Comparing version 0.0.1-alpha.3 to 0.0.1-alpha.4
@@ -23,3 +23,3 @@ import { unsafeCSS as b, LitElement as g, html as l, nothing as r } from "lit"; | ||
`; | ||
var f = Object.defineProperty, x = Object.getOwnPropertyDescriptor, o = (t, a, s, n) => { | ||
var f = Object.defineProperty, x = Object.getOwnPropertyDescriptor, e = (t, a, s, n) => { | ||
for (var p = n > 1 ? void 0 : n ? x(a, s) : a, c = t.length - 1, u; c >= 0; c--) | ||
@@ -29,14 +29,14 @@ (u = t[c]) && (p = (n ? u(a, s, p) : u(p)) || p); | ||
}; | ||
let e = class extends g { | ||
let o = class extends g { | ||
constructor() { | ||
super(), this.autocomplete = "off", this.autofocus = !1, this.disabled = !1, this.maxlength = void 0, this.readonly = !1, this.required = !1, this.type = "text", this.onInput = (t) => { | ||
const a = t.target; | ||
this.internals.setFormValue(a.value), this.manageRequired(a.value); | ||
const s = new CustomEvent("input-change-event", { bubbles: !0, detail: { message: t } }); | ||
a && (this.value = a.value || ""), this.internals.setFormValue(this.value), this.manageRequired(this.value), this.dispatchEvent(new CustomEvent("changeEvent", { bubbles: !0, detail: { value: this.value } })); | ||
const s = new CustomEvent("inputEvent", { bubbles: !0, detail: { value: t } }); | ||
this.dispatchEvent(s); | ||
}, this.onBlur = () => { | ||
this.dispatchEvent(new CustomEvent("blur-event", { bubbles: !0 })); | ||
this.dispatchEvent(new CustomEvent("blurEvent", { bubbles: !0 })); | ||
}, this.onFocus = (t) => { | ||
const a = t.target; | ||
this.dispatchEvent(new CustomEvent("focus-event", { bubbles: !0 })), this.readonly && setTimeout(() => { | ||
this.dispatchEvent(new CustomEvent("focusEvent", { bubbles: !0 })), this.readonly && setTimeout(() => { | ||
a.select(); | ||
@@ -46,9 +46,2 @@ }, 10); | ||
} | ||
get value() { | ||
return this._value; | ||
} | ||
set value(t) { | ||
const a = this._value; | ||
this._value = t, this.dispatchEvent(new CustomEvent("change-event", { bubbles: !0, detail: { message: this._value } })), this.requestUpdate("value", a); | ||
} | ||
updated() { | ||
@@ -153,74 +146,74 @@ this.manageRequired(null); | ||
}; | ||
e.formAssociated = !0; | ||
e.styles = [ | ||
o.formAssociated = !0; | ||
o.styles = [ | ||
b(m) | ||
]; | ||
o([ | ||
e([ | ||
i({ type: String }) | ||
], e.prototype, "autocomplete", 2); | ||
o([ | ||
], o.prototype, "autocomplete", 2); | ||
e([ | ||
i({ type: Boolean }) | ||
], e.prototype, "autofocus", 2); | ||
o([ | ||
], o.prototype, "autofocus", 2); | ||
e([ | ||
i({ type: Array, hasChanged: (t, a) => (console.log("OldValue", a), console.log("Actual value", t), !0) }) | ||
], e.prototype, "datalist", 2); | ||
o([ | ||
], o.prototype, "datalist", 2); | ||
e([ | ||
i({ type: Boolean }) | ||
], e.prototype, "disabled", 2); | ||
o([ | ||
], o.prototype, "disabled", 2); | ||
e([ | ||
i({ type: String }) | ||
], e.prototype, "icon", 2); | ||
o([ | ||
], o.prototype, "icon", 2); | ||
e([ | ||
i({ type: Number }) | ||
], e.prototype, "max", 2); | ||
o([ | ||
], o.prototype, "max", 2); | ||
e([ | ||
i({ type: Number }) | ||
], e.prototype, "maxlength", 2); | ||
o([ | ||
], o.prototype, "maxlength", 2); | ||
e([ | ||
i({ type: Number }) | ||
], e.prototype, "min", 2); | ||
o([ | ||
], o.prototype, "min", 2); | ||
e([ | ||
i({ type: Number }) | ||
], e.prototype, "minlength", 2); | ||
o([ | ||
], o.prototype, "minlength", 2); | ||
e([ | ||
i({ type: String }) | ||
], e.prototype, "name", 2); | ||
o([ | ||
], o.prototype, "name", 2); | ||
e([ | ||
i({ type: String }) | ||
], e.prototype, "pattern", 2); | ||
o([ | ||
], o.prototype, "pattern", 2); | ||
e([ | ||
i({ type: String }) | ||
], e.prototype, "placeholder", 2); | ||
o([ | ||
], o.prototype, "placeholder", 2); | ||
e([ | ||
i({ type: Boolean }) | ||
], e.prototype, "readonly", 2); | ||
o([ | ||
], o.prototype, "readonly", 2); | ||
e([ | ||
i({ type: Boolean }) | ||
], e.prototype, "required", 2); | ||
o([ | ||
], o.prototype, "required", 2); | ||
e([ | ||
i({ reflect: !0 }) | ||
], e.prototype, "variant", 2); | ||
o([ | ||
], o.prototype, "variant", 2); | ||
e([ | ||
i({ type: String }) | ||
], e.prototype, "variantTip", 2); | ||
o([ | ||
], o.prototype, "variantTip", 2); | ||
e([ | ||
i({ type: Number }) | ||
], e.prototype, "step", 2); | ||
o([ | ||
], o.prototype, "step", 2); | ||
e([ | ||
i({ type: String }) | ||
], e.prototype, "type", 2); | ||
o([ | ||
i({ reflect: !0 }) | ||
], e.prototype, "value", 1); | ||
o([ | ||
], o.prototype, "type", 2); | ||
e([ | ||
i({ reflect: !0, type: String }) | ||
], o.prototype, "value", 2); | ||
e([ | ||
w() | ||
], e.prototype, "tabindex", 2); | ||
o([ | ||
], o.prototype, "tabindex", 2); | ||
e([ | ||
y(".input") | ||
], e.prototype, "inputElement", 2); | ||
e = o([ | ||
], o.prototype, "inputElement", 2); | ||
o = e([ | ||
v("mds-input") | ||
], e); | ||
], o); | ||
export { | ||
e as MdsInput | ||
o as MdsInput | ||
}; |
{ | ||
"name": "mds-input", | ||
"private": false, | ||
"version": "0.0.1-alpha.3", | ||
"version": "0.0.1-alpha.4", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "main": "dist/mds-input.js", |
@@ -10,3 +10,2 @@ import { LitElement } from 'lit'; | ||
private internals; | ||
private _value?; | ||
/** | ||
@@ -94,4 +93,3 @@ * Specifies whether the element should have autocomplete enabled | ||
*/ | ||
get value(): InputValueType; | ||
set value(val: InputValueType); | ||
value: InputValueType; | ||
private tabindex?; | ||
@@ -98,0 +96,0 @@ inputElement: HTMLElement | HTMLTextAreaElement | undefined; |
21001
355