@aurodesignsystem-dev/auro-formkit 0.0.0-pr1505.0 → 0.0.0-pr1505.2
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.html +1 -2
- 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.html +1 -2
- package/components/combobox/demo/customize.md +108 -132
- package/components/combobox/demo/customize.min.js +6 -6
- package/components/combobox/demo/getting-started.min.js +6 -6
- package/components/combobox/demo/index.min.js +6 -6
- package/components/combobox/dist/index.js +4 -4
- package/components/combobox/dist/registered.js +4 -4
- 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/api.md +2 -2
- package/components/datepicker/demo/customize.js +2 -2
- package/components/datepicker/demo/customize.md +29 -74
- package/components/datepicker/demo/customize.min.js +10 -10
- package/components/datepicker/demo/index.min.js +8 -8
- package/components/datepicker/dist/index.js +8 -8
- package/components/datepicker/dist/registered.js +8 -8
- package/components/datepicker/dist/src/auro-datepicker.d.ts +2 -2
- 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.html +6 -6
- package/components/form/demo/customize.js +19 -0
- package/components/form/demo/customize.md +203 -51
- package/components/form/demo/customize.min.js +588 -83
- package/components/form/demo/getting-started.min.js +516 -83
- package/components/form/demo/index.min.js +516 -83
- package/components/form/demo/registerDemoDeps.min.js +153 -46
- package/components/form/dist/auro-form.d.ts +122 -4
- package/components/form/dist/index.js +363 -37
- package/components/form/dist/registered.js +363 -37
- package/components/input/demo/api.md +1 -1
- package/components/input/demo/customize.html +1 -2
- package/components/input/demo/customize.md +2 -2
- package/components/input/demo/customize.min.js +2 -2
- package/components/input/demo/getting-started.min.js +2 -2
- package/components/input/demo/index.md +2 -2
- package/components/input/demo/index.min.js +2 -2
- package/components/input/dist/auro-input.d.ts +1 -1
- package/components/input/dist/index.js +2 -2
- package/components/input/dist/registered.js +2 -2
- package/components/menu/demo/index.min.js +2 -2
- package/components/menu/dist/index.js +2 -2
- package/components/menu/dist/registered.js +2 -2
- 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/api.md +1 -0
- package/components/select/demo/customize.html +1 -2
- package/components/select/demo/customize.md +71 -0
- package/components/select/demo/customize.min.js +135 -28
- package/components/select/demo/getting-started.min.js +135 -28
- package/components/select/demo/index.min.js +135 -28
- package/components/select/demo/keyboard-behavior.md +18 -0
- package/components/select/dist/auro-select.d.ts +38 -2
- package/components/select/dist/index.js +133 -26
- package/components/select/dist/registered.js +133 -26
- package/components/select/dist/selectUtils.d.ts +12 -0
- package/custom-elements.json +1654 -1441
- package/package.json +1 -1
|
@@ -109,7 +109,7 @@ let AuroLibraryRuntimeUtils$b = class AuroLibraryRuntimeUtils {
|
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
111
|
|
|
112
|
-
/* eslint-disable no-underscore-dangle, max-lines, object-property-newline */
|
|
112
|
+
/* eslint-disable no-underscore-dangle, max-lines, object-property-newline, dot-location */
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
/**
|
|
@@ -117,7 +117,7 @@ let AuroLibraryRuntimeUtils$b = class AuroLibraryRuntimeUtils {
|
|
|
117
117
|
* @property {string | number | boolean | string[] | null} value - The value of the form element.
|
|
118
118
|
* @property {ValidityState} validity - The validity state of the form element, stored when fired from the form element.
|
|
119
119
|
* @property {boolean} required - Whether the form element is required or not.
|
|
120
|
-
* @property {
|
|
120
|
+
* @property {boolean} disabled - Whether the form element is currently disabled. Cached from the live attribute via the MutationObserver in `connectedCallback` and refreshed from `_handleAttributeMutations`.
|
|
121
121
|
*/
|
|
122
122
|
|
|
123
123
|
/**
|
|
@@ -201,6 +201,31 @@ class AuroForm extends i$3 {
|
|
|
201
201
|
*/
|
|
202
202
|
this.mutationObservers = [];
|
|
203
203
|
|
|
204
|
+
/**
|
|
205
|
+
* Captured initial (default) value per field `name`. Populated on first
|
|
206
|
+
* sight of each name in `_addElementToState` and preserved across
|
|
207
|
+
* subsequent `initializeState` cycles (slot change, rename, reset) so
|
|
208
|
+
* `_setInitialState` can detect user edits as `current !== initial`,
|
|
209
|
+
* matching HTML's `dirtyValueFlag` semantics.
|
|
210
|
+
* @private
|
|
211
|
+
* @type {Record<string, string | number | boolean | string[] | null | undefined>}
|
|
212
|
+
*/
|
|
213
|
+
this._initialValues = {};
|
|
214
|
+
|
|
215
|
+
// Single subtree observer that watches `disabled` and `name` attribute
|
|
216
|
+
// changes across all tracked form elements. The `name` watch is required:
|
|
217
|
+
// without it, renaming a tracked field at runtime leaves a stale key in
|
|
218
|
+
// `formState` that `_isNameDisabled` cannot resolve, so a renamed-but-
|
|
219
|
+
// disabled field would re-appear in `.value`.
|
|
220
|
+
/**
|
|
221
|
+
* @private
|
|
222
|
+
* @type {MutationObserver | null}
|
|
223
|
+
*/
|
|
224
|
+
this._attributeObserver = null;
|
|
225
|
+
|
|
226
|
+
/** @private */
|
|
227
|
+
this._handleAttributeMutations = this._handleAttributeMutations.bind(this);
|
|
228
|
+
|
|
204
229
|
// Bind listeners
|
|
205
230
|
/** @private */
|
|
206
231
|
this.reset = this.reset.bind(this);
|
|
@@ -269,6 +294,45 @@ class AuroForm extends i$3 {
|
|
|
269
294
|
return this._isInElementCollection(AuroForm.formElementTags, element);
|
|
270
295
|
}
|
|
271
296
|
|
|
297
|
+
/**
|
|
298
|
+
* Whether a given element is currently disabled. Disabled controls are excluded
|
|
299
|
+
* from submission, validity, and initial-state checks per the HTML spec
|
|
300
|
+
* (section 4.10.19.2 "Enabling and disabling form controls":
|
|
301
|
+
* https://www.w3.org/TR/2011/WD-html5-20110113/association-of-controls-and-forms.html).
|
|
302
|
+
*
|
|
303
|
+
* Implementation note: we deliberately read only the attribute. Every Auro
|
|
304
|
+
* form element in `formElementTags` declares `disabled` with `reflect: true`,
|
|
305
|
+
* so the attribute and property stay in sync. Reading the attribute also
|
|
306
|
+
* lets the MutationObserver in `connectedCallback` (which is filtered to
|
|
307
|
+
* `['disabled', 'name']`) be the single source of truth for re-renders.
|
|
308
|
+
* If a future form-element type ships without attribute reflection, expand
|
|
309
|
+
* this helper to also read `element.disabled`.
|
|
310
|
+
* @param {HTMLElement | undefined | null} element - The element to check.
|
|
311
|
+
* @returns {boolean}
|
|
312
|
+
* @private
|
|
313
|
+
*/
|
|
314
|
+
_isDisabled(element) {
|
|
315
|
+
return Boolean(element?.hasAttribute('disabled'));
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Whether the tracked form element registered under `name` is currently disabled.
|
|
320
|
+
* See `_isDisabled` for the HTML-spec rationale behind excluding disabled
|
|
321
|
+
* controls from form state.
|
|
322
|
+
*
|
|
323
|
+
* Reads a cached flag on `formState[name]` populated by `_addElementToState`
|
|
324
|
+
* at registration and refreshed by `_handleAttributeMutations` whenever the
|
|
325
|
+
* element's `disabled` attribute toggles. The cache is fed by the same
|
|
326
|
+
* `hasAttribute('disabled')` read as `_isDisabled`, so the "future form-element
|
|
327
|
+
* type without attribute reflection" caveat documented there applies here too.
|
|
328
|
+
* @param {string} name - The `name` attribute used to register the element.
|
|
329
|
+
* @returns {boolean}
|
|
330
|
+
* @private
|
|
331
|
+
*/
|
|
332
|
+
_isNameDisabled(name) {
|
|
333
|
+
return Boolean(this.formState[name]?.disabled);
|
|
334
|
+
}
|
|
335
|
+
|
|
272
336
|
/**
|
|
273
337
|
* Validates if an event is from a valid form element with a name.
|
|
274
338
|
* @param {Event} event - The event to validate.
|
|
@@ -308,6 +372,10 @@ class AuroForm extends i$3 {
|
|
|
308
372
|
*/
|
|
309
373
|
get value() {
|
|
310
374
|
return Object.keys(this.formState).reduce((acc, key) => {
|
|
375
|
+
if (this._isNameDisabled(key)) {
|
|
376
|
+
return acc;
|
|
377
|
+
}
|
|
378
|
+
|
|
311
379
|
acc[key] = this.formState[key].value;
|
|
312
380
|
return acc;
|
|
313
381
|
}, {});
|
|
@@ -331,23 +399,113 @@ class AuroForm extends i$3 {
|
|
|
331
399
|
return this._resetElements;
|
|
332
400
|
}
|
|
333
401
|
|
|
402
|
+
/**
|
|
403
|
+
* Raw constraint-validation check. Returns `true` when no enabled field
|
|
404
|
+
* has a validity error. Unlike the public `validity` getter, this does
|
|
405
|
+
* NOT gate on `isInitialState` — callers that need to make a decision
|
|
406
|
+
* based on the actual constraint state (submit-button enablement, the
|
|
407
|
+
* internal `submit()` gate) read this so a pre-filled valid form is
|
|
408
|
+
* correctly recognized as submittable at first render.
|
|
409
|
+
* @returns {boolean}
|
|
410
|
+
* @private
|
|
411
|
+
*/
|
|
412
|
+
_isFormValid() {
|
|
413
|
+
return !Object.keys(this.formState).some((key) => {
|
|
414
|
+
if (this._isNameDisabled(key)) {
|
|
415
|
+
return false;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
const formKey = this.formState[key];
|
|
419
|
+
// `null` validity means "not yet validated" — auro-input doesn't
|
|
420
|
+
// re-validate on every keystroke, so validity stays `null` between
|
|
421
|
+
// input events until blur. Treating `null` as invalid disables Submit
|
|
422
|
+
// the moment a user types into any field, which is the wrong UX.
|
|
423
|
+
// We treat a field as invalid in two cases:
|
|
424
|
+
// 1. validity is known-bad (non-null, non-'valid')
|
|
425
|
+
// 2. it's `required` and structurally empty — `valueMissing` is
|
|
426
|
+
// certain even without a validation pass.
|
|
427
|
+
// `submit()` calls `validate(true)` on every enabled field before
|
|
428
|
+
// reading `_isFormValid()`, so any not-yet-validated field that turns
|
|
429
|
+
// out to fail another constraint still blocks dispatch.
|
|
430
|
+
const knownInvalid = formKey.validity !== null && formKey.validity !== 'valid';
|
|
431
|
+
const requiredAndEmpty = formKey.required && this._normalizeEmpty(formKey.value) === null;
|
|
432
|
+
return knownInvalid || requiredAndEmpty;
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Whether the reset button should be enabled. True when the form has
|
|
438
|
+
* diverged from its initial state (so the user can always return to
|
|
439
|
+
* defaults — even if the dirty value lives behind a now-disabled field),
|
|
440
|
+
* OR when any non-disabled field has a current value or captured initial
|
|
441
|
+
* value (covers pre-filled forms and user-cleared-back-to-empty cases).
|
|
442
|
+
* @returns {boolean}
|
|
443
|
+
* @private
|
|
444
|
+
*/
|
|
445
|
+
_hasResetableState() {
|
|
446
|
+
// Form is dirty — always allow Reset, even if the dirt is on a field
|
|
447
|
+
// that has since been disabled. Without this branch, the user would
|
|
448
|
+
// have no UI path to return the form to its initial state.
|
|
449
|
+
if (!this._isInitialState) {
|
|
450
|
+
return true;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
return Object.keys(this.formState).some((key) => {
|
|
454
|
+
if (this._isNameDisabled(key)) {
|
|
455
|
+
return false;
|
|
456
|
+
}
|
|
457
|
+
const current = this._normalizeEmpty(this.formState[key].value);
|
|
458
|
+
const initial = this._normalizeEmpty(this._initialValues[key]);
|
|
459
|
+
return current !== null || initial !== null;
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Collapse empty representations to a single canonical `null`.
|
|
465
|
+
*
|
|
466
|
+
* `_addElementToState` captures `null` for a field that mounts without a
|
|
467
|
+
* `value` attribute (`element.value || element.getAttribute('value')` is
|
|
468
|
+
* falsy → resolves to `null`), but `sharedInputListener` later stores the
|
|
469
|
+
* raw `event.target.value` — which is `''` for a user-cleared text input.
|
|
470
|
+
* Without this normalization, backspacing back to empty would taint the
|
|
471
|
+
* form forever (`'' !== null`) and Reset would stay enabled with nothing
|
|
472
|
+
* to actually reset.
|
|
473
|
+
*
|
|
474
|
+
* `''`, `undefined`, and `[]` all collapse to `null`. The empty-array case
|
|
475
|
+
* covers checkbox-group, radio-group, and multiselect, where `[]` means
|
|
476
|
+
* "no selection" — semantically the same as `null`/`''`. Genuine values
|
|
477
|
+
* — including `0`, `false`, non-empty strings, and non-empty arrays —
|
|
478
|
+
* pass through unchanged so number, boolean, and populated multi-value
|
|
479
|
+
* fields still compare correctly.
|
|
480
|
+
* @param {*} value - Value to normalize.
|
|
481
|
+
* @returns {*}
|
|
482
|
+
* @private
|
|
483
|
+
*/
|
|
484
|
+
_normalizeEmpty(value) {
|
|
485
|
+
if (value === '' || value === undefined) {
|
|
486
|
+
return null;
|
|
487
|
+
}
|
|
488
|
+
if (Array.isArray(value) && value.length === 0) {
|
|
489
|
+
return null;
|
|
490
|
+
}
|
|
491
|
+
return value;
|
|
492
|
+
}
|
|
493
|
+
|
|
334
494
|
/**
|
|
335
495
|
* Infer validity status based on current formState.
|
|
496
|
+
*
|
|
497
|
+
* Validity stays `null` while the form is in its initial state — this is
|
|
498
|
+
* the "stay quiet until the user interacts" UX contract that consumers
|
|
499
|
+
* depend on to delay error indicators. Code that needs the raw
|
|
500
|
+
* constraint-validation result regardless of interaction (e.g.,
|
|
501
|
+
* submit-button enablement) should call `_isFormValid()` directly.
|
|
336
502
|
* @private
|
|
337
503
|
*/
|
|
338
504
|
_calculateValidity() {
|
|
339
505
|
if (this.isInitialState) {
|
|
340
506
|
this._validity = null;
|
|
341
507
|
} else {
|
|
342
|
-
|
|
343
|
-
const invalidKey = Object.keys(this.formState).
|
|
344
|
-
find((key) => {
|
|
345
|
-
const formKey = this.formState[key];
|
|
346
|
-
// these are NOT extra parens
|
|
347
|
-
// eslint-disable-next-line no-extra-parens
|
|
348
|
-
return (formKey.validity !== 'valid' && formKey.required) || (formKey.validity !== 'valid' && formKey.value !== null);
|
|
349
|
-
});
|
|
350
|
-
this._validity = invalidKey ? 'invalid' : 'valid';
|
|
508
|
+
this._validity = this._isFormValid() ? 'valid' : 'invalid';
|
|
351
509
|
}
|
|
352
510
|
}
|
|
353
511
|
|
|
@@ -363,20 +521,38 @@ class AuroForm extends i$3 {
|
|
|
363
521
|
}
|
|
364
522
|
|
|
365
523
|
/**
|
|
366
|
-
* Determines whether the form is in its initial (untouched) state
|
|
524
|
+
* Determines whether the form is in its initial (untouched) state.
|
|
525
|
+
*
|
|
526
|
+
* A field is tainted if either:
|
|
527
|
+
* - its value differs from the value captured on first render, OR
|
|
528
|
+
* - its validity is failing (anything other than `null` or `'valid'`).
|
|
529
|
+
*
|
|
530
|
+
* Validity acts as a backup signal: it catches users who interact with a
|
|
531
|
+
* field without changing its value (e.g., focusing and blurring a required
|
|
532
|
+
* field). We skip `null` (not yet validated) and `'valid'` (the default
|
|
533
|
+
* after Auro's auto-validation on mount) because neither proves the user
|
|
534
|
+
* touched anything.
|
|
367
535
|
* @returns {void}
|
|
368
536
|
* @private
|
|
369
537
|
*/
|
|
370
538
|
_setInitialState() {
|
|
371
|
-
const anyTainted = Object.keys(this.formState).some((key) =>
|
|
539
|
+
const anyTainted = Object.keys(this.formState).some((key) => {
|
|
540
|
+
// Normalize empty values so a freshly-captured `null` (no `value`
|
|
541
|
+
// attribute at mount) and a user-cleared `''` (input emptied via
|
|
542
|
+
// backspace) compare equal. Without this, backspacing back to an
|
|
543
|
+
// empty field leaves the form permanently tainted.
|
|
544
|
+
const initialValue = this._normalizeEmpty(this._initialValues[key]);
|
|
545
|
+
const currentValue = this._normalizeEmpty(this.formState[key].value);
|
|
546
|
+
const fieldValidity = this.formState[key].validity;
|
|
547
|
+
// eslint-disable-next-line no-extra-parens
|
|
548
|
+
return currentValue !== initialValue || (fieldValidity !== null && fieldValidity !== 'valid');
|
|
549
|
+
});
|
|
372
550
|
|
|
373
551
|
this._isInitialState = !anyTainted;
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
}
|
|
379
|
-
});
|
|
552
|
+
// Button state is owned by setDisabledStateOnButtons (called from updated()
|
|
553
|
+
// and reset()). Touching resetElement.disabled here causes a visible flicker
|
|
554
|
+
// in reset(), where the final setDisabledStateOnButtons is deferred behind
|
|
555
|
+
// an extra updateComplete.
|
|
380
556
|
}
|
|
381
557
|
|
|
382
558
|
/**
|
|
@@ -394,19 +570,19 @@ class AuroForm extends i$3 {
|
|
|
394
570
|
*/
|
|
395
571
|
setDisabledStateOnButtons() {
|
|
396
572
|
this._resetElements.forEach((element) => {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
}
|
|
573
|
+
// Reset is meaningful whenever any non-disabled field has a current
|
|
574
|
+
// value OR a captured default value — i.e., whenever the click would
|
|
575
|
+
// either clear something or restore a default.
|
|
576
|
+
element.disabled = !this._hasResetableState();
|
|
402
577
|
});
|
|
403
578
|
|
|
404
579
|
this._submitElements.forEach((element) => {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
580
|
+
// Submit enablement reads raw validity (not the gated public getter)
|
|
581
|
+
// so a pre-filled valid form is submittable at first render — the
|
|
582
|
+
// public `validity` stays `null` during initial state to keep error
|
|
583
|
+
// indicators quiet until the user interacts, but the button decision
|
|
584
|
+
// bypasses that gate.
|
|
585
|
+
element.disabled = !this._isFormValid();
|
|
410
586
|
});
|
|
411
587
|
}
|
|
412
588
|
|
|
@@ -452,9 +628,18 @@ class AuroForm extends i$3 {
|
|
|
452
628
|
value: element.value || element.getAttribute('value'),
|
|
453
629
|
validity: element.validity || null,
|
|
454
630
|
required: element.hasAttribute('required'),
|
|
455
|
-
|
|
631
|
+
disabled: element.hasAttribute('disabled'),
|
|
456
632
|
};
|
|
457
633
|
|
|
634
|
+
// Capture the initial (default) value once per name. Use `in` rather
|
|
635
|
+
// than `??=` so a captured `null` (an empty field at first sight) is
|
|
636
|
+
// preserved across rename/slot/reset cycles — `??=` would treat the
|
|
637
|
+
// stored `null` as nullish and overwrite it with whatever value the
|
|
638
|
+
// field has now, defeating the `current !== initial` taint check.
|
|
639
|
+
if (!(targetName in this._initialValues)) {
|
|
640
|
+
this._initialValues[targetName] = this.formState[targetName].value;
|
|
641
|
+
}
|
|
642
|
+
|
|
458
643
|
this._elements.push(element);
|
|
459
644
|
}
|
|
460
645
|
|
|
@@ -491,6 +676,15 @@ class AuroForm extends i$3 {
|
|
|
491
676
|
}
|
|
492
677
|
});
|
|
493
678
|
|
|
679
|
+
// Drop captured initial values for fields that no longer exist in the form.
|
|
680
|
+
// Rename migration in _handleAttributeMutations has already re-keyed surviving
|
|
681
|
+
// fields, so anything left here is a field that was removed from the DOM.
|
|
682
|
+
for (const key of Object.keys(this._initialValues)) {
|
|
683
|
+
if (!(key in this.formState)) {
|
|
684
|
+
delete this._initialValues[key];
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
|
|
494
688
|
this.dispatchEvent(new Event('change', {
|
|
495
689
|
bubbles: true,
|
|
496
690
|
composed: true,
|
|
@@ -535,16 +729,21 @@ class AuroForm extends i$3 {
|
|
|
535
729
|
* @returns {Promise<void>}
|
|
536
730
|
*/
|
|
537
731
|
async submit() {
|
|
538
|
-
// Force validation on
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
732
|
+
// Force validation on all enabled elements. Disabled fields are skipped
|
|
733
|
+
// because disabled controls are not validated nor submitted per the HTML spec.
|
|
734
|
+
this._elements.
|
|
735
|
+
filter((element) => !this._isDisabled(element)).
|
|
736
|
+
forEach((element) => {
|
|
737
|
+
element.validate(true);
|
|
738
|
+
});
|
|
542
739
|
|
|
543
740
|
// Wait for validation to complete and formState to update
|
|
544
741
|
await this.updateComplete;
|
|
545
742
|
|
|
546
|
-
//
|
|
547
|
-
|
|
743
|
+
// Gate on raw constraint-validation rather than the public `validity`
|
|
744
|
+
// getter (which is `null` while in initial state). A pre-filled valid
|
|
745
|
+
// form should be submittable without a prior user edit.
|
|
746
|
+
if (this._isFormValid()) {
|
|
548
747
|
this.dispatchEvent(new CustomEvent('submit', {
|
|
549
748
|
bubbles: true,
|
|
550
749
|
composed: true,
|
|
@@ -614,7 +813,14 @@ class AuroForm extends i$3 {
|
|
|
614
813
|
this._addElementToState(event.target);
|
|
615
814
|
}
|
|
616
815
|
|
|
617
|
-
|
|
816
|
+
// `auroFormElement-validated` can fire with `detail.validity === undefined`
|
|
817
|
+
// when auro-input's updated() lifecycle invokes `validate()` mid-edit but
|
|
818
|
+
// the validation framework's gating conditions (not focused, touched-or-
|
|
819
|
+
// has-value) aren't met — the dispatch still fires, just with the current
|
|
820
|
+
// (untouched) validity. Normalize to `null` so the rest of the form treats
|
|
821
|
+
// "no known status" identically whether it came from `_addElementToState`
|
|
822
|
+
// at mount or from this passthrough mid-typing.
|
|
823
|
+
this.formState[targetName].validity = event.detail.validity ?? null;
|
|
618
824
|
this._calculateValidity();
|
|
619
825
|
this.requestUpdate('formState');
|
|
620
826
|
}
|
|
@@ -626,6 +832,11 @@ class AuroForm extends i$3 {
|
|
|
626
832
|
*/
|
|
627
833
|
handleKeyDown(event) {
|
|
628
834
|
if (event.key === 'Enter' && this.isFormElement(event.target)) {
|
|
835
|
+
// Disabled controls do not submit a form natively.
|
|
836
|
+
if (this._isDisabled(event.target)) {
|
|
837
|
+
return;
|
|
838
|
+
}
|
|
839
|
+
|
|
629
840
|
// Don't submit if it's a textarea (allow new lines)
|
|
630
841
|
if (event.target.tagName.toLowerCase() === 'textarea' ||
|
|
631
842
|
event.target.hasAttribute('textarea')) {
|
|
@@ -657,6 +868,121 @@ class AuroForm extends i$3 {
|
|
|
657
868
|
});
|
|
658
869
|
}
|
|
659
870
|
|
|
871
|
+
/**
|
|
872
|
+
* Handle batched MutationObserver records for `disabled` and `name`
|
|
873
|
+
* attribute changes on tracked form elements. A `name` change invalidates
|
|
874
|
+
* the formState keying — we resolve it by re-initializing state. A `disabled`
|
|
875
|
+
* change simply needs a re-render (so `value` / `validity` getters re-evaluate)
|
|
876
|
+
* and a refresh of the submit/reset button enablement.
|
|
877
|
+
* @param {MutationRecord[]} mutations - The batched mutation records.
|
|
878
|
+
* @returns {void}
|
|
879
|
+
* @private
|
|
880
|
+
*/
|
|
881
|
+
_handleAttributeMutations(mutations) {
|
|
882
|
+
// Only mutations on tracked FORM elements matter here. The same observer
|
|
883
|
+
// also sees attribute changes on the submit/reset buttons (which this
|
|
884
|
+
// component itself toggles via `setDisabledStateOnButtons`); reacting to
|
|
885
|
+
// those would create an infinite observer/update loop.
|
|
886
|
+
const relevant = mutations.filter((mutation) => this.isFormElement(mutation.target));
|
|
887
|
+
if (relevant.length === 0) {
|
|
888
|
+
return;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
const renameMutations = relevant.filter((mutation) => mutation.attributeName === 'name');
|
|
892
|
+
if (renameMutations.length > 0) {
|
|
893
|
+
// Migrate each renamed field's captured initial value from the old key
|
|
894
|
+
// to the new key before `initializeState()` re-runs `_addElementToState`.
|
|
895
|
+
// Without this, the new-name lookup in `_initialValues` would miss, the
|
|
896
|
+
// field's current (possibly user-edited) value would be captured as the
|
|
897
|
+
// new initial, and the form would incorrectly flip back to its initial
|
|
898
|
+
// state. The old key would also leak in `_initialValues` indefinitely.
|
|
899
|
+
renameMutations.forEach((mutation) => {
|
|
900
|
+
const oldName = mutation.oldValue;
|
|
901
|
+
const newName = mutation.target.getAttribute('name');
|
|
902
|
+
if (!oldName || oldName === newName) {
|
|
903
|
+
return;
|
|
904
|
+
}
|
|
905
|
+
if (newName === null) {
|
|
906
|
+
// `name` attribute removed — field will fall out of formState on re-init.
|
|
907
|
+
// Drop its captured initial so it doesn't leak in _initialValues.
|
|
908
|
+
delete this._initialValues[oldName];
|
|
909
|
+
return;
|
|
910
|
+
}
|
|
911
|
+
if (oldName in this._initialValues) {
|
|
912
|
+
this._initialValues[newName] = this._initialValues[oldName];
|
|
913
|
+
delete this._initialValues[oldName];
|
|
914
|
+
}
|
|
915
|
+
});
|
|
916
|
+
// initializeState() rebuilds formState from scratch (re-keying any
|
|
917
|
+
// renamed element) and also dispatches `change` + refreshes button state.
|
|
918
|
+
// We also re-run _attachEventListeners() because elements that previously
|
|
919
|
+
// had no `name` were skipped by queryAuroElements() (which selects
|
|
920
|
+
// `[name]`) and therefore never received input/validation/keydown
|
|
921
|
+
// listeners. Re-attaching is safe — the listener-removal step inside
|
|
922
|
+
// _attachEventListeners() prevents duplicates on already-wired elements.
|
|
923
|
+
this.initializeState();
|
|
924
|
+
this._attachEventListeners();
|
|
925
|
+
return;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
// Refresh the cached `disabled` flag on each affected formState entry
|
|
929
|
+
// before the re-render, so getters that read `_isNameDisabled` see the
|
|
930
|
+
// current attribute state in the same tick.
|
|
931
|
+
relevant
|
|
932
|
+
.filter((mutation) => mutation.attributeName === 'disabled')
|
|
933
|
+
.forEach((mutation) => {
|
|
934
|
+
const name = mutation.target.getAttribute('name');
|
|
935
|
+
if (name && this.formState[name]) {
|
|
936
|
+
this.formState[name].disabled = mutation.target.hasAttribute('disabled');
|
|
937
|
+
}
|
|
938
|
+
});
|
|
939
|
+
|
|
940
|
+
this.requestUpdate('formState');
|
|
941
|
+
this.setDisabledStateOnButtons();
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
/**
|
|
945
|
+
* @returns {void}
|
|
946
|
+
*/
|
|
947
|
+
connectedCallback() {
|
|
948
|
+
super.connectedCallback();
|
|
949
|
+
|
|
950
|
+
// One observer rooted at the host catches `disabled` / `name` changes on
|
|
951
|
+
// any tracked form element (light-DOM children, including those nested in
|
|
952
|
+
// wrapper elements). Cheaper than allocating an observer per element and
|
|
953
|
+
// resilient to runtime DOM mutations.
|
|
954
|
+
if (!this._attributeObserver) {
|
|
955
|
+
this._attributeObserver = new MutationObserver(this._handleAttributeMutations);
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
this._attributeObserver.observe(this, {
|
|
959
|
+
attributes: true,
|
|
960
|
+
subtree: true,
|
|
961
|
+
attributeOldValue: true,
|
|
962
|
+
attributeFilter: [
|
|
963
|
+
'disabled',
|
|
964
|
+
'name'
|
|
965
|
+
]
|
|
966
|
+
});
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* @returns {void}
|
|
971
|
+
*/
|
|
972
|
+
disconnectedCallback() {
|
|
973
|
+
// Disconnect everything we own to avoid leaking observers (and the strong
|
|
974
|
+
// refs they hold to DOM nodes) past the form's lifetime.
|
|
975
|
+
this._attributeObserver?.disconnect();
|
|
976
|
+
this.mutationObservers.forEach((observer) => observer.disconnect());
|
|
977
|
+
this.mutationObservers = [];
|
|
978
|
+
// Intentionally do NOT clear _initialValues here. Slot-moves trigger a
|
|
979
|
+
// disconnect/reconnect cycle; clearing would cause the next initializeState
|
|
980
|
+
// to capture the user's edited values as the new "initial" and silently
|
|
981
|
+
// flip the form back to its initial state.
|
|
982
|
+
|
|
983
|
+
super.disconnectedCallback();
|
|
984
|
+
}
|
|
985
|
+
|
|
660
986
|
/**
|
|
661
987
|
* @param {import('lit').PropertyValues} _changedProperties - Map of changed properties with their previous values.
|
|
662
988
|
* @returns {void}
|
|
@@ -13043,7 +13369,7 @@ let AuroHelpText$8 = class AuroHelpText extends i$3 {
|
|
|
13043
13369
|
}
|
|
13044
13370
|
};
|
|
13045
13371
|
|
|
13046
|
-
var formkitVersion$8 = '
|
|
13372
|
+
var formkitVersion$8 = '202606222118';
|
|
13047
13373
|
|
|
13048
13374
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
13049
13375
|
// See LICENSE in the project root for license information.
|
|
@@ -13058,7 +13384,7 @@ var formkitVersion$8 = '202606171946';
|
|
|
13058
13384
|
* @slot ariaLabel.password.hide - Sets aria-label on password button to toggle off showing password
|
|
13059
13385
|
* @slot helpText - Sets the help text displayed below the input.
|
|
13060
13386
|
* @slot label - Sets the label text for the input.
|
|
13061
|
-
* @slot optionalLabel - Allows overriding the optional display text "(optional)", which appears next to the label.
|
|
13387
|
+
* @slot optionalLabel - Allows overriding the optional display text " (optional)", which appears next to the label.
|
|
13062
13388
|
* @slot displayValue - Allows custom HTML content to display in place of the value when the input is not focused.
|
|
13063
13389
|
* @csspart wrapper - Use for customizing the style of the root element
|
|
13064
13390
|
* @csspart label - Use for customizing the style of the label element
|
|
@@ -27162,7 +27488,7 @@ let AuroBibtemplate$3 = class AuroBibtemplate extends i$3 {
|
|
|
27162
27488
|
}
|
|
27163
27489
|
};
|
|
27164
27490
|
|
|
27165
|
-
var formkitVersion$2$1 = '
|
|
27491
|
+
var formkitVersion$2$1 = '202606222118';
|
|
27166
27492
|
|
|
27167
27493
|
let l$1$2 = class l{generateElementName(t,e){let o=t;return o+="-",o+=e.replace(/[.]/g,"_"),o}generateTag(o,s,a){const r=this.generateElementName(o,s),i=i$2`${s$3(r)}`;return customElements.get(r)||customElements.define(r,class extends a{}),i}};let d$1$2 = class d{registerComponent(t,e){customElements.get(t)||customElements.define(t,class extends e{});}closestElement(t,e=this,o=(e,s=e&&e.closest(t))=>e&&e!==document&&e!==window?s||o(e.getRootNode().host):null){return o(e)}handleComponentTagRename(t,e){const o=e.toLowerCase();t.tagName.toLowerCase()!==o&&t.setAttribute(o,true);}elementMatch(t,e){const o=e.toLowerCase();return t.tagName.toLowerCase()===o||t.hasAttribute(o)}getSlotText(t,e){const o=t.shadowRoot?.querySelector(`slot[name="${e}"]`),s=(o?.assignedNodes({flatten:true})||[]).map(t=>t.textContent?.trim()).join(" ").trim();return s||null}};let h$1$2 = class h{registerComponent(t,e){customElements.get(t)||customElements.define(t,class extends e{});}closestElement(t,e=this,o=(e,s=e&&e.closest(t))=>e&&e!==document&&e!==window?s||o(e.getRootNode().host):null){return o(e)}handleComponentTagRename(t,e){const o=e.toLowerCase();t.tagName.toLowerCase()!==o&&t.setAttribute(o,true);}elementMatch(t,e){const o=e.toLowerCase();return t.tagName.toLowerCase()===o||t.hasAttribute(o)}};var c$1$3=i$6`:host{color:var(--ds-auro-loader-color)}:host>span{background-color:var(--ds-auro-loader-background-color);border-color:var(--ds-auro-loader-border-color)}:host([onlight]),:host([appearance=brand]){--ds-auro-loader-color: var(--ds-basic-color-brand-primary, #01426a)}:host([ondark]),:host([appearance=inverse]){--ds-auro-loader-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([orbit])>span{--ds-auro-loader-background-color: transparent}:host([orbit])>span:nth-child(1){--ds-auro-loader-border-color: currentcolor;opacity:.25}:host([orbit])>span:nth-child(2){--ds-auro-loader-border-color: currentcolor;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent}
|
|
27168
27494
|
`,u$4$2=i$6`.body-default{font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-lg{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{font-size:var(--wcss-body-sm-font-size, .875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs{font-size:var(--wcss-body-xs-font-size, .75rem);line-height:var(--wcss-body-xs-line-height, 1rem)}.body-2xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-2xs-font-size, .625rem);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);line-height:var(--wcss-body-2xs-line-height, .875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular"),var(--wcss-display-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular"),var(--wcss-display-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular"),var(--wcss-display-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular"),var(--wcss-display-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular"),var(--wcss-display-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular"),var(--wcss-display-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular"),var(--wcss-heading-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular"),var(--wcss-heading-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular"),var(--wcss-heading-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular"),var(--wcss-heading-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular"),var(--wcss-heading-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-weight:var(--wcss-heading-xs-weight, 450);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular"),var(--wcss-heading-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-weight:var(--wcss-heading-2xs-weight, 450);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT"),var(--wcss-accent-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, .05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT"),var(--wcss-accent-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, .05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT"),var(--wcss-accent-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, .05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT"),var(--wcss-accent-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, .05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT"),var(--wcss-accent-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, .05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT"),var(--wcss-accent-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, .1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT"),var(--wcss-accent-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(.875rem, 1.1666666667vw, .875rem));font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, .1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}:focus:not(:focus-visible){outline:3px solid transparent}:host,:host>span{position:relative}:host{width:2rem;height:2rem;display:inline-block;font-size:0}:host>span{position:absolute;display:inline-block;float:none;top:0;left:0;width:2rem;height:2rem;border-radius:100%;border-style:solid;border-width:0;box-sizing:border-box}:host([xs]),:host([xs])>span{width:1.2rem;height:1.2rem}:host([sm]),:host([sm])>span{width:3rem;height:3rem}:host([md]),:host([md])>span{width:5rem;height:5rem}:host([lg]),:host([lg])>span{width:8rem;height:8rem}:host{--margin: .375rem;--margin-xs: .2rem;--margin-sm: .5rem;--margin-md: .75rem;--margin-lg: 1rem}:host([pulse]),:host([pulse])>span{position:relative}:host([pulse]){width:calc(3rem + var(--margin) * 6);height:calc(1rem + var(--margin) * 2)}:host([pulse])>span{width:1rem;height:1rem;margin:var(--margin);animation:pulse 1.5s ease infinite}:host([pulse][xs]){width:calc(1.95rem + var(--margin-xs) * 6);height:calc(.65rem + var(--margin-xs) * 2)}:host([pulse][xs])>span{margin:var(--margin-xs);width:.65rem;height:.65rem}:host([pulse][sm]){width:calc(6rem + var(--margin-sm) * 6);height:calc(2rem + var(--margin-sm) * 2)}:host([pulse][sm])>span{margin:var(--margin-sm);width:2rem;height:2rem}:host([pulse][md]){width:calc(9rem + var(--margin-md) * 6);height:calc(3rem + var(--margin-md) * 2)}:host([pulse][md])>span{margin:var(--margin-md);width:3rem;height:3rem}:host([pulse][lg]){width:calc(15rem + var(--margin-lg) * 6);height:calc(5rem + var(--margin-lg) * 2)}:host([pulse][lg])>span{margin:var(--margin-lg);width:5rem;height:5rem}:host([pulse])>span:nth-child(1){animation-delay:-.4s}:host([pulse])>span:nth-child(2){animation-delay:-.2s}:host([pulse])>span:nth-child(3){animation-delay:0ms}@keyframes pulse{0%,to{opacity:.1;transform:scale(.9)}50%{opacity:1;transform:scale(1.1)}}:host([orbit]),:host([orbit])>span{opacity:1}:host([orbit])>span{border-width:5px}:host([orbit])>span:nth-child(2){animation:orbit 2s linear infinite}:host([orbit][sm])>span{border-width:8px}:host([orbit][md])>span{border-width:13px}:host([orbit][lg])>span{border-width:21px}@keyframes orbit{0%{transform:rotate(0)}to{transform:rotate(360deg)}}:host([ringworm])>svg{animation:rotate 2s linear infinite;height:100%;width:100%;stroke:currentcolor;stroke-width:8}:host([ringworm]) .path{stroke-dashoffset:0;animation:ringworm 1.5s ease-in-out infinite;stroke-linecap:round}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes ringworm{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-124px}}:host([laser]){position:static;width:100%;display:block;height:0;overflow:hidden;font-size:unset}:host([laser])>span{position:fixed;width:100%;height:.25rem;border-radius:0;z-index:100}:host([laser])>span:nth-child(1){border-color:currentcolor;opacity:.25}:host([laser])>span:nth-child(2){border-color:currentcolor;animation:laser 2s linear infinite;opacity:1;width:50%}:host([laser][sm])>span:nth-child(2){width:20%}:host([laser][md])>span:nth-child(2){width:30%}:host([laser][lg])>span:nth-child(2){width:50%;animation-duration:1.5s}:host([laser][xl])>span:nth-child(2){width:80%;animation-duration:1.5s}@keyframes laser{0%{left:-100%}to{left:110%}}:host>.no-animation{display:none}@media (prefers-reduced-motion: reduce){:host{display:flex;align-items:center;justify-content:center}:host>span{opacity:1}:host>.loader{display:none}:host>svg{display:none}:host>.no-animation{display:block}}
|
|
@@ -32673,7 +32999,7 @@ let AuroHelpText$2$1 = class AuroHelpText extends i$3 {
|
|
|
32673
32999
|
}
|
|
32674
33000
|
};
|
|
32675
33001
|
|
|
32676
|
-
var formkitVersion$1$3 = '
|
|
33002
|
+
var formkitVersion$1$3 = '202606222118';
|
|
32677
33003
|
|
|
32678
33004
|
let AuroElement$2$2 = class AuroElement extends i$3 {
|
|
32679
33005
|
static get properties() {
|
|
@@ -46255,7 +46581,7 @@ let AuroHelpText$1$3 = class AuroHelpText extends i$3 {
|
|
|
46255
46581
|
}
|
|
46256
46582
|
};
|
|
46257
46583
|
|
|
46258
|
-
var formkitVersion$7 = '
|
|
46584
|
+
var formkitVersion$7 = '202606222118';
|
|
46259
46585
|
|
|
46260
46586
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
46261
46587
|
// See LICENSE in the project root for license information.
|
|
@@ -46270,7 +46596,7 @@ var formkitVersion$7 = '202606171946';
|
|
|
46270
46596
|
* @slot ariaLabel.password.hide - Sets aria-label on password button to toggle off showing password
|
|
46271
46597
|
* @slot helpText - Sets the help text displayed below the input.
|
|
46272
46598
|
* @slot label - Sets the label text for the input.
|
|
46273
|
-
* @slot optionalLabel - Allows overriding the optional display text "(optional)", which appears next to the label.
|
|
46599
|
+
* @slot optionalLabel - Allows overriding the optional display text " (optional)", which appears next to the label.
|
|
46274
46600
|
* @slot displayValue - Allows custom HTML content to display in place of the value when the input is not focused.
|
|
46275
46601
|
* @csspart wrapper - Use for customizing the style of the root element
|
|
46276
46602
|
* @csspart label - Use for customizing the style of the label element
|
|
@@ -47675,8 +48001,8 @@ const datepickerKeyboardStrategy = {
|
|
|
47675
48001
|
* @slot label - Defines the label content for the entire datepicker when `layout="snowflake"`.
|
|
47676
48002
|
* @slot toLabel - Defines the label content for the second input when the `range` attribute is used.
|
|
47677
48003
|
* @slot fromLabel - Defines the label content for the first input.
|
|
47678
|
-
* @slot optionalFromLabel - Overrides the "(optional)" text rendered next to the first input's label when the datepicker is not `required`.
|
|
47679
|
-
* @slot optionalToLabel - Overrides the "(optional)" text rendered next to the second input's label when `range` is set and the datepicker is not `required`.
|
|
48004
|
+
* @slot optionalFromLabel - Overrides the " (optional)" text rendered next to the first input's label when the datepicker is not `required`.
|
|
48005
|
+
* @slot optionalToLabel - Overrides the " (optional)" text rendered next to the second input's label when `range` is set and the datepicker is not `required`.
|
|
47680
48006
|
* @slot date_YYYY_MM_DD - Defines the content to display in the auro-calendar-cell for the specified date. The content text is colored using the success state token when the `highlight` attribute is applied to the slot.
|
|
47681
48007
|
* @slot popover_YYYY_MM_DD - Defines the content to display in the auro-calendar-cell popover for the specified date.
|
|
47682
48008
|
* @csspart dropdown - Use for customizing the style of the dropdown.
|
|
@@ -49669,7 +49995,7 @@ class AuroDatePicker extends AuroElement$5 {
|
|
|
49669
49995
|
}
|
|
49670
49996
|
<span slot="ariaLabel.clear">${this.runtimeUtils.getSlotText(this, 'ariaLabel.input.clear') || i18n$2(this.lang, 'clearInput')}</span>
|
|
49671
49997
|
<span slot="label"><slot name="fromLabel"></slot></span>
|
|
49672
|
-
<
|
|
49998
|
+
<slot name="optionalFromLabel" slot="optionalLabel"> (optional)</slot>
|
|
49673
49999
|
</${this.inputTag}>
|
|
49674
50000
|
</div>
|
|
49675
50001
|
|
|
@@ -49714,7 +50040,7 @@ class AuroDatePicker extends AuroElement$5 {
|
|
|
49714
50040
|
}
|
|
49715
50041
|
<span slot="ariaLabel.clear">${this.runtimeUtils.getSlotText(this, 'ariaLabel.input.clear') || this.runtimeUtils.getSlotText(this, 'ariaLabel.input.clear') || i18n$2(this.lang, 'clearInput')}</span>
|
|
49716
50042
|
<span slot="label"><slot name="toLabel"></slot></span>
|
|
49717
|
-
<
|
|
50043
|
+
<slot name="optionalToLabel" slot="optionalLabel"> (optional)</slot>
|
|
49718
50044
|
</${this.inputTag}>
|
|
49719
50045
|
</div>
|
|
49720
50046
|
` : undefined}
|
|
@@ -50958,7 +51284,7 @@ let AuroHelpText$1$2 = class AuroHelpText extends i$3 {
|
|
|
50958
51284
|
}
|
|
50959
51285
|
};
|
|
50960
51286
|
|
|
50961
|
-
var formkitVersion$1$2 = '
|
|
51287
|
+
var formkitVersion$1$2 = '202606222118';
|
|
50962
51288
|
|
|
50963
51289
|
// Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
|
|
50964
51290
|
// See LICENSE in the project root for license information.
|
|
@@ -55286,7 +55612,7 @@ let AuroHelpText$6 = class AuroHelpText extends i$3 {
|
|
|
55286
55612
|
}
|
|
55287
55613
|
};
|
|
55288
55614
|
|
|
55289
|
-
var formkitVersion$6 = '
|
|
55615
|
+
var formkitVersion$6 = '202606222118';
|
|
55290
55616
|
|
|
55291
55617
|
let AuroElement$1$2 = class AuroElement extends i$3 {
|
|
55292
55618
|
static get properties() {
|
|
@@ -59218,7 +59544,7 @@ let AuroHelpText$5 = class AuroHelpText extends i$3 {
|
|
|
59218
59544
|
}
|
|
59219
59545
|
};
|
|
59220
59546
|
|
|
59221
|
-
var formkitVersion$5 = '
|
|
59547
|
+
var formkitVersion$5 = '202606222118';
|
|
59222
59548
|
|
|
59223
59549
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
59224
59550
|
// See LICENSE in the project root for license information.
|
|
@@ -60968,7 +61294,7 @@ let AuroHelpText$4 = class AuroHelpText extends i$3 {
|
|
|
60968
61294
|
}
|
|
60969
61295
|
};
|
|
60970
61296
|
|
|
60971
|
-
var formkitVersion$4 = '
|
|
61297
|
+
var formkitVersion$4 = '202606222118';
|
|
60972
61298
|
|
|
60973
61299
|
// Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
|
|
60974
61300
|
// See LICENSE in the project root for license information.
|
|
@@ -66183,7 +66509,7 @@ let AuroHelpText$2 = class AuroHelpText extends i$3 {
|
|
|
66183
66509
|
}
|
|
66184
66510
|
};
|
|
66185
66511
|
|
|
66186
|
-
var formkitVersion$2 = '
|
|
66512
|
+
var formkitVersion$2 = '202606222118';
|
|
66187
66513
|
|
|
66188
66514
|
let AuroElement$2$1 = class AuroElement extends i$3 {
|
|
66189
66515
|
static get properties() {
|
|
@@ -79765,7 +80091,7 @@ let AuroHelpText$1$1 = class AuroHelpText extends i$3 {
|
|
|
79765
80091
|
}
|
|
79766
80092
|
};
|
|
79767
80093
|
|
|
79768
|
-
var formkitVersion$1$1 = '
|
|
80094
|
+
var formkitVersion$1$1 = '202606222118';
|
|
79769
80095
|
|
|
79770
80096
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
79771
80097
|
// See LICENSE in the project root for license information.
|
|
@@ -79780,7 +80106,7 @@ var formkitVersion$1$1 = '202606171946';
|
|
|
79780
80106
|
* @slot ariaLabel.password.hide - Sets aria-label on password button to toggle off showing password
|
|
79781
80107
|
* @slot helpText - Sets the help text displayed below the input.
|
|
79782
80108
|
* @slot label - Sets the label text for the input.
|
|
79783
|
-
* @slot optionalLabel - Allows overriding the optional display text "(optional)", which appears next to the label.
|
|
80109
|
+
* @slot optionalLabel - Allows overriding the optional display text " (optional)", which appears next to the label.
|
|
79784
80110
|
* @slot displayValue - Allows custom HTML content to display in place of the value when the input is not focused.
|
|
79785
80111
|
* @csspart wrapper - Use for customizing the style of the root element
|
|
79786
80112
|
* @csspart label - Use for customizing the style of the label element
|
|
@@ -80886,7 +81212,7 @@ let AuroBibtemplate$1 = class AuroBibtemplate extends i$3 {
|
|
|
80886
81212
|
}
|
|
80887
81213
|
};
|
|
80888
81214
|
|
|
80889
|
-
var formkitVersion$3 = '
|
|
81215
|
+
var formkitVersion$3 = '202606222118';
|
|
80890
81216
|
|
|
80891
81217
|
var styleCss$1$3 = i$6`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;text-align:left}:host [auro-dropdown]{--ds-auro-dropdown-trigger-background-color: transparent}:host #inputInBib::part(wrapper){box-shadow:none}:host #inputInBib::part(accent-left){display:none}:host([layout*=classic]) [auro-input]{width:100%}:host([layout*=classic]) [auro-input]::part(helpText){display:none}:host([layout*=classic]) #slotHolder{display:none}`;
|
|
80892
81218
|
|
|
@@ -83650,8 +83976,8 @@ class AuroMenu extends AuroElement$2 {
|
|
|
83650
83976
|
// Malformed JSON (e.g. a literal string that happens to start with "[") falls back
|
|
83651
83977
|
// to a single-item array rather than throwing during render.
|
|
83652
83978
|
try {
|
|
83653
|
-
|
|
83654
|
-
return
|
|
83979
|
+
// any valid JSON starting with `[` ALWAYS parses to an array
|
|
83980
|
+
return JSON.parse(this.value);
|
|
83655
83981
|
} catch {
|
|
83656
83982
|
return [this.value];
|
|
83657
83983
|
}
|
|
@@ -85650,6 +85976,21 @@ function getEnabledOptions(menu) {
|
|
|
85650
85976
|
return (menu?.options || []).filter((option) => !option.disabled);
|
|
85651
85977
|
}
|
|
85652
85978
|
|
|
85979
|
+
/**
|
|
85980
|
+
* Returns the active (selectable + visible) options for type-ahead navigation.
|
|
85981
|
+
*
|
|
85982
|
+
* Uses auro-menuoption's `isActive` getter, which excludes disabled, hidden,
|
|
85983
|
+
* and static options (e.g. `static nomatch` placeholders) so the type-ahead
|
|
85984
|
+
* cursor never lands on a non-actionable item. Same empty-safe handling as
|
|
85985
|
+
* `getEnabledOptions`.
|
|
85986
|
+
*
|
|
85987
|
+
* @param {HTMLElement | null | undefined} menu - The auro-menu element.
|
|
85988
|
+
* @returns {Array<HTMLElement>} Active options, empty array when none.
|
|
85989
|
+
*/
|
|
85990
|
+
function getActiveOptions(menu) {
|
|
85991
|
+
return (menu?.options || []).filter((option) => option.isActive);
|
|
85992
|
+
}
|
|
85993
|
+
|
|
85653
85994
|
/* eslint-disable new-cap */
|
|
85654
85995
|
|
|
85655
85996
|
const selectKeyboardStrategy = {
|
|
@@ -85682,6 +86023,14 @@ const selectKeyboardStrategy = {
|
|
|
85682
86023
|
},
|
|
85683
86024
|
|
|
85684
86025
|
Escape(component, evt, ctx) {
|
|
86026
|
+
// Always clear the type-ahead buffer — Escape is a universal cancel.
|
|
86027
|
+
// Safe to call when the buffer is empty.
|
|
86028
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
86029
|
+
if (typeof component._clearTypeaheadBuffer === 'function') {
|
|
86030
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
86031
|
+
component._clearTypeaheadBuffer();
|
|
86032
|
+
}
|
|
86033
|
+
|
|
85685
86034
|
if (!ctx.isExpanded) {
|
|
85686
86035
|
return;
|
|
85687
86036
|
}
|
|
@@ -85741,16 +86090,25 @@ const selectKeyboardStrategy = {
|
|
|
85741
86090
|
},
|
|
85742
86091
|
|
|
85743
86092
|
default(component, evt, ctx) {
|
|
85744
|
-
|
|
86093
|
+
// Space resolves to either typeahead-buffer extension or bib toggle
|
|
86094
|
+
// depending on whether a type-ahead buffer is active. Mirrors native
|
|
86095
|
+
// <select> and the WAI-ARIA APG Listbox guidance: mid-typeahead space
|
|
86096
|
+
// is a search character (e.g. "San Francisco"); otherwise it toggles.
|
|
85745
86097
|
if (evt.key === ' ') {
|
|
85746
86098
|
evt.preventDefault();
|
|
85747
86099
|
evt.stopPropagation();
|
|
86100
|
+
if (component.typeaheadBuffer && component.typeaheadBuffer.length > 0) {
|
|
86101
|
+
component.updateActiveOptionBasedOnKey(evt.key);
|
|
86102
|
+
return;
|
|
86103
|
+
}
|
|
85748
86104
|
if (ctx.isExpanded) {
|
|
85749
86105
|
component.dropdown.hide();
|
|
85750
|
-
|
|
86106
|
+
} else {
|
|
86107
|
+
component.dropdown.show();
|
|
85751
86108
|
}
|
|
85752
|
-
|
|
86109
|
+
return;
|
|
85753
86110
|
}
|
|
86111
|
+
component.updateActiveOptionBasedOnKey(evt.key);
|
|
85754
86112
|
},
|
|
85755
86113
|
};
|
|
85756
86114
|
|
|
@@ -89662,7 +90020,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$3 {
|
|
|
89662
90020
|
}
|
|
89663
90021
|
};
|
|
89664
90022
|
|
|
89665
|
-
var formkitVersion$1 = '
|
|
90023
|
+
var formkitVersion$1 = '202606222118';
|
|
89666
90024
|
|
|
89667
90025
|
class AuroElement extends i$3 {
|
|
89668
90026
|
static get properties() {
|
|
@@ -91675,7 +92033,7 @@ class AuroHelpText extends i$3 {
|
|
|
91675
92033
|
}
|
|
91676
92034
|
}
|
|
91677
92035
|
|
|
91678
|
-
var formkitVersion = '
|
|
92036
|
+
var formkitVersion = '202606222118';
|
|
91679
92037
|
|
|
91680
92038
|
var styleCss = i$6`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}.body-default{font-size:var(--wcss-body-default-font-size, 1rem);font-weight:var(--wcss-body-default-weight, );line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-default-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-default-emphasized{font-size:var(--wcss-body-default-emphasized-font-size, 1rem);font-weight:var(--wcss-body-default-emphasized-weight, );line-height:var(--wcss-body-default-emphasized-line-height, 1.5rem)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);font-weight:var(--wcss-body-lg-weight, );line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-lg,.body-lg-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg-emphasized{font-size:var(--wcss-body-lg-emphasized-font-size, 1.125rem);font-weight:var(--wcss-body-lg-emphasized-weight, );line-height:var(--wcss-body-lg-emphasized-line-height, 1.625rem)}.body-sm{font-size:var(--wcss-body-sm-font-size, 0.875rem);font-weight:var(--wcss-body-sm-weight, );line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-sm-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-sm-emphasized{font-size:var(--wcss-body-sm-emphasized-font-size, 0.875rem);font-weight:var(--wcss-body-sm-emphasized-weight, );line-height:var(--wcss-body-sm-emphasized-line-height, 1.25rem)}.body-xs{font-size:var(--wcss-body-xs-font-size, 0.75rem);font-weight:var(--wcss-body-xs-weight, );line-height:var(--wcss-body-xs-line-height, 1rem)}.body-xs,.body-xs-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs-emphasized{font-size:var(--wcss-body-xs-emphasized-font-size, 0.75rem);font-weight:var(--wcss-body-xs-emphasized-weight, );line-height:var(--wcss-body-xs-emphasized-line-height, 1rem)}.body-2xs{font-size:var(--wcss-body-2xs-font-size, 0.625rem);font-weight:var(--wcss-body-2xs-weight, );line-height:var(--wcss-body-2xs-line-height, 0.875rem)}.body-2xs,.body-2xs-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-2xs-emphasized{font-size:var(--wcss-body-2xs-emphasized-font-size, 0.625rem);font-weight:var(--wcss-body-2xs-emphasized-weight, );line-height:var(--wcss-body-2xs-emphasized-line-height, 0.875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular"),var(--wcss-display-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular"),var(--wcss-display-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular"),var(--wcss-display-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular"),var(--wcss-display-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular"),var(--wcss-display-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular"),var(--wcss-display-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular"),var(--wcss-heading-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular"),var(--wcss-heading-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular"),var(--wcss-heading-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular"),var(--wcss-heading-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular"),var(--wcss-heading-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-weight:var(--wcss-heading-xs-weight, 300);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular"),var(--wcss-heading-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-weight:var(--wcss-heading-2xs-weight, 300);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT"),var(--wcss-accent-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT"),var(--wcss-accent-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT"),var(--wcss-accent-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT"),var(--wcss-accent-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT"),var(--wcss-accent-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT"),var(--wcss-accent-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT"),var(--wcss-accent-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}[auro-dropdown]{--ds-auro-dropdown-trigger-border-color: var(--ds-auro-select-border-color);--ds-auro-dropdown-trigger-background-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-container-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-outline-color: var(--ds-auro-select-outline-color)}:host{display:inline-block;text-align:left;vertical-align:top}:host([layout*=emphasized]) [auro-dropdown],:host([layout*=snowflake]) [auro-dropdown]{--ds-auro-select-border-color: transparent}:host([layout*=emphasized]) .mainContent,:host([layout*=snowflake]) .mainContent{text-align:center}.mainContent{position:relative;display:flex;overflow:hidden;flex:1;flex-direction:column;align-items:center;justify-content:center}.valueContainer [slot=displayValue]{display:none}.accents{display:flex;flex-direction:row;align-items:center;justify-content:center}::slotted([slot=typeIcon]){margin-right:var(--ds-size-100, 0.5rem)}.displayValue{display:block}.displayValue:not(.force){display:none}.displayValue:not(.force).hasContent:is(.withValue):not(.hasFocus){display:block}.triggerContent{display:flex;width:100%;align-items:center;justify-content:center}:host([layout*=emphasized]) .triggerContent{padding:0 var(--ds-size-100, 0.5rem) 0 var(--ds-size-300, 1.5rem)}:host([layout*=snowflake]) .triggerContent{padding:0 var(--ds-size-100, 0.5rem) 0 var(--ds-size-200, 1rem)}:host([layout*=snowflake]) label{padding-block:var(--ds-size-25, 0.125rem)}:host([layout*=classic]) .triggerContent{padding:0 var(--ds-size-100, 0.5rem)}:host([layout*=classic]) .mainContent{align-items:start}:host([layout*=classic]) label{overflow:hidden;cursor:text;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) .value{height:auto}label{color:var(--ds-auro-select-label-text-color)}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-select-outline-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown],:host([appearance=inverse]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8);--ds-auro-select-outline-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([fluid]){width:100%}:host([disabled]){pointer-events:none;user-select:none}:host([disabled]:not([ondark])) [auro-dropdown],:host([disabled]:not([appearance=inverse])) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([layout*=classic])[disabled][ondark]) [auro-dropdown],:host(:not([layout*=classic])[disabled][appearance=inverse]) [auro-dropdown]{--ds-auro-select-border-color: transparent}`;
|
|
91681
92039
|
|
|
@@ -91780,6 +92138,16 @@ class AuroSelect extends AuroElement$1 {
|
|
|
91780
92138
|
* @private
|
|
91781
92139
|
*/
|
|
91782
92140
|
this.hasDisplayValueContent = false;
|
|
92141
|
+
|
|
92142
|
+
/**
|
|
92143
|
+
* @private
|
|
92144
|
+
*/
|
|
92145
|
+
this.typeaheadBuffer = '';
|
|
92146
|
+
|
|
92147
|
+
/**
|
|
92148
|
+
* @private
|
|
92149
|
+
*/
|
|
92150
|
+
this._typeaheadTimeout = null;
|
|
91783
92151
|
}
|
|
91784
92152
|
|
|
91785
92153
|
/**
|
|
@@ -91792,6 +92160,7 @@ class AuroSelect extends AuroElement$1 {
|
|
|
91792
92160
|
this.fullscreenBreakpoint = 'sm';
|
|
91793
92161
|
this.onDark = false;
|
|
91794
92162
|
this.isPopoverVisible = false;
|
|
92163
|
+
this.typeaheadTimeoutMs = 500;
|
|
91795
92164
|
|
|
91796
92165
|
// Layout Config
|
|
91797
92166
|
this.layout = 'classic';
|
|
@@ -92095,6 +92464,16 @@ class AuroSelect extends AuroElement$1 {
|
|
|
92095
92464
|
attribute: false
|
|
92096
92465
|
},
|
|
92097
92466
|
|
|
92467
|
+
/**
|
|
92468
|
+
* Milliseconds of keyboard inactivity before the type-ahead buffer resets.
|
|
92469
|
+
* Increase for users who type slowly.
|
|
92470
|
+
* @default 500
|
|
92471
|
+
*/
|
|
92472
|
+
typeaheadTimeoutMs: {
|
|
92473
|
+
type: Number,
|
|
92474
|
+
reflect: true
|
|
92475
|
+
},
|
|
92476
|
+
|
|
92098
92477
|
/**
|
|
92099
92478
|
* Specifies the `validityState` this element is in.
|
|
92100
92479
|
*/
|
|
@@ -92534,6 +92913,7 @@ class AuroSelect extends AuroElement$1 {
|
|
|
92534
92913
|
this.addEventListener('blur', () => {
|
|
92535
92914
|
this.validate();
|
|
92536
92915
|
this.hasFocus = false;
|
|
92916
|
+
this._clearTypeaheadBuffer();
|
|
92537
92917
|
});
|
|
92538
92918
|
}
|
|
92539
92919
|
|
|
@@ -92547,41 +92927,89 @@ class AuroSelect extends AuroElement$1 {
|
|
|
92547
92927
|
}
|
|
92548
92928
|
}
|
|
92549
92929
|
|
|
92930
|
+
/**
|
|
92931
|
+
* Returns the lowercase, trimmed text content of a menu option.
|
|
92932
|
+
* @private
|
|
92933
|
+
* @param {HTMLElement} option - The menu option element.
|
|
92934
|
+
* @returns {string}
|
|
92935
|
+
*/
|
|
92936
|
+
_getOptionDisplayText(option) {
|
|
92937
|
+
return (option.textContent || '').trim().toLowerCase();
|
|
92938
|
+
}
|
|
92939
|
+
|
|
92940
|
+
/**
|
|
92941
|
+
* Empties the type-ahead buffer and cancels any pending reset timeout.
|
|
92942
|
+
* Called when focus leaves the component, when Escape closes the bib, and on disconnect
|
|
92943
|
+
* so a stale buffer never bridges into a fresh interaction.
|
|
92944
|
+
* @private
|
|
92945
|
+
*/
|
|
92946
|
+
_clearTypeaheadBuffer() {
|
|
92947
|
+
if (this._typeaheadTimeout) {
|
|
92948
|
+
clearTimeout(this._typeaheadTimeout);
|
|
92949
|
+
this._typeaheadTimeout = null;
|
|
92950
|
+
}
|
|
92951
|
+
this.typeaheadBuffer = '';
|
|
92952
|
+
}
|
|
92953
|
+
|
|
92550
92954
|
/**
|
|
92551
92955
|
* Updates the active option in the menu based on keyboard input.
|
|
92956
|
+
*
|
|
92957
|
+
* Implements the WAI-ARIA APG Listbox type-ahead pattern: accumulates printable
|
|
92958
|
+
* keystrokes into a buffer that resets after `typeaheadTimeoutMs` of inactivity.
|
|
92959
|
+
* A multi-character buffer matches the first option whose displayed text starts
|
|
92960
|
+
* with the buffer; repeating a single character cycles through options that start
|
|
92961
|
+
* with that character.
|
|
92552
92962
|
* @private
|
|
92553
92963
|
* @param {string} _key - The key pressed by the user.
|
|
92554
92964
|
* @returns {void}
|
|
92555
92965
|
*/
|
|
92556
92966
|
updateActiveOptionBasedOnKey(_key) {
|
|
92967
|
+
// Ignore non-printable keys (Shift, ArrowDown, Tab, etc.)
|
|
92968
|
+
if (typeof _key !== 'string' || _key.length !== 1) {
|
|
92969
|
+
return;
|
|
92970
|
+
}
|
|
92557
92971
|
|
|
92558
|
-
//
|
|
92559
|
-
|
|
92560
|
-
|
|
92561
|
-
//
|
|
92562
|
-
|
|
92972
|
+
// No selectable options to match against — clear any stale buffer/timer so
|
|
92973
|
+
// Space stays a bib toggle and the next keystroke after fresh options load
|
|
92974
|
+
// starts cleanly. `getActiveOptions` excludes disabled, hidden, and static
|
|
92975
|
+
// options (e.g. `static nomatch` placeholders). Checked BEFORE mutating
|
|
92976
|
+
// the buffer.
|
|
92977
|
+
const options = getActiveOptions(this.menu);
|
|
92978
|
+
if (!options.length) {
|
|
92979
|
+
this._clearTypeaheadBuffer();
|
|
92980
|
+
return;
|
|
92981
|
+
}
|
|
92563
92982
|
|
|
92564
|
-
|
|
92565
|
-
this.lastLetter = key;
|
|
92983
|
+
const key = _key.toLowerCase();
|
|
92566
92984
|
|
|
92567
|
-
//
|
|
92568
|
-
|
|
92569
|
-
|
|
92570
|
-
|
|
92571
|
-
|
|
92985
|
+
// Reset the buffer after a period of inactivity
|
|
92986
|
+
if (this._typeaheadTimeout) {
|
|
92987
|
+
clearTimeout(this._typeaheadTimeout);
|
|
92988
|
+
}
|
|
92989
|
+
this._typeaheadTimeout = setTimeout(() => {
|
|
92990
|
+
this._clearTypeaheadBuffer();
|
|
92991
|
+
}, this.typeaheadTimeoutMs);
|
|
92572
92992
|
|
|
92573
|
-
|
|
92574
|
-
if (letterOptions.length) {
|
|
92993
|
+
this.typeaheadBuffer += key;
|
|
92575
92994
|
|
|
92576
|
-
|
|
92577
|
-
this.dropdown.show();
|
|
92995
|
+
const isRepeatedChar = this.typeaheadBuffer.length > 1 && new Set(this.typeaheadBuffer).size === 1;
|
|
92578
92996
|
|
|
92579
|
-
|
|
92580
|
-
|
|
92997
|
+
let match = null;
|
|
92998
|
+
if (isRepeatedChar) {
|
|
92999
|
+
const matches = options.filter((option) => this._getOptionDisplayText(option).startsWith(key));
|
|
93000
|
+
if (matches.length) {
|
|
93001
|
+
const cycleIndex = (this.typeaheadBuffer.length - 1) % matches.length;
|
|
93002
|
+
match = matches[cycleIndex];
|
|
93003
|
+
}
|
|
93004
|
+
} else {
|
|
93005
|
+
match = options.find((option) => this._getOptionDisplayText(option).startsWith(this.typeaheadBuffer));
|
|
93006
|
+
}
|
|
92581
93007
|
|
|
92582
|
-
|
|
92583
|
-
|
|
92584
|
-
|
|
93008
|
+
if (match) {
|
|
93009
|
+
if (!this.dropdown.isPopoverVisible) {
|
|
93010
|
+
this.dropdown.show();
|
|
93011
|
+
}
|
|
93012
|
+
this.menu.updateActiveOption(match);
|
|
92585
93013
|
}
|
|
92586
93014
|
}
|
|
92587
93015
|
|
|
@@ -92695,6 +93123,11 @@ class AuroSelect extends AuroElement$1 {
|
|
|
92695
93123
|
}
|
|
92696
93124
|
}
|
|
92697
93125
|
|
|
93126
|
+
disconnectedCallback() {
|
|
93127
|
+
super.disconnectedCallback();
|
|
93128
|
+
this._clearTypeaheadBuffer();
|
|
93129
|
+
}
|
|
93130
|
+
|
|
92698
93131
|
// lifecycle runs only after the element's DOM has been updated the first time
|
|
92699
93132
|
firstUpdated() {
|
|
92700
93133
|
// Add the tag name as an attribute if it is different than the component name
|
|
@@ -93228,7 +93661,79 @@ AuroMenu.register();
|
|
|
93228
93661
|
AuroMenuOption.register();
|
|
93229
93662
|
AuroSelect.register();
|
|
93230
93663
|
|
|
93664
|
+
async function disabledExample() {
|
|
93665
|
+
await customElements.whenDefined('auro-form');
|
|
93666
|
+
|
|
93667
|
+
const form = document.querySelector('#disabledExampleForm');
|
|
93668
|
+
const output = document.querySelector('#disabledExampleOutput');
|
|
93669
|
+
|
|
93670
|
+
if (!form || !output) {
|
|
93671
|
+
throw new Error('disabledExample: required nodes not yet rendered');
|
|
93672
|
+
}
|
|
93673
|
+
|
|
93674
|
+
await form.updateComplete;
|
|
93675
|
+
|
|
93676
|
+
form.addEventListener('submit', (event) => {
|
|
93677
|
+
output.textContent = JSON.stringify(event.detail.value, null, 2);
|
|
93678
|
+
});
|
|
93679
|
+
}
|
|
93680
|
+
|
|
93681
|
+
async function disableAfterEditExample() {
|
|
93682
|
+
await customElements.whenDefined('auro-form');
|
|
93683
|
+
|
|
93684
|
+
const form = document.querySelector('#disableAfterEditForm');
|
|
93685
|
+
const output = document.querySelector('#disableAfterEditOutput');
|
|
93686
|
+
const field = document.querySelector('#dae-field');
|
|
93687
|
+
const toggle = document.querySelector('#dae-toggle');
|
|
93688
|
+
|
|
93689
|
+
if (!form || !output || !field || !toggle) {
|
|
93690
|
+
throw new Error('disableAfterEditExample: required nodes not yet rendered');
|
|
93691
|
+
}
|
|
93692
|
+
|
|
93693
|
+
await form.updateComplete;
|
|
93694
|
+
|
|
93695
|
+
toggle.addEventListener('click', () => {
|
|
93696
|
+
const willDisable = !field.hasAttribute('disabled');
|
|
93697
|
+
if (willDisable) {
|
|
93698
|
+
field.setAttribute('disabled', '');
|
|
93699
|
+
toggle.textContent = 'Enable field';
|
|
93700
|
+
} else {
|
|
93701
|
+
field.removeAttribute('disabled');
|
|
93702
|
+
toggle.textContent = 'Disable field';
|
|
93703
|
+
}
|
|
93704
|
+
});
|
|
93705
|
+
|
|
93706
|
+
form.addEventListener('submit', (event) => {
|
|
93707
|
+
output.textContent = [
|
|
93708
|
+
'submit payload:',
|
|
93709
|
+
JSON.stringify(event.detail.value, null, 2),
|
|
93710
|
+
'',
|
|
93711
|
+
`form.isInitialState: ${form.isInitialState}`,
|
|
93712
|
+
].join('\n');
|
|
93713
|
+
});
|
|
93714
|
+
}
|
|
93715
|
+
|
|
93716
|
+
/* eslint-disable jsdoc/require-jsdoc */
|
|
93717
|
+
|
|
93718
|
+
|
|
93231
93719
|
AuroInput$2.register('input-two');
|
|
93232
93720
|
AuroDatePicker.register();
|
|
93233
93721
|
AuroForm.register();
|
|
93234
93722
|
AuroForm.register('custom-form');
|
|
93723
|
+
|
|
93724
|
+
async function initExamples(initCount) {
|
|
93725
|
+
initCount = initCount || 0;
|
|
93726
|
+
|
|
93727
|
+
try {
|
|
93728
|
+
await disabledExample();
|
|
93729
|
+
await disableAfterEditExample();
|
|
93730
|
+
} catch (err) {
|
|
93731
|
+
if (initCount <= 20) {
|
|
93732
|
+
setTimeout(() => {
|
|
93733
|
+
initExamples(initCount + 1);
|
|
93734
|
+
}, 100);
|
|
93735
|
+
}
|
|
93736
|
+
}
|
|
93737
|
+
}
|
|
93738
|
+
|
|
93739
|
+
export { initExamples };
|