@konce-pt/angular 0.1.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/LICENSE +21 -0
- package/dist/fesm2022/konce-pt-angular-icons.mjs +5166 -0
- package/dist/fesm2022/konce-pt-angular-icons.mjs.map +1 -0
- package/dist/fesm2022/konce-pt-angular.mjs +5863 -0
- package/dist/fesm2022/konce-pt-angular.mjs.map +1 -0
- package/dist/package.json +47 -0
- package/dist/src/lib/accordion/llms.txt +18 -0
- package/dist/src/lib/alert/llms.txt +19 -0
- package/dist/src/lib/app-shell/llms.txt +29 -0
- package/dist/src/lib/autocomplete/llms.txt +16 -0
- package/dist/src/lib/avatar/llms.txt +15 -0
- package/dist/src/lib/avatar-group/llms.txt +15 -0
- package/dist/src/lib/badge/llms.txt +16 -0
- package/dist/src/lib/bottom-sheet/llms.txt +16 -0
- package/dist/src/lib/breadcrumb/llms.txt +12 -0
- package/dist/src/lib/button/llms.txt +35 -0
- package/dist/src/lib/button-group/llms.txt +14 -0
- package/dist/src/lib/card/llms.txt +24 -0
- package/dist/src/lib/carousel/llms.txt +24 -0
- package/dist/src/lib/checkbox/llms.txt +15 -0
- package/dist/src/lib/chip/llms.txt +14 -0
- package/dist/src/lib/chips-input/llms.txt +18 -0
- package/dist/src/lib/color-picker/llms.txt +18 -0
- package/dist/src/lib/confirm/llms.txt +21 -0
- package/dist/src/lib/context-menu/llms.txt +17 -0
- package/dist/src/lib/data-table/llms.txt +62 -0
- package/dist/src/lib/data-view/llms.txt +18 -0
- package/dist/src/lib/date-range/llms.txt +24 -0
- package/dist/src/lib/datepicker/llms.txt +17 -0
- package/dist/src/lib/dialog/llms.txt +27 -0
- package/dist/src/lib/divider/llms.txt +19 -0
- package/dist/src/lib/drawer/llms.txt +17 -0
- package/dist/src/lib/empty/llms.txt +17 -0
- package/dist/src/lib/fab/llms.txt +18 -0
- package/dist/src/lib/fieldset/llms.txt +15 -0
- package/dist/src/lib/file-upload/llms.txt +23 -0
- package/dist/src/lib/form-field/llms.txt +37 -0
- package/dist/src/lib/galleria/llms.txt +15 -0
- package/dist/src/lib/icon/llms.txt +34 -0
- package/dist/src/lib/icon-button/llms.txt +15 -0
- package/dist/src/lib/image/llms.txt +15 -0
- package/dist/src/lib/input/llms.txt +38 -0
- package/dist/src/lib/input-mask/llms.txt +20 -0
- package/dist/src/lib/input-number/llms.txt +17 -0
- package/dist/src/lib/input-otp/llms.txt +19 -0
- package/dist/src/lib/knob/llms.txt +20 -0
- package/dist/src/lib/listbox/llms.txt +17 -0
- package/dist/src/lib/megamenu/llms.txt +21 -0
- package/dist/src/lib/menu/llms.txt +17 -0
- package/dist/src/lib/menubar/llms.txt +19 -0
- package/dist/src/lib/meter-group/llms.txt +15 -0
- package/dist/src/lib/order-list/llms.txt +17 -0
- package/dist/src/lib/paginator/llms.txt +18 -0
- package/dist/src/lib/panel/llms.txt +18 -0
- package/dist/src/lib/password/llms.txt +20 -0
- package/dist/src/lib/pick-list/llms.txt +17 -0
- package/dist/src/lib/popover/llms.txt +17 -0
- package/dist/src/lib/progress/llms.txt +16 -0
- package/dist/src/lib/radio-group/llms.txt +15 -0
- package/dist/src/lib/rating/llms.txt +14 -0
- package/dist/src/lib/rich-text/llms.txt +16 -0
- package/dist/src/lib/scroll-top/llms.txt +15 -0
- package/dist/src/lib/select/llms.txt +22 -0
- package/dist/src/lib/sidenav/llms.txt +20 -0
- package/dist/src/lib/skeleton/llms.txt +14 -0
- package/dist/src/lib/slider/llms.txt +13 -0
- package/dist/src/lib/speed-dial/llms.txt +16 -0
- package/dist/src/lib/spinner/llms.txt +10 -0
- package/dist/src/lib/split-button/llms.txt +26 -0
- package/dist/src/lib/splitter/llms.txt +21 -0
- package/dist/src/lib/stepper/llms.txt +19 -0
- package/dist/src/lib/switch/llms.txt +13 -0
- package/dist/src/lib/tabs/llms.txt +19 -0
- package/dist/src/lib/textarea/llms.txt +14 -0
- package/dist/src/lib/timeline/llms.txt +22 -0
- package/dist/src/lib/toast/llms.txt +22 -0
- package/dist/src/lib/toolbar/llms.txt +23 -0
- package/dist/src/lib/tooltip/llms.txt +19 -0
- package/dist/src/lib/tree/llms.txt +17 -0
- package/dist/types/konce-pt-angular-icons.d.ts +18 -0
- package/dist/types/konce-pt-angular.d.ts +1858 -0
- package/package.json +61 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@konce-pt/angular",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Komponenty Koncept UI dla Angular 22 (sygnały, Signal Forms). Selektory kpt-*, klasy Kpt*.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "konce.pt",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"module": "fesm2022/konce-pt-angular.mjs",
|
|
12
|
+
"types": "./dist/types/konce-pt-angular.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./types/konce-pt-angular.d.ts",
|
|
16
|
+
"default": "./fesm2022/konce-pt-angular.mjs"
|
|
17
|
+
},
|
|
18
|
+
"./icons": {
|
|
19
|
+
"types": "./types/konce-pt-angular-icons.d.ts",
|
|
20
|
+
"default": "./fesm2022/konce-pt-angular-icons.mjs"
|
|
21
|
+
},
|
|
22
|
+
"./package.json": {
|
|
23
|
+
"default": "./package.json"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@angular/cdk": "^22.0.0",
|
|
28
|
+
"@angular/common": "^22.0.0",
|
|
29
|
+
"@angular/core": "^22.0.0",
|
|
30
|
+
"@angular/forms": "^22.0.0"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"tslib": "^2.3.0"
|
|
34
|
+
},
|
|
35
|
+
"nx": {
|
|
36
|
+
"targets": {
|
|
37
|
+
"build": {
|
|
38
|
+
"outputs": [
|
|
39
|
+
"{projectRoot}/dist"
|
|
40
|
+
],
|
|
41
|
+
"cache": true
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"typings": "types/konce-pt-angular.d.ts",
|
|
46
|
+
"type": "module"
|
|
47
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# KptAccordion (kpt-accordion) + KptAccordionPanel (kpt-accordion-panel)
|
|
2
|
+
|
|
3
|
+
Akordeon — grupa rozwijanych paneli.
|
|
4
|
+
Import: `import { KptAccordion, KptAccordionPanel } from '@konce-pt/angular';`
|
|
5
|
+
|
|
6
|
+
## KptAccordion
|
|
7
|
+
- `multi`: boolean — pozwala otworzyć wiele naraz (domyślnie: tylko jeden)
|
|
8
|
+
|
|
9
|
+
## KptAccordionPanel
|
|
10
|
+
- `title`: string (wymagane); `disabled`: boolean; `expanded`: model<boolean>
|
|
11
|
+
|
|
12
|
+
## Przykład
|
|
13
|
+
<kpt-accordion>
|
|
14
|
+
<kpt-accordion-panel title="Sekcja 1" [expanded]="true">…</kpt-accordion-panel>
|
|
15
|
+
<kpt-accordion-panel title="Sekcja 2">…</kpt-accordion-panel>
|
|
16
|
+
</kpt-accordion>
|
|
17
|
+
|
|
18
|
+
Koordynacja single/multi: panel woła rodzica przez inject(KptAccordion).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# KptAlert (kpt-alert)
|
|
2
|
+
|
|
3
|
+
Komunikat inline. Warianty info/success/warning/danger, tytuł, zamykanie.
|
|
4
|
+
Import: `import { KptAlert } from '@konce-pt/angular';`
|
|
5
|
+
|
|
6
|
+
## Selektor
|
|
7
|
+
`kpt-alert`
|
|
8
|
+
|
|
9
|
+
## Wejścia / wyjścia
|
|
10
|
+
- `variant`: 'info'|'success'|'warning'|'danger' (domyślnie 'info')
|
|
11
|
+
- `title`: string; `dismissible`: boolean (przycisk ×)
|
|
12
|
+
- `closed`: output<void>
|
|
13
|
+
|
|
14
|
+
## Przykład
|
|
15
|
+
<kpt-alert variant="success" title="Zapisano">Zmiany zapisane.</kpt-alert>
|
|
16
|
+
<kpt-alert variant="danger" dismissible (closed)="onClose()">Błąd.</kpt-alert>
|
|
17
|
+
|
|
18
|
+
## Tokeny
|
|
19
|
+
Akcent z `--kpt-color-{info,success,warning,danger}`; tło color-mix na `--kpt-color-surface`.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# KptAppShell (kpt-app-shell)
|
|
2
|
+
|
|
3
|
+
Szkielet aplikacji w stylu Material: toolbar u góry, panel boczny, treść.
|
|
4
|
+
Import: `import { KptAppShell } from '@konce-pt/angular';`
|
|
5
|
+
|
|
6
|
+
## Selektor
|
|
7
|
+
`kpt-app-shell`
|
|
8
|
+
|
|
9
|
+
## Wejścia / wyjścia
|
|
10
|
+
- `sidenavOpen`: model<boolean> (domyślnie true) — dwukierunkowe `[(sidenavOpen)]`
|
|
11
|
+
- `sidenavMode`: 'side' | 'over' (domyślnie 'side'); 'over' nakłada panel ze scrimem
|
|
12
|
+
|
|
13
|
+
## Sloty projekcji
|
|
14
|
+
- `[kptShellToolbar]` → pasek u góry
|
|
15
|
+
- `[kptShellSidenav]` → panel boczny
|
|
16
|
+
- treść domyślna → obszar główny
|
|
17
|
+
|
|
18
|
+
## Przykład
|
|
19
|
+
<kpt-app-shell [(sidenavOpen)]="navOpen" sidenavMode="side">
|
|
20
|
+
<kpt-toolbar kptShellToolbar>
|
|
21
|
+
<kpt-button variant="text" (click)="navOpen.set(!navOpen())">☰</kpt-button>
|
|
22
|
+
</kpt-toolbar>
|
|
23
|
+
<kpt-sidenav kptShellSidenav>…</kpt-sidenav>
|
|
24
|
+
<router-outlet />
|
|
25
|
+
</kpt-app-shell>
|
|
26
|
+
|
|
27
|
+
## Zachowanie
|
|
28
|
+
- 'side': zamknięty panel chowa się (ujemny margines) i rozpycha treść.
|
|
29
|
+
- 'over': panel absolutny z `translateX`, klik w scrim zamyka. Szerokość: `--kpt-sidenav-width`.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# KptAutocomplete (kpt-autocomplete)
|
|
2
|
+
|
|
3
|
+
Pole z podpowiedziami na CDK Overlay, Signal Forms. Wartość = wpisany tekst.
|
|
4
|
+
Wymaga `import '@angular/cdk/overlay-prebuilt.css';`
|
|
5
|
+
Import: `import { KptAutocomplete } from '@konce-pt/angular';`
|
|
6
|
+
|
|
7
|
+
## Wejścia
|
|
8
|
+
- `value`: model<string>; `options`: string[]; `placeholder`: string
|
|
9
|
+
- `disabled`/`invalid`/`touched`: boolean; `touch`: output
|
|
10
|
+
- Klawiatura: ↑/↓ nawigacja, Enter wybiera, Esc zamyka.
|
|
11
|
+
|
|
12
|
+
## Przykład
|
|
13
|
+
<kpt-autocomplete [formField]="f.city" [options]="cities" placeholder="Miasto…" />
|
|
14
|
+
|
|
15
|
+
## Tokeny
|
|
16
|
+
`--kpt-form-field-*`, panel `--kpt-color-surface-raised`.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# KptAvatar (kpt-avatar)
|
|
2
|
+
|
|
3
|
+
Awatar — obraz, inicjały (z `name`) lub ikona. Import: `import { KptAvatar } from '@konce-pt/angular';`
|
|
4
|
+
|
|
5
|
+
## Wejścia
|
|
6
|
+
- `src`: string|null (obraz); `name`: string (inicjały, do 2 liter); `icon`: string|null
|
|
7
|
+
- `size`: 'sm'|'md'|'lg'|'xl'; `shape`: 'circle'|'square'
|
|
8
|
+
|
|
9
|
+
## Przykłady
|
|
10
|
+
<kpt-avatar src="/u/anna.jpg" />
|
|
11
|
+
<kpt-avatar name="Anna Kowalska" size="lg" />
|
|
12
|
+
<kpt-avatar icon="user" shape="square" />
|
|
13
|
+
|
|
14
|
+
## Tokeny
|
|
15
|
+
`--kpt-color-muted`, `--kpt-color-on-muted`, `--kpt-radius-full`/`--kpt-radius-md`.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# KptAvatarGroup (kpt-avatar-group)
|
|
2
|
+
|
|
3
|
+
Grupa nakładających się awatarów z licznikiem „+N". Buduje na `kpt-avatar`.
|
|
4
|
+
Import: `import { KptAvatarGroup } from '@konce-pt/angular';`
|
|
5
|
+
|
|
6
|
+
## Wejścia
|
|
7
|
+
- `avatars`: KptAvatarItem[] — { name?, src?, icon? }
|
|
8
|
+
- `max`: number (domyślnie 4) — ile pokazać przed „+N"
|
|
9
|
+
- `size`: 'sm' | 'md' | 'lg' | 'xl'
|
|
10
|
+
|
|
11
|
+
## Przykład
|
|
12
|
+
<kpt-avatar-group [avatars]="team" [max]="4" />
|
|
13
|
+
|
|
14
|
+
## Tokeny
|
|
15
|
+
Nakładka z obwódką `--kpt-color-surface`; „+N" `--kpt-color-muted`.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# KptBadge (kpt-badge)
|
|
2
|
+
|
|
3
|
+
Znacznik — licznik lub kropka statusu; standalone lub nałożony na treść (`overlay`).
|
|
4
|
+
Import: `import { KptBadge } from '@konce-pt/angular';`
|
|
5
|
+
|
|
6
|
+
## Wejścia
|
|
7
|
+
- `value`: string|number|null; `variant`: 'neutral'|'primary'|'success'|'danger'|'warning'|'info'
|
|
8
|
+
- `dot`: boolean (kropka bez liczby); `overlay`: boolean (róg treści); `max`: number (domyślnie 99 → '99+')
|
|
9
|
+
|
|
10
|
+
## Przykłady
|
|
11
|
+
<kpt-badge [value]="3" variant="danger" />
|
|
12
|
+
<kpt-badge [value]="128" overlay><kpt-icon name="menu" /></kpt-badge>
|
|
13
|
+
<kpt-badge dot variant="success" overlay><kpt-avatar name="AK" /></kpt-badge>
|
|
14
|
+
|
|
15
|
+
## Tokeny
|
|
16
|
+
`--kpt-color-{primary,muted,success,danger,warning,info}`, obwódka overlay z `--kpt-color-surface`.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# KptBottomSheet (kpt-bottom-sheet)
|
|
2
|
+
|
|
3
|
+
Arkusz wysuwany z dołu ekranu. Sterowany sygnałem `open`, z uchwytem i backdrop.
|
|
4
|
+
Import: `import { KptBottomSheet } from '@konce-pt/angular';`
|
|
5
|
+
|
|
6
|
+
## Wejścia / model
|
|
7
|
+
- `open`: model<boolean> (dwukierunkowe)
|
|
8
|
+
- `header`: string; `closeOnBackdrop`: boolean
|
|
9
|
+
- Treść przez projekcję.
|
|
10
|
+
|
|
11
|
+
## Przykład
|
|
12
|
+
<kpt-button (click)="sheetOpen.set(true)">Udostępnij</kpt-button>
|
|
13
|
+
<kpt-bottom-sheet [(open)]="sheetOpen" header="Udostępnij">…</kpt-bottom-sheet>
|
|
14
|
+
|
|
15
|
+
## Tokeny
|
|
16
|
+
Panel `--kpt-color-surface-raised`, zaokrąglenie górne `--kpt-radius-lg`, `--kpt-elevation-4`.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# KptBreadcrumb (kpt-breadcrumb)
|
|
2
|
+
|
|
3
|
+
Ścieżka nawigacji. Import: `import { KptBreadcrumb, KptBreadcrumbItem } from '@konce-pt/angular';`
|
|
4
|
+
|
|
5
|
+
## Wejścia
|
|
6
|
+
- `items`: KptBreadcrumbItem[] `{ label: string; url?: string }` (element bez `url` lub ostatni = bieżąca strona)
|
|
7
|
+
|
|
8
|
+
## Przykład
|
|
9
|
+
<kpt-breadcrumb [items]="[{label:'Start',url:'/'},{label:'Ustawienia',url:'/s'},{label:'Profil'}]" />
|
|
10
|
+
|
|
11
|
+
## Tokeny
|
|
12
|
+
Separator ikoną `chevron-right`; linki `--kpt-color-on-surface-muted` → hover `--kpt-color-primary`.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# KptButton (kpt-button)
|
|
2
|
+
|
|
3
|
+
Przycisk Koncept UI. Renderuje natywny `<button>` (semantyka + submit formularza).
|
|
4
|
+
Standalone, OnPush, sygnały. Import: `import { KptButton } from '@konce-pt/angular';`
|
|
5
|
+
|
|
6
|
+
## Selektor
|
|
7
|
+
`kpt-button`
|
|
8
|
+
|
|
9
|
+
## Wejścia (input signals)
|
|
10
|
+
- `variant`: 'filled' | 'tonal' | 'outline' | 'text' | 'danger' (domyślnie 'filled')
|
|
11
|
+
- `size`: 'sm' | 'md' | 'lg' (domyślnie 'md')
|
|
12
|
+
- `type`: 'button' | 'submit' | 'reset' (domyślnie 'button')
|
|
13
|
+
- `disabled`: boolean (booleanAttribute)
|
|
14
|
+
- `loading`: boolean — spinner + blokada interakcji, ustawia aria-busy
|
|
15
|
+
- `fullWidth`: boolean — pełna szerokość kontenera
|
|
16
|
+
|
|
17
|
+
## Zdarzenia
|
|
18
|
+
Brak własnych — natywny `click` bąbelkuje z wewnętrznego `<button>`; wiąż `(click)` na `<kpt-button>`.
|
|
19
|
+
|
|
20
|
+
## Przykłady
|
|
21
|
+
<kpt-button (click)="save()">Zapisz</kpt-button>
|
|
22
|
+
<kpt-button variant="outline" size="sm">Anuluj</kpt-button>
|
|
23
|
+
<kpt-button variant="danger" [loading]="deleting()">Usuń</kpt-button>
|
|
24
|
+
<form (submit)="onSubmit()"><kpt-button type="submit">Wyślij</kpt-button></form>
|
|
25
|
+
|
|
26
|
+
## Tokeny (stylowanie)
|
|
27
|
+
`--kpt-button-radius`, `--kpt-button-font-weight`, `--kpt-button-gap`,
|
|
28
|
+
`--kpt-button-filled-{bg,fg,bg-hover,bg-active}`, `--kpt-button-tonal-{bg,fg,bg-hover}`,
|
|
29
|
+
`--kpt-button-outline-{border,fg,bg-hover}`, `--kpt-button-text-{fg,bg-hover}`.
|
|
30
|
+
Wariant 'danger' korzysta z `--kpt-color-danger` / `--kpt-color-on-danger`.
|
|
31
|
+
|
|
32
|
+
## Dostępność
|
|
33
|
+
- Natywny `<button>` — pełna obsługa klawiatury i czytników.
|
|
34
|
+
- `loading` ustawia `aria-busy="true"` i blokuje przycisk (`disabled`).
|
|
35
|
+
- Pierścień fokusa z `@konce-pt/styles` (`--kpt-color-focus-ring`).
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# KptButtonGroup (kpt-button-group)
|
|
2
|
+
|
|
3
|
+
Segmentowana grupa przycisków (toggle, pojedynczy wybór). Signal Forms.
|
|
4
|
+
Import: `import { KptButtonGroup, KptOption } from '@konce-pt/angular';`
|
|
5
|
+
|
|
6
|
+
## Wejścia
|
|
7
|
+
- `options`: KptOption<T>[]; `value`: model<T>; `size`: 'sm'|'md'|'lg'; `disabled`/`invalid`/`touched`; `touch`
|
|
8
|
+
|
|
9
|
+
## Przykłady
|
|
10
|
+
<kpt-button-group [(value)]="view" [options]="[{label:'Lista',value:'list'},{label:'Siatka',value:'grid'}]" />
|
|
11
|
+
<kpt-button-group [formField]="f.period" [options]="periods" />
|
|
12
|
+
|
|
13
|
+
## Tokeny
|
|
14
|
+
`--kpt-color-primary`, `--kpt-color-border-strong`, `--kpt-color-muted`.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# KptCard (kpt-card)
|
|
2
|
+
|
|
3
|
+
Karta — powierzchnia z wyniesieniem (elevated) lub obramowaniem (outlined).
|
|
4
|
+
Import: `import { KptCard } from '@konce-pt/angular';`
|
|
5
|
+
|
|
6
|
+
## Selektor
|
|
7
|
+
`kpt-card`
|
|
8
|
+
|
|
9
|
+
## Wejścia
|
|
10
|
+
- `variant`: 'elevated' | 'outlined' (domyślnie 'elevated')
|
|
11
|
+
- `header`: string — opcjonalny tekst nagłówka
|
|
12
|
+
|
|
13
|
+
## Projekcja
|
|
14
|
+
- treść domyślna → body karty
|
|
15
|
+
- element z atrybutem `kptCardFooter` (bezpośrednie dziecko `kpt-card`) → stopka
|
|
16
|
+
|
|
17
|
+
## Przykład
|
|
18
|
+
<kpt-card header="Ustawienia" variant="outlined">
|
|
19
|
+
<p>Treść…</p>
|
|
20
|
+
<div kptCardFooter><kpt-button>Zapisz</kpt-button></div>
|
|
21
|
+
</kpt-card>
|
|
22
|
+
|
|
23
|
+
## Tokeny
|
|
24
|
+
`--kpt-card-{bg,fg,border,radius,padding,shadow}`.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# KptCarousel (kpt-carousel)
|
|
2
|
+
|
|
3
|
+
Karuzela slajdów (generyczna). Import: `import { KptCarousel } from '@konce-pt/angular';`
|
|
4
|
+
Dane przez `items`, szablon slajdu przez projekcję `<ng-template let-item>`.
|
|
5
|
+
|
|
6
|
+
## Wejścia / model
|
|
7
|
+
- `items`: T[] — dane slajdów
|
|
8
|
+
- `activeIndex`: model<number> (domyślnie 0) — dwukierunkowy indeks aktywnego slajdu
|
|
9
|
+
|
|
10
|
+
## Projekcja
|
|
11
|
+
- `<ng-template let-item let-i="index">` — szablon pojedynczego slajdu; kontekst: `$implicit` = item, `index`.
|
|
12
|
+
|
|
13
|
+
## Metody
|
|
14
|
+
- `next()`, `prev()`, `goTo(index)`
|
|
15
|
+
|
|
16
|
+
## Przykład
|
|
17
|
+
<kpt-carousel [items]="photos">
|
|
18
|
+
<ng-template let-photo>
|
|
19
|
+
<img [src]="photo" style="width:100%" />
|
|
20
|
+
</ng-template>
|
|
21
|
+
</kpt-carousel>
|
|
22
|
+
|
|
23
|
+
## Tokeny
|
|
24
|
+
Nawigacja/kropki `--kpt-color-primary`; tło strzałek `--kpt-color-surface-raised`.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# KptCheckbox (kpt-checkbox)
|
|
2
|
+
|
|
3
|
+
Pole wyboru na Signal Forms (`FormCheckboxControl`, model `checked`).
|
|
4
|
+
Import: `import { KptCheckbox } from '@konce-pt/angular';`
|
|
5
|
+
|
|
6
|
+
## Użycie
|
|
7
|
+
<kpt-checkbox [formField]="f.terms" label="Akceptuję regulamin" />
|
|
8
|
+
|
|
9
|
+
## Wejścia
|
|
10
|
+
- `checked`: model<boolean> (kontrakt FormCheckboxControl)
|
|
11
|
+
- `label`: string
|
|
12
|
+
- `disabled` / `invalid` / `touched`: boolean (wiąże FormField); output `touch` (blur)
|
|
13
|
+
|
|
14
|
+
## Tokeny
|
|
15
|
+
`--kpt-color-primary`, `--kpt-color-on-primary`, `--kpt-form-field-border`, `--kpt-form-field-border-error`.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# KptChip (kpt-chip)
|
|
2
|
+
|
|
3
|
+
Chip / tag — etykieta, opcjonalnie usuwalna. Import: `import { KptChip } from '@konce-pt/angular';`
|
|
4
|
+
|
|
5
|
+
## Wejścia / wyjścia
|
|
6
|
+
- `variant`: 'neutral'|'primary'|'success'|'danger'|'warning'|'info'
|
|
7
|
+
- `removable`: boolean (przycisk ×); `disabled`: boolean; `removed`: output<void>
|
|
8
|
+
|
|
9
|
+
## Przykłady
|
|
10
|
+
<kpt-chip>Angular</kpt-chip>
|
|
11
|
+
<kpt-chip variant="success" removable (removed)="onRemove()">UI</kpt-chip>
|
|
12
|
+
|
|
13
|
+
## Tokeny
|
|
14
|
+
Tło color-mix na wariancie, `--kpt-color-muted` (neutral).
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# KptChipsInput (kpt-chips-input)
|
|
2
|
+
|
|
3
|
+
Pole tagów — dodawanie Enter/przecinkiem, usuwanie Backspace/×. Signal Forms.
|
|
4
|
+
Wartość = string[]. Renderuje elementy przez `kpt-chip`.
|
|
5
|
+
Import: `import { KptChipsInput } from '@konce-pt/angular';`
|
|
6
|
+
|
|
7
|
+
## Wejścia / model
|
|
8
|
+
- `value`: model<string[]> (lub `formField`)
|
|
9
|
+
- `placeholder`: string
|
|
10
|
+
- `allowDuplicates`: boolean (domyślnie false)
|
|
11
|
+
- `disabled`/`invalid`/`touched`: boolean; `touch`: output
|
|
12
|
+
|
|
13
|
+
## Przykład
|
|
14
|
+
<kpt-chips-input [formField]="f.tags" placeholder="Dodaj tag…" />
|
|
15
|
+
<kpt-chips-input [(value)]="tags" />
|
|
16
|
+
|
|
17
|
+
## Tokeny
|
|
18
|
+
Pole `--kpt-form-field-*`; tagi dziedziczą z `kpt-chip`.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# KptColorPicker (kpt-color-picker)
|
|
2
|
+
|
|
3
|
+
Wybór koloru (swatch + hex + presety) na Signal Forms. Wartość = hex, np. '#3b82f6'.
|
|
4
|
+
Import: `import { KptColorPicker } from '@konce-pt/angular';`
|
|
5
|
+
|
|
6
|
+
## Wejścia / model
|
|
7
|
+
- `value`: model<string> (lub `formField`) — kolor hex
|
|
8
|
+
- `presets`: string[] — paleta szybkiego wyboru (domyślnie 8 kolorów)
|
|
9
|
+
- `disabled`/`invalid`/`touched`: boolean; `touch`: output
|
|
10
|
+
|
|
11
|
+
## Przykład
|
|
12
|
+
<kpt-color-picker [formField]="f.brand" />
|
|
13
|
+
<kpt-color-picker [(value)]="color" [presets]="['#ef4444','#3b82f6']" />
|
|
14
|
+
|
|
15
|
+
color = signal('#3b82f6');
|
|
16
|
+
|
|
17
|
+
## Tokeny
|
|
18
|
+
Obramowanie `--kpt-form-field-border`; aktywny preset `--kpt-color-primary`.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# KptConfirm (KptConfirmService + kpt-confirm-container)
|
|
2
|
+
|
|
3
|
+
Serwis potwierdzeń oparty na `kpt-dialog`. Wzór jak `KptToastService`.
|
|
4
|
+
Import: `import { KptConfirmService, KptConfirmContainer } from '@konce-pt/angular';`
|
|
5
|
+
|
|
6
|
+
## Użycie
|
|
7
|
+
1. Umieść `<kpt-confirm-container />` raz w aplikacji (obok `<kpt-toast-container />`).
|
|
8
|
+
2. Wstrzyknij `KptConfirmService` i wywołaj `confirm(options)` → Promise<boolean>.
|
|
9
|
+
|
|
10
|
+
## KptConfirmOptions
|
|
11
|
+
- `message`: string (wymagane); `header?`: string
|
|
12
|
+
- `acceptLabel?`/`rejectLabel?`: string; `variant?`: 'filled' | 'danger'; `icon?`: string
|
|
13
|
+
|
|
14
|
+
## Przykład
|
|
15
|
+
const ok = await this.confirm.confirm({
|
|
16
|
+
message: 'Usunąć rekord?', variant: 'danger', acceptLabel: 'Usuń', icon: 'alert-triangle',
|
|
17
|
+
});
|
|
18
|
+
if (ok) { /* ... */ }
|
|
19
|
+
|
|
20
|
+
## Tokeny
|
|
21
|
+
Dziedziczy z `kpt-dialog`; ikona wg wariantu (`--kpt-color-danger` / `--kpt-color-primary`).
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# KptContextMenu (kpt-context-menu)
|
|
2
|
+
|
|
3
|
+
Menu kontekstowe (prawy przycisk myszy) na obszarze projekcji. Panel pozycjonowany do kursora.
|
|
4
|
+
Import: `import { KptContextMenu } from '@konce-pt/angular';`
|
|
5
|
+
|
|
6
|
+
## Wejścia / wyjścia
|
|
7
|
+
- `items`: KptMenuItem<T>[] — { label, icon?, danger?, disabled?, separator? }
|
|
8
|
+
- `select`: KptMenuItem<T> — wybór pozycji
|
|
9
|
+
- Obszar reagujący na PPM przez projekcję `<ng-content>`.
|
|
10
|
+
|
|
11
|
+
## Przykład
|
|
12
|
+
<kpt-context-menu [items]="items" (select)="onSelect($event)">
|
|
13
|
+
<div class="obszar">Kliknij prawym przyciskiem</div>
|
|
14
|
+
</kpt-context-menu>
|
|
15
|
+
|
|
16
|
+
## Tokeny
|
|
17
|
+
Panel `--kpt-color-surface-raised`, `--kpt-elevation-3`.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# KptDataTable (kpt-data-table)
|
|
2
|
+
|
|
3
|
+
Flagowa tabela danych (w duchu PrimeNG): kolumny konfiguracją, sortowanie, filtr globalny,
|
|
4
|
+
paginacja, zaznaczanie wierszy i własne szablony komórek. Sygnałowa, OnPush.
|
|
5
|
+
Import: `import { KptDataTable, KptColumn, KptCellDef } from '@konce-pt/angular';`
|
|
6
|
+
|
|
7
|
+
## Selektor
|
|
8
|
+
`kpt-data-table`
|
|
9
|
+
|
|
10
|
+
## Model kolumny (KptColumn)
|
|
11
|
+
`{ field: string; header: string; sortable?: boolean; align?: 'start'|'center'|'end'; width?: string; frozen?: boolean }`
|
|
12
|
+
Kolumny `frozen` (wiodące, sąsiadujące) przyklejają się przy poziomym przewijaniu — wymagają `width`.
|
|
13
|
+
|
|
14
|
+
## Wejścia
|
|
15
|
+
- `columns`: KptColumn[] (wymagane)
|
|
16
|
+
- `data`: T[] (domyślnie [])
|
|
17
|
+
- `filterable`: boolean — pole filtra globalnego
|
|
18
|
+
- `pageSize`: number — 0 wyłącza paginację
|
|
19
|
+
- `pageSizeOptions`: number[] (domyślnie [5,10,20,50])
|
|
20
|
+
- `selectable`: 'none' | 'single' | 'multiple'
|
|
21
|
+
- `loading`: boolean — wiersz „Ładowanie…"
|
|
22
|
+
- `emptyMessage`: string (domyślnie „Brak danych")
|
|
23
|
+
- `rowKey`: string | null — pole identyfikujące wiersz (dla zaznaczania); bez niego porównanie po referencji
|
|
24
|
+
- `reorderable`: boolean — przestawianie kolumn przeciągnij-i-upuść (natywny HTML5 DnD)
|
|
25
|
+
- `exportable`: boolean — przycisk „Eksport CSV" w toolbarze
|
|
26
|
+
- `exportFilename`: string (domyślnie 'export.csv')
|
|
27
|
+
- `lazy`: boolean — tryb serwerowy (bez filtr/sort/paginacji po stronie klienta)
|
|
28
|
+
- `totalRecords`: number | null — łączna liczba rekordów (wymagane przy lazy)
|
|
29
|
+
- `scrollHeight`: string | null — wysokość przewijalnego obszaru (np. '400px'); sticky header pozostaje
|
|
30
|
+
- `virtualScroll`: boolean — wirtualizacja wierszy (renderuje tylko widoczne); wymaga `scrollHeight`
|
|
31
|
+
- `rowHeight`: number — stała wysokość wiersza w px (domyślnie 41), potrzebna przy virtualScroll
|
|
32
|
+
|
|
33
|
+
## Model / zdarzenia
|
|
34
|
+
- `selection`: model<T[]> — dwukierunkowe `[(selection)]`
|
|
35
|
+
- `rowClick`: output<T>
|
|
36
|
+
- `lazyLoad`: output<KptTableLazyState> — { pageIndex, pageSize, sortField, sortDir, filter }; emitowane w trybie lazy przy każdej zmianie stanu
|
|
37
|
+
|
|
38
|
+
## Eksport / metody
|
|
39
|
+
- `exportCsv()`: publiczna metoda — eksportuje bieżące (filtr+sort) dane do CSV (separator `;`, BOM dla Excela).
|
|
40
|
+
|
|
41
|
+
## Własne szablony komórek (dyrektywa kptCell)
|
|
42
|
+
Kontekst: `$implicit` = wiersz, `value` = wartość pola.
|
|
43
|
+
|
|
44
|
+
<kpt-data-table [columns]="cols" [data]="rows" filterable [pageSize]="10"
|
|
45
|
+
selectable="multiple" rowKey="id" [(selection)]="picked">
|
|
46
|
+
<ng-template kptCell="status" let-row let-value="value">
|
|
47
|
+
<span class="badge">{{ value }}</span>
|
|
48
|
+
</ng-template>
|
|
49
|
+
</kpt-data-table>
|
|
50
|
+
|
|
51
|
+
## Zachowanie
|
|
52
|
+
- Sortowanie: klik w nagłówek sortowalnej kolumny cyklicznie asc → desc → brak.
|
|
53
|
+
- Filtr: dopasowanie tekstu we wszystkich polach kolumn; reset strony do 0.
|
|
54
|
+
- Zaznaczanie 'multiple': nagłówkowy checkbox zaznacza/odznacza bieżącą stronę.
|
|
55
|
+
- Sticky header, stany pusty/ładowanie, wyrównanie i szerokości per kolumna.
|
|
56
|
+
|
|
57
|
+
## Tokeny
|
|
58
|
+
`--kpt-table-{bg,fg,border,radius,header-bg,header-fg,row-hover,row-selected,cell-padding}`.
|
|
59
|
+
Paginacja: komponent `kpt-paginator`.
|
|
60
|
+
|
|
61
|
+
## Do zrobienia (roadmap)
|
|
62
|
+
Kolumny grupowane, edycja komórek inline, wiersze rozwijane.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# KptDataView (kpt-data-view)
|
|
2
|
+
|
|
3
|
+
Prezentacja listy elementów w układzie lista/siatka, z opcjonalną paginacją (reuse `kpt-paginator`).
|
|
4
|
+
Szablon elementu przez projekcję `<ng-template let-item>`.
|
|
5
|
+
Import: `import { KptDataView } from '@konce-pt/angular';`
|
|
6
|
+
|
|
7
|
+
## Wejścia / model
|
|
8
|
+
- `items`: T[]
|
|
9
|
+
- `layout`: model<'list' | 'grid'> (przełącznik w pasku)
|
|
10
|
+
- `pageSize`: number (0 = bez paginacji); `paginated`: boolean
|
|
11
|
+
|
|
12
|
+
## Przykład
|
|
13
|
+
<kpt-data-view [items]="products" [pageSize]="6">
|
|
14
|
+
<ng-template let-p><div>{{ p.name }}</div></ng-template>
|
|
15
|
+
</kpt-data-view>
|
|
16
|
+
|
|
17
|
+
## Tokeny
|
|
18
|
+
Karty elementów `--kpt-color-surface-raised`; przełącznik `--kpt-color-primary`.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# KptDateRange (kpt-date-range)
|
|
2
|
+
|
|
3
|
+
Wybór zakresu dat z kalendarzem (CDK Overlay) na Signal Forms.
|
|
4
|
+
Wartość: `{ start: 'RRRR-MM-DD', end: 'RRRR-MM-DD' }` (KptDateRangeValue).
|
|
5
|
+
Import: `import { KptDateRange, KptDateRangeValue } from '@konce-pt/angular';`
|
|
6
|
+
Wymaga `import '@angular/cdk/overlay-prebuilt.css';`
|
|
7
|
+
|
|
8
|
+
## Wejścia / model
|
|
9
|
+
- `value`: model<KptDateRangeValue> (lub `formField`)
|
|
10
|
+
- `placeholder`: string (domyślnie 'Wybierz zakres')
|
|
11
|
+
- `disabled`/`invalid`/`touched`: boolean; `touch`: output
|
|
12
|
+
|
|
13
|
+
## Zachowanie
|
|
14
|
+
Pierwszy klik ustawia `start`, drugi `end` (kolejność jest normalizowana). Zakres podświetlany;
|
|
15
|
+
przycisk „×" czyści wartość.
|
|
16
|
+
|
|
17
|
+
## Przykład
|
|
18
|
+
<kpt-date-range [formField]="f.period" />
|
|
19
|
+
<kpt-date-range [(value)]="period" />
|
|
20
|
+
|
|
21
|
+
period = signal<KptDateRangeValue>({ start: '', end: '' });
|
|
22
|
+
|
|
23
|
+
## Tokeny
|
|
24
|
+
Pole `--kpt-form-field-*`; kalendarz `--kpt-color-surface-raised`, zakres `--kpt-color-primary`.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# KptDatepicker (kpt-datepicker)
|
|
2
|
+
|
|
3
|
+
Wybór daty z własnym kalendarzem (CDK Overlay), Signal Forms. Wartość ISO 'RRRR-MM-DD',
|
|
4
|
+
wyświetlana jako 'DD.MM.RRRR'. Tydzień od poniedziałku, dziś zaznaczone, zakres min/max.
|
|
5
|
+
Wymaga stylów overlay CDK: `import '@angular/cdk/overlay-prebuilt.css';`
|
|
6
|
+
Import: `import { KptDatepicker } from '@konce-pt/angular';`
|
|
7
|
+
|
|
8
|
+
## Użycie
|
|
9
|
+
<kpt-datepicker [formField]="f.birthDate" minDate="1900-01-01" maxDate="2030-12-31" />
|
|
10
|
+
|
|
11
|
+
## Wejścia
|
|
12
|
+
- `value`: model<string> (ISO); `minDate`/`maxDate`: string|null; `placeholder`: string
|
|
13
|
+
- `disabled`/`invalid`/`touched`: boolean; output `touch`.
|
|
14
|
+
- Panel: nawigacja miesięcy (‹ ›), przycisk czyszczenia (×).
|
|
15
|
+
|
|
16
|
+
## Tokeny
|
|
17
|
+
`--kpt-form-field-{bg,text,border,border-focus,border-error,radius}`.
|
|
@@ -0,0 +1,27 @@
|
|
|
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).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# KptDivider (kpt-divider)
|
|
2
|
+
|
|
3
|
+
Separator (linia pozioma lub pionowa). `role="separator"`.
|
|
4
|
+
Import: `import { KptDivider } from '@konce-pt/angular';`
|
|
5
|
+
|
|
6
|
+
## Selektor
|
|
7
|
+
`kpt-divider`
|
|
8
|
+
|
|
9
|
+
## Wejścia
|
|
10
|
+
- `orientation`: 'horizontal' | 'vertical' (domyślnie 'horizontal')
|
|
11
|
+
- `inset`: boolean — odstęp od krawędzi kontenera
|
|
12
|
+
|
|
13
|
+
## Przykład
|
|
14
|
+
<kpt-divider />
|
|
15
|
+
<kpt-divider inset />
|
|
16
|
+
<kpt-divider orientation="vertical" /> <!-- w kontenerze flex -->
|
|
17
|
+
|
|
18
|
+
## Tokeny
|
|
19
|
+
Kolor z `--kpt-color-border`. Pionowy wymaga rodzica flex (align-self: stretch).
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# KptDrawer (kpt-drawer)
|
|
2
|
+
|
|
3
|
+
Panel wysuwany (drawer / off-canvas) sterowany sygnałem `open`. Niezależny od app-shell
|
|
4
|
+
(pozycja fixed + backdrop, animacja transform). Import: `import { KptDrawer } from '@konce-pt/angular';`
|
|
5
|
+
|
|
6
|
+
## Wejścia / model
|
|
7
|
+
- `open`: model<boolean> (dwukierunkowe)
|
|
8
|
+
- `position`: 'left' | 'right' | 'top' | 'bottom' (KptDrawerPosition)
|
|
9
|
+
- `header`: string; `dismissible`: boolean (× i Esc); `closeOnBackdrop`: boolean
|
|
10
|
+
- Treść przez projekcję `<ng-content>`.
|
|
11
|
+
|
|
12
|
+
## Przykład
|
|
13
|
+
<kpt-button (click)="menuOpen.set(true)">Menu</kpt-button>
|
|
14
|
+
<kpt-drawer [(open)]="menuOpen" position="right" header="Filtry">…</kpt-drawer>
|
|
15
|
+
|
|
16
|
+
## Tokeny
|
|
17
|
+
Panel `--kpt-color-surface-raised`, `--kpt-elevation-4`; backdrop półprzezroczysty.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# KptEmpty (kpt-empty)
|
|
2
|
+
|
|
3
|
+
Stan pusty (empty state) — ikona, tytuł, opis i opcjonalne akcje (projekcja).
|
|
4
|
+
Import: `import { KptEmpty } from '@konce-pt/angular';`
|
|
5
|
+
|
|
6
|
+
## Wejścia
|
|
7
|
+
- `icon`: string | null (domyślnie 'info-circle')
|
|
8
|
+
- `title`: string; `description`: string
|
|
9
|
+
- Akcje: `<ng-content>` (np. przyciski).
|
|
10
|
+
|
|
11
|
+
## Przykład
|
|
12
|
+
<kpt-empty icon="search" title="Brak wyników" description="Zmień kryteria.">
|
|
13
|
+
<kpt-button>Wyczyść filtry</kpt-button>
|
|
14
|
+
</kpt-empty>
|
|
15
|
+
|
|
16
|
+
## Tokeny
|
|
17
|
+
Ikona w kółku `--kpt-color-muted`; tekst `--kpt-color-on-surface(-muted)`.
|