@ngneers/controls 0.0.1-next.0 → 0.0.1-next.1

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 (35) hide show
  1. package/fesm2022/ngneers-controls-api-resize.mjs +7 -0
  2. package/fesm2022/ngneers-controls-api-resize.mjs.map +1 -1
  3. package/fesm2022/ngneers-controls-i18n-translations-de.mjs +3 -0
  4. package/fesm2022/ngneers-controls-i18n-translations-de.mjs.map +1 -1
  5. package/fesm2022/ngneers-controls-i18n-translations-en.mjs +3 -0
  6. package/fesm2022/ngneers-controls-i18n-translations-en.mjs.map +1 -1
  7. package/fesm2022/ngneers-controls-otp.mjs +251 -0
  8. package/fesm2022/ngneers-controls-otp.mjs.map +1 -0
  9. package/fesm2022/ngneers-controls-splitter.mjs +43 -12
  10. package/fesm2022/ngneers-controls-splitter.mjs.map +1 -1
  11. package/fesm2022/ngneers-controls-toggle-button.mjs +2 -2
  12. package/fesm2022/ngneers-controls-toggle-button.mjs.map +1 -1
  13. package/package.json +6 -2
  14. package/types/ngneers-controls-breadcrumb.d.ts +3 -0
  15. package/types/ngneers-controls-calendar.d.ts +3 -0
  16. package/types/ngneers-controls-chip.d.ts +3 -0
  17. package/types/ngneers-controls-dialog.d.ts +3 -0
  18. package/types/ngneers-controls-drawer.d.ts +3 -0
  19. package/types/ngneers-controls-edit-inplace.d.ts +3 -0
  20. package/types/ngneers-controls-filter.d.ts +3 -0
  21. package/types/ngneers-controls-i18n-translations-de.d.ts +3 -0
  22. package/types/ngneers-controls-i18n-translations-en.d.ts +3 -0
  23. package/types/ngneers-controls-i18n.d.ts +3 -0
  24. package/types/ngneers-controls-input-field.d.ts +3 -0
  25. package/types/ngneers-controls-list-box.d.ts +3 -0
  26. package/types/ngneers-controls-mask-input.d.ts +3 -0
  27. package/types/ngneers-controls-otp.d.ts +243 -0
  28. package/types/ngneers-controls-paginator.d.ts +3 -0
  29. package/types/ngneers-controls-select.d.ts +3 -0
  30. package/types/ngneers-controls-snackbar.d.ts +3 -0
  31. package/types/ngneers-controls-splitter.d.ts +12 -2
  32. package/types/ngneers-controls-table.d.ts +3 -0
  33. package/types/ngneers-controls-toast.d.ts +3 -0
  34. package/types/ngneers-controls-tree.d.ts +3 -0
  35. package/types/ngneers-controls-upload.d.ts +3 -0
