@govtechsg/sgds-web-component 3.5.6-rc.4 → 3.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base/dropdown-list-element.js +0 -1
- package/base/dropdown-list-element.js.map +1 -1
- package/components/Breadcrumb/index.umd.min.js +1 -1
- package/components/Breadcrumb/index.umd.min.js.map +1 -1
- package/components/ComboBox/index.umd.min.js +2 -2
- package/components/ComboBox/index.umd.min.js.map +1 -1
- package/components/ComboBox/sgds-combo-box.js +33 -17
- package/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/components/Dropdown/index.umd.min.js +1 -1
- package/components/Dropdown/index.umd.min.js.map +1 -1
- package/components/Mainnav/index.umd.min.js +1 -1
- package/components/Mainnav/index.umd.min.js.map +1 -1
- package/components/OverflowMenu/index.umd.min.js +1 -1
- package/components/OverflowMenu/index.umd.min.js.map +1 -1
- package/components/Select/index.umd.min.js +1 -1
- package/components/Select/index.umd.min.js.map +1 -1
- package/components/Skeleton/index.umd.min.js +9 -5
- package/components/Skeleton/index.umd.min.js.map +1 -1
- package/components/Skeleton/sgds-skeleton.d.ts +0 -2
- package/components/Skeleton/sgds-skeleton.js +13 -11
- package/components/Skeleton/sgds-skeleton.js.map +1 -1
- package/components/Skeleton/skeleton.js +1 -1
- package/components/index.umd.min.js +8 -4
- package/components/index.umd.min.js.map +1 -1
- package/index.umd.min.js +8 -4
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/base/dropdown-list-element.cjs.js +0 -1
- package/react/base/dropdown-list-element.cjs.js.map +1 -1
- package/react/base/dropdown-list-element.js +0 -1
- package/react/base/dropdown-list-element.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.cjs.js +33 -17
- package/react/components/ComboBox/sgds-combo-box.cjs.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.js +33 -17
- package/react/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/react/components/Skeleton/sgds-skeleton.cjs.js +13 -11
- package/react/components/Skeleton/sgds-skeleton.cjs.js.map +1 -1
- package/react/components/Skeleton/sgds-skeleton.js +13 -11
- package/react/components/Skeleton/sgds-skeleton.js.map +1 -1
- package/react/components/Skeleton/skeleton.cjs.js +1 -1
- package/react/components/Skeleton/skeleton.js +1 -1
|
@@ -115,7 +115,6 @@ class DropdownListElement extends DropdownElement {
|
|
|
115
115
|
// Use modulo for looping
|
|
116
116
|
const idx = ((currentItemIdx % items.length) + items.length) % items.length;
|
|
117
117
|
const activeItem = items[idx];
|
|
118
|
-
console.log(activeItem, "activeItem");
|
|
119
118
|
this.emit("i-sgds-option-focus", { detail: { option: activeItem } });
|
|
120
119
|
this.nextDropdownItemNo = (idx + 1) % items.length;
|
|
121
120
|
this.prevDropdownItemNo = (idx - 1 + items.length) % items.length;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-list-element.js","sources":["../../src/base/dropdown-list-element.ts"],"sourcesContent":["import { property, query, state } from \"lit/decorators.js\";\nimport { DropdownElement } from \"./dropdown-element\";\nimport { SgdsDropdownItem } from \"../components\";\nimport { PropertyValueMap } from \"lit\";\n\nconst TAB = \"Tab\";\nconst ARROW_DOWN = \"ArrowDown\";\nconst ARROW_UP = \"ArrowUp\";\nconst ENTER = \"Enter\";\n\n/**\n * @event sgds-select - Emitted event when a slot item is selected\n */\nexport class DropdownListElement extends DropdownElement {\n static styles = DropdownElement.styles;\n\n /**@internal */\n @query(\"ul.dropdown-menu\")\n private menu: HTMLUListElement;\n\n /** @internal */\n @state()\n nextDropdownItemNo = 0;\n\n /** @internal */\n @state()\n prevDropdownItemNo = -1;\n\n @property({ type: Boolean, reflect: true })\n hidden = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.addEventListener(\"sgds-hide\", this._resetMenu);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener(\"sgds-hide\", this._resetMenu);\n }\n\n firstUpdated(changedProperties: PropertyValueMap<this>) {\n super.firstUpdated(changedProperties);\n this.addEventListener(\"keydown\", this._handleKeyboardMenuItemsEvent);\n }\n\n protected handleSelectSlot(e: KeyboardEvent | MouseEvent) {\n const items = this._getActiveMenuItems();\n const currentItemNo = items.indexOf(e.target as SgdsDropdownItem);\n this.nextDropdownItemNo = currentItemNo + 1;\n this.prevDropdownItemNo = currentItemNo <= 0 ? items.length - 1 : currentItemNo - 1;\n\n /** Emitted event from SgdsDropdown element when a slot item is selected */\n const selectedItem = e.target as SgdsDropdownItem;\n if (!selectedItem.disabled) {\n this.emit(\"sgds-select\");\n if (this.close !== \"outside\") {\n this.hideMenu(); // <-- Use new API\n }\n }\n }\n\n private _resetMenu() {\n this.nextDropdownItemNo = 0;\n this.prevDropdownItemNo = -1;\n // reset the tabindex\n const items = this._getMenuItems();\n items.forEach(item => {\n const dropdownItem = item?.shadowRoot?.querySelector(\".dropdown-item\") as HTMLAnchorElement;\n dropdownItem && dropdownItem.removeAttribute(\"tabindex\");\n });\n }\n protected _handleKeyboardMenuItemsEvent(e: KeyboardEvent) {\n if (this.readonly) return;\n const menuItems = this._getActiveMenuItems();\n if (menuItems.length === 0) return;\n\n switch (e.key) {\n case ARROW_DOWN:\n e.preventDefault();\n this._setMenuItem(this.nextDropdownItemNo);\n break;\n case ARROW_UP:\n e.preventDefault();\n this._setMenuItem(this.prevDropdownItemNo);\n break;\n case TAB:\n if (!this.menuIsOpen) return;\n e.preventDefault();\n if (e.shiftKey) {\n this._setMenuItem(this.prevDropdownItemNo);\n } else {\n this._setMenuItem(this.nextDropdownItemNo);\n }\n break;\n case ENTER:\n if (menuItems.includes(e.target as SgdsDropdownItem)) {\n this.handleSelectSlot(e);\n }\n break;\n default:\n break;\n }\n }\n\n private _getMenuItems(): SgdsDropdownItem[] {\n const defaultSlot = this.shadowRoot.querySelector(\"slot#default\");\n // for case when default slot is used e.g. dropdown, mainnavdropdown\n if (defaultSlot) {\n const defaultSlotItems = (this.shadowRoot.querySelector(\"slot#default\") as HTMLSlotElement)\n ?.assignedElements({\n flatten: true\n })\n .filter(el => !el.classList.contains(\"empty-menu\") && !el.hasAttribute(\"hidden\")) as SgdsDropdownItem[];\n return defaultSlotItems;\n }\n // for case when there is no slot e.g. combobox\n if (this.menu?.hasChildNodes()) {\n const menuItems = Array.from(this.menu.children);\n return [...menuItems] as SgdsDropdownItem[];\n }\n\n return [];\n }\n\n private _getActiveMenuItems(): SgdsDropdownItem[] {\n return this._getMenuItems().filter(item => !item.disabled && !item.hidden);\n }\n private _setMenuItem(currentItemIdx: number) {\n const items = this._getActiveMenuItems();\n if (items.length === 0) return;\n\n // Use modulo for looping\n const idx = ((currentItemIdx % items.length) + items.length) % items.length;\n const activeItem = items[idx];\n
|
|
1
|
+
{"version":3,"file":"dropdown-list-element.js","sources":["../../src/base/dropdown-list-element.ts"],"sourcesContent":["import { property, query, state } from \"lit/decorators.js\";\nimport { DropdownElement } from \"./dropdown-element\";\nimport { SgdsDropdownItem } from \"../components\";\nimport { PropertyValueMap } from \"lit\";\n\nconst TAB = \"Tab\";\nconst ARROW_DOWN = \"ArrowDown\";\nconst ARROW_UP = \"ArrowUp\";\nconst ENTER = \"Enter\";\n\n/**\n * @event sgds-select - Emitted event when a slot item is selected\n */\nexport class DropdownListElement extends DropdownElement {\n static styles = DropdownElement.styles;\n\n /**@internal */\n @query(\"ul.dropdown-menu\")\n private menu: HTMLUListElement;\n\n /** @internal */\n @state()\n nextDropdownItemNo = 0;\n\n /** @internal */\n @state()\n prevDropdownItemNo = -1;\n\n @property({ type: Boolean, reflect: true })\n hidden = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.addEventListener(\"sgds-hide\", this._resetMenu);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener(\"sgds-hide\", this._resetMenu);\n }\n\n firstUpdated(changedProperties: PropertyValueMap<this>) {\n super.firstUpdated(changedProperties);\n this.addEventListener(\"keydown\", this._handleKeyboardMenuItemsEvent);\n }\n\n protected handleSelectSlot(e: KeyboardEvent | MouseEvent) {\n const items = this._getActiveMenuItems();\n const currentItemNo = items.indexOf(e.target as SgdsDropdownItem);\n this.nextDropdownItemNo = currentItemNo + 1;\n this.prevDropdownItemNo = currentItemNo <= 0 ? items.length - 1 : currentItemNo - 1;\n\n /** Emitted event from SgdsDropdown element when a slot item is selected */\n const selectedItem = e.target as SgdsDropdownItem;\n if (!selectedItem.disabled) {\n this.emit(\"sgds-select\");\n if (this.close !== \"outside\") {\n this.hideMenu(); // <-- Use new API\n }\n }\n }\n\n private _resetMenu() {\n this.nextDropdownItemNo = 0;\n this.prevDropdownItemNo = -1;\n // reset the tabindex\n const items = this._getMenuItems();\n items.forEach(item => {\n const dropdownItem = item?.shadowRoot?.querySelector(\".dropdown-item\") as HTMLAnchorElement;\n dropdownItem && dropdownItem.removeAttribute(\"tabindex\");\n });\n }\n protected _handleKeyboardMenuItemsEvent(e: KeyboardEvent) {\n if (this.readonly) return;\n const menuItems = this._getActiveMenuItems();\n if (menuItems.length === 0) return;\n\n switch (e.key) {\n case ARROW_DOWN:\n e.preventDefault();\n this._setMenuItem(this.nextDropdownItemNo);\n break;\n case ARROW_UP:\n e.preventDefault();\n this._setMenuItem(this.prevDropdownItemNo);\n break;\n case TAB:\n if (!this.menuIsOpen) return;\n e.preventDefault();\n if (e.shiftKey) {\n this._setMenuItem(this.prevDropdownItemNo);\n } else {\n this._setMenuItem(this.nextDropdownItemNo);\n }\n break;\n case ENTER:\n if (menuItems.includes(e.target as SgdsDropdownItem)) {\n this.handleSelectSlot(e);\n }\n break;\n default:\n break;\n }\n }\n\n private _getMenuItems(): SgdsDropdownItem[] {\n const defaultSlot = this.shadowRoot.querySelector(\"slot#default\");\n // for case when default slot is used e.g. dropdown, mainnavdropdown\n if (defaultSlot) {\n const defaultSlotItems = (this.shadowRoot.querySelector(\"slot#default\") as HTMLSlotElement)\n ?.assignedElements({\n flatten: true\n })\n .filter(el => !el.classList.contains(\"empty-menu\") && !el.hasAttribute(\"hidden\")) as SgdsDropdownItem[];\n return defaultSlotItems;\n }\n // for case when there is no slot e.g. combobox\n if (this.menu?.hasChildNodes()) {\n const menuItems = Array.from(this.menu.children);\n return [...menuItems] as SgdsDropdownItem[];\n }\n\n return [];\n }\n\n private _getActiveMenuItems(): SgdsDropdownItem[] {\n return this._getMenuItems().filter(item => !item.disabled && !item.hidden);\n }\n private _setMenuItem(currentItemIdx: number) {\n const items = this._getActiveMenuItems();\n if (items.length === 0) return;\n\n // Use modulo for looping\n const idx = ((currentItemIdx % items.length) + items.length) % items.length;\n const activeItem = items[idx];\n this.emit(\"i-sgds-option-focus\", { detail: { option: activeItem } });\n this.nextDropdownItemNo = (idx + 1) % items.length;\n this.prevDropdownItemNo = (idx - 1 + items.length) % items.length;\n\n items.forEach(item => {\n const dropdownItem = item.shadowRoot.querySelector(\".dropdown-item\") as HTMLAnchorElement;\n dropdownItem.setAttribute(\"tabindex\", item === activeItem ? \"0\" : \"-1\");\n if (item === activeItem) dropdownItem.focus();\n });\n }\n}\n"],"names":[],"mappings":";;;;AAKA,MAAM,GAAG,GAAG,KAAK,CAAC;AAClB,MAAM,UAAU,GAAG,WAAW,CAAC;AAC/B,MAAM,QAAQ,GAAG,SAAS,CAAC;AAC3B,MAAM,KAAK,GAAG,OAAO,CAAC;AAEtB;;AAEG;AACG,MAAO,mBAAoB,SAAQ,eAAe,CAAA;AAAxD,IAAA,WAAA,GAAA;;;QASE,IAAkB,CAAA,kBAAA,GAAG,CAAC,CAAC;;QAIvB,IAAkB,CAAA,kBAAA,GAAG,CAAC,CAAC,CAAC;QAGxB,IAAM,CAAA,MAAA,GAAG,KAAK,CAAC;KAoHhB;IAlHC,iBAAiB,GAAA;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;KACrD;IAED,oBAAoB,GAAA;QAClB,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,IAAI,CAAC,mBAAmB,CAA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AAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC5B,CAAA,EAAA,mBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,KAAA,CAAA,CAAA;;;;"}
|
|
@@ -87,7 +87,7 @@ const Pe=globalThis,Ae=Pe.ShadowRoot&&(void 0===Pe.ShadyCSS||Pe.ShadyCSS.nativeS
|
|
|
87
87
|
* @license
|
|
88
88
|
* Copyright 2020 Google LLC
|
|
89
89
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
90
|
-
*/const yt=()=>new Ct;class Ct{}const bt=new WeakMap;const Zt=ht(class extends xt{render(e){return he}update(e,[t]){const i=t!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=t,this._context=e.options?.host,this._updateRefValue(this._element=e.element)),he}_updateRefValue(e){if(this.isConnected||(e=void 0),"function"==typeof this._ref){const t=this._context??globalThis;let i=bt.get(t);void 0===i&&(i=new WeakMap,bt.set(t,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,e),void 0!==e&&this._ref.call(this._context,e)}else this._ref.value=e}get _lastElementForRef(){return"function"==typeof this._ref?bt.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),_t=Math.min,Mt=Math.max,Vt=Math.round,Ht=Math.floor,St=e=>({x:e,y:e}),$t={left:"right",right:"left",bottom:"top",top:"bottom"},kt={start:"end",end:"start"};function Bt(e,t,i){return Mt(e,_t(t,i))}function Pt(e,t){return"function"==typeof e?e(t):e}function At(e){return e.split("-")[0]}function Lt(e){return e.split("-")[1]}function Et(e){return"x"===e?"y":"x"}function Tt(e){return"y"===e?"height":"width"}const Ot=new Set(["top","bottom"]);function Rt(e){return Ot.has(At(e))?"y":"x"}function Ut(e){return Et(Rt(e))}function zt(e,t,i){void 0===i&&(i=!1);const l=Lt(e),o=Ut(e),a=Tt(o);let n="x"===o?l===(i?"end":"start")?"right":"left":"start"===l?"bottom":"top";return t.reference[a]>t.floating[a]&&(n=jt(n)),[n,jt(n)]}function Nt(e){return e.replace(/start|end/g,(e=>kt[e]))}const Dt=["left","right"],It=["right","left"],Wt=["top","bottom"],Ft=["bottom","top"];function qt(e,t,i,l){const o=Lt(e);let a=function(e,t,i){switch(e){case"top":case"bottom":return i?t?It:Dt:t?Dt:It;case"left":case"right":return t?Wt:Ft;default:return[]}}(At(e),"start"===i,l);return o&&(a=a.map((e=>e+"-"+o)),t&&(a=a.concat(a.map(Nt)))),a}function jt(e){return e.replace(/left|right|bottom|top/g,(e=>$t[e]))}function Jt(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Kt(e){const{x:t,y:i,width:l,height:o}=e;return{width:l,height:o,top:i,left:t,right:t+l,bottom:i+o,x:t,y:i}}function Yt(e,t,i){let{reference:l,floating:o}=e;const a=Rt(t),n=Ut(t),r=Tt(n),s=At(t),c="y"===a,d=l.x+l.width/2-o.width/2,h=l.y+l.height/2-o.height/2,v=l[r]/2-o[r]/2;let p;switch(s){case"top":p={x:d,y:l.y-o.height};break;case"bottom":p={x:d,y:l.y+l.height};break;case"right":p={x:l.x+l.width,y:h};break;case"left":p={x:l.x-o.width,y:h};break;default:p={x:l.x,y:l.y}}switch(Lt(t)){case"start":p[n]-=v*(i&&c?-1:1);break;case"end":p[n]+=v*(i&&c?-1:1)}return p}async function Xt(e,t){var i;void 0===t&&(t={});const{x:l,y:o,platform:a,rects:n,elements:r,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:v=!1,padding:p=0}=Pt(t,e),u=Jt(p),g=r[v?"floating"===h?"reference":"floating":h],f=Kt(await a.getClippingRect({element:null==(i=await(null==a.isElement?void 0:a.isElement(g)))||i?g:g.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(r.floating)),boundary:c,rootBoundary:d,strategy:s})),w="floating"===h?{x:l,y:o,width:n.floating.width,height:n.floating.height}:n.reference,m=await(null==a.getOffsetParent?void 0:a.getOffsetParent(r.floating)),x=await(null==a.isElement?void 0:a.isElement(m))&&await(null==a.getScale?void 0:a.getScale(m))||{x:1,y:1},y=Kt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:r,rect:w,offsetParent:m,strategy:s}):w);return{top:(f.top-y.top+u.top)/x.y,bottom:(y.bottom-f.bottom+u.bottom)/x.y,left:(f.left-y.left+u.left)/x.x,right:(y.right-f.right+u.right)/x.x}}const Gt=new Set(["left","top"]);function Qt(){return"undefined"!=typeof window}function ei(e){return li(e)?(e.nodeName||"").toLowerCase():"#document"}function ti(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ii(e){var t;return null==(t=(li(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function li(e){return!!Qt()&&(e instanceof Node||e instanceof ti(e).Node)}function oi(e){return!!Qt()&&(e instanceof Element||e instanceof ti(e).Element)}function ai(e){return!!Qt()&&(e instanceof HTMLElement||e instanceof ti(e).HTMLElement)}function ni(e){return!(!Qt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ti(e).ShadowRoot)}const ri=new Set(["inline","contents"]);function si(e){const{overflow:t,overflowX:i,overflowY:l,display:o}=yi(e);return/auto|scroll|overlay|hidden|clip/.test(t+l+i)&&!ri.has(o)}const ci=new Set(["table","td","th"]);function di(e){return ci.has(ei(e))}const hi=[":popover-open",":modal"];function vi(e){return hi.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}const pi=["transform","translate","scale","rotate","perspective"],ui=["transform","translate","scale","rotate","perspective","filter"],gi=["paint","layout","strict","content"];function fi(e){const t=wi(),i=oi(e)?yi(e):e;return pi.some((e=>!!i[e]&&"none"!==i[e]))||!!i.containerType&&"normal"!==i.containerType||!t&&!!i.backdropFilter&&"none"!==i.backdropFilter||!t&&!!i.filter&&"none"!==i.filter||ui.some((e=>(i.willChange||"").includes(e)))||gi.some((e=>(i.contain||"").includes(e)))}function wi(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const mi=new Set(["html","body","#document"]);function xi(e){return mi.has(ei(e))}function yi(e){return ti(e).getComputedStyle(e)}function Ci(e){return oi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bi(e){if("html"===ei(e))return e;const t=e.assignedSlot||e.parentNode||ni(e)&&e.host||ii(e);return ni(t)?t.host:t}function Zi(e){const t=bi(e);return xi(t)?e.ownerDocument?e.ownerDocument.body:e.body:ai(t)&&si(t)?t:Zi(t)}function _i(e,t,i){var l;void 0===t&&(t=[]),void 0===i&&(i=!0);const o=Zi(e),a=o===(null==(l=e.ownerDocument)?void 0:l.body),n=ti(o);if(a){const e=Mi(n);return t.concat(n,n.visualViewport||[],si(o)?o:[],e&&i?_i(e):[])}return t.concat(o,_i(o,[],i))}function Mi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vi(e){const t=yi(e);let i=parseFloat(t.width)||0,l=parseFloat(t.height)||0;const o=ai(e),a=o?e.offsetWidth:i,n=o?e.offsetHeight:l,r=Vt(i)!==a||Vt(l)!==n;return r&&(i=a,l=n),{width:i,height:l,$:r}}function Hi(e){return oi(e)?e:e.contextElement}function Si(e){const t=Hi(e);if(!ai(t))return St(1);const i=t.getBoundingClientRect(),{width:l,height:o,$:a}=Vi(t);let n=(a?Vt(i.width):i.width)/l,r=(a?Vt(i.height):i.height)/o;return n&&Number.isFinite(n)||(n=1),r&&Number.isFinite(r)||(r=1),{x:n,y:r}}const $i=St(0);function ki(e){const t=ti(e);return wi()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:$i}function Bi(e,t,i,l){void 0===t&&(t=!1),void 0===i&&(i=!1);const o=e.getBoundingClientRect(),a=Hi(e);let n=St(1);t&&(l?oi(l)&&(n=Si(l)):n=Si(e));const r=function(e,t,i){return void 0===t&&(t=!1),!(!i||t&&i!==ti(e))&&t}(a,i,l)?ki(a):St(0);let s=(o.left+r.x)/n.x,c=(o.top+r.y)/n.y,d=o.width/n.x,h=o.height/n.y;if(a){const e=ti(a),t=l&&oi(l)?ti(l):l;let i=e,o=Mi(i);for(;o&&l&&t!==i;){const e=Si(o),t=o.getBoundingClientRect(),l=yi(o),a=t.left+(o.clientLeft+parseFloat(l.paddingLeft))*e.x,n=t.top+(o.clientTop+parseFloat(l.paddingTop))*e.y;s*=e.x,c*=e.y,d*=e.x,h*=e.y,s+=a,c+=n,i=ti(o),o=Mi(i)}}return Kt({width:d,height:h,x:s,y:c})}function Pi(e,t){const i=Ci(e).scrollLeft;return t?t.left+i:Bi(ii(e)).left+i}function Ai(e,t){const i=e.getBoundingClientRect();return{x:i.left+t.scrollLeft-Pi(e,i),y:i.top+t.scrollTop}}const Li=25;const Ei=new Set(["absolute","fixed"]);function Ti(e,t,i){let l;if("viewport"===t)l=function(e,t){const i=ti(e),l=ii(e),o=i.visualViewport;let a=l.clientWidth,n=l.clientHeight,r=0,s=0;if(o){a=o.width,n=o.height;const e=wi();(!e||e&&"fixed"===t)&&(r=o.offsetLeft,s=o.offsetTop)}const c=Pi(l);if(c<=0){const e=l.ownerDocument,t=e.body,i=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,n=Math.abs(l.clientWidth-t.clientWidth-o);n<=Li&&(a-=n)}else c<=Li&&(a+=c);return{width:a,height:n,x:r,y:s}}(e,i);else if("document"===t)l=function(e){const t=ii(e),i=Ci(e),l=e.ownerDocument.body,o=Mt(t.scrollWidth,t.clientWidth,l.scrollWidth,l.clientWidth),a=Mt(t.scrollHeight,t.clientHeight,l.scrollHeight,l.clientHeight);let n=-i.scrollLeft+Pi(e);const r=-i.scrollTop;return"rtl"===yi(l).direction&&(n+=Mt(t.clientWidth,l.clientWidth)-o),{width:o,height:a,x:n,y:r}}(ii(e));else if(oi(t))l=function(e,t){const i=Bi(e,!0,"fixed"===t),l=i.top+e.clientTop,o=i.left+e.clientLeft,a=ai(e)?Si(e):St(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:l*a.y}}(t,i);else{const i=ki(e);l={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Kt(l)}function Oi(e,t){const i=bi(e);return!(i===t||!oi(i)||xi(i))&&("fixed"===yi(i).position||Oi(i,t))}function Ri(e,t,i){const l=ai(t),o=ii(t),a="fixed"===i,n=Bi(e,!0,a,t);let r={scrollLeft:0,scrollTop:0};const s=St(0);function c(){s.x=Pi(o)}if(l||!l&&!a)if(("body"!==ei(t)||si(o))&&(r=Ci(t)),l){const e=Bi(t,!0,a,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&c();a&&!l&&o&&c();const d=!o||l||a?St(0):Ai(o,r);return{x:n.left+r.scrollLeft-s.x-d.x,y:n.top+r.scrollTop-s.y-d.y,width:n.width,height:n.height}}function Ui(e){return"static"===yi(e).position}function zi(e,t){if(!ai(e)||"fixed"===yi(e).position)return null;if(t)return t(e);let i=e.offsetParent;return ii(e)===i&&(i=i.ownerDocument.body),i}function Ni(e,t){const i=ti(e);if(vi(e))return i;if(!ai(e)){let t=bi(e);for(;t&&!xi(t);){if(oi(t)&&!Ui(t))return t;t=bi(t)}return i}let l=zi(e,t);for(;l&&di(l)&&Ui(l);)l=zi(l,t);return l&&xi(l)&&Ui(l)&&!fi(l)?i:l||function(e){let t=bi(e);for(;ai(t)&&!xi(t);){if(fi(t))return t;if(vi(t))return null;t=bi(t)}return null}(e)||i}const Di={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:i,offsetParent:l,strategy:o}=e;const a="fixed"===o,n=ii(l),r=!!t&&vi(t.floating);if(l===n||r&&a)return i;let s={scrollLeft:0,scrollTop:0},c=St(1);const d=St(0),h=ai(l);if((h||!h&&!a)&&(("body"!==ei(l)||si(n))&&(s=Ci(l)),ai(l))){const e=Bi(l);c=Si(l),d.x=e.x+l.clientLeft,d.y=e.y+l.clientTop}const v=!n||h||a?St(0):Ai(n,s);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-s.scrollLeft*c.x+d.x+v.x,y:i.y*c.y-s.scrollTop*c.y+d.y+v.y}},getDocumentElement:ii,getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:l,strategy:o}=e;const a=[..."clippingAncestors"===i?vi(t)?[]:function(e,t){const i=t.get(e);if(i)return i;let l=_i(e,[],!1).filter((e=>oi(e)&&"body"!==ei(e))),o=null;const a="fixed"===yi(e).position;let n=a?bi(e):e;for(;oi(n)&&!xi(n);){const t=yi(n),i=fi(n);i||"fixed"!==t.position||(o=null),(a?!i&&!o:!i&&"static"===t.position&&o&&Ei.has(o.position)||si(n)&&!i&&Oi(e,n))?l=l.filter((e=>e!==n)):o=t,n=bi(n)}return t.set(e,l),l}(t,this._c):[].concat(i),l],n=a[0],r=a.reduce(((e,i)=>{const l=Ti(t,i,o);return e.top=Mt(l.top,e.top),e.right=_t(l.right,e.right),e.bottom=_t(l.bottom,e.bottom),e.left=Mt(l.left,e.left),e}),Ti(t,n,o));return{width:r.right-r.left,height:r.bottom-r.top,x:r.left,y:r.top}},getOffsetParent:Ni,getElementRects:async function(e){const t=this.getOffsetParent||Ni,i=this.getDimensions,l=await i(e.floating);return{reference:Ri(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:i}=Vi(e);return{width:t,height:i}},getScale:Si,isElement:oi,isRTL:function(e){return"rtl"===yi(e).direction}};function Ii(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Wi(e,t,i,l){void 0===l&&(l={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:n="function"==typeof ResizeObserver,layoutShift:r="function"==typeof IntersectionObserver,animationFrame:s=!1}=l,c=Hi(e),d=o||a?[...c?_i(c):[],..._i(t)]:[];d.forEach((e=>{o&&e.addEventListener("scroll",i,{passive:!0}),a&&e.addEventListener("resize",i)}));const h=c&&r?function(e,t){let i,l=null;const o=ii(e);function a(){var e;clearTimeout(i),null==(e=l)||e.disconnect(),l=null}return function n(r,s){void 0===r&&(r=!1),void 0===s&&(s=1),a();const c=e.getBoundingClientRect(),{left:d,top:h,width:v,height:p}=c;if(r||t(),!v||!p)return;const u={rootMargin:-Ht(h)+"px "+-Ht(o.clientWidth-(d+v))+"px "+-Ht(o.clientHeight-(h+p))+"px "+-Ht(d)+"px",threshold:Mt(0,_t(1,s))||1};let g=!0;function f(t){const l=t[0].intersectionRatio;if(l!==s){if(!g)return n();l?n(!1,l):i=setTimeout((()=>{n(!1,1e-7)}),1e3)}1!==l||Ii(c,e.getBoundingClientRect())||n(),g=!1}try{l=new IntersectionObserver(f,{...u,root:o.ownerDocument})}catch(e){l=new IntersectionObserver(f,u)}l.observe(e)}(!0),a}(c,i):null;let v,p=-1,u=null;n&&(u=new ResizeObserver((e=>{let[l]=e;l&&l.target===c&&u&&(u.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=u)||e.observe(t)}))),i()})),c&&!s&&u.observe(c),u.observe(t));let g=s?Bi(e):null;return s&&function t(){const l=Bi(e);g&&!Ii(g,l)&&i();g=l,v=requestAnimationFrame(t)}(),i(),()=>{var e;d.forEach((e=>{o&&e.removeEventListener("scroll",i),a&&e.removeEventListener("resize",i)})),null==h||h(),null==(e=u)||e.disconnect(),u=null,s&&cancelAnimationFrame(v)}}const Fi=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var i,l;const{x:o,y:a,placement:n,middlewareData:r}=t,s=await async function(e,t){const{placement:i,platform:l,elements:o}=e,a=await(null==l.isRTL?void 0:l.isRTL(o.floating)),n=At(i),r=Lt(i),s="y"===Rt(i),c=Gt.has(n)?-1:1,d=a&&s?-1:1,h=Pt(t,e);let{mainAxis:v,crossAxis:p,alignmentAxis:u}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return r&&"number"==typeof u&&(p="end"===r?-1*u:u),s?{x:p*d,y:v*c}:{x:v*c,y:p*d}}(t,e);return n===(null==(i=r.offset)?void 0:i.placement)&&null!=(l=r.arrow)&&l.alignmentOffset?{}:{x:o+s.x,y:a+s.y,data:{...s,placement:n}}}}},qi=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:l,placement:o}=t,{mainAxis:a=!0,crossAxis:n=!1,limiter:r={fn:e=>{let{x:t,y:i}=e;return{x:t,y:i}}},...s}=Pt(e,t),c={x:i,y:l},d=await Xt(t,s),h=Rt(At(o)),v=Et(h);let p=c[v],u=c[h];if(a){const e="y"===v?"bottom":"right";p=Bt(p+d["y"===v?"top":"left"],p,p-d[e])}if(n){const e="y"===h?"bottom":"right";u=Bt(u+d["y"===h?"top":"left"],u,u-d[e])}const g=r.fn({...t,[v]:p,[h]:u});return{...g,data:{x:g.x-i,y:g.y-l,enabled:{[v]:a,[h]:n}}}}}},ji=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var i,l;const{placement:o,middlewareData:a,rects:n,initialPlacement:r,platform:s,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:u="none",flipAlignment:g=!0,...f}=Pt(e,t);if(null!=(i=a.arrow)&&i.alignmentOffset)return{};const w=At(o),m=Rt(r),x=At(r)===r,y=await(null==s.isRTL?void 0:s.isRTL(c.floating)),C=v||(x||!g?[jt(r)]:function(e){const t=jt(e);return[Nt(e),t,Nt(t)]}(r)),b="none"!==u;!v&&b&&C.push(...qt(r,g,u,y));const Z=[r,...C],_=await Xt(t,f),M=[];let V=(null==(l=a.flip)?void 0:l.overflows)||[];if(d&&M.push(_[w]),h){const e=zt(o,n,y);M.push(_[e[0]],_[e[1]])}if(V=[...V,{placement:o,overflows:M}],!M.every((e=>e<=0))){var H,S;const e=((null==(H=a.flip)?void 0:H.index)||0)+1,t=Z[e];if(t){if(!("alignment"===h&&m!==Rt(t))||V.every((e=>Rt(e.placement)!==m||e.overflows[0]>0)))return{data:{index:e,overflows:V},reset:{placement:t}}}let i=null==(S=V.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:S.placement;if(!i)switch(p){case"bestFit":{var $;const e=null==($=V.filter((e=>{if(b){const t=Rt(e.placement);return t===m||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:$[0];e&&(i=e);break}case"initialPlacement":i=r}if(o!==i)return{reset:{placement:i}}}return{}}}},Ji=(e,t,i)=>{const l=new Map,o={platform:Di,...i},a={...o.platform,_c:l};return(async(e,t,i)=>{const{placement:l="bottom",strategy:o="absolute",middleware:a=[],platform:n}=i,r=a.filter(Boolean),s=await(null==n.isRTL?void 0:n.isRTL(t));let c=await n.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=Yt(c,l,s),v=l,p={},u=0;for(let i=0;i<r.length;i++){const{name:a,fn:g}=r[i],{x:f,y:w,data:m,reset:x}=await g({x:d,y:h,initialPlacement:l,placement:v,strategy:o,middlewareData:p,rects:c,platform:n,elements:{reference:e,floating:t}});d=null!=f?f:d,h=null!=w?w:h,p={...p,[a]:{...p[a],...m}},x&&u<=50&&(u++,"object"==typeof x&&(x.placement&&(v=x.placement),x.rects&&(c=!0===x.rects?await n.getElementRects({reference:e,floating:t,strategy:o}):x.rects),({x:d,y:h}=Yt(c,v,s))),i=-1)}return{x:d,y:h,placement:v,strategy:o,middlewareData:p}})(e,t,{...o,platform:a})};class Ki extends rt{constructor(){super(...arguments),this.myDropdown=yt(),this.dropdownMenuId=function(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}("dropdown-menu","div"),this.noFlip=!1,this.menuAlignRight=!1,this.drop="down",this.floatingOpts={},this.menuIsOpen=!1,this.close="default",this.disabled=!1,this.readonly=!1,this.menuRef=yt(),this._handleKeyboardMenuEvent=e=>{if(!this.readonly)switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),this.menuIsOpen||this.showMenu();break;case"Escape":this.hideMenu()}},this._handleClickOutOfElement=e=>{this.menuIsOpen&&(e.composedPath().includes(this)||this.hideMenu())}}connectedCallback(){super.connectedCallback(),"inside"!==this.close&&document.addEventListener("click",this._handleClickOutOfElement),this.addEventListener("keydown",this._handleKeyboardMenuEvent)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutOfElement),this.removeEventListener("keydown",this._handleKeyboardMenuEvent),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0)}firstUpdated(e){super.firstUpdated(e),this.menuIsOpen&&this.updateFloatingPosition()}async showMenu(){this.disabled||this.menuIsOpen||(this.menuIsOpen=!0,this.emit("sgds-show"),await this.updateFloatingPosition(),this.emit("sgds-after-show"),this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=Wi(this.myDropdown.value,this.menuRef.value,(()=>this.updateFloatingPosition()))))}async hideMenu(){this.menuIsOpen&&(this.emit("sgds-hide"),this.menuIsOpen=!1,setTimeout((()=>this.emit("sgds-after-hide")),0),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0))}toggleMenu(){this.menuIsOpen?this.hideMenu():this.showMenu()}mergeMiddleware(e,t){const i=e=>{var t;return(null==e?void 0:e.name)||(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)},l=t.map(i),o=e.map((e=>{const o=i(e),a=l.indexOf(o);return-1!==a?t[a]:e})).concat(t.filter((t=>!e.some((e=>i(e)===i(t))))));return o}async updateFloatingPosition(){if(!this.myDropdown.value||!this.menuRef.value)return;let e="bottom-start";switch(this.drop){case"up":e=this.menuAlignRight?"top-end":"top-start";break;case"right":e="right-start";break;case"left":e="left-start";break;case"down":e=this.menuAlignRight?"bottom-end":"bottom-start";break;default:e="bottom-start"}const t=[Fi(8),this.noFlip?void 0:ji(),qi()].filter(Boolean);let i=t;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(i=this.mergeMiddleware(t,this.floatingOpts.middleware.filter(Boolean)));const l=Object.assign(Object.assign({strategy:"fixed",placement:e},this.floatingOpts),{middleware:i}),{x:o,y:a,strategy:n,placement:r}=await Ji(this.myDropdown.value,this.menuRef.value,l);this.menuRef.value.setAttribute("data-placement",r),Object.assign(this.menuRef.value.style,{position:n,left:`${o}px`,top:`${a}px`})}}e([S({type:Boolean,state:!0})],Ki.prototype,"noFlip",void 0),e([S({type:Boolean,reflect:!0,state:!0})],Ki.prototype,"menuAlignRight",void 0),e([S({type:String,reflect:!0,state:!0})],Ki.prototype,"drop",void 0),e([S({type:Object})],Ki.prototype,"floatingOpts",void 0),e([S({type:Boolean,reflect:!0})],Ki.prototype,"menuIsOpen",void 0),e([S({type:Boolean,reflect:!0})],Ki.prototype,"disabled",void 0),e([S({type:Boolean,reflect:!0})],Ki.prototype,"readonly",void 0);class Yi extends Ki{constructor(){super(...arguments),this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1,this.hidden=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-hide",this._resetMenu)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sgds-hide",this._resetMenu)}firstUpdated(e){super.firstUpdated(e),this.addEventListener("keydown",this._handleKeyboardMenuItemsEvent)}handleSelectSlot(e){const t=this._getActiveMenuItems(),i=t.indexOf(e.target);this.nextDropdownItemNo=i+1,this.prevDropdownItemNo=i<=0?t.length-1:i-1;e.target.disabled||(this.emit("sgds-select"),"outside"!==this.close&&this.hideMenu())}_resetMenu(){this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1;this._getMenuItems().forEach((e=>{var t;const i=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".dropdown-item");i&&i.removeAttribute("tabindex")}))}_handleKeyboardMenuItemsEvent(e){if(this.readonly)return;const t=this._getActiveMenuItems();if(0!==t.length)switch(e.key){case"ArrowDown":e.preventDefault(),this._setMenuItem(this.nextDropdownItemNo);break;case"ArrowUp":e.preventDefault(),this._setMenuItem(this.prevDropdownItemNo);break;case"Tab":if(!this.menuIsOpen)return;e.preventDefault(),e.shiftKey?this._setMenuItem(this.prevDropdownItemNo):this._setMenuItem(this.nextDropdownItemNo);break;case"Enter":t.includes(e.target)&&this.handleSelectSlot(e)}}_getMenuItems(){var e,t;if(this.shadowRoot.querySelector("slot#default")){return null===(e=this.shadowRoot.querySelector("slot#default"))||void 0===e?void 0:e.assignedElements({flatten:!0}).filter((e=>!e.classList.contains("empty-menu")&&!e.hasAttribute("hidden")))}if(null===(t=this.menu)||void 0===t?void 0:t.hasChildNodes()){return[...Array.from(this.menu.children)]}return[]}_getActiveMenuItems(){return this._getMenuItems().filter((e=>!e.disabled&&!e.hidden))}_setMenuItem(e){const t=this._getActiveMenuItems();if(0===t.length)return;const i=(e%t.length+t.length)%t.length,l=t[i];console.log(l,"activeItem"),this.emit("i-sgds-option-focus",{detail:{option:l}}),this.nextDropdownItemNo=(i+1)%t.length,this.prevDropdownItemNo=(i-1+t.length)%t.length,t.forEach((e=>{const t=e.shadowRoot.querySelector(".dropdown-item");t.setAttribute("tabindex",e===l?"0":"-1"),e===l&&t.focus()}))}}Yi.styles=Ki.styles,e([P("ul.dropdown-menu")],Yi.prototype,"menu",void 0),e([$()],Yi.prototype,"nextDropdownItemNo",void 0),e([$()],Yi.prototype,"prevDropdownItemNo",void 0),e([S({type:Boolean,reflect:!0})],Yi.prototype,"hidden",void 0);var Xi=Oe`:host([menuisopen]) .dropdown-menu{display:block}.dropdown-menu{background-clip:padding-box;background-color:var(--sgds-surface-default);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 1px 0 hsla(0,0%,5%,.12),0 4px 8px 0 hsla(0,0%,5%,.12);color:var(--sgds-color-default);display:none;list-style:none;margin:0;max-height:var(--sgds-dimension-480);min-width:var(--sgds-dimension-280);overflow-y:auto;padding:var(--sgds-padding-xs) 0;position:absolute;text-align:left;z-index:1050}.nav-tabs .dropdown-menu{border-top-left-radius:0;border-top-right-radius:0;margin-top:calc(var(--sgds-nav-tabs-border-width)*-1)}@media (min-width:576px){.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:768px){.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:992px){.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1200px){.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1400px){.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.sgds.navbar .dropdown-menu.megamenu{left:0;right:0;width:100%}.sgds.combobox>.dropdown-menu{min-width:100%}`,Gi=Oe`.dropdown{display:flex;height:inherit;position:relative}`;class Qi extends Yi{constructor(){super(),this.noFlip=!1,this.menuAlignRight=!1,this.drop="down",this.menuRef=Zt()}async _handleClick(){this.disabled||this.toggleMenu()}_handleCloseMenu(){const e=this._toggler[0];null==e||e.focus()}async connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-hide",this._handleCloseMenu)}async disconnectedCallback(){this.removeEventListener("sgds-hide",this._handleCloseMenu)}async firstUpdated(e){super.firstUpdated(e),this.menuIsOpen&&await this.showMenu(),this._handleDisabled()}_handleDisabled(){const e=this._toggler[0];e&&(this.disabled?e.setAttribute("disabled","true"):e.hasAttribute("disabled")&&e.removeAttribute("disabled"))}render(){return se`
|
|
90
|
+
*/const yt=()=>new Ct;class Ct{}const bt=new WeakMap;const Zt=ht(class extends xt{render(e){return he}update(e,[t]){const i=t!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=t,this._context=e.options?.host,this._updateRefValue(this._element=e.element)),he}_updateRefValue(e){if(this.isConnected||(e=void 0),"function"==typeof this._ref){const t=this._context??globalThis;let i=bt.get(t);void 0===i&&(i=new WeakMap,bt.set(t,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,e),void 0!==e&&this._ref.call(this._context,e)}else this._ref.value=e}get _lastElementForRef(){return"function"==typeof this._ref?bt.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),_t=Math.min,Mt=Math.max,Vt=Math.round,Ht=Math.floor,St=e=>({x:e,y:e}),$t={left:"right",right:"left",bottom:"top",top:"bottom"},kt={start:"end",end:"start"};function Bt(e,t,i){return Mt(e,_t(t,i))}function Pt(e,t){return"function"==typeof e?e(t):e}function At(e){return e.split("-")[0]}function Lt(e){return e.split("-")[1]}function Et(e){return"x"===e?"y":"x"}function Tt(e){return"y"===e?"height":"width"}const Ot=new Set(["top","bottom"]);function Rt(e){return Ot.has(At(e))?"y":"x"}function Ut(e){return Et(Rt(e))}function zt(e,t,i){void 0===i&&(i=!1);const l=Lt(e),o=Ut(e),a=Tt(o);let n="x"===o?l===(i?"end":"start")?"right":"left":"start"===l?"bottom":"top";return t.reference[a]>t.floating[a]&&(n=jt(n)),[n,jt(n)]}function Nt(e){return e.replace(/start|end/g,(e=>kt[e]))}const Dt=["left","right"],It=["right","left"],Wt=["top","bottom"],Ft=["bottom","top"];function qt(e,t,i,l){const o=Lt(e);let a=function(e,t,i){switch(e){case"top":case"bottom":return i?t?It:Dt:t?Dt:It;case"left":case"right":return t?Wt:Ft;default:return[]}}(At(e),"start"===i,l);return o&&(a=a.map((e=>e+"-"+o)),t&&(a=a.concat(a.map(Nt)))),a}function jt(e){return e.replace(/left|right|bottom|top/g,(e=>$t[e]))}function Jt(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Kt(e){const{x:t,y:i,width:l,height:o}=e;return{width:l,height:o,top:i,left:t,right:t+l,bottom:i+o,x:t,y:i}}function Yt(e,t,i){let{reference:l,floating:o}=e;const a=Rt(t),n=Ut(t),r=Tt(n),s=At(t),c="y"===a,d=l.x+l.width/2-o.width/2,h=l.y+l.height/2-o.height/2,v=l[r]/2-o[r]/2;let p;switch(s){case"top":p={x:d,y:l.y-o.height};break;case"bottom":p={x:d,y:l.y+l.height};break;case"right":p={x:l.x+l.width,y:h};break;case"left":p={x:l.x-o.width,y:h};break;default:p={x:l.x,y:l.y}}switch(Lt(t)){case"start":p[n]-=v*(i&&c?-1:1);break;case"end":p[n]+=v*(i&&c?-1:1)}return p}async function Xt(e,t){var i;void 0===t&&(t={});const{x:l,y:o,platform:a,rects:n,elements:r,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:v=!1,padding:p=0}=Pt(t,e),u=Jt(p),g=r[v?"floating"===h?"reference":"floating":h],f=Kt(await a.getClippingRect({element:null==(i=await(null==a.isElement?void 0:a.isElement(g)))||i?g:g.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(r.floating)),boundary:c,rootBoundary:d,strategy:s})),w="floating"===h?{x:l,y:o,width:n.floating.width,height:n.floating.height}:n.reference,m=await(null==a.getOffsetParent?void 0:a.getOffsetParent(r.floating)),x=await(null==a.isElement?void 0:a.isElement(m))&&await(null==a.getScale?void 0:a.getScale(m))||{x:1,y:1},y=Kt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:r,rect:w,offsetParent:m,strategy:s}):w);return{top:(f.top-y.top+u.top)/x.y,bottom:(y.bottom-f.bottom+u.bottom)/x.y,left:(f.left-y.left+u.left)/x.x,right:(y.right-f.right+u.right)/x.x}}const Gt=new Set(["left","top"]);function Qt(){return"undefined"!=typeof window}function ei(e){return li(e)?(e.nodeName||"").toLowerCase():"#document"}function ti(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ii(e){var t;return null==(t=(li(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function li(e){return!!Qt()&&(e instanceof Node||e instanceof ti(e).Node)}function oi(e){return!!Qt()&&(e instanceof Element||e instanceof ti(e).Element)}function ai(e){return!!Qt()&&(e instanceof HTMLElement||e instanceof ti(e).HTMLElement)}function ni(e){return!(!Qt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ti(e).ShadowRoot)}const ri=new Set(["inline","contents"]);function si(e){const{overflow:t,overflowX:i,overflowY:l,display:o}=yi(e);return/auto|scroll|overlay|hidden|clip/.test(t+l+i)&&!ri.has(o)}const ci=new Set(["table","td","th"]);function di(e){return ci.has(ei(e))}const hi=[":popover-open",":modal"];function vi(e){return hi.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}const pi=["transform","translate","scale","rotate","perspective"],ui=["transform","translate","scale","rotate","perspective","filter"],gi=["paint","layout","strict","content"];function fi(e){const t=wi(),i=oi(e)?yi(e):e;return pi.some((e=>!!i[e]&&"none"!==i[e]))||!!i.containerType&&"normal"!==i.containerType||!t&&!!i.backdropFilter&&"none"!==i.backdropFilter||!t&&!!i.filter&&"none"!==i.filter||ui.some((e=>(i.willChange||"").includes(e)))||gi.some((e=>(i.contain||"").includes(e)))}function wi(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const mi=new Set(["html","body","#document"]);function xi(e){return mi.has(ei(e))}function yi(e){return ti(e).getComputedStyle(e)}function Ci(e){return oi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bi(e){if("html"===ei(e))return e;const t=e.assignedSlot||e.parentNode||ni(e)&&e.host||ii(e);return ni(t)?t.host:t}function Zi(e){const t=bi(e);return xi(t)?e.ownerDocument?e.ownerDocument.body:e.body:ai(t)&&si(t)?t:Zi(t)}function _i(e,t,i){var l;void 0===t&&(t=[]),void 0===i&&(i=!0);const o=Zi(e),a=o===(null==(l=e.ownerDocument)?void 0:l.body),n=ti(o);if(a){const e=Mi(n);return t.concat(n,n.visualViewport||[],si(o)?o:[],e&&i?_i(e):[])}return t.concat(o,_i(o,[],i))}function Mi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vi(e){const t=yi(e);let i=parseFloat(t.width)||0,l=parseFloat(t.height)||0;const o=ai(e),a=o?e.offsetWidth:i,n=o?e.offsetHeight:l,r=Vt(i)!==a||Vt(l)!==n;return r&&(i=a,l=n),{width:i,height:l,$:r}}function Hi(e){return oi(e)?e:e.contextElement}function Si(e){const t=Hi(e);if(!ai(t))return St(1);const i=t.getBoundingClientRect(),{width:l,height:o,$:a}=Vi(t);let n=(a?Vt(i.width):i.width)/l,r=(a?Vt(i.height):i.height)/o;return n&&Number.isFinite(n)||(n=1),r&&Number.isFinite(r)||(r=1),{x:n,y:r}}const $i=St(0);function ki(e){const t=ti(e);return wi()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:$i}function Bi(e,t,i,l){void 0===t&&(t=!1),void 0===i&&(i=!1);const o=e.getBoundingClientRect(),a=Hi(e);let n=St(1);t&&(l?oi(l)&&(n=Si(l)):n=Si(e));const r=function(e,t,i){return void 0===t&&(t=!1),!(!i||t&&i!==ti(e))&&t}(a,i,l)?ki(a):St(0);let s=(o.left+r.x)/n.x,c=(o.top+r.y)/n.y,d=o.width/n.x,h=o.height/n.y;if(a){const e=ti(a),t=l&&oi(l)?ti(l):l;let i=e,o=Mi(i);for(;o&&l&&t!==i;){const e=Si(o),t=o.getBoundingClientRect(),l=yi(o),a=t.left+(o.clientLeft+parseFloat(l.paddingLeft))*e.x,n=t.top+(o.clientTop+parseFloat(l.paddingTop))*e.y;s*=e.x,c*=e.y,d*=e.x,h*=e.y,s+=a,c+=n,i=ti(o),o=Mi(i)}}return Kt({width:d,height:h,x:s,y:c})}function Pi(e,t){const i=Ci(e).scrollLeft;return t?t.left+i:Bi(ii(e)).left+i}function Ai(e,t){const i=e.getBoundingClientRect();return{x:i.left+t.scrollLeft-Pi(e,i),y:i.top+t.scrollTop}}const Li=25;const Ei=new Set(["absolute","fixed"]);function Ti(e,t,i){let l;if("viewport"===t)l=function(e,t){const i=ti(e),l=ii(e),o=i.visualViewport;let a=l.clientWidth,n=l.clientHeight,r=0,s=0;if(o){a=o.width,n=o.height;const e=wi();(!e||e&&"fixed"===t)&&(r=o.offsetLeft,s=o.offsetTop)}const c=Pi(l);if(c<=0){const e=l.ownerDocument,t=e.body,i=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,n=Math.abs(l.clientWidth-t.clientWidth-o);n<=Li&&(a-=n)}else c<=Li&&(a+=c);return{width:a,height:n,x:r,y:s}}(e,i);else if("document"===t)l=function(e){const t=ii(e),i=Ci(e),l=e.ownerDocument.body,o=Mt(t.scrollWidth,t.clientWidth,l.scrollWidth,l.clientWidth),a=Mt(t.scrollHeight,t.clientHeight,l.scrollHeight,l.clientHeight);let n=-i.scrollLeft+Pi(e);const r=-i.scrollTop;return"rtl"===yi(l).direction&&(n+=Mt(t.clientWidth,l.clientWidth)-o),{width:o,height:a,x:n,y:r}}(ii(e));else if(oi(t))l=function(e,t){const i=Bi(e,!0,"fixed"===t),l=i.top+e.clientTop,o=i.left+e.clientLeft,a=ai(e)?Si(e):St(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:l*a.y}}(t,i);else{const i=ki(e);l={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Kt(l)}function Oi(e,t){const i=bi(e);return!(i===t||!oi(i)||xi(i))&&("fixed"===yi(i).position||Oi(i,t))}function Ri(e,t,i){const l=ai(t),o=ii(t),a="fixed"===i,n=Bi(e,!0,a,t);let r={scrollLeft:0,scrollTop:0};const s=St(0);function c(){s.x=Pi(o)}if(l||!l&&!a)if(("body"!==ei(t)||si(o))&&(r=Ci(t)),l){const e=Bi(t,!0,a,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&c();a&&!l&&o&&c();const d=!o||l||a?St(0):Ai(o,r);return{x:n.left+r.scrollLeft-s.x-d.x,y:n.top+r.scrollTop-s.y-d.y,width:n.width,height:n.height}}function Ui(e){return"static"===yi(e).position}function zi(e,t){if(!ai(e)||"fixed"===yi(e).position)return null;if(t)return t(e);let i=e.offsetParent;return ii(e)===i&&(i=i.ownerDocument.body),i}function Ni(e,t){const i=ti(e);if(vi(e))return i;if(!ai(e)){let t=bi(e);for(;t&&!xi(t);){if(oi(t)&&!Ui(t))return t;t=bi(t)}return i}let l=zi(e,t);for(;l&&di(l)&&Ui(l);)l=zi(l,t);return l&&xi(l)&&Ui(l)&&!fi(l)?i:l||function(e){let t=bi(e);for(;ai(t)&&!xi(t);){if(fi(t))return t;if(vi(t))return null;t=bi(t)}return null}(e)||i}const Di={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:i,offsetParent:l,strategy:o}=e;const a="fixed"===o,n=ii(l),r=!!t&&vi(t.floating);if(l===n||r&&a)return i;let s={scrollLeft:0,scrollTop:0},c=St(1);const d=St(0),h=ai(l);if((h||!h&&!a)&&(("body"!==ei(l)||si(n))&&(s=Ci(l)),ai(l))){const e=Bi(l);c=Si(l),d.x=e.x+l.clientLeft,d.y=e.y+l.clientTop}const v=!n||h||a?St(0):Ai(n,s);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-s.scrollLeft*c.x+d.x+v.x,y:i.y*c.y-s.scrollTop*c.y+d.y+v.y}},getDocumentElement:ii,getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:l,strategy:o}=e;const a=[..."clippingAncestors"===i?vi(t)?[]:function(e,t){const i=t.get(e);if(i)return i;let l=_i(e,[],!1).filter((e=>oi(e)&&"body"!==ei(e))),o=null;const a="fixed"===yi(e).position;let n=a?bi(e):e;for(;oi(n)&&!xi(n);){const t=yi(n),i=fi(n);i||"fixed"!==t.position||(o=null),(a?!i&&!o:!i&&"static"===t.position&&o&&Ei.has(o.position)||si(n)&&!i&&Oi(e,n))?l=l.filter((e=>e!==n)):o=t,n=bi(n)}return t.set(e,l),l}(t,this._c):[].concat(i),l],n=a[0],r=a.reduce(((e,i)=>{const l=Ti(t,i,o);return e.top=Mt(l.top,e.top),e.right=_t(l.right,e.right),e.bottom=_t(l.bottom,e.bottom),e.left=Mt(l.left,e.left),e}),Ti(t,n,o));return{width:r.right-r.left,height:r.bottom-r.top,x:r.left,y:r.top}},getOffsetParent:Ni,getElementRects:async function(e){const t=this.getOffsetParent||Ni,i=this.getDimensions,l=await i(e.floating);return{reference:Ri(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:i}=Vi(e);return{width:t,height:i}},getScale:Si,isElement:oi,isRTL:function(e){return"rtl"===yi(e).direction}};function Ii(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Wi(e,t,i,l){void 0===l&&(l={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:n="function"==typeof ResizeObserver,layoutShift:r="function"==typeof IntersectionObserver,animationFrame:s=!1}=l,c=Hi(e),d=o||a?[...c?_i(c):[],..._i(t)]:[];d.forEach((e=>{o&&e.addEventListener("scroll",i,{passive:!0}),a&&e.addEventListener("resize",i)}));const h=c&&r?function(e,t){let i,l=null;const o=ii(e);function a(){var e;clearTimeout(i),null==(e=l)||e.disconnect(),l=null}return function n(r,s){void 0===r&&(r=!1),void 0===s&&(s=1),a();const c=e.getBoundingClientRect(),{left:d,top:h,width:v,height:p}=c;if(r||t(),!v||!p)return;const u={rootMargin:-Ht(h)+"px "+-Ht(o.clientWidth-(d+v))+"px "+-Ht(o.clientHeight-(h+p))+"px "+-Ht(d)+"px",threshold:Mt(0,_t(1,s))||1};let g=!0;function f(t){const l=t[0].intersectionRatio;if(l!==s){if(!g)return n();l?n(!1,l):i=setTimeout((()=>{n(!1,1e-7)}),1e3)}1!==l||Ii(c,e.getBoundingClientRect())||n(),g=!1}try{l=new IntersectionObserver(f,{...u,root:o.ownerDocument})}catch(e){l=new IntersectionObserver(f,u)}l.observe(e)}(!0),a}(c,i):null;let v,p=-1,u=null;n&&(u=new ResizeObserver((e=>{let[l]=e;l&&l.target===c&&u&&(u.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=u)||e.observe(t)}))),i()})),c&&!s&&u.observe(c),u.observe(t));let g=s?Bi(e):null;return s&&function t(){const l=Bi(e);g&&!Ii(g,l)&&i();g=l,v=requestAnimationFrame(t)}(),i(),()=>{var e;d.forEach((e=>{o&&e.removeEventListener("scroll",i),a&&e.removeEventListener("resize",i)})),null==h||h(),null==(e=u)||e.disconnect(),u=null,s&&cancelAnimationFrame(v)}}const Fi=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var i,l;const{x:o,y:a,placement:n,middlewareData:r}=t,s=await async function(e,t){const{placement:i,platform:l,elements:o}=e,a=await(null==l.isRTL?void 0:l.isRTL(o.floating)),n=At(i),r=Lt(i),s="y"===Rt(i),c=Gt.has(n)?-1:1,d=a&&s?-1:1,h=Pt(t,e);let{mainAxis:v,crossAxis:p,alignmentAxis:u}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return r&&"number"==typeof u&&(p="end"===r?-1*u:u),s?{x:p*d,y:v*c}:{x:v*c,y:p*d}}(t,e);return n===(null==(i=r.offset)?void 0:i.placement)&&null!=(l=r.arrow)&&l.alignmentOffset?{}:{x:o+s.x,y:a+s.y,data:{...s,placement:n}}}}},qi=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:l,placement:o}=t,{mainAxis:a=!0,crossAxis:n=!1,limiter:r={fn:e=>{let{x:t,y:i}=e;return{x:t,y:i}}},...s}=Pt(e,t),c={x:i,y:l},d=await Xt(t,s),h=Rt(At(o)),v=Et(h);let p=c[v],u=c[h];if(a){const e="y"===v?"bottom":"right";p=Bt(p+d["y"===v?"top":"left"],p,p-d[e])}if(n){const e="y"===h?"bottom":"right";u=Bt(u+d["y"===h?"top":"left"],u,u-d[e])}const g=r.fn({...t,[v]:p,[h]:u});return{...g,data:{x:g.x-i,y:g.y-l,enabled:{[v]:a,[h]:n}}}}}},ji=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var i,l;const{placement:o,middlewareData:a,rects:n,initialPlacement:r,platform:s,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:u="none",flipAlignment:g=!0,...f}=Pt(e,t);if(null!=(i=a.arrow)&&i.alignmentOffset)return{};const w=At(o),m=Rt(r),x=At(r)===r,y=await(null==s.isRTL?void 0:s.isRTL(c.floating)),C=v||(x||!g?[jt(r)]:function(e){const t=jt(e);return[Nt(e),t,Nt(t)]}(r)),b="none"!==u;!v&&b&&C.push(...qt(r,g,u,y));const Z=[r,...C],_=await Xt(t,f),M=[];let V=(null==(l=a.flip)?void 0:l.overflows)||[];if(d&&M.push(_[w]),h){const e=zt(o,n,y);M.push(_[e[0]],_[e[1]])}if(V=[...V,{placement:o,overflows:M}],!M.every((e=>e<=0))){var H,S;const e=((null==(H=a.flip)?void 0:H.index)||0)+1,t=Z[e];if(t){if(!("alignment"===h&&m!==Rt(t))||V.every((e=>Rt(e.placement)!==m||e.overflows[0]>0)))return{data:{index:e,overflows:V},reset:{placement:t}}}let i=null==(S=V.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:S.placement;if(!i)switch(p){case"bestFit":{var $;const e=null==($=V.filter((e=>{if(b){const t=Rt(e.placement);return t===m||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:$[0];e&&(i=e);break}case"initialPlacement":i=r}if(o!==i)return{reset:{placement:i}}}return{}}}},Ji=(e,t,i)=>{const l=new Map,o={platform:Di,...i},a={...o.platform,_c:l};return(async(e,t,i)=>{const{placement:l="bottom",strategy:o="absolute",middleware:a=[],platform:n}=i,r=a.filter(Boolean),s=await(null==n.isRTL?void 0:n.isRTL(t));let c=await n.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=Yt(c,l,s),v=l,p={},u=0;for(let i=0;i<r.length;i++){const{name:a,fn:g}=r[i],{x:f,y:w,data:m,reset:x}=await g({x:d,y:h,initialPlacement:l,placement:v,strategy:o,middlewareData:p,rects:c,platform:n,elements:{reference:e,floating:t}});d=null!=f?f:d,h=null!=w?w:h,p={...p,[a]:{...p[a],...m}},x&&u<=50&&(u++,"object"==typeof x&&(x.placement&&(v=x.placement),x.rects&&(c=!0===x.rects?await n.getElementRects({reference:e,floating:t,strategy:o}):x.rects),({x:d,y:h}=Yt(c,v,s))),i=-1)}return{x:d,y:h,placement:v,strategy:o,middlewareData:p}})(e,t,{...o,platform:a})};class Ki extends rt{constructor(){super(...arguments),this.myDropdown=yt(),this.dropdownMenuId=function(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}("dropdown-menu","div"),this.noFlip=!1,this.menuAlignRight=!1,this.drop="down",this.floatingOpts={},this.menuIsOpen=!1,this.close="default",this.disabled=!1,this.readonly=!1,this.menuRef=yt(),this._handleKeyboardMenuEvent=e=>{if(!this.readonly)switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),this.menuIsOpen||this.showMenu();break;case"Escape":this.hideMenu()}},this._handleClickOutOfElement=e=>{this.menuIsOpen&&(e.composedPath().includes(this)||this.hideMenu())}}connectedCallback(){super.connectedCallback(),"inside"!==this.close&&document.addEventListener("click",this._handleClickOutOfElement),this.addEventListener("keydown",this._handleKeyboardMenuEvent)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutOfElement),this.removeEventListener("keydown",this._handleKeyboardMenuEvent),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0)}firstUpdated(e){super.firstUpdated(e),this.menuIsOpen&&this.updateFloatingPosition()}async showMenu(){this.disabled||this.menuIsOpen||(this.menuIsOpen=!0,this.emit("sgds-show"),await this.updateFloatingPosition(),this.emit("sgds-after-show"),this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=Wi(this.myDropdown.value,this.menuRef.value,(()=>this.updateFloatingPosition()))))}async hideMenu(){this.menuIsOpen&&(this.emit("sgds-hide"),this.menuIsOpen=!1,setTimeout((()=>this.emit("sgds-after-hide")),0),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0))}toggleMenu(){this.menuIsOpen?this.hideMenu():this.showMenu()}mergeMiddleware(e,t){const i=e=>{var t;return(null==e?void 0:e.name)||(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)},l=t.map(i),o=e.map((e=>{const o=i(e),a=l.indexOf(o);return-1!==a?t[a]:e})).concat(t.filter((t=>!e.some((e=>i(e)===i(t))))));return o}async updateFloatingPosition(){if(!this.myDropdown.value||!this.menuRef.value)return;let e="bottom-start";switch(this.drop){case"up":e=this.menuAlignRight?"top-end":"top-start";break;case"right":e="right-start";break;case"left":e="left-start";break;case"down":e=this.menuAlignRight?"bottom-end":"bottom-start";break;default:e="bottom-start"}const t=[Fi(8),this.noFlip?void 0:ji(),qi()].filter(Boolean);let i=t;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(i=this.mergeMiddleware(t,this.floatingOpts.middleware.filter(Boolean)));const l=Object.assign(Object.assign({strategy:"fixed",placement:e},this.floatingOpts),{middleware:i}),{x:o,y:a,strategy:n,placement:r}=await Ji(this.myDropdown.value,this.menuRef.value,l);this.menuRef.value.setAttribute("data-placement",r),Object.assign(this.menuRef.value.style,{position:n,left:`${o}px`,top:`${a}px`})}}e([S({type:Boolean,state:!0})],Ki.prototype,"noFlip",void 0),e([S({type:Boolean,reflect:!0,state:!0})],Ki.prototype,"menuAlignRight",void 0),e([S({type:String,reflect:!0,state:!0})],Ki.prototype,"drop",void 0),e([S({type:Object})],Ki.prototype,"floatingOpts",void 0),e([S({type:Boolean,reflect:!0})],Ki.prototype,"menuIsOpen",void 0),e([S({type:Boolean,reflect:!0})],Ki.prototype,"disabled",void 0),e([S({type:Boolean,reflect:!0})],Ki.prototype,"readonly",void 0);class Yi extends Ki{constructor(){super(...arguments),this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1,this.hidden=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-hide",this._resetMenu)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sgds-hide",this._resetMenu)}firstUpdated(e){super.firstUpdated(e),this.addEventListener("keydown",this._handleKeyboardMenuItemsEvent)}handleSelectSlot(e){const t=this._getActiveMenuItems(),i=t.indexOf(e.target);this.nextDropdownItemNo=i+1,this.prevDropdownItemNo=i<=0?t.length-1:i-1;e.target.disabled||(this.emit("sgds-select"),"outside"!==this.close&&this.hideMenu())}_resetMenu(){this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1;this._getMenuItems().forEach((e=>{var t;const i=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".dropdown-item");i&&i.removeAttribute("tabindex")}))}_handleKeyboardMenuItemsEvent(e){if(this.readonly)return;const t=this._getActiveMenuItems();if(0!==t.length)switch(e.key){case"ArrowDown":e.preventDefault(),this._setMenuItem(this.nextDropdownItemNo);break;case"ArrowUp":e.preventDefault(),this._setMenuItem(this.prevDropdownItemNo);break;case"Tab":if(!this.menuIsOpen)return;e.preventDefault(),e.shiftKey?this._setMenuItem(this.prevDropdownItemNo):this._setMenuItem(this.nextDropdownItemNo);break;case"Enter":t.includes(e.target)&&this.handleSelectSlot(e)}}_getMenuItems(){var e,t;if(this.shadowRoot.querySelector("slot#default")){return null===(e=this.shadowRoot.querySelector("slot#default"))||void 0===e?void 0:e.assignedElements({flatten:!0}).filter((e=>!e.classList.contains("empty-menu")&&!e.hasAttribute("hidden")))}if(null===(t=this.menu)||void 0===t?void 0:t.hasChildNodes()){return[...Array.from(this.menu.children)]}return[]}_getActiveMenuItems(){return this._getMenuItems().filter((e=>!e.disabled&&!e.hidden))}_setMenuItem(e){const t=this._getActiveMenuItems();if(0===t.length)return;const i=(e%t.length+t.length)%t.length,l=t[i];this.emit("i-sgds-option-focus",{detail:{option:l}}),this.nextDropdownItemNo=(i+1)%t.length,this.prevDropdownItemNo=(i-1+t.length)%t.length,t.forEach((e=>{const t=e.shadowRoot.querySelector(".dropdown-item");t.setAttribute("tabindex",e===l?"0":"-1"),e===l&&t.focus()}))}}Yi.styles=Ki.styles,e([P("ul.dropdown-menu")],Yi.prototype,"menu",void 0),e([$()],Yi.prototype,"nextDropdownItemNo",void 0),e([$()],Yi.prototype,"prevDropdownItemNo",void 0),e([S({type:Boolean,reflect:!0})],Yi.prototype,"hidden",void 0);var Xi=Oe`:host([menuisopen]) .dropdown-menu{display:block}.dropdown-menu{background-clip:padding-box;background-color:var(--sgds-surface-default);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 1px 0 hsla(0,0%,5%,.12),0 4px 8px 0 hsla(0,0%,5%,.12);color:var(--sgds-color-default);display:none;list-style:none;margin:0;max-height:var(--sgds-dimension-480);min-width:var(--sgds-dimension-280);overflow-y:auto;padding:var(--sgds-padding-xs) 0;position:absolute;text-align:left;z-index:1050}.nav-tabs .dropdown-menu{border-top-left-radius:0;border-top-right-radius:0;margin-top:calc(var(--sgds-nav-tabs-border-width)*-1)}@media (min-width:576px){.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:768px){.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:992px){.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1200px){.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1400px){.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.sgds.navbar .dropdown-menu.megamenu{left:0;right:0;width:100%}.sgds.combobox>.dropdown-menu{min-width:100%}`,Gi=Oe`.dropdown{display:flex;height:inherit;position:relative}`;class Qi extends Yi{constructor(){super(),this.noFlip=!1,this.menuAlignRight=!1,this.drop="down",this.menuRef=Zt()}async _handleClick(){this.disabled||this.toggleMenu()}_handleCloseMenu(){const e=this._toggler[0];null==e||e.focus()}async connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-hide",this._handleCloseMenu)}async disconnectedCallback(){this.removeEventListener("sgds-hide",this._handleCloseMenu)}async firstUpdated(e){super.firstUpdated(e),this.menuIsOpen&&await this.showMenu(),this._handleDisabled()}_handleDisabled(){const e=this._toggler[0];e&&(this.disabled?e.setAttribute("disabled","true"):e.hasAttribute("disabled")&&e.removeAttribute("disabled"))}render(){return se`
|
|
91
91
|
<div class="dropdown">
|
|
92
92
|
<div
|
|
93
93
|
class="toggler-container"
|