diff --git a/docs/core/makeup-expander/index.html b/docs/core/makeup-expander/index.html index b9d2ab45..6e82aa47 100644 --- a/docs/core/makeup-expander/index.html +++ b/docs/core/makeup-expander/index.html @@ -157,6 +157,15 @@

Auto Collapse On

A checkbox:

+ +

UseAriaExpanded=false

+ + + +
+

A link: www.ebay.com

+
+
diff --git a/docs/core/makeup-expander/index.js b/docs/core/makeup-expander/index.js index ed962d4d..87860561 100644 --- a/docs/core/makeup-expander/index.js +++ b/docs/core/makeup-expander/index.js @@ -10,6 +10,7 @@ const hoverExpanderEls = document.querySelectorAll(".expander--hover-only"); const hoverAndFocusExpanderEls = document.querySelectorAll(".expander--focus-and-hover"); const stealthExpanderEls = document.querySelectorAll(".expander--stealth-only"); const clickAndSpacebarExpanderEls = document.querySelectorAll(".expander--click-and-spacebar"); +const tooltipEls = document.querySelectorAll(".expander--tooltip"); const expanderWidgets = []; expanderWidgets.push(new Expander(clickExpanderEls[0], { expandOnClick: true })); @@ -49,11 +50,24 @@ clickAndSpacebarExpanderEls.forEach(function (el) { ); }); -expanderWidgets.forEach(function (item) { - item.el.addEventListener("expander-expand", function (e) { - console.log(e); - }); - item.el.addEventListener("expander-collapse", function (e) { - console.log(e); +tooltipEls.forEach(function (el) { + expanderWidgets.push( + new Expander(el, { + ariaControls: false, + autoCollapse: true, + expandOnFocus: true, + expandOnHover: true, + useAriaExpanded: false, + expandedClass: "expander__host-container--expanded", + }), + ); + + expanderWidgets.forEach(function (item) { + item.el.addEventListener("expander-expand", function (e) { + console.log(e); + }); + item.el.addEventListener("expander-collapse", function (e) { + console.log(e); + }); }); }); diff --git a/docs/core/makeup-expander/index.min.js b/docs/core/makeup-expander/index.min.js index 28f54fdb..02a02f3f 100644 --- a/docs/core/makeup-expander/index.min.js +++ b/docs/core/makeup-expander/index.min.js @@ -74,7 +74,8 @@ const defaultOptions = { expandOnHover: false, focusManagement: null, hostSelector: ".expander__host", - simulateSpacebarClick: false + simulateSpacebarClick: false, + useAriaExpanded: true }; function onHostKeyDown(e) { if (e.keyCode === 13 || e.keyCode === 32) { @@ -174,8 +175,14 @@ class _default { this._hostHoverListener = onHostHover.bind(this); this._focusExitListener = onFocusExit.bind(this); this._mouseLeaveListener = onMouseLeave.bind(this); - if (this.hostEl.getAttribute("aria-expanded") === null) { - this.hostEl.setAttribute("aria-expanded", "false"); + if (this.options.useAriaExpanded === true) { + const initialAriaExpanded = this.hostEl.getAttribute("aria-expanded"); + this._expanded = initialAriaExpanded === "true"; + if (initialAriaExpanded === null) { + this.hostEl.setAttribute("aria-expanded", "false"); + } + } else { + this._expanded = false; } if (this.options.ariaControls === true) { // ensure the widget has an id @@ -268,11 +275,13 @@ class _default { } } get expanded() { - return this.hostEl.getAttribute("aria-expanded") === "true"; + return this._expanded; } set expanded(bool) { if (bool === true && this.expanded === false) { - this.hostEl.setAttribute("aria-expanded", "true"); + if (this.options.useAriaExpanded === true) { + this.hostEl.setAttribute("aria-expanded", "true"); + } if (this.options.expandedClass) { this.el.classList.add(this.options.expandedClass); } @@ -285,7 +294,9 @@ class _default { })); } if (bool === false && this.expanded === true) { - this.hostEl.setAttribute("aria-expanded", "false"); + if (this.options.useAriaExpanded === true) { + this.hostEl.setAttribute("aria-expanded", "false"); + } if (this.options.expandedClass) { this.el.classList.remove(this.options.expandedClass); } @@ -294,6 +305,7 @@ class _default { detail: this.contentEl })); } + this._expanded = bool; this._expandWasKeyboardClickActivated = false; this._expandWasMouseClickActivated = false; this._expandWasFocusActivated = false; @@ -508,6 +520,7 @@ const hoverExpanderEls = document.querySelectorAll(".expander--hover-only"); const hoverAndFocusExpanderEls = document.querySelectorAll(".expander--focus-and-hover"); const stealthExpanderEls = document.querySelectorAll(".expander--stealth-only"); const clickAndSpacebarExpanderEls = document.querySelectorAll(".expander--click-and-spacebar"); +const tooltipEls = document.querySelectorAll(".expander--tooltip"); const expanderWidgets = []; expanderWidgets.push(new _makeupExpander.default(clickExpanderEls[0], { expandOnClick: true @@ -551,12 +564,22 @@ clickAndSpacebarExpanderEls.forEach(function (el) { expandedClass: "expander__host-container--expanded" })); }); -expanderWidgets.forEach(function (item) { - item.el.addEventListener("expander-expand", function (e) { - console.log(e); - }); - item.el.addEventListener("expander-collapse", function (e) { - console.log(e); +tooltipEls.forEach(function (el) { + expanderWidgets.push(new _makeupExpander.default(el, { + ariaControls: false, + autoCollapse: true, + expandOnFocus: true, + expandOnHover: true, + useAriaExpanded: false, + expandedClass: "expander__host-container--expanded" + })); + expanderWidgets.forEach(function (item) { + item.el.addEventListener("expander-expand", function (e) { + console.log(e); + }); + item.el.addEventListener("expander-collapse", function (e) { + console.log(e); + }); }); }); /******/ })() diff --git a/docs/core/makeup-expander/index.min.js.map b/docs/core/makeup-expander/index.min.js.map index b218353c..fd4f1374 100644 --- a/docs/core/makeup-expander/index.min.js.map +++ b/docs/core/makeup-expander/index.min.js.map @@ -1 +1 @@ -{"version":3,"file":"makeup-expander/index.min.js","mappings":";;;;;;;AAAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;ACnCa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf,2CAA2C,mBAAO,CAAC,GAAgB;AACnE,0CAA0C,mBAAO,CAAC,GAAqB;AACvE,+CAA+C,mBAAO,CAAC,GAAmB;AAC1E,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ,2CAA2C,gBAAgB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,WAAW;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;;;;;;;;AC1RF;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,oBAAoB;AACpB,uBAAuB;AACvB,2CAA2C,mBAAO,CAAC,GAAgB;AACnE,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3Ea;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,OAAO,EAAE,UAAU,EAAE,cAAc;;AAEpD;AACA;AACA;AACA,6BAA6B,IAAI,GAAG,mBAAmB;AACvD;AACA;AACA;;;;;;;UCvCA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;ACtBa;;AAEb,6CAA6C,mBAAO,CAAC,GAAiB;AACtE,qCAAqC,iCAAiC;AACtE;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH,CAAC,E","sources":["webpack://root/./packages/core/makeup-focusables/dist/cjs/index.js","webpack://root/./packages/core/makeup-expander/dist/cjs/index.js","webpack://root/./packages/core/makeup-exit-emitter/dist/cjs/index.js","webpack://root/./packages/core/makeup-next-id/dist/cjs/index.js","webpack://root/webpack/bootstrap","webpack://root/./docs/core/makeup-expander/index.compiled.js"],"sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nconst focusableElList = [\"a[href]\", \"area[href]\", \"button:not([disabled])\", \"embed\", \"iframe\", \"input:not([disabled])\", \"object\", \"select:not([disabled])\", \"textarea:not([disabled])\", \"*[tabindex]\", \"*[contenteditable]\"];\nconst focusableElSelector = focusableElList.join();\nfunction _default(el) {\n let keyboardOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let callback = arguments.length > 2 ? arguments[2] : undefined;\n if (callback) {\n const request = requestAnimationFrame(() => {\n callback(getFocusables(el, keyboardOnly));\n });\n return () => {\n cancelAnimationFrame(request);\n };\n }\n return getFocusables(el, keyboardOnly);\n}\nfunction getFocusables(el) {\n let keyboardOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let focusableEls = Array.prototype.slice.call(el.querySelectorAll(focusableElSelector));\n\n // filter out elements with display: none or nested in a display: none parent\n focusableEls = focusableEls.filter(function (focusableEl) {\n return !!(focusableEl.offsetWidth || focusableEl.offsetHeight || focusableEl.getClientRects().length);\n });\n if (keyboardOnly === true) {\n focusableEls = focusableEls.filter(function (focusableEl) {\n return focusableEl.getAttribute(\"tabindex\") !== \"-1\";\n });\n }\n return focusableEls;\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _makeupNextId = _interopRequireDefault(require(\"makeup-next-id\"));\nvar ExitEmitter = _interopRequireWildcard(require(\"makeup-exit-emitter\"));\nvar _makeupFocusables = _interopRequireDefault(require(\"makeup-focusables\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst defaultOptions = {\n alwaysDoFocusManagement: false,\n ariaControls: true,\n autoCollapse: false,\n collapseOnFocusOut: false,\n collapseOnMouseOut: false,\n collapseOnClickOut: false,\n collapseOnHostReFocus: false,\n contentSelector: \".expander__content\",\n expandedClass: null,\n expandOnClick: false,\n expandOnFocus: false,\n expandOnHover: false,\n focusManagement: null,\n hostSelector: \".expander__host\",\n simulateSpacebarClick: false\n};\nfunction onHostKeyDown(e) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this._keyboardClickFlag = true;\n }\n // if host element does not naturally trigger a click event on spacebar, we can force one to trigger here.\n // careful! if host already triggers click events naturally, we end up with a \"double-click\".\n if (e.keyCode === 32 && this.options.simulateSpacebarClick === true) {\n this.hostEl.click();\n }\n}\nfunction onHostMouseDown() {\n this._mouseClickFlag = true;\n}\nfunction onHostClick() {\n this._expandWasKeyboardClickActivated = this._keyboardClickFlag;\n this._expandWasMouseClickActivated = this._mouseClickFlag;\n this._widgetHasKeyboardFocus = this._keyboardClickFlag;\n this.expanded = !this.expanded;\n}\nfunction onHostFocus() {\n this._expandWasFocusActivated = true;\n this.expanded = true;\n}\n\n// NOTE: collapseOnHostReFocus cannot be used when expandOnFocus is true\nfunction onHostReFocus() {\n if (this.expanded && this._widgetHasKeyboardFocus) {\n this.expanded = false;\n }\n}\nfunction onHostHover() {\n clearTimeout(this._mouseLeft);\n this._expandWasHoverActivated = true;\n this.expanded = true;\n}\nfunction onFocusExit() {\n this._widgetHasKeyboardFocus = false;\n this.expanded = false;\n}\nfunction onMouseLeave() {\n clearTimeout(this._mouseLeft);\n this._mouseLeft = setTimeout(() => {\n this.expanded = false;\n }, 300);\n}\nfunction _onDocumentClick(e) {\n if (this.el.contains(e.target) === false) {\n this.expanded = false;\n }\n}\nfunction _onDocumentTouchStart() {\n this.documentClick = true;\n}\nfunction _onDocumentTouchMove() {\n this.documentClick = false;\n}\nfunction _onDocumentTouchEnd(e) {\n if (this.documentClick === true) {\n this.documentClick = false;\n if (this.el.contains(e.target) === false) {\n this.expanded = false;\n }\n }\n}\nfunction manageFocus(focusManagement, contentEl) {\n if (focusManagement === \"content\") {\n contentEl.setAttribute(\"tabindex\", \"-1\");\n contentEl.focus();\n } else if (focusManagement === \"focusable\") {\n (0, _makeupFocusables.default)(contentEl)[0]?.focus();\n } else if (focusManagement === \"interactive\") {\n (0, _makeupFocusables.default)(contentEl, true)[0]?.focus();\n } else if (focusManagement !== null) {\n const el = contentEl.querySelector(`#${focusManagement}`);\n if (el) {\n el.focus();\n }\n }\n}\nclass _default {\n constructor(el, selectedOptions) {\n this.options = Object.assign({}, defaultOptions, selectedOptions);\n this.el = el;\n this.hostEl = el.querySelector(this.options.hostSelector); // the keyboard focusable host el\n this.contentEl = el.querySelector(this.options.contentSelector);\n ExitEmitter.addFocusExit(this.el);\n this._hostKeyDownListener = onHostKeyDown.bind(this);\n this._hostMouseDownListener = onHostMouseDown.bind(this);\n this._documentClickListener = _onDocumentClick.bind(this);\n this._documentTouchStartListener = _onDocumentTouchStart.bind(this);\n this._documentTouchMoveListener = _onDocumentTouchMove.bind(this);\n this._documentTouchEndListener = _onDocumentTouchEnd.bind(this);\n this._hostClickListener = onHostClick.bind(this);\n this._hostFocusListener = onHostFocus.bind(this);\n this._hostReFocusListener = onHostReFocus.bind(this);\n this._hostHoverListener = onHostHover.bind(this);\n this._focusExitListener = onFocusExit.bind(this);\n this._mouseLeaveListener = onMouseLeave.bind(this);\n if (this.hostEl.getAttribute(\"aria-expanded\") === null) {\n this.hostEl.setAttribute(\"aria-expanded\", \"false\");\n }\n if (this.options.ariaControls === true) {\n // ensure the widget has an id\n (0, _makeupNextId.default)(this.el, \"expander\");\n this.contentEl.id = this.contentEl.id || `${this.el.id}-content`;\n this.hostEl.setAttribute(\"aria-controls\", this.contentEl.id);\n }\n this.expandOnClick = this.options.expandOnClick;\n this.expandOnFocus = this.options.expandOnFocus;\n this.expandOnHover = this.options.expandOnHover;\n this.collapseOnHostReFocus = this.options.collapseOnHostReFocus;\n if (this.options.autoCollapse === false) {\n this.collapseOnClickOut = this.options.collapseOnClickOut;\n this.collapseOnFocusOut = this.options.collapseOnFocusOut;\n this.collapseOnMouseOut = this.options.collapseOnMouseOut;\n }\n }\n set expandOnClick(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"keydown\", this._hostKeyDownListener);\n this.hostEl.addEventListener(\"mousedown\", this._hostMouseDownListener);\n this.hostEl.addEventListener(\"click\", this._hostClickListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnClickOut = true;\n this.collapseOnFocusOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"click\", this._hostClickListener);\n this.hostEl.removeEventListener(\"mousedown\", this._hostMouseDownListener);\n this.hostEl.removeEventListener(\"keydown\", this._hostKeyDownListener);\n }\n }\n set expandOnFocus(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"focus\", this._hostFocusListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnClickOut = true;\n this.collapseOnFocusOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"focus\", this._hostFocusListener);\n }\n }\n set collapseOnHostReFocus(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"focus\", this._hostReFocusListener);\n } else {\n this.hostEl.removeEventListener(\"focus\", this._hostReFocusListener);\n }\n }\n set expandOnHover(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"mouseenter\", this._hostHoverListener);\n this.contentEl.addEventListener(\"mouseenter\", this._hostHoverListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnMouseOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"mouseenter\", this._hostHoverListener);\n this.contentEl.removeEventListener(\"mouseenter\", this._hostHoverListener);\n }\n }\n set collapseOnClickOut(bool) {\n if (bool === true) {\n document.addEventListener(\"click\", this._documentClickListener);\n document.addEventListener(\"touchstart\", this._documentTouchStartListener);\n document.addEventListener(\"touchmove\", this._documentTouchMoveListener);\n document.addEventListener(\"touchend\", this._documentTouchEndListener);\n } else {\n document.removeEventListener(\"click\", this._documentClickListener);\n document.removeEventListener(\"touchstart\", this._documentTouchStartListener);\n document.removeEventListener(\"touchmove\", this._documentTouchMoveListener);\n document.removeEventListener(\"touchend\", this._documentTouchEndListener);\n }\n }\n set collapseOnFocusOut(bool) {\n if (bool === true) {\n this.el.addEventListener(\"focusExit\", this._focusExitListener);\n } else {\n this.el.removeEventListener(\"focusExit\", this._focusExitListener);\n }\n }\n set collapseOnMouseOut(bool) {\n if (bool === true) {\n this.el.addEventListener(\"mouseleave\", this._mouseLeaveListener);\n this.contentEl.addEventListener(\"mouseleave\", this._mouseLeaveListener);\n } else {\n this.el.removeEventListener(\"mouseleave\", this._mouseLeaveListener);\n this.contentEl.removeEventListener(\"mouseleave\", this._mouseLeaveListener);\n }\n }\n get expanded() {\n return this.hostEl.getAttribute(\"aria-expanded\") === \"true\";\n }\n set expanded(bool) {\n if (bool === true && this.expanded === false) {\n this.hostEl.setAttribute(\"aria-expanded\", \"true\");\n if (this.options.expandedClass) {\n this.el.classList.add(this.options.expandedClass);\n }\n if (this._expandWasKeyboardClickActivated || this._expandWasMouseClickActivated && this.options.alwaysDoFocusManagement) {\n manageFocus(this.options.focusManagement, this.contentEl);\n }\n this.el.dispatchEvent(new CustomEvent(\"expander-expand\", {\n bubbles: true,\n detail: this.contentEl\n }));\n }\n if (bool === false && this.expanded === true) {\n this.hostEl.setAttribute(\"aria-expanded\", \"false\");\n if (this.options.expandedClass) {\n this.el.classList.remove(this.options.expandedClass);\n }\n this.el.dispatchEvent(new CustomEvent(\"expander-collapse\", {\n bubbles: true,\n detail: this.contentEl\n }));\n }\n this._expandWasKeyboardClickActivated = false;\n this._expandWasMouseClickActivated = false;\n this._expandWasFocusActivated = false;\n this._expandWasHoverActivated = false;\n this._keyboardClickFlag = false;\n this._mouseClickFlag = false;\n }\n sleep() {\n if (this._destroyed !== true) {\n this.expandOnClick = false;\n this.expandOnFocus = false;\n this.expandOnHover = false;\n this.collapseOnClickOut = false;\n this.collapseOnFocusOut = false;\n this.collapseOnMouseOut = false;\n this.collapseOnHostReFocus = false;\n }\n }\n destroy() {\n this.sleep();\n this._destroyed = true;\n this._hostKeyDownListener = null;\n this._hostMouseDownListener = null;\n this._documentClickListener = null;\n this._documentTouchStartListener = null;\n this._documentTouchMoveListener = null;\n this._documentTouchEndListener = null;\n this._hostClickListener = null;\n this._hostFocusListener = null;\n this._hostReFocusListener = null;\n this._hostHoverListener = null;\n this._focusExitListener = null;\n this._mouseLeaveListener = null;\n this._widgetHasKeyboardFocus = null;\n }\n}\nexports.default = _default;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.addFocusExit = addFocusExit;\nexports.removeFocusExit = removeFocusExit;\nvar _makeupNextId = _interopRequireDefault(require(\"makeup-next-id\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst focusExitEmitters = {};\nfunction doFocusExit(el, fromElement, toElement) {\n el.dispatchEvent(new CustomEvent(\"focusExit\", {\n detail: {\n fromElement,\n toElement\n },\n bubbles: false // mirror the native mouseleave event\n }));\n}\nfunction onDocumentFocusIn(e) {\n const newFocusElement = e.target;\n const targetIsDescendant = this.el.contains(newFocusElement);\n\n // if focus has moved to a focusable descendant\n if (targetIsDescendant === true) {\n // set the target as the currently focussed element\n this.currentFocusElement = newFocusElement;\n } else {\n // else focus has not gone to a focusable descendant\n window.removeEventListener(\"blur\", this.onWindowBlurListener);\n document.removeEventListener(\"focusin\", this.onDocumentFocusInListener);\n doFocusExit(this.el, this.currentFocusElement, newFocusElement);\n this.currentFocusElement = null;\n }\n}\nfunction onWindowBlur() {\n doFocusExit(this.el, this.currentFocusElement, undefined);\n}\nfunction onWidgetFocusIn() {\n // listen for focus moving to anywhere in document\n // note that mouse click on buttons, checkboxes and radios does not trigger focus events in all browsers!\n document.addEventListener(\"focusin\", this.onDocumentFocusInListener);\n // listen for focus leaving the window\n window.addEventListener(\"blur\", this.onWindowBlurListener);\n}\nclass FocusExitEmitter {\n constructor(el) {\n this.el = el;\n this.currentFocusElement = null;\n this.onWidgetFocusInListener = onWidgetFocusIn.bind(this);\n this.onDocumentFocusInListener = onDocumentFocusIn.bind(this);\n this.onWindowBlurListener = onWindowBlur.bind(this);\n this.el.addEventListener(\"focusin\", this.onWidgetFocusInListener);\n }\n removeEventListeners() {\n window.removeEventListener(\"blur\", this.onWindowBlurListener);\n document.removeEventListener(\"focusin\", this.onDocumentFocusInListener);\n this.el.removeEventListener(\"focusin\", this.onWidgetFocusInListener);\n }\n}\nfunction addFocusExit(el) {\n let exitEmitter = null;\n (0, _makeupNextId.default)(el);\n if (!focusExitEmitters[el.id]) {\n exitEmitter = new FocusExitEmitter(el);\n focusExitEmitters[el.id] = exitEmitter;\n }\n return exitEmitter;\n}\nfunction removeFocusExit(el) {\n const exitEmitter = focusExitEmitters[el.id];\n if (exitEmitter) {\n exitEmitter.removeEventListeners();\n delete focusExitEmitters[el.id];\n }\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nconst sequenceMap = {};\nconst defaultPrefix = \"nid\";\nconst randomPortion = createRandomPortion(3);\nfunction randomNumber(max) {\n return Math.floor(Math.random() * max);\n}\nfunction createRandomPortion(size) {\n const letters = \"abcdefghijklmnopqrstuvwxyz\";\n const digits = \"0123456789\";\n const allChars = letters + digits;\n\n // to ensure a valid HTML ID (when prefix is empty), first character must be a letter\n let portion = letters[randomNumber(25)];\n\n // start iterating from 1, as we already have our first char\n for (let i = 1; i < size; i++) {\n portion += allChars[randomNumber(35)];\n }\n return portion;\n}\nfunction _default(el) {\n let prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultPrefix;\n const separator = prefix === \"\" ? \"\" : \"-\";\n\n // join first prefix with random portion to create key\n const key = `${prefix}${separator}${randomPortion}`;\n\n // initialise key in sequence map if necessary\n sequenceMap[key] = sequenceMap[key] || 0;\n if (!el.id) {\n el.setAttribute(\"id\", `${key}-${sequenceMap[key]++}`);\n }\n return el.id;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\"use strict\";\n\nvar _makeupExpander = _interopRequireDefault(require(\"makeup-expander\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\n// REQUIRE\n// const Expander = require('makeup-expander').default;\n\n// IMPORT\n\nconst clickExpanderEls = document.querySelectorAll(\".expander--click-only\");\nconst focusExpanderEls = document.querySelectorAll(\".expander--focus-only\");\nconst hoverExpanderEls = document.querySelectorAll(\".expander--hover-only\");\nconst hoverAndFocusExpanderEls = document.querySelectorAll(\".expander--focus-and-hover\");\nconst stealthExpanderEls = document.querySelectorAll(\".expander--stealth-only\");\nconst clickAndSpacebarExpanderEls = document.querySelectorAll(\".expander--click-and-spacebar\");\nconst expanderWidgets = [];\nexpanderWidgets.push(new _makeupExpander.default(clickExpanderEls[0], {\n expandOnClick: true\n}));\nexpanderWidgets.push(new _makeupExpander.default(clickExpanderEls[1], {\n autoCollapse: true,\n expandOnClick: true\n}));\nfocusExpanderEls.forEach(function (el) {\n expanderWidgets.push(new _makeupExpander.default(el, {\n autoCollapse: true,\n expandOnFocus: true\n }));\n});\nhoverExpanderEls.forEach(function (el) {\n expanderWidgets.push(new _makeupExpander.default(el, {\n autoCollapse: true,\n expandOnHover: true\n }));\n});\nhoverAndFocusExpanderEls.forEach(function (el) {\n expanderWidgets.push(new _makeupExpander.default(el, {\n autoCollapse: true,\n expandOnFocus: true,\n expandOnHover: true\n }));\n});\nstealthExpanderEls.forEach(function (el) {\n expanderWidgets.push(new _makeupExpander.default(el, {\n collapseOnClickOut: true,\n collapseOnFocusOut: true,\n expandOnClick: true,\n focusManagement: \"focusable\"\n }));\n});\nclickAndSpacebarExpanderEls.forEach(function (el) {\n expanderWidgets.push(new _makeupExpander.default(el, {\n autoCollapse: true,\n expandOnClick: true,\n simulateSpacebarClick: true,\n expandedClass: \"expander__host-container--expanded\"\n }));\n});\nexpanderWidgets.forEach(function (item) {\n item.el.addEventListener(\"expander-expand\", function (e) {\n console.log(e);\n });\n item.el.addEventListener(\"expander-collapse\", function (e) {\n console.log(e);\n });\n});"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"makeup-expander/index.min.js","mappings":";;;;;;;AAAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;ACnCa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf,2CAA2C,mBAAO,CAAC,GAAgB;AACnE,0CAA0C,mBAAO,CAAC,GAAqB;AACvE,+CAA+C,mBAAO,CAAC,GAAmB;AAC1E,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ,2CAA2C,gBAAgB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,kDAAkD,WAAW;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;;;;;;;;ACtSF;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,oBAAoB;AACpB,uBAAuB;AACvB,2CAA2C,mBAAO,CAAC,GAAgB;AACnE,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3Ea;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,OAAO,EAAE,UAAU,EAAE,cAAc;;AAEpD;AACA;AACA;AACA,6BAA6B,IAAI,GAAG,mBAAmB;AACvD;AACA;AACA;;;;;;;UCvCA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;ACtBa;;AAEb,6CAA6C,mBAAO,CAAC,GAAiB;AACtE,qCAAqC,iCAAiC;AACtE;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH,CAAC,E","sources":["webpack://root/./packages/core/makeup-focusables/dist/cjs/index.js","webpack://root/./packages/core/makeup-expander/dist/cjs/index.js","webpack://root/./packages/core/makeup-exit-emitter/dist/cjs/index.js","webpack://root/./packages/core/makeup-next-id/dist/cjs/index.js","webpack://root/webpack/bootstrap","webpack://root/./docs/core/makeup-expander/index.compiled.js"],"sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nconst focusableElList = [\"a[href]\", \"area[href]\", \"button:not([disabled])\", \"embed\", \"iframe\", \"input:not([disabled])\", \"object\", \"select:not([disabled])\", \"textarea:not([disabled])\", \"*[tabindex]\", \"*[contenteditable]\"];\nconst focusableElSelector = focusableElList.join();\nfunction _default(el) {\n let keyboardOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let callback = arguments.length > 2 ? arguments[2] : undefined;\n if (callback) {\n const request = requestAnimationFrame(() => {\n callback(getFocusables(el, keyboardOnly));\n });\n return () => {\n cancelAnimationFrame(request);\n };\n }\n return getFocusables(el, keyboardOnly);\n}\nfunction getFocusables(el) {\n let keyboardOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let focusableEls = Array.prototype.slice.call(el.querySelectorAll(focusableElSelector));\n\n // filter out elements with display: none or nested in a display: none parent\n focusableEls = focusableEls.filter(function (focusableEl) {\n return !!(focusableEl.offsetWidth || focusableEl.offsetHeight || focusableEl.getClientRects().length);\n });\n if (keyboardOnly === true) {\n focusableEls = focusableEls.filter(function (focusableEl) {\n return focusableEl.getAttribute(\"tabindex\") !== \"-1\";\n });\n }\n return focusableEls;\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _makeupNextId = _interopRequireDefault(require(\"makeup-next-id\"));\nvar ExitEmitter = _interopRequireWildcard(require(\"makeup-exit-emitter\"));\nvar _makeupFocusables = _interopRequireDefault(require(\"makeup-focusables\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst defaultOptions = {\n alwaysDoFocusManagement: false,\n ariaControls: true,\n autoCollapse: false,\n collapseOnFocusOut: false,\n collapseOnMouseOut: false,\n collapseOnClickOut: false,\n collapseOnHostReFocus: false,\n contentSelector: \".expander__content\",\n expandedClass: null,\n expandOnClick: false,\n expandOnFocus: false,\n expandOnHover: false,\n focusManagement: null,\n hostSelector: \".expander__host\",\n simulateSpacebarClick: false,\n useAriaExpanded: true\n};\nfunction onHostKeyDown(e) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this._keyboardClickFlag = true;\n }\n // if host element does not naturally trigger a click event on spacebar, we can force one to trigger here.\n // careful! if host already triggers click events naturally, we end up with a \"double-click\".\n if (e.keyCode === 32 && this.options.simulateSpacebarClick === true) {\n this.hostEl.click();\n }\n}\nfunction onHostMouseDown() {\n this._mouseClickFlag = true;\n}\nfunction onHostClick() {\n this._expandWasKeyboardClickActivated = this._keyboardClickFlag;\n this._expandWasMouseClickActivated = this._mouseClickFlag;\n this._widgetHasKeyboardFocus = this._keyboardClickFlag;\n this.expanded = !this.expanded;\n}\nfunction onHostFocus() {\n this._expandWasFocusActivated = true;\n this.expanded = true;\n}\n\n// NOTE: collapseOnHostReFocus cannot be used when expandOnFocus is true\nfunction onHostReFocus() {\n if (this.expanded && this._widgetHasKeyboardFocus) {\n this.expanded = false;\n }\n}\nfunction onHostHover() {\n clearTimeout(this._mouseLeft);\n this._expandWasHoverActivated = true;\n this.expanded = true;\n}\nfunction onFocusExit() {\n this._widgetHasKeyboardFocus = false;\n this.expanded = false;\n}\nfunction onMouseLeave() {\n clearTimeout(this._mouseLeft);\n this._mouseLeft = setTimeout(() => {\n this.expanded = false;\n }, 300);\n}\nfunction _onDocumentClick(e) {\n if (this.el.contains(e.target) === false) {\n this.expanded = false;\n }\n}\nfunction _onDocumentTouchStart() {\n this.documentClick = true;\n}\nfunction _onDocumentTouchMove() {\n this.documentClick = false;\n}\nfunction _onDocumentTouchEnd(e) {\n if (this.documentClick === true) {\n this.documentClick = false;\n if (this.el.contains(e.target) === false) {\n this.expanded = false;\n }\n }\n}\nfunction manageFocus(focusManagement, contentEl) {\n if (focusManagement === \"content\") {\n contentEl.setAttribute(\"tabindex\", \"-1\");\n contentEl.focus();\n } else if (focusManagement === \"focusable\") {\n (0, _makeupFocusables.default)(contentEl)[0]?.focus();\n } else if (focusManagement === \"interactive\") {\n (0, _makeupFocusables.default)(contentEl, true)[0]?.focus();\n } else if (focusManagement !== null) {\n const el = contentEl.querySelector(`#${focusManagement}`);\n if (el) {\n el.focus();\n }\n }\n}\nclass _default {\n constructor(el, selectedOptions) {\n this.options = Object.assign({}, defaultOptions, selectedOptions);\n this.el = el;\n this.hostEl = el.querySelector(this.options.hostSelector); // the keyboard focusable host el\n this.contentEl = el.querySelector(this.options.contentSelector);\n ExitEmitter.addFocusExit(this.el);\n this._hostKeyDownListener = onHostKeyDown.bind(this);\n this._hostMouseDownListener = onHostMouseDown.bind(this);\n this._documentClickListener = _onDocumentClick.bind(this);\n this._documentTouchStartListener = _onDocumentTouchStart.bind(this);\n this._documentTouchMoveListener = _onDocumentTouchMove.bind(this);\n this._documentTouchEndListener = _onDocumentTouchEnd.bind(this);\n this._hostClickListener = onHostClick.bind(this);\n this._hostFocusListener = onHostFocus.bind(this);\n this._hostReFocusListener = onHostReFocus.bind(this);\n this._hostHoverListener = onHostHover.bind(this);\n this._focusExitListener = onFocusExit.bind(this);\n this._mouseLeaveListener = onMouseLeave.bind(this);\n if (this.options.useAriaExpanded === true) {\n const initialAriaExpanded = this.hostEl.getAttribute(\"aria-expanded\");\n this._expanded = initialAriaExpanded === \"true\";\n if (initialAriaExpanded === null) {\n this.hostEl.setAttribute(\"aria-expanded\", \"false\");\n }\n } else {\n this._expanded = false;\n }\n if (this.options.ariaControls === true) {\n // ensure the widget has an id\n (0, _makeupNextId.default)(this.el, \"expander\");\n this.contentEl.id = this.contentEl.id || `${this.el.id}-content`;\n this.hostEl.setAttribute(\"aria-controls\", this.contentEl.id);\n }\n this.expandOnClick = this.options.expandOnClick;\n this.expandOnFocus = this.options.expandOnFocus;\n this.expandOnHover = this.options.expandOnHover;\n this.collapseOnHostReFocus = this.options.collapseOnHostReFocus;\n if (this.options.autoCollapse === false) {\n this.collapseOnClickOut = this.options.collapseOnClickOut;\n this.collapseOnFocusOut = this.options.collapseOnFocusOut;\n this.collapseOnMouseOut = this.options.collapseOnMouseOut;\n }\n }\n set expandOnClick(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"keydown\", this._hostKeyDownListener);\n this.hostEl.addEventListener(\"mousedown\", this._hostMouseDownListener);\n this.hostEl.addEventListener(\"click\", this._hostClickListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnClickOut = true;\n this.collapseOnFocusOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"click\", this._hostClickListener);\n this.hostEl.removeEventListener(\"mousedown\", this._hostMouseDownListener);\n this.hostEl.removeEventListener(\"keydown\", this._hostKeyDownListener);\n }\n }\n set expandOnFocus(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"focus\", this._hostFocusListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnClickOut = true;\n this.collapseOnFocusOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"focus\", this._hostFocusListener);\n }\n }\n set collapseOnHostReFocus(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"focus\", this._hostReFocusListener);\n } else {\n this.hostEl.removeEventListener(\"focus\", this._hostReFocusListener);\n }\n }\n set expandOnHover(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"mouseenter\", this._hostHoverListener);\n this.contentEl.addEventListener(\"mouseenter\", this._hostHoverListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnMouseOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"mouseenter\", this._hostHoverListener);\n this.contentEl.removeEventListener(\"mouseenter\", this._hostHoverListener);\n }\n }\n set collapseOnClickOut(bool) {\n if (bool === true) {\n document.addEventListener(\"click\", this._documentClickListener);\n document.addEventListener(\"touchstart\", this._documentTouchStartListener);\n document.addEventListener(\"touchmove\", this._documentTouchMoveListener);\n document.addEventListener(\"touchend\", this._documentTouchEndListener);\n } else {\n document.removeEventListener(\"click\", this._documentClickListener);\n document.removeEventListener(\"touchstart\", this._documentTouchStartListener);\n document.removeEventListener(\"touchmove\", this._documentTouchMoveListener);\n document.removeEventListener(\"touchend\", this._documentTouchEndListener);\n }\n }\n set collapseOnFocusOut(bool) {\n if (bool === true) {\n this.el.addEventListener(\"focusExit\", this._focusExitListener);\n } else {\n this.el.removeEventListener(\"focusExit\", this._focusExitListener);\n }\n }\n set collapseOnMouseOut(bool) {\n if (bool === true) {\n this.el.addEventListener(\"mouseleave\", this._mouseLeaveListener);\n this.contentEl.addEventListener(\"mouseleave\", this._mouseLeaveListener);\n } else {\n this.el.removeEventListener(\"mouseleave\", this._mouseLeaveListener);\n this.contentEl.removeEventListener(\"mouseleave\", this._mouseLeaveListener);\n }\n }\n get expanded() {\n return this._expanded;\n }\n set expanded(bool) {\n if (bool === true && this.expanded === false) {\n if (this.options.useAriaExpanded === true) {\n this.hostEl.setAttribute(\"aria-expanded\", \"true\");\n }\n if (this.options.expandedClass) {\n this.el.classList.add(this.options.expandedClass);\n }\n if (this._expandWasKeyboardClickActivated || this._expandWasMouseClickActivated && this.options.alwaysDoFocusManagement) {\n manageFocus(this.options.focusManagement, this.contentEl);\n }\n this.el.dispatchEvent(new CustomEvent(\"expander-expand\", {\n bubbles: true,\n detail: this.contentEl\n }));\n }\n if (bool === false && this.expanded === true) {\n if (this.options.useAriaExpanded === true) {\n this.hostEl.setAttribute(\"aria-expanded\", \"false\");\n }\n if (this.options.expandedClass) {\n this.el.classList.remove(this.options.expandedClass);\n }\n this.el.dispatchEvent(new CustomEvent(\"expander-collapse\", {\n bubbles: true,\n detail: this.contentEl\n }));\n }\n this._expanded = bool;\n this._expandWasKeyboardClickActivated = false;\n this._expandWasMouseClickActivated = false;\n this._expandWasFocusActivated = false;\n this._expandWasHoverActivated = false;\n this._keyboardClickFlag = false;\n this._mouseClickFlag = false;\n }\n sleep() {\n if (this._destroyed !== true) {\n this.expandOnClick = false;\n this.expandOnFocus = false;\n this.expandOnHover = false;\n this.collapseOnClickOut = false;\n this.collapseOnFocusOut = false;\n this.collapseOnMouseOut = false;\n this.collapseOnHostReFocus = false;\n }\n }\n destroy() {\n this.sleep();\n this._destroyed = true;\n this._hostKeyDownListener = null;\n this._hostMouseDownListener = null;\n this._documentClickListener = null;\n this._documentTouchStartListener = null;\n this._documentTouchMoveListener = null;\n this._documentTouchEndListener = null;\n this._hostClickListener = null;\n this._hostFocusListener = null;\n this._hostReFocusListener = null;\n this._hostHoverListener = null;\n this._focusExitListener = null;\n this._mouseLeaveListener = null;\n this._widgetHasKeyboardFocus = null;\n }\n}\nexports.default = _default;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.addFocusExit = addFocusExit;\nexports.removeFocusExit = removeFocusExit;\nvar _makeupNextId = _interopRequireDefault(require(\"makeup-next-id\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst focusExitEmitters = {};\nfunction doFocusExit(el, fromElement, toElement) {\n el.dispatchEvent(new CustomEvent(\"focusExit\", {\n detail: {\n fromElement,\n toElement\n },\n bubbles: false // mirror the native mouseleave event\n }));\n}\nfunction onDocumentFocusIn(e) {\n const newFocusElement = e.target;\n const targetIsDescendant = this.el.contains(newFocusElement);\n\n // if focus has moved to a focusable descendant\n if (targetIsDescendant === true) {\n // set the target as the currently focussed element\n this.currentFocusElement = newFocusElement;\n } else {\n // else focus has not gone to a focusable descendant\n window.removeEventListener(\"blur\", this.onWindowBlurListener);\n document.removeEventListener(\"focusin\", this.onDocumentFocusInListener);\n doFocusExit(this.el, this.currentFocusElement, newFocusElement);\n this.currentFocusElement = null;\n }\n}\nfunction onWindowBlur() {\n doFocusExit(this.el, this.currentFocusElement, undefined);\n}\nfunction onWidgetFocusIn() {\n // listen for focus moving to anywhere in document\n // note that mouse click on buttons, checkboxes and radios does not trigger focus events in all browsers!\n document.addEventListener(\"focusin\", this.onDocumentFocusInListener);\n // listen for focus leaving the window\n window.addEventListener(\"blur\", this.onWindowBlurListener);\n}\nclass FocusExitEmitter {\n constructor(el) {\n this.el = el;\n this.currentFocusElement = null;\n this.onWidgetFocusInListener = onWidgetFocusIn.bind(this);\n this.onDocumentFocusInListener = onDocumentFocusIn.bind(this);\n this.onWindowBlurListener = onWindowBlur.bind(this);\n this.el.addEventListener(\"focusin\", this.onWidgetFocusInListener);\n }\n removeEventListeners() {\n window.removeEventListener(\"blur\", this.onWindowBlurListener);\n document.removeEventListener(\"focusin\", this.onDocumentFocusInListener);\n this.el.removeEventListener(\"focusin\", this.onWidgetFocusInListener);\n }\n}\nfunction addFocusExit(el) {\n let exitEmitter = null;\n (0, _makeupNextId.default)(el);\n if (!focusExitEmitters[el.id]) {\n exitEmitter = new FocusExitEmitter(el);\n focusExitEmitters[el.id] = exitEmitter;\n }\n return exitEmitter;\n}\nfunction removeFocusExit(el) {\n const exitEmitter = focusExitEmitters[el.id];\n if (exitEmitter) {\n exitEmitter.removeEventListeners();\n delete focusExitEmitters[el.id];\n }\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nconst sequenceMap = {};\nconst defaultPrefix = \"nid\";\nconst randomPortion = createRandomPortion(3);\nfunction randomNumber(max) {\n return Math.floor(Math.random() * max);\n}\nfunction createRandomPortion(size) {\n const letters = \"abcdefghijklmnopqrstuvwxyz\";\n const digits = \"0123456789\";\n const allChars = letters + digits;\n\n // to ensure a valid HTML ID (when prefix is empty), first character must be a letter\n let portion = letters[randomNumber(25)];\n\n // start iterating from 1, as we already have our first char\n for (let i = 1; i < size; i++) {\n portion += allChars[randomNumber(35)];\n }\n return portion;\n}\nfunction _default(el) {\n let prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultPrefix;\n const separator = prefix === \"\" ? \"\" : \"-\";\n\n // join first prefix with random portion to create key\n const key = `${prefix}${separator}${randomPortion}`;\n\n // initialise key in sequence map if necessary\n sequenceMap[key] = sequenceMap[key] || 0;\n if (!el.id) {\n el.setAttribute(\"id\", `${key}-${sequenceMap[key]++}`);\n }\n return el.id;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\"use strict\";\n\nvar _makeupExpander = _interopRequireDefault(require(\"makeup-expander\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\n// REQUIRE\n// const Expander = require('makeup-expander').default;\n\n// IMPORT\n\nconst clickExpanderEls = document.querySelectorAll(\".expander--click-only\");\nconst focusExpanderEls = document.querySelectorAll(\".expander--focus-only\");\nconst hoverExpanderEls = document.querySelectorAll(\".expander--hover-only\");\nconst hoverAndFocusExpanderEls = document.querySelectorAll(\".expander--focus-and-hover\");\nconst stealthExpanderEls = document.querySelectorAll(\".expander--stealth-only\");\nconst clickAndSpacebarExpanderEls = document.querySelectorAll(\".expander--click-and-spacebar\");\nconst tooltipEls = document.querySelectorAll(\".expander--tooltip\");\nconst expanderWidgets = [];\nexpanderWidgets.push(new _makeupExpander.default(clickExpanderEls[0], {\n expandOnClick: true\n}));\nexpanderWidgets.push(new _makeupExpander.default(clickExpanderEls[1], {\n autoCollapse: true,\n expandOnClick: true\n}));\nfocusExpanderEls.forEach(function (el) {\n expanderWidgets.push(new _makeupExpander.default(el, {\n autoCollapse: true,\n expandOnFocus: true\n }));\n});\nhoverExpanderEls.forEach(function (el) {\n expanderWidgets.push(new _makeupExpander.default(el, {\n autoCollapse: true,\n expandOnHover: true\n }));\n});\nhoverAndFocusExpanderEls.forEach(function (el) {\n expanderWidgets.push(new _makeupExpander.default(el, {\n autoCollapse: true,\n expandOnFocus: true,\n expandOnHover: true\n }));\n});\nstealthExpanderEls.forEach(function (el) {\n expanderWidgets.push(new _makeupExpander.default(el, {\n collapseOnClickOut: true,\n collapseOnFocusOut: true,\n expandOnClick: true,\n focusManagement: \"focusable\"\n }));\n});\nclickAndSpacebarExpanderEls.forEach(function (el) {\n expanderWidgets.push(new _makeupExpander.default(el, {\n autoCollapse: true,\n expandOnClick: true,\n simulateSpacebarClick: true,\n expandedClass: \"expander__host-container--expanded\"\n }));\n});\ntooltipEls.forEach(function (el) {\n expanderWidgets.push(new _makeupExpander.default(el, {\n ariaControls: false,\n autoCollapse: true,\n expandOnFocus: true,\n expandOnHover: true,\n useAriaExpanded: false,\n expandedClass: \"expander__host-container--expanded\"\n }));\n expanderWidgets.forEach(function (item) {\n item.el.addEventListener(\"expander-expand\", function (e) {\n console.log(e);\n });\n item.el.addEventListener(\"expander-collapse\", function (e) {\n console.log(e);\n });\n });\n});"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/docs/ui/makeup-combobox/index.min.js b/docs/ui/makeup-combobox/index.min.js index 4f4d270e..193023b3 100644 --- a/docs/ui/makeup-combobox/index.min.js +++ b/docs/ui/makeup-combobox/index.min.js @@ -999,7 +999,8 @@ const defaultOptions = { expandOnHover: false, focusManagement: null, hostSelector: ".expander__host", - simulateSpacebarClick: false + simulateSpacebarClick: false, + useAriaExpanded: true }; function onHostKeyDown(e) { if (e.keyCode === 13 || e.keyCode === 32) { @@ -1099,8 +1100,14 @@ class _default { this._hostHoverListener = onHostHover.bind(this); this._focusExitListener = onFocusExit.bind(this); this._mouseLeaveListener = onMouseLeave.bind(this); - if (this.hostEl.getAttribute("aria-expanded") === null) { - this.hostEl.setAttribute("aria-expanded", "false"); + if (this.options.useAriaExpanded === true) { + const initialAriaExpanded = this.hostEl.getAttribute("aria-expanded"); + this._expanded = initialAriaExpanded === "true"; + if (initialAriaExpanded === null) { + this.hostEl.setAttribute("aria-expanded", "false"); + } + } else { + this._expanded = false; } if (this.options.ariaControls === true) { // ensure the widget has an id @@ -1193,11 +1200,13 @@ class _default { } } get expanded() { - return this.hostEl.getAttribute("aria-expanded") === "true"; + return this._expanded; } set expanded(bool) { if (bool === true && this.expanded === false) { - this.hostEl.setAttribute("aria-expanded", "true"); + if (this.options.useAriaExpanded === true) { + this.hostEl.setAttribute("aria-expanded", "true"); + } if (this.options.expandedClass) { this.el.classList.add(this.options.expandedClass); } @@ -1210,7 +1219,9 @@ class _default { })); } if (bool === false && this.expanded === true) { - this.hostEl.setAttribute("aria-expanded", "false"); + if (this.options.useAriaExpanded === true) { + this.hostEl.setAttribute("aria-expanded", "false"); + } if (this.options.expandedClass) { this.el.classList.remove(this.options.expandedClass); } @@ -1219,6 +1230,7 @@ class _default { detail: this.contentEl })); } + this._expanded = bool; this._expandWasKeyboardClickActivated = false; this._expandWasMouseClickActivated = false; this._expandWasFocusActivated = false; diff --git a/docs/ui/makeup-combobox/index.min.js.map b/docs/ui/makeup-combobox/index.min.js.map index fdeebfcb..18c4798b 100644 --- a/docs/ui/makeup-combobox/index.min.js.map +++ b/docs/ui/makeup-combobox/index.min.js.map @@ -1 +1 @@ -{"version":3,"file":"makeup-combobox/index.min.js","mappings":";;;;;;;AAAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf,6CAA6C,mBAAO,CAAC,IAAiB;AACtE,4CAA4C,mBAAO,CAAC,IAAgB;AACpE,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;AACf;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;ACvOa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,oBAAoB;AACpB,uBAAuB;AACvB,2CAA2C,mBAAO,CAAC,IAAgB;AACnE,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC3EA;;;;;;;;;;ACAA;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf,+CAA+C,mBAAO,CAAC,IAA0B;AACjF,gDAAgD,mBAAO,CAAC,IAA4B;AACpF,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;;;;;;;ACvNA,mBAAO,CAAC,IAA8B;;;;;;;;;ACAzB;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,oBAAoB;AACpB,gDAAgD,mBAAO,CAAC,IAA2B;AACnF,2CAA2C,mBAAO,CAAC,IAAgB;AACnE,qCAAqC,iCAAiC;AACtE,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;ACxKA,mBAAO,CAAC,IAAgC;;;;;;;;;ACA3B;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,OAAO,EAAE,UAAU,EAAE,cAAc;;AAEpD;AACA;AACA;AACA,6BAA6B,IAAI,GAAG,mBAAmB;AACvD;AACA;AACA;;;;;;;;ACvCA,mBAAO,CAAC,IAAsB;AAC9B,mBAAO,CAAC,IAAuB;;;;;;;;ACD/B,mBAAO,CAAC,IAA0B;;;;;;;;;;ACAlC;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;ACnCa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,WAAW;AACX,kBAAkB;AAClB,gBAAgB;AAChB,cAAc;AACd,qBAAqB;AACrB,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,IAAI,KAAK,aAAa;AAC1F;AACA;AACA,SAAS;AACT;AACA;AACA,uDAAuD,aAAa;AACpE;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACrEA;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf,2CAA2C,mBAAO,CAAC,IAAgB;AACnE,0CAA0C,mBAAO,CAAC,GAAqB;AACvE,+CAA+C,mBAAO,CAAC,IAAmB;AAC1E,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ,2CAA2C,gBAAgB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,WAAW;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;;;;;;;;;AC1RF;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,oBAAoB;AACpB,yCAAyC,mBAAO,CAAC,IAAoB;AACrE,0CAA0C,mBAAO,CAAC,GAAqB;AACvE,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,QAAQ;AACrB,aAAa,uBAAuB;AACpC;AACA;AACA,iBAAiB,uBAAuB;AACxC,mCAAmC;;AAEnC,iBAAiB,aAAa;AAC9B;;AAEA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,QAAQ;AACrB,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,4CAA4C,mBAAmB;AAC/D;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;ACjXA,mBAAO,CAAC,IAA+B;;;;;;;;;;ACAvC;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,WAAW;AACX,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;UCjBA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;;;;ACNa;;AAEb,mBAAO,CAAC,IAAgB;AACxB,mBAAO,CAAC,IAAmB;AAC3B,mBAAO,CAAC,IAAmB;AAC3B,mBAAO,CAAC,IAAqB;AAC7B,6CAA6C,mBAAO,CAAC,GAAiB;AACtE,qCAAqC,iCAAiC;AACtE;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH,E","sources":["webpack://root/./packages/ui/makeup-combobox/dist/cjs/index.js","webpack://root/./packages/core/makeup-exit-emitter/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/dist/global/global.css?e001","webpack://root/./node_modules/@ebay/skin/dist/tokens/evo-light.css?9c33","webpack://root/./packages/ui/makeup-listbox/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/combobox.js","webpack://root/./packages/core/makeup-active-descendant/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/tokens/evo-light.js","webpack://root/./packages/core/makeup-next-id/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/tokens.js","webpack://root/./node_modules/@ebay/skin/global.js","webpack://root/./docs/docs.css?378e","webpack://root/./packages/core/makeup-focusables/dist/cjs/index.js","webpack://root/./packages/core/makeup-key-emitter/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/dist/combobox/combobox.css?755d","webpack://root/./packages/core/makeup-expander/dist/cjs/index.js","webpack://root/./packages/core/makeup-navigation-emitter/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/tokens/evo-core.js","webpack://root/./node_modules/@ebay/skin/dist/tokens/evo-core.css?7a96","webpack://root/./packages/core/makeup-prevent-scroll-keys/dist/cjs/index.js","webpack://root/webpack/bootstrap","webpack://root/webpack/runtime/make namespace object","webpack://root/./docs/ui/makeup-combobox/index.compiled.js"],"sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _makeupExpander = _interopRequireDefault(require(\"makeup-expander\"));\nvar _makeupListbox = _interopRequireDefault(require(\"makeup-listbox\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst defaultOptions = {\n autoSelect: true,\n collapseTimeout: 150,\n customElementMode: false,\n autoScroll: true\n};\nclass _default {\n constructor(widgetEl, selectedOptions) {\n this._options = Object.assign({}, defaultOptions, selectedOptions);\n this._el = widgetEl;\n this._inputEl = this._el.querySelector(\"input\");\n this._listboxEl = this._el.querySelector(\".combobox__listbox\");\n this._autocompleteType = this._inputEl.getAttribute(\"aria-autocomplete\");\n this._inputEl.setAttribute(\"autocomplete\", \"off\");\n this._inputEl.setAttribute(\"role\", \"combobox\");\n this._listboxEl.hidden = false;\n this._listboxWidget = new _makeupListbox.default(this._listboxEl, {\n activeDescendantClassName: \"combobox__option--active\",\n autoReset: -1,\n autoSelect: this._options.autoSelect,\n focusableElement: this._inputEl,\n listboxOwnerElement: this._el,\n autoScroll: this._options.autoScroll\n });\n this._expander = new _makeupExpander.default(this._el, {\n collapseOnClickOut: true,\n collapseOnFocusOut: true,\n contentSelector: \".combobox__listbox\",\n expandedClass: \"combobox--expanded\",\n expandOnFocus: true,\n hostSelector: \"input\"\n });\n this._destroyed = false;\n this._onInputFocusListener = _onInputFocus.bind(this);\n this._onListboxClickListener = _onListboxClick.bind(this);\n this._onListboxActiveDescendantChangeListener = _onListboxActiveDescendantChange.bind(this);\n this._onTextboxKeyDownListener = _onTextboxKeyDown.bind(this);\n this._onTextboxInputListener = _onTextboxInput.bind(this);\n this._onTextboxClickListener = _onTextboxClick.bind(this);\n this._onMutationListener = _onMutation.bind(this);\n this._el.classList.add(\"combobox--js\");\n if (!this._options.customElementMode) {\n this._mutationObserver = new MutationObserver(this._onMutationListener);\n this._observeMutations();\n this._observeEvents();\n }\n }\n resetFilter() {\n this._listboxWidget._activeDescendant.reset();\n this._listboxWidget.items.forEach(el => el.hidden = false);\n }\n _observeMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.observe(this._inputEl, {\n attributes: true,\n childList: true,\n subtree: true\n });\n }\n }\n _unobserveMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.disconnect();\n }\n }\n _observeEvents() {\n if (this._destroyed !== true) {\n this._listboxEl.addEventListener(\"click\", this._onListboxClickListener);\n this._listboxWidget._activeDescendantRootEl.addEventListener(\"activeDescendantChange\", this._onListboxActiveDescendantChangeListener);\n this._inputEl.addEventListener(\"focus\", this._onInputFocusListener);\n this._inputEl.addEventListener(\"keydown\", this._onTextboxKeyDownListener);\n this._inputEl.addEventListener(\"input\", this._onTextboxInputListener);\n this._inputEl.addEventListener(\"click\", this._onTextboxClickListener);\n }\n }\n _unobserveEvents() {\n this._listboxEl.removeEventListener(\"click\", this._onListboxClickListener);\n this._listboxWidget._activeDescendantRootEl.removeEventListener(\"activeDescendantChange\", this._onListboxActiveDescendantChangeListener);\n this._inputEl.removeEventListener(\"focus\", this._onInputFocusListener);\n this._inputEl.removeEventListener(\"keydown\", this._onTextboxKeyDownListener);\n this._inputEl.removeEventListener(\"input\", this._onTextboxInputListener);\n this._inputEl.removeEventListener(\"click\", this._onTextboxClickListener);\n }\n destroy() {\n this._destroyed = true;\n this._unobserveMutations();\n this._unobserveEvents();\n this._onInputFocusListener = null;\n this._onListboxClickListener = null;\n this._onListboxActiveDesendanctChangeListener = null;\n this._onTextboxKeyDownListener = null;\n this._onTextboxInputListener = null;\n this._onTextboxClickListener = null;\n this._onMutationListener = null;\n }\n}\nexports.default = _default;\nfunction _onInputFocus() {\n if (this._autocompleteType === \"list\") {\n _filterSuggestions(this._inputEl.value, this._listboxWidget.items);\n } else {\n this.resetFilter();\n }\n}\nfunction _onTextboxKeyDown(e) {\n // up and down keys should not move caret\n if (e.keyCode === 38 || e.keyCode === 40) {\n e.preventDefault();\n }\n\n // down arrow key should always expand listbox\n if (e.keyCode === 40) {\n if (this._expander.expanded === false) {\n this._expander.expanded = true;\n }\n }\n\n // escape key should always collapse listbox\n if (e.keyCode === 27) {\n if (this._expander.expanded === true) {\n this._expander.expanded = false;\n this._listboxWidget._activeDescendant.reset();\n }\n }\n\n // for manual selection, ENTER should not submit form when there is an active descendant\n if (this._options.autoSelect === false && e.keyCode === 13 && this._inputEl.getAttribute(\"aria-activedescendant\")) {\n e.preventDefault();\n const widget = this;\n this._inputEl.value = this._listboxWidget.items[this._listboxWidget._activeDescendant.index].innerText;\n _dispatchChangeEvent(this._el, this._inputEl.value);\n this._listboxWidget._activeDescendant.reset();\n setTimeout(function () {\n widget._expander.expanded = false;\n if (widget._autocompleteType === \"list\") {\n if (widget._inputEl.value.length === 0) {\n widget.resetFilter();\n } else {\n _filterSuggestions(widget._inputEl.value, widget._listboxWidget.items);\n }\n }\n }, this._options.collapseTimeout);\n }\n}\nfunction _onTextboxClick() {\n if (this._expander.expanded === false) {\n this._expander.expanded = true;\n }\n}\nfunction _onTextboxInput() {\n if (this._expander.expanded === false) {\n this._expander.expanded = true;\n }\n // TODO: refactor this redundant logic with L165: L171\n if (this._autocompleteType === \"list\") {\n this._listboxWidget._activeDescendant.reset();\n if (this._inputEl.value.length === 0) {\n this.resetFilter();\n } else {\n _filterSuggestions(this._inputEl.value, this._listboxWidget.items);\n }\n }\n}\nfunction _onListboxClick(e) {\n const widget = this;\n const element = e.target.closest(\"[role=option]\");\n const indexData = this._listboxWidget.items.indexOf(element);\n if (indexData !== undefined) {\n this._inputEl.value = this._listboxWidget.items[indexData].innerText;\n\n // TODO: refactor this redundant logic with L165: L171\n if (this._autocompleteType === \"list\") {\n this._listboxWidget._activeDescendant.reset();\n if (this._inputEl.value.length === 0) {\n this.resetFilter();\n } else {\n _filterSuggestions(this._inputEl.value, this._listboxWidget.items);\n }\n }\n if (this._options.autoSelect === false) {\n _dispatchChangeEvent(this._el, this._inputEl.value);\n }\n setTimeout(function () {\n widget._expander.expanded = false;\n }, this._options.collapseTimeout);\n }\n}\nfunction _onListboxActiveDescendantChange(e) {\n if (this._options.autoSelect === true) {\n this._inputEl.value = this._listboxWidget.items[e.detail.toIndex].innerText;\n _dispatchChangeEvent(this._el, this._inputEl.value);\n }\n}\nfunction _onMutation(mutationsList) {\n for (const mutation of mutationsList) {\n if (mutation.type === \"attributes\") {\n this._el.dispatchEvent(new CustomEvent(\"makeup-combobox-mutation\", {\n detail: {\n attributeName: mutation.attributeName\n }\n }));\n }\n }\n}\nfunction _filterSuggestions(value, items) {\n const numChars = value.length;\n const currentValue = value.toLowerCase();\n const matchedItems = items.filter(el => {\n return el.innerText.trim().substring(0, numChars).toLowerCase() === currentValue;\n });\n const unmatchedItems = items.filter(el => {\n return el.innerText.trim().substring(0, numChars).toLowerCase() !== currentValue;\n });\n matchedItems.forEach(el => el.hidden = false);\n unmatchedItems.forEach(el => el.hidden = true);\n}\nfunction _dispatchChangeEvent(el, value) {\n el.dispatchEvent(new CustomEvent(\"makeup-combobox-change\", {\n detail: {\n value\n }\n }));\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.addFocusExit = addFocusExit;\nexports.removeFocusExit = removeFocusExit;\nvar _makeupNextId = _interopRequireDefault(require(\"makeup-next-id\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst focusExitEmitters = {};\nfunction doFocusExit(el, fromElement, toElement) {\n el.dispatchEvent(new CustomEvent(\"focusExit\", {\n detail: {\n fromElement,\n toElement\n },\n bubbles: false // mirror the native mouseleave event\n }));\n}\nfunction onDocumentFocusIn(e) {\n const newFocusElement = e.target;\n const targetIsDescendant = this.el.contains(newFocusElement);\n\n // if focus has moved to a focusable descendant\n if (targetIsDescendant === true) {\n // set the target as the currently focussed element\n this.currentFocusElement = newFocusElement;\n } else {\n // else focus has not gone to a focusable descendant\n window.removeEventListener(\"blur\", this.onWindowBlurListener);\n document.removeEventListener(\"focusin\", this.onDocumentFocusInListener);\n doFocusExit(this.el, this.currentFocusElement, newFocusElement);\n this.currentFocusElement = null;\n }\n}\nfunction onWindowBlur() {\n doFocusExit(this.el, this.currentFocusElement, undefined);\n}\nfunction onWidgetFocusIn() {\n // listen for focus moving to anywhere in document\n // note that mouse click on buttons, checkboxes and radios does not trigger focus events in all browsers!\n document.addEventListener(\"focusin\", this.onDocumentFocusInListener);\n // listen for focus leaving the window\n window.addEventListener(\"blur\", this.onWindowBlurListener);\n}\nclass FocusExitEmitter {\n constructor(el) {\n this.el = el;\n this.currentFocusElement = null;\n this.onWidgetFocusInListener = onWidgetFocusIn.bind(this);\n this.onDocumentFocusInListener = onDocumentFocusIn.bind(this);\n this.onWindowBlurListener = onWindowBlur.bind(this);\n this.el.addEventListener(\"focusin\", this.onWidgetFocusInListener);\n }\n removeEventListeners() {\n window.removeEventListener(\"blur\", this.onWindowBlurListener);\n document.removeEventListener(\"focusin\", this.onDocumentFocusInListener);\n this.el.removeEventListener(\"focusin\", this.onWidgetFocusInListener);\n }\n}\nfunction addFocusExit(el) {\n let exitEmitter = null;\n (0, _makeupNextId.default)(el);\n if (!focusExitEmitters[el.id]) {\n exitEmitter = new FocusExitEmitter(el);\n focusExitEmitters[el.id] = exitEmitter;\n }\n return exitEmitter;\n}\nfunction removeFocusExit(el) {\n const exitEmitter = focusExitEmitters[el.id];\n if (exitEmitter) {\n exitEmitter.removeEventListeners();\n delete focusExitEmitters[el.id];\n }\n}\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar ActiveDescendant = _interopRequireWildcard(require(\"makeup-active-descendant\"));\nvar PreventScrollKeys = _interopRequireWildcard(require(\"makeup-prevent-scroll-keys\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\n/**\n * A listbox can be a standalone focusable widget, or controlled by a separate, focusable widget\n * (a textbox for example, in the case of a combobox or datepicker)\n *\n * This listbox code currently supports single-selct only!\n * This code has been copied from Skin & MIND Patterns and has not yet been cleaned up.\n */\n\nconst defaultOptions = {\n activeDescendantClassName: \"listbox__option--active\",\n // the classname applied to the current active desdcendant\n autoInit: \"none\",\n autoReset: null,\n autoSelect: true,\n // when true, aria-checked state matches active-descendant\n autoScroll: true,\n // when true, the listbox will scroll to keep the activeDescendant in view\n customElementMode: false,\n focusableElement: null,\n // used in a combobox/datepicker scenario\n listboxOwnerElement: null,\n // used in a combobox/datepicker scenario\n multiSelect: false,\n // todo\n useAriaChecked: true,\n // doubles up on support for aria-selected to announce visible selected/checked state\n valueSelector: \".listbox__value\" // Selector to get value from\n};\nclass _default {\n constructor(widgetEl, selectedOptions) {\n this._options = Object.assign({}, defaultOptions, selectedOptions);\n this.el = widgetEl;\n\n // in cases such as combobox, the active-descendant logic is controlled by a parent widget\n this._activeDescendantRootEl = this._options.listboxOwnerElement || this.el;\n\n // todo: not sure this check is needed any more\n if (widgetEl.getAttribute(\"role\") === \"listbox\") {\n this._listboxEl = widgetEl;\n } else {\n this._listboxEl = this.el.querySelector(\"[role=listbox]\");\n }\n if (!this._options.focusableElement && this._listboxEl.getAttribute(\"tabindex\") === null) {\n this._listboxEl.setAttribute(\"tabindex\", \"0\");\n }\n PreventScrollKeys.add(this.el);\n this._onKeyDownListener = _onKeyDown.bind(this);\n this._onClickListener = _onClick.bind(this);\n this._onFirstMouseDownListener = _onFirstMouseDown.bind(this);\n this._onFirstFocusListener = _onFirstFocus.bind(this);\n this._onActiveDescendantChangeListener = _onActiveDescendantChange.bind(this);\n this._onMutationListener = _onMutation.bind(this);\n this.el.classList.add(\"listbox--js\");\n if (!this._options.customElementMode) {\n this._mutationObserver = new MutationObserver(this._onMutationListener);\n this._observeMutations();\n this._observeEvents();\n }\n this._activeDescendant = ActiveDescendant.createLinear(this._activeDescendantRootEl, this._options.focusableElement || this._listboxEl, this._listboxEl.parentElement, \"[role=option]\", {\n activeDescendantClassName: this._options.activeDescendantClassName,\n autoInit: this._options.autoInit,\n autoReset: this._options.autoReset,\n autoScroll: this._options.autoScroll,\n axis: \"y\"\n });\n }\n _observeMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.observe(this._listboxEl, {\n attributeFilter: [\"aria-selected\"],\n attributes: true,\n childList: true,\n subtree: true\n });\n }\n }\n _unobserveMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.disconnect();\n }\n }\n _observeEvents() {\n if (this._destroyed !== true) {\n this._activeDescendantRootEl.addEventListener(\"activeDescendantChange\", this._onActiveDescendantChangeListener);\n this._listboxEl.addEventListener(\"mousedown\", this._onFirstMouseDownListener, {\n once: true\n });\n this._listboxEl.addEventListener(\"focus\", this._onFirstFocusListener, {\n once: true\n });\n this._listboxEl.addEventListener(\"keydown\", this._onKeyDownListener);\n this._listboxEl.addEventListener(\"click\", this._onClickListener);\n }\n }\n _unobserveEvents() {\n this._listboxEl.removeEventListener(\"keydown\", this._onKeyDownListener);\n this._listboxEl.removeEventListener(\"click\", this._onClickListener);\n this._listboxEl.removeEventListener(\"focus\", this._onFirstFocusListener);\n this._listboxEl.removeEventListener(\"mousedown\", this._onFirstMouseDownListener);\n this._activeDescendantRootEl.removeEventListener(\"activeDescendantChange\", this._onActiveDescendantChangeListener);\n }\n get index() {\n return this.items.findIndex(el => el.getAttribute(\"aria-selected\") === \"true\");\n }\n get items() {\n return this._activeDescendant.items;\n }\n select(index) {\n this._unobserveMutations();\n if (this.index !== index) {\n this.unselect(this.index);\n const itemEl = this._activeDescendant.items[index];\n if (itemEl && itemEl.getAttribute(\"aria-disabled\") !== \"true\") {\n const matchingItem = this.items[index];\n let optionValue;\n matchingItem.setAttribute(\"aria-selected\", \"true\");\n if (this._options.useAriaChecked === true) {\n matchingItem.setAttribute(\"aria-checked\", \"true\");\n }\n optionValue = matchingItem.innerText;\n\n // Check if value selector is present and use that to get innerText instead\n // If its not present, will default to innerText of the whole item\n if (this._options.valueSelector) {\n const valueSelector = matchingItem.querySelector(this._options.valueSelector);\n if (valueSelector) {\n optionValue = valueSelector.innerText;\n }\n }\n this.el.dispatchEvent(new CustomEvent(\"makeup-listbox-change\", {\n detail: {\n el: matchingItem,\n optionIndex: index,\n optionValue\n }\n }));\n }\n }\n this._observeMutations();\n }\n unselect(index) {\n this._unobserveMutations();\n const itemEl = this.items[index];\n if (itemEl && itemEl.getAttribute(\"aria-disabled\") !== \"true\") {\n const matchingItem = this.items[index];\n matchingItem.setAttribute(\"aria-selected\", \"false\");\n if (this._options.useAriaChecked === true) {\n matchingItem.setAttribute(\"aria-checked\", \"false\");\n }\n }\n this._observeMutations();\n }\n destroy() {\n this._destroyed = true;\n this._unobserveMutations();\n this._unobserveEvents();\n this._onKeyDownListener = null;\n this._onClickListener = null;\n this._onFirstMouseDownListener = null;\n this._onFirstFocusListener = null;\n this._onActiveDescendantChangeListener = null;\n this._onMutationListener = null;\n }\n}\nexports.default = _default;\nfunction _onFirstMouseDown() {\n this._isMouseDown = true;\n}\n\n// set activeDescendant on first keyboard focus\nfunction _onFirstFocus() {\n if (!this._isMouseDown) {\n this._activeDescendant.index = this.index === -1 ? 0 : this.index;\n }\n this._isMouseDown = false;\n}\nfunction _onClick(e) {\n const toEl = e.target.closest(\"[role=option]\");\n if (toEl) {\n this.select(this.items.indexOf(toEl));\n }\n}\nfunction _onKeyDown(e) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this.select(this._activeDescendant.index);\n }\n}\nfunction _onActiveDescendantChange(e) {\n const {\n toIndex\n } = e.detail;\n const toEl = this.items[toIndex];\n if (this._options.autoSelect === true && toEl) {\n this.select(toIndex);\n }\n}\nfunction _onMutation(mutationsList) {\n for (const mutation of mutationsList) {\n if (mutation.type === \"attributes\") {\n this.el.dispatchEvent(new CustomEvent(\"makeup-listbox-mutation\", {\n detail: {\n attributeName: mutation.attributeName\n }\n }));\n }\n }\n}\n","require('./dist/combobox/combobox.css');\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createLinear = createLinear;\nvar NavigationEmitter = _interopRequireWildcard(require(\"makeup-navigation-emitter\"));\nvar _makeupNextId = _interopRequireDefault(require(\"makeup-next-id\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nconst defaultOptions = {\n activeDescendantClassName: \"active-descendant\",\n autoInit: \"none\",\n autoReset: \"none\",\n autoScroll: false,\n axis: \"both\",\n wrap: false\n};\nfunction onModelInit(e) {\n const {\n items,\n toIndex\n } = e.detail;\n const itemEl = items[toIndex];\n if (itemEl) {\n itemEl.classList.add(this._options.activeDescendantClassName);\n this._focusEl.setAttribute(\"aria-activedescendant\", itemEl.id);\n }\n this._el.dispatchEvent(new CustomEvent(\"activeDescendantInit\", {\n detail: e.detail\n }));\n}\nfunction onModelChange(e) {\n const {\n fromIndex,\n toIndex\n } = e.detail;\n const fromItem = this.items[fromIndex];\n const toItem = this.items[toIndex];\n if (fromItem) {\n fromItem.classList.remove(this._options.activeDescendantClassName);\n }\n if (toItem) {\n toItem.classList.add(this._options.activeDescendantClassName);\n this._focusEl.setAttribute(\"aria-activedescendant\", toItem.id);\n if (this._options.autoScroll && this._itemContainerEl) {\n this._itemContainerEl.scrollTop = toItem.offsetTop - this._itemContainerEl.offsetHeight / 2;\n }\n }\n this._el.dispatchEvent(new CustomEvent(\"activeDescendantChange\", {\n detail: e.detail\n }));\n}\nfunction onModelReset(e) {\n const toIndex = e.detail.toIndex;\n const activeClassName = this._options.activeDescendantClassName;\n this.items.forEach(function (el) {\n el.classList.remove(activeClassName);\n });\n if (toIndex !== null && toIndex !== -1) {\n const itemEl = this.items[toIndex];\n itemEl.classList.add(activeClassName);\n this._focusEl.setAttribute(\"aria-activedescendant\", itemEl.id);\n } else {\n this._focusEl.removeAttribute(\"aria-activedescendant\");\n }\n this._el.dispatchEvent(new CustomEvent(\"activeDescendantReset\", {\n detail: e.detail\n }));\n}\nfunction onModelMutation(e) {\n const {\n toIndex\n } = e.detail;\n const activeDescendantClassName = this._options.activeDescendantClassName;\n this.items.forEach(function (item, index) {\n (0, _makeupNextId.default)(item);\n if (index !== toIndex) {\n item.classList.remove(activeDescendantClassName);\n } else {\n item.classList.add(activeDescendantClassName);\n }\n });\n this._el.dispatchEvent(new CustomEvent(\"activeDescendantMutation\", {\n detail: e.detail\n }));\n}\nclass ActiveDescendant {\n constructor(el) {\n this._el = el;\n this._onMutationListener = onModelMutation.bind(this);\n this._onChangeListener = onModelChange.bind(this);\n this._onResetListener = onModelReset.bind(this);\n this._onInitListener = onModelInit.bind(this);\n this._el.addEventListener(\"navigationModelMutation\", this._onMutationListener);\n this._el.addEventListener(\"navigationModelChange\", this._onChangeListener);\n this._el.addEventListener(\"navigationModelReset\", this._onResetListener);\n this._el.addEventListener(\"navigationModelInit\", this._onInitListener);\n }\n destroy() {\n this._el.removeEventListener(\"navigationModelMutation\", this._onMutationListener);\n this._el.removeEventListener(\"navigationModelChange\", this._onChangeListener);\n this._el.removeEventListener(\"navigationModelReset\", this._onResetListener);\n this._el.removeEventListener(\"navigationModelInit\", this._onInitListener);\n }\n}\nclass LinearActiveDescendant extends ActiveDescendant {\n constructor(el, focusEl, itemContainerEl, itemSelector, selectedOptions) {\n super(el);\n this._options = Object.assign({}, defaultOptions, selectedOptions);\n this._focusEl = focusEl;\n this._itemContainerEl = itemContainerEl;\n this._itemSelector = itemSelector;\n\n // ensure container has an id\n (0, _makeupNextId.default)(this._itemContainerEl);\n\n // if programmatic relationship set aria-owns\n if (this._itemContainerEl !== this._focusEl) {\n focusEl.setAttribute(\"aria-owns\", this._itemContainerEl.id);\n }\n this._navigationEmitter = NavigationEmitter.createLinear(el, itemSelector, {\n autoInit: this._options.autoInit,\n autoReset: this._options.autoReset,\n axis: this._options.axis,\n ignoreByDelegateSelector: this._options.ignoreByDelegateSelector,\n wrap: this._options.wrap\n });\n\n // ensure each item has an id\n this.items.forEach(function (itemEl) {\n (0, _makeupNextId.default)(itemEl);\n });\n }\n get index() {\n return this._navigationEmitter.model.index;\n }\n set index(newIndex) {\n this._navigationEmitter.model.index = newIndex;\n }\n reset() {\n this._navigationEmitter.model.reset();\n }\n get currentItem() {\n return this._navigationEmitter.model.currentItem;\n }\n get items() {\n return this._navigationEmitter.model.items;\n }\n set wrap(newWrap) {\n this._navigationEmitter.model.options.wrap = newWrap;\n }\n destroy() {\n super.destroy();\n this._navigationEmitter.destroy();\n }\n}\n\n/*\nclass GridActiveDescendant extends ActiveDescendant {\n constructor(el, focusEl, containerEl, rowSelector, cellSelector) {\n super(el);\n }\n}\n*/\n\nfunction createLinear(el, focusEl, itemContainerEl, itemSelector, selectedOptions) {\n return new LinearActiveDescendant(el, focusEl, itemContainerEl, itemSelector, selectedOptions);\n}\n","require('./../dist/tokens/evo-light.css');\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nconst sequenceMap = {};\nconst defaultPrefix = \"nid\";\nconst randomPortion = createRandomPortion(3);\nfunction randomNumber(max) {\n return Math.floor(Math.random() * max);\n}\nfunction createRandomPortion(size) {\n const letters = \"abcdefghijklmnopqrstuvwxyz\";\n const digits = \"0123456789\";\n const allChars = letters + digits;\n\n // to ensure a valid HTML ID (when prefix is empty), first character must be a letter\n let portion = letters[randomNumber(25)];\n\n // start iterating from 1, as we already have our first char\n for (let i = 1; i < size; i++) {\n portion += allChars[randomNumber(35)];\n }\n return portion;\n}\nfunction _default(el) {\n let prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultPrefix;\n const separator = prefix === \"\" ? \"\" : \"-\";\n\n // join first prefix with random portion to create key\n const key = `${prefix}${separator}${randomPortion}`;\n\n // initialise key in sequence map if necessary\n sequenceMap[key] = sequenceMap[key] || 0;\n if (!el.id) {\n el.setAttribute(\"id\", `${key}-${sequenceMap[key]++}`);\n }\n return el.id;\n}\n","require('./tokens/evo-core.js');\nrequire('./tokens/evo-light.js');\n","require('./dist/global/global.css');\n","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nconst focusableElList = [\"a[href]\", \"area[href]\", \"button:not([disabled])\", \"embed\", \"iframe\", \"input:not([disabled])\", \"object\", \"select:not([disabled])\", \"textarea:not([disabled])\", \"*[tabindex]\", \"*[contenteditable]\"];\nconst focusableElSelector = focusableElList.join();\nfunction _default(el) {\n let keyboardOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let callback = arguments.length > 2 ? arguments[2] : undefined;\n if (callback) {\n const request = requestAnimationFrame(() => {\n callback(getFocusables(el, keyboardOnly));\n });\n return () => {\n cancelAnimationFrame(request);\n };\n }\n return getFocusables(el, keyboardOnly);\n}\nfunction getFocusables(el) {\n let keyboardOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let focusableEls = Array.prototype.slice.call(el.querySelectorAll(focusableElSelector));\n\n // filter out elements with display: none or nested in a display: none parent\n focusableEls = focusableEls.filter(function (focusableEl) {\n return !!(focusableEl.offsetWidth || focusableEl.offsetHeight || focusableEl.getClientRects().length);\n });\n if (keyboardOnly === true) {\n focusableEls = focusableEls.filter(function (focusableEl) {\n return focusableEl.getAttribute(\"tabindex\") !== \"-1\";\n });\n }\n return focusableEls;\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.add = add;\nexports.addKeyDown = addKeyDown;\nexports.addKeyUp = addKeyUp;\nexports.remove = remove;\nexports.removeKeyDown = removeKeyDown;\nexports.removeKeyUp = removeKeyUp;\nfunction uncapitalizeFirstLetter(str) {\n return str.charAt(0).toLowerCase() + str.slice(1);\n}\nfunction onKeyDownOrUp(evt, el, keyEventType) {\n if (!evt.shiftKey) {\n const key = evt.key;\n switch (key) {\n case \"Enter\":\n case \"Escape\":\n case \"PageUp\":\n case \"PageDown\":\n case \"End\":\n case \"Home\":\n case \"ArrowLeft\":\n case \"ArrowUp\":\n case \"ArrowRight\":\n case \"ArrowDown\":\n el.dispatchEvent(new CustomEvent(uncapitalizeFirstLetter(`${key}Key${keyEventType}`), {\n detail: evt,\n bubbles: true\n }));\n break;\n case \" \":\n el.dispatchEvent(new CustomEvent(`spacebarKey${keyEventType}`, {\n detail: evt,\n bubbles: true\n }));\n break;\n default:\n return;\n }\n }\n}\nfunction onKeyDown(e) {\n onKeyDownOrUp(e, this, \"Down\");\n}\nfunction onKeyUp(e) {\n onKeyDownOrUp(e, this, \"Up\");\n}\nfunction addKeyDown(el) {\n el.addEventListener(\"keydown\", onKeyDown);\n}\nfunction addKeyUp(el) {\n el.addEventListener(\"keyup\", onKeyUp);\n}\nfunction removeKeyDown(el) {\n el.removeEventListener(\"keydown\", onKeyDown);\n}\nfunction removeKeyUp(el) {\n el.removeEventListener(\"keyup\", onKeyUp);\n}\nfunction add(el) {\n addKeyDown(el);\n addKeyUp(el);\n}\nfunction remove(el) {\n removeKeyDown(el);\n removeKeyUp(el);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _makeupNextId = _interopRequireDefault(require(\"makeup-next-id\"));\nvar ExitEmitter = _interopRequireWildcard(require(\"makeup-exit-emitter\"));\nvar _makeupFocusables = _interopRequireDefault(require(\"makeup-focusables\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst defaultOptions = {\n alwaysDoFocusManagement: false,\n ariaControls: true,\n autoCollapse: false,\n collapseOnFocusOut: false,\n collapseOnMouseOut: false,\n collapseOnClickOut: false,\n collapseOnHostReFocus: false,\n contentSelector: \".expander__content\",\n expandedClass: null,\n expandOnClick: false,\n expandOnFocus: false,\n expandOnHover: false,\n focusManagement: null,\n hostSelector: \".expander__host\",\n simulateSpacebarClick: false\n};\nfunction onHostKeyDown(e) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this._keyboardClickFlag = true;\n }\n // if host element does not naturally trigger a click event on spacebar, we can force one to trigger here.\n // careful! if host already triggers click events naturally, we end up with a \"double-click\".\n if (e.keyCode === 32 && this.options.simulateSpacebarClick === true) {\n this.hostEl.click();\n }\n}\nfunction onHostMouseDown() {\n this._mouseClickFlag = true;\n}\nfunction onHostClick() {\n this._expandWasKeyboardClickActivated = this._keyboardClickFlag;\n this._expandWasMouseClickActivated = this._mouseClickFlag;\n this._widgetHasKeyboardFocus = this._keyboardClickFlag;\n this.expanded = !this.expanded;\n}\nfunction onHostFocus() {\n this._expandWasFocusActivated = true;\n this.expanded = true;\n}\n\n// NOTE: collapseOnHostReFocus cannot be used when expandOnFocus is true\nfunction onHostReFocus() {\n if (this.expanded && this._widgetHasKeyboardFocus) {\n this.expanded = false;\n }\n}\nfunction onHostHover() {\n clearTimeout(this._mouseLeft);\n this._expandWasHoverActivated = true;\n this.expanded = true;\n}\nfunction onFocusExit() {\n this._widgetHasKeyboardFocus = false;\n this.expanded = false;\n}\nfunction onMouseLeave() {\n clearTimeout(this._mouseLeft);\n this._mouseLeft = setTimeout(() => {\n this.expanded = false;\n }, 300);\n}\nfunction _onDocumentClick(e) {\n if (this.el.contains(e.target) === false) {\n this.expanded = false;\n }\n}\nfunction _onDocumentTouchStart() {\n this.documentClick = true;\n}\nfunction _onDocumentTouchMove() {\n this.documentClick = false;\n}\nfunction _onDocumentTouchEnd(e) {\n if (this.documentClick === true) {\n this.documentClick = false;\n if (this.el.contains(e.target) === false) {\n this.expanded = false;\n }\n }\n}\nfunction manageFocus(focusManagement, contentEl) {\n if (focusManagement === \"content\") {\n contentEl.setAttribute(\"tabindex\", \"-1\");\n contentEl.focus();\n } else if (focusManagement === \"focusable\") {\n (0, _makeupFocusables.default)(contentEl)[0]?.focus();\n } else if (focusManagement === \"interactive\") {\n (0, _makeupFocusables.default)(contentEl, true)[0]?.focus();\n } else if (focusManagement !== null) {\n const el = contentEl.querySelector(`#${focusManagement}`);\n if (el) {\n el.focus();\n }\n }\n}\nclass _default {\n constructor(el, selectedOptions) {\n this.options = Object.assign({}, defaultOptions, selectedOptions);\n this.el = el;\n this.hostEl = el.querySelector(this.options.hostSelector); // the keyboard focusable host el\n this.contentEl = el.querySelector(this.options.contentSelector);\n ExitEmitter.addFocusExit(this.el);\n this._hostKeyDownListener = onHostKeyDown.bind(this);\n this._hostMouseDownListener = onHostMouseDown.bind(this);\n this._documentClickListener = _onDocumentClick.bind(this);\n this._documentTouchStartListener = _onDocumentTouchStart.bind(this);\n this._documentTouchMoveListener = _onDocumentTouchMove.bind(this);\n this._documentTouchEndListener = _onDocumentTouchEnd.bind(this);\n this._hostClickListener = onHostClick.bind(this);\n this._hostFocusListener = onHostFocus.bind(this);\n this._hostReFocusListener = onHostReFocus.bind(this);\n this._hostHoverListener = onHostHover.bind(this);\n this._focusExitListener = onFocusExit.bind(this);\n this._mouseLeaveListener = onMouseLeave.bind(this);\n if (this.hostEl.getAttribute(\"aria-expanded\") === null) {\n this.hostEl.setAttribute(\"aria-expanded\", \"false\");\n }\n if (this.options.ariaControls === true) {\n // ensure the widget has an id\n (0, _makeupNextId.default)(this.el, \"expander\");\n this.contentEl.id = this.contentEl.id || `${this.el.id}-content`;\n this.hostEl.setAttribute(\"aria-controls\", this.contentEl.id);\n }\n this.expandOnClick = this.options.expandOnClick;\n this.expandOnFocus = this.options.expandOnFocus;\n this.expandOnHover = this.options.expandOnHover;\n this.collapseOnHostReFocus = this.options.collapseOnHostReFocus;\n if (this.options.autoCollapse === false) {\n this.collapseOnClickOut = this.options.collapseOnClickOut;\n this.collapseOnFocusOut = this.options.collapseOnFocusOut;\n this.collapseOnMouseOut = this.options.collapseOnMouseOut;\n }\n }\n set expandOnClick(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"keydown\", this._hostKeyDownListener);\n this.hostEl.addEventListener(\"mousedown\", this._hostMouseDownListener);\n this.hostEl.addEventListener(\"click\", this._hostClickListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnClickOut = true;\n this.collapseOnFocusOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"click\", this._hostClickListener);\n this.hostEl.removeEventListener(\"mousedown\", this._hostMouseDownListener);\n this.hostEl.removeEventListener(\"keydown\", this._hostKeyDownListener);\n }\n }\n set expandOnFocus(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"focus\", this._hostFocusListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnClickOut = true;\n this.collapseOnFocusOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"focus\", this._hostFocusListener);\n }\n }\n set collapseOnHostReFocus(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"focus\", this._hostReFocusListener);\n } else {\n this.hostEl.removeEventListener(\"focus\", this._hostReFocusListener);\n }\n }\n set expandOnHover(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"mouseenter\", this._hostHoverListener);\n this.contentEl.addEventListener(\"mouseenter\", this._hostHoverListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnMouseOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"mouseenter\", this._hostHoverListener);\n this.contentEl.removeEventListener(\"mouseenter\", this._hostHoverListener);\n }\n }\n set collapseOnClickOut(bool) {\n if (bool === true) {\n document.addEventListener(\"click\", this._documentClickListener);\n document.addEventListener(\"touchstart\", this._documentTouchStartListener);\n document.addEventListener(\"touchmove\", this._documentTouchMoveListener);\n document.addEventListener(\"touchend\", this._documentTouchEndListener);\n } else {\n document.removeEventListener(\"click\", this._documentClickListener);\n document.removeEventListener(\"touchstart\", this._documentTouchStartListener);\n document.removeEventListener(\"touchmove\", this._documentTouchMoveListener);\n document.removeEventListener(\"touchend\", this._documentTouchEndListener);\n }\n }\n set collapseOnFocusOut(bool) {\n if (bool === true) {\n this.el.addEventListener(\"focusExit\", this._focusExitListener);\n } else {\n this.el.removeEventListener(\"focusExit\", this._focusExitListener);\n }\n }\n set collapseOnMouseOut(bool) {\n if (bool === true) {\n this.el.addEventListener(\"mouseleave\", this._mouseLeaveListener);\n this.contentEl.addEventListener(\"mouseleave\", this._mouseLeaveListener);\n } else {\n this.el.removeEventListener(\"mouseleave\", this._mouseLeaveListener);\n this.contentEl.removeEventListener(\"mouseleave\", this._mouseLeaveListener);\n }\n }\n get expanded() {\n return this.hostEl.getAttribute(\"aria-expanded\") === \"true\";\n }\n set expanded(bool) {\n if (bool === true && this.expanded === false) {\n this.hostEl.setAttribute(\"aria-expanded\", \"true\");\n if (this.options.expandedClass) {\n this.el.classList.add(this.options.expandedClass);\n }\n if (this._expandWasKeyboardClickActivated || this._expandWasMouseClickActivated && this.options.alwaysDoFocusManagement) {\n manageFocus(this.options.focusManagement, this.contentEl);\n }\n this.el.dispatchEvent(new CustomEvent(\"expander-expand\", {\n bubbles: true,\n detail: this.contentEl\n }));\n }\n if (bool === false && this.expanded === true) {\n this.hostEl.setAttribute(\"aria-expanded\", \"false\");\n if (this.options.expandedClass) {\n this.el.classList.remove(this.options.expandedClass);\n }\n this.el.dispatchEvent(new CustomEvent(\"expander-collapse\", {\n bubbles: true,\n detail: this.contentEl\n }));\n }\n this._expandWasKeyboardClickActivated = false;\n this._expandWasMouseClickActivated = false;\n this._expandWasFocusActivated = false;\n this._expandWasHoverActivated = false;\n this._keyboardClickFlag = false;\n this._mouseClickFlag = false;\n }\n sleep() {\n if (this._destroyed !== true) {\n this.expandOnClick = false;\n this.expandOnFocus = false;\n this.expandOnHover = false;\n this.collapseOnClickOut = false;\n this.collapseOnFocusOut = false;\n this.collapseOnMouseOut = false;\n this.collapseOnHostReFocus = false;\n }\n }\n destroy() {\n this.sleep();\n this._destroyed = true;\n this._hostKeyDownListener = null;\n this._hostMouseDownListener = null;\n this._documentClickListener = null;\n this._documentTouchStartListener = null;\n this._documentTouchMoveListener = null;\n this._documentTouchEndListener = null;\n this._hostClickListener = null;\n this._hostFocusListener = null;\n this._hostReFocusListener = null;\n this._hostHoverListener = null;\n this._focusExitListener = null;\n this._mouseLeaveListener = null;\n this._widgetHasKeyboardFocus = null;\n }\n}\nexports.default = _default;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createLinear = createLinear;\nvar KeyEmitter = _interopRequireWildcard(require(\"makeup-key-emitter\"));\nvar ExitEmitter = _interopRequireWildcard(require(\"makeup-exit-emitter\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nconst defaultOptions = {\n axis: \"both\",\n autoInit: \"interactive\",\n autoReset: \"current\",\n ignoreByDelegateSelector: null,\n wrap: false\n};\nfunction isItemNavigable(el) {\n return !el.hidden && el.getAttribute(\"aria-disabled\") !== \"true\";\n}\nfunction isIndexNavigable(items, index) {\n return index >= 0 && index < items.length ? isItemNavigable(items[index]) : false;\n}\nfunction findNavigableItems(items) {\n return items.filter(isItemNavigable);\n}\nfunction findFirstNavigableIndex(items) {\n return items.findIndex(item => isItemNavigable(item));\n}\nfunction findLastNavigableIndex(items) {\n // todo: at(-1) is more performant than reverse(), but Babel is not transpiling it\n return items.indexOf(findNavigableItems(items).reverse()[0]);\n}\nfunction findIndexByAttribute(items, attribute, value) {\n return items.findIndex(item => isItemNavigable(item) && item.getAttribute(attribute) === value);\n}\nfunction findFirstNavigableAriaCheckedIndex(items) {\n return findIndexByAttribute(items, \"aria-checked\", \"true\");\n}\nfunction findFirstNavigableAriaSelectedIndex(items) {\n return findIndexByAttribute(items, \"aria-selected\", \"true\");\n}\nfunction findIgnoredByDelegateItems(el, options) {\n return options.ignoreByDelegateSelector !== null ? [...el.querySelectorAll(options.ignoreByDelegateSelector)] : [];\n}\nfunction findPreviousNavigableIndex(items, index, wrap) {\n let previousNavigableIndex = -1;\n if (index === null || atStart(items, index)) {\n if (wrap === true) {\n previousNavigableIndex = findLastNavigableIndex(items);\n }\n } else {\n let i = index;\n while (--i >= 0) {\n if (isItemNavigable(items[i])) {\n previousNavigableIndex = i;\n break;\n }\n }\n }\n return previousNavigableIndex;\n}\nfunction findNextNavigableIndex(items, index, wrap) {\n let nextNavigableIndex = -1;\n if (index === null) {\n nextNavigableIndex = findFirstNavigableIndex(items);\n } else if (atEnd(items, index)) {\n if (wrap === true) {\n nextNavigableIndex = findFirstNavigableIndex(items);\n }\n } else {\n let i = index;\n while (++i < items.length) {\n if (isItemNavigable(items[i])) {\n nextNavigableIndex = i;\n break;\n }\n }\n }\n return nextNavigableIndex;\n}\n\n// returning -1 means not found\nfunction findIndexPositionByType(typeOrNum, items, currentIndex) {\n let index = -1;\n switch (typeOrNum) {\n case \"none\":\n index = null;\n break;\n case \"current\":\n index = currentIndex;\n break;\n case \"interactive\":\n index = findFirstNavigableIndex(items);\n break;\n case \"ariaChecked\":\n index = findFirstNavigableAriaCheckedIndex(items);\n break;\n case \"ariaSelected\":\n index = findFirstNavigableAriaSelectedIndex(items);\n break;\n case \"ariaSelectedOrInteractive\":\n index = findFirstNavigableAriaSelectedIndex(items);\n index = index === -1 ? findFirstNavigableIndex(items) : index;\n break;\n default:\n index = typeof typeOrNum === \"number\" || typeOrNum === null ? typeOrNum : -1;\n }\n return index;\n}\nfunction atStart(items, index) {\n return index === findFirstNavigableIndex(items);\n}\nfunction atEnd(items, index) {\n return index === findLastNavigableIndex(items);\n}\nfunction onKeyPrev(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findPreviousNavigableIndex(this.items, this.index, this.options.wrap);\n }\n}\nfunction onKeyNext(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findNextNavigableIndex(this.items, this.index, this.options.wrap);\n }\n}\nfunction onClick(e) {\n const itemIndex = this.indexOf(e.target.closest(this._itemSelector));\n if (isIndexNavigable(this.items, itemIndex)) {\n this.index = itemIndex;\n }\n}\nfunction onKeyHome(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findFirstNavigableIndex(this.items);\n }\n}\nfunction onKeyEnd(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findLastNavigableIndex(this.items);\n }\n}\nfunction onFocusExit() {\n if (this.options.autoReset !== null) {\n this.reset();\n }\n}\nfunction onMutation(e) {\n const fromIndex = this.index;\n let toIndex = this.index;\n // https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord\n const {\n addedNodes,\n attributeName,\n removedNodes,\n target,\n type\n } = e[0];\n if (type === \"attributes\") {\n if (target === this.currentItem) {\n if (attributeName === \"aria-disabled\") {\n // current item was disabled - keep it as current index (until a keyboard navigation happens)\n toIndex = this.index;\n } else if (attributeName === \"hidden\") {\n // current item was hidden and focus is lost - reset index to first interactive element\n toIndex = findFirstNavigableIndex(this.items);\n }\n } else {\n toIndex = this.index;\n }\n } else if (type === \"childList\") {\n if (removedNodes.length > 0 && [...removedNodes].includes(this._cachedElement)) {\n // current item was removed and focus is lost - reset index to first interactive element\n toIndex = findFirstNavigableIndex(this.items);\n } else if (removedNodes.length > 0 || addedNodes.length > 0) {\n // nodes were added and/or removed - keep current item and resync its index\n toIndex = this.indexOf(this._cachedElement);\n }\n }\n this._index = toIndex;\n this._el.dispatchEvent(new CustomEvent(\"navigationModelMutation\", {\n bubbles: false,\n detail: {\n fromIndex,\n toIndex\n }\n }));\n}\nclass NavigationModel {\n /**\n * @param {HTMLElement} el\n * @param {string} itemSelector\n * @param {typeof defaultOptions} selectedOptions\n */\n constructor(el, itemSelector, selectedOptions) {\n /** @member {typeof defaultOptions} */\n this.options = Object.assign({}, defaultOptions, selectedOptions);\n\n /** @member {HTMLElement} */\n this._el = el;\n\n /** @member {string} */\n this._itemSelector = itemSelector;\n }\n}\nclass LinearNavigationModel extends NavigationModel {\n /**\n * @param {HTMLElement} el\n * @param {string} itemSelector\n * @param {typeof defaultOptions} selectedOptions\n */\n constructor(el, itemSelector, selectedOptions) {\n super(el, itemSelector, selectedOptions);\n const fromIndex = this._index;\n const toIndex = findIndexPositionByType(this.options.autoInit, this.items, this.index);\n\n // do not use setter as it will trigger a change event\n this._index = toIndex;\n\n // always keep an element reference to the last item (for use in mutation observer)\n // todo: convert index to Tuple to store last/current values instead?\n this._cachedElement = this.items[toIndex];\n this._el.dispatchEvent(new CustomEvent(\"navigationModelInit\", {\n bubbles: false,\n detail: {\n firstInteractiveIndex: this.firstNavigableIndex,\n fromIndex,\n items: this.items,\n toIndex\n }\n }));\n }\n get currentItem() {\n return this.items[this.index];\n }\n\n // todo: code smell as getter abstracts that the query selector re-runs every time getter is accessed\n get items() {\n return [...this._el.querySelectorAll(`${this._itemSelector}`)];\n }\n get index() {\n return this._index;\n }\n\n /**\n * @param {number} toIndex - update index position in this.items (non-interactive indexes fail silently)\n */\n set index(toIndex) {\n if (toIndex === this.index) {\n return;\n } else if (!isIndexNavigable(this.items, toIndex)) {\n // no-op. throw exception?\n } else {\n const fromIndex = this.index;\n // update cached element reference (for use in mutation observer if DOM node gets removed)\n this._cachedElement = this.items[toIndex];\n this._index = toIndex;\n this._el.dispatchEvent(new CustomEvent(\"navigationModelChange\", {\n bubbles: false,\n detail: {\n fromIndex,\n toIndex\n }\n }));\n }\n }\n indexOf(element) {\n return this.items.indexOf(element);\n }\n reset() {\n const fromIndex = this.index;\n const toIndex = findIndexPositionByType(this.options.autoReset, this.items, this.index);\n if (toIndex !== fromIndex) {\n // do not use setter as it will trigger a navigationModelChange event\n this._index = toIndex;\n this._el.dispatchEvent(new CustomEvent(\"navigationModelReset\", {\n bubbles: false,\n detail: {\n fromIndex,\n toIndex\n }\n }));\n }\n }\n}\n\n// 2D Grid Model will go here\n\n/*\nclass GridModel extends NavigationModel {\n constructor(el, rowSelector, colSelector) {\n super();\n this._coords = null;\n }\n}\n*/\n\nclass NavigationEmitter {\n /**\n * @param {HTMLElement} el\n * @param {LinearNavigationModel} model\n */\n constructor(el, model) {\n this.model = model;\n this.el = el;\n this._keyPrevListener = onKeyPrev.bind(model);\n this._keyNextListener = onKeyNext.bind(model);\n this._keyHomeListener = onKeyHome.bind(model);\n this._keyEndListener = onKeyEnd.bind(model);\n this._clickListener = onClick.bind(model);\n this._focusExitListener = onFocusExit.bind(model);\n this._observer = new MutationObserver(onMutation.bind(model));\n KeyEmitter.addKeyDown(this.el);\n ExitEmitter.addFocusExit(this.el);\n const axis = model.options.axis;\n if (axis === \"both\" || axis === \"x\") {\n this.el.addEventListener(\"arrowLeftKeyDown\", this._keyPrevListener);\n this.el.addEventListener(\"arrowRightKeyDown\", this._keyNextListener);\n }\n if (axis === \"both\" || axis === \"y\") {\n this.el.addEventListener(\"arrowUpKeyDown\", this._keyPrevListener);\n this.el.addEventListener(\"arrowDownKeyDown\", this._keyNextListener);\n }\n this.el.addEventListener(\"homeKeyDown\", this._keyHomeListener);\n this.el.addEventListener(\"endKeyDown\", this._keyEndListener);\n this.el.addEventListener(\"click\", this._clickListener);\n this.el.addEventListener(\"focusExit\", this._focusExitListener);\n this._observer.observe(this.el, {\n childList: true,\n subtree: true,\n attributeFilter: [\"aria-disabled\", \"hidden\"],\n attributes: true,\n attributeOldValue: true\n });\n }\n destroy() {\n KeyEmitter.removeKeyDown(this.el);\n ExitEmitter.removeFocusExit(this.el);\n this.el.removeEventListener(\"arrowLeftKeyDown\", this._keyPrevListener);\n this.el.removeEventListener(\"arrowRightKeyDown\", this._keyNextListener);\n this.el.removeEventListener(\"arrowUpKeyDown\", this._keyPrevListener);\n this.el.removeEventListener(\"arrowDownKeyDown\", this._keyNextListener);\n this.el.removeEventListener(\"homeKeyDown\", this._keyHomeListener);\n this.el.removeEventListener(\"endKeyDown\", this._keyEndListener);\n this.el.removeEventListener(\"click\", this._clickListener);\n this.el.removeEventListener(\"focusExit\", this._focusExitListener);\n this._observer.disconnect();\n }\n}\nfunction createLinear(el, itemSelector, selectedOptions) {\n const model = new LinearNavigationModel(el, itemSelector, selectedOptions);\n return new NavigationEmitter(el, model);\n}\n\n/*\nstatic createGrid(el, rowSelector, colSelector, selectedOptions) {\n return null;\n}\n*/\n","require('./../dist/tokens/evo-core.css');\n","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.add = add;\nexports.remove = remove;\nfunction onKeyDown(e) {\n if (e.keyCode >= 32 && e.keyCode <= 40) {\n e.preventDefault();\n }\n}\nfunction add(el) {\n el.addEventListener(\"keydown\", onKeyDown);\n}\nfunction remove(el) {\n el.removeEventListener(\"keydown\", onKeyDown);\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\"use strict\";\n\nrequire(\"../../docs.css\");\nrequire(\"@ebay/skin/tokens\");\nrequire(\"@ebay/skin/global\");\nrequire(\"@ebay/skin/combobox\");\nvar _makeupCombobox = _interopRequireDefault(require(\"makeup-combobox\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\n// REQUIRE\n// const Combobox = require('makeup-combobox').default;\n\n// IMPORT\n\nwindow.onload = function () {\n document.querySelectorAll(\".combobox\").forEach(function (el, i) {\n const widget = new _makeupCombobox.default(el, {\n autoSelect: el.dataset.makeupAutoSelect === \"false\" ? false : true\n });\n el.addEventListener(\"makeup-combobox-change\", function (e) {\n console.log(e.type, e.detail);\n });\n el.addEventListener(\"makeup-combobox-mutation\", function (e) {\n console.log(e.type, e.detail);\n });\n });\n};"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"makeup-combobox/index.min.js","mappings":";;;;;;;AAAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf,6CAA6C,mBAAO,CAAC,IAAiB;AACtE,4CAA4C,mBAAO,CAAC,IAAgB;AACpE,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;AACf;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;ACvOa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,oBAAoB;AACpB,uBAAuB;AACvB,2CAA2C,mBAAO,CAAC,IAAgB;AACnE,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC3EA;;;;;;;;;;ACAA;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf,+CAA+C,mBAAO,CAAC,IAA0B;AACjF,gDAAgD,mBAAO,CAAC,IAA4B;AACpF,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;;;;;;;ACvNA,mBAAO,CAAC,IAA8B;;;;;;;;;ACAzB;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,oBAAoB;AACpB,gDAAgD,mBAAO,CAAC,IAA2B;AACnF,2CAA2C,mBAAO,CAAC,IAAgB;AACnE,qCAAqC,iCAAiC;AACtE,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;ACxKA,mBAAO,CAAC,IAAgC;;;;;;;;;ACA3B;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,OAAO,EAAE,UAAU,EAAE,cAAc;;AAEpD;AACA;AACA;AACA,6BAA6B,IAAI,GAAG,mBAAmB;AACvD;AACA;AACA;;;;;;;;ACvCA,mBAAO,CAAC,IAAsB;AAC9B,mBAAO,CAAC,IAAuB;;;;;;;;ACD/B,mBAAO,CAAC,IAA0B;;;;;;;;;;ACAlC;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;ACnCa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,WAAW;AACX,kBAAkB;AAClB,gBAAgB;AAChB,cAAc;AACd,qBAAqB;AACrB,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,IAAI,KAAK,aAAa;AAC1F;AACA;AACA,SAAS;AACT;AACA;AACA,uDAAuD,aAAa;AACpE;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACrEA;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf,2CAA2C,mBAAO,CAAC,IAAgB;AACnE,0CAA0C,mBAAO,CAAC,GAAqB;AACvE,+CAA+C,mBAAO,CAAC,IAAmB;AAC1E,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ,2CAA2C,gBAAgB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,kDAAkD,WAAW;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;;;;;;;;;ACtSF;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,oBAAoB;AACpB,yCAAyC,mBAAO,CAAC,IAAoB;AACrE,0CAA0C,mBAAO,CAAC,GAAqB;AACvE,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,QAAQ;AACrB,aAAa,uBAAuB;AACpC;AACA;AACA,iBAAiB,uBAAuB;AACxC,mCAAmC;;AAEnC,iBAAiB,aAAa;AAC9B;;AAEA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,QAAQ;AACrB,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,4CAA4C,mBAAmB;AAC/D;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;ACjXA,mBAAO,CAAC,IAA+B;;;;;;;;;;ACAvC;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,WAAW;AACX,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;UCjBA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;;;;ACNa;;AAEb,mBAAO,CAAC,IAAgB;AACxB,mBAAO,CAAC,IAAmB;AAC3B,mBAAO,CAAC,IAAmB;AAC3B,mBAAO,CAAC,IAAqB;AAC7B,6CAA6C,mBAAO,CAAC,GAAiB;AACtE,qCAAqC,iCAAiC;AACtE;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH,E","sources":["webpack://root/./packages/ui/makeup-combobox/dist/cjs/index.js","webpack://root/./packages/core/makeup-exit-emitter/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/dist/global/global.css?e001","webpack://root/./node_modules/@ebay/skin/dist/tokens/evo-light.css?9c33","webpack://root/./packages/ui/makeup-listbox/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/combobox.js","webpack://root/./packages/core/makeup-active-descendant/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/tokens/evo-light.js","webpack://root/./packages/core/makeup-next-id/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/tokens.js","webpack://root/./node_modules/@ebay/skin/global.js","webpack://root/./docs/docs.css?378e","webpack://root/./packages/core/makeup-focusables/dist/cjs/index.js","webpack://root/./packages/core/makeup-key-emitter/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/dist/combobox/combobox.css?755d","webpack://root/./packages/core/makeup-expander/dist/cjs/index.js","webpack://root/./packages/core/makeup-navigation-emitter/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/tokens/evo-core.js","webpack://root/./node_modules/@ebay/skin/dist/tokens/evo-core.css?7a96","webpack://root/./packages/core/makeup-prevent-scroll-keys/dist/cjs/index.js","webpack://root/webpack/bootstrap","webpack://root/webpack/runtime/make namespace object","webpack://root/./docs/ui/makeup-combobox/index.compiled.js"],"sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _makeupExpander = _interopRequireDefault(require(\"makeup-expander\"));\nvar _makeupListbox = _interopRequireDefault(require(\"makeup-listbox\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst defaultOptions = {\n autoSelect: true,\n collapseTimeout: 150,\n customElementMode: false,\n autoScroll: true\n};\nclass _default {\n constructor(widgetEl, selectedOptions) {\n this._options = Object.assign({}, defaultOptions, selectedOptions);\n this._el = widgetEl;\n this._inputEl = this._el.querySelector(\"input\");\n this._listboxEl = this._el.querySelector(\".combobox__listbox\");\n this._autocompleteType = this._inputEl.getAttribute(\"aria-autocomplete\");\n this._inputEl.setAttribute(\"autocomplete\", \"off\");\n this._inputEl.setAttribute(\"role\", \"combobox\");\n this._listboxEl.hidden = false;\n this._listboxWidget = new _makeupListbox.default(this._listboxEl, {\n activeDescendantClassName: \"combobox__option--active\",\n autoReset: -1,\n autoSelect: this._options.autoSelect,\n focusableElement: this._inputEl,\n listboxOwnerElement: this._el,\n autoScroll: this._options.autoScroll\n });\n this._expander = new _makeupExpander.default(this._el, {\n collapseOnClickOut: true,\n collapseOnFocusOut: true,\n contentSelector: \".combobox__listbox\",\n expandedClass: \"combobox--expanded\",\n expandOnFocus: true,\n hostSelector: \"input\"\n });\n this._destroyed = false;\n this._onInputFocusListener = _onInputFocus.bind(this);\n this._onListboxClickListener = _onListboxClick.bind(this);\n this._onListboxActiveDescendantChangeListener = _onListboxActiveDescendantChange.bind(this);\n this._onTextboxKeyDownListener = _onTextboxKeyDown.bind(this);\n this._onTextboxInputListener = _onTextboxInput.bind(this);\n this._onTextboxClickListener = _onTextboxClick.bind(this);\n this._onMutationListener = _onMutation.bind(this);\n this._el.classList.add(\"combobox--js\");\n if (!this._options.customElementMode) {\n this._mutationObserver = new MutationObserver(this._onMutationListener);\n this._observeMutations();\n this._observeEvents();\n }\n }\n resetFilter() {\n this._listboxWidget._activeDescendant.reset();\n this._listboxWidget.items.forEach(el => el.hidden = false);\n }\n _observeMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.observe(this._inputEl, {\n attributes: true,\n childList: true,\n subtree: true\n });\n }\n }\n _unobserveMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.disconnect();\n }\n }\n _observeEvents() {\n if (this._destroyed !== true) {\n this._listboxEl.addEventListener(\"click\", this._onListboxClickListener);\n this._listboxWidget._activeDescendantRootEl.addEventListener(\"activeDescendantChange\", this._onListboxActiveDescendantChangeListener);\n this._inputEl.addEventListener(\"focus\", this._onInputFocusListener);\n this._inputEl.addEventListener(\"keydown\", this._onTextboxKeyDownListener);\n this._inputEl.addEventListener(\"input\", this._onTextboxInputListener);\n this._inputEl.addEventListener(\"click\", this._onTextboxClickListener);\n }\n }\n _unobserveEvents() {\n this._listboxEl.removeEventListener(\"click\", this._onListboxClickListener);\n this._listboxWidget._activeDescendantRootEl.removeEventListener(\"activeDescendantChange\", this._onListboxActiveDescendantChangeListener);\n this._inputEl.removeEventListener(\"focus\", this._onInputFocusListener);\n this._inputEl.removeEventListener(\"keydown\", this._onTextboxKeyDownListener);\n this._inputEl.removeEventListener(\"input\", this._onTextboxInputListener);\n this._inputEl.removeEventListener(\"click\", this._onTextboxClickListener);\n }\n destroy() {\n this._destroyed = true;\n this._unobserveMutations();\n this._unobserveEvents();\n this._onInputFocusListener = null;\n this._onListboxClickListener = null;\n this._onListboxActiveDesendanctChangeListener = null;\n this._onTextboxKeyDownListener = null;\n this._onTextboxInputListener = null;\n this._onTextboxClickListener = null;\n this._onMutationListener = null;\n }\n}\nexports.default = _default;\nfunction _onInputFocus() {\n if (this._autocompleteType === \"list\") {\n _filterSuggestions(this._inputEl.value, this._listboxWidget.items);\n } else {\n this.resetFilter();\n }\n}\nfunction _onTextboxKeyDown(e) {\n // up and down keys should not move caret\n if (e.keyCode === 38 || e.keyCode === 40) {\n e.preventDefault();\n }\n\n // down arrow key should always expand listbox\n if (e.keyCode === 40) {\n if (this._expander.expanded === false) {\n this._expander.expanded = true;\n }\n }\n\n // escape key should always collapse listbox\n if (e.keyCode === 27) {\n if (this._expander.expanded === true) {\n this._expander.expanded = false;\n this._listboxWidget._activeDescendant.reset();\n }\n }\n\n // for manual selection, ENTER should not submit form when there is an active descendant\n if (this._options.autoSelect === false && e.keyCode === 13 && this._inputEl.getAttribute(\"aria-activedescendant\")) {\n e.preventDefault();\n const widget = this;\n this._inputEl.value = this._listboxWidget.items[this._listboxWidget._activeDescendant.index].innerText;\n _dispatchChangeEvent(this._el, this._inputEl.value);\n this._listboxWidget._activeDescendant.reset();\n setTimeout(function () {\n widget._expander.expanded = false;\n if (widget._autocompleteType === \"list\") {\n if (widget._inputEl.value.length === 0) {\n widget.resetFilter();\n } else {\n _filterSuggestions(widget._inputEl.value, widget._listboxWidget.items);\n }\n }\n }, this._options.collapseTimeout);\n }\n}\nfunction _onTextboxClick() {\n if (this._expander.expanded === false) {\n this._expander.expanded = true;\n }\n}\nfunction _onTextboxInput() {\n if (this._expander.expanded === false) {\n this._expander.expanded = true;\n }\n // TODO: refactor this redundant logic with L165: L171\n if (this._autocompleteType === \"list\") {\n this._listboxWidget._activeDescendant.reset();\n if (this._inputEl.value.length === 0) {\n this.resetFilter();\n } else {\n _filterSuggestions(this._inputEl.value, this._listboxWidget.items);\n }\n }\n}\nfunction _onListboxClick(e) {\n const widget = this;\n const element = e.target.closest(\"[role=option]\");\n const indexData = this._listboxWidget.items.indexOf(element);\n if (indexData !== undefined) {\n this._inputEl.value = this._listboxWidget.items[indexData].innerText;\n\n // TODO: refactor this redundant logic with L165: L171\n if (this._autocompleteType === \"list\") {\n this._listboxWidget._activeDescendant.reset();\n if (this._inputEl.value.length === 0) {\n this.resetFilter();\n } else {\n _filterSuggestions(this._inputEl.value, this._listboxWidget.items);\n }\n }\n if (this._options.autoSelect === false) {\n _dispatchChangeEvent(this._el, this._inputEl.value);\n }\n setTimeout(function () {\n widget._expander.expanded = false;\n }, this._options.collapseTimeout);\n }\n}\nfunction _onListboxActiveDescendantChange(e) {\n if (this._options.autoSelect === true) {\n this._inputEl.value = this._listboxWidget.items[e.detail.toIndex].innerText;\n _dispatchChangeEvent(this._el, this._inputEl.value);\n }\n}\nfunction _onMutation(mutationsList) {\n for (const mutation of mutationsList) {\n if (mutation.type === \"attributes\") {\n this._el.dispatchEvent(new CustomEvent(\"makeup-combobox-mutation\", {\n detail: {\n attributeName: mutation.attributeName\n }\n }));\n }\n }\n}\nfunction _filterSuggestions(value, items) {\n const numChars = value.length;\n const currentValue = value.toLowerCase();\n const matchedItems = items.filter(el => {\n return el.innerText.trim().substring(0, numChars).toLowerCase() === currentValue;\n });\n const unmatchedItems = items.filter(el => {\n return el.innerText.trim().substring(0, numChars).toLowerCase() !== currentValue;\n });\n matchedItems.forEach(el => el.hidden = false);\n unmatchedItems.forEach(el => el.hidden = true);\n}\nfunction _dispatchChangeEvent(el, value) {\n el.dispatchEvent(new CustomEvent(\"makeup-combobox-change\", {\n detail: {\n value\n }\n }));\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.addFocusExit = addFocusExit;\nexports.removeFocusExit = removeFocusExit;\nvar _makeupNextId = _interopRequireDefault(require(\"makeup-next-id\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst focusExitEmitters = {};\nfunction doFocusExit(el, fromElement, toElement) {\n el.dispatchEvent(new CustomEvent(\"focusExit\", {\n detail: {\n fromElement,\n toElement\n },\n bubbles: false // mirror the native mouseleave event\n }));\n}\nfunction onDocumentFocusIn(e) {\n const newFocusElement = e.target;\n const targetIsDescendant = this.el.contains(newFocusElement);\n\n // if focus has moved to a focusable descendant\n if (targetIsDescendant === true) {\n // set the target as the currently focussed element\n this.currentFocusElement = newFocusElement;\n } else {\n // else focus has not gone to a focusable descendant\n window.removeEventListener(\"blur\", this.onWindowBlurListener);\n document.removeEventListener(\"focusin\", this.onDocumentFocusInListener);\n doFocusExit(this.el, this.currentFocusElement, newFocusElement);\n this.currentFocusElement = null;\n }\n}\nfunction onWindowBlur() {\n doFocusExit(this.el, this.currentFocusElement, undefined);\n}\nfunction onWidgetFocusIn() {\n // listen for focus moving to anywhere in document\n // note that mouse click on buttons, checkboxes and radios does not trigger focus events in all browsers!\n document.addEventListener(\"focusin\", this.onDocumentFocusInListener);\n // listen for focus leaving the window\n window.addEventListener(\"blur\", this.onWindowBlurListener);\n}\nclass FocusExitEmitter {\n constructor(el) {\n this.el = el;\n this.currentFocusElement = null;\n this.onWidgetFocusInListener = onWidgetFocusIn.bind(this);\n this.onDocumentFocusInListener = onDocumentFocusIn.bind(this);\n this.onWindowBlurListener = onWindowBlur.bind(this);\n this.el.addEventListener(\"focusin\", this.onWidgetFocusInListener);\n }\n removeEventListeners() {\n window.removeEventListener(\"blur\", this.onWindowBlurListener);\n document.removeEventListener(\"focusin\", this.onDocumentFocusInListener);\n this.el.removeEventListener(\"focusin\", this.onWidgetFocusInListener);\n }\n}\nfunction addFocusExit(el) {\n let exitEmitter = null;\n (0, _makeupNextId.default)(el);\n if (!focusExitEmitters[el.id]) {\n exitEmitter = new FocusExitEmitter(el);\n focusExitEmitters[el.id] = exitEmitter;\n }\n return exitEmitter;\n}\nfunction removeFocusExit(el) {\n const exitEmitter = focusExitEmitters[el.id];\n if (exitEmitter) {\n exitEmitter.removeEventListeners();\n delete focusExitEmitters[el.id];\n }\n}\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar ActiveDescendant = _interopRequireWildcard(require(\"makeup-active-descendant\"));\nvar PreventScrollKeys = _interopRequireWildcard(require(\"makeup-prevent-scroll-keys\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\n/**\n * A listbox can be a standalone focusable widget, or controlled by a separate, focusable widget\n * (a textbox for example, in the case of a combobox or datepicker)\n *\n * This listbox code currently supports single-selct only!\n * This code has been copied from Skin & MIND Patterns and has not yet been cleaned up.\n */\n\nconst defaultOptions = {\n activeDescendantClassName: \"listbox__option--active\",\n // the classname applied to the current active desdcendant\n autoInit: \"none\",\n autoReset: null,\n autoSelect: true,\n // when true, aria-checked state matches active-descendant\n autoScroll: true,\n // when true, the listbox will scroll to keep the activeDescendant in view\n customElementMode: false,\n focusableElement: null,\n // used in a combobox/datepicker scenario\n listboxOwnerElement: null,\n // used in a combobox/datepicker scenario\n multiSelect: false,\n // todo\n useAriaChecked: true,\n // doubles up on support for aria-selected to announce visible selected/checked state\n valueSelector: \".listbox__value\" // Selector to get value from\n};\nclass _default {\n constructor(widgetEl, selectedOptions) {\n this._options = Object.assign({}, defaultOptions, selectedOptions);\n this.el = widgetEl;\n\n // in cases such as combobox, the active-descendant logic is controlled by a parent widget\n this._activeDescendantRootEl = this._options.listboxOwnerElement || this.el;\n\n // todo: not sure this check is needed any more\n if (widgetEl.getAttribute(\"role\") === \"listbox\") {\n this._listboxEl = widgetEl;\n } else {\n this._listboxEl = this.el.querySelector(\"[role=listbox]\");\n }\n if (!this._options.focusableElement && this._listboxEl.getAttribute(\"tabindex\") === null) {\n this._listboxEl.setAttribute(\"tabindex\", \"0\");\n }\n PreventScrollKeys.add(this.el);\n this._onKeyDownListener = _onKeyDown.bind(this);\n this._onClickListener = _onClick.bind(this);\n this._onFirstMouseDownListener = _onFirstMouseDown.bind(this);\n this._onFirstFocusListener = _onFirstFocus.bind(this);\n this._onActiveDescendantChangeListener = _onActiveDescendantChange.bind(this);\n this._onMutationListener = _onMutation.bind(this);\n this.el.classList.add(\"listbox--js\");\n if (!this._options.customElementMode) {\n this._mutationObserver = new MutationObserver(this._onMutationListener);\n this._observeMutations();\n this._observeEvents();\n }\n this._activeDescendant = ActiveDescendant.createLinear(this._activeDescendantRootEl, this._options.focusableElement || this._listboxEl, this._listboxEl.parentElement, \"[role=option]\", {\n activeDescendantClassName: this._options.activeDescendantClassName,\n autoInit: this._options.autoInit,\n autoReset: this._options.autoReset,\n autoScroll: this._options.autoScroll,\n axis: \"y\"\n });\n }\n _observeMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.observe(this._listboxEl, {\n attributeFilter: [\"aria-selected\"],\n attributes: true,\n childList: true,\n subtree: true\n });\n }\n }\n _unobserveMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.disconnect();\n }\n }\n _observeEvents() {\n if (this._destroyed !== true) {\n this._activeDescendantRootEl.addEventListener(\"activeDescendantChange\", this._onActiveDescendantChangeListener);\n this._listboxEl.addEventListener(\"mousedown\", this._onFirstMouseDownListener, {\n once: true\n });\n this._listboxEl.addEventListener(\"focus\", this._onFirstFocusListener, {\n once: true\n });\n this._listboxEl.addEventListener(\"keydown\", this._onKeyDownListener);\n this._listboxEl.addEventListener(\"click\", this._onClickListener);\n }\n }\n _unobserveEvents() {\n this._listboxEl.removeEventListener(\"keydown\", this._onKeyDownListener);\n this._listboxEl.removeEventListener(\"click\", this._onClickListener);\n this._listboxEl.removeEventListener(\"focus\", this._onFirstFocusListener);\n this._listboxEl.removeEventListener(\"mousedown\", this._onFirstMouseDownListener);\n this._activeDescendantRootEl.removeEventListener(\"activeDescendantChange\", this._onActiveDescendantChangeListener);\n }\n get index() {\n return this.items.findIndex(el => el.getAttribute(\"aria-selected\") === \"true\");\n }\n get items() {\n return this._activeDescendant.items;\n }\n select(index) {\n this._unobserveMutations();\n if (this.index !== index) {\n this.unselect(this.index);\n const itemEl = this._activeDescendant.items[index];\n if (itemEl && itemEl.getAttribute(\"aria-disabled\") !== \"true\") {\n const matchingItem = this.items[index];\n let optionValue;\n matchingItem.setAttribute(\"aria-selected\", \"true\");\n if (this._options.useAriaChecked === true) {\n matchingItem.setAttribute(\"aria-checked\", \"true\");\n }\n optionValue = matchingItem.innerText;\n\n // Check if value selector is present and use that to get innerText instead\n // If its not present, will default to innerText of the whole item\n if (this._options.valueSelector) {\n const valueSelector = matchingItem.querySelector(this._options.valueSelector);\n if (valueSelector) {\n optionValue = valueSelector.innerText;\n }\n }\n this.el.dispatchEvent(new CustomEvent(\"makeup-listbox-change\", {\n detail: {\n el: matchingItem,\n optionIndex: index,\n optionValue\n }\n }));\n }\n }\n this._observeMutations();\n }\n unselect(index) {\n this._unobserveMutations();\n const itemEl = this.items[index];\n if (itemEl && itemEl.getAttribute(\"aria-disabled\") !== \"true\") {\n const matchingItem = this.items[index];\n matchingItem.setAttribute(\"aria-selected\", \"false\");\n if (this._options.useAriaChecked === true) {\n matchingItem.setAttribute(\"aria-checked\", \"false\");\n }\n }\n this._observeMutations();\n }\n destroy() {\n this._destroyed = true;\n this._unobserveMutations();\n this._unobserveEvents();\n this._onKeyDownListener = null;\n this._onClickListener = null;\n this._onFirstMouseDownListener = null;\n this._onFirstFocusListener = null;\n this._onActiveDescendantChangeListener = null;\n this._onMutationListener = null;\n }\n}\nexports.default = _default;\nfunction _onFirstMouseDown() {\n this._isMouseDown = true;\n}\n\n// set activeDescendant on first keyboard focus\nfunction _onFirstFocus() {\n if (!this._isMouseDown) {\n this._activeDescendant.index = this.index === -1 ? 0 : this.index;\n }\n this._isMouseDown = false;\n}\nfunction _onClick(e) {\n const toEl = e.target.closest(\"[role=option]\");\n if (toEl) {\n this.select(this.items.indexOf(toEl));\n }\n}\nfunction _onKeyDown(e) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this.select(this._activeDescendant.index);\n }\n}\nfunction _onActiveDescendantChange(e) {\n const {\n toIndex\n } = e.detail;\n const toEl = this.items[toIndex];\n if (this._options.autoSelect === true && toEl) {\n this.select(toIndex);\n }\n}\nfunction _onMutation(mutationsList) {\n for (const mutation of mutationsList) {\n if (mutation.type === \"attributes\") {\n this.el.dispatchEvent(new CustomEvent(\"makeup-listbox-mutation\", {\n detail: {\n attributeName: mutation.attributeName\n }\n }));\n }\n }\n}\n","require('./dist/combobox/combobox.css');\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createLinear = createLinear;\nvar NavigationEmitter = _interopRequireWildcard(require(\"makeup-navigation-emitter\"));\nvar _makeupNextId = _interopRequireDefault(require(\"makeup-next-id\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nconst defaultOptions = {\n activeDescendantClassName: \"active-descendant\",\n autoInit: \"none\",\n autoReset: \"none\",\n autoScroll: false,\n axis: \"both\",\n wrap: false\n};\nfunction onModelInit(e) {\n const {\n items,\n toIndex\n } = e.detail;\n const itemEl = items[toIndex];\n if (itemEl) {\n itemEl.classList.add(this._options.activeDescendantClassName);\n this._focusEl.setAttribute(\"aria-activedescendant\", itemEl.id);\n }\n this._el.dispatchEvent(new CustomEvent(\"activeDescendantInit\", {\n detail: e.detail\n }));\n}\nfunction onModelChange(e) {\n const {\n fromIndex,\n toIndex\n } = e.detail;\n const fromItem = this.items[fromIndex];\n const toItem = this.items[toIndex];\n if (fromItem) {\n fromItem.classList.remove(this._options.activeDescendantClassName);\n }\n if (toItem) {\n toItem.classList.add(this._options.activeDescendantClassName);\n this._focusEl.setAttribute(\"aria-activedescendant\", toItem.id);\n if (this._options.autoScroll && this._itemContainerEl) {\n this._itemContainerEl.scrollTop = toItem.offsetTop - this._itemContainerEl.offsetHeight / 2;\n }\n }\n this._el.dispatchEvent(new CustomEvent(\"activeDescendantChange\", {\n detail: e.detail\n }));\n}\nfunction onModelReset(e) {\n const toIndex = e.detail.toIndex;\n const activeClassName = this._options.activeDescendantClassName;\n this.items.forEach(function (el) {\n el.classList.remove(activeClassName);\n });\n if (toIndex !== null && toIndex !== -1) {\n const itemEl = this.items[toIndex];\n itemEl.classList.add(activeClassName);\n this._focusEl.setAttribute(\"aria-activedescendant\", itemEl.id);\n } else {\n this._focusEl.removeAttribute(\"aria-activedescendant\");\n }\n this._el.dispatchEvent(new CustomEvent(\"activeDescendantReset\", {\n detail: e.detail\n }));\n}\nfunction onModelMutation(e) {\n const {\n toIndex\n } = e.detail;\n const activeDescendantClassName = this._options.activeDescendantClassName;\n this.items.forEach(function (item, index) {\n (0, _makeupNextId.default)(item);\n if (index !== toIndex) {\n item.classList.remove(activeDescendantClassName);\n } else {\n item.classList.add(activeDescendantClassName);\n }\n });\n this._el.dispatchEvent(new CustomEvent(\"activeDescendantMutation\", {\n detail: e.detail\n }));\n}\nclass ActiveDescendant {\n constructor(el) {\n this._el = el;\n this._onMutationListener = onModelMutation.bind(this);\n this._onChangeListener = onModelChange.bind(this);\n this._onResetListener = onModelReset.bind(this);\n this._onInitListener = onModelInit.bind(this);\n this._el.addEventListener(\"navigationModelMutation\", this._onMutationListener);\n this._el.addEventListener(\"navigationModelChange\", this._onChangeListener);\n this._el.addEventListener(\"navigationModelReset\", this._onResetListener);\n this._el.addEventListener(\"navigationModelInit\", this._onInitListener);\n }\n destroy() {\n this._el.removeEventListener(\"navigationModelMutation\", this._onMutationListener);\n this._el.removeEventListener(\"navigationModelChange\", this._onChangeListener);\n this._el.removeEventListener(\"navigationModelReset\", this._onResetListener);\n this._el.removeEventListener(\"navigationModelInit\", this._onInitListener);\n }\n}\nclass LinearActiveDescendant extends ActiveDescendant {\n constructor(el, focusEl, itemContainerEl, itemSelector, selectedOptions) {\n super(el);\n this._options = Object.assign({}, defaultOptions, selectedOptions);\n this._focusEl = focusEl;\n this._itemContainerEl = itemContainerEl;\n this._itemSelector = itemSelector;\n\n // ensure container has an id\n (0, _makeupNextId.default)(this._itemContainerEl);\n\n // if programmatic relationship set aria-owns\n if (this._itemContainerEl !== this._focusEl) {\n focusEl.setAttribute(\"aria-owns\", this._itemContainerEl.id);\n }\n this._navigationEmitter = NavigationEmitter.createLinear(el, itemSelector, {\n autoInit: this._options.autoInit,\n autoReset: this._options.autoReset,\n axis: this._options.axis,\n ignoreByDelegateSelector: this._options.ignoreByDelegateSelector,\n wrap: this._options.wrap\n });\n\n // ensure each item has an id\n this.items.forEach(function (itemEl) {\n (0, _makeupNextId.default)(itemEl);\n });\n }\n get index() {\n return this._navigationEmitter.model.index;\n }\n set index(newIndex) {\n this._navigationEmitter.model.index = newIndex;\n }\n reset() {\n this._navigationEmitter.model.reset();\n }\n get currentItem() {\n return this._navigationEmitter.model.currentItem;\n }\n get items() {\n return this._navigationEmitter.model.items;\n }\n set wrap(newWrap) {\n this._navigationEmitter.model.options.wrap = newWrap;\n }\n destroy() {\n super.destroy();\n this._navigationEmitter.destroy();\n }\n}\n\n/*\nclass GridActiveDescendant extends ActiveDescendant {\n constructor(el, focusEl, containerEl, rowSelector, cellSelector) {\n super(el);\n }\n}\n*/\n\nfunction createLinear(el, focusEl, itemContainerEl, itemSelector, selectedOptions) {\n return new LinearActiveDescendant(el, focusEl, itemContainerEl, itemSelector, selectedOptions);\n}\n","require('./../dist/tokens/evo-light.css');\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nconst sequenceMap = {};\nconst defaultPrefix = \"nid\";\nconst randomPortion = createRandomPortion(3);\nfunction randomNumber(max) {\n return Math.floor(Math.random() * max);\n}\nfunction createRandomPortion(size) {\n const letters = \"abcdefghijklmnopqrstuvwxyz\";\n const digits = \"0123456789\";\n const allChars = letters + digits;\n\n // to ensure a valid HTML ID (when prefix is empty), first character must be a letter\n let portion = letters[randomNumber(25)];\n\n // start iterating from 1, as we already have our first char\n for (let i = 1; i < size; i++) {\n portion += allChars[randomNumber(35)];\n }\n return portion;\n}\nfunction _default(el) {\n let prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultPrefix;\n const separator = prefix === \"\" ? \"\" : \"-\";\n\n // join first prefix with random portion to create key\n const key = `${prefix}${separator}${randomPortion}`;\n\n // initialise key in sequence map if necessary\n sequenceMap[key] = sequenceMap[key] || 0;\n if (!el.id) {\n el.setAttribute(\"id\", `${key}-${sequenceMap[key]++}`);\n }\n return el.id;\n}\n","require('./tokens/evo-core.js');\nrequire('./tokens/evo-light.js');\n","require('./dist/global/global.css');\n","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nconst focusableElList = [\"a[href]\", \"area[href]\", \"button:not([disabled])\", \"embed\", \"iframe\", \"input:not([disabled])\", \"object\", \"select:not([disabled])\", \"textarea:not([disabled])\", \"*[tabindex]\", \"*[contenteditable]\"];\nconst focusableElSelector = focusableElList.join();\nfunction _default(el) {\n let keyboardOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let callback = arguments.length > 2 ? arguments[2] : undefined;\n if (callback) {\n const request = requestAnimationFrame(() => {\n callback(getFocusables(el, keyboardOnly));\n });\n return () => {\n cancelAnimationFrame(request);\n };\n }\n return getFocusables(el, keyboardOnly);\n}\nfunction getFocusables(el) {\n let keyboardOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let focusableEls = Array.prototype.slice.call(el.querySelectorAll(focusableElSelector));\n\n // filter out elements with display: none or nested in a display: none parent\n focusableEls = focusableEls.filter(function (focusableEl) {\n return !!(focusableEl.offsetWidth || focusableEl.offsetHeight || focusableEl.getClientRects().length);\n });\n if (keyboardOnly === true) {\n focusableEls = focusableEls.filter(function (focusableEl) {\n return focusableEl.getAttribute(\"tabindex\") !== \"-1\";\n });\n }\n return focusableEls;\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.add = add;\nexports.addKeyDown = addKeyDown;\nexports.addKeyUp = addKeyUp;\nexports.remove = remove;\nexports.removeKeyDown = removeKeyDown;\nexports.removeKeyUp = removeKeyUp;\nfunction uncapitalizeFirstLetter(str) {\n return str.charAt(0).toLowerCase() + str.slice(1);\n}\nfunction onKeyDownOrUp(evt, el, keyEventType) {\n if (!evt.shiftKey) {\n const key = evt.key;\n switch (key) {\n case \"Enter\":\n case \"Escape\":\n case \"PageUp\":\n case \"PageDown\":\n case \"End\":\n case \"Home\":\n case \"ArrowLeft\":\n case \"ArrowUp\":\n case \"ArrowRight\":\n case \"ArrowDown\":\n el.dispatchEvent(new CustomEvent(uncapitalizeFirstLetter(`${key}Key${keyEventType}`), {\n detail: evt,\n bubbles: true\n }));\n break;\n case \" \":\n el.dispatchEvent(new CustomEvent(`spacebarKey${keyEventType}`, {\n detail: evt,\n bubbles: true\n }));\n break;\n default:\n return;\n }\n }\n}\nfunction onKeyDown(e) {\n onKeyDownOrUp(e, this, \"Down\");\n}\nfunction onKeyUp(e) {\n onKeyDownOrUp(e, this, \"Up\");\n}\nfunction addKeyDown(el) {\n el.addEventListener(\"keydown\", onKeyDown);\n}\nfunction addKeyUp(el) {\n el.addEventListener(\"keyup\", onKeyUp);\n}\nfunction removeKeyDown(el) {\n el.removeEventListener(\"keydown\", onKeyDown);\n}\nfunction removeKeyUp(el) {\n el.removeEventListener(\"keyup\", onKeyUp);\n}\nfunction add(el) {\n addKeyDown(el);\n addKeyUp(el);\n}\nfunction remove(el) {\n removeKeyDown(el);\n removeKeyUp(el);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _makeupNextId = _interopRequireDefault(require(\"makeup-next-id\"));\nvar ExitEmitter = _interopRequireWildcard(require(\"makeup-exit-emitter\"));\nvar _makeupFocusables = _interopRequireDefault(require(\"makeup-focusables\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst defaultOptions = {\n alwaysDoFocusManagement: false,\n ariaControls: true,\n autoCollapse: false,\n collapseOnFocusOut: false,\n collapseOnMouseOut: false,\n collapseOnClickOut: false,\n collapseOnHostReFocus: false,\n contentSelector: \".expander__content\",\n expandedClass: null,\n expandOnClick: false,\n expandOnFocus: false,\n expandOnHover: false,\n focusManagement: null,\n hostSelector: \".expander__host\",\n simulateSpacebarClick: false,\n useAriaExpanded: true\n};\nfunction onHostKeyDown(e) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this._keyboardClickFlag = true;\n }\n // if host element does not naturally trigger a click event on spacebar, we can force one to trigger here.\n // careful! if host already triggers click events naturally, we end up with a \"double-click\".\n if (e.keyCode === 32 && this.options.simulateSpacebarClick === true) {\n this.hostEl.click();\n }\n}\nfunction onHostMouseDown() {\n this._mouseClickFlag = true;\n}\nfunction onHostClick() {\n this._expandWasKeyboardClickActivated = this._keyboardClickFlag;\n this._expandWasMouseClickActivated = this._mouseClickFlag;\n this._widgetHasKeyboardFocus = this._keyboardClickFlag;\n this.expanded = !this.expanded;\n}\nfunction onHostFocus() {\n this._expandWasFocusActivated = true;\n this.expanded = true;\n}\n\n// NOTE: collapseOnHostReFocus cannot be used when expandOnFocus is true\nfunction onHostReFocus() {\n if (this.expanded && this._widgetHasKeyboardFocus) {\n this.expanded = false;\n }\n}\nfunction onHostHover() {\n clearTimeout(this._mouseLeft);\n this._expandWasHoverActivated = true;\n this.expanded = true;\n}\nfunction onFocusExit() {\n this._widgetHasKeyboardFocus = false;\n this.expanded = false;\n}\nfunction onMouseLeave() {\n clearTimeout(this._mouseLeft);\n this._mouseLeft = setTimeout(() => {\n this.expanded = false;\n }, 300);\n}\nfunction _onDocumentClick(e) {\n if (this.el.contains(e.target) === false) {\n this.expanded = false;\n }\n}\nfunction _onDocumentTouchStart() {\n this.documentClick = true;\n}\nfunction _onDocumentTouchMove() {\n this.documentClick = false;\n}\nfunction _onDocumentTouchEnd(e) {\n if (this.documentClick === true) {\n this.documentClick = false;\n if (this.el.contains(e.target) === false) {\n this.expanded = false;\n }\n }\n}\nfunction manageFocus(focusManagement, contentEl) {\n if (focusManagement === \"content\") {\n contentEl.setAttribute(\"tabindex\", \"-1\");\n contentEl.focus();\n } else if (focusManagement === \"focusable\") {\n (0, _makeupFocusables.default)(contentEl)[0]?.focus();\n } else if (focusManagement === \"interactive\") {\n (0, _makeupFocusables.default)(contentEl, true)[0]?.focus();\n } else if (focusManagement !== null) {\n const el = contentEl.querySelector(`#${focusManagement}`);\n if (el) {\n el.focus();\n }\n }\n}\nclass _default {\n constructor(el, selectedOptions) {\n this.options = Object.assign({}, defaultOptions, selectedOptions);\n this.el = el;\n this.hostEl = el.querySelector(this.options.hostSelector); // the keyboard focusable host el\n this.contentEl = el.querySelector(this.options.contentSelector);\n ExitEmitter.addFocusExit(this.el);\n this._hostKeyDownListener = onHostKeyDown.bind(this);\n this._hostMouseDownListener = onHostMouseDown.bind(this);\n this._documentClickListener = _onDocumentClick.bind(this);\n this._documentTouchStartListener = _onDocumentTouchStart.bind(this);\n this._documentTouchMoveListener = _onDocumentTouchMove.bind(this);\n this._documentTouchEndListener = _onDocumentTouchEnd.bind(this);\n this._hostClickListener = onHostClick.bind(this);\n this._hostFocusListener = onHostFocus.bind(this);\n this._hostReFocusListener = onHostReFocus.bind(this);\n this._hostHoverListener = onHostHover.bind(this);\n this._focusExitListener = onFocusExit.bind(this);\n this._mouseLeaveListener = onMouseLeave.bind(this);\n if (this.options.useAriaExpanded === true) {\n const initialAriaExpanded = this.hostEl.getAttribute(\"aria-expanded\");\n this._expanded = initialAriaExpanded === \"true\";\n if (initialAriaExpanded === null) {\n this.hostEl.setAttribute(\"aria-expanded\", \"false\");\n }\n } else {\n this._expanded = false;\n }\n if (this.options.ariaControls === true) {\n // ensure the widget has an id\n (0, _makeupNextId.default)(this.el, \"expander\");\n this.contentEl.id = this.contentEl.id || `${this.el.id}-content`;\n this.hostEl.setAttribute(\"aria-controls\", this.contentEl.id);\n }\n this.expandOnClick = this.options.expandOnClick;\n this.expandOnFocus = this.options.expandOnFocus;\n this.expandOnHover = this.options.expandOnHover;\n this.collapseOnHostReFocus = this.options.collapseOnHostReFocus;\n if (this.options.autoCollapse === false) {\n this.collapseOnClickOut = this.options.collapseOnClickOut;\n this.collapseOnFocusOut = this.options.collapseOnFocusOut;\n this.collapseOnMouseOut = this.options.collapseOnMouseOut;\n }\n }\n set expandOnClick(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"keydown\", this._hostKeyDownListener);\n this.hostEl.addEventListener(\"mousedown\", this._hostMouseDownListener);\n this.hostEl.addEventListener(\"click\", this._hostClickListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnClickOut = true;\n this.collapseOnFocusOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"click\", this._hostClickListener);\n this.hostEl.removeEventListener(\"mousedown\", this._hostMouseDownListener);\n this.hostEl.removeEventListener(\"keydown\", this._hostKeyDownListener);\n }\n }\n set expandOnFocus(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"focus\", this._hostFocusListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnClickOut = true;\n this.collapseOnFocusOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"focus\", this._hostFocusListener);\n }\n }\n set collapseOnHostReFocus(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"focus\", this._hostReFocusListener);\n } else {\n this.hostEl.removeEventListener(\"focus\", this._hostReFocusListener);\n }\n }\n set expandOnHover(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"mouseenter\", this._hostHoverListener);\n this.contentEl.addEventListener(\"mouseenter\", this._hostHoverListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnMouseOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"mouseenter\", this._hostHoverListener);\n this.contentEl.removeEventListener(\"mouseenter\", this._hostHoverListener);\n }\n }\n set collapseOnClickOut(bool) {\n if (bool === true) {\n document.addEventListener(\"click\", this._documentClickListener);\n document.addEventListener(\"touchstart\", this._documentTouchStartListener);\n document.addEventListener(\"touchmove\", this._documentTouchMoveListener);\n document.addEventListener(\"touchend\", this._documentTouchEndListener);\n } else {\n document.removeEventListener(\"click\", this._documentClickListener);\n document.removeEventListener(\"touchstart\", this._documentTouchStartListener);\n document.removeEventListener(\"touchmove\", this._documentTouchMoveListener);\n document.removeEventListener(\"touchend\", this._documentTouchEndListener);\n }\n }\n set collapseOnFocusOut(bool) {\n if (bool === true) {\n this.el.addEventListener(\"focusExit\", this._focusExitListener);\n } else {\n this.el.removeEventListener(\"focusExit\", this._focusExitListener);\n }\n }\n set collapseOnMouseOut(bool) {\n if (bool === true) {\n this.el.addEventListener(\"mouseleave\", this._mouseLeaveListener);\n this.contentEl.addEventListener(\"mouseleave\", this._mouseLeaveListener);\n } else {\n this.el.removeEventListener(\"mouseleave\", this._mouseLeaveListener);\n this.contentEl.removeEventListener(\"mouseleave\", this._mouseLeaveListener);\n }\n }\n get expanded() {\n return this._expanded;\n }\n set expanded(bool) {\n if (bool === true && this.expanded === false) {\n if (this.options.useAriaExpanded === true) {\n this.hostEl.setAttribute(\"aria-expanded\", \"true\");\n }\n if (this.options.expandedClass) {\n this.el.classList.add(this.options.expandedClass);\n }\n if (this._expandWasKeyboardClickActivated || this._expandWasMouseClickActivated && this.options.alwaysDoFocusManagement) {\n manageFocus(this.options.focusManagement, this.contentEl);\n }\n this.el.dispatchEvent(new CustomEvent(\"expander-expand\", {\n bubbles: true,\n detail: this.contentEl\n }));\n }\n if (bool === false && this.expanded === true) {\n if (this.options.useAriaExpanded === true) {\n this.hostEl.setAttribute(\"aria-expanded\", \"false\");\n }\n if (this.options.expandedClass) {\n this.el.classList.remove(this.options.expandedClass);\n }\n this.el.dispatchEvent(new CustomEvent(\"expander-collapse\", {\n bubbles: true,\n detail: this.contentEl\n }));\n }\n this._expanded = bool;\n this._expandWasKeyboardClickActivated = false;\n this._expandWasMouseClickActivated = false;\n this._expandWasFocusActivated = false;\n this._expandWasHoverActivated = false;\n this._keyboardClickFlag = false;\n this._mouseClickFlag = false;\n }\n sleep() {\n if (this._destroyed !== true) {\n this.expandOnClick = false;\n this.expandOnFocus = false;\n this.expandOnHover = false;\n this.collapseOnClickOut = false;\n this.collapseOnFocusOut = false;\n this.collapseOnMouseOut = false;\n this.collapseOnHostReFocus = false;\n }\n }\n destroy() {\n this.sleep();\n this._destroyed = true;\n this._hostKeyDownListener = null;\n this._hostMouseDownListener = null;\n this._documentClickListener = null;\n this._documentTouchStartListener = null;\n this._documentTouchMoveListener = null;\n this._documentTouchEndListener = null;\n this._hostClickListener = null;\n this._hostFocusListener = null;\n this._hostReFocusListener = null;\n this._hostHoverListener = null;\n this._focusExitListener = null;\n this._mouseLeaveListener = null;\n this._widgetHasKeyboardFocus = null;\n }\n}\nexports.default = _default;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createLinear = createLinear;\nvar KeyEmitter = _interopRequireWildcard(require(\"makeup-key-emitter\"));\nvar ExitEmitter = _interopRequireWildcard(require(\"makeup-exit-emitter\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nconst defaultOptions = {\n axis: \"both\",\n autoInit: \"interactive\",\n autoReset: \"current\",\n ignoreByDelegateSelector: null,\n wrap: false\n};\nfunction isItemNavigable(el) {\n return !el.hidden && el.getAttribute(\"aria-disabled\") !== \"true\";\n}\nfunction isIndexNavigable(items, index) {\n return index >= 0 && index < items.length ? isItemNavigable(items[index]) : false;\n}\nfunction findNavigableItems(items) {\n return items.filter(isItemNavigable);\n}\nfunction findFirstNavigableIndex(items) {\n return items.findIndex(item => isItemNavigable(item));\n}\nfunction findLastNavigableIndex(items) {\n // todo: at(-1) is more performant than reverse(), but Babel is not transpiling it\n return items.indexOf(findNavigableItems(items).reverse()[0]);\n}\nfunction findIndexByAttribute(items, attribute, value) {\n return items.findIndex(item => isItemNavigable(item) && item.getAttribute(attribute) === value);\n}\nfunction findFirstNavigableAriaCheckedIndex(items) {\n return findIndexByAttribute(items, \"aria-checked\", \"true\");\n}\nfunction findFirstNavigableAriaSelectedIndex(items) {\n return findIndexByAttribute(items, \"aria-selected\", \"true\");\n}\nfunction findIgnoredByDelegateItems(el, options) {\n return options.ignoreByDelegateSelector !== null ? [...el.querySelectorAll(options.ignoreByDelegateSelector)] : [];\n}\nfunction findPreviousNavigableIndex(items, index, wrap) {\n let previousNavigableIndex = -1;\n if (index === null || atStart(items, index)) {\n if (wrap === true) {\n previousNavigableIndex = findLastNavigableIndex(items);\n }\n } else {\n let i = index;\n while (--i >= 0) {\n if (isItemNavigable(items[i])) {\n previousNavigableIndex = i;\n break;\n }\n }\n }\n return previousNavigableIndex;\n}\nfunction findNextNavigableIndex(items, index, wrap) {\n let nextNavigableIndex = -1;\n if (index === null) {\n nextNavigableIndex = findFirstNavigableIndex(items);\n } else if (atEnd(items, index)) {\n if (wrap === true) {\n nextNavigableIndex = findFirstNavigableIndex(items);\n }\n } else {\n let i = index;\n while (++i < items.length) {\n if (isItemNavigable(items[i])) {\n nextNavigableIndex = i;\n break;\n }\n }\n }\n return nextNavigableIndex;\n}\n\n// returning -1 means not found\nfunction findIndexPositionByType(typeOrNum, items, currentIndex) {\n let index = -1;\n switch (typeOrNum) {\n case \"none\":\n index = null;\n break;\n case \"current\":\n index = currentIndex;\n break;\n case \"interactive\":\n index = findFirstNavigableIndex(items);\n break;\n case \"ariaChecked\":\n index = findFirstNavigableAriaCheckedIndex(items);\n break;\n case \"ariaSelected\":\n index = findFirstNavigableAriaSelectedIndex(items);\n break;\n case \"ariaSelectedOrInteractive\":\n index = findFirstNavigableAriaSelectedIndex(items);\n index = index === -1 ? findFirstNavigableIndex(items) : index;\n break;\n default:\n index = typeof typeOrNum === \"number\" || typeOrNum === null ? typeOrNum : -1;\n }\n return index;\n}\nfunction atStart(items, index) {\n return index === findFirstNavigableIndex(items);\n}\nfunction atEnd(items, index) {\n return index === findLastNavigableIndex(items);\n}\nfunction onKeyPrev(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findPreviousNavigableIndex(this.items, this.index, this.options.wrap);\n }\n}\nfunction onKeyNext(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findNextNavigableIndex(this.items, this.index, this.options.wrap);\n }\n}\nfunction onClick(e) {\n const itemIndex = this.indexOf(e.target.closest(this._itemSelector));\n if (isIndexNavigable(this.items, itemIndex)) {\n this.index = itemIndex;\n }\n}\nfunction onKeyHome(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findFirstNavigableIndex(this.items);\n }\n}\nfunction onKeyEnd(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findLastNavigableIndex(this.items);\n }\n}\nfunction onFocusExit() {\n if (this.options.autoReset !== null) {\n this.reset();\n }\n}\nfunction onMutation(e) {\n const fromIndex = this.index;\n let toIndex = this.index;\n // https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord\n const {\n addedNodes,\n attributeName,\n removedNodes,\n target,\n type\n } = e[0];\n if (type === \"attributes\") {\n if (target === this.currentItem) {\n if (attributeName === \"aria-disabled\") {\n // current item was disabled - keep it as current index (until a keyboard navigation happens)\n toIndex = this.index;\n } else if (attributeName === \"hidden\") {\n // current item was hidden and focus is lost - reset index to first interactive element\n toIndex = findFirstNavigableIndex(this.items);\n }\n } else {\n toIndex = this.index;\n }\n } else if (type === \"childList\") {\n if (removedNodes.length > 0 && [...removedNodes].includes(this._cachedElement)) {\n // current item was removed and focus is lost - reset index to first interactive element\n toIndex = findFirstNavigableIndex(this.items);\n } else if (removedNodes.length > 0 || addedNodes.length > 0) {\n // nodes were added and/or removed - keep current item and resync its index\n toIndex = this.indexOf(this._cachedElement);\n }\n }\n this._index = toIndex;\n this._el.dispatchEvent(new CustomEvent(\"navigationModelMutation\", {\n bubbles: false,\n detail: {\n fromIndex,\n toIndex\n }\n }));\n}\nclass NavigationModel {\n /**\n * @param {HTMLElement} el\n * @param {string} itemSelector\n * @param {typeof defaultOptions} selectedOptions\n */\n constructor(el, itemSelector, selectedOptions) {\n /** @member {typeof defaultOptions} */\n this.options = Object.assign({}, defaultOptions, selectedOptions);\n\n /** @member {HTMLElement} */\n this._el = el;\n\n /** @member {string} */\n this._itemSelector = itemSelector;\n }\n}\nclass LinearNavigationModel extends NavigationModel {\n /**\n * @param {HTMLElement} el\n * @param {string} itemSelector\n * @param {typeof defaultOptions} selectedOptions\n */\n constructor(el, itemSelector, selectedOptions) {\n super(el, itemSelector, selectedOptions);\n const fromIndex = this._index;\n const toIndex = findIndexPositionByType(this.options.autoInit, this.items, this.index);\n\n // do not use setter as it will trigger a change event\n this._index = toIndex;\n\n // always keep an element reference to the last item (for use in mutation observer)\n // todo: convert index to Tuple to store last/current values instead?\n this._cachedElement = this.items[toIndex];\n this._el.dispatchEvent(new CustomEvent(\"navigationModelInit\", {\n bubbles: false,\n detail: {\n firstInteractiveIndex: this.firstNavigableIndex,\n fromIndex,\n items: this.items,\n toIndex\n }\n }));\n }\n get currentItem() {\n return this.items[this.index];\n }\n\n // todo: code smell as getter abstracts that the query selector re-runs every time getter is accessed\n get items() {\n return [...this._el.querySelectorAll(`${this._itemSelector}`)];\n }\n get index() {\n return this._index;\n }\n\n /**\n * @param {number} toIndex - update index position in this.items (non-interactive indexes fail silently)\n */\n set index(toIndex) {\n if (toIndex === this.index) {\n return;\n } else if (!isIndexNavigable(this.items, toIndex)) {\n // no-op. throw exception?\n } else {\n const fromIndex = this.index;\n // update cached element reference (for use in mutation observer if DOM node gets removed)\n this._cachedElement = this.items[toIndex];\n this._index = toIndex;\n this._el.dispatchEvent(new CustomEvent(\"navigationModelChange\", {\n bubbles: false,\n detail: {\n fromIndex,\n toIndex\n }\n }));\n }\n }\n indexOf(element) {\n return this.items.indexOf(element);\n }\n reset() {\n const fromIndex = this.index;\n const toIndex = findIndexPositionByType(this.options.autoReset, this.items, this.index);\n if (toIndex !== fromIndex) {\n // do not use setter as it will trigger a navigationModelChange event\n this._index = toIndex;\n this._el.dispatchEvent(new CustomEvent(\"navigationModelReset\", {\n bubbles: false,\n detail: {\n fromIndex,\n toIndex\n }\n }));\n }\n }\n}\n\n// 2D Grid Model will go here\n\n/*\nclass GridModel extends NavigationModel {\n constructor(el, rowSelector, colSelector) {\n super();\n this._coords = null;\n }\n}\n*/\n\nclass NavigationEmitter {\n /**\n * @param {HTMLElement} el\n * @param {LinearNavigationModel} model\n */\n constructor(el, model) {\n this.model = model;\n this.el = el;\n this._keyPrevListener = onKeyPrev.bind(model);\n this._keyNextListener = onKeyNext.bind(model);\n this._keyHomeListener = onKeyHome.bind(model);\n this._keyEndListener = onKeyEnd.bind(model);\n this._clickListener = onClick.bind(model);\n this._focusExitListener = onFocusExit.bind(model);\n this._observer = new MutationObserver(onMutation.bind(model));\n KeyEmitter.addKeyDown(this.el);\n ExitEmitter.addFocusExit(this.el);\n const axis = model.options.axis;\n if (axis === \"both\" || axis === \"x\") {\n this.el.addEventListener(\"arrowLeftKeyDown\", this._keyPrevListener);\n this.el.addEventListener(\"arrowRightKeyDown\", this._keyNextListener);\n }\n if (axis === \"both\" || axis === \"y\") {\n this.el.addEventListener(\"arrowUpKeyDown\", this._keyPrevListener);\n this.el.addEventListener(\"arrowDownKeyDown\", this._keyNextListener);\n }\n this.el.addEventListener(\"homeKeyDown\", this._keyHomeListener);\n this.el.addEventListener(\"endKeyDown\", this._keyEndListener);\n this.el.addEventListener(\"click\", this._clickListener);\n this.el.addEventListener(\"focusExit\", this._focusExitListener);\n this._observer.observe(this.el, {\n childList: true,\n subtree: true,\n attributeFilter: [\"aria-disabled\", \"hidden\"],\n attributes: true,\n attributeOldValue: true\n });\n }\n destroy() {\n KeyEmitter.removeKeyDown(this.el);\n ExitEmitter.removeFocusExit(this.el);\n this.el.removeEventListener(\"arrowLeftKeyDown\", this._keyPrevListener);\n this.el.removeEventListener(\"arrowRightKeyDown\", this._keyNextListener);\n this.el.removeEventListener(\"arrowUpKeyDown\", this._keyPrevListener);\n this.el.removeEventListener(\"arrowDownKeyDown\", this._keyNextListener);\n this.el.removeEventListener(\"homeKeyDown\", this._keyHomeListener);\n this.el.removeEventListener(\"endKeyDown\", this._keyEndListener);\n this.el.removeEventListener(\"click\", this._clickListener);\n this.el.removeEventListener(\"focusExit\", this._focusExitListener);\n this._observer.disconnect();\n }\n}\nfunction createLinear(el, itemSelector, selectedOptions) {\n const model = new LinearNavigationModel(el, itemSelector, selectedOptions);\n return new NavigationEmitter(el, model);\n}\n\n/*\nstatic createGrid(el, rowSelector, colSelector, selectedOptions) {\n return null;\n}\n*/\n","require('./../dist/tokens/evo-core.css');\n","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.add = add;\nexports.remove = remove;\nfunction onKeyDown(e) {\n if (e.keyCode >= 32 && e.keyCode <= 40) {\n e.preventDefault();\n }\n}\nfunction add(el) {\n el.addEventListener(\"keydown\", onKeyDown);\n}\nfunction remove(el) {\n el.removeEventListener(\"keydown\", onKeyDown);\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\"use strict\";\n\nrequire(\"../../docs.css\");\nrequire(\"@ebay/skin/tokens\");\nrequire(\"@ebay/skin/global\");\nrequire(\"@ebay/skin/combobox\");\nvar _makeupCombobox = _interopRequireDefault(require(\"makeup-combobox\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\n// REQUIRE\n// const Combobox = require('makeup-combobox').default;\n\n// IMPORT\n\nwindow.onload = function () {\n document.querySelectorAll(\".combobox\").forEach(function (el, i) {\n const widget = new _makeupCombobox.default(el, {\n autoSelect: el.dataset.makeupAutoSelect === \"false\" ? false : true\n });\n el.addEventListener(\"makeup-combobox-change\", function (e) {\n console.log(e.type, e.detail);\n });\n el.addEventListener(\"makeup-combobox-mutation\", function (e) {\n console.log(e.type, e.detail);\n });\n });\n};"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/docs/ui/makeup-listbox-button/index.min.js b/docs/ui/makeup-listbox-button/index.min.js index 6a0aed49..e980dbc5 100644 --- a/docs/ui/makeup-listbox-button/index.min.js +++ b/docs/ui/makeup-listbox-button/index.min.js @@ -795,7 +795,8 @@ const defaultOptions = { expandOnHover: false, focusManagement: null, hostSelector: ".expander__host", - simulateSpacebarClick: false + simulateSpacebarClick: false, + useAriaExpanded: true }; function onHostKeyDown(e) { if (e.keyCode === 13 || e.keyCode === 32) { @@ -895,8 +896,14 @@ class _default { this._hostHoverListener = onHostHover.bind(this); this._focusExitListener = onFocusExit.bind(this); this._mouseLeaveListener = onMouseLeave.bind(this); - if (this.hostEl.getAttribute("aria-expanded") === null) { - this.hostEl.setAttribute("aria-expanded", "false"); + if (this.options.useAriaExpanded === true) { + const initialAriaExpanded = this.hostEl.getAttribute("aria-expanded"); + this._expanded = initialAriaExpanded === "true"; + if (initialAriaExpanded === null) { + this.hostEl.setAttribute("aria-expanded", "false"); + } + } else { + this._expanded = false; } if (this.options.ariaControls === true) { // ensure the widget has an id @@ -989,11 +996,13 @@ class _default { } } get expanded() { - return this.hostEl.getAttribute("aria-expanded") === "true"; + return this._expanded; } set expanded(bool) { if (bool === true && this.expanded === false) { - this.hostEl.setAttribute("aria-expanded", "true"); + if (this.options.useAriaExpanded === true) { + this.hostEl.setAttribute("aria-expanded", "true"); + } if (this.options.expandedClass) { this.el.classList.add(this.options.expandedClass); } @@ -1006,7 +1015,9 @@ class _default { })); } if (bool === false && this.expanded === true) { - this.hostEl.setAttribute("aria-expanded", "false"); + if (this.options.useAriaExpanded === true) { + this.hostEl.setAttribute("aria-expanded", "false"); + } if (this.options.expandedClass) { this.el.classList.remove(this.options.expandedClass); } @@ -1015,6 +1026,7 @@ class _default { detail: this.contentEl })); } + this._expanded = bool; this._expandWasKeyboardClickActivated = false; this._expandWasMouseClickActivated = false; this._expandWasFocusActivated = false; diff --git a/docs/ui/makeup-listbox-button/index.min.js.map b/docs/ui/makeup-listbox-button/index.min.js.map index a88164e8..c4f16dba 100644 --- a/docs/ui/makeup-listbox-button/index.min.js.map +++ b/docs/ui/makeup-listbox-button/index.min.js.map @@ -1 +1 @@ -{"version":3,"file":"makeup-listbox-button/index.min.js","mappings":";;;;;;AAAA,mBAAO,CAAC,IAA0B;;;;;;;;;ACArB;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,oBAAoB;AACpB,uBAAuB;AACvB,2CAA2C,mBAAO,CAAC,IAAgB;AACnE,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC3EA;;;;;;;;;;ACAA;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf,+CAA+C,mBAAO,CAAC,IAA0B;AACjF,gDAAgD,mBAAO,CAAC,IAA4B;AACpF,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;;;;;;;;ACvNa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,oBAAoB;AACpB,gDAAgD,mBAAO,CAAC,IAA2B;AACnF,2CAA2C,mBAAO,CAAC,IAAgB;AACnE,qCAAqC,iCAAiC;AACtE,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;ACxKA;;;;;;;;ACAA,mBAAO,CAAC,IAAgC;;;;;;;;;ACA3B;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,OAAO,EAAE,UAAU,EAAE,cAAc;;AAEpD;AACA;AACA;AACA,6BAA6B,IAAI,GAAG,mBAAmB;AACvD;AACA;AACA;;;;;;;;;;ACvCA;;;;;;;;ACAA,mBAAO,CAAC,IAAsB;AAC9B,mBAAO,CAAC,IAAuB;;;;;;;;ACD/B,mBAAO,CAAC,IAA0B;;;;;;;;ACAlC,mBAAO,CAAC,IAA0C;;;;;;;;;;ACAlD;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;ACnCa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,WAAW;AACX,kBAAkB;AAClB,gBAAgB;AAChB,cAAc;AACd,qBAAqB;AACrB,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,IAAI,KAAK,aAAa;AAC1F;AACA;AACA,SAAS;AACT;AACA;AACA,uDAAuD,aAAa;AACpE;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACrEA;;;;;;;;ACAA,mBAAO,CAAC,IAA4B;;;;;;;;;ACAvB;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf,2CAA2C,mBAAO,CAAC,IAAgB;AACnE,0CAA0C,mBAAO,CAAC,GAAqB;AACvE,+CAA+C,mBAAO,CAAC,IAAmB;AAC1E,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ,2CAA2C,gBAAgB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,WAAW;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;;;;;;;;;AC1RF;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,oBAAoB;AACpB,yCAAyC,mBAAO,CAAC,IAAoB;AACrE,0CAA0C,mBAAO,CAAC,GAAqB;AACvE,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,QAAQ;AACrB,aAAa,uBAAuB;AACpC;AACA;AACA,iBAAiB,uBAAuB;AACxC,mCAAmC;;AAEnC,iBAAiB,aAAa;AAC9B;;AAEA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,QAAQ;AACrB,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,4CAA4C,mBAAmB;AAC/D;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;ACjXA,mBAAO,CAAC,IAA+B;;;;;;;;;ACA1B;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf,6CAA6C,mBAAO,CAAC,IAAiB;AACtE,4CAA4C,mBAAO,CAAC,IAAgB;AACpE,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,2CAA2C,mBAAmB,EAAE,QAAQ;AACxE;AACA;AACA;AACA,wBAAwB,gBAAgB,QAAQ,WAAW;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,oBAAoB,EAAE,aAAa;AACzG;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;;;;;;;;;ACjMA;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,WAAW;AACX,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;UCjBA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;;;;ACNa;;AAEb,mBAAO,CAAC,IAAgB;AACxB,mBAAO,CAAC,IAAmB;AAC3B,mBAAO,CAAC,IAAmB;AAC3B,mBAAO,CAAC,IAAoB;AAC5B,mBAAO,CAAC,GAAmB;AAC3B,mBAAO,CAAC,IAA2B;AACnC,kDAAkD,mBAAO,CAAC,IAAuB;AACjF,qCAAqC,iCAAiC;AACtE;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH,E","sources":["webpack://root/./node_modules/@ebay/skin/button.js","webpack://root/./packages/core/makeup-exit-emitter/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/dist/global/global.css?e001","webpack://root/./node_modules/@ebay/skin/dist/tokens/evo-light.css?9c33","webpack://root/./packages/ui/makeup-listbox/dist/cjs/index.js","webpack://root/./packages/core/makeup-active-descendant/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/dist/listbox-button/listbox-button.css?ea08","webpack://root/./node_modules/@ebay/skin/tokens/evo-light.js","webpack://root/./packages/core/makeup-next-id/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/dist/utility/utility.css?6c3b","webpack://root/./node_modules/@ebay/skin/tokens.js","webpack://root/./node_modules/@ebay/skin/global.js","webpack://root/./node_modules/@ebay/skin/listbox-button.js","webpack://root/./docs/docs.css?378e","webpack://root/./packages/core/makeup-focusables/dist/cjs/index.js","webpack://root/./packages/core/makeup-key-emitter/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/dist/button/button.css?9a44","webpack://root/./node_modules/@ebay/skin/utility.js","webpack://root/./packages/core/makeup-expander/dist/cjs/index.js","webpack://root/./packages/core/makeup-navigation-emitter/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/tokens/evo-core.js","webpack://root/./packages/ui/makeup-listbox-button/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/dist/tokens/evo-core.css?7a96","webpack://root/./packages/core/makeup-prevent-scroll-keys/dist/cjs/index.js","webpack://root/webpack/bootstrap","webpack://root/webpack/runtime/make namespace object","webpack://root/./docs/ui/makeup-listbox-button/index.compiled.js"],"sourcesContent":["require('./dist/button/button.css');\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.addFocusExit = addFocusExit;\nexports.removeFocusExit = removeFocusExit;\nvar _makeupNextId = _interopRequireDefault(require(\"makeup-next-id\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst focusExitEmitters = {};\nfunction doFocusExit(el, fromElement, toElement) {\n el.dispatchEvent(new CustomEvent(\"focusExit\", {\n detail: {\n fromElement,\n toElement\n },\n bubbles: false // mirror the native mouseleave event\n }));\n}\nfunction onDocumentFocusIn(e) {\n const newFocusElement = e.target;\n const targetIsDescendant = this.el.contains(newFocusElement);\n\n // if focus has moved to a focusable descendant\n if (targetIsDescendant === true) {\n // set the target as the currently focussed element\n this.currentFocusElement = newFocusElement;\n } else {\n // else focus has not gone to a focusable descendant\n window.removeEventListener(\"blur\", this.onWindowBlurListener);\n document.removeEventListener(\"focusin\", this.onDocumentFocusInListener);\n doFocusExit(this.el, this.currentFocusElement, newFocusElement);\n this.currentFocusElement = null;\n }\n}\nfunction onWindowBlur() {\n doFocusExit(this.el, this.currentFocusElement, undefined);\n}\nfunction onWidgetFocusIn() {\n // listen for focus moving to anywhere in document\n // note that mouse click on buttons, checkboxes and radios does not trigger focus events in all browsers!\n document.addEventListener(\"focusin\", this.onDocumentFocusInListener);\n // listen for focus leaving the window\n window.addEventListener(\"blur\", this.onWindowBlurListener);\n}\nclass FocusExitEmitter {\n constructor(el) {\n this.el = el;\n this.currentFocusElement = null;\n this.onWidgetFocusInListener = onWidgetFocusIn.bind(this);\n this.onDocumentFocusInListener = onDocumentFocusIn.bind(this);\n this.onWindowBlurListener = onWindowBlur.bind(this);\n this.el.addEventListener(\"focusin\", this.onWidgetFocusInListener);\n }\n removeEventListeners() {\n window.removeEventListener(\"blur\", this.onWindowBlurListener);\n document.removeEventListener(\"focusin\", this.onDocumentFocusInListener);\n this.el.removeEventListener(\"focusin\", this.onWidgetFocusInListener);\n }\n}\nfunction addFocusExit(el) {\n let exitEmitter = null;\n (0, _makeupNextId.default)(el);\n if (!focusExitEmitters[el.id]) {\n exitEmitter = new FocusExitEmitter(el);\n focusExitEmitters[el.id] = exitEmitter;\n }\n return exitEmitter;\n}\nfunction removeFocusExit(el) {\n const exitEmitter = focusExitEmitters[el.id];\n if (exitEmitter) {\n exitEmitter.removeEventListeners();\n delete focusExitEmitters[el.id];\n }\n}\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar ActiveDescendant = _interopRequireWildcard(require(\"makeup-active-descendant\"));\nvar PreventScrollKeys = _interopRequireWildcard(require(\"makeup-prevent-scroll-keys\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\n/**\n * A listbox can be a standalone focusable widget, or controlled by a separate, focusable widget\n * (a textbox for example, in the case of a combobox or datepicker)\n *\n * This listbox code currently supports single-selct only!\n * This code has been copied from Skin & MIND Patterns and has not yet been cleaned up.\n */\n\nconst defaultOptions = {\n activeDescendantClassName: \"listbox__option--active\",\n // the classname applied to the current active desdcendant\n autoInit: \"none\",\n autoReset: null,\n autoSelect: true,\n // when true, aria-checked state matches active-descendant\n autoScroll: true,\n // when true, the listbox will scroll to keep the activeDescendant in view\n customElementMode: false,\n focusableElement: null,\n // used in a combobox/datepicker scenario\n listboxOwnerElement: null,\n // used in a combobox/datepicker scenario\n multiSelect: false,\n // todo\n useAriaChecked: true,\n // doubles up on support for aria-selected to announce visible selected/checked state\n valueSelector: \".listbox__value\" // Selector to get value from\n};\nclass _default {\n constructor(widgetEl, selectedOptions) {\n this._options = Object.assign({}, defaultOptions, selectedOptions);\n this.el = widgetEl;\n\n // in cases such as combobox, the active-descendant logic is controlled by a parent widget\n this._activeDescendantRootEl = this._options.listboxOwnerElement || this.el;\n\n // todo: not sure this check is needed any more\n if (widgetEl.getAttribute(\"role\") === \"listbox\") {\n this._listboxEl = widgetEl;\n } else {\n this._listboxEl = this.el.querySelector(\"[role=listbox]\");\n }\n if (!this._options.focusableElement && this._listboxEl.getAttribute(\"tabindex\") === null) {\n this._listboxEl.setAttribute(\"tabindex\", \"0\");\n }\n PreventScrollKeys.add(this.el);\n this._onKeyDownListener = _onKeyDown.bind(this);\n this._onClickListener = _onClick.bind(this);\n this._onFirstMouseDownListener = _onFirstMouseDown.bind(this);\n this._onFirstFocusListener = _onFirstFocus.bind(this);\n this._onActiveDescendantChangeListener = _onActiveDescendantChange.bind(this);\n this._onMutationListener = _onMutation.bind(this);\n this.el.classList.add(\"listbox--js\");\n if (!this._options.customElementMode) {\n this._mutationObserver = new MutationObserver(this._onMutationListener);\n this._observeMutations();\n this._observeEvents();\n }\n this._activeDescendant = ActiveDescendant.createLinear(this._activeDescendantRootEl, this._options.focusableElement || this._listboxEl, this._listboxEl.parentElement, \"[role=option]\", {\n activeDescendantClassName: this._options.activeDescendantClassName,\n autoInit: this._options.autoInit,\n autoReset: this._options.autoReset,\n autoScroll: this._options.autoScroll,\n axis: \"y\"\n });\n }\n _observeMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.observe(this._listboxEl, {\n attributeFilter: [\"aria-selected\"],\n attributes: true,\n childList: true,\n subtree: true\n });\n }\n }\n _unobserveMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.disconnect();\n }\n }\n _observeEvents() {\n if (this._destroyed !== true) {\n this._activeDescendantRootEl.addEventListener(\"activeDescendantChange\", this._onActiveDescendantChangeListener);\n this._listboxEl.addEventListener(\"mousedown\", this._onFirstMouseDownListener, {\n once: true\n });\n this._listboxEl.addEventListener(\"focus\", this._onFirstFocusListener, {\n once: true\n });\n this._listboxEl.addEventListener(\"keydown\", this._onKeyDownListener);\n this._listboxEl.addEventListener(\"click\", this._onClickListener);\n }\n }\n _unobserveEvents() {\n this._listboxEl.removeEventListener(\"keydown\", this._onKeyDownListener);\n this._listboxEl.removeEventListener(\"click\", this._onClickListener);\n this._listboxEl.removeEventListener(\"focus\", this._onFirstFocusListener);\n this._listboxEl.removeEventListener(\"mousedown\", this._onFirstMouseDownListener);\n this._activeDescendantRootEl.removeEventListener(\"activeDescendantChange\", this._onActiveDescendantChangeListener);\n }\n get index() {\n return this.items.findIndex(el => el.getAttribute(\"aria-selected\") === \"true\");\n }\n get items() {\n return this._activeDescendant.items;\n }\n select(index) {\n this._unobserveMutations();\n if (this.index !== index) {\n this.unselect(this.index);\n const itemEl = this._activeDescendant.items[index];\n if (itemEl && itemEl.getAttribute(\"aria-disabled\") !== \"true\") {\n const matchingItem = this.items[index];\n let optionValue;\n matchingItem.setAttribute(\"aria-selected\", \"true\");\n if (this._options.useAriaChecked === true) {\n matchingItem.setAttribute(\"aria-checked\", \"true\");\n }\n optionValue = matchingItem.innerText;\n\n // Check if value selector is present and use that to get innerText instead\n // If its not present, will default to innerText of the whole item\n if (this._options.valueSelector) {\n const valueSelector = matchingItem.querySelector(this._options.valueSelector);\n if (valueSelector) {\n optionValue = valueSelector.innerText;\n }\n }\n this.el.dispatchEvent(new CustomEvent(\"makeup-listbox-change\", {\n detail: {\n el: matchingItem,\n optionIndex: index,\n optionValue\n }\n }));\n }\n }\n this._observeMutations();\n }\n unselect(index) {\n this._unobserveMutations();\n const itemEl = this.items[index];\n if (itemEl && itemEl.getAttribute(\"aria-disabled\") !== \"true\") {\n const matchingItem = this.items[index];\n matchingItem.setAttribute(\"aria-selected\", \"false\");\n if (this._options.useAriaChecked === true) {\n matchingItem.setAttribute(\"aria-checked\", \"false\");\n }\n }\n this._observeMutations();\n }\n destroy() {\n this._destroyed = true;\n this._unobserveMutations();\n this._unobserveEvents();\n this._onKeyDownListener = null;\n this._onClickListener = null;\n this._onFirstMouseDownListener = null;\n this._onFirstFocusListener = null;\n this._onActiveDescendantChangeListener = null;\n this._onMutationListener = null;\n }\n}\nexports.default = _default;\nfunction _onFirstMouseDown() {\n this._isMouseDown = true;\n}\n\n// set activeDescendant on first keyboard focus\nfunction _onFirstFocus() {\n if (!this._isMouseDown) {\n this._activeDescendant.index = this.index === -1 ? 0 : this.index;\n }\n this._isMouseDown = false;\n}\nfunction _onClick(e) {\n const toEl = e.target.closest(\"[role=option]\");\n if (toEl) {\n this.select(this.items.indexOf(toEl));\n }\n}\nfunction _onKeyDown(e) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this.select(this._activeDescendant.index);\n }\n}\nfunction _onActiveDescendantChange(e) {\n const {\n toIndex\n } = e.detail;\n const toEl = this.items[toIndex];\n if (this._options.autoSelect === true && toEl) {\n this.select(toIndex);\n }\n}\nfunction _onMutation(mutationsList) {\n for (const mutation of mutationsList) {\n if (mutation.type === \"attributes\") {\n this.el.dispatchEvent(new CustomEvent(\"makeup-listbox-mutation\", {\n detail: {\n attributeName: mutation.attributeName\n }\n }));\n }\n }\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createLinear = createLinear;\nvar NavigationEmitter = _interopRequireWildcard(require(\"makeup-navigation-emitter\"));\nvar _makeupNextId = _interopRequireDefault(require(\"makeup-next-id\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nconst defaultOptions = {\n activeDescendantClassName: \"active-descendant\",\n autoInit: \"none\",\n autoReset: \"none\",\n autoScroll: false,\n axis: \"both\",\n wrap: false\n};\nfunction onModelInit(e) {\n const {\n items,\n toIndex\n } = e.detail;\n const itemEl = items[toIndex];\n if (itemEl) {\n itemEl.classList.add(this._options.activeDescendantClassName);\n this._focusEl.setAttribute(\"aria-activedescendant\", itemEl.id);\n }\n this._el.dispatchEvent(new CustomEvent(\"activeDescendantInit\", {\n detail: e.detail\n }));\n}\nfunction onModelChange(e) {\n const {\n fromIndex,\n toIndex\n } = e.detail;\n const fromItem = this.items[fromIndex];\n const toItem = this.items[toIndex];\n if (fromItem) {\n fromItem.classList.remove(this._options.activeDescendantClassName);\n }\n if (toItem) {\n toItem.classList.add(this._options.activeDescendantClassName);\n this._focusEl.setAttribute(\"aria-activedescendant\", toItem.id);\n if (this._options.autoScroll && this._itemContainerEl) {\n this._itemContainerEl.scrollTop = toItem.offsetTop - this._itemContainerEl.offsetHeight / 2;\n }\n }\n this._el.dispatchEvent(new CustomEvent(\"activeDescendantChange\", {\n detail: e.detail\n }));\n}\nfunction onModelReset(e) {\n const toIndex = e.detail.toIndex;\n const activeClassName = this._options.activeDescendantClassName;\n this.items.forEach(function (el) {\n el.classList.remove(activeClassName);\n });\n if (toIndex !== null && toIndex !== -1) {\n const itemEl = this.items[toIndex];\n itemEl.classList.add(activeClassName);\n this._focusEl.setAttribute(\"aria-activedescendant\", itemEl.id);\n } else {\n this._focusEl.removeAttribute(\"aria-activedescendant\");\n }\n this._el.dispatchEvent(new CustomEvent(\"activeDescendantReset\", {\n detail: e.detail\n }));\n}\nfunction onModelMutation(e) {\n const {\n toIndex\n } = e.detail;\n const activeDescendantClassName = this._options.activeDescendantClassName;\n this.items.forEach(function (item, index) {\n (0, _makeupNextId.default)(item);\n if (index !== toIndex) {\n item.classList.remove(activeDescendantClassName);\n } else {\n item.classList.add(activeDescendantClassName);\n }\n });\n this._el.dispatchEvent(new CustomEvent(\"activeDescendantMutation\", {\n detail: e.detail\n }));\n}\nclass ActiveDescendant {\n constructor(el) {\n this._el = el;\n this._onMutationListener = onModelMutation.bind(this);\n this._onChangeListener = onModelChange.bind(this);\n this._onResetListener = onModelReset.bind(this);\n this._onInitListener = onModelInit.bind(this);\n this._el.addEventListener(\"navigationModelMutation\", this._onMutationListener);\n this._el.addEventListener(\"navigationModelChange\", this._onChangeListener);\n this._el.addEventListener(\"navigationModelReset\", this._onResetListener);\n this._el.addEventListener(\"navigationModelInit\", this._onInitListener);\n }\n destroy() {\n this._el.removeEventListener(\"navigationModelMutation\", this._onMutationListener);\n this._el.removeEventListener(\"navigationModelChange\", this._onChangeListener);\n this._el.removeEventListener(\"navigationModelReset\", this._onResetListener);\n this._el.removeEventListener(\"navigationModelInit\", this._onInitListener);\n }\n}\nclass LinearActiveDescendant extends ActiveDescendant {\n constructor(el, focusEl, itemContainerEl, itemSelector, selectedOptions) {\n super(el);\n this._options = Object.assign({}, defaultOptions, selectedOptions);\n this._focusEl = focusEl;\n this._itemContainerEl = itemContainerEl;\n this._itemSelector = itemSelector;\n\n // ensure container has an id\n (0, _makeupNextId.default)(this._itemContainerEl);\n\n // if programmatic relationship set aria-owns\n if (this._itemContainerEl !== this._focusEl) {\n focusEl.setAttribute(\"aria-owns\", this._itemContainerEl.id);\n }\n this._navigationEmitter = NavigationEmitter.createLinear(el, itemSelector, {\n autoInit: this._options.autoInit,\n autoReset: this._options.autoReset,\n axis: this._options.axis,\n ignoreByDelegateSelector: this._options.ignoreByDelegateSelector,\n wrap: this._options.wrap\n });\n\n // ensure each item has an id\n this.items.forEach(function (itemEl) {\n (0, _makeupNextId.default)(itemEl);\n });\n }\n get index() {\n return this._navigationEmitter.model.index;\n }\n set index(newIndex) {\n this._navigationEmitter.model.index = newIndex;\n }\n reset() {\n this._navigationEmitter.model.reset();\n }\n get currentItem() {\n return this._navigationEmitter.model.currentItem;\n }\n get items() {\n return this._navigationEmitter.model.items;\n }\n set wrap(newWrap) {\n this._navigationEmitter.model.options.wrap = newWrap;\n }\n destroy() {\n super.destroy();\n this._navigationEmitter.destroy();\n }\n}\n\n/*\nclass GridActiveDescendant extends ActiveDescendant {\n constructor(el, focusEl, containerEl, rowSelector, cellSelector) {\n super(el);\n }\n}\n*/\n\nfunction createLinear(el, focusEl, itemContainerEl, itemSelector, selectedOptions) {\n return new LinearActiveDescendant(el, focusEl, itemContainerEl, itemSelector, selectedOptions);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","require('./../dist/tokens/evo-light.css');\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nconst sequenceMap = {};\nconst defaultPrefix = \"nid\";\nconst randomPortion = createRandomPortion(3);\nfunction randomNumber(max) {\n return Math.floor(Math.random() * max);\n}\nfunction createRandomPortion(size) {\n const letters = \"abcdefghijklmnopqrstuvwxyz\";\n const digits = \"0123456789\";\n const allChars = letters + digits;\n\n // to ensure a valid HTML ID (when prefix is empty), first character must be a letter\n let portion = letters[randomNumber(25)];\n\n // start iterating from 1, as we already have our first char\n for (let i = 1; i < size; i++) {\n portion += allChars[randomNumber(35)];\n }\n return portion;\n}\nfunction _default(el) {\n let prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultPrefix;\n const separator = prefix === \"\" ? \"\" : \"-\";\n\n // join first prefix with random portion to create key\n const key = `${prefix}${separator}${randomPortion}`;\n\n // initialise key in sequence map if necessary\n sequenceMap[key] = sequenceMap[key] || 0;\n if (!el.id) {\n el.setAttribute(\"id\", `${key}-${sequenceMap[key]++}`);\n }\n return el.id;\n}\n","// extracted by mini-css-extract-plugin\nexport {};","require('./tokens/evo-core.js');\nrequire('./tokens/evo-light.js');\n","require('./dist/global/global.css');\n","require('./dist/listbox-button/listbox-button.css');\n","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nconst focusableElList = [\"a[href]\", \"area[href]\", \"button:not([disabled])\", \"embed\", \"iframe\", \"input:not([disabled])\", \"object\", \"select:not([disabled])\", \"textarea:not([disabled])\", \"*[tabindex]\", \"*[contenteditable]\"];\nconst focusableElSelector = focusableElList.join();\nfunction _default(el) {\n let keyboardOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let callback = arguments.length > 2 ? arguments[2] : undefined;\n if (callback) {\n const request = requestAnimationFrame(() => {\n callback(getFocusables(el, keyboardOnly));\n });\n return () => {\n cancelAnimationFrame(request);\n };\n }\n return getFocusables(el, keyboardOnly);\n}\nfunction getFocusables(el) {\n let keyboardOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let focusableEls = Array.prototype.slice.call(el.querySelectorAll(focusableElSelector));\n\n // filter out elements with display: none or nested in a display: none parent\n focusableEls = focusableEls.filter(function (focusableEl) {\n return !!(focusableEl.offsetWidth || focusableEl.offsetHeight || focusableEl.getClientRects().length);\n });\n if (keyboardOnly === true) {\n focusableEls = focusableEls.filter(function (focusableEl) {\n return focusableEl.getAttribute(\"tabindex\") !== \"-1\";\n });\n }\n return focusableEls;\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.add = add;\nexports.addKeyDown = addKeyDown;\nexports.addKeyUp = addKeyUp;\nexports.remove = remove;\nexports.removeKeyDown = removeKeyDown;\nexports.removeKeyUp = removeKeyUp;\nfunction uncapitalizeFirstLetter(str) {\n return str.charAt(0).toLowerCase() + str.slice(1);\n}\nfunction onKeyDownOrUp(evt, el, keyEventType) {\n if (!evt.shiftKey) {\n const key = evt.key;\n switch (key) {\n case \"Enter\":\n case \"Escape\":\n case \"PageUp\":\n case \"PageDown\":\n case \"End\":\n case \"Home\":\n case \"ArrowLeft\":\n case \"ArrowUp\":\n case \"ArrowRight\":\n case \"ArrowDown\":\n el.dispatchEvent(new CustomEvent(uncapitalizeFirstLetter(`${key}Key${keyEventType}`), {\n detail: evt,\n bubbles: true\n }));\n break;\n case \" \":\n el.dispatchEvent(new CustomEvent(`spacebarKey${keyEventType}`, {\n detail: evt,\n bubbles: true\n }));\n break;\n default:\n return;\n }\n }\n}\nfunction onKeyDown(e) {\n onKeyDownOrUp(e, this, \"Down\");\n}\nfunction onKeyUp(e) {\n onKeyDownOrUp(e, this, \"Up\");\n}\nfunction addKeyDown(el) {\n el.addEventListener(\"keydown\", onKeyDown);\n}\nfunction addKeyUp(el) {\n el.addEventListener(\"keyup\", onKeyUp);\n}\nfunction removeKeyDown(el) {\n el.removeEventListener(\"keydown\", onKeyDown);\n}\nfunction removeKeyUp(el) {\n el.removeEventListener(\"keyup\", onKeyUp);\n}\nfunction add(el) {\n addKeyDown(el);\n addKeyUp(el);\n}\nfunction remove(el) {\n removeKeyDown(el);\n removeKeyUp(el);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","require('./dist/utility/utility.css');\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _makeupNextId = _interopRequireDefault(require(\"makeup-next-id\"));\nvar ExitEmitter = _interopRequireWildcard(require(\"makeup-exit-emitter\"));\nvar _makeupFocusables = _interopRequireDefault(require(\"makeup-focusables\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst defaultOptions = {\n alwaysDoFocusManagement: false,\n ariaControls: true,\n autoCollapse: false,\n collapseOnFocusOut: false,\n collapseOnMouseOut: false,\n collapseOnClickOut: false,\n collapseOnHostReFocus: false,\n contentSelector: \".expander__content\",\n expandedClass: null,\n expandOnClick: false,\n expandOnFocus: false,\n expandOnHover: false,\n focusManagement: null,\n hostSelector: \".expander__host\",\n simulateSpacebarClick: false\n};\nfunction onHostKeyDown(e) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this._keyboardClickFlag = true;\n }\n // if host element does not naturally trigger a click event on spacebar, we can force one to trigger here.\n // careful! if host already triggers click events naturally, we end up with a \"double-click\".\n if (e.keyCode === 32 && this.options.simulateSpacebarClick === true) {\n this.hostEl.click();\n }\n}\nfunction onHostMouseDown() {\n this._mouseClickFlag = true;\n}\nfunction onHostClick() {\n this._expandWasKeyboardClickActivated = this._keyboardClickFlag;\n this._expandWasMouseClickActivated = this._mouseClickFlag;\n this._widgetHasKeyboardFocus = this._keyboardClickFlag;\n this.expanded = !this.expanded;\n}\nfunction onHostFocus() {\n this._expandWasFocusActivated = true;\n this.expanded = true;\n}\n\n// NOTE: collapseOnHostReFocus cannot be used when expandOnFocus is true\nfunction onHostReFocus() {\n if (this.expanded && this._widgetHasKeyboardFocus) {\n this.expanded = false;\n }\n}\nfunction onHostHover() {\n clearTimeout(this._mouseLeft);\n this._expandWasHoverActivated = true;\n this.expanded = true;\n}\nfunction onFocusExit() {\n this._widgetHasKeyboardFocus = false;\n this.expanded = false;\n}\nfunction onMouseLeave() {\n clearTimeout(this._mouseLeft);\n this._mouseLeft = setTimeout(() => {\n this.expanded = false;\n }, 300);\n}\nfunction _onDocumentClick(e) {\n if (this.el.contains(e.target) === false) {\n this.expanded = false;\n }\n}\nfunction _onDocumentTouchStart() {\n this.documentClick = true;\n}\nfunction _onDocumentTouchMove() {\n this.documentClick = false;\n}\nfunction _onDocumentTouchEnd(e) {\n if (this.documentClick === true) {\n this.documentClick = false;\n if (this.el.contains(e.target) === false) {\n this.expanded = false;\n }\n }\n}\nfunction manageFocus(focusManagement, contentEl) {\n if (focusManagement === \"content\") {\n contentEl.setAttribute(\"tabindex\", \"-1\");\n contentEl.focus();\n } else if (focusManagement === \"focusable\") {\n (0, _makeupFocusables.default)(contentEl)[0]?.focus();\n } else if (focusManagement === \"interactive\") {\n (0, _makeupFocusables.default)(contentEl, true)[0]?.focus();\n } else if (focusManagement !== null) {\n const el = contentEl.querySelector(`#${focusManagement}`);\n if (el) {\n el.focus();\n }\n }\n}\nclass _default {\n constructor(el, selectedOptions) {\n this.options = Object.assign({}, defaultOptions, selectedOptions);\n this.el = el;\n this.hostEl = el.querySelector(this.options.hostSelector); // the keyboard focusable host el\n this.contentEl = el.querySelector(this.options.contentSelector);\n ExitEmitter.addFocusExit(this.el);\n this._hostKeyDownListener = onHostKeyDown.bind(this);\n this._hostMouseDownListener = onHostMouseDown.bind(this);\n this._documentClickListener = _onDocumentClick.bind(this);\n this._documentTouchStartListener = _onDocumentTouchStart.bind(this);\n this._documentTouchMoveListener = _onDocumentTouchMove.bind(this);\n this._documentTouchEndListener = _onDocumentTouchEnd.bind(this);\n this._hostClickListener = onHostClick.bind(this);\n this._hostFocusListener = onHostFocus.bind(this);\n this._hostReFocusListener = onHostReFocus.bind(this);\n this._hostHoverListener = onHostHover.bind(this);\n this._focusExitListener = onFocusExit.bind(this);\n this._mouseLeaveListener = onMouseLeave.bind(this);\n if (this.hostEl.getAttribute(\"aria-expanded\") === null) {\n this.hostEl.setAttribute(\"aria-expanded\", \"false\");\n }\n if (this.options.ariaControls === true) {\n // ensure the widget has an id\n (0, _makeupNextId.default)(this.el, \"expander\");\n this.contentEl.id = this.contentEl.id || `${this.el.id}-content`;\n this.hostEl.setAttribute(\"aria-controls\", this.contentEl.id);\n }\n this.expandOnClick = this.options.expandOnClick;\n this.expandOnFocus = this.options.expandOnFocus;\n this.expandOnHover = this.options.expandOnHover;\n this.collapseOnHostReFocus = this.options.collapseOnHostReFocus;\n if (this.options.autoCollapse === false) {\n this.collapseOnClickOut = this.options.collapseOnClickOut;\n this.collapseOnFocusOut = this.options.collapseOnFocusOut;\n this.collapseOnMouseOut = this.options.collapseOnMouseOut;\n }\n }\n set expandOnClick(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"keydown\", this._hostKeyDownListener);\n this.hostEl.addEventListener(\"mousedown\", this._hostMouseDownListener);\n this.hostEl.addEventListener(\"click\", this._hostClickListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnClickOut = true;\n this.collapseOnFocusOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"click\", this._hostClickListener);\n this.hostEl.removeEventListener(\"mousedown\", this._hostMouseDownListener);\n this.hostEl.removeEventListener(\"keydown\", this._hostKeyDownListener);\n }\n }\n set expandOnFocus(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"focus\", this._hostFocusListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnClickOut = true;\n this.collapseOnFocusOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"focus\", this._hostFocusListener);\n }\n }\n set collapseOnHostReFocus(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"focus\", this._hostReFocusListener);\n } else {\n this.hostEl.removeEventListener(\"focus\", this._hostReFocusListener);\n }\n }\n set expandOnHover(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"mouseenter\", this._hostHoverListener);\n this.contentEl.addEventListener(\"mouseenter\", this._hostHoverListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnMouseOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"mouseenter\", this._hostHoverListener);\n this.contentEl.removeEventListener(\"mouseenter\", this._hostHoverListener);\n }\n }\n set collapseOnClickOut(bool) {\n if (bool === true) {\n document.addEventListener(\"click\", this._documentClickListener);\n document.addEventListener(\"touchstart\", this._documentTouchStartListener);\n document.addEventListener(\"touchmove\", this._documentTouchMoveListener);\n document.addEventListener(\"touchend\", this._documentTouchEndListener);\n } else {\n document.removeEventListener(\"click\", this._documentClickListener);\n document.removeEventListener(\"touchstart\", this._documentTouchStartListener);\n document.removeEventListener(\"touchmove\", this._documentTouchMoveListener);\n document.removeEventListener(\"touchend\", this._documentTouchEndListener);\n }\n }\n set collapseOnFocusOut(bool) {\n if (bool === true) {\n this.el.addEventListener(\"focusExit\", this._focusExitListener);\n } else {\n this.el.removeEventListener(\"focusExit\", this._focusExitListener);\n }\n }\n set collapseOnMouseOut(bool) {\n if (bool === true) {\n this.el.addEventListener(\"mouseleave\", this._mouseLeaveListener);\n this.contentEl.addEventListener(\"mouseleave\", this._mouseLeaveListener);\n } else {\n this.el.removeEventListener(\"mouseleave\", this._mouseLeaveListener);\n this.contentEl.removeEventListener(\"mouseleave\", this._mouseLeaveListener);\n }\n }\n get expanded() {\n return this.hostEl.getAttribute(\"aria-expanded\") === \"true\";\n }\n set expanded(bool) {\n if (bool === true && this.expanded === false) {\n this.hostEl.setAttribute(\"aria-expanded\", \"true\");\n if (this.options.expandedClass) {\n this.el.classList.add(this.options.expandedClass);\n }\n if (this._expandWasKeyboardClickActivated || this._expandWasMouseClickActivated && this.options.alwaysDoFocusManagement) {\n manageFocus(this.options.focusManagement, this.contentEl);\n }\n this.el.dispatchEvent(new CustomEvent(\"expander-expand\", {\n bubbles: true,\n detail: this.contentEl\n }));\n }\n if (bool === false && this.expanded === true) {\n this.hostEl.setAttribute(\"aria-expanded\", \"false\");\n if (this.options.expandedClass) {\n this.el.classList.remove(this.options.expandedClass);\n }\n this.el.dispatchEvent(new CustomEvent(\"expander-collapse\", {\n bubbles: true,\n detail: this.contentEl\n }));\n }\n this._expandWasKeyboardClickActivated = false;\n this._expandWasMouseClickActivated = false;\n this._expandWasFocusActivated = false;\n this._expandWasHoverActivated = false;\n this._keyboardClickFlag = false;\n this._mouseClickFlag = false;\n }\n sleep() {\n if (this._destroyed !== true) {\n this.expandOnClick = false;\n this.expandOnFocus = false;\n this.expandOnHover = false;\n this.collapseOnClickOut = false;\n this.collapseOnFocusOut = false;\n this.collapseOnMouseOut = false;\n this.collapseOnHostReFocus = false;\n }\n }\n destroy() {\n this.sleep();\n this._destroyed = true;\n this._hostKeyDownListener = null;\n this._hostMouseDownListener = null;\n this._documentClickListener = null;\n this._documentTouchStartListener = null;\n this._documentTouchMoveListener = null;\n this._documentTouchEndListener = null;\n this._hostClickListener = null;\n this._hostFocusListener = null;\n this._hostReFocusListener = null;\n this._hostHoverListener = null;\n this._focusExitListener = null;\n this._mouseLeaveListener = null;\n this._widgetHasKeyboardFocus = null;\n }\n}\nexports.default = _default;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createLinear = createLinear;\nvar KeyEmitter = _interopRequireWildcard(require(\"makeup-key-emitter\"));\nvar ExitEmitter = _interopRequireWildcard(require(\"makeup-exit-emitter\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nconst defaultOptions = {\n axis: \"both\",\n autoInit: \"interactive\",\n autoReset: \"current\",\n ignoreByDelegateSelector: null,\n wrap: false\n};\nfunction isItemNavigable(el) {\n return !el.hidden && el.getAttribute(\"aria-disabled\") !== \"true\";\n}\nfunction isIndexNavigable(items, index) {\n return index >= 0 && index < items.length ? isItemNavigable(items[index]) : false;\n}\nfunction findNavigableItems(items) {\n return items.filter(isItemNavigable);\n}\nfunction findFirstNavigableIndex(items) {\n return items.findIndex(item => isItemNavigable(item));\n}\nfunction findLastNavigableIndex(items) {\n // todo: at(-1) is more performant than reverse(), but Babel is not transpiling it\n return items.indexOf(findNavigableItems(items).reverse()[0]);\n}\nfunction findIndexByAttribute(items, attribute, value) {\n return items.findIndex(item => isItemNavigable(item) && item.getAttribute(attribute) === value);\n}\nfunction findFirstNavigableAriaCheckedIndex(items) {\n return findIndexByAttribute(items, \"aria-checked\", \"true\");\n}\nfunction findFirstNavigableAriaSelectedIndex(items) {\n return findIndexByAttribute(items, \"aria-selected\", \"true\");\n}\nfunction findIgnoredByDelegateItems(el, options) {\n return options.ignoreByDelegateSelector !== null ? [...el.querySelectorAll(options.ignoreByDelegateSelector)] : [];\n}\nfunction findPreviousNavigableIndex(items, index, wrap) {\n let previousNavigableIndex = -1;\n if (index === null || atStart(items, index)) {\n if (wrap === true) {\n previousNavigableIndex = findLastNavigableIndex(items);\n }\n } else {\n let i = index;\n while (--i >= 0) {\n if (isItemNavigable(items[i])) {\n previousNavigableIndex = i;\n break;\n }\n }\n }\n return previousNavigableIndex;\n}\nfunction findNextNavigableIndex(items, index, wrap) {\n let nextNavigableIndex = -1;\n if (index === null) {\n nextNavigableIndex = findFirstNavigableIndex(items);\n } else if (atEnd(items, index)) {\n if (wrap === true) {\n nextNavigableIndex = findFirstNavigableIndex(items);\n }\n } else {\n let i = index;\n while (++i < items.length) {\n if (isItemNavigable(items[i])) {\n nextNavigableIndex = i;\n break;\n }\n }\n }\n return nextNavigableIndex;\n}\n\n// returning -1 means not found\nfunction findIndexPositionByType(typeOrNum, items, currentIndex) {\n let index = -1;\n switch (typeOrNum) {\n case \"none\":\n index = null;\n break;\n case \"current\":\n index = currentIndex;\n break;\n case \"interactive\":\n index = findFirstNavigableIndex(items);\n break;\n case \"ariaChecked\":\n index = findFirstNavigableAriaCheckedIndex(items);\n break;\n case \"ariaSelected\":\n index = findFirstNavigableAriaSelectedIndex(items);\n break;\n case \"ariaSelectedOrInteractive\":\n index = findFirstNavigableAriaSelectedIndex(items);\n index = index === -1 ? findFirstNavigableIndex(items) : index;\n break;\n default:\n index = typeof typeOrNum === \"number\" || typeOrNum === null ? typeOrNum : -1;\n }\n return index;\n}\nfunction atStart(items, index) {\n return index === findFirstNavigableIndex(items);\n}\nfunction atEnd(items, index) {\n return index === findLastNavigableIndex(items);\n}\nfunction onKeyPrev(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findPreviousNavigableIndex(this.items, this.index, this.options.wrap);\n }\n}\nfunction onKeyNext(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findNextNavigableIndex(this.items, this.index, this.options.wrap);\n }\n}\nfunction onClick(e) {\n const itemIndex = this.indexOf(e.target.closest(this._itemSelector));\n if (isIndexNavigable(this.items, itemIndex)) {\n this.index = itemIndex;\n }\n}\nfunction onKeyHome(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findFirstNavigableIndex(this.items);\n }\n}\nfunction onKeyEnd(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findLastNavigableIndex(this.items);\n }\n}\nfunction onFocusExit() {\n if (this.options.autoReset !== null) {\n this.reset();\n }\n}\nfunction onMutation(e) {\n const fromIndex = this.index;\n let toIndex = this.index;\n // https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord\n const {\n addedNodes,\n attributeName,\n removedNodes,\n target,\n type\n } = e[0];\n if (type === \"attributes\") {\n if (target === this.currentItem) {\n if (attributeName === \"aria-disabled\") {\n // current item was disabled - keep it as current index (until a keyboard navigation happens)\n toIndex = this.index;\n } else if (attributeName === \"hidden\") {\n // current item was hidden and focus is lost - reset index to first interactive element\n toIndex = findFirstNavigableIndex(this.items);\n }\n } else {\n toIndex = this.index;\n }\n } else if (type === \"childList\") {\n if (removedNodes.length > 0 && [...removedNodes].includes(this._cachedElement)) {\n // current item was removed and focus is lost - reset index to first interactive element\n toIndex = findFirstNavigableIndex(this.items);\n } else if (removedNodes.length > 0 || addedNodes.length > 0) {\n // nodes were added and/or removed - keep current item and resync its index\n toIndex = this.indexOf(this._cachedElement);\n }\n }\n this._index = toIndex;\n this._el.dispatchEvent(new CustomEvent(\"navigationModelMutation\", {\n bubbles: false,\n detail: {\n fromIndex,\n toIndex\n }\n }));\n}\nclass NavigationModel {\n /**\n * @param {HTMLElement} el\n * @param {string} itemSelector\n * @param {typeof defaultOptions} selectedOptions\n */\n constructor(el, itemSelector, selectedOptions) {\n /** @member {typeof defaultOptions} */\n this.options = Object.assign({}, defaultOptions, selectedOptions);\n\n /** @member {HTMLElement} */\n this._el = el;\n\n /** @member {string} */\n this._itemSelector = itemSelector;\n }\n}\nclass LinearNavigationModel extends NavigationModel {\n /**\n * @param {HTMLElement} el\n * @param {string} itemSelector\n * @param {typeof defaultOptions} selectedOptions\n */\n constructor(el, itemSelector, selectedOptions) {\n super(el, itemSelector, selectedOptions);\n const fromIndex = this._index;\n const toIndex = findIndexPositionByType(this.options.autoInit, this.items, this.index);\n\n // do not use setter as it will trigger a change event\n this._index = toIndex;\n\n // always keep an element reference to the last item (for use in mutation observer)\n // todo: convert index to Tuple to store last/current values instead?\n this._cachedElement = this.items[toIndex];\n this._el.dispatchEvent(new CustomEvent(\"navigationModelInit\", {\n bubbles: false,\n detail: {\n firstInteractiveIndex: this.firstNavigableIndex,\n fromIndex,\n items: this.items,\n toIndex\n }\n }));\n }\n get currentItem() {\n return this.items[this.index];\n }\n\n // todo: code smell as getter abstracts that the query selector re-runs every time getter is accessed\n get items() {\n return [...this._el.querySelectorAll(`${this._itemSelector}`)];\n }\n get index() {\n return this._index;\n }\n\n /**\n * @param {number} toIndex - update index position in this.items (non-interactive indexes fail silently)\n */\n set index(toIndex) {\n if (toIndex === this.index) {\n return;\n } else if (!isIndexNavigable(this.items, toIndex)) {\n // no-op. throw exception?\n } else {\n const fromIndex = this.index;\n // update cached element reference (for use in mutation observer if DOM node gets removed)\n this._cachedElement = this.items[toIndex];\n this._index = toIndex;\n this._el.dispatchEvent(new CustomEvent(\"navigationModelChange\", {\n bubbles: false,\n detail: {\n fromIndex,\n toIndex\n }\n }));\n }\n }\n indexOf(element) {\n return this.items.indexOf(element);\n }\n reset() {\n const fromIndex = this.index;\n const toIndex = findIndexPositionByType(this.options.autoReset, this.items, this.index);\n if (toIndex !== fromIndex) {\n // do not use setter as it will trigger a navigationModelChange event\n this._index = toIndex;\n this._el.dispatchEvent(new CustomEvent(\"navigationModelReset\", {\n bubbles: false,\n detail: {\n fromIndex,\n toIndex\n }\n }));\n }\n }\n}\n\n// 2D Grid Model will go here\n\n/*\nclass GridModel extends NavigationModel {\n constructor(el, rowSelector, colSelector) {\n super();\n this._coords = null;\n }\n}\n*/\n\nclass NavigationEmitter {\n /**\n * @param {HTMLElement} el\n * @param {LinearNavigationModel} model\n */\n constructor(el, model) {\n this.model = model;\n this.el = el;\n this._keyPrevListener = onKeyPrev.bind(model);\n this._keyNextListener = onKeyNext.bind(model);\n this._keyHomeListener = onKeyHome.bind(model);\n this._keyEndListener = onKeyEnd.bind(model);\n this._clickListener = onClick.bind(model);\n this._focusExitListener = onFocusExit.bind(model);\n this._observer = new MutationObserver(onMutation.bind(model));\n KeyEmitter.addKeyDown(this.el);\n ExitEmitter.addFocusExit(this.el);\n const axis = model.options.axis;\n if (axis === \"both\" || axis === \"x\") {\n this.el.addEventListener(\"arrowLeftKeyDown\", this._keyPrevListener);\n this.el.addEventListener(\"arrowRightKeyDown\", this._keyNextListener);\n }\n if (axis === \"both\" || axis === \"y\") {\n this.el.addEventListener(\"arrowUpKeyDown\", this._keyPrevListener);\n this.el.addEventListener(\"arrowDownKeyDown\", this._keyNextListener);\n }\n this.el.addEventListener(\"homeKeyDown\", this._keyHomeListener);\n this.el.addEventListener(\"endKeyDown\", this._keyEndListener);\n this.el.addEventListener(\"click\", this._clickListener);\n this.el.addEventListener(\"focusExit\", this._focusExitListener);\n this._observer.observe(this.el, {\n childList: true,\n subtree: true,\n attributeFilter: [\"aria-disabled\", \"hidden\"],\n attributes: true,\n attributeOldValue: true\n });\n }\n destroy() {\n KeyEmitter.removeKeyDown(this.el);\n ExitEmitter.removeFocusExit(this.el);\n this.el.removeEventListener(\"arrowLeftKeyDown\", this._keyPrevListener);\n this.el.removeEventListener(\"arrowRightKeyDown\", this._keyNextListener);\n this.el.removeEventListener(\"arrowUpKeyDown\", this._keyPrevListener);\n this.el.removeEventListener(\"arrowDownKeyDown\", this._keyNextListener);\n this.el.removeEventListener(\"homeKeyDown\", this._keyHomeListener);\n this.el.removeEventListener(\"endKeyDown\", this._keyEndListener);\n this.el.removeEventListener(\"click\", this._clickListener);\n this.el.removeEventListener(\"focusExit\", this._focusExitListener);\n this._observer.disconnect();\n }\n}\nfunction createLinear(el, itemSelector, selectedOptions) {\n const model = new LinearNavigationModel(el, itemSelector, selectedOptions);\n return new NavigationEmitter(el, model);\n}\n\n/*\nstatic createGrid(el, rowSelector, colSelector, selectedOptions) {\n return null;\n}\n*/\n","require('./../dist/tokens/evo-core.css');\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _makeupExpander = _interopRequireDefault(require(\"makeup-expander\"));\nvar _makeupListbox = _interopRequireDefault(require(\"makeup-listbox\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst defaultOptions = {\n autoSelect: true,\n buttonLabelSelector: \".btn__text\",\n collapseTimeout: 150,\n customElementMode: false,\n listboxSelector: \".listbox-button__listbox\",\n floatingLabelSelector: \".btn__floating-label\",\n floatingLabelInline: \"btn__floating-label--inline\",\n floatingLabelAnimate: \"btn__floating-label--animate\",\n valueSelector: \".listbox-button__value\",\n buttonValueType: \"text\",\n // [\"text\", \"icon\", \"both\"],\n listboxOptionIconSelector: \".icon\",\n listboxOptionAriaLabelSelector: null\n};\nclass _default {\n constructor(widgetEl, selectedOptions) {\n this._options = Object.assign({}, defaultOptions, selectedOptions);\n this.el = widgetEl;\n this._buttonEl = this.el.querySelector(\"button\");\n this._buttonLabelEl = widgetEl.querySelector(this._options.buttonLabelSelector);\n this._buttonFloatingLabelEl = widgetEl.querySelector(this._options.floatingLabelSelector);\n this._buttonPrefix = this._buttonEl.dataset?.listboxButtonPrefix;\n this._listboxEl = this.el.querySelector(this._options.listboxSelector);\n this._onButtonFirstClickListener = _onButtonFirstClick.bind(this);\n this._onListboxClickListener = _onListboxClick.bind(this);\n this._onListboxKeyDownListener = _onListboxKeyDown.bind(this);\n this._onListboxInitListener = _onListboxInit.bind(this);\n this._onListboxChangeListener = _onListboxChange.bind(this);\n this._onMutationListener = _onMutation.bind(this);\n if (!this._options.customElementMode) {\n this._mutationObserver = new MutationObserver(this._onMutationListener);\n this._observeMutations();\n this._observeEvents();\n }\n this.listbox = new _makeupListbox.default(this._listboxEl, {\n activeDescendantClassName: \"listbox-button__option--active\",\n autoReset: \"ariaSelectedOrInteractive\",\n autoSelect: this._options.autoSelect,\n valueSelector: this._options.valueSelector\n });\n this._expander = new _makeupExpander.default(this.el, {\n alwaysDoFocusManagement: true,\n autoCollapse: true,\n collapseOnHostReFocus: true,\n contentSelector: this._options.listboxSelector,\n expandedClass: \"listbox-button--expanded\",\n expandOnClick: true,\n focusManagement: \"focusable\",\n hostSelector: \"button\"\n });\n this.el.classList.add(\"listbox-button--js\");\n if (this._buttonFloatingLabelEl) {\n if (!this._buttonLabelEl.innerText) {\n this._buttonFloatingLabelEl.classList.add(this._options.floatingLabelInline);\n }\n }\n }\n _observeMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.observe(this._buttonEl, {\n attributeFilter: [\"aria-expanded\"],\n attributes: true,\n childList: false,\n subtree: false\n });\n }\n }\n _unobserveMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.disconnect();\n }\n }\n _unobserveEvents() {\n this._buttonEl.removeEventListener(\"click\", this._onButtonFirstClickListener);\n this._listboxEl.removeEventListener(\"click\", this._onListboxClickListener);\n this._listboxEl.removeEventListener(\"keydown\", this._onListboxKeyDownListener);\n this._listboxEl.removeEventListener(\"makeup-listbox-init\", this._onListboxInitListener);\n this._listboxEl.removeEventListener(\"makeup-listbox-change\", this._onListboxChangeListener);\n }\n _observeEvents() {\n if (this._destroyed !== true) {\n this._buttonEl.addEventListener(\"click\", this._onButtonFirstClickListener, {\n once: true\n });\n this._listboxEl.addEventListener(\"click\", this._onListboxClickListener);\n this._listboxEl.addEventListener(\"keydown\", this._onListboxKeyDownListener);\n this._listboxEl.addEventListener(\"makeup-listbox-init\", this._onListboxInitListener);\n this._listboxEl.addEventListener(\"makeup-listbox-change\", this._onListboxChangeListener);\n }\n }\n collapse() {\n const widget = this;\n setTimeout(function () {\n widget._unobserveMutations();\n widget._expander.expanded = false;\n widget._observeMutations();\n widget._buttonEl.focus();\n }, this._options.collapseTimeout);\n }\n destroy() {\n this._destroyed = true;\n this._unobserveEvents();\n this._unobserveMutations();\n this._onButtonFirstClickListener = null;\n this._onListboxClickListener = null;\n this._onListboxKeyDownListener = null;\n this._onListboxInitListener = null;\n this._onListboxChangeListener = null;\n this._onMutationListener = null;\n }\n}\n\n// listbox element should be hidden in initial SSR markup (for progressive enhancement)\nexports.default = _default;\nfunction _onButtonFirstClick() {\n this.listbox.el.hidden = false;\n}\nfunction _onListboxKeyDown(e) {\n if (e.keyCode === 13 || e.keyCode === 27 || e.keyCode === 32) {\n this.collapse();\n }\n}\nfunction _onListboxClick(e) {\n if (e.target.closest(\"[role=option]\")) {\n this.collapse();\n }\n}\nfunction _onListboxInit(e) {\n this.el.dispatchEvent(new CustomEvent(\"makeup-listbox-button-init\", {\n detail: e.detail\n }));\n}\nfunction _onListboxChange(e) {\n const toValue = e.detail.optionValue;\n const {\n listboxOptionIconSelector,\n listboxOptionAriaLabelSelector,\n buttonValueType,\n floatingLabelAnimate,\n floatingLabelInline\n } = this._options;\n const icon = e.detail.el.querySelector(listboxOptionIconSelector).cloneNode(true);\n let btnContent = this._buttonPrefix ? `${this._buttonPrefix}${toValue}` : toValue;\n if (icon) {\n switch (buttonValueType) {\n case \"both\":\n btnContent = `${icon.outerHTML} ${btnContent}`;\n break;\n case \"icon\":\n this._buttonEl.setAttribute(\"aria-label\", btnContent);\n btnContent = icon.outerHTML;\n break;\n default:\n break;\n }\n }\n if (listboxOptionAriaLabelSelector) {\n const selectorText = e.detail.el.querySelector(listboxOptionAriaLabelSelector)?.innerText.trim();\n this._buttonEl.setAttribute(\"aria-label\", this._buttonPrefix ? `${this._buttonPrefix} ${selectorText}` : selectorText);\n }\n this._buttonLabelEl.innerHTML = btnContent;\n if (this._buttonFloatingLabelEl) {\n if (toValue) {\n this._buttonFloatingLabelEl.classList.add(floatingLabelAnimate);\n this._buttonFloatingLabelEl.classList.remove(floatingLabelInline);\n } else {\n this._buttonFloatingLabelEl.classList.add(floatingLabelInline);\n }\n }\n this.el.dispatchEvent(new CustomEvent(\"makeup-listbox-button-change\", {\n detail: e.detail\n }));\n}\nfunction _onMutation(mutationsList) {\n for (const mutation of mutationsList) {\n if (mutation.type === \"attributes\") {\n this.el.dispatchEvent(new CustomEvent(\"makeup-listbox-button-mutation\", {\n detail: {\n attributeName: mutation.attributeName\n }\n }));\n }\n }\n}\n","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.add = add;\nexports.remove = remove;\nfunction onKeyDown(e) {\n if (e.keyCode >= 32 && e.keyCode <= 40) {\n e.preventDefault();\n }\n}\nfunction add(el) {\n el.addEventListener(\"keydown\", onKeyDown);\n}\nfunction remove(el) {\n el.removeEventListener(\"keydown\", onKeyDown);\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\"use strict\";\n\nrequire(\"../../docs.css\");\nrequire(\"@ebay/skin/tokens\");\nrequire(\"@ebay/skin/global\");\nrequire(\"@ebay/skin/utility\");\nrequire(\"@ebay/skin/button\");\nrequire(\"@ebay/skin/listbox-button\");\nvar _makeupListboxButton = _interopRequireDefault(require(\"makeup-listbox-button\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\n// REQUIRE\n// const ListboxButton = require('makeup-listbox-button').default;\n\n// IMPORT\n\nconst widgets = [];\nconst log = e => console.log(e.type, e.detail);\nwindow.onload = function () {\n document.querySelectorAll(\".listbox-button\").forEach(function (el, i) {\n const hasCustomLabel = el.classList.contains(\"listbox-button-with-icon-label\");\n const hasIconText = el.classList.contains(\"listbox-button-with-iconText\");\n const hasIcon = el.classList.contains(\"listbox-button-with-icon\");\n let buttonValueType;\n if (hasIconText) {\n buttonValueType = \"both\";\n } else if (hasIcon || hasCustomLabel) {\n buttonValueType = \"icon\";\n } else {\n buttonValueType = \"text\";\n }\n const listboxOptionAriaLabelSelector = hasCustomLabel ? \".listbox-button__value span\" : null;\n el.addEventListener(\"makeup-listbox-button-init\", log);\n el.addEventListener(\"makeup-listbox-button-change\", log);\n el.addEventListener(\"makeup-listbox-button-mutation\", log);\n widgets.push(new _makeupListboxButton.default(el, {\n autoSelect: el.dataset.makeupAutoSelect === \"false\" ? false : true,\n buttonValueType,\n listboxOptionAriaLabelSelector\n }));\n });\n};"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"makeup-listbox-button/index.min.js","mappings":";;;;;;AAAA,mBAAO,CAAC,IAA0B;;;;;;;;;ACArB;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,oBAAoB;AACpB,uBAAuB;AACvB,2CAA2C,mBAAO,CAAC,IAAgB;AACnE,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC3EA;;;;;;;;;;ACAA;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf,+CAA+C,mBAAO,CAAC,IAA0B;AACjF,gDAAgD,mBAAO,CAAC,IAA4B;AACpF,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;;;;;;;;ACvNa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,oBAAoB;AACpB,gDAAgD,mBAAO,CAAC,IAA2B;AACnF,2CAA2C,mBAAO,CAAC,IAAgB;AACnE,qCAAqC,iCAAiC;AACtE,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;ACxKA;;;;;;;;ACAA,mBAAO,CAAC,IAAgC;;;;;;;;;ACA3B;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,OAAO,EAAE,UAAU,EAAE,cAAc;;AAEpD;AACA;AACA;AACA,6BAA6B,IAAI,GAAG,mBAAmB;AACvD;AACA;AACA;;;;;;;;;;ACvCA;;;;;;;;ACAA,mBAAO,CAAC,IAAsB;AAC9B,mBAAO,CAAC,IAAuB;;;;;;;;ACD/B,mBAAO,CAAC,IAA0B;;;;;;;;ACAlC,mBAAO,CAAC,IAA0C;;;;;;;;;;ACAlD;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;ACnCa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,WAAW;AACX,kBAAkB;AAClB,gBAAgB;AAChB,cAAc;AACd,qBAAqB;AACrB,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,IAAI,KAAK,aAAa;AAC1F;AACA;AACA,SAAS;AACT;AACA;AACA,uDAAuD,aAAa;AACpE;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACrEA;;;;;;;;ACAA,mBAAO,CAAC,IAA4B;;;;;;;;;ACAvB;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf,2CAA2C,mBAAO,CAAC,IAAgB;AACnE,0CAA0C,mBAAO,CAAC,GAAqB;AACvE,+CAA+C,mBAAO,CAAC,IAAmB;AAC1E,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ,2CAA2C,gBAAgB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,kDAAkD,WAAW;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;;;;;;;;;ACtSF;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,oBAAoB;AACpB,yCAAyC,mBAAO,CAAC,IAAoB;AACrE,0CAA0C,mBAAO,CAAC,GAAqB;AACvE,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,QAAQ;AACrB,aAAa,uBAAuB;AACpC;AACA;AACA,iBAAiB,uBAAuB;AACxC,mCAAmC;;AAEnC,iBAAiB,aAAa;AAC9B;;AAEA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,QAAQ;AACrB,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,4CAA4C,mBAAmB;AAC/D;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;ACjXA,mBAAO,CAAC,IAA+B;;;;;;;;;ACA1B;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf,6CAA6C,mBAAO,CAAC,IAAiB;AACtE,4CAA4C,mBAAO,CAAC,IAAgB;AACpE,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,2CAA2C,mBAAmB,EAAE,QAAQ;AACxE;AACA;AACA;AACA,wBAAwB,gBAAgB,QAAQ,WAAW;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,oBAAoB,EAAE,aAAa;AACzG;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;;;;;;;;;ACjMA;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,WAAW;AACX,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;UCjBA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;;;;ACNa;;AAEb,mBAAO,CAAC,IAAgB;AACxB,mBAAO,CAAC,IAAmB;AAC3B,mBAAO,CAAC,IAAmB;AAC3B,mBAAO,CAAC,IAAoB;AAC5B,mBAAO,CAAC,GAAmB;AAC3B,mBAAO,CAAC,IAA2B;AACnC,kDAAkD,mBAAO,CAAC,IAAuB;AACjF,qCAAqC,iCAAiC;AACtE;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH,E","sources":["webpack://root/./node_modules/@ebay/skin/button.js","webpack://root/./packages/core/makeup-exit-emitter/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/dist/global/global.css?e001","webpack://root/./node_modules/@ebay/skin/dist/tokens/evo-light.css?9c33","webpack://root/./packages/ui/makeup-listbox/dist/cjs/index.js","webpack://root/./packages/core/makeup-active-descendant/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/dist/listbox-button/listbox-button.css?ea08","webpack://root/./node_modules/@ebay/skin/tokens/evo-light.js","webpack://root/./packages/core/makeup-next-id/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/dist/utility/utility.css?6c3b","webpack://root/./node_modules/@ebay/skin/tokens.js","webpack://root/./node_modules/@ebay/skin/global.js","webpack://root/./node_modules/@ebay/skin/listbox-button.js","webpack://root/./docs/docs.css?378e","webpack://root/./packages/core/makeup-focusables/dist/cjs/index.js","webpack://root/./packages/core/makeup-key-emitter/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/dist/button/button.css?9a44","webpack://root/./node_modules/@ebay/skin/utility.js","webpack://root/./packages/core/makeup-expander/dist/cjs/index.js","webpack://root/./packages/core/makeup-navigation-emitter/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/tokens/evo-core.js","webpack://root/./packages/ui/makeup-listbox-button/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/dist/tokens/evo-core.css?7a96","webpack://root/./packages/core/makeup-prevent-scroll-keys/dist/cjs/index.js","webpack://root/webpack/bootstrap","webpack://root/webpack/runtime/make namespace object","webpack://root/./docs/ui/makeup-listbox-button/index.compiled.js"],"sourcesContent":["require('./dist/button/button.css');\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.addFocusExit = addFocusExit;\nexports.removeFocusExit = removeFocusExit;\nvar _makeupNextId = _interopRequireDefault(require(\"makeup-next-id\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst focusExitEmitters = {};\nfunction doFocusExit(el, fromElement, toElement) {\n el.dispatchEvent(new CustomEvent(\"focusExit\", {\n detail: {\n fromElement,\n toElement\n },\n bubbles: false // mirror the native mouseleave event\n }));\n}\nfunction onDocumentFocusIn(e) {\n const newFocusElement = e.target;\n const targetIsDescendant = this.el.contains(newFocusElement);\n\n // if focus has moved to a focusable descendant\n if (targetIsDescendant === true) {\n // set the target as the currently focussed element\n this.currentFocusElement = newFocusElement;\n } else {\n // else focus has not gone to a focusable descendant\n window.removeEventListener(\"blur\", this.onWindowBlurListener);\n document.removeEventListener(\"focusin\", this.onDocumentFocusInListener);\n doFocusExit(this.el, this.currentFocusElement, newFocusElement);\n this.currentFocusElement = null;\n }\n}\nfunction onWindowBlur() {\n doFocusExit(this.el, this.currentFocusElement, undefined);\n}\nfunction onWidgetFocusIn() {\n // listen for focus moving to anywhere in document\n // note that mouse click on buttons, checkboxes and radios does not trigger focus events in all browsers!\n document.addEventListener(\"focusin\", this.onDocumentFocusInListener);\n // listen for focus leaving the window\n window.addEventListener(\"blur\", this.onWindowBlurListener);\n}\nclass FocusExitEmitter {\n constructor(el) {\n this.el = el;\n this.currentFocusElement = null;\n this.onWidgetFocusInListener = onWidgetFocusIn.bind(this);\n this.onDocumentFocusInListener = onDocumentFocusIn.bind(this);\n this.onWindowBlurListener = onWindowBlur.bind(this);\n this.el.addEventListener(\"focusin\", this.onWidgetFocusInListener);\n }\n removeEventListeners() {\n window.removeEventListener(\"blur\", this.onWindowBlurListener);\n document.removeEventListener(\"focusin\", this.onDocumentFocusInListener);\n this.el.removeEventListener(\"focusin\", this.onWidgetFocusInListener);\n }\n}\nfunction addFocusExit(el) {\n let exitEmitter = null;\n (0, _makeupNextId.default)(el);\n if (!focusExitEmitters[el.id]) {\n exitEmitter = new FocusExitEmitter(el);\n focusExitEmitters[el.id] = exitEmitter;\n }\n return exitEmitter;\n}\nfunction removeFocusExit(el) {\n const exitEmitter = focusExitEmitters[el.id];\n if (exitEmitter) {\n exitEmitter.removeEventListeners();\n delete focusExitEmitters[el.id];\n }\n}\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar ActiveDescendant = _interopRequireWildcard(require(\"makeup-active-descendant\"));\nvar PreventScrollKeys = _interopRequireWildcard(require(\"makeup-prevent-scroll-keys\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\n/**\n * A listbox can be a standalone focusable widget, or controlled by a separate, focusable widget\n * (a textbox for example, in the case of a combobox or datepicker)\n *\n * This listbox code currently supports single-selct only!\n * This code has been copied from Skin & MIND Patterns and has not yet been cleaned up.\n */\n\nconst defaultOptions = {\n activeDescendantClassName: \"listbox__option--active\",\n // the classname applied to the current active desdcendant\n autoInit: \"none\",\n autoReset: null,\n autoSelect: true,\n // when true, aria-checked state matches active-descendant\n autoScroll: true,\n // when true, the listbox will scroll to keep the activeDescendant in view\n customElementMode: false,\n focusableElement: null,\n // used in a combobox/datepicker scenario\n listboxOwnerElement: null,\n // used in a combobox/datepicker scenario\n multiSelect: false,\n // todo\n useAriaChecked: true,\n // doubles up on support for aria-selected to announce visible selected/checked state\n valueSelector: \".listbox__value\" // Selector to get value from\n};\nclass _default {\n constructor(widgetEl, selectedOptions) {\n this._options = Object.assign({}, defaultOptions, selectedOptions);\n this.el = widgetEl;\n\n // in cases such as combobox, the active-descendant logic is controlled by a parent widget\n this._activeDescendantRootEl = this._options.listboxOwnerElement || this.el;\n\n // todo: not sure this check is needed any more\n if (widgetEl.getAttribute(\"role\") === \"listbox\") {\n this._listboxEl = widgetEl;\n } else {\n this._listboxEl = this.el.querySelector(\"[role=listbox]\");\n }\n if (!this._options.focusableElement && this._listboxEl.getAttribute(\"tabindex\") === null) {\n this._listboxEl.setAttribute(\"tabindex\", \"0\");\n }\n PreventScrollKeys.add(this.el);\n this._onKeyDownListener = _onKeyDown.bind(this);\n this._onClickListener = _onClick.bind(this);\n this._onFirstMouseDownListener = _onFirstMouseDown.bind(this);\n this._onFirstFocusListener = _onFirstFocus.bind(this);\n this._onActiveDescendantChangeListener = _onActiveDescendantChange.bind(this);\n this._onMutationListener = _onMutation.bind(this);\n this.el.classList.add(\"listbox--js\");\n if (!this._options.customElementMode) {\n this._mutationObserver = new MutationObserver(this._onMutationListener);\n this._observeMutations();\n this._observeEvents();\n }\n this._activeDescendant = ActiveDescendant.createLinear(this._activeDescendantRootEl, this._options.focusableElement || this._listboxEl, this._listboxEl.parentElement, \"[role=option]\", {\n activeDescendantClassName: this._options.activeDescendantClassName,\n autoInit: this._options.autoInit,\n autoReset: this._options.autoReset,\n autoScroll: this._options.autoScroll,\n axis: \"y\"\n });\n }\n _observeMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.observe(this._listboxEl, {\n attributeFilter: [\"aria-selected\"],\n attributes: true,\n childList: true,\n subtree: true\n });\n }\n }\n _unobserveMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.disconnect();\n }\n }\n _observeEvents() {\n if (this._destroyed !== true) {\n this._activeDescendantRootEl.addEventListener(\"activeDescendantChange\", this._onActiveDescendantChangeListener);\n this._listboxEl.addEventListener(\"mousedown\", this._onFirstMouseDownListener, {\n once: true\n });\n this._listboxEl.addEventListener(\"focus\", this._onFirstFocusListener, {\n once: true\n });\n this._listboxEl.addEventListener(\"keydown\", this._onKeyDownListener);\n this._listboxEl.addEventListener(\"click\", this._onClickListener);\n }\n }\n _unobserveEvents() {\n this._listboxEl.removeEventListener(\"keydown\", this._onKeyDownListener);\n this._listboxEl.removeEventListener(\"click\", this._onClickListener);\n this._listboxEl.removeEventListener(\"focus\", this._onFirstFocusListener);\n this._listboxEl.removeEventListener(\"mousedown\", this._onFirstMouseDownListener);\n this._activeDescendantRootEl.removeEventListener(\"activeDescendantChange\", this._onActiveDescendantChangeListener);\n }\n get index() {\n return this.items.findIndex(el => el.getAttribute(\"aria-selected\") === \"true\");\n }\n get items() {\n return this._activeDescendant.items;\n }\n select(index) {\n this._unobserveMutations();\n if (this.index !== index) {\n this.unselect(this.index);\n const itemEl = this._activeDescendant.items[index];\n if (itemEl && itemEl.getAttribute(\"aria-disabled\") !== \"true\") {\n const matchingItem = this.items[index];\n let optionValue;\n matchingItem.setAttribute(\"aria-selected\", \"true\");\n if (this._options.useAriaChecked === true) {\n matchingItem.setAttribute(\"aria-checked\", \"true\");\n }\n optionValue = matchingItem.innerText;\n\n // Check if value selector is present and use that to get innerText instead\n // If its not present, will default to innerText of the whole item\n if (this._options.valueSelector) {\n const valueSelector = matchingItem.querySelector(this._options.valueSelector);\n if (valueSelector) {\n optionValue = valueSelector.innerText;\n }\n }\n this.el.dispatchEvent(new CustomEvent(\"makeup-listbox-change\", {\n detail: {\n el: matchingItem,\n optionIndex: index,\n optionValue\n }\n }));\n }\n }\n this._observeMutations();\n }\n unselect(index) {\n this._unobserveMutations();\n const itemEl = this.items[index];\n if (itemEl && itemEl.getAttribute(\"aria-disabled\") !== \"true\") {\n const matchingItem = this.items[index];\n matchingItem.setAttribute(\"aria-selected\", \"false\");\n if (this._options.useAriaChecked === true) {\n matchingItem.setAttribute(\"aria-checked\", \"false\");\n }\n }\n this._observeMutations();\n }\n destroy() {\n this._destroyed = true;\n this._unobserveMutations();\n this._unobserveEvents();\n this._onKeyDownListener = null;\n this._onClickListener = null;\n this._onFirstMouseDownListener = null;\n this._onFirstFocusListener = null;\n this._onActiveDescendantChangeListener = null;\n this._onMutationListener = null;\n }\n}\nexports.default = _default;\nfunction _onFirstMouseDown() {\n this._isMouseDown = true;\n}\n\n// set activeDescendant on first keyboard focus\nfunction _onFirstFocus() {\n if (!this._isMouseDown) {\n this._activeDescendant.index = this.index === -1 ? 0 : this.index;\n }\n this._isMouseDown = false;\n}\nfunction _onClick(e) {\n const toEl = e.target.closest(\"[role=option]\");\n if (toEl) {\n this.select(this.items.indexOf(toEl));\n }\n}\nfunction _onKeyDown(e) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this.select(this._activeDescendant.index);\n }\n}\nfunction _onActiveDescendantChange(e) {\n const {\n toIndex\n } = e.detail;\n const toEl = this.items[toIndex];\n if (this._options.autoSelect === true && toEl) {\n this.select(toIndex);\n }\n}\nfunction _onMutation(mutationsList) {\n for (const mutation of mutationsList) {\n if (mutation.type === \"attributes\") {\n this.el.dispatchEvent(new CustomEvent(\"makeup-listbox-mutation\", {\n detail: {\n attributeName: mutation.attributeName\n }\n }));\n }\n }\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createLinear = createLinear;\nvar NavigationEmitter = _interopRequireWildcard(require(\"makeup-navigation-emitter\"));\nvar _makeupNextId = _interopRequireDefault(require(\"makeup-next-id\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nconst defaultOptions = {\n activeDescendantClassName: \"active-descendant\",\n autoInit: \"none\",\n autoReset: \"none\",\n autoScroll: false,\n axis: \"both\",\n wrap: false\n};\nfunction onModelInit(e) {\n const {\n items,\n toIndex\n } = e.detail;\n const itemEl = items[toIndex];\n if (itemEl) {\n itemEl.classList.add(this._options.activeDescendantClassName);\n this._focusEl.setAttribute(\"aria-activedescendant\", itemEl.id);\n }\n this._el.dispatchEvent(new CustomEvent(\"activeDescendantInit\", {\n detail: e.detail\n }));\n}\nfunction onModelChange(e) {\n const {\n fromIndex,\n toIndex\n } = e.detail;\n const fromItem = this.items[fromIndex];\n const toItem = this.items[toIndex];\n if (fromItem) {\n fromItem.classList.remove(this._options.activeDescendantClassName);\n }\n if (toItem) {\n toItem.classList.add(this._options.activeDescendantClassName);\n this._focusEl.setAttribute(\"aria-activedescendant\", toItem.id);\n if (this._options.autoScroll && this._itemContainerEl) {\n this._itemContainerEl.scrollTop = toItem.offsetTop - this._itemContainerEl.offsetHeight / 2;\n }\n }\n this._el.dispatchEvent(new CustomEvent(\"activeDescendantChange\", {\n detail: e.detail\n }));\n}\nfunction onModelReset(e) {\n const toIndex = e.detail.toIndex;\n const activeClassName = this._options.activeDescendantClassName;\n this.items.forEach(function (el) {\n el.classList.remove(activeClassName);\n });\n if (toIndex !== null && toIndex !== -1) {\n const itemEl = this.items[toIndex];\n itemEl.classList.add(activeClassName);\n this._focusEl.setAttribute(\"aria-activedescendant\", itemEl.id);\n } else {\n this._focusEl.removeAttribute(\"aria-activedescendant\");\n }\n this._el.dispatchEvent(new CustomEvent(\"activeDescendantReset\", {\n detail: e.detail\n }));\n}\nfunction onModelMutation(e) {\n const {\n toIndex\n } = e.detail;\n const activeDescendantClassName = this._options.activeDescendantClassName;\n this.items.forEach(function (item, index) {\n (0, _makeupNextId.default)(item);\n if (index !== toIndex) {\n item.classList.remove(activeDescendantClassName);\n } else {\n item.classList.add(activeDescendantClassName);\n }\n });\n this._el.dispatchEvent(new CustomEvent(\"activeDescendantMutation\", {\n detail: e.detail\n }));\n}\nclass ActiveDescendant {\n constructor(el) {\n this._el = el;\n this._onMutationListener = onModelMutation.bind(this);\n this._onChangeListener = onModelChange.bind(this);\n this._onResetListener = onModelReset.bind(this);\n this._onInitListener = onModelInit.bind(this);\n this._el.addEventListener(\"navigationModelMutation\", this._onMutationListener);\n this._el.addEventListener(\"navigationModelChange\", this._onChangeListener);\n this._el.addEventListener(\"navigationModelReset\", this._onResetListener);\n this._el.addEventListener(\"navigationModelInit\", this._onInitListener);\n }\n destroy() {\n this._el.removeEventListener(\"navigationModelMutation\", this._onMutationListener);\n this._el.removeEventListener(\"navigationModelChange\", this._onChangeListener);\n this._el.removeEventListener(\"navigationModelReset\", this._onResetListener);\n this._el.removeEventListener(\"navigationModelInit\", this._onInitListener);\n }\n}\nclass LinearActiveDescendant extends ActiveDescendant {\n constructor(el, focusEl, itemContainerEl, itemSelector, selectedOptions) {\n super(el);\n this._options = Object.assign({}, defaultOptions, selectedOptions);\n this._focusEl = focusEl;\n this._itemContainerEl = itemContainerEl;\n this._itemSelector = itemSelector;\n\n // ensure container has an id\n (0, _makeupNextId.default)(this._itemContainerEl);\n\n // if programmatic relationship set aria-owns\n if (this._itemContainerEl !== this._focusEl) {\n focusEl.setAttribute(\"aria-owns\", this._itemContainerEl.id);\n }\n this._navigationEmitter = NavigationEmitter.createLinear(el, itemSelector, {\n autoInit: this._options.autoInit,\n autoReset: this._options.autoReset,\n axis: this._options.axis,\n ignoreByDelegateSelector: this._options.ignoreByDelegateSelector,\n wrap: this._options.wrap\n });\n\n // ensure each item has an id\n this.items.forEach(function (itemEl) {\n (0, _makeupNextId.default)(itemEl);\n });\n }\n get index() {\n return this._navigationEmitter.model.index;\n }\n set index(newIndex) {\n this._navigationEmitter.model.index = newIndex;\n }\n reset() {\n this._navigationEmitter.model.reset();\n }\n get currentItem() {\n return this._navigationEmitter.model.currentItem;\n }\n get items() {\n return this._navigationEmitter.model.items;\n }\n set wrap(newWrap) {\n this._navigationEmitter.model.options.wrap = newWrap;\n }\n destroy() {\n super.destroy();\n this._navigationEmitter.destroy();\n }\n}\n\n/*\nclass GridActiveDescendant extends ActiveDescendant {\n constructor(el, focusEl, containerEl, rowSelector, cellSelector) {\n super(el);\n }\n}\n*/\n\nfunction createLinear(el, focusEl, itemContainerEl, itemSelector, selectedOptions) {\n return new LinearActiveDescendant(el, focusEl, itemContainerEl, itemSelector, selectedOptions);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","require('./../dist/tokens/evo-light.css');\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nconst sequenceMap = {};\nconst defaultPrefix = \"nid\";\nconst randomPortion = createRandomPortion(3);\nfunction randomNumber(max) {\n return Math.floor(Math.random() * max);\n}\nfunction createRandomPortion(size) {\n const letters = \"abcdefghijklmnopqrstuvwxyz\";\n const digits = \"0123456789\";\n const allChars = letters + digits;\n\n // to ensure a valid HTML ID (when prefix is empty), first character must be a letter\n let portion = letters[randomNumber(25)];\n\n // start iterating from 1, as we already have our first char\n for (let i = 1; i < size; i++) {\n portion += allChars[randomNumber(35)];\n }\n return portion;\n}\nfunction _default(el) {\n let prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultPrefix;\n const separator = prefix === \"\" ? \"\" : \"-\";\n\n // join first prefix with random portion to create key\n const key = `${prefix}${separator}${randomPortion}`;\n\n // initialise key in sequence map if necessary\n sequenceMap[key] = sequenceMap[key] || 0;\n if (!el.id) {\n el.setAttribute(\"id\", `${key}-${sequenceMap[key]++}`);\n }\n return el.id;\n}\n","// extracted by mini-css-extract-plugin\nexport {};","require('./tokens/evo-core.js');\nrequire('./tokens/evo-light.js');\n","require('./dist/global/global.css');\n","require('./dist/listbox-button/listbox-button.css');\n","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nconst focusableElList = [\"a[href]\", \"area[href]\", \"button:not([disabled])\", \"embed\", \"iframe\", \"input:not([disabled])\", \"object\", \"select:not([disabled])\", \"textarea:not([disabled])\", \"*[tabindex]\", \"*[contenteditable]\"];\nconst focusableElSelector = focusableElList.join();\nfunction _default(el) {\n let keyboardOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let callback = arguments.length > 2 ? arguments[2] : undefined;\n if (callback) {\n const request = requestAnimationFrame(() => {\n callback(getFocusables(el, keyboardOnly));\n });\n return () => {\n cancelAnimationFrame(request);\n };\n }\n return getFocusables(el, keyboardOnly);\n}\nfunction getFocusables(el) {\n let keyboardOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let focusableEls = Array.prototype.slice.call(el.querySelectorAll(focusableElSelector));\n\n // filter out elements with display: none or nested in a display: none parent\n focusableEls = focusableEls.filter(function (focusableEl) {\n return !!(focusableEl.offsetWidth || focusableEl.offsetHeight || focusableEl.getClientRects().length);\n });\n if (keyboardOnly === true) {\n focusableEls = focusableEls.filter(function (focusableEl) {\n return focusableEl.getAttribute(\"tabindex\") !== \"-1\";\n });\n }\n return focusableEls;\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.add = add;\nexports.addKeyDown = addKeyDown;\nexports.addKeyUp = addKeyUp;\nexports.remove = remove;\nexports.removeKeyDown = removeKeyDown;\nexports.removeKeyUp = removeKeyUp;\nfunction uncapitalizeFirstLetter(str) {\n return str.charAt(0).toLowerCase() + str.slice(1);\n}\nfunction onKeyDownOrUp(evt, el, keyEventType) {\n if (!evt.shiftKey) {\n const key = evt.key;\n switch (key) {\n case \"Enter\":\n case \"Escape\":\n case \"PageUp\":\n case \"PageDown\":\n case \"End\":\n case \"Home\":\n case \"ArrowLeft\":\n case \"ArrowUp\":\n case \"ArrowRight\":\n case \"ArrowDown\":\n el.dispatchEvent(new CustomEvent(uncapitalizeFirstLetter(`${key}Key${keyEventType}`), {\n detail: evt,\n bubbles: true\n }));\n break;\n case \" \":\n el.dispatchEvent(new CustomEvent(`spacebarKey${keyEventType}`, {\n detail: evt,\n bubbles: true\n }));\n break;\n default:\n return;\n }\n }\n}\nfunction onKeyDown(e) {\n onKeyDownOrUp(e, this, \"Down\");\n}\nfunction onKeyUp(e) {\n onKeyDownOrUp(e, this, \"Up\");\n}\nfunction addKeyDown(el) {\n el.addEventListener(\"keydown\", onKeyDown);\n}\nfunction addKeyUp(el) {\n el.addEventListener(\"keyup\", onKeyUp);\n}\nfunction removeKeyDown(el) {\n el.removeEventListener(\"keydown\", onKeyDown);\n}\nfunction removeKeyUp(el) {\n el.removeEventListener(\"keyup\", onKeyUp);\n}\nfunction add(el) {\n addKeyDown(el);\n addKeyUp(el);\n}\nfunction remove(el) {\n removeKeyDown(el);\n removeKeyUp(el);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","require('./dist/utility/utility.css');\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _makeupNextId = _interopRequireDefault(require(\"makeup-next-id\"));\nvar ExitEmitter = _interopRequireWildcard(require(\"makeup-exit-emitter\"));\nvar _makeupFocusables = _interopRequireDefault(require(\"makeup-focusables\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst defaultOptions = {\n alwaysDoFocusManagement: false,\n ariaControls: true,\n autoCollapse: false,\n collapseOnFocusOut: false,\n collapseOnMouseOut: false,\n collapseOnClickOut: false,\n collapseOnHostReFocus: false,\n contentSelector: \".expander__content\",\n expandedClass: null,\n expandOnClick: false,\n expandOnFocus: false,\n expandOnHover: false,\n focusManagement: null,\n hostSelector: \".expander__host\",\n simulateSpacebarClick: false,\n useAriaExpanded: true\n};\nfunction onHostKeyDown(e) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this._keyboardClickFlag = true;\n }\n // if host element does not naturally trigger a click event on spacebar, we can force one to trigger here.\n // careful! if host already triggers click events naturally, we end up with a \"double-click\".\n if (e.keyCode === 32 && this.options.simulateSpacebarClick === true) {\n this.hostEl.click();\n }\n}\nfunction onHostMouseDown() {\n this._mouseClickFlag = true;\n}\nfunction onHostClick() {\n this._expandWasKeyboardClickActivated = this._keyboardClickFlag;\n this._expandWasMouseClickActivated = this._mouseClickFlag;\n this._widgetHasKeyboardFocus = this._keyboardClickFlag;\n this.expanded = !this.expanded;\n}\nfunction onHostFocus() {\n this._expandWasFocusActivated = true;\n this.expanded = true;\n}\n\n// NOTE: collapseOnHostReFocus cannot be used when expandOnFocus is true\nfunction onHostReFocus() {\n if (this.expanded && this._widgetHasKeyboardFocus) {\n this.expanded = false;\n }\n}\nfunction onHostHover() {\n clearTimeout(this._mouseLeft);\n this._expandWasHoverActivated = true;\n this.expanded = true;\n}\nfunction onFocusExit() {\n this._widgetHasKeyboardFocus = false;\n this.expanded = false;\n}\nfunction onMouseLeave() {\n clearTimeout(this._mouseLeft);\n this._mouseLeft = setTimeout(() => {\n this.expanded = false;\n }, 300);\n}\nfunction _onDocumentClick(e) {\n if (this.el.contains(e.target) === false) {\n this.expanded = false;\n }\n}\nfunction _onDocumentTouchStart() {\n this.documentClick = true;\n}\nfunction _onDocumentTouchMove() {\n this.documentClick = false;\n}\nfunction _onDocumentTouchEnd(e) {\n if (this.documentClick === true) {\n this.documentClick = false;\n if (this.el.contains(e.target) === false) {\n this.expanded = false;\n }\n }\n}\nfunction manageFocus(focusManagement, contentEl) {\n if (focusManagement === \"content\") {\n contentEl.setAttribute(\"tabindex\", \"-1\");\n contentEl.focus();\n } else if (focusManagement === \"focusable\") {\n (0, _makeupFocusables.default)(contentEl)[0]?.focus();\n } else if (focusManagement === \"interactive\") {\n (0, _makeupFocusables.default)(contentEl, true)[0]?.focus();\n } else if (focusManagement !== null) {\n const el = contentEl.querySelector(`#${focusManagement}`);\n if (el) {\n el.focus();\n }\n }\n}\nclass _default {\n constructor(el, selectedOptions) {\n this.options = Object.assign({}, defaultOptions, selectedOptions);\n this.el = el;\n this.hostEl = el.querySelector(this.options.hostSelector); // the keyboard focusable host el\n this.contentEl = el.querySelector(this.options.contentSelector);\n ExitEmitter.addFocusExit(this.el);\n this._hostKeyDownListener = onHostKeyDown.bind(this);\n this._hostMouseDownListener = onHostMouseDown.bind(this);\n this._documentClickListener = _onDocumentClick.bind(this);\n this._documentTouchStartListener = _onDocumentTouchStart.bind(this);\n this._documentTouchMoveListener = _onDocumentTouchMove.bind(this);\n this._documentTouchEndListener = _onDocumentTouchEnd.bind(this);\n this._hostClickListener = onHostClick.bind(this);\n this._hostFocusListener = onHostFocus.bind(this);\n this._hostReFocusListener = onHostReFocus.bind(this);\n this._hostHoverListener = onHostHover.bind(this);\n this._focusExitListener = onFocusExit.bind(this);\n this._mouseLeaveListener = onMouseLeave.bind(this);\n if (this.options.useAriaExpanded === true) {\n const initialAriaExpanded = this.hostEl.getAttribute(\"aria-expanded\");\n this._expanded = initialAriaExpanded === \"true\";\n if (initialAriaExpanded === null) {\n this.hostEl.setAttribute(\"aria-expanded\", \"false\");\n }\n } else {\n this._expanded = false;\n }\n if (this.options.ariaControls === true) {\n // ensure the widget has an id\n (0, _makeupNextId.default)(this.el, \"expander\");\n this.contentEl.id = this.contentEl.id || `${this.el.id}-content`;\n this.hostEl.setAttribute(\"aria-controls\", this.contentEl.id);\n }\n this.expandOnClick = this.options.expandOnClick;\n this.expandOnFocus = this.options.expandOnFocus;\n this.expandOnHover = this.options.expandOnHover;\n this.collapseOnHostReFocus = this.options.collapseOnHostReFocus;\n if (this.options.autoCollapse === false) {\n this.collapseOnClickOut = this.options.collapseOnClickOut;\n this.collapseOnFocusOut = this.options.collapseOnFocusOut;\n this.collapseOnMouseOut = this.options.collapseOnMouseOut;\n }\n }\n set expandOnClick(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"keydown\", this._hostKeyDownListener);\n this.hostEl.addEventListener(\"mousedown\", this._hostMouseDownListener);\n this.hostEl.addEventListener(\"click\", this._hostClickListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnClickOut = true;\n this.collapseOnFocusOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"click\", this._hostClickListener);\n this.hostEl.removeEventListener(\"mousedown\", this._hostMouseDownListener);\n this.hostEl.removeEventListener(\"keydown\", this._hostKeyDownListener);\n }\n }\n set expandOnFocus(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"focus\", this._hostFocusListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnClickOut = true;\n this.collapseOnFocusOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"focus\", this._hostFocusListener);\n }\n }\n set collapseOnHostReFocus(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"focus\", this._hostReFocusListener);\n } else {\n this.hostEl.removeEventListener(\"focus\", this._hostReFocusListener);\n }\n }\n set expandOnHover(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"mouseenter\", this._hostHoverListener);\n this.contentEl.addEventListener(\"mouseenter\", this._hostHoverListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnMouseOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"mouseenter\", this._hostHoverListener);\n this.contentEl.removeEventListener(\"mouseenter\", this._hostHoverListener);\n }\n }\n set collapseOnClickOut(bool) {\n if (bool === true) {\n document.addEventListener(\"click\", this._documentClickListener);\n document.addEventListener(\"touchstart\", this._documentTouchStartListener);\n document.addEventListener(\"touchmove\", this._documentTouchMoveListener);\n document.addEventListener(\"touchend\", this._documentTouchEndListener);\n } else {\n document.removeEventListener(\"click\", this._documentClickListener);\n document.removeEventListener(\"touchstart\", this._documentTouchStartListener);\n document.removeEventListener(\"touchmove\", this._documentTouchMoveListener);\n document.removeEventListener(\"touchend\", this._documentTouchEndListener);\n }\n }\n set collapseOnFocusOut(bool) {\n if (bool === true) {\n this.el.addEventListener(\"focusExit\", this._focusExitListener);\n } else {\n this.el.removeEventListener(\"focusExit\", this._focusExitListener);\n }\n }\n set collapseOnMouseOut(bool) {\n if (bool === true) {\n this.el.addEventListener(\"mouseleave\", this._mouseLeaveListener);\n this.contentEl.addEventListener(\"mouseleave\", this._mouseLeaveListener);\n } else {\n this.el.removeEventListener(\"mouseleave\", this._mouseLeaveListener);\n this.contentEl.removeEventListener(\"mouseleave\", this._mouseLeaveListener);\n }\n }\n get expanded() {\n return this._expanded;\n }\n set expanded(bool) {\n if (bool === true && this.expanded === false) {\n if (this.options.useAriaExpanded === true) {\n this.hostEl.setAttribute(\"aria-expanded\", \"true\");\n }\n if (this.options.expandedClass) {\n this.el.classList.add(this.options.expandedClass);\n }\n if (this._expandWasKeyboardClickActivated || this._expandWasMouseClickActivated && this.options.alwaysDoFocusManagement) {\n manageFocus(this.options.focusManagement, this.contentEl);\n }\n this.el.dispatchEvent(new CustomEvent(\"expander-expand\", {\n bubbles: true,\n detail: this.contentEl\n }));\n }\n if (bool === false && this.expanded === true) {\n if (this.options.useAriaExpanded === true) {\n this.hostEl.setAttribute(\"aria-expanded\", \"false\");\n }\n if (this.options.expandedClass) {\n this.el.classList.remove(this.options.expandedClass);\n }\n this.el.dispatchEvent(new CustomEvent(\"expander-collapse\", {\n bubbles: true,\n detail: this.contentEl\n }));\n }\n this._expanded = bool;\n this._expandWasKeyboardClickActivated = false;\n this._expandWasMouseClickActivated = false;\n this._expandWasFocusActivated = false;\n this._expandWasHoverActivated = false;\n this._keyboardClickFlag = false;\n this._mouseClickFlag = false;\n }\n sleep() {\n if (this._destroyed !== true) {\n this.expandOnClick = false;\n this.expandOnFocus = false;\n this.expandOnHover = false;\n this.collapseOnClickOut = false;\n this.collapseOnFocusOut = false;\n this.collapseOnMouseOut = false;\n this.collapseOnHostReFocus = false;\n }\n }\n destroy() {\n this.sleep();\n this._destroyed = true;\n this._hostKeyDownListener = null;\n this._hostMouseDownListener = null;\n this._documentClickListener = null;\n this._documentTouchStartListener = null;\n this._documentTouchMoveListener = null;\n this._documentTouchEndListener = null;\n this._hostClickListener = null;\n this._hostFocusListener = null;\n this._hostReFocusListener = null;\n this._hostHoverListener = null;\n this._focusExitListener = null;\n this._mouseLeaveListener = null;\n this._widgetHasKeyboardFocus = null;\n }\n}\nexports.default = _default;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createLinear = createLinear;\nvar KeyEmitter = _interopRequireWildcard(require(\"makeup-key-emitter\"));\nvar ExitEmitter = _interopRequireWildcard(require(\"makeup-exit-emitter\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nconst defaultOptions = {\n axis: \"both\",\n autoInit: \"interactive\",\n autoReset: \"current\",\n ignoreByDelegateSelector: null,\n wrap: false\n};\nfunction isItemNavigable(el) {\n return !el.hidden && el.getAttribute(\"aria-disabled\") !== \"true\";\n}\nfunction isIndexNavigable(items, index) {\n return index >= 0 && index < items.length ? isItemNavigable(items[index]) : false;\n}\nfunction findNavigableItems(items) {\n return items.filter(isItemNavigable);\n}\nfunction findFirstNavigableIndex(items) {\n return items.findIndex(item => isItemNavigable(item));\n}\nfunction findLastNavigableIndex(items) {\n // todo: at(-1) is more performant than reverse(), but Babel is not transpiling it\n return items.indexOf(findNavigableItems(items).reverse()[0]);\n}\nfunction findIndexByAttribute(items, attribute, value) {\n return items.findIndex(item => isItemNavigable(item) && item.getAttribute(attribute) === value);\n}\nfunction findFirstNavigableAriaCheckedIndex(items) {\n return findIndexByAttribute(items, \"aria-checked\", \"true\");\n}\nfunction findFirstNavigableAriaSelectedIndex(items) {\n return findIndexByAttribute(items, \"aria-selected\", \"true\");\n}\nfunction findIgnoredByDelegateItems(el, options) {\n return options.ignoreByDelegateSelector !== null ? [...el.querySelectorAll(options.ignoreByDelegateSelector)] : [];\n}\nfunction findPreviousNavigableIndex(items, index, wrap) {\n let previousNavigableIndex = -1;\n if (index === null || atStart(items, index)) {\n if (wrap === true) {\n previousNavigableIndex = findLastNavigableIndex(items);\n }\n } else {\n let i = index;\n while (--i >= 0) {\n if (isItemNavigable(items[i])) {\n previousNavigableIndex = i;\n break;\n }\n }\n }\n return previousNavigableIndex;\n}\nfunction findNextNavigableIndex(items, index, wrap) {\n let nextNavigableIndex = -1;\n if (index === null) {\n nextNavigableIndex = findFirstNavigableIndex(items);\n } else if (atEnd(items, index)) {\n if (wrap === true) {\n nextNavigableIndex = findFirstNavigableIndex(items);\n }\n } else {\n let i = index;\n while (++i < items.length) {\n if (isItemNavigable(items[i])) {\n nextNavigableIndex = i;\n break;\n }\n }\n }\n return nextNavigableIndex;\n}\n\n// returning -1 means not found\nfunction findIndexPositionByType(typeOrNum, items, currentIndex) {\n let index = -1;\n switch (typeOrNum) {\n case \"none\":\n index = null;\n break;\n case \"current\":\n index = currentIndex;\n break;\n case \"interactive\":\n index = findFirstNavigableIndex(items);\n break;\n case \"ariaChecked\":\n index = findFirstNavigableAriaCheckedIndex(items);\n break;\n case \"ariaSelected\":\n index = findFirstNavigableAriaSelectedIndex(items);\n break;\n case \"ariaSelectedOrInteractive\":\n index = findFirstNavigableAriaSelectedIndex(items);\n index = index === -1 ? findFirstNavigableIndex(items) : index;\n break;\n default:\n index = typeof typeOrNum === \"number\" || typeOrNum === null ? typeOrNum : -1;\n }\n return index;\n}\nfunction atStart(items, index) {\n return index === findFirstNavigableIndex(items);\n}\nfunction atEnd(items, index) {\n return index === findLastNavigableIndex(items);\n}\nfunction onKeyPrev(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findPreviousNavigableIndex(this.items, this.index, this.options.wrap);\n }\n}\nfunction onKeyNext(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findNextNavigableIndex(this.items, this.index, this.options.wrap);\n }\n}\nfunction onClick(e) {\n const itemIndex = this.indexOf(e.target.closest(this._itemSelector));\n if (isIndexNavigable(this.items, itemIndex)) {\n this.index = itemIndex;\n }\n}\nfunction onKeyHome(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findFirstNavigableIndex(this.items);\n }\n}\nfunction onKeyEnd(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findLastNavigableIndex(this.items);\n }\n}\nfunction onFocusExit() {\n if (this.options.autoReset !== null) {\n this.reset();\n }\n}\nfunction onMutation(e) {\n const fromIndex = this.index;\n let toIndex = this.index;\n // https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord\n const {\n addedNodes,\n attributeName,\n removedNodes,\n target,\n type\n } = e[0];\n if (type === \"attributes\") {\n if (target === this.currentItem) {\n if (attributeName === \"aria-disabled\") {\n // current item was disabled - keep it as current index (until a keyboard navigation happens)\n toIndex = this.index;\n } else if (attributeName === \"hidden\") {\n // current item was hidden and focus is lost - reset index to first interactive element\n toIndex = findFirstNavigableIndex(this.items);\n }\n } else {\n toIndex = this.index;\n }\n } else if (type === \"childList\") {\n if (removedNodes.length > 0 && [...removedNodes].includes(this._cachedElement)) {\n // current item was removed and focus is lost - reset index to first interactive element\n toIndex = findFirstNavigableIndex(this.items);\n } else if (removedNodes.length > 0 || addedNodes.length > 0) {\n // nodes were added and/or removed - keep current item and resync its index\n toIndex = this.indexOf(this._cachedElement);\n }\n }\n this._index = toIndex;\n this._el.dispatchEvent(new CustomEvent(\"navigationModelMutation\", {\n bubbles: false,\n detail: {\n fromIndex,\n toIndex\n }\n }));\n}\nclass NavigationModel {\n /**\n * @param {HTMLElement} el\n * @param {string} itemSelector\n * @param {typeof defaultOptions} selectedOptions\n */\n constructor(el, itemSelector, selectedOptions) {\n /** @member {typeof defaultOptions} */\n this.options = Object.assign({}, defaultOptions, selectedOptions);\n\n /** @member {HTMLElement} */\n this._el = el;\n\n /** @member {string} */\n this._itemSelector = itemSelector;\n }\n}\nclass LinearNavigationModel extends NavigationModel {\n /**\n * @param {HTMLElement} el\n * @param {string} itemSelector\n * @param {typeof defaultOptions} selectedOptions\n */\n constructor(el, itemSelector, selectedOptions) {\n super(el, itemSelector, selectedOptions);\n const fromIndex = this._index;\n const toIndex = findIndexPositionByType(this.options.autoInit, this.items, this.index);\n\n // do not use setter as it will trigger a change event\n this._index = toIndex;\n\n // always keep an element reference to the last item (for use in mutation observer)\n // todo: convert index to Tuple to store last/current values instead?\n this._cachedElement = this.items[toIndex];\n this._el.dispatchEvent(new CustomEvent(\"navigationModelInit\", {\n bubbles: false,\n detail: {\n firstInteractiveIndex: this.firstNavigableIndex,\n fromIndex,\n items: this.items,\n toIndex\n }\n }));\n }\n get currentItem() {\n return this.items[this.index];\n }\n\n // todo: code smell as getter abstracts that the query selector re-runs every time getter is accessed\n get items() {\n return [...this._el.querySelectorAll(`${this._itemSelector}`)];\n }\n get index() {\n return this._index;\n }\n\n /**\n * @param {number} toIndex - update index position in this.items (non-interactive indexes fail silently)\n */\n set index(toIndex) {\n if (toIndex === this.index) {\n return;\n } else if (!isIndexNavigable(this.items, toIndex)) {\n // no-op. throw exception?\n } else {\n const fromIndex = this.index;\n // update cached element reference (for use in mutation observer if DOM node gets removed)\n this._cachedElement = this.items[toIndex];\n this._index = toIndex;\n this._el.dispatchEvent(new CustomEvent(\"navigationModelChange\", {\n bubbles: false,\n detail: {\n fromIndex,\n toIndex\n }\n }));\n }\n }\n indexOf(element) {\n return this.items.indexOf(element);\n }\n reset() {\n const fromIndex = this.index;\n const toIndex = findIndexPositionByType(this.options.autoReset, this.items, this.index);\n if (toIndex !== fromIndex) {\n // do not use setter as it will trigger a navigationModelChange event\n this._index = toIndex;\n this._el.dispatchEvent(new CustomEvent(\"navigationModelReset\", {\n bubbles: false,\n detail: {\n fromIndex,\n toIndex\n }\n }));\n }\n }\n}\n\n// 2D Grid Model will go here\n\n/*\nclass GridModel extends NavigationModel {\n constructor(el, rowSelector, colSelector) {\n super();\n this._coords = null;\n }\n}\n*/\n\nclass NavigationEmitter {\n /**\n * @param {HTMLElement} el\n * @param {LinearNavigationModel} model\n */\n constructor(el, model) {\n this.model = model;\n this.el = el;\n this._keyPrevListener = onKeyPrev.bind(model);\n this._keyNextListener = onKeyNext.bind(model);\n this._keyHomeListener = onKeyHome.bind(model);\n this._keyEndListener = onKeyEnd.bind(model);\n this._clickListener = onClick.bind(model);\n this._focusExitListener = onFocusExit.bind(model);\n this._observer = new MutationObserver(onMutation.bind(model));\n KeyEmitter.addKeyDown(this.el);\n ExitEmitter.addFocusExit(this.el);\n const axis = model.options.axis;\n if (axis === \"both\" || axis === \"x\") {\n this.el.addEventListener(\"arrowLeftKeyDown\", this._keyPrevListener);\n this.el.addEventListener(\"arrowRightKeyDown\", this._keyNextListener);\n }\n if (axis === \"both\" || axis === \"y\") {\n this.el.addEventListener(\"arrowUpKeyDown\", this._keyPrevListener);\n this.el.addEventListener(\"arrowDownKeyDown\", this._keyNextListener);\n }\n this.el.addEventListener(\"homeKeyDown\", this._keyHomeListener);\n this.el.addEventListener(\"endKeyDown\", this._keyEndListener);\n this.el.addEventListener(\"click\", this._clickListener);\n this.el.addEventListener(\"focusExit\", this._focusExitListener);\n this._observer.observe(this.el, {\n childList: true,\n subtree: true,\n attributeFilter: [\"aria-disabled\", \"hidden\"],\n attributes: true,\n attributeOldValue: true\n });\n }\n destroy() {\n KeyEmitter.removeKeyDown(this.el);\n ExitEmitter.removeFocusExit(this.el);\n this.el.removeEventListener(\"arrowLeftKeyDown\", this._keyPrevListener);\n this.el.removeEventListener(\"arrowRightKeyDown\", this._keyNextListener);\n this.el.removeEventListener(\"arrowUpKeyDown\", this._keyPrevListener);\n this.el.removeEventListener(\"arrowDownKeyDown\", this._keyNextListener);\n this.el.removeEventListener(\"homeKeyDown\", this._keyHomeListener);\n this.el.removeEventListener(\"endKeyDown\", this._keyEndListener);\n this.el.removeEventListener(\"click\", this._clickListener);\n this.el.removeEventListener(\"focusExit\", this._focusExitListener);\n this._observer.disconnect();\n }\n}\nfunction createLinear(el, itemSelector, selectedOptions) {\n const model = new LinearNavigationModel(el, itemSelector, selectedOptions);\n return new NavigationEmitter(el, model);\n}\n\n/*\nstatic createGrid(el, rowSelector, colSelector, selectedOptions) {\n return null;\n}\n*/\n","require('./../dist/tokens/evo-core.css');\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _makeupExpander = _interopRequireDefault(require(\"makeup-expander\"));\nvar _makeupListbox = _interopRequireDefault(require(\"makeup-listbox\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst defaultOptions = {\n autoSelect: true,\n buttonLabelSelector: \".btn__text\",\n collapseTimeout: 150,\n customElementMode: false,\n listboxSelector: \".listbox-button__listbox\",\n floatingLabelSelector: \".btn__floating-label\",\n floatingLabelInline: \"btn__floating-label--inline\",\n floatingLabelAnimate: \"btn__floating-label--animate\",\n valueSelector: \".listbox-button__value\",\n buttonValueType: \"text\",\n // [\"text\", \"icon\", \"both\"],\n listboxOptionIconSelector: \".icon\",\n listboxOptionAriaLabelSelector: null\n};\nclass _default {\n constructor(widgetEl, selectedOptions) {\n this._options = Object.assign({}, defaultOptions, selectedOptions);\n this.el = widgetEl;\n this._buttonEl = this.el.querySelector(\"button\");\n this._buttonLabelEl = widgetEl.querySelector(this._options.buttonLabelSelector);\n this._buttonFloatingLabelEl = widgetEl.querySelector(this._options.floatingLabelSelector);\n this._buttonPrefix = this._buttonEl.dataset?.listboxButtonPrefix;\n this._listboxEl = this.el.querySelector(this._options.listboxSelector);\n this._onButtonFirstClickListener = _onButtonFirstClick.bind(this);\n this._onListboxClickListener = _onListboxClick.bind(this);\n this._onListboxKeyDownListener = _onListboxKeyDown.bind(this);\n this._onListboxInitListener = _onListboxInit.bind(this);\n this._onListboxChangeListener = _onListboxChange.bind(this);\n this._onMutationListener = _onMutation.bind(this);\n if (!this._options.customElementMode) {\n this._mutationObserver = new MutationObserver(this._onMutationListener);\n this._observeMutations();\n this._observeEvents();\n }\n this.listbox = new _makeupListbox.default(this._listboxEl, {\n activeDescendantClassName: \"listbox-button__option--active\",\n autoReset: \"ariaSelectedOrInteractive\",\n autoSelect: this._options.autoSelect,\n valueSelector: this._options.valueSelector\n });\n this._expander = new _makeupExpander.default(this.el, {\n alwaysDoFocusManagement: true,\n autoCollapse: true,\n collapseOnHostReFocus: true,\n contentSelector: this._options.listboxSelector,\n expandedClass: \"listbox-button--expanded\",\n expandOnClick: true,\n focusManagement: \"focusable\",\n hostSelector: \"button\"\n });\n this.el.classList.add(\"listbox-button--js\");\n if (this._buttonFloatingLabelEl) {\n if (!this._buttonLabelEl.innerText) {\n this._buttonFloatingLabelEl.classList.add(this._options.floatingLabelInline);\n }\n }\n }\n _observeMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.observe(this._buttonEl, {\n attributeFilter: [\"aria-expanded\"],\n attributes: true,\n childList: false,\n subtree: false\n });\n }\n }\n _unobserveMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.disconnect();\n }\n }\n _unobserveEvents() {\n this._buttonEl.removeEventListener(\"click\", this._onButtonFirstClickListener);\n this._listboxEl.removeEventListener(\"click\", this._onListboxClickListener);\n this._listboxEl.removeEventListener(\"keydown\", this._onListboxKeyDownListener);\n this._listboxEl.removeEventListener(\"makeup-listbox-init\", this._onListboxInitListener);\n this._listboxEl.removeEventListener(\"makeup-listbox-change\", this._onListboxChangeListener);\n }\n _observeEvents() {\n if (this._destroyed !== true) {\n this._buttonEl.addEventListener(\"click\", this._onButtonFirstClickListener, {\n once: true\n });\n this._listboxEl.addEventListener(\"click\", this._onListboxClickListener);\n this._listboxEl.addEventListener(\"keydown\", this._onListboxKeyDownListener);\n this._listboxEl.addEventListener(\"makeup-listbox-init\", this._onListboxInitListener);\n this._listboxEl.addEventListener(\"makeup-listbox-change\", this._onListboxChangeListener);\n }\n }\n collapse() {\n const widget = this;\n setTimeout(function () {\n widget._unobserveMutations();\n widget._expander.expanded = false;\n widget._observeMutations();\n widget._buttonEl.focus();\n }, this._options.collapseTimeout);\n }\n destroy() {\n this._destroyed = true;\n this._unobserveEvents();\n this._unobserveMutations();\n this._onButtonFirstClickListener = null;\n this._onListboxClickListener = null;\n this._onListboxKeyDownListener = null;\n this._onListboxInitListener = null;\n this._onListboxChangeListener = null;\n this._onMutationListener = null;\n }\n}\n\n// listbox element should be hidden in initial SSR markup (for progressive enhancement)\nexports.default = _default;\nfunction _onButtonFirstClick() {\n this.listbox.el.hidden = false;\n}\nfunction _onListboxKeyDown(e) {\n if (e.keyCode === 13 || e.keyCode === 27 || e.keyCode === 32) {\n this.collapse();\n }\n}\nfunction _onListboxClick(e) {\n if (e.target.closest(\"[role=option]\")) {\n this.collapse();\n }\n}\nfunction _onListboxInit(e) {\n this.el.dispatchEvent(new CustomEvent(\"makeup-listbox-button-init\", {\n detail: e.detail\n }));\n}\nfunction _onListboxChange(e) {\n const toValue = e.detail.optionValue;\n const {\n listboxOptionIconSelector,\n listboxOptionAriaLabelSelector,\n buttonValueType,\n floatingLabelAnimate,\n floatingLabelInline\n } = this._options;\n const icon = e.detail.el.querySelector(listboxOptionIconSelector).cloneNode(true);\n let btnContent = this._buttonPrefix ? `${this._buttonPrefix}${toValue}` : toValue;\n if (icon) {\n switch (buttonValueType) {\n case \"both\":\n btnContent = `${icon.outerHTML} ${btnContent}`;\n break;\n case \"icon\":\n this._buttonEl.setAttribute(\"aria-label\", btnContent);\n btnContent = icon.outerHTML;\n break;\n default:\n break;\n }\n }\n if (listboxOptionAriaLabelSelector) {\n const selectorText = e.detail.el.querySelector(listboxOptionAriaLabelSelector)?.innerText.trim();\n this._buttonEl.setAttribute(\"aria-label\", this._buttonPrefix ? `${this._buttonPrefix} ${selectorText}` : selectorText);\n }\n this._buttonLabelEl.innerHTML = btnContent;\n if (this._buttonFloatingLabelEl) {\n if (toValue) {\n this._buttonFloatingLabelEl.classList.add(floatingLabelAnimate);\n this._buttonFloatingLabelEl.classList.remove(floatingLabelInline);\n } else {\n this._buttonFloatingLabelEl.classList.add(floatingLabelInline);\n }\n }\n this.el.dispatchEvent(new CustomEvent(\"makeup-listbox-button-change\", {\n detail: e.detail\n }));\n}\nfunction _onMutation(mutationsList) {\n for (const mutation of mutationsList) {\n if (mutation.type === \"attributes\") {\n this.el.dispatchEvent(new CustomEvent(\"makeup-listbox-button-mutation\", {\n detail: {\n attributeName: mutation.attributeName\n }\n }));\n }\n }\n}\n","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.add = add;\nexports.remove = remove;\nfunction onKeyDown(e) {\n if (e.keyCode >= 32 && e.keyCode <= 40) {\n e.preventDefault();\n }\n}\nfunction add(el) {\n el.addEventListener(\"keydown\", onKeyDown);\n}\nfunction remove(el) {\n el.removeEventListener(\"keydown\", onKeyDown);\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\"use strict\";\n\nrequire(\"../../docs.css\");\nrequire(\"@ebay/skin/tokens\");\nrequire(\"@ebay/skin/global\");\nrequire(\"@ebay/skin/utility\");\nrequire(\"@ebay/skin/button\");\nrequire(\"@ebay/skin/listbox-button\");\nvar _makeupListboxButton = _interopRequireDefault(require(\"makeup-listbox-button\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\n// REQUIRE\n// const ListboxButton = require('makeup-listbox-button').default;\n\n// IMPORT\n\nconst widgets = [];\nconst log = e => console.log(e.type, e.detail);\nwindow.onload = function () {\n document.querySelectorAll(\".listbox-button\").forEach(function (el, i) {\n const hasCustomLabel = el.classList.contains(\"listbox-button-with-icon-label\");\n const hasIconText = el.classList.contains(\"listbox-button-with-iconText\");\n const hasIcon = el.classList.contains(\"listbox-button-with-icon\");\n let buttonValueType;\n if (hasIconText) {\n buttonValueType = \"both\";\n } else if (hasIcon || hasCustomLabel) {\n buttonValueType = \"icon\";\n } else {\n buttonValueType = \"text\";\n }\n const listboxOptionAriaLabelSelector = hasCustomLabel ? \".listbox-button__value span\" : null;\n el.addEventListener(\"makeup-listbox-button-init\", log);\n el.addEventListener(\"makeup-listbox-button-change\", log);\n el.addEventListener(\"makeup-listbox-button-mutation\", log);\n widgets.push(new _makeupListboxButton.default(el, {\n autoSelect: el.dataset.makeupAutoSelect === \"false\" ? false : true,\n buttonValueType,\n listboxOptionAriaLabelSelector\n }));\n });\n};"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/docs/ui/makeup-menu-button/index.min.js b/docs/ui/makeup-menu-button/index.min.js index 2ab744ab..6ef23f83 100644 --- a/docs/ui/makeup-menu-button/index.min.js +++ b/docs/ui/makeup-menu-button/index.min.js @@ -839,7 +839,8 @@ const defaultOptions = { expandOnHover: false, focusManagement: null, hostSelector: ".expander__host", - simulateSpacebarClick: false + simulateSpacebarClick: false, + useAriaExpanded: true }; function onHostKeyDown(e) { if (e.keyCode === 13 || e.keyCode === 32) { @@ -939,8 +940,14 @@ class _default { this._hostHoverListener = onHostHover.bind(this); this._focusExitListener = onFocusExit.bind(this); this._mouseLeaveListener = onMouseLeave.bind(this); - if (this.hostEl.getAttribute("aria-expanded") === null) { - this.hostEl.setAttribute("aria-expanded", "false"); + if (this.options.useAriaExpanded === true) { + const initialAriaExpanded = this.hostEl.getAttribute("aria-expanded"); + this._expanded = initialAriaExpanded === "true"; + if (initialAriaExpanded === null) { + this.hostEl.setAttribute("aria-expanded", "false"); + } + } else { + this._expanded = false; } if (this.options.ariaControls === true) { // ensure the widget has an id @@ -1033,11 +1040,13 @@ class _default { } } get expanded() { - return this.hostEl.getAttribute("aria-expanded") === "true"; + return this._expanded; } set expanded(bool) { if (bool === true && this.expanded === false) { - this.hostEl.setAttribute("aria-expanded", "true"); + if (this.options.useAriaExpanded === true) { + this.hostEl.setAttribute("aria-expanded", "true"); + } if (this.options.expandedClass) { this.el.classList.add(this.options.expandedClass); } @@ -1050,7 +1059,9 @@ class _default { })); } if (bool === false && this.expanded === true) { - this.hostEl.setAttribute("aria-expanded", "false"); + if (this.options.useAriaExpanded === true) { + this.hostEl.setAttribute("aria-expanded", "false"); + } if (this.options.expandedClass) { this.el.classList.remove(this.options.expandedClass); } @@ -1059,6 +1070,7 @@ class _default { detail: this.contentEl })); } + this._expanded = bool; this._expandWasKeyboardClickActivated = false; this._expandWasMouseClickActivated = false; this._expandWasFocusActivated = false; diff --git a/docs/ui/makeup-menu-button/index.min.js.map b/docs/ui/makeup-menu-button/index.min.js.map index be4a0d1e..5f0f579d 100644 --- a/docs/ui/makeup-menu-button/index.min.js.map +++ b/docs/ui/makeup-menu-button/index.min.js.map @@ -1 +1 @@ -{"version":3,"file":"makeup-menu-button/index.min.js","mappings":";;;;;;AAAA,mBAAO,CAAC,IAA0B;;;;;;;;;ACArB;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,oBAAoB;AACpB,uBAAuB;AACvB,2CAA2C,mBAAO,CAAC,IAAgB;AACnE,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC3EA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf,6CAA6C,mBAAO,CAAC,IAAwB;AAC7E,gDAAgD,mBAAO,CAAC,IAA4B;AACpF,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mEAAmE,UAAU;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;;;;;;;;AC9Ka;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,oBAAoB;AACpB,gDAAgD,mBAAO,CAAC,IAA2B;AACnF,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;ACvHA,mBAAO,CAAC,IAAgC;;;;;;;;;ACA3B;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,OAAO,EAAE,UAAU,EAAE,cAAc;;AAEpD;AACA;AACA;AACA,6BAA6B,IAAI,GAAG,mBAAmB;AACvD;AACA;AACA;;;;;;;;ACvCA,mBAAO,CAAC,IAAsB;AAC9B,mBAAO,CAAC,IAAuB;;;;;;;;ACD/B,mBAAO,CAAC,IAA0B;;;;;;;;;;ACAlC;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;ACnCa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,WAAW;AACX,kBAAkB;AAClB,gBAAgB;AAChB,cAAc;AACd,qBAAqB;AACrB,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,IAAI,KAAK,aAAa;AAC1F;AACA;AACA,SAAS;AACT;AACA;AACA,uDAAuD,aAAa;AACpE;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrEa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf,6CAA6C,mBAAO,CAAC,IAAiB;AACtE,yCAAyC,mBAAO,CAAC,IAAa;AAC9D,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,2CAA2C,oBAAoB,EAAE,KAAK;AACtE;AACA;AACA;AACA,wBAAwB,gBAAgB,QAAQ,WAAW;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,oBAAoB,EAAE,aAAa;AACzG;AACA;AACA;;;;;;;;;;ACvJA;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf,2CAA2C,mBAAO,CAAC,IAAgB;AACnE,0CAA0C,mBAAO,CAAC,GAAqB;AACvE,+CAA+C,mBAAO,CAAC,IAAmB;AAC1E,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ,2CAA2C,gBAAgB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,WAAW;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;;;;;;;;;AC1RF;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,oBAAoB;AACpB,yCAAyC,mBAAO,CAAC,IAAoB;AACrE,0CAA0C,mBAAO,CAAC,GAAqB;AACvE,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,QAAQ;AACrB,aAAa,uBAAuB;AACpC;AACA;AACA,iBAAiB,uBAAuB;AACxC,mCAAmC;;AAEnC,iBAAiB,aAAa;AAC9B;;AAEA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,QAAQ;AACrB,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,4CAA4C,mBAAmB;AAC/D;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;ACjXA,mBAAO,CAAC,IAA+B;;;;;;;;ACAvC,mBAAO,CAAC,IAAoC;;;;;;;;;;ACA5C;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,WAAW;AACX,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;UCjBA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;;;;ACNa;;AAEb,mBAAO,CAAC,IAAgB;AACxB,mBAAO,CAAC,IAAmB;AAC3B,mBAAO,CAAC,IAAmB;AAC3B,mBAAO,CAAC,GAAmB;AAC3B,mBAAO,CAAC,IAAwB;AAChC,+CAA+C,mBAAO,CAAC,IAAoB;AAC3E,qCAAqC,iCAAiC;AACtE;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH,E","sources":["webpack://root/./node_modules/@ebay/skin/button.js","webpack://root/./packages/core/makeup-exit-emitter/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/dist/global/global.css?e001","webpack://root/./node_modules/@ebay/skin/dist/tokens/evo-light.css?9c33","webpack://root/./node_modules/@ebay/skin/dist/menu-button/menu-button.css?7300","webpack://root/./packages/ui/makeup-menu/dist/cjs/index.js","webpack://root/./packages/core/makeup-roving-tabindex/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/tokens/evo-light.js","webpack://root/./packages/core/makeup-next-id/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/tokens.js","webpack://root/./node_modules/@ebay/skin/global.js","webpack://root/./docs/docs.css?378e","webpack://root/./packages/core/makeup-focusables/dist/cjs/index.js","webpack://root/./packages/core/makeup-key-emitter/dist/cjs/index.js","webpack://root/./packages/ui/makeup-menu-button/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/dist/button/button.css?9a44","webpack://root/./packages/core/makeup-expander/dist/cjs/index.js","webpack://root/./packages/core/makeup-navigation-emitter/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/tokens/evo-core.js","webpack://root/./node_modules/@ebay/skin/menu-button.js","webpack://root/./node_modules/@ebay/skin/dist/tokens/evo-core.css?7a96","webpack://root/./packages/core/makeup-prevent-scroll-keys/dist/cjs/index.js","webpack://root/webpack/bootstrap","webpack://root/webpack/runtime/make namespace object","webpack://root/./docs/ui/makeup-menu-button/index.compiled.js"],"sourcesContent":["require('./dist/button/button.css');\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.addFocusExit = addFocusExit;\nexports.removeFocusExit = removeFocusExit;\nvar _makeupNextId = _interopRequireDefault(require(\"makeup-next-id\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst focusExitEmitters = {};\nfunction doFocusExit(el, fromElement, toElement) {\n el.dispatchEvent(new CustomEvent(\"focusExit\", {\n detail: {\n fromElement,\n toElement\n },\n bubbles: false // mirror the native mouseleave event\n }));\n}\nfunction onDocumentFocusIn(e) {\n const newFocusElement = e.target;\n const targetIsDescendant = this.el.contains(newFocusElement);\n\n // if focus has moved to a focusable descendant\n if (targetIsDescendant === true) {\n // set the target as the currently focussed element\n this.currentFocusElement = newFocusElement;\n } else {\n // else focus has not gone to a focusable descendant\n window.removeEventListener(\"blur\", this.onWindowBlurListener);\n document.removeEventListener(\"focusin\", this.onDocumentFocusInListener);\n doFocusExit(this.el, this.currentFocusElement, newFocusElement);\n this.currentFocusElement = null;\n }\n}\nfunction onWindowBlur() {\n doFocusExit(this.el, this.currentFocusElement, undefined);\n}\nfunction onWidgetFocusIn() {\n // listen for focus moving to anywhere in document\n // note that mouse click on buttons, checkboxes and radios does not trigger focus events in all browsers!\n document.addEventListener(\"focusin\", this.onDocumentFocusInListener);\n // listen for focus leaving the window\n window.addEventListener(\"blur\", this.onWindowBlurListener);\n}\nclass FocusExitEmitter {\n constructor(el) {\n this.el = el;\n this.currentFocusElement = null;\n this.onWidgetFocusInListener = onWidgetFocusIn.bind(this);\n this.onDocumentFocusInListener = onDocumentFocusIn.bind(this);\n this.onWindowBlurListener = onWindowBlur.bind(this);\n this.el.addEventListener(\"focusin\", this.onWidgetFocusInListener);\n }\n removeEventListeners() {\n window.removeEventListener(\"blur\", this.onWindowBlurListener);\n document.removeEventListener(\"focusin\", this.onDocumentFocusInListener);\n this.el.removeEventListener(\"focusin\", this.onWidgetFocusInListener);\n }\n}\nfunction addFocusExit(el) {\n let exitEmitter = null;\n (0, _makeupNextId.default)(el);\n if (!focusExitEmitters[el.id]) {\n exitEmitter = new FocusExitEmitter(el);\n focusExitEmitters[el.id] = exitEmitter;\n }\n return exitEmitter;\n}\nfunction removeFocusExit(el) {\n const exitEmitter = focusExitEmitters[el.id];\n if (exitEmitter) {\n exitEmitter.removeEventListeners();\n delete focusExitEmitters[el.id];\n }\n}\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar RovingTabIndex = _interopRequireWildcard(require(\"makeup-roving-tabindex\"));\nvar PreventScrollKeys = _interopRequireWildcard(require(\"makeup-prevent-scroll-keys\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nconst defaultOptions = {\n customElementMode: false,\n autoInit: \"interactive\",\n autoReset: \"interactive\"\n};\nclass _default {\n constructor(widgetEl, selectedOptions) {\n this._options = Object.assign({}, defaultOptions, selectedOptions);\n this.el = widgetEl;\n this._rovingTabIndex = RovingTabIndex.createLinear(this.el, \"[role^=menuitem]\", {\n autoInit: this._options.autoInit,\n autoReset: this._options.autoReset\n });\n PreventScrollKeys.add(this.el);\n this._onKeyDownListener = _onKeyDown.bind(this);\n this._onClickListener = _onClick.bind(this);\n this._onMutationListener = _onMutation.bind(this);\n this.el.classList.add(\"menu--js\");\n if (!this._options.customElementMode) {\n this._mutationObserver = new MutationObserver(this._onMutationListener);\n this._observeMutations();\n this._observeEvents();\n }\n }\n select(index) {\n this._unobserveMutations();\n const el = this.items[index];\n switch (el.getAttribute(\"role\")) {\n case \"menuitemcheckbox\":\n _selectMenuItemCheckbox(this.el, el);\n break;\n case \"menuitemradio\":\n _selectMenuItemRadio(this.el, el);\n break;\n default:\n _selectMenuItem(this.el, el);\n break;\n }\n this._observeMutations();\n }\n get items() {\n return this._rovingTabIndex.items;\n }\n get radioGroupNames() {\n const els = [...this.el.querySelectorAll(\"[role=menuitemradio][data-makeup-group]\")];\n const groupNames = [...new Set(els.map(el => el.dataset.makeupGroup))];\n return groupNames;\n }\n get checkboxGroupNames() {\n const els = [...this.el.querySelectorAll(\"[role=menuitemcheckbox][data-makeup-group]\")];\n const groupNames = [...new Set(els.map(el => el.dataset.makeupGroup))];\n return groupNames;\n }\n _observeMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.observe(this.el, {\n attributeFilter: [\"aria-checked\", \"aria-disabled\"],\n attributes: true,\n childList: true,\n subtree: true\n });\n }\n }\n _unobserveMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.disconnect();\n }\n }\n _observeEvents() {\n if (this._destroyed !== true) {\n this.el.addEventListener(\"keydown\", this._onKeyDownListener);\n this.el.addEventListener(\"click\", this._onClickListener);\n }\n }\n _unobserveEvents() {\n this.el.removeEventListener(\"keydown\", this._onKeyDownListener);\n this.el.removeEventListener(\"click\", this._onClickListener);\n }\n destroy() {\n this._destroyed = true;\n this._unobserveMutations();\n this._unobserveEvents();\n this._onKeyDownListener = null;\n this._onClickListener = null;\n this._onMutationListener = null;\n }\n}\nexports.default = _default;\nfunction _onMutation(mutationsList) {\n for (const mutation of mutationsList) {\n if (mutation.type === \"attributes\") {\n this.el.dispatchEvent(new CustomEvent(\"makeup-menu-mutation\", {\n detail: {\n attributeName: mutation.attributeName\n }\n }));\n }\n }\n}\nfunction _onKeyDown(e) {\n this._unobserveMutations();\n if (e.keyCode === 13) {\n e.preventDefault();\n }\n if (e.keyCode === 13 || e.keyCode === 32) {\n this.select(Array.from(this.items).indexOf(e.target));\n }\n this._observeMutations();\n}\nfunction _onClick(e) {\n // unlike the keyDown event, the click event target can be a child element of the menuitem\n // e.g.
Item 1
\n const menuItemEl = e.target.closest(\"[role^=menuitem]\");\n const index = this.items.indexOf(menuItemEl);\n if (index !== -1) {\n this.select(index);\n }\n}\nfunction _selectMenuItem(widgetEl, menuItemEl) {\n widgetEl.dispatchEvent(new CustomEvent(\"makeup-menu-select\", {\n detail: {\n el: menuItemEl,\n value: menuItemEl.innerText\n }\n }));\n}\nfunction _selectMenuItemCheckbox(widgetEl, menuItemEl) {\n if (menuItemEl.getAttribute(\"aria-disabled\") !== \"true\") {\n const groupName = menuItemEl.dataset.makeupGroup;\n menuItemEl.setAttribute(\"aria-checked\", menuItemEl.getAttribute(\"aria-checked\") === \"true\" ? \"false\" : \"true\");\n widgetEl.dispatchEvent(new CustomEvent(\"makeup-menu-change\", {\n detail: {\n el: menuItemEl,\n checked: menuItemEl.getAttribute(\"aria-checked\"),\n group: groupName,\n value: menuItemEl.innerText\n }\n }));\n }\n}\nfunction _selectMenuItemRadio(widgetEl, menuItemEl) {\n if (menuItemEl.getAttribute(\"aria-disabled\") !== \"true\") {\n const groupName = menuItemEl.dataset.makeupGroup;\n const checkedEl = widgetEl.querySelector(`[data-makeup-group=${groupName}][aria-checked=true]`);\n if (!checkedEl) {\n menuItemEl.setAttribute(\"aria-checked\", \"true\");\n widgetEl.dispatchEvent(new CustomEvent(\"makeup-menu-change\", {\n detail: {\n el: menuItemEl,\n group: groupName,\n value: menuItemEl.innerText\n }\n }));\n } else if (checkedEl !== menuItemEl) {\n checkedEl.setAttribute(\"aria-checked\", \"false\");\n menuItemEl.setAttribute(\"aria-checked\", \"true\");\n widgetEl.dispatchEvent(new CustomEvent(\"makeup-menu-change\", {\n detail: {\n el: menuItemEl,\n group: groupName,\n value: menuItemEl.innerText\n }\n }));\n }\n }\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createLinear = createLinear;\nvar NavigationEmitter = _interopRequireWildcard(require(\"makeup-navigation-emitter\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nconst defaultOptions = {\n autoInit: \"interactive\",\n autoReset: \"current\",\n wrap: false,\n axis: \"both\"\n};\nfunction refreshTabindex(items, focusIndex) {\n items.forEach(function (el, i) {\n el.setAttribute(\"tabindex\", i === focusIndex ? \"0\" : \"-1\");\n });\n}\nfunction onModelInit(e) {\n refreshTabindex(e.detail.items, e.detail.toIndex);\n this._el.dispatchEvent(new CustomEvent(\"rovingTabindexInit\", {\n detail: e.detail\n }));\n}\nfunction onModelChange(e) {\n const items = this.items;\n const fromItem = items[e.detail.fromIndex];\n const toItem = items[e.detail.toIndex];\n if (fromItem) {\n fromItem.setAttribute(\"tabindex\", \"-1\");\n }\n if (toItem) {\n toItem.setAttribute(\"tabindex\", \"0\");\n toItem.focus();\n }\n this._el.dispatchEvent(new CustomEvent(\"rovingTabindexChange\", {\n detail: e.detail\n }));\n}\nfunction onModelReset(e) {\n refreshTabindex(this.items, e.detail.toIndex);\n this._el.dispatchEvent(new CustomEvent(\"rovingTabindexReset\", {\n detail: e.detail\n }));\n}\nfunction onModelMutation(e) {\n refreshTabindex(this.items, e.detail.toIndex);\n this._el.dispatchEvent(new CustomEvent(\"rovingTabindexMutation\", {\n detail: e.detail\n }));\n}\nclass RovingTabindex {\n constructor(el) {\n this._el = el;\n this._onMutationListener = onModelMutation.bind(this);\n this._onChangeListener = onModelChange.bind(this);\n this._onInitListener = onModelInit.bind(this);\n this._onResetListener = onModelReset.bind(this);\n this._el.addEventListener(\"navigationModelMutation\", this._onMutationListener);\n this._el.addEventListener(\"navigationModelChange\", this._onChangeListener);\n this._el.addEventListener(\"navigationModelInit\", this._onInitListener);\n this._el.addEventListener(\"navigationModelReset\", this._onResetListener);\n }\n destroy() {\n this._el.removeEventListener(\"navigationModelMutation\", this._onMutationListener);\n this._el.removeEventListener(\"navigationModelChange\", this._onChangeListener);\n this._el.removeEventListener(\"navigationModelInit\", this._onInitListener);\n this._el.removeEventListener(\"navigationModelReset\", this._onResetListener);\n }\n}\nclass LinearRovingTabindex extends RovingTabindex {\n constructor(el, itemSelector, selectedOptions) {\n super(el);\n this._options = Object.assign({}, defaultOptions, selectedOptions);\n this._itemSelector = itemSelector;\n\n // todo: options.index is deprecated. Remove support in future release.\n this._navigationEmitter = NavigationEmitter.createLinear(el, itemSelector, {\n autoInit: this._options.index !== undefined ? this._options.index : this._options.autoInit,\n autoReset: this._options.autoReset,\n wrap: this._options.wrap,\n axis: this._options.axis\n });\n }\n get index() {\n return this._navigationEmitter.model.index;\n }\n set index(newIndex) {\n this._navigationEmitter.model.index = newIndex;\n }\n set wrap(newWrap) {\n this._navigationEmitter.model.options.wrap = newWrap;\n }\n get currentItem() {\n return this._navigationEmitter.model.currentItem;\n }\n get items() {\n return this._navigationEmitter.model.items;\n }\n reset() {\n this._navigationEmitter.model.reset();\n }\n destroy() {\n super.destroy();\n this._navigationEmitter.destroy();\n }\n}\n\n/*\nclass GridRovingTabindex extends RovingTabindex {\n constructor(el, rowSelector, cellSelector, selectedOptions) {\n super(el);\n }\n}\n*/\n\nfunction createLinear(el, itemSelector, selectedOptions) {\n return new LinearRovingTabindex(el, itemSelector, selectedOptions);\n}\n","require('./../dist/tokens/evo-light.css');\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nconst sequenceMap = {};\nconst defaultPrefix = \"nid\";\nconst randomPortion = createRandomPortion(3);\nfunction randomNumber(max) {\n return Math.floor(Math.random() * max);\n}\nfunction createRandomPortion(size) {\n const letters = \"abcdefghijklmnopqrstuvwxyz\";\n const digits = \"0123456789\";\n const allChars = letters + digits;\n\n // to ensure a valid HTML ID (when prefix is empty), first character must be a letter\n let portion = letters[randomNumber(25)];\n\n // start iterating from 1, as we already have our first char\n for (let i = 1; i < size; i++) {\n portion += allChars[randomNumber(35)];\n }\n return portion;\n}\nfunction _default(el) {\n let prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultPrefix;\n const separator = prefix === \"\" ? \"\" : \"-\";\n\n // join first prefix with random portion to create key\n const key = `${prefix}${separator}${randomPortion}`;\n\n // initialise key in sequence map if necessary\n sequenceMap[key] = sequenceMap[key] || 0;\n if (!el.id) {\n el.setAttribute(\"id\", `${key}-${sequenceMap[key]++}`);\n }\n return el.id;\n}\n","require('./tokens/evo-core.js');\nrequire('./tokens/evo-light.js');\n","require('./dist/global/global.css');\n","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nconst focusableElList = [\"a[href]\", \"area[href]\", \"button:not([disabled])\", \"embed\", \"iframe\", \"input:not([disabled])\", \"object\", \"select:not([disabled])\", \"textarea:not([disabled])\", \"*[tabindex]\", \"*[contenteditable]\"];\nconst focusableElSelector = focusableElList.join();\nfunction _default(el) {\n let keyboardOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let callback = arguments.length > 2 ? arguments[2] : undefined;\n if (callback) {\n const request = requestAnimationFrame(() => {\n callback(getFocusables(el, keyboardOnly));\n });\n return () => {\n cancelAnimationFrame(request);\n };\n }\n return getFocusables(el, keyboardOnly);\n}\nfunction getFocusables(el) {\n let keyboardOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let focusableEls = Array.prototype.slice.call(el.querySelectorAll(focusableElSelector));\n\n // filter out elements with display: none or nested in a display: none parent\n focusableEls = focusableEls.filter(function (focusableEl) {\n return !!(focusableEl.offsetWidth || focusableEl.offsetHeight || focusableEl.getClientRects().length);\n });\n if (keyboardOnly === true) {\n focusableEls = focusableEls.filter(function (focusableEl) {\n return focusableEl.getAttribute(\"tabindex\") !== \"-1\";\n });\n }\n return focusableEls;\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.add = add;\nexports.addKeyDown = addKeyDown;\nexports.addKeyUp = addKeyUp;\nexports.remove = remove;\nexports.removeKeyDown = removeKeyDown;\nexports.removeKeyUp = removeKeyUp;\nfunction uncapitalizeFirstLetter(str) {\n return str.charAt(0).toLowerCase() + str.slice(1);\n}\nfunction onKeyDownOrUp(evt, el, keyEventType) {\n if (!evt.shiftKey) {\n const key = evt.key;\n switch (key) {\n case \"Enter\":\n case \"Escape\":\n case \"PageUp\":\n case \"PageDown\":\n case \"End\":\n case \"Home\":\n case \"ArrowLeft\":\n case \"ArrowUp\":\n case \"ArrowRight\":\n case \"ArrowDown\":\n el.dispatchEvent(new CustomEvent(uncapitalizeFirstLetter(`${key}Key${keyEventType}`), {\n detail: evt,\n bubbles: true\n }));\n break;\n case \" \":\n el.dispatchEvent(new CustomEvent(`spacebarKey${keyEventType}`, {\n detail: evt,\n bubbles: true\n }));\n break;\n default:\n return;\n }\n }\n}\nfunction onKeyDown(e) {\n onKeyDownOrUp(e, this, \"Down\");\n}\nfunction onKeyUp(e) {\n onKeyDownOrUp(e, this, \"Up\");\n}\nfunction addKeyDown(el) {\n el.addEventListener(\"keydown\", onKeyDown);\n}\nfunction addKeyUp(el) {\n el.addEventListener(\"keyup\", onKeyUp);\n}\nfunction removeKeyDown(el) {\n el.removeEventListener(\"keydown\", onKeyDown);\n}\nfunction removeKeyUp(el) {\n el.removeEventListener(\"keyup\", onKeyUp);\n}\nfunction add(el) {\n addKeyDown(el);\n addKeyUp(el);\n}\nfunction remove(el) {\n removeKeyDown(el);\n removeKeyUp(el);\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _makeupExpander = _interopRequireDefault(require(\"makeup-expander\"));\nvar _makeupMenu = _interopRequireDefault(require(\"makeup-menu\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst defaultOptions = {\n customElementMode: false,\n expandedClass: \"menu-button--expanded\",\n menuSelector: \".menu-button__menu\",\n buttonTextSelector: `.btn__text`,\n buttonValueType: \"text\",\n // [\"text\", \"icon\", \"both\"],\n menuItemIconSelector: \".icon\",\n menuItemButtonAriaLabelSelector: null\n};\nclass _default {\n constructor(widgetEl, selectedOptions) {\n this._options = Object.assign({}, defaultOptions, selectedOptions);\n this.el = widgetEl;\n this._buttonEl = widgetEl.querySelector(\"button\");\n this._buttonEl.setAttribute(\"aria-haspopup\", \"true\");\n this.menu = new _makeupMenu.default(widgetEl.querySelector(this._options.menuSelector), {\n autoReset: \"interactive\"\n });\n this._buttonPrefix = this._buttonEl.dataset?.makeupMenuButtonPrefix;\n this._buttonTextEl = this._buttonEl.querySelector(this._options.buttonTextSelector);\n this._expander = new _makeupExpander.default(widgetEl, {\n alwaysDoFocusManagement: true,\n autoCollapse: true,\n collapseOnHostReFocus: true,\n contentSelector: this._options.menuSelector,\n expandedClass: this._options.expandedClass,\n expandOnClick: true,\n focusManagement: \"focusable\",\n hostSelector: \"button\"\n });\n this._onButtonFirstClickListener = _onButtonFirstClick.bind(this);\n this._onMenuKeyDownListener = _onMenuKeyDown.bind(this);\n this._onMenuItemSelectListener = _onMenuItemSelect.bind(this);\n this._onMutationListener = _onMutation.bind(this);\n this.el.classList.add(\"menu-button--js\");\n if (!this._options.customElementMode) {\n this._mutationObserver = new MutationObserver(this._onMutationListener);\n this._observeMutations();\n this._observeEvents();\n }\n }\n _observeMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.observe(this.el, {\n attributeFilter: [\"aria-expanded\", \"disabled\"],\n attributes: true,\n childList: false,\n subtree: false\n });\n }\n }\n _unobserveMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.disconnect();\n }\n }\n _observeEvents() {\n if (this._destroyed !== true) {\n this._buttonEl.addEventListener(\"click\", this._onButtonFirstClickListener, {\n once: true\n });\n this.menu.el.addEventListener(\"keydown\", this._onMenuKeyDownListener);\n this.menu.el.addEventListener(\"makeup-menu-select\", this._onMenuItemSelectListener);\n this.menu.el.addEventListener(\"makeup-menu-change\", this._onMenuItemSelectListener);\n }\n }\n _unobserveEvents() {\n this._buttonEl.removeEventListener(\"click\", this._onButtonFirstClickListener);\n this.menu.el.removeEventListener(\"keydown\", this._onMenuKeyDownListener);\n this.menu.el.removeEventListener(\"makeup-menu-select\", this._onMenuItemSelectListener);\n this.menu.el.removeEventListener(\"makeup-menu-change\", this._onMenuItemSelectListener);\n }\n destroy() {\n this._destroyed = true;\n this._unobserveMutations();\n this._unobserveEvents();\n this._onButtonFirstClickListener = null;\n this._onMenuKeyDownListener = null;\n this._onMenuItemSelectListener = null;\n this._onMutationListener = null;\n }\n}\nexports.default = _default;\nfunction _onMutation(mutationsList) {\n for (const mutation of mutationsList) {\n if (mutation.type === \"attributes\") {\n this.el.dispatchEvent(new CustomEvent(\"makeup-menu-button-mutation\", {\n detail: {\n attributeName: mutation.attributeName\n }\n }));\n }\n }\n}\nfunction _onButtonFirstClick() {\n this.menu.el.hidden = false;\n}\nfunction _onMenuKeyDown(e) {\n if (e.keyCode === 27) {\n this._expander.expanded = false;\n this._buttonEl.focus();\n }\n}\nfunction _onMenuItemSelect(e) {\n const widget = this;\n const {\n el\n } = e.detail;\n setTimeout(function () {\n widget._expander.expanded = false;\n widget._buttonEl.focus();\n }, 150);\n if (el.getAttribute(\"role\") !== \"menuitemradio\") {\n return;\n }\n const {\n menuItemIconSelector,\n menuItemButtonAriaLabelSelector,\n buttonValueType\n } = this._options;\n const icon = el.querySelector(menuItemIconSelector).cloneNode(true);\n const text = el.innerText.trim();\n let btnContent = this._buttonPrefix ? `${this._buttonPrefix} ${text}` : text;\n if (icon) {\n switch (buttonValueType) {\n case \"both\":\n btnContent = `${icon.outerHTML} ${btnContent}`;\n break;\n case \"icon\":\n this._buttonEl.setAttribute(\"aria-label\", btnContent);\n btnContent = icon.outerHTML;\n break;\n default:\n break;\n }\n }\n if (menuItemButtonAriaLabelSelector) {\n const selectorText = el.querySelector(menuItemButtonAriaLabelSelector)?.innerText.trim();\n this._buttonEl.setAttribute(\"aria-label\", this._buttonPrefix ? `${this._buttonPrefix} ${selectorText}` : selectorText);\n }\n this._buttonTextEl.innerHTML = btnContent;\n}\n","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _makeupNextId = _interopRequireDefault(require(\"makeup-next-id\"));\nvar ExitEmitter = _interopRequireWildcard(require(\"makeup-exit-emitter\"));\nvar _makeupFocusables = _interopRequireDefault(require(\"makeup-focusables\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst defaultOptions = {\n alwaysDoFocusManagement: false,\n ariaControls: true,\n autoCollapse: false,\n collapseOnFocusOut: false,\n collapseOnMouseOut: false,\n collapseOnClickOut: false,\n collapseOnHostReFocus: false,\n contentSelector: \".expander__content\",\n expandedClass: null,\n expandOnClick: false,\n expandOnFocus: false,\n expandOnHover: false,\n focusManagement: null,\n hostSelector: \".expander__host\",\n simulateSpacebarClick: false\n};\nfunction onHostKeyDown(e) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this._keyboardClickFlag = true;\n }\n // if host element does not naturally trigger a click event on spacebar, we can force one to trigger here.\n // careful! if host already triggers click events naturally, we end up with a \"double-click\".\n if (e.keyCode === 32 && this.options.simulateSpacebarClick === true) {\n this.hostEl.click();\n }\n}\nfunction onHostMouseDown() {\n this._mouseClickFlag = true;\n}\nfunction onHostClick() {\n this._expandWasKeyboardClickActivated = this._keyboardClickFlag;\n this._expandWasMouseClickActivated = this._mouseClickFlag;\n this._widgetHasKeyboardFocus = this._keyboardClickFlag;\n this.expanded = !this.expanded;\n}\nfunction onHostFocus() {\n this._expandWasFocusActivated = true;\n this.expanded = true;\n}\n\n// NOTE: collapseOnHostReFocus cannot be used when expandOnFocus is true\nfunction onHostReFocus() {\n if (this.expanded && this._widgetHasKeyboardFocus) {\n this.expanded = false;\n }\n}\nfunction onHostHover() {\n clearTimeout(this._mouseLeft);\n this._expandWasHoverActivated = true;\n this.expanded = true;\n}\nfunction onFocusExit() {\n this._widgetHasKeyboardFocus = false;\n this.expanded = false;\n}\nfunction onMouseLeave() {\n clearTimeout(this._mouseLeft);\n this._mouseLeft = setTimeout(() => {\n this.expanded = false;\n }, 300);\n}\nfunction _onDocumentClick(e) {\n if (this.el.contains(e.target) === false) {\n this.expanded = false;\n }\n}\nfunction _onDocumentTouchStart() {\n this.documentClick = true;\n}\nfunction _onDocumentTouchMove() {\n this.documentClick = false;\n}\nfunction _onDocumentTouchEnd(e) {\n if (this.documentClick === true) {\n this.documentClick = false;\n if (this.el.contains(e.target) === false) {\n this.expanded = false;\n }\n }\n}\nfunction manageFocus(focusManagement, contentEl) {\n if (focusManagement === \"content\") {\n contentEl.setAttribute(\"tabindex\", \"-1\");\n contentEl.focus();\n } else if (focusManagement === \"focusable\") {\n (0, _makeupFocusables.default)(contentEl)[0]?.focus();\n } else if (focusManagement === \"interactive\") {\n (0, _makeupFocusables.default)(contentEl, true)[0]?.focus();\n } else if (focusManagement !== null) {\n const el = contentEl.querySelector(`#${focusManagement}`);\n if (el) {\n el.focus();\n }\n }\n}\nclass _default {\n constructor(el, selectedOptions) {\n this.options = Object.assign({}, defaultOptions, selectedOptions);\n this.el = el;\n this.hostEl = el.querySelector(this.options.hostSelector); // the keyboard focusable host el\n this.contentEl = el.querySelector(this.options.contentSelector);\n ExitEmitter.addFocusExit(this.el);\n this._hostKeyDownListener = onHostKeyDown.bind(this);\n this._hostMouseDownListener = onHostMouseDown.bind(this);\n this._documentClickListener = _onDocumentClick.bind(this);\n this._documentTouchStartListener = _onDocumentTouchStart.bind(this);\n this._documentTouchMoveListener = _onDocumentTouchMove.bind(this);\n this._documentTouchEndListener = _onDocumentTouchEnd.bind(this);\n this._hostClickListener = onHostClick.bind(this);\n this._hostFocusListener = onHostFocus.bind(this);\n this._hostReFocusListener = onHostReFocus.bind(this);\n this._hostHoverListener = onHostHover.bind(this);\n this._focusExitListener = onFocusExit.bind(this);\n this._mouseLeaveListener = onMouseLeave.bind(this);\n if (this.hostEl.getAttribute(\"aria-expanded\") === null) {\n this.hostEl.setAttribute(\"aria-expanded\", \"false\");\n }\n if (this.options.ariaControls === true) {\n // ensure the widget has an id\n (0, _makeupNextId.default)(this.el, \"expander\");\n this.contentEl.id = this.contentEl.id || `${this.el.id}-content`;\n this.hostEl.setAttribute(\"aria-controls\", this.contentEl.id);\n }\n this.expandOnClick = this.options.expandOnClick;\n this.expandOnFocus = this.options.expandOnFocus;\n this.expandOnHover = this.options.expandOnHover;\n this.collapseOnHostReFocus = this.options.collapseOnHostReFocus;\n if (this.options.autoCollapse === false) {\n this.collapseOnClickOut = this.options.collapseOnClickOut;\n this.collapseOnFocusOut = this.options.collapseOnFocusOut;\n this.collapseOnMouseOut = this.options.collapseOnMouseOut;\n }\n }\n set expandOnClick(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"keydown\", this._hostKeyDownListener);\n this.hostEl.addEventListener(\"mousedown\", this._hostMouseDownListener);\n this.hostEl.addEventListener(\"click\", this._hostClickListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnClickOut = true;\n this.collapseOnFocusOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"click\", this._hostClickListener);\n this.hostEl.removeEventListener(\"mousedown\", this._hostMouseDownListener);\n this.hostEl.removeEventListener(\"keydown\", this._hostKeyDownListener);\n }\n }\n set expandOnFocus(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"focus\", this._hostFocusListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnClickOut = true;\n this.collapseOnFocusOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"focus\", this._hostFocusListener);\n }\n }\n set collapseOnHostReFocus(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"focus\", this._hostReFocusListener);\n } else {\n this.hostEl.removeEventListener(\"focus\", this._hostReFocusListener);\n }\n }\n set expandOnHover(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"mouseenter\", this._hostHoverListener);\n this.contentEl.addEventListener(\"mouseenter\", this._hostHoverListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnMouseOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"mouseenter\", this._hostHoverListener);\n this.contentEl.removeEventListener(\"mouseenter\", this._hostHoverListener);\n }\n }\n set collapseOnClickOut(bool) {\n if (bool === true) {\n document.addEventListener(\"click\", this._documentClickListener);\n document.addEventListener(\"touchstart\", this._documentTouchStartListener);\n document.addEventListener(\"touchmove\", this._documentTouchMoveListener);\n document.addEventListener(\"touchend\", this._documentTouchEndListener);\n } else {\n document.removeEventListener(\"click\", this._documentClickListener);\n document.removeEventListener(\"touchstart\", this._documentTouchStartListener);\n document.removeEventListener(\"touchmove\", this._documentTouchMoveListener);\n document.removeEventListener(\"touchend\", this._documentTouchEndListener);\n }\n }\n set collapseOnFocusOut(bool) {\n if (bool === true) {\n this.el.addEventListener(\"focusExit\", this._focusExitListener);\n } else {\n this.el.removeEventListener(\"focusExit\", this._focusExitListener);\n }\n }\n set collapseOnMouseOut(bool) {\n if (bool === true) {\n this.el.addEventListener(\"mouseleave\", this._mouseLeaveListener);\n this.contentEl.addEventListener(\"mouseleave\", this._mouseLeaveListener);\n } else {\n this.el.removeEventListener(\"mouseleave\", this._mouseLeaveListener);\n this.contentEl.removeEventListener(\"mouseleave\", this._mouseLeaveListener);\n }\n }\n get expanded() {\n return this.hostEl.getAttribute(\"aria-expanded\") === \"true\";\n }\n set expanded(bool) {\n if (bool === true && this.expanded === false) {\n this.hostEl.setAttribute(\"aria-expanded\", \"true\");\n if (this.options.expandedClass) {\n this.el.classList.add(this.options.expandedClass);\n }\n if (this._expandWasKeyboardClickActivated || this._expandWasMouseClickActivated && this.options.alwaysDoFocusManagement) {\n manageFocus(this.options.focusManagement, this.contentEl);\n }\n this.el.dispatchEvent(new CustomEvent(\"expander-expand\", {\n bubbles: true,\n detail: this.contentEl\n }));\n }\n if (bool === false && this.expanded === true) {\n this.hostEl.setAttribute(\"aria-expanded\", \"false\");\n if (this.options.expandedClass) {\n this.el.classList.remove(this.options.expandedClass);\n }\n this.el.dispatchEvent(new CustomEvent(\"expander-collapse\", {\n bubbles: true,\n detail: this.contentEl\n }));\n }\n this._expandWasKeyboardClickActivated = false;\n this._expandWasMouseClickActivated = false;\n this._expandWasFocusActivated = false;\n this._expandWasHoverActivated = false;\n this._keyboardClickFlag = false;\n this._mouseClickFlag = false;\n }\n sleep() {\n if (this._destroyed !== true) {\n this.expandOnClick = false;\n this.expandOnFocus = false;\n this.expandOnHover = false;\n this.collapseOnClickOut = false;\n this.collapseOnFocusOut = false;\n this.collapseOnMouseOut = false;\n this.collapseOnHostReFocus = false;\n }\n }\n destroy() {\n this.sleep();\n this._destroyed = true;\n this._hostKeyDownListener = null;\n this._hostMouseDownListener = null;\n this._documentClickListener = null;\n this._documentTouchStartListener = null;\n this._documentTouchMoveListener = null;\n this._documentTouchEndListener = null;\n this._hostClickListener = null;\n this._hostFocusListener = null;\n this._hostReFocusListener = null;\n this._hostHoverListener = null;\n this._focusExitListener = null;\n this._mouseLeaveListener = null;\n this._widgetHasKeyboardFocus = null;\n }\n}\nexports.default = _default;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createLinear = createLinear;\nvar KeyEmitter = _interopRequireWildcard(require(\"makeup-key-emitter\"));\nvar ExitEmitter = _interopRequireWildcard(require(\"makeup-exit-emitter\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nconst defaultOptions = {\n axis: \"both\",\n autoInit: \"interactive\",\n autoReset: \"current\",\n ignoreByDelegateSelector: null,\n wrap: false\n};\nfunction isItemNavigable(el) {\n return !el.hidden && el.getAttribute(\"aria-disabled\") !== \"true\";\n}\nfunction isIndexNavigable(items, index) {\n return index >= 0 && index < items.length ? isItemNavigable(items[index]) : false;\n}\nfunction findNavigableItems(items) {\n return items.filter(isItemNavigable);\n}\nfunction findFirstNavigableIndex(items) {\n return items.findIndex(item => isItemNavigable(item));\n}\nfunction findLastNavigableIndex(items) {\n // todo: at(-1) is more performant than reverse(), but Babel is not transpiling it\n return items.indexOf(findNavigableItems(items).reverse()[0]);\n}\nfunction findIndexByAttribute(items, attribute, value) {\n return items.findIndex(item => isItemNavigable(item) && item.getAttribute(attribute) === value);\n}\nfunction findFirstNavigableAriaCheckedIndex(items) {\n return findIndexByAttribute(items, \"aria-checked\", \"true\");\n}\nfunction findFirstNavigableAriaSelectedIndex(items) {\n return findIndexByAttribute(items, \"aria-selected\", \"true\");\n}\nfunction findIgnoredByDelegateItems(el, options) {\n return options.ignoreByDelegateSelector !== null ? [...el.querySelectorAll(options.ignoreByDelegateSelector)] : [];\n}\nfunction findPreviousNavigableIndex(items, index, wrap) {\n let previousNavigableIndex = -1;\n if (index === null || atStart(items, index)) {\n if (wrap === true) {\n previousNavigableIndex = findLastNavigableIndex(items);\n }\n } else {\n let i = index;\n while (--i >= 0) {\n if (isItemNavigable(items[i])) {\n previousNavigableIndex = i;\n break;\n }\n }\n }\n return previousNavigableIndex;\n}\nfunction findNextNavigableIndex(items, index, wrap) {\n let nextNavigableIndex = -1;\n if (index === null) {\n nextNavigableIndex = findFirstNavigableIndex(items);\n } else if (atEnd(items, index)) {\n if (wrap === true) {\n nextNavigableIndex = findFirstNavigableIndex(items);\n }\n } else {\n let i = index;\n while (++i < items.length) {\n if (isItemNavigable(items[i])) {\n nextNavigableIndex = i;\n break;\n }\n }\n }\n return nextNavigableIndex;\n}\n\n// returning -1 means not found\nfunction findIndexPositionByType(typeOrNum, items, currentIndex) {\n let index = -1;\n switch (typeOrNum) {\n case \"none\":\n index = null;\n break;\n case \"current\":\n index = currentIndex;\n break;\n case \"interactive\":\n index = findFirstNavigableIndex(items);\n break;\n case \"ariaChecked\":\n index = findFirstNavigableAriaCheckedIndex(items);\n break;\n case \"ariaSelected\":\n index = findFirstNavigableAriaSelectedIndex(items);\n break;\n case \"ariaSelectedOrInteractive\":\n index = findFirstNavigableAriaSelectedIndex(items);\n index = index === -1 ? findFirstNavigableIndex(items) : index;\n break;\n default:\n index = typeof typeOrNum === \"number\" || typeOrNum === null ? typeOrNum : -1;\n }\n return index;\n}\nfunction atStart(items, index) {\n return index === findFirstNavigableIndex(items);\n}\nfunction atEnd(items, index) {\n return index === findLastNavigableIndex(items);\n}\nfunction onKeyPrev(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findPreviousNavigableIndex(this.items, this.index, this.options.wrap);\n }\n}\nfunction onKeyNext(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findNextNavigableIndex(this.items, this.index, this.options.wrap);\n }\n}\nfunction onClick(e) {\n const itemIndex = this.indexOf(e.target.closest(this._itemSelector));\n if (isIndexNavigable(this.items, itemIndex)) {\n this.index = itemIndex;\n }\n}\nfunction onKeyHome(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findFirstNavigableIndex(this.items);\n }\n}\nfunction onKeyEnd(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findLastNavigableIndex(this.items);\n }\n}\nfunction onFocusExit() {\n if (this.options.autoReset !== null) {\n this.reset();\n }\n}\nfunction onMutation(e) {\n const fromIndex = this.index;\n let toIndex = this.index;\n // https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord\n const {\n addedNodes,\n attributeName,\n removedNodes,\n target,\n type\n } = e[0];\n if (type === \"attributes\") {\n if (target === this.currentItem) {\n if (attributeName === \"aria-disabled\") {\n // current item was disabled - keep it as current index (until a keyboard navigation happens)\n toIndex = this.index;\n } else if (attributeName === \"hidden\") {\n // current item was hidden and focus is lost - reset index to first interactive element\n toIndex = findFirstNavigableIndex(this.items);\n }\n } else {\n toIndex = this.index;\n }\n } else if (type === \"childList\") {\n if (removedNodes.length > 0 && [...removedNodes].includes(this._cachedElement)) {\n // current item was removed and focus is lost - reset index to first interactive element\n toIndex = findFirstNavigableIndex(this.items);\n } else if (removedNodes.length > 0 || addedNodes.length > 0) {\n // nodes were added and/or removed - keep current item and resync its index\n toIndex = this.indexOf(this._cachedElement);\n }\n }\n this._index = toIndex;\n this._el.dispatchEvent(new CustomEvent(\"navigationModelMutation\", {\n bubbles: false,\n detail: {\n fromIndex,\n toIndex\n }\n }));\n}\nclass NavigationModel {\n /**\n * @param {HTMLElement} el\n * @param {string} itemSelector\n * @param {typeof defaultOptions} selectedOptions\n */\n constructor(el, itemSelector, selectedOptions) {\n /** @member {typeof defaultOptions} */\n this.options = Object.assign({}, defaultOptions, selectedOptions);\n\n /** @member {HTMLElement} */\n this._el = el;\n\n /** @member {string} */\n this._itemSelector = itemSelector;\n }\n}\nclass LinearNavigationModel extends NavigationModel {\n /**\n * @param {HTMLElement} el\n * @param {string} itemSelector\n * @param {typeof defaultOptions} selectedOptions\n */\n constructor(el, itemSelector, selectedOptions) {\n super(el, itemSelector, selectedOptions);\n const fromIndex = this._index;\n const toIndex = findIndexPositionByType(this.options.autoInit, this.items, this.index);\n\n // do not use setter as it will trigger a change event\n this._index = toIndex;\n\n // always keep an element reference to the last item (for use in mutation observer)\n // todo: convert index to Tuple to store last/current values instead?\n this._cachedElement = this.items[toIndex];\n this._el.dispatchEvent(new CustomEvent(\"navigationModelInit\", {\n bubbles: false,\n detail: {\n firstInteractiveIndex: this.firstNavigableIndex,\n fromIndex,\n items: this.items,\n toIndex\n }\n }));\n }\n get currentItem() {\n return this.items[this.index];\n }\n\n // todo: code smell as getter abstracts that the query selector re-runs every time getter is accessed\n get items() {\n return [...this._el.querySelectorAll(`${this._itemSelector}`)];\n }\n get index() {\n return this._index;\n }\n\n /**\n * @param {number} toIndex - update index position in this.items (non-interactive indexes fail silently)\n */\n set index(toIndex) {\n if (toIndex === this.index) {\n return;\n } else if (!isIndexNavigable(this.items, toIndex)) {\n // no-op. throw exception?\n } else {\n const fromIndex = this.index;\n // update cached element reference (for use in mutation observer if DOM node gets removed)\n this._cachedElement = this.items[toIndex];\n this._index = toIndex;\n this._el.dispatchEvent(new CustomEvent(\"navigationModelChange\", {\n bubbles: false,\n detail: {\n fromIndex,\n toIndex\n }\n }));\n }\n }\n indexOf(element) {\n return this.items.indexOf(element);\n }\n reset() {\n const fromIndex = this.index;\n const toIndex = findIndexPositionByType(this.options.autoReset, this.items, this.index);\n if (toIndex !== fromIndex) {\n // do not use setter as it will trigger a navigationModelChange event\n this._index = toIndex;\n this._el.dispatchEvent(new CustomEvent(\"navigationModelReset\", {\n bubbles: false,\n detail: {\n fromIndex,\n toIndex\n }\n }));\n }\n }\n}\n\n// 2D Grid Model will go here\n\n/*\nclass GridModel extends NavigationModel {\n constructor(el, rowSelector, colSelector) {\n super();\n this._coords = null;\n }\n}\n*/\n\nclass NavigationEmitter {\n /**\n * @param {HTMLElement} el\n * @param {LinearNavigationModel} model\n */\n constructor(el, model) {\n this.model = model;\n this.el = el;\n this._keyPrevListener = onKeyPrev.bind(model);\n this._keyNextListener = onKeyNext.bind(model);\n this._keyHomeListener = onKeyHome.bind(model);\n this._keyEndListener = onKeyEnd.bind(model);\n this._clickListener = onClick.bind(model);\n this._focusExitListener = onFocusExit.bind(model);\n this._observer = new MutationObserver(onMutation.bind(model));\n KeyEmitter.addKeyDown(this.el);\n ExitEmitter.addFocusExit(this.el);\n const axis = model.options.axis;\n if (axis === \"both\" || axis === \"x\") {\n this.el.addEventListener(\"arrowLeftKeyDown\", this._keyPrevListener);\n this.el.addEventListener(\"arrowRightKeyDown\", this._keyNextListener);\n }\n if (axis === \"both\" || axis === \"y\") {\n this.el.addEventListener(\"arrowUpKeyDown\", this._keyPrevListener);\n this.el.addEventListener(\"arrowDownKeyDown\", this._keyNextListener);\n }\n this.el.addEventListener(\"homeKeyDown\", this._keyHomeListener);\n this.el.addEventListener(\"endKeyDown\", this._keyEndListener);\n this.el.addEventListener(\"click\", this._clickListener);\n this.el.addEventListener(\"focusExit\", this._focusExitListener);\n this._observer.observe(this.el, {\n childList: true,\n subtree: true,\n attributeFilter: [\"aria-disabled\", \"hidden\"],\n attributes: true,\n attributeOldValue: true\n });\n }\n destroy() {\n KeyEmitter.removeKeyDown(this.el);\n ExitEmitter.removeFocusExit(this.el);\n this.el.removeEventListener(\"arrowLeftKeyDown\", this._keyPrevListener);\n this.el.removeEventListener(\"arrowRightKeyDown\", this._keyNextListener);\n this.el.removeEventListener(\"arrowUpKeyDown\", this._keyPrevListener);\n this.el.removeEventListener(\"arrowDownKeyDown\", this._keyNextListener);\n this.el.removeEventListener(\"homeKeyDown\", this._keyHomeListener);\n this.el.removeEventListener(\"endKeyDown\", this._keyEndListener);\n this.el.removeEventListener(\"click\", this._clickListener);\n this.el.removeEventListener(\"focusExit\", this._focusExitListener);\n this._observer.disconnect();\n }\n}\nfunction createLinear(el, itemSelector, selectedOptions) {\n const model = new LinearNavigationModel(el, itemSelector, selectedOptions);\n return new NavigationEmitter(el, model);\n}\n\n/*\nstatic createGrid(el, rowSelector, colSelector, selectedOptions) {\n return null;\n}\n*/\n","require('./../dist/tokens/evo-core.css');\n","require('./dist/menu-button/menu-button.css');\n","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.add = add;\nexports.remove = remove;\nfunction onKeyDown(e) {\n if (e.keyCode >= 32 && e.keyCode <= 40) {\n e.preventDefault();\n }\n}\nfunction add(el) {\n el.addEventListener(\"keydown\", onKeyDown);\n}\nfunction remove(el) {\n el.removeEventListener(\"keydown\", onKeyDown);\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\"use strict\";\n\nrequire(\"../../docs.css\");\nrequire(\"@ebay/skin/tokens\");\nrequire(\"@ebay/skin/global\");\nrequire(\"@ebay/skin/button\");\nrequire(\"@ebay/skin/menu-button\");\nvar _makeupMenuButton = _interopRequireDefault(require(\"makeup-menu-button\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\n// REQUIRE\n// const MenuButton = require('makeup-menu-button').default;\n\n// IMPORT\n\nwindow.onload = function () {\n document.querySelectorAll(\".menu-button\").forEach(function (el, i) {\n const hasCustomLabel = el.classList.contains(\"menu-button-with-icon-customText\");\n const hasIconText = el.classList.contains(\"menu-button-with-iconText\");\n const hasIcon = el.classList.contains(\"menu-button-with-icon\");\n let buttonValueType;\n if (hasIconText) {\n buttonValueType = \"both\";\n } else if (hasIcon || hasCustomLabel) {\n buttonValueType = \"icon\";\n } else {\n buttonValueType = \"text\";\n }\n const menuItemButtonAriaLabelSelector = hasCustomLabel ? \".menu-button__item-value span\" : null;\n const widget = new _makeupMenuButton.default(el, {\n buttonValueType,\n menuItemButtonAriaLabelSelector\n });\n widget.menu.el.addEventListener(\"makeup-menu-select\", e => console.log(e.type, e.detail));\n widget.menu.el.addEventListener(\"makeup-menu-change\", e => console.log(e.type, e.detail));\n widget.menu.el.addEventListener(\"makeup-menu-button-mutation\", e => console.log(e.type, e.detail));\n });\n};"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"makeup-menu-button/index.min.js","mappings":";;;;;;AAAA,mBAAO,CAAC,IAA0B;;;;;;;;;ACArB;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,oBAAoB;AACpB,uBAAuB;AACvB,2CAA2C,mBAAO,CAAC,IAAgB;AACnE,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC3EA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf,6CAA6C,mBAAO,CAAC,IAAwB;AAC7E,gDAAgD,mBAAO,CAAC,IAA4B;AACpF,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mEAAmE,UAAU;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;;;;;;;;AC9Ka;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,oBAAoB;AACpB,gDAAgD,mBAAO,CAAC,IAA2B;AACnF,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;ACvHA,mBAAO,CAAC,IAAgC;;;;;;;;;ACA3B;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,OAAO,EAAE,UAAU,EAAE,cAAc;;AAEpD;AACA;AACA;AACA,6BAA6B,IAAI,GAAG,mBAAmB;AACvD;AACA;AACA;;;;;;;;ACvCA,mBAAO,CAAC,IAAsB;AAC9B,mBAAO,CAAC,IAAuB;;;;;;;;ACD/B,mBAAO,CAAC,IAA0B;;;;;;;;;;ACAlC;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;ACnCa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,WAAW;AACX,kBAAkB;AAClB,gBAAgB;AAChB,cAAc;AACd,qBAAqB;AACrB,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,IAAI,KAAK,aAAa;AAC1F;AACA;AACA,SAAS;AACT;AACA;AACA,uDAAuD,aAAa;AACpE;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrEa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf,6CAA6C,mBAAO,CAAC,IAAiB;AACtE,yCAAyC,mBAAO,CAAC,IAAa;AAC9D,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,2CAA2C,oBAAoB,EAAE,KAAK;AACtE;AACA;AACA;AACA,wBAAwB,gBAAgB,QAAQ,WAAW;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,oBAAoB,EAAE,aAAa;AACzG;AACA;AACA;;;;;;;;;;ACvJA;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,kBAAe;AACf,2CAA2C,mBAAO,CAAC,IAAgB;AACnE,0CAA0C,mBAAO,CAAC,GAAqB;AACvE,+CAA+C,mBAAO,CAAC,IAAmB;AAC1E,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ,2CAA2C,gBAAgB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,kDAAkD,WAAW;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;;;;;;;;;ACtSF;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,oBAAoB;AACpB,yCAAyC,mBAAO,CAAC,IAAoB;AACrE,0CAA0C,mBAAO,CAAC,GAAqB;AACvE,yCAAyC,4EAA4E,oDAAoD,uCAAuC,gBAAgB,+BAA+B,4EAA4E,qBAAqB,+BAA+B,eAAe,wCAAwC,2JAA2J,WAAW;AAC5lB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,QAAQ;AACrB,aAAa,uBAAuB;AACpC;AACA;AACA,iBAAiB,uBAAuB;AACxC,mCAAmC;;AAEnC,iBAAiB,aAAa;AAC9B;;AAEA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,QAAQ;AACrB,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,4CAA4C,mBAAmB;AAC/D;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,uBAAuB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;ACjXA,mBAAO,CAAC,IAA+B;;;;;;;;ACAvC,mBAAO,CAAC,IAAoC;;;;;;;;;;ACA5C;;;;;;;;;ACAa;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,WAAW;AACX,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;UCjBA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;;;;ACNa;;AAEb,mBAAO,CAAC,IAAgB;AACxB,mBAAO,CAAC,IAAmB;AAC3B,mBAAO,CAAC,IAAmB;AAC3B,mBAAO,CAAC,GAAmB;AAC3B,mBAAO,CAAC,IAAwB;AAChC,+CAA+C,mBAAO,CAAC,IAAoB;AAC3E,qCAAqC,iCAAiC;AACtE;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH,E","sources":["webpack://root/./node_modules/@ebay/skin/button.js","webpack://root/./packages/core/makeup-exit-emitter/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/dist/global/global.css?e001","webpack://root/./node_modules/@ebay/skin/dist/tokens/evo-light.css?9c33","webpack://root/./node_modules/@ebay/skin/dist/menu-button/menu-button.css?7300","webpack://root/./packages/ui/makeup-menu/dist/cjs/index.js","webpack://root/./packages/core/makeup-roving-tabindex/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/tokens/evo-light.js","webpack://root/./packages/core/makeup-next-id/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/tokens.js","webpack://root/./node_modules/@ebay/skin/global.js","webpack://root/./docs/docs.css?378e","webpack://root/./packages/core/makeup-focusables/dist/cjs/index.js","webpack://root/./packages/core/makeup-key-emitter/dist/cjs/index.js","webpack://root/./packages/ui/makeup-menu-button/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/dist/button/button.css?9a44","webpack://root/./packages/core/makeup-expander/dist/cjs/index.js","webpack://root/./packages/core/makeup-navigation-emitter/dist/cjs/index.js","webpack://root/./node_modules/@ebay/skin/tokens/evo-core.js","webpack://root/./node_modules/@ebay/skin/menu-button.js","webpack://root/./node_modules/@ebay/skin/dist/tokens/evo-core.css?7a96","webpack://root/./packages/core/makeup-prevent-scroll-keys/dist/cjs/index.js","webpack://root/webpack/bootstrap","webpack://root/webpack/runtime/make namespace object","webpack://root/./docs/ui/makeup-menu-button/index.compiled.js"],"sourcesContent":["require('./dist/button/button.css');\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.addFocusExit = addFocusExit;\nexports.removeFocusExit = removeFocusExit;\nvar _makeupNextId = _interopRequireDefault(require(\"makeup-next-id\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst focusExitEmitters = {};\nfunction doFocusExit(el, fromElement, toElement) {\n el.dispatchEvent(new CustomEvent(\"focusExit\", {\n detail: {\n fromElement,\n toElement\n },\n bubbles: false // mirror the native mouseleave event\n }));\n}\nfunction onDocumentFocusIn(e) {\n const newFocusElement = e.target;\n const targetIsDescendant = this.el.contains(newFocusElement);\n\n // if focus has moved to a focusable descendant\n if (targetIsDescendant === true) {\n // set the target as the currently focussed element\n this.currentFocusElement = newFocusElement;\n } else {\n // else focus has not gone to a focusable descendant\n window.removeEventListener(\"blur\", this.onWindowBlurListener);\n document.removeEventListener(\"focusin\", this.onDocumentFocusInListener);\n doFocusExit(this.el, this.currentFocusElement, newFocusElement);\n this.currentFocusElement = null;\n }\n}\nfunction onWindowBlur() {\n doFocusExit(this.el, this.currentFocusElement, undefined);\n}\nfunction onWidgetFocusIn() {\n // listen for focus moving to anywhere in document\n // note that mouse click on buttons, checkboxes and radios does not trigger focus events in all browsers!\n document.addEventListener(\"focusin\", this.onDocumentFocusInListener);\n // listen for focus leaving the window\n window.addEventListener(\"blur\", this.onWindowBlurListener);\n}\nclass FocusExitEmitter {\n constructor(el) {\n this.el = el;\n this.currentFocusElement = null;\n this.onWidgetFocusInListener = onWidgetFocusIn.bind(this);\n this.onDocumentFocusInListener = onDocumentFocusIn.bind(this);\n this.onWindowBlurListener = onWindowBlur.bind(this);\n this.el.addEventListener(\"focusin\", this.onWidgetFocusInListener);\n }\n removeEventListeners() {\n window.removeEventListener(\"blur\", this.onWindowBlurListener);\n document.removeEventListener(\"focusin\", this.onDocumentFocusInListener);\n this.el.removeEventListener(\"focusin\", this.onWidgetFocusInListener);\n }\n}\nfunction addFocusExit(el) {\n let exitEmitter = null;\n (0, _makeupNextId.default)(el);\n if (!focusExitEmitters[el.id]) {\n exitEmitter = new FocusExitEmitter(el);\n focusExitEmitters[el.id] = exitEmitter;\n }\n return exitEmitter;\n}\nfunction removeFocusExit(el) {\n const exitEmitter = focusExitEmitters[el.id];\n if (exitEmitter) {\n exitEmitter.removeEventListeners();\n delete focusExitEmitters[el.id];\n }\n}\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar RovingTabIndex = _interopRequireWildcard(require(\"makeup-roving-tabindex\"));\nvar PreventScrollKeys = _interopRequireWildcard(require(\"makeup-prevent-scroll-keys\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nconst defaultOptions = {\n customElementMode: false,\n autoInit: \"interactive\",\n autoReset: \"interactive\"\n};\nclass _default {\n constructor(widgetEl, selectedOptions) {\n this._options = Object.assign({}, defaultOptions, selectedOptions);\n this.el = widgetEl;\n this._rovingTabIndex = RovingTabIndex.createLinear(this.el, \"[role^=menuitem]\", {\n autoInit: this._options.autoInit,\n autoReset: this._options.autoReset\n });\n PreventScrollKeys.add(this.el);\n this._onKeyDownListener = _onKeyDown.bind(this);\n this._onClickListener = _onClick.bind(this);\n this._onMutationListener = _onMutation.bind(this);\n this.el.classList.add(\"menu--js\");\n if (!this._options.customElementMode) {\n this._mutationObserver = new MutationObserver(this._onMutationListener);\n this._observeMutations();\n this._observeEvents();\n }\n }\n select(index) {\n this._unobserveMutations();\n const el = this.items[index];\n switch (el.getAttribute(\"role\")) {\n case \"menuitemcheckbox\":\n _selectMenuItemCheckbox(this.el, el);\n break;\n case \"menuitemradio\":\n _selectMenuItemRadio(this.el, el);\n break;\n default:\n _selectMenuItem(this.el, el);\n break;\n }\n this._observeMutations();\n }\n get items() {\n return this._rovingTabIndex.items;\n }\n get radioGroupNames() {\n const els = [...this.el.querySelectorAll(\"[role=menuitemradio][data-makeup-group]\")];\n const groupNames = [...new Set(els.map(el => el.dataset.makeupGroup))];\n return groupNames;\n }\n get checkboxGroupNames() {\n const els = [...this.el.querySelectorAll(\"[role=menuitemcheckbox][data-makeup-group]\")];\n const groupNames = [...new Set(els.map(el => el.dataset.makeupGroup))];\n return groupNames;\n }\n _observeMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.observe(this.el, {\n attributeFilter: [\"aria-checked\", \"aria-disabled\"],\n attributes: true,\n childList: true,\n subtree: true\n });\n }\n }\n _unobserveMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.disconnect();\n }\n }\n _observeEvents() {\n if (this._destroyed !== true) {\n this.el.addEventListener(\"keydown\", this._onKeyDownListener);\n this.el.addEventListener(\"click\", this._onClickListener);\n }\n }\n _unobserveEvents() {\n this.el.removeEventListener(\"keydown\", this._onKeyDownListener);\n this.el.removeEventListener(\"click\", this._onClickListener);\n }\n destroy() {\n this._destroyed = true;\n this._unobserveMutations();\n this._unobserveEvents();\n this._onKeyDownListener = null;\n this._onClickListener = null;\n this._onMutationListener = null;\n }\n}\nexports.default = _default;\nfunction _onMutation(mutationsList) {\n for (const mutation of mutationsList) {\n if (mutation.type === \"attributes\") {\n this.el.dispatchEvent(new CustomEvent(\"makeup-menu-mutation\", {\n detail: {\n attributeName: mutation.attributeName\n }\n }));\n }\n }\n}\nfunction _onKeyDown(e) {\n this._unobserveMutations();\n if (e.keyCode === 13) {\n e.preventDefault();\n }\n if (e.keyCode === 13 || e.keyCode === 32) {\n this.select(Array.from(this.items).indexOf(e.target));\n }\n this._observeMutations();\n}\nfunction _onClick(e) {\n // unlike the keyDown event, the click event target can be a child element of the menuitem\n // e.g.
Item 1
\n const menuItemEl = e.target.closest(\"[role^=menuitem]\");\n const index = this.items.indexOf(menuItemEl);\n if (index !== -1) {\n this.select(index);\n }\n}\nfunction _selectMenuItem(widgetEl, menuItemEl) {\n widgetEl.dispatchEvent(new CustomEvent(\"makeup-menu-select\", {\n detail: {\n el: menuItemEl,\n value: menuItemEl.innerText\n }\n }));\n}\nfunction _selectMenuItemCheckbox(widgetEl, menuItemEl) {\n if (menuItemEl.getAttribute(\"aria-disabled\") !== \"true\") {\n const groupName = menuItemEl.dataset.makeupGroup;\n menuItemEl.setAttribute(\"aria-checked\", menuItemEl.getAttribute(\"aria-checked\") === \"true\" ? \"false\" : \"true\");\n widgetEl.dispatchEvent(new CustomEvent(\"makeup-menu-change\", {\n detail: {\n el: menuItemEl,\n checked: menuItemEl.getAttribute(\"aria-checked\"),\n group: groupName,\n value: menuItemEl.innerText\n }\n }));\n }\n}\nfunction _selectMenuItemRadio(widgetEl, menuItemEl) {\n if (menuItemEl.getAttribute(\"aria-disabled\") !== \"true\") {\n const groupName = menuItemEl.dataset.makeupGroup;\n const checkedEl = widgetEl.querySelector(`[data-makeup-group=${groupName}][aria-checked=true]`);\n if (!checkedEl) {\n menuItemEl.setAttribute(\"aria-checked\", \"true\");\n widgetEl.dispatchEvent(new CustomEvent(\"makeup-menu-change\", {\n detail: {\n el: menuItemEl,\n group: groupName,\n value: menuItemEl.innerText\n }\n }));\n } else if (checkedEl !== menuItemEl) {\n checkedEl.setAttribute(\"aria-checked\", \"false\");\n menuItemEl.setAttribute(\"aria-checked\", \"true\");\n widgetEl.dispatchEvent(new CustomEvent(\"makeup-menu-change\", {\n detail: {\n el: menuItemEl,\n group: groupName,\n value: menuItemEl.innerText\n }\n }));\n }\n }\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createLinear = createLinear;\nvar NavigationEmitter = _interopRequireWildcard(require(\"makeup-navigation-emitter\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nconst defaultOptions = {\n autoInit: \"interactive\",\n autoReset: \"current\",\n wrap: false,\n axis: \"both\"\n};\nfunction refreshTabindex(items, focusIndex) {\n items.forEach(function (el, i) {\n el.setAttribute(\"tabindex\", i === focusIndex ? \"0\" : \"-1\");\n });\n}\nfunction onModelInit(e) {\n refreshTabindex(e.detail.items, e.detail.toIndex);\n this._el.dispatchEvent(new CustomEvent(\"rovingTabindexInit\", {\n detail: e.detail\n }));\n}\nfunction onModelChange(e) {\n const items = this.items;\n const fromItem = items[e.detail.fromIndex];\n const toItem = items[e.detail.toIndex];\n if (fromItem) {\n fromItem.setAttribute(\"tabindex\", \"-1\");\n }\n if (toItem) {\n toItem.setAttribute(\"tabindex\", \"0\");\n toItem.focus();\n }\n this._el.dispatchEvent(new CustomEvent(\"rovingTabindexChange\", {\n detail: e.detail\n }));\n}\nfunction onModelReset(e) {\n refreshTabindex(this.items, e.detail.toIndex);\n this._el.dispatchEvent(new CustomEvent(\"rovingTabindexReset\", {\n detail: e.detail\n }));\n}\nfunction onModelMutation(e) {\n refreshTabindex(this.items, e.detail.toIndex);\n this._el.dispatchEvent(new CustomEvent(\"rovingTabindexMutation\", {\n detail: e.detail\n }));\n}\nclass RovingTabindex {\n constructor(el) {\n this._el = el;\n this._onMutationListener = onModelMutation.bind(this);\n this._onChangeListener = onModelChange.bind(this);\n this._onInitListener = onModelInit.bind(this);\n this._onResetListener = onModelReset.bind(this);\n this._el.addEventListener(\"navigationModelMutation\", this._onMutationListener);\n this._el.addEventListener(\"navigationModelChange\", this._onChangeListener);\n this._el.addEventListener(\"navigationModelInit\", this._onInitListener);\n this._el.addEventListener(\"navigationModelReset\", this._onResetListener);\n }\n destroy() {\n this._el.removeEventListener(\"navigationModelMutation\", this._onMutationListener);\n this._el.removeEventListener(\"navigationModelChange\", this._onChangeListener);\n this._el.removeEventListener(\"navigationModelInit\", this._onInitListener);\n this._el.removeEventListener(\"navigationModelReset\", this._onResetListener);\n }\n}\nclass LinearRovingTabindex extends RovingTabindex {\n constructor(el, itemSelector, selectedOptions) {\n super(el);\n this._options = Object.assign({}, defaultOptions, selectedOptions);\n this._itemSelector = itemSelector;\n\n // todo: options.index is deprecated. Remove support in future release.\n this._navigationEmitter = NavigationEmitter.createLinear(el, itemSelector, {\n autoInit: this._options.index !== undefined ? this._options.index : this._options.autoInit,\n autoReset: this._options.autoReset,\n wrap: this._options.wrap,\n axis: this._options.axis\n });\n }\n get index() {\n return this._navigationEmitter.model.index;\n }\n set index(newIndex) {\n this._navigationEmitter.model.index = newIndex;\n }\n set wrap(newWrap) {\n this._navigationEmitter.model.options.wrap = newWrap;\n }\n get currentItem() {\n return this._navigationEmitter.model.currentItem;\n }\n get items() {\n return this._navigationEmitter.model.items;\n }\n reset() {\n this._navigationEmitter.model.reset();\n }\n destroy() {\n super.destroy();\n this._navigationEmitter.destroy();\n }\n}\n\n/*\nclass GridRovingTabindex extends RovingTabindex {\n constructor(el, rowSelector, cellSelector, selectedOptions) {\n super(el);\n }\n}\n*/\n\nfunction createLinear(el, itemSelector, selectedOptions) {\n return new LinearRovingTabindex(el, itemSelector, selectedOptions);\n}\n","require('./../dist/tokens/evo-light.css');\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nconst sequenceMap = {};\nconst defaultPrefix = \"nid\";\nconst randomPortion = createRandomPortion(3);\nfunction randomNumber(max) {\n return Math.floor(Math.random() * max);\n}\nfunction createRandomPortion(size) {\n const letters = \"abcdefghijklmnopqrstuvwxyz\";\n const digits = \"0123456789\";\n const allChars = letters + digits;\n\n // to ensure a valid HTML ID (when prefix is empty), first character must be a letter\n let portion = letters[randomNumber(25)];\n\n // start iterating from 1, as we already have our first char\n for (let i = 1; i < size; i++) {\n portion += allChars[randomNumber(35)];\n }\n return portion;\n}\nfunction _default(el) {\n let prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultPrefix;\n const separator = prefix === \"\" ? \"\" : \"-\";\n\n // join first prefix with random portion to create key\n const key = `${prefix}${separator}${randomPortion}`;\n\n // initialise key in sequence map if necessary\n sequenceMap[key] = sequenceMap[key] || 0;\n if (!el.id) {\n el.setAttribute(\"id\", `${key}-${sequenceMap[key]++}`);\n }\n return el.id;\n}\n","require('./tokens/evo-core.js');\nrequire('./tokens/evo-light.js');\n","require('./dist/global/global.css');\n","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nconst focusableElList = [\"a[href]\", \"area[href]\", \"button:not([disabled])\", \"embed\", \"iframe\", \"input:not([disabled])\", \"object\", \"select:not([disabled])\", \"textarea:not([disabled])\", \"*[tabindex]\", \"*[contenteditable]\"];\nconst focusableElSelector = focusableElList.join();\nfunction _default(el) {\n let keyboardOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let callback = arguments.length > 2 ? arguments[2] : undefined;\n if (callback) {\n const request = requestAnimationFrame(() => {\n callback(getFocusables(el, keyboardOnly));\n });\n return () => {\n cancelAnimationFrame(request);\n };\n }\n return getFocusables(el, keyboardOnly);\n}\nfunction getFocusables(el) {\n let keyboardOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let focusableEls = Array.prototype.slice.call(el.querySelectorAll(focusableElSelector));\n\n // filter out elements with display: none or nested in a display: none parent\n focusableEls = focusableEls.filter(function (focusableEl) {\n return !!(focusableEl.offsetWidth || focusableEl.offsetHeight || focusableEl.getClientRects().length);\n });\n if (keyboardOnly === true) {\n focusableEls = focusableEls.filter(function (focusableEl) {\n return focusableEl.getAttribute(\"tabindex\") !== \"-1\";\n });\n }\n return focusableEls;\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.add = add;\nexports.addKeyDown = addKeyDown;\nexports.addKeyUp = addKeyUp;\nexports.remove = remove;\nexports.removeKeyDown = removeKeyDown;\nexports.removeKeyUp = removeKeyUp;\nfunction uncapitalizeFirstLetter(str) {\n return str.charAt(0).toLowerCase() + str.slice(1);\n}\nfunction onKeyDownOrUp(evt, el, keyEventType) {\n if (!evt.shiftKey) {\n const key = evt.key;\n switch (key) {\n case \"Enter\":\n case \"Escape\":\n case \"PageUp\":\n case \"PageDown\":\n case \"End\":\n case \"Home\":\n case \"ArrowLeft\":\n case \"ArrowUp\":\n case \"ArrowRight\":\n case \"ArrowDown\":\n el.dispatchEvent(new CustomEvent(uncapitalizeFirstLetter(`${key}Key${keyEventType}`), {\n detail: evt,\n bubbles: true\n }));\n break;\n case \" \":\n el.dispatchEvent(new CustomEvent(`spacebarKey${keyEventType}`, {\n detail: evt,\n bubbles: true\n }));\n break;\n default:\n return;\n }\n }\n}\nfunction onKeyDown(e) {\n onKeyDownOrUp(e, this, \"Down\");\n}\nfunction onKeyUp(e) {\n onKeyDownOrUp(e, this, \"Up\");\n}\nfunction addKeyDown(el) {\n el.addEventListener(\"keydown\", onKeyDown);\n}\nfunction addKeyUp(el) {\n el.addEventListener(\"keyup\", onKeyUp);\n}\nfunction removeKeyDown(el) {\n el.removeEventListener(\"keydown\", onKeyDown);\n}\nfunction removeKeyUp(el) {\n el.removeEventListener(\"keyup\", onKeyUp);\n}\nfunction add(el) {\n addKeyDown(el);\n addKeyUp(el);\n}\nfunction remove(el) {\n removeKeyDown(el);\n removeKeyUp(el);\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _makeupExpander = _interopRequireDefault(require(\"makeup-expander\"));\nvar _makeupMenu = _interopRequireDefault(require(\"makeup-menu\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst defaultOptions = {\n customElementMode: false,\n expandedClass: \"menu-button--expanded\",\n menuSelector: \".menu-button__menu\",\n buttonTextSelector: `.btn__text`,\n buttonValueType: \"text\",\n // [\"text\", \"icon\", \"both\"],\n menuItemIconSelector: \".icon\",\n menuItemButtonAriaLabelSelector: null\n};\nclass _default {\n constructor(widgetEl, selectedOptions) {\n this._options = Object.assign({}, defaultOptions, selectedOptions);\n this.el = widgetEl;\n this._buttonEl = widgetEl.querySelector(\"button\");\n this._buttonEl.setAttribute(\"aria-haspopup\", \"true\");\n this.menu = new _makeupMenu.default(widgetEl.querySelector(this._options.menuSelector), {\n autoReset: \"interactive\"\n });\n this._buttonPrefix = this._buttonEl.dataset?.makeupMenuButtonPrefix;\n this._buttonTextEl = this._buttonEl.querySelector(this._options.buttonTextSelector);\n this._expander = new _makeupExpander.default(widgetEl, {\n alwaysDoFocusManagement: true,\n autoCollapse: true,\n collapseOnHostReFocus: true,\n contentSelector: this._options.menuSelector,\n expandedClass: this._options.expandedClass,\n expandOnClick: true,\n focusManagement: \"focusable\",\n hostSelector: \"button\"\n });\n this._onButtonFirstClickListener = _onButtonFirstClick.bind(this);\n this._onMenuKeyDownListener = _onMenuKeyDown.bind(this);\n this._onMenuItemSelectListener = _onMenuItemSelect.bind(this);\n this._onMutationListener = _onMutation.bind(this);\n this.el.classList.add(\"menu-button--js\");\n if (!this._options.customElementMode) {\n this._mutationObserver = new MutationObserver(this._onMutationListener);\n this._observeMutations();\n this._observeEvents();\n }\n }\n _observeMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.observe(this.el, {\n attributeFilter: [\"aria-expanded\", \"disabled\"],\n attributes: true,\n childList: false,\n subtree: false\n });\n }\n }\n _unobserveMutations() {\n if (!this._options.customElementMode) {\n this._mutationObserver.disconnect();\n }\n }\n _observeEvents() {\n if (this._destroyed !== true) {\n this._buttonEl.addEventListener(\"click\", this._onButtonFirstClickListener, {\n once: true\n });\n this.menu.el.addEventListener(\"keydown\", this._onMenuKeyDownListener);\n this.menu.el.addEventListener(\"makeup-menu-select\", this._onMenuItemSelectListener);\n this.menu.el.addEventListener(\"makeup-menu-change\", this._onMenuItemSelectListener);\n }\n }\n _unobserveEvents() {\n this._buttonEl.removeEventListener(\"click\", this._onButtonFirstClickListener);\n this.menu.el.removeEventListener(\"keydown\", this._onMenuKeyDownListener);\n this.menu.el.removeEventListener(\"makeup-menu-select\", this._onMenuItemSelectListener);\n this.menu.el.removeEventListener(\"makeup-menu-change\", this._onMenuItemSelectListener);\n }\n destroy() {\n this._destroyed = true;\n this._unobserveMutations();\n this._unobserveEvents();\n this._onButtonFirstClickListener = null;\n this._onMenuKeyDownListener = null;\n this._onMenuItemSelectListener = null;\n this._onMutationListener = null;\n }\n}\nexports.default = _default;\nfunction _onMutation(mutationsList) {\n for (const mutation of mutationsList) {\n if (mutation.type === \"attributes\") {\n this.el.dispatchEvent(new CustomEvent(\"makeup-menu-button-mutation\", {\n detail: {\n attributeName: mutation.attributeName\n }\n }));\n }\n }\n}\nfunction _onButtonFirstClick() {\n this.menu.el.hidden = false;\n}\nfunction _onMenuKeyDown(e) {\n if (e.keyCode === 27) {\n this._expander.expanded = false;\n this._buttonEl.focus();\n }\n}\nfunction _onMenuItemSelect(e) {\n const widget = this;\n const {\n el\n } = e.detail;\n setTimeout(function () {\n widget._expander.expanded = false;\n widget._buttonEl.focus();\n }, 150);\n if (el.getAttribute(\"role\") !== \"menuitemradio\") {\n return;\n }\n const {\n menuItemIconSelector,\n menuItemButtonAriaLabelSelector,\n buttonValueType\n } = this._options;\n const icon = el.querySelector(menuItemIconSelector).cloneNode(true);\n const text = el.innerText.trim();\n let btnContent = this._buttonPrefix ? `${this._buttonPrefix} ${text}` : text;\n if (icon) {\n switch (buttonValueType) {\n case \"both\":\n btnContent = `${icon.outerHTML} ${btnContent}`;\n break;\n case \"icon\":\n this._buttonEl.setAttribute(\"aria-label\", btnContent);\n btnContent = icon.outerHTML;\n break;\n default:\n break;\n }\n }\n if (menuItemButtonAriaLabelSelector) {\n const selectorText = el.querySelector(menuItemButtonAriaLabelSelector)?.innerText.trim();\n this._buttonEl.setAttribute(\"aria-label\", this._buttonPrefix ? `${this._buttonPrefix} ${selectorText}` : selectorText);\n }\n this._buttonTextEl.innerHTML = btnContent;\n}\n","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _makeupNextId = _interopRequireDefault(require(\"makeup-next-id\"));\nvar ExitEmitter = _interopRequireWildcard(require(\"makeup-exit-emitter\"));\nvar _makeupFocusables = _interopRequireDefault(require(\"makeup-focusables\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst defaultOptions = {\n alwaysDoFocusManagement: false,\n ariaControls: true,\n autoCollapse: false,\n collapseOnFocusOut: false,\n collapseOnMouseOut: false,\n collapseOnClickOut: false,\n collapseOnHostReFocus: false,\n contentSelector: \".expander__content\",\n expandedClass: null,\n expandOnClick: false,\n expandOnFocus: false,\n expandOnHover: false,\n focusManagement: null,\n hostSelector: \".expander__host\",\n simulateSpacebarClick: false,\n useAriaExpanded: true\n};\nfunction onHostKeyDown(e) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this._keyboardClickFlag = true;\n }\n // if host element does not naturally trigger a click event on spacebar, we can force one to trigger here.\n // careful! if host already triggers click events naturally, we end up with a \"double-click\".\n if (e.keyCode === 32 && this.options.simulateSpacebarClick === true) {\n this.hostEl.click();\n }\n}\nfunction onHostMouseDown() {\n this._mouseClickFlag = true;\n}\nfunction onHostClick() {\n this._expandWasKeyboardClickActivated = this._keyboardClickFlag;\n this._expandWasMouseClickActivated = this._mouseClickFlag;\n this._widgetHasKeyboardFocus = this._keyboardClickFlag;\n this.expanded = !this.expanded;\n}\nfunction onHostFocus() {\n this._expandWasFocusActivated = true;\n this.expanded = true;\n}\n\n// NOTE: collapseOnHostReFocus cannot be used when expandOnFocus is true\nfunction onHostReFocus() {\n if (this.expanded && this._widgetHasKeyboardFocus) {\n this.expanded = false;\n }\n}\nfunction onHostHover() {\n clearTimeout(this._mouseLeft);\n this._expandWasHoverActivated = true;\n this.expanded = true;\n}\nfunction onFocusExit() {\n this._widgetHasKeyboardFocus = false;\n this.expanded = false;\n}\nfunction onMouseLeave() {\n clearTimeout(this._mouseLeft);\n this._mouseLeft = setTimeout(() => {\n this.expanded = false;\n }, 300);\n}\nfunction _onDocumentClick(e) {\n if (this.el.contains(e.target) === false) {\n this.expanded = false;\n }\n}\nfunction _onDocumentTouchStart() {\n this.documentClick = true;\n}\nfunction _onDocumentTouchMove() {\n this.documentClick = false;\n}\nfunction _onDocumentTouchEnd(e) {\n if (this.documentClick === true) {\n this.documentClick = false;\n if (this.el.contains(e.target) === false) {\n this.expanded = false;\n }\n }\n}\nfunction manageFocus(focusManagement, contentEl) {\n if (focusManagement === \"content\") {\n contentEl.setAttribute(\"tabindex\", \"-1\");\n contentEl.focus();\n } else if (focusManagement === \"focusable\") {\n (0, _makeupFocusables.default)(contentEl)[0]?.focus();\n } else if (focusManagement === \"interactive\") {\n (0, _makeupFocusables.default)(contentEl, true)[0]?.focus();\n } else if (focusManagement !== null) {\n const el = contentEl.querySelector(`#${focusManagement}`);\n if (el) {\n el.focus();\n }\n }\n}\nclass _default {\n constructor(el, selectedOptions) {\n this.options = Object.assign({}, defaultOptions, selectedOptions);\n this.el = el;\n this.hostEl = el.querySelector(this.options.hostSelector); // the keyboard focusable host el\n this.contentEl = el.querySelector(this.options.contentSelector);\n ExitEmitter.addFocusExit(this.el);\n this._hostKeyDownListener = onHostKeyDown.bind(this);\n this._hostMouseDownListener = onHostMouseDown.bind(this);\n this._documentClickListener = _onDocumentClick.bind(this);\n this._documentTouchStartListener = _onDocumentTouchStart.bind(this);\n this._documentTouchMoveListener = _onDocumentTouchMove.bind(this);\n this._documentTouchEndListener = _onDocumentTouchEnd.bind(this);\n this._hostClickListener = onHostClick.bind(this);\n this._hostFocusListener = onHostFocus.bind(this);\n this._hostReFocusListener = onHostReFocus.bind(this);\n this._hostHoverListener = onHostHover.bind(this);\n this._focusExitListener = onFocusExit.bind(this);\n this._mouseLeaveListener = onMouseLeave.bind(this);\n if (this.options.useAriaExpanded === true) {\n const initialAriaExpanded = this.hostEl.getAttribute(\"aria-expanded\");\n this._expanded = initialAriaExpanded === \"true\";\n if (initialAriaExpanded === null) {\n this.hostEl.setAttribute(\"aria-expanded\", \"false\");\n }\n } else {\n this._expanded = false;\n }\n if (this.options.ariaControls === true) {\n // ensure the widget has an id\n (0, _makeupNextId.default)(this.el, \"expander\");\n this.contentEl.id = this.contentEl.id || `${this.el.id}-content`;\n this.hostEl.setAttribute(\"aria-controls\", this.contentEl.id);\n }\n this.expandOnClick = this.options.expandOnClick;\n this.expandOnFocus = this.options.expandOnFocus;\n this.expandOnHover = this.options.expandOnHover;\n this.collapseOnHostReFocus = this.options.collapseOnHostReFocus;\n if (this.options.autoCollapse === false) {\n this.collapseOnClickOut = this.options.collapseOnClickOut;\n this.collapseOnFocusOut = this.options.collapseOnFocusOut;\n this.collapseOnMouseOut = this.options.collapseOnMouseOut;\n }\n }\n set expandOnClick(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"keydown\", this._hostKeyDownListener);\n this.hostEl.addEventListener(\"mousedown\", this._hostMouseDownListener);\n this.hostEl.addEventListener(\"click\", this._hostClickListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnClickOut = true;\n this.collapseOnFocusOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"click\", this._hostClickListener);\n this.hostEl.removeEventListener(\"mousedown\", this._hostMouseDownListener);\n this.hostEl.removeEventListener(\"keydown\", this._hostKeyDownListener);\n }\n }\n set expandOnFocus(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"focus\", this._hostFocusListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnClickOut = true;\n this.collapseOnFocusOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"focus\", this._hostFocusListener);\n }\n }\n set collapseOnHostReFocus(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"focus\", this._hostReFocusListener);\n } else {\n this.hostEl.removeEventListener(\"focus\", this._hostReFocusListener);\n }\n }\n set expandOnHover(bool) {\n if (bool === true) {\n this.hostEl.addEventListener(\"mouseenter\", this._hostHoverListener);\n this.contentEl.addEventListener(\"mouseenter\", this._hostHoverListener);\n if (this.options.autoCollapse === true) {\n this.collapseOnMouseOut = true;\n }\n } else {\n this.hostEl.removeEventListener(\"mouseenter\", this._hostHoverListener);\n this.contentEl.removeEventListener(\"mouseenter\", this._hostHoverListener);\n }\n }\n set collapseOnClickOut(bool) {\n if (bool === true) {\n document.addEventListener(\"click\", this._documentClickListener);\n document.addEventListener(\"touchstart\", this._documentTouchStartListener);\n document.addEventListener(\"touchmove\", this._documentTouchMoveListener);\n document.addEventListener(\"touchend\", this._documentTouchEndListener);\n } else {\n document.removeEventListener(\"click\", this._documentClickListener);\n document.removeEventListener(\"touchstart\", this._documentTouchStartListener);\n document.removeEventListener(\"touchmove\", this._documentTouchMoveListener);\n document.removeEventListener(\"touchend\", this._documentTouchEndListener);\n }\n }\n set collapseOnFocusOut(bool) {\n if (bool === true) {\n this.el.addEventListener(\"focusExit\", this._focusExitListener);\n } else {\n this.el.removeEventListener(\"focusExit\", this._focusExitListener);\n }\n }\n set collapseOnMouseOut(bool) {\n if (bool === true) {\n this.el.addEventListener(\"mouseleave\", this._mouseLeaveListener);\n this.contentEl.addEventListener(\"mouseleave\", this._mouseLeaveListener);\n } else {\n this.el.removeEventListener(\"mouseleave\", this._mouseLeaveListener);\n this.contentEl.removeEventListener(\"mouseleave\", this._mouseLeaveListener);\n }\n }\n get expanded() {\n return this._expanded;\n }\n set expanded(bool) {\n if (bool === true && this.expanded === false) {\n if (this.options.useAriaExpanded === true) {\n this.hostEl.setAttribute(\"aria-expanded\", \"true\");\n }\n if (this.options.expandedClass) {\n this.el.classList.add(this.options.expandedClass);\n }\n if (this._expandWasKeyboardClickActivated || this._expandWasMouseClickActivated && this.options.alwaysDoFocusManagement) {\n manageFocus(this.options.focusManagement, this.contentEl);\n }\n this.el.dispatchEvent(new CustomEvent(\"expander-expand\", {\n bubbles: true,\n detail: this.contentEl\n }));\n }\n if (bool === false && this.expanded === true) {\n if (this.options.useAriaExpanded === true) {\n this.hostEl.setAttribute(\"aria-expanded\", \"false\");\n }\n if (this.options.expandedClass) {\n this.el.classList.remove(this.options.expandedClass);\n }\n this.el.dispatchEvent(new CustomEvent(\"expander-collapse\", {\n bubbles: true,\n detail: this.contentEl\n }));\n }\n this._expanded = bool;\n this._expandWasKeyboardClickActivated = false;\n this._expandWasMouseClickActivated = false;\n this._expandWasFocusActivated = false;\n this._expandWasHoverActivated = false;\n this._keyboardClickFlag = false;\n this._mouseClickFlag = false;\n }\n sleep() {\n if (this._destroyed !== true) {\n this.expandOnClick = false;\n this.expandOnFocus = false;\n this.expandOnHover = false;\n this.collapseOnClickOut = false;\n this.collapseOnFocusOut = false;\n this.collapseOnMouseOut = false;\n this.collapseOnHostReFocus = false;\n }\n }\n destroy() {\n this.sleep();\n this._destroyed = true;\n this._hostKeyDownListener = null;\n this._hostMouseDownListener = null;\n this._documentClickListener = null;\n this._documentTouchStartListener = null;\n this._documentTouchMoveListener = null;\n this._documentTouchEndListener = null;\n this._hostClickListener = null;\n this._hostFocusListener = null;\n this._hostReFocusListener = null;\n this._hostHoverListener = null;\n this._focusExitListener = null;\n this._mouseLeaveListener = null;\n this._widgetHasKeyboardFocus = null;\n }\n}\nexports.default = _default;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createLinear = createLinear;\nvar KeyEmitter = _interopRequireWildcard(require(\"makeup-key-emitter\"));\nvar ExitEmitter = _interopRequireWildcard(require(\"makeup-exit-emitter\"));\nfunction _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\nconst defaultOptions = {\n axis: \"both\",\n autoInit: \"interactive\",\n autoReset: \"current\",\n ignoreByDelegateSelector: null,\n wrap: false\n};\nfunction isItemNavigable(el) {\n return !el.hidden && el.getAttribute(\"aria-disabled\") !== \"true\";\n}\nfunction isIndexNavigable(items, index) {\n return index >= 0 && index < items.length ? isItemNavigable(items[index]) : false;\n}\nfunction findNavigableItems(items) {\n return items.filter(isItemNavigable);\n}\nfunction findFirstNavigableIndex(items) {\n return items.findIndex(item => isItemNavigable(item));\n}\nfunction findLastNavigableIndex(items) {\n // todo: at(-1) is more performant than reverse(), but Babel is not transpiling it\n return items.indexOf(findNavigableItems(items).reverse()[0]);\n}\nfunction findIndexByAttribute(items, attribute, value) {\n return items.findIndex(item => isItemNavigable(item) && item.getAttribute(attribute) === value);\n}\nfunction findFirstNavigableAriaCheckedIndex(items) {\n return findIndexByAttribute(items, \"aria-checked\", \"true\");\n}\nfunction findFirstNavigableAriaSelectedIndex(items) {\n return findIndexByAttribute(items, \"aria-selected\", \"true\");\n}\nfunction findIgnoredByDelegateItems(el, options) {\n return options.ignoreByDelegateSelector !== null ? [...el.querySelectorAll(options.ignoreByDelegateSelector)] : [];\n}\nfunction findPreviousNavigableIndex(items, index, wrap) {\n let previousNavigableIndex = -1;\n if (index === null || atStart(items, index)) {\n if (wrap === true) {\n previousNavigableIndex = findLastNavigableIndex(items);\n }\n } else {\n let i = index;\n while (--i >= 0) {\n if (isItemNavigable(items[i])) {\n previousNavigableIndex = i;\n break;\n }\n }\n }\n return previousNavigableIndex;\n}\nfunction findNextNavigableIndex(items, index, wrap) {\n let nextNavigableIndex = -1;\n if (index === null) {\n nextNavigableIndex = findFirstNavigableIndex(items);\n } else if (atEnd(items, index)) {\n if (wrap === true) {\n nextNavigableIndex = findFirstNavigableIndex(items);\n }\n } else {\n let i = index;\n while (++i < items.length) {\n if (isItemNavigable(items[i])) {\n nextNavigableIndex = i;\n break;\n }\n }\n }\n return nextNavigableIndex;\n}\n\n// returning -1 means not found\nfunction findIndexPositionByType(typeOrNum, items, currentIndex) {\n let index = -1;\n switch (typeOrNum) {\n case \"none\":\n index = null;\n break;\n case \"current\":\n index = currentIndex;\n break;\n case \"interactive\":\n index = findFirstNavigableIndex(items);\n break;\n case \"ariaChecked\":\n index = findFirstNavigableAriaCheckedIndex(items);\n break;\n case \"ariaSelected\":\n index = findFirstNavigableAriaSelectedIndex(items);\n break;\n case \"ariaSelectedOrInteractive\":\n index = findFirstNavigableAriaSelectedIndex(items);\n index = index === -1 ? findFirstNavigableIndex(items) : index;\n break;\n default:\n index = typeof typeOrNum === \"number\" || typeOrNum === null ? typeOrNum : -1;\n }\n return index;\n}\nfunction atStart(items, index) {\n return index === findFirstNavigableIndex(items);\n}\nfunction atEnd(items, index) {\n return index === findLastNavigableIndex(items);\n}\nfunction onKeyPrev(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findPreviousNavigableIndex(this.items, this.index, this.options.wrap);\n }\n}\nfunction onKeyNext(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findNextNavigableIndex(this.items, this.index, this.options.wrap);\n }\n}\nfunction onClick(e) {\n const itemIndex = this.indexOf(e.target.closest(this._itemSelector));\n if (isIndexNavigable(this.items, itemIndex)) {\n this.index = itemIndex;\n }\n}\nfunction onKeyHome(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findFirstNavigableIndex(this.items);\n }\n}\nfunction onKeyEnd(e) {\n const ignoredByDelegateItems = findIgnoredByDelegateItems(this._el, this.options);\n\n // todo: update KeyEmitter to deal with ignored items?\n if (ignoredByDelegateItems.length === 0 || !ignoredByDelegateItems.includes(e.detail.target)) {\n this.index = findLastNavigableIndex(this.items);\n }\n}\nfunction onFocusExit() {\n if (this.options.autoReset !== null) {\n this.reset();\n }\n}\nfunction onMutation(e) {\n const fromIndex = this.index;\n let toIndex = this.index;\n // https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord\n const {\n addedNodes,\n attributeName,\n removedNodes,\n target,\n type\n } = e[0];\n if (type === \"attributes\") {\n if (target === this.currentItem) {\n if (attributeName === \"aria-disabled\") {\n // current item was disabled - keep it as current index (until a keyboard navigation happens)\n toIndex = this.index;\n } else if (attributeName === \"hidden\") {\n // current item was hidden and focus is lost - reset index to first interactive element\n toIndex = findFirstNavigableIndex(this.items);\n }\n } else {\n toIndex = this.index;\n }\n } else if (type === \"childList\") {\n if (removedNodes.length > 0 && [...removedNodes].includes(this._cachedElement)) {\n // current item was removed and focus is lost - reset index to first interactive element\n toIndex = findFirstNavigableIndex(this.items);\n } else if (removedNodes.length > 0 || addedNodes.length > 0) {\n // nodes were added and/or removed - keep current item and resync its index\n toIndex = this.indexOf(this._cachedElement);\n }\n }\n this._index = toIndex;\n this._el.dispatchEvent(new CustomEvent(\"navigationModelMutation\", {\n bubbles: false,\n detail: {\n fromIndex,\n toIndex\n }\n }));\n}\nclass NavigationModel {\n /**\n * @param {HTMLElement} el\n * @param {string} itemSelector\n * @param {typeof defaultOptions} selectedOptions\n */\n constructor(el, itemSelector, selectedOptions) {\n /** @member {typeof defaultOptions} */\n this.options = Object.assign({}, defaultOptions, selectedOptions);\n\n /** @member {HTMLElement} */\n this._el = el;\n\n /** @member {string} */\n this._itemSelector = itemSelector;\n }\n}\nclass LinearNavigationModel extends NavigationModel {\n /**\n * @param {HTMLElement} el\n * @param {string} itemSelector\n * @param {typeof defaultOptions} selectedOptions\n */\n constructor(el, itemSelector, selectedOptions) {\n super(el, itemSelector, selectedOptions);\n const fromIndex = this._index;\n const toIndex = findIndexPositionByType(this.options.autoInit, this.items, this.index);\n\n // do not use setter as it will trigger a change event\n this._index = toIndex;\n\n // always keep an element reference to the last item (for use in mutation observer)\n // todo: convert index to Tuple to store last/current values instead?\n this._cachedElement = this.items[toIndex];\n this._el.dispatchEvent(new CustomEvent(\"navigationModelInit\", {\n bubbles: false,\n detail: {\n firstInteractiveIndex: this.firstNavigableIndex,\n fromIndex,\n items: this.items,\n toIndex\n }\n }));\n }\n get currentItem() {\n return this.items[this.index];\n }\n\n // todo: code smell as getter abstracts that the query selector re-runs every time getter is accessed\n get items() {\n return [...this._el.querySelectorAll(`${this._itemSelector}`)];\n }\n get index() {\n return this._index;\n }\n\n /**\n * @param {number} toIndex - update index position in this.items (non-interactive indexes fail silently)\n */\n set index(toIndex) {\n if (toIndex === this.index) {\n return;\n } else if (!isIndexNavigable(this.items, toIndex)) {\n // no-op. throw exception?\n } else {\n const fromIndex = this.index;\n // update cached element reference (for use in mutation observer if DOM node gets removed)\n this._cachedElement = this.items[toIndex];\n this._index = toIndex;\n this._el.dispatchEvent(new CustomEvent(\"navigationModelChange\", {\n bubbles: false,\n detail: {\n fromIndex,\n toIndex\n }\n }));\n }\n }\n indexOf(element) {\n return this.items.indexOf(element);\n }\n reset() {\n const fromIndex = this.index;\n const toIndex = findIndexPositionByType(this.options.autoReset, this.items, this.index);\n if (toIndex !== fromIndex) {\n // do not use setter as it will trigger a navigationModelChange event\n this._index = toIndex;\n this._el.dispatchEvent(new CustomEvent(\"navigationModelReset\", {\n bubbles: false,\n detail: {\n fromIndex,\n toIndex\n }\n }));\n }\n }\n}\n\n// 2D Grid Model will go here\n\n/*\nclass GridModel extends NavigationModel {\n constructor(el, rowSelector, colSelector) {\n super();\n this._coords = null;\n }\n}\n*/\n\nclass NavigationEmitter {\n /**\n * @param {HTMLElement} el\n * @param {LinearNavigationModel} model\n */\n constructor(el, model) {\n this.model = model;\n this.el = el;\n this._keyPrevListener = onKeyPrev.bind(model);\n this._keyNextListener = onKeyNext.bind(model);\n this._keyHomeListener = onKeyHome.bind(model);\n this._keyEndListener = onKeyEnd.bind(model);\n this._clickListener = onClick.bind(model);\n this._focusExitListener = onFocusExit.bind(model);\n this._observer = new MutationObserver(onMutation.bind(model));\n KeyEmitter.addKeyDown(this.el);\n ExitEmitter.addFocusExit(this.el);\n const axis = model.options.axis;\n if (axis === \"both\" || axis === \"x\") {\n this.el.addEventListener(\"arrowLeftKeyDown\", this._keyPrevListener);\n this.el.addEventListener(\"arrowRightKeyDown\", this._keyNextListener);\n }\n if (axis === \"both\" || axis === \"y\") {\n this.el.addEventListener(\"arrowUpKeyDown\", this._keyPrevListener);\n this.el.addEventListener(\"arrowDownKeyDown\", this._keyNextListener);\n }\n this.el.addEventListener(\"homeKeyDown\", this._keyHomeListener);\n this.el.addEventListener(\"endKeyDown\", this._keyEndListener);\n this.el.addEventListener(\"click\", this._clickListener);\n this.el.addEventListener(\"focusExit\", this._focusExitListener);\n this._observer.observe(this.el, {\n childList: true,\n subtree: true,\n attributeFilter: [\"aria-disabled\", \"hidden\"],\n attributes: true,\n attributeOldValue: true\n });\n }\n destroy() {\n KeyEmitter.removeKeyDown(this.el);\n ExitEmitter.removeFocusExit(this.el);\n this.el.removeEventListener(\"arrowLeftKeyDown\", this._keyPrevListener);\n this.el.removeEventListener(\"arrowRightKeyDown\", this._keyNextListener);\n this.el.removeEventListener(\"arrowUpKeyDown\", this._keyPrevListener);\n this.el.removeEventListener(\"arrowDownKeyDown\", this._keyNextListener);\n this.el.removeEventListener(\"homeKeyDown\", this._keyHomeListener);\n this.el.removeEventListener(\"endKeyDown\", this._keyEndListener);\n this.el.removeEventListener(\"click\", this._clickListener);\n this.el.removeEventListener(\"focusExit\", this._focusExitListener);\n this._observer.disconnect();\n }\n}\nfunction createLinear(el, itemSelector, selectedOptions) {\n const model = new LinearNavigationModel(el, itemSelector, selectedOptions);\n return new NavigationEmitter(el, model);\n}\n\n/*\nstatic createGrid(el, rowSelector, colSelector, selectedOptions) {\n return null;\n}\n*/\n","require('./../dist/tokens/evo-core.css');\n","require('./dist/menu-button/menu-button.css');\n","// extracted by mini-css-extract-plugin\nexport {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.add = add;\nexports.remove = remove;\nfunction onKeyDown(e) {\n if (e.keyCode >= 32 && e.keyCode <= 40) {\n e.preventDefault();\n }\n}\nfunction add(el) {\n el.addEventListener(\"keydown\", onKeyDown);\n}\nfunction remove(el) {\n el.removeEventListener(\"keydown\", onKeyDown);\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\"use strict\";\n\nrequire(\"../../docs.css\");\nrequire(\"@ebay/skin/tokens\");\nrequire(\"@ebay/skin/global\");\nrequire(\"@ebay/skin/button\");\nrequire(\"@ebay/skin/menu-button\");\nvar _makeupMenuButton = _interopRequireDefault(require(\"makeup-menu-button\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\n// REQUIRE\n// const MenuButton = require('makeup-menu-button').default;\n\n// IMPORT\n\nwindow.onload = function () {\n document.querySelectorAll(\".menu-button\").forEach(function (el, i) {\n const hasCustomLabel = el.classList.contains(\"menu-button-with-icon-customText\");\n const hasIconText = el.classList.contains(\"menu-button-with-iconText\");\n const hasIcon = el.classList.contains(\"menu-button-with-icon\");\n let buttonValueType;\n if (hasIconText) {\n buttonValueType = \"both\";\n } else if (hasIcon || hasCustomLabel) {\n buttonValueType = \"icon\";\n } else {\n buttonValueType = \"text\";\n }\n const menuItemButtonAriaLabelSelector = hasCustomLabel ? \".menu-button__item-value span\" : null;\n const widget = new _makeupMenuButton.default(el, {\n buttonValueType,\n menuItemButtonAriaLabelSelector\n });\n widget.menu.el.addEventListener(\"makeup-menu-select\", e => console.log(e.type, e.detail));\n widget.menu.el.addEventListener(\"makeup-menu-change\", e => console.log(e.type, e.detail));\n widget.menu.el.addEventListener(\"makeup-menu-button-mutation\", e => console.log(e.type, e.detail));\n });\n};"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/packages/core/makeup-expander/README.md b/packages/core/makeup-expander/README.md index 5bd1e6fb..923b9325 100644 --- a/packages/core/makeup-expander/README.md +++ b/packages/core/makeup-expander/README.md @@ -6,13 +6,13 @@ Creates the basic interactivity for an element that expands and collapses anothe This module is still in an experimental state, until it reaches v1 you must consider all minor releases as breaking changes. -## Example 1: Requires aria-expanded only +## Example 1: Uses aria-expanded In the first example, our expanded content is adjacent to the host element. ```html
- +

Any kind of HTML control can go inside...

A link: www.ebay.com

@@ -38,7 +38,7 @@ const options = { const widget = new Expander(widgetEl, options); ``` -Clicking the button will now toggle its aria-expanded state. CSS can be used to display the content accordingly, for example: +Clicking the button will now toggle its expanded state (setting aria-expanded on the element, by default). CSS can be used to display the content accordingly, for example: ```css .expander__content { @@ -50,9 +50,9 @@ Clicking the button will now toggle its aria-expanded state. CSS can be used to } ``` -## Example 2: Requires aria-expanded and a class +## Example 2: Uses a class -In this second example, our expanded content is not adjacent to the host element. +In this second example, we use a class. This can be useful when our expanded content is not adjacent to the host element or when aria-expanded is not required. ```html
@@ -79,7 +79,7 @@ const options = { }; ``` -Setting focus on the host (a text input) sets it's aria-expanded state _and_ add adds the chosen class to the root. CSS can be used to display the content accordingly, for example: +Setting focus on the host adds the chosen class to the root. CSS can be used to display the content accordingly, for example: ```css .expander--expanded .expander__content { @@ -103,7 +103,8 @@ Setting focus on the host (a text input) sets it's aria-expanded state _and_ add - `options.expandOnHover`: whether the host should be hover activated (default: false) - `options.focusManagement`: where keyboard focus should go (null, 'content', 'focusable', 'interactive', or ID reference) when expanded via `ENTER` or `SPACEBAR` (default: null) - `options.hostSelector`: the query selector for the host element in relation to the widget (default: '.expander\_\_host') -- `options.expandedClass`: the class which will be used on the root element to signify expanded state. **Example:** `foo--expanded`; this mirrors the `aria-expanded="true"` setting on the host element +- `options.expandedClass`: the class which will be used on the root element to signify expanded state. +- `options.useAriaExpanded`: set to false for tooltips (default: true) ## Properties @@ -117,13 +118,6 @@ Set the following properties to true or false to enable or disable the behaviour - `expandOnFocus` - `expandOnHover` -## Methods - -- `collapse()`: set state to collapsed (DEPRECATED) -- `expand()`: set state to expanded (DEPRECATED) -- `isExpanded()`: returns expanded state (DEPRECATED) -- `toggle()`: toggle expanded/collapsed state (DEPRECATED) - ## Events - `expander-collapse` diff --git a/packages/core/makeup-expander/dist/cjs/index.js b/packages/core/makeup-expander/dist/cjs/index.js index c6b7a955..abe269e4 100644 --- a/packages/core/makeup-expander/dist/cjs/index.js +++ b/packages/core/makeup-expander/dist/cjs/index.js @@ -24,7 +24,8 @@ const defaultOptions = { expandOnHover: false, focusManagement: null, hostSelector: ".expander__host", - simulateSpacebarClick: false + simulateSpacebarClick: false, + useAriaExpanded: true }; function onHostKeyDown(e) { if (e.keyCode === 13 || e.keyCode === 32) { @@ -124,8 +125,14 @@ class _default { this._hostHoverListener = onHostHover.bind(this); this._focusExitListener = onFocusExit.bind(this); this._mouseLeaveListener = onMouseLeave.bind(this); - if (this.hostEl.getAttribute("aria-expanded") === null) { - this.hostEl.setAttribute("aria-expanded", "false"); + if (this.options.useAriaExpanded === true) { + const initialAriaExpanded = this.hostEl.getAttribute("aria-expanded"); + this._expanded = initialAriaExpanded === "true"; + if (initialAriaExpanded === null) { + this.hostEl.setAttribute("aria-expanded", "false"); + } + } else { + this._expanded = false; } if (this.options.ariaControls === true) { // ensure the widget has an id @@ -218,11 +225,13 @@ class _default { } } get expanded() { - return this.hostEl.getAttribute("aria-expanded") === "true"; + return this._expanded; } set expanded(bool) { if (bool === true && this.expanded === false) { - this.hostEl.setAttribute("aria-expanded", "true"); + if (this.options.useAriaExpanded === true) { + this.hostEl.setAttribute("aria-expanded", "true"); + } if (this.options.expandedClass) { this.el.classList.add(this.options.expandedClass); } @@ -235,7 +244,9 @@ class _default { })); } if (bool === false && this.expanded === true) { - this.hostEl.setAttribute("aria-expanded", "false"); + if (this.options.useAriaExpanded === true) { + this.hostEl.setAttribute("aria-expanded", "false"); + } if (this.options.expandedClass) { this.el.classList.remove(this.options.expandedClass); } @@ -244,6 +255,7 @@ class _default { detail: this.contentEl })); } + this._expanded = bool; this._expandWasKeyboardClickActivated = false; this._expandWasMouseClickActivated = false; this._expandWasFocusActivated = false; diff --git a/packages/core/makeup-expander/dist/mjs/index.js b/packages/core/makeup-expander/dist/mjs/index.js index ce6da763..69e61ef5 100644 --- a/packages/core/makeup-expander/dist/mjs/index.js +++ b/packages/core/makeup-expander/dist/mjs/index.js @@ -16,7 +16,8 @@ const defaultOptions = { expandOnHover: false, focusManagement: null, hostSelector: ".expander__host", - simulateSpacebarClick: false + simulateSpacebarClick: false, + useAriaExpanded: true }; function onHostKeyDown(e) { if (e.keyCode === 13 || e.keyCode === 32) { @@ -112,8 +113,14 @@ class index_default { this._hostHoverListener = onHostHover.bind(this); this._focusExitListener = onFocusExit.bind(this); this._mouseLeaveListener = onMouseLeave.bind(this); - if (this.hostEl.getAttribute("aria-expanded") === null) { - this.hostEl.setAttribute("aria-expanded", "false"); + if (this.options.useAriaExpanded === true) { + const initialAriaExpanded = this.hostEl.getAttribute("aria-expanded"); + this._expanded = initialAriaExpanded === "true"; + if (initialAriaExpanded === null) { + this.hostEl.setAttribute("aria-expanded", "false"); + } + } else { + this._expanded = false; } if (this.options.ariaControls === true) { nextID(this.el, "expander"); @@ -205,11 +212,13 @@ class index_default { } } get expanded() { - return this.hostEl.getAttribute("aria-expanded") === "true"; + return this._expanded; } set expanded(bool) { if (bool === true && this.expanded === false) { - this.hostEl.setAttribute("aria-expanded", "true"); + if (this.options.useAriaExpanded === true) { + this.hostEl.setAttribute("aria-expanded", "true"); + } if (this.options.expandedClass) { this.el.classList.add(this.options.expandedClass); } @@ -219,12 +228,15 @@ class index_default { this.el.dispatchEvent(new CustomEvent("expander-expand", { bubbles: true, detail: this.contentEl })); } if (bool === false && this.expanded === true) { - this.hostEl.setAttribute("aria-expanded", "false"); + if (this.options.useAriaExpanded === true) { + this.hostEl.setAttribute("aria-expanded", "false"); + } if (this.options.expandedClass) { this.el.classList.remove(this.options.expandedClass); } this.el.dispatchEvent(new CustomEvent("expander-collapse", { bubbles: true, detail: this.contentEl })); } + this._expanded = bool; this._expandWasKeyboardClickActivated = false; this._expandWasMouseClickActivated = false; this._expandWasFocusActivated = false; diff --git a/packages/core/makeup-expander/src/index.js b/packages/core/makeup-expander/src/index.js index 72ebe200..ee3cc685 100644 --- a/packages/core/makeup-expander/src/index.js +++ b/packages/core/makeup-expander/src/index.js @@ -18,6 +18,7 @@ const defaultOptions = { focusManagement: null, hostSelector: ".expander__host", simulateSpacebarClick: false, + useAriaExpanded: true, }; function onHostKeyDown(e) { @@ -134,8 +135,14 @@ export default class { this._focusExitListener = onFocusExit.bind(this); this._mouseLeaveListener = onMouseLeave.bind(this); - if (this.hostEl.getAttribute("aria-expanded") === null) { - this.hostEl.setAttribute("aria-expanded", "false"); + if (this.options.useAriaExpanded === true) { + const initialAriaExpanded = this.hostEl.getAttribute("aria-expanded"); + this._expanded = initialAriaExpanded === "true"; + if (initialAriaExpanded === null) { + this.hostEl.setAttribute("aria-expanded", "false"); + } + } else { + this._expanded = false; } if (this.options.ariaControls === true) { @@ -242,12 +249,14 @@ export default class { } get expanded() { - return this.hostEl.getAttribute("aria-expanded") === "true"; + return this._expanded; } set expanded(bool) { if (bool === true && this.expanded === false) { - this.hostEl.setAttribute("aria-expanded", "true"); + if (this.options.useAriaExpanded === true) { + this.hostEl.setAttribute("aria-expanded", "true"); + } if (this.options.expandedClass) { this.el.classList.add(this.options.expandedClass); } @@ -261,13 +270,17 @@ export default class { } if (bool === false && this.expanded === true) { - this.hostEl.setAttribute("aria-expanded", "false"); + if (this.options.useAriaExpanded === true) { + this.hostEl.setAttribute("aria-expanded", "false"); + } if (this.options.expandedClass) { this.el.classList.remove(this.options.expandedClass); } this.el.dispatchEvent(new CustomEvent("expander-collapse", { bubbles: true, detail: this.contentEl })); } + this._expanded = bool; + this._expandWasKeyboardClickActivated = false; this._expandWasMouseClickActivated = false; this._expandWasFocusActivated = false;