@cscfi/csc-ui 4.0.0-alpha.0 → 4.0.0-alpha.2

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.
@@ -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 row shown when the query matches no options"
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
  }
@@ -2062,7 +2088,7 @@
2062
2088
  "cssParts": [
2063
2089
  {
2064
2090
  "name": "root",
2065
- "description": "The card's visible surface, carries the background, radius, shadow and section spacing"
2091
+ "description": "The card's visible surface, carries the background, border, radius, shadow and section spacing"
2066
2092
  },
2067
2093
  {
2068
2094
  "name": "fullscreen-toggle",
@@ -1,2 +1,28 @@
1
- A filterable value-selection component: a readonly value field that opens a
2
- popover panel with a search input above the matching options.
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.
@@ -73,17 +73,18 @@
73
73
  --c-secondary-800: #4f002fff;
74
74
  --c-secondary-900: #3e0024ff;
75
75
  --c-secondary-950: #2f001aff;
76
- --c-slate-100: #e9ebeeff;
76
+ --c-slate-100: #e9eceeff;
77
77
  --c-slate-200: #cfd3d8ff;
78
- --c-slate-300: #aab1b8ff;
79
- --c-slate-400: #828a93ff;
78
+ --c-slate-300: #abb2b8ff;
79
+ --c-slate-400: #808890ff;
80
80
  --c-slate-500: #5e6770ff;
81
81
  --c-slate-rgb: 94, 103, 112;
82
- --c-slate-600: #454d57ff;
83
- --c-slate-700: #333941ff;
84
- --c-slate-800: #24282dff;
85
- --c-slate-900: #16181bff;
86
- --c-slate-950: #0f1113ff;
82
+ --c-slate-600: #4b5158ff;
83
+ --c-slate-700: #3c4247ff;
84
+ --c-slate-800: #2b2f33ff;
85
+ --c-slate-850: #26292dff;
86
+ --c-slate-900: #24272aff;
87
+ --c-slate-950: #1b1e20ff;
87
88
  --c-success-50: #f2ffecff;
88
89
  --c-success-100: #d0efc3ff;
89
90
  --c-success-200: #afdf99ff;
@@ -218,147 +219,147 @@
218
219
 
219
220
  /* Explicit dark mode (wins over the OS preference). */
220
221
  :root[data-theme='dark'] {
221
- --c-surface: var(--c-slate-900);
222
- --c-surface-raised: var(--c-slate-900);
223
- --c-surface-overlay: var(--c-slate-800);
224
- --c-surface-muted: var(--c-slate-800);
225
- --c-surface-sunken: var(--c-slate-950);
226
- --c-on-surface: var(--c-white);
227
- --c-on-surface-muted: var(--c-slate-100);
222
+ --c-surface: var(--c-slate-800);
223
+ --c-surface-raised: var(--c-slate-800);
224
+ --c-surface-overlay: var(--c-slate-700);
225
+ --c-surface-muted: var(--c-slate-850);
226
+ --c-surface-sunken: var(--c-slate-900);
227
+ --c-on-surface: var(--c-slate-100);
228
+ --c-on-surface-muted: var(--c-slate-300);
228
229
  --c-on-surface-faint: var(--c-slate-400);
229
- --c-on-surface-sunken: var(--c-primary-200);
230
+ --c-on-surface-sunken: var(--c-slate-100);
230
231
  --c-border: var(--c-slate-700);
231
232
  --c-border-strong: var(--c-slate-400);
232
- --c-ring: var(--c-primary-300);
233
- --c-primary: var(--c-primary-300);
234
- --c-primary-hover: var(--c-primary-200);
235
- --c-on-primary: var(--c-primary-900);
233
+ --c-ring: var(--c-accent-400);
234
+ --c-primary: var(--c-accent-500);
235
+ --c-primary-hover: var(--c-accent-400);
236
+ --c-on-primary: var(--c-primary-950);
236
237
  --c-primary-subtle: var(--c-primary-800);
237
- --c-primary-subtle-hover: var(--c-primary-900);
238
- --c-on-primary-subtle: var(--c-white);
238
+ --c-primary-subtle-hover: var(--c-primary-700);
239
+ --c-on-primary-subtle: var(--c-accent-300);
239
240
  --c-secondary: var(--c-secondary-300);
240
241
  --c-secondary-hover: var(--c-secondary-200);
241
242
  --c-on-secondary: var(--c-secondary-900);
242
243
  --c-secondary-subtle: var(--c-secondary-800);
243
- --c-secondary-subtle-hover: var(--c-secondary-900);
244
+ --c-secondary-subtle-hover: var(--c-secondary-700);
244
245
  --c-on-secondary-subtle: var(--c-secondary-200);
245
246
  --c-accent: var(--c-accent-300);
246
247
  --c-accent-hover: var(--c-accent-200);
247
248
  --c-on-accent: var(--c-accent-900);
248
249
  --c-accent-subtle: var(--c-accent-800);
249
- --c-accent-subtle-hover: var(--c-accent-900);
250
+ --c-accent-subtle-hover: var(--c-accent-700);
250
251
  --c-on-accent-subtle: var(--c-accent-200);
251
252
  --c-success: var(--c-success-300);
252
253
  --c-success-hover: var(--c-success-200);
253
254
  --c-on-success: var(--c-success-900);
254
255
  --c-success-subtle: var(--c-success-800);
255
- --c-success-subtle-hover: var(--c-success-900);
256
+ --c-success-subtle-hover: var(--c-success-700);
256
257
  --c-on-success-subtle: var(--c-success-200);
257
258
  --c-info: var(--c-info-300);
258
259
  --c-info-hover: var(--c-info-200);
259
260
  --c-on-info: var(--c-info-900);
260
261
  --c-info-subtle: var(--c-info-800);
261
- --c-info-subtle-hover: var(--c-info-900);
262
+ --c-info-subtle-hover: var(--c-info-700);
262
263
  --c-on-info-subtle: var(--c-info-200);
263
264
  --c-warning: var(--c-warning-300);
264
265
  --c-warning-hover: var(--c-warning-200);
265
266
  --c-on-warning: var(--c-warning-900);
266
267
  --c-warning-subtle: var(--c-warning-800);
267
- --c-warning-subtle-hover: var(--c-warning-900);
268
+ --c-warning-subtle-hover: var(--c-warning-700);
268
269
  --c-on-warning-subtle: var(--c-warning-200);
269
270
  --c-error: var(--c-error-300);
270
271
  --c-error-hover: var(--c-error-200);
271
272
  --c-on-error: var(--c-error-900);
272
273
  --c-error-subtle: var(--c-error-800);
273
- --c-error-subtle-hover: var(--c-error-900);
274
+ --c-error-subtle-hover: var(--c-error-700);
274
275
  --c-on-error-subtle: var(--c-error-200);
275
- --c-link: var(--c-link-200);
276
- --c-link-hover: var(--c-accent-900);
276
+ --c-link: var(--c-accent-400);
277
+ --c-link-hover: var(--c-accent-300);
277
278
  --c-on-link: var(--c-link-900);
278
279
  --c-link-subtle: var(--c-link-800);
279
- --c-link-subtle-hover: var(--c-link-900);
280
+ --c-link-subtle-hover: var(--c-link-700);
280
281
  --c-on-link-subtle: var(--c-link-200);
281
- --c-nav-surface: var(--c-primary-900);
282
- --c-nav-surface-hover: var(--c-primary-800);
282
+ --c-nav-surface: var(--c-primary-800);
283
+ --c-nav-surface-hover: var(--c-primary-700);
283
284
  --c-on-nav: var(--c-primary-100);
284
- --c-nav-active: var(--c-primary-700);
285
+ --c-nav-active: var(--c-primary-600);
285
286
  --c-on-nav-active: var(--c-white);
286
- --c-logo-wordmark: var(--c-white);
287
- --c-logo-teal: var(--c-white);
288
- --c-logo-magenta: var(--c-white);
287
+ --c-logo-wordmark: var(--c-slate-100);
288
+ --c-logo-teal: var(--c-slate-100);
289
+ --c-logo-magenta: #c2447cff;
289
290
  }
290
291
 
291
292
  /* OS dark preference, only when no explicit data-theme is set. */
292
293
  @media (prefers-color-scheme: dark) {
293
294
  :root:not([data-theme]) {
294
- --c-surface: var(--c-slate-900);
295
- --c-surface-raised: var(--c-slate-900);
296
- --c-surface-overlay: var(--c-slate-800);
297
- --c-surface-muted: var(--c-slate-800);
298
- --c-surface-sunken: var(--c-slate-950);
299
- --c-on-surface: var(--c-white);
300
- --c-on-surface-muted: var(--c-slate-100);
295
+ --c-surface: var(--c-slate-800);
296
+ --c-surface-raised: var(--c-slate-800);
297
+ --c-surface-overlay: var(--c-slate-700);
298
+ --c-surface-muted: var(--c-slate-850);
299
+ --c-surface-sunken: var(--c-slate-900);
300
+ --c-on-surface: var(--c-slate-100);
301
+ --c-on-surface-muted: var(--c-slate-300);
301
302
  --c-on-surface-faint: var(--c-slate-400);
302
- --c-on-surface-sunken: var(--c-primary-200);
303
+ --c-on-surface-sunken: var(--c-slate-100);
303
304
  --c-border: var(--c-slate-700);
304
305
  --c-border-strong: var(--c-slate-400);
305
- --c-ring: var(--c-primary-300);
306
- --c-primary: var(--c-primary-300);
307
- --c-primary-hover: var(--c-primary-200);
308
- --c-on-primary: var(--c-primary-900);
306
+ --c-ring: var(--c-accent-400);
307
+ --c-primary: var(--c-accent-500);
308
+ --c-primary-hover: var(--c-accent-400);
309
+ --c-on-primary: var(--c-primary-950);
309
310
  --c-primary-subtle: var(--c-primary-800);
310
- --c-primary-subtle-hover: var(--c-primary-900);
311
- --c-on-primary-subtle: var(--c-white);
311
+ --c-primary-subtle-hover: var(--c-primary-700);
312
+ --c-on-primary-subtle: var(--c-accent-300);
312
313
  --c-secondary: var(--c-secondary-300);
313
314
  --c-secondary-hover: var(--c-secondary-200);
314
315
  --c-on-secondary: var(--c-secondary-900);
315
316
  --c-secondary-subtle: var(--c-secondary-800);
316
- --c-secondary-subtle-hover: var(--c-secondary-900);
317
+ --c-secondary-subtle-hover: var(--c-secondary-700);
317
318
  --c-on-secondary-subtle: var(--c-secondary-200);
318
319
  --c-accent: var(--c-accent-300);
319
320
  --c-accent-hover: var(--c-accent-200);
320
321
  --c-on-accent: var(--c-accent-900);
321
322
  --c-accent-subtle: var(--c-accent-800);
322
- --c-accent-subtle-hover: var(--c-accent-900);
323
+ --c-accent-subtle-hover: var(--c-accent-700);
323
324
  --c-on-accent-subtle: var(--c-accent-200);
324
325
  --c-success: var(--c-success-300);
325
326
  --c-success-hover: var(--c-success-200);
326
327
  --c-on-success: var(--c-success-900);
327
328
  --c-success-subtle: var(--c-success-800);
328
- --c-success-subtle-hover: var(--c-success-900);
329
+ --c-success-subtle-hover: var(--c-success-700);
329
330
  --c-on-success-subtle: var(--c-success-200);
330
331
  --c-info: var(--c-info-300);
331
332
  --c-info-hover: var(--c-info-200);
332
333
  --c-on-info: var(--c-info-900);
333
334
  --c-info-subtle: var(--c-info-800);
334
- --c-info-subtle-hover: var(--c-info-900);
335
+ --c-info-subtle-hover: var(--c-info-700);
335
336
  --c-on-info-subtle: var(--c-info-200);
336
337
  --c-warning: var(--c-warning-300);
337
338
  --c-warning-hover: var(--c-warning-200);
338
339
  --c-on-warning: var(--c-warning-900);
339
340
  --c-warning-subtle: var(--c-warning-800);
340
- --c-warning-subtle-hover: var(--c-warning-900);
341
+ --c-warning-subtle-hover: var(--c-warning-700);
341
342
  --c-on-warning-subtle: var(--c-warning-200);
342
343
  --c-error: var(--c-error-300);
343
344
  --c-error-hover: var(--c-error-200);
344
345
  --c-on-error: var(--c-error-900);
345
346
  --c-error-subtle: var(--c-error-800);
346
- --c-error-subtle-hover: var(--c-error-900);
347
+ --c-error-subtle-hover: var(--c-error-700);
347
348
  --c-on-error-subtle: var(--c-error-200);
348
- --c-link: var(--c-link-200);
349
- --c-link-hover: var(--c-accent-900);
349
+ --c-link: var(--c-accent-400);
350
+ --c-link-hover: var(--c-accent-300);
350
351
  --c-on-link: var(--c-link-900);
351
352
  --c-link-subtle: var(--c-link-800);
352
- --c-link-subtle-hover: var(--c-link-900);
353
+ --c-link-subtle-hover: var(--c-link-700);
353
354
  --c-on-link-subtle: var(--c-link-200);
354
- --c-nav-surface: var(--c-primary-900);
355
- --c-nav-surface-hover: var(--c-primary-800);
355
+ --c-nav-surface: var(--c-primary-800);
356
+ --c-nav-surface-hover: var(--c-primary-700);
356
357
  --c-on-nav: var(--c-primary-100);
357
- --c-nav-active: var(--c-primary-700);
358
+ --c-nav-active: var(--c-primary-600);
358
359
  --c-on-nav-active: var(--c-white);
359
- --c-logo-wordmark: var(--c-white);
360
- --c-logo-teal: var(--c-white);
361
- --c-logo-magenta: var(--c-white);
360
+ --c-logo-wordmark: var(--c-slate-100);
361
+ --c-logo-teal: var(--c-slate-100);
362
+ --c-logo-magenta: #c2447cff;
362
363
  }
363
364
  }
364
365
 
@@ -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 row shown when the query matches no options"
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)",
@@ -84,7 +84,7 @@
84
84
  },
