@govtechsg/sgds-web-component 3.21.2-rc.5 → 3.22.1
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/card.js +1 -1
- package/base/select-element.d.ts +2 -0
- package/base/select-element.js +5 -0
- package/base/select-element.js.map +1 -1
- package/components/Breadcrumb/index.umd.min.js +1 -1
- package/components/Breadcrumb/index.umd.min.js.map +1 -1
- package/components/Card/index.umd.min.js +1 -1
- package/components/Card/index.umd.min.js.map +1 -1
- package/components/ComboBox/index.umd.min.js +4 -2
- package/components/ComboBox/index.umd.min.js.map +1 -1
- package/components/ComboBox/sgds-combo-box.js +2 -0
- package/components/ComboBox/sgds-combo-box.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/Footer/index.umd.min.js +1 -1
- package/components/Footer/index.umd.min.js.map +1 -1
- package/components/IconCard/index.umd.min.js +1 -1
- package/components/IconCard/index.umd.min.js.map +1 -1
- package/components/ImageCard/index.umd.min.js +1 -1
- package/components/ImageCard/index.umd.min.js.map +1 -1
- package/components/Input/index.umd.min.js +3 -2
- package/components/Input/index.umd.min.js.map +1 -1
- package/components/Input/sgds-input.d.ts +2 -0
- package/components/Input/sgds-input.js +6 -0
- package/components/Input/sgds-input.js.map +1 -1
- package/components/Link/index.umd.min.js +1 -1
- package/components/Link/index.umd.min.js.map +1 -1
- package/components/Link/link.js +1 -1
- package/components/QuantityToggle/index.umd.min.js +3 -2
- package/components/QuantityToggle/index.umd.min.js.map +1 -1
- package/components/Select/index.umd.min.js +2 -2
- package/components/Select/index.umd.min.js.map +1 -1
- package/components/Subnav/index.umd.min.js +1 -1
- package/components/Subnav/index.umd.min.js.map +1 -1
- package/components/ThumbnailCard/index.umd.min.js +1 -1
- package/components/ThumbnailCard/index.umd.min.js.map +1 -1
- package/components/index.umd.min.js +10 -7
- package/components/index.umd.min.js.map +1 -1
- package/css/fouc.css +1 -1
- package/css/grid.css +4 -30
- package/css/grid.js +1 -1
- package/custom-elements.json +237 -141
- package/index.umd.min.js +10 -7
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/base/card.cjs.js +1 -1
- package/react/base/card.js +1 -1
- package/react/base/select-element.cjs.js +5 -0
- package/react/base/select-element.cjs.js.map +1 -1
- package/react/base/select-element.js +5 -0
- package/react/base/select-element.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.cjs.js +2 -0
- package/react/components/ComboBox/sgds-combo-box.cjs.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.js +2 -0
- package/react/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/react/components/Input/sgds-input.cjs.js +6 -0
- package/react/components/Input/sgds-input.cjs.js.map +1 -1
- package/react/components/Input/sgds-input.js +6 -0
- package/react/components/Input/sgds-input.js.map +1 -1
- package/react/components/Link/link.cjs.js +1 -1
- package/react/components/Link/link.js +1 -1
- package/react/css/grid.cjs.js +1 -1
- package/react/css/grid.js +1 -1
- package/react/index.cjs.js +6 -6
- package/react/index.d.ts +1 -1
- package/react/index.js +1 -1
- package/themes/root.css +0 -2
- package/types/react.d.ts +17 -11
|
@@ -2300,7 +2300,7 @@ class extends Le{constructor(e){if(super(e),e.type!==Se&&e.type!==Be&&e.type!==k
|
|
|
2300
2300
|
clip-rule="evenodd"
|
|
2301
2301
|
/>
|
|
2302
2302
|
</svg>
|
|
2303
|
-
`};var Ct,Mt,yt=r`: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)}`;class bt extends Ge{constructor(){super(...arguments),this.size="lg"}_getIconByName(e){if(!e)return;const t=xt[e];if(t)return t;console.warn(`Icon not found: ${e}`)}updated(){var e;const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("svg");t&&(this.ariaLabel?(t.removeAttribute("aria-hidden"),t.setAttribute("aria-label",this.ariaLabel)):(t.removeAttribute("aria-label"),t.setAttribute("aria-hidden","true")))}render(){const e=this._getIconByName(this.name);return e||le}}bt.styles=[...Ge.styles,yt],e([Ve({type:String,reflect:!0})],bt.prototype,"name",void 0),e([Ve({type:String,reflect:!0})],bt.prototype,"size",void 0),e([Ve({type:String})],bt.prototype,"ariaLabel",void 0);class _t extends(Qe(Ye)){constructor(){super(...arguments),this.type="text",this.placeholder="placeholder",this.autofocus=!1,this.readonly=!1,this.defaultValue="",this.valid=!1,this.loading=!1,this.required=!1,this.noValidate=!1,this.value="",this._isTouched=!1,this._showPassword=!1}focus(e){this.input.focus(e)}blur(){this.input.blur()}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}setValidity(e,t,l){return this._mixinSetValidity(e,t,l)}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_handleFocus(){this.emit("sgds-focus")}_handleBlur(){const 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(){const e="both"===this.hasFeedback||"style"===this.hasFeedback,t="both"===this.hasFeedback||"text"===this.hasFeedback,l=[this.hintText?`${this._controlId}Help`:"",this.invalid&&t?`${this._controlId}-invalid`:""].filter(Boolean).join(" ")||void 0;return Oe`
|
|
2303
|
+
`};var Ct,Mt,yt=r`: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)}`;class bt extends Ge{constructor(){super(...arguments),this.size="lg"}_getIconByName(e){if(!e)return;const t=xt[e];if(t)return t;console.warn(`Icon not found: ${e}`)}updated(){var e;const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("svg");t&&(this.ariaLabel?(t.removeAttribute("aria-hidden"),t.setAttribute("aria-label",this.ariaLabel)):(t.removeAttribute("aria-label"),t.setAttribute("aria-hidden","true")))}render(){const e=this._getIconByName(this.name);return e||le}}bt.styles=[...Ge.styles,yt],e([Ve({type:String,reflect:!0})],bt.prototype,"name",void 0),e([Ve({type:String,reflect:!0})],bt.prototype,"size",void 0),e([Ve({type:String})],bt.prototype,"ariaLabel",void 0);class _t extends(Qe(Ye)){constructor(){super(...arguments),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}focus(e){this.input.focus(e)}blur(){this.input.blur()}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}setValidity(e,t,l){return this._mixinSetValidity(e,t,l)}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_handleFocus(){this.emit("sgds-focus")}_handleBlur(){const 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(){const e="both"===this.hasFeedback||"style"===this.hasFeedback,t="both"===this.hasFeedback||"text"===this.hasFeedback,l=[this.hintText?`${this._controlId}Help`:"",this.invalid&&t?`${this._controlId}-invalid`:""].filter(Boolean).join(" ")||void 0;return Oe`
|
|
2304
2304
|
<div
|
|
2305
2305
|
class="form-control-group ${Pe({disabled:this.disabled,readonly:this.readonly,"is-invalid":this.invalid&&e})}"
|
|
2306
2306
|
@click=${this._handleClick}
|
|
@@ -2331,6 +2331,7 @@ class extends Le{constructor(e){if(super(e),e.type!==Se&&e.type!==Be&&e.type!==k
|
|
|
2331
2331
|
@focus=${this._handleFocus}
|
|
2332
2332
|
@blur=${this._handleBlur}
|
|
2333
2333
|
aria-describedby=${Te(l)}
|
|
2334
|
+
.autocomplete=${this.autocomplete}
|
|
2334
2335
|
/>
|
|
2335
2336
|
${"password"===this.type?this._renderPasswordToggle():le}
|
|
2336
2337
|
${this.suffix?Oe`<span class="form-control-suffix">${this.suffix}</span>`:le}
|
|
@@ -2367,5 +2368,5 @@ class extends Le{constructor(e){if(super(e),e.type!==Se&&e.type!==Be&&e.type!==k
|
|
|
2367
2368
|
</div>
|
|
2368
2369
|
${this._renderFeedback()}
|
|
2369
2370
|
</div>
|
|
2370
|
-
`}}_t.styles=[...Ye.styles,Xe,We,at],_t.dependencies={"sgds-spinner":it,"sgds-icon":bt},e([Ve({reflect:!0})],_t.prototype,"type",void 0),e([Ve({type:String})],_t.prototype,"prefix",void 0),e([Ve({type:String})],_t.prototype,"suffix",void 0),e([Ve({type:Number,reflect:!0})],_t.prototype,"minlength",void 0),e([Ve({type:Number,reflect:!0})],_t.prototype,"maxlength",void 0),e([Ve()],_t.prototype,"min",void 0),e([Ve()],_t.prototype,"max",void 0),e([Ve({type:String,reflect:!0})],_t.prototype,"placeholder",void 0),e([Ve({type:String})],_t.prototype,"pattern",void 0),e([Ve({type:Boolean,reflect:!0})],_t.prototype,"autofocus",void 0),e([Ve({type:Boolean,reflect:!0})],_t.prototype,"readonly",void 0),e([Ve()],_t.prototype,"step",void 0),e([Ve({type:String,reflect:!0})],_t.prototype,"hasFeedback",void 0),e([Ve({type:String,reflect:!0})],_t.prototype,"invalidFeedback",void 0),e([((e="value")=>(t,l)=>{const i=t.constructor,a=i.prototype.attributeChangedCallback;i.prototype.attributeChangedCallback=function(t,o,r){var c;const s=i.getPropertyOptions(e);if(t===("string"==typeof s.attribute?s.attribute:e).toLowerCase()){const t=s.converter||C,i=("function"==typeof t?t:null!==(c=null==t?void 0:t.fromAttribute)&&void 0!==c?c:C.fromAttribute)(r,s.type);this[e]!==i&&(this[l]=i)}a.call(this,t,o,r)}})()],_t.prototype,"defaultValue",void 0),e([Ve({type:Boolean,reflect:!0})],_t.prototype,"valid",void 0),e([Ve({type:Boolean,reflect:!0})],_t.prototype,"loading",void 0),e([Ve({type:Boolean,reflect:!0})],_t.prototype,"required",void 0),e([Ve({type:Boolean,reflect:!0})],_t.prototype,"noValidate",void 0),e([Ve({reflect:!0})],_t.prototype,"value",void 0),e([He()],_t.prototype,"_isTouched",void 0),e([He()],_t.prototype,"_showPassword",void 0),e([et("_isTouched",{waitUntilFirstUpdate:!0})],_t.prototype,"_handleIsTouched",null),e([et("disabled",{waitUntilFirstUpdate:!0})],_t.prototype,"_handleDisabledChange",null),Ct="sgds-input",Mt=_t,customElements.get(Ct)||customElements.define(Ct,Mt)});
|
|
2371
|
+
`}}_t.styles=[...Ye.styles,Xe,We,at],_t.dependencies={"sgds-spinner":it,"sgds-icon":bt},e([Ve({reflect:!0})],_t.prototype,"type",void 0),e([Ve({type:String})],_t.prototype,"prefix",void 0),e([Ve({type:String})],_t.prototype,"suffix",void 0),e([Ve({type:Number,reflect:!0})],_t.prototype,"minlength",void 0),e([Ve({type:Number,reflect:!0})],_t.prototype,"maxlength",void 0),e([Ve()],_t.prototype,"min",void 0),e([Ve()],_t.prototype,"max",void 0),e([Ve({type:String,reflect:!0})],_t.prototype,"placeholder",void 0),e([Ve({type:String})],_t.prototype,"pattern",void 0),e([Ve({type:Boolean,reflect:!0})],_t.prototype,"autofocus",void 0),e([Ve({type:Boolean,reflect:!0})],_t.prototype,"readonly",void 0),e([Ve({type:String,reflect:!0})],_t.prototype,"autocomplete",void 0),e([Ve()],_t.prototype,"step",void 0),e([Ve({type:String,reflect:!0})],_t.prototype,"hasFeedback",void 0),e([Ve({type:String,reflect:!0})],_t.prototype,"invalidFeedback",void 0),e([((e="value")=>(t,l)=>{const i=t.constructor,a=i.prototype.attributeChangedCallback;i.prototype.attributeChangedCallback=function(t,o,r){var c;const s=i.getPropertyOptions(e);if(t===("string"==typeof s.attribute?s.attribute:e).toLowerCase()){const t=s.converter||C,i=("function"==typeof t?t:null!==(c=null==t?void 0:t.fromAttribute)&&void 0!==c?c:C.fromAttribute)(r,s.type);this[e]!==i&&(this[l]=i)}a.call(this,t,o,r)}})()],_t.prototype,"defaultValue",void 0),e([Ve({type:Boolean,reflect:!0})],_t.prototype,"valid",void 0),e([Ve({type:Boolean,reflect:!0})],_t.prototype,"loading",void 0),e([Ve({type:Boolean,reflect:!0})],_t.prototype,"required",void 0),e([Ve({type:Boolean,reflect:!0})],_t.prototype,"noValidate",void 0),e([Ve({reflect:!0})],_t.prototype,"value",void 0),e([He()],_t.prototype,"_isTouched",void 0),e([He()],_t.prototype,"_showPassword",void 0),e([et("_isTouched",{waitUntilFirstUpdate:!0})],_t.prototype,"_handleIsTouched",null),e([et("disabled",{waitUntilFirstUpdate:!0})],_t.prototype,"_handleDisabledChange",null),Ct="sgds-input",Mt=_t,customElements.get(Ct)||customElements.define(Ct,Mt)});
|
|
2371
2372
|
//# sourceMappingURL=index.umd.min.js.map
|