@cscfi/csc-ui 4.0.0-alpha.11 → 4.0.0-alpha.12
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 +7297 -6845
- package/dist/custom-elements.json +259 -56
- package/dist/docs/c-autocomplete/usage.md +97 -0
- package/dist/docs/c-menu/usage.md +15 -0
- package/dist/docs/c-menu-item/usage.md +6 -0
- package/dist/docs/c-option-value/usage.md +1 -0
- package/dist/docs/c-select/usage.md +71 -0
- package/dist/vscode.css-custom-data.json +53 -0
- package/dist/vscode.html-custom-data.json +34 -19
- package/dist/web-types.json +153 -51
- package/dist-types/components/c-autocomplete/CAutocomplete.vue.d.ts +70 -11
- package/dist-types/components/c-checkbox/CCheckbox.vue.d.ts +2 -2
- package/dist-types/components/c-data-table/CDataTable.vue.d.ts +1 -1
- package/dist-types/components/c-dropdown/CDropdown.vue.d.ts +15 -3
- package/dist-types/components/c-input/CInput.vue.d.ts +1 -1
- package/dist-types/components/c-menu/CMenu.vue.d.ts +1 -1
- package/dist-types/components/c-popover/CPopover.vue.d.ts +1 -1
- package/dist-types/components/c-select/CSelect.vue.d.ts +68 -17
- package/dist-types/components/c-side-navigation/CSideNavigation.vue.d.ts +1 -1
- package/dist-types/components/c-tag/CTag.vue.d.ts +7 -0
- package/dist-types/components/c-text-field/CTextField.vue.d.ts +3 -3
- package/dist-types/components/c-tooltip/CTooltip.vue.d.ts +1 -1
- package/dist-types/index.d.ts +2 -1
- package/dist-types/shared/FormLabel.vue.d.ts +1 -1
- package/dist-types/shared/SelectionIndicator.vue.d.ts +21 -0
- package/dist-types/shared/optionLabel.d.ts +18 -0
- package/dist-types/shared/peekCap.d.ts +35 -0
- package/dist-types/shared/splitMatches.d.ts +18 -0
- package/dist-types/tag-name-map.d.ts +78 -17
- package/package.json +1 -1
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
A filterable value-selection component: a readonly value field that opens a popover panel with a search input above the matching options.
|
|
2
2
|
|
|
3
|
+
## Options
|
|
4
|
+
|
|
5
|
+
Options are slotted `c-option` elements or an `items` array of
|
|
6
|
+
`{ name, value }` entries. A slotted option's label — the text shown in the
|
|
7
|
+
closed field and in its tag, and the text the filter matches — is its `name`
|
|
8
|
+
attribute, else the text of a `c-option-value` inside it, else the option's
|
|
9
|
+
whole text. Wrap the label in `c-option-value` when an option carries more
|
|
10
|
+
than its label, such as a description; the rest of the option's markup still
|
|
11
|
+
renders in the row:
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<c-option value="ts">
|
|
15
|
+
<c-option-value>TypeScript</c-option-value>
|
|
16
|
+
<small>JavaScript with static types</small>
|
|
17
|
+
</c-option>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
While a query is typed, the runs of each option's label that equal it are
|
|
21
|
+
marked: inside the `c-option-value` of a slotted option, or in the plain
|
|
22
|
+
label of an `items` entry. A slotted option without the wrapper is rendered
|
|
23
|
+
exactly as authored and never marked. Every occurrence of the literal query
|
|
24
|
+
is marked, whatever the filter did — a fuzzy `filter`, or a `name` that
|
|
25
|
+
differs from the wrapper's text, can leave a row unmarked — and the wrapper's
|
|
26
|
+
content is treated as plain text while a query is active. The marks are the
|
|
27
|
+
`match` part:
|
|
28
|
+
|
|
29
|
+
```css
|
|
30
|
+
c-autocomplete::part(match) {
|
|
31
|
+
font-weight: 600;
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
3
35
|
## Filtering
|
|
4
36
|
|
|
5
37
|
By default the component filters its options itself: the query typed into the
|
|
@@ -26,3 +58,68 @@ label even when a later fetch no longer includes it: the label is remembered
|
|
|
26
58
|
when the option is committed, and a programmatically set value resolves its
|
|
27
59
|
label from the current options, or from the object's `name` when
|
|
28
60
|
`return-object` is used.
|
|
61
|
+
|
|
62
|
+
## Multiple selection
|
|
63
|
+
|
|
64
|
+
Set `multiple` to let the user pick several options. The value is then an
|
|
65
|
+
array of the picked options' values in the order they were picked (an array
|
|
66
|
+
of `{ name, value }` items with `return-object`), and `[]` when nothing is
|
|
67
|
+
picked. Arrays have no attribute form — bind `value` as a DOM property
|
|
68
|
+
(`v-model` or `:value.prop` in Vue; the React wrapper and property
|
|
69
|
+
assignment do this naturally). Picking an option toggles it and keeps the
|
|
70
|
+
panel open; the search input keeps its query after a pick, so several
|
|
71
|
+
matches can be picked in a row. `clearable` clears the whole selection.
|
|
72
|
+
|
|
73
|
+
Each picked option shows as a tag inside the field, and the field grows as
|
|
74
|
+
the tags wrap. A tag's close button removes that option; Backspace in the
|
|
75
|
+
closed field removes the last one. Set `max-tags` to show only that many
|
|
76
|
+
tags and fold the rest into a single "+N more" tag, or `max-tags="0"` to
|
|
77
|
+
show no tags at all — the field then reads "N selected". Assistive
|
|
78
|
+
technology always hears the full selection as the field's value. With
|
|
79
|
+
`external`, a pick's label is remembered when it is made, so a later fetch
|
|
80
|
+
that no longer lists it keeps its tag readable.
|
|
81
|
+
|
|
82
|
+
The row checkboxes recolour like c-checkbox's (`::part(indicator)`,
|
|
83
|
+
`::part(mark)`), and the tags are stylable through the `tags`, `tag` and
|
|
84
|
+
`tag-root` parts:
|
|
85
|
+
|
|
86
|
+
```css
|
|
87
|
+
c-autocomplete::part(tag-root) {
|
|
88
|
+
background: var(--c-primary-subtle);
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Texts
|
|
93
|
+
|
|
94
|
+
Every built-in string — the clear and toggle button labels, the search
|
|
95
|
+
input's placeholder and accessible label, the loading and no-results rows, a
|
|
96
|
+
tag's remove label, the overflow and count texts — can be replaced for
|
|
97
|
+
another language through the `texts` object, merged over the English
|
|
98
|
+
defaults. Count and label texts are functions, so the object must be bound
|
|
99
|
+
as a DOM property; the `placeholder` prop still wins over
|
|
100
|
+
`texts.searchPlaceholder` when both are set:
|
|
101
|
+
|
|
102
|
+
```vue
|
|
103
|
+
<c-autocomplete
|
|
104
|
+
:texts.prop="{
|
|
105
|
+
noResults: 'Ei osumia',
|
|
106
|
+
remove: (label) => `Poista ${label}`,
|
|
107
|
+
}"
|
|
108
|
+
multiple
|
|
109
|
+
/>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Scrolling
|
|
113
|
+
|
|
114
|
+
The panel shows `items-per-page` full rows (six by default) and then a
|
|
115
|
+
half-visible row instead of a scrollbar: the cut row is the cue that more
|
|
116
|
+
options follow, and the wheel, touch and arrow keys scroll as usual. Set
|
|
117
|
+
`items-per-page="0"` to let the list grow to the space the panel allows; it
|
|
118
|
+
still ends on a half row when it overflows. To bring the native scrollbar
|
|
119
|
+
back:
|
|
120
|
+
|
|
121
|
+
```css
|
|
122
|
+
c-autocomplete::part(list) {
|
|
123
|
+
scrollbar-width: auto;
|
|
124
|
+
}
|
|
125
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
A command menu: a transient panel of actions or navigation choices opened from a trigger (the WAI-ARIA menu-button pattern), authored declaratively with slotted `c-menu-item`, `c-menu-label` and `c-divider` elements. Activating an item fires a one-off `select` event and closes the menu; the menu holds no selected value — that is `c-select`'s job.
|
|
2
|
+
|
|
3
|
+
## Scrolling
|
|
4
|
+
|
|
5
|
+
A menu taller than the viewport allows scrolls without a scrollbar: the panel
|
|
6
|
+
ends on a half-visible item, which is the cue that more items follow, and the
|
|
7
|
+
wheel, touch and arrow keys scroll as usual. Submenu panels behave the same.
|
|
8
|
+
To bring the native scrollbar back:
|
|
9
|
+
|
|
10
|
+
```css
|
|
11
|
+
c-menu::part(list),
|
|
12
|
+
c-menu-item::part(submenu) {
|
|
13
|
+
scrollbar-width: auto;
|
|
14
|
+
}
|
|
15
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
The label region of a `c-option`: wraps the text that c-select and c-autocomplete use as the option's label — in the closed field, its tag and the autocomplete filter — so the option can carry a description or an icon beside its label, and the region in which c-autocomplete marks the runs equal to the query (`::part(match)`).
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
A value-selection field: a readonly field that opens a listbox of options — slotted `c-option` elements or an `items` array — and holds the picked value, emitting the value events that back `v-model`.
|
|
2
|
+
|
|
3
|
+
## Options
|
|
4
|
+
|
|
5
|
+
Options are slotted `c-option` elements or an `items` array of
|
|
6
|
+
`{ name, value }` entries. A slotted option's label — the text shown in the
|
|
7
|
+
closed field and, in `multiple` mode, in its tag — is its `name` attribute,
|
|
8
|
+
else the text of a `c-option-value` inside it, else the option's whole text.
|
|
9
|
+
Wrap the label in `c-option-value` when an option carries more than its
|
|
10
|
+
label, such as a description; the rest of the option's markup still renders
|
|
11
|
+
in the list row.
|
|
12
|
+
|
|
13
|
+
## Multiple selection
|
|
14
|
+
|
|
15
|
+
Set `multiple` to let the user pick several options. The value is then an
|
|
16
|
+
array of the picked options' values in the order they were picked (an array
|
|
17
|
+
of `{ name, value }` items with `return-object`), and `[]` when nothing is
|
|
18
|
+
picked. Arrays have no attribute form — bind `value` as a DOM property
|
|
19
|
+
(`v-model` or `:value.prop` in Vue; the React wrapper and property
|
|
20
|
+
assignment do this naturally). Picking an option toggles it and keeps the
|
|
21
|
+
list open; `clearable` clears the whole selection. `option-as-selection`
|
|
22
|
+
has no effect in this mode.
|
|
23
|
+
|
|
24
|
+
Each picked option shows as a tag inside the field, and the field grows as
|
|
25
|
+
the tags wrap. A tag's close button removes that option; Backspace in the
|
|
26
|
+
closed field removes the last one. Set `max-tags` to show only that many
|
|
27
|
+
tags and fold the rest into a single "+N more" tag, or `max-tags="0"` to
|
|
28
|
+
show no tags at all — the field then reads "N selected". Assistive
|
|
29
|
+
technology always hears the full selection as the field's value.
|
|
30
|
+
|
|
31
|
+
The row checkboxes recolour like c-checkbox's (`::part(indicator)`,
|
|
32
|
+
`::part(mark)`), and the tags are stylable through the `tags`, `tag` and
|
|
33
|
+
`tag-root` parts:
|
|
34
|
+
|
|
35
|
+
```css
|
|
36
|
+
c-select::part(tag-root) {
|
|
37
|
+
background: var(--c-primary-subtle);
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Texts
|
|
42
|
+
|
|
43
|
+
Every built-in string — the clear and toggle button labels, a tag's remove
|
|
44
|
+
label, the overflow and count texts — can be replaced for another language
|
|
45
|
+
through the `texts` object, merged over the English defaults. Count and
|
|
46
|
+
label texts are functions, so the object must be bound as a DOM property:
|
|
47
|
+
|
|
48
|
+
```vue
|
|
49
|
+
<c-select
|
|
50
|
+
:texts.prop="{
|
|
51
|
+
more: (n) => `+${n} lisää`,
|
|
52
|
+
remove: (label) => `Poista ${label}`,
|
|
53
|
+
}"
|
|
54
|
+
multiple
|
|
55
|
+
/>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Scrolling
|
|
59
|
+
|
|
60
|
+
The list shows `items-per-page` full rows (six by default) and then a
|
|
61
|
+
half-visible row instead of a scrollbar: the cut row is the cue that more
|
|
62
|
+
options follow, and the wheel, touch and arrow keys scroll as usual. Set
|
|
63
|
+
`items-per-page="0"` to let the list grow to the space the viewport allows;
|
|
64
|
+
it still ends on a half row when it overflows. To bring the native scrollbar
|
|
65
|
+
back:
|
|
66
|
+
|
|
67
|
+
```css
|
|
68
|
+
c-select::part(list) {
|
|
69
|
+
scrollbar-width: auto;
|
|
70
|
+
}
|
|
71
|
+
```
|
|
@@ -59,10 +59,35 @@
|
|
|
59
59
|
"description": "The search-input row at the top of the panel"
|
|
60
60
|
},
|
|
61
61
|
{ "name": "::part(list)", "description": "The scrollable options listbox" },
|
|
62
|
+
{ "name": "::part(item)", "description": "One option row in the list" },
|
|
63
|
+
{
|
|
64
|
+
"name": "::part(indicator)",
|
|
65
|
+
"description": "The decorative checkbox box on an option row in `multiple` mode; border, fill and glyph draw with `currentColor`, so `color` recolours them together (the c-checkbox recipe)"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "::part(mark)",
|
|
69
|
+
"description": "The check glyph inside a row indicator; draws with `currentColor`"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "::part(match)",
|
|
73
|
+
"description": "A run of an option's label equal to the query, in the row; underlined in the primary colour, text inherits the row"
|
|
74
|
+
},
|
|
62
75
|
{
|
|
63
76
|
"name": "::part(info)",
|
|
64
77
|
"description": "The info row: loading while `loading` with an empty list, otherwise no-results when the query matches no options"
|
|
65
78
|
},
|
|
79
|
+
{
|
|
80
|
+
"name": "::part(tags)",
|
|
81
|
+
"description": "The row of selected-value tags inside the field (`multiple` mode)"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "::part(tag)",
|
|
85
|
+
"description": "One selected-value tag: the `c-tag` host, including the overflow tag"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"name": "::part(tag-root)",
|
|
89
|
+
"description": "The pill box inside each tag (the `c-tag` `root` part), for colours and borders"
|
|
90
|
+
},
|
|
66
91
|
{
|
|
67
92
|
"name": "::part(root)",
|
|
68
93
|
"description": "The badge pill itself, absolutely positioned at the top right corner of its parent"
|
|
@@ -197,6 +222,14 @@
|
|
|
197
222
|
},
|
|
198
223
|
{ "name": "::part(list)", "description": "The scrolling listbox" },
|
|
199
224
|
{ "name": "::part(item)", "description": "One option row" },
|
|
225
|
+
{
|
|
226
|
+
"name": "::part(indicator)",
|
|
227
|
+
"description": "The decorative checkbox box on an option row in `multiple` mode; border, fill and glyph draw with `currentColor`, so `color` recolours them together"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"name": "::part(mark)",
|
|
231
|
+
"description": "The check glyph inside a row indicator; draws with `currentColor`"
|
|
232
|
+
},
|
|
200
233
|
{
|
|
201
234
|
"name": "::part(root)",
|
|
202
235
|
"description": "The `<svg>` element rendering the icon"
|
|
@@ -476,6 +509,26 @@
|
|
|
476
509
|
"name": "::part(item)",
|
|
477
510
|
"description": "One option row in the list. Any `part` attribute set on content inside a slotted `<c-option>` is exported too, so `c-select::part(<name>)` reaches the consumer's own option markup"
|
|
478
511
|
},
|
|
512
|
+
{
|
|
513
|
+
"name": "::part(indicator)",
|
|
514
|
+
"description": "The decorative checkbox box on an option row in `multiple` mode; border, fill and glyph draw with `currentColor`, so `color` recolours them together (the c-checkbox recipe)"
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
"name": "::part(mark)",
|
|
518
|
+
"description": "The check glyph inside a row indicator; draws with `currentColor`"
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
"name": "::part(tags)",
|
|
522
|
+
"description": "The row of selected-value tags inside the field (`multiple` mode)"
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
"name": "::part(tag)",
|
|
526
|
+
"description": "One selected-value tag: the `c-tag` host, including the overflow tag"
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
"name": "::part(tag-root)",
|
|
530
|
+
"description": "The pill box inside each tag (the `c-tag` `root` part), for colours and borders"
|
|
531
|
+
},
|
|
479
532
|
{ "name": "::part(root)", "description": "The outer drawer container" },
|
|
480
533
|
{
|
|
481
534
|
"name": "::part(nav)",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
"name": "c-autocomplete",
|
|
89
|
-
"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",
|
|
89
|
+
"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. In `multiple` mode the whole array of picked values, in\npick order (`[]` when 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- **item** - One option row in the list\n- **indicator** - The decorative checkbox box on an option row in `multiple` mode; border, fill and glyph draw with `currentColor`, so `color` recolours them together (the c-checkbox recipe)\n- **mark** - The check glyph inside a row indicator; draws with `currentColor`\n- **match** - A run of an option's label equal to the query, in the row; underlined in the primary colour, text inherits the row\n- **info** - The info row: loading while `loading` with an empty list, otherwise no-results when the query matches no options\n- **tags** - The row of selected-value tags inside the field (`multiple` mode)\n- **tag** - One selected-value tag: the `c-tag` host, including the overflow tag\n- **tag-root** - The pill box inside each tag (the `c-tag` `root` part), for colours and borders",
|
|
90
90
|
"attributes": [
|
|
91
91
|
{
|
|
92
92
|
"name": "clearable",
|
|
@@ -135,12 +135,17 @@
|
|
|
135
135
|
"description": "Show loading state",
|
|
136
136
|
"values": []
|
|
137
137
|
},
|
|
138
|
-
{ "name": "name", "description": "Input field name", "values": [] },
|
|
139
138
|
{
|
|
140
|
-
"name": "
|
|
141
|
-
"description": "
|
|
139
|
+
"name": "max-tags",
|
|
140
|
+
"description": "In `multiple` mode, show at most this many selected-value tags and fold\nthe rest into one \"+N more\" tag; `0` shows no tags and reads \"N selected\"\ninstead; unset shows every tag",
|
|
142
141
|
"values": []
|
|
143
142
|
},
|
|
143
|
+
{
|
|
144
|
+
"name": "multiple",
|
|
145
|
+
"description": "Allow selecting several options: rows toggle, the panel stays open and\nkeeps its query, `value` becomes an array of the selected values (items\nwith `return-object`) in the order they were picked, and the picks show\nas tags inside the field. Arrays have no attribute form — bind `value` as\na DOM property",
|
|
146
|
+
"values": []
|
|
147
|
+
},
|
|
148
|
+
{ "name": "name", "description": "Input field name", "values": [] },
|
|
144
149
|
{
|
|
145
150
|
"name": "placeholder",
|
|
146
151
|
"description": "Placeholder for the in-panel search input",
|
|
@@ -166,11 +171,6 @@
|
|
|
166
171
|
"name": "valid",
|
|
167
172
|
"description": "Set the validity of the input",
|
|
168
173
|
"values": []
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
"name": "value",
|
|
172
|
-
"description": "Selected value (scalar, or object when return-object is set)",
|
|
173
|
-
"values": [{ "name": "CAutocompleteItem" }]
|
|
174
174
|
}
|
|
175
175
|
],
|
|
176
176
|
"references": []
|
|
@@ -512,7 +512,7 @@
|
|
|
512
512
|
},
|
|
513
513
|
{
|
|
514
514
|
"name": "c-dropdown",
|
|
515
|
-
"description": "\n---\n\n\n### **Events:**\n - **dropdownStateChange** - Fired when the dropdown menu opens or closes; the detail is the new open\nstate. Also dispatched as `dropdown-state-change` — bind that name in Vue templates.\n- **selectOption** - Fired when the user selects an option row, carrying the option's name\nand value for the parent (c-select) to commit. Also dispatched as `select-option` — bind that name in Vue templates.\n\n### **Methods:**\n - **close()** - Close dropdown\n- **open()** - Open dropdown\n- **selectItem()** - Select item\n- **updateList()** - Update list items\n\n### **Slots:**\n - **default** - The anchor c-input of the parent select / autocomplete, rendered inline while the menu is closed\n- **input-top** - Target the c-input is moved into when the menu opens below the field\n- **input-bottom** - Target the c-input is moved into when the menu opens above the field\n\n### **CSS Parts:**\n - **menu** - The positioned dialog surface holding the field and the list\n- **list** - The scrolling listbox\n- **item** - One option row",
|
|
515
|
+
"description": "\n---\n\n\n### **Events:**\n - **dropdownStateChange** - Fired when the dropdown menu opens or closes; the detail is the new open\nstate. Also dispatched as `dropdown-state-change` — bind that name in Vue templates.\n- **selectOption** - Fired when the user selects an option row, carrying the option's name\nand value for the parent (c-select) to commit. Also dispatched as `select-option` — bind that name in Vue templates.\n\n### **Methods:**\n - **close()** - Close dropdown\n- **open()** - Open dropdown\n- **selectItem()** - Select item\n- **updateList()** - Update list items\n\n### **Slots:**\n - **default** - The anchor c-input of the parent select / autocomplete, rendered inline while the menu is closed\n- **input-top** - Target the c-input is moved into when the menu opens below the field\n- **input-bottom** - Target the c-input is moved into when the menu opens above the field\n\n### **CSS Parts:**\n - **menu** - The positioned dialog surface holding the field and the list\n- **list** - The scrolling listbox\n- **item** - One option row\n- **indicator** - The decorative checkbox box on an option row in `multiple` mode; border, fill and glyph draw with `currentColor`, so `color` recolours them together\n- **mark** - The check glyph inside a row indicator; draws with `currentColor`",
|
|
516
516
|
"attributes": [
|
|
517
517
|
{
|
|
518
518
|
"name": "dropdown-item-type",
|
|
@@ -539,6 +539,11 @@
|
|
|
539
539
|
"description": "Items per page before adding scroll",
|
|
540
540
|
"values": []
|
|
541
541
|
},
|
|
542
|
+
{
|
|
543
|
+
"name": "multiple",
|
|
544
|
+
"description": "Multi-select mode: rows toggle instead of committing, each carries a\ndecorative checkbox indicator, and the listbox is `aria-multiselectable`",
|
|
545
|
+
"values": []
|
|
546
|
+
},
|
|
542
547
|
{
|
|
543
548
|
"name": "parent",
|
|
544
549
|
"description": "Dropdown parent (the c-select / c-autocomplete host element)",
|
|
@@ -924,7 +929,7 @@
|
|
|
924
929
|
},
|
|
925
930
|
{
|
|
926
931
|
"name": "c-menu",
|
|
927
|
-
"description": "
|
|
932
|
+
"description": "A command menu: a transient panel of actions or navigation choices opened from a trigger (the WAI-ARIA menu-button pattern), authored declaratively with slotted `c-menu-item`, `c-menu-label` and `c-divider` elements. Activating an item fires a one-off `select` event and closes the menu; the menu holds no selected value — that is `c-select`'s job.\n---\n\n\n### **Events:**\n - **change:open** - Fired whenever the menu opens or closes, carrying the new open state.\nNamed `change:open`, not `update:open`: Vue's runtime silently drops\n`onUpdate:*` listeners on custom elements (`isModelListener`), so a\ntemplate `@update:open` would never be attached.\n- **select** - Fired when a leaf menu item is selected, carrying the item's `value`;\nbubbles out of the menu so a single listener can handle the whole tree.\n\n### **Slots:**\n - **default** - Menu title / activator element (simple variant)\n- **trigger** - The element that opens the menu (e.g. a c-button)\n\n### **CSS Parts:**\n - **trigger** - The inline wrapper around the slotted trigger, serving as the panel's anchor\n- **panel** - The floating popover positioned against the trigger\n- **list** - The menu list surface inside the panel",
|
|
928
933
|
"attributes": [
|
|
929
934
|
{
|
|
930
935
|
"name": "distance",
|
|
@@ -1063,7 +1068,7 @@
|
|
|
1063
1068
|
},
|
|
1064
1069
|
{
|
|
1065
1070
|
"name": "c-option",
|
|
1066
|
-
"description": "\n---\n\n\n### **Slots:**\n - **default** - The option's
|
|
1071
|
+
"description": "\n---\n\n\n### **Slots:**\n - **default** - The option's content, rendered in the list row; wrap the label text in c-option-value when the option carries more than its label",
|
|
1067
1072
|
"attributes": [
|
|
1068
1073
|
{
|
|
1069
1074
|
"name": "disabled",
|
|
@@ -1086,7 +1091,7 @@
|
|
|
1086
1091
|
},
|
|
1087
1092
|
{
|
|
1088
1093
|
"name": "c-option-value",
|
|
1089
|
-
"description": "
|
|
1094
|
+
"description": "The label region of a `c-option`: wraps the text that c-select and c-autocomplete use as the option's label — in the closed field, its tag and the autocomplete filter — so the option can carry a description or an icon beside its label, and the region in which c-autocomplete marks the runs equal to the query (`::part(match)`).\n---\n\n\n### **Slots:**\n - **default** - The option's label: the text c-select and c-autocomplete use for the option in the closed field, its tag and the filter, and the region c-autocomplete marks query matches in",
|
|
1090
1095
|
"attributes": [],
|
|
1091
1096
|
"references": []
|
|
1092
1097
|
},
|
|
@@ -1340,7 +1345,7 @@
|
|
|
1340
1345
|
},
|
|
1341
1346
|
{
|
|
1342
1347
|
"name": "c-select",
|
|
1343
|
-
"description": "
|
|
1348
|
+
"description": "A value-selection field: a readonly field that opens a listbox of options — slotted `c-option` elements or an `items` array — and holds the picked value, emitting the value events that back `v-model`.\n---\n\n\n### **Events:**\n - **changeValue** - Fired when the selection changes (an option is picked or the value is\ncleared), carrying the new value — the option's value, or the whole\n`{ name, value }` item when `return-object` is set; `null` when cleared.\nIn `multiple` mode the whole array of picked values, in pick order\n(`[]` when 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 select state\n\n### **Slots:**\n - **default** - Use c-option elements only\n- **pre** - Leading content forwarded to the inner c-input, rendered before the select's value\n- **post** - Trailing content forwarded to the inner c-input, rendered after the select's controls\n\n### **CSS Parts:**\n - **menu** - The dropdown surface (the positioned dialog) holding the field and the list\n- **list** - The scrolling listbox of options\n- **item** - One option row in the list. Any `part` attribute set on content inside a slotted `<c-option>` is exported too, so `c-select::part(<name>)` reaches the consumer's own option markup\n- **indicator** - The decorative checkbox box on an option row in `multiple` mode; border, fill and glyph draw with `currentColor`, so `color` recolours them together (the c-checkbox recipe)\n- **mark** - The check glyph inside a row indicator; draws with `currentColor`\n- **tags** - The row of selected-value tags inside the field (`multiple` mode)\n- **tag** - One selected-value tag: the `c-tag` host, including the overflow tag\n- **tag-root** - The pill box inside each tag (the `c-tag` `root` part), for colours and borders",
|
|
1344
1349
|
"attributes": [
|
|
1345
1350
|
{
|
|
1346
1351
|
"name": "clearable",
|
|
@@ -1384,6 +1389,16 @@
|
|
|
1384
1389
|
"description": "Show loading state",
|
|
1385
1390
|
"values": []
|
|
1386
1391
|
},
|
|
1392
|
+
{
|
|
1393
|
+
"name": "max-tags",
|
|
1394
|
+
"description": "In `multiple` mode, show at most this many selected-value tags and fold\nthe rest into one \"+N more\" tag; `0` shows no tags and reads \"N selected\"\ninstead; unset shows every tag",
|
|
1395
|
+
"values": []
|
|
1396
|
+
},
|
|
1397
|
+
{
|
|
1398
|
+
"name": "multiple",
|
|
1399
|
+
"description": "Allow selecting several options: rows toggle and the list stays open,\n`value` becomes an array of the selected values (items with\n`return-object`) in the order they were picked, and the picks show as\ntags inside the field. `option-as-selection` is ignored in this mode.\nArrays have no attribute form — bind `value` as a DOM property",
|
|
1400
|
+
"values": []
|
|
1401
|
+
},
|
|
1387
1402
|
{ "name": "name", "description": "Input field name", "values": [] },
|
|
1388
1403
|
{
|
|
1389
1404
|
"name": "option-as-selection",
|
|
@@ -1415,11 +1430,6 @@
|
|
|
1415
1430
|
"name": "valid",
|
|
1416
1431
|
"description": "Set the validity of the input",
|
|
1417
1432
|
"values": []
|
|
1418
|
-
},
|
|
1419
|
-
{
|
|
1420
|
-
"name": "value",
|
|
1421
|
-
"description": "Selected value (scalar, or object when return-object is set)",
|
|
1422
|
-
"values": [{ "name": "CSelectItem" }]
|
|
1423
1433
|
}
|
|
1424
1434
|
],
|
|
1425
1435
|
"references": []
|
|
@@ -1759,6 +1769,11 @@
|
|
|
1759
1769
|
"description": "Mark tag as closeable",
|
|
1760
1770
|
"values": []
|
|
1761
1771
|
},
|
|
1772
|
+
{
|
|
1773
|
+
"name": "close-label",
|
|
1774
|
+
"description": "Accessible name of the close button rendered when `closeable`",
|
|
1775
|
+
"values": []
|
|
1776
|
+
},
|
|
1762
1777
|
{
|
|
1763
1778
|
"name": "flat",
|
|
1764
1779
|
"description": "Remove the hover effect",
|