@govtechsg/sgds-web-component 3.30.1-rc.4 → 3.30.1-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Datepicker/index.umd.min.js +3 -3
- package/components/Datepicker/index.umd.min.js.map +1 -1
- package/components/Datepicker/sgds-datepicker.d.ts +1 -1
- package/components/Datepicker/sgds-datepicker.js +5 -1
- package/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/components/Input/index.umd.min.js +2 -2
- package/components/Input/index.umd.min.js.map +1 -1
- package/components/Input/sgds-input.d.ts +1 -0
- package/components/Input/sgds-input.js +7 -0
- package/components/Input/sgds-input.js.map +1 -1
- package/components/QuantityToggle/index.umd.min.js +230 -230
- package/components/QuantityToggle/index.umd.min.js.map +1 -1
- package/components/QuantityToggle/sgds-quantity-toggle.d.ts +1 -0
- package/components/QuantityToggle/sgds-quantity-toggle.js +9 -0
- package/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
- package/components/Radio/index.umd.min.js +1 -1
- package/components/Radio/index.umd.min.js.map +1 -1
- package/components/Radio/sgds-radio-group.d.ts +1 -1
- package/components/Radio/sgds-radio-group.js +5 -1
- package/components/Radio/sgds-radio-group.js.map +1 -1
- package/components/Textarea/index.umd.min.js +1 -1
- package/components/Textarea/index.umd.min.js.map +1 -1
- package/components/Textarea/sgds-textarea.d.ts +1 -1
- package/components/Textarea/sgds-textarea.js +6 -2
- package/components/Textarea/sgds-textarea.js.map +1 -1
- package/components/index.umd.min.js +7 -7
- package/components/index.umd.min.js.map +1 -1
- package/custom-elements.json +11 -1
- package/index.umd.min.js +7 -7
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/components/Datepicker/sgds-datepicker.cjs.js +5 -1
- package/react/components/Datepicker/sgds-datepicker.cjs.js.map +1 -1
- package/react/components/Datepicker/sgds-datepicker.js +5 -1
- package/react/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/react/components/Input/sgds-input.cjs.js +7 -0
- package/react/components/Input/sgds-input.cjs.js.map +1 -1
- package/react/components/Input/sgds-input.js +7 -0
- package/react/components/Input/sgds-input.js.map +1 -1
- package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js +9 -0
- package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js.map +1 -1
- package/react/components/QuantityToggle/sgds-quantity-toggle.js +9 -0
- package/react/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
- package/react/components/Radio/sgds-radio-group.cjs.js +5 -1
- package/react/components/Radio/sgds-radio-group.cjs.js.map +1 -1
- package/react/components/Radio/sgds-radio-group.js +5 -1
- package/react/components/Radio/sgds-radio-group.js.map +1 -1
- package/react/components/Textarea/sgds-textarea.cjs.js +6 -2
- package/react/components/Textarea/sgds-textarea.cjs.js.map +1 -1
- package/react/components/Textarea/sgds-textarea.js +6 -2
- package/react/components/Textarea/sgds-textarea.js.map +1 -1
- package/react/utils/ssr-nonce-patch.js +1 -2
package/custom-elements.json
CHANGED
|
@@ -14768,6 +14768,11 @@
|
|
|
14768
14768
|
"name": "_handleDisabledChange",
|
|
14769
14769
|
"type": {}
|
|
14770
14770
|
},
|
|
14771
|
+
{
|
|
14772
|
+
"kind": "method",
|
|
14773
|
+
"name": "_handleValueChange",
|
|
14774
|
+
"type": {}
|
|
14775
|
+
},
|
|
14771
14776
|
{
|
|
14772
14777
|
"kind": "method",
|
|
14773
14778
|
"name": "_renderInput",
|
|
@@ -18424,6 +18429,11 @@
|
|
|
18424
18429
|
"readonly": true,
|
|
18425
18430
|
"type": {}
|
|
18426
18431
|
},
|
|
18432
|
+
{
|
|
18433
|
+
"kind": "method",
|
|
18434
|
+
"name": "_handleValuePropertyChange",
|
|
18435
|
+
"type": {}
|
|
18436
|
+
},
|
|
18427
18437
|
{
|
|
18428
18438
|
"kind": "method",
|
|
18429
18439
|
"name": "_handleValueChange",
|
|
@@ -32036,7 +32046,7 @@
|
|
|
32036
32046
|
"package": {
|
|
32037
32047
|
"name": "@govtechsg/sgds-web-component",
|
|
32038
32048
|
"description": "",
|
|
32039
|
-
"version": "3.30.1-rc.
|
|
32049
|
+
"version": "3.30.1-rc.6",
|
|
32040
32050
|
"author": "GovTechSG",
|
|
32041
32051
|
"license": "MIT"
|
|
32042
32052
|
}
|
package/index.umd.min.js
CHANGED
|
@@ -2897,7 +2897,7 @@ let y_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
2897
2897
|
>
|
|
2898
2898
|
</sgds-icon-button>
|
|
2899
2899
|
</div>
|
|
2900
|
-
`}};w([b({attribute:!1})],G_.prototype,`displayDate`,void 0),w([b({attribute:!1})],G_.prototype,`focusedDate`,void 0),w([b({attribute:!1})],G_.prototype,`selectedDate`,void 0),w([b()],G_.prototype,`view`,void 0),w([b()],G_.prototype,`focusedTabIndex`,void 0),w([N(`focusedTabIndex`,{waitUntilFirstUpdate:!0})],G_.prototype,`_handleFocusedTabIndexChange`,null);let K_=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`];var q_=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()}};y();var J_=l`:host{--input-border-radius:var(--sgds-form-border-radius);--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-outline-focus)}.form-control-row{align-items:center;display:flex;gap:var(--sgds-gap-sm)}`;y();var G=class extends l_(B){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=[...B.styles,o_,h_,J_]}static{this.dependencies={"sgds-spinner":S_,"sgds-icon":I}}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 F`
|
|
2900
|
+
`}};w([b({attribute:!1})],G_.prototype,`displayDate`,void 0),w([b({attribute:!1})],G_.prototype,`focusedDate`,void 0),w([b({attribute:!1})],G_.prototype,`selectedDate`,void 0),w([b()],G_.prototype,`view`,void 0),w([b()],G_.prototype,`focusedTabIndex`,void 0),w([N(`focusedTabIndex`,{waitUntilFirstUpdate:!0})],G_.prototype,`_handleFocusedTabIndexChange`,null);let K_=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`];var q_=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()}};y();var J_=l`:host{--input-border-radius:var(--sgds-form-border-radius);--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-outline-focus)}.form-control-row{align-items:center;display:flex;gap:var(--sgds-gap-sm)}`;y();var G=class extends l_(B){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=[...B.styles,o_,h_,J_]}static{this.dependencies={"sgds-spinner":S_,"sgds-icon":I}}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)}async _handleValueChange(){this._mixinSetFormValue(),await this.updateComplete,!this._mixinShouldSkipSgdsValidation()&&this._mixinValidate(this.input)}_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 F`
|
|
2901
2901
|
<div
|
|
2902
2902
|
class="form-control-group ${E({disabled:this.disabled,readonly:this.readonly,"is-invalid":this.invalid&&e})}"
|
|
2903
2903
|
@click=${this._handleClick}
|
|
@@ -2966,7 +2966,7 @@ let y_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
2966
2966
|
</div>
|
|
2967
2967
|
${this._renderFeedback()}
|
|
2968
2968
|
</div>
|
|
2969
|
-
`}};w([b({reflect:!0})],G.prototype,`type`,void 0),w([b({type:String})],G.prototype,`prefix`,void 0),w([b({type:String})],G.prototype,`suffix`,void 0),w([b({type:Number,reflect:!0})],G.prototype,`minlength`,void 0),w([b({type:Number,reflect:!0})],G.prototype,`maxlength`,void 0),w([b()],G.prototype,`min`,void 0),w([b()],G.prototype,`max`,void 0),w([b({type:String,reflect:!0})],G.prototype,`placeholder`,void 0),w([b({type:String})],G.prototype,`pattern`,void 0),w([b({type:Boolean,reflect:!0})],G.prototype,`autofocus`,void 0),w([b({type:Boolean,reflect:!0})],G.prototype,`readonly`,void 0),w([b({type:String,reflect:!0})],G.prototype,`autocomplete`,void 0),w([b()],G.prototype,`step`,void 0),w([b({type:String,reflect:!0})],G.prototype,`hasFeedback`,void 0),w([b({type:String,reflect:!0})],G.prototype,`invalidFeedback`,void 0),w([s_()],G.prototype,`defaultValue`,void 0),w([b({type:Boolean,reflect:!0})],G.prototype,`valid`,void 0),w([b({type:Boolean,reflect:!0})],G.prototype,`loading`,void 0),w([b({type:Boolean,reflect:!0})],G.prototype,`required`,void 0),w([b({type:Boolean,reflect:!0})],G.prototype,`noValidate`,void 0),w([b({reflect:!0})],G.prototype,`value`,void 0),w([x()],G.prototype,`_isTouched`,void 0),w([x()],G.prototype,`_showPassword`,void 0),w([N(`_isTouched`,{waitUntilFirstUpdate:!0})],G.prototype,`_handleIsTouched`,null),w([N(`disabled`,{waitUntilFirstUpdate:!0})],G.prototype,`_handleDisabledChange`,null),y();var Y_=l`.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}`;y();var X_=class extends G{static{this.styles=[...G.styles,Y_]}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=>W(N_(e,P_[this.dateFormat].fnsPattern))),t=e.filter(e=>!j_(e)||O_(e,new Date(0,0,1))||O_(e,W(new Date(this.minDate)))||D_(e,W(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=>W(N_(e,P_[this.dateFormat].fnsPattern))),t=e.filter(e=>!j_(e)||O_(e,new Date(0,0,1))||O_(e,W(new Date(this.minDate)))||D_(e,W(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`?P_[e].imPattern:P_[e].imRangePattern;this.mask=new q_(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 _`
|
|
2969
|
+
`}};w([b({reflect:!0})],G.prototype,`type`,void 0),w([b({type:String})],G.prototype,`prefix`,void 0),w([b({type:String})],G.prototype,`suffix`,void 0),w([b({type:Number,reflect:!0})],G.prototype,`minlength`,void 0),w([b({type:Number,reflect:!0})],G.prototype,`maxlength`,void 0),w([b()],G.prototype,`min`,void 0),w([b()],G.prototype,`max`,void 0),w([b({type:String,reflect:!0})],G.prototype,`placeholder`,void 0),w([b({type:String})],G.prototype,`pattern`,void 0),w([b({type:Boolean,reflect:!0})],G.prototype,`autofocus`,void 0),w([b({type:Boolean,reflect:!0})],G.prototype,`readonly`,void 0),w([b({type:String,reflect:!0})],G.prototype,`autocomplete`,void 0),w([b()],G.prototype,`step`,void 0),w([b({type:String,reflect:!0})],G.prototype,`hasFeedback`,void 0),w([b({type:String,reflect:!0})],G.prototype,`invalidFeedback`,void 0),w([s_()],G.prototype,`defaultValue`,void 0),w([b({type:Boolean,reflect:!0})],G.prototype,`valid`,void 0),w([b({type:Boolean,reflect:!0})],G.prototype,`loading`,void 0),w([b({type:Boolean,reflect:!0})],G.prototype,`required`,void 0),w([b({type:Boolean,reflect:!0})],G.prototype,`noValidate`,void 0),w([b({reflect:!0})],G.prototype,`value`,void 0),w([x()],G.prototype,`_isTouched`,void 0),w([x()],G.prototype,`_showPassword`,void 0),w([N(`_isTouched`,{waitUntilFirstUpdate:!0})],G.prototype,`_handleIsTouched`,null),w([N(`disabled`,{waitUntilFirstUpdate:!0})],G.prototype,`_handleDisabledChange`,null),w([N(`value`,{waitUntilFirstUpdate:!0})],G.prototype,`_handleValueChange`,null),y();var Y_=l`.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}`;y();var X_=class extends G{static{this.styles=[...G.styles,Y_]}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=>W(N_(e,P_[this.dateFormat].fnsPattern))),t=e.filter(e=>!j_(e)||O_(e,new Date(0,0,1))||O_(e,W(new Date(this.minDate)))||D_(e,W(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=>W(N_(e,P_[this.dateFormat].fnsPattern))),t=e.filter(e=>!j_(e)||O_(e,new Date(0,0,1))||O_(e,W(new Date(this.minDate)))||D_(e,W(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`?P_[e].imPattern:P_[e].imRangePattern;this.mask=new q_(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 _`
|
|
2970
2970
|
<div
|
|
2971
2971
|
class="form-control-container ${E({disabled:this.disabled})}"
|
|
2972
2972
|
>
|
|
@@ -2977,7 +2977,7 @@ let y_=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i
|
|
|
2977
2977
|
</div>
|
|
2978
2978
|
${this._renderFeedback()}
|
|
2979
2979
|
</div>
|
|
2980
|
-
`}};w([b({type:String})],X_.prototype,`minDate`,void 0),w([b({type:String})],X_.prototype,`maxDate`,void 0),w([b({type:String,reflect:!0})],X_.prototype,`mode`,void 0),w([ot(`input`)],X_.prototype,`shadowInput`,void 0),y();var Z_=l`: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);border-radius:var(--sgds-overlay-border-radius);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) 0 0 var(--sgds-form-border-radius);flex:1;margin-right:0}sgds-icon-button{--btn-border-radius:0 var(--sgds-form-border-radius) var(--sgds-form-border-radius) 0}.m-width-160{min-width:var(--sgds-dimension-160)}`;y();var K=class extends l_(jg){static{this.styles=[...jg.styles,Ng,Z_]}static{this.dependencies={"sgds-datepicker-input":X_,"sgds-datepicker-calendar":V_,"sgds-datepicker-header":G_,"sgds-button":L,"sgds-icon-button":U_}}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=>T_(e,P_[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=>W(N_(e,P_[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 _`
|
|
2980
|
+
`}};w([b({type:String})],X_.prototype,`minDate`,void 0),w([b({type:String})],X_.prototype,`maxDate`,void 0),w([b({type:String,reflect:!0})],X_.prototype,`mode`,void 0),w([ot(`input`)],X_.prototype,`shadowInput`,void 0),y();var Z_=l`: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);border-radius:var(--sgds-overlay-border-radius);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) 0 0 var(--sgds-form-border-radius);flex:1;margin-right:0}sgds-icon-button{--btn-border-radius:0 var(--sgds-form-border-radius) var(--sgds-form-border-radius) 0}.m-width-160{min-width:var(--sgds-dimension-160)}`;y();var K=class extends l_(jg){static{this.styles=[...jg.styles,Ng,Z_]}static{this.dependencies={"sgds-datepicker-input":X_,"sgds-datepicker-calendar":V_,"sgds-datepicker-header":G_,"sgds-button":L,"sgds-icon-button":U_}}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=>T_(e,P_[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=>W(N_(e,P_[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)}async _handleValueChange(){this._mixinSetFormValue(),this.emit(`sgds-change-date`),await this.updateComplete,!this._mixinShouldSkipSgdsValidation()&&this._mixinValidate(this.input)}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 _`
|
|
2981
2981
|
<div class="datepicker-container m-width-160">
|
|
2982
2982
|
<sgds-datepicker-input
|
|
2983
2983
|
.value=${r_(this.value)}
|
|
@@ -3721,7 +3721,7 @@ super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTa
|
|
|
3721
3721
|
</div>
|
|
3722
3722
|
${this.label?_`<span class="label">${this.label}</span>`:v}
|
|
3723
3723
|
</div>
|
|
3724
|
-
`}};w([b({type:String,reflect:!0})],ey.prototype,`variant`,void 0),w([b({type:Number,reflect:!0})],ey.prototype,`value`,void 0),w([b({type:Number,reflect:!0})],ey.prototype,`ariamin`,void 0),w([b({type:Number,reflect:!0})],ey.prototype,`ariamax`,void 0),w([b({type:String,reflect:!0})],ey.prototype,`ariaLabel`,void 0),w([b({type:String,reflect:!0})],ey.prototype,`arialabel`,void 0),w([b({type:String,reflect:!0})],ey.prototype,`label`,void 0),P(`sgds-progress-bar`,ey),y();var ty=l`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) 0 0 var(--sgds-form-border-radius)}.input-group>sgds-icon-button.plus-btn{--btn-border-radius:0 var(--sgds-form-border-radius) var(--sgds-form-border-radius) 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}`,ny=class extends l_(B){constructor(...e){super(...e),this.value=0,this.step=1,this.noValidate=!1,this.readonly=!1,this.defaultValue=0}static{this.styles=[...B.styles,h_,Hv,o_,ty]}static{this.dependencies={"sgds-input":G,"sgds-icon-button":U_}}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?F` <div class="invalid-feedback-container">
|
|
3724
|
+
`}};w([b({type:String,reflect:!0})],ey.prototype,`variant`,void 0),w([b({type:Number,reflect:!0})],ey.prototype,`value`,void 0),w([b({type:Number,reflect:!0})],ey.prototype,`ariamin`,void 0),w([b({type:Number,reflect:!0})],ey.prototype,`ariamax`,void 0),w([b({type:String,reflect:!0})],ey.prototype,`ariaLabel`,void 0),w([b({type:String,reflect:!0})],ey.prototype,`arialabel`,void 0),w([b({type:String,reflect:!0})],ey.prototype,`label`,void 0),P(`sgds-progress-bar`,ey),y();var ty=l`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) 0 0 var(--sgds-form-border-radius)}.input-group>sgds-icon-button.plus-btn{--btn-border-radius:0 var(--sgds-form-border-radius) var(--sgds-form-border-radius) 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}`,ny=class extends l_(B){constructor(...e){super(...e),this.value=0,this.step=1,this.noValidate=!1,this.readonly=!1,this.defaultValue=0}static{this.styles=[...B.styles,h_,Hv,o_,ty]}static{this.dependencies={"sgds-input":G,"sgds-icon-button":U_}}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}async _handleValuePropertyChange(){if(this._mixinSetFormValue(),await this.updateComplete,this._mixinShouldSkipSgdsValidation())return;let e=await this._sgdsInput;this._mixinValidate(e.input)}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?F` <div class="invalid-feedback-container">
|
|
3725
3725
|
<slot name="invalidIcon">
|
|
3726
3726
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
3727
3727
|
<path
|
|
@@ -3789,7 +3789,7 @@ super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTa
|
|
|
3789
3789
|
<div id="${this._controlId}-announcer" aria-live="assertive" class="visually-hidden">${this.value}</div>
|
|
3790
3790
|
${this._renderFeedback()}
|
|
3791
3791
|
</div>
|
|
3792
|
-
`}};w([S(`sgds-icon-button[ariaLabel^='increase by']`)],ny.prototype,`plusBtn`,void 0),w([S(`sgds-icon-button[ariaLabel^='decrease by']`)],ny.prototype,`minusBtn`,void 0),w([b({type:Number,reflect:!0})],ny.prototype,`value`,void 0),w([b({type:Number})],ny.prototype,`step`,void 0),w([b({type:Number})],ny.prototype,`min`,void 0),w([b({type:Number})],ny.prototype,`max`,void 0),w([b({type:String,reflect:!0})],ny.prototype,`hasFeedback`,void 0),w([b({type:String,reflect:!0})],ny.prototype,`invalidFeedback`,void 0),w([b({type:Boolean,reflect:!0})],ny.prototype,`noValidate`,void 0),w([b({type:Boolean,reflect:!0})],ny.prototype,`readonly`,void 0),w([s_()],ny.prototype,`defaultValue`,void 0),w([ot(`sgds-input`)],ny.prototype,`_sgdsInput`,void 0),P(`sgds-quantity-toggle`,ny),y();var ry=l`:host{outline:0}.form-check-input[type=radio]{border-radius:50%}.form-check-input[checked]{--sgds-radio-bg-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" fill="none" viewBox="0 0 8 8"><path fill="%23fff" d="M0 4a4 4 0 1 1 8 0 4 4 0 0 1-8 0"/></svg>')}.form-check-input[checked].is-invalid{background-color:var(--sgds-form-danger-surface-default)}`;y();var iy=class extends T{constructor(...e){super(...e),this.checked=!1,this.disabled=!1,this.invalid=!1,this.autofocus=!1,this.radioId=Ag(`radio`)}static{this.styles=[...T.styles,__,m_,ry]}connectedCallback(){super.connectedCallback(),this.setInitialAttributes(),this.addEventListeners()}handleCheckedChange(){this.checked&&this.autofocus&&this.input?.focus(),this.setAttribute(`tabindex`,this.checked?`0`:`-1`)}handleDisabledChange(){this.setAttribute(`aria-disabled`,this.disabled?`true`:`false`)}handleBlur(){this.emit(`sgds-blur`)}handleClick(){this.disabled||(this.checked=!0)}handleFocus(){this.emit(`sgds-focus`)}addEventListeners(){this.addEventListener(`blur`,()=>this.handleBlur()),this.addEventListener(`click`,()=>this.handleClick()),this.addEventListener(`focus`,()=>this.handleFocus())}setInitialAttributes(){this.setAttribute(`tabindex`,`-1`),this.setAttribute(`aria-disabled`,this.disabled?`true`:`false`)}render(){return _`
|
|
3792
|
+
`}};w([S(`sgds-icon-button[ariaLabel^='increase by']`)],ny.prototype,`plusBtn`,void 0),w([S(`sgds-icon-button[ariaLabel^='decrease by']`)],ny.prototype,`minusBtn`,void 0),w([b({type:Number,reflect:!0})],ny.prototype,`value`,void 0),w([b({type:Number})],ny.prototype,`step`,void 0),w([b({type:Number})],ny.prototype,`min`,void 0),w([b({type:Number})],ny.prototype,`max`,void 0),w([b({type:String,reflect:!0})],ny.prototype,`hasFeedback`,void 0),w([b({type:String,reflect:!0})],ny.prototype,`invalidFeedback`,void 0),w([b({type:Boolean,reflect:!0})],ny.prototype,`noValidate`,void 0),w([b({type:Boolean,reflect:!0})],ny.prototype,`readonly`,void 0),w([s_()],ny.prototype,`defaultValue`,void 0),w([ot(`sgds-input`)],ny.prototype,`_sgdsInput`,void 0),w([N(`value`,{waitUntilFirstUpdate:!0})],ny.prototype,`_handleValuePropertyChange`,null),P(`sgds-quantity-toggle`,ny),y();var ry=l`:host{outline:0}.form-check-input[type=radio]{border-radius:50%}.form-check-input[checked]{--sgds-radio-bg-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" fill="none" viewBox="0 0 8 8"><path fill="%23fff" d="M0 4a4 4 0 1 1 8 0 4 4 0 0 1-8 0"/></svg>')}.form-check-input[checked].is-invalid{background-color:var(--sgds-form-danger-surface-default)}`;y();var iy=class extends T{constructor(...e){super(...e),this.checked=!1,this.disabled=!1,this.invalid=!1,this.autofocus=!1,this.radioId=Ag(`radio`)}static{this.styles=[...T.styles,__,m_,ry]}connectedCallback(){super.connectedCallback(),this.setInitialAttributes(),this.addEventListeners()}handleCheckedChange(){this.checked&&this.autofocus&&this.input?.focus(),this.setAttribute(`tabindex`,this.checked?`0`:`-1`)}handleDisabledChange(){this.setAttribute(`aria-disabled`,this.disabled?`true`:`false`)}handleBlur(){this.emit(`sgds-blur`)}handleClick(){this.disabled||(this.checked=!0)}handleFocus(){this.emit(`sgds-focus`)}addEventListeners(){this.addEventListener(`blur`,()=>this.handleBlur()),this.addEventListener(`click`,()=>this.handleClick()),this.addEventListener(`focus`,()=>this.handleFocus())}setInitialAttributes(){this.setAttribute(`tabindex`,`-1`),this.setAttribute(`aria-disabled`,this.disabled?`true`:`false`)}render(){return _`
|
|
3793
3793
|
<div class="form-check">
|
|
3794
3794
|
<input
|
|
3795
3795
|
class=${E({"form-check-input":!0,"is-invalid":this.invalid})}
|
|
@@ -3806,7 +3806,7 @@ super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTa
|
|
|
3806
3806
|
<slot></slot>
|
|
3807
3807
|
</label>
|
|
3808
3808
|
</div>
|
|
3809
|
-
`}};w([b({type:Boolean,reflect:!0})],iy.prototype,`checked`,void 0),w([b()],iy.prototype,`value`,void 0),w([b({type:Boolean,reflect:!0})],iy.prototype,`disabled`,void 0),w([b({type:Boolean,reflect:!0})],iy.prototype,`invalid`,void 0),w([b({type:Boolean,reflect:!1})],iy.prototype,`autofocus`,void 0),w([S(`input`)],iy.prototype,`input`,void 0),w([N(`checked`)],iy.prototype,`handleCheckedChange`,null),w([N(`disabled`,{waitUntilFirstUpdate:!0})],iy.prototype,`handleDisabledChange`,null),y();var ay=l`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)}.radio-group-validation-input{display:none}.radio-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}:host([disabled]) .label-hint-container{cursor:not-allowed;opacity:var(--sgds-opacity-40)}`;y();var X=class extends l_(B){constructor(...e){super(...e),this.defaultValue=``,this.value=``,this.invalidFeedback=``,this.hasFeedback=!1,this.required=!1,this.noValidate=!1,this.autofocus=!1,this._isTouched=!1}static{this.styles=[...B.styles,ay]}_handleValueChange(){this._updateCheckedRadio()}_handleInvalidChange(){this._radios.forEach(e=>e.invalid=this.invalid)}_mixinResetFormControl(){this.value=this.input.value=this.defaultValue,this._updateInputValue(`reset`),this._mixinResetValidity(this.input)}connectedCallback(){super.connectedCallback(),this.defaultValue=this.value,this.addEventListener(`sgds-blur`,()=>{this._isTouched=!0})}firstUpdated(e){super.firstUpdated(e);let t=this._radios;t.forEach((e,n)=>{if(t.length>1)switch(n){case 0:e.setAttribute(`first-of-type`,``);break;case t.length-1:e.setAttribute(`last-of-type`,``);break;default:e.setAttribute(`nth-of-type`,``)}}),this.value&&this._updateInputValue(`change`)}_handleRadioClick(e){e.preventDefault();let t=e.target;t.disabled||(this.value=t.value,this.emit(`sgds-change`,{detail:{value:this.value}}),this._updateInputValue(),this._radios.forEach(e=>e.checked=e===t))}_updateInputValue(e=`change`){this.input.value=this.value,this.input.dispatchEvent(new InputEvent(e))}_handleKeyDown(e){if(![`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,` `].includes(e.key))return;let t=this._radios.filter(e=>!e.disabled),n=t.find(e=>e.checked)??t[0],r=e.key===` `?0:[`ArrowUp`,`ArrowLeft`].includes(e.key)?-1:1,i=t.indexOf(n)+r;i<0&&(i=t.length-1),i>t.length-1&&(i=0),this._radios.forEach(e=>{e.checked=!1,e.tabIndex=-1}),this.value=t[i].value,this.emit(`sgds-change`,{detail:{value:this.value}}),this._updateInputValue(),t[i].checked=!0,t[i].tabIndex=0,e.preventDefault()}_handleSlotChange(){let e=this._radios;e.forEach(e=>(e.autofocus=this.autofocus,e.checked=e.value===this.value,e)),this._disabledChildRadios(),e.some(e=>e.checked)||e[0]&&(e[0].tabIndex=0)}_updateCheckedRadio(){this._radios.forEach(e=>e.checked=e.value===this.value)}_renderHintText(){let e=_` <div id="${this._controlId}Help" class="form-text">${this.hintText}</div> `;return this.hintText&&e}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&(this.invalid=!this.input.checkValidity())}_handleDisabledChange(){this.setInvalid(!1),this._disabledChildRadios()}_disabledChildRadios(){this.disabled&&this._radios.forEach(e=>e.disabled=this.disabled)}render(){let e=_`
|
|
3809
|
+
`}};w([b({type:Boolean,reflect:!0})],iy.prototype,`checked`,void 0),w([b()],iy.prototype,`value`,void 0),w([b({type:Boolean,reflect:!0})],iy.prototype,`disabled`,void 0),w([b({type:Boolean,reflect:!0})],iy.prototype,`invalid`,void 0),w([b({type:Boolean,reflect:!1})],iy.prototype,`autofocus`,void 0),w([S(`input`)],iy.prototype,`input`,void 0),w([N(`checked`)],iy.prototype,`handleCheckedChange`,null),w([N(`disabled`,{waitUntilFirstUpdate:!0})],iy.prototype,`handleDisabledChange`,null),y();var ay=l`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)}.radio-group-validation-input{display:none}.radio-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}:host([disabled]) .label-hint-container{cursor:not-allowed;opacity:var(--sgds-opacity-40)}`;y();var X=class extends l_(B){constructor(...e){super(...e),this.defaultValue=``,this.value=``,this.invalidFeedback=``,this.hasFeedback=!1,this.required=!1,this.noValidate=!1,this.autofocus=!1,this._isTouched=!1}static{this.styles=[...B.styles,ay]}async _handleValueChange(){this._updateCheckedRadio(),this._mixinSetFormValue(),await this.updateComplete,!this._mixinShouldSkipSgdsValidation()&&this._mixinValidate(this.input)}_handleInvalidChange(){this._radios.forEach(e=>e.invalid=this.invalid)}_mixinResetFormControl(){this.value=this.input.value=this.defaultValue,this._updateInputValue(`reset`),this._mixinResetValidity(this.input)}connectedCallback(){super.connectedCallback(),this.defaultValue=this.value,this.addEventListener(`sgds-blur`,()=>{this._isTouched=!0})}firstUpdated(e){super.firstUpdated(e);let t=this._radios;t.forEach((e,n)=>{if(t.length>1)switch(n){case 0:e.setAttribute(`first-of-type`,``);break;case t.length-1:e.setAttribute(`last-of-type`,``);break;default:e.setAttribute(`nth-of-type`,``)}}),this.value&&this._updateInputValue(`change`)}_handleRadioClick(e){e.preventDefault();let t=e.target;t.disabled||(this.value=t.value,this.emit(`sgds-change`,{detail:{value:this.value}}),this._updateInputValue(),this._radios.forEach(e=>e.checked=e===t))}_updateInputValue(e=`change`){this.input.value=this.value,this.input.dispatchEvent(new InputEvent(e))}_handleKeyDown(e){if(![`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,` `].includes(e.key))return;let t=this._radios.filter(e=>!e.disabled),n=t.find(e=>e.checked)??t[0],r=e.key===` `?0:[`ArrowUp`,`ArrowLeft`].includes(e.key)?-1:1,i=t.indexOf(n)+r;i<0&&(i=t.length-1),i>t.length-1&&(i=0),this._radios.forEach(e=>{e.checked=!1,e.tabIndex=-1}),this.value=t[i].value,this.emit(`sgds-change`,{detail:{value:this.value}}),this._updateInputValue(),t[i].checked=!0,t[i].tabIndex=0,e.preventDefault()}_handleSlotChange(){let e=this._radios;e.forEach(e=>(e.autofocus=this.autofocus,e.checked=e.value===this.value,e)),this._disabledChildRadios(),e.some(e=>e.checked)||e[0]&&(e[0].tabIndex=0)}_updateCheckedRadio(){this._radios.forEach(e=>e.checked=e.value===this.value)}_renderHintText(){let e=_` <div id="${this._controlId}Help" class="form-text">${this.hintText}</div> `;return this.hintText&&e}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&(this.invalid=!this.input.checkValidity())}_handleDisabledChange(){this.setInvalid(!1),this._disabledChildRadios()}_disabledChildRadios(){this.disabled&&this._radios.forEach(e=>e.disabled=this.disabled)}render(){let e=_`
|
|
3810
3810
|
<slot
|
|
3811
3811
|
class="radio-container"
|
|
3812
3812
|
@click=${this._handleRadioClick}
|
|
@@ -4096,7 +4096,7 @@ super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTa
|
|
|
4096
4096
|
class=${E({"table-head":!0,"header-background":this._headerBackground})}
|
|
4097
4097
|
>
|
|
4098
4098
|
<slot></slot>
|
|
4099
|
-
</div>`}};w([Tv({context:Iy,subscribe:!0}),x()],zy.prototype,`_headerBackground`,void 0),w([N(`_headerBackground`)],zy.prototype,`_handleHeaderBackground`,null),y();var By=l`:host{display:table-row;width:100%}:host([tableBorder]:last-of-type) .table-row::slotted(*){border-bottom:0}`;y();var Vy=class extends T{constructor(...e){super(...e),this.tableBorder=!1}static{this.styles=[...T.styles,By]}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`row`)}render(){return _`<slot class="table-row"></slot>`}};w([Tv({context:Fy,subscribe:!0}),b({type:Boolean,reflect:!0})],Vy.prototype,`tableBorder`,void 0),y();var Hy=l`:host{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);display:table-cell;vertical-align:middle}.table-cell{align-items:center;display:flex;min-height:var(--sgds-dimension-56);padding:var(--sgds-padding-sm) var(--sgds-padding-md)}`;y();var Uy=class extends T{static{this.styles=[...T.styles,Hy]}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`cell`)}render(){return _`<div class="table-cell"><slot></slot></div>`}};P(`sgds-table`,Ly),P(`sgds-table-head`,zy),P(`sgds-table-row`,Vy),P(`sgds-table-cell`,Uy),y();var Wy=l`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}`;y();var Z=class extends l_(B){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=[...B.styles,o_,Wy]}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.
|
|
4099
|
+
</div>`}};w([Tv({context:Iy,subscribe:!0}),x()],zy.prototype,`_headerBackground`,void 0),w([N(`_headerBackground`)],zy.prototype,`_handleHeaderBackground`,null),y();var By=l`:host{display:table-row;width:100%}:host([tableBorder]:last-of-type) .table-row::slotted(*){border-bottom:0}`;y();var Vy=class extends T{constructor(...e){super(...e),this.tableBorder=!1}static{this.styles=[...T.styles,By]}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`row`)}render(){return _`<slot class="table-row"></slot>`}};w([Tv({context:Fy,subscribe:!0}),b({type:Boolean,reflect:!0})],Vy.prototype,`tableBorder`,void 0),y();var Hy=l`:host{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);display:table-cell;vertical-align:middle}.table-cell{align-items:center;display:flex;min-height:var(--sgds-dimension-56);padding:var(--sgds-padding-sm) var(--sgds-padding-md)}`;y();var Uy=class extends T{static{this.styles=[...T.styles,Hy]}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`cell`)}render(){return _`<div class="table-cell"><slot></slot></div>`}};P(`sgds-table`,Ly),P(`sgds-table-head`,zy),P(`sgds-table-row`,Vy),P(`sgds-table-cell`,Uy),y();var Wy=l`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}`;y();var Z=class extends l_(B){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=[...B.styles,o_,Wy]}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)}async _handleValueChange(){this._mixinSetFormValue(),await this.updateComplete,this._setTextareaHeight(),!this._mixinShouldSkipSgdsValidation()&&this._mixinValidate(this.input)}_renderHintText(){let e=F` <div id="${this._controlId}Help" class="form-text">${this.hintText}</div> `;return this.hintText&&e}_wordCount(){return F`
|
|
4100
4100
|
<div
|
|
4101
4101
|
class="form-text word-count ${E({"invalid-feedback":this.invalid&&this.hasFeedback})}"
|
|
4102
4102
|
>
|