@aurodesignsystem-dev/auro-formkit 0.0.0-pr1492.5 → 0.0.0-pr1493.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/bibtemplate/dist/auro-bibtemplate.d.ts +7 -0
- package/components/bibtemplate/dist/index.js +9 -1
- package/components/bibtemplate/dist/registered.js +9 -1
- package/components/checkbox/demo/css-only.html +57 -0
- package/components/checkbox/demo/css-only.md +146 -0
- 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/demo/pages.json +1 -1
- package/components/checkbox/demo/styles.min.css +1 -1
- package/components/checkbox/demo/why-checkbox.html +57 -0
- package/components/checkbox/demo/why-checkbox.md +86 -0
- package/components/checkbox/dist/index.js +2 -2
- package/components/checkbox/dist/registered.js +2 -2
- package/components/combobox/demo/css-only.html +57 -0
- package/components/combobox/demo/css-only.md +209 -0
- package/components/combobox/demo/customize.md +7 -3
- package/components/combobox/demo/customize.min.js +1846 -1804
- package/components/combobox/demo/getting-started.min.js +1846 -1804
- package/components/combobox/demo/index.min.js +1846 -1804
- package/components/combobox/demo/pages.json +1 -1
- package/components/combobox/demo/styles.min.css +1 -1
- package/components/combobox/demo/why-combobox.html +57 -0
- package/components/combobox/demo/why-combobox.md +113 -0
- package/components/combobox/dist/auro-combobox.d.ts +5 -0
- package/components/combobox/dist/index.js +796 -179
- package/components/combobox/dist/registered.js +796 -179
- package/components/counter/demo/css-only.html +57 -0
- package/components/counter/demo/css-only.md +184 -0
- package/components/counter/demo/customize.min.js +276 -16
- package/components/counter/demo/index.min.js +276 -16
- package/components/counter/demo/keyboard-behavior.md +1 -0
- package/components/counter/demo/pages.json +1 -1
- package/components/counter/demo/styles.min.css +1 -1
- package/components/counter/demo/why-counter.html +57 -0
- package/components/counter/demo/why-counter.md +108 -0
- package/components/counter/dist/index.js +5457 -193
- package/components/counter/dist/registered.js +5457 -193
- package/components/datepicker/demo/accessibility.md +54 -3
- package/components/datepicker/demo/api.md +65 -55
- package/components/datepicker/demo/css-only.html +57 -0
- package/components/datepicker/demo/css-only.md +151 -0
- package/components/datepicker/demo/customize.html +2 -0
- package/components/datepicker/demo/customize.js +19 -0
- package/components/datepicker/demo/customize.md +474 -298
- package/components/datepicker/demo/customize.min.js +36243 -0
- package/components/datepicker/demo/design.md +5 -3
- package/components/datepicker/demo/getting-started.md +6 -6
- package/components/datepicker/demo/index.js +5 -1
- package/components/datepicker/demo/index.md +113 -16
- package/components/datepicker/demo/index.min.js +2735 -396
- package/components/datepicker/demo/keyboard-behavior.md +201 -2
- package/components/datepicker/demo/pages.json +1 -1
- package/components/datepicker/demo/styles.min.css +1 -1
- package/components/datepicker/demo/voiceover.md +21 -12
- package/components/datepicker/demo/why-datepicker.html +57 -0
- package/components/datepicker/demo/why-datepicker.md +133 -0
- package/components/datepicker/dist/index.js +2649 -397
- package/components/datepicker/dist/registered.js +2649 -397
- package/components/datepicker/dist/src/auro-calendar-cell.d.ts +116 -14
- package/components/datepicker/dist/src/auro-calendar-month.d.ts +54 -1
- package/components/datepicker/dist/src/auro-calendar.d.ts +264 -0
- package/components/datepicker/dist/src/auro-datepicker.d.ts +189 -53
- package/components/datepicker/dist/src/datepickerKeyboardStrategy.d.ts +5 -3
- package/components/datepicker/dist/src/utilities.d.ts +0 -14
- package/components/dropdown/demo/accessibility.md +11 -0
- package/components/dropdown/demo/api.md +1 -0
- package/components/dropdown/demo/css-only.html +57 -0
- package/components/dropdown/demo/css-only.md +219 -0
- package/components/dropdown/demo/customize.md +3 -0
- package/components/dropdown/demo/customize.min.js +265 -13
- package/components/dropdown/demo/getting-started.min.js +265 -13
- package/components/dropdown/demo/index.min.js +265 -13
- package/components/dropdown/demo/keyboard-behavior.md +1 -0
- package/components/dropdown/demo/pages.json +1 -1
- package/components/dropdown/demo/styles.min.css +1 -1
- package/components/dropdown/demo/why-dropdown.html +57 -0
- package/components/dropdown/demo/why-dropdown.md +97 -0
- package/components/dropdown/dist/auro-dropdown.d.ts +36 -1
- package/components/dropdown/dist/index.js +265 -13
- package/components/dropdown/dist/registered.js +265 -13
- package/components/form/demo/css-only.html +57 -0
- package/components/form/demo/css-only.md +156 -0
- package/components/form/demo/customize.min.js +11084 -8072
- package/components/form/demo/getting-started.min.js +11084 -8072
- package/components/form/demo/index.min.js +11084 -8072
- package/components/form/demo/pages.json +1 -1
- package/components/form/demo/registerDemoDeps.min.js +11083 -8071
- package/components/form/demo/styles.min.css +1 -1
- package/components/form/demo/why-form.html +57 -0
- package/components/form/demo/why-form.md +101 -0
- package/components/input/demo/css-only.html +57 -0
- package/components/input/demo/css-only.md +199 -0
- package/components/input/demo/customize.md +625 -636
- package/components/input/demo/customize.min.js +150 -75
- package/components/input/demo/getting-started.md +16 -6
- package/components/input/demo/getting-started.min.js +150 -75
- package/components/input/demo/index.min.js +150 -75
- package/components/input/demo/pages.json +1 -1
- package/components/input/demo/styles.min.css +1 -1
- package/components/input/demo/why-input.html +57 -0
- package/components/input/demo/why-input.md +121 -0
- package/components/input/dist/auro-input-util.d.ts +1 -1
- package/components/input/dist/base-input.d.ts +16 -0
- package/components/input/dist/index.js +150 -75
- package/components/input/dist/registered.js +150 -75
- package/components/input/dist/utilities.d.ts +1 -2
- package/components/menu/demo/api.md +41 -45
- package/components/menu/demo/css-only.html +57 -0
- package/components/menu/demo/css-only.md +166 -0
- package/components/menu/demo/customize.md +0 -28
- package/components/menu/demo/index.min.js +779 -1354
- package/components/menu/demo/pages.json +1 -1
- package/components/menu/demo/styles.min.css +1 -1
- package/components/menu/demo/why-menu.html +57 -0
- package/components/menu/demo/why-menu.md +104 -0
- package/components/menu/dist/auro-menu.d.ts +95 -110
- package/components/menu/dist/auro-menuoption.d.ts +32 -138
- package/components/menu/dist/index.js +753 -1308
- package/components/menu/dist/registered.js +765 -1308
- package/components/radio/demo/css-only.html +57 -0
- package/components/radio/demo/css-only.md +151 -0
- package/components/radio/demo/customize.min.js +1764 -0
- package/components/radio/demo/demo-support.min.js +55807 -0
- package/components/radio/demo/getting-started.js +1 -1
- package/components/radio/demo/getting-started.md +1 -1
- package/components/radio/demo/getting-started.min.js +1783 -0
- package/components/radio/demo/index.min.js +2 -2
- package/components/radio/demo/pages.json +1 -1
- package/components/radio/demo/styles.min.css +1 -1
- package/components/radio/demo/why-radio.html +57 -0
- package/components/radio/demo/why-radio.md +92 -0
- package/components/radio/dist/index.js +2 -2
- package/components/radio/dist/registered.js +2 -2
- package/components/select/demo/api.md +1 -0
- package/components/select/demo/css-only.html +57 -0
- package/components/select/demo/css-only.md +203 -0
- package/components/select/demo/customize.md +78 -3
- package/components/select/demo/customize.min.js +1341 -1533
- package/components/select/demo/getting-started.min.js +1341 -1533
- package/components/select/demo/index.min.js +1341 -1533
- package/components/select/demo/keyboard-behavior.md +19 -0
- package/components/select/demo/pages.json +1 -1
- package/components/select/demo/styles.min.css +1 -1
- package/components/select/demo/why-select.html +57 -0
- package/components/select/demo/why-select.md +128 -0
- package/components/select/dist/auro-select.d.ts +38 -2
- package/components/select/dist/index.js +435 -52
- package/components/select/dist/registered.js +435 -52
- package/components/select/dist/selectUtils.d.ts +12 -0
- package/custom-elements.json +4206 -3708
- package/package.json +8 -8
- package/components/menu/dist/auro-menu.context.d.ts +0 -238
|
@@ -4490,7 +4490,7 @@ class AuroFormValidation {
|
|
|
4490
4490
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input') && elem.errorMessage === '') {
|
|
4491
4491
|
const input = elem.renderRoot.querySelector('input');
|
|
4492
4492
|
|
|
4493
|
-
if (input.validationMessage.length > 0) {
|
|
4493
|
+
if (input && input.validationMessage.length > 0) {
|
|
4494
4494
|
elem.errorMessage = input.validationMessage;
|
|
4495
4495
|
}
|
|
4496
4496
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-combobox') && elem.errorMessage === '') {
|
|
@@ -10162,7 +10162,11 @@ class AuroInputUtilities {
|
|
|
10162
10162
|
return part.value;
|
|
10163
10163
|
}
|
|
10164
10164
|
})
|
|
10165
|
-
.join("")
|
|
10165
|
+
.join("")
|
|
10166
|
+
// Remove whitespace and leading/trailing special characters for IMask compatibility
|
|
10167
|
+
// for example, ko-KR's format is `YYYY. MM. DD.` which causes issues with IMask if we don't remove the trailing period.
|
|
10168
|
+
.replace(/\s/gu, '')
|
|
10169
|
+
.replace(/^[^A-Z0-9]+|[^A-Z0-9]+$/gu, '');
|
|
10166
10170
|
}
|
|
10167
10171
|
|
|
10168
10172
|
/**
|
|
@@ -10318,27 +10322,16 @@ class AuroInputUtilities {
|
|
|
10318
10322
|
* Converts a model value to a display value for the input element.
|
|
10319
10323
|
* For full date formats, converts an ISO model value to the configured display format.
|
|
10320
10324
|
* @private
|
|
10321
|
-
* @param {string} value - The model value (ISO string for date types).
|
|
10322
10325
|
* @param {Date|undefined} valueObject - Date object representation of value.
|
|
10323
10326
|
* @param {string} format - The date format string.
|
|
10324
|
-
* @returns {string}
|
|
10327
|
+
* @returns {string | undefined}
|
|
10325
10328
|
*/
|
|
10326
|
-
toFormattedValue(
|
|
10327
|
-
if (!this.isFullDateFormat('date', format) || !value) {
|
|
10328
|
-
return value;
|
|
10329
|
-
}
|
|
10330
|
-
|
|
10331
|
-
if (!dateFormatter.isValidDate(value)) {
|
|
10332
|
-
// For ISO-pattern strings that fail range validation (e.g. '2024-99-99'),
|
|
10333
|
-
// return '' so inputElement stays empty and format-based validation is not triggered.
|
|
10334
|
-
return (/^\d{4}-\d{2}-\d{2}$/u).test(value) ? '' : value;
|
|
10335
|
-
}
|
|
10336
|
-
|
|
10329
|
+
toFormattedValue(valueObject, format) {
|
|
10337
10330
|
const normalizedFormat = format.toLowerCase();
|
|
10338
10331
|
const maskOptions = this.getMaskOptions('date', normalizedFormat);
|
|
10339
10332
|
|
|
10340
10333
|
if (!(valueObject instanceof Date) || Number.isNaN(valueObject.getTime()) || !maskOptions || typeof maskOptions.format !== 'function') {
|
|
10341
|
-
return
|
|
10334
|
+
return undefined;
|
|
10342
10335
|
}
|
|
10343
10336
|
|
|
10344
10337
|
return maskOptions.format(valueObject);
|
|
@@ -11040,7 +11033,7 @@ class BaseInput extends AuroElement {
|
|
|
11040
11033
|
* @returns {Date|undefined}
|
|
11041
11034
|
*/
|
|
11042
11035
|
get valueObject() {
|
|
11043
|
-
return this._valueObject;
|
|
11036
|
+
return this._valueObject || this._computeDateObjectFallback(this.value);
|
|
11044
11037
|
}
|
|
11045
11038
|
|
|
11046
11039
|
/**
|
|
@@ -11048,7 +11041,7 @@ class BaseInput extends AuroElement {
|
|
|
11048
11041
|
* @returns {Date|undefined}
|
|
11049
11042
|
*/
|
|
11050
11043
|
get minObject() {
|
|
11051
|
-
return this._minObject;
|
|
11044
|
+
return this._minObject || this._computeDateObjectFallback(this.min);
|
|
11052
11045
|
}
|
|
11053
11046
|
|
|
11054
11047
|
/**
|
|
@@ -11056,7 +11049,31 @@ class BaseInput extends AuroElement {
|
|
|
11056
11049
|
* @returns {Date|undefined}
|
|
11057
11050
|
*/
|
|
11058
11051
|
get maxObject() {
|
|
11059
|
-
return this._maxObject;
|
|
11052
|
+
return this._maxObject || this._computeDateObjectFallback(this.max);
|
|
11053
|
+
}
|
|
11054
|
+
|
|
11055
|
+
/**
|
|
11056
|
+
* Parses a date string into a Date object when the corresponding `_*Object`
|
|
11057
|
+
* field hasn't been synced yet by `updated()`. Returns undefined when the
|
|
11058
|
+
* input type/format isn't a full date or the string is not a valid date.
|
|
11059
|
+
*
|
|
11060
|
+
* Why this exists: a parent (datepicker) can call `inputN.validate()` from
|
|
11061
|
+
* inside its own `updated()` before this input's `updated()` has run
|
|
11062
|
+
* `syncDateValues()` — so `_valueObject`/`_maxObject` are still `undefined`
|
|
11063
|
+
* and range checks would otherwise silently no-op (flipping the result to
|
|
11064
|
+
* `valid` or `patternMismatch`).
|
|
11065
|
+
* @private
|
|
11066
|
+
* @param {string|undefined} dateStr - ISO date string from `value`/`min`/`max`.
|
|
11067
|
+
* @returns {Date|undefined}
|
|
11068
|
+
*/
|
|
11069
|
+
_computeDateObjectFallback(dateStr) {
|
|
11070
|
+
if (!dateStr || !this.util || !this.util.isFullDateFormat(this.type, this.format)) {
|
|
11071
|
+
return undefined;
|
|
11072
|
+
}
|
|
11073
|
+
if (!dateFormatter.isValidDate(dateStr)) {
|
|
11074
|
+
return undefined;
|
|
11075
|
+
}
|
|
11076
|
+
return dateFormatter.stringToDateInstance(dateStr);
|
|
11060
11077
|
}
|
|
11061
11078
|
|
|
11062
11079
|
/**
|
|
@@ -11081,8 +11098,30 @@ class BaseInput extends AuroElement {
|
|
|
11081
11098
|
connectedCallback() {
|
|
11082
11099
|
super.connectedCallback();
|
|
11083
11100
|
|
|
11101
|
+
// Mark for query selectors when registered under a versioned tag (e.g. inside
|
|
11102
|
+
// a datepicker/combobox). Must run before parent components call validate() on
|
|
11103
|
+
// their inner inputs — the validation framework matches via tag-or-attribute,
|
|
11104
|
+
// and parents trigger validation during their own updated() cycle, which can
|
|
11105
|
+
// precede this input's firstUpdated().
|
|
11106
|
+
if (this.tagName.toLowerCase() !== 'auro-input' && !this.hasAttribute('auro-input')) {
|
|
11107
|
+
this.setAttribute('auro-input', '');
|
|
11108
|
+
}
|
|
11109
|
+
|
|
11084
11110
|
this.locale = this.domHandler.getLocale(this);
|
|
11085
11111
|
notifyOnLangChange(this);
|
|
11112
|
+
|
|
11113
|
+
// Pre-compute lengthForType and date-object fields so a parent (e.g. datepicker)
|
|
11114
|
+
// calling our validate() synchronously during its own updated() cycle sees
|
|
11115
|
+
// populated values. Without this, range validation silently no-ops because
|
|
11116
|
+
// `max.length === lengthForType` fails when lengthForType is still undefined.
|
|
11117
|
+
// Rebuild util here (constructor seeded with en-US default) so configureDataForType's
|
|
11118
|
+
// locale-derived format lookup uses the actual locale just resolved above.
|
|
11119
|
+
this.util = new AuroInputUtilities({
|
|
11120
|
+
locale: this.locale,
|
|
11121
|
+
format: this.format
|
|
11122
|
+
});
|
|
11123
|
+
this.configureDataForType();
|
|
11124
|
+
this.syncDateValues();
|
|
11086
11125
|
}
|
|
11087
11126
|
|
|
11088
11127
|
disconnectedCallback() {
|
|
@@ -11103,8 +11142,8 @@ class BaseInput extends AuroElement {
|
|
|
11103
11142
|
}
|
|
11104
11143
|
|
|
11105
11144
|
// add attribute for query selectors when auro-input is registered under a custom name
|
|
11106
|
-
if (this.tagName.toLowerCase() !== 'auro-input') {
|
|
11107
|
-
this.setAttribute('auro-input',
|
|
11145
|
+
if (this.tagName.toLowerCase() !== 'auro-input' && !this.hasAttribute('auro-input')) {
|
|
11146
|
+
this.setAttribute('auro-input', '');
|
|
11108
11147
|
}
|
|
11109
11148
|
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
11110
11149
|
|
|
@@ -11152,6 +11191,12 @@ class BaseInput extends AuroElement {
|
|
|
11152
11191
|
return;
|
|
11153
11192
|
}
|
|
11154
11193
|
|
|
11194
|
+
// While configureAutoFormatting is running, imask's internal updateControl
|
|
11195
|
+
// writes el.value to align display with the masked value. A synthetic input
|
|
11196
|
+
// event from that write would re-enter handleInput → processCreditCard mid-setup
|
|
11197
|
+
// and clobber a Lit value that was just pushed by the parent combobox.
|
|
11198
|
+
if (component._configuringMask) return;
|
|
11199
|
+
|
|
11155
11200
|
// If all guard clauses are passed, dispatch the event
|
|
11156
11201
|
const inputEvent = new InputEvent('input', {
|
|
11157
11202
|
bubbles: true,
|
|
@@ -11256,11 +11301,30 @@ class BaseInput extends AuroElement {
|
|
|
11256
11301
|
this.hasValue = false;
|
|
11257
11302
|
}
|
|
11258
11303
|
|
|
11259
|
-
|
|
11304
|
+
let formattedValue = this.value;
|
|
11305
|
+
if (this.type === 'date') {
|
|
11306
|
+
const formattedDate = this.util.toFormattedValue(this.valueObject, this.format);
|
|
11307
|
+
if (!formattedDate) {
|
|
11308
|
+
// if user entered unrecognized date format that cannot be parsed into a Date object,
|
|
11309
|
+
// keep the raw value in the input so they can edit it instead of overwriting with an empty string
|
|
11310
|
+
formattedValue = this.value;
|
|
11311
|
+
} else {
|
|
11312
|
+
formattedValue = formattedDate;
|
|
11313
|
+
}
|
|
11314
|
+
}
|
|
11260
11315
|
|
|
11261
11316
|
if (formattedValue !== this.inputElement.value) {
|
|
11262
11317
|
this.skipNextProgrammaticInputEvent = true;
|
|
11263
|
-
if (
|
|
11318
|
+
if (this.maskInstance && this.type === 'credit-card') {
|
|
11319
|
+
// Route through the mask so its _value and el.value stay in lock-step
|
|
11320
|
+
// (set value calls updateControl which writes el.value = displayValue).
|
|
11321
|
+
// Writing el.value directly leaves the mask thinking displayValue is
|
|
11322
|
+
// stale; _saveSelection on the next focus/click then warns. Scoped to
|
|
11323
|
+
// credit-card so date's own formattedValue (raw ISO when calendar-invalid)
|
|
11324
|
+
// isn't re-masked through the mm/dd/yyyy mask, which would truncate it
|
|
11325
|
+
// and flip validity from patternMismatch to tooShort.
|
|
11326
|
+
this.maskInstance.value = formattedValue || '';
|
|
11327
|
+
} else if (formattedValue) {
|
|
11264
11328
|
this.inputElement.value = formattedValue;
|
|
11265
11329
|
} else {
|
|
11266
11330
|
this.inputElement.value = '';
|
|
@@ -11369,58 +11433,73 @@ class BaseInput extends AuroElement {
|
|
|
11369
11433
|
* @returns {void}
|
|
11370
11434
|
*/
|
|
11371
11435
|
configureAutoFormatting() {
|
|
11372
|
-
|
|
11373
|
-
|
|
11374
|
-
|
|
11375
|
-
|
|
11376
|
-
|
|
11377
|
-
this.
|
|
11378
|
-
|
|
11379
|
-
|
|
11380
|
-
|
|
11381
|
-
if (this.inputElement && maskOptions.mask) {
|
|
11382
|
-
|
|
11383
|
-
// Stash and clear any existing value before IMask init.
|
|
11384
|
-
// IMask's constructor processes the current input value which requires
|
|
11385
|
-
// selection state — clearing first avoids that scenario entirely.
|
|
11386
|
-
// When the format changes (e.g. locale switch) and we have a valid ISO
|
|
11387
|
-
// model value, compute the display string for the NEW format instead of
|
|
11388
|
-
// re-using the old display string, which may be invalid in the new mask.
|
|
11389
|
-
let existingValue = this.inputElement.value;
|
|
11390
|
-
if (
|
|
11391
|
-
this.util.isFullDateFormat(this.type, this.format) &&
|
|
11392
|
-
this.value &&
|
|
11393
|
-
dateFormatter.isValidDate(this.value) &&
|
|
11394
|
-
this.valueObject instanceof Date &&
|
|
11395
|
-
!Number.isNaN(this.valueObject.getTime()) &&
|
|
11396
|
-
typeof maskOptions.format === 'function'
|
|
11397
|
-
) {
|
|
11398
|
-
existingValue = maskOptions.format(this.valueObject);
|
|
11436
|
+
// Re-entrancy guard. The patched-setter's synthetic input event (suppressed
|
|
11437
|
+
// by _configuringMask above) could otherwise trigger handleInput →
|
|
11438
|
+
// processCreditCard → configureAutoFormatting before the outer call's
|
|
11439
|
+
// set value has finished its alignCursor pass.
|
|
11440
|
+
if (this._configuringMask) return;
|
|
11441
|
+
this._configuringMask = true;
|
|
11442
|
+
try {
|
|
11443
|
+
if (this.maskInstance) {
|
|
11444
|
+
this.maskInstance.destroy();
|
|
11399
11445
|
}
|
|
11400
11446
|
|
|
11401
|
-
|
|
11402
|
-
this.
|
|
11403
|
-
|
|
11404
|
-
this.maskInstance = IMask(this.inputElement, maskOptions);
|
|
11447
|
+
// Pass new format to util
|
|
11448
|
+
this.util.updateFormat(this.format);
|
|
11405
11449
|
|
|
11406
|
-
this.
|
|
11407
|
-
|
|
11408
|
-
|
|
11409
|
-
|
|
11450
|
+
const maskOptions = this.util.getMaskOptions(this.type, this.format);
|
|
11451
|
+
|
|
11452
|
+
if (this.inputElement && maskOptions.mask) {
|
|
11453
|
+
|
|
11454
|
+
// Stash and clear any existing value before IMask init.
|
|
11455
|
+
// IMask's constructor processes the current input value which requires
|
|
11456
|
+
// selection state — clearing first avoids that scenario entirely.
|
|
11457
|
+
// When the format changes (e.g. locale switch) and we have a valid ISO
|
|
11458
|
+
// model value, compute the display string for the NEW format instead of
|
|
11459
|
+
// re-using the old display string, which may be invalid in the new mask.
|
|
11460
|
+
let existingValue = this.inputElement.value;
|
|
11461
|
+
if (
|
|
11462
|
+
this.util.isFullDateFormat(this.type, this.format) &&
|
|
11463
|
+
this.value &&
|
|
11464
|
+
dateFormatter.isValidDate(this.value) &&
|
|
11465
|
+
this.valueObject instanceof Date &&
|
|
11466
|
+
!Number.isNaN(this.valueObject.getTime()) &&
|
|
11467
|
+
typeof maskOptions.format === 'function'
|
|
11468
|
+
) {
|
|
11469
|
+
existingValue = maskOptions.format(this.valueObject);
|
|
11410
11470
|
}
|
|
11411
|
-
});
|
|
11412
11471
|
|
|
11413
|
-
|
|
11414
|
-
this.value =
|
|
11415
|
-
|
|
11416
|
-
|
|
11417
|
-
|
|
11418
|
-
|
|
11472
|
+
this.skipNextProgrammaticInputEvent = true;
|
|
11473
|
+
this.inputElement.value = '';
|
|
11474
|
+
|
|
11475
|
+
this.maskInstance = IMask(this.inputElement, maskOptions);
|
|
11476
|
+
|
|
11477
|
+
this.maskInstance.on('accept', () => {
|
|
11478
|
+
// Suppress propagation during configureAutoFormatting's own value-restoration
|
|
11479
|
+
// (line below) — the mask emits 'accept' on every value-set, including ours,
|
|
11480
|
+
// and we don't want to overwrite a value the parent just pushed.
|
|
11481
|
+
if (this._configuringMask) return;
|
|
11482
|
+
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
11483
|
+
if (this.type === "date") {
|
|
11484
|
+
this._rawMaskValue = this.maskInstance.value;
|
|
11485
|
+
}
|
|
11486
|
+
});
|
|
11419
11487
|
|
|
11420
|
-
|
|
11421
|
-
|
|
11422
|
-
|
|
11488
|
+
this.maskInstance.on('complete', () => {
|
|
11489
|
+
if (this._configuringMask) return;
|
|
11490
|
+
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
11491
|
+
if (this.type === "date") {
|
|
11492
|
+
this._rawMaskValue = this.maskInstance.value;
|
|
11493
|
+
}
|
|
11494
|
+
});
|
|
11495
|
+
|
|
11496
|
+
// Restore the stashed value through IMask so it's properly masked
|
|
11497
|
+
if (existingValue) {
|
|
11498
|
+
this.maskInstance.value = existingValue;
|
|
11499
|
+
}
|
|
11423
11500
|
}
|
|
11501
|
+
} finally {
|
|
11502
|
+
this._configuringMask = false;
|
|
11424
11503
|
}
|
|
11425
11504
|
}
|
|
11426
11505
|
|
|
@@ -11707,10 +11786,10 @@ class BaseInput extends AuroElement {
|
|
|
11707
11786
|
},
|
|
11708
11787
|
{
|
|
11709
11788
|
name: 'Diners club',
|
|
11710
|
-
regex: /^(?<num>36|38)\d{0}/u,
|
|
11789
|
+
regex: /^(?<num>30[0-5]|36|38)\d{0}/u,
|
|
11711
11790
|
formatLength: 16,
|
|
11712
11791
|
errorMessage: CreditCardValidationMessage,
|
|
11713
|
-
cardIcon: '
|
|
11792
|
+
cardIcon: 'cc-dinersclub',
|
|
11714
11793
|
maskFormat: "0000 000000 0000"
|
|
11715
11794
|
},
|
|
11716
11795
|
{
|
|
@@ -12120,7 +12199,7 @@ class AuroHelpText extends LitElement {
|
|
|
12120
12199
|
}
|
|
12121
12200
|
}
|
|
12122
12201
|
|
|
12123
|
-
var formkitVersion = '
|
|
12202
|
+
var formkitVersion = '202606181613';
|
|
12124
12203
|
|
|
12125
12204
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
12126
12205
|
// See LICENSE in the project root for license information.
|
|
@@ -12458,10 +12537,6 @@ class AuroInput extends BaseInput {
|
|
|
12458
12537
|
return i18n(this.lang, this.type);
|
|
12459
12538
|
}
|
|
12460
12539
|
|
|
12461
|
-
if (this.type === 'date') {
|
|
12462
|
-
return i18n(this.lang, this.dateFormatMap[this.format] || 'dateMMDDYYYY');
|
|
12463
|
-
}
|
|
12464
|
-
|
|
12465
12540
|
return '';
|
|
12466
12541
|
}
|
|
12467
12542
|
|
|
@@ -75,10 +75,9 @@ export class AuroInputUtilities {
|
|
|
75
75
|
* Converts a model value to a display value for the input element.
|
|
76
76
|
* For full date formats, converts an ISO model value to the configured display format.
|
|
77
77
|
* @private
|
|
78
|
-
* @param {string} value - The model value (ISO string for date types).
|
|
79
78
|
* @param {Date|undefined} valueObject - Date object representation of value.
|
|
80
79
|
* @param {string} format - The date format string.
|
|
81
|
-
* @returns {string}
|
|
80
|
+
* @returns {string | undefined}
|
|
82
81
|
*/
|
|
83
82
|
private toFormattedValue;
|
|
84
83
|
}
|
|
@@ -7,32 +7,32 @@ The `auro-menu` element provides users a way to select from a list of options.
|
|
|
7
7
|
|
|
8
8
|
## Properties
|
|
9
9
|
|
|
10
|
-
| Property
|
|
11
|
-
|
|
12
|
-
| `
|
|
13
|
-
| `
|
|
14
|
-
| `
|
|
15
|
-
| `
|
|
16
|
-
| `
|
|
17
|
-
| `
|
|
18
|
-
| `
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
21
|
-
| `
|
|
22
|
-
| `
|
|
23
|
-
| `
|
|
24
|
-
| `
|
|
25
|
-
| `
|
|
26
|
-
| `
|
|
27
|
-
| `selectedOptions` | | readonly | `HTMLElement[]` | | Gets the currently selected options. |
|
|
28
|
-
| `value` | `value` | | `string` | | The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values. |
|
|
10
|
+
| Property | Attribute | Modifiers | Type | Default | Description |
|
|
11
|
+
|-------------------------|------------------|-----------|-----------------------|-------------|--------------------------------------------------|
|
|
12
|
+
| `currentLabel` | | readonly | `string` | | |
|
|
13
|
+
| `disabled` | `disabled` | | `boolean` | | When true, the entire menu and all options are disabled. |
|
|
14
|
+
| `hasLoadingPlaceholder` | | readonly | `boolean` | | Getter for loading placeholder state. |
|
|
15
|
+
| `index` | | | `number` | | |
|
|
16
|
+
| `layout` | | | `string` | | |
|
|
17
|
+
| `loading` | `loading` | | `boolean` | false | When true, displays a loading state using the loadingIcon and loadingText slots if provided. |
|
|
18
|
+
| `matchWord` | `matchword` | | `string` | "undefined" | Specifies a string used to highlight matched string parts in options. |
|
|
19
|
+
| `multiSelect` | `multiselect` | | `boolean` | false | When true, the selected option can be multiple options. |
|
|
20
|
+
| `noCheckmark` | `nocheckmark` | | `boolean` | false | When true, selected option will not show the checkmark. |
|
|
21
|
+
| `optionActive` | `optionactive` | | `object` | "undefined" | Specifies the current active menuOption. |
|
|
22
|
+
| `optionSelected` | `optionSelected` | | `object` | "undefined" | An array of currently selected menu options, type `HTMLElement` by default. In multi-select mode, `optionSelected` is an array of HTML elements. |
|
|
23
|
+
| `options` | | readonly | `HTMLElement[]` | | |
|
|
24
|
+
| `selectedOption` | | readonly | `HTMLElement \| null` | | Gets the first selected option, or null if none. |
|
|
25
|
+
| `selectedOptions` | | readonly | `HTMLElement[]` | | Gets the currently selected options as an array. |
|
|
26
|
+
| `value` | `value` | | `string` | "undefined" | The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values. |
|
|
29
27
|
|
|
30
28
|
## Methods
|
|
31
29
|
|
|
32
|
-
| Method | Type
|
|
33
|
-
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
30
|
+
| Method | Type | Description |
|
|
31
|
+
|----------------------|--------------------------------------------------|--------------------------------------------------|
|
|
32
|
+
| `navigateOptions` | `(direction: string): void` | Navigates through options using keyboard.<br /><br />**direction**: 'up' or 'down'. |
|
|
33
|
+
| `reset` | `(): void` | Resets the menu to its initial state.<br />This is the only way to return value to undefined. |
|
|
34
|
+
| `selectByValue` | `(value: string \| string[] \| null \| undefined): void` | Selects options by value.<br /><br />**value**: The value(s) to select. |
|
|
35
|
+
| `updateActiveOption` | `(indexOrOption: number \| HTMLElement): void` | Updates the active option state and dispatches events.<br />Accepts either a numeric index or an HTMLElement option.<br /><br />**indexOrOption**: Index of the option or the option element to make active. |
|
|
36
36
|
|
|
37
37
|
## Events
|
|
38
38
|
|
|
@@ -40,9 +40,8 @@ The `auro-menu` element provides users a way to select from a list of options.
|
|
|
40
40
|
|-------------------------------|--------------------------------------------------|--------------------------------------------------|
|
|
41
41
|
| `auroMenu-activatedOption` | `CustomEvent<Element>` | Notifies that a menuoption has been made `active`. |
|
|
42
42
|
| `auroMenu-customEventFired` | `CustomEvent<any>` | Notifies that a custom event has been fired. |
|
|
43
|
-
| `auroMenu-deselectPrevented` | `CustomEvent<{ values: HTMLElement[] }>` | Notifies that deselection was prevented and includes the affected options in `detail.values`. |
|
|
44
43
|
| `auroMenu-loadingChange` | `CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>` | Notifies when the loading attribute is changed. |
|
|
45
|
-
| `auroMenu-optionsChange` | `CustomEvent<{ options:
|
|
44
|
+
| `auroMenu-optionsChange` | `CustomEvent<{ options: Element[] \| undefined; }>` | |
|
|
46
45
|
| `auroMenu-selectValueFailure` | `CustomEvent<any>` | Notifies that an attempt to select a menuoption by matching a value has failed. |
|
|
47
46
|
| `auroMenu-selectValueReset` | `CustomEvent<any>` | Notifies that the component value has been reset. |
|
|
48
47
|
| `auroMenu-selectedOption` | `CustomEvent<any>` | Notifies that a new menuoption selection has been made. |
|
|
@@ -61,34 +60,31 @@ The `auro-menuoption` element provides users a way to define a menu option.
|
|
|
61
60
|
|
|
62
61
|
## Properties
|
|
63
62
|
|
|
64
|
-
| Property | Attribute
|
|
65
|
-
|
|
66
|
-
| `disabled` | `disabled`
|
|
67
|
-
| `iconTag` |
|
|
68
|
-
| `isActive` |
|
|
69
|
-
| `
|
|
70
|
-
| `
|
|
71
|
-
| `
|
|
72
|
-
| `
|
|
73
|
-
| `
|
|
74
|
-
| `value` | `value` | | `string` | | Specifies the value to be sent to a server. |
|
|
63
|
+
| Property | Attribute | Modifiers | Type | Default | Description |
|
|
64
|
+
|---------------|---------------|-----------|-----------|---------|--------------------------------------------------|
|
|
65
|
+
| `disabled` | `disabled` | | `boolean` | false | |
|
|
66
|
+
| `iconTag` | | | | | |
|
|
67
|
+
| `isActive` | | readonly | `boolean` | | Returns whether the menu option is currently active and selectable. |
|
|
68
|
+
| `layout` | | | `string` | | |
|
|
69
|
+
| `noCheckmark` | `noCheckmark` | | `boolean` | false | |
|
|
70
|
+
| `noMatch` | `nomatch` | | `boolean` | false | When true, marks this option as the "no matching results" placeholder shown by combobox<br />when the user's input does not match any available options. |
|
|
71
|
+
| `selected` | `selected` | | `boolean` | false | |
|
|
72
|
+
| `value` | `value` | | `string` | | |
|
|
75
73
|
|
|
76
74
|
## Methods
|
|
77
75
|
|
|
78
|
-
| Method
|
|
79
|
-
|
|
80
|
-
| `attachTo`
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `setSelected` | `(isSelected: boolean): void` | Sets the selected state of the menu option.<br />This function updates whether the option is currently selected.<br /><br />**isSelected**: Whether the option should be marked as selected. |
|
|
85
|
-
| `updateActive` | `(isActive: boolean): void` | Updates the active state and visual highlighting of the menu option.<br />This function toggles the option's active status and applies or removes the active CSS class.<br /><br />**isActive**: Whether the option should be marked as active. |
|
|
76
|
+
| Method | Type |
|
|
77
|
+
|--------------------|-----------------------|
|
|
78
|
+
| `attachTo` | `(): void` |
|
|
79
|
+
| `handleMenuChange` | `(): void` |
|
|
80
|
+
| `setSelected` | `(value: any): void` |
|
|
81
|
+
| `updateActive` | `(active: any): void` |
|
|
86
82
|
|
|
87
83
|
## Events
|
|
88
84
|
|
|
89
85
|
| Event | Type | Description |
|
|
90
86
|
|----------------------------|---------------------|--------------------------------------------------|
|
|
91
|
-
| `auroMenuOption-click` | `CustomEvent<this>` |
|
|
87
|
+
| `auroMenuOption-click` | `CustomEvent<this>` | Notifies that this option has been clicked. |
|
|
92
88
|
| `auroMenuOption-mouseover` | `CustomEvent<this>` | Notifies that this option has been hovered over. |
|
|
93
89
|
|
|
94
90
|
## Slots
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3
|
+
See LICENSE in the project root for license information.
|
|
4
|
+
|
|
5
|
+
HTML in this document is standardized and NOT to be edited.
|
|
6
|
+
All demo code should be added/edited in ./demo/css-only.md
|
|
7
|
+
|
|
8
|
+
With the exception of adding custom elements if needed for the demo.
|
|
9
|
+
|
|
10
|
+
----------------------- DO NOT EDIT -----------------------------
|
|
11
|
+
|
|
12
|
+
-->
|
|
13
|
+
|
|
14
|
+
<!DOCTYPE html>
|
|
15
|
+
<html lang="en">
|
|
16
|
+
<head>
|
|
17
|
+
<meta charset="UTF-8" />
|
|
18
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
19
|
+
<title>Auro Web Component Demo | auro-menu | CSS only</title>
|
|
20
|
+
|
|
21
|
+
<!-- highlight.js Stylesheet -->
|
|
22
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/github.min.css"/>
|
|
23
|
+
|
|
24
|
+
<!-- Legacy reference is still needed to support auro-menu's use of legacy token values at this time -->
|
|
25
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/legacy/auro-classic/CSSCustomProperties.css"/>
|
|
26
|
+
|
|
27
|
+
<!-- Design Token Alaska Theme -->
|
|
28
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/themes/alaska/CSSCustomProperties--alaska.min.css"/>
|
|
29
|
+
|
|
30
|
+
<!-- Webcore Stylesheet Alaska Theme -->
|
|
31
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/themes/alaska.global.min.css" />
|
|
32
|
+
|
|
33
|
+
<!-- Demo Specific Styles -->
|
|
34
|
+
<link rel="stylesheet" type="text/css" href="./styles.min.css" />
|
|
35
|
+
<style>
|
|
36
|
+
table {
|
|
37
|
+
--ds-color-container-secondary-default: transparent;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
tr:not(:last-of-type) {
|
|
41
|
+
border-bottom: 1px solid var(--ds-color-border-tertiary-default);
|
|
42
|
+
}
|
|
43
|
+
</style>
|
|
44
|
+
</head>
|
|
45
|
+
<body class="auro-markdown">
|
|
46
|
+
<main></main>
|
|
47
|
+
|
|
48
|
+
<script type="module">
|
|
49
|
+
import { renderPage } from './demo-support.min.js';
|
|
50
|
+
await renderPage('./css-only.md');
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<!-- If additional elements are needed for the demo, add them here. -->
|
|
54
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-header@latest/+esm" type="module"></script>
|
|
55
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-hyperlink@latest/+esm" type="module"></script>
|
|
56
|
+
</body>
|
|
57
|
+
</html>
|