@aurodesignsystem-dev/auro-formkit 0.0.0-pr1498.0 → 0.0.0-pr1499.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/components/checkbox/demo/customize.min.js +2 -2
- package/components/checkbox/demo/getting-started.min.js +2 -2
- package/components/checkbox/demo/index.min.js +2 -2
- package/components/checkbox/dist/index.js +2 -2
- package/components/checkbox/dist/registered.js +2 -2
- package/components/combobox/demo/customize.md +3 -7
- package/components/combobox/demo/customize.min.js +1705 -1459
- package/components/combobox/demo/getting-started.min.js +1705 -1459
- package/components/combobox/demo/index.min.js +1705 -1459
- package/components/combobox/dist/auro-combobox.d.ts +0 -5
- package/components/combobox/dist/index.js +162 -491
- package/components/combobox/dist/registered.js +162 -491
- package/components/counter/demo/customize.min.js +19 -18
- package/components/counter/demo/index.min.js +19 -18
- package/components/counter/dist/index.js +187 -5442
- package/components/counter/dist/registered.js +187 -5442
- package/components/datepicker/demo/customize.md +477 -384
- package/components/datepicker/demo/customize.min.js +96 -161
- package/components/datepicker/demo/index.md +0 -1
- package/components/datepicker/demo/index.min.js +96 -161
- package/components/datepicker/dist/index.js +96 -161
- package/components/datepicker/dist/registered.js +96 -161
- package/components/datepicker/dist/src/auro-datepicker.d.ts +2 -2
- package/components/dropdown/demo/customize.min.js +17 -16
- package/components/dropdown/demo/getting-started.min.js +17 -16
- package/components/dropdown/demo/index.min.js +17 -16
- package/components/dropdown/dist/auro-dropdown.d.ts +2 -1
- package/components/dropdown/dist/index.js +17 -16
- package/components/dropdown/dist/registered.js +17 -16
- package/components/form/demo/customize.min.js +7965 -7884
- package/components/form/demo/getting-started.min.js +7965 -7884
- package/components/form/demo/index.min.js +7965 -7884
- package/components/form/demo/registerDemoDeps.min.js +7934 -7853
- package/components/input/demo/customize.md +539 -472
- package/components/input/demo/customize.min.js +61 -132
- package/components/input/demo/getting-started.min.js +61 -132
- package/components/input/demo/index.min.js +61 -132
- package/components/input/dist/base-input.d.ts +0 -16
- package/components/input/dist/index.js +61 -132
- package/components/input/dist/registered.js +61 -132
- package/components/menu/demo/api.md +45 -41
- package/components/menu/demo/customize.md +28 -0
- package/components/menu/demo/index.min.js +1358 -783
- package/components/menu/dist/auro-menu.context.d.ts +238 -0
- package/components/menu/dist/auro-menu.d.ts +110 -95
- package/components/menu/dist/auro-menuoption.d.ts +138 -32
- package/components/menu/dist/index.js +1312 -757
- package/components/menu/dist/registered.js +1312 -769
- package/components/radio/demo/customize.min.js +2 -2
- package/components/radio/demo/getting-started.min.js +2 -2
- package/components/radio/demo/index.min.js +2 -2
- package/components/radio/dist/index.js +2 -2
- package/components/radio/dist/registered.js +2 -2
- package/components/select/demo/customize.md +3 -7
- package/components/select/demo/customize.min.js +1634 -1089
- package/components/select/demo/getting-started.min.js +1634 -1089
- package/components/select/demo/index.min.js +1634 -1089
- package/components/select/dist/index.js +31 -61
- package/components/select/dist/registered.js +31 -61
- package/custom-elements.json +2085 -1439
- package/package.json +1 -1
- package/components/select/dist/selectUtils.d.ts +0 -12
|
@@ -4548,7 +4548,7 @@ class AuroFormValidation {
|
|
|
4548
4548
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input') && elem.errorMessage === '') {
|
|
4549
4549
|
const input = elem.renderRoot.querySelector('input');
|
|
4550
4550
|
|
|
4551
|
-
if (input
|
|
4551
|
+
if (input.validationMessage.length > 0) {
|
|
4552
4552
|
elem.errorMessage = input.validationMessage;
|
|
4553
4553
|
}
|
|
4554
4554
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-combobox') && elem.errorMessage === '') {
|
|
@@ -10220,7 +10220,11 @@ class AuroInputUtilities {
|
|
|
10220
10220
|
return part.value;
|
|
10221
10221
|
}
|
|
10222
10222
|
})
|
|
10223
|
-
.join("")
|
|
10223
|
+
.join("")
|
|
10224
|
+
// Remove whitespace and leading/trailing special characters for IMask compatibility
|
|
10225
|
+
// for example, ko-KR's format is `YYYY. MM. DD.` which causes issues with IMask if we don't remove the trailing period.
|
|
10226
|
+
.replace(/\s/gu, '')
|
|
10227
|
+
.replace(/^[^A-Z0-9]+|[^A-Z0-9]+$/gu, '');
|
|
10224
10228
|
}
|
|
10225
10229
|
|
|
10226
10230
|
/**
|
|
@@ -10385,6 +10389,7 @@ class AuroInputUtilities {
|
|
|
10385
10389
|
const maskOptions = this.getMaskOptions('date', normalizedFormat);
|
|
10386
10390
|
|
|
10387
10391
|
if (!(valueObject instanceof Date) || Number.isNaN(valueObject.getTime()) || !maskOptions || typeof maskOptions.format !== 'function') {
|
|
10392
|
+
console.debug('Invalid date object or mask options for formatting', { valueObject, maskOptions }); // eslint-disable-line no-console
|
|
10388
10393
|
return undefined;
|
|
10389
10394
|
}
|
|
10390
10395
|
|
|
@@ -11087,7 +11092,7 @@ class BaseInput extends AuroElement {
|
|
|
11087
11092
|
* @returns {Date|undefined}
|
|
11088
11093
|
*/
|
|
11089
11094
|
get valueObject() {
|
|
11090
|
-
return this._valueObject
|
|
11095
|
+
return this._valueObject;
|
|
11091
11096
|
}
|
|
11092
11097
|
|
|
11093
11098
|
/**
|
|
@@ -11095,7 +11100,7 @@ class BaseInput extends AuroElement {
|
|
|
11095
11100
|
* @returns {Date|undefined}
|
|
11096
11101
|
*/
|
|
11097
11102
|
get minObject() {
|
|
11098
|
-
return this._minObject
|
|
11103
|
+
return this._minObject;
|
|
11099
11104
|
}
|
|
11100
11105
|
|
|
11101
11106
|
/**
|
|
@@ -11103,31 +11108,7 @@ class BaseInput extends AuroElement {
|
|
|
11103
11108
|
* @returns {Date|undefined}
|
|
11104
11109
|
*/
|
|
11105
11110
|
get maxObject() {
|
|
11106
|
-
return this._maxObject
|
|
11107
|
-
}
|
|
11108
|
-
|
|
11109
|
-
/**
|
|
11110
|
-
* Parses a date string into a Date object when the corresponding `_*Object`
|
|
11111
|
-
* field hasn't been synced yet by `updated()`. Returns undefined when the
|
|
11112
|
-
* input type/format isn't a full date or the string is not a valid date.
|
|
11113
|
-
*
|
|
11114
|
-
* Why this exists: a parent (datepicker) can call `inputN.validate()` from
|
|
11115
|
-
* inside its own `updated()` before this input's `updated()` has run
|
|
11116
|
-
* `syncDateValues()` — so `_valueObject`/`_maxObject` are still `undefined`
|
|
11117
|
-
* and range checks would otherwise silently no-op (flipping the result to
|
|
11118
|
-
* `valid` or `patternMismatch`).
|
|
11119
|
-
* @private
|
|
11120
|
-
* @param {string|undefined} dateStr - ISO date string from `value`/`min`/`max`.
|
|
11121
|
-
* @returns {Date|undefined}
|
|
11122
|
-
*/
|
|
11123
|
-
_computeDateObjectFallback(dateStr) {
|
|
11124
|
-
if (!dateStr || !this.util || !this.util.isFullDateFormat(this.type, this.format)) {
|
|
11125
|
-
return undefined;
|
|
11126
|
-
}
|
|
11127
|
-
if (!dateFormatter.isValidDate(dateStr)) {
|
|
11128
|
-
return undefined;
|
|
11129
|
-
}
|
|
11130
|
-
return dateFormatter.stringToDateInstance(dateStr);
|
|
11111
|
+
return this._maxObject;
|
|
11131
11112
|
}
|
|
11132
11113
|
|
|
11133
11114
|
/**
|
|
@@ -11152,30 +11133,8 @@ class BaseInput extends AuroElement {
|
|
|
11152
11133
|
connectedCallback() {
|
|
11153
11134
|
super.connectedCallback();
|
|
11154
11135
|
|
|
11155
|
-
// Mark for query selectors when registered under a versioned tag (e.g. inside
|
|
11156
|
-
// a datepicker/combobox). Must run before parent components call validate() on
|
|
11157
|
-
// their inner inputs — the validation framework matches via tag-or-attribute,
|
|
11158
|
-
// and parents trigger validation during their own updated() cycle, which can
|
|
11159
|
-
// precede this input's firstUpdated().
|
|
11160
|
-
if (this.tagName.toLowerCase() !== 'auro-input' && !this.hasAttribute('auro-input')) {
|
|
11161
|
-
this.setAttribute('auro-input', '');
|
|
11162
|
-
}
|
|
11163
|
-
|
|
11164
11136
|
this.locale = this.domHandler.getLocale(this);
|
|
11165
11137
|
notifyOnLangChange(this);
|
|
11166
|
-
|
|
11167
|
-
// Pre-compute lengthForType and date-object fields so a parent (e.g. datepicker)
|
|
11168
|
-
// calling our validate() synchronously during its own updated() cycle sees
|
|
11169
|
-
// populated values. Without this, range validation silently no-ops because
|
|
11170
|
-
// `max.length === lengthForType` fails when lengthForType is still undefined.
|
|
11171
|
-
// Rebuild util here (constructor seeded with en-US default) so configureDataForType's
|
|
11172
|
-
// locale-derived format lookup uses the actual locale just resolved above.
|
|
11173
|
-
this.util = new AuroInputUtilities({
|
|
11174
|
-
locale: this.locale,
|
|
11175
|
-
format: this.format
|
|
11176
|
-
});
|
|
11177
|
-
this.configureDataForType();
|
|
11178
|
-
this.syncDateValues();
|
|
11179
11138
|
}
|
|
11180
11139
|
|
|
11181
11140
|
disconnectedCallback() {
|
|
@@ -11196,8 +11155,8 @@ class BaseInput extends AuroElement {
|
|
|
11196
11155
|
}
|
|
11197
11156
|
|
|
11198
11157
|
// add attribute for query selectors when auro-input is registered under a custom name
|
|
11199
|
-
if (this.tagName.toLowerCase() !== 'auro-input'
|
|
11200
|
-
this.setAttribute('auro-input',
|
|
11158
|
+
if (this.tagName.toLowerCase() !== 'auro-input') {
|
|
11159
|
+
this.setAttribute('auro-input', true);
|
|
11201
11160
|
}
|
|
11202
11161
|
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
11203
11162
|
|
|
@@ -11245,12 +11204,6 @@ class BaseInput extends AuroElement {
|
|
|
11245
11204
|
return;
|
|
11246
11205
|
}
|
|
11247
11206
|
|
|
11248
|
-
// While configureAutoFormatting is running, imask's internal updateControl
|
|
11249
|
-
// writes el.value to align display with the masked value. A synthetic input
|
|
11250
|
-
// event from that write would re-enter handleInput → processCreditCard mid-setup
|
|
11251
|
-
// and clobber a Lit value that was just pushed by the parent combobox.
|
|
11252
|
-
if (component._configuringMask) return;
|
|
11253
|
-
|
|
11254
11207
|
// If all guard clauses are passed, dispatch the event
|
|
11255
11208
|
const inputEvent = new InputEvent('input', {
|
|
11256
11209
|
bubbles: true,
|
|
@@ -11369,16 +11322,7 @@ class BaseInput extends AuroElement {
|
|
|
11369
11322
|
|
|
11370
11323
|
if (formattedValue !== this.inputElement.value) {
|
|
11371
11324
|
this.skipNextProgrammaticInputEvent = true;
|
|
11372
|
-
if (
|
|
11373
|
-
// Route through the mask so its _value and el.value stay in lock-step
|
|
11374
|
-
// (set value calls updateControl which writes el.value = displayValue).
|
|
11375
|
-
// Writing el.value directly leaves the mask thinking displayValue is
|
|
11376
|
-
// stale; _saveSelection on the next focus/click then warns. Scoped to
|
|
11377
|
-
// credit-card so date's own formattedValue (raw ISO when calendar-invalid)
|
|
11378
|
-
// isn't re-masked through the mm/dd/yyyy mask, which would truncate it
|
|
11379
|
-
// and flip validity from patternMismatch to tooShort.
|
|
11380
|
-
this.maskInstance.value = formattedValue || '';
|
|
11381
|
-
} else if (formattedValue) {
|
|
11325
|
+
if (formattedValue) {
|
|
11382
11326
|
this.inputElement.value = formattedValue;
|
|
11383
11327
|
} else {
|
|
11384
11328
|
this.inputElement.value = '';
|
|
@@ -11487,73 +11431,58 @@ class BaseInput extends AuroElement {
|
|
|
11487
11431
|
* @returns {void}
|
|
11488
11432
|
*/
|
|
11489
11433
|
configureAutoFormatting() {
|
|
11490
|
-
|
|
11491
|
-
|
|
11492
|
-
|
|
11493
|
-
// set value has finished its alignCursor pass.
|
|
11494
|
-
if (this._configuringMask) return;
|
|
11495
|
-
this._configuringMask = true;
|
|
11496
|
-
try {
|
|
11497
|
-
if (this.maskInstance) {
|
|
11498
|
-
this.maskInstance.destroy();
|
|
11499
|
-
}
|
|
11434
|
+
if (this.maskInstance) {
|
|
11435
|
+
this.maskInstance.destroy();
|
|
11436
|
+
}
|
|
11500
11437
|
|
|
11501
|
-
|
|
11502
|
-
|
|
11438
|
+
// Pass new format to util
|
|
11439
|
+
this.util.updateFormat(this.format);
|
|
11503
11440
|
|
|
11504
|
-
|
|
11505
|
-
|
|
11506
|
-
if (this.inputElement && maskOptions.mask) {
|
|
11507
|
-
|
|
11508
|
-
// Stash and clear any existing value before IMask init.
|
|
11509
|
-
// IMask's constructor processes the current input value which requires
|
|
11510
|
-
// selection state — clearing first avoids that scenario entirely.
|
|
11511
|
-
// When the format changes (e.g. locale switch) and we have a valid ISO
|
|
11512
|
-
// model value, compute the display string for the NEW format instead of
|
|
11513
|
-
// re-using the old display string, which may be invalid in the new mask.
|
|
11514
|
-
let existingValue = this.inputElement.value;
|
|
11515
|
-
if (
|
|
11516
|
-
this.util.isFullDateFormat(this.type, this.format) &&
|
|
11517
|
-
this.value &&
|
|
11518
|
-
dateFormatter.isValidDate(this.value) &&
|
|
11519
|
-
this.valueObject instanceof Date &&
|
|
11520
|
-
!Number.isNaN(this.valueObject.getTime()) &&
|
|
11521
|
-
typeof maskOptions.format === 'function'
|
|
11522
|
-
) {
|
|
11523
|
-
existingValue = maskOptions.format(this.valueObject);
|
|
11524
|
-
}
|
|
11441
|
+
const maskOptions = this.util.getMaskOptions(this.type, this.format);
|
|
11525
11442
|
|
|
11526
|
-
|
|
11527
|
-
this.inputElement.value = '';
|
|
11528
|
-
|
|
11529
|
-
this.maskInstance = IMask(this.inputElement, maskOptions);
|
|
11530
|
-
|
|
11531
|
-
this.maskInstance.on('accept', () => {
|
|
11532
|
-
// Suppress propagation during configureAutoFormatting's own value-restoration
|
|
11533
|
-
// (line below) — the mask emits 'accept' on every value-set, including ours,
|
|
11534
|
-
// and we don't want to overwrite a value the parent just pushed.
|
|
11535
|
-
if (this._configuringMask) return;
|
|
11536
|
-
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
11537
|
-
if (this.type === "date") {
|
|
11538
|
-
this._rawMaskValue = this.maskInstance.value;
|
|
11539
|
-
}
|
|
11540
|
-
});
|
|
11443
|
+
if (this.inputElement && maskOptions.mask) {
|
|
11541
11444
|
|
|
11542
|
-
|
|
11543
|
-
|
|
11544
|
-
|
|
11545
|
-
|
|
11546
|
-
|
|
11547
|
-
|
|
11548
|
-
|
|
11445
|
+
// Stash and clear any existing value before IMask init.
|
|
11446
|
+
// IMask's constructor processes the current input value which requires
|
|
11447
|
+
// selection state — clearing first avoids that scenario entirely.
|
|
11448
|
+
// When the format changes (e.g. locale switch) and we have a valid ISO
|
|
11449
|
+
// model value, compute the display string for the NEW format instead of
|
|
11450
|
+
// re-using the old display string, which may be invalid in the new mask.
|
|
11451
|
+
let existingValue = this.inputElement.value;
|
|
11452
|
+
if (
|
|
11453
|
+
this.util.isFullDateFormat(this.type, this.format) &&
|
|
11454
|
+
this.value &&
|
|
11455
|
+
dateFormatter.isValidDate(this.value) &&
|
|
11456
|
+
this.valueObject instanceof Date &&
|
|
11457
|
+
!Number.isNaN(this.valueObject.getTime()) &&
|
|
11458
|
+
typeof maskOptions.format === 'function'
|
|
11459
|
+
) {
|
|
11460
|
+
existingValue = maskOptions.format(this.valueObject);
|
|
11461
|
+
}
|
|
11462
|
+
|
|
11463
|
+
this.skipNextProgrammaticInputEvent = true;
|
|
11464
|
+
this.inputElement.value = '';
|
|
11465
|
+
|
|
11466
|
+
this.maskInstance = IMask(this.inputElement, maskOptions);
|
|
11467
|
+
|
|
11468
|
+
this.maskInstance.on('accept', () => {
|
|
11469
|
+
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
11470
|
+
if (this.type === "date") {
|
|
11471
|
+
this._rawMaskValue = this.maskInstance.value;
|
|
11472
|
+
}
|
|
11473
|
+
});
|
|
11549
11474
|
|
|
11550
|
-
|
|
11551
|
-
|
|
11552
|
-
|
|
11475
|
+
this.maskInstance.on('complete', () => {
|
|
11476
|
+
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
11477
|
+
if (this.type === "date") {
|
|
11478
|
+
this._rawMaskValue = this.maskInstance.value;
|
|
11553
11479
|
}
|
|
11480
|
+
});
|
|
11481
|
+
|
|
11482
|
+
// Restore the stashed value through IMask so it's properly masked
|
|
11483
|
+
if (existingValue) {
|
|
11484
|
+
this.maskInstance.value = existingValue;
|
|
11554
11485
|
}
|
|
11555
|
-
} finally {
|
|
11556
|
-
this._configuringMask = false;
|
|
11557
11486
|
}
|
|
11558
11487
|
}
|
|
11559
11488
|
|
|
@@ -11840,10 +11769,10 @@ class BaseInput extends AuroElement {
|
|
|
11840
11769
|
},
|
|
11841
11770
|
{
|
|
11842
11771
|
name: 'Diners club',
|
|
11843
|
-
regex: /^(?<num>
|
|
11772
|
+
regex: /^(?<num>36|38)\d{0}/u,
|
|
11844
11773
|
formatLength: 16,
|
|
11845
11774
|
errorMessage: CreditCardValidationMessage,
|
|
11846
|
-
cardIcon: '
|
|
11775
|
+
cardIcon: 'credit-card',
|
|
11847
11776
|
maskFormat: "0000 000000 0000"
|
|
11848
11777
|
},
|
|
11849
11778
|
{
|
|
@@ -12253,7 +12182,7 @@ class AuroHelpText extends i$3 {
|
|
|
12253
12182
|
}
|
|
12254
12183
|
}
|
|
12255
12184
|
|
|
12256
|
-
var formkitVersion = '
|
|
12185
|
+
var formkitVersion = '202606101857';
|
|
12257
12186
|
|
|
12258
12187
|
/**
|
|
12259
12188
|
* @license
|
|
@@ -4548,7 +4548,7 @@ class AuroFormValidation {
|
|
|
4548
4548
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input') && elem.errorMessage === '') {
|
|
4549
4549
|
const input = elem.renderRoot.querySelector('input');
|
|
4550
4550
|
|
|
4551
|
-
if (input
|
|
4551
|
+
if (input.validationMessage.length > 0) {
|
|
4552
4552
|
elem.errorMessage = input.validationMessage;
|
|
4553
4553
|
}
|
|
4554
4554
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-combobox') && elem.errorMessage === '') {
|
|
@@ -10220,7 +10220,11 @@ class AuroInputUtilities {
|
|
|
10220
10220
|
return part.value;
|
|
10221
10221
|
}
|
|
10222
10222
|
})
|
|
10223
|
-
.join("")
|
|
10223
|
+
.join("")
|
|
10224
|
+
// Remove whitespace and leading/trailing special characters for IMask compatibility
|
|
10225
|
+
// for example, ko-KR's format is `YYYY. MM. DD.` which causes issues with IMask if we don't remove the trailing period.
|
|
10226
|
+
.replace(/\s/gu, '')
|
|
10227
|
+
.replace(/^[^A-Z0-9]+|[^A-Z0-9]+$/gu, '');
|
|
10224
10228
|
}
|
|
10225
10229
|
|
|
10226
10230
|
/**
|
|
@@ -10385,6 +10389,7 @@ class AuroInputUtilities {
|
|
|
10385
10389
|
const maskOptions = this.getMaskOptions('date', normalizedFormat);
|
|
10386
10390
|
|
|
10387
10391
|
if (!(valueObject instanceof Date) || Number.isNaN(valueObject.getTime()) || !maskOptions || typeof maskOptions.format !== 'function') {
|
|
10392
|
+
console.debug('Invalid date object or mask options for formatting', { valueObject, maskOptions }); // eslint-disable-line no-console
|
|
10388
10393
|
return undefined;
|
|
10389
10394
|
}
|
|
10390
10395
|
|
|
@@ -11087,7 +11092,7 @@ class BaseInput extends AuroElement {
|
|
|
11087
11092
|
* @returns {Date|undefined}
|
|
11088
11093
|
*/
|
|
11089
11094
|
get valueObject() {
|
|
11090
|
-
return this._valueObject
|
|
11095
|
+
return this._valueObject;
|
|
11091
11096
|
}
|
|
11092
11097
|
|
|
11093
11098
|
/**
|
|
@@ -11095,7 +11100,7 @@ class BaseInput extends AuroElement {
|
|
|
11095
11100
|
* @returns {Date|undefined}
|
|
11096
11101
|
*/
|
|
11097
11102
|
get minObject() {
|
|
11098
|
-
return this._minObject
|
|
11103
|
+
return this._minObject;
|
|
11099
11104
|
}
|
|
11100
11105
|
|
|
11101
11106
|
/**
|
|
@@ -11103,31 +11108,7 @@ class BaseInput extends AuroElement {
|
|
|
11103
11108
|
* @returns {Date|undefined}
|
|
11104
11109
|
*/
|
|
11105
11110
|
get maxObject() {
|
|
11106
|
-
return this._maxObject
|
|
11107
|
-
}
|
|
11108
|
-
|
|
11109
|
-
/**
|
|
11110
|
-
* Parses a date string into a Date object when the corresponding `_*Object`
|
|
11111
|
-
* field hasn't been synced yet by `updated()`. Returns undefined when the
|
|
11112
|
-
* input type/format isn't a full date or the string is not a valid date.
|
|
11113
|
-
*
|
|
11114
|
-
* Why this exists: a parent (datepicker) can call `inputN.validate()` from
|
|
11115
|
-
* inside its own `updated()` before this input's `updated()` has run
|
|
11116
|
-
* `syncDateValues()` — so `_valueObject`/`_maxObject` are still `undefined`
|
|
11117
|
-
* and range checks would otherwise silently no-op (flipping the result to
|
|
11118
|
-
* `valid` or `patternMismatch`).
|
|
11119
|
-
* @private
|
|
11120
|
-
* @param {string|undefined} dateStr - ISO date string from `value`/`min`/`max`.
|
|
11121
|
-
* @returns {Date|undefined}
|
|
11122
|
-
*/
|
|
11123
|
-
_computeDateObjectFallback(dateStr) {
|
|
11124
|
-
if (!dateStr || !this.util || !this.util.isFullDateFormat(this.type, this.format)) {
|
|
11125
|
-
return undefined;
|
|
11126
|
-
}
|
|
11127
|
-
if (!dateFormatter.isValidDate(dateStr)) {
|
|
11128
|
-
return undefined;
|
|
11129
|
-
}
|
|
11130
|
-
return dateFormatter.stringToDateInstance(dateStr);
|
|
11111
|
+
return this._maxObject;
|
|
11131
11112
|
}
|
|
11132
11113
|
|
|
11133
11114
|
/**
|
|
@@ -11152,30 +11133,8 @@ class BaseInput extends AuroElement {
|
|
|
11152
11133
|
connectedCallback() {
|
|
11153
11134
|
super.connectedCallback();
|
|
11154
11135
|
|
|
11155
|
-
// Mark for query selectors when registered under a versioned tag (e.g. inside
|
|
11156
|
-
// a datepicker/combobox). Must run before parent components call validate() on
|
|
11157
|
-
// their inner inputs — the validation framework matches via tag-or-attribute,
|
|
11158
|
-
// and parents trigger validation during their own updated() cycle, which can
|
|
11159
|
-
// precede this input's firstUpdated().
|
|
11160
|
-
if (this.tagName.toLowerCase() !== 'auro-input' && !this.hasAttribute('auro-input')) {
|
|
11161
|
-
this.setAttribute('auro-input', '');
|
|
11162
|
-
}
|
|
11163
|
-
|
|
11164
11136
|
this.locale = this.domHandler.getLocale(this);
|
|
11165
11137
|
notifyOnLangChange(this);
|
|
11166
|
-
|
|
11167
|
-
// Pre-compute lengthForType and date-object fields so a parent (e.g. datepicker)
|
|
11168
|
-
// calling our validate() synchronously during its own updated() cycle sees
|
|
11169
|
-
// populated values. Without this, range validation silently no-ops because
|
|
11170
|
-
// `max.length === lengthForType` fails when lengthForType is still undefined.
|
|
11171
|
-
// Rebuild util here (constructor seeded with en-US default) so configureDataForType's
|
|
11172
|
-
// locale-derived format lookup uses the actual locale just resolved above.
|
|
11173
|
-
this.util = new AuroInputUtilities({
|
|
11174
|
-
locale: this.locale,
|
|
11175
|
-
format: this.format
|
|
11176
|
-
});
|
|
11177
|
-
this.configureDataForType();
|
|
11178
|
-
this.syncDateValues();
|
|
11179
11138
|
}
|
|
11180
11139
|
|
|
11181
11140
|
disconnectedCallback() {
|
|
@@ -11196,8 +11155,8 @@ class BaseInput extends AuroElement {
|
|
|
11196
11155
|
}
|
|
11197
11156
|
|
|
11198
11157
|
// add attribute for query selectors when auro-input is registered under a custom name
|
|
11199
|
-
if (this.tagName.toLowerCase() !== 'auro-input'
|
|
11200
|
-
this.setAttribute('auro-input',
|
|
11158
|
+
if (this.tagName.toLowerCase() !== 'auro-input') {
|
|
11159
|
+
this.setAttribute('auro-input', true);
|
|
11201
11160
|
}
|
|
11202
11161
|
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
11203
11162
|
|
|
@@ -11245,12 +11204,6 @@ class BaseInput extends AuroElement {
|
|
|
11245
11204
|
return;
|
|
11246
11205
|
}
|
|
11247
11206
|
|
|
11248
|
-
// While configureAutoFormatting is running, imask's internal updateControl
|
|
11249
|
-
// writes el.value to align display with the masked value. A synthetic input
|
|
11250
|
-
// event from that write would re-enter handleInput → processCreditCard mid-setup
|
|
11251
|
-
// and clobber a Lit value that was just pushed by the parent combobox.
|
|
11252
|
-
if (component._configuringMask) return;
|
|
11253
|
-
|
|
11254
11207
|
// If all guard clauses are passed, dispatch the event
|
|
11255
11208
|
const inputEvent = new InputEvent('input', {
|
|
11256
11209
|
bubbles: true,
|
|
@@ -11369,16 +11322,7 @@ class BaseInput extends AuroElement {
|
|
|
11369
11322
|
|
|
11370
11323
|
if (formattedValue !== this.inputElement.value) {
|
|
11371
11324
|
this.skipNextProgrammaticInputEvent = true;
|
|
11372
|
-
if (
|
|
11373
|
-
// Route through the mask so its _value and el.value stay in lock-step
|
|
11374
|
-
// (set value calls updateControl which writes el.value = displayValue).
|
|
11375
|
-
// Writing el.value directly leaves the mask thinking displayValue is
|
|
11376
|
-
// stale; _saveSelection on the next focus/click then warns. Scoped to
|
|
11377
|
-
// credit-card so date's own formattedValue (raw ISO when calendar-invalid)
|
|
11378
|
-
// isn't re-masked through the mm/dd/yyyy mask, which would truncate it
|
|
11379
|
-
// and flip validity from patternMismatch to tooShort.
|
|
11380
|
-
this.maskInstance.value = formattedValue || '';
|
|
11381
|
-
} else if (formattedValue) {
|
|
11325
|
+
if (formattedValue) {
|
|
11382
11326
|
this.inputElement.value = formattedValue;
|
|
11383
11327
|
} else {
|
|
11384
11328
|
this.inputElement.value = '';
|
|
@@ -11487,73 +11431,58 @@ class BaseInput extends AuroElement {
|
|
|
11487
11431
|
* @returns {void}
|
|
11488
11432
|
*/
|
|
11489
11433
|
configureAutoFormatting() {
|
|
11490
|
-
|
|
11491
|
-
|
|
11492
|
-
|
|
11493
|
-
// set value has finished its alignCursor pass.
|
|
11494
|
-
if (this._configuringMask) return;
|
|
11495
|
-
this._configuringMask = true;
|
|
11496
|
-
try {
|
|
11497
|
-
if (this.maskInstance) {
|
|
11498
|
-
this.maskInstance.destroy();
|
|
11499
|
-
}
|
|
11434
|
+
if (this.maskInstance) {
|
|
11435
|
+
this.maskInstance.destroy();
|
|
11436
|
+
}
|
|
11500
11437
|
|
|
11501
|
-
|
|
11502
|
-
|
|
11438
|
+
// Pass new format to util
|
|
11439
|
+
this.util.updateFormat(this.format);
|
|
11503
11440
|
|
|
11504
|
-
|
|
11505
|
-
|
|
11506
|
-
if (this.inputElement && maskOptions.mask) {
|
|
11507
|
-
|
|
11508
|
-
// Stash and clear any existing value before IMask init.
|
|
11509
|
-
// IMask's constructor processes the current input value which requires
|
|
11510
|
-
// selection state — clearing first avoids that scenario entirely.
|
|
11511
|
-
// When the format changes (e.g. locale switch) and we have a valid ISO
|
|
11512
|
-
// model value, compute the display string for the NEW format instead of
|
|
11513
|
-
// re-using the old display string, which may be invalid in the new mask.
|
|
11514
|
-
let existingValue = this.inputElement.value;
|
|
11515
|
-
if (
|
|
11516
|
-
this.util.isFullDateFormat(this.type, this.format) &&
|
|
11517
|
-
this.value &&
|
|
11518
|
-
dateFormatter.isValidDate(this.value) &&
|
|
11519
|
-
this.valueObject instanceof Date &&
|
|
11520
|
-
!Number.isNaN(this.valueObject.getTime()) &&
|
|
11521
|
-
typeof maskOptions.format === 'function'
|
|
11522
|
-
) {
|
|
11523
|
-
existingValue = maskOptions.format(this.valueObject);
|
|
11524
|
-
}
|
|
11441
|
+
const maskOptions = this.util.getMaskOptions(this.type, this.format);
|
|
11525
11442
|
|
|
11526
|
-
|
|
11527
|
-
this.inputElement.value = '';
|
|
11528
|
-
|
|
11529
|
-
this.maskInstance = IMask(this.inputElement, maskOptions);
|
|
11530
|
-
|
|
11531
|
-
this.maskInstance.on('accept', () => {
|
|
11532
|
-
// Suppress propagation during configureAutoFormatting's own value-restoration
|
|
11533
|
-
// (line below) — the mask emits 'accept' on every value-set, including ours,
|
|
11534
|
-
// and we don't want to overwrite a value the parent just pushed.
|
|
11535
|
-
if (this._configuringMask) return;
|
|
11536
|
-
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
11537
|
-
if (this.type === "date") {
|
|
11538
|
-
this._rawMaskValue = this.maskInstance.value;
|
|
11539
|
-
}
|
|
11540
|
-
});
|
|
11443
|
+
if (this.inputElement && maskOptions.mask) {
|
|
11541
11444
|
|
|
11542
|
-
|
|
11543
|
-
|
|
11544
|
-
|
|
11545
|
-
|
|
11546
|
-
|
|
11547
|
-
|
|
11548
|
-
|
|
11445
|
+
// Stash and clear any existing value before IMask init.
|
|
11446
|
+
// IMask's constructor processes the current input value which requires
|
|
11447
|
+
// selection state — clearing first avoids that scenario entirely.
|
|
11448
|
+
// When the format changes (e.g. locale switch) and we have a valid ISO
|
|
11449
|
+
// model value, compute the display string for the NEW format instead of
|
|
11450
|
+
// re-using the old display string, which may be invalid in the new mask.
|
|
11451
|
+
let existingValue = this.inputElement.value;
|
|
11452
|
+
if (
|
|
11453
|
+
this.util.isFullDateFormat(this.type, this.format) &&
|
|
11454
|
+
this.value &&
|
|
11455
|
+
dateFormatter.isValidDate(this.value) &&
|
|
11456
|
+
this.valueObject instanceof Date &&
|
|
11457
|
+
!Number.isNaN(this.valueObject.getTime()) &&
|
|
11458
|
+
typeof maskOptions.format === 'function'
|
|
11459
|
+
) {
|
|
11460
|
+
existingValue = maskOptions.format(this.valueObject);
|
|
11461
|
+
}
|
|
11462
|
+
|
|
11463
|
+
this.skipNextProgrammaticInputEvent = true;
|
|
11464
|
+
this.inputElement.value = '';
|
|
11465
|
+
|
|
11466
|
+
this.maskInstance = IMask(this.inputElement, maskOptions);
|
|
11467
|
+
|
|
11468
|
+
this.maskInstance.on('accept', () => {
|
|
11469
|
+
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
11470
|
+
if (this.type === "date") {
|
|
11471
|
+
this._rawMaskValue = this.maskInstance.value;
|
|
11472
|
+
}
|
|
11473
|
+
});
|
|
11549
11474
|
|
|
11550
|
-
|
|
11551
|
-
|
|
11552
|
-
|
|
11475
|
+
this.maskInstance.on('complete', () => {
|
|
11476
|
+
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
11477
|
+
if (this.type === "date") {
|
|
11478
|
+
this._rawMaskValue = this.maskInstance.value;
|
|
11553
11479
|
}
|
|
11480
|
+
});
|
|
11481
|
+
|
|
11482
|
+
// Restore the stashed value through IMask so it's properly masked
|
|
11483
|
+
if (existingValue) {
|
|
11484
|
+
this.maskInstance.value = existingValue;
|
|
11554
11485
|
}
|
|
11555
|
-
} finally {
|
|
11556
|
-
this._configuringMask = false;
|
|
11557
11486
|
}
|
|
11558
11487
|
}
|
|
11559
11488
|
|
|
@@ -11840,10 +11769,10 @@ class BaseInput extends AuroElement {
|
|
|
11840
11769
|
},
|
|
11841
11770
|
{
|
|
11842
11771
|
name: 'Diners club',
|
|
11843
|
-
regex: /^(?<num>
|
|
11772
|
+
regex: /^(?<num>36|38)\d{0}/u,
|
|
11844
11773
|
formatLength: 16,
|
|
11845
11774
|
errorMessage: CreditCardValidationMessage,
|
|
11846
|
-
cardIcon: '
|
|
11775
|
+
cardIcon: 'credit-card',
|
|
11847
11776
|
maskFormat: "0000 000000 0000"
|
|
11848
11777
|
},
|
|
11849
11778
|
{
|
|
@@ -12253,7 +12182,7 @@ class AuroHelpText extends i$3 {
|
|
|
12253
12182
|
}
|
|
12254
12183
|
}
|
|
12255
12184
|
|
|
12256
|
-
var formkitVersion = '
|
|
12185
|
+
var formkitVersion = '202606101857';
|
|
12257
12186
|
|
|
12258
12187
|
/**
|
|
12259
12188
|
* @license
|