@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.
Files changed (87) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/charts/src/lib/llms.txt +30 -30
  3. package/fesm2022/konce-pt-angular.mjs +1403 -368
  4. package/fesm2022/konce-pt-angular.mjs.map +1 -1
  5. package/grid/src/lib/llms.txt +48 -48
  6. package/map/src/lib/llms.txt +446 -446
  7. package/package.json +1 -1
  8. package/roadmap/src/lib/llms.txt +74 -74
  9. package/src/lib/accordion/llms.txt +9 -9
  10. package/src/lib/alert/llms.txt +10 -10
  11. package/src/lib/app-shell/llms.txt +59 -59
  12. package/src/lib/auth/llms.txt +104 -0
  13. package/src/lib/autocomplete/llms.txt +8 -8
  14. package/src/lib/avatar/llms.txt +9 -9
  15. package/src/lib/avatar-group/llms.txt +8 -8
  16. package/src/lib/badge/llms.txt +9 -9
  17. package/src/lib/bottom-sheet/llms.txt +14 -14
  18. package/src/lib/breadcrumb/llms.txt +7 -7
  19. package/src/lib/breakpoint/llms.txt +21 -21
  20. package/src/lib/button/llms.txt +34 -34
  21. package/src/lib/button-group/llms.txt +5 -5
  22. package/src/lib/card/llms.txt +27 -27
  23. package/src/lib/carousel/llms.txt +11 -11
  24. package/src/lib/checkbox/llms.txt +7 -7
  25. package/src/lib/chip/llms.txt +6 -6
  26. package/src/lib/chips-input/llms.txt +9 -9
  27. package/src/lib/color-picker/llms.txt +7 -7
  28. package/src/lib/confirm/llms.txt +11 -11
  29. package/src/lib/context-menu/llms.txt +10 -10
  30. package/src/lib/data-table/llms.txt +170 -170
  31. package/src/lib/data-view/llms.txt +8 -8
  32. package/src/lib/date-range/llms.txt +25 -25
  33. package/src/lib/datepicker/llms.txt +48 -48
  34. package/src/lib/dialog/llms.txt +62 -62
  35. package/src/lib/divider/llms.txt +9 -9
  36. package/src/lib/drawer/llms.txt +18 -18
  37. package/src/lib/empty/llms.txt +9 -9
  38. package/src/lib/fab/llms.txt +12 -12
  39. package/src/lib/fieldset/llms.txt +9 -9
  40. package/src/lib/file-upload/llms.txt +10 -10
  41. package/src/lib/form-field/llms.txt +45 -45
  42. package/src/lib/galleria/llms.txt +7 -7
  43. package/src/lib/i18n/llms.txt +21 -21
  44. package/src/lib/icon/llms.txt +20 -20
  45. package/src/lib/icon-button/llms.txt +8 -8
  46. package/src/lib/image/llms.txt +9 -9
  47. package/src/lib/input/llms.txt +27 -25
  48. package/src/lib/input-mask/llms.txt +10 -10
  49. package/src/lib/input-number/llms.txt +34 -34
  50. package/src/lib/input-otp/llms.txt +11 -11
  51. package/src/lib/knob/llms.txt +14 -14
  52. package/src/lib/listbox/llms.txt +8 -8
  53. package/src/lib/megamenu/llms.txt +13 -13
  54. package/src/lib/menu/llms.txt +26 -26
  55. package/src/lib/menubar/llms.txt +10 -10
  56. package/src/lib/meter-group/llms.txt +8 -8
  57. package/src/lib/order-list/llms.txt +8 -8
  58. package/src/lib/paginator/llms.txt +12 -12
  59. package/src/lib/panel/llms.txt +12 -12
  60. package/src/lib/password/llms.txt +12 -9
  61. package/src/lib/pick-list/llms.txt +8 -8
  62. package/src/lib/popover/llms.txt +8 -8
  63. package/src/lib/progress/llms.txt +6 -6
  64. package/src/lib/radio-group/llms.txt +5 -5
  65. package/src/lib/rating/llms.txt +6 -6
  66. package/src/lib/rich-text/llms.txt +51 -32
  67. package/src/lib/scroll-top/llms.txt +7 -7
  68. package/src/lib/select/llms.txt +26 -26
  69. package/src/lib/sidenav/llms.txt +24 -24
  70. package/src/lib/skeleton/llms.txt +6 -6
  71. package/src/lib/slider/llms.txt +17 -17
  72. package/src/lib/speed-dial/llms.txt +7 -7
  73. package/src/lib/spinner/llms.txt +5 -5
  74. package/src/lib/split-button/llms.txt +15 -15
  75. package/src/lib/splitter/llms.txt +11 -11
  76. package/src/lib/stepper/llms.txt +10 -10
  77. package/src/lib/switch/llms.txt +10 -10
  78. package/src/lib/switch-group/llms.txt +16 -16
  79. package/src/lib/tabs/llms.txt +10 -10
  80. package/src/lib/textarea/llms.txt +5 -5
  81. package/src/lib/timeline/llms.txt +10 -10
  82. package/src/lib/toast/llms.txt +10 -10
  83. package/src/lib/toolbar/llms.txt +31 -31
  84. package/src/lib/tooltip/llms.txt +21 -21
  85. package/src/lib/tree/llms.txt +6 -6
  86. package/types/konce-pt-angular.d.ts +316 -7
  87. package/types/konce-pt-angular.d.ts.map +1 -1
@@ -1,91 +1,91 @@
1
1
  # KptDataTable (kpt-data-table)
2
2
 
3
- Flagowa tabela danych: kolumny konfiguracją, sortowanie, filtr globalny,
4
- paginacja, zaznaczanie wierszy i własne szablony komórek. Sygnałowa, OnPush.
3
+ The flagship data table: columns from configuration, sorting, a global filter,
4
+ pagination, row selection and custom cell templates. Signal-based, OnPush.
5
5
  Import: `import { KptDataTable, KptColumn, KptCellDef, KptCellEditDef, KptRowDetailDef } from '@konce-pt/angular';`
