@jxsuite/ui 0.0.0 → 0.1.0
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/components/jx-accordion-item.json +281 -0
- package/components/jx-accordion.json +33 -0
- package/components/jx-action-button.json +261 -33
- package/components/jx-action-group.json +123 -0
- package/components/jx-button.json +133 -25
- package/components/jx-checkbox.json +215 -0
- package/components/jx-color-area.json +263 -0
- package/components/jx-color-field.json +565 -0
- package/components/jx-color-slider.json +216 -0
- package/components/jx-combobox.json +544 -0
- package/components/jx-dialog.json +416 -0
- package/components/jx-divider.json +52 -0
- package/components/jx-dot.json +38 -0
- package/components/jx-field.json +162 -0
- package/components/jx-kbd.json +24 -0
- package/components/jx-listbox.json +76 -0
- package/components/jx-menu-item.json +5 -12
- package/components/jx-menu.json +45 -6
- package/components/jx-number-field.json +441 -0
- package/components/jx-option.json +350 -0
- package/components/jx-popover.json +227 -0
- package/components/jx-select.json +637 -0
- package/components/jx-spinner.json +129 -0
- package/components/jx-split.json +221 -0
- package/components/jx-swatch-group.json +107 -0
- package/components/jx-swatch.json +262 -0
- package/components/jx-switch.json +253 -0
- package/components/jx-tab-panel.json +58 -0
- package/components/jx-tab.json +296 -0
- package/components/jx-tabs.json +124 -0
- package/components/jx-textfield.json +639 -0
- package/components/jx-toast-host.json +121 -0
- package/components/jx-toast.json +255 -0
- package/components/jx-toolbar.json +81 -0
- package/components/jx-tooltip.json +207 -0
- package/components/jx-tree-item.json +325 -0
- package/components/jx-tree.json +202 -0
- package/icons/list.json +4 -0
- package/icons/manifest.json +12 -0
- package/package.json +27 -5
- package/project.json +164 -153
- package/src/behaviors/action-group.ts +255 -0
- package/src/behaviors/color-area.ts +303 -0
- package/src/behaviors/color-field.ts +465 -0
- package/src/behaviors/color-slider.ts +154 -0
- package/src/behaviors/combobox.ts +474 -0
- package/src/behaviors/dialog.ts +137 -0
- package/src/behaviors/listbox.ts +118 -0
- package/src/behaviors/menu.ts +80 -48
- package/src/behaviors/number-field.ts +161 -0
- package/src/behaviors/popover.ts +399 -0
- package/src/behaviors/select.ts +154 -0
- package/src/behaviors/split.ts +478 -0
- package/src/behaviors/swatch-group.ts +297 -0
- package/src/behaviors/tabs.ts +319 -0
- package/src/behaviors/textfield.ts +164 -0
- package/src/behaviors/toast-host.ts +241 -0
- package/src/behaviors/toast.ts +261 -0
- package/src/behaviors/toolbar.ts +413 -0
- package/src/behaviors/tooltip.ts +715 -0
- package/src/behaviors/tree.ts +830 -0
- package/src/color.ts +433 -0
- package/src/documents.ts +91 -1
- package/src/index.ts +41 -1
- package/src/loaders.ts +47 -0
- package/src/testing/anchor-support.ts +28 -0
- package/src/testing/popover-shim.ts +39 -6
- package/src/theme.ts +30 -6
- package/stylebook/jx-accordion-item.json +195 -0
- package/stylebook/jx-accordion.json +220 -0
- package/stylebook/jx-action-button.json +191 -23
- package/stylebook/jx-action-group.json +335 -0
- package/stylebook/jx-button.json +129 -26
- package/stylebook/jx-checkbox.json +245 -0
- package/stylebook/jx-color-area.json +272 -0
- package/stylebook/jx-color-field.json +261 -0
- package/stylebook/jx-color-slider.json +220 -0
- package/stylebook/jx-combobox.json +332 -0
- package/stylebook/jx-dialog.json +186 -0
- package/stylebook/jx-divider.json +125 -0
- package/stylebook/jx-dot.json +92 -0
- package/stylebook/jx-field.json +313 -0
- package/stylebook/jx-icon.json +4 -0
- package/stylebook/jx-kbd.json +90 -0
- package/stylebook/jx-listbox.json +337 -0
- package/stylebook/jx-menu.json +0 -1
- package/stylebook/jx-number-field.json +203 -0
- package/stylebook/jx-option.json +285 -0
- package/stylebook/jx-popover.json +123 -0
- package/stylebook/jx-select.json +407 -0
- package/stylebook/jx-spinner.json +111 -0
- package/stylebook/jx-split.json +170 -0
- package/stylebook/jx-swatch-group.json +175 -0
- package/stylebook/jx-swatch.json +249 -0
- package/stylebook/jx-switch.json +240 -0
- package/stylebook/jx-tab-panel.json +147 -0
- package/stylebook/jx-tab.json +201 -0
- package/stylebook/jx-tabs.json +278 -0
- package/stylebook/jx-textfield.json +309 -0
- package/stylebook/jx-toast-host.json +157 -0
- package/stylebook/jx-toast.json +266 -0
- package/stylebook/jx-toolbar.json +435 -0
- package/stylebook/jx-tooltip.json +162 -0
- package/stylebook/jx-tree-item.json +258 -0
- package/stylebook/jx-tree.json +429 -0
|
@@ -0,0 +1,637 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://jxsuite.com/schema/v1",
|
|
3
|
+
"$id": "JxSelect",
|
|
4
|
+
"tagName": "jx-select",
|
|
5
|
+
"observedAttributes": [
|
|
6
|
+
"label",
|
|
7
|
+
"labelledby",
|
|
8
|
+
"describedby",
|
|
9
|
+
"value",
|
|
10
|
+
"name",
|
|
11
|
+
"disabled",
|
|
12
|
+
"required",
|
|
13
|
+
"size",
|
|
14
|
+
"invalid",
|
|
15
|
+
"error",
|
|
16
|
+
"help"
|
|
17
|
+
],
|
|
18
|
+
"state": {
|
|
19
|
+
"value": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"default": "",
|
|
22
|
+
"attribute": "value",
|
|
23
|
+
"description": "The chosen row's value. The empty string is a LEGAL value here — it is the inherit row, an option a reader can arrow to — and never means unset, so nothing in this element treats it as absence. It is written into the control as a PROPERTY and re-asserted by the sidecar whenever the option list changes; the selected content attribute is never written, because the first real keyboard pick makes an option dirty and the attribute stops moving selectedness from that moment on."
|
|
24
|
+
},
|
|
25
|
+
"options": {
|
|
26
|
+
"type": "array",
|
|
27
|
+
"default": [],
|
|
28
|
+
"description": "Ungrouped rows, drawn above every group. A row is { value, label, description?, disabled?, face?, swatch?, line?, weight?, slant?, variant?, transform?, decoration? }: value and label are what the control is made of, and the rest are the drawing channels — a font face, a colour, a border style, and the five typographic axes the label can draw itself in (font weight, font style, font variant, text transform, text decoration), each arriving as a custom property on its own span so seventy rows still cost zero rules."
|
|
29
|
+
},
|
|
30
|
+
"groups": {
|
|
31
|
+
"type": "array",
|
|
32
|
+
"default": [],
|
|
33
|
+
"description": "Grouped rows, as { id, label, rows }. Each group draws BOTH halves of its delimiter: the optgroup's label is what names the group in the accessibility tree, and the legend inside it is what draws the heading. Neither half substitutes for the other — strip the legend and the group keeps its name with nothing to look at, an 18px empty band above its first row."
|
|
34
|
+
},
|
|
35
|
+
"unlisted": {
|
|
36
|
+
"type": "array",
|
|
37
|
+
"default": [],
|
|
38
|
+
"description": "Zero rows or one: the stand-in row for a value no group holds. A select whose value matches no option falls silently to index 0, so the sidecar synthesises the row rather than letting the element lie about what it holds. The sidecar computes it and this document renders it — the sidecar never builds DOM — and the row it renders carries part=\"unlisted\", which is how the same computation tells its own row apart from the listed ones and does not loop."
|
|
39
|
+
},
|
|
40
|
+
"label": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"default": "",
|
|
43
|
+
"attribute": "label",
|
|
44
|
+
"description": "The accessible name, forwarded to the control as aria-label. Required unless a visible label points at the control."
|
|
45
|
+
},
|
|
46
|
+
"labelledby": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"default": "",
|
|
49
|
+
"attribute": "labelledby",
|
|
50
|
+
"description": "Forwarded to the inner control as aria-labelledby."
|
|
51
|
+
},
|
|
52
|
+
"describedby": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"default": "",
|
|
55
|
+
"attribute": "describedby",
|
|
56
|
+
"description": "Forwarded to the inner control as aria-describedby, after the element's own error and help sentences."
|
|
57
|
+
},
|
|
58
|
+
"name": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"default": "",
|
|
61
|
+
"attribute": "name",
|
|
62
|
+
"description": "The form field name, forwarded to the control. It is also the answer to the one HTML-validity issue a page carrying this element otherwise raises: a form field element should have an id or a name."
|
|
63
|
+
},
|
|
64
|
+
"disabled": {
|
|
65
|
+
"type": "boolean",
|
|
66
|
+
"default": false,
|
|
67
|
+
"attribute": "disabled",
|
|
68
|
+
"description": "Cannot be opened or focused, and submits nothing."
|
|
69
|
+
},
|
|
70
|
+
"required": {
|
|
71
|
+
"type": "boolean",
|
|
72
|
+
"default": false,
|
|
73
|
+
"attribute": "required",
|
|
74
|
+
"description": "Forwarded to the control, for the form it sits in."
|
|
75
|
+
},
|
|
76
|
+
"size": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"default": "md",
|
|
79
|
+
"attribute": "size",
|
|
80
|
+
"description": "sm, md or lg. The control height is the kit's, so a row of controls lines up."
|
|
81
|
+
},
|
|
82
|
+
"invalid": {
|
|
83
|
+
"type": "boolean",
|
|
84
|
+
"default": false,
|
|
85
|
+
"attribute": "invalid",
|
|
86
|
+
"description": "The value is refused: the control says aria-invalid and draws in the danger colour."
|
|
87
|
+
},
|
|
88
|
+
"error": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"default": "",
|
|
91
|
+
"attribute": "error",
|
|
92
|
+
"description": "The sentence explaining a refused value, drawn under the control and announced as it changes. Its region is permanent and empty until there is something to say, so the first refusal is announced rather than only a later one."
|
|
93
|
+
},
|
|
94
|
+
"help": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"default": "",
|
|
97
|
+
"attribute": "help",
|
|
98
|
+
"description": "A sentence of guidance under the control."
|
|
99
|
+
},
|
|
100
|
+
"uid": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"default": "",
|
|
103
|
+
"description": "This element's own id stem, minted on mount. The error and help sentences take their ids from it, and the control names those ids in aria-describedby."
|
|
104
|
+
},
|
|
105
|
+
"hasError": {
|
|
106
|
+
"$expression": {
|
|
107
|
+
"operator": "!==",
|
|
108
|
+
"target": {
|
|
109
|
+
"$ref": "#/state/error"
|
|
110
|
+
},
|
|
111
|
+
"value": ""
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"hasHelp": {
|
|
115
|
+
"$expression": {
|
|
116
|
+
"operator": "!==",
|
|
117
|
+
"target": {
|
|
118
|
+
"$ref": "#/state/help"
|
|
119
|
+
},
|
|
120
|
+
"value": ""
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"onMount": {
|
|
124
|
+
"$prototype": "Function",
|
|
125
|
+
"$src": "jx-ui:/behaviors/select.ts",
|
|
126
|
+
"$export": "mountSelect",
|
|
127
|
+
"description": "Mints the id stem, then keeps the control's selectedness and its stand-in row in step with state.value as the option list changes. Both are things a document body cannot say: the value property binding runs before the first option exists, its write is refused, and it never re-runs because nothing it read changed."
|
|
128
|
+
},
|
|
129
|
+
"onChange": {
|
|
130
|
+
"$prototype": "Function",
|
|
131
|
+
"body": [
|
|
132
|
+
{
|
|
133
|
+
"operator": "=",
|
|
134
|
+
"target": {
|
|
135
|
+
"$ref": "#/state/value"
|
|
136
|
+
},
|
|
137
|
+
"value": {
|
|
138
|
+
"$ref": "event#/target/value"
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"description": "Writes what the reader picked into value, and NOTHING else. The control's own input and change already bubble out of the element with e.target being the inner select, which is the contract jx-textfield has; a body that dispatched change as well would hear its own event and re-enter — one pick measured 43 change events before this said only the one thing."
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"attributes": {
|
|
146
|
+
"data-size": "${state.size}",
|
|
147
|
+
"data-invalid": "${state.invalid ? '' : null}",
|
|
148
|
+
"data-disabled": "${state.disabled ? '' : null}"
|
|
149
|
+
},
|
|
150
|
+
"style": {
|
|
151
|
+
"display": "inline-flex",
|
|
152
|
+
"position": "relative",
|
|
153
|
+
"flexDirection": "column",
|
|
154
|
+
"gap": "var(--jx-space-1)",
|
|
155
|
+
"verticalAlign": "middle",
|
|
156
|
+
"minWidth": "0",
|
|
157
|
+
"--jx-select-h": "var(--jx-control-h)",
|
|
158
|
+
"--jx-select-pad": "var(--jx-space-3)",
|
|
159
|
+
"&[hidden]": {
|
|
160
|
+
"display": "none"
|
|
161
|
+
},
|
|
162
|
+
"&[data-size=\"sm\"]": {
|
|
163
|
+
"--jx-select-h": "calc(var(--jx-control-h) - 4px)",
|
|
164
|
+
"--jx-select-pad": "var(--jx-space-2)"
|
|
165
|
+
},
|
|
166
|
+
"&[data-size=\"lg\"]": {
|
|
167
|
+
"--jx-select-h": "calc(var(--jx-control-h) + 8px)"
|
|
168
|
+
},
|
|
169
|
+
"& select": {
|
|
170
|
+
"appearance": "base-select",
|
|
171
|
+
"boxSizing": "border-box",
|
|
172
|
+
"display": "flex",
|
|
173
|
+
"alignItems": "center",
|
|
174
|
+
"width": "100%",
|
|
175
|
+
"minHeight": "var(--jx-select-h)",
|
|
176
|
+
"margin": "0",
|
|
177
|
+
"paddingBlock": "0",
|
|
178
|
+
"paddingInline": "var(--jx-select-pad)",
|
|
179
|
+
"border": "1px solid var(--jx-border-strong)",
|
|
180
|
+
"borderRadius": "var(--jx-radius-sm)",
|
|
181
|
+
"background": "var(--jx-bg-input)",
|
|
182
|
+
"color": "var(--jx-fg)",
|
|
183
|
+
"font": "inherit",
|
|
184
|
+
"fontFamily": "var(--jx-font-sans)",
|
|
185
|
+
"fontSize": "var(--jx-text-md)",
|
|
186
|
+
"lineHeight": "var(--jx-leading-md)",
|
|
187
|
+
"textAlign": "start",
|
|
188
|
+
"outline": "none",
|
|
189
|
+
"transition": "border-color var(--jx-dur-1) var(--jx-ease-out)",
|
|
190
|
+
":hover": {
|
|
191
|
+
"borderColor": "var(--jx-fg-muted)"
|
|
192
|
+
},
|
|
193
|
+
":focus-visible": {
|
|
194
|
+
"outline": "var(--jx-focus-ring)",
|
|
195
|
+
"outlineOffset": "-1px"
|
|
196
|
+
},
|
|
197
|
+
":disabled": {
|
|
198
|
+
"opacity": "0.5",
|
|
199
|
+
"cursor": "default"
|
|
200
|
+
},
|
|
201
|
+
"&::picker(select)": {
|
|
202
|
+
"appearance": "base-select",
|
|
203
|
+
"boxSizing": "border-box",
|
|
204
|
+
"margin": "0",
|
|
205
|
+
"padding": "var(--jx-space-1)",
|
|
206
|
+
"border": "0",
|
|
207
|
+
"borderRadius": "var(--jx-radius-md)",
|
|
208
|
+
"background": "var(--jx-bg-overlay)",
|
|
209
|
+
"color": "var(--jx-fg)",
|
|
210
|
+
"boxShadow": "var(--jx-shadow-popover)",
|
|
211
|
+
"maxHeight": "min(320px, 60vh)",
|
|
212
|
+
"overflowY": "auto",
|
|
213
|
+
"fontFamily": "var(--jx-font-sans)",
|
|
214
|
+
"fontSize": "var(--jx-text-md)"
|
|
215
|
+
},
|
|
216
|
+
"&::picker-icon": {
|
|
217
|
+
"marginInlineStart": "auto",
|
|
218
|
+
"paddingInlineStart": "var(--jx-space-2)",
|
|
219
|
+
"color": "var(--jx-fg-muted)",
|
|
220
|
+
"transition": "rotate var(--jx-dur-1) var(--jx-ease-out)"
|
|
221
|
+
},
|
|
222
|
+
"&:open::picker-icon": {
|
|
223
|
+
"rotate": "180deg"
|
|
224
|
+
},
|
|
225
|
+
"& optgroup": {
|
|
226
|
+
"margin": "0",
|
|
227
|
+
"padding": "0",
|
|
228
|
+
"font": "inherit",
|
|
229
|
+
"color": "inherit",
|
|
230
|
+
"background": "none"
|
|
231
|
+
},
|
|
232
|
+
"& hr": {
|
|
233
|
+
"margin": "var(--jx-space-1) var(--jx-space-2)",
|
|
234
|
+
"border": "0",
|
|
235
|
+
"borderBlockStart": "1px solid var(--jx-border)"
|
|
236
|
+
},
|
|
237
|
+
"& option": {
|
|
238
|
+
"boxSizing": "border-box",
|
|
239
|
+
"display": "flex",
|
|
240
|
+
"alignItems": "center",
|
|
241
|
+
"gap": "var(--jx-space-3)",
|
|
242
|
+
"minHeight": "var(--jx-select-h)",
|
|
243
|
+
"paddingBlock": "var(--jx-space-1)",
|
|
244
|
+
"paddingInline": "var(--jx-space-2)",
|
|
245
|
+
"borderRadius": "var(--jx-radius-xs)",
|
|
246
|
+
"color": "var(--jx-fg)",
|
|
247
|
+
":hover": {
|
|
248
|
+
"background": "var(--jx-hover-bg)"
|
|
249
|
+
},
|
|
250
|
+
":disabled": {
|
|
251
|
+
"opacity": "0.45"
|
|
252
|
+
},
|
|
253
|
+
"&::checkmark": {
|
|
254
|
+
"order": "1",
|
|
255
|
+
"marginInlineStart": "auto",
|
|
256
|
+
"paddingInlineStart": "var(--jx-space-3)"
|
|
257
|
+
},
|
|
258
|
+
"&:checked::checkmark": {
|
|
259
|
+
"color": "var(--jx-accent)"
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
"& option[hidden]": {
|
|
263
|
+
"display": "none"
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
"&[data-invalid] select": {
|
|
267
|
+
"borderColor": "var(--jx-danger)"
|
|
268
|
+
},
|
|
269
|
+
"& [part=\"trigger\"]": {
|
|
270
|
+
"display": "flex",
|
|
271
|
+
"alignItems": "center",
|
|
272
|
+
"flex": "1 1 auto",
|
|
273
|
+
"minWidth": "0",
|
|
274
|
+
"margin": "0",
|
|
275
|
+
"padding": "0",
|
|
276
|
+
"appearance": "none",
|
|
277
|
+
"border": "0",
|
|
278
|
+
"borderRadius": "0",
|
|
279
|
+
"background": "none",
|
|
280
|
+
"color": "inherit",
|
|
281
|
+
"font": "inherit",
|
|
282
|
+
"textAlign": "start",
|
|
283
|
+
"outline": "none"
|
|
284
|
+
},
|
|
285
|
+
"& [part=\"preview\"]": {
|
|
286
|
+
"display": "flex",
|
|
287
|
+
"alignItems": "center",
|
|
288
|
+
"gap": "var(--jx-space-3)",
|
|
289
|
+
"minWidth": "0",
|
|
290
|
+
"overflow": "hidden",
|
|
291
|
+
"whiteSpace": "nowrap"
|
|
292
|
+
},
|
|
293
|
+
"& [part=\"preview\"] [part=\"description\"]": {
|
|
294
|
+
"display": "none"
|
|
295
|
+
},
|
|
296
|
+
"& [part=\"group-heading\"]": {
|
|
297
|
+
"display": "block",
|
|
298
|
+
"padding": "var(--jx-space-2) var(--jx-space-2) var(--jx-space-1)",
|
|
299
|
+
"fontSize": "var(--jx-text-sm)",
|
|
300
|
+
"fontWeight": "600",
|
|
301
|
+
"color": "var(--jx-fg-muted)"
|
|
302
|
+
},
|
|
303
|
+
"& [part=\"text\"]": {
|
|
304
|
+
"fontFamily": "var(--jx-row-face, inherit)",
|
|
305
|
+
"fontWeight": "var(--jx-row-weight, inherit)",
|
|
306
|
+
"fontStyle": "var(--jx-row-slant, inherit)",
|
|
307
|
+
"fontVariant": "var(--jx-row-variant, inherit)",
|
|
308
|
+
"textTransform": "var(--jx-row-transform, inherit)",
|
|
309
|
+
"textDecoration": "var(--jx-row-decoration, inherit)",
|
|
310
|
+
"overflow": "hidden",
|
|
311
|
+
"textOverflow": "ellipsis",
|
|
312
|
+
"whiteSpace": "nowrap"
|
|
313
|
+
},
|
|
314
|
+
"& [part=\"swatch\"]": {
|
|
315
|
+
"background": "var(--jx-row-swatch, transparent)",
|
|
316
|
+
"inlineSize": "16px",
|
|
317
|
+
"blockSize": "16px",
|
|
318
|
+
"flex": "0 0 auto",
|
|
319
|
+
"borderRadius": "var(--jx-radius-xs)",
|
|
320
|
+
"boxShadow": "inset 0 0 0 1px var(--jx-border)"
|
|
321
|
+
},
|
|
322
|
+
"& [part=\"line\"]": {
|
|
323
|
+
"borderBlockStart": "2px var(--jx-row-line, none) currentColor",
|
|
324
|
+
"inlineSize": "32px",
|
|
325
|
+
"blockSize": "0",
|
|
326
|
+
"flex": "0 0 auto"
|
|
327
|
+
},
|
|
328
|
+
"& [part=\"description\"]": {
|
|
329
|
+
"marginInlineStart": "auto",
|
|
330
|
+
"paddingInlineStart": "var(--jx-space-4)",
|
|
331
|
+
"color": "var(--jx-fg-muted)",
|
|
332
|
+
"fontSize": "var(--jx-text-sm)"
|
|
333
|
+
},
|
|
334
|
+
"& [part=\"swatch\"][hidden], & [part=\"line\"][hidden], & [part=\"description\"][hidden]": {
|
|
335
|
+
"display": "none"
|
|
336
|
+
},
|
|
337
|
+
"& [part=\"error\"], & [part=\"help\"]": {
|
|
338
|
+
"margin": "0",
|
|
339
|
+
"fontSize": "var(--jx-text-sm)",
|
|
340
|
+
"lineHeight": "var(--jx-leading-sm)",
|
|
341
|
+
"color": "var(--jx-fg-dim)"
|
|
342
|
+
},
|
|
343
|
+
"& [part=\"error\"]": {
|
|
344
|
+
"color": "var(--jx-danger)"
|
|
345
|
+
},
|
|
346
|
+
"& [part=\"error\"]:empty": {
|
|
347
|
+
"position": "absolute"
|
|
348
|
+
},
|
|
349
|
+
"& > [part=\"help-slot\"]": {
|
|
350
|
+
"display": "contents"
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
"children": [
|
|
354
|
+
{
|
|
355
|
+
"tagName": "select",
|
|
356
|
+
"attributes": {
|
|
357
|
+
"part": "control",
|
|
358
|
+
"data-value": "${state.value}",
|
|
359
|
+
"aria-label": "${state.label || null}",
|
|
360
|
+
"aria-labelledby": "${state.labelledby || null}",
|
|
361
|
+
"aria-describedby": "${[state.hasError && state.uid ? state.uid + '-error' : null, state.hasHelp && state.uid ? state.uid + '-help' : null, state.describedby || null].filter(Boolean).join(' ') || null}",
|
|
362
|
+
"aria-invalid": "${state.invalid ? 'true' : null}",
|
|
363
|
+
"name": "${state.name || null}",
|
|
364
|
+
"disabled": {
|
|
365
|
+
"$ref": "#/state/disabled"
|
|
366
|
+
},
|
|
367
|
+
"required": {
|
|
368
|
+
"$ref": "#/state/required"
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
"value": {
|
|
372
|
+
"$ref": "#/state/value"
|
|
373
|
+
},
|
|
374
|
+
"onchange": {
|
|
375
|
+
"$ref": "#/state/onChange"
|
|
376
|
+
},
|
|
377
|
+
"children": [
|
|
378
|
+
{
|
|
379
|
+
"tagName": "button",
|
|
380
|
+
"attributes": {
|
|
381
|
+
"part": "trigger",
|
|
382
|
+
"type": "button",
|
|
383
|
+
"tabindex": "-1",
|
|
384
|
+
"role": "none"
|
|
385
|
+
},
|
|
386
|
+
"children": [
|
|
387
|
+
{
|
|
388
|
+
"tagName": "selectedcontent",
|
|
389
|
+
"attributes": {
|
|
390
|
+
"part": "preview"
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
]
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"$prototype": "Array",
|
|
397
|
+
"items": {
|
|
398
|
+
"$ref": "#/state/unlisted"
|
|
399
|
+
},
|
|
400
|
+
"key": {
|
|
401
|
+
"$ref": "$map/item/value"
|
|
402
|
+
},
|
|
403
|
+
"map": {
|
|
404
|
+
"tagName": "option",
|
|
405
|
+
"attributes": {
|
|
406
|
+
"part": "unlisted",
|
|
407
|
+
"value": "${$map.item.value}"
|
|
408
|
+
},
|
|
409
|
+
"children": [
|
|
410
|
+
{
|
|
411
|
+
"tagName": "span",
|
|
412
|
+
"attributes": {
|
|
413
|
+
"part": "text"
|
|
414
|
+
},
|
|
415
|
+
"textContent": "${$map.item.label}"
|
|
416
|
+
}
|
|
417
|
+
]
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"$prototype": "Array",
|
|
422
|
+
"items": {
|
|
423
|
+
"$ref": "#/state/options"
|
|
424
|
+
},
|
|
425
|
+
"key": {
|
|
426
|
+
"$ref": "$map/item/value"
|
|
427
|
+
},
|
|
428
|
+
"map": {
|
|
429
|
+
"tagName": "option",
|
|
430
|
+
"attributes": {
|
|
431
|
+
"part": "option",
|
|
432
|
+
"value": "${$map.item.value}",
|
|
433
|
+
"disabled": "${!!$map.item.disabled}"
|
|
434
|
+
},
|
|
435
|
+
"children": [
|
|
436
|
+
{
|
|
437
|
+
"tagName": "span",
|
|
438
|
+
"attributes": {
|
|
439
|
+
"part": "swatch",
|
|
440
|
+
"hidden": "${!$map.item.swatch}"
|
|
441
|
+
},
|
|
442
|
+
"style": {
|
|
443
|
+
"--jx-row-swatch": {
|
|
444
|
+
"$ref": "$map/item/swatch"
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
"tagName": "span",
|
|
450
|
+
"attributes": {
|
|
451
|
+
"part": "line",
|
|
452
|
+
"hidden": "${!$map.item.line}"
|
|
453
|
+
},
|
|
454
|
+
"style": {
|
|
455
|
+
"--jx-row-line": {
|
|
456
|
+
"$ref": "$map/item/line"
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
"tagName": "span",
|
|
462
|
+
"attributes": {
|
|
463
|
+
"part": "text"
|
|
464
|
+
},
|
|
465
|
+
"style": {
|
|
466
|
+
"--jx-row-face": {
|
|
467
|
+
"$ref": "$map/item/face"
|
|
468
|
+
},
|
|
469
|
+
"--jx-row-weight": {
|
|
470
|
+
"$ref": "$map/item/weight"
|
|
471
|
+
},
|
|
472
|
+
"--jx-row-slant": {
|
|
473
|
+
"$ref": "$map/item/slant"
|
|
474
|
+
},
|
|
475
|
+
"--jx-row-variant": {
|
|
476
|
+
"$ref": "$map/item/variant"
|
|
477
|
+
},
|
|
478
|
+
"--jx-row-transform": {
|
|
479
|
+
"$ref": "$map/item/transform"
|
|
480
|
+
},
|
|
481
|
+
"--jx-row-decoration": {
|
|
482
|
+
"$ref": "$map/item/decoration"
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
"textContent": "${$map.item.label}"
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
"tagName": "span",
|
|
489
|
+
"attributes": {
|
|
490
|
+
"part": "description",
|
|
491
|
+
"hidden": "${!$map.item.description}"
|
|
492
|
+
},
|
|
493
|
+
"textContent": "${$map.item.description || ''}"
|
|
494
|
+
}
|
|
495
|
+
]
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
"$prototype": "Array",
|
|
500
|
+
"items": {
|
|
501
|
+
"$ref": "#/state/groups"
|
|
502
|
+
},
|
|
503
|
+
"key": {
|
|
504
|
+
"$ref": "$map/item/id"
|
|
505
|
+
},
|
|
506
|
+
"map": {
|
|
507
|
+
"tagName": "optgroup",
|
|
508
|
+
"attributes": {
|
|
509
|
+
"part": "group",
|
|
510
|
+
"label": "${$map.item.label}"
|
|
511
|
+
},
|
|
512
|
+
"children": [
|
|
513
|
+
{
|
|
514
|
+
"tagName": "legend",
|
|
515
|
+
"attributes": {
|
|
516
|
+
"part": "group-heading"
|
|
517
|
+
},
|
|
518
|
+
"textContent": "${$map.item.label}"
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
"$prototype": "Array",
|
|
522
|
+
"items": {
|
|
523
|
+
"$ref": "$map/item/rows"
|
|
524
|
+
},
|
|
525
|
+
"key": {
|
|
526
|
+
"$ref": "$map/item/value"
|
|
527
|
+
},
|
|
528
|
+
"map": {
|
|
529
|
+
"tagName": "option",
|
|
530
|
+
"attributes": {
|
|
531
|
+
"part": "option",
|
|
532
|
+
"value": "${$map.item.value}",
|
|
533
|
+
"disabled": "${!!$map.item.disabled}"
|
|
534
|
+
},
|
|
535
|
+
"children": [
|
|
536
|
+
{
|
|
537
|
+
"tagName": "span",
|
|
538
|
+
"attributes": {
|
|
539
|
+
"part": "swatch",
|
|
540
|
+
"hidden": "${!$map.item.swatch}"
|
|
541
|
+
},
|
|
542
|
+
"style": {
|
|
543
|
+
"--jx-row-swatch": {
|
|
544
|
+
"$ref": "$map/item/swatch"
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
"tagName": "span",
|
|
550
|
+
"attributes": {
|
|
551
|
+
"part": "line",
|
|
552
|
+
"hidden": "${!$map.item.line}"
|
|
553
|
+
},
|
|
554
|
+
"style": {
|
|
555
|
+
"--jx-row-line": {
|
|
556
|
+
"$ref": "$map/item/line"
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
"tagName": "span",
|
|
562
|
+
"attributes": {
|
|
563
|
+
"part": "text"
|
|
564
|
+
},
|
|
565
|
+
"style": {
|
|
566
|
+
"--jx-row-face": {
|
|
567
|
+
"$ref": "$map/item/face"
|
|
568
|
+
},
|
|
569
|
+
"--jx-row-weight": {
|
|
570
|
+
"$ref": "$map/item/weight"
|
|
571
|
+
},
|
|
572
|
+
"--jx-row-slant": {
|
|
573
|
+
"$ref": "$map/item/slant"
|
|
574
|
+
},
|
|
575
|
+
"--jx-row-variant": {
|
|
576
|
+
"$ref": "$map/item/variant"
|
|
577
|
+
},
|
|
578
|
+
"--jx-row-transform": {
|
|
579
|
+
"$ref": "$map/item/transform"
|
|
580
|
+
},
|
|
581
|
+
"--jx-row-decoration": {
|
|
582
|
+
"$ref": "$map/item/decoration"
|
|
583
|
+
}
|
|
584
|
+
},
|
|
585
|
+
"textContent": "${$map.item.label}"
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
"tagName": "span",
|
|
589
|
+
"attributes": {
|
|
590
|
+
"part": "description",
|
|
591
|
+
"hidden": "${!$map.item.description}"
|
|
592
|
+
},
|
|
593
|
+
"textContent": "${$map.item.description || ''}"
|
|
594
|
+
}
|
|
595
|
+
]
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
]
|
|
599
|
+
}
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
"tagName": "slot"
|
|
603
|
+
}
|
|
604
|
+
]
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
"tagName": "p",
|
|
608
|
+
"attributes": {
|
|
609
|
+
"part": "error",
|
|
610
|
+
"id": "${state.uid ? state.uid + '-error' : null}",
|
|
611
|
+
"role": "status",
|
|
612
|
+
"aria-live": "polite"
|
|
613
|
+
},
|
|
614
|
+
"textContent": "${state.error}"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
"tagName": "div",
|
|
618
|
+
"attributes": {
|
|
619
|
+
"role": "none",
|
|
620
|
+
"part": "help-slot"
|
|
621
|
+
},
|
|
622
|
+
"$switch": {
|
|
623
|
+
"$ref": "#/state/hasHelp"
|
|
624
|
+
},
|
|
625
|
+
"cases": {
|
|
626
|
+
"true": {
|
|
627
|
+
"tagName": "p",
|
|
628
|
+
"attributes": {
|
|
629
|
+
"part": "help",
|
|
630
|
+
"id": "${state.uid ? state.uid + '-help' : null}"
|
|
631
|
+
},
|
|
632
|
+
"textContent": "${state.help}"
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
]
|
|
637
|
+
}
|