@kirana-ui/web 0.2.0 → 0.4.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/CHANGELOG.md +140 -0
- package/llms.txt +1598 -143
- package/package.json +48 -3
- package/skills/kirana-ui-primitives/SKILL.md +53 -12
- package/src/accordion.d.ts +1 -1
- package/src/accordion.js +2 -1
- package/src/accordion.js.map +1 -1
- package/src/alert-dialog.d.ts +2 -2
- package/src/alert-dialog.js +9 -4
- package/src/alert-dialog.js.map +1 -1
- package/src/around.d.ts +28 -4
- package/src/around.js +46 -13
- package/src/around.js.map +1 -1
- package/src/autocomplete.d.ts +7 -4
- package/src/autocomplete.js +8 -4
- package/src/autocomplete.js.map +1 -1
- package/src/avatar.d.ts +11 -5
- package/src/avatar.js +41 -12
- package/src/avatar.js.map +1 -1
- package/src/button.d.ts +2 -1
- package/src/button.js +2 -1
- package/src/button.js.map +1 -1
- package/src/calendar.d.ts +9 -5
- package/src/calendar.js +22 -9
- package/src/calendar.js.map +1 -1
- package/src/carousel.d.ts +1 -1
- package/src/carousel.js +4 -2
- package/src/carousel.js.map +1 -1
- package/src/checkbox-group.d.ts +22 -0
- package/src/checkbox-group.js +36 -0
- package/src/checkbox-group.js.map +1 -0
- package/src/checkbox.d.ts +4 -2
- package/src/checkbox.js +10 -4
- package/src/checkbox.js.map +1 -1
- package/src/color-picker.d.ts +28 -0
- package/src/color-picker.js +81 -0
- package/src/color-picker.js.map +1 -0
- package/src/combobox.d.ts +27 -7
- package/src/combobox.js +79 -17
- package/src/combobox.js.map +1 -1
- package/src/command.d.ts +3 -3
- package/src/command.js +6 -5
- package/src/command.js.map +1 -1
- package/src/context-menu.d.ts +2 -1
- package/src/context-menu.js.map +1 -1
- package/src/date-field.d.ts +2 -2
- package/src/date-field.js +3 -3
- package/src/date-field.js.map +1 -1
- package/src/date-picker.d.ts +14 -8
- package/src/date-picker.js +49 -10
- package/src/date-picker.js.map +1 -1
- package/src/dates.d.ts +11 -5
- package/src/dates.js +58 -20
- package/src/dates.js.map +1 -1
- package/src/dialog.d.ts +3 -2
- package/src/dialog.js +12 -4
- package/src/dialog.js.map +1 -1
- package/src/drawer.d.ts +2 -1
- package/src/drawer.js +7 -3
- package/src/drawer.js.map +1 -1
- package/src/editable.d.ts +21 -0
- package/src/editable.js +56 -0
- package/src/editable.js.map +1 -0
- package/src/file-upload.d.ts +23 -0
- package/src/file-upload.js +98 -0
- package/src/file-upload.js.map +1 -0
- package/src/hover-card.d.ts +2 -1
- package/src/hover-card.js.map +1 -1
- package/src/index.d.ts +29 -7
- package/src/index.js +11 -0
- package/src/menu.d.ts +4 -3
- package/src/menu.js +19 -10
- package/src/menu.js.map +1 -1
- package/src/menubar.d.ts +2 -2
- package/src/menubar.js +5 -3
- package/src/menubar.js.map +1 -1
- package/src/navigation-menu.d.ts +4 -3
- package/src/navigation-menu.js +10 -6
- package/src/navigation-menu.js.map +1 -1
- package/src/number-field.d.ts +5 -2
- package/src/number-field.js +23 -3
- package/src/number-field.js.map +1 -1
- package/src/otp.d.ts +4 -2
- package/src/otp.js +24 -4
- package/src/otp.js.map +1 -1
- package/src/password-input.d.ts +20 -0
- package/src/password-input.js +39 -0
- package/src/password-input.js.map +1 -0
- package/src/popover.d.ts +8 -7
- package/src/popover.js +33 -5
- package/src/popover.js.map +1 -1
- package/src/radio-group.d.ts +2 -1
- package/src/radio-group.js +9 -2
- package/src/radio-group.js.map +1 -1
- package/src/rating.d.ts +18 -0
- package/src/rating.js +54 -0
- package/src/rating.js.map +1 -0
- package/src/runtime.d.ts +9 -4
- package/src/runtime.js +8 -5
- package/src/runtime.js.map +1 -1
- package/src/select.d.ts +12 -4
- package/src/select.js +33 -10
- package/src/select.js.map +1 -1
- package/src/slider.d.ts +2 -2
- package/src/slider.js +3 -2
- package/src/slider.js.map +1 -1
- package/src/steps.d.ts +17 -0
- package/src/steps.js +47 -0
- package/src/steps.js.map +1 -0
- package/src/tags-input.d.ts +35 -0
- package/src/tags-input.js +96 -0
- package/src/tags-input.js.map +1 -0
- package/src/time-field.d.ts +18 -0
- package/src/time-field.js +54 -0
- package/src/time-field.js.map +1 -0
- package/src/toast.d.ts +4 -3
- package/src/toast.js +6 -4
- package/src/toast.js.map +1 -1
- package/src/toggle-group.d.ts +1 -1
- package/src/toggle-group.js +2 -1
- package/src/toggle-group.js.map +1 -1
- package/src/toolbar.d.ts +0 -6
- package/src/toolbar.js +14 -3
- package/src/toolbar.js.map +1 -1
- package/src/tooltip.d.ts +2 -1
- package/src/tooltip.js.map +1 -1
- package/src/tour.d.ts +27 -0
- package/src/tour.js +62 -0
- package/src/tour.js.map +1 -0
- package/src/tree.d.ts +29 -0
- package/src/tree.js +99 -0
- package/src/tree.js.map +1 -0
package/llms.txt
CHANGED
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
Generated from the library's own source (`bun scripts/llms.ts`), and checked against it: every element, attribute, event and part here is in the package, and what is not here is not.
|
|
6
6
|
|
|
7
|
+
This file describes the version it ships with. What changed in each release, the breaking changes first with what to write instead, is `CHANGELOG.md` in the package: `node_modules/@kirana-ui/web/CHANGELOG.md`.
|
|
8
|
+
|
|
7
9
|
## Install and entries
|
|
8
10
|
|
|
9
11
|
Install `@kirana-ui/web`. It is enough: the core it is built on comes with it, and what the core gives an application is also an entry of this package (`@kirana-ui/web/agent`, `@kirana-ui/web/testing`).
|
|
10
12
|
|
|
11
|
-
Its entries: an entry per element (`@kirana-ui/web/tabs`,
|
|
13
|
+
Its entries: an entry per element (`@kirana-ui/web/tabs`, 59 of them), the package root `@kirana-ui/web` (every element at once), `@kirana-ui/web/runtime` (`defineElement`, for an element of your own), `@kirana-ui/web/agent` and `@kirana-ui/web/testing` (the agent bridge and the testing kit: what they give is the same on every framework, and written out in each framework package's `llms.txt`).
|
|
12
14
|
|
|
13
15
|
The attributes and CSS variables below are also data and typed selectors, for a design system: install `@kirana-ui/vocabulary` for them. It is its own package, and not installed with this one.
|
|
14
16
|
|
|
@@ -16,10 +18,12 @@ The attributes and CSS variables below are also data and typed selectors, for a
|
|
|
16
18
|
|
|
17
19
|
- Importing an entry defines its element: `import "@kirana-ui/web/dialog"`. `import "@kirana-ui/web"` defines them all.
|
|
18
20
|
- The custom element (`<kui-dialog>`) holds the component and draws nothing: it takes no room (`display: contents`) and has no shadow root. Every part, the root among them, is an element of the page's own inside it, named by `kui-part`: `<button kui-part="trigger">`. So a trigger is a real button, and the page is the page the other adapters draw.
|
|
21
|
+
- A part on a `<button>` writes `type="button"`, so that it never submits a form by accident, unless the element has a `type` of its own (`<button kui-part="root" type="submit">`); a part on an element that is not a button (`<a kui-part="trigger" href="/x">`) writes none. A button on a link that navigates stays a link: `<kui-button native-button="false"><a kui-part="root" href="/x">` is given no `role`, no `tabindex` and none of the button's keys (its Enter is its own, and Space does not press it); a disabled one still has `tabindex="-1"` and `aria-disabled`.
|
|
19
22
|
- A prop is an attribute in kebab case on the custom element (`default-open`), and a property in camel case (`element.defaultOpen`, `element.open = true`). A prop that is a function or an object is a property only, listed for its element.
|
|
20
23
|
- A change is an event on the custom element, named for its callback (`open-change`, `value-change`): `event.detail` holds the value under its prop's name (`detail.open`) and `detail.details` (`reason`, `event`, `source`, `cancel()`). `event.preventDefault()` keeps the value as it was. The element then holds the value: it is controlled by writing the property back.
|
|
21
|
-
- What a part needs of its own is a `kui-` attribute on the part's element: `kui-value`, `kui-disabled`, `kui-index`, `kui-label`, a positioner's `kui-side`, `kui-align`, `kui-side-offset`, `kui-align-offset`, `kui-collision-padding`
|
|
24
|
+
- What a part needs of its own is a `kui-` attribute on the part's element: `kui-value`, `kui-disabled`, `kui-index`, `kui-label`, a positioner's `kui-side`, `kui-align`, `kui-side-offset`, `kui-align-offset`, `kui-collision-padding`, `kui-sticky`, `kui-arrow-padding`, `kui-position-method`, `kui-anchor` (the id of the element the popup is placed against, when that is not its trigger) and `kui-collision-boundary` (the id of the element it is held inside). What an attribute cannot say of a positioner (`sideOffset` as a function, `collisionBoundary` as an element or a rectangle, `collisionPadding` a side, `collisionAvoidance`) is the `positioning` property of its custom element, an object of the positioner's options read as the popup comes into the page (`popover.positioning = { sideOffset: ({ anchor }) => anchor.height }`); an attribute on the positioner comes before the same option there. An `id` for the component is `kui-id` on the custom element.
|
|
22
25
|
- A part that is in the page only some of the time (a closed panel, a popup) is taken out of the page while it is not, and put back where it was; `kui-keep-mounted` on the part keeps it. A portal part (`kui-part="portal"`) is moved to the end of `<body>`.
|
|
26
|
+
- A part writes its role, ARIA and state attributes on its element over the element's own: `<button kui-part="trigger" aria-expanded="true">` says the part's `aria-expanded`. An attribute the part has no value for is the page's (`aria-controls="note"` while the panel is not in the page), and the page's own comes back when the part stops giving one. A part that writes its own text (a calendar's heading, a meter's value) writes it only while its element has no content of its own.
|
|
23
27
|
- A list the component draws is written once, as a `<template kui-each="name">` where the list goes: it is stamped for each entry, `{field}` in its text and attributes filled from the entry, and an element with `kui-when` kept only for entries of that type.
|
|
24
28
|
- A component inside another's custom element is that one's own: a `<kui-menu>` inside a `<kui-menu>` is its submenu, a control inside a `<kui-field>` is the field's control.
|
|
25
29
|
- TypeScript knows each element by its tag (`document.querySelector("kui-dialog")`): its props as properties and its events with their `detail`.
|
|
@@ -31,6 +35,11 @@ The attributes and CSS variables below are also data and typed selectors, for a
|
|
|
31
35
|
- A value is controlled when it is given (`value`) and the component's own when it is not (`defaultValue`). `open`/`defaultOpen` and the others pair the same way.
|
|
32
36
|
- A control with a `name` is submitted with the form around it and follows the form's reset. Inside a `Field` it is the field's control.
|
|
33
37
|
|
|
38
|
+
### For a design system
|
|
39
|
+
|
|
40
|
+
- A design system's own element (a badge, a breadcrumb's link) is the page's own element, with its own classes and attributes: nothing of the library's is needed for it, and none is given, since a custom element's parts are the page's own elements too and are composed by writing them.
|
|
41
|
+
- Tooltips need no provider: one is open at a time across the page, and while one shows the next opens without its wait, by themselves. A tooltip waits 600 ms before it opens (a hover card 600 ms, and 300 ms before it closes). A design system whose tooltips open at once writes `delay="0"` on each `<kui-tooltip>`.
|
|
42
|
+
|
|
34
43
|
## Elements
|
|
35
44
|
|
|
36
45
|
### Accordion
|
|
@@ -39,7 +48,7 @@ The attributes and CSS variables below are also data and typed selectors, for a
|
|
|
39
48
|
import "@kirana-ui/web/accordion"
|
|
40
49
|
```
|
|
41
50
|
|
|
42
|
-
`<kui-accordion>`: `<kui-accordion>` around `kui-part="root"` and its `item`s, each with a `header`, a `trigger` button and a `panel` that is in the page while its item is open. An item's `kui-value` tells it from the others; an item that is given none makes its own. `value` and `default-value` (the open items, with commas between), `multiple`, `disabled`, `orientation`, `loop
|
|
51
|
+
`<kui-accordion>`: `<kui-accordion>` around `kui-part="root"` and its `item`s, each with a `header`, a `trigger` button and a `panel` that is in the page while its item is open. An item's `kui-value` tells it from the others; an item that is given none makes its own. `value` and `default-value` (the open items, with commas between), `multiple`, `disabled`, `orientation`, `loop-focus` (`loop` is its older name); it tells `value-change`.
|
|
43
52
|
|
|
44
53
|
Attributes of the element (each also a property, in camel case):
|
|
45
54
|
|
|
@@ -48,7 +57,8 @@ Attributes of the element (each also a property, in camel case):
|
|
|
48
57
|
- `multiple` (boolean): Whether several items can be open at once. Default `false`: opening one closes the others.
|
|
49
58
|
- `disabled` (boolean): Disables every item: none can be opened or closed.
|
|
50
59
|
- `orientation` (string): The way the arrows move between triggers. Default `vertical`.
|
|
51
|
-
- `loop` (boolean): Whether the arrows wrap from the last trigger to the first. Default `true`.
|
|
60
|
+
- `loop-focus` (boolean): Whether the arrows wrap from the last trigger to the first. Default `true`.
|
|
61
|
+
- `loop` (boolean): Whether the arrows wrap from the last item to the first.
|
|
52
62
|
|
|
53
63
|
Events:
|
|
54
64
|
|
|
@@ -79,12 +89,15 @@ Attributes and CSS variables, by part:
|
|
|
79
89
|
- `data-orientation="horizontal | vertical"`: The way the items are laid out, and the arrows that move between their triggers.
|
|
80
90
|
- `data-disabled`: Present when it is disabled.
|
|
81
91
|
- item: One section: a header with its trigger, and a panel. Its `value` tells it from the others; an item that is given none makes its own.
|
|
92
|
+
- `data-index`: The item's place among the accordion's items, from 0.
|
|
82
93
|
- `data-open`: Present when the item is open.
|
|
83
94
|
- `data-disabled`: Present when it is disabled.
|
|
84
95
|
- header: The heading that holds the trigger.
|
|
96
|
+
- `data-index`: The item's place among the accordion's items, from 0.
|
|
85
97
|
- `data-open`: Present when the item is open.
|
|
86
98
|
- `data-disabled`: Present when it is disabled.
|
|
87
99
|
- trigger: The button that opens and closes the item's panel.
|
|
100
|
+
- `data-index`: The item's place among the accordion's items, from 0.
|
|
88
101
|
- `data-panel-open`: Present when the item's panel is open.
|
|
89
102
|
- `data-disabled`: Present when it is disabled.
|
|
90
103
|
- panel: The item's content. In the page while open, and through its exit's motion.
|
|
@@ -94,6 +107,7 @@ Attributes and CSS variables, by part:
|
|
|
94
107
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
95
108
|
- `data-disabled`: Present when it is disabled.
|
|
96
109
|
- `data-orientation="horizontal | vertical"`: The way the items are laid out, and the arrows that move between their triggers.
|
|
110
|
+
- `data-index`: The item's place among the accordion's items, from 0.
|
|
97
111
|
- `--accordion-panel-height`: The panel's content height while it opens or closes, `auto` once it is open.
|
|
98
112
|
- `--accordion-panel-width`: The panel's content width while it opens or closes, `auto` once it is open.
|
|
99
113
|
|
|
@@ -103,7 +117,7 @@ Attributes and CSS variables, by part:
|
|
|
103
117
|
import "@kirana-ui/web/alert-dialog"
|
|
104
118
|
```
|
|
105
119
|
|
|
106
|
-
`<kui-alert-dialog>`: `<kui-alert-dialog>`: a dialog that asks, with the dialog's parts. A press outside does not close it. `open`, `default-open`; it tells `open-change`.
|
|
120
|
+
`<kui-alert-dialog>`: `<kui-alert-dialog>`: a dialog that asks, with the dialog's parts, its `viewport` too. A press outside does not close it. `open`, `default-open`; it tells `open-change`.
|
|
107
121
|
|
|
108
122
|
Attributes of the element (each also a property, in camel case):
|
|
109
123
|
|
|
@@ -118,6 +132,7 @@ Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
|
118
132
|
|
|
119
133
|
- `trigger`
|
|
120
134
|
- `backdrop`
|
|
135
|
+
- `viewport`
|
|
121
136
|
- `popup`
|
|
122
137
|
- `title`
|
|
123
138
|
- `description`
|
|
@@ -130,28 +145,40 @@ Anatomy:
|
|
|
130
145
|
trigger
|
|
131
146
|
portal
|
|
132
147
|
backdrop
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
148
|
+
viewport (optional)
|
|
149
|
+
popup
|
|
150
|
+
title
|
|
151
|
+
description
|
|
152
|
+
close
|
|
137
153
|
```
|
|
138
154
|
|
|
139
155
|
Attributes and CSS variables, by part:
|
|
140
156
|
|
|
141
157
|
- trigger: The button that opens the dialog.
|
|
142
158
|
- `data-popup-open`: Present when the dialog is open.
|
|
159
|
+
- `data-disabled`: Present when it is disabled.
|
|
143
160
|
- backdrop: The layer over the page behind the dialog.
|
|
144
161
|
- `data-open`: Present when it is open.
|
|
145
162
|
- `data-closed`: Present when it is closed.
|
|
146
163
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
147
164
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
165
|
+
- viewport: What a long dialog scrolls in: it lies over the page, between the backdrop and the popup. A press on it beside the popup is a press outside the dialog; a press on its scrollbar is not.
|
|
166
|
+
- `data-open`: Present when it is open.
|
|
167
|
+
- `data-closed`: Present when it is closed.
|
|
168
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
169
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
170
|
+
- `data-nested`: Present when the dialog opened over another dialog.
|
|
171
|
+
- `data-nested-dialog-open`: Present when another dialog is open above this one.
|
|
148
172
|
- popup: The dialog itself.
|
|
149
173
|
- `data-open`: Present when it is open.
|
|
150
174
|
- `data-closed`: Present when it is closed.
|
|
151
175
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
152
176
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
177
|
+
- `data-nested`: Present when the dialog opened over another dialog.
|
|
153
178
|
- `data-nested-dialog-open`: Present when another dialog is open above this one.
|
|
154
179
|
- `--nested-dialogs`: How many dialogs are open above this one.
|
|
180
|
+
- close: A button that closes the dialog.
|
|
181
|
+
- `data-disabled`: Present when it is disabled.
|
|
155
182
|
|
|
156
183
|
### Autocomplete
|
|
157
184
|
|
|
@@ -159,7 +186,7 @@ Attributes and CSS variables, by part:
|
|
|
159
186
|
import "@kirana-ui/web/autocomplete"
|
|
160
187
|
```
|
|
161
188
|
|
|
162
|
-
`<kui-autocomplete>`: `<kui-autocomplete>`: a combobox whose text is the value, with a combobox's parts: the list only suggests. `value`, `default-value`, `open`, `default-open`, `mode`, `open-on-input-click`, `auto-highlight`, `disabled`, `required`, `name`, `form`; `filter` as a
|
|
189
|
+
`<kui-autocomplete>`: `<kui-autocomplete>`: a combobox whose text is the value, with a combobox's parts: the list only suggests. `value`, `default-value`, `open`, `default-open`, `mode`, `open-on-input-click`, `auto-highlight`, `disabled`, `read-only`, `required`, `name`, `form`; `filter` and `items` as properties (with `items`, the suggestions are a `<template kui-each="collection">`, as a combobox's); it tells `value-change` and `open-change`.
|
|
163
190
|
|
|
164
191
|
Attributes of the element (each also a property, in camel case):
|
|
165
192
|
|
|
@@ -167,10 +194,11 @@ Attributes of the element (each also a property, in camel case):
|
|
|
167
194
|
- `default-value` (string): The text it starts with, when the caller does not hold `value`. Read once.
|
|
168
195
|
- `open` (boolean): Whether the list is open, when the caller holds it.
|
|
169
196
|
- `default-open` (boolean): Whether the list starts open, when the caller does not hold `open`. Read once.
|
|
170
|
-
- `mode` (string): `"list"` (the default): the suggestions are filtered by what is typed. `"
|
|
197
|
+
- `mode` (string): `"list"` (the default): the suggestions are filtered by what is typed. `"both"`: they are filtered, and the rest of the first one that begins with what is typed is written after it in the input, selected, so typing on replaces it and Enter or Tab keeps it; the arrows write the suggestion they are on into the input. `"inline"`: written so, and not filtered. `"none"`: neither; the suggestions are as the caller draws them. A completion is not written into a word an input method is composing, nor after a deletion.
|
|
171
198
|
- `open-on-input-click` (boolean): Whether a press on the input opens the list. Default: it opens when something is typed.
|
|
172
199
|
- `auto-highlight` (boolean): The first suggestion for what was typed is highlighted as one types, so Enter takes it. Off by default: no suggestion is highlighted for having been typed at, and Enter is the form's, with the text as typed, until an arrow or the pointer has gone to one.
|
|
173
200
|
- `disabled` (boolean): Disabled: it cannot be changed.
|
|
201
|
+
- `read-only` (boolean): Its text can be read and not changed: nothing typed is taken, no suggestion pressed is written in, and its clear button does nothing. The list still opens (by its button, the arrows, or a press with `openOnInputClick`) and can be gone through. It keeps focus, and its text is still submitted.
|
|
174
202
|
- `required` (boolean): Needed: in a `Field`, leaving it empty is then invalid.
|
|
175
203
|
- `name` (string): The input's name in the form around it.
|
|
176
204
|
- `form` (string): The id of the form the control belongs to, when it is not inside it.
|
|
@@ -178,6 +206,7 @@ Attributes of the element (each also a property, in camel case):
|
|
|
178
206
|
Properties only:
|
|
179
207
|
|
|
180
208
|
- `filter`: Whether a suggestion is shown for what was typed; `null` shows every one.
|
|
209
|
+
- `items`: The suggestions as data, for a `Collection` to draw: a list of them with their labels, groups of them (`{ value, items }`, `value` the group's name), or the labels by value. The autocomplete filters them by what is typed (not with `mode: "none"`), and the `Collection` draws what is left.
|
|
181
210
|
|
|
182
211
|
Events:
|
|
183
212
|
|
|
@@ -188,8 +217,10 @@ Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
|
188
217
|
|
|
189
218
|
- `input`
|
|
190
219
|
- `trigger`
|
|
220
|
+
- `value`: `kui-placeholder`
|
|
221
|
+
- `status`
|
|
191
222
|
- `clear`
|
|
192
|
-
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-collision-padding`, `kui-side`, `kui-side-offset`
|
|
223
|
+
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-arrow-padding`, `kui-collision-boundary`, `kui-collision-padding`, `kui-position-method`, `kui-side`, `kui-side-offset`, `kui-sticky`
|
|
193
224
|
- `popup`
|
|
194
225
|
- `list`
|
|
195
226
|
- `empty`
|
|
@@ -202,6 +233,8 @@ Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
|
202
233
|
- `chip-remove`
|
|
203
234
|
- `item-indicator`: `kui-value`
|
|
204
235
|
|
|
236
|
+
Lists (`<template kui-each="…">`): `collection`.
|
|
237
|
+
|
|
205
238
|
Anatomy:
|
|
206
239
|
|
|
207
240
|
```
|
|
@@ -212,12 +245,19 @@ Anatomy:
|
|
|
212
245
|
positioner
|
|
213
246
|
popup
|
|
214
247
|
list (optional)
|
|
248
|
+
<template kui-each="collection"> (optional)
|
|
249
|
+
item (repeated, as above)
|
|
250
|
+
group (optional, repeated, as above)
|
|
215
251
|
group (optional, repeated)
|
|
252
|
+
<template kui-each="collection"> (optional, as above)
|
|
216
253
|
item (repeated)
|
|
217
254
|
group-label
|
|
218
255
|
separator (repeated)
|
|
256
|
+
<template kui-each="collection"> (optional, as above)
|
|
219
257
|
empty
|
|
258
|
+
status (optional)
|
|
220
259
|
popup (as above)
|
|
260
|
+
status (optional, as above)
|
|
221
261
|
clear
|
|
222
262
|
```
|
|
223
263
|
|
|
@@ -225,36 +265,73 @@ Attributes and CSS variables, by part:
|
|
|
225
265
|
|
|
226
266
|
- input: The text input: its text is the value, and what is typed asks for suggestions.
|
|
227
267
|
- `data-popup-open`: Present when the list is open.
|
|
268
|
+
- `data-pressed`: Present while its popup is open: it stays pressed, as a button held down.
|
|
269
|
+
- `data-popup-side="top | right | bottom | left | inline-start | inline-end | none"`: While the list is in the page: the side of the trigger it is on, after any flip; `none` when it lies over the trigger. Not said while it opens as a sheet.
|
|
270
|
+
- `data-list-empty`: Present when no item is shown for what was typed, once the list is in the page.
|
|
228
271
|
- `data-disabled`: Present when it is disabled.
|
|
272
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
273
|
+
- `data-required`: Present when the form needs it.
|
|
274
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
275
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
276
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
277
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
278
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
279
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
229
280
|
- trigger: A button that opens and closes the list. With the input inside the popup it is the combobox: a stop for Tab, and what the popup is placed against.
|
|
230
281
|
- `data-popup-open`: Present when the list is open.
|
|
282
|
+
- `data-pressed`: Present while its popup is open: it stays pressed, as a button held down.
|
|
283
|
+
- `data-popup-side="top | right | bottom | left | inline-start | inline-end | none"`: While the list is in the page: the side of the trigger it is on, after any flip; `none` when it lies over the trigger. Not said while it opens as a sheet.
|
|
284
|
+
- `data-list-empty`: Present when no item is shown for what was typed, once the list is in the page.
|
|
231
285
|
- `data-disabled`: Present when it is disabled.
|
|
232
|
-
-
|
|
286
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
287
|
+
- `data-required`: Present when the form needs it.
|
|
288
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
289
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
290
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
291
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
292
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
293
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
294
|
+
- positioner: Places the list against the input: against the chips' box when the input is in one, the button when the input is inside the popup, or its own `anchor`. It carries the geometry. As a sheet it is not placed, and carries none.
|
|
233
295
|
- `data-open`: Present when it is open.
|
|
234
296
|
- `data-closed`: Present when it is closed.
|
|
235
297
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
236
298
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
299
|
+
- `data-presentation="popup | sheet"`: How the list opened: placed against its trigger, or as a sheet from the bottom edge.
|
|
300
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
301
|
+
- `data-empty`: Present when no item is shown for what was typed.
|
|
237
302
|
- `--anchor-width`: The anchor's width.
|
|
238
303
|
- `--anchor-height`: The anchor's height.
|
|
239
304
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
240
305
|
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
241
306
|
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
242
|
-
- popup: The list of items. With a `list` inside, what holds it: a dialog around an input and the list.
|
|
307
|
+
- popup: The list of items. With a `list` inside, what holds it: a dialog around an input and the list. As a sheet, a design moves it by what it says of the drag, and gives it `touch-action: none` where a finger drags it.
|
|
243
308
|
- `data-open`: Present when it is open.
|
|
244
309
|
- `data-closed`: Present when it is closed.
|
|
245
310
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
246
311
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
247
312
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
248
313
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
314
|
+
- `data-presentation="popup | sheet"`: How the list opened: placed against its trigger, or as a sheet from the bottom edge.
|
|
315
|
+
- `data-swiping`: Present while the sheet is dragged.
|
|
316
|
+
- `data-swipe-dismiss`: Present once a drag has closed it.
|
|
317
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
249
318
|
- `data-empty`: Present when no item is shown for what was typed.
|
|
319
|
+
- `--drawer-swipe-movement-x`: As a sheet: how far it has been dragged across, always 0px.
|
|
320
|
+
- `--drawer-swipe-movement-y`: As a sheet: how far it has been dragged down.
|
|
321
|
+
- `--drawer-swipe-progress`: As a sheet: how far it has been dragged, of its own height: 0 to 1.
|
|
322
|
+
- `--drawer-swipe-strength`: As a sheet, once let go: 0.1 to 1, the share of the design's own time it should take to come to rest.
|
|
250
323
|
- list: The items' own box inside the popup, when the popup holds more than items (an input): it is then the listbox.
|
|
251
324
|
- `data-empty`: Present when no item is shown for what was typed.
|
|
252
325
|
- item: One suggestion: chosen, its text is written into the input.
|
|
253
326
|
- `data-selected`: Present on the chosen item.
|
|
254
327
|
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
255
328
|
- `data-disabled`: Present when it is disabled.
|
|
256
|
-
- clear: A button that empties the input and the value.
|
|
329
|
+
- clear: A button that empties the input and the value. It is in the page while there is something to clear (the text, for an autocomplete; else what is chosen), and through its exit; `keepMounted` keeps it there.
|
|
257
330
|
- `data-disabled`: Present when it is disabled.
|
|
331
|
+
- `data-popup-open`: Present when the list is open.
|
|
332
|
+
- `data-visible`: Present while there is something to clear.
|
|
333
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
334
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
258
335
|
|
|
259
336
|
### Autosize
|
|
260
337
|
|
|
@@ -285,17 +362,21 @@ Anatomy:
|
|
|
285
362
|
import "@kirana-ui/web/avatar"
|
|
286
363
|
```
|
|
287
364
|
|
|
288
|
-
`<kui-avatar>`: `<kui-avatar>` around `kui-part="root"`, an `image` (an `<img>`, in the page once the picture has loaded) and a `fallback`, in the page until then. `src`: the picture's address, on the component, since the image is not in the page to be given one.
|
|
365
|
+
`<kui-avatar>`: `<kui-avatar>` around `kui-part="root"`, an `image` (an `<img>`, in the page once the picture has loaded) and a `fallback`, in the page until then; `kui-delay="600"` on the fallback waits that many milliseconds first. `src`: the picture's address, on the component, since the image is not in the page to be given one. With `kui-keep-mounted` the image stays in the page, as Base UI's `keepMounted` image: its own `src` is the address, it loads the picture itself, and it is `aria-hidden` until it has (`data-loading`, `data-error`). It tells `loading-status-change` (`detail.status`) as the picture loads.
|
|
289
366
|
|
|
290
367
|
Attributes of the element (each also a property, in camel case):
|
|
291
368
|
|
|
292
369
|
- `src` (string)
|
|
293
370
|
|
|
371
|
+
Events:
|
|
372
|
+
|
|
373
|
+
- `loading-status-change`: `event.detail.status`, with `event.detail.details`. It reports something that happened: there is nothing to keep.
|
|
374
|
+
|
|
294
375
|
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
295
376
|
|
|
296
377
|
- `root`
|
|
297
|
-
- `image`
|
|
298
|
-
- `fallback`
|
|
378
|
+
- `image`: `kui-keep-mounted`
|
|
379
|
+
- `fallback`: `kui-delay`
|
|
299
380
|
|
|
300
381
|
Anatomy:
|
|
301
382
|
|
|
@@ -306,19 +387,27 @@ Anatomy:
|
|
|
306
387
|
fallback
|
|
307
388
|
```
|
|
308
389
|
|
|
390
|
+
Attributes and CSS variables, by part:
|
|
391
|
+
|
|
392
|
+
- root: The frame the image and its stand-in share.
|
|
393
|
+
- `data-image-loading-status="idle | loading | loaded | error"`: Where the picture is in its loading: `idle` while it has no address.
|
|
394
|
+
- image: The picture. In the page once it has loaded; with `keepMounted` (on Angular, the attribute form) in the page all along, `aria-hidden` until it has loaded.
|
|
395
|
+
- `data-loading`: Present while the picture loads, on an image kept in the page.
|
|
396
|
+
- `data-error`: Present when the picture cannot load, on an image kept in the page.
|
|
397
|
+
|
|
309
398
|
### Button
|
|
310
399
|
|
|
311
400
|
```
|
|
312
401
|
import "@kirana-ui/web/button"
|
|
313
402
|
```
|
|
314
403
|
|
|
315
|
-
`<kui-button>`: `<kui-button>` around a `kui-part="root"` button, or with `native-button="false"` another element that acts as one. `disabled`, `focusable-when-disabled`, `native-button`.
|
|
404
|
+
`<kui-button>`: `<kui-button>` around a `kui-part="root"` button, or with `native-button="false"` another element that acts as one; on a link that navigates (`<a href>`), it stays a link. `disabled`, `focusable-when-disabled`, `native-button`.
|
|
316
405
|
|
|
317
406
|
Attributes of the element (each also a property, in camel case):
|
|
318
407
|
|
|
319
408
|
- `disabled` (boolean): Disabled: a press does nothing.
|
|
320
409
|
- `focusable-when-disabled` (boolean): Keeps a disabled button in the tab order, so what it would do can still be read.
|
|
321
|
-
- `native-button` (boolean): `false` when the element is not a `<button>`: it is given a button's role and
|
|
410
|
+
- `native-button` (boolean): `false` when the element is not a `<button>`: it is given a button's role, a place in the tab order and its keys (Enter, Space). A link that navigates (an `<a>` or `<area>` with an `href`) stays a link: no role is written over its own, it keeps its own place in the tab order and its own Enter, and Space does not press it; disabled, it is still blocked.
|
|
322
411
|
|
|
323
412
|
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
324
413
|
|
|
@@ -342,21 +431,30 @@ Attributes and CSS variables, by part:
|
|
|
342
431
|
import "@kirana-ui/web/calendar"
|
|
343
432
|
```
|
|
344
433
|
|
|
345
|
-
`<kui-calendar>`: `<kui-calendar>` around `kui-part="root"`, with `previous` and `next` buttons, a `heading` (it says the month) and a `grid` table. The table's head row holds a `<template kui-each="weekdays">` with a `head-cell` (`{short}`, `{narrow}`, `{long}`); its body a `<template kui-each="weeks">` with a row, which holds a `<template kui-each="days">` with a `cell` and its `day` button (`{date}`, `{label}`). `value` and `default-value` (a day as `2026-03-14`;
|
|
434
|
+
`<kui-calendar>`: `<kui-calendar>` around `kui-part="root"`, with `previous` and `next` buttons, a `heading` (it says the month) and a `grid` table. The table's head row holds a `<template kui-each="weekdays">` with a `head-cell` (`{short}`, `{narrow}`, `{long}`); its body a `<template kui-each="weeks">` with a row, which holds a `<template kui-each="days">` with a `cell` and its `day` button (`{date}`, `{label}`). With several `months`, a `<template kui-each="months">` (`{index}`, `{month}`, `{title}`) holds each month's `heading` and `grid`. An `<input kui-part="input">` submits the value under `name`. `value` and `default-value` (a day as `2026-03-14`; a range's first and last, or a list's days, with commas between), `mode`, `required`, `min-days`, `max-days`, `months`, `paged-navigation`, `month`, `default-month`, `default-focused-value`, `locale`, `calendar-system`, `min`, `max`, `disabled`, `read-only`, `fixed-weeks`, `name`, `form`; `isDateUnavailable` as a property; it tells `value-change` and `month-change`.
|
|
346
435
|
|
|
347
436
|
Attributes of the element (each also a property, in camel case):
|
|
348
437
|
|
|
349
|
-
- `value` (string): One day
|
|
438
|
+
- `value` (string): One day; with `mode: "range"` a first and a last day; with `mode: "multiple"` a list of days, in the order they were chosen. `null` (or an empty list) for none.
|
|
350
439
|
- `default-value` (string): The value it starts with, when the caller does not hold `value`. Read once.
|
|
351
|
-
- `mode` (string): Whether one day is chosen (the default)
|
|
352
|
-
- `default-
|
|
353
|
-
- `
|
|
440
|
+
- `mode` (string): Whether one day is chosen (the default), a first and a last (`"range"`), or any number (`"multiple"`: a day pressed is added, and pressed again is taken away).
|
|
441
|
+
- `required` (boolean): Whether a day, once chosen, stays chosen. Off by default, as in react-day-picker: the chosen day pressed again is taken away and the value is `null`, heard with the reason `"day-deselect"` (cancellable). Given, the chosen day pressed again stays, and with `mode: "multiple"` the last day cannot be taken away. With `mode: "range"` a press always begins a range again, so a press never clears a range. It does not make a form ask for a value.
|
|
442
|
+
- `min-days` (number): With `mode: "multiple"`: the fewest days that can be left chosen. A press that would leave fewer does nothing.
|
|
443
|
+
- `max-days` (number): With `mode: "multiple"`: the most days that can be chosen. Once they are, the other days are disabled until one is taken away.
|
|
444
|
+
- `months` (number): How many months are shown side by side (1 by default): one selection and one grid for the keys, which go from a month into the next. Each is drawn in `Calendar.Months`.
|
|
445
|
+
- `paged-navigation` (boolean): With several `months`: whether Previous and Next turn them all (a page) rather than one month. Off by default, as in react-day-picker.
|
|
446
|
+
- `month` (string): The month shown (the first of them, with several `months`), when the caller holds it: any day of it. A caption's month and year menus, or a "today" button, set it.
|
|
447
|
+
- `default-month` (string): The month it starts on, when the caller does not hold `month`. Read once. Without it, the month of `defaultFocusedValue`, of the value, or of today.
|
|
448
|
+
- `default-focused-value` (string): The day it opens on, focusable when Tab reaches the grid. It is also the month it opens on, unless `month` or `defaultMonth` says another: then the stop for Tab is a chosen day of the months shown, today, or their first day.
|
|
449
|
+
- `locale` (string): The language and region its names, numbers, first day of the week and calendar follow (`"en-US"`, `"fa-IR"`). Give it: a server does not know the reader's. The week begins on the day the region begins it on (Sunday in `"en-US"`, Monday in `"fr-FR"`), or on the day a `-u-fw-` extension names: `"en-US-u-fw-mon"` is American English with weeks from Monday (`sun`, `mon`, `tue`, `wed`, `thu`, `fri`, `sat`).
|
|
354
450
|
- `calendar-system` (string): The calendar its months are laid out in, when it is not the Gregorian one: an instance from `@internationalized/date` (`new PersianCalendar()`). Given, not found from the locale: a page then carries only the calendars it uses.
|
|
355
451
|
- `min` (string): The first and the last day that can be chosen.
|
|
356
452
|
- `max` (string): The last day that can be chosen.
|
|
357
453
|
- `disabled` (boolean): Disabled: no day can be chosen.
|
|
358
454
|
- `read-only` (boolean): Shown as it is: the days can be moved through, and none can be chosen.
|
|
359
455
|
- `fixed-weeks` (boolean): Always six rows, so the calendar is one height in every month.
|
|
456
|
+
- `name` (string): The name its hidden input submits the value under: a day; the first and the last of a range, as two entries; each day of a list.
|
|
457
|
+
- `form` (string): The id of the form it belongs to, when it is not inside it.
|
|
360
458
|
|
|
361
459
|
Properties only:
|
|
362
460
|
|
|
@@ -365,11 +463,12 @@ Properties only:
|
|
|
365
463
|
Events:
|
|
366
464
|
|
|
367
465
|
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
368
|
-
- `month-change`: `event.detail.month`, with `event.detail.details`.
|
|
466
|
+
- `month-change`: `event.detail.month`, with `event.detail.details`. `preventDefault()` keeps `month` as it was.
|
|
369
467
|
|
|
370
468
|
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
371
469
|
|
|
372
470
|
- `root`
|
|
471
|
+
- `input`
|
|
373
472
|
- `heading`
|
|
374
473
|
- `previous`
|
|
375
474
|
- `next`
|
|
@@ -378,23 +477,25 @@ Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
|
378
477
|
- `cell`
|
|
379
478
|
- `day`
|
|
380
479
|
|
|
381
|
-
Lists (`<template kui-each="…">`): `weekdays`, `weeks`, `days`.
|
|
480
|
+
Lists (`<template kui-each="…">`): `weekdays`, `months`, `weeks`, `days`.
|
|
382
481
|
|
|
383
482
|
Anatomy:
|
|
384
483
|
|
|
385
484
|
```
|
|
386
485
|
<kui-calendar>
|
|
387
486
|
root
|
|
388
|
-
|
|
487
|
+
<template kui-each="months"> (optional)
|
|
488
|
+
heading
|
|
489
|
+
grid
|
|
490
|
+
<template kui-each="weekdays">
|
|
491
|
+
head-cell (repeated)
|
|
492
|
+
<template kui-each="weeks">
|
|
493
|
+
<template kui-each="days">
|
|
494
|
+
cell (repeated)
|
|
495
|
+
day
|
|
389
496
|
previous
|
|
390
497
|
next
|
|
391
|
-
|
|
392
|
-
<template kui-each="weekdays">
|
|
393
|
-
head-cell (repeated)
|
|
394
|
-
<template kui-each="weeks">
|
|
395
|
-
<template kui-each="days">
|
|
396
|
-
cell (repeated)
|
|
397
|
-
day
|
|
498
|
+
input
|
|
398
499
|
```
|
|
399
500
|
|
|
400
501
|
Attributes and CSS variables, by part:
|
|
@@ -407,21 +508,21 @@ Attributes and CSS variables, by part:
|
|
|
407
508
|
- next: Shows the month after.
|
|
408
509
|
- `data-disabled`: Present when it is disabled.
|
|
409
510
|
- cell: A day's cell.
|
|
410
|
-
- `data-selected`: Present on a chosen day,
|
|
511
|
+
- `data-selected`: Present on a chosen day, on every day of a chosen range, and on each day of a list. Also on a copy of one (a day of the month before or after, shown in its own month too), which is drawn as the day is but has no aria-selected.
|
|
411
512
|
- `data-today`: Present on today.
|
|
412
513
|
- `data-outside-month`: Present on the days of the month before and after that fill the first and last weeks.
|
|
413
514
|
- `data-disabled`: Present when it is disabled.
|
|
414
515
|
- `data-unavailable`: Present on a day that cannot be chosen.
|
|
415
|
-
- `data-range-start`: Present on the first day of a range.
|
|
416
|
-
- `data-range-end`: Present on the last day of a range.
|
|
516
|
+
- `data-range-start`: Present on the first day of a range, and on a copy of it.
|
|
517
|
+
- `data-range-end`: Present on the last day of a range, and on a copy of it.
|
|
417
518
|
- day: The button for a day.
|
|
418
|
-
- `data-selected`: Present on a chosen day,
|
|
519
|
+
- `data-selected`: Present on a chosen day, on every day of a chosen range, and on each day of a list. Also on a copy of one (a day of the month before or after, shown in its own month too), which is drawn as the day is but has no aria-selected.
|
|
419
520
|
- `data-today`: Present on today.
|
|
420
521
|
- `data-outside-month`: Present on the days of the month before and after that fill the first and last weeks.
|
|
421
522
|
- `data-disabled`: Present when it is disabled.
|
|
422
523
|
- `data-unavailable`: Present on a day that cannot be chosen.
|
|
423
|
-
- `data-range-start`: Present on the first day of a range.
|
|
424
|
-
- `data-range-end`: Present on the last day of a range.
|
|
524
|
+
- `data-range-start`: Present on the first day of a range, and on a copy of it.
|
|
525
|
+
- `data-range-end`: Present on the last day of a range, and on a copy of it.
|
|
425
526
|
|
|
426
527
|
### Carousel
|
|
427
528
|
|
|
@@ -429,7 +530,7 @@ Attributes and CSS variables, by part:
|
|
|
429
530
|
import "@kirana-ui/web/carousel"
|
|
430
531
|
```
|
|
431
532
|
|
|
432
|
-
`<kui-carousel>`: `<kui-carousel>` around `kui-part="root"`, a `viewport` with an `item` for each slide (`kui-index`, from 0), `previous` and `next` buttons, and an `indicator` button for a slide (`kui-index`). `index`, `default-index`, `orientation`, `loop`; it tells `index-change`.
|
|
533
|
+
`<kui-carousel>`: `<kui-carousel>` around `kui-part="root"`, a `viewport` with an `item` for each slide (`kui-index`, from 0, or its place in the page when it has none), `previous` and `next` buttons, and an `indicator` button for a slide (`kui-index`). `index`, `default-index`, `orientation`, `loop`; it tells `index-change`.
|
|
433
534
|
|
|
434
535
|
Attributes of the element (each also a property, in camel case):
|
|
435
536
|
|
|
@@ -485,19 +586,21 @@ Attributes and CSS variables, by part:
|
|
|
485
586
|
import "@kirana-ui/web/checkbox"
|
|
486
587
|
```
|
|
487
588
|
|
|
488
|
-
`<kui-checkbox>`: `<kui-checkbox>` around a `kui-part="root"` button with an `indicator` inside, which is in the page while the box is checked or indeterminate. The root draws the hidden native input a form and a label reach. `checked`, `default-checked`, `indeterminate`, `disabled`, `read-only`, `required`, `name`, `form`, `value`; it tells `checked-change`.
|
|
589
|
+
`<kui-checkbox>`: `<kui-checkbox>` around a `kui-part="root"` button with an `indicator` inside, which is in the page while the box is checked or indeterminate. The root draws the hidden native input a form and a label reach. Inside a `<kui-checkbox-group>` it is one of the group's boxes, by its `value`, or with `parent` the one that stands for them all. `checked`, `default-checked`, `indeterminate`, `parent`, `disabled`, `read-only`, `required`, `name`, `form`, `value`; it tells `checked-change`.
|
|
489
590
|
|
|
490
591
|
Attributes of the element (each also a property, in camel case):
|
|
491
592
|
|
|
492
593
|
- `checked` (boolean): Whether it is checked, when the caller holds it.
|
|
493
594
|
- `default-checked` (boolean): Read once.
|
|
494
595
|
- `indeterminate` (boolean): Neither checked nor unchecked: a parent of boxes that disagree.
|
|
596
|
+
- `parent` (boolean): In a checkbox group with `allValues`: the box that stands for them all, written anywhere inside the group. It is checked when every one is, mixed when some are, and it is not submitted; its `aria-controls` names the boxes. A press from mixed checks them all, the next unchecks them all, and the next brings back the set they were left in (left all checked or none, a press goes between all and none); a disabled box keeps its state. Read once.
|
|
495
597
|
- `disabled` (boolean): Disabled: it cannot be changed.
|
|
496
598
|
- `read-only` (boolean): Shown as it is, focusable, not changeable.
|
|
497
599
|
- `required` (boolean): Needed: in a `Field`, leaving it unchecked is then invalid.
|
|
498
600
|
- `name` (string): With a name, the control is submitted with the form around it when it is checked.
|
|
499
601
|
- `form` (string): The id of the form the control belongs to, when it is not inside it.
|
|
500
602
|
- `value` (string): What is submitted. Default `"on"`, as a native checkbox's.
|
|
603
|
+
- `kui-id` (string): The id of the box's hidden native checkbox, not of the box: a `<label for>` names it. Inside a `Field`, that input takes the field's id instead.
|
|
501
604
|
|
|
502
605
|
Events:
|
|
503
606
|
|
|
@@ -525,16 +628,65 @@ Attributes and CSS variables, by part:
|
|
|
525
628
|
- `data-disabled`: Present when it is disabled.
|
|
526
629
|
- `data-readonly`: Present when it can be read but not changed.
|
|
527
630
|
- `data-required`: Present when the form needs it.
|
|
528
|
-
-
|
|
631
|
+
- `data-parent`: Present on the checkbox that stands for every box of its group.
|
|
632
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
633
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
634
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
635
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
636
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
637
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
638
|
+
- indicator: The mark. In the page while the box is checked or indeterminate. `data-indeterminate` and `data-checked` say which mark to draw, a dash or a tick: in CSS (`[data-indeterminate]`), or from the part's state. Through its exit the box is already unchecked, and both are absent.
|
|
529
639
|
- `data-checked`: Present when it is checked.
|
|
530
640
|
- `data-unchecked`: Present when it is not checked.
|
|
531
641
|
- `data-indeterminate`: Present when it is neither checked nor unchecked.
|
|
532
642
|
- `data-disabled`: Present when it is disabled.
|
|
533
643
|
- `data-readonly`: Present when it can be read but not changed.
|
|
534
644
|
- `data-required`: Present when the form needs it.
|
|
645
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
646
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
647
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
648
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
649
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
650
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
535
651
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
536
652
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
537
653
|
|
|
654
|
+
### CheckboxGroup
|
|
655
|
+
|
|
656
|
+
```
|
|
657
|
+
import "@kirana-ui/web/checkbox-group"
|
|
658
|
+
```
|
|
659
|
+
|
|
660
|
+
`<kui-checkbox-group>`: `<kui-checkbox-group>` around `kui-part="root"` and its `<kui-checkbox>`es, each with a `value`; one marked `parent` stands for every value of `all-values`. `value`, `default-value` and `all-values` (with commas between), `disabled`; it tells `value-change`.
|
|
661
|
+
|
|
662
|
+
Attributes of the element (each also a property, in camel case):
|
|
663
|
+
|
|
664
|
+
- `value` (string): The values of the checked checkboxes, when the caller holds them.
|
|
665
|
+
- `default-value` (string): The values checked at the start, when the caller does not hold `value`. Read once.
|
|
666
|
+
- `all-values` (string): The value of every checkbox of the group, for a checkbox marked `parent`: it is checked when all of them are, mixed when some are, and a press on it goes from the set they were left in to all, then none, then back. Its order names the boxes' elements (`<id>-0` …).
|
|
667
|
+
- `disabled` (boolean): Disables every checkbox of the group.
|
|
668
|
+
- `kui-id` (string): The group's own id, and what its boxes' elements are named from (`<id>-0`, `<id>-1` …, by their place in `allValues`), which a parent box's `aria-controls` names. Inside a `Field`, the group takes the field's id instead.
|
|
669
|
+
|
|
670
|
+
Events:
|
|
671
|
+
|
|
672
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
673
|
+
|
|
674
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
675
|
+
|
|
676
|
+
- `root`
|
|
677
|
+
|
|
678
|
+
Anatomy:
|
|
679
|
+
|
|
680
|
+
```
|
|
681
|
+
<kui-checkbox-group>
|
|
682
|
+
root
|
|
683
|
+
```
|
|
684
|
+
|
|
685
|
+
Attributes and CSS variables, by part:
|
|
686
|
+
|
|
687
|
+
- root: The group: `role="group"`, with its `id`. Name it with `aria-label`, or `aria-labelledby` naming a heading of your own; inside a `Field`, the field's label names it and its description describes it. A checkbox anywhere inside it with a `value` is checked while the group's value holds it; one marked `parent`, anywhere inside it too, stands for every value of `allValues`, and its `aria-controls` names their boxes.
|
|
688
|
+
- `data-disabled`: Present when it is disabled.
|
|
689
|
+
|
|
538
690
|
### Collapsible
|
|
539
691
|
|
|
540
692
|
```
|
|
@@ -574,6 +726,8 @@ Attributes and CSS variables, by part:
|
|
|
574
726
|
- `data-open`: Present when it is open.
|
|
575
727
|
- `data-closed`: Present when it is closed.
|
|
576
728
|
- `data-disabled`: Present when it is disabled.
|
|
729
|
+
- `data-starting-style`: Present for the first style of the panel's entrance, as on the panel.
|
|
730
|
+
- `data-ending-style`: Present through the panel's exit, as on the panel.
|
|
577
731
|
- trigger: The button that opens and closes the panel.
|
|
578
732
|
- `data-panel-open`: Present when the panel is open.
|
|
579
733
|
- `data-disabled`: Present when it is disabled.
|
|
@@ -585,36 +739,191 @@ Attributes and CSS variables, by part:
|
|
|
585
739
|
- `--collapsible-panel-height`: The panel's content height while it opens or closes, `auto` once it is open.
|
|
586
740
|
- `--collapsible-panel-width`: The panel's content width while it opens or closes, `auto` once it is open.
|
|
587
741
|
|
|
742
|
+
### ColorPicker
|
|
743
|
+
|
|
744
|
+
```
|
|
745
|
+
import "@kirana-ui/web/color-picker"
|
|
746
|
+
```
|
|
747
|
+
|
|
748
|
+
`<kui-color-picker>`: `<kui-color-picker>` around `kui-part="root"`, which holds an `area` with its `area-thumb`, a `channel-slider` for each channel it moves (`kui-channel`: `hue` or `alpha`, and `kui-orientation`) holding its `channel-slider-track` and `channel-slider-thumb`, a `channel-input` for each channel typed in (`kui-channel`: `hex`, `red`, `green`, `blue`, `hue`, `saturation`, `lightness`, `alpha`), `swatch`es, `swatch-trigger` buttons for presets (`kui-value`), an `eye-dropper-trigger`, a `value-text` that says the colour and a `format-trigger` that says its format, each unless the page wrote something. The root draws the hidden input a form reads, as its last child. `value`, `default-value`, `format`, `default-format`, `alpha`, `thumb-alignment`, `disabled`, `read-only`, `required`, `name`, `form`; `getAriaValueText` as a property. It tells `value-change`, `value-committed` and `format-change`.
|
|
749
|
+
|
|
750
|
+
Attributes of the element (each also a property, in camel case):
|
|
751
|
+
|
|
752
|
+
- `value` (string): The colour as text in `format`, when the caller holds it. Any format is read.
|
|
753
|
+
- `default-value` (string): Read once. Default `#000000`.
|
|
754
|
+
- `format` (string): How the value is written, when the caller holds it.
|
|
755
|
+
- `default-format` (string): Read once. Default `"hex"`.
|
|
756
|
+
- `alpha` (boolean): Whether the opacity can be chosen. With it, the value always carries its alpha (`#rrggbbaa`, `rgba()`, `hsla()`); without it, never. Default false.
|
|
757
|
+
- `thumb-alignment` (string): Where a thumb is at the ends of its range. `"center"` (the default): its centre on the edge, so half of it lies outside. `"edge"`: its edge on the edge, so it stays inside.
|
|
758
|
+
- `disabled` (boolean): Disabled: it cannot be changed.
|
|
759
|
+
- `read-only` (boolean): Shown as it is, focusable, not changeable; still submitted with the form.
|
|
760
|
+
- `required` (boolean): Needed by the form. A colour always has a value, so this only says so.
|
|
761
|
+
- `name` (string): With a name, the value is submitted with the form around the picker.
|
|
762
|
+
- `form` (string): The id of the form the picker belongs to, when it is not inside it.
|
|
763
|
+
|
|
764
|
+
Properties only:
|
|
765
|
+
|
|
766
|
+
- `getAriaValueText`: What assistive technology reads for a thumb, when the written one is not enough.
|
|
767
|
+
|
|
768
|
+
Events:
|
|
769
|
+
|
|
770
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
771
|
+
- `value-committed`: `event.detail.value`, with `event.detail.details`. It reports something that happened: there is nothing to keep.
|
|
772
|
+
- `format-change`: `event.detail.format`, with `event.detail.details`. `preventDefault()` keeps `format` as it was.
|
|
773
|
+
|
|
774
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
775
|
+
|
|
776
|
+
- `root`
|
|
777
|
+
- `area`
|
|
778
|
+
- `area-thumb`
|
|
779
|
+
- `channel-slider`: `kui-channel`, `kui-orientation`
|
|
780
|
+
- `channel-slider-track`: `kui-channel`, `kui-orientation`
|
|
781
|
+
- `channel-slider-thumb`: `kui-channel`, `kui-orientation`
|
|
782
|
+
- `channel-input`: `kui-channel`
|
|
783
|
+
- `swatch`
|
|
784
|
+
- `swatch-trigger`: `kui-value`
|
|
785
|
+
- `eye-dropper-trigger`
|
|
786
|
+
- `value-text`
|
|
787
|
+
- `format-trigger`
|
|
788
|
+
|
|
789
|
+
Anatomy:
|
|
790
|
+
|
|
791
|
+
```
|
|
792
|
+
<kui-color-picker>
|
|
793
|
+
root
|
|
794
|
+
area
|
|
795
|
+
area-thumb
|
|
796
|
+
channel-slider (repeated)
|
|
797
|
+
channel-slider-track
|
|
798
|
+
channel-slider-thumb
|
|
799
|
+
channel-slider-thumb (as above)
|
|
800
|
+
channel-input (repeated)
|
|
801
|
+
swatch (repeated)
|
|
802
|
+
swatch-trigger (repeated)
|
|
803
|
+
eye-dropper-trigger
|
|
804
|
+
value-text
|
|
805
|
+
format-trigger
|
|
806
|
+
```
|
|
807
|
+
|
|
808
|
+
Attributes and CSS variables, by part:
|
|
809
|
+
|
|
810
|
+
- root: Groups the picker's parts. It holds the hidden input a form reads, and the colour for anything inside to paint with.
|
|
811
|
+
- `data-disabled`: Present when it is disabled.
|
|
812
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
813
|
+
- `data-required`: Present when the form needs a colour.
|
|
814
|
+
- `data-dragging`: Present while a pointer holds a thumb of the picker.
|
|
815
|
+
- `data-format="hex | rgb | hsl"`: How the value is written.
|
|
816
|
+
- `--color`: The colour, with its alpha.
|
|
817
|
+
- area: The two-dimensional field a pointer presses and drags on: saturation across, the way the text runs, and brightness up. A design paints it from its hue.
|
|
818
|
+
- `data-disabled`: Present when it is disabled.
|
|
819
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
820
|
+
- `data-required`: Present when the form needs a colour.
|
|
821
|
+
- `data-dragging`: Present while a pointer holds this part's thumb.
|
|
822
|
+
- `--hue-color`: The colour's hue at full saturation and brightness.
|
|
823
|
+
- areaThumb: What is dragged in the area, and what the arrows move: a slider in two dimensions to assistive technology, its text saying both. Its place is written on it.
|
|
824
|
+
- `data-disabled`: Present when it is disabled.
|
|
825
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
826
|
+
- `data-required`: Present when the form needs a colour.
|
|
827
|
+
- `data-dragging`: Present while a pointer holds this part's thumb.
|
|
828
|
+
- `--saturation`: Its place across, as a share of the area: the saturation.
|
|
829
|
+
- `--brightness`: Its place up, as a share of the area: the brightness.
|
|
830
|
+
- `--color`: The colour under it, without its alpha.
|
|
831
|
+
- channelSlider: What a pointer presses and drags on to move the hue or the alpha. It holds the track and the thumb. It takes `channel` and `orientation`.
|
|
832
|
+
- `data-disabled`: Present when it is disabled.
|
|
833
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
834
|
+
- `data-required`: Present when the form needs a colour.
|
|
835
|
+
- `data-dragging`: Present while a pointer holds this part's thumb.
|
|
836
|
+
- `data-channel="hue | alpha"`: The channel the slider moves.
|
|
837
|
+
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
838
|
+
- channelSliderTrack: The channel's whole range: what a design paints the hues or the alpha on.
|
|
839
|
+
- `data-disabled`: Present when it is disabled.
|
|
840
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
841
|
+
- `data-required`: Present when the form needs a colour.
|
|
842
|
+
- `data-dragging`: Present while a pointer holds this part's thumb.
|
|
843
|
+
- `data-channel="hue | alpha"`: The channel the slider moves.
|
|
844
|
+
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
845
|
+
- `--color`: The colour without its alpha: the end of an alpha track.
|
|
846
|
+
- `--hue-color`: The colour's hue at full saturation and brightness.
|
|
847
|
+
- channelSliderThumb: What is dragged, and what the keyboard moves: a slider to assistive technology, its range 0 to 360 for the hue and 0 to 100 for the alpha. Its place on the track is written on it.
|
|
848
|
+
- `data-disabled`: Present when it is disabled.
|
|
849
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
850
|
+
- `data-required`: Present when the form needs a colour.
|
|
851
|
+
- `data-dragging`: Present while a pointer holds this part's thumb.
|
|
852
|
+
- `data-channel="hue | alpha"`: The channel the slider moves.
|
|
853
|
+
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
854
|
+
- `--color`: The colour under it: the pure hue, or the colour at its alpha.
|
|
855
|
+
- channelInput: A text input for one channel (`hex`, `red`, `green`, `blue`, `hue`, `saturation`, `lightness`, `alpha`). What is typed is taken when it is a colour or a number in range, and put back when focus leaves while it is not.
|
|
856
|
+
- `data-disabled`: Present when it is disabled.
|
|
857
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
858
|
+
- `data-required`: Present when the form needs a colour.
|
|
859
|
+
- `data-dragging`: Present while a pointer holds a thumb of the picker.
|
|
860
|
+
- `data-channel="hex | red | green | blue | hue | saturation | lightness | alpha"`: The channel the input is typed in.
|
|
861
|
+
- swatch: Shows the current colour.
|
|
862
|
+
- `data-disabled`: Present when it is disabled.
|
|
863
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
864
|
+
- `data-required`: Present when the form needs a colour.
|
|
865
|
+
- `data-dragging`: Present while a pointer holds a thumb of the picker.
|
|
866
|
+
- `--color`: The colour, with its alpha.
|
|
867
|
+
- swatchTrigger: A preset colour, given as `value`: pressed, the colour is this one.
|
|
868
|
+
- `data-disabled`: Present when it is disabled.
|
|
869
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
870
|
+
- `data-required`: Present when the form needs a colour.
|
|
871
|
+
- `data-dragging`: Present while a pointer holds a thumb of the picker.
|
|
872
|
+
- `data-selected`: Present while the colour is this one.
|
|
873
|
+
- `--color`: The preset's colour, with its alpha.
|
|
874
|
+
- eyeDropperTrigger: Picks a colour from the screen with the browser's eye dropper. Hidden where the browser has none, and on a server.
|
|
875
|
+
- `data-disabled`: Present when it is disabled.
|
|
876
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
877
|
+
- `data-required`: Present when the form needs a colour.
|
|
878
|
+
- `data-dragging`: Present while a pointer holds a thumb of the picker.
|
|
879
|
+
- valueText: The colour, written in its format.
|
|
880
|
+
- `data-disabled`: Present when it is disabled.
|
|
881
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
882
|
+
- `data-required`: Present when the form needs a colour.
|
|
883
|
+
- `data-dragging`: Present while a pointer holds a thumb of the picker.
|
|
884
|
+
- `data-format="hex | rgb | hsl"`: How the value is written.
|
|
885
|
+
- formatTrigger: Goes to the next format: hex, then rgb, then hsl.
|
|
886
|
+
- `data-disabled`: Present when it is disabled.
|
|
887
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
888
|
+
- `data-required`: Present when the form needs a colour.
|
|
889
|
+
- `data-dragging`: Present while a pointer holds a thumb of the picker.
|
|
890
|
+
- `data-format="hex | rgb | hsl"`: How the value is written.
|
|
891
|
+
|
|
588
892
|
### Combobox
|
|
589
893
|
|
|
590
894
|
```
|
|
591
895
|
import "@kirana-ui/web/combobox"
|
|
592
896
|
```
|
|
593
897
|
|
|
594
|
-
`<kui-combobox>`: `<kui-combobox>` around an `input`, with a `trigger` and a `clear` button if it has them, and a `portal` with a `positioner` (`kui-side` … and `kui-anchor`, an element's id) around the `popup`, which holds an `item` for each `kui-value` (`kui-disabled`, `kui-label`, `kui-id`) with an `item-indicator`, in `group`s with a `group-label` and `separator`s if it has them, and an `empty` part drawn while nothing matches. The `input` may be inside the `popup`, the items then in a `list` part: the popup is placed against the `trigger`, and the input has focus while it is open. With `multiple`, the input is in a `chips` part with a `<template kui-each="chips">` holding a `chip` (`{value}`) and its `chip-remove` button. With a name it draws the hidden input a form reads. `value`, `default-value`, `input-value`, `default-input-value`, `open`, `default-open`, `disabled`, `required`, `inline`, `auto-highlight`, `multiple
|
|
898
|
+
`<kui-combobox>`: `<kui-combobox>` around an `input`, with a `trigger` and a `clear` button if it has them, and a `portal` with a `positioner` (`kui-side` … and `kui-anchor`, an element's id) around the `popup`, which holds an `item` for each `kui-value` (`kui-disabled`, `kui-label`, `kui-id`) with an `item-indicator`, in `group`s with a `group-label` and `separator`s if it has them, and an `empty` part drawn while nothing matches. The `input` may be inside the `popup`, the items then in a `list` part: the popup is placed against the `trigger`, and the input has focus while it is open. With `multiple`, the input is in a `chips` part with a `<template kui-each="chips">` holding a `chip` (`{value}`) and its `chip-remove` button. With the input in the popup, the `trigger` may hold a `value` part: it says the chosen value's label, or its `kui-placeholder`. A `status` part says how the list stands to software that reads the page, as the page changes its text. With `items` given as data, the list is a `<template kui-each="collection">` holding an `item` (`kui-value="{value}"`, `{label}`; `kui-when="item"` where groups are given too) or a `group` (`kui-when="group"`, `{value}` its name) with a `<template kui-each="collection">` of its own for its items: the element filters, and draws what is left. With a name it draws the hidden input a form reads. `value`, `default-value`, `input-value`, `default-input-value`, `open`, `default-open`, `disabled`, `read-only`, `required`, `inline`, `auto-highlight`, `multiple` (with it, `value` and `default-value` hold the chosen values with commas between; `values` and `default-values`, the older names, are still read), `name`, `form`, `presentation` (`sheet` opens the list from the bottom edge, modal, over a `backdrop` part in the portal; `auto` on a narrow touch screen) and `sheet-below`; `items`, `filter`, `itemToStringLabel` and `itemToStringValue` as properties; it tells `value-change`, `values-change`, `input-value-change` and `open-change`.
|
|
595
899
|
|
|
596
900
|
Attributes of the element (each also a property, in camel case):
|
|
597
901
|
|
|
598
|
-
- `value` (string): The chosen value; `null` is "none".
|
|
599
|
-
- `default-value` (string): The value it starts with, when the caller does not hold `value`. Read once.
|
|
902
|
+
- `value` (string): The chosen value; `null` is "none". With `multiple`, the chosen values, in the order they were chosen.
|
|
903
|
+
- `default-value` (string): The value it starts with (with `multiple`, the values), when the caller does not hold `value`. Read once.
|
|
600
904
|
- `input-value` (string): What the input says.
|
|
601
905
|
- `default-input-value` (string): The text the input starts with, when the caller does not hold `inputValue`. Read once.
|
|
602
906
|
- `open` (boolean): Whether the list is open, when the caller holds it.
|
|
603
907
|
- `default-open` (boolean): Whether the list starts open, when the caller does not hold `open`. Read once.
|
|
604
908
|
- `disabled` (boolean): Disabled: it cannot be changed.
|
|
909
|
+
- `read-only` (boolean): Its value can be read and not changed. The list still opens and can be gone through, by the pointer and the arrows, but no press and no Enter chooses; nothing typed is taken, and its clear and chip buttons do nothing. It keeps focus, and its value is still submitted.
|
|
605
910
|
- `required` (boolean): In a field, "none" is then wrong.
|
|
606
911
|
- `inline` (boolean): The list is always in the page, under the input, with no popup: a command palette. An item chosen is told to the caller, and the input keeps what was typed.
|
|
607
912
|
- `auto-highlight` (boolean): The first item shown for what was typed is highlighted as one types, so Enter chooses it. Off by default: typing then highlights nothing, and Enter chooses once an arrow or the pointer has gone to an item. Either way a list opened with nothing typed is on its chosen item, if it has one.
|
|
608
|
-
- `multiple` (boolean): Several values
|
|
609
|
-
- `values` (string): With `multiple`: the chosen values
|
|
610
|
-
- `default-values` (string): With `multiple`: the values it starts with
|
|
913
|
+
- `multiple` (boolean): Several values: `value`, `defaultValue` and `onValueChange` then hold a list. Read once.
|
|
914
|
+
- `values` (string): With `multiple`: the chosen values.
|
|
915
|
+
- `default-values` (string): With `multiple`: the values it starts with.
|
|
611
916
|
- `name` (string): With a name, the value is submitted with the form around it.
|
|
612
917
|
- `form` (string): The id of the form the control belongs to, when it is not inside it.
|
|
918
|
+
- `presentation` (string): How the list opens. `"sheet"`: from the bottom edge, not placed against the input, modal with a backdrop, swiped down or pressed outside to close; the input then goes in the popup, at its head. `"auto"`: decided each time it opens, a sheet when the pointer is coarse and the viewport narrower than `sheetBelow`. Default `"popup"`. Not with `inline`.
|
|
919
|
+
- `sheet-below` (number): With `presentation: "auto"`: the viewport's width, in CSS pixels, under which a coarse pointer opens a sheet. Default 640.
|
|
613
920
|
|
|
614
921
|
Properties only:
|
|
615
922
|
|
|
616
|
-
- `items`: The
|
|
617
|
-
- `filter`: Whether an item is shown for what was typed. Default: its label holds the text, without regard to case. `null`: every item is shown, and the caller draws the ones it wants.
|
|
923
|
+
- `items`: The values with their labels: a list of them, groups of them (`{ value, items }`, `value` the group's name), or, for values that are text, the labels by value (`{ apple: "Apple" }`). The input shows a value by its label from here before the list has ever been opened. With the items written in the markup that is all it is for. With a `Collection` it is the list itself: the combobox filters it by what is typed, and the `Collection` draws what is left.
|
|
924
|
+
- `filter`: Whether an item is shown for what was typed. Default: its label holds the text, without regard to case. `null`: every item is shown, and the caller draws the ones it wants (or gives the `items` it wants, when they are loaded for what was typed).
|
|
925
|
+
- `itemToStringLabel`: For values that are objects: the text the input shows for one, and what an item drawn with no text of its own is filtered by. Without it, an object's own `label` names it, then the label `items` gives it, then the item's text in the markup.
|
|
926
|
+
- `itemToStringValue`: For values that are objects: the text the form is sent for one. Without it, the `value` of an object shaped `{ value, label }` is sent, and any other object as JSON.
|
|
618
927
|
|
|
619
928
|
Events:
|
|
620
929
|
|
|
@@ -627,8 +936,10 @@ Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
|
627
936
|
|
|
628
937
|
- `input`
|
|
629
938
|
- `trigger`
|
|
939
|
+
- `value`: `kui-placeholder`
|
|
940
|
+
- `status`
|
|
630
941
|
- `clear`
|
|
631
|
-
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-collision-padding`, `kui-side`, `kui-side-offset`
|
|
942
|
+
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-arrow-padding`, `kui-collision-boundary`, `kui-collision-padding`, `kui-position-method`, `kui-side`, `kui-side-offset`, `kui-sticky`
|
|
632
943
|
- `popup`
|
|
633
944
|
- `list`
|
|
634
945
|
- `empty`
|
|
@@ -640,8 +951,9 @@ Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
|
640
951
|
- `chip`
|
|
641
952
|
- `chip-remove`
|
|
642
953
|
- `item-indicator`: `kui-value`
|
|
954
|
+
- `backdrop`
|
|
643
955
|
|
|
644
|
-
Lists (`<template kui-each="…">`): `chips`.
|
|
956
|
+
Lists (`<template kui-each="…">`): `chips`, `collection`.
|
|
645
957
|
|
|
646
958
|
Anatomy:
|
|
647
959
|
|
|
@@ -649,18 +961,27 @@ Anatomy:
|
|
|
649
961
|
<kui-combobox>
|
|
650
962
|
input
|
|
651
963
|
trigger
|
|
964
|
+
value (optional)
|
|
652
965
|
portal
|
|
966
|
+
backdrop (optional)
|
|
653
967
|
positioner
|
|
654
968
|
popup
|
|
655
969
|
input (as above)
|
|
656
970
|
list (optional)
|
|
971
|
+
<template kui-each="collection"> (optional)
|
|
972
|
+
item (repeated, as above)
|
|
973
|
+
group (optional, repeated, as above)
|
|
657
974
|
group (optional, repeated)
|
|
975
|
+
<template kui-each="collection"> (optional, as above)
|
|
658
976
|
item (repeated)
|
|
659
977
|
item-indicator
|
|
660
978
|
group-label
|
|
661
979
|
separator (repeated)
|
|
980
|
+
<template kui-each="collection"> (optional, as above)
|
|
662
981
|
empty
|
|
982
|
+
status (optional)
|
|
663
983
|
popup (as above)
|
|
984
|
+
status (optional, as above)
|
|
664
985
|
clear
|
|
665
986
|
chips
|
|
666
987
|
input (as above)
|
|
@@ -672,35 +993,85 @@ Attributes and CSS variables, by part:
|
|
|
672
993
|
|
|
673
994
|
- input: The text input. What is typed filters the list, which is placed against it, or against the chips' box when it is in one. Inside the popup, it takes focus while the popup is open.
|
|
674
995
|
- `data-popup-open`: Present when the list is open.
|
|
996
|
+
- `data-pressed`: Present while its popup is open: it stays pressed, as a button held down.
|
|
997
|
+
- `data-popup-side="top | right | bottom | left | inline-start | inline-end | none"`: While the list is in the page: the side of the trigger it is on, after any flip; `none` when it lies over the trigger. Not said while it opens as a sheet.
|
|
998
|
+
- `data-list-empty`: Present when no item is shown for what was typed, once the list is in the page.
|
|
675
999
|
- `data-disabled`: Present when it is disabled.
|
|
1000
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1001
|
+
- `data-required`: Present when the form needs it.
|
|
1002
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
1003
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
1004
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
1005
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
1006
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
1007
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
676
1008
|
- trigger: A button that opens and closes the list. With the input inside the popup it is the combobox: a stop for Tab, and what the popup is placed against.
|
|
677
1009
|
- `data-popup-open`: Present when the list is open.
|
|
1010
|
+
- `data-pressed`: Present while its popup is open: it stays pressed, as a button held down.
|
|
1011
|
+
- `data-popup-side="top | right | bottom | left | inline-start | inline-end | none"`: While the list is in the page: the side of the trigger it is on, after any flip; `none` when it lies over the trigger. Not said while it opens as a sheet.
|
|
1012
|
+
- `data-list-empty`: Present when no item is shown for what was typed, once the list is in the page.
|
|
678
1013
|
- `data-disabled`: Present when it is disabled.
|
|
679
|
-
-
|
|
1014
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1015
|
+
- `data-required`: Present when the form needs it.
|
|
1016
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
1017
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
1018
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
1019
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
1020
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
1021
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
1022
|
+
- backdrop: The layer over the page behind the list: a press on it closes the list.
|
|
1023
|
+
- `data-open`: Present when it is open.
|
|
1024
|
+
- `data-closed`: Present when it is closed.
|
|
1025
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1026
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1027
|
+
- `data-presentation="popup | sheet"`: How the list opened: placed against its trigger, or as a sheet from the bottom edge.
|
|
1028
|
+
- `data-swiping`: Present while the sheet is dragged.
|
|
1029
|
+
- `data-swipe-dismiss`: Present once a drag has closed it.
|
|
1030
|
+
- `--drawer-swipe-movement-x`: As a sheet: how far it has been dragged across, always 0px.
|
|
1031
|
+
- `--drawer-swipe-movement-y`: As a sheet: how far it has been dragged down.
|
|
1032
|
+
- `--drawer-swipe-progress`: As a sheet: how far it has been dragged, of its own height: 0 to 1.
|
|
1033
|
+
- positioner: Places the list against the input: against the chips' box when the input is in one, the button when the input is inside the popup, or its own `anchor`. It carries the geometry. As a sheet it is not placed, and carries none.
|
|
680
1034
|
- `data-open`: Present when it is open.
|
|
681
1035
|
- `data-closed`: Present when it is closed.
|
|
682
1036
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
683
1037
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1038
|
+
- `data-presentation="popup | sheet"`: How the list opened: placed against its trigger, or as a sheet from the bottom edge.
|
|
1039
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
1040
|
+
- `data-empty`: Present when no item is shown for what was typed.
|
|
684
1041
|
- `--anchor-width`: The anchor's width.
|
|
685
1042
|
- `--anchor-height`: The anchor's height.
|
|
686
1043
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
687
1044
|
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
688
1045
|
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
689
|
-
- popup: The list of items. With a `list` inside, what holds it: a dialog around an input and the list.
|
|
1046
|
+
- popup: The list of items. With a `list` inside, what holds it: a dialog around an input and the list. As a sheet, a design moves it by what it says of the drag, and gives it `touch-action: none` where a finger drags it.
|
|
690
1047
|
- `data-open`: Present when it is open.
|
|
691
1048
|
- `data-closed`: Present when it is closed.
|
|
692
1049
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
693
1050
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
694
1051
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
695
1052
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1053
|
+
- `data-presentation="popup | sheet"`: How the list opened: placed against its trigger, or as a sheet from the bottom edge.
|
|
1054
|
+
- `data-swiping`: Present while the sheet is dragged.
|
|
1055
|
+
- `data-swipe-dismiss`: Present once a drag has closed it.
|
|
1056
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
696
1057
|
- `data-empty`: Present when no item is shown for what was typed.
|
|
1058
|
+
- `--drawer-swipe-movement-x`: As a sheet: how far it has been dragged across, always 0px.
|
|
1059
|
+
- `--drawer-swipe-movement-y`: As a sheet: how far it has been dragged down.
|
|
1060
|
+
- `--drawer-swipe-progress`: As a sheet: how far it has been dragged, of its own height: 0 to 1.
|
|
1061
|
+
- `--drawer-swipe-strength`: As a sheet, once let go: 0.1 to 1, the share of the design's own time it should take to come to rest.
|
|
697
1062
|
- list: The items' own box inside the popup, when the popup holds more than items (an input): it is then the listbox.
|
|
698
1063
|
- `data-empty`: Present when no item is shown for what was typed.
|
|
699
1064
|
- item: One choice in the list.
|
|
700
1065
|
- `data-selected`: Present on the chosen item.
|
|
701
1066
|
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
702
1067
|
- `data-disabled`: Present when it is disabled.
|
|
703
|
-
- clear: A button that empties the input and the value.
|
|
1068
|
+
- clear: A button that empties the input and the value. It is in the page while there is something to clear (the text, for an autocomplete; else what is chosen), and through its exit; `keepMounted` keeps it there.
|
|
1069
|
+
- `data-disabled`: Present when it is disabled.
|
|
1070
|
+
- `data-popup-open`: Present when the list is open.
|
|
1071
|
+
- `data-visible`: Present while there is something to clear.
|
|
1072
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1073
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1074
|
+
- chip: One chosen value. The arrows reach it from the start of the input, and Backspace or Delete on it takes it away.
|
|
704
1075
|
- `data-disabled`: Present when it is disabled.
|
|
705
1076
|
- chipRemove: A chip's button that takes its value away.
|
|
706
1077
|
- `data-disabled`: Present when it is disabled.
|
|
@@ -711,13 +1082,14 @@ Attributes and CSS variables, by part:
|
|
|
711
1082
|
import "@kirana-ui/web/command"
|
|
712
1083
|
```
|
|
713
1084
|
|
|
714
|
-
`<kui-command>`: `<kui-command>` around `kui-part="root"`, an `input` and a `list` of `item`s (`kui-value`, `kui-disabled`, `kui-label`, `kui-keywords` with commas between, `kui-id`), in `group`s with a `group-heading` and `separator`s (`kui-always-render`) if it has them, and an `empty` part drawn while nothing matches. What is typed filters the list; Enter or a press runs an item. `input-value`, `default-input-value`, `loop`, `disabled`; `filter` as a property; it tells `input-value-change` and `select`.
|
|
1085
|
+
`<kui-command>`: `<kui-command>` around `kui-part="root"`, an `input` and a `list` of `item`s (`kui-value`, its `kui-label` or its text when left out, `kui-disabled`, `kui-label`, `kui-keywords` with commas between, `kui-id`), in `group`s with a `group-heading` and `separator`s (`kui-always-render`) if it has them, and an `empty` part drawn while nothing matches. What is typed filters the list; Enter or a press runs an item. `input-value`, `default-input-value`, `loop`, `auto-highlight` (on unless `="false"`), `disabled`; `filter` as a property; it tells `input-value-change` and `select`.
|
|
715
1086
|
|
|
716
1087
|
Attributes of the element (each also a property, in camel case):
|
|
717
1088
|
|
|
718
1089
|
- `input-value` (string): What the input says.
|
|
719
1090
|
- `default-input-value` (string): The text the input starts with, when the caller does not hold `inputValue`. Read once.
|
|
720
1091
|
- `loop` (boolean): Whether a step past an end of the list goes round to the other.
|
|
1092
|
+
- `auto-highlight` (boolean): Whether the first item shown is highlighted from the start and again whenever the text changes, so Enter does it with no arrow key first, as a command palette is used. Default: `true`. With `false`, nothing is highlighted until the input has focus or an arrow or the pointer moves to an item.
|
|
721
1093
|
- `disabled` (boolean): Disabled: nothing can be typed or chosen.
|
|
722
1094
|
|
|
723
1095
|
Properties only:
|
|
@@ -780,17 +1152,17 @@ Events:
|
|
|
780
1152
|
|
|
781
1153
|
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
782
1154
|
|
|
783
|
-
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-collision-padding`, `kui-side`, `kui-side-offset`
|
|
1155
|
+
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-arrow-padding`, `kui-collision-boundary`, `kui-collision-padding`, `kui-position-method`, `kui-side`, `kui-side-offset`, `kui-sticky`
|
|
784
1156
|
- `popup`
|
|
785
1157
|
- `arrow`
|
|
786
1158
|
- `separator`
|
|
787
|
-
- `item`: `kui-close-on-click`, `kui-disabled`, `kui-label`
|
|
1159
|
+
- `item`: `kui-close-on-click`, `kui-close-on-select`, `kui-disabled`, `kui-label`
|
|
788
1160
|
- `group`: `kui-id`
|
|
789
1161
|
- `group-label`
|
|
790
1162
|
- `checkbox-item`
|
|
791
1163
|
- `checkbox-item-indicator`
|
|
792
1164
|
- `radio-group`
|
|
793
|
-
- `radio-item`: `kui-close-on-click`, `kui-disabled`, `kui-label`, `kui-value`
|
|
1165
|
+
- `radio-item`: `kui-close-on-click`, `kui-close-on-select`, `kui-disabled`, `kui-label`, `kui-value`
|
|
794
1166
|
- `radio-item-indicator`: `kui-value`
|
|
795
1167
|
- `trigger`
|
|
796
1168
|
|
|
@@ -821,16 +1193,20 @@ Attributes and CSS variables, by part:
|
|
|
821
1193
|
|
|
822
1194
|
- trigger: The area a secondary press, or a long press on a touch screen, opens the menu in.
|
|
823
1195
|
- `data-popup-open`: Present when the menu is open.
|
|
1196
|
+
- `data-pressed`: Present while its popup is open: it stays pressed, as a button held down.
|
|
824
1197
|
- positioner: Places the menu against its trigger. It carries the geometry.
|
|
825
1198
|
- `data-open`: Present when it is open.
|
|
826
1199
|
- `data-closed`: Present when it is closed.
|
|
827
1200
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
828
1201
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1202
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
829
1203
|
- `--anchor-width`: The anchor's width.
|
|
830
1204
|
- `--anchor-height`: The anchor's height.
|
|
831
1205
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
832
1206
|
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
833
1207
|
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
1208
|
+
- `--positioner-width`: The popup's width, as its content lays it out: a design gives the positioner `width: var(--positioner-width)` to animate a change of size.
|
|
1209
|
+
- `--positioner-height`: The popup's height, as its content lays it out: a design gives the positioner `height: var(--positioner-height)` to animate a change of size.
|
|
834
1210
|
- popup: The menu itself: the list of items.
|
|
835
1211
|
- `data-open`: Present when it is open.
|
|
836
1212
|
- `data-closed`: Present when it is closed.
|
|
@@ -838,7 +1214,10 @@ Attributes and CSS variables, by part:
|
|
|
838
1214
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
839
1215
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
840
1216
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1217
|
+
- `data-instant="click | dismiss | group"`: Present when it opened or closed in a way that should skip the motion: `click` when the keyboard pressed its trigger or an item, `dismiss` when Escape closed it, `group` when focus or the pointer went from one menu of a bar to another.
|
|
841
1218
|
- arrow: An element that points at the trigger.
|
|
1219
|
+
- `data-open`: Present when it is open.
|
|
1220
|
+
- `data-closed`: Present when it is closed.
|
|
842
1221
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
843
1222
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
844
1223
|
- `data-uncentered`: Present when the arrow cannot sit at the trigger's centre.
|
|
@@ -877,7 +1256,7 @@ Attributes and CSS variables, by part:
|
|
|
877
1256
|
import "@kirana-ui/web/date-field"
|
|
878
1257
|
```
|
|
879
1258
|
|
|
880
|
-
`<kui-date-field>`: `<kui-date-field>` around `kui-part="root"`, which holds a `<template kui-each="segments">` with the `segment` each part of the date is typed in (`{type}` and `{index}` say which), and the hidden `input` a form reads. `value`, `default-value`, `locale`, `min`, `max`, `disabled`, `read-only`, `required`, `name`, `form`; `placeholders` as
|
|
1259
|
+
`<kui-date-field>`: `<kui-date-field>` around `kui-part="root"`, which holds a `<template kui-each="segments">` with the `segment` each part of the date is typed in (`{type}` and `{index}` say which), and the hidden `input` a form reads. `value`, `default-value`, `locale`, `min`, `max`, `disabled`, `read-only`, `required`, `name`, `form`; `placeholders` and `calendarSystem` (an instance from `@internationalized/date`) as properties; it tells `value-change`.
|
|
881
1260
|
|
|
882
1261
|
Attributes of the element (each also a property, in camel case):
|
|
883
1262
|
|
|
@@ -894,7 +1273,8 @@ Attributes of the element (each also a property, in camel case):
|
|
|
894
1273
|
|
|
895
1274
|
Properties only:
|
|
896
1275
|
|
|
897
|
-
- `placeholders`: What an empty part shows. Default: `dd`, `mm`, `yyyy`.
|
|
1276
|
+
- `placeholders`: What an empty part shows. Default: `dd`, `mm`, `yyyy`, `era`.
|
|
1277
|
+
- `calendarSystem`: The calendar its parts are typed in, when it is not the Gregorian one: an instance from `@internationalized/date` (`new PersianCalendar()`), as a calendar takes it. Its days, months, years and eras are the parts' ranges; the value is still an ISO day. In a calendar with several eras (Japanese, Minguo, Ethiopic), the era is a part of its own.
|
|
898
1278
|
|
|
899
1279
|
Events:
|
|
900
1280
|
|
|
@@ -925,7 +1305,7 @@ Attributes and CSS variables, by part:
|
|
|
925
1305
|
- `data-readonly`: Present when its value cannot be changed.
|
|
926
1306
|
- `data-invalid`: Present when the date is outside what it takes, or is asked for and half typed.
|
|
927
1307
|
- segment: One piece of the date: a part that is typed, or what stands between two.
|
|
928
|
-
- `data-segment="day | month | year | literal"`: Which piece it is.
|
|
1308
|
+
- `data-segment="era | day | month | year | literal"`: Which piece it is: the era only in a calendar of several eras.
|
|
929
1309
|
- `data-placeholder`: Present on a part that is empty.
|
|
930
1310
|
- `data-disabled`: Present when it is disabled.
|
|
931
1311
|
- `data-invalid`: Present when the date is outside what it takes, or is asked for and half typed.
|
|
@@ -936,22 +1316,27 @@ Attributes and CSS variables, by part:
|
|
|
936
1316
|
import "@kirana-ui/web/date-picker"
|
|
937
1317
|
```
|
|
938
1318
|
|
|
939
|
-
`<kui-date-picker>`: `<kui-date-picker>`: a date field and a calendar in a popover that are one value. A `kui-part="field"` with a date field's `segments` template and `input
|
|
1319
|
+
`<kui-date-picker>`: `<kui-date-picker>`: a date field and a calendar in a popover that are one value. A `kui-part="field"` with a date field's `segments` template and `input` (with `mode="range"`, two: `kui-range="start"` and `kui-range="end"`); a `trigger` button; a `clear` button and `preset` buttons (`kui-value`: a day, or a range's first and last with a comma between); and a `portal` with a `positioner` around the `popup`, which holds the `calendar` with a calendar's parts and templates. `value` (a range as a preset's), `default-value`, `mode`, `open`, `default-open`, `locale`, `min`, `max`, `calendar-system`, `fixed-weeks`, `months` (each drawn in a `<template kui-each="months">`), `paged-navigation`, `month`, `default-month`, `disabled`, `read-only`, `required`, `name`, `form`; `isDateUnavailable` and `placeholders` as properties; it tells `value-change`, `open-change` and `month-change`.
|
|
940
1320
|
|
|
941
1321
|
Attributes of the element (each also a property, in camel case):
|
|
942
1322
|
|
|
943
|
-
- `value` (string): The day, typed or picked; `null` for none.
|
|
1323
|
+
- `value` (string): The day, typed or picked; with `mode: "range"` a first and a last day, each typed in its own field or both picked in the one calendar. `null` for none.
|
|
944
1324
|
- `default-value` (string): The value it starts with, when the caller does not hold `value`. Read once.
|
|
1325
|
+
- `mode` (string): One day (the default), or a first and a last (`"range"`): two fields, `DatePicker.Field` with `range="start"` and `range="end"`, and the calendar in range mode, which stays open until the range is whole. Read once.
|
|
945
1326
|
- `open` (boolean): Whether the calendar is open, when the caller holds it.
|
|
946
1327
|
- `default-open` (boolean): Whether the calendar starts open, when the caller does not hold `open`. Read once.
|
|
947
1328
|
- `locale` (string): The language and region of the field and the calendar. Give it: a server does not know.
|
|
948
1329
|
- `min` (string): The first and the last day that can be typed or picked.
|
|
949
1330
|
- `max` (string): The last day that can be typed or picked.
|
|
950
|
-
- `calendar-system` (string): The calendar its months are laid out in, when it is not the Gregorian one.
|
|
1331
|
+
- `calendar-system` (string): The calendar its months are laid out in and its field typed in, when it is not the Gregorian one. The value is an ISO day whatever it is.
|
|
951
1332
|
- `fixed-weeks` (boolean): Always six rows of days.
|
|
1333
|
+
- `months` (number): How many months the calendar shows side by side (1 by default).
|
|
1334
|
+
- `paged-navigation` (boolean): With several `months`: whether Previous and Next turn them all rather than one month.
|
|
1335
|
+
- `month` (string): The month the calendar shows (the first, with several), when the caller holds it.
|
|
1336
|
+
- `default-month` (string): The month the calendar starts on, when the caller does not hold `month`. Read once.
|
|
952
1337
|
- `disabled` (boolean): Disabled: it cannot be changed.
|
|
953
1338
|
- `read-only` (boolean): Shown as it is, focusable, not changeable.
|
|
954
|
-
- `required` (boolean): Needed: in a `Field`, leaving it empty is then invalid.
|
|
1339
|
+
- `required` (boolean): Needed: in a `Field`, leaving it empty is then invalid, and the day picked, pressed again in the calendar, stays picked. Without it, that press empties the field and closes the calendar.
|
|
955
1340
|
- `name` (string): The name it is submitted under.
|
|
956
1341
|
- `form` (string): The id of the form it belongs to, when it is not inside it.
|
|
957
1342
|
|
|
@@ -964,14 +1349,15 @@ Events:
|
|
|
964
1349
|
|
|
965
1350
|
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
966
1351
|
- `open-change`: `event.detail.open`, with `event.detail.details`. `preventDefault()` keeps `open` as it was.
|
|
1352
|
+
- `month-change`: `event.detail.month`, with `event.detail.details`. `preventDefault()` keeps `month` as it was.
|
|
967
1353
|
|
|
968
1354
|
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
969
1355
|
|
|
970
|
-
- `field`
|
|
1356
|
+
- `field`: `kui-range`
|
|
971
1357
|
- `segment`
|
|
972
1358
|
- `input`
|
|
973
1359
|
- `trigger`
|
|
974
|
-
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-collision-padding`, `kui-side`, `kui-side-offset`
|
|
1360
|
+
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-arrow-padding`, `kui-collision-boundary`, `kui-collision-padding`, `kui-position-method`, `kui-side`, `kui-side-offset`, `kui-sticky`
|
|
975
1361
|
- `popup`
|
|
976
1362
|
- `calendar`
|
|
977
1363
|
- `heading`
|
|
@@ -981,14 +1367,16 @@ Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
|
981
1367
|
- `head-cell`
|
|
982
1368
|
- `cell`
|
|
983
1369
|
- `day`
|
|
1370
|
+
- `clear`
|
|
1371
|
+
- `preset`: `kui-value`
|
|
984
1372
|
|
|
985
|
-
Lists (`<template kui-each="…">`): `segments`, `weekdays`, `weeks`, `days`.
|
|
1373
|
+
Lists (`<template kui-each="…">`): `segments`, `weekdays`, `months`, `weeks`, `days`.
|
|
986
1374
|
|
|
987
1375
|
Anatomy:
|
|
988
1376
|
|
|
989
1377
|
```
|
|
990
1378
|
<kui-date-picker>
|
|
991
|
-
field
|
|
1379
|
+
field (repeated)
|
|
992
1380
|
<template kui-each="segments">
|
|
993
1381
|
segment (repeated)
|
|
994
1382
|
input
|
|
@@ -997,41 +1385,48 @@ Anatomy:
|
|
|
997
1385
|
positioner
|
|
998
1386
|
popup
|
|
999
1387
|
calendar
|
|
1000
|
-
|
|
1388
|
+
<template kui-each="months"> (optional)
|
|
1389
|
+
heading
|
|
1390
|
+
grid
|
|
1391
|
+
<template kui-each="weekdays">
|
|
1392
|
+
head-cell (repeated)
|
|
1393
|
+
<template kui-each="weeks">
|
|
1394
|
+
<template kui-each="days">
|
|
1395
|
+
cell (repeated)
|
|
1396
|
+
day
|
|
1001
1397
|
previous
|
|
1002
1398
|
next
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
head-cell (repeated)
|
|
1006
|
-
<template kui-each="weeks">
|
|
1007
|
-
<template kui-each="days">
|
|
1008
|
-
cell (repeated)
|
|
1009
|
-
day
|
|
1399
|
+
clear (optional)
|
|
1400
|
+
preset (optional, repeated)
|
|
1010
1401
|
```
|
|
1011
1402
|
|
|
1012
1403
|
Attributes and CSS variables, by part:
|
|
1013
1404
|
|
|
1014
|
-
- field: The field
|
|
1405
|
+
- field: The field a day is typed in: with `mode: "range"`, one for the first day (`range="start"`) and one for the last (`range="end"`).
|
|
1015
1406
|
- `data-disabled`: Present when it is disabled.
|
|
1016
1407
|
- `data-readonly`: Present when its value cannot be changed.
|
|
1017
1408
|
- `data-invalid`: Present when the date is outside what it takes, or is asked for and half typed.
|
|
1018
1409
|
- segment: One piece of the date: a part that is typed, or what stands between two.
|
|
1019
|
-
- `data-segment="day | month | year | literal"`: Which piece it is.
|
|
1410
|
+
- `data-segment="era | day | month | year | literal"`: Which piece it is: the era only in a calendar of several eras.
|
|
1020
1411
|
- `data-placeholder`: Present on a part that is empty.
|
|
1021
1412
|
- `data-disabled`: Present when it is disabled.
|
|
1022
1413
|
- `data-invalid`: Present when the date is outside what it takes, or is asked for and half typed.
|
|
1023
1414
|
- trigger: The button that opens the popover, and what it is placed against.
|
|
1024
1415
|
- `data-popup-open`: Present when the popover is open.
|
|
1416
|
+
- `data-pressed`: Present while the popover a press on this trigger opened is open: it stays pressed, as a button held down.
|
|
1025
1417
|
- positioner: Places the popup against the trigger. It carries the geometry.
|
|
1026
1418
|
- `data-open`: Present when it is open.
|
|
1027
1419
|
- `data-closed`: Present when it is closed.
|
|
1028
1420
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
1029
1421
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1422
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
1030
1423
|
- `--anchor-width`: The anchor's width.
|
|
1031
1424
|
- `--anchor-height`: The anchor's height.
|
|
1032
1425
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
1033
1426
|
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
1034
1427
|
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
1428
|
+
- `--positioner-width`: The popup's width, as its content lays it out: a design gives the positioner `width: var(--positioner-width)` to animate a change of size.
|
|
1429
|
+
- `--positioner-height`: The popup's height, as its content lays it out: a design gives the positioner `height: var(--positioner-height)` to animate a change of size.
|
|
1035
1430
|
- popup: The popover itself.
|
|
1036
1431
|
- `data-open`: Present when it is open.
|
|
1037
1432
|
- `data-closed`: Present when it is closed.
|
|
@@ -1039,6 +1434,9 @@ Attributes and CSS variables, by part:
|
|
|
1039
1434
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1040
1435
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
1041
1436
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1437
|
+
- `data-instant="click | dismiss"`: Present when it opened or closed in a way that should skip the motion: `click` when the keyboard pressed the trigger, `dismiss` when Escape closed it.
|
|
1438
|
+
- `--popup-width`: Its width: `auto`, and while its content changes size, the old width and then the new one, for a transition between them.
|
|
1439
|
+
- `--popup-height`: Its height: `auto`, and while its content changes size, the old height and then the new one, for a transition between them.
|
|
1042
1440
|
- calendar: The calendar.
|
|
1043
1441
|
- `data-disabled`: Present when it is disabled.
|
|
1044
1442
|
- `data-readonly`: Present when its value cannot be changed.
|
|
@@ -1047,21 +1445,26 @@ Attributes and CSS variables, by part:
|
|
|
1047
1445
|
- next: Shows the month after.
|
|
1048
1446
|
- `data-disabled`: Present when it is disabled.
|
|
1049
1447
|
- cell: A day's cell.
|
|
1050
|
-
- `data-selected`: Present on a chosen day,
|
|
1448
|
+
- `data-selected`: Present on a chosen day, on every day of a chosen range, and on each day of a list. Also on a copy of one (a day of the month before or after, shown in its own month too), which is drawn as the day is but has no aria-selected.
|
|
1051
1449
|
- `data-today`: Present on today.
|
|
1052
1450
|
- `data-outside-month`: Present on the days of the month before and after that fill the first and last weeks.
|
|
1053
1451
|
- `data-disabled`: Present when it is disabled.
|
|
1054
1452
|
- `data-unavailable`: Present on a day that cannot be chosen.
|
|
1055
|
-
- `data-range-start`: Present on the first day of a range.
|
|
1056
|
-
- `data-range-end`: Present on the last day of a range.
|
|
1453
|
+
- `data-range-start`: Present on the first day of a range, and on a copy of it.
|
|
1454
|
+
- `data-range-end`: Present on the last day of a range, and on a copy of it.
|
|
1057
1455
|
- day: The button for a day.
|
|
1058
|
-
- `data-selected`: Present on a chosen day,
|
|
1456
|
+
- `data-selected`: Present on a chosen day, on every day of a chosen range, and on each day of a list. Also on a copy of one (a day of the month before or after, shown in its own month too), which is drawn as the day is but has no aria-selected.
|
|
1059
1457
|
- `data-today`: Present on today.
|
|
1060
1458
|
- `data-outside-month`: Present on the days of the month before and after that fill the first and last weeks.
|
|
1061
1459
|
- `data-disabled`: Present when it is disabled.
|
|
1062
1460
|
- `data-unavailable`: Present on a day that cannot be chosen.
|
|
1063
|
-
- `data-range-start`: Present on the first day of a range.
|
|
1064
|
-
- `data-range-end`: Present on the last day of a range.
|
|
1461
|
+
- `data-range-start`: Present on the first day of a range, and on a copy of it.
|
|
1462
|
+
- `data-range-end`: Present on the last day of a range, and on a copy of it.
|
|
1463
|
+
- clear: Empties the value, and gives focus to the field. Disabled while there is none.
|
|
1464
|
+
- `data-disabled`: Present when it is disabled.
|
|
1465
|
+
- preset: Makes the value the day, or the range, it is given. Pressed while the value is that.
|
|
1466
|
+
- `data-pressed`: Present while the value is the one it gives.
|
|
1467
|
+
- `data-disabled`: Present when it is disabled.
|
|
1065
1468
|
|
|
1066
1469
|
### Dialog
|
|
1067
1470
|
|
|
@@ -1069,13 +1472,15 @@ Attributes and CSS variables, by part:
|
|
|
1069
1472
|
import "@kirana-ui/web/dialog"
|
|
1070
1473
|
```
|
|
1071
1474
|
|
|
1072
|
-
`<kui-dialog>`: `<kui-dialog>` around a `kui-part="trigger"` button and a `portal`, which is drawn at the end of the page while the dialog is open and holds its `backdrop` and its `popup`, with a `title`, a `description` and a `close` button. `open`, `default-open`, `modal`, `dismissible
|
|
1475
|
+
`<kui-dialog>`: `<kui-dialog>` around a `kui-part="trigger"` button and a `portal`, which is drawn at the end of the page while the dialog is open and holds its `backdrop` and its `popup`, with a `title`, a `description` and a `close` button. The trigger and the close take `kui-disabled`. A long dialog's popup is in a `viewport`, which scrolls. `open`, `default-open`, `modal`, `disable-pointer-dismissal` (`close-on-outside-press` and `dismissible`, the other way round, its old names, still read); it tells `open-change`.
|
|
1073
1476
|
|
|
1074
1477
|
Attributes of the element (each also a property, in camel case):
|
|
1075
1478
|
|
|
1076
1479
|
- `open` (boolean): Whether it is open, when the caller holds it.
|
|
1077
1480
|
- `default-open` (boolean): Whether it starts open, when the caller does not hold `open`. Read once.
|
|
1078
1481
|
- `modal` (boolean): Blocks the page behind it and traps focus. Default `true`.
|
|
1482
|
+
- `disable-pointer-dismissal` (boolean): Keeps it open when the pointer presses outside it. Default `false`. Escape always closes it: a caller who must keep it open cancels the change whose `details.reason` is `"escape-key"`.
|
|
1483
|
+
- `close-on-outside-press` (boolean): Whether a press outside closes it. Default `true`.
|
|
1079
1484
|
- `dismissible` (boolean): Whether a press outside closes it. Default `true`.
|
|
1080
1485
|
|
|
1081
1486
|
Events:
|
|
@@ -1086,6 +1491,7 @@ Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
|
1086
1491
|
|
|
1087
1492
|
- `trigger`
|
|
1088
1493
|
- `backdrop`
|
|
1494
|
+
- `viewport`
|
|
1089
1495
|
- `popup`
|
|
1090
1496
|
- `title`
|
|
1091
1497
|
- `description`
|
|
@@ -1098,28 +1504,40 @@ Anatomy:
|
|
|
1098
1504
|
trigger
|
|
1099
1505
|
portal
|
|
1100
1506
|
backdrop
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1507
|
+
viewport (optional)
|
|
1508
|
+
popup
|
|
1509
|
+
title
|
|
1510
|
+
description
|
|
1511
|
+
close
|
|
1105
1512
|
```
|
|
1106
1513
|
|
|
1107
1514
|
Attributes and CSS variables, by part:
|
|
1108
1515
|
|
|
1109
1516
|
- trigger: The button that opens the dialog.
|
|
1110
1517
|
- `data-popup-open`: Present when the dialog is open.
|
|
1518
|
+
- `data-disabled`: Present when it is disabled.
|
|
1111
1519
|
- backdrop: The layer over the page behind the dialog.
|
|
1112
1520
|
- `data-open`: Present when it is open.
|
|
1113
1521
|
- `data-closed`: Present when it is closed.
|
|
1114
1522
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1115
1523
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1524
|
+
- viewport: What a long dialog scrolls in: it lies over the page, between the backdrop and the popup. A press on it beside the popup is a press outside the dialog; a press on its scrollbar is not.
|
|
1525
|
+
- `data-open`: Present when it is open.
|
|
1526
|
+
- `data-closed`: Present when it is closed.
|
|
1527
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1528
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1529
|
+
- `data-nested`: Present when the dialog opened over another dialog.
|
|
1530
|
+
- `data-nested-dialog-open`: Present when another dialog is open above this one.
|
|
1116
1531
|
- popup: The dialog itself.
|
|
1117
1532
|
- `data-open`: Present when it is open.
|
|
1118
1533
|
- `data-closed`: Present when it is closed.
|
|
1119
1534
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1120
1535
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1536
|
+
- `data-nested`: Present when the dialog opened over another dialog.
|
|
1121
1537
|
- `data-nested-dialog-open`: Present when another dialog is open above this one.
|
|
1122
1538
|
- `--nested-dialogs`: How many dialogs are open above this one.
|
|
1539
|
+
- close: A button that closes the dialog.
|
|
1540
|
+
- `data-disabled`: Present when it is disabled.
|
|
1123
1541
|
|
|
1124
1542
|
### Drawer
|
|
1125
1543
|
|
|
@@ -1127,13 +1545,15 @@ Attributes and CSS variables, by part:
|
|
|
1127
1545
|
import "@kirana-ui/web/drawer"
|
|
1128
1546
|
```
|
|
1129
1547
|
|
|
1130
|
-
`<kui-drawer>`: `<kui-drawer>`: a dialog that comes from an edge and is dragged back to it, with the dialog's parts. `open`, `default-open`, `modal`, `dismissible`, `swipe-direction`, `snap-points` (with commas between: `0.4,1` or `200px,1`), `snap-point`, `default-snap-point`; it tells `open-change` and `snap-point-change`.
|
|
1548
|
+
`<kui-drawer>`: `<kui-drawer>`: a dialog that comes from an edge and is dragged back to it, with the dialog's parts. `open`, `default-open`, `modal`, `disable-pointer-dismissal` (`close-on-outside-press` and `dismissible`, the other way round, its old names, still read), `swipe-direction`, `snap-points` (with commas between: `0.4,1` or `200px,1`), `snap-point`, `default-snap-point`; it tells `open-change` and `snap-point-change`.
|
|
1131
1549
|
|
|
1132
1550
|
Attributes of the element (each also a property, in camel case):
|
|
1133
1551
|
|
|
1134
1552
|
- `open` (boolean): Whether it is open, when the caller holds it.
|
|
1135
1553
|
- `default-open` (boolean): Whether it starts open, when the caller does not hold `open`. Read once.
|
|
1136
1554
|
- `modal` (boolean): Blocks the page behind it and traps focus. Default `true`.
|
|
1555
|
+
- `disable-pointer-dismissal` (boolean): Keeps it open when the pointer presses outside it. Default `false`. Escape always closes it: a caller who must keep it open cancels the change whose `details.reason` is `"escape-key"`.
|
|
1556
|
+
- `close-on-outside-press` (boolean): Whether a press outside closes it. Default `true`.
|
|
1137
1557
|
- `dismissible` (boolean): Whether a press outside closes it. Default `true`.
|
|
1138
1558
|
- `swipe-direction` (string): The way it is dragged to close it: the edge it came from. Default: `"down"`.
|
|
1139
1559
|
- `snap-points` (string): Places it rests at, each how much of itself shows: a share (`0.4`, or `"40%"`) or a length (`"148px"`, `"20rem"`). `[0.4, 1]` is a drawer that opens two fifths shown and is dragged up to the whole. Without any, it is whole.
|
|
@@ -1171,21 +1591,26 @@ Attributes and CSS variables, by part:
|
|
|
1171
1591
|
|
|
1172
1592
|
- trigger: The button that opens the dialog.
|
|
1173
1593
|
- `data-popup-open`: Present when the dialog is open.
|
|
1594
|
+
- `data-disabled`: Present when it is disabled.
|
|
1174
1595
|
- backdrop: The layer over the page behind the dialog.
|
|
1175
1596
|
- `data-open`: Present when it is open.
|
|
1176
1597
|
- `data-closed`: Present when it is closed.
|
|
1177
1598
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1178
1599
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1179
1600
|
- `data-swiping`: Present while the drawer is dragged.
|
|
1601
|
+
- `data-swipe-dismiss`: Present once a drag has closed the drawer.
|
|
1180
1602
|
- `--drawer-swipe-movement-x`: How far it has been dragged across.
|
|
1181
1603
|
- `--drawer-swipe-movement-y`: How far it has been dragged up or down.
|
|
1182
1604
|
- `--drawer-swipe-progress`: How far it has been dragged, of its own size: 0 to 1.
|
|
1183
1605
|
- `--drawer-snap-point-offset`: How far from whole it rests, towards the edge it closes at: 0px at its largest snap point.
|
|
1606
|
+
- `--drawer-swipe-strength`: Always 1: the backdrop takes the design's own time to leave, however the drawer was thrown.
|
|
1607
|
+
- `--drawer-height`: While the drawer is dragged: the height of the drawer in front.
|
|
1184
1608
|
- popup: The drawer. A design moves it by what it says of the drag, and gives it `touch-action: none` where a finger drags it.
|
|
1185
1609
|
- `data-open`: Present when it is open.
|
|
1186
1610
|
- `data-closed`: Present when it is closed.
|
|
1187
1611
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1188
1612
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1613
|
+
- `data-nested`: Present when the dialog opened over another dialog.
|
|
1189
1614
|
- `data-nested-dialog-open`: Present when another dialog is open above this one.
|
|
1190
1615
|
- `data-swiping`: Present while the drawer is dragged.
|
|
1191
1616
|
- `data-swipe-direction="up | down | left | right"`: The way it is dragged to close it.
|
|
@@ -1203,6 +1628,127 @@ Attributes and CSS variables, by part:
|
|
|
1203
1628
|
- `--drawer-frontmost-height`: The height of the drawer in front of every other, while this one is open.
|
|
1204
1629
|
- `--drawer-swipe-strength`: Once let go: 0.1 to 1, the share of the design's own time it should take to come to rest. A drawer thrown hard arrives sooner.
|
|
1205
1630
|
- `--drawer-width`: Its width.
|
|
1631
|
+
- close: A button that closes the dialog.
|
|
1632
|
+
- `data-disabled`: Present when it is disabled.
|
|
1633
|
+
|
|
1634
|
+
### Editable
|
|
1635
|
+
|
|
1636
|
+
```
|
|
1637
|
+
import "@kirana-ui/web/editable"
|
|
1638
|
+
```
|
|
1639
|
+
|
|
1640
|
+
`<kui-editable>`: `<kui-editable>` around `kui-part="root"`, a `preview`, which says the text (or the placeholder while there is none) unless the page gave it something to say, an `input` or a textarea, and `edit-trigger`, `submit-trigger` and `cancel-trigger` buttons. The input's id is the element's `kui-id`. `value`, `default-value`, `editing`, `default-editing`, `placeholder`, `activation`, `submit-on-blur`, `select-on-focus`, `disabled`, `read-only`, `required`, `name`, `form`; it tells `value-change` and `editing-change`. Inside a `<kui-field>` its input is the field's control.
|
|
1641
|
+
|
|
1642
|
+
Attributes of the element (each also a property, in camel case):
|
|
1643
|
+
|
|
1644
|
+
- `value` (string): The text it holds: what the preview shows, and what editing starts from.
|
|
1645
|
+
- `default-value` (string): The text it starts with, when the caller does not hold `value`. Read once.
|
|
1646
|
+
- `editing` (boolean): Whether it is being edited, when the caller holds it.
|
|
1647
|
+
- `default-editing` (boolean): Read once.
|
|
1648
|
+
- `placeholder` (string): What the preview shows while the text is empty.
|
|
1649
|
+
- `activation` (string): What on the preview starts an edit: focus reaching it (the default), a press, two presses, or nothing, where only the edit trigger does.
|
|
1650
|
+
- `submit-on-blur` (boolean): Whether focus leaving the input keeps the edit (the default) or drops it.
|
|
1651
|
+
- `select-on-focus` (boolean): Whether the text is selected as editing starts. Default `true`.
|
|
1652
|
+
- `disabled` (boolean): Disabled: it cannot be edited.
|
|
1653
|
+
- `read-only` (boolean): Shown as it is, not editable.
|
|
1654
|
+
- `required` (boolean): Needed: in a `Field`, leaving it empty is then invalid.
|
|
1655
|
+
- `name` (string): With a name, the text is submitted with the form around it; in a `Field`, the field's by default.
|
|
1656
|
+
- `form` (string): The id of the form the input belongs to, when it is not inside it.
|
|
1657
|
+
|
|
1658
|
+
Events:
|
|
1659
|
+
|
|
1660
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
1661
|
+
- `editing-change`: `event.detail.editing`, with `event.detail.details`. `preventDefault()` keeps `editing` as it was.
|
|
1662
|
+
|
|
1663
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1664
|
+
|
|
1665
|
+
- `root`
|
|
1666
|
+
- `preview`
|
|
1667
|
+
- `input`
|
|
1668
|
+
- `edit-trigger`
|
|
1669
|
+
- `submit-trigger`
|
|
1670
|
+
- `cancel-trigger`
|
|
1671
|
+
|
|
1672
|
+
Anatomy:
|
|
1673
|
+
|
|
1674
|
+
```
|
|
1675
|
+
<kui-editable>
|
|
1676
|
+
root
|
|
1677
|
+
preview
|
|
1678
|
+
input
|
|
1679
|
+
edit-trigger (optional)
|
|
1680
|
+
submit-trigger (optional)
|
|
1681
|
+
cancel-trigger (optional)
|
|
1682
|
+
```
|
|
1683
|
+
|
|
1684
|
+
Attributes and CSS variables, by part:
|
|
1685
|
+
|
|
1686
|
+
- root: A text edited in place.
|
|
1687
|
+
- `data-editing`: Present while it is being edited.
|
|
1688
|
+
- `data-disabled`: Present when it is disabled.
|
|
1689
|
+
- `data-readonly`: Present when it is shown and cannot be edited.
|
|
1690
|
+
- `data-placeholder`: Present while it holds no text.
|
|
1691
|
+
- `data-touched`: In a field: present once focus has left it.
|
|
1692
|
+
- `data-dirty`: In a field: present while the text is not the one it began with.
|
|
1693
|
+
- `data-filled`: In a field: present while it holds text.
|
|
1694
|
+
- `data-focused`: In a field: present while it has focus.
|
|
1695
|
+
- `data-valid`: In a field: present once the text was checked and found right.
|
|
1696
|
+
- `data-invalid`: In a field: present while the text is wrong.
|
|
1697
|
+
- preview: The text as it reads, or the placeholder while there is none: hidden while editing.
|
|
1698
|
+
- `data-editing`: Present while it is being edited.
|
|
1699
|
+
- `data-disabled`: Present when it is disabled.
|
|
1700
|
+
- `data-readonly`: Present when it is shown and cannot be edited.
|
|
1701
|
+
- `data-placeholder`: Present while it holds no text.
|
|
1702
|
+
- `data-touched`: In a field: present once focus has left it.
|
|
1703
|
+
- `data-dirty`: In a field: present while the text is not the one it began with.
|
|
1704
|
+
- `data-filled`: In a field: present while it holds text.
|
|
1705
|
+
- `data-focused`: In a field: present while it has focus.
|
|
1706
|
+
- `data-valid`: In a field: present once the text was checked and found right.
|
|
1707
|
+
- `data-invalid`: In a field: present while the text is wrong.
|
|
1708
|
+
- input: Where the text is typed, an `<input>` or a `<textarea>`: hidden unless editing.
|
|
1709
|
+
- `data-editing`: Present while it is being edited.
|
|
1710
|
+
- `data-disabled`: Present when it is disabled.
|
|
1711
|
+
- `data-readonly`: Present when it is shown and cannot be edited.
|
|
1712
|
+
- `data-placeholder`: Present while it holds no text.
|
|
1713
|
+
- `data-touched`: In a field: present once focus has left it.
|
|
1714
|
+
- `data-dirty`: In a field: present while the text is not the one it began with.
|
|
1715
|
+
- `data-filled`: In a field: present while it holds text.
|
|
1716
|
+
- `data-focused`: In a field: present while it has focus.
|
|
1717
|
+
- `data-valid`: In a field: present once the text was checked and found right.
|
|
1718
|
+
- `data-invalid`: In a field: present while the text is wrong.
|
|
1719
|
+
- editTrigger: Starts an edit: hidden while editing.
|
|
1720
|
+
- `data-editing`: Present while it is being edited.
|
|
1721
|
+
- `data-disabled`: Present when it is disabled.
|
|
1722
|
+
- `data-readonly`: Present when it is shown and cannot be edited.
|
|
1723
|
+
- `data-placeholder`: Present while it holds no text.
|
|
1724
|
+
- `data-touched`: In a field: present once focus has left it.
|
|
1725
|
+
- `data-dirty`: In a field: present while the text is not the one it began with.
|
|
1726
|
+
- `data-filled`: In a field: present while it holds text.
|
|
1727
|
+
- `data-focused`: In a field: present while it has focus.
|
|
1728
|
+
- `data-valid`: In a field: present once the text was checked and found right.
|
|
1729
|
+
- `data-invalid`: In a field: present while the text is wrong.
|
|
1730
|
+
- submitTrigger: Keeps what was typed: hidden unless editing.
|
|
1731
|
+
- `data-editing`: Present while it is being edited.
|
|
1732
|
+
- `data-disabled`: Present when it is disabled.
|
|
1733
|
+
- `data-readonly`: Present when it is shown and cannot be edited.
|
|
1734
|
+
- `data-placeholder`: Present while it holds no text.
|
|
1735
|
+
- `data-touched`: In a field: present once focus has left it.
|
|
1736
|
+
- `data-dirty`: In a field: present while the text is not the one it began with.
|
|
1737
|
+
- `data-filled`: In a field: present while it holds text.
|
|
1738
|
+
- `data-focused`: In a field: present while it has focus.
|
|
1739
|
+
- `data-valid`: In a field: present once the text was checked and found right.
|
|
1740
|
+
- `data-invalid`: In a field: present while the text is wrong.
|
|
1741
|
+
- cancelTrigger: Drops what was typed: hidden unless editing.
|
|
1742
|
+
- `data-editing`: Present while it is being edited.
|
|
1743
|
+
- `data-disabled`: Present when it is disabled.
|
|
1744
|
+
- `data-readonly`: Present when it is shown and cannot be edited.
|
|
1745
|
+
- `data-placeholder`: Present while it holds no text.
|
|
1746
|
+
- `data-touched`: In a field: present once focus has left it.
|
|
1747
|
+
- `data-dirty`: In a field: present while the text is not the one it began with.
|
|
1748
|
+
- `data-filled`: In a field: present while it holds text.
|
|
1749
|
+
- `data-focused`: In a field: present while it has focus.
|
|
1750
|
+
- `data-valid`: In a field: present once the text was checked and found right.
|
|
1751
|
+
- `data-invalid`: In a field: present while the text is wrong.
|
|
1206
1752
|
|
|
1207
1753
|
### Field
|
|
1208
1754
|
|
|
@@ -1240,7 +1786,7 @@ Anatomy:
|
|
|
1240
1786
|
label
|
|
1241
1787
|
control
|
|
1242
1788
|
description
|
|
1243
|
-
error
|
|
1789
|
+
error (repeated)
|
|
1244
1790
|
```
|
|
1245
1791
|
|
|
1246
1792
|
Attributes and CSS variables, by part:
|
|
@@ -1277,7 +1823,7 @@ Attributes and CSS variables, by part:
|
|
|
1277
1823
|
- `data-focused`: Present while the control has focus.
|
|
1278
1824
|
- `data-valid`: Present once the value has been checked and found right.
|
|
1279
1825
|
- `data-invalid`: Present while the value is wrong.
|
|
1280
|
-
- error: What is wrong with the value. In the page while it applies.
|
|
1826
|
+
- error: What is wrong with the value. In the page while it applies. Several, each with its own `match`, can be shown at once: each has an id of its own, and the control names them all.
|
|
1281
1827
|
- `data-disabled`: Present when it is disabled.
|
|
1282
1828
|
- `data-touched`: Present once focus has left the control.
|
|
1283
1829
|
- `data-dirty`: Present while the value is not the one it started with.
|
|
@@ -1320,6 +1866,108 @@ Attributes and CSS variables, by part:
|
|
|
1320
1866
|
- legend: The group's name.
|
|
1321
1867
|
- `data-disabled`: Present when it is disabled.
|
|
1322
1868
|
|
|
1869
|
+
### FileUpload
|
|
1870
|
+
|
|
1871
|
+
```
|
|
1872
|
+
import "@kirana-ui/web/file-upload"
|
|
1873
|
+
```
|
|
1874
|
+
|
|
1875
|
+
`<kui-file-upload>`: `<kui-file-upload>` around `kui-part="root"`, which holds a `dropzone` (with a `trigger` button inside, if the page wants one), a `list` with a `<template kui-each="items">` for a file (`{name}`, `{size}` in bytes, `{type}` and `{index}` are its own), and a `clear` button. An `item` holds its `item-name` and `item-size`, which say the file's name and its size as people read one (in the language of its `kui-locale`) unless the page wrote something, and an `item-remove` button. The dropzone draws the native file input, hidden, as its last child. `accept`, `multiple`, `max-files`, `max-size`, `min-size`, `disabled`, `required`, `name`, `form`; `files`, `default-files` and `validate` as properties. It tells `files-change` and `files-reject` (`detail.rejections`).
|
|
1876
|
+
|
|
1877
|
+
Attributes of the element (each also a property, in camel case):
|
|
1878
|
+
|
|
1879
|
+
- `accept` (string): What may be taken, as a file input's `accept`: extensions (`".png"`), types (`"image/png"`) and kinds (`"image/*"`), in a list or one text with commas. Without it, anything.
|
|
1880
|
+
- `multiple` (boolean): Whether several files are held. Default `false`: a file taken is the one held.
|
|
1881
|
+
- `max-files` (number): With `multiple`, how many files it holds at most.
|
|
1882
|
+
- `max-size` (number): The largest a file may be, in bytes.
|
|
1883
|
+
- `min-size` (number): The smallest a file may be, in bytes.
|
|
1884
|
+
- `disabled` (boolean): Disabled: no file can be taken or removed.
|
|
1885
|
+
- `required` (boolean): Needed: in a `Field`, holding none is then invalid.
|
|
1886
|
+
- `name` (string): With a name, the files are submitted with the form around them.
|
|
1887
|
+
- `form` (string): The id of the form the control belongs to, when it is not inside it.
|
|
1888
|
+
|
|
1889
|
+
Properties only:
|
|
1890
|
+
|
|
1891
|
+
- `files`: The files it holds, in order.
|
|
1892
|
+
- `defaultFiles`: The files it starts with, when the caller does not hold `files`. Read once.
|
|
1893
|
+
- `validate`: Whether a file may be taken, asked after the checks above.
|
|
1894
|
+
|
|
1895
|
+
Events:
|
|
1896
|
+
|
|
1897
|
+
- `files-change`: `event.detail.files`, with `event.detail.details`. `preventDefault()` keeps `files` as it was.
|
|
1898
|
+
- `files-reject`: `event.detail.rejections`, with `event.detail.details`. It reports something that happened: there is nothing to keep.
|
|
1899
|
+
|
|
1900
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1901
|
+
|
|
1902
|
+
- `root`
|
|
1903
|
+
- `dropzone`
|
|
1904
|
+
- `trigger`
|
|
1905
|
+
- `list`
|
|
1906
|
+
- `item`
|
|
1907
|
+
- `item-name`
|
|
1908
|
+
- `item-size`: `kui-locale`
|
|
1909
|
+
- `item-remove`
|
|
1910
|
+
- `clear`
|
|
1911
|
+
|
|
1912
|
+
Lists (`<template kui-each="…">`): `items`.
|
|
1913
|
+
|
|
1914
|
+
Anatomy:
|
|
1915
|
+
|
|
1916
|
+
```
|
|
1917
|
+
<kui-file-upload>
|
|
1918
|
+
root
|
|
1919
|
+
dropzone
|
|
1920
|
+
trigger (optional, as above)
|
|
1921
|
+
trigger (optional)
|
|
1922
|
+
list
|
|
1923
|
+
<template kui-each="items">
|
|
1924
|
+
item (repeated)
|
|
1925
|
+
item-name
|
|
1926
|
+
item-size (optional)
|
|
1927
|
+
item-remove (optional)
|
|
1928
|
+
clear (optional)
|
|
1929
|
+
```
|
|
1930
|
+
|
|
1931
|
+
Attributes and CSS variables, by part:
|
|
1932
|
+
|
|
1933
|
+
- root: Files chosen to be sent.
|
|
1934
|
+
- `data-disabled`: Present when it is disabled.
|
|
1935
|
+
- `data-dragging`: Present while files are dragged over the dropzone.
|
|
1936
|
+
- `data-required`: Present when a file is needed.
|
|
1937
|
+
- `data-empty`: Present while it holds no file.
|
|
1938
|
+
- dropzone: Where files are dropped or pasted; pressed, it opens the file picker. It holds the hidden file input.
|
|
1939
|
+
- `data-disabled`: Present when it is disabled.
|
|
1940
|
+
- `data-dragging`: Present while files are dragged over the dropzone.
|
|
1941
|
+
- `data-required`: Present when a file is needed.
|
|
1942
|
+
- trigger: A button that opens the file picker.
|
|
1943
|
+
- `data-disabled`: Present when it is disabled.
|
|
1944
|
+
- `data-dragging`: Present while files are dragged over the dropzone.
|
|
1945
|
+
- `data-required`: Present when a file is needed.
|
|
1946
|
+
- list: What holds the files: a list.
|
|
1947
|
+
- `data-disabled`: Present when it is disabled.
|
|
1948
|
+
- `data-dragging`: Present while files are dragged over the dropzone.
|
|
1949
|
+
- `data-required`: Present when a file is needed.
|
|
1950
|
+
- item: A file.
|
|
1951
|
+
- `data-disabled`: Present when it is disabled.
|
|
1952
|
+
- `data-dragging`: Present while files are dragged over the dropzone.
|
|
1953
|
+
- `data-required`: Present when a file is needed.
|
|
1954
|
+
- itemName: A file's name.
|
|
1955
|
+
- `data-disabled`: Present when it is disabled.
|
|
1956
|
+
- `data-dragging`: Present while files are dragged over the dropzone.
|
|
1957
|
+
- `data-required`: Present when a file is needed.
|
|
1958
|
+
- itemSize: A file's size, as people read one.
|
|
1959
|
+
- `data-disabled`: Present when it is disabled.
|
|
1960
|
+
- `data-dragging`: Present while files are dragged over the dropzone.
|
|
1961
|
+
- `data-required`: Present when a file is needed.
|
|
1962
|
+
- itemRemove: A file's button that takes it away.
|
|
1963
|
+
- `data-disabled`: Present when it is disabled.
|
|
1964
|
+
- `data-dragging`: Present while files are dragged over the dropzone.
|
|
1965
|
+
- `data-required`: Present when a file is needed.
|
|
1966
|
+
- clear: Takes every file away: hidden while there is none.
|
|
1967
|
+
- `data-disabled`: Present when it is disabled.
|
|
1968
|
+
- `data-dragging`: Present while files are dragged over the dropzone.
|
|
1969
|
+
- `data-required`: Present when a file is needed.
|
|
1970
|
+
|
|
1323
1971
|
### Form
|
|
1324
1972
|
|
|
1325
1973
|
```
|
|
@@ -1375,7 +2023,7 @@ Events:
|
|
|
1375
2023
|
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1376
2024
|
|
|
1377
2025
|
- `trigger`: `kui-close-delay`, `kui-delay`
|
|
1378
|
-
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-collision-padding`, `kui-side`, `kui-side-offset`
|
|
2026
|
+
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-arrow-padding`, `kui-collision-boundary`, `kui-collision-padding`, `kui-position-method`, `kui-side`, `kui-side-offset`, `kui-sticky`
|
|
1379
2027
|
- `popup`
|
|
1380
2028
|
- `arrow`
|
|
1381
2029
|
|
|
@@ -1399,11 +2047,14 @@ Attributes and CSS variables, by part:
|
|
|
1399
2047
|
- `data-closed`: Present when it is closed.
|
|
1400
2048
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
1401
2049
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2050
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
1402
2051
|
- `--anchor-width`: The anchor's width.
|
|
1403
2052
|
- `--anchor-height`: The anchor's height.
|
|
1404
2053
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
1405
2054
|
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
1406
2055
|
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
2056
|
+
- `--positioner-width`: The popup's width, as its content lays it out: a design gives the positioner `width: var(--positioner-width)` to animate a change of size.
|
|
2057
|
+
- `--positioner-height`: The popup's height, as its content lays it out: a design gives the positioner `height: var(--positioner-height)` to animate a change of size.
|
|
1407
2058
|
- popup: The card itself.
|
|
1408
2059
|
- `data-open`: Present when it is open.
|
|
1409
2060
|
- `data-closed`: Present when it is closed.
|
|
@@ -1413,6 +2064,8 @@ Attributes and CSS variables, by part:
|
|
|
1413
2064
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1414
2065
|
- `data-instant="delay | focus | dismiss"`: Present when it opened or closed without its usual wait, for a design that skips the motion then.
|
|
1415
2066
|
- arrow: An element that points at the trigger, placed along the popup's edge.
|
|
2067
|
+
- `data-open`: Present when it is open.
|
|
2068
|
+
- `data-closed`: Present when it is closed.
|
|
1416
2069
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
1417
2070
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1418
2071
|
- `data-uncentered`: Present when the popup was pushed along its edge, so the arrow is not at the trigger's centre.
|
|
@@ -1543,7 +2196,7 @@ Attributes and CSS variables, by part:
|
|
|
1543
2196
|
import "@kirana-ui/web/menu"
|
|
1544
2197
|
```
|
|
1545
2198
|
|
|
1546
|
-
`<kui-menu>`: `<kui-menu>` around a `kui-part="trigger"` and a `portal` with a `positioner` (its `kui-side` and the like) around the `popup`, which holds its `item`s (`kui-disabled`, `kui-label`, `kui-close-on-
|
|
2199
|
+
`<kui-menu>`: `<kui-menu>` around a `kui-part="trigger"` and a `portal` with a `positioner` (its `kui-side` and the like) around the `popup`, which holds its `item`s (`kui-disabled`, `kui-label`, `kui-close-on-select="false"`), `separator`s, `group`s with a `group-label`, `checkbox-item`s (`kui-checked`, `kui-default-checked`; it tells `checked-change`) with a `checkbox-item-indicator`, and a `radio-group` (`kui-value`, `kui-default-value`; it tells `value-change`) of `radio-item`s (`kui-value`) with a `radio-item-indicator`. A `<kui-menu>` inside a menu is its submenu, its trigger an item of the menu; inside a `<kui-menubar>`, one of the bar's. `open`, `default-open`, `disabled`, `loop-focus` (`loop` is its older name), `modal`; it tells `open-change`.
|
|
1547
2200
|
|
|
1548
2201
|
Events:
|
|
1549
2202
|
|
|
@@ -1551,17 +2204,17 @@ Events:
|
|
|
1551
2204
|
|
|
1552
2205
|
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1553
2206
|
|
|
1554
|
-
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-collision-padding`, `kui-side`, `kui-side-offset`
|
|
2207
|
+
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-arrow-padding`, `kui-collision-boundary`, `kui-collision-padding`, `kui-position-method`, `kui-side`, `kui-side-offset`, `kui-sticky`
|
|
1555
2208
|
- `popup`
|
|
1556
2209
|
- `arrow`
|
|
1557
2210
|
- `separator`
|
|
1558
|
-
- `item`: `kui-close-on-click`, `kui-disabled`, `kui-label`
|
|
2211
|
+
- `item`: `kui-close-on-click`, `kui-close-on-select`, `kui-disabled`, `kui-label`
|
|
1559
2212
|
- `group`: `kui-id`
|
|
1560
2213
|
- `group-label`
|
|
1561
2214
|
- `checkbox-item`
|
|
1562
2215
|
- `checkbox-item-indicator`
|
|
1563
2216
|
- `radio-group`
|
|
1564
|
-
- `radio-item`: `kui-close-on-click`, `kui-disabled`, `kui-label`, `kui-value`
|
|
2217
|
+
- `radio-item`: `kui-close-on-click`, `kui-close-on-select`, `kui-disabled`, `kui-label`, `kui-value`
|
|
1565
2218
|
- `radio-item-indicator`: `kui-value`
|
|
1566
2219
|
- `trigger`
|
|
1567
2220
|
|
|
@@ -1592,17 +2245,21 @@ Attributes and CSS variables, by part:
|
|
|
1592
2245
|
|
|
1593
2246
|
- trigger: The button that opens the menu, and what it is placed against.
|
|
1594
2247
|
- `data-popup-open`: Present when the menu is open.
|
|
2248
|
+
- `data-pressed`: Present while its popup is open: it stays pressed, as a button held down.
|
|
1595
2249
|
- `data-disabled`: Present when it is disabled.
|
|
1596
2250
|
- positioner: Places the menu against its trigger. It carries the geometry.
|
|
1597
2251
|
- `data-open`: Present when it is open.
|
|
1598
2252
|
- `data-closed`: Present when it is closed.
|
|
1599
2253
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
1600
2254
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2255
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
1601
2256
|
- `--anchor-width`: The anchor's width.
|
|
1602
2257
|
- `--anchor-height`: The anchor's height.
|
|
1603
2258
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
1604
2259
|
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
1605
2260
|
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
2261
|
+
- `--positioner-width`: The popup's width, as its content lays it out: a design gives the positioner `width: var(--positioner-width)` to animate a change of size.
|
|
2262
|
+
- `--positioner-height`: The popup's height, as its content lays it out: a design gives the positioner `height: var(--positioner-height)` to animate a change of size.
|
|
1606
2263
|
- popup: The menu itself: the list of items.
|
|
1607
2264
|
- `data-open`: Present when it is open.
|
|
1608
2265
|
- `data-closed`: Present when it is closed.
|
|
@@ -1610,7 +2267,10 @@ Attributes and CSS variables, by part:
|
|
|
1610
2267
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1611
2268
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
1612
2269
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2270
|
+
- `data-instant="click | dismiss | group"`: Present when it opened or closed in a way that should skip the motion: `click` when the keyboard pressed its trigger or an item, `dismiss` when Escape closed it, `group` when focus or the pointer went from one menu of a bar to another.
|
|
1613
2271
|
- arrow: An element that points at the trigger.
|
|
2272
|
+
- `data-open`: Present when it is open.
|
|
2273
|
+
- `data-closed`: Present when it is closed.
|
|
1614
2274
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
1615
2275
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1616
2276
|
- `data-uncentered`: Present when the arrow cannot sit at the trigger's centre.
|
|
@@ -1649,13 +2309,15 @@ Attributes and CSS variables, by part:
|
|
|
1649
2309
|
import "@kirana-ui/web/menubar"
|
|
1650
2310
|
```
|
|
1651
2311
|
|
|
1652
|
-
`<kui-menubar>`: `<kui-menubar>` around `kui-part="root"` and its `<kui-menu>`s, which work as one: the arrows move between them, and with one open the pointer opens the next. `loop
|
|
2312
|
+
`<kui-menubar>`: `<kui-menubar>` around `kui-part="root"` and its `<kui-menu>`s, which work as one: the arrows move between them, and with one open the pointer opens the next. `loop-focus` (`loop` is its older name), `disabled`, `orientation`, `modal`.
|
|
1653
2313
|
|
|
1654
2314
|
Attributes of the element (each also a property, in camel case):
|
|
1655
2315
|
|
|
1656
|
-
- `loop` (boolean): Whether the arrows go round from the last menu to the first. Default: they do.
|
|
2316
|
+
- `loop-focus` (boolean): Whether the arrows go round from the last menu to the first. Default: they do.
|
|
2317
|
+
- `loop` (boolean): Whether the arrows wrap from the last item to the first.
|
|
1657
2318
|
- `disabled` (boolean): No menu of the bar opens.
|
|
1658
2319
|
- `orientation` (string): A row (the default) or a column of menus. In a column a menu opens beside its trigger.
|
|
2320
|
+
- `modal` (boolean): Holds the page while one of its menus is open, as a menu's own `modal` does: its scroll is locked, and a press outside closes the menu and reaches nothing. Default: it does not. Read as a menu opens.
|
|
1659
2321
|
|
|
1660
2322
|
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1661
2323
|
|
|
@@ -1672,6 +2334,8 @@ Attributes and CSS variables, by part:
|
|
|
1672
2334
|
|
|
1673
2335
|
- root: The row of menus. A menu inside it is one of its items.
|
|
1674
2336
|
- `data-disabled`: Present when it is disabled.
|
|
2337
|
+
- `data-modal`: Present when its menus hold the page while one is open.
|
|
2338
|
+
- `data-has-submenu-open`: Present while one of its menus is open.
|
|
1675
2339
|
- `data-orientation="horizontal | vertical"`: Whether its menus are in a row or a column.
|
|
1676
2340
|
|
|
1677
2341
|
### MessageScroller
|
|
@@ -1762,7 +2426,7 @@ Anatomy:
|
|
|
1762
2426
|
import "@kirana-ui/web/navigation-menu"
|
|
1763
2427
|
```
|
|
1764
2428
|
|
|
1765
|
-
`<kui-navigation-menu>`: `<kui-navigation-menu>` around a `kui-part="root"` nav with its `list`. An `item` has a `trigger` (with an `icon` if it has one) and a `content`, which is drawn in the menu's one `viewport` while its item is open; its `kui-value` tells it from the others, and an item that is given none makes its own. A `link` is a link (`kui-active`, `kui-close-on-
|
|
2429
|
+
`<kui-navigation-menu>`: `<kui-navigation-menu>` around a `kui-part="root"` nav with its `list`. An `item` has a `trigger` (with an `icon` if it has one; `kui-disabled`) and a `content`, which is drawn in the menu's one `viewport` while its item is open; its `kui-value` tells it from the others, and an item that is given none makes its own. A `link` is a link (`kui-active`, `kui-close-on-select="false"`). The viewport is in a `portal` with a `positioner` around the `popup`, with an `arrow` and a `backdrop` if it has them. `value`, `default-value`, `delay`, `close-delay`, `orientation`; it tells `value-change`.
|
|
1766
2430
|
|
|
1767
2431
|
Attributes of the element (each also a property, in camel case):
|
|
1768
2432
|
|
|
@@ -1784,8 +2448,8 @@ Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
|
1784
2448
|
- `trigger`: `kui-value`
|
|
1785
2449
|
- `icon`: `kui-value`
|
|
1786
2450
|
- `content`: `kui-value`
|
|
1787
|
-
- `link`: `kui-active`, `kui-close-on-click`
|
|
1788
|
-
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-collision-padding`, `kui-side`, `kui-side-offset`
|
|
2451
|
+
- `link`: `kui-active`, `kui-close-on-click`, `kui-close-on-select`
|
|
2452
|
+
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-arrow-padding`, `kui-collision-boundary`, `kui-collision-padding`, `kui-position-method`, `kui-side`, `kui-side-offset`, `kui-sticky`
|
|
1789
2453
|
- `popup`
|
|
1790
2454
|
- `viewport`
|
|
1791
2455
|
- `arrow`
|
|
@@ -1816,10 +2480,15 @@ Attributes and CSS variables, by part:
|
|
|
1816
2480
|
|
|
1817
2481
|
- root: The navigation.
|
|
1818
2482
|
- `data-orientation="horizontal | vertical"`: Whether the list is a row or a column.
|
|
2483
|
+
- `data-open`: Present while an item's content is shown.
|
|
2484
|
+
- `data-nested`: Present on a navigation menu inside another's content: a submenu of it.
|
|
1819
2485
|
- list: The row of items.
|
|
1820
2486
|
- `data-orientation="horizontal | vertical"`: Whether the list is a row or a column.
|
|
2487
|
+
- `data-open`: Present while an item's content is shown.
|
|
1821
2488
|
- trigger: The button that shows an item's content.
|
|
1822
2489
|
- `data-popup-open`: Present while the item's content is shown.
|
|
2490
|
+
- `data-pressed`: Present while its popup is open: it stays pressed, as a button held down.
|
|
2491
|
+
- `data-disabled`: Present when it is disabled.
|
|
1823
2492
|
- icon: A mark on a trigger that shows whether its content is open.
|
|
1824
2493
|
- `data-popup-open`: Present while the item's content is shown.
|
|
1825
2494
|
- content: What an item shows. It is drawn in the viewport every item shares.
|
|
@@ -1827,7 +2496,7 @@ Attributes and CSS variables, by part:
|
|
|
1827
2496
|
- `data-closed`: Present when it is closed.
|
|
1828
2497
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1829
2498
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1830
|
-
- `data-activation-direction="left | right"`: Which way it came from: the item before it, or after.
|
|
2499
|
+
- `data-activation-direction="left | right | up | down"`: Which way it came from: the item before it, or after; `up` and `down` when the list is a column.
|
|
1831
2500
|
- link: A link, in the list or in an item's content.
|
|
1832
2501
|
- `data-active`: Present on the link of the page the reader is on.
|
|
1833
2502
|
- positioner: Places the popup against the open item's trigger. It carries the geometry.
|
|
@@ -1835,6 +2504,8 @@ Attributes and CSS variables, by part:
|
|
|
1835
2504
|
- `data-closed`: Present when it is closed.
|
|
1836
2505
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
1837
2506
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2507
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
2508
|
+
- `data-instant`: Present while it should move at once: as it is first drawn, and while the window is resized.
|
|
1838
2509
|
- `--anchor-width`: The anchor's width.
|
|
1839
2510
|
- `--anchor-height`: The anchor's height.
|
|
1840
2511
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
@@ -1849,9 +2520,12 @@ Attributes and CSS variables, by part:
|
|
|
1849
2520
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1850
2521
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
1851
2522
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2523
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
1852
2524
|
- `--popup-width`: The open content's width.
|
|
1853
2525
|
- `--popup-height`: The open content's height.
|
|
1854
2526
|
- arrow: An element that points at the open item's trigger.
|
|
2527
|
+
- `data-open`: Present when it is open.
|
|
2528
|
+
- `data-closed`: Present when it is closed.
|
|
1855
2529
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
1856
2530
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1857
2531
|
- `data-uncentered`: Present when the arrow cannot sit at the trigger's centre.
|
|
@@ -1867,7 +2541,7 @@ Attributes and CSS variables, by part:
|
|
|
1867
2541
|
import "@kirana-ui/web/number-field"
|
|
1868
2542
|
```
|
|
1869
2543
|
|
|
1870
|
-
`<kui-number-field>`: `<kui-number-field>` around `kui-part="root"`, a `group`, an `input`, and `increment` and `decrement` buttons. With a name, the root draws the hidden input a form reads. `value`, `default-value`, `min`, `max`, `step`, `small-step`, `large-step`, `snap-on-step`, `allow-wheel-scrub`, `locale`, `disabled`, `read-only`, `required`, `name`, `form`; `format` as a property; it tells `value-change` and `value-committed`.
|
|
2544
|
+
`<kui-number-field>`: `<kui-number-field>` around `kui-part="root"`, a `group`, an `input`, and `increment` and `decrement` buttons. With a name, the root draws the hidden input a form reads. A `scrub-area` (a label, as a rule) is pressed and dragged to change the number, with `kui-direction="vertical"`, `kui-pixel-sensitivity` and `kui-teleport-distance` on it; a `scrub-area-cursor` inside it is drawn at the end of the page while the pointer is locked. `value`, `default-value`, `min`, `max`, `step`, `small-step`, `large-step`, `snap-on-step`, `allow-wheel-scrub`, `locale`, `disabled`, `read-only`, `required`, `name`, `form`; `format` as a property; it tells `value-change` and `value-committed`.
|
|
1871
2545
|
|
|
1872
2546
|
Attributes of the element (each also a property, in camel case):
|
|
1873
2547
|
|
|
@@ -1886,6 +2560,7 @@ Attributes of the element (each also a property, in camel case):
|
|
|
1886
2560
|
- `required` (boolean): Needed: in a `Field`, leaving it empty is then invalid.
|
|
1887
2561
|
- `name` (string): With a name, the number is submitted with the form around it.
|
|
1888
2562
|
- `form` (string): The id of the form the control belongs to, when it is not inside it.
|
|
2563
|
+
- `kui-id` (string): What its input's id is made from: the input is `<id>-input`, which a `<label for>` names. Inside a `Field`, the input takes the field's id instead.
|
|
1889
2564
|
|
|
1890
2565
|
Properties only:
|
|
1891
2566
|
|
|
@@ -1903,6 +2578,8 @@ Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
|
1903
2578
|
- `input`
|
|
1904
2579
|
- `increment`
|
|
1905
2580
|
- `decrement`
|
|
2581
|
+
- `scrub-area`: `kui-direction`, `kui-pixel-sensitivity`, `kui-teleport-distance`
|
|
2582
|
+
- `scrub-area-cursor`
|
|
1906
2583
|
|
|
1907
2584
|
Anatomy:
|
|
1908
2585
|
|
|
@@ -1913,6 +2590,8 @@ Anatomy:
|
|
|
1913
2590
|
input
|
|
1914
2591
|
increment
|
|
1915
2592
|
decrement
|
|
2593
|
+
scrub-area
|
|
2594
|
+
scrub-area-cursor
|
|
1916
2595
|
```
|
|
1917
2596
|
|
|
1918
2597
|
Attributes and CSS variables, by part:
|
|
@@ -1925,6 +2604,7 @@ Attributes and CSS variables, by part:
|
|
|
1925
2604
|
- `data-dirty`: Present while the number is not the one it started with.
|
|
1926
2605
|
- `data-filled`: Present while there is a number.
|
|
1927
2606
|
- `data-focused`: Present while the input has focus.
|
|
2607
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
1928
2608
|
- `data-valid`: In a field: present once the number was checked and found right.
|
|
1929
2609
|
- `data-invalid`: In a field: present while the number is wrong.
|
|
1930
2610
|
- group: What holds the input and its buttons, as one control.
|
|
@@ -1935,6 +2615,7 @@ Attributes and CSS variables, by part:
|
|
|
1935
2615
|
- `data-dirty`: Present while the number is not the one it started with.
|
|
1936
2616
|
- `data-filled`: Present while there is a number.
|
|
1937
2617
|
- `data-focused`: Present while the input has focus.
|
|
2618
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
1938
2619
|
- `data-valid`: In a field: present once the number was checked and found right.
|
|
1939
2620
|
- `data-invalid`: In a field: present while the number is wrong.
|
|
1940
2621
|
- input: The text input: it takes what its locale writes a number with.
|
|
@@ -1945,6 +2626,7 @@ Attributes and CSS variables, by part:
|
|
|
1945
2626
|
- `data-dirty`: Present while the number is not the one it started with.
|
|
1946
2627
|
- `data-filled`: Present while there is a number.
|
|
1947
2628
|
- `data-focused`: Present while the input has focus.
|
|
2629
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
1948
2630
|
- `data-valid`: In a field: present once the number was checked and found right.
|
|
1949
2631
|
- `data-invalid`: In a field: present while the number is wrong.
|
|
1950
2632
|
- increment: A button that steps the number up. Held, it goes on.
|
|
@@ -1955,6 +2637,7 @@ Attributes and CSS variables, by part:
|
|
|
1955
2637
|
- `data-dirty`: Present while the number is not the one it started with.
|
|
1956
2638
|
- `data-filled`: Present while there is a number.
|
|
1957
2639
|
- `data-focused`: Present while the input has focus.
|
|
2640
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
1958
2641
|
- `data-valid`: In a field: present once the number was checked and found right.
|
|
1959
2642
|
- `data-invalid`: In a field: present while the number is wrong.
|
|
1960
2643
|
- decrement: A button that steps the number down. Held, it goes on.
|
|
@@ -1965,30 +2648,59 @@ Attributes and CSS variables, by part:
|
|
|
1965
2648
|
- `data-dirty`: Present while the number is not the one it started with.
|
|
1966
2649
|
- `data-filled`: Present while there is a number.
|
|
1967
2650
|
- `data-focused`: Present while the input has focus.
|
|
2651
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
1968
2652
|
- `data-valid`: In a field: present once the number was checked and found right.
|
|
1969
2653
|
- `data-invalid`: In a field: present while the number is wrong.
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
2654
|
+
- scrubArea: An area that is pressed and dragged to change the number: the field's label, as a rule. It takes `direction`, `pixelSensitivity` and `teleportDistance`. A mouse's pointer is locked for the drag where the browser has that (not in Safari); a finger drags as it is.
|
|
2655
|
+
- `data-disabled`: Present when it is disabled.
|
|
2656
|
+
- `data-readonly`: Present when the number cannot be changed.
|
|
2657
|
+
- `data-required`: Present when a number must be given.
|
|
2658
|
+
- `data-touched`: Present once focus has left the input.
|
|
2659
|
+
- `data-dirty`: Present while the number is not the one it started with.
|
|
2660
|
+
- `data-filled`: Present while there is a number.
|
|
2661
|
+
- `data-focused`: Present while the input has focus.
|
|
2662
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
2663
|
+
- `data-valid`: In a field: present once the number was checked and found right.
|
|
2664
|
+
- `data-invalid`: In a field: present while the number is wrong.
|
|
2665
|
+
- scrubAreaCursor: What is drawn in place of the pointer while it is locked for a drag: in the page only then, at the end of `<body>`, placed by the component.
|
|
2666
|
+
- `data-disabled`: Present when it is disabled.
|
|
2667
|
+
- `data-readonly`: Present when the number cannot be changed.
|
|
2668
|
+
- `data-required`: Present when a number must be given.
|
|
2669
|
+
- `data-touched`: Present once focus has left the input.
|
|
2670
|
+
- `data-dirty`: Present while the number is not the one it started with.
|
|
2671
|
+
- `data-filled`: Present while there is a number.
|
|
2672
|
+
- `data-focused`: Present while the input has focus.
|
|
2673
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
2674
|
+
- `data-valid`: In a field: present once the number was checked and found right.
|
|
2675
|
+
- `data-invalid`: In a field: present while the number is wrong.
|
|
2676
|
+
|
|
2677
|
+
### Otp
|
|
2678
|
+
|
|
1973
2679
|
```
|
|
1974
2680
|
import "@kirana-ui/web/otp"
|
|
1975
2681
|
```
|
|
1976
2682
|
|
|
1977
|
-
`<kui-otp>`: `<kui-otp>` around `kui-part="root"`, the one `input` that is typed in, and a `slot` for each character (`kui-index`, from 0), which says its character and may hold a `caret`, in the page while the next character goes there. Slots may be in `group`s with a `separator` between. `length`, `value`, `default-value`, `mode`, `disabled`, `name`, `form`; it tells `value-change` and `complete
|
|
2683
|
+
`<kui-otp>`: `<kui-otp>` around `kui-part="root"`, the one `input` that is typed in, and a `slot` for each character (`kui-index`, from 0), which says its character and may hold a `caret`, in the page while the next character goes there. Slots may be in `group`s with a `separator` between. `length`, `value`, `default-value`, `validation-type` (`mode`, its old name), `pattern`, `disabled`, `read-only`, `required`, `name`, `form`; it tells `value-change` and `value-complete` (and `complete`, its old name).
|
|
1978
2684
|
|
|
1979
2685
|
Attributes of the element (each also a property, in camel case):
|
|
1980
2686
|
|
|
1981
2687
|
- `length` (number): How many characters the code has. Default: 6.
|
|
1982
2688
|
- `value` (string): The characters typed so far, when the caller holds them.
|
|
1983
2689
|
- `default-value` (string): The characters it starts with, when the caller does not hold `value`. Read once.
|
|
1984
|
-
- `
|
|
2690
|
+
- `validation-type` (string): What a character may be: a digit (`numeric`), a letter (`alpha`, `a` to `z` either case), either (`alphanumeric`), or anything but white space (`none`: no rule beyond that). It also says which keyboard a phone shows: the digits' for `numeric`, letters' otherwise. Default: `numeric`, on purpose: a one-time code is digits, and its keyboard is then the one to type them on. `alphabetic` and `text` are older spellings of `alpha` and `none`, still read.
|
|
2691
|
+
- `mode` (string): What a character may be.
|
|
2692
|
+
- `pattern` (string): What else a character may be: a regular expression, as text, that one character must match whole (`"[A-F0-9]"`), in place of `validationType`'s rule. Text, as an attribute can only be, so it is given the same way on every framework and on a custom element. With a pattern, `validationType` only says the keyboard, and defaults to `none`.
|
|
1985
2693
|
- `disabled` (boolean): Disabled: it cannot be changed.
|
|
2694
|
+
- `read-only` (boolean): Shown as it is, focusable, not changeable.
|
|
2695
|
+
- `required` (boolean): Needed: in a `Field`, an empty code is then invalid.
|
|
1986
2696
|
- `name` (string): With a name, the code is submitted with the form around it.
|
|
1987
2697
|
- `form` (string): The id of the form the input belongs to, when it is not inside it.
|
|
2698
|
+
- `kui-id` (string): The id of its input, not of the root: a `<label for>` names it.
|
|
1988
2699
|
|
|
1989
2700
|
Events:
|
|
1990
2701
|
|
|
1991
2702
|
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
2703
|
+
- `value-complete`: `event.detail.value`, with `event.detail.details`. It reports something that happened: there is nothing to keep.
|
|
1992
2704
|
- `complete`: `event.detail.value`, with `event.detail.details`. It reports something that happened: there is nothing to keep.
|
|
1993
2705
|
|
|
1994
2706
|
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
@@ -2015,16 +2727,31 @@ Anatomy:
|
|
|
2015
2727
|
Attributes and CSS variables, by part:
|
|
2016
2728
|
|
|
2017
2729
|
- root: The code: the input and its cells.
|
|
2018
|
-
- `data-
|
|
2730
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
2731
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
2732
|
+
- `data-filled`: Present when the code has a character in it.
|
|
2019
2733
|
- `data-focused`: Present while the input has focus.
|
|
2734
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
2735
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2736
|
+
- `data-disabled`: Present when it is disabled.
|
|
2737
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
2738
|
+
- `data-required`: Present when the form needs it.
|
|
2020
2739
|
- `data-complete`: Present when every character is in.
|
|
2021
2740
|
- input: The one input the code is typed in. A design lays it over the cells, unseen.
|
|
2022
2741
|
- `data-disabled`: Present when it is disabled.
|
|
2023
2742
|
- slot: One cell of the code.
|
|
2024
2743
|
- `data-index`: The cell's place, from 0.
|
|
2025
2744
|
- `data-active`: Present on the cell the next character goes in, or that is selected.
|
|
2745
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
2746
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
2026
2747
|
- `data-filled`: Present when the cell has its character.
|
|
2748
|
+
- `data-focused`: Present while the input has focus.
|
|
2749
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
2750
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2027
2751
|
- `data-disabled`: Present when it is disabled.
|
|
2752
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
2753
|
+
- `data-required`: Present when the form needs it.
|
|
2754
|
+
- `data-complete`: Present when every character is in.
|
|
2028
2755
|
|
|
2029
2756
|
### Pagination
|
|
2030
2757
|
|
|
@@ -2082,18 +2809,76 @@ Attributes and CSS variables, by part:
|
|
|
2082
2809
|
- next: Goes to the page after.
|
|
2083
2810
|
- `data-disabled`: Present when it is disabled.
|
|
2084
2811
|
|
|
2812
|
+
### PasswordInput
|
|
2813
|
+
|
|
2814
|
+
```
|
|
2815
|
+
import "@kirana-ui/web/password-input"
|
|
2816
|
+
```
|
|
2817
|
+
|
|
2818
|
+
`<kui-password-input>`: `<kui-password-input>` around `kui-part="root"`, an `input`, and a `toggle` button that shows the password and hides it again, with an `indicator` inside that says which it is. Inside a `<kui-field>` the input is the field's control. `visible`, `default-visible`, `disabled`; it tells `visible-change` and `value-change`.
|
|
2819
|
+
|
|
2820
|
+
Attributes of the element (each also a property, in camel case):
|
|
2821
|
+
|
|
2822
|
+
- `visible` (boolean): Whether the password can be read, when the caller holds it.
|
|
2823
|
+
- `default-visible` (boolean): Read once. Default `false`.
|
|
2824
|
+
- `disabled` (boolean): Disabled: nothing can be typed in it.
|
|
2825
|
+
|
|
2826
|
+
Events:
|
|
2827
|
+
|
|
2828
|
+
- `visible-change`: `event.detail.visible`, with `event.detail.details`. `preventDefault()` keeps `visible` as it was.
|
|
2829
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. It reports something that happened: there is nothing to keep.
|
|
2830
|
+
|
|
2831
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2832
|
+
|
|
2833
|
+
- `root`
|
|
2834
|
+
- `input`
|
|
2835
|
+
- `toggle`
|
|
2836
|
+
- `indicator`
|
|
2837
|
+
|
|
2838
|
+
Anatomy:
|
|
2839
|
+
|
|
2840
|
+
```
|
|
2841
|
+
<kui-password-input>
|
|
2842
|
+
root
|
|
2843
|
+
input
|
|
2844
|
+
toggle
|
|
2845
|
+
indicator (optional)
|
|
2846
|
+
```
|
|
2847
|
+
|
|
2848
|
+
Attributes and CSS variables, by part:
|
|
2849
|
+
|
|
2850
|
+
- root: A password that can be shown while it is typed.
|
|
2851
|
+
- `data-visible`: Present while the password can be read.
|
|
2852
|
+
- `data-disabled`: Present when it is disabled.
|
|
2853
|
+
- input: The `<input>`: a password, or text while it is shown. In a `Field` it is the field's control.
|
|
2854
|
+
- `data-visible`: Present while the password can be read.
|
|
2855
|
+
- `data-disabled`: Present when it is disabled.
|
|
2856
|
+
- `data-touched`: Present once focus has left it.
|
|
2857
|
+
- `data-dirty`: Present once its text differs from what it began with.
|
|
2858
|
+
- `data-filled`: Present while it holds text.
|
|
2859
|
+
- `data-focused`: Present while it has focus.
|
|
2860
|
+
- `data-valid`: In a field: present once the value was checked and found right.
|
|
2861
|
+
- `data-invalid`: In a field: present while the value is wrong.
|
|
2862
|
+
- toggle: Shows the password, and hides it again. Focus and the caret stay in the input.
|
|
2863
|
+
- `data-visible`: Present while the password can be read.
|
|
2864
|
+
- `data-disabled`: Present when it is disabled.
|
|
2865
|
+
- indicator: What draws which of the two it is: an eye, open or struck.
|
|
2866
|
+
- `data-visible`: Present while the password can be read.
|
|
2867
|
+
- `data-disabled`: Present when it is disabled.
|
|
2868
|
+
|
|
2085
2869
|
### Popover
|
|
2086
2870
|
|
|
2087
2871
|
```
|
|
2088
2872
|
import "@kirana-ui/web/popover"
|
|
2089
2873
|
```
|
|
2090
2874
|
|
|
2091
|
-
`<kui-popover>`: `<kui-popover>` around a `kui-part="trigger"` button and a `portal`, drawn at the end of the page while it is open, with a `positioner` (`kui-side`, `kui-align`, `kui-side-offset`, `kui-align-offset`, `kui-collision-padding`, and `kui-anchor`: the id of the element it is placed against, when that is not the trigger) around the `popup`, which may hold a `title`, a `description` and a `close` button. `open`, `default-open
|
|
2875
|
+
`<kui-popover>`: `<kui-popover>` around a `kui-part="trigger"` button and a `portal`, drawn at the end of the page while it is open, with a `positioner` (`kui-side`, `kui-align`, `kui-side-offset`, `kui-align-offset`, `kui-collision-padding`, and `kui-anchor`: the id of the element it is placed against, when that is not the trigger) around the `popup`, which may hold an `arrow`, a `title`, a `description` and a `close` button; the portal may hold a `backdrop` too. The trigger takes `kui-open-on-hover`, with `kui-delay` and `kui-close-delay`. `open`, `default-open`, `modal` (there, or `"trap-focus"`); it tells `open-change`.
|
|
2092
2876
|
|
|
2093
2877
|
Attributes of the element (each also a property, in camel case):
|
|
2094
2878
|
|
|
2095
2879
|
- `open` (boolean): Whether it is open, when the caller holds it.
|
|
2096
2880
|
- `default-open` (boolean): Whether it starts open, when the caller does not hold `open`. Read once.
|
|
2881
|
+
- `modal` (string): What the page behind it may do while it is open. `false` (the default): everything. `true`: nothing, the page is inert and does not scroll, and Tab stays inside the popover. `"trap-focus"`: Tab stays inside the popover, and the page can still be pressed and scrolled. A popover the pointer opened holds nothing until it is pressed. Read as it opens.
|
|
2097
2882
|
|
|
2098
2883
|
Events:
|
|
2099
2884
|
|
|
@@ -2101,9 +2886,11 @@ Events:
|
|
|
2101
2886
|
|
|
2102
2887
|
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2103
2888
|
|
|
2104
|
-
- `trigger`
|
|
2105
|
-
- `
|
|
2889
|
+
- `trigger`: `kui-close-delay`, `kui-delay`, `kui-open-on-hover`
|
|
2890
|
+
- `backdrop`
|
|
2891
|
+
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-arrow-padding`, `kui-collision-boundary`, `kui-collision-padding`, `kui-position-method`, `kui-side`, `kui-side-offset`, `kui-sticky`
|
|
2106
2892
|
- `popup`
|
|
2893
|
+
- `arrow`
|
|
2107
2894
|
- `title`
|
|
2108
2895
|
- `description`
|
|
2109
2896
|
- `close`
|
|
@@ -2114,27 +2901,38 @@ Anatomy:
|
|
|
2114
2901
|
<kui-popover>
|
|
2115
2902
|
trigger
|
|
2116
2903
|
portal
|
|
2904
|
+
backdrop
|
|
2117
2905
|
positioner
|
|
2118
2906
|
popup
|
|
2119
2907
|
title
|
|
2120
2908
|
description
|
|
2121
2909
|
close
|
|
2910
|
+
arrow
|
|
2122
2911
|
```
|
|
2123
2912
|
|
|
2124
2913
|
Attributes and CSS variables, by part:
|
|
2125
2914
|
|
|
2126
2915
|
- trigger: The button that opens the popover, and what it is placed against.
|
|
2127
2916
|
- `data-popup-open`: Present when the popover is open.
|
|
2917
|
+
- `data-pressed`: Present while the popover a press on this trigger opened is open: it stays pressed, as a button held down.
|
|
2918
|
+
- backdrop: A layer over the page behind the popover.
|
|
2919
|
+
- `data-open`: Present when it is open.
|
|
2920
|
+
- `data-closed`: Present when it is closed.
|
|
2921
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
2922
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2128
2923
|
- positioner: Places the popup against the trigger. It carries the geometry.
|
|
2129
2924
|
- `data-open`: Present when it is open.
|
|
2130
2925
|
- `data-closed`: Present when it is closed.
|
|
2131
2926
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
2132
2927
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2928
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
2133
2929
|
- `--anchor-width`: The anchor's width.
|
|
2134
2930
|
- `--anchor-height`: The anchor's height.
|
|
2135
2931
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
2136
2932
|
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
2137
2933
|
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
2934
|
+
- `--positioner-width`: The popup's width, as its content lays it out: a design gives the positioner `width: var(--positioner-width)` to animate a change of size.
|
|
2935
|
+
- `--positioner-height`: The popup's height, as its content lays it out: a design gives the positioner `height: var(--positioner-height)` to animate a change of size.
|
|
2138
2936
|
- popup: The popover itself.
|
|
2139
2937
|
- `data-open`: Present when it is open.
|
|
2140
2938
|
- `data-closed`: Present when it is closed.
|
|
@@ -2142,6 +2940,15 @@ Attributes and CSS variables, by part:
|
|
|
2142
2940
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2143
2941
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
2144
2942
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2943
|
+
- `data-instant="click | dismiss"`: Present when it opened or closed in a way that should skip the motion: `click` when the keyboard pressed the trigger, `dismiss` when Escape closed it.
|
|
2944
|
+
- `--popup-width`: Its width: `auto`, and while its content changes size, the old width and then the new one, for a transition between them.
|
|
2945
|
+
- `--popup-height`: Its height: `auto`, and while its content changes size, the old height and then the new one, for a transition between them.
|
|
2946
|
+
- arrow: An element that points at the trigger, placed along the popup's edge.
|
|
2947
|
+
- `data-open`: Present when it is open.
|
|
2948
|
+
- `data-closed`: Present when it is closed.
|
|
2949
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
2950
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2951
|
+
- `data-uncentered`: Present when the popup was pushed along its edge, so the arrow is not at the trigger's centre.
|
|
2145
2952
|
|
|
2146
2953
|
### Progress
|
|
2147
2954
|
|
|
@@ -2244,7 +3051,7 @@ Attributes and CSS variables, by part:
|
|
|
2244
3051
|
import "@kirana-ui/web/radio-group"
|
|
2245
3052
|
```
|
|
2246
3053
|
|
|
2247
|
-
`<kui-radio-group>`: `<kui-radio-group>` around `kui-part="root"` and an `item` button for each `value`, with an `indicator` inside that is in the page while its item is the chosen one. An item draws the hidden native radio a form and a label reach. `value`, `default-value`, `disabled`, `read-only`, `required`, `name`, `form`; it tells `value-change`.
|
|
3054
|
+
`<kui-radio-group>`: `<kui-radio-group>` around `kui-part="root"` and an `item` button for each `value`, with an `indicator` inside that is in the page while its item is the chosen one. An item draws the hidden native radio a form and a label reach; an item's `kui-id` is that radio's id, which a `<label for>` names. `value`, `default-value`, `disabled`, `read-only`, `required`, `name`, `form`; it tells `value-change`.
|
|
2248
3055
|
|
|
2249
3056
|
Attributes of the element (each also a property, in camel case):
|
|
2250
3057
|
|
|
@@ -2263,7 +3070,7 @@ Events:
|
|
|
2263
3070
|
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2264
3071
|
|
|
2265
3072
|
- `root`
|
|
2266
|
-
- `item`: `kui-disabled`, `kui-value`
|
|
3073
|
+
- `item`: `kui-disabled`, `kui-id`, `kui-value`
|
|
2267
3074
|
- `indicator`: `kui-value`
|
|
2268
3075
|
|
|
2269
3076
|
Anatomy:
|
|
@@ -2281,21 +3088,95 @@ Attributes and CSS variables, by part:
|
|
|
2281
3088
|
- `data-disabled`: Present when it is disabled.
|
|
2282
3089
|
- `data-readonly`: Present when it can be read but not changed.
|
|
2283
3090
|
- `data-required`: Present when the form needs it.
|
|
2284
|
-
-
|
|
3091
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3092
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3093
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3094
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3095
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3096
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
3097
|
+
- item: One choice. It holds a hidden native radio, which a form and a label reach: the item's `id` (`kpId` on Angular, `kui-id` on a custom element) is the radio's, which a `<label for>` names.
|
|
2285
3098
|
- `data-checked`: Present when it is checked.
|
|
2286
3099
|
- `data-unchecked`: Present when it is not checked.
|
|
2287
3100
|
- `data-disabled`: Present when it is disabled.
|
|
2288
3101
|
- `data-readonly`: Present when it can be read but not changed.
|
|
2289
3102
|
- `data-required`: Present when the form needs it.
|
|
3103
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3104
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3105
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3106
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3107
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3108
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2290
3109
|
- indicator: The mark. In the page while its item is the chosen one.
|
|
2291
3110
|
- `data-checked`: Present when it is checked.
|
|
2292
3111
|
- `data-unchecked`: Present when it is not checked.
|
|
2293
3112
|
- `data-disabled`: Present when it is disabled.
|
|
2294
3113
|
- `data-readonly`: Present when it can be read but not changed.
|
|
2295
3114
|
- `data-required`: Present when the form needs it.
|
|
3115
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3116
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3117
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3118
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3119
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3120
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2296
3121
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
2297
3122
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2298
3123
|
|
|
3124
|
+
### Rating
|
|
3125
|
+
|
|
3126
|
+
```
|
|
3127
|
+
import "@kirana-ui/web/rating"
|
|
3128
|
+
```
|
|
3129
|
+
|
|
3130
|
+
`<kui-rating>`: `<kui-rating>` around a `kui-part="root"` element holding a `<template kui-each="items">` with an `item` for a place (`{place}` is its number, from 1). The root draws the hidden input a form reads, as its last child. `value`, `default-value`, `count`, `allow-half`, `disabled`, `read-only`, `required`, `name`, `form`; it tells `value-change` and `hover-change`.
|
|
3131
|
+
|
|
3132
|
+
Attributes of the element (each also a property, in camel case):
|
|
3133
|
+
|
|
3134
|
+
- `value` (number): How much is given, from 0 (none) to `count`; a half where `allowHalf` is set.
|
|
3135
|
+
- `default-value` (number): The value it starts with, when the caller does not hold `value`. Read once.
|
|
3136
|
+
- `count` (number): How many items there are. Default 5.
|
|
3137
|
+
- `allow-half` (boolean): Whether half an item can be given: by the half of it a pointer is over, and by the arrows.
|
|
3138
|
+
- `disabled` (boolean): Disabled: it cannot be changed.
|
|
3139
|
+
- `read-only` (boolean): Shown as it is, focusable, not changeable.
|
|
3140
|
+
- `required` (boolean): Needed: in a `Field`, giving none is then invalid.
|
|
3141
|
+
- `name` (string): With a name, the value is submitted with the form around it; none is submitted as empty.
|
|
3142
|
+
- `form` (string): The id of the form the control belongs to, when it is not inside it.
|
|
3143
|
+
|
|
3144
|
+
Events:
|
|
3145
|
+
|
|
3146
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
3147
|
+
- `hover-change`: `event.detail.value`, with `event.detail.details`. It reports something that happened: there is nothing to keep.
|
|
3148
|
+
|
|
3149
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
3150
|
+
|
|
3151
|
+
- `root`
|
|
3152
|
+
- `item`
|
|
3153
|
+
|
|
3154
|
+
Lists (`<template kui-each="…">`): `items`.
|
|
3155
|
+
|
|
3156
|
+
Anatomy:
|
|
3157
|
+
|
|
3158
|
+
```
|
|
3159
|
+
<kui-rating>
|
|
3160
|
+
root
|
|
3161
|
+
<template kui-each="items">
|
|
3162
|
+
item (repeated)
|
|
3163
|
+
```
|
|
3164
|
+
|
|
3165
|
+
Attributes and CSS variables, by part:
|
|
3166
|
+
|
|
3167
|
+
- root: The items, as one choice: a radio group. It holds the hidden input a form reads.
|
|
3168
|
+
- `data-disabled`: Present when it is disabled.
|
|
3169
|
+
- `data-readonly`: Present when it is shown and cannot be changed.
|
|
3170
|
+
- `data-required`: Present when a value is needed.
|
|
3171
|
+
- `data-hovering`: Present while a pointer is over an item.
|
|
3172
|
+
- item: One item (a star): pressed, the value is its place, or half of it.
|
|
3173
|
+
- `data-checked`: Present on the item that holds the value.
|
|
3174
|
+
- `data-filled`: Present on every item up to the value drawn: the one a pointer is over, or the one held.
|
|
3175
|
+
- `data-half`: Present on the item the value drawn fills by half.
|
|
3176
|
+
- `data-disabled`: Present when it is disabled.
|
|
3177
|
+
- `data-readonly`: Present when it is shown and cannot be changed.
|
|
3178
|
+
- `data-required`: Present when a value is needed.
|
|
3179
|
+
|
|
2299
3180
|
### Resizable
|
|
2300
3181
|
|
|
2301
3182
|
```
|
|
@@ -2331,13 +3212,13 @@ Anatomy:
|
|
|
2331
3212
|
|
|
2332
3213
|
Attributes and CSS variables, by part:
|
|
2333
3214
|
|
|
2334
|
-
- group: The panels and the bars between them. A design lays it out as a flex box.
|
|
3215
|
+
- group: The panels and the bars between them. A design lays it out as a flex box: `display: flex`, and `flex-direction: column` when it is vertical. A group in a panel that is a flex box itself takes `min-width: 0` and `min-height: 0`, or what it holds widens the panel.
|
|
2335
3216
|
- `data-orientation="horizontal | vertical"`: Whether the panels are side by side or one over the other.
|
|
2336
3217
|
- `data-disabled`: Present when it is disabled.
|
|
2337
|
-
- panel: One panel. It carries its share of the group.
|
|
3218
|
+
- panel: One panel. It carries its share of the group, written as its `flex` with `min-width: 0` and `min-height: 0`, so what it holds cannot keep it past its share. Its `overflow` is the design's.
|
|
2338
3219
|
- `data-orientation="horizontal | vertical"`: Whether the panels are side by side or one over the other.
|
|
2339
3220
|
- `--panel-size`: The panel's share, in hundredths of the group.
|
|
2340
|
-
- handle: The bar between two panels: dragged, or moved with the arrows.
|
|
3221
|
+
- handle: The bar between two panels: dragged, or moved with the arrows. A design gives it its thickness and `flex-shrink: 0`, so the panels do not squeeze it.
|
|
2341
3222
|
- `data-orientation="horizontal | vertical"`: Whether the panels are side by side or one over the other.
|
|
2342
3223
|
- `data-dragging`: Present while the bar is dragged.
|
|
2343
3224
|
- `data-disabled`: Present when it is disabled.
|
|
@@ -2365,7 +3246,8 @@ Anatomy:
|
|
|
2365
3246
|
<kui-scroll-area>
|
|
2366
3247
|
root
|
|
2367
3248
|
viewport
|
|
2368
|
-
content
|
|
3249
|
+
content (optional)
|
|
3250
|
+
scrollbar (repeated, as above)
|
|
2369
3251
|
scrollbar (repeated)
|
|
2370
3252
|
thumb
|
|
2371
3253
|
corner
|
|
@@ -2376,6 +3258,10 @@ Attributes and CSS variables, by part:
|
|
|
2376
3258
|
- root: The area. It holds the viewport and the scrollbars, which the library places against it: a design gives a scrollbar its thickness and draws it, and places nothing.
|
|
2377
3259
|
- `data-has-overflow-x`: Present when there is more to see sideways.
|
|
2378
3260
|
- `data-has-overflow-y`: Present when there is more to see up or down.
|
|
3261
|
+
- `data-overflow-x-start`: Present when there is more to scroll to towards the start of a line.
|
|
3262
|
+
- `data-overflow-x-end`: Present when there is more to scroll to towards the end of a line.
|
|
3263
|
+
- `data-overflow-y-start`: Present when there is more to scroll to above.
|
|
3264
|
+
- `data-overflow-y-end`: Present when there is more to scroll to below.
|
|
2379
3265
|
- `data-scrolling`: Present while it is being scrolled, and a moment after.
|
|
2380
3266
|
- `data-hovering`: Present while the pointer is over the area.
|
|
2381
3267
|
- `--scroll-area-corner-width`: The width of the corner: the vertical scrollbar's, while both scrollbars and the corner are in the page.
|
|
@@ -2383,15 +3269,38 @@ Attributes and CSS variables, by part:
|
|
|
2383
3269
|
- viewport: The element that scrolls.
|
|
2384
3270
|
- `data-has-overflow-x`: Present when there is more to see sideways.
|
|
2385
3271
|
- `data-has-overflow-y`: Present when there is more to see up or down.
|
|
3272
|
+
- `data-overflow-x-start`: Present when there is more to scroll to towards the start of a line.
|
|
3273
|
+
- `data-overflow-x-end`: Present when there is more to scroll to towards the end of a line.
|
|
3274
|
+
- `data-overflow-y-start`: Present when there is more to scroll to above.
|
|
3275
|
+
- `data-overflow-y-end`: Present when there is more to scroll to below.
|
|
3276
|
+
- `data-scrolling`: Present while it is being scrolled, and a moment after.
|
|
3277
|
+
- `--scroll-area-overflow-x-start`: How far the view is from the start of a line, to fade that edge by: `0px` at it.
|
|
3278
|
+
- `--scroll-area-overflow-x-end`: How far the view is from the end of a line: `0px` at it.
|
|
3279
|
+
- `--scroll-area-overflow-y-start`: How far the view is from the top: `0px` at it.
|
|
3280
|
+
- `--scroll-area-overflow-y-end`: How far the view is from the bottom: `0px` at it.
|
|
3281
|
+
- content: A box around what is scrolled, as wide as what it holds. Not needed to measure: the viewport's children are watched as they are. For content whose own box does not grow with what is in it (a block holding a wider table, or bare text).
|
|
3282
|
+
- `data-has-overflow-x`: Present when there is more to see sideways.
|
|
3283
|
+
- `data-has-overflow-y`: Present when there is more to see up or down.
|
|
3284
|
+
- `data-overflow-x-start`: Present when there is more to scroll to towards the start of a line.
|
|
3285
|
+
- `data-overflow-x-end`: Present when there is more to scroll to towards the end of a line.
|
|
3286
|
+
- `data-overflow-y-start`: Present when there is more to scroll to above.
|
|
3287
|
+
- `data-overflow-y-end`: Present when there is more to scroll to below.
|
|
2386
3288
|
- `data-scrolling`: Present while it is being scrolled, and a moment after.
|
|
2387
3289
|
- scrollbar: A scrollbar's track, placed along its edge of the area. In the page while there is something to scroll its way.
|
|
2388
3290
|
- `data-orientation="horizontal | vertical"`: Which way the scrollbar scrolls.
|
|
2389
3291
|
- `data-hovering`: Present while the pointer is over the area.
|
|
2390
3292
|
- `data-scrolling`: Present while the area is scrolled its way.
|
|
3293
|
+
- `data-has-overflow-x`: Present when there is more to see sideways.
|
|
3294
|
+
- `data-has-overflow-y`: Present when there is more to see up or down.
|
|
3295
|
+
- `data-overflow-x-start`: Present when there is more to scroll to towards the start of a line.
|
|
3296
|
+
- `data-overflow-x-end`: Present when there is more to scroll to towards the end of a line.
|
|
3297
|
+
- `data-overflow-y-start`: Present when there is more to scroll to above.
|
|
3298
|
+
- `data-overflow-y-end`: Present when there is more to scroll to below.
|
|
2391
3299
|
- `--scroll-area-thumb-height`: A vertical thumb's height.
|
|
2392
3300
|
- `--scroll-area-thumb-width`: A horizontal thumb's width.
|
|
2393
3301
|
- thumb: The part of a scrollbar that shows where the view is, and can be dragged. As long as its scrollbar's variable says.
|
|
2394
3302
|
- `data-orientation="horizontal | vertical"`: Which way the scrollbar scrolls.
|
|
3303
|
+
- `data-scrolling`: Present while the area is scrolled its way.
|
|
2395
3304
|
|
|
2396
3305
|
### Select
|
|
2397
3306
|
|
|
@@ -2399,25 +3308,30 @@ Attributes and CSS variables, by part:
|
|
|
2399
3308
|
import "@kirana-ui/web/select"
|
|
2400
3309
|
```
|
|
2401
3310
|
|
|
2402
|
-
`<kui-select>`: `<kui-select>` around a `kui-part="trigger"` button holding a `value` (it says the chosen item's text, or its `kui-placeholder`; with `multiple`, the chosen items' texts with commas between), and a `portal` with a `positioner` (its `kui-side` and the like, and `kui-align-item-with-trigger`) around the `popup`. The popup holds an `item` for each `kui-value` (`kui-disabled`, `kui-label`), each with an `item-text` and an `item-indicator`; items may be in a `group` with a `group-label`, with `separator`s between, and in a `list` between a `scroll-up-arrow` and a `scroll-down-arrow`. With a name it draws the hidden input a form reads. A `value` part that holds something says what the page wrote there: a `<template kui-each="values">` in it is drawn for each chosen value (`{value}`, `{label}`), in the items' order. `value`, `default-value`, `open`, `default-open`, `disabled`, `required`, `multiple
|
|
3311
|
+
`<kui-select>`: `<kui-select>` around a `kui-part="trigger"` button holding a `value` (it says the chosen item's text, or its `kui-placeholder`; with `multiple`, the chosen items' texts with commas between), and a `portal` with a `positioner` (its `kui-side` and the like, and `kui-align-item-with-trigger`) around the `popup`. The popup holds an `item` for each `kui-value` (`kui-disabled`, `kui-label`), each with an `item-text` and an `item-indicator`; items may be in a `group` with a `group-label`, with `separator`s between, and in a `list` between a `scroll-up-arrow` and a `scroll-down-arrow`. With a name it draws the hidden input a form reads. A `value` part that holds something says what the page wrote there: a `<template kui-each="values">` in it is drawn for each chosen value (`{value}`, `{label}`), in the items' order. `value`, `default-value`, `open`, `default-open`, `disabled`, `read-only`, `required`, `multiple` (with it, `value` and `default-value` hold the chosen values with commas between; `values` and `default-values`, the older names, are still read), `name`, `form`, `presentation` (`sheet` opens the list from the bottom edge, modal, over a `backdrop` part in the portal; `auto` on a narrow touch screen) and `sheet-below`; `items`, `itemToStringLabel` and `itemToStringValue` as properties; it tells `value-change`, `values-change` and `open-change`.
|
|
2403
3312
|
|
|
2404
3313
|
Attributes of the element (each also a property, in camel case):
|
|
2405
3314
|
|
|
2406
|
-
- `value` (string): The chosen value; `null` is "none".
|
|
2407
|
-
- `default-value` (string): The value it starts with, when the caller does not hold `value`. Read once.
|
|
3315
|
+
- `value` (string): The chosen value; `null` is "none". With `multiple`, the chosen values, in the order they were chosen.
|
|
3316
|
+
- `default-value` (string): The value it starts with (with `multiple`, the values), when the caller does not hold `value`. Read once.
|
|
2408
3317
|
- `open` (boolean): Whether the list is open, when the caller holds it.
|
|
2409
3318
|
- `default-open` (boolean): Whether the list starts open, when the caller does not hold `open`. Read once.
|
|
2410
3319
|
- `disabled` (boolean): Disabled: it cannot be changed.
|
|
3320
|
+
- `read-only` (boolean): Shown as it is, focusable, not changeable: the list still opens to be read, and no item can be chosen. Its value is still submitted with the form.
|
|
2411
3321
|
- `required` (boolean): In a field, "none" is then wrong.
|
|
2412
|
-
- `multiple` (boolean): Several values:
|
|
2413
|
-
- `values` (string): With `multiple`: the chosen values
|
|
2414
|
-
- `default-values` (string): With `multiple`: the values it starts with
|
|
3322
|
+
- `multiple` (boolean): Several values: `value`, `defaultValue` and `onValueChange` then hold a list. Read once.
|
|
3323
|
+
- `values` (string): With `multiple`: the chosen values.
|
|
3324
|
+
- `default-values` (string): With `multiple`: the values it starts with.
|
|
2415
3325
|
- `name` (string): With a name, the value is submitted with the form around it.
|
|
2416
3326
|
- `form` (string): The id of the form the control belongs to, when it is not inside it.
|
|
3327
|
+
- `presentation` (string): How the list opens. `"sheet"`: from the bottom edge, not placed against the trigger, modal with a backdrop, swiped down or pressed outside to close. `"auto"`: decided each time it opens, a sheet when the pointer is coarse and the viewport narrower than `sheetBelow`. Default `"popup"`.
|
|
3328
|
+
- `sheet-below` (number): With `presentation: "auto"`: the viewport's width, in CSS pixels, under which a coarse pointer opens a sheet. Default 640.
|
|
2417
3329
|
|
|
2418
3330
|
Properties only:
|
|
2419
3331
|
|
|
2420
3332
|
- `items`: The labels of the values, for the trigger to show before the list has ever been opened: a list of values with their labels, or, for values that are text, the labels by value (`{ apple: "Apple" }`). Not needed for the list itself: its items are read from the markup.
|
|
3333
|
+
- `itemToStringLabel`: For values that are objects: the text the trigger shows for one, and what typing matches an item by when it gives no `label`. Without it, an object's own `label` names it, then the label `items` gives it, then the item's text in the markup.
|
|
3334
|
+
- `itemToStringValue`: For values that are objects: the text the form is sent for one. Without it, the `value` of an object shaped `{ value, label }` is sent, and any other object as JSON.
|
|
2421
3335
|
|
|
2422
3336
|
Events:
|
|
2423
3337
|
|
|
@@ -2429,8 +3343,9 @@ Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
|
2429
3343
|
|
|
2430
3344
|
- `trigger`
|
|
2431
3345
|
- `value`: `kui-placeholder`
|
|
2432
|
-
- `positioner`: `kui-align`, `kui-align-item-with-trigger`, `kui-align-offset`, `kui-anchor`, `kui-collision-padding`, `kui-side`, `kui-side-offset`
|
|
3346
|
+
- `positioner`: `kui-align`, `kui-align-item-with-trigger`, `kui-align-offset`, `kui-anchor`, `kui-arrow-padding`, `kui-collision-boundary`, `kui-collision-padding`, `kui-position-method`, `kui-side`, `kui-side-offset`, `kui-sticky`
|
|
2433
3347
|
- `popup`
|
|
3348
|
+
- `backdrop`
|
|
2434
3349
|
- `list`
|
|
2435
3350
|
- `scroll-up-arrow`
|
|
2436
3351
|
- `scroll-down-arrow`
|
|
@@ -2451,6 +3366,7 @@ Anatomy:
|
|
|
2451
3366
|
value
|
|
2452
3367
|
<template kui-each="values"> (optional)
|
|
2453
3368
|
portal
|
|
3369
|
+
backdrop (optional)
|
|
2454
3370
|
positioner
|
|
2455
3371
|
popup
|
|
2456
3372
|
scroll-up-arrow
|
|
@@ -2468,15 +3384,38 @@ Attributes and CSS variables, by part:
|
|
|
2468
3384
|
|
|
2469
3385
|
- trigger: The button that shows the value and opens the list.
|
|
2470
3386
|
- `data-popup-open`: Present when the list is open.
|
|
3387
|
+
- `data-pressed`: Present while its popup is open: it stays pressed, as a button held down.
|
|
3388
|
+
- `data-popup-side="top | right | bottom | left | inline-start | inline-end | none"`: While the list is in the page: the side of the trigger it is on, after any flip; `none` when it lies over the trigger. Not said while it opens as a sheet.
|
|
2471
3389
|
- `data-placeholder`: Present while nothing is chosen.
|
|
2472
3390
|
- `data-disabled`: Present when it is disabled.
|
|
3391
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
3392
|
+
- `data-required`: Present when the form needs it.
|
|
3393
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3394
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3395
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3396
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3397
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3398
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2473
3399
|
- value: The chosen value's label, or the placeholder. With several values, their labels with commas between.
|
|
2474
3400
|
- `data-placeholder`: Present while nothing is chosen.
|
|
2475
|
-
-
|
|
3401
|
+
- backdrop: The layer over the page behind the list: a press on it closes the list.
|
|
3402
|
+
- `data-open`: Present when it is open.
|
|
3403
|
+
- `data-closed`: Present when it is closed.
|
|
3404
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
3405
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
3406
|
+
- `data-presentation="popup | sheet"`: How the list opened: placed against its trigger, or as a sheet from the bottom edge.
|
|
3407
|
+
- `data-swiping`: Present while the sheet is dragged.
|
|
3408
|
+
- `data-swipe-dismiss`: Present once a drag has closed it.
|
|
3409
|
+
- `--drawer-swipe-movement-x`: As a sheet: how far it has been dragged across, always 0px.
|
|
3410
|
+
- `--drawer-swipe-movement-y`: As a sheet: how far it has been dragged down.
|
|
3411
|
+
- `--drawer-swipe-progress`: As a sheet: how far it has been dragged, of its own height: 0 to 1.
|
|
3412
|
+
- positioner: Places the list against the trigger. It carries the geometry. As a sheet it is not placed, and carries none.
|
|
2476
3413
|
- `data-open`: Present when it is open.
|
|
2477
3414
|
- `data-closed`: Present when it is closed.
|
|
2478
3415
|
- `data-side="top | right | bottom | left | inline-start | inline-end | none"`: The side of the trigger it is on, after any flip; `none` when it lies over the trigger.
|
|
2479
3416
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
3417
|
+
- `data-presentation="popup | sheet"`: How the list opened: placed against its trigger, or as a sheet from the bottom edge.
|
|
3418
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
2480
3419
|
- `--anchor-width`: The anchor's width.
|
|
2481
3420
|
- `--anchor-height`: The anchor's height.
|
|
2482
3421
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
@@ -2494,13 +3433,20 @@ Attributes and CSS variables, by part:
|
|
|
2494
3433
|
- `data-side="top | right | bottom | left | inline-start | inline-end | none"`: The side of the trigger the list is on; `none` when it lies over the trigger.
|
|
2495
3434
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
2496
3435
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2497
|
-
- popup: The list of items.
|
|
3436
|
+
- popup: The list of items. As a sheet, a design moves it by what it says of the drag, and gives it `touch-action: none` where a finger drags it.
|
|
2498
3437
|
- `data-open`: Present when it is open.
|
|
2499
3438
|
- `data-closed`: Present when it is closed.
|
|
2500
3439
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
2501
3440
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2502
|
-
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the
|
|
3441
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end | none"`: The side of the trigger it is on, after any flip; `none` when it lies over the trigger.
|
|
2503
3442
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
3443
|
+
- `data-presentation="popup | sheet"`: How the list opened: placed against its trigger, or as a sheet from the bottom edge.
|
|
3444
|
+
- `data-swiping`: Present while the sheet is dragged.
|
|
3445
|
+
- `data-swipe-dismiss`: Present once a drag has closed it.
|
|
3446
|
+
- `--drawer-swipe-movement-x`: As a sheet: how far it has been dragged across, always 0px.
|
|
3447
|
+
- `--drawer-swipe-movement-y`: As a sheet: how far it has been dragged down.
|
|
3448
|
+
- `--drawer-swipe-progress`: As a sheet: how far it has been dragged, of its own height: 0 to 1.
|
|
3449
|
+
- `--drawer-swipe-strength`: As a sheet, once let go: 0.1 to 1, the share of the design's own time it should take to come to rest.
|
|
2504
3450
|
- item: One choice in the list.
|
|
2505
3451
|
- `data-selected`: Present on the chosen item, or on each of several.
|
|
2506
3452
|
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
@@ -2540,7 +3486,7 @@ Attributes and CSS variables, by part:
|
|
|
2540
3486
|
import "@kirana-ui/web/slider"
|
|
2541
3487
|
```
|
|
2542
3488
|
|
|
2543
|
-
`<kui-slider>`: `<kui-slider>` around `kui-part="root"`, a `value` (which says the value as it is written), a `control` with its `track`, `indicator` and a `thumb` for each value, in the values' order (or each with its `kui-index`). A thumb draws the hidden input a form reads. `value` and `default-value` (a range with a comma), `min`, `max`, `step`, `large-step`, `min-steps-between-values`, `thumb-alignment`, `orientation`, `disabled`, `name`, `form`, `locale`; it tells `value-change` and `value-committed`.
|
|
3489
|
+
`<kui-slider>`: `<kui-slider>` around `kui-part="root"`, a `value` (which says the value as it is written), a `control` with its `track`, `indicator` and a `thumb` for each value, in the values' order (or each with its `kui-index`). A thumb draws the hidden input a form reads. `value` and `default-value` (a range with a comma), `min`, `max`, `step`, `large-step`, `min-steps-between-values`, `thumb-alignment`, `orientation`, `disabled`, `read-only`, `name`, `form`, `locale`; it tells `value-change` and `value-committed`.
|
|
2544
3490
|
|
|
2545
3491
|
Attributes of the element (each also a property, in camel case):
|
|
2546
3492
|
|
|
@@ -2554,6 +3500,7 @@ Attributes of the element (each also a property, in camel case):
|
|
|
2554
3500
|
- `thumb-alignment` (string): Where a thumb is at the ends of its range. `"center"` (the default): its centre on the control's edge, so half of it lies outside. `"edge"`: its edge on the control's edge, so it stays inside. `"edge-client-only"` is the same here: nothing waits for the browser.
|
|
2555
3501
|
- `orientation` (string): Whether the track lies across (the default) or stands upright: the arrows that move a thumb follow.
|
|
2556
3502
|
- `disabled` (boolean): Disabled: it cannot be changed.
|
|
3503
|
+
- `read-only` (boolean): Shown as it is, focusable, not changeable: no key and no pointer moves a thumb, and its value is still submitted with the form.
|
|
2557
3504
|
- `name` (string): With a name, each thumb's value is submitted with the form around the slider.
|
|
2558
3505
|
- `form` (string): The id of the form the control belongs to, when it is not inside it.
|
|
2559
3506
|
- `locale` (string): The language a value is written in; the page's by default.
|
|
@@ -2594,32 +3541,163 @@ Attributes and CSS variables, by part:
|
|
|
2594
3541
|
- root: Groups the slider's parts.
|
|
2595
3542
|
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
2596
3543
|
- `data-disabled`: Present when it is disabled.
|
|
3544
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
2597
3545
|
- `data-dragging`: Present while a pointer holds a thumb.
|
|
3546
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3547
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3548
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3549
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3550
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3551
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2598
3552
|
- value: The value, written.
|
|
2599
3553
|
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
2600
3554
|
- `data-disabled`: Present when it is disabled.
|
|
3555
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
2601
3556
|
- `data-dragging`: Present while a pointer holds a thumb.
|
|
3557
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3558
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3559
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3560
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3561
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3562
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2602
3563
|
- control: What a pointer presses and drags on. It holds the track and the thumbs.
|
|
2603
3564
|
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
2604
3565
|
- `data-disabled`: Present when it is disabled.
|
|
3566
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
2605
3567
|
- `data-dragging`: Present while a pointer holds a thumb.
|
|
3568
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3569
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3570
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3571
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3572
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3573
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2606
3574
|
- track: The whole range.
|
|
2607
3575
|
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
2608
3576
|
- `data-disabled`: Present when it is disabled.
|
|
3577
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
2609
3578
|
- `data-dragging`: Present while a pointer holds a thumb.
|
|
3579
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3580
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3581
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3582
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3583
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3584
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2610
3585
|
- indicator: The filled part: up to the thumb, or from the first thumb to the last. Its place and length are written on it.
|
|
2611
3586
|
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
2612
3587
|
- `data-disabled`: Present when it is disabled.
|
|
3588
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
2613
3589
|
- `data-dragging`: Present while a pointer holds a thumb.
|
|
3590
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3591
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3592
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3593
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3594
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3595
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2614
3596
|
- `--start-position`: With thumbs that stay inside the control: where the filled part starts, or with one thumb where it ends.
|
|
2615
3597
|
- `--relative-size`: With thumbs that stay inside the control and a range: the filled part's length.
|
|
2616
3598
|
- thumb: What is dragged, and what the keyboard moves: a slider to assistive technology. Its place on the track is written on it. It holds a hidden input, which a form reads. A thumb that is given no `index` is the value at its place among the slider's thumbs, in the order they are written.
|
|
2617
3599
|
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
2618
3600
|
- `data-disabled`: Present when it is disabled.
|
|
3601
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
2619
3602
|
- `data-dragging`: Present while a pointer holds a thumb.
|
|
3603
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3604
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3605
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3606
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3607
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3608
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2620
3609
|
- `data-index`: Which thumb it is, from 0.
|
|
2621
3610
|
- `--position`: With thumbs that stay inside the control: where the thumb's centre is.
|
|
2622
3611
|
|
|
3612
|
+
### Steps
|
|
3613
|
+
|
|
3614
|
+
```
|
|
3615
|
+
import "@kirana-ui/web/steps"
|
|
3616
|
+
```
|
|
3617
|
+
|
|
3618
|
+
`<kui-steps>`: `<kui-steps>` around `kui-part="root"`, a `list` with an `item` for each step (`kui-index`, from 0, or its place in the page when it has none) holding its `trigger` (with an `indicator` inside) and a `separator`, a `content` for each step (`kui-index`), a `completed`, and `previous` and `next` buttons. `step`, `default-step`, `count` (the items in the page when it is left out), `linear`, `orientation`; it tells `step-change`.
|
|
3619
|
+
|
|
3620
|
+
Attributes of the element (each also a property, in camel case):
|
|
3621
|
+
|
|
3622
|
+
- `step` (number): The step shown, from 0. Equal to `count`, every step is done.
|
|
3623
|
+
- `default-step` (number): The step it starts at, when the caller does not hold `step`. Read once.
|
|
3624
|
+
- `count` (number): How many steps there are. Left out, the items in the page, counted once they are there: until then (and on a server) no step is the last, so none is all done. Give it where only some of the steps are drawn.
|
|
3625
|
+
- `linear` (boolean): In order only: a step that is not done yet cannot be gone to by its trigger.
|
|
3626
|
+
- `orientation` (string): Whether the steps are laid out across (the default) or down: the arrows follow.
|
|
3627
|
+
|
|
3628
|
+
Events:
|
|
3629
|
+
|
|
3630
|
+
- `step-change`: `event.detail.step`, with `event.detail.details`. `preventDefault()` keeps `step` as it was.
|
|
3631
|
+
|
|
3632
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
3633
|
+
|
|
3634
|
+
- `root`
|
|
3635
|
+
- `list`
|
|
3636
|
+
- `item`: `kui-index`
|
|
3637
|
+
- `trigger`: `kui-index`
|
|
3638
|
+
- `indicator`: `kui-index`
|
|
3639
|
+
- `separator`: `kui-index`
|
|
3640
|
+
- `content`: `kui-index`
|
|
3641
|
+
- `completed`
|
|
3642
|
+
- `previous`
|
|
3643
|
+
- `next`
|
|
3644
|
+
|
|
3645
|
+
Anatomy:
|
|
3646
|
+
|
|
3647
|
+
```
|
|
3648
|
+
<kui-steps>
|
|
3649
|
+
root
|
|
3650
|
+
list
|
|
3651
|
+
item (repeated)
|
|
3652
|
+
trigger
|
|
3653
|
+
indicator (optional)
|
|
3654
|
+
separator (optional)
|
|
3655
|
+
content (repeated)
|
|
3656
|
+
completed (optional)
|
|
3657
|
+
previous (optional)
|
|
3658
|
+
next (optional)
|
|
3659
|
+
```
|
|
3660
|
+
|
|
3661
|
+
Attributes and CSS variables, by part:
|
|
3662
|
+
|
|
3663
|
+
- root: A task in steps, taken in order.
|
|
3664
|
+
- `data-orientation="horizontal | vertical"`: Whether the steps are laid out across or down.
|
|
3665
|
+
- `data-complete`: Present once every step is done.
|
|
3666
|
+
- list: The row of steps: the arrows move between their triggers.
|
|
3667
|
+
- `data-orientation="horizontal | vertical"`: Whether the steps are laid out across or down.
|
|
3668
|
+
- item: One step of the row, around its trigger and its separator.
|
|
3669
|
+
- `data-current`: Present on the step that is shown.
|
|
3670
|
+
- `data-complete`: Present on a step that is done: one before the step shown.
|
|
3671
|
+
- `data-incomplete`: Present on a step still to come.
|
|
3672
|
+
- `data-orientation="horizontal | vertical"`: Whether the steps are laid out across or down.
|
|
3673
|
+
- trigger: Names a step, and goes to it when pressed.
|
|
3674
|
+
- `data-current`: Present on the step that is shown.
|
|
3675
|
+
- `data-complete`: Present on a step that is done: one before the step shown.
|
|
3676
|
+
- `data-incomplete`: Present on a step still to come.
|
|
3677
|
+
- `data-orientation="horizontal | vertical"`: Whether the steps are laid out across or down.
|
|
3678
|
+
- `data-disabled`: Present when it is disabled.
|
|
3679
|
+
- indicator: A step's mark: its number, or a tick once it is done.
|
|
3680
|
+
- `data-current`: Present on the step that is shown.
|
|
3681
|
+
- `data-complete`: Present on a step that is done: one before the step shown.
|
|
3682
|
+
- `data-incomplete`: Present on a step still to come.
|
|
3683
|
+
- `data-orientation="horizontal | vertical"`: Whether the steps are laid out across or down.
|
|
3684
|
+
- separator: The line from a step to the next.
|
|
3685
|
+
- `data-current`: Present on the step that is shown.
|
|
3686
|
+
- `data-complete`: Present on a step that is done: one before the step shown.
|
|
3687
|
+
- `data-incomplete`: Present on a step still to come.
|
|
3688
|
+
- `data-orientation="horizontal | vertical"`: Whether the steps are laid out across or down.
|
|
3689
|
+
- content: What a step shows: hidden unless its step is the one shown.
|
|
3690
|
+
- `data-current`: Present on the step that is shown.
|
|
3691
|
+
- `data-complete`: Present on a step that is done: one before the step shown.
|
|
3692
|
+
- `data-incomplete`: Present on a step still to come.
|
|
3693
|
+
- `data-orientation="horizontal | vertical"`: Whether the steps are laid out across or down.
|
|
3694
|
+
- completed: What is shown once every step is done.
|
|
3695
|
+
- `data-orientation="horizontal | vertical"`: Whether the steps are laid out across or down.
|
|
3696
|
+
- previous: Goes to the step before.
|
|
3697
|
+
- `data-disabled`: Present when it is disabled.
|
|
3698
|
+
- next: Goes to the step after; from the last, to all of them done.
|
|
3699
|
+
- `data-disabled`: Present when it is disabled.
|
|
3700
|
+
|
|
2623
3701
|
### Switch
|
|
2624
3702
|
|
|
2625
3703
|
```
|
|
@@ -2638,6 +3716,7 @@ Attributes of the element (each also a property, in camel case):
|
|
|
2638
3716
|
- `name` (string): With a name, the control is submitted with the form around it when it is checked.
|
|
2639
3717
|
- `form` (string): The id of the form the control belongs to, when it is not inside it.
|
|
2640
3718
|
- `value` (string): What is submitted. Default `"on"`, as a native checkbox's.
|
|
3719
|
+
- `kui-id` (string): The id of the switch's hidden native checkbox, not of the switch: a `<label for>` names it. Inside a `Field`, that input takes the field's id instead.
|
|
2641
3720
|
|
|
2642
3721
|
Events:
|
|
2643
3722
|
|
|
@@ -2664,12 +3743,24 @@ Attributes and CSS variables, by part:
|
|
|
2664
3743
|
- `data-disabled`: Present when it is disabled.
|
|
2665
3744
|
- `data-readonly`: Present when it can be read but not changed.
|
|
2666
3745
|
- `data-required`: Present when the form needs it.
|
|
3746
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3747
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3748
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3749
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3750
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3751
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2667
3752
|
- thumb: The knob that moves along the track.
|
|
2668
3753
|
- `data-checked`: Present when it is checked.
|
|
2669
3754
|
- `data-unchecked`: Present when it is not checked.
|
|
2670
3755
|
- `data-disabled`: Present when it is disabled.
|
|
2671
3756
|
- `data-readonly`: Present when it can be read but not changed.
|
|
2672
3757
|
- `data-required`: Present when the form needs it.
|
|
3758
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3759
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3760
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3761
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3762
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3763
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2673
3764
|
|
|
2674
3765
|
### Tabs
|
|
2675
3766
|
|
|
@@ -2720,6 +3811,7 @@ Attributes and CSS variables, by part:
|
|
|
2720
3811
|
- `data-active`: Present on the tab whose panel is shown.
|
|
2721
3812
|
- `data-disabled`: Present when it is disabled.
|
|
2722
3813
|
- `data-orientation="horizontal | vertical"`: The way the tabs are laid out.
|
|
3814
|
+
- `data-activation-direction="left | right | up | down | none"`: Where the newly active tab is from the one before, for a panel or a mark that slides.
|
|
2723
3815
|
- indicator: A mark for the active tab: it carries that tab's position and size.
|
|
2724
3816
|
- `data-orientation="horizontal | vertical"`: The way the tabs are laid out.
|
|
2725
3817
|
- `data-activation-direction="left | right | up | down | none"`: Where the newly active tab is from the one before, for a panel or a mark that slides.
|
|
@@ -2731,24 +3823,195 @@ Attributes and CSS variables, by part:
|
|
|
2731
3823
|
- `--active-tab-height`: The active tab's height.
|
|
2732
3824
|
- panel: A tab's content. In the page while its tab is active, and through its exit.
|
|
2733
3825
|
- `data-hidden`: Present while its tab is not the active one.
|
|
3826
|
+
- `data-index`: The panel's place among the panels in the page, from 0, once it is in the page.
|
|
2734
3827
|
- `data-orientation="horizontal | vertical"`: The way the tabs are laid out.
|
|
2735
3828
|
- `data-activation-direction="left | right | up | down | none"`: Where the newly active tab is from the one before, for a panel or a mark that slides.
|
|
2736
3829
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
2737
3830
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2738
3831
|
|
|
3832
|
+
### TagsInput
|
|
3833
|
+
|
|
3834
|
+
```
|
|
3835
|
+
import "@kirana-ui/web/tags-input"
|
|
3836
|
+
```
|
|
3837
|
+
|
|
3838
|
+
`<kui-tags-input>`: `<kui-tags-input>` around `kui-part="root"`, which holds a `list` with a `<template kui-each="items">` for a tag (`{value}` is its text, `{index}` its place): an `item` holding its `item-text`, which says the tag unless the page wrote something, and optionally an `item-input` to edit it in place and an `item-remove` button. Beside the list, the `input` a new tag is typed in and a `clear` button. The root draws the hidden inputs a form reads, as its last children. `value` and `default-value` (with commas between), `max`, `allow-duplicates`, `delimiter`, `add-on-blur`, `add-on-paste`, `editable`, `disabled`, `read-only`, `required`, `name`, `form`; `validate`, and `delimiter` when it is a pattern, as properties. It tells `value-change`, and `value-invalid` (`detail.text`, `detail.reason`) for a text that was not made a tag.
|
|
3839
|
+
|
|
3840
|
+
Attributes of the element (each also a property, in camel case):
|
|
3841
|
+
|
|
3842
|
+
- `value` (string): The tags, in order.
|
|
3843
|
+
- `default-value` (string): The tags it starts with, when the caller does not hold `value`. Read once.
|
|
3844
|
+
- `max` (number): How many tags it holds at most.
|
|
3845
|
+
- `allow-duplicates` (boolean): Whether the same text may be a tag twice. Default `false`.
|
|
3846
|
+
- `delimiter` (string): What ends a tag as it is typed or pasted, beside Enter. Default `","`. `null` for nothing.
|
|
3847
|
+
- `add-on-blur` (boolean): Whether what is typed becomes a tag as focus leaves the input. Default `false`.
|
|
3848
|
+
- `add-on-paste` (boolean): Whether a pasted text is cut into tags at its delimiters and line ends. Default `true`.
|
|
3849
|
+
- `editable` (boolean): Whether a tag can be edited in place, by two presses or Enter on it. Default `true`.
|
|
3850
|
+
- `disabled` (boolean): Disabled: nothing can be added or taken away.
|
|
3851
|
+
- `read-only` (boolean): Shown as they are, focusable, not changeable.
|
|
3852
|
+
- `required` (boolean): Needed: in a `Field`, holding none is then invalid.
|
|
3853
|
+
- `name` (string): With a name, each tag is submitted under it with the form around them.
|
|
3854
|
+
- `form` (string): The id of the form the control belongs to, when it is not inside it.
|
|
3855
|
+
|
|
3856
|
+
Properties only:
|
|
3857
|
+
|
|
3858
|
+
- `validate`: Whether a text may be a tag. Asked after the text is trimmed, and not for an empty one.
|
|
3859
|
+
|
|
3860
|
+
Events:
|
|
3861
|
+
|
|
3862
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
3863
|
+
|
|
3864
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
3865
|
+
|
|
3866
|
+
- `root`
|
|
3867
|
+
- `list`
|
|
3868
|
+
- `item`
|
|
3869
|
+
- `item-text`
|
|
3870
|
+
- `item-input`
|
|
3871
|
+
- `item-remove`
|
|
3872
|
+
- `input`
|
|
3873
|
+
- `clear`
|
|
3874
|
+
|
|
3875
|
+
Lists (`<template kui-each="…">`): `items`.
|
|
3876
|
+
|
|
3877
|
+
Anatomy:
|
|
3878
|
+
|
|
3879
|
+
```
|
|
3880
|
+
<kui-tags-input>
|
|
3881
|
+
root
|
|
3882
|
+
list
|
|
3883
|
+
<template kui-each="items">
|
|
3884
|
+
item (repeated)
|
|
3885
|
+
item-text
|
|
3886
|
+
item-input (optional)
|
|
3887
|
+
item-remove (optional)
|
|
3888
|
+
input
|
|
3889
|
+
clear (optional)
|
|
3890
|
+
```
|
|
3891
|
+
|
|
3892
|
+
Attributes and CSS variables, by part:
|
|
3893
|
+
|
|
3894
|
+
- root: Several short texts held as tags, and the input a new one is typed in. It holds the hidden inputs a form reads.
|
|
3895
|
+
- `data-disabled`: Present when it is disabled.
|
|
3896
|
+
- `data-readonly`: Present when the tags are shown and cannot be changed.
|
|
3897
|
+
- `data-required`: Present when a tag is needed.
|
|
3898
|
+
- `data-focused`: Present while focus is on a tag or in the input.
|
|
3899
|
+
- `data-empty`: Present while it holds no tag.
|
|
3900
|
+
- list: What holds the tags: a list.
|
|
3901
|
+
- `data-disabled`: Present when it is disabled.
|
|
3902
|
+
- `data-readonly`: Present when the tags are shown and cannot be changed.
|
|
3903
|
+
- `data-required`: Present when a tag is needed.
|
|
3904
|
+
- item: A tag: reached with the arrows, taken away with Backspace or Delete.
|
|
3905
|
+
- `data-disabled`: Present when it is disabled.
|
|
3906
|
+
- `data-readonly`: Present when the tags are shown and cannot be changed.
|
|
3907
|
+
- `data-required`: Present when a tag is needed.
|
|
3908
|
+
- `data-editing`: Present while the tag is edited.
|
|
3909
|
+
- itemText: A tag's text: hidden while the tag is edited.
|
|
3910
|
+
- `data-disabled`: Present when it is disabled.
|
|
3911
|
+
- `data-readonly`: Present when the tags are shown and cannot be changed.
|
|
3912
|
+
- `data-required`: Present when a tag is needed.
|
|
3913
|
+
- itemInput: Where a tag is edited in place: hidden unless it is being edited.
|
|
3914
|
+
- `data-disabled`: Present when it is disabled.
|
|
3915
|
+
- `data-readonly`: Present when the tags are shown and cannot be changed.
|
|
3916
|
+
- `data-required`: Present when a tag is needed.
|
|
3917
|
+
- itemRemove: A tag's button that takes it away.
|
|
3918
|
+
- `data-disabled`: Present when it is disabled.
|
|
3919
|
+
- `data-readonly`: Present when the tags are shown and cannot be changed.
|
|
3920
|
+
- `data-required`: Present when a tag is needed.
|
|
3921
|
+
- input: Where a new tag is typed. In a `Field` it is what the field's label names.
|
|
3922
|
+
- `data-disabled`: Present when it is disabled.
|
|
3923
|
+
- `data-readonly`: Present when the tags are shown and cannot be changed.
|
|
3924
|
+
- `data-required`: Present when a tag is needed.
|
|
3925
|
+
- clear: Takes every tag away: hidden while there is none.
|
|
3926
|
+
- `data-disabled`: Present when it is disabled.
|
|
3927
|
+
- `data-readonly`: Present when the tags are shown and cannot be changed.
|
|
3928
|
+
- `data-required`: Present when a tag is needed.
|
|
3929
|
+
|
|
3930
|
+
### TimeField
|
|
3931
|
+
|
|
3932
|
+
```
|
|
3933
|
+
import "@kirana-ui/web/time-field"
|
|
3934
|
+
```
|
|
3935
|
+
|
|
3936
|
+
`<kui-time-field>`: `<kui-time-field>` around `kui-part="root"`, which holds a `<template kui-each="segments">` with the `segment` each part of the time is typed in (`{type}` and `{index}` say which), and the hidden `input` a form reads. `value`, `default-value`, `granularity`, `hour-cycle`, `locale`, `min`, `max`, `disabled`, `read-only`, `required`, `name`, `form`; `placeholders` as a property; it tells `value-change`. Inside a `<kui-field>` it is the field's control.
|
|
3937
|
+
|
|
3938
|
+
Attributes of the element (each also a property, in camel case):
|
|
3939
|
+
|
|
3940
|
+
- `value` (string): The time typed, once all of it is; `null` until then.
|
|
3941
|
+
- `default-value` (string): The value it starts with, when the caller does not hold `value`. Read once.
|
|
3942
|
+
- `granularity` (string): To the minute (`HH:MM`, the default) or to the second (`HH:MM:SS`).
|
|
3943
|
+
- `hour-cycle` (number): A clock of 12 or 24 hours, whatever the locale's is.
|
|
3944
|
+
- `locale` (string): The language and region that order the parts, put what stands between them and say whether the clock has twelve hours or twenty-four (`"en-US"`: 12, with AM and PM). Give it: a server does not know the reader's.
|
|
3945
|
+
- `min` (string): The first time it takes: before it, it says it is invalid.
|
|
3946
|
+
- `max` (string): The last time it takes.
|
|
3947
|
+
- `disabled` (boolean): Disabled: it cannot be changed.
|
|
3948
|
+
- `read-only` (boolean): Shown as it is, focusable, not changeable.
|
|
3949
|
+
- `required` (boolean): Needed: in a `Field`, leaving it empty is then invalid.
|
|
3950
|
+
- `name` (string): The name it is submitted under, by its hidden input; in a `Field`, the field's by default.
|
|
3951
|
+
- `form` (string): The id of the form it belongs to, when it is not inside it.
|
|
3952
|
+
|
|
3953
|
+
Properties only:
|
|
3954
|
+
|
|
3955
|
+
- `placeholders`: What an empty part shows. Default: `hh`, `mm`, `ss`, and `--` for the day period.
|
|
3956
|
+
|
|
3957
|
+
Events:
|
|
3958
|
+
|
|
3959
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
3960
|
+
|
|
3961
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
3962
|
+
|
|
3963
|
+
- `root`
|
|
3964
|
+
- `segment`
|
|
3965
|
+
- `input`
|
|
3966
|
+
|
|
3967
|
+
Lists (`<template kui-each="…">`): `segments`.
|
|
3968
|
+
|
|
3969
|
+
Anatomy:
|
|
3970
|
+
|
|
3971
|
+
```
|
|
3972
|
+
<kui-time-field>
|
|
3973
|
+
root
|
|
3974
|
+
<template kui-each="segments">
|
|
3975
|
+
segment (repeated)
|
|
3976
|
+
input
|
|
3977
|
+
```
|
|
3978
|
+
|
|
3979
|
+
Attributes and CSS variables, by part:
|
|
3980
|
+
|
|
3981
|
+
- root: The field: a group of the time's parts.
|
|
3982
|
+
- `data-disabled`: Present when it is disabled.
|
|
3983
|
+
- `data-readonly`: Present when its value cannot be changed.
|
|
3984
|
+
- `data-invalid`: Present when the time is outside what it takes, is asked for and half typed, or is wrong by its field.
|
|
3985
|
+
- `data-touched`: In a field: present once focus has left it.
|
|
3986
|
+
- `data-dirty`: In a field: present while the time is not the one it began with.
|
|
3987
|
+
- `data-filled`: In a field: present while it holds a time.
|
|
3988
|
+
- `data-focused`: In a field: present while one of its parts has focus.
|
|
3989
|
+
- `data-valid`: In a field: present once the time was checked and found right.
|
|
3990
|
+
- segment: One piece of the time: a part that is typed, or what stands between two.
|
|
3991
|
+
- `data-segment="hour | minute | second | dayPeriod | literal"`: Which piece it is: `dayPeriod` is AM or PM, on a clock of twelve hours.
|
|
3992
|
+
- `data-placeholder`: Present on a part that is empty.
|
|
3993
|
+
- `data-disabled`: Present when it is disabled.
|
|
3994
|
+
- `data-invalid`: Present when the time is outside what it takes, is asked for and half typed, or is wrong by its field.
|
|
3995
|
+
- `data-touched`: In a field: present once focus has left it.
|
|
3996
|
+
- `data-dirty`: In a field: present while the time is not the one it began with.
|
|
3997
|
+
- `data-filled`: In a field: present while it holds a time.
|
|
3998
|
+
- `data-focused`: In a field: present while one of its parts has focus.
|
|
3999
|
+
- `data-valid`: In a field: present once the time was checked and found right.
|
|
4000
|
+
|
|
2739
4001
|
### Toast
|
|
2740
4002
|
|
|
2741
4003
|
```
|
|
2742
4004
|
import "@kirana-ui/web/toast"
|
|
2743
4005
|
```
|
|
2744
4006
|
|
|
2745
|
-
`<kui-toast>`: `<kui-toast>` around a `kui-part="viewport"`, which holds a `<template kui-each="toasts">` with a `toast` for each message (`{id}`, `{type}`), its `content` with a `title` and a `description`, and a `close` and an `action` button. A `title`, a `description` and an `action` written empty say what the toast was added with, and are in the page only for a toast that has one; one written with something in it (`{title}`) is always there. `label`, `hotkey`, `swipe-direction`; `
|
|
4007
|
+
`<kui-toast>`: `<kui-toast>` around a `kui-part="viewport"`, which holds a `<template kui-each="toasts">` with a `toast` for each message (`{id}`, `{type}`), its `content` with a `title` and a `description`, and a `close` and an `action` button. A `title`, a `description` and an `action` written empty say what the toast was added with, and are in the page only for a toast that has one; one written with something in it (`{title}`) is always there. `label`, `hotkey`, `swipe-direction`; `timeout` (`duration`, its old name) and `limit` for the toaster it makes, or `toaster` as a property for one of the page's own. A title, a description and an action's label are strings.
|
|
2746
4008
|
|
|
2747
4009
|
Attributes of the element (each also a property, in camel case):
|
|
2748
4010
|
|
|
2749
4011
|
- `label` (string)
|
|
2750
4012
|
- `hotkey` (string)
|
|
2751
4013
|
- `swipe-direction` (string)
|
|
4014
|
+
- `timeout` (number)
|
|
2752
4015
|
- `duration` (number)
|
|
2753
4016
|
- `limit` (number)
|
|
2754
4017
|
|
|
@@ -2803,6 +4066,14 @@ Attributes and CSS variables, by part:
|
|
|
2803
4066
|
- content: What holds a toast's contents, when the design sizes the toast itself.
|
|
2804
4067
|
- `data-behind`: Present on a toast that is behind the newest.
|
|
2805
4068
|
- `data-expanded`: Present while the pointer or focus is on the stack: the toasts are spread out, and wait.
|
|
4069
|
+
- title: What the toast is called: the title it was added with, when nothing else is written in it.
|
|
4070
|
+
- `data-type`: The kind the toast was added as.
|
|
4071
|
+
- description: What the toast says: the description it was added with, when nothing else is written in it.
|
|
4072
|
+
- `data-type`: The kind the toast was added as.
|
|
4073
|
+
- close: Closes the toast.
|
|
4074
|
+
- `data-type`: The kind the toast was added as.
|
|
4075
|
+
- action: A button of the toast's own: the action it was added with, when nothing else is written in it. Pressing it closes the toast too, unless the action refuses.
|
|
4076
|
+
- `data-type`: The kind the toast was added as.
|
|
2806
4077
|
|
|
2807
4078
|
### Toggle
|
|
2808
4079
|
|
|
@@ -2846,7 +4117,7 @@ Attributes and CSS variables, by part:
|
|
|
2846
4117
|
import "@kirana-ui/web/toggle-group"
|
|
2847
4118
|
```
|
|
2848
4119
|
|
|
2849
|
-
`<kui-toggle-group>`: `<kui-toggle-group>` around `kui-part="root"` and its `<kui-toggle>`s, each with a `value`. `value` and `default-value` (the pressed ones, with commas between), `multiple`, `disabled`, `orientation`, `loop
|
|
4120
|
+
`<kui-toggle-group>`: `<kui-toggle-group>` around `kui-part="root"` and its `<kui-toggle>`s, each with a `value`. `value` and `default-value` (the pressed ones, with commas between), `multiple`, `disabled`, `orientation`, `loop-focus` (`loop` is its older name); it tells `value-change`.
|
|
2850
4121
|
|
|
2851
4122
|
Attributes of the element (each also a property, in camel case):
|
|
2852
4123
|
|
|
@@ -2855,7 +4126,8 @@ Attributes of the element (each also a property, in camel case):
|
|
|
2855
4126
|
- `multiple` (boolean): Whether more than one can be pressed at a time.
|
|
2856
4127
|
- `disabled` (boolean): Disables every toggle of the group.
|
|
2857
4128
|
- `orientation` (string): Whether the toggles are laid out across (the default) or down: the arrows that move between them follow.
|
|
2858
|
-
- `loop` (boolean): Whether the arrows go round from the last toggle to the first. Default: they do.
|
|
4129
|
+
- `loop-focus` (boolean): Whether the arrows go round from the last toggle to the first. Default: they do.
|
|
4130
|
+
- `loop` (boolean): Whether the arrows wrap from the last item to the first.
|
|
2859
4131
|
|
|
2860
4132
|
Events:
|
|
2861
4133
|
|
|
@@ -2885,19 +4157,20 @@ Attributes and CSS variables, by part:
|
|
|
2885
4157
|
import "@kirana-ui/web/toolbar"
|
|
2886
4158
|
```
|
|
2887
4159
|
|
|
2888
|
-
`<kui-toolbar
|
|
4160
|
+
`<kui-toolbar>`
|
|
2889
4161
|
|
|
2890
4162
|
Attributes of the element (each also a property, in camel case):
|
|
2891
4163
|
|
|
2892
4164
|
- `orientation` (string): Whether the controls are laid out across (the default) or down: the arrows that move between them follow.
|
|
2893
|
-
- `loop` (boolean): Whether the arrows go round from the last item to the first. Default: they do.
|
|
4165
|
+
- `loop-focus` (boolean): Whether the arrows go round from the last item to the first. Default: they do.
|
|
4166
|
+
- `loop` (boolean): Whether the arrows wrap from the last item to the first.
|
|
2894
4167
|
- `disabled` (boolean): Disables every control of the toolbar.
|
|
2895
4168
|
|
|
2896
4169
|
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2897
4170
|
|
|
2898
4171
|
- `root`
|
|
2899
|
-
- `button`: `kui-disabled`, `kui-label`
|
|
2900
|
-
- `input`: `kui-disabled`, `kui-label`
|
|
4172
|
+
- `button`: `kui-disabled`, `kui-focusable-when-disabled`, `kui-label`
|
|
4173
|
+
- `input`: `kui-disabled`, `kui-focusable-when-disabled`, `kui-label`
|
|
2901
4174
|
- `group`: `kui-disabled`, `kui-label`
|
|
2902
4175
|
- `link`
|
|
2903
4176
|
- `separator`
|
|
@@ -2922,12 +4195,14 @@ Attributes and CSS variables, by part:
|
|
|
2922
4195
|
- button: A button of the toolbar.
|
|
2923
4196
|
- `data-orientation="horizontal | vertical"`: Whether the toolbar is a row or a column.
|
|
2924
4197
|
- `data-disabled`: Present when it is disabled.
|
|
4198
|
+
- `data-focusable`: Present when it stays focusable while disabled: the arrows still reach it.
|
|
2925
4199
|
- link: A link of the toolbar.
|
|
2926
4200
|
- `data-orientation="horizontal | vertical"`: Whether the toolbar is a row or a column.
|
|
2927
4201
|
- `data-disabled`: Present when it is disabled.
|
|
2928
4202
|
- input: A text input of the toolbar. The arrows are its own until the caret is at an end.
|
|
2929
4203
|
- `data-orientation="horizontal | vertical"`: Whether the toolbar is a row or a column.
|
|
2930
4204
|
- `data-disabled`: Present when it is disabled.
|
|
4205
|
+
- `data-focusable`: Present when it stays focusable while disabled: the arrows still reach it.
|
|
2931
4206
|
- group: Items that belong together.
|
|
2932
4207
|
- `data-orientation="horizontal | vertical"`: Whether the toolbar is a row or a column.
|
|
2933
4208
|
- `data-disabled`: Present when it is disabled.
|
|
@@ -2957,7 +4232,7 @@ Events:
|
|
|
2957
4232
|
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2958
4233
|
|
|
2959
4234
|
- `trigger`: `kui-close-delay`, `kui-delay`
|
|
2960
|
-
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-collision-padding`, `kui-side`, `kui-side-offset`
|
|
4235
|
+
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-arrow-padding`, `kui-collision-boundary`, `kui-collision-padding`, `kui-position-method`, `kui-side`, `kui-side-offset`, `kui-sticky`
|
|
2961
4236
|
- `popup`
|
|
2962
4237
|
- `arrow`
|
|
2963
4238
|
|
|
@@ -2976,16 +4251,20 @@ Attributes and CSS variables, by part:
|
|
|
2976
4251
|
|
|
2977
4252
|
- trigger: The element the tooltip describes.
|
|
2978
4253
|
- `data-popup-open`: Present when the tooltip is open.
|
|
4254
|
+
- `data-trigger-disabled`: Present when the tooltip is disabled: the pointer and focus on the trigger do not open it.
|
|
2979
4255
|
- positioner: Places the popup against the trigger. It carries the geometry.
|
|
2980
4256
|
- `data-open`: Present when it is open.
|
|
2981
4257
|
- `data-closed`: Present when it is closed.
|
|
2982
4258
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
2983
4259
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
4260
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
2984
4261
|
- `--anchor-width`: The anchor's width.
|
|
2985
4262
|
- `--anchor-height`: The anchor's height.
|
|
2986
4263
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
2987
4264
|
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
2988
4265
|
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
4266
|
+
- `--positioner-width`: The popup's width, as its content lays it out: a design gives the positioner `width: var(--positioner-width)` to animate a change of size.
|
|
4267
|
+
- `--positioner-height`: The popup's height, as its content lays it out: a design gives the positioner `height: var(--positioner-height)` to animate a change of size.
|
|
2989
4268
|
- popup: The tooltip itself.
|
|
2990
4269
|
- `data-open`: Present when it is open.
|
|
2991
4270
|
- `data-closed`: Present when it is closed.
|
|
@@ -2995,6 +4274,182 @@ Attributes and CSS variables, by part:
|
|
|
2995
4274
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2996
4275
|
- `data-instant="delay | focus | dismiss"`: Present when it opened or closed without its usual wait, for a design that skips the motion then.
|
|
2997
4276
|
- arrow: An element that points at the trigger, placed along the popup's edge.
|
|
4277
|
+
- `data-open`: Present when it is open.
|
|
4278
|
+
- `data-closed`: Present when it is closed.
|
|
2998
4279
|
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
2999
4280
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
4281
|
+
- `data-instant="delay | focus | dismiss"`: Present when it opened or closed without its usual wait, for a design that skips the motion then.
|
|
3000
4282
|
- `data-uncentered`: Present when the popup was pushed along its edge, so the arrow is not at the trigger's centre.
|
|
4283
|
+
|
|
4284
|
+
### Tour
|
|
4285
|
+
|
|
4286
|
+
```
|
|
4287
|
+
import "@kirana-ui/web/tour"
|
|
4288
|
+
```
|
|
4289
|
+
|
|
4290
|
+
`<kui-tour>`: `<kui-tour>` around a `kui-part="portal"`, drawn at the end of the page while a step is shown, which holds a `spotlight` and a `positioner` (`kui-side`, `kui-align`, `kui-side-offset` and the like) around the `popup`, with an `arrow`, a `title`, a `description`, and `previous`, `next` and `close` buttons. What a step says is the page's to write: its `controller` has the step shown (`shown`), its place (`current`) and how many there are (`total`). `steps` as a property; `open`, `default-open`, `step`, `default-step`, `wait-for-target`, `spotlight-padding`, `close-on-outside-press`, `interactive`, `keyboard-navigation`; it tells `open-change` and `step-change`.
|
|
4291
|
+
|
|
4292
|
+
Attributes of the element (each also a property, in camel case):
|
|
4293
|
+
|
|
4294
|
+
- `open` (boolean): Whether it is open, when the caller holds it.
|
|
4295
|
+
- `default-open` (boolean): Whether it starts open, when the caller does not hold `open`. Read once.
|
|
4296
|
+
- `step` (number): The index of the step shown, from 0, when the caller holds it.
|
|
4297
|
+
- `default-step` (number): The step it starts at, when the caller does not hold `step`. Read once. Default 0.
|
|
4298
|
+
- `wait-for-target` (number): How long a step whose target is not in the page waits for it, in milliseconds, before it is shown in the middle of the viewport. Default 1000.
|
|
4299
|
+
- `spotlight-padding` (number): The room between the target and the edge of the spotlight's hole, in pixels. Default 4.
|
|
4300
|
+
- `close-on-outside-press` (boolean): Whether a press on the dimmed page ends the tour. Default `false`.
|
|
4301
|
+
- `interactive` (boolean): Whether the target can be used while its step is shown: pressed, focused, typed in. Default `false`: the target is seen, not used, and the rest of the page is inert either way.
|
|
4302
|
+
- `keyboard-navigation` (boolean): Whether ArrowRight and ArrowLeft go on and back a step. Default `true`.
|
|
4303
|
+
|
|
4304
|
+
Properties only:
|
|
4305
|
+
|
|
4306
|
+
- `steps`: The steps, in order.
|
|
4307
|
+
|
|
4308
|
+
Events:
|
|
4309
|
+
|
|
4310
|
+
- `open-change`: `event.detail.open`, with `event.detail.details`. `preventDefault()` keeps `open` as it was.
|
|
4311
|
+
- `step-change`: `event.detail.step`, with `event.detail.details`. `preventDefault()` keeps `step` as it was.
|
|
4312
|
+
|
|
4313
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
4314
|
+
|
|
4315
|
+
- `spotlight`
|
|
4316
|
+
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-arrow-padding`, `kui-collision-boundary`, `kui-collision-padding`, `kui-position-method`, `kui-side`, `kui-side-offset`, `kui-sticky`
|
|
4317
|
+
- `popup`
|
|
4318
|
+
- `arrow`
|
|
4319
|
+
- `title`
|
|
4320
|
+
- `description`
|
|
4321
|
+
- `previous`
|
|
4322
|
+
- `next`
|
|
4323
|
+
- `close`
|
|
4324
|
+
|
|
4325
|
+
Anatomy:
|
|
4326
|
+
|
|
4327
|
+
```
|
|
4328
|
+
<kui-tour>
|
|
4329
|
+
portal
|
|
4330
|
+
spotlight
|
|
4331
|
+
positioner
|
|
4332
|
+
popup
|
|
4333
|
+
arrow
|
|
4334
|
+
title
|
|
4335
|
+
description
|
|
4336
|
+
previous
|
|
4337
|
+
next
|
|
4338
|
+
close
|
|
4339
|
+
```
|
|
4340
|
+
|
|
4341
|
+
Attributes and CSS variables, by part:
|
|
4342
|
+
|
|
4343
|
+
- spotlight: A layer over the page with a hole over the step's target, which the design draws from its variables (a clip path, or a box with a large shadow). A press on it is a press outside the tour. While the target can be used (`interactive`), presses go through it.
|
|
4344
|
+
- `data-open`: Present when it is open.
|
|
4345
|
+
- `data-closed`: Present when it is closed.
|
|
4346
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
4347
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
4348
|
+
- `data-centered`: Present while the step shown has no target in the page: the popup stands in the middle of the viewport.
|
|
4349
|
+
- `--spotlight-left`: The hole's left edge, from the spotlight's own left edge: the target's, less `spotlightPadding`.
|
|
4350
|
+
- `--spotlight-top`: The hole's top edge, from the spotlight's own top edge: the target's, less `spotlightPadding`.
|
|
4351
|
+
- `--spotlight-width`: The hole's width: the target's, with `spotlightPadding` on each side.
|
|
4352
|
+
- `--spotlight-height`: The hole's height: the target's, with `spotlightPadding` on each side. With no target, the hole is a point in the middle.
|
|
4353
|
+
- positioner: Places the popup against the step's target, or in the middle of the viewport for a step with none. It carries the geometry.
|
|
4354
|
+
- `data-open`: Present when it is open.
|
|
4355
|
+
- `data-closed`: Present when it is closed.
|
|
4356
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
4357
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
4358
|
+
- `data-centered`: Present while the step shown has no target in the page: the popup stands in the middle of the viewport.
|
|
4359
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
4360
|
+
- `--anchor-width`: The anchor's width.
|
|
4361
|
+
- `--anchor-height`: The anchor's height.
|
|
4362
|
+
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
4363
|
+
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
4364
|
+
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
4365
|
+
- popup: The step itself: a dialog that stays in the page from the first step to the last, and moves.
|
|
4366
|
+
- `data-open`: Present when it is open.
|
|
4367
|
+
- `data-closed`: Present when it is closed.
|
|
4368
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
4369
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
4370
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
4371
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
4372
|
+
- `data-centered`: Present while the step shown has no target in the page: the popup stands in the middle of the viewport.
|
|
4373
|
+
- arrow: An element that points at the target, placed along the popup's edge.
|
|
4374
|
+
- `data-open`: Present when it is open.
|
|
4375
|
+
- `data-closed`: Present when it is closed.
|
|
4376
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
4377
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
4378
|
+
- `data-uncentered`: Present when the popup was pushed along its edge, so the arrow is not at the target's centre.
|
|
4379
|
+
- `data-centered`: Present while the step shown has no target in the page: the popup stands in the middle of the viewport.
|
|
4380
|
+
- previous: A button that goes back a step. On the first step it does nothing.
|
|
4381
|
+
- `data-disabled`: Present when it is disabled.
|
|
4382
|
+
- next: A button that goes on a step. On the last step it finishes the tour.
|
|
4383
|
+
- `data-last`: Present on the last step: a press finishes the tour.
|
|
4384
|
+
|
|
4385
|
+
### Tree
|
|
4386
|
+
|
|
4387
|
+
```
|
|
4388
|
+
import "@kirana-ui/web/tree"
|
|
4389
|
+
```
|
|
4390
|
+
|
|
4391
|
+
`<kui-tree>`: `<kui-tree>` around `kui-part="root"` and its nodes: each an `item` (`kui-value`, and `kui-branch`, `kui-disabled`, `kui-loading`, `kui-label` as it needs), nested as the page nests them, holding an `item-row` with an `item-indicator` and an `item-text`, and, for a branch, a `group` of its children, in the page while the branch is open (`kui-keep-mounted` keeps it). A node's depth is read from the nodes around it. `expanded-value`, `default-expanded-value`, `selected-value` and `default-selected-value` (with commas between), `selection-mode`, `expand-on-click`; it tells `expanded-change` and `selected-change`.
|
|
4392
|
+
|
|
4393
|
+
Attributes of the element (each also a property, in camel case):
|
|
4394
|
+
|
|
4395
|
+
- `expanded-value` (string): The values of the open branches.
|
|
4396
|
+
- `default-expanded-value` (string): The branches open at first, when the caller does not hold `expandedValue`. Read once.
|
|
4397
|
+
- `selected-value` (string): The values of the chosen nodes.
|
|
4398
|
+
- `default-selected-value` (string): The nodes chosen at first, when the caller does not hold `selectedValue`. Read once.
|
|
4399
|
+
- `selection-mode` (string): Whether nodes can be chosen: none, one, or several. Default `single`.
|
|
4400
|
+
- `expand-on-click` (boolean): Whether a press on a branch (or Enter on it) also opens or closes it. Default `true`.
|
|
4401
|
+
|
|
4402
|
+
Events:
|
|
4403
|
+
|
|
4404
|
+
- `expanded-change`: `event.detail.expandedValue`, with `event.detail.details`. `preventDefault()` keeps `expandedValue` as it was.
|
|
4405
|
+
- `selected-change`: `event.detail.selectedValue`, with `event.detail.details`. `preventDefault()` keeps `selectedValue` as it was.
|
|
4406
|
+
|
|
4407
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
4408
|
+
|
|
4409
|
+
- `root`
|
|
4410
|
+
- `item`: `kui-branch`, `kui-disabled`, `kui-label`, `kui-loading`, `kui-part`, `kui-value`
|
|
4411
|
+
- `item-row`: `kui-branch`, `kui-disabled`, `kui-label`, `kui-loading`, `kui-part`, `kui-value`
|
|
4412
|
+
- `item-indicator`: `kui-branch`, `kui-disabled`, `kui-label`, `kui-loading`, `kui-part`, `kui-value`
|
|
4413
|
+
- `item-text`: `kui-branch`, `kui-disabled`, `kui-label`, `kui-loading`, `kui-part`, `kui-value`
|
|
4414
|
+
- `group`: `kui-branch`, `kui-disabled`, `kui-label`, `kui-loading`, `kui-part`, `kui-value`
|
|
4415
|
+
|
|
4416
|
+
Anatomy:
|
|
4417
|
+
|
|
4418
|
+
```
|
|
4419
|
+
<kui-tree>
|
|
4420
|
+
root
|
|
4421
|
+
item (repeated)
|
|
4422
|
+
item-row (optional)
|
|
4423
|
+
item-indicator
|
|
4424
|
+
item-text
|
|
4425
|
+
group
|
|
4426
|
+
item (repeated, as above)
|
|
4427
|
+
```
|
|
4428
|
+
|
|
4429
|
+
Attributes and CSS variables, by part:
|
|
4430
|
+
|
|
4431
|
+
- item: One node, a `treeitem`: a leaf, or a branch that holds its row and its group. Its `value` tells it from the others; its depth, and its place among its siblings, are read from the page.
|
|
4432
|
+
- `data-selected`: Present on a chosen node.
|
|
4433
|
+
- `data-highlighted`: Present on the node focus is on, while it is in the tree.
|
|
4434
|
+
- `data-disabled`: Present when it is disabled.
|
|
4435
|
+
- `data-open`: Present on a branch that is open.
|
|
4436
|
+
- `data-closed`: Present on a branch that is closed.
|
|
4437
|
+
- `data-loading`: Present on a branch that says its children are being loaded.
|
|
4438
|
+
- itemRow: The line a node draws, apart from the children its group holds: what a design gives a background.
|
|
4439
|
+
- `data-selected`: Present on a chosen node.
|
|
4440
|
+
- `data-highlighted`: Present on the node focus is on, while it is in the tree.
|
|
4441
|
+
- `data-disabled`: Present when it is disabled.
|
|
4442
|
+
- `data-open`: Present on a branch that is open.
|
|
4443
|
+
- `data-closed`: Present on a branch that is closed.
|
|
4444
|
+
- `data-loading`: Present on a branch that says its children are being loaded.
|
|
4445
|
+
- itemIndicator: The mark that says whether a branch is open. A press on it opens or closes the branch and chooses nothing.
|
|
4446
|
+
- `data-open`: Present on a branch that is open.
|
|
4447
|
+
- `data-closed`: Present on a branch that is closed.
|
|
4448
|
+
- `data-loading`: Present on a branch that says its children are being loaded.
|
|
4449
|
+
- group: A branch's children. In the page while the branch is open, and through its exit's motion.
|
|
4450
|
+
- `data-open`: Present when it is open.
|
|
4451
|
+
- `data-closed`: Present when it is closed.
|
|
4452
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
4453
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
4454
|
+
- `--tree-group-height`: The group's content height while it opens or closes, `auto` once it is open.
|
|
4455
|
+
- `--tree-group-width`: The group's content width while it opens or closes, `auto` once it is open.
|