@aurodesignsystem-dev/auro-formkit 0.0.0-pr1395.0 → 0.0.0-pr1395.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/api.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/api.min.js +151 -40
- package/components/combobox/demo/index.min.js +151 -40
- package/components/combobox/dist/index.js +3 -3
- package/components/combobox/dist/registered.js +3 -3
- package/components/counter/demo/api.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.min.js +74 -13
- package/components/datepicker/demo/index.min.js +74 -13
- package/components/datepicker/dist/datepickerKeyboardStrategy.d.ts +4 -0
- package/components/datepicker/dist/index.js +74 -13
- package/components/datepicker/dist/registered.js +74 -13
- package/components/dropdown/demo/api.min.js +1 -1
- package/components/dropdown/demo/index.min.js +1 -1
- package/components/dropdown/dist/index.js +1 -1
- package/components/dropdown/dist/registered.js +1 -1
- package/components/form/demo/api.min.js +240 -63
- package/components/form/demo/index.min.js +240 -63
- package/components/input/demo/api.min.js +1 -1
- package/components/input/demo/index.min.js +1 -1
- package/components/input/dist/index.js +1 -1
- package/components/input/dist/registered.js +1 -1
- package/components/menu/demo/api.md +1 -1
- package/components/menu/demo/api.min.js +148 -37
- package/components/menu/demo/index.min.js +148 -37
- package/components/menu/dist/auro-menu.context.d.ts +15 -3
- package/components/menu/dist/auro-menu.d.ts +1 -1
- package/components/menu/dist/index.js +148 -37
- package/components/menu/dist/registered.js +148 -37
- package/components/radio/demo/api.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.min.js +158 -42
- package/components/select/demo/index.min.js +158 -42
- package/components/select/dist/index.js +10 -5
- package/components/select/dist/registered.js +10 -5
- package/custom-elements.json +1514 -1429
- package/package.json +11 -4
|
@@ -5031,7 +5031,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$3 {
|
|
|
5031
5031
|
}
|
|
5032
5032
|
};
|
|
5033
5033
|
|
|
5034
|
-
var formkitVersion$1 = '
|
|
5034
|
+
var formkitVersion$1 = '202603241855';
|
|
5035
5035
|
|
|
5036
5036
|
class AuroElement extends i$3 {
|
|
5037
5037
|
static get properties() {
|
|
@@ -6775,7 +6775,7 @@ class AuroHelpText extends i$3 {
|
|
|
6775
6775
|
}
|
|
6776
6776
|
}
|
|
6777
6777
|
|
|
6778
|
-
var formkitVersion = '
|
|
6778
|
+
var formkitVersion = '202603241855';
|
|
6779
6779
|
|
|
6780
6780
|
var styleCss$2 = 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);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, 0.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, 0.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, 0.625rem);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);line-height:var(--wcss-body-2xs-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, 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, 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}`;
|
|
6781
6781
|
|
|
@@ -7556,9 +7556,11 @@ class AuroSelect extends AuroElement$1 {
|
|
|
7556
7556
|
// Update the displayed value
|
|
7557
7557
|
this.updateDisplayedValue();
|
|
7558
7558
|
|
|
7559
|
-
|
|
7559
|
+
const options = event.detail.options || [];
|
|
7560
|
+
|
|
7560
7561
|
this.value = event.detail.stringValue;
|
|
7561
|
-
|
|
7562
|
+
|
|
7563
|
+
this.optionSelected = this.multiSelect ? options : options[0];
|
|
7562
7564
|
|
|
7563
7565
|
if (this.dropdown.isPopoverVisible) {
|
|
7564
7566
|
this.dropdown.hide();
|
|
@@ -7808,7 +7810,10 @@ class AuroSelect extends AuroElement$1 {
|
|
|
7808
7810
|
}
|
|
7809
7811
|
|
|
7810
7812
|
updated(changedProperties) {
|
|
7811
|
-
if (
|
|
7813
|
+
if (
|
|
7814
|
+
changedProperties.has('multiSelect') &&
|
|
7815
|
+
!changedProperties.has('value')
|
|
7816
|
+
) {
|
|
7812
7817
|
this.clearSelection();
|
|
7813
7818
|
}
|
|
7814
7819
|
|
|
@@ -8544,10 +8549,20 @@ class AuroMenuOption extends AuroElement$1 {
|
|
|
8544
8549
|
subscribe: true
|
|
8545
8550
|
});
|
|
8546
8551
|
|
|
8547
|
-
// Establish the key property as early as possible
|
|
8552
|
+
// Establish the key property as early as possible.
|
|
8553
|
+
// When a framework (e.g. Svelte) inserts the element into the DOM before
|
|
8554
|
+
// setting its `value` property, both `getAttribute('value')` and
|
|
8555
|
+
// `getAttribute('key')` return null here. Setting `this.key = null`
|
|
8556
|
+
// would block the fallback in `updated()` that assigns key from the
|
|
8557
|
+
// value property (the guard checked `=== undefined`). Only assign key
|
|
8558
|
+
// if at least one source attribute is actually present so that the
|
|
8559
|
+
// `updated()` fallback can run when the value property arrives later.
|
|
8548
8560
|
const valueAttr = this.getAttribute('value');
|
|
8549
8561
|
const keyAttr = this.getAttribute('key');
|
|
8550
|
-
|
|
8562
|
+
const resolvedKey = keyAttr !== null ? keyAttr : valueAttr;
|
|
8563
|
+
if (resolvedKey !== null) {
|
|
8564
|
+
this.key = resolvedKey;
|
|
8565
|
+
}
|
|
8551
8566
|
}
|
|
8552
8567
|
|
|
8553
8568
|
firstUpdated() {
|
|
@@ -8597,8 +8612,14 @@ class AuroMenuOption extends AuroElement$1 {
|
|
|
8597
8612
|
this.updateTextHighlight();
|
|
8598
8613
|
}
|
|
8599
8614
|
|
|
8600
|
-
// Set the key to be the passed value if no key is provided
|
|
8601
|
-
|
|
8615
|
+
// Set the key to be the passed value if no key is provided.
|
|
8616
|
+
// Loose equality (== null) is intentional: it catches both null AND
|
|
8617
|
+
// undefined. When a framework (e.g. Svelte, React) inserts the element
|
|
8618
|
+
// before setting its value property, connectedCallback skips key
|
|
8619
|
+
// assignment because both attributes are null at that point. The Lit
|
|
8620
|
+
// property default for `key` is undefined (not null), so strict
|
|
8621
|
+
// === null would miss the case and the fallback would never run.
|
|
8622
|
+
if (changedProperties.has('value') && this.key == null) { // eslint-disable-line eqeqeq, no-eq-null
|
|
8602
8623
|
this.key = this.value;
|
|
8603
8624
|
}
|
|
8604
8625
|
}
|
|
@@ -8967,6 +8988,9 @@ class MenuService {
|
|
|
8967
8988
|
this._subscribers = [];
|
|
8968
8989
|
this.internalUpdateInProgress = false;
|
|
8969
8990
|
this.selectedOptions = [];
|
|
8991
|
+
this._pendingValue = null;
|
|
8992
|
+
this._pendingRetryScheduled = false;
|
|
8993
|
+
this._pendingRetryCount = 0;
|
|
8970
8994
|
}
|
|
8971
8995
|
|
|
8972
8996
|
/**
|
|
@@ -9006,6 +9030,9 @@ class MenuService {
|
|
|
9006
9030
|
hostDisconnected() {
|
|
9007
9031
|
this._subscribers = [];
|
|
9008
9032
|
this._menuOptions = [];
|
|
9033
|
+
this._pendingValue = null;
|
|
9034
|
+
this._pendingRetryScheduled = false;
|
|
9035
|
+
this._pendingRetryCount = 0;
|
|
9009
9036
|
}
|
|
9010
9037
|
|
|
9011
9038
|
/**
|
|
@@ -9208,17 +9235,22 @@ class MenuService {
|
|
|
9208
9235
|
* @param {string|number|Array<string|number>} value - The value(s) to select.
|
|
9209
9236
|
*/
|
|
9210
9237
|
selectByValue(value) {
|
|
9211
|
-
|
|
9212
|
-
if (this.internalUpdateInProgress ||
|
|
9213
|
-
this.host.internalUpdateInProgress ||
|
|
9214
|
-
value === undefined ||
|
|
9238
|
+
const isEmptyValue = value === undefined ||
|
|
9215
9239
|
value === null ||
|
|
9216
9240
|
(Array.isArray(value) && value.length === 0) ||
|
|
9217
|
-
(typeof value === 'string' && value.trim() === '')
|
|
9241
|
+
(typeof value === 'string' && value.trim() === '');
|
|
9242
|
+
|
|
9243
|
+
// Early exit for invalid/empty values
|
|
9244
|
+
if (isEmptyValue) {
|
|
9218
9245
|
return;
|
|
9219
9246
|
}
|
|
9220
9247
|
|
|
9221
|
-
|
|
9248
|
+
// If an internal update cycle is still in progress, defer value application
|
|
9249
|
+
// rather than dropping it.
|
|
9250
|
+
if (this.internalUpdateInProgress || this.host.internalUpdateInProgress) {
|
|
9251
|
+
this.queuePendingValue(value);
|
|
9252
|
+
return;
|
|
9253
|
+
}
|
|
9222
9254
|
|
|
9223
9255
|
// Normalize values to array of strings
|
|
9224
9256
|
const normalizedValues = this._getNormalizedValues(value);
|
|
@@ -9230,33 +9262,100 @@ class MenuService {
|
|
|
9230
9262
|
validatedValues = [normalizedValues[0]];
|
|
9231
9263
|
}
|
|
9232
9264
|
|
|
9265
|
+
if (this._menuOptions.length === 0) {
|
|
9266
|
+
this.queuePendingValue(value);
|
|
9267
|
+
return;
|
|
9268
|
+
}
|
|
9269
|
+
|
|
9233
9270
|
// Find matching options by comparing available options to validated values
|
|
9234
9271
|
const trackedKeys = new Set();
|
|
9235
9272
|
const optionsToSelect = this._menuOptions.filter(option => {
|
|
9236
9273
|
const passesFilter = validatedValues.includes(option.key);
|
|
9237
9274
|
const alreadyTracked = trackedKeys.has(option.key);
|
|
9275
|
+
const isActive = option.isActive;
|
|
9238
9276
|
|
|
9239
9277
|
trackedKeys.add(option.key);
|
|
9240
9278
|
|
|
9241
9279
|
// Include the option in the options to be selected if it passes the filter check and
|
|
9242
9280
|
// either hasn't been tracked yet or selectAllMatchingOptions is true
|
|
9243
|
-
return passesFilter && (!alreadyTracked || (alreadyTracked && this.selectAllMatchingOptions));
|
|
9281
|
+
return isActive && passesFilter && (!alreadyTracked || (alreadyTracked && this.selectAllMatchingOptions));
|
|
9244
9282
|
});
|
|
9245
9283
|
|
|
9246
|
-
// Handle selection
|
|
9247
|
-
|
|
9248
|
-
|
|
9249
|
-
|
|
9250
|
-
|
|
9284
|
+
// Handle no matches: clear existing selection, but do not dispatch an intermediate
|
|
9285
|
+
// undefined value that can overwrite the host value in parent components.
|
|
9286
|
+
if (!optionsToSelect.length) {
|
|
9287
|
+
const hasUnresolvedKeys = this._menuOptions.some((option) => option.isActive && option.key == null);
|
|
9288
|
+
|
|
9289
|
+
if (hasUnresolvedKeys) {
|
|
9290
|
+
this.queuePendingValue(value);
|
|
9291
|
+
return;
|
|
9292
|
+
}
|
|
9293
|
+
|
|
9294
|
+
this.clearPendingValue();
|
|
9295
|
+
|
|
9296
|
+
if (this.selectedOptions.length > 0) {
|
|
9297
|
+
this.selectedOptions = [];
|
|
9298
|
+
}
|
|
9299
|
+
|
|
9300
|
+
// Always notify so the host resets any stale invalid value, even when
|
|
9301
|
+
// selectedOptions was already empty (e.g. double-clicking set-invalid).
|
|
9302
|
+
this.stageUpdate({ reason: 'no-match' });
|
|
9303
|
+
|
|
9304
|
+
// Dispatch failure event if no matches found
|
|
9305
|
+
if (validatedValues.length) {
|
|
9306
|
+
this.dispatchChangeEvent('auroMenu-selectValueFailure', {
|
|
9307
|
+
message: 'No matching options found for the provided value(s).',
|
|
9308
|
+
values: validatedValues
|
|
9309
|
+
});
|
|
9310
|
+
}
|
|
9311
|
+
|
|
9312
|
+
return;
|
|
9251
9313
|
}
|
|
9252
9314
|
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
values: validatedValues
|
|
9258
|
-
});
|
|
9315
|
+
this.clearPendingValue();
|
|
9316
|
+
|
|
9317
|
+
if (this.optionsArraysMatch(optionsToSelect, this.selectedOptions)) {
|
|
9318
|
+
return;
|
|
9259
9319
|
}
|
|
9320
|
+
|
|
9321
|
+
// Apply programmatic selection as a single transaction and emit one final state.
|
|
9322
|
+
this.selectedOptions = optionsToSelect;
|
|
9323
|
+
this.stageUpdate();
|
|
9324
|
+
}
|
|
9325
|
+
|
|
9326
|
+
/**
|
|
9327
|
+
* Queues a pending value and schedules a bounded retry.
|
|
9328
|
+
* @param {string|number|Array<string|number>} value - The value to retry.
|
|
9329
|
+
*/
|
|
9330
|
+
queuePendingValue(value) {
|
|
9331
|
+
this._pendingValue = value;
|
|
9332
|
+
|
|
9333
|
+
if (this._pendingRetryScheduled || this._pendingRetryCount >= 5) {
|
|
9334
|
+
return;
|
|
9335
|
+
}
|
|
9336
|
+
|
|
9337
|
+
this._pendingRetryScheduled = true;
|
|
9338
|
+
this._pendingRetryCount += 1;
|
|
9339
|
+
|
|
9340
|
+
setTimeout(() => {
|
|
9341
|
+
this._pendingRetryScheduled = false;
|
|
9342
|
+
|
|
9343
|
+
if (this._pendingValue == null) {
|
|
9344
|
+
return;
|
|
9345
|
+
}
|
|
9346
|
+
|
|
9347
|
+
const pendingValue = this._pendingValue;
|
|
9348
|
+
this.selectByValue(pendingValue);
|
|
9349
|
+
}, 0);
|
|
9350
|
+
}
|
|
9351
|
+
|
|
9352
|
+
/**
|
|
9353
|
+
* Clears pending retry state.
|
|
9354
|
+
*/
|
|
9355
|
+
clearPendingValue() {
|
|
9356
|
+
this._pendingValue = null;
|
|
9357
|
+
this._pendingRetryScheduled = false;
|
|
9358
|
+
this._pendingRetryCount = 0;
|
|
9260
9359
|
}
|
|
9261
9360
|
|
|
9262
9361
|
/**
|
|
@@ -9295,9 +9394,9 @@ class MenuService {
|
|
|
9295
9394
|
/**
|
|
9296
9395
|
* Stages an update to notify subscribers of state and value changes.
|
|
9297
9396
|
*/
|
|
9298
|
-
stageUpdate() {
|
|
9299
|
-
this.notifyStateChange();
|
|
9300
|
-
this.notifyValueChange();
|
|
9397
|
+
stageUpdate(meta = {}) {
|
|
9398
|
+
this.notifyStateChange(meta);
|
|
9399
|
+
this.notifyValueChange(meta);
|
|
9301
9400
|
}
|
|
9302
9401
|
|
|
9303
9402
|
/**
|
|
@@ -9312,14 +9411,18 @@ class MenuService {
|
|
|
9312
9411
|
/**
|
|
9313
9412
|
* Notifies subscribers of a state change (selected options has changed).
|
|
9314
9413
|
*/
|
|
9315
|
-
notifyStateChange() {
|
|
9316
|
-
this.notify({
|
|
9414
|
+
notifyStateChange(meta = {}) {
|
|
9415
|
+
this.notify({
|
|
9416
|
+
type: 'stateChange',
|
|
9417
|
+
selectedOptions: this.selectedOptions,
|
|
9418
|
+
...meta
|
|
9419
|
+
});
|
|
9317
9420
|
}
|
|
9318
9421
|
|
|
9319
9422
|
/**
|
|
9320
9423
|
* Notifies subscribers of a value change (current value has changed).
|
|
9321
9424
|
*/
|
|
9322
|
-
notifyValueChange() {
|
|
9425
|
+
notifyValueChange(meta = {}) {
|
|
9323
9426
|
|
|
9324
9427
|
// Prepare details for the event
|
|
9325
9428
|
const details = {
|
|
@@ -9335,10 +9438,9 @@ class MenuService {
|
|
|
9335
9438
|
|
|
9336
9439
|
this.notify({
|
|
9337
9440
|
type: 'valueChange',
|
|
9441
|
+
...meta,
|
|
9338
9442
|
...details
|
|
9339
9443
|
});
|
|
9340
|
-
|
|
9341
|
-
this.dispatchChangeEvent('auroMenu-selectedOption', details);
|
|
9342
9444
|
}
|
|
9343
9445
|
|
|
9344
9446
|
/**
|
|
@@ -9366,6 +9468,10 @@ class MenuService {
|
|
|
9366
9468
|
addMenuOption(option) {
|
|
9367
9469
|
this._menuOptions.push(option);
|
|
9368
9470
|
this.notify({ type: 'optionsChange', options: this._menuOptions });
|
|
9471
|
+
|
|
9472
|
+
if (this._pendingValue != null) {
|
|
9473
|
+
this.queuePendingValue(this._pendingValue);
|
|
9474
|
+
}
|
|
9369
9475
|
}
|
|
9370
9476
|
|
|
9371
9477
|
/**
|
|
@@ -9375,6 +9481,10 @@ class MenuService {
|
|
|
9375
9481
|
removeMenuOption(option) {
|
|
9376
9482
|
this._menuOptions = this._menuOptions.filter(opt => opt !== option);
|
|
9377
9483
|
this.notify({ type: 'optionsChange', options: this._menuOptions });
|
|
9484
|
+
|
|
9485
|
+
if (this._menuOptions.length === 0) {
|
|
9486
|
+
this.clearPendingValue();
|
|
9487
|
+
}
|
|
9378
9488
|
}
|
|
9379
9489
|
|
|
9380
9490
|
/**
|
|
@@ -9648,7 +9758,7 @@ class AuroMenu extends AuroElement$1 {
|
|
|
9648
9758
|
},
|
|
9649
9759
|
|
|
9650
9760
|
/**
|
|
9651
|
-
* Available menu options
|
|
9761
|
+
* Available menu options.
|
|
9652
9762
|
* @readonly
|
|
9653
9763
|
*/
|
|
9654
9764
|
options: {
|
|
@@ -9715,7 +9825,7 @@ class AuroMenu extends AuroElement$1 {
|
|
|
9715
9825
|
/**
|
|
9716
9826
|
* @readonly
|
|
9717
9827
|
* @returns {Array<HTMLElement>} - Returns the array of available menu options.
|
|
9718
|
-
* @deprecated
|
|
9828
|
+
* @deprecated Use `options` property instead.
|
|
9719
9829
|
*/
|
|
9720
9830
|
get items() {
|
|
9721
9831
|
return this.options;
|
|
@@ -9823,7 +9933,7 @@ class AuroMenu extends AuroElement$1 {
|
|
|
9823
9933
|
const newValue = event.stringValue;
|
|
9824
9934
|
|
|
9825
9935
|
// Check if the option or value has actually changed
|
|
9826
|
-
if (
|
|
9936
|
+
if (this.optionSelected !== newOption || this.stringValue !== newValue) {
|
|
9827
9937
|
this.optionSelected = newOption;
|
|
9828
9938
|
this.setInternalValue(newValue);
|
|
9829
9939
|
}
|
|
@@ -9897,8 +10007,13 @@ class AuroMenu extends AuroElement$1 {
|
|
|
9897
10007
|
updated(changedProperties) {
|
|
9898
10008
|
super.updated(changedProperties);
|
|
9899
10009
|
|
|
9900
|
-
//
|
|
9901
|
-
|
|
10010
|
+
// Apply value selection synchronously so that static-HTML fixtures
|
|
10011
|
+
// resolve within a single update cycle. The refactored selectByValue
|
|
10012
|
+
// no longer calls reset() first, so the destructive intermediate-event
|
|
10013
|
+
// cascade that originally required deferral is eliminated. If option
|
|
10014
|
+
// keys are not yet resolved (framework mount-order race), selectByValue
|
|
10015
|
+
// queues a bounded retry automatically via queuePendingValue.
|
|
10016
|
+
if (changedProperties.has('value') && !this.internalUpdateInProgress) {
|
|
9902
10017
|
this.menuService.selectByValue(this.value);
|
|
9903
10018
|
}
|
|
9904
10019
|
|
|
@@ -10078,12 +10193,13 @@ class AuroMenu extends AuroElement$1 {
|
|
|
10078
10193
|
* @param {any} source - The source that triggers this event.
|
|
10079
10194
|
* @private
|
|
10080
10195
|
*/
|
|
10081
|
-
notifySelectionChange({value, stringValue, keys, options} = {}) {
|
|
10196
|
+
notifySelectionChange({value, stringValue, keys, options, reason} = {}) {
|
|
10082
10197
|
dispatchMenuEvent(this, 'auroMenu-selectedOption', {
|
|
10083
10198
|
value,
|
|
10084
10199
|
stringValue,
|
|
10085
10200
|
keys,
|
|
10086
|
-
options
|
|
10201
|
+
options,
|
|
10202
|
+
reason
|
|
10087
10203
|
});
|
|
10088
10204
|
}
|
|
10089
10205
|
|