@cas-smartdesign/lit-input 7.4.1 → 7.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/docs/doc.mjs
CHANGED
|
@@ -468,7 +468,7 @@ setupValidation("suggestion", ValidationLevel.Suggest);
|
|
|
468
468
|
</sd-field-validation-message>
|
|
469
469
|
`}
|
|
470
470
|
</div>
|
|
471
|
-
`}updated(e){super.updated(e),this._needsAutocompletedCheck&&!this.autocompleted&&setTimeout(()=>{try{this.autocompleted=this.autocompleted||!!this.shadowRoot.querySelector(":-webkit-autofill")}catch{}},0),this.rows>1&&((e.has("min")||e.has("max")||e.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(e){if(super.update(e),e.has("validationMessage")&&(this.validationMessage?this._internals?.setValidity({customError:!0},this.validationMessage):this._internals?.setValidity(this.inputElement.validity,this.inputElement.validationMessage)),this._initialized&&e.has("rows"))throw Error("rows attribute cannot be changed after the input is attached to the DOM")}fireValueChange(e){this.dispatchEvent(new CustomEvent(`${e?"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);const e=this.shadowRoot.querySelector("sd-field-validation-message");this.requestUpdate("validationMessage",e==null?null:e.message)}}shouldFloat(){return this.alwaysFloatLabel||this.currentText||this.placeholder||this.autocompleted||this.type==="date"}setFormValue(e){this._internals?.setFormValue(e),this.updateFormValidity()}formResetCallback(){this.value=this._initialValue}formDisabledCallback(e){this.effectiveDisabled=e||this.hasAttribute("disabled")}formAssociatedCallback(e){this._needsAutocompletedCheck=!0}formStateRestoreCallback(e,n){typeof e=="string"&&(this.value=e)}},de.ID=Vr,de.DEFAULT_MAX_LENGTH=524288,de.formAssociated=!0,de.shadowRootOptions={...Me.shadowRootOptions,delegatesFocus:ii},de);Q([Z({type:String,reflect:!0})],X.prototype,"label");Q([Z({type:String,attribute:!0})],X.prototype,"validationMessage");Q([Z({type:String,attribute:!0})],X.prototype,"validationIconSrc");Q([Z({type:gt,attribute:!0,reflect:!0})],X.prototype,"validationLevel");Q([Z({type:String,hasChanged(i,e){return e!=null&&e!=i}})],X.prototype,"currentText");Q([Z({type:Boolean,attribute:!0})],X.prototype,"alwaysFloatLabel");Q([Z({type:Boolean,attribute:!0})],X.prototype,"autocompleted");Q([Z({type:Number,attribute:!0})],X.prototype,"rows");Q([Z({type:Boolean,reflect:!0,attribute:"effective-disabled"})],X.prototype,"effectiveDisabled");Q([Z({type:Boolean,reflect:!0,attribute:"extended-prefix"})],X.prototype,"extendedPrefix");Q([Z({type:String,reflect:!0})],X.prototype,"type");Q([Z({type:String,reflect:!0})],X.prototype,"placeholder");Q([Z({type:String,reflect:!0})],X.prototype,"sdAriaLabel");Q([Z({type:Number,reflect:!0})],X.prototype,"maxlength");Q([Z({type:Boolean,reflect:!0})],X.prototype,"readonly");Q([Z({type:Boolean,reflect:!0})],X.prototype,"required");Q([Z({type:String,reflect:!0})],X.prototype,"name");Q([Z({type:Boolean,reflect:!0})],X.prototype,"inactive");Q([Z({type:String,attribute:!0})],X.prototype,"autocomplete");Q([Z({type:String,attribute:!0})],X.prototype,"min");Q([Z({type:String,attribute:!0})],X.prototype,"max");Q([Z({type:String,attribute:!0})],X.prototype,"pattern");let Dt=X;customElements.get(Dt.ID)||customElements.define(Dt.ID,Dt);function Ui(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Zr(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var e=i.default;if(typeof e=="function"){var n=function r(){var t=!1;try{t=this instanceof r}catch{}return t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(i).forEach(function(r){var t=Object.getOwnPropertyDescriptor(i,r);Object.defineProperty(n,r,t.get?t:{enumerable:!0,get:function(){return i[r]}})}),n}var ut={exports:{}},si;function Jr(){if(si)return ut.exports;si=1;var i=String,e=function(){return{isColorSupported:!1,reset:i,bold:i,dim:i,italic:i,underline:i,inverse:i,hidden:i,strikethrough:i,black:i,red:i,green:i,yellow:i,blue:i,magenta:i,cyan:i,white:i,gray:i,bgBlack:i,bgRed:i,bgGreen:i,bgYellow:i,bgBlue:i,bgMagenta:i,bgCyan:i,bgWhite:i,blackBright:i,redBright:i,greenBright:i,yellowBright:i,blueBright:i,magentaBright:i,cyanBright:i,whiteBright:i,bgBlackBright:i,bgRedBright:i,bgGreenBright:i,bgYellowBright:i,bgBlueBright:i,bgMagentaBright:i,bgCyanBright:i,bgWhiteBright:i}};return ut.exports=e(),ut.exports.createColors=e,ut.exports}const Kr={},Xr=Object.freeze(Object.defineProperty({__proto__:null,default:Kr},Symbol.toStringTag,{value:"Module"})),fe=Zr(Xr);var zt,ri;function En(){if(ri)return zt;ri=1;let i=Jr(),e=fe;class n extends Error{constructor(t,u,a,f,b,d){super(t),this.name="CssSyntaxError",this.reason=t,b&&(this.file=b),f&&(this.source=f),d&&(this.plugin=d),typeof u<"u"&&typeof a<"u"&&(typeof u=="number"?(this.line=u,this.column=a):(this.line=u.line,this.column=u.column,this.endLine=a.line,this.endColumn=a.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let u=this.source;t==null&&(t=i.isColorSupported);let a=l=>l,f=l=>l,b=l=>l;if(t){let{bold:l,gray:p,red:m}=i.createColors(!0);f=g=>l(m(g)),a=g=>p(g),e&&(b=g=>e(g))}let d=u.split(/\r?\n/),s=Math.max(this.line-3,0),c=Math.min(this.line+2,d.length),o=String(c).length;return d.slice(s,c).map((l,p)=>{let m=s+1+p,g=" "+(" "+m).slice(-o)+" | ";if(m===this.line){if(l.length>160){let E=20,w=Math.max(0,this.column-E),v=Math.max(this.column+E,this.endColumn+E),y=l.slice(w,v),S=a(g.replace(/\d/g," "))+l.slice(0,Math.min(this.column-1,E-1)).replace(/[^\t]/g," ");return f(">")+a(g)+b(y)+`
|
|
471
|
+
`}updated(e){super.updated(e),this._needsAutocompletedCheck&&!this.autocompleted&&setTimeout(()=>{try{this.autocompleted=this.autocompleted||!!this.shadowRoot.querySelector(":-webkit-autofill")}catch{}},0),this.rows>1&&((e.has("min")||e.has("max")||e.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(e){if(super.update(e),e.has("validationMessage")&&(this.validationMessage?this._internals?.setValidity({customError:!0},this.validationMessage):this._internals?.setValidity(this.inputElement.validity,this.inputElement.validationMessage)),this._initialized&&e.has("rows"))throw Error("rows attribute cannot be changed after the input is attached to the DOM")}fireValueChange(e){this.dispatchEvent(new CustomEvent(`${e?"immediate-":""}value-change`,{detail:{value:this.value}})),this.setFormValue(this.value)}updateFormValidity(){if(this.validationMessage==null&&this.inputElement!=null){this._internals.setValidity(this.inputElement.validity,this.inputElement.validationMessage);const e=this.shadowRoot.querySelector("sd-field-validation-message");this.requestUpdate("validationMessage",e==null?null:e.message)}}shouldFloat(){return this.alwaysFloatLabel||this.currentText||this.placeholder||this.autocompleted||this.type==="date"}setFormValue(e){this._internals?.setFormValue(e),this.updateFormValidity()}formResetCallback(){this.value=this._initialValue}formDisabledCallback(e){this.effectiveDisabled=e||this.hasAttribute("disabled")}formAssociatedCallback(e){this._needsAutocompletedCheck=!0}formStateRestoreCallback(e,n){typeof e=="string"&&(this.value=e)}},de.ID=Vr,de.DEFAULT_MAX_LENGTH=524288,de.formAssociated=!0,de.shadowRootOptions={...Me.shadowRootOptions,delegatesFocus:ii},de);Q([Z({type:String,reflect:!0})],X.prototype,"label");Q([Z({type:String,attribute:!0})],X.prototype,"validationMessage");Q([Z({type:String,attribute:!0})],X.prototype,"validationIconSrc");Q([Z({type:gt,attribute:!0,reflect:!0})],X.prototype,"validationLevel");Q([Z({type:String,hasChanged(i,e){return e!=null&&e!=i}})],X.prototype,"currentText");Q([Z({type:Boolean,attribute:!0})],X.prototype,"alwaysFloatLabel");Q([Z({type:Boolean,attribute:!0})],X.prototype,"autocompleted");Q([Z({type:Number,attribute:!0})],X.prototype,"rows");Q([Z({type:Boolean,reflect:!0,attribute:"effective-disabled"})],X.prototype,"effectiveDisabled");Q([Z({type:Boolean,reflect:!0,attribute:"extended-prefix"})],X.prototype,"extendedPrefix");Q([Z({type:String,reflect:!0})],X.prototype,"type");Q([Z({type:String,reflect:!0})],X.prototype,"placeholder");Q([Z({type:String,reflect:!0})],X.prototype,"sdAriaLabel");Q([Z({type:Number,reflect:!0})],X.prototype,"maxlength");Q([Z({type:Boolean,reflect:!0})],X.prototype,"readonly");Q([Z({type:Boolean,reflect:!0})],X.prototype,"required");Q([Z({type:String,reflect:!0})],X.prototype,"name");Q([Z({type:Boolean,reflect:!0})],X.prototype,"inactive");Q([Z({type:String,attribute:!0})],X.prototype,"autocomplete");Q([Z({type:String,attribute:!0})],X.prototype,"min");Q([Z({type:String,attribute:!0})],X.prototype,"max");Q([Z({type:String,attribute:!0})],X.prototype,"pattern");let Dt=X;customElements.get(Dt.ID)||customElements.define(Dt.ID,Dt);function Ui(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Zr(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var e=i.default;if(typeof e=="function"){var n=function r(){var t=!1;try{t=this instanceof r}catch{}return t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(i).forEach(function(r){var t=Object.getOwnPropertyDescriptor(i,r);Object.defineProperty(n,r,t.get?t:{enumerable:!0,get:function(){return i[r]}})}),n}var ut={exports:{}},si;function Jr(){if(si)return ut.exports;si=1;var i=String,e=function(){return{isColorSupported:!1,reset:i,bold:i,dim:i,italic:i,underline:i,inverse:i,hidden:i,strikethrough:i,black:i,red:i,green:i,yellow:i,blue:i,magenta:i,cyan:i,white:i,gray:i,bgBlack:i,bgRed:i,bgGreen:i,bgYellow:i,bgBlue:i,bgMagenta:i,bgCyan:i,bgWhite:i,blackBright:i,redBright:i,greenBright:i,yellowBright:i,blueBright:i,magentaBright:i,cyanBright:i,whiteBright:i,bgBlackBright:i,bgRedBright:i,bgGreenBright:i,bgYellowBright:i,bgBlueBright:i,bgMagentaBright:i,bgCyanBright:i,bgWhiteBright:i}};return ut.exports=e(),ut.exports.createColors=e,ut.exports}const Kr={},Xr=Object.freeze(Object.defineProperty({__proto__:null,default:Kr},Symbol.toStringTag,{value:"Module"})),fe=Zr(Xr);var zt,ri;function En(){if(ri)return zt;ri=1;let i=Jr(),e=fe;class n extends Error{constructor(t,u,a,f,b,d){super(t),this.name="CssSyntaxError",this.reason=t,b&&(this.file=b),f&&(this.source=f),d&&(this.plugin=d),typeof u<"u"&&typeof a<"u"&&(typeof u=="number"?(this.line=u,this.column=a):(this.line=u.line,this.column=u.column,this.endLine=a.line,this.endColumn=a.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let u=this.source;t==null&&(t=i.isColorSupported);let a=l=>l,f=l=>l,b=l=>l;if(t){let{bold:l,gray:p,red:m}=i.createColors(!0);f=g=>l(m(g)),a=g=>p(g),e&&(b=g=>e(g))}let d=u.split(/\r?\n/),s=Math.max(this.line-3,0),c=Math.min(this.line+2,d.length),o=String(c).length;return d.slice(s,c).map((l,p)=>{let m=s+1+p,g=" "+(" "+m).slice(-o)+" | ";if(m===this.line){if(l.length>160){let E=20,w=Math.max(0,this.column-E),v=Math.max(this.column+E,this.endColumn+E),y=l.slice(w,v),S=a(g.replace(/\d/g," "))+l.slice(0,Math.min(this.column-1,E-1)).replace(/[^\t]/g," ");return f(">")+a(g)+b(y)+`
|
|
472
472
|
`+S+f("^")}let _=a(g.replace(/\d/g," "))+l.slice(0,this.column-1).replace(/[^\t]/g," ");return f(">")+a(g)+b(l)+`
|
|
473
473
|
`+_+f("^")}return" "+a(g)+b(l)}).join(`
|
|
474
474
|
`)}toString(){let t=this.showSourceCode();return t&&(t=`
|
|
@@ -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)}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);})();
|
|
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.inputElement!=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:
|