@govtechsg/sgds-web-component 3.28.1-rc.0 → 3.29.0
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/button.js +1 -1
- package/base/button.js.map +1 -1
- package/components/Alert/alert.js +1 -1
- package/components/Alert/alert.js.map +1 -1
- package/components/Alert/index.umd.min.js +3 -3
- package/components/Alert/index.umd.min.js.map +1 -1
- package/components/Alert/sgds-alert.js +1 -1
- package/components/Alert/sgds-alert.js.map +1 -1
- package/components/Appnav/index.umd.min.js +3 -3
- package/components/Appnav/index.umd.min.js.map +1 -1
- package/components/Appnav/sgds-appnav.js +1 -1
- package/components/Appnav/sgds-appnav.js.map +1 -1
- package/components/Badge/index.umd.min.js +1 -1
- package/components/Badge/index.umd.min.js.map +1 -1
- package/components/Breadcrumb/index.umd.min.js +3 -3
- package/components/Breadcrumb/index.umd.min.js.map +1 -1
- package/components/Breadcrumb/sgds-breadcrumb.js +2 -2
- package/components/Breadcrumb/sgds-breadcrumb.js.map +1 -1
- package/components/Button/index.umd.min.js +2 -2
- package/components/Button/index.umd.min.js.map +1 -1
- package/components/Button/sgds-button.js +1 -1
- package/components/Button/sgds-button.js.map +1 -1
- package/components/Checkbox/index.umd.min.js +3 -2
- package/components/Checkbox/index.umd.min.js.map +1 -1
- package/components/Checkbox/sgds-checkbox.d.ts +2 -0
- package/components/Checkbox/sgds-checkbox.js +3 -0
- package/components/Checkbox/sgds-checkbox.js.map +1 -1
- package/components/CloseButton/close-button.js +1 -1
- package/components/CloseButton/close-button.js.map +1 -1
- package/components/CloseButton/index.umd.min.js +1 -1
- package/components/CloseButton/index.umd.min.js.map +1 -1
- package/components/ComboBox/index.umd.min.js +4 -3
- package/components/ComboBox/index.umd.min.js.map +1 -1
- package/components/DataTable/data-table.js +1 -1
- package/components/DataTable/data-table.js.map +1 -1
- package/components/DataTable/index.umd.min.js +20 -11
- package/components/DataTable/index.umd.min.js.map +1 -1
- package/components/DataTable/sgds-data-table-row.js +12 -4
- package/components/DataTable/sgds-data-table-row.js.map +1 -1
- package/components/DataTable/sgds-data-table.js +1 -2
- package/components/DataTable/sgds-data-table.js.map +1 -1
- package/components/Datepicker/index.umd.min.js +3 -2
- package/components/Datepicker/index.umd.min.js.map +1 -1
- package/components/Drawer/index.umd.min.js +1 -1
- package/components/Drawer/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/Dropdown/sgds-dropdown.js +1 -1
- package/components/Dropdown/sgds-dropdown.js.map +1 -1
- package/components/FileUpload/index.umd.min.js +3 -3
- package/components/FileUpload/index.umd.min.js.map +1 -1
- package/components/IconButton/index.umd.min.js +1 -1
- package/components/IconButton/index.umd.min.js.map +1 -1
- package/components/Input/index.umd.min.js +1 -0
- package/components/Input/index.umd.min.js.map +1 -1
- package/components/Input/sgds-input.js +1 -0
- package/components/Input/sgds-input.js.map +1 -1
- package/components/Mainnav/index.umd.min.js +3 -3
- package/components/Mainnav/index.umd.min.js.map +1 -1
- package/components/Mainnav/sgds-mainnav.js +1 -1
- package/components/Mainnav/sgds-mainnav.js.map +1 -1
- package/components/Modal/index.umd.min.js +3 -3
- package/components/Modal/index.umd.min.js.map +1 -1
- package/components/Modal/modal.js +1 -1
- package/components/Modal/modal.js.map +1 -1
- package/components/Modal/sgds-modal.js +1 -1
- package/components/Modal/sgds-modal.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/Pagination/index.umd.min.js +2 -2
- package/components/Pagination/index.umd.min.js.map +1 -1
- package/components/QuantityToggle/index.umd.min.js +2 -1
- package/components/QuantityToggle/index.umd.min.js.map +1 -1
- package/components/Select/index.umd.min.js +1 -1
- package/components/Select/index.umd.min.js.map +1 -1
- package/components/Select/sgds-select.js +1 -1
- package/components/Select/sgds-select.js.map +1 -1
- package/components/Sidebar/index.umd.min.js +1 -1
- package/components/Sidebar/index.umd.min.js.map +1 -1
- package/components/Sidenav/index.umd.min.js +1 -1
- package/components/Sidenav/index.umd.min.js.map +1 -1
- package/components/Sidenav/sgds-sidenav.js +1 -1
- package/components/Sidenav/sgds-sidenav.js.map +1 -1
- package/components/SystemBanner/index.umd.min.js +4 -2
- package/components/SystemBanner/index.umd.min.js.map +1 -1
- package/components/SystemBanner/sgds-system-banner.js +2 -0
- package/components/SystemBanner/sgds-system-banner.js.map +1 -1
- package/components/Toast/index.umd.min.js +1 -1
- package/components/Toast/index.umd.min.js.map +1 -1
- package/components/index.umd.min.js +68 -56
- package/components/index.umd.min.js.map +1 -1
- package/custom-elements.json +20 -1
- package/index.umd.min.js +49 -37
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/base/button.cjs.js +1 -1
- package/react/base/button.cjs.js.map +1 -1
- package/react/base/button.js +1 -1
- package/react/base/button.js.map +1 -1
- package/react/components/Alert/alert.cjs.js +1 -1
- package/react/components/Alert/alert.cjs.js.map +1 -1
- package/react/components/Alert/alert.js +1 -1
- package/react/components/Alert/alert.js.map +1 -1
- package/react/components/Alert/sgds-alert.cjs.js +1 -1
- package/react/components/Alert/sgds-alert.cjs.js.map +1 -1
- package/react/components/Alert/sgds-alert.js +1 -1
- package/react/components/Alert/sgds-alert.js.map +1 -1
- package/react/components/Appnav/sgds-appnav.cjs.js +1 -1
- package/react/components/Appnav/sgds-appnav.cjs.js.map +1 -1
- package/react/components/Appnav/sgds-appnav.js +1 -1
- package/react/components/Appnav/sgds-appnav.js.map +1 -1
- package/react/components/Breadcrumb/sgds-breadcrumb.cjs.js +2 -2
- package/react/components/Breadcrumb/sgds-breadcrumb.cjs.js.map +1 -1
- package/react/components/Breadcrumb/sgds-breadcrumb.js +2 -2
- package/react/components/Breadcrumb/sgds-breadcrumb.js.map +1 -1
- package/react/components/Button/sgds-button.cjs.js +1 -1
- package/react/components/Button/sgds-button.cjs.js.map +1 -1
- package/react/components/Button/sgds-button.js +1 -1
- package/react/components/Button/sgds-button.js.map +1 -1
- package/react/components/Checkbox/sgds-checkbox.cjs.js +3 -0
- package/react/components/Checkbox/sgds-checkbox.cjs.js.map +1 -1
- package/react/components/Checkbox/sgds-checkbox.js +3 -0
- package/react/components/Checkbox/sgds-checkbox.js.map +1 -1
- package/react/components/CloseButton/close-button.cjs.js +1 -1
- package/react/components/CloseButton/close-button.cjs.js.map +1 -1
- package/react/components/CloseButton/close-button.js +1 -1
- package/react/components/CloseButton/close-button.js.map +1 -1
- package/react/components/DataTable/data-table.cjs.js +1 -1
- package/react/components/DataTable/data-table.cjs.js.map +1 -1
- package/react/components/DataTable/data-table.js +1 -1
- package/react/components/DataTable/data-table.js.map +1 -1
- package/react/components/DataTable/sgds-data-table-row.cjs.js +12 -4
- package/react/components/DataTable/sgds-data-table-row.cjs.js.map +1 -1
- package/react/components/DataTable/sgds-data-table-row.js +12 -4
- package/react/components/DataTable/sgds-data-table-row.js.map +1 -1
- package/react/components/DataTable/sgds-data-table.cjs.js +1 -2
- package/react/components/DataTable/sgds-data-table.cjs.js.map +1 -1
- package/react/components/DataTable/sgds-data-table.js +1 -2
- package/react/components/DataTable/sgds-data-table.js.map +1 -1
- package/react/components/Dropdown/sgds-dropdown.cjs.js +1 -1
- package/react/components/Dropdown/sgds-dropdown.cjs.js.map +1 -1
- package/react/components/Dropdown/sgds-dropdown.js +1 -1
- package/react/components/Dropdown/sgds-dropdown.js.map +1 -1
- package/react/components/Input/sgds-input.cjs.js +1 -0
- package/react/components/Input/sgds-input.cjs.js.map +1 -1
- package/react/components/Input/sgds-input.js +1 -0
- package/react/components/Input/sgds-input.js.map +1 -1
- package/react/components/Mainnav/sgds-mainnav.cjs.js +1 -1
- package/react/components/Mainnav/sgds-mainnav.cjs.js.map +1 -1
- package/react/components/Mainnav/sgds-mainnav.js +1 -1
- package/react/components/Mainnav/sgds-mainnav.js.map +1 -1
- package/react/components/Modal/modal.cjs.js +1 -1
- package/react/components/Modal/modal.cjs.js.map +1 -1
- package/react/components/Modal/modal.js +1 -1
- package/react/components/Modal/modal.js.map +1 -1
- package/react/components/Modal/sgds-modal.cjs.js +1 -1
- package/react/components/Modal/sgds-modal.cjs.js.map +1 -1
- package/react/components/Modal/sgds-modal.js +1 -1
- package/react/components/Modal/sgds-modal.js.map +1 -1
- package/react/components/Select/sgds-select.cjs.js +1 -1
- package/react/components/Select/sgds-select.cjs.js.map +1 -1
- package/react/components/Select/sgds-select.js +1 -1
- package/react/components/Select/sgds-select.js.map +1 -1
- package/react/components/Sidenav/sgds-sidenav.cjs.js +1 -1
- package/react/components/Sidenav/sgds-sidenav.cjs.js.map +1 -1
- package/react/components/Sidenav/sgds-sidenav.js +1 -1
- package/react/components/Sidenav/sgds-sidenav.js.map +1 -1
- package/react/components/SystemBanner/sgds-system-banner.cjs.js +2 -0
- package/react/components/SystemBanner/sgds-system-banner.cjs.js.map +1 -1
- package/react/components/SystemBanner/sgds-system-banner.js +2 -0
- package/react/components/SystemBanner/sgds-system-banner.js.map +1 -1
- package/themes/night.css +8 -8
- package/types/react.d.ts +2 -0
|
@@ -121,7 +121,7 @@ let dt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ft
|
|
|
121
121
|
* Copyright 2020 Google LLC
|
|
122
122
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
123
123
|
*/
|
|
124
|
-
let St=Symbol.for(``),Ct=e=>{if(e?.r===St)return e?._$litStatic$},wt=(e,...t)=>({_$litStatic$:t.reduce((t,n,r)=>t+(e=>{if(e._$litStatic$!==void 0)return e._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${e}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(n)+e[r+1],e[0]),r:St}),Tt=/* @__PURE__ */ new Map,I=(e=>(t,...n)=>{let r=n.length,i,a,o=[],s=[],c,l=0,u=!1;for(;l<r;){for(c=t[l];l<r&&(a=n[l],(i=Ct(a))!==void 0);)c+=i+t[++l],u=!0;l!==r&&s.push(a),o.push(c),l++}if(l===r&&o.push(t[r]),u){let e=o.join(`$$lit$$`);(t=Tt.get(e))===void 0&&(o.raw=o,Tt.set(e,t=o)),n=s}return e(t,...n)})(y);x();var Et=u`:host{--sgds-close-btn-border-radius:var(--sgds-border-radius-sm);display:inline-flex}:host([size=sm]) .btn-close{height:var(--sgds-dimension-24);width:var(--sgds-dimension-24)}:host([tone=fixed-light]) .btn-close{color:var(--sgds-color-fixed-light)}:host([tone=fixed-dark]) .btn-close{color:var(--sgds-color-fixed-dark)}.btn-close{align-items:center;background-color:var(--sgds-bg-transparent);border:0;border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-close-btn-border-radius);cursor:pointer;display:flex;height:var(--sgds-dimension-32);justify-content:center;padding:0;position:relative;width:var(--sgds-dimension-32)}.btn-close:focus-visible,.btn-close:hover{background-color:var(--sgds-bg-translucent)}:host([tone=fixed-light]) .btn-close:focus-visible,:host([tone=fixed-light]) .btn-close:hover{background-color:var(--sgds-bg-translucent-fixed-light)}:host([tone=fixed-dark]) .btn-close:focus-visible,:host([tone=fixed-dark]) .btn-close:hover{background-color:var(--sgds-bg-translucent-fixed-dark)}.btn-close:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}:host([disabled]) .btn-close{cursor:not-allowed;opacity:var(--sgds-opacity-40);pointer-events:none}`;function Dt(e){return!!customElements.get(e)}function Ot(e){return Dt(e)?!0:(console.error(`Custom element of name : ${e} is not registered. Remember to import the component file for custom element registration`),!1)}x();var kt=class extends D{constructor(...e){super(...e),this.size=`md`,this.tone=`default`,this.disabled=!1,this._clickHandler=()=>{}}static{this.styles=[...D.styles,Et]}_handleClick(e){if(this.disabled){e.preventDefault(),e.stopPropagation();return}this.removeEventListener(`click`,this._clickHandler),this.addEventListener(`click`,this._clickHandler)}firstUpdated(e){super.firstUpdated(e),Ot(`sgds-icon`)}render(){return y`
|
|
124
|
+
let St=Symbol.for(``),Ct=e=>{if(e?.r===St)return e?._$litStatic$},wt=(e,...t)=>({_$litStatic$:t.reduce((t,n,r)=>t+(e=>{if(e._$litStatic$!==void 0)return e._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${e}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(n)+e[r+1],e[0]),r:St}),Tt=/* @__PURE__ */ new Map,I=(e=>(t,...n)=>{let r=n.length,i,a,o=[],s=[],c,l=0,u=!1;for(;l<r;){for(c=t[l];l<r&&(a=n[l],(i=Ct(a))!==void 0);)c+=i+t[++l],u=!0;l!==r&&s.push(a),o.push(c),l++}if(l===r&&o.push(t[r]),u){let e=o.join(`$$lit$$`);(t=Tt.get(e))===void 0&&(o.raw=o,Tt.set(e,t=o)),n=s}return e(t,...n)})(y);x();var Et=u`:host{--sgds-close-btn-border-radius:var(--sgds-border-radius-sm);display:inline-flex}:host([size=sm]) .btn-close{height:var(--sgds-dimension-24);width:var(--sgds-dimension-24)}:host([tone=fixed-light]) .btn-close{color:var(--sgds-color-fixed-light)}:host([tone=fixed-dark]) .btn-close{color:var(--sgds-color-fixed-dark)}.btn-close{align-items:center;background-color:var(--sgds-bg-transparent);border:0;border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-close-btn-border-radius);cursor:pointer;display:flex;height:var(--sgds-dimension-32);justify-content:center;padding:0;position:relative;width:var(--sgds-dimension-32)}.btn-close:focus-visible,.btn-close:hover{background-color:var(--sgds-bg-translucent)}:host([tone=fixed-light]) .btn-close:focus-visible,:host([tone=fixed-light]) .btn-close:hover{background-color:var(--sgds-bg-translucent-fixed-light)}:host([tone=fixed-dark]) .btn-close:focus-visible,:host([tone=fixed-dark]) .btn-close:hover{background-color:var(--sgds-bg-translucent-fixed-dark)}.btn-close:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}:host(:not([disabled])) .btn-close:active:after{background-color:var(--sgds-bg-translucent);border-radius:inherit;content:"";inset:0;position:absolute}:host([disabled]) .btn-close{cursor:not-allowed;opacity:var(--sgds-opacity-40);pointer-events:none}`;function Dt(e){return!!customElements.get(e)}function Ot(e){return Dt(e)?!0:(console.error(`Custom element of name : ${e} is not registered. Remember to import the component file for custom element registration`),!1)}x();var kt=class extends D{constructor(...e){super(...e),this.size=`md`,this.tone=`default`,this.disabled=!1,this._clickHandler=()=>{}}static{this.styles=[...D.styles,Et]}_handleClick(e){if(this.disabled){e.preventDefault(),e.stopPropagation();return}this.removeEventListener(`click`,this._clickHandler),this.addEventListener(`click`,this._clickHandler)}firstUpdated(e){super.firstUpdated(e),Ot(`sgds-icon`)}render(){return y`
|
|
125
125
|
<button class="btn-close" aria-label="Close button" ?disabled=${this.disabled} @click=${this._handleClick}>
|
|
126
126
|
<sgds-icon name="cross" size="sm"></sgds-icon>
|
|
127
127
|
</button>
|
|
@@ -2395,7 +2395,7 @@ let St=Symbol.for(``),Ct=e=>{if(e?.r===St)return e?._$litStatic$},wt=(e,...t)=>(
|
|
|
2395
2395
|
clip-rule="evenodd"
|
|
2396
2396
|
/>
|
|
2397
2397
|
</svg>
|
|
2398
|
-
`}));let Jp={announcement:()=>Promise.resolve().then(()=>(Mt(),At)),archive:()=>Promise.resolve().then(()=>(Ft(),Nt)),"arrow-bar-down":()=>Promise.resolve().then(()=>(Rt(),It)),"arrow-bar-left":()=>Promise.resolve().then(()=>(Vt(),zt)),"arrow-bar-right":()=>Promise.resolve().then(()=>(Wt(),Ht)),"arrow-bar-up":()=>Promise.resolve().then(()=>(qt(),Gt)),"arrow-circle-down":()=>Promise.resolve().then(()=>(Xt(),Jt)),"arrow-circle-left":()=>Promise.resolve().then(()=>($t(),Zt)),"arrow-circle-right":()=>Promise.resolve().then(()=>(nn(),en)),"arrow-circle-up":()=>Promise.resolve().then(()=>(on(),rn)),"arrow-clockwise":()=>Promise.resolve().then(()=>(ln(),sn)),"arrow-down":()=>Promise.resolve().then(()=>(fn(),un)),"arrow-left":()=>Promise.resolve().then(()=>(hn(),pn)),"arrow-repeat":()=>Promise.resolve().then(()=>(vn(),gn)),"arrow-right":()=>Promise.resolve().then(()=>(xn(),yn)),"arrow-square-down":()=>Promise.resolve().then(()=>(wn(),Sn)),"arrow-square-left":()=>Promise.resolve().then(()=>(Dn(),Tn)),"arrow-square-right":()=>Promise.resolve().then(()=>(An(),On)),"arrow-square-up":()=>Promise.resolve().then(()=>(Nn(),jn)),"arrow-up":()=>Promise.resolve().then(()=>(In(),Pn)),"bank-fill":()=>Promise.resolve().then(()=>(zn(),Ln)),"bell-slash":()=>Promise.resolve().then(()=>(Hn(),Bn)),bell:()=>Promise.resolve().then(()=>(Gn(),Un)),"bi-funnel":()=>Promise.resolve().then(()=>(Jn(),Kn)),"bookmark-fill":()=>Promise.resolve().then(()=>(Zn(),Yn)),bookmark:()=>Promise.resolve().then(()=>(er(),Qn)),"box-arrow-up-right":()=>Promise.resolve().then(()=>(rr(),tr)),"box-seam":()=>Promise.resolve().then(()=>(or(),ir)),building:()=>Promise.resolve().then(()=>(lr(),sr)),bus:()=>Promise.resolve().then(()=>(fr(),ur)),calculator:()=>Promise.resolve().then(()=>(hr(),pr)),"calendar-check":()=>Promise.resolve().then(()=>(vr(),gr)),"calendar-heart":()=>Promise.resolve().then(()=>(xr(),yr)),"calendar-x":()=>Promise.resolve().then(()=>(wr(),Sr)),calendar:()=>Promise.resolve().then(()=>(Dr(),Tr)),camera:()=>Promise.resolve().then(()=>(Ar(),Or)),car:()=>Promise.resolve().then(()=>(Nr(),jr)),"chat-dots":()=>Promise.resolve().then(()=>(Ir(),Pr)),"chat-left-text":()=>Promise.resolve().then(()=>(zr(),Lr)),chat:()=>Promise.resolve().then(()=>(Hr(),Br)),"check-circle-fill":()=>Promise.resolve().then(()=>(Gr(),Ur)),"check-circle":()=>Promise.resolve().then(()=>(Jr(),Kr)),check:()=>Promise.resolve().then(()=>(Zr(),Yr)),"chevron-down":()=>Promise.resolve().then(()=>(ei(),Qr)),"chevron-left":()=>Promise.resolve().then(()=>(ri(),ti)),"chevron-right":()=>Promise.resolve().then(()=>(oi(),ii)),"chevron-selector-vertical":()=>Promise.resolve().then(()=>(li(),si)),"chevron-up":()=>Promise.resolve().then(()=>(fi(),ui)),clock:()=>Promise.resolve().then(()=>(hi(),pi)),"cloud-check":()=>Promise.resolve().then(()=>(vi(),gi)),"cloud-download":()=>Promise.resolve().then(()=>(xi(),yi)),"cloud-upload":()=>Promise.resolve().then(()=>(wi(),Si)),cloud:()=>Promise.resolve().then(()=>(Di(),Ti)),"code-square":()=>Promise.resolve().then(()=>(Ai(),Oi)),"coins-hand":()=>Promise.resolve().then(()=>(Ni(),ji)),compass:()=>Promise.resolve().then(()=>(Ii(),Pi)),copy:()=>Promise.resolve().then(()=>(zi(),Li)),"cpu-chip-ai":()=>Promise.resolve().then(()=>(Hi(),Bi)),cross:()=>Promise.resolve().then(()=>(Gi(),Ui)),"cursor-fill":()=>Promise.resolve().then(()=>(Ji(),Ki)),cursor:()=>Promise.resolve().then(()=>(Zi(),Yi)),"dash-circle":()=>Promise.resolve().then(()=>(ea(),Qi)),"dash-square":()=>Promise.resolve().then(()=>(ra(),ta)),dash:()=>Promise.resolve().then(()=>(oa(),ia)),database:()=>Promise.resolve().then(()=>(la(),sa)),dataflow:()=>Promise.resolve().then(()=>(fa(),ua)),download:()=>Promise.resolve().then(()=>(ha(),pa)),edit:()=>Promise.resolve().then(()=>(va(),ga)),"exclamation-circle-fill":()=>Promise.resolve().then(()=>(xa(),ya)),"exclamation-circle":()=>Promise.resolve().then(()=>(wa(),Sa)),"exclamation-triangle-fill":()=>Promise.resolve().then(()=>(Da(),Ta)),"exclamation-triangle":()=>Promise.resolve().then(()=>(Aa(),Oa)),exclamation:()=>Promise.resolve().then(()=>(Na(),ja)),"eye-fill":()=>Promise.resolve().then(()=>(Ia(),Pa)),"eye-slash-fill":()=>Promise.resolve().then(()=>(za(),La)),"eye-slash":()=>Promise.resolve().then(()=>(Ha(),Ba)),eye:()=>Promise.resolve().then(()=>(Ga(),Ua)),"face-smile-fill":()=>Promise.resolve().then(()=>(Ja(),Ka)),"face-smile":()=>Promise.resolve().then(()=>(Za(),Ya)),facebook:()=>Promise.resolve().then(()=>(eo(),Qa)),"file-earmark-text":()=>Promise.resolve().then(()=>(ro(),to)),"file-pdf":()=>Promise.resolve().then(()=>(oo(),io)),"file-plus":()=>Promise.resolve().then(()=>(lo(),so)),"file-text":()=>Promise.resolve().then(()=>(po(),uo)),file:()=>Promise.resolve().then(()=>(go(),mo)),files:()=>Promise.resolve().then(()=>(yo(),_o)),fingerprint:()=>Promise.resolve().then(()=>(So(),bo)),flash:()=>Promise.resolve().then(()=>(To(),Co)),"folder-check":()=>Promise.resolve().then(()=>(Oo(),Eo)),"folder-minus":()=>Promise.resolve().then(()=>(jo(),ko)),"folder-plus":()=>Promise.resolve().then(()=>(Po(),Mo)),folder:()=>Promise.resolve().then(()=>(Lo(),Fo)),gear:()=>Promise.resolve().then(()=>(Bo(),Ro)),"geo-alt":()=>Promise.resolve().then(()=>(Uo(),Vo)),"geo-fill":()=>Promise.resolve().then(()=>(Ko(),Wo)),geo:()=>Promise.resolve().then(()=>(Yo(),qo)),"globe-alt":()=>Promise.resolve().then(()=>(Qo(),Xo)),globe:()=>Promise.resolve().then(()=>(ts(),$o)),google:()=>Promise.resolve().then(()=>(is(),ns)),"grid-alt":()=>Promise.resolve().then(()=>(ss(),as)),"grid-fill":()=>Promise.resolve().then(()=>(us(),cs)),"hand-thumbs-down":()=>Promise.resolve().then(()=>(ps(),ds)),"hand-thumbs-up":()=>Promise.resolve().then(()=>(gs(),ms)),"hard-drive":()=>Promise.resolve().then(()=>(ys(),_s)),heart:()=>Promise.resolve().then(()=>(Ss(),bs)),"house-door":()=>Promise.resolve().then(()=>(Ts(),Cs)),house:()=>Promise.resolve().then(()=>(Os(),Es)),image:()=>Promise.resolve().then(()=>(js(),ks)),"in-box":()=>Promise.resolve().then(()=>(Ps(),Ms)),"info-circle-fill":()=>Promise.resolve().then(()=>(Ls(),Fs)),"info-circle":()=>Promise.resolve().then(()=>(Bs(),Rs)),instagram:()=>Promise.resolve().then(()=>(Us(),Vs)),key:()=>Promise.resolve().then(()=>(Ks(),Ws)),"laptop-gear":()=>Promise.resolve().then(()=>(Ys(),qs)),laptop:()=>Promise.resolve().then(()=>(Qs(),Xs)),layers:()=>Promise.resolve().then(()=>(tc(),$s)),"layout-text-window-reverse":()=>Promise.resolve().then(()=>(ic(),nc)),"layout-text-window":()=>Promise.resolve().then(()=>(sc(),ac)),layout:()=>Promise.resolve().then(()=>(uc(),cc)),"life-buoy":()=>Promise.resolve().then(()=>(pc(),dc)),lightbulb:()=>Promise.resolve().then(()=>(gc(),mc)),link:()=>Promise.resolve().then(()=>(yc(),_c)),linkedin:()=>Promise.resolve().then(()=>(Sc(),bc)),list:()=>Promise.resolve().then(()=>(Tc(),Cc)),"lock-fill":()=>Promise.resolve().then(()=>(Oc(),Ec)),lock:()=>Promise.resolve().then(()=>(jc(),kc)),login:()=>Promise.resolve().then(()=>(Pc(),Mc)),logout:()=>Promise.resolve().then(()=>(Lc(),Fc)),luggage:()=>Promise.resolve().then(()=>(Bc(),Rc)),"mail-open":()=>Promise.resolve().then(()=>(Uc(),Vc)),mail:()=>Promise.resolve().then(()=>(Kc(),Wc)),map:()=>Promise.resolve().then(()=>(Yc(),qc)),meetup:()=>Promise.resolve().then(()=>(Qc(),Xc)),menu:()=>Promise.resolve().then(()=>(tl(),$c)),microphone:()=>Promise.resolve().then(()=>(il(),nl)),monitor:()=>Promise.resolve().then(()=>(sl(),al)),moon:()=>Promise.resolve().then(()=>(ul(),cl)),move:()=>Promise.resolve().then(()=>(pl(),dl)),paperclip:()=>Promise.resolve().then(()=>(gl(),ml)),passcode:()=>Promise.resolve().then(()=>(yl(),_l)),passport:()=>Promise.resolve().then(()=>(Sl(),bl)),pause:()=>Promise.resolve().then(()=>(Tl(),Cl)),pencil:()=>Promise.resolve().then(()=>(Ol(),El)),"pending-circle":()=>Promise.resolve().then(()=>(jl(),kl)),"person-dash":()=>Promise.resolve().then(()=>(Pl(),Ml)),"person-plus":()=>Promise.resolve().then(()=>(Ll(),Fl)),"person-x":()=>Promise.resolve().then(()=>(Bl(),Rl)),person:()=>Promise.resolve().then(()=>(Ul(),Vl)),phone:()=>Promise.resolve().then(()=>(Kl(),Wl)),"pin-map-fill":()=>Promise.resolve().then(()=>(Yl(),ql)),pin:()=>Promise.resolve().then(()=>(Ql(),Xl)),placeholder:()=>Promise.resolve().then(()=>(tu(),$l)),plane:()=>Promise.resolve().then(()=>(iu(),nu)),play:()=>Promise.resolve().then(()=>(su(),au)),"plus-circle":()=>Promise.resolve().then(()=>(uu(),cu)),"plus-square":()=>Promise.resolve().then(()=>(pu(),du)),plus:()=>Promise.resolve().then(()=>(gu(),mu)),printer:()=>Promise.resolve().then(()=>(yu(),_u)),"question-circle":()=>Promise.resolve().then(()=>(Su(),bu)),rocket:()=>Promise.resolve().then(()=>(Tu(),Cu)),save:()=>Promise.resolve().then(()=>(Ou(),Eu)),search:()=>Promise.resolve().then(()=>(ju(),ku)),send:()=>Promise.resolve().then(()=>(Pu(),Mu)),"sg-crest":()=>Promise.resolve().then(()=>(Lu(),Fu)),share:()=>Promise.resolve().then(()=>(Bu(),Ru)),"shield-tick":()=>Promise.resolve().then(()=>(Uu(),Vu)),"sidebar-collapse":()=>Promise.resolve().then(()=>(Ku(),Wu)),"sidebar-expand":()=>Promise.resolve().then(()=>(Yu(),qu)),"slash-circle":()=>Promise.resolve().then(()=>(Qu(),Xu)),"slash-divider":()=>Promise.resolve().then(()=>(td(),$u)),sliders:()=>Promise.resolve().then(()=>(id(),nd)),"sort-ascending":()=>Promise.resolve().then(()=>(sd(),ad)),"sort-descending":()=>Promise.resolve().then(()=>(ud(),cd)),speedometer:()=>Promise.resolve().then(()=>(pd(),dd)),"star-ai":()=>Promise.resolve().then(()=>(gd(),md)),"star-fill":()=>Promise.resolve().then(()=>(yd(),_d)),star:()=>Promise.resolve().then(()=>(Sd(),bd)),stoplights:()=>Promise.resolve().then(()=>(Td(),Cd)),sun:()=>Promise.resolve().then(()=>(Od(),Ed)),"switch-horizontal":()=>Promise.resolve().then(()=>(jd(),kd)),"switch-vertical":()=>Promise.resolve().then(()=>(Pd(),Md)),tablet:()=>Promise.resolve().then(()=>(Ld(),Fd)),telegram:()=>Promise.resolve().then(()=>(Bd(),Rd)),telephone:()=>Promise.resolve().then(()=>(Ud(),Vd)),"three-dots-vertical":()=>Promise.resolve().then(()=>(Kd(),Wd)),"three-dots":()=>Promise.resolve().then(()=>(Yd(),qd)),ticket:()=>Promise.resolve().then(()=>(Qd(),Xd)),"toggle-off":()=>Promise.resolve().then(()=>(tf(),$d)),"toggle-on":()=>Promise.resolve().then(()=>(af(),nf)),train:()=>Promise.resolve().then(()=>(cf(),of)),translate:()=>Promise.resolve().then(()=>(df(),lf)),trash:()=>Promise.resolve().then(()=>(mf(),ff)),"trend-down":()=>Promise.resolve().then(()=>(_f(),hf)),"trend-up":()=>Promise.resolve().then(()=>(bf(),vf)),truck:()=>Promise.resolve().then(()=>(Cf(),xf)),"twitter-x":()=>Promise.resolve().then(()=>(Ef(),wf)),unlock:()=>Promise.resolve().then(()=>(kf(),Df)),upload:()=>Promise.resolve().then(()=>(Mf(),Af)),"user-check":()=>Promise.resolve().then(()=>(Ff(),Nf)),"user-circle":()=>Promise.resolve().then(()=>(Rf(),If)),"user-pause":()=>Promise.resolve().then(()=>(Vf(),zf)),"user-square":()=>Promise.resolve().then(()=>(Wf(),Hf)),users:()=>Promise.resolve().then(()=>(qf(),Gf)),"video-recorder":()=>Promise.resolve().then(()=>(Xf(),Jf)),"volume-max":()=>Promise.resolve().then(()=>($f(),Zf)),"volume-x":()=>Promise.resolve().then(()=>(np(),ep)),"window-dash":()=>Promise.resolve().then(()=>(ap(),rp)),"window-desktop":()=>Promise.resolve().then(()=>(cp(),op)),"window-dock":()=>Promise.resolve().then(()=>(dp(),lp)),"window-fullscreen":()=>Promise.resolve().then(()=>(mp(),fp)),"window-plus":()=>Promise.resolve().then(()=>(_p(),hp)),"window-sidebar":()=>Promise.resolve().then(()=>(bp(),vp)),"window-split":()=>Promise.resolve().then(()=>(Cp(),xp)),"window-stack":()=>Promise.resolve().then(()=>(Ep(),wp)),"window-x":()=>Promise.resolve().then(()=>(kp(),Dp)),window:()=>Promise.resolve().then(()=>(Mp(),Ap)),"xcircle-fill":()=>Promise.resolve().then(()=>(Fp(),Np)),xcircle:()=>Promise.resolve().then(()=>(Rp(),Ip)),youtube:()=>Promise.resolve().then(()=>(Vp(),zp)),"zoom-in":()=>Promise.resolve().then(()=>(Wp(),Hp)),"zoom-out":()=>Promise.resolve().then(()=>(qp(),Gp))};x();var Yp=u`:host{color:inherit;display:inline-flex;vertical-align:bottom}:host(.icon-left){margin-right:.25rem}:host(.icon-right){margin-left:.25rem}:host([size=xs]) svg{height:var(--sgds-icon-size-xs);width:var(--sgds-icon-size-xs)}:host([size=sm]) svg{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}:host([size=md]) svg{height:var(--sgds-icon-size-md);width:var(--sgds-icon-size-md)}:host([size=xl]) svg{height:var(--sgds-icon-size-xl);width:var(--sgds-icon-size-xl)}:host([size="2-xl"]) svg{height:var(--sgds-icon-size-2-xl);width:var(--sgds-icon-size-2-xl)}:host([size="3-xl"]) svg{height:var(--sgds-icon-size-3-xl);width:var(--sgds-icon-size-3-xl)}svg{display:inline-block;height:var(--sgds-icon-size-lg);width:var(--sgds-icon-size-lg)}`;x();let Xp=/* @__PURE__ */ new Map;var L=class extends D{constructor(...e){super(...e),this.size=`lg`}static{this.styles=[...D.styles,Yp]}willUpdate(e){e.has(`name`)&&this._loadIcon(this.name)}async _loadIcon(e){if(!e){this._icon=void 0;return}if(Xp.has(e)){this._icon=Xp.get(e);return}let t=Jp[e];if(!t){console.warn(`Icon not found: ${e}`),this._icon=void 0;return}try{let n=await t();Xp.set(e,n.default),this._icon=n.default}catch{console.warn(`Failed to load icon: ${e}`),this._icon=void 0}}updated(){let e=this.shadowRoot?.querySelector(`svg`);e&&(this.ariaLabel?(e.removeAttribute(`aria-hidden`),e.setAttribute(`aria-label`,this.ariaLabel)):(e.removeAttribute(`aria-label`),e.setAttribute(`aria-hidden`,`true`)))}render(){return this._icon??b}};E([S({type:String,reflect:!0})],L.prototype,`name`,void 0),E([S({type:String,reflect:!0})],L.prototype,`size`,void 0),E([S({type:String})],L.prototype,`ariaLabel`,void 0),E([C()],L.prototype,`_icon`,void 0),x();var Zp=u`:host([variant=success]) .alert{background-color:var(--sgds-success-surface-default)}:host([variant=warning]) .alert{--sgds-alert-color:var(--sgds-color-fixed-dark);background-color:var(--sgds-warning-surface-default)}:host([variant=danger]) .alert{background-color:var(--sgds-danger-surface-default)}:host([variant=neutral]) .alert{background-color:var(--sgds-neutral-surface-emphasis)}:host([variant=success][outlined]) .alert{background-color:var(--sgds-success-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-success-border-color-muted)}:host([variant=warning][outlined]) .alert{background-color:var(--sgds-warning-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-warning-border-color-muted)}:host([variant=danger][outlined]) .alert{background-color:var(--sgds-danger-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-danger-border-color-muted)}:host([variant=neutral][outlined]) .alert{background-color:var(--sgds-neutral-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-neutral-border-color-muted)}:host([outlined]) .alert-icon__outlined::slotted(*){color:var(--sgds-primary-color-fixed-dark)}:host([variant=success][outlined]) .alert-icon__outlined::slotted(*){color:var(--sgds-success-color-fixed-dark)}:host([variant=warning][outlined]) .alert-icon__outlined::slotted(*){color:var(--sgds-warning-color-fixed-light)}:host([variant=danger][outlined]) .alert-icon__outlined::slotted(*){color:var(--sgds-danger-color-fixed-dark)}:host([variant=neutral][outlined]) .alert-icon__outlined::slotted(*){color:var(--sgds-color-fixed-dark)}.alert{--sgds-alert-color:var(--sgds-color-fixed-light);background-color:var(--sgds-primary-surface-default);border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-border-radius-md);color:var(--sgds-alert-color);display:flex;flex-direction:row;gap:var(--sgds-gap-sm);padding:var(--sgds-padding-lg);position:relative}.alert.outlined{--sgds-alert-color:var(--sgds-color-fixed-dark);background-color:var(--sgds-primary-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-primary-border-color-muted)}.alert-content{align-items:flex-start;display:flex;flex:1 0 0;flex-direction:column;gap:var(--sgds-gap-md);padding-right:var(--sgds-padding-2-xl)}.alert-content__upper{display:flex;flex-direction:column;gap:var(--sgds-gap-2-xs)}.alert-title{font-size:var(--sgds-font-size-subtitle-sm);font-style:normal;font-weight:var(--sgds-font-weight-semibold);line-height:var(--sgds-line-height-2-xs)}.alert-content__description{display:inline;font-size:var(--sgds-font-size-label-sm);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-2-xs)}.alert-content__description::slotted(*){font-size:var(--sgds-font-size-label-sm);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-2-xs)}.alert-content__description::slotted(a),.alert-content__description::slotted(a:hover){color:inherit!important}.alert-content__description::slotted(a:focus-visible){outline:var(--sgds-outline-focus)!important;outline-offset:var(--sgds-outline-offset-focus)!important}.alert sgds-close-button{position:absolute;right:14px;top:14px}`;x();var Qp=class extends D{constructor(...e){super(...e),this.show=!1,this.dismissible=!1,this.variant=`info`,this.outlined=!1,this.title=``}static{this.styles=[...D.styles,Zp]}static{this.dependencies={"sgds-close-button":kt,"sgds-icon":L}}close(){this.show=!1}_handleShowChange(){this.show?this.emit(`sgds-show`):this.emit(`sgds-hide`)}render(){return this.dismissible&&this.show||!this.dismissible?I`
|
|
2398
|
+
`}));let Jp={announcement:()=>Promise.resolve().then(()=>(Mt(),At)),archive:()=>Promise.resolve().then(()=>(Ft(),Nt)),"arrow-bar-down":()=>Promise.resolve().then(()=>(Rt(),It)),"arrow-bar-left":()=>Promise.resolve().then(()=>(Vt(),zt)),"arrow-bar-right":()=>Promise.resolve().then(()=>(Wt(),Ht)),"arrow-bar-up":()=>Promise.resolve().then(()=>(qt(),Gt)),"arrow-circle-down":()=>Promise.resolve().then(()=>(Xt(),Jt)),"arrow-circle-left":()=>Promise.resolve().then(()=>($t(),Zt)),"arrow-circle-right":()=>Promise.resolve().then(()=>(nn(),en)),"arrow-circle-up":()=>Promise.resolve().then(()=>(on(),rn)),"arrow-clockwise":()=>Promise.resolve().then(()=>(ln(),sn)),"arrow-down":()=>Promise.resolve().then(()=>(fn(),un)),"arrow-left":()=>Promise.resolve().then(()=>(hn(),pn)),"arrow-repeat":()=>Promise.resolve().then(()=>(vn(),gn)),"arrow-right":()=>Promise.resolve().then(()=>(xn(),yn)),"arrow-square-down":()=>Promise.resolve().then(()=>(wn(),Sn)),"arrow-square-left":()=>Promise.resolve().then(()=>(Dn(),Tn)),"arrow-square-right":()=>Promise.resolve().then(()=>(An(),On)),"arrow-square-up":()=>Promise.resolve().then(()=>(Nn(),jn)),"arrow-up":()=>Promise.resolve().then(()=>(In(),Pn)),"bank-fill":()=>Promise.resolve().then(()=>(zn(),Ln)),"bell-slash":()=>Promise.resolve().then(()=>(Hn(),Bn)),bell:()=>Promise.resolve().then(()=>(Gn(),Un)),"bi-funnel":()=>Promise.resolve().then(()=>(Jn(),Kn)),"bookmark-fill":()=>Promise.resolve().then(()=>(Zn(),Yn)),bookmark:()=>Promise.resolve().then(()=>(er(),Qn)),"box-arrow-up-right":()=>Promise.resolve().then(()=>(rr(),tr)),"box-seam":()=>Promise.resolve().then(()=>(or(),ir)),building:()=>Promise.resolve().then(()=>(lr(),sr)),bus:()=>Promise.resolve().then(()=>(fr(),ur)),calculator:()=>Promise.resolve().then(()=>(hr(),pr)),"calendar-check":()=>Promise.resolve().then(()=>(vr(),gr)),"calendar-heart":()=>Promise.resolve().then(()=>(xr(),yr)),"calendar-x":()=>Promise.resolve().then(()=>(wr(),Sr)),calendar:()=>Promise.resolve().then(()=>(Dr(),Tr)),camera:()=>Promise.resolve().then(()=>(Ar(),Or)),car:()=>Promise.resolve().then(()=>(Nr(),jr)),"chat-dots":()=>Promise.resolve().then(()=>(Ir(),Pr)),"chat-left-text":()=>Promise.resolve().then(()=>(zr(),Lr)),chat:()=>Promise.resolve().then(()=>(Hr(),Br)),"check-circle-fill":()=>Promise.resolve().then(()=>(Gr(),Ur)),"check-circle":()=>Promise.resolve().then(()=>(Jr(),Kr)),check:()=>Promise.resolve().then(()=>(Zr(),Yr)),"chevron-down":()=>Promise.resolve().then(()=>(ei(),Qr)),"chevron-left":()=>Promise.resolve().then(()=>(ri(),ti)),"chevron-right":()=>Promise.resolve().then(()=>(oi(),ii)),"chevron-selector-vertical":()=>Promise.resolve().then(()=>(li(),si)),"chevron-up":()=>Promise.resolve().then(()=>(fi(),ui)),clock:()=>Promise.resolve().then(()=>(hi(),pi)),"cloud-check":()=>Promise.resolve().then(()=>(vi(),gi)),"cloud-download":()=>Promise.resolve().then(()=>(xi(),yi)),"cloud-upload":()=>Promise.resolve().then(()=>(wi(),Si)),cloud:()=>Promise.resolve().then(()=>(Di(),Ti)),"code-square":()=>Promise.resolve().then(()=>(Ai(),Oi)),"coins-hand":()=>Promise.resolve().then(()=>(Ni(),ji)),compass:()=>Promise.resolve().then(()=>(Ii(),Pi)),copy:()=>Promise.resolve().then(()=>(zi(),Li)),"cpu-chip-ai":()=>Promise.resolve().then(()=>(Hi(),Bi)),cross:()=>Promise.resolve().then(()=>(Gi(),Ui)),"cursor-fill":()=>Promise.resolve().then(()=>(Ji(),Ki)),cursor:()=>Promise.resolve().then(()=>(Zi(),Yi)),"dash-circle":()=>Promise.resolve().then(()=>(ea(),Qi)),"dash-square":()=>Promise.resolve().then(()=>(ra(),ta)),dash:()=>Promise.resolve().then(()=>(oa(),ia)),database:()=>Promise.resolve().then(()=>(la(),sa)),dataflow:()=>Promise.resolve().then(()=>(fa(),ua)),download:()=>Promise.resolve().then(()=>(ha(),pa)),edit:()=>Promise.resolve().then(()=>(va(),ga)),"exclamation-circle-fill":()=>Promise.resolve().then(()=>(xa(),ya)),"exclamation-circle":()=>Promise.resolve().then(()=>(wa(),Sa)),"exclamation-triangle-fill":()=>Promise.resolve().then(()=>(Da(),Ta)),"exclamation-triangle":()=>Promise.resolve().then(()=>(Aa(),Oa)),exclamation:()=>Promise.resolve().then(()=>(Na(),ja)),"eye-fill":()=>Promise.resolve().then(()=>(Ia(),Pa)),"eye-slash-fill":()=>Promise.resolve().then(()=>(za(),La)),"eye-slash":()=>Promise.resolve().then(()=>(Ha(),Ba)),eye:()=>Promise.resolve().then(()=>(Ga(),Ua)),"face-smile-fill":()=>Promise.resolve().then(()=>(Ja(),Ka)),"face-smile":()=>Promise.resolve().then(()=>(Za(),Ya)),facebook:()=>Promise.resolve().then(()=>(eo(),Qa)),"file-earmark-text":()=>Promise.resolve().then(()=>(ro(),to)),"file-pdf":()=>Promise.resolve().then(()=>(oo(),io)),"file-plus":()=>Promise.resolve().then(()=>(lo(),so)),"file-text":()=>Promise.resolve().then(()=>(po(),uo)),file:()=>Promise.resolve().then(()=>(go(),mo)),files:()=>Promise.resolve().then(()=>(yo(),_o)),fingerprint:()=>Promise.resolve().then(()=>(So(),bo)),flash:()=>Promise.resolve().then(()=>(To(),Co)),"folder-check":()=>Promise.resolve().then(()=>(Oo(),Eo)),"folder-minus":()=>Promise.resolve().then(()=>(jo(),ko)),"folder-plus":()=>Promise.resolve().then(()=>(Po(),Mo)),folder:()=>Promise.resolve().then(()=>(Lo(),Fo)),gear:()=>Promise.resolve().then(()=>(Bo(),Ro)),"geo-alt":()=>Promise.resolve().then(()=>(Uo(),Vo)),"geo-fill":()=>Promise.resolve().then(()=>(Ko(),Wo)),geo:()=>Promise.resolve().then(()=>(Yo(),qo)),"globe-alt":()=>Promise.resolve().then(()=>(Qo(),Xo)),globe:()=>Promise.resolve().then(()=>(ts(),$o)),google:()=>Promise.resolve().then(()=>(is(),ns)),"grid-alt":()=>Promise.resolve().then(()=>(ss(),as)),"grid-fill":()=>Promise.resolve().then(()=>(us(),cs)),"hand-thumbs-down":()=>Promise.resolve().then(()=>(ps(),ds)),"hand-thumbs-up":()=>Promise.resolve().then(()=>(gs(),ms)),"hard-drive":()=>Promise.resolve().then(()=>(ys(),_s)),heart:()=>Promise.resolve().then(()=>(Ss(),bs)),"house-door":()=>Promise.resolve().then(()=>(Ts(),Cs)),house:()=>Promise.resolve().then(()=>(Os(),Es)),image:()=>Promise.resolve().then(()=>(js(),ks)),"in-box":()=>Promise.resolve().then(()=>(Ps(),Ms)),"info-circle-fill":()=>Promise.resolve().then(()=>(Ls(),Fs)),"info-circle":()=>Promise.resolve().then(()=>(Bs(),Rs)),instagram:()=>Promise.resolve().then(()=>(Us(),Vs)),key:()=>Promise.resolve().then(()=>(Ks(),Ws)),"laptop-gear":()=>Promise.resolve().then(()=>(Ys(),qs)),laptop:()=>Promise.resolve().then(()=>(Qs(),Xs)),layers:()=>Promise.resolve().then(()=>(tc(),$s)),"layout-text-window-reverse":()=>Promise.resolve().then(()=>(ic(),nc)),"layout-text-window":()=>Promise.resolve().then(()=>(sc(),ac)),layout:()=>Promise.resolve().then(()=>(uc(),cc)),"life-buoy":()=>Promise.resolve().then(()=>(pc(),dc)),lightbulb:()=>Promise.resolve().then(()=>(gc(),mc)),link:()=>Promise.resolve().then(()=>(yc(),_c)),linkedin:()=>Promise.resolve().then(()=>(Sc(),bc)),list:()=>Promise.resolve().then(()=>(Tc(),Cc)),"lock-fill":()=>Promise.resolve().then(()=>(Oc(),Ec)),lock:()=>Promise.resolve().then(()=>(jc(),kc)),login:()=>Promise.resolve().then(()=>(Pc(),Mc)),logout:()=>Promise.resolve().then(()=>(Lc(),Fc)),luggage:()=>Promise.resolve().then(()=>(Bc(),Rc)),"mail-open":()=>Promise.resolve().then(()=>(Uc(),Vc)),mail:()=>Promise.resolve().then(()=>(Kc(),Wc)),map:()=>Promise.resolve().then(()=>(Yc(),qc)),meetup:()=>Promise.resolve().then(()=>(Qc(),Xc)),menu:()=>Promise.resolve().then(()=>(tl(),$c)),microphone:()=>Promise.resolve().then(()=>(il(),nl)),monitor:()=>Promise.resolve().then(()=>(sl(),al)),moon:()=>Promise.resolve().then(()=>(ul(),cl)),move:()=>Promise.resolve().then(()=>(pl(),dl)),paperclip:()=>Promise.resolve().then(()=>(gl(),ml)),passcode:()=>Promise.resolve().then(()=>(yl(),_l)),passport:()=>Promise.resolve().then(()=>(Sl(),bl)),pause:()=>Promise.resolve().then(()=>(Tl(),Cl)),pencil:()=>Promise.resolve().then(()=>(Ol(),El)),"pending-circle":()=>Promise.resolve().then(()=>(jl(),kl)),"person-dash":()=>Promise.resolve().then(()=>(Pl(),Ml)),"person-plus":()=>Promise.resolve().then(()=>(Ll(),Fl)),"person-x":()=>Promise.resolve().then(()=>(Bl(),Rl)),person:()=>Promise.resolve().then(()=>(Ul(),Vl)),phone:()=>Promise.resolve().then(()=>(Kl(),Wl)),"pin-map-fill":()=>Promise.resolve().then(()=>(Yl(),ql)),pin:()=>Promise.resolve().then(()=>(Ql(),Xl)),placeholder:()=>Promise.resolve().then(()=>(tu(),$l)),plane:()=>Promise.resolve().then(()=>(iu(),nu)),play:()=>Promise.resolve().then(()=>(su(),au)),"plus-circle":()=>Promise.resolve().then(()=>(uu(),cu)),"plus-square":()=>Promise.resolve().then(()=>(pu(),du)),plus:()=>Promise.resolve().then(()=>(gu(),mu)),printer:()=>Promise.resolve().then(()=>(yu(),_u)),"question-circle":()=>Promise.resolve().then(()=>(Su(),bu)),rocket:()=>Promise.resolve().then(()=>(Tu(),Cu)),save:()=>Promise.resolve().then(()=>(Ou(),Eu)),search:()=>Promise.resolve().then(()=>(ju(),ku)),send:()=>Promise.resolve().then(()=>(Pu(),Mu)),"sg-crest":()=>Promise.resolve().then(()=>(Lu(),Fu)),share:()=>Promise.resolve().then(()=>(Bu(),Ru)),"shield-tick":()=>Promise.resolve().then(()=>(Uu(),Vu)),"sidebar-collapse":()=>Promise.resolve().then(()=>(Ku(),Wu)),"sidebar-expand":()=>Promise.resolve().then(()=>(Yu(),qu)),"slash-circle":()=>Promise.resolve().then(()=>(Qu(),Xu)),"slash-divider":()=>Promise.resolve().then(()=>(td(),$u)),sliders:()=>Promise.resolve().then(()=>(id(),nd)),"sort-ascending":()=>Promise.resolve().then(()=>(sd(),ad)),"sort-descending":()=>Promise.resolve().then(()=>(ud(),cd)),speedometer:()=>Promise.resolve().then(()=>(pd(),dd)),"star-ai":()=>Promise.resolve().then(()=>(gd(),md)),"star-fill":()=>Promise.resolve().then(()=>(yd(),_d)),star:()=>Promise.resolve().then(()=>(Sd(),bd)),stoplights:()=>Promise.resolve().then(()=>(Td(),Cd)),sun:()=>Promise.resolve().then(()=>(Od(),Ed)),"switch-horizontal":()=>Promise.resolve().then(()=>(jd(),kd)),"switch-vertical":()=>Promise.resolve().then(()=>(Pd(),Md)),tablet:()=>Promise.resolve().then(()=>(Ld(),Fd)),telegram:()=>Promise.resolve().then(()=>(Bd(),Rd)),telephone:()=>Promise.resolve().then(()=>(Ud(),Vd)),"three-dots-vertical":()=>Promise.resolve().then(()=>(Kd(),Wd)),"three-dots":()=>Promise.resolve().then(()=>(Yd(),qd)),ticket:()=>Promise.resolve().then(()=>(Qd(),Xd)),"toggle-off":()=>Promise.resolve().then(()=>(tf(),$d)),"toggle-on":()=>Promise.resolve().then(()=>(af(),nf)),train:()=>Promise.resolve().then(()=>(cf(),of)),translate:()=>Promise.resolve().then(()=>(df(),lf)),trash:()=>Promise.resolve().then(()=>(mf(),ff)),"trend-down":()=>Promise.resolve().then(()=>(_f(),hf)),"trend-up":()=>Promise.resolve().then(()=>(bf(),vf)),truck:()=>Promise.resolve().then(()=>(Cf(),xf)),"twitter-x":()=>Promise.resolve().then(()=>(Ef(),wf)),unlock:()=>Promise.resolve().then(()=>(kf(),Df)),upload:()=>Promise.resolve().then(()=>(Mf(),Af)),"user-check":()=>Promise.resolve().then(()=>(Ff(),Nf)),"user-circle":()=>Promise.resolve().then(()=>(Rf(),If)),"user-pause":()=>Promise.resolve().then(()=>(Vf(),zf)),"user-square":()=>Promise.resolve().then(()=>(Wf(),Hf)),users:()=>Promise.resolve().then(()=>(qf(),Gf)),"video-recorder":()=>Promise.resolve().then(()=>(Xf(),Jf)),"volume-max":()=>Promise.resolve().then(()=>($f(),Zf)),"volume-x":()=>Promise.resolve().then(()=>(np(),ep)),"window-dash":()=>Promise.resolve().then(()=>(ap(),rp)),"window-desktop":()=>Promise.resolve().then(()=>(cp(),op)),"window-dock":()=>Promise.resolve().then(()=>(dp(),lp)),"window-fullscreen":()=>Promise.resolve().then(()=>(mp(),fp)),"window-plus":()=>Promise.resolve().then(()=>(_p(),hp)),"window-sidebar":()=>Promise.resolve().then(()=>(bp(),vp)),"window-split":()=>Promise.resolve().then(()=>(Cp(),xp)),"window-stack":()=>Promise.resolve().then(()=>(Ep(),wp)),"window-x":()=>Promise.resolve().then(()=>(kp(),Dp)),window:()=>Promise.resolve().then(()=>(Mp(),Ap)),"xcircle-fill":()=>Promise.resolve().then(()=>(Fp(),Np)),xcircle:()=>Promise.resolve().then(()=>(Rp(),Ip)),youtube:()=>Promise.resolve().then(()=>(Vp(),zp)),"zoom-in":()=>Promise.resolve().then(()=>(Wp(),Hp)),"zoom-out":()=>Promise.resolve().then(()=>(qp(),Gp))};x();var Yp=u`:host{color:inherit;display:inline-flex;vertical-align:bottom}:host(.icon-left){margin-right:.25rem}:host(.icon-right){margin-left:.25rem}:host([size=xs]) svg{height:var(--sgds-icon-size-xs);width:var(--sgds-icon-size-xs)}:host([size=sm]) svg{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}:host([size=md]) svg{height:var(--sgds-icon-size-md);width:var(--sgds-icon-size-md)}:host([size=xl]) svg{height:var(--sgds-icon-size-xl);width:var(--sgds-icon-size-xl)}:host([size="2-xl"]) svg{height:var(--sgds-icon-size-2-xl);width:var(--sgds-icon-size-2-xl)}:host([size="3-xl"]) svg{height:var(--sgds-icon-size-3-xl);width:var(--sgds-icon-size-3-xl)}svg{display:inline-block;height:var(--sgds-icon-size-lg);width:var(--sgds-icon-size-lg)}`;x();let Xp=/* @__PURE__ */ new Map;var L=class extends D{constructor(...e){super(...e),this.size=`lg`}static{this.styles=[...D.styles,Yp]}willUpdate(e){e.has(`name`)&&this._loadIcon(this.name)}async _loadIcon(e){if(!e){this._icon=void 0;return}if(Xp.has(e)){this._icon=Xp.get(e);return}let t=Jp[e];if(!t){console.warn(`Icon not found: ${e}`),this._icon=void 0;return}try{let n=await t();Xp.set(e,n.default),this._icon=n.default}catch{console.warn(`Failed to load icon: ${e}`),this._icon=void 0}}updated(){let e=this.shadowRoot?.querySelector(`svg`);e&&(this.ariaLabel?(e.removeAttribute(`aria-hidden`),e.setAttribute(`aria-label`,this.ariaLabel)):(e.removeAttribute(`aria-label`),e.setAttribute(`aria-hidden`,`true`)))}render(){return this._icon??b}};E([S({type:String,reflect:!0})],L.prototype,`name`,void 0),E([S({type:String,reflect:!0})],L.prototype,`size`,void 0),E([S({type:String})],L.prototype,`ariaLabel`,void 0),E([C()],L.prototype,`_icon`,void 0),x();var Zp=u`:host([variant=success]) .alert{background-color:var(--sgds-success-surface-default)}:host([variant=warning]) .alert{--sgds-alert-color:var(--sgds-color-fixed-dark);background-color:var(--sgds-warning-surface-default)}:host([variant=danger]) .alert{background-color:var(--sgds-danger-surface-default)}:host([variant=neutral]) .alert{background-color:var(--sgds-neutral-surface-emphasis)}:host([variant=success][outlined]) .alert{background-color:var(--sgds-success-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-success-border-color-muted)}:host([variant=warning][outlined]) .alert{background-color:var(--sgds-warning-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-warning-border-color-muted)}:host([variant=danger][outlined]) .alert{background-color:var(--sgds-danger-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-danger-border-color-muted)}:host([variant=neutral][outlined]) .alert{background-color:var(--sgds-neutral-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-neutral-border-color-muted)}:host([outlined]) .alert-icon__outlined::slotted(*){color:var(--sgds-primary-color-default)}:host([variant=success][outlined]) .alert-icon__outlined::slotted(*){color:var(--sgds-success-color-default)}:host([variant=warning][outlined]) .alert-icon__outlined::slotted(*){color:var(--sgds-warning-color-fixed-light)}:host([variant=danger][outlined]) .alert-icon__outlined::slotted(*){color:var(--sgds-danger-color-default)}:host([variant=neutral][outlined]) .alert-icon__outlined::slotted(*){color:var(--sgds-body-color-default)}.alert{--sgds-alert-color:var(--sgds-color-fixed-light);background-color:var(--sgds-primary-surface-default);border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-border-radius-md);color:var(--sgds-alert-color);display:flex;flex-direction:row;gap:var(--sgds-gap-sm);padding:var(--sgds-padding-lg);position:relative}:host([outlined]) .alert{--sgds-alert-color:var(--sgds-body-color-default);background-color:var(--sgds-primary-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-primary-border-color-muted)}.alert-content{align-items:flex-start;display:flex;flex:1 0 0;flex-direction:column;gap:var(--sgds-gap-md);padding-right:var(--sgds-padding-2-xl)}.alert-content__upper{display:flex;flex-direction:column;gap:var(--sgds-gap-2-xs)}.alert-title{font-size:var(--sgds-font-size-subtitle-sm);font-style:normal;font-weight:var(--sgds-font-weight-semibold);line-height:var(--sgds-line-height-2-xs)}.alert-content__description{display:inline;font-size:var(--sgds-font-size-label-sm);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-2-xs)}.alert-content__description::slotted(*){font-size:var(--sgds-font-size-label-sm);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-2-xs)}.alert-content__description::slotted(a),.alert-content__description::slotted(a:hover){color:inherit!important}.alert-content__description::slotted(a:focus-visible){outline:var(--sgds-outline-focus)!important;outline-offset:var(--sgds-outline-offset-focus)!important}.alert sgds-close-button{position:absolute;right:14px;top:14px}`;x();var Qp=class extends D{constructor(...e){super(...e),this.show=!1,this.dismissible=!1,this.variant=`info`,this.outlined=!1,this.title=``}static{this.styles=[...D.styles,Zp]}static{this.dependencies={"sgds-close-button":kt,"sgds-icon":L}}close(){this.show=!1}_handleShowChange(){this.show?this.emit(`sgds-show`):this.emit(`sgds-hide`)}render(){return this.dismissible&&this.show||!this.dismissible?I`
|
|
2399
2399
|
<div
|
|
2400
2400
|
class="${O({alert:!0,show:this.show,"alert-dismissible":this.dismissible,outlined:this.outlined})}"
|
|
2401
2401
|
role="alert"
|
|
@@ -2412,7 +2412,7 @@ let St=Symbol.for(``),Ct=e=>{if(e?.r===St)return e?._$litStatic$},wt=(e,...t)=>(
|
|
|
2412
2412
|
${this.dismissible?I`<sgds-close-button
|
|
2413
2413
|
aria-label="close the alert"
|
|
2414
2414
|
@click=${this.close}
|
|
2415
|
-
tone
|
|
2415
|
+
tone="default"
|
|
2416
2416
|
></sgds-close-button>`:b}
|
|
2417
2417
|
</div>
|
|
2418
2418
|
`:b}};E([S({type:Boolean,reflect:!0})],Qp.prototype,`show`,void 0),E([S({type:Boolean,reflect:!0})],Qp.prototype,`dismissible`,void 0),E([S({type:String,reflect:!0})],Qp.prototype,`variant`,void 0),E([S({type:Boolean,reflect:!0})],Qp.prototype,`outlined`,void 0),E([S({type:String,reflect:!0})],Qp.prototype,`title`,void 0),E([F(`show`)],Qp.prototype,`_handleShowChange`,null);function $p(e){if(!e)return e;let t=e.trim().toLowerCase();if(!(t.startsWith(`javascript:`)||t.startsWith(`data:`)||t.startsWith(`vbscript:`)))return e}x();var em=u`:host{cursor:pointer;display:inline-block}.alert-link,.alert-link:hover{color:var(--sgds-alert-color);font-size:var(--sgds-font-size-label-sm);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-2-xs);text-decoration-line:underline}.alert-link:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}`;x();var tm=u`::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath fill='%230e0e0e' fill-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4M12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6' clip-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath fill='%230e0e0e' fill-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4M12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:top;width:1em}`,nm=class extends D{static{this.styles=[...D.styles,tm,em]}render(){return I`
|
|
@@ -2458,7 +2458,7 @@ super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTa
|
|
|
2458
2458
|
* @license
|
|
2459
2459
|
* Copyright 2022 Google LLC
|
|
2460
2460
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2461
|
-
*/function um({context:e,subscribe:t}){return(n,r)=>{typeof r==`object`?r.addInitializer((function(){new am(this,{context:e,callback:e=>{n.set.call(this,e)},subscribe:t})})):n.constructor.addInitializer((n=>{new am(n,{context:e,callback:e=>{n[r]=e},subscribe:t})}))}}let dm=1024,fm=1280;function pm(e=``,t=``){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}x();var mm=u`:host{--btn-font-weight:var(--sgds-font-weight-regular);--btn-color:var(--sgds-color-fixed-light);--btn-bg:var(--sgds-primary-surface-default);--btn-hover-bg:var(--sgds-primary-surface-emphasis);--btn-border-radius:var(--sgds-border-radius-md);--btn-opacity:var(--sgds-opacity-100,1)}:host([variant=danger]){--btn-bg:var(--sgds-danger-surface-default);--btn-hover-bg:var(--sgds-danger-surface-emphasis);--btn-color:var(--sgds-color-fixed-light)}:host([variant=primary][tone=brand]){--btn-bg:var(--sgds-primary-surface-default);--btn-color:var(--sgds-color-fixed-light)}:host([variant=outline]){--btn-border-width:var(--sgds-border-width-1)}:host([variant=outline][tone=brand]){--btn-border-color:var(--sgds-primary-border-color-default);--btn-bg:var(--sgds-bg-transparent);--btn-color:var(--sgds-primary-color-default);--btn-hover-bg:var(--sgds-primary-bg-translucent)}:host([variant=ghost][tone=brand]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-primary-surface-translucent);--btn-color:var(--sgds-primary-color-default)}:host([variant=primary][tone=danger]){--btn-bg:var(--sgds-danger-surface-default);--btn-hover-bg:var(--sgds-danger-surface-emphasis);--btn-color:var(--sgds-color-fixed-light)}:host([variant=outline][tone=danger]){--btn-border-color:var(--sgds-danger-border-color-default);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-danger-surface-translucent);--btn-color:var(--sgds-danger-color-default)}:host([variant=ghost][tone=danger]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-danger-surface-translucent);--btn-color:var(--sgds-danger-color-default)}:host([variant=primary][tone=fixed-light]){--btn-bg:var(--sgds-surface-fixed-light);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark,hsla(0,0%,5%,.2)) 0%,var(--sgds-bg-translucent-fixed-dark,hsla(0,0%,5%,.2)) 100%),var(--sgds-surface-fixed-light,#fff);--btn-color:var(--sgds-color-fixed-dark)}:host([variant=outline][tone=fixed-light]){--btn-border-color:var(--sgds-border-color-fixed-light);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark) 0%,var(--sgds-bg-translucent-fixed-dark) 100%),var(--sgds-bg-transparent);--btn-color:var(--sgds-color-fixed-light)}:host([variant=ghost][tone=fixed-light]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark) 0%,var(--sgds-bg-translucent-fixed-dark) 100%),var(--sgds-bg-transparent);--btn-color:var(--sgds-color-fixed-light)}:host([variant=primary][tone=neutral]){--btn-bg:var(--sgds-surface-inverse);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-inverse) 0%,var(--sgds-bg-translucent-inverse) 100%),var(--sgds-surface-inverse);--btn-color:var(--sgds-color-inverse)}:host([variant=outline][tone=neutral]){--btn-border-color:var(--sgds-border-color-emphasis);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-inverse) 0%,var(--sgds-bg-translucent-inverse) 100%),var(--sgds-bg-translucent-subtle);--btn-color:var(--sgds-color-default)}:host([variant=ghost][tone=neutral]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-bg-translucent-subtle);--btn-color:var(--sgds-color-default)}:host([variant=ghost]) .btn,:host([variant=outline]) .btn,:host([variant=primary]) .btn{color:var(--btn-color)}:host([variant=outline]) .btn{border:var(--btn-border-width) solid var(--btn-border-color)}:host([size=lg]) .btn{font-size:var(--sgds-font-size-label-lg);height:var(--sgds-dimension-56);line-height:var(--sgds-line-height-md);min-width:var(--sgds-dimension-112);padding:var(--sgds-padding-none) var(--sgds-padding-xl)}:host([size=sm]) .btn{font-size:var(--sgds-font-size-label-sm);height:var(--sgds-dimension-40);line-height:var(--sgds-line-height-2-xs);min-width:var(--sgds-dimension-80);padding:var(--sgds-padding-none) var(--sgds-padding-md)}:host([size=xs]) .btn{font-size:var(--sgds-font-size-label-xs);height:var(--sgds-dimension-32);line-height:var(--sgds-line-height-3-xs);min-width:var(--sgds-dimension-64);padding:var(--sgds-padding-none) var(--sgds-padding-sm)}.btn{align-items:center;background-color:var(--btn-bg);border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--btn-border-radius);color:var(--sgds-color-fixed-light);cursor:pointer;display:inline-flex;font-size:var(--sgds-font-size-label-md);font-weight:var(--btn-font-weight);gap:var(--sgds-gap-2-xs);height:var(--sgds-dimension-48);justify-content:center;line-height:var(--sgds-line-height-xs);min-width:var(--sgds-dimension-96);opacity:var(--btn-opacity);padding:var(--sgds-padding-none) var(--sgds-padding-lg);text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;user-select:none;vertical-align:middle;white-space:nowrap;width:inherit}.btn.active,.btn:hover{background:var(--btn-hover-bg)}.btn:focus-visible{background:var(--btn-hover-bg);border-color:transparent;outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.btn.disabled,.btn:disabled{color:var(--btn-color);cursor:not-allowed;opacity:var(--sgds-opacity-40)}.btn.loading{cursor:default}.btn slot::slotted(*){color:var(--btn-color)}`,R=class extends D{constructor(...e){super(...e),this.variant=`primary`,this.tone=`brand`,this.size=`md`,this.active=!1,this.disabled=!1,this.target=`_self`}static{this.styles=[...D.styles,mm]}focus(e){this.button.focus(e)}click(){this.button.click()}blur(){this.button.blur()}_handleBlur(){this.emit(`sgds-blur`)}_handleFocus(){this.emit(`sgds-focus`)}_handleClick(e){if(this.disabled||this.loading){e.preventDefault(),e.stopPropagation();return}}_handleKeydown(e){if(e.key===`Enter`&&this.loading){e.preventDefault(),e.stopPropagation();return}}_assignSpinnerSize(e){if(e===`xs`||e===`sm`)return`xs`;if(e===`md`||e===`lg`)return`sm`}_assignSpinnerTone(e,t){return e===`fixed-light`&&t===`primary`?`fixed-dark`:e===`neutral`&&t===`primary`?`inverse`:e===`fixed-light`||t===`primary`?`fixed-light`:e===`neutral`&&(t===`outline`||t===`ghost`)?`neutral`:`brand`}};E([w(`.btn`)],R.prototype,`button`,void 0),E([S({reflect:!0})],R.prototype,`variant`,void 0),E([S({reflect:!0})],R.prototype,`tone`,void 0),E([S({reflect:!0})],R.prototype,`size`,void 0),E([S({type:Boolean,reflect:!0})],R.prototype,`active`,void 0),E([S({type:Boolean,reflect:!0})],R.prototype,`disabled`,void 0),E([S({type:String,reflect:!0})],R.prototype,`href`,void 0),E([S({type:String,reflect:!0})],R.prototype,`target`,void 0),E([S({type:String,reflect:!0})],R.prototype,`download`,void 0),E([S({type:String})],R.prototype,`ariaLabel`,void 0),E([S({type:Boolean})],R.prototype,`loading`,void 0),x();var hm=u`:host{--sgds-spinner-bg:var(--sgds-primary-surface-default);display:inline-flex}:host([variant=neutral]){--sgds-spinner-bg:var(--sgds-neutral-surface-default)}:host([tone=neutral]){--sgds-spinner-bg:var(--sgds-surface-inverse)}:host([tone=inverse]){--sgds-spinner-bg:var(--sgds-surface-default)}:host([tone=fixed-light]){--sgds-spinner-bg:var(--sgds-surface-fixed-light)}:host([tone=fixed-dark]){--sgds-spinner-bg:var(--sgds-surface-fixed-dark)}.spinner-wrapper{align-items:center;display:flex;flex-direction:column;gap:var(--sgds-gap-2-xs)}.spinner-wrapper.horizontal{flex-direction:row}.spinner{--border-thickness:4px;animation:spinner .75s linear infinite;border:var(--border-thickness) solid var(--sgds-bg-translucent);border-radius:50%;border-right:var(--border-thickness) solid var(--sgds-spinner-bg);color:var(--sgds-spinner-color);display:inline-flex;height:var(--sgds-dimension-32);width:var(--sgds-dimension-32)}.spinner-xs{--border-thickness:2px;height:var(--sgds-dimension-16);width:var(--sgds-dimension-16)}.spinner-sm{--border-thickness:3px;height:var(--sgds-dimension-24);width:var(--sgds-dimension-24)}.spinner-lg{--border-thickness:6px;height:var(--sgds-dimension-48);width:var(--sgds-dimension-48)}.spinner-xl{--border-thickness:8px;height:var(--sgds-dimension-64);width:var(--sgds-dimension-64)}.spinner-label{color:var(--sgds-neutral-color-default);font-size:var(--sgds-font-size-label-sm)}
|
|
2461
|
+
*/function um({context:e,subscribe:t}){return(n,r)=>{typeof r==`object`?r.addInitializer((function(){new am(this,{context:e,callback:e=>{n.set.call(this,e)},subscribe:t})})):n.constructor.addInitializer((n=>{new am(n,{context:e,callback:e=>{n[r]=e},subscribe:t})}))}}let dm=1024,fm=1280;function pm(e=``,t=``){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}x();var mm=u`:host{--btn-font-weight:var(--sgds-font-weight-regular);--btn-color:var(--sgds-color-fixed-light);--btn-bg:var(--sgds-primary-surface-default);--btn-hover-bg:var(--sgds-primary-surface-emphasis);--btn-border-radius:var(--sgds-border-radius-md);--btn-opacity:var(--sgds-opacity-100,1)}:host([variant=danger]){--btn-bg:var(--sgds-danger-surface-default);--btn-hover-bg:var(--sgds-danger-surface-emphasis);--btn-color:var(--sgds-color-fixed-light)}:host([variant=primary][tone=brand]){--btn-bg:var(--sgds-primary-surface-default);--btn-color:var(--sgds-color-fixed-light)}:host([variant=outline]){--btn-border-width:var(--sgds-border-width-1)}:host([variant=outline][tone=brand]){--btn-border-color:var(--sgds-primary-border-color-default);--btn-bg:var(--sgds-bg-transparent);--btn-color:var(--sgds-primary-color-default);--btn-hover-bg:var(--sgds-primary-bg-translucent)}:host([variant=ghost][tone=brand]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-primary-surface-translucent);--btn-color:var(--sgds-primary-color-default)}:host([variant=primary][tone=danger]){--btn-bg:var(--sgds-danger-surface-default);--btn-hover-bg:var(--sgds-danger-surface-emphasis);--btn-color:var(--sgds-color-fixed-light)}:host([variant=outline][tone=danger]){--btn-border-color:var(--sgds-danger-border-color-default);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-danger-surface-translucent);--btn-color:var(--sgds-danger-color-default)}:host([variant=ghost][tone=danger]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-danger-surface-translucent);--btn-color:var(--sgds-danger-color-default)}:host([variant=primary][tone=fixed-light]){--btn-bg:var(--sgds-surface-fixed-light);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark,hsla(0,0%,5%,.2)) 0%,var(--sgds-bg-translucent-fixed-dark,hsla(0,0%,5%,.2)) 100%),var(--sgds-surface-fixed-light,#fff);--btn-color:var(--sgds-color-fixed-dark)}:host([variant=outline][tone=fixed-light]){--btn-border-color:var(--sgds-border-color-fixed-light);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark) 0%,var(--sgds-bg-translucent-fixed-dark) 100%),var(--sgds-bg-transparent);--btn-color:var(--sgds-color-fixed-light)}:host([variant=ghost][tone=fixed-light]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark) 0%,var(--sgds-bg-translucent-fixed-dark) 100%),var(--sgds-bg-transparent);--btn-color:var(--sgds-color-fixed-light)}:host([variant=primary][tone=neutral]){--btn-bg:var(--sgds-surface-inverse);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-inverse) 0%,var(--sgds-bg-translucent-inverse) 100%),var(--sgds-surface-inverse);--btn-color:var(--sgds-color-inverse)}:host([variant=outline][tone=neutral]){--btn-border-color:var(--sgds-border-color-emphasis);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-inverse) 0%,var(--sgds-bg-translucent-inverse) 100%),var(--sgds-bg-translucent-subtle);--btn-color:var(--sgds-color-default)}:host([variant=ghost][tone=neutral]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-bg-translucent-subtle);--btn-color:var(--sgds-color-default)}:host([variant=ghost]) .btn,:host([variant=outline]) .btn,:host([variant=primary]) .btn{color:var(--btn-color)}:host([variant=outline]) .btn{border:var(--btn-border-width) solid var(--btn-border-color)}:host([size=lg]) .btn{font-size:var(--sgds-font-size-label-lg);height:var(--sgds-dimension-56);line-height:var(--sgds-line-height-md);min-width:var(--sgds-dimension-112);padding:var(--sgds-padding-none) var(--sgds-padding-xl)}:host([size=sm]) .btn{font-size:var(--sgds-font-size-label-sm);height:var(--sgds-dimension-40);line-height:var(--sgds-line-height-2-xs);min-width:var(--sgds-dimension-80);padding:var(--sgds-padding-none) var(--sgds-padding-md)}:host([size=xs]) .btn{font-size:var(--sgds-font-size-label-xs);height:var(--sgds-dimension-32);line-height:var(--sgds-line-height-3-xs);min-width:var(--sgds-dimension-64);padding:var(--sgds-padding-none) var(--sgds-padding-sm)}.btn{align-items:center;background-color:var(--btn-bg);border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--btn-border-radius);color:var(--sgds-color-fixed-light);cursor:pointer;display:inline-flex;font-size:var(--sgds-font-size-label-md);font-weight:var(--btn-font-weight);gap:var(--sgds-gap-2-xs);height:var(--sgds-dimension-48);justify-content:center;line-height:var(--sgds-line-height-xs);min-width:var(--sgds-dimension-96);opacity:var(--btn-opacity);padding:var(--sgds-padding-none) var(--sgds-padding-lg);position:relative;text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;user-select:none;vertical-align:middle;white-space:nowrap;width:inherit}.btn.active,.btn:hover{background:var(--btn-hover-bg)}.btn:focus-visible{background:var(--btn-hover-bg);border-color:transparent;outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}:host(:not([disabled])) .btn:active:after{background-color:var(--sgds-bg-translucent);border-radius:inherit;content:"";inset:0;position:absolute}.btn.disabled,.btn:disabled{color:var(--btn-color);cursor:not-allowed;opacity:var(--sgds-opacity-40)}.btn.loading{cursor:default}.btn slot::slotted(*){color:var(--btn-color)}`,R=class extends D{constructor(...e){super(...e),this.variant=`primary`,this.tone=`brand`,this.size=`md`,this.active=!1,this.disabled=!1,this.target=`_self`}static{this.styles=[...D.styles,mm]}focus(e){this.button.focus(e)}click(){this.button.click()}blur(){this.button.blur()}_handleBlur(){this.emit(`sgds-blur`)}_handleFocus(){this.emit(`sgds-focus`)}_handleClick(e){if(this.disabled||this.loading){e.preventDefault(),e.stopPropagation();return}}_handleKeydown(e){if(e.key===`Enter`&&this.loading){e.preventDefault(),e.stopPropagation();return}}_assignSpinnerSize(e){if(e===`xs`||e===`sm`)return`xs`;if(e===`md`||e===`lg`)return`sm`}_assignSpinnerTone(e,t){return e===`fixed-light`&&t===`primary`?`fixed-dark`:e===`neutral`&&t===`primary`?`inverse`:e===`fixed-light`||t===`primary`?`fixed-light`:e===`neutral`&&(t===`outline`||t===`ghost`)?`neutral`:`brand`}};E([w(`.btn`)],R.prototype,`button`,void 0),E([S({reflect:!0})],R.prototype,`variant`,void 0),E([S({reflect:!0})],R.prototype,`tone`,void 0),E([S({reflect:!0})],R.prototype,`size`,void 0),E([S({type:Boolean,reflect:!0})],R.prototype,`active`,void 0),E([S({type:Boolean,reflect:!0})],R.prototype,`disabled`,void 0),E([S({type:String,reflect:!0})],R.prototype,`href`,void 0),E([S({type:String,reflect:!0})],R.prototype,`target`,void 0),E([S({type:String,reflect:!0})],R.prototype,`download`,void 0),E([S({type:String})],R.prototype,`ariaLabel`,void 0),E([S({type:Boolean})],R.prototype,`loading`,void 0),x();var hm=u`:host{--sgds-spinner-bg:var(--sgds-primary-surface-default);display:inline-flex}:host([variant=neutral]){--sgds-spinner-bg:var(--sgds-neutral-surface-default)}:host([tone=neutral]){--sgds-spinner-bg:var(--sgds-surface-inverse)}:host([tone=inverse]){--sgds-spinner-bg:var(--sgds-surface-default)}:host([tone=fixed-light]){--sgds-spinner-bg:var(--sgds-surface-fixed-light)}:host([tone=fixed-dark]){--sgds-spinner-bg:var(--sgds-surface-fixed-dark)}.spinner-wrapper{align-items:center;display:flex;flex-direction:column;gap:var(--sgds-gap-2-xs)}.spinner-wrapper.horizontal{flex-direction:row}.spinner{--border-thickness:4px;animation:spinner .75s linear infinite;border:var(--border-thickness) solid var(--sgds-bg-translucent);border-radius:50%;border-right:var(--border-thickness) solid var(--sgds-spinner-bg);color:var(--sgds-spinner-color);display:inline-flex;height:var(--sgds-dimension-32);width:var(--sgds-dimension-32)}.spinner-xs{--border-thickness:2px;height:var(--sgds-dimension-16);width:var(--sgds-dimension-16)}.spinner-sm{--border-thickness:3px;height:var(--sgds-dimension-24);width:var(--sgds-dimension-24)}.spinner-lg{--border-thickness:6px;height:var(--sgds-dimension-48);width:var(--sgds-dimension-48)}.spinner-xl{--border-thickness:8px;height:var(--sgds-dimension-64);width:var(--sgds-dimension-64)}.spinner-label{color:var(--sgds-neutral-color-default);font-size:var(--sgds-font-size-label-sm)}
|
|
2462
2462
|
|
|
2463
2463
|
|
|
2464
2464
|
/*! CSS Used keyframes */@keyframes spinner{to{transform:rotate(1turn)}}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`;x();var gm=u`.text-primary{color:var(--sgds-primary-rgb)!important}.text-secondary{color:var(--sgds-secondary-rgb)!important}.text-success{color:var(--sgds-success-rgb)!important}.text-info{color:var(--sgds-info-rgb)!important}.text-warning{color:var(--sgds-warning-rgb)!important}.text-danger{color:var(--sgds-danger-rgb)!important}.text-light{color:var(--sgds-light-rgb)!important}.text-dark{color:var(--sgds-dark-rgb)!important}.text-muted{color:var(--sgds-secondary-color)!important}`;x();var _m=class extends D{constructor(...e){super(...e),this.variant=`primary`,this.tone=`brand`,this.size=`md`,this.orientation=`vertical`}static{this.styles=[...D.styles,gm,hm]}render(){return I`
|
|
@@ -2521,7 +2521,7 @@ super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTa
|
|
|
2521
2521
|
aria-expanded="${this.expanded}"
|
|
2522
2522
|
.ariaLabel=${`Toggle navigation`}
|
|
2523
2523
|
></sgds-icon-button>`}_handleProfileSlotChange(e){let t=e.target.assignedElements({flatten:!0});this._hasProfileSlotItems=t.length>0,t.forEach(e=>{e.setAttribute(`expand`,this.expand),e.setAttribute(`tone`,this.tone)})}render(){return this.breakpointReached=window.innerWidth<(this.expand===`always`?-1:this.expand===`never`?1/0:{sm:512,md:768,lg:1024,xl:1280,xxl:1440}[this.expand]),y`
|
|
2524
|
-
<nav>
|
|
2524
|
+
<nav aria-label="App navigation">
|
|
2525
2525
|
<div class="navbar ${this._expandClass()}">
|
|
2526
2526
|
<slot name="start" class=${O({"slot-empty":!this.hasStartSlot})}></slot>
|
|
2527
2527
|
<a class="navbar-brand" href=${$p(this.brandHref)??``} aria-label="brand-link">
|
|
@@ -2567,7 +2567,7 @@ let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),Fg(e,t);return
|
|
|
2567
2567
|
* @license
|
|
2568
2568
|
* Copyright 2020 Google LLC
|
|
2569
2569
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2570
|
-
*/let Hg=()=>new Ug;var Ug=class{};let Wg=/* @__PURE__ */ new WeakMap,Gg=ft(class extends Vg{render(e){return b}update(e,[t]){let n=t!==this.G;return n&&this.G!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),b}rt(e){if(this.isConnected||(e=void 0),typeof this.G==`function`){let t=this.ht??globalThis,n=Wg.get(t);n===void 0&&(n=/* @__PURE__ */ new WeakMap,Wg.set(t,n)),n.get(this.G)!==void 0&&this.G.call(this.ht,void 0),n.set(this.G,e),e!==void 0&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return typeof this.G==`function`?Wg.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var Kg=class extends D{constructor(...e){super(...e),this.myDropdown=Hg(),this.dropdownMenuId=pm(`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=Hg(),this._handleClickOutOfElement=e=>{this.menuIsOpen&&(e.composedPath().includes(this)||this.hideMenu(!0))}}connectedCallback(){super.connectedCallback(),this.close!==`inside`&&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(),void 0)}firstUpdated(e){super.firstUpdated(e),this.menuIsOpen&&requestAnimationFrame(async()=>{await this.updateFloatingPosition(),this._startAutoUpdate()})}async showMenu(){if(!(this.disabled||this.menuIsOpen)){if(this.menuIsOpen=!0,this.emit(`sgds-show`),await this.updateFloatingPosition(),this._startAutoUpdate(),this.menuRef.value){let e=(this.menuRef.value.getAttribute(`data-placement`)||``).startsWith(`top`)?`4px`:`-4px`,{options:t}=M(this,`dropdown.show`);await A(this.menuRef.value,[{opacity:0,transform:`translateY(${e})`},{opacity:1,transform:`translateY(0)`}],t)}this.emit(`sgds-after-show`)}}_startAutoUpdate(){this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=vg(this.myDropdown.value,this.menuRef.value,()=>this.updateFloatingPosition()))}async hideMenu(e){if(this.menuIsOpen){if(this.emit(`sgds-hide`,{detail:{isOutside:e}}),this.menuRef.value){let e=(this.menuRef.value.getAttribute(`data-placement`)||``).startsWith(`top`)?`4px`:`-4px`,{options:t}=M(this,`dropdown.hide`);await A(this.menuRef.value,[{opacity:1,transform:`translateY(0)`},{opacity:0,transform:`translateY(${e})`}],t)}this.menuIsOpen=!1,this.emit(`sgds-after-hide`),this._cleanupAutoUpdate&&=(this._cleanupAutoUpdate(),void 0)}}toggleMenu(){this.menuIsOpen?this.hideMenu():this.showMenu()}_handleKeyboardMenuEvent(e){if(!this.readonly)switch(e.key){case`ArrowDown`:case`ArrowUp`:e.preventDefault(),this.menuIsOpen||this.showMenu();break;case`Escape`:this.hideMenu()}}mergeMiddleware(e,t){let n=e=>e?.name||e?.constructor?.name,r=t.map(n);return e.map(e=>{let i=n(e),a=r.indexOf(i);return a===-1?e:t[a]}).concat(t.filter(t=>!e.some(e=>n(e)===n(t))))}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`}let t=[yg(8),this.noFlip?void 0:xg(),bg()].filter(Boolean),n=t;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(n=this.mergeMiddleware(t,this.floatingOpts.middleware.filter(Boolean)));let r={strategy:`fixed`,placement:e,...this.floatingOpts,middleware:n},{x:i,y:a,strategy:o,placement:s}=await wg(this.myDropdown.value,this.menuRef.value,r);this.menuRef.value.setAttribute(`data-placement`,s),Object.assign(this.menuRef.value.style,{position:o,left:`${i}px`,top:`${a}px`})}};E([S({type:Boolean,state:!0})],Kg.prototype,`noFlip`,void 0),E([S({type:Boolean,reflect:!0,state:!0})],Kg.prototype,`menuAlignRight`,void 0),E([S({type:String,reflect:!0,state:!0})],Kg.prototype,`drop`,void 0),E([S({type:Object})],Kg.prototype,`floatingOpts`,void 0),E([S({type:Boolean,reflect:!0})],Kg.prototype,`menuIsOpen`,void 0),E([S({type:Boolean,reflect:!0})],Kg.prototype,`disabled`,void 0),E([S({type:Boolean,reflect:!0})],Kg.prototype,`readonly`,void 0),N(`dropdown.show`,{keyframes:[],options:{duration:200,easing:`cubic-bezier(0.1, 0, 0.5, 0)`}}),N(`dropdown.hide`,{keyframes:[],options:{duration:200,easing:`cubic-bezier(0.15, 0.6, 0.6, 1)`}});var qg=class extends Kg{constructor(...e){super(...e),this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1,this.hidden=!1}static{this.styles=Kg.styles}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){let t=this._getActiveMenuItems(),n=t.find(t=>e.composedPath().includes(t));if(!n)return;let r=t.indexOf(n);this.nextDropdownItemNo=r+1,this.prevDropdownItemNo=r<=0?t.length-1:r-1,n.disabled||(this.emit(`sgds-select`,{detail:{item:n}}),this.close!==`outside`&&this.hideMenu())}_resetMenu(){this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1,this._getMenuItems().forEach(e=>{let t=e?.shadowRoot?.querySelector(`.dropdown-item`);t&&t.removeAttribute(`tabindex`)})}_handleKeyboardMenuItemsEvent(e){if(this.readonly)return;let t=this._getActiveMenuItems();if(t.length!==0)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`Escape`:this.menuIsOpen&&(e.preventDefault(),this.hideMenu());break;case`Enter`:t.find(t=>e.composedPath().includes(t))&&this.handleSelectSlot(e)}}_getMenuItems(){return this.shadowRoot.querySelector(`slot#default`)?this.shadowRoot.querySelector(`slot#default`)?.assignedElements({flatten:!0}).filter(e=>e.getAttribute(`role`)===`menuitem`&&!e.classList.contains(`empty-menu`)&&!e.hasAttribute(`hidden`)):this.menu?.hasChildNodes()?[...Array.from(this.menu.children)]:[]}_getActiveMenuItems(){return this._getMenuItems().filter(e=>!e.disabled&&!e.hidden&&!e.readonly)}_setMenuItem(e){let t=this._getActiveMenuItems();if(t.length===0)return;let n=(e%t.length+t.length)%t.length,r=t[n];this.emit(`i-sgds-option-focus`,{detail:{option:r}}),this.nextDropdownItemNo=(n+1)%t.length,this.prevDropdownItemNo=(n-1+t.length)%t.length,t.forEach(e=>{let t=e.shadowRoot.querySelector(`.dropdown-item`);t.setAttribute(`tabindex`,e===r?`0`:`-1`),e===r&&t.focus()})}};E([w(`ul.dropdown-menu`)],qg.prototype,`menu`,void 0),E([C()],qg.prototype,`nextDropdownItemNo`,void 0),E([C()],qg.prototype,`prevDropdownItemNo`,void 0),E([S({type:Boolean,reflect:!0})],qg.prototype,`hidden`,void 0),x();var Jg=u`:host([menuisopen]:not([disabled]):not([readonly])) .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-192);overflow-y:auto;padding:var(--sgds-padding-xs) 0;position:absolute;text-align:left;z-index:var(--sgds-z-index-floating)}.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%}`;x();var Yg=u`.dropdown{display:flex;height:inherit;position:relative}.dropdown-menu{max-width:var(--sgds-dimension-320)}.toggler-container{flex:1;pointer-events:none}.toggler-container ::slotted(*){pointer-events:auto}`;x();var Xg=class extends qg{static{this.styles=[...qg.styles,Yg,Jg]}constructor(){super(),this.noFlip=!1,this.menuAlignRight=!1,this.drop=`down`,this.close=`default`,this.menuRef=Gg()}async _handleClick(e){if(this.disabled)return;let t=this._toggler[0];if(!t){this.toggleMenu();return}if(e.composedPath().includes(t)){this.toggleMenu();return}if(!this.menuIsOpen)return;let n=this.menuRef.value;n&&e.composedPath().includes(n)||this.hideMenu()}_handleCloseMenu(){this._toggler[0]?.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.updateFloatingPosition(),this._handleDisabled()}_handleTogglerSlotChange(e){let t=e.target.assignedElements({flatten:!0})[0];t&&(t.setAttribute(`aria-haspopup`,`menu`),t.setAttribute(`aria-expanded`,String(this.menuIsOpen)))}_handleMenuIsOpenChange(){let e=this._toggler[0];e&&e.setAttribute(`aria-expanded`,String(this.menuIsOpen))}_handleDisabled(){let e=this._toggler[0];e&&(this.disabled?e.setAttribute(`disabled`,`true`):e.hasAttribute(`disabled`)&&e.removeAttribute(`disabled`))}render(){return y`
|
|
2570
|
+
*/let Hg=()=>new Ug;var Ug=class{};let Wg=/* @__PURE__ */ new WeakMap,Gg=ft(class extends Vg{render(e){return b}update(e,[t]){let n=t!==this.G;return n&&this.G!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),b}rt(e){if(this.isConnected||(e=void 0),typeof this.G==`function`){let t=this.ht??globalThis,n=Wg.get(t);n===void 0&&(n=/* @__PURE__ */ new WeakMap,Wg.set(t,n)),n.get(this.G)!==void 0&&this.G.call(this.ht,void 0),n.set(this.G,e),e!==void 0&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return typeof this.G==`function`?Wg.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var Kg=class extends D{constructor(...e){super(...e),this.myDropdown=Hg(),this.dropdownMenuId=pm(`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=Hg(),this._handleClickOutOfElement=e=>{this.menuIsOpen&&(e.composedPath().includes(this)||this.hideMenu(!0))}}connectedCallback(){super.connectedCallback(),this.close!==`inside`&&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(),void 0)}firstUpdated(e){super.firstUpdated(e),this.menuIsOpen&&requestAnimationFrame(async()=>{await this.updateFloatingPosition(),this._startAutoUpdate()})}async showMenu(){if(!(this.disabled||this.menuIsOpen)){if(this.menuIsOpen=!0,this.emit(`sgds-show`),await this.updateFloatingPosition(),this._startAutoUpdate(),this.menuRef.value){let e=(this.menuRef.value.getAttribute(`data-placement`)||``).startsWith(`top`)?`4px`:`-4px`,{options:t}=M(this,`dropdown.show`);await A(this.menuRef.value,[{opacity:0,transform:`translateY(${e})`},{opacity:1,transform:`translateY(0)`}],t)}this.emit(`sgds-after-show`)}}_startAutoUpdate(){this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=vg(this.myDropdown.value,this.menuRef.value,()=>this.updateFloatingPosition()))}async hideMenu(e){if(this.menuIsOpen){if(this.emit(`sgds-hide`,{detail:{isOutside:e}}),this.menuRef.value){let e=(this.menuRef.value.getAttribute(`data-placement`)||``).startsWith(`top`)?`4px`:`-4px`,{options:t}=M(this,`dropdown.hide`);await A(this.menuRef.value,[{opacity:1,transform:`translateY(0)`},{opacity:0,transform:`translateY(${e})`}],t)}this.menuIsOpen=!1,this.emit(`sgds-after-hide`),this._cleanupAutoUpdate&&=(this._cleanupAutoUpdate(),void 0)}}toggleMenu(){this.menuIsOpen?this.hideMenu():this.showMenu()}_handleKeyboardMenuEvent(e){if(!this.readonly)switch(e.key){case`ArrowDown`:case`ArrowUp`:e.preventDefault(),this.menuIsOpen||this.showMenu();break;case`Escape`:this.hideMenu()}}mergeMiddleware(e,t){let n=e=>e?.name||e?.constructor?.name,r=t.map(n);return e.map(e=>{let i=n(e),a=r.indexOf(i);return a===-1?e:t[a]}).concat(t.filter(t=>!e.some(e=>n(e)===n(t))))}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`}let t=[yg(8),this.noFlip?void 0:xg(),bg()].filter(Boolean),n=t;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(n=this.mergeMiddleware(t,this.floatingOpts.middleware.filter(Boolean)));let r={strategy:`fixed`,placement:e,...this.floatingOpts,middleware:n},{x:i,y:a,strategy:o,placement:s}=await wg(this.myDropdown.value,this.menuRef.value,r);this.menuRef.value.setAttribute(`data-placement`,s),Object.assign(this.menuRef.value.style,{position:o,left:`${i}px`,top:`${a}px`})}};E([S({type:Boolean,state:!0})],Kg.prototype,`noFlip`,void 0),E([S({type:Boolean,reflect:!0,state:!0})],Kg.prototype,`menuAlignRight`,void 0),E([S({type:String,reflect:!0,state:!0})],Kg.prototype,`drop`,void 0),E([S({type:Object})],Kg.prototype,`floatingOpts`,void 0),E([S({type:Boolean,reflect:!0})],Kg.prototype,`menuIsOpen`,void 0),E([S({type:Boolean,reflect:!0})],Kg.prototype,`disabled`,void 0),E([S({type:Boolean,reflect:!0})],Kg.prototype,`readonly`,void 0),N(`dropdown.show`,{keyframes:[],options:{duration:200,easing:`cubic-bezier(0.1, 0, 0.5, 0)`}}),N(`dropdown.hide`,{keyframes:[],options:{duration:200,easing:`cubic-bezier(0.15, 0.6, 0.6, 1)`}});var qg=class extends Kg{constructor(...e){super(...e),this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1,this.hidden=!1}static{this.styles=Kg.styles}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){let t=this._getActiveMenuItems(),n=t.find(t=>e.composedPath().includes(t));if(!n)return;let r=t.indexOf(n);this.nextDropdownItemNo=r+1,this.prevDropdownItemNo=r<=0?t.length-1:r-1,n.disabled||(this.emit(`sgds-select`,{detail:{item:n}}),this.close!==`outside`&&this.hideMenu())}_resetMenu(){this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1,this._getMenuItems().forEach(e=>{let t=e?.shadowRoot?.querySelector(`.dropdown-item`);t&&t.removeAttribute(`tabindex`)})}_handleKeyboardMenuItemsEvent(e){if(this.readonly)return;let t=this._getActiveMenuItems();if(t.length!==0)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`Escape`:this.menuIsOpen&&(e.preventDefault(),this.hideMenu());break;case`Enter`:t.find(t=>e.composedPath().includes(t))&&this.handleSelectSlot(e)}}_getMenuItems(){return this.shadowRoot.querySelector(`slot#default`)?this.shadowRoot.querySelector(`slot#default`)?.assignedElements({flatten:!0}).filter(e=>e.getAttribute(`role`)===`menuitem`&&!e.classList.contains(`empty-menu`)&&!e.hasAttribute(`hidden`)):this.menu?.hasChildNodes()?[...Array.from(this.menu.children)]:[]}_getActiveMenuItems(){return this._getMenuItems().filter(e=>!e.disabled&&!e.hidden&&!e.readonly)}_setMenuItem(e){let t=this._getActiveMenuItems();if(t.length===0)return;let n=(e%t.length+t.length)%t.length,r=t[n];this.emit(`i-sgds-option-focus`,{detail:{option:r}}),this.nextDropdownItemNo=(n+1)%t.length,this.prevDropdownItemNo=(n-1+t.length)%t.length,t.forEach(e=>{let t=e.shadowRoot.querySelector(`.dropdown-item`);t.setAttribute(`tabindex`,e===r?`0`:`-1`),e===r&&t.focus()})}};E([w(`ul.dropdown-menu`)],qg.prototype,`menu`,void 0),E([C()],qg.prototype,`nextDropdownItemNo`,void 0),E([C()],qg.prototype,`prevDropdownItemNo`,void 0),E([S({type:Boolean,reflect:!0})],qg.prototype,`hidden`,void 0),x();var Jg=u`:host([menuisopen]:not([disabled]):not([readonly])) .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-192);overflow-y:auto;padding:var(--sgds-padding-xs) 0;position:absolute;text-align:left;z-index:var(--sgds-z-index-floating)}.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%}`;x();var Yg=u`.dropdown{display:flex;height:inherit;position:relative}.dropdown-menu{max-width:var(--sgds-dimension-320)}.toggler-container{flex:1;pointer-events:none}.toggler-container ::slotted(*){pointer-events:auto}`;x();var Xg=class extends qg{static{this.styles=[...qg.styles,Yg,Jg]}constructor(){super(),this.noFlip=!1,this.menuAlignRight=!1,this.drop=`down`,this.close=`default`,this.menuRef=Gg()}async _handleClick(e){if(this.disabled)return;let t=this._toggler[0];if(!t){this.toggleMenu();return}if(e.composedPath().includes(t)){this.toggleMenu();return}if(!this.menuIsOpen)return;let n=this.menuRef.value;n&&e.composedPath().includes(n)||this.hideMenu()}_handleCloseMenu(){this._toggler[0]?.focus({preventScroll:!0})}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.updateFloatingPosition(),this._handleDisabled()}_handleTogglerSlotChange(e){let t=e.target.assignedElements({flatten:!0})[0];t&&(t.setAttribute(`aria-haspopup`,`menu`),t.setAttribute(`aria-expanded`,String(this.menuIsOpen)))}_handleMenuIsOpenChange(){let e=this._toggler[0];e&&e.setAttribute(`aria-expanded`,String(this.menuIsOpen))}_handleDisabled(){let e=this._toggler[0];e&&(this.disabled?e.setAttribute(`disabled`,`true`):e.hasAttribute(`disabled`)&&e.removeAttribute(`disabled`))}render(){return y`
|
|
2571
2571
|
<div class="dropdown" @click=${this._handleClick}>
|
|
2572
2572
|
<div class="toggler-container" ${Gg(this.myDropdown)}>
|
|
2573
2573
|
<slot name="toggler" @slotchange=${this._handleTogglerSlotChange}></slot>
|
|
@@ -2667,11 +2667,11 @@ let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),Fg(e,t);return
|
|
|
2667
2667
|
<slot></slot>
|
|
2668
2668
|
</sgds-dropdown>
|
|
2669
2669
|
`}};E([S({type:String,reflect:!0})],s_.prototype,`size`,void 0),x();var c_=u`.breadcrumb{display:flex;gap:var(--sgds-gap-xs)}.breadcrumb sgds-breadcrumb-item:first-child,.breadcrumb slot::slotted(sgds-breadcrumb-item:first-child){flex:0 0 auto}`,l_=class extends D{constructor(...e){super(...e),this.ariaLabel=`breadcrumb`}static{this.styles=[...D.styles,c_]}static{this.dependencies={"sgds-overflow-menu":s_}}_replaceExcessItemsWithDropdown(e){let t=document.createElement(`sgds-breadcrumb-item`),n=document.createElement(`sgds-overflow-menu`);n.setAttribute(`aria-haspopup`,`menu`),n.setAttribute(`size`,`sm`);let r=e.filter((t,r)=>{if(r>0&&r<e.length-2){let e=t.querySelector(`a`).cloneNode(!0),r=document.createElement(`sgds-dropdown-item`);r.appendChild(e),n.appendChild(r);return}return t});t.classList.add(`overflow-menu`),t.appendChild(n),r.splice(1,0,t),this.defaultSlot.replaceWith(...r)}_handleSlotChange(e){let t=e.target.assignedElements({flatten:!0}).filter(e=>e.tagName.toLowerCase()===`sgds-breadcrumb-item`);t.forEach((e,n)=>{n===t.length-1?(e.setAttribute(`aria-current`,`page`),e.active=!0):e.removeAttribute(`aria-current`)}),t.length>=5&&this._replaceExcessItemsWithDropdown(t)}render(){return I`
|
|
2670
|
-
<
|
|
2670
|
+
<nav aria-label=${k(this.ariaLabel)}>
|
|
2671
2671
|
<div class="breadcrumb">
|
|
2672
2672
|
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
2673
2673
|
</div>
|
|
2674
|
-
</
|
|
2674
|
+
</nav>
|
|
2675
2675
|
`}};E([S({type:String})],l_.prototype,`ariaLabel`,void 0),E([w(`slot`)],l_.prototype,`defaultSlot`,void 0),x();var u_=u`: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-link-md)!important;line-height:var(--sgds-line-height-xs)!important}:host([size=lg]) .nav-link::slotted(a){--text-underline-offset:4px;font-size:var(--sgds-font-size-link-lg)!important;line-height:var(--sgds-line-height-md)!important}:host([size=sm]) .nav-link::slotted(a){--text-underline-offset:2.8px;font-size:var(--sgds-font-size-link-sm)!important;line-height:var(--sgds-line-height-2-xs)!important}:host([size=xs]) .nav-link::slotted(a){--text-underline-offset:2.2px;font-size:var(--sgds-font-size-link-xs)!important;line-height:var(--sgds-line-height-3-xs)!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' fill='none' viewBox='0 0 20 20'%3E%3Cpath fill='%230e0e0e' fill-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-.035m2.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-.5' clip-rule='evenodd'/%3E%3C/svg%3E")!important;mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath fill='%230e0e0e' fill-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-.035m2.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-.5' clip-rule='evenodd'/%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-40)}.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){pointer-events:none;text-decoration:none!important}`;x();var d_=class extends D{constructor(...e){super(...e),this.size=`md`,this.variant=`primary`,this.tone=`primary`,this.active=!1,this.disabled=!1}static{this.styles=[...D.styles,u_]}_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){let 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){let t=e.target.assignedElements().find(e=>e.tagName.toLowerCase()===`a`);t&&(this._processAnchor(t),this._processIcon(t))}firstUpdated(e){super.firstUpdated(e);let t=this.querySelector(`a`);t&&(this._processAnchor(t),this._processIcon(t))}render(){return y`<slot class="nav-link " @slotchange=${this._handleSlotChange}></slot> `}};E([S({type:String,reflect:!0})],d_.prototype,`size`,void 0),E([S({type:String,reflect:!0})],d_.prototype,`variant`,void 0),E([S({type:String,reflect:!0})],d_.prototype,`tone`,void 0),E([S({type:Boolean,reflect:!0})],d_.prototype,`active`,void 0),E([S({type:Boolean,reflect:!0})],d_.prototype,`disabled`,void 0),x();var f_=u`:host{align-items:center;display:flex;font-size:var(--sgds-font-size-link-md);gap:var(--sgds-gap-xs);min-width:0}:host .nav-link::slotted(*){display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([active]) .nav-link::slotted(*){--sgds-link-color-default:var(--sgds-color-default);color:var(--sgds-link-color-default,--sgds-color-default);overflow:hidden;pointer-events:none;text-overflow:ellipsis;white-space:nowrap}: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)}:host(.overflow-menu){flex-shrink:0}sgds-link{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.separator{color:var(--sgds-color-subtle);display:flex}:host(:last-of-type) .separator{display:none}`;x();var p_=class extends D{constructor(...e){super(...e),this.active=!1,this._preventNavigation=e=>e.preventDefault()}static{this.styles=[f_]}static{this.dependencies={"sgds-link":d_,"sgds-icon":L}}updated(e){if(super.updated(e),e.has(`active`)){let e=this.querySelector(`a`);e&&(this.active?(e.setAttribute(`tabindex`,`-1`),e.addEventListener(`click`,this._preventNavigation)):e.removeEventListener(`click`,this._preventNavigation))}}render(){return y`
|
|
2676
2676
|
<sgds-link><slot class="nav-link"></slot></sgds-link>
|
|
2677
2677
|
<div class="separator">
|
|
@@ -2701,7 +2701,7 @@ let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),Fg(e,t);return
|
|
|
2701
2701
|
size=${k(this._assignSpinnerSize(this.size))}
|
|
2702
2702
|
tone=${k(this._assignSpinnerTone(this.tone,this.variant))}
|
|
2703
2703
|
></sgds-spinner>`:I`<slot name="leftIcon"></slot>
|
|
2704
|
-
<span><slot></slot></span>
|
|
2704
|
+
<span role="presentation"><slot></slot></span>
|
|
2705
2705
|
<slot name="rightIcon"></slot>`}
|
|
2706
2706
|
|
|
2707
2707
|
</${t}>
|
|
@@ -2739,13 +2739,14 @@ let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),Fg(e,t);return
|
|
|
2739
2739
|
* @license
|
|
2740
2740
|
* Copyright 2020 Google LLC
|
|
2741
2741
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2742
|
-
*/let w_=ft(class extends pt{constructor(e){if(super(e),e.type!==dt.PROPERTY&&e.type!==dt.ATTRIBUTE&&e.type!==dt.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Dg(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===Fe||t===b)return t;let n=e.element,r=e.name;if(e.type===dt.PROPERTY){if(t===n[r])return Fe}else if(e.type===dt.BOOLEAN_ATTRIBUTE){if(!!t===n.hasAttribute(r))return Fe}else if(e.type===dt.ATTRIBUTE&&n.getAttribute(r)===t+``)return Fe;return Mg(e),t}});x();var T_=u`.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-label-sm);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`;x();var E_=u`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs)}.form-text.disabled{opacity:var(--sgds-opacity-40)}`;x();var D_=u`.form-label{color:var(--sgds-form-color-default);font-weight:var(--sgds-font-weight-semibold);margin-bottom:0}.form-label.disabled{opacity:var(--sgds-opacity-40)}.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}`;x();var O_=u`.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)}`,V=class extends D{constructor(...e){super(...e),this.label=``,this.hintText=``,this.disabled=!1,this.invalid=!1,this._controlId=pm(`input`),this._labelId=pm(`label`)}static{this.styles=[...D.styles,T_,E_,D_,O_]}setInvalid(e){this.invalid=e,e?this.emit(`sgds-invalid`):this.emit(`sgds-valid`)}};E([S({reflect:!0})],V.prototype,`label`,void 0),E([S({reflect:!0})],V.prototype,`hintText`,void 0),E([S({reflect:!0})],V.prototype,`name`,void 0),E([S({type:Boolean,reflect:!0})],V.prototype,`disabled`,void 0),E([S({type:Boolean,reflect:!0})],V.prototype,`invalid`,void 0),x();let k_=(e=`value`)=>(t,n)=>{let r=t.constructor,i=r.prototype.attributeChangedCallback;r.prototype.attributeChangedCallback=function(t,a,o){let s=r.getPropertyOptions(e);if(t===(typeof s.attribute==`string`?s.attribute:e).toLowerCase()){let t=s.converter||v,r=(typeof t==`function`?t:t?.fromAttribute??v.fromAttribute)(o,s.type);this[e]!==r&&(this[n]=r)}i.call(this,t,a,o)}};var A_=class{constructor(e,t){(this.host=e).addController(this),this._internals=e._internals||this.host.attachInternals(),this.options={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){let t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){let 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,n){return this._internals.setValidity(e,t,n)}setFormValue(){let e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});let t=e.validity;if(t.valid)this._internals.setValidity({});else for(let n in t)t[n]&&(this.validationError=n.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}};let j_=e=>{class t extends e{static{this.formAssociated=!0}constructor(...e){super(...e),this._isTouched=!1,this._internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),this.inputValidationController??=new A_(this)}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector(`input`)||await this.sgdsInput||this.shadowRoot.querySelector(`textarea`)||await this.sgdsDatepickerInput,this._mixinSetFormValue(),!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._mixinShouldSkipSgdsValidation()&&this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),!this._mixinShouldSkipSgdsValidation()&&this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this._isTouched&&=!1,!this._mixinShouldSkipSgdsValidation()&&this.inputValidationController.validateInput(e)}_mixinValidate(e){this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinSetFormValue(){let e=this.value;this._internals.setFormValue(e)}_mixinCheckValidity(){return this._mixinShouldSkipSgdsValidation()?!0:this.inputValidationController.checkValidity()}_mixinReportValidity(){return this._mixinShouldSkipSgdsValidation()?!0:this.inputValidationController.reportValidity()}_mixinGetValidity(){return this._internals.validity}_mixinGetValidationMessage(){return this._internals.validationMessage}_mixinSetValidity(e,t,n){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(e,t,n)}_mixinShouldSkipSgdsValidation(){return this.closest(`form`)?.noValidate||this.noValidate}}return E([at(`sgds-input`)],t.prototype,`sgdsInput`,void 0),E([at(`sgds-datepicker-input`)],t.prototype,`sgdsDatepickerInput`,void 0),t};x();var M_=u`.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" viewBox="0 0 17 16"><path fill="%23fff" d="M14.347 3.979a.52.52 0 0 1 0 .739L7.043 12.02a.52.52 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 0"/></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" viewBox="0 0 17 16"><path fill="%23fff" fill-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-.5" clip-rule="evenodd"/></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;font-size:var(--sgds-font-size-label-md)}.form-check{margin:var(--sgds-form-padding-inline-sm) 0;padding:0}`;x();var N_=u`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);flex-shrink:0;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-40)}.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)}`;x();var P_=class extends j_(V){constructor(...e){super(...e),this.hasSlotController=new xm(this,`[default]`),this.checked=!1,this.defaultChecked=!1,this.indeterminate=!1,this.required=!1,this.noValidate=!1,this.invalidFeedback=``,this._isTouched=!1,this._handleHostClick=e=>{e.composedPath()[0]===this&&(e.stopPropagation(),this.input.click())}}static{this.styles=[...V.styles,N_,M_]}static{this.dependencies={"sgds-icon":L}}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}_handleChange(e){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){let t=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;e.key===`Enter`&&!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._mixinShouldSkipSgdsValidation()||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}})}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,this._handleHostClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`click`,this._handleHostClick)}render(){let e=this.hasFeedback===`both`||this.hasFeedback===`style`,t=this.hasFeedback===`both`||this.hasFeedback===`text`,n=this.hasSlotController.test(`[default]`);return y`
|
|
2742
|
+
*/let w_=ft(class extends pt{constructor(e){if(super(e),e.type!==dt.PROPERTY&&e.type!==dt.ATTRIBUTE&&e.type!==dt.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Dg(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===Fe||t===b)return t;let n=e.element,r=e.name;if(e.type===dt.PROPERTY){if(t===n[r])return Fe}else if(e.type===dt.BOOLEAN_ATTRIBUTE){if(!!t===n.hasAttribute(r))return Fe}else if(e.type===dt.ATTRIBUTE&&n.getAttribute(r)===t+``)return Fe;return Mg(e),t}});x();var T_=u`.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-label-sm);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`;x();var E_=u`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs)}.form-text.disabled{opacity:var(--sgds-opacity-40)}`;x();var D_=u`.form-label{color:var(--sgds-form-color-default);font-weight:var(--sgds-font-weight-semibold);margin-bottom:0}.form-label.disabled{opacity:var(--sgds-opacity-40)}.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}`;x();var O_=u`.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)}`,V=class extends D{constructor(...e){super(...e),this.label=``,this.hintText=``,this.disabled=!1,this.invalid=!1,this._controlId=pm(`input`),this._labelId=pm(`label`)}static{this.styles=[...D.styles,T_,E_,D_,O_]}setInvalid(e){this.invalid=e,e?this.emit(`sgds-invalid`):this.emit(`sgds-valid`)}};E([S({reflect:!0})],V.prototype,`label`,void 0),E([S({reflect:!0})],V.prototype,`hintText`,void 0),E([S({reflect:!0})],V.prototype,`name`,void 0),E([S({type:Boolean,reflect:!0})],V.prototype,`disabled`,void 0),E([S({type:Boolean,reflect:!0})],V.prototype,`invalid`,void 0),x();let k_=(e=`value`)=>(t,n)=>{let r=t.constructor,i=r.prototype.attributeChangedCallback;r.prototype.attributeChangedCallback=function(t,a,o){let s=r.getPropertyOptions(e);if(t===(typeof s.attribute==`string`?s.attribute:e).toLowerCase()){let t=s.converter||v,r=(typeof t==`function`?t:t?.fromAttribute??v.fromAttribute)(o,s.type);this[e]!==r&&(this[n]=r)}i.call(this,t,a,o)}};var A_=class{constructor(e,t){(this.host=e).addController(this),this._internals=e._internals||this.host.attachInternals(),this.options={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){let t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){let 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,n){return this._internals.setValidity(e,t,n)}setFormValue(){let e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});let t=e.validity;if(t.valid)this._internals.setValidity({});else for(let n in t)t[n]&&(this.validationError=n.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}};let j_=e=>{class t extends e{static{this.formAssociated=!0}constructor(...e){super(...e),this._isTouched=!1,this._internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),this.inputValidationController??=new A_(this)}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector(`input`)||await this.sgdsInput||this.shadowRoot.querySelector(`textarea`)||await this.sgdsDatepickerInput,this._mixinSetFormValue(),!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._mixinShouldSkipSgdsValidation()&&this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),!this._mixinShouldSkipSgdsValidation()&&this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this._isTouched&&=!1,!this._mixinShouldSkipSgdsValidation()&&this.inputValidationController.validateInput(e)}_mixinValidate(e){this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinSetFormValue(){let e=this.value;this._internals.setFormValue(e)}_mixinCheckValidity(){return this._mixinShouldSkipSgdsValidation()?!0:this.inputValidationController.checkValidity()}_mixinReportValidity(){return this._mixinShouldSkipSgdsValidation()?!0:this.inputValidationController.reportValidity()}_mixinGetValidity(){return this._internals.validity}_mixinGetValidationMessage(){return this._internals.validationMessage}_mixinSetValidity(e,t,n){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(e,t,n)}_mixinShouldSkipSgdsValidation(){return this.closest(`form`)?.noValidate||this.noValidate}}return E([at(`sgds-input`)],t.prototype,`sgdsInput`,void 0),E([at(`sgds-datepicker-input`)],t.prototype,`sgdsDatepickerInput`,void 0),t};x();var M_=u`.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" viewBox="0 0 17 16"><path fill="%23fff" d="M14.347 3.979a.52.52 0 0 1 0 .739L7.043 12.02a.52.52 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 0"/></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" viewBox="0 0 17 16"><path fill="%23fff" fill-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-.5" clip-rule="evenodd"/></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;font-size:var(--sgds-font-size-label-md)}.form-check{margin:var(--sgds-form-padding-inline-sm) 0;padding:0}`;x();var N_=u`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);flex-shrink:0;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-40)}.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)}`;x();var H=class extends j_(V){constructor(...e){super(...e),this.hasSlotController=new xm(this,`[default]`),this.checked=!1,this.defaultChecked=!1,this.indeterminate=!1,this.required=!1,this.noValidate=!1,this.ariaLabel=``,this.invalidFeedback=``,this._isTouched=!1,this._handleHostClick=e=>{e.composedPath()[0]===this&&(e.stopPropagation(),this.input.click())}}static{this.styles=[...V.styles,N_,M_]}static{this.dependencies={"sgds-icon":L}}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}_handleChange(e){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){let t=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;e.key===`Enter`&&!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._mixinShouldSkipSgdsValidation()||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}})}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,this._handleHostClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`click`,this._handleHostClick)}render(){let e=this.hasFeedback===`both`||this.hasFeedback===`style`,t=this.hasFeedback===`both`||this.hasFeedback===`text`,n=this.hasSlotController.test(`[default]`);return y`
|
|
2743
2743
|
<div class="form-check">
|
|
2744
2744
|
<input
|
|
2745
2745
|
class=${O({"form-check-input":!0,"is-invalid":e&&this.invalid})}
|
|
2746
2746
|
type="checkbox"
|
|
2747
2747
|
id=${this._controlId}
|
|
2748
2748
|
aria-invalid=${this.invalid?`true`:`false`}
|
|
2749
|
+
aria-label=${k(this.ariaLabel||void 0)}
|
|
2749
2750
|
name=${k(this.name)}
|
|
2750
2751
|
?indeterminate=${this.indeterminate}
|
|
2751
2752
|
?required=${this.required}
|
|
@@ -2772,7 +2773,7 @@ let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),Fg(e,t);return
|
|
|
2772
2773
|
</div>
|
|
2773
2774
|
</div>
|
|
2774
2775
|
`:b}
|
|
2775
|
-
`}};E([S({type:String,reflect:!0})],
|
|
2776
|
+
`}};E([S({type:String,reflect:!0})],H.prototype,`value`,void 0),E([S({type:Boolean,reflect:!0})],H.prototype,`checked`,void 0),E([S({type:String,reflect:!0})],H.prototype,`hasFeedback`,void 0),E([k_(`checked`)],H.prototype,`defaultChecked`,void 0),E([S({type:Boolean,reflect:!0})],H.prototype,`indeterminate`,void 0),E([S({type:Boolean,reflect:!0})],H.prototype,`required`,void 0),E([S({type:Boolean,reflect:!0})],H.prototype,`noValidate`,void 0),E([S({type:String})],H.prototype,`ariaLabel`,void 0),E([S({type:String,reflect:!0})],H.prototype,`invalidFeedback`,void 0),E([C()],H.prototype,`_isTouched`,void 0),E([F(`disabled`,{waitUntilFirstUpdate:!0})],H.prototype,`_handleDisabledChange`,null),E([F(`_isTouched`,{waitUntilFirstUpdate:!0})],H.prototype,`_handleIsTouched`,null),x();var P_=u`: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-label-md);font-weight:var(--sgds-font-weight-semibold)}.checkbox-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md);padding:var(--sgds-form-padding-inline-sm) 0}.checkbox-group-validation-input{display:none}:host([disabled]) .label-hint-container{cursor:not-allowed;opacity:var(--sgds-opacity-40)}`;x();var U=class extends j_(V){constructor(...e){super(...e),this.label=``,this.invalidFeedback=`Please tick at least one box if you want to proceed`,this.hasFeedback=!1,this.hintText=``,this.required=!1,this.noValidate=!1,this.value=``,this._isTouched=!1,this.defaultValue=``,this._blurredCheckboxes=/* @__PURE__ */ new Set}static{this.styles=[...V.styles,P_]}static{this.dependencies={"sgds-icon":L}}connectedCallback(){super.connectedCallback(),this.addEventListener(`sgds-check`,e=>{let{value:t}=e.detail;!this.value.includes(t)&&this._addValue(t)}),this.addEventListener(`sgds-uncheck`,e=>{let{value:t}=e.detail;this._removeValue(t)}),this.addEventListener(`sgds-blur`,e=>{let 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(){let e=y` <div class="form-text" id="${this._controlId}Help">${this.hintText}</div> `;return this.hintText&&e}_addValue(e){let t=this.value?this.value.split(`;`):[];t.push(e),this.value=t.join(`;`),this._updateInputValue(),this.emit(`sgds-change`,{detail:{value:this.value}})}_removeValue(e){let t=(this.value?this.value.split(`;`):[]).filter(t=>t!==e);this.value=t.join(`;`),this._updateInputValue(),this.emit(`sgds-change`,{detail:{value:this.value}})}_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(){this.disabled&&this._checkboxes.forEach(e=>e.disabled=this.disabled)}_handleValueChange(){this._checkboxes.forEach(e=>{e.checked=this.value.includes(e.value)}),this._updateInputValue(),this._updateInvalid()}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||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))}render(){return y`
|
|
2776
2777
|
<fieldset>
|
|
2777
2778
|
<div class="label-hint-container">
|
|
2778
2779
|
<label class="form-label">${this.label}</label>
|
|
@@ -2801,7 +2802,7 @@ let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),Fg(e,t);return
|
|
|
2801
2802
|
</div>
|
|
2802
2803
|
`:b}
|
|
2803
2804
|
</fieldset>
|
|
2804
|
-
`}};E([S({reflect:!0})],
|
|
2805
|
+
`}};E([S({reflect:!0})],U.prototype,`label`,void 0),E([S({type:String,reflect:!0})],U.prototype,`invalidFeedback`,void 0),E([S({type:Boolean,reflect:!0})],U.prototype,`hasFeedback`,void 0),E([S({reflect:!0})],U.prototype,`hintText`,void 0),E([S({type:Boolean,reflect:!0})],U.prototype,`required`,void 0),E([S({type:Boolean,reflect:!0})],U.prototype,`noValidate`,void 0),E([S({reflect:!0})],U.prototype,`value`,void 0),E([C()],U.prototype,`_isTouched`,void 0),E([k_()],U.prototype,`defaultValue`,void 0),E([C()],U.prototype,`_blurredCheckboxes`,void 0),E([T()],U.prototype,`_checkboxes`,void 0),E([F(`value`,{waitUntilFirstUpdate:!0})],U.prototype,`_handleValueChange`,null),E([F(`_isTouched`,{waitUntilFirstUpdate:!0})],U.prototype,`_handleIsTouched`,null),E([F(`invalid`,{waitUntilFirstUpdate:!0})],U.prototype,`_updateInvalid`,null),x();var F_=u`.form-control-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.m-width-160{min-width:var(--sgds-dimension-160)}.m-width-256{min-width:var(--sgds-dimension-256)}.form-label{color:var(--sgds-form-color-default);font-size:var(--sgds-font-size-label-md);font-weight:var(--sgds-font-weight-semibold)}.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;overflow:hidden;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-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-label-md);line-height:var(--sgds-line-height-xs);min-width:0;outline:none;padding:0;width:100%}.form-clearable{color:var(--sgds-color-subtle);cursor:pointer}.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-40)}.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)}`;x();var I_=u`.empty-menu,.loading-menu{padding:var(--sgds-padding-sm) var(--sgds-padding-lg,20px);pointer-events:none}.loading-menu{align-items:center;display:flex;gap:var(--sgds-gap-xs)}`;x();var W=class extends j_(qg){static{this.styles=[...qg.styles,Jg,E_,T_,F_,I_]}setInvalid(e){this.invalid=e,e?this.emit(`sgds-invalid`):this.emit(`sgds-valid`)}constructor(){super(),this.label=``,this.hintText=``,this.autofocus=!1,this.disabled=!1,this.required=!1,this.loading=!1,this.value=``,this.displayValue=``,this.defaultValue=``,this.hasFeedback=!1,this.invalidFeedback=``,this.invalid=!1,this.autocomplete=`on`,this.menuList=[],this.selectedItems=[],this.filteredList=[],this._isTouched=!1,this._controlId=pm(`input`),this._labelId=pm(`label`),this.floatingOpts={middleware:[Sg({apply({rects:e,elements:t}){t.floating.style.width=`${e.reference.width}px`}})]}}connectedCallback(){super.connectedCallback(),this.addEventListener(`blur`,async e=>{if(this._mixinShouldSkipSgdsValidation())return;let t=this.constructor.childName,n=e.relatedTarget?.tagName.toLowerCase()===t;this.invalid=!n&&!this._mixinReportValidity()})}reportValidity(){return this._mixinReportValidity()}setValidity(e,t,n){return this._mixinSetValidity(e,t,n)}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_renderFeedback(){return this.invalid&&this.hasFeedback?y` <div class="invalid-feedback-container">
|
|
2805
2806
|
<slot name="invalidIcon">
|
|
2806
2807
|
<sgds-icon name="exclamation-circle-fill" size="md"></sgds-icon>
|
|
2807
2808
|
</slot>
|
|
@@ -2815,11 +2816,11 @@ let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),Fg(e,t);return
|
|
|
2815
2816
|
class=${O({"form-label":!0,required:this.required})}
|
|
2816
2817
|
>${this.label}</label
|
|
2817
2818
|
>
|
|
2818
|
-
`;return this.label&&e}_handleClick(){if(this.readonly)return null;this.menuIsOpen?this.hideMenu():this.showMenu()}async _getMenuListFromOptions(e){let t=e.map(async e=>(await e.updateComplete,e));return(await Promise.all(t))?.map(e=>({label:e.textContent?.trim()??``,value:e.getAttribute(`value`),disabled:e.disabled??void 0}))}_renderEmptyMenu(){return y` <div class="empty-menu">No options</div> `}_renderLoadingMenu(){return y`<div class="loading-menu"><sgds-spinner size="xs" tone="brand"></sgds-spinner>Loading...</div>`}};E([S({reflect:!0})],
|
|
2819
|
+
`;return this.label&&e}_handleClick(){if(this.readonly)return null;this.menuIsOpen?this.hideMenu():this.showMenu()}async _getMenuListFromOptions(e){let t=e.map(async e=>(await e.updateComplete,e));return(await Promise.all(t))?.map(e=>({label:e.textContent?.trim()??``,value:e.getAttribute(`value`),disabled:e.disabled??void 0}))}_renderEmptyMenu(){return y` <div class="empty-menu">No options</div> `}_renderLoadingMenu(){return y`<div class="loading-menu"><sgds-spinner size="xs" tone="brand"></sgds-spinner>Loading...</div>`}};E([S({reflect:!0})],W.prototype,`label`,void 0),E([S({reflect:!0})],W.prototype,`hintText`,void 0),E([S({reflect:!0})],W.prototype,`name`,void 0),E([S({type:String,reflect:!0})],W.prototype,`placeholder`,void 0),E([S({type:Boolean,reflect:!0})],W.prototype,`autofocus`,void 0),E([S({type:Boolean,reflect:!0})],W.prototype,`disabled`,void 0),E([S({type:Boolean,reflect:!0})],W.prototype,`required`,void 0),E([S({type:Boolean,reflect:!0})],W.prototype,`loading`,void 0),E([S({type:String,reflect:!0})],W.prototype,`value`,void 0),E([C()],W.prototype,`displayValue`,void 0),E([k_()],W.prototype,`defaultValue`,void 0),E([S({type:Boolean,reflect:!0})],W.prototype,`hasFeedback`,void 0),E([S({type:String,reflect:!0})],W.prototype,`invalidFeedback`,void 0),E([S({type:Boolean,reflect:!0})],W.prototype,`invalid`,void 0),E([S({type:String,reflect:!0})],W.prototype,`autocomplete`,void 0),E([S({type:Array})],W.prototype,`menuList`,void 0),E([C()],W.prototype,`selectedItems`,void 0),E([C()],W.prototype,`filteredList`,void 0),E([at(`input.form-control`)],W.prototype,`_input`,void 0),x();var L_=u`:host{display:block;position:relative}.dropdown{display:flex;height:100%}.dropdown-menu{box-sizing:border-box;max-height:10rem;overflow-x:hidden;overflow-y:auto}.visually-hidden{clip:rect(0,0,0,0)!important;border:0!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}.combobox .form-control-group{height:unset;min-height:var(--sgds-dimension-48)}.combobox-input-container{align-items:center;display:flex;flex-wrap:wrap;gap:var(--sgds-gap-xs);padding:calc(var(--sgds-form-padding-y) - var(--sgds-form-border-width-default)) 0;width:calc(100% - var(--sgds-icon-size-md, 1.25rem))}.combobox-input-container .form-control{flex:1 1 0;min-width:10ch}slot[id=default].d-none,slot[id=default].d-none::slotted(*){display:none}.form-clearable:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}`;x();var R_=u`:host([active]) .dropdown-item{background-color:var(--sgds-bg-translucent-subtle)}.dropdown-item{background-color:var(--sgds-bg-transparent);clear:both;color:var(--sgds-form-color-default);cursor:pointer;font-size:var(--sgds-font-size-label-md);height:100%;overflow-wrap:anywhere;padding:var(--sgds-padding-sm) var(--sgds-padding-md);text-align:inherit;white-space:normal}.dropdown-item.disabled{opacity:var(--sgds-opacity-40);pointer-events:none}.dropdown-item .normal-item-content{align-items:center;display:flex;justify-content:space-between}:host([active]) .dropdown-item .normal-item-content{color:var(--sgds-form-primary-color-default)}.dropdown-item:hover{background:var(--sgds-bg-translucent-subtle)}.dropdown-item:focus-visible{background:var(--sgds-bg-translucent-subtle);outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}`;x();var z_=class extends D{constructor(...e){super(...e),this.active=!1,this.disabled=!1}static{this.styles=[R_]}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`menuitem`),this.setAttribute(`aria-disabled`,`${this.disabled}`),this._updateAriaLabel()}_updateAriaLabel(){let e=this.textContent?.trim();e&&this.setAttribute(`aria-label`,e)}render(){let e={disabled:this.disabled,active:this.active};return y`
|
|
2819
2820
|
<div class="dropdown-item ${O(e)}" tabindex=${this.disabled?`-1`:`0`}>
|
|
2820
2821
|
${this._renderItemContent()}
|
|
2821
2822
|
</div>
|
|
2822
|
-
`}};E([S({type:Boolean,reflect:!0})],
|
|
2823
|
+
`}};E([S({type:Boolean,reflect:!0})],z_.prototype,`active`,void 0),E([S({type:Boolean,reflect:!0})],z_.prototype,`disabled`,void 0),E([S({type:String,reflect:!0})],z_.prototype,`value`,void 0),x();var B_=class extends z_{constructor(...e){super(...e),this.checkbox=!1,this._renderItemContent=()=>this.checkbox?y`
|
|
2823
2824
|
<sgds-checkbox .checked=${this.active} .disabled=${this.disabled}>
|
|
2824
2825
|
<slot></slot>
|
|
2825
2826
|
</sgds-checkbox>
|
|
@@ -2828,16 +2829,16 @@ let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),Fg(e,t);return
|
|
|
2828
2829
|
<slot></slot>
|
|
2829
2830
|
${this.active?y` <sgds-icon name="check"></sgds-icon> `:b}
|
|
2830
2831
|
</div>
|
|
2831
|
-
`}static{this.dependencies={"sgds-icon":L,"sgds-checkbox":
|
|
2832
|
+
`}static{this.dependencies={"sgds-icon":L,"sgds-checkbox":H}}connectedCallback(){super.connectedCallback()}firstUpdated(e){super.firstUpdated(e),this.parentElement?.multiSelect&&(this.checkbox=!0)}};E([S({type:Boolean,reflect:!0})],B_.prototype,`checkbox`,void 0),Xe();
|
|
2832
2833
|
/**
|
|
2833
2834
|
* @license
|
|
2834
2835
|
* Copyright 2017 Google LLC
|
|
2835
2836
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2836
2837
|
*/
|
|
2837
|
-
let
|
|
2838
|
+
let V_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},H_=ft(class extends pt{constructor(e){if(super(e),e.type!==dt.CHILD)throw Error(`repeat() can only be used in text expressions`)}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,r]){let i=Ng(e),{values:a,keys:o}=this.dt(t,n,r);if(!Array.isArray(i))return this.ut=o,a;let s=this.ut??=[],c=[],l,u,d=0,f=i.length-1,p=0,m=a.length-1;for(;d<=f&&p<=m;)if(i[d]===null)d++;else if(i[f]===null)f--;else if(s[d]===o[p])c[p]=Ag(i[d],a[p]),d++,p++;else if(s[f]===o[m])c[m]=Ag(i[f],a[m]),f--,m--;else if(s[d]===o[m])c[m]=Ag(i[d],a[m]),kg(e,c[m+1],i[d]),d++,m--;else if(s[f]===o[p])c[p]=Ag(i[f],a[p]),kg(e,i[d],i[f]),f--,p++;else if(l===void 0&&(l=V_(o,p,m),u=V_(s,d,f)),l.has(s[d])){if(l.has(s[f])){let t=u.get(o[p]),n=t===void 0?null:i[t];if(n===null){let t=kg(e,i[d]);Ag(t,a[p]),c[p]=t}else c[p]=Ag(n,a[p]),kg(e,i[d],n),i[t]=null;p++}else Pg(i[f]),f--}else Pg(i[d]),d++;for(;p<=m;){let t=kg(e,c[m+1]);Ag(t,a[p]),c[p++]=t}for(;d<=f;){let e=i[d++];e!==null&&Pg(e)}return this.ut=o,Mg(e,c),Fe}});x();var G=class e extends W{constructor(...e){super(...e),this.multiSelect=!1,this.badgeFullWidth=!1,this.clearable=!1,this.noValidate=!1,this.async=!1,this.emptyMenuAsync=!1,this.scrollBottomOffset=0,this.filterFunction=(e,t)=>t.label.toLowerCase().startsWith(e.toLowerCase()),this.optionList=[],this.emptyMenuAfterFiltering=!1,this.isFocused=!1,this.isScrollEnd=!1,this.suffixIconTemplate=y`<sgds-icon
|
|
2838
2839
|
name=${this.menuIsOpen?`chevron-up`:`chevron-down`}
|
|
2839
2840
|
size="md"
|
|
2840
|
-
></sgds-icon>`,this.prefixIconTemplate=y`${b}`}static{this.styles=[...
|
|
2841
|
+
></sgds-icon>`,this.prefixIconTemplate=y`${b}`}static{this.styles=[...W.styles,F_,L_]}static{this.childName=`sgds-combo-box-option`}static{this.dependencies={[e.childName]:B_,"sgds-icon":L,"sgds-badge":r_,"sgds-spinner":_m}}connectedCallback(){super.connectedCallback(),this.addEventListener(`focus`,async()=>{this.isFocused=!0}),this.addEventListener(`blur`,async()=>{this.isFocused=!1}),this.addEventListener(`keydown`,e=>{e.key===`Enter`&&e.target.shadowRoot?.querySelector(`.form-clearable`)?.matches(`:focus`)&&this._handleClear()}),this.addEventListener(`sgds-hide`,async e=>{e.detail.isOutside||(await this._input).focus(),this.options.forEach(e=>e.removeAttribute(`hidden`)),this.emptyMenuAfterFiltering=!1})}async firstUpdated(e){super.firstUpdated(e),this.async&&(this.filterFunction=()=>!0),this.menuList.forEach(e=>{let 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&&await this.updateFloatingPosition()}async _handleDefaultSlotChange(e){let t=e.target.assignedElements({flatten:!0});t.forEach(e=>{if(e.hasAttribute(`disabled`)||e.clickEventAdded)return!1;e.addEventListener(`click`,e=>{e.preventDefault();let t=e.target;return this.multiSelect&&t.active?this._handleItemUnselect(e):this._handleItemSelected(e),!1}),e.clickEventAdded=!0,e.addEventListener(`keydown`,e=>{e.key===`Enter`&&(this.close=`outside`,e.target.click())})}),await this.updateComplete,this.optionList=await this._getMenuListFromOptions(t),this._setupValidation(this.optionList)}async _setupValidation(e){if(this.value&&e.length>0){let t=this.value.split(`;`),n=e.filter(({value:e})=>t.includes(e));this.selectedItems=[...n,...this.selectedItems],this.multiSelect||(this.displayValue=n[0]?.label)}this.input=this.multiSelect?await this._multiSelectInput:await this._input,this._mixinValidate(this.input)}async _handleValueChange(){this.options.forEach(e=>e.removeAttribute(`hidden`));let 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._mixinShouldSkipSgdsValidation()||(this.invalid=!this._mixinReportValidity()))}_emitChangeEvents(){this._mixinSetFormValue(),this.emit(`sgds-change`),this.value&&this.emit(`sgds-select`)}_handleOptionListChange(){this._updateValueAndDisplayValue(this.optionList)}_handleMenuListChange(){let e=this.menuList.map(e=>{let 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){let t=this.value.split(`;`),n=e.filter(({value:e})=>t.includes(e));this.selectedItems=[...n];let r=n.map(e=>e.value).join(`;`);r!==this.value&&(this.value=r),!this.multiSelect&&!this.async&&(this.displayValue=n[0]?.label||``),this.options.forEach(e=>e.active=t.includes(e.value))}async _handleInputChange(e){let t=e.target;this.displayValue=t.value,this.emit(`sgds-input`,{detail:{displayValue:this.displayValue}}),this.invalid=!1,this.showMenu(),this.displayValue===``&&!this.multiSelect&&(this.selectedItems=[],this.value=this.selectedItems.join(`;`),this.options.forEach(e=>e.active=!1),this._emitChangeEvents());let n=this.options.map(e=>({value:e.value,label:e.textContent.trim()}));this.filteredList=n.filter(e=>this.filterFunction(this.displayValue,e)),this.emptyMenuAfterFiltering=this.filteredList.length===0;let r=this.filteredList.map(e=>e.value);this.options.forEach(e=>{e.hidden=!r.includes(e.value)})}async _handleItemSelected(e){let t=e.target;if(t.disabled)return;let n=t.textContent?.trim()??``,r=t.getAttribute(`value`)??n,i=this.filteredList.find(e=>e.value.toString()===r)||{label:n,value:r};this.multiSelect?(this.selectedItems.some(e=>e.value===i.value)||(this.selectedItems=[...this.selectedItems,i]),this.value=this.selectedItems.map(e=>e.value).join(`;`),t.active=!0):(this.selectedItems.length===0||this.selectedItems[0].value!==i.value)&&(this.options.forEach(e=>e.active=!1),t.active=!0,this.selectedItems=[i],this.value=i.value.toString(),this.displayValue=i.label,this.hideMenu()),this._emitChangeEvents()}_handleItemUnselect(e){let t=e.target;if(t.disabled)return;t.removeAttribute(`active`);let n=t.textContent?.trim()??``,r=t.getAttribute(`value`)??n,i=this.filteredList.find(e=>e.value.toString()===r)||{label:n,value:r};this.selectedItems=this.selectedItems.filter(e=>e.value!==i.value),this.value=this.selectedItems.map(e=>e.value).join(`;`),this._emitChangeEvents()}async _handleBadgeDismissed(e,t){e.preventDefault();let n=t.value;this.options?.forEach(e=>e.value===n?e.active=!1:null),this.selectedItems=this.selectedItems.filter(e=>e.value!==t.value),this.value=this.selectedItems.map(e=>e.value).join(`;`),this._emitChangeEvents()}async _handleMultiSelectKeyDown(e){if(this.multiSelect&&e.key===`Backspace`&&this.multiSelect&&this.displayValue.trim()===``&&this.selectedItems.length>0){let e=this.selectedItems[this.selectedItems.length-1].value;this.options?.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(`;`),this._emitChangeEvents()}}_handleFocus(){this.emit(`sgds-focus`)}async _handleInputBlur(e){e.preventDefault(),this.emit(`sgds-blur`),this.multiSelect?this.selectedItems.filter(({label:e})=>this.displayValue===e).length<=0&&(this.displayValue=``):this.displayValue=this.selectedItems.length>0?this.selectedItems[0].label:``}async _handleClear(){this.value=this.displayValue=``,this.options?.forEach(e=>e.active=!1),this._emitChangeEvents(),(await this._input).focus(),this.showMenu()}async _mixinResetFormControl(){if(this.value=this.defaultValue,this.multiSelect){let e=this.value.split(`;`);this.options.forEach(t=>{t.active=e.includes(t.value)});let 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});let e=this.options.filter(e=>e.value===this.value);this.displayValue=e.length<=0?``:e[0].textContent.trim(),this._mixinResetValidity(await this._input)}}async _handleScroll(e){let t=e.target;if(t){let e=t.scrollHeight-t.clientHeight,n=Math.max(0,this.scrollBottomOffset);t.scrollTop>=e-n?(this.isScrollEnd||this.emit(`sgds-scroll-end`),this.isScrollEnd=!0):this.isScrollEnd=!1}}_renderInput(e){let t=this.hasFeedback,n=e;return y`
|
|
2841
2842
|
<div
|
|
2842
2843
|
${Gg(this.myDropdown)}
|
|
2843
2844
|
class="form-control-group ${O({disabled:this.disabled,readonly:this.readonly,"is-invalid":this.invalid&&t})}"
|
|
@@ -2846,7 +2847,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
2846
2847
|
${this.prefixIconTemplate}
|
|
2847
2848
|
<div class="combobox-input-container">
|
|
2848
2849
|
${this.multiSelect?y`
|
|
2849
|
-
${
|
|
2850
|
+
${H_(this.selectedItems,e=>e.value,e=>y`<sgds-badge
|
|
2850
2851
|
outlined
|
|
2851
2852
|
variant="neutral"
|
|
2852
2853
|
show
|
|
@@ -2928,7 +2929,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
2928
2929
|
aria-hidden="true"
|
|
2929
2930
|
.autocomplete=${this.autocomplete}
|
|
2930
2931
|
/>`:b}
|
|
2931
|
-
`}};E([S({type:Boolean,reflect:!0})],
|
|
2932
|
+
`}};E([S({type:Boolean,reflect:!0})],G.prototype,`multiSelect`,void 0),E([S({type:Boolean,reflect:!0})],G.prototype,`badgeFullWidth`,void 0),E([S({type:Boolean,reflect:!0})],G.prototype,`clearable`,void 0),E([S({type:Boolean,reflect:!0})],G.prototype,`noValidate`,void 0),E([S({type:Boolean,reflect:!0})],G.prototype,`async`,void 0),E([S({type:Boolean,reflect:!0})],G.prototype,`emptyMenuAsync`,void 0),E([S({type:Number,reflect:!0})],G.prototype,`scrollBottomOffset`,void 0),E([S()],G.prototype,`filterFunction`,void 0),E([at(`input#multi-select-input-tracker`)],G.prototype,`_multiSelectInput`,void 0),E([T({flatten:!0,selector:`sgds-combo-box-option`})],G.prototype,`options`,void 0),E([C()],G.prototype,`optionList`,void 0),E([C()],G.prototype,`emptyMenuAfterFiltering`,void 0),E([C()],G.prototype,`isFocused`,void 0),E([C()],G.prototype,`isScrollEnd`,void 0),E([F(`value`,{waitUntilFirstUpdate:!0})],G.prototype,`_handleValueChange`,null),E([F(`optionList`,{waitUntilFirstUpdate:!0})],G.prototype,`_handleOptionListChange`,null),E([F(`menuList`,{waitUntilFirstUpdate:!0})],G.prototype,`_handleMenuListChange`,null),x();var U_=u`:host{display:contents}:host([layout=fixed]) .table{table-layout:fixed}.table{border-collapse:collapse;display:table;table-layout:auto;width:100%}.table-container{overflow-x:auto}.data-table{border:var(--sgds-border-width-1) solid;border-color:var(--sgds-border-color-muted);border-radius:var(--sgds-border-radius-none);display:flex;flex-direction:column;min-height:var(--sgds-dimension-56)}.footer{align-items:center;display:flex;justify-content:space-between;padding:var(--sgds-padding-sm) var(--sgds-padding-lg)}.skeleton-row{display:table-row}.skeleton-cell{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);display:table-cell;height:var(--sgds-dimension-56);padding:var(--sgds-padding-sm) var(--sgds-padding-md);vertical-align:middle}.skeleton-cell.control-cell{width:var(--sgds-dimension-56)}.no-data{align-items:center;color:var(--sgds-text-color-subtle);display:flex;justify-content:center;min-height:var(--sgds-dimension-128);padding:var(--sgds-padding-sm) var(--sgds-padding-md)}.active:not(.sort-icon),tr:hover:not([data-header-row]){background-color:var(--sgds-bg-translucent-subtle);transition:background-color .15s ease}td,th{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);vertical-align:middle}th[data-sorting]{cursor:pointer}th[data-sorting]:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.data-table-cell,.data-table-head,.footer,.no-data{align-items:center;display:flex;font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-label-sm);font-style:normal;letter-spacing:var(--sgds-letter-spacing-normal);line-height:var(--sgds-line-height-2-xs);min-height:var(--sgds-dimension-56);padding:var(--sgds-padding-sm) var(--sgds-padding-md)}.data-table-head{color:var(--sgds-color-default);font-weight:var(--sgds-font-weight-semibold);gap:var(--sgds-gap-2-xs)}.data-table-head ::slotted(sgds-data-table-head){font-size:var(--sgds-font-size-label-sm);font-weight:var(--sgds-font-weight-semibold);line-height:var(--sgds-line-height-2-xs)}.data-table-cell{font-weight:var(--sgds-font-weight-regular)}.data-table-cell ::slotted(sgds-data-table-cell){font-size:var(--sgds-font-size-label-sm);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-2-xs)}.sort,.sort-button{align-items:center;display:inline-flex}.sort-button{background-color:var(--sgds-bg-transparent);border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-form-border-radius-sm);color:var(--sgds-color-subtle);cursor:pointer;height:var(--sgds-dimension-20);justify-content:center;padding:0;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:var(--sgds-dimension-20)}.sort-button:hover{background-color:var(--sgds-bg-translucent-subtle);color:var(--sgds-color-default)}.sort-button:focus,.sort-button:focus-visible{background-color:var(--sgds-bg-translucent-subtle);border-color:transparent;outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.sort-button:disabled{background-color:var(--sgds-bg-transparent);color:var(--sgds-color-muted);cursor:not-allowed}.sort-button.active{background-color:var(--sgds-primary-surface-translucent);color:var(--sgds-primary-color-default)}.sort-icon{display:inline-flex}.data-table-cell.align-right,.data-table-head.align-right{justify-content:flex-end;text-align:right}.control-cell{width:var(--sgds-dimension-56)}:host(.checkbox-cell) .data-table-cell,:host(.checkbox-cell) .data-table-head{padding:var(--sgds-padding-sm) var(--sgds-padding-md)}:host(.expand-cell) .data-table-cell{cursor:pointer;padding:var(--sgds-padding-md)}.expandable-td{border:0;padding:0}.expandable-content{background-color:var(--sgds-surface-raised);border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);padding:var(--sgds-padding-2-xl);padding-left:var(--sgds-padding-4-xl)}.hidden{display:none}.visually-hidden{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`;x();var W_=u`ul{margin-bottom:1rem;margin-top:0;padding-left:2rem}svg{vertical-align:middle}.pagination{display:inline-flex;gap:var(--sgds-gap-2-xs);list-style:none;padding-left:0}.page-link{align-items:center;background-color:var(--sgds-bg-transparent);border-radius:var(--sgds-border-radius-md);display:flex;height:var(--sgds-dimension-48);justify-content:center;width:var(--sgds-dimension-48)}.page-link:not(.ellipsis):focus-visible,.page-link:not(.ellipsis):hover{background-color:var(--sgds-primary-surface-translucent);color:var(--sgds-primary-color-default)}.page-link:not(.ellipsis):focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.page-item>.page-link:not(.ellipsis){cursor:pointer}.page-item.active .page-link{background-color:var(--sgds-primary-surface-default);color:var(--sgds-color-fixed-light)}.ellipsis-disabled,.page-item.disabled .page-link{opacity:var(--sgds-opacity-40)}.ellipsis-disabled{cursor:not-allowed;pointer-events:none}.pagination-sm .page-link{font-size:var(--sgds-font-size-label-sm);height:var(--sgds-dimension-40);width:var(--sgds-dimension-40)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pagination-description{align-items:center;display:flex}.pagination-sm .pagination-description{font-size:var(--sgds-font-size-label-sm)}`;x();var G_=class extends D{constructor(...e){super(...e),this.dataLength=0,this.currentPage=1,this.itemsPerPage=5,this.variant=`default`,this.navigation=`icon-button`,this.size=`md`,this._limit=4,this.ellipsisContent=y`
|
|
2932
2933
|
<span aria-hidden="true">…</span>
|
|
2933
2934
|
<span class="sr-only" role="text">Ellipsis</span>
|
|
2934
2935
|
`,this._renderFirstEllipsis=()=>this.pages.length<=7||!(this.pages.length!==this._limit&&this.currentPage>4)?null:y`
|
|
@@ -2949,7 +2950,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
2949
2950
|
variant="ghost"
|
|
2950
2951
|
>${r}${e}</sgds-button
|
|
2951
2952
|
>
|
|
2952
|
-
`}}static{this.styles=[...D.styles,
|
|
2953
|
+
`}}static{this.styles=[...D.styles,W_]}static{this.dependencies={"sgds-icon-button":ym,"sgds-button":B,"sgds-icon":L}}_handleValueChange(){return this.emit(`sgds-page-change`,{detail:{currentPage:this.currentPage}}),this._limit=this.pages.length<=7?5:this.pages.length-this.currentPage<=3?4:this.currentPage>4?3:4}_handlePageClick(e){let t=e.target.closest(`.page-item`);if(t){let e=Number(t.getAttribute(`key`));e!==this.currentPage&&(this.currentPage=e)}}_handleNextButton(){this.currentPage+=1}_handlePrevButton(){--this.currentPage}get pages(){let e=[];for(let t=1;t<=Math.ceil(this.dataLength/this.itemsPerPage);t++)e.push(t);return e}_handleKeyDown(e,t,n,r){if(e.key===`Enter`)switch(t){case`pageNumber`:this.currentPage=n;break;case`directionButton`:r?this._handlePrevButton():this._handleNextButton()}}_renderFirstPage(){return y`
|
|
2953
2954
|
<div key=${1} class="page-item ${this.currentPage===1?`active`:``}">
|
|
2954
2955
|
<span
|
|
2955
2956
|
role="button"
|
|
@@ -3023,15 +3024,15 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3023
3024
|
${this.variant===`button`?this._renderButtonPagination():b}
|
|
3024
3025
|
</div>
|
|
3025
3026
|
</nav>
|
|
3026
|
-
`}};E([S({type:Number})],
|
|
3027
|
+
`}};E([S({type:Number})],G_.prototype,`dataLength`,void 0),E([S({type:Number})],G_.prototype,`currentPage`,void 0),E([S({type:Number})],G_.prototype,`itemsPerPage`,void 0),E([S({type:String})],G_.prototype,`variant`,void 0),E([S({type:String})],G_.prototype,`navigation`,void 0),E([S({type:String})],G_.prototype,`size`,void 0),E([C()],G_.prototype,`_limit`,void 0),E([F(`currentPage`,{waitUntilFirstUpdate:!1})],G_.prototype,`_handleValueChange`,null),x();var K_=class extends D{static{this.styles=[...D.styles,u`
|
|
3027
3028
|
:host {
|
|
3028
3029
|
display: contents;
|
|
3029
3030
|
}
|
|
3030
|
-
`]}render(){return y`<slot></slot>`}};E([S({type:Number})],
|
|
3031
|
+
`]}render(){return y`<slot></slot>`}};E([S({type:Number})],K_.prototype,`colSpan`,void 0),E([S({type:Number})],K_.prototype,`rowSpan`,void 0),x();var K=class extends D{constructor(...e){super(...e),this.textAlign=`left`,this.sorting=!1,this.sortKey=``}static{this.styles=[...D.styles,u`
|
|
3031
3032
|
:host {
|
|
3032
3033
|
display: contents;
|
|
3033
3034
|
}
|
|
3034
|
-
`]}handleSortClick(){if(!this.sorting)return;let e=this.sortDirection===`ascending`?`descending`:this.sortDirection===`descending`?`none`:`ascending`;this.sortDirection=e,this.emit(`i-sgds-sort`,{detail:{key:this.sortKey,direction:e},bubbles:!0,composed:!0})}render(){return y`<slot></slot>`}};E([S({type:String,reflect:!0})],
|
|
3035
|
+
`]}handleSortClick(){if(!this.sorting)return;let e=this.sortDirection===`ascending`?`descending`:this.sortDirection===`descending`?`none`:`ascending`;this.sortDirection=e,this.emit(`i-sgds-sort`,{detail:{key:this.sortKey,direction:e},bubbles:!0,composed:!0})}render(){return y`<slot></slot>`}};E([S({type:String,reflect:!0})],K.prototype,`width`,void 0),E([S({type:Number})],K.prototype,`colSpan`,void 0),E([S({type:Number})],K.prototype,`rowSpan`,void 0),E([S({type:String,reflect:!0})],K.prototype,`textAlign`,void 0),E([S({type:String,reflect:!0})],K.prototype,`sortDirection`,void 0),E([S({type:Boolean,reflect:!0})],K.prototype,`sorting`,void 0),E([S({type:String,reflect:!0})],K.prototype,`sortKey`,void 0),x();var q_=class extends D{constructor(...e){super(...e),this.expand=!1,this.open=!1,this.checked=!1,this.showCheckbox=!1,this.showExpandPlaceholder=!1,this.columnAlignments=[],this.hasDataRows=!1,this._isHeaderRow=!1,this._cellSlotNames=/* @__PURE__ */ new WeakMap}static{this.styles=[...D.styles,U_]}static{this.dependencies={"sgds-checkbox":H,"sgds-data-table-cell":K_,"sgds-data-table-head":K,"sgds-icon":L}}get checkbox(){return this._checkboxEl??null}connectedCallback(){super.connectedCallback(),this._lightDomObserver=new MutationObserver(()=>this._handleLightDomChange()),this._lightDomObserver.observe(this,{childList:!0}),this._handleLightDomChange()}disconnectedCallback(){this._lightDomObserver?.disconnect(),super.disconnectedCallback()}firstUpdated(){this._expandableBody&&(this._expandableBody.hidden=!this.open)}async handleExpandedChange(){if(this.open){if(this.emit(`sgds-show`,{cancelable:!0}).defaultPrevented){this.open=!1;return}await j(this._expandableBody),this._expandableBody.hidden=!1;let{keyframes:e,options:t}=M(this,`row.expand.show`);await A(this._expandableBody,ht(e,this._expandableBody.scrollHeight),t),this.emit(`sgds-after-show`)}else{if(this.emit(`sgds-hide`,{cancelable:!0}).defaultPrevented){this.open=!0;return}await j(this._expandableBody);let{keyframes:e,options:t}=M(this,`row.expand.hide`);await A(this._expandableBody,ht(e,this._expandableBody.scrollHeight),t),this._expandableBody.hidden=!0,this.emit(`sgds-after-hide`)}}async show(){if(!this.open)return this.open=!0,P(this,`sgds-after-show`)}async hide(){if(this.open)return this.open=!1,P(this,`sgds-after-hide`)}getCellText(e){let t=this._getCells().filter(e=>e instanceof K_)[e];return t?(t.textContent??``).trim():``}_getCells(){return Array.from(this.children).filter(e=>e instanceof K_||e instanceof K)}_syncCellSlots(e){e.forEach(t=>{let n=`cell-${e.indexOf(t)}`;this._cellSlotNames.set(t,n),t.getAttribute(`slot`)!==n&&t.setAttribute(`slot`,n)})}_handleLightDomChange(){let e=this._getCells();this._syncCellSlots(e),this._isHeaderRow=e.some(e=>e instanceof K),this.requestUpdate()}_onCheckboxChange(e){this.emit(`i-sgds-change`,{detail:{checked:e.target.checked}})}_toggleExpand(){this.open?this.hide():this.show()}_onExpandKeyDown(e){e.key===`Enter`&&(e.preventDefault(),this._toggleExpand())}_onSortKeyDown(e,t){e.key===`Enter`&&(e.preventDefault(),t.handleSortClick())}_renderCell(e,t){let n=this._cellSlotNames.get(e);if(e instanceof K)return y`<th
|
|
3035
3036
|
width=${k(e.width)}
|
|
3036
3037
|
colspan=${k(e.colSpan)}
|
|
3037
3038
|
rowspan=${k(e.rowSpan)}
|
|
@@ -3063,17 +3064,25 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3063
3064
|
<div class="data-table-cell ${r===`right`?`align-right`:`align-left`}">
|
|
3064
3065
|
${n?y`<slot name=${n}></slot>`:b}
|
|
3065
3066
|
</div>
|
|
3066
|
-
</td>`}_renderExpandCell(){return this._isHeaderRow?y`<th class="control-cell" scope="col"></th>`:y`<td class="control-cell" @click=${this._toggleExpand} @keydown=${this._onExpandKeyDown} tabindex="0">
|
|
3067
|
+
</td>`}_renderExpandCell(){return this._isHeaderRow?y`<th class="control-cell" scope="col"><span class="visually-hidden">Expand</span></th>`:y`<td class="control-cell" @click=${this._toggleExpand} @keydown=${this._onExpandKeyDown} tabindex="0">
|
|
3067
3068
|
<div class="data-table-cell expand-cell">
|
|
3068
3069
|
<sgds-icon name=${this.open?`chevron-up`:`chevron-down`} size="md"></sgds-icon>
|
|
3069
3070
|
</div>
|
|
3070
|
-
</td>`}_renderExpandPlaceholder(){return this._isHeaderRow?y`<th class="control-cell" scope="col"></th>`:y`<td class="control-cell"></td>`}_renderCheckboxCell(){return this._isHeaderRow?y`<th class="control-cell" scope="col">
|
|
3071
|
+
</td>`}_renderExpandPlaceholder(){return this._isHeaderRow?y`<th class="control-cell" scope="col"><span class="visually-hidden">Expand</span></th>`:y`<td class="control-cell"></td>`}_renderCheckboxCell(){return this._isHeaderRow?y`<th class="control-cell" scope="col">
|
|
3071
3072
|
<div class="data-table-cell checkbox-cell">
|
|
3072
|
-
<sgds-checkbox
|
|
3073
|
+
<sgds-checkbox
|
|
3074
|
+
.checked=${this.checked}
|
|
3075
|
+
@sgds-change=${this._onCheckboxChange}
|
|
3076
|
+
.ariaLabel=${`Select all rows`}
|
|
3077
|
+
></sgds-checkbox>
|
|
3073
3078
|
</div>
|
|
3074
3079
|
</th>`:y`<td class="control-cell">
|
|
3075
3080
|
<div class="data-table-cell checkbox-cell">
|
|
3076
|
-
<sgds-checkbox
|
|
3081
|
+
<sgds-checkbox
|
|
3082
|
+
.checked=${this.checked}
|
|
3083
|
+
@sgds-change=${this._onCheckboxChange}
|
|
3084
|
+
.ariaLabel=${`Select row`}
|
|
3085
|
+
></sgds-checkbox>
|
|
3077
3086
|
</div>
|
|
3078
3087
|
</td>`}render(){let e=this._getCells(),t=e.length+ +!!this.showCheckbox+(this.expand||this.showExpandPlaceholder?1:0),n=this._isHeaderRow?`row row-header`:`row row-body`;return y`
|
|
3079
3088
|
<tr part=${n} ?data-header-row=${this._isHeaderRow} class=${this.open?`active`:``}>
|
|
@@ -3093,7 +3102,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3093
3102
|
</td>
|
|
3094
3103
|
</tr>
|
|
3095
3104
|
`:b}
|
|
3096
|
-
`}};E([S({type:Boolean,reflect:!0})],
|
|
3105
|
+
`}};E([S({type:Boolean,reflect:!0})],q_.prototype,`expand`,void 0),E([S({type:Boolean,reflect:!0})],q_.prototype,`open`,void 0),E([S({type:Boolean,reflect:!0})],q_.prototype,`checked`,void 0),E([S({type:Boolean})],q_.prototype,`showCheckbox`,void 0),E([S({type:Boolean})],q_.prototype,`showExpandPlaceholder`,void 0),E([S({attribute:!1})],q_.prototype,`columnAlignments`,void 0),E([S({type:Boolean})],q_.prototype,`hasDataRows`,void 0),E([w(`.expandable-body`)],q_.prototype,`_expandableBody`,void 0),E([w(`sgds-checkbox`)],q_.prototype,`_checkboxEl`,void 0),E([C()],q_.prototype,`_isHeaderRow`,void 0),E([F(`open`,{waitUntilFirstUpdate:!0})],q_.prototype,`handleExpandedChange`,null),N(`row.expand.show`,{keyframes:[{height:`0`,opacity:`0`},{height:`auto`,opacity:`1`}],options:{duration:250,easing:`ease-in-out`}}),N(`row.expand.hide`,{keyframes:[{height:`auto`,opacity:`1`},{height:`0`,opacity:`0`}],options:{duration:250,easing:`ease-in-out`}}),x();var J_=u`.skeleton{--bg:var(--sgds-bg-translucent-subtle);background-color:var(--bg);border-radius:var(--sgds-border-radius-sm);display:flex;flex-direction:column;gap:var(--sgds-gap-xs);max-width:100%}.skeleton.skeleton-paragraph{background-color:transparent}.skeleton.skeleton-paragraph.auto-size-rows>div[class*=skeleton-row]{background-color:var(--sgds-bg-translucent);border-radius:var(--sgds-border-radius-sm);height:-webkit-fill-available}.sheen{--sheen-color:var(--sgds-bg-translucent);animation:sheen 8s ease-in-out infinite;background:linear-gradient(270deg,var(--bg) 0,var(--sheen-color) 33.33%,var(--sheen-color) 66.67%,var(--bg) 100%);background-size:400% 100%}@keyframes sheen{0%{background-position:200% 0}to{background-position:-200% 0}}`;x();var Y_=class extends D{constructor(...e){super(...e),this.width=``,this.height=``,this.borderRadius=``,this.sheen=!1}static{this.styles=[J_]}render(){let e={width:this.width||void 0,height:this.height||void 0,borderRadius:this.borderRadius||void 0};return y`
|
|
3097
3106
|
<div
|
|
3098
3107
|
class=${O({skeleton:!0,"skeleton-paragraph":this.rows>0,"auto-size-rows":this.rows>0,sheen:this.sheen&&!this.rows})}
|
|
3099
3108
|
style=${Object.entries(e).filter(([e,t])=>t).map(([e,t])=>`${e.replace(/([A-Z])/g,`-$1`).toLowerCase()}: ${t}`).join(`; `)}
|
|
@@ -3103,11 +3112,11 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3103
3112
|
style=${this.borderRadius?`border-radius: ${this.borderRadius}`:b}
|
|
3104
3113
|
></div>`}):b}
|
|
3105
3114
|
</div>
|
|
3106
|
-
`}};E([w(`.skeleton`)],
|
|
3115
|
+
`}};E([w(`.skeleton`)],Y_.prototype,`skeleton`,void 0),E([S({type:String,reflect:!0})],Y_.prototype,`width`,void 0),E([S({type:String,reflect:!0})],Y_.prototype,`height`,void 0),E([S({type:String,reflect:!0})],Y_.prototype,`borderRadius`,void 0),E([S({type:Number,reflect:!0})],Y_.prototype,`rows`,void 0),E([S({type:Boolean,reflect:!0})],Y_.prototype,`sheen`,void 0),x();var X_=class extends D{constructor(...e){super(...e),this.multiSelect=!1,this.dataLength=0,this.currentPage=1,this.itemsPerPage=5,this.paginationSummary=``,this.loading=!1,this.serverSort=!1,this.paginationVariant=`default`,this.layout=`auto`,this.mode=`client`,this.tableRows=[],this.headerRows=[],this._headerCells=[],this._initialRowPositions=/* @__PURE__ */ new WeakMap,this._hasCapturedInitialRowPositions=!1,this._rowHandlers=/* @__PURE__ */ new WeakMap}static{this.styles=[...D.styles,U_,u`
|
|
3107
3116
|
:host {
|
|
3108
3117
|
display: block;
|
|
3109
3118
|
}
|
|
3110
|
-
`]}static{this.dependencies={"sgds-pagination":
|
|
3119
|
+
`]}static{this.dependencies={"sgds-pagination":G_,"sgds-data-table-cell":K_,"sgds-data-table-head":K,"sgds-skeleton":Y_}}connectedCallback(){super.connectedCallback()}_isRowChecked(e){return e.checked||e.checkbox?.checked===!0}_updateHeaderCheckbox(){let e=this.tableRows.filter(e=>this._isRowChecked(e)).length,t=e===this.tableRows.length&&e>0;this.headerRows.forEach(n=>{n.checked=t,n.checkbox&&(n.checkbox.checked=t,n.checkbox.indeterminate=e>0&&!t)})}async _syncHeaderCheckboxAfterRender(){if(!this.multiSelect||this.headerRows.length===0)return;let e=[...this.headerRows,...this.tableRows];await Promise.all(e.map(e=>e.updateComplete)),this._updateHeaderCheckbox()}_emitRowSelect(){let e=this.tableRows.filter(e=>this._isRowChecked(e)).map(e=>this._getRowData(e));this.emit(`sgds-row-select`,{detail:{selected:e}})}_attachRowListener(e){let t=this._rowHandlers.get(e);t&&e.removeEventListener(`i-sgds-change`,t);let n=t=>{let{checked:n}=t.detail;this.headerRows.includes(e)?this.tableRows.forEach(e=>{e.checked=n,e.checkbox&&(e.checkbox.checked=n)}):(e.checked=n,this._updateHeaderCheckbox()),this._emitRowSelect()};this._rowHandlers.set(e,n),e.addEventListener(`i-sgds-change`,n)}_configureRows(){let e=this.tableRows.some(e=>e.expand),t=this.tableRows.length>0;this.headerRows.forEach(n=>{n.showCheckbox=this.multiSelect,n.showExpandPlaceholder=e,n.hasDataRows=t,this.multiSelect&&this._attachRowListener(n)}),this.tableRows.forEach(t=>{t.showCheckbox=this.multiSelect,t.showExpandPlaceholder=!t.expand&&e,this.multiSelect&&this._attachRowListener(t)}),this.multiSelect&&this._syncHeaderCheckboxAfterRender(),this._applyColumnAlignment()}_applyColumnAlignment(){let e=this._headerCells.reduce((e,t)=>{let n=Number(t.colSpan)>0?Number(t.colSpan):1,r=t.textAlign??`left`;for(let t=0;t<n;t++)e.push(r);return e},[]);this.headerRows.forEach(t=>{t.columnAlignments=[...e]}),this.tableRows.forEach(t=>{t.columnAlignments=[...e]})}_extractCellText(e,t){return e.getCellText(t)||(Array.from(e.children).filter(e=>e.tagName.toLowerCase()===`sgds-data-table-cell`)[t]?.textContent||``).trim()}_getRowData(e){let t={};return this._headerCells.forEach((n,r)=>{let i=n.sortKey||(n.textContent??``).trim()||`col-${r}`;t[i]=this._extractCellText(e,r)}),t}_toComparableValue(e,t,n){return this._extractCellText(e,n)}_compareValues(e,t,n){if(e===t)return 0;let r=Number(e),i=Number(t);if(Number.isFinite(r)&&Number.isFinite(i))return n===`ascending`?r-i:i-r;let a=String(e).localeCompare(String(t),void 0,{numeric:!0,sensitivity:`base`});return n===`ascending`?a:-a}_resetOtherHeaderSortStates(e){this._headerCells.forEach(t=>{t!==e&&t.sorting&&(t.sortDirection=`none`)})}_getRowsInInitialPositionOrder(e){return[...e].sort((e,t)=>{let n=this._initialRowPositions.get(e),r=this._initialRowPositions.get(t);return n===void 0&&r===void 0?0:n===void 0?1:r===void 0?-1:n-r})}_captureInitialRowPositions(e){this._hasCapturedInitialRowPositions||=(e.forEach((e,t)=>{this._initialRowPositions.set(e,t)}),!0)}_handleSort(e){let t=e.composedPath().find(e=>e instanceof K);if(!t||!t.sorting)return;let{key:n,direction:r}=e.detail,i=t?this._headerCells.indexOf(t):-1;if(this._resetOtherHeaderSortStates(t),this.serverSort){e.stopPropagation(),this.emit(`sgds-sort`,{detail:{key:n,direction:r}});return}if(!(i<0)){if(r===`none`){this.tableRows=this._getRowsInInitialPositionOrder(this.tableRows),this._syncDomRowOrder(),this._updateVisibleRows();return}if(this.mode===`client`){let e=(this.currentPage-1)*this.itemsPerPage,t=e+this.itemsPerPage,a=[...this.tableRows],o=a.slice(e,t).sort((e,t)=>{let a=this._toComparableValue(e,n,i),o=this._toComparableValue(t,n,i);return this._compareValues(a,o,r)});a.splice(e,o.length,...o),this.tableRows=a,this._syncDomRowOrder(),this._updateVisibleRows();return}this.tableRows=[...this.tableRows].sort((e,t)=>{let a=this._toComparableValue(e,n,i),o=this._toComparableValue(t,n,i);return this._compareValues(a,o,r)}),this._syncDomRowOrder(),this._updateVisibleRows()}}_syncDomRowOrder(){let e=this.tableRows[0]?.parentElement;e&&this.tableRows.forEach(t=>e.appendChild(t))}_handleSlotChange(e){let t=e.target.assignedElements({flatten:!0}).filter(e=>e instanceof q_),n=e=>Array.from(e.children).filter(e=>{let t=e.tagName.toLowerCase();return t!==`sgds-data-table-cell`&&t!==`sgds-data-table-head`?!1:e.getAttribute(`slot`)!==`content`});this.headerRows=t.filter(e=>n(e).some(e=>e.tagName.toLowerCase()===`sgds-data-table-head`)),this.tableRows=t.filter(e=>{let t=n(e);return t.length>0&&t.every(e=>e.tagName.toLowerCase()===`sgds-data-table-cell`)}),this._headerCells=this.headerRows.reduce((e,t)=>{let n=Array.from(t.children).filter(e=>e instanceof K);return e.push(...n),e},[]),this._captureInitialRowPositions(this.tableRows),this._headerCells.forEach(e=>{e.sorting&&!e.sortDirection&&(e.sortDirection=`none`)}),this._configureRows(),this._updateVisibleRows()}_updateVisibleRows(){if(this.loading){this.tableRows.forEach(e=>e.style.display=`none`);return}if(this.mode===`server`){this.tableRows.forEach(e=>e.style.display=``);return}let e=this.dataLength||this.tableRows.length,t=Math.max(1,Math.ceil(e/this.itemsPerPage));if(this.currentPage>t){this.currentPage=t;return}let n=(this.currentPage-1)*this.itemsPerPage,r=new Set(this.tableRows.slice(n,n+this.itemsPerPage));this.tableRows.forEach(e=>e.style.display=r.has(e)?``:`none`)}_getSkeletonColumnCount(){let e=this._headerCells.reduce((e,t)=>e+(Number(t.colSpan)>0?Number(t.colSpan):1),0),t=this.tableRows[0],n=t?Array.from(t.children).filter(e=>e instanceof K_).length:0,r=this.tableRows.some(e=>e.expand);return{dataColumns:e||n||1,hasExpand:r,hasCheckbox:this.multiSelect}}_renderLoadingSkeleton(){let{dataColumns:e,hasExpand:t,hasCheckbox:n}=this._getSkeletonColumnCount(),r=Math.max(1,this.itemsPerPage||1);return Array.from({length:r},()=>y`<div class="skeleton-row" role="presentation">
|
|
3111
3120
|
${t?y`<div class="skeleton-cell control-cell">
|
|
3112
3121
|
<sgds-skeleton .height=${`20px`} .width=${`20px`} .borderRadius=${`4px`}></sgds-skeleton>
|
|
3113
3122
|
</div>`:b}
|
|
@@ -3120,7 +3129,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3120
3129
|
</div>`)}updated(e){(e.has(`currentPage`)||e.has(`itemsPerPage`)||e.has(`mode`)||e.has(`loading`))&&this._updateVisibleRows(),e.has(`multiSelect`)&&this._configureRows(),this.multiSelect&&(e.has(`tableRows`)||e.has(`headerRows`))&&this._syncHeaderCheckboxAfterRender()}render(){let e=this.dataLength||this.tableRows.length,t=(this.currentPage-1)*this.itemsPerPage,n=Math.min(t+this.itemsPerPage,e),r=e===0?0:t+1,i=!this.loading&&this.tableRows.length===0,a=e!==0;return y`
|
|
3121
3130
|
<div class="data-table">
|
|
3122
3131
|
<div class="table-container">
|
|
3123
|
-
<div class="table">
|
|
3132
|
+
<div class="table" role="table">
|
|
3124
3133
|
<slot @slotchange=${this._handleSlotChange} @i-sgds-sort=${this._handleSort}></slot>
|
|
3125
3134
|
${this.loading?this._renderLoadingSkeleton():b}
|
|
3126
3135
|
</div>
|
|
@@ -3139,7 +3148,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3139
3148
|
></sgds-pagination>
|
|
3140
3149
|
</div>`:b}
|
|
3141
3150
|
</div>
|
|
3142
|
-
`}};E([S({type:Boolean})],Z_.prototype,`multiSelect`,void 0),E([S({type:Number})],Z_.prototype,`dataLength`,void 0),E([S({type:Number})],Z_.prototype,`currentPage`,void 0),E([S({type:Number})],Z_.prototype,`itemsPerPage`,void 0),E([S({type:String})],Z_.prototype,`paginationSummary`,void 0),E([S({type:Boolean})],Z_.prototype,`loading`,void 0),E([S({type:Boolean})],Z_.prototype,`serverSort`,void 0),E([S({type:String})],Z_.prototype,`paginationVariant`,void 0),E([S({type:String,reflect:!0})],Z_.prototype,`layout`,void 0),E([S({type:String})],Z_.prototype,`mode`,void 0),E([C()],Z_.prototype,`tableRows`,void 0),E([C()],Z_.prototype,`headerRows`,void 0);function Q_(e){if(e>=11&&e<=13)return e+`th`;switch(e%10){case 1:return e+`st`;case 2:return e+`nd`;case 3:return e+`rd`;default:return e+`th`}}function $_(e,t){let n=e.getDate(),r=e.getMonth()+1,i=e.getFullYear(),a=n<10?`0`+n:String(n),o=r<10?`0`+r:String(r),s=String(i);switch(t){case`dd/MM/yyyy`:return`${a}/${o}/${s}`;case`MM/dd/yyyy`:return`${o}/${a}/${s}`;case`yyyy/MM/dd`:return`${s}/${o}/${a}`;case`PPPP`:return`${new Intl.DateTimeFormat(`en-US`,{weekday:`long`}).format(e)}, ${new Intl.DateTimeFormat(`en-US`,{month:`long`}).format(e)} ${Q_(e.getDate())}, ${e.getFullYear()}`;default:return`${a}/${o}/${s}`}}function ev(e){return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()}function tv(e,t){return e.getTime()>t.getTime()}function nv(e,t){return e.getTime()<t.getTime()}function rv(e,t){return e.getTime()===t.getTime()}function iv(e){return e.getDate()===ev(e)}function av(e){return e instanceof Date&&!isNaN(e.getTime())}function ov(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function sv(e,t){let n=e.split(`/`),r,i,a;switch(t){case`dd/MM/yyyy`:r=parseInt(n[0],10),i=parseInt(n[1],10)-1,a=parseInt(n[2],10);break;case`MM/dd/yyyy`:i=parseInt(n[0],10)-1,r=parseInt(n[1],10),a=parseInt(n[2],10);break;case`yyyy/MM/dd`:a=parseInt(n[0],10),i=parseInt(n[1],10)-1,r=parseInt(n[2],10);break;default:return/* @__PURE__ */ new Date(NaN)}if(isNaN(r)||isNaN(i)||isNaN(a))return/* @__PURE__ */ new Date(NaN);let o=new Date(a,i,r,12,0,0,0);return o.getFullYear()!==a||o.getMonth()!==i||o.getDate()!==r?/* @__PURE__ */ new Date(NaN):o}let cv={"DD/MM/YYYY":{imPattern:"`dd{/}`mm{/}`yyyy",imRangePattern:"`dd{/}`mm{/}`yyyy - `DD{/}`MM{/}`YYYY",fnsPattern:`dd/MM/yyyy`},"MM/DD/YYYY":{imPattern:"`mm{/}`dd{/}`yyyy",imRangePattern:"`mm{/}`dd{/}`yyyy - `MM{/}`DD{/}`YYYY",fnsPattern:`MM/dd/yyyy`},"YYYY/MM/DD":{imPattern:"`yyyy{/}`mm{/}`dd",imRangePattern:"`yyyy{/}`mm{/}`dd - `YYYY{/}`MM{/}`DD",fnsPattern:`yyyy/MM/dd`}},lv=(e,t)=>{let n=e.getFullYear(),r=(n-t)%12,i=r<0?12+r:r,a=[],o=n-i,s=n-i+12-1;for(let e=o;e<s+1;e++)a.push(e);return a},uv=e=>{let t=e.getMonth(),n=e.getFullYear(),r=e.getDate(),i=new Date(n,t+1),a=ev(i);return iv(e)&&a<r?ov(i):new Date(n,t+1,r)},dv=e=>{let t=e.getMonth(),n=e.getFullYear(),r=e.getDate(),i=new Date(n,t-1),a=ev(i);return iv(e)&&a<r?ov(i):new Date(n,t-1,r)},K=e=>{let t=new Date(e);return t.setHours(12),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t};x();var fv=u`.datepicker-body{color:var(--sgds-form-color-default);display:flex;justify-content:center}table{border-collapse:collapse;text-align:center}.monthpicker,.yearpicker{display:grid;grid-template-columns:repeat(3,6rem);grid-template-rows:repeat(4,2.5rem)}.monthpicker [role=row],.yearpicker [role=row]{display:contents}button.month,button.year{background-color:transparent;border:0;border-radius:var(--sgds-form-border-radius-sm);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs);padding:0;position:relative}button.month.active:not(.selected-ends),button.year.active:not(.selected-ends),td[data-day].active:not(.selected-ends){background-color:var(--sgds-primary-surface-translucent);border-radius:0;cursor:pointer}button.month:hover:not(.active),button.year:hover:not(.active),td[data-day]:hover:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle);cursor:pointer}button.month:focus:not(.active),button.year:focus:not(.active),td[data-day]:focus:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle)}button.month:focus-visible,button.year:focus-visible,td[data-day]:focus-visible{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}button.month.active:not(.selected-ends):focus,button.year.active:not(.selected-ends):focus,td[data-day].active:not(.selected-ends):focus{border-radius:var(--sgds-form-border-radius-sm)}button.year.active{background-color:var(--sgds-primary-surface-translucent);cursor:pointer}td,th{border-radius:var(--sgds-form-border-radius-sm);font-size:var(--sgds-font-size-label-sm);height:var(--sgds-form-height-lg);line-height:var(--sgds-line-height-2-xs);padding:0;position:relative;width:var(--sgds-form-width-md)}th{font-weight:var(--sgds-font-weight-semibold)}td[data-day]{cursor:pointer}button.month.active.selected-ends,button.year.active.selected-ends,td[data-day].active.selected-ends{background-color:var(--sgds-form-primary-surface-default);color:var(--sgds-form-color-fixed-light)}button.month.active.selected-ends:focus,button.month.active.selected-ends:hover,button.year.active.selected-ends:focus,button.year.active.selected-ends:hover,td[data-day].active.selected-ends:focus,td[data-day].active.selected-ends:hover{background-color:var(--sgds-form-primary-surface-emphasis)}td[data-day].disabled{cursor:not-allowed;opacity:var(--sgds-opacity-40)}.today{align-items:center;display:flex;flex-direction:column;justify-content:center}.today:after{background-color:var(--sgds-form-primary-surface-default);bottom:6px;content:".";line-height:4px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none' viewBox='0 0 4 4'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235a42c0'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none' viewBox='0 0 4 4'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235a42c0'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;position:absolute;width:4px}.today.active.selected-ends:after{background-color:var(--sgds-form-color-inverse)}`;x();let pv=/* @__PURE__ */ new Date,mv={ArrowUp:{days:-7,months:-3,years:-3},ArrowDown:{days:7,months:3,years:3},ArrowRight:{days:1,months:1,years:1},ArrowLeft:{days:-1,months:-1,years:-1}};var hv=class e extends D{constructor(...e){super(...e),this.selectedDate=[],this.mode=`single`}static{this.styles=[fv]}static{this.DAY_LABELS=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]}static{this.daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31]}static{this.MONTHVIEW_LABELS=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]}focusOnCalendar(e){e.blur(),this._focusOnCalendarCell()}connectedCallback(){super.connectedCallback(),this.addEventListener(`keydown`,this._handleKeyPress),this.addEventListener(`blur`,e=>e.stopPropagation())}updated(){this.focusedTabIndex===3&&this._focusOnCalendarCell()}_updateFocusedDate(){this.focusedDate=K(this.displayDate),this.focusedDate.getFullYear()<1900&&this.focusedDate.setFullYear(1900)}_setFocusedDate(e){let t=this.focusedDate.getDate(),n=this.focusedDate.getMonth(),r=this.focusedDate.getFullYear();switch(this.view){case`days`:{let i=K(new Date(r,n,t+e));(tv(i,new Date(0,0,1,12))||rv(i,new Date(0,0,1,12)))&&(this.focusedDate=i);break}case`months`:{let i=K(new Date(r,n+e,t));(tv(i,new Date(0,0,1,12))||rv(i,new Date(0,0,1,12)))&&(this.focusedDate=i);break}case`years`:{let i=K(new Date(r+e,n,t));i.getFullYear()>=1900&&(this.focusedDate=i);break}}}_handleEnterDateKeyboard(e){let t=e.composedPath()[0];if(!t.classList.contains(`disabled`))switch(this.view){case`days`:this._onClickDay(e);break;case`months`:{let{month:e}=t.dataset;this._onClickMonth(parseInt(e));break}case`years`:{let{year:e}=t.dataset;this._onClickYear(parseInt(e))}}}_handleKeyPress(e){if(e.key===`Enter`){e.preventDefault(),this._handleEnterDateKeyboard(e);return}if(e.key===`Tab`){let e=this._getFocusedTarget();this.focusedTabIndex!==3&&e.blur();return}if(e.key.includes(`Arrow`)){e.preventDefault(),this._blurCalendarCell();let t=mv[e.key][this.view];this._setFocusedDate(t),this._focusOnCalendarCell()}}_getSelectedRange(){if(this.selectedDate.length===0)return null;let e=K(this.selectedDate[0]);if(this.selectedDate.length<2)return{start:e,end:e};let t=K(this.selectedDate[1]);return e.getTime()<=t.getTime()?{start:e,end:t}:{start:t,end:e}}_onClickDay(e){let{day:t,date:n}=e.composedPath()[0].dataset,r=new Date(this.displayDate);if(r.setDate(parseInt(t)),e.type===`click`&&(this.focusedDate=K(new Date(n))),this.mode===`single`)this.selectedDate=[r],this.emit(`sgds-selectdates`,{detail:this.selectedDate});else if(this.mode===`range`){let e=[...this.selectedDate];(e.length===0||e.length===2)&&(e.length=0),e.push(r),this.selectedDate=e,this.emit(`sgds-selectdates`,{detail:this.selectedDate})}let i=this.minDate?K(new Date(this.minDate)):null,a=this.maxDate?K(new Date(this.maxDate)):null,o=K(r);(i&&o<i||a&&o>a)&&(e.stopPropagation(),e.preventDefault())}_onClickMonth(e,t=this.focusedDate.getFullYear()){let n=new Date(this.displayDate);this.view=`days`,n.setMonth(e),n.setFullYear(t),this.displayDate=n,this.emit(`sgds-view`,{detail:this.view}),this.emit(`sgds-selectmonth`,{detail:this.displayDate})}_onClickYear(e){let t=new Date(this.displayDate);t.setFullYear(e),this.displayDate=t,this.view=`months`,this.emit(`sgds-view`,{detail:this.view}),this.emit(`sgds-selectyear`,{detail:this.displayDate})}_getFocusedTarget(){let e={days:`td[data-date="${this.focusedDate.toISOString()}"]`,months:`button[data-month="${this.focusedDate.getMonth()}"][data-year="${this.focusedDate.getFullYear()}"]`,years:`button[data-year="${this.focusedDate.getFullYear()}"]`}[this.view];return this.shadowRoot.querySelector(`${e}`)}_blurCalendarCell(){let e=this._getFocusedTarget();e.setAttribute(`tabindex`,`-1`),e.blur()}_focusOnCalendarCell(){let e=this._getFocusedTarget();e?(e.setAttribute(`tabindex`,`0`),e.focus(),this.emit(`sgds-update-focus`,{detail:this.focusedDate})):this.emit(`sgds-change-calendar`,{detail:this.focusedDate})}_generateDays(){this.selectedDate.map(e=>K(e));let t=this._getSelectedRange(),n=this.minDate?K(new Date(this.minDate)):null,r=this.maxDate?K(new Date(this.maxDate)):null,i=this.displayDate.getFullYear(),a=this.displayDate.getMonth(),o=new Date(i,a,1).getDay(),s=e.daysInMonth[a];a===1&&(i%4==0&&i%100!=0||i%400==0)&&(s=29);let c=[],l=1;for(let e=0;e<9;e++){let u=[];for(let c=0;c<=6;c++)if(l<=s&&(e>0||c>=o)){let e=new Date(i,a,l,12,0,0,0),o=e.toISOString(),s=n&&Date.parse(o)<Date.parse(n.toISOString()),d=r&&Date.parse(o)>Date.parse(r.toISOString()),f=s||d?void 0:this._onClickDay,p=pv.getMonth()===this.displayDate.getMonth(),m=pv.getFullYear()===this.displayDate.getFullYear(),h=pv.getDate()===l,ee=Date.parse(o),g=t!==null&&ee>=t.start.getTime()&&ee<=t.end.getTime(),te=t!==null&&t.start.toISOString()===o,_=t!==null&&this.selectedDate.length>1&&t.end.toISOString()===o,ne=`${h&&p&&m?`Today's date, `:``}`+$_(e,`PPPP`);u.push(y`<td
|
|
3151
|
+
`}};E([S({type:Boolean})],X_.prototype,`multiSelect`,void 0),E([S({type:Number})],X_.prototype,`dataLength`,void 0),E([S({type:Number})],X_.prototype,`currentPage`,void 0),E([S({type:Number})],X_.prototype,`itemsPerPage`,void 0),E([S({type:String})],X_.prototype,`paginationSummary`,void 0),E([S({type:Boolean})],X_.prototype,`loading`,void 0),E([S({type:Boolean})],X_.prototype,`serverSort`,void 0),E([S({type:String})],X_.prototype,`paginationVariant`,void 0),E([S({type:String,reflect:!0})],X_.prototype,`layout`,void 0),E([S({type:String})],X_.prototype,`mode`,void 0),E([C()],X_.prototype,`tableRows`,void 0),E([C()],X_.prototype,`headerRows`,void 0);function Z_(e){if(e>=11&&e<=13)return e+`th`;switch(e%10){case 1:return e+`st`;case 2:return e+`nd`;case 3:return e+`rd`;default:return e+`th`}}function Q_(e,t){let n=e.getDate(),r=e.getMonth()+1,i=e.getFullYear(),a=n<10?`0`+n:String(n),o=r<10?`0`+r:String(r),s=String(i);switch(t){case`dd/MM/yyyy`:return`${a}/${o}/${s}`;case`MM/dd/yyyy`:return`${o}/${a}/${s}`;case`yyyy/MM/dd`:return`${s}/${o}/${a}`;case`PPPP`:return`${new Intl.DateTimeFormat(`en-US`,{weekday:`long`}).format(e)}, ${new Intl.DateTimeFormat(`en-US`,{month:`long`}).format(e)} ${Z_(e.getDate())}, ${e.getFullYear()}`;default:return`${a}/${o}/${s}`}}function $_(e){return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()}function ev(e,t){return e.getTime()>t.getTime()}function tv(e,t){return e.getTime()<t.getTime()}function nv(e,t){return e.getTime()===t.getTime()}function rv(e){return e.getDate()===$_(e)}function iv(e){return e instanceof Date&&!isNaN(e.getTime())}function av(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function ov(e,t){let n=e.split(`/`),r,i,a;switch(t){case`dd/MM/yyyy`:r=parseInt(n[0],10),i=parseInt(n[1],10)-1,a=parseInt(n[2],10);break;case`MM/dd/yyyy`:i=parseInt(n[0],10)-1,r=parseInt(n[1],10),a=parseInt(n[2],10);break;case`yyyy/MM/dd`:a=parseInt(n[0],10),i=parseInt(n[1],10)-1,r=parseInt(n[2],10);break;default:return/* @__PURE__ */ new Date(NaN)}if(isNaN(r)||isNaN(i)||isNaN(a))return/* @__PURE__ */ new Date(NaN);let o=new Date(a,i,r,12,0,0,0);return o.getFullYear()!==a||o.getMonth()!==i||o.getDate()!==r?/* @__PURE__ */ new Date(NaN):o}let sv={"DD/MM/YYYY":{imPattern:"`dd{/}`mm{/}`yyyy",imRangePattern:"`dd{/}`mm{/}`yyyy - `DD{/}`MM{/}`YYYY",fnsPattern:`dd/MM/yyyy`},"MM/DD/YYYY":{imPattern:"`mm{/}`dd{/}`yyyy",imRangePattern:"`mm{/}`dd{/}`yyyy - `MM{/}`DD{/}`YYYY",fnsPattern:`MM/dd/yyyy`},"YYYY/MM/DD":{imPattern:"`yyyy{/}`mm{/}`dd",imRangePattern:"`yyyy{/}`mm{/}`dd - `YYYY{/}`MM{/}`DD",fnsPattern:`yyyy/MM/dd`}},cv=(e,t)=>{let n=e.getFullYear(),r=(n-t)%12,i=r<0?12+r:r,a=[],o=n-i,s=n-i+12-1;for(let e=o;e<s+1;e++)a.push(e);return a},lv=e=>{let t=e.getMonth(),n=e.getFullYear(),r=e.getDate(),i=new Date(n,t+1),a=$_(i);return rv(e)&&a<r?av(i):new Date(n,t+1,r)},uv=e=>{let t=e.getMonth(),n=e.getFullYear(),r=e.getDate(),i=new Date(n,t-1),a=$_(i);return rv(e)&&a<r?av(i):new Date(n,t-1,r)},q=e=>{let t=new Date(e);return t.setHours(12),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t};x();var dv=u`.datepicker-body{color:var(--sgds-form-color-default);display:flex;justify-content:center}table{border-collapse:collapse;text-align:center}.monthpicker,.yearpicker{display:grid;grid-template-columns:repeat(3,6rem);grid-template-rows:repeat(4,2.5rem)}.monthpicker [role=row],.yearpicker [role=row]{display:contents}button.month,button.year{background-color:transparent;border:0;border-radius:var(--sgds-form-border-radius-sm);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs);padding:0;position:relative}button.month.active:not(.selected-ends),button.year.active:not(.selected-ends),td[data-day].active:not(.selected-ends){background-color:var(--sgds-primary-surface-translucent);border-radius:0;cursor:pointer}button.month:hover:not(.active),button.year:hover:not(.active),td[data-day]:hover:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle);cursor:pointer}button.month:focus:not(.active),button.year:focus:not(.active),td[data-day]:focus:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle)}button.month:focus-visible,button.year:focus-visible,td[data-day]:focus-visible{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}button.month.active:not(.selected-ends):focus,button.year.active:not(.selected-ends):focus,td[data-day].active:not(.selected-ends):focus{border-radius:var(--sgds-form-border-radius-sm)}button.year.active{background-color:var(--sgds-primary-surface-translucent);cursor:pointer}td,th{border-radius:var(--sgds-form-border-radius-sm);font-size:var(--sgds-font-size-label-sm);height:var(--sgds-form-height-lg);line-height:var(--sgds-line-height-2-xs);padding:0;position:relative;width:var(--sgds-form-width-md)}th{font-weight:var(--sgds-font-weight-semibold)}td[data-day]{cursor:pointer}button.month.active.selected-ends,button.year.active.selected-ends,td[data-day].active.selected-ends{background-color:var(--sgds-form-primary-surface-default);color:var(--sgds-form-color-fixed-light)}button.month.active.selected-ends:focus,button.month.active.selected-ends:hover,button.year.active.selected-ends:focus,button.year.active.selected-ends:hover,td[data-day].active.selected-ends:focus,td[data-day].active.selected-ends:hover{background-color:var(--sgds-form-primary-surface-emphasis)}td[data-day].disabled{cursor:not-allowed;opacity:var(--sgds-opacity-40)}.today{align-items:center;display:flex;flex-direction:column;justify-content:center}.today:after{background-color:var(--sgds-form-primary-surface-default);bottom:6px;content:".";line-height:4px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none' viewBox='0 0 4 4'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235a42c0'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none' viewBox='0 0 4 4'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235a42c0'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;position:absolute;width:4px}.today.active.selected-ends:after{background-color:var(--sgds-form-color-inverse)}`;x();let fv=/* @__PURE__ */ new Date,pv={ArrowUp:{days:-7,months:-3,years:-3},ArrowDown:{days:7,months:3,years:3},ArrowRight:{days:1,months:1,years:1},ArrowLeft:{days:-1,months:-1,years:-1}};var mv=class e extends D{constructor(...e){super(...e),this.selectedDate=[],this.mode=`single`}static{this.styles=[dv]}static{this.DAY_LABELS=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]}static{this.daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31]}static{this.MONTHVIEW_LABELS=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]}focusOnCalendar(e){e.blur(),this._focusOnCalendarCell()}connectedCallback(){super.connectedCallback(),this.addEventListener(`keydown`,this._handleKeyPress),this.addEventListener(`blur`,e=>e.stopPropagation())}updated(){this.focusedTabIndex===3&&this._focusOnCalendarCell()}_updateFocusedDate(){this.focusedDate=q(this.displayDate),this.focusedDate.getFullYear()<1900&&this.focusedDate.setFullYear(1900)}_setFocusedDate(e){let t=this.focusedDate.getDate(),n=this.focusedDate.getMonth(),r=this.focusedDate.getFullYear();switch(this.view){case`days`:{let i=q(new Date(r,n,t+e));(ev(i,new Date(0,0,1,12))||nv(i,new Date(0,0,1,12)))&&(this.focusedDate=i);break}case`months`:{let i=q(new Date(r,n+e,t));(ev(i,new Date(0,0,1,12))||nv(i,new Date(0,0,1,12)))&&(this.focusedDate=i);break}case`years`:{let i=q(new Date(r+e,n,t));i.getFullYear()>=1900&&(this.focusedDate=i);break}}}_handleEnterDateKeyboard(e){let t=e.composedPath()[0];if(!t.classList.contains(`disabled`))switch(this.view){case`days`:this._onClickDay(e);break;case`months`:{let{month:e}=t.dataset;this._onClickMonth(parseInt(e));break}case`years`:{let{year:e}=t.dataset;this._onClickYear(parseInt(e))}}}_handleKeyPress(e){if(e.key===`Enter`){e.preventDefault(),this._handleEnterDateKeyboard(e);return}if(e.key===`Tab`){let e=this._getFocusedTarget();this.focusedTabIndex!==3&&e.blur();return}if(e.key.includes(`Arrow`)){e.preventDefault(),this._blurCalendarCell();let t=pv[e.key][this.view];this._setFocusedDate(t),this._focusOnCalendarCell()}}_getSelectedRange(){if(this.selectedDate.length===0)return null;let e=q(this.selectedDate[0]);if(this.selectedDate.length<2)return{start:e,end:e};let t=q(this.selectedDate[1]);return e.getTime()<=t.getTime()?{start:e,end:t}:{start:t,end:e}}_onClickDay(e){let{day:t,date:n}=e.composedPath()[0].dataset,r=new Date(this.displayDate);if(r.setDate(parseInt(t)),e.type===`click`&&(this.focusedDate=q(new Date(n))),this.mode===`single`)this.selectedDate=[r],this.emit(`sgds-selectdates`,{detail:this.selectedDate});else if(this.mode===`range`){let e=[...this.selectedDate];(e.length===0||e.length===2)&&(e.length=0),e.push(r),this.selectedDate=e,this.emit(`sgds-selectdates`,{detail:this.selectedDate})}let i=this.minDate?q(new Date(this.minDate)):null,a=this.maxDate?q(new Date(this.maxDate)):null,o=q(r);(i&&o<i||a&&o>a)&&(e.stopPropagation(),e.preventDefault())}_onClickMonth(e,t=this.focusedDate.getFullYear()){let n=new Date(this.displayDate);this.view=`days`,n.setMonth(e),n.setFullYear(t),this.displayDate=n,this.emit(`sgds-view`,{detail:this.view}),this.emit(`sgds-selectmonth`,{detail:this.displayDate})}_onClickYear(e){let t=new Date(this.displayDate);t.setFullYear(e),this.displayDate=t,this.view=`months`,this.emit(`sgds-view`,{detail:this.view}),this.emit(`sgds-selectyear`,{detail:this.displayDate})}_getFocusedTarget(){let e={days:`td[data-date="${this.focusedDate.toISOString()}"]`,months:`button[data-month="${this.focusedDate.getMonth()}"][data-year="${this.focusedDate.getFullYear()}"]`,years:`button[data-year="${this.focusedDate.getFullYear()}"]`}[this.view];return this.shadowRoot.querySelector(`${e}`)}_blurCalendarCell(){let e=this._getFocusedTarget();e.setAttribute(`tabindex`,`-1`),e.blur()}_focusOnCalendarCell(){let e=this._getFocusedTarget();e?(e.setAttribute(`tabindex`,`0`),e.focus(),this.emit(`sgds-update-focus`,{detail:this.focusedDate})):this.emit(`sgds-change-calendar`,{detail:this.focusedDate})}_generateDays(){this.selectedDate.map(e=>q(e));let t=this._getSelectedRange(),n=this.minDate?q(new Date(this.minDate)):null,r=this.maxDate?q(new Date(this.maxDate)):null,i=this.displayDate.getFullYear(),a=this.displayDate.getMonth(),o=new Date(i,a,1).getDay(),s=e.daysInMonth[a];a===1&&(i%4==0&&i%100!=0||i%400==0)&&(s=29);let c=[],l=1;for(let e=0;e<9;e++){let u=[];for(let c=0;c<=6;c++)if(l<=s&&(e>0||c>=o)){let e=new Date(i,a,l,12,0,0,0),o=e.toISOString(),s=n&&Date.parse(o)<Date.parse(n.toISOString()),d=r&&Date.parse(o)>Date.parse(r.toISOString()),f=s||d?void 0:this._onClickDay,p=fv.getMonth()===this.displayDate.getMonth(),m=fv.getFullYear()===this.displayDate.getFullYear(),h=fv.getDate()===l,ee=Date.parse(o),g=t!==null&&ee>=t.start.getTime()&&ee<=t.end.getTime(),te=t!==null&&t.start.toISOString()===o,_=t!==null&&this.selectedDate.length>1&&t.end.toISOString()===o,ne=`${h&&p&&m?`Today's date, `:``}`+Q_(e,`PPPP`);u.push(y`<td
|
|
3143
3152
|
key=${c}
|
|
3144
3153
|
data-date=${o}
|
|
3145
3154
|
data-day=${l}
|
|
@@ -3171,7 +3180,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3171
3180
|
<div class="monthpicker" role="grid">
|
|
3172
3181
|
${[0,1,2,3].map(r=>y`
|
|
3173
3182
|
<div role="row">
|
|
3174
|
-
${e.MONTHVIEW_LABELS.slice(r*3,r*3+3).map((e,i)=>{let a=r*3+i,o=a===
|
|
3183
|
+
${e.MONTHVIEW_LABELS.slice(r*3,r*3+3).map((e,i)=>{let a=r*3+i,o=a===fv.getMonth()&&n===fv.getFullYear(),s=q(new Date(n,a,1)),c=q(new Date(n,a+1,0)),l=t!==null&&c.getTime()>=t.start.getTime()&&s.getTime()<=t.end.getTime(),u=t!==null&&t.start.getMonth()===a&&t.start.getFullYear()===n,d=t!==null&&t.end.getMonth()===a&&t.end.getFullYear()===n,f=o?`Current month ${e} ${n}`:`${e} ${n}`;return y` <button
|
|
3175
3184
|
role="gridcell"
|
|
3176
3185
|
class=${O({active:l,today:o,month:!0,"selected-ends":u||d})}
|
|
3177
3186
|
@click=${()=>this._onClickMonth(a)}
|
|
@@ -3186,7 +3195,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3186
3195
|
</div>
|
|
3187
3196
|
`)}
|
|
3188
3197
|
</div>
|
|
3189
|
-
`}_generateYears(){let e=this._getSelectedRange(),t=
|
|
3198
|
+
`}_generateYears(){let e=this._getSelectedRange(),t=fv.getFullYear(),n=cv(this.displayDate,t);return y`
|
|
3190
3199
|
<div class="sgds yearpicker" role="grid">
|
|
3191
3200
|
${[0,1,2,3].map(r=>y`
|
|
3192
3201
|
<div role="row">
|
|
@@ -3207,7 +3216,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3207
3216
|
</div>
|
|
3208
3217
|
`)}
|
|
3209
3218
|
</div>
|
|
3210
|
-
`}render(){let e;switch(this.view){case`days`:e=y` ${this._generateDays()} `;break;case`months`:e=y` ${this._generateMonths()} `;break;case`years`:e=y` ${this._generateYears()} `;break;default:e=y` ${this._generateDays()} `}return y` <div class="datepicker-body">${e}</div> `}};E([S({type:Array})],
|
|
3219
|
+
`}render(){let e;switch(this.view){case`days`:e=y` ${this._generateDays()} `;break;case`months`:e=y` ${this._generateMonths()} `;break;case`years`:e=y` ${this._generateYears()} `;break;default:e=y` ${this._generateDays()} `}return y` <div class="datepicker-body">${e}</div> `}};E([S({type:Array})],mv.prototype,`selectedDate`,void 0),E([S({attribute:!1})],mv.prototype,`displayDate`,void 0),E([S({type:String})],mv.prototype,`minDate`,void 0),E([S({type:String})],mv.prototype,`maxDate`,void 0),E([S({type:String,reflect:!0})],mv.prototype,`mode`,void 0),E([S()],mv.prototype,`view`,void 0),E([S({type:Boolean})],mv.prototype,`show`,void 0),E([S()],mv.prototype,`focusedTabIndex`,void 0),E([F(`displayDate`)],mv.prototype,`_updateFocusedDate`,null),x();var hv=u`.datepicker-header{display:flex;gap:var(--sgds-form-gap-md)}sgds-button{--btn-font-weight:var(--sgds-font-weight-semibold)}`;x();var gv=class extends D{constructor(...e){super(...e),this.selectedDate=[]}static{this.styles=[hv]}static{this.dependencies={"sgds-icon":L,"sgds-icon-button":ym,"sgds-button":B}}_handleFocusedTabIndexChange(){let e;switch(this.focusedTabIndex){case 0:e=this.shadowRoot.querySelector(`sgds-icon-button[name='arrow-left']`);break;case 1:e=this.shadowRoot.querySelector(`sgds-button`);break;case 2:e=this.shadowRoot.querySelector(`sgds-icon-button[name='arrow-right']`);break;default:return}e.focus()}_changeView(){switch(this.view){case`days`:this.view=`months`;break;case`months`:this.view=`years`}this.emit(`sgds-view`,{detail:this.view})}renderHeader(e=this.displayDate,t=this.view){if(t===`months`)return e.getFullYear();if(t===`years`){let t=(/* @__PURE__ */ new Date()).getFullYear(),n=e.getFullYear(),r=(n-t)%12,i=r<0?12+r:r;return`${n-i} - ${n-i+12-1}`}return`${_v[e.getMonth()]} ${e.getFullYear()}`}_renderHeaderTemplate(){return y`${this.renderHeader()}`}handleClickPrevious(){let{view:e,displayDate:t,focusedDate:n}=this,r=new Date(t);e===`months`?r.setFullYear(r.getFullYear()-1):this.view===`years`?r.setFullYear(r.getFullYear()-12):r=n.getDate()===t.getDate()?uv(r):uv(n),this.displayDate=r,this.emit(`sgds-change-calendar`,{detail:this.displayDate})}_handleClickNext(){let{view:e,displayDate:t,focusedDate:n}=this,r=new Date(t);e===`months`?r.setFullYear(r.getFullYear()+1):this.view===`years`?r.setFullYear(r.getFullYear()+12):r=n.getDate()===t.getDate()?lv(r):lv(n),this.displayDate=r,this.emit(`sgds-change-calendar`,{detail:this.displayDate})}_removeCaret(){let e=this.displayDate.getFullYear(),t=this.displayDate.getMonth(),n=new Date(e,t);return this.view===`months`?e<=1900:this.view===`years`?e<1904:nv(n,new Date(0,0,1))||tv(n,new Date(0,0,1))}_ariaLabelForNextBtn(){return{days:`Show next month`,months:`Show next year`,years:`Show next 12 years`}[this.view]}_ariaLabelForPrevBtn(){return{days:`Show previous month`,months:`Show previous year`,years:`Show previous 12 years`}[this.view]}_ariaLabelForHeaderBtn(){let e={days:`Current view is days, click to show months in ${this.displayDate.getFullYear()}`,months:`Current view is months, click to show years between ${this.renderHeader(this.displayDate,`years`)}`,years:`Current view is years`};return`${this.renderHeader()}. ${e[this.view]}`}render(){return y`
|
|
3211
3220
|
<div class="datepicker-header dropdown-header">
|
|
3212
3221
|
<sgds-icon-button
|
|
3213
3222
|
name="arrow-left"
|
|
@@ -3239,7 +3248,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3239
3248
|
>
|
|
3240
3249
|
</sgds-icon-button>
|
|
3241
3250
|
</div>
|
|
3242
|
-
`}};E([S({attribute:!1})],
|
|
3251
|
+
`}};E([S({attribute:!1})],gv.prototype,`displayDate`,void 0),E([S({attribute:!1})],gv.prototype,`focusedDate`,void 0),E([S({attribute:!1})],gv.prototype,`selectedDate`,void 0),E([S()],gv.prototype,`view`,void 0),E([S()],gv.prototype,`focusedTabIndex`,void 0),E([F(`focusedTabIndex`,{waitUntilFirstUpdate:!0})],gv.prototype,`_handleFocusedTabIndexChange`,null);let _v=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`];var vv=class{constructor(e,t){this.listeners=/* @__PURE__ */ new Map,this.input=e,this.placeholderStr=this._buildPlaceholder(t.pattern),this._state=this.placeholderStr,this.listeners.set(`accept`,[]),this.listeners.set(`complete`,[]);let n={value:``,isComplete:!1};Object.defineProperties(n,{value:{get:()=>this._state,enumerable:!0},isComplete:{get:()=>this._state.length>0&&!/[DMY]/.test(this._state),enumerable:!0}}),this.masked=n,this.input.value&&this.input.value.length===this._state.length&&!/[DMY]/.test(this.input.value)?this._state=this.input.value:this.input.value=this._state,this._boundHandleBeforeInput=this._handleBeforeInput.bind(this),this._boundHandleInput=this._handleInput.bind(this),this._boundHandleKeydown=this._handleKeydown.bind(this),this._boundHandleFocus=this._handleFocus.bind(this),this._boundHandleBlur=this._handleBlur.bind(this),this._valueAtFocus=this._state,this.input.addEventListener(`beforeinput`,this._boundHandleBeforeInput),this.input.addEventListener(`input`,this._boundHandleInput),this.input.addEventListener(`keydown`,this._boundHandleKeydown),this.input.addEventListener(`focus`,this._boundHandleFocus),this.input.addEventListener(`blur`,this._boundHandleBlur)}get value(){return this._state}set value(e){this._state=!e||e===``?this.placeholderStr:e,this.input.value=this._state,this._emit(`accept`)}on(e,t){this.listeners.get(e)?.push(t)}updateValue(){this._state=this.input.value}destroy(){this.input.removeEventListener(`beforeinput`,this._boundHandleBeforeInput),this.input.removeEventListener(`input`,this._boundHandleInput),this.input.removeEventListener(`keydown`,this._boundHandleKeydown),this.input.removeEventListener(`focus`,this._boundHandleFocus),this.input.removeEventListener(`blur`,this._boundHandleBlur),this.listeners.clear()}_handleFocus(){this._valueAtFocus=this._state}_handleBlur(){this._state!==this._valueAtFocus&&this.input.dispatchEvent(new Event(`change`,{bubbles:!0}))}_buildPlaceholder(e){return e.replace(/`/g,``).replace(/\{(\/)\}/g,`$1`).replace(/d/g,`D`).replace(/m/g,`M`).replace(/y/g,`Y`)}_getDigitPositions(){let e=[];for(let t=0;t<this.placeholderStr.length;t++){let n=this.placeholderStr[t];(n===`D`||n===`M`||n===`Y`)&&e.push(t)}return e}_handleBeforeInput(e){e.preventDefault()}_handleInput(){this.input.value!==this._state&&(this.input.value=this._state)}_handleKeydown(e){e.key===`Backspace`?(e.preventDefault(),this._backspace()):e.key===`Delete`?(e.preventDefault(),this._deleteForward()):e.key.length===1&&/\d/.test(e.key)&&(e.preventDefault(),this._insertDigit(e.key))}_insertDigit(e){let t=this._getDigitPositions(),n=this._state.split(``),r=-1;for(let e of t)if(/[DMY]/.test(n[e])){r=e;break}if(r===-1)return;n[r]=e,this._state=n.join(``),this.input.value=this._state;let i=this._findNextInputPos(r);this.input.setSelectionRange(i,i),this._emit(`accept`),this.masked.isComplete&&this._emit(`complete`)}_backspace(){let e=this.input.selectionStart??this._state.length,t=this._state.split(``),n=e-1;for(;n>=0&&!/\d/.test(t[n]);)n--;n>=0&&(t[n]=this.placeholderStr[n],this._state=t.join(``),this.input.value=this._state,this.input.setSelectionRange(n,n),this._emit(`accept`))}_deleteForward(){let e=this.input.selectionStart??0,t=this._state.split(``),n=e;for(;n<t.length&&!/\d/.test(t[n]);)n++;n<t.length&&(t[n]=this.placeholderStr[n],this._state=t.join(``),this.input.value=this._state,this.input.setSelectionRange(e,e),this._emit(`accept`))}_findNextInputPos(e){for(let t=e+1;t<this._state.length;t++)if(/[DMY]/.test(this._state[t]))return t;return this._state.length}_emit(e){let t=this.listeners.get(e);if(t)for(let e of t)e()}};x();var yv=u`:host{--input-border-radius:var(--sgds-form-border-radius-md);--input-min-width:var(--sgds-dimension-160)}.form-control-container{min-width:var(--input-min-width)}:host(.quantity-toggle) input::-webkit-inner-spin-button{appearance:none;margin:0}:host(.quantity-toggle) input{text-align:center}.form-control-prefix,.form-control-suffix{align-items:center;color:var(--sgds-form-color-subtle);display:flex;flex-shrink:0;font-weight:var(--sgds-font-weight-semibold);gap:var(--sgds-gap-xs);height:100%;justify-content:center}.form-control-prefix{border-right:var(--sgds-form-border-width-default) solid var(--sgds-border-color-muted);padding-right:var(--sgds-form-padding-x)}.form-control-suffix{border-left:var(--sgds-form-border-width-default) solid var(--sgds-border-color-muted);padding-left:var(--sgds-form-padding-x)}.form-control-group.quantity-toggle{padding:0}sgds-icon[role=button]{cursor:pointer}sgds-icon[role=button]:focus,sgds-icon[role=button]:focus-visible{outline:var(--sgds-form-outline-focus)}.form-control-row{align-items:center;display:flex;gap:var(--sgds-gap-sm)}`;x();var J=class extends j_(V){constructor(...e){super(...e),this.type=`text`,this.placeholder=`placeholder`,this.autofocus=!1,this.readonly=!1,this.autocomplete=`on`,this.defaultValue=``,this.valid=!1,this.loading=!1,this.required=!1,this.noValidate=!1,this.value=``,this._isTouched=!1,this._showPassword=!1}static{this.styles=[...V.styles,F_,O_,yv]}static{this.dependencies={"sgds-spinner":_m,"sgds-icon":L}}focus(e){this.input.focus(e)}blur(){this.input.blur()}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}setValidity(e,t,n){return this._mixinSetValidity(e,t,n)}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_handleFocus(){this.emit(`sgds-focus`)}_handleBlur(){let e=this.emit(`sgds-blur`,{cancelable:!0});this._mixinShouldSkipSgdsValidation()||e.defaultPrevented||(this.setInvalid(!this._mixinCheckValidity()),this._isTouched=!0)}_handleClick(){this.focus()}_handleChange(e){this.value=this.input.value,!this.emit(`sgds-change`,{cancelable:!0}).defaultPrevented&&super._mixinHandleChange(e)}_handleInputChange(e){this.value=this.input.value,!this.emit(`sgds-input`,{cancelable:!0}).defaultPrevented&&super._mixinHandleInputChange(e)}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&this.setInvalid(!this._mixinCheckValidity())}_handleDisabledChange(){this.setInvalid(!1)}_renderInput(){let e=this.hasFeedback===`both`||this.hasFeedback===`style`,t=this.hasFeedback===`both`||this.hasFeedback===`text`,n=[this.hintText?`${this._controlId}Help`:``,this.invalid&&t?`${this._controlId}-invalid`:``].filter(Boolean).join(` `)||void 0;return I`
|
|
3243
3252
|
<div
|
|
3244
3253
|
class="form-control-group ${O({disabled:this.disabled,readonly:this.readonly,"is-invalid":this.invalid&&e})}"
|
|
3245
3254
|
@click=${this._handleClick}
|
|
@@ -3282,6 +3291,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3282
3291
|
`}_renderPasswordToggle(){return I`<sgds-icon
|
|
3283
3292
|
tabIndex="0"
|
|
3284
3293
|
role="button"
|
|
3294
|
+
aria-label=${this._showPassword?`Hide password`:`Show password`}
|
|
3285
3295
|
name=${this._showPassword?`eye-slash-fill`:`eye-fill`}
|
|
3286
3296
|
@click=${()=>this._showPassword=!this._showPassword}
|
|
3287
3297
|
></sgds-icon>`}_inputType(){return this.type===`password`&&this._showPassword?`text`:this.type}_renderFeedback(){let e=this.hasFeedback===`both`||this.hasFeedback===`text`;return this.invalid&&e?I` <div class="invalid-feedback-container">
|
|
@@ -3307,7 +3317,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3307
3317
|
</div>
|
|
3308
3318
|
${this._renderFeedback()}
|
|
3309
3319
|
</div>
|
|
3310
|
-
`}};E([S({reflect:!0})],
|
|
3320
|
+
`}};E([S({reflect:!0})],J.prototype,`type`,void 0),E([S({type:String})],J.prototype,`prefix`,void 0),E([S({type:String})],J.prototype,`suffix`,void 0),E([S({type:Number,reflect:!0})],J.prototype,`minlength`,void 0),E([S({type:Number,reflect:!0})],J.prototype,`maxlength`,void 0),E([S()],J.prototype,`min`,void 0),E([S()],J.prototype,`max`,void 0),E([S({type:String,reflect:!0})],J.prototype,`placeholder`,void 0),E([S({type:String})],J.prototype,`pattern`,void 0),E([S({type:Boolean,reflect:!0})],J.prototype,`autofocus`,void 0),E([S({type:Boolean,reflect:!0})],J.prototype,`readonly`,void 0),E([S({type:String,reflect:!0})],J.prototype,`autocomplete`,void 0),E([S()],J.prototype,`step`,void 0),E([S({type:String,reflect:!0})],J.prototype,`hasFeedback`,void 0),E([S({type:String,reflect:!0})],J.prototype,`invalidFeedback`,void 0),E([k_()],J.prototype,`defaultValue`,void 0),E([S({type:Boolean,reflect:!0})],J.prototype,`valid`,void 0),E([S({type:Boolean,reflect:!0})],J.prototype,`loading`,void 0),E([S({type:Boolean,reflect:!0})],J.prototype,`required`,void 0),E([S({type:Boolean,reflect:!0})],J.prototype,`noValidate`,void 0),E([S({reflect:!0})],J.prototype,`value`,void 0),E([C()],J.prototype,`_isTouched`,void 0),E([C()],J.prototype,`_showPassword`,void 0),E([F(`_isTouched`,{waitUntilFirstUpdate:!0})],J.prototype,`_handleIsTouched`,null),E([F(`disabled`,{waitUntilFirstUpdate:!0})],J.prototype,`_handleDisabledChange`,null),x();var bv=u`.datepicker-input-container{display:flex;flex-direction:row;width:-webkit-fill-available;width:-moz-available}.datepicker-input-container .form-control-group{border-right:0}.calendar-btn{all:unset}`;x();var xv=class extends J{static{this.styles=[...J.styles,bv]}constructor(){super(),this.dateFormat=`DD/MM/YYYY`,this.mode=`single`,this._validateInput=async()=>{let e=this.mask.value.split(` - `).filter(e=>e!==this.dateFormat).map(e=>q(ov(e,sv[this.dateFormat].fnsPattern))),t=e.filter(e=>!iv(e)||tv(e,new Date(0,0,1))||tv(e,q(new Date(this.minDate)))||ev(e,q(new Date(this.maxDate))));if(t.length>0||this.mode===`range`&&e.length===1)return this.setInvalid(!0),this.emit(`i-sgds-invalid-input`);if(t.length===0&&e.length>0)return this.setInvalid(!1),this.emit(`i-sgds-selectdates-input`,{detail:e});if(e.length===0&&t.length===0)return this.setInvalid(!1),this.emit(`i-sgds-empty-input`)},this.type=`text`}_handleBlur(){let e=this.mask.value.split(` - `).filter(e=>e!==this.dateFormat).map(e=>q(ov(e,sv[this.dateFormat].fnsPattern))),t=e.filter(e=>!iv(e)||tv(e,new Date(0,0,1))||tv(e,q(new Date(this.minDate)))||ev(e,q(new Date(this.maxDate))));this.mask.masked.isComplete&&t.length>0&&e.length>0&&(this.value=``,this.mask.value=``,this.setInvalid(!1)),this.emit(`sgds-blur`)}async _handleChange(e){this.value=this.input.value,this.emit(`sgds-change`),super._mixinHandleChange(e),await this._validateInput()}async firstUpdated(e){super.firstUpdated(e),this._applyInputMask(this.dateFormat)}async _applyInputMask(e){let t=await this.shadowInput,n=this.mode===`single`?sv[e].imPattern:sv[e].imRangePattern;this.mask=new vv(t,{pattern:n}),this.mask.on(`accept`,()=>{this.value=this.mask.masked.value,this.emit(`i-sgds-mask-input-change`,{detail:this.value})}),this.mask.on(`complete`,this._validateInput)}updateMaskValue(){this.mask?.updateValue()}destroyInputMask(){this.mask?.destroy()}async applyInputMask(){return await this._applyInputMask(this.dateFormat)}async focus(){return(await this.shadowInput).focus()}render(){return y`
|
|
3311
3321
|
<div
|
|
3312
3322
|
class="form-control-container ${O({disabled:this.disabled})}"
|
|
3313
3323
|
>
|
|
@@ -3318,7 +3328,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3318
3328
|
</div>
|
|
3319
3329
|
${this._renderFeedback()}
|
|
3320
3330
|
</div>
|
|
3321
|
-
`}};E([S({type:String})],
|
|
3331
|
+
`}};E([S({type:String})],xv.prototype,`minDate`,void 0),E([S({type:String})],xv.prototype,`maxDate`,void 0),E([S({type:String,reflect:!0})],xv.prototype,`mode`,void 0),E([at(`input`)],xv.prototype,`shadowInput`,void 0),x();var Sv=u`:host{--datepicker-theme-color:var(--sgds-primary);--datepicker-hover-bg:var(--sgds-primary-100);--datepicker-bg:#fff;--datepicker-close-btn-bg:var(--datepicker-theme-color);--datepicker-close-btn-hover-bg:var(--sgds-primary-700);--datepicker-close-btn-color:#fff;--datepicker-selected-date-bg:var(--sgds-primary);--datepicker-selected-date-color:#fff}:host([menuisopen]:not([disabled]):not([readonly])) .dropdown-menu{background-color:var(--sgds-form-surface-default);display:flex;flex-direction:column;gap:var(--sgds-form-gap-sm);overflow:unset;padding:var(--sgds-form-padding-y) var(--sgds-form-padding-x);width:var(--sgds-dimension-320)}.dropdown{display:flex;height:100%}sgds-datepicker-input{--input-border-radius:var(--sgds-form-border-radius-md) 0 0 var(--sgds-form-border-radius-md);flex:1;margin-right:0}sgds-icon-button{--btn-border-radius:0 var(--sgds-form-border-radius-md) var(--sgds-form-border-radius-md) 0}.m-width-160{min-width:var(--sgds-dimension-160)}`;x();var Y=class extends j_(Kg){static{this.styles=[...Kg.styles,Jg,Sv]}static{this.dependencies={"sgds-datepicker-input":xv,"sgds-datepicker-calendar":mv,"sgds-datepicker-header":gv,"sgds-button":B,"sgds-icon-button":ym}}constructor(){super(),this.required=!1,this.disabled=!1,this.noValidate=!1,this.value=``,this.initialValue=[],this.dateFormat=`DD/MM/YYYY`,this.minDate=``,this.maxDate=``,this.mode=`single`,this.hasFeedback=!1,this.label=``,this.hintText=``,this.noFlip=!1,this.drop=`down`,this.defaultValue=``,this.invalid=!1,this.view=`days`,this.selectedDateRange=[],this.focusedTabIndex=3,this.initialDisplayDate=/* @__PURE__ */ new Date,this._makeInputValueString=(e,t,n)=>{if(!e&&!t)return this.value;let r=e=>Q_(e,sv[n].fnsPattern);switch(this.mode){case`single`:e&&(this.value=r(e));break;case`range`:e&&t&&(this.value=`${r(e)} - ${r(t)}`),e&&!t&&(this.value=`${r(e)} - ${this.dateFormat}`)}return this.value},this._dialogAriaLabels={days:`Choose date`,months:`Choose month`,years:`Choose year`},this.floatingOpts={placement:`bottom-end`}}isValueEmpty(){return this.value===``||this.value===`DD/MM/YYYY`||this.value===`DD/MM/YYYY - DD/MM/YYYY`}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}setInvalid(e){this.invalid=e,this.datepickerInput&&this.datepickerInput.setInvalid(e)}setValidity(e,t,n){return this._mixinSetValidity(e,t,n)}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}async connectedCallback(){if(super.connectedCallback(),this.addEventListener(`sgds-view`,this._handleViewChanged),this.addEventListener(`sgds-change-calendar`,this._handleDateChanged),this.addEventListener(`sgds-update-focus`,this._handleFocusDateChanged),this.addEventListener(`sgds-selectmonth`,this._handleSelectMonth),this.addEventListener(`sgds-selectyear`,this._handleSelectYear),this.addEventListener(`sgds-selectdates`,this._handleSelectDatesAndClose),this.addEventListener(`i-sgds-selectdates-input`,this._handleSelectDatesInput),this.addEventListener(`i-sgds-empty-input`,this._handleEmptyInput),this.addEventListener(`keydown`,this._handleTab),this.addEventListener(`sgds-hide`,this._handleCloseMenu),this.addEventListener(`sgds-show`,this._handleOpenMenu),this.addEventListener(`blur`,this._mixinCheckValidity),this.initialValue=this.value?this.value.split(` - `).map(e=>e.trim()):this.initialValue,this.initialDisplayDate=this.displayDate||/* @__PURE__ */ new Date,this.initialValue&&this.initialValue.length>0){let e=new RegExp(this._getDateFormatRegex()),t=this.initialValue.filter(t=>!e.test(t));if(t.length>0)return console.error(`Invalid date format in initialValue:`,t);{let e=this.initialValue.map(e=>q(ov(e,sv[this.dateFormat].fnsPattern)));this._handleSelectDates(e)}}else this.displayDate=this.initialDisplayDate;(await this.datepickerInputAsync).setInvalid(this.invalid)}async firstUpdated(e){if(super.firstUpdated(e),this.menuIsOpen){let e=await this.datepickerInputAsync;await this.updateFloatingPosition(),(await this.calendar).focusOnCalendar(e)}}_getDateFormatRegex(){return this.dateFormat.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(`MM`,`\\d{2}`).replace(`DD`,`\\d{2}`).replace(`YYYY`,`\\d{4}`).replace(`/`,`\\/`)}_handleTab(e){if(!this.menuIsOpen)return;let t=[,,,,];e.shiftKey&&e.key===`Tab`?(e.preventDefault(),this.focusedTabIndex=(this.focusedTabIndex-1+t.length)%t.length):e.key===`Tab`&&(e.preventDefault(),this.focusedTabIndex=(this.focusedTabIndex+1+t.length)%t.length)}_handleValueChange(){this.emit(`sgds-change-date`)}async _handleCloseMenu(){if(this.selectedDateRange.length===0)this.displayDate=this.initialDisplayDate;else{let e=this.selectedDateRange.length;this.displayDate=this.selectedDateRange[e-1],(await this.calendar)._updateFocusedDate()}await this.updateComplete,(await this.datepickerInputAsync).focus()}async _handleOpenMenu(){let e=await this.calendar,t=await this.datepickerInputAsync;e.focusOnCalendar(t)}_handleSelectDatesInput(e){this._handleSelectDates(e.detail)}async _handleSelectDates(e){e.sort((e,t)=>e.getTime()-t.getTime()),this.displayDate=e[0],this.focusedDate=e[0],this.selectedDateRange=e;let t=this._makeInputValueString(this.selectedDateRange[0],this.selectedDateRange[1],this.dateFormat);this.value=t,(await this.datepickerInputAsync).updateMaskValue(),this._manageInternalsValid()}async _handleSelectDatesAndClose(e){await this._handleSelectDates(e.detail),(this.mode===`range`&&this.selectedDateRange.length===2||this.mode===`single`&&this.selectedDateRange.length===1)&&this.hideMenu()}_handleViewChanged(e){this.view=e.detail}_handleDateChanged(e){this.displayDate=e.detail}_handleFocusDateChanged(e){this.focusedDate=e.detail}_handleSelectMonth(e){this.displayDate=e.detail}_handleSelectYear(e){this.displayDate=e.detail}async _handleInvalidInput(){this.selectedDateRange=[],this.displayDate=this.initialDisplayDate,!this._mixinShouldSkipSgdsValidation()&&(this.invalid=!0,this._manageInternalsBadInput())}async _handleEmptyInput(){this.required&&this._manageEmptyInput()}async _resetDatepicker(e=``){this.displayDate=this.initialDisplayDate,this.selectedDateRange=[],this.value=e,this.view=`days`;let t=await this.datepickerInputAsync;t.setInvalid(this.invalid),t.destroyInputMask(),await t.applyInputMask(),this._mixinResetValidity(t),this.isValueEmpty()&&this._handleEmptyInput()}_manageInternalsBadInput(){this._mixinSetValidity({badInput:!0},`Invalid date input`,this.datepickerInput)}_manageEmptyInput(){this._mixinSetValidity({valueMissing:!0},`Please fill in this field`,this.datepickerInput)}_manageInternalsValid(){this._mixinSetFormValue(),!this._mixinShouldSkipSgdsValidation()&&(this._mixinSetValidity({}),this.invalid=this.datepickerInput.invalid=!1)}async _mixinResetFormControl(){this._resetDatepicker(this.defaultValue)}async _handleInputMaskChange(e){this.value=e.detail,this.isValueEmpty()&&this._resetDatepicker()}render(){return y`
|
|
3322
3332
|
<div class="datepicker-container m-width-160">
|
|
3323
3333
|
<sgds-datepicker-input
|
|
3324
3334
|
.value=${w_(this.value)}
|
|
@@ -3382,7 +3392,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3382
3392
|
></sgds-datepicker-calendar>
|
|
3383
3393
|
</div>
|
|
3384
3394
|
</div>
|
|
3385
|
-
`}};E([S({type:Boolean,reflect:!0})],
|
|
3395
|
+
`}};E([S({type:Boolean,reflect:!0})],Y.prototype,`required`,void 0),E([S({reflect:!0})],Y.prototype,`name`,void 0),E([S({type:Boolean,reflect:!0})],Y.prototype,`disabled`,void 0),E([S({type:Boolean,reflect:!0})],Y.prototype,`noValidate`,void 0),E([S({type:String,reflect:!0})],Y.prototype,`value`,void 0),E([S({type:Array,reflect:!0})],Y.prototype,`initialValue`,void 0),E([S({type:String})],Y.prototype,`minDate`,void 0),E([S({type:String})],Y.prototype,`maxDate`,void 0),E([S({type:String,reflect:!0})],Y.prototype,`mode`,void 0),E([S({type:String,reflect:!0})],Y.prototype,`invalidFeedback`,void 0),E([S({type:Boolean,reflect:!0})],Y.prototype,`hasFeedback`,void 0),E([S({reflect:!0})],Y.prototype,`label`,void 0),E([S({reflect:!0})],Y.prototype,`hintText`,void 0),E([S({type:Boolean,reflect:!0,state:!1})],Y.prototype,`noFlip`,void 0),E([S({type:String,reflect:!0,state:!1})],Y.prototype,`drop`,void 0),E([S({attribute:!1})],Y.prototype,`displayDate`,void 0),E([k_()],Y.prototype,`defaultValue`,void 0),E([S({type:Boolean,reflect:!0})],Y.prototype,`invalid`,void 0),E([C()],Y.prototype,`view`,void 0),E([C()],Y.prototype,`selectedDateRange`,void 0),E([C()],Y.prototype,`focusedDate`,void 0),E([C()],Y.prototype,`focusedTabIndex`,void 0),E([at(`sgds-datepicker-calendar`)],Y.prototype,`calendar`,void 0),E([at(`sgds-datepicker-input`)],Y.prototype,`datepickerInputAsync`,void 0),E([w(`sgds-datepicker-input`)],Y.prototype,`datepickerInput`,void 0),E([F(`value`,{waitUntilFirstUpdate:!0})],Y.prototype,`_handleValueChange`,null),x();var Cv=u`:host([bordered][islastchild]) .container:last-child{border-bottom:none}.container{align-items:flex-start;border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);display:flex;flex-direction:column;gap:var(--sgds-gap-2-xs);justify-content:flex-start;padding:var(--sgds-padding-lg) var(--sgds-padding-xl)}.data-container,.label-container{flex:1}.label-container{max-width:var(--sgds-dimension-280)}.label{color:var(--sgds-color-default);font-weight:var(--sgds-font-weight-semibold)}.data,.label{font-size:var(--sgds-font-size-label-md)}.data{color:var(--sgds-color-subtle);font-weight:var(--sgds-font-weight-regular);margin:0}@media (min-width:512px){:host(:not([stacked])) .container{flex-direction:row;gap:var(--sgds-gap-2-xl)}}`;x();let wv=0;var Tv=class extends D{constructor(...e){super(...e),this.attrId=++wv,this.componentId=`sgds-description-list-${this.attrId}`,this.stacked=!1,this.bordered=!1}static{this.styles=[...D.styles,Cv]}connectedCallback(){super.connectedCallback(),this.id=this.id.length>0?this.id:this.componentId,this.setAttribute(`role`,`listitem`)}render(){return y`
|
|
3386
3396
|
<div class="container">
|
|
3387
3397
|
<div class="label-container">
|
|
3388
3398
|
<span class="label">
|
|
@@ -3395,7 +3405,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3395
3405
|
</span>
|
|
3396
3406
|
</div>
|
|
3397
3407
|
</div>
|
|
3398
|
-
`}};E([S({type:Boolean,reflect:!0})],
|
|
3408
|
+
`}};E([S({type:Boolean,reflect:!0})],Tv.prototype,`stacked`,void 0),E([S({type:Boolean,reflect:!0})],Tv.prototype,`bordered`,void 0),x();var Ev=u`:host([bordered]) .container{border:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);border-radius:var(--sgds-border-radius-md)}.container{display:flex;flex-direction:column}slot[name=title]::slotted(*){color:var(--sgds-heading-color-default);font-size:var(--sgds-font-size-heading-sm);font-weight:var(--sgds-font-weight-semibold);letter-spacing:var(--sgds-letter-spacing-tight);line-height:var(--sgds-line-height-sm)}slot[name=description]::slotted(*){color:var(--sgds-color-subtle);font-size:var(--sgds-font-size-label-md);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-xs)}.header{display:flex;flex-direction:column;gap:var(--sgds-gap-xs)}.has-header{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);padding:var(--sgds-padding-lg) var(--sgds-padding-xl)}`;x();var Dv=class extends D{constructor(...e){super(...e),this.bordered=!1,this.stacked=!1,this.hasTitleSlot=!1,this.hasDescriptionSlot=!1,this.hasSlotController=new xm(this,`title`,`description`)}static{this.styles=[...D.styles,Ev]}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`list`),this.updateComplete.then(()=>{this._updateDescriptionLists()})}_updateDescriptionLists(){this._descriptionLists&&this._descriptionLists.forEach((e,t)=>{this.stacked?e.setAttribute(`stacked`,``):e.removeAttribute(`stacked`),this.bordered?e.setAttribute(`bordered`,``):e.removeAttribute(`bordered`),t===this._descriptionLists.length-1&&e.setAttribute(`isLastChild`,``)})}updated(e){e.has(`stacked`)&&this._updateDescriptionLists(),e.has(`bordered`)&&this._updateDescriptionLists(),this.hasTitleSlot||=this.hasSlotController.test(`title`),this.hasDescriptionSlot||=this.hasSlotController.test(`description`)}render(){return y`
|
|
3399
3409
|
<div class="container">
|
|
3400
3410
|
<div
|
|
3401
3411
|
class="${O({header:!0,"has-header":this.hasTitleSlot||this.hasDescriptionSlot})}"
|
|
@@ -3407,7 +3417,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3407
3417
|
<slot></slot>
|
|
3408
3418
|
</div>
|
|
3409
3419
|
</div>
|
|
3410
|
-
`}};E([S({type:Boolean,reflect:!0})],
|
|
3420
|
+
`}};E([S({type:Boolean,reflect:!0})],Dv.prototype,`bordered`,void 0),E([S({type:Boolean,reflect:!0})],Dv.prototype,`stacked`,void 0),E([S({type:Boolean})],Dv.prototype,`hasTitleSlot`,void 0),E([S({type:Boolean})],Dv.prototype,`hasDescriptionSlot`,void 0),E([T({flatten:!0})],Dv.prototype,`_descriptionLists`,void 0),x();var Ov=u`:host{--container-size:8px}:host([orientation=horizontal]){border-top:var(--border-width) solid var(--sgds-border-color-muted);display:block;margin:calc((var(--container-size) - var(--border-width))/2) 0;width:100%}:host([orientation=vertical]){border-left:var(--border-width) solid var(--sgds-border-color-muted);display:inline-block;height:100%;margin:0 calc((var(--container-size) - var(--border-width))/2)}:host([thickness=thin]){--border-width:var(--sgds-border-width-1)}:host([thickness=thick]){--border-width:var(--sgds-border-width-2)}:host([thickness=thicker]){--border-width:var(--sgds-border-width-4)}`,kv=class extends D{constructor(...e){super(...e),this.orientation=`horizontal`,this.thickness=`thin`}static{this.styles=[Ov]}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`separator`),this.setAttribute(`aria-orientation`,this.orientation)}};E([S({type:String,reflect:!0})],kv.prototype,`orientation`,void 0),E([S({type:String,reflect:!0})],kv.prototype,`thickness`,void 0);let Av=/* @__PURE__ */ new Set;function jv(e){Av.add(e),document.body.style.overflow=`hidden`}function Mv(e){Av.delete(e),Av.size===0&&(document.body.style.overflow=``)}x();var Nv=u`:host([size=md]) .drawer-end .drawer-panel,:host([size=md]) .drawer-start .drawer-panel{max-width:var(--sgds-dimension-768)}:host([size=md]) .drawer-bottom .drawer-panel,:host([size=md]) .drawer-top .drawer-panel{max-height:var(--sgds-dimension-768)}:host([size=lg]) .drawer-end .drawer-panel,:host([size=lg]) .drawer-start .drawer-panel{max-width:var(--sgds-dimension-1024)}:host([size=lg]) .drawer-bottom .drawer-panel,:host([size=lg]) .drawer-top .drawer-panel{max-height:var(--sgds-dimension-1024)}.drawer{height:100%;inset-inline-start:0;overflow:hidden;pointer-events:none;top:0;width:100%}.drawer-fixed{position:fixed;z-index:var(--sgds-z-index-modal)}.drawer-panel{background-color:var(--sgds-surface-default);display:flex;flex-direction:column;overflow:auto;pointer-events:all;position:absolute;z-index:2}.drawer-panel:focus{outline:none}.drawer-top .drawer-panel{bottom:auto;height:80%;inset-inline-end:auto;inset-inline-start:0;max-height:var(--sgds-dimension-512);top:0;width:100%}.drawer-end .drawer-panel{bottom:auto;height:100%;inset-inline-end:0;inset-inline-start:auto;max-width:var(--sgds-dimension-512);top:0;width:80%}.drawer-bottom .drawer-panel{bottom:0;height:80%;inset-inline-end:auto;inset-inline-start:0;max-height:var(--sgds-dimension-512);top:auto;width:100%}.drawer-start .drawer-panel{bottom:auto;height:100%;inset-inline-end:auto;inset-inline-start:0;max-width:var(--sgds-dimension-512);top:0;width:80%}.drawer-close-wrapper{position:sticky;top:0}sgds-close-button.drawer-close{inset-inline-end:8px;position:absolute;top:8px}.drawer-header{display:flex;flex-direction:column;gap:var(--sgds-gap-xs);padding:var(--sgds-padding-lg) var(--sgds-padding-lg) var(--sgds-padding-none)}slot[name=title]::slotted(*){color:var(--sgds-color-default)!important;font-size:var(--sgds-font-size-heading-sm)!important;margin-bottom:var(--sgds-margin-none)!important}slot[name=description]::slotted(*){color:var(--sgds-color-subtle);margin-bottom:var(--sgds-margin-none)!important}slot[name=footer]::slotted(*){background-color:var(--sgds-surface-default);bottom:0;padding:var(--sgds-padding-lg);position:sticky}.drawer-body{-webkit-overflow-scrolling:touch;display:block;flex:1 1 auto;overflow:hidden;padding:var(--sgds-padding-lg)}.drawer-overlay{background-color:var(--sgds-bg-overlay);display:block;inset:0;pointer-events:all;position:fixed}.drawer-contained .drawer-overlay{display:none}.drawer-contained{height:unset;width:unset}@media screen and (min-width:512px){.drawer-body{padding:var(--sgds-padding-2-xl)}.drawer-header{padding:var(--sgds-padding-2-xl) var(--sgds-padding-2-xl) var(--sgds-padding-none)}slot[name=footer]::slotted(*){padding:var(--sgds-padding-2-xl)}}`;x();var Pv=class extends D{constructor(...e){super(...e),this.open=!1,this.size=`sm`,this.placement=`end`,this.ariaLabel=`Drawer`,this.contained=!1,this.handleDocumentKeyDown=e=>{this.open&&!this.contained&&e.key===`Escape`&&(e.stopPropagation(),this.requestClose(`keyboard`))}}static{this.styles=[...D.styles,Nv]}static{this.dependencies={"sgds-close-button":kt}}firstUpdated(e){super.firstUpdated(e),this.open&&(this.addOpenListeners(),this.contained||jv(this))}disconnectedCallback(){super.disconnectedCallback(),Mv(this)}uppercaseFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1)}requestClose(e){if(this.emit(`sgds-request-close`,{cancelable:!0,detail:{source:e}}).defaultPrevented){let e=M(this,`drawer.denyClose`);A(this.panel,e.keyframes,e.options);return}this.hide()}addOpenListeners(){document.addEventListener(`keydown`,this.handleDocumentKeyDown)}removeOpenListeners(){document.removeEventListener(`keydown`,this.handleDocumentKeyDown)}async handleOpenChange(){if(this.open){this.emit(`sgds-show`),this.addOpenListeners(),this.originalTrigger=document.activeElement,this.contained||jv(this);let e=this.querySelector(`[autofocus]`);e&&e.removeAttribute(`autofocus`),await Promise.all([j(this.drawer),j(this.overlay)]),this.drawer.hidden=!1,requestAnimationFrame(()=>{this.emit(`sgds-initial-focus`,{cancelable:!0}).defaultPrevented||(e?e.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),e&&e.setAttribute(`autofocus`,``)});let t=M(this,`drawer.show${this.uppercaseFirstLetter(this.placement)}`),n=M(this,`drawer.overlay.show`);await Promise.all([A(this.panel,t.keyframes,t.options),A(this.overlay,n.keyframes,n.options)]),this.emit(`sgds-after-show`)}else{this.emit(`sgds-hide`),this.removeOpenListeners(),this.contained||Mv(this),await Promise.all([j(this.drawer),j(this.overlay)]);let e=M(this,`drawer.hide${this.uppercaseFirstLetter(this.placement)}`),t=M(this,`drawer.overlay.hide`);await Promise.all([A(this.overlay,t.keyframes,t.options).then(()=>{this.overlay.hidden=!0}),A(this.panel,e.keyframes,e.options).then(()=>{this.panel.hidden=!0})]),this.drawer.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1;let n=this.originalTrigger;typeof n?.focus==`function`&&setTimeout(()=>n.focus()),this.emit(`sgds-after-hide`)}}handleNoModalChange(){this.open&&!this.contained&&jv(this),this.open&&this.contained&&Mv(this)}async show(){if(!this.open)return this.open=!0,P(this,`sgds-after-show`)}async hide(){if(this.open)return this.open=!1,P(this,`sgds-after-hide`)}render(){let e=this.hasUpdated,t=!this.open&&!e;return y`
|
|
3411
3421
|
<div
|
|
3412
3422
|
class=${O({drawer:!0,"drawer-top":this.placement===`top`,"drawer-end":this.placement===`end`,"drawer-bottom":this.placement===`bottom`,"drawer-start":this.placement===`start`,"drawer-contained":this.contained,"drawer-fixed":!this.contained})}
|
|
3413
3423
|
?hidden=${t}
|
|
@@ -3441,7 +3451,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3441
3451
|
</div>
|
|
3442
3452
|
</div>
|
|
3443
3453
|
</div>
|
|
3444
|
-
`}};E([w(`.drawer`)],
|
|
3454
|
+
`}};E([w(`.drawer`)],Pv.prototype,`drawer`,void 0),E([w(`.drawer-panel`)],Pv.prototype,`panel`,void 0),E([w(`.drawer-overlay`)],Pv.prototype,`overlay`,void 0),E([S({type:Boolean,reflect:!0})],Pv.prototype,`open`,void 0),E([S({type:String,reflect:!0})],Pv.prototype,`size`,void 0),E([S({type:String,reflect:!0})],Pv.prototype,`placement`,void 0),E([S({type:String})],Pv.prototype,`ariaLabel`,void 0),E([S({type:Boolean,reflect:!0})],Pv.prototype,`contained`,void 0),E([F(`open`,{waitUntilFirstUpdate:!0})],Pv.prototype,`handleOpenChange`,null),E([F(`contained`,{waitUntilFirstUpdate:!0})],Pv.prototype,`handleNoModalChange`,null),N(`drawer.showTop`,{keyframes:[{opacity:0,translate:`0 -100%`},{opacity:1,translate:`0 0`}],options:{duration:250,easing:`ease`}}),N(`drawer.hideTop`,{keyframes:[{opacity:1,translate:`0 0`},{opacity:0,translate:`0 -100%`}],options:{duration:250,easing:`ease`}}),N(`drawer.showEnd`,{keyframes:[{opacity:0,translate:`100%`},{opacity:1,translate:`0`}],rtlKeyframes:[{opacity:0,translate:`-100%`},{opacity:1,translate:`0`}],options:{duration:250,easing:`ease`}}),N(`drawer.hideEnd`,{keyframes:[{opacity:1,translate:`0`},{opacity:0,translate:`100%`}],rtlKeyframes:[{opacity:1,translate:`0`},{opacity:0,translate:`-100%`}],options:{duration:250,easing:`ease`}}),N(`drawer.showBottom`,{keyframes:[{opacity:0,translate:`0 100%`},{opacity:1,translate:`0 0`}],options:{duration:250,easing:`ease`}}),N(`drawer.hideBottom`,{keyframes:[{opacity:1,translate:`0 0`},{opacity:0,translate:`0 100%`}],options:{duration:250,easing:`ease`}}),N(`drawer.showStart`,{keyframes:[{opacity:0,translate:`-100%`},{opacity:1,translate:`0`}],rtlKeyframes:[{opacity:0,translate:`100%`},{opacity:1,translate:`0`}],options:{duration:250,easing:`ease`}}),N(`drawer.hideStart`,{keyframes:[{opacity:1,translate:`0`},{opacity:0,translate:`-100%`}],rtlKeyframes:[{opacity:1,translate:`0`},{opacity:0,translate:`100%`}],options:{duration:250,easing:`ease`}}),N(`drawer.denyClose`,{keyframes:[{scale:1},{scale:1.01},{scale:1}],options:{duration:250}}),N(`drawer.overlay.show`,{keyframes:[{opacity:0},{opacity:1}],options:{duration:250}}),N(`drawer.overlay.hide`,{keyframes:[{opacity:1},{opacity:0}],options:{duration:250}}),x();var Fv=u`.file-upload-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.file-upload-list{display:flex;flex-direction:column;gap:var(--sgds-form-gap-xl);list-style-type:none;margin-top:0}.file-upload-list.has-files{margin-top:var(--sgds-margin-xl)}.filesize{color:var(--sgds-form-color-subtle)}@keyframes fileUploadEnter{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@keyframes fileUploadExit{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-8px)}}.file-upload-list-item-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md);max-height:500px;overflow:hidden;transition:max-height var(--sgds-motion-duration-standard) var(--sgds-motion-easing-standard),opacity var(--sgds-motion-duration-standard) var(--sgds-motion-easing-standard)}.file-upload-list-item-container.file-upload-exit{max-height:0;opacity:0}.file-upload-list-item{align-items:center;animation:fileUploadEnter var(--sgds-motion-duration-standard) var(--sgds-motion-easing-enter);background-color:var(--sgds-form-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-muted);border-radius:var(--sgds-form-border-radius-md);display:flex;gap:var(--sgds-form-gap-lg);padding:var(--sgds-form-padding-y) calc(var(--sgds-form-padding-x) + var(--sgds-padding-2-xl)) var(--sgds-form-padding-y) var(--sgds-form-padding-x);position:relative;transition:transform var(--sgds-motion-duration-standard) var(--sgds-motion-easing-standard)}.file-upload-list-item.file-upload-error{border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.file-upload-list-item.file-upload-exit{animation:fileUploadExit var(--sgds-motion-duration-standard) var(--sgds-motion-easing-exit)}.file-upload-list-item span:not(:first-of-type){cursor:pointer}.file-upload-item-error{align-items:flex-start;display:flex;gap:var(--sgds-form-gap-lg)}.file-upload-item-error sgds-icon{color:var(--sgds-color-muted);flex-shrink:0;margin-top:2px}.file-upload-item-error-message{color:var(--sgds-form-danger-color-default);font-size:var(--sgds-font-size-label-sm,);line-height:var(--sgds-line-height-2-xs)}ul{margin:0;padding:0}input{display:none}sgds-button{cursor:pointer;width:fit-content}sgds-close-button{position:absolute;right:8px;top:8px}sgds-icon.valid{color:var(--sgds-form-success-color-default)}sgds-icon.invalid{color:var(--sgds-color-muted)}.drag-drop-zone{align-items:center;background-color:var(--sgds-surface-raised);border:var(--sgds-border-width-1) dashed var(--sgds-border-color-default);border-radius:var(--sgds-border-radius-md);display:flex;flex-direction:column;gap:var(--sgds-gap-md);justify-content:center;padding:var(--sgds-padding-2-xl)}.drag-drop-text{font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs)}.drag-drop-zone:focus,.drag-drop-zone:focus-visible{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}:host([disabled]) .file-upload-container>:not(sgds-button):not(.invalid-feedback-container){opacity:var(--sgds-opacity-50)}:host([disabled]){cursor:not-allowed;pointer-events:none}:host([disabled]) .drag-drop-zone:focus,:host([disabled]) .drag-drop-zone:focus-visible{outline:none}:host([invalid]:not([disabled])) .drag-drop-zone{border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}:host([invalid]:not([disabled])) .drag-drop-zone:focus,:host([invalid]:not([disabled])) .drag-drop-zone:focus-visible{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}:host(:not([disabled]):not([invalid])) .drag-drop-zone:hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}`;let Iv=e=>{let t=e/1024,n=t/1024,r=n/1024,i=r/1024;return n<1?t.toFixed(2)+` KB`:r<1?n.toFixed(2)+` MB`:i<1?r.toFixed(2)+` GB`:i.toFixed(2)+` TB`};x();var X=class extends j_(V){constructor(...e){super(...e),this.multiple=!1,this.accept=``,this.hasFeedback=!1,this.required=!1,this.variant=`default`,this.ariaLabel=`Choose files`,this.noValidate=!1,this.selectedFiles=[],this.exitingFile=null,this.fileMetadata=/* @__PURE__ */ new Map,this._isTouched=!1,this._isProgrammaticChange=!1,this.inputRef=Hg(),this._dragZoneRef=Hg(),this._dragCounter=0,this._isDialogOpen=!1}static{this.styles=[...V.styles,Fv]}static{this.dependencies={"sgds-button":B,"sgds-close-button":kt,"sgds-icon":L,"sgds-spinner":_m}}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}get files(){return this.selectedFiles}setFileUploadState(e,t,n){let r=this.selectedFiles[e];r&&(this.fileMetadata.set(r,{uploading:t===`loading`,error:n}),this.requestUpdate())}_setFileList(e,t=0,n){if(this.emit(`sgds-change`,{detail:e}),this.emit(`sgds-files-selected`,{detail:e}),e.length>t){let n=Array.from(e).slice(t),r=new DataTransfer;n.forEach(e=>r.items.add(e)),this.emit(`sgds-add-files`,{detail:r.files})}else if(e.length===t&&t>0&&!n){let t=new DataTransfer;Array.from(e).forEach(e=>t.items.add(e)),this.emit(`sgds-add-files`,{detail:t.files})}e.length<t&&n&&this.emit(`sgds-remove-file`,{detail:{file:n,files:e}})}_handleClick(e){e.preventDefault(),this.disabled||(this._isDialogOpen=!0,this.inputRef.value?.click())}_handleCancel(){this._isDialogOpen=!1,this._isTouched=!0,!this._mixinShouldSkipSgdsValidation()&&this.setInvalid(!this._mixinCheckValidity())}_handleChange(e){this._isDialogOpen=!1;let t=e.target,n=t.files,r=this.selectedFiles.length,i=n.length===0&&!this._isProgrammaticChange,a=n.length>0&&!this._isProgrammaticChange,o=a&&this.multiple&&this.selectedFiles.length>0;i&&this.selectedFiles.length>0?this._restoreNativeInput(t):o?this._appendFiles(t,n):n.length>0&&(this.selectedFiles=Array.from(n)),a&&this._setFileList(t.files,r),(!i||this._isTouched)&&super._mixinHandleChange(e)}_restoreNativeInput(e){let t=new DataTransfer;this.selectedFiles.forEach(e=>t.items.add(e)),e.files=t.files}_appendFiles(e,t){let n=[...this.selectedFiles,...Array.from(t)];this.selectedFiles=n;let r=new DataTransfer;n.forEach(e=>r.items.add(e)),e.files=r.files}_removeFileHandler(e){let t=this.selectedFiles[e];this.exitingFile=t,this.requestUpdate(),setTimeout(()=>{let n=this.inputRef.value;if(!n)return;let r=this.selectedFiles.length,i=new DataTransfer;this.selectedFiles.forEach((t,n)=>{e!==n&&i.items.add(t)}),this._isProgrammaticChange=!0,n.files=i.files,this._setFileList(i.files,r,t),this.selectedFiles=Array.from(i.files),this.exitingFile=null,this.requestUpdate(),n.dispatchEvent(new Event(`change`,{bubbles:!0})),this._isProgrammaticChange=!1},300)}_clearAllFiles(){let e=this.inputRef.value,t=this.selectedFiles.length,n=new DataTransfer;e&&(e.files=n.files),this._setFileList(n.files,t),this.selectedFiles=Array.from(n.files)}_mixinResetFormControl(){this._clearAllFiles(),this._mixinResetValidity(this.input)}_handleDisabledChange(){this.setInvalid(!1)}_handleBlur(){let e=this.emit(`sgds-blur`,{cancelable:!0});this._mixinShouldSkipSgdsValidation()||e.defaultPrevented||this._isDialogOpen||(this.setInvalid(!this._mixinCheckValidity()),this._isTouched=!0)}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&this.setInvalid(!this._mixinCheckValidity())}_renderLabel(){let e=y` <label id=${this._labelId} class="form-label"> ${this.label} </label> `;return this.label&&e}_renderHintText(){let e=y` <div id="${this._controlId}Help" class="form-text">${this.hintText}</div> `;return this.hintText&&e}_renderFeedback(){return y`
|
|
3445
3455
|
<div class="invalid-feedback-container">
|
|
3446
3456
|
<sgds-icon name="exclamation-circle-fill" size="md"></sgds-icon>
|
|
3447
3457
|
<div id="${this._controlId}-invalid" class="invalid-feedback">
|
|
@@ -3483,12 +3493,12 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3483
3493
|
<slot>Choose files</slot>
|
|
3484
3494
|
<sgds-icon slot="rightIcon" name="upload"></sgds-icon>
|
|
3485
3495
|
</sgds-button>
|
|
3486
|
-
`}render(){let e=e=>{let t=this.invalid||e?.error?`invalid`:`valid`;return y`<sgds-icon name="check-circle-fill" class="${t}"></sgds-icon>`},t=
|
|
3496
|
+
`}render(){let e=e=>{let t=this.invalid||e?.error?`invalid`:`valid`;return y`<sgds-icon name="check-circle-fill" class="${t}"></sgds-icon>`},t=H_(this.selectedFiles,e=>e,(t,n)=>{let r=this.fileMetadata.get(t);return y`
|
|
3487
3497
|
<li class="file-upload-list-item-container ${this.exitingFile===t?`file-upload-exit`:``}">
|
|
3488
3498
|
<div class="file-upload-list-item ${r?.error?`file-upload-error`:``}">
|
|
3489
3499
|
${r?.uploading?y`<sgds-spinner size="sm"></sgds-spinner>`:e(r)}
|
|
3490
3500
|
<span class="filename">${t.name}</span>
|
|
3491
|
-
<span class="filesize">${
|
|
3501
|
+
<span class="filesize">${Iv(t.size)}</span>
|
|
3492
3502
|
<sgds-close-button
|
|
3493
3503
|
aria-label="remove the file"
|
|
3494
3504
|
?disabled=${r?.uploading}
|
|
@@ -3521,7 +3531,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3521
3531
|
<ul class="file-upload-list ${this.selectedFiles.length>0?`has-files`:``}">
|
|
3522
3532
|
${t}
|
|
3523
3533
|
</ul>
|
|
3524
|
-
`}};E([S({type:Boolean,reflect:!0})],
|
|
3534
|
+
`}};E([S({type:Boolean,reflect:!0})],X.prototype,`multiple`,void 0),E([S({type:String,reflect:!0})],X.prototype,`accept`,void 0),E([S({type:Boolean,reflect:!0})],X.prototype,`hasFeedback`,void 0),E([S({type:String,reflect:!0})],X.prototype,`invalidFeedback`,void 0),E([S({type:Boolean,reflect:!0})],X.prototype,`required`,void 0),E([S({type:String,reflect:!0})],X.prototype,`variant`,void 0),E([S({type:String})],X.prototype,`ariaLabel`,void 0),E([S({type:Boolean,reflect:!0})],X.prototype,`noValidate`,void 0),E([C()],X.prototype,`selectedFiles`,void 0),E([C()],X.prototype,`exitingFile`,void 0),E([C()],X.prototype,`fileMetadata`,void 0),E([C()],X.prototype,`_isTouched`,void 0),E([F(`disabled`,{waitUntilFirstUpdate:!0})],X.prototype,`_handleDisabledChange`,null),E([F(`_isTouched`,{waitUntilFirstUpdate:!0})],X.prototype,`_handleIsTouched`,null),x();var Lv=u`.footer{background-color:var(--sgds-bg-fixed-dark);height:auto}.footer-top{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-default);display:flex;flex-direction:column;padding:var(--sgds-padding-2-xl) var(--sgds-padding-none)}.footer-top.has-content{gap:var(--sgds-gap-2-xl)}.footer-header{display:flex;flex-direction:column;gap:var(--sgds-gap-sm)}slot[name=title]::slotted(*){color:var(--sgds-color-fixed-light)!important;font-size:var(--sgds-font-size-heading-md)!important;font-weight:var(--sgds-font-weight-semibold);letter-spacing:var(--sgds-letter-spacing-tight);line-height:var(--sgds-line-height-md)!important;margin-bottom:var(--sgds-margin-none)!important;margin-top:var(--sgds-margin-none)}slot:not([name])::slotted(*),slot[name=description]::slotted(*){color:var(--sgds-color-fixed-light);margin-bottom:var(--sgds-margin-none)!important;margin-top:var(--sgds-margin-none)}.footer-items{display:grid;gap:var(--sgds-gap-md) var(--sgds-gap-lg);grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}.footer ul{margin:0;padding:0}.footer ul li{list-style-type:none}.footer-bottom{display:flex;flex-direction:column;gap:var(--sgds-gap-md);padding:var(--sgds-padding-2-xl) var(--sgds-padding-none)}.footer-mandatory-links{display:flex;flex-direction:column;flex-wrap:wrap;gap:var(--sgds-gap-xl);justify-content:space-between}.footer-mandatory-links ul{display:flex;flex-direction:column;flex-wrap:wrap;gap:var(--sgds-gap-sm)}.footer-mandatory-links ul li a{color:var(--sgds-color-fixed-light)}.footer-mandatory-links ul li a:focus,.footer-mandatory-links ul li a:hover{color:var(--sgds-color-fixed-light)}.footer-mandatory-links ul li a:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.footer-copyrights{color:var(--sgds-color-fixed-light);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs)}@media (min-width:768px){.footer-mandatory-links ul{flex-direction:row;gap:var(--sgds-gap-sm) var(--sgds-gap-xl)}}@media (min-width:1024px){.footer-top{padding:var(--sgds-padding-3-xl) var(--sgds-padding-none)}.footer-top.has-content{gap:var(--sgds-gap-3-xl)}slot[name=title]::slotted(*){font-size:var(--sgds-font-size-heading-md)!important;line-height:var(--sgds-line-height-md)!important}.footer-mandatory-links ul{gap:var(--sgds-gap-xl)}}@media (min-width:1280px){.footer-mandatory-links{flex-direction:row}}:host([tone=neutral]) .footer{background-color:var(--sgds-bg-default)}:host([tone=neutral]) slot[name=title]::slotted(*){color:var(--sgds-color-default)!important}:host([tone=neutral]) slot:not([name])::slotted(*),:host([tone=neutral]) slot[name=description]::slotted(*){color:var(--sgds-color-default)}:host([tone=neutral]) .footer-copyrights{color:var(--sgds-color-default)}`;x();var Rv=u`.sgds-container,.sgds-container-sidebar{margin-left:auto;margin-right:auto;max-width:calc(100% - 40px);width:100%}.sgds-container-sidebar .sgds-grid{gap:var(--sgds-gap-md)}.sgds-grid{display:grid;gap:var(--sgds-layout-gap-md);grid-template-columns:repeat(4,1fr)}.sgds-col-1{grid-column:span 1}.sgds-col-2{grid-column:span 2}.sgds-col-3{grid-column:span 3}.sgds-col-4{grid-column:span 4}.sgds-col-center-2{grid-column:2/span 2}.sgds-col-none{display:none}@media (min-width:512px){.sgds-grid{grid-template-columns:repeat(8,1fr)}.sgds-container,.sgds-container-sidebar{max-width:calc(100% - 48px)}.sgds-col-sm-1{grid-column:span 1}.sgds-col-sm-2{grid-column:span 2}.sgds-col-sm-3{grid-column:span 3}.sgds-col-sm-4{grid-column:span 4}.sgds-col-sm-5{grid-column:span 5}.sgds-col-sm-6{grid-column:span 6}.sgds-col-sm-7{grid-column:span 7}.sgds-col-sm-8{grid-column:span 8}.sgds-col-sm-center-2{grid-column:4/span 2}.sgds-col-sm-center-4{grid-column:3/span 4}.sgds-col-sm-center-6{grid-column:2/span 6}.sgds-col-none{display:revert}.sgds-col-sm-none{display:none}}@media (min-width:768px){.sgds-container{max-width:calc(100% - 56px)}.sgds-container-sidebar{max-width:calc(100% - 96px)}.sgds-container-sidebar .sgds-grid{gap:var(--sgds-gap-xl)}.sgds-col-md-1{grid-column:span 1}.sgds-col-md-2{grid-column:span 2}.sgds-col-md-3{grid-column:span 3}.sgds-col-md-4{grid-column:span 4}.sgds-col-md-5{grid-column:span 5}.sgds-col-md-6{grid-column:span 6}.sgds-col-md-7{grid-column:span 7}.sgds-col-md-8{grid-column:span 8}.sgds-col-md-center-2{grid-column:4/span 2}.sgds-col-md-center-4{grid-column:3/span 4}.sgds-col-md-center-6{grid-column:2/span 6}.sgds-col-sm-none{display:revert}.sgds-col-md-none{display:none}}@media (min-width:1024px){.sgds-grid{grid-template-columns:repeat(12,1fr)}.sgds-container-sidebar{max-width:calc(100% - 96px)}.sgds-container{max-width:var(--sgds-dimension-888)}.sgds-col-lg-1{grid-column:span 1}.sgds-col-lg-2{grid-column:span 2}.sgds-col-lg-3{grid-column:span 3}.sgds-col-lg-4{grid-column:span 4}.sgds-col-lg-5{grid-column:span 5}.sgds-col-lg-6{grid-column:span 6}.sgds-col-lg-7{grid-column:span 7}.sgds-col-lg-8{grid-column:span 8}.sgds-col-lg-9{grid-column:span 9}.sgds-col-lg-10{grid-column:span 10}.sgds-col-lg-11{grid-column:span 11}.sgds-col-lg-12{grid-column:span 12}.sgds-col-lg-center-2{grid-column:6/span 2}.sgds-col-lg-center-4{grid-column:5/span 4}.sgds-col-lg-center-6{grid-column:4/span 6}.sgds-col-lg-center-8{grid-column:3/span 8}.sgds-col-lg-center-10{grid-column:2/span 10}.sgds-col-md-none{display:revert}.sgds-col-lg-none{display:none}}@media (min-width:1280px){.sgds-container{max-width:var(--sgds-dimension-1168)}.sgds-container-sidebar{max-width:calc(100% - 96px)}.sgds-col-xl-1{grid-column:span 1}.sgds-col-xl-2{grid-column:span 2}.sgds-col-xl-3{grid-column:span 3}.sgds-col-xl-4{grid-column:span 4}.sgds-col-xl-5{grid-column:span 5}.sgds-col-xl-6{grid-column:span 6}.sgds-col-xl-7{grid-column:span 7}.sgds-col-xl-8{grid-column:span 8}.sgds-col-xl-9{grid-column:span 9}.sgds-col-xl-10{grid-column:span 10}.sgds-col-xl-11{grid-column:span 11}.sgds-col-xl-12{grid-column:span 12}.sgds-col-xl-center-2{grid-column:6/span 2}.sgds-col-xl-center-4{grid-column:5/span 4}.sgds-col-xl-center-6{grid-column:4/span 6}.sgds-col-xl-center-8{grid-column:3/span 8}.sgds-col-xl-center-10{grid-column:2/span 10}.sgds-col-lg-none{display:revert}.sgds-col-xl-none{display:none}}@media (min-width:1440px){.sgds-container{max-width:var(--sgds-dimension-1312)}.sgds-container-sidebar{max-width:calc(100% - 96px)}.sgds-col-2-xl-1{grid-column:span 1}.sgds-col-2-xl-2{grid-column:span 2}.sgds-col-2-xl-3{grid-column:span 3}.sgds-col-2-xl-4{grid-column:span 4}.sgds-col-2-xl-5{grid-column:span 5}.sgds-col-2-xl-6{grid-column:span 6}.sgds-col-2-xl-7{grid-column:span 7}.sgds-col-2-xl-8{grid-column:span 8}.sgds-col-2-xl-9{grid-column:span 9}.sgds-col-2-xl-10{grid-column:span 10}.sgds-col-2-xl-11{grid-column:span 11}.sgds-col-2-xl-12{grid-column:span 12}.sgds-col-2-xl-center-2{grid-column:6/span 2}.sgds-col-2-xl-center-4{grid-column:5/span 4}.sgds-col-2-xl-center-6{grid-column:4/span 6}.sgds-col-2-xl-center-8{grid-column:3/span 8}.sgds-col-2-xl-center-10{grid-column:2/span 10}.sgds-col-xl-none{display:revert}.sgds-col-2-xl-none{display:none}}@media (min-width:1680px){.sgds-container-sidebar{max-width:var(--sgds-dimension-1296)}.sgds-col-3-xl-1{grid-column:span 1}.sgds-col-3-xl-2{grid-column:span 2}.sgds-col-3-xl-3{grid-column:span 3}.sgds-col-3-xl-4{grid-column:span 4}.sgds-col-3-xl-5{grid-column:span 5}.sgds-col-3-xl-6{grid-column:span 6}.sgds-col-3-xl-7{grid-column:span 7}.sgds-col-3-xl-8{grid-column:span 8}.sgds-col-3-xl-9{grid-column:span 9}.sgds-col-3-xl-10{grid-column:span 10}.sgds-col-3-xl-11{grid-column:span 11}.sgds-col-3-xl-12{grid-column:span 12}.sgds-col-3-xl-center-2{grid-column:6/span 2}.sgds-col-3-xl-center-4{grid-column:5/span 4}.sgds-col-3-xl-center-6{grid-column:4/span 6}.sgds-col-3-xl-center-8{grid-column:3/span 8}.sgds-col-3-xl-center-10{grid-column:2/span 10}.sgds-col-2-xl-none{display:revert}.sgds-col-3-xl-none{display:none}}`;x();var zv=class extends D{constructor(...e){super(...e),this.copyrightLiner=`Government of Singapore`,this.contactHref=`#`,this.feedbackHref=`#`,this.faqHref=``,this.sitemapHref=``,this.privacyHref=`#`,this.termsOfUseHref=`#`,this.layout=`default`,this.tone=`fixed-dark`,this.hasDefaultSlot=!1,this.hasTitleSlot=!1,this.hasDescriptionSlot=!1,this.hasItemsSlot=!1,this.hasSlotController=new xm(this,`[default]`,`title`,`description`,`items`)}static{this.styles=[...D.styles,Rv,Lv]}static{this.dependencies={"sgds-link":d_}}_handleItemsSlotChange(e){e.target.assignedElements().forEach(e=>{e.tone=this.tone})}_handleToneChange(){(this.shadowRoot?.querySelector(`slot[name="items"]`))?.assignedElements().forEach(e=>{e.tone=this.tone})}updated(){this.hasDefaultSlot||=this.hasSlotController.test(`[default]`),this.hasTitleSlot||=this.hasSlotController.test(`title`),this.hasDescriptionSlot||=this.hasSlotController.test(`description`),this.hasItemsSlot||=this.hasSlotController.test(`items`)}get _linkTone(){return this.tone===`neutral`?`neutral`:`fixed-light`}render(){return y`
|
|
3525
3535
|
<footer class="footer">
|
|
3526
3536
|
<section
|
|
3527
3537
|
class="${O({"footer-top":this.hasDefaultSlot||this.hasTitleSlot||this.hasDescriptionSlot||this.hasItemsSlot,"has-content":this.hasDefaultSlot||this.hasItemsSlot,"sgds-container":this.layout==="default","sgds-container-sidebar":this.layout===`sidebar`})}"
|
|
@@ -3585,7 +3595,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3585
3595
|
</div>
|
|
3586
3596
|
</section>
|
|
3587
3597
|
</footer>
|
|
3588
|
-
`}};E([S({type:String})],
|
|
3598
|
+
`}};E([S({type:String})],zv.prototype,`copyrightLiner`,void 0),E([S({type:String})],zv.prototype,`contactHref`,void 0),E([S({type:String})],zv.prototype,`feedbackHref`,void 0),E([S({type:String})],zv.prototype,`faqHref`,void 0),E([S({type:String})],zv.prototype,`sitemapHref`,void 0),E([S({type:String})],zv.prototype,`privacyHref`,void 0),E([S({type:String})],zv.prototype,`termsOfUseHref`,void 0),E([S({type:String,reflect:!0})],zv.prototype,`layout`,void 0),E([S({type:String,reflect:!0})],zv.prototype,`tone`,void 0),E([S({type:Boolean})],zv.prototype,`hasDefaultSlot`,void 0),E([S({type:Boolean})],zv.prototype,`hasTitleSlot`,void 0),E([S({type:Boolean})],zv.prototype,`hasDescriptionSlot`,void 0),E([S({type:Boolean})],zv.prototype,`hasItemsSlot`,void 0),E([F(`tone`,{waitUntilFirstUpdate:!0})],zv.prototype,`_handleToneChange`,null),x();var Bv=u`.footer-item{margin-bottom:var(--sgds-margin-xs)}.footer-item,.links{display:flex;flex-direction:column;gap:var(--sgds-gap-xs)}slot[name=title]::slotted(*){--sgds-paragraph-spacing-xl:var(--sgds-margin-none);--sgds-font-weight-regular:var(--sgds-font-weight-semibold);color:var(--sgds-color-fixed-light);font-weight:var(--sgds-font-weight-regular,--sgds-font-weight-semibold);margin:var(--sgds-paragraph-spacing-xl,--sgds-margin-none)}.links{margin:0;padding:0}.links slot::slotted(a){--sgds-link-color-default:var(--sgds-color-fixed-light);color:var(--sgds-link-color-default,--sgds-fixed-light);width:fit-content}.links slot::slotted(a:focus),.links slot::slotted(a:focus-visible),slot::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-color-fixed-light);color:var(--sgds-link-color-emphasis,--sgds-color-fixed-light)}.links slot::slotted(a:focus-visible){outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}:host([tone=neutral]) slot[name=title]::slotted(*){color:var(--sgds-color-default)}:host([tone=neutral]) .links slot::slotted(a){--sgds-link-color-default:var(--sgds-color-default);color:var(--sgds-link-color-default)}:host([tone=neutral]) .links slot::slotted(a:focus),:host([tone=neutral]) .links slot::slotted(a:focus-visible),:host([tone=neutral]) .links slot::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-color-default);color:var(--sgds-link-color-emphasis)}`;x();var Vv=class extends D{constructor(...e){super(...e),this.tone=`fixed-dark`}static{this.styles=[...D.styles,Bv]}_handleToneChange(){(this.shadowRoot?.querySelector(`slot:not([name])`))?.assignedElements().forEach(e=>{e.tagName===`SGDS-LINK`&&(e.tone=this.tone===`neutral`?`neutral`:`fixed-light`)})}_handleSlotChange(e){let t=this.tone===`neutral`?`neutral`:`fixed-light`;e.target.assignedElements().forEach(e=>{if(e.tagName===`SGDS-LINK`){let n=e;n.tone=t,n.size=`sm`}})}render(){return y`
|
|
3589
3599
|
<div class="footer-item">
|
|
3590
3600
|
<slot name="title"></slot>
|
|
3591
3601
|
<div class="links">
|
|
@@ -3650,7 +3660,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3650
3660
|
</div>
|
|
3651
3661
|
</${e}>
|
|
3652
3662
|
`}};E([ot({slot:`image`,flatten:!0})],qv.prototype,`_imageNode`,void 0),E([T({slot:`footer`})],qv.prototype,`footerNode`,void 0),E([T({slot:`link`})],qv.prototype,`linkNode`,void 0),E([S({type:Boolean,reflect:!0})],qv.prototype,`noPadding`,void 0),E([S({type:String,reflect:!0})],qv.prototype,`imagePosition`,void 0),E([S({type:String,reflect:!0})],qv.prototype,`imageAdjustment`,void 0);let Jv=im(`mainnav-context`),Yv=im(`mainnav-expanded-context`);x();var Xv=u`:host{display:block}nav{background-color:var(--sgds-surface-default);box-shadow:0 2px 4px 0 hsla(0,0%,5%,.08);position:relative;z-index:var(--sgds-z-index-floating)}.navbar{align-items:stretch;display:flex;flex-wrap:wrap;font-size:var(--sgds-font-size-label-sm);gap:var(--sgds-gap-xs);justify-content:flex-start;margin:auto;max-width:var(--sgds-mainnav-max-width,1440px);min-height:var(--sgds-mainnav-height,72px);padding:0 var(--sgds-mainnav-mobile-padding-x);width:100%}:host([fluid]) .navbar{max-width:none}.navbar-brand{align-items:center;align-self:center;color:var(--sgds-color-default);display:flex;height:var(--sgds-dimension-40);text-decoration:none;white-space:nowrap}.navbar-brand ::slotted(img){height:100%}.navbar-brand:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.navbar-nav{display:flex;flex-direction:column;height:100%;margin-bottom:0;margin-top:0;width:100%}nav>.navbar-body{background-color:var(--sgds-surface-default);border-top:var(--sgds-border-width-1) solid var(--sgds-border-color-translucent);box-shadow:0 2px 4px 0 hsla(0,0%,5%,.08);padding:var(--sgds-padding-md) 0;position:absolute;transition:transform .2s ease-in-out;width:100%;z-index:var(--sgds-z-index-floating)}nav>.navbar-body .navbar-nav{height:100dvh;margin:auto;max-width:var(--sgds-mainnav-max-width,1440px)}nav>.navbar-body slot::slotted(:not(sgds-mainnav-item):not(sgds-mainnav-dropdown):not(sgds-mainnav-profile)){padding:var(--sgds-padding-sm) var(--sgds-mainnav-mobile-padding-x)}.navbar-collapse{align-items:center;flex-basis:100%;flex-grow:1}.navbar-toggler{align-self:center}@media (prefers-reduced-motion:reduce){.navbar-toggler{transition:none}}.navbar-nav-scroll{overflow-y:auto}@media (min-width:512px){.navbar-expand-sm{flex-wrap:nowrap;gap:var(--sgds-gap-xl);justify-content:flex-start}.navbar-expand-sm .navbar-nav{flex-direction:row}.navbar-expand-sm .navbar-nav-scroll{overflow:visible}.navbar-expand-sm .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}}@media (min-width:768px){.navbar-expand-md{flex-wrap:nowrap;gap:var(--sgds-gap-xl);justify-content:flex-start}.navbar-expand-md .navbar-nav{flex-direction:row}.navbar-expand-md .navbar-nav-scroll{overflow:visible}.navbar-expand-md .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}}@media (min-width:1024px){.navbar{padding:0 var(--sgds-mainnav-padding-x)}.navbar-expand-lg{flex-wrap:nowrap;gap:var(--sgds-gap-xl);justify-content:flex-start}.navbar-expand-lg .navbar-nav{flex-direction:row}.navbar-expand-lg .navbar-nav-scroll{overflow:visible}.navbar-expand-lg .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}}@media (min-width:1280px){.navbar-expand-xl{flex-wrap:nowrap;gap:var(--sgds-gap-xl);justify-content:flex-start}.navbar-expand-xl .navbar-nav{flex-direction:row}.navbar-expand-xl .navbar-nav .nav-link{padding-left:var(--mainnav-nav-link-padding-x);padding-right:var(--mainnav-nav-link-padding-x)}.navbar-expand-xl .navbar-nav-scroll{overflow:visible}.navbar-expand-xl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}}@media (min-width:1440px){.navbar-expand-xxl{flex-wrap:nowrap;gap:var(--sgds-gap-xl);justify-content:flex-start}.navbar-expand-xxl .navbar-nav{flex-direction:row}.navbar-expand-xxl .navbar-nav-scroll{overflow:visible}.navbar-expand-xxl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xxl .navbar-toggler{display:none}}.navbar-expand{flex-wrap:nowrap;gap:var(--sgds-gap-xl);justify-content:flex-start}.navbar-expand .navbar-nav{flex-direction:row}.navbar-expand .navbar-nav-scroll{overflow:visible}.navbar-expand .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-end{align-items:center;display:flex;gap:var(--sgds-gap-xs);margin-left:auto}slot[name=non-collapsible].slot-empty{display:none}slot[name=profile]{align-self:stretch;display:flex}slot[name=non-collapsible]{align-items:center;display:flex;gap:var(--sgds-spacer-4)}.slot-end{align-items:stretch;display:flex;gap:var(--sgds-gap-xs);height:inherit;margin-left:auto}.slot-end::slotted(:not([name$=-mainnav-item]):not([name$=-mainnav-dropdown])){align-self:center}`;x();var Zv=class extends z{constructor(...e){super(...e),this._breakpointReached=!1,this._expanded=!1,this.hasNonCollapsibleSlot=!1,this.fluid=!1,this.hasSlotController=new xm(this,`non-collapsible`)}static{this.styles=[...z.styles,Xv]}get defaultSlotItems(){return[...this.defaultNodes||[]].filter(e=>e.tagName!==void 0)}get endSlotItems(){return[...this.endNodes||[]].filter(e=>e.tagName!==void 0)}updated(){this.hasNonCollapsibleSlot||=this.hasSlotController.test(`non-collapsible`),this._expanded=this.expanded}_onBreakpointReached(e){this._breakpointReached=e}_isBreakpointReached(){return this._breakpointReached}_handleDefaultSlotChange(e){e.target.assignedElements({flatten:!0}).forEach(e=>{e.setAttribute(`expand`,this.expand)})}_handleSlotChange(e){e.target.assignedElements({flatten:!0}).forEach(e=>{e.setAttribute(`name`,e.tagName.toLowerCase()),e.setAttribute(`expand`,this.expand)})}_handleProfileSlotChange(e){e.target.assignedElements({flatten:!0}).forEach(e=>{e.setAttribute(`expand`,this.expand)})}render(){return this.breakpointReached=window.innerWidth<(this.expand===`always`?-1:this.expand===`never`?1/0:{sm:512,md:768,lg:1024,xl:1280,xxl:1440}[this.expand]),y`
|
|
3653
|
-
<nav>
|
|
3663
|
+
<nav aria-label="Main navigation">
|
|
3654
3664
|
<div class="navbar ${this._expandClass()}">
|
|
3655
3665
|
<a class="navbar-brand" href=${$p(this.brandHref)??``} aria-label="brand-link">
|
|
3656
3666
|
<slot name="brand"></slot>
|
|
@@ -3861,7 +3871,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3861
3871
|
</div>
|
|
3862
3872
|
</div>
|
|
3863
3873
|
</div>
|
|
3864
|
-
`}};E([S({type:Boolean,reflect:!0})],oy.prototype,`fluid`,void 0),E([C()],oy.prototype,`toggleVisibility`,void 0);function sy(e){let t=e.tagName.toLowerCase();return e.getAttribute(`tabindex`)===`-1`||e.hasAttribute(`disabled`)||e.hasAttribute(`aria-disabled`)&&e.getAttribute(`aria-disabled`)!==`false`||t===`input`&&e.getAttribute(`type`)===`radio`&&!e.hasAttribute(`checked`)||e.offsetParent===null||window.getComputedStyle(e).visibility===`hidden`?!1:(t===`audio`||t===`video`)&&e.hasAttribute(`controls`)||e.hasAttribute(`tabindex`)||e.hasAttribute(`contenteditable`)&&e.getAttribute(`contenteditable`)!==`false`?!0:[`button`,`input`,`select`,`textarea`,`a`,`audio`,`video`,`summary`].includes(t)}function cy(e){let t=[];function n(e){e instanceof HTMLElement&&(t.push(e),e.shadowRoot!==null&&e.shadowRoot.mode===`open`&&n(e.shadowRoot)),[...e.children].forEach(e=>n(e))}return n(e),{start:t.find(e=>sy(e))??null,end:t.reverse().find(e=>sy(e))??null}}let ly=[];var uy=class{constructor(e){this.tabDirection=`forward`,this.element=e,this.handleFocusIn=this.handleFocusIn.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this)}activate(){ly.push(this.element),document.addEventListener(`focusin`,this.handleFocusIn),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}deactivate(){ly=ly.filter(e=>e!==this.element),document.removeEventListener(`focusin`,this.handleFocusIn),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)}isActive(){return ly[ly.length-1]===this.element}checkFocus(){if(this.isActive()&&!this.element.matches(`:focus-within`)){let{start:e,end:t}=cy(this.element),n=this.tabDirection===`forward`?e:t;typeof n?.focus==`function`&&n.focus({preventScroll:!0})}}handleFocusIn(){this.checkFocus()}handleKeyDown(e){e.key===`Tab`&&e.shiftKey&&(this.tabDirection=`backward`,requestAnimationFrame(()=>this.checkFocus()))}handleKeyUp(){this.tabDirection=`forward`}};x();var dy=u`:host(:not([size=fullscreen])) .modal-panel{background-color:var(--sgds-surface-default);max-width:var(--sgds-dimension-640);padding:var(--sgds-padding-xl)}:host([size=sm]) .modal-panel{max-width:var(--sgds-dimension-480)}:host([size=md]) .modal-panel{max-width:var(--sgds-dimension-640)}:host([size=lg]) .modal-panel{max-width:var(--sgds-dimension-800)}:host([size=xl]) .modal-panel{max-width:var(--sgds-dimension-1280)}:host([size=fullscreen]) .modal-overlay{background-color:var(--sgds-surface-default)}:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-xl) var(--sgds-margin-lg)}.modal{align-items:start;bottom:0;display:flex;font-family:var(--sgds-body-font-family);justify-content:center;left:0;position:fixed;right:0;top:0;z-index:var(--sgds-z-index-modal)}.modal-panel{border-radius:var(--sgds-border-radius-md);display:flex;flex-direction:column;gap:var(--sgds-gap-2-xl);margin:auto;max-height:calc(100% - var(--sgds-margin-xl) - var(--sgds-margin-xl));width:100%;z-index:2}.modal-panel:focus{outline:none}.modal-content{display:flex;flex:1 1 auto;flex-direction:column;gap:var(--sgds-gap-2-xl);min-height:0;position:relative}.modal-header__close{position:absolute;right:calc(var(--sgds-padding-md)*-1);top:calc(var(--sgds-padding-md)*-1)}@media screen and (min-width:512px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-xl)}}@media screen and (min-width:768px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-2-xl);max-height:calc(100% - var(--sgds-margin-2-xl) - var(--sgds-margin-2-xl))}}@media screen and (min-width:1024px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-4-xl) var(--sgds-margin-lg);max-height:calc(100% - var(--sgds-margin-4-xl) - var(--sgds-margin-4-xl));max-width:var(--sgds-dimension-888)}}@media screen and (min-width:1280px){:host([size=fullscreen]) .modal-panel{max-width:var(--sgds-dimension-1168)}}@media screen and (min-width:1440px){:host([size=fullscreen]) .modal-panel{max-width:var(--sgds-dimension-1312)}}.modal.show .modal-panel{opacity:1;transform:none}.modal-header{display:flex;flex:0 0 auto;flex-direction:row;justify-content:space-between;max-width:var(--sgds-dimension-872)}.modal-header__title-description{display:flex;flex-direction:column;gap:var(--sgds-gap-sm)}:host([size=fullscreen]) .modal-header__title-description{gap:var(--sgds-gap-md)}slot[name=title]::slotted(*){align-items:center;display:flex;flex:1 1 auto;font-size:var(--sgds-font-size-heading-sm)!important;gap:1rem;line-height:var(--sgds-line-height-lg)!important;margin:var(--sgds-margin-none)!important}slot[name=description]::slotted(*){color:var(--sgds-color-subtle);line-height:var(--sgds-line-height-xs);margin:var(--sgds-margin-none)!important}.modal-body{-webkit-overflow-scrolling:touch;flex:1 1 auto;overflow:auto}.modal-body slot::slotted(*){--sgds-paragraph-spacing-xl:var(--sgds-margin-none)}.modal-footer{display:flex;flex:0 0 auto;flex-wrap:wrap;gap:var(--sgds-gap-md);justify-content:flex-end;padding-top:var(--sgds-padding-md)}.modal:not(.has-footer) .modal-footer{display:none}.modal-overlay{background-color:var(--sgds-bg-overlay);bottom:0;left:0;position:fixed;right:0;top:0}[hidden]{display:none}`;x();var fy=class extends D{constructor(...e){super(...e),this.hasSlotController=new xm(this,`footer`),this.open=!1,this.noAnimation=!1,this.size=`md`,this.hasFooterSlot=!1,this.noCloseButton=!1}static{this.styles=[...D.styles,y_,ay,dy]}static{this.dependencies={"sgds-close-button":kt}}connectedCallback(){super.connectedCallback(),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.modal=new uy(this),this._resizeHandler=this._debounce(this._onWindowResize.bind(this),200)}disconnectedCallback(){super.disconnectedCallback(),this._removeResizeListener(),
|
|
3874
|
+
`}};E([S({type:Boolean,reflect:!0})],oy.prototype,`fluid`,void 0),E([C()],oy.prototype,`toggleVisibility`,void 0);function sy(e){let t=e.tagName.toLowerCase();return e.getAttribute(`tabindex`)===`-1`||e.hasAttribute(`disabled`)||e.hasAttribute(`aria-disabled`)&&e.getAttribute(`aria-disabled`)!==`false`||t===`input`&&e.getAttribute(`type`)===`radio`&&!e.hasAttribute(`checked`)||e.offsetParent===null||window.getComputedStyle(e).visibility===`hidden`?!1:(t===`audio`||t===`video`)&&e.hasAttribute(`controls`)||e.hasAttribute(`tabindex`)||e.hasAttribute(`contenteditable`)&&e.getAttribute(`contenteditable`)!==`false`?!0:[`button`,`input`,`select`,`textarea`,`a`,`audio`,`video`,`summary`].includes(t)}function cy(e){let t=[];function n(e){e instanceof HTMLElement&&(t.push(e),e.shadowRoot!==null&&e.shadowRoot.mode===`open`&&n(e.shadowRoot)),[...e.children].forEach(e=>n(e))}return n(e),{start:t.find(e=>sy(e))??null,end:t.reverse().find(e=>sy(e))??null}}let ly=[];var uy=class{constructor(e){this.tabDirection=`forward`,this.element=e,this.handleFocusIn=this.handleFocusIn.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this)}activate(){ly.push(this.element),document.addEventListener(`focusin`,this.handleFocusIn),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}deactivate(){ly=ly.filter(e=>e!==this.element),document.removeEventListener(`focusin`,this.handleFocusIn),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)}isActive(){return ly[ly.length-1]===this.element}checkFocus(){if(this.isActive()&&!this.element.matches(`:focus-within`)){let{start:e,end:t}=cy(this.element),n=this.tabDirection===`forward`?e:t;typeof n?.focus==`function`&&n.focus({preventScroll:!0})}}handleFocusIn(){this.checkFocus()}handleKeyDown(e){e.key===`Tab`&&e.shiftKey&&(this.tabDirection=`backward`,requestAnimationFrame(()=>this.checkFocus()))}handleKeyUp(){this.tabDirection=`forward`}};x();var dy=u`:host(:not([size=fullscreen])) .modal-panel{background-color:var(--sgds-surface-default);max-width:var(--sgds-dimension-640);padding:var(--sgds-padding-xl)}:host([size=sm]) .modal-panel{max-width:var(--sgds-dimension-480)}:host([size=md]) .modal-panel{max-width:var(--sgds-dimension-640)}:host([size=lg]) .modal-panel{max-width:var(--sgds-dimension-800)}:host([size=xl]) .modal-panel{max-width:var(--sgds-dimension-1280)}:host([size=fullscreen]) .modal-overlay{background-color:var(--sgds-surface-default)}:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-xl) var(--sgds-margin-lg)}.modal{align-items:start;bottom:0;display:flex;font-family:var(--sgds-body-font-family);justify-content:center;left:0;position:fixed;right:0;top:0;z-index:var(--sgds-z-index-modal)}.modal-panel{border-radius:var(--sgds-border-radius-md);display:flex;flex-direction:column;gap:var(--sgds-gap-2-xl);margin:auto;max-height:calc(100% - var(--sgds-margin-xl) - var(--sgds-margin-xl));width:100%;z-index:2}.modal-panel:focus{outline:none}.modal-content{display:flex;flex:1 1 auto;flex-direction:column;gap:var(--sgds-gap-2-xl);min-height:0;position:relative}.modal-header__close{position:absolute;right:calc(var(--sgds-padding-md)*-1);top:calc(var(--sgds-padding-md)*-1)}@media screen and (min-width:512px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-xl)}}@media screen and (min-width:768px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-2-xl);max-height:calc(100% - var(--sgds-margin-2-xl) - var(--sgds-margin-2-xl))}}@media screen and (min-width:1024px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-4-xl) var(--sgds-margin-lg);max-height:calc(100% - var(--sgds-margin-4-xl) - var(--sgds-margin-4-xl));max-width:var(--sgds-dimension-888)}}@media screen and (min-width:1280px){:host([size=fullscreen]) .modal-panel{max-width:var(--sgds-dimension-1168)}}@media screen and (min-width:1440px){:host([size=fullscreen]) .modal-panel{max-width:var(--sgds-dimension-1312)}}.modal.show .modal-panel{opacity:1;transform:none}.modal-header{display:flex;flex:0 0 auto;flex-direction:row;justify-content:space-between;max-width:var(--sgds-dimension-872)}.modal-header__title-description{display:flex;flex-direction:column;gap:var(--sgds-gap-sm)}:host([size=fullscreen]) .modal-header__title-description{gap:var(--sgds-gap-md)}slot[name=title]::slotted(*){align-items:center;display:flex;flex:1 1 auto;font-size:var(--sgds-font-size-heading-sm)!important;gap:1rem;line-height:var(--sgds-line-height-lg)!important;margin:var(--sgds-margin-none)!important}slot[name=description]::slotted(*){color:var(--sgds-color-subtle);line-height:var(--sgds-line-height-xs);margin:var(--sgds-margin-none)!important}.modal-body{-webkit-overflow-scrolling:touch;flex:1 1 auto;overflow:auto}.modal-body:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.modal-body slot::slotted(*){--sgds-paragraph-spacing-xl:var(--sgds-margin-none)}.modal-footer{display:flex;flex:0 0 auto;flex-wrap:wrap;gap:var(--sgds-gap-md);justify-content:flex-end;padding-top:var(--sgds-padding-md)}.modal:not(.has-footer) .modal-footer{display:none}.modal-overlay{background-color:var(--sgds-bg-overlay);bottom:0;left:0;position:fixed;right:0;top:0}[hidden]{display:none}`;x();var fy=class extends D{constructor(...e){super(...e),this.hasSlotController=new xm(this,`footer`),this.open=!1,this.noAnimation=!1,this.size=`md`,this.hasFooterSlot=!1,this.noCloseButton=!1}static{this.styles=[...D.styles,y_,ay,dy]}static{this.dependencies={"sgds-close-button":kt}}connectedCallback(){super.connectedCallback(),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.modal=new uy(this),this._resizeHandler=this._debounce(this._onWindowResize.bind(this),200)}disconnectedCallback(){super.disconnectedCallback(),this._removeResizeListener(),Mv(this)}firstUpdated(e){super.firstUpdated(e),this._onWindowResize(),this.dialog.hidden=!this.open,this.open&&(this.addOpenListeners(),this.modal.activate(),jv(this))}updated(){this.hasFooterSlot||=this.hasSlotController.test(`footer`)}_debounce(e,t){let n;return(...r)=>{clearTimeout(n),n=window.setTimeout(()=>e(...r),t)}}_onWindowResize(){let e=this.panel.getBoundingClientRect().width,t=this.querySelectorAll(`sgds-button[slot='footer']`);this.panel&&(t.length<=1||(e<512||this.size===`fullscreen`&&e<768?t.forEach(e=>{let t=e;t.fullWidth=!0}):t.forEach(e=>{let t=e;t.fullWidth=!1})))}_addResizeListener(){window.addEventListener(`resize`,this._resizeHandler)}_removeResizeListener(){window.removeEventListener(`resize`,this._resizeHandler)}async show(){if(!this.open)return this.open=!0,P(this,`sgds-after-show`)}async hide(){if(this.open)return this.open=!1,P(this,`sgds-after-hide`)}requestClose(e){if(this.emit(`sgds-close`,{cancelable:!0,detail:{source:e}}).defaultPrevented){let e=M(this,`modal.denyClose`);A(this.panel,e.keyframes);return}this.hide()}addOpenListeners(){document.addEventListener(`keydown`,this.handleDocumentKeyDown)}removeOpenListeners(){document.removeEventListener(`keydown`,this.handleDocumentKeyDown)}handleDocumentKeyDown(e){this.open&&e.key===`Escape`&&(e.stopPropagation(),this.requestClose(`keyboard`))}_overlayClickHandler(){this.size!==`fullscreen`&&this.requestClose(`overlay`)}async handleOpenChange(){if(this.open){this.emit(`sgds-show`),this.addOpenListeners(),this.originalTrigger=document.activeElement,this.modal.activate(),jv(this),await Promise.all([j(this.dialog),j(this.overlay)]),this.dialog.hidden=!1;let e=M(this,`modal.show`),t=M(this,`modal.overlay.show`);!this.noAnimation&&await Promise.all([A(this.panel,e.keyframes,e.options),A(this.overlay,t.keyframes,t.options)]),this.emit(`sgds-after-show`),this.heading.focus(),this._addResizeListener()}else{this.emit(`sgds-hide`),this.removeOpenListeners(),this.modal.deactivate(),await Promise.all([j(this.dialog),j(this.overlay)]);let e=M(this,`modal.hide`),t=M(this,`modal.overlay.hide`);!this.noAnimation&&await Promise.all([A(this.overlay,t.keyframes,t.options).then(()=>{this.overlay.hidden=!0}),A(this.panel,e.keyframes,e.options).then(()=>{this.panel.hidden=!0})]),this.dialog.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1,Mv(this);let n=this.originalTrigger;typeof n?.focus==`function`&&setTimeout(()=>n.focus()),this.emit(`sgds-after-hide`),this._removeResizeListener()}}render(){return y`
|
|
3865
3875
|
<div
|
|
3866
3876
|
class=${O({modal:!0,show:this.open,"has-footer":this.hasFooterSlot})}
|
|
3867
3877
|
>
|
|
@@ -3887,7 +3897,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3887
3897
|
<slot name="description"></slot>
|
|
3888
3898
|
</div>
|
|
3889
3899
|
</div>
|
|
3890
|
-
<div class="modal-body">
|
|
3900
|
+
<div class="modal-body" tabindex="0">
|
|
3891
3901
|
<slot></slot>
|
|
3892
3902
|
</div>
|
|
3893
3903
|
</div class="modal-content">
|
|
@@ -3916,7 +3926,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
3916
3926
|
</div>
|
|
3917
3927
|
${this.label?y`<span class="label">${this.label}</span>`:b}
|
|
3918
3928
|
</div>
|
|
3919
|
-
`}};E([S({type:String,reflect:!0})],hy.prototype,`variant`,void 0),E([S({type:Number,reflect:!0})],hy.prototype,`value`,void 0),E([S({type:Number,reflect:!0})],hy.prototype,`ariamin`,void 0),E([S({type:Number,reflect:!0})],hy.prototype,`ariamax`,void 0),E([S({type:String,reflect:!0})],hy.prototype,`ariaLabel`,void 0),E([S({type:String,reflect:!0})],hy.prototype,`arialabel`,void 0),E([S({type:String,reflect:!0})],hy.prototype,`label`,void 0),x();var gy=u`sgds-input{--input-min-width:var(--sgds-dimension-0)}.input-group{align-items:stretch;display:flex;gap:var(--sgds-gap-none)}.input-group>sgds-input{--input-border-radius:0;flex:1 1 auto;margin-inline:calc(var(--sgds-form-border-width-default)*-1);min-width:0;position:relative;z-index:1}.input-group>sgds-input:focus-within{z-index:3}.input-group>sgds-icon-button.minus-btn{--btn-border-radius:var(--sgds-form-border-radius-md) 0 0 var(--sgds-form-border-radius-md)}.input-group>sgds-icon-button.plus-btn{--btn-border-radius:0 var(--sgds-form-border-radius-md) var(--sgds-form-border-radius-md) 0}.input-group sgds-button:focus{z-index:3}.visually-hidden{clip:rect(0,0,0,0)!important;border:0!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}`,_y=class extends j_(V){constructor(...e){super(...e),this.value=0,this.step=1,this.noValidate=!1,this.readonly=!1,this.defaultValue=0}static{this.styles=[...V.styles,O_,ay,
|
|
3929
|
+
`}};E([S({type:String,reflect:!0})],hy.prototype,`variant`,void 0),E([S({type:Number,reflect:!0})],hy.prototype,`value`,void 0),E([S({type:Number,reflect:!0})],hy.prototype,`ariamin`,void 0),E([S({type:Number,reflect:!0})],hy.prototype,`ariamax`,void 0),E([S({type:String,reflect:!0})],hy.prototype,`ariaLabel`,void 0),E([S({type:String,reflect:!0})],hy.prototype,`arialabel`,void 0),E([S({type:String,reflect:!0})],hy.prototype,`label`,void 0),x();var gy=u`sgds-input{--input-min-width:var(--sgds-dimension-0)}.input-group{align-items:stretch;display:flex;gap:var(--sgds-gap-none)}.input-group>sgds-input{--input-border-radius:0;flex:1 1 auto;margin-inline:calc(var(--sgds-form-border-width-default)*-1);min-width:0;position:relative;z-index:1}.input-group>sgds-input:focus-within{z-index:3}.input-group>sgds-icon-button.minus-btn{--btn-border-radius:var(--sgds-form-border-radius-md) 0 0 var(--sgds-form-border-radius-md)}.input-group>sgds-icon-button.plus-btn{--btn-border-radius:0 var(--sgds-form-border-radius-md) var(--sgds-form-border-radius-md) 0}.input-group sgds-button:focus{z-index:3}.visually-hidden{clip:rect(0,0,0,0)!important;border:0!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}`,_y=class extends j_(V){constructor(...e){super(...e),this.value=0,this.step=1,this.noValidate=!1,this.readonly=!1,this.defaultValue=0}static{this.styles=[...V.styles,O_,ay,F_,gy]}static{this.dependencies={"sgds-input":J,"sgds-icon-button":ym}}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}async _handleValueChange(e,t){e.stopPropagation();let n=await this._sgdsInput;(parseInt(n.value)<this.step||n.value===``)&&(n.value=`0`),this.value=parseInt(n.value),this._mixinSetFormValue(),this.emit(t),!this._mixinShouldSkipSgdsValidation()&&(t===`sgds-input`&&(this.invalid=!1),this._mixinValidate(n.input),t===`sgds-change`&&(this.invalid=!this._mixinReportValidity()))}async _mixinResetFormControl(){let e=await this._sgdsInput;this.value=this.defaultValue,e.input.value=this.value.toString(),this._mixinResetValidity(e.input)}_handleKeyDown(e){[`Backspace`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,...Array.from(Array(10).keys()).map(e=>e.toString()),`Tab`].includes(e.key)||e.preventDefault()}_handleInvalid(){this.invalid=!0}_handleValid(){this.invalid=!1}plus(){this.plusBtn.click()}minus(){this.minusBtn.click()}async _onPlus(e){let t=await this._sgdsInput;e.preventDefault(),e.stopPropagation(),this.value=parseInt(t.value)+parseInt(t.step.toString()),this._validateOnClick(t.input),this.emit(`sgds-change`)}async _onMinus(e){let t=await this._sgdsInput;e.preventDefault(),e.stopPropagation(),this.value=this.value<this.step?0:parseInt(t.value)-parseInt(t.step.toString()),this._validateOnClick(t.input),this.emit(`sgds-change`)}async _validateOnClick(e){await(await this._sgdsInput).updateComplete,this._mixinSetFormValue(),!this._mixinShouldSkipSgdsValidation()&&(this._mixinValidate(e),this.invalid=!this._mixinReportValidity())}_renderFeedback(){let e=this.hasFeedback===`both`||this.hasFeedback===`text`;return this.invalid&&e?I` <div class="invalid-feedback-container">
|
|
3920
3930
|
<slot name="invalidIcon">
|
|
3921
3931
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
3922
3932
|
<path
|
|
@@ -4045,10 +4055,10 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
4045
4055
|
</div>
|
|
4046
4056
|
`:b}
|
|
4047
4057
|
</fieldset>
|
|
4048
|
-
`}};E([w(`slot:not([name])`)],xy.prototype,`defaultSlot`,void 0),E([C()],xy.prototype,`defaultValue`,void 0),E([S({reflect:!0})],xy.prototype,`value`,void 0),E([S({type:String,reflect:!0})],xy.prototype,`invalidFeedback`,void 0),E([S({type:Boolean,reflect:!0})],xy.prototype,`hasFeedback`,void 0),E([S({type:Boolean,reflect:!0})],xy.prototype,`required`,void 0),E([S({type:Boolean,reflect:!0})],xy.prototype,`noValidate`,void 0),E([S({type:Boolean,reflect:!0})],xy.prototype,`autofocus`,void 0),E([F(`value`,{waitUntilFirstUpdate:!0})],xy.prototype,`_handleValueChange`,null),E([F(`invalid`,{waitUntilFirstUpdate:!0})],xy.prototype,`_handleInvalidChange`,null),E([C()],xy.prototype,`_isTouched`,void 0),E([T()],xy.prototype,`_radios`,void 0),E([F(`_isTouched`,{waitUntilFirstUpdate:!0})],xy.prototype,`_handleIsTouched`,null),E([F(`disabled`,{waitUntilFirstUpdate:!0})],xy.prototype,`_handleDisabledChange`,null),x();var Sy=u`:host{display:block;position:relative}input.form-control{caret-color:transparent;cursor:default}.dropdown{display:flex;height:100%}.dropdown-menu{box-sizing:border-box;max-height:10rem;overflow-x:hidden;overflow-y:auto}slot[id=default].is-loading,slot[id=default].is-loading::slotted(*){display:none}`;x();var Cy=class extends
|
|
4058
|
+
`}};E([w(`slot:not([name])`)],xy.prototype,`defaultSlot`,void 0),E([C()],xy.prototype,`defaultValue`,void 0),E([S({reflect:!0})],xy.prototype,`value`,void 0),E([S({type:String,reflect:!0})],xy.prototype,`invalidFeedback`,void 0),E([S({type:Boolean,reflect:!0})],xy.prototype,`hasFeedback`,void 0),E([S({type:Boolean,reflect:!0})],xy.prototype,`required`,void 0),E([S({type:Boolean,reflect:!0})],xy.prototype,`noValidate`,void 0),E([S({type:Boolean,reflect:!0})],xy.prototype,`autofocus`,void 0),E([F(`value`,{waitUntilFirstUpdate:!0})],xy.prototype,`_handleValueChange`,null),E([F(`invalid`,{waitUntilFirstUpdate:!0})],xy.prototype,`_handleInvalidChange`,null),E([C()],xy.prototype,`_isTouched`,void 0),E([T()],xy.prototype,`_radios`,void 0),E([F(`_isTouched`,{waitUntilFirstUpdate:!0})],xy.prototype,`_handleIsTouched`,null),E([F(`disabled`,{waitUntilFirstUpdate:!0})],xy.prototype,`_handleDisabledChange`,null),x();var Sy=u`:host{display:block;position:relative}input.form-control{caret-color:transparent;cursor:default}.dropdown{display:flex;height:100%}.dropdown-menu{box-sizing:border-box;max-height:10rem;overflow-x:hidden;overflow-y:auto}slot[id=default].is-loading,slot[id=default].is-loading::slotted(*){display:none}`;x();var Cy=class extends z_{constructor(...e){super(...e),this._renderItemContent=()=>y`<div class="normal-item-content" role="presentation">
|
|
4049
4059
|
<slot></slot>
|
|
4050
4060
|
${this.active?y` <sgds-icon name="check"></sgds-icon> `:b}
|
|
4051
|
-
</div>`}static{this.dependencies={"sgds-icon":L}}};x();var wy=class e extends
|
|
4061
|
+
</div>`}static{this.dependencies={"sgds-icon":L}}};x();var wy=class e extends W{constructor(...e){super(...e),this.noValidate=!1,this._blockInputKeydown=e=>{e.key!==`Tab`&&e.preventDefault()}}static{this.styles=[...W.styles,F_,Sy]}static{this.childName=`sgds-select-option`}static{this.dependencies={"sgds-icon":L,"sgds-spinner":_m,[e.childName]:Cy}}connectedCallback(){super.connectedCallback(),this.addEventListener(`sgds-hide`,async()=>{(await this._input).focus({preventScroll:!0})})}async firstUpdated(e){super.firstUpdated(e),this._updateDisplayValue(),this.input=await this._input,this._mixinValidate(this.input),this.menuIsOpen&&await this.updateFloatingPosition()}async _handleSlotChange(e){let t=e.target.assignedElements({flatten:!0});t.forEach(e=>e.addEventListener(`click`,e=>{e.target.disabled||this._handleItemSelected(e)})),t.forEach(e=>e.addEventListener(`keydown`,e=>{e.key===`Enter`&&this._handleItemSelected(e)})),this.menuList=await this._getMenuListFromOptions(t),this.value&&(this._updateDisplayValue(),this._setActiveToOption()),this.input=await this._input,this._mixinValidate(this.input)}_updateDisplayValue(){if(this.value&&this.menuList.length>0){let e=this.menuList.filter(({value:e})=>e===this.value);if(e.length===0)return;this.displayValue=e[0].label,this._setActiveToOption()}}_setActiveToOption(){let e=this.menuList.findIndex(e=>e.value?.toString()===this.value);this.options.forEach((t,n)=>{t.active=n===e})}async _handleValueChange(){if(this.menuList.length===0)return;this._setActiveToOption(),this.emit(`sgds-change`),this.value&&this.emit(`sgds-select`);let e=await this._input;this._mixinSetFormValue(),this._mixinValidate(e),this._updateDisplayValue(),(this._isTouched||this.value!==``)&&(this._mixinShouldSkipSgdsValidation()||(this.invalid=!this._mixinReportValidity()))}async _handleItemSelected(e){let t=e.target,n=t.textContent?.trim()??``,r={label:n,value:t.getAttribute(`value`)??n};this.value=r.value.toString(),this.displayValue=r.label,this.hideMenu()}_handleFocus(){this.emit(`sgds-focus`)}async _handleInputBlur(e){e.preventDefault(),this.emit(`sgds-blur`)}async _mixinResetFormControl(){this.value=this.defaultValue;let e=this.menuList.filter(({value:e})=>e===this.value);this.displayValue=e.length<=0?``:e[0].label,this._mixinResetValidity(await this._input)}_renderMenu(){let e=this.menuList.map(e=>{let t=e.value===this.value;return y`
|
|
4052
4062
|
<sgds-select-option
|
|
4053
4063
|
?active=${t}
|
|
4054
4064
|
value=${e.value}
|
|
@@ -4183,7 +4193,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
4183
4193
|
</div>
|
|
4184
4194
|
</nav>
|
|
4185
4195
|
`}};E([S({type:Boolean,reflect:!0})],Q.prototype,`collapsed`,void 0),E([S({type:String,reflect:!0})],Q.prototype,`active`,void 0),E([S({type:Boolean,reflect:!0})],Q.prototype,`scrim`,void 0),E([S({type:String,reflect:!0})],Q.prototype,`variant`,void 0),E([S({type:String})],Q.prototype,`ariaLabel`,void 0),E([lm({context:Ey}),C()],Q.prototype,`_sidebarActiveGroup`,void 0),E([lm({context:Oy}),C()],Q.prototype,`_sidebarCollapsed`,void 0),E([lm({context:Dy}),C()],Q.prototype,`_sidebarActiveItem`,void 0),E([lm({context:ky}),C()],Q.prototype,`_drawerItems`,void 0),E([lm({context:Ay}),C()],Q.prototype,`_showDrawer`,void 0),E([lm({context:jy}),C()],Q.prototype,`_isOverlay`,void 0),E([T()],Q.prototype,`_defaultNodes`,void 0),E([C()],Q.prototype,`_isNarrowViewport`,void 0),E([F(`collapsed`)],Q.prototype,`_handleCollapsed`,null),E([F(`_sidebarActiveItem`)],Q.prototype,`_handleActiveItem`,null),E([F(`active`)],Q.prototype,`_handleActive`,null),x();var Py=u`:host{--sidenav-sticky-top:0rem}.sticky{height:calc(100vh - var(--sidenav-sticky-top));overflow-y:visible;position:sticky;top:var(--sidenav-sticky-top)}`;x();var Fy=class extends D{constructor(...e){super(...e),this.sticky=!1}static{this.styles=[...D.styles,Py]}get items(){return[...this.defaultNodes||[]].filter(e=>e.tagName!==void 0)}async onToggle(e){let t=e.target.tagName===`SGDS-SIDENAV-LINK`;if(e.defaultPrevented||t)return;let n=[...this.items];!n||n.length}render(){return y`
|
|
4186
|
-
<nav class=${O({sticky:this.sticky})}>
|
|
4196
|
+
<nav aria-label="Side navigation" class=${O({sticky:this.sticky})}>
|
|
4187
4197
|
<div>
|
|
4188
4198
|
<slot @click=${this.onToggle}></slot>
|
|
4189
4199
|
</div>
|
|
@@ -4258,7 +4268,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
4258
4268
|
</div>
|
|
4259
4269
|
`)}
|
|
4260
4270
|
</div>
|
|
4261
|
-
`}};E([S({type:Array})],Uy.prototype,`steps`,void 0),E([S({type:Number,reflect:!0})],Uy.prototype,`activeStep`,void 0),E([S({type:String,reflect:!0})],Uy.prototype,`orientation`,void 0),E([S({type:Boolean,reflect:!0})],Uy.prototype,`clickable`,void 0),E([S({type:Boolean,reflect:!0})],Uy.prototype,`linear`,void 0),E([k_(`activeStep`)],Uy.prototype,`defaultActiveStep`,void 0),E([T()],Uy.prototype,`_slotNodes`,void 0),E([S({type:Boolean})],Uy.prototype,`hasDefaultSlot`,void 0),E([F(`activeStep`,{waitUntilFirstUpdate:!0})],Uy.prototype,`_handleActiveStepChange`,null),E([F(`clickable`,{waitUntilFirstUpdate:!0})],Uy.prototype,`_handleClickableChange`,null),E([F(`orientation`,{waitUntilFirstUpdate:!0})],Uy.prototype,`_handleOrientationChange`,null),x();var Wy=u`:host{display:block;position:relative;z-index:var(--sgds-z-index-sticky)}nav{background-color:var(--sgds-surface-raised);border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);position:relative;width:100%}.subnav{flex-direction:column;flex-wrap:nowrap}.header-container,.subnav{align-items:flex-start;display:flex}.header-container{gap:var(--sgds-gap-md);padding:var(--sgds-padding-md) var(--sgds-padding-lg);width:100%}slot[name=header]::slotted(*){--sgds-margin-xs:var(--sgds-margin-none);flex:1 1 auto;margin-bottom:var(--sgds-margin-xs,--sgds-margin-none);padding-top:var(--sgds-padding-none)}.subnav-toggler{cursor:pointer;transition:transform .2s ease-in-out}.subnav-toggler:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.subnav:not(.collapsed) .subnav-toggler{transform:rotate(-180deg)}.subnav-nav-group{display:flex;flex:1 1 0}.subnav-nav,.subnav-nav-group{align-items:flex-start;flex-direction:column;width:100%}.subnav-nav{display:none;overflow-y:auto;transition:transform .2s ease-in-out}.subnav-nav ::slotted(*){width:100%}.subnav-actions{bottom:0;display:flex;flex-direction:column;gap:var(--sgds-gap-md);padding:var(--sgds-padding-md) var(--sgds-padding-lg);position:sticky;width:100%}.no-actions{display:none}slot[name=actions]::slotted(*){width:100%}@media screen and (max-width:1023px){.subnav.sgds-container{max-width:inherit}}@media screen and (min-width:512px){.subnav-actions{flex-direction:row}}@media screen and (min-width:768px){nav{border-bottom:var(--sgds-border-width-0)}.subnav{flex-direction:row}.subnav.collapsed{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted)}.header-container{padding:var(--sgds-padding-lg) var(--sgds-padding-2-xl)}.subnav-nav{background-color:var(--sgds-surface-raised);border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);left:0;position:absolute;top:100%}.subnav-actions{align-items:center;flex-direction:row;padding:var(--sgds-padding-sm) var(--sgds-padding-2-xl) var(--sgds-padding-sm) var(--sgds-padding-none);position:inherit}}@media screen and (min-width:1024px){nav{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);position:inherit}.subnav{flex-wrap:wrap;gap:var(--sgds-gap-xl);row-gap:var(--sgds-gap-none)}.subnav.collapsed{border-bottom:var(--sgds-border-width-0)}.header-container{flex:1;padding:var(--sgds-padding-none);width:auto}slot[name=header]::slotted(*){padding-top:var(--sgds-padding-lg);white-space:nowrap}.subnav-nav-group{align-items:center;flex:inherit;flex-direction:row;flex-wrap:wrap;gap:var(--sgds-gap-xl);justify-content:space-between;row-gap:var(--sgds-gap-none);width:auto}.subnav-nav{align-items:center;background-color:inherit;border-bottom:var(--sgds-border-width-0);display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--sgds-gap-lg);overflow-y:inherit;position:inherit;row-gap:0;transition:none;width:auto}.subnav-nav ::slotted(*){width:inherit}.subnav-toggler{display:none}.subnav-actions{padding:var(--sgds-padding-sm) var(--sgds-padding-none);width:auto}slot[name=actions]::slotted(*){width:inherit}}`;x();let Gy=[`Enter`,` `];var Ky=class extends D{constructor(...e){super(...e),this.hasActionsSlot=!1,this.isCollapsed=!1,this.isMenuOpen=!1,this.hasSlotController=new xm(this,`actions`),this._handleResize=async()=>{this.isCollapsed=window.innerWidth<dm,await this.updateComplete,this.isCollapsed||(this.isMenuOpen=!1),this._updateMobileLayout()},this._updateMobileLayout=()=>{if(this.nav&&this.headerContainer&&this.mobileActions&&this.mobileNav){if(this.isCollapsed){let{top:e}=this.nav.getBoundingClientRect(),t=this.headerContainer.clientHeight,n=this.mobileActions.clientHeight,r=window.innerWidth>=768&&window.innerWidth<1024?e+t:e+t+n;this.mobileNav.style.maxHeight=`calc(100dvh - ${r}px)`,this.style.minHeight=`${this.nav.clientHeight}px`,this.nav.style.position=`absolute`}else this.mobileNav.style.maxHeight=`none`,this.style.minHeight=`auto`,this.nav.style.position=`relative`}},this._toggleMenu=()=>{this.isMenuOpen?this.hide():(this._lockBodyScroll(),this.show()),this.toggler?.focus()}}static{this.styles=[...D.styles,Wy,
|
|
4271
|
+
`}};E([S({type:Array})],Uy.prototype,`steps`,void 0),E([S({type:Number,reflect:!0})],Uy.prototype,`activeStep`,void 0),E([S({type:String,reflect:!0})],Uy.prototype,`orientation`,void 0),E([S({type:Boolean,reflect:!0})],Uy.prototype,`clickable`,void 0),E([S({type:Boolean,reflect:!0})],Uy.prototype,`linear`,void 0),E([k_(`activeStep`)],Uy.prototype,`defaultActiveStep`,void 0),E([T()],Uy.prototype,`_slotNodes`,void 0),E([S({type:Boolean})],Uy.prototype,`hasDefaultSlot`,void 0),E([F(`activeStep`,{waitUntilFirstUpdate:!0})],Uy.prototype,`_handleActiveStepChange`,null),E([F(`clickable`,{waitUntilFirstUpdate:!0})],Uy.prototype,`_handleClickableChange`,null),E([F(`orientation`,{waitUntilFirstUpdate:!0})],Uy.prototype,`_handleOrientationChange`,null),x();var Wy=u`:host{display:block;position:relative;z-index:var(--sgds-z-index-sticky)}nav{background-color:var(--sgds-surface-raised);border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);position:relative;width:100%}.subnav{flex-direction:column;flex-wrap:nowrap}.header-container,.subnav{align-items:flex-start;display:flex}.header-container{gap:var(--sgds-gap-md);padding:var(--sgds-padding-md) var(--sgds-padding-lg);width:100%}slot[name=header]::slotted(*){--sgds-margin-xs:var(--sgds-margin-none);flex:1 1 auto;margin-bottom:var(--sgds-margin-xs,--sgds-margin-none);padding-top:var(--sgds-padding-none)}.subnav-toggler{cursor:pointer;transition:transform .2s ease-in-out}.subnav-toggler:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.subnav:not(.collapsed) .subnav-toggler{transform:rotate(-180deg)}.subnav-nav-group{display:flex;flex:1 1 0}.subnav-nav,.subnav-nav-group{align-items:flex-start;flex-direction:column;width:100%}.subnav-nav{display:none;overflow-y:auto;transition:transform .2s ease-in-out}.subnav-nav ::slotted(*){width:100%}.subnav-actions{bottom:0;display:flex;flex-direction:column;gap:var(--sgds-gap-md);padding:var(--sgds-padding-md) var(--sgds-padding-lg);position:sticky;width:100%}.no-actions{display:none}slot[name=actions]::slotted(*){width:100%}@media screen and (max-width:1023px){.subnav.sgds-container{max-width:inherit}}@media screen and (min-width:512px){.subnav-actions{flex-direction:row}}@media screen and (min-width:768px){nav{border-bottom:var(--sgds-border-width-0)}.subnav{flex-direction:row}.subnav.collapsed{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted)}.header-container{padding:var(--sgds-padding-lg) var(--sgds-padding-2-xl)}.subnav-nav{background-color:var(--sgds-surface-raised);border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);left:0;position:absolute;top:100%}.subnav-actions{align-items:center;flex-direction:row;padding:var(--sgds-padding-sm) var(--sgds-padding-2-xl) var(--sgds-padding-sm) var(--sgds-padding-none);position:inherit}}@media screen and (min-width:1024px){nav{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);position:inherit}.subnav{flex-wrap:wrap;gap:var(--sgds-gap-xl);row-gap:var(--sgds-gap-none)}.subnav.collapsed{border-bottom:var(--sgds-border-width-0)}.header-container{flex:1;padding:var(--sgds-padding-none);width:auto}slot[name=header]::slotted(*){padding-top:var(--sgds-padding-lg);white-space:nowrap}.subnav-nav-group{align-items:center;flex:inherit;flex-direction:row;flex-wrap:wrap;gap:var(--sgds-gap-xl);justify-content:space-between;row-gap:var(--sgds-gap-none);width:auto}.subnav-nav{align-items:center;background-color:inherit;border-bottom:var(--sgds-border-width-0);display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--sgds-gap-lg);overflow-y:inherit;position:inherit;row-gap:0;transition:none;width:auto}.subnav-nav ::slotted(*){width:inherit}.subnav-toggler{display:none}.subnav-actions{padding:var(--sgds-padding-sm) var(--sgds-padding-none);width:auto}slot[name=actions]::slotted(*){width:inherit}}`;x();let Gy=[`Enter`,` `];var Ky=class extends D{constructor(...e){super(...e),this.hasActionsSlot=!1,this.isCollapsed=!1,this.isMenuOpen=!1,this.hasSlotController=new xm(this,`actions`),this._handleResize=async()=>{this.isCollapsed=window.innerWidth<dm,await this.updateComplete,this.isCollapsed||(this.isMenuOpen=!1),this._updateMobileLayout()},this._updateMobileLayout=()=>{if(this.nav&&this.headerContainer&&this.mobileActions&&this.mobileNav){if(this.isCollapsed){let{top:e}=this.nav.getBoundingClientRect(),t=this.headerContainer.clientHeight,n=this.mobileActions.clientHeight,r=window.innerWidth>=768&&window.innerWidth<1024?e+t:e+t+n;this.mobileNav.style.maxHeight=`calc(100dvh - ${r}px)`,this.style.minHeight=`${this.nav.clientHeight}px`,this.nav.style.position=`absolute`}else this.mobileNav.style.maxHeight=`none`,this.style.minHeight=`auto`,this.nav.style.position=`relative`}},this._toggleMenu=()=>{this.isMenuOpen?this.hide():(this._lockBodyScroll(),this.show()),this.toggler?.focus()}}static{this.styles=[...D.styles,Wy,Rv]}static{this.dependencies={"sgds-icon":L}}connectedCallback(){super.connectedCallback(),window.addEventListener(`resize`,this._handleResize),window.addEventListener(`click`,e=>this._handleClickOutOfElement(e,this.navGroup))}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(`resize`,this._handleResize),window.removeEventListener(`click`,e=>this._handleClickOutOfElement(e,this.navGroup))}firstUpdated(e){super.firstUpdated(e),this._handleResize()}updated(){this.hasActionsSlot||=this.hasSlotController.test(`actions`)}_handleClickOutOfElement(e,t){!e.composedPath().includes(t)&&!e.composedPath().includes(this.toggler)&&this.hide()}async _onKeyboardToggle(e){Gy.includes(e.key)&&(e.preventDefault(),this._toggleMenu())}async show(){if(!this.isMenuOpen)return this.isMenuOpen=!0,P(this,`sgds-after-show`)}async hide(){if(this.isMenuOpen)return this.isMenuOpen=!1,this._unlockBodyScroll(),P(this,`sgds-after-hide`)}_lockBodyScroll(){if(typeof window>`u`)return;let e=window.scrollY;document.body.style.position=`fixed`,document.body.style.top=`-${e}px`,document.body.style.width=`100%`}_unlockBodyScroll(){if(typeof window>`u`)return;let e=parseInt(document.body.style.top||`0`)*-1;document.body.style.position=``,document.body.style.top=``,document.body.style.width=``,window.scrollTo(0,e)}async _animateToShow(){if(this.emit(`sgds-show`,{cancelable:!0}).defaultPrevented){this.isMenuOpen=!1;return}await j(this.mobileNav),this.isCollapsed&&(this.mobileNav.style.display=`flex`);let{keyframes:e,options:t}=M(this,`subnav.show`);await A(this.mobileNav,ht(e,this.mobileNav.scrollHeight),t),this.emit(`sgds-after-show`)}async _animateToHide(){if(this.emit(`sgds-hide`,{cancelable:!0}).defaultPrevented){this.isMenuOpen=!0;return}await j(this.mobileNav);let{keyframes:e,options:t}=M(this,`subnav.hide`);await A(this.mobileNav,ht(e,this.mobileNav.scrollHeight),t),this.isCollapsed&&(this.mobileNav.style.display=`none`),this.emit(`sgds-after-hide`)}async handleOpenChange(){this.isMenuOpen?this._animateToShow():this._animateToHide()}async handleCollapsedChange(){await this.updateComplete,this.mobileNav.style.display=this.isCollapsed?`none`:`flex`}render(){return y`
|
|
4262
4272
|
<nav aria-label="Sub navigation">
|
|
4263
4273
|
<div
|
|
4264
4274
|
class=${O({"sgds-container":!0,subnav:!0,collapsed:!this.isMenuOpen})}
|
|
@@ -4331,6 +4341,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
4331
4341
|
tone="fixed-light"
|
|
4332
4342
|
variant="ghost"
|
|
4333
4343
|
size="xs"
|
|
4344
|
+
ariaLabel="Previous"
|
|
4334
4345
|
@click=${this._prev}
|
|
4335
4346
|
></sgds-icon-button>
|
|
4336
4347
|
<span>${this._currentIndex+1}/${this.childCount}</span>
|
|
@@ -4339,6 +4350,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
4339
4350
|
tone="fixed-light"
|
|
4340
4351
|
variant="ghost"
|
|
4341
4352
|
size="xs"
|
|
4353
|
+
ariaLabel="Next"
|
|
4342
4354
|
@click=${this._next}
|
|
4343
4355
|
></sgds-icon-button>
|
|
4344
4356
|
</div>`:b}
|
|
@@ -4432,7 +4444,7 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
4432
4444
|
<ul class="contents">
|
|
4433
4445
|
<slot name="contents"></slot>
|
|
4434
4446
|
</ul>
|
|
4435
|
-
</div> `}};x();var bb=u`textarea{font-family:inherit;font-size:inherit;line-height:inherit;margin:0;resize:vertical}textarea.form-control-group{height:auto;min-height:var(--sgds-dimension-136);overflow:auto;padding:var(--sgds-form-padding-y) var(--sgds-form-padding-x)}.textarea-resize-none{resize:none}.textarea-resize-vertical{resize:vertical}.textarea-resize-auto{height:auto;overflow-y:hidden;resize:none}.textarea-info-container{display:flex;justify-content:space-between}.word-count{margin-left:auto}`;x();var $=class extends j_(V){constructor(...e){super(...e),this.value=``,this.spellcheck=!1,this.rows=4,this.placeholder=`Placeholder`,this.invalidFeedback=``,this.autofocus=!1,this.readonly=!1,this.resize=`vertical`,this.defaultValue=``,this.hasFeedback=!1,this.required=!1,this.noValidate=!1,this.hintText=``,this._isTouched=!1}static{this.styles=[...V.styles,
|
|
4447
|
+
</div> `}};x();var bb=u`textarea{font-family:inherit;font-size:inherit;line-height:inherit;margin:0;resize:vertical}textarea.form-control-group{height:auto;min-height:var(--sgds-dimension-136);overflow:auto;padding:var(--sgds-form-padding-y) var(--sgds-form-padding-x)}.textarea-resize-none{resize:none}.textarea-resize-vertical{resize:vertical}.textarea-resize-auto{height:auto;overflow-y:hidden;resize:none}.textarea-info-container{display:flex;justify-content:space-between}.word-count{margin-left:auto}`;x();var $=class extends j_(V){constructor(...e){super(...e),this.value=``,this.spellcheck=!1,this.rows=4,this.placeholder=`Placeholder`,this.invalidFeedback=``,this.autofocus=!1,this.readonly=!1,this.resize=`vertical`,this.defaultValue=``,this.hasFeedback=!1,this.required=!1,this.noValidate=!1,this.hintText=``,this._isTouched=!1}static{this.styles=[...V.styles,F_,bb]}focus(e){this.textarea.focus(e)}blur(){this.textarea.blur()}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}select(){this.textarea.select()}_handleInvalid(e){e.preventDefault(),this.invalid=!0}_handleChange(e){this.value=this.input.value,this.emit(`sgds-change`),super._mixinHandleChange(e)}_handleInputChange(e){this.value=this.input.value,this.emit(`sgds-input`),super._mixinHandleInputChange(e)}_handleFocus(){this.emit(`sgds-focus`)}_handleBlur(){let e=this.emit(`sgds-blur`,{cancelable:!0});this._mixinShouldSkipSgdsValidation()||e.defaultPrevented||(this.setInvalid(!this._mixinCheckValidity()),this._isTouched=!0)}_handleRowsChange(){this._setTextareaHeight()}_setTextareaHeight(){this.resize===`auto`?(this.textarea.style.height=`auto`,this.textarea.style.height=`${this.textarea.scrollHeight}px`):this.textarea.style.height=void 0}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&this.setInvalid(!this._mixinCheckValidity())}_handleDisabledChange(){this.setInvalid(!1)}_handleValueChange(){this.updateComplete.then(()=>this._setTextareaHeight())}_renderHintText(){let e=I` <div id="${this._controlId}Help" class="form-text">${this.hintText}</div> `;return this.hintText&&e}_wordCount(){return I`
|
|
4436
4448
|
<div
|
|
4437
4449
|
class="form-text word-count ${O({"invalid-feedback":this.invalid&&this.hasFeedback})}"
|
|
4438
4450
|
>
|
|
@@ -4532,5 +4544,5 @@ let H_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
4532
4544
|
>
|
|
4533
4545
|
<slot></slot>
|
|
4534
4546
|
</div>
|
|
4535
|
-
`}};E([S({type:String,reflect:!0})],Eb.prototype,`position`,void 0),e.SgdsAccordion=ut,e.SgdsAccordionItem=xt,e.SgdsAlert=Qp,e.SgdsAlertLink=nm,e.SgdsAppnav=Em,e.SgdsAppnavProfile=$g,e.SgdsBadge=r_,e.SgdsBreadcrumb=l_,e.SgdsBreadcrumbItem=p_,e.SgdsButton=B,e.SgdsCard=C_,e.SgdsCheckbox=
|
|
4547
|
+
`}};E([S({type:String,reflect:!0})],Eb.prototype,`position`,void 0),e.SgdsAccordion=ut,e.SgdsAccordionItem=xt,e.SgdsAlert=Qp,e.SgdsAlertLink=nm,e.SgdsAppnav=Em,e.SgdsAppnavProfile=$g,e.SgdsBadge=r_,e.SgdsBreadcrumb=l_,e.SgdsBreadcrumbItem=p_,e.SgdsButton=B,e.SgdsCard=C_,e.SgdsCheckbox=H,e.SgdsCheckboxGroup=U,e.SgdsCloseButton=kt,e.SgdsComboBox=G,e.SgdsComboBoxOption=B_,e.SgdsDataTable=X_,e.SgdsDataTableCell=K_,e.SgdsDataTableHead=K,e.SgdsDataTableRow=q_,e.SgdsDatepicker=Y,e.SgdsDescriptionList=Tv,e.SgdsDescriptionListGroup=Dv,e.SgdsDivider=kv,e.SgdsDrawer=Pv,e.SgdsDropdown=Xg,e.SgdsDropdownItem=o_,e.SgdsFileUpload=X,e.SgdsFooter=zv,e.SgdsFooterItem=Vv,e.SgdsIcon=L,e.SgdsIconButton=ym,e.SgdsIconCard=Uv,e.SgdsIconList=Gv,e.SgdsImageCard=qv,e.SgdsInput=J,e.SgdsLink=d_,e.SgdsMainnav=Zv,e.SgdsMainnavDropdown=ey,e.SgdsMainnavItem=ny,e.SgdsMainnavProfile=ry,e.SgdsMasthead=oy,e.SgdsModal=fy,e.SgdsOverflowMenu=s_,e.SgdsPagination=G_,e.SgdsProgressBar=hy,e.SgdsQuantityToggle=_y,e.SgdsRadio=yy,e.SgdsRadioGroup=xy,e.SgdsSelect=wy,e.SgdsSelectOption=Cy,e.SgdsSidebar=Q,e.SgdsSidenav=Fy,e.SgdsSidenavItem=Ly,e.SgdsSidenavLink=zy,e.SgdsSkeleton=Y_,e.SgdsSpinner=_m,e.SgdsStep=Vy,e.SgdsStepper=Uy,e.SgdsSubnav=Ky,e.SgdsSubnavItem=Jy,e.SgdsSwitch=Xy,e.SgdsSystemBanner=eb,e.SgdsTab=rb,e.SgdsTabGroup=ab,e.SgdsTabPanel=cb,e.SgdsTable=db,e.SgdsTableCell=pb,e.SgdsTableHead=hb,e.SgdsTableOfContents=yb,e.SgdsTableRow=_b,e.SgdsTextarea=$,e.SgdsThumbnailCard=Sb,e.SgdsToast=wb,e.SgdsToastContainer=Eb,e.SgdsTooltip=n_});
|
|
4536
4548
|
//# sourceMappingURL=index.umd.min.js.map
|