@cscfi/csc-ui 4.0.0-alpha.0 → 4.0.0-alpha.1
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/dist/csc-ui.js +4931 -4959
- package/dist/custom-elements.json +29 -3
- package/dist/docs/c-autocomplete/usage.md +28 -2
- package/dist/vscode.css-custom-data.json +1 -1
- package/dist/vscode.html-custom-data.json +6 -1
- package/dist/web-types.json +24 -4
- package/dist-types/components/c-autocomplete/CAutocomplete.vue.d.ts +8 -1
- package/dist-types/components/c-data-table/CDataTable.vue.d.ts +1 -1
- package/dist-types/components/c-dropdown/CDropdown.vue.d.ts +0 -1
- package/dist-types/tag-name-map.d.ts +15 -3
- package/package.json +1 -1
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"owner": "c-autocomplete"
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
|
-
"declaration": "export interface CAutocompleteProps {\n /** Make the selected value clearable */\n clearable?: boolean;\n /** Disable the input */\n disabled?: boolean;\n /**\n * Error message shown in place of the hint while the autocomplete is invalid\n *\n * @freeform\n */\n errorMessage?: string;\n /** Custom filter predicate; receives a normalized option + the query */\n filter?: CAutocompleteFilter;\n /** Hide the hint and error messages */\n hideDetails?: boolean;\n /**\n * Hint text for the input\n *\n * @freeform\n */\n hint?: string;\n /**\n * Id of the element\n *\n * @freeform\n */\n hostId?: string;\n /** Dropdown items (when not using <c-option> elements) */\n items?: CAutocompleteItem[];\n /** Items per page before the list scrolls */\n itemsPerPage?: number;\n /**\n * Element label\n *\n * @freeform\n */\n label?: string;\n /** Label on top of the input */\n labelOnTop?: boolean;\n /** Show loading state */\n loading?: boolean;\n /**\n * Input field name\n *\n * @freeform\n */\n name?: string;\n /**\n * Message shown when the query matches no options\n *\n * @freeform\n */\n noResultsText?: string;\n /**\n * Placeholder for the in-panel search input\n *\n * @freeform\n */\n placeholder?: string;\n /** Set the autocomplete as required */\n required?: boolean;\n /** Return object instead of value */\n returnObject?: boolean;\n /** Shadow variant */\n shadow?: boolean;\n /** Set the validity of the input */\n valid?: boolean;\n /** Selected value (scalar, or object when return-object is set) */\n value?: CAutocompleteItem | null | number | string;\n}",
|
|
66
|
+
"declaration": "export interface CAutocompleteProps {\n /** Make the selected value clearable */\n clearable?: boolean;\n /** Disable the input */\n disabled?: boolean;\n /**\n * Error message shown in place of the hint while the autocomplete is invalid\n *\n * @freeform\n */\n errorMessage?: string;\n /**\n * The consumer owns filtering: the component renders its options verbatim\n * and only emits `change:query` as the user types. Pair with `loading` and\n * an async data source feeding `items`\n */\n external?: boolean;\n /** Custom filter predicate; receives a normalized option + the query. Ignored when `external` is set */\n filter?: CAutocompleteFilter;\n /** Hide the hint and error messages */\n hideDetails?: boolean;\n /**\n * Hint text for the input\n *\n * @freeform\n */\n hint?: string;\n /**\n * Id of the element\n *\n * @freeform\n */\n hostId?: string;\n /** Dropdown items (when not using <c-option> elements) */\n items?: CAutocompleteItem[];\n /** Items per page before the list scrolls */\n itemsPerPage?: number;\n /**\n * Element label\n *\n * @freeform\n */\n label?: string;\n /** Label on top of the input */\n labelOnTop?: boolean;\n /** Show loading state */\n loading?: boolean;\n /**\n * Input field name\n *\n * @freeform\n */\n name?: string;\n /**\n * Message shown when the query matches no options\n *\n * @freeform\n */\n noResultsText?: string;\n /**\n * Placeholder for the in-panel search input\n *\n * @freeform\n */\n placeholder?: string;\n /** Set the autocomplete as required */\n required?: boolean;\n /** Return object instead of value */\n returnObject?: boolean;\n /** Shadow variant */\n shadow?: boolean;\n /** Set the validity of the input */\n valid?: boolean;\n /** Selected value (scalar, or object when return-object is set) */\n value?: CAutocompleteItem | null | number | string;\n}",
|
|
67
67
|
"description": "",
|
|
68
68
|
"kind": "interface",
|
|
69
69
|
"name": "CAutocompleteProps",
|
|
@@ -877,6 +877,15 @@
|
|
|
877
877
|
"freeform": true
|
|
878
878
|
}
|
|
879
879
|
},
|
|
880
|
+
{
|
|
881
|
+
"fieldName": "external",
|
|
882
|
+
"name": "external",
|
|
883
|
+
"description": "The consumer owns filtering: the component renders its options verbatim\nand only emits `change:query` as the user types. Pair with `loading` and\nan async data source feeding `items`",
|
|
884
|
+
"type": {
|
|
885
|
+
"text": "boolean"
|
|
886
|
+
},
|
|
887
|
+
"default": "false"
|
|
888
|
+
},
|
|
880
889
|
{
|
|
881
890
|
"fieldName": "hideDetails",
|
|
882
891
|
"name": "hide-details",
|
|
@@ -1050,7 +1059,7 @@
|
|
|
1050
1059
|
},
|
|
1051
1060
|
{
|
|
1052
1061
|
"name": "info",
|
|
1053
|
-
"description": "The no-results
|
|
1062
|
+
"description": "The info row: loading while `loading` with an empty list, otherwise no-results when the query matches no options"
|
|
1054
1063
|
}
|
|
1055
1064
|
],
|
|
1056
1065
|
"cssProperties": [],
|
|
@@ -1062,6 +1071,13 @@
|
|
|
1062
1071
|
},
|
|
1063
1072
|
"description": "Native change event (no detail) dispatched whenever a selection is\ncommitted or cleared; bubbles through the shadow boundary for\nform-style listeners."
|
|
1064
1073
|
},
|
|
1074
|
+
{
|
|
1075
|
+
"name": "change:query",
|
|
1076
|
+
"type": {
|
|
1077
|
+
"text": "CustomEvent<string>"
|
|
1078
|
+
},
|
|
1079
|
+
"description": "Fired whenever the query changes — on every keystroke in the search\ninput, and with an empty string when the panel opens. Carries the query\nstring. With `external`, drive your data source from this (debounce on\nyour side) and feed the results back via `items`."
|
|
1080
|
+
},
|
|
1065
1081
|
{
|
|
1066
1082
|
"name": "changeValue",
|
|
1067
1083
|
"type": {
|
|
@@ -1118,11 +1134,21 @@
|
|
|
1118
1134
|
"freeform": true
|
|
1119
1135
|
}
|
|
1120
1136
|
},
|
|
1137
|
+
{
|
|
1138
|
+
"kind": "field",
|
|
1139
|
+
"name": "external",
|
|
1140
|
+
"privacy": "public",
|
|
1141
|
+
"description": "The consumer owns filtering: the component renders its options verbatim\nand only emits `change:query` as the user types. Pair with `loading` and\nan async data source feeding `items`",
|
|
1142
|
+
"type": {
|
|
1143
|
+
"text": "boolean"
|
|
1144
|
+
},
|
|
1145
|
+
"default": "false"
|
|
1146
|
+
},
|
|
1121
1147
|
{
|
|
1122
1148
|
"kind": "field",
|
|
1123
1149
|
"name": "filter",
|
|
1124
1150
|
"privacy": "public",
|
|
1125
|
-
"description": "Custom filter predicate; receives a normalized option + the query",
|
|
1151
|
+
"description": "Custom filter predicate; receives a normalized option + the query. Ignored when `external` is set",
|
|
1126
1152
|
"type": {
|
|
1127
1153
|
"text": "CAutocompleteFilter"
|
|
1128
1154
|
}
|
|
@@ -1,2 +1,28 @@
|
|
|
1
|
-
A filterable value-selection component: a readonly value field that opens a
|
|
2
|
-
|
|
1
|
+
A filterable value-selection component: a readonly value field that opens a popover panel with a search input above the matching options.
|
|
2
|
+
|
|
3
|
+
## Filtering
|
|
4
|
+
|
|
5
|
+
By default the component filters its options itself: the query typed into the
|
|
6
|
+
search input is matched against the start of each option's label. Supply a
|
|
7
|
+
`filter` predicate to change the matching — it receives the normalized option
|
|
8
|
+
and the query, and keeps the option when it returns `true` (see the
|
|
9
|
+
custom-filter example). Because `filter` is a function, it must be bound as a
|
|
10
|
+
DOM property, not an attribute.
|
|
11
|
+
|
|
12
|
+
## External data
|
|
13
|
+
|
|
14
|
+
Set `external` to hand filtering to your own code — for example a server
|
|
15
|
+
search endpoint. The component then renders `items` verbatim and emits a
|
|
16
|
+
`change:query` event carrying the query string: on every keystroke, and with
|
|
17
|
+
an empty string when the panel opens (use that to load the initial,
|
|
18
|
+
unfiltered list). Set `loading` while a request is in flight; the panel shows
|
|
19
|
+
a loading row when there is nothing to display yet and keeps the current
|
|
20
|
+
options on screen during a refresh.
|
|
21
|
+
|
|
22
|
+
The component ships no debounce and no minimum query length — debounce the
|
|
23
|
+
requests in your handler and skip fetches for too-short queries yourself (see
|
|
24
|
+
the external example). The closed field keeps showing the selected option's
|
|
25
|
+
label even when a later fetch no longer includes it: the label is remembered
|
|
26
|
+
when the option is committed, and a programmatically set value resolves its
|
|
27
|
+
label from the current options, or from the object's `name` when
|
|
28
|
+
`return-object` is used.
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
{ "name": "::part(list)", "description": "The scrollable options listbox" },
|
|
57
57
|
{
|
|
58
58
|
"name": "::part(info)",
|
|
59
|
-
"description": "The no-results
|
|
59
|
+
"description": "The info row: loading while `loading` with an empty list, otherwise no-results when the query matches no options"
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
"name": "::part(root)",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
"name": "c-autocomplete",
|
|
79
|
-
"description": "A filterable value-selection component: a readonly value field that opens a popover panel with a search input above the matching options.\n---\n\n\n### **Events:**\n - **change** - Native change event (no detail) dispatched whenever a selection is\ncommitted or cleared; bubbles through the shadow boundary for\nform-style listeners.\n- **changeValue** - Fired when the selected value changes (an option is committed or the\nselection is cleared), carrying the new value — the option's value, or\nthe whole `{ name, value }` item when `return-object` is set; `null`\nwhen cleared. Also dispatched as `change-value` — bind that name in Vue templates.\n- **input** - Native bubbling input event dispatched alongside every value change so a\nplain `v-model` stays in sync. Carries no detail.\n- **update:value** - Fired alongside `changeValue` with the same detail — the `v-model`\ncontract.\n\n### **Methods:**\n - **reset()** - Reset autocomplete state\n\n### **Slots:**\n - **pre** - Content placed before the value field inside the input row\n- **default** - The c-option elements used as the data source (never rendered in place)\n- **post** - Content placed after the value field inside the input row\n\n### **CSS Parts:**\n - **panel** - The top-layer popover container anchored below the field\n- **card** - The elevated surface inside the panel holding the search row and the list\n- **search** - The search-input row at the top of the panel\n- **list** - The scrollable options listbox\n- **info** - The no-results
|
|
79
|
+
"description": "A filterable value-selection component: a readonly value field that opens a popover panel with a search input above the matching options.\n---\n\n\n### **Events:**\n - **change** - Native change event (no detail) dispatched whenever a selection is\ncommitted or cleared; bubbles through the shadow boundary for\nform-style listeners.\n- **change:query** - Fired whenever the query changes — on every keystroke in the search\ninput, and with an empty string when the panel opens. Carries the query\nstring. With `external`, drive your data source from this (debounce on\nyour side) and feed the results back via `items`.\n- **changeValue** - Fired when the selected value changes (an option is committed or the\nselection is cleared), carrying the new value — the option's value, or\nthe whole `{ name, value }` item when `return-object` is set; `null`\nwhen cleared. Also dispatched as `change-value` — bind that name in Vue templates.\n- **input** - Native bubbling input event dispatched alongside every value change so a\nplain `v-model` stays in sync. Carries no detail.\n- **update:value** - Fired alongside `changeValue` with the same detail — the `v-model`\ncontract.\n\n### **Methods:**\n - **reset()** - Reset autocomplete state\n\n### **Slots:**\n - **pre** - Content placed before the value field inside the input row\n- **default** - The c-option elements used as the data source (never rendered in place)\n- **post** - Content placed after the value field inside the input row\n\n### **CSS Parts:**\n - **panel** - The top-layer popover container anchored below the field\n- **card** - The elevated surface inside the panel holding the search row and the list\n- **search** - The search-input row at the top of the panel\n- **list** - The scrollable options listbox\n- **info** - The info row: loading while `loading` with an empty list, otherwise no-results when the query matches no options",
|
|
80
80
|
"attributes": [
|
|
81
81
|
{
|
|
82
82
|
"name": "clearable",
|
|
@@ -93,6 +93,11 @@
|
|
|
93
93
|
"description": "Error message shown in place of the hint while the autocomplete is invalid",
|
|
94
94
|
"values": []
|
|
95
95
|
},
|
|
96
|
+
{
|
|
97
|
+
"name": "external",
|
|
98
|
+
"description": "The consumer owns filtering: the component renders its options verbatim\nand only emits `change:query` as the user types. Pair with `loading` and\nan async data source feeding `items`",
|
|
99
|
+
"values": []
|
|
100
|
+
},
|
|
96
101
|
{
|
|
97
102
|
"name": "hide-details",
|
|
98
103
|
"description": "Hide the hint and error messages",
|
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@cscfi/csc-ui",
|
|
4
|
-
"version": "4.0.0-alpha.
|
|
4
|
+
"version": "4.0.0-alpha.1",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
},
|
|
218
218
|
{
|
|
219
219
|
"name": "c-autocomplete",
|
|
220
|
-
"description": "A filterable value-selection component: a readonly value field that opens a popover panel with a search input above the matching options.\n---\n\n\n### **Events:**\n - **change** - Native change event (no detail) dispatched whenever a selection is\ncommitted or cleared; bubbles through the shadow boundary for\nform-style listeners.\n- **changeValue** - Fired when the selected value changes (an option is committed or the\nselection is cleared), carrying the new value — the option's value, or\nthe whole `{ name, value }` item when `return-object` is set; `null`\nwhen cleared. Also dispatched as `change-value` — bind that name in Vue templates.\n- **input** - Native bubbling input event dispatched alongside every value change so a\nplain `v-model` stays in sync. Carries no detail.\n- **update:value** - Fired alongside `changeValue` with the same detail — the `v-model`\ncontract.\n\n### **Methods:**\n - **reset()** - Reset autocomplete state\n\n### **Slots:**\n - **pre** - Content placed before the value field inside the input row\n- **default** - The c-option elements used as the data source (never rendered in place)\n- **post** - Content placed after the value field inside the input row\n\n### **CSS Parts:**\n - **panel** - The top-layer popover container anchored below the field\n- **card** - The elevated surface inside the panel holding the search row and the list\n- **search** - The search-input row at the top of the panel\n- **list** - The scrollable options listbox\n- **info** - The no-results
|
|
220
|
+
"description": "A filterable value-selection component: a readonly value field that opens a popover panel with a search input above the matching options.\n---\n\n\n### **Events:**\n - **change** - Native change event (no detail) dispatched whenever a selection is\ncommitted or cleared; bubbles through the shadow boundary for\nform-style listeners.\n- **change:query** - Fired whenever the query changes — on every keystroke in the search\ninput, and with an empty string when the panel opens. Carries the query\nstring. With `external`, drive your data source from this (debounce on\nyour side) and feed the results back via `items`.\n- **changeValue** - Fired when the selected value changes (an option is committed or the\nselection is cleared), carrying the new value — the option's value, or\nthe whole `{ name, value }` item when `return-object` is set; `null`\nwhen cleared. Also dispatched as `change-value` — bind that name in Vue templates.\n- **input** - Native bubbling input event dispatched alongside every value change so a\nplain `v-model` stays in sync. Carries no detail.\n- **update:value** - Fired alongside `changeValue` with the same detail — the `v-model`\ncontract.\n\n### **Methods:**\n - **reset()** - Reset autocomplete state\n\n### **Slots:**\n - **pre** - Content placed before the value field inside the input row\n- **default** - The c-option elements used as the data source (never rendered in place)\n- **post** - Content placed after the value field inside the input row\n\n### **CSS Parts:**\n - **panel** - The top-layer popover container anchored below the field\n- **card** - The elevated surface inside the panel holding the search row and the list\n- **search** - The search-input row at the top of the panel\n- **list** - The scrollable options listbox\n- **info** - The info row: loading while `loading` with an empty list, otherwise no-results when the query matches no options",
|
|
221
221
|
"doc-url": "",
|
|
222
222
|
"attributes": [
|
|
223
223
|
{
|
|
@@ -235,6 +235,11 @@
|
|
|
235
235
|
"description": "Error message shown in place of the hint while the autocomplete is invalid",
|
|
236
236
|
"value": { "type": "string", "default": "''" }
|
|
237
237
|
},
|
|
238
|
+
{
|
|
239
|
+
"name": "external",
|
|
240
|
+
"description": "The consumer owns filtering: the component renders its options verbatim\nand only emits `change:query` as the user types. Pair with `loading` and\nan async data source feeding `items`",
|
|
241
|
+
"value": { "type": "boolean", "default": "false" }
|
|
242
|
+
},
|
|
238
243
|
{
|
|
239
244
|
"name": "hide-details",
|
|
240
245
|
"description": "Hide the hint and error messages",
|
|
@@ -334,6 +339,11 @@
|
|
|
334
339
|
"type": "CustomEvent<void>",
|
|
335
340
|
"description": "Native change event (no detail) dispatched whenever a selection is\ncommitted or cleared; bubbles through the shadow boundary for\nform-style listeners."
|
|
336
341
|
},
|
|
342
|
+
{
|
|
343
|
+
"name": "change:query",
|
|
344
|
+
"type": "CustomEvent<string>",
|
|
345
|
+
"description": "Fired whenever the query changes — on every keystroke in the search\ninput, and with an empty string when the panel opens. Carries the query\nstring. With `external`, drive your data source from this (debounce on\nyour side) and feed the results back via `items`."
|
|
346
|
+
},
|
|
337
347
|
{
|
|
338
348
|
"name": "changeValue",
|
|
339
349
|
"type": "CustomEvent<CAutocompleteItem | null | number | string>",
|
|
@@ -367,9 +377,14 @@
|
|
|
367
377
|
"description": "Error message shown in place of the hint while the autocomplete is invalid",
|
|
368
378
|
"type": "string"
|
|
369
379
|
},
|
|
380
|
+
{
|
|
381
|
+
"name": "external",
|
|
382
|
+
"description": "The consumer owns filtering: the component renders its options verbatim\nand only emits `change:query` as the user types. Pair with `loading` and\nan async data source feeding `items`",
|
|
383
|
+
"type": "boolean"
|
|
384
|
+
},
|
|
370
385
|
{
|
|
371
386
|
"name": "filter",
|
|
372
|
-
"description": "Custom filter predicate; receives a normalized option + the query",
|
|
387
|
+
"description": "Custom filter predicate; receives a normalized option + the query. Ignored when `external` is set",
|
|
373
388
|
"type": "CAutocompleteFilter"
|
|
374
389
|
},
|
|
375
390
|
{
|
|
@@ -459,6 +474,11 @@
|
|
|
459
474
|
"type": "CustomEvent<void>",
|
|
460
475
|
"description": "Native change event (no detail) dispatched whenever a selection is\ncommitted or cleared; bubbles through the shadow boundary for\nform-style listeners."
|
|
461
476
|
},
|
|
477
|
+
{
|
|
478
|
+
"name": "change:query",
|
|
479
|
+
"type": "CustomEvent<string>",
|
|
480
|
+
"description": "Fired whenever the query changes — on every keystroke in the search\ninput, and with an empty string when the panel opens. Carries the query\nstring. With `external`, drive your data source from this (debounce on\nyour side) and feed the results back via `items`."
|
|
481
|
+
},
|
|
462
482
|
{
|
|
463
483
|
"name": "changeValue",
|
|
464
484
|
"type": "CustomEvent<CAutocompleteItem | null | number | string>",
|
|
@@ -5146,7 +5166,7 @@
|
|
|
5146
5166
|
},
|
|
5147
5167
|
{
|
|
5148
5168
|
"name": "part(info)",
|
|
5149
|
-
"description": "The no-results
|
|
5169
|
+
"description": "The info row: loading while `loading` with an empty list, otherwise no-results when the query matches no options"
|
|
5150
5170
|
},
|
|
5151
5171
|
{
|
|
5152
5172
|
"name": "part(root)",
|
|
@@ -33,7 +33,13 @@ export interface CAutocompleteProps {
|
|
|
33
33
|
* @freeform
|
|
34
34
|
*/
|
|
35
35
|
errorMessage?: string;
|
|
36
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* The consumer owns filtering: the component renders its options verbatim
|
|
38
|
+
* and only emits `change:query` as the user types. Pair with `loading` and
|
|
39
|
+
* an async data source feeding `items`
|
|
40
|
+
*/
|
|
41
|
+
external?: boolean;
|
|
42
|
+
/** Custom filter predicate; receives a normalized option + the query. Ignored when `external` is set */
|
|
37
43
|
filter?: CAutocompleteFilter;
|
|
38
44
|
/** Hide the hint and error messages */
|
|
39
45
|
hideDetails?: boolean;
|
|
@@ -104,6 +110,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CAutoc
|
|
|
104
110
|
clearable: boolean;
|
|
105
111
|
disabled: boolean;
|
|
106
112
|
errorMessage: string;
|
|
113
|
+
external: boolean;
|
|
107
114
|
hideDetails: boolean;
|
|
108
115
|
hint: string;
|
|
109
116
|
hostId: string;
|
|
@@ -194,11 +194,11 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CDataT
|
|
|
194
194
|
filter: string;
|
|
195
195
|
expanded: string[];
|
|
196
196
|
sort: CDataTableSort | null;
|
|
197
|
+
external: boolean;
|
|
197
198
|
loading: boolean;
|
|
198
199
|
autohide: boolean;
|
|
199
200
|
columns: CDataTableColumn[];
|
|
200
201
|
expandedContent: (context: CDataTableExpandedContext) => CDataTableCellContent;
|
|
201
|
-
external: boolean;
|
|
202
202
|
getRowId: (row: CDataTableRow) => string;
|
|
203
203
|
itemCount: number;
|
|
204
204
|
page: number;
|
|
@@ -18,7 +18,6 @@ type DropdownItem = {
|
|
|
18
18
|
disabled?: boolean;
|
|
19
19
|
name: string;
|
|
20
20
|
outerHTML?: string;
|
|
21
|
-
querySelector?: (s: string) => Element | null;
|
|
22
21
|
selected?: boolean;
|
|
23
22
|
value: number | string;
|
|
24
23
|
};
|
|
@@ -105,6 +104,13 @@ export interface CAutocompleteElementEventMap {
|
|
|
105
104
|
* form-style listeners.
|
|
106
105
|
*/
|
|
107
106
|
change: CustomEvent<void>;
|
|
107
|
+
/**
|
|
108
|
+
* Fired whenever the query changes — on every keystroke in the search
|
|
109
|
+
* input, and with an empty string when the panel opens. Carries the query
|
|
110
|
+
* string. With `external`, drive your data source from this (debounce on
|
|
111
|
+
* your side) and feed the results back via `items`.
|
|
112
|
+
*/
|
|
113
|
+
'change:query': CustomEvent<string>;
|
|
108
114
|
/**
|
|
109
115
|
* Fired when the selected value changes (an option is committed or the
|
|
110
116
|
* selection is cleared), carrying the new value — the option's value, or
|
|
@@ -124,14 +130,20 @@ export interface CAutocompleteElementEventMap {
|
|
|
124
130
|
'update:value': CustomEvent<CAutocompleteItem | null | number | string>;
|
|
125
131
|
}
|
|
126
132
|
/** A filterable value-selection component: a readonly value field that opens a popover panel with a search input above the matching options. */
|
|
127
|
-
export interface CAutocompleteElement extends Omit<HTMLElement, 'clearable' | 'disabled' | 'errorMessage' | 'filter' | 'hideDetails' | 'hint' | 'hostId' | 'items' | 'itemsPerPage' | 'label' | 'labelOnTop' | 'loading' | 'name' | 'noResultsText' | 'placeholder' | 'required' | 'returnObject' | 'shadow' | 'valid' | 'value'> {
|
|
133
|
+
export interface CAutocompleteElement extends Omit<HTMLElement, 'clearable' | 'disabled' | 'errorMessage' | 'external' | 'filter' | 'hideDetails' | 'hint' | 'hostId' | 'items' | 'itemsPerPage' | 'label' | 'labelOnTop' | 'loading' | 'name' | 'noResultsText' | 'placeholder' | 'required' | 'returnObject' | 'shadow' | 'valid' | 'value'> {
|
|
128
134
|
/** Make the selected value clearable */
|
|
129
135
|
clearable?: boolean;
|
|
130
136
|
/** Disable the input */
|
|
131
137
|
disabled?: boolean;
|
|
132
138
|
/** Error message shown in place of the hint while the autocomplete is invalid */
|
|
133
139
|
errorMessage?: string;
|
|
134
|
-
/**
|
|
140
|
+
/**
|
|
141
|
+
* The consumer owns filtering: the component renders its options verbatim
|
|
142
|
+
* and only emits `change:query` as the user types. Pair with `loading` and
|
|
143
|
+
* an async data source feeding `items`
|
|
144
|
+
*/
|
|
145
|
+
external?: boolean;
|
|
146
|
+
/** Custom filter predicate; receives a normalized option + the query. Ignored when `external` is set */
|
|
135
147
|
filter?: CAutocompleteFilter;
|
|
136
148
|
/** Hide the hint and error messages */
|
|
137
149
|
hideDetails?: boolean;
|
package/package.json
CHANGED