@easymais-ui/text-input
Advanced tools
Comparing version 1.0.0-next.2 to 1.0.0-next.3
{ | ||
"name": "@easymais-ui/text-input", | ||
"version": "1.0.0-next.2", | ||
"version": "1.0.0-next.3", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
@@ -1,2 +0,2 @@ | ||
var __decorate=this&&this.__decorate||function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)if(d=decorators[i])r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r;return c>3&&r&&Object.defineProperty(target,key,r),r};import{LitElement,html}from"lit";import{property}from"lit/decorators.js";import{ifDefined}from"lit/directives/if-defined.js";import IMask from"imask";const textInputTypes=["text","tel","password","date"];export class TextInputBase extends LitElement{static get formAssociated(){return true}get form(){return this._internals?.form}set value(value){this._value=value}get value(){if(this.keepMask&&this.mask){return IMask.pipe(this._value,{mask:this.mask,lazy:true})}return this._value}displayValue(){if(this.mask){return IMask.pipe(this._value,{mask:this.mask,lazy:true})}return this._value}firstUpdated(changes){if(changes.has("value")){this._internals?.setFormValue(this.value)}}updated(changes){if(changes.has("value")){this._internals?.setFormValue(this.value)}}render(){return html` | ||
var __decorate=this&&this.__decorate||function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)if(d=decorators[i])r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r;return c>3&&r&&Object.defineProperty(target,key,r),r};import{LitElement,html}from"lit";import{property}from"lit/decorators.js";import{ifDefined}from"lit/directives/if-defined.js";import IMask from"imask";const textInputTypes=["text","tel","password"];export class TextInputBase extends LitElement{static get formAssociated(){return true}get form(){return this._internals?.form}set value(value){this._value=value}get value(){if(this.keepMask&&this.mask){return IMask.pipe(this._value,{mask:this.mask,lazy:true})}return this._value}displayValue(){if(this.mask){return IMask.pipe(this._value,{mask:this.mask,lazy:true})}return this._value}firstUpdated(changes){if(changes.has("value")){this._internals?.setFormValue(this.value)}}updated(changes){if(changes.has("value")){this._internals?.setFormValue(this.value)}}render(){return html` | ||
<input | ||
@@ -14,2 +14,2 @@ class="input" | ||
/> | ||
`}handleChange(){this.dispatchEvent(new Event("change",{bubbles:true,composed:true}))}handleInput(event){const inputTarget=event.target;if(this.mask){this._value=IMask.pipe(inputTarget.value,{mask:this.mask},"value","unmaskedValue");inputTarget.value=this.displayValue()}}constructor(){super();this.type="text";this._value="";this.required=false;this.readonly=false;this.invalid=false;this.disabled=false;this._internals=this.attachInternals();this._internals?.setFormValue(this.value)}}__decorate([property()],TextInputBase.prototype,"placeholder",void 0);__decorate([property({type:String})],TextInputBase.prototype,"value",null);__decorate([property()],TextInputBase.prototype,"mask",void 0);__decorate([property({type:Boolean,attribute:"keep-mask"})],TextInputBase.prototype,"keepMask",void 0);__decorate([property({type:Boolean,reflect:true})],TextInputBase.prototype,"required",void 0);__decorate([property({type:Boolean,reflect:true})],TextInputBase.prototype,"readonly",void 0);__decorate([property({type:Boolean,reflect:true})],TextInputBase.prototype,"invalid",void 0);__decorate([property({type:Boolean,reflect:true})],TextInputBase.prototype,"disabled",void 0); | ||
`}handleChange(){this._internals?.setFormValue(this.value);this.dispatchEvent(new Event("change",{bubbles:true,composed:true}))}handleInput(event){const inputTarget=event.target;if(this.mask){this._value=IMask.pipe(inputTarget.value,{mask:this.mask},"value","unmaskedValue")}else{this._value=inputTarget.value}inputTarget.value=this.displayValue()}constructor(){super();this.type="text";this._value="";this.required=false;this.readonly=false;this.invalid=false;this.disabled=false;this._internals=this.attachInternals();this._internals?.setFormValue(this.value)}}__decorate([property()],TextInputBase.prototype,"placeholder",void 0);__decorate([property({type:String})],TextInputBase.prototype,"value",null);__decorate([property()],TextInputBase.prototype,"mask",void 0);__decorate([property({type:Boolean,attribute:"keep-mask"})],TextInputBase.prototype,"keepMask",void 0);__decorate([property({type:Boolean,reflect:true})],TextInputBase.prototype,"required",void 0);__decorate([property({type:Boolean,reflect:true})],TextInputBase.prototype,"readonly",void 0);__decorate([property({type:Boolean,reflect:true})],TextInputBase.prototype,"invalid",void 0);__decorate([property({type:Boolean,reflect:true})],TextInputBase.prototype,"disabled",void 0); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
43854
0