@fluid-topics/ft-checkbox 1.2.26 → 1.2.28
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/build/ft-checkbox.d.ts +1 -0
- package/build/ft-checkbox.js +14 -9
- package/build/ft-checkbox.light.js +61 -46
- package/build/ft-checkbox.min.js +129 -114
- package/build/ft-checkbox.styles.d.ts +4 -3
- package/build/ft-checkbox.styles.js +27 -10
- package/package.json +5 -5
package/build/ft-checkbox.d.ts
CHANGED
package/build/ft-checkbox.js
CHANGED
|
@@ -18,24 +18,26 @@ class FtCheckbox extends FtLitElement {
|
|
|
18
18
|
this.checked = false;
|
|
19
19
|
this.indeterminate = false;
|
|
20
20
|
this.disabled = false;
|
|
21
|
+
this.error = false;
|
|
21
22
|
}
|
|
22
23
|
render() {
|
|
23
24
|
const classes = {
|
|
24
25
|
"ft-checkbox": true,
|
|
26
|
+
"ft-checkbox--error": this.error,
|
|
25
27
|
"ft-checkbox--checked": this.checked,
|
|
26
28
|
"ft-checkbox--indeterminate": this.indeterminate,
|
|
27
29
|
"ft-checkbox--disabled": this.disabled,
|
|
28
30
|
};
|
|
29
31
|
return html `
|
|
30
|
-
<label class="${classMap(classes)}" for="checkbox-input">
|
|
31
|
-
<div class="ft-checkbox--box-container">
|
|
32
|
-
<ft-ripple
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
<label class="${classMap(classes)}" for="checkbox-input" part="checkbox-label">
|
|
33
|
+
<div class="ft-checkbox--box-container" part="checkbox-box-container">
|
|
34
|
+
<ft-ripple part="checkbox-ripple"
|
|
35
|
+
?disabled=${this.disabled}
|
|
36
|
+
?primary=${this.checked || this.indeterminate}
|
|
37
|
+
unbounded>
|
|
36
38
|
</ft-ripple>
|
|
37
|
-
<div class="ft-checkbox--box">
|
|
38
|
-
<svg class="ft-checkbox--checkmark" viewBox="0 0 24 24">
|
|
39
|
+
<div class="ft-checkbox--box" part="checkbox-box">
|
|
40
|
+
<svg class="ft-checkbox--checkmark" viewBox="0 0 24 24" part="checkbox-check">
|
|
39
41
|
<path class="ft-checkbox--checkmark-path" fill="none"
|
|
40
42
|
d=${(this.indeterminate && !this.checked)
|
|
41
43
|
? "M2,12 22,12"
|
|
@@ -51,7 +53,7 @@ class FtCheckbox extends FtLitElement {
|
|
|
51
53
|
aria-checked=${this.indeterminate ? "mixed" : (this.checked ? "true" : "false")}
|
|
52
54
|
>
|
|
53
55
|
</div>
|
|
54
|
-
<ft-typography variant="body2">
|
|
56
|
+
<ft-typography variant="body2" part="checkbox-body">
|
|
55
57
|
<slot></slot>
|
|
56
58
|
</ft-typography>
|
|
57
59
|
</label>
|
|
@@ -89,6 +91,9 @@ __decorate([
|
|
|
89
91
|
__decorate([
|
|
90
92
|
property({ type: Boolean })
|
|
91
93
|
], FtCheckbox.prototype, "disabled", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
property({ type: Boolean })
|
|
96
|
+
], FtCheckbox.prototype, "error", void 0);
|
|
92
97
|
__decorate([
|
|
93
98
|
query(".ft-checkbox")
|
|
94
99
|
], FtCheckbox.prototype, "container", void 0);
|