@govtechsg/sgds-web-component 3.6.0 → 3.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base/dropdown-element.d.ts +1 -1
- package/base/dropdown-element.js +3 -3
- package/base/dropdown-element.js.map +1 -1
- package/components/Breadcrumb/index.umd.min.js +7 -7
- package/components/Breadcrumb/index.umd.min.js.map +1 -1
- package/components/Checkbox/checkbox.js +1 -1
- package/components/Checkbox/index.umd.min.js +6 -6
- package/components/Checkbox/index.umd.min.js.map +1 -1
- package/components/Checkbox/sgds-checkbox.js +1 -1
- package/components/Checkbox/sgds-checkbox.js.map +1 -1
- package/components/ComboBox/index.umd.min.js +274 -260
- package/components/ComboBox/index.umd.min.js.map +1 -1
- package/components/ComboBox/sgds-combo-box-option.d.ts +0 -3
- package/components/ComboBox/sgds-combo-box-option.js +2 -20
- package/components/ComboBox/sgds-combo-box-option.js.map +1 -1
- package/components/ComboBox/sgds-combo-box.d.ts +4 -0
- package/components/ComboBox/sgds-combo-box.js +79 -24
- package/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/components/Datepicker/index.umd.min.js +2 -2
- package/components/Datepicker/index.umd.min.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/Footer/index.umd.min.js +1 -1
- package/components/Footer/index.umd.min.js.map +1 -1
- package/components/Input/index.umd.min.js +1 -1
- package/components/Input/index.umd.min.js.map +1 -1
- package/components/Link/index.umd.min.js +9 -9
- package/components/Link/index.umd.min.js.map +1 -1
- package/components/Link/link.js +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/QuantityToggle/index.umd.min.js +1 -1
- package/components/QuantityToggle/index.umd.min.js.map +1 -1
- package/components/Radio/index.umd.min.js +6 -6
- package/components/Radio/index.umd.min.js.map +1 -1
- package/components/Radio/radio.js +1 -1
- package/components/Select/index.umd.min.js +1 -1
- package/components/Select/index.umd.min.js.map +1 -1
- package/components/Switch/index.umd.min.js +1 -1
- package/components/Switch/index.umd.min.js.map +1 -1
- package/components/Switch/switch.js +1 -1
- package/components/SystemBanner/index.umd.min.js +5 -1
- package/components/SystemBanner/index.umd.min.js.map +1 -1
- package/components/SystemBanner/sgds-system-banner.js +5 -1
- package/components/SystemBanner/sgds-system-banner.js.map +1 -1
- package/components/Textarea/index.umd.min.js +1 -1
- package/components/Textarea/index.umd.min.js.map +1 -1
- package/components/index.umd.min.js +33 -14
- package/components/index.umd.min.js.map +1 -1
- package/index.umd.min.js +33 -14
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/base/dropdown-element.cjs.js +3 -3
- package/react/base/dropdown-element.cjs.js.map +1 -1
- package/react/base/dropdown-element.js +3 -3
- package/react/base/dropdown-element.js.map +1 -1
- package/react/components/Checkbox/checkbox.cjs.js +1 -1
- package/react/components/Checkbox/checkbox.js +1 -1
- package/react/components/Checkbox/sgds-checkbox.cjs.js +1 -1
- package/react/components/Checkbox/sgds-checkbox.cjs.js.map +1 -1
- package/react/components/Checkbox/sgds-checkbox.js +1 -1
- package/react/components/Checkbox/sgds-checkbox.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box-option.cjs.js +2 -20
- package/react/components/ComboBox/sgds-combo-box-option.cjs.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box-option.js +2 -20
- package/react/components/ComboBox/sgds-combo-box-option.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.cjs.js +79 -24
- package/react/components/ComboBox/sgds-combo-box.cjs.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.js +79 -24
- package/react/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/react/components/Link/link.cjs.js +1 -1
- package/react/components/Link/link.js +1 -1
- package/react/components/Radio/radio.cjs.js +1 -1
- package/react/components/Radio/radio.js +1 -1
- package/react/components/Switch/switch.cjs.js +1 -1
- package/react/components/Switch/switch.js +1 -1
- package/react/components/SystemBanner/sgds-system-banner.cjs.js +5 -1
- package/react/components/SystemBanner/sgds-system-banner.cjs.js.map +1 -1
- package/react/components/SystemBanner/sgds-system-banner.js +5 -1
- package/react/components/SystemBanner/sgds-system-banner.js.map +1 -1
- package/react/styles/form-check.cjs.js +1 -1
- package/react/styles/form-check.js +1 -1
- package/react/styles/form-text-control.cjs.js +1 -1
- package/react/styles/form-text-control.js +1 -1
- package/styles/form-check.js +1 -1
- package/styles/form-text-control.js +1 -1
package/index.umd.min.js
CHANGED
|
@@ -2064,7 +2064,7 @@ const qt=e=>e??se;var Yt=Se`:host{cursor:pointer;display:inline-block}.alert-lin
|
|
|
2064
2064
|
></sgds-close-button>`:se}
|
|
2065
2065
|
</div>`}render(){return this.dismissible&&this.show||!this.dismissible?this.truncated?J`<sgds-tooltip content=${this.text} @sgds-hide=${e=>e.stopPropagation()}
|
|
2066
2066
|
>${this._renderBadge()}</sgds-tooltip
|
|
2067
|
-
>`:this._renderBadge():se}}Ki.styles=[...rt.styles,Kt],Ki.dependencies={"sgds-close-button":Ht,"sgds-tooltip":ji},e([Qe({type:Boolean,reflect:!0})],Ki.prototype,"show",void 0),e([Qe({reflect:!0})],Ki.prototype,"variant",void 0),e([Qe({type:Boolean,reflect:!0})],Ki.prototype,"outlined",void 0),e([Qe({type:Boolean,reflect:!0})],Ki.prototype,"dismissible",void 0),e([Qe({type:Boolean,reflect:!0})],Ki.prototype,"fullWidth",void 0),e([Je()],Ki.prototype,"truncated",void 0),e([Je()],Ki.prototype,"text",void 0),e([$t("show")],Ki.prototype,"_handleShowChange",null),e([$t("text")],Ki.prototype,"_handleTruncation",null),Vt("sgds-badge",Ki);var Gi=Se`:host([size=sm]) .overflow-btn{height:var(--sgds-dimension-24);width:var(--sgds-dimension-24)}.overflow-btn{align-items:center;background-color:var(--sgds-bg-transparent);border:0;border-radius:var(--sgds-border-radius-sm);cursor:pointer;display:flex;height:var(--sgds-dimension-32);justify-content:center;padding:0;position:relative;width:var(--sgds-dimension-32)}.overflow-btn:hover{background-color:var(--sgds-bg-translucent-subtle)}.overflow-btn:focus-visible{background-color:var(--sgds-bg-translucent-subtle);outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}`;function Xi(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}class Qi extends rt{constructor(){super(...arguments),this.myDropdown=us(),this.dropdownMenuId=Xi("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=us(),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=Hi(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 s=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)},i=t.map(s),a=e.map((e=>{const a=s(e),o=i.indexOf(a);return-1!==o?t[o]:e})).concat(t.filter((t=>!e.some((e=>s(e)===s(t))))));return a}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=[zi(8),this.noFlip?void 0:Oi(),Ri()].filter(Boolean);let s=t;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(s=this.mergeMiddleware(t,this.floatingOpts.middleware.filter(Boolean)));const i=Object.assign(Object.assign({strategy:"fixed",placement:e},this.floatingOpts),{middleware:s}),{x:a,y:o,strategy:n,placement:r}=await qi(this.myDropdown.value,this.menuRef.value,i);this.menuRef.value.setAttribute("data-placement",r),Object.assign(this.menuRef.value.style,{position:n,left:`${a}px`,top:`${o}px`})}}e([Qe({type:Boolean,state:!0})],Qi.prototype,"noFlip",void 0),e([Qe({type:Boolean,reflect:!0,state:!0})],Qi.prototype,"menuAlignRight",void 0),e([Qe({type:String,reflect:!0,state:!0})],Qi.prototype,"drop",void 0),e([Qe({type:Object})],Qi.prototype,"floatingOpts",void 0),e([Qe({type:Boolean,reflect:!0})],Qi.prototype,"menuIsOpen",void 0),e([Qe({type:Boolean,reflect:!0})],Qi.prototype,"disabled",void 0),e([Qe({type:Boolean,reflect:!0})],Qi.prototype,"readonly",void 0);class Ji extends Qi{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(),s=t.indexOf(e.target);this.nextDropdownItemNo=s+1,this.prevDropdownItemNo=s<=0?t.length-1:s-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 s=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".dropdown-item");s&&s.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 s=(e%t.length+t.length)%t.length,i=t[s];this.emit("i-sgds-option-focus",{detail:{option:i}}),this.nextDropdownItemNo=(s+1)%t.length,this.prevDropdownItemNo=(s-1+t.length)%t.length,t.forEach((e=>{const t=e.shadowRoot.querySelector(".dropdown-item");t.setAttribute("tabindex",e===i?"0":"-1"),e===i&&t.focus()}))}}Ji.styles=Qi.styles,e([st("ul.dropdown-menu")],Ji.prototype,"menu",void 0),e([Je()],Ji.prototype,"nextDropdownItemNo",void 0),e([Je()],Ji.prototype,"prevDropdownItemNo",void 0),e([Qe({type:Boolean,reflect:!0})],Ji.prototype,"hidden",void 0);var ea=Se`: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:512px){.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:1024px){.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1280px){.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1440px){.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%}`,ta=Se`.dropdown{display:flex;height:inherit;position:relative}`;class sa extends Ji{constructor(){super(),this.noFlip=!1,this.menuAlignRight=!1,this.drop="down",this.menuRef=vs()}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 J`
|
|
2067
|
+
>`:this._renderBadge():se}}Ki.styles=[...rt.styles,Kt],Ki.dependencies={"sgds-close-button":Ht,"sgds-tooltip":ji},e([Qe({type:Boolean,reflect:!0})],Ki.prototype,"show",void 0),e([Qe({reflect:!0})],Ki.prototype,"variant",void 0),e([Qe({type:Boolean,reflect:!0})],Ki.prototype,"outlined",void 0),e([Qe({type:Boolean,reflect:!0})],Ki.prototype,"dismissible",void 0),e([Qe({type:Boolean,reflect:!0})],Ki.prototype,"fullWidth",void 0),e([Je()],Ki.prototype,"truncated",void 0),e([Je()],Ki.prototype,"text",void 0),e([$t("show")],Ki.prototype,"_handleShowChange",null),e([$t("text")],Ki.prototype,"_handleTruncation",null),Vt("sgds-badge",Ki);var Gi=Se`:host([size=sm]) .overflow-btn{height:var(--sgds-dimension-24);width:var(--sgds-dimension-24)}.overflow-btn{align-items:center;background-color:var(--sgds-bg-transparent);border:0;border-radius:var(--sgds-border-radius-sm);cursor:pointer;display:flex;height:var(--sgds-dimension-32);justify-content:center;padding:0;position:relative;width:var(--sgds-dimension-32)}.overflow-btn:hover{background-color:var(--sgds-bg-translucent-subtle)}.overflow-btn:focus-visible{background-color:var(--sgds-bg-translucent-subtle);outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}`;function Xi(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}class Qi extends rt{constructor(){super(...arguments),this.myDropdown=us(),this.dropdownMenuId=Xi("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=us(),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(!0))}}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=Hi(this.myDropdown.value,this.menuRef.value,(()=>this.updateFloatingPosition()))))}async hideMenu(e){this.menuIsOpen&&(this.emit("sgds-hide",{detail:{isOutside:e}}),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 s=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)},i=t.map(s),a=e.map((e=>{const a=s(e),o=i.indexOf(a);return-1!==o?t[o]:e})).concat(t.filter((t=>!e.some((e=>s(e)===s(t))))));return a}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=[zi(8),this.noFlip?void 0:Oi(),Ri()].filter(Boolean);let s=t;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(s=this.mergeMiddleware(t,this.floatingOpts.middleware.filter(Boolean)));const i=Object.assign(Object.assign({strategy:"fixed",placement:e},this.floatingOpts),{middleware:s}),{x:a,y:o,strategy:n,placement:r}=await qi(this.myDropdown.value,this.menuRef.value,i);this.menuRef.value.setAttribute("data-placement",r),Object.assign(this.menuRef.value.style,{position:n,left:`${a}px`,top:`${o}px`})}}e([Qe({type:Boolean,state:!0})],Qi.prototype,"noFlip",void 0),e([Qe({type:Boolean,reflect:!0,state:!0})],Qi.prototype,"menuAlignRight",void 0),e([Qe({type:String,reflect:!0,state:!0})],Qi.prototype,"drop",void 0),e([Qe({type:Object})],Qi.prototype,"floatingOpts",void 0),e([Qe({type:Boolean,reflect:!0})],Qi.prototype,"menuIsOpen",void 0),e([Qe({type:Boolean,reflect:!0})],Qi.prototype,"disabled",void 0),e([Qe({type:Boolean,reflect:!0})],Qi.prototype,"readonly",void 0);class Ji extends Qi{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(),s=t.indexOf(e.target);this.nextDropdownItemNo=s+1,this.prevDropdownItemNo=s<=0?t.length-1:s-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 s=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".dropdown-item");s&&s.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 s=(e%t.length+t.length)%t.length,i=t[s];this.emit("i-sgds-option-focus",{detail:{option:i}}),this.nextDropdownItemNo=(s+1)%t.length,this.prevDropdownItemNo=(s-1+t.length)%t.length,t.forEach((e=>{const t=e.shadowRoot.querySelector(".dropdown-item");t.setAttribute("tabindex",e===i?"0":"-1"),e===i&&t.focus()}))}}Ji.styles=Qi.styles,e([st("ul.dropdown-menu")],Ji.prototype,"menu",void 0),e([Je()],Ji.prototype,"nextDropdownItemNo",void 0),e([Je()],Ji.prototype,"prevDropdownItemNo",void 0),e([Qe({type:Boolean,reflect:!0})],Ji.prototype,"hidden",void 0);var ea=Se`: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:512px){.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:1024px){.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1280px){.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1440px){.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%}`,ta=Se`.dropdown{display:flex;height:inherit;position:relative}`;class sa extends Ji{constructor(){super(),this.noFlip=!1,this.menuAlignRight=!1,this.drop="down",this.menuRef=vs()}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 J`
|
|
2068
2068
|
<div class="dropdown">
|
|
2069
2069
|
<div
|
|
2070
2070
|
class="toggler-container"
|
|
@@ -2099,7 +2099,7 @@ const qt=e=>e??se;var Yt=Se`:host{cursor:pointer;display:inline-block}.alert-lin
|
|
|
2099
2099
|
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
2100
2100
|
</div>
|
|
2101
2101
|
</div>
|
|
2102
|
-
`}}ra.styles=[...rt.styles,na],ra.dependencies={"sgds-overflow-menu":oa},e([Qe({type:String})],ra.prototype,"ariaLabel",void 0),e([st("slot")],ra.prototype,"defaultSlot",void 0);var la=Se`:host{--color-emphasis:var(--sgds-link-color-emphasis);display:inline-flex;vertical-align:middle}:host([tone=danger]),:host([variant=danger]){--color-emphasis:var(--sgds-danger-color-emphasis)}:host([tone=neutral]),:host([variant=neutral]){--color-emphasis:var(--sgds-color-default)}:host([tone=fixed-light]),:host([variant=light]){--color-emphasis:var(--sgds-color-fixed-light)}:host([variant=dark]) :host([tone=fixed-dark]){--color-emphasis:var(--sgds-color-fixed-dark)}:host([tone=danger]) .nav-link::slotted(a),:host([variant=danger]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-danger-color-default);color:var(--sgds-link-color-default,--sgds-danger-color-default)}:host([tone=danger]) .nav-link::slotted(a:focus),:host([tone=danger]) .nav-link::slotted(a:focus-visible),:host([tone=danger]) .nav-link::slotted(a:hover),:host([variant=danger]) .nav-link::slotted(a:focus),:host([variant=danger]) .nav-link::slotted(a:focus-visible),:host([variant=danger]) .nav-link::slotted(a:hover){--color-emphasis:var(--sgds-danger-color-emphasis);color:var(--color-emphasis,--sgds-danger-color-emphasis)}:host([tone=neutral]) .nav-link::slotted(a),:host([variant=neutral]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-color-default);color:var(--sgds-link-color-default,--sgds-color-default)}:host([tone=neutral]) .nav-link::slotted(a:focus),:host([tone=neutral]) .nav-link::slotted(a:focus-visible),:host([tone=neutral]) .nav-link::slotted(a:hover),:host([variant=neutral]) .nav-link::slotted(a:focus),:host([variant=neutral]) .nav-link::slotted(a:focus-visible),:host([variant=neutral]) .nav-link::slotted(a:hover){--color-emphasis:var(--sgds-color-default);color:var(--color-emphasis,--sgds-color-default)}:host([tone=fixed-light]) .nav-link::slotted(a),:host([variant=light]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-color-fixed-light);color:var(--sgds-link-color-default,--sgds-color-fixed-light)}:host([tone=fixed-light]) .nav-link::slotted(a:focus),:host([tone=fixed-light]) .nav-link::slotted(a:focus-visible),:host([tone=fixed-light]) .nav-link::slotted(a:hover),:host([variant=light]) .nav-link::slotted(a:focus),:host([variant=light]) .nav-link::slotted(a:focus-visible),:host([variant=light]) .nav-link::slotted(a:hover){--color-emphasis:var(--sgds-color-fixed-light);color:var(--color-emphasis,--sgds-color-fixed-light)}:host([tone=fixed-dark]) .nav-link::slotted(a),:host([variant=dark]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-color-fixed-dark);color:var(--sgds-link-color-default,--sgds-color-fixed-dark)}:host([tone=fixed-dark]) .nav-link::slotted(a:focus),:host([tone=fixed-dark]) .nav-link::slotted(a:focus-visible),:host([tone=fixed-dark]) .nav-link::slotted(a:hover),:host([variant=dark]) .nav-link::slotted(a:focus),:host([variant=dark]) .nav-link::slotted(a:focus-visible),:host([variant=dark]) .nav-link::slotted(a:hover){--color-emphasis:var(--sgds-color-fixed-dark);color:var(--color-emphasis,--sgds-color-fixed-dark)}:host([size=md]) .nav-link::slotted(a){--text-underline-offset:3px;font-size:var(--sgds-font-size-2)!important;line-height:var(--sgds-line-height-24)!important}:host([size=lg]) .nav-link::slotted(a){--text-underline-offset:4px;font-size:var(--sgds-font-size-3)!important;line-height:var(--sgds-line-height-32)!important}:host([size=sm]) .nav-link::slotted(a){--text-underline-offset:2.8px;font-size:var(--sgds-font-size-1)!important;line-height:var(--sgds-line-height-20)!important}:host([size=xs]) .nav-link::slotted(a){--text-underline-offset:2.2px;font-size:var(--sgds-font-size-0)!important;line-height:var(--sgds-line-height-16)!important}.nav-link::slotted(a):after{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.145 3.667h.021a.5.5 0 1 1 0 1c-.708 0-1.209 0-1.6.032-.387.032-.622.091-.807.186a2 2 0 0 0-.875.874c-.094.185-.154.42-.185.806-.032.392-.032.893-.032 1.602v3.666c0 .709 0 1.21.032 1.602.031.386.091.621.185.806a2 2 0 0 0 .875.874c.185.095.42.154.806.186.392.032.893.032 1.601.032h3.667c.708 0 1.21 0 1.601-.032.386-.032.622-.091.807-.186a2 2 0 0 0 .874-.874c.095-.185.154-.42.186-.806.032-.392.032-.893.032-1.602a.5.5 0 1 1 1 0v.022c0 .682 0 1.224-.036 1.661-.036.448-.113.83-.29 1.18a3 3 0 0 1-1.312 1.31c-.35.178-.731.255-1.18.292-.436.035-.978.035-1.66.035h-3.71c-.682 0-1.224 0-1.661-.035-.448-.037-.83-.113-1.18-.292a3 3 0 0 1-1.31-1.31c-.179-.35-.255-.732-.292-1.18-.035-.437-.035-.98-.035-1.66V8.144c0-.682 0-1.224.035-1.661.037-.448.113-.83.291-1.18a3 3 0 0 1 1.312-1.31c.35-.178.731-.255 1.179-.292.437-.035.98-.035 1.66-.035Zm2.188.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v5a.5.5 0 0 1-1 0V5.374l-4.98 4.98a.5.5 0 0 1-.707-.708l4.98-4.98h-3.793a.5.5 0 0 1-.5-.5Z' fill='%230E0E0E'/%3E%3C/svg%3E")!important;mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.145 3.667h.021a.5.5 0 1 1 0 1c-.708 0-1.209 0-1.6.032-.387.032-.622.091-.807.186a2 2 0 0 0-.875.874c-.094.185-.154.42-.185.806-.032.392-.032.893-.032 1.602v3.666c0 .709 0 1.21.032 1.602.031.386.091.621.185.806a2 2 0 0 0 .875.874c.185.095.42.154.806.186.392.032.893.032 1.601.032h3.667c.708 0 1.21 0 1.601-.032.386-.032.622-.091.807-.186a2 2 0 0 0 .874-.874c.095-.185.154-.42.186-.806.032-.392.032-.893.032-1.602a.5.5 0 1 1 1 0v.022c0 .682 0 1.224-.036 1.661-.036.448-.113.83-.29 1.18a3 3 0 0 1-1.312 1.31c-.35.178-.731.255-1.18.292-.436.035-.978.035-1.66.035h-3.71c-.682 0-1.224 0-1.661-.035-.448-.037-.83-.113-1.18-.292a3 3 0 0 1-1.31-1.31c-.179-.35-.255-.732-.292-1.18-.035-.437-.035-.98-.035-1.66V8.144c0-.682 0-1.224.035-1.661.037-.448.113-.83.291-1.18a3 3 0 0 1 1.312-1.31c.35-.178.731-.255 1.179-.292.437-.035.98-.035 1.66-.035Zm2.188.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v5a.5.5 0 0 1-1 0V5.374l-4.98 4.98a.5.5 0 0 1-.707-.708l4.98-4.98h-3.793a.5.5 0 0 1-.5-.5Z' fill='%230E0E0E'/%3E%3C/svg%3E")!important}:host([size=xs]) .nav-link::slotted(a):after{height:var(--sgds-icon-size-sm)!important;width:var(--sgds-icon-size-sm)!important}:host([size=sm]) .nav-link::slotted(a):after{height:var(--sgds-icon-size-md)!important;width:var(--sgds-icon-size-md)!important}:host([size=md]) .nav-link::slotted(a):after{height:var(--sgds-icon-size-lg)!important;width:var(--sgds-icon-size-lg)!important}:host([size=lg]) .nav-link::slotted(a):after{height:var(--sgds-icon-size-xl)!important;width:var(--sgds-icon-size-xl)!important}::slotted(*){align-items:center;display:flex}.nav-link::slotted(a:focus-visible:not([disabled])){outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.nav-link::slotted(a[disabled]){cursor:not-allowed;opacity:var(--sgds-opacity-50)}.nav-link::slotted(a){color:var(--sgds-link-color-default);cursor:pointer}:host(:not([active])) .nav-link::slotted(a:not(:hover)){text-decoration:underline solid transparent!important;text-underline-offset:0;transition:text-underline-offset var(--sgds-motion-duration-standard) var(--sgds-motion-easing-enter),text-decoration-color var(--sgds-motion-duration-standard) var(--sgds-motion-easing-enter)}.nav-link::slotted(a:focus),.nav-link::slotted(a:focus-visible),.nav-link::slotted(a:hover),:host([active]) .nav-link::slotted(a){color:var(--color-emphasis)!important}.nav-link::slotted(a:hover),:host([active]) .nav-link::slotted(a){text-decoration-color:var(--color-emphasis)!important;text-underline-offset:var(--text-underline-offset);transition:text-underline-offset var(--sgds-motion-duration-standard) var(--sgds-motion-easing-enter),text-decoration-color var(--sgds-motion-duration-standard) var(--sgds-motion-easing-enter)}.nav-link::slotted(a[disabled]),:host([disabled]) .nav-link::slotted(a){text-decoration:none!important}@media (prefers-reduced-motion:reduce){.nav-link::slotted(a:hover),:host(:not([active])) .nav-link::slotted(a:not(:hover)),:host([active]) .nav-link::slotted(a){transition:none}}`;class da extends rt{constructor(){super(...arguments),this.size="md",this.variant="primary",this.tone="primary",this.active=!1,this.disabled=!1}_processAnchor(e){this.disabled&&e.setAttribute("disabled","true"),e.hasAttribute("disabled")?(e.setAttribute("href","javascript:void(0)"),e.setAttribute("tabindex","-1")):e.setAttribute("tabindex","0")}_processIcon(e){const t={xs:"sm",sm:"md",md:"lg",lg:"xl"};e.querySelectorAll("sgds-icon").forEach((e=>{e.setAttribute("size",t[this.size]),e.classList.remove("icon-left","icon-right"),e.previousElementSibling||e.previousSibling||e.classList.add("icon-left"),e.nextElementSibling||e.nextSibling||e.classList.add("icon-right")}))}_handleSlotChange(e){const t=e.target.assignedElements().find((e=>"a"===e.tagName.toLowerCase()));t&&(this._processAnchor(t),this._processIcon(t))}firstUpdated(e){super.firstUpdated(e);const t=this.querySelector("a");t&&(this._processAnchor(t),this._processIcon(t))}render(){return J`<slot class="nav-link " @slotchange=${this._handleSlotChange}></slot> `}}da.styles=[...rt.styles,la],e([Qe({type:String,reflect:!0})],da.prototype,"size",void 0),e([Qe({type:String,reflect:!0})],da.prototype,"variant",void 0),e([Qe({type:String,reflect:!0})],da.prototype,"tone",void 0),e([Qe({type:Boolean,reflect:!0})],da.prototype,"active",void 0),e([Qe({type:Boolean,reflect:!0})],da.prototype,"disabled",void 0);var ca=Se`:host{align-items:center;display:flex;gap:var(--sgds-gap-xs)}:host([active]) .nav-link::slotted(*){--sgds-link-color-default:var(--sgds-color-default);color:var(--sgds-link-color-default,--sgds-color-default);pointer-events:none}:host([active]) .nav-link::slotted(:focus),:host([active]) .nav-link::slotted(:focus-visible),:host([active]) .nav-link::slotted(:hover){--sgds-link-color-emphasis:var(--sgds-color-default);color:var(--sgds-link-color-emphasis,--sgds-color-default)}.separator svg{display:block}:host(:last-of-type) .separator{display:none}`;class ha extends rt{constructor(){super(...arguments),this.active=!1}render(){return J`
|
|
2102
|
+
`}}ra.styles=[...rt.styles,na],ra.dependencies={"sgds-overflow-menu":oa},e([Qe({type:String})],ra.prototype,"ariaLabel",void 0),e([st("slot")],ra.prototype,"defaultSlot",void 0);var la=Se`:host{--color-emphasis:var(--sgds-link-color-emphasis);display:inline-flex;vertical-align:middle}:host([tone=danger]),:host([variant=danger]){--color-emphasis:var(--sgds-danger-color-emphasis)}:host([tone=neutral]),:host([variant=neutral]){--color-emphasis:var(--sgds-color-default)}:host([tone=fixed-light]),:host([variant=light]){--color-emphasis:var(--sgds-color-fixed-light)}:host([variant=dark]) :host([tone=fixed-dark]){--color-emphasis:var(--sgds-color-fixed-dark)}:host([tone=danger]) .nav-link::slotted(a),:host([variant=danger]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-danger-color-default);color:var(--sgds-link-color-default,--sgds-danger-color-default)}:host([tone=danger]) .nav-link::slotted(a:focus),:host([tone=danger]) .nav-link::slotted(a:focus-visible),:host([tone=danger]) .nav-link::slotted(a:hover),:host([variant=danger]) .nav-link::slotted(a:focus),:host([variant=danger]) .nav-link::slotted(a:focus-visible),:host([variant=danger]) .nav-link::slotted(a:hover){--color-emphasis:var(--sgds-danger-color-emphasis);color:var(--color-emphasis,--sgds-danger-color-emphasis)}:host([tone=neutral]) .nav-link::slotted(a),:host([variant=neutral]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-color-default);color:var(--sgds-link-color-default,--sgds-color-default)}:host([tone=neutral]) .nav-link::slotted(a:focus),:host([tone=neutral]) .nav-link::slotted(a:focus-visible),:host([tone=neutral]) .nav-link::slotted(a:hover),:host([variant=neutral]) .nav-link::slotted(a:focus),:host([variant=neutral]) .nav-link::slotted(a:focus-visible),:host([variant=neutral]) .nav-link::slotted(a:hover){--color-emphasis:var(--sgds-color-default);color:var(--color-emphasis,--sgds-color-default)}:host([tone=fixed-light]) .nav-link::slotted(a),:host([variant=light]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-color-fixed-light);color:var(--sgds-link-color-default,--sgds-color-fixed-light)}:host([tone=fixed-light]) .nav-link::slotted(a:focus),:host([tone=fixed-light]) .nav-link::slotted(a:focus-visible),:host([tone=fixed-light]) .nav-link::slotted(a:hover),:host([variant=light]) .nav-link::slotted(a:focus),:host([variant=light]) .nav-link::slotted(a:focus-visible),:host([variant=light]) .nav-link::slotted(a:hover){--color-emphasis:var(--sgds-color-fixed-light);color:var(--color-emphasis,--sgds-color-fixed-light)}:host([tone=fixed-dark]) .nav-link::slotted(a),:host([variant=dark]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-color-fixed-dark);color:var(--sgds-link-color-default,--sgds-color-fixed-dark)}:host([tone=fixed-dark]) .nav-link::slotted(a:focus),:host([tone=fixed-dark]) .nav-link::slotted(a:focus-visible),:host([tone=fixed-dark]) .nav-link::slotted(a:hover),:host([variant=dark]) .nav-link::slotted(a:focus),:host([variant=dark]) .nav-link::slotted(a:focus-visible),:host([variant=dark]) .nav-link::slotted(a:hover){--color-emphasis:var(--sgds-color-fixed-dark);color:var(--color-emphasis,--sgds-color-fixed-dark)}:host([size=md]) .nav-link::slotted(a){--text-underline-offset:3px;font-size:var(--sgds-font-size-2)!important;line-height:var(--sgds-line-height-24)!important}:host([size=lg]) .nav-link::slotted(a){--text-underline-offset:4px;font-size:var(--sgds-font-size-3)!important;line-height:var(--sgds-line-height-32)!important}:host([size=sm]) .nav-link::slotted(a){--text-underline-offset:2.8px;font-size:var(--sgds-font-size-1)!important;line-height:var(--sgds-line-height-20)!important}:host([size=xs]) .nav-link::slotted(a){--text-underline-offset:2.2px;font-size:var(--sgds-font-size-0)!important;line-height:var(--sgds-line-height-16)!important}.nav-link::slotted(a):after{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.145 3.667h.021a.5.5 0 1 1 0 1c-.708 0-1.209 0-1.6.032-.387.032-.622.091-.807.186a2 2 0 0 0-.875.874c-.094.185-.154.42-.185.806-.032.392-.032.893-.032 1.602v3.666c0 .709 0 1.21.032 1.602.031.386.091.621.185.806a2 2 0 0 0 .875.874c.185.095.42.154.806.186.392.032.893.032 1.601.032h3.667c.708 0 1.21 0 1.601-.032.386-.032.622-.091.807-.186a2 2 0 0 0 .874-.874c.095-.185.154-.42.186-.806.032-.392.032-.893.032-1.602a.5.5 0 1 1 1 0v.022c0 .682 0 1.224-.036 1.661-.036.448-.113.83-.29 1.18a3 3 0 0 1-1.312 1.31c-.35.178-.731.255-1.18.292-.436.035-.978.035-1.66.035h-3.71c-.682 0-1.224 0-1.661-.035-.448-.037-.83-.113-1.18-.292a3 3 0 0 1-1.31-1.31c-.179-.35-.255-.732-.292-1.18-.035-.437-.035-.98-.035-1.66V8.144c0-.682 0-1.224.035-1.661.037-.448.113-.83.291-1.18a3 3 0 0 1 1.312-1.31c.35-.178.731-.255 1.179-.292.437-.035.98-.035 1.66-.035Zm2.188.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v5a.5.5 0 0 1-1 0V5.374l-4.98 4.98a.5.5 0 0 1-.707-.708l4.98-4.98h-3.793a.5.5 0 0 1-.5-.5Z' fill='%230E0E0E'/%3E%3C/svg%3E")!important;mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.145 3.667h.021a.5.5 0 1 1 0 1c-.708 0-1.209 0-1.6.032-.387.032-.622.091-.807.186a2 2 0 0 0-.875.874c-.094.185-.154.42-.185.806-.032.392-.032.893-.032 1.602v3.666c0 .709 0 1.21.032 1.602.031.386.091.621.185.806a2 2 0 0 0 .875.874c.185.095.42.154.806.186.392.032.893.032 1.601.032h3.667c.708 0 1.21 0 1.601-.032.386-.032.622-.091.807-.186a2 2 0 0 0 .874-.874c.095-.185.154-.42.186-.806.032-.392.032-.893.032-1.602a.5.5 0 1 1 1 0v.022c0 .682 0 1.224-.036 1.661-.036.448-.113.83-.29 1.18a3 3 0 0 1-1.312 1.31c-.35.178-.731.255-1.18.292-.436.035-.978.035-1.66.035h-3.71c-.682 0-1.224 0-1.661-.035-.448-.037-.83-.113-1.18-.292a3 3 0 0 1-1.31-1.31c-.179-.35-.255-.732-.292-1.18-.035-.437-.035-.98-.035-1.66V8.144c0-.682 0-1.224.035-1.661.037-.448.113-.83.291-1.18a3 3 0 0 1 1.312-1.31c.35-.178.731-.255 1.179-.292.437-.035.98-.035 1.66-.035Zm2.188.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v5a.5.5 0 0 1-1 0V5.374l-4.98 4.98a.5.5 0 0 1-.707-.708l4.98-4.98h-3.793a.5.5 0 0 1-.5-.5Z' fill='%230E0E0E'/%3E%3C/svg%3E")!important}:host([size=xs]) .nav-link::slotted(a):after{height:var(--sgds-icon-size-sm)!important;width:var(--sgds-icon-size-sm)!important}:host([size=sm]) .nav-link::slotted(a):after{height:var(--sgds-icon-size-md)!important;width:var(--sgds-icon-size-md)!important}:host([size=md]) .nav-link::slotted(a):after{height:var(--sgds-icon-size-lg)!important;width:var(--sgds-icon-size-lg)!important}:host([size=lg]) .nav-link::slotted(a):after{height:var(--sgds-icon-size-xl)!important;width:var(--sgds-icon-size-xl)!important}::slotted(*){align-items:center;display:flex}.nav-link::slotted(a:focus-visible:not([disabled])){outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.nav-link::slotted(a[disabled]){cursor:not-allowed;opacity:var(--sgds-opacity-50)}.nav-link::slotted(a){color:var(--sgds-link-color-default)!important;cursor:pointer}:host(:not([active])) .nav-link::slotted(a:not(:hover)){text-decoration:underline solid transparent!important;text-underline-offset:0;transition:text-underline-offset var(--sgds-motion-duration-standard) var(--sgds-motion-easing-enter),text-decoration-color var(--sgds-motion-duration-standard) var(--sgds-motion-easing-enter)}.nav-link::slotted(a:focus),.nav-link::slotted(a:focus-visible),.nav-link::slotted(a:hover),:host([active]) .nav-link::slotted(a){color:var(--color-emphasis)!important}.nav-link::slotted(a:hover),:host([active]) .nav-link::slotted(a){text-decoration-color:var(--color-emphasis)!important;text-underline-offset:var(--text-underline-offset);transition:text-underline-offset var(--sgds-motion-duration-standard) var(--sgds-motion-easing-enter),text-decoration-color var(--sgds-motion-duration-standard) var(--sgds-motion-easing-enter)}.nav-link::slotted(a[disabled]),:host([disabled]) .nav-link::slotted(a){text-decoration:none!important}@media (prefers-reduced-motion:reduce){.nav-link::slotted(a:hover),:host(:not([active])) .nav-link::slotted(a:not(:hover)),:host([active]) .nav-link::slotted(a){transition:none}}`;class da extends rt{constructor(){super(...arguments),this.size="md",this.variant="primary",this.tone="primary",this.active=!1,this.disabled=!1}_processAnchor(e){this.disabled&&e.setAttribute("disabled","true"),e.hasAttribute("disabled")?(e.setAttribute("href","javascript:void(0)"),e.setAttribute("tabindex","-1")):e.setAttribute("tabindex","0")}_processIcon(e){const t={xs:"sm",sm:"md",md:"lg",lg:"xl"};e.querySelectorAll("sgds-icon").forEach((e=>{e.setAttribute("size",t[this.size]),e.classList.remove("icon-left","icon-right"),e.previousElementSibling||e.previousSibling||e.classList.add("icon-left"),e.nextElementSibling||e.nextSibling||e.classList.add("icon-right")}))}_handleSlotChange(e){const t=e.target.assignedElements().find((e=>"a"===e.tagName.toLowerCase()));t&&(this._processAnchor(t),this._processIcon(t))}firstUpdated(e){super.firstUpdated(e);const t=this.querySelector("a");t&&(this._processAnchor(t),this._processIcon(t))}render(){return J`<slot class="nav-link " @slotchange=${this._handleSlotChange}></slot> `}}da.styles=[...rt.styles,la],e([Qe({type:String,reflect:!0})],da.prototype,"size",void 0),e([Qe({type:String,reflect:!0})],da.prototype,"variant",void 0),e([Qe({type:String,reflect:!0})],da.prototype,"tone",void 0),e([Qe({type:Boolean,reflect:!0})],da.prototype,"active",void 0),e([Qe({type:Boolean,reflect:!0})],da.prototype,"disabled",void 0);var ca=Se`:host{align-items:center;display:flex;gap:var(--sgds-gap-xs)}:host([active]) .nav-link::slotted(*){--sgds-link-color-default:var(--sgds-color-default);color:var(--sgds-link-color-default,--sgds-color-default);pointer-events:none}:host([active]) .nav-link::slotted(:focus),:host([active]) .nav-link::slotted(:focus-visible),:host([active]) .nav-link::slotted(:hover){--sgds-link-color-emphasis:var(--sgds-color-default);color:var(--sgds-link-color-emphasis,--sgds-color-default)}.separator svg{display:block}:host(:last-of-type) .separator{display:none}`;class ha extends rt{constructor(){super(...arguments),this.active=!1}render(){return J`
|
|
2103
2103
|
<sgds-link><slot class="nav-link"></slot></sgds-link>
|
|
2104
2104
|
<div class="separator">
|
|
2105
2105
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
@@ -2173,7 +2173,7 @@ const qt=e=>e??se;var Yt=Se`:host{cursor:pointer;display:inline-block}.alert-lin
|
|
|
2173
2173
|
* Copyright 2020 Google LLC
|
|
2174
2174
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2175
2175
|
*/
|
|
2176
|
-
class extends mt{constructor(e){if(super(e),e.type!==pt&&e.type!==ht&&e.type!==gt)throw new Error("The `live` directive is not allowed on child or event bindings");if(!Qt(e))throw new Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===te||t===se)return t;const s=e.element,i=e.name;if(e.type===pt){if(t===s[i])return te}else if(e.type===gt){if(!!t===s.hasAttribute(i))return te}else if(e.type===ht&&s.getAttribute(i)===String(t))return te;return is(e),t}});var $a=Se`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-1);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,Aa=Se`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-1);line-height:var(--sgds-line-height-20)}.form-text.disabled{opacity:var(--sgds-opacity-50)}`,Da=Se`.form-control-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.form-control-group{align-items:center;background-color:var(--sgds-form-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);border-radius:var(--input-border-radius,var(--sgds-form-border-radius-md));display:flex;gap:var(--sgds-form-gap-md);height:var(--sgds-dimension-48);justify-content:center;min-width:var(--sgds-dimension-256);padding:0 var(--sgds-form-padding-x);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:-webkit-fill-available;width:-moz-available}.form-control{appearance:none;background-clip:padding-box;background:none;border:none;color:var(--sgds-form-color-default);display:block;flex-grow:1;font-size:var(--sgds-font-size-2);line-height:var(--sgds-line-height-24);outline:none;padding:0}@media (prefers-reduced-motion:reduce){.form-control-group{transition:none}}.form-control-group:not(.disabled):not(.is-invalid):not(.readonly):not(:focus-within):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-group:not(.disabled):not(.is-invalid):focus-within{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-container.disabled{opacity:var(--sgds-opacity-50)}.form-control-group.disabled{background-color:var(--sgds-form-surface-muted);cursor:not-allowed}.form-control-group.readonly{background-color:var(--sgds-form-surface-raised)}.form-control-group.is-invalid:not(.disabled){border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-control-group:not(.disabled).is-invalid:focus-within{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}`;const Va=(e="value")=>(t,s)=>{const i=t.constructor,a=i.prototype.attributeChangedCallback;i.prototype.attributeChangedCallback=function(t,o,n){var r;const l=i.getPropertyOptions(e);if(t===("string"==typeof l.attribute?l.attribute:e).toLowerCase()){const t=l.converter||ze,i=("function"==typeof t?t:null!==(r=null==t?void 0:t.fromAttribute)&&void 0!==r?r:ze.fromAttribute)(n,l.type);this[e]!==i&&(this[s]=i)}a.call(this,t,o,n)}};class Ea{constructor(e,t){(this.host=e).addController(this),this._internals=this.host.attachInternals(),this.options=Object.assign({setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input},t)}hostConnected(){this.host.addEventListener("invalid",(e=>this.handleInvalid(e)))}hostDisconnected(){this.host.removeEventListener("invalid",(e=>this.handleInvalid(e)))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){const t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){const t=e.target;this.validateInput(t),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(e,t,s){return this._internals.setValidity(e,t,s)}setFormValue(){const e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const t=e.validity;if(t.valid)this._internals.setValidity({});else for(const s in t)t[s]&&(this.validationError=s.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const Ia=t=>{class s extends t{constructor(){super(...arguments),this._isTouched=!1}connectedCallback(){var e;super.connectedCallback(),this._mixinShouldSkipSgdsValidation()||null!==(e=this.inputValidationController)&&void 0!==e||(this.inputValidationController=new Ea(this))}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinShouldSkipSgdsValidation()||this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this.inputValidationController.validateInput(e),this._isTouched&&(this._isTouched=!1)}_mixinValidate(e){this.inputValidationController.validateInput(e)}_mixinSetFormValue(){this.inputValidationController.setFormValue()}_mixinCheckValidity(){return this.inputValidationController.checkValidity()}_mixinReportValidity(){return this.inputValidationController.reportValidity()}_mixinGetValidity(){return this.inputValidationController.validity}_mixinGetValidationMessage(){return this.inputValidationController.validationMessage}_mixinSetValidity(e,t,s){return this.inputValidationController.setValidity(e,t,s)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return s.formAssociated=!0,e([it("sgds-input")],s.prototype,"sgdsInput",void 0),e([it("sgds-datepicker-input")],s.prototype,"sgdsDatepickerInput",void 0),s};class Ba extends(Ia(Ji)){constructor(){super(),this.label="",this.hintText="",this.autofocus=!1,this.disabled=!1,this.required=!1,this.value="",this.displayValue="",this.defaultValue="",this.hasFeedback=!1,this.invalidFeedback="",this.invalid=!1,this.menuList=[],this.selectedItems=[],this.filteredList=[],this._isTouched=!1,this._controlId=Xi("input"),this._labelId=Xi("label"),this.floatingOpts={middleware:[Ni({apply({rects:e,elements:t}){t.floating.style.width=`${e.reference.width}px`}})]}}connectedCallback(){super.connectedCallback(),this.addEventListener("blur",(async()=>{this.invalid=!this.menuIsOpen&&!this._mixinReportValidity()}))}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_renderFeedback(){return this.invalid&&this.hasFeedback?J` <div class="invalid-feedback-container">
|
|
2176
|
+
class extends mt{constructor(e){if(super(e),e.type!==pt&&e.type!==ht&&e.type!==gt)throw new Error("The `live` directive is not allowed on child or event bindings");if(!Qt(e))throw new Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===te||t===se)return t;const s=e.element,i=e.name;if(e.type===pt){if(t===s[i])return te}else if(e.type===gt){if(!!t===s.hasAttribute(i))return te}else if(e.type===ht&&s.getAttribute(i)===String(t))return te;return is(e),t}});var $a=Se`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-1);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,Aa=Se`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-1);line-height:var(--sgds-line-height-20)}.form-text.disabled{opacity:var(--sgds-opacity-50)}`,Da=Se`.form-control-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.form-control-group{align-items:center;background-color:var(--sgds-form-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);border-radius:var(--input-border-radius,var(--sgds-form-border-radius-md));display:flex;gap:var(--sgds-form-gap-md);height:var(--sgds-dimension-48);justify-content:center;min-width:var(--sgds-dimension-256);padding:0 var(--sgds-form-padding-x);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:-webkit-fill-available;width:-moz-available}.form-control{appearance:none;background-clip:padding-box;background:none;border:none;color:var(--sgds-form-color-default);display:block;flex-grow:1;font-size:var(--sgds-font-size-2);line-height:var(--sgds-line-height-24);outline:none;padding:0}.form-clearable{color:var(--sgds-color-subtle);cursor:pointer}@media (prefers-reduced-motion:reduce){.form-control-group{transition:none}}.form-control-group:not(.disabled):not(.is-invalid):not(.readonly):not(:focus-within):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-group:not(.disabled):not(.is-invalid):focus-within{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-container.disabled{opacity:var(--sgds-opacity-50)}.form-control-group.disabled{background-color:var(--sgds-form-surface-muted);cursor:not-allowed}.form-control-group.readonly{background-color:var(--sgds-form-surface-raised)}.form-control-group.is-invalid:not(.disabled){border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-control-group:not(.disabled).is-invalid:focus-within{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}`;const Va=(e="value")=>(t,s)=>{const i=t.constructor,a=i.prototype.attributeChangedCallback;i.prototype.attributeChangedCallback=function(t,o,n){var r;const l=i.getPropertyOptions(e);if(t===("string"==typeof l.attribute?l.attribute:e).toLowerCase()){const t=l.converter||ze,i=("function"==typeof t?t:null!==(r=null==t?void 0:t.fromAttribute)&&void 0!==r?r:ze.fromAttribute)(n,l.type);this[e]!==i&&(this[s]=i)}a.call(this,t,o,n)}};class Ea{constructor(e,t){(this.host=e).addController(this),this._internals=this.host.attachInternals(),this.options=Object.assign({setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input},t)}hostConnected(){this.host.addEventListener("invalid",(e=>this.handleInvalid(e)))}hostDisconnected(){this.host.removeEventListener("invalid",(e=>this.handleInvalid(e)))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){const t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){const t=e.target;this.validateInput(t),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(e,t,s){return this._internals.setValidity(e,t,s)}setFormValue(){const e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const t=e.validity;if(t.valid)this._internals.setValidity({});else for(const s in t)t[s]&&(this.validationError=s.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const Ia=t=>{class s extends t{constructor(){super(...arguments),this._isTouched=!1}connectedCallback(){var e;super.connectedCallback(),this._mixinShouldSkipSgdsValidation()||null!==(e=this.inputValidationController)&&void 0!==e||(this.inputValidationController=new Ea(this))}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinShouldSkipSgdsValidation()||this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this.inputValidationController.validateInput(e),this._isTouched&&(this._isTouched=!1)}_mixinValidate(e){this.inputValidationController.validateInput(e)}_mixinSetFormValue(){this.inputValidationController.setFormValue()}_mixinCheckValidity(){return this.inputValidationController.checkValidity()}_mixinReportValidity(){return this.inputValidationController.reportValidity()}_mixinGetValidity(){return this.inputValidationController.validity}_mixinGetValidationMessage(){return this.inputValidationController.validationMessage}_mixinSetValidity(e,t,s){return this.inputValidationController.setValidity(e,t,s)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return s.formAssociated=!0,e([it("sgds-input")],s.prototype,"sgdsInput",void 0),e([it("sgds-datepicker-input")],s.prototype,"sgdsDatepickerInput",void 0),s};class Ba extends(Ia(Ji)){constructor(){super(),this.label="",this.hintText="",this.autofocus=!1,this.disabled=!1,this.required=!1,this.value="",this.displayValue="",this.defaultValue="",this.hasFeedback=!1,this.invalidFeedback="",this.invalid=!1,this.menuList=[],this.selectedItems=[],this.filteredList=[],this._isTouched=!1,this._controlId=Xi("input"),this._labelId=Xi("label"),this.floatingOpts={middleware:[Ni({apply({rects:e,elements:t}){t.floating.style.width=`${e.reference.width}px`}})]}}connectedCallback(){super.connectedCallback(),this.addEventListener("blur",(async()=>{this.invalid=!this.menuIsOpen&&!this._mixinReportValidity()}))}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_renderFeedback(){return this.invalid&&this.hasFeedback?J` <div class="invalid-feedback-container">
|
|
2177
2177
|
<slot name="invalidIcon">
|
|
2178
2178
|
<sgds-icon name="exclamation-circle-fill" size="md"></sgds-icon>
|
|
2179
2179
|
</slot>
|
|
@@ -2191,7 +2191,7 @@ class extends mt{constructor(e){if(super(e),e.type!==pt&&e.type!==ht&&e.type!==g
|
|
|
2191
2191
|
<div class="dropdown-item ${ft(e)}" tabindex=${this.disabled?"-1":"0"}>
|
|
2192
2192
|
${this._renderItemContent()}
|
|
2193
2193
|
</div>
|
|
2194
|
-
`}}Ta.styles=[La],e([Qe({type:Boolean,reflect:!0})],Ta.prototype,"active",void 0),e([Qe({type:Boolean,reflect:!0})],Ta.prototype,"disabled",void 0),e([Qe({type:String,reflect:!0})],Ta.prototype,"value",void 0);var Fa=Se`.form-label{color:var(--sgds-form-color-default);margin-bottom:0}.form-label.disabled{opacity:var(--sgds-opacity-50)}.form-check-label{color:var(--sgds-form-color-default)}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{cursor:not-allowed}`,Za=Se`.form-control::placeholder{color:var(--sgds-form-color-subtle);font-family:var(--sgds-font-family-brand);font-weight:var(--sgds-font-weight-light);line-height:var(--sgds-line-height-24)}`;class Ha extends rt{constructor(){super(...arguments),this.label="",this.hintText="",this.disabled=!1,this.invalid=!1,this._controlId=Xi("input"),this._labelId=Xi("label")}setInvalid(e){this.invalid=e,e?this.emit("sgds-invalid"):this.emit("sgds-valid")}}Ha.styles=[...rt.styles,$a,Aa,Fa,Za],e([Qe({reflect:!0})],Ha.prototype,"label",void 0),e([Qe({reflect:!0})],Ha.prototype,"hintText",void 0),e([Qe({reflect:!0})],Ha.prototype,"name",void 0),e([Qe({type:Boolean,reflect:!0})],Ha.prototype,"disabled",void 0),e([Qe({type:Boolean,reflect:!0})],Ha.prototype,"invalid",void 0);var za=Se`.form-check-input[type=checkbox]{border-radius:var(--sgds-form-border-radius-md)}.form-check-input
|
|
2194
|
+
`}}Ta.styles=[La],e([Qe({type:Boolean,reflect:!0})],Ta.prototype,"active",void 0),e([Qe({type:Boolean,reflect:!0})],Ta.prototype,"disabled",void 0),e([Qe({type:String,reflect:!0})],Ta.prototype,"value",void 0);var Fa=Se`.form-label{color:var(--sgds-form-color-default);margin-bottom:0}.form-label.disabled{opacity:var(--sgds-opacity-50)}.form-check-label{color:var(--sgds-form-color-default)}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{cursor:not-allowed}`,Za=Se`.form-control::placeholder{color:var(--sgds-form-color-subtle);font-family:var(--sgds-font-family-brand);font-weight:var(--sgds-font-weight-light);line-height:var(--sgds-line-height-24)}`;class Ha extends rt{constructor(){super(...arguments),this.label="",this.hintText="",this.disabled=!1,this.invalid=!1,this._controlId=Xi("input"),this._labelId=Xi("label")}setInvalid(e){this.invalid=e,e?this.emit("sgds-invalid"):this.emit("sgds-valid")}}Ha.styles=[...rt.styles,$a,Aa,Fa,Za],e([Qe({reflect:!0})],Ha.prototype,"label",void 0),e([Qe({reflect:!0})],Ha.prototype,"hintText",void 0),e([Qe({reflect:!0})],Ha.prototype,"name",void 0),e([Qe({type:Boolean,reflect:!0})],Ha.prototype,"disabled",void 0),e([Qe({type:Boolean,reflect:!0})],Ha.prototype,"invalid",void 0);var za=Se`.form-check-input[type=checkbox]{border-radius:var(--sgds-form-border-radius-md)}.form-check-input[checked]{--sgds-radio-bg-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" fill="none"><path d="M14.347 3.979a.522.522 0 0 1 0 .739L7.043 12.02a.521.521 0 0 1-.738 0L2.653 8.369a.522.522 0 1 1 .739-.738l3.282 3.283 6.934-6.935a.52.52 0 0 1 .739 0Z" fill="%23fff"/></svg>')}.form-check-input:indeterminate,.form-check-input[indeterminate]{--sgds-radio-bg-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.5 8a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5Z" fill="%23fff"/></svg>');background-color:var(--sgds-form-primary-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-transparent)}.form-check-input:indeterminate:focus,.form-check-input:indeterminate:hover,.form-check-input[indeterminate]:focus-visible,.form-check-input[indeterminate]:hover{background-color:var(--sgds-form-primary-surface-emphasis)}.form-check-input:indeterminate.is-invalid,.form-check-input[checked].is-invalid,.form-check-input[indeterminate].is-invalid{background-color:var(--sgds-form-danger-surface-default)}.form-check-label{flex:1}.form-check{margin:var(--sgds-form-padding-inline-sm) 0;padding:0}`,Ra=Se`input{margin:0}.form-check{display:flex;gap:var(--sgds-form-gap-md);padding:var(--sgds-form-padding-inline-sm) 0}.form-check-input{appearance:none;background-color:var(--sgds-form-surface-default);background-image:var(--sgds-radio-bg-image);background-position:50%;background-repeat:no-repeat;background-size:auto;border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);height:var(--sgds-form-height-sm);width:var(--sgds-form-width-xs)}.form-check-input[checked]{background-color:var(--sgds-form-primary-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-transparent)}.form-check-input:focus-visible{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}.form-check-input:not([disabled]):not(.is-invalid):not([aria-checked=true]):not(:focus-visible):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}.form-check-input:not([disabled]):not(.is-invalid)[checked]:focus-visible,.form-check-input:not([disabled]):not(.is-invalid)[checked]:hover{background-color:var(--sgds-form-primary-surface-emphasis)}:host([disabled]) .form-check{cursor:not-allowed;opacity:var(--sgds-opacity-50)}.form-check-input:not([disabled]).is-invalid{border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-check-input:not([disabled]).is-invalid:focus-visible{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}`;class Oa extends(Ia(Ha)){constructor(){super(...arguments),this.checked=!1,this.defaultChecked=!1,this.indeterminate=!1,this.required=!1,this.invalidFeedback="",this._isTouched=!1}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}_handleChange(e){this.indeterminate&&(this.indeterminate=!this.indeterminate),this.checked=!this.checked,super._mixinHandleChange(e),this.emit("sgds-change",{detail:{checked:this.checked,value:this.value}}),this.checked?this.emit("sgds-check",{detail:{value:this.value}}):this.emit("sgds-uncheck",{detail:{value:this.value}})}_handleKeyDown(e){const t=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;"Enter"!==e.key||t||this.click()}_handleBlur(){this._isTouched=!0,this.emit("sgds-blur")}_handleFocus(){this.emit("sgds-focus")}_handleInvalid(e){e.preventDefault(),this.invalid=!0}_handleDisabledChange(){this.setInvalid(!1)}_handleIsTouched(){this._isTouched&&(this.invalid=!this.input.checkValidity())}_mixinResetFormControl(){this._isTouched=!1,this.checked=this.input.checked=this.defaultChecked,this.input.dispatchEvent(new InputEvent("reset")),this._mixinResetValidity(this.input)}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}firstUpdated(e){super.firstUpdated(e),this.checked&&this.emit("sgds-check",{detail:{value:this.value}})}render(){const e="both"===this.hasFeedback||"style"===this.hasFeedback,t="both"===this.hasFeedback||"text"===this.hasFeedback;return J`
|
|
2195
2195
|
<div class="form-check">
|
|
2196
2196
|
<input
|
|
2197
2197
|
class=${ft({"form-check-input":!0,"is-invalid":e&&this.invalid})}
|
|
@@ -2206,7 +2206,7 @@ class extends mt{constructor(e){if(super(e),e.type!==pt&&e.type!==ht&&e.type!==g
|
|
|
2206
2206
|
@change=${e=>this._handleChange(e)}
|
|
2207
2207
|
@keydown=${this._handleKeyDown}
|
|
2208
2208
|
@invalid=${e=>this._handleInvalid(e)}
|
|
2209
|
-
|
|
2209
|
+
?checked=${Ma(this.checked)}
|
|
2210
2210
|
.disabled=${this.disabled}
|
|
2211
2211
|
.required=${this.required}
|
|
2212
2212
|
@blur=${this._handleBlur}
|
|
@@ -2230,21 +2230,21 @@ class extends mt{constructor(e){if(super(e),e.type!==pt&&e.type!==ht&&e.type!==g
|
|
|
2230
2230
|
</div>
|
|
2231
2231
|
`:se}
|
|
2232
2232
|
`}}Oa.styles=[...Ha.styles,Ra,za],e([Qe({type:String,reflect:!0})],Oa.prototype,"value",void 0),e([Qe({type:Boolean,reflect:!0})],Oa.prototype,"checked",void 0),e([Qe({type:String,reflect:!0})],Oa.prototype,"hasFeedback",void 0),e([Va("checked")],Oa.prototype,"defaultChecked",void 0),e([Qe({type:Boolean,reflect:!0})],Oa.prototype,"indeterminate",void 0),e([Qe({type:Boolean,reflect:!0})],Oa.prototype,"required",void 0),e([Qe({type:String,reflect:!0})],Oa.prototype,"invalidFeedback",void 0),e([Je()],Oa.prototype,"_isTouched",void 0),e([$t("disabled",{waitUntilFirstUpdate:!0})],Oa.prototype,"_handleDisabledChange",null),e([$t("_isTouched",{waitUntilFirstUpdate:!0})],Oa.prototype,"_handleIsTouched",null);class Na extends Ta{constructor(){super(...arguments),this.checkbox=!1,this._renderItemContent=()=>this.checkbox?J`
|
|
2233
|
-
<sgds-checkbox
|
|
2233
|
+
<sgds-checkbox .checked=${this.active} .disabled=${this.disabled}>
|
|
2234
2234
|
<slot></slot>
|
|
2235
2235
|
</sgds-checkbox>
|
|
2236
2236
|
`:J`
|
|
2237
|
-
<div class="normal-item-content"
|
|
2237
|
+
<div class="normal-item-content">
|
|
2238
2238
|
<slot></slot>
|
|
2239
2239
|
${this.active?J` <sgds-icon name="check"></sgds-icon> `:se}
|
|
2240
2240
|
</div>
|
|
2241
|
-
`}connectedCallback(){super.connectedCallback()
|
|
2241
|
+
`}connectedCallback(){super.connectedCallback()}firstUpdated(e){super.firstUpdated(e);const t=this.closest("sgds-combo-box");(null==t?void 0:t.multiSelect)&&(this.checkbox=!0)}}Na.dependencies={"sgds-icon":Ot,"sgds-checkbox":Oa},e([Qe({type:Boolean,reflect:!0})],Na.prototype,"checkbox",void 0);
|
|
2242
2242
|
/**
|
|
2243
2243
|
* @license
|
|
2244
2244
|
* Copyright 2017 Google LLC
|
|
2245
2245
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2246
2246
|
*/
|
|
2247
|
-
const Ua=(e,t,s)=>{const i=new Map;for(let a=t;a<=s;a++)i.set(e[a],a);return i};const qa=vt(class extends mt{constructor(e){if(super(e),e.type!==ut)throw new Error("repeat() can only be used in text expressions")}_getValuesAndKeys(e,t,s){let i;void 0===s?s=t:void 0!==t&&(i=t);const a=[],o=[];let n=0;for(const t of e)a[n]=i?i(t,n):n,o[n]=s(t,n),n++;return{values:o,keys:a}}render(e,t,s){return this._getValuesAndKeys(e,t,s).values}update(e,[t,s,i]){const a=e._$committedValue;const{values:o,keys:n}=this._getValuesAndKeys(t,s,i);if(!Array.isArray(a))return this._itemKeys=n,o;const r=this._itemKeys??=[],l=[];let d,c,h=0,u=a.length-1,p=0,g=o.length-1;for(;h<=u&&p<=g;)if(null===a[h])h++;else if(null===a[u])u--;else if(r[h]===n[p])l[p]=ts(a[h],o[p]),h++,p++;else if(r[u]===n[g])l[g]=ts(a[u],o[g]),u--,g--;else if(r[h]===n[g])l[g]=ts(a[h],o[g]),es(e,l[g+1],a[h]),h++,g--;else if(r[u]===n[p])l[p]=ts(a[u],o[p]),es(e,a[h],a[u]),u--,p++;else if(void 0===d&&(d=Ua(n,p,g),c=Ua(r,h,u)),d.has(r[h]))if(d.has(r[u])){const t=c.get(n[p]),s=void 0!==t?a[t]:null;if(null===s){const t=es(e,a[h]);ts(t,o[p]),l[p]=t}else l[p]=ts(s,o[p]),es(e,a[h],s),a[t]=null;p++}else as(a[u]),u--;else as(a[h]),h++;for(;p<=g;){const t=es(e,l[g+1]);ts(t,o[p]),l[p++]=t}for(;h<=u;){const e=a[h++];null!==e&&as(e)}return this._itemKeys=n,is(e,l),te}});class Ya extends Ba{constructor(){super(...arguments),this.multiSelect=!1,this.badgeFullWidth=!1,this.filterFunction=(e,t)=>t.label.toLowerCase().startsWith(e.toLowerCase()),this.optionList=[],this.emptyMenu=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-hide",(async()
|
|
2247
|
+
const Ua=(e,t,s)=>{const i=new Map;for(let a=t;a<=s;a++)i.set(e[a],a);return i};const qa=vt(class extends mt{constructor(e){if(super(e),e.type!==ut)throw new Error("repeat() can only be used in text expressions")}_getValuesAndKeys(e,t,s){let i;void 0===s?s=t:void 0!==t&&(i=t);const a=[],o=[];let n=0;for(const t of e)a[n]=i?i(t,n):n,o[n]=s(t,n),n++;return{values:o,keys:a}}render(e,t,s){return this._getValuesAndKeys(e,t,s).values}update(e,[t,s,i]){const a=e._$committedValue;const{values:o,keys:n}=this._getValuesAndKeys(t,s,i);if(!Array.isArray(a))return this._itemKeys=n,o;const r=this._itemKeys??=[],l=[];let d,c,h=0,u=a.length-1,p=0,g=o.length-1;for(;h<=u&&p<=g;)if(null===a[h])h++;else if(null===a[u])u--;else if(r[h]===n[p])l[p]=ts(a[h],o[p]),h++,p++;else if(r[u]===n[g])l[g]=ts(a[u],o[g]),u--,g--;else if(r[h]===n[g])l[g]=ts(a[h],o[g]),es(e,l[g+1],a[h]),h++,g--;else if(r[u]===n[p])l[p]=ts(a[u],o[p]),es(e,a[h],a[u]),u--,p++;else if(void 0===d&&(d=Ua(n,p,g),c=Ua(r,h,u)),d.has(r[h]))if(d.has(r[u])){const t=c.get(n[p]),s=void 0!==t?a[t]:null;if(null===s){const t=es(e,a[h]);ts(t,o[p]),l[p]=t}else l[p]=ts(s,o[p]),es(e,a[h],s),a[t]=null;p++}else as(a[u]),u--;else as(a[h]),h++;for(;p<=g;){const t=es(e,l[g+1]);ts(t,o[p]),l[p++]=t}for(;h<=u;){const e=a[h++];null!==e&&as(e)}return this._itemKeys=n,is(e,l),te}});class Ya extends Ba{constructor(){super(...arguments),this.multiSelect=!1,this.badgeFullWidth=!1,this.clearable=!1,this.filterFunction=(e,t)=>t.label.toLowerCase().startsWith(e.toLowerCase()),this.optionList=[],this.emptyMenu=!1,this.isFocused=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("focus",(async()=>{this.isFocused=!0})),this.addEventListener("blur",(async()=>{this.isFocused=!1})),this.addEventListener("keydown",(e=>{var t,s;"Enter"===e.key&&(null===(s=null===(t=e.target.shadowRoot)||void 0===t?void 0:t.querySelector(".form-clearable"))||void 0===s?void 0:s.matches(":focus"))&&this._handleClear()})),this.addEventListener("sgds-hide",(async e=>{if(!e.detail.isOutside){(await this._input).focus()}this.options.forEach((e=>e.removeAttribute("hidden"))),this.emptyMenu=!1}))}async firstUpdated(e){super.firstUpdated(e),this.menuList.forEach((e=>{const t=document.createElement("sgds-combo-box-option");t.innerText=e.label,t.value=e.value,t.checkbox=this.multiSelect,t.active=this.value.includes(e.value),this.appendChild(t)})),this._setupValidation(this.menuList),this.menuIsOpen&&!this.readonly&&this.showMenu()}async _handleDefaultSlotChange(e){const t=e.target.assignedElements({flatten:!0});t.forEach((e=>{if(e.hasAttribute("disabled"))return!1;e.addEventListener("click",(e=>{e.preventDefault();const t=e.target;return this.multiSelect&&t.active?this._handleItemUnselect(e):this._handleItemSelected(e),!1})),e.addEventListener("keydown",(e=>{if("Enter"===e.key){this.close="outside";e.target.click()}}))})),await this.updateComplete,this.optionList=await this._getMenuListFromOptions(t),this._setupValidation(this.optionList)}async _setupValidation(e){var t;if(this.value&&e.length>0){const s=this.value.split(";"),i=e.filter((({value:e})=>s.includes(e)));this.selectedItems=[...i,...this.selectedItems],this.multiSelect||(this.displayValue=null===(t=i[0])||void 0===t?void 0:t.label),this.multiSelect?this.input=await this._multiSelectInput:this.input=await this._input,this._mixinValidate(this.input)}}async _handleValueChange(){this.emit("sgds-change"),this.options.forEach((e=>e.removeAttribute("hidden"))),this.value&&this.emit("sgds-select");const e=await this._input;this._mixinSetFormValue(),this.multiSelect?this._mixinValidate(this.input):this._mixinValidate(e);this.selectedItems.map((e=>e.value)).join(";")!==this.value&&this._updateValueAndDisplayValue(this.optionList),(this._isTouched||""!==this.value)&&(this.invalid=!this._mixinReportValidity())}_handleOptionListChange(){this._updateValueAndDisplayValue(this.optionList)}_handleMenuListChange(){const e=this.menuList.map((e=>{const t=document.createElement("sgds-combo-box-option");return t.innerText=e.label,t.value=e.value,t.checkbox=this.multiSelect,t.active=this.value.includes(e.value),t}));this.replaceChildren(...e)}_updateValueAndDisplayValue(e){var t,s;const i=this.value.split(";"),a=e.filter((({value:e})=>i.includes(e)));this.selectedItems=[...a];const o=a.map((e=>e.value)).join(";");o!==this.value&&(this.value=o),this.multiSelect||(this.displayValue=null!==(s=null===(t=a[0])||void 0===t?void 0:t.label)&&void 0!==s?s:""),this.options.forEach((e=>e.active=i.includes(e.value)))}async _handleInputChange(e){const t=e.target;this.displayValue=t.value,this.emit("sgds-input",{detail:{displayValue:this.displayValue}});const s=this.options.map((e=>({value:e.value,label:e.textContent.trim()})));this.filteredList=s.filter((e=>this.filterFunction(this.displayValue,e))),""!==this.displayValue||this.multiSelect||(this.selectedItems=[],this.value=this.selectedItems.join(";"),this.options.forEach((e=>e.active=!1))),this.invalid=!1,this.showMenu(),this.emptyMenu=0===this.filteredList.length;const i=this.filteredList.map((e=>e.value));this.options.forEach((e=>{i.includes(e.value)?e.hidden=!1:e.hidden=!0})),""===this.displayValue&&(this.options.forEach((e=>e.hidden=!1)),await this.updateComplete)}async _handleItemSelected(e){var t,s,i;const a=e.target,o=null!==(s=null===(t=a.textContent)||void 0===t?void 0:t.trim())&&void 0!==s?s:"",n=null!==(i=a.getAttribute("value"))&&void 0!==i?i:o,r=this.filteredList.find((e=>e.value.toString()===n))||{label:o,value:n};this.multiSelect?(this.selectedItems.some((e=>e.value===r.value))||(this.selectedItems=[...this.selectedItems,r]),this.value=this.selectedItems.map((e=>e.value)).join(";"),a.active=!0):0!==this.selectedItems.length&&this.selectedItems[0].value===r.value||(this.options.forEach((e=>e.active=!1)),a.active=!0,this.selectedItems=[r],this.value=r.value.toString(),this.displayValue=r.label,this.hideMenu())}_handleItemUnselect(e){var t,s,i;const a=e.target;a.removeAttribute("active");const o=null!==(s=null===(t=a.textContent)||void 0===t?void 0:t.trim())&&void 0!==s?s:"",n=null!==(i=a.getAttribute("value"))&&void 0!==i?i:o,r=this.filteredList.find((e=>e.value.toString()===n))||{label:o,value:n};this.selectedItems=this.selectedItems.filter((e=>e.value!==r.value)),this.value=this.selectedItems.map((e=>e.value)).join(";")}async _handleBadgeDismissed(e,t){var s;e.preventDefault();const i=t.value;null===(s=this.options)||void 0===s||s.forEach((e=>e.value===i?e.active=!1:null)),this.selectedItems=this.selectedItems.filter((e=>e.value!==t.value)),this.value=this.selectedItems.map((e=>e.value)).join(";")}async _handleMultiSelectKeyDown(e){var t;if(this.multiSelect&&"Backspace"===e.key&&this.multiSelect&&""===this.displayValue.trim()&&this.selectedItems.length>0){const e=this.selectedItems[this.selectedItems.length-1].value;null===(t=this.options)||void 0===t||t.forEach((t=>t.value===e?t.active=!1:null)),this.selectedItems=this.selectedItems.slice(0,-1),this.value=this.selectedItems.map((e=>e.value)).join(";")}}_handleFocus(){this.emit("sgds-focus")}async _handleInputBlur(e){if(e.preventDefault(),this.emit("sgds-blur"),this.multiSelect){this.selectedItems.filter((({label:e})=>this.displayValue===e)).length<=0&&(this.displayValue="")}else this.selectedItems.length>0?this.displayValue=this.selectedItems[0].label:this.displayValue=""}async _handleClear(){var e;this.value="",null===(e=this.options)||void 0===e||e.forEach((e=>e.active=!1));(await this._input).focus(),this.showMenu()}async _mixinResetFormControl(){if(this.value=this.defaultValue,this.multiSelect){const e=this.value.split(";");this.options.forEach((t=>{t.active=e.includes(t.value)}));const t=this.options.filter((t=>e.includes(t.value)));this.selectedItems=t.map((e=>({value:e.value,label:e.textContent.trim()}))),this._mixinResetValidity(await this._multiSelectInput)}else{this.options.forEach((e=>{e.active=e.value===this.value}));const e=this.options.filter((e=>e.value===this.value));e.length<=0?this.displayValue="":this.displayValue=e[0].textContent.trim(),this._mixinResetValidity(await this._input)}}_renderInput(){const e=this.hasFeedback,t=(this.isFocused||this.menuIsOpen)&&""!==this.value&&this.clearable;return J`
|
|
2248
2248
|
<div
|
|
2249
2249
|
${vs(this.myDropdown)}
|
|
2250
2250
|
class="form-control-group ${ft({disabled:this.disabled,readonly:this.readonly,"is-invalid":this.invalid&&e})}"
|
|
@@ -2281,7 +2281,21 @@ const Ua=(e,t,s)=>{const i=new Map;for(let a=t;a<=s;a++)i.set(e[a],a);return i};
|
|
|
2281
2281
|
aria-labelledby="${this._labelId} ${this._controlId}Help ${this.invalid&&this.hasFeedback?`${this._controlId}-invalid`:""}"
|
|
2282
2282
|
/>
|
|
2283
2283
|
</div>
|
|
2284
|
-
|
|
2284
|
+
|
|
2285
|
+
${t?J`
|
|
2286
|
+
<sgds-icon
|
|
2287
|
+
id=${`${this._controlId}-combobox-clear-button`}
|
|
2288
|
+
tabindex="0"
|
|
2289
|
+
class="form-clearable"
|
|
2290
|
+
name="xcircle-fill"
|
|
2291
|
+
size="md"
|
|
2292
|
+
@click=${this._handleClear}
|
|
2293
|
+
aria-label="Clear selections"
|
|
2294
|
+
role="button"
|
|
2295
|
+
></sgds-icon>
|
|
2296
|
+
`:se}
|
|
2297
|
+
|
|
2298
|
+
<sgds-icon name=${this.menuIsOpen?"chevron-up":"chevron-down"} size="md"></sgds-icon>
|
|
2285
2299
|
</div>
|
|
2286
2300
|
`}render(){return J`
|
|
2287
2301
|
<div
|
|
@@ -2291,6 +2305,7 @@ const Ua=(e,t,s)=>{const i=new Map;for(let a=t;a<=s;a++)i.set(e[a],a);return i};
|
|
|
2291
2305
|
${this._renderLabel()}
|
|
2292
2306
|
<!-- The input -->
|
|
2293
2307
|
${this._renderInput()} ${this._renderFeedback()}
|
|
2308
|
+
|
|
2294
2309
|
<ul id=${this.dropdownMenuId} class="dropdown-menu" part="menu" tabindex="-1" ${vs(this.menuRef)}>
|
|
2295
2310
|
<slot id="default" @slotchange=${this._handleDefaultSlotChange}
|
|
2296
2311
|
><div class="empty-menu">No options</div></slot
|
|
@@ -2306,7 +2321,7 @@ const Ua=(e,t,s)=>{const i=new Map;for(let a=t;a<=s;a++)i.set(e[a],a);return i};
|
|
|
2306
2321
|
class="visually-hidden"
|
|
2307
2322
|
?required=${this.required}
|
|
2308
2323
|
/>`:se}
|
|
2309
|
-
`}}Ya.styles=[...Ba.styles,Da,Pa],Ya.dependencies={"sgds-combo-box-option":Na,"sgds-icon":Ot,"sgds-badge":Ki},e([Qe({type:Boolean,reflect:!0})],Ya.prototype,"multiSelect",void 0),e([Qe({type:Boolean,reflect:!0})],Ya.prototype,"badgeFullWidth",void 0),e([Qe()],Ya.prototype,"filterFunction",void 0),e([it("input#multi-select-input-tracker")],Ya.prototype,"_multiSelectInput",void 0),e([at({flatten:!0,selector:"sgds-combo-box-option"})],Ya.prototype,"options",void 0),e([Je()],Ya.prototype,"optionList",void 0),e([Je()],Ya.prototype,"emptyMenu",void 0),e([$t("value",{waitUntilFirstUpdate:!0})],Ya.prototype,"_handleValueChange",null),e([$t("optionList",{waitUntilFirstUpdate:!0})],Ya.prototype,"_handleOptionListChange",null),e([$t("menuList",{waitUntilFirstUpdate:!0})],Ya.prototype,"_handleMenuListChange",null),Vt("sgds-combo-box",Ya),Vt("sgds-combo-box-option",Na);var ja=Se`:host{--sgds-checkbox-group-gap:var(--sgds-spacer-2)}fieldset{border:0;gap:var(--sgds-form-gap-md);margin:0;min-width:0;padding:0}.label-hint-container,fieldset{display:flex;flex-direction:column}.label-hint-container{gap:var(--sgds-form-gap-sm)}.label-hint-container .form-label{color:var(--sgds-form-color-default);font-size:var(--sgds-font-size-2);font-weight:var(--sgds-font-weight-regular)}.checkbox-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.checkbox-group-validation-input{display:none}:host([disabled]) .label-hint-container{cursor:not-allowed;opacity:var(--sgds-opacity-50)}`;class Wa extends(Ia(Ha)){constructor(){super(...arguments),this.label="",this.invalidFeedback="Please tick at least one box if you want to proceed",this.hasFeedback=!1,this.hintText="",this.required=!1,this.value="",this._isTouched=!1,this.defaultValue="",this._blurredCheckboxes=new Set}connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-check",(e=>{const{value:t}=e.detail;!this.value.includes(t)&&this._addValue(t)})),this.addEventListener("sgds-uncheck",(e=>{const{value:t}=e.detail;this._removeValue(t)})),this.addEventListener("sgds-blur",(e=>{const t=e.target;this._blurredCheckboxes.add(t),Array.from(this._blurredCheckboxes).length===this._checkboxes.length&&(this._isTouched=!0,this._blurredCheckboxes.clear())}))}firstUpdated(e){super.firstUpdated(e),this.value&&this._updateInputValue(),this.invalid&&this._updateInvalid()}_renderHintText(){const e=J` <div class="form-text" id="${this._controlId}Help">${this.hintText}</div> `;return this.hintText&&e}_addValue(e){const t=this.value?this.value.split(";"):[];t.push(e),this.value=t.join(";")}_removeValue(e){const t=(this.value?this.value.split(";"):[]).filter((t=>t!==e));this.value=t.join(";")}_sanitizeSlot(){this._checkboxes.forEach((e=>{e.checked=e.defaultChecked=this.value.includes(e.value),e.hasFeedback=this.hasFeedback?"style":null,e.required&&(console.error("Checkboxes in a group cannot have required or hasFeedback prop set to true"),e.remove())})),this._disabledChildCheckboxes()}_disabledChildCheckboxes(){if(this.disabled){this._checkboxes.forEach((e=>e.disabled=this.disabled))}}_handleValueChange(){if("reset"===this.formEvent&&this.value===this.defaultValue)return void(this.formEvent=null);this.emit("sgds-change");this._checkboxes.forEach((e=>{e.checked=this.value.includes(e.value)})),this._updateInputValue(),this._updateInvalid()}_handleIsTouched(){this._isTouched&&(this.invalid=!this.input.checkValidity(),this._updateInvalid())}_updateInvalid(){this._checkboxes.forEach((e=>e.invalid=this.invalid))}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_mixinResetFormControl(){this.value=this.input.value=this.defaultValue,this._updateInputValue("reset"),this._mixinResetValidity(this.input)}async _updateInputValue(e="change"){this.input.value=this.value,this.input.dispatchEvent(new InputEvent(e)),this.formEvent=e}render(){return J`
|
|
2324
|
+
`}}Ya.styles=[...Ba.styles,Da,Pa],Ya.dependencies={"sgds-combo-box-option":Na,"sgds-icon":Ot,"sgds-badge":Ki},e([Qe({type:Boolean,reflect:!0})],Ya.prototype,"multiSelect",void 0),e([Qe({type:Boolean,reflect:!0})],Ya.prototype,"badgeFullWidth",void 0),e([Qe({type:Boolean,reflect:!0})],Ya.prototype,"clearable",void 0),e([Qe()],Ya.prototype,"filterFunction",void 0),e([it("input#multi-select-input-tracker")],Ya.prototype,"_multiSelectInput",void 0),e([at({flatten:!0,selector:"sgds-combo-box-option"})],Ya.prototype,"options",void 0),e([Je()],Ya.prototype,"optionList",void 0),e([Je()],Ya.prototype,"emptyMenu",void 0),e([Je()],Ya.prototype,"isFocused",void 0),e([$t("value",{waitUntilFirstUpdate:!0})],Ya.prototype,"_handleValueChange",null),e([$t("optionList",{waitUntilFirstUpdate:!0})],Ya.prototype,"_handleOptionListChange",null),e([$t("menuList",{waitUntilFirstUpdate:!0})],Ya.prototype,"_handleMenuListChange",null),Vt("sgds-combo-box",Ya),Vt("sgds-combo-box-option",Na);var ja=Se`:host{--sgds-checkbox-group-gap:var(--sgds-spacer-2)}fieldset{border:0;gap:var(--sgds-form-gap-md);margin:0;min-width:0;padding:0}.label-hint-container,fieldset{display:flex;flex-direction:column}.label-hint-container{gap:var(--sgds-form-gap-sm)}.label-hint-container .form-label{color:var(--sgds-form-color-default);font-size:var(--sgds-font-size-2);font-weight:var(--sgds-font-weight-regular)}.checkbox-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.checkbox-group-validation-input{display:none}:host([disabled]) .label-hint-container{cursor:not-allowed;opacity:var(--sgds-opacity-50)}`;class Wa extends(Ia(Ha)){constructor(){super(...arguments),this.label="",this.invalidFeedback="Please tick at least one box if you want to proceed",this.hasFeedback=!1,this.hintText="",this.required=!1,this.value="",this._isTouched=!1,this.defaultValue="",this._blurredCheckboxes=new Set}connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-check",(e=>{const{value:t}=e.detail;!this.value.includes(t)&&this._addValue(t)})),this.addEventListener("sgds-uncheck",(e=>{const{value:t}=e.detail;this._removeValue(t)})),this.addEventListener("sgds-blur",(e=>{const t=e.target;this._blurredCheckboxes.add(t),Array.from(this._blurredCheckboxes).length===this._checkboxes.length&&(this._isTouched=!0,this._blurredCheckboxes.clear())}))}firstUpdated(e){super.firstUpdated(e),this.value&&this._updateInputValue(),this.invalid&&this._updateInvalid()}_renderHintText(){const e=J` <div class="form-text" id="${this._controlId}Help">${this.hintText}</div> `;return this.hintText&&e}_addValue(e){const t=this.value?this.value.split(";"):[];t.push(e),this.value=t.join(";")}_removeValue(e){const t=(this.value?this.value.split(";"):[]).filter((t=>t!==e));this.value=t.join(";")}_sanitizeSlot(){this._checkboxes.forEach((e=>{e.checked=e.defaultChecked=this.value.includes(e.value),e.hasFeedback=this.hasFeedback?"style":null,e.required&&(console.error("Checkboxes in a group cannot have required or hasFeedback prop set to true"),e.remove())})),this._disabledChildCheckboxes()}_disabledChildCheckboxes(){if(this.disabled){this._checkboxes.forEach((e=>e.disabled=this.disabled))}}_handleValueChange(){if("reset"===this.formEvent&&this.value===this.defaultValue)return void(this.formEvent=null);this.emit("sgds-change");this._checkboxes.forEach((e=>{e.checked=this.value.includes(e.value)})),this._updateInputValue(),this._updateInvalid()}_handleIsTouched(){this._isTouched&&(this.invalid=!this.input.checkValidity(),this._updateInvalid())}_updateInvalid(){this._checkboxes.forEach((e=>e.invalid=this.invalid))}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_mixinResetFormControl(){this.value=this.input.value=this.defaultValue,this._updateInputValue("reset"),this._mixinResetValidity(this.input)}async _updateInputValue(e="change"){this.input.value=this.value,this.input.dispatchEvent(new InputEvent(e)),this.formEvent=e}render(){return J`
|
|
2310
2325
|
<fieldset>
|
|
2311
2326
|
<div class="label-hint-container">
|
|
2312
2327
|
<label class="form-label">${this.label}</label>
|
|
@@ -3259,7 +3274,7 @@ const Wl="important",Kl=" !"+Wl;const Gl=vt(class extends mt{constructor(e){if(s
|
|
|
3259
3274
|
<div id="announcer" role="region" aria-live="assertive" class="visually-hidden">${this.value}</div>
|
|
3260
3275
|
${this._renderFeedback()}
|
|
3261
3276
|
</div>
|
|
3262
|
-
`}}ed.styles=[...Ha.styles,Za,Hl,Da,Jl],ed.dependencies={"sgds-input":Kr,"sgds-icon-button":lr},e([st("sgds-icon-button[ariaLabel^='increase by']")],ed.prototype,"plusBtn",void 0),e([st("sgds-icon-button[ariaLabel^='decrease by']")],ed.prototype,"minusBtn",void 0),e([Qe({type:Number,reflect:!0})],ed.prototype,"value",void 0),e([Qe({type:Number})],ed.prototype,"step",void 0),e([Qe({type:Number})],ed.prototype,"min",void 0),e([Qe({type:Number})],ed.prototype,"max",void 0),e([Qe({type:String,reflect:!0})],ed.prototype,"hasFeedback",void 0),e([Qe({type:String,reflect:!0})],ed.prototype,"invalidFeedback",void 0),e([Qe({type:Boolean,reflect:!0})],ed.prototype,"readonly",void 0),e([Va()],ed.prototype,"defaultValue",void 0),e([it("sgds-input")],ed.prototype,"_sgdsInput",void 0),Vt("sgds-quantity-toggle",ed);var td=Se`:host{outline:0}.form-check-input[type=radio]{border-radius:50%}.form-check-input
|
|
3277
|
+
`}}ed.styles=[...Ha.styles,Za,Hl,Da,Jl],ed.dependencies={"sgds-input":Kr,"sgds-icon-button":lr},e([st("sgds-icon-button[ariaLabel^='increase by']")],ed.prototype,"plusBtn",void 0),e([st("sgds-icon-button[ariaLabel^='decrease by']")],ed.prototype,"minusBtn",void 0),e([Qe({type:Number,reflect:!0})],ed.prototype,"value",void 0),e([Qe({type:Number})],ed.prototype,"step",void 0),e([Qe({type:Number})],ed.prototype,"min",void 0),e([Qe({type:Number})],ed.prototype,"max",void 0),e([Qe({type:String,reflect:!0})],ed.prototype,"hasFeedback",void 0),e([Qe({type:String,reflect:!0})],ed.prototype,"invalidFeedback",void 0),e([Qe({type:Boolean,reflect:!0})],ed.prototype,"readonly",void 0),e([Va()],ed.prototype,"defaultValue",void 0),e([it("sgds-input")],ed.prototype,"_sgdsInput",void 0),Vt("sgds-quantity-toggle",ed);var td=Se`:host{outline:0}.form-check-input[type=radio]{border-radius:50%}.form-check-input[checked]{--sgds-radio-bg-image:url('data:image/svg+xml;charset=utf-8,<svg width="8" height="8" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 4a4 4 0 1 1 8 0 4 4 0 0 1-8 0Z" fill="%23fff"/></svg>')}.form-check-input[checked].is-invalid{background-color:var(--sgds-form-danger-surface-default)}`;class sd extends rt{constructor(){super(...arguments),this.checked=!1,this.disabled=!1,this.invalid=!1,this.radioId=Xi("radio")}connectedCallback(){super.connectedCallback(),this.setInitialAttributes(),this.addEventListeners()}handleCheckedChange(){var e;this.checked&&(null===(e=this.input)||void 0===e||e.focus()),this.setAttribute("aria-checked",this.checked?"true":"false"),this.setAttribute("tabindex",this.checked?"0":"-1")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleBlur(){this.emit("sgds-blur")}handleClick(){this.disabled||(this.checked=!0)}handleFocus(){this.emit("sgds-focus")}addEventListeners(){this.addEventListener("blur",(()=>this.handleBlur())),this.addEventListener("click",(()=>this.handleClick())),this.addEventListener("focus",(()=>this.handleFocus()))}setInitialAttributes(){this.setAttribute("role","radio"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled",this.disabled?"true":"false")}render(){return J`
|
|
3263
3278
|
<div class="form-check">
|
|
3264
3279
|
<input
|
|
3265
3280
|
class=${ft({"form-check-input":!0,"is-invalid":this.invalid})}
|
|
@@ -3383,7 +3398,7 @@ const Wl="important",Kl=" !"+Wl;const Gl=vt(class extends mt{constructor(e){if(s
|
|
|
3383
3398
|
</div>
|
|
3384
3399
|
`))}
|
|
3385
3400
|
</div>
|
|
3386
|
-
`}}gd.styles=[...rt.styles,pd],gd.dependencies={"sgds-icon":Ot},e([Qe({type:Array})],gd.prototype,"steps",void 0),e([Qe({type:Number,reflect:!0})],gd.prototype,"activeStep",void 0),e([Qe({type:String,reflect:!0})],gd.prototype,"orientation",void 0),e([Qe({type:Boolean,reflect:!0})],gd.prototype,"clickable",void 0),e([Va("activeStep")],gd.prototype,"defaultActiveStep",void 0),e([$t("activeStep",{waitUntilFirstUpdate:!0})],gd.prototype,"_handleActiveStepChange",null),Vt("sgds-stepper",gd);var vd=Se`input{margin:0}.form-check{align-items:center;display:flex;gap:var(--sgds-form-gap-lg)}.form-check-input{--sgds-switch-width:var(--sgds-form-width-xl);--sgds-switch-height:var(--sgds-form-height-md);--sgds-switch-bg-image:url('data:image/svg+xml;charset=utf-8,<svg viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M.5 12c0-6.627 5.373-12 12-12s12 5.373 12 12-5.373 12-12 12-12-5.373-12-12Z" fill="%23fff"/></svg>');appearance:none;background-color:var(--sgds-form-surface-subtle);background-image:var(--sgds-switch-bg-image);background-position:left var(--sgds-form-padding-inline-sm) center;background-repeat:no-repeat;background-size:var(--sgds-form-width-xs) var(--sgds-form-height-sm);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-form-border-radius-full);height:var(--sgds-switch-height);padding:0 var(--sgds-form-padding-inline-sm);transition:background-position .15s ease-in-out;width:var(--sgds-switch-width)}.form-check-input:focus,.form-check-input:focus-visible{background-color:var(--sgds-form-surface-emphasis)}.form-check-input:focus-visible{background-color:var(--sgds-form-surface-emphasis);outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus);outline-offset:0}.form-check-input:not([disabled]):hover{background-color:var(--sgds-form-surface-emphasis)}.form-check-input
|
|
3401
|
+
`}}gd.styles=[...rt.styles,pd],gd.dependencies={"sgds-icon":Ot},e([Qe({type:Array})],gd.prototype,"steps",void 0),e([Qe({type:Number,reflect:!0})],gd.prototype,"activeStep",void 0),e([Qe({type:String,reflect:!0})],gd.prototype,"orientation",void 0),e([Qe({type:Boolean,reflect:!0})],gd.prototype,"clickable",void 0),e([Va("activeStep")],gd.prototype,"defaultActiveStep",void 0),e([$t("activeStep",{waitUntilFirstUpdate:!0})],gd.prototype,"_handleActiveStepChange",null),Vt("sgds-stepper",gd);var vd=Se`input{margin:0}.form-check{align-items:center;display:flex;gap:var(--sgds-form-gap-lg)}.form-check-input{--sgds-switch-width:var(--sgds-form-width-xl);--sgds-switch-height:var(--sgds-form-height-md);--sgds-switch-bg-image:url('data:image/svg+xml;charset=utf-8,<svg viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M.5 12c0-6.627 5.373-12 12-12s12 5.373 12 12-5.373 12-12 12-12-5.373-12-12Z" fill="%23fff"/></svg>');appearance:none;background-color:var(--sgds-form-surface-subtle);background-image:var(--sgds-switch-bg-image);background-position:left var(--sgds-form-padding-inline-sm) center;background-repeat:no-repeat;background-size:var(--sgds-form-width-xs) var(--sgds-form-height-sm);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-form-border-radius-full);height:var(--sgds-switch-height);padding:0 var(--sgds-form-padding-inline-sm);transition:background-position .15s ease-in-out;width:var(--sgds-switch-width)}.form-check-input:focus,.form-check-input:focus-visible{background-color:var(--sgds-form-surface-emphasis)}.form-check-input:focus-visible{background-color:var(--sgds-form-surface-emphasis);outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus);outline-offset:0}.form-check-input:not([disabled]):hover{background-color:var(--sgds-form-surface-emphasis)}.form-check-input[checked]{background-color:var(--sgds-form-primary-surface-default);background-position:right var(--sgds-form-padding-inline-sm) center}.form-check-input:not([disabled])[checked]:focus-visible,.form-check-input:not([disabled])[checked]:hover{background-color:var(--sgds-form-primary-surface-emphasis)}:host([disabled]) .form-check{cursor:not-allowed;opacity:var(--sgds-opacity-50)}:host([size=sm]) .form-check{font-size:var(--sgds-font-size-1)}:host([size=sm]) .form-check-input{--sgds-switch-width:var(--sgds-form-width-md);--sgds-switch-height:var(--sgds-form-height-sm);background-size:var(--sgds-form-width-2-xs) var(--sgds-form-height-2-xs)}:host([size=lg]) .form-check{font-size:var(--sgds-font-size-3)}:host([size=lg]) .form-check-input{--sgds-switch-width:var(--sgds-form-width-3-xl);--sgds-switch-height:var(--sgds-form-height-lg);background-size:var(--sgds-form-width-sm) var(--sgds-form-height-md)}@media (prefers-reduced-motion:reduce){.form-check .form-check-input{transition:none}}:host([icon]) .form-check-input[checked]{--sgds-switch-bg-image:url('data:image/svg+xml;charset=utf-8,<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M16 32c8.837 0 16-7.163 16-16S24.837 0 16 0 0 7.163 0 16s7.163 16 16 16Zm8.94-21.778a.776.776 0 0 0-.424-.424.781.781 0 0 0-.854.17L13.261 20.372l-4.924-4.925a.783.783 0 1 0-1.108 1.108l5.478 5.478a.777.777 0 0 0 .692.217.787.787 0 0 0 .416-.217L24.77 11.076a.777.777 0 0 0 .17-.854Z" fill="%23fff"/></svg>')}:host([icon]) .form-check-input{--sgds-switch-bg-image:url('data:image/svg+xml;charset=utf-8,<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M16 32c8.837 0 16-7.163 16-16S24.837 0 16 0 0 7.163 0 16s7.163 16 16 16ZM10.164 9.416a.75.75 0 0 0-.53 1.28L14.937 16l-5.303 5.303a.75.75 0 0 0 1.06 1.061l5.304-5.303 5.303 5.303a.75.75 0 1 0 1.06-1.06L17.06 16l5.303-5.303a.75.75 0 0 0-1.06-1.061l-5.304 5.304-5.303-5.304a.75.75 0 0 0-.53-.22Z" fill="%23fff"/></svg>')}.d-none{display:none}`;class md extends rt{constructor(){super(...arguments),this.size="md",this.icon=!1,this.checked=!1,this.disabled=!1,this.hasDefaultSlot=!1,this.hasLeftLabelSlot=!1,this.defaultChecked=!1,this.hasSlotController=new Wi(this,"[default]","leftLabel"),this._inputId=Xi("switch")}updated(){this.hasDefaultSlot||(this.hasDefaultSlot=this.hasSlotController.test("[default]")),this.hasLeftLabelSlot||(this.hasLeftLabelSlot=this.hasSlotController.test("leftLabel"))}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}_handleChange(){this.checked=!this.checked,this.emit("sgds-change",{detail:{checked:this.checked}})}_handleKeyDown(e){const t=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;"Enter"!==e.key||t||this.click()}_handleDisabledChange(){this.input.disabled=this.disabled}render(){const e=!this.hasDefaultSlot&&!this.hasLeftLabelSlot;return J`
|
|
3387
3402
|
<div class="form-check">
|
|
3388
3403
|
<label
|
|
3389
3404
|
for="${this._inputId}"
|
|
@@ -3436,7 +3451,11 @@ const Wl="important",Kl=" !"+Wl;const Gl=vt(class extends mt{constructor(e){if(s
|
|
|
3436
3451
|
></sgds-icon-button>
|
|
3437
3452
|
</div>`:se}
|
|
3438
3453
|
${this.dismissible?J`
|
|
3439
|
-
<sgds-close-button
|
|
3454
|
+
<sgds-close-button
|
|
3455
|
+
aria-label="close the alert"
|
|
3456
|
+
@click=${this.close}
|
|
3457
|
+
tone="fixed-light"
|
|
3458
|
+
></sgds-close-button>
|
|
3440
3459
|
`:se}
|
|
3441
3460
|
</div>
|
|
3442
3461
|
`}}wd.styles=[...rt.styles,fd],wd.dependencies={"sgds-close-button":Ht,"sgds-icon":Ot,"sgds-icon-button":lr},e([Qe({type:Boolean,reflect:!0})],wd.prototype,"show",void 0),e([Qe({type:Boolean,reflect:!0})],wd.prototype,"dismissible",void 0),e([at({flatten:!0})],wd.prototype,"bannerItem",void 0),e([st(".banner")],wd.prototype,"banner",void 0),e([Sl({context:bd}),Je()],wd.prototype,"childCount",void 0),e([Je()],wd.prototype,"_intervalId",void 0),e([Je()],wd.prototype,"_currentIndex",void 0),e([$t("show",{waitUntilFirstUpdate:!0})],wd.prototype,"_handleShowChange",null),St("banner.item.next",{keyframes:[{opacity:0,transform:"translateY(-100%)"},{opacity:1,transform:"translateY(0)"}],options:{duration:500,easing:"cubic-bezier(0.45,0.05,0.55,0.95)"}}),St("banner.item.prev",{keyframes:[{opacity:0,transform:"translateY(100%)"},{opacity:1,transform:"translateY(0)"}],options:{duration:500,easing:"cubic-bezier(0.45,0.05,0.55,0.95)"}});var yd=Se`:host{display:block;font-size:var(--sgds-font-size-1,14px);font-style:normal;font-weight:var(--sgds-font-weight-regular,400);letter-spacing:var(--sgds-letter-spacing-normal,0);line-height:var(--sgds-line-height-20,20px);width:inherit}.banner-item{color:var(--sgds-color-fixed-light);display:flex;gap:var(--sgds-gap-sm);padding:var(--sgds-padding-2-xs) 0}.message{line-clamp:5;-webkit-line-clamp:5;-webkit-box-orient:vertical;display:-webkit-box;max-height:calc(var(--sgds-line-height-20, 20px)*5);overflow:hidden;word-break:break-all}.message.truncated:after{background-color:var(--sgds-surface-fixed-dark);bottom:0;content:"";height:var(--sgds-line-height-20,20px);position:absolute;right:0;text-align:right;width:10ch}.clamped-container{display:inline-block;margin-right:var(--sgds-margin-md);max-width:var(--sgds-dimension-872);position:relative}.show-more{bottom:0;position:absolute;right:0;white-space:nowrap}.show-more__link{cursor:pointer;text-decoration:underline}.action{align-items:center;display:flex;gap:var(--sgds-gap-2-xs,4px);margin-top:6px;min-height:var(--sgds-line-height-20);white-space:nowrap}slot[name=action]::slotted(a){color:var(--sgds-color-fixed-light)!important;font-size:var(--sgds-font-size-1,14px)!important;text-decoration:none!important}.banner-item__message_and__action{display:flex;flex:1 0 0;flex-direction:column;gap:var(--sgds-gap-xs)}@media (min-width:512px){.banner-item__message_and__action{flex-direction:row;gap:var(--sgds-gap-sm)}.action{margin-left:auto;margin-top:0}.message{line-clamp:2;-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;max-height:calc(var(--sgds-line-height-20, 20px)*2);overflow:hidden;word-break:break-all}}`;class xd extends rt{constructor(){super(...arguments),this.hasActionSlot=!1,this.clamped=!1,this.siblingsCount=0,this.hasSlotController=new Wi(this,"action")}async firstUpdated(e){super.firstUpdated(e),await this.updateComplete,this._clampCheck(),this._resizeObserver=new ResizeObserver((()=>this._clampCheck())),this._resizeObserver.observe(this.shadowRoot.querySelector(".message"))}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver&&this._resizeObserver.disconnect()}updated(){this.hasActionSlot||(this.hasActionSlot=this.hasSlotController.test("action"))}_clampCheck(){const e=this.shadowRoot.querySelector(".message");requestAnimationFrame((()=>{this.clamped=e.scrollHeight>e.clientHeight}))}_handleShowMoreClick(){this.emit("sgds-show-more")}render(){return J`
|