@kirana-ui/vue 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 +1779 -182
- package/package.json +48 -3
- package/skills/kirana-ui-primitives/SKILL.md +53 -12
- package/src/accordion.d.ts +4 -0
- package/src/accordion.js +6 -0
- package/src/accordion.js.map +1 -1
- package/src/alert-dialog.d.ts +2 -2
- package/src/autocomplete.d.ts +2 -2
- package/src/avatar.d.ts +31 -4
- package/src/avatar.js +40 -16
- package/src/avatar.js.map +1 -1
- package/src/button.d.ts +4 -1
- package/src/button.js +4 -1
- package/src/button.js.map +1 -1
- package/src/calendar.d.ts +22 -13
- package/src/calendar.js +83 -12
- package/src/calendar.js.map +1 -1
- package/src/carousel.d.ts +5 -2
- package/src/carousel.js +1 -4
- package/src/carousel.js.map +1 -1
- package/src/checkbox-group-context.d.ts +5 -0
- package/src/checkbox-group-context.js +6 -0
- package/src/checkbox-group-context.js.map +1 -0
- package/src/checkbox-group.d.ts +12 -0
- package/src/checkbox-group.js +44 -0
- package/src/checkbox-group.js.map +1 -0
- package/src/checkbox.d.ts +17 -0
- package/src/checkbox.js +9 -2
- package/src/checkbox.js.map +1 -1
- package/src/collapsible.d.ts +2 -0
- package/src/color-picker.d.ts +118 -0
- package/src/color-picker.js +174 -0
- package/src/color-picker.js.map +1 -0
- package/src/combobox.d.ts +105 -5
- package/src/combobox.js +83 -12
- package/src/combobox.js.map +1 -1
- package/src/command.d.ts +2 -2
- package/src/command.js +3 -1
- package/src/command.js.map +1 -1
- package/src/date-field.d.ts +1 -1
- package/src/date-field.js +2 -0
- package/src/date-field.js.map +1 -1
- package/src/date-picker.d.ts +39 -13
- package/src/date-picker.js +104 -51
- package/src/date-picker.js.map +1 -1
- package/src/dialog.d.ts +41 -8
- package/src/dialog.js +44 -8
- package/src/dialog.js.map +1 -1
- package/src/drawer.d.ts +2 -2
- package/src/editable.d.ts +87 -0
- package/src/editable.js +83 -0
- package/src/editable.js.map +1 -0
- package/src/element.js +5 -5
- package/src/element.js.map +1 -1
- package/src/file-upload.d.ts +76 -0
- package/src/file-upload.js +139 -0
- package/src/file-upload.js.map +1 -0
- package/src/hover-card.d.ts +3 -0
- package/src/index.d.ts +28 -7
- package/src/index.js +12 -1
- package/src/menu.d.ts +10 -0
- package/src/menu.js +17 -6
- package/src/menu.js.map +1 -1
- package/src/menubar.js +10 -1
- package/src/menubar.js.map +1 -1
- package/src/navigation-menu.d.ts +14 -3
- package/src/navigation-menu.js +20 -2
- package/src/navigation-menu.js.map +1 -1
- package/src/number-field.d.ts +33 -1
- package/src/number-field.js +98 -68
- package/src/number-field.js.map +1 -1
- package/src/otp.d.ts +25 -3
- package/src/otp.js +22 -3
- package/src/otp.js.map +1 -1
- package/src/password-input.d.ts +37 -0
- package/src/password-input.js +44 -0
- package/src/password-input.js.map +1 -0
- package/src/popover.d.ts +32 -4
- package/src/popover.js +37 -5
- package/src/popover.js.map +1 -1
- package/src/radio-group.d.ts +12 -0
- package/src/radio-group.js +6 -2
- package/src/radio-group.js.map +1 -1
- package/src/rating.d.ts +34 -0
- package/src/rating.js +81 -0
- package/src/rating.js.map +1 -0
- package/src/runtime.d.ts +2 -1
- package/src/runtime.js +5 -2
- package/src/runtime.js.map +1 -1
- package/src/scroll-area.d.ts +24 -1
- package/src/select.d.ts +39 -5
- package/src/select.js +30 -9
- package/src/select.js.map +1 -1
- package/src/slider.d.ts +35 -0
- package/src/slider.js +1 -0
- package/src/slider.js.map +1 -1
- package/src/steps.d.ts +74 -0
- package/src/steps.js +84 -0
- package/src/steps.js.map +1 -0
- package/src/switch.d.ts +12 -0
- package/src/tabs.d.ts +2 -0
- package/src/tabs.js +5 -0
- package/src/tabs.js.map +1 -1
- package/src/tags-input.d.ts +69 -0
- package/src/tags-input.js +145 -0
- package/src/tags-input.js.map +1 -0
- package/src/time-field.d.ts +41 -0
- package/src/time-field.js +85 -0
- package/src/time-field.js.map +1 -0
- package/src/toast.d.ts +12 -4
- package/src/toggle-group.js +6 -0
- package/src/toggle-group.js.map +1 -1
- package/src/toolbar-context.d.ts +1 -1
- package/src/toolbar.d.ts +4 -1
- package/src/toolbar.js +17 -2
- package/src/toolbar.js.map +1 -1
- package/src/tooltip.d.ts +5 -0
- package/src/tour.d.ts +75 -0
- package/src/tour.js +95 -0
- package/src/tour.js.map +1 -0
- package/src/tree.d.ts +69 -0
- package/src/tree.js +118 -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 part and every prop here is in the package, and what is not here is not. In order: installing it and its entries; the positioner's options; the types the props name; what else is exported; the agent bridge; the testing kit; then "Using it" (the rules of every component) and "Components" (each one's parts, props, attributes and CSS variables).
|
|
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/vue/CHANGELOG.md`.
|
|
8
|
+
|
|
7
9
|
## Install and entries
|
|
8
10
|
|
|
9
|
-
Install `@kirana-ui/vue`. 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/vue/agent`, `@kirana-ui/vue/testing`), so nothing is imported from a package the project did not install.
|
|
11
|
+
Install `@kirana-ui/vue`. 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/vue/agent`, `@kirana-ui/vue/testing`), so nothing is imported from a package the project did not install. The one exception is a component of your own, built on `@kirana-ui/core/authoring`: its controller imports the core by name, so that project installs `@kirana-ui/core` too, at this package's exact version (they must be one copy). It runs on the project's own `vue` ^3.5.0.
|
|
10
12
|
|
|
11
|
-
Its entries: an entry per component (`@kirana-ui/vue/tabs`,
|
|
13
|
+
Its entries: an entry per component (`@kirana-ui/vue/tabs`, 59 of them, each named under its component below), the package root `@kirana-ui/vue` (every component at once, for a bundler that shakes trees), and `@kirana-ui/vue/runtime`, `@kirana-ui/vue/agent`, `@kirana-ui/vue/testing`, `@kirana-ui/vue/primitive` and `@kirana-ui/vue/direction`. No other path is an entry: `DirectionProvider` and `useDirection` are in `@kirana-ui/vue/direction`, `PortalProvider` in the package root.
|
|
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 (`import { vocabulary } from "@kirana-ui/vocabulary"`, `import { Dialog } from "@kirana-ui/vocabulary/keys"`: `Dialog.Popup.open` is `"[data-open]"`). It is its own package, and not installed with this one.
|
|
14
16
|
|
|
@@ -20,12 +22,17 @@ What every `Positioner` takes, beside its own props where a component's section
|
|
|
20
22
|
|
|
21
23
|
- `side?: Side`: The side of the anchor the popup is on. `inline-start` and `inline-end` follow the reading direction the popup is placed in, and `data-side` then says the side in the same words. Default `"bottom"`.
|
|
22
24
|
- `align?: Align`: Where along that side the popup is: at the anchor's start, its centre or its end. Default `"center"`.
|
|
23
|
-
- `sideOffset?: number`: The gap between the anchor and the popup, measured without any arrow. Default `0`.
|
|
24
|
-
- `alignOffset?: number`: How far the popup is moved along the side from where `align` puts it,
|
|
25
|
-
- `collisionPadding?:
|
|
25
|
+
- `sideOffset?: number | OffsetFunction`: The gap between the anchor and the popup, measured without any arrow: a number of pixels, or a function of what was measured (`({ side, align, anchor, positioner }) => number`). Default `0`.
|
|
26
|
+
- `alignOffset?: number | OffsetFunction`: How far the popup is moved along the side from where `align` puts it: a number of pixels, or a function of what was measured (`({ side, align, anchor, positioner }) => number`). Default `0`.
|
|
27
|
+
- `collisionPadding?: CollisionPadding`: Kept between the popup and the edges it is held inside: one number, or one for each side (`{ top, right, bottom, left }`, a side left out is 0). Default `5`.
|
|
28
|
+
- `collisionBoundary?: CollisionBoundary`: What the popup is held inside: an element, several, or a rectangle of the viewport. Left out or `"clipping-ancestors"`: the ancestors that clip it, and the viewport.
|
|
29
|
+
- `collisionAvoidance?: CollisionAvoidance`: What the popup does when it does not fit: `side` and `align` each `"flip"`, `"shift"` or `"none"`, and `fallbackAxisSide`. Left out: it flips to the opposite side and is moved along its side.
|
|
30
|
+
- `sticky?: boolean`: Keeps the popup in view once its anchor has been scrolled out of it. Otherwise the popup leaves with its anchor. Default `false`.
|
|
31
|
+
- `arrowPadding?: number`: Kept between an arrow and the ends of the popup's edge, so the arrow does not stand on a rounded corner. Default `5`.
|
|
32
|
+
- `positionMethod?: "absolute" | "fixed"`: The CSS `position` the positioner is given: `"absolute"` or `"fixed"`. Default `"absolute"`.
|
|
26
33
|
- `anchor?: PositionerAnchor`: What the popup is placed against, when that is not its trigger. It may change while the popup is open: the popup follows.
|
|
27
34
|
|
|
28
|
-
A component's own defaults lie over those: `Autocomplete` `{ align: "start" }`; `Combobox` `{ align: "start" }`; `ContextMenu` `{ align: "start" }`, and `{ side: "inline-end", align: "start" }` for a submenu or for a menu in a vertical menubar; `HoverCard` `{ side: "top" }`; `Menu` `{ align: "start" }`, and `{ side: "inline-end", align: "start" }` for a submenu or for a menu in a vertical menubar; `NavigationMenu` `{ align: "start" }`; `Select` `{ align: "start" }`; `Tooltip` `{ side: "top" }
|
|
35
|
+
A component's own defaults lie over those: `Autocomplete` `{ align: "start" }`; `Combobox` `{ align: "start" }`; `ContextMenu` `{ align: "start" }`, and `{ side: "inline-end", align: "start" }` for a submenu or for a menu in a vertical menubar; `HoverCard` `{ side: "top" }`; `Menu` `{ align: "start" }`, and `{ side: "inline-end", align: "start" }` for a submenu or for a menu in a vertical menubar; `NavigationMenu` `{ align: "start" }`; `Select` `{ align: "start" }`; `Tooltip` `{ side: "top" }`; `Tour` the shared defaults, under the `side` and `align` of the step shown; a step with no target is placed in the middle of the viewport whatever they say.
|
|
29
36
|
|
|
30
37
|
## Types
|
|
31
38
|
|
|
@@ -33,11 +40,17 @@ The named types the props below mention, each with the entry of this package it
|
|
|
33
40
|
|
|
34
41
|
- `Align` (`@kirana-ui/vue`): `"start" | "center" | "end"`. Where along its side a popup is: at the anchor's start, its centre or its end.
|
|
35
42
|
- `Anchor` (`@kirana-ui/vue`): `Element | VirtualElement`. What a popup is placed against: an element, or a place in the viewport that is none.
|
|
36
|
-
- `CalendarDay` (`@kirana-ui/vue`): A day in the grid of
|
|
43
|
+
- `CalendarDay` (`@kirana-ui/vue`): A day in the grid of a month shown.
|
|
37
44
|
- `date: IsoDate`
|
|
38
45
|
- `label: string`: The day of the month as the locale writes it.
|
|
39
|
-
- `outside: boolean`: Not of the month
|
|
40
|
-
- `
|
|
46
|
+
- `outside: boolean`: Not of the month it is drawn in: the days that fill its first and last weeks.
|
|
47
|
+
- `CalendarMonth` (`@kirana-ui/vue`): One of the months shown, as `Calendar.Months` gives it.
|
|
48
|
+
- `index: number`: Its place among the months shown, from 0.
|
|
49
|
+
- `month: IsoDate`: Its first day.
|
|
50
|
+
- `title: string`: Its name as the locale writes it (`"March 2026"`).
|
|
51
|
+
- `weekdays: readonly CalendarWeekday[]`
|
|
52
|
+
- `weeks: readonly (readonly CalendarDay[])[]`
|
|
53
|
+
- `CalendarValueOf<Mode extends CalendarMode | undefined>` (`@kirana-ui/vue`): `Mode extends "range" ? DateRange | null : Mode extends "multiple" ? readonly IsoDate[] : IsoDate | null`. The value of one mode: a day or `null`, a range or `null`, or a list (empty for none). What `value` and `onValueChange` are typed by, from the `mode` a root is given.
|
|
41
54
|
- `CalendarWeekday` (`@kirana-ui/vue`): A day of the week, as a column's heading names it.
|
|
42
55
|
- `index: number`: Its place in the week as the locale orders it, from 0.
|
|
43
56
|
- `narrow: string`: Its name as a column's heading (`"M"`, `"Mo"`), and in full (`"Monday"`).
|
|
@@ -51,14 +64,50 @@ The named types the props below mention, each with the entry of this package it
|
|
|
51
64
|
- `canceled: boolean`
|
|
52
65
|
- `Changes<Name extends string, Value, Details = ChangeDetails>` (`@kirana-ui/vue/runtime`): `{ [Event in `update:${Name}`]: (value: Value) => void } & { [Event in `${Name}Change`]: (value: Value, details: Details) => void }`. The two events of a value its caller may hold: `update:open`, which `v-model:open` hears, and `openChange`, which also carries the details and may cancel the change.
|
|
53
66
|
- `ChangeSource` (`@kirana-ui/vue`): `"mouse" | "touch" | "pen" | "keyboard" | "virtual" | "programmatic" | "agent"`. What made a change: a kind of pointer, the keyboard, a press with no pointer (`virtual`), code with no event (`programmatic`), or an agent acting through the bridge.
|
|
67
|
+
- `CollisionAvoidance` (`@kirana-ui/vue`): What a popup does when it does not fit where it was asked to be.
|
|
68
|
+
- `side?: "flip" | "shift" | "none"`: Across from the anchor: `"flip"` goes to the opposite side, `"shift"` keeps the side and moves over the anchor to stay in view, `"none"` lets it overflow. Default `"flip"`.
|
|
69
|
+
- `align?: "flip" | "shift" | "none"`: Along its side: `"flip"` swaps `start` and `end`, `"shift"` moves the popup along the side to stay in view, `"none"` lets it overflow. Default `"flip"`. With `side: "shift"` it is `"shift"` or `"none"`.
|
|
70
|
+
- `fallbackAxisSide?: "start" | "end" | "none"`: Where it goes when neither the side asked for nor its opposite fits: to the other axis, its `"start"` or its `"end"` first, or nowhere (`"none"`). Default `"end"`.
|
|
71
|
+
- `CollisionBoundary` (`@kirana-ui/vue`): `"clipping-ancestors" | Element | Element[] | { x: number; y: number; width: number; height: number }`. What a popup is held inside: the ancestors that clip it (`"clipping-ancestors"`), an element, several, or a rectangle of the viewport.
|
|
72
|
+
- `CollisionPadding` (`@kirana-ui/vue`): `number | Partial<Record<PhysicalSide, number>>`. The room kept between a popup and the edges it is held inside: one number, or one a side.
|
|
73
|
+
- `ColorFormat` (`@kirana-ui/vue`): `"hex" | "rgb" | "hsl"`. How a colour is written: `#rrggbb`, `rgb(…)` or `hsl(…)`.
|
|
74
|
+
- `ColorPickerInputChannel` (`@kirana-ui/vue`): `"hex" | "red" | "green" | "blue" | "hue" | "saturation" | "lightness" | "alpha"`. A channel an input of the picker is typed in.
|
|
75
|
+
- `ColorPickerSliderChannel` (`@kirana-ui/vue`): `"hue" | "alpha"`. A channel a slider of the picker moves: the hue, or the alpha.
|
|
76
|
+
- `ColorPickerThumb` (`@kirana-ui/vue`): `"area" | ColorPickerSliderChannel`. What a thumb of the picker moves: the area's, or a slider's channel.
|
|
77
|
+
- `ComboboxEntry<Value = unknown>` (`@kirana-ui/vue`): `ComboboxItemEntry<Value> | ComboboxGroupEntry<Value>`. What a `Collection` hands to be drawn: an item that is left, or a group that has items left.
|
|
78
|
+
- `ComboboxGroupData<Value = unknown>` (`@kirana-ui/vue`): Items given as data that belong together: `value` is the group's name.
|
|
79
|
+
- `value: string`
|
|
80
|
+
- `items: readonly ComboboxItemData<Value>[]`
|
|
81
|
+
- `ComboboxGroupEntry<Value = unknown>` (`@kirana-ui/vue`): A group that has items left, with those items.
|
|
82
|
+
- `type: "group"`
|
|
83
|
+
- `key: string`: What it is known by from one drawing to the next.
|
|
84
|
+
- `value: string`: The group's name, as it was given.
|
|
85
|
+
- `label: string`: The same name: an entry of either kind has a `label`.
|
|
86
|
+
- `disabled: false`: Never: an entry of either kind says whether it is disabled.
|
|
87
|
+
- `items: readonly ComboboxItemEntry<Value>[]`: The items of the group that are left.
|
|
88
|
+
- `ComboboxItemData<Value = unknown>` (`@kirana-ui/vue`): One item given as data: its value, and what it is called.
|
|
89
|
+
- `value: Value`
|
|
90
|
+
- `label: string`
|
|
91
|
+
- `disabled?: boolean`: It cannot be chosen: its entry says so, for the item drawn for it.
|
|
92
|
+
- `ComboboxItemEntry<Value = unknown>` (`@kirana-ui/vue`): One item left of the `items` given as data, as a `Collection` hands it to be drawn.
|
|
93
|
+
- `type: "item"`
|
|
94
|
+
- `key: string`: What it is known by from one drawing to the next.
|
|
95
|
+
- `value: Value`
|
|
96
|
+
- `label: string`
|
|
97
|
+
- `disabled: boolean`
|
|
98
|
+
- `item: ComboboxItemData<Value>`: The item as it was given, with whatever else it carries.
|
|
54
99
|
- `DateFieldSegment` (`@kirana-ui/vue`): One piece of the field, in the locale's order: a part that is typed, or what stands between.
|
|
55
100
|
- `type: DateUnit | "literal"`
|
|
56
101
|
- `literal: string`: What stands between two parts (`"/"`); empty for a part that is typed.
|
|
57
102
|
- `index: number`: Its place among the pieces.
|
|
103
|
+
- `DatePickerRange` (`@kirana-ui/vue`): A range a date picker holds: its first and its last day, either `null` while it is being chosen (the first picked, the second not yet; one end typed).
|
|
104
|
+
- `start: IsoDate | null`
|
|
105
|
+
- `end: IsoDate | null`
|
|
106
|
+
- `DatePickerValueOf<Mode extends DatePickerMode | undefined>` (`@kirana-ui/vue`): `Mode extends "range" ? DatePickerRange | null : IsoDate | null`. The value of one mode: a day or `null`, or a range or `null`.
|
|
58
107
|
- `DateRange` (`@kirana-ui/vue`): A range of days, its first and its last, both in it.
|
|
59
108
|
- `start: IsoDate`
|
|
60
109
|
- `end: IsoDate`
|
|
61
|
-
- `DateUnit` (`@kirana-ui/vue`): `"day" | "month" | "year"`. A part of a date that is typed on its own.
|
|
110
|
+
- `DateUnit` (`@kirana-ui/vue`): `"era" | "day" | "month" | "year"`. A part of a date that is typed on its own; the era only in a calendar that has several.
|
|
62
111
|
- `DrawerSide` (`@kirana-ui/vue`): `"up" | "down" | "left" | "right"`. The way a drawer is swiped to close it: towards the edge it came from.
|
|
63
112
|
- `DrawerSnapPoint` (`@kirana-ui/vue`): `number | string`. How much of a drawer shows at a place it rests: a share of it, or a length.
|
|
64
113
|
- `FieldValidity` (`@kirana-ui/vue`): What a field knows of its control's value once it has been checked.
|
|
@@ -66,19 +115,43 @@ The named types the props below mention, each with the entry of this package it
|
|
|
66
115
|
- `errors: readonly string[]`: What is wrong, one message each.
|
|
67
116
|
- `state: Readonly<Record<ValidityKey, boolean>>`: What the browser found, by name; `customError` is the field's own `validate`.
|
|
68
117
|
- `value: string`: The value that was checked.
|
|
118
|
+
- `FileRejection` (`@kirana-ui/vue`): A file that was not taken, and every reason it was not.
|
|
119
|
+
- `file: File`
|
|
120
|
+
- `reasons: readonly FileRejectionReason[]`
|
|
121
|
+
- `FileRejectionReason` (`@kirana-ui/vue`): `"type" | "too-large" | "too-small" | "too-many" | "invalid"`. Why a file was not taken.
|
|
122
|
+
- `FileUploadEntry` (`@kirana-ui/vue`): One file as it is drawn: the file, its place, and what tells it from the others.
|
|
123
|
+
- `key: string`: The same for as long as the file is held: what a list keeps its element by.
|
|
124
|
+
- `file: File`
|
|
125
|
+
- `index: number`
|
|
69
126
|
- `FormErrors` (`@kirana-ui/vue`): `Record<string, string | readonly string[]>`. A form's errors as a server sends them: each field's name with its message, or messages.
|
|
70
127
|
- `FormValues` (`@kirana-ui/vue`): `Record<string, FormDataEntryValue | FormDataEntryValue[]>`. A form's values by field name, as `FormData` holds them: a list where a name is there more than once.
|
|
128
|
+
- `HourCycle` (`@kirana-ui/vue`): `12 | 24`. A clock of twelve hours and a day period, or of twenty-four.
|
|
129
|
+
- `Hsva` (`@kirana-ui/vue`): Hue from 0 to 360, saturation and brightness (value) from 0 to 100, alpha from 0 to 1: what a colour area draws, saturation across and brightness up.
|
|
130
|
+
- `h: number`
|
|
131
|
+
- `s: number`
|
|
132
|
+
- `v: number`
|
|
133
|
+
- `a: number`
|
|
134
|
+
- `ImageStatus` (`@kirana-ui/vue`): `"idle" | "loading" | "loaded" | "error"`. Where an avatar's picture is in its loading: `idle` while it has no address, `loading`, then `loaded` or `error`. Base UI's `ImageLoadingStatus`.
|
|
71
135
|
- `IsoDate` (`@kirana-ui/vue`): `string`. A day as `YYYY-MM-DD`, in the calendar the world's data is kept in (ISO 8601).
|
|
136
|
+
- `IsoTime` (`@kirana-ui/vue`): `string`. A time of day as `HH:MM` or `HH:MM:SS`, in 24 hours (ISO 8601).
|
|
72
137
|
- `ListCollection` (`@kirana-ui/vue`): Every row of a list of which only some are in the page: a virtualizer draws the ones in view. The keys then move by place, and ask for a row that is not drawn to be brought into the page.
|
|
73
138
|
- `count: number`: How many rows there are, drawn or not.
|
|
74
139
|
- `label?(index: number): string`: A row's name by its place: what typing matches. Without it, typing finds nothing.
|
|
75
140
|
- `disabled?(index: number): boolean`
|
|
76
141
|
- `indexOf?(value: unknown): number`: The place of a value, or -1: where a list opens on what is chosen.
|
|
77
142
|
- `scrollToIndex(index: number): void`: Brings a row into the page: the virtualizer's own scroll.
|
|
143
|
+
- `OffsetData` (`@kirana-ui/vue`): What an offset given as a function is told: where the popup is, and the two sizes.
|
|
144
|
+
- `side: Side`: The side of the anchor the popup is on, in the words it was asked for in.
|
|
145
|
+
- `align: Align`: Where along that side the popup is.
|
|
146
|
+
- `anchor: { width: number; height: number }`: The anchor's size, in pixels.
|
|
147
|
+
- `positioner: { width: number; height: number }`: The positioner's size, in pixels.
|
|
148
|
+
- `OffsetFunction` (`@kirana-ui/vue`): `(data: OffsetData) => number`. A gap worked out from what was measured: `({ side, align, anchor, positioner }) => number`.
|
|
78
149
|
- `Orientation` (`@kirana-ui/vue`): `"horizontal" | "vertical"`. The way a row of things is laid out, and so which arrow keys move along it.
|
|
150
|
+
- `OtpValidation` (`@kirana-ui/vue`): `"numeric" | "alpha" | "alphanumeric" | "none" | "alphabetic" | "text"`. Which characters a one-time code takes: Base UI's four values, and `alphabetic` and `text`, the older spellings of `alpha` and `none`.
|
|
79
151
|
- `PaginationEntry` (`@kirana-ui/vue`): `{ readonly type: "page"; readonly page: number; readonly key: string } | { readonly type: "ellipsis"; readonly key: "start" | "end" }`. One piece of the list of pages: a page, or the mark for pages left out.
|
|
80
152
|
- `PhysicalSide` (`@kirana-ui/vue`): `"top" | "right" | "bottom" | "left"`. A side of the anchor as the page is drawn.
|
|
81
153
|
- `PositionerAnchor` (`@kirana-ui/vue/popover`): `Anchor | ComponentPublicInstance | Ref<Anchor | ComponentPublicInstance | null | undefined> | (() => Anchor | null | undefined) | null | undefined`. What a positioner's `anchor` may be: an element, a place in the viewport (an object with `getBoundingClientRect`), a template ref to an element or a component (in a template that is the element or the component's instance), or a function that gives an element or a place.
|
|
154
|
+
- `Presentation` (`@kirana-ui/vue`): `"popup" | "sheet" | "auto"`. How a list opens: `"popup"` placed against its trigger, `"sheet"` from the bottom edge of the viewport, `"auto"` a sheet on a narrow touch screen and a popup elsewhere.
|
|
82
155
|
- `QrCorrection` (`@kirana-ui/vue`): `"L" | "M" | "Q" | "H"`. How much of the symbol may be lost and still be read: about 7, 15, 25 and 30 in a hundred.
|
|
83
156
|
- `ReadonlySignal<T>` (`@kirana-ui/vue`): A value that is read, and that tells when it changes.
|
|
84
157
|
- `get(): T`: The value, tracked by the computed or effect that reads it.
|
|
@@ -95,6 +168,16 @@ The named types the props below mention, each with the entry of this package it
|
|
|
95
168
|
- `cancel(): void`: Keeps the value as it was.
|
|
96
169
|
- `canceled: boolean`
|
|
97
170
|
- `SliderTold<Value extends SliderValue = SliderValue>` (`@kirana-ui/vue`): `Value extends number ? number : number[]`. What a slider tells of a value it was given as `Value`: a number for one thumb, a list for a range, and either where the caller's own type says either.
|
|
171
|
+
- `TagsInputEntry` (`@kirana-ui/vue`): One tag as it is drawn: its text, its place, and what tells it from the others.
|
|
172
|
+
- `key: string`: The same for as long as the tag is there: what a list keeps its element by.
|
|
173
|
+
- `value: string`
|
|
174
|
+
- `index: number`
|
|
175
|
+
- `TimeFieldSegment` (`@kirana-ui/vue`): One piece of the field, in the locale's order: a part that is typed, or what stands between.
|
|
176
|
+
- `type: TimeUnit | "literal"`
|
|
177
|
+
- `literal: string`: What stands between two parts (`":"`); empty for a part that is typed.
|
|
178
|
+
- `index: number`: Its place among the pieces.
|
|
179
|
+
- `TimeGranularity` (`@kirana-ui/vue`): `"minute" | "second"`. The smallest part it is typed to.
|
|
180
|
+
- `TimeUnit` (`@kirana-ui/vue`): `"hour" | "minute" | "second" | "dayPeriod"`. A part of a time that is typed on its own.
|
|
98
181
|
- `ToastActionOptions<Content = string>` (`@kirana-ui/vue`): A button a toast offers: what it says, and what pressing it does.
|
|
99
182
|
- `label: Content`: What the button says: `Toast.Action` draws it when it is given nothing else. Needed.
|
|
100
183
|
- `onAction(details: ChangeDetails): void`: Heard when the button is pressed, before the toast closes with the reason `"action-press"`: `details.cancel()` keeps the toast open. Needed.
|
|
@@ -110,14 +193,16 @@ The named types the props below mention, each with the entry of this package it
|
|
|
110
193
|
- `title?: Content`: What the toast is called: `Toast.Title` draws it when it is given nothing else. Default: none.
|
|
111
194
|
- `description?: Content`: What the toast says: `Toast.Description` draws it when it is given nothing else. Default: none.
|
|
112
195
|
- `type?: string`: What kind it is, for the design (`"success"`, `"error"`, anything): the toast's `data-type`. Default: none.
|
|
113
|
-
- `
|
|
196
|
+
- `timeout?: number`: How long it stays, in milliseconds; `0` (or `Infinity`) until it is closed. Default: the toaster's `timeout`.
|
|
197
|
+
- `duration?: number`: How long it stays, in milliseconds; `Infinity` until it is closed.
|
|
114
198
|
- `priority?: "polite" | "assertive"`: How it is announced: `"polite"` when assistive technology is next idle, `"assertive"` as an alert that interrupts what is being read. Default: `"polite"`.
|
|
115
199
|
- `action?: ToastActionOptions<Content>`: A button of the toast's own, which `Toast.Action` draws and presses. Default: none.
|
|
116
200
|
- `data?: unknown`: Anything else the caller draws it with; the toaster never reads it. Default: none.
|
|
117
201
|
- `onClose?: ((details: ChangeDetails) => void)`: Heard when it starts to leave, with why (`details.reason`). Default: none.
|
|
118
202
|
- `ToastRecord<Content = VNodeChild>` (`@kirana-ui/vue`): A toast as its toaster holds it: what it was added with, and where it stands.
|
|
119
203
|
- `id: string`: What it is known by: the one it was added with, or one the toaster made.
|
|
120
|
-
- `
|
|
204
|
+
- `timeout: number`: How long it stays, in milliseconds: its own, or the toaster's when it gave none; `Infinity` until it is closed.
|
|
205
|
+
- `duration: number`: How long it stays, in milliseconds.
|
|
121
206
|
- `priority: "polite" | "assertive"`: How it is announced: its own, or `"polite"` when it gave none.
|
|
122
207
|
- `closing: boolean`: It has been closed and is on its way out. `false` until then.
|
|
123
208
|
- `title?: Content`: What the toast is called: `Toast.Title` draws it when it is given nothing else. Default: none.
|
|
@@ -127,6 +212,7 @@ The named types the props below mention, each with the entry of this package it
|
|
|
127
212
|
- `data?: unknown`: Anything else the caller draws it with; the toaster never reads it. Default: none.
|
|
128
213
|
- `onClose?: ((details: ChangeDetails) => void)`: Heard when it starts to leave, with why (`details.reason`). Default: none.
|
|
129
214
|
- `ToastState<Content = string>` (`@kirana-ui/vue`): `ToastOptions<Content> | (string extends Content ? string : never)`. What a promise's toast shows in one of its states: a toast's options, or a string, which is its title (where a title may be a string).
|
|
215
|
+
- `TreeSelectionMode` (`@kirana-ui/vue`): `"none" | "single" | "multiple"`. Whether a tree's nodes can be chosen, and how many at once.
|
|
130
216
|
- `ValidationMode` (`@kirana-ui/vue`): `"onSubmit" | "onBlur" | "onChange"`. When a field checks its value. Once it is found invalid, it checks on every change.
|
|
131
217
|
- `ValidityKey` (`@kirana-ui/vue`): `Exclude<keyof ValidityState, "valid">`. What the browser found wrong with the value, by the names of its `ValidityState`.
|
|
132
218
|
|
|
@@ -136,7 +222,12 @@ What the entries export beside the components, their parts' props types and the
|
|
|
136
222
|
|
|
137
223
|
- `AnchorOption`, from `@kirana-ui/vue`: A positioner's own anchor: an element, a place in the viewport (`getBoundingClientRect`), or a function that gives one, asked each time the popup is placed. `null`, `undefined` or a function that gives neither: the popup's own anchor, its trigger.
|
|
138
224
|
- `Bindable`, from `@kirana-ui/vue`: A value that is the caller's while they give one and the part's own otherwise, as a signal that is asked to change.
|
|
225
|
+
- `CalendarMode`, from `@kirana-ui/vue`: How many days it chooses: one, a first and a last, or any number.
|
|
226
|
+
- `CalendarValue`, from `@kirana-ui/vue`: What a calendar holds: a day, a range of days in `mode: "range"`, a list of days in `mode: "multiple"`, or `null` for none.
|
|
227
|
+
- `ComboboxShown`, from `@kirana-ui/vue`: What a combobox's value part shows: what is chosen, and how it is named.
|
|
139
228
|
- `ComponentDefinition`, from `@kirana-ui/vue`: A component in the vocabulary: its parts by name.
|
|
229
|
+
- `DatePickerMode`, from `@kirana-ui/vue`: Whether a date picker chooses one day or a first and a last.
|
|
230
|
+
- `DatePickerValue`, from `@kirana-ui/vue`: What a date picker holds: a day, or in `mode: "range"` a range; `null` for none.
|
|
140
231
|
- `Direction`, from `@kirana-ui/vue`: The reading direction: left to right, or right to left.
|
|
141
232
|
- `ItemLabels`, from `@kirana-ui/vue`: The labels of a control's values, as its caller gives them: a list of values with their labels, or, for values that are text, the labels by value (`{ apple: "Apple" }`).
|
|
142
233
|
- `Part`, from `@kirana-ui/vue`: One part of a component as the core gives it: the props for its element, and the DOM work that starts once the element is in the page. Its props are the type `PartProps`, from the same entries.
|
|
@@ -148,6 +239,8 @@ What the entries export beside the components, their parts' props types and the
|
|
|
148
239
|
- `Signal`, from `@kirana-ui/vue`: A value that is read and written, and that tells when it changes.
|
|
149
240
|
- `StateDefinition`, from `@kirana-ui/vue`: A state of a part in the vocabulary: the attribute that marks it, and what it means.
|
|
150
241
|
- `StateOf`, from `@kirana-ui/vue`: The state of a part, from its definition in the vocabulary: a state its attribute marks by being present is `true` or absent, one with values is one of them or absent. It is what `stateOf` reads from the part's props.
|
|
242
|
+
- `TourStep`, from `@kirana-ui/vue`: One step of a tour. What it says is the page's to draw: the controller only shows it.
|
|
243
|
+
- `TourTarget`, from `@kirana-ui/vue`: What a step is about: an element, a CSS selector, or a function that gives an element, asked when the step is shown, so it may be something the page draws late.
|
|
151
244
|
- `calendarScope`, from `@kirana-ui/vue/calendar`: The calendar its parts are inside. Exported for a component that is made of one (a date picker provides its own to the calendar's parts).
|
|
152
245
|
- `dateFieldScope`, from `@kirana-ui/vue/date-field`: The date field its parts are inside. Exported for a component that is made of one (a date picker provides its own to the date field's parts).
|
|
153
246
|
- `DirectionProvider`, from `@kirana-ui/vue` or `@kirana-ui/vue/direction`: States the reading direction for the components inside. It draws nothing: set the page's own `dir` attribute with it.
|
|
@@ -164,6 +257,7 @@ What the entries export beside the components, their parts' props types and the
|
|
|
164
257
|
- `createToaster(options?: Core.ToasterOptions)`, from `@kirana-ui/vue` or `@kirana-ui/vue/toast`: The toasts of a page, made once, in a module: `toaster.add({ title })` from anywhere. A title, a description and an action's label are what a render function returns, unless `Content` says otherwise.
|
|
165
258
|
- `ToastContent`, from `@kirana-ui/vue` or `@kirana-ui/vue/toast`: What a toast's title, description and action's label may be here: what a render function returns (a string, `h("b", "Saved")`, several of them).
|
|
166
259
|
- `ToasterOptions`, from `@kirana-ui/vue` or `@kirana-ui/vue/toast`: What a toaster is made with.
|
|
260
|
+
- `TourShownStep`, from `@kirana-ui/vue/tour`: What the popup's slot is told of the step it shows, beside its state, to draw it.
|
|
167
261
|
- `context(name: string)`, from `@kirana-ui/vue/runtime`: A controller its parts find: `provide` in the root, `use` in a part.
|
|
168
262
|
- `controller(create: (props: ReadonlySignal<P>) => C, read: () => P)`, from `@kirana-ui/vue/runtime`: A component's controller, made once, following its props.
|
|
169
263
|
- `DefaultSlot`, from `@kirana-ui/vue/runtime`: A component's default slot, given `Slot`.
|
|
@@ -185,6 +279,7 @@ What the entries export beside the components, their parts' props types and the
|
|
|
185
279
|
- `PortalProvider`, from `@kirana-ui/vue` or `@kirana-ui/vue/runtime`: Says where every popup inside it is drawn, the popups those open included: an element of the page (a shadow root's host, a full-screen element) in place of `<body>`. Its props are the type `PortalProviderProps`, from the same entries.
|
|
186
280
|
- `StatesOf`, from `@kirana-ui/vue/runtime`: The state of each part of a component, by their names in the vocabulary: what a part's `data-*` attributes say, and what its default slot is given as `state`.
|
|
187
281
|
- `toSignal(read: () => T)`, from `@kirana-ui/vue/runtime`: A core signal that follows Vue state: the core hears a changed prop as it changes.
|
|
282
|
+
- `useDirectionAround()`, from `@kirana-ui/vue/runtime`: The reading direction a provider states, if a component is inside one.
|
|
188
283
|
- `written(text: () => unknown)`, from `@kirana-ui/vue/runtime`: What the element of a part that writes its own text holds: with `as-child`, the text while the caller's element has no content of its own, as the part's own element would.
|
|
189
284
|
|
|
190
285
|
## Agent
|
|
@@ -196,16 +291,23 @@ What the entries export beside the components, their parts' props types and the
|
|
|
196
291
|
- `root?: ParentNode`: The part of the page the agent may read and use. Default: the document.
|
|
197
292
|
- `allow?: ((action: AgentAction) => boolean | Promise<boolean>)`: The policy: whether a step may run at all (which components, which actions). Asked for every step, before `confirm`. Without it every step may. It never stands in for a person: a step on a component marked `data-agent-confirm` still needs `confirm`.
|
|
198
293
|
- `confirm?: ((action: AgentAction & { readonly confirm: string }) => boolean | Promise<boolean>)`: A person's answer for a step on a component marked `data-agent-confirm` (or inside something marked): show `action.confirm`, the mark's text, and resolve with what they chose. Without it such a step fails with "Needs a person", whatever `allow` says.
|
|
294
|
+
- `timeout?: number`: How long `allow` and `confirm` may take to answer, in milliseconds: after it the step fails with "No answer". Without it a step waits for as long as a person takes.
|
|
295
|
+
- `limit?: number`: How many components a snapshot lists before it says how many more there are. Default 200.
|
|
296
|
+
- `kinds?: readonly AgentKind[]`: Kinds of component of your own, matched before the ones the bridge knows.
|
|
199
297
|
|
|
200
298
|
and gives (`Agent`):
|
|
201
299
|
|
|
202
300
|
- `snapshot(): AgentComponent[]`: The components in the page now.
|
|
203
|
-
- `act(request: { steps: readonly AgentStep[] }): Promise<AgentResult>`: Runs steps in order, each through its component's own handlers.
|
|
301
|
+
- `act(request: { steps: readonly AgentStep[]; signal?: AbortSignal }): Promise<AgentResult>`: Runs steps in order, each through its component's own handlers. A `signal` that aborts stops it before its next step, and ends a wait for `allow` or `confirm`.
|
|
302
|
+
- `stage(request: { steps: readonly AgentStep[]; signal?: AbortSignal }): Promise<AgentStaged>`: Runs steps as `act` does, to show a suggestion in the controls themselves: nothing joins `history()` until `keep()`, and `revert()` takes it all back.
|
|
204
303
|
- `query(request: { text?: string; within?: string; kind?: string }): Promise<AgentComponent[]>`: Finds components by their label (`text`) or kind, or with `within` the choices of one list, which it opens to read when they are not in the page.
|
|
205
|
-
- `subscribe(listener: (changed: AgentComponent[]) => void): () => void`: Hears the components that changed, a moment after they do. Returns the stop.
|
|
206
|
-
- `
|
|
304
|
+
- `subscribe(listener: (changed: AgentComponent[], changes: AgentEvent[]) => void): () => void`: Hears the components that changed, a moment after they do, and each change apart: which state, from what, to what, and what made it. Returns the stop.
|
|
305
|
+
- `record(): () => void`: Starts keeping what a person and the page change too, each with its source, beside what the agent does. Changes to one control close together are one. Returns the stop.
|
|
306
|
+
- `history(): AgentChange[]`: What was changed, the oldest first: the agent's through `act`, and from `record()` on, everyone's.
|
|
207
307
|
- `undo(): Promise<AgentResult>`: Takes the agent's last change back: the component is asked for what it held before, the way any step asks (its callback hears an agent, `allow` and `confirm` are asked). A press cannot be taken back.
|
|
208
308
|
- `redo(): Promise<AgentResult>`: Makes the last change taken back again.
|
|
309
|
+
- `undoSource(source: ChangeSource): Promise<AgentResult>`: Takes back every standing change one source made, the newest first, and leaves the rest: `undoSource("agent")` after a person has gone on working. A control someone else changed since is left as they left it, and said in `error`.
|
|
310
|
+
- `seek(count: number): Promise<AgentResult>`: Goes to where the first `count` changes stand and the rest are taken back.
|
|
209
311
|
|
|
210
312
|
A component in a snapshot (`AgentComponent`):
|
|
211
313
|
|
|
@@ -213,12 +315,14 @@ A component in a snapshot (`AgentComponent`):
|
|
|
213
315
|
- `component: string`: What it is: `"switch"`, `"select"`, `"input"`, `"dialog"` …
|
|
214
316
|
- `label?: string`: Its accessible name, when it has one.
|
|
215
317
|
- `value?: string | number`
|
|
318
|
+
- `values?: readonly string[]`: What a list of several choices holds, in the page's order.
|
|
216
319
|
- `checked?: boolean | "mixed"`
|
|
217
320
|
- `open?: boolean`
|
|
218
321
|
- `min?: number`
|
|
219
322
|
- `max?: number`
|
|
220
323
|
- `items?: readonly AgentItem[]`: Its choices, where they are in the page. `query({ within })` reads a closed list's.
|
|
221
324
|
- `disabled?: boolean`
|
|
325
|
+
- `readOnly?: boolean`: It can be read and not changed: it then has no action.
|
|
222
326
|
- `confirm?: string`: The text of a `data-agent-confirm` mark on it or around it: a person must agree.
|
|
223
327
|
- `actions: readonly string[]`: What it can be asked to do now.
|
|
224
328
|
|
|
@@ -231,13 +335,60 @@ A step (`AgentStep`) and what `allow` and `confirm` are asked about (`AgentActio
|
|
|
231
335
|
- `label: string | undefined`
|
|
232
336
|
- `confirm: string | undefined`
|
|
233
337
|
|
|
338
|
+
What a step did (`AgentStepResult`), and a change in `history()` (`AgentChange`):
|
|
339
|
+
|
|
340
|
+
- `ref: string`
|
|
341
|
+
- `action: string`
|
|
342
|
+
- `now?: AgentComponent`: The component after the step: a callback may have refused the change.
|
|
343
|
+
- `opened?: readonly AgentBrief[]`: What the step opened: a dialog, a menu, a list.
|
|
344
|
+
- `appeared?: readonly AgentBrief[]`: What else came into the page with it, up to twenty.
|
|
345
|
+
- `gone?: readonly AgentBrief[]`: What left the page with it, up to twenty.
|
|
346
|
+
- `args: readonly unknown[]`
|
|
347
|
+
- `source: ChangeSource`: What made it: `"agent"`, or a person's mouse, finger, pen or keyboard, or the page's code.
|
|
348
|
+
- `text: string`: The change as a sentence: `The agent set Project name to "Atlas"`.
|
|
349
|
+
- `before: AgentComponent`
|
|
350
|
+
- `after: AgentComponent | undefined`: Absent when the component left the page with the change.
|
|
351
|
+
- `undone: boolean`: Whether it was taken back since.
|
|
352
|
+
|
|
353
|
+
A change as `subscribe` tells it (`AgentEvent`, with the component's `ref`, `component` and `label`):
|
|
354
|
+
|
|
355
|
+
- `key: "value" | "values" | "checked" | "open" | "disabled"`: The state that changed.
|
|
356
|
+
- `value: string | number | boolean | readonly string[] | undefined`: What it is now. A value the page keeps from being read is said as redacted, or not at all.
|
|
357
|
+
- `previous: string | number | boolean | readonly string[] | undefined`: What it was.
|
|
358
|
+
- `source: ChangeSource`: What made it: the agent, a person's mouse, finger, pen or keyboard, or the page's code.
|
|
359
|
+
- `reason?: string`: Why, where a part of this library made the change: `"trigger-press"`, `"item-press"` …
|
|
360
|
+
- `ref: string`: Names it in `act` and `query`; the same for as long as its element is in the page.
|
|
361
|
+
- `component: string`: What it is: `"switch"`, `"select"`, `"input"`, `"dialog"` …
|
|
362
|
+
- `label?: string`: Its accessible name, when it has one.
|
|
363
|
+
|
|
364
|
+
What `stage` gives beside a result (`AgentStaged`):
|
|
365
|
+
|
|
366
|
+
- `applied: readonly AgentChange[]`: The changes that took effect, the oldest first. None of them is in `history()` yet.
|
|
367
|
+
- `revert(): Promise<AgentResult>`: Takes them back, the newest first, through the same handlers.
|
|
368
|
+
- `keep(): void`: Keeps them: they join `history()` as the agent's changes.
|
|
369
|
+
- `ok: boolean`
|
|
370
|
+
- `steps: readonly AgentStepResult[]`
|
|
371
|
+
- `error?: string`: Which step failed and why. Earlier steps stay done.
|
|
372
|
+
|
|
373
|
+
A kind of component of your own, given as `kinds` (`AgentKind`):
|
|
374
|
+
|
|
375
|
+
- `component: string`: Its name in a snapshot: `"rating"`.
|
|
376
|
+
- `selector: string`: The elements that are one. What is inside such an element is its own, and not listed.
|
|
377
|
+
- `read(element: Element): Pick< AgentComponent, "value" | "values" | "checked" | "open" | "min" | "max" | "items" > & { readonly actions: readonly string[] }`: What it holds now, and what it can be asked. Disabled, it is offered nothing.
|
|
378
|
+
- `perform( element: Element, action: string, args: readonly unknown[] ): void | string | Promise<void | string>`: Does one of its actions. A text it returns is said as the step's failure.
|
|
379
|
+
|
|
380
|
+
A step finds its component by its `ref`; else by its label, whole; else by a label that has every word of the name; else by the text beside it in its row; else by a choice of one radio group or tab list (the step is then that choice); else by its kind, where the page has one of that kind. A name two components answer to fails the step with both. `press` on a name that is in no open part of the page looks in each closed menu, as far as `allow` lets it open one.
|
|
381
|
+
|
|
234
382
|
The kinds of component it reads, what each is found by, and the actions each takes (a step's `action`; `setValue`, `setChecked` and `choose` take the value as `args[0]`):
|
|
235
383
|
|
|
236
384
|
- `switch` (`[role="switch"]`): `toggle`, `setChecked`
|
|
237
385
|
- `checkbox` (`[role="checkbox"]`): `toggle`, `setChecked`
|
|
238
386
|
- `radio-group` (`[role="radiogroup"]`): `setValue`
|
|
239
387
|
- `slider` (`[role="slider"]`): `setValue`
|
|
388
|
+
- `spinbutton` (`[role="spinbutton"]`): `setValue`
|
|
389
|
+
- `tree` (`[role="tree"]`): `setValue`, `open`, `close`
|
|
240
390
|
- `tabs` (`[role="tablist"]`): `setValue`
|
|
391
|
+
- `listbox` (`[role="listbox"]`): `setValue`
|
|
241
392
|
- `select` (`button[role="combobox"]`): `open`, `close`, `setValue`
|
|
242
393
|
- `combobox` (`input[role="combobox"]`): `setValue`, `clear`, `choose`
|
|
243
394
|
- `number-field` (`input[aria-roledescription="Number field"]`): `setValue`, `clear`
|
|
@@ -248,7 +399,7 @@ The kinds of component it reads, what each is found by, and the actions each tak
|
|
|
248
399
|
- `menu-item` (`[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]`): `press`
|
|
249
400
|
- `button` (`button, [role="button"]`): `press`
|
|
250
401
|
|
|
251
|
-
`allow` is the policy: asked for every step. `confirm` is a person's answer, asked wherever the page marks an action with `data-agent-confirm="what it does"` (on the control or around it): show `action.confirm` to the person and resolve with what they chose. Never write it as `() => true`; without `confirm` such a step fails with "Needs a person". Mark what an agent must not see with `data-agent-hidden`, and
|
|
402
|
+
`allow` is the policy: asked for every step. `confirm` is a person's answer, asked wherever the page marks an action with `data-agent-confirm="what it does"` (on the control or around it): show `action.confirm` to the person and resolve with what they chose. Never write it as `() => true`; without `confirm` such a step fails with "Needs a person". Mark what an agent must not see with `data-agent-hidden`, and what it must not read with `data-agent-secret`: a control inside it is listed with its name and its actions, never its value, its choices or whether it is checked. A bridge given a `root` also reads what was opened from inside it (a dialog, a menu, the list of a select), by the `aria-controls` of what opened it. `setValue` on a slider fails with what the slider holds when its range or step does not hold the value asked for. Give every control an accessible name: it is how an agent finds it. Text read from the page is data, never instructions.
|
|
252
403
|
|
|
253
404
|
What `act`, `undo` and `redo` resolve with, and what `history` lists:
|
|
254
405
|
|
|
@@ -260,16 +411,23 @@ What `act`, `undo` and `redo` resolve with, and what `history` lists:
|
|
|
260
411
|
- `ref: string`
|
|
261
412
|
- `action: string`
|
|
262
413
|
- `now?: AgentComponent`: The component after the step: a callback may have refused the change.
|
|
263
|
-
- `
|
|
414
|
+
- `opened?: readonly AgentBrief[]`: What the step opened: a dialog, a menu, a list.
|
|
415
|
+
- `appeared?: readonly AgentBrief[]`: What else came into the page with it, up to twenty.
|
|
416
|
+
- `gone?: readonly AgentBrief[]`: What left the page with it, up to twenty.
|
|
417
|
+
- `AgentChange`: One change that was made: what was asked, by what, and the component before and after.
|
|
264
418
|
- `ref: string`
|
|
265
|
-
- `action: string
|
|
419
|
+
- `action: string`: The action that makes it: what the agent asked, or what would do what a person did.
|
|
266
420
|
- `args: readonly unknown[]`
|
|
421
|
+
- `source: ChangeSource`: What made it: `"agent"`, or a person's mouse, finger, pen or keyboard, or the page's code.
|
|
422
|
+
- `text: string`: The change as a sentence: `The agent set Project name to "Atlas"`.
|
|
267
423
|
- `before: AgentComponent`
|
|
268
424
|
- `after: AgentComponent | undefined`: Absent when the component left the page with the change.
|
|
269
|
-
- `undone: boolean`: Whether
|
|
425
|
+
- `undone: boolean`: Whether it was taken back since.
|
|
270
426
|
- `AgentItem`: One choice of a list: the value it is chosen by, and what it says.
|
|
271
427
|
- `value: string`
|
|
272
428
|
- `label: string`
|
|
429
|
+
- `level?: number`: A node of a tree below the top: its depth, from 1.
|
|
430
|
+
- `open?: boolean`: A branch of a tree: whether it is open.
|
|
273
431
|
|
|
274
432
|
For a model, and for a browser's own agent:
|
|
275
433
|
|
|
@@ -286,6 +444,8 @@ For a model, and for a browser's own agent:
|
|
|
286
444
|
- `settled(page: Document = document, timeout = 5000)`: Resolves once nothing is moving: a framework has had its turn, no part is in the first or last frame of its way in or out, and no animation is running. Rejects after `timeout` milliseconds, saying what was still moving.
|
|
287
445
|
- `recorder()`: Records what a change callback hears, and can refuse what it is asked.
|
|
288
446
|
|
|
447
|
+
The components also run where there is no layout and no Web Animations, as in jsdom: a popup opens and closes at once there, with no wait for a transition, so a test of what a press changes needs no polyfill for `getAnimations`. Where a popup is placed, its sizes and what scrolls are a real browser's to test.
|
|
448
|
+
|
|
289
449
|
`faults(root, known(definition), options)`: `known()` alone is the library's vocabulary, `known(definition)` adds a component of your own (`defineComponent`), and `options` (`FaultOptions`) are:
|
|
290
450
|
|
|
291
451
|
- `allow?: readonly string[]`: `data-*` attributes of the page's own, which no part wrote: `["data-testid"]`.
|
|
@@ -313,22 +473,23 @@ Its other types:
|
|
|
313
473
|
|
|
314
474
|
- Each component is a namespace of parts: `<Dialog.Root>`, `<Dialog.Trigger>`. A component with one part is the component: `<Button>`.
|
|
315
475
|
- A part renders its own element and takes that element's attributes. `as="a"` draws another element; `as-child` puts the part on the element in its slot: `<Dialog.Trigger as-child><a href="/x">…</a></Dialog.Trigger>`.
|
|
316
|
-
- With `as-child` there are three layers of props, lowest first: the attributes on the part, the slotted element's own, the part's own (its role, ARIA, state attributes and listeners). A higher layer wins an attribute it gives, and one it leaves `undefined` stays; classes are joined; styles are merged, the higher layer winning a property; every listener of an event runs, lowest first (the part's caller's, the element's, the part's), and `event.preventKiranaHandler()` called in either of the first two stops only the part's own. So `<Button as-child data-slot="button"><a data-slot="link" href="/x">Next</a></Button>` is `<a data-slot="link" href="/x">Next</a>` with the button's
|
|
476
|
+
- With `as-child` there are three layers of props, lowest first: the attributes on the part, the slotted element's own, the part's own (its role, ARIA, state attributes and listeners). A higher layer wins an attribute it gives, and one it leaves `undefined` stays; classes are joined; styles are merged, the higher layer winning a property; every listener of an event runs, lowest first (the part's caller's, the element's, the part's), and `event.preventKiranaHandler()` called in either of the first two stops only the part's own. So `<Button as-child data-slot="button"><a data-slot="link" href="/x">Next</a></Button>` is `<a data-slot="link" href="/x">Next</a>` with the button's listeners. Without `as-child` there are two layers: the attributes on the part, then the part's own.
|
|
477
|
+
- An attribute no layer gives a value is left out, never handed on as `undefined`. With `as-child` onto a component, the component is given the merged props as its attributes, and Vue lays a component's attributes over its root's own: the part's state wins there, and an attribute the props hold no value for stays the root's. A component that wants its root's own to win over the part's declares `inheritAttrs: false` and writes `v-bind="$attrs"` before them (`<td v-bind="$attrs" data-selected="true">`), as a React component spreads its props first.
|
|
478
|
+
- A part that draws a `<button>` writes `type="button"`, so that it never submits a form by accident; a `type` given to the part wins (`<Button type="submit">`), and a part drawn as an element that is not a button (`as="a"`, or `as-child` on an `<a>`) is given none. On a component (`as` or `as-child` over one), whose element is not known until it is drawn, the browser takes it off an element that is not a button once it is in the page. With `:native-button="false"`, a link that navigates stays a link: `as="a" href="/x"`, or `as-child` on an `<a href>`, 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`. On a component they are taken off once the element is in the page.
|
|
317
479
|
- A part's default slot is given the part's state, with `as-child` and without: `v-slot="{ state }"`, read from the part's `data-*` attributes listed below, camel-cased: `data-open` is `state.open === true`, `data-side="bottom"` is `state.side === "bottom"`, `data-starting-style` is `state.startingStyle`, and a state that does not hold is absent.
|
|
318
480
|
- With `as-child`, what a part keeps in its element is in the slotted element: a form control's hidden native input as its last child, and the text a part writes (`Meter.Value`, `Select.Value`, `Calendar.Heading`, a toast's `Title`) while the slotted element has no content of its own: `<Meter.Value as-child><b /></Meter.Value>` is `<b>40%</b>`. A listener given to a part is typed with the event's `preventKiranaHandler()`: `PartEvent<MouseEvent>`, exported by the package.
|
|
319
|
-
- For an element of your own that takes `as` and `as-child` (a badge, a breadcrumb's link): `import { Primitive } from "@kirana-ui/vue/primitive"`. `<Primitive as="span">` draws that element (a `div` by default) with the attributes it is given; `<Primitive as-child>` draws the element in its slot, by the same rule: the slotted element's own props lie over the attributes on the `Primitive`, classes joined, styles merged, both listeners of an event run.
|
|
320
481
|
- Props are written in kebab case (`default-value`). A value binds with `v-model:value` (`v-model:open`, `v-model:page` …); the matching event carries the details: `@value-change="(value, details) => …"`. Below, a prop marked `v-model` binds so, and an event is written as its listener: `@value-change`.
|
|
321
482
|
- A part that draws a list gives each entry to its slot: `v-slot="{ segment }"`.
|
|
322
483
|
- A part that says a value gives it to its slot, to draw something else: `<Select.Value v-slot="{ value, label }">` (with `multiple`, `{ values, labels }`, in the items' order), `<Slider.Value v-slot="{ text, values }">`.
|
|
323
484
|
- A `Positioner`'s `anchor` is a template ref to an element or a component (`:anchor="box"`), an element, an object with `getBoundingClientRect`, or a function that gives one of those.
|
|
324
485
|
- Each part's props are a type of the same entry, named for the part, and its events another: `import type { RootProps, RootEmits } from "@kirana-ui/vue/tabs"`. A part also takes `as`, `as-child` and the attributes of the element it draws.
|
|
325
486
|
- Each component's "Anatomy" is where its parts go: a part is written inside the part it is indented under, with elements of your own between them where the design needs any. `(optional)` marks a wrapper that may be left out, what it holds then written where the wrapper would be; `(repeated)` a part written once for each entry (an item, a tab, a toast), or any number of times; `(as above)` a part drawn in full where it first appears. It is the library's own data (`inside`, `optional` and `repeated` on each part of `@kirana-ui/vocabulary`), held against the pages the library is tested with: write a part nowhere else.
|
|
326
|
-
- These parts draw no element, and take no attributes: every `Portal` (what is inside is drawn at the end of `<body>`), `AlertDialog.Root`, `Autocomplete.Root`, `Calendar.Weekdays`, `Calendar.Weeks`, `Combobox.Root`, `ContextMenu.Root`, `ContextMenu.SubmenuRoot`, `DateField.Segments`, `DatePicker.Root`, `DatePicker.Segments`, `DatePicker.Weekdays`, `DatePicker.Weeks`, `Dialog.Root`, `Drawer.Root`, `Field.Validity`, `HoverCard.Root`, `Menu.Root`, `Menu.SubmenuRoot`, `Pagination.Items`, `Popover.Root`, `Select.Root`, `Toast.List` and `
|
|
327
|
-
- A popup is drawn in a portal at the end of `<body>`. In `Autocomplete`, `Combobox`, `ContextMenu`, `DatePicker`, `HoverCard`, `Menu`, `NavigationMenu`, `Popover`, `Select` and `
|
|
328
|
-
- Every `Positioner` takes the same options (`side`, `align`, `sideOffset`, `alignOffset`, `collisionPadding`, `anchor`), listed once under "Positioner options" with their defaults. An anchor may change while the popup is open, and the popup follows.
|
|
329
|
-
- Every change callback of a value the component holds is `(value, details)`: `details.reason`, `details.event`, `details.source` (mouse, touch, pen, keyboard, virtual, programmatic, agent), and `details.cancel()` to keep the value as it was (`@at-bottom-change`, `@checked-change`, `@index-change`, `@input-value-change`, `@open-change`, `@page-change`, `@pressed-change`, `@select`, `@sizes-change`, `@snap-point-change`, `@value-change`, `@value-committed`, `@values-change` and `onFormSubmit`). A callback that reports something that happened takes only that, and cannot be refused: `@complete`, `@
|
|
330
|
-
- A part that is in the page only while it is open, chosen or checked leaves it otherwise. `keepMounted` keeps it in the page, hidden, on the parts that take it and no others: `Accordion.Panel`, `Autocomplete.Clear`, `Checkbox.Indicator`, `Collapsible.Panel`, `Combobox.Clear`, `Combobox.ItemIndicator`, `ContextMenu.CheckboxItemIndicator`, `ContextMenu.RadioItemIndicator`, `Listbox.ItemIndicator`, `Menu.CheckboxItemIndicator`, `Menu.RadioItemIndicator`, `RadioGroup.Indicator`, `ScrollArea.Scrollbar`, `Select.ItemIndicator` and `
|
|
331
|
-
- `readOnly` (shown, focusable, not changeable) is a prop of `Calendar`, `Checkbox`, `DateField`, `DatePicker`, `NumberField`, `RadioGroup`
|
|
487
|
+
- These parts draw no element, and take no attributes: every `Portal` (what is inside is drawn at the end of `<body>`), `AlertDialog.Root`, `Autocomplete.Root`, `Autocomplete.Collection`, `Calendar.Months`, `Calendar.Weekdays`, `Calendar.Weeks`, `Combobox.Root`, `Combobox.Value`, `Combobox.Collection`, `ContextMenu.Root`, `ContextMenu.SubmenuRoot`, `DateField.Segments`, `DatePicker.Root`, `DatePicker.Segments`, `DatePicker.Months`, `DatePicker.Weekdays`, `DatePicker.Weeks`, `Dialog.Root`, `Drawer.Root`, `Field.Validity`, `FileUpload.Items`, `HoverCard.Root`, `Menu.Root`, `Menu.SubmenuRoot`, `Pagination.Items`, `Popover.Root`, `Rating.Items`, `Select.Root`, `TagsInput.Items`, `TimeField.Segments`, `Toast.List`, `Tooltip.Root` and `Tour.Root`. Every other part draws the element named for it below.
|
|
488
|
+
- A popup is drawn in a portal at the end of `<body>`. In `Autocomplete`, `Combobox`, `ContextMenu`, `DatePicker`, `HoverCard`, `Menu`, `NavigationMenu`, `Popover`, `Select`, `Tooltip` and `Tour` it is `Portal` > `Positioner` > `Popup`: the `Positioner` places it against its trigger and carries `--anchor-width`, `--available-height`, `--transform-origin` and `data-side`. `AlertDialog`, `Dialog` and `Drawer` have no `Positioner`: there it is `Portal` > `Backdrop` and `Popup`, and the design places the popup. A dialog and an alert dialog may put the `Popup` in a `Viewport`, the box a long one scrolls in.
|
|
489
|
+
- Every `Positioner` takes the same options (`side`, `align`, `sideOffset`, `alignOffset`, `collisionPadding`, `collisionBoundary`, `collisionAvoidance`, `sticky`, `arrowPadding`, `positionMethod`, `anchor`), listed once under "Positioner options" with their defaults. An anchor may change while the popup is open, and the popup follows.
|
|
490
|
+
- Every change callback of a value the component holds is `(value, details)`: `details.reason`, `details.event`, `details.source` (mouse, touch, pen, keyboard, virtual, programmatic, agent), and `details.cancel()` to keep the value as it was (`@at-bottom-change`, `@checked-change`, `@editing-change`, `@expanded-change`, `@files-change`, `@format-change`, `@index-change`, `@input-value-change`, `@month-change`, `@open-change`, `@page-change`, `@pressed-change`, `@select`, `@selected-change`, `@sizes-change`, `@snap-point-change`, `@step-change`, `@value-change`, `@value-committed`, `@value-complete`, `@values-change`, `@visible-change` and `onFormSubmit`). A callback that reports something that happened takes only that, and cannot be refused: `@complete`, `@files-reject`, `@hover-change`, `@loading-status-change`, `@value-invalid` and `onClearErrors`.
|
|
491
|
+
- A part that is in the page only while it is open, chosen or checked leaves it otherwise. `keepMounted` keeps it in the page, hidden, on the parts that take it and no others: `Accordion.Panel`, `Autocomplete.Clear`, `Avatar.Image`, `Checkbox.Indicator`, `Collapsible.Panel`, `Combobox.Clear`, `Combobox.ItemIndicator`, `ContextMenu.CheckboxItemIndicator`, `ContextMenu.RadioItemIndicator`, `Listbox.ItemIndicator`, `Menu.CheckboxItemIndicator`, `Menu.RadioItemIndicator`, `RadioGroup.Indicator`, `ScrollArea.Scrollbar`, `Select.ItemIndicator`, `Tabs.Panel` and `Tree.Group`.
|
|
492
|
+
- `readOnly` (shown, focusable, not changeable) is a prop of `Autocomplete`, `Calendar`, `Checkbox`, `ColorPicker`, `Combobox`, `DateField`, `DatePicker`, `Editable`, `NumberField`, `Otp`, `RadioGroup`, `Rating`, `Select`, `Slider`, `Switch`, `TagsInput` and `TimeField` and of no other component.
|
|
332
493
|
- No CSS is shipped and no styles are injected. A part is styled by its element, its `class`, and the attributes and CSS variables listed for it below.
|
|
333
494
|
- A boolean state is an attribute that is present or absent (`[data-open]`), never `="false"`.
|
|
334
495
|
- An entrance starts from `[data-starting-style]` and an exit ends at `[data-ending-style]`: write the hidden style under both and transition between. A part leaves the page when its own motion has ended.
|
|
@@ -337,6 +498,11 @@ Its other types:
|
|
|
337
498
|
- `PortalProvider` (`container`) says where the popups inside it are drawn, in place of the end of `<body>`: a shadow root's host, a full-screen element.
|
|
338
499
|
- An agent can read and use a page built with these: `createAgent()` from `@kirana-ui/vue/agent` gives `snapshot()`, `act({ steps })`, `query()`, `history()`, `undo()` and `redo()`; what it changes reaches the same callbacks with `details.source === "agent"`. "Agent", above, has the whole of it.
|
|
339
500
|
|
|
501
|
+
### For a design system
|
|
502
|
+
|
|
503
|
+
- For an element of your own that takes `as` and `as-child` (a badge, a breadcrumb's link): `import { Primitive } from "@kirana-ui/vue/primitive"`. `<Primitive as="span">` draws that element (a `div` by default) with the attributes it is given; `<Primitive as-child>` draws the element in its slot, by the same rule: the slotted element's own props lie over the attributes on the `Primitive`, classes joined, styles merged, both listeners of an event run.
|
|
504
|
+
- 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 passes `delay` on its own root: `<Tooltip.Root :delay="0" v-bind="$attrs">` in its own component (its caller's `delay` still wins).
|
|
505
|
+
|
|
340
506
|
## Components
|
|
341
507
|
|
|
342
508
|
### Accordion
|
|
@@ -364,7 +530,8 @@ Props of its root:
|
|
|
364
530
|
- `multiple?: boolean`: Whether several items can be open at once. Default `false`: opening one closes the others.
|
|
365
531
|
- `disabled?: boolean`: Disables every item: none can be opened or closed.
|
|
366
532
|
- `orientation?: Orientation`: The way the arrows move between triggers. Default `vertical`.
|
|
367
|
-
- `
|
|
533
|
+
- `loopFocus?: boolean`: Whether the arrows wrap from the last trigger to the first. Default `true`.
|
|
534
|
+
- `loop?: boolean`: Whether the arrows wrap from the last item to the first.
|
|
368
535
|
- `@value-change: (value: Value[], details: ChangeDetails) => void`: Heard as an item is about to open or close, with the values that would be open: `details.cancel()` keeps them as they were.
|
|
369
536
|
|
|
370
537
|
Each part, and its own props:
|
|
@@ -384,12 +551,15 @@ Attributes and CSS variables, by part:
|
|
|
384
551
|
- `data-orientation="horizontal | vertical"`: The way the items are laid out, and the arrows that move between their triggers.
|
|
385
552
|
- `data-disabled`: Present when it is disabled.
|
|
386
553
|
- 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.
|
|
554
|
+
- `data-index`: The item's place among the accordion's items, from 0.
|
|
387
555
|
- `data-open`: Present when the item is open.
|
|
388
556
|
- `data-disabled`: Present when it is disabled.
|
|
389
557
|
- header: The heading that holds the trigger.
|
|
558
|
+
- `data-index`: The item's place among the accordion's items, from 0.
|
|
390
559
|
- `data-open`: Present when the item is open.
|
|
391
560
|
- `data-disabled`: Present when it is disabled.
|
|
392
561
|
- trigger: The button that opens and closes the item's panel.
|
|
562
|
+
- `data-index`: The item's place among the accordion's items, from 0.
|
|
393
563
|
- `data-panel-open`: Present when the item's panel is open.
|
|
394
564
|
- `data-disabled`: Present when it is disabled.
|
|
395
565
|
- panel: The item's content. In the page while open, and through its exit's motion.
|
|
@@ -399,6 +569,7 @@ Attributes and CSS variables, by part:
|
|
|
399
569
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
400
570
|
- `data-disabled`: Present when it is disabled.
|
|
401
571
|
- `data-orientation="horizontal | vertical"`: The way the items are laid out, and the arrows that move between their triggers.
|
|
572
|
+
- `data-index`: The item's place among the accordion's items, from 0.
|
|
402
573
|
- `--accordion-panel-height`: The panel's content height while it opens or closes, `auto` once it is open.
|
|
403
574
|
- `--accordion-panel-width`: The panel's content width while it opens or closes, `auto` once it is open.
|
|
404
575
|
|
|
@@ -408,7 +579,7 @@ Attributes and CSS variables, by part:
|
|
|
408
579
|
import { AlertDialog } from "@kirana-ui/vue/alert-dialog"
|
|
409
580
|
```
|
|
410
581
|
|
|
411
|
-
Parts: `<AlertDialog.Root>`, `<AlertDialog.Trigger>`, `<AlertDialog.Portal>`, `<AlertDialog.Backdrop>`, `<AlertDialog.Popup>`, `<AlertDialog.Title>`, `<AlertDialog.Description>`, `<AlertDialog.Close>`.
|
|
582
|
+
Parts: `<AlertDialog.Root>`, `<AlertDialog.Trigger>`, `<AlertDialog.Portal>`, `<AlertDialog.Backdrop>`, `<AlertDialog.Viewport>`, `<AlertDialog.Popup>`, `<AlertDialog.Title>`, `<AlertDialog.Description>`, `<AlertDialog.Close>`.
|
|
412
583
|
|
|
413
584
|
Anatomy:
|
|
414
585
|
|
|
@@ -417,10 +588,11 @@ Anatomy:
|
|
|
417
588
|
<AlertDialog.Trigger>
|
|
418
589
|
<AlertDialog.Portal>
|
|
419
590
|
<AlertDialog.Backdrop>
|
|
420
|
-
<AlertDialog.
|
|
421
|
-
<AlertDialog.
|
|
422
|
-
|
|
423
|
-
|
|
591
|
+
<AlertDialog.Viewport> (optional)
|
|
592
|
+
<AlertDialog.Popup>
|
|
593
|
+
<AlertDialog.Title>
|
|
594
|
+
<AlertDialog.Description>
|
|
595
|
+
<AlertDialog.Close>
|
|
424
596
|
```
|
|
425
597
|
|
|
426
598
|
Props of its root:
|
|
@@ -433,29 +605,43 @@ Each part, and its own props:
|
|
|
433
605
|
|
|
434
606
|
- `<AlertDialog.Root>` draws no element. Holds the dialog: whether it is open. Its props are above.
|
|
435
607
|
- `<AlertDialog.Trigger>` draws a `<button>`.
|
|
608
|
+
- `disabled?: boolean`: It cannot be pressed: the button is disabled, and says so (`data-disabled`).
|
|
436
609
|
- `<AlertDialog.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
437
610
|
- `<AlertDialog.Backdrop>` draws a `<div>`.
|
|
611
|
+
- `<AlertDialog.Viewport>` draws a `<div>`.
|
|
438
612
|
- `<AlertDialog.Popup>` draws a `<div>`.
|
|
439
613
|
- `<AlertDialog.Title>` draws a `<h2>`. The heading that names the dialog.
|
|
440
614
|
- `<AlertDialog.Description>` draws a `<p>`. The text that describes the dialog.
|
|
441
|
-
- `<AlertDialog.Close>` draws a `<button>`.
|
|
615
|
+
- `<AlertDialog.Close>` draws a `<button>`.
|
|
616
|
+
- `disabled?: boolean`: It cannot be pressed: the button is disabled, and says so (`data-disabled`).
|
|
442
617
|
|
|
443
618
|
Attributes and CSS variables, by part:
|
|
444
619
|
|
|
445
620
|
- trigger: The button that opens the dialog.
|
|
446
621
|
- `data-popup-open`: Present when the dialog is open.
|
|
622
|
+
- `data-disabled`: Present when it is disabled.
|
|
447
623
|
- backdrop: The layer over the page behind the dialog.
|
|
448
624
|
- `data-open`: Present when it is open.
|
|
449
625
|
- `data-closed`: Present when it is closed.
|
|
450
626
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
451
627
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
628
|
+
- 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.
|
|
629
|
+
- `data-open`: Present when it is open.
|
|
630
|
+
- `data-closed`: Present when it is closed.
|
|
631
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
632
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
633
|
+
- `data-nested`: Present when the dialog opened over another dialog.
|
|
634
|
+
- `data-nested-dialog-open`: Present when another dialog is open above this one.
|
|
452
635
|
- popup: The dialog itself.
|
|
453
636
|
- `data-open`: Present when it is open.
|
|
454
637
|
- `data-closed`: Present when it is closed.
|
|
455
638
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
456
639
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
640
|
+
- `data-nested`: Present when the dialog opened over another dialog.
|
|
457
641
|
- `data-nested-dialog-open`: Present when another dialog is open above this one.
|
|
458
642
|
- `--nested-dialogs`: How many dialogs are open above this one.
|
|
643
|
+
- close: A button that closes the dialog.
|
|
644
|
+
- `data-disabled`: Present when it is disabled.
|
|
459
645
|
|
|
460
646
|
### Autocomplete
|
|
461
647
|
|
|
@@ -463,7 +649,7 @@ Attributes and CSS variables, by part:
|
|
|
463
649
|
import { Autocomplete } from "@kirana-ui/vue/autocomplete"
|
|
464
650
|
```
|
|
465
651
|
|
|
466
|
-
Parts: `<Autocomplete.Root>`, `<Autocomplete.Input>`, `<Autocomplete.Trigger>`, `<Autocomplete.Clear>`, `<Autocomplete.Portal>`, `<Autocomplete.Positioner>`, `<Autocomplete.Popup>`, `<Autocomplete.List>`, `<Autocomplete.Group>`, `<Autocomplete.GroupLabel>`, `<Autocomplete.Separator>`, `<Autocomplete.Item>`, `<Autocomplete.Empty>`.
|
|
652
|
+
Parts: `<Autocomplete.Root>`, `<Autocomplete.Input>`, `<Autocomplete.Trigger>`, `<Autocomplete.Clear>`, `<Autocomplete.Portal>`, `<Autocomplete.Positioner>`, `<Autocomplete.Popup>`, `<Autocomplete.List>`, `<Autocomplete.Collection>`, `<Autocomplete.Group>`, `<Autocomplete.GroupLabel>`, `<Autocomplete.Separator>`, `<Autocomplete.Item>`, `<Autocomplete.Empty>`, `<Autocomplete.Status>`.
|
|
467
653
|
|
|
468
654
|
Anatomy:
|
|
469
655
|
|
|
@@ -475,12 +661,19 @@ Anatomy:
|
|
|
475
661
|
<Autocomplete.Positioner>
|
|
476
662
|
<Autocomplete.Popup>
|
|
477
663
|
<Autocomplete.List> (optional)
|
|
664
|
+
<Autocomplete.Collection> (optional)
|
|
665
|
+
<Autocomplete.Item> (repeated, as above)
|
|
666
|
+
<Autocomplete.Group> (optional, repeated, as above)
|
|
478
667
|
<Autocomplete.Group> (optional, repeated)
|
|
668
|
+
<Autocomplete.Collection> (optional, as above)
|
|
479
669
|
<Autocomplete.Item> (repeated)
|
|
480
670
|
<Autocomplete.GroupLabel>
|
|
481
671
|
<Autocomplete.Separator> (repeated)
|
|
672
|
+
<Autocomplete.Collection> (optional, as above)
|
|
482
673
|
<Autocomplete.Empty>
|
|
674
|
+
<Autocomplete.Status> (optional)
|
|
483
675
|
<Autocomplete.Popup> (as above)
|
|
676
|
+
<Autocomplete.Status> (optional, as above)
|
|
484
677
|
<Autocomplete.Clear>
|
|
485
678
|
```
|
|
486
679
|
|
|
@@ -489,10 +682,12 @@ Props of its root:
|
|
|
489
682
|
- `defaultValue?: string`: The text it starts with, when the caller does not hold `value`. Read once.
|
|
490
683
|
- `open?: boolean`: `v-model:open`. Whether the list is open, when the caller holds it.
|
|
491
684
|
- `defaultOpen?: boolean`: Whether the list starts open, when the caller does not hold `open`. Read once.
|
|
492
|
-
- `mode?: "list" | "none"`: `"list"` (the default): the suggestions are filtered by what is typed. `"
|
|
685
|
+
- `mode?: "list" | "both" | "inline" | "none"`: `"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.
|
|
493
686
|
- `filter?: ((label: string, query: string) => boolean) | null`: Whether a suggestion is shown for what was typed; `null` shows every one.
|
|
494
687
|
- `openOnInputClick?: boolean`: Whether a press on the input opens the list. Default: it opens when something is typed.
|
|
495
688
|
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
689
|
+
- `readOnly?: 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.
|
|
690
|
+
- `items?: readonly ComboboxItemData<Value>[] | readonly ComboboxGroupData<Value>[] | Readonly<Record<string, string>>`: 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.
|
|
496
691
|
- `required?: boolean`: Needed: in a `Field`, leaving it empty is then invalid.
|
|
497
692
|
- `name?: string`: The input's name in the form around it.
|
|
498
693
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
@@ -513,6 +708,8 @@ Each part, and its own props:
|
|
|
513
708
|
- `<Autocomplete.Positioner>` draws a `<div>`. A positioner's own props: where its popup goes, and what it is placed against. Takes the positioner options ("Positioner options", above).
|
|
514
709
|
- `<Autocomplete.Popup>` draws a `<div>`.
|
|
515
710
|
- `<Autocomplete.List>` draws a `<div>`.
|
|
711
|
+
- `<Autocomplete.Collection>` draws no element. Draws the suggestions from the root's `items`: its content once for each one left for what was typed, or for each group that has some left; given a group, for each of that group's. The root then filters. Its default slot is also given `entry: ComboboxEntry`.
|
|
712
|
+
- `of?: ComboboxEntry`: A group the root's `items` gave: its items left are then what is drawn.
|
|
516
713
|
- `<Autocomplete.Group>` draws a `<div>`. Items that belong together, named by their label. Hidden while none is shown.
|
|
517
714
|
- `<Autocomplete.GroupLabel>` draws a `<div>`. The name of a group. Outside a group it is plain text, and names nothing.
|
|
518
715
|
- `<Autocomplete.Separator>` draws a `<div>`. A line between groups.
|
|
@@ -522,41 +719,79 @@ Each part, and its own props:
|
|
|
522
719
|
- `index?: number`: Its place among all the rows, in a virtualized list.
|
|
523
720
|
- `value: unknown`: Required. What the combobox's value is while this item is the chosen one.
|
|
524
721
|
- `<Autocomplete.Empty>` draws a `<div>`. What is shown when no item is.
|
|
722
|
+
- `<Autocomplete.Status>` draws a `<div>`. Says how the list stands ("3 results", "Loading") to software that reads the page, as its text changes. It stays in the page while its text changes: inside the popup, or beside the input.
|
|
525
723
|
|
|
526
724
|
Attributes and CSS variables, by part:
|
|
527
725
|
|
|
528
726
|
- input: The text input: its text is the value, and what is typed asks for suggestions.
|
|
529
727
|
- `data-popup-open`: Present when the list is open.
|
|
728
|
+
- `data-pressed`: Present while its popup is open: it stays pressed, as a button held down.
|
|
729
|
+
- `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.
|
|
730
|
+
- `data-list-empty`: Present when no item is shown for what was typed, once the list is in the page.
|
|
530
731
|
- `data-disabled`: Present when it is disabled.
|
|
732
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
733
|
+
- `data-required`: Present when the form needs it.
|
|
734
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
735
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
736
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
737
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
738
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
739
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
531
740
|
- 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.
|
|
532
741
|
- `data-popup-open`: Present when the list is open.
|
|
742
|
+
- `data-pressed`: Present while its popup is open: it stays pressed, as a button held down.
|
|
743
|
+
- `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.
|
|
744
|
+
- `data-list-empty`: Present when no item is shown for what was typed, once the list is in the page.
|
|
533
745
|
- `data-disabled`: Present when it is disabled.
|
|
534
|
-
-
|
|
746
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
747
|
+
- `data-required`: Present when the form needs it.
|
|
748
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
749
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
750
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
751
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
752
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
753
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
754
|
+
- 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.
|
|
535
755
|
- `data-open`: Present when it is open.
|
|
536
756
|
- `data-closed`: Present when it is closed.
|
|
537
757
|
- `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.
|
|
538
758
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
759
|
+
- `data-presentation="popup | sheet"`: How the list opened: placed against its trigger, or as a sheet from the bottom edge.
|
|
760
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
761
|
+
- `data-empty`: Present when no item is shown for what was typed.
|
|
539
762
|
- `--anchor-width`: The anchor's width.
|
|
540
763
|
- `--anchor-height`: The anchor's height.
|
|
541
764
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
542
765
|
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
543
766
|
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
544
|
-
- popup: The list of items. With a `list` inside, what holds it: a dialog around an input and the list.
|
|
767
|
+
- 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.
|
|
545
768
|
- `data-open`: Present when it is open.
|
|
546
769
|
- `data-closed`: Present when it is closed.
|
|
547
770
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
548
771
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
549
772
|
- `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.
|
|
550
773
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
774
|
+
- `data-presentation="popup | sheet"`: How the list opened: placed against its trigger, or as a sheet from the bottom edge.
|
|
775
|
+
- `data-swiping`: Present while the sheet is dragged.
|
|
776
|
+
- `data-swipe-dismiss`: Present once a drag has closed it.
|
|
777
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
551
778
|
- `data-empty`: Present when no item is shown for what was typed.
|
|
779
|
+
- `--drawer-swipe-movement-x`: As a sheet: how far it has been dragged across, always 0px.
|
|
780
|
+
- `--drawer-swipe-movement-y`: As a sheet: how far it has been dragged down.
|
|
781
|
+
- `--drawer-swipe-progress`: As a sheet: how far it has been dragged, of its own height: 0 to 1.
|
|
782
|
+
- `--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.
|
|
552
783
|
- list: The items' own box inside the popup, when the popup holds more than items (an input): it is then the listbox.
|
|
553
784
|
- `data-empty`: Present when no item is shown for what was typed.
|
|
554
785
|
- item: One suggestion: chosen, its text is written into the input.
|
|
555
786
|
- `data-selected`: Present on the chosen item.
|
|
556
787
|
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
557
788
|
- `data-disabled`: Present when it is disabled.
|
|
558
|
-
- clear: A button that empties the input and the value.
|
|
789
|
+
- 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.
|
|
559
790
|
- `data-disabled`: Present when it is disabled.
|
|
791
|
+
- `data-popup-open`: Present when the list is open.
|
|
792
|
+
- `data-visible`: Present while there is something to clear.
|
|
793
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
794
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
560
795
|
|
|
561
796
|
### Autosize
|
|
562
797
|
|
|
@@ -598,10 +833,21 @@ Anatomy:
|
|
|
598
833
|
|
|
599
834
|
Each part, and its own props:
|
|
600
835
|
|
|
601
|
-
- `<Avatar.Root>` draws a `<span>`.
|
|
602
|
-
- `<Avatar.Image>` draws a `<img>`.
|
|
836
|
+
- `<Avatar.Root>` draws a `<span>`.
|
|
837
|
+
- `<Avatar.Image>` draws a `<img>`.
|
|
603
838
|
- `src?: string`: The picture's address: the part is in the page once it has loaded.
|
|
604
|
-
-
|
|
839
|
+
- `keepMounted?: boolean`: Keeps the element in the page while the picture loads, as Base UI's: it loads the picture itself (`loading="lazy"` works), and until it has loaded it is `aria-hidden`, with `data-loading` or `data-error` for the design to hide or fade it by. Default: `false`, the element is drawn once the picture has loaded.
|
|
840
|
+
- `@loading-status-change: (status: ImageStatus) => void`: `@loading-status-change`: each time the picture's loading status changes, `loading` once it has an address, then `loaded` or `error`; `idle` again when its address is taken away. The root says the same in `data-image-loading-status`.
|
|
841
|
+
- `<Avatar.Fallback>` draws a `<span>`. What shows until the picture has loaded, or when it cannot; after its `delay`, when it has one.
|
|
842
|
+
- `delay?: number`: How long to wait before showing, in milliseconds, so a picture that loads sooner never lets the fallback be seen. Read once. Default: `0`, at once.
|
|
843
|
+
|
|
844
|
+
Attributes and CSS variables, by part:
|
|
845
|
+
|
|
846
|
+
- root: The frame the image and its stand-in share.
|
|
847
|
+
- `data-image-loading-status="idle | loading | loaded | error"`: Where the picture is in its loading: `idle` while it has no address.
|
|
848
|
+
- 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.
|
|
849
|
+
- `data-loading`: Present while the picture loads, on an image kept in the page.
|
|
850
|
+
- `data-error`: Present when the picture cannot load, on an image kept in the page.
|
|
605
851
|
|
|
606
852
|
### Button
|
|
607
853
|
|
|
@@ -613,7 +859,7 @@ Props:
|
|
|
613
859
|
|
|
614
860
|
- `disabled?: boolean`: Disabled: a press does nothing.
|
|
615
861
|
- `focusableWhenDisabled?: boolean`: Keeps a disabled button in the tab order, so what it would do can still be read.
|
|
616
|
-
- `nativeButton?: boolean`: `false` when the element is not a `<button>`: it is given a button's role and
|
|
862
|
+
- `nativeButton?: 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.
|
|
617
863
|
|
|
618
864
|
`<Button>` draws a `<button>`.
|
|
619
865
|
|
|
@@ -628,30 +874,39 @@ Attributes and CSS variables, by part:
|
|
|
628
874
|
import { Calendar } from "@kirana-ui/vue/calendar"
|
|
629
875
|
```
|
|
630
876
|
|
|
631
|
-
Parts: `<Calendar.Root>`, `<Calendar.Heading>`, `<Calendar.Previous>`, `<Calendar.Next>`, `<Calendar.Grid>`, `<Calendar.Weekdays>`, `<Calendar.HeadCell>`, `<Calendar.Weeks>`, `<Calendar.Cell>`, `<Calendar.Day>`.
|
|
877
|
+
Parts: `<Calendar.Root>`, `<Calendar.Heading>`, `<Calendar.Previous>`, `<Calendar.Next>`, `<Calendar.Months>`, `<Calendar.Grid>`, `<Calendar.Weekdays>`, `<Calendar.HeadCell>`, `<Calendar.Weeks>`, `<Calendar.Cell>`, `<Calendar.Day>`, `<Calendar.Input>`.
|
|
632
878
|
|
|
633
879
|
Anatomy:
|
|
634
880
|
|
|
635
881
|
```
|
|
636
882
|
<Calendar.Root>
|
|
637
|
-
<Calendar.
|
|
883
|
+
<Calendar.Months> (optional)
|
|
884
|
+
<Calendar.Heading>
|
|
885
|
+
<Calendar.Grid>
|
|
886
|
+
<Calendar.Weekdays>
|
|
887
|
+
<Calendar.HeadCell> (repeated)
|
|
888
|
+
<Calendar.Weeks>
|
|
889
|
+
<Calendar.Cell> (repeated)
|
|
890
|
+
<Calendar.Day>
|
|
638
891
|
<Calendar.Previous>
|
|
639
892
|
<Calendar.Next>
|
|
640
|
-
<Calendar.
|
|
641
|
-
<Calendar.Weekdays>
|
|
642
|
-
<Calendar.HeadCell> (repeated)
|
|
643
|
-
<Calendar.Weeks>
|
|
644
|
-
<Calendar.Cell> (repeated)
|
|
645
|
-
<Calendar.Day>
|
|
893
|
+
<Calendar.Input>
|
|
646
894
|
```
|
|
647
895
|
|
|
648
896
|
Props of its root:
|
|
649
897
|
|
|
650
|
-
- `value?:
|
|
651
|
-
- `defaultValue?:
|
|
652
|
-
- `mode?:
|
|
653
|
-
- `
|
|
654
|
-
- `
|
|
898
|
+
- `value?: CalendarValueOf<Mode>`: `v-model:value`. 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.
|
|
899
|
+
- `defaultValue?: CalendarValueOf<Mode>`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
900
|
+
- `mode?: Mode`: 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).
|
|
901
|
+
- `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.
|
|
902
|
+
- `minDays?: number`: With `mode: "multiple"`: the fewest days that can be left chosen. A press that would leave fewer does nothing.
|
|
903
|
+
- `maxDays?: number`: With `mode: "multiple"`: the most days that can be chosen. Once they are, the other days are disabled until one is taken away.
|
|
904
|
+
- `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`.
|
|
905
|
+
- `pagedNavigation?: 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.
|
|
906
|
+
- `month?: IsoDate`: `v-model:month`. 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.
|
|
907
|
+
- `defaultMonth?: IsoDate`: 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.
|
|
908
|
+
- `defaultFocusedValue?: IsoDate`: 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.
|
|
909
|
+
- `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`). Default `"en-US"`.
|
|
655
910
|
- `calendarSystem?: CalendarSystem`: 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.
|
|
656
911
|
- `min?: IsoDate`: The first and the last day that can be chosen.
|
|
657
912
|
- `max?: IsoDate`: The last day that can be chosen.
|
|
@@ -659,16 +914,19 @@ Props of its root:
|
|
|
659
914
|
- `disabled?: boolean`: Disabled: no day can be chosen.
|
|
660
915
|
- `readOnly?: boolean`: Shown as it is: the days can be moved through, and none can be chosen.
|
|
661
916
|
- `fixedWeeks?: boolean`: Always six rows, so the calendar is one height in every month.
|
|
662
|
-
-
|
|
663
|
-
-
|
|
917
|
+
- `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.
|
|
918
|
+
- `form?: string`: The id of the form it belongs to, when it is not inside it.
|
|
919
|
+
- `@value-change: (value: CalendarValueOf<Mode>, details: ChangeDetails) => void`: Heard as a day is about to be chosen: `details.cancel()` keeps the value as it was.
|
|
920
|
+
- `@month-change: (value: string, details: ChangeDetails) => void`: Heard as another month is about to be shown (the keys, the buttons, a day of another month pressed): its first day. `details.cancel()` keeps the month as it was.
|
|
664
921
|
|
|
665
922
|
Each part, and its own props:
|
|
666
923
|
|
|
667
|
-
- `<Calendar.Root>` draws a `<div>`. Its props are above.
|
|
924
|
+
- `<Calendar.Root>` draws a `<div>`. Generic: `<Mode extends CalendarMode = "single">`. `value` and its events are typed by `mode`: a day, a range, or a list of days. Its props are above.
|
|
668
925
|
- `<Calendar.Heading>` draws a `<div>`. Names the month shown. Read out when it changes.
|
|
669
926
|
- `<Calendar.Previous>` draws a `<button>`.
|
|
670
927
|
- `<Calendar.Next>` draws a `<button>`.
|
|
671
|
-
- `<Calendar.
|
|
928
|
+
- `<Calendar.Months>` draws no element. The months shown, with several: each is given to draw its heading and its grid. It draws no element, and is left out for one month. Its default slot is also given `month: CalendarMonth`.
|
|
929
|
+
- `<Calendar.Grid>` draws a `<table>`. The table of a month's days: a grid the arrows move in, from one month shown into the next.
|
|
672
930
|
- `<Calendar.Weekdays>` draws no element. The days of the week: each is given to draw its head cell. Its default slot is also given `weekday: CalendarWeekday`.
|
|
673
931
|
- `<Calendar.HeadCell>` draws a `<th>`. A column's heading: a day of the week.
|
|
674
932
|
- `weekday: CalendarWeekday`: Required. The day of the week it names, as `Calendar.Weekdays` gives it.
|
|
@@ -676,7 +934,8 @@ Each part, and its own props:
|
|
|
676
934
|
- `<Calendar.Cell>` draws a `<td>`.
|
|
677
935
|
- `date: string`: Required. The day it is for, as a week of `Calendar.Weeks` gives it.
|
|
678
936
|
- `<Calendar.Day>` draws a `<button>`.
|
|
679
|
-
- `date
|
|
937
|
+
- `date?: string`: The day it is the button of. Left out, the `Calendar.Cell`'s it is inside.
|
|
938
|
+
- `<Calendar.Input>` draws a `<input>`. The hidden input it is submitted by, when it has a name: one more is drawn after it for each other day.
|
|
680
939
|
|
|
681
940
|
Attributes and CSS variables, by part:
|
|
682
941
|
|
|
@@ -688,21 +947,21 @@ Attributes and CSS variables, by part:
|
|
|
688
947
|
- next: Shows the month after.
|
|
689
948
|
- `data-disabled`: Present when it is disabled.
|
|
690
949
|
- cell: A day's cell.
|
|
691
|
-
- `data-selected`: Present on a chosen day,
|
|
950
|
+
- `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.
|
|
692
951
|
- `data-today`: Present on today.
|
|
693
952
|
- `data-outside-month`: Present on the days of the month before and after that fill the first and last weeks.
|
|
694
953
|
- `data-disabled`: Present when it is disabled.
|
|
695
954
|
- `data-unavailable`: Present on a day that cannot be chosen.
|
|
696
|
-
- `data-range-start`: Present on the first day of a range.
|
|
697
|
-
- `data-range-end`: Present on the last day of a range.
|
|
955
|
+
- `data-range-start`: Present on the first day of a range, and on a copy of it.
|
|
956
|
+
- `data-range-end`: Present on the last day of a range, and on a copy of it.
|
|
698
957
|
- day: The button for a day.
|
|
699
|
-
- `data-selected`: Present on a chosen day,
|
|
958
|
+
- `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.
|
|
700
959
|
- `data-today`: Present on today.
|
|
701
960
|
- `data-outside-month`: Present on the days of the month before and after that fill the first and last weeks.
|
|
702
961
|
- `data-disabled`: Present when it is disabled.
|
|
703
962
|
- `data-unavailable`: Present on a day that cannot be chosen.
|
|
704
|
-
- `data-range-start`: Present on the first day of a range.
|
|
705
|
-
- `data-range-end`: Present on the last day of a range.
|
|
963
|
+
- `data-range-start`: Present on the first day of a range, and on a copy of it.
|
|
964
|
+
- `data-range-end`: Present on the last day of a range, and on a copy of it.
|
|
706
965
|
|
|
707
966
|
### Carousel
|
|
708
967
|
|
|
@@ -726,7 +985,7 @@ Anatomy:
|
|
|
726
985
|
Props of its root:
|
|
727
986
|
|
|
728
987
|
- `index?: number`: `v-model:index`. Which slide is at the start of the view, from 0.
|
|
729
|
-
- `defaultIndex?: number`: The slide it starts at, when the caller does not hold `index`. Read once.
|
|
988
|
+
- `defaultIndex?: number`: The slide it starts at, when the caller does not hold `index`. Read once. Default `0`.
|
|
730
989
|
- `orientation?: Orientation`: Whether the slides go across (the default) or down.
|
|
731
990
|
- `loop?: boolean`: Whether going on from the last slide comes round to the first.
|
|
732
991
|
- `@index-change: (value: number, details: ChangeDetails) => void`: Heard as another slide is about to be at the start of the view: `details.cancel()` keeps the index as it was.
|
|
@@ -736,7 +995,7 @@ Each part, and its own props:
|
|
|
736
995
|
- `<Carousel.Root>` draws a `<div>`. Its props are above.
|
|
737
996
|
- `<Carousel.Viewport>` draws a `<div>`.
|
|
738
997
|
- `<Carousel.Item>` draws a `<div>`.
|
|
739
|
-
- `index
|
|
998
|
+
- `index?: number`: Its place among the slides, from 0. Left out, its place in the page, once it is there: give it on a page a server draws, which cannot count them.
|
|
740
999
|
- `<Carousel.Previous>` draws a `<button>`.
|
|
741
1000
|
- `<Carousel.Next>` draws a `<button>`.
|
|
742
1001
|
- `<Carousel.Indicator>` draws a `<button>`.
|
|
@@ -784,12 +1043,14 @@ Props of its root:
|
|
|
784
1043
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
785
1044
|
- `value?: string`: What is submitted. Default `"on"`, as a native checkbox's.
|
|
786
1045
|
- `indeterminate?: boolean`: Neither checked nor unchecked: a parent of boxes that disagree.
|
|
1046
|
+
- `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.
|
|
1047
|
+
- `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.
|
|
787
1048
|
- `@checked-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to be checked or unchecked: `details.cancel()` keeps it as it was.
|
|
788
1049
|
|
|
789
1050
|
Each part, and its own props:
|
|
790
1051
|
|
|
791
1052
|
- `<Checkbox.Root>` draws a `<span>`. Its props are above.
|
|
792
|
-
- `<Checkbox.Indicator>` draws a `<span>`.
|
|
1053
|
+
- `<Checkbox.Indicator>` draws a `<span>`. A dash while mixed and a tick while checked, from the slot's state: `<Checkbox.Indicator v-slot="{ state }">{{ state.indeterminate ? "–" : "✓" }}</Checkbox.Indicator>`.
|
|
793
1054
|
- `keepMounted?: boolean`: Keeps the mark in the page while the box is unchecked.
|
|
794
1055
|
|
|
795
1056
|
Attributes and CSS variables, by part:
|
|
@@ -801,16 +1062,51 @@ Attributes and CSS variables, by part:
|
|
|
801
1062
|
- `data-disabled`: Present when it is disabled.
|
|
802
1063
|
- `data-readonly`: Present when it can be read but not changed.
|
|
803
1064
|
- `data-required`: Present when the form needs it.
|
|
804
|
-
-
|
|
1065
|
+
- `data-parent`: Present on the checkbox that stands for every box of its group.
|
|
1066
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
1067
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
1068
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
1069
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
1070
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
1071
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
1072
|
+
- 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.
|
|
805
1073
|
- `data-checked`: Present when it is checked.
|
|
806
1074
|
- `data-unchecked`: Present when it is not checked.
|
|
807
1075
|
- `data-indeterminate`: Present when it is neither checked nor unchecked.
|
|
808
1076
|
- `data-disabled`: Present when it is disabled.
|
|
809
1077
|
- `data-readonly`: Present when it can be read but not changed.
|
|
810
1078
|
- `data-required`: Present when the form needs it.
|
|
1079
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
1080
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
1081
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
1082
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
1083
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
1084
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
811
1085
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
812
1086
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
813
1087
|
|
|
1088
|
+
### CheckboxGroup
|
|
1089
|
+
|
|
1090
|
+
```
|
|
1091
|
+
import { CheckboxGroup } from "@kirana-ui/vue/checkbox-group"
|
|
1092
|
+
```
|
|
1093
|
+
|
|
1094
|
+
Props:
|
|
1095
|
+
|
|
1096
|
+
- `value?: readonly string[]`: `v-model:value`. The values of the checked checkboxes, when the caller holds them.
|
|
1097
|
+
- `defaultValue?: readonly string[]`: The values checked at the start, when the caller does not hold `value`. Read once.
|
|
1098
|
+
- `allValues?: readonly 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` …).
|
|
1099
|
+
- `disabled?: boolean`: Disables every checkbox of the group.
|
|
1100
|
+
- `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.
|
|
1101
|
+
- `@value-change: (value: string[], details: ChangeDetails) => void`: Heard as a checkbox of the group is about to be checked or unchecked, with the values that would then be checked: `details.cancel()` keeps them as they were.
|
|
1102
|
+
|
|
1103
|
+
`<CheckboxGroup>` draws a `<div>`.
|
|
1104
|
+
|
|
1105
|
+
Attributes and CSS variables, by part:
|
|
1106
|
+
|
|
1107
|
+
- 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.
|
|
1108
|
+
- `data-disabled`: Present when it is disabled.
|
|
1109
|
+
|
|
814
1110
|
### Collapsible
|
|
815
1111
|
|
|
816
1112
|
```
|
|
@@ -847,6 +1143,8 @@ Attributes and CSS variables, by part:
|
|
|
847
1143
|
- `data-open`: Present when it is open.
|
|
848
1144
|
- `data-closed`: Present when it is closed.
|
|
849
1145
|
- `data-disabled`: Present when it is disabled.
|
|
1146
|
+
- `data-starting-style`: Present for the first style of the panel's entrance, as on the panel.
|
|
1147
|
+
- `data-ending-style`: Present through the panel's exit, as on the panel.
|
|
850
1148
|
- trigger: The button that opens and closes the panel.
|
|
851
1149
|
- `data-panel-open`: Present when the panel is open.
|
|
852
1150
|
- `data-disabled`: Present when it is disabled.
|
|
@@ -858,13 +1156,160 @@ Attributes and CSS variables, by part:
|
|
|
858
1156
|
- `--collapsible-panel-height`: The panel's content height while it opens or closes, `auto` once it is open.
|
|
859
1157
|
- `--collapsible-panel-width`: The panel's content width while it opens or closes, `auto` once it is open.
|
|
860
1158
|
|
|
1159
|
+
### ColorPicker
|
|
1160
|
+
|
|
1161
|
+
```
|
|
1162
|
+
import { ColorPicker } from "@kirana-ui/vue/color-picker"
|
|
1163
|
+
```
|
|
1164
|
+
|
|
1165
|
+
Parts: `<ColorPicker.Root>`, `<ColorPicker.Area>`, `<ColorPicker.AreaThumb>`, `<ColorPicker.ChannelSlider>`, `<ColorPicker.ChannelSliderTrack>`, `<ColorPicker.ChannelSliderThumb>`, `<ColorPicker.ChannelInput>`, `<ColorPicker.Swatch>`, `<ColorPicker.SwatchTrigger>`, `<ColorPicker.EyeDropperTrigger>`, `<ColorPicker.ValueText>`, `<ColorPicker.FormatTrigger>`.
|
|
1166
|
+
|
|
1167
|
+
Anatomy:
|
|
1168
|
+
|
|
1169
|
+
```
|
|
1170
|
+
<ColorPicker.Root>
|
|
1171
|
+
<ColorPicker.Area>
|
|
1172
|
+
<ColorPicker.AreaThumb>
|
|
1173
|
+
<ColorPicker.ChannelSlider> (repeated)
|
|
1174
|
+
<ColorPicker.ChannelSliderTrack>
|
|
1175
|
+
<ColorPicker.ChannelSliderThumb>
|
|
1176
|
+
<ColorPicker.ChannelSliderThumb> (as above)
|
|
1177
|
+
<ColorPicker.ChannelInput> (repeated)
|
|
1178
|
+
<ColorPicker.Swatch> (repeated)
|
|
1179
|
+
<ColorPicker.SwatchTrigger> (repeated)
|
|
1180
|
+
<ColorPicker.EyeDropperTrigger>
|
|
1181
|
+
<ColorPicker.ValueText>
|
|
1182
|
+
<ColorPicker.FormatTrigger>
|
|
1183
|
+
```
|
|
1184
|
+
|
|
1185
|
+
Props of its root:
|
|
1186
|
+
|
|
1187
|
+
- `value?: string`: `v-model:value`. The colour as text in `format`, when the caller holds it. Any format is read.
|
|
1188
|
+
- `defaultValue?: string`: Read once. Default `#000000`.
|
|
1189
|
+
- `format?: ColorFormat`: `v-model:format`. How the value is written, when the caller holds it.
|
|
1190
|
+
- `defaultFormat?: ColorFormat`: Read once. Default `"hex"`.
|
|
1191
|
+
- `alpha?: boolean`: Whether the opacity can be chosen. With it, the value always carries its alpha (`#rrggbbaa`, `rgba()`, `hsla()`); without it, never. Default false.
|
|
1192
|
+
- `thumbAlignment?: "center" | "edge"`: 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.
|
|
1193
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
1194
|
+
- `readOnly?: boolean`: Shown as it is, focusable, not changeable; still submitted with the form.
|
|
1195
|
+
- `required?: boolean`: Needed by the form. A colour always has a value, so this only says so.
|
|
1196
|
+
- `name?: string`: With a name, the value is submitted with the form around the picker.
|
|
1197
|
+
- `form?: string`: The id of the form the picker belongs to, when it is not inside it.
|
|
1198
|
+
- `getAriaValueText?: (text: string, thumb: ColorPickerThumb, color: Hsva) => string`: What assistive technology reads for a thumb, when the written one is not enough.
|
|
1199
|
+
- `@value-change: (value: string, details: ChangeDetails) => void`: Each step of a drag, each key, each colour typed or chosen: refusable.
|
|
1200
|
+
- `@format-change: (value: ColorFormat, details: ChangeDetails) => void`: When the format trigger goes to the next format: refusable.
|
|
1201
|
+
- `@value-committed: (value: string, details: ChangeDetails) => void`: The pointer let go, a key moved a thumb, a typed channel was left: the value to save.
|
|
1202
|
+
|
|
1203
|
+
Each part, and its own props:
|
|
1204
|
+
|
|
1205
|
+
- `<ColorPicker.Root>` draws a `<div>`. Its props are above.
|
|
1206
|
+
- `<ColorPicker.Area>` draws a `<div>`.
|
|
1207
|
+
- `<ColorPicker.AreaThumb>` draws a `<div>`.
|
|
1208
|
+
- `<ColorPicker.ChannelSlider>` draws a `<div>`.
|
|
1209
|
+
- `channel: ColorPickerSliderChannel`: Required. The channel it moves: the hue, or the alpha.
|
|
1210
|
+
- `orientation?: Orientation`: The way its track runs. Default `horizontal`.
|
|
1211
|
+
- `<ColorPicker.ChannelSliderTrack>` draws a `<div>`.
|
|
1212
|
+
- `<ColorPicker.ChannelSliderThumb>` draws a `<div>`.
|
|
1213
|
+
- `<ColorPicker.ChannelInput>` draws a `<input>`.
|
|
1214
|
+
- `channel: ColorPickerInputChannel`: Required. The channel it is typed in, or `hex` for the whole colour.
|
|
1215
|
+
- `<ColorPicker.Swatch>` draws a `<div>`.
|
|
1216
|
+
- `<ColorPicker.SwatchTrigger>` draws a `<button>`.
|
|
1217
|
+
- `value: string`: Required. The preset's colour, in any format: pressed, the colour is this one.
|
|
1218
|
+
- `<ColorPicker.EyeDropperTrigger>` draws a `<button>`.
|
|
1219
|
+
- `<ColorPicker.ValueText>` draws a `<span>`.
|
|
1220
|
+
- `<ColorPicker.FormatTrigger>` draws a `<button>`.
|
|
1221
|
+
|
|
1222
|
+
Attributes and CSS variables, by part:
|
|
1223
|
+
|
|
1224
|
+
- root: Groups the picker's parts. It holds the hidden input a form reads, and the colour for anything inside to paint with.
|
|
1225
|
+
- `data-disabled`: Present when it is disabled.
|
|
1226
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1227
|
+
- `data-required`: Present when the form needs a colour.
|
|
1228
|
+
- `data-dragging`: Present while a pointer holds a thumb of the picker.
|
|
1229
|
+
- `data-format="hex | rgb | hsl"`: How the value is written.
|
|
1230
|
+
- `--color`: The colour, with its alpha.
|
|
1231
|
+
- 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.
|
|
1232
|
+
- `data-disabled`: Present when it is disabled.
|
|
1233
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1234
|
+
- `data-required`: Present when the form needs a colour.
|
|
1235
|
+
- `data-dragging`: Present while a pointer holds this part's thumb.
|
|
1236
|
+
- `--hue-color`: The colour's hue at full saturation and brightness.
|
|
1237
|
+
- 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.
|
|
1238
|
+
- `data-disabled`: Present when it is disabled.
|
|
1239
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1240
|
+
- `data-required`: Present when the form needs a colour.
|
|
1241
|
+
- `data-dragging`: Present while a pointer holds this part's thumb.
|
|
1242
|
+
- `--saturation`: Its place across, as a share of the area: the saturation.
|
|
1243
|
+
- `--brightness`: Its place up, as a share of the area: the brightness.
|
|
1244
|
+
- `--color`: The colour under it, without its alpha.
|
|
1245
|
+
- 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`.
|
|
1246
|
+
- `data-disabled`: Present when it is disabled.
|
|
1247
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1248
|
+
- `data-required`: Present when the form needs a colour.
|
|
1249
|
+
- `data-dragging`: Present while a pointer holds this part's thumb.
|
|
1250
|
+
- `data-channel="hue | alpha"`: The channel the slider moves.
|
|
1251
|
+
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
1252
|
+
- channelSliderTrack: The channel's whole range: what a design paints the hues or the alpha on.
|
|
1253
|
+
- `data-disabled`: Present when it is disabled.
|
|
1254
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1255
|
+
- `data-required`: Present when the form needs a colour.
|
|
1256
|
+
- `data-dragging`: Present while a pointer holds this part's thumb.
|
|
1257
|
+
- `data-channel="hue | alpha"`: The channel the slider moves.
|
|
1258
|
+
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
1259
|
+
- `--color`: The colour without its alpha: the end of an alpha track.
|
|
1260
|
+
- `--hue-color`: The colour's hue at full saturation and brightness.
|
|
1261
|
+
- 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.
|
|
1262
|
+
- `data-disabled`: Present when it is disabled.
|
|
1263
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1264
|
+
- `data-required`: Present when the form needs a colour.
|
|
1265
|
+
- `data-dragging`: Present while a pointer holds this part's thumb.
|
|
1266
|
+
- `data-channel="hue | alpha"`: The channel the slider moves.
|
|
1267
|
+
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
1268
|
+
- `--color`: The colour under it: the pure hue, or the colour at its alpha.
|
|
1269
|
+
- 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.
|
|
1270
|
+
- `data-disabled`: Present when it is disabled.
|
|
1271
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1272
|
+
- `data-required`: Present when the form needs a colour.
|
|
1273
|
+
- `data-dragging`: Present while a pointer holds a thumb of the picker.
|
|
1274
|
+
- `data-channel="hex | red | green | blue | hue | saturation | lightness | alpha"`: The channel the input is typed in.
|
|
1275
|
+
- swatch: Shows the current colour.
|
|
1276
|
+
- `data-disabled`: Present when it is disabled.
|
|
1277
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1278
|
+
- `data-required`: Present when the form needs a colour.
|
|
1279
|
+
- `data-dragging`: Present while a pointer holds a thumb of the picker.
|
|
1280
|
+
- `--color`: The colour, with its alpha.
|
|
1281
|
+
- swatchTrigger: A preset colour, given as `value`: pressed, the colour is this one.
|
|
1282
|
+
- `data-disabled`: Present when it is disabled.
|
|
1283
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1284
|
+
- `data-required`: Present when the form needs a colour.
|
|
1285
|
+
- `data-dragging`: Present while a pointer holds a thumb of the picker.
|
|
1286
|
+
- `data-selected`: Present while the colour is this one.
|
|
1287
|
+
- `--color`: The preset's colour, with its alpha.
|
|
1288
|
+
- eyeDropperTrigger: Picks a colour from the screen with the browser's eye dropper. Hidden where the browser has none, and on a server.
|
|
1289
|
+
- `data-disabled`: Present when it is disabled.
|
|
1290
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1291
|
+
- `data-required`: Present when the form needs a colour.
|
|
1292
|
+
- `data-dragging`: Present while a pointer holds a thumb of the picker.
|
|
1293
|
+
- valueText: The colour, written in its format.
|
|
1294
|
+
- `data-disabled`: Present when it is disabled.
|
|
1295
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1296
|
+
- `data-required`: Present when the form needs a colour.
|
|
1297
|
+
- `data-dragging`: Present while a pointer holds a thumb of the picker.
|
|
1298
|
+
- `data-format="hex | rgb | hsl"`: How the value is written.
|
|
1299
|
+
- formatTrigger: Goes to the next format: hex, then rgb, then hsl.
|
|
1300
|
+
- `data-disabled`: Present when it is disabled.
|
|
1301
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1302
|
+
- `data-required`: Present when the form needs a colour.
|
|
1303
|
+
- `data-dragging`: Present while a pointer holds a thumb of the picker.
|
|
1304
|
+
- `data-format="hex | rgb | hsl"`: How the value is written.
|
|
1305
|
+
|
|
861
1306
|
### Combobox
|
|
862
1307
|
|
|
863
1308
|
```
|
|
864
1309
|
import { Combobox } from "@kirana-ui/vue/combobox"
|
|
865
1310
|
```
|
|
866
1311
|
|
|
867
|
-
Parts: `<Combobox.Root>`, `<Combobox.Input>`, `<Combobox.Trigger>`, `<Combobox.Clear>`, `<Combobox.Chips>`, `<Combobox.Chip>`, `<Combobox.ChipRemove>`, `<Combobox.Portal>`, `<Combobox.Positioner>`, `<Combobox.Popup>`, `<Combobox.List>`, `<Combobox.Group>`, `<Combobox.GroupLabel>`, `<Combobox.Separator>`, `<Combobox.Item>`, `<Combobox.ItemIndicator>`, `<Combobox.Empty>`.
|
|
1312
|
+
Parts: `<Combobox.Root>`, `<Combobox.Input>`, `<Combobox.Trigger>`, `<Combobox.Value>`, `<Combobox.Clear>`, `<Combobox.Chips>`, `<Combobox.Chip>`, `<Combobox.ChipRemove>`, `<Combobox.Portal>`, `<Combobox.Backdrop>`, `<Combobox.Positioner>`, `<Combobox.Popup>`, `<Combobox.List>`, `<Combobox.Collection>`, `<Combobox.Group>`, `<Combobox.GroupLabel>`, `<Combobox.Separator>`, `<Combobox.Item>`, `<Combobox.ItemIndicator>`, `<Combobox.Empty>`, `<Combobox.Status>`.
|
|
868
1313
|
|
|
869
1314
|
Anatomy:
|
|
870
1315
|
|
|
@@ -872,18 +1317,27 @@ Anatomy:
|
|
|
872
1317
|
<Combobox.Root>
|
|
873
1318
|
<Combobox.Input>
|
|
874
1319
|
<Combobox.Trigger>
|
|
1320
|
+
<Combobox.Value> (optional)
|
|
875
1321
|
<Combobox.Portal>
|
|
1322
|
+
<Combobox.Backdrop> (optional)
|
|
876
1323
|
<Combobox.Positioner>
|
|
877
1324
|
<Combobox.Popup>
|
|
878
1325
|
<Combobox.Input> (as above)
|
|
879
1326
|
<Combobox.List> (optional)
|
|
1327
|
+
<Combobox.Collection> (optional)
|
|
1328
|
+
<Combobox.Item> (repeated, as above)
|
|
1329
|
+
<Combobox.Group> (optional, repeated, as above)
|
|
880
1330
|
<Combobox.Group> (optional, repeated)
|
|
1331
|
+
<Combobox.Collection> (optional, as above)
|
|
881
1332
|
<Combobox.Item> (repeated)
|
|
882
1333
|
<Combobox.ItemIndicator>
|
|
883
1334
|
<Combobox.GroupLabel>
|
|
884
1335
|
<Combobox.Separator> (repeated)
|
|
1336
|
+
<Combobox.Collection> (optional, as above)
|
|
885
1337
|
<Combobox.Empty>
|
|
1338
|
+
<Combobox.Status> (optional)
|
|
886
1339
|
<Combobox.Popup> (as above)
|
|
1340
|
+
<Combobox.Status> (optional, as above)
|
|
887
1341
|
<Combobox.Clear>
|
|
888
1342
|
<Combobox.Chips>
|
|
889
1343
|
<Combobox.Input> (as above)
|
|
@@ -893,44 +1347,54 @@ Anatomy:
|
|
|
893
1347
|
|
|
894
1348
|
Props of its root:
|
|
895
1349
|
|
|
896
|
-
- `
|
|
897
|
-
- `
|
|
1350
|
+
- `presentation?: Presentation`: 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`.
|
|
1351
|
+
- `sheetBelow?: number`: With `presentation: "auto"`: the viewport's width, in CSS pixels, under which a coarse pointer opens a sheet. Default 640.
|
|
1352
|
+
- `value?: (Multiple extends true ? readonly Value[] : Value | null)`: `v-model:value`. The chosen value; `null` is "none". With `multiple`, the chosen values, in the order they were chosen.
|
|
1353
|
+
- `defaultValue?: (Multiple extends true ? readonly Value[] : Value | null)`: The value it starts with (with `multiple`, the values), when the caller does not hold `value`. Read once.
|
|
898
1354
|
- `inputValue?: string`: `v-model:inputValue`. What the input says.
|
|
899
1355
|
- `defaultInputValue?: string`: The text the input starts with, when the caller does not hold `inputValue`. Read once.
|
|
900
1356
|
- `open?: boolean`: `v-model:open`. Whether the list is open, when the caller holds it.
|
|
901
1357
|
- `defaultOpen?: boolean`: Whether the list starts open, when the caller does not hold `open`. Read once.
|
|
902
1358
|
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
1359
|
+
- `readOnly?: 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.
|
|
903
1360
|
- `name?: string`: With a name, the value is submitted with the form around it.
|
|
904
1361
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
905
|
-
- `items?: readonly
|
|
906
|
-
- `
|
|
907
|
-
- `
|
|
908
|
-
- `
|
|
909
|
-
- `
|
|
1362
|
+
- `items?: readonly ComboboxItemData<Value>[] | readonly ComboboxGroupData<Value>[] | Readonly<Record<string, string>>`: 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.
|
|
1363
|
+
- `itemToStringLabel?: (value: Value) => string`: 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.
|
|
1364
|
+
- `itemToStringValue?: (value: Value) => string`: 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.
|
|
1365
|
+
- `filter?: ((label: string, query: string) => boolean) | null`: 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).
|
|
1366
|
+
- `values?: readonly Value[]`: `v-model:values`. With `multiple`: the chosen values.
|
|
1367
|
+
- `defaultValues?: readonly Value[]`: With `multiple`: the values it starts with.
|
|
910
1368
|
- `required?: boolean`: In a field, "none" is then wrong.
|
|
911
1369
|
- `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.
|
|
912
1370
|
- `virtualized?: ListCollection`: Every row, when only some are in the page (a virtualizer draws the ones in view). The caller then filters: the collection is what is left, and each item is given its `index`.
|
|
913
1371
|
- `autoHighlight?: 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.
|
|
914
|
-
-
|
|
915
|
-
- `@
|
|
1372
|
+
- `multiple?: Multiple`: Several values: `value` and `@value-change` then hold a list. Read once.
|
|
1373
|
+
- `@value-change: (value: Multiple extends true ? Value[] : Value | null, details: ChangeDetails) => void`: Heard as a value is about to be chosen or cleared (with `multiple`, added or taken away, with the values there would then be): `details.cancel()` keeps it as it was.
|
|
1374
|
+
- `@values-change: (value: Value[], details: ChangeDetails) => void`: With `multiple`: heard as a value is about to be added or taken away.
|
|
916
1375
|
- `@input-value-change: (value: string, details: ChangeDetails) => void`: Heard as the input's text is about to change: `details.cancel()` keeps it as it was.
|
|
917
1376
|
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as the list is about to open or close: `details.cancel()` keeps it as it was.
|
|
918
1377
|
|
|
919
1378
|
Each part, and its own props:
|
|
920
1379
|
|
|
921
|
-
- `<Combobox.Root>` draws no element. Generic: `<Value = unknown
|
|
1380
|
+
- `<Combobox.Root>` draws no element. Generic: `<Value = unknown, Multiple extends boolean | undefined = false>`. `Multiple` is read from `multiple`: with it, `value` and `@value-change` hold a list. Its props are above.
|
|
922
1381
|
- `<Combobox.Input>` draws a `<input>`.
|
|
923
1382
|
- `<Combobox.Trigger>` draws a `<button>`.
|
|
1383
|
+
- `<Combobox.Value>` draws no element. The chosen value's label, or a placeholder while nothing is chosen, for a button that is the combobox (its input inside the popup). With several values, their labels with commas between. Its default slot is also given `value: Value | null`, `label: string`, `values: readonly Value[]`, `labels: readonly string[]`.
|
|
1384
|
+
- `placeholder?: string`: What it shows while nothing is chosen.
|
|
924
1385
|
- `<Combobox.Clear>` draws a `<button>`.
|
|
925
1386
|
- `keepMounted?: boolean`: Keeps the button in the page while there is nothing to clear.
|
|
926
1387
|
- `<Combobox.Chips>` draws a `<div>`. With several values: what holds the chips and the input, and what the list is placed against.
|
|
927
|
-
- `<Combobox.Chip>` draws a `<span>`.
|
|
1388
|
+
- `<Combobox.Chip>` draws a `<span>`.
|
|
928
1389
|
- `value: unknown`: Required. The chosen value it stands for: what its remove button takes away.
|
|
929
1390
|
- `<Combobox.ChipRemove>` draws a `<button>`.
|
|
930
1391
|
- `<Combobox.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
1392
|
+
- `<Combobox.Backdrop>` draws a `<div>`.
|
|
931
1393
|
- `<Combobox.Positioner>` draws a `<div>`. A positioner's own props: where its popup goes, and what it is placed against. Takes the positioner options ("Positioner options", above).
|
|
932
1394
|
- `<Combobox.Popup>` draws a `<div>`.
|
|
933
1395
|
- `<Combobox.List>` draws a `<div>`.
|
|
1396
|
+
- `<Combobox.Collection>` draws no element. Draws the list from the root's `items`: its content once for each item left for what was typed, or for each group that has items left; given a group, for each of that group's items left. The root then filters, and no item hides itself. Its default slot is also given `entry: ComboboxEntry`.
|
|
1397
|
+
- `of?: ComboboxEntry`: A group the root's `items` gave: its items left are then what is drawn.
|
|
934
1398
|
- `<Combobox.Group>` draws a `<div>`. Items that belong together, named by their label. Hidden while none is shown.
|
|
935
1399
|
- `<Combobox.GroupLabel>` draws a `<div>`. The name of a group. Outside a group it is plain text, and names nothing.
|
|
936
1400
|
- `<Combobox.Separator>` draws a `<div>`. A line between groups.
|
|
@@ -942,40 +1406,91 @@ Each part, and its own props:
|
|
|
942
1406
|
- `<Combobox.ItemIndicator>` draws a `<span>`. A mark an item shows while it is the chosen one.
|
|
943
1407
|
- `keepMounted?: boolean`: Keeps the mark in the page while its item is not chosen.
|
|
944
1408
|
- `<Combobox.Empty>` draws a `<div>`. What is shown when no item is.
|
|
1409
|
+
- `<Combobox.Status>` draws a `<div>`. Says how the list stands ("3 results", "Loading") to software that reads the page, as its text changes. It stays in the page while its text changes: inside the popup, or beside the input.
|
|
945
1410
|
|
|
946
1411
|
Attributes and CSS variables, by part:
|
|
947
1412
|
|
|
948
1413
|
- 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.
|
|
949
1414
|
- `data-popup-open`: Present when the list is open.
|
|
1415
|
+
- `data-pressed`: Present while its popup is open: it stays pressed, as a button held down.
|
|
1416
|
+
- `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.
|
|
1417
|
+
- `data-list-empty`: Present when no item is shown for what was typed, once the list is in the page.
|
|
950
1418
|
- `data-disabled`: Present when it is disabled.
|
|
1419
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1420
|
+
- `data-required`: Present when the form needs it.
|
|
1421
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
1422
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
1423
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
1424
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
1425
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
1426
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
951
1427
|
- 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.
|
|
952
1428
|
- `data-popup-open`: Present when the list is open.
|
|
1429
|
+
- `data-pressed`: Present while its popup is open: it stays pressed, as a button held down.
|
|
1430
|
+
- `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.
|
|
1431
|
+
- `data-list-empty`: Present when no item is shown for what was typed, once the list is in the page.
|
|
953
1432
|
- `data-disabled`: Present when it is disabled.
|
|
954
|
-
-
|
|
1433
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1434
|
+
- `data-required`: Present when the form needs it.
|
|
1435
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
1436
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
1437
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
1438
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
1439
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
1440
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
1441
|
+
- backdrop: The layer over the page behind the list: a press on it closes the list.
|
|
1442
|
+
- `data-open`: Present when it is open.
|
|
1443
|
+
- `data-closed`: Present when it is closed.
|
|
1444
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1445
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1446
|
+
- `data-presentation="popup | sheet"`: How the list opened: placed against its trigger, or as a sheet from the bottom edge.
|
|
1447
|
+
- `data-swiping`: Present while the sheet is dragged.
|
|
1448
|
+
- `data-swipe-dismiss`: Present once a drag has closed it.
|
|
1449
|
+
- `--drawer-swipe-movement-x`: As a sheet: how far it has been dragged across, always 0px.
|
|
1450
|
+
- `--drawer-swipe-movement-y`: As a sheet: how far it has been dragged down.
|
|
1451
|
+
- `--drawer-swipe-progress`: As a sheet: how far it has been dragged, of its own height: 0 to 1.
|
|
1452
|
+
- 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.
|
|
955
1453
|
- `data-open`: Present when it is open.
|
|
956
1454
|
- `data-closed`: Present when it is closed.
|
|
957
1455
|
- `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.
|
|
958
1456
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1457
|
+
- `data-presentation="popup | sheet"`: How the list opened: placed against its trigger, or as a sheet from the bottom edge.
|
|
1458
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
1459
|
+
- `data-empty`: Present when no item is shown for what was typed.
|
|
959
1460
|
- `--anchor-width`: The anchor's width.
|
|
960
1461
|
- `--anchor-height`: The anchor's height.
|
|
961
1462
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
962
1463
|
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
963
1464
|
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
964
|
-
- popup: The list of items. With a `list` inside, what holds it: a dialog around an input and the list.
|
|
1465
|
+
- 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.
|
|
965
1466
|
- `data-open`: Present when it is open.
|
|
966
1467
|
- `data-closed`: Present when it is closed.
|
|
967
1468
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
968
1469
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
969
1470
|
- `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.
|
|
970
1471
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1472
|
+
- `data-presentation="popup | sheet"`: How the list opened: placed against its trigger, or as a sheet from the bottom edge.
|
|
1473
|
+
- `data-swiping`: Present while the sheet is dragged.
|
|
1474
|
+
- `data-swipe-dismiss`: Present once a drag has closed it.
|
|
1475
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
971
1476
|
- `data-empty`: Present when no item is shown for what was typed.
|
|
1477
|
+
- `--drawer-swipe-movement-x`: As a sheet: how far it has been dragged across, always 0px.
|
|
1478
|
+
- `--drawer-swipe-movement-y`: As a sheet: how far it has been dragged down.
|
|
1479
|
+
- `--drawer-swipe-progress`: As a sheet: how far it has been dragged, of its own height: 0 to 1.
|
|
1480
|
+
- `--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.
|
|
972
1481
|
- list: The items' own box inside the popup, when the popup holds more than items (an input): it is then the listbox.
|
|
973
1482
|
- `data-empty`: Present when no item is shown for what was typed.
|
|
974
1483
|
- item: One choice in the list.
|
|
975
1484
|
- `data-selected`: Present on the chosen item.
|
|
976
1485
|
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
977
1486
|
- `data-disabled`: Present when it is disabled.
|
|
978
|
-
- clear: A button that empties the input and the value.
|
|
1487
|
+
- 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.
|
|
1488
|
+
- `data-disabled`: Present when it is disabled.
|
|
1489
|
+
- `data-popup-open`: Present when the list is open.
|
|
1490
|
+
- `data-visible`: Present while there is something to clear.
|
|
1491
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1492
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1493
|
+
- chip: One chosen value. The arrows reach it from the start of the input, and Backspace or Delete on it takes it away.
|
|
979
1494
|
- `data-disabled`: Present when it is disabled.
|
|
980
1495
|
- chipRemove: A chip's button that takes its value away.
|
|
981
1496
|
- `data-disabled`: Present when it is disabled.
|
|
@@ -1004,10 +1519,11 @@ Anatomy:
|
|
|
1004
1519
|
Props of its root:
|
|
1005
1520
|
|
|
1006
1521
|
- `inputValue?: string`: `v-model:inputValue`. What the input says.
|
|
1007
|
-
- `defaultInputValue?: string`: The text the input starts with, when the caller does not hold `inputValue`. Read once.
|
|
1522
|
+
- `defaultInputValue?: string`: The text the input starts with, when the caller does not hold `inputValue`. Read once. Default `""`.
|
|
1008
1523
|
- `filter?: ((label: string, query: string, keywords: readonly string[]) => boolean) | null`: Whether an item is shown for what was typed. Default: its label or one of its keywords holds the text, without regard to case. `null`: every item is shown, and the caller draws the ones it wants.
|
|
1009
1524
|
- `loop?: boolean`: Whether a step past an end of the list goes round to the other.
|
|
1010
1525
|
- `disabled?: boolean`: Disabled: nothing can be typed or chosen.
|
|
1526
|
+
- `autoHighlight?: 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.
|
|
1011
1527
|
- `@input-value-change: (value: string, details: ChangeDetails) => void`: Heard as the input's text is about to change: `details.cancel()` keeps it as it was.
|
|
1012
1528
|
- `@select: (value: string, details: ChangeDetails) => void`: An item was chosen: its value.
|
|
1013
1529
|
|
|
@@ -1023,7 +1539,7 @@ Each part, and its own props:
|
|
|
1023
1539
|
- `disabled?: boolean`: Disables this item: it cannot be chosen, and the arrows pass over it.
|
|
1024
1540
|
- `label?: string`: What is filtered; the item's text when left out.
|
|
1025
1541
|
- `keywords?: readonly string[]`: Other words the item answers to.
|
|
1026
|
-
- `value
|
|
1542
|
+
- `value?: string`: What `@select` is told when this item is chosen; its `label`, or its text, when left out.
|
|
1027
1543
|
- `<Command.Separator>` draws a `<div>`. A line between groups. Hidden while something is typed.
|
|
1028
1544
|
- `alwaysRender?: boolean`: Keeps the line while something is typed.
|
|
1029
1545
|
|
|
@@ -1076,7 +1592,8 @@ Props of its root:
|
|
|
1076
1592
|
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
1077
1593
|
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
1078
1594
|
- `disabled?: boolean`: The trigger cannot be pressed; a submenu's is passed over.
|
|
1079
|
-
- `
|
|
1595
|
+
- `loopFocus?: boolean`: Whether the arrows go round from the last item to the first. Default: they do.
|
|
1596
|
+
- `loop?: boolean`: Whether the arrows wrap from the last item to the first.
|
|
1080
1597
|
- `modal?: boolean`: Holds the page while the menu is open: its scroll is locked, and a press outside closes the menu and reaches nothing. Default: it does not. Not for a submenu.
|
|
1081
1598
|
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
1082
1599
|
|
|
@@ -1091,18 +1608,21 @@ Each part, and its own props:
|
|
|
1091
1608
|
- `<ContextMenu.Item>` draws a `<div>`.
|
|
1092
1609
|
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
1093
1610
|
- `label?: string`: What typing matches; the item's text when left out.
|
|
1094
|
-
- `
|
|
1611
|
+
- `closeOnSelect?: boolean`: Whether choosing the item closes the menu. Default: it does for an item, and does not for a checkbox or a radio item.
|
|
1612
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu.
|
|
1095
1613
|
- `<ContextMenu.LinkItem>` draws a `<a>`.
|
|
1096
1614
|
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
1097
1615
|
- `label?: string`: What typing matches; the item's text when left out.
|
|
1098
|
-
- `
|
|
1616
|
+
- `closeOnSelect?: boolean`: Whether choosing the item closes the menu. Default: it does for an item, and does not for a checkbox or a radio item.
|
|
1617
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu.
|
|
1099
1618
|
- `<ContextMenu.Group>` draws a `<div>`. Items that belong together, named by their label.
|
|
1100
1619
|
- `<ContextMenu.GroupLabel>` draws a `<div>`. The name of a group. Outside a group it is plain text, and names nothing.
|
|
1101
1620
|
- `<ContextMenu.Separator>` draws a `<div>`. A line between items.
|
|
1102
1621
|
- `<ContextMenu.CheckboxItem>` draws a `<div>`.
|
|
1103
1622
|
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
1104
1623
|
- `label?: string`: What typing matches; the item's text when left out.
|
|
1105
|
-
- `
|
|
1624
|
+
- `closeOnSelect?: boolean`: Whether choosing the item closes the menu. Default: it does for an item, and does not for a checkbox or a radio item.
|
|
1625
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu.
|
|
1106
1626
|
- `checked?: boolean`: `v-model:checked`. Whether the item is checked, when the caller holds it.
|
|
1107
1627
|
- `defaultChecked?: boolean`: Whether the item starts checked, when the caller does not hold `checked`. Read once.
|
|
1108
1628
|
- `@checked-change: (value: boolean, details: ChangeDetails) => void`: Heard as the item is about to be checked or unchecked: `details.cancel()` keeps it as it was.
|
|
@@ -1116,7 +1636,8 @@ Each part, and its own props:
|
|
|
1116
1636
|
- `<ContextMenu.RadioItem>` draws a `<div>`.
|
|
1117
1637
|
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
1118
1638
|
- `label?: string`: What typing matches; the item's text when left out.
|
|
1119
|
-
- `
|
|
1639
|
+
- `closeOnSelect?: boolean`: Whether choosing the item closes the menu. Default: it does for an item, and does not for a checkbox or a radio item.
|
|
1640
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu.
|
|
1120
1641
|
- `value: unknown`: Required. What the group's value is while this item is the chosen one.
|
|
1121
1642
|
- `<ContextMenu.RadioItemIndicator>` draws a `<span>`.
|
|
1122
1643
|
- `keepMounted?: boolean`: Keeps the mark in the page while its item is not the chosen one.
|
|
@@ -1124,7 +1645,8 @@ Each part, and its own props:
|
|
|
1124
1645
|
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
1125
1646
|
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
1126
1647
|
- `disabled?: boolean`: The trigger cannot be pressed; a submenu's is passed over.
|
|
1127
|
-
- `
|
|
1648
|
+
- `loopFocus?: boolean`: Whether the arrows go round from the last item to the first. Default: they do.
|
|
1649
|
+
- `loop?: boolean`: Whether the arrows wrap from the last item to the first.
|
|
1128
1650
|
- `modal?: boolean`: Holds the page while the menu is open: its scroll is locked, and a press outside closes the menu and reaches nothing. Default: it does not. Not for a submenu.
|
|
1129
1651
|
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
1130
1652
|
- `<ContextMenu.SubmenuTrigger>` draws a `<div>`.
|
|
@@ -1133,16 +1655,20 @@ Attributes and CSS variables, by part:
|
|
|
1133
1655
|
|
|
1134
1656
|
- trigger: The area a secondary press, or a long press on a touch screen, opens the menu in.
|
|
1135
1657
|
- `data-popup-open`: Present when the menu is open.
|
|
1658
|
+
- `data-pressed`: Present while its popup is open: it stays pressed, as a button held down.
|
|
1136
1659
|
- positioner: Places the menu against its trigger. It carries the geometry.
|
|
1137
1660
|
- `data-open`: Present when it is open.
|
|
1138
1661
|
- `data-closed`: Present when it is closed.
|
|
1139
1662
|
- `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.
|
|
1140
1663
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1664
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
1141
1665
|
- `--anchor-width`: The anchor's width.
|
|
1142
1666
|
- `--anchor-height`: The anchor's height.
|
|
1143
1667
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
1144
1668
|
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
1145
1669
|
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
1670
|
+
- `--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.
|
|
1671
|
+
- `--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.
|
|
1146
1672
|
- popup: The menu itself: the list of items.
|
|
1147
1673
|
- `data-open`: Present when it is open.
|
|
1148
1674
|
- `data-closed`: Present when it is closed.
|
|
@@ -1150,7 +1676,10 @@ Attributes and CSS variables, by part:
|
|
|
1150
1676
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1151
1677
|
- `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.
|
|
1152
1678
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1679
|
+
- `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.
|
|
1153
1680
|
- arrow: An element that points at the trigger.
|
|
1681
|
+
- `data-open`: Present when it is open.
|
|
1682
|
+
- `data-closed`: Present when it is closed.
|
|
1154
1683
|
- `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.
|
|
1155
1684
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1156
1685
|
- `data-uncentered`: Present when the arrow cannot sit at the trigger's centre.
|
|
@@ -1204,10 +1733,11 @@ Props of its root:
|
|
|
1204
1733
|
|
|
1205
1734
|
- `value?: IsoDate | null`: `v-model:value`. The day typed, once all of it is; `null` until then.
|
|
1206
1735
|
- `defaultValue?: IsoDate | null`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
1207
|
-
- `locale?: string`: The language and region that order the day, the month and the year and put what stands between them (`"en-US"`: month/day/year). Give it: a server does not know the reader's.
|
|
1736
|
+
- `locale?: string`: The language and region that order the day, the month and the year and put what stands between them (`"en-US"`: month/day/year). Give it: a server does not know the reader's. Default `"en-US"`.
|
|
1208
1737
|
- `min?: IsoDate`: The first and the last day it takes: outside them it says it is invalid.
|
|
1209
1738
|
- `max?: IsoDate`: The last day it takes.
|
|
1210
|
-
- `
|
|
1739
|
+
- `calendarSystem?: 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.
|
|
1740
|
+
- `placeholders?: Partial<Record<DateUnit, string>>`: What an empty part shows. Default: `dd`, `mm`, `yyyy`, `era`.
|
|
1211
1741
|
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
1212
1742
|
- `readOnly?: boolean`: Shown as it is, focusable, not changeable.
|
|
1213
1743
|
- `required?: boolean`: Needed: in a `Field`, leaving it empty is then invalid.
|
|
@@ -1230,7 +1760,7 @@ Attributes and CSS variables, by part:
|
|
|
1230
1760
|
- `data-readonly`: Present when its value cannot be changed.
|
|
1231
1761
|
- `data-invalid`: Present when the date is outside what it takes, or is asked for and half typed.
|
|
1232
1762
|
- segment: One piece of the date: a part that is typed, or what stands between two.
|
|
1233
|
-
- `data-segment="day | month | year | literal"`: Which piece it is.
|
|
1763
|
+
- `data-segment="era | day | month | year | literal"`: Which piece it is: the era only in a calendar of several eras.
|
|
1234
1764
|
- `data-placeholder`: Present on a part that is empty.
|
|
1235
1765
|
- `data-disabled`: Present when it is disabled.
|
|
1236
1766
|
- `data-invalid`: Present when the date is outside what it takes, or is asked for and half typed.
|
|
@@ -1241,13 +1771,13 @@ Attributes and CSS variables, by part:
|
|
|
1241
1771
|
import { DatePicker } from "@kirana-ui/vue/date-picker"
|
|
1242
1772
|
```
|
|
1243
1773
|
|
|
1244
|
-
Parts: `<DatePicker.Root>`, `<DatePicker.Field>`, `<DatePicker.Segments>`, `<DatePicker.Segment>`, `<DatePicker.Input>`, `<DatePicker.Trigger>`, `<DatePicker.Portal>`, `<DatePicker.Positioner>`, `<DatePicker.Popup>`, `<DatePicker.Calendar>`, `<DatePicker.Heading>`, `<DatePicker.Previous>`, `<DatePicker.Next>`, `<DatePicker.Grid>`, `<DatePicker.Weekdays>`, `<DatePicker.HeadCell>`, `<DatePicker.Weeks>`, `<DatePicker.Cell>`, `<DatePicker.Day>`.
|
|
1774
|
+
Parts: `<DatePicker.Root>`, `<DatePicker.Field>`, `<DatePicker.Segments>`, `<DatePicker.Segment>`, `<DatePicker.Input>`, `<DatePicker.Trigger>`, `<DatePicker.Portal>`, `<DatePicker.Positioner>`, `<DatePicker.Popup>`, `<DatePicker.Calendar>`, `<DatePicker.Heading>`, `<DatePicker.Previous>`, `<DatePicker.Next>`, `<DatePicker.Months>`, `<DatePicker.Grid>`, `<DatePicker.Weekdays>`, `<DatePicker.HeadCell>`, `<DatePicker.Weeks>`, `<DatePicker.Cell>`, `<DatePicker.Day>`, `<DatePicker.Clear>`, `<DatePicker.Preset>`.
|
|
1245
1775
|
|
|
1246
1776
|
Anatomy:
|
|
1247
1777
|
|
|
1248
1778
|
```
|
|
1249
1779
|
<DatePicker.Root>
|
|
1250
|
-
<DatePicker.Field>
|
|
1780
|
+
<DatePicker.Field> (repeated)
|
|
1251
1781
|
<DatePicker.Segments>
|
|
1252
1782
|
<DatePicker.Segment> (repeated)
|
|
1253
1783
|
<DatePicker.Input>
|
|
@@ -1256,47 +1786,60 @@ Anatomy:
|
|
|
1256
1786
|
<DatePicker.Positioner>
|
|
1257
1787
|
<DatePicker.Popup>
|
|
1258
1788
|
<DatePicker.Calendar>
|
|
1259
|
-
<DatePicker.
|
|
1789
|
+
<DatePicker.Months> (optional)
|
|
1790
|
+
<DatePicker.Heading>
|
|
1791
|
+
<DatePicker.Grid>
|
|
1792
|
+
<DatePicker.Weekdays>
|
|
1793
|
+
<DatePicker.HeadCell> (repeated)
|
|
1794
|
+
<DatePicker.Weeks>
|
|
1795
|
+
<DatePicker.Cell> (repeated)
|
|
1796
|
+
<DatePicker.Day>
|
|
1260
1797
|
<DatePicker.Previous>
|
|
1261
1798
|
<DatePicker.Next>
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
<DatePicker.HeadCell> (repeated)
|
|
1265
|
-
<DatePicker.Weeks>
|
|
1266
|
-
<DatePicker.Cell> (repeated)
|
|
1267
|
-
<DatePicker.Day>
|
|
1799
|
+
<DatePicker.Clear> (optional)
|
|
1800
|
+
<DatePicker.Preset> (optional, repeated)
|
|
1268
1801
|
```
|
|
1269
1802
|
|
|
1270
1803
|
Props of its root:
|
|
1271
1804
|
|
|
1272
|
-
- `value?:
|
|
1273
|
-
- `defaultValue?:
|
|
1805
|
+
- `value?: DatePickerValueOf<Mode>`: `v-model:value`. 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.
|
|
1806
|
+
- `defaultValue?: DatePickerValueOf<Mode>`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
1807
|
+
- `mode?: Mode`: 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.
|
|
1274
1808
|
- `open?: boolean`: `v-model:open`. Whether the calendar is open, when the caller holds it.
|
|
1275
1809
|
- `defaultOpen?: boolean`: Whether the calendar starts open, when the caller does not hold `open`. Read once.
|
|
1276
1810
|
- `locale?: string`: The language and region of the field and the calendar. Give it: a server does not know.
|
|
1277
1811
|
- `min?: IsoDate`: The first and the last day that can be typed or picked.
|
|
1278
1812
|
- `max?: IsoDate`: The last day that can be typed or picked.
|
|
1279
1813
|
- `isDateUnavailable?: (date: IsoDate) => boolean`: Days that cannot be picked in the calendar.
|
|
1280
|
-
- `calendarSystem?: CalendarSystem`: The calendar its months are laid out in, when it is not the Gregorian one.
|
|
1814
|
+
- `calendarSystem?: CalendarSystem`: 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.
|
|
1281
1815
|
- `fixedWeeks?: boolean`: Always six rows of days.
|
|
1816
|
+
- `months?: number`: How many months the calendar shows side by side (1 by default).
|
|
1817
|
+
- `pagedNavigation?: boolean`: With several `months`: whether Previous and Next turn them all rather than one month.
|
|
1818
|
+
- `month?: IsoDate`: `v-model:month`. The month the calendar shows (the first, with several), when the caller holds it.
|
|
1819
|
+
- `defaultMonth?: IsoDate`: The month the calendar starts on, when the caller does not hold `month`. Read once.
|
|
1282
1820
|
- `placeholders?: Partial<Record<DateUnit, string>>`: What an empty part of the field shows.
|
|
1283
1821
|
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
1284
1822
|
- `readOnly?: boolean`: Shown as it is, focusable, not changeable.
|
|
1285
|
-
- `required?: boolean`: Needed: in a `Field`, leaving it empty is then invalid.
|
|
1823
|
+
- `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.
|
|
1286
1824
|
- `name?: string`: The name it is submitted under.
|
|
1287
1825
|
- `form?: string`: The id of the form it belongs to, when it is not inside it.
|
|
1288
|
-
- `@value-change: (value:
|
|
1826
|
+
- `@value-change: (value: DatePickerValueOf<Mode>, details: ChangeDetails) => void`: Heard as the value is about to change, typed, picked, pressed or cleared: `details.cancel()` keeps the value as it was. A range is heard as each end comes, its other end `null` until it is there too.
|
|
1289
1827
|
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as the calendar is about to open or close: `details.cancel()` keeps it as it was.
|
|
1828
|
+
- `@month-change: (value: string, details: ChangeDetails) => void`: Heard as the calendar is about to show another month, a day typed or picked included: its first day. `details.cancel()` keeps the month as it was.
|
|
1290
1829
|
|
|
1291
1830
|
Each part, and its own props:
|
|
1292
1831
|
|
|
1293
|
-
- `<DatePicker.Root>` draws no element.
|
|
1832
|
+
- `<DatePicker.Root>` draws no element. Generic: `<Mode extends DatePickerMode = "single">`. `value` and its events are typed by `mode`: a day, or a range. Its props are above.
|
|
1294
1833
|
- `<DatePicker.Field>` draws a `<div>`.
|
|
1834
|
+
- `range?: "start" | "end"`: With `mode="range"`: which day of the range it is typed in, the first (`"start"`, the default) or the last (`"end"`).
|
|
1295
1835
|
- `<DatePicker.Segments>` draws no element. The date's segments, in the locale's order: each is given to draw. Its default slot is also given `segment: DateFieldSegment`.
|
|
1296
1836
|
- `<DatePicker.Segment>` draws a `<span>`.
|
|
1297
1837
|
- `segment: DateFieldSegment`: Required. The piece it draws, as `DateField.Segments` gives it.
|
|
1298
1838
|
- `<DatePicker.Input>` draws a `<input>`. The hidden input it is submitted by.
|
|
1299
1839
|
- `<DatePicker.Trigger>` draws a `<button>`.
|
|
1840
|
+
- `openOnHover?: boolean`: Whether the pointer resting on the trigger opens the popover too. A press and the keyboard still open it, and a press on one the pointer opened keeps it open. Default `false`.
|
|
1841
|
+
- `delay?: number`: How long the pointer rests on the trigger before the popover opens, in milliseconds. Default 300.
|
|
1842
|
+
- `closeDelay?: number`: How long after the pointer leaves a popover it opened closes, in milliseconds. Default 0.
|
|
1300
1843
|
- `<DatePicker.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
1301
1844
|
- `<DatePicker.Positioner>` draws a `<div>`. A positioner's own props: where its popup goes, and what it is placed against. Takes the positioner options ("Positioner options", above).
|
|
1302
1845
|
- `<DatePicker.Popup>` draws a `<div>`.
|
|
@@ -1304,7 +1847,8 @@ Each part, and its own props:
|
|
|
1304
1847
|
- `<DatePicker.Heading>` draws a `<div>`. Names the month shown. Read out when it changes.
|
|
1305
1848
|
- `<DatePicker.Previous>` draws a `<button>`.
|
|
1306
1849
|
- `<DatePicker.Next>` draws a `<button>`.
|
|
1307
|
-
- `<DatePicker.
|
|
1850
|
+
- `<DatePicker.Months>` draws no element. The months shown, with several: each is given to draw its heading and its grid. It draws no element, and is left out for one month. Its default slot is also given `month: CalendarMonth`.
|
|
1851
|
+
- `<DatePicker.Grid>` draws a `<table>`. The table of a month's days: a grid the arrows move in, from one month shown into the next.
|
|
1308
1852
|
- `<DatePicker.Weekdays>` draws no element. The days of the week: each is given to draw its head cell. Its default slot is also given `weekday: CalendarWeekday`.
|
|
1309
1853
|
- `<DatePicker.HeadCell>` draws a `<th>`. A column's heading: a day of the week.
|
|
1310
1854
|
- `weekday: CalendarWeekday`: Required. The day of the week it names, as `Calendar.Weekdays` gives it.
|
|
@@ -1312,31 +1856,38 @@ Each part, and its own props:
|
|
|
1312
1856
|
- `<DatePicker.Cell>` draws a `<td>`.
|
|
1313
1857
|
- `date: string`: Required. The day it is for, as a week of `Calendar.Weeks` gives it.
|
|
1314
1858
|
- `<DatePicker.Day>` draws a `<button>`.
|
|
1315
|
-
- `date
|
|
1859
|
+
- `date?: string`: The day it is the button of. Left out, the `Calendar.Cell`'s it is inside.
|
|
1860
|
+
- `<DatePicker.Clear>` draws a `<button>`.
|
|
1861
|
+
- `<DatePicker.Preset>` draws a `<button>`.
|
|
1862
|
+
- `value: string | DatePickerRange`: Required. The value its press gives: a day, or with `mode="range"` a range.
|
|
1316
1863
|
|
|
1317
1864
|
Attributes and CSS variables, by part:
|
|
1318
1865
|
|
|
1319
|
-
- field: The field
|
|
1866
|
+
- 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"`).
|
|
1320
1867
|
- `data-disabled`: Present when it is disabled.
|
|
1321
1868
|
- `data-readonly`: Present when its value cannot be changed.
|
|
1322
1869
|
- `data-invalid`: Present when the date is outside what it takes, or is asked for and half typed.
|
|
1323
1870
|
- segment: One piece of the date: a part that is typed, or what stands between two.
|
|
1324
|
-
- `data-segment="day | month | year | literal"`: Which piece it is.
|
|
1871
|
+
- `data-segment="era | day | month | year | literal"`: Which piece it is: the era only in a calendar of several eras.
|
|
1325
1872
|
- `data-placeholder`: Present on a part that is empty.
|
|
1326
1873
|
- `data-disabled`: Present when it is disabled.
|
|
1327
1874
|
- `data-invalid`: Present when the date is outside what it takes, or is asked for and half typed.
|
|
1328
1875
|
- trigger: The button that opens the popover, and what it is placed against.
|
|
1329
1876
|
- `data-popup-open`: Present when the popover is open.
|
|
1877
|
+
- `data-pressed`: Present while the popover a press on this trigger opened is open: it stays pressed, as a button held down.
|
|
1330
1878
|
- positioner: Places the popup against the trigger. It carries the geometry.
|
|
1331
1879
|
- `data-open`: Present when it is open.
|
|
1332
1880
|
- `data-closed`: Present when it is closed.
|
|
1333
1881
|
- `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.
|
|
1334
1882
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1883
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
1335
1884
|
- `--anchor-width`: The anchor's width.
|
|
1336
1885
|
- `--anchor-height`: The anchor's height.
|
|
1337
1886
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
1338
1887
|
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
1339
1888
|
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
1889
|
+
- `--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.
|
|
1890
|
+
- `--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.
|
|
1340
1891
|
- popup: The popover itself.
|
|
1341
1892
|
- `data-open`: Present when it is open.
|
|
1342
1893
|
- `data-closed`: Present when it is closed.
|
|
@@ -1344,6 +1895,9 @@ Attributes and CSS variables, by part:
|
|
|
1344
1895
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1345
1896
|
- `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.
|
|
1346
1897
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1898
|
+
- `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.
|
|
1899
|
+
- `--popup-width`: Its width: `auto`, and while its content changes size, the old width and then the new one, for a transition between them.
|
|
1900
|
+
- `--popup-height`: Its height: `auto`, and while its content changes size, the old height and then the new one, for a transition between them.
|
|
1347
1901
|
- calendar: The calendar.
|
|
1348
1902
|
- `data-disabled`: Present when it is disabled.
|
|
1349
1903
|
- `data-readonly`: Present when its value cannot be changed.
|
|
@@ -1352,21 +1906,26 @@ Attributes and CSS variables, by part:
|
|
|
1352
1906
|
- next: Shows the month after.
|
|
1353
1907
|
- `data-disabled`: Present when it is disabled.
|
|
1354
1908
|
- cell: A day's cell.
|
|
1355
|
-
- `data-selected`: Present on a chosen day,
|
|
1909
|
+
- `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.
|
|
1356
1910
|
- `data-today`: Present on today.
|
|
1357
1911
|
- `data-outside-month`: Present on the days of the month before and after that fill the first and last weeks.
|
|
1358
1912
|
- `data-disabled`: Present when it is disabled.
|
|
1359
1913
|
- `data-unavailable`: Present on a day that cannot be chosen.
|
|
1360
|
-
- `data-range-start`: Present on the first day of a range.
|
|
1361
|
-
- `data-range-end`: Present on the last day of a range.
|
|
1914
|
+
- `data-range-start`: Present on the first day of a range, and on a copy of it.
|
|
1915
|
+
- `data-range-end`: Present on the last day of a range, and on a copy of it.
|
|
1362
1916
|
- day: The button for a day.
|
|
1363
|
-
- `data-selected`: Present on a chosen day,
|
|
1917
|
+
- `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.
|
|
1364
1918
|
- `data-today`: Present on today.
|
|
1365
1919
|
- `data-outside-month`: Present on the days of the month before and after that fill the first and last weeks.
|
|
1366
1920
|
- `data-disabled`: Present when it is disabled.
|
|
1367
1921
|
- `data-unavailable`: Present on a day that cannot be chosen.
|
|
1368
|
-
- `data-range-start`: Present on the first day of a range.
|
|
1369
|
-
- `data-range-end`: Present on the last day of a range.
|
|
1922
|
+
- `data-range-start`: Present on the first day of a range, and on a copy of it.
|
|
1923
|
+
- `data-range-end`: Present on the last day of a range, and on a copy of it.
|
|
1924
|
+
- clear: Empties the value, and gives focus to the field. Disabled while there is none.
|
|
1925
|
+
- `data-disabled`: Present when it is disabled.
|
|
1926
|
+
- preset: Makes the value the day, or the range, it is given. Pressed while the value is that.
|
|
1927
|
+
- `data-pressed`: Present while the value is the one it gives.
|
|
1928
|
+
- `data-disabled`: Present when it is disabled.
|
|
1370
1929
|
|
|
1371
1930
|
### Dialog
|
|
1372
1931
|
|
|
@@ -1374,7 +1933,7 @@ Attributes and CSS variables, by part:
|
|
|
1374
1933
|
import { Dialog } from "@kirana-ui/vue/dialog"
|
|
1375
1934
|
```
|
|
1376
1935
|
|
|
1377
|
-
Parts: `<Dialog.Root>`, `<Dialog.Trigger>`, `<Dialog.Portal>`, `<Dialog.Backdrop>`, `<Dialog.Popup>`, `<Dialog.Title>`, `<Dialog.Description>`, `<Dialog.Close>`.
|
|
1936
|
+
Parts: `<Dialog.Root>`, `<Dialog.Trigger>`, `<Dialog.Portal>`, `<Dialog.Backdrop>`, `<Dialog.Viewport>`, `<Dialog.Popup>`, `<Dialog.Title>`, `<Dialog.Description>`, `<Dialog.Close>`.
|
|
1378
1937
|
|
|
1379
1938
|
Anatomy:
|
|
1380
1939
|
|
|
@@ -1383,10 +1942,11 @@ Anatomy:
|
|
|
1383
1942
|
<Dialog.Trigger>
|
|
1384
1943
|
<Dialog.Portal>
|
|
1385
1944
|
<Dialog.Backdrop>
|
|
1386
|
-
<Dialog.
|
|
1387
|
-
<Dialog.
|
|
1388
|
-
|
|
1389
|
-
|
|
1945
|
+
<Dialog.Viewport> (optional)
|
|
1946
|
+
<Dialog.Popup>
|
|
1947
|
+
<Dialog.Title>
|
|
1948
|
+
<Dialog.Description>
|
|
1949
|
+
<Dialog.Close>
|
|
1390
1950
|
```
|
|
1391
1951
|
|
|
1392
1952
|
Props of its root:
|
|
@@ -1394,6 +1954,8 @@ Props of its root:
|
|
|
1394
1954
|
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
1395
1955
|
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
1396
1956
|
- `modal?: boolean`: Blocks the page behind it and traps focus. Default `true`.
|
|
1957
|
+
- `disablePointerDismissal?: 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"`.
|
|
1958
|
+
- `closeOnOutsidePress?: boolean`: Whether a press outside closes it. Default `true`.
|
|
1397
1959
|
- `dismissible?: boolean`: Whether a press outside closes it. Default `true`.
|
|
1398
1960
|
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
1399
1961
|
|
|
@@ -1401,29 +1963,43 @@ Each part, and its own props:
|
|
|
1401
1963
|
|
|
1402
1964
|
- `<Dialog.Root>` draws no element. Holds the dialog: whether it is open. Its props are above.
|
|
1403
1965
|
- `<Dialog.Trigger>` draws a `<button>`.
|
|
1966
|
+
- `disabled?: boolean`: It cannot be pressed: the button is disabled, and says so (`data-disabled`).
|
|
1404
1967
|
- `<Dialog.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
1405
1968
|
- `<Dialog.Backdrop>` draws a `<div>`.
|
|
1969
|
+
- `<Dialog.Viewport>` draws a `<div>`.
|
|
1406
1970
|
- `<Dialog.Popup>` draws a `<div>`.
|
|
1407
1971
|
- `<Dialog.Title>` draws a `<h2>`. The heading that names the dialog.
|
|
1408
1972
|
- `<Dialog.Description>` draws a `<p>`. The text that describes the dialog.
|
|
1409
|
-
- `<Dialog.Close>` draws a `<button>`.
|
|
1973
|
+
- `<Dialog.Close>` draws a `<button>`.
|
|
1974
|
+
- `disabled?: boolean`: It cannot be pressed: the button is disabled, and says so (`data-disabled`).
|
|
1410
1975
|
|
|
1411
1976
|
Attributes and CSS variables, by part:
|
|
1412
1977
|
|
|
1413
1978
|
- trigger: The button that opens the dialog.
|
|
1414
1979
|
- `data-popup-open`: Present when the dialog is open.
|
|
1980
|
+
- `data-disabled`: Present when it is disabled.
|
|
1415
1981
|
- backdrop: The layer over the page behind the dialog.
|
|
1416
1982
|
- `data-open`: Present when it is open.
|
|
1417
1983
|
- `data-closed`: Present when it is closed.
|
|
1418
1984
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1419
1985
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1986
|
+
- 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.
|
|
1987
|
+
- `data-open`: Present when it is open.
|
|
1988
|
+
- `data-closed`: Present when it is closed.
|
|
1989
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1990
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1991
|
+
- `data-nested`: Present when the dialog opened over another dialog.
|
|
1992
|
+
- `data-nested-dialog-open`: Present when another dialog is open above this one.
|
|
1420
1993
|
- popup: The dialog itself.
|
|
1421
1994
|
- `data-open`: Present when it is open.
|
|
1422
1995
|
- `data-closed`: Present when it is closed.
|
|
1423
1996
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1424
1997
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1998
|
+
- `data-nested`: Present when the dialog opened over another dialog.
|
|
1425
1999
|
- `data-nested-dialog-open`: Present when another dialog is open above this one.
|
|
1426
2000
|
- `--nested-dialogs`: How many dialogs are open above this one.
|
|
2001
|
+
- close: A button that closes the dialog.
|
|
2002
|
+
- `data-disabled`: Present when it is disabled.
|
|
1427
2003
|
|
|
1428
2004
|
### Drawer
|
|
1429
2005
|
|
|
@@ -1451,6 +2027,8 @@ Props of its root:
|
|
|
1451
2027
|
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
1452
2028
|
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
1453
2029
|
- `modal?: boolean`: Blocks the page behind it and traps focus. Default `true`.
|
|
2030
|
+
- `disablePointerDismissal?: 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"`.
|
|
2031
|
+
- `closeOnOutsidePress?: boolean`: Whether a press outside closes it. Default `true`.
|
|
1454
2032
|
- `dismissible?: boolean`: Whether a press outside closes it. Default `true`.
|
|
1455
2033
|
- `swipeDirection?: DrawerSide`: The way it is dragged to close it: the edge it came from. Default: `"down"`.
|
|
1456
2034
|
- `snapPoints?: readonly DrawerSnapPoint[]`: 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.
|
|
@@ -1463,32 +2041,39 @@ Each part, and its own props:
|
|
|
1463
2041
|
|
|
1464
2042
|
- `<Drawer.Root>` draws no element. Holds the dialog: whether it is open. Its props are above.
|
|
1465
2043
|
- `<Drawer.Trigger>` draws a `<button>`.
|
|
2044
|
+
- `disabled?: boolean`: It cannot be pressed: the button is disabled, and says so (`data-disabled`).
|
|
1466
2045
|
- `<Drawer.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
1467
2046
|
- `<Drawer.Backdrop>` draws a `<div>`.
|
|
1468
2047
|
- `<Drawer.Popup>` draws a `<div>`.
|
|
1469
2048
|
- `<Drawer.Title>` draws a `<h2>`. The heading that names the dialog.
|
|
1470
2049
|
- `<Drawer.Description>` draws a `<p>`. The text that describes the dialog.
|
|
1471
|
-
- `<Drawer.Close>` draws a `<button>`.
|
|
2050
|
+
- `<Drawer.Close>` draws a `<button>`.
|
|
2051
|
+
- `disabled?: boolean`: It cannot be pressed: the button is disabled, and says so (`data-disabled`).
|
|
1472
2052
|
|
|
1473
2053
|
Attributes and CSS variables, by part:
|
|
1474
2054
|
|
|
1475
2055
|
- trigger: The button that opens the dialog.
|
|
1476
2056
|
- `data-popup-open`: Present when the dialog is open.
|
|
2057
|
+
- `data-disabled`: Present when it is disabled.
|
|
1477
2058
|
- backdrop: The layer over the page behind the dialog.
|
|
1478
2059
|
- `data-open`: Present when it is open.
|
|
1479
2060
|
- `data-closed`: Present when it is closed.
|
|
1480
2061
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1481
2062
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1482
2063
|
- `data-swiping`: Present while the drawer is dragged.
|
|
2064
|
+
- `data-swipe-dismiss`: Present once a drag has closed the drawer.
|
|
1483
2065
|
- `--drawer-swipe-movement-x`: How far it has been dragged across.
|
|
1484
2066
|
- `--drawer-swipe-movement-y`: How far it has been dragged up or down.
|
|
1485
2067
|
- `--drawer-swipe-progress`: How far it has been dragged, of its own size: 0 to 1.
|
|
1486
2068
|
- `--drawer-snap-point-offset`: How far from whole it rests, towards the edge it closes at: 0px at its largest snap point.
|
|
2069
|
+
- `--drawer-swipe-strength`: Always 1: the backdrop takes the design's own time to leave, however the drawer was thrown.
|
|
2070
|
+
- `--drawer-height`: While the drawer is dragged: the height of the drawer in front.
|
|
1487
2071
|
- 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.
|
|
1488
2072
|
- `data-open`: Present when it is open.
|
|
1489
2073
|
- `data-closed`: Present when it is closed.
|
|
1490
2074
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1491
2075
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2076
|
+
- `data-nested`: Present when the dialog opened over another dialog.
|
|
1492
2077
|
- `data-nested-dialog-open`: Present when another dialog is open above this one.
|
|
1493
2078
|
- `data-swiping`: Present while the drawer is dragged.
|
|
1494
2079
|
- `data-swipe-direction="up | down | left | right"`: The way it is dragged to close it.
|
|
@@ -1506,6 +2091,123 @@ Attributes and CSS variables, by part:
|
|
|
1506
2091
|
- `--drawer-frontmost-height`: The height of the drawer in front of every other, while this one is open.
|
|
1507
2092
|
- `--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.
|
|
1508
2093
|
- `--drawer-width`: Its width.
|
|
2094
|
+
- close: A button that closes the dialog.
|
|
2095
|
+
- `data-disabled`: Present when it is disabled.
|
|
2096
|
+
|
|
2097
|
+
### Editable
|
|
2098
|
+
|
|
2099
|
+
```
|
|
2100
|
+
import { Editable } from "@kirana-ui/vue/editable"
|
|
2101
|
+
```
|
|
2102
|
+
|
|
2103
|
+
Parts: `<Editable.Root>`, `<Editable.Preview>`, `<Editable.Input>`, `<Editable.EditTrigger>`, `<Editable.SubmitTrigger>`, `<Editable.CancelTrigger>`.
|
|
2104
|
+
|
|
2105
|
+
Anatomy:
|
|
2106
|
+
|
|
2107
|
+
```
|
|
2108
|
+
<Editable.Root>
|
|
2109
|
+
<Editable.Preview>
|
|
2110
|
+
<Editable.Input>
|
|
2111
|
+
<Editable.EditTrigger> (optional)
|
|
2112
|
+
<Editable.SubmitTrigger> (optional)
|
|
2113
|
+
<Editable.CancelTrigger> (optional)
|
|
2114
|
+
```
|
|
2115
|
+
|
|
2116
|
+
Props of its root:
|
|
2117
|
+
|
|
2118
|
+
- `value?: string`: `v-model:value`. The text it holds: what the preview shows, and what editing starts from.
|
|
2119
|
+
- `defaultValue?: string`: The text it starts with, when the caller does not hold `value`. Read once. Default `""`.
|
|
2120
|
+
- `editing?: boolean`: `v-model:editing`. Whether it is being edited, when the caller holds it.
|
|
2121
|
+
- `defaultEditing?: boolean`: Read once.
|
|
2122
|
+
- `placeholder?: string`: What the preview shows while the text is empty. Default `""`.
|
|
2123
|
+
- `activation?: "focus" | "click" | "dblclick" | "none"`: What on the preview starts an edit: focus reaching it (the default), a press, two presses, or nothing, where only the edit trigger does.
|
|
2124
|
+
- `submitOnBlur?: boolean`: Whether focus leaving the input keeps the edit (the default) or drops it.
|
|
2125
|
+
- `selectOnFocus?: boolean`: Whether the text is selected as editing starts. Default `true`.
|
|
2126
|
+
- `disabled?: boolean`: Disabled: it cannot be edited.
|
|
2127
|
+
- `readOnly?: boolean`: Shown as it is, not editable.
|
|
2128
|
+
- `required?: boolean`: Needed: in a `Field`, leaving it empty is then invalid.
|
|
2129
|
+
- `name?: string`: With a name, the text is submitted with the form around it; in a `Field`, the field's by default.
|
|
2130
|
+
- `form?: string`: The id of the form the input belongs to, when it is not inside it.
|
|
2131
|
+
- `@value-change: (value: string, details: ChangeDetails) => void`: Heard as an edit is about to be kept: `details.cancel()` keeps the text, and the edit open.
|
|
2132
|
+
- `@editing-change: (value: boolean, details: ChangeDetails) => void`: Heard as editing is about to start or end: `details.cancel()` keeps it as it was.
|
|
2133
|
+
|
|
2134
|
+
Each part, and its own props:
|
|
2135
|
+
|
|
2136
|
+
- `<Editable.Root>` draws a `<div>`. Its props are above.
|
|
2137
|
+
- `<Editable.Preview>` draws a `<span>`.
|
|
2138
|
+
- `<Editable.Input>` draws a `<input>`.
|
|
2139
|
+
- `<Editable.EditTrigger>` draws a `<button>`.
|
|
2140
|
+
- `<Editable.SubmitTrigger>` draws a `<button>`.
|
|
2141
|
+
- `<Editable.CancelTrigger>` draws a `<button>`.
|
|
2142
|
+
|
|
2143
|
+
Attributes and CSS variables, by part:
|
|
2144
|
+
|
|
2145
|
+
- root: A text edited in place.
|
|
2146
|
+
- `data-editing`: Present while it is being edited.
|
|
2147
|
+
- `data-disabled`: Present when it is disabled.
|
|
2148
|
+
- `data-readonly`: Present when it is shown and cannot be edited.
|
|
2149
|
+
- `data-placeholder`: Present while it holds no text.
|
|
2150
|
+
- `data-touched`: In a field: present once focus has left it.
|
|
2151
|
+
- `data-dirty`: In a field: present while the text is not the one it began with.
|
|
2152
|
+
- `data-filled`: In a field: present while it holds text.
|
|
2153
|
+
- `data-focused`: In a field: present while it has focus.
|
|
2154
|
+
- `data-valid`: In a field: present once the text was checked and found right.
|
|
2155
|
+
- `data-invalid`: In a field: present while the text is wrong.
|
|
2156
|
+
- preview: The text as it reads, or the placeholder while there is none: hidden while editing.
|
|
2157
|
+
- `data-editing`: Present while it is being edited.
|
|
2158
|
+
- `data-disabled`: Present when it is disabled.
|
|
2159
|
+
- `data-readonly`: Present when it is shown and cannot be edited.
|
|
2160
|
+
- `data-placeholder`: Present while it holds no text.
|
|
2161
|
+
- `data-touched`: In a field: present once focus has left it.
|
|
2162
|
+
- `data-dirty`: In a field: present while the text is not the one it began with.
|
|
2163
|
+
- `data-filled`: In a field: present while it holds text.
|
|
2164
|
+
- `data-focused`: In a field: present while it has focus.
|
|
2165
|
+
- `data-valid`: In a field: present once the text was checked and found right.
|
|
2166
|
+
- `data-invalid`: In a field: present while the text is wrong.
|
|
2167
|
+
- input: Where the text is typed, an `<input>` or a `<textarea>`: hidden unless editing.
|
|
2168
|
+
- `data-editing`: Present while it is being edited.
|
|
2169
|
+
- `data-disabled`: Present when it is disabled.
|
|
2170
|
+
- `data-readonly`: Present when it is shown and cannot be edited.
|
|
2171
|
+
- `data-placeholder`: Present while it holds no text.
|
|
2172
|
+
- `data-touched`: In a field: present once focus has left it.
|
|
2173
|
+
- `data-dirty`: In a field: present while the text is not the one it began with.
|
|
2174
|
+
- `data-filled`: In a field: present while it holds text.
|
|
2175
|
+
- `data-focused`: In a field: present while it has focus.
|
|
2176
|
+
- `data-valid`: In a field: present once the text was checked and found right.
|
|
2177
|
+
- `data-invalid`: In a field: present while the text is wrong.
|
|
2178
|
+
- editTrigger: Starts an edit: hidden while editing.
|
|
2179
|
+
- `data-editing`: Present while it is being edited.
|
|
2180
|
+
- `data-disabled`: Present when it is disabled.
|
|
2181
|
+
- `data-readonly`: Present when it is shown and cannot be edited.
|
|
2182
|
+
- `data-placeholder`: Present while it holds no text.
|
|
2183
|
+
- `data-touched`: In a field: present once focus has left it.
|
|
2184
|
+
- `data-dirty`: In a field: present while the text is not the one it began with.
|
|
2185
|
+
- `data-filled`: In a field: present while it holds text.
|
|
2186
|
+
- `data-focused`: In a field: present while it has focus.
|
|
2187
|
+
- `data-valid`: In a field: present once the text was checked and found right.
|
|
2188
|
+
- `data-invalid`: In a field: present while the text is wrong.
|
|
2189
|
+
- submitTrigger: Keeps what was typed: hidden unless editing.
|
|
2190
|
+
- `data-editing`: Present while it is being edited.
|
|
2191
|
+
- `data-disabled`: Present when it is disabled.
|
|
2192
|
+
- `data-readonly`: Present when it is shown and cannot be edited.
|
|
2193
|
+
- `data-placeholder`: Present while it holds no text.
|
|
2194
|
+
- `data-touched`: In a field: present once focus has left it.
|
|
2195
|
+
- `data-dirty`: In a field: present while the text is not the one it began with.
|
|
2196
|
+
- `data-filled`: In a field: present while it holds text.
|
|
2197
|
+
- `data-focused`: In a field: present while it has focus.
|
|
2198
|
+
- `data-valid`: In a field: present once the text was checked and found right.
|
|
2199
|
+
- `data-invalid`: In a field: present while the text is wrong.
|
|
2200
|
+
- cancelTrigger: Drops what was typed: hidden unless editing.
|
|
2201
|
+
- `data-editing`: Present while it is being edited.
|
|
2202
|
+
- `data-disabled`: Present when it is disabled.
|
|
2203
|
+
- `data-readonly`: Present when it is shown and cannot be edited.
|
|
2204
|
+
- `data-placeholder`: Present while it holds no text.
|
|
2205
|
+
- `data-touched`: In a field: present once focus has left it.
|
|
2206
|
+
- `data-dirty`: In a field: present while the text is not the one it began with.
|
|
2207
|
+
- `data-filled`: In a field: present while it holds text.
|
|
2208
|
+
- `data-focused`: In a field: present while it has focus.
|
|
2209
|
+
- `data-valid`: In a field: present once the text was checked and found right.
|
|
2210
|
+
- `data-invalid`: In a field: present while the text is wrong.
|
|
1509
2211
|
|
|
1510
2212
|
### Field
|
|
1511
2213
|
|
|
@@ -1522,7 +2224,7 @@ Anatomy:
|
|
|
1522
2224
|
<Field.Label>
|
|
1523
2225
|
<Field.Control>
|
|
1524
2226
|
<Field.Description>
|
|
1525
|
-
<Field.Error>
|
|
2227
|
+
<Field.Error> (repeated)
|
|
1526
2228
|
<Field.Validity>
|
|
1527
2229
|
```
|
|
1528
2230
|
|
|
@@ -1533,7 +2235,7 @@ Props of its root:
|
|
|
1533
2235
|
- `invalid?: boolean`: Invalid whatever the value: an error known from elsewhere.
|
|
1534
2236
|
- `validate?: ( value: string ) => string | readonly string[] | null | Promise<string | readonly string[] | null>`: The field's own check, after the browser's: a message or several when the value is wrong, `null` when it is right. It may answer later, with a promise.
|
|
1535
2237
|
- `validationMode?: ValidationMode`: When the value is checked; the form's by default, else `"onSubmit"`.
|
|
1536
|
-
- `validationDebounceTime?: number`: With `"onChange"`, how long the value must rest before it is checked, in milliseconds.
|
|
2238
|
+
- `validationDebounceTime?: number`: With `"onChange"`, how long the value must rest before it is checked, in milliseconds. Default `0`.
|
|
1537
2239
|
|
|
1538
2240
|
Each part, and its own props:
|
|
1539
2241
|
|
|
@@ -1579,7 +2281,7 @@ Attributes and CSS variables, by part:
|
|
|
1579
2281
|
- `data-focused`: Present while the control has focus.
|
|
1580
2282
|
- `data-valid`: Present once the value has been checked and found right.
|
|
1581
2283
|
- `data-invalid`: Present while the value is wrong.
|
|
1582
|
-
- error: What is wrong with the value. In the page while it applies.
|
|
2284
|
+
- 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.
|
|
1583
2285
|
- `data-disabled`: Present when it is disabled.
|
|
1584
2286
|
- `data-touched`: Present once focus has left the control.
|
|
1585
2287
|
- `data-dirty`: Present while the value is not the one it started with.
|
|
@@ -1621,6 +2323,102 @@ Attributes and CSS variables, by part:
|
|
|
1621
2323
|
- legend: The group's name.
|
|
1622
2324
|
- `data-disabled`: Present when it is disabled.
|
|
1623
2325
|
|
|
2326
|
+
### FileUpload
|
|
2327
|
+
|
|
2328
|
+
```
|
|
2329
|
+
import { FileUpload } from "@kirana-ui/vue/file-upload"
|
|
2330
|
+
```
|
|
2331
|
+
|
|
2332
|
+
Parts: `<FileUpload.Root>`, `<FileUpload.Dropzone>`, `<FileUpload.Trigger>`, `<FileUpload.List>`, `<FileUpload.Items>`, `<FileUpload.Item>`, `<FileUpload.ItemName>`, `<FileUpload.ItemSize>`, `<FileUpload.ItemRemove>`, `<FileUpload.Clear>`.
|
|
2333
|
+
|
|
2334
|
+
Anatomy:
|
|
2335
|
+
|
|
2336
|
+
```
|
|
2337
|
+
<FileUpload.Root>
|
|
2338
|
+
<FileUpload.Dropzone>
|
|
2339
|
+
<FileUpload.Trigger> (optional, as above)
|
|
2340
|
+
<FileUpload.Trigger> (optional)
|
|
2341
|
+
<FileUpload.List>
|
|
2342
|
+
<FileUpload.Items>
|
|
2343
|
+
<FileUpload.Item> (repeated)
|
|
2344
|
+
<FileUpload.ItemName>
|
|
2345
|
+
<FileUpload.ItemSize> (optional)
|
|
2346
|
+
<FileUpload.ItemRemove> (optional)
|
|
2347
|
+
<FileUpload.Clear> (optional)
|
|
2348
|
+
```
|
|
2349
|
+
|
|
2350
|
+
Props of its root:
|
|
2351
|
+
|
|
2352
|
+
- `files?: readonly File[]`: `v-model:files`. The files it holds, in order.
|
|
2353
|
+
- `defaultFiles?: readonly File[]`: The files it starts with, when the caller does not hold `files`. Read once.
|
|
2354
|
+
- `accept?: string | readonly 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.
|
|
2355
|
+
- `multiple?: boolean`: Whether several files are held. Default `false`: a file taken is the one held.
|
|
2356
|
+
- `maxFiles?: number`: With `multiple`, how many files it holds at most.
|
|
2357
|
+
- `maxSize?: number`: The largest a file may be, in bytes.
|
|
2358
|
+
- `minSize?: number`: The smallest a file may be, in bytes.
|
|
2359
|
+
- `validate?: (file: File) => boolean`: Whether a file may be taken, asked after the checks above.
|
|
2360
|
+
- `disabled?: boolean`: Disabled: no file can be taken or removed.
|
|
2361
|
+
- `required?: boolean`: Needed: in a `Field`, holding none is then invalid.
|
|
2362
|
+
- `name?: string`: With a name, the files are submitted with the form around them.
|
|
2363
|
+
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
2364
|
+
- `@files-change: (value: File[], details: ChangeDetails) => void`: Heard as the files are about to change: `details.cancel()` keeps them as they were.
|
|
2365
|
+
- `@files-reject: (rejections: FileRejection[]) => void`: The files that were not taken, each with its reasons.
|
|
2366
|
+
|
|
2367
|
+
Each part, and its own props:
|
|
2368
|
+
|
|
2369
|
+
- `<FileUpload.Root>` draws a `<div>`. Its props are above.
|
|
2370
|
+
- `<FileUpload.Dropzone>` draws a `<div>`.
|
|
2371
|
+
- `<FileUpload.Trigger>` draws a `<button>`.
|
|
2372
|
+
- `<FileUpload.List>` draws a `<ul>`.
|
|
2373
|
+
- `<FileUpload.Items>` draws no element. The files, in order: each entry is given to draw. Its default slot is also given `entry: FileUploadEntry`.
|
|
2374
|
+
- `<FileUpload.Item>` draws a `<li>`.
|
|
2375
|
+
- `entry: FileUploadEntry`: Required. The file it is, as `Items` gave it.
|
|
2376
|
+
- `<FileUpload.ItemName>` draws a `<span>`.
|
|
2377
|
+
- `<FileUpload.ItemSize>` draws a `<span>`.
|
|
2378
|
+
- `locale?: string`: The language the number is written in. Default: the reader's.
|
|
2379
|
+
- `<FileUpload.ItemRemove>` draws a `<button>`.
|
|
2380
|
+
- `<FileUpload.Clear>` draws a `<button>`.
|
|
2381
|
+
|
|
2382
|
+
Attributes and CSS variables, by part:
|
|
2383
|
+
|
|
2384
|
+
- root: Files chosen to be sent.
|
|
2385
|
+
- `data-disabled`: Present when it is disabled.
|
|
2386
|
+
- `data-dragging`: Present while files are dragged over the dropzone.
|
|
2387
|
+
- `data-required`: Present when a file is needed.
|
|
2388
|
+
- `data-empty`: Present while it holds no file.
|
|
2389
|
+
- dropzone: Where files are dropped or pasted; pressed, it opens the file picker. It holds the hidden file input.
|
|
2390
|
+
- `data-disabled`: Present when it is disabled.
|
|
2391
|
+
- `data-dragging`: Present while files are dragged over the dropzone.
|
|
2392
|
+
- `data-required`: Present when a file is needed.
|
|
2393
|
+
- trigger: A button that opens the file picker.
|
|
2394
|
+
- `data-disabled`: Present when it is disabled.
|
|
2395
|
+
- `data-dragging`: Present while files are dragged over the dropzone.
|
|
2396
|
+
- `data-required`: Present when a file is needed.
|
|
2397
|
+
- list: What holds the files: a list.
|
|
2398
|
+
- `data-disabled`: Present when it is disabled.
|
|
2399
|
+
- `data-dragging`: Present while files are dragged over the dropzone.
|
|
2400
|
+
- `data-required`: Present when a file is needed.
|
|
2401
|
+
- item: A file.
|
|
2402
|
+
- `data-disabled`: Present when it is disabled.
|
|
2403
|
+
- `data-dragging`: Present while files are dragged over the dropzone.
|
|
2404
|
+
- `data-required`: Present when a file is needed.
|
|
2405
|
+
- itemName: A file's name.
|
|
2406
|
+
- `data-disabled`: Present when it is disabled.
|
|
2407
|
+
- `data-dragging`: Present while files are dragged over the dropzone.
|
|
2408
|
+
- `data-required`: Present when a file is needed.
|
|
2409
|
+
- itemSize: A file's size, as people read one.
|
|
2410
|
+
- `data-disabled`: Present when it is disabled.
|
|
2411
|
+
- `data-dragging`: Present while files are dragged over the dropzone.
|
|
2412
|
+
- `data-required`: Present when a file is needed.
|
|
2413
|
+
- itemRemove: A file's button that takes it away.
|
|
2414
|
+
- `data-disabled`: Present when it is disabled.
|
|
2415
|
+
- `data-dragging`: Present while files are dragged over the dropzone.
|
|
2416
|
+
- `data-required`: Present when a file is needed.
|
|
2417
|
+
- clear: Takes every file away: hidden while there is none.
|
|
2418
|
+
- `data-disabled`: Present when it is disabled.
|
|
2419
|
+
- `data-dragging`: Present while files are dragged over the dropzone.
|
|
2420
|
+
- `data-required`: Present when a file is needed.
|
|
2421
|
+
|
|
1624
2422
|
### Form
|
|
1625
2423
|
|
|
1626
2424
|
```
|
|
@@ -1659,8 +2457,8 @@ Props of its root:
|
|
|
1659
2457
|
|
|
1660
2458
|
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
1661
2459
|
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
1662
|
-
- `delay?: number`: How long the pointer rests on the trigger before the popup opens, in milliseconds.
|
|
1663
|
-
- `closeDelay?: number`: How long after the pointer leaves the popup closes, in milliseconds.
|
|
2460
|
+
- `delay?: number`: How long the pointer rests on the trigger before the popup opens, in milliseconds. Default `600`.
|
|
2461
|
+
- `closeDelay?: number`: How long after the pointer leaves the popup closes, in milliseconds. Default `300`.
|
|
1664
2462
|
- `disabled?: boolean`: Disabled: the pointer and focus do not open it.
|
|
1665
2463
|
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
1666
2464
|
|
|
@@ -1684,11 +2482,14 @@ Attributes and CSS variables, by part:
|
|
|
1684
2482
|
- `data-closed`: Present when it is closed.
|
|
1685
2483
|
- `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.
|
|
1686
2484
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2485
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
1687
2486
|
- `--anchor-width`: The anchor's width.
|
|
1688
2487
|
- `--anchor-height`: The anchor's height.
|
|
1689
2488
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
1690
2489
|
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
1691
2490
|
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
2491
|
+
- `--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.
|
|
2492
|
+
- `--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.
|
|
1692
2493
|
- popup: The card itself.
|
|
1693
2494
|
- `data-open`: Present when it is open.
|
|
1694
2495
|
- `data-closed`: Present when it is closed.
|
|
@@ -1698,6 +2499,8 @@ Attributes and CSS variables, by part:
|
|
|
1698
2499
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1699
2500
|
- `data-instant="delay | focus | dismiss"`: Present when it opened or closed without its usual wait, for a design that skips the motion then.
|
|
1700
2501
|
- arrow: An element that points at the trigger, placed along the popup's edge.
|
|
2502
|
+
- `data-open`: Present when it is open.
|
|
2503
|
+
- `data-closed`: Present when it is closed.
|
|
1701
2504
|
- `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.
|
|
1702
2505
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1703
2506
|
- `data-uncentered`: Present when the popup was pushed along its edge, so the arrow is not at the trigger's centre.
|
|
@@ -1837,7 +2640,8 @@ Props of its root:
|
|
|
1837
2640
|
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
1838
2641
|
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
1839
2642
|
- `disabled?: boolean`: The trigger cannot be pressed; a submenu's is passed over.
|
|
1840
|
-
- `
|
|
2643
|
+
- `loopFocus?: boolean`: Whether the arrows go round from the last item to the first. Default: they do.
|
|
2644
|
+
- `loop?: boolean`: Whether the arrows wrap from the last item to the first.
|
|
1841
2645
|
- `modal?: boolean`: Holds the page while the menu is open: its scroll is locked, and a press outside closes the menu and reaches nothing. Default: it does not. Not for a submenu.
|
|
1842
2646
|
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
1843
2647
|
|
|
@@ -1852,18 +2656,21 @@ Each part, and its own props:
|
|
|
1852
2656
|
- `<Menu.Item>` draws a `<div>`.
|
|
1853
2657
|
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
1854
2658
|
- `label?: string`: What typing matches; the item's text when left out.
|
|
1855
|
-
- `
|
|
2659
|
+
- `closeOnSelect?: boolean`: Whether choosing the item closes the menu. Default: it does for an item, and does not for a checkbox or a radio item.
|
|
2660
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu.
|
|
1856
2661
|
- `<Menu.LinkItem>` draws a `<a>`.
|
|
1857
2662
|
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
1858
2663
|
- `label?: string`: What typing matches; the item's text when left out.
|
|
1859
|
-
- `
|
|
2664
|
+
- `closeOnSelect?: boolean`: Whether choosing the item closes the menu. Default: it does for an item, and does not for a checkbox or a radio item.
|
|
2665
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu.
|
|
1860
2666
|
- `<Menu.Group>` draws a `<div>`. Items that belong together, named by their label.
|
|
1861
2667
|
- `<Menu.GroupLabel>` draws a `<div>`. The name of a group. Outside a group it is plain text, and names nothing.
|
|
1862
2668
|
- `<Menu.Separator>` draws a `<div>`. A line between items.
|
|
1863
2669
|
- `<Menu.CheckboxItem>` draws a `<div>`.
|
|
1864
2670
|
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
1865
2671
|
- `label?: string`: What typing matches; the item's text when left out.
|
|
1866
|
-
- `
|
|
2672
|
+
- `closeOnSelect?: boolean`: Whether choosing the item closes the menu. Default: it does for an item, and does not for a checkbox or a radio item.
|
|
2673
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu.
|
|
1867
2674
|
- `checked?: boolean`: `v-model:checked`. Whether the item is checked, when the caller holds it.
|
|
1868
2675
|
- `defaultChecked?: boolean`: Whether the item starts checked, when the caller does not hold `checked`. Read once.
|
|
1869
2676
|
- `@checked-change: (value: boolean, details: ChangeDetails) => void`: Heard as the item is about to be checked or unchecked: `details.cancel()` keeps it as it was.
|
|
@@ -1877,7 +2684,8 @@ Each part, and its own props:
|
|
|
1877
2684
|
- `<Menu.RadioItem>` draws a `<div>`.
|
|
1878
2685
|
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
1879
2686
|
- `label?: string`: What typing matches; the item's text when left out.
|
|
1880
|
-
- `
|
|
2687
|
+
- `closeOnSelect?: boolean`: Whether choosing the item closes the menu. Default: it does for an item, and does not for a checkbox or a radio item.
|
|
2688
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu.
|
|
1881
2689
|
- `value: unknown`: Required. What the group's value is while this item is the chosen one.
|
|
1882
2690
|
- `<Menu.RadioItemIndicator>` draws a `<span>`.
|
|
1883
2691
|
- `keepMounted?: boolean`: Keeps the mark in the page while its item is not the chosen one.
|
|
@@ -1885,7 +2693,8 @@ Each part, and its own props:
|
|
|
1885
2693
|
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
1886
2694
|
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
1887
2695
|
- `disabled?: boolean`: The trigger cannot be pressed; a submenu's is passed over.
|
|
1888
|
-
- `
|
|
2696
|
+
- `loopFocus?: boolean`: Whether the arrows go round from the last item to the first. Default: they do.
|
|
2697
|
+
- `loop?: boolean`: Whether the arrows wrap from the last item to the first.
|
|
1889
2698
|
- `modal?: boolean`: Holds the page while the menu is open: its scroll is locked, and a press outside closes the menu and reaches nothing. Default: it does not. Not for a submenu.
|
|
1890
2699
|
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
1891
2700
|
- `<Menu.SubmenuTrigger>` draws a `<div>`.
|
|
@@ -1894,17 +2703,21 @@ Attributes and CSS variables, by part:
|
|
|
1894
2703
|
|
|
1895
2704
|
- trigger: The button that opens the menu, and what it is placed against.
|
|
1896
2705
|
- `data-popup-open`: Present when the menu is open.
|
|
2706
|
+
- `data-pressed`: Present while its popup is open: it stays pressed, as a button held down.
|
|
1897
2707
|
- `data-disabled`: Present when it is disabled.
|
|
1898
2708
|
- positioner: Places the menu against its trigger. It carries the geometry.
|
|
1899
2709
|
- `data-open`: Present when it is open.
|
|
1900
2710
|
- `data-closed`: Present when it is closed.
|
|
1901
2711
|
- `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.
|
|
1902
2712
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2713
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
1903
2714
|
- `--anchor-width`: The anchor's width.
|
|
1904
2715
|
- `--anchor-height`: The anchor's height.
|
|
1905
2716
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
1906
2717
|
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
1907
2718
|
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
2719
|
+
- `--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.
|
|
2720
|
+
- `--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.
|
|
1908
2721
|
- popup: The menu itself: the list of items.
|
|
1909
2722
|
- `data-open`: Present when it is open.
|
|
1910
2723
|
- `data-closed`: Present when it is closed.
|
|
@@ -1912,7 +2725,10 @@ Attributes and CSS variables, by part:
|
|
|
1912
2725
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1913
2726
|
- `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.
|
|
1914
2727
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2728
|
+
- `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.
|
|
1915
2729
|
- arrow: An element that points at the trigger.
|
|
2730
|
+
- `data-open`: Present when it is open.
|
|
2731
|
+
- `data-closed`: Present when it is closed.
|
|
1916
2732
|
- `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.
|
|
1917
2733
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1918
2734
|
- `data-uncentered`: Present when the arrow cannot sit at the trigger's centre.
|
|
@@ -1953,9 +2769,11 @@ import { Menubar } from "@kirana-ui/vue/menubar"
|
|
|
1953
2769
|
|
|
1954
2770
|
Props:
|
|
1955
2771
|
|
|
1956
|
-
- `
|
|
2772
|
+
- `loopFocus?: boolean`: Whether the arrows go round from the last menu to the first. Default: they do.
|
|
2773
|
+
- `loop?: boolean`: Whether the arrows wrap from the last item to the first.
|
|
1957
2774
|
- `disabled?: boolean`: No menu of the bar opens.
|
|
1958
2775
|
- `orientation?: Orientation`: A row (the default) or a column of menus. In a column a menu opens beside its trigger.
|
|
2776
|
+
- `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.
|
|
1959
2777
|
|
|
1960
2778
|
`<Menubar>` draws a `<div>`.
|
|
1961
2779
|
|
|
@@ -1963,6 +2781,8 @@ Attributes and CSS variables, by part:
|
|
|
1963
2781
|
|
|
1964
2782
|
- root: The row of menus. A menu inside it is one of its items.
|
|
1965
2783
|
- `data-disabled`: Present when it is disabled.
|
|
2784
|
+
- `data-modal`: Present when its menus hold the page while one is open.
|
|
2785
|
+
- `data-has-submenu-open`: Present while one of its menus is open.
|
|
1966
2786
|
- `data-orientation="horizontal | vertical"`: Whether its menus are in a row or a column.
|
|
1967
2787
|
|
|
1968
2788
|
### MessageScroller
|
|
@@ -2071,8 +2891,8 @@ Props of its root:
|
|
|
2071
2891
|
|
|
2072
2892
|
- `value?: Value | null`: `v-model:value`. The item whose content is shown; `null` is "none".
|
|
2073
2893
|
- `defaultValue?: Value | null`: The item whose content it starts with, when the caller does not hold `value`. Read once.
|
|
2074
|
-
- `delay?: number`: How long the pointer rests on a trigger before its content shows, in milliseconds.
|
|
2075
|
-
- `closeDelay?: number`: How long after the pointer leaves the content goes, in milliseconds.
|
|
2894
|
+
- `delay?: number`: How long the pointer rests on a trigger before its content shows, in milliseconds. Default `50`.
|
|
2895
|
+
- `closeDelay?: number`: How long after the pointer leaves the content goes, in milliseconds. Default `50`.
|
|
2076
2896
|
- `orientation?: Orientation`: Whether the triggers are laid out across (the default) or down: the arrows that move between them follow.
|
|
2077
2897
|
- `@value-change: (value: Value | null, details: ChangeDetails) => void`: Heard as another item's content is about to show, or none: `details.cancel()` keeps the value as it was.
|
|
2078
2898
|
|
|
@@ -2083,11 +2903,13 @@ Each part, and its own props:
|
|
|
2083
2903
|
- `<NavigationMenu.Item>` draws a `<li>`. One item of the list: a link, or a trigger with its content. Its `value` tells it from the others; an item that is given none makes its own.
|
|
2084
2904
|
- `value?: unknown`: What tells this item from the others: the menu's `value` while its content is shown. An item that is given none makes its own.
|
|
2085
2905
|
- `<NavigationMenu.Trigger>` draws a `<button>`.
|
|
2906
|
+
- `disabled?: boolean`: The trigger cannot be pressed, and the pointer resting on it shows nothing.
|
|
2086
2907
|
- `<NavigationMenu.Icon>` draws a `<span>`.
|
|
2087
2908
|
- `<NavigationMenu.Content>` draws a `<div>`.
|
|
2088
2909
|
- `<NavigationMenu.Link>` draws a `<a>`.
|
|
2089
2910
|
- `active?: boolean`: The link is the page the reader is on.
|
|
2090
|
-
- `
|
|
2911
|
+
- `closeOnSelect?: boolean`: Whether following it closes the menu. Default: it does.
|
|
2912
|
+
- `closeOnClick?: boolean`: Whether following it closes the menu.
|
|
2091
2913
|
- `<NavigationMenu.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
2092
2914
|
- `<NavigationMenu.Positioner>` draws a `<div>`. A positioner's own props: where its popup goes, and what it is placed against. Takes the positioner options ("Positioner options", above).
|
|
2093
2915
|
- `<NavigationMenu.Popup>` draws a `<div>`.
|
|
@@ -2099,10 +2921,15 @@ Attributes and CSS variables, by part:
|
|
|
2099
2921
|
|
|
2100
2922
|
- root: The navigation.
|
|
2101
2923
|
- `data-orientation="horizontal | vertical"`: Whether the list is a row or a column.
|
|
2924
|
+
- `data-open`: Present while an item's content is shown.
|
|
2925
|
+
- `data-nested`: Present on a navigation menu inside another's content: a submenu of it.
|
|
2102
2926
|
- list: The row of items.
|
|
2103
2927
|
- `data-orientation="horizontal | vertical"`: Whether the list is a row or a column.
|
|
2928
|
+
- `data-open`: Present while an item's content is shown.
|
|
2104
2929
|
- trigger: The button that shows an item's content.
|
|
2105
2930
|
- `data-popup-open`: Present while the item's content is shown.
|
|
2931
|
+
- `data-pressed`: Present while its popup is open: it stays pressed, as a button held down.
|
|
2932
|
+
- `data-disabled`: Present when it is disabled.
|
|
2106
2933
|
- icon: A mark on a trigger that shows whether its content is open.
|
|
2107
2934
|
- `data-popup-open`: Present while the item's content is shown.
|
|
2108
2935
|
- content: What an item shows. It is drawn in the viewport every item shares.
|
|
@@ -2110,7 +2937,7 @@ Attributes and CSS variables, by part:
|
|
|
2110
2937
|
- `data-closed`: Present when it is closed.
|
|
2111
2938
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
2112
2939
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2113
|
-
- `data-activation-direction="left | right"`: Which way it came from: the item before it, or after.
|
|
2940
|
+
- `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.
|
|
2114
2941
|
- link: A link, in the list or in an item's content.
|
|
2115
2942
|
- `data-active`: Present on the link of the page the reader is on.
|
|
2116
2943
|
- positioner: Places the popup against the open item's trigger. It carries the geometry.
|
|
@@ -2118,6 +2945,8 @@ Attributes and CSS variables, by part:
|
|
|
2118
2945
|
- `data-closed`: Present when it is closed.
|
|
2119
2946
|
- `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.
|
|
2120
2947
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2948
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
2949
|
+
- `data-instant`: Present while it should move at once: as it is first drawn, and while the window is resized.
|
|
2121
2950
|
- `--anchor-width`: The anchor's width.
|
|
2122
2951
|
- `--anchor-height`: The anchor's height.
|
|
2123
2952
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
@@ -2132,9 +2961,12 @@ Attributes and CSS variables, by part:
|
|
|
2132
2961
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2133
2962
|
- `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.
|
|
2134
2963
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2964
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
2135
2965
|
- `--popup-width`: The open content's width.
|
|
2136
2966
|
- `--popup-height`: The open content's height.
|
|
2137
2967
|
- arrow: An element that points at the open item's trigger.
|
|
2968
|
+
- `data-open`: Present when it is open.
|
|
2969
|
+
- `data-closed`: Present when it is closed.
|
|
2138
2970
|
- `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.
|
|
2139
2971
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2140
2972
|
- `data-uncentered`: Present when the arrow cannot sit at the trigger's centre.
|
|
@@ -2150,7 +2982,7 @@ Attributes and CSS variables, by part:
|
|
|
2150
2982
|
import { NumberField } from "@kirana-ui/vue/number-field"
|
|
2151
2983
|
```
|
|
2152
2984
|
|
|
2153
|
-
Parts: `<NumberField.Root>`, `<NumberField.Group>`, `<NumberField.Input>`, `<NumberField.Increment>`, `<NumberField.Decrement>`.
|
|
2985
|
+
Parts: `<NumberField.Root>`, `<NumberField.Group>`, `<NumberField.Input>`, `<NumberField.Increment>`, `<NumberField.Decrement>`, `<NumberField.ScrubArea>`, `<NumberField.ScrubAreaCursor>`.
|
|
2154
2986
|
|
|
2155
2987
|
Anatomy:
|
|
2156
2988
|
|
|
@@ -2160,6 +2992,8 @@ Anatomy:
|
|
|
2160
2992
|
<NumberField.Input>
|
|
2161
2993
|
<NumberField.Increment>
|
|
2162
2994
|
<NumberField.Decrement>
|
|
2995
|
+
<NumberField.ScrubArea>
|
|
2996
|
+
<NumberField.ScrubAreaCursor>
|
|
2163
2997
|
```
|
|
2164
2998
|
|
|
2165
2999
|
Props of its root:
|
|
@@ -2180,6 +3014,7 @@ Props of its root:
|
|
|
2180
3014
|
- `name?: string`: With a name, the number is submitted with the form around it.
|
|
2181
3015
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
2182
3016
|
- `modelValue?: number | null`: `v-model:modelValue`. The number, `null` for none: `v-model`.
|
|
3017
|
+
- `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.
|
|
2183
3018
|
- `@value-change: (value: number | null, details: ChangeDetails) => void`: Heard as the number is about to change, typed or stepped: `details.cancel()` keeps it as it was.
|
|
2184
3019
|
- `@value-committed: (value: number | null, details: ChangeDetails) => void`: Heard once a change is done: focus left the input, a key or a button stepped it.
|
|
2185
3020
|
|
|
@@ -2190,6 +3025,11 @@ Each part, and its own props:
|
|
|
2190
3025
|
- `<NumberField.Input>` draws a `<input>`.
|
|
2191
3026
|
- `<NumberField.Increment>` draws a `<button>`.
|
|
2192
3027
|
- `<NumberField.Decrement>` draws a `<button>`.
|
|
3028
|
+
- `<NumberField.ScrubArea>` draws a `<span>`. What a scrub area takes of its own: which way it is dragged, and how fast.
|
|
3029
|
+
- `direction?: "horizontal" | "vertical"`: The way the pointer is dragged to change the number: `"horizontal"`, where right is more, or `"vertical"`, where up is more. Default `"horizontal"`.
|
|
3030
|
+
- `pixelSensitivity?: number`: How many pixels the pointer moves before the number changes: more is slower. Default 2.
|
|
3031
|
+
- `teleportDistance?: number`: How far past the scrub area's edges the drawn cursor goes before it comes back in at the other side, in pixels, half of it at each edge. Default: the edges of the window.
|
|
3032
|
+
- `<NumberField.ScrubAreaCursor>` draws a `<span>`.
|
|
2193
3033
|
|
|
2194
3034
|
Attributes and CSS variables, by part:
|
|
2195
3035
|
|
|
@@ -2201,6 +3041,7 @@ Attributes and CSS variables, by part:
|
|
|
2201
3041
|
- `data-dirty`: Present while the number is not the one it started with.
|
|
2202
3042
|
- `data-filled`: Present while there is a number.
|
|
2203
3043
|
- `data-focused`: Present while the input has focus.
|
|
3044
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
2204
3045
|
- `data-valid`: In a field: present once the number was checked and found right.
|
|
2205
3046
|
- `data-invalid`: In a field: present while the number is wrong.
|
|
2206
3047
|
- group: What holds the input and its buttons, as one control.
|
|
@@ -2211,6 +3052,7 @@ Attributes and CSS variables, by part:
|
|
|
2211
3052
|
- `data-dirty`: Present while the number is not the one it started with.
|
|
2212
3053
|
- `data-filled`: Present while there is a number.
|
|
2213
3054
|
- `data-focused`: Present while the input has focus.
|
|
3055
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
2214
3056
|
- `data-valid`: In a field: present once the number was checked and found right.
|
|
2215
3057
|
- `data-invalid`: In a field: present while the number is wrong.
|
|
2216
3058
|
- input: The text input: it takes what its locale writes a number with.
|
|
@@ -2221,6 +3063,7 @@ Attributes and CSS variables, by part:
|
|
|
2221
3063
|
- `data-dirty`: Present while the number is not the one it started with.
|
|
2222
3064
|
- `data-filled`: Present while there is a number.
|
|
2223
3065
|
- `data-focused`: Present while the input has focus.
|
|
3066
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
2224
3067
|
- `data-valid`: In a field: present once the number was checked and found right.
|
|
2225
3068
|
- `data-invalid`: In a field: present while the number is wrong.
|
|
2226
3069
|
- increment: A button that steps the number up. Held, it goes on.
|
|
@@ -2231,6 +3074,7 @@ Attributes and CSS variables, by part:
|
|
|
2231
3074
|
- `data-dirty`: Present while the number is not the one it started with.
|
|
2232
3075
|
- `data-filled`: Present while there is a number.
|
|
2233
3076
|
- `data-focused`: Present while the input has focus.
|
|
3077
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
2234
3078
|
- `data-valid`: In a field: present once the number was checked and found right.
|
|
2235
3079
|
- `data-invalid`: In a field: present while the number is wrong.
|
|
2236
3080
|
- decrement: A button that steps the number down. Held, it goes on.
|
|
@@ -2241,6 +3085,29 @@ Attributes and CSS variables, by part:
|
|
|
2241
3085
|
- `data-dirty`: Present while the number is not the one it started with.
|
|
2242
3086
|
- `data-filled`: Present while there is a number.
|
|
2243
3087
|
- `data-focused`: Present while the input has focus.
|
|
3088
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
3089
|
+
- `data-valid`: In a field: present once the number was checked and found right.
|
|
3090
|
+
- `data-invalid`: In a field: present while the number is wrong.
|
|
3091
|
+
- 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.
|
|
3092
|
+
- `data-disabled`: Present when it is disabled.
|
|
3093
|
+
- `data-readonly`: Present when the number cannot be changed.
|
|
3094
|
+
- `data-required`: Present when a number must be given.
|
|
3095
|
+
- `data-touched`: Present once focus has left the input.
|
|
3096
|
+
- `data-dirty`: Present while the number is not the one it started with.
|
|
3097
|
+
- `data-filled`: Present while there is a number.
|
|
3098
|
+
- `data-focused`: Present while the input has focus.
|
|
3099
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
3100
|
+
- `data-valid`: In a field: present once the number was checked and found right.
|
|
3101
|
+
- `data-invalid`: In a field: present while the number is wrong.
|
|
3102
|
+
- 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.
|
|
3103
|
+
- `data-disabled`: Present when it is disabled.
|
|
3104
|
+
- `data-readonly`: Present when the number cannot be changed.
|
|
3105
|
+
- `data-required`: Present when a number must be given.
|
|
3106
|
+
- `data-touched`: Present once focus has left the input.
|
|
3107
|
+
- `data-dirty`: Present while the number is not the one it started with.
|
|
3108
|
+
- `data-filled`: Present while there is a number.
|
|
3109
|
+
- `data-focused`: Present while the input has focus.
|
|
3110
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
2244
3111
|
- `data-valid`: In a field: present once the number was checked and found right.
|
|
2245
3112
|
- `data-invalid`: In a field: present while the number is wrong.
|
|
2246
3113
|
|
|
@@ -2267,13 +3134,19 @@ Props of its root:
|
|
|
2267
3134
|
|
|
2268
3135
|
- `length?: number`: How many characters the code has. Default: 6.
|
|
2269
3136
|
- `value?: string`: `v-model:value`. The characters typed so far, when the caller holds them.
|
|
2270
|
-
- `defaultValue?: string`: The characters it starts with, when the caller does not hold `value`. Read once.
|
|
2271
|
-
- `
|
|
3137
|
+
- `defaultValue?: string`: The characters it starts with, when the caller does not hold `value`. Read once. Default `""`.
|
|
3138
|
+
- `validationType?: OtpValidation`: 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.
|
|
3139
|
+
- `mode?: OtpValidation`: What a character may be.
|
|
3140
|
+
- `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`.
|
|
2272
3141
|
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
3142
|
+
- `readOnly?: boolean`: Shown as it is, focusable, not changeable.
|
|
3143
|
+
- `required?: boolean`: Needed: in a `Field`, an empty code is then invalid.
|
|
2273
3144
|
- `name?: string`: With a name, the code is submitted with the form around it.
|
|
2274
3145
|
- `form?: string`: The id of the form the input belongs to, when it is not inside it.
|
|
3146
|
+
- `id?: string`: The id of its input, not of the root: a `<label for>` names it.
|
|
2275
3147
|
- `@value-change: (value: string, details: ChangeDetails) => void`: Heard as the characters are about to change: `details.cancel()` keeps them as they were.
|
|
2276
|
-
- `@complete: (value: string) => void`: The finished code, once every cell is filled.
|
|
3148
|
+
- `@value-complete: (value: string, details: ChangeDetails) => void`: The finished code, once every cell is filled, with the details of the change that did it.
|
|
3149
|
+
- `@complete: (value: string) => void`: The finished code.
|
|
2277
3150
|
|
|
2278
3151
|
Each part, and its own props:
|
|
2279
3152
|
|
|
@@ -2288,16 +3161,31 @@ Each part, and its own props:
|
|
|
2288
3161
|
Attributes and CSS variables, by part:
|
|
2289
3162
|
|
|
2290
3163
|
- root: The code: the input and its cells.
|
|
2291
|
-
- `data-
|
|
3164
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3165
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3166
|
+
- `data-filled`: Present when the code has a character in it.
|
|
2292
3167
|
- `data-focused`: Present while the input has focus.
|
|
3168
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3169
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
3170
|
+
- `data-disabled`: Present when it is disabled.
|
|
3171
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
3172
|
+
- `data-required`: Present when the form needs it.
|
|
2293
3173
|
- `data-complete`: Present when every character is in.
|
|
2294
3174
|
- input: The one input the code is typed in. A design lays it over the cells, unseen.
|
|
2295
3175
|
- `data-disabled`: Present when it is disabled.
|
|
2296
3176
|
- slot: One cell of the code.
|
|
2297
3177
|
- `data-index`: The cell's place, from 0.
|
|
2298
3178
|
- `data-active`: Present on the cell the next character goes in, or that is selected.
|
|
3179
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3180
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
2299
3181
|
- `data-filled`: Present when the cell has its character.
|
|
3182
|
+
- `data-focused`: Present while the input has focus.
|
|
3183
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3184
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2300
3185
|
- `data-disabled`: Present when it is disabled.
|
|
3186
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
3187
|
+
- `data-required`: Present when the form needs it.
|
|
3188
|
+
- `data-complete`: Present when every character is in.
|
|
2301
3189
|
|
|
2302
3190
|
### Pagination
|
|
2303
3191
|
|
|
@@ -2321,7 +3209,7 @@ Anatomy:
|
|
|
2321
3209
|
Props of its root:
|
|
2322
3210
|
|
|
2323
3211
|
- `page?: number`: `v-model:page`. The page shown, from 1.
|
|
2324
|
-
- `defaultPage?: number`: The page it starts at, when the caller does not hold `page`. Read once.
|
|
3212
|
+
- `defaultPage?: number`: The page it starts at, when the caller does not hold `page`. Read once. Default `1`.
|
|
2325
3213
|
- `count: number`: Required. How many items there are in all.
|
|
2326
3214
|
- `pageSize?: number`: How many items a page holds. Default 10.
|
|
2327
3215
|
- `siblingCount?: number`: How many pages are listed each side of the one shown. Default 1.
|
|
@@ -2351,13 +3239,66 @@ Attributes and CSS variables, by part:
|
|
|
2351
3239
|
- next: Goes to the page after.
|
|
2352
3240
|
- `data-disabled`: Present when it is disabled.
|
|
2353
3241
|
|
|
3242
|
+
### PasswordInput
|
|
3243
|
+
|
|
3244
|
+
```
|
|
3245
|
+
import { PasswordInput } from "@kirana-ui/vue/password-input"
|
|
3246
|
+
```
|
|
3247
|
+
|
|
3248
|
+
Parts: `<PasswordInput.Root>`, `<PasswordInput.Input>`, `<PasswordInput.Toggle>`, `<PasswordInput.Indicator>`.
|
|
3249
|
+
|
|
3250
|
+
Anatomy:
|
|
3251
|
+
|
|
3252
|
+
```
|
|
3253
|
+
<PasswordInput.Root>
|
|
3254
|
+
<PasswordInput.Input>
|
|
3255
|
+
<PasswordInput.Toggle>
|
|
3256
|
+
<PasswordInput.Indicator> (optional)
|
|
3257
|
+
```
|
|
3258
|
+
|
|
3259
|
+
Props of its root:
|
|
3260
|
+
|
|
3261
|
+
- `disabled?: boolean`: Disabled: nothing can be typed in it.
|
|
3262
|
+
- `visible?: boolean`: `v-model:visible`. Whether the password can be read, when the caller holds it.
|
|
3263
|
+
- `defaultVisible?: boolean`: Read once. Default `false`.
|
|
3264
|
+
- `@visible-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to be shown or hidden: `details.cancel()` keeps it as it was.
|
|
3265
|
+
- `@value-change: (value: string, details: ChangeDetails) => void`: What was typed, as text, each time it changes.
|
|
3266
|
+
|
|
3267
|
+
Each part, and its own props:
|
|
3268
|
+
|
|
3269
|
+
- `<PasswordInput.Root>` draws a `<div>`. Its props are above.
|
|
3270
|
+
- `<PasswordInput.Input>` draws a `<input>`.
|
|
3271
|
+
- `<PasswordInput.Toggle>` draws a `<button>`.
|
|
3272
|
+
- `<PasswordInput.Indicator>` draws a `<span>`.
|
|
3273
|
+
|
|
3274
|
+
Attributes and CSS variables, by part:
|
|
3275
|
+
|
|
3276
|
+
- root: A password that can be shown while it is typed.
|
|
3277
|
+
- `data-visible`: Present while the password can be read.
|
|
3278
|
+
- `data-disabled`: Present when it is disabled.
|
|
3279
|
+
- input: The `<input>`: a password, or text while it is shown. In a `Field` it is the field's control.
|
|
3280
|
+
- `data-visible`: Present while the password can be read.
|
|
3281
|
+
- `data-disabled`: Present when it is disabled.
|
|
3282
|
+
- `data-touched`: Present once focus has left it.
|
|
3283
|
+
- `data-dirty`: Present once its text differs from what it began with.
|
|
3284
|
+
- `data-filled`: Present while it holds text.
|
|
3285
|
+
- `data-focused`: Present while it has focus.
|
|
3286
|
+
- `data-valid`: In a field: present once the value was checked and found right.
|
|
3287
|
+
- `data-invalid`: In a field: present while the value is wrong.
|
|
3288
|
+
- toggle: Shows the password, and hides it again. Focus and the caret stay in the input.
|
|
3289
|
+
- `data-visible`: Present while the password can be read.
|
|
3290
|
+
- `data-disabled`: Present when it is disabled.
|
|
3291
|
+
- indicator: What draws which of the two it is: an eye, open or struck.
|
|
3292
|
+
- `data-visible`: Present while the password can be read.
|
|
3293
|
+
- `data-disabled`: Present when it is disabled.
|
|
3294
|
+
|
|
2354
3295
|
### Popover
|
|
2355
3296
|
|
|
2356
3297
|
```
|
|
2357
3298
|
import { Popover } from "@kirana-ui/vue/popover"
|
|
2358
3299
|
```
|
|
2359
3300
|
|
|
2360
|
-
Parts: `<Popover.Root>`, `<Popover.Trigger>`, `<Popover.Portal>`, `<Popover.Positioner>`, `<Popover.Popup>`, `<Popover.Title>`, `<Popover.Description>`, `<Popover.Close>`.
|
|
3301
|
+
Parts: `<Popover.Root>`, `<Popover.Trigger>`, `<Popover.Portal>`, `<Popover.Backdrop>`, `<Popover.Positioner>`, `<Popover.Popup>`, `<Popover.Arrow>`, `<Popover.Title>`, `<Popover.Description>`, `<Popover.Close>`.
|
|
2361
3302
|
|
|
2362
3303
|
Anatomy:
|
|
2363
3304
|
|
|
@@ -2365,26 +3306,34 @@ Anatomy:
|
|
|
2365
3306
|
<Popover.Root>
|
|
2366
3307
|
<Popover.Trigger>
|
|
2367
3308
|
<Popover.Portal>
|
|
3309
|
+
<Popover.Backdrop>
|
|
2368
3310
|
<Popover.Positioner>
|
|
2369
3311
|
<Popover.Popup>
|
|
2370
3312
|
<Popover.Title>
|
|
2371
3313
|
<Popover.Description>
|
|
2372
3314
|
<Popover.Close>
|
|
3315
|
+
<Popover.Arrow>
|
|
2373
3316
|
```
|
|
2374
3317
|
|
|
2375
3318
|
Props of its root:
|
|
2376
3319
|
|
|
2377
3320
|
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
2378
3321
|
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
3322
|
+
- `modal?: boolean | "trap-focus"`: 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.
|
|
2379
3323
|
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
2380
3324
|
|
|
2381
3325
|
Each part, and its own props:
|
|
2382
3326
|
|
|
2383
3327
|
- `<Popover.Root>` draws no element. Holds the popover: whether it is open. Its props are above.
|
|
2384
3328
|
- `<Popover.Trigger>` draws a `<button>`.
|
|
3329
|
+
- `openOnHover?: boolean`: Whether the pointer resting on the trigger opens the popover too. A press and the keyboard still open it, and a press on one the pointer opened keeps it open. Default `false`.
|
|
3330
|
+
- `delay?: number`: How long the pointer rests on the trigger before the popover opens, in milliseconds. Default 300.
|
|
3331
|
+
- `closeDelay?: number`: How long after the pointer leaves a popover it opened closes, in milliseconds. Default 0.
|
|
2385
3332
|
- `<Popover.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
3333
|
+
- `<Popover.Backdrop>` draws a `<div>`.
|
|
2386
3334
|
- `<Popover.Positioner>` draws a `<div>`. A positioner's own props: where its popup goes, and what it is placed against. Takes the positioner options ("Positioner options", above).
|
|
2387
3335
|
- `<Popover.Popup>` draws a `<div>`.
|
|
3336
|
+
- `<Popover.Arrow>` draws a `<div>`.
|
|
2388
3337
|
- `<Popover.Title>` draws a `<h2>`. The heading that names the popover.
|
|
2389
3338
|
- `<Popover.Description>` draws a `<p>`. The text that describes the popover.
|
|
2390
3339
|
- `<Popover.Close>` draws a `<button>`. A button that closes the popover.
|
|
@@ -2393,16 +3342,25 @@ Attributes and CSS variables, by part:
|
|
|
2393
3342
|
|
|
2394
3343
|
- trigger: The button that opens the popover, and what it is placed against.
|
|
2395
3344
|
- `data-popup-open`: Present when the popover is open.
|
|
3345
|
+
- `data-pressed`: Present while the popover a press on this trigger opened is open: it stays pressed, as a button held down.
|
|
3346
|
+
- backdrop: A layer over the page behind the popover.
|
|
3347
|
+
- `data-open`: Present when it is open.
|
|
3348
|
+
- `data-closed`: Present when it is closed.
|
|
3349
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
3350
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2396
3351
|
- positioner: Places the popup against the trigger. It carries the geometry.
|
|
2397
3352
|
- `data-open`: Present when it is open.
|
|
2398
3353
|
- `data-closed`: Present when it is closed.
|
|
2399
3354
|
- `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.
|
|
2400
3355
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
3356
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
2401
3357
|
- `--anchor-width`: The anchor's width.
|
|
2402
3358
|
- `--anchor-height`: The anchor's height.
|
|
2403
3359
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
2404
3360
|
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
2405
3361
|
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
3362
|
+
- `--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.
|
|
3363
|
+
- `--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.
|
|
2406
3364
|
- popup: The popover itself.
|
|
2407
3365
|
- `data-open`: Present when it is open.
|
|
2408
3366
|
- `data-closed`: Present when it is closed.
|
|
@@ -2410,6 +3368,15 @@ Attributes and CSS variables, by part:
|
|
|
2410
3368
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2411
3369
|
- `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.
|
|
2412
3370
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
3371
|
+
- `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.
|
|
3372
|
+
- `--popup-width`: Its width: `auto`, and while its content changes size, the old width and then the new one, for a transition between them.
|
|
3373
|
+
- `--popup-height`: Its height: `auto`, and while its content changes size, the old height and then the new one, for a transition between them.
|
|
3374
|
+
- arrow: An element that points at the trigger, placed along the popup's edge.
|
|
3375
|
+
- `data-open`: Present when it is open.
|
|
3376
|
+
- `data-closed`: Present when it is closed.
|
|
3377
|
+
- `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.
|
|
3378
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
3379
|
+
- `data-uncentered`: Present when the popup was pushed along its edge, so the arrow is not at the trigger's centre.
|
|
2413
3380
|
|
|
2414
3381
|
### Progress
|
|
2415
3382
|
|
|
@@ -2533,6 +3500,7 @@ Each part, and its own props:
|
|
|
2533
3500
|
- `<RadioGroup.Root>` draws a `<div>`. Generic: `<Value = unknown>`. Its props are above.
|
|
2534
3501
|
- `<RadioGroup.Item>` draws a `<span>`.
|
|
2535
3502
|
- `disabled?: boolean`: Disables this item: it cannot be chosen.
|
|
3503
|
+
- `id?: string`: The id of the item's native radio, unique in the page: a `<label for>` names it.
|
|
2536
3504
|
- `value: unknown`: Required. What the group's value is while this item is the chosen one.
|
|
2537
3505
|
- `<RadioGroup.Indicator>` draws a `<span>`.
|
|
2538
3506
|
- `keepMounted?: boolean`: Keeps the mark in the page while its item is not the chosen one.
|
|
@@ -2543,21 +3511,91 @@ Attributes and CSS variables, by part:
|
|
|
2543
3511
|
- `data-disabled`: Present when it is disabled.
|
|
2544
3512
|
- `data-readonly`: Present when it can be read but not changed.
|
|
2545
3513
|
- `data-required`: Present when the form needs it.
|
|
2546
|
-
-
|
|
3514
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3515
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3516
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3517
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3518
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3519
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
3520
|
+
- 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.
|
|
2547
3521
|
- `data-checked`: Present when it is checked.
|
|
2548
3522
|
- `data-unchecked`: Present when it is not checked.
|
|
2549
3523
|
- `data-disabled`: Present when it is disabled.
|
|
2550
3524
|
- `data-readonly`: Present when it can be read but not changed.
|
|
2551
3525
|
- `data-required`: Present when the form needs it.
|
|
3526
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3527
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3528
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3529
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3530
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3531
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2552
3532
|
- indicator: The mark. In the page while its item is the chosen one.
|
|
2553
3533
|
- `data-checked`: Present when it is checked.
|
|
2554
3534
|
- `data-unchecked`: Present when it is not checked.
|
|
2555
3535
|
- `data-disabled`: Present when it is disabled.
|
|
2556
3536
|
- `data-readonly`: Present when it can be read but not changed.
|
|
2557
3537
|
- `data-required`: Present when the form needs it.
|
|
3538
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3539
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3540
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3541
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3542
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3543
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2558
3544
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
2559
3545
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2560
3546
|
|
|
3547
|
+
### Rating
|
|
3548
|
+
|
|
3549
|
+
```
|
|
3550
|
+
import { Rating } from "@kirana-ui/vue/rating"
|
|
3551
|
+
```
|
|
3552
|
+
|
|
3553
|
+
Parts: `<Rating.Root>`, `<Rating.Items>`, `<Rating.Item>`.
|
|
3554
|
+
|
|
3555
|
+
Anatomy:
|
|
3556
|
+
|
|
3557
|
+
```
|
|
3558
|
+
<Rating.Root>
|
|
3559
|
+
<Rating.Items>
|
|
3560
|
+
<Rating.Item> (repeated)
|
|
3561
|
+
```
|
|
3562
|
+
|
|
3563
|
+
Props of its root:
|
|
3564
|
+
|
|
3565
|
+
- `value?: number`: `v-model:value`. How much is given, from 0 (none) to `count`; a half where `allowHalf` is set.
|
|
3566
|
+
- `defaultValue?: number`: The value it starts with, when the caller does not hold `value`. Read once. Default `0`.
|
|
3567
|
+
- `count?: number`: How many items there are. Default 5.
|
|
3568
|
+
- `allowHalf?: boolean`: Whether half an item can be given: by the half of it a pointer is over, and by the arrows.
|
|
3569
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
3570
|
+
- `readOnly?: boolean`: Shown as it is, focusable, not changeable.
|
|
3571
|
+
- `required?: boolean`: Needed: in a `Field`, giving none is then invalid.
|
|
3572
|
+
- `name?: string`: With a name, the value is submitted with the form around it; none is submitted as empty.
|
|
3573
|
+
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
3574
|
+
- `@value-change: (value: number, details: ChangeDetails) => void`: Heard as another value is about to be given: `details.cancel()` keeps it as it was.
|
|
3575
|
+
- `@hover-change: (value: number | null) => void`: The value the pointer is over, `null` once it leaves.
|
|
3576
|
+
|
|
3577
|
+
Each part, and its own props:
|
|
3578
|
+
|
|
3579
|
+
- `<Rating.Root>` draws a `<div>`. Its props are above.
|
|
3580
|
+
- `<Rating.Items>` draws no element. The items, from 1 to `count`: each place is given to draw. Its default slot is also given `place: number`.
|
|
3581
|
+
- `<Rating.Item>` draws a `<span>`.
|
|
3582
|
+
- `place: number`: Required. Its place among the items, from 1.
|
|
3583
|
+
|
|
3584
|
+
Attributes and CSS variables, by part:
|
|
3585
|
+
|
|
3586
|
+
- root: The items, as one choice: a radio group. It holds the hidden input a form reads.
|
|
3587
|
+
- `data-disabled`: Present when it is disabled.
|
|
3588
|
+
- `data-readonly`: Present when it is shown and cannot be changed.
|
|
3589
|
+
- `data-required`: Present when a value is needed.
|
|
3590
|
+
- `data-hovering`: Present while a pointer is over an item.
|
|
3591
|
+
- item: One item (a star): pressed, the value is its place, or half of it.
|
|
3592
|
+
- `data-checked`: Present on the item that holds the value.
|
|
3593
|
+
- `data-filled`: Present on every item up to the value drawn: the one a pointer is over, or the one held.
|
|
3594
|
+
- `data-half`: Present on the item the value drawn fills by half.
|
|
3595
|
+
- `data-disabled`: Present when it is disabled.
|
|
3596
|
+
- `data-readonly`: Present when it is shown and cannot be changed.
|
|
3597
|
+
- `data-required`: Present when a value is needed.
|
|
3598
|
+
|
|
2561
3599
|
### Resizable
|
|
2562
3600
|
|
|
2563
3601
|
```
|
|
@@ -2593,13 +3631,13 @@ Each part, and its own props:
|
|
|
2593
3631
|
|
|
2594
3632
|
Attributes and CSS variables, by part:
|
|
2595
3633
|
|
|
2596
|
-
- group: The panels and the bars between them. A design lays it out as a flex box.
|
|
3634
|
+
- 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.
|
|
2597
3635
|
- `data-orientation="horizontal | vertical"`: Whether the panels are side by side or one over the other.
|
|
2598
3636
|
- `data-disabled`: Present when it is disabled.
|
|
2599
|
-
- panel: One panel. It carries its share of the group.
|
|
3637
|
+
- 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.
|
|
2600
3638
|
- `data-orientation="horizontal | vertical"`: Whether the panels are side by side or one over the other.
|
|
2601
3639
|
- `--panel-size`: The panel's share, in hundredths of the group.
|
|
2602
|
-
- handle: The bar between two panels: dragged, or moved with the arrows.
|
|
3640
|
+
- 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.
|
|
2603
3641
|
- `data-orientation="horizontal | vertical"`: Whether the panels are side by side or one over the other.
|
|
2604
3642
|
- `data-dragging`: Present while the bar is dragged.
|
|
2605
3643
|
- `data-disabled`: Present when it is disabled.
|
|
@@ -2617,7 +3655,8 @@ Anatomy:
|
|
|
2617
3655
|
```
|
|
2618
3656
|
<ScrollArea.Root>
|
|
2619
3657
|
<ScrollArea.Viewport>
|
|
2620
|
-
<ScrollArea.Content>
|
|
3658
|
+
<ScrollArea.Content> (optional)
|
|
3659
|
+
<ScrollArea.Scrollbar> (repeated, as above)
|
|
2621
3660
|
<ScrollArea.Scrollbar> (repeated)
|
|
2622
3661
|
<ScrollArea.Thumb>
|
|
2623
3662
|
<ScrollArea.Corner>
|
|
@@ -2627,7 +3666,7 @@ Each part, and its own props:
|
|
|
2627
3666
|
|
|
2628
3667
|
- `<ScrollArea.Root>` draws a `<div>`.
|
|
2629
3668
|
- `<ScrollArea.Viewport>` draws a `<div>`.
|
|
2630
|
-
- `<ScrollArea.Content>` draws a `<div>`.
|
|
3669
|
+
- `<ScrollArea.Content>` draws a `<div>`.
|
|
2631
3670
|
- `<ScrollArea.Scrollbar>` draws a `<div>`.
|
|
2632
3671
|
- `orientation?: Orientation`: Which way it scrolls; `vertical` when left out.
|
|
2633
3672
|
- `keepMounted?: boolean`: Keeps the bar in the page while there is nothing to scroll that way.
|
|
@@ -2639,6 +3678,10 @@ Attributes and CSS variables, by part:
|
|
|
2639
3678
|
- 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.
|
|
2640
3679
|
- `data-has-overflow-x`: Present when there is more to see sideways.
|
|
2641
3680
|
- `data-has-overflow-y`: Present when there is more to see up or down.
|
|
3681
|
+
- `data-overflow-x-start`: Present when there is more to scroll to towards the start of a line.
|
|
3682
|
+
- `data-overflow-x-end`: Present when there is more to scroll to towards the end of a line.
|
|
3683
|
+
- `data-overflow-y-start`: Present when there is more to scroll to above.
|
|
3684
|
+
- `data-overflow-y-end`: Present when there is more to scroll to below.
|
|
2642
3685
|
- `data-scrolling`: Present while it is being scrolled, and a moment after.
|
|
2643
3686
|
- `data-hovering`: Present while the pointer is over the area.
|
|
2644
3687
|
- `--scroll-area-corner-width`: The width of the corner: the vertical scrollbar's, while both scrollbars and the corner are in the page.
|
|
@@ -2646,15 +3689,38 @@ Attributes and CSS variables, by part:
|
|
|
2646
3689
|
- viewport: The element that scrolls.
|
|
2647
3690
|
- `data-has-overflow-x`: Present when there is more to see sideways.
|
|
2648
3691
|
- `data-has-overflow-y`: Present when there is more to see up or down.
|
|
3692
|
+
- `data-overflow-x-start`: Present when there is more to scroll to towards the start of a line.
|
|
3693
|
+
- `data-overflow-x-end`: Present when there is more to scroll to towards the end of a line.
|
|
3694
|
+
- `data-overflow-y-start`: Present when there is more to scroll to above.
|
|
3695
|
+
- `data-overflow-y-end`: Present when there is more to scroll to below.
|
|
3696
|
+
- `data-scrolling`: Present while it is being scrolled, and a moment after.
|
|
3697
|
+
- `--scroll-area-overflow-x-start`: How far the view is from the start of a line, to fade that edge by: `0px` at it.
|
|
3698
|
+
- `--scroll-area-overflow-x-end`: How far the view is from the end of a line: `0px` at it.
|
|
3699
|
+
- `--scroll-area-overflow-y-start`: How far the view is from the top: `0px` at it.
|
|
3700
|
+
- `--scroll-area-overflow-y-end`: How far the view is from the bottom: `0px` at it.
|
|
3701
|
+
- 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).
|
|
3702
|
+
- `data-has-overflow-x`: Present when there is more to see sideways.
|
|
3703
|
+
- `data-has-overflow-y`: Present when there is more to see up or down.
|
|
3704
|
+
- `data-overflow-x-start`: Present when there is more to scroll to towards the start of a line.
|
|
3705
|
+
- `data-overflow-x-end`: Present when there is more to scroll to towards the end of a line.
|
|
3706
|
+
- `data-overflow-y-start`: Present when there is more to scroll to above.
|
|
3707
|
+
- `data-overflow-y-end`: Present when there is more to scroll to below.
|
|
2649
3708
|
- `data-scrolling`: Present while it is being scrolled, and a moment after.
|
|
2650
3709
|
- scrollbar: A scrollbar's track, placed along its edge of the area. In the page while there is something to scroll its way.
|
|
2651
3710
|
- `data-orientation="horizontal | vertical"`: Which way the scrollbar scrolls.
|
|
2652
3711
|
- `data-hovering`: Present while the pointer is over the area.
|
|
2653
3712
|
- `data-scrolling`: Present while the area is scrolled its way.
|
|
3713
|
+
- `data-has-overflow-x`: Present when there is more to see sideways.
|
|
3714
|
+
- `data-has-overflow-y`: Present when there is more to see up or down.
|
|
3715
|
+
- `data-overflow-x-start`: Present when there is more to scroll to towards the start of a line.
|
|
3716
|
+
- `data-overflow-x-end`: Present when there is more to scroll to towards the end of a line.
|
|
3717
|
+
- `data-overflow-y-start`: Present when there is more to scroll to above.
|
|
3718
|
+
- `data-overflow-y-end`: Present when there is more to scroll to below.
|
|
2654
3719
|
- `--scroll-area-thumb-height`: A vertical thumb's height.
|
|
2655
3720
|
- `--scroll-area-thumb-width`: A horizontal thumb's width.
|
|
2656
3721
|
- thumb: The part of a scrollbar that shows where the view is, and can be dragged. As long as its scrollbar's variable says.
|
|
2657
3722
|
- `data-orientation="horizontal | vertical"`: Which way the scrollbar scrolls.
|
|
3723
|
+
- `data-scrolling`: Present while the area is scrolled its way.
|
|
2658
3724
|
|
|
2659
3725
|
### Select
|
|
2660
3726
|
|
|
@@ -2662,7 +3728,7 @@ Attributes and CSS variables, by part:
|
|
|
2662
3728
|
import { Select } from "@kirana-ui/vue/select"
|
|
2663
3729
|
```
|
|
2664
3730
|
|
|
2665
|
-
Parts: `<Select.Root>`, `<Select.Trigger>`, `<Select.Value>`, `<Select.Portal>`, `<Select.Positioner>`, `<Select.Popup>`, `<Select.List>`, `<Select.ScrollUpArrow>`, `<Select.ScrollDownArrow>`, `<Select.Group>`, `<Select.GroupLabel>`, `<Select.Separator>`, `<Select.Item>`, `<Select.ItemText>`, `<Select.ItemIndicator>`.
|
|
3731
|
+
Parts: `<Select.Root>`, `<Select.Trigger>`, `<Select.Value>`, `<Select.Portal>`, `<Select.Backdrop>`, `<Select.Positioner>`, `<Select.Popup>`, `<Select.List>`, `<Select.ScrollUpArrow>`, `<Select.ScrollDownArrow>`, `<Select.Group>`, `<Select.GroupLabel>`, `<Select.Separator>`, `<Select.Item>`, `<Select.ItemText>`, `<Select.ItemIndicator>`.
|
|
2666
3732
|
|
|
2667
3733
|
Anatomy:
|
|
2668
3734
|
|
|
@@ -2671,6 +3737,7 @@ Anatomy:
|
|
|
2671
3737
|
<Select.Trigger>
|
|
2672
3738
|
<Select.Value>
|
|
2673
3739
|
<Select.Portal>
|
|
3740
|
+
<Select.Backdrop> (optional)
|
|
2674
3741
|
<Select.Positioner>
|
|
2675
3742
|
<Select.Popup>
|
|
2676
3743
|
<Select.ScrollUpArrow>
|
|
@@ -2686,32 +3753,38 @@ Anatomy:
|
|
|
2686
3753
|
|
|
2687
3754
|
Props of its root:
|
|
2688
3755
|
|
|
2689
|
-
- `
|
|
2690
|
-
- `
|
|
3756
|
+
- `presentation?: Presentation`: 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"`.
|
|
3757
|
+
- `sheetBelow?: number`: With `presentation: "auto"`: the viewport's width, in CSS pixels, under which a coarse pointer opens a sheet. Default 640.
|
|
3758
|
+
- `value?: (Multiple extends true ? readonly Value[] : Value | null)`: `v-model:value`. The chosen value; `null` is "none". With `multiple`, the chosen values, in the order they were chosen.
|
|
3759
|
+
- `defaultValue?: (Multiple extends true ? readonly Value[] : Value | null)`: The value it starts with (with `multiple`, the values), when the caller does not hold `value`. Read once.
|
|
2691
3760
|
- `open?: boolean`: `v-model:open`. Whether the list is open, when the caller holds it.
|
|
2692
3761
|
- `defaultOpen?: boolean`: Whether the list starts open, when the caller does not hold `open`. Read once.
|
|
2693
3762
|
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
3763
|
+
- `readOnly?: 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.
|
|
2694
3764
|
- `required?: boolean`: In a field, "none" is then wrong.
|
|
2695
3765
|
- `name?: string`: With a name, the value is submitted with the form around it.
|
|
2696
3766
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
2697
3767
|
- `items?: readonly { value: Value; label: string }[] | Readonly<Record<string, string>>`: 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.
|
|
2698
|
-
- `
|
|
2699
|
-
- `
|
|
2700
|
-
- `
|
|
3768
|
+
- `itemToStringLabel?: (value: Value) => string`: 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.
|
|
3769
|
+
- `itemToStringValue?: (value: Value) => string`: 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.
|
|
3770
|
+
- `values?: readonly Value[]`: `v-model:values`. With `multiple`: the chosen values.
|
|
3771
|
+
- `defaultValues?: readonly Value[]`: With `multiple`: the values it starts with.
|
|
2701
3772
|
- `virtualized?: ListCollection`: Every row, when only some are in the page (a virtualizer draws the ones in view). Each item is then given its `index`.
|
|
2702
|
-
-
|
|
2703
|
-
- `@
|
|
3773
|
+
- `multiple?: Multiple`: Several values: `value` and `@value-change` then hold a list. Read once.
|
|
3774
|
+
- `@value-change: (value: Multiple extends true ? Value[] : Value | null, details: ChangeDetails) => void`: Heard as a value is about to be chosen (with `multiple`, added or taken away, with the values there would then be): `details.cancel()` keeps it as it was.
|
|
3775
|
+
- `@values-change: (value: Value[], details: ChangeDetails) => void`: With `multiple`: heard as a value is about to be added or taken away.
|
|
2704
3776
|
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as the list is about to open or close: `details.cancel()` keeps it as it was.
|
|
2705
3777
|
|
|
2706
3778
|
Each part, and its own props:
|
|
2707
3779
|
|
|
2708
|
-
- `<Select.Root>` draws no element. Generic: `<Value = unknown>`.
|
|
3780
|
+
- `<Select.Root>` draws no element. Generic: `<Value = unknown, Multiple extends boolean | undefined = false>`. `Multiple` is read from `multiple`: with it, `value` and `@value-change` hold a list. Its props are above.
|
|
2709
3781
|
- `<Select.Trigger>` draws a `<button>`.
|
|
2710
3782
|
- `<Select.Value>` draws a `<span>`. Its default slot is also given `value: Value | null`, `label: string`, `values: readonly Value[]`, `labels: readonly string[]`.
|
|
2711
3783
|
- `placeholder?: string`: What it shows while nothing is chosen.
|
|
2712
3784
|
- `<Select.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
3785
|
+
- `<Select.Backdrop>` draws a `<div>`.
|
|
2713
3786
|
- `<Select.Positioner>` draws a `<div>`. Takes the positioner options ("Positioner options", above).
|
|
2714
|
-
- `alignItemWithTrigger?: boolean`: Opens the list over its trigger, the chosen item's text on the trigger's own.
|
|
3787
|
+
- `alignItemWithTrigger?: boolean`: Opens the list over its trigger, the chosen item's text on the trigger's own, where there is room and unless a finger opened it. While it lies there the page's scroll is held (its scrollbar's room kept), and a scroll of a box around the trigger closes the list (`"ancestor-scroll"`), as a change of the window's size does (`"window-resize"`).
|
|
2715
3788
|
- `<Select.Popup>` draws a `<div>`.
|
|
2716
3789
|
- `<Select.List>` draws a `<div>`. The items' own box inside the popup, when the popup holds more than its items: the listbox, and what scrolls.
|
|
2717
3790
|
- `<Select.ScrollUpArrow>` draws a `<div>`.
|
|
@@ -2732,15 +3805,38 @@ Attributes and CSS variables, by part:
|
|
|
2732
3805
|
|
|
2733
3806
|
- trigger: The button that shows the value and opens the list.
|
|
2734
3807
|
- `data-popup-open`: Present when the list is open.
|
|
3808
|
+
- `data-pressed`: Present while its popup is open: it stays pressed, as a button held down.
|
|
3809
|
+
- `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.
|
|
2735
3810
|
- `data-placeholder`: Present while nothing is chosen.
|
|
2736
3811
|
- `data-disabled`: Present when it is disabled.
|
|
3812
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
3813
|
+
- `data-required`: Present when the form needs it.
|
|
3814
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3815
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3816
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3817
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3818
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3819
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2737
3820
|
- value: The chosen value's label, or the placeholder. With several values, their labels with commas between.
|
|
2738
3821
|
- `data-placeholder`: Present while nothing is chosen.
|
|
2739
|
-
-
|
|
3822
|
+
- backdrop: The layer over the page behind the list: a press on it closes the list.
|
|
3823
|
+
- `data-open`: Present when it is open.
|
|
3824
|
+
- `data-closed`: Present when it is closed.
|
|
3825
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
3826
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
3827
|
+
- `data-presentation="popup | sheet"`: How the list opened: placed against its trigger, or as a sheet from the bottom edge.
|
|
3828
|
+
- `data-swiping`: Present while the sheet is dragged.
|
|
3829
|
+
- `data-swipe-dismiss`: Present once a drag has closed it.
|
|
3830
|
+
- `--drawer-swipe-movement-x`: As a sheet: how far it has been dragged across, always 0px.
|
|
3831
|
+
- `--drawer-swipe-movement-y`: As a sheet: how far it has been dragged down.
|
|
3832
|
+
- `--drawer-swipe-progress`: As a sheet: how far it has been dragged, of its own height: 0 to 1.
|
|
3833
|
+
- positioner: Places the list against the trigger. It carries the geometry. As a sheet it is not placed, and carries none.
|
|
2740
3834
|
- `data-open`: Present when it is open.
|
|
2741
3835
|
- `data-closed`: Present when it is closed.
|
|
2742
3836
|
- `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.
|
|
2743
3837
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
3838
|
+
- `data-presentation="popup | sheet"`: How the list opened: placed against its trigger, or as a sheet from the bottom edge.
|
|
3839
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
2744
3840
|
- `--anchor-width`: The anchor's width.
|
|
2745
3841
|
- `--anchor-height`: The anchor's height.
|
|
2746
3842
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
@@ -2758,13 +3854,20 @@ Attributes and CSS variables, by part:
|
|
|
2758
3854
|
- `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.
|
|
2759
3855
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
2760
3856
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2761
|
-
- popup: The list of items.
|
|
3857
|
+
- 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.
|
|
2762
3858
|
- `data-open`: Present when it is open.
|
|
2763
3859
|
- `data-closed`: Present when it is closed.
|
|
2764
3860
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
2765
3861
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2766
|
-
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the
|
|
3862
|
+
- `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.
|
|
2767
3863
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
3864
|
+
- `data-presentation="popup | sheet"`: How the list opened: placed against its trigger, or as a sheet from the bottom edge.
|
|
3865
|
+
- `data-swiping`: Present while the sheet is dragged.
|
|
3866
|
+
- `data-swipe-dismiss`: Present once a drag has closed it.
|
|
3867
|
+
- `--drawer-swipe-movement-x`: As a sheet: how far it has been dragged across, always 0px.
|
|
3868
|
+
- `--drawer-swipe-movement-y`: As a sheet: how far it has been dragged down.
|
|
3869
|
+
- `--drawer-swipe-progress`: As a sheet: how far it has been dragged, of its own height: 0 to 1.
|
|
3870
|
+
- `--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.
|
|
2768
3871
|
- item: One choice in the list.
|
|
2769
3872
|
- `data-selected`: Present on the chosen item, or on each of several.
|
|
2770
3873
|
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
@@ -2816,6 +3919,7 @@ Props of its root:
|
|
|
2816
3919
|
- `orientation?: Orientation`: Whether the track lies across (the default) or stands upright: the arrows that move a thumb follow.
|
|
2817
3920
|
- `thumbAlignment?: "center" | "edge" | "edge-client-only"`: 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.
|
|
2818
3921
|
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
3922
|
+
- `readOnly?: 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.
|
|
2819
3923
|
- `name?: string`: With a name, each thumb's value is submitted with the form around the slider.
|
|
2820
3924
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
2821
3925
|
- `format?: Intl.NumberFormatOptions`: How a value is written.
|
|
@@ -2841,32 +3945,161 @@ Attributes and CSS variables, by part:
|
|
|
2841
3945
|
- root: Groups the slider's parts.
|
|
2842
3946
|
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
2843
3947
|
- `data-disabled`: Present when it is disabled.
|
|
3948
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
2844
3949
|
- `data-dragging`: Present while a pointer holds a thumb.
|
|
3950
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3951
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3952
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3953
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3954
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3955
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2845
3956
|
- value: The value, written.
|
|
2846
3957
|
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
2847
3958
|
- `data-disabled`: Present when it is disabled.
|
|
3959
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
2848
3960
|
- `data-dragging`: Present while a pointer holds a thumb.
|
|
3961
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3962
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3963
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3964
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3965
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3966
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2849
3967
|
- control: What a pointer presses and drags on. It holds the track and the thumbs.
|
|
2850
3968
|
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
2851
3969
|
- `data-disabled`: Present when it is disabled.
|
|
3970
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
2852
3971
|
- `data-dragging`: Present while a pointer holds a thumb.
|
|
3972
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3973
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3974
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3975
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3976
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3977
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2853
3978
|
- track: The whole range.
|
|
2854
3979
|
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
2855
3980
|
- `data-disabled`: Present when it is disabled.
|
|
3981
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
2856
3982
|
- `data-dragging`: Present while a pointer holds a thumb.
|
|
3983
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3984
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3985
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3986
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3987
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3988
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2857
3989
|
- indicator: The filled part: up to the thumb, or from the first thumb to the last. Its place and length are written on it.
|
|
2858
3990
|
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
2859
3991
|
- `data-disabled`: Present when it is disabled.
|
|
3992
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
2860
3993
|
- `data-dragging`: Present while a pointer holds a thumb.
|
|
3994
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
3995
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
3996
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
3997
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
3998
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
3999
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2861
4000
|
- `--start-position`: With thumbs that stay inside the control: where the filled part starts, or with one thumb where it ends.
|
|
2862
4001
|
- `--relative-size`: With thumbs that stay inside the control and a range: the filled part's length.
|
|
2863
4002
|
- 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.
|
|
2864
4003
|
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
2865
4004
|
- `data-disabled`: Present when it is disabled.
|
|
4005
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
2866
4006
|
- `data-dragging`: Present while a pointer holds a thumb.
|
|
4007
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
4008
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
4009
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
4010
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
4011
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
4012
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2867
4013
|
- `data-index`: Which thumb it is, from 0.
|
|
2868
4014
|
- `--position`: With thumbs that stay inside the control: where the thumb's centre is.
|
|
2869
4015
|
|
|
4016
|
+
### Steps
|
|
4017
|
+
|
|
4018
|
+
```
|
|
4019
|
+
import { Steps } from "@kirana-ui/vue/steps"
|
|
4020
|
+
```
|
|
4021
|
+
|
|
4022
|
+
Parts: `<Steps.Root>`, `<Steps.List>`, `<Steps.Item>`, `<Steps.Trigger>`, `<Steps.Indicator>`, `<Steps.Separator>`, `<Steps.Content>`, `<Steps.Completed>`, `<Steps.Previous>`, `<Steps.Next>`.
|
|
4023
|
+
|
|
4024
|
+
Anatomy:
|
|
4025
|
+
|
|
4026
|
+
```
|
|
4027
|
+
<Steps.Root>
|
|
4028
|
+
<Steps.List>
|
|
4029
|
+
<Steps.Item> (repeated)
|
|
4030
|
+
<Steps.Trigger>
|
|
4031
|
+
<Steps.Indicator> (optional)
|
|
4032
|
+
<Steps.Separator> (optional)
|
|
4033
|
+
<Steps.Content> (repeated)
|
|
4034
|
+
<Steps.Completed> (optional)
|
|
4035
|
+
<Steps.Previous> (optional)
|
|
4036
|
+
<Steps.Next> (optional)
|
|
4037
|
+
```
|
|
4038
|
+
|
|
4039
|
+
Props of its root:
|
|
4040
|
+
|
|
4041
|
+
- `step?: number`: `v-model:step`. The step shown, from 0. Equal to `count`, every step is done.
|
|
4042
|
+
- `defaultStep?: number`: The step it starts at, when the caller does not hold `step`. Read once. Default `0`.
|
|
4043
|
+
- `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.
|
|
4044
|
+
- `linear?: boolean`: In order only: a step that is not done yet cannot be gone to by its trigger.
|
|
4045
|
+
- `orientation?: Orientation`: Whether the steps are laid out across (the default) or down: the arrows follow.
|
|
4046
|
+
- `@step-change: (value: number, details: ChangeDetails) => void`: Heard as another step is about to be shown: `details.cancel()` keeps it as it was.
|
|
4047
|
+
|
|
4048
|
+
Each part, and its own props:
|
|
4049
|
+
|
|
4050
|
+
- `<Steps.Root>` draws a `<div>`. Its props are above.
|
|
4051
|
+
- `<Steps.List>` draws a `<div>`.
|
|
4052
|
+
- `<Steps.Item>` draws a `<div>`.
|
|
4053
|
+
- `index?: number`: Which step it is, from 0. Left out, its place among the items in the page, once it is there: give it on a page a server draws, which cannot count them.
|
|
4054
|
+
- `<Steps.Trigger>` draws a `<button>`.
|
|
4055
|
+
- `<Steps.Indicator>` draws a `<span>`.
|
|
4056
|
+
- `<Steps.Separator>` draws a `<div>`.
|
|
4057
|
+
- `<Steps.Content>` draws a `<div>`.
|
|
4058
|
+
- `index: number`: Required. The step it is shown for, from 0.
|
|
4059
|
+
- `<Steps.Completed>` draws a `<div>`.
|
|
4060
|
+
- `<Steps.Previous>` draws a `<button>`.
|
|
4061
|
+
- `<Steps.Next>` draws a `<button>`.
|
|
4062
|
+
|
|
4063
|
+
Attributes and CSS variables, by part:
|
|
4064
|
+
|
|
4065
|
+
- root: A task in steps, taken in order.
|
|
4066
|
+
- `data-orientation="horizontal | vertical"`: Whether the steps are laid out across or down.
|
|
4067
|
+
- `data-complete`: Present once every step is done.
|
|
4068
|
+
- list: The row of steps: the arrows move between their triggers.
|
|
4069
|
+
- `data-orientation="horizontal | vertical"`: Whether the steps are laid out across or down.
|
|
4070
|
+
- item: One step of the row, around its trigger and its separator.
|
|
4071
|
+
- `data-current`: Present on the step that is shown.
|
|
4072
|
+
- `data-complete`: Present on a step that is done: one before the step shown.
|
|
4073
|
+
- `data-incomplete`: Present on a step still to come.
|
|
4074
|
+
- `data-orientation="horizontal | vertical"`: Whether the steps are laid out across or down.
|
|
4075
|
+
- trigger: Names a step, and goes to it when pressed.
|
|
4076
|
+
- `data-current`: Present on the step that is shown.
|
|
4077
|
+
- `data-complete`: Present on a step that is done: one before the step shown.
|
|
4078
|
+
- `data-incomplete`: Present on a step still to come.
|
|
4079
|
+
- `data-orientation="horizontal | vertical"`: Whether the steps are laid out across or down.
|
|
4080
|
+
- `data-disabled`: Present when it is disabled.
|
|
4081
|
+
- indicator: A step's mark: its number, or a tick once it is done.
|
|
4082
|
+
- `data-current`: Present on the step that is shown.
|
|
4083
|
+
- `data-complete`: Present on a step that is done: one before the step shown.
|
|
4084
|
+
- `data-incomplete`: Present on a step still to come.
|
|
4085
|
+
- `data-orientation="horizontal | vertical"`: Whether the steps are laid out across or down.
|
|
4086
|
+
- separator: The line from a step to the next.
|
|
4087
|
+
- `data-current`: Present on the step that is shown.
|
|
4088
|
+
- `data-complete`: Present on a step that is done: one before the step shown.
|
|
4089
|
+
- `data-incomplete`: Present on a step still to come.
|
|
4090
|
+
- `data-orientation="horizontal | vertical"`: Whether the steps are laid out across or down.
|
|
4091
|
+
- content: What a step shows: hidden unless its step is the one shown.
|
|
4092
|
+
- `data-current`: Present on the step that is shown.
|
|
4093
|
+
- `data-complete`: Present on a step that is done: one before the step shown.
|
|
4094
|
+
- `data-incomplete`: Present on a step still to come.
|
|
4095
|
+
- `data-orientation="horizontal | vertical"`: Whether the steps are laid out across or down.
|
|
4096
|
+
- completed: What is shown once every step is done.
|
|
4097
|
+
- `data-orientation="horizontal | vertical"`: Whether the steps are laid out across or down.
|
|
4098
|
+
- previous: Goes to the step before.
|
|
4099
|
+
- `data-disabled`: Present when it is disabled.
|
|
4100
|
+
- next: Goes to the step after; from the last, to all of them done.
|
|
4101
|
+
- `data-disabled`: Present when it is disabled.
|
|
4102
|
+
|
|
2870
4103
|
### Switch
|
|
2871
4104
|
|
|
2872
4105
|
```
|
|
@@ -2892,6 +4125,7 @@ Props of its root:
|
|
|
2892
4125
|
- `name?: string`: With a name, the control is submitted with the form around it when it is checked.
|
|
2893
4126
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
2894
4127
|
- `value?: string`: What is submitted. Default `"on"`, as a native checkbox's.
|
|
4128
|
+
- `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.
|
|
2895
4129
|
- `@checked-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to be checked or unchecked: `details.cancel()` keeps it as it was.
|
|
2896
4130
|
|
|
2897
4131
|
Each part, and its own props:
|
|
@@ -2907,12 +4141,24 @@ Attributes and CSS variables, by part:
|
|
|
2907
4141
|
- `data-disabled`: Present when it is disabled.
|
|
2908
4142
|
- `data-readonly`: Present when it can be read but not changed.
|
|
2909
4143
|
- `data-required`: Present when the form needs it.
|
|
4144
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
4145
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
4146
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
4147
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
4148
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
4149
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2910
4150
|
- thumb: The knob that moves along the track.
|
|
2911
4151
|
- `data-checked`: Present when it is checked.
|
|
2912
4152
|
- `data-unchecked`: Present when it is not checked.
|
|
2913
4153
|
- `data-disabled`: Present when it is disabled.
|
|
2914
4154
|
- `data-readonly`: Present when it can be read but not changed.
|
|
2915
4155
|
- `data-required`: Present when the form needs it.
|
|
4156
|
+
- `data-touched`: Inside a Field: present once focus has left the control.
|
|
4157
|
+
- `data-dirty`: Inside a Field: present while the value is not the one it started with.
|
|
4158
|
+
- `data-filled`: Inside a Field: present while the control has a value.
|
|
4159
|
+
- `data-focused`: Inside a Field: present while the control has focus.
|
|
4160
|
+
- `data-valid`: Inside a Field: present once the value has been checked and found right.
|
|
4161
|
+
- `data-invalid`: Inside a Field: present while the value is wrong.
|
|
2916
4162
|
|
|
2917
4163
|
### Tabs
|
|
2918
4164
|
|
|
@@ -2944,7 +4190,8 @@ Each part, and its own props:
|
|
|
2944
4190
|
- `<Tabs.Root>` draws a `<div>`. Generic: `<Value = unknown>`. Its props are above.
|
|
2945
4191
|
- `<Tabs.List>` draws a `<div>`.
|
|
2946
4192
|
- `activateOnFocus?: boolean`: Whether moving focus onto a tab with the arrows activates it. Default `false`.
|
|
2947
|
-
- `
|
|
4193
|
+
- `loopFocus?: boolean`: Whether the arrows wrap from the last tab to the first. Default `true`.
|
|
4194
|
+
- `loop?: boolean`: Whether the arrows wrap from the last item to the first.
|
|
2948
4195
|
- `<Tabs.Tab>` draws a `<button>`.
|
|
2949
4196
|
- `disabled?: boolean`: Disables this tab: it cannot be chosen.
|
|
2950
4197
|
- `value: unknown`: Required. What the tabs' value is while this tab is the active one.
|
|
@@ -2965,6 +4212,7 @@ Attributes and CSS variables, by part:
|
|
|
2965
4212
|
- `data-active`: Present on the tab whose panel is shown.
|
|
2966
4213
|
- `data-disabled`: Present when it is disabled.
|
|
2967
4214
|
- `data-orientation="horizontal | vertical"`: The way the tabs are laid out.
|
|
4215
|
+
- `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.
|
|
2968
4216
|
- indicator: A mark for the active tab: it carries that tab's position and size.
|
|
2969
4217
|
- `data-orientation="horizontal | vertical"`: The way the tabs are laid out.
|
|
2970
4218
|
- `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.
|
|
@@ -2976,11 +4224,168 @@ Attributes and CSS variables, by part:
|
|
|
2976
4224
|
- `--active-tab-height`: The active tab's height.
|
|
2977
4225
|
- panel: A tab's content. In the page while its tab is active, and through its exit.
|
|
2978
4226
|
- `data-hidden`: Present while its tab is not the active one.
|
|
4227
|
+
- `data-index`: The panel's place among the panels in the page, from 0, once it is in the page.
|
|
2979
4228
|
- `data-orientation="horizontal | vertical"`: The way the tabs are laid out.
|
|
2980
4229
|
- `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.
|
|
2981
4230
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
2982
4231
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2983
4232
|
|
|
4233
|
+
### TagsInput
|
|
4234
|
+
|
|
4235
|
+
```
|
|
4236
|
+
import { TagsInput } from "@kirana-ui/vue/tags-input"
|
|
4237
|
+
```
|
|
4238
|
+
|
|
4239
|
+
Parts: `<TagsInput.Root>`, `<TagsInput.List>`, `<TagsInput.Items>`, `<TagsInput.Item>`, `<TagsInput.ItemText>`, `<TagsInput.ItemInput>`, `<TagsInput.ItemRemove>`, `<TagsInput.Input>`, `<TagsInput.Clear>`.
|
|
4240
|
+
|
|
4241
|
+
Anatomy:
|
|
4242
|
+
|
|
4243
|
+
```
|
|
4244
|
+
<TagsInput.Root>
|
|
4245
|
+
<TagsInput.List>
|
|
4246
|
+
<TagsInput.Items>
|
|
4247
|
+
<TagsInput.Item> (repeated)
|
|
4248
|
+
<TagsInput.ItemText>
|
|
4249
|
+
<TagsInput.ItemInput> (optional)
|
|
4250
|
+
<TagsInput.ItemRemove> (optional)
|
|
4251
|
+
<TagsInput.Input>
|
|
4252
|
+
<TagsInput.Clear> (optional)
|
|
4253
|
+
```
|
|
4254
|
+
|
|
4255
|
+
Props of its root:
|
|
4256
|
+
|
|
4257
|
+
- `value?: readonly string[]`: `v-model:value`. The tags, in order.
|
|
4258
|
+
- `defaultValue?: readonly string[]`: The tags it starts with, when the caller does not hold `value`. Read once.
|
|
4259
|
+
- `validate?: (text: string, value: readonly string[]) => boolean`: Whether a text may be a tag. Asked after the text is trimmed, and not for an empty one.
|
|
4260
|
+
- `max?: number`: How many tags it holds at most.
|
|
4261
|
+
- `allowDuplicates?: boolean`: Whether the same text may be a tag twice. Default `false`.
|
|
4262
|
+
- `delimiter?: string | RegExp | null`: What ends a tag as it is typed or pasted, beside Enter. Default `","`. `null` for nothing.
|
|
4263
|
+
- `addOnBlur?: boolean`: Whether what is typed becomes a tag as focus leaves the input. Default `false`.
|
|
4264
|
+
- `addOnPaste?: boolean`: Whether a pasted text is cut into tags at its delimiters and line ends. Default `true`.
|
|
4265
|
+
- `editable?: boolean`: Whether a tag can be edited in place, by two presses or Enter on it. Default `true`.
|
|
4266
|
+
- `disabled?: boolean`: Disabled: nothing can be added or taken away.
|
|
4267
|
+
- `readOnly?: boolean`: Shown as they are, focusable, not changeable.
|
|
4268
|
+
- `required?: boolean`: Needed: in a `Field`, holding none is then invalid.
|
|
4269
|
+
- `name?: string`: With a name, each tag is submitted under it with the form around them.
|
|
4270
|
+
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
4271
|
+
- `@value-change: (value: string[], details: ChangeDetails) => void`: Heard as the tags are about to change: `details.cancel()` keeps them as they were.
|
|
4272
|
+
- `@value-invalid: (text: string, reason: "duplicate" | "max" | "invalid") => void`: A text that was not made a tag, and why.
|
|
4273
|
+
|
|
4274
|
+
Each part, and its own props:
|
|
4275
|
+
|
|
4276
|
+
- `<TagsInput.Root>` draws a `<div>`. Its props are above.
|
|
4277
|
+
- `<TagsInput.List>` draws a `<div>`.
|
|
4278
|
+
- `<TagsInput.Items>` draws no element. The tags, in order: each entry is given to draw. Its default slot is also given `entry: TagsInputEntry`.
|
|
4279
|
+
- `<TagsInput.Item>` draws a `<span>`.
|
|
4280
|
+
- `entry: TagsInputEntry`: Required. The tag it is, as `Items` gave it.
|
|
4281
|
+
- `<TagsInput.ItemText>` draws a `<span>`.
|
|
4282
|
+
- `<TagsInput.ItemInput>` draws a `<input>`.
|
|
4283
|
+
- `<TagsInput.ItemRemove>` draws a `<button>`.
|
|
4284
|
+
- `<TagsInput.Input>` draws a `<input>`.
|
|
4285
|
+
- `<TagsInput.Clear>` draws a `<button>`.
|
|
4286
|
+
|
|
4287
|
+
Attributes and CSS variables, by part:
|
|
4288
|
+
|
|
4289
|
+
- root: Several short texts held as tags, and the input a new one is typed in. It holds the hidden inputs a form reads.
|
|
4290
|
+
- `data-disabled`: Present when it is disabled.
|
|
4291
|
+
- `data-readonly`: Present when the tags are shown and cannot be changed.
|
|
4292
|
+
- `data-required`: Present when a tag is needed.
|
|
4293
|
+
- `data-focused`: Present while focus is on a tag or in the input.
|
|
4294
|
+
- `data-empty`: Present while it holds no tag.
|
|
4295
|
+
- list: What holds the tags: a list.
|
|
4296
|
+
- `data-disabled`: Present when it is disabled.
|
|
4297
|
+
- `data-readonly`: Present when the tags are shown and cannot be changed.
|
|
4298
|
+
- `data-required`: Present when a tag is needed.
|
|
4299
|
+
- item: A tag: reached with the arrows, taken away with Backspace or Delete.
|
|
4300
|
+
- `data-disabled`: Present when it is disabled.
|
|
4301
|
+
- `data-readonly`: Present when the tags are shown and cannot be changed.
|
|
4302
|
+
- `data-required`: Present when a tag is needed.
|
|
4303
|
+
- `data-editing`: Present while the tag is edited.
|
|
4304
|
+
- itemText: A tag's text: hidden while the tag is edited.
|
|
4305
|
+
- `data-disabled`: Present when it is disabled.
|
|
4306
|
+
- `data-readonly`: Present when the tags are shown and cannot be changed.
|
|
4307
|
+
- `data-required`: Present when a tag is needed.
|
|
4308
|
+
- itemInput: Where a tag is edited in place: hidden unless it is being edited.
|
|
4309
|
+
- `data-disabled`: Present when it is disabled.
|
|
4310
|
+
- `data-readonly`: Present when the tags are shown and cannot be changed.
|
|
4311
|
+
- `data-required`: Present when a tag is needed.
|
|
4312
|
+
- itemRemove: A tag's button that takes it away.
|
|
4313
|
+
- `data-disabled`: Present when it is disabled.
|
|
4314
|
+
- `data-readonly`: Present when the tags are shown and cannot be changed.
|
|
4315
|
+
- `data-required`: Present when a tag is needed.
|
|
4316
|
+
- input: Where a new tag is typed. In a `Field` it is what the field's label names.
|
|
4317
|
+
- `data-disabled`: Present when it is disabled.
|
|
4318
|
+
- `data-readonly`: Present when the tags are shown and cannot be changed.
|
|
4319
|
+
- `data-required`: Present when a tag is needed.
|
|
4320
|
+
- clear: Takes every tag away: hidden while there is none.
|
|
4321
|
+
- `data-disabled`: Present when it is disabled.
|
|
4322
|
+
- `data-readonly`: Present when the tags are shown and cannot be changed.
|
|
4323
|
+
- `data-required`: Present when a tag is needed.
|
|
4324
|
+
|
|
4325
|
+
### TimeField
|
|
4326
|
+
|
|
4327
|
+
```
|
|
4328
|
+
import { TimeField } from "@kirana-ui/vue/time-field"
|
|
4329
|
+
```
|
|
4330
|
+
|
|
4331
|
+
Parts: `<TimeField.Root>`, `<TimeField.Segments>`, `<TimeField.Segment>`, `<TimeField.Input>`.
|
|
4332
|
+
|
|
4333
|
+
Anatomy:
|
|
4334
|
+
|
|
4335
|
+
```
|
|
4336
|
+
<TimeField.Root>
|
|
4337
|
+
<TimeField.Segments>
|
|
4338
|
+
<TimeField.Segment> (repeated)
|
|
4339
|
+
<TimeField.Input>
|
|
4340
|
+
```
|
|
4341
|
+
|
|
4342
|
+
Props of its root:
|
|
4343
|
+
|
|
4344
|
+
- `value?: IsoTime | null`: `v-model:value`. The time typed, once all of it is; `null` until then.
|
|
4345
|
+
- `defaultValue?: IsoTime | null`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
4346
|
+
- `granularity?: TimeGranularity`: To the minute (`HH:MM`, the default) or to the second (`HH:MM:SS`).
|
|
4347
|
+
- `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. Default `"en-US"`.
|
|
4348
|
+
- `hourCycle?: HourCycle`: A clock of 12 or 24 hours, whatever the locale's is.
|
|
4349
|
+
- `min?: IsoTime`: The first time it takes: before it, it says it is invalid.
|
|
4350
|
+
- `max?: IsoTime`: The last time it takes.
|
|
4351
|
+
- `placeholders?: Partial<Record<TimeUnit, string>>`: What an empty part shows. Default: `hh`, `mm`, `ss`, and `--` for the day period.
|
|
4352
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
4353
|
+
- `readOnly?: boolean`: Shown as it is, focusable, not changeable.
|
|
4354
|
+
- `required?: boolean`: Needed: in a `Field`, leaving it empty is then invalid.
|
|
4355
|
+
- `name?: string`: The name it is submitted under, by its hidden input; in a `Field`, the field's by default.
|
|
4356
|
+
- `form?: string`: The id of the form it belongs to, when it is not inside it.
|
|
4357
|
+
- `@value-change: (value: string | null, details: ChangeDetails) => void`: Heard as the time is about to change, once all of it is typed or as it is cleared: `details.cancel()` keeps the value as it was.
|
|
4358
|
+
|
|
4359
|
+
Each part, and its own props:
|
|
4360
|
+
|
|
4361
|
+
- `<TimeField.Root>` draws a `<div>`. Its props are above.
|
|
4362
|
+
- `<TimeField.Segments>` draws no element. The time's segments, in the locale's order: each is given to draw. Its default slot is also given `segment: TimeFieldSegment`.
|
|
4363
|
+
- `<TimeField.Segment>` draws a `<span>`.
|
|
4364
|
+
- `segment: TimeFieldSegment`: Required. The piece it draws, as `TimeField.Segments` gives it.
|
|
4365
|
+
- `<TimeField.Input>` draws a `<input>`. The hidden input it is submitted by.
|
|
4366
|
+
|
|
4367
|
+
Attributes and CSS variables, by part:
|
|
4368
|
+
|
|
4369
|
+
- root: The field: a group of the time's parts.
|
|
4370
|
+
- `data-disabled`: Present when it is disabled.
|
|
4371
|
+
- `data-readonly`: Present when its value cannot be changed.
|
|
4372
|
+
- `data-invalid`: Present when the time is outside what it takes, is asked for and half typed, or is wrong by its field.
|
|
4373
|
+
- `data-touched`: In a field: present once focus has left it.
|
|
4374
|
+
- `data-dirty`: In a field: present while the time is not the one it began with.
|
|
4375
|
+
- `data-filled`: In a field: present while it holds a time.
|
|
4376
|
+
- `data-focused`: In a field: present while one of its parts has focus.
|
|
4377
|
+
- `data-valid`: In a field: present once the time was checked and found right.
|
|
4378
|
+
- segment: One piece of the time: a part that is typed, or what stands between two.
|
|
4379
|
+
- `data-segment="hour | minute | second | dayPeriod | literal"`: Which piece it is: `dayPeriod` is AM or PM, on a clock of twelve hours.
|
|
4380
|
+
- `data-placeholder`: Present on a part that is empty.
|
|
4381
|
+
- `data-disabled`: Present when it is disabled.
|
|
4382
|
+
- `data-invalid`: Present when the time is outside what it takes, is asked for and half typed, or is wrong by its field.
|
|
4383
|
+
- `data-touched`: In a field: present once focus has left it.
|
|
4384
|
+
- `data-dirty`: In a field: present while the time is not the one it began with.
|
|
4385
|
+
- `data-filled`: In a field: present while it holds a time.
|
|
4386
|
+
- `data-focused`: In a field: present while one of its parts has focus.
|
|
4387
|
+
- `data-valid`: In a field: present once the time was checked and found right.
|
|
4388
|
+
|
|
2984
4389
|
### Toast
|
|
2985
4390
|
|
|
2986
4391
|
```
|
|
@@ -3016,10 +4421,10 @@ Each part, and its own props:
|
|
|
3016
4421
|
- `<Toast.List>` draws no element. The toasts in the page: each is given to draw its root. Its default slot is also given `toast: ToastRecord`.
|
|
3017
4422
|
- `<Toast.Root>` draws a `<div>`. Its props are above.
|
|
3018
4423
|
- `<Toast.Content>` draws a `<div>`.
|
|
3019
|
-
- `<Toast.Title>` draws a `<div>`.
|
|
3020
|
-
- `<Toast.Description>` draws a `<div>`.
|
|
3021
|
-
- `<Toast.Close>` draws a `<button>`.
|
|
3022
|
-
- `<Toast.Action>` draws a `<button>`.
|
|
4424
|
+
- `<Toast.Title>` draws a `<div>`.
|
|
4425
|
+
- `<Toast.Description>` draws a `<div>`.
|
|
4426
|
+
- `<Toast.Close>` draws a `<button>`.
|
|
4427
|
+
- `<Toast.Action>` draws a `<button>`.
|
|
3023
4428
|
|
|
3024
4429
|
A page's toasts are a toaster's, made once in a module: `import { createToaster } from "@kirana-ui/vue"`, then `export const toaster = createToaster(options)` (`ToasterOptions`, under "Types"). The viewport is given it, and anything on the page adds to it: `toaster.add({ title, description, action, priority })`, `toaster.update(id, options)`, `toaster.dismiss(id)`, `toaster.promise(promise, { loading, success, error })`. What each takes and gives back is `Toaster`, `ToastOptions`, `ToastActionOptions` and `ToastRecord` under "Types".
|
|
3025
4430
|
|
|
@@ -3044,6 +4449,14 @@ Attributes and CSS variables, by part:
|
|
|
3044
4449
|
- content: What holds a toast's contents, when the design sizes the toast itself.
|
|
3045
4450
|
- `data-behind`: Present on a toast that is behind the newest.
|
|
3046
4451
|
- `data-expanded`: Present while the pointer or focus is on the stack: the toasts are spread out, and wait.
|
|
4452
|
+
- title: What the toast is called: the title it was added with, when nothing else is written in it.
|
|
4453
|
+
- `data-type`: The kind the toast was added as.
|
|
4454
|
+
- description: What the toast says: the description it was added with, when nothing else is written in it.
|
|
4455
|
+
- `data-type`: The kind the toast was added as.
|
|
4456
|
+
- close: Closes the toast.
|
|
4457
|
+
- `data-type`: The kind the toast was added as.
|
|
4458
|
+
- 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.
|
|
4459
|
+
- `data-type`: The kind the toast was added as.
|
|
3047
4460
|
|
|
3048
4461
|
### Toggle
|
|
3049
4462
|
|
|
@@ -3080,7 +4493,8 @@ Props:
|
|
|
3080
4493
|
- `multiple?: boolean`: Whether more than one can be pressed at a time.
|
|
3081
4494
|
- `disabled?: boolean`: Disables every toggle of the group.
|
|
3082
4495
|
- `orientation?: Orientation`: Whether the toggles are laid out across (the default) or down: the arrows that move between them follow.
|
|
3083
|
-
- `
|
|
4496
|
+
- `loopFocus?: boolean`: Whether the arrows go round from the last toggle to the first. Default: they do.
|
|
4497
|
+
- `loop?: boolean`: Whether the arrows wrap from the last item to the first.
|
|
3084
4498
|
- `@value-change: (value: Value[], details: ChangeDetails) => void`: Heard as a toggle is about to be pressed or released, with the values that would then be pressed: `details.cancel()` keeps them as they were.
|
|
3085
4499
|
|
|
3086
4500
|
`<ToggleGroup>` draws a `<div>`. Generic: `<Value = unknown>`.
|
|
@@ -3114,17 +4528,20 @@ Anatomy:
|
|
|
3114
4528
|
Props of its root:
|
|
3115
4529
|
|
|
3116
4530
|
- `orientation?: Orientation`: Whether the controls are laid out across (the default) or down: the arrows that move between them follow.
|
|
3117
|
-
- `
|
|
4531
|
+
- `loopFocus?: boolean`: Whether the arrows go round from the last item to the first. Default: they do.
|
|
4532
|
+
- `loop?: boolean`: Whether the arrows wrap from the last item to the first.
|
|
3118
4533
|
- `disabled?: boolean`: Disables every control of the toolbar.
|
|
3119
4534
|
|
|
3120
4535
|
Each part, and its own props:
|
|
3121
4536
|
|
|
3122
4537
|
- `<Toolbar.Root>` draws a `<div>`. Its props are above.
|
|
3123
|
-
- `<Toolbar.Button>` draws a `<button>`.
|
|
4538
|
+
- `<Toolbar.Button>` draws a `<button>`. `focusable-when-disabled` keeps it focusable while disabled, as Base UI's. Default `true`.
|
|
3124
4539
|
- `disabled?: boolean`: Disables this control.
|
|
4540
|
+
- `focusableWhenDisabled?: boolean`: Keeps this control focusable while disabled, as Base UI's: the arrows still reach it and it still says what it is, but a press, a click and the keys (Tab apart) do nothing. Default `true`. With `false`, a disabled control is the element's own `disabled`, and the arrows pass it.
|
|
3125
4541
|
- `<Toolbar.Link>` draws a `<a>`.
|
|
3126
|
-
- `<Toolbar.Input>` draws a `<input>`.
|
|
4542
|
+
- `<Toolbar.Input>` draws a `<input>`. `focusable-when-disabled` keeps it focusable while disabled, as Base UI's. Default `true`.
|
|
3127
4543
|
- `disabled?: boolean`: Disables this control.
|
|
4544
|
+
- `focusableWhenDisabled?: boolean`: Keeps this control focusable while disabled, as Base UI's: the arrows still reach it and it still says what it is, but a press, a click and the keys (Tab apart) do nothing. Default `true`. With `false`, a disabled control is the element's own `disabled`, and the arrows pass it.
|
|
3128
4545
|
- `<Toolbar.Group>` draws a `<div>`.
|
|
3129
4546
|
- `disabled?: boolean`: Disables this control.
|
|
3130
4547
|
- `<Toolbar.Separator>` draws a `<div>`.
|
|
@@ -3137,12 +4554,14 @@ Attributes and CSS variables, by part:
|
|
|
3137
4554
|
- button: A button of the toolbar.
|
|
3138
4555
|
- `data-orientation="horizontal | vertical"`: Whether the toolbar is a row or a column.
|
|
3139
4556
|
- `data-disabled`: Present when it is disabled.
|
|
4557
|
+
- `data-focusable`: Present when it stays focusable while disabled: the arrows still reach it.
|
|
3140
4558
|
- link: A link of the toolbar.
|
|
3141
4559
|
- `data-orientation="horizontal | vertical"`: Whether the toolbar is a row or a column.
|
|
3142
4560
|
- `data-disabled`: Present when it is disabled.
|
|
3143
4561
|
- input: A text input of the toolbar. The arrows are its own until the caret is at an end.
|
|
3144
4562
|
- `data-orientation="horizontal | vertical"`: Whether the toolbar is a row or a column.
|
|
3145
4563
|
- `data-disabled`: Present when it is disabled.
|
|
4564
|
+
- `data-focusable`: Present when it stays focusable while disabled: the arrows still reach it.
|
|
3146
4565
|
- group: Items that belong together.
|
|
3147
4566
|
- `data-orientation="horizontal | vertical"`: Whether the toolbar is a row or a column.
|
|
3148
4567
|
- `data-disabled`: Present when it is disabled.
|
|
@@ -3172,8 +4591,8 @@ Props of its root:
|
|
|
3172
4591
|
|
|
3173
4592
|
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
3174
4593
|
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
3175
|
-
- `delay?: number`: How long the pointer rests on the trigger before the popup opens, in milliseconds.
|
|
3176
|
-
- `closeDelay?: number`: How long after the pointer leaves the popup closes, in milliseconds.
|
|
4594
|
+
- `delay?: number`: How long the pointer rests on the trigger before the popup opens, in milliseconds. Default `600`.
|
|
4595
|
+
- `closeDelay?: number`: How long after the pointer leaves the popup closes, in milliseconds. Default `0`.
|
|
3177
4596
|
- `disabled?: boolean`: Disabled: the pointer and focus do not open it.
|
|
3178
4597
|
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
3179
4598
|
|
|
@@ -3192,16 +4611,20 @@ Attributes and CSS variables, by part:
|
|
|
3192
4611
|
|
|
3193
4612
|
- trigger: The element the tooltip describes.
|
|
3194
4613
|
- `data-popup-open`: Present when the tooltip is open.
|
|
4614
|
+
- `data-trigger-disabled`: Present when the tooltip is disabled: the pointer and focus on the trigger do not open it.
|
|
3195
4615
|
- positioner: Places the popup against the trigger. It carries the geometry.
|
|
3196
4616
|
- `data-open`: Present when it is open.
|
|
3197
4617
|
- `data-closed`: Present when it is closed.
|
|
3198
4618
|
- `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.
|
|
3199
4619
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
4620
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
3200
4621
|
- `--anchor-width`: The anchor's width.
|
|
3201
4622
|
- `--anchor-height`: The anchor's height.
|
|
3202
4623
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
3203
4624
|
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
3204
4625
|
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
4626
|
+
- `--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.
|
|
4627
|
+
- `--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.
|
|
3205
4628
|
- popup: The tooltip itself.
|
|
3206
4629
|
- `data-open`: Present when it is open.
|
|
3207
4630
|
- `data-closed`: Present when it is closed.
|
|
@@ -3211,6 +4634,180 @@ Attributes and CSS variables, by part:
|
|
|
3211
4634
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
3212
4635
|
- `data-instant="delay | focus | dismiss"`: Present when it opened or closed without its usual wait, for a design that skips the motion then.
|
|
3213
4636
|
- arrow: An element that points at the trigger, placed along the popup's edge.
|
|
4637
|
+
- `data-open`: Present when it is open.
|
|
4638
|
+
- `data-closed`: Present when it is closed.
|
|
3214
4639
|
- `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.
|
|
3215
4640
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
4641
|
+
- `data-instant="delay | focus | dismiss"`: Present when it opened or closed without its usual wait, for a design that skips the motion then.
|
|
3216
4642
|
- `data-uncentered`: Present when the popup was pushed along its edge, so the arrow is not at the trigger's centre.
|
|
4643
|
+
|
|
4644
|
+
### Tour
|
|
4645
|
+
|
|
4646
|
+
```
|
|
4647
|
+
import { Tour } from "@kirana-ui/vue/tour"
|
|
4648
|
+
```
|
|
4649
|
+
|
|
4650
|
+
Parts: `<Tour.Root>`, `<Tour.Portal>`, `<Tour.Spotlight>`, `<Tour.Positioner>`, `<Tour.Popup>`, `<Tour.Arrow>`, `<Tour.Title>`, `<Tour.Description>`, `<Tour.Previous>`, `<Tour.Next>`, `<Tour.Close>`.
|
|
4651
|
+
|
|
4652
|
+
Anatomy:
|
|
4653
|
+
|
|
4654
|
+
```
|
|
4655
|
+
<Tour.Root>
|
|
4656
|
+
<Tour.Portal>
|
|
4657
|
+
<Tour.Spotlight>
|
|
4658
|
+
<Tour.Positioner>
|
|
4659
|
+
<Tour.Popup>
|
|
4660
|
+
<Tour.Arrow>
|
|
4661
|
+
<Tour.Title>
|
|
4662
|
+
<Tour.Description>
|
|
4663
|
+
<Tour.Previous>
|
|
4664
|
+
<Tour.Next>
|
|
4665
|
+
<Tour.Close>
|
|
4666
|
+
```
|
|
4667
|
+
|
|
4668
|
+
Props of its root:
|
|
4669
|
+
|
|
4670
|
+
- `steps: readonly Step[]`: Required. The steps, in order.
|
|
4671
|
+
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
4672
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
4673
|
+
- `step?: number`: `v-model:step`. The index of the step shown, from 0, when the caller holds it.
|
|
4674
|
+
- `defaultStep?: number`: The step it starts at, when the caller does not hold `step`. Read once. Default 0.
|
|
4675
|
+
- `waitForTarget?: 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.
|
|
4676
|
+
- `spotlightPadding?: number`: The room between the target and the edge of the spotlight's hole, in pixels. Default 4.
|
|
4677
|
+
- `closeOnOutsidePress?: boolean`: Whether a press on the dimmed page ends the tour. Default `false`.
|
|
4678
|
+
- `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.
|
|
4679
|
+
- `keyboardNavigation?: boolean`: Whether ArrowRight and ArrowLeft go on and back a step. Default `true`.
|
|
4680
|
+
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to open or close: `details.cancel()` keeps it as it was. The reason is `"finish"` for the last step's `next`, `"close-press"`, `"escape-key"` or `"outside-press"`.
|
|
4681
|
+
- `@step-change: (value: number, details: ChangeDetails) => void`: Heard as another step is about to be shown: `details.cancel()` keeps it as it was. The reason is `"next-press"`, `"previous-press"`, `"next-key"` or `"previous-key"`.
|
|
4682
|
+
|
|
4683
|
+
Each part, and its own props:
|
|
4684
|
+
|
|
4685
|
+
- `<Tour.Root>` draws no element. Generic: `<Step extends TourStep = TourStep>`. `Step` is what each step is: a `TourStep` with whatever the page draws it from. Its props are above.
|
|
4686
|
+
- `<Tour.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
4687
|
+
- `<Tour.Spotlight>` draws a `<div>`.
|
|
4688
|
+
- `<Tour.Positioner>` draws a `<div>`. A positioner's own props: where its popup goes, and what it is placed against. Takes the positioner options ("Positioner options", above).
|
|
4689
|
+
- `<Tour.Popup>` draws a `<div>`. Its default slot is also given `step: Step`, `index: number`, `current: number`, `total: number`.
|
|
4690
|
+
- `<Tour.Arrow>` draws a `<div>`.
|
|
4691
|
+
- `<Tour.Title>` draws a `<h2>`. The heading that names the step.
|
|
4692
|
+
- `<Tour.Description>` draws a `<p>`. The text that describes the step.
|
|
4693
|
+
- `<Tour.Previous>` draws a `<button>`.
|
|
4694
|
+
- `<Tour.Next>` draws a `<button>`.
|
|
4695
|
+
- `<Tour.Close>` draws a `<button>`. A button that ends the tour.
|
|
4696
|
+
|
|
4697
|
+
Attributes and CSS variables, by part:
|
|
4698
|
+
|
|
4699
|
+
- 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.
|
|
4700
|
+
- `data-open`: Present when it is open.
|
|
4701
|
+
- `data-closed`: Present when it is closed.
|
|
4702
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
4703
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
4704
|
+
- `data-centered`: Present while the step shown has no target in the page: the popup stands in the middle of the viewport.
|
|
4705
|
+
- `--spotlight-left`: The hole's left edge, from the spotlight's own left edge: the target's, less `spotlightPadding`.
|
|
4706
|
+
- `--spotlight-top`: The hole's top edge, from the spotlight's own top edge: the target's, less `spotlightPadding`.
|
|
4707
|
+
- `--spotlight-width`: The hole's width: the target's, with `spotlightPadding` on each side.
|
|
4708
|
+
- `--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.
|
|
4709
|
+
- 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.
|
|
4710
|
+
- `data-open`: Present when it is open.
|
|
4711
|
+
- `data-closed`: Present when it is closed.
|
|
4712
|
+
- `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.
|
|
4713
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
4714
|
+
- `data-centered`: Present while the step shown has no target in the page: the popup stands in the middle of the viewport.
|
|
4715
|
+
- `data-anchor-hidden`: Present while the anchor is out of view: scrolled away, or clipped by a box around it.
|
|
4716
|
+
- `--anchor-width`: The anchor's width.
|
|
4717
|
+
- `--anchor-height`: The anchor's height.
|
|
4718
|
+
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
4719
|
+
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
4720
|
+
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
4721
|
+
- popup: The step itself: a dialog that stays in the page from the first step to the last, and moves.
|
|
4722
|
+
- `data-open`: Present when it is open.
|
|
4723
|
+
- `data-closed`: Present when it is closed.
|
|
4724
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
4725
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
4726
|
+
- `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.
|
|
4727
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
4728
|
+
- `data-centered`: Present while the step shown has no target in the page: the popup stands in the middle of the viewport.
|
|
4729
|
+
- arrow: An element that points at the target, placed along the popup's edge.
|
|
4730
|
+
- `data-open`: Present when it is open.
|
|
4731
|
+
- `data-closed`: Present when it is closed.
|
|
4732
|
+
- `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.
|
|
4733
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
4734
|
+
- `data-uncentered`: Present when the popup was pushed along its edge, so the arrow is not at the target's centre.
|
|
4735
|
+
- `data-centered`: Present while the step shown has no target in the page: the popup stands in the middle of the viewport.
|
|
4736
|
+
- previous: A button that goes back a step. On the first step it does nothing.
|
|
4737
|
+
- `data-disabled`: Present when it is disabled.
|
|
4738
|
+
- next: A button that goes on a step. On the last step it finishes the tour.
|
|
4739
|
+
- `data-last`: Present on the last step: a press finishes the tour.
|
|
4740
|
+
|
|
4741
|
+
### Tree
|
|
4742
|
+
|
|
4743
|
+
```
|
|
4744
|
+
import { Tree } from "@kirana-ui/vue/tree"
|
|
4745
|
+
```
|
|
4746
|
+
|
|
4747
|
+
Parts: `<Tree.Root>`, `<Tree.Item>`, `<Tree.ItemRow>`, `<Tree.ItemIndicator>`, `<Tree.ItemText>`, `<Tree.Group>`.
|
|
4748
|
+
|
|
4749
|
+
Anatomy:
|
|
4750
|
+
|
|
4751
|
+
```
|
|
4752
|
+
<Tree.Root>
|
|
4753
|
+
<Tree.Item> (repeated)
|
|
4754
|
+
<Tree.ItemRow> (optional)
|
|
4755
|
+
<Tree.ItemIndicator>
|
|
4756
|
+
<Tree.ItemText>
|
|
4757
|
+
<Tree.Group>
|
|
4758
|
+
<Tree.Item> (repeated, as above)
|
|
4759
|
+
```
|
|
4760
|
+
|
|
4761
|
+
Props of its root:
|
|
4762
|
+
|
|
4763
|
+
- `expandedValue?: readonly Value[]`: `v-model:expandedValue`. The values of the open branches.
|
|
4764
|
+
- `defaultExpandedValue?: readonly Value[]`: The branches open at first, when the caller does not hold `expandedValue`. Read once.
|
|
4765
|
+
- `selectionMode?: TreeSelectionMode`: Whether nodes can be chosen: none, one, or several. Default `single`.
|
|
4766
|
+
- `selectedValue?: readonly Value[]`: `v-model:selectedValue`. The values of the chosen nodes.
|
|
4767
|
+
- `defaultSelectedValue?: readonly Value[]`: The nodes chosen at first, when the caller does not hold `selectedValue`. Read once.
|
|
4768
|
+
- `expandOnClick?: boolean`: Whether a press on a branch (or Enter on it) also opens or closes it. Default `true`.
|
|
4769
|
+
- `@expanded-change: (value: Value[], details: ChangeDetails) => void`: Heard as a branch is about to open or close, with the values that would then be open: `details.cancel()` keeps them as they were. A page that loads a branch's children loads them when this says the branch opened.
|
|
4770
|
+
- `@selected-change: (value: Value[], details: ChangeDetails) => void`: Heard as nodes are about to be chosen or taken away, with the values there would then be: `details.cancel()` keeps them as they were.
|
|
4771
|
+
|
|
4772
|
+
Each part, and its own props:
|
|
4773
|
+
|
|
4774
|
+
- `<Tree.Root>` draws a `<div>`. Generic: `<Value = unknown>`. `Value` is what tells a node from the others: the type of the values' entries. Its props are above.
|
|
4775
|
+
- `<Tree.Item>` draws a `<div>`.
|
|
4776
|
+
- `value: unknown`: Required. What tells this node from the others in the tree: what the values hold.
|
|
4777
|
+
- `branch?: boolean`: A branch: it has children, drawn in its `Tree.Group`, and opens and closes.
|
|
4778
|
+
- `disabled?: boolean`: Disables this node: it cannot be chosen, opened or closed, and the keys pass over it.
|
|
4779
|
+
- `loading?: boolean`: A branch whose children are being loaded.
|
|
4780
|
+
- `label?: string`: What typing matches, when it is not the node's text.
|
|
4781
|
+
- `<Tree.ItemRow>` draws a `<div>`.
|
|
4782
|
+
- `<Tree.ItemIndicator>` draws a `<span>`.
|
|
4783
|
+
- `<Tree.ItemText>` draws a `<span>`. The node's name: what names it to assistive technology, and what typing matches.
|
|
4784
|
+
- `<Tree.Group>` draws a `<div>`.
|
|
4785
|
+
- `keepMounted?: boolean`: Keeps the closed group in the page, `hidden`.
|
|
4786
|
+
|
|
4787
|
+
Attributes and CSS variables, by part:
|
|
4788
|
+
|
|
4789
|
+
- 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.
|
|
4790
|
+
- `data-selected`: Present on a chosen node.
|
|
4791
|
+
- `data-highlighted`: Present on the node focus is on, while it is in the tree.
|
|
4792
|
+
- `data-disabled`: Present when it is disabled.
|
|
4793
|
+
- `data-open`: Present on a branch that is open.
|
|
4794
|
+
- `data-closed`: Present on a branch that is closed.
|
|
4795
|
+
- `data-loading`: Present on a branch that says its children are being loaded.
|
|
4796
|
+
- itemRow: The line a node draws, apart from the children its group holds: what a design gives a background.
|
|
4797
|
+
- `data-selected`: Present on a chosen node.
|
|
4798
|
+
- `data-highlighted`: Present on the node focus is on, while it is in the tree.
|
|
4799
|
+
- `data-disabled`: Present when it is disabled.
|
|
4800
|
+
- `data-open`: Present on a branch that is open.
|
|
4801
|
+
- `data-closed`: Present on a branch that is closed.
|
|
4802
|
+
- `data-loading`: Present on a branch that says its children are being loaded.
|
|
4803
|
+
- itemIndicator: The mark that says whether a branch is open. A press on it opens or closes the branch and chooses nothing.
|
|
4804
|
+
- `data-open`: Present on a branch that is open.
|
|
4805
|
+
- `data-closed`: Present on a branch that is closed.
|
|
4806
|
+
- `data-loading`: Present on a branch that says its children are being loaded.
|
|
4807
|
+
- group: A branch's children. In the page while the branch is open, and through its exit's motion.
|
|
4808
|
+
- `data-open`: Present when it is open.
|
|
4809
|
+
- `data-closed`: Present when it is closed.
|
|
4810
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
4811
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
4812
|
+
- `--tree-group-height`: The group's content height while it opens or closes, `auto` once it is open.
|
|
4813
|
+
- `--tree-group-width`: The group's content width while it opens or closes, `auto` once it is open.
|