From 1c81d9ce09660d0787e7a3c9d4c0cb2251ec8e72 Mon Sep 17 00:00:00 2001 From: chrisfalaska <> Date: Thu, 19 Dec 2024 13:44:48 -0800 Subject: [PATCH] fix: updating doc files --- components/menu/demo/api.min.js | 126 +++++++++++++++--------------- components/menu/demo/index.min.js | 126 +++++++++++++++--------------- 2 files changed, 126 insertions(+), 126 deletions(-) diff --git a/components/menu/demo/api.min.js b/components/menu/demo/api.min.js index 1efd38b..33bcd6a 100644 --- a/components/menu/demo/api.min.js +++ b/components/menu/demo/api.min.js @@ -621,86 +621,86 @@ class AuroMenu extends r { }); } - /** - * Method to apply `selected` attribute to `menuoption` via `value`. - * @private - * @param {String} value - Must match a unique `menuoption` value. - */ - selectByValue(value) { - let valueMatch = false; - if (!this.items) { - this.initItems(); - } + /** + * Method to apply `selected` attribute to `menuoption` via `value`. + * @private + * @param {String} value - Must match a unique `menuoption` value. + */ + selectByValue(value) { + let valueMatch = false; + if (!this.items) { + this.initItems(); + } - this.index = undefined; + this.index = undefined; - if (!this.multiSelect) { - if (this.value && this.value.length > 0) { - for (let index = 0; index < this.items.length; index += 1) { - if (this.items[index].value === value) { - valueMatch = true; - this.index = index; + if (!this.multiSelect) { + if (this.value && this.value.length > 0) { + for (let index = 0; index < this.items.length; index += 1) { + if (this.items[index].value === value) { + valueMatch = true; + this.index = index; + } } - } - - if (!valueMatch) { - // reset the menu to no selection - this.index = undefined; - // this event needs to be removed after select and combobox are updated to use the new standard name - this.dispatchEvent(new CustomEvent('auroMenuSelectValueFailure', { - bubbles: true, - cancelable: false, - composed: true, - })); + if (!valueMatch) { + // reset the menu to no selection + this.index = undefined; + + // this event needs to be removed after select and combobox are updated to use the new standard name + this.dispatchEvent(new CustomEvent('auroMenuSelectValueFailure', { + bubbles: true, + cancelable: false, + composed: true, + })); + + this.dispatchEvent(new CustomEvent('auroMenu-selectValueFailure', { + bubbles: true, + cancelable: false, + composed: true, + })); + } else { + this.makeSelection(); + } + } else { + this.resetOptionsStates(); - this.dispatchEvent(new CustomEvent('auroMenu-selectValueFailure', { + this.dispatchEvent(new CustomEvent('auroMenu-selectValueReset', { bubbles: true, cancelable: false, composed: true, })); - } else { - this.makeSelection(); } } else { - this.resetOptionsStates(); - - this.dispatchEvent(new CustomEvent('auroMenu-selectValueReset', { - bubbles: true, - cancelable: false, - composed: true, - })); - } - } else { - // handle multiSelect array values - if (!this.value || typeof this.value !== 'string') { - return; - } + // handle multiSelect array values + if (!this.value || typeof this.value !== 'string') { + return; + } - const trimmedValue = this.value.trim(); - if (!trimmedValue.startsWith('[') || !trimmedValue.endsWith(']')) { - return; - } + const trimmedValue = this.value.trim(); + if (!trimmedValue.startsWith('[') || !trimmedValue.endsWith(']')) { + return; + } - try { - const values = JSON.parse(trimmedValue); - if (Array.isArray(values)) { - values.forEach((val) => { - for (let index = 0; index < this.items.length; index += 1) { - if (this.items[index].value === val) { - this.index = index; - this.makeSelection(); - break; + try { + const values = JSON.parse(trimmedValue); + if (Array.isArray(values)) { + values.forEach((val) => { + for (let index = 0; index < this.items.length; index += 1) { + if (this.items[index].value === val) { + this.index = index; + this.makeSelection(); + break; + } } - } - }); + }); + } + } catch (error) { + /* eslint-disable no-console */ + console.error('Failed to parse multiSelect values:', error); } - } catch (error) { - /* eslint-disable no-console */ - console.error('Failed to parse multiSelect values:', error); } } -} /** * Used to make the active state for options follow mouseover. diff --git a/components/menu/demo/index.min.js b/components/menu/demo/index.min.js index b52396d..43c45e7 100644 --- a/components/menu/demo/index.min.js +++ b/components/menu/demo/index.min.js @@ -581,86 +581,86 @@ class AuroMenu extends r { }); } - /** - * Method to apply `selected` attribute to `menuoption` via `value`. - * @private - * @param {String} value - Must match a unique `menuoption` value. - */ - selectByValue(value) { - let valueMatch = false; - if (!this.items) { - this.initItems(); - } + /** + * Method to apply `selected` attribute to `menuoption` via `value`. + * @private + * @param {String} value - Must match a unique `menuoption` value. + */ + selectByValue(value) { + let valueMatch = false; + if (!this.items) { + this.initItems(); + } - this.index = undefined; + this.index = undefined; - if (!this.multiSelect) { - if (this.value && this.value.length > 0) { - for (let index = 0; index < this.items.length; index += 1) { - if (this.items[index].value === value) { - valueMatch = true; - this.index = index; + if (!this.multiSelect) { + if (this.value && this.value.length > 0) { + for (let index = 0; index < this.items.length; index += 1) { + if (this.items[index].value === value) { + valueMatch = true; + this.index = index; + } } - } - - if (!valueMatch) { - // reset the menu to no selection - this.index = undefined; - // this event needs to be removed after select and combobox are updated to use the new standard name - this.dispatchEvent(new CustomEvent('auroMenuSelectValueFailure', { - bubbles: true, - cancelable: false, - composed: true, - })); + if (!valueMatch) { + // reset the menu to no selection + this.index = undefined; + + // this event needs to be removed after select and combobox are updated to use the new standard name + this.dispatchEvent(new CustomEvent('auroMenuSelectValueFailure', { + bubbles: true, + cancelable: false, + composed: true, + })); + + this.dispatchEvent(new CustomEvent('auroMenu-selectValueFailure', { + bubbles: true, + cancelable: false, + composed: true, + })); + } else { + this.makeSelection(); + } + } else { + this.resetOptionsStates(); - this.dispatchEvent(new CustomEvent('auroMenu-selectValueFailure', { + this.dispatchEvent(new CustomEvent('auroMenu-selectValueReset', { bubbles: true, cancelable: false, composed: true, })); - } else { - this.makeSelection(); } } else { - this.resetOptionsStates(); - - this.dispatchEvent(new CustomEvent('auroMenu-selectValueReset', { - bubbles: true, - cancelable: false, - composed: true, - })); - } - } else { - // handle multiSelect array values - if (!this.value || typeof this.value !== 'string') { - return; - } + // handle multiSelect array values + if (!this.value || typeof this.value !== 'string') { + return; + } - const trimmedValue = this.value.trim(); - if (!trimmedValue.startsWith('[') || !trimmedValue.endsWith(']')) { - return; - } + const trimmedValue = this.value.trim(); + if (!trimmedValue.startsWith('[') || !trimmedValue.endsWith(']')) { + return; + } - try { - const values = JSON.parse(trimmedValue); - if (Array.isArray(values)) { - values.forEach((val) => { - for (let index = 0; index < this.items.length; index += 1) { - if (this.items[index].value === val) { - this.index = index; - this.makeSelection(); - break; + try { + const values = JSON.parse(trimmedValue); + if (Array.isArray(values)) { + values.forEach((val) => { + for (let index = 0; index < this.items.length; index += 1) { + if (this.items[index].value === val) { + this.index = index; + this.makeSelection(); + break; + } } - } - }); + }); + } + } catch (error) { + /* eslint-disable no-console */ + console.error('Failed to parse multiSelect values:', error); } - } catch (error) { - /* eslint-disable no-console */ - console.error('Failed to parse multiSelect values:', error); } } -} /** * Used to make the active state for options follow mouseover.