@konce-pt/angular 0.7.11 → 0.8.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 +72 -0
- package/charts/src/lib/llms.txt +31 -30
- package/fesm2022/konce-pt-angular-charts.mjs +7 -498
- package/fesm2022/konce-pt-angular-charts.mjs.map +1 -1
- package/fesm2022/konce-pt-angular-icons.mjs +7 -5136
- package/fesm2022/konce-pt-angular-icons.mjs.map +1 -1
- package/fesm2022/konce-pt-angular-map.mjs +14 -1298
- package/fesm2022/konce-pt-angular-map.mjs.map +1 -1
- package/fesm2022/konce-pt-angular-roadmap.mjs +8 -1269
- package/fesm2022/konce-pt-angular-roadmap.mjs.map +1 -1
- package/fesm2022/konce-pt-angular.mjs +179 -1455
- package/fesm2022/konce-pt-angular.mjs.map +1 -1
- package/grid/src/lib/llms.txt +48 -48
- package/map/src/lib/llms.txt +447 -446
- package/package.json +9 -2
- package/roadmap/src/lib/llms.txt +75 -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 +58 -58
- 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 +52 -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 +28 -22
- package/src/lib/icon/llms.txt +20 -20
- package/src/lib/icon-button/llms.txt +9 -8
- package/src/lib/image/llms.txt +9 -9
- package/src/lib/input/llms.txt +27 -27
- 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 -12
- 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 +10 -6
- package/src/lib/rich-text/llms.txt +50 -50
- 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-charts.d.ts +10 -199
- package/types/konce-pt-angular-charts.d.ts.map +1 -1
- package/types/konce-pt-angular-icons.d.ts +2 -4
- package/types/konce-pt-angular-icons.d.ts.map +1 -1
- package/types/konce-pt-angular-map.d.ts +4 -609
- package/types/konce-pt-angular-map.d.ts.map +1 -1
- package/types/konce-pt-angular-roadmap.d.ts +6 -541
- package/types/konce-pt-angular-roadmap.d.ts.map +1 -1
- package/types/konce-pt-angular.d.ts +57 -529
- package/types/konce-pt-angular.d.ts.map +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# KptGalleria (kpt-galleria)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A large image preview with a thumbnail strip and navigation.
|
|
4
4
|
Import: `import { KptGalleria } from '@konce-pt/angular';`
|
|
5
5
|
|
|
6
|
-
##
|
|
6
|
+
## Inputs / model
|
|
7
7
|
- `items`: KptGalleriaItem[] — { src, thumbnail?, alt? }
|
|
8
|
-
- `activeIndex`: model<number> (
|
|
9
|
-
- `showThumbnails`: boolean (
|
|
8
|
+
- `activeIndex`: model<number> (two-way)
|
|
9
|
+
- `showThumbnails`: boolean (default true)
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Example
|
|
12
12
|
<kpt-galleria [items]="photos" [(activeIndex)]="idx" />
|
|
13
13
|
|
|
14
|
-
##
|
|
15
|
-
|
|
14
|
+
## Tokens
|
|
15
|
+
The stage `--kpt-color-muted`; the active thumbnail `--kpt-color-primary`.
|
package/src/lib/i18n/llms.txt
CHANGED
|
@@ -1,35 +1,41 @@
|
|
|
1
1
|
# i18n (provideKptI18n / KptI18n)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Translations for component labels. Base languages: EN (default), PL. Signal-based (zoneless-friendly), with no external dependencies.
|
|
4
4
|
Import: `import { provideKptI18n, KptI18n } from '@konce-pt/angular';`
|
|
5
5
|
|
|
6
|
-
##
|
|
7
|
-
- `provideKptI18n({ locale?, messages? }): EnvironmentProviders` —
|
|
8
|
-
- `locale`: 'en' | 'pl' |
|
|
9
|
-
- `messages`: `Record<locale, DeepPartial<KptMessages>>` —
|
|
6
|
+
## Configuration (provider)
|
|
7
|
+
- `provideKptI18n({ locale?, messages? }): EnvironmentProviders` — in `bootstrapApplication`.
|
|
8
|
+
- `locale`: 'en' | 'pl' | any string (default 'en').
|
|
9
|
+
- `messages`: `Record<locale, DeepPartial<KptMessages>>` — registers a new language or overrides an existing one (deep merge, missing keys fall back to EN).
|
|
10
10
|
|
|
11
|
-
##
|
|
12
|
-
- `locale: Signal<KptLocale>` —
|
|
13
|
-
- `setLocale(locale)` —
|
|
14
|
-
- `registerMessages(locale, patch)` —
|
|
15
|
-
- `t(key, params?)` —
|
|
11
|
+
## The KptI18n service (providedIn: 'root')
|
|
12
|
+
- `locale: Signal<KptLocale>` — the current language.
|
|
13
|
+
- `setLocale(locale)` — a runtime change (reactive across every component).
|
|
14
|
+
- `registerMessages(locale, patch)` — adds to or overrides a dictionary at runtime.
|
|
15
|
+
- `t(key, params?)` — translates a dotted key (`'paginator.range'`) with `{name}` interpolation.
|
|
16
16
|
|
|
17
|
-
##
|
|
18
|
-
import de from './i18n/de.json'; //
|
|
17
|
+
## Adding your own language (one JSON file)
|
|
18
|
+
import de from './i18n/de.json'; // the shape is the KptMessages interface
|
|
19
19
|
provideKptI18n({ locale: 'de', messages: { de } });
|
|
20
|
-
// runtime: inject(KptI18n).registerMessages('de', de); inject(KptI18n).setLocale('de');
|
|
20
|
+
// at runtime: inject(KptI18n).registerMessages('de', de); inject(KptI18n).setLocale('de');
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## Switching language at runtime
|
|
23
23
|
const i18n = inject(KptI18n);
|
|
24
24
|
i18n.setLocale('pl');
|
|
25
25
|
|
|
26
|
-
##
|
|
27
|
-
|
|
26
|
+
## The key contract (KptMessages)
|
|
27
|
+
Namespaces: `common` (close/remove/previous/next/clear/done/all), `paginator` (rowsPerPage/range/prevPage/nextPage),
|
|
28
28
|
`select`, `listbox`, `dataView`, `dataTable`, `confirm`, `fileUpload`, `chipsInput`, `dateRange`, `datepicker`,
|
|
29
|
-
`pickList`, `orderList`, `inputNumber`, `password`, `spinner`, `speedDial`, `scrollTop`, `splitButton`, `panel`,
|
|
30
|
-
`breadcrumb`, `richText`, `auth` (
|
|
31
|
-
`richText.styleHeading` ({level}), `auth.continueWith` ({provider}), `auth.passwordHint`
|
|
29
|
+
`pickList`, `orderList`, `inputNumber`, `password`, `rating`, `spinner`, `speedDial`, `scrollTop`, `splitButton`, `panel`,
|
|
30
|
+
`breadcrumb`, `richText`, `auth` (including `auth.promo.*`). Interpolations: `paginator.range` ({start},{end},{total}), `dataTable.filter*` ({column}),
|
|
31
|
+
`richText.styleHeading` ({level}), `auth.continueWith` ({provider}), `auth.passwordHint` and `auth.errorMinLength` ({min}), `rating.star` ({value},{max}). Day and month names in calendars are derived from `Intl` per locale (not from the dictionary).
|
|
32
32
|
|
|
33
|
-
##
|
|
34
|
-
|
|
35
|
-
input
|
|
33
|
+
## Note
|
|
34
|
+
Individual labels can also be overridden per component through the matching `input()` (e.g. `emptyMessage`, `acceptLabel`) —
|
|
35
|
+
the input takes priority over the i18n dictionary.
|
|
36
|
+
|
|
37
|
+
## Where the dictionaries live
|
|
38
|
+
The contract (`KptMessages`), the base EN/PL dictionaries and the translation core (`translate`, `deepMerge`)
|
|
39
|
+
live in `@konce-pt/i18n` — a pure-TypeScript package with no framework dependency, shared with the React port
|
|
40
|
+
so both render identical labels. `@konce-pt/angular` re-exports all of it, so the imports above stay unchanged;
|
|
41
|
+
you never need to install `@konce-pt/i18n` yourself.
|
package/src/lib/icon/llms.txt
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
# KptIcon (kpt-icon)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
An inline SVG icon (the Tabler Icons set — MIT). The size is inherited from `font-size` (1em),
|
|
4
|
+
the color from `currentColor`. Import: `import { KptIcon } from '@konce-pt/angular';`
|
|
5
5
|
|
|
6
|
-
##
|
|
6
|
+
## Selector
|
|
7
7
|
`kpt-icon`
|
|
8
8
|
|
|
9
|
-
##
|
|
10
|
-
- `name`: KptIconName (
|
|
11
|
-
- `size`: string (
|
|
9
|
+
## Inputs
|
|
10
|
+
- `name`: KptIconName (required) — an icon name from the registry
|
|
11
|
+
- `size`: string (optional, e.g. '1.25rem') — otherwise inherited from font-size
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Available names (built in)
|
|
14
14
|
menu, x, chevron-up, chevron-down, chevron-left, chevron-right, check, search,
|
|
15
15
|
grip-vertical, info, alert-triangle, circle-check, circle-x, calendar, copy, link, code,
|
|
16
16
|
star, phone, map-pin, world, clock, align-left, align-center, align-right, align-justified,
|
|
17
17
|
palette, highlight, clipboard, clipboard-text, table, mail, share, external-link, crosshair
|
|
18
|
-
(
|
|
18
|
+
(the full list lives in `icons.ts`).
|
|
19
19
|
|
|
20
|
-
##
|
|
21
|
-
|
|
20
|
+
## The full set (5130 Tabler icons)
|
|
21
|
+
An optional entry point `@konce-pt/angular/icons` (downloaded only when imported):
|
|
22
22
|
|
|
23
23
|
import { provideKptTablerIcons } from '@konce-pt/angular/icons';
|
|
24
24
|
bootstrapApplication(App, { providers: [provideKptTablerIcons()] });
|
|
25
|
-
//
|
|
25
|
+
// then: <kpt-icon name="rocket" />, <kpt-icon name="arrow-left" /> …
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
`ellipse` +
|
|
30
|
-
build
|
|
31
|
-
`kpt-icon`
|
|
27
|
+
You can also register your own through `KptIconRegistry.register({ name: 'inner svg' })` — the content is
|
|
28
|
+
sanitized down to an allowlist of SVG geometry (`path`/`circle`/`rect`/`g`/`line`/`polygon`/`polyline`/
|
|
29
|
+
`ellipse` + shape/style attributes), but `register()` may only be called with content the developer controls
|
|
30
|
+
at build time, never straight from runtime/CMS/upload data.
|
|
31
|
+
`kpt-icon` reacts to late registration (the `version` signal).
|
|
32
32
|
|
|
33
|
-
##
|
|
33
|
+
## Example
|
|
34
34
|
<kpt-icon name="check" />
|
|
35
35
|
<kpt-icon name="chevron-down" size="1.25rem" />
|
|
36
36
|
<button><kpt-icon name="x" /></button>
|
|
37
37
|
|
|
38
|
-
##
|
|
39
|
-
Tabler Icons (MIT).
|
|
40
|
-
|
|
38
|
+
## Icon license
|
|
39
|
+
Tabler Icons (MIT). The icons are extracted inline into `icons.ts`. See ICONS-LICENSE at the root.
|
|
40
|
+
Adding an icon: add an entry to `KPT_ICONS`/`KptIconName` (a 24×24 grid, 2px stroke).
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
# KptIconButton (kpt-icon-button)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An icon-only button. `ariaLabel` is required.
|
|
4
4
|
Import: `import { KptIconButton } from '@konce-pt/angular';`
|
|
5
5
|
|
|
6
|
-
##
|
|
6
|
+
## Inputs
|
|
7
7
|
- `variant`: 'filled'|'tonal'|'outline'|'text'|'danger'; `size`: 'sm'|'md'|'lg'; `shape`: 'round'|'square'
|
|
8
|
-
- `type`, `disabled`, `loading`, `ariaLabel` (
|
|
8
|
+
- `type`, `disabled`, `loading`, `ariaLabel` (required)
|
|
9
|
+
- `ariaPressed`: `boolean | null` = `null` — toggle state; lands on the inner `<button>`, so a screen reader announces it (`[attr.aria-pressed]` on the tag would sit on the host, which has no button role)
|
|
9
10
|
|
|
10
|
-
##
|
|
11
|
-
<kpt-icon-button ariaLabel="
|
|
12
|
-
<kpt-icon-button variant="danger" shape="square" ariaLabel="
|
|
11
|
+
## Examples
|
|
12
|
+
<kpt-icon-button ariaLabel="Settings"><kpt-icon name="menu" /></kpt-icon-button>
|
|
13
|
+
<kpt-icon-button variant="danger" shape="square" ariaLabel="Delete"><kpt-icon name="x" /></kpt-icon-button>
|
|
13
14
|
|
|
14
|
-
##
|
|
15
|
-
|
|
15
|
+
## Tokens
|
|
16
|
+
Shared with kpt-button (`--kpt-color-primary`, `--kpt-color-muted`, …).
|
package/src/lib/image/llms.txt
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# KptImage (kpt-image)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An image with an optional full-screen preview (zoom).
|
|
4
4
|
Import: `import { KptImage } from '@konce-pt/angular';`
|
|
5
5
|
|
|
6
|
-
##
|
|
7
|
-
- `src`: string (
|
|
8
|
-
- `width`: string | null (
|
|
9
|
-
- `preview`: boolean —
|
|
6
|
+
## Inputs
|
|
7
|
+
- `src`: string (required); `alt`: string
|
|
8
|
+
- `width`: string | null (e.g. '240px')
|
|
9
|
+
- `preview`: boolean — a click opens a magnifying overlay
|
|
10
10
|
|
|
11
|
-
##
|
|
12
|
-
<kpt-image src="/
|
|
11
|
+
## Example
|
|
12
|
+
<kpt-image src="/photo.jpg" alt="Photo" preview width="240px" />
|
|
13
13
|
|
|
14
|
-
##
|
|
15
|
-
|
|
14
|
+
## Tokens
|
|
15
|
+
A semi-transparent preview mask; the `zoom-in` icon; a dark overlay.
|
package/src/lib/input/llms.txt
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
# KptInput (kpt-input)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
`FormValueControl<string>` —
|
|
5
|
-
|
|
3
|
+
The Koncept UI text field, integrated with Angular Signal Forms. It implements
|
|
4
|
+
`FormValueControl<string>` — bind it with the `FormField` directive (`@angular/forms/signals`).
|
|
5
|
+
No `ControlValueAccessor`. Import: `import { KptInput } from '@konce-pt/angular';`
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Selector
|
|
8
8
|
`kpt-input`
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Usage with Signal Forms
|
|
11
11
|
|
|
12
12
|
import { form, FormField, required, email } from '@angular/forms/signals';
|
|
13
13
|
|
|
14
14
|
model = signal({ email: '' });
|
|
15
15
|
loginForm = form(this.model, (p) => {
|
|
16
|
-
required(p.email, { message: 'E-mail
|
|
17
|
-
email(p.email, { message: '
|
|
16
|
+
required(p.email, { message: 'E-mail is required' });
|
|
17
|
+
email(p.email, { message: 'Enter a valid e-mail address' });
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
//
|
|
20
|
+
// template (imports: [KptInput, FormField, FormRoot, KptButton])
|
|
21
21
|
<form [formRoot]="loginForm" (submit)="onSubmit()">
|
|
22
22
|
<kpt-input [formField]="loginForm.email" type="email" id="f-email" />
|
|
23
|
-
<kpt-button type="submit" [disabled]="loginForm().invalid()">
|
|
23
|
+
<kpt-button type="submit" [disabled]="loginForm().invalid()">Sign in</kpt-button>
|
|
24
24
|
</form>
|
|
25
25
|
|
|
26
|
-
`[formRoot]`
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
`[formRoot]` sets `novalidate` and calls `submit()` on its own; `submit()` does `markAsTouched()` on its own.
|
|
27
|
+
Do not gate validators with `when: state.touched()` — it breaks `valid()`.
|
|
28
|
+
The full flow: the `## A form from scratch (Signal Forms)` section in the root llms.txt.
|
|
29
29
|
|
|
30
|
-
##
|
|
31
|
-
- `type`: 'text'|'email'|'password'|'number'|'search'|'tel'|'url'|'time' (
|
|
30
|
+
## Presentational inputs
|
|
31
|
+
- `type`: 'text'|'email'|'password'|'number'|'search'|'tel'|'url'|'time' (default 'text')
|
|
32
32
|
- `placeholder`: string
|
|
33
|
-
- `id`: string —
|
|
33
|
+
- `id`: string — lands on the inner `<input>` (for `label[for]`); the host does not carry it
|
|
34
34
|
- `ariaLabel`: string | null
|
|
35
|
-
- `autocomplete`: string | null —
|
|
36
|
-
(
|
|
35
|
+
- `autocomplete`: string | null — a hint for the browser and the password manager
|
|
36
|
+
(e.g. `email`, `username`, `one-time-code`); without it autofill does not work
|
|
37
37
|
|
|
38
|
-
##
|
|
39
|
-
`value` (model,
|
|
40
|
-
`touched`;
|
|
38
|
+
## State bound automatically by FormField
|
|
39
|
+
`value` (model, required), `disabled`, `readonly`, `required`, `invalid`, `errors`,
|
|
40
|
+
`touched`; the `touch` output (emitted on blur). Do not set them by hand when used with a form.
|
|
41
41
|
|
|
42
|
-
##
|
|
42
|
+
## Tokens
|
|
43
43
|
`--kpt-form-field-{bg,text,placeholder,border,border-hover,border-focus,border-error,radius}`.
|
|
44
44
|
|
|
45
|
-
##
|
|
46
|
-
- `aria-invalid="true"`
|
|
47
|
-
|
|
48
|
-
- `aria-required="true"`
|
|
49
|
-
|
|
50
|
-
-
|
|
45
|
+
## Accessibility
|
|
46
|
+
- `aria-invalid="true"` only once the field is invalid **and** touched (`blur`) — a fresh,
|
|
47
|
+
empty form is not painted red.
|
|
48
|
+
- `aria-required="true"` with `required` — deliberately not the native `required` attribute, which
|
|
49
|
+
would block the submit event and run browser validation alongside Signal Forms.
|
|
50
|
+
- Error messages are usually rendered by `kpt-form-field` (`role="alert"`).
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
# KptInputMask (kpt-input-mask)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A field with a character mask on Signal Forms. The value is a string.
|
|
4
4
|
Import: `import { KptInputMask } from '@konce-pt/angular';`
|
|
5
5
|
|
|
6
|
-
##
|
|
7
|
-
- `9` =
|
|
6
|
+
## Mask tokens
|
|
7
|
+
- `9` = a digit, `a` = a letter, `*` = alphanumeric. Every other character in the mask is a literal (spaces, parentheses, hyphens).
|
|
8
8
|
|
|
9
|
-
##
|
|
10
|
-
- `value`: model<string> (
|
|
11
|
-
- `mask`: string (
|
|
12
|
-
- `placeholder`: string (
|
|
9
|
+
## Inputs / model
|
|
10
|
+
- `value`: model<string> (or `formField`)
|
|
11
|
+
- `mask`: string (e.g. `(999) 999-99-99`)
|
|
12
|
+
- `placeholder`: string (defaults to the mask)
|
|
13
13
|
- `disabled`/`invalid`/`touched`: boolean; `touch`: output
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Example
|
|
16
16
|
<kpt-input-mask [formField]="f.phone" mask="(999) 999-99-99" />
|
|
17
17
|
<kpt-input-mask [(value)]="zip" mask="99-999" />
|
|
18
18
|
|
|
19
|
-
##
|
|
20
|
-
|
|
19
|
+
## Tokens
|
|
20
|
+
The field uses `--kpt-form-field-*`.
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
# KptInputNumber (kpt-input-number)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
`showButtons="false"`
|
|
3
|
+
A numeric field with stepper arrows on Signal Forms. The value is number | null.
|
|
4
|
+
`showButtons="false"` gives the arrow-less variant — for "from–to" ranges.
|
|
5
5
|
Import: `import { KptInputNumber } from '@konce-pt/angular';`
|
|
6
6
|
|
|
7
|
-
##
|
|
8
|
-
- `value`: model<number | null> (
|
|
9
|
-
- `min`/`max`: number | undefined; `step`: number (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
(FORM_FIELD_UNSUPPORTED_BINDING).
|
|
13
|
-
- `suffix`: string (
|
|
14
|
-
- `showButtons`: boolean (
|
|
15
|
-
|
|
7
|
+
## Inputs / model
|
|
8
|
+
- `value`: model<number | null> (or `formField`)
|
|
9
|
+
- `min`/`max`: number | undefined; `step`: number (default 1). Under `[formField]` do NOT
|
|
10
|
+
bind the bounds — they are declared by `min()`/`max()` in `form()`, and `FormField` injects them
|
|
11
|
+
into these inputs itself; `[min]`/`[max]` next to `[formField]` is a compilation error
|
|
12
|
+
(FORM_FIELD_UNSUPPORTED_BINDING). Bind them directly only together with `[(value)]`.
|
|
13
|
+
- `suffix`: string (e.g. ' %'); `placeholder`: string
|
|
14
|
+
- `showButtons`: boolean (default `true`) — `false` hides the `−`/`+` arrows; the field content
|
|
15
|
+
then aligns left, as in `kpt-input` (the `.kpt-input-number--plain` modifier)
|
|
16
16
|
- `disabled`/`invalid`/`touched`: boolean; `touch`: output
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## Example
|
|
19
19
|
<kpt-input-number [formField]="f.qty" [step]="1" />
|
|
20
|
-
<kpt-input-number [(value)]="qty" [min]="0" [max]="99" suffix="
|
|
21
|
-
<kpt-input-number [formField]="f.priceFrom" [showButtons]="false" suffix="
|
|
20
|
+
<kpt-input-number [(value)]="qty" [min]="0" [max]="99" suffix=" pcs" />
|
|
21
|
+
<kpt-input-number [formField]="f.priceFrom" [showButtons]="false" suffix=" USD" />
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## A "from–to" range (cross-field validation)
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
Two separate form fields; the "to ≥ from" rule is attached through `validateTree` on the root.
|
|
26
|
+
The error is aimed at a specific field with the `fieldTree` property — otherwise it would land on the form
|
|
27
|
+
and would not show up under any control.
|
|
28
28
|
|
|
29
29
|
import { form, max, min, validateTree } from '@angular/forms/signals';
|
|
30
30
|
|
|
31
31
|
model = signal({ priceFrom: null as number | null, priceTo: null as number | null });
|
|
32
32
|
|
|
33
33
|
rangeForm = form(this.model, (path) => {
|
|
34
|
-
min(path.priceFrom, 0, { message: '
|
|
35
|
-
max(path.priceFrom, 9999, { message: '
|
|
36
|
-
min(path.priceTo, 0, { message: '
|
|
37
|
-
max(path.priceTo, 9999, { message: '
|
|
34
|
+
min(path.priceFrom, 0, { message: 'The value cannot be negative' });
|
|
35
|
+
max(path.priceFrom, 9999, { message: 'The value cannot exceed 9999' });
|
|
36
|
+
min(path.priceTo, 0, { message: 'The value cannot be negative' });
|
|
37
|
+
max(path.priceTo, 9999, { message: 'The value cannot exceed 9999' });
|
|
38
38
|
|
|
39
39
|
validateTree(path, (ctx) => {
|
|
40
40
|
const from = ctx.valueOf(path.priceFrom);
|
|
@@ -42,25 +42,25 @@ i nie pokazałby się pod żadną kontrolką.
|
|
|
42
42
|
if (from === null || to === null || from <= to) return null;
|
|
43
43
|
return {
|
|
44
44
|
kind: 'range',
|
|
45
|
-
message: '
|
|
46
|
-
fieldTree: ctx.fieldTreeOf(path.priceTo), //
|
|
45
|
+
message: 'The "to" value cannot be lower than "from"',
|
|
46
|
+
fieldTree: ctx.fieldTreeOf(path.priceTo), // the error lands on the "to" field
|
|
47
47
|
};
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
//
|
|
51
|
+
// template — two columns from md up (utility classes from @konce-pt/grid)
|
|
52
52
|
<form class="kpt-grid" [formRoot]="rangeForm" (submit)="onSubmit()">
|
|
53
|
-
<kpt-form-field class="kpt-col-12 kpt-col-md-6" label="
|
|
54
|
-
<kpt-input-number [formField]="rangeForm.priceFrom" [showButtons]="false" suffix="
|
|
53
|
+
<kpt-form-field class="kpt-col-12 kpt-col-md-6" label="Price from" [error]="fromError()">
|
|
54
|
+
<kpt-input-number [formField]="rangeForm.priceFrom" [showButtons]="false" suffix=" USD" />
|
|
55
55
|
</kpt-form-field>
|
|
56
|
-
<kpt-form-field class="kpt-col-12 kpt-col-md-6" label="
|
|
57
|
-
<kpt-input-number [formField]="rangeForm.priceTo" [showButtons]="false" suffix="
|
|
56
|
+
<kpt-form-field class="kpt-col-12 kpt-col-md-6" label="Price to" [error]="toError()">
|
|
57
|
+
<kpt-input-number [formField]="rangeForm.priceTo" [showButtons]="false" suffix=" USD" />
|
|
58
58
|
</kpt-form-field>
|
|
59
59
|
</form>
|
|
60
60
|
|
|
61
|
-
`ctx.valueOf(path.x)`
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
`ctx.valueOf(path.x)` reads another field's value, `ctx.fieldTreeOf(path.x)` points at the field
|
|
62
|
+
the error belongs to. Messages are supplied through `errorFor()` with a `touched()` gate — do not
|
|
63
|
+
gate the validators. The full submit flow: `## A form from scratch (Signal Forms)` in the root llms.txt.
|
|
64
64
|
|
|
65
|
-
##
|
|
66
|
-
|
|
65
|
+
## Tokens
|
|
66
|
+
The field `--kpt-form-field-*`; the buttons `--kpt-color-muted`.
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# KptInputOtp (kpt-input-otp)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
A one-time code field (OTP/PIN) — N separate boxes with autofocus and paste support. Signal Forms.
|
|
4
|
+
The value is a string (the characters joined). Import: `import { KptInputOtp } from '@konce-pt/angular';`
|
|
5
5
|
|
|
6
|
-
##
|
|
7
|
-
- `value`: model<string> (
|
|
8
|
-
- `length`: number (
|
|
9
|
-
- `integerOnly`: boolean —
|
|
6
|
+
## Inputs / model
|
|
7
|
+
- `value`: model<string> (or `formField`)
|
|
8
|
+
- `length`: number (default 6)
|
|
9
|
+
- `integerOnly`: boolean — digits only
|
|
10
10
|
- `disabled`/`invalid`/`touched`: boolean; `touch`: output
|
|
11
11
|
|
|
12
|
-
##
|
|
13
|
-
|
|
12
|
+
## Behavior
|
|
13
|
+
Typing a character moves to the next box; Backspace goes back; pasting spreads the code across the boxes.
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Example
|
|
16
16
|
<kpt-input-otp [formField]="f.code" [length]="6" integerOnly />
|
|
17
17
|
|
|
18
|
-
##
|
|
19
|
-
|
|
18
|
+
## Tokens
|
|
19
|
+
The boxes use `--kpt-form-field-*`.
|
package/src/lib/knob/llms.txt
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
# KptKnob (kpt-knob)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A knob — pick a value along an SVG arc, with the mouse (drag) or the arrow keys. Signal Forms.
|
|
4
4
|
Import: `import { KptKnob } from '@konce-pt/angular';`
|
|
5
5
|
|
|
6
|
-
##
|
|
7
|
-
- `value`: model<number> (
|
|
8
|
-
- `min`/`max`: number | undefined (0/100); `step`: number.
|
|
9
|
-
|
|
10
|
-
(FORM_FIELD_UNSUPPORTED_BINDING);
|
|
11
|
-
- `size`: px (
|
|
12
|
-
- `showValue`: boolean (
|
|
6
|
+
## Inputs / model
|
|
7
|
+
- `value`: model<number> (or `formField`)
|
|
8
|
+
- `min`/`max`: number | undefined (0/100); `step`: number. Under `[formField]` the bounds come
|
|
9
|
+
from `min()`/`max()` in `form()` — `[min]`/`[max]` next to `[formField]` is a compilation error
|
|
10
|
+
(FORM_FIELD_UNSUPPORTED_BINDING); bind them directly only together with `[(value)]`.
|
|
11
|
+
- `size`: px (default 96); `stroke`: px (10); `suffix`: string
|
|
12
|
+
- `showValue`: boolean (default true)
|
|
13
13
|
- `disabled`/`invalid`/`touched`: boolean; `touch`: output
|
|
14
14
|
|
|
15
|
-
##
|
|
16
|
-
`role="slider"` + aria-valuemin/max/now;
|
|
15
|
+
## Accessibility
|
|
16
|
+
`role="slider"` + aria-valuemin/max/now; arrow keys, Home/End.
|
|
17
17
|
|
|
18
|
-
##
|
|
19
|
-
<kpt-knob [formField]="f.level" [step]="5" /> <!--
|
|
18
|
+
## Example
|
|
19
|
+
<kpt-knob [formField]="f.level" [step]="5" /> <!-- bounds from min()/max() in form() -->
|
|
20
20
|
<kpt-knob [(value)]="level" [min]="0" [max]="100" [step]="5" />
|
|
21
21
|
|
|
22
|
-
##
|
|
23
|
-
|
|
22
|
+
## Tokens
|
|
23
|
+
The background arc `--kpt-color-border`; the value `--kpt-color-primary`; text `--kpt-color-on-surface`.
|
package/src/lib/listbox/llms.txt
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# KptListbox (kpt-listbox)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
A selection list (listbox) on Signal Forms. Single or multiple selection, an optional filter.
|
|
4
|
+
Value: `T` (single) or `T[]` (multiple). Import: `import { KptListbox } from '@konce-pt/angular';`
|
|
5
5
|
|
|
6
|
-
##
|
|
7
|
-
- `value`: model<T | T[] | null> (
|
|
6
|
+
## Inputs / model
|
|
7
|
+
- `value`: model<T | T[] | null> (or `formField`)
|
|
8
8
|
- `options`: KptOption<T>[] — { label, value, disabled? }
|
|
9
|
-
- `multiple`: boolean; `filter`: boolean (
|
|
9
|
+
- `multiple`: boolean; `filter`: boolean (a search field)
|
|
10
10
|
- `disabled`/`invalid`/`touched`: boolean; `touch`: output
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Example
|
|
13
13
|
<kpt-listbox [formField]="f.role" [options]="roles" filter />
|
|
14
14
|
<kpt-listbox [(value)]="tags" [options]="tagOptions" multiple />
|
|
15
15
|
|
|
16
|
-
##
|
|
17
|
-
|
|
16
|
+
## Tokens
|
|
17
|
+
The frame `--kpt-form-field-*`; selection `--kpt-color-primary`.
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
# KptMegamenu (kpt-megamenu)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
A mega menu — a horizontal bar with a wide, multi-column panel.
|
|
4
|
+
Structure: a top-level entry → `items` (the columns) → each column's `items` (the links).
|
|
5
|
+
The panel sits on CDK Overlay (attached to `body`, never clipped by `overflow: hidden`).
|
|
6
|
+
Requires `import '@angular/cdk/overlay-prebuilt.css';`
|
|
7
7
|
Import: `import { KptMegamenu } from '@konce-pt/angular';`
|
|
8
8
|
|
|
9
|
-
##
|
|
10
|
-
- `items`: KptMenuItem<T>[] (3
|
|
11
|
-
- `selected`: KptMenuItem<T> (
|
|
9
|
+
## Inputs / outputs
|
|
10
|
+
- `items`: KptMenuItem<T>[] (3 levels: top → columns → links)
|
|
11
|
+
- `selected`: KptMenuItem<T> (the clicked link)
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Example
|
|
14
14
|
items = [{
|
|
15
|
-
label: '
|
|
15
|
+
label: 'Products',
|
|
16
16
|
items: [
|
|
17
|
-
{ label: '
|
|
18
|
-
{ label: '
|
|
17
|
+
{ label: 'Components', items: [{ label: 'Forms' }, { label: 'Tables' }] },
|
|
18
|
+
{ label: 'Templates', items: [{ label: 'Dashboard' }] },
|
|
19
19
|
],
|
|
20
20
|
}];
|
|
21
21
|
|
|
22
|
-
##
|
|
23
|
-
|
|
22
|
+
## Tokens
|
|
23
|
+
The panel `--kpt-color-surface-raised`, `--kpt-elevation-3`.
|