@@ -0,0 +1,243 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import * as _ngneers_signal_translate from '@ngneers/signal-translate';
3
+ import * as _ngneers_controls_api_ng from '@ngneers/controls/api/ng';
4
+ import * as _ngneers_controls_themes from '@ngneers/controls-themes';
5
+ import { ValueControlBase } from '@ngneers/controls/base';
6
+
7
+ /**
8
+ * A one-time-password / verification-code input that splits a short code across
9
+ * a row of single-character cells (like the PrimeNG `InputOtp`).
10
+ *
11
+ * - Typing a character fills the active cell and advances focus to the next.
12
+ * - **Backspace** clears the active cell, or steps back and clears the previous
13
+ * one when the active cell is already empty.
14
+ * - **←/→** move between cells, **Home/End** jump to the first/last.
15
+ * - Pasting a code distributes its characters across the cells.
16
+ *
17
+ * It is a self-contained value control — bind `[value]`/`(valueChange)` (or
18
+ * `[(value)]`) directly on `<ngn-otp>`. The value is the composed string
19
+ * (`null` while every cell is empty); {@link completed} fires once the whole
20
+ * code is filled.
21
+ *
22
+ * @category control
23
+ */
24
+ declare class NgnOtp extends ValueControlBase<'otp', string | null> {
25
+ protected readonly theme: _ngneers_controls_api_ng.ControlTemplateInfo<_ngneers_controls_themes.ControlTemplate<"otp", ["root", "box", "invalid"], readonly []>>;
26
+ protected readonly i18n: _ngneers_signal_translate.TranslationsSignal<{
27
+ calendar: {
28
+ today: string;
29
+ input: string;
30
+ selectYear: string;
31
+ selectMonth: string;
32
+ previousMonth: string;
33
+ nextMonth: string;
34
+ weekdays: {
35
+ monday: string;
36
+ tuesday: string;
37
+ wednesday: string;
38
+ thursday: string;
39
+ friday: string;
40
+ saturday: string;
41
+ sunday: string;
42
+ };
43
+ weekdaysShort: {
44
+ monday: string;
45
+ tuesday: string;
46
+ wednesday: string;
47
+ thursday: string;
48
+ friday: string;
49
+ saturday: string;
50
+ sunday: string;
51
+ };
52
+ months: {
53
+ january: string;
54
+ february: string;
55
+ march: string;
56
+ april: string;
57
+ may: string;
58
+ june: string;
59
+ july: string;
60
+ august: string;
61
+ september: string;
62
+ october: string;
63
+ november: string;
64
+ december: string;
65
+ };
66
+ };
67
+ editInplace: {
68
+ placeholder: string;
69
+ confirm: string;
70
+ };
71
+ filter: {
72
+ noFilter: string;
73
+ addCondition: string;
74
+ removeCondition: string;
75
+ operator: string;
76
+ value: string;
77
+ clear: string;
78
+ apply: string;
79
+ cancel: string;
80
+ matchModeLabel: string;
81
+ match: {
82
+ all: string;
83
+ any: string;
84
+ and: string;
85
+ or: string;
86
+ };
87
+ selected: string;
88
+ conditions: string;
89
+ operators: {
90
+ isEqual: string;
91
+ isNotEqual: string;
92
+ contains: string;
93
+ startsWith: string;
94
+ endsWith: string;
95
+ in: string;
96
+ isEmpty: string;
97
+ isNotEmpty: string;
98
+ greaterThan: string;
99
+ greaterThanOrEqual: string;
100
+ lessThan: string;
101
+ lessThanOrEqual: string;
102
+ after: string;
103
+ onOrAfter: string;
104
+ before: string;
105
+ onOrBefore: string;
106
+ isTrue: string;
107
+ isFalse: string;
108
+ custom: string;
109
+ };
110
+ };
111
+ splitter: {
112
+ handleLabel: string;
113
+ };
114
+ inputField: {
115
+ clearInput: string;
116
+ };
117
+ maskInput: {
118
+ roleDescription: string;
119
+ segmentRange: string;
120
+ optionSeparator: string;
121
+ };
122
+ otp: {
123
+ cellLabel: string;
124
+ };
125
+ drawer: {
126
+ close: string;
127
+ };
128
+ dialog: {
129
+ close: string;
130
+ };
131
+ chip: {
132
+ close: string;
133
+ };
134
+ breadcrumb: {
135
+ overflow: string;
136
+ };
137
+ toast: {
138
+ close: string;
139
+ region: string;
140
+ };
141
+ snackbar: {
142
+ close: string;
143
+ region: string;
144
+ severity: {
145
+ error: string;
146
+ warning: string;
147
+ success: string;
148
+ info: string;
149
+ };
150
+ };
151
+ upload: {
152
+ upload: string;
153
+ uploadNamed: string;
154
+ retryNamed: string;
155
+ cancelNamed: string;
156
+ removeNamed: string;
157
+ progressNamed: string;
158
+ };
159
+ select: {
160
+ filterOptions: string;
161
+ };
162
+ paginator: {
163
+ previousPage: string;
164
+ nextPage: string;
165
+ };
166
+ listBox: {
167
+ noItemsFound: string;
168
+ };
169
+ tree: {
170
+ noItemsFound: string;
171
+ };
172
+ table: {
173
+ selectAllRows: string;
174
+ selectRow: string;
175
+ sortedBy: string;
176
+ sortAscending: string;
177
+ sortDescending: string;
178
+ sortCleared: string;
179
+ selectedCount: string;
180
+ page: string;
181
+ resultCount: string;
182
+ };
183
+ state: {
184
+ loading: string;
185
+ success: string;
186
+ warning: string;
187
+ error: string;
188
+ cancelled: string;
189
+ };
190
+ }, "_">;
191
+ /**
192
+ * The number of character cells the code is split across.
193
+ * @default 6
194
+ */
195
+ readonly length: _angular_core.InputSignalWithTransform<number, unknown>;
196
+ /**
197
+ * Render each entered character as a masked dot instead of the character
198
+ * itself (like a password field).
199
+ * @default false
200
+ */
201
+ readonly mask: _angular_core.InputSignalWithTransform<boolean, unknown>;
202
+ /**
203
+ * Restrict entry to digits (`0`–`9`) only. Also switches the on-screen
204
+ * keyboard to numeric on touch devices.
205
+ * @default false
206
+ */
207
+ readonly integerOnly: _angular_core.InputSignalWithTransform<boolean, unknown>;
208
+ /** Emits the fully composed code once every cell holds a character. */
209
+ readonly completed: _angular_core.OutputEmitterRef<string>;
210
+ /** Per-cell characters — the source of truth the composed value derives from. */
211
+ protected readonly cells: _angular_core.WritableSignal<string[]>;
212
+ /** Effective, sanitized cell count. */
213
+ protected readonly appliedLength: _angular_core.Signal<number>;
214
+ /** Cell indices for the template `@for` loop. */
215
+ protected readonly indices: _angular_core.Signal<number[]>;
216
+ protected readonly boxType: _angular_core.Signal<"text" | "password">;
217
+ protected readonly boxInputMode: _angular_core.Signal<"text" | "numeric">;
218
+ private readonly _boxes;
219
+ constructor();
220
+ /** Accessible name for a cell — its 1-based position within the code. */
221
+ protected cellLabel(index: number): string;
222
+ /**
223
+ * The control fully owns each cell's value: every text mutation is cancelled
224
+ * and the character is written to the {@link cells} signal instead, which the
225
+ * `[value]` binding reflects back. This makes overtype work from any caret
226
+ * position (no `maxlength`/selection tricks) and lets a single multi-character
227
+ * insert — e.g. SMS one-time-code autofill — spread across the cells.
228
+ */
229
+ protected onBeforeInput(index: number, event: InputEvent): void;
230
+ protected onKeyDown(index: number, event: KeyboardEvent): void;
231
+ protected onPaste(event: ClipboardEvent): void;
232
+ /** Clears every cell (also serves a surrounding field's clear button). */
233
+ clearValue(): boolean;
234
+ private _setCell;
235
+ /** Writes `text` into consecutive cells starting at `start`, then focuses the
236
+ * next empty cell (or the last one). Used by typing and autofill. */
237
+ private _fillFrom;
238
+ private _focusCell;
239
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgnOtp, never>;
240
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgnOtp, "ngn-otp", never, { "length": { "alias": "length"; "required": false; "isSignal": true; }; "mask": { "alias": "mask"; "required": false; "isSignal": true; }; "integerOnly": { "alias": "integerOnly"; "required": false; "isSignal": true; }; }, { "completed": "completed"; }, never, never, true, never>;
241
+ }
242
+
243
+ export { NgnOtp };
@@ -142,6 +142,9 @@ declare class NgnPaginator extends NgnBase<'paginator'> {
142
142
  segmentRange: string;
143
143
  optionSeparator: string;
144
144
  };
