@konce-pt/angular 0.11.2 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +792 -333
- package/README.md +111 -55
- package/charts/src/lib/llms.txt +23 -15
- package/chat/src/lib/llms.txt +68 -33
- package/fesm2022/konce-pt-angular-charts.mjs +149 -68
- package/fesm2022/konce-pt-angular-charts.mjs.map +1 -1
- package/fesm2022/konce-pt-angular-chat.mjs +296 -135
- package/fesm2022/konce-pt-angular-chat.mjs.map +1 -1
- package/fesm2022/konce-pt-angular-grid.mjs +16 -16
- package/fesm2022/konce-pt-angular-grid.mjs.map +1 -1
- package/fesm2022/konce-pt-angular-icons.mjs +5 -5
- package/fesm2022/konce-pt-angular-icons.mjs.map +1 -1
- package/fesm2022/konce-pt-angular-map.mjs +360 -293
- package/fesm2022/konce-pt-angular-map.mjs.map +1 -1
- package/fesm2022/konce-pt-angular-roadmap.mjs +120 -34
- package/fesm2022/konce-pt-angular-roadmap.mjs.map +1 -1
- package/fesm2022/konce-pt-angular.mjs +7117 -3373
- package/fesm2022/konce-pt-angular.mjs.map +1 -1
- package/grid/src/lib/llms.txt +18 -18
- package/map/src/lib/llms.txt +142 -140
- package/package.json +14 -12
- package/roadmap/src/lib/llms.txt +37 -27
- package/src/lib/accordion/llms.txt +18 -6
- package/src/lib/alert/llms.txt +5 -4
- package/src/lib/app-shell/llms.txt +25 -22
- package/src/lib/auth/llms.txt +26 -22
- package/src/lib/autocomplete/llms.txt +18 -4
- package/src/lib/avatar/llms.txt +3 -3
- package/src/lib/avatar-group/llms.txt +5 -5
- package/src/lib/backdrop/llms.txt +35 -35
- package/src/lib/badge/llms.txt +7 -7
- package/src/lib/bottom-sheet/llms.txt +6 -3
- package/src/lib/breadcrumb/llms.txt +9 -1
- package/src/lib/breakpoint/llms.txt +8 -8
- package/src/lib/button/llms.txt +26 -18
- package/src/lib/button-group/llms.txt +40 -31
- package/src/lib/card/llms.txt +19 -19
- package/src/lib/carousel/llms.txt +6 -6
- package/src/lib/checkbox/llms.txt +17 -2
- package/src/lib/chip/llms.txt +6 -6
- package/src/lib/chips-input/llms.txt +14 -4
- package/src/lib/color-picker/llms.txt +7 -4
- package/src/lib/confirm/llms.txt +9 -3
- package/src/lib/context-menu/llms.txt +7 -4
- package/src/lib/data-table/llms.txt +280 -227
- package/src/lib/data-view/llms.txt +25 -4
- package/src/lib/date-range/llms.txt +37 -18
- package/src/lib/datepicker/llms.txt +46 -29
- package/src/lib/dialog/llms.txt +29 -26
- package/src/lib/divider/llms.txt +2 -1
- package/src/lib/drawer/llms.txt +9 -6
- package/src/lib/empty/llms.txt +4 -4
- package/src/lib/fab/llms.txt +6 -2
- package/src/lib/fieldset/llms.txt +22 -4
- package/src/lib/file-upload/llms.txt +3 -0
- package/src/lib/form-field/llms.txt +33 -19
- package/src/lib/galleria/llms.txt +3 -3
- package/src/lib/i18n/llms.txt +15 -8
- package/src/lib/icon/llms.txt +9 -9
- package/src/lib/icon-button/llms.txt +8 -3
- package/src/lib/image/llms.txt +4 -4
- package/src/lib/input/llms.txt +21 -7
- package/src/lib/input-mask/llms.txt +5 -2
- package/src/lib/input-number/llms.txt +18 -15
- package/src/lib/input-otp/llms.txt +15 -4
- package/src/lib/knob/llms.txt +14 -7
- package/src/lib/listbox/llms.txt +8 -5
- package/src/lib/loader/llms.txt +72 -0
- package/src/lib/megamenu/llms.txt +16 -5
- package/src/lib/mention/llms.txt +15 -15
- package/src/lib/menu/llms.txt +12 -12
- package/src/lib/menubar/llms.txt +16 -5
- package/src/lib/meter-group/llms.txt +7 -7
- package/src/lib/order-list/llms.txt +20 -5
- package/src/lib/paginator/llms.txt +5 -5
- package/src/lib/panel/llms.txt +20 -8
- package/src/lib/password/llms.txt +17 -5
- package/src/lib/peek/llms.txt +11 -11
- package/src/lib/pick-list/llms.txt +28 -5
- package/src/lib/popover/llms.txt +9 -6
- package/src/lib/progress/llms.txt +16 -16
- package/src/lib/radio-group/llms.txt +13 -3
- package/src/lib/rating/llms.txt +13 -6
- package/src/lib/rich-text/llms.txt +42 -24
- package/src/lib/scroll-top/llms.txt +3 -3
- package/src/lib/select/llms.txt +23 -13
- package/src/lib/sidenav/llms.txt +8 -8
- package/src/lib/slider/llms.txt +23 -7
- package/src/lib/speech/llms.txt +108 -0
- package/src/lib/speed-dial/llms.txt +9 -3
- package/src/lib/spinner/llms.txt +2 -2
- package/src/lib/split-button/llms.txt +14 -8
- package/src/lib/splitter/llms.txt +8 -8
- package/src/lib/stepper/llms.txt +26 -7
- package/src/lib/switch/llms.txt +13 -3
- package/src/lib/switch-group/llms.txt +12 -9
- package/src/lib/tabs/llms.txt +7 -4
- package/src/lib/textarea/llms.txt +16 -5
- package/src/lib/timeline/llms.txt +1 -1
- package/src/lib/toast/llms.txt +36 -5
- package/src/lib/toolbar/llms.txt +3 -3
- package/src/lib/tooltip/llms.txt +13 -10
- package/src/lib/tree/llms.txt +19 -5
- package/src/lib/update/llms.txt +52 -0
- package/types/konce-pt-angular-charts.d.ts +11 -0
- package/types/konce-pt-angular-charts.d.ts.map +1 -1
- package/types/konce-pt-angular-chat.d.ts +98 -40
- package/types/konce-pt-angular-chat.d.ts.map +1 -1
- package/types/konce-pt-angular-grid.d.ts +14 -14
- package/types/konce-pt-angular-icons.d.ts +3 -3
- package/types/konce-pt-angular-map.d.ts +147 -119
- package/types/konce-pt-angular-map.d.ts.map +1 -1
- package/types/konce-pt-angular-roadmap.d.ts +34 -9
- package/types/konce-pt-angular-roadmap.d.ts.map +1 -1
- package/types/konce-pt-angular.d.ts +1774 -651
- package/types/konce-pt-angular.d.ts.map +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# KptSpeedDial (kpt-speed-dial)
|
|
2
2
|
|
|
3
|
-
A speed dial
|
|
3
|
+
A speed dial - a FAB that fans out a set of actions. Built on `kpt-fab`.
|
|
4
4
|
Import: `import { KptSpeedDial } from '@konce-pt/angular';`
|
|
5
5
|
|
|
6
6
|
## Inputs / outputs
|
|
7
|
-
- `items`: KptMenuItem<T>[]
|
|
7
|
+
- `items`: KptMenuItem<T>[] - the actions (label, icon)
|
|
8
8
|
- `direction`: 'up' | 'down' | 'left' | 'right' (KptSpeedDialDirection)
|
|
9
9
|
- `icon`: string (default 'plus', rotates 45° when open); `ariaLabel`: string
|
|
10
10
|
- `selected`: KptMenuItem<T>
|
|
@@ -15,10 +15,16 @@ Import: `import { KptSpeedDial } from '@konce-pt/angular';`
|
|
|
15
15
|
## Accessibility
|
|
16
16
|
- The main button carries `aria-expanded` and `aria-controls` pointing at the actions container.
|
|
17
17
|
- Closed actions are `visibility: hidden` (switched after the fade-out), so they are out of the Tab
|
|
18
|
-
order and the accessibility tree
|
|
18
|
+
order and the accessibility tree - not just transparent.
|
|
19
19
|
- `Escape` anywhere in the dial closes it and returns focus to the main button.
|
|
20
20
|
- Every action is a `<button>` labelled with its own `label`, so the fan works from the keyboard even
|
|
21
21
|
when the actions show icons only.
|
|
22
22
|
|
|
23
|
+
## Motion
|
|
24
|
+
The actions fan out from the button in a cascade - the nearest first, on a spring, from the side of the
|
|
25
|
+
button - and fold back in reverse order; the trigger icon turns on a spring. The container hides
|
|
26
|
+
(`visibility`) only after the last action, so the closing cascade is not cut off. Pressed, it squeezes slightly and springs back on release (shared mixin `styles/_press.scss`). Pure CSS; durations follow `--kpt-motion-scale`, so `enabled: false` turns it off, and it drops out
|
|
27
|
+
under "reduce motion".
|
|
28
|
+
|
|
23
29
|
## Tokens
|
|
24
30
|
The main FAB comes from `kpt-fab`; the actions use `--kpt-color-surface-raised`, `--kpt-elevation-2`.
|
package/src/lib/spinner/llms.txt
CHANGED
|
@@ -7,13 +7,13 @@ Loading indicator. Primary colour by default; `color` on the host changes it (`c
|
|
|
7
7
|
|
|
8
8
|
## Example
|
|
9
9
|
<kpt-spinner />
|
|
10
|
-
<kpt-spinner size="2rem" label="Loading
|
|
10
|
+
<kpt-spinner size="2rem" label="Loading..." />
|
|
11
11
|
|
|
12
12
|
## Tokens
|
|
13
13
|
The host sets `color: var(--kpt-color-primary)` and the ring is drawn in `currentColor`; the ring width is 8% of `size`, at least 2px.
|
|
14
14
|
|
|
15
15
|
## Accessibility
|
|
16
16
|
The ring is `aria-hidden`; next to it sits a visually hidden `.kpt-spinner__label` with
|
|
17
|
-
`role="status"`. Its text
|
|
17
|
+
`role="status"`. Its text - `label`, or `spinner.label` - is written a frame after the spinner
|
|
18
18
|
appears, because a status region that is born already filled in is skipped by most screen readers.
|
|
19
19
|
Under `prefers-reduced-motion` the rotation slows down instead of stopping.
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
# KptSplitButton (kpt-split-button)
|
|
2
2
|
|
|
3
|
-
A split button
|
|
3
|
+
A split button - a primary action + a drop-down menu of secondary actions (CDK Overlay).
|
|
4
4
|
Import: `import { KptSplitButton } from '@konce-pt/angular';`
|
|
5
5
|
Requires `import '@angular/cdk/overlay-prebuilt.css';`
|
|
6
6
|
|
|
7
7
|
## Inputs
|
|
8
|
-
- `variant`: `KptSplitButtonVariant` = 'filled' | 'tonal' | 'outline' | 'text' (default 'filled')
|
|
8
|
+
- `variant`: `KptSplitButtonVariant` = 'filled' | 'tonal' | 'outline' | 'text' (default 'filled') -
|
|
9
9
|
the subset of `KptButtonVariant` that has a style; `outline` and `text` use the `--kpt-button-outline-*`
|
|
10
10
|
and `--kpt-button-text-*` tokens, so they match `kpt-button` in the same row
|
|
11
|
-
- `items`: KptMenuItem<T>[]
|
|
11
|
+
- `items`: KptMenuItem<T>[] - { label, value?, icon?, danger?, disabled?, separator? }
|
|
12
12
|
It also honors `header` (a non-clickable row with `avatar`/`label`/`description`), `description`
|
|
13
|
-
(a second line) and `badge` + `badgeVariant` (a badge on the right)
|
|
13
|
+
(a second line) and `badge` + `badgeVariant` (a badge on the right) - described in full in menu/llms.txt.
|
|
14
14
|
- `disabled`: boolean
|
|
15
15
|
|
|
16
16
|
## Outputs
|
|
17
|
-
- `primaryClick`: void
|
|
18
|
-
- `selected`: KptMenuItem<T>
|
|
17
|
+
- `primaryClick`: void - a click on the primary button
|
|
18
|
+
- `selected`: KptMenuItem<T> - an entry picked from the menu
|
|
19
19
|
|
|
20
20
|
## Keyboard
|
|
21
21
|
The toggle is a menu button: `aria-haspopup="menu"`, a live `aria-expanded`, `aria-controls` while
|
|
22
|
-
open.
|
|
22
|
+
open. `ArrowDown` / `ArrowUp` on it open the menu on the first / last item; inside, `ArrowDown` / `ArrowUp` wrap, `Home` / `End`
|
|
23
23
|
jump, `Escape` / `Tab` close, and closing or picking returns focus to the toggle. Same rules as the
|
|
24
|
-
menu
|
|
24
|
+
menu - see menu/llms.txt.
|
|
25
25
|
|
|
26
26
|
## Example
|
|
27
27
|
<kpt-split-button [items]="items" (primaryClick)="save()" (selected)="onItem($event)">Save</kpt-split-button>
|
|
@@ -32,6 +32,12 @@ menu — see menu/llms.txt.
|
|
|
32
32
|
{ label: 'Discard', value: 'discard', danger: true },
|
|
33
33
|
];
|
|
34
34
|
|
|
35
|
+
## Motion
|
|
36
|
+
Pressing either part squeezes the whole pill (one part alone would come apart from the other inside
|
|
37
|
+
the clipped container); the arrow turns over when the menu opens and the menu slides out from under the
|
|
38
|
+
button. Pure CSS; durations follow `--kpt-motion-scale`, so `enabled: false` turns it off, and it drops out
|
|
39
|
+
under "reduce motion".
|
|
40
|
+
|
|
35
41
|
## Tokens
|
|
36
42
|
Colors: `filled` / `tonal` from `--kpt-color-primary` / `--kpt-color-muted`, `outline` / `text`
|
|
37
43
|
from the `--kpt-button-*` tokens of those variants; the panel `--kpt-color-surface-raised`, `--kpt-elevation-3`.
|
|
@@ -5,18 +5,18 @@ Import: `import { KptSplitter } from '@konce-pt/angular';`
|
|
|
5
5
|
|
|
6
6
|
## Inputs / model
|
|
7
7
|
- `orientation`: 'horizontal' | 'vertical' (KptSplitterOrientation)
|
|
8
|
-
- `startSize`: model<number>
|
|
9
|
-
- `minSize`: number (%)
|
|
10
|
-
- `ariaLabel`: string
|
|
11
|
-
- `ariaLabel`: string
|
|
12
|
-
- `ariaLabel`: string
|
|
13
|
-
- `ariaLabel`: string
|
|
8
|
+
- `startSize`: model<number> - the size of the first pane in % (two-way)
|
|
9
|
+
- `minSize`: number (%) - the minimum pane size
|
|
10
|
+
- `ariaLabel`: string - the handle's name; empty = `splitter.resize` from the dictionary
|
|
11
|
+
- `ariaLabel`: string - the handle's name; empty = `splitter.resize` from the dictionary
|
|
12
|
+
- `ariaLabel`: string - the handle's name; empty = `splitter.resize` from the dictionary
|
|
13
|
+
- `ariaLabel`: string - the handle's name; empty = `splitter.resize` from the dictionary
|
|
14
14
|
|
|
15
15
|
## Accessibility
|
|
16
16
|
The handle is a focusable `role="separator"` (the WAI-ARIA window splitter): `aria-valuenow`,
|
|
17
17
|
`aria-valuemin`/`aria-valuemax` (from `minSize`), `aria-controls` pointing at the first pane, and a
|
|
18
18
|
name from `ariaLabel` or `splitter.resize` in the dictionary. Arrow keys resize by 2%, `Home`/`End`
|
|
19
|
-
jump to the minimum/maximum. `aria-orientation` describes the handle's line, not the layout
|
|
19
|
+
jump to the minimum/maximum. `aria-orientation` describes the handle's line, not the layout -
|
|
20
20
|
side-by-side panes have a vertical handle. The host takes `height: 100%`, so a height set on the
|
|
21
21
|
parent reaches the panes.
|
|
22
22
|
|
|
@@ -27,4 +27,4 @@ parent reaches the panes.
|
|
|
27
27
|
</kpt-splitter>
|
|
28
28
|
|
|
29
29
|
## Tokens
|
|
30
|
-
The handle `--kpt-color-border`
|
|
30
|
+
The handle `--kpt-color-border` -> `--kpt-color-primary` (hover/focus).
|
package/src/lib/stepper/llms.txt
CHANGED
|
@@ -5,25 +5,44 @@ Import: `import { KptStepper, KptStep } from '@konce-pt/angular';`
|
|
|
5
5
|
|
|
6
6
|
## KptStepper
|
|
7
7
|
- `activeIndex`: model<number>; public methods: `next()`, `prev()`, `goTo(i)`
|
|
8
|
-
- `animated`: boolean (default true)
|
|
9
|
-
- `animationDuration`: number (default 500)
|
|
8
|
+
- `animated`: boolean (default true) - the switching motion (see "Motion")
|
|
9
|
+
- `animationDuration`: number (default 500) - the pace of the whole motion in ms: the content enter, and the line
|
|
10
|
+
(a segment takes 0.84x, a multi-step jump fits in 1.8x)
|
|
10
11
|
|
|
11
12
|
## KptStep
|
|
12
13
|
- `label`: string (required)
|
|
13
14
|
|
|
14
15
|
## Example
|
|
15
16
|
<kpt-stepper #s [(activeIndex)]="step">
|
|
16
|
-
<kpt-step label="Account"
|
|
17
|
-
<kpt-step label="Profile"
|
|
17
|
+
<kpt-step label="Account">...<kpt-button (click)="s.next()">Next</kpt-button></kpt-step>
|
|
18
|
+
<kpt-step label="Profile">...</kpt-step>
|
|
18
19
|
</kpt-stepper>
|
|
19
20
|
|
|
21
|
+
## Motion
|
|
22
|
+
Switching steps reads as colour flowing: the state changes at once (classes, `aria-current`,
|
|
23
|
+
the marker names), but the connector fills from grey to `--kpt-color-primary` with a glowing comet
|
|
24
|
+
running along it, and a marker turns "done" (fills from the centre, the check pops in) only when the
|
|
25
|
+
colour reaches it; the new active step sends out a ring and keeps a soft glow. A jump over several
|
|
26
|
+
steps runs the segments one after another within ~0.9 s; going back retracts them from the end.
|
|
27
|
+
The content of the new step slides in from the side of the move and sharpens out of a blur, the old
|
|
28
|
+
one leaves as a ghost the other way, and the body height changes smoothly.
|
|
29
|
+
|
|
30
|
+
The timings come from `stepperSchedule` in `@konce-pt/motion` (CSS variables
|
|
31
|
+
`--kpt-stepper-mark-delay`, `--kpt-stepper-line-delay`, `--kpt-stepper-line-dur` on the steps), the comet
|
|
32
|
+
and the ring from `playStepperLight`, the ghost from `preparePanelSwap`. Follows `animated` and `enter`
|
|
33
|
+
from `provideKptMotion` (`none` - everything switches at once, `fade` - no comet and ring); `enabled: false` and the
|
|
34
|
+
system "reduce motion" setting always win.
|
|
35
|
+
|
|
20
36
|
## Tokens
|
|
21
37
|
The active/completed step: `--kpt-color-primary` (marker, connector).
|
|
22
38
|
|
|
23
39
|
## Accessibility
|
|
24
40
|
The header is an `<ol>` of real buttons, so every step is reachable with the keyboard and the list
|
|
25
|
-
announces how many there are. Each marker is named from the dictionary
|
|
26
|
-
(
|
|
41
|
+
announces how many there are. Each marker is named from the dictionary - `stepper.step`
|
|
42
|
+
("Step 2: Delivery") or `stepper.stepDone` ("..., completed") - because the visible marker is only a
|
|
27
43
|
number or a check; the visible label is `aria-hidden` so it is not read twice. The active marker
|
|
28
|
-
carries `aria-current="step"`. After `next()` focus stays where it was
|
|
44
|
+
carries `aria-current="step"`. After `next()` focus stays where it was - move it into the new step
|
|
29
45
|
yourself when the step is long.
|
|
46
|
+
|
|
47
|
+
## Inactive content is destroyed
|
|
48
|
+
Switching renders the new panel from scratch (that is what the enter animation starts from), so local state inside the previous one - an unsent file upload, expanded sections, scroll position - is lost. Keep such state in your own model, outside the panel.
|
package/src/lib/switch/llms.txt
CHANGED
|
@@ -10,19 +10,29 @@ Import: `import { KptSwitch } from '@konce-pt/angular';`
|
|
|
10
10
|
|
|
11
11
|
## Inputs
|
|
12
12
|
- `checked`: model<boolean>; `label`: string (static); `disabled`/`invalid`/`touched`: boolean; the `touch` output.
|
|
13
|
-
- `labelPosition`: 'start' | 'end' (default 'end')
|
|
14
|
-
- `onLabel`/`offLabel`: string
|
|
13
|
+
- `labelPosition`: 'start' | 'end' (default 'end') - the `label` to the left or to the right of the switch.
|
|
14
|
+
- `onLabel`/`offLabel`: string - the state text; shown according to `checked` (the on state highlighted with `--kpt-color-primary`). Can be combined with a static `label`.
|
|
15
|
+
- `toggleMotion`: 'spring' | 'fade' | 'none' (default from `provideKptMotion`, else `spring`) - see "Toggle motion"
|
|
15
16
|
|
|
16
17
|
## Screen reader and keyboard
|
|
17
18
|
The `onLabel`/`offLabel` text is `aria-hidden`: `role="switch"` already announces the state, and
|
|
18
19
|
text inside the `<label>` would change the switch's name on every toggle.
|
|
19
20
|
|
|
20
21
|
## Label and description
|
|
21
|
-
`id` goes to the native field
|
|
22
|
+
`id` goes to the native field - the host never carries it; without one it is generated. Inside
|
|
22
23
|
`kpt-form-field` the control links itself: the wrapper's `label[for]` points at it and the hint or
|
|
23
24
|
error is added to `aria-describedby`, so `controlId` is not needed. Without a wrapper, name it with
|
|
24
25
|
`ariaLabel`. Inside `kpt-form-field` the switch gets both names: the wrapper label and its own
|
|
25
26
|
`label`.
|
|
26
27
|
|
|
28
|
+
## Toggle motion
|
|
29
|
+
`toggleMotion`: `spring` - the thumb travels on a spring and stretches while moving; `fade` - a calm colour and mark transition; `none` - no
|
|
30
|
+
motion. The bounce is started by the change handler, so a control that is checked on load does not
|
|
31
|
+
move. With no value it takes `toggle` from `provideKptMotion` (default `spring`); `enabled: false` and the
|
|
32
|
+
system "reduce motion" setting always win.
|
|
33
|
+
|
|
27
34
|
## Tokens
|
|
28
35
|
`--kpt-color-primary`, `--kpt-color-border-strong`, `--kpt-color-surface`, `--kpt-elevation-1`.
|
|
36
|
+
|
|
37
|
+
## Read-only and required
|
|
38
|
+
`readonly` keeps the switch focusable but blocks toggling (`aria-readonly`); `required` sets `aria-required`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# KptSwitchGroup (kpt-switch-group)
|
|
2
2
|
|
|
3
|
-
A group of switches. Single choice by default (mutually exclusive)
|
|
3
|
+
A group of switches. Single choice by default (mutually exclusive) - turning one on turns the others off.
|
|
4
4
|
With `multiple` it switches to multi-select mode (the value is an array of the selected options).
|
|
5
5
|
Built on Signal Forms (`FormValueControl<T | T[] | null>`, the `value` model). Import: `import { KptSwitchGroup } from '@konce-pt/angular';`
|
|
6
6
|
|
|
@@ -8,28 +8,31 @@ Built on Signal Forms (`FormValueControl<T | T[] | null>`, the `value` model). I
|
|
|
8
8
|
<kpt-switch-group [(value)]="plan" [options]="plans" />
|
|
9
9
|
<!-- multi-select: value = T[] -->
|
|
10
10
|
<kpt-switch-group multiple [(value)]="tags" [options]="tagOptions" />
|
|
11
|
-
<!-- plans: KptOption<T>[] = [{ label, value, disabled? },
|
|
11
|
+
<!-- plans: KptOption<T>[] = [{ label, value, disabled? }, ...] -->
|
|
12
12
|
|
|
13
13
|
## Inputs
|
|
14
|
-
- `value`: model<T | T[] | null>
|
|
15
|
-
- `options`: KptOption<T>[]
|
|
16
|
-
- `multiple`: boolean (default false)
|
|
14
|
+
- `value`: model<T | T[] | null> - single: the option's value or `null`; multiple: an array of the selected options' values.
|
|
15
|
+
- `options`: KptOption<T>[] - the list of options.
|
|
16
|
+
- `multiple`: boolean (default false) - multi-select mode; the value becomes a `T[]` array.
|
|
17
17
|
- `orientation`: 'vertical' (default) | 'horizontal'.
|
|
18
|
-
- `allowDeselect`: boolean (default true)
|
|
18
|
+
- `allowDeselect`: boolean (default true) - whether clicking the active option deselects it (single mode only; in multiple mode deselection is always allowed).
|
|
19
19
|
- `disabled`/`invalid`/`touched`: boolean; the `touch` output.
|
|
20
20
|
|
|
21
21
|
## How it works
|
|
22
22
|
Every entry is a `kpt-switch` with a one-way `[checked]`. In single mode turning one on sets `value` to that
|
|
23
|
-
option, which switches the others off automatically. In `multiple` mode the value is normalized to an array
|
|
23
|
+
option, which switches the others off automatically. In `multiple` mode the value is normalized to an array - turning
|
|
24
24
|
one on adds the option's value, turning it off removes it. It renders `kpt-switch`, so it inherits its look and tokens.
|
|
25
25
|
|
|
26
26
|
## Screen reader and keyboard
|
|
27
27
|
`aria-invalid` is not supported on `role="group"`, so the error state is carried by each switch. In
|
|
28
28
|
single mode the switches are mutually exclusive and nothing announces that turning one on turned
|
|
29
|
-
another off
|
|
29
|
+
another off - for a single choice prefer `kpt-radio-group`.
|
|
30
30
|
|
|
31
31
|
## Label and description
|
|
32
|
-
`id` goes to the focusable element
|
|
32
|
+
`id` goes to the focusable element - the host never carries it; without one it is generated. A `div`
|
|
33
33
|
with a role is not named by `label[for]`, so inside `kpt-form-field` it gets `aria-labelledby`
|
|
34
34
|
pointing at the wrapper's label (unless `ariaLabel` is set), and the hint or error is added to
|
|
35
35
|
`aria-describedby`. No `controlId` needed. New: `id` and `ariaLabel` on the `group`.
|
|
36
|
+
|
|
37
|
+
## Read-only and required
|
|
38
|
+
`readonly` is passed to every switch. With `allowDeselect=false` turning the active switch off puts it back on - before, the switch looked off while the group value said it was on.
|
package/src/lib/tabs/llms.txt
CHANGED
|
@@ -5,16 +5,16 @@ Import: `import { KptTabs, KptTab } from '@konce-pt/angular';`
|
|
|
5
5
|
|
|
6
6
|
## KptTabs
|
|
7
7
|
- `activeIndex`: model<number> (two-way)
|
|
8
|
-
- `animated`: boolean (default true)
|
|
9
|
-
- `animationDuration`: number (default 500)
|
|
8
|
+
- `animated`: boolean (default true) - the transition animation (fade+slide, pure CSS)
|
|
9
|
+
- `animationDuration`: number (default 500) - animation time in ms
|
|
10
10
|
|
|
11
11
|
## KptTab
|
|
12
12
|
- `label`: string (required); `disabled`: boolean
|
|
13
13
|
|
|
14
14
|
## Example
|
|
15
15
|
<kpt-tabs [(activeIndex)]="tab">
|
|
16
|
-
<kpt-tab label="General"
|
|
17
|
-
<kpt-tab label="Advanced"
|
|
16
|
+
<kpt-tab label="General">...</kpt-tab>
|
|
17
|
+
<kpt-tab label="Advanced">...</kpt-tab>
|
|
18
18
|
</kpt-tabs>
|
|
19
19
|
|
|
20
20
|
## Tokens
|
|
@@ -26,3 +26,6 @@ wrapping at the ends, `Home`/`End` jump to the first/last one, and disabled tabs
|
|
|
26
26
|
Moving activates the tab straight away; the next `Tab` goes to the panel (`tabindex="0"`).
|
|
27
27
|
Each tab has an `id`, the active one points at the panel with `aria-controls`, and the panel is
|
|
28
28
|
named by the active tab (`aria-labelledby`).
|
|
29
|
+
|
|
30
|
+
## Inactive content is destroyed
|
|
31
|
+
Switching renders the new panel from scratch (that is what the enter animation starts from), so local state inside the previous one - an unsent file upload, expanded sections, scroll position - is lost. Keep such state in your own model, outside the panel.
|
|
@@ -8,19 +8,30 @@ Import: `import { KptTextarea } from '@konce-pt/angular';`
|
|
|
8
8
|
- `disabled`/`readonly`/`invalid`/`touched`: boolean; `touch`: output
|
|
9
9
|
|
|
10
10
|
## Example
|
|
11
|
-
<kpt-textarea [formField]="f.notes" placeholder="Notes
|
|
11
|
+
<kpt-textarea [formField]="f.notes" placeholder="Notes..." autoResize />
|
|
12
12
|
|
|
13
13
|
## Screen reader and keyboard
|
|
14
|
-
`maxLength`: number
|
|
15
|
-
schema); `counter`: boolean
|
|
14
|
+
`maxLength`: number - the native `maxlength` (under `[formField]` it comes from `maxLength()` in the
|
|
15
|
+
schema); `counter`: boolean - a "12 / 280" counter under the field, read together with it through
|
|
16
16
|
`aria-describedby`.
|
|
17
17
|
|
|
18
18
|
## Label and description
|
|
19
|
-
`id` goes to the native field
|
|
19
|
+
`id` goes to the native field - the host never carries it; without one it is generated. Inside
|
|
20
20
|
`kpt-form-field` the control links itself: the wrapper's `label[for]` points at it and the hint or
|
|
21
21
|
error is added to `aria-describedby`, so `controlId` is not needed. Without a wrapper, name it with
|
|
22
|
-
`ariaLabel`. New: `id`, `ariaLabel` and `required` (
|
|
22
|
+
`ariaLabel`. New: `id`, `ariaLabel` and `required` (-> `aria-required`); `[formField]` binds
|
|
23
23
|
`required`.
|
|
24
24
|
|
|
25
25
|
## Tokens
|
|
26
26
|
`--kpt-form-field-*`.
|
|
27
|
+
|
|
28
|
+
## Dictation
|
|
29
|
+
- `speech`: boolean = false - a microphone in the top corner of the field (the bottom corner belongs
|
|
30
|
+
to the resize handle); while listening the wave stands to its left and the text column widens by
|
|
31
|
+
the wave. Colour: `--kpt-speech-color` / `--kpt-speech-on-color` on the field (theme colour by default). Without browser support it is not shown.
|
|
32
|
+
- `speechLang`: string | null; `speechMode`: `'insert' | 'append' | 'replace'` = `'insert'`.
|
|
33
|
+
- `speechColor`: `'primary' | 'danger' | 'success' | 'warning' | 'info'` = `'primary'` - colour of "stop" and the wave while listening.
|
|
34
|
+
|
|
35
|
+
Interim words are visible but never reach the model; `autoResize` follows the dictated text.
|
|
36
|
+
|
|
37
|
+
<kpt-textarea [formField]="f.notes" speech autoResize />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# KptTimeline (kpt-timeline)
|
|
2
2
|
|
|
3
|
-
A timeline
|
|
3
|
+
A timeline - a vertical list of events with markers. Import: `import { KptTimeline } from '@konce-pt/angular';`
|
|
4
4
|
|
|
5
5
|
## Inputs
|
|
6
6
|
- `items`: KptTimelineItem[]
|
package/src/lib/toast/llms.txt
CHANGED
|
@@ -17,24 +17,55 @@ Place the container once in the application: `<kpt-toast-container />`.
|
|
|
17
17
|
toast.pause(); toast.resume();
|
|
18
18
|
|
|
19
19
|
## KptToast
|
|
20
|
-
`{ id, message, title?, variant: 'info'|'success'|'warning'|'danger', duration, action?: { label, run } }`
|
|
20
|
+
`{ id, message, title?, variant: 'info'|'success'|'warning'|'danger', duration, action?: { label, run }, position?, appearance, closable, progress }`
|
|
21
|
+
|
|
22
|
+
## Position
|
|
23
|
+
`<kpt-toast-container position="top-end" />` - the corner for toasts without their own `position`:
|
|
24
|
+
`top-start`, `top-center`, `top-end`, `bottom-start`, `bottom-center`, `bottom-end` (default).
|
|
25
|
+
`start`/`end` are logical (they swap in RTL). Each corner is its own stack (`data-position`); the
|
|
26
|
+
newest toast is always next to the edge (bottom of a bottom stack, top of a top one) and slides in
|
|
27
|
+
from it. Distance from the edge: `--kpt-toast-offset` (default `--kpt-space-4`) plus the safe area;
|
|
28
|
+
below 40rem a stack takes the full width. One toast can go elsewhere: `{ position: 'bottom-center' }`.
|
|
29
|
+
|
|
30
|
+
## Appearance
|
|
31
|
+
`appearance: 'outline'` (default) - a raised surface with the accent on the start edge;
|
|
32
|
+
`'filled'` - the whole toast in the variant colour, content in `--kpt-color-<role>-contrast` (white
|
|
33
|
+
on every variant in the light theme, dark in the dark theme).
|
|
34
|
+
Icon, text, action and close button are centred on one axis.
|
|
35
|
+
|
|
36
|
+
## Closing and the time bar
|
|
37
|
+
`closable: false` hides the close button. A toast without the close button, without an action and
|
|
38
|
+
with `duration: 0` could never be closed, so it gets `KPT_TOAST_FALLBACK_DURATION` (5000 ms).
|
|
39
|
+
`progress: true` draws a time bar at the bottom that shrinks over `duration` and stops while the
|
|
40
|
+
timers are paused (`service.paused()` -> `data-paused` on the stack). It ignores the motion switch -
|
|
41
|
+
it shows time, it is not decoration.
|
|
42
|
+
|
|
43
|
+
## App-wide defaults
|
|
44
|
+
bootstrapApplication(App, { providers: [provideKptToast({ appearance: 'filled', progress: true, duration: 5000 })] });
|
|
45
|
+
`KptToastConfig`: `duration`, `appearance`, `closable`, `progress`. Order: toast option >
|
|
46
|
+
`provideKptToast` > library default. `resolveKptToast(id, message, options, config)` is the same
|
|
47
|
+
resolution as a pure function.
|
|
21
48
|
|
|
22
49
|
## Actions and pausing
|
|
23
|
-
`action: { label, run }` adds one button to the toast (typically
|
|
50
|
+
`action: { label, run }` adds one button to the toast (typically "Undo"); a click calls `run` and
|
|
24
51
|
dismisses the toast. Give such toasts a longer `duration`, and keep the action available elsewhere.
|
|
25
52
|
`pause()` / `resume()` stop and continue every timer; the container calls them on hover and focus,
|
|
26
53
|
and resumes by itself when the stack empties.
|
|
27
54
|
|
|
28
55
|
## Tokens
|
|
29
56
|
`--kpt-color-surface-raised`, `--kpt-elevation-3`, the accent `--kpt-color-{info,success,warning,danger}`,
|
|
57
|
+
content of `filled` `--kpt-color-{info,success,warning,danger}-contrast`, edge distance `--kpt-toast-offset`,
|
|
30
58
|
stacking `--kpt-z-toast`.
|
|
31
59
|
|
|
32
60
|
## Accessibility
|
|
33
|
-
Announcements go through two permanent, visually hidden live regions next to the stack
|
|
34
|
-
`aria-live="polite"` for ordinary toasts and `aria-live="assertive"` for `danger`
|
|
61
|
+
Announcements go through two permanent, visually hidden live regions next to the stack -
|
|
62
|
+
`aria-live="polite"` for ordinary toasts and `aria-live="assertive"` for `danger` - and not through
|
|
35
63
|
the toasts themselves: a live region has to exist before content appears in it, and nested regions
|
|
36
64
|
are read twice by some screen readers. Each region is cleared before it is written, so the same
|
|
37
65
|
text twice is announced twice, and a dismissed toast never re-announces an older one. While there
|
|
38
|
-
are toasts the stack is `role="region"` named `toast.region` (
|
|
66
|
+
are toasts the stack is `role="region"` named `toast.region` ("Notifications"). Pointer or focus on
|
|
39
67
|
the stack pauses every timer (WCAG 2.2.1); the timers resume with the time that was left. The close
|
|
40
68
|
button is labelled from `common.close`.
|
|
69
|
+
|
|
70
|
+
## Toasts with an action
|
|
71
|
+
A toast with `action` does not close by itself (`duration` defaults to 0): a keyboard or screen-reader user cannot reach the "Undo" button at the end of the page within four seconds (WCAG 2.2.1). An explicit `duration` still wins.
|
package/src/lib/toolbar/llms.txt
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# KptToolbar (kpt-toolbar)
|
|
2
2
|
|
|
3
|
-
A top bar (toolbar)
|
|
3
|
+
A top bar (toolbar) - a horizontal strip for application content.
|
|
4
4
|
Import: `import { KptToolbar } from '@konce-pt/angular';`
|
|
5
5
|
|
|
6
6
|
## Selector
|
|
7
7
|
`kpt-toolbar`
|
|
8
8
|
|
|
9
9
|
## Inputs
|
|
10
|
-
- `elevated`: boolean
|
|
11
|
-
- `wrap`: boolean
|
|
10
|
+
- `elevated`: boolean - a shadow under the bar
|
|
11
|
+
- `wrap`: boolean - lets the content wrap onto further rows. Optional, because
|
|
12
12
|
wrapping changes what `kptToolbarSpacer` does: in a single-row bar it pushes content apart,
|
|
13
13
|
while in a wrapping bar it can shove the remaining actions onto a new row.
|
|
14
14
|
|
package/src/lib/tooltip/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# KptTooltip (kptTooltip)
|
|
2
2
|
|
|
3
|
-
A directive for a tooltip shown on hover/focus. Lightweight
|
|
3
|
+
A directive for a tooltip shown on hover/focus. Lightweight - the element is appended to
|
|
4
4
|
`body` and positioned relative to the host (works in zoneless mode).
|
|
5
5
|
Import: `import { KptTooltip } from '@konce-pt/angular';`
|
|
6
6
|
|
|
@@ -8,27 +8,27 @@ Import: `import { KptTooltip } from '@konce-pt/angular';`
|
|
|
8
8
|
`[kptTooltip]`
|
|
9
9
|
|
|
10
10
|
## Inputs
|
|
11
|
-
- `kptTooltip`: string (the content, required)
|
|
12
|
-
- `kptTooltipPosition`: 'top'|'bottom'|'left'|'right' (default 'top')
|
|
13
|
-
- `kptTooltipOnlyWhenTruncated`: boolean (default false)
|
|
11
|
+
- `kptTooltip`: string (the content, required) - empty content disables the tooltip
|
|
12
|
+
- `kptTooltipPosition`: 'top'|'bottom'|'left'|'right' (default 'top') - the preferred side; see below
|
|
13
|
+
- `kptTooltipOnlyWhenTruncated`: boolean (default false) - shows the tooltip only when
|
|
14
14
|
the content does not fit the element (it is cut off with an ellipsis)
|
|
15
15
|
|
|
16
16
|
## Side
|
|
17
17
|
The bubble goes on the first side that works, in this order: the preferred one, the opposite one,
|
|
18
18
|
then the two others. A side works when the bubble fits in the viewport **and** the host's edge on
|
|
19
|
-
that side is not covered
|
|
19
|
+
that side is not covered - checked with `elementFromPoint` just inside the edge, so a button tucked
|
|
20
20
|
under a sticky header gets its bubble below, not floating over the header. When no side works, the
|
|
21
21
|
preferred one stays. The bubble is then clamped to the viewport (4 px margin), and `data-side` on
|
|
22
22
|
it names the side that won. The check runs again on scroll and resize.
|
|
23
23
|
|
|
24
24
|
## A tooltip only for truncated text
|
|
25
25
|
With `kptTooltipOnlyWhenTruncated` the tooltip does not repeat text that is visible anyway.
|
|
26
|
-
Overflow is measured on the host **and on its direct children**
|
|
26
|
+
Overflow is measured on the host **and on its direct children** - `text-overflow:
|
|
27
27
|
ellipsis` usually sits on an inner element, and such an element shrinks to the available width
|
|
28
28
|
without stretching its parent, so measuring the host alone would detect nothing. When the text is deeper
|
|
29
29
|
than one level, put the directive on its direct parent.
|
|
30
30
|
|
|
31
|
-
The check happens at hover (or focus) time, not at render
|
|
31
|
+
The check happens at hover (or focus) time, not at render - so the result is always
|
|
32
32
|
current after a change in width, zoom or layout, with no `ResizeObserver`.
|
|
33
33
|
|
|
34
34
|
<span class="ellipsis" [kptTooltip]="name" kptTooltipOnlyWhenTruncated>{{ name }}</span>
|
|
@@ -46,8 +46,11 @@ current after a change in width, zoom or layout, with no `ResizeObserver`.
|
|
|
46
46
|
the tooltip) and with `onlyWhenTruncated`, where the text is already in the DOM; the visible
|
|
47
47
|
bubble is then `aria-hidden`.
|
|
48
48
|
- `Escape` closes the bubble, and the pointer can move onto it without it disappearing (a 120 ms
|
|
49
|
-
grace period)
|
|
50
|
-
- It does NOT replace an accessible name
|
|
49
|
+
grace period) - WCAG 1.4.13.
|
|
50
|
+
- It does NOT replace an accessible name - an icon-only button still needs its own label.
|
|
51
51
|
|
|
52
52
|
## Tokens
|
|
53
|
-
Background `--kpt-color-on-surface`, text `--kpt-color-surface` (contrast in both themes), `--kpt-elevation-2`.
|
|
53
|
+
Background `--kpt-color-on-surface`, text `--kpt-color-surface` (contrast in both themes), `--kpt-elevation-2`.
|
|
54
|
+
|
|
55
|
+
## Styling and the top layer
|
|
56
|
+
The bubble is styled by `.kpt-tooltip` from `@konce-pt/styles`, in the `kpt.components` layer - override it from your own CSS without `!important`; only `position: fixed` and the coordinates stay inline. Inside an open `<dialog>` or popover the bubble is attached to that element, because a modal dialog lives in the top layer and anything outside it is hidden behind it regardless of `z-index`. A hover shows the bubble after 300 ms (sliding across a toolbar does not light every icon); focus shows it at once. Changing the text while the bubble is visible updates it.
|
package/src/lib/tree/llms.txt
CHANGED
|
@@ -8,6 +8,7 @@ Import: `import { KptTree, KptTreeNode } from '@konce-pt/angular';`
|
|
|
8
8
|
|
|
9
9
|
## Inputs / outputs
|
|
10
10
|
- `nodes`: KptTreeNode[]; `selectable`: boolean
|
|
11
|
+
- `collapseMotion`: `'spring' | 'fade' | 'none'` (default from `provideKptMotion`, else `spring`) - see below
|
|
11
12
|
- `selected`: model<KptTreeNode|null>; `nodeClick`: output<KptTreeNode>
|
|
12
13
|
|
|
13
14
|
## Example
|
|
@@ -15,16 +16,16 @@ Import: `import { KptTree, KptTreeNode } from '@konce-pt/angular';`
|
|
|
15
16
|
|
|
16
17
|
## Expansion is component state, not data
|
|
17
18
|
`expanded` in a node is the initial state only. The component keeps what the user opened or closed
|
|
18
|
-
itself and never writes to the node objects
|
|
19
|
+
itself and never writes to the node objects - so two trees fed the same nodes open and close
|
|
19
20
|
independently, and replacing `nodes` with new objects brings their own initial state.
|
|
20
21
|
|
|
21
22
|
## Keyboard
|
|
22
23
|
The tree is one Tab stop (roving tabindex on the `treeitem` elements), following the WAI-ARIA tree view
|
|
23
24
|
pattern:
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
- `Enter` / `Space`
|
|
25
|
+
- `ArrowDown` / `ArrowUp` - the next / previous visible row, `Home` / `End` - the first / last;
|
|
26
|
+
- `ArrowRight` - expands a closed branch, on an open one moves to its first child;
|
|
27
|
+
- `ArrowLeft` - collapses an open branch, otherwise moves to the parent;
|
|
28
|
+
- `Enter` / `Space` - the same as a click: selects (with `selectable`) or toggles the branch.
|
|
28
29
|
The logic is the pure function `treeKeyAction` in `tree-keys.ts`; the other port has a twin file.
|
|
29
30
|
|
|
30
31
|
## Accessibility
|
|
@@ -33,6 +34,19 @@ selectable trees `aria-selected`, disabled rows `aria-disabled`. The chevron is
|
|
|
33
34
|
(`aria-hidden`): a button inside a `treeitem` would be a nested control and a second Tab stop per
|
|
34
35
|
row, and the keyboard expands with the arrows anyway. The focus ring is drawn on the row, not on the
|
|
35
36
|
`<li>`, which would outline the whole subtree.
|
|
37
|
+
`ariaLabel` names the `role="tree"` element (e.g. "Project files") - without it a screen reader announces a bare "tree".
|
|
38
|
+
|
|
39
|
+
## Branch motion
|
|
40
|
+
`collapseMotion` animates expanding and collapsing a branch:
|
|
41
|
+
- `spring` - the height opens on a soft spring, children slide in as a cascade and sharpen out of a
|
|
42
|
+
blur; when collapsing, the children fade first;
|
|
43
|
+
- `fade` - children cross-fade;
|
|
44
|
+
- `none` - no motion.
|
|
45
|
+
|
|
46
|
+
A collapsing branch stays in the DOM (`inert`) until its animation ends, so it does not cut off
|
|
47
|
+
mid-way; keyboard navigation already skips it. Entry rules apply only after the first render, so
|
|
48
|
+
branches expanded in the data do not animate on page load. With no value it takes `collapse` from
|
|
49
|
+
`provideKptMotion` (default `spring`); `enabled: false` and the system "reduce motion" setting always win.
|
|
36
50
|
|
|
37
51
|
## Tokens
|
|
38
52
|
Row hover `--kpt-color-surface-variant`; the selected row `--kpt-color-primary`.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# KptUpdate (kpt-update)
|
|
2
|
+
|
|
3
|
+
An app update row: the icon in a `kpt-loader variant="ring"`, the name, a status line
|
|
4
|
+
("12.3 MB of 24 MB") and a button whose label follows the state. Texts cross-fade when the state
|
|
5
|
+
changes; the ring goes from waiting to progress to the result. Import:
|
|
6
|
+
`import { KptUpdate } from '@konce-pt/angular';`
|
|
7
|
+
|
|
8
|
+
The component downloads nothing - the app owns the state, the byte counts and what an action does.
|
|
9
|
+
|
|
10
|
+
## States (`status`)
|
|
11
|
+
- `pending` (default) - waiting (queued, or for the user's decision): the ring loops, the line says
|
|
12
|
+
`update.pending`, the button `update.update`
|
|
13
|
+
- `downloading` - with `total` the ring draws `loaded / total` and the line shows both sizes in the
|
|
14
|
+
unit of the total ("0.4 MB of 24 MB"); without `total` the ring loops and the line shows `loaded`
|
|
15
|
+
(or `update.downloading`). Button: `update.cancel`
|
|
16
|
+
- `success` - the ring closes and releases the icon; line `update.success`, button `update.open`
|
|
17
|
+
- `error` - the ring retracts and a badge pops on the icon; line `update.error`, button `update.retry`
|
|
18
|
+
|
|
19
|
+
## Inputs
|
|
20
|
+
- `name`: string (required)
|
|
21
|
+
- `status`: KptUpdateStatus (default 'pending')
|
|
22
|
+
- `loaded`, `total`: number | null (bytes) - formatted with `Intl` in the interface language
|
|
23
|
+
- `size`: string (default '5.5rem') - the ring size (the `size` of `kpt-loader`)
|
|
24
|
+
- `color`: KptLoaderColor (default 'info') - the ring and the icon tile; a theme role or a CSS colour
|
|
25
|
+
- `showAction`: boolean (default true)
|
|
26
|
+
- `pendingText`, `downloadingText`, `successText`, `errorText` - override the line/status texts
|
|
27
|
+
- `updateLabel`, `cancelLabel`, `openLabel`, `retryLabel` - override the button labels
|
|
28
|
+
|
|
29
|
+
## Outputs
|
|
30
|
+
- `action`: KptUpdateAction - 'update' | 'cancel' | 'open' | 'retry', chosen by the state at the
|
|
31
|
+
moment of the click
|
|
32
|
+
|
|
33
|
+
## Content
|
|
34
|
+
The icon: `<img>`, an inline SVG or `kpt-icon`. An `<img>`/`<svg>` fills the rounded tile; without
|
|
35
|
+
content the tile shows the `download` icon.
|
|
36
|
+
|
|
37
|
+
## Example
|
|
38
|
+
<kpt-update name="Kompas" [status]="status()" [loaded]="loaded()" [total]="total()" (action)="onAction($event)">
|
|
39
|
+
<img src="/kompas.svg" alt="" />
|
|
40
|
+
</kpt-update>
|
|
41
|
+
|
|
42
|
+
## Tokens
|
|
43
|
+
The tile is a gradient from the `color` role to `--kpt-color-success`, the icon on it in
|
|
44
|
+
`--kpt-color-<role>-contrast`, with `--kpt-shadow-sm`. Text: `--kpt-font-weight-semibold` (name),
|
|
45
|
+
`--kpt-font-size-sm` and `--kpt-color-text-muted` (line). Gaps: `--kpt-space-1`, `--kpt-space-4`.
|
|
46
|
+
|
|
47
|
+
## Accessibility
|
|
48
|
+
A visually hidden `role="status"` region holds "name: state" and announces each state change -
|
|
49
|
+
not every byte (the line is `aria-hidden`). While downloading with a known total the ring is a
|
|
50
|
+
`role="progressbar"` named by the state text. The button is a real `kpt-button`; during the
|
|
51
|
+
cross-fade the leaving label is `aria-hidden`. With `provideKptMotion({ enabled: false })` or
|
|
52
|
+
"reduce motion" texts change without the cross-fade.
|
|
@@ -2,6 +2,7 @@ import * as _konce_pt_chart from '@konce-pt/chart';
|
|
|
2
2
|
import { KptChartConfig, KptAnimationOptions, KptAlign } from '@konce-pt/chart';
|
|
3
3
|
export { KPT_CHART_PALETTE, KptAlign, KptAnimationOptions, KptBarOrientation, KptChartConfig, KptChartSeries, KptChartType, KptFont, KptLegendOptions, KptLegendPosition, KptLegendTitle, KptLineInterpolation, KptPadding, KptPointStyle, KptTitleOptions, KptTooltipContext, KptTooltipOptions, areaPath, barLayout, linePath, niceScale, pieSlices, polarSlices, radarGrid, radarPoints, seriesColor } from '@konce-pt/chart';
|
|
4
4
|
import * as _angular_core from '@angular/core';
|
|
5
|
+
import { KptI18n } from '@konce-pt/angular';
|
|
5
6
|
|
|
6
7
|
interface KptChartLegendItem {
|
|
7
8
|
key: string;
|
|
@@ -117,6 +118,16 @@ declare class KptChart {
|
|
|
117
118
|
readonly width: _angular_core.InputSignal<number>;
|
|
118
119
|
/** Wysokość viewBoxa (jednostki SVG). */
|
|
119
120
|
readonly height: _angular_core.InputSignal<number>;
|
|
121
|
+
protected readonly i18n: KptI18n;
|
|
122
|
+
/** Id opisu (`config.description`) dla `aria-describedby` wykresu. */
|
|
123
|
+
protected readonly descId: string;
|
|
124
|
+
/**
|
|
125
|
+
* Alternatywa tekstowa (WCAG 1.1.1): SVG `role="img"` dostaje nazwę (`ariaLabel` -> tytuł -> i18n),
|
|
126
|
+
* a dane idą do ukrytej wizualnie tabeli, po której czytnik chodzi komórka po komórce - dymek
|
|
127
|
+
* na najechanie jest dostępny tylko myszą.
|
|
128
|
+
*/
|
|
129
|
+
protected readonly accessibleName: _angular_core.Signal<string>;
|
|
130
|
+
protected readonly dataTable: _angular_core.Signal<_konce_pt_chart.KptChartDataTable>;
|
|
120
131
|
protected readonly hidden: _angular_core.WritableSignal<ReadonlySet<string>>;
|
|
121
132
|
protected readonly highlighted: _angular_core.WritableSignal<string | null>;
|
|
122
133
|
protected readonly tooltip: _angular_core.WritableSignal<KptChartTooltipState | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"konce-pt-angular-charts.d.ts","sources":["../../charts/src/lib/chart-legend.component.ts","../../charts/src/lib/chart-tooltip.component.ts","../../charts/src/lib/chart.component.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"konce-pt-angular-charts.d.ts","sources":["../../charts/src/lib/chart-legend.component.ts","../../charts/src/lib/chart-tooltip.component.ts","../../charts/src/lib/chart.component.ts"],"mappings":";;;;;;UAGiB,kBAAkB;;;;;AAKlC;;UCNgB,kBAAkB;;;;AAIlC;UAEgB,oBAAoB;;;;;;UAM7B,kBAAkB;AACzB;;ACiBD,UAAU,SAAS;;;;AAIjB;AACD;AACD,UAAU,QAAQ;;;;;AAKjB;AACD,UAAU,SAAS;;;;;AAKlB;AACD,UAAU,YAAY;;;;;AAKpB;YACQ,SAAS;AAClB;AACD,UAAU,MAAM;AACd;;;;;;YACQ,YAAY;UACd,QAAQ;iBACD,SAAS;eACX,SAAS;;AAErB;AACD,UAAU,KAAK;AACb;AACA;;;;;;;;;;AAAyI;UACnI,QAAQ;iBACD,SAAS;eACX,SAAS;AACrB;AACD,UAAU,OAAO;;;;;;;;AAQhB;AACD,UAAU,aAAa;;;;;YAKb,SAAS;AAClB;AACD,UAAU,OAAO;;eAEJ,QAAQ;gBACP,SAAS;YACb,aAAa;AACtB;AAKD;;;;;;;;AAQG;AACH,cAea,QAAQ;qBACJ,aAAA,CAAA,WAAA,CAAA,cAAA;;oBAED,aAAA,CAAA,WAAA;;qBAEC,aAAA,CAAA,WAAA;AAEf,6BAAuB,OAAA;;AAEvB;AACA;;;;AAIG;AACH,uCAAiC,aAAA,CAAA,MAAA;AACjC,kCAA4B,aAAA,CAAA,MAAA,CAAA,eAAA,CAAA,iBAAA;AAG5B,+BAAyB,aAAA,CAAA,cAAA,CAAA,WAAA;AACzB,oCAA8B,aAAA,CAAA,cAAA;AAC9B,gCAA0B,aAAA,CAAA,cAAA,CAAA,oBAAA;;AAE1B,oCAA8B,aAAA,CAAA,cAAA;AAG9B,6BAAuB,aAAA,CAAA,MAAA,CAAA,eAAA,CAAA,YAAA;AACvB,6BAAuB,aAAA,CAAA,MAAA,CAAA,QAAA,CAAA,mBAAA;mCAIM,aAAA,CAAA,MAAA;;;;;;AAS1B;AACH,kCAA4B,aAAA,CAAA,MAAA,CAAA,eAAA,CAAA,eAAA;AAC5B,qCAA+B,aAAA,CAAA,MAAA,CAAA,eAAA,CAAA,eAAA;AAE/B,mCAA6B,aAAA,CAAA,MAAA;AAC7B,sCAAgC,aAAA,CAAA,MAAA;AAGhC,oCAA8B,aAAA,CAAA,MAAA,CAAA,kBAAA;AAgB9B,+BAAyB,aAAA,CAAA,MAAA,CAAA,MAAA;AAuCzB,8BAAwB,aAAA,CAAA,MAAA,CAAA,KAAA;AAmDxB,8BAAwB,aAAA,CAAA,MAAA,CAAA,OAAA;AAuBxB,gCAA0B,aAAA,CAAA,MAAA,CAAA,OAAA;kCAmCE,aAAA,CAAA,MAAA;;;;;;;;;;;AAqBzB;AAGH;;;;AAqBA;;;AAYA;oDA7QW,QAAQ;sDAAR,QAAQ;AAiRpB;;;;","names":[]}
|