@cscfi/csc-ui 4.0.0-alpha.12 → 4.0.0-alpha.14
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 +7754 -6741
- package/dist/custom-elements.json +672 -7
- package/dist/docs/c-autocomplete/usage.md +38 -6
- package/dist/docs/c-select/usage.md +36 -3
- package/dist/docs/c-tree-select/usage.md +133 -0
- package/dist/styles/css/tokens.css +2 -1
- package/dist/vscode.css-custom-data.json +61 -0
- package/dist/vscode.html-custom-data.json +100 -4
- package/dist/web-types.json +367 -7
- package/dist-types/components/c-autocomplete/CAutocomplete.vue.d.ts +14 -0
- package/dist-types/components/c-dropdown/CDropdown.vue.d.ts +22 -5
- package/dist-types/components/c-select/CSelect.vue.d.ts +13 -0
- package/dist-types/components/c-tree-select/CTreeSelect.vue.d.ts +247 -0
- package/dist-types/index.d.ts +1 -0
- package/dist-types/shared/selectAll.d.ts +29 -0
- package/dist-types/shared/useAnchoredPanel.d.ts +72 -0
- package/dist-types/shared/useStatusAnnouncer.d.ts +33 -0
- package/dist-types/tag-name-map.d.ts +136 -6
- package/package.json +1 -1
|
@@ -17,6 +17,30 @@ renders in the row:
|
|
|
17
17
|
</c-option>
|
|
18
18
|
```
|
|
19
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
|
+
|
|
20
44
|
While a query is typed, the runs of each option's label that equal it are
|
|
21
45
|
marked: inside the `c-option-value` of a slotted option, or in the plain
|
|
22
46
|
label of an `items` entry. A slotted option without the wrapper is rendered
|
|
@@ -79,9 +103,17 @@ technology always hears the full selection as the field's value. With
|
|
|
79
103
|
`external`, a pick's label is remembered when it is made, so a later fetch
|
|
80
104
|
that no longer lists it keeps its tag readable.
|
|
81
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
|
+
|
|
82
114
|
The row checkboxes recolour like c-checkbox's (`::part(indicator)`,
|
|
83
|
-
`::part(mark)`),
|
|
84
|
-
`tag-root` parts:
|
|
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:
|
|
85
117
|
|
|
86
118
|
```css
|
|
87
119
|
c-autocomplete::part(tag-root) {
|
|
@@ -92,10 +124,10 @@ c-autocomplete::part(tag-root) {
|
|
|
92
124
|
## Texts
|
|
93
125
|
|
|
94
126
|
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,
|
|
96
|
-
tag's remove label, the overflow and count
|
|
97
|
-
another language through the `texts` object,
|
|
98
|
-
defaults. Count and label texts are functions, so the object must be bound
|
|
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
|
|
99
131
|
as a DOM property; the `placeholder` prop still wins over
|
|
100
132
|
`texts.searchPlaceholder` when both are set:
|
|
101
133
|
|
|
@@ -10,6 +10,31 @@ Wrap the label in `c-option-value` when an option carries more than its
|
|
|
10
10
|
label, such as a description; the rest of the option's markup still renders
|
|
11
11
|
in the list row.
|
|
12
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
|
+
|
|
13
38
|
## Multiple selection
|
|
14
39
|
|
|
15
40
|
Set `multiple` to let the user pick several options. The value is then an
|
|
@@ -28,9 +53,16 @@ tags and fold the rest into a single "+N more" tag, or `max-tags="0"` to
|
|
|
28
53
|
show no tags at all — the field then reads "N selected". Assistive
|
|
29
54
|
technology always hears the full selection as the field's value.
|
|
30
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
|
+
|
|
31
63
|
The row checkboxes recolour like c-checkbox's (`::part(indicator)`,
|
|
32
|
-
`::part(mark)`),
|
|
33
|
-
`tag-root` parts:
|
|
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:
|
|
34
66
|
|
|
35
67
|
```css
|
|
36
68
|
c-select::part(tag-root) {
|
|
@@ -41,7 +73,8 @@ c-select::part(tag-root) {
|
|
|
41
73
|
## Texts
|
|
42
74
|
|
|
43
75
|
Every built-in string — the clear and toggle button labels, a tag's remove
|
|
44
|
-
label, the overflow and count texts
|
|
76
|
+
label, the overflow and count texts, the select-all row's label — can be
|
|
77
|
+
replaced for another language
|
|
45
78
|
through the `texts` object, merged over the English defaults. Count and
|
|
46
79
|
label texts are functions, so the object must be bound as a DOM property:
|
|
47
80
|
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
A hierarchical value-selection component: a readonly value field that opens a panel for browsing a tree one level at a time, or searching it as a whole, to commit one item.
|
|
2
|
+
|
|
3
|
+
## Items
|
|
4
|
+
|
|
5
|
+
The tree is the `items` property: an array of `{ value, name }` entries where
|
|
6
|
+
an entry with a non-empty `children` array is a branch and any other entry is
|
|
7
|
+
a leaf. Values must be unique across the whole tree. An optional `code` — a
|
|
8
|
+
classification number, say — is shown before the name in a muted column and
|
|
9
|
+
is matched by the search. Arrays have no attribute form, so bind `items` as a
|
|
10
|
+
DOM property (`:items.prop` in Vue; the React wrapper and property assignment
|
|
11
|
+
do this naturally):
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
const items: CTreeSelectItem[] = [
|
|
15
|
+
{
|
|
16
|
+
value: '1',
|
|
17
|
+
code: '1',
|
|
18
|
+
name: 'Natural sciences',
|
|
19
|
+
children: [
|
|
20
|
+
{
|
|
21
|
+
value: '111',
|
|
22
|
+
code: '111',
|
|
23
|
+
name: 'Mathematics',
|
|
24
|
+
children: [{ value: '1111', code: '1111', name: 'Pure mathematics' }],
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
A `disabled` branch cannot be entered and a `disabled` leaf cannot be
|
|
32
|
+
committed; both render as disabled rows, and the items below a disabled
|
|
33
|
+
branch are listed disabled in search results.
|
|
34
|
+
|
|
35
|
+
The value is the committed item's `value`, or `null` when nothing is
|
|
36
|
+
committed. With `return-object` the value is a fresh `{ value, name, code,
|
|
37
|
+
path }` object instead — `path` holds the item's ancestors root-first, each
|
|
38
|
+
as `{ value, name, code }` — never the `items` entry itself, and never its
|
|
39
|
+
children. The closed field shows the committed item's path on a muted line
|
|
40
|
+
above its code and name.
|
|
41
|
+
|
|
42
|
+
## Browsing and searching
|
|
43
|
+
|
|
44
|
+
The panel lists one level at a time: the top-level items first, then the
|
|
45
|
+
children of whichever branch is picked, with a breadcrumb above the list —
|
|
46
|
+
the root crumb ("All") followed by one crumb per ancestor — for climbing
|
|
47
|
+
back. The header names the level being chosen: give `level-labels` an array
|
|
48
|
+
of names, top level first ("Main field", "Field", "Subfield"), and it reads
|
|
49
|
+
"Choose Field"; a level without a name reads "Choose Level 2". While the
|
|
50
|
+
tree is evenly deep — every leaf at the same level — the header also counts
|
|
51
|
+
the steps ("Step 2 of 3"); in an unevenly deep tree the counter is left out,
|
|
52
|
+
and a level made only of leaves says "Final level" instead. Reopening the
|
|
53
|
+
panel returns to the committed item's level with its row selected, so its
|
|
54
|
+
siblings are one click away.
|
|
55
|
+
|
|
56
|
+
Typing into the search input switches the panel to a flat list of matches
|
|
57
|
+
from the whole tree, each with its path on a second line. The query is
|
|
58
|
+
matched case-insensitively anywhere in the name or code of an item and of
|
|
59
|
+
every ancestor above it, so a query matching a branch lists all of its
|
|
60
|
+
leaves. Supply a `filter` predicate to change the matching — it receives the
|
|
61
|
+
item, the query and the item's ancestors, and lists the item when it returns
|
|
62
|
+
`true`. Because `filter` is a function, it must be bound as a DOM property.
|
|
63
|
+
Deleting the query, or the "Browse instead" control in the header, returns to
|
|
64
|
+
the level the user was browsing.
|
|
65
|
+
|
|
66
|
+
While a query is typed, the runs of each row's code, label and path that
|
|
67
|
+
equal it are marked. The marks are the `match` part, the path line the `path`
|
|
68
|
+
part and the code column the `code` part:
|
|
69
|
+
|
|
70
|
+
```css
|
|
71
|
+
c-tree-select::part(match) {
|
|
72
|
+
font-weight: 600;
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
From the keyboard, ArrowDown and ArrowUp move through the rows and Enter
|
|
77
|
+
activates one: a branch descends, a leaf commits. ArrowRight descends into a
|
|
78
|
+
highlighted branch and ArrowLeft — or Backspace with nothing left to delete —
|
|
79
|
+
climbs one level. Escape closes the panel and returns focus to the field; Tab
|
|
80
|
+
closes it and moves on.
|
|
81
|
+
|
|
82
|
+
## Committing a branch
|
|
83
|
+
|
|
84
|
+
By default only a leaf can be committed; a branch always opens its children.
|
|
85
|
+
Set `allow-branch` to let a branch be the value as well: every level below
|
|
86
|
+
the root then starts with a pinned select-branch row ("Select Natural
|
|
87
|
+
sciences") that commits the branch the user is in, and branches matching a
|
|
88
|
+
query are listed as search results and commit directly. The pinned row is the
|
|
89
|
+
`select-branch` part.
|
|
90
|
+
|
|
91
|
+
## Texts
|
|
92
|
+
|
|
93
|
+
Every built-in string — the root crumb, the header texts, a branch row's
|
|
94
|
+
child count, the select-branch row's label, the "Browse instead" control, the
|
|
95
|
+
no-results row, the search input's placeholder and accessible label, the
|
|
96
|
+
clear and toggle button labels — can be replaced for another language through
|
|
97
|
+
the `texts` object, merged over the English defaults. Interpolated texts are
|
|
98
|
+
functions, so the object must be bound as a DOM property; the `placeholder`
|
|
99
|
+
prop still wins over `texts.searchPlaceholder` when both are set:
|
|
100
|
+
|
|
101
|
+
```vue
|
|
102
|
+
<c-tree-select
|
|
103
|
+
:texts.prop="{
|
|
104
|
+
root: 'Kaikki',
|
|
105
|
+
choose: (level) => `Valitse ${level}`,
|
|
106
|
+
children: (count) => `${count} alakohtaa`,
|
|
107
|
+
}"
|
|
108
|
+
/>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Scrolling
|
|
112
|
+
|
|
113
|
+
The panel shows `items-per-page` full rows (six by default) and then a
|
|
114
|
+
half-visible row instead of a scrollbar: the cut row is the cue that more
|
|
115
|
+
items follow, and the wheel, touch and arrow keys scroll as usual. Set
|
|
116
|
+
`items-per-page="0"` to let the list grow to the space the panel allows; it
|
|
117
|
+
still ends on a half row when it overflows. To bring the native scrollbar
|
|
118
|
+
back:
|
|
119
|
+
|
|
120
|
+
```css
|
|
121
|
+
c-tree-select::part(list) {
|
|
122
|
+
scrollbar-width: auto;
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Lazily loaded trees
|
|
127
|
+
|
|
128
|
+
The component walks the `items` you give it and has no loading state of its
|
|
129
|
+
own: there is no `external` mode and no per-branch fetch event yet. A tree
|
|
130
|
+
that arrives in pieces can still be shown by re-assigning `items` with the
|
|
131
|
+
fetched `children` filled in — the panel keeps its level and re-homes the
|
|
132
|
+
highlight when the tree changes. A branch must already list its children to
|
|
133
|
+
be enterable, so load at least one level ahead of the user.
|
|
@@ -505,7 +505,8 @@ c-text-field:not(:defined),
|
|
|
505
505
|
c-toast:not(:defined),
|
|
506
506
|
c-toasts:not(:defined),
|
|
507
507
|
c-toolbar:not(:defined),
|
|
508
|
-
c-tooltip:not(:defined)
|
|
508
|
+
c-tooltip:not(:defined),
|
|
509
|
+
c-tree-select:not(:defined) {
|
|
509
510
|
visibility: hidden;
|
|
510
511
|
animation-name: c-pre-upgrade-reveal;
|
|
511
512
|
animation-duration: 0s;
|
|
@@ -60,6 +60,10 @@
|
|
|
60
60
|
},
|
|
61
61
|
{ "name": "::part(list)", "description": "The scrollable options listbox" },
|
|
62
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
|
+
},
|
|
63
67
|
{
|
|
64
68
|
"name": "::part(indicator)",
|
|
65
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)"
|
|
@@ -222,6 +226,10 @@
|
|
|
222
226
|
},
|
|
223
227
|
{ "name": "::part(list)", "description": "The scrolling listbox" },
|
|
224
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
|
+
},
|
|
225
233
|
{
|
|
226
234
|
"name": "::part(indicator)",
|
|
227
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"
|
|
@@ -509,6 +517,10 @@
|
|
|
509
517
|
"name": "::part(item)",
|
|
510
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"
|
|
511
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
|
+
},
|
|
512
524
|
{
|
|
513
525
|
"name": "::part(indicator)",
|
|
514
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)"
|
|
@@ -717,6 +729,55 @@
|
|
|
717
729
|
{
|
|
718
730
|
"name": "::part(panel)",
|
|
719
731
|
"description": "The floating tooltip bubble positioned against the trigger"
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
"name": "::part(panel)",
|
|
735
|
+
"description": "The top-layer popover container anchored below the field"
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
"name": "::part(card)",
|
|
739
|
+
"description": "The elevated surface inside the panel holding the search row, the breadcrumb, the header and the list"
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
"name": "::part(search)",
|
|
743
|
+
"description": "The search-input row at the top of the panel"
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
"name": "::part(breadcrumb)",
|
|
747
|
+
"description": "The breadcrumb navigation naming the browsed level's path"
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
"name": "::part(crumb)",
|
|
751
|
+
"description": "One crumb in the breadcrumb: the root crumb, an ancestor, or the collapsed \"…\" crumb"
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
"name": "::part(header)",
|
|
755
|
+
"description": "The header line under the breadcrumb: the level to choose and its step counter, or the match count and the \"Browse instead\" control"
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
"name": "::part(list)",
|
|
759
|
+
"description": "The scrollable listbox: the level list while browsing, the results while searching"
|
|
760
|
+
},
|
|
761
|
+
{ "name": "::part(item)", "description": "One item row in the list" },
|
|
762
|
+
{
|
|
763
|
+
"name": "::part(select-branch)",
|
|
764
|
+
"description": "The pinned select-branch row at the top of a level list inside a branch (`allow-branch`)"
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
"name": "::part(code)",
|
|
768
|
+
"description": "An item's code column, in a row and in the closed field"
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
"name": "::part(path)",
|
|
772
|
+
"description": "The ancestor path line under a search result's label"
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
"name": "::part(match)",
|
|
776
|
+
"description": "A run of an item's code, label or path equal to the query, in a row; underlined in the primary colour, text inherits the row"
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
"name": "::part(info)",
|
|
780
|
+
"description": "The no-results row shown when nothing is listed"
|
|
720
781
|
}
|
|
721
782
|
]
|
|
722
783
|
}
|
|
@@ -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. 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",
|
|
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",
|
|
@@ -161,6 +161,11 @@
|
|
|
161
161
|
"description": "Return object instead of value",
|
|
162
162
|
"values": []
|
|
163
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
|
+
},
|
|
164
169
|
{ "name": "shadow", "description": "Shadow variant", "values": [] },
|
|
165
170
|
{
|
|
166
171
|
"name": "size",
|
|
@@ -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\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`",
|
|
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
|
{
|
|
@@ -549,6 +554,11 @@
|
|
|
549
554
|
"description": "Dropdown parent (the c-select / c-autocomplete host element)",
|
|
550
555
|
"values": [{ "name": "HTMLElement" }]
|
|
551
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
|
+
},
|
|
552
562
|
{
|
|
553
563
|
"name": "type",
|
|
554
564
|
"description": "Parent type — drives autocomplete-only behaviour (highlight, messages)",
|
|
@@ -1345,7 +1355,7 @@
|
|
|
1345
1355
|
},
|
|
1346
1356
|
{
|
|
1347
1357
|
"name": "c-select",
|
|
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",
|
|
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",
|
|
1349
1359
|
"attributes": [
|
|
1350
1360
|
{
|
|
1351
1361
|
"name": "clearable",
|
|
@@ -1420,6 +1430,11 @@
|
|
|
1420
1430
|
"description": "Return object instead of value",
|
|
1421
1431
|
"values": []
|
|
1422
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
|
+
},
|
|
1423
1438
|
{ "name": "shadow", "description": "Shadow variant", "values": [] },
|
|
1424
1439
|
{
|
|
1425
1440
|
"name": "size",
|
|
@@ -2021,6 +2036,87 @@
|
|
|
2021
2036
|
}
|
|
2022
2037
|
],
|
|
2023
2038
|
"references": []
|
|
2039
|
+
},
|
|
2040
|
+
{
|
|
2041
|
+
"name": "c-tree-select",
|
|
2042
|
+
"description": "A hierarchical value-selection component: a readonly value field that opens a panel for browsing a tree one level at a time, or searching it as a whole, to commit one item.\n---\n\n\n### **Events:**\n - **change** - Fired when the selection changes — an item is committed or the selection\nis cleared — carrying the new value: the item's value, the\n`CTreeSelectSelection` with `return-object`, or `null` when cleared.\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.\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 `change` with the same detail — the `v-model` contract.\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, the breadcrumb, the header and the list\n- **search** - The search-input row at the top of the panel\n- **breadcrumb** - The breadcrumb navigation naming the browsed level's path\n- **crumb** - One crumb in the breadcrumb: the root crumb, an ancestor, or the collapsed \"…\" crumb\n- **header** - The header line under the breadcrumb: the level to choose and its step counter, or the match count and the \"Browse instead\" control\n- **list** - The scrollable listbox: the level list while browsing, the results while searching\n- **item** - One item row in the list\n- **select-branch** - The pinned select-branch row at the top of a level list inside a branch (`allow-branch`)\n- **code** - An item's code column, in a row and in the closed field\n- **path** - The ancestor path line under a search result's label\n- **match** - A run of an item's code, label or path equal to the query, in a row; underlined in the primary colour, text inherits the row\n- **info** - The no-results row shown when nothing is listed",
|
|
2043
|
+
"attributes": [
|
|
2044
|
+
{
|
|
2045
|
+
"name": "allow-branch",
|
|
2046
|
+
"description": "Let a branch be committed as the value: a pinned select-branch row heads\nevery level below the root, and matching branches are listed as search\nresults",
|
|
2047
|
+
"values": []
|
|
2048
|
+
},
|
|
2049
|
+
{
|
|
2050
|
+
"name": "clearable",
|
|
2051
|
+
"description": "Make the selected value clearable",
|
|
2052
|
+
"values": []
|
|
2053
|
+
},
|
|
2054
|
+
{
|
|
2055
|
+
"name": "disabled",
|
|
2056
|
+
"description": "Disable the field",
|
|
2057
|
+
"values": []
|
|
2058
|
+
},
|
|
2059
|
+
{
|
|
2060
|
+
"name": "error-message",
|
|
2061
|
+
"description": "Error message shown in place of the hint while the field is invalid",
|
|
2062
|
+
"values": []
|
|
2063
|
+
},
|
|
2064
|
+
{
|
|
2065
|
+
"name": "hide-details",
|
|
2066
|
+
"description": "Hide the hint and error messages",
|
|
2067
|
+
"values": []
|
|
2068
|
+
},
|
|
2069
|
+
{
|
|
2070
|
+
"name": "hint",
|
|
2071
|
+
"description": "Hint text for the field",
|
|
2072
|
+
"values": []
|
|
2073
|
+
},
|
|
2074
|
+
{ "name": "host-id", "description": "Id of the element", "values": [] },
|
|
2075
|
+
{
|
|
2076
|
+
"name": "items-per-page",
|
|
2077
|
+
"description": "Items per page before the list scrolls",
|
|
2078
|
+
"values": []
|
|
2079
|
+
},
|
|
2080
|
+
{ "name": "label", "description": "Element label", "values": [] },
|
|
2081
|
+
{
|
|
2082
|
+
"name": "label-on-top",
|
|
2083
|
+
"description": "Label on top of the field",
|
|
2084
|
+
"values": []
|
|
2085
|
+
},
|
|
2086
|
+
{ "name": "name", "description": "Input field name", "values": [] },
|
|
2087
|
+
{
|
|
2088
|
+
"name": "placeholder",
|
|
2089
|
+
"description": "Placeholder for the search input inside the panel",
|
|
2090
|
+
"values": []
|
|
2091
|
+
},
|
|
2092
|
+
{
|
|
2093
|
+
"name": "required",
|
|
2094
|
+
"description": "Set the field as required",
|
|
2095
|
+
"values": []
|
|
2096
|
+
},
|
|
2097
|
+
{
|
|
2098
|
+
"name": "return-object",
|
|
2099
|
+
"description": "Emit the committed item with its path as a `CTreeSelectSelection` instead\nof its value",
|
|
2100
|
+
"values": []
|
|
2101
|
+
},
|
|
2102
|
+
{ "name": "shadow", "description": "Shadow variant", "values": [] },
|
|
2103
|
+
{
|
|
2104
|
+
"name": "size",
|
|
2105
|
+
"description": "Field height: the 44px default or the 36px `small` box",
|
|
2106
|
+
"values": [{ "name": "default" }, { "name": "small" }]
|
|
2107
|
+
},
|
|
2108
|
+
{
|
|
2109
|
+
"name": "valid",
|
|
2110
|
+
"description": "Set the validity of the field",
|
|
2111
|
+
"values": []
|
|
2112
|
+
},
|
|
2113
|
+
{
|
|
2114
|
+
"name": "value",
|
|
2115
|
+
"description": "Selected value: the committed item's value, or the `CTreeSelectSelection`\nwith `return-object`; `null` when nothing is selected",
|
|
2116
|
+
"values": [{ "name": "CTreeSelectValue" }]
|
|
2117
|
+
}
|
|
2118
|
+
],
|
|
2119
|
+
"references": []
|
|
2024
2120
|
}
|
|
2025
2121
|
]
|
|
2026
2122
|
}
|