145
+ otp: {
146
+ cellLabel: string;
147
+ };
145
148
  drawer: {
146
149
  close: string;
147
150
  };
@@ -225,6 +225,9 @@ declare class NgnSelect<V, Editable extends boolean = false, Multiple extends bo
225
225
  segmentRange: string;
226
226
  optionSeparator: string;
227
227
  };
228
+ otp: {
229
+ cellLabel: string;
230
+ };
228
231
  drawer: {
229
232
  close: string;
230
233
  };
@@ -164,6 +164,9 @@ declare class NgnSnackbar extends SnackbarTemplates implements OnInit {
164
164
  segmentRange: string;
165
165
  optionSeparator: string;
166
166
  };
167
+ otp: {
168
+ cellLabel: string;
169
+ };
167
170
  drawer: {
168
171
  close: string;
169
172
  };
@@ -276,6 +276,9 @@ declare class NgnSplitter extends NgnBase<'splitter'> implements OnDestroy {
276
276
  segmentRange: string;
277
277
  optionSeparator: string;
278
278
  };
279
+ otp: {
280
+ cellLabel: string;
281
+ };
279
282
  drawer: {
280
283
  close: string;
281
284
  };
@@ -443,13 +446,20 @@ declare class NgnSplitter extends NgnBase<'splitter'> implements OnDestroy {
443
446
  private onStateLoad;
444
447
  private ensureValidState;
445
448
  private applyFromState;
449
+ /** Cached divider positions (percentage) measured post-layout; see the after-render effect in the constructor. */
450
+ private readonly _dividerValues;
446
451
  /**
447
452
  * The divider's current position as a percentage (0–100) of the total panel
448
453
  * content size, used for `aria-valuenow` on the `role="separator"` handle.
449
- * Reads `gridTemplateSizes()` to stay reactive to resizes, then measures the
450
- * rendered panel sizes on either side of the divider.
454
+ * Reads the cached value measured in the after-render phase.
451
455
  */
452
456
  protected dividerValueNow(index: number): number;
457
+ /**
458
+ * Measures each divider's position as a percentage (0–100) of the total panel
459
+ * content size. Reads `gridTemplateSizes()`, `elementSize()` and `dragContext()`
460
+ * as reactive triggers, then measures the rendered panel sizes.
461
+ */
462
+ private measureDividerValues;
453
463
  private getStepInPx;
454
464
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgnSplitter, never>;
455
465
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgnSplitter, "ngn-splitter", never, { "layout": { "alias": "layout"; "required": true; "isSignal": true; }; "panelOrder": { "alias": "panelOrder"; "required": false; "isSignal": true; }; "stateStorage": { "alias": "stateStorage"; "required": false; "isSignal": true; }; "stateKey": { "alias": "stateKey"; "required": false; "isSignal": true; }; "stateData": { "alias": "stateData"; "required": false; "isSignal": true; }; "calculatorType": { "alias": "calculatorType"; "required": false; "isSignal": true; }; "resizeMode": { "alias": "resizeMode"; "required": false; "isSignal": true; }; "lockSizes": { "alias": "lockSizes"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; }, { "layout": "layoutChange"; "panelOrder": "panelOrderChange"; "stateSaving": "stateSaving"; "stateLoading": "stateLoading"; }, ["panels"], ["*"], true, never>;
@@ -817,6 +817,9 @@ declare class NgnTable<T extends object, K extends keyof T, G extends Extract<Al
817
817
  segmentRange: string;
818
818
  optionSeparator: string;
819
819
  };
820
+ otp: {
821
+ cellLabel: string;
822
+ };
820
823
  drawer: {
821
824
  close: string;
822
825
  };
@@ -159,6 +159,9 @@ declare class NgnToast extends ToastTemplates implements OnInit {
159
159
  segmentRange: string;
160
160
  optionSeparator: string;
161
161
  };
162
+ otp: {
163
+ cellLabel: string;
164
+ };
162
165
  drawer: {
163
166
  close: string;
164
167
  };
@@ -217,6 +217,9 @@ declare class NgnTree<Items extends readonly NgnTreeItem[], Multiple extends boo
217
217
  segmentRange: string;
218
218
  optionSeparator: string;
219
219
  };
220
+ otp: {
221
+ cellLabel: string;
222
+ };
220
223
  drawer: {
221
224
  close: string;
222
225
  };
@@ -171,6 +171,9 @@ declare class NgnUpload extends NgnBase<'upload'> {
171
171
  segmentRange: string;
172
172
  optionSeparator: string;
173
173
  };
174
+ otp: {
175
+ cellLabel: string;
176
+ };
174
177
  drawer: {
175
178
  close: string;
176
179
  };