@searchcraft/vue-sdk 0.13.1 → 0.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/index.d.ts +109 -0
- package/dist/index.es.js +3364 -2718
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +34 -33
- package/dist/index.umd.js.map +1 -1
- package/dist/themes/hologram.css +1 -1
- package/dist/themes/hologram.css.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -147,8 +147,9 @@ export const filterPanelItems = [
|
|
|
147
147
|
field: 'section',
|
|
148
148
|
label: 'Filter by Section',
|
|
149
149
|
options: {
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
showSublevel: false,
|
|
151
|
+
initialCollapseState: 'open', // 'open' or 'closed' - controls if section starts expanded or collapsed
|
|
152
|
+
viewMoreThreshold: 8, // Number of facets to show before "view more" link appears (0 = show all)
|
|
152
153
|
},
|
|
153
154
|
},
|
|
154
155
|
];
|
package/dist/index.d.ts
CHANGED
|
@@ -184,6 +184,19 @@ export interface FacetsFilterItem extends FilterItem {
|
|
|
184
184
|
options: {
|
|
185
185
|
showSublevel: boolean;
|
|
186
186
|
exclude?: string[];
|
|
187
|
+
/**
|
|
188
|
+
* Initial collapse state of the facet section.
|
|
189
|
+
* - 'open': Section is expanded by default
|
|
190
|
+
* - 'closed': Section is collapsed by default
|
|
191
|
+
* @default 'open'
|
|
192
|
+
*/
|
|
193
|
+
initialCollapseState?: "open" | "closed";
|
|
194
|
+
/**
|
|
195
|
+
* The number of facets to show before displaying a "view more" link.
|
|
196
|
+
* Set to 0 to show all facets without a "view more" link.
|
|
197
|
+
* @default 8
|
|
198
|
+
*/
|
|
199
|
+
viewMoreThreshold?: number;
|
|
187
200
|
};
|
|
188
201
|
}
|
|
189
202
|
export interface NumericFilterItem extends FilterItem {
|
|
@@ -837,7 +850,19 @@ export namespace Components {
|
|
|
837
850
|
* It is consumed within the `searchcraft-filter-panel`.
|
|
838
851
|
* @js-example ```html
|
|
839
852
|
* <!-- index.html -->
|
|
853
|
+
* <!-- Basic usage -->
|
|
840
854
|
* <searchcraft-facet-list field-name="title" />
|
|
855
|
+
* <!-- With collapsible section (initially closed) and view more threshold -->
|
|
856
|
+
* <searchcraft-facet-list
|
|
857
|
+
* field-name="category"
|
|
858
|
+
* initial-collapse-state="closed"
|
|
859
|
+
* view-more-threshold="5"
|
|
860
|
+
* />
|
|
861
|
+
* <!-- Show all facets without "view more" link -->
|
|
862
|
+
* <searchcraft-facet-list
|
|
863
|
+
* field-name="brand"
|
|
864
|
+
* view-more-threshold="0"
|
|
865
|
+
* />
|
|
841
866
|
* ```
|
|
842
867
|
* ```js
|
|
843
868
|
* // index.js
|
|
@@ -845,6 +870,8 @@ export namespace Components {
|
|
|
845
870
|
* facetList.addEventListener('facetSelectionUpdated', () => {
|
|
846
871
|
* console.log('Facet selection updated');
|
|
847
872
|
* });
|
|
873
|
+
* // Programmatically toggle collapse state
|
|
874
|
+
* await facetList.handleCollapseToggle();
|
|
848
875
|
* ```
|
|
849
876
|
*/
|
|
850
877
|
interface SearchcraftFacetList {
|
|
@@ -857,10 +884,30 @@ export namespace Components {
|
|
|
857
884
|
* @default ''
|
|
858
885
|
*/
|
|
859
886
|
"fieldName": string;
|
|
887
|
+
/**
|
|
888
|
+
* Returns whether the facet section is currently collapsed.
|
|
889
|
+
* @returns A promise that resolves to true if collapsed, false if expanded.
|
|
890
|
+
*/
|
|
891
|
+
"getIsCollapsed": () => Promise<boolean>;
|
|
892
|
+
/**
|
|
893
|
+
* Toggles the collapsed state of the facet section.
|
|
894
|
+
* @returns A promise that resolves when the toggle is complete.
|
|
895
|
+
*/
|
|
896
|
+
"handleCollapseToggle": () => Promise<void>;
|
|
897
|
+
/**
|
|
898
|
+
* Initial collapse state of the facet section.
|
|
899
|
+
* @default 'open'
|
|
900
|
+
*/
|
|
901
|
+
"initialCollapseState"?: "open" | "closed";
|
|
860
902
|
/**
|
|
861
903
|
* The id of the Searchcraft instance that this component should use.
|
|
862
904
|
*/
|
|
863
905
|
"searchcraftId"?: string;
|
|
906
|
+
/**
|
|
907
|
+
* The number of facets to show before displaying a "view more" link. Set to 0 to show all facets without a "view more" link.
|
|
908
|
+
* @default 8
|
|
909
|
+
*/
|
|
910
|
+
"viewMoreThreshold"?: number;
|
|
864
911
|
}
|
|
865
912
|
/**
|
|
866
913
|
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
@@ -1007,6 +1054,11 @@ export namespace Components {
|
|
|
1007
1054
|
* ```
|
|
1008
1055
|
*/
|
|
1009
1056
|
interface SearchcraftPagination {
|
|
1057
|
+
/**
|
|
1058
|
+
* Whether to scroll to the top of the search results when pagination buttons are clicked.
|
|
1059
|
+
* @default true
|
|
1060
|
+
*/
|
|
1061
|
+
"scrollToTop"?: boolean;
|
|
1010
1062
|
/**
|
|
1011
1063
|
* The id of the Searchcraft instance that this component should use.
|
|
1012
1064
|
*/
|
|
@@ -1542,7 +1594,19 @@ declare global {
|
|
|
1542
1594
|
* It is consumed within the `searchcraft-filter-panel`.
|
|
1543
1595
|
* @js-example ```html
|
|
1544
1596
|
* <!-- index.html -->
|
|
1597
|
+
* <!-- Basic usage -->
|
|
1545
1598
|
* <searchcraft-facet-list field-name="title" />
|
|
1599
|
+
* <!-- With collapsible section (initially closed) and view more threshold -->
|
|
1600
|
+
* <searchcraft-facet-list
|
|
1601
|
+
* field-name="category"
|
|
1602
|
+
* initial-collapse-state="closed"
|
|
1603
|
+
* view-more-threshold="5"
|
|
1604
|
+
* />
|
|
1605
|
+
* <!-- Show all facets without "view more" link -->
|
|
1606
|
+
* <searchcraft-facet-list
|
|
1607
|
+
* field-name="brand"
|
|
1608
|
+
* view-more-threshold="0"
|
|
1609
|
+
* />
|
|
1546
1610
|
* ```
|
|
1547
1611
|
* ```js
|
|
1548
1612
|
* // index.js
|
|
@@ -1550,6 +1614,8 @@ declare global {
|
|
|
1550
1614
|
* facetList.addEventListener('facetSelectionUpdated', () => {
|
|
1551
1615
|
* console.log('Facet selection updated');
|
|
1552
1616
|
* });
|
|
1617
|
+
* // Programmatically toggle collapse state
|
|
1618
|
+
* await facetList.handleCollapseToggle();
|
|
1553
1619
|
* ```
|
|
1554
1620
|
*/
|
|
1555
1621
|
interface HTMLSearchcraftFacetListElement extends Components.SearchcraftFacetList, HTMLStencilElement {
|
|
@@ -2133,7 +2199,19 @@ declare namespace LocalJSX {
|
|
|
2133
2199
|
* It is consumed within the `searchcraft-filter-panel`.
|
|
2134
2200
|
* @js-example ```html
|
|
2135
2201
|
* <!-- index.html -->
|
|
2202
|
+
* <!-- Basic usage -->
|
|
2136
2203
|
* <searchcraft-facet-list field-name="title" />
|
|
2204
|
+
* <!-- With collapsible section (initially closed) and view more threshold -->
|
|
2205
|
+
* <searchcraft-facet-list
|
|
2206
|
+
* field-name="category"
|
|
2207
|
+
* initial-collapse-state="closed"
|
|
2208
|
+
* view-more-threshold="5"
|
|
2209
|
+
* />
|
|
2210
|
+
* <!-- Show all facets without "view more" link -->
|
|
2211
|
+
* <searchcraft-facet-list
|
|
2212
|
+
* field-name="brand"
|
|
2213
|
+
* view-more-threshold="0"
|
|
2214
|
+
* />
|
|
2137
2215
|
* ```
|
|
2138
2216
|
* ```js
|
|
2139
2217
|
* // index.js
|
|
@@ -2141,6 +2219,8 @@ declare namespace LocalJSX {
|
|
|
2141
2219
|
* facetList.addEventListener('facetSelectionUpdated', () => {
|
|
2142
2220
|
* console.log('Facet selection updated');
|
|
2143
2221
|
* });
|
|
2222
|
+
* // Programmatically toggle collapse state
|
|
2223
|
+
* await facetList.handleCollapseToggle();
|
|
2144
2224
|
* ```
|
|
2145
2225
|
*/
|
|
2146
2226
|
interface SearchcraftFacetList {
|
|
@@ -2153,6 +2233,11 @@ declare namespace LocalJSX {
|
|
|
2153
2233
|
* @default ''
|
|
2154
2234
|
*/
|
|
2155
2235
|
"fieldName"?: string;
|
|
2236
|
+
/**
|
|
2237
|
+
* Initial collapse state of the facet section.
|
|
2238
|
+
* @default 'open'
|
|
2239
|
+
*/
|
|
2240
|
+
"initialCollapseState"?: "open" | "closed";
|
|
2156
2241
|
/**
|
|
2157
2242
|
* Emitted when the facets are updated.
|
|
2158
2243
|
*/
|
|
@@ -2163,6 +2248,11 @@ declare namespace LocalJSX {
|
|
|
2163
2248
|
* The id of the Searchcraft instance that this component should use.
|
|
2164
2249
|
*/
|
|
2165
2250
|
"searchcraftId"?: string;
|
|
2251
|
+
/**
|
|
2252
|
+
* The number of facets to show before displaying a "view more" link. Set to 0 to show all facets without a "view more" link.
|
|
2253
|
+
* @default 8
|
|
2254
|
+
*/
|
|
2255
|
+
"viewMoreThreshold"?: number;
|
|
2166
2256
|
}
|
|
2167
2257
|
/**
|
|
2168
2258
|
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
@@ -2321,6 +2411,11 @@ declare namespace LocalJSX {
|
|
|
2321
2411
|
* ```
|
|
2322
2412
|
*/
|
|
2323
2413
|
interface SearchcraftPagination {
|
|
2414
|
+
/**
|
|
2415
|
+
* Whether to scroll to the top of the search results when pagination buttons are clicked.
|
|
2416
|
+
* @default true
|
|
2417
|
+
*/
|
|
2418
|
+
"scrollToTop"?: boolean;
|
|
2324
2419
|
/**
|
|
2325
2420
|
* The id of the Searchcraft instance that this component should use.
|
|
2326
2421
|
*/
|
|
@@ -2840,7 +2935,19 @@ declare module "@stencil/core" {
|
|
|
2840
2935
|
* It is consumed within the `searchcraft-filter-panel`.
|
|
2841
2936
|
* @js-example ```html
|
|
2842
2937
|
* <!-- index.html -->
|
|
2938
|
+
* <!-- Basic usage -->
|
|
2843
2939
|
* <searchcraft-facet-list field-name="title" />
|
|
2940
|
+
* <!-- With collapsible section (initially closed) and view more threshold -->
|
|
2941
|
+
* <searchcraft-facet-list
|
|
2942
|
+
* field-name="category"
|
|
2943
|
+
* initial-collapse-state="closed"
|
|
2944
|
+
* view-more-threshold="5"
|
|
2945
|
+
* />
|
|
2946
|
+
* <!-- Show all facets without "view more" link -->
|
|
2947
|
+
* <searchcraft-facet-list
|
|
2948
|
+
* field-name="brand"
|
|
2949
|
+
* view-more-threshold="0"
|
|
2950
|
+
* />
|
|
2844
2951
|
* ```
|
|
2845
2952
|
* ```js
|
|
2846
2953
|
* // index.js
|
|
@@ -2848,6 +2955,8 @@ declare module "@stencil/core" {
|
|
|
2848
2955
|
* facetList.addEventListener('facetSelectionUpdated', () => {
|
|
2849
2956
|
* console.log('Facet selection updated');
|
|
2850
2957
|
* });
|
|
2958
|
+
* // Programmatically toggle collapse state
|
|
2959
|
+
* await facetList.handleCollapseToggle();
|
|
2851
2960
|
* ```
|
|
2852
2961
|
*/
|
|
2853
2962
|
"searchcraft-facet-list": LocalJSX.SearchcraftFacetList & JSXBase.HTMLAttributes<HTMLSearchcraftFacetListElement>;
|