@cas-smartdesign/lit-input 7.4.0 → 7.4.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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
document.getElementById("random-generator-button").addEventListener("click",t=>{t.preventDefault();const e=t.target.parentElement;e.value=(Math.random()+1).toString(36).substring(7)});document.getElementById("clear-button").addEventListener("click",t=>{t.preventDefault();const e=t.target.parentElement;e.value=""});
|
|
@@ -71,7 +71,7 @@ var window;(window||={})["@cas-smartdesign/lit-input"]=(()=>{var Z=Object.define
|
|
|
71
71
|
</sd-field-validation-message>
|
|
72
72
|
`}
|
|
73
73
|
</div>
|
|
74
|
-
`}updated(i){super.updated(i),this._needsAutocompletedCheck&&!this.autocompleted&&setTimeout(()=>{try{this.autocompleted=this.autocompleted||!!this.shadowRoot.querySelector(":-webkit-autofill")}catch{}},0),this.rows>1&&((i.has("min")||i.has("max")||i.has("pattern"))&&console.warn("min, max & pattern attributes are not supported with multiple rows configuration."),this.type!="text"&&console.warn(`type: ${this.type} is not supported with multiple rows configuration.`))}update(i){if(super.update(i),i.has("validationMessage")&&(this.validationMessage?this._internals?.setValidity({customError:!0},this.validationMessage):this._internals?.setValidity(this.inputElement.validity,this.inputElement.validationMessage)),this._initialized&&i.has("rows"))throw Error("rows attribute cannot be changed after the input is attached to the DOM")}fireValueChange(i){this.dispatchEvent(new CustomEvent(`${i?"immediate-":""}value-change`,{detail:{value:this.value}})),this.setFormValue(this.value)
|
|
74
|
+
`}updated(i){super.updated(i),this._needsAutocompletedCheck&&!this.autocompleted&&setTimeout(()=>{try{this.autocompleted=this.autocompleted||!!this.shadowRoot.querySelector(":-webkit-autofill")}catch{}},0),this.rows>1&&((i.has("min")||i.has("max")||i.has("pattern"))&&console.warn("min, max & pattern attributes are not supported with multiple rows configuration."),this.type!="text"&&console.warn(`type: ${this.type} is not supported with multiple rows configuration.`))}update(i){if(super.update(i),i.has("validationMessage")&&(this.validationMessage?this._internals?.setValidity({customError:!0},this.validationMessage):this._internals?.setValidity(this.inputElement.validity,this.inputElement.validationMessage)),this._initialized&&i.has("rows"))throw Error("rows attribute cannot be changed after the input is attached to the DOM")}fireValueChange(i){this.dispatchEvent(new CustomEvent(`${i?"immediate-":""}value-change`,{detail:{value:this.value}})),this.setFormValue(this.value)}updateFormValidity(){if(this.validationMessage==null){this._internals.setValidity(this.inputElement.validity,this.inputElement.validationMessage);let i=this.shadowRoot.querySelector("sd-field-validation-message");this.requestUpdate("validationMessage",i==null?null:i.message)}}shouldFloat(){return this.alwaysFloatLabel||this.currentText||this.placeholder||this.autocompleted||this.type==="date"}setFormValue(i){this._internals?.setFormValue(i),this.updateFormValidity()}formResetCallback(){this.value=this._initialValue}formDisabledCallback(i){this.effectiveDisabled=i||this.hasAttribute("disabled")}formAssociatedCallback(i){this._needsAutocompletedCheck=!0}formStateRestoreCallback(i,t){typeof i=="string"&&(this.value=i)}},$.ID=ee,$.DEFAULT_MAX_LENGTH=524288,$.formAssociated=!0,$.shadowRootOptions={...g.shadowRootOptions,delegatesFocus:St},$);u([h({type:String,reflect:!0})],c.prototype,"label");u([h({type:String,attribute:!0})],c.prototype,"validationMessage");u([h({type:String,attribute:!0})],c.prototype,"validationIconSrc");u([h({type:B,attribute:!0,reflect:!0})],c.prototype,"validationLevel");u([h({type:String,hasChanged(i,t){return t!=null&&t!=i}})],c.prototype,"currentText");u([h({type:Boolean,attribute:!0})],c.prototype,"alwaysFloatLabel");u([h({type:Boolean,attribute:!0})],c.prototype,"autocompleted");u([h({type:Number,attribute:!0})],c.prototype,"rows");u([h({type:Boolean,reflect:!0,attribute:"effective-disabled"})],c.prototype,"effectiveDisabled");u([h({type:Boolean,reflect:!0,attribute:"extended-prefix"})],c.prototype,"extendedPrefix");u([h({type:String,reflect:!0})],c.prototype,"type");u([h({type:String,reflect:!0})],c.prototype,"placeholder");u([h({type:String,reflect:!0})],c.prototype,"sdAriaLabel");u([h({type:Number,reflect:!0})],c.prototype,"maxlength");u([h({type:Boolean,reflect:!0})],c.prototype,"readonly");u([h({type:Boolean,reflect:!0})],c.prototype,"required");u([h({type:String,reflect:!0})],c.prototype,"name");u([h({type:Boolean,reflect:!0})],c.prototype,"inactive");u([h({type:String,attribute:!0})],c.prototype,"autocomplete");u([h({type:String,attribute:!0})],c.prototype,"min");u([h({type:String,attribute:!0})],c.prototype,"max");u([h({type:String,attribute:!0})],c.prototype,"pattern");var X=c;customElements.get(X.ID)||customElements.define(X.ID,X);return Lt(se);})();
|
|
75
75
|
/*! Bundled license information:
|
|
76
76
|
|
|
77
77
|
@lit/reactive-element/css-tag.js:
|