@aurodesignsystem-dev/auro-formkit 0.0.0-pr1532.1 → 0.0.0-pr1533.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/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 +118 -50
- package/components/combobox/demo/getting-started.min.js +118 -50
- package/components/combobox/demo/index.min.js +118 -50
- package/components/combobox/dist/auro-combobox.d.ts +10 -0
- package/components/combobox/dist/index.js +118 -50
- package/components/combobox/dist/registered.js +118 -50
- 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/accessibility.md +17 -8
- package/components/datepicker/demo/api.md +1 -1
- package/components/datepicker/demo/customize.min.js +229 -72
- package/components/datepicker/demo/index.min.js +229 -72
- package/components/datepicker/demo/keyboard-behavior.md +3 -3
- package/components/datepicker/demo/voiceover.md +4 -4
- package/components/datepicker/demo/why-datepicker.md +2 -2
- package/components/datepicker/dist/auro-calendar-cell.d.ts +11 -0
- package/components/datepicker/dist/auro-calendar.d.ts +26 -2
- package/components/datepicker/dist/auro-datepicker.d.ts +9 -1
- package/components/datepicker/dist/index.js +229 -72
- package/components/datepicker/dist/registered.js +229 -72
- 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/api.md +3 -3
- package/components/form/demo/customize.md +345 -97
- package/components/form/demo/customize.min.js +441 -176
- package/components/form/demo/getting-started.md +344 -96
- package/components/form/demo/getting-started.min.js +461 -176
- package/components/form/demo/index.min.js +412 -176
- package/components/form/demo/registerDemoDeps.min.js +408 -172
- package/components/form/dist/auro-form.d.ts +7 -7
- package/components/form/dist/index.js +4 -4
- package/components/form/dist/registered.js +4 -4
- package/components/input/demo/customize.min.js +56 -45
- package/components/input/demo/getting-started.min.js +56 -45
- package/components/input/demo/index.min.js +56 -45
- package/components/input/dist/base-input.d.ts +20 -4
- package/components/input/dist/index.js +56 -45
- package/components/input/dist/registered.js +56 -45
- 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 +2 -2
- package/components/select/demo/getting-started.min.js +2 -2
- package/components/select/demo/index.min.js +2 -2
- package/components/select/dist/index.js +2 -2
- package/components/select/dist/registered.js +2 -2
- package/custom-elements.json +5924 -5826
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {Object} FormStateMember - The form state member.
|
|
3
|
-
* @property {string | number | boolean | string[] | null} value - The value of the form element.
|
|
3
|
+
* @property {string | number | boolean | string[] | Record<string, number> | null} value - The value of the form element. Mirrors the child component's own `.value`, so the shape varies by element type (e.g. an array for `auro-checkbox-group`, an object keyed by counter name for `auro-counter-group`). A `range` `auro-datepicker` is the one form-specific case: its `.values` array is stored rather than its single `.value` string.
|
|
4
4
|
* @property {ValidityState} validity - The validity state of the form element, stored when fired from the form element.
|
|
5
5
|
* @property {boolean} required - Whether the form element is required or not.
|
|
6
6
|
* @property {boolean} disabled - Whether the form element is currently disabled. Cached from the live attribute via the MutationObserver in `connectedCallback` and refreshed from `_handleAttributeMutations`.
|
|
@@ -102,7 +102,7 @@ export class AuroForm extends LitElement {
|
|
|
102
102
|
* `_setInitialState` can detect user edits as `current !== initial`,
|
|
103
103
|
* matching HTML's `dirtyValueFlag` semantics.
|
|
104
104
|
* @private
|
|
105
|
-
* @type {Record<string, string | number | boolean | string[] | null | undefined>}
|
|
105
|
+
* @type {Record<string, string | number | boolean | string[] | Record<string, number> | null | undefined>}
|
|
106
106
|
*/
|
|
107
107
|
private _initialValues;
|
|
108
108
|
/**
|
|
@@ -229,10 +229,10 @@ export class AuroForm extends LitElement {
|
|
|
229
229
|
*/
|
|
230
230
|
private isButtonElement;
|
|
231
231
|
/**
|
|
232
|
-
* Returns the current values of all named form elements as a key-value object, keyed by each element's `name` attribute.
|
|
233
|
-
* @returns {Record<string, string | number | boolean | string[] | null>} The current form values.
|
|
232
|
+
* Returns the current values of all named, enabled form elements as a key-value object, keyed by each element's `name` attribute. Each value is the child component's own `.value`, so the shape depends on the element type — see that component's documentation for its exact shape (for example, `auro-checkbox-group` yields an array, `auro-counter-group` yields an object keyed by counter name, and `auro-select` with `multiSelect` yields a JSON-encoded string). The one form-specific exception is a `range` `auro-datepicker`, whose `.values` array (`[start, end]`) is stored instead of its single `.value` string.
|
|
233
|
+
* @returns {Record<string, string | number | boolean | string[] | Record<string, number> | null>} The current form values.
|
|
234
234
|
*/
|
|
235
|
-
get value(): Record<string, string | number | boolean | string[] | null>;
|
|
235
|
+
get value(): Record<string, string | number | boolean | string[] | Record<string, number> | null>;
|
|
236
236
|
/**
|
|
237
237
|
* Getter for internal _submitElements.
|
|
238
238
|
* @returns {HTMLButtonElement[]}
|
|
@@ -373,9 +373,9 @@ export class AuroForm extends LitElement {
|
|
|
373
373
|
*/
|
|
374
374
|
export type FormStateMember = {
|
|
375
375
|
/**
|
|
376
|
-
* - The value of the form element.
|
|
376
|
+
* - The value of the form element. Mirrors the child component's own `.value`, so the shape varies by element type (e.g. an array for `auro-checkbox-group`, an object keyed by counter name for `auro-counter-group`). A `range` `auro-datepicker` is the one form-specific case: its `.values` array is stored rather than its single `.value` string.
|
|
377
377
|
*/
|
|
378
|
-
value: string | number | boolean | string[] | null;
|
|
378
|
+
value: string | number | boolean | string[] | Record<string, number> | null;
|
|
379
379
|
/**
|
|
380
380
|
* - The validity state of the form element, stored when fired from the form element.
|
|
381
381
|
*/
|
|
@@ -90,7 +90,7 @@ class AuroLibraryRuntimeUtils {
|
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
* @typedef {Object} FormStateMember - The form state member.
|
|
93
|
-
* @property {string | number | boolean | string[] | null} value - The value of the form element.
|
|
93
|
+
* @property {string | number | boolean | string[] | Record<string, number> | null} value - The value of the form element. Mirrors the child component's own `.value`, so the shape varies by element type (e.g. an array for `auro-checkbox-group`, an object keyed by counter name for `auro-counter-group`). A `range` `auro-datepicker` is the one form-specific case: its `.values` array is stored rather than its single `.value` string.
|
|
94
94
|
* @property {ValidityState} validity - The validity state of the form element, stored when fired from the form element.
|
|
95
95
|
* @property {boolean} required - Whether the form element is required or not.
|
|
96
96
|
* @property {boolean} disabled - Whether the form element is currently disabled. Cached from the live attribute via the MutationObserver in `connectedCallback` and refreshed from `_handleAttributeMutations`.
|
|
@@ -184,7 +184,7 @@ class AuroForm extends LitElement {
|
|
|
184
184
|
* `_setInitialState` can detect user edits as `current !== initial`,
|
|
185
185
|
* matching HTML's `dirtyValueFlag` semantics.
|
|
186
186
|
* @private
|
|
187
|
-
* @type {Record<string, string | number | boolean | string[] | null | undefined>}
|
|
187
|
+
* @type {Record<string, string | number | boolean | string[] | Record<string, number> | null | undefined>}
|
|
188
188
|
*/
|
|
189
189
|
this._initialValues = {};
|
|
190
190
|
|
|
@@ -343,8 +343,8 @@ class AuroForm extends LitElement {
|
|
|
343
343
|
}
|
|
344
344
|
|
|
345
345
|
/**
|
|
346
|
-
* Returns the current values of all named form elements as a key-value object, keyed by each element's `name` attribute.
|
|
347
|
-
* @returns {Record<string, string | number | boolean | string[] | null>} The current form values.
|
|
346
|
+
* Returns the current values of all named, enabled form elements as a key-value object, keyed by each element's `name` attribute. Each value is the child component's own `.value`, so the shape depends on the element type — see that component's documentation for its exact shape (for example, `auro-checkbox-group` yields an array, `auro-counter-group` yields an object keyed by counter name, and `auro-select` with `multiSelect` yields a JSON-encoded string). The one form-specific exception is a `range` `auro-datepicker`, whose `.values` array (`[start, end]`) is stored instead of its single `.value` string.
|
|
347
|
+
* @returns {Record<string, string | number | boolean | string[] | Record<string, number> | null>} The current form values.
|
|
348
348
|
*/
|
|
349
349
|
get value() {
|
|
350
350
|
return Object.keys(this.formState).reduce((acc, key) => {
|
|
@@ -90,7 +90,7 @@ class AuroLibraryRuntimeUtils {
|
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
* @typedef {Object} FormStateMember - The form state member.
|
|
93
|
-
* @property {string | number | boolean | string[] | null} value - The value of the form element.
|
|
93
|
+
* @property {string | number | boolean | string[] | Record<string, number> | null} value - The value of the form element. Mirrors the child component's own `.value`, so the shape varies by element type (e.g. an array for `auro-checkbox-group`, an object keyed by counter name for `auro-counter-group`). A `range` `auro-datepicker` is the one form-specific case: its `.values` array is stored rather than its single `.value` string.
|
|
94
94
|
* @property {ValidityState} validity - The validity state of the form element, stored when fired from the form element.
|
|
95
95
|
* @property {boolean} required - Whether the form element is required or not.
|
|
96
96
|
* @property {boolean} disabled - Whether the form element is currently disabled. Cached from the live attribute via the MutationObserver in `connectedCallback` and refreshed from `_handleAttributeMutations`.
|
|
@@ -184,7 +184,7 @@ class AuroForm extends LitElement {
|
|
|
184
184
|
* `_setInitialState` can detect user edits as `current !== initial`,
|
|
185
185
|
* matching HTML's `dirtyValueFlag` semantics.
|
|
186
186
|
* @private
|
|
187
|
-
* @type {Record<string, string | number | boolean | string[] | null | undefined>}
|
|
187
|
+
* @type {Record<string, string | number | boolean | string[] | Record<string, number> | null | undefined>}
|
|
188
188
|
*/
|
|
189
189
|
this._initialValues = {};
|
|
190
190
|
|
|
@@ -343,8 +343,8 @@ class AuroForm extends LitElement {
|
|
|
343
343
|
}
|
|
344
344
|
|
|
345
345
|
/**
|
|
346
|
-
* Returns the current values of all named form elements as a key-value object, keyed by each element's `name` attribute.
|
|
347
|
-
* @returns {Record<string, string | number | boolean | string[] | null>} The current form values.
|
|
346
|
+
* Returns the current values of all named, enabled form elements as a key-value object, keyed by each element's `name` attribute. Each value is the child component's own `.value`, so the shape depends on the element type — see that component's documentation for its exact shape (for example, `auro-checkbox-group` yields an array, `auro-counter-group` yields an object keyed by counter name, and `auro-select` with `multiSelect` yields a JSON-encoded string). The one form-specific exception is a `range` `auro-datepicker`, whose `.values` array (`[start, end]`) is stored instead of its single `.value` string.
|
|
347
|
+
* @returns {Record<string, string | number | boolean | string[] | Record<string, number> | null>} The current form values.
|
|
348
348
|
*/
|
|
349
349
|
get value() {
|
|
350
350
|
return Object.keys(this.formState).reduce((acc, key) => {
|
|
@@ -10657,14 +10657,16 @@ 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;
|
|
10660
10664
|
this.max = undefined;
|
|
10661
10665
|
this.maxLength = undefined;
|
|
10662
10666
|
this.min = undefined;
|
|
10663
10667
|
this.minLength = undefined;
|
|
10664
10668
|
this.noValidate = false;
|
|
10665
10669
|
this.onDark = false;
|
|
10666
|
-
// Raw values returned from the input mask before model normalization.
|
|
10667
|
-
this._rawMaskValue = undefined;
|
|
10668
10670
|
this.required = false;
|
|
10669
10671
|
this.setCustomValidityForType = undefined;
|
|
10670
10672
|
// Credit Card is intentionally excluded — its mask manages the cursor
|
|
@@ -10822,7 +10824,8 @@ class BaseInput extends AuroElement {
|
|
|
10822
10824
|
*/
|
|
10823
10825
|
format: {
|
|
10824
10826
|
type: String,
|
|
10825
|
-
reflect: true
|
|
10827
|
+
reflect: true,
|
|
10828
|
+
noAccessor: true
|
|
10826
10829
|
},
|
|
10827
10830
|
|
|
10828
10831
|
/**
|
|
@@ -11160,6 +11163,34 @@ class BaseInput extends AuroElement {
|
|
|
11160
11163
|
return this.max && dateFormatter.isValidDate(this.max) ? dateFormatter.stringToDateInstance(this.max) : undefined;
|
|
11161
11164
|
}
|
|
11162
11165
|
|
|
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
|
+
|
|
11163
11194
|
connectedCallback() {
|
|
11164
11195
|
super.connectedCallback();
|
|
11165
11196
|
|
|
@@ -11207,15 +11238,6 @@ class BaseInput extends AuroElement {
|
|
|
11207
11238
|
|
|
11208
11239
|
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
11209
11240
|
|
|
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
|
-
|
|
11219
11241
|
// use validity message override if declared when initializing the component
|
|
11220
11242
|
if (this.hasAttribute('setCustomValidity')) {
|
|
11221
11243
|
this.ValidityMessageOverride = this.setCustomValidity;
|
|
@@ -11322,12 +11344,10 @@ class BaseInput extends AuroElement {
|
|
|
11322
11344
|
updated(changedProperties) {
|
|
11323
11345
|
super.updated(changedProperties);
|
|
11324
11346
|
|
|
11325
|
-
// When locale changes
|
|
11326
|
-
// Only runs if the current format is still the previous locale's default (not user-overridden).
|
|
11347
|
+
// When locale changes, auto-derive format unless the consumer explicitly set one.
|
|
11327
11348
|
if (changedProperties.has('locale') && !changedProperties.has('format') && this.type === 'date') {
|
|
11328
|
-
|
|
11329
|
-
|
|
11330
|
-
this.format = getDateFormatFromLocale(this.locale);
|
|
11349
|
+
if (!this._userSetFormat) {
|
|
11350
|
+
this._setFormatFromLocale(getDateFormatFromLocale(this.locale));
|
|
11331
11351
|
}
|
|
11332
11352
|
}
|
|
11333
11353
|
|
|
@@ -11498,9 +11518,6 @@ class BaseInput extends AuroElement {
|
|
|
11498
11518
|
this.maskInstance.on('accept', () => {
|
|
11499
11519
|
if (this._configuringMask) return;
|
|
11500
11520
|
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
11501
|
-
if (this.type === "date") {
|
|
11502
|
-
this._rawMaskValue = this.maskInstance.value;
|
|
11503
|
-
}
|
|
11504
11521
|
});
|
|
11505
11522
|
|
|
11506
11523
|
// Mask fires 'complete' on the restore step below for any value that
|
|
@@ -11508,9 +11525,6 @@ class BaseInput extends AuroElement {
|
|
|
11508
11525
|
this.maskInstance.on('complete', () => {
|
|
11509
11526
|
if (this._configuringMask) return;
|
|
11510
11527
|
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
11511
|
-
if (this.type === "date") {
|
|
11512
|
-
this._rawMaskValue = this.maskInstance.value;
|
|
11513
|
-
}
|
|
11514
11528
|
});
|
|
11515
11529
|
|
|
11516
11530
|
// Write existingValue through the mask (not the input directly) so
|
|
@@ -11531,14 +11545,17 @@ class BaseInput extends AuroElement {
|
|
|
11531
11545
|
* @returns {void}
|
|
11532
11546
|
*/
|
|
11533
11547
|
notifyValueChanged() {
|
|
11534
|
-
|
|
11535
|
-
|
|
11536
|
-
|
|
11548
|
+
// This echoes Lit's reactive value update (and handleClickClear's
|
|
11549
|
+
// programmatic clear) — it is NOT a fresh user-input event. Mark it
|
|
11550
|
+
// `isProgrammatic` so consumers (e.g. auro-combobox) can distinguish
|
|
11551
|
+
// it from genuine user typing and skip clobbering their own
|
|
11552
|
+
// programmatic state during init-time renders.
|
|
11553
|
+
const inputEvent = new Event('input', {
|
|
11537
11554
|
bubbles: true,
|
|
11538
11555
|
composed: true,
|
|
11539
11556
|
});
|
|
11557
|
+
inputEvent.isProgrammatic = true;
|
|
11540
11558
|
|
|
11541
|
-
// Dispatched event to alert outside shadow DOM context of event firing.
|
|
11542
11559
|
this.dispatchEvent(inputEvent);
|
|
11543
11560
|
}
|
|
11544
11561
|
|
|
@@ -11747,8 +11764,7 @@ class BaseInput extends AuroElement {
|
|
|
11747
11764
|
|
|
11748
11765
|
// Set default date format if type=date and no format is defined
|
|
11749
11766
|
if (this.type === "date" && !this.format) {
|
|
11750
|
-
|
|
11751
|
-
this.format = this.util.getDateMaskFromLocale().toLowerCase();
|
|
11767
|
+
this._setFormatFromLocale(this.util.getDateMaskFromLocale().toLowerCase());
|
|
11752
11768
|
this.util.updateFormat(this.format);
|
|
11753
11769
|
}
|
|
11754
11770
|
}
|
|
@@ -11777,7 +11793,7 @@ class BaseInput extends AuroElement {
|
|
|
11777
11793
|
const creditCard = this.matchInputValueToCreditCard();
|
|
11778
11794
|
const previousFormat = this.format;
|
|
11779
11795
|
|
|
11780
|
-
this.
|
|
11796
|
+
this._setFormatFromLocale(creditCard.maskFormat);
|
|
11781
11797
|
|
|
11782
11798
|
this.maxLength = creditCard.formatLength;
|
|
11783
11799
|
this.minLength = creditCard.formatMinLength;
|
|
@@ -12251,7 +12267,7 @@ class AuroHelpText extends i$3 {
|
|
|
12251
12267
|
}
|
|
12252
12268
|
}
|
|
12253
12269
|
|
|
12254
|
-
var formkitVersion = '
|
|
12270
|
+
var formkitVersion = '202607071532';
|
|
12255
12271
|
|
|
12256
12272
|
/**
|
|
12257
12273
|
* @license
|
|
@@ -12549,20 +12565,15 @@ class AuroInput extends BaseInput {
|
|
|
12549
12565
|
* @returns {void}
|
|
12550
12566
|
*/
|
|
12551
12567
|
checkDisplayValueSlotChange() {
|
|
12552
|
-
|
|
12553
|
-
|
|
12554
|
-
//
|
|
12555
|
-
|
|
12556
|
-
|
|
12557
|
-
|
|
12558
|
-
|
|
12559
|
-
|
|
12560
|
-
|
|
12561
|
-
if (nodes.length > 0) {
|
|
12562
|
-
hasContent = true;
|
|
12563
|
-
}
|
|
12564
|
-
|
|
12565
|
-
this.hasDisplayValueContent = hasContent;
|
|
12568
|
+
// flatten:true resolves through auro-combobox's forwarding slot
|
|
12569
|
+
// (<slot name="displayValue" slot="displayValue">) so a clone appended
|
|
12570
|
+
// directly to auro-input's light DOM alongside the forwarder still
|
|
12571
|
+
// counts as content. The prior nodes[0].tagName === 'SLOT' recursion
|
|
12572
|
+
// discarded any siblings past the forwarder.
|
|
12573
|
+
const slot = this.shadowRoot.querySelector('slot[name="displayValue"]');
|
|
12574
|
+
const nodes = slot.assignedNodes({ flatten: true });
|
|
12575
|
+
|
|
12576
|
+
this.hasDisplayValueContent = nodes.length > 0;
|
|
12566
12577
|
}
|
|
12567
12578
|
|
|
12568
12579
|
firstUpdated() {
|
|
@@ -10657,14 +10657,16 @@ 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;
|
|
10660
10664
|
this.max = undefined;
|
|
10661
10665
|
this.maxLength = undefined;
|
|
10662
10666
|
this.min = undefined;
|
|
10663
10667
|
this.minLength = undefined;
|
|
10664
10668
|
this.noValidate = false;
|
|
10665
10669
|
this.onDark = false;
|
|
10666
|
-
// Raw values returned from the input mask before model normalization.
|
|
10667
|
-
this._rawMaskValue = undefined;
|
|
10668
10670
|
this.required = false;
|
|
10669
10671
|
this.setCustomValidityForType = undefined;
|
|
10670
10672
|
// Credit Card is intentionally excluded — its mask manages the cursor
|
|
@@ -10822,7 +10824,8 @@ class BaseInput extends AuroElement {
|
|
|
10822
10824
|
*/
|
|
10823
10825
|
format: {
|
|
10824
10826
|
type: String,
|
|
10825
|
-
reflect: true
|
|
10827
|
+
reflect: true,
|
|
10828
|
+
noAccessor: true
|
|
10826
10829
|
},
|
|
10827
10830
|
|
|
10828
10831
|
/**
|
|
@@ -11160,6 +11163,34 @@ class BaseInput extends AuroElement {
|
|
|
11160
11163
|
return this.max && dateFormatter.isValidDate(this.max) ? dateFormatter.stringToDateInstance(this.max) : undefined;
|
|
11161
11164
|
}
|
|
11162
11165
|
|
|
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
|
+
|
|
11163
11194
|
connectedCallback() {
|
|
11164
11195
|
super.connectedCallback();
|
|
11165
11196
|
|
|
@@ -11207,15 +11238,6 @@ class BaseInput extends AuroElement {
|
|
|
11207
11238
|
|
|
11208
11239
|
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
11209
11240
|
|
|
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
|
-
|
|
11219
11241
|
// use validity message override if declared when initializing the component
|
|
11220
11242
|
if (this.hasAttribute('setCustomValidity')) {
|
|
11221
11243
|
this.ValidityMessageOverride = this.setCustomValidity;
|
|
@@ -11322,12 +11344,10 @@ class BaseInput extends AuroElement {
|
|
|
11322
11344
|
updated(changedProperties) {
|
|
11323
11345
|
super.updated(changedProperties);
|
|
11324
11346
|
|
|
11325
|
-
// When locale changes
|
|
11326
|
-
// Only runs if the current format is still the previous locale's default (not user-overridden).
|
|
11347
|
+
// When locale changes, auto-derive format unless the consumer explicitly set one.
|
|
11327
11348
|
if (changedProperties.has('locale') && !changedProperties.has('format') && this.type === 'date') {
|
|
11328
|
-
|
|
11329
|
-
|
|
11330
|
-
this.format = getDateFormatFromLocale(this.locale);
|
|
11349
|
+
if (!this._userSetFormat) {
|
|
11350
|
+
this._setFormatFromLocale(getDateFormatFromLocale(this.locale));
|
|
11331
11351
|
}
|
|
11332
11352
|
}
|
|
11333
11353
|
|
|
@@ -11498,9 +11518,6 @@ class BaseInput extends AuroElement {
|
|
|
11498
11518
|
this.maskInstance.on('accept', () => {
|
|
11499
11519
|
if (this._configuringMask) return;
|
|
11500
11520
|
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
11501
|
-
if (this.type === "date") {
|
|
11502
|
-
this._rawMaskValue = this.maskInstance.value;
|
|
11503
|
-
}
|
|
11504
11521
|
});
|
|
11505
11522
|
|
|
11506
11523
|
// Mask fires 'complete' on the restore step below for any value that
|
|
@@ -11508,9 +11525,6 @@ class BaseInput extends AuroElement {
|
|
|
11508
11525
|
this.maskInstance.on('complete', () => {
|
|
11509
11526
|
if (this._configuringMask) return;
|
|
11510
11527
|
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
11511
|
-
if (this.type === "date") {
|
|
11512
|
-
this._rawMaskValue = this.maskInstance.value;
|
|
11513
|
-
}
|
|
11514
11528
|
});
|
|
11515
11529
|
|
|
11516
11530
|
// Write existingValue through the mask (not the input directly) so
|
|
@@ -11531,14 +11545,17 @@ class BaseInput extends AuroElement {
|
|
|
11531
11545
|
* @returns {void}
|
|
11532
11546
|
*/
|
|
11533
11547
|
notifyValueChanged() {
|
|
11534
|
-
|
|
11535
|
-
|
|
11536
|
-
|
|
11548
|
+
// This echoes Lit's reactive value update (and handleClickClear's
|
|
11549
|
+
// programmatic clear) — it is NOT a fresh user-input event. Mark it
|
|
11550
|
+
// `isProgrammatic` so consumers (e.g. auro-combobox) can distinguish
|
|
11551
|
+
// it from genuine user typing and skip clobbering their own
|
|
11552
|
+
// programmatic state during init-time renders.
|
|
11553
|
+
const inputEvent = new Event('input', {
|
|
11537
11554
|
bubbles: true,
|
|
11538
11555
|
composed: true,
|
|
11539
11556
|
});
|
|
11557
|
+
inputEvent.isProgrammatic = true;
|
|
11540
11558
|
|
|
11541
|
-
// Dispatched event to alert outside shadow DOM context of event firing.
|
|
11542
11559
|
this.dispatchEvent(inputEvent);
|
|
11543
11560
|
}
|
|
11544
11561
|
|
|
@@ -11747,8 +11764,7 @@ class BaseInput extends AuroElement {
|
|
|
11747
11764
|
|
|
11748
11765
|
// Set default date format if type=date and no format is defined
|
|
11749
11766
|
if (this.type === "date" && !this.format) {
|
|
11750
|
-
|
|
11751
|
-
this.format = this.util.getDateMaskFromLocale().toLowerCase();
|
|
11767
|
+
this._setFormatFromLocale(this.util.getDateMaskFromLocale().toLowerCase());
|
|
11752
11768
|
this.util.updateFormat(this.format);
|
|
11753
11769
|
}
|
|
11754
11770
|
}
|
|
@@ -11777,7 +11793,7 @@ class BaseInput extends AuroElement {
|
|
|
11777
11793
|
const creditCard = this.matchInputValueToCreditCard();
|
|
11778
11794
|
const previousFormat = this.format;
|
|
11779
11795
|
|
|
11780
|
-
this.
|
|
11796
|
+
this._setFormatFromLocale(creditCard.maskFormat);
|
|
11781
11797
|
|
|
11782
11798
|
this.maxLength = creditCard.formatLength;
|
|
11783
11799
|
this.minLength = creditCard.formatMinLength;
|
|
@@ -12251,7 +12267,7 @@ class AuroHelpText extends i$3 {
|
|
|
12251
12267
|
}
|
|
12252
12268
|
}
|
|
12253
12269
|
|
|
12254
|
-
var formkitVersion = '
|
|
12270
|
+
var formkitVersion = '202607071532';
|
|
12255
12271
|
|
|
12256
12272
|
/**
|
|
12257
12273
|
* @license
|
|
@@ -12549,20 +12565,15 @@ class AuroInput extends BaseInput {
|
|
|
12549
12565
|
* @returns {void}
|
|
12550
12566
|
*/
|
|
12551
12567
|
checkDisplayValueSlotChange() {
|
|
12552
|
-
|
|
12553
|
-
|
|
12554
|
-
//
|
|
12555
|
-
|
|
12556
|
-
|
|
12557
|
-
|
|
12558
|
-
|
|
12559
|
-
|
|
12560
|
-
|
|
12561
|
-
if (nodes.length > 0) {
|
|
12562
|
-
hasContent = true;
|
|
12563
|
-
}
|
|
12564
|
-
|
|
12565
|
-
this.hasDisplayValueContent = hasContent;
|
|
12568
|
+
// flatten:true resolves through auro-combobox's forwarding slot
|
|
12569
|
+
// (<slot name="displayValue" slot="displayValue">) so a clone appended
|
|
12570
|
+
// directly to auro-input's light DOM alongside the forwarder still
|
|
12571
|
+
// counts as content. The prior nodes[0].tagName === 'SLOT' recursion
|
|
12572
|
+
// discarded any siblings past the forwarder.
|
|
12573
|
+
const slot = this.shadowRoot.querySelector('slot[name="displayValue"]');
|
|
12574
|
+
const nodes = slot.assignedNodes({ flatten: true });
|
|
12575
|
+
|
|
12576
|
+
this.hasDisplayValueContent = nodes.length > 0;
|
|
12566
12577
|
}
|
|
12567
12578
|
|
|
12568
12579
|
firstUpdated() {
|