6
6
 
7
- ## Selektor
7
+ ## Selector
8
8
  `kpt-data-table`
9
9
 
10
- ## Model kolumny (KptColumn)
10
+ ## The column model (KptColumn)
11
11
  `{ field: string; header: string; sortable?: boolean; align?: 'start'|'center'|'end'; width?: string; frozen?: boolean; filter?: KptColumnFilter; edit?: KptColumnEdit; summary?: KptColumnSummary }`
12
- Kolumny `frozen` (wiodące, sąsiadujące) przyklejają się przy poziomym przewijaniu — wymagają `width`.
12
+ `frozen` columns (leading, adjacent) stick during horizontal scrolling — they require `width`.
13
13
 
14
- ### Filtr kolumny (KptColumnFilter)
14
+ ### The column filter (KptColumnFilter)
15
15
  `{ type: 'text'|'number'|'select'|'dateRange'|'numberRange'|'slider'; options?: KptOption[]; multiple?: boolean; placeholder?: string; min?: number; max?: number; step?: number }`
16
- Gdy którakolwiek kolumna ma `filter`, w nagłówku renderuje się wiersz filtrów:
17
- - `text` — input tekstowy (dopasowanie „zawiera"), `number` — input tylko cyfry (dopasowanie po cyfrach),
18
- - `select` — lista wyboru (z `multiple` = wiele; dopasowanie OR). Gdy wartość pola jest **tablicą** (np. lista tagów/członków), dopasowuje, gdy tablica zawiera dowolną z wybranych wartości,
19
- - `numberRange` — dwa pola (min–max); dopasowuje, gdy liczbowa wartość pola mieści się w zakresie (puste ograniczenie = otwarte),
20
- - `slider` — suwak zakresu (dwa uchwyty; `min`/`max`/`step`); wartość filtra to `[lo, hi]`, dopasowuje liczbę w `[lo, hi]`,
21
- - `dateRange` — zakres dat (pole ISO/Date w `[start,end]`).
22
- Filtry kolumn łączą się AND ze sobą i z filtrem globalnym; zmiana resetuje stronę.
23
- Filtry działają na **surowej wartości pola** (`row[field]`), niezależnie od własnego szablonu `kptCell` — można filtrować także kolumny z custom cell (np. status-badge).
24
- Filtry `select`/`dateRange` wymagają `import '@angular/cdk/overlay-prebuilt.css';`.
25
-
26
- ### Edycja kolumny (KptColumnEdit)
16
+ As soon as any column has a `filter`, a filter row is rendered in the header:
17
+ - `text` — a text input ("contains" matching), `number` — a digits-only input (matching on digits),
18
+ - `select` — a selection list (with `multiple` = many; OR matching). When the field's value is an **array** (a list of tags or members, say), it matches when the array contains any of the selected values,
19
+ - `numberRange` — two fields (min–max); it matches when the field's numeric value falls inside the range (an empty bound = open),
20
+ - `slider` — a range slider (two handles; `min`/`max`/`step`); the filter value is `[lo, hi]`, matching a number inside `[lo, hi]`,
21
+ - `dateRange` — a date range (an ISO/Date field within `[start,end]`).
22
+ Column filters combine with AND, both with each other and with the global filter; a change resets the page.
23
+ Filters work on the **raw field value** (`row[field]`), regardless of any custom `kptCell` template — so columns with a custom cell (a status badge, for instance) can be filtered too.
24
+ The `select`/`dateRange` filters require `import '@angular/cdk/overlay-prebuilt.css';`.
25
+
26
+ ### Column editing (KptColumnEdit)
27
27
  `{ type: 'text'|'number'|'date'|'select'|'multiselect'; options?: KptOption[]; placeholder?: string; min?: number; max?: number; step?: number }`
28
- Gdy kolumna ma `edit`, jej komórki są klikalne — klik (albo Enter na sfokusowanej komórce) zamienia
29
- wartość na kontrolkę: `text` → `kpt-input`, `number` → `kpt-input-number`, `date` → `kpt-datepicker`,
30
- `select` → `kpt-select`, `multiselect` → `kpt-select multiple filter`. Patrz sekcja „Edycja inline” niżej.
28
+ When a column has `edit`, its cells become clickable — a click (or Enter on a focused cell) swaps
29
+ the value for a control: `text` → `kpt-input`, `number` → `kpt-input-number`, `date` → `kpt-datepicker`,
30
+ `select` → `kpt-select`, `multiselect` → `kpt-select multiple filter`. See the "Inline editing" section below.
31
31
 
32
- ### Podsumowanie kolumny (KptColumnSummary)
32
+ ### The column summary (KptColumnSummary)
33
33
  `{ fn: 'sum'|'avg'|'min'|'max'|'count' | ((rows) => unknown); format?: (value) => string }`
34
- Kolumna z `summary` jest agregowana w wierszu podsumowania — patrz sekcja „Wiersz podsumowania” niżej.
35
-
36
- ## Wejścia
37
- - `columns`: KptColumn[] (wymagane)
38
- - `data`: T[] (domyślnie [])
39
- - `filterable`: boolean — pole filtra globalnego
40
- - `filterRowPosition`: 'top' | 'bottom' (domyślnie 'bottom') — wiersz filtrów kolumn nad/pod etykietami
41
- - `pageSize`: number — 0 wyłącza paginację
42
- - `pageSizeOptions`: number[] (domyślnie [5,10,20,50])
34
+ A column with `summary` is aggregated in the summary row — see the "Summary row" section below.
35
+
36
+ ## Inputs
37
+ - `columns`: KptColumn[] (required)
38
+ - `data`: T[] (default [])
39
+ - `filterable`: boolean — the global filter field
40
+ - `filterRowPosition`: 'top' | 'bottom' (default 'bottom') — the column filter row above/below the labels
41
+ - `pageSize`: number — 0 disables pagination
42
+ - `pageSizeOptions`: number[] (default [5,10,20,50])
43
43
  - `selectable`: 'none' | 'single' | 'multiple'
44
- - `loading`: boolean — wiersz „Ładowanie…"
45
- - `emptyMessage`: string — bez wartości używa i18n (`dataTable.empty`); input ma priorytet
46
- - `rowKey`: string | null — pole identyfikujące wiersz (dla zaznaczania); bez niego porównanie po referencji
47
- - `reorderable`: boolean — przestawianie kolumn przeciągnij-i-upuść (natywny HTML5 DnD); kolumny `frozen` są wyłączone z przenoszenia (pozostają wiodące) i nie można upuszczać innych kolumn przed nie
48
- - `exportable`: boolean — przycisk „Eksport CSV" w toolbarze
49
- - `exportFilename`: string (domyślnie 'export.csv')
50
- - `lazy`: boolean — tryb serwerowy (bez filtr/sort/paginacji po stronie klienta)
51
- - `totalRecords`: number | null — łączna liczba rekordów (wymagane przy lazy)
52
- - `scrollHeight`: string | null — wysokość przewijalnego obszaru (np. '400px'); sticky header pozostaje
53
- - `virtualScroll`: boolean — wirtualizacja wierszy (renderuje tylko widoczne); wymaga `scrollHeight`
54
- - `rowHeight`: number — stała wysokość wiersza w px (domyślnie 41), potrzebna przy virtualScroll
55
- - `expandable`: boolean — kolumna z przełącznikiem rozwijającym wiersz (renderuje szablon `kptRowDetail`)
56
- - `multiExpand`: boolean (domyślnie true) — pozwala rozwinąć wiele wierszy naraz; false = tylko jeden
57
- - `summaryLabel`: string — etykieta wiersza podsumowania; bez wartości używa i18n (`dataTable.total`)
58
- - `summaryValues`: Record<string, unknown> | null — gotowe wartości podsumowania (pole → wartość);
59
- nadpisują wyliczenia, przy `lazy` są jedynym źródłem
60
-
61
- ## Model / zdarzenia
62
- - `selection`: model<T[]> — dwukierunkowe `[(selection)]`
63
- - `expandedRows`: model<T[]> — dwukierunkowe `[(expandedRows)]` (rozwinięte wiersze)
64
- - `hiddenFields`: model<readonly string[]> — dwukierunkowe `[(hiddenFields)]`; zbiór `KptColumn.field`
65
- aktualnie ukrytych. Komponent sam nie dostarcza UI do zarządzania tym stanem (bez przycisku,
66
- bez dialogu, bez persystencji) — to celowo minimalny hak do podpięcia zewnętrznego przełącznika
67
- kolumn. Przykład gotowego UI (przycisk + dialog z checkboxami + zapis w localStorage), zbudowany
68
- z `kpt-dialog`/`kpt-checkbox`/`kpt-button`, jest w playground jako `pg-column-toggle`
69
- (`apps/playground/src/pg-column-toggle.component.ts`) — nie jest eksportowany z biblioteki.
70
- Ukrycie kolumny nie wyłącza jej z globalnego wyszukiwania ani z filtrów per-kolumna — tylko
71
- z widoku (i z eksportu CSV, patrz niżej). Kolejność zapamiętana przez `reorderable` przetrwa
72
- ukrycie/pokazanie kolumny. Do umieszczenia kompaktowej (ikonowej) wersji takiego przycisku
73
- obok paginatora służy slot projekcji `[kptPaginatorActions]` — patrz sekcja „Wiersz
74
- paginatora” niżej.
44
+ - `loading`: boolean — a "Loading…" row
45
+ - `emptyMessage`: string — with no value it uses i18n (`dataTable.empty`); the input takes priority
46
+ - `rowKey`: string | null — the field identifying a row (for selection); without it rows are compared by reference
47
+ - `reorderable`: boolean — drag-and-drop column reordering (native HTML5 DnD); `frozen` columns are excluded from moving (they stay leading) and no other column can be dropped in front of them
48
+ - `exportable`: boolean — an "Export CSV" button in the toolbar
49
+ - `exportFilename`: string (default 'export.csv')
50
+ - `lazy`: boolean — server-side mode (no client-side filtering/sorting/pagination)
51
+ - `totalRecords`: number | null — the total record count (required with lazy)
52
+ - `scrollHeight`: string | null — the height of the scrollable area (e.g. '400px'); the sticky header stays
53
+ - `virtualScroll`: boolean — row virtualization (only visible rows are rendered); requires `scrollHeight`
54
+ - `rowHeight`: number — a fixed row height in px (default 41), needed with virtualScroll
55
+ - `expandable`: boolean — a column with a toggle that expands the row (rendering the `kptRowDetail` template)
56
+ - `multiExpand`: boolean (default true) — allows several rows open at once; false = only one
57
+ - `summaryLabel`: string — the summary row's label; with no value it uses i18n (`dataTable.total`)
58
+ - `summaryValues`: Record<string, unknown> | null — ready-made summary values (field → value);
59
+ they override the computed ones, and with `lazy` they are the only source
60
+
61
+ ## Model / events
62
+ - `selection`: model<T[]> — two-way `[(selection)]`
63
+ - `expandedRows`: model<T[]> — two-way `[(expandedRows)]` (the expanded rows)
64
+ - `hiddenFields`: model<readonly string[]> — two-way `[(hiddenFields)]`; the set of `KptColumn.field`
65
+ values currently hidden. The component provides no UI for managing that state itself (no button,
66
+ no dialog, no persistence) — it is a deliberately minimal hook for wiring up an external column
67
+ switcher. An example of a finished UI (a button + a dialog with checkboxes + localStorage persistence), built
68
+ from `kpt-dialog`/`kpt-checkbox`/`kpt-button`, lives in the playground as `pg-column-toggle`
69
+ (`apps/playground/src/pg-column-toggle.component.ts`) — it is not exported from the library.
70
+ Hiding a column does not take it out of the global search or the per-column filters — only
71
+ out of the view (and out of the CSV export, see below). The order remembered by `reorderable` survives
72
+ hiding and showing a column. To place a compact (icon) version of such a button
73
+ next to the paginator there is the `[kptPaginatorActions]` projection slot — see the "The paginator
74
+ row" section below.
75
75
  - `rowClick`: output<T>
76
- - `lazyLoad`: output<KptTableLazyState> — { pageIndex, pageSize, sortField, sortDir, filter, columnFilters }; emitowane w trybie lazy przy każdej zmianie stanu
77
- - `cellEdit`: output<KptCellEditEvent<T>> — `{ row, field, value, updatedRow }`; emitowane po
78
- zatwierdzeniu edycji komórki (patrz „Edycja inline” niżej), tylko gdy wartość faktycznie się
79
- zmieniła. Tabela sama niczego nie zapisuje (brak HTTP, brak stanu ładowania/błędu) — `updatedRow`
80
- to gotowe body żądania, resztą (zapis, optymistyczna aktualizacja, rollback przy błędzie) zajmuje
81
- się konsument, dokładnie jak przy `lazyLoad`.
76
+ - `lazyLoad`: output<KptTableLazyState> — { pageIndex, pageSize, sortField, sortDir, filter, columnFilters }; emitted in lazy mode on every state change
77
+ - `cellEdit`: output<KptCellEditEvent<T>> — `{ row, field, value, updatedRow }`; emitted once a cell
78
+ edit is committed (see "Inline editing" below), and only when the value actually
79
+ changed. The table saves nothing itself (no HTTP, no loading/error state) — `updatedRow`
80
+ is a ready request body, and the rest (saving, an optimistic update, a rollback on error) is handled
81
+ by the consumer, exactly as with `lazyLoad`.
82
82
 
83
- ## Eksport / metody
84
- - `exportCsv()`: publiczna metoda — eksportuje bieżące (filtr+sort) dane do CSV (separator `;`, BOM dla
85
- Excela). Eksportuje tylko aktualnie **widoczne** kolumny (bez tych w `hiddenFields`).
83
+ ## Export / methods
84
+ - `exportCsv()`: a public method — exports the current (filtered+sorted) data to CSV (the `;` separator, a BOM for
85
+ Excel). It exports only the currently **visible** columns (those in `hiddenFields` are left out).
86
86
 
87
- ## Własne szablony komórek (dyrektywa kptCell)
88
- Kontekst: `$implicit` = wiersz, `value` = wartość pola.
87
+ ## Custom cell templates (the kptCell directive)
88
+ Context: `$implicit` = the row, `value` = the field's value.
89
89
 
90
90
  <kpt-data-table [columns]="cols" [data]="rows" filterable [pageSize]="10"
91
91
  selectable="multiple" rowKey="id" [(selection)]="picked">
@@ -94,48 +94,48 @@ Kontekst: `$implicit` = wiersz, `value` = wartość pola.
94
94
  </ng-template>
95
95
  </kpt-data-table>
96
96
 
97
- ## Rozwijane wiersze (dyrektywa kptRowDetail)
98
- Włącz `expandable` i podaj szablon `kptRowDetail` (kontekst: `$implicit` = wiersz).
99
- Dodaje wiodącą kolumnę z przełącznikiem; rozwinięty wiersz renderuje szablon w pełnej szerokości pod wierszem.
100
- Stan przez `[(expandedRows)]`; `multiExpand=false` ogranicza do jednego otwartego naraz.
101
- Niezależne od `selectable` (można łączyć z zaznaczaniem). Nieaktywne przy `virtualScroll`.
97
+ ## Expandable rows (the kptRowDetail directive)
98
+ Turn on `expandable` and supply a `kptRowDetail` template (context: `$implicit` = the row).
99
+ It adds a leading column with a toggle; an expanded row renders the template at full width below the row.
100
+ The state goes through `[(expandedRows)]`; `multiExpand=false` limits it to one open at a time.
101
+ Independent of `selectable` (it can be combined with selection). Not available with `virtualScroll`.
102
102
 
103
103
  <kpt-data-table [columns]="cols" [data]="rows" expandable rowKey="id" [(expandedRows)]="open">
104
104
  <ng-template kptRowDetail let-row>
105
- <div class="detale">{{ row.opis }}</div>
105
+ <div class="details">{{ row.description }}</div>
106
106
  </ng-template>
107
107
  </kpt-data-table>
108
108
 
109
- ## Edycja inline (column.edit / kptCellEdit)
110
- Klik w komórkę edytowalnej kolumny (albo Enter, gdy komórka ma fokus — jest wtedy `tabindex="0"`)
111
- zamienia jej wartość na kontrolkę z `column.edit.type`. Zatwierdzanie zależy od rodzaju kontrolki:
112
-
113
- - `text`/`number` (`kpt-input`, `kpt-input-number`) — brak overlaya, więc zatwierdza wyjście fokusu
114
- **poza cały edytor** (`focusout` z kontrolą `relatedTarget`) albo Enter; Escape odrzuca zmianę.
115
- Świadomie nie na `touch`/blur samej kontrolki: `kpt-input-number` ma fokusowalne strzałki `+`/`-`
116
- obok pola (i jeszcze emituje `touch` w `step_()`), więc każde kliknięcie strzałki zamykałoby
117
- edycję, zanim zdąży zmienić wartość.
118
- - `date`/`select`/`multiselect` (`kpt-datepicker`, `kpt-select`) — panel otwiera się **od razu** po
119
- kliknięciu komórki, a zatwierdzenie następuje przy jego **zamknięciu**: wybór wartości (single),
120
- klik poza panelem albo Escape. W `multiselect` zaznaczanie kolejnych opcji nie zatwierdza nic po
121
- drodze — panel zostaje otwarty, aż user kliknie poza nim, i wtedy leci jedno zdarzenie z pełną listą.
122
-
123
- Tabela **nigdzie nie zatwierdza na `touch`** — i nie należy tego przywracać. `touch` w tych
124
- kontrolkach nie znaczy „user skończył": leci z blur triggera (a panel żyje w kontenerze CDK Overlay
125
- przy `<body>`, więc naciśnięcie myszy na opcji/dniu blurruje trigger) i dodatkowo ze `step_()`
126
- w `kpt-input-number`. Zatwierdzanie na `touch` niszczyło edytor razem z panelem, zanim kliknięcie
127
- zdążyło wybrać wartość. Zamiast tego: edytory overlayowe wiążą się z `open` (`[open]`/`(openChange)`),
128
- a pozostałe z `focusout` na całym edytorze (fokus przeniesiony wewnątrz edytora nie zatwierdza).
129
-
130
- **Ograniczenie**: dla edytorów overlayowych Escape **zatwierdza** (zamyka panel), a nie odrzuca —
131
- klawiaturę panelu obsługują wewnętrznie `kpt-select`/`kpt-datepicker`, a keydown z overlaya nie
132
- dociera do komórki. Escape odrzuca zmianę tylko w `text`/`number`.
133
-
134
- Wartości porównywane są przed emisją: `cellEdit` nie leci, gdy user otworzył i zamknął panel bez
135
- zmiany, ani gdy w `multiselect` wróci do tego samego zestawu (tablice porównywane po zawartości).
136
-
137
- Gdy 5 wbudowanych typów nie wystarcza, dyrektywa `kptCellEdit` daje pełny, własny edytor. Kontekst:
138
- `$implicit` = bieżąca wartość, `row` = wiersz, `commit(value)` = zatwierdź i zamknij, `cancel()` = odrzuć.
109
+ ## Inline editing (column.edit / kptCellEdit)
110
+ Clicking a cell in an editable column (or pressing Enter while the cell has focus — it carries `tabindex="0"` then)
111
+ swaps its value for a control from `column.edit.type`. How it commits depends on the kind of control:
112
+
113
+ - `text`/`number` (`kpt-input`, `kpt-input-number`) — there is no overlay, so it commits when focus leaves
114
+ **the whole editor** (`focusout` with a `relatedTarget` check) or on Enter; Escape discards the change.
115
+ Deliberately not on the control's own `touch`/blur: `kpt-input-number` has focusable `+`/`-` arrows
116
+ next to the field (and it also emits `touch` in `step_()`), so every arrow click would close
117
+ the edit before it had a chance to change the value.
118
+ - `date`/`select`/`multiselect` (`kpt-datepicker`, `kpt-select`) — the panel opens **immediately** after
119
+ the cell is clicked, and the commit happens when it **closes**: picking a value (single),
120
+ a click outside the panel or Escape. In `multiselect`, ticking further options commits nothing along
121
+ the way — the panel stays open until the user clicks outside it, and then a single event fires with the full list.
122
+
123
+ The table **never commits on `touch`** — and that must not be reinstated. `touch` in these
124
+ controls does not mean "the user is done": it fires on the trigger's blur (and the panel lives in a CDK Overlay
125
+ container next to `<body>`, so pressing the mouse on an option/day blurs the trigger) and, on top of that, from `step_()`
126
+ in `kpt-input-number`. Committing on `touch` destroyed the editor together with the panel before the click
127
+ had a chance to pick a value. Instead: overlay editors bind to `open` (`[open]`/`(openChange)`),
128
+ and the rest to `focusout` on the whole editor (focus moved within the editor does not commit).
129
+
130
+ **A limitation**: for overlay editors Escape **commits** (it closes the panel) rather than discarding —
131
+ the panel's keyboard handling lives inside `kpt-select`/`kpt-datepicker`, and a keydown from the overlay does not
132
+ reach the cell. Escape discards a change only in `text`/`number`.
133
+
134
+ Values are compared before emitting: `cellEdit` does not fire when the user opened and closed a panel without
135
+ a change, nor when a `multiselect` returns to the same set (arrays are compared by content).
136
+
137
+ When the 5 built-in types are not enough, the `kptCellEdit` directive gives you a full custom editor. Context:
138
+ `$implicit` = the current value, `row` = the row, `commit(value)` = commit and close, `cancel()` = discard.
139
139
 
