@cscfi/csc-ui 4.0.0-alpha.11 → 4.0.0-alpha.13
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 +7677 -7042
- package/dist/custom-elements.json +337 -58
- package/dist/docs/c-autocomplete/usage.md +129 -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 +104 -0
- package/dist/vscode.css-custom-data.json +65 -0
- package/dist/vscode.html-custom-data.json +50 -20
- package/dist/web-types.json +210 -53
- package/dist-types/components/c-autocomplete/CAutocomplete.vue.d.ts +84 -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 +32 -4
- 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 +81 -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/selectAll.d.ts +29 -0
- package/dist-types/shared/splitMatches.d.ts +18 -0
- package/dist-types/tag-name-map.d.ts +110 -18
- package/package.json +1 -1
|
@@ -1,5 +1,61 @@
|
|
|
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
|
+
The row shows a copy of the option's markup, re-created from its HTML inside
|
|
21
|
+
the panel. A component nested in an option — a `c-icon`, say — is therefore
|
|
22
|
+
configured through attributes, or props with an attribute form (strings,
|
|
23
|
+
numbers, booleans); object props and event listeners on option content do not
|
|
24
|
+
carry over. Page CSS does not reach the copy either: give the content a `part`
|
|
25
|
+
and style it through the field:
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<c-option value="ts">
|
|
29
|
+
<div part="language">
|
|
30
|
+
<c-option-value>TypeScript</c-option-value>
|
|
31
|
+
<c-icon path="…"></c-icon>
|
|
32
|
+
</div>
|
|
33
|
+
</c-option>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```css
|
|
37
|
+
c-autocomplete::part(language) {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
gap: 0.5rem;
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
While a query is typed, the runs of each option's label that equal it are
|
|
45
|
+
marked: inside the `c-option-value` of a slotted option, or in the plain
|
|
46
|
+
label of an `items` entry. A slotted option without the wrapper is rendered
|
|
47
|
+
exactly as authored and never marked. Every occurrence of the literal query
|
|
48
|
+
is marked, whatever the filter did — a fuzzy `filter`, or a `name` that
|
|
49
|
+
differs from the wrapper's text, can leave a row unmarked — and the wrapper's
|
|
50
|
+
content is treated as plain text while a query is active. The marks are the
|
|
51
|
+
`match` part:
|
|
52
|
+
|
|
53
|
+
```css
|
|
54
|
+
c-autocomplete::part(match) {
|
|
55
|
+
font-weight: 600;
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
3
59
|
## Filtering
|
|
4
60
|
|
|
5
61
|
By default the component filters its options itself: the query typed into the
|
|
@@ -26,3 +82,76 @@ label even when a later fetch no longer includes it: the label is remembered
|
|
|
26
82
|
when the option is committed, and a programmatically set value resolves its
|
|
27
83
|
label from the current options, or from the object's `name` when
|
|
28
84
|
`return-object` is used.
|
|
85
|
+
|
|
86
|
+
## Multiple selection
|
|
87
|
+
|
|
88
|
+
Set `multiple` to let the user pick several options. The value is then an
|
|
89
|
+
array of the picked options' values in the order they were picked (an array
|
|
90
|
+
of `{ name, value }` items with `return-object`), and `[]` when nothing is
|
|
91
|
+
picked. Arrays have no attribute form — bind `value` as a DOM property
|
|
92
|
+
(`v-model` or `:value.prop` in Vue; the React wrapper and property
|
|
93
|
+
assignment do this naturally). Picking an option toggles it and keeps the
|
|
94
|
+
panel open; the search input keeps its query after a pick, so several
|
|
95
|
+
matches can be picked in a row. `clearable` clears the whole selection.
|
|
96
|
+
|
|
97
|
+
Each picked option shows as a tag inside the field, and the field grows as
|
|
98
|
+
the tags wrap. A tag's close button removes that option; Backspace in the
|
|
99
|
+
closed field removes the last one. Set `max-tags` to show only that many
|
|
100
|
+
tags and fold the rest into a single "+N more" tag, or `max-tags="0"` to
|
|
101
|
+
show no tags at all — the field then reads "N selected". Assistive
|
|
102
|
+
technology always hears the full selection as the field's value. With
|
|
103
|
+
`external`, a pick's label is remembered when it is made, so a later fetch
|
|
104
|
+
that no longer lists it keeps its tag readable.
|
|
105
|
+
|
|
106
|
+
Set `select-all` to pin a select-all row at the top of the list. It acts on
|
|
107
|
+
the options currently listed — the matches while a query is typed, or the
|
|
108
|
+
`items` you supply with `external`: activating it selects every enabled one
|
|
109
|
+
of them, or unselects them all when they already are, and options outside
|
|
110
|
+
the list keep their state. Disabled options are left alone, and the row only
|
|
111
|
+
appears while there is something to select. Its label is `texts.selectAll`,
|
|
112
|
+
a function receiving the number of listed options.
|
|
113
|
+
|
|
114
|
+
The row checkboxes recolour like c-checkbox's (`::part(indicator)`,
|
|
115
|
+
`::part(mark)`), the select-all row is the `select-all` part, and the tags are
|
|
116
|
+
stylable through the `tags`, `tag` and `tag-root` parts:
|
|
117
|
+
|
|
118
|
+
```css
|
|
119
|
+
c-autocomplete::part(tag-root) {
|
|
120
|
+
background: var(--c-primary-subtle);
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Texts
|
|
125
|
+
|
|
126
|
+
Every built-in string — the clear and toggle button labels, the search
|
|
127
|
+
input's placeholder and accessible label, the loading and no-results rows,
|
|
128
|
+
the select-all row's label, a tag's remove label, the overflow and count
|
|
129
|
+
texts — can be replaced for another language through the `texts` object,
|
|
130
|
+
merged over the English defaults. Count and label texts are functions, so the object must be bound
|
|
131
|
+
as a DOM property; the `placeholder` prop still wins over
|
|
132
|
+
`texts.searchPlaceholder` when both are set:
|
|
133
|
+
|
|
134
|
+
```vue
|
|
135
|
+
<c-autocomplete
|
|
136
|
+
:texts.prop="{
|
|
137
|
+
noResults: 'Ei osumia',
|
|
138
|
+
remove: (label) => `Poista ${label}`,
|
|
139
|
+
}"
|
|
140
|
+
multiple
|
|
141
|
+
/>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Scrolling
|
|
145
|
+
|
|
146
|
+
The panel shows `items-per-page` full rows (six by default) and then a
|
|
147
|
+
half-visible row instead of a scrollbar: the cut row is the cue that more
|
|
148
|
+
options follow, and the wheel, touch and arrow keys scroll as usual. Set
|
|
149
|
+
`items-per-page="0"` to let the list grow to the space the panel allows; it
|
|
150
|
+
still ends on a half row when it overflows. To bring the native scrollbar
|
|
151
|
+
back:
|
|
152
|
+
|
|
153
|
+
```css
|
|
154
|
+
c-autocomplete::part(list) {
|
|
155
|
+
scrollbar-width: auto;
|
|
156
|
+
}
|
|
157
|
+
```
|
|
@@ -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,104 @@
|
|
|
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
|
+
The row shows a copy of the option's markup, re-created from its HTML inside
|
|
14
|
+
the list. A component nested in an option — a `c-icon`, say — is therefore
|
|
15
|
+
configured through attributes, or props with an attribute form (strings,
|
|
16
|
+
numbers, booleans); object props and event listeners on option content do not
|
|
17
|
+
carry over. Page CSS does not reach the copy either: give the content a `part`
|
|
18
|
+
and style it through the field, which forwards every `part` named inside its
|
|
19
|
+
options:
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<c-option value="ts">
|
|
23
|
+
<div part="language">
|
|
24
|
+
<c-option-value>TypeScript</c-option-value>
|
|
25
|
+
<c-icon path="…"></c-icon>
|
|
26
|
+
</div>
|
|
27
|
+
</c-option>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```css
|
|
31
|
+
c-select::part(language) {
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
gap: 0.5rem;
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Multiple selection
|
|
39
|
+
|
|
40
|
+
Set `multiple` to let the user pick several options. The value is then an
|
|
41
|
+
array of the picked options' values in the order they were picked (an array
|
|
42
|
+
of `{ name, value }` items with `return-object`), and `[]` when nothing is
|
|
43
|
+
picked. Arrays have no attribute form — bind `value` as a DOM property
|
|
44
|
+
(`v-model` or `:value.prop` in Vue; the React wrapper and property
|
|
45
|
+
assignment do this naturally). Picking an option toggles it and keeps the
|
|
46
|
+
list open; `clearable` clears the whole selection. `option-as-selection`
|
|
47
|
+
has no effect in this mode.
|
|
48
|
+
|
|
49
|
+
Each picked option shows as a tag inside the field, and the field grows as
|
|
50
|
+
the tags wrap. A tag's close button removes that option; Backspace in the
|
|
51
|
+
closed field removes the last one. Set `max-tags` to show only that many
|
|
52
|
+
tags and fold the rest into a single "+N more" tag, or `max-tags="0"` to
|
|
53
|
+
show no tags at all — the field then reads "N selected". Assistive
|
|
54
|
+
technology always hears the full selection as the field's value.
|
|
55
|
+
|
|
56
|
+
Set `select-all` to pin a select-all row at the top of the list. Its checkbox
|
|
57
|
+
shows whether none, some or all enabled options are selected; activating it
|
|
58
|
+
selects every enabled option, or unselects them all when they already are.
|
|
59
|
+
Disabled options are left alone, and the row only appears while there is
|
|
60
|
+
something to select. Its label is `texts.selectAll`, a function receiving the
|
|
61
|
+
number of listed options.
|
|
62
|
+
|
|
63
|
+
The row checkboxes recolour like c-checkbox's (`::part(indicator)`,
|
|
64
|
+
`::part(mark)`), the select-all row is the `select-all` part, and the tags are
|
|
65
|
+
stylable through the `tags`, `tag` and `tag-root` parts:
|
|
66
|
+
|
|
67
|
+
```css
|
|
68
|
+
c-select::part(tag-root) {
|
|
69
|
+
background: var(--c-primary-subtle);
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Texts
|
|
74
|
+
|
|
75
|
+
Every built-in string — the clear and toggle button labels, a tag's remove
|
|
76
|
+
label, the overflow and count texts, the select-all row's label — can be
|
|
77
|
+
replaced for another language
|
|
78
|
+
through the `texts` object, merged over the English defaults. Count and
|
|
79
|
+
label texts are functions, so the object must be bound as a DOM property:
|
|
80
|
+
|
|
81
|
+
```vue
|
|
82
|
+
<c-select
|
|
83
|
+
:texts.prop="{
|
|
84
|
+
more: (n) => `+${n} lisää`,
|
|
85
|
+
remove: (label) => `Poista ${label}`,
|
|
86
|
+
}"
|
|
87
|
+
multiple
|
|
88
|
+
/>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Scrolling
|
|
92
|
+
|
|
93
|
+
The list shows `items-per-page` full rows (six by default) and then a
|
|
94
|
+
half-visible row instead of a scrollbar: the cut row is the cue that more
|
|
95
|
+
options follow, and the wheel, touch and arrow keys scroll as usual. Set
|
|
96
|
+
`items-per-page="0"` to let the list grow to the space the viewport allows;
|
|
97
|
+
it still ends on a half row when it overflows. To bring the native scrollbar
|
|
98
|
+
back:
|
|
99
|
+
|
|
100
|
+
```css
|
|
101
|
+
c-select::part(list) {
|
|
102
|
+
scrollbar-width: auto;
|
|
103
|
+
}
|
|
104
|
+
```
|
|
@@ -59,10 +59,39 @@
|
|
|
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(select-all)",
|
|
65
|
+
"description": "The pinned select-all row at the top of the list (`multiple` mode with `select-all`); carries the same indicator / mark parts as an option row"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "::part(indicator)",
|
|
69
|
+
"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)"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "::part(mark)",
|
|
73
|
+
"description": "The check glyph inside a row indicator; draws with `currentColor`"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "::part(match)",
|
|
77
|
+
"description": "A run of an option's label equal to the query, in the row; underlined in the primary colour, text inherits the row"
|
|
78
|
+
},
|
|
62
79
|
{
|
|
63
80
|
"name": "::part(info)",
|
|
64
81
|
"description": "The info row: loading while `loading` with an empty list, otherwise no-results when the query matches no options"
|
|
65
82
|
},
|
|
83
|
+
{
|
|
84
|
+
"name": "::part(tags)",
|
|
85
|
+
"description": "The row of selected-value tags inside the field (`multiple` mode)"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"name": "::part(tag)",
|
|
89
|
+
"description": "One selected-value tag: the `c-tag` host, including the overflow tag"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "::part(tag-root)",
|
|
93
|
+
"description": "The pill box inside each tag (the `c-tag` `root` part), for colours and borders"
|
|
94
|
+
},
|
|
66
95
|
{
|
|
67
96
|
"name": "::part(root)",
|
|
68
97
|
"description": "The badge pill itself, absolutely positioned at the top right corner of its parent"
|
|
@@ -197,6 +226,18 @@
|
|
|
197
226
|
},
|
|
198
227
|
{ "name": "::part(list)", "description": "The scrolling listbox" },
|
|
199
228
|
{ "name": "::part(item)", "description": "One option row" },
|
|
229
|
+
{
|
|
230
|
+
"name": "::part(select-all)",
|
|
231
|
+
"description": "The pinned select-all row at the top of the list in `multiple` mode; carries the same indicator / mark parts as an option row"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"name": "::part(indicator)",
|
|
235
|
+
"description": "The decorative checkbox box on an option row in `multiple` mode; border, fill and glyph draw with `currentColor`, so `color` recolours them together"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"name": "::part(mark)",
|
|
239
|
+
"description": "The check glyph inside a row indicator; draws with `currentColor`"
|
|
240
|
+
},
|
|
200
241
|
{
|
|
201
242
|
"name": "::part(root)",
|
|
202
243
|
"description": "The `<svg>` element rendering the icon"
|
|
@@ -476,6 +517,30 @@
|
|
|
476
517
|
"name": "::part(item)",
|
|
477
518
|
"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
519
|
},
|
|
520
|
+
{
|
|
521
|
+
"name": "::part(select-all)",
|
|
522
|
+
"description": "The pinned select-all row at the top of the list (`multiple` mode with `select-all`); carries the same indicator / mark parts as an option row"
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
"name": "::part(indicator)",
|
|
526
|
+
"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)"
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
"name": "::part(mark)",
|
|
530
|
+
"description": "The check glyph inside a row indicator; draws with `currentColor`"
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
"name": "::part(tags)",
|
|
534
|
+
"description": "The row of selected-value tags inside the field (`multiple` mode)"
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
"name": "::part(tag)",
|
|
538
|
+
"description": "One selected-value tag: the `c-tag` host, including the overflow tag"
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
"name": "::part(tag-root)",
|
|
542
|
+
"description": "The pill box inside each tag (the `c-tag` `root` part), for colours and borders"
|
|
543
|
+
},
|
|
479
544
|
{ "name": "::part(root)", "description": "The outer drawer container" },
|
|
480
545
|
{
|
|
481
546
|
"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- **select-all** - The pinned select-all row at the top of the list (`multiple` mode with `select-all`); carries the same indicator / mark parts as an 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 (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",
|
|
@@ -156,6 +161,11 @@
|
|
|
156
161
|
"description": "Return object instead of value",
|
|
157
162
|
"values": []
|
|
158
163
|
},
|
|
164
|
+
{
|
|
165
|
+
"name": "select-all",
|
|
166
|
+
"description": "In `multiple` mode, pin a select-all row at the top of the list. Its\ncheckbox shows whether none, some or all enabled options currently listed\n— the matches while a query is typed, the given `items` with `external` —\nare selected; activating it selects them all, or, when all are selected,\nunselects them. Ignored in single mode",
|
|
167
|
+
"values": []
|
|
168
|
+
},
|
|
159
169
|
{ "name": "shadow", "description": "Shadow variant", "values": [] },
|
|
160
170
|
{
|
|
161
171
|
"name": "size",
|
|
@@ -166,11 +176,6 @@
|
|
|
166
176
|
"name": "valid",
|
|
167
177
|
"description": "Set the validity of the input",
|
|
168
178
|
"values": []
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
"name": "value",
|
|
172
|
-
"description": "Selected value (scalar, or object when return-object is set)",
|
|
173
|
-
"values": [{ "name": "CAutocompleteItem" }]
|
|
174
179
|
}
|
|
175
180
|
],
|
|
176
181
|
"references": []
|
|
@@ -512,7 +517,7 @@
|
|
|
512
517
|
},
|
|
513
518
|
{
|
|
514
519
|
"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",
|
|
520
|
+
"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- **selectall** - Fired when the select-all row is activated; the parent (c-select) toggles\nevery listed enabled option.\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- **select-all** - The pinned select-all row at the top of the list in `multiple` mode; carries the same indicator / mark parts as an 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
521
|
"attributes": [
|
|
517
522
|
{
|
|
518
523
|
"name": "dropdown-item-type",
|
|
@@ -526,7 +531,7 @@
|
|
|
526
531
|
},
|
|
527
532
|
{
|
|
528
533
|
"name": "index",
|
|
529
|
-
"description": "Current highlighted index",
|
|
534
|
+
"description": "Current highlighted index; `-1` (`SELECT_ALL_INDEX`) is the select-all row",
|
|
530
535
|
"values": []
|
|
531
536
|
},
|
|
532
537
|
{
|
|
@@ -539,11 +544,21 @@
|
|
|
539
544
|
"description": "Items per page before adding scroll",
|
|
540
545
|
"values": []
|
|
541
546
|
},
|
|
547
|
+
{
|
|
548
|
+
"name": "multiple",
|
|
549
|
+
"description": "Multi-select mode: rows toggle instead of committing, each carries a\ndecorative checkbox indicator, and the listbox is `aria-multiselectable`",
|
|
550
|
+
"values": []
|
|
551
|
+
},
|
|
542
552
|
{
|
|
543
553
|
"name": "parent",
|
|
544
554
|
"description": "Dropdown parent (the c-select / c-autocomplete host element)",
|
|
545
555
|
"values": [{ "name": "HTMLElement" }]
|
|
546
556
|
},
|
|
557
|
+
{
|
|
558
|
+
"name": "select-all-row",
|
|
559
|
+
"description": "The select-all row in `multiple` mode, as the parent computes it (label,\ntri-state, counts for the live region); `null` renders no row",
|
|
560
|
+
"values": [{ "name": "CDropdownSelectAllRow" }]
|
|
561
|
+
},
|
|
547
562
|
{
|
|
548
563
|
"name": "type",
|
|
549
564
|
"description": "Parent type — drives autocomplete-only behaviour (highlight, messages)",
|
|
@@ -924,7 +939,7 @@
|
|
|
924
939
|
},
|
|
925
940
|
{
|
|
926
941
|
"name": "c-menu",
|
|
927
|
-
"description": "
|
|
942
|
+
"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
943
|
"attributes": [
|
|
929
944
|
{
|
|
930
945
|
"name": "distance",
|
|
@@ -1063,7 +1078,7 @@
|
|
|
1063
1078
|
},
|
|
1064
1079
|
{
|
|
1065
1080
|
"name": "c-option",
|
|
1066
|
-
"description": "\n---\n\n\n### **Slots:**\n - **default** - The option's
|
|
1081
|
+
"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
1082
|
"attributes": [
|
|
1068
1083
|
{
|
|
1069
1084
|
"name": "disabled",
|
|
@@ -1086,7 +1101,7 @@
|
|
|
1086
1101
|
},
|
|
1087
1102
|
{
|
|
1088
1103
|
"name": "c-option-value",
|
|
1089
|
-
"description": "
|
|
1104
|
+
"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
1105
|
"attributes": [],
|
|
1091
1106
|
"references": []
|
|
1092
1107
|
},
|
|
@@ -1340,7 +1355,7 @@
|
|
|
1340
1355
|
},
|
|
1341
1356
|
{
|
|
1342
1357
|
"name": "c-select",
|
|
1343
|
-
"description": "
|
|
1358
|
+
"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- **select-all** - The pinned select-all row at the top of the list (`multiple` mode with `select-all`); carries the same indicator / mark parts as an 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 (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
1359
|
"attributes": [
|
|
1345
1360
|
{
|
|
1346
1361
|
"name": "clearable",
|
|
@@ -1384,6 +1399,16 @@
|
|
|
1384
1399
|
"description": "Show loading state",
|
|
1385
1400
|
"values": []
|
|
1386
1401
|
},
|
|
1402
|
+
{
|
|
1403
|
+
"name": "max-tags",
|
|
1404
|
+
"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",
|
|
1405
|
+
"values": []
|
|
1406
|
+
},
|
|
1407
|
+
{
|
|
1408
|
+
"name": "multiple",
|
|
1409
|
+
"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",
|
|
1410
|
+
"values": []
|
|
1411
|
+
},
|
|
1387
1412
|
{ "name": "name", "description": "Input field name", "values": [] },
|
|
1388
1413
|
{
|
|
1389
1414
|
"name": "option-as-selection",
|
|
@@ -1405,6 +1430,11 @@
|
|
|
1405
1430
|
"description": "Return object instead of value",
|
|
1406
1431
|
"values": []
|
|
1407
1432
|
},
|
|
1433
|
+
{
|
|
1434
|
+
"name": "select-all",
|
|
1435
|
+
"description": "In `multiple` mode, pin a select-all row at the top of the list. Its\ncheckbox shows whether none, some or all enabled options are selected;\nactivating it selects every enabled option — or, when all are selected,\nunselects them. Ignored in single mode",
|
|
1436
|
+
"values": []
|
|
1437
|
+
},
|
|
1408
1438
|
{ "name": "shadow", "description": "Shadow variant", "values": [] },
|
|
1409
1439
|
{
|
|
1410
1440
|
"name": "size",
|
|
@@ -1415,11 +1445,6 @@
|
|
|
1415
1445
|
"name": "valid",
|
|
1416
1446
|
"description": "Set the validity of the input",
|
|
1417
1447
|
"values": []
|
|
1418
|
-
},
|
|
1419
|
-
{
|
|
1420
|
-
"name": "value",
|
|
1421
|
-
"description": "Selected value (scalar, or object when return-object is set)",
|
|
1422
|
-
"values": [{ "name": "CSelectItem" }]
|
|
1423
1448
|
}
|
|
1424
1449
|
],
|
|
1425
1450
|
"references": []
|
|
@@ -1759,6 +1784,11 @@
|
|
|
1759
1784
|
"description": "Mark tag as closeable",
|
|
1760
1785
|
"values": []
|
|
1761
1786
|
},
|
|
1787
|
+
{
|
|
1788
|
+
"name": "close-label",
|
|
1789
|
+
"description": "Accessible name of the close button rendered when `closeable`",
|
|
1790
|
+
"values": []
|
|
1791
|
+
},
|
|
1762
1792
|
{
|
|
1763
1793
|
"name": "flat",
|
|
1764
1794
|
"description": "Remove the hover effect",
|