@tekus/design-system 5.39.0 → 5.41.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/fesm2022/tekus-design-system-components-badge.mjs +19 -3
- package/fesm2022/tekus-design-system-components-badge.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-carousel.mjs +27 -6
- package/fesm2022/tekus-design-system-components-carousel.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-counter.mjs +494 -0
- package/fesm2022/tekus-design-system-components-counter.mjs.map +1 -0
- package/fesm2022/tekus-design-system-components-icon.mjs +14 -0
- package/fesm2022/tekus-design-system-components-icon.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-panel.mjs +2 -2
- package/fesm2022/tekus-design-system-components-panel.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-stepper.mjs +2 -2
- package/fesm2022/tekus-design-system-components-stepper.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-table.mjs +94 -3
- package/fesm2022/tekus-design-system-components-table.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-tabs.mjs +1 -1
- package/fesm2022/tekus-design-system-components-tabs.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-toggle.mjs +2 -2
- package/fesm2022/tekus-design-system-components-toggle.mjs.map +1 -1
- package/package.json +5 -1
- package/types/tekus-design-system-components-badge.d.ts +15 -1
- package/types/tekus-design-system-components-carousel.d.ts +21 -2
- package/types/tekus-design-system-components-counter.d.ts +286 -0
- package/types/tekus-design-system-components-icon.d.ts +1 -1
- package/types/tekus-design-system-components-table.d.ts +115 -2
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { OnInit } from '@angular/core';
|
|
3
|
+
import { ControlValueAccessor, NgControl, FormControl } from '@angular/forms';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @component CounterComponent
|
|
7
|
+
* @description
|
|
8
|
+
* Compact control for selecting an integer value within a bounded range using
|
|
9
|
+
* icon-only decrement and increment buttons, with an editable value in the center.
|
|
10
|
+
* It has its own distinct visual identity so it reads as a standalone element rather
|
|
11
|
+
* than blending into the standard input family.
|
|
12
|
+
*
|
|
13
|
+
* This component supports:
|
|
14
|
+
* - `value`: the current integer. Never null; always rendered clamped into `[min, max]`.
|
|
15
|
+
* - `min` / `max`: the inclusive bounds. Buttons **disable** at a limit, never hide,
|
|
16
|
+
* and the value never wraps around.
|
|
17
|
+
* - `step`: the amount added or subtracted per action.
|
|
18
|
+
* - `disabled` / `readonly`: `disabled` blocks interaction and applies a distinct
|
|
19
|
+
* treatment to the value; `readonly` looks normal but cannot change.
|
|
20
|
+
* - Holding a button auto-repeats the step.
|
|
21
|
+
*
|
|
22
|
+
* It implements `ControlValueAccessor`, so it works with `[(ngModel)]` and reactive forms.
|
|
23
|
+
*
|
|
24
|
+
* @usage
|
|
25
|
+
* ### Basic Usage
|
|
26
|
+
* ```html
|
|
27
|
+
* <tk-counter [(ngModel)]="quantity" />
|
|
28
|
+
* <tk-counter [min]="1" [max]="10" [step]="2" [(value)]="servings" />
|
|
29
|
+
* <tk-counter [control]="quantityControl" (valueChange)="onQuantityChange($event)" />
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
declare class CounterComponent implements ControlValueAccessor, OnInit {
|
|
33
|
+
readonly ngControl: NgControl | null;
|
|
34
|
+
private readonly destroyRef;
|
|
35
|
+
constructor();
|
|
36
|
+
/**
|
|
37
|
+
* @property {ModelSignal<number>} value
|
|
38
|
+
* @description
|
|
39
|
+
* Current integer value. Never null; always rendered clamped into `[min, max]`.
|
|
40
|
+
* Supports two-way binding via `[(value)]` and emits `(valueChange)` after clamping.
|
|
41
|
+
*
|
|
42
|
+
* @default `0`
|
|
43
|
+
*/
|
|
44
|
+
value: _angular_core.ModelSignal<number>;
|
|
45
|
+
/**
|
|
46
|
+
* @property {InputSignal<number>} min
|
|
47
|
+
* @description
|
|
48
|
+
* Lower bound, inclusive. The decrement button disables at this value.
|
|
49
|
+
*
|
|
50
|
+
* @default `0`
|
|
51
|
+
*/
|
|
52
|
+
min: _angular_core.InputSignal<number>;
|
|
53
|
+
/**
|
|
54
|
+
* @property {InputSignal<number>} max
|
|
55
|
+
* @description
|
|
56
|
+
* Upper bound, inclusive. The increment button disables at this value.
|
|
57
|
+
*
|
|
58
|
+
* @default `99`
|
|
59
|
+
*/
|
|
60
|
+
max: _angular_core.InputSignal<number>;
|
|
61
|
+
/**
|
|
62
|
+
* @property {InputSignal<number>} step
|
|
63
|
+
* @description
|
|
64
|
+
* Amount added or subtracted per action. `PageUp` / `PageDown` apply ten times this.
|
|
65
|
+
*
|
|
66
|
+
* @default `1`
|
|
67
|
+
*/
|
|
68
|
+
step: _angular_core.InputSignal<number>;
|
|
69
|
+
/**
|
|
70
|
+
* @property {ModelSignal<boolean>} disabled
|
|
71
|
+
* @description
|
|
72
|
+
* Disables all interaction and applies the distinct disabled treatment to the value.
|
|
73
|
+
*
|
|
74
|
+
* @default `false`
|
|
75
|
+
*/
|
|
76
|
+
disabled: _angular_core.ModelSignal<boolean>;
|
|
77
|
+
/**
|
|
78
|
+
* @property {InputSignal<boolean>} readonly
|
|
79
|
+
* @description
|
|
80
|
+
* The value is shown but cannot change. Visually normal, unlike `disabled`.
|
|
81
|
+
*
|
|
82
|
+
* @default `false`
|
|
83
|
+
*/
|
|
84
|
+
readonly: _angular_core.InputSignal<boolean>;
|
|
85
|
+
/**
|
|
86
|
+
* @property {InputSignal<FormControl | undefined>} control
|
|
87
|
+
* @description
|
|
88
|
+
* External FormControl used to read/set the value. Optional: when omitted the
|
|
89
|
+
* counter keeps its value in the `value` model alone and creates no control.
|
|
90
|
+
* Not needed when using `formControlName` or `[(ngModel)]`.
|
|
91
|
+
*
|
|
92
|
+
* @default `undefined`
|
|
93
|
+
*/
|
|
94
|
+
control: _angular_core.InputSignal<FormControl<any> | undefined>;
|
|
95
|
+
/**
|
|
96
|
+
* @property {InputSignal<string>} decreaseLabel
|
|
97
|
+
* @description
|
|
98
|
+
* Accessible label for the decrement button, which carries no visible text.
|
|
99
|
+
*
|
|
100
|
+
* @default `'Decrease'`
|
|
101
|
+
*/
|
|
102
|
+
decreaseLabel: _angular_core.InputSignal<string>;
|
|
103
|
+
/**
|
|
104
|
+
* @property {InputSignal<string>} increaseLabel
|
|
105
|
+
* @description
|
|
106
|
+
* Accessible label for the increment button, which carries no visible text.
|
|
107
|
+
*
|
|
108
|
+
* @default `'Increase'`
|
|
109
|
+
*/
|
|
110
|
+
increaseLabel: _angular_core.InputSignal<string>;
|
|
111
|
+
/**
|
|
112
|
+
* @property {InputSignal<string>} ariaLabel
|
|
113
|
+
* @description
|
|
114
|
+
* Accessible name for the value field. The counter renders no visible label, so
|
|
115
|
+
* either this or `ariaLabelledby` must be set unless surrounding text already
|
|
116
|
+
* names the control — otherwise the spinbutton is announced unnamed.
|
|
117
|
+
*/
|
|
118
|
+
ariaLabel: _angular_core.InputSignal<string>;
|
|
119
|
+
/**
|
|
120
|
+
* @property {InputSignal<string>} ariaLabelledby
|
|
121
|
+
* @description
|
|
122
|
+
* Id of an existing element that names the value field. Use instead of
|
|
123
|
+
* `ariaLabel` when a visible label already exists elsewhere in the view.
|
|
124
|
+
*/
|
|
125
|
+
ariaLabelledby: _angular_core.InputSignal<string>;
|
|
126
|
+
/** The value field, used to resync its text after the model clamps a typed entry. */
|
|
127
|
+
private readonly valueInput;
|
|
128
|
+
/**
|
|
129
|
+
* The effective upper bound. Guards against a `max` lower than `min` so the range
|
|
130
|
+
* is never inverted and `clamp` stays well defined.
|
|
131
|
+
*/
|
|
132
|
+
readonly safeMax: _angular_core.Signal<number>;
|
|
133
|
+
/**
|
|
134
|
+
* The effective step. Guards against `0`, a negative, or a non-finite `step`, any
|
|
135
|
+
* of which would make stepping a no-op — and would let a held button repeat forever
|
|
136
|
+
* without ever reaching a limit.
|
|
137
|
+
*/
|
|
138
|
+
readonly effectiveStep: _angular_core.Signal<number>;
|
|
139
|
+
/** The amount applied by `PageUp` / `PageDown`: ten times `step`. */
|
|
140
|
+
readonly pageStep: _angular_core.Signal<number>;
|
|
141
|
+
/**
|
|
142
|
+
* Character budget for the value field: the widest number the range can produce,
|
|
143
|
+
* never fewer than `MIN_VALUE_WIDTH_CH`.
|
|
144
|
+
*
|
|
145
|
+
* Derived from the **range**, not from the current value, so that every counter
|
|
146
|
+
* sharing a range renders exactly the same width. That is what keeps the buttons
|
|
147
|
+
* aligned down a column when one row shows `1` and the next shows `44` — sizing to
|
|
148
|
+
* the current value instead would make each row a different width.
|
|
149
|
+
*/
|
|
150
|
+
readonly valueWidthCh: _angular_core.Signal<number>;
|
|
151
|
+
/**
|
|
152
|
+
* The rendered value: always a valid integer inside `[min, safeMax]`, even when a
|
|
153
|
+
* parent binds something out of range. Deliberately a `computed` rather than an
|
|
154
|
+
* `effect` writing back into `value`, which would fight a two-way `[(value)]`
|
|
155
|
+
* binding; the first interaction commits the clamped number and converges the two.
|
|
156
|
+
*/
|
|
157
|
+
readonly displayValue: _angular_core.Signal<number>;
|
|
158
|
+
/** Whether the value sits at the lower bound, which disables the decrement button. */
|
|
159
|
+
readonly atMin: _angular_core.Signal<boolean>;
|
|
160
|
+
/** Whether the value sits at the upper bound, which disables the increment button. */
|
|
161
|
+
readonly atMax: _angular_core.Signal<boolean>;
|
|
162
|
+
/** Computed host class: the BEM block plus the disabled and readonly modifiers. */
|
|
163
|
+
readonly hostClass: _angular_core.Signal<string>;
|
|
164
|
+
get effectiveControl(): FormControl | null;
|
|
165
|
+
onChange: (value: number) => void;
|
|
166
|
+
onTouched: () => void;
|
|
167
|
+
private isWriting;
|
|
168
|
+
private holdTimeout;
|
|
169
|
+
private holdInterval;
|
|
170
|
+
ngOnInit(): void;
|
|
171
|
+
/**
|
|
172
|
+
* @method writeValue
|
|
173
|
+
* @description
|
|
174
|
+
* Writes a new value to the element, clamped into range.
|
|
175
|
+
* @param value The new value.
|
|
176
|
+
*/
|
|
177
|
+
writeValue(value: number | null): void;
|
|
178
|
+
/**
|
|
179
|
+
* @method registerOnChange
|
|
180
|
+
* @description
|
|
181
|
+
* Registers a callback called when the value changes in the UI.
|
|
182
|
+
* @param fn The callback function.
|
|
183
|
+
*/
|
|
184
|
+
registerOnChange(fn: (value: number) => void): void;
|
|
185
|
+
/**
|
|
186
|
+
* @method registerOnTouched
|
|
187
|
+
* @description
|
|
188
|
+
* Registers a callback called by the forms API to update the form model on blur.
|
|
189
|
+
* @param fn The callback function.
|
|
190
|
+
*/
|
|
191
|
+
registerOnTouched(fn: () => void): void;
|
|
192
|
+
/**
|
|
193
|
+
* @method setDisabledState
|
|
194
|
+
* @description
|
|
195
|
+
* Called by the forms API when the control status changes to or from 'DISABLED'.
|
|
196
|
+
* @param isDisabled The disabled status to set on the element.
|
|
197
|
+
*/
|
|
198
|
+
setDisabledState(isDisabled: boolean): void;
|
|
199
|
+
/**
|
|
200
|
+
* @method stepBy
|
|
201
|
+
* @description
|
|
202
|
+
* Moves the value by `step` in the given direction, clamped into range.
|
|
203
|
+
* @param direction `1` to increment, `-1` to decrement.
|
|
204
|
+
*/
|
|
205
|
+
stepBy(direction: 1 | -1): void;
|
|
206
|
+
/**
|
|
207
|
+
* @method startHold
|
|
208
|
+
* @description
|
|
209
|
+
* Steps once immediately, then begins auto-repeating after `HOLD_DELAY_MS`.
|
|
210
|
+
* No-ops when the counter cannot change or is already at that limit.
|
|
211
|
+
* @param direction `1` to increment, `-1` to decrement.
|
|
212
|
+
*/
|
|
213
|
+
startHold(direction: 1 | -1): void;
|
|
214
|
+
/**
|
|
215
|
+
* @method stopHold
|
|
216
|
+
* @description
|
|
217
|
+
* Cancels any pending or running auto-repeat. Safe to call when none is active.
|
|
218
|
+
*/
|
|
219
|
+
stopHold(): void;
|
|
220
|
+
/**
|
|
221
|
+
* @method onButtonKeydown
|
|
222
|
+
* @description
|
|
223
|
+
* Handles keyboard activation of a stepper button. `Enter` and `Space` are handled
|
|
224
|
+
* here — and their default prevented — so the button steps exactly once per press
|
|
225
|
+
* and relies on native key auto-repeat while held.
|
|
226
|
+
* @param event The keyboard event.
|
|
227
|
+
* @param direction `1` to increment, `-1` to decrement.
|
|
228
|
+
*/
|
|
229
|
+
onButtonKeydown(event: KeyboardEvent, direction: 1 | -1): void;
|
|
230
|
+
/**
|
|
231
|
+
* @method onValueKeydown
|
|
232
|
+
* @description
|
|
233
|
+
* Handles the spinbutton keyboard contract: arrows step by `step`, Home / End jump
|
|
234
|
+
* to the bounds, PageUp / PageDown apply a larger step, and Enter commits the
|
|
235
|
+
* currently typed text.
|
|
236
|
+
* @param event The keyboard event.
|
|
237
|
+
*/
|
|
238
|
+
onValueKeydown(event: KeyboardEvent): void;
|
|
239
|
+
/**
|
|
240
|
+
* @method onInput
|
|
241
|
+
* @description
|
|
242
|
+
* Rejects non-numeric characters as they are typed, without clamping — clamping
|
|
243
|
+
* mid-keystroke would fight the user on the way to a valid number (typing `1`
|
|
244
|
+
* toward `12` when `min` is `5`). The value is committed on blur or Enter.
|
|
245
|
+
* @param event The input event.
|
|
246
|
+
*/
|
|
247
|
+
onInput(event: Event): void;
|
|
248
|
+
/**
|
|
249
|
+
* @method onValueBlur
|
|
250
|
+
* @description
|
|
251
|
+
* Commits the typed text, marks the control touched, and resyncs the field so its
|
|
252
|
+
* text always matches the clamped value.
|
|
253
|
+
*/
|
|
254
|
+
onValueBlur(): void;
|
|
255
|
+
/**
|
|
256
|
+
* Keeps digits only, plus a single leading `-` when the range includes negatives.
|
|
257
|
+
* Applied to whatever lands in the field, so it also covers paste and drop.
|
|
258
|
+
*/
|
|
259
|
+
private sanitize;
|
|
260
|
+
/** Whether the counter currently accepts changes. */
|
|
261
|
+
private canInteract;
|
|
262
|
+
/** Whether stepping in `direction` would move past an already-reached bound. */
|
|
263
|
+
private isAtLimit;
|
|
264
|
+
/**
|
|
265
|
+
* Rounds and clamps an arbitrary value into `[min, safeMax]`. Non-finite input
|
|
266
|
+
* (an empty or unparseable field) falls back to `min`, so the value is never empty.
|
|
267
|
+
*/
|
|
268
|
+
private clamp;
|
|
269
|
+
/**
|
|
270
|
+
* The single write path: clamps, updates the model, notifies the forms API, and
|
|
271
|
+
* emits `(valueChange)` — so clamping and emission happen in exactly one place.
|
|
272
|
+
*/
|
|
273
|
+
private commit;
|
|
274
|
+
/** Parses the field's current text, commits it, and resyncs the displayed text. */
|
|
275
|
+
private commitTypedValue;
|
|
276
|
+
/**
|
|
277
|
+
* Rewrites the field's text from `displayValue`. Required because the `[value]`
|
|
278
|
+
* binding will not update the DOM when the model is unchanged — typing `150` with
|
|
279
|
+
* `max` `99` while the value is already `99` leaves stale text behind otherwise.
|
|
280
|
+
*/
|
|
281
|
+
private syncInputText;
|
|
282
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CounterComponent, never>;
|
|
283
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CounterComponent, "tk-counter", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "decreaseLabel": { "alias": "decreaseLabel"; "required": false; "isSignal": true; }; "increaseLabel": { "alias": "increaseLabel"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "ariaLabelledby"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "disabled": "disabledChange"; }, never, never, true, never>;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export { CounterComponent };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { Table } from 'primeng/table';
|
|
3
3
|
import { TagSeverity } from '@tekus/design-system/components/tag';
|
|
4
|
+
import { BadgeSeverity } from '@tekus/design-system/components/badge';
|
|
5
|
+
import { IconColors } from '@tekus/design-system/components/icon';
|
|
4
6
|
import { SortEvent } from 'primeng/api';
|
|
5
7
|
import { TkAction } from '@tekus/design-system/components/action-group';
|
|
6
8
|
|
|
7
|
-
type TableColumnType = 'text' | 'tag' | 'actions' | 'selection' | 'checkbox' | 'action-group' | 'connection-status' | 'image';
|
|
9
|
+
type TableColumnType = 'text' | 'tag' | 'actions' | 'selection' | 'checkbox' | 'action-group' | 'connection-status' | 'image' | 'counter' | 'toggle';
|
|
8
10
|
interface TableColumn<T = unknown> {
|
|
9
11
|
field?: string;
|
|
10
12
|
header: string;
|
|
@@ -12,6 +14,19 @@ interface TableColumn<T = unknown> {
|
|
|
12
14
|
filterable?: boolean;
|
|
13
15
|
type?: TableColumnType;
|
|
14
16
|
width?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Icon rendered before the value of a `'text'` (or default) cell.
|
|
19
|
+
* Uses the design system's IconCatalog names (same as `tk-icon`).
|
|
20
|
+
*/
|
|
21
|
+
icon?: (row: T) => string;
|
|
22
|
+
/** Color of `icon`. Falls back to `tk-icon`'s own default. */
|
|
23
|
+
iconColor?: (row: T) => IconColors;
|
|
24
|
+
/**
|
|
25
|
+
* Truncates a `'text'` (or default) cell with an ellipsis instead of
|
|
26
|
+
* overflowing or wrapping. Uses `width` as the truncation point,
|
|
27
|
+
* falling back to `200px` when `width` is not set.
|
|
28
|
+
*/
|
|
29
|
+
truncate?: boolean;
|
|
15
30
|
tagSeverity?: (row: T) => TagSeverity;
|
|
16
31
|
connectionStatusSeverity?: (row: T) => 'success' | 'warn' | 'danger' | 'gray';
|
|
17
32
|
connectionStatusTooltipText?: (row: T) => string;
|
|
@@ -32,6 +47,43 @@ interface TableColumn<T = unknown> {
|
|
|
32
47
|
imageHeight?: string;
|
|
33
48
|
imageFallback?: string;
|
|
34
49
|
imageAction?: (row: T) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Total number of images available for the row (e.g. multiple evidence shots
|
|
52
|
+
* behind one thumbnail). When it resolves to more than 1, the cell overlays
|
|
53
|
+
* a `tk-badge` on the top-right corner of the thumbnail showing the count.
|
|
54
|
+
*/
|
|
55
|
+
imageCount?: (row: T) => number;
|
|
56
|
+
/**
|
|
57
|
+
* Severity (color) of the `imageCount` overlay badge.
|
|
58
|
+
* @default 'primary'
|
|
59
|
+
*/
|
|
60
|
+
imageCountSeverity?: (row: T) => BadgeSeverity;
|
|
61
|
+
counterMin?: number;
|
|
62
|
+
counterMax?: number;
|
|
63
|
+
counterStep?: number;
|
|
64
|
+
counterDisabled?: boolean | ((row: T) => boolean);
|
|
65
|
+
/** Accessible name for the cell's counter. Falls back to the column `header`. */
|
|
66
|
+
counterAriaLabel?: (row: T) => string;
|
|
67
|
+
counterDecreaseLabel?: string;
|
|
68
|
+
counterIncreaseLabel?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Called after the cell has written the clamped value into `row[field]`.
|
|
71
|
+
* The hook to persist a quantity change.
|
|
72
|
+
*/
|
|
73
|
+
counterChange?: (row: T, value: number) => void;
|
|
74
|
+
toggleDisabled?: boolean | ((row: T) => boolean);
|
|
75
|
+
/** Optional label rendered next to the switch. Falls back to no label. */
|
|
76
|
+
toggleLabel?: (row: T) => string;
|
|
77
|
+
/**
|
|
78
|
+
* Called after the cell has written the new value into `row[field]`.
|
|
79
|
+
* The hook to persist a toggle change.
|
|
80
|
+
*/
|
|
81
|
+
toggleChange?: (row: T, value: boolean) => void;
|
|
82
|
+
/**
|
|
83
|
+
* Tooltip text identifying the switch's current state, wrapping it in a
|
|
84
|
+
* `tk-tooltip`. Receives the row and the current (pre-toggle) value.
|
|
85
|
+
*/
|
|
86
|
+
toggleTooltip?: (row: T, value: boolean) => string;
|
|
35
87
|
}
|
|
36
88
|
|
|
37
89
|
declare class TableComponent<T = unknown> {
|
|
@@ -91,6 +143,16 @@ declare class TableComponent<T = unknown> {
|
|
|
91
143
|
* Property name to uniquely identify a row.
|
|
92
144
|
*/
|
|
93
145
|
dataKey: _angular_core.InputSignal<string | undefined>;
|
|
146
|
+
/**
|
|
147
|
+
* @property {InputSignal<string | null>} minTableWidth
|
|
148
|
+
* @description
|
|
149
|
+
* CSS `min-width` applied to the underlying PrimeNG table. Pass `null` to
|
|
150
|
+
* remove the minimum entirely (e.g. inside a narrow container such as a
|
|
151
|
+
* wizard step or modal) so the table can shrink to fit instead of forcing
|
|
152
|
+
* horizontal overflow.
|
|
153
|
+
* @default '60rem'
|
|
154
|
+
*/
|
|
155
|
+
minTableWidth: _angular_core.InputSignal<string | null>;
|
|
94
156
|
readonly initialData: _angular_core.WritableSignal<T[]>;
|
|
95
157
|
readonly internalData: _angular_core.WritableSignal<T[]>;
|
|
96
158
|
readonly isSorted: _angular_core.WritableSignal<boolean | null>;
|
|
@@ -215,6 +277,57 @@ declare class TableComponent<T = unknown> {
|
|
|
215
277
|
* @param row {T} - The data row associated with the clicked image.
|
|
216
278
|
*/
|
|
217
279
|
handleImageClick(event: Event, col: TableColumn<T>, row: T): void;
|
|
280
|
+
/**
|
|
281
|
+
* @method isCounterDisabled
|
|
282
|
+
* @description
|
|
283
|
+
* Resolves a counter column's `counterDisabled`, which may be a boolean or a
|
|
284
|
+
* per-row predicate — the same shape `getActionGroup` already accepts.
|
|
285
|
+
* @param col {TableColumn<T>} - The counter column definition.
|
|
286
|
+
* @param row {T} - The data row being rendered.
|
|
287
|
+
* @returns Whether this row's counter should be disabled.
|
|
288
|
+
*/
|
|
289
|
+
isCounterDisabled(col: TableColumn<T>, row: T): boolean;
|
|
290
|
+
/**
|
|
291
|
+
* @method onCounterChange
|
|
292
|
+
* @description
|
|
293
|
+
* Writes a counter cell's new value into the row and notifies the consumer.
|
|
294
|
+
* The value arrives already clamped into the column's range by `tk-counter`.
|
|
295
|
+
* Mutating the row in place matches how the `checkbox` column type behaves.
|
|
296
|
+
* @param col {TableColumn<T>} - The counter column definition.
|
|
297
|
+
* @param row {T} - The data row being edited.
|
|
298
|
+
* @param value {number} - The new, clamped value.
|
|
299
|
+
*/
|
|
300
|
+
onCounterChange(col: TableColumn<T>, row: T, value: number): void;
|
|
301
|
+
/**
|
|
302
|
+
* @method isToggleDisabled
|
|
303
|
+
* @description
|
|
304
|
+
* Resolves a toggle column's `toggleDisabled`, which may be a boolean or a
|
|
305
|
+
* per-row predicate — the same shape `isCounterDisabled` already accepts.
|
|
306
|
+
* @param col {TableColumn<T>} - The toggle column definition.
|
|
307
|
+
* @param row {T} - The data row being rendered.
|
|
308
|
+
* @returns Whether this row's toggle should be disabled.
|
|
309
|
+
*/
|
|
310
|
+
isToggleDisabled(col: TableColumn<T>, row: T): boolean;
|
|
311
|
+
/**
|
|
312
|
+
* @method onToggleChange
|
|
313
|
+
* @description
|
|
314
|
+
* Writes a toggle cell's new value into the row and notifies the consumer.
|
|
315
|
+
* Mutating the row in place matches how the `checkbox` column type behaves.
|
|
316
|
+
* @param col {TableColumn<T>} - The toggle column definition.
|
|
317
|
+
* @param row {T} - The data row being edited.
|
|
318
|
+
* @param value {boolean} - The new switch value.
|
|
319
|
+
*/
|
|
320
|
+
onToggleChange(col: TableColumn<T>, row: T, value: boolean): void;
|
|
321
|
+
/**
|
|
322
|
+
* @method getImageCount
|
|
323
|
+
* @description
|
|
324
|
+
* Resolves how many images are available for an image-type cell via the
|
|
325
|
+
* column's `imageCount` callback. Returns 0 when not configured, so the
|
|
326
|
+
* template only overlays a `tk-badge` when there is more than one image.
|
|
327
|
+
* @param col {TableColumn<T>} - The image column definition.
|
|
328
|
+
* @param row {T} - The data row being rendered.
|
|
329
|
+
*/
|
|
330
|
+
getImageCount(col: TableColumn<T>, row: T): number;
|
|
218
331
|
/**
|
|
219
332
|
* @method onImageError
|
|
220
333
|
* @description
|
|
@@ -225,7 +338,7 @@ declare class TableComponent<T = unknown> {
|
|
|
225
338
|
*/
|
|
226
339
|
onImageError(event: Event, fallback?: string): void;
|
|
227
340
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TableComponent<any>, never>;
|
|
228
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TableComponent<any>, "tk-table", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "selection": { "alias": "selection"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "columnFilters": { "alias": "columnFilters"; "required": false; "isSignal": true; }; "sortField": { "alias": "sortField"; "required": false; "isSignal": true; }; "sortOrder": { "alias": "sortOrder"; "required": false; "isSignal": true; }; }, { "selection": "selectionChange"; "columnFilters": "columnFiltersChange"; "sortField": "sortFieldChange"; "sortOrder": "sortOrderChange"; }, never, never, true, never>;
|
|
341
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TableComponent<any>, "tk-table", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "selection": { "alias": "selection"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "minTableWidth": { "alias": "minTableWidth"; "required": false; "isSignal": true; }; "columnFilters": { "alias": "columnFilters"; "required": false; "isSignal": true; }; "sortField": { "alias": "sortField"; "required": false; "isSignal": true; }; "sortOrder": { "alias": "sortOrder"; "required": false; "isSignal": true; }; }, { "selection": "selectionChange"; "columnFilters": "columnFiltersChange"; "sortField": "sortFieldChange"; "sortOrder": "sortOrderChange"; }, never, never, true, never>;
|
|
229
342
|
}
|
|
230
343
|
|
|
231
344
|
export { TableComponent };
|