@aurodesignsystem-dev/auro-formkit 0.0.0-pr1531.1 → 0.0.0-pr1532.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 +1 -1
- package/components/checkbox/demo/getting-started.min.js +1 -1
- package/components/checkbox/demo/index.min.js +1 -1
- package/components/checkbox/dist/index.js +1 -1
- package/components/checkbox/dist/registered.js +1 -1
- package/components/combobox/demo/customize.min.js +29 -42
- package/components/combobox/demo/getting-started.min.js +29 -42
- package/components/combobox/demo/index.min.js +29 -42
- package/components/combobox/dist/index.js +29 -42
- package/components/combobox/dist/registered.js +29 -42
- package/components/counter/demo/customize.min.js +2 -2
- package/components/counter/demo/index.min.js +2 -2
- package/components/counter/dist/index.js +2 -2
- package/components/counter/dist/registered.js +2 -2
- package/components/datepicker/demo/customize.min.js +29 -42
- package/components/datepicker/demo/index.min.js +29 -42
- package/components/datepicker/dist/index.js +29 -42
- package/components/datepicker/dist/registered.js +29 -42
- package/components/dropdown/demo/customize.min.js +1 -1
- package/components/dropdown/demo/getting-started.min.js +1 -1
- package/components/dropdown/demo/index.min.js +1 -1
- package/components/dropdown/dist/index.js +1 -1
- package/components/dropdown/dist/registered.js +1 -1
- package/components/form/demo/customize.min.js +151 -144
- package/components/form/demo/getting-started.min.js +151 -144
- package/components/form/demo/index.min.js +151 -144
- package/components/form/demo/registerDemoDeps.min.js +151 -144
- package/components/input/demo/customize.min.js +27 -40
- package/components/input/demo/getting-started.min.js +27 -40
- package/components/input/demo/index.min.js +27 -40
- package/components/input/dist/base-input.d.ts +4 -20
- package/components/input/dist/index.js +27 -40
- package/components/input/dist/registered.js +27 -40
- package/components/radio/demo/customize.min.js +1 -1
- package/components/radio/demo/getting-started.min.js +1 -1
- package/components/radio/demo/index.min.js +1 -1
- package/components/radio/dist/index.js +1 -1
- package/components/radio/dist/registered.js +1 -1
- package/components/select/demo/customize.min.js +62 -16
- package/components/select/demo/getting-started.min.js +62 -16
- package/components/select/demo/index.min.js +62 -16
- package/components/select/dist/auro-select.d.ts +6 -0
- package/components/select/dist/index.js +62 -16
- package/components/select/dist/registered.js +62 -16
- package/custom-elements.json +1561 -1615
- package/package.json +1 -1
|
@@ -10657,16 +10657,14 @@ class BaseInput extends AuroElement {
|
|
|
10657
10657
|
this.label = 'Input label is undefined';
|
|
10658
10658
|
this.layout = 'classic';
|
|
10659
10659
|
this.locale = 'en-US';
|
|
10660
|
-
this._format = undefined;
|
|
10661
|
-
|
|
10662
|
-
/** @private */
|
|
10663
|
-
this._userSetFormat = false;
|
|
10664
10660
|
this.max = undefined;
|
|
10665
10661
|
this.maxLength = undefined;
|
|
10666
10662
|
this.min = undefined;
|
|
10667
10663
|
this.minLength = undefined;
|
|
10668
10664
|
this.noValidate = false;
|
|
10669
10665
|
this.onDark = false;
|
|
10666
|
+
// Raw values returned from the input mask before model normalization.
|
|
10667
|
+
this._rawMaskValue = undefined;
|
|
10670
10668
|
this.required = false;
|
|
10671
10669
|
this.setCustomValidityForType = undefined;
|
|
10672
10670
|
// Credit Card is intentionally excluded — its mask manages the cursor
|
|
@@ -10824,8 +10822,7 @@ class BaseInput extends AuroElement {
|
|
|
10824
10822
|
*/
|
|
10825
10823
|
format: {
|
|
10826
10824
|
type: String,
|
|
10827
|
-
reflect: true
|
|
10828
|
-
noAccessor: true
|
|
10825
|
+
reflect: true
|
|
10829
10826
|
},
|
|
10830
10827
|
|
|
10831
10828
|
/**
|
|
@@ -11163,34 +11160,6 @@ class BaseInput extends AuroElement {
|
|
|
11163
11160
|
return this.max && dateFormatter.isValidDate(this.max) ? dateFormatter.stringToDateInstance(this.max) : undefined;
|
|
11164
11161
|
}
|
|
11165
11162
|
|
|
11166
|
-
get format() {
|
|
11167
|
-
return this._format;
|
|
11168
|
-
}
|
|
11169
|
-
|
|
11170
|
-
/**
|
|
11171
|
-
* Overrides LitElement's generated accessor so we can track whether the
|
|
11172
|
-
* consumer explicitly set `format`. Locale-derived updates use
|
|
11173
|
-
* `_setFormatFromLocale` instead, which skips this flag.
|
|
11174
|
-
*/
|
|
11175
|
-
set format(value) {
|
|
11176
|
-
const oldValue = this._format;
|
|
11177
|
-
this._format = value ? value.toLowerCase() : value;
|
|
11178
|
-
this._userSetFormat = Boolean(value);
|
|
11179
|
-
this.requestUpdate('format', oldValue);
|
|
11180
|
-
}
|
|
11181
|
-
|
|
11182
|
-
/**
|
|
11183
|
-
* Sets format without marking it as user-set. Used by locale auto-derive
|
|
11184
|
-
* so that a subsequent locale change can still update the format.
|
|
11185
|
-
* @private
|
|
11186
|
-
* @param {string} value
|
|
11187
|
-
*/
|
|
11188
|
-
_setFormatFromLocale(value) {
|
|
11189
|
-
const oldValue = this._format;
|
|
11190
|
-
this._format = value ? value.toLowerCase() : value;
|
|
11191
|
-
this.requestUpdate('format', oldValue);
|
|
11192
|
-
}
|
|
11193
|
-
|
|
11194
11163
|
connectedCallback() {
|
|
11195
11164
|
super.connectedCallback();
|
|
11196
11165
|
|
|
@@ -11238,6 +11207,15 @@ class BaseInput extends AuroElement {
|
|
|
11238
11207
|
|
|
11239
11208
|
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
11240
11209
|
|
|
11210
|
+
// Normalize the format token to lowercase so case-mixed values supplied
|
|
11211
|
+
// via attribute (e.g. `format="MM/DD/YYYY"`) hit the `dateFormatMap`
|
|
11212
|
+
// lookup inside `setCustomHelpTextMessage`. Without this, an uppercase
|
|
11213
|
+
// format silently misses the map and leaves `setCustomValidityForType`
|
|
11214
|
+
// unset.
|
|
11215
|
+
if (this.format) {
|
|
11216
|
+
this.format = this.format.toLowerCase();
|
|
11217
|
+
}
|
|
11218
|
+
|
|
11241
11219
|
// use validity message override if declared when initializing the component
|
|
11242
11220
|
if (this.hasAttribute('setCustomValidity')) {
|
|
11243
11221
|
this.ValidityMessageOverride = this.setCustomValidity;
|
|
@@ -11344,10 +11322,12 @@ class BaseInput extends AuroElement {
|
|
|
11344
11322
|
updated(changedProperties) {
|
|
11345
11323
|
super.updated(changedProperties);
|
|
11346
11324
|
|
|
11347
|
-
// When locale changes,
|
|
11325
|
+
// When locale changes without an explicit format override, derive format from the new locale.
|
|
11326
|
+
// Only runs if the current format is still the previous locale's default (not user-overridden).
|
|
11348
11327
|
if (changedProperties.has('locale') && !changedProperties.has('format') && this.type === 'date') {
|
|
11349
|
-
|
|
11350
|
-
|
|
11328
|
+
const previousLocaleFormat = getDateFormatFromLocale(changedProperties.get('locale'));
|
|
11329
|
+
if (!this.format || this.format.toLowerCase() === previousLocaleFormat) {
|
|
11330
|
+
this.format = getDateFormatFromLocale(this.locale);
|
|
11351
11331
|
}
|
|
11352
11332
|
}
|
|
11353
11333
|
|
|
@@ -11518,6 +11498,9 @@ class BaseInput extends AuroElement {
|
|
|
11518
11498
|
this.maskInstance.on('accept', () => {
|
|
11519
11499
|
if (this._configuringMask) return;
|
|
11520
11500
|
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
11501
|
+
if (this.type === "date") {
|
|
11502
|
+
this._rawMaskValue = this.maskInstance.value;
|
|
11503
|
+
}
|
|
11521
11504
|
});
|
|
11522
11505
|
|
|
11523
11506
|
// Mask fires 'complete' on the restore step below for any value that
|
|
@@ -11525,6 +11508,9 @@ class BaseInput extends AuroElement {
|
|
|
11525
11508
|
this.maskInstance.on('complete', () => {
|
|
11526
11509
|
if (this._configuringMask) return;
|
|
11527
11510
|
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
11511
|
+
if (this.type === "date") {
|
|
11512
|
+
this._rawMaskValue = this.maskInstance.value;
|
|
11513
|
+
}
|
|
11528
11514
|
});
|
|
11529
11515
|
|
|
11530
11516
|
// Write existingValue through the mask (not the input directly) so
|
|
@@ -11761,7 +11747,8 @@ class BaseInput extends AuroElement {
|
|
|
11761
11747
|
|
|
11762
11748
|
// Set default date format if type=date and no format is defined
|
|
11763
11749
|
if (this.type === "date" && !this.format) {
|
|
11764
|
-
|
|
11750
|
+
// Use locale to determine default date format
|
|
11751
|
+
this.format = this.util.getDateMaskFromLocale().toLowerCase();
|
|
11765
11752
|
this.util.updateFormat(this.format);
|
|
11766
11753
|
}
|
|
11767
11754
|
}
|
|
@@ -11790,7 +11777,7 @@ class BaseInput extends AuroElement {
|
|
|
11790
11777
|
const creditCard = this.matchInputValueToCreditCard();
|
|
11791
11778
|
const previousFormat = this.format;
|
|
11792
11779
|
|
|
11793
|
-
this.
|
|
11780
|
+
this.format = creditCard.maskFormat;
|
|
11794
11781
|
|
|
11795
11782
|
this.maxLength = creditCard.formatLength;
|
|
11796
11783
|
this.minLength = creditCard.formatMinLength;
|
|
@@ -12264,7 +12251,7 @@ class AuroHelpText extends i$3 {
|
|
|
12264
12251
|
}
|
|
12265
12252
|
}
|
|
12266
12253
|
|
|
12267
|
-
var formkitVersion = '
|
|
12254
|
+
var formkitVersion = '202607022008';
|
|
12268
12255
|
|
|
12269
12256
|
/**
|
|
12270
12257
|
* @license
|
|
@@ -10657,16 +10657,14 @@ class BaseInput extends AuroElement {
|
|
|
10657
10657
|
this.label = 'Input label is undefined';
|
|
10658
10658
|
this.layout = 'classic';
|
|
10659
10659
|
this.locale = 'en-US';
|
|
10660
|
-
this._format = undefined;
|
|
10661
|
-
|
|
10662
|
-
/** @private */
|
|
10663
|
-
this._userSetFormat = false;
|
|
10664
10660
|
this.max = undefined;
|
|
10665
10661
|
this.maxLength = undefined;
|
|
10666
10662
|
this.min = undefined;
|
|
10667
10663
|
this.minLength = undefined;
|
|
10668
10664
|
this.noValidate = false;
|
|
10669
10665
|
this.onDark = false;
|
|
10666
|
+
// Raw values returned from the input mask before model normalization.
|
|
10667
|
+
this._rawMaskValue = undefined;
|
|
10670
10668
|
this.required = false;
|
|
10671
10669
|
this.setCustomValidityForType = undefined;
|
|
10672
10670
|
// Credit Card is intentionally excluded — its mask manages the cursor
|
|
@@ -10824,8 +10822,7 @@ class BaseInput extends AuroElement {
|
|
|
10824
10822
|
*/
|
|
10825
10823
|
format: {
|
|
10826
10824
|
type: String,
|
|
10827
|
-
reflect: true
|
|
10828
|
-
noAccessor: true
|
|
10825
|
+
reflect: true
|
|
10829
10826
|
},
|
|
10830
10827
|
|
|
10831
10828
|
/**
|
|
@@ -11163,34 +11160,6 @@ class BaseInput extends AuroElement {
|
|
|
11163
11160
|
return this.max && dateFormatter.isValidDate(this.max) ? dateFormatter.stringToDateInstance(this.max) : undefined;
|
|
11164
11161
|
}
|
|
11165
11162
|
|
|
11166
|
-
get format() {
|
|
11167
|
-
return this._format;
|
|
11168
|
-
}
|
|
11169
|
-
|
|
11170
|
-
/**
|
|
11171
|
-
* Overrides LitElement's generated accessor so we can track whether the
|
|
11172
|
-
* consumer explicitly set `format`. Locale-derived updates use
|
|
11173
|
-
* `_setFormatFromLocale` instead, which skips this flag.
|
|
11174
|
-
*/
|
|
11175
|
-
set format(value) {
|
|
11176
|
-
const oldValue = this._format;
|
|
11177
|
-
this._format = value ? value.toLowerCase() : value;
|
|
11178
|
-
this._userSetFormat = Boolean(value);
|
|
11179
|
-
this.requestUpdate('format', oldValue);
|
|
11180
|
-
}
|
|
11181
|
-
|
|
11182
|
-
/**
|
|
11183
|
-
* Sets format without marking it as user-set. Used by locale auto-derive
|
|
11184
|
-
* so that a subsequent locale change can still update the format.
|
|
11185
|
-
* @private
|
|
11186
|
-
* @param {string} value
|
|
11187
|
-
*/
|
|
11188
|
-
_setFormatFromLocale(value) {
|
|
11189
|
-
const oldValue = this._format;
|
|
11190
|
-
this._format = value ? value.toLowerCase() : value;
|
|
11191
|
-
this.requestUpdate('format', oldValue);
|
|
11192
|
-
}
|
|
11193
|
-
|
|
11194
11163
|
connectedCallback() {
|
|
11195
11164
|
super.connectedCallback();
|
|
11196
11165
|
|
|
@@ -11238,6 +11207,15 @@ class BaseInput extends AuroElement {
|
|
|
11238
11207
|
|
|
11239
11208
|
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
11240
11209
|
|
|
11210
|
+
// Normalize the format token to lowercase so case-mixed values supplied
|
|
11211
|
+
// via attribute (e.g. `format="MM/DD/YYYY"`) hit the `dateFormatMap`
|
|
11212
|
+
// lookup inside `setCustomHelpTextMessage`. Without this, an uppercase
|
|
11213
|
+
// format silently misses the map and leaves `setCustomValidityForType`
|
|
11214
|
+
// unset.
|
|
11215
|
+
if (this.format) {
|
|
11216
|
+
this.format = this.format.toLowerCase();
|
|
11217
|
+
}
|
|
11218
|
+
|
|
11241
11219
|
// use validity message override if declared when initializing the component
|
|
11242
11220
|
if (this.hasAttribute('setCustomValidity')) {
|
|
11243
11221
|
this.ValidityMessageOverride = this.setCustomValidity;
|
|
@@ -11344,10 +11322,12 @@ class BaseInput extends AuroElement {
|
|
|
11344
11322
|
updated(changedProperties) {
|
|
11345
11323
|
super.updated(changedProperties);
|
|
11346
11324
|
|
|
11347
|
-
// When locale changes,
|
|
11325
|
+
// When locale changes without an explicit format override, derive format from the new locale.
|
|
11326
|
+
// Only runs if the current format is still the previous locale's default (not user-overridden).
|
|
11348
11327
|
if (changedProperties.has('locale') && !changedProperties.has('format') && this.type === 'date') {
|
|
11349
|
-
|
|
11350
|
-
|
|
11328
|
+
const previousLocaleFormat = getDateFormatFromLocale(changedProperties.get('locale'));
|
|
11329
|
+
if (!this.format || this.format.toLowerCase() === previousLocaleFormat) {
|
|
11330
|
+
this.format = getDateFormatFromLocale(this.locale);
|
|
11351
11331
|
}
|
|
11352
11332
|
}
|
|
11353
11333
|
|
|
@@ -11518,6 +11498,9 @@ class BaseInput extends AuroElement {
|
|
|
11518
11498
|
this.maskInstance.on('accept', () => {
|
|
11519
11499
|
if (this._configuringMask) return;
|
|
11520
11500
|
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
11501
|
+
if (this.type === "date") {
|
|
11502
|
+
this._rawMaskValue = this.maskInstance.value;
|
|
11503
|
+
}
|
|
11521
11504
|
});
|
|
11522
11505
|
|
|
11523
11506
|
// Mask fires 'complete' on the restore step below for any value that
|
|
@@ -11525,6 +11508,9 @@ class BaseInput extends AuroElement {
|
|
|
11525
11508
|
this.maskInstance.on('complete', () => {
|
|
11526
11509
|
if (this._configuringMask) return;
|
|
11527
11510
|
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
11511
|
+
if (this.type === "date") {
|
|
11512
|
+
this._rawMaskValue = this.maskInstance.value;
|
|
11513
|
+
}
|
|
11528
11514
|
});
|
|
11529
11515
|
|
|
11530
11516
|
// Write existingValue through the mask (not the input directly) so
|
|
@@ -11761,7 +11747,8 @@ class BaseInput extends AuroElement {
|
|
|
11761
11747
|
|
|
11762
11748
|
// Set default date format if type=date and no format is defined
|
|
11763
11749
|
if (this.type === "date" && !this.format) {
|
|
11764
|
-
|
|
11750
|
+
// Use locale to determine default date format
|
|
11751
|
+
this.format = this.util.getDateMaskFromLocale().toLowerCase();
|
|
11765
11752
|
this.util.updateFormat(this.format);
|
|
11766
11753
|
}
|
|
11767
11754
|
}
|
|
@@ -11790,7 +11777,7 @@ class BaseInput extends AuroElement {
|
|
|
11790
11777
|
const creditCard = this.matchInputValueToCreditCard();
|
|
11791
11778
|
const previousFormat = this.format;
|
|
11792
11779
|
|
|
11793
|
-
this.
|
|
11780
|
+
this.format = creditCard.maskFormat;
|
|
11794
11781
|
|
|
11795
11782
|
this.maxLength = creditCard.formatLength;
|
|
11796
11783
|
this.minLength = creditCard.formatMinLength;
|
|
@@ -12264,7 +12251,7 @@ class AuroHelpText extends i$3 {
|
|
|
12264
12251
|
}
|
|
12265
12252
|
}
|
|
12266
12253
|
|
|
12267
|
-
var formkitVersion = '
|
|
12254
|
+
var formkitVersion = '202607022008';
|
|
12268
12255
|
|
|
12269
12256
|
/**
|
|
12270
12257
|
* @license
|
|
@@ -10657,16 +10657,14 @@ class BaseInput extends AuroElement {
|
|
|
10657
10657
|
this.label = 'Input label is undefined';
|
|
10658
10658
|
this.layout = 'classic';
|
|
10659
10659
|
this.locale = 'en-US';
|
|
10660
|
-
this._format = undefined;
|
|
10661
|
-
|
|
10662
|
-
/** @private */
|
|
10663
|
-
this._userSetFormat = false;
|
|
10664
10660
|
this.max = undefined;
|
|
10665
10661
|
this.maxLength = undefined;
|
|
10666
10662
|
this.min = undefined;
|
|
10667
10663
|
this.minLength = undefined;
|
|
10668
10664
|
this.noValidate = false;
|
|
10669
10665
|
this.onDark = false;
|
|
10666
|
+
// Raw values returned from the input mask before model normalization.
|
|
10667
|
+
this._rawMaskValue = undefined;
|
|
10670
10668
|
this.required = false;
|
|
10671
10669
|
this.setCustomValidityForType = undefined;
|
|
10672
10670
|
// Credit Card is intentionally excluded — its mask manages the cursor
|
|
@@ -10824,8 +10822,7 @@ class BaseInput extends AuroElement {
|
|
|
10824
10822
|
*/
|
|
10825
10823
|
format: {
|
|
10826
10824
|
type: String,
|
|
10827
|
-
reflect: true
|
|
10828
|
-
noAccessor: true
|
|
10825
|
+
reflect: true
|
|
10829
10826
|
},
|
|
10830
10827
|
|
|
10831
10828
|
/**
|
|
@@ -11163,34 +11160,6 @@ class BaseInput extends AuroElement {
|
|
|
11163
11160
|
return this.max && dateFormatter.isValidDate(this.max) ? dateFormatter.stringToDateInstance(this.max) : undefined;
|
|
11164
11161
|
}
|
|
11165
11162
|
|
|
11166
|
-
get format() {
|
|
11167
|
-
return this._format;
|
|
11168
|
-
}
|
|
11169
|
-
|
|
11170
|
-
/**
|
|
11171
|
-
* Overrides LitElement's generated accessor so we can track whether the
|
|
11172
|
-
* consumer explicitly set `format`. Locale-derived updates use
|
|
11173
|
-
* `_setFormatFromLocale` instead, which skips this flag.
|
|
11174
|
-
*/
|
|
11175
|
-
set format(value) {
|
|
11176
|
-
const oldValue = this._format;
|
|
11177
|
-
this._format = value ? value.toLowerCase() : value;
|
|
11178
|
-
this._userSetFormat = Boolean(value);
|
|
11179
|
-
this.requestUpdate('format', oldValue);
|
|
11180
|
-
}
|
|
11181
|
-
|
|
11182
|
-
/**
|
|
11183
|
-
* Sets format without marking it as user-set. Used by locale auto-derive
|
|
11184
|
-
* so that a subsequent locale change can still update the format.
|
|
11185
|
-
* @private
|
|
11186
|
-
* @param {string} value
|
|
11187
|
-
*/
|
|
11188
|
-
_setFormatFromLocale(value) {
|
|
11189
|
-
const oldValue = this._format;
|
|
11190
|
-
this._format = value ? value.toLowerCase() : value;
|
|
11191
|
-
this.requestUpdate('format', oldValue);
|
|
11192
|
-
}
|
|
11193
|
-
|
|
11194
11163
|
connectedCallback() {
|
|
11195
11164
|
super.connectedCallback();
|
|
11196
11165
|
|
|
@@ -11238,6 +11207,15 @@ class BaseInput extends AuroElement {
|
|
|
11238
11207
|
|
|
11239
11208
|
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
11240
11209
|
|
|
11210
|
+
// Normalize the format token to lowercase so case-mixed values supplied
|
|
11211
|
+
// via attribute (e.g. `format="MM/DD/YYYY"`) hit the `dateFormatMap`
|
|
11212
|
+
// lookup inside `setCustomHelpTextMessage`. Without this, an uppercase
|
|
11213
|
+
// format silently misses the map and leaves `setCustomValidityForType`
|
|
11214
|
+
// unset.
|
|
11215
|
+
if (this.format) {
|
|
11216
|
+
this.format = this.format.toLowerCase();
|
|
11217
|
+
}
|
|
11218
|
+
|
|
11241
11219
|
// use validity message override if declared when initializing the component
|
|
11242
11220
|
if (this.hasAttribute('setCustomValidity')) {
|
|
11243
11221
|
this.ValidityMessageOverride = this.setCustomValidity;
|
|
@@ -11344,10 +11322,12 @@ class BaseInput extends AuroElement {
|
|
|
11344
11322
|
updated(changedProperties) {
|
|
11345
11323
|
super.updated(changedProperties);
|
|
11346
11324
|
|
|
11347
|
-
// When locale changes,
|
|
11325
|
+
// When locale changes without an explicit format override, derive format from the new locale.
|
|
11326
|
+
// Only runs if the current format is still the previous locale's default (not user-overridden).
|
|
11348
11327
|
if (changedProperties.has('locale') && !changedProperties.has('format') && this.type === 'date') {
|
|
11349
|
-
|
|
11350
|
-
|
|
11328
|
+
const previousLocaleFormat = getDateFormatFromLocale(changedProperties.get('locale'));
|
|
11329
|
+
if (!this.format || this.format.toLowerCase() === previousLocaleFormat) {
|
|
11330
|
+
this.format = getDateFormatFromLocale(this.locale);
|
|
11351
11331
|
}
|
|
11352
11332
|
}
|
|
11353
11333
|
|
|
@@ -11518,6 +11498,9 @@ class BaseInput extends AuroElement {
|
|
|
11518
11498
|
this.maskInstance.on('accept', () => {
|
|
11519
11499
|
if (this._configuringMask) return;
|
|
11520
11500
|
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
11501
|
+
if (this.type === "date") {
|
|
11502
|
+
this._rawMaskValue = this.maskInstance.value;
|
|
11503
|
+
}
|
|
11521
11504
|
});
|
|
11522
11505
|
|
|
11523
11506
|
// Mask fires 'complete' on the restore step below for any value that
|
|
@@ -11525,6 +11508,9 @@ class BaseInput extends AuroElement {
|
|
|
11525
11508
|
this.maskInstance.on('complete', () => {
|
|
11526
11509
|
if (this._configuringMask) return;
|
|
11527
11510
|
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
11511
|
+
if (this.type === "date") {
|
|
11512
|
+
this._rawMaskValue = this.maskInstance.value;
|
|
11513
|
+
}
|
|
11528
11514
|
});
|
|
11529
11515
|
|
|
11530
11516
|
// Write existingValue through the mask (not the input directly) so
|
|
@@ -11761,7 +11747,8 @@ class BaseInput extends AuroElement {
|
|
|
11761
11747
|
|
|
11762
11748
|
// Set default date format if type=date and no format is defined
|
|
11763
11749
|
if (this.type === "date" && !this.format) {
|
|
11764
|
-
|
|
11750
|
+
// Use locale to determine default date format
|
|
11751
|
+
this.format = this.util.getDateMaskFromLocale().toLowerCase();
|
|
11765
11752
|
this.util.updateFormat(this.format);
|
|
11766
11753
|
}
|
|
11767
11754
|
}
|
|
@@ -11790,7 +11777,7 @@ class BaseInput extends AuroElement {
|
|
|
11790
11777
|
const creditCard = this.matchInputValueToCreditCard();
|
|
11791
11778
|
const previousFormat = this.format;
|
|
11792
11779
|
|
|
11793
|
-
this.
|
|
11780
|
+
this.format = creditCard.maskFormat;
|
|
11794
11781
|
|
|
11795
11782
|
this.maxLength = creditCard.formatLength;
|
|
11796
11783
|
this.minLength = creditCard.formatMinLength;
|
|
@@ -12264,7 +12251,7 @@ class AuroHelpText extends i$3 {
|
|
|
12264
12251
|
}
|
|
12265
12252
|
}
|
|
12266
12253
|
|
|
12267
|
-
var formkitVersion = '
|
|
12254
|
+
var formkitVersion = '202607022008';
|
|
12268
12255
|
|
|
12269
12256
|
/**
|
|
12270
12257
|
* @license
|
|
@@ -115,7 +115,6 @@ export default class BaseInput extends AuroElement {
|
|
|
115
115
|
format: {
|
|
116
116
|
type: StringConstructor;
|
|
117
117
|
reflect: boolean;
|
|
118
|
-
noAccessor: boolean;
|
|
119
118
|
};
|
|
120
119
|
/**
|
|
121
120
|
* Flag to indicate if the input currently has focus.
|
|
@@ -407,15 +406,13 @@ export default class BaseInput extends AuroElement {
|
|
|
407
406
|
/** @private */
|
|
408
407
|
private label;
|
|
409
408
|
locale: string;
|
|
410
|
-
_format: any;
|
|
411
|
-
/** @private */
|
|
412
|
-
private _userSetFormat;
|
|
413
409
|
max: any;
|
|
414
410
|
maxLength: any;
|
|
415
411
|
min: any;
|
|
416
412
|
minLength: any;
|
|
417
413
|
noValidate: boolean;
|
|
418
414
|
onDark: boolean;
|
|
415
|
+
_rawMaskValue: string | undefined;
|
|
419
416
|
required: boolean;
|
|
420
417
|
setCustomValidityForType: string | undefined;
|
|
421
418
|
/** @private */
|
|
@@ -433,7 +430,7 @@ export default class BaseInput extends AuroElement {
|
|
|
433
430
|
private validation;
|
|
434
431
|
/** @private */
|
|
435
432
|
private validationCCLength;
|
|
436
|
-
value:
|
|
433
|
+
value: any;
|
|
437
434
|
/**
|
|
438
435
|
* Read-only Date object representation of `value` for full date formats.
|
|
439
436
|
* @returns {Date|undefined}
|
|
@@ -449,25 +446,12 @@ export default class BaseInput extends AuroElement {
|
|
|
449
446
|
* @returns {Date|undefined}
|
|
450
447
|
*/
|
|
451
448
|
get maxObject(): Date | undefined;
|
|
452
|
-
/**
|
|
453
|
-
* Overrides LitElement's generated accessor so we can track whether the
|
|
454
|
-
* consumer explicitly set `format`. Locale-derived updates use
|
|
455
|
-
* `_setFormatFromLocale` instead, which skips this flag.
|
|
456
|
-
*/
|
|
457
|
-
set format(value: any);
|
|
458
|
-
get format(): any;
|
|
459
|
-
/**
|
|
460
|
-
* Sets format without marking it as user-set. Used by locale auto-derive
|
|
461
|
-
* so that a subsequent locale change can still update the format.
|
|
462
|
-
* @private
|
|
463
|
-
* @param {string} value
|
|
464
|
-
*/
|
|
465
|
-
private _setFormatFromLocale;
|
|
466
449
|
firstUpdated(): void;
|
|
467
450
|
wrapperElement: Element | null | undefined;
|
|
468
451
|
inputElement: HTMLInputElement | null | undefined;
|
|
469
452
|
labelElement: HTMLLabelElement | null | undefined;
|
|
470
453
|
inputId: string | undefined;
|
|
454
|
+
format: any;
|
|
471
455
|
ValidityMessageOverride: any;
|
|
472
456
|
/**
|
|
473
457
|
* Patches the input element to dispatch an 'input' event whenever its value is set programmatically.
|
|
@@ -503,7 +487,7 @@ export default class BaseInput extends AuroElement {
|
|
|
503
487
|
*/
|
|
504
488
|
private configureAutoFormatting;
|
|
505
489
|
_configuringMask: boolean | undefined;
|
|
506
|
-
maskInstance: import("imask").InputMask<
|
|
490
|
+
maskInstance: import("imask").InputMask<any> | null | undefined;
|
|
507
491
|
/**
|
|
508
492
|
* Sends event notifying that the input has changed it's value.
|
|
509
493
|
* @private
|
|
@@ -10599,16 +10599,14 @@ class BaseInput extends AuroElement {
|
|
|
10599
10599
|
this.label = 'Input label is undefined';
|
|
10600
10600
|
this.layout = 'classic';
|
|
10601
10601
|
this.locale = 'en-US';
|
|
10602
|
-
this._format = undefined;
|
|
10603
|
-
|
|
10604
|
-
/** @private */
|
|
10605
|
-
this._userSetFormat = false;
|
|
10606
10602
|
this.max = undefined;
|
|
10607
10603
|
this.maxLength = undefined;
|
|
10608
10604
|
this.min = undefined;
|
|
10609
10605
|
this.minLength = undefined;
|
|
10610
10606
|
this.noValidate = false;
|
|
10611
10607
|
this.onDark = false;
|
|
10608
|
+
// Raw values returned from the input mask before model normalization.
|
|
10609
|
+
this._rawMaskValue = undefined;
|
|
10612
10610
|
this.required = false;
|
|
10613
10611
|
this.setCustomValidityForType = undefined;
|
|
10614
10612
|
// Credit Card is intentionally excluded — its mask manages the cursor
|
|
@@ -10766,8 +10764,7 @@ class BaseInput extends AuroElement {
|
|
|
10766
10764
|
*/
|
|
10767
10765
|
format: {
|
|
10768
10766
|
type: String,
|
|
10769
|
-
reflect: true
|
|
10770
|
-
noAccessor: true
|
|
10767
|
+
reflect: true
|
|
10771
10768
|
},
|
|
10772
10769
|
|
|
10773
10770
|
/**
|
|
@@ -11105,34 +11102,6 @@ class BaseInput extends AuroElement {
|
|
|
11105
11102
|
return this.max && dateFormatter.isValidDate(this.max) ? dateFormatter.stringToDateInstance(this.max) : undefined;
|
|
11106
11103
|
}
|
|
11107
11104
|
|
|
11108
|
-
get format() {
|
|
11109
|
-
return this._format;
|
|
11110
|
-
}
|
|
11111
|
-
|
|
11112
|
-
/**
|
|
11113
|
-
* Overrides LitElement's generated accessor so we can track whether the
|
|
11114
|
-
* consumer explicitly set `format`. Locale-derived updates use
|
|
11115
|
-
* `_setFormatFromLocale` instead, which skips this flag.
|
|
11116
|
-
*/
|
|
11117
|
-
set format(value) {
|
|
11118
|
-
const oldValue = this._format;
|
|
11119
|
-
this._format = value ? value.toLowerCase() : value;
|
|
11120
|
-
this._userSetFormat = Boolean(value);
|
|
11121
|
-
this.requestUpdate('format', oldValue);
|
|
11122
|
-
}
|
|
11123
|
-
|
|
11124
|
-
/**
|
|
11125
|
-
* Sets format without marking it as user-set. Used by locale auto-derive
|
|
11126
|
-
* so that a subsequent locale change can still update the format.
|
|
11127
|
-
* @private
|
|
11128
|
-
* @param {string} value
|
|
11129
|
-
*/
|
|
11130
|
-
_setFormatFromLocale(value) {
|
|
11131
|
-
const oldValue = this._format;
|
|
11132
|
-
this._format = value ? value.toLowerCase() : value;
|
|
11133
|
-
this.requestUpdate('format', oldValue);
|
|
11134
|
-
}
|
|
11135
|
-
|
|
11136
11105
|
connectedCallback() {
|
|
11137
11106
|
super.connectedCallback();
|
|
11138
11107
|
|
|
@@ -11180,6 +11149,15 @@ class BaseInput extends AuroElement {
|
|
|
11180
11149
|
|
|
11181
11150
|
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
11182
11151
|
|
|
11152
|
+
// Normalize the format token to lowercase so case-mixed values supplied
|
|
11153
|
+
// via attribute (e.g. `format="MM/DD/YYYY"`) hit the `dateFormatMap`
|
|
11154
|
+
// lookup inside `setCustomHelpTextMessage`. Without this, an uppercase
|
|
11155
|
+
// format silently misses the map and leaves `setCustomValidityForType`
|
|
11156
|
+
// unset.
|
|
11157
|
+
if (this.format) {
|
|
11158
|
+
this.format = this.format.toLowerCase();
|
|
11159
|
+
}
|
|
11160
|
+
|
|
11183
11161
|
// use validity message override if declared when initializing the component
|
|
11184
11162
|
if (this.hasAttribute('setCustomValidity')) {
|
|
11185
11163
|
this.ValidityMessageOverride = this.setCustomValidity;
|
|
@@ -11286,10 +11264,12 @@ class BaseInput extends AuroElement {
|
|
|
11286
11264
|
updated(changedProperties) {
|
|
11287
11265
|
super.updated(changedProperties);
|
|
11288
11266
|
|
|
11289
|
-
// When locale changes,
|
|
11267
|
+
// When locale changes without an explicit format override, derive format from the new locale.
|
|
11268
|
+
// Only runs if the current format is still the previous locale's default (not user-overridden).
|
|
11290
11269
|
if (changedProperties.has('locale') && !changedProperties.has('format') && this.type === 'date') {
|
|
11291
|
-
|
|
11292
|
-
|
|
11270
|
+
const previousLocaleFormat = getDateFormatFromLocale(changedProperties.get('locale'));
|
|
11271
|
+
if (!this.format || this.format.toLowerCase() === previousLocaleFormat) {
|
|
11272
|
+
this.format = getDateFormatFromLocale(this.locale);
|
|
11293
11273
|
}
|
|
11294
11274
|
}
|
|
11295
11275
|
|
|
@@ -11460,6 +11440,9 @@ class BaseInput extends AuroElement {
|
|
|
11460
11440
|
this.maskInstance.on('accept', () => {
|
|
11461
11441
|
if (this._configuringMask) return;
|
|
11462
11442
|
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
11443
|
+
if (this.type === "date") {
|
|
11444
|
+
this._rawMaskValue = this.maskInstance.value;
|
|
11445
|
+
}
|
|
11463
11446
|
});
|
|
11464
11447
|
|
|
11465
11448
|
// Mask fires 'complete' on the restore step below for any value that
|
|
@@ -11467,6 +11450,9 @@ class BaseInput extends AuroElement {
|
|
|
11467
11450
|
this.maskInstance.on('complete', () => {
|
|
11468
11451
|
if (this._configuringMask) return;
|
|
11469
11452
|
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
11453
|
+
if (this.type === "date") {
|
|
11454
|
+
this._rawMaskValue = this.maskInstance.value;
|
|
11455
|
+
}
|
|
11470
11456
|
});
|
|
11471
11457
|
|
|
11472
11458
|
// Write existingValue through the mask (not the input directly) so
|
|
@@ -11703,7 +11689,8 @@ class BaseInput extends AuroElement {
|
|
|
11703
11689
|
|
|
11704
11690
|
// Set default date format if type=date and no format is defined
|
|
11705
11691
|
if (this.type === "date" && !this.format) {
|
|
11706
|
-
|
|
11692
|
+
// Use locale to determine default date format
|
|
11693
|
+
this.format = this.util.getDateMaskFromLocale().toLowerCase();
|
|
11707
11694
|
this.util.updateFormat(this.format);
|
|
11708
11695
|
}
|
|
11709
11696
|
}
|
|
@@ -11732,7 +11719,7 @@ class BaseInput extends AuroElement {
|
|
|
11732
11719
|
const creditCard = this.matchInputValueToCreditCard();
|
|
11733
11720
|
const previousFormat = this.format;
|
|
11734
11721
|
|
|
11735
|
-
this.
|
|
11722
|
+
this.format = creditCard.maskFormat;
|
|
11736
11723
|
|
|
11737
11724
|
this.maxLength = creditCard.formatLength;
|
|
11738
11725
|
this.minLength = creditCard.formatMinLength;
|
|
@@ -12206,7 +12193,7 @@ class AuroHelpText extends LitElement {
|
|
|
12206
12193
|
}
|
|
12207
12194
|
}
|
|
12208
12195
|
|
|
12209
|
-
var formkitVersion = '
|
|
12196
|
+
var formkitVersion = '202607022008';
|
|
12210
12197
|
|
|
12211
12198
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
12212
12199
|
// See LICENSE in the project root for license information.
|