Skip to content

Commit

Permalink
perf: bump up auro-menu version
Browse files Browse the repository at this point in the history
  • Loading branch information
sun-mota committed Oct 30, 2024
1 parent 59b4666 commit 6cc8f64
Show file tree
Hide file tree
Showing 8 changed files with 3,900 additions and 1,969 deletions.
15 changes: 11 additions & 4 deletions demo/api.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function valueExtractionExample() {
});
}

var dropdownVersion = '3.0.2';
var dropdownVersion = '3.1.0';

var styleCss = css`*,*:before,*:after{box-sizing:border-box}@media(prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}}*:focus-visible{outline:0}*:focus-visible{outline:0}:focus:not(:focus-visible){outline:3px solid transparent}.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}[slot=trigger]{width:100%;padding:0;border:0;cursor:pointer;font-family:inherit;font-size:inherit;text-align:left}:host [auro-dropdown]{position:relative}:host [auro-dropdown]::part(trigger){min-height:var(--ds-size-500, 2.5rem);max-height:var(--ds-size-500, 2.5rem)}:host [auro-dropdown]::part(popover){max-width:-webkit-fill-available}:host([disabled]) *{user-select:none}.outerWrapper{position:relative}auro-menuoption{pointer-events:none}.menuWrapper{padding:var(--ds-size-50, 0.25rem) 0}.selectElement-helpText{margin:var(--ds-size-50, 0.25rem) 0;font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:1rem}`;

Expand Down Expand Up @@ -247,7 +247,7 @@ class AuroSelect extends LitElement {
const triggerContentEl = this.dropdown.querySelector('#triggerFocus');

// remove all existing rendered value(s)
triggerContentEl.querySelectorAll('auro-menuoption, [valuestr]').forEach((elm) => {
triggerContentEl.querySelectorAll('auro-menuoption, [valuestr], [auro-menuoption]').forEach((elm) => {
elm.remove();
});

Expand Down Expand Up @@ -276,7 +276,14 @@ class AuroSelect extends LitElement {
* @returns {void}
*/
configureMenu() {
this.menu = this.querySelector('auro-menu') || this.querySelector('[auro-menu]');
this.menu = this.querySelector('auro-menu, [auro-menu]');
// racing condition on custom-select with custom-menu
if (!this.menu) {
setTimeout(() => {
this.configureMenu();
}, 0);
return;
}

this.menu.setAttribute('aria-hidden', 'true');

Expand Down Expand Up @@ -451,7 +458,7 @@ class AuroSelect extends LitElement {
*/
generateOptionsArray() {
if (this.menu) {
this.options = [...this.menu.querySelectorAll('auro-menuoption')];
this.options = [...this.menu.querySelectorAll('auro-menuoption, [auro-menuoption]')];
} else {
this.options = [];
}
Expand Down
15 changes: 11 additions & 4 deletions demo/index.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { AuroDependencyVersioning } from '@aurodesignsystem/auro-library/scripts
import { AuroDropdown } from '@aurodesignsystem/auro-dropdown/src/auro-dropdown.js';
import '@aurodesignsystem/auro-menu';

var dropdownVersion = '3.0.2';
var dropdownVersion = '3.1.0';

var styleCss = css`*,*:before,*:after{box-sizing:border-box}@media(prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}}*:focus-visible{outline:0}*:focus-visible{outline:0}:focus:not(:focus-visible){outline:3px solid transparent}.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}[slot=trigger]{width:100%;padding:0;border:0;cursor:pointer;font-family:inherit;font-size:inherit;text-align:left}:host [auro-dropdown]{position:relative}:host [auro-dropdown]::part(trigger){min-height:var(--ds-size-500, 2.5rem);max-height:var(--ds-size-500, 2.5rem)}:host [auro-dropdown]::part(popover){max-width:-webkit-fill-available}:host([disabled]) *{user-select:none}.outerWrapper{position:relative}auro-menuoption{pointer-events:none}.menuWrapper{padding:var(--ds-size-50, 0.25rem) 0}.selectElement-helpText{margin:var(--ds-size-50, 0.25rem) 0;font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:1rem}`;

Expand Down Expand Up @@ -195,7 +195,7 @@ class AuroSelect extends LitElement {
const triggerContentEl = this.dropdown.querySelector('#triggerFocus');

// remove all existing rendered value(s)
triggerContentEl.querySelectorAll('auro-menuoption, [valuestr]').forEach((elm) => {
triggerContentEl.querySelectorAll('auro-menuoption, [valuestr], [auro-menuoption]').forEach((elm) => {
elm.remove();
});

Expand Down Expand Up @@ -224,7 +224,14 @@ class AuroSelect extends LitElement {
* @returns {void}
*/
configureMenu() {
this.menu = this.querySelector('auro-menu') || this.querySelector('[auro-menu]');
this.menu = this.querySelector('auro-menu, [auro-menu]');
// racing condition on custom-select with custom-menu
if (!this.menu) {
setTimeout(() => {
this.configureMenu();
}, 0);
return;
}

this.menu.setAttribute('aria-hidden', 'true');

Expand Down Expand Up @@ -399,7 +406,7 @@ class AuroSelect extends LitElement {
*/
generateOptionsArray() {
if (this.menu) {
this.options = [...this.menu.querySelectorAll('auro-menuoption')];
this.options = [...this.menu.querySelectorAll('auro-menuoption, [auro-menuoption]')];
} else {
this.options = [];
}
Expand Down
Loading

0 comments on commit 6cc8f64

Please sign in to comment.