@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.
- package/fesm2022/ngneers-controls-api-resize.mjs +7 -0
- package/fesm2022/ngneers-controls-api-resize.mjs.map +1 -1
- package/fesm2022/ngneers-controls-i18n-translations-de.mjs +3 -0
- package/fesm2022/ngneers-controls-i18n-translations-de.mjs.map +1 -1
- package/fesm2022/ngneers-controls-i18n-translations-en.mjs +3 -0
- package/fesm2022/ngneers-controls-i18n-translations-en.mjs.map +1 -1
- package/fesm2022/ngneers-controls-otp.mjs +251 -0
- package/fesm2022/ngneers-controls-otp.mjs.map +1 -0
- package/fesm2022/ngneers-controls-splitter.mjs +43 -12
- package/fesm2022/ngneers-controls-splitter.mjs.map +1 -1
- package/fesm2022/ngneers-controls-toggle-button.mjs +2 -2
- package/fesm2022/ngneers-controls-toggle-button.mjs.map +1 -1
- package/package.json +6 -2
- package/types/ngneers-controls-breadcrumb.d.ts +3 -0
- package/types/ngneers-controls-calendar.d.ts +3 -0
- package/types/ngneers-controls-chip.d.ts +3 -0
- package/types/ngneers-controls-dialog.d.ts +3 -0
- package/types/ngneers-controls-drawer.d.ts +3 -0
- package/types/ngneers-controls-edit-inplace.d.ts +3 -0
- package/types/ngneers-controls-filter.d.ts +3 -0
- package/types/ngneers-controls-i18n-translations-de.d.ts +3 -0
- package/types/ngneers-controls-i18n-translations-en.d.ts +3 -0
- package/types/ngneers-controls-i18n.d.ts +3 -0
- package/types/ngneers-controls-input-field.d.ts +3 -0
- package/types/ngneers-controls-list-box.d.ts +3 -0
- package/types/ngneers-controls-mask-input.d.ts +3 -0
- package/types/ngneers-controls-otp.d.ts +243 -0
- package/types/ngneers-controls-paginator.d.ts +3 -0
- package/types/ngneers-controls-select.d.ts +3 -0
- package/types/ngneers-controls-snackbar.d.ts +3 -0
- package/types/ngneers-controls-splitter.d.ts +12 -2
- package/types/ngneers-controls-table.d.ts +3 -0
- package/types/ngneers-controls-toast.d.ts +3 -0
- package/types/ngneers-controls-tree.d.ts +3 -0
- 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 };
|
|
@@ -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
|
|
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>;
|