85
85
  {
86
86
  "name": "::part(root)",
87
- "description": "The card's visible surface, carries the background, radius, shadow and section spacing"
87
+ "description": "The card's visible surface, carries the background, border, radius, shadow and section spacing"
88
88
  },
89
89
  {
90
90
  "name": "::part(fullscreen-toggle)",
@@ -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 row shown when the query matches no options",
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",
@@ -288,7 +293,7 @@
288
293
  },
289
294
  {
290
295
  "name": "c-card",
291
- "description": "\n---\n\n\n### **Methods:**\n - **enterFullscreen()** - Enter fullscreen from the outside\n- **exitFullscreen()** - Exit fullscreen from the outside\n\n### **Slots:**\n - **default** - Card components\n\n### **CSS Parts:**\n - **root** - The card's visible surface, carries the background, radius, shadow and section spacing\n- **fullscreen-toggle** - The circular fullscreen toggle button shown when the fullscreen prop is set",
296
+ "description": "\n---\n\n\n### **Methods:**\n - **enterFullscreen()** - Enter fullscreen from the outside\n- **exitFullscreen()** - Exit fullscreen from the outside\n\n### **Slots:**\n - **default** - Card components\n\n### **CSS Parts:**\n - **root** - The card's visible surface, carries the background, border, radius, shadow and section spacing\n- **fullscreen-toggle** - The circular fullscreen toggle button shown when the fullscreen prop is set",
292
297
  "attributes": [
293
298
  {
294
299
  "name": "fullscreen",
@@ -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.0",
4
+ "version": "4.0.0-alpha.2",
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 row shown when the query matches no options",
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>",
@@ -809,7 +829,7 @@
809
829
  },
810
830
  {
811
831
  "name": "c-card",
812
- "description": "\n---\n\n\n### **Methods:**\n - **enterFullscreen()** - Enter fullscreen from the outside\n- **exitFullscreen()** - Exit fullscreen from the outside\n\n### **Slots:**\n - **default** - Card components\n\n### **CSS Parts:**\n - **root** - The card's visible surface, carries the background, radius, shadow and section spacing\n- **fullscreen-toggle** - The circular fullscreen toggle button shown when the fullscreen prop is set",
832
+ "description": "\n---\n\n\n### **Methods:**\n - **enterFullscreen()** - Enter fullscreen from the outside\n- **exitFullscreen()** - Exit fullscreen from the outside\n\n### **Slots:**\n - **default** - Card components\n\n### **CSS Parts:**\n - **root** - The card's visible surface, carries the background, border, radius, shadow and section spacing\n- **fullscreen-toggle** - The circular fullscreen toggle button shown when the fullscreen prop is set",
813
833
  "doc-url": "",
814
834
  "attributes": [
815
835
  {
@@ -5146,7 +5166,7 @@
5146
5166
  },
5147
5167
  {
5148
5168
  "name": "part(info)",
5149
- "description": "The no-results row shown when the query matches no options"
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)",
@@ -5174,7 +5194,7 @@
5174
5194
  },
5175
5195
  {
5176
5196
  "name": "part(root)",
5177
- "description": "The card's visible surface, carries the background, radius, shadow and section spacing"
5197
+ "description": "The card's visible surface, carries the background, border, radius, shadow and section spacing"
5178
5198
  },
5179
5199
  {
5180
5200
  "name": "part(fullscreen-toggle)",
@@ -33,7 +33,13 @@ export interface CAutocompleteProps {
33
33
  * @freeform
34
34
  */
35
35
  errorMessage?: string;
36
- /** Custom filter predicate; receives a normalized option + the query */
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;
@@ -24,7 +24,6 @@ type DropdownItem = {
24
24
  disabled?: boolean;
25
25
  name: string;
26
26
  outerHTML?: string;
27
- querySelector?: (s: string) => Element | null;
28
27
  selected?: boolean;
29
28
  value: number | string;
30
29
  };
@@ -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
- /** Custom filter predicate; receives a normalized option + the query */
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cscfi/csc-ui",
3
- "version": "4.0.0-alpha.0",
3
+ "version": "4.0.0-alpha.2",
4
4
  "description": "Vue 3-based replacement for @cscfi/csc-ui — same custom element tag names, Vue v-model contract.",
5
5
  "type": "module",
6
6
  "main": "./dist/csc-ui.js",