@covalent/components 11.4.1 → 11.4.3-beta.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/package.json +28 -1
- package/textarea.js +1 -1
- package/textarea.mjs +1 -1
- package/textfield/textfield.d.ts +16 -0
- package/{textfield-Byf2gP_G.js → textfield-lDKLLJ_h.js} +1 -1
- package/{textfield-vzZ-4E3g.mjs → textfield-umYQ5oiz.mjs} +195 -195
- package/textfield.js +18 -3
- package/textfield.mjs +62 -18
package/textfield.js
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
2
|
-
${
|
3
|
-
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("./query-assigned-elements-8EurZY45.js"),c=require("./property-DYTC_2-m.js"),o=require("./textfield-lDKLLJ_h.js");require("./circular-progress.js");const h=require("./class-map-DTzB8z-1.js");var u=Object.defineProperty,x=Object.getOwnPropertyDescriptor,a=(n,e,i,r)=>{for(var t=r>1?void 0:r?x(e,i):e,s=n.length-1,d;s>=0;s--)(d=n[s])&&(t=(r?d(e,i,t):d(t))||t);return r&&t&&u(e,i,t),t};exports.CovalentTextField=class extends o.TextFieldBase{constructor(){super(...arguments),this.loading=!1,this.loaderDensity=-6,this.outlined=!0}render(){const e=this.charCounter&&this.maxLength!==-1,i=!!this.helper||!!this.validationMessage||e,r={"mdc-text-field--disabled":this.disabled,"mdc-text-field--no-label":!this.label,"mdc-text-field--filled":!this.outlined,"mdc-text-field--outlined":this.outlined,"mdc-text-field--with-leading-icon":this.icon,"mdc-text-field--with-trailing-icon":this.iconTrailing,"mdc-text-field--end-aligned":this.endAligned,"cv-text-field--loading":this.loading};return l.x`
|
2
|
+
<label class="mdc-text-field ${h.o(r)}">
|
3
|
+
${this.renderRipple()}
|
4
|
+
${this.outlined?this.renderOutline():this.renderLabel()}
|
5
|
+
${this.renderLeadingIcon()} ${this.renderPrefix()}
|
6
|
+
${this.renderInput(i)} ${this.renderSuffix()}
|
7
|
+
${this.renderTrailingIcon()} ${this.renderLineRipple()}
|
8
|
+
</label>
|
9
|
+
${this.renderHelperText(i,e)}
|
10
|
+
`}renderTrailingIcon(){return this.loading?l.x`<cv-circular-progress
|
11
|
+
class="text-field-loading"
|
12
|
+
indeterminate
|
13
|
+
progress="0"
|
14
|
+
density="${this.loaderDensity}"
|
15
|
+
>
|
16
|
+
</cv-circular-progress>`:this.iconTrailing?this.renderIcon(this.iconTrailing,!0):""}};exports.CovalentTextField.styles=[o.styles,l.i`
|
17
|
+
${l.r(o.styles$1)}
|
18
|
+
`];a([c.n({type:Boolean,reflect:!0})],exports.CovalentTextField.prototype,"loading",2);a([c.n({type:Number})],exports.CovalentTextField.prototype,"loaderDensity",2);exports.CovalentTextField=a([l.e("cv-textfield")],exports.CovalentTextField);const p=exports.CovalentTextField;exports.default=p;
|
package/textfield.mjs
CHANGED
@@ -1,26 +1,70 @@
|
|
1
|
-
import { r as
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
import { r as h, i as p, x as a, e as f } from "./query-assigned-elements-D930kELM.mjs";
|
2
|
+
import { n as c } from "./property-DJzm_oB9.mjs";
|
3
|
+
import { s as u, a as g, T as x } from "./textfield-umYQ5oiz.mjs";
|
4
|
+
import "./circular-progress.mjs";
|
5
|
+
import { o as m } from "./class-map-DPUylGZM.mjs";
|
6
|
+
var $ = Object.defineProperty, v = Object.getOwnPropertyDescriptor, o = (r, e, s, l) => {
|
7
|
+
for (var t = l > 1 ? void 0 : l ? v(e, s) : e, n = r.length - 1, d; n >= 0; n--)
|
8
|
+
(d = r[n]) && (t = (l ? d(e, s, t) : d(t)) || t);
|
9
|
+
return l && t && $(e, s, t), t;
|
7
10
|
};
|
8
|
-
let
|
11
|
+
let i = class extends x {
|
9
12
|
constructor() {
|
10
|
-
super(...arguments), this.outlined = !0;
|
13
|
+
super(...arguments), this.loading = !1, this.loaderDensity = -6, this.outlined = !0;
|
14
|
+
}
|
15
|
+
/**
|
16
|
+
* This method is identical to the base implementation,
|
17
|
+
* with the only difference being the addition of a class to handle the loading state.
|
18
|
+
*/
|
19
|
+
render() {
|
20
|
+
const r = this.charCounter && this.maxLength !== -1, e = !!this.helper || !!this.validationMessage || r, s = {
|
21
|
+
"mdc-text-field--disabled": this.disabled,
|
22
|
+
"mdc-text-field--no-label": !this.label,
|
23
|
+
"mdc-text-field--filled": !this.outlined,
|
24
|
+
"mdc-text-field--outlined": this.outlined,
|
25
|
+
"mdc-text-field--with-leading-icon": this.icon,
|
26
|
+
"mdc-text-field--with-trailing-icon": this.iconTrailing,
|
27
|
+
"mdc-text-field--end-aligned": this.endAligned,
|
28
|
+
"cv-text-field--loading": this.loading
|
29
|
+
};
|
30
|
+
return a`
|
31
|
+
<label class="mdc-text-field ${m(s)}">
|
32
|
+
${this.renderRipple()}
|
33
|
+
${this.outlined ? this.renderOutline() : this.renderLabel()}
|
34
|
+
${this.renderLeadingIcon()} ${this.renderPrefix()}
|
35
|
+
${this.renderInput(e)} ${this.renderSuffix()}
|
36
|
+
${this.renderTrailingIcon()} ${this.renderLineRipple()}
|
37
|
+
</label>
|
38
|
+
${this.renderHelperText(e, r)}
|
39
|
+
`;
|
40
|
+
}
|
41
|
+
renderTrailingIcon() {
|
42
|
+
return this.loading ? a`<cv-circular-progress
|
43
|
+
class="text-field-loading"
|
44
|
+
indeterminate
|
45
|
+
progress="0"
|
46
|
+
density="${this.loaderDensity}"
|
47
|
+
>
|
48
|
+
</cv-circular-progress>` : this.iconTrailing ? this.renderIcon(this.iconTrailing, !0) : "";
|
11
49
|
}
|
12
50
|
};
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
${
|
51
|
+
i.styles = [
|
52
|
+
u,
|
53
|
+
p`
|
54
|
+
${h(g)}
|
17
55
|
`
|
18
56
|
];
|
19
|
-
|
20
|
-
|
21
|
-
],
|
22
|
-
|
57
|
+
o([
|
58
|
+
c({ type: Boolean, reflect: !0 })
|
59
|
+
], i.prototype, "loading", 2);
|
60
|
+
o([
|
61
|
+
c({ type: Number })
|
62
|
+
], i.prototype, "loaderDensity", 2);
|
63
|
+
i = o([
|
64
|
+
f("cv-textfield")
|
65
|
+
], i);
|
66
|
+
const D = i;
|
23
67
|
export {
|
24
|
-
|
25
|
-
|
68
|
+
i as CovalentTextField,
|
69
|
+
D as default
|
26
70
|
};
|