@kirana-ui/angular 0.1.1 → 0.3.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/fesm2022/kirana-ui-angular-agent.mjs +1 -0
- package/fesm2022/kirana-ui-angular-testing.mjs +1 -0
- package/fesm2022/kirana-ui-angular.mjs +5367 -3795
- package/fesm2022/kirana-ui-angular.mjs.map +1 -1
- package/llms.txt +1996 -371
- package/package.json +10 -2
- package/skills/kirana-ui-primitives/SKILL.md +163 -0
- package/types/kirana-ui-angular-agent.d.ts +1 -0
- package/types/kirana-ui-angular-testing.d.ts +1 -0
- package/types/kirana-ui-angular.d.ts +1963 -1371
package/llms.txt
CHANGED
|
@@ -2,52 +2,471 @@
|
|
|
2
2
|
|
|
3
3
|
> Kirana UI Primitives for Angular: headless, accessible components with no styles of their own. The same components, parts, attributes and behaviour as on the other four frameworks, from one core.
|
|
4
4
|
|
|
5
|
-
Generated from the library's own
|
|
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
|
+
|
|
7
|
+
## Install and entries
|
|
8
|
+
|
|
9
|
+
Install `@kirana-ui/angular`. 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/angular/agent`, `@kirana-ui/angular/testing`), so nothing is imported from a package the project did not install.
|
|
10
|
+
|
|
11
|
+
Its entries: `@kirana-ui/angular` (every directive, and what a directive of your own is made with), `@kirana-ui/angular/agent` and `@kirana-ui/angular/testing`. There is no entry per component: Angular's packager writes one module, which a project's build takes apart.
|
|
12
|
+
|
|
13
|
+
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
|
+
|
|
15
|
+
An agent's skill is in the package: `node_modules/@kirana-ui/angular/skills/kirana-ui-primitives/SKILL.md`.
|
|
16
|
+
|
|
17
|
+
## Positioner options
|
|
18
|
+
|
|
19
|
+
What every `Positioner` takes, beside its own props where a component's section lists any:
|
|
20
|
+
|
|
21
|
+
- `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
|
+
- `align?: Align`: Where along that side the popup is: at the anchor's start, its centre or its end. Default `"center"`.
|
|
23
|
+
- `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`.
|
|
24
|
+
- `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`.
|
|
25
|
+
- `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`.
|
|
26
|
+
- `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.
|
|
27
|
+
- `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.
|
|
28
|
+
- `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`.
|
|
29
|
+
- `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`.
|
|
30
|
+
- `positionMethod?: "absolute" | "fixed"`: The CSS `position` the positioner is given: `"absolute"` or `"fixed"`. Default `"absolute"`.
|
|
31
|
+
- `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.
|
|
32
|
+
|
|
33
|
+
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" }`.
|
|
34
|
+
|
|
35
|
+
## Types
|
|
36
|
+
|
|
37
|
+
The named types the props below mention, each with the entry of this package it is imported from: `import type { ChangeDetails, Side } from "@kirana-ui/angular"`. The core's own types are re-exported there, as types only, so nothing is imported from `@kirana-ui/core`, which a strict installer keeps out of a project's reach. A capital alone (`Value`) in a part's props is that part's own type parameter, said on the part's line.
|
|
38
|
+
|
|
39
|
+
- `Align` (`@kirana-ui/angular`): `"start" | "center" | "end"`. Where along its side a popup is: at the anchor's start, its centre or its end.
|
|
40
|
+
- `Anchor` (`@kirana-ui/angular`): `Element | VirtualElement`. What a popup is placed against: an element, or a place in the viewport that is none.
|
|
41
|
+
- `CalendarDay` (`@kirana-ui/angular`): A day in the grid of a month shown.
|
|
42
|
+
- `date: IsoDate`
|
|
43
|
+
- `label: string`: The day of the month as the locale writes it.
|
|
44
|
+
- `outside: boolean`: Not of the month it is drawn in: the days that fill its first and last weeks.
|
|
45
|
+
- `CalendarMonth` (`@kirana-ui/angular`): One of the months shown, as `Calendar.Months` gives it.
|
|
46
|
+
- `index: number`: Its place among the months shown, from 0.
|
|
47
|
+
- `month: IsoDate`: Its first day.
|
|
48
|
+
- `title: string`: Its name as the locale writes it (`"March 2026"`).
|
|
49
|
+
- `weekdays: readonly CalendarWeekday[]`
|
|
50
|
+
- `weeks: readonly (readonly CalendarDay[])[]`
|
|
51
|
+
- `CalendarProps<Mode extends CalendarMode = CalendarMode>` (`@kirana-ui/angular`)
|
|
52
|
+
- `id: string`
|
|
53
|
+
- `value?: CalendarValueOf<Mode>`: 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.
|
|
54
|
+
- `defaultValue?: CalendarValueOf<Mode>`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
55
|
+
- `onValueChange?: ((value: CalendarValueOf<Mode>, details: ChangeDetails) => void)`: Heard as a day is about to be chosen: `details.cancel()` keeps the value as it was.
|
|
56
|
+
- `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).
|
|
57
|
+
- `minDays?: number`: With `mode: "multiple"`: the fewest days that can be left chosen. A press that would leave fewer does nothing.
|
|
58
|
+
- `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.
|
|
59
|
+
- `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`.
|
|
60
|
+
- `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.
|
|
61
|
+
- `month?: IsoDate`: 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.
|
|
62
|
+
- `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.
|
|
63
|
+
- `onMonthChange?: ((month: IsoDate, 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.
|
|
64
|
+
- `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.
|
|
65
|
+
- `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.
|
|
66
|
+
- `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.
|
|
67
|
+
- `min?: IsoDate`: The first and the last day that can be chosen.
|
|
68
|
+
- `max?: IsoDate`: The last day that can be chosen.
|
|
69
|
+
- `isDateUnavailable?: ((date: IsoDate) => boolean)`: Days that cannot be chosen, though they can be reached: a day off, a day taken.
|
|
70
|
+
- `disabled?: boolean`: Disabled: no day can be chosen.
|
|
71
|
+
- `readOnly?: boolean`: Shown as it is: the days can be moved through, and none can be chosen.
|
|
72
|
+
- `fixedWeeks?: boolean`: Always six rows, so the calendar is one height in every month.
|
|
73
|
+
- `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.
|
|
74
|
+
- `form?: string`: The id of the form it belongs to, when it is not inside it.
|
|
75
|
+
- `CalendarValueOf<Mode extends CalendarMode | undefined>` (`@kirana-ui/angular`): `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.
|
|
76
|
+
- `CalendarWeekday` (`@kirana-ui/angular`): A day of the week, as a column's heading names it.
|
|
77
|
+
- `index: number`: Its place in the week as the locale orders it, from 0.
|
|
78
|
+
- `narrow: string`: Its name as a column's heading (`"M"`, `"Mo"`), and in full (`"Monday"`).
|
|
79
|
+
- `short: string`
|
|
80
|
+
- `long: string`
|
|
81
|
+
- `ChangeDetails` (`@kirana-ui/angular`): What a change callback is given beside the value: why it changed, what made it, and a way to refuse it.
|
|
82
|
+
- `reason: string`: Why the value changed: `"trigger-press"`, `"outside-press"`, `"escape-key"`, `"item-press"` …
|
|
83
|
+
- `event: Event | undefined`: The DOM event behind it, when there is one.
|
|
84
|
+
- `source: ChangeSource`: What made it: a mouse, a finger, a pen, the keyboard, something that presses without a pointer (a screen reader, `element.click()`), code with no event at all, or an agent acting through the bridge (`@kirana-ui/core/agent`).
|
|
85
|
+
- `cancel(): void`: Keeps the value as it was.
|
|
86
|
+
- `canceled: boolean`
|
|
87
|
+
- `ChangeSource` (`@kirana-ui/angular`): `"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.
|
|
88
|
+
- `CollisionAvoidance` (`@kirana-ui/angular`): What a popup does when it does not fit where it was asked to be.
|
|
89
|
+
- `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"`.
|
|
90
|
+
- `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"`.
|
|
91
|
+
- `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"`.
|
|
92
|
+
- `CollisionBoundary` (`@kirana-ui/angular`): `"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.
|
|
93
|
+
- `CollisionPadding` (`@kirana-ui/angular`): `number | Partial<Record<PhysicalSide, number>>`. The room kept between a popup and the edges it is held inside: one number, or one a side.
|
|
94
|
+
- `ComboboxEntry<Value = unknown>` (`@kirana-ui/angular`): `ComboboxItemEntry<Value> | ComboboxGroupEntry<Value>`. What a `Collection` hands to be drawn: an item that is left, or a group that has items left.
|
|
95
|
+
- `ComboboxGroupData<Value = unknown>` (`@kirana-ui/angular`): Items given as data that belong together: `value` is the group's name.
|
|
96
|
+
- `value: string`
|
|
97
|
+
- `items: readonly ComboboxItemData<Value>[]`
|
|
98
|
+
- `ComboboxGroupEntry<Value = unknown>` (`@kirana-ui/angular`): A group that has items left, with those items.
|
|
99
|
+
- `type: "group"`
|
|
100
|
+
- `key: string`: What it is known by from one drawing to the next.
|
|
101
|
+
- `value: string`: The group's name, as it was given.
|
|
102
|
+
- `label: string`: The same name: an entry of either kind has a `label`.
|
|
103
|
+
- `disabled: false`: Never: an entry of either kind says whether it is disabled.
|
|
104
|
+
- `items: readonly ComboboxItemEntry<Value>[]`: The items of the group that are left.
|
|
105
|
+
- `ComboboxItemData<Value = unknown>` (`@kirana-ui/angular`): One item given as data: its value, and what it is called.
|
|
106
|
+
- `value: Value`
|
|
107
|
+
- `label: string`
|
|
108
|
+
- `disabled?: boolean`: It cannot be chosen: its entry says so, for the item drawn for it.
|
|
109
|
+
- `ComboboxItemEntry<Value = unknown>` (`@kirana-ui/angular`): One item left of the `items` given as data, as a `Collection` hands it to be drawn.
|
|
110
|
+
- `type: "item"`
|
|
111
|
+
- `key: string`: What it is known by from one drawing to the next.
|
|
112
|
+
- `value: Value`
|
|
113
|
+
- `label: string`
|
|
114
|
+
- `disabled: boolean`
|
|
115
|
+
- `item: ComboboxItemData<Value>`: The item as it was given, with whatever else it carries.
|
|
116
|
+
- `ComboboxShown<Value = unknown>` (`@kirana-ui/angular`): What a combobox's value part shows: what is chosen, and how it is named.
|
|
117
|
+
- `value: Value | null`: The chosen value; `null` while nothing is chosen, and with `multiple`.
|
|
118
|
+
- `label: string | undefined`: The chosen value's label, or with `multiple` every chosen label with ", " between; `undefined` while nothing is chosen.
|
|
119
|
+
- `values: readonly Value[]`: Every chosen value, in the order they were chosen: one or none without `multiple`.
|
|
120
|
+
- `labels: readonly string[]`: The label of each of `values`.
|
|
121
|
+
- `DateFieldProps` (`@kirana-ui/angular`)
|
|
122
|
+
- `id: string`
|
|
123
|
+
- `value?: IsoDate | null`: The day typed, once all of it is; `null` until then.
|
|
124
|
+
- `defaultValue?: IsoDate | null`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
125
|
+
- `onValueChange?: ((value: IsoDate | null, details: ChangeDetails) => void)`: Heard as the day is about to change, once all of it is typed or as it is cleared: `details.cancel()` keeps the value as it was.
|
|
126
|
+
- `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.
|
|
127
|
+
- `min?: IsoDate`: The first and the last day it takes: outside them it says it is invalid.
|
|
128
|
+
- `max?: IsoDate`: The last day it takes.
|
|
129
|
+
- `placeholders?: Partial<Record<DateUnit, string>>`: What an empty part shows. Default: `dd`, `mm`, `yyyy`.
|
|
130
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
131
|
+
- `readOnly?: boolean`: Shown as it is, focusable, not changeable.
|
|
132
|
+
- `required?: boolean`: Needed: in a `Field`, leaving it empty is then invalid.
|
|
133
|
+
- `name?: string`: The name it is submitted under, by its hidden input.
|
|
134
|
+
- `form?: string`: The id of the form it belongs to, when it is not inside it.
|
|
135
|
+
- `DateFieldSegment` (`@kirana-ui/angular`): One piece of the field, in the locale's order: a part that is typed, or what stands between.
|
|
136
|
+
- `type: DateUnit | "literal"`
|
|
137
|
+
- `literal: string`: What stands between two parts (`"/"`); empty for a part that is typed.
|
|
138
|
+
- `index: number`: Its place among the pieces.
|
|
139
|
+
- `DateRange` (`@kirana-ui/angular`): A range of days, its first and its last, both in it.
|
|
140
|
+
- `start: IsoDate`
|
|
141
|
+
- `end: IsoDate`
|
|
142
|
+
- `DateUnit` (`@kirana-ui/angular`): `"day" | "month" | "year"`. A part of a date that is typed on its own.
|
|
143
|
+
- `Direction` (`@kirana-ui/angular`): `"ltr" | "rtl"`. The reading direction: left to right, or right to left.
|
|
144
|
+
- `DrawerSide` (`@kirana-ui/angular`): `"up" | "down" | "left" | "right"`. The way a drawer is swiped to close it: towards the edge it came from.
|
|
145
|
+
- `DrawerSnapPoint` (`@kirana-ui/angular`): `number | string`. How much of a drawer shows at a place it rests: a share of it, or a length.
|
|
146
|
+
- `FieldValidity` (`@kirana-ui/angular`): What a field knows of its control's value once it has been checked.
|
|
147
|
+
- `valid: boolean | null`: `null` until the value has been checked.
|
|
148
|
+
- `errors: readonly string[]`: What is wrong, one message each.
|
|
149
|
+
- `state: Readonly<Record<ValidityKey, boolean>>`: What the browser found, by name; `customError` is the field's own `validate`.
|
|
150
|
+
- `value: string`: The value that was checked.
|
|
151
|
+
- `FormErrors` (`@kirana-ui/angular`): `Record<string, string | readonly string[]>`. A form's errors as a server sends them: each field's name with its message, or messages.
|
|
152
|
+
- `FormValues` (`@kirana-ui/angular`): `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.
|
|
153
|
+
- `ImageStatus` (`@kirana-ui/angular`): `"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`.
|
|
154
|
+
- `IsoDate` (`@kirana-ui/angular`): `string`. A day as `YYYY-MM-DD`, in the calendar the world's data is kept in (ISO 8601).
|
|
155
|
+
- `ItemLabels<Value = unknown>` (`@kirana-ui/angular`): `readonly { value: Value; label: string }[] | Readonly<Record<string, string>>`. 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" }`).
|
|
156
|
+
- `ListCollection` (`@kirana-ui/angular`): 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.
|
|
157
|
+
- `count: number`: How many rows there are, drawn or not.
|
|
158
|
+
- `label?(index: number): string`: A row's name by its place: what typing matches. Without it, typing finds nothing.
|
|
159
|
+
- `disabled?(index: number): boolean`
|
|
160
|
+
- `indexOf?(value: unknown): number`: The place of a value, or -1: where a list opens on what is chosen.
|
|
161
|
+
- `scrollToIndex(index: number): void`: Brings a row into the page: the virtualizer's own scroll.
|
|
162
|
+
- `OffsetData` (`@kirana-ui/angular`): What an offset given as a function is told: where the popup is, and the two sizes.
|
|
163
|
+
- `side: Side`: The side of the anchor the popup is on, in the words it was asked for in.
|
|
164
|
+
- `align: Align`: Where along that side the popup is.
|
|
165
|
+
- `anchor: { width: number; height: number }`: The anchor's size, in pixels.
|
|
166
|
+
- `positioner: { width: number; height: number }`: The positioner's size, in pixels.
|
|
167
|
+
- `OffsetFunction` (`@kirana-ui/angular`): `(data: OffsetData) => number`. A gap worked out from what was measured: `({ side, align, anchor, positioner }) => number`.
|
|
168
|
+
- `Orientation` (`@kirana-ui/angular`): `"horizontal" | "vertical"`. The way a row of things is laid out, and so which arrow keys move along it.
|
|
169
|
+
- `PaginationEntry` (`@kirana-ui/angular`): `{ 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.
|
|
170
|
+
- `PhysicalSide` (`@kirana-ui/angular`): `"top" | "right" | "bottom" | "left"`. A side of the anchor as the page is drawn.
|
|
171
|
+
- `PositionerAnchor` (`@kirana-ui/angular`): `Anchor | ElementRef<Element> | (() => Anchor | ElementRef<Element> | null | undefined) | null | undefined`. What a positioner's `anchor` may be: an element (a template variable, `#box`), an `ElementRef`, a place in the viewport (an object with `getBoundingClientRect`), or a function that gives one of those (a `viewChild` signal).
|
|
172
|
+
- `QrCorrection` (`@kirana-ui/angular`): `"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.
|
|
173
|
+
- `ReadonlySignal<T>` (`@kirana-ui/angular`): A value that is read, and that tells when it changes.
|
|
174
|
+
- `get(): T`: The value, tracked by the computed or effect that reads it.
|
|
175
|
+
- `peek(): T`: The value, untracked.
|
|
176
|
+
- `subscribe(listener: () => void): () => void`: Calls `listener` after each change (not at once). Returns the unsubscribe.
|
|
177
|
+
- `SelectShown<Value = unknown>` (`@kirana-ui/angular`): What a select's value part shows: what is chosen, and how it is named.
|
|
178
|
+
- `value: Value | null`: The chosen value; `null` while nothing is chosen, and with `multiple`.
|
|
179
|
+
- `label: string | undefined`: What the part says: the chosen value's label, or with `multiple` every chosen label with ", " between; `undefined` while nothing is chosen.
|
|
180
|
+
- `values: readonly Value[]`: Every chosen value, in the items' order: one or none without `multiple`.
|
|
181
|
+
- `labels: readonly string[]`: The label of each of `values`.
|
|
182
|
+
- `Side` (`@kirana-ui/angular`): `PhysicalSide | "inline-start" | "inline-end"`. The side of its anchor a popup is on. `inline-start` and `inline-end` turn with the reading direction: `inline-end` is the right in English and the left in Arabic.
|
|
183
|
+
- `SliderChangeDetails` (`@kirana-ui/angular`): A slider's change details: the details of any change, and which thumb moved.
|
|
184
|
+
- `index: number`: The thumb that moved.
|
|
185
|
+
- `reason: string`: Why the value changed: `"trigger-press"`, `"outside-press"`, `"escape-key"`, `"item-press"` …
|
|
186
|
+
- `event: Event | undefined`: The DOM event behind it, when there is one.
|
|
187
|
+
- `source: ChangeSource`: What made it: a mouse, a finger, a pen, the keyboard, something that presses without a pointer (a screen reader, `element.click()`), code with no event at all, or an agent acting through the bridge (`@kirana-ui/core/agent`).
|
|
188
|
+
- `cancel(): void`: Keeps the value as it was.
|
|
189
|
+
- `canceled: boolean`
|
|
190
|
+
- `SliderTold<Value extends SliderValue = SliderValue>` (`@kirana-ui/angular`): `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.
|
|
191
|
+
- `ToastActionOptions<Content = string>` (`@kirana-ui/angular`): A button a toast offers: what it says, and what pressing it does.
|
|
192
|
+
- `label: Content`: What the button says: `Toast.Action` draws it when it is given nothing else. Needed.
|
|
193
|
+
- `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.
|
|
194
|
+
- `Toaster<Content = ToastContent>` (`@kirana-ui/angular`): The toasts of a page and what changes them: what `createToaster()` gives.
|
|
195
|
+
- `toasts: ReadonlySignal<readonly ToastRecord<Content>[]>`: Every toast that is in the page, the newest first. Empty to begin with.
|
|
196
|
+
- `limit: number`: How many are shown at once; the rest wait behind. Default: `3`.
|
|
197
|
+
- `add(options: ToastOptions<Content> & { id?: string }): string`: Shows a toast, and gives the id it is known by: `id` when one is given (the same id again is the same toast, changed), `toast-1`, `toast-2` … otherwise.
|
|
198
|
+
- `update(id: string, options: ToastOptions<Content>): void`: Changes one that is showing: what is given replaces what it had, the rest stays, and its time starts again.
|
|
199
|
+
- `dismiss(id?: string, details?: ChangeDetails): void`: Closes one, or every one when no id is given: it leaves once its motion has ended. `details` is what `onClose` hears. Default: the reason `"dismiss"`.
|
|
200
|
+
- `remove(id: string): void`: Takes one out at once, with no exit: what draws the toasts calls it when the motion has ended.
|
|
201
|
+
- `promise<Value>( promise: Promise<Value>, states: { loading: ToastState<Content> success: ToastState<Content> | ((value: Value) => ToastState<Content>) error: ToastState<Content> | ((error: unknown) => ToastState<Content>) } ): Promise<Value>`: One toast for something that takes time: `loading` (type `"loading"`, staying until the promise settles), then `success` or `error` in its place, each a title, a toast's options, or a function of what the promise gave. Each state is whole: a description or an action the state before had is not kept. Answers the promise itself.
|
|
202
|
+
- `ToastOptions<Content = string>` (`@kirana-ui/angular`): What a toast is added with. `Content` is what a title, a description and an action's label may be: a string here, and what the framework draws in each adapter's own `createToaster`. The toaster hands it on as it was given, and never reads it.
|
|
203
|
+
- `title?: Content`: What the toast is called: `Toast.Title` draws it when it is given nothing else. Default: none.
|
|
204
|
+
- `description?: Content`: What the toast says: `Toast.Description` draws it when it is given nothing else. Default: none.
|
|
205
|
+
- `type?: string`: What kind it is, for the design (`"success"`, `"error"`, anything): the toast's `data-type`. Default: none.
|
|
206
|
+
- `duration?: number`: How long it stays, in milliseconds; `Infinity` until it is closed. Default: the toaster's `duration`.
|
|
207
|
+
- `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"`.
|
|
208
|
+
- `action?: ToastActionOptions<Content>`: A button of the toast's own, which `Toast.Action` draws and presses. Default: none.
|
|
209
|
+
- `data?: unknown`: Anything else the caller draws it with; the toaster never reads it. Default: none.
|
|
210
|
+
- `onClose?: ((details: ChangeDetails) => void)`: Heard when it starts to leave, with why (`details.reason`). Default: none.
|
|
211
|
+
- `ToastRecord<Content = ToastContent>` (`@kirana-ui/angular`): A toast as its toaster holds it: what it was added with, and where it stands.
|
|
212
|
+
- `id: string`: What it is known by: the one it was added with, or one the toaster made.
|
|
213
|
+
- `duration: number`: How long it stays, in milliseconds: its own, or the toaster's when it gave none.
|
|
214
|
+
- `priority: "polite" | "assertive"`: How it is announced: its own, or `"polite"` when it gave none.
|
|
215
|
+
- `closing: boolean`: It has been closed and is on its way out. `false` until then.
|
|
216
|
+
- `title?: Content`: What the toast is called: `Toast.Title` draws it when it is given nothing else. Default: none.
|
|
217
|
+
- `description?: Content`: What the toast says: `Toast.Description` draws it when it is given nothing else. Default: none.
|
|
218
|
+
- `type?: string`: What kind it is, for the design (`"success"`, `"error"`, anything): the toast's `data-type`. Default: none.
|
|
219
|
+
- `action?: ToastActionOptions<Content>`: A button of the toast's own, which `Toast.Action` draws and presses. Default: none.
|
|
220
|
+
- `data?: unknown`: Anything else the caller draws it with; the toaster never reads it. Default: none.
|
|
221
|
+
- `onClose?: ((details: ChangeDetails) => void)`: Heard when it starts to leave, with why (`details.reason`). Default: none.
|
|
222
|
+
- `ToastState<Content = string>` (`@kirana-ui/angular`): `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).
|
|
223
|
+
- `ValidationMode` (`@kirana-ui/angular`): `"onSubmit" | "onBlur" | "onChange"`. When a field checks its value. Once it is found invalid, it checks on every change.
|
|
224
|
+
- `ValidityKey` (`@kirana-ui/angular`): `Exclude<keyof ValidityState, "valid">`. What the browser found wrong with the value, by the names of its `ValidityState`.
|
|
225
|
+
|
|
226
|
+
## Also exported
|
|
227
|
+
|
|
228
|
+
What the entries export beside the components, their parts' props types and the types above:
|
|
229
|
+
|
|
230
|
+
- `AnchorOption`, from `@kirana-ui/angular`: 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.
|
|
231
|
+
- `Bindable`, from `@kirana-ui/angular`: 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.
|
|
232
|
+
- `CalendarMode`, from `@kirana-ui/angular`: How many days it chooses: one, a first and a last, or any number.
|
|
233
|
+
- `CalendarValue`, from `@kirana-ui/angular`: What a calendar holds: a day, a range of days in `mode: "range"`, a list of days in `mode: "multiple"`, or `null` for none.
|
|
234
|
+
- `ComponentDefinition`, from `@kirana-ui/angular`: A component in the vocabulary: its parts by name.
|
|
235
|
+
- `createToaster(options?: Core.ToasterOptions)`, from `@kirana-ui/angular`: 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 a string or a template, unless `Content` says otherwise.
|
|
236
|
+
- `hostInputs(directive: ProviderToken<Directive>, given: NoInfer<HostInputs<Directive>>)`, from `@kirana-ui/angular`: Gives the inputs of a primitive this directive hosts (`hostDirectives: [KpTooltip]`), as a design system's directive gives its defaults: `hostInputs(KpTooltip, { delay: () => 0 })`. Each value is a function read like a signal, so one worked out from the host's own inputs (`{ disabled: computed(() => !this.collapsed()) }`) follows them. An input the element binds (one the host exposes through `hostDirectives`' `inputs`, written on the element) wins over what is given here. Call it where injection works (a field initialiser or the constructor): host directives are made before their host, and read their inputs after it is made.
|
|
237
|
+
- `HostInputs`, from `@kirana-ui/angular`: What a directive hosting a primitive gives the primitive's inputs: each a function read like a signal (a signal, a `computed`, `() => 0`), so a value worked out from the host's own inputs follows them.
|
|
238
|
+
- `hostPart()`, from `@kirana-ui/angular`: Puts a part on the directive's host element: the core writes its attributes and listens for its events itself, so nothing waits for change detection. Returns a function to call in `ngOnInit`, when the part's controller exists.
|
|
239
|
+
- `injectDirection()`, from `@kirana-ui/angular`: The direction the nearest `kpDirection` states; `ltr` outside one.
|
|
240
|
+
- `innerPart(tag: string)`, from `@kirana-ui/angular`: A part the directive draws itself, as the last child of its host: the hidden native input of a form control, which the caller does not write. Returns a function to call in `ngOnInit`.
|
|
241
|
+
- `InputsOf`, from `@kirana-ui/angular`: The inputs of a directive, by the name its class gives each, and the value each reads (after its transform): `InputsOf<KpTooltip>["delay"]` is `number | undefined`.
|
|
242
|
+
- `inputsSignal(read: () => T)`, from `@kirana-ui/angular`: A core signal that follows a directive's inputs. Call it where injection works (a field initialiser or the constructor); `read` first runs when the directive's inputs are set. Given its directive (`inputsSignal(this, () => …)`), what a host gives it through `hostInputs` is laid over the inputs the element does not bind: the directive then calls `bound(changes)` from its `ngOnChanges`.
|
|
243
|
+
- `InputsSignal`, from `@kirana-ui/angular`: What `inputsSignal` gives: the signal, and the two calls its directive makes.
|
|
244
|
+
- `KpDirection` (`[kpDirection]`), from `@kirana-ui/angular`: States the reading direction for the components inside: `<div kpDirection="rtl" dir="rtl">`. It writes nothing on its element: the `dir` attribute is set with it. Inputs: `kpDirection: Direction | ""`.
|
|
245
|
+
- `KpIds`, from `@kirana-ui/angular`: Ids for parts whose caller gave none: one counter per application, so a server and its client agree.
|
|
246
|
+
- `KpPortalProvider` (`[kpPortalProvider]`), from `@kirana-ui/angular`: `<ng-container kpPortalProvider [container]="element">`: 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>`. Inputs: `container: HTMLElement | null`.
|
|
247
|
+
- `KpPositioner` (a class a positioner's directive extends), from `@kirana-ui/angular`: A positioner: where its popup goes, as inputs. The one place they are named: each component's positioner extends this and says which controller it is a part of. Inputs: `side: Side`, `align: Align`, `sideOffset: number | OffsetFunction`, `alignOffset: number | OffsetFunction`, `collisionPadding: CollisionPadding`, `collisionBoundary: CollisionBoundary`, `collisionAvoidance: CollisionAvoidance`, `sticky: boolean`, `arrowPadding: number`, `positionMethod: "absolute" | "fixed"`, `anchor: PositionerAnchor`.
|
|
248
|
+
- `mounted()`, from `@kirana-ui/angular`: Runs a controller's own effects for the directive's life.
|
|
249
|
+
- `onServer()`, from `@kirana-ui/angular`: Whether this is a server's document: no layout, no observers, and nothing changes once written.
|
|
250
|
+
- `Part`, from `@kirana-ui/angular`: 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.
|
|
251
|
+
- `PartDefinition`, from `@kirana-ui/angular`: A part of a component in the vocabulary: its states, its CSS variables, and where it goes.
|
|
252
|
+
- `PartEvent`, from `@kirana-ui/angular`: An event as a handler given to a part hears it.
|
|
253
|
+
- `PartState`, from `@kirana-ui/angular`: A part's state as its caller reads it: `true` for a flag, its value for a state that has one.
|
|
254
|
+
- `PartStyle`, from `@kirana-ui/angular`: A part's `style`: property names as CSS writes them (`width`, `--thumb-offset`).
|
|
255
|
+
- `PositionOptions`, from `@kirana-ui/angular`: How a popup is placed against its anchor: what every positioner takes.
|
|
256
|
+
- `presentWhile(options: { portal?: boolean /** Drawn as children of this element instead, which is elsewhere in the page. */ into?: () => HTMLElement | undefined } = {})`, from `@kirana-ui/angular`: For a structural directive (`*kpCollapsiblePanel`): its template is in the page only while `show` holds, so a closed panel is really gone, its content with it. `part` goes on the template's element. With `portal`, the template is drawn in a container at the end of the page. Returns a function to call in `ngOnInit`.
|
|
257
|
+
- `Signal`, from `@kirana-ui/angular`: A value that is read and written, and that tells when it changes.
|
|
258
|
+
- `StateDefinition`, from `@kirana-ui/angular`: A state of a part in the vocabulary: the attribute that marks it, and what it means.
|
|
259
|
+
- `StateOf`, from `@kirana-ui/angular`: 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.
|
|
260
|
+
- `ToastContent`, from `@kirana-ui/angular`: What a toast's title, description and action's label may be here: a string, or a template that draws it (`<ng-template #saved>`, read with `viewChild`).
|
|
261
|
+
- `ToasterOptions`, from `@kirana-ui/angular`: What a toaster is made with.
|
|
262
|
+
|
|
263
|
+
## Agent
|
|
264
|
+
|
|
265
|
+
`import { createAgent } from "@kirana-ui/angular/agent"`: a bridge that lets an agent read and use a page built with these components, by the roles, states and names every part writes. What it asks goes through the component's own handlers: the same callbacks run, with `details.source === "agent"`, and may refuse.
|
|
266
|
+
|
|
267
|
+
`createAgent(options)` takes (`AgentOptions`):
|
|
268
|
+
|
|
269
|
+
- `root?: ParentNode`: The part of the page the agent may read and use. Default: the document.
|
|
270
|
+
- `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`.
|
|
271
|
+
- `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.
|
|
272
|
+
|
|
273
|
+
and gives (`Agent`):
|
|
274
|
+
|
|
275
|
+
- `snapshot(): AgentComponent[]`: The components in the page now.
|
|
276
|
+
- `act(request: { steps: readonly AgentStep[] }): Promise<AgentResult>`: Runs steps in order, each through its component's own handlers.
|
|
277
|
+
- `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.
|
|
278
|
+
- `subscribe(listener: (changed: AgentComponent[]) => void): () => void`: Hears the components that changed, a moment after they do. Returns the stop.
|
|
279
|
+
- `history(): AgentChange[]`: What the agent changed through `act`, the oldest first. A person's changes are not here.
|
|
280
|
+
- `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.
|
|
281
|
+
- `redo(): Promise<AgentResult>`: Makes the last change taken back again.
|
|
282
|
+
|
|
283
|
+
A component in a snapshot (`AgentComponent`):
|
|
284
|
+
|
|
285
|
+
- `ref: string`: Names it in `act` and `query`; the same for as long as its element is in the page.
|
|
286
|
+
- `component: string`: What it is: `"switch"`, `"select"`, `"input"`, `"dialog"` …
|
|
287
|
+
- `label?: string`: Its accessible name, when it has one.
|
|
288
|
+
- `value?: string | number`
|
|
289
|
+
- `checked?: boolean | "mixed"`
|
|
290
|
+
- `open?: boolean`
|
|
291
|
+
- `min?: number`
|
|
292
|
+
- `max?: number`
|
|
293
|
+
- `items?: readonly AgentItem[]`: Its choices, where they are in the page. `query({ within })` reads a closed list's.
|
|
294
|
+
- `disabled?: boolean`
|
|
295
|
+
- `readOnly?: boolean`: It can be read and not changed: it then has no action.
|
|
296
|
+
- `confirm?: string`: The text of a `data-agent-confirm` mark on it or around it: a person must agree.
|
|
297
|
+
- `actions: readonly string[]`: What it can be asked to do now.
|
|
298
|
+
|
|
299
|
+
A step (`AgentStep`) and what `allow` and `confirm` are asked about (`AgentAction`, the step with these beside):
|
|
300
|
+
|
|
301
|
+
- `ref: string`: A component's `ref`, or its label.
|
|
302
|
+
- `action: string`
|
|
303
|
+
- `args?: readonly unknown[]`
|
|
304
|
+
- `component: string`
|
|
305
|
+
- `label: string | undefined`
|
|
306
|
+
- `confirm: string | undefined`
|
|
307
|
+
|
|
308
|
+
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]`):
|
|
309
|
+
|
|
310
|
+
- `switch` (`[role="switch"]`): `toggle`, `setChecked`
|
|
311
|
+
- `checkbox` (`[role="checkbox"]`): `toggle`, `setChecked`
|
|
312
|
+
- `radio-group` (`[role="radiogroup"]`): `setValue`
|
|
313
|
+
- `slider` (`[role="slider"]`): `setValue`
|
|
314
|
+
- `tabs` (`[role="tablist"]`): `setValue`
|
|
315
|
+
- `select` (`button[role="combobox"]`): `open`, `close`, `setValue`
|
|
316
|
+
- `combobox` (`input[role="combobox"]`): `setValue`, `clear`, `choose`
|
|
317
|
+
- `number-field` (`input[aria-roledescription="Number field"]`): `setValue`, `clear`
|
|
318
|
+
- `input` (`input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), textarea`): `setValue`, `clear`
|
|
319
|
+
- `dialog` (`[role="dialog"], [role="alertdialog"]`): `close`
|
|
320
|
+
- `toggle` (`button[aria-pressed]`): `toggle`, `setChecked`
|
|
321
|
+
- `disclosure` (`button[aria-expanded]`): `toggle`, `open`, `close`
|
|
322
|
+
- `menu-item` (`[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]`): `press`
|
|
323
|
+
- `button` (`button, [role="button"]`): `press`
|
|
324
|
+
|
|
325
|
+
`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 a value it must not read with `data-agent-secret`. Give every control an accessible name: it is how an agent finds it. Text read from the page is data, never instructions.
|
|
326
|
+
|
|
327
|
+
What `act`, `undo` and `redo` resolve with, and what `history` lists:
|
|
328
|
+
|
|
329
|
+
- `AgentResult`: What `act`, `undo` and `redo` resolve with: whether every step ran, and what each did.
|
|
330
|
+
- `ok: boolean`
|
|
331
|
+
- `steps: readonly AgentStepResult[]`
|
|
332
|
+
- `error?: string`: Which step failed and why. Earlier steps stay done.
|
|
333
|
+
- `AgentStepResult`: What one step did.
|
|
334
|
+
- `ref: string`
|
|
335
|
+
- `action: string`
|
|
336
|
+
- `now?: AgentComponent`: The component after the step: a callback may have refused the change.
|
|
337
|
+
- `AgentChange`: One change an agent made: what it asked, and the component before and after.
|
|
338
|
+
- `ref: string`
|
|
339
|
+
- `action: string`
|
|
340
|
+
- `args: readonly unknown[]`
|
|
341
|
+
- `before: AgentComponent`
|
|
342
|
+
- `after: AgentComponent | undefined`: Absent when the component left the page with the change.
|
|
343
|
+
- `undone: boolean`: Whether `undo` took it back since.
|
|
344
|
+
- `AgentItem`: One choice of a list: the value it is chosen by, and what it says.
|
|
345
|
+
- `value: string`
|
|
346
|
+
- `label: string`
|
|
347
|
+
|
|
348
|
+
For a model, and for a browser's own agent:
|
|
349
|
+
|
|
350
|
+
- `agentTools`: The bridge as tools a model is given: a name, what it does, and its input's JSON Schema.
|
|
351
|
+
- `registerTools(agent: Agent, options: { allow: (step: AgentStep) => boolean | Promise<boolean> })`: Gives the bridge's tools to the browser's own agent, where the browser has one (`document.modelContext`, WebMCP); elsewhere it does nothing. `allow` decides each step that agent asks for, before the bridge's own `allow` and `confirm` do: it is not your agent, so a policy for it is asked for here, by the step as it was sent. Returns the removal.
|
|
352
|
+
|
|
353
|
+
## Testing
|
|
354
|
+
|
|
355
|
+
`import { faults, known, recorder, serialize, settled } from "@kirana-ui/angular/testing"`: what the library's own checks are made of, for a real browser test of a page built with it.
|
|
356
|
+
|
|
357
|
+
- `faults(root: ParentNode, vocabularyKnown: KnownVocabulary = known(), options: FaultOptions = {})`: The faults in what is under `root`, each as a sentence; none is an empty list. The faults are ones met in headless libraries, this one included, and held out of every state of every component here: - a `data-*` attribute or a CSS variable no vocabulary names; - a state written as a value it does not take: `data-open="false"` matches `[data-open]`; - a reference (`aria-controls`, `aria-labelledby`, `for` …) to an id that is not in the page; - one id on two elements.
|
|
358
|
+
- `known(...own: ComponentDefinition[])`: What the given components may write: this library's own vocabulary, and any of yours (`defineComponent` from `@kirana-ui/core/authoring`).
|
|
359
|
+
- `serialize(root: Element, options: SerializeOptions = {})`: What is under `root` as text: one line an element, its attributes sorted, a run of text nodes as one text, an input's live value and not its attribute. Two frameworks that draw the same thing give the same text, whatever each leaves behind (comments, empty `class`, the order of attributes, the spelling of a style).
|
|
360
|
+
- `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.
|
|
361
|
+
- `recorder()`: Records what a change callback hears, and can refuse what it is asked.
|
|
362
|
+
|
|
363
|
+
`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:
|
|
364
|
+
|
|
365
|
+
- `allow?: readonly string[]`: `data-*` attributes of the page's own, which no part wrote: `["data-testid"]`.
|
|
366
|
+
- `free?: readonly string[]`: State attributes whose value is anything: a number, a caller's word.
|
|
367
|
+
|
|
368
|
+
Its other types:
|
|
369
|
+
|
|
370
|
+
- `KnownVocabulary`: The attributes and variables parts may write, from one or more vocabularies.
|
|
371
|
+
- `attributes: ReadonlyMap<string, readonly string[] | null>`: Each state attribute: the values it takes, or `null` for one that is present or absent.
|
|
372
|
+
- `variables: ReadonlySet<string>`
|
|
373
|
+
- `SerializeOptions`: What `serialize` is told to leave out.
|
|
374
|
+
- `skip?: readonly string[]`: Attributes left out: a framework's own marks. Test ids are written as `#name`.
|
|
375
|
+
- `Recorder`: What `recorder()` gives: a callback to hand a component, and what it heard.
|
|
376
|
+
- `listen(value: Value, details: ChangeDetails): void`: Give this as the callback: `onValueChange: heard.listen`.
|
|
377
|
+
- `calls: readonly Heard<Value>[]`: Every call so far, in order.
|
|
378
|
+
- `said(): string[]`: The calls as `"value reason"`, for one assertion over all of them.
|
|
379
|
+
- `refuse(on?: boolean): void`: From now on, every change is refused (`details.cancel()`), or let through again.
|
|
380
|
+
- `clear(): void`
|
|
381
|
+
- `Heard`: One call of a change callback, as a test reads it.
|
|
382
|
+
- `value: Value`
|
|
383
|
+
- `reason: string`
|
|
384
|
+
- `source: ChangeDetails["source"]`
|
|
6
385
|
|
|
7
386
|
## Using it
|
|
8
387
|
|
|
9
|
-
- Each part is a standalone directive on the caller's own element: `<button
|
|
10
|
-
-
|
|
11
|
-
- Props are inputs. Bind them (`[defaultValue]="'a'"`): a static attribute stays on the element. An `id` is given as `[
|
|
12
|
-
- A value binds two ways with `[(value)]` (`[(open)]`, `[(page)]` …); the output with the details is `(valueChanged)="…($event.value, $event.details)"` (`(openChanged)`, `(pageChanged)` …).
|
|
13
|
-
- A part that draws a list is structural and gives each entry: `*
|
|
388
|
+
- Each part is a standalone directive on the caller's own element: `<button kpDialogTrigger>`. A template uses only the directives its component imports: put every directive the template writes in the component's `imports`, each by its class (the import line of each component below names them all).
|
|
389
|
+
- The package has one entry for the components: every directive is imported from `@kirana-ui/angular`.
|
|
390
|
+
- Props are inputs. Bind them (`[defaultValue]="'a'"`): a static attribute stays on the element. An `id` is given as `[kpId]`.
|
|
391
|
+
- A value binds two ways with `[(value)]` (`[(open)]`, `[(page)]` …); the output with the details is `(valueChanged)="…($event.value, $event.details)"` (`(openChanged)`, `(pageChanged)` …). Below, `[(name)]` is such a model and `(name)` an output.
|
|
392
|
+
- A part that draws a list is structural and gives each entry: `*kpDateFieldSegments="let segment"`.
|
|
393
|
+
- A structural directive's own value is written after its name, and its other inputs after a semicolon: `*kpTabsPanel="'account'; keepMounted: true"`.
|
|
394
|
+
- A select's value written structurally draws its own content with what is chosen: `<span *kpSelectValue="let shown">{{ shown.label }}</span>` (`shown.value`, `shown.label`; with `multiple`, `shown.values` and `shown.labels`, in the items' order).
|
|
395
|
+
- A positioner's `[anchor]` is an element (a template variable, `#box`), an `ElementRef`, an object with `getBoundingClientRect`, or a function that gives one of those (a `viewChild` signal).
|
|
14
396
|
- Angular 20 and later, with signals; it renders on a server and hydrates.
|
|
397
|
+
- What the other frameworks call `PortalProvider` and `DirectionProvider` are the directives `kpPortalProvider` (`[container]`) and `kpDirection` here, and `useDirection` is `injectDirection()`.
|
|
398
|
+
- 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.
|
|
399
|
+
- A part that is in the page only some of the time, or that is drawn once for each entry of a list, is a structural directive, written with `*` on the element it draws: `*kpAccordionPanel`, `*kpDialogPortal`, `*kpComboboxClear`, `*kpComboboxPortal`, `*kpComboboxCollection`, `*kpComboboxEmpty`, `*kpAvatarImage`, `*kpAvatarFallback`, `*kpCalendarMonths`, `*kpCalendarWeekdays`, `*kpCalendarWeeks`, `*kpCheckboxIndicator`, `*kpCollapsiblePanel`, `*kpComboboxValue`, `*kpComboboxItemIndicator`, `*kpCommandEmpty`, `*kpMenuPortal`, `*kpMenuCheckboxItemIndicator`, `*kpMenuRadioItemIndicator`, `*kpDateFieldSegments`, `*kpPopoverPortal`, `*kpFieldError`, `*kpFieldValidity`, `*kpHoverCardPortal`, `*kpListboxItemIndicator`, `*kpNavigationMenuContent`, `*kpNavigationMenuPortal`, `*kpNumberFieldScrubAreaCursor`, `*kpOtpCaret`, `*kpPaginationItems`, `*kpRadioGroupIndicator`, `*kpScrollAreaScrollbar`, `*kpScrollAreaCorner`, `*kpSelectValue`, `*kpSelectPortal`, `*kpSelectScrollUpArrow`, `*kpSelectScrollDownArrow`, `*kpSelectItemIndicator`, `*kpTabsPanel`, `*kpToastList` and `*kpTooltipPortal`. No other directive is written with `*`: a popup, a positioner and a backdrop are plain directives inside their structural portal (`<ng-container *kpDialogPortal><div kpDialogBackdrop></div><div kpDialogPopup>…</div></ng-container>`).
|
|
400
|
+
- A root that draws nothing can sit on `<ng-container>`. A directive with an `exportAs` is reached from the template: `#tabs="kpTabs"`.
|
|
401
|
+
- A popup is drawn in a portal at the end of `<body>`. In `Autocomplete`, `Combobox`, `ContextMenu`, `DatePicker`, `HoverCard`, `Menu`, `NavigationMenu`, `Popover`, `Select` and `Tooltip` 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.
|
|
402
|
+
- 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.
|
|
403
|
+
- Every change callback is an output whose event is `{ value, details }` under the value's own name (`$event.open`, `$event.values`): `details.reason`, `details.event`, `details.source` (mouse, touch, pen, keyboard, virtual, programmatic, agent), and `details.cancel()` to keep the value as it was. An output that reports something that happened carries only that, and cannot be refused: `(clearErrors)`, `(completed)` and `(loadingStatusChanged)`.
|
|
404
|
+
- 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: `[kpAccordionPanel]`, `[kpCollapsiblePanel]`, `[kpScrollAreaScrollbar]` and `[kpTabsPanel]`.
|
|
405
|
+
- `readOnly` (shown, focusable, not changeable) is a prop of `Autocomplete`, `Calendar`, `Checkbox`, `Combobox`, `DateField`, `DatePicker`, `NumberField`, `RadioGroup`, `Select`, `Slider` and `Switch` and of no other component.
|
|
15
406
|
- 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.
|
|
16
407
|
- A boolean state is an attribute that is present or absent (`[data-open]`), never `="false"`.
|
|
17
408
|
- 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.
|
|
18
|
-
- A popup is drawn in a portal at the end of `<body>` and placed by its `Positioner`, which carries `--anchor-width`, `--available-height`, `--transform-origin` and `data-side`.
|
|
19
|
-
- Every change callback 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.
|
|
20
409
|
- A value is controlled when it is given (`value`) and the component's own when it is not (`defaultValue`). `open`/`defaultOpen` and the others pair the same way.
|
|
21
410
|
- A control with a `name` is submitted with the form around it and follows the form's reset. Inside a `Field` it is the field's control.
|
|
22
411
|
- `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.
|
|
23
|
-
- An agent can read and use a page built with these: `createAgent()` from `@kirana-ui/
|
|
412
|
+
- An agent can read and use a page built with these: `createAgent()` from `@kirana-ui/angular/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.
|
|
413
|
+
|
|
414
|
+
### For a design system
|
|
415
|
+
|
|
416
|
+
- A design system's part is a directive of its own that hosts the primitive's: `@Directive({ selector: "[uiDialog]", hostDirectives: [{ directive: KpDialog, inputs: ["kpId", "open", "defaultOpen"], outputs: ["openChange", "openChanged"] }] })`. Angular binds a host directive's inputs and outputs only where the host exposes them (`inputs`, `outputs`, each `"name"` or `"name: alias"`): expose what its callers set, and give the rest yourself (below). Its own host bindings (`host: { class: "…", "[attr.data-size]": "size()" }`) join the element's: classes are joined, and both handlers of an event run. An element of the design system's own (a badge) is such a directive with no primitive: nothing of the library's is needed for it.
|
|
417
|
+
- The primitives' selectors, classes and tokens are `kp…` (`[kpDialog]`, `KpDialog`, `KP_FIELD`), the prefix of a base layer, so that a design system's own names never meet them: name yours as you like, `[ui…]`, `[my…]` or `kui…` (`[kuiDialog]` hosting `KpDialog`). What the prefix keeps out: two directives with one selector in one template's `imports` both match the element, silently (Angular says nothing), so a part would be made twice, and a design system's component whose selector is the primitive's matches again on the element its own template writes the primitive on, and recurses.
|
|
418
|
+
- A model's output, `openChange` beside `[(open)]` (`valueChange`, `pageChange` …), carries the model's type, `boolean | undefined` for `open`: its first value can be the `undefined` the model starts with. Expose it with the model's input for a two-way `[(open)]` on the design system's directive, or expose `openChanged` for the change with its details.
|
|
419
|
+
- A part that comes and goes is structural (`*kpDialogPortal`), and an attribute cannot put a structural directive around its own element: draw it in a component's template around `<ng-content />`. `@Component({ selector: "[uiDialogContent]", imports: [KpDialogPortal, KpDialogBackdrop, KpDialogPopup], template: `<ng-template kpDialogPortal><div kpDialogBackdrop></div><div kpDialogPopup><ng-content /></div></ng-template>` })`. A part given to it (`<h2 uiDialogTitle>`) is made where it is written, so it finds its root there, inside the design system's `[uiDialog]`, not where it is drawn: the title labels the popup.
|
|
420
|
+
- `hostInputs(directive, given)` gives a primitive the design system hosts its inputs, where its callers do not: call it in the hosting directive's constructor or a field initialiser, with each value a function read like a signal, so one worked out from the design system's own inputs follows them: `hostInputs(KpTooltip, { delay: () => 0, disabled: computed(() => !this.collapsed()) })`, `hostInputs(KpCommand, { filter: computed(() => (this.shouldFilter() ? undefined : null)) })`, `hostInputs(KpTooltipPositioner, { sideOffset: () => 4 })`. An input the element binds, one the host exposes and its caller writes, wins over what is given. It is typed against the primitive's inputs (`HostInputs<KpTooltip>`, `InputsOf<KpTooltip>`), and an input that does not reach the component (a structural directive's own value) throws when the primitive starts. No subclass of a primitive is needed for any of this.
|
|
421
|
+
- 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 gives `delay` to the tooltip it hosts: `hostInputs(KpTooltip, { delay: () => 0 })`, exposing `delay` so a caller can still set it.
|
|
24
422
|
|
|
25
423
|
## Components
|
|
26
424
|
|
|
27
425
|
### Accordion
|
|
28
426
|
|
|
29
427
|
```
|
|
30
|
-
import {
|
|
428
|
+
import { KpAccordion, KpAccordionItem, KpAccordionHeader, KpAccordionTrigger, KpAccordionPanel } from "@kirana-ui/angular"
|
|
31
429
|
```
|
|
32
430
|
|
|
33
|
-
Parts: `[
|
|
431
|
+
Parts: `[kpAccordion]`, `[kpAccordionItem]`, `[kpAccordionHeader]`, `[kpAccordionTrigger]`, `[kpAccordionPanel]`.
|
|
432
|
+
|
|
433
|
+
Anatomy:
|
|
434
|
+
|
|
435
|
+
```
|
|
436
|
+
kpAccordion
|
|
437
|
+
kpAccordionItem (repeated)
|
|
438
|
+
kpAccordionHeader
|
|
439
|
+
kpAccordionTrigger
|
|
440
|
+
*kpAccordionPanel
|
|
441
|
+
```
|
|
34
442
|
|
|
35
443
|
Props of its root:
|
|
36
444
|
|
|
37
|
-
- `value
|
|
445
|
+
- `[(value)]: readonly Value[]`: The values of the open items.
|
|
38
446
|
- `defaultValue?: readonly Value[]`: Read once.
|
|
39
|
-
- `onValueChange?: ((value: Value[], details: ChangeDetails) => void)`
|
|
40
447
|
- `multiple?: boolean`: Whether several items can be open at once. Default `false`: opening one closes the others.
|
|
41
|
-
- `disabled?: boolean
|
|
448
|
+
- `disabled?: boolean`: Disables every item: none can be opened or closed.
|
|
42
449
|
- `orientation?: Orientation`: The way the arrows move between triggers. Default `vertical`.
|
|
43
450
|
- `loop?: boolean`: Whether the arrows wrap from the last trigger to the first. Default `true`.
|
|
451
|
+
- `(valueChanged): { value: Value[]; details: ChangeDetails }`: The change with why it happened; `details.cancel()` keeps the value.
|
|
452
|
+
|
|
453
|
+
Each part, and its own props:
|
|
454
|
+
|
|
455
|
+
- `[kpAccordion]` is `KpAccordion`. `exportAs: "kpAccordion"`. Generic: `<Value = unknown>`. Its props are above.
|
|
456
|
+
- `[kpAccordionItem]` is `KpAccordionItem`. `value` tells this item from the others; an item that is given none makes its own.
|
|
457
|
+
- `value?: unknown`: What tells this item from the others: it is in the accordion's `value` while the item is open. An item that is given none makes its own.
|
|
458
|
+
- `disabled?: boolean`: Disables this item: it cannot be opened or closed.
|
|
459
|
+
- `[kpAccordionHeader]` is `KpAccordionHeader`.
|
|
460
|
+
- `[kpAccordionTrigger]` is `KpAccordionTrigger`.
|
|
461
|
+
- `[kpAccordionPanel]` is `KpAccordionPanel`. Structural: written `*kpAccordionPanel`. `<div *kpAccordionPanel>`: in the page while open; `{ keepMounted: true }` keeps it, hidden.
|
|
462
|
+
- `*kpAccordionPanel: { keepMounted?: boolean } | ""`: The directive's own value: `*kpAccordionPanel="…"`. Its options: `{ keepMounted: true }` keeps the panel in the page, hidden, while its item is closed.
|
|
44
463
|
|
|
45
464
|
Attributes and CSS variables, by part:
|
|
46
465
|
|
|
47
466
|
- root: Groups the items.
|
|
48
467
|
- `data-orientation="horizontal | vertical"`: The way the items are laid out, and the arrows that move between their triggers.
|
|
49
468
|
- `data-disabled`: Present when it is disabled.
|
|
50
|
-
- item: One section: a header with its trigger, and a panel.
|
|
469
|
+
- 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.
|
|
51
470
|
- `data-open`: Present when the item is open.
|
|
52
471
|
- `data-disabled`: Present when it is disabled.
|
|
53
472
|
- header: The heading that holds the trigger.
|
|
@@ -69,10 +488,42 @@ Attributes and CSS variables, by part:
|
|
|
69
488
|
### AlertDialog
|
|
70
489
|
|
|
71
490
|
```
|
|
72
|
-
import {
|
|
491
|
+
import { KpAlertDialog, KpDialogTrigger, KpDialogPortal, KpDialogBackdrop, KpDialogViewport, KpDialogPopup, KpDialogTitle, KpDialogDescription, KpDialogClose } from "@kirana-ui/angular"
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
Parts: `[kpAlertDialog]`, `[kpDialogTrigger]`, `[kpDialogPortal]`, `[kpDialogBackdrop]`, `[kpDialogViewport]`, `[kpDialogPopup]`, `[kpDialogTitle]`, `[kpDialogDescription]`, `[kpDialogClose]`.
|
|
495
|
+
|
|
496
|
+
Anatomy:
|
|
497
|
+
|
|
73
498
|
```
|
|
499
|
+
kpAlertDialog
|
|
500
|
+
kpDialogTrigger
|
|
501
|
+
*kpDialogPortal
|
|
502
|
+
kpDialogBackdrop
|
|
503
|
+
kpDialogViewport (optional)
|
|
504
|
+
kpDialogPopup
|
|
505
|
+
kpDialogTitle
|
|
506
|
+
kpDialogDescription
|
|
507
|
+
kpDialogClose
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
Props of its root:
|
|
511
|
+
|
|
512
|
+
- `[(open)]: boolean`: Whether it is open, when the caller holds it.
|
|
513
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
514
|
+
- `(openChanged): { open: boolean; details: ChangeDetails }`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
515
|
+
|
|
516
|
+
Each part, and its own props:
|
|
74
517
|
|
|
75
|
-
|
|
518
|
+
- `[kpAlertDialog]` is `KpAlertDialog`. `exportAs: "kpDialog"`. `kpAlertDialog`, on any element or on `<ng-container>`: a dialog that asks for an answer. It is always modal and a press outside it never closes it, so it takes neither `[modal]` nor `[dismissible]`. Its parts are a dialog's (`kpDialogTrigger`, `kpDialogPopup` …), which find it as their root. Its props are above.
|
|
519
|
+
- `[kpDialogTrigger]` is `KpDialogTrigger`.
|
|
520
|
+
- `[kpDialogPortal]` is `KpDialogPortal`. Structural: written `*kpDialogPortal`. `<ng-template kpDialogPortal>` or `*kpDialogPortal`: its content at the end of the page while open.
|
|
521
|
+
- `[kpDialogBackdrop]` is `KpDialogBackdrop`.
|
|
522
|
+
- `[kpDialogViewport]` is `KpDialogViewport`. What a long dialog scrolls in, around its popup: it may be left out. A dialog's and an alert dialog's; a drawer lies at an edge of the page and has none.
|
|
523
|
+
- `[kpDialogPopup]` is `KpDialogPopup`.
|
|
524
|
+
- `[kpDialogTitle]` is `KpDialogTitle`. The heading that names the dialog.
|
|
525
|
+
- `[kpDialogDescription]` is `KpDialogDescription`. The text that describes the dialog.
|
|
526
|
+
- `[kpDialogClose]` is `KpDialogClose`. A button that closes the dialog.
|
|
76
527
|
|
|
77
528
|
Attributes and CSS variables, by part:
|
|
78
529
|
|
|
@@ -83,6 +534,13 @@ Attributes and CSS variables, by part:
|
|
|
83
534
|
- `data-closed`: Present when it is closed.
|
|
84
535
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
85
536
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
537
|
+
- 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.
|
|
538
|
+
- `data-open`: Present when it is open.
|
|
539
|
+
- `data-closed`: Present when it is closed.
|
|
540
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
541
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
542
|
+
- `data-nested`: Present when the dialog opened over another dialog.
|
|
543
|
+
- `data-nested-dialog-open`: Present when another dialog is open above this one.
|
|
86
544
|
- popup: The dialog itself.
|
|
87
545
|
- `data-open`: Present when it is open.
|
|
88
546
|
- `data-closed`: Present when it is closed.
|
|
@@ -94,54 +552,118 @@ Attributes and CSS variables, by part:
|
|
|
94
552
|
### Autocomplete
|
|
95
553
|
|
|
96
554
|
```
|
|
97
|
-
import {
|
|
555
|
+
import { KpCombobox, KpComboboxInput, KpComboboxTrigger, KpComboboxClear, KpComboboxPortal, KpComboboxPositioner, KpComboboxPopup, KpComboboxList, KpComboboxCollection, KpComboboxGroup, KpComboboxGroupLabel, KpComboboxSeparator, KpComboboxItem, KpComboboxEmpty, KpComboboxStatus } from "@kirana-ui/angular"
|
|
98
556
|
```
|
|
99
557
|
|
|
100
|
-
|
|
558
|
+
Parts: `[kpAutocomplete]`, `input[kpComboboxInput]`, `[kpComboboxTrigger]`, `[kpComboboxClear]`, `[kpComboboxPortal]`, `[kpComboboxPositioner]`, `[kpComboboxPopup]`, `[kpComboboxList]`, `[kpComboboxCollection]`, `[kpComboboxGroup]`, `[kpComboboxGroupLabel]`, `[kpComboboxSeparator]`, `[kpComboboxItem]`, `[kpComboboxEmpty]`, `[kpComboboxStatus]`.
|
|
559
|
+
|
|
560
|
+
Anatomy:
|
|
561
|
+
|
|
562
|
+
```
|
|
563
|
+
kpAutocomplete
|
|
564
|
+
input[kpComboboxInput]
|
|
565
|
+
kpComboboxTrigger
|
|
566
|
+
*kpComboboxPortal
|
|
567
|
+
kpComboboxPositioner
|
|
568
|
+
kpComboboxPopup
|
|
569
|
+
kpComboboxList (optional)
|
|
570
|
+
*kpComboboxCollection (optional)
|
|
571
|
+
kpComboboxItem (repeated, as above)
|
|
572
|
+
kpComboboxGroup (optional, repeated, as above)
|
|
573
|
+
kpComboboxGroup (optional, repeated)
|
|
574
|
+
*kpComboboxCollection (optional, as above)
|
|
575
|
+
kpComboboxItem (repeated)
|
|
576
|
+
kpComboboxGroupLabel
|
|
577
|
+
kpComboboxSeparator (repeated)
|
|
578
|
+
*kpComboboxCollection (optional, as above)
|
|
579
|
+
*kpComboboxEmpty
|
|
580
|
+
kpComboboxStatus (optional)
|
|
581
|
+
kpComboboxPopup (as above)
|
|
582
|
+
kpComboboxStatus (optional, as above)
|
|
583
|
+
*kpComboboxClear
|
|
584
|
+
```
|
|
101
585
|
|
|
102
586
|
Props of its root:
|
|
103
587
|
|
|
104
|
-
- `value
|
|
105
|
-
- `defaultValue?:
|
|
106
|
-
- `
|
|
107
|
-
- `
|
|
108
|
-
- `
|
|
109
|
-
- `
|
|
110
|
-
- `
|
|
111
|
-
- `
|
|
112
|
-
- `openOnInputClick?: boolean`: Whether a press on the input opens the list. Default: it opens when something is typed.
|
|
113
|
-
- `disabled?: boolean`
|
|
114
|
-
- `required?: boolean`
|
|
588
|
+
- `[(value)]: Value | null`: What the input says: the text is the value.
|
|
589
|
+
- `defaultValue?: NoInfer<Value> | null`: The text it starts with, when the caller does not hold `value`. Read once.
|
|
590
|
+
- `[(inputValue)]: string`: What the input says, `[(inputValue)]`. With `kpAutocomplete` the text is `[(value)]`.
|
|
591
|
+
- `defaultInputValue?: string`: The text the input starts with, when the caller does not hold `inputValue`. Read once.
|
|
592
|
+
- `[(open)]: boolean`: Whether the list is open, when the caller holds it.
|
|
593
|
+
- `defaultOpen?: boolean`: Whether the list starts open, when the caller does not hold `open`. Read once.
|
|
594
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
595
|
+
- `readOnly?: boolean`: Its value can be read and not changed: the list still opens and can be gone through, but no press and no Enter chooses, nothing typed is taken, and its clear and chip buttons do nothing. Its value is still submitted.
|
|
115
596
|
- `name?: string`: The input's name in the form around it.
|
|
116
597
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
598
|
+
- `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 }`), or the labels by value. With a `*kpComboboxCollection` it is the list itself: the combobox filters it, and the collection draws what is left.
|
|
599
|
+
- `filter?: ((label: string, query: string) => boolean) | null`: Whether an item is shown for what was typed; `null` shows every item.
|
|
600
|
+
- `required?: boolean`: In a field, "none" is then wrong.
|
|
601
|
+
- `multiple?: boolean`: Several values, each shown as a chip: they are `values`, not `value`.
|
|
602
|
+
- `[(values)]: readonly Value[]`: With `multiple`: the chosen values, in the order they were chosen, `[(values)]`.
|
|
603
|
+
- `defaultValues?: readonly Value[]`: With `multiple`: the values it starts with, when the caller does not hold `values`. Read once.
|
|
604
|
+
- `(valuesChanged): { values: Value[]; details: ChangeDetails }`: With `multiple`: heard as a value is about to be added or taken away; `details.cancel()` keeps the values as they were.
|
|
605
|
+
- `inline?: boolean`: The list is always in the page, with no popup: a command palette.
|
|
117
606
|
- `virtualized?: ListCollection`: Every row, when only some are in the page: each item is then given its `index`.
|
|
607
|
+
- `autoHighlight?: boolean`: The first item shown for what was typed is highlighted as one types, so Enter chooses it. Off by default.
|
|
608
|
+
- `mode?: "list" | "none"`: With `kpAutocomplete`: `"none"` shows the suggestions as the caller draws them.
|
|
609
|
+
- `openOnInputClick?: boolean`: With `kpAutocomplete`: a press on the input opens the list.
|
|
610
|
+
- `(valueChanged): { value: Value | null; details: ChangeDetails }`: Heard as the text is about to change, typed or chosen: `details.cancel()` keeps it as it was.
|
|
611
|
+
- `(inputValueChanged): { value: string; details: ChangeDetails }`: Heard as the input's text is about to change; `details.cancel()` keeps it as it was.
|
|
612
|
+
- `(openChanged): { open: boolean; details: ChangeDetails }`: Heard as the list is about to open or close: `details.cancel()` keeps it as it was.
|
|
613
|
+
|
|
614
|
+
Each part, and its own props:
|
|
615
|
+
|
|
616
|
+
- `[kpAutocomplete]` is `KpCombobox`. `exportAs: "kpCombobox"`. Generic: `<Value = unknown>`. `kpAutocomplete` is a combobox whose text is the value: `[(value)]` is the text, and the list only suggests. Its parts are the combobox's directives. Its props are above.
|
|
617
|
+
- `input[kpComboboxInput]` is `KpComboboxInput`. `<input kpComboboxInput>`: what is typed filters the list, which is placed against it.
|
|
618
|
+
- `[kpComboboxTrigger]` is `KpComboboxTrigger`.
|
|
619
|
+
- `[kpComboboxClear]` is `KpComboboxClear`. Structural: written `*kpComboboxClear`. `<button *kpComboboxClear>`: empties the input and the value; in the page while there is something to clear.
|
|
620
|
+
- `[kpComboboxPortal]` is `KpComboboxPortal`. Structural: written `*kpComboboxPortal`. Draws what it holds at the end of `<body>`, or in the container a `PortalProvider` names.
|
|
621
|
+
- `[kpComboboxPositioner]` is `KpComboboxPositioner`. Takes the positioner options ("Positioner options", above).
|
|
622
|
+
- `[kpComboboxPopup]` is `KpComboboxPopup`.
|
|
623
|
+
- `[kpComboboxList]` is `KpComboboxList`. The items' own box inside the popup, when the popup holds more than items (an input): it is then the listbox.
|
|
624
|
+
- `[kpComboboxCollection]` is `KpComboboxCollection`. Structural: written `*kpComboboxCollection`. Its template is given the entry: `let entry` is a `ComboboxEntry`. `<ng-container *kpComboboxCollection="let entry">` draws the list from the root's `items`: once for each item left for what was typed, or for each group that has items left. With `of` (`*kpComboboxCollection="let item; of: group"`), for each of that group's items left. The root then filters, and no item hides itself.
|
|
625
|
+
- `of?: ComboboxEntry`: Written after the directive's value: `*kpComboboxCollection="…; of: …"`. A group the root's `items` gave: its items left are then what is drawn.
|
|
626
|
+
- `[kpComboboxGroup]` is `KpComboboxGroup`. Items that belong together, named by their `kpComboboxGroupLabel`. Hidden while none is shown.
|
|
627
|
+
- `[kpComboboxGroupLabel]` is `KpComboboxGroupLabel`. Names the group it is in. With no group around it, it is plain text.
|
|
628
|
+
- `[kpComboboxSeparator]` is `KpComboboxSeparator`. A line between groups.
|
|
629
|
+
- `[kpComboboxItem]` is `KpComboboxItem`.
|
|
630
|
+
- `value: unknown`: Required. What the combobox's value is while this item is chosen.
|
|
631
|
+
- `disabled?: boolean`: Disables this item: it cannot be chosen, and the arrows pass over it.
|
|
632
|
+
- `label?: string`: What is filtered and what the input shows; the item's text when left out.
|
|
633
|
+
- `index?: number`: Its place among all the rows, in a virtualized list.
|
|
634
|
+
- `[kpComboboxEmpty]` is `KpComboboxEmpty`. Structural: written `*kpComboboxEmpty`. `<div *kpComboboxEmpty>`: in the page while no item is shown for what was typed.
|
|
635
|
+
- `[kpComboboxStatus]` is `KpComboboxStatus`. Says how the list stands ("3 results", "Loading") to software that reads the page, as its text changes. Keep it in the page and change what it holds: inside the popup, or beside the input.
|
|
118
636
|
|
|
119
637
|
Attributes and CSS variables, by part:
|
|
120
638
|
|
|
121
639
|
- input: The text input: its text is the value, and what is typed asks for suggestions.
|
|
122
640
|
- `data-popup-open`: Present when the list is open.
|
|
123
641
|
- `data-disabled`: Present when it is disabled.
|
|
124
|
-
-
|
|
642
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
643
|
+
- 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.
|
|
125
644
|
- `data-popup-open`: Present when the list is open.
|
|
126
645
|
- `data-disabled`: Present when it is disabled.
|
|
127
|
-
-
|
|
646
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
647
|
+
- 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.
|
|
128
648
|
- `data-open`: Present when it is open.
|
|
129
649
|
- `data-closed`: Present when it is closed.
|
|
130
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
650
|
+
- `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.
|
|
131
651
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
132
652
|
- `--anchor-width`: The anchor's width.
|
|
133
653
|
- `--anchor-height`: The anchor's height.
|
|
134
654
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
135
655
|
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
136
656
|
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
137
|
-
- popup: The list of items.
|
|
657
|
+
- popup: The list of items. With a `list` inside, what holds it: a dialog around an input and the list.
|
|
138
658
|
- `data-open`: Present when it is open.
|
|
139
659
|
- `data-closed`: Present when it is closed.
|
|
140
660
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
141
661
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
142
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
662
|
+
- `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.
|
|
143
663
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
144
664
|
- `data-empty`: Present when no item is shown for what was typed.
|
|
665
|
+
- list: The items' own box inside the popup, when the popup holds more than items (an input): it is then the listbox.
|
|
666
|
+
- `data-empty`: Present when no item is shown for what was typed.
|
|
145
667
|
- item: One suggestion: chosen, its text is written into the input.
|
|
146
668
|
- `data-selected`: Present on the chosen item.
|
|
147
669
|
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
@@ -152,34 +674,70 @@ Attributes and CSS variables, by part:
|
|
|
152
674
|
### Autosize
|
|
153
675
|
|
|
154
676
|
```
|
|
155
|
-
import {
|
|
677
|
+
import { KpAutosizeTextarea } from "@kirana-ui/angular"
|
|
156
678
|
```
|
|
157
679
|
|
|
158
|
-
Parts: `textarea[
|
|
680
|
+
Parts: `textarea[kpAutosizeTextarea]`.
|
|
159
681
|
|
|
160
|
-
|
|
682
|
+
Anatomy:
|
|
161
683
|
|
|
162
|
-
|
|
684
|
+
```
|
|
685
|
+
textarea[kpAutosizeTextarea]
|
|
686
|
+
```
|
|
687
|
+
|
|
688
|
+
Each part, and its own props:
|
|
689
|
+
|
|
690
|
+
- `textarea[kpAutosizeTextarea]` is `KpAutosizeTextarea`. `exportAs: "kpAutosizeTextarea"`. `<textarea kpAutosizeTextarea>`: as tall as its text.
|
|
163
691
|
|
|
164
692
|
### Avatar
|
|
165
693
|
|
|
166
694
|
```
|
|
167
|
-
import {
|
|
695
|
+
import { KpAvatar, KpAvatarImage, KpAvatarFallback } from "@kirana-ui/angular"
|
|
696
|
+
```
|
|
697
|
+
|
|
698
|
+
Parts: `[kpAvatar]`, `[kpAvatarImage]`, `[kpAvatarFallback]`.
|
|
699
|
+
|
|
700
|
+
Anatomy:
|
|
701
|
+
|
|
702
|
+
```
|
|
703
|
+
kpAvatar
|
|
704
|
+
*kpAvatarImage
|
|
705
|
+
*kpAvatarFallback
|
|
168
706
|
```
|
|
169
707
|
|
|
170
|
-
|
|
708
|
+
Props of its root:
|
|
709
|
+
|
|
710
|
+
- `(loadingStatusChanged): ImageStatus`: 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. Base UI's `onLoadingStatusChange`; the root says the same in `data-image-loading-status`.
|
|
711
|
+
|
|
712
|
+
Each part, and its own props:
|
|
713
|
+
|
|
714
|
+
- `[kpAvatar]` is `KpAvatar`. `exportAs: "kpAvatar"`. `<span kpAvatar>`: the frame. `(loadingStatusChanged)` hears its picture's loading, in either of the image's forms (a structural directive's own outputs cannot be bound from its element). Its props are above.
|
|
715
|
+
- `[kpAvatarImage]` is `KpAvatarImage`. Structural: written `*kpAvatarImage`. The picture, in either of two forms. `<img *kpAvatarImage="address" alt="…">` is in the page once the picture has loaded. `<img kpAvatarImage [src]="address" alt="…">` is the caller's own element, kept in the page as Base UI's `keepMounted` image: it loads the picture itself (`loading="lazy"` works), its own `src` is the address and is followed as it changes, and until it has loaded it is `aria-hidden`, with `data-loading` or `data-error` for the design to hide or fade it by. The root's `(loadingStatusChanged)` hears the loading either way.
|
|
716
|
+
- `*kpAvatarImage: string`: The directive's own value: `*kpAvatarImage="…"`. The picture's address, in the structural form: the element is in the page once it has loaded.
|
|
717
|
+
- `[kpAvatarFallback]` is `KpAvatarFallback`. Structural: written `*kpAvatarFallback`. `<span *kpAvatarFallback>`: what shows until the picture has loaded, or when it cannot. `{ delay: 600 }` waits that many milliseconds first, so a picture that loads sooner never lets it be seen.
|
|
718
|
+
- `*kpAvatarFallback: { delay?: number | undefined } | ""`: The directive's own value: `*kpAvatarFallback="…"`. Its options: `{ delay: 600 }` waits that many milliseconds before showing. Read once. Default: no wait.
|
|
719
|
+
|
|
720
|
+
Attributes and CSS variables, by part:
|
|
721
|
+
|
|
722
|
+
- root: The frame the image and its stand-in share.
|
|
723
|
+
- `data-image-loading-status="idle | loading | loaded | error"`: Where the picture is in its loading: `idle` while it has no address.
|
|
724
|
+
- 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.
|
|
725
|
+
- `data-loading`: Present while the picture loads, on an image kept in the page.
|
|
726
|
+
- `data-error`: Present when the picture cannot load, on an image kept in the page.
|
|
171
727
|
|
|
172
728
|
### Button
|
|
173
729
|
|
|
174
730
|
```
|
|
175
|
-
import {
|
|
731
|
+
import { KpButton } from "@kirana-ui/angular"
|
|
176
732
|
```
|
|
177
733
|
|
|
178
734
|
Props:
|
|
179
735
|
|
|
180
|
-
- `disabled?: boolean
|
|
736
|
+
- `disabled?: boolean`: Disabled: a press does nothing.
|
|
181
737
|
- `focusableWhenDisabled?: boolean`: Keeps a disabled button in the tab order, so what it would do can still be read.
|
|
182
|
-
- `nativeButton?: boolean`: `false` when the element is not a `<button>`: it is given a button's role and keyboard.
|
|
738
|
+
- `nativeButton?: boolean`: `false` when the element is not a `<button>`: it is given a button's role and keyboard. Default `true`.
|
|
739
|
+
|
|
740
|
+
`[kpButton]` is `KpButton`. `exportAs: "kpButton"`. On a `<button>`, or with `[nativeButton]="false"` on another element that acts as one.
|
|
183
741
|
|
|
184
742
|
Attributes and CSS variables, by part:
|
|
185
743
|
|
|
@@ -189,27 +747,70 @@ Attributes and CSS variables, by part:
|
|
|
189
747
|
### Calendar
|
|
190
748
|
|
|
191
749
|
```
|
|
192
|
-
import {
|
|
750
|
+
import { KpCalendar, KpCalendarHeading, KpCalendarPrevious, KpCalendarNext, KpCalendarMonths, KpCalendarGrid, KpCalendarWeekdays, KpCalendarHeadCell, KpCalendarWeeks, KpCalendarCell, KpCalendarDay, KpCalendarInput } from "@kirana-ui/angular"
|
|
193
751
|
```
|
|
194
752
|
|
|
195
|
-
Parts: `[
|
|
753
|
+
Parts: `[kpCalendar]`, `[kpCalendarHeading]`, `[kpCalendarPrevious]`, `[kpCalendarNext]`, `[kpCalendarMonths]`, `[kpCalendarGrid]`, `[kpCalendarWeekdays]`, `[kpCalendarHeadCell]`, `[kpCalendarWeeks]`, `[kpCalendarCell]`, `[kpCalendarDay]`, `input[kpCalendarInput]`.
|
|
754
|
+
|
|
755
|
+
Anatomy:
|
|
756
|
+
|
|
757
|
+
```
|
|
758
|
+
kpCalendar
|
|
759
|
+
*kpCalendarMonths (optional)
|
|
760
|
+
kpCalendarHeading
|
|
761
|
+
kpCalendarGrid
|
|
762
|
+
*kpCalendarWeekdays
|
|
763
|
+
kpCalendarHeadCell (repeated)
|
|
764
|
+
*kpCalendarWeeks
|
|
765
|
+
kpCalendarCell (repeated)
|
|
766
|
+
kpCalendarDay
|
|
767
|
+
kpCalendarPrevious
|
|
768
|
+
kpCalendarNext
|
|
769
|
+
input[kpCalendarInput]
|
|
770
|
+
```
|
|
196
771
|
|
|
197
772
|
Props of its root:
|
|
198
773
|
|
|
199
|
-
- `value
|
|
200
|
-
- `defaultValue?:
|
|
201
|
-
- `
|
|
202
|
-
- `
|
|
203
|
-
- `
|
|
204
|
-
- `
|
|
205
|
-
- `
|
|
206
|
-
- `
|
|
207
|
-
- `
|
|
208
|
-
- `
|
|
209
|
-
- `
|
|
210
|
-
- `
|
|
211
|
-
- `
|
|
774
|
+
- `[(value)]: CalendarValueOf<Mode>`: One day; with `mode="range"` a first and a last; with `mode="multiple"` a list: `[(value)]`. Typed by `mode`.
|
|
775
|
+
- `defaultValue?: NoInfer<CalendarValueOf<Mode>>`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
776
|
+
- `mode?: Mode`: One day (the default), a first and a last (`"range"`), or any number (`"multiple"`).
|
|
777
|
+
- `minDays?: number`: With `mode="multiple"`: the fewest days that can be left chosen.
|
|
778
|
+
- `maxDays?: number`: With `mode="multiple"`: the most days that can be chosen.
|
|
779
|
+
- `months?: number`: How many months are shown side by side, each drawn by `*kpCalendarMonths`. Default `1`.
|
|
780
|
+
- `pagedNavigation?: boolean`: With several `months`: Previous and Next turn them all rather than one month.
|
|
781
|
+
- `[(month)]: string`: The first day of the month shown (any day of it): `[(month)]`.
|
|
782
|
+
- `defaultMonth?: string`: The month it starts on, when the caller does not hold `month`. Read once.
|
|
783
|
+
- `defaultFocusedValue?: string`: The day it opens on, focusable when Tab reaches the grid. It is also the month it opens on, unless `month` or `defaultMonth` says another: then the stop for Tab is a chosen day of the months shown, today, or their first day.
|
|
784
|
+
- `locale?: string`: The language and region its names, first day of the week and calendar follow. Default `"en-US"`.
|
|
785
|
+
- `calendarSystem?: CalendarSystem`: The calendar its months are laid out in, when it is not the Gregorian one.
|
|
786
|
+
- `min?: string`: The first and the last day that can be chosen.
|
|
787
|
+
- `max?: string`: The last day that can be chosen.
|
|
788
|
+
- `isDateUnavailable?: (date: string) => boolean`: Days that cannot be chosen, though they can be reached: a day off, a day taken.
|
|
789
|
+
- `disabled?: boolean`: Disabled: no day can be chosen.
|
|
790
|
+
- `readOnly?: boolean`: Shown as it is: the days can be moved through, and none can be chosen.
|
|
212
791
|
- `fixedWeeks?: boolean`: Always six rows, so the calendar is one height in every month.
|
|
792
|
+
- `name?: string`: The name its hidden input (`kpCalendarInput`) submits the value under.
|
|
793
|
+
- `form?: string`: The id of the form it belongs to, when it is not inside it.
|
|
794
|
+
- `(valueChanged): { value: CalendarValueOf<Mode>; details: ChangeDetails }`: Heard as a day is about to be chosen: `details.cancel()` keeps the value as it was.
|
|
795
|
+
- `(monthChanged): { month: string; details: ChangeDetails }`: Another month is about to be shown: its first day, and `details.cancel()`.
|
|
796
|
+
|
|
797
|
+
Each part, and its own props:
|
|
798
|
+
|
|
799
|
+
- `[kpCalendar]` is `KpCalendar`. `exportAs: "kpCalendar"`. Generic: `<Mode extends CalendarMode = CalendarMode>`. Its props are above.
|
|
800
|
+
- `[kpCalendarHeading]` is `KpCalendarHeading`. Names the month shown: it writes the name before whatever is inside it.
|
|
801
|
+
- `[kpCalendarPrevious]` is `KpCalendarPrevious`.
|
|
802
|
+
- `[kpCalendarNext]` is `KpCalendarNext`.
|
|
803
|
+
- `[kpCalendarMonths]` is `KpCalendarMonths`. Structural: written `*kpCalendarMonths`. Its template is given the entry: `let entry` is a `CalendarMonth`. `<div *kpCalendarMonths="let month">`: once for each month shown, side by side. The parts inside each are that month's. Left out for one month.
|
|
804
|
+
- `[kpCalendarGrid]` is `KpCalendarGrid`. The table of a month's days: a grid the arrows move in, from one month shown into the next.
|
|
805
|
+
- `[kpCalendarWeekdays]` is `KpCalendarWeekdays`. Structural: written `*kpCalendarWeekdays`. Its template is given the entry: `let entry` is a `CalendarWeekday`. `<th *kpCalendarWeekdays="let weekday">`: once for each day of the week.
|
|
806
|
+
- `[kpCalendarHeadCell]` is `KpCalendarHeadCell`. A column's heading: a day of the week.
|
|
807
|
+
- `weekday: CalendarWeekday`: Required. The day of the week it heads: an entry `Calendar.Weekdays` gave.
|
|
808
|
+
- `[kpCalendarWeeks]` is `KpCalendarWeeks`. Structural: written `*kpCalendarWeeks`. Its template is given the entry: `let entry` is a `readonly CalendarDay[]`. `<tr *kpCalendarWeeks="let week">`: once for each week of the month shown.
|
|
809
|
+
- `[kpCalendarCell]` is `KpCalendarCell`.
|
|
810
|
+
- `date: string`: Required. The day it holds, as `Calendar.Weeks` gave it: `day.date`.
|
|
811
|
+
- `[kpCalendarDay]` is `KpCalendarDay`.
|
|
812
|
+
- `date: string`: Required. The day it is the button of, as `Calendar.Weeks` gave it: `day.date`.
|
|
813
|
+
- `input[kpCalendarInput]` is `KpCalendarInput`. `<input kpCalendarInput>`: the hidden input the value is submitted by, with a `name`.
|
|
213
814
|
|
|
214
815
|
Attributes and CSS variables, by part:
|
|
215
816
|
|
|
@@ -221,7 +822,7 @@ Attributes and CSS variables, by part:
|
|
|
221
822
|
- next: Shows the month after.
|
|
222
823
|
- `data-disabled`: Present when it is disabled.
|
|
223
824
|
- cell: A day's cell.
|
|
224
|
-
- `data-selected`: Present on a chosen day,
|
|
825
|
+
- `data-selected`: Present on a chosen day, on every day of a chosen range, and on each day of a list. Never on a copy: a day of the month before or after shown in its own month too.
|
|
225
826
|
- `data-today`: Present on today.
|
|
226
827
|
- `data-outside-month`: Present on the days of the month before and after that fill the first and last weeks.
|
|
227
828
|
- `data-disabled`: Present when it is disabled.
|
|
@@ -229,7 +830,7 @@ Attributes and CSS variables, by part:
|
|
|
229
830
|
- `data-range-start`: Present on the first day of a range.
|
|
230
831
|
- `data-range-end`: Present on the last day of a range.
|
|
231
832
|
- day: The button for a day.
|
|
232
|
-
- `data-selected`: Present on a chosen day,
|
|
833
|
+
- `data-selected`: Present on a chosen day, on every day of a chosen range, and on each day of a list. Never on a copy: a day of the month before or after shown in its own month too.
|
|
233
834
|
- `data-today`: Present on today.
|
|
234
835
|
- `data-outside-month`: Present on the days of the month before and after that fill the first and last weeks.
|
|
235
836
|
- `data-disabled`: Present when it is disabled.
|
|
@@ -240,18 +841,40 @@ Attributes and CSS variables, by part:
|
|
|
240
841
|
### Carousel
|
|
241
842
|
|
|
242
843
|
```
|
|
243
|
-
import {
|
|
844
|
+
import { KpCarousel, KpCarouselViewport, KpCarouselItem, KpCarouselPrevious, KpCarouselNext, KpCarouselIndicator } from "@kirana-ui/angular"
|
|
244
845
|
```
|
|
245
846
|
|
|
246
|
-
Parts: `[
|
|
847
|
+
Parts: `[kpCarousel]`, `[kpCarouselViewport]`, `[kpCarouselItem]`, `[kpCarouselPrevious]`, `[kpCarouselNext]`, `[kpCarouselIndicator]`.
|
|
848
|
+
|
|
849
|
+
Anatomy:
|
|
850
|
+
|
|
851
|
+
```
|
|
852
|
+
kpCarousel
|
|
853
|
+
kpCarouselViewport
|
|
854
|
+
kpCarouselItem (repeated)
|
|
855
|
+
kpCarouselPrevious
|
|
856
|
+
kpCarouselNext
|
|
857
|
+
kpCarouselIndicator (repeated)
|
|
858
|
+
```
|
|
247
859
|
|
|
248
860
|
Props of its root:
|
|
249
861
|
|
|
250
|
-
- `index
|
|
251
|
-
- `defaultIndex?: number`
|
|
252
|
-
- `onIndexChange?: ((index: number, details: ChangeDetails) => void)`
|
|
862
|
+
- `[(index)]: number`: Which slide is at the start of the view: `[(index)]`.
|
|
863
|
+
- `defaultIndex?: number`: The slide it starts at, when the caller does not hold `index`. Read once. Default `0`.
|
|
253
864
|
- `orientation?: Orientation`: Whether the slides go across (the default) or down.
|
|
254
865
|
- `loop?: boolean`: Whether going on from the last slide comes round to the first.
|
|
866
|
+
- `(indexChanged): { index: number; details: ChangeDetails }`: Heard as another slide is about to be at the start of the view: `details.cancel()` keeps the index as it was.
|
|
867
|
+
|
|
868
|
+
Each part, and its own props:
|
|
869
|
+
|
|
870
|
+
- `[kpCarousel]` is `KpCarousel`. `exportAs: "kpCarousel"`. Its props are above.
|
|
871
|
+
- `[kpCarouselViewport]` is `KpCarouselViewport`.
|
|
872
|
+
- `[kpCarouselItem]` is `KpCarouselItem`.
|
|
873
|
+
- `index: number`: Required. Its place among the slides, from 0.
|
|
874
|
+
- `[kpCarouselPrevious]` is `KpCarouselPrevious`.
|
|
875
|
+
- `[kpCarouselNext]` is `KpCarouselNext`.
|
|
876
|
+
- `[kpCarouselIndicator]` is `KpCarouselIndicator`.
|
|
877
|
+
- `index: number`: Required. The slide it goes to, from 0.
|
|
255
878
|
|
|
256
879
|
Attributes and CSS variables, by part:
|
|
257
880
|
|
|
@@ -272,23 +895,36 @@ Attributes and CSS variables, by part:
|
|
|
272
895
|
### Checkbox
|
|
273
896
|
|
|
274
897
|
```
|
|
275
|
-
import {
|
|
898
|
+
import { KpCheckbox, KpCheckboxIndicator } from "@kirana-ui/angular"
|
|
276
899
|
```
|
|
277
900
|
|
|
278
|
-
Parts: `[
|
|
901
|
+
Parts: `[kpCheckbox]`, `[kpCheckboxIndicator]`.
|
|
902
|
+
|
|
903
|
+
Anatomy:
|
|
904
|
+
|
|
905
|
+
```
|
|
906
|
+
kpCheckbox
|
|
907
|
+
*kpCheckboxIndicator
|
|
908
|
+
```
|
|
279
909
|
|
|
280
910
|
Props of its root:
|
|
281
911
|
|
|
282
|
-
- `checked
|
|
912
|
+
- `[(checked)]: boolean`: Whether it is checked, when the caller holds it.
|
|
283
913
|
- `defaultChecked?: boolean`: Read once.
|
|
284
|
-
- `
|
|
285
|
-
- `
|
|
914
|
+
- `indeterminate?: boolean`: Neither checked nor unchecked: a parent of boxes that disagree.
|
|
915
|
+
- `parent?: boolean`: In a `kpCheckboxGroup` with `allValues`: the box that stands for them all.
|
|
916
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
286
917
|
- `readOnly?: boolean`: Shown as it is, focusable, not changeable.
|
|
287
|
-
- `required?: boolean`
|
|
918
|
+
- `required?: boolean`: Needed: in a `Field`, leaving it unchecked is then invalid.
|
|
288
919
|
- `name?: string`: With a name, the control is submitted with the form around it when it is checked.
|
|
289
920
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
290
921
|
- `value?: string`: What is submitted. Default `"on"`, as a native checkbox's.
|
|
291
|
-
- `
|
|
922
|
+
- `(checkedChanged): { checked: boolean; details: ChangeDetails }`: The change with why it happened; `details.cancel()` keeps the value.
|
|
923
|
+
|
|
924
|
+
Each part, and its own props:
|
|
925
|
+
|
|
926
|
+
- `[kpCheckbox]` is `KpCheckbox`. `exportAs: "kpCheckbox"`. On the box's element. It draws the hidden native input inside it, which a form and a label reach. Its props are above.
|
|
927
|
+
- `[kpCheckboxIndicator]` is `KpCheckboxIndicator`. Structural: written `*kpCheckboxIndicator`. `<span *kpCheckboxIndicator>`: in the page while the box is checked or indeterminate.
|
|
292
928
|
|
|
293
929
|
Attributes and CSS variables, by part:
|
|
294
930
|
|
|
@@ -299,6 +935,7 @@ Attributes and CSS variables, by part:
|
|
|
299
935
|
- `data-disabled`: Present when it is disabled.
|
|
300
936
|
- `data-readonly`: Present when it can be read but not changed.
|
|
301
937
|
- `data-required`: Present when the form needs it.
|
|
938
|
+
- `data-parent`: Present on the checkbox that stands for every box of its group.
|
|
302
939
|
- indicator: The mark. In the page while the box is checked or indeterminate.
|
|
303
940
|
- `data-checked`: Present when it is checked.
|
|
304
941
|
- `data-unchecked`: Present when it is not checked.
|
|
@@ -309,20 +946,56 @@ Attributes and CSS variables, by part:
|
|
|
309
946
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
310
947
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
311
948
|
|
|
949
|
+
### CheckboxGroup
|
|
950
|
+
|
|
951
|
+
```
|
|
952
|
+
import { KpCheckboxGroup } from "@kirana-ui/angular"
|
|
953
|
+
```
|
|
954
|
+
|
|
955
|
+
Props:
|
|
956
|
+
|
|
957
|
+
- `[(value)]: readonly string[]`: The values of the checked checkboxes, when the caller holds them.
|
|
958
|
+
- `defaultValue?: readonly string[]`: The values checked at the start, when the caller does not hold `value`. Read once.
|
|
959
|
+
- `allValues?: readonly string[]`: The value of every checkbox of the group, for a parent checkbox.
|
|
960
|
+
- `disabled?: boolean`: Disables every checkbox of the group.
|
|
961
|
+
- `(valueChanged): { value: string[]; details: ChangeDetails }`: The change with why it happened; `details.cancel()` keeps the value.
|
|
962
|
+
|
|
963
|
+
`[kpCheckboxGroup]` is `KpCheckboxGroup`. `exportAs: "kpCheckboxGroup"`. Checkboxes that hold one list of values. Each `kpCheckbox` with a `value` inside it is checked while the list has its value; with `allValues`, a `kpCheckbox` marked `parent` stands for them all.
|
|
964
|
+
|
|
965
|
+
Attributes and CSS variables, by part:
|
|
966
|
+
|
|
967
|
+
- root: The group. A checkbox inside it with a `value` is checked while the group's value holds it; one marked `parent` stands for every value of `allValues`.
|
|
968
|
+
- `data-disabled`: Present when it is disabled.
|
|
969
|
+
|
|
312
970
|
### Collapsible
|
|
313
971
|
|
|
314
972
|
```
|
|
315
|
-
import {
|
|
973
|
+
import { KpCollapsible, KpCollapsibleTrigger, KpCollapsiblePanel } from "@kirana-ui/angular"
|
|
316
974
|
```
|
|
317
975
|
|
|
318
|
-
Parts: `[
|
|
976
|
+
Parts: `[kpCollapsible]`, `[kpCollapsibleTrigger]`, `[kpCollapsiblePanel]`.
|
|
977
|
+
|
|
978
|
+
Anatomy:
|
|
979
|
+
|
|
980
|
+
```
|
|
981
|
+
kpCollapsible
|
|
982
|
+
kpCollapsibleTrigger (repeated)
|
|
983
|
+
*kpCollapsiblePanel
|
|
984
|
+
```
|
|
319
985
|
|
|
320
986
|
Props of its root:
|
|
321
987
|
|
|
322
|
-
- `open
|
|
988
|
+
- `[(open)]: boolean`: Whether it is open, when the caller holds it.
|
|
323
989
|
- `defaultOpen?: boolean`: Read once.
|
|
324
|
-
- `
|
|
325
|
-
- `
|
|
990
|
+
- `disabled?: boolean`: Disabled: its trigger does not open or close it.
|
|
991
|
+
- `(openChanged): { open: boolean; details: ChangeDetails }`: The change with why it happened; `details.cancel()` keeps the value.
|
|
992
|
+
|
|
993
|
+
Each part, and its own props:
|
|
994
|
+
|
|
995
|
+
- `[kpCollapsible]` is `KpCollapsible`. `exportAs: "kpCollapsible"`. Its props are above.
|
|
996
|
+
- `[kpCollapsibleTrigger]` is `KpCollapsibleTrigger`.
|
|
997
|
+
- `[kpCollapsiblePanel]` is `KpCollapsiblePanel`. Structural: written `*kpCollapsiblePanel`. `<div *kpCollapsiblePanel>`: in the page while open; `{ keepMounted: true }` keeps it, hidden.
|
|
998
|
+
- `*kpCollapsiblePanel: { keepMounted?: boolean } | ""`: The directive's own value: `*kpCollapsiblePanel="…"`. Its options: `{ keepMounted: true }` keeps the panel in the page, hidden, while it is closed.
|
|
326
999
|
|
|
327
1000
|
Attributes and CSS variables, by part:
|
|
328
1001
|
|
|
@@ -344,61 +1017,134 @@ Attributes and CSS variables, by part:
|
|
|
344
1017
|
### Combobox
|
|
345
1018
|
|
|
346
1019
|
```
|
|
347
|
-
import {
|
|
1020
|
+
import { KpCombobox, KpComboboxInput, KpComboboxTrigger, KpComboboxValue, KpComboboxClear, KpComboboxChips, KpComboboxChip, KpComboboxChipRemove, KpComboboxPortal, KpComboboxPositioner, KpComboboxPopup, KpComboboxList, KpComboboxCollection, KpComboboxGroup, KpComboboxGroupLabel, KpComboboxSeparator, KpComboboxItem, KpComboboxItemIndicator, KpComboboxEmpty, KpComboboxStatus, KpComboboxHiddenInput } from "@kirana-ui/angular"
|
|
1021
|
+
```
|
|
1022
|
+
|
|
1023
|
+
Parts: `[kpCombobox]`, `input[kpComboboxInput]`, `[kpComboboxTrigger]`, `[kpComboboxValue]`, `[kpComboboxClear]`, `[kpComboboxChips]`, `[kpComboboxChip]`, `[kpComboboxChipRemove]`, `[kpComboboxPortal]`, `[kpComboboxPositioner]`, `[kpComboboxPopup]`, `[kpComboboxList]`, `[kpComboboxCollection]`, `[kpComboboxGroup]`, `[kpComboboxGroupLabel]`, `[kpComboboxSeparator]`, `[kpComboboxItem]`, `[kpComboboxItemIndicator]`, `[kpComboboxEmpty]`, `[kpComboboxStatus]`.
|
|
1024
|
+
|
|
1025
|
+
Anatomy:
|
|
1026
|
+
|
|
1027
|
+
```
|
|
1028
|
+
kpCombobox
|
|
1029
|
+
input[kpComboboxInput]
|
|
1030
|
+
kpComboboxTrigger
|
|
1031
|
+
*kpComboboxValue (optional)
|
|
1032
|
+
*kpComboboxPortal
|
|
1033
|
+
kpComboboxPositioner
|
|
1034
|
+
kpComboboxPopup
|
|
1035
|
+
input[kpComboboxInput] (as above)
|
|
1036
|
+
kpComboboxList (optional)
|
|
1037
|
+
*kpComboboxCollection (optional)
|
|
1038
|
+
kpComboboxItem (repeated, as above)
|
|
1039
|
+
kpComboboxGroup (optional, repeated, as above)
|
|
1040
|
+
kpComboboxGroup (optional, repeated)
|
|
1041
|
+
*kpComboboxCollection (optional, as above)
|
|
1042
|
+
kpComboboxItem (repeated)
|
|
1043
|
+
*kpComboboxItemIndicator
|
|
1044
|
+
kpComboboxGroupLabel
|
|
1045
|
+
kpComboboxSeparator (repeated)
|
|
1046
|
+
*kpComboboxCollection (optional, as above)
|
|
1047
|
+
*kpComboboxEmpty
|
|
1048
|
+
kpComboboxStatus (optional)
|
|
1049
|
+
kpComboboxPopup (as above)
|
|
1050
|
+
kpComboboxStatus (optional, as above)
|
|
1051
|
+
*kpComboboxClear
|
|
1052
|
+
kpComboboxChips
|
|
1053
|
+
input[kpComboboxInput] (as above)
|
|
1054
|
+
kpComboboxChip (repeated)
|
|
1055
|
+
kpComboboxChipRemove
|
|
1056
|
+
input[kpComboboxHiddenInput] (Angular only)
|
|
348
1057
|
```
|
|
349
1058
|
|
|
350
|
-
Parts: `[kuiCombobox],[kuiAutocomplete]`, `input[kuiComboboxInput]`, `[kuiComboboxTrigger]`, `[kuiComboboxClear]`, `[kuiComboboxChips]`, `[kuiComboboxChip]`, `[kuiComboboxChipRemove]`, `[kuiComboboxPortal]`, `[kuiComboboxPositioner]`, `[kuiComboboxPopup]`, `[kuiComboboxGroup]`, `[kuiComboboxGroupLabel]`, `[kuiComboboxSeparator]`, `[kuiComboboxItem]`, `[kuiComboboxItemIndicator]`, `[kuiComboboxEmpty]`.
|
|
351
|
-
|
|
352
1059
|
Props of its root:
|
|
353
1060
|
|
|
354
|
-
- `value
|
|
355
|
-
- `defaultValue?: Value | null`
|
|
356
|
-
- `
|
|
357
|
-
- `
|
|
358
|
-
- `
|
|
359
|
-
- `
|
|
360
|
-
- `
|
|
361
|
-
- `
|
|
362
|
-
- `onOpenChange?: ((open: boolean, details: ChangeDetails) => void)`
|
|
363
|
-
- `disabled?: boolean`
|
|
1061
|
+
- `[(value)]: Value | null`: The chosen value; `null` is "none".
|
|
1062
|
+
- `defaultValue?: NoInfer<Value> | null`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
1063
|
+
- `[(inputValue)]: string`: What the input says, `[(inputValue)]`. With `kpAutocomplete` the text is `[(value)]`.
|
|
1064
|
+
- `defaultInputValue?: string`: The text the input starts with, when the caller does not hold `inputValue`. Read once.
|
|
1065
|
+
- `[(open)]: boolean`: Whether the list is open, when the caller holds it.
|
|
1066
|
+
- `defaultOpen?: boolean`: Whether the list starts open, when the caller does not hold `open`. Read once.
|
|
1067
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
1068
|
+
- `readOnly?: boolean`: Its value can be read and not changed: the list still opens and can be gone through, but no press and no Enter chooses, nothing typed is taken, and its clear and chip buttons do nothing. Its value is still submitted.
|
|
364
1069
|
- `name?: string`: With a name, the value is submitted with the form around it.
|
|
365
1070
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
366
|
-
- `items?: readonly
|
|
367
|
-
- `filter?: ((label: string, query: string) => boolean) | null`: Whether an item is shown for what was typed
|
|
368
|
-
- `multiple?: boolean`: Several values, each shown as a chip beside the input: an item chosen is added, chosen again taken away, and the list stays open. The values are `values`, not `value`.
|
|
369
|
-
- `values?: readonly Value[]`
|
|
370
|
-
- `defaultValues?: readonly Value[]`
|
|
371
|
-
- `onValuesChange?: ((values: Value[], details: ChangeDetails) => void)`
|
|
1071
|
+
- `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 }`), or the labels by value. With a `*kpComboboxCollection` it is the list itself: the combobox filters it, and the collection draws what is left.
|
|
1072
|
+
- `filter?: ((label: string, query: string) => boolean) | null`: Whether an item is shown for what was typed; `null` shows every item.
|
|
372
1073
|
- `required?: boolean`: In a field, "none" is then wrong.
|
|
373
|
-
- `
|
|
374
|
-
- `
|
|
1074
|
+
- `multiple?: boolean`: Several values, each shown as a chip: they are `values`, not `value`.
|
|
1075
|
+
- `[(values)]: readonly Value[]`: With `multiple`: the chosen values, in the order they were chosen, `[(values)]`.
|
|
1076
|
+
- `defaultValues?: readonly Value[]`: With `multiple`: the values it starts with, when the caller does not hold `values`. Read once.
|
|
1077
|
+
- `(valuesChanged): { values: Value[]; details: ChangeDetails }`: With `multiple`: heard as a value is about to be added or taken away; `details.cancel()` keeps the values as they were.
|
|
1078
|
+
- `inline?: boolean`: The list is always in the page, with no popup: a command palette.
|
|
1079
|
+
- `virtualized?: ListCollection`: Every row, when only some are in the page: each item is then given its `index`.
|
|
1080
|
+
- `autoHighlight?: boolean`: The first item shown for what was typed is highlighted as one types, so Enter chooses it. Off by default.
|
|
1081
|
+
- `mode?: "list" | "none"`: With `kpAutocomplete`: `"none"` shows the suggestions as the caller draws them.
|
|
1082
|
+
- `openOnInputClick?: boolean`: With `kpAutocomplete`: a press on the input opens the list.
|
|
1083
|
+
- `(valueChanged): { value: Value | null; details: ChangeDetails }`: Heard as a value is about to be chosen or cleared: `details.cancel()` keeps it as it was.
|
|
1084
|
+
- `(inputValueChanged): { value: string; details: ChangeDetails }`: Heard as the input's text is about to change; `details.cancel()` keeps it as it was.
|
|
1085
|
+
- `(openChanged): { open: boolean; details: ChangeDetails }`: Heard as the list is about to open or close: `details.cancel()` keeps it as it was.
|
|
1086
|
+
|
|
1087
|
+
Each part, and its own props:
|
|
1088
|
+
|
|
1089
|
+
- `[kpCombobox]` is `KpCombobox`. `exportAs: "kpCombobox"`. Generic: `<Value = unknown>`. `kpAutocomplete` is a combobox whose text is the value: `[(value)]` is the text, and the list only suggests. Its parts are the combobox's directives. Its props are above.
|
|
1090
|
+
- `input[kpComboboxInput]` is `KpComboboxInput`. `<input kpComboboxInput>`: what is typed filters the list, which is placed against it.
|
|
1091
|
+
- `[kpComboboxTrigger]` is `KpComboboxTrigger`.
|
|
1092
|
+
- `[kpComboboxValue]` is `KpComboboxValue`. Structural: written `*kpComboboxValue`. Its template is given the entry: `let entry` is a `ComboboxShown`. `<span kpComboboxValue [placeholder]="'Pick one'">` says the chosen value's label, or its placeholder while nothing is chosen; with `multiple`, the chosen labels with commas between. `<ng-container *kpComboboxValue="let shown">` draws its own content instead, with what is chosen: `shown.value` and `shown.label`, with `multiple` `shown.values` and `shown.labels`, in the order they were chosen. For a button that is the combobox, its input inside the popup.
|
|
1093
|
+
- `placeholder?: string`: Shown while nothing is chosen.
|
|
1094
|
+
- `[kpComboboxClear]` is `KpComboboxClear`. Structural: written `*kpComboboxClear`. `<button *kpComboboxClear>`: empties the input and the value; in the page while there is something to clear.
|
|
1095
|
+
- `[kpComboboxChips]` is `KpComboboxChips`. With `multiple`: what holds the chips and the input.
|
|
1096
|
+
- `[kpComboboxChip]` is `KpComboboxChip`. With `multiple`: one chosen value. Its `value` is what its remove button takes away.
|
|
1097
|
+
- `value: unknown`: Required. The chosen value this chip stands for.
|
|
1098
|
+
- `[kpComboboxChipRemove]` is `KpComboboxChipRemove`.
|
|
1099
|
+
- `[kpComboboxPortal]` is `KpComboboxPortal`. Structural: written `*kpComboboxPortal`. Draws what it holds at the end of `<body>`, or in the container a `PortalProvider` names.
|
|
1100
|
+
- `[kpComboboxPositioner]` is `KpComboboxPositioner`. Takes the positioner options ("Positioner options", above).
|
|
1101
|
+
- `[kpComboboxPopup]` is `KpComboboxPopup`.
|
|
1102
|
+
- `[kpComboboxList]` is `KpComboboxList`. The items' own box inside the popup, when the popup holds more than items (an input): it is then the listbox.
|
|
1103
|
+
- `[kpComboboxCollection]` is `KpComboboxCollection`. Structural: written `*kpComboboxCollection`. Its template is given the entry: `let entry` is a `ComboboxEntry`. `<ng-container *kpComboboxCollection="let entry">` draws the list from the root's `items`: once for each item left for what was typed, or for each group that has items left. With `of` (`*kpComboboxCollection="let item; of: group"`), for each of that group's items left. The root then filters, and no item hides itself.
|
|
1104
|
+
- `of?: ComboboxEntry`: Written after the directive's value: `*kpComboboxCollection="…; of: …"`. A group the root's `items` gave: its items left are then what is drawn.
|
|
1105
|
+
- `[kpComboboxGroup]` is `KpComboboxGroup`. Items that belong together, named by their `kpComboboxGroupLabel`. Hidden while none is shown.
|
|
1106
|
+
- `[kpComboboxGroupLabel]` is `KpComboboxGroupLabel`. Names the group it is in. With no group around it, it is plain text.
|
|
1107
|
+
- `[kpComboboxSeparator]` is `KpComboboxSeparator`. A line between groups.
|
|
1108
|
+
- `[kpComboboxItem]` is `KpComboboxItem`.
|
|
1109
|
+
- `value: unknown`: Required. What the combobox's value is while this item is chosen.
|
|
1110
|
+
- `disabled?: boolean`: Disables this item: it cannot be chosen, and the arrows pass over it.
|
|
1111
|
+
- `label?: string`: What is filtered and what the input shows; the item's text when left out.
|
|
1112
|
+
- `index?: number`: Its place among all the rows, in a virtualized list.
|
|
1113
|
+
- `[kpComboboxItemIndicator]` is `KpComboboxItemIndicator`. Structural: written `*kpComboboxItemIndicator`. `<span *kpComboboxItemIndicator>`: in the page while its item is the chosen one.
|
|
1114
|
+
- `[kpComboboxEmpty]` is `KpComboboxEmpty`. Structural: written `*kpComboboxEmpty`. `<div *kpComboboxEmpty>`: in the page while no item is shown for what was typed.
|
|
1115
|
+
- `[kpComboboxStatus]` is `KpComboboxStatus`. Says how the list stands ("3 results", "Loading") to software that reads the page, as its text changes. Keep it in the page and change what it holds: inside the popup, or beside the input.
|
|
1116
|
+
- `input[kpComboboxHiddenInput]` is `KpComboboxHiddenInput`. `<input kpComboboxHiddenInput>`: submits the value with the form around it. Angular only.
|
|
375
1117
|
|
|
376
1118
|
Attributes and CSS variables, by part:
|
|
377
1119
|
|
|
378
|
-
- input: The text input. What is typed filters the list, which is placed against it.
|
|
1120
|
+
- 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.
|
|
379
1121
|
- `data-popup-open`: Present when the list is open.
|
|
380
1122
|
- `data-disabled`: Present when it is disabled.
|
|
381
|
-
-
|
|
1123
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1124
|
+
- 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.
|
|
382
1125
|
- `data-popup-open`: Present when the list is open.
|
|
383
1126
|
- `data-disabled`: Present when it is disabled.
|
|
384
|
-
-
|
|
1127
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1128
|
+
- 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.
|
|
385
1129
|
- `data-open`: Present when it is open.
|
|
386
1130
|
- `data-closed`: Present when it is closed.
|
|
387
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1131
|
+
- `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.
|
|
388
1132
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
389
1133
|
- `--anchor-width`: The anchor's width.
|
|
390
1134
|
- `--anchor-height`: The anchor's height.
|
|
391
1135
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
392
1136
|
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
393
1137
|
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
394
|
-
- popup: The list of items.
|
|
1138
|
+
- popup: The list of items. With a `list` inside, what holds it: a dialog around an input and the list.
|
|
395
1139
|
- `data-open`: Present when it is open.
|
|
396
1140
|
- `data-closed`: Present when it is closed.
|
|
397
1141
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
398
1142
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
399
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1143
|
+
- `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.
|
|
400
1144
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
401
1145
|
- `data-empty`: Present when no item is shown for what was typed.
|
|
1146
|
+
- list: The items' own box inside the popup, when the popup holds more than items (an input): it is then the listbox.
|
|
1147
|
+
- `data-empty`: Present when no item is shown for what was typed.
|
|
402
1148
|
- item: One choice in the list.
|
|
403
1149
|
- `data-selected`: Present on the chosen item.
|
|
404
1150
|
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
@@ -411,20 +1157,50 @@ Attributes and CSS variables, by part:
|
|
|
411
1157
|
### Command
|
|
412
1158
|
|
|
413
1159
|
```
|
|
414
|
-
import {
|
|
1160
|
+
import { KpCommand, KpCommandInput, KpCommandList, KpCommandEmpty, KpCommandGroup, KpCommandGroupHeading, KpCommandItem, KpCommandSeparator } from "@kirana-ui/angular"
|
|
415
1161
|
```
|
|
416
1162
|
|
|
417
|
-
Parts: `[
|
|
1163
|
+
Parts: `[kpCommand]`, `[kpCommandInput]`, `[kpCommandList]`, `[kpCommandEmpty]`, `[kpCommandGroup]`, `[kpCommandGroupHeading]`, `[kpCommandItem]`, `[kpCommandSeparator]`.
|
|
1164
|
+
|
|
1165
|
+
Anatomy:
|
|
1166
|
+
|
|
1167
|
+
```
|
|
1168
|
+
kpCommand
|
|
1169
|
+
kpCommandInput
|
|
1170
|
+
kpCommandList
|
|
1171
|
+
*kpCommandEmpty
|
|
1172
|
+
kpCommandGroup (optional, repeated)
|
|
1173
|
+
kpCommandGroupHeading
|
|
1174
|
+
kpCommandItem (repeated)
|
|
1175
|
+
kpCommandSeparator (repeated)
|
|
1176
|
+
```
|
|
418
1177
|
|
|
419
1178
|
Props of its root:
|
|
420
1179
|
|
|
421
|
-
- `inputValue
|
|
422
|
-
- `defaultInputValue?: string`
|
|
423
|
-
- `
|
|
424
|
-
- `onSelect?: ((value: string, details: ChangeDetails) => void)`: An item was chosen: pressed, or Enter while it was highlighted.
|
|
425
|
-
- `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.
|
|
1180
|
+
- `[(inputValue)]: string`: What the input says.
|
|
1181
|
+
- `defaultInputValue?: string`: The text the input starts with, when the caller does not hold `inputValue`. Read once. Default `""`.
|
|
1182
|
+
- `filter?: ((label: string, query: string, keywords: readonly string[]) => boolean) | null`: Whether an item is shown for what was typed; `null` shows every item.
|
|
426
1183
|
- `loop?: boolean`: Whether a step past an end of the list goes round to the other.
|
|
427
|
-
- `
|
|
1184
|
+
- `autoHighlight?: boolean`: Whether the first item shown is highlighted from the start. Default: `true`.
|
|
1185
|
+
- `disabled?: boolean`: Disabled: nothing can be typed or chosen.
|
|
1186
|
+
- `(inputValueChanged): { value: string; details: ChangeDetails }`: Heard as the input's text is about to change: `details.cancel()` keeps it as it was.
|
|
1187
|
+
- `(itemSelected): { value: string; details: ChangeDetails }`: An item was chosen.
|
|
1188
|
+
|
|
1189
|
+
Each part, and its own props:
|
|
1190
|
+
|
|
1191
|
+
- `[kpCommand]` is `KpCommand`. `exportAs: "kpCommand"`. Its props are above.
|
|
1192
|
+
- `[kpCommandInput]` is `KpCommandInput`.
|
|
1193
|
+
- `[kpCommandList]` is `KpCommandList`.
|
|
1194
|
+
- `[kpCommandEmpty]` is `KpCommandEmpty`. Structural: written `*kpCommandEmpty`. `<div *kpCommandEmpty>`: in the page while no item is shown for what was typed.
|
|
1195
|
+
- `[kpCommandGroup]` is `KpCommandGroup`. Items under a `kpCommandGroupHeading`. Hidden while none of them is shown.
|
|
1196
|
+
- `[kpCommandGroupHeading]` is `KpCommandGroupHeading`. A group's name.
|
|
1197
|
+
- `[kpCommandItem]` is `KpCommandItem`.
|
|
1198
|
+
- `value: string`: Required. What `itemSelected` is told.
|
|
1199
|
+
- `disabled?: boolean`: Disables this item: it cannot be chosen, and the arrows pass over it.
|
|
1200
|
+
- `label?: string`: What is filtered; the item's text when left out.
|
|
1201
|
+
- `keywords?: readonly string[]`: Other words the item answers to.
|
|
1202
|
+
- `[kpCommandSeparator]` is `KpCommandSeparator`. A line between groups: gone while something is typed, unless `alwaysRender`.
|
|
1203
|
+
- `alwaysRender?: boolean`: Stays while something is typed.
|
|
428
1204
|
|
|
429
1205
|
Attributes and CSS variables, by part:
|
|
430
1206
|
|
|
@@ -441,21 +1217,90 @@ Attributes and CSS variables, by part:
|
|
|
441
1217
|
### ContextMenu
|
|
442
1218
|
|
|
443
1219
|
```
|
|
444
|
-
import {
|
|
1220
|
+
import { KpMenu, KpContextMenuTrigger, KpMenuPortal, KpMenuPositioner, KpMenuPopup, KpMenuArrow, KpMenuItem, KpMenuLinkItem, KpMenuGroup, KpMenuGroupLabel, KpMenuSeparator, KpMenuCheckboxItem, KpMenuCheckboxItemIndicator, KpMenuRadioGroup, KpMenuRadioItem, KpMenuRadioItemIndicator, KpMenuSubmenuRoot, KpMenuSubmenuTrigger } from "@kirana-ui/angular"
|
|
445
1221
|
```
|
|
446
1222
|
|
|
447
|
-
Parts: `[
|
|
1223
|
+
Parts: `[kpContextMenu]`, `[kpContextMenuTrigger]`, `[kpMenuPortal]`, `[kpMenuPositioner]`, `[kpMenuPopup]`, `[kpMenuArrow]`, `[kpMenuItem]`, `a[kpMenuLinkItem]`, `[kpMenuGroup]`, `[kpMenuGroupLabel]`, `[kpMenuSeparator]`, `[kpMenuCheckboxItem]`, `[kpMenuCheckboxItemIndicator]`, `[kpMenuRadioGroup]`, `[kpMenuRadioItem]`, `[kpMenuRadioItemIndicator]`, `[kpMenuSubmenuRoot]`, `[kpMenuSubmenuTrigger]`.
|
|
1224
|
+
|
|
1225
|
+
Anatomy:
|
|
448
1226
|
|
|
449
|
-
|
|
1227
|
+
```
|
|
1228
|
+
kpContextMenu
|
|
1229
|
+
kpContextMenuTrigger
|
|
1230
|
+
*kpMenuPortal
|
|
1231
|
+
kpMenuPositioner
|
|
1232
|
+
kpMenuPopup
|
|
1233
|
+
kpMenuArrow
|
|
1234
|
+
kpMenuGroup (optional, repeated)
|
|
1235
|
+
kpMenuItem (repeated)
|
|
1236
|
+
a[kpMenuLinkItem] (repeated)
|
|
1237
|
+
kpMenuGroupLabel
|
|
1238
|
+
kpMenuCheckboxItem (repeated)
|
|
1239
|
+
*kpMenuCheckboxItemIndicator
|
|
1240
|
+
kpMenuRadioGroup (repeated)
|
|
1241
|
+
kpMenuRadioItem (repeated)
|
|
1242
|
+
*kpMenuRadioItemIndicator
|
|
1243
|
+
kpMenuSubmenuRoot (repeated)
|
|
1244
|
+
*kpMenuPortal (as above)
|
|
1245
|
+
kpMenuSubmenuTrigger
|
|
1246
|
+
kpMenuSeparator (repeated)
|
|
1247
|
+
```
|
|
450
1248
|
|
|
451
1249
|
Props of its root:
|
|
452
1250
|
|
|
453
|
-
- `open
|
|
454
|
-
- `defaultOpen?: boolean`
|
|
455
|
-
- `onOpenChange?: ((open: boolean, details: ChangeDetails) => void)`
|
|
1251
|
+
- `[(open)]: boolean`: Whether it is open, when the caller holds it.
|
|
1252
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
456
1253
|
- `disabled?: boolean`: The trigger cannot be pressed; a submenu's is passed over.
|
|
457
1254
|
- `loop?: boolean`: Whether the arrows go round from the last item to the first. Default: they do.
|
|
458
|
-
- `modal?: boolean`: Holds the page while the menu is open
|
|
1255
|
+
- `modal?: boolean`: Holds the page while the menu is open. Not for a submenu.
|
|
1256
|
+
- `(openChanged): { open: boolean; details: ChangeDetails }`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
1257
|
+
|
|
1258
|
+
Each part, and its own props:
|
|
1259
|
+
|
|
1260
|
+
- `[kpContextMenu]` is `KpMenu`. `exportAs: "kpMenu"`. `kpContextMenu` in place of `kpMenu` is a menu for an area of the page, opened at the pointer: its trigger is `kpContextMenuTrigger`, its other parts the menu's. Its props are above.
|
|
1261
|
+
- `[kpContextMenuTrigger]` is `KpContextMenuTrigger`. The area a secondary press, or a long press on a touch screen, opens a `kpContextMenu` in.
|
|
1262
|
+
- `[kpMenuPortal]` is `KpMenuPortal`. Structural: written `*kpMenuPortal`. Draws what it holds at the end of `<body>`, or in the container a `PortalProvider` names.
|
|
1263
|
+
- `[kpMenuPositioner]` is `KpMenuPositioner`. Takes the positioner options ("Positioner options", above).
|
|
1264
|
+
- `[kpMenuPopup]` is `KpMenuPopup`.
|
|
1265
|
+
- `[kpMenuArrow]` is `KpMenuArrow`.
|
|
1266
|
+
- `[kpMenuItem]` is `KpMenuItem`.
|
|
1267
|
+
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
1268
|
+
- `label?: string`: What typing matches; the item's text when left out.
|
|
1269
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu. Default: it does.
|
|
1270
|
+
- `a[kpMenuLinkItem]` is `KpMenuLinkItem`. `<a kpMenuLinkItem href="…">`: an item that is a link.
|
|
1271
|
+
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
1272
|
+
- `label?: string`: What typing matches; the item's text when left out.
|
|
1273
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu. Default: it does.
|
|
1274
|
+
- `[kpMenuGroup]` is `KpMenuGroup`. Items that belong together, named by their label.
|
|
1275
|
+
- `[kpMenuGroupLabel]` is `KpMenuGroupLabel`. Names the group it is in. With no group around it, it is plain text.
|
|
1276
|
+
- `[kpMenuSeparator]` is `KpMenuSeparator`. A line between items.
|
|
1277
|
+
- `[kpMenuCheckboxItem]` is `KpMenuCheckboxItem`. `exportAs: "kpMenuCheckboxItem"`.
|
|
1278
|
+
- `[(checked)]: boolean`: Whether the item is checked, when the caller holds it.
|
|
1279
|
+
- `defaultChecked?: boolean`: Whether the item starts checked, when the caller does not hold `checked`. Read once.
|
|
1280
|
+
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
1281
|
+
- `label?: string`: What typing matches; the item's text when left out.
|
|
1282
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu. Default: it does not.
|
|
1283
|
+
- `(checkedChanged): { checked: boolean; details: ChangeDetails }`: Heard as the item is about to be checked or unchecked: `details.cancel()` keeps it as it was.
|
|
1284
|
+
- `[kpMenuCheckboxItemIndicator]` is `KpMenuCheckboxItemIndicator`. Structural: written `*kpMenuCheckboxItemIndicator`. `<span *kpMenuCheckboxItemIndicator>`: in the page while its item is checked.
|
|
1285
|
+
- `[kpMenuRadioGroup]` is `KpMenuRadioGroup`. `exportAs: "kpMenuRadioGroup"`. Generic: `<Value = unknown>`.
|
|
1286
|
+
- `[(value)]: Value | null`: The chosen value; `null` is "none".
|
|
1287
|
+
- `defaultValue?: NoInfer<Value> | null`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
1288
|
+
- `disabled?: boolean`: Disables every item of the group.
|
|
1289
|
+
- `(valueChanged): { value: Value; details: ChangeDetails }`: Told an item's own value, never `null`: a press chooses, and nothing takes the choice back.
|
|
1290
|
+
- `[kpMenuRadioItem]` is `KpMenuRadioItem`.
|
|
1291
|
+
- `value: unknown`: Required. What the radio group's value is while this item is the chosen one.
|
|
1292
|
+
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
1293
|
+
- `label?: string`: What typing matches; the item's text when left out.
|
|
1294
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu. Default: it does not.
|
|
1295
|
+
- `[kpMenuRadioItemIndicator]` is `KpMenuRadioItemIndicator`. Structural: written `*kpMenuRadioItemIndicator`. `<span *kpMenuRadioItemIndicator>`: in the page while its item is the chosen one.
|
|
1296
|
+
- `[kpMenuSubmenuRoot]` is `KpMenuSubmenuRoot`. `exportAs: "kpMenuSubmenuRoot"`. A menu that one of this menu's items opens. Its trigger is `kpMenuSubmenuTrigger`.
|
|
1297
|
+
- `[(open)]: boolean`: Whether it is open, when the caller holds it.
|
|
1298
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
1299
|
+
- `disabled?: boolean`: The trigger cannot be pressed; a submenu's is passed over.
|
|
1300
|
+
- `loop?: boolean`: Whether the arrows go round from the last item to the first. Default: they do.
|
|
1301
|
+
- `modal?: boolean`: Holds the page while the menu is open. Not for a submenu.
|
|
1302
|
+
- `(openChanged): { open: boolean; details: ChangeDetails }`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
1303
|
+
- `[kpMenuSubmenuTrigger]` is `KpMenuSubmenuTrigger`. On the item of a menu that opens the submenu around it (`kpMenuSubmenuRoot`).
|
|
459
1304
|
|
|
460
1305
|
Attributes and CSS variables, by part:
|
|
461
1306
|
|
|
@@ -464,7 +1309,7 @@ Attributes and CSS variables, by part:
|
|
|
464
1309
|
- positioner: Places the menu against its trigger. It carries the geometry.
|
|
465
1310
|
- `data-open`: Present when it is open.
|
|
466
1311
|
- `data-closed`: Present when it is closed.
|
|
467
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1312
|
+
- `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.
|
|
468
1313
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
469
1314
|
- `--anchor-width`: The anchor's width.
|
|
470
1315
|
- `--anchor-height`: The anchor's height.
|
|
@@ -476,10 +1321,10 @@ Attributes and CSS variables, by part:
|
|
|
476
1321
|
- `data-closed`: Present when it is closed.
|
|
477
1322
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
478
1323
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
479
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1324
|
+
- `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.
|
|
480
1325
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
481
1326
|
- arrow: An element that points at the trigger.
|
|
482
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1327
|
+
- `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.
|
|
483
1328
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
484
1329
|
- `data-uncentered`: Present when the arrow cannot sit at the trigger's centre.
|
|
485
1330
|
- item: An action. Choosing it closes the menu.
|
|
@@ -514,25 +1359,42 @@ Attributes and CSS variables, by part:
|
|
|
514
1359
|
### DateField
|
|
515
1360
|
|
|
516
1361
|
```
|
|
517
|
-
import {
|
|
1362
|
+
import { KpDateField, KpDateFieldSegments, KpDateFieldSegment, KpDateFieldInput } from "@kirana-ui/angular"
|
|
518
1363
|
```
|
|
519
1364
|
|
|
520
|
-
Parts: `[
|
|
1365
|
+
Parts: `[kpDateField]`, `[kpDateFieldSegments]`, `[kpDateFieldSegment]`, `input[kpDateFieldInput]`.
|
|
1366
|
+
|
|
1367
|
+
Anatomy:
|
|
1368
|
+
|
|
1369
|
+
```
|
|
1370
|
+
kpDateField
|
|
1371
|
+
*kpDateFieldSegments
|
|
1372
|
+
kpDateFieldSegment (repeated)
|
|
1373
|
+
input[kpDateFieldInput]
|
|
1374
|
+
```
|
|
521
1375
|
|
|
522
1376
|
Props of its root:
|
|
523
1377
|
|
|
524
|
-
- `value
|
|
525
|
-
- `defaultValue?:
|
|
526
|
-
- `
|
|
527
|
-
- `
|
|
528
|
-
- `
|
|
529
|
-
- `max?: IsoDate`
|
|
1378
|
+
- `[(value)]: string | null`: The day typed, once all of it is: `[(value)]`.
|
|
1379
|
+
- `defaultValue?: string | null`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
1380
|
+
- `locale?: string`: The language and region that order the day, the month and the year. Default `"en-US"`.
|
|
1381
|
+
- `min?: string`: The first and the last day it takes: outside them it says it is invalid.
|
|
1382
|
+
- `max?: string`: The last day it takes.
|
|
530
1383
|
- `placeholders?: Partial<Record<DateUnit, string>>`: What an empty part shows. Default: `dd`, `mm`, `yyyy`.
|
|
531
|
-
- `disabled?: boolean
|
|
532
|
-
- `readOnly?: boolean
|
|
533
|
-
- `required?: boolean`
|
|
1384
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
1385
|
+
- `readOnly?: boolean`: Shown as it is, focusable, not changeable.
|
|
1386
|
+
- `required?: boolean`: Needed: in a `Field`, leaving it empty is then invalid.
|
|
534
1387
|
- `name?: string`: The name it is submitted under, by its hidden input.
|
|
535
1388
|
- `form?: string`: The id of the form it belongs to, when it is not inside it.
|
|
1389
|
+
- `(valueChanged): { value: string | null; details: ChangeDetails }`: Heard as the day is about to change, once all of it is typed or as it is cleared: `details.cancel()` keeps the value as it was.
|
|
1390
|
+
|
|
1391
|
+
Each part, and its own props:
|
|
1392
|
+
|
|
1393
|
+
- `[kpDateField]` is `KpDateField`. `exportAs: "kpDateField"`. Its props are above.
|
|
1394
|
+
- `[kpDateFieldSegments]` is `KpDateFieldSegments`. Structural: written `*kpDateFieldSegments`. Its template is given the entry: `let entry` is a `DateFieldSegment`. `<span *kpDateFieldSegments="let segment">`: once for each piece of the date.
|
|
1395
|
+
- `[kpDateFieldSegment]` is `KpDateFieldSegment`. One piece: a part that is typed, or what stands between two. It writes its own text.
|
|
1396
|
+
- `segment: DateFieldSegment`: Required. The piece it is: an entry `DateField.Segments` gave.
|
|
1397
|
+
- `input[kpDateFieldInput]` is `KpDateFieldInput`. `<input kpDateFieldInput>`: the hidden input it is submitted by.
|
|
536
1398
|
|
|
537
1399
|
Attributes and CSS variables, by part:
|
|
538
1400
|
|
|
@@ -549,33 +1411,91 @@ Attributes and CSS variables, by part:
|
|
|
549
1411
|
### DatePicker
|
|
550
1412
|
|
|
551
1413
|
```
|
|
552
|
-
import {
|
|
1414
|
+
import { KpDatePicker, KpDatePickerField, KpDateFieldSegments, KpDateFieldSegment, KpDateFieldInput, KpPopoverTrigger, KpPopoverPortal, KpPopoverPositioner, KpPopoverPopup, KpDatePickerCalendar, KpCalendarHeading, KpCalendarPrevious, KpCalendarNext, KpCalendarMonths, KpCalendarGrid, KpCalendarWeekdays, KpCalendarHeadCell, KpCalendarWeeks, KpCalendarCell, KpCalendarDay } from "@kirana-ui/angular"
|
|
553
1415
|
```
|
|
554
1416
|
|
|
555
|
-
Parts: `[
|
|
1417
|
+
Parts: `[kpDatePicker]`, `[kpDatePickerField]`, `[kpDateFieldSegments]`, `[kpDateFieldSegment]`, `input[kpDateFieldInput]`, `[kpPopoverTrigger]`, `[kpPopoverPortal]`, `[kpPopoverPositioner]`, `[kpPopoverPopup]`, `[kpDatePickerCalendar]`, `[kpCalendarHeading]`, `[kpCalendarPrevious]`, `[kpCalendarNext]`, `[kpCalendarMonths]`, `[kpCalendarGrid]`, `[kpCalendarWeekdays]`, `[kpCalendarHeadCell]`, `[kpCalendarWeeks]`, `[kpCalendarCell]`, `[kpCalendarDay]`.
|
|
1418
|
+
|
|
1419
|
+
Anatomy:
|
|
556
1420
|
|
|
557
|
-
|
|
1421
|
+
```
|
|
1422
|
+
kpDatePicker
|
|
1423
|
+
kpDatePickerField
|
|
1424
|
+
*kpDateFieldSegments
|
|
1425
|
+
kpDateFieldSegment (repeated)
|
|
1426
|
+
input[kpDateFieldInput]
|
|
1427
|
+
kpPopoverTrigger
|
|
1428
|
+
*kpPopoverPortal
|
|
1429
|
+
kpPopoverPositioner
|
|
1430
|
+
kpPopoverPopup
|
|
1431
|
+
kpDatePickerCalendar
|
|
1432
|
+
*kpCalendarMonths (optional)
|
|
1433
|
+
kpCalendarHeading
|
|
1434
|
+
kpCalendarGrid
|
|
1435
|
+
*kpCalendarWeekdays
|
|
1436
|
+
kpCalendarHeadCell (repeated)
|
|
1437
|
+
*kpCalendarWeeks
|
|
1438
|
+
kpCalendarCell (repeated)
|
|
1439
|
+
kpCalendarDay
|
|
1440
|
+
kpCalendarPrevious
|
|
1441
|
+
kpCalendarNext
|
|
1442
|
+
```
|
|
558
1443
|
|
|
559
1444
|
Props of its root:
|
|
560
1445
|
|
|
561
|
-
- `value
|
|
562
|
-
- `defaultValue?:
|
|
563
|
-
- `
|
|
564
|
-
- `
|
|
565
|
-
- `defaultOpen?: boolean`
|
|
566
|
-
- `onOpenChange?: ((open: boolean, details: ChangeDetails) => void)`
|
|
1446
|
+
- `[(value)]: string | null`: The day, typed or picked; `null` for none.
|
|
1447
|
+
- `defaultValue?: string | null`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
1448
|
+
- `[(open)]: boolean`: Whether the calendar is open, when the caller holds it.
|
|
1449
|
+
- `defaultOpen?: boolean`: Whether the calendar starts open, when the caller does not hold `open`. Read once.
|
|
567
1450
|
- `locale?: string`: The language and region of the field and the calendar. Give it: a server does not know.
|
|
568
|
-
- `min?:
|
|
569
|
-
- `max?:
|
|
1451
|
+
- `min?: string`: The first and the last day that can be typed or picked.
|
|
1452
|
+
- `max?: string`: The last day that can be typed or picked.
|
|
570
1453
|
- `isDateUnavailable?: CalendarProps["isDateUnavailable"]`: Days that cannot be picked in the calendar.
|
|
571
1454
|
- `calendarSystem?: CalendarProps["calendarSystem"]`: The calendar its months are laid out in, when it is not the Gregorian one.
|
|
572
1455
|
- `fixedWeeks?: boolean`: Always six rows of days.
|
|
1456
|
+
- `months?: number`: How many months the calendar shows side by side.
|
|
1457
|
+
- `pagedNavigation?: boolean`: With several `months`: Previous and Next turn them all rather than one month.
|
|
1458
|
+
- `[(month)]: string`: The first day of the month the calendar shows (any day of it): `[(month)]`.
|
|
1459
|
+
- `defaultMonth?: string`: The month the calendar starts on, when the caller does not hold `month`. Read once.
|
|
573
1460
|
- `placeholders?: DateFieldProps["placeholders"]`: What an empty part of the field shows.
|
|
574
|
-
- `disabled?: boolean
|
|
575
|
-
- `readOnly?: boolean
|
|
576
|
-
- `required?: boolean`
|
|
1461
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
1462
|
+
- `readOnly?: boolean`: Shown as it is, focusable, not changeable.
|
|
1463
|
+
- `required?: boolean`: Needed: in a `Field`, leaving it empty is then invalid.
|
|
577
1464
|
- `name?: string`: The name it is submitted under.
|
|
578
1465
|
- `form?: string`: The id of the form it belongs to, when it is not inside it.
|
|
1466
|
+
- `(valueChanged): { value: string | null; details: ChangeDetails }`: Heard as the day is about to change, typed or picked: `details.cancel()` keeps the value as it was.
|
|
1467
|
+
- `(openChanged): { open: boolean; details: ChangeDetails }`: Heard as the calendar is about to open or close: `details.cancel()` keeps it as it was.
|
|
1468
|
+
- `(monthChanged): { month: string; details: ChangeDetails }`: The calendar is about to show another month: its first day, and `details.cancel()`.
|
|
1469
|
+
|
|
1470
|
+
Each part, and its own props:
|
|
1471
|
+
|
|
1472
|
+
- `[kpDatePicker]` is `KpDatePicker`. `exportAs: "kpDatePicker"`. A date field, and a calendar in a popover, with one value between them. On any element, or on `<ng-container>` to draw none. Inside it the date field's, the popover's and the calendar's own directives are its parts (`kpDateFieldSegments`, `kpPopoverTrigger`, `kpCalendarGrid` …), with `kpDatePickerField` and `kpDatePickerCalendar` for the two elements that hold them. `[(value)]` is the day, `[(open)]` whether the calendar shows, `[(month)]` the first day of the month it shows. Its props are above.
|
|
1473
|
+
- `[kpDatePickerField]` is `KpDatePickerField`. The typed date: what holds its segments and its hidden input.
|
|
1474
|
+
- `[kpDateFieldSegments]` is `KpDateFieldSegments`. Structural: written `*kpDateFieldSegments`. Its template is given the entry: `let entry` is a `DateFieldSegment`. `<span *kpDateFieldSegments="let segment">`: once for each piece of the date.
|
|
1475
|
+
- `[kpDateFieldSegment]` is `KpDateFieldSegment`. One piece: a part that is typed, or what stands between two. It writes its own text.
|
|
1476
|
+
- `segment: DateFieldSegment`: Required. The piece it is: an entry `DateField.Segments` gave.
|
|
1477
|
+
- `input[kpDateFieldInput]` is `KpDateFieldInput`. `<input kpDateFieldInput>`: the hidden input it is submitted by.
|
|
1478
|
+
- `[kpPopoverTrigger]` is `KpPopoverTrigger`.
|
|
1479
|
+
- `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`.
|
|
1480
|
+
- `delay?: number`: How long the pointer rests on the trigger before the popover opens, in milliseconds. Default 300.
|
|
1481
|
+
- `closeDelay?: number`: How long after the pointer leaves a popover it opened closes, in milliseconds. Default 0.
|
|
1482
|
+
- `[kpPopoverPortal]` is `KpPopoverPortal`. Structural: written `*kpPopoverPortal`. Draws what it holds at the end of `<body>`, or in the container a `PortalProvider` names.
|
|
1483
|
+
- `[kpPopoverPositioner]` is `KpPopoverPositioner`. Takes the positioner options ("Positioner options", above).
|
|
1484
|
+
- `[kpPopoverPopup]` is `KpPopoverPopup`.
|
|
1485
|
+
- `[kpDatePickerCalendar]` is `KpDatePickerCalendar`. The calendar: what holds its heading, its buttons and its grid.
|
|
1486
|
+
- `[kpCalendarHeading]` is `KpCalendarHeading`. Names the month shown: it writes the name before whatever is inside it.
|
|
1487
|
+
- `[kpCalendarPrevious]` is `KpCalendarPrevious`.
|
|
1488
|
+
- `[kpCalendarNext]` is `KpCalendarNext`.
|
|
1489
|
+
- `[kpCalendarMonths]` is `KpCalendarMonths`. Structural: written `*kpCalendarMonths`. Its template is given the entry: `let entry` is a `CalendarMonth`. `<div *kpCalendarMonths="let month">`: once for each month shown, side by side. The parts inside each are that month's. Left out for one month.
|
|
1490
|
+
- `[kpCalendarGrid]` is `KpCalendarGrid`. The table of a month's days: a grid the arrows move in, from one month shown into the next.
|
|
1491
|
+
- `[kpCalendarWeekdays]` is `KpCalendarWeekdays`. Structural: written `*kpCalendarWeekdays`. Its template is given the entry: `let entry` is a `CalendarWeekday`. `<th *kpCalendarWeekdays="let weekday">`: once for each day of the week.
|
|
1492
|
+
- `[kpCalendarHeadCell]` is `KpCalendarHeadCell`. A column's heading: a day of the week.
|
|
1493
|
+
- `weekday: CalendarWeekday`: Required. The day of the week it heads: an entry `Calendar.Weekdays` gave.
|
|
1494
|
+
- `[kpCalendarWeeks]` is `KpCalendarWeeks`. Structural: written `*kpCalendarWeeks`. Its template is given the entry: `let entry` is a `readonly CalendarDay[]`. `<tr *kpCalendarWeeks="let week">`: once for each week of the month shown.
|
|
1495
|
+
- `[kpCalendarCell]` is `KpCalendarCell`.
|
|
1496
|
+
- `date: string`: Required. The day it holds, as `Calendar.Weeks` gave it: `day.date`.
|
|
1497
|
+
- `[kpCalendarDay]` is `KpCalendarDay`.
|
|
1498
|
+
- `date: string`: Required. The day it is the button of, as `Calendar.Weeks` gave it: `day.date`.
|
|
579
1499
|
|
|
580
1500
|
Attributes and CSS variables, by part:
|
|
581
1501
|
|
|
@@ -593,7 +1513,7 @@ Attributes and CSS variables, by part:
|
|
|
593
1513
|
- positioner: Places the popup against the trigger. It carries the geometry.
|
|
594
1514
|
- `data-open`: Present when it is open.
|
|
595
1515
|
- `data-closed`: Present when it is closed.
|
|
596
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1516
|
+
- `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.
|
|
597
1517
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
598
1518
|
- `--anchor-width`: The anchor's width.
|
|
599
1519
|
- `--anchor-height`: The anchor's height.
|
|
@@ -605,7 +1525,7 @@ Attributes and CSS variables, by part:
|
|
|
605
1525
|
- `data-closed`: Present when it is closed.
|
|
606
1526
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
607
1527
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
608
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1528
|
+
- `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.
|
|
609
1529
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
610
1530
|
- calendar: The calendar.
|
|
611
1531
|
- `data-disabled`: Present when it is disabled.
|
|
@@ -615,7 +1535,7 @@ Attributes and CSS variables, by part:
|
|
|
615
1535
|
- next: Shows the month after.
|
|
616
1536
|
- `data-disabled`: Present when it is disabled.
|
|
617
1537
|
- cell: A day's cell.
|
|
618
|
-
- `data-selected`: Present on a chosen day,
|
|
1538
|
+
- `data-selected`: Present on a chosen day, on every day of a chosen range, and on each day of a list. Never on a copy: a day of the month before or after shown in its own month too.
|
|
619
1539
|
- `data-today`: Present on today.
|
|
620
1540
|
- `data-outside-month`: Present on the days of the month before and after that fill the first and last weeks.
|
|
621
1541
|
- `data-disabled`: Present when it is disabled.
|
|
@@ -623,7 +1543,7 @@ Attributes and CSS variables, by part:
|
|
|
623
1543
|
- `data-range-start`: Present on the first day of a range.
|
|
624
1544
|
- `data-range-end`: Present on the last day of a range.
|
|
625
1545
|
- day: The button for a day.
|
|
626
|
-
- `data-selected`: Present on a chosen day,
|
|
1546
|
+
- `data-selected`: Present on a chosen day, on every day of a chosen range, and on each day of a list. Never on a copy: a day of the month before or after shown in its own month too.
|
|
627
1547
|
- `data-today`: Present on today.
|
|
628
1548
|
- `data-outside-month`: Present on the days of the month before and after that fill the first and last weeks.
|
|
629
1549
|
- `data-disabled`: Present when it is disabled.
|
|
@@ -634,18 +1554,49 @@ Attributes and CSS variables, by part:
|
|
|
634
1554
|
### Dialog
|
|
635
1555
|
|
|
636
1556
|
```
|
|
637
|
-
import {
|
|
1557
|
+
import { KpDialog, KpDialogTrigger, KpDialogPortal, KpDialogBackdrop, KpDialogViewport, KpDialogPopup, KpDialogTitle, KpDialogDescription, KpDialogClose } from "@kirana-ui/angular"
|
|
638
1558
|
```
|
|
639
1559
|
|
|
640
|
-
Parts: `[
|
|
1560
|
+
Parts: `[kpDialog]`, `[kpDialogTrigger]`, `[kpDialogPortal]`, `[kpDialogBackdrop]`, `[kpDialogViewport]`, `[kpDialogPopup]`, `[kpDialogTitle]`, `[kpDialogDescription]`, `[kpDialogClose]`.
|
|
1561
|
+
|
|
1562
|
+
Anatomy:
|
|
1563
|
+
|
|
1564
|
+
```
|
|
1565
|
+
kpDialog
|
|
1566
|
+
kpDialogTrigger
|
|
1567
|
+
*kpDialogPortal
|
|
1568
|
+
kpDialogBackdrop
|
|
1569
|
+
kpDialogViewport (optional)
|
|
1570
|
+
kpDialogPopup
|
|
1571
|
+
kpDialogTitle
|
|
1572
|
+
kpDialogDescription
|
|
1573
|
+
kpDialogClose
|
|
1574
|
+
```
|
|
641
1575
|
|
|
642
1576
|
Props of its root:
|
|
643
1577
|
|
|
644
|
-
- `open
|
|
645
|
-
- `defaultOpen?: boolean`
|
|
646
|
-
- `onOpenChange?: ((open: boolean, details: ChangeDetails) => void)`
|
|
1578
|
+
- `[(open)]: boolean`: Whether it is open, when the caller holds it.
|
|
1579
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
647
1580
|
- `modal?: boolean`: Blocks the page behind it and traps focus. Default `true`.
|
|
648
1581
|
- `dismissible?: boolean`: Whether a press outside closes it. Default `true`.
|
|
1582
|
+
- `swipeDirection?: DrawerSide`: With `kpDrawer`: the way it is dragged to close it. Default: `"down"`.
|
|
1583
|
+
- `snapPoints?: readonly DrawerSnapPoint[]`: With `kpDrawer`: places it rests at, each the share of itself that shows.
|
|
1584
|
+
- `[(snapPoint)]: DrawerSnapPoint`: With `kpDrawer`: which of them it rests at, `[(snapPoint)]`.
|
|
1585
|
+
- `defaultSnapPoint?: DrawerSnapPoint`: With `kpDrawer`: where it opens. Default: the smallest.
|
|
1586
|
+
- `(snapPointChanged): { snapPoint: DrawerSnapPoint; details: ChangeDetails }`: With `kpDrawer`: heard as it is about to rest at another snap point; `details.cancel()` keeps it where it was.
|
|
1587
|
+
- `(openChanged): { open: boolean; details: ChangeDetails }`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
1588
|
+
|
|
1589
|
+
Each part, and its own props:
|
|
1590
|
+
|
|
1591
|
+
- `[kpDialog]` is `KpDialog`. `exportAs: "kpDialog"`. On any element, or on `<ng-container>` to draw none. `kpDrawer` in place of `kpDialog` is a dialog that comes from an edge and is dragged back to it (`swipeDirection`): its parts are a dialog's (`kpDialogPopup` …). An alert dialog has a root of its own, `kpAlertDialog`. Its props are above.
|
|
1592
|
+
- `[kpDialogTrigger]` is `KpDialogTrigger`.
|
|
1593
|
+
- `[kpDialogPortal]` is `KpDialogPortal`. Structural: written `*kpDialogPortal`. `<ng-template kpDialogPortal>` or `*kpDialogPortal`: its content at the end of the page while open.
|
|
1594
|
+
- `[kpDialogBackdrop]` is `KpDialogBackdrop`.
|
|
1595
|
+
- `[kpDialogViewport]` is `KpDialogViewport`. What a long dialog scrolls in, around its popup: it may be left out. A dialog's and an alert dialog's; a drawer lies at an edge of the page and has none.
|
|
1596
|
+
- `[kpDialogPopup]` is `KpDialogPopup`.
|
|
1597
|
+
- `[kpDialogTitle]` is `KpDialogTitle`. The heading that names the dialog.
|
|
1598
|
+
- `[kpDialogDescription]` is `KpDialogDescription`. The text that describes the dialog.
|
|
1599
|
+
- `[kpDialogClose]` is `KpDialogClose`. A button that closes the dialog.
|
|
649
1600
|
|
|
650
1601
|
Attributes and CSS variables, by part:
|
|
651
1602
|
|
|
@@ -656,6 +1607,13 @@ Attributes and CSS variables, by part:
|
|
|
656
1607
|
- `data-closed`: Present when it is closed.
|
|
657
1608
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
658
1609
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1610
|
+
- 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.
|
|
1611
|
+
- `data-open`: Present when it is open.
|
|
1612
|
+
- `data-closed`: Present when it is closed.
|
|
1613
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1614
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1615
|
+
- `data-nested`: Present when the dialog opened over another dialog.
|
|
1616
|
+
- `data-nested-dialog-open`: Present when another dialog is open above this one.
|
|
659
1617
|
- popup: The dialog itself.
|
|
660
1618
|
- `data-open`: Present when it is open.
|
|
661
1619
|
- `data-closed`: Present when it is closed.
|
|
@@ -664,32 +1622,50 @@ Attributes and CSS variables, by part:
|
|
|
664
1622
|
- `data-nested-dialog-open`: Present when another dialog is open above this one.
|
|
665
1623
|
- `--nested-dialogs`: How many dialogs are open above this one.
|
|
666
1624
|
|
|
667
|
-
###
|
|
1625
|
+
### Drawer
|
|
668
1626
|
|
|
669
1627
|
```
|
|
670
|
-
import {
|
|
1628
|
+
import { KpDialog, KpDialogTrigger, KpDialogPortal, KpDialogBackdrop, KpDialogPopup, KpDialogTitle, KpDialogDescription, KpDialogClose } from "@kirana-ui/angular"
|
|
671
1629
|
```
|
|
672
1630
|
|
|
673
|
-
|
|
1631
|
+
Parts: `[kpDrawer]`, `[kpDialogTrigger]`, `[kpDialogPortal]`, `[kpDialogBackdrop]`, `[kpDialogPopup]`, `[kpDialogTitle]`, `[kpDialogDescription]`, `[kpDialogClose]`.
|
|
1632
|
+
|
|
1633
|
+
Anatomy:
|
|
674
1634
|
|
|
675
1635
|
```
|
|
676
|
-
|
|
1636
|
+
kpDrawer
|
|
1637
|
+
kpDialogTrigger
|
|
1638
|
+
*kpDialogPortal
|
|
1639
|
+
kpDialogBackdrop
|
|
1640
|
+
kpDialogPopup
|
|
1641
|
+
kpDialogTitle
|
|
1642
|
+
kpDialogDescription
|
|
1643
|
+
kpDialogClose
|
|
677
1644
|
```
|
|
678
1645
|
|
|
679
|
-
Its root is `[kuiDrawer]`, a selector of `KuiDialog`: inside it, that component's directives are its parts.
|
|
680
|
-
|
|
681
1646
|
Props of its root:
|
|
682
1647
|
|
|
683
|
-
- `open
|
|
684
|
-
- `defaultOpen?: boolean`
|
|
685
|
-
- `onOpenChange?: ((open: boolean, details: ChangeDetails) => void)`
|
|
1648
|
+
- `[(open)]: boolean`: Whether it is open, when the caller holds it.
|
|
1649
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
686
1650
|
- `modal?: boolean`: Blocks the page behind it and traps focus. Default `true`.
|
|
687
1651
|
- `dismissible?: boolean`: Whether a press outside closes it. Default `true`.
|
|
688
|
-
- `swipeDirection?: DrawerSide`:
|
|
689
|
-
- `snapPoints?: readonly DrawerSnapPoint[]`:
|
|
690
|
-
- `snapPoint
|
|
691
|
-
- `defaultSnapPoint?: DrawerSnapPoint`:
|
|
692
|
-
- `
|
|
1652
|
+
- `swipeDirection?: DrawerSide`: With `kpDrawer`: the way it is dragged to close it. Default: `"down"`.
|
|
1653
|
+
- `snapPoints?: readonly DrawerSnapPoint[]`: With `kpDrawer`: places it rests at, each the share of itself that shows.
|
|
1654
|
+
- `[(snapPoint)]: DrawerSnapPoint`: With `kpDrawer`: which of them it rests at, `[(snapPoint)]`.
|
|
1655
|
+
- `defaultSnapPoint?: DrawerSnapPoint`: With `kpDrawer`: where it opens. Default: the smallest.
|
|
1656
|
+
- `(snapPointChanged): { snapPoint: DrawerSnapPoint; details: ChangeDetails }`: With `kpDrawer`: heard as it is about to rest at another snap point; `details.cancel()` keeps it where it was.
|
|
1657
|
+
- `(openChanged): { open: boolean; details: ChangeDetails }`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
1658
|
+
|
|
1659
|
+
Each part, and its own props:
|
|
1660
|
+
|
|
1661
|
+
- `[kpDrawer]` is `KpDialog`. `exportAs: "kpDialog"`. On any element, or on `<ng-container>` to draw none. `kpDrawer` in place of `kpDialog` is a dialog that comes from an edge and is dragged back to it (`swipeDirection`): its parts are a dialog's (`kpDialogPopup` …). An alert dialog has a root of its own, `kpAlertDialog`. Its props are above.
|
|
1662
|
+
- `[kpDialogTrigger]` is `KpDialogTrigger`.
|
|
1663
|
+
- `[kpDialogPortal]` is `KpDialogPortal`. Structural: written `*kpDialogPortal`. `<ng-template kpDialogPortal>` or `*kpDialogPortal`: its content at the end of the page while open.
|
|
1664
|
+
- `[kpDialogBackdrop]` is `KpDialogBackdrop`.
|
|
1665
|
+
- `[kpDialogPopup]` is `KpDialogPopup`.
|
|
1666
|
+
- `[kpDialogTitle]` is `KpDialogTitle`. The heading that names the dialog.
|
|
1667
|
+
- `[kpDialogDescription]` is `KpDialogDescription`. The text that describes the dialog.
|
|
1668
|
+
- `[kpDialogClose]` is `KpDialogClose`. A button that closes the dialog.
|
|
693
1669
|
|
|
694
1670
|
Attributes and CSS variables, by part:
|
|
695
1671
|
|
|
@@ -731,19 +1707,40 @@ Attributes and CSS variables, by part:
|
|
|
731
1707
|
### Field
|
|
732
1708
|
|
|
733
1709
|
```
|
|
734
|
-
import {
|
|
1710
|
+
import { KpField, KpFieldLabel, KpFieldControl, KpFieldDescription, KpFieldError, KpFieldValidity } from "@kirana-ui/angular"
|
|
735
1711
|
```
|
|
736
1712
|
|
|
737
|
-
Parts: `[
|
|
1713
|
+
Parts: `[kpField]`, `[kpFieldLabel]`, `[kpFieldControl]`, `[kpFieldDescription]`, `[kpFieldError]`, `[kpFieldValidity]`.
|
|
1714
|
+
|
|
1715
|
+
Anatomy:
|
|
1716
|
+
|
|
1717
|
+
```
|
|
1718
|
+
kpField
|
|
1719
|
+
kpFieldLabel
|
|
1720
|
+
kpFieldControl
|
|
1721
|
+
kpFieldDescription
|
|
1722
|
+
*kpFieldError
|
|
1723
|
+
*kpFieldValidity
|
|
1724
|
+
```
|
|
738
1725
|
|
|
739
1726
|
Props of its root:
|
|
740
1727
|
|
|
741
1728
|
- `name?: string`: The control's name in the form.
|
|
742
|
-
- `disabled?: boolean`
|
|
1729
|
+
- `disabled?: boolean`: Disables the field: its control cannot be changed, and its parts say so (`data-disabled`).
|
|
743
1730
|
- `invalid?: boolean`: Invalid whatever the value: an error known from elsewhere.
|
|
744
|
-
- `validate?:
|
|
1731
|
+
- `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.
|
|
745
1732
|
- `validationMode?: ValidationMode`: When the value is checked; the form's by default, else `"onSubmit"`.
|
|
746
|
-
- `validationDebounceTime?: number`: With `"onChange"`, how long the value must rest before it is checked, in milliseconds.
|
|
1733
|
+
- `validationDebounceTime?: number`: With `"onChange"`, how long the value must rest before it is checked, in milliseconds. Default `0`.
|
|
1734
|
+
|
|
1735
|
+
Each part, and its own props:
|
|
1736
|
+
|
|
1737
|
+
- `[kpField]` is `KpField`. `exportAs: "kpField"`. Its props are above.
|
|
1738
|
+
- `[kpFieldLabel]` is `KpFieldLabel`.
|
|
1739
|
+
- `[kpFieldControl]` is `KpFieldControl`. On the control: an `<input>`, a `<textarea>` or a `<select>`.
|
|
1740
|
+
- `[kpFieldDescription]` is `KpFieldDescription`.
|
|
1741
|
+
- `[kpFieldError]` is `KpFieldError`. Structural: written `*kpFieldError`. `<div *kpFieldError>`: in the page while something is wrong, with the message as its text unless it has content of its own. `*kpFieldError="'valueMissing'"` shows for only that finding of the browser's, `*kpFieldError="true"` always.
|
|
1742
|
+
- `*kpFieldError: ValidityKey | boolean | ""`: The directive's own value: `*kpFieldError="…"`. One of the browser's findings (`"valueMissing"`) to show for only that; `true` to show always.
|
|
1743
|
+
- `[kpFieldValidity]` is `KpFieldValidity`. Structural: written `*kpFieldValidity`. Its template is given the entry: `let entry` is a `FieldValidity`. `<ng-container *kpFieldValidity="let validity">`: draws its template with the field's validity.
|
|
747
1744
|
|
|
748
1745
|
Attributes and CSS variables, by part:
|
|
749
1746
|
|
|
@@ -793,15 +1790,27 @@ Attributes and CSS variables, by part:
|
|
|
793
1790
|
### Fieldset
|
|
794
1791
|
|
|
795
1792
|
```
|
|
796
|
-
import {
|
|
1793
|
+
import { KpFieldset, KpFieldsetLegend } from "@kirana-ui/angular"
|
|
797
1794
|
```
|
|
798
1795
|
|
|
799
|
-
Parts: `[
|
|
1796
|
+
Parts: `[kpFieldset]`, `[kpFieldsetLegend]`.
|
|
1797
|
+
|
|
1798
|
+
Anatomy:
|
|
1799
|
+
|
|
1800
|
+
```
|
|
1801
|
+
kpFieldset
|
|
1802
|
+
kpFieldsetLegend
|
|
1803
|
+
```
|
|
800
1804
|
|
|
801
1805
|
Props of its root:
|
|
802
1806
|
|
|
803
1807
|
- `disabled?: boolean`: Disables every field inside.
|
|
804
1808
|
|
|
1809
|
+
Each part, and its own props:
|
|
1810
|
+
|
|
1811
|
+
- `[kpFieldset]` is `KpFieldset`. `exportAs: "kpFieldset"`. Its props are above.
|
|
1812
|
+
- `[kpFieldsetLegend]` is `KpFieldsetLegend`.
|
|
1813
|
+
|
|
805
1814
|
Attributes and CSS variables, by part:
|
|
806
1815
|
|
|
807
1816
|
- root: The group of fields.
|
|
@@ -812,32 +1821,56 @@ Attributes and CSS variables, by part:
|
|
|
812
1821
|
### Form
|
|
813
1822
|
|
|
814
1823
|
```
|
|
815
|
-
import {
|
|
1824
|
+
import { KpForm } from "@kirana-ui/angular"
|
|
816
1825
|
```
|
|
817
1826
|
|
|
818
1827
|
Props:
|
|
819
1828
|
|
|
820
1829
|
- `errors?: FormErrors`: Errors from outside the page (a server's), by field name. A field shows its own until its value changes.
|
|
821
|
-
- `onClearErrors?: ((errors: FormErrors) => void)`: A field's value changed while it showed an error from `errors`: what is left of them.
|
|
822
|
-
- `onFormSubmit?: ((values: FormValues, details: ChangeDetails) => void)`: Every field is valid. Given this, the page is not left: the values come as an object. Without it, the form submits as a form does.
|
|
823
1830
|
- `validationMode?: ValidationMode`: When the form's fields check their values, unless a field says otherwise. Default `"onSubmit"`.
|
|
1831
|
+
- `(formSubmit): { values: FormValues; details: ChangeDetails }`: Every field is valid. Given this, the page is not left: the values come as an object. Without it, the form submits as a form does.
|
|
1832
|
+
- `(clearErrors): FormErrors`: A field's value changed while it showed one of `errors`: what is left of them.
|
|
1833
|
+
|
|
1834
|
+
`form[kpForm]` is `KpForm`. `exportAs: "kpForm"`. On a `<form>`: its fields say what is wrong, and `(formSubmit)` gives the values once all are valid. As with Angular's own forms, the page is left only when the form has an `action`.
|
|
824
1835
|
|
|
825
1836
|
### HoverCard
|
|
826
1837
|
|
|
827
1838
|
```
|
|
828
|
-
import {
|
|
1839
|
+
import { KpHoverCard, KpHoverCardTrigger, KpHoverCardPortal, KpHoverCardPositioner, KpHoverCardPopup, KpHoverCardArrow } from "@kirana-ui/angular"
|
|
829
1840
|
```
|
|
830
1841
|
|
|
831
|
-
Parts: `[
|
|
1842
|
+
Parts: `[kpHoverCard]`, `[kpHoverCardTrigger]`, `[kpHoverCardPortal]`, `[kpHoverCardPositioner]`, `[kpHoverCardPopup]`, `[kpHoverCardArrow]`.
|
|
1843
|
+
|
|
1844
|
+
Anatomy:
|
|
1845
|
+
|
|
1846
|
+
```
|
|
1847
|
+
kpHoverCard
|
|
1848
|
+
kpHoverCardTrigger
|
|
1849
|
+
*kpHoverCardPortal
|
|
1850
|
+
kpHoverCardPositioner
|
|
1851
|
+
kpHoverCardPopup
|
|
1852
|
+
kpHoverCardArrow
|
|
1853
|
+
```
|
|
832
1854
|
|
|
833
1855
|
Props of its root:
|
|
834
1856
|
|
|
835
|
-
- `open
|
|
836
|
-
- `defaultOpen?: boolean`
|
|
837
|
-
- `
|
|
838
|
-
- `
|
|
839
|
-
- `
|
|
840
|
-
- `
|
|
1857
|
+
- `[(open)]: boolean`: Whether it is open, when the caller holds it.
|
|
1858
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
1859
|
+
- `delay?: number`: How long the pointer rests on the trigger before the popup opens, in milliseconds. Default `600`.
|
|
1860
|
+
- `closeDelay?: number`: How long after the pointer leaves the popup closes, in milliseconds. Default `300`.
|
|
1861
|
+
- `disabled?: boolean`: Disabled: the pointer and focus do not open it.
|
|
1862
|
+
- `(openChanged): { open: boolean; details: ChangeDetails }`: The change with why it happened; `details.cancel()` keeps the value.
|
|
1863
|
+
|
|
1864
|
+
Each part, and its own props:
|
|
1865
|
+
|
|
1866
|
+
- `[kpHoverCard]` is `KpHoverCard`. `exportAs: "kpHoverCard"`. On any element, or on `<ng-container>` to draw none. Its props are above.
|
|
1867
|
+
- `[kpHoverCardTrigger]` is `KpHoverCardTrigger`.
|
|
1868
|
+
- `delay?: number`: Its own waits, which come before the root's.
|
|
1869
|
+
- `closeDelay?: number`: How long after the pointer leaves this trigger's popup closes, in milliseconds.
|
|
1870
|
+
- `[kpHoverCardPortal]` is `KpHoverCardPortal`. Structural: written `*kpHoverCardPortal`. Draws what it holds at the end of `<body>`, or in the container a `PortalProvider` names.
|
|
1871
|
+
- `[kpHoverCardPositioner]` is `KpHoverCardPositioner`. Takes the positioner options ("Positioner options", above).
|
|
1872
|
+
- `[kpHoverCardPopup]` is `KpHoverCardPopup`.
|
|
1873
|
+
- `[kpHoverCardArrow]` is `KpHoverCardArrow`.
|
|
841
1874
|
|
|
842
1875
|
Attributes and CSS variables, by part:
|
|
843
1876
|
|
|
@@ -846,7 +1879,7 @@ Attributes and CSS variables, by part:
|
|
|
846
1879
|
- positioner: Places the popup against the trigger. It carries the geometry.
|
|
847
1880
|
- `data-open`: Present when it is open.
|
|
848
1881
|
- `data-closed`: Present when it is closed.
|
|
849
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1882
|
+
- `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.
|
|
850
1883
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
851
1884
|
- `--anchor-width`: The anchor's width.
|
|
852
1885
|
- `--anchor-height`: The anchor's height.
|
|
@@ -858,24 +1891,26 @@ Attributes and CSS variables, by part:
|
|
|
858
1891
|
- `data-closed`: Present when it is closed.
|
|
859
1892
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
860
1893
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
861
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1894
|
+
- `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.
|
|
862
1895
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
863
1896
|
- `data-instant="delay | focus | dismiss"`: Present when it opened or closed without its usual wait, for a design that skips the motion then.
|
|
864
1897
|
- arrow: An element that points at the trigger, placed along the popup's edge.
|
|
865
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1898
|
+
- `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.
|
|
866
1899
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
867
1900
|
- `data-uncentered`: Present when the popup was pushed along its edge, so the arrow is not at the trigger's centre.
|
|
868
1901
|
|
|
869
1902
|
### Input
|
|
870
1903
|
|
|
871
1904
|
```
|
|
872
|
-
import {
|
|
1905
|
+
import { KpInput } from "@kirana-ui/angular"
|
|
873
1906
|
```
|
|
874
1907
|
|
|
875
1908
|
Props:
|
|
876
1909
|
|
|
877
|
-
- `disabled?: boolean
|
|
878
|
-
- `
|
|
1910
|
+
- `disabled?: boolean`: Disabled: nothing can be typed in it.
|
|
1911
|
+
- `(valueChanged): { value: string; details: ChangeDetails }`: What was typed, as text, each time it changes.
|
|
1912
|
+
|
|
1913
|
+
`[kpInput]` is `KpInput`. `exportAs: "kpInput"`. `<input kpInput>` or `<textarea kpInput>`: it says its state, and inside a `kpField` it is the field's control. Its value is the element's own (`[value]`, `ngModel`).
|
|
879
1914
|
|
|
880
1915
|
Attributes and CSS variables, by part:
|
|
881
1916
|
|
|
@@ -891,9 +1926,11 @@ Attributes and CSS variables, by part:
|
|
|
891
1926
|
### Label
|
|
892
1927
|
|
|
893
1928
|
```
|
|
894
|
-
import {
|
|
1929
|
+
import { KpLabel } from "@kirana-ui/angular"
|
|
895
1930
|
```
|
|
896
1931
|
|
|
1932
|
+
`[kpLabel]` is `KpLabel`. `exportAs: "kpLabel"`. `<label kpLabel>`. Inside a `kpField` it is the field's label.
|
|
1933
|
+
|
|
897
1934
|
Attributes and CSS variables, by part:
|
|
898
1935
|
|
|
899
1936
|
- label: A control's name. Inside a field it is the field's label, with its states.
|
|
@@ -908,22 +1945,44 @@ Attributes and CSS variables, by part:
|
|
|
908
1945
|
### Listbox
|
|
909
1946
|
|
|
910
1947
|
```
|
|
911
|
-
import {
|
|
1948
|
+
import { KpListbox, KpListboxItem, KpListboxItemIndicator, KpListboxGroup, KpListboxGroupLabel } from "@kirana-ui/angular"
|
|
912
1949
|
```
|
|
913
1950
|
|
|
914
|
-
Parts: `[
|
|
1951
|
+
Parts: `[kpListbox]`, `[kpListboxItem]`, `[kpListboxItemIndicator]`, `[kpListboxGroup]`, `[kpListboxGroupLabel]`.
|
|
1952
|
+
|
|
1953
|
+
Anatomy:
|
|
1954
|
+
|
|
1955
|
+
```
|
|
1956
|
+
kpListbox
|
|
1957
|
+
kpListboxGroup (optional, repeated)
|
|
1958
|
+
kpListboxItem (repeated)
|
|
1959
|
+
*kpListboxItemIndicator
|
|
1960
|
+
kpListboxGroupLabel
|
|
1961
|
+
```
|
|
915
1962
|
|
|
916
1963
|
Props of its root:
|
|
917
1964
|
|
|
918
|
-
- `value
|
|
919
|
-
- `defaultValue?: readonly Value[]`
|
|
920
|
-
- `onValueChange?: ((value: Value[], details: ChangeDetails) => void)`
|
|
1965
|
+
- `[(value)]: readonly Value[]`: The chosen values: none, one, or with `multiple` several.
|
|
1966
|
+
- `defaultValue?: readonly Value[]`: The values it starts with, when the caller does not hold `value`. Read once.
|
|
921
1967
|
- `multiple?: boolean`: Whether more than one can be chosen: a press then adds or takes away.
|
|
922
|
-
- `disabled?: boolean
|
|
1968
|
+
- `disabled?: boolean`: Disabled: no item can be chosen.
|
|
923
1969
|
- `loop?: boolean`: Whether the arrows go round from the last item to the first. Default: they do not.
|
|
924
1970
|
- `name?: string`: With a name, the chosen values are submitted with the form around the list.
|
|
925
1971
|
- `form?: string`: The id of the form the list belongs to, when it is not inside it.
|
|
926
|
-
- `virtualized?: ListCollection`: Every row, when only some are in the page
|
|
1972
|
+
- `virtualized?: ListCollection`: Every row, when only some are in the page: each item is then given its `index`.
|
|
1973
|
+
- `(valueChanged): { value: Value[]; details: ChangeDetails }`: Heard as an item is about to be chosen or taken away, with the values there would then be: `details.cancel()` keeps them as they were.
|
|
1974
|
+
|
|
1975
|
+
Each part, and its own props:
|
|
1976
|
+
|
|
1977
|
+
- `[kpListbox]` is `KpListbox`. `exportAs: "kpListbox"`. Generic: `<Value = unknown>`. Its props are above.
|
|
1978
|
+
- `[kpListboxItem]` is `KpListboxItem`.
|
|
1979
|
+
- `value: unknown`: Required. What is in the listbox's value while this item is chosen.
|
|
1980
|
+
- `disabled?: boolean`: Disables this item: it cannot be chosen, and the arrows pass over it.
|
|
1981
|
+
- `label?: string`: What typing matches; the item's text when left out.
|
|
1982
|
+
- `index?: number`: Its place among all the rows, in a virtualized list.
|
|
1983
|
+
- `[kpListboxItemIndicator]` is `KpListboxItemIndicator`. Structural: written `*kpListboxItemIndicator`. `<span *kpListboxItemIndicator>`: in the page while its item is chosen.
|
|
1984
|
+
- `[kpListboxGroup]` is `KpListboxGroup`. Items that belong together, named by their label.
|
|
1985
|
+
- `[kpListboxGroupLabel]` is `KpListboxGroupLabel`. The name of a group.
|
|
927
1986
|
|
|
928
1987
|
Attributes and CSS variables, by part:
|
|
929
1988
|
|
|
@@ -939,19 +1998,90 @@ Attributes and CSS variables, by part:
|
|
|
939
1998
|
### Menu
|
|
940
1999
|
|
|
941
2000
|
```
|
|
942
|
-
import {
|
|
2001
|
+
import { KpMenu, KpMenuTrigger, KpMenuPortal, KpMenuPositioner, KpMenuPopup, KpMenuArrow, KpMenuItem, KpMenuLinkItem, KpMenuGroup, KpMenuGroupLabel, KpMenuSeparator, KpMenuCheckboxItem, KpMenuCheckboxItemIndicator, KpMenuRadioGroup, KpMenuRadioItem, KpMenuRadioItemIndicator, KpMenuSubmenuRoot, KpMenuSubmenuTrigger } from "@kirana-ui/angular"
|
|
943
2002
|
```
|
|
944
2003
|
|
|
945
|
-
Parts: `[
|
|
2004
|
+
Parts: `[kpMenu]`, `[kpMenuTrigger]`, `[kpMenuPortal]`, `[kpMenuPositioner]`, `[kpMenuPopup]`, `[kpMenuArrow]`, `[kpMenuItem]`, `a[kpMenuLinkItem]`, `[kpMenuGroup]`, `[kpMenuGroupLabel]`, `[kpMenuSeparator]`, `[kpMenuCheckboxItem]`, `[kpMenuCheckboxItemIndicator]`, `[kpMenuRadioGroup]`, `[kpMenuRadioItem]`, `[kpMenuRadioItemIndicator]`, `[kpMenuSubmenuRoot]`, `[kpMenuSubmenuTrigger]`.
|
|
2005
|
+
|
|
2006
|
+
Anatomy:
|
|
2007
|
+
|
|
2008
|
+
```
|
|
2009
|
+
kpMenu
|
|
2010
|
+
kpMenuTrigger
|
|
2011
|
+
*kpMenuPortal
|
|
2012
|
+
kpMenuPositioner
|
|
2013
|
+
kpMenuPopup
|
|
2014
|
+
kpMenuArrow
|
|
2015
|
+
kpMenuGroup (optional, repeated)
|
|
2016
|
+
kpMenuItem (repeated)
|
|
2017
|
+
a[kpMenuLinkItem] (repeated)
|
|
2018
|
+
kpMenuGroupLabel
|
|
2019
|
+
kpMenuCheckboxItem (repeated)
|
|
2020
|
+
*kpMenuCheckboxItemIndicator
|
|
2021
|
+
kpMenuRadioGroup (repeated)
|
|
2022
|
+
kpMenuRadioItem (repeated)
|
|
2023
|
+
*kpMenuRadioItemIndicator
|
|
2024
|
+
kpMenuSubmenuRoot (repeated)
|
|
2025
|
+
*kpMenuPortal (as above)
|
|
2026
|
+
kpMenuSubmenuTrigger
|
|
2027
|
+
kpMenuSeparator (repeated)
|
|
2028
|
+
```
|
|
946
2029
|
|
|
947
2030
|
Props of its root:
|
|
948
2031
|
|
|
949
|
-
- `open
|
|
950
|
-
- `defaultOpen?: boolean`
|
|
951
|
-
- `onOpenChange?: ((open: boolean, details: ChangeDetails) => void)`
|
|
2032
|
+
- `[(open)]: boolean`: Whether it is open, when the caller holds it.
|
|
2033
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
952
2034
|
- `disabled?: boolean`: The trigger cannot be pressed; a submenu's is passed over.
|
|
953
2035
|
- `loop?: boolean`: Whether the arrows go round from the last item to the first. Default: they do.
|
|
954
|
-
- `modal?: boolean`: Holds the page while the menu is open
|
|
2036
|
+
- `modal?: boolean`: Holds the page while the menu is open. Not for a submenu.
|
|
2037
|
+
- `(openChanged): { open: boolean; details: ChangeDetails }`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
2038
|
+
|
|
2039
|
+
Each part, and its own props:
|
|
2040
|
+
|
|
2041
|
+
- `[kpMenu]` is `KpMenu`. `exportAs: "kpMenu"`. `kpContextMenu` in place of `kpMenu` is a menu for an area of the page, opened at the pointer: its trigger is `kpContextMenuTrigger`, its other parts the menu's. Its props are above.
|
|
2042
|
+
- `[kpMenuTrigger]` is `KpMenuTrigger`.
|
|
2043
|
+
- `[kpMenuPortal]` is `KpMenuPortal`. Structural: written `*kpMenuPortal`. Draws what it holds at the end of `<body>`, or in the container a `PortalProvider` names.
|
|
2044
|
+
- `[kpMenuPositioner]` is `KpMenuPositioner`. Takes the positioner options ("Positioner options", above).
|
|
2045
|
+
- `[kpMenuPopup]` is `KpMenuPopup`.
|
|
2046
|
+
- `[kpMenuArrow]` is `KpMenuArrow`.
|
|
2047
|
+
- `[kpMenuItem]` is `KpMenuItem`.
|
|
2048
|
+
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
2049
|
+
- `label?: string`: What typing matches; the item's text when left out.
|
|
2050
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu. Default: it does.
|
|
2051
|
+
- `a[kpMenuLinkItem]` is `KpMenuLinkItem`. `<a kpMenuLinkItem href="…">`: an item that is a link.
|
|
2052
|
+
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
2053
|
+
- `label?: string`: What typing matches; the item's text when left out.
|
|
2054
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu. Default: it does.
|
|
2055
|
+
- `[kpMenuGroup]` is `KpMenuGroup`. Items that belong together, named by their label.
|
|
2056
|
+
- `[kpMenuGroupLabel]` is `KpMenuGroupLabel`. Names the group it is in. With no group around it, it is plain text.
|
|
2057
|
+
- `[kpMenuSeparator]` is `KpMenuSeparator`. A line between items.
|
|
2058
|
+
- `[kpMenuCheckboxItem]` is `KpMenuCheckboxItem`. `exportAs: "kpMenuCheckboxItem"`.
|
|
2059
|
+
- `[(checked)]: boolean`: Whether the item is checked, when the caller holds it.
|
|
2060
|
+
- `defaultChecked?: boolean`: Whether the item starts checked, when the caller does not hold `checked`. Read once.
|
|
2061
|
+
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
2062
|
+
- `label?: string`: What typing matches; the item's text when left out.
|
|
2063
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu. Default: it does not.
|
|
2064
|
+
- `(checkedChanged): { checked: boolean; details: ChangeDetails }`: Heard as the item is about to be checked or unchecked: `details.cancel()` keeps it as it was.
|
|
2065
|
+
- `[kpMenuCheckboxItemIndicator]` is `KpMenuCheckboxItemIndicator`. Structural: written `*kpMenuCheckboxItemIndicator`. `<span *kpMenuCheckboxItemIndicator>`: in the page while its item is checked.
|
|
2066
|
+
- `[kpMenuRadioGroup]` is `KpMenuRadioGroup`. `exportAs: "kpMenuRadioGroup"`. Generic: `<Value = unknown>`.
|
|
2067
|
+
- `[(value)]: Value | null`: The chosen value; `null` is "none".
|
|
2068
|
+
- `defaultValue?: NoInfer<Value> | null`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
2069
|
+
- `disabled?: boolean`: Disables every item of the group.
|
|
2070
|
+
- `(valueChanged): { value: Value; details: ChangeDetails }`: Told an item's own value, never `null`: a press chooses, and nothing takes the choice back.
|
|
2071
|
+
- `[kpMenuRadioItem]` is `KpMenuRadioItem`.
|
|
2072
|
+
- `value: unknown`: Required. What the radio group's value is while this item is the chosen one.
|
|
2073
|
+
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
2074
|
+
- `label?: string`: What typing matches; the item's text when left out.
|
|
2075
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu. Default: it does not.
|
|
2076
|
+
- `[kpMenuRadioItemIndicator]` is `KpMenuRadioItemIndicator`. Structural: written `*kpMenuRadioItemIndicator`. `<span *kpMenuRadioItemIndicator>`: in the page while its item is the chosen one.
|
|
2077
|
+
- `[kpMenuSubmenuRoot]` is `KpMenuSubmenuRoot`. `exportAs: "kpMenuSubmenuRoot"`. A menu that one of this menu's items opens. Its trigger is `kpMenuSubmenuTrigger`.
|
|
2078
|
+
- `[(open)]: boolean`: Whether it is open, when the caller holds it.
|
|
2079
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
2080
|
+
- `disabled?: boolean`: The trigger cannot be pressed; a submenu's is passed over.
|
|
2081
|
+
- `loop?: boolean`: Whether the arrows go round from the last item to the first. Default: they do.
|
|
2082
|
+
- `modal?: boolean`: Holds the page while the menu is open. Not for a submenu.
|
|
2083
|
+
- `(openChanged): { open: boolean; details: ChangeDetails }`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
2084
|
+
- `[kpMenuSubmenuTrigger]` is `KpMenuSubmenuTrigger`. On the item of a menu that opens the submenu around it (`kpMenuSubmenuRoot`).
|
|
955
2085
|
|
|
956
2086
|
Attributes and CSS variables, by part:
|
|
957
2087
|
|
|
@@ -961,7 +2091,7 @@ Attributes and CSS variables, by part:
|
|
|
961
2091
|
- positioner: Places the menu against its trigger. It carries the geometry.
|
|
962
2092
|
- `data-open`: Present when it is open.
|
|
963
2093
|
- `data-closed`: Present when it is closed.
|
|
964
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
2094
|
+
- `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.
|
|
965
2095
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
966
2096
|
- `--anchor-width`: The anchor's width.
|
|
967
2097
|
- `--anchor-height`: The anchor's height.
|
|
@@ -973,10 +2103,10 @@ Attributes and CSS variables, by part:
|
|
|
973
2103
|
- `data-closed`: Present when it is closed.
|
|
974
2104
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
975
2105
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
976
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
2106
|
+
- `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.
|
|
977
2107
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
978
2108
|
- arrow: An element that points at the trigger.
|
|
979
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
2109
|
+
- `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.
|
|
980
2110
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
981
2111
|
- `data-uncentered`: Present when the arrow cannot sit at the trigger's centre.
|
|
982
2112
|
- item: An action. Choosing it closes the menu.
|
|
@@ -1011,7 +2141,7 @@ Attributes and CSS variables, by part:
|
|
|
1011
2141
|
### Menubar
|
|
1012
2142
|
|
|
1013
2143
|
```
|
|
1014
|
-
import {
|
|
2144
|
+
import { KpMenubar } from "@kirana-ui/angular"
|
|
1015
2145
|
```
|
|
1016
2146
|
|
|
1017
2147
|
Props:
|
|
@@ -1020,6 +2150,8 @@ Props:
|
|
|
1020
2150
|
- `disabled?: boolean`: No menu of the bar opens.
|
|
1021
2151
|
- `orientation?: Orientation`: A row (the default) or a column of menus. In a column a menu opens beside its trigger.
|
|
1022
2152
|
|
|
2153
|
+
`[kpMenubar]` is `KpMenubar`. `exportAs: "kpMenubar"`. A row of menus that work as one. Each `kpMenu` inside it is one of its items.
|
|
2154
|
+
|
|
1023
2155
|
Attributes and CSS variables, by part:
|
|
1024
2156
|
|
|
1025
2157
|
- root: The row of menus. A menu inside it is one of its items.
|
|
@@ -1029,16 +2161,32 @@ Attributes and CSS variables, by part:
|
|
|
1029
2161
|
### MessageScroller
|
|
1030
2162
|
|
|
1031
2163
|
```
|
|
1032
|
-
import {
|
|
2164
|
+
import { KpMessageScroller, KpMessageScrollerViewport, KpMessageScrollerContent, KpMessageScrollerButton } from "@kirana-ui/angular"
|
|
1033
2165
|
```
|
|
1034
2166
|
|
|
1035
|
-
Parts: `[
|
|
2167
|
+
Parts: `[kpMessageScroller]`, `[kpMessageScrollerViewport]`, `[kpMessageScrollerContent]`, `[kpMessageScrollerButton]`.
|
|
2168
|
+
|
|
2169
|
+
Anatomy:
|
|
2170
|
+
|
|
2171
|
+
```
|
|
2172
|
+
kpMessageScroller
|
|
2173
|
+
kpMessageScrollerViewport
|
|
2174
|
+
kpMessageScrollerContent
|
|
2175
|
+
kpMessageScrollerButton
|
|
2176
|
+
```
|
|
1036
2177
|
|
|
1037
2178
|
Props of its root:
|
|
1038
2179
|
|
|
1039
2180
|
- `initial?: "bottom" | "top"`: Where it begins: at the newest message (the default), or at the first.
|
|
1040
2181
|
- `threshold?: number`: How near the end counts as at it, in pixels. Default: 24.
|
|
1041
|
-
- `
|
|
2182
|
+
- `(atBottomChanged): { atBottom: boolean; details: ChangeDetails }`: It came to the end, or left it.
|
|
2183
|
+
|
|
2184
|
+
Each part, and its own props:
|
|
2185
|
+
|
|
2186
|
+
- `[kpMessageScroller]` is `KpMessageScroller`. `exportAs: "kpMessageScroller"`. Its props are above.
|
|
2187
|
+
- `[kpMessageScrollerViewport]` is `KpMessageScrollerViewport`.
|
|
2188
|
+
- `[kpMessageScrollerContent]` is `KpMessageScrollerContent`. The messages: what grows as one is written.
|
|
2189
|
+
- `[kpMessageScrollerButton]` is `KpMessageScrollerButton`.
|
|
1042
2190
|
|
|
1043
2191
|
Attributes and CSS variables, by part:
|
|
1044
2192
|
|
|
@@ -1052,27 +2200,93 @@ Attributes and CSS variables, by part:
|
|
|
1052
2200
|
### Meter
|
|
1053
2201
|
|
|
1054
2202
|
```
|
|
1055
|
-
import {
|
|
2203
|
+
import { KpMeter, KpMeterTrack, KpMeterIndicator, KpMeterValue, KpMeterLabel } from "@kirana-ui/angular"
|
|
2204
|
+
```
|
|
2205
|
+
|
|
2206
|
+
Parts: `[kpMeter]`, `[kpMeterTrack]`, `[kpMeterIndicator]`, `[kpMeterValue]`, `[kpMeterLabel]`.
|
|
2207
|
+
|
|
2208
|
+
Anatomy:
|
|
2209
|
+
|
|
1056
2210
|
```
|
|
2211
|
+
kpMeter
|
|
2212
|
+
kpMeterTrack
|
|
2213
|
+
kpMeterIndicator
|
|
2214
|
+
kpMeterValue
|
|
2215
|
+
kpMeterLabel
|
|
2216
|
+
```
|
|
2217
|
+
|
|
2218
|
+
Props of its root:
|
|
2219
|
+
|
|
2220
|
+
- `value: number`: Required. The measure, between `min` and `max`. A meter always has one.
|
|
2221
|
+
- `min?: number`: Default 0.
|
|
2222
|
+
- `max?: number`: Default 100.
|
|
2223
|
+
- `format?: Intl.NumberFormatOptions`: How the value is written; a percentage of the range by default.
|
|
2224
|
+
- `locale?: string`: The language the value is written in; the page's by default.
|
|
2225
|
+
- `getAriaValueText?: (text: string | undefined, value: number | null) => string`: What assistive technology reads for the value, when the written value is not enough.
|
|
1057
2226
|
|
|
1058
|
-
|
|
2227
|
+
Each part, and its own props:
|
|
2228
|
+
|
|
2229
|
+
- `[kpMeter]` is `KpMeter`. `exportAs: "kpMeter"`. The meter: it says the value to assistive technology. Its props are above.
|
|
2230
|
+
- `[kpMeterTrack]` is `KpMeterTrack`. The whole range.
|
|
2231
|
+
- `[kpMeterIndicator]` is `KpMeterIndicator`. The filled part: its width is the value's share of the range.
|
|
2232
|
+
- `[kpMeterValue]` is `KpMeterValue`. Shows the written value.
|
|
2233
|
+
- `[kpMeterLabel]` is `KpMeterLabel`. The meter's name.
|
|
1059
2234
|
|
|
1060
2235
|
### NavigationMenu
|
|
1061
2236
|
|
|
1062
2237
|
```
|
|
1063
|
-
import {
|
|
2238
|
+
import { KpNavigationMenu, KpNavigationMenuList, KpNavigationMenuItem, KpNavigationMenuTrigger, KpNavigationMenuIcon, KpNavigationMenuContent, KpNavigationMenuLink, KpNavigationMenuPortal, KpNavigationMenuPositioner, KpNavigationMenuPopup, KpNavigationMenuViewport, KpNavigationMenuArrow, KpNavigationMenuBackdrop } from "@kirana-ui/angular"
|
|
1064
2239
|
```
|
|
1065
2240
|
|
|
1066
|
-
Parts: `[
|
|
2241
|
+
Parts: `[kpNavigationMenu]`, `[kpNavigationMenuList]`, `[kpNavigationMenuItem]`, `[kpNavigationMenuTrigger]`, `[kpNavigationMenuIcon]`, `[kpNavigationMenuContent]`, `[kpNavigationMenuLink]`, `[kpNavigationMenuPortal]`, `[kpNavigationMenuPositioner]`, `[kpNavigationMenuPopup]`, `[kpNavigationMenuViewport]`, `[kpNavigationMenuArrow]`, `[kpNavigationMenuBackdrop]`.
|
|
2242
|
+
|
|
2243
|
+
Anatomy:
|
|
2244
|
+
|
|
2245
|
+
```
|
|
2246
|
+
kpNavigationMenu
|
|
2247
|
+
kpNavigationMenuList
|
|
2248
|
+
kpNavigationMenuItem (repeated)
|
|
2249
|
+
kpNavigationMenuTrigger
|
|
2250
|
+
kpNavigationMenuIcon
|
|
2251
|
+
*kpNavigationMenuContent
|
|
2252
|
+
kpNavigationMenuLink (repeated)
|
|
2253
|
+
kpNavigationMenuLink (repeated, as above)
|
|
2254
|
+
kpNavigationMenuLink (repeated, as above)
|
|
2255
|
+
*kpNavigationMenuPortal
|
|
2256
|
+
kpNavigationMenuPositioner
|
|
2257
|
+
kpNavigationMenuPopup
|
|
2258
|
+
kpNavigationMenuViewport
|
|
2259
|
+
kpNavigationMenuArrow
|
|
2260
|
+
kpNavigationMenuBackdrop
|
|
2261
|
+
```
|
|
1067
2262
|
|
|
1068
2263
|
Props of its root:
|
|
1069
2264
|
|
|
1070
|
-
- `value
|
|
1071
|
-
- `defaultValue?: Value | null`
|
|
1072
|
-
- `
|
|
1073
|
-
- `
|
|
1074
|
-
- `
|
|
1075
|
-
- `
|
|
2265
|
+
- `[(value)]: Value | null`: The item whose content is shown; `null` is "none".
|
|
2266
|
+
- `defaultValue?: NoInfer<Value> | null`: The item whose content it starts with, when the caller does not hold `value`. Read once.
|
|
2267
|
+
- `delay?: number`: How long the pointer rests on a trigger before its content shows, in milliseconds. Default `50`.
|
|
2268
|
+
- `closeDelay?: number`: How long after the pointer leaves the content goes, in milliseconds. Default `50`.
|
|
2269
|
+
- `orientation?: Orientation`: Whether the triggers are laid out across (the default) or down: the arrows that move between them follow.
|
|
2270
|
+
- `(valueChanged): { value: Value | null; details: ChangeDetails }`: Heard as another item's content is about to show, or none: `details.cancel()` keeps the value as it was.
|
|
2271
|
+
|
|
2272
|
+
Each part, and its own props:
|
|
2273
|
+
|
|
2274
|
+
- `[kpNavigationMenu]` is `KpNavigationMenu`. `exportAs: "kpNavigationMenu"`. Generic: `<Value = unknown>`. Its props are above.
|
|
2275
|
+
- `[kpNavigationMenuList]` is `KpNavigationMenuList`.
|
|
2276
|
+
- `[kpNavigationMenuItem]` is `KpNavigationMenuItem`. On an item's `<li>`. `value` tells it from the others; an item that is given none makes its own.
|
|
2277
|
+
- `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.
|
|
2278
|
+
- `[kpNavigationMenuTrigger]` is `KpNavigationMenuTrigger`.
|
|
2279
|
+
- `[kpNavigationMenuIcon]` is `KpNavigationMenuIcon`.
|
|
2280
|
+
- `[kpNavigationMenuContent]` is `KpNavigationMenuContent`. Structural: written `*kpNavigationMenuContent`. `<div *kpNavigationMenuContent>`: an item's content, drawn in `kpNavigationMenuViewport` while it is shown.
|
|
2281
|
+
- `[kpNavigationMenuLink]` is `KpNavigationMenuLink`.
|
|
2282
|
+
- `active?: boolean`: The link is the page the reader is on.
|
|
2283
|
+
- `closeOnClick?: boolean`: Whether following it closes the menu. Default: it does.
|
|
2284
|
+
- `[kpNavigationMenuPortal]` is `KpNavigationMenuPortal`. Structural: written `*kpNavigationMenuPortal`. Draws what it holds at the end of `<body>`, or in the container a `PortalProvider` names.
|
|
2285
|
+
- `[kpNavigationMenuPositioner]` is `KpNavigationMenuPositioner`. Takes the positioner options ("Positioner options", above).
|
|
2286
|
+
- `[kpNavigationMenuPopup]` is `KpNavigationMenuPopup`.
|
|
2287
|
+
- `[kpNavigationMenuViewport]` is `KpNavigationMenuViewport`. Where the contents are drawn, inside the popup.
|
|
2288
|
+
- `[kpNavigationMenuArrow]` is `KpNavigationMenuArrow`.
|
|
2289
|
+
- `[kpNavigationMenuBackdrop]` is `KpNavigationMenuBackdrop`.
|
|
1076
2290
|
|
|
1077
2291
|
Attributes and CSS variables, by part:
|
|
1078
2292
|
|
|
@@ -1095,7 +2309,7 @@ Attributes and CSS variables, by part:
|
|
|
1095
2309
|
- positioner: Places the popup against the open item's trigger. It carries the geometry.
|
|
1096
2310
|
- `data-open`: Present when it is open.
|
|
1097
2311
|
- `data-closed`: Present when it is closed.
|
|
1098
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
2312
|
+
- `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.
|
|
1099
2313
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1100
2314
|
- `--anchor-width`: The anchor's width.
|
|
1101
2315
|
- `--anchor-height`: The anchor's height.
|
|
@@ -1109,12 +2323,12 @@ Attributes and CSS variables, by part:
|
|
|
1109
2323
|
- `data-closed`: Present when it is closed.
|
|
1110
2324
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1111
2325
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1112
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
2326
|
+
- `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.
|
|
1113
2327
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1114
2328
|
- `--popup-width`: The open content's width.
|
|
1115
2329
|
- `--popup-height`: The open content's height.
|
|
1116
2330
|
- arrow: An element that points at the open item's trigger.
|
|
1117
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
2331
|
+
- `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.
|
|
1118
2332
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1119
2333
|
- `data-uncentered`: Present when the arrow cannot sit at the trigger's centre.
|
|
1120
2334
|
- backdrop: An element behind the popup, for a design that dims the page.
|
|
@@ -1126,19 +2340,29 @@ Attributes and CSS variables, by part:
|
|
|
1126
2340
|
### NumberField
|
|
1127
2341
|
|
|
1128
2342
|
```
|
|
1129
|
-
import {
|
|
2343
|
+
import { KpNumberField, KpNumberFieldGroup, KpNumberFieldInput, KpNumberFieldIncrement, KpNumberFieldDecrement, KpNumberFieldScrubArea, KpNumberFieldScrubAreaCursor } from "@kirana-ui/angular"
|
|
1130
2344
|
```
|
|
1131
2345
|
|
|
1132
|
-
Parts: `[
|
|
2346
|
+
Parts: `[kpNumberField]`, `[kpNumberFieldGroup]`, `[kpNumberFieldInput]`, `[kpNumberFieldIncrement]`, `[kpNumberFieldDecrement]`, `[kpNumberFieldScrubArea]`, `[kpNumberFieldScrubAreaCursor]`.
|
|
2347
|
+
|
|
2348
|
+
Anatomy:
|
|
2349
|
+
|
|
2350
|
+
```
|
|
2351
|
+
kpNumberField
|
|
2352
|
+
kpNumberFieldGroup
|
|
2353
|
+
kpNumberFieldInput
|
|
2354
|
+
kpNumberFieldIncrement
|
|
2355
|
+
kpNumberFieldDecrement
|
|
2356
|
+
kpNumberFieldScrubArea
|
|
2357
|
+
*kpNumberFieldScrubAreaCursor
|
|
2358
|
+
```
|
|
1133
2359
|
|
|
1134
2360
|
Props of its root:
|
|
1135
2361
|
|
|
1136
|
-
- `value
|
|
1137
|
-
- `defaultValue?: number | null`
|
|
1138
|
-
- `
|
|
1139
|
-
- `
|
|
1140
|
-
- `min?: number`
|
|
1141
|
-
- `max?: number`
|
|
2362
|
+
- `[(value)]: number | null`: The number; `null` is "none".
|
|
2363
|
+
- `defaultValue?: number | null`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
2364
|
+
- `min?: number`: The least the number may be.
|
|
2365
|
+
- `max?: number`: The most the number may be.
|
|
1142
2366
|
- `step?: number`: What the buttons and the arrows move by. Default 1.
|
|
1143
2367
|
- `smallStep?: number`: With Alt held. Default 0.1.
|
|
1144
2368
|
- `largeStep?: number`: With Shift held. Default 10.
|
|
@@ -1146,11 +2370,26 @@ Props of its root:
|
|
|
1146
2370
|
- `allowWheelScrub?: boolean`: The wheel steps it while the pointer is over the input and focus is in it.
|
|
1147
2371
|
- `format?: Intl.NumberFormatOptions`: How the number is written.
|
|
1148
2372
|
- `locale?: string`: The language it is written in; the page's by default.
|
|
1149
|
-
- `disabled?: boolean
|
|
1150
|
-
- `readOnly?: boolean
|
|
1151
|
-
- `required?: boolean`
|
|
2373
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
2374
|
+
- `readOnly?: boolean`: Shown as it is, focusable, not changeable.
|
|
2375
|
+
- `required?: boolean`: Needed: in a `Field`, leaving it empty is then invalid.
|
|
1152
2376
|
- `name?: string`: With a name, the number is submitted with the form around it.
|
|
1153
2377
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
2378
|
+
- `(valueChanged): { value: number | null; details: ChangeDetails }`: Heard as the number is about to change, typed or stepped: `details.cancel()` keeps it as it was.
|
|
2379
|
+
- `(valueCommitted): { value: number | null; details: ChangeDetails }`: A change that is done: focus left the input, a key or a button stepped it.
|
|
2380
|
+
|
|
2381
|
+
Each part, and its own props:
|
|
2382
|
+
|
|
2383
|
+
- `[kpNumberField]` is `KpNumberField`. `exportAs: "kpNumberField"`. On the element that holds the field's parts. `[(value)]` is the number, `null` for none. With a name, it draws the hidden input a form reads. Its props are above.
|
|
2384
|
+
- `[kpNumberFieldGroup]` is `KpNumberFieldGroup`.
|
|
2385
|
+
- `[kpNumberFieldInput]` is `KpNumberFieldInput`.
|
|
2386
|
+
- `[kpNumberFieldIncrement]` is `KpNumberFieldIncrement`.
|
|
2387
|
+
- `[kpNumberFieldDecrement]` is `KpNumberFieldDecrement`.
|
|
2388
|
+
- `[kpNumberFieldScrubArea]` is `KpNumberFieldScrubArea`. On the element that is pressed and dragged to change the number: the field's label, as a rule.
|
|
2389
|
+
- `direction?: "horizontal" | "vertical"`: The way the pointer is dragged: `"horizontal"`, where right is more, or `"vertical"`, where up is more. Default `"horizontal"`.
|
|
2390
|
+
- `pixelSensitivity?: number`: How many pixels the pointer moves before the number changes. Default 2.
|
|
2391
|
+
- `teleportDistance?: number`: How far past the area's edges the drawn cursor goes before it comes back in at the other side. Default: the edges of the window.
|
|
2392
|
+
- `[kpNumberFieldScrubAreaCursor]` is `KpNumberFieldScrubAreaCursor`. Structural: written `*kpNumberFieldScrubAreaCursor`. `<span *kpNumberFieldScrubAreaCursor>`: drawn in place of the pointer while it is locked for a drag, at the end of the page.
|
|
1154
2393
|
|
|
1155
2394
|
Attributes and CSS variables, by part:
|
|
1156
2395
|
|
|
@@ -1162,6 +2401,7 @@ Attributes and CSS variables, by part:
|
|
|
1162
2401
|
- `data-dirty`: Present while the number is not the one it started with.
|
|
1163
2402
|
- `data-filled`: Present while there is a number.
|
|
1164
2403
|
- `data-focused`: Present while the input has focus.
|
|
2404
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
1165
2405
|
- `data-valid`: In a field: present once the number was checked and found right.
|
|
1166
2406
|
- `data-invalid`: In a field: present while the number is wrong.
|
|
1167
2407
|
- group: What holds the input and its buttons, as one control.
|
|
@@ -1172,6 +2412,7 @@ Attributes and CSS variables, by part:
|
|
|
1172
2412
|
- `data-dirty`: Present while the number is not the one it started with.
|
|
1173
2413
|
- `data-filled`: Present while there is a number.
|
|
1174
2414
|
- `data-focused`: Present while the input has focus.
|
|
2415
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
1175
2416
|
- `data-valid`: In a field: present once the number was checked and found right.
|
|
1176
2417
|
- `data-invalid`: In a field: present while the number is wrong.
|
|
1177
2418
|
- input: The text input: it takes what its locale writes a number with.
|
|
@@ -1182,6 +2423,7 @@ Attributes and CSS variables, by part:
|
|
|
1182
2423
|
- `data-dirty`: Present while the number is not the one it started with.
|
|
1183
2424
|
- `data-filled`: Present while there is a number.
|
|
1184
2425
|
- `data-focused`: Present while the input has focus.
|
|
2426
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
1185
2427
|
- `data-valid`: In a field: present once the number was checked and found right.
|
|
1186
2428
|
- `data-invalid`: In a field: present while the number is wrong.
|
|
1187
2429
|
- increment: A button that steps the number up. Held, it goes on.
|
|
@@ -1192,6 +2434,7 @@ Attributes and CSS variables, by part:
|
|
|
1192
2434
|
- `data-dirty`: Present while the number is not the one it started with.
|
|
1193
2435
|
- `data-filled`: Present while there is a number.
|
|
1194
2436
|
- `data-focused`: Present while the input has focus.
|
|
2437
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
1195
2438
|
- `data-valid`: In a field: present once the number was checked and found right.
|
|
1196
2439
|
- `data-invalid`: In a field: present while the number is wrong.
|
|
1197
2440
|
- decrement: A button that steps the number down. Held, it goes on.
|
|
@@ -1202,28 +2445,73 @@ Attributes and CSS variables, by part:
|
|
|
1202
2445
|
- `data-dirty`: Present while the number is not the one it started with.
|
|
1203
2446
|
- `data-filled`: Present while there is a number.
|
|
1204
2447
|
- `data-focused`: Present while the input has focus.
|
|
2448
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
2449
|
+
- `data-valid`: In a field: present once the number was checked and found right.
|
|
2450
|
+
- `data-invalid`: In a field: present while the number is wrong.
|
|
2451
|
+
- 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.
|
|
2452
|
+
- `data-disabled`: Present when it is disabled.
|
|
2453
|
+
- `data-readonly`: Present when the number cannot be changed.
|
|
2454
|
+
- `data-required`: Present when a number must be given.
|
|
2455
|
+
- `data-touched`: Present once focus has left the input.
|
|
2456
|
+
- `data-dirty`: Present while the number is not the one it started with.
|
|
2457
|
+
- `data-filled`: Present while there is a number.
|
|
2458
|
+
- `data-focused`: Present while the input has focus.
|
|
2459
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
2460
|
+
- `data-valid`: In a field: present once the number was checked and found right.
|
|
2461
|
+
- `data-invalid`: In a field: present while the number is wrong.
|
|
2462
|
+
- 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.
|
|
2463
|
+
- `data-disabled`: Present when it is disabled.
|
|
2464
|
+
- `data-readonly`: Present when the number cannot be changed.
|
|
2465
|
+
- `data-required`: Present when a number must be given.
|
|
2466
|
+
- `data-touched`: Present once focus has left the input.
|
|
2467
|
+
- `data-dirty`: Present while the number is not the one it started with.
|
|
2468
|
+
- `data-filled`: Present while there is a number.
|
|
2469
|
+
- `data-focused`: Present while the input has focus.
|
|
2470
|
+
- `data-scrubbing`: Present while the number is dragged from its scrub area.
|
|
1205
2471
|
- `data-valid`: In a field: present once the number was checked and found right.
|
|
1206
2472
|
- `data-invalid`: In a field: present while the number is wrong.
|
|
1207
2473
|
|
|
1208
2474
|
### Otp
|
|
1209
2475
|
|
|
1210
2476
|
```
|
|
1211
|
-
import {
|
|
2477
|
+
import { KpOtp, KpOtpInput, KpOtpGroup, KpOtpSlot, KpOtpSeparator, KpOtpCaret } from "@kirana-ui/angular"
|
|
1212
2478
|
```
|
|
1213
2479
|
|
|
1214
|
-
Parts: `[
|
|
2480
|
+
Parts: `[kpOtp]`, `input[kpOtpInput]`, `[kpOtpGroup]`, `[kpOtpSlot]`, `[kpOtpSeparator]`, `[kpOtpCaret]`.
|
|
2481
|
+
|
|
2482
|
+
Anatomy:
|
|
2483
|
+
|
|
2484
|
+
```
|
|
2485
|
+
kpOtp
|
|
2486
|
+
input[kpOtpInput]
|
|
2487
|
+
kpOtpGroup (repeated)
|
|
2488
|
+
kpOtpSlot (repeated)
|
|
2489
|
+
*kpOtpCaret
|
|
2490
|
+
kpOtpSeparator (repeated)
|
|
2491
|
+
```
|
|
1215
2492
|
|
|
1216
2493
|
Props of its root:
|
|
1217
2494
|
|
|
1218
2495
|
- `length?: number`: How many characters the code has. Default: 6.
|
|
1219
|
-
- `value
|
|
1220
|
-
- `defaultValue?: string`
|
|
1221
|
-
- `
|
|
1222
|
-
- `
|
|
1223
|
-
- `
|
|
1224
|
-
- `disabled?: boolean`
|
|
2496
|
+
- `[(value)]: string`: The characters typed so far, when the caller holds them.
|
|
2497
|
+
- `defaultValue?: string`: The characters it starts with, when the caller does not hold `value`. Read once. Default `""`.
|
|
2498
|
+
- `mode?: "numeric" | "alphabetic" | "alphanumeric" | "text"`: What a character may be: a digit (`numeric`), a letter (`alphabetic`, `a` to `z` either case), either (`alphanumeric`), or anything but white space (`text`). 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.
|
|
2499
|
+
- `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 `mode`'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, `mode` only says the keyboard, and defaults to `text`.
|
|
2500
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
1225
2501
|
- `name?: string`: With a name, the code is submitted with the form around it.
|
|
1226
2502
|
- `form?: string`: The id of the form the input belongs to, when it is not inside it.
|
|
2503
|
+
- `(valueChanged): { value: string; details: ChangeDetails }`: Heard as the characters are about to change: `details.cancel()` keeps them as they were.
|
|
2504
|
+
- `(completed): string`: Every character is in: the moment to send the code.
|
|
2505
|
+
|
|
2506
|
+
Each part, and its own props:
|
|
2507
|
+
|
|
2508
|
+
- `[kpOtp]` is `KpOtp`. `exportAs: "kpOtp"`. Its props are above.
|
|
2509
|
+
- `input[kpOtpInput]` is `KpOtpInput`. `<input kpOtpInput>`: the one input the code is typed in.
|
|
2510
|
+
- `[kpOtpGroup]` is `KpOtpGroup`. Cells that are drawn together.
|
|
2511
|
+
- `[kpOtpSlot]` is `KpOtpSlot`. One cell. It writes its character before whatever is inside it (a caret), and leaves that alone.
|
|
2512
|
+
- `index: number`: Required. Which character of the code it shows, from 0.
|
|
2513
|
+
- `[kpOtpSeparator]` is `KpOtpSeparator`. A mark between groups of cells.
|
|
2514
|
+
- `[kpOtpCaret]` is `KpOtpCaret`. Structural: written `*kpOtpCaret`. `<div *kpOtpCaret>`: in its cell while the cell is the active one and empty.
|
|
1227
2515
|
|
|
1228
2516
|
Attributes and CSS variables, by part:
|
|
1229
2517
|
|
|
@@ -1242,21 +2530,42 @@ Attributes and CSS variables, by part:
|
|
|
1242
2530
|
### Pagination
|
|
1243
2531
|
|
|
1244
2532
|
```
|
|
1245
|
-
import {
|
|
2533
|
+
import { KpPagination, KpPaginationItems, KpPaginationItem, KpPaginationEllipsis, KpPaginationPrevious, KpPaginationNext } from "@kirana-ui/angular"
|
|
1246
2534
|
```
|
|
1247
2535
|
|
|
1248
|
-
Parts: `[
|
|
2536
|
+
Parts: `[kpPagination]`, `[kpPaginationItems]`, `[kpPaginationItem]`, `[kpPaginationEllipsis]`, `[kpPaginationPrevious]`, `[kpPaginationNext]`.
|
|
2537
|
+
|
|
2538
|
+
Anatomy:
|
|
2539
|
+
|
|
2540
|
+
```
|
|
2541
|
+
kpPagination
|
|
2542
|
+
*kpPaginationItems
|
|
2543
|
+
kpPaginationItem (repeated)
|
|
2544
|
+
kpPaginationEllipsis (repeated)
|
|
2545
|
+
kpPaginationPrevious
|
|
2546
|
+
kpPaginationNext
|
|
2547
|
+
```
|
|
1249
2548
|
|
|
1250
2549
|
Props of its root:
|
|
1251
2550
|
|
|
1252
|
-
- `page
|
|
1253
|
-
- `defaultPage?: number`
|
|
1254
|
-
- `
|
|
1255
|
-
- `count: number`: How many items there are in all.
|
|
2551
|
+
- `[(page)]: number`: The page shown, from 1.
|
|
2552
|
+
- `defaultPage?: number`: The page it starts at, when the caller does not hold `page`. Read once. Default `1`.
|
|
2553
|
+
- `count: number`: Required. How many items there are in all.
|
|
1256
2554
|
- `pageSize?: number`: How many items a page holds. Default 10.
|
|
1257
2555
|
- `siblingCount?: number`: How many pages are listed each side of the one shown. Default 1.
|
|
1258
2556
|
- `boundaryCount?: number`: How many pages are always listed at each end. Default 1.
|
|
1259
|
-
- `disabled?: boolean
|
|
2557
|
+
- `disabled?: boolean`: Disabled: no page can be gone to.
|
|
2558
|
+
- `(pageChanged): { page: number; details: ChangeDetails }`: Heard as another page is about to be shown: `details.cancel()` keeps the page as it was.
|
|
2559
|
+
|
|
2560
|
+
Each part, and its own props:
|
|
2561
|
+
|
|
2562
|
+
- `[kpPagination]` is `KpPagination`. `exportAs: "kpPagination"`. On a `<nav>`. `[(page)]` is the page shown, from 1. Its props are above.
|
|
2563
|
+
- `[kpPaginationItems]` is `KpPaginationItems`. Structural: written `*kpPaginationItems`. Its template is given the entry: `let entry` is a `PaginationEntry`. `<ng-container *kpPaginationItems="let entry">`: once for each piece of the row, a page or the mark for pages left out.
|
|
2564
|
+
- `[kpPaginationItem]` is `KpPaginationItem`.
|
|
2565
|
+
- `page: number`: Required. The page it goes to, from 1.
|
|
2566
|
+
- `[kpPaginationEllipsis]` is `KpPaginationEllipsis`. The mark for pages left out of the row.
|
|
2567
|
+
- `[kpPaginationPrevious]` is `KpPaginationPrevious`.
|
|
2568
|
+
- `[kpPaginationNext]` is `KpPaginationNext`.
|
|
1260
2569
|
|
|
1261
2570
|
Attributes and CSS variables, by part:
|
|
1262
2571
|
|
|
@@ -1273,25 +2582,62 @@ Attributes and CSS variables, by part:
|
|
|
1273
2582
|
### Popover
|
|
1274
2583
|
|
|
1275
2584
|
```
|
|
1276
|
-
import {
|
|
2585
|
+
import { KpPopover, KpPopoverTrigger, KpPopoverPortal, KpPopoverBackdrop, KpPopoverPositioner, KpPopoverPopup, KpPopoverArrow, KpPopoverTitle, KpPopoverDescription, KpPopoverClose } from "@kirana-ui/angular"
|
|
1277
2586
|
```
|
|
1278
2587
|
|
|
1279
|
-
Parts: `[
|
|
2588
|
+
Parts: `[kpPopover]`, `[kpPopoverTrigger]`, `[kpPopoverPortal]`, `[kpPopoverBackdrop]`, `[kpPopoverPositioner]`, `[kpPopoverPopup]`, `[kpPopoverArrow]`, `[kpPopoverTitle]`, `[kpPopoverDescription]`, `[kpPopoverClose]`.
|
|
2589
|
+
|
|
2590
|
+
Anatomy:
|
|
2591
|
+
|
|
2592
|
+
```
|
|
2593
|
+
kpPopover
|
|
2594
|
+
kpPopoverTrigger
|
|
2595
|
+
*kpPopoverPortal
|
|
2596
|
+
kpPopoverBackdrop
|
|
2597
|
+
kpPopoverPositioner
|
|
2598
|
+
kpPopoverPopup
|
|
2599
|
+
kpPopoverTitle
|
|
2600
|
+
kpPopoverDescription
|
|
2601
|
+
kpPopoverClose
|
|
2602
|
+
kpPopoverArrow
|
|
2603
|
+
```
|
|
1280
2604
|
|
|
1281
2605
|
Props of its root:
|
|
1282
2606
|
|
|
1283
|
-
- `open
|
|
1284
|
-
- `defaultOpen?: boolean`
|
|
1285
|
-
- `
|
|
2607
|
+
- `[(open)]: boolean`: Whether it is open, when the caller holds it.
|
|
2608
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
2609
|
+
- `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.
|
|
2610
|
+
- `(openChanged): { open: boolean; details: ChangeDetails }`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
2611
|
+
|
|
2612
|
+
Each part, and its own props:
|
|
2613
|
+
|
|
2614
|
+
- `[kpPopover]` is `KpPopover`. `exportAs: "kpPopover"`. Holds the popover: whether it is open. Its props are above.
|
|
2615
|
+
- `[kpPopoverTrigger]` is `KpPopoverTrigger`.
|
|
2616
|
+
- `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`.
|
|
2617
|
+
- `delay?: number`: How long the pointer rests on the trigger before the popover opens, in milliseconds. Default 300.
|
|
2618
|
+
- `closeDelay?: number`: How long after the pointer leaves a popover it opened closes, in milliseconds. Default 0.
|
|
2619
|
+
- `[kpPopoverPortal]` is `KpPopoverPortal`. Structural: written `*kpPopoverPortal`. Draws what it holds at the end of `<body>`, or in the container a `PortalProvider` names.
|
|
2620
|
+
- `[kpPopoverBackdrop]` is `KpPopoverBackdrop`.
|
|
2621
|
+
- `[kpPopoverPositioner]` is `KpPopoverPositioner`. Takes the positioner options ("Positioner options", above).
|
|
2622
|
+
- `[kpPopoverPopup]` is `KpPopoverPopup`.
|
|
2623
|
+
- `[kpPopoverArrow]` is `KpPopoverArrow`.
|
|
2624
|
+
- `[kpPopoverTitle]` is `KpPopoverTitle`. The heading that names the popover.
|
|
2625
|
+
- `[kpPopoverDescription]` is `KpPopoverDescription`. The text that describes the popover.
|
|
2626
|
+
- `[kpPopoverClose]` is `KpPopoverClose`. A button that closes the popover.
|
|
1286
2627
|
|
|
1287
2628
|
Attributes and CSS variables, by part:
|
|
1288
2629
|
|
|
1289
2630
|
- trigger: The button that opens the popover, and what it is placed against.
|
|
1290
2631
|
- `data-popup-open`: Present when the popover is open.
|
|
2632
|
+
- backdrop: A layer over the page behind the popover.
|
|
2633
|
+
- `data-open`: Present when it is open.
|
|
2634
|
+
- `data-closed`: Present when it is closed.
|
|
2635
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
2636
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1291
2637
|
- positioner: Places the popup against the trigger. It carries the geometry.
|
|
1292
2638
|
- `data-open`: Present when it is open.
|
|
1293
2639
|
- `data-closed`: Present when it is closed.
|
|
1294
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
2640
|
+
- `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.
|
|
1295
2641
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1296
2642
|
- `--anchor-width`: The anchor's width.
|
|
1297
2643
|
- `--anchor-height`: The anchor's height.
|
|
@@ -1303,31 +2649,47 @@ Attributes and CSS variables, by part:
|
|
|
1303
2649
|
- `data-closed`: Present when it is closed.
|
|
1304
2650
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1305
2651
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1306
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
2652
|
+
- `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.
|
|
2653
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2654
|
+
- arrow: An element that points at the trigger, placed along the popup's edge.
|
|
2655
|
+
- `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.
|
|
1307
2656
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2657
|
+
- `data-uncentered`: Present when the popup was pushed along its edge, so the arrow is not at the trigger's centre.
|
|
1308
2658
|
|
|
1309
|
-
###
|
|
2659
|
+
### Progress
|
|
1310
2660
|
|
|
1311
2661
|
```
|
|
1312
|
-
import {
|
|
2662
|
+
import { KpProgress, KpProgressTrack, KpProgressIndicator, KpProgressValue, KpProgressLabel } from "@kirana-ui/angular"
|
|
1313
2663
|
```
|
|
1314
2664
|
|
|
1315
|
-
|
|
2665
|
+
Parts: `[kpProgress]`, `[kpProgressTrack]`, `[kpProgressIndicator]`, `[kpProgressValue]`, `[kpProgressLabel]`.
|
|
2666
|
+
|
|
2667
|
+
Anatomy:
|
|
1316
2668
|
|
|
1317
2669
|
```
|
|
1318
|
-
|
|
2670
|
+
kpProgress
|
|
2671
|
+
kpProgressTrack
|
|
2672
|
+
kpProgressIndicator
|
|
2673
|
+
kpProgressValue
|
|
2674
|
+
kpProgressLabel
|
|
1319
2675
|
```
|
|
1320
2676
|
|
|
1321
|
-
Parts: `[kuiProgress]`, `[kuiProgressTrack]`, `[kuiProgressIndicator]`, `[kuiProgressValue]`, `[kuiProgressLabel]`.
|
|
1322
|
-
|
|
1323
2677
|
Props of its root:
|
|
1324
2678
|
|
|
1325
|
-
- `value: number | null`: The value. For a progress bar, `null` is "under way, how far is not known".
|
|
2679
|
+
- `value: number | null`: Required. The value. For a progress bar, `null` is "under way, how far is not known".
|
|
1326
2680
|
- `min?: number`: Default 0.
|
|
1327
2681
|
- `max?: number`: Default 100.
|
|
1328
2682
|
- `format?: Intl.NumberFormatOptions`: How the value is written; a percentage of the range by default.
|
|
1329
2683
|
- `locale?: string`: The language the value is written in; the page's by default.
|
|
1330
|
-
- `getAriaValueText?: (
|
|
2684
|
+
- `getAriaValueText?: (text: string | undefined, value: number | null) => string`: What assistive technology reads for the value, when the written value is not enough.
|
|
2685
|
+
|
|
2686
|
+
Each part, and its own props:
|
|
2687
|
+
|
|
2688
|
+
- `[kpProgress]` is `KpProgress`. `exportAs: "kpProgress"`. Its props are above.
|
|
2689
|
+
- `[kpProgressTrack]` is `KpProgressTrack`.
|
|
2690
|
+
- `[kpProgressIndicator]` is `KpProgressIndicator`.
|
|
2691
|
+
- `[kpProgressValue]` is `KpProgressValue`. Shows the written value.
|
|
2692
|
+
- `[kpProgressLabel]` is `KpProgressLabel`.
|
|
1331
2693
|
|
|
1332
2694
|
Attributes and CSS variables, by part:
|
|
1333
2695
|
|
|
@@ -1355,16 +2717,30 @@ Attributes and CSS variables, by part:
|
|
|
1355
2717
|
### QrCode
|
|
1356
2718
|
|
|
1357
2719
|
```
|
|
1358
|
-
import {
|
|
2720
|
+
import { KpQrCode, KpQrCodeFrame, KpQrCodePattern } from "@kirana-ui/angular"
|
|
1359
2721
|
```
|
|
1360
2722
|
|
|
1361
|
-
Parts: `[
|
|
2723
|
+
Parts: `[kpQrCode]`, `[kpQrCodeFrame]`, `[kpQrCodePattern]`.
|
|
2724
|
+
|
|
2725
|
+
Anatomy:
|
|
2726
|
+
|
|
2727
|
+
```
|
|
2728
|
+
kpQrCode
|
|
2729
|
+
kpQrCodeFrame
|
|
2730
|
+
kpQrCodePattern
|
|
2731
|
+
```
|
|
1362
2732
|
|
|
1363
2733
|
Props of its root:
|
|
1364
2734
|
|
|
1365
|
-
- `value
|
|
2735
|
+
- `value?: string`: What the code says: a link, a text.
|
|
1366
2736
|
- `correction?: QrCorrection`: How much of it may be lost and still be read. Default: `"M"`.
|
|
1367
2737
|
|
|
2738
|
+
Each part, and its own props:
|
|
2739
|
+
|
|
2740
|
+
- `[kpQrCode]` is `KpQrCode`. `exportAs: "kpQrCode"`. Its props are above.
|
|
2741
|
+
- `[kpQrCodeFrame]` is `KpQrCodeFrame`. `<svg kpQrCodeFrame>`: the drawing.
|
|
2742
|
+
- `[kpQrCodePattern]` is `KpQrCodePattern`. `<svg:path kpQrCodePattern>`: the dark modules.
|
|
2743
|
+
|
|
1368
2744
|
Attributes and CSS variables, by part:
|
|
1369
2745
|
|
|
1370
2746
|
- root: What holds the code.
|
|
@@ -1373,21 +2749,37 @@ Attributes and CSS variables, by part:
|
|
|
1373
2749
|
### RadioGroup
|
|
1374
2750
|
|
|
1375
2751
|
```
|
|
1376
|
-
import {
|
|
2752
|
+
import { KpRadioGroup, KpRadioGroupItem, KpRadioGroupIndicator } from "@kirana-ui/angular"
|
|
1377
2753
|
```
|
|
1378
2754
|
|
|
1379
|
-
Parts: `[
|
|
2755
|
+
Parts: `[kpRadioGroup]`, `[kpRadioGroupItem]`, `[kpRadioGroupIndicator]`.
|
|
2756
|
+
|
|
2757
|
+
Anatomy:
|
|
2758
|
+
|
|
2759
|
+
```
|
|
2760
|
+
kpRadioGroup
|
|
2761
|
+
kpRadioGroupItem (repeated)
|
|
2762
|
+
*kpRadioGroupIndicator
|
|
2763
|
+
```
|
|
1380
2764
|
|
|
1381
2765
|
Props of its root:
|
|
1382
2766
|
|
|
1383
|
-
- `value
|
|
1384
|
-
- `defaultValue?: Value | null`
|
|
1385
|
-
- `
|
|
1386
|
-
- `
|
|
1387
|
-
- `
|
|
1388
|
-
- `required?: boolean`
|
|
2767
|
+
- `[(value)]: Value | null`: The chosen value; `null` is "none".
|
|
2768
|
+
- `defaultValue?: NoInfer<Value> | null`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
2769
|
+
- `disabled?: boolean`: Disables every item of the group.
|
|
2770
|
+
- `readOnly?: boolean`: Shown as it is, focusable, not changeable.
|
|
2771
|
+
- `required?: boolean`: Needed: in a `Field`, choosing none is then invalid.
|
|
1389
2772
|
- `name?: string`: With a name, the chosen value is submitted with the form around the group.
|
|
1390
2773
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
2774
|
+
- `(valueChanged): { value: Value | null; details: ChangeDetails }`: The change with why it happened; `details.cancel()` keeps the value.
|
|
2775
|
+
|
|
2776
|
+
Each part, and its own props:
|
|
2777
|
+
|
|
2778
|
+
- `[kpRadioGroup]` is `KpRadioGroup`. `exportAs: "kpRadioGroup"`. Generic: `<Value = unknown>`. Its props are above.
|
|
2779
|
+
- `[kpRadioGroupItem]` is `KpRadioGroupItem`. On an item's element. It draws the hidden native radio inside it, which a form and a label reach.
|
|
2780
|
+
- `value: unknown`: Required. What the group's value is while this item is the chosen one.
|
|
2781
|
+
- `disabled?: boolean`: Disables this item: it cannot be chosen.
|
|
2782
|
+
- `[kpRadioGroupIndicator]` is `KpRadioGroupIndicator`. Structural: written `*kpRadioGroupIndicator`. `<span *kpRadioGroupIndicator>`: in the page while its item is the chosen one.
|
|
1391
2783
|
|
|
1392
2784
|
Attributes and CSS variables, by part:
|
|
1393
2785
|
|
|
@@ -1395,7 +2787,7 @@ Attributes and CSS variables, by part:
|
|
|
1395
2787
|
- `data-disabled`: Present when it is disabled.
|
|
1396
2788
|
- `data-readonly`: Present when it can be read but not changed.
|
|
1397
2789
|
- `data-required`: Present when the form needs it.
|
|
1398
|
-
- item: One choice. It holds a hidden native radio, which a form and a label reach.
|
|
2790
|
+
- 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.
|
|
1399
2791
|
- `data-checked`: Present when it is checked.
|
|
1400
2792
|
- `data-unchecked`: Present when it is not checked.
|
|
1401
2793
|
- `data-disabled`: Present when it is disabled.
|
|
@@ -1413,27 +2805,45 @@ Attributes and CSS variables, by part:
|
|
|
1413
2805
|
### Resizable
|
|
1414
2806
|
|
|
1415
2807
|
```
|
|
1416
|
-
import {
|
|
2808
|
+
import { KpResizableGroup, KpResizablePanel, KpResizableHandle } from "@kirana-ui/angular"
|
|
1417
2809
|
```
|
|
1418
2810
|
|
|
1419
|
-
Parts: `[
|
|
2811
|
+
Parts: `[kpResizableGroup]`, `[kpResizablePanel]`, `[kpResizableHandle]`.
|
|
2812
|
+
|
|
2813
|
+
Anatomy:
|
|
2814
|
+
|
|
2815
|
+
```
|
|
2816
|
+
kpResizableGroup
|
|
2817
|
+
kpResizablePanel (repeated)
|
|
2818
|
+
kpResizableHandle (repeated)
|
|
2819
|
+
```
|
|
1420
2820
|
|
|
1421
2821
|
Props of its root:
|
|
1422
2822
|
|
|
1423
2823
|
- `orientation?: Orientation`: Whether the panels are side by side (the default) or one over the other.
|
|
1424
|
-
- `onSizesChange?: ((sizes: number[], details: ChangeDetails) => void)`: Heard as the panels are resized: each panel's share, in the page's order, summing to 100.
|
|
1425
2824
|
- `keyboardStep?: number`: How far an arrow key moves a handle, in hundredths of the group. Default: 10.
|
|
1426
|
-
- `disabled?: boolean
|
|
2825
|
+
- `disabled?: boolean`: Disabled: the handles cannot be dragged or moved with the keyboard.
|
|
2826
|
+
- `(sizesChanged): { sizes: number[]; details: ChangeDetails }`: Each panel's share as the panels are resized, with why.
|
|
2827
|
+
|
|
2828
|
+
Each part, and its own props:
|
|
2829
|
+
|
|
2830
|
+
- `[kpResizableGroup]` is `KpResizableGroup`. `exportAs: "kpResizableGroup"`. Its props are above.
|
|
2831
|
+
- `[kpResizablePanel]` is `KpResizablePanel`.
|
|
2832
|
+
- `defaultSize?: number`: Its share to begin with, in hundredths of the group. Either every panel gives one or none does (they are then equal).
|
|
2833
|
+
- `minSize?: number`: The least it can be made. Default: 0.
|
|
2834
|
+
- `maxSize?: number`: The most it can be made. Default: 100.
|
|
2835
|
+
- `[kpResizableHandle]` is `KpResizableHandle`.
|
|
2836
|
+
- `disabled?: boolean`: Disables this handle: it cannot be dragged or moved with the keyboard.
|
|
1427
2837
|
|
|
1428
2838
|
Attributes and CSS variables, by part:
|
|
1429
2839
|
|
|
1430
|
-
- group: The panels and the bars between them. A design lays it out as a flex box.
|
|
2840
|
+
- 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.
|
|
1431
2841
|
- `data-orientation="horizontal | vertical"`: Whether the panels are side by side or one over the other.
|
|
1432
2842
|
- `data-disabled`: Present when it is disabled.
|
|
1433
|
-
- panel: One panel. It carries its share of the group.
|
|
2843
|
+
- 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.
|
|
1434
2844
|
- `data-orientation="horizontal | vertical"`: Whether the panels are side by side or one over the other.
|
|
1435
2845
|
- `--panel-size`: The panel's share, in hundredths of the group.
|
|
1436
|
-
- handle: The bar between two panels: dragged, or moved with the arrows.
|
|
2846
|
+
- 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.
|
|
1437
2847
|
- `data-orientation="horizontal | vertical"`: Whether the panels are side by side or one over the other.
|
|
1438
2848
|
- `data-dragging`: Present while the bar is dragged.
|
|
1439
2849
|
- `data-disabled`: Present when it is disabled.
|
|
@@ -1441,55 +2851,129 @@ Attributes and CSS variables, by part:
|
|
|
1441
2851
|
### ScrollArea
|
|
1442
2852
|
|
|
1443
2853
|
```
|
|
1444
|
-
import {
|
|
2854
|
+
import { KpScrollArea, KpScrollAreaViewport, KpScrollAreaContent, KpScrollAreaScrollbar, KpScrollAreaThumb, KpScrollAreaCorner } from "@kirana-ui/angular"
|
|
2855
|
+
```
|
|
2856
|
+
|
|
2857
|
+
Parts: `[kpScrollArea]`, `[kpScrollAreaViewport]`, `[kpScrollAreaContent]`, `[kpScrollAreaScrollbar]`, `[kpScrollAreaThumb]`, `[kpScrollAreaCorner]`.
|
|
2858
|
+
|
|
2859
|
+
Anatomy:
|
|
2860
|
+
|
|
2861
|
+
```
|
|
2862
|
+
kpScrollArea
|
|
2863
|
+
kpScrollAreaViewport
|
|
2864
|
+
kpScrollAreaContent (optional)
|
|
2865
|
+
*kpScrollAreaScrollbar (repeated, as above)
|
|
2866
|
+
*kpScrollAreaScrollbar (repeated)
|
|
2867
|
+
kpScrollAreaThumb
|
|
2868
|
+
*kpScrollAreaCorner
|
|
1445
2869
|
```
|
|
1446
2870
|
|
|
1447
|
-
|
|
2871
|
+
Each part, and its own props:
|
|
2872
|
+
|
|
2873
|
+
- `[kpScrollArea]` is `KpScrollArea`. `exportAs: "kpScrollArea"`.
|
|
2874
|
+
- `[kpScrollAreaViewport]` is `KpScrollAreaViewport`.
|
|
2875
|
+
- `[kpScrollAreaContent]` is `KpScrollAreaContent`. 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).
|
|
2876
|
+
- `[kpScrollAreaScrollbar]` is `KpScrollAreaScrollbar`. Structural: written `*kpScrollAreaScrollbar`. `<div *kpScrollAreaScrollbar="'horizontal'">`: in the page while there is something to scroll its way (`vertical` when no orientation is given).
|
|
2877
|
+
- `*kpScrollAreaScrollbar: Orientation | ""`: The directive's own value: `*kpScrollAreaScrollbar="…"`. Which way it scrolls: `'horizontal'`, or `'vertical'` when none is given.
|
|
2878
|
+
- `keepMounted?: boolean`: Written after the directive's value: `*kpScrollAreaScrollbar="…; keepMounted: …"`. In the page even while there is nothing to scroll its way.
|
|
2879
|
+
- `[kpScrollAreaThumb]` is `KpScrollAreaThumb`.
|
|
2880
|
+
- `[kpScrollAreaCorner]` is `KpScrollAreaCorner`. Structural: written `*kpScrollAreaCorner`. `<div *kpScrollAreaCorner>`: in the page while both scrollbars are.
|
|
1448
2881
|
|
|
1449
2882
|
Attributes and CSS variables, by part:
|
|
1450
2883
|
|
|
1451
|
-
- root: The area. It holds the viewport and the scrollbars.
|
|
2884
|
+
- 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.
|
|
1452
2885
|
- `data-has-overflow-x`: Present when there is more to see sideways.
|
|
1453
2886
|
- `data-has-overflow-y`: Present when there is more to see up or down.
|
|
1454
2887
|
- `data-scrolling`: Present while it is being scrolled, and a moment after.
|
|
1455
2888
|
- `data-hovering`: Present while the pointer is over the area.
|
|
1456
|
-
- `--scroll-area-corner-width`: The width of the corner: the vertical scrollbar's.
|
|
1457
|
-
- `--scroll-area-corner-height`: The height of the corner: the horizontal scrollbar's.
|
|
2889
|
+
- `--scroll-area-corner-width`: The width of the corner: the vertical scrollbar's, while both scrollbars and the corner are in the page.
|
|
2890
|
+
- `--scroll-area-corner-height`: The height of the corner: the horizontal scrollbar's, while both scrollbars and the corner are in the page.
|
|
1458
2891
|
- viewport: The element that scrolls.
|
|
1459
2892
|
- `data-has-overflow-x`: Present when there is more to see sideways.
|
|
1460
2893
|
- `data-has-overflow-y`: Present when there is more to see up or down.
|
|
1461
2894
|
- `data-scrolling`: Present while it is being scrolled, and a moment after.
|
|
1462
|
-
- scrollbar: A scrollbar's track. In the page while there is something to scroll its way.
|
|
2895
|
+
- scrollbar: A scrollbar's track, placed along its edge of the area. In the page while there is something to scroll its way.
|
|
1463
2896
|
- `data-orientation="horizontal | vertical"`: Which way the scrollbar scrolls.
|
|
1464
2897
|
- `data-hovering`: Present while the pointer is over the area.
|
|
1465
2898
|
- `data-scrolling`: Present while the area is scrolled its way.
|
|
1466
|
-
- thumb: The part of a scrollbar that shows where the view is, and can be dragged.
|
|
1467
|
-
- `data-orientation="horizontal | vertical"`: Which way the scrollbar scrolls.
|
|
1468
2899
|
- `--scroll-area-thumb-height`: A vertical thumb's height.
|
|
1469
2900
|
- `--scroll-area-thumb-width`: A horizontal thumb's width.
|
|
2901
|
+
- thumb: The part of a scrollbar that shows where the view is, and can be dragged. As long as its scrollbar's variable says.
|
|
2902
|
+
- `data-orientation="horizontal | vertical"`: Which way the scrollbar scrolls.
|
|
1470
2903
|
|
|
1471
2904
|
### Select
|
|
1472
2905
|
|
|
1473
2906
|
```
|
|
1474
|
-
import {
|
|
2907
|
+
import { KpSelect, KpSelectTrigger, KpSelectValue, KpSelectPortal, KpSelectPositioner, KpSelectPopup, KpSelectList, KpSelectScrollUpArrow, KpSelectScrollDownArrow, KpSelectGroup, KpSelectGroupLabel, KpSelectSeparator, KpSelectItem, KpSelectItemText, KpSelectItemIndicator, KpSelectInput } from "@kirana-ui/angular"
|
|
1475
2908
|
```
|
|
1476
2909
|
|
|
1477
|
-
Parts: `[
|
|
2910
|
+
Parts: `[kpSelect]`, `[kpSelectTrigger]`, `[kpSelectValue]`, `[kpSelectPortal]`, `[kpSelectPositioner]`, `[kpSelectPopup]`, `[kpSelectList]`, `[kpSelectScrollUpArrow]`, `[kpSelectScrollDownArrow]`, `[kpSelectGroup]`, `[kpSelectGroupLabel]`, `[kpSelectSeparator]`, `[kpSelectItem]`, `[kpSelectItemText]`, `[kpSelectItemIndicator]`.
|
|
2911
|
+
|
|
2912
|
+
Anatomy:
|
|
2913
|
+
|
|
2914
|
+
```
|
|
2915
|
+
kpSelect
|
|
2916
|
+
kpSelectTrigger
|
|
2917
|
+
*kpSelectValue
|
|
2918
|
+
*kpSelectPortal
|
|
2919
|
+
kpSelectPositioner
|
|
2920
|
+
kpSelectPopup
|
|
2921
|
+
*kpSelectScrollUpArrow
|
|
2922
|
+
kpSelectList (optional)
|
|
2923
|
+
kpSelectGroup (optional, repeated)
|
|
2924
|
+
kpSelectGroupLabel
|
|
2925
|
+
kpSelectItem (repeated)
|
|
2926
|
+
kpSelectItemText
|
|
2927
|
+
*kpSelectItemIndicator
|
|
2928
|
+
kpSelectSeparator (repeated)
|
|
2929
|
+
*kpSelectScrollDownArrow
|
|
2930
|
+
input[kpSelectInput] (Angular only)
|
|
2931
|
+
```
|
|
1478
2932
|
|
|
1479
2933
|
Props of its root:
|
|
1480
2934
|
|
|
1481
|
-
- `value
|
|
1482
|
-
- `defaultValue?: Value | null`
|
|
1483
|
-
- `
|
|
1484
|
-
- `
|
|
1485
|
-
- `
|
|
1486
|
-
- `
|
|
1487
|
-
- `disabled?: boolean`
|
|
2935
|
+
- `[(value)]: Value | null`: The chosen value; `null` is "none".
|
|
2936
|
+
- `defaultValue?: NoInfer<Value> | null`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
2937
|
+
- `[(open)]: boolean`: Whether the list is open, when the caller holds it.
|
|
2938
|
+
- `defaultOpen?: boolean`: Whether the list starts open, when the caller does not hold `open`. Read once.
|
|
2939
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
2940
|
+
- `readOnly?: boolean`: Shown as it is, focusable, not changeable: the list still opens, and nothing is chosen.
|
|
1488
2941
|
- `required?: boolean`: In a field, "none" is then wrong.
|
|
1489
2942
|
- `name?: string`: With a name, the value is submitted with the form around it.
|
|
1490
2943
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
1491
|
-
- `items?:
|
|
1492
|
-
- `
|
|
2944
|
+
- `items?: ItemLabels<Value>`: The values' labels: a list of values with their labels, or the labels by value.
|
|
2945
|
+
- `multiple?: boolean`: Several values: they are `values`, not `value`.
|
|
2946
|
+
- `[(values)]: readonly Value[]`: With `multiple`: the chosen values, in the order they were chosen.
|
|
2947
|
+
- `defaultValues?: readonly Value[]`: With `multiple`: the values it starts with, when the caller does not hold `values`. Read once.
|
|
2948
|
+
- `(valuesChanged): { values: Value[]; details: ChangeDetails }`: With `multiple`: heard as a value is about to be added or taken away, with the values there would then be: `details.cancel()` keeps them as they were.
|
|
2949
|
+
- `virtualized?: ListCollection`: Every row, when only some are in the page: each item is then given its `index`.
|
|
2950
|
+
- `(valueChanged): { value: Value | null; details: ChangeDetails }`: Heard as a value is about to be chosen: `details.cancel()` keeps it as it was.
|
|
2951
|
+
- `(openChanged): { open: boolean; details: ChangeDetails }`: Heard as the list is about to open or close: `details.cancel()` keeps it as it was.
|
|
2952
|
+
|
|
2953
|
+
Each part, and its own props:
|
|
2954
|
+
|
|
2955
|
+
- `[kpSelect]` is `KpSelect`. `exportAs: "kpSelect"`. Generic: `<Value = unknown>`. Holds the select: its value and whether the list is open. Its props are above.
|
|
2956
|
+
- `[kpSelectTrigger]` is `KpSelectTrigger`.
|
|
2957
|
+
- `[kpSelectValue]` is `KpSelectValue`. Structural: written `*kpSelectValue`. Its template is given the entry: `let entry` is a `SelectShown`. `<span kpSelectValue>` shows the chosen value's label, or `placeholder` while nothing is chosen; with `multiple`, the chosen labels with commas between. `<span *kpSelectValue="let shown">` draws its own content instead, with what is chosen: `shown.value` and `shown.label`, with `multiple` `shown.values` and `shown.labels`, in the items' order.
|
|
2958
|
+
- `placeholder?: string`: Shown while nothing is chosen.
|
|
2959
|
+
- `[kpSelectPortal]` is `KpSelectPortal`. Structural: written `*kpSelectPortal`. Draws what it holds at the end of `<body>`, or in the container a `PortalProvider` names.
|
|
2960
|
+
- `[kpSelectPositioner]` is `KpSelectPositioner`. Takes the positioner options ("Positioner options", above).
|
|
2961
|
+
- `alignItemWithTrigger?: boolean`: The list opens over its trigger, the chosen item's text on the trigger's own, where there is room and unless a finger opened it.
|
|
2962
|
+
- `[kpSelectPopup]` is `KpSelectPopup`.
|
|
2963
|
+
- `[kpSelectList]` is `KpSelectList`. The items' own box inside the popup, when the popup also holds scroll arrows.
|
|
2964
|
+
- `[kpSelectScrollUpArrow]` is `KpSelectScrollUpArrow`. Structural: written `*kpSelectScrollUpArrow`. `<div *kpSelectScrollUpArrow>`: in the page while there is more of the list above. It scrolls the list while the pointer moves over it.
|
|
2965
|
+
- `[kpSelectScrollDownArrow]` is `KpSelectScrollDownArrow`. Structural: written `*kpSelectScrollDownArrow`. `<div *kpSelectScrollDownArrow>`: in the page while there is more of the list below.
|
|
2966
|
+
- `[kpSelectGroup]` is `KpSelectGroup`. Items that belong together, named by their `kpSelectGroupLabel`.
|
|
2967
|
+
- `[kpSelectGroupLabel]` is `KpSelectGroupLabel`. Names the group it is in. With no group around it, it is plain text.
|
|
2968
|
+
- `[kpSelectSeparator]` is `KpSelectSeparator`. A line between groups.
|
|
2969
|
+
- `[kpSelectItem]` is `KpSelectItem`.
|
|
2970
|
+
- `value: unknown`: Required. What the select's value is while this item is chosen.
|
|
2971
|
+
- `disabled?: boolean`: Disables this item: it cannot be chosen, and the arrows pass over it.
|
|
2972
|
+
- `label?: string`: What typeahead matches and the trigger shows; the item's text when left out.
|
|
2973
|
+
- `index?: number`: Its place among all the rows, in a virtualized list.
|
|
2974
|
+
- `[kpSelectItemText]` is `KpSelectItemText`. The item's name: what the trigger shows once it is chosen.
|
|
2975
|
+
- `[kpSelectItemIndicator]` is `KpSelectItemIndicator`. Structural: written `*kpSelectItemIndicator`. `<span *kpSelectItemIndicator>`: in the page while its item is the chosen one.
|
|
2976
|
+
- `input[kpSelectInput]` is `KpSelectInput`. `<input kpSelectInput>`: submits the value with the form around it. Angular only.
|
|
1493
2977
|
|
|
1494
2978
|
Attributes and CSS variables, by part:
|
|
1495
2979
|
|
|
@@ -1497,12 +2981,13 @@ Attributes and CSS variables, by part:
|
|
|
1497
2981
|
- `data-popup-open`: Present when the list is open.
|
|
1498
2982
|
- `data-placeholder`: Present while nothing is chosen.
|
|
1499
2983
|
- `data-disabled`: Present when it is disabled.
|
|
1500
|
-
-
|
|
2984
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
2985
|
+
- value: The chosen value's label, or the placeholder. With several values, their labels with commas between.
|
|
1501
2986
|
- `data-placeholder`: Present while nothing is chosen.
|
|
1502
2987
|
- positioner: Places the list against the trigger. It carries the geometry.
|
|
1503
2988
|
- `data-open`: Present when it is open.
|
|
1504
2989
|
- `data-closed`: Present when it is closed.
|
|
1505
|
-
- `data-side="top | right | bottom | left | none"`: The side of the trigger it is on, after any flip; `none` when it lies over the trigger.
|
|
2990
|
+
- `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.
|
|
1506
2991
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1507
2992
|
- `--anchor-width`: The anchor's width.
|
|
1508
2993
|
- `--anchor-height`: The anchor's height.
|
|
@@ -1512,13 +2997,13 @@ Attributes and CSS variables, by part:
|
|
|
1512
2997
|
- scrollUpArrow: In the page while there is more of the list above: it scrolls the list while the pointer moves over it.
|
|
1513
2998
|
- `data-direction="up | down"`: The way it scrolls the list.
|
|
1514
2999
|
- `data-visible`: Present while there is more of the list its way.
|
|
1515
|
-
- `data-side="top | right | bottom | left | none"`: The side of the trigger the list is on; `none` when it lies over the trigger.
|
|
3000
|
+
- `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.
|
|
1516
3001
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1517
3002
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1518
3003
|
- scrollDownArrow: In the page while there is more of the list below: it scrolls the list while the pointer moves over it.
|
|
1519
3004
|
- `data-direction="up | down"`: The way it scrolls the list.
|
|
1520
3005
|
- `data-visible`: Present while there is more of the list its way.
|
|
1521
|
-
- `data-side="top | right | bottom | left | none"`: The side of the trigger the list is on; `none` when it lies over the trigger.
|
|
3006
|
+
- `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.
|
|
1522
3007
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1523
3008
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1524
3009
|
- popup: The list of items.
|
|
@@ -1526,22 +3011,24 @@ Attributes and CSS variables, by part:
|
|
|
1526
3011
|
- `data-closed`: Present when it is closed.
|
|
1527
3012
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1528
3013
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1529
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
3014
|
+
- `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.
|
|
1530
3015
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1531
3016
|
- item: One choice in the list.
|
|
1532
|
-
- `data-selected`: Present on the chosen item.
|
|
3017
|
+
- `data-selected`: Present on the chosen item, or on each of several.
|
|
1533
3018
|
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
1534
3019
|
- `data-disabled`: Present when it is disabled.
|
|
1535
3020
|
|
|
1536
3021
|
### Separator
|
|
1537
3022
|
|
|
1538
3023
|
```
|
|
1539
|
-
import {
|
|
3024
|
+
import { KpSeparator } from "@kirana-ui/angular"
|
|
1540
3025
|
```
|
|
1541
3026
|
|
|
1542
3027
|
Props:
|
|
1543
3028
|
|
|
1544
|
-
- `orientation?: Orientation
|
|
3029
|
+
- `orientation?: Orientation`: Whether the line lies across (the default) or stands upright: what a screen reader is told.
|
|
3030
|
+
|
|
3031
|
+
`[kpSeparator]` is `KpSeparator`. `exportAs: "kpSeparator"`.
|
|
1545
3032
|
|
|
1546
3033
|
Attributes and CSS variables, by part:
|
|
1547
3034
|
|
|
@@ -1551,58 +3038,86 @@ Attributes and CSS variables, by part:
|
|
|
1551
3038
|
### Slider
|
|
1552
3039
|
|
|
1553
3040
|
```
|
|
1554
|
-
import {
|
|
3041
|
+
import { KpSlider, KpSliderValue, KpSliderControl, KpSliderTrack, KpSliderIndicator, KpSliderThumb } from "@kirana-ui/angular"
|
|
1555
3042
|
```
|
|
1556
3043
|
|
|
1557
|
-
Parts: `[
|
|
3044
|
+
Parts: `[kpSlider]`, `[kpSliderValue]`, `[kpSliderControl]`, `[kpSliderTrack]`, `[kpSliderIndicator]`, `[kpSliderThumb]`.
|
|
3045
|
+
|
|
3046
|
+
Anatomy:
|
|
3047
|
+
|
|
3048
|
+
```
|
|
3049
|
+
kpSlider
|
|
3050
|
+
kpSliderValue
|
|
3051
|
+
kpSliderControl
|
|
3052
|
+
kpSliderTrack
|
|
3053
|
+
kpSliderIndicator
|
|
3054
|
+
kpSliderThumb (repeated)
|
|
3055
|
+
```
|
|
1558
3056
|
|
|
1559
3057
|
Props of its root:
|
|
1560
3058
|
|
|
1561
|
-
- `value
|
|
1562
|
-
- `defaultValue?:
|
|
1563
|
-
- `onValueChange?: ((value: number | number[], details: SliderChangeDetails) => void)`: Each step of a drag and each key.
|
|
1564
|
-
- `onValueCommitted?: ((value: number | number[], details: SliderChangeDetails) => void)`: When the pointer lets go, and after each key: the value to save.
|
|
3059
|
+
- `[(value)]: Value`: A number for one thumb, a list for a range: what is told back is the same kind.
|
|
3060
|
+
- `defaultValue?: NoInfer<Value>`: Read once. Default `min`.
|
|
1565
3061
|
- `min?: number`: Default 0.
|
|
1566
3062
|
- `max?: number`: Default 100.
|
|
1567
3063
|
- `step?: number`: Default 1.
|
|
1568
3064
|
- `largeStep?: number`: What Page Up, Page Down and an arrow with Shift move by. Default 10.
|
|
1569
3065
|
- `minStepsBetweenValues?: number`: How many steps two thumbs of a range stay apart. Default 0.
|
|
1570
|
-
- `
|
|
1571
|
-
- `
|
|
1572
|
-
- `disabled?: boolean
|
|
3066
|
+
- `thumbAlignment?: "center" | "edge" | "edge-client-only"`: `"edge"` keeps a thumb inside the control at the ends of its range. Default `"center"`.
|
|
3067
|
+
- `orientation?: "horizontal" | "vertical"`: Whether the track lies across (the default) or stands upright: the arrows that move a thumb follow.
|
|
3068
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
3069
|
+
- `readOnly?: boolean`: Shown as it is, focusable, not changeable; its value is still submitted.
|
|
1573
3070
|
- `name?: string`: With a name, each thumb's value is submitted with the form around the slider.
|
|
1574
3071
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
1575
3072
|
- `format?: Intl.NumberFormatOptions`: How a value is written.
|
|
1576
3073
|
- `locale?: string`: The language a value is written in; the page's by default.
|
|
1577
|
-
- `getAriaValueText?: (
|
|
3074
|
+
- `getAriaValueText?: (text: string, value: number, index: number) => string`: What assistive technology reads for a thumb, when the written value is not enough.
|
|
3075
|
+
- `(valueChanged): { value: SliderTold<Value>; details: SliderChangeDetails }`: Each step of a drag and each key, with why; `details.cancel()` keeps the value.
|
|
3076
|
+
- `(valueCommitted): { value: SliderTold<Value>; details: SliderChangeDetails }`: When the pointer lets go, and after each key.
|
|
3077
|
+
|
|
3078
|
+
Each part, and its own props:
|
|
3079
|
+
|
|
3080
|
+
- `[kpSlider]` is `KpSlider`. `exportAs: "kpSlider"`. Generic: `<Value extends SliderValue = SliderValue>`. Its props are above.
|
|
3081
|
+
- `[kpSliderValue]` is `KpSliderValue`. Shows the written value.
|
|
3082
|
+
- `[kpSliderControl]` is `KpSliderControl`.
|
|
3083
|
+
- `[kpSliderTrack]` is `KpSliderTrack`.
|
|
3084
|
+
- `[kpSliderIndicator]` is `KpSliderIndicator`.
|
|
3085
|
+
- `[kpSliderThumb]` is `KpSliderThumb`. On a thumb's element. It draws the hidden input inside it, which a form reads.
|
|
3086
|
+
- `index?: number`: Which value of a range the thumb is, from 0. A thumb that is given none takes its place among the slider's thumbs, in the order they are written.
|
|
1578
3087
|
|
|
1579
3088
|
Attributes and CSS variables, by part:
|
|
1580
3089
|
|
|
1581
3090
|
- root: Groups the slider's parts.
|
|
1582
3091
|
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
1583
3092
|
- `data-disabled`: Present when it is disabled.
|
|
3093
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1584
3094
|
- `data-dragging`: Present while a pointer holds a thumb.
|
|
1585
3095
|
- value: The value, written.
|
|
1586
3096
|
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
1587
3097
|
- `data-disabled`: Present when it is disabled.
|
|
3098
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1588
3099
|
- `data-dragging`: Present while a pointer holds a thumb.
|
|
1589
3100
|
- control: What a pointer presses and drags on. It holds the track and the thumbs.
|
|
1590
3101
|
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
1591
3102
|
- `data-disabled`: Present when it is disabled.
|
|
3103
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1592
3104
|
- `data-dragging`: Present while a pointer holds a thumb.
|
|
1593
3105
|
- track: The whole range.
|
|
1594
3106
|
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
1595
3107
|
- `data-disabled`: Present when it is disabled.
|
|
3108
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1596
3109
|
- `data-dragging`: Present while a pointer holds a thumb.
|
|
1597
3110
|
- indicator: The filled part: up to the thumb, or from the first thumb to the last. Its place and length are written on it.
|
|
1598
3111
|
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
1599
3112
|
- `data-disabled`: Present when it is disabled.
|
|
3113
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1600
3114
|
- `data-dragging`: Present while a pointer holds a thumb.
|
|
1601
3115
|
- `--start-position`: With thumbs that stay inside the control: where the filled part starts, or with one thumb where it ends.
|
|
1602
3116
|
- `--relative-size`: With thumbs that stay inside the control and a range: the filled part's length.
|
|
1603
|
-
- 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.
|
|
3117
|
+
- 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.
|
|
1604
3118
|
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
1605
3119
|
- `data-disabled`: Present when it is disabled.
|
|
3120
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
1606
3121
|
- `data-dragging`: Present while a pointer holds a thumb.
|
|
1607
3122
|
- `data-index`: Which thumb it is, from 0.
|
|
1608
3123
|
- `--position`: With thumbs that stay inside the control: where the thumb's centre is.
|
|
@@ -1610,22 +3125,34 @@ Attributes and CSS variables, by part:
|
|
|
1610
3125
|
### Switch
|
|
1611
3126
|
|
|
1612
3127
|
```
|
|
1613
|
-
import {
|
|
3128
|
+
import { KpSwitch, KpSwitchThumb } from "@kirana-ui/angular"
|
|
1614
3129
|
```
|
|
1615
3130
|
|
|
1616
|
-
Parts: `[
|
|
3131
|
+
Parts: `[kpSwitch]`, `[kpSwitchThumb]`.
|
|
3132
|
+
|
|
3133
|
+
Anatomy:
|
|
3134
|
+
|
|
3135
|
+
```
|
|
3136
|
+
kpSwitch
|
|
3137
|
+
kpSwitchThumb
|
|
3138
|
+
```
|
|
1617
3139
|
|
|
1618
3140
|
Props of its root:
|
|
1619
3141
|
|
|
1620
|
-
- `checked
|
|
3142
|
+
- `[(checked)]: boolean`: Whether it is checked, when the caller holds it.
|
|
1621
3143
|
- `defaultChecked?: boolean`: Read once.
|
|
1622
|
-
- `
|
|
1623
|
-
- `disabled?: boolean`
|
|
3144
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
1624
3145
|
- `readOnly?: boolean`: Shown as it is, focusable, not changeable.
|
|
1625
|
-
- `required?: boolean`
|
|
3146
|
+
- `required?: boolean`: Needed: in a `Field`, leaving it unchecked is then invalid.
|
|
1626
3147
|
- `name?: string`: With a name, the control is submitted with the form around it when it is checked.
|
|
1627
3148
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
1628
3149
|
- `value?: string`: What is submitted. Default `"on"`, as a native checkbox's.
|
|
3150
|
+
- `(checkedChanged): { checked: boolean; details: ChangeDetails }`: The change with why it happened; `details.cancel()` keeps the value.
|
|
3151
|
+
|
|
3152
|
+
Each part, and its own props:
|
|
3153
|
+
|
|
3154
|
+
- `[kpSwitch]` is `KpSwitch`. `exportAs: "kpSwitch"`. On the box's element. It draws the hidden native input inside it, which a form and a label reach. Its props are above.
|
|
3155
|
+
- `[kpSwitchThumb]` is `KpSwitchThumb`.
|
|
1629
3156
|
|
|
1630
3157
|
Attributes and CSS variables, by part:
|
|
1631
3158
|
|
|
@@ -1645,17 +3172,41 @@ Attributes and CSS variables, by part:
|
|
|
1645
3172
|
### Tabs
|
|
1646
3173
|
|
|
1647
3174
|
```
|
|
1648
|
-
import {
|
|
3175
|
+
import { KpTabs, KpTabsList, KpTabsTab, KpTabsIndicator, KpTabsPanel } from "@kirana-ui/angular"
|
|
1649
3176
|
```
|
|
1650
3177
|
|
|
1651
|
-
Parts: `[
|
|
3178
|
+
Parts: `[kpTabs]`, `[kpTabsList]`, `[kpTabsTab]`, `[kpTabsIndicator]`, `[kpTabsPanel]`.
|
|
3179
|
+
|
|
3180
|
+
Anatomy:
|
|
3181
|
+
|
|
3182
|
+
```
|
|
3183
|
+
kpTabs
|
|
3184
|
+
kpTabsList
|
|
3185
|
+
kpTabsTab (repeated)
|
|
3186
|
+
kpTabsIndicator
|
|
3187
|
+
*kpTabsPanel (repeated)
|
|
3188
|
+
```
|
|
1652
3189
|
|
|
1653
3190
|
Props of its root:
|
|
1654
3191
|
|
|
1655
|
-
- `value
|
|
1656
|
-
- `defaultValue?: Value | null`: Read once. Without one, the first tab that can be chosen is, once the page is there.
|
|
1657
|
-
- `
|
|
1658
|
-
- `
|
|
3192
|
+
- `[(value)]: Value | null`: The active tab's value; `null` is "none".
|
|
3193
|
+
- `defaultValue?: NoInfer<Value> | null`: Read once. Without one, the first tab that can be chosen is, once the page is there.
|
|
3194
|
+
- `orientation?: Orientation`: Whether the tabs are laid out across (the default) or down: the arrows that move between them follow.
|
|
3195
|
+
- `(valueChanged): { value: Value; details: ChangeDetails }`: The change with why it happened; `details.cancel()` keeps the value.
|
|
3196
|
+
|
|
3197
|
+
Each part, and its own props:
|
|
3198
|
+
|
|
3199
|
+
- `[kpTabs]` is `KpTabs`. `exportAs: "kpTabs"`. Generic: `<Value = unknown>`. Its props are above.
|
|
3200
|
+
- `[kpTabsList]` is `KpTabsList`.
|
|
3201
|
+
- `activateOnFocus?: boolean`: Whether moving focus onto a tab with the arrows activates it. Default `false`.
|
|
3202
|
+
- `loop?: boolean`: Whether the arrows wrap from the last tab to the first. Default `true`.
|
|
3203
|
+
- `[kpTabsTab]` is `KpTabsTab`.
|
|
3204
|
+
- `value: unknown`: Required. What the tabs' value is while this tab is the active one.
|
|
3205
|
+
- `disabled?: boolean`: Disables this tab: it cannot be chosen.
|
|
3206
|
+
- `[kpTabsIndicator]` is `KpTabsIndicator`.
|
|
3207
|
+
- `[kpTabsPanel]` is `KpTabsPanel`. Structural: written `*kpTabsPanel`. `<div *kpTabsPanel="'account'">`: in the page while its tab is the active one; `*kpTabsPanel="'account'; keepMounted: true"` keeps it, hidden.
|
|
3208
|
+
- `*kpTabsPanel: unknown`: The directive's own value: `*kpTabsPanel="…"`. Required. The value of the tab this is the panel of.
|
|
3209
|
+
- `keepMounted?: boolean`: Written after the directive's value: `*kpTabsPanel="…; keepMounted: …"`. Keeps the panel in the page, `hidden`, while its tab is not the active one.
|
|
1659
3210
|
|
|
1660
3211
|
Attributes and CSS variables, by part:
|
|
1661
3212
|
|
|
@@ -1688,19 +3239,44 @@ Attributes and CSS variables, by part:
|
|
|
1688
3239
|
### Toast
|
|
1689
3240
|
|
|
1690
3241
|
```
|
|
1691
|
-
import {
|
|
3242
|
+
import { KpToastViewport, KpToastList, KpToastRoot, KpToastContent, KpToastTitle, KpToastDescription, KpToastClose, KpToastAction } from "@kirana-ui/angular"
|
|
1692
3243
|
```
|
|
1693
3244
|
|
|
1694
|
-
Parts: `[
|
|
3245
|
+
Parts: `[kpToastViewport]`, `[kpToastList]`, `[kpToastRoot]`, `[kpToastContent]`, `[kpToastTitle]`, `[kpToastDescription]`, `[kpToastClose]`, `[kpToastAction]`.
|
|
3246
|
+
|
|
3247
|
+
Anatomy:
|
|
1695
3248
|
|
|
1696
|
-
|
|
3249
|
+
```
|
|
3250
|
+
kpToastViewport
|
|
3251
|
+
*kpToastList
|
|
3252
|
+
kpToastRoot (repeated)
|
|
3253
|
+
kpToastContent (optional)
|
|
3254
|
+
kpToastTitle
|
|
3255
|
+
kpToastDescription
|
|
3256
|
+
kpToastClose
|
|
3257
|
+
kpToastAction
|
|
3258
|
+
```
|
|
1697
3259
|
|
|
1698
3260
|
Props of its root:
|
|
1699
3261
|
|
|
1700
|
-
- `
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
3262
|
+
- `toast: ToastRecord`: Required. The toast it draws: the one `*kpToastList` gave its template (`let toast`).
|
|
3263
|
+
|
|
3264
|
+
Each part, and its own props:
|
|
3265
|
+
|
|
3266
|
+
- `[kpToastViewport]` is `KpToastViewport`. `exportAs: "kpToastViewport"`. Where a toaster's toasts are drawn. Always in the page: put it once, near the root.
|
|
3267
|
+
- `toaster: Toaster`: Required. The page's toaster: one is made with `createToaster()`, once, in a module.
|
|
3268
|
+
- `label?: string`: What the region of toasts is called, for assistive technology.
|
|
3269
|
+
- `hotkey?: string`: The key that takes focus to the toasts. Default: `"F6"`.
|
|
3270
|
+
- `swipeDirection?: "left" | "right" | "up" | "down"`: The way a toast is dragged to close it. Default: `"right"`.
|
|
3271
|
+
- `[kpToastList]` is `KpToastList`. Structural: written `*kpToastList`. Its template is given the entry: `let entry` is a `ToastRecord`. `<div *kpToastList="let toast">`: its template once for each toast, the newest first.
|
|
3272
|
+
- `[kpToastRoot]` is `KpToastRoot`. One toast, on the element `*kpToastList` draws for it. Its props are above.
|
|
3273
|
+
- `[kpToastContent]` is `KpToastContent`. What holds a toast's contents, when the design sizes the toast itself.
|
|
3274
|
+
- `[kpToastTitle]` is `KpToastTitle`. The toast's title, unless something is written in its element.
|
|
3275
|
+
- `[kpToastDescription]` is `KpToastDescription`. The toast's description, unless something is written in its element.
|
|
3276
|
+
- `[kpToastClose]` is `KpToastClose`. Closes the toast.
|
|
3277
|
+
- `[kpToastAction]` is `KpToastAction`. The toast's action, its label unless something is written in its element. A press tells the action (`onAction`), then closes the toast unless the action called `details.cancel()`.
|
|
3278
|
+
|
|
3279
|
+
A page's toasts are a toaster's, made once in a module: `import { createToaster } from "@kirana-ui/angular"`, 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".
|
|
1704
3280
|
|
|
1705
3281
|
Attributes and CSS variables, by part:
|
|
1706
3282
|
|
|
@@ -1727,16 +3303,18 @@ Attributes and CSS variables, by part:
|
|
|
1727
3303
|
### Toggle
|
|
1728
3304
|
|
|
1729
3305
|
```
|
|
1730
|
-
import {
|
|
3306
|
+
import { KpToggle } from "@kirana-ui/angular"
|
|
1731
3307
|
```
|
|
1732
3308
|
|
|
1733
3309
|
Props:
|
|
1734
3310
|
|
|
1735
|
-
- `pressed
|
|
3311
|
+
- `[(pressed)]: boolean`: Whether it is pressed, when the caller holds it.
|
|
1736
3312
|
- `defaultPressed?: boolean`: Read once.
|
|
1737
|
-
- `
|
|
1738
|
-
- `disabled?: boolean`
|
|
3313
|
+
- `disabled?: boolean`: Disabled: a press does nothing.
|
|
1739
3314
|
- `value?: unknown`: In a toggle group: what the group's value holds while this one is pressed.
|
|
3315
|
+
- `(pressedChanged): { pressed: boolean; details: ChangeDetails }`: The change with why it happened; `details.cancel()` keeps the value.
|
|
3316
|
+
|
|
3317
|
+
`[kpToggle]` is `KpToggle`. `exportAs: "kpToggle"`. Inside a `kpToggleGroup`, `value` makes it one of the group's toggles.
|
|
1740
3318
|
|
|
1741
3319
|
Attributes and CSS variables, by part:
|
|
1742
3320
|
|
|
@@ -1747,18 +3325,20 @@ Attributes and CSS variables, by part:
|
|
|
1747
3325
|
### ToggleGroup
|
|
1748
3326
|
|
|
1749
3327
|
```
|
|
1750
|
-
import {
|
|
3328
|
+
import { KpToggleGroup } from "@kirana-ui/angular"
|
|
1751
3329
|
```
|
|
1752
3330
|
|
|
1753
3331
|
Props:
|
|
1754
3332
|
|
|
1755
|
-
- `value
|
|
1756
|
-
- `defaultValue?: readonly Value[]`
|
|
1757
|
-
- `onValueChange?: ((value: Value[], details: ChangeDetails) => void)`
|
|
3333
|
+
- `[(value)]: readonly Value[]`: The values of the pressed toggles: none, one, or with `multiple` several.
|
|
3334
|
+
- `defaultValue?: readonly Value[]`: The values pressed at the start, when the caller does not hold `value`. Read once.
|
|
1758
3335
|
- `multiple?: boolean`: Whether more than one can be pressed at a time.
|
|
1759
|
-
- `disabled?: boolean
|
|
1760
|
-
- `orientation?: Orientation
|
|
3336
|
+
- `disabled?: boolean`: Disables every toggle of the group.
|
|
3337
|
+
- `orientation?: Orientation`: Whether the toggles are laid out across (the default) or down: the arrows that move between them follow.
|
|
1761
3338
|
- `loop?: boolean`: Whether the arrows go round from the last toggle to the first. Default: they do.
|
|
3339
|
+
- `(valueChanged): { value: Value[]; details: ChangeDetails }`: 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.
|
|
3340
|
+
|
|
3341
|
+
`[kpToggleGroup]` is `KpToggleGroup`. `exportAs: "kpToggleGroup"`. Generic: `<Value = unknown>`. Toggles that are one control. Each `kpToggle` with a `value` inside it is one of its toggles.
|
|
1762
3342
|
|
|
1763
3343
|
Attributes and CSS variables, by part:
|
|
1764
3344
|
|
|
@@ -1770,16 +3350,39 @@ Attributes and CSS variables, by part:
|
|
|
1770
3350
|
### Toolbar
|
|
1771
3351
|
|
|
1772
3352
|
```
|
|
1773
|
-
import {
|
|
3353
|
+
import { KpToolbar, KpToolbarButton, KpToolbarLink, KpToolbarInput, KpToolbarGroup, KpToolbarSeparator } from "@kirana-ui/angular"
|
|
1774
3354
|
```
|
|
1775
3355
|
|
|
1776
|
-
Parts: `[
|
|
3356
|
+
Parts: `[kpToolbar]`, `[kpToolbarButton]`, `[kpToolbarLink]`, `[kpToolbarInput]`, `[kpToolbarGroup]`, `[kpToolbarSeparator]`.
|
|
3357
|
+
|
|
3358
|
+
Anatomy:
|
|
3359
|
+
|
|
3360
|
+
```
|
|
3361
|
+
kpToolbar
|
|
3362
|
+
kpToolbarGroup (optional, repeated)
|
|
3363
|
+
kpToolbarButton (repeated)
|
|
3364
|
+
kpToolbarLink (repeated)
|
|
3365
|
+
kpToolbarInput (repeated)
|
|
3366
|
+
kpToolbarSeparator (repeated)
|
|
3367
|
+
```
|
|
1777
3368
|
|
|
1778
3369
|
Props of its root:
|
|
1779
3370
|
|
|
1780
|
-
- `orientation?: Orientation
|
|
3371
|
+
- `orientation?: Orientation`: Whether the controls are laid out across (the default) or down: the arrows that move between them follow.
|
|
1781
3372
|
- `loop?: boolean`: Whether the arrows go round from the last item to the first. Default: they do.
|
|
1782
|
-
- `disabled?: boolean
|
|
3373
|
+
- `disabled?: boolean`: Disables every control of the toolbar.
|
|
3374
|
+
|
|
3375
|
+
Each part, and its own props:
|
|
3376
|
+
|
|
3377
|
+
- `[kpToolbar]` is `KpToolbar`. `exportAs: "kpToolbar"`. Its props are above.
|
|
3378
|
+
- `[kpToolbarButton]` is `KpToolbarButton`.
|
|
3379
|
+
- `disabled?: boolean`: Disables this control.
|
|
3380
|
+
- `[kpToolbarLink]` is `KpToolbarLink`.
|
|
3381
|
+
- `[kpToolbarInput]` is `KpToolbarInput`. `<input kpToolbarInput>`: the arrows are its own until the caret is at an end.
|
|
3382
|
+
- `disabled?: boolean`: Disables this control.
|
|
3383
|
+
- `[kpToolbarGroup]` is `KpToolbarGroup`.
|
|
3384
|
+
- `disabled?: boolean`: Disables this control.
|
|
3385
|
+
- `[kpToolbarSeparator]` is `KpToolbarSeparator`.
|
|
1783
3386
|
|
|
1784
3387
|
Attributes and CSS variables, by part:
|
|
1785
3388
|
|
|
@@ -1804,19 +3407,41 @@ Attributes and CSS variables, by part:
|
|
|
1804
3407
|
### Tooltip
|
|
1805
3408
|
|
|
1806
3409
|
```
|
|
1807
|
-
import {
|
|
3410
|
+
import { KpTooltip, KpTooltipTrigger, KpTooltipPortal, KpTooltipPositioner, KpTooltipPopup, KpTooltipArrow } from "@kirana-ui/angular"
|
|
1808
3411
|
```
|
|
1809
3412
|
|
|
1810
|
-
Parts: `[
|
|
3413
|
+
Parts: `[kpTooltip]`, `[kpTooltipTrigger]`, `[kpTooltipPortal]`, `[kpTooltipPositioner]`, `[kpTooltipPopup]`, `[kpTooltipArrow]`.
|
|
3414
|
+
|
|
3415
|
+
Anatomy:
|
|
3416
|
+
|
|
3417
|
+
```
|
|
3418
|
+
kpTooltip
|
|
3419
|
+
kpTooltipTrigger
|
|
3420
|
+
*kpTooltipPortal
|
|
3421
|
+
kpTooltipPositioner
|
|
3422
|
+
kpTooltipPopup
|
|
3423
|
+
kpTooltipArrow
|
|
3424
|
+
```
|
|
1811
3425
|
|
|
1812
3426
|
Props of its root:
|
|
1813
3427
|
|
|
1814
|
-
- `open
|
|
1815
|
-
- `defaultOpen?: boolean`
|
|
1816
|
-
- `
|
|
1817
|
-
- `
|
|
1818
|
-
- `
|
|
1819
|
-
- `
|
|
3428
|
+
- `[(open)]: boolean`: Whether it is open, when the caller holds it.
|
|
3429
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
3430
|
+
- `delay?: number`: How long the pointer rests on the trigger before the popup opens, in milliseconds. Default `600`.
|
|
3431
|
+
- `closeDelay?: number`: How long after the pointer leaves the popup closes, in milliseconds. Default `0`.
|
|
3432
|
+
- `disabled?: boolean`: Disabled: the pointer and focus do not open it.
|
|
3433
|
+
- `(openChanged): { open: boolean; details: ChangeDetails }`: The change with why it happened; `details.cancel()` keeps the value.
|
|
3434
|
+
|
|
3435
|
+
Each part, and its own props:
|
|
3436
|
+
|
|
3437
|
+
- `[kpTooltip]` is `KpTooltip`. `exportAs: "kpTooltip"`. On any element, or on `<ng-container>` to draw none. Its props are above.
|
|
3438
|
+
- `[kpTooltipTrigger]` is `KpTooltipTrigger`.
|
|
3439
|
+
- `delay?: number`: Its own waits, which come before the root's.
|
|
3440
|
+
- `closeDelay?: number`: How long after the pointer leaves this trigger's popup closes, in milliseconds.
|
|
3441
|
+
- `[kpTooltipPortal]` is `KpTooltipPortal`. Structural: written `*kpTooltipPortal`. Draws what it holds at the end of `<body>`, or in the container a `PortalProvider` names.
|
|
3442
|
+
- `[kpTooltipPositioner]` is `KpTooltipPositioner`. Takes the positioner options ("Positioner options", above).
|
|
3443
|
+
- `[kpTooltipPopup]` is `KpTooltipPopup`.
|
|
3444
|
+
- `[kpTooltipArrow]` is `KpTooltipArrow`.
|
|
1820
3445
|
|
|
1821
3446
|
Attributes and CSS variables, by part:
|
|
1822
3447
|
|
|
@@ -1825,7 +3450,7 @@ Attributes and CSS variables, by part:
|
|
|
1825
3450
|
- positioner: Places the popup against the trigger. It carries the geometry.
|
|
1826
3451
|
- `data-open`: Present when it is open.
|
|
1827
3452
|
- `data-closed`: Present when it is closed.
|
|
1828
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
3453
|
+
- `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.
|
|
1829
3454
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1830
3455
|
- `--anchor-width`: The anchor's width.
|
|
1831
3456
|
- `--anchor-height`: The anchor's height.
|
|
@@ -1837,10 +3462,10 @@ Attributes and CSS variables, by part:
|
|
|
1837
3462
|
- `data-closed`: Present when it is closed.
|
|
1838
3463
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1839
3464
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1840
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
3465
|
+
- `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.
|
|
1841
3466
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1842
3467
|
- `data-instant="delay | focus | dismiss"`: Present when it opened or closed without its usual wait, for a design that skips the motion then.
|
|
1843
3468
|
- arrow: An element that points at the trigger, placed along the popup's edge.
|
|
1844
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
3469
|
+
- `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.
|
|
1845
3470
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1846
3471
|
- `data-uncentered`: Present when the popup was pushed along its edge, so the arrow is not at the trigger's centre.
|