Skip to content

Commit

Permalink
added slot and quantic sort option component
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonMilord committed Jun 17, 2024
1 parent fe412e0 commit b8c10fe
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
</c-quantic-component-error>
</template>
<template lwc:else>
<slot><!-- Custom sort options --></slot>
<template if:true={hasResults}>
<div class="sort__container">
<lightning-layout-item class="sort__header slds-var-p-right_small">
Expand All @@ -13,7 +14,7 @@
<lightning-combobox name="sort" value={value} variant="label-hidden" label={labels.sortBy} placeholder={labels.relevancy} options={options} onchange={handleChange}>
</lightning-combobox>
</lightning-layout-item>
</div>
</div>
</template>
</template>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<template>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import {LightningElement, api} from 'lwc';

/** @typedef {import("coveo").SortCriterion} SortCriterion */

/**
* @typedef SortOption
* @property {string} label
* @property {string} value
* @property {SortCriterion} criterion
*/

/**
* The `QuanticSortOption` component defines a sort option for a `c-quantic-sort` component.
* It must therefore be defined within a `c-quantic-sort` component.
*
* A sort option is a criterion that the end user can select to sort the query results.
* @category Search
* @category Insight Panel
* @example
* <c-quantic-sort-option></c-quantic-sort-option>
*/
export default class QuanticSortOption extends LightningElement {
/**
* The label of the sort option.
* @api
* @type {string}
*/
@api label;
/**
* The value of the sort option.
* @api
* @type {string}
*/
@api value;
/**
* The criterion to use when sorting query results.
* @api
* @type {SortCriterion}
*/
@api criterion;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<isExposed>false</isExposed>
</LightningComponentBundle>

0 comments on commit b8c10fe

Please sign in to comment.