@cscfi/csc-ui 4.0.0-alpha.13 → 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 +7259 -6429
- package/dist/custom-elements.json +590 -1
- 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 +49 -0
- package/dist/vscode.html-custom-data.json +81 -0
- package/dist/web-types.json +307 -2
- package/dist-types/components/c-dropdown/CDropdown.vue.d.ts +3 -2
- 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/useAnchoredPanel.d.ts +72 -0
- package/dist-types/shared/useStatusAnnouncer.d.ts +33 -0
- package/dist-types/tag-name-map.d.ts +101 -2
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -729,6 +729,55 @@
|
|
|
729
729
|
{
|
|
730
730
|
"name": "::part(panel)",
|
|
731
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"
|
|
732
781
|
}
|
|
733
782
|
]
|
|
734
783
|
}
|
|
@@ -2036,6 +2036,87 @@
|
|
|
2036
2036
|
}
|
|
2037
2037
|
],
|
|
2038
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": []
|
|
2039
2120
|
}
|
|
2040
2121
|
]
|
|
2041
2122
|
}
|
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@cscfi/csc-ui",
|
|
4
|
-
"version": "4.0.0-alpha.
|
|
4
|
+
"version": "4.0.0-alpha.14",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -1602,7 +1602,7 @@
|
|
|
1602
1602
|
},
|
|
1603
1603
|
{
|
|
1604
1604
|
"name": "selected",
|
|
1605
|
-
"description": "Values of the currently selected items in `multiple
|
|
1605
|
+
"description": "Values of the currently selected items — the picked values in `multiple`\nmode, the single value otherwise; drives each row's `aria-selected`, its\nindicator and the single-mode selected-row check",
|
|
1606
1606
|
"type": "(number | string)[]"
|
|
1607
1607
|
},
|
|
1608
1608
|
{
|
|
@@ -5542,6 +5542,262 @@
|
|
|
5542
5542
|
}
|
|
5543
5543
|
]
|
|
5544
5544
|
}
|
|
5545
|
+
},
|
|
5546
|
+
{
|
|
5547
|
+
"name": "c-tree-select",
|
|
5548
|
+
"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",
|
|
5549
|
+
"doc-url": "",
|
|
5550
|
+
"attributes": [
|
|
5551
|
+
{
|
|
5552
|
+
"name": "allow-branch",
|
|
5553
|
+
"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",
|
|
5554
|
+
"value": { "type": "boolean", "default": "false" }
|
|
5555
|
+
},
|
|
5556
|
+
{
|
|
5557
|
+
"name": "clearable",
|
|
5558
|
+
"description": "Make the selected value clearable",
|
|
5559
|
+
"value": { "type": "boolean", "default": "false" }
|
|
5560
|
+
},
|
|
5561
|
+
{
|
|
5562
|
+
"name": "disabled",
|
|
5563
|
+
"description": "Disable the field",
|
|
5564
|
+
"value": { "type": "boolean", "default": "false" }
|
|
5565
|
+
},
|
|
5566
|
+
{
|
|
5567
|
+
"name": "error-message",
|
|
5568
|
+
"description": "Error message shown in place of the hint while the field is invalid",
|
|
5569
|
+
"value": { "type": "string", "default": "''" }
|
|
5570
|
+
},
|
|
5571
|
+
{
|
|
5572
|
+
"name": "hide-details",
|
|
5573
|
+
"description": "Hide the hint and error messages",
|
|
5574
|
+
"value": { "type": "boolean", "default": "false" }
|
|
5575
|
+
},
|
|
5576
|
+
{
|
|
5577
|
+
"name": "hint",
|
|
5578
|
+
"description": "Hint text for the field",
|
|
5579
|
+
"value": { "type": "string", "default": "''" }
|
|
5580
|
+
},
|
|
5581
|
+
{
|
|
5582
|
+
"name": "host-id",
|
|
5583
|
+
"description": "Id of the element",
|
|
5584
|
+
"value": { "type": "string", "default": "''" }
|
|
5585
|
+
},
|
|
5586
|
+
{
|
|
5587
|
+
"name": "items-per-page",
|
|
5588
|
+
"description": "Items per page before the list scrolls",
|
|
5589
|
+
"value": { "type": "number", "default": "6" }
|
|
5590
|
+
},
|
|
5591
|
+
{
|
|
5592
|
+
"name": "label",
|
|
5593
|
+
"description": "Element label",
|
|
5594
|
+
"value": { "type": "string", "default": "''" }
|
|
5595
|
+
},
|
|
5596
|
+
{
|
|
5597
|
+
"name": "label-on-top",
|
|
5598
|
+
"description": "Label on top of the field",
|
|
5599
|
+
"value": { "type": "boolean", "default": "false" }
|
|
5600
|
+
},
|
|
5601
|
+
{
|
|
5602
|
+
"name": "name",
|
|
5603
|
+
"description": "Input field name",
|
|
5604
|
+
"value": { "type": "string", "default": "''" }
|
|
5605
|
+
},
|
|
5606
|
+
{
|
|
5607
|
+
"name": "placeholder",
|
|
5608
|
+
"description": "Placeholder for the search input inside the panel",
|
|
5609
|
+
"value": { "type": "string", "default": "''" }
|
|
5610
|
+
},
|
|
5611
|
+
{
|
|
5612
|
+
"name": "required",
|
|
5613
|
+
"description": "Set the field as required",
|
|
5614
|
+
"value": { "type": "boolean", "default": "false" }
|
|
5615
|
+
},
|
|
5616
|
+
{
|
|
5617
|
+
"name": "return-object",
|
|
5618
|
+
"description": "Emit the committed item with its path as a `CTreeSelectSelection` instead\nof its value",
|
|
5619
|
+
"value": { "type": "boolean", "default": "false" }
|
|
5620
|
+
},
|
|
5621
|
+
{
|
|
5622
|
+
"name": "shadow",
|
|
5623
|
+
"description": "Shadow variant",
|
|
5624
|
+
"value": { "type": "boolean", "default": "false" }
|
|
5625
|
+
},
|
|
5626
|
+
{
|
|
5627
|
+
"name": "size",
|
|
5628
|
+
"description": "Field height: the 44px default or the 36px `small` box",
|
|
5629
|
+
"value": { "type": "'default' | 'small'", "default": "'default'" }
|
|
5630
|
+
},
|
|
5631
|
+
{
|
|
5632
|
+
"name": "valid",
|
|
5633
|
+
"description": "Set the validity of the field",
|
|
5634
|
+
"value": { "type": "boolean", "default": "true" }
|
|
5635
|
+
},
|
|
5636
|
+
{
|
|
5637
|
+
"name": "value",
|
|
5638
|
+
"description": "Selected value: the committed item's value, or the `CTreeSelectSelection`\nwith `return-object`; `null` when nothing is selected",
|
|
5639
|
+
"value": { "type": "CTreeSelectValue", "default": "null" }
|
|
5640
|
+
}
|
|
5641
|
+
],
|
|
5642
|
+
"slots": [],
|
|
5643
|
+
"events": [
|
|
5644
|
+
{
|
|
5645
|
+
"name": "change",
|
|
5646
|
+
"type": "CustomEvent<CTreeSelectValue>",
|
|
5647
|
+
"description": "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."
|
|
5648
|
+
},
|
|
5649
|
+
{
|
|
5650
|
+
"name": "change:query",
|
|
5651
|
+
"type": "CustomEvent<string>",
|
|
5652
|
+
"description": "Fired whenever the query changes — on every keystroke in the search\ninput, and with an empty string when the panel opens. Carries the query\nstring."
|
|
5653
|
+
},
|
|
5654
|
+
{
|
|
5655
|
+
"name": "input",
|
|
5656
|
+
"type": "CustomEvent<void>",
|
|
5657
|
+
"description": "Native bubbling input event dispatched alongside every value change so a\nplain `v-model` stays in sync. Carries no detail."
|
|
5658
|
+
},
|
|
5659
|
+
{
|
|
5660
|
+
"name": "update:value",
|
|
5661
|
+
"type": "CustomEvent<CTreeSelectValue>",
|
|
5662
|
+
"description": "Fired alongside `change` with the same detail — the `v-model` contract."
|
|
5663
|
+
}
|
|
5664
|
+
],
|
|
5665
|
+
"js": {
|
|
5666
|
+
"properties": [
|
|
5667
|
+
{
|
|
5668
|
+
"name": "allowBranch",
|
|
5669
|
+
"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",
|
|
5670
|
+
"type": "boolean"
|
|
5671
|
+
},
|
|
5672
|
+
{
|
|
5673
|
+
"name": "clearable",
|
|
5674
|
+
"description": "Make the selected value clearable",
|
|
5675
|
+
"type": "boolean"
|
|
5676
|
+
},
|
|
5677
|
+
{
|
|
5678
|
+
"name": "disabled",
|
|
5679
|
+
"description": "Disable the field",
|
|
5680
|
+
"type": "boolean"
|
|
5681
|
+
},
|
|
5682
|
+
{
|
|
5683
|
+
"name": "errorMessage",
|
|
5684
|
+
"description": "Error message shown in place of the hint while the field is invalid",
|
|
5685
|
+
"type": "string"
|
|
5686
|
+
},
|
|
5687
|
+
{
|
|
5688
|
+
"name": "filter",
|
|
5689
|
+
"description": "Custom search predicate; receives the item, the query and the item's\nancestors. Functions have no attribute form — bind as a DOM property",
|
|
5690
|
+
"type": "CTreeSelectFilter"
|
|
5691
|
+
},
|
|
5692
|
+
{
|
|
5693
|
+
"name": "hideDetails",
|
|
5694
|
+
"description": "Hide the hint and error messages",
|
|
5695
|
+
"type": "boolean"
|
|
5696
|
+
},
|
|
5697
|
+
{
|
|
5698
|
+
"name": "hint",
|
|
5699
|
+
"description": "Hint text for the field",
|
|
5700
|
+
"type": "string"
|
|
5701
|
+
},
|
|
5702
|
+
{
|
|
5703
|
+
"name": "hostId",
|
|
5704
|
+
"description": "Id of the element",
|
|
5705
|
+
"type": "string"
|
|
5706
|
+
},
|
|
5707
|
+
{
|
|
5708
|
+
"name": "items",
|
|
5709
|
+
"description": "The tree to pick from. Arrays have no attribute form — bind as a DOM\nproperty (`:items.prop` in Vue)",
|
|
5710
|
+
"type": "CTreeSelectItem[]"
|
|
5711
|
+
},
|
|
5712
|
+
{
|
|
5713
|
+
"name": "itemsPerPage",
|
|
5714
|
+
"description": "Items per page before the list scrolls",
|
|
5715
|
+
"type": "number"
|
|
5716
|
+
},
|
|
5717
|
+
{
|
|
5718
|
+
"name": "label",
|
|
5719
|
+
"description": "Element label",
|
|
5720
|
+
"type": "string"
|
|
5721
|
+
},
|
|
5722
|
+
{
|
|
5723
|
+
"name": "labelOnTop",
|
|
5724
|
+
"description": "Label on top of the field",
|
|
5725
|
+
"type": "boolean"
|
|
5726
|
+
},
|
|
5727
|
+
{
|
|
5728
|
+
"name": "levelLabels",
|
|
5729
|
+
"description": "Names of the levels, top level first, shown in the panel header; a\nmissing entry falls back to `texts.level(n)`. Arrays have no attribute\nform — bind as a DOM property",
|
|
5730
|
+
"type": "string[]"
|
|
5731
|
+
},
|
|
5732
|
+
{
|
|
5733
|
+
"name": "name",
|
|
5734
|
+
"description": "Input field name",
|
|
5735
|
+
"type": "string"
|
|
5736
|
+
},
|
|
5737
|
+
{
|
|
5738
|
+
"name": "placeholder",
|
|
5739
|
+
"description": "Placeholder for the search input inside the panel",
|
|
5740
|
+
"type": "string"
|
|
5741
|
+
},
|
|
5742
|
+
{
|
|
5743
|
+
"name": "required",
|
|
5744
|
+
"description": "Set the field as required",
|
|
5745
|
+
"type": "boolean"
|
|
5746
|
+
},
|
|
5747
|
+
{
|
|
5748
|
+
"name": "returnObject",
|
|
5749
|
+
"description": "Emit the committed item with its path as a `CTreeSelectSelection` instead\nof its value",
|
|
5750
|
+
"type": "boolean"
|
|
5751
|
+
},
|
|
5752
|
+
{
|
|
5753
|
+
"name": "shadow",
|
|
5754
|
+
"description": "Shadow variant",
|
|
5755
|
+
"type": "boolean"
|
|
5756
|
+
},
|
|
5757
|
+
{
|
|
5758
|
+
"name": "size",
|
|
5759
|
+
"description": "Field height: the 44px default or the 36px `small` box",
|
|
5760
|
+
"type": "'default' | 'small'"
|
|
5761
|
+
},
|
|
5762
|
+
{
|
|
5763
|
+
"name": "texts",
|
|
5764
|
+
"description": "UI text overrides (i18n), merged over the English defaults. Objects have\nno attribute form — bind as a DOM property (`:texts.prop` in Vue)",
|
|
5765
|
+
"type": "CTreeSelectTexts"
|
|
5766
|
+
},
|
|
5767
|
+
{
|
|
5768
|
+
"name": "valid",
|
|
5769
|
+
"description": "Set the validity of the field",
|
|
5770
|
+
"type": "boolean"
|
|
5771
|
+
},
|
|
5772
|
+
{
|
|
5773
|
+
"name": "value",
|
|
5774
|
+
"description": "Selected value: the committed item's value, or the `CTreeSelectSelection`\nwith `return-object`; `null` when nothing is selected",
|
|
5775
|
+
"type": "CTreeSelectValue"
|
|
5776
|
+
}
|
|
5777
|
+
],
|
|
5778
|
+
"events": [
|
|
5779
|
+
{
|
|
5780
|
+
"name": "change",
|
|
5781
|
+
"type": "CustomEvent<CTreeSelectValue>",
|
|
5782
|
+
"description": "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."
|
|
5783
|
+
},
|
|
5784
|
+
{
|
|
5785
|
+
"name": "change:query",
|
|
5786
|
+
"type": "CustomEvent<string>",
|
|
5787
|
+
"description": "Fired whenever the query changes — on every keystroke in the search\ninput, and with an empty string when the panel opens. Carries the query\nstring."
|
|
5788
|
+
},
|
|
5789
|
+
{
|
|
5790
|
+
"name": "input",
|
|
5791
|
+
"type": "CustomEvent<void>",
|
|
5792
|
+
"description": "Native bubbling input event dispatched alongside every value change so a\nplain `v-model` stays in sync. Carries no detail."
|
|
5793
|
+
},
|
|
5794
|
+
{
|
|
5795
|
+
"name": "update:value",
|
|
5796
|
+
"type": "CustomEvent<CTreeSelectValue>",
|
|
5797
|
+
"description": "Fired alongside `change` with the same detail — the `v-model` contract."
|
|
5798
|
+
}
|
|
5799
|
+
]
|
|
5800
|
+
}
|
|
5545
5801
|
}
|
|
5546
5802
|
]
|
|
5547
5803
|
},
|
|
@@ -6285,6 +6541,55 @@
|
|
|
6285
6541
|
{
|
|
6286
6542
|
"name": "part(panel)",
|
|
6287
6543
|
"description": "The floating tooltip bubble positioned against the trigger"
|
|
6544
|
+
},
|
|
6545
|
+
{
|
|
6546
|
+
"name": "part(panel)",
|
|
6547
|
+
"description": "The top-layer popover container anchored below the field"
|
|
6548
|
+
},
|
|
6549
|
+
{
|
|
6550
|
+
"name": "part(card)",
|
|
6551
|
+
"description": "The elevated surface inside the panel holding the search row, the breadcrumb, the header and the list"
|
|
6552
|
+
},
|
|
6553
|
+
{
|
|
6554
|
+
"name": "part(search)",
|
|
6555
|
+
"description": "The search-input row at the top of the panel"
|
|
6556
|
+
},
|
|
6557
|
+
{
|
|
6558
|
+
"name": "part(breadcrumb)",
|
|
6559
|
+
"description": "The breadcrumb navigation naming the browsed level's path"
|
|
6560
|
+
},
|
|
6561
|
+
{
|
|
6562
|
+
"name": "part(crumb)",
|
|
6563
|
+
"description": "One crumb in the breadcrumb: the root crumb, an ancestor, or the collapsed \"…\" crumb"
|
|
6564
|
+
},
|
|
6565
|
+
{
|
|
6566
|
+
"name": "part(header)",
|
|
6567
|
+
"description": "The header line under the breadcrumb: the level to choose and its step counter, or the match count and the \"Browse instead\" control"
|
|
6568
|
+
},
|
|
6569
|
+
{
|
|
6570
|
+
"name": "part(list)",
|
|
6571
|
+
"description": "The scrollable listbox: the level list while browsing, the results while searching"
|
|
6572
|
+
},
|
|
6573
|
+
{ "name": "part(item)", "description": "One item row in the list" },
|
|
6574
|
+
{
|
|
6575
|
+
"name": "part(select-branch)",
|
|
6576
|
+
"description": "The pinned select-branch row at the top of a level list inside a branch (`allow-branch`)"
|
|
6577
|
+
},
|
|
6578
|
+
{
|
|
6579
|
+
"name": "part(code)",
|
|
6580
|
+
"description": "An item's code column, in a row and in the closed field"
|
|
6581
|
+
},
|
|
6582
|
+
{
|
|
6583
|
+
"name": "part(path)",
|
|
6584
|
+
"description": "The ancestor path line under a search result's label"
|
|
6585
|
+
},
|
|
6586
|
+
{
|
|
6587
|
+
"name": "part(match)",
|
|
6588
|
+
"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"
|
|
6589
|
+
},
|
|
6590
|
+
{
|
|
6591
|
+
"name": "part(info)",
|
|
6592
|
+
"description": "The no-results row shown when nothing is listed"
|
|
6288
6593
|
}
|
|
6289
6594
|
]
|
|
6290
6595
|
}
|
|
@@ -28,8 +28,9 @@ interface CDropdownProps {
|
|
|
28
28
|
*/
|
|
29
29
|
selectAllRow?: CDropdownSelectAllRow | null;
|
|
30
30
|
/**
|
|
31
|
-
* Values of the currently selected items in `multiple`
|
|
32
|
-
* row's `aria-selected
|
|
31
|
+
* Values of the currently selected items — the picked values in `multiple`
|
|
32
|
+
* mode, the single value otherwise; drives each row's `aria-selected`, its
|
|
33
|
+
* indicator and the single-mode selected-row check
|
|
33
34
|
*/
|
|
34
35
|
selected?: (number | string)[];
|
|
35
36
|
/** Parent type — drives autocomplete-only behaviour (highlight, messages) */
|