140
140
  <kpt-data-table [columns]="cols" [data]="rows" rowKey="id" (cellEdit)="onCellEdit($event)">
141
141
  <ng-template kptCellEdit="team" let-value let-commit="commit">
@@ -143,84 +143,84 @@ Gdy 5 wbudowanych typów nie wystarcza, dyrektywa `kptCellEdit` daje pełny, wł
143
143
  </ng-template>
144
144
  </kpt-data-table>
145
145
 
146
- ## Wiersz podsumowania (column.summary)
147
- Kolumny z `summary` renderują `<tfoot>` — ostatni wiersz tabeli, **nad paginatorem**, przyklejony
148
- do dołu obszaru przewijania (`position: sticky; bottom: 0`, jak sticky header).
149
-
150
- - **Etykieta** (`summaryLabel`, domyślnie i18n `dataTable.total` → „Total”/„Razem”) renderuje się
151
- w jednej komórce scalonej (`colspan`) od początku wiersza do pierwszej liczonej kolumny,
152
- wyrównana do prawej. Colspan obejmuje też kolumny systemowe (rozwijanie, zaznaczanie).
153
- Przykład: `summary` na 3. kolumnie → scalone kolumny 1–2. Gdy liczona jest **pierwsza** widoczna
154
- kolumna (i nie ma kolumn systemowych), etykieta nie ma się gdzie zmieścić i nie renderuje się.
155
- - **Zakres**: agregacja obejmuje **wszystkie wiersze po filtrach** — całą stronę 1 i każdą następną,
156
- nie tylko widoczną. Filtr globalny i filtry kolumn zawężają zbiór (zgodnie z licznikiem paginatora),
157
- sortowanie i strona nie zmieniają wyniku.
158
- - **Na żywo przy edycji inline**: `data` jest zwykłym inputem, więc gdy konsument po `cellEdit`
159
- podmieni tablicę w sygnale, podsumowanie przelicza się samo (zwykły `computed`).
160
- - **Agregacje**: `sum`, `avg`, `min`, `max`, `count`. `count` liczy wiersze; pozostałe pomijają
161
- wartości nieliczbowe (string z liczbą jest parsowany). Pusty zbiór: `sum` = 0, reszta — pusta
162
- komórka. `sum`/`avg` przycinają ogony zmiennoprzecinkowe (bez tego `0.1+0.2` = `0.30000000000000004`).
163
- Własna funkcja `fn: (rows) => unknown` dostaje ten sam zbiór (np. suma ważona).
164
- - **Formatowanie**: `format: (value) => string` (np. `Intl.NumberFormat`); bez niego wartość leci
165
- surowa. Komórki podsumowania są domyślnie do prawej — jawne `align` kolumny ma priorytet.
166
- Etykieta wiersza („Razem”) jest jedna na cały wiersz, więc kolumnę liczoną inaczej niż sumą
167
- (`avg`, `min`, `max`) nazwij w `format` (np. `ø 662,57 zł`) — inaczej czyta się jak suma.
168
- - **Ukryte kolumny** (`hiddenFields`) wypadają też z podsumowania; kolejność po `reorderable`
169
- jest respektowana (etykieta scala się do aktualnie pierwszej liczonej kolumny).
170
- - **Tryb `lazy`**: tabela ma tylko bieżącą stronę, więc nie liczy nic sama — podaj `summaryValues`
171
- (pole → gotowa wartość z serwera). `summaryValues` działa też poza `lazy`, nadpisując wyliczenia.
172
- Kolumna wymieniona wyłącznie w `summaryValues` (bez `summary`) też pokazuje wartość.
173
- - Wiersz nie renderuje się przy `loading` ani gdy tabela jest pusta (nie dublujemy komunikatu stanu).
174
- - Eksport CSV **nie zawiera** wiersza podsumowania — `exportCsv()` eksportuje same dane.
146
+ ## The summary row (column.summary)
147
+ Columns with a `summary` render a `<tfoot>` — the table's last row, **above the paginator**, stuck
148
+ to the bottom of the scrolling area (`position: sticky; bottom: 0`, like the sticky header).
149
+
150
+ - **The label** (`summaryLabel`, i18n `dataTable.total` by default → "Total"/"Razem") is rendered
151
+ in one merged cell (`colspan`) reaching from the start of the row to the first aggregated column,
152
+ right-aligned. The colspan also covers the system columns (expand, select).
153
+ For example: a `summary` on the 3rd column → columns 1–2 merged. When the **first** visible
154
+ column is the aggregated one (and there are no system columns), the label has nowhere to fit and is not rendered.
155
+ - **The scope**: the aggregation covers **every row after filtering** — the whole of page 1 and every following one,
156
+ not just what is visible. The global filter and the column filters narrow the set (in step with the paginator's counter),
157
+ while sorting and the current page do not change the result.
158
+ - **Live under inline editing**: `data` is an ordinary input, so once the consumer swaps the array in a signal
159
+ after `cellEdit`, the summary recomputes itself (a plain `computed`).
160
+ - **Aggregations**: `sum`, `avg`, `min`, `max`, `count`. `count` counts rows; the rest skip
161
+ non-numeric values (a string holding a number is parsed). On an empty set: `sum` = 0, the rest — an empty
162
+ cell. `sum`/`avg` trim floating-point tails (without that `0.1+0.2` = `0.30000000000000004`).
163
+ A custom `fn: (rows) => unknown` receives the same set (a weighted sum, for instance).
164
+ - **Formatting**: `format: (value) => string` (`Intl.NumberFormat`, say); without it the value goes out
165
+ raw. Summary cells are right-aligned by default — an explicit column `align` takes priority.
166
+ The row label ("Total") is one for the whole row, so name a column aggregated by anything other than a sum
167
+ (`avg`, `min`, `max`) inside `format` (e.g. `ø 662.57 USD`) — otherwise it reads as a sum.
168
+ - **Hidden columns** (`hiddenFields`) drop out of the summary too; the order after `reorderable`
169
+ is respected (the label merges up to whatever is now the first aggregated column).
170
+ - **`lazy` mode**: the table only holds the current page, so it computes nothing itself — supply `summaryValues`
171
+ (field → a ready value from the server). `summaryValues` also works outside `lazy`, overriding the computed values.
172
+ A column listed only in `summaryValues` (with no `summary`) shows a value too.
173
+ - The row is not rendered while `loading`, nor when the table is empty (we do not duplicate the state message).
174
+ - The CSV export **does not include** the summary row — `exportCsv()` exports the data alone.
175
175
 
176
176
  cols = [
177
- { field: 'product', header: 'Produkt' },
178
- { field: 'qty', header: 'Ilość', align: 'end', summary: { fn: 'sum' } },
179
- { field: 'net', header: 'Netto', align: 'end', summary: { fn: 'sum', format: pln } },
177
+ { field: 'product', header: 'Product' },
178
+ { field: 'qty', header: 'Quantity', align: 'end', summary: { fn: 'sum' } },
179
+ { field: 'net', header: 'Net', align: 'end', summary: { fn: 'sum', format: usd } },
180
180
  ];
181
181
 
182
182
  <kpt-data-table [columns]="cols" [data]="rows()" [pageSize]="5" rowKey="id"
183
- summaryLabel="Razem" (cellEdit)="onCellEdit($event)" />
183
+ summaryLabel="Total" (cellEdit)="onCellEdit($event)" />
184
184
 
185
- ## Zachowanie
186
- - Sortowanie: klik w nagłówek sortowalnej kolumny cyklicznie asc → desc → brak.
187
- - Filtr: dopasowanie tekstu we wszystkich polach kolumn; reset strony do 0.
188
- - Zaznaczanie 'multiple': nagłówkowy checkbox zaznacza/odznacza bieżącą stronę.
189
- - Sticky header, stany pusty/ładowanie, wyrównanie i szerokości per kolumna.
185
+ ## Behavior
186
+ - Sorting: clicking a sortable column's header cycles asc → desc → none.
187
+ - Filtering: text matching across every column field; the page resets to 0.
188
+ - 'multiple' selection: the header checkbox selects/deselects the current page.
189
+ - A sticky header, empty/loading states, per-column alignment and widths.
190
190
 
191
191
  ## i18n
192
- Etykiety toolbaru/stanów/aria (Szukaj, Eksport CSV, Ładowanie, Brak danych, zaznaczanie, filtry kolumn:
193
- Filtr/Filtr min/Filtr max z `{column}`, Wszystkie, min, max, Zakres dat) pochodzą z i18n (namespace `dataTable`).
194
- Domyślnie EN; konfiguracja przez `provideKptI18n` — patrz `i18n/llms.txt`.
195
-
196
- ## Wiersz paginatora (slot [kptPaginatorActions])
197
- Wiersz z `kpt-paginator` (renderowany gdy `pageSize > 0` i bez `virtualScroll`) to flex
198
- z opcjonalnym slotem projekcji po lewej stronie: `<div kptPaginatorActions>…</div>` wstawione
199
- jako zawartość `kpt-data-table` renderuje się przed paginatorem, w tym samym wierszu (`kpt-paginator`
200
- ma `flex: 1 1 auto` i własne `justify-content: flex-end` — bez projekcji zachowuje się identycznie
201
- jak wcześniej, w pełni po prawej). Miejsce na kompaktowy (ikonowy) przycisk dostosowywania kolumn —
202
- patrz `hiddenFields` wyżej i przykład `pg-column-toggle` w playground.
192
+ The toolbar/state/aria labels (Search, Export CSV, Loading, No data, selection, the column filters:
193
+ Filter/Filter min/Filter max with `{column}`, All, min, max, Date range) come from i18n (the `dataTable` namespace).
194
+ English by default; configured through `provideKptI18n` — see `i18n/llms.txt`.
195
+
196
+ ## The paginator row (the [kptPaginatorActions] slot)
197
+ The row holding `kpt-paginator` (rendered when `pageSize > 0` and there is no `virtualScroll`) is a flex
198
+ container with an optional projection slot on the left: a `<div kptPaginatorActions>…</div>` placed
199
+ as content of `kpt-data-table` renders before the paginator, in the same row (`kpt-paginator`
200
+ has `flex: 1 1 auto` and its own `justify-content: flex-end` — with no projection it behaves exactly
201
+ as it did before, fully to the right). This is the place for a compact (icon) column-customization button —
202
+ see `hiddenFields` above and the `pg-column-toggle` example in the playground.
203
203
 
204
204
  <kpt-data-table [columns]="cols" [data]="rows" [pageSize]="10" [(hiddenFields)]="hidden">
205
- <kpt-icon-button kptPaginatorActions ariaLabel="Kolumny" (click)="open.set(true)">
205
+ <kpt-icon-button kptPaginatorActions ariaLabel="Columns" (click)="open.set(true)">
206
206
  <kpt-icon name="adjustments-horizontal" />
207
207
  </kpt-icon-button>
208
208
  </kpt-data-table>
209
209
 
210
- ## Tokeny
210
+ ## Tokens
211
211
  `--kpt-table-{bg,fg,border,radius,header-bg,header-fg,row-hover,row-selected,cell-padding}`.
212
- Rozwijany wiersz: `--kpt-table-detail-bg` (fallback: surface-variant → row-hover).
213
- Wiersz podsumowania: `--kpt-table-summary-bg` (fallback: header-bg).
214
- Paginacja: komponent `kpt-paginator`.
212
+ The expanded row: `--kpt-table-detail-bg` (fallback: surface-variant → row-hover).
213
+ The summary row: `--kpt-table-summary-bg` (fallback: header-bg).
214
+ Pagination: the `kpt-paginator` component.
215
215
 
216
- ## Do zrobienia (roadmap)
217
- Kolumny grupowane.
216
+ ## To do (roadmap)
217
+ Grouped columns.
218
218
 
219
- Show/hide kolumn: gotowe (hak `hiddenFields`; UI dostosowywania — patrz sekcja „Model / zdarzenia”
220
- i przykład `pg-column-toggle` w playground).
219
+ Column show/hide: done (the `hiddenFields` hook; the customization UI — see the "Model / events" section
220
+ and the `pg-column-toggle` example in the playground).
221
221
 
222
- Edycja komórek inline: gotowe (`column.edit` + `cellEdit` + `kptCellEdit`; zapis do API —
223
- patrz przykład w playground, `pg-fake-users-api.ts`).
222
+ Inline cell editing: done (`column.edit` + `cellEdit` + `kptCellEdit`; saving to an API —
223
+ see the playground example, `pg-fake-users-api.ts`).
224
224
 
225
- Wiersz podsumowania: gotowe (`column.summary` + `summaryLabel` + `summaryValues` — patrz sekcja
226
- „Wiersz podsumowania” i przykład „Inline editing + summary row” w playground).
225
+ The summary row: done (`column.summary` + `summaryLabel` + `summaryValues` — see the
226
+ "The summary row" section and the "Inline editing + summary row" example in the playground).
@@ -1,18 +1,18 @@
1
1
  # KptDataView (kpt-data-view)
2
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>`.
3
+ Presents a list of items in a list or grid layout, with optional pagination (reusing `kpt-paginator`).
4
+ The item template comes through projection: `<ng-template let-item>`.
5
5
  Import: `import { KptDataView } from '@konce-pt/angular';`
6
6
 
7
- ## Wejścia / model
7
+ ## Inputs / model
8
8
  - `items`: T[]
9
- - `layout`: model<'list' | 'grid'> (przełącznik w pasku)
10
- - `pageSize`: number (0 = bez paginacji); `paginated`: boolean
9
+ - `layout`: model<'list' | 'grid'> (the toggle in the bar)
10
+ - `pageSize`: number (0 = no pagination); `paginated`: boolean
11
11
 
12
- ## Przykład
12
+ ## Example
13
13
  <kpt-data-view [items]="products" [pageSize]="6">
14
14
  <ng-template let-p><div>{{ p.name }}</div></ng-template>
15
15
  </kpt-data-view>
16
16
 
17
- ## Tokeny
18
- Karty elementów `--kpt-color-surface-raised`; przełącznik `--kpt-color-primary`.
17
+ ## Tokens
18
+ Item cards `--kpt-color-surface-raised`; the toggle `--kpt-color-primary`.
@@ -1,31 +1,31 @@
1
1
  # KptDateRange (kpt-date-range)
2
2
 
3
- Wybór zakresu dat/godzin z kalendarzem (CDK Overlay) na Signal Forms.
4
- `mode`: 'date' (domyślnie), 'datetime' (data+godzina, tarcza zegara `kpt-clock`), 'time' (sama godzina).
5
- Wartość `{ start, end }` (KptDateRangeValue): daty 'RRRR-MM-DD', datetime 'RRRR-MM-DDTHH:mm', godziny 'HH:mm'.
3
+ Picking a date/time range with a calendar (CDK Overlay) on Signal Forms.
4
+ `mode`: 'date' (default), 'datetime' (date+time, the `kpt-clock` dial), 'time' (time only).
5
+ The value is `{ start, end }` (KptDateRangeValue): dates 'YYYY-MM-DD', datetime 'YYYY-MM-DDTHH:mm', times 'HH:mm'.
6
6
  Import: `import { KptDateRange, KptDateRangeValue } from '@konce-pt/angular';`
7
- Wymaga `import '@angular/cdk/overlay-prebuilt.css';`
7
+ Requires `import '@angular/cdk/overlay-prebuilt.css';`
8
8
 
9
- ## Wejścia / model
10
- - `value`: model<KptDateRangeValue> (lub `formField`)
11
- - `mode`: 'date' | 'datetime' | 'time' (domyślnie 'date')
12
- - `visibleMonths`: number (domyślnie 1, przycinane do 1–3) — liczba miesięcy obok siebie.
13
- Strzałki ‹ › stoją na skrajnych panelach i przesuwają całość o jeden miesiąc.
14
- Ignorowane w trybie 'time'. Przy >1 dni sąsiednich miesięcy są ukrywane (puste sloty) —
15
- inaczej ta sama data byłaby klikalna w dwóch panelach naraz.
16
- - `hourFormat`: 12 | 24 (domyślnie 24) — tarcza z AM/PM lub 24h; czas zawsze 24h w wartości
17
- - `minuteStep`: number (domyślnie 1) — snap minut na tarczy
18
- - `placeholder`: string — bez wartości używa i18n (`dateRange.placeholder`); input ma priorytet
19
- - `displayFormat`: 'pl' | 'iso' (domyślnie 'pl') — format wyświetlania start/end
9
+ ## Inputs / model
10
+ - `value`: model<KptDateRangeValue> (or `formField`)
11
+ - `mode`: 'date' | 'datetime' | 'time' (default 'date')
12
+ - `visibleMonths`: number (default 1, clamped to 1–3) — how many months sit side by side.
13
+ The ‹ › arrows stand on the outermost panels and move the whole set by one month.
14
+ Ignored in 'time' mode. With more than one, days from adjacent months are hidden (empty slots) —
15
+ otherwise the same date would be clickable in two panels at once.
16
+ - `hourFormat`: 12 | 24 (default 24) — an AM/PM or a 24h dial; the value is always 24h
17
+ - `minuteStep`: number (default 1) — minute snapping on the dial
18
+ - `placeholder`: string — with no value it uses i18n (`dateRange.placeholder`); the input takes priority
19
+ - `displayFormat`: 'pl' | 'iso' (default 'pl') — the display format for start/end
20
20
  - `disabled`/`invalid`/`touched`: boolean; `touch`: output
21
21
 
22
- ## Zachowanie
23
- Pierwszy klik ustawia `start`, drugi `end` (kolejność normalizowana). „×" czyści.
24
- Zakres podświetla ciągłe pasmo biegnące przez wszystkie panele: dni skrajne mają plamę
25
- zaznaczenia, a pasmo wychodzi z ich środka, zaokrąglając się na krańcach wiersza siatki.
26
- Tryby datetime/time: przełącznik „Od / Koniec" + tarcza zegara, zatwierdzenie przyciskiem „Gotowe".
22
+ ## Behavior
23
+ The first click sets `start`, the second `end` (the order is normalized). The "×" clears it.
24
+ The range highlights one continuous band running across every panel: the end days carry the selection
25
+ blob, and the band leaves their center, rounding off at the ends of a grid row.
26
+ The datetime/time modes: a "From / To" toggle + the clock dial, confirmed with the "Done" button.
27
27
 
28
- ## Przykład
28
+ ## Example
29
29
  <kpt-date-range [formField]="f.period" />
30
30
  <kpt-date-range [(value)]="period" />
31
31
  <kpt-date-range [visibleMonths]="2" [(value)]="period" />
@@ -33,8 +33,8 @@ Tryby datetime/time: przełącznik „Od / Koniec" + tarcza zegara, zatwierdzeni
33
33
  period = signal<KptDateRangeValue>({ start: '', end: '' });
34
34
 
35
35
  ## i18n
36
- Nazwy dni/miesięcy z `Intl` wg locale; etykiety („Od/Koniec", nawigacja, „Gotowe", placeholder) z i18n
37
- (namespace `dateRange` + `datepicker`/`common`). Domyślnie EN — patrz `i18n/llms.txt`.
36
+ Day and month names come from `Intl` per locale; the labels ("From/To", navigation, "Done", the placeholder) come from i18n
37
+ (the `dateRange` namespace + `datepicker`/`common`). English by default — see `i18n/llms.txt`.
38
38
 
39
- ## Tokeny
40
- Pole `--kpt-form-field-*`; kalendarz `--kpt-color-surface-raised`, zakres `--kpt-color-primary`.
39
+ ## Tokens
40
+ The field `--kpt-form-field-*`; the calendar `--kpt-color-surface-raised`, the range `--kpt-color-primary`.