@konce-pt/angular 0.7.10 → 0.7.12
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 +44 -0
- package/charts/src/lib/llms.txt +30 -30
- package/fesm2022/konce-pt-angular.mjs +1403 -368
- package/fesm2022/konce-pt-angular.mjs.map +1 -1
- package/grid/src/lib/llms.txt +48 -48
- package/map/src/lib/llms.txt +446 -446
- package/package.json +1 -1
- package/roadmap/src/lib/llms.txt +74 -74
- package/src/lib/accordion/llms.txt +9 -9
- package/src/lib/alert/llms.txt +10 -10
- package/src/lib/app-shell/llms.txt +59 -59
- package/src/lib/auth/llms.txt +104 -0
- package/src/lib/autocomplete/llms.txt +8 -8
- package/src/lib/avatar/llms.txt +9 -9
- package/src/lib/avatar-group/llms.txt +8 -8
- package/src/lib/badge/llms.txt +9 -9
- package/src/lib/bottom-sheet/llms.txt +14 -14
- package/src/lib/breadcrumb/llms.txt +7 -7
- package/src/lib/breakpoint/llms.txt +21 -21
- package/src/lib/button/llms.txt +34 -34
- package/src/lib/button-group/llms.txt +5 -5
- package/src/lib/card/llms.txt +27 -27
- package/src/lib/carousel/llms.txt +11 -11
- package/src/lib/checkbox/llms.txt +7 -7
- package/src/lib/chip/llms.txt +6 -6
- package/src/lib/chips-input/llms.txt +9 -9
- package/src/lib/color-picker/llms.txt +7 -7
- package/src/lib/confirm/llms.txt +11 -11
- package/src/lib/context-menu/llms.txt +10 -10
- package/src/lib/data-table/llms.txt +170 -170
- package/src/lib/data-view/llms.txt +8 -8
- package/src/lib/date-range/llms.txt +25 -25
- package/src/lib/datepicker/llms.txt +48 -48
- package/src/lib/dialog/llms.txt +62 -62
- package/src/lib/divider/llms.txt +9 -9
- package/src/lib/drawer/llms.txt +18 -18
- package/src/lib/empty/llms.txt +9 -9
- package/src/lib/fab/llms.txt +12 -12
- package/src/lib/fieldset/llms.txt +9 -9
- package/src/lib/file-upload/llms.txt +10 -10
- package/src/lib/form-field/llms.txt +45 -45
- package/src/lib/galleria/llms.txt +7 -7
- package/src/lib/i18n/llms.txt +21 -21
- package/src/lib/icon/llms.txt +20 -20
- package/src/lib/icon-button/llms.txt +8 -8
- package/src/lib/image/llms.txt +9 -9
- package/src/lib/input/llms.txt +27 -25
- package/src/lib/input-mask/llms.txt +10 -10
- package/src/lib/input-number/llms.txt +34 -34
- package/src/lib/input-otp/llms.txt +11 -11
- package/src/lib/knob/llms.txt +14 -14
- package/src/lib/listbox/llms.txt +8 -8
- package/src/lib/megamenu/llms.txt +13 -13
- package/src/lib/menu/llms.txt +26 -26
- package/src/lib/menubar/llms.txt +10 -10
- package/src/lib/meter-group/llms.txt +8 -8
- package/src/lib/order-list/llms.txt +8 -8
- package/src/lib/paginator/llms.txt +12 -12
- package/src/lib/panel/llms.txt +12 -12
- package/src/lib/password/llms.txt +12 -9
- package/src/lib/pick-list/llms.txt +8 -8
- package/src/lib/popover/llms.txt +8 -8
- package/src/lib/progress/llms.txt +6 -6
- package/src/lib/radio-group/llms.txt +5 -5
- package/src/lib/rating/llms.txt +6 -6
- package/src/lib/rich-text/llms.txt +51 -32
- package/src/lib/scroll-top/llms.txt +7 -7
- package/src/lib/select/llms.txt +26 -26
- package/src/lib/sidenav/llms.txt +24 -24
- package/src/lib/skeleton/llms.txt +6 -6
- package/src/lib/slider/llms.txt +17 -17
- package/src/lib/speed-dial/llms.txt +7 -7
- package/src/lib/spinner/llms.txt +5 -5
- package/src/lib/split-button/llms.txt +15 -15
- package/src/lib/splitter/llms.txt +11 -11
- package/src/lib/stepper/llms.txt +10 -10
- package/src/lib/switch/llms.txt +10 -10
- package/src/lib/switch-group/llms.txt +16 -16
- package/src/lib/tabs/llms.txt +10 -10
- package/src/lib/textarea/llms.txt +5 -5
- package/src/lib/timeline/llms.txt +10 -10
- package/src/lib/toast/llms.txt +10 -10
- package/src/lib/toolbar/llms.txt +31 -31
- package/src/lib/tooltip/llms.txt +21 -21
- package/src/lib/tree/llms.txt +6 -6
- package/types/konce-pt-angular.d.ts +316 -7
- package/types/konce-pt-angular.d.ts.map +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# KptDatepicker (kpt-datepicker)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
`selectionMode`:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
`startView="decade"` (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
Picking a date/time with a custom calendar (CDK Overlay), Signal Forms. The granularity comes from
|
|
4
|
+
`selectionMode`: date (the default), month+year, year, month, date+time, time only.
|
|
5
|
+
The panel is a stack of views — **decade → years → months → days**: clicking a cell goes one level down,
|
|
6
|
+
clicking the title goes one level up. The starting level is set by `startView` — for a date of birth use
|
|
7
|
+
`startView="decade"` (decade → year → month → day, four clicks instead of hundreds of arrow presses).
|
|
8
|
+
The time is picked on a clock dial (two stages: hours → minutes, click or drag), in 12/24h format.
|
|
9
|
+
Display follows `displayFormat` ('pl'/'iso'). The week starts on Monday, today is marked, min/max range supported.
|
|
10
|
+
Requires the CDK overlay styles: `import '@angular/cdk/overlay-prebuilt.css';`
|
|
11
11
|
Import: `import { KptDatepicker } from '@konce-pt/angular';`
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Usage
|
|
14
14
|
<kpt-datepicker [formField]="f.birthDate" startView="decade" minDate="1920-01-01" />
|
|
15
15
|
<kpt-datepicker [formField]="f.date" minDate="1900-01-01" maxDate="2030-12-31" />
|
|
16
16
|
<kpt-datepicker selectionMode="monthYear" [(value)]="period" />
|
|
@@ -18,50 +18,50 @@ Import: `import { KptDatepicker } from '@konce-pt/angular';`
|
|
|
18
18
|
<kpt-datepicker selectionMode="datetime" [hourFormat]="12" [(value)]="meetingAt" />
|
|
19
19
|
<kpt-datepicker selectionMode="time" [(value)]="alarm" />
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## Inputs
|
|
22
22
|
- `value`: model<string>; `minDate`/`maxDate`: string|null; `placeholder`: string
|
|
23
|
-
- `selectionMode`: 'date' | 'monthYear' | 'year' | 'month' | 'datetime' | 'time' (
|
|
24
|
-
|
|
25
|
-
- `startView`: 'day' | 'month' | 'year' | 'decade' | null (
|
|
26
|
-
|
|
27
|
-
'month'
|
|
28
|
-
`startView="day"`
|
|
29
|
-
(
|
|
30
|
-
- `hourFormat`: 12 | 24 (
|
|
31
|
-
- `minuteStep`: number (
|
|
32
|
-
- `monthDisplay`: 'long' | 'number' (
|
|
33
|
-
- `displayFormat`: 'pl' | 'iso' (
|
|
34
|
-
- `disabled`/`invalid`/`touched`: boolean;
|
|
35
|
-
- `open`: model (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
- `ariaLabel`: string|null —
|
|
41
|
-
(
|
|
42
|
-
-
|
|
43
|
-
-
|
|
23
|
+
- `selectionMode`: 'date' | 'monthYear' | 'year' | 'month' | 'datetime' | 'time' (default 'date').
|
|
24
|
+
The value format depends on the mode: 'YYYY-MM-DD' / 'YYYY-MM' / 'YYYY' / 'MM' / 'YYYY-MM-DDTHH:mm' (datetime) / 'HH:mm' (time).
|
|
25
|
+
- `startView`: 'day' | 'month' | 'year' | 'decade' | null (default null) — the level the panel
|
|
26
|
+
opens at. `null` = the level at which the mode commits a value: 'day' for 'date'/'datetime',
|
|
27
|
+
'month' for 'monthYear'/'month', 'year' for 'year'. It will not go below that level —
|
|
28
|
+
`startView="day"` in 'year' mode is raised to 'year'. The 'month' mode stays on 'month'
|
|
29
|
+
(the value is just 'MM', there is nothing to navigate), and the 'time' mode ignores the input.
|
|
30
|
+
- `hourFormat`: 12 | 24 (default 24) — an AM/PM dial (12) or one with a 13–00 ring (24); the value is always 24h.
|
|
31
|
+
- `minuteStep`: number (default 1) — minute snapping on the dial.
|
|
32
|
+
- `monthDisplay`: 'long' | 'number' (default 'long') — in 'month' mode and in month labels: as a word (January) or a number (01)
|
|
33
|
+
- `displayFormat`: 'pl' | 'iso' (default 'pl') — the display format and the default placeholder
|
|
34
|
+
- `disabled`/`invalid`/`touched`: boolean; the `touch` output.
|
|
35
|
+
- `open`: model (two-way `[(open)]`, the `(openChange)` output) — the calendar state. It lets you open
|
|
36
|
+
it from outside and know when the user is done choosing. For the latter **do not use `touch`**:
|
|
37
|
+
it also fires on the trigger's blur, that is, the moment the mouse goes down on a day in the panel (the panel
|
|
38
|
+
lives in a CDK Overlay container next to `<body>`, outside the control's DOM). That is what inline editing
|
|
39
|
+
in `kpt-data-table` does — see `data-table/llms.txt`.
|
|
40
|
+
- `ariaLabel`: string|null — the accessible name when no `<label for>` describes the field
|
|
41
|
+
(two times in one editor row, for instance). Without it a screen reader announces the value alone.
|
|
42
|
+
- The icon in the field: a calendar, and a clock in 'time' mode.
|
|
43
|
+
- The panel: a clear button (×), the clock dial with "Done".
|
|
44
44
|
|
|
45
|
-
##
|
|
46
|
-
|
|
47
|
-
a
|
|
45
|
+
## Behavior (the view stack)
|
|
46
|
+
The panel header always has the shape `‹ title ›`; the arrows move the current level's page,
|
|
47
|
+
and the title is a button that goes one level up:
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
day ‹ [June] [1979] › arrows ±1 month; the chips → months / years
|
|
50
|
+
month ‹ [1979] › arrows ±1 year; the chip → years
|
|
51
|
+
year ‹ [1970 – 1979] › arrows ±10 years; the chip → decades
|
|
52
|
+
decade ‹ 1920 – 2039 › arrows ±120 years; the top of the stack, the title is not clickable
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
A year page is a **full decade** (10 cells, 1970–1979), a decade page holds 12 decades (1920–2039).
|
|
55
|
+
Clicking a cell above the committing level goes down; on the committing level it sets
|
|
56
|
+
the value and closes the panel. The cell containing today gets an outline (like "today" in the day grid).
|
|
57
|
+
An arrow dims (`disabled`) when the whole neighboring page falls outside `minDate`/`maxDate`.
|
|
58
58
|
|
|
59
59
|
## i18n
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
(
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
Weekday and month names are derived from `Intl` per the active i18n locale (not from the dictionary).
|
|
61
|
+
The navigation/aria labels ("previous decades", "choose a year"…) and "Done" come from i18n
|
|
62
|
+
(the `datepicker` + `common` namespaces). English by default;
|
|
63
|
+
configured through `provideKptI18n` — see `i18n/llms.txt`. Note: `displayFormat` ('pl'/'iso')
|
|
64
|
+
controls the date format only and is independent of the label language.
|
|
65
65
|
|
|
66
|
-
##
|
|
66
|
+
## Tokens
|
|
67
67
|
`--kpt-form-field-{bg,text,border,border-focus,border-error,radius}`.
|
package/src/lib/dialog/llms.txt
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
# KptDialog (kpt-dialog)
|
|
2
|
-
|
|
3
|
-
Okno modalne na natywnym `<dialog>` (focus trap, Esc, backdrop w standardzie).
|
|
4
|
-
Import: `import { KptDialog } from '@konce-pt/angular';`
|
|
5
|
-
|
|
6
|
-
## Selektor
|
|
7
|
-
`kpt-dialog`
|
|
8
|
-
|
|
9
|
-
## Wejścia
|
|
10
|
-
- `open`: model<boolean> — dwukierunkowe `[(open)]`
|
|
11
|
-
- `header`: string; `dismissible`: boolean (Esc/× zamyka; domyślnie true)
|
|
12
|
-
|
|
13
|
-
## Sloty
|
|
14
|
-
- treść domyślna → body; element z atrybutem `kptDialogFooter` → stopka
|
|
15
|
-
|
|
16
|
-
## Przykład
|
|
17
|
-
<kpt-dialog [(open)]="confirmOpen" header="Usunąć?">
|
|
18
|
-
Nieodwracalne.
|
|
19
|
-
<div kptDialogFooter>
|
|
20
|
-
<kpt-button variant="text" (click)="confirmOpen.set(false)">Anuluj</kpt-button>
|
|
21
|
-
<kpt-button variant="danger" (click)="remove()">Usuń</kpt-button>
|
|
22
|
-
</div>
|
|
23
|
-
</kpt-dialog>
|
|
24
|
-
|
|
25
|
-
## Tokeny
|
|
26
|
-
`--kpt-color-surface-raised`, `--kpt-color-overlay-scrim` (::backdrop), `--kpt-elevation-4`.
|
|
27
|
-
Uwaga: globalny reset zeruje margin — komponent przywraca `margin:auto` (centrowanie).
|
|
28
|
-
|
|
29
|
-
## Kontrolki na CDK Overlay w środku okna
|
|
30
|
-
|
|
31
|
-
`kpt-dialog` stoi na natywnym `<dialog>` i otwiera się przez `showModal()`, co wynosi je
|
|
32
|
-
do **warstwy szczytowej** przeglądarki — a ta jest ponad całym drzewem dokumentu i żaden
|
|
33
|
-
`z-index` jej nie przebije. Kontener CDK Overlay wisi domyślnie na `<body>`, więc panele
|
|
34
|
-
`kpt-select`, `kpt-datepicker`, `kpt-autocomplete` i `kpt-menu` otwierałyby się w środku
|
|
35
|
-
okna NIEWIDOCZNE, schowane za jego tłem.
|
|
36
|
-
|
|
37
|
-
Dlatego `kpt-dialog` na czas otwarcia przenosi kontener overlayów do wnętrza `<dialog>`
|
|
38
|
-
i oddaje go na miejsce przy zamknięciu (również gdy komponent zostanie zniszczony
|
|
39
|
-
z otwartym oknem). Nie trzeba nic konfigurować — kontrolki overlayowe działają w oknie
|
|
40
|
-
tak samo jak poza nim.
|
|
1
|
+
# KptDialog (kpt-dialog)
|
|
41
2
|
|
|
42
|
-
|
|
3
|
+
A modal window on the native `<dialog>` (focus trap, Esc, a backdrop out of the box).
|
|
4
|
+
Import: `import { KptDialog } from '@konce-pt/angular';`
|
|
43
5
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
Pasek przewijania biegnie więc tylko wzdłuż treści, nie wzdłuż całego okna.
|
|
6
|
+
## Selector
|
|
7
|
+
`kpt-dialog`
|
|
47
8
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
na `max-height: calc(100vh - 4rem)` i przewija samą treść.
|
|
9
|
+
## Inputs
|
|
10
|
+
- `open`: model<boolean> — two-way `[(open)]`
|
|
11
|
+
- `header`: string; `dismissible`: boolean (Esc/× closes it; default true)
|
|
52
12
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
autorska ją bije — także z `@layer`. Niescopowane `display: flex` zostawiłoby wszystkie
|
|
56
|
-
zamknięte okna widoczne na stronie.
|
|
13
|
+
## Slots
|
|
14
|
+
- the default content → the body; an element with the `kptDialogFooter` attribute → the footer
|
|
57
15
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
16
|
+
## Example
|
|
17
|
+
<kpt-dialog [(open)]="confirmOpen" header="Delete this?">
|
|
18
|
+
This cannot be undone.
|
|
19
|
+
<div kptDialogFooter>
|
|
20
|
+
<kpt-button variant="text" (click)="confirmOpen.set(false)">Cancel</kpt-button>
|
|
21
|
+
<kpt-button variant="danger" (click)="remove()">Delete</kpt-button>
|
|
22
|
+
</div>
|
|
23
|
+
</kpt-dialog>
|
|
62
24
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
25
|
+
## Tokens
|
|
26
|
+
`--kpt-color-surface-raised`, `--kpt-color-overlay-scrim` (::backdrop), `--kpt-elevation-4`.
|
|
27
|
+
Note: the global reset zeroes the margin — the component restores `margin:auto` (centering).
|
|
28
|
+
|
|
29
|
+
## CDK Overlay controls inside the dialog
|
|
30
|
+
|
|
31
|
+
`kpt-dialog` stands on the native `<dialog>` and opens through `showModal()`, which lifts it
|
|
32
|
+
into the browser's **top layer** — and that sits above the entire document tree, where no
|
|
33
|
+
`z-index` can reach it. The CDK Overlay container hangs off `<body>` by default, so the panels of
|
|
34
|
+
`kpt-select`, `kpt-datepicker`, `kpt-autocomplete` and `kpt-menu` would open inside the
|
|
35
|
+
dialog INVISIBLE, hidden behind its background.
|
|
36
|
+
|
|
37
|
+
That is why, while it is open, `kpt-dialog` moves the overlay container inside the `<dialog>`
|
|
38
|
+
and puts it back on close (including when the component is destroyed
|
|
39
|
+
with the dialog open). Nothing needs configuring — overlay controls behave inside the dialog
|
|
40
|
+
exactly as they do outside it.
|
|
41
|
+
|
|
42
|
+
## Layout and scrolling
|
|
43
|
+
|
|
44
|
+
An open dialog is a flex column: the header (`.kpt-dialog__header`) and the footer
|
|
45
|
+
(`[kptDialogFooter]`) stay put, and only `.kpt-dialog__body` scrolls.
|
|
46
|
+
The scrollbar therefore runs alongside the content, not alongside the whole dialog.
|
|
47
|
+
|
|
48
|
+
The content gets `flex: 0 1 auto` (the default) + `min-height: 0`, deliberately **not** `flex: 1`
|
|
49
|
+
as in `kpt-drawer`. A drawer fills the height of the screen, a dialog is meant to shrink to its content:
|
|
50
|
+
a short one (`kpt-confirm` — two sentences and two buttons) stays short, a long one stops
|
|
51
|
+
at `max-height: calc(100vh - 4rem)` and scrolls the content alone.
|
|
52
|
+
|
|
53
|
+
The `display: flex` declaration is scoped with `&[open]` and has to stay that way. The
|
|
54
|
+
`dialog:not([open]) { display: none }` rule comes from the browser stylesheet, and any author
|
|
55
|
+
declaration beats it — including one inside `@layer`. An unscoped `display: flex` would leave every
|
|
56
|
+
closed dialog visible on the page.
|
|
57
|
+
|
|
58
|
+
`.kpt-dialog` does not get `overflow: hidden` — while it is open the CDK Overlay container is
|
|
59
|
+
moved inside the `<dialog>` (see the section above), so clipping the dialog would cut off the
|
|
60
|
+
panels of `kpt-select` or `kpt-datepicker`. It is not needed for scrolling either:
|
|
61
|
+
once it is a flex column, nothing sticks out of the dialog.
|
|
62
|
+
|
|
63
|
+
A pinned action bar inside the content (say "Cancel / Save" in `kpt-map-create-dialog`)
|
|
64
|
+
is done with `position: sticky` — the scrolling container is `.kpt-dialog__body`.
|
|
65
|
+
The negative side margins have to match its padding (`--kpt-space-6`),
|
|
66
|
+
and the `bottom` offset has to mirror the negative bottom margin
|
|
67
|
+
(`bottom: calc(var(--kpt-space-6) * -1)`) — stickiness is computed for the margin
|
|
68
|
+
box, so with `bottom: 0` a sliver of content would slide underneath the bar.
|
package/src/lib/divider/llms.txt
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# KptDivider (kpt-divider)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A separator (a horizontal or vertical line). `role="separator"`.
|
|
4
4
|
Import: `import { KptDivider } from '@konce-pt/angular';`
|
|
5
5
|
|
|
6
|
-
##
|
|
6
|
+
## Selector
|
|
7
7
|
`kpt-divider`
|
|
8
8
|
|
|
9
|
-
##
|
|
10
|
-
- `orientation`: 'horizontal' | 'vertical' (
|
|
11
|
-
- `inset`: boolean —
|
|
9
|
+
## Inputs
|
|
10
|
+
- `orientation`: 'horizontal' | 'vertical' (default 'horizontal')
|
|
11
|
+
- `inset`: boolean — inset from the container edges
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Example
|
|
14
14
|
<kpt-divider />
|
|
15
15
|
<kpt-divider inset />
|
|
16
|
-
<kpt-divider orientation="vertical" /> <!--
|
|
16
|
+
<kpt-divider orientation="vertical" /> <!-- inside a flex container -->
|
|
17
17
|
|
|
18
|
-
##
|
|
19
|
-
|
|
18
|
+
## Tokens
|
|
19
|
+
Color from `--kpt-color-border`. The vertical one needs a flex parent (align-self: stretch).
|
package/src/lib/drawer/llms.txt
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
# KptDrawer (kpt-drawer)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
(
|
|
3
|
+
A sliding panel (drawer / off-canvas) driven by the `open` signal. Independent of the app shell
|
|
4
|
+
(fixed position + a backdrop, a transform animation). Import: `import { KptDrawer } from '@konce-pt/angular';`
|
|
5
5
|
|
|
6
|
-
##
|
|
7
|
-
- `open`: model<boolean> (
|
|
6
|
+
## Inputs / model
|
|
7
|
+
- `open`: model<boolean> (two-way)
|
|
8
8
|
- `position`: 'left' | 'right' | 'top' | 'bottom' (KptDrawerPosition)
|
|
9
|
-
- `header`: string; `dismissible`: boolean (×
|
|
10
|
-
-
|
|
9
|
+
- `header`: string; `dismissible`: boolean (× and Esc); `closeOnBackdrop`: boolean
|
|
10
|
+
- Content through the `<ng-content>` projection.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Example
|
|
13
13
|
<kpt-button (click)="menuOpen.set(true)">Menu</kpt-button>
|
|
14
|
-
<kpt-drawer [(open)]="menuOpen" position="right" header="
|
|
14
|
+
<kpt-drawer [(open)]="menuOpen" position="right" header="Filters">…</kpt-drawer>
|
|
15
15
|
|
|
16
|
-
##
|
|
17
|
-
|
|
18
|
-
`display: none`,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
`[data-position]` —
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
## The closed state / a11y
|
|
17
|
+
The panel is always in the DOM (no `@if`), hidden with `transform` **and** `visibility: hidden` — never
|
|
18
|
+
`display: none`, so that the slide-in and slide-out animations survive. `visibility` takes the closed panel
|
|
19
|
+
out of the tab order and out of the accessibility tree without `inert`, and it does so on the very first frame,
|
|
20
|
+
without waiting for JavaScript. Both closed-state declarations live in the **base** rule, not in
|
|
21
|
+
`[data-position]` — Angular only sets the position attribute during the update pass, so a panel gated on that
|
|
22
|
+
attribute would flash on screen and then animate away. `prefers-reduced-motion: reduce`
|
|
23
|
+
drops the transitions.
|
|
24
24
|
|
|
25
|
-
##
|
|
26
|
-
|
|
25
|
+
## Tokens
|
|
26
|
+
The panel `--kpt-color-surface-raised`, `--kpt-elevation-4`; a semi-transparent backdrop.
|
package/src/lib/empty/llms.txt
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# KptEmpty (kpt-empty)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An empty state — an icon, a title, a description and optional actions (content projection).
|
|
4
4
|
Import: `import { KptEmpty } from '@konce-pt/angular';`
|
|
5
5
|
|
|
6
|
-
##
|
|
7
|
-
- `icon`: string | null (
|
|
6
|
+
## Inputs
|
|
7
|
+
- `icon`: string | null (default 'info-circle')
|
|
8
8
|
- `title`: string; `description`: string
|
|
9
|
-
-
|
|
9
|
+
- Actions: `<ng-content>` (buttons, for instance).
|
|
10
10
|
|
|
11
|
-
##
|
|
12
|
-
<kpt-empty icon="search" title="
|
|
13
|
-
<kpt-button>
|
|
11
|
+
## Example
|
|
12
|
+
<kpt-empty icon="search" title="No results" description="Change your criteria.">
|
|
13
|
+
<kpt-button>Clear filters</kpt-button>
|
|
14
14
|
</kpt-empty>
|
|
15
15
|
|
|
16
|
-
##
|
|
17
|
-
|
|
16
|
+
## Tokens
|
|
17
|
+
The icon sits in a `--kpt-color-muted` circle; text `--kpt-color-on-surface(-muted)`.
|
package/src/lib/fab/llms.txt
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
# KptFab (kpt-fab)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A floating action button — a round, raised action button. Import: `import { KptFab } from '@konce-pt/angular';`
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
- `variant`: 'filled' | 'tonal' (
|
|
7
|
-
- `size`: 'md' | 'mini' (
|
|
8
|
-
- `extended`: boolean (
|
|
5
|
+
## Inputs
|
|
6
|
+
- `variant`: 'filled' | 'tonal' (default 'filled')
|
|
7
|
+
- `size`: 'md' | 'mini' (default 'md')
|
|
8
|
+
- `extended`: boolean (a pill with text)
|
|
9
9
|
- `disabled`: boolean; `type`: 'button' | 'submit' | 'reset'
|
|
10
|
-
- `ariaLabel`: string (
|
|
10
|
+
- `ariaLabel`: string (required for the round, textless variant)
|
|
11
11
|
|
|
12
|
-
##
|
|
13
|
-
<kpt-fab ariaLabel="
|
|
14
|
-
<kpt-fab extended><kpt-icon name="plus" />
|
|
15
|
-
<kpt-fab variant="tonal" size="mini" ariaLabel="
|
|
12
|
+
## Example
|
|
13
|
+
<kpt-fab ariaLabel="Add"><kpt-icon name="plus" /></kpt-fab>
|
|
14
|
+
<kpt-fab extended><kpt-icon name="plus" /> New</kpt-fab>
|
|
15
|
+
<kpt-fab variant="tonal" size="mini" ariaLabel="Edit"><kpt-icon name="copy" /></kpt-fab>
|
|
16
16
|
|
|
17
|
-
##
|
|
18
|
-
|
|
17
|
+
## Tokens
|
|
18
|
+
Background `--kpt-color-primary` / `--kpt-color-primary-container` (tonal); shadow `--kpt-elevation-3`.
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# KptFieldset (kpt-fieldset)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A group of fields with a legend (`<fieldset>`+`<legend>`), optionally collapsible.
|
|
4
4
|
Import: `import { KptFieldset } from '@konce-pt/angular';`
|
|
5
5
|
|
|
6
|
-
##
|
|
6
|
+
## Inputs / model
|
|
7
7
|
- `legend`: string
|
|
8
8
|
- `toggleable`: boolean; `collapsed`: model<boolean>
|
|
9
|
-
- `animated`: boolean (
|
|
10
|
-
- `animationDuration`: number (
|
|
11
|
-
-
|
|
9
|
+
- `animated`: boolean (default true) — the collapse animation (CSS grid, pure CSS)
|
|
10
|
+
- `animationDuration`: number (default 500) — animation time in ms
|
|
11
|
+
- Content: `<ng-content>`.
|
|
12
12
|
|
|
13
|
-
##
|
|
14
|
-
<kpt-fieldset legend="
|
|
13
|
+
## Example
|
|
14
|
+
<kpt-fieldset legend="Personal details" toggleable>…</kpt-fieldset>
|
|
15
15
|
|
|
16
|
-
##
|
|
17
|
-
|
|
16
|
+
## Tokens
|
|
17
|
+
Border `--kpt-color-border`; radius `--kpt-radius-md`.
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
# KptFileUpload (kpt-file-upload)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
File upload (drag-and-drop + picker) on Signal Forms. The value is a File[].
|
|
4
4
|
Import: `import { KptFileUpload } from '@konce-pt/angular';`
|
|
5
5
|
|
|
6
|
-
##
|
|
7
|
-
- `value`: model<File[]> (
|
|
8
|
-
- `accept`: string (
|
|
6
|
+
## Inputs / model
|
|
7
|
+
- `value`: model<File[]> (or `formField`)
|
|
8
|
+
- `accept`: string (e.g. 'image/*')
|
|
9
9
|
- `multiple`: boolean
|
|
10
10
|
- `disabled`/`invalid`/`touched`: boolean; `touch`: output
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Example
|
|
13
13
|
<kpt-file-upload [formField]="f.files" accept="image/*" multiple />
|
|
14
14
|
<kpt-file-upload [(value)]="files" />
|
|
15
15
|
|
|
16
16
|
files = signal<File[]>([]);
|
|
17
17
|
|
|
18
|
-
##
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
## Behavior
|
|
19
|
+
The zone responds both to a click and to files dragged onto it. With `multiple=false` it keeps only the first file.
|
|
20
|
+
The file list shows the name, the size and a remove button.
|
|
21
21
|
|
|
22
|
-
##
|
|
23
|
-
|
|
22
|
+
## Tokens
|
|
23
|
+
The zone uses `--kpt-form-field-border` (dashed), the dragover state `--kpt-color-primary`.
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
# KptFormField (kpt-form-field)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
(
|
|
3
|
+
A form field wrapper: the label, the hint and the error message around any control
|
|
4
|
+
(`kpt-input`, for instance). Presentational — the error state is passed in through `error`.
|
|
5
5
|
Import: `import { KptFormField } from '@konce-pt/angular';`
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Selector
|
|
8
8
|
`kpt-form-field`
|
|
9
9
|
|
|
10
|
-
##
|
|
11
|
-
- `label`: string —
|
|
12
|
-
- `hint`: string —
|
|
13
|
-
- `error`: string | null —
|
|
14
|
-
- `required`: boolean —
|
|
15
|
-
- `controlId`: string — id
|
|
16
|
-
- `labelType`: 'fixed' | 'over' | 'in' | 'on' —
|
|
17
|
-
|
|
18
|
-
##
|
|
19
|
-
- `fixed` (
|
|
20
|
-
- `over` —
|
|
21
|
-
- `in` —
|
|
22
|
-
- `on` —
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
10
|
+
## Inputs (input signals)
|
|
11
|
+
- `label`: string — the label text
|
|
12
|
+
- `hint`: string — a hint (hidden while there is an error)
|
|
13
|
+
- `error`: string | null — the error message; when non-empty, the field is marked invalid
|
|
14
|
+
- `required`: boolean — an asterisk next to the label
|
|
15
|
+
- `controlId`: string — the control's id, for the `label[for]` association
|
|
16
|
+
- `labelType`: 'fixed' | 'over' | 'in' | 'on' — the label variant (default `fixed`)
|
|
17
|
+
|
|
18
|
+
## Label variants (labelType)
|
|
19
|
+
- `fixed` (the default) — a static label above the control (as before).
|
|
20
|
+
- `over` — a float label: the label rises above the field's border.
|
|
21
|
+
- `in` — a float label: the label rises into the upper part inside the field (a taller field, the "filled" style).
|
|
22
|
+
- `on` — a float label: the label sits on the top border (a notch, the "outlined" style).
|
|
23
|
+
|
|
24
|
+
The float variants animate the label's transition (from its resting position where the placeholder is →
|
|
25
|
+
raised). It rises when the control takes focus **or** when the field has a value. Detecting whether
|
|
26
|
+
it is filled happens inside the component (`input`/`change` events + the initial value) — it does **not**
|
|
27
|
+
require setting a placeholder on the control.
|
|
28
28
|
|
|
29
29
|
<kpt-form-field label="E-mail" labelType="over">
|
|
30
30
|
<kpt-input />
|
|
31
31
|
</kpt-form-field>
|
|
32
32
|
|
|
33
|
-
###
|
|
33
|
+
### Controls with no native `input`/`textarea`
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
`kpt-select`
|
|
35
|
+
The value of `kpt-select` cannot be read from the DOM (the panel lives in an overlay), so such a control
|
|
36
|
+
reports being filled itself — it provides the `KPT_FORM_FIELD_CONTROL` token with a `filled` signal.
|
|
37
|
+
`kpt-select` does this out of the box; a custom control needs:
|
|
38
38
|
|
|
39
39
|
import { KPT_FORM_FIELD_CONTROL, type KptFormFieldControl } from '@konce-pt/angular';
|
|
40
40
|
|
|
@@ -45,36 +45,36 @@ zgłasza wypełnienie sama — dostarcza token `KPT_FORM_FIELD_CONTROL` z sygna
|
|
|
45
45
|
readonly filled = computed(() => this.value() != null);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
Once a control provides the token, `kpt-form-field` stops looking into the DOM and trusts the
|
|
49
|
+
`filled` signal alone — which is why the label rises the instant the value changes.
|
|
50
50
|
|
|
51
|
-
##
|
|
52
|
-
|
|
51
|
+
## Content projection
|
|
52
|
+
The control goes into the content (ng-content):
|
|
53
53
|
|
|
54
|
-
<kpt-form-field label="E-mail" [error]="emailError()" hint="
|
|
54
|
+
<kpt-form-field label="E-mail" [error]="emailError()" hint="Your work address" required controlId="f-email">
|
|
55
55
|
<kpt-input [formField]="loginForm.email" type="email" id="f-email" />
|
|
56
56
|
</kpt-form-field>
|
|
57
57
|
|
|
58
|
-
##
|
|
59
|
-
`error`
|
|
58
|
+
## Integration with Signal Forms
|
|
59
|
+
`error` usually comes from a form field, for example:
|
|
60
60
|
|
|
61
61
|
emailError = computed(() => {
|
|
62
62
|
const s = loginForm.email();
|
|
63
63
|
return s.touched() && s.invalid() ? s.errors()[0]?.message ?? null : null;
|
|
64
64
|
});
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
`state.touched()`
|
|
68
|
-
|
|
69
|
-
`##
|
|
66
|
+
The `touched()` gate applies to the message only — do not gate the validators (`when:` on
|
|
67
|
+
`state.touched()` makes `valid()` lie on an untouched form). The `kpt-*` controls gate their own
|
|
68
|
+
visual state the same way. The full submit flow: the
|
|
69
|
+
`## A form from scratch (Signal Forms)` section in the root llms.txt.
|
|
70
70
|
|
|
71
|
-
##
|
|
71
|
+
## Tokens
|
|
72
72
|
`--kpt-form-field-label`, `--kpt-form-field-hint`, `--kpt-form-field-error`, `--kpt-color-danger`.
|
|
73
|
-
|
|
74
|
-
`--kpt-form-field-border-focus` (
|
|
75
|
-
`--kpt-form-field-bg` (
|
|
76
|
-
`--kpt-motion-easing-standard`;
|
|
77
|
-
|
|
78
|
-
##
|
|
79
|
-
-
|
|
80
|
-
-
|
|
73
|
+
The float variants add: `--kpt-form-field-placeholder` (the resting label),
|
|
74
|
+
`--kpt-form-field-border-focus` (raised), `--kpt-form-field-border-error` (the error state),
|
|
75
|
+
`--kpt-form-field-bg` (the notch mask in `on`). Animation: `--kpt-motion-duration-fast`,
|
|
76
|
+
`--kpt-motion-easing-standard`; it respects `prefers-reduced-motion`.
|
|
77
|
+
|
|
78
|
+
## Accessibility
|
|
79
|
+
- The error message carries `role="alert"`.
|
|
80
|
+
- Tie `controlId` to the control's `id` so the label is clickable (`label[for]`).
|