@exhaustive-ui/core 22.0.0-rc.2 → 22.0.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/README.md +1 -1
- package/fesm2022/exhaustive-ui-core-accordion.mjs +5 -0
- package/fesm2022/exhaustive-ui-core-accordion.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-autocomplete.mjs +12 -14
- package/fesm2022/exhaustive-ui-core-autocomplete.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-avatargroup.mjs +3 -9
- package/fesm2022/exhaustive-ui-core-avatargroup.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-badge.mjs +3 -34
- package/fesm2022/exhaustive-ui-core-badge.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-basecomponent.mjs +3 -0
- package/fesm2022/exhaustive-ui-core-basecomponent.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-baseinput.mjs +27 -7
- package/fesm2022/exhaustive-ui-core-baseinput.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-blockui.mjs +13 -1
- package/fesm2022/exhaustive-ui-core-blockui.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-breadcrumb.mjs +1 -1
- package/fesm2022/exhaustive-ui-core-breadcrumb.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-button.mjs +10 -34
- package/fesm2022/exhaustive-ui-core-button.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-carousel.mjs +5 -0
- package/fesm2022/exhaustive-ui-core-carousel.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-cascadeselect.mjs +25 -11
- package/fesm2022/exhaustive-ui-core-cascadeselect.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-checkbox.mjs +1 -1
- package/fesm2022/exhaustive-ui-core-checkbox.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-config.mjs +1 -8
- package/fesm2022/exhaustive-ui-core-config.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-confirmdialog.mjs +1 -1
- package/fesm2022/exhaustive-ui-core-confirmdialog.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-confirmpopup.mjs +3 -8
- package/fesm2022/exhaustive-ui-core-confirmpopup.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-contextmenu.mjs +16 -3
- package/fesm2022/exhaustive-ui-core-contextmenu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dataview.mjs +2 -14
- package/fesm2022/exhaustive-ui-core-dataview.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-datepicker.mjs +38 -4
- package/fesm2022/exhaustive-ui-core-datepicker.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dialog.mjs +12 -7
- package/fesm2022/exhaustive-ui-core-dialog.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dock.mjs +1 -1
- package/fesm2022/exhaustive-ui-core-dock.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dom.mjs +9 -2
- package/fesm2022/exhaustive-ui-core-dom.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-drawer.mjs +6 -6
- package/fesm2022/exhaustive-ui-core-drawer.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dynamicdialog.mjs +19 -19
- package/fesm2022/exhaustive-ui-core-dynamicdialog.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-editor.mjs +11 -0
- package/fesm2022/exhaustive-ui-core-editor.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-fileupload.mjs +4 -1
- package/fesm2022/exhaustive-ui-core-fileupload.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-galleria.mjs +12 -0
- package/fesm2022/exhaustive-ui-core-galleria.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-image.mjs +7 -0
- package/fesm2022/exhaustive-ui-core-image.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-imagecompare.mjs +5 -5
- package/fesm2022/exhaustive-ui-core-imagecompare.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inplace.mjs +6 -32
- package/fesm2022/exhaustive-ui-core-inplace.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputgroupaddon.mjs +3 -9
- package/fesm2022/exhaustive-ui-core-inputgroupaddon.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputmask.mjs +54 -27
- package/fesm2022/exhaustive-ui-core-inputmask.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputnumber.mjs +9 -11
- package/fesm2022/exhaustive-ui-core-inputnumber.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputotp.mjs +8 -3
- package/fesm2022/exhaustive-ui-core-inputotp.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputtext.mjs +6 -14
- package/fesm2022/exhaustive-ui-core-inputtext.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-listbox.mjs +53 -20
- package/fesm2022/exhaustive-ui-core-listbox.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-megamenu.mjs +4 -1
- package/fesm2022/exhaustive-ui-core-megamenu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-menu.mjs +11 -5
- package/fesm2022/exhaustive-ui-core-menu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-menubar.mjs +8 -2
- package/fesm2022/exhaustive-ui-core-menubar.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-message.mjs +5 -10
- package/fesm2022/exhaustive-ui-core-message.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-metergroup.mjs +3 -0
- package/fesm2022/exhaustive-ui-core-metergroup.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-motion.mjs +10 -1
- package/fesm2022/exhaustive-ui-core-motion.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-multiselect.mjs +77 -38
- package/fesm2022/exhaustive-ui-core-multiselect.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-orderlist.mjs +14 -19
- package/fesm2022/exhaustive-ui-core-orderlist.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-organizationchart.mjs +3 -1
- package/fesm2022/exhaustive-ui-core-organizationchart.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-overlay.mjs +28 -0
- package/fesm2022/exhaustive-ui-core-overlay.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-panel.mjs +12 -2
- package/fesm2022/exhaustive-ui-core-panel.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-panelmenu.mjs +61 -13
- package/fesm2022/exhaustive-ui-core-panelmenu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-password.mjs +37 -26
- package/fesm2022/exhaustive-ui-core-password.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-picklist.mjs +11 -25
- package/fesm2022/exhaustive-ui-core-picklist.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-popover.mjs +2 -2
- package/fesm2022/exhaustive-ui-core-popover.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-radiobutton.mjs +8 -4
- package/fesm2022/exhaustive-ui-core-radiobutton.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-scroller.mjs +91 -10
- package/fesm2022/exhaustive-ui-core-scroller.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-select.mjs +36 -4
- package/fesm2022/exhaustive-ui-core-select.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-selectbutton.mjs +3 -8
- package/fesm2022/exhaustive-ui-core-selectbutton.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-slider.mjs +6 -0
- package/fesm2022/exhaustive-ui-core-slider.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-speeddial.mjs +1 -1
- package/fesm2022/exhaustive-ui-core-speeddial.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-splitbutton.mjs +1 -1
- package/fesm2022/exhaustive-ui-core-splitbutton.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-stepper.mjs +7 -11
- package/fesm2022/exhaustive-ui-core-stepper.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-steps.mjs +1 -1
- package/fesm2022/exhaustive-ui-core-steps.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-table.mjs +227 -32
- package/fesm2022/exhaustive-ui-core-table.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-tabs.mjs +16 -1
- package/fesm2022/exhaustive-ui-core-tabs.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-textarea.mjs +1 -1
- package/fesm2022/exhaustive-ui-core-textarea.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-tieredmenu.mjs +60 -16
- package/fesm2022/exhaustive-ui-core-tieredmenu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-toast.mjs +6 -2
- package/fesm2022/exhaustive-ui-core-toast.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-toggleswitch.mjs +2 -9
- package/fesm2022/exhaustive-ui-core-toggleswitch.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-tooltip.mjs +9 -17
- package/fesm2022/exhaustive-ui-core-tooltip.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-tree.mjs +99 -28
- package/fesm2022/exhaustive-ui-core-tree.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-treeselect.mjs +1 -1
- package/fesm2022/exhaustive-ui-core-treeselect.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-treetable.mjs +75 -19
- package/fesm2022/exhaustive-ui-core-treetable.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-utils.mjs +15 -0
- package/fesm2022/exhaustive-ui-core-utils.mjs.map +1 -1
- package/package.json +5 -5
- package/schematics/collection.json +1 -1
- package/schematics/migrate-from-primeng/index.js +2 -16
- package/schematics/migrate-from-primeng/schema.json +1 -2
- package/schematics/migrations/config-input-style-to-variant/migration.js +70 -0
- package/schematics/migrations/remove-dead-inputs/migration.js +46 -7
- package/schematics/migrations/removed-exports/migration.js +73 -0
- package/schematics/migrations/renamed-inputs/migration.js +54 -3
- package/schematics/migrations/renamed-outputs/migration.js +89 -0
- package/schematics/migrations/renamed-templates/migration.js +59 -0
- package/schematics/migrations/styleclass-to-class/migration.js +5 -0
- package/schematics/migrations.json +23 -3
- package/schematics/utils/config-signal.js +115 -0
- package/schematics/utils/removed-exports.js +172 -0
- package/schematics/utils/removed-inputs.js +0 -0
- package/schematics/utils/renamed-inputs.js +20 -9
- package/schematics/utils/renamed-outputs.js +154 -0
- package/schematics/utils/renamed-templates.js +142 -0
- package/schematics/utils/versions.json +8 -8
- package/types/exhaustive-ui-core-api.d.ts +0 -10
- package/types/exhaustive-ui-core-autocomplete.d.ts +4 -9
- package/types/exhaustive-ui-core-avatargroup.d.ts +1 -6
- package/types/exhaustive-ui-core-badge.d.ts +1 -14
- package/types/exhaustive-ui-core-basecomponent.d.ts +3 -0
- package/types/exhaustive-ui-core-baseinput.d.ts +3 -3
- package/types/exhaustive-ui-core-button.d.ts +4 -25
- package/types/exhaustive-ui-core-cascadeselect.d.ts +5 -2
- package/types/exhaustive-ui-core-config.d.ts +0 -8
- package/types/exhaustive-ui-core-confirmpopup.d.ts +1 -6
- package/types/exhaustive-ui-core-contextmenu.d.ts +3 -0
- package/types/exhaustive-ui-core-dataview.d.ts +1 -11
- package/types/exhaustive-ui-core-datepicker.d.ts +1 -0
- package/types/exhaustive-ui-core-dialog.d.ts +1 -1
- package/types/exhaustive-ui-core-drawer.d.ts +2 -2
- package/types/exhaustive-ui-core-dynamicdialog.d.ts +3 -12
- package/types/exhaustive-ui-core-editor.d.ts +5 -0
- package/types/exhaustive-ui-core-fileupload.d.ts +3 -0
- package/types/exhaustive-ui-core-galleria.d.ts +12 -0
- package/types/exhaustive-ui-core-image.d.ts +1 -0
- package/types/exhaustive-ui-core-imagecompare.d.ts +2 -2
- package/types/exhaustive-ui-core-inplace.d.ts +3 -11
- package/types/exhaustive-ui-core-inputgroupaddon.d.ts +1 -6
- package/types/exhaustive-ui-core-inputmask.d.ts +2 -2
- package/types/exhaustive-ui-core-inputtext.d.ts +3 -10
- package/types/exhaustive-ui-core-listbox.d.ts +12 -6
- package/types/exhaustive-ui-core-megamenu.d.ts +3 -0
- package/types/exhaustive-ui-core-menu.d.ts +6 -11
- package/types/exhaustive-ui-core-menubar.d.ts +5 -11
- package/types/exhaustive-ui-core-message.d.ts +1 -8
- package/types/exhaustive-ui-core-metergroup.d.ts +3 -0
- package/types/exhaustive-ui-core-multiselect.d.ts +13 -10
- package/types/exhaustive-ui-core-orderlist.d.ts +2 -12
- package/types/exhaustive-ui-core-organizationchart.d.ts +3 -1
- package/types/exhaustive-ui-core-overlay.d.ts +8 -0
- package/types/exhaustive-ui-core-panel.d.ts +2 -0
- package/types/exhaustive-ui-core-panelmenu.d.ts +9 -0
- package/types/exhaustive-ui-core-password.d.ts +19 -14
- package/types/exhaustive-ui-core-picklist.d.ts +1 -16
- package/types/exhaustive-ui-core-radiobutton.d.ts +4 -1
- package/types/exhaustive-ui-core-scroller.d.ts +10 -0
- package/types/exhaustive-ui-core-select.d.ts +11 -27
- package/types/exhaustive-ui-core-selectbutton.d.ts +1 -6
- package/types/exhaustive-ui-core-stepper.d.ts +3 -11
- package/types/exhaustive-ui-core-table.d.ts +32 -4
- package/types/exhaustive-ui-core-tieredmenu.d.ts +8 -0
- package/types/exhaustive-ui-core-toast.d.ts +3 -0
- package/types/exhaustive-ui-core-toggleswitch.d.ts +1 -7
- package/types/exhaustive-ui-core-tooltip.d.ts +3 -10
- package/types/exhaustive-ui-core-tree.d.ts +17 -1
- package/types/exhaustive-ui-core-treetable.d.ts +24 -5
- package/types/exhaustive-ui-core-types-multiselect.d.ts +0 -6
- package/types/exhaustive-ui-core-types-table.d.ts +1 -1
- package/types/exhaustive-ui-core-types-tree.d.ts +5 -0
- package/types/exhaustive-ui-core-utils.d.ts +15 -0
|
@@ -123,6 +123,21 @@ var InputMaskClasses;
|
|
|
123
123
|
*/
|
|
124
124
|
const INPUTMASK_INSTANCE = new InjectionToken('INPUTMASK_INSTANCE');
|
|
125
125
|
const INPUTMASK_DIRECTIVE_INSTANCE = new InjectionToken('INPUTMASK_DIRECTIVE_INSTANCE');
|
|
126
|
+
/**
|
|
127
|
+
* Splits a mask into its characters; a backslash makes the next character a literal, so '+\\9 999' keeps its '9' prefix.
|
|
128
|
+
*/
|
|
129
|
+
function maskTokens(mask) {
|
|
130
|
+
const tokens = [];
|
|
131
|
+
for (let i = 0; i < mask.length; i++) {
|
|
132
|
+
if (mask[i] === '\\' && i + 1 < mask.length) {
|
|
133
|
+
tokens.push({ char: mask[++i], literal: true });
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
tokens.push({ char: mask[i], literal: false });
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return tokens;
|
|
140
|
+
}
|
|
126
141
|
/**
|
|
127
142
|
* InputMask directive is applied directly to input elements to enable masked input.
|
|
128
143
|
* @group Components
|
|
@@ -145,7 +160,7 @@ class InputMaskDirective extends BaseComponent {
|
|
|
145
160
|
pInputMaskUnstyled = input(/* @ts-ignore */
|
|
146
161
|
...(ngDevMode ? [undefined, { debugName: "pInputMaskUnstyled" }] : /* istanbul ignore next */ []));
|
|
147
162
|
/**
|
|
148
|
-
* Mask pattern.
|
|
163
|
+
* Mask pattern. A backslash makes the next character a literal, e.g. mask="+\9 999" for a fixed '+9' prefix.
|
|
149
164
|
* @group Props
|
|
150
165
|
*/
|
|
151
166
|
pInputMask = input(/* @ts-ignore */
|
|
@@ -188,8 +203,9 @@ class InputMaskDirective extends BaseComponent {
|
|
|
188
203
|
return { defs: undefined, tests: undefined, partialPosition: undefined, firstNonMaskPos: undefined, lastRequiredNonMaskPos: undefined, len: undefined, buffer: undefined, defaultBuffer: undefined };
|
|
189
204
|
}
|
|
190
205
|
const tests = [];
|
|
191
|
-
|
|
192
|
-
let
|
|
206
|
+
const tokens = maskTokens(maskValue);
|
|
207
|
+
let partialPosition = tokens.length;
|
|
208
|
+
let len = tokens.length;
|
|
193
209
|
let firstNonMaskPos = null;
|
|
194
210
|
let lastRequiredNonMaskPos;
|
|
195
211
|
const defs = {
|
|
@@ -197,14 +213,13 @@ class InputMaskDirective extends BaseComponent {
|
|
|
197
213
|
a: this.characterPattern(),
|
|
198
214
|
'*': `${this.characterPattern()}|[0-9]`
|
|
199
215
|
};
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
if (c == '?') {
|
|
216
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
217
|
+
const { char: c, literal } = tokens[i];
|
|
218
|
+
if (c == '?' && !literal) {
|
|
204
219
|
len--;
|
|
205
220
|
partialPosition = i;
|
|
206
221
|
}
|
|
207
|
-
else if (defs[c]) {
|
|
222
|
+
else if (!literal && defs[c]) {
|
|
208
223
|
tests.push(new RegExp(defs[c]));
|
|
209
224
|
if (firstNonMaskPos === null) {
|
|
210
225
|
firstNonMaskPos = tests.length - 1;
|
|
@@ -218,10 +233,10 @@ class InputMaskDirective extends BaseComponent {
|
|
|
218
233
|
}
|
|
219
234
|
}
|
|
220
235
|
const buffer = [];
|
|
221
|
-
for (let i = 0; i <
|
|
222
|
-
const c =
|
|
223
|
-
if (c != '?') {
|
|
224
|
-
if (defs[c])
|
|
236
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
237
|
+
const { char: c, literal } = tokens[i];
|
|
238
|
+
if (c != '?' || literal) {
|
|
239
|
+
if (!literal && defs[c])
|
|
225
240
|
buffer.push(this.getPlaceholder(i));
|
|
226
241
|
else
|
|
227
242
|
buffer.push(c);
|
|
@@ -313,7 +328,7 @@ class InputMaskDirective extends BaseComponent {
|
|
|
313
328
|
return;
|
|
314
329
|
}
|
|
315
330
|
this.writeBuffer();
|
|
316
|
-
if (pos == this.
|
|
331
|
+
if (pos == this.len()) {
|
|
317
332
|
this.caret(0, pos);
|
|
318
333
|
}
|
|
319
334
|
else {
|
|
@@ -568,6 +583,9 @@ class InputMaskDirective extends BaseComponent {
|
|
|
568
583
|
while (pos.begin < this.firstNonMaskPos() && !this.tests()[pos.begin])
|
|
569
584
|
pos.begin++;
|
|
570
585
|
}
|
|
586
|
+
// checkVal() rewrote the value and sent the caret to the end: put it back now so it does not flicker,
|
|
587
|
+
// and again after the keyboard has finished its own update
|
|
588
|
+
this.caret(pos.begin, pos.begin);
|
|
571
589
|
setTimeout(() => {
|
|
572
590
|
this.caret(pos.begin, pos.begin);
|
|
573
591
|
this.onUnmaskedChange.emit(this.getUnmaskedValue());
|
|
@@ -586,6 +604,9 @@ class InputMaskDirective extends BaseComponent {
|
|
|
586
604
|
while (pos.begin < this.len() && !this.tests()[pos.begin])
|
|
587
605
|
pos.begin++;
|
|
588
606
|
}
|
|
607
|
+
// checkVal() rewrote the value and sent the caret to the end: put it back now so it does not flicker,
|
|
608
|
+
// and again after the keyboard has finished its own update
|
|
609
|
+
this.caret(pos.begin, pos.begin);
|
|
589
610
|
setTimeout(() => {
|
|
590
611
|
this.caret(pos.begin, pos.begin);
|
|
591
612
|
this.onUnmaskedChange.emit(this.getUnmaskedValue());
|
|
@@ -874,7 +895,7 @@ class InputMask extends BaseInput {
|
|
|
874
895
|
*/
|
|
875
896
|
keepBuffer = input(false, { ...(ngDevMode ? { debugName: "keepBuffer" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
876
897
|
/**
|
|
877
|
-
* Mask pattern.
|
|
898
|
+
* Mask pattern. A backslash makes the next character a literal, e.g. mask="+\9 999" for a fixed '+9' prefix.
|
|
878
899
|
* @group Props
|
|
879
900
|
*/
|
|
880
901
|
mask = input(/* @ts-ignore */
|
|
@@ -930,8 +951,9 @@ class InputMask extends BaseInput {
|
|
|
930
951
|
return { defs: undefined, tests: undefined, partialPosition: undefined, firstNonMaskPos: undefined, lastRequiredNonMaskPos: undefined, len: undefined, buffer: undefined, defaultBuffer: undefined };
|
|
931
952
|
}
|
|
932
953
|
const tests = [];
|
|
933
|
-
|
|
934
|
-
let
|
|
954
|
+
const tokens = maskTokens(mask);
|
|
955
|
+
let partialPosition = tokens.length;
|
|
956
|
+
let len = tokens.length;
|
|
935
957
|
let firstNonMaskPos = null;
|
|
936
958
|
let lastRequiredNonMaskPos;
|
|
937
959
|
const defs = {
|
|
@@ -939,14 +961,13 @@ class InputMask extends BaseInput {
|
|
|
939
961
|
a: this.characterPattern(),
|
|
940
962
|
'*': `${this.characterPattern()}|[0-9]`
|
|
941
963
|
};
|
|
942
|
-
let
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
if (c == '?') {
|
|
964
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
965
|
+
const { char: c, literal } = tokens[i];
|
|
966
|
+
if (c == '?' && !literal) {
|
|
946
967
|
len--;
|
|
947
968
|
partialPosition = i;
|
|
948
969
|
}
|
|
949
|
-
else if (defs[c]) {
|
|
970
|
+
else if (!literal && defs[c]) {
|
|
950
971
|
tests.push(new RegExp(defs[c]));
|
|
951
972
|
if (firstNonMaskPos === null) {
|
|
952
973
|
firstNonMaskPos = tests.length - 1;
|
|
@@ -960,10 +981,10 @@ class InputMask extends BaseInput {
|
|
|
960
981
|
}
|
|
961
982
|
}
|
|
962
983
|
const buffer = [];
|
|
963
|
-
for (let i = 0; i <
|
|
964
|
-
|
|
965
|
-
if (c != '?') {
|
|
966
|
-
if (defs[c])
|
|
984
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
985
|
+
const { char: c, literal } = tokens[i];
|
|
986
|
+
if (c != '?' || literal) {
|
|
987
|
+
if (!literal && defs[c])
|
|
967
988
|
buffer.push(this.getPlaceholder(i));
|
|
968
989
|
else
|
|
969
990
|
buffer.push(c);
|
|
@@ -1118,6 +1139,9 @@ class InputMask extends BaseInput {
|
|
|
1118
1139
|
while (pos.begin < this.firstNonMaskPos() && !this.tests()[pos.begin])
|
|
1119
1140
|
pos.begin++;
|
|
1120
1141
|
}
|
|
1142
|
+
// checkVal() rewrote the value and sent the caret to the end: put it back now so it does not flicker,
|
|
1143
|
+
// and again after the keyboard has finished its own update
|
|
1144
|
+
this.caret(pos.begin, pos.begin);
|
|
1121
1145
|
setTimeout(() => {
|
|
1122
1146
|
this.caret(pos.begin, pos.begin);
|
|
1123
1147
|
this.updateModel(e);
|
|
@@ -1136,6 +1160,9 @@ class InputMask extends BaseInput {
|
|
|
1136
1160
|
while (pos.begin < this.len() && !this.tests()[pos.begin])
|
|
1137
1161
|
pos.begin++;
|
|
1138
1162
|
}
|
|
1163
|
+
// checkVal() rewrote the value and sent the caret to the end: put it back now so it does not flicker,
|
|
1164
|
+
// and again after the keyboard has finished its own update
|
|
1165
|
+
this.caret(pos.begin, pos.begin);
|
|
1139
1166
|
setTimeout(() => {
|
|
1140
1167
|
this.caret(pos.begin, pos.begin);
|
|
1141
1168
|
this.updateModel(e);
|
|
@@ -1355,7 +1382,7 @@ class InputMask extends BaseInput {
|
|
|
1355
1382
|
return;
|
|
1356
1383
|
}
|
|
1357
1384
|
this.writeBuffer();
|
|
1358
|
-
if (pos == this.
|
|
1385
|
+
if (pos == this.len()) {
|
|
1359
1386
|
this.caret(0, pos);
|
|
1360
1387
|
}
|
|
1361
1388
|
else {
|
|
@@ -1482,7 +1509,7 @@ class InputMask extends BaseInput {
|
|
|
1482
1509
|
</span>
|
|
1483
1510
|
}
|
|
1484
1511
|
}
|
|
1485
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: InputText, selector: "[pInputText]", inputs: ["hostName", "
|
|
1512
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: InputText, selector: "[pInputText]", inputs: ["hostName", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "directive", type: AutoFocus, selector: "[pAutoFocus]", inputs: ["pAutoFocus"] }, { kind: "component", type: TimesIcon, selector: "[data-p-icon=\"times\"]" }, { kind: "ngmodule", type: SharedModule }, { kind: "ngmodule", type: BindModule }, { kind: "directive", type: i1.Bind, selector: "[pBind]", inputs: ["pBind"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1486
1513
|
}
|
|
1487
1514
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: InputMask, decorators: [{
|
|
1488
1515
|
type: Component,
|