@spectrum-web-components/checkbox 0.13.3 → 0.13.6-devmode.0
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/custom-elements.json +1 -17
- package/package.json +28 -11
- package/sp-checkbox.dev.js +3 -0
- package/sp-checkbox.dev.js.map +7 -0
- package/sp-checkbox.js +3 -14
- package/sp-checkbox.js.map +7 -1
- package/src/Checkbox.dev.js +128 -0
- package/src/Checkbox.dev.js.map +7 -0
- package/src/Checkbox.js +75 -79
- package/src/Checkbox.js.map +7 -1
- package/src/CheckboxBase.d.ts +1 -1
- package/src/CheckboxBase.dev.js +65 -0
- package/src/CheckboxBase.dev.js.map +7 -0
- package/src/CheckboxBase.js +53 -51
- package/src/CheckboxBase.js.map +7 -1
- package/src/checkbox.css.dev.js +233 -0
- package/src/checkbox.css.dev.js.map +7 -0
- package/src/checkbox.css.js +3 -14
- package/src/checkbox.css.js.map +7 -1
- package/src/index.dev.js +2 -0
- package/src/index.dev.js.map +7 -0
- package/src/index.js +2 -13
- package/src/index.js.map +7 -1
- package/src/spectrum-checkbox.css.dev.js +233 -0
- package/src/spectrum-checkbox.css.dev.js.map +7 -0
- package/src/spectrum-checkbox.css.js +3 -14
- package/src/spectrum-checkbox.css.js.map +7 -1
- package/stories/checkbox-sizes.stories.js +29 -34
- package/stories/checkbox-sizes.stories.js.map +7 -1
- package/stories/checkbox.stories.js +28 -39
- package/stories/checkbox.stories.js.map +7 -1
- package/test/benchmark/test-basic.js +5 -16
- package/test/benchmark/test-basic.js.map +7 -1
- package/test/checkbox-sizes.test-vrt.js +4 -15
- package/test/checkbox-sizes.test-vrt.js.map +7 -1
- package/test/checkbox.test-vrt.js +4 -15
- package/test/checkbox.test-vrt.js.map +7 -1
- package/test/checkbox.test.js +98 -90
- package/test/checkbox.test.js.map +7 -1
package/custom-elements.json
CHANGED
|
@@ -128,14 +128,6 @@
|
|
|
128
128
|
"text": "void"
|
|
129
129
|
}
|
|
130
130
|
},
|
|
131
|
-
"parameters": [
|
|
132
|
-
{
|
|
133
|
-
"name": "event",
|
|
134
|
-
"type": {
|
|
135
|
-
"text": "Event"
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
],
|
|
139
131
|
"inheritedFrom": {
|
|
140
132
|
"name": "CheckboxBase",
|
|
141
133
|
"module": "src/CheckboxBase.ts"
|
|
@@ -272,15 +264,7 @@
|
|
|
272
264
|
"type": {
|
|
273
265
|
"text": "void"
|
|
274
266
|
}
|
|
275
|
-
}
|
|
276
|
-
"parameters": [
|
|
277
|
-
{
|
|
278
|
-
"name": "event",
|
|
279
|
-
"type": {
|
|
280
|
-
"text": "Event"
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
]
|
|
267
|
+
}
|
|
284
268
|
}
|
|
285
269
|
],
|
|
286
270
|
"attributes": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/checkbox",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.6-devmode.0+07474d44f",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -20,11 +20,28 @@
|
|
|
20
20
|
"module": "./src/index.js",
|
|
21
21
|
"type": "module",
|
|
22
22
|
"exports": {
|
|
23
|
-
".":
|
|
24
|
-
|
|
23
|
+
".": {
|
|
24
|
+
"development": "./src/index.dev.js",
|
|
25
|
+
"default": "./src/index.js"
|
|
26
|
+
},
|
|
25
27
|
"./package.json": "./package.json",
|
|
26
|
-
"./
|
|
27
|
-
|
|
28
|
+
"./src/Checkbox.js": {
|
|
29
|
+
"development": "./src/Checkbox.dev.js",
|
|
30
|
+
"default": "./src/Checkbox.js"
|
|
31
|
+
},
|
|
32
|
+
"./src/CheckboxBase.js": {
|
|
33
|
+
"development": "./src/CheckboxBase.dev.js",
|
|
34
|
+
"default": "./src/CheckboxBase.js"
|
|
35
|
+
},
|
|
36
|
+
"./src/checkbox.css.js": "./src/checkbox.css.js",
|
|
37
|
+
"./src/index.js": {
|
|
38
|
+
"development": "./src/index.dev.js",
|
|
39
|
+
"default": "./src/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./sp-checkbox.js": {
|
|
42
|
+
"development": "./sp-checkbox.dev.js",
|
|
43
|
+
"default": "./sp-checkbox.js"
|
|
44
|
+
}
|
|
28
45
|
},
|
|
29
46
|
"scripts": {
|
|
30
47
|
"test": "echo \"Error: run tests from mono-repo root.\" && exit 1"
|
|
@@ -44,19 +61,19 @@
|
|
|
44
61
|
"lit-html"
|
|
45
62
|
],
|
|
46
63
|
"dependencies": {
|
|
47
|
-
"@spectrum-web-components/base": "^0.5.
|
|
48
|
-
"@spectrum-web-components/icon": "^0.11.
|
|
49
|
-
"@spectrum-web-components/icons-ui": "^0.8.
|
|
50
|
-
"@spectrum-web-components/shared": "^0.14.
|
|
64
|
+
"@spectrum-web-components/base": "^0.5.9-devmode.24+07474d44f",
|
|
65
|
+
"@spectrum-web-components/icon": "^0.11.12-devmode.0+07474d44f",
|
|
66
|
+
"@spectrum-web-components/icons-ui": "^0.8.12-devmode.0+07474d44f",
|
|
67
|
+
"@spectrum-web-components/shared": "^0.14.5-devmode.0+07474d44f",
|
|
51
68
|
"tslib": "^2.0.0"
|
|
52
69
|
},
|
|
53
70
|
"devDependencies": {
|
|
54
|
-
"@spectrum-css/checkbox": "^3.1.
|
|
71
|
+
"@spectrum-css/checkbox": "^3.1.3"
|
|
55
72
|
},
|
|
56
73
|
"types": "./src/index.d.ts",
|
|
57
74
|
"customElements": "custom-elements.json",
|
|
58
75
|
"sideEffects": [
|
|
59
76
|
"./sp-*.js"
|
|
60
77
|
],
|
|
61
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "07474d44f6cee1db241b9ccf3dc812514ffbe7fa"
|
|
62
79
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-checkbox.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { Checkbox } from './src/Checkbox.dev.js'\n\ncustomElements.define('sp-checkbox', Checkbox);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-checkbox': Checkbox;\n }\n}\n"],
|
|
5
|
+
"mappings": "AAWA;AAEA,eAAe,OAAO,eAAe,QAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/sp-checkbox.js
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import { Checkbox } from './src/Checkbox.js';
|
|
13
|
-
customElements.define('sp-checkbox', Checkbox);
|
|
14
|
-
//# sourceMappingURL=sp-checkbox.js.map
|
|
1
|
+
import { Checkbox } from "./src/Checkbox.js";
|
|
2
|
+
customElements.define("sp-checkbox", Checkbox);
|
|
3
|
+
//# sourceMappingURL=sp-checkbox.js.map
|
package/sp-checkbox.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-checkbox.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { Checkbox } from './src/Checkbox.js';\n\ncustomElements.define('sp-checkbox', Checkbox);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-checkbox': Checkbox;\n }\n}\n"],
|
|
5
|
+
"mappings": "AAWA;AAEA,eAAe,OAAO,eAAe,QAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result)
|
|
9
|
+
__defProp(target, key, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
import {
|
|
13
|
+
html,
|
|
14
|
+
SizedMixin
|
|
15
|
+
} from "@spectrum-web-components/base";
|
|
16
|
+
import { property } from "@spectrum-web-components/base/src/decorators.js";
|
|
17
|
+
import { CheckboxBase } from "./CheckboxBase.dev.js";
|
|
18
|
+
import "@spectrum-web-components/icons-ui/icons/sp-icon-checkmark75.js";
|
|
19
|
+
import "@spectrum-web-components/icons-ui/icons/sp-icon-checkmark100.js";
|
|
20
|
+
import "@spectrum-web-components/icons-ui/icons/sp-icon-checkmark200.js";
|
|
21
|
+
import "@spectrum-web-components/icons-ui/icons/sp-icon-checkmark300.js";
|
|
22
|
+
import "@spectrum-web-components/icons-ui/icons/sp-icon-dash75.js";
|
|
23
|
+
import "@spectrum-web-components/icons-ui/icons/sp-icon-dash100.js";
|
|
24
|
+
import "@spectrum-web-components/icons-ui/icons/sp-icon-dash200.js";
|
|
25
|
+
import "@spectrum-web-components/icons-ui/icons/sp-icon-dash300.js";
|
|
26
|
+
import checkboxStyles from "./checkbox.css.js";
|
|
27
|
+
import checkmarkSmallStyles from "@spectrum-web-components/icon/src/spectrum-icon-checkmark.css.js";
|
|
28
|
+
import dashSmallStyles from "@spectrum-web-components/icon/src/spectrum-icon-dash.css.js";
|
|
29
|
+
const checkmarkIcon = {
|
|
30
|
+
s: html`
|
|
31
|
+
<sp-icon-checkmark75
|
|
32
|
+
id="checkmark"
|
|
33
|
+
class="spectrum-UIIcon-Checkmark75"
|
|
34
|
+
></sp-icon-checkmark75>
|
|
35
|
+
`,
|
|
36
|
+
m: html`
|
|
37
|
+
<sp-icon-checkmark100
|
|
38
|
+
id="checkmark"
|
|
39
|
+
class="spectrum-UIIcon-Checkmark100"
|
|
40
|
+
></sp-icon-checkmark100>
|
|
41
|
+
`,
|
|
42
|
+
l: html`
|
|
43
|
+
<sp-icon-checkmark200
|
|
44
|
+
id="checkmark"
|
|
45
|
+
class="spectrum-UIIcon-Checkmark200"
|
|
46
|
+
></sp-icon-checkmark200>
|
|
47
|
+
`,
|
|
48
|
+
xl: html`
|
|
49
|
+
<sp-icon-checkmark300
|
|
50
|
+
id="checkmark"
|
|
51
|
+
class="spectrum-UIIcon-Checkmark300"
|
|
52
|
+
></sp-icon-checkmark300>
|
|
53
|
+
`
|
|
54
|
+
};
|
|
55
|
+
const dashIcon = {
|
|
56
|
+
s: html`
|
|
57
|
+
<sp-icon-dash75
|
|
58
|
+
id="partialCheckmark"
|
|
59
|
+
class="spectrum-UIIcon-Dash75"
|
|
60
|
+
></sp-icon-dash75>
|
|
61
|
+
`,
|
|
62
|
+
m: html`
|
|
63
|
+
<sp-icon-dash100
|
|
64
|
+
id="partialCheckmark"
|
|
65
|
+
class="spectrum-UIIcon-Dash100"
|
|
66
|
+
></sp-icon-dash100>
|
|
67
|
+
`,
|
|
68
|
+
l: html`
|
|
69
|
+
<sp-icon-dash200
|
|
70
|
+
id="partialCheckmark"
|
|
71
|
+
class="spectrum-UIIcon-Dash200"
|
|
72
|
+
></sp-icon-dash200>
|
|
73
|
+
`,
|
|
74
|
+
xl: html`
|
|
75
|
+
<sp-icon-dash300
|
|
76
|
+
id="partialCheckmark"
|
|
77
|
+
class="spectrum-UIIcon-Dash300"
|
|
78
|
+
></sp-icon-dash300>
|
|
79
|
+
`
|
|
80
|
+
};
|
|
81
|
+
export class Checkbox extends SizedMixin(CheckboxBase) {
|
|
82
|
+
constructor() {
|
|
83
|
+
super(...arguments);
|
|
84
|
+
this.indeterminate = false;
|
|
85
|
+
this.invalid = false;
|
|
86
|
+
this.emphasized = false;
|
|
87
|
+
}
|
|
88
|
+
static get styles() {
|
|
89
|
+
return [checkboxStyles, checkmarkSmallStyles, dashSmallStyles];
|
|
90
|
+
}
|
|
91
|
+
render() {
|
|
92
|
+
return html`
|
|
93
|
+
${super.render()}
|
|
94
|
+
<span id="box">
|
|
95
|
+
${checkmarkIcon[this.size]}
|
|
96
|
+
${dashIcon[this.size]}
|
|
97
|
+
</span>
|
|
98
|
+
<label id="label"><slot></slot></label>
|
|
99
|
+
`;
|
|
100
|
+
}
|
|
101
|
+
updated(changes) {
|
|
102
|
+
super.updated(changes);
|
|
103
|
+
if (changes.has("invalid")) {
|
|
104
|
+
if (this.invalid) {
|
|
105
|
+
this.inputElement.setAttribute("aria-invalid", "true");
|
|
106
|
+
} else {
|
|
107
|
+
this.inputElement.removeAttribute("aria-invalid");
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (changes.has("indeterminate")) {
|
|
111
|
+
if (this.indeterminate) {
|
|
112
|
+
this.inputElement.setAttribute("aria-checked", "mixed");
|
|
113
|
+
} else {
|
|
114
|
+
this.inputElement.removeAttribute("aria-checked");
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
__decorateClass([
|
|
120
|
+
property({ type: Boolean, reflect: true })
|
|
121
|
+
], Checkbox.prototype, "indeterminate", 2);
|
|
122
|
+
__decorateClass([
|
|
123
|
+
property({ type: Boolean, reflect: true })
|
|
124
|
+
], Checkbox.prototype, "invalid", 2);
|
|
125
|
+
__decorateClass([
|
|
126
|
+
property({ type: Boolean, reflect: true })
|
|
127
|
+
], Checkbox.prototype, "emphasized", 2);
|
|
128
|
+
//# sourceMappingURL=Checkbox.dev.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["Checkbox.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n DefaultElementSize,\n html,\n PropertyValues,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { CheckboxBase } from './CheckboxBase.dev.js'\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-checkmark75.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-checkmark100.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-checkmark200.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-checkmark300.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-dash75.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-dash100.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-dash200.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-dash300.js';\nimport checkboxStyles from './checkbox.css.js';\nimport checkmarkSmallStyles from '@spectrum-web-components/icon/src/spectrum-icon-checkmark.css.js';\nimport dashSmallStyles from '@spectrum-web-components/icon/src/spectrum-icon-dash.css.js';\n\nconst checkmarkIcon = {\n s: html`\n <sp-icon-checkmark75\n id=\"checkmark\"\n class=\"spectrum-UIIcon-Checkmark75\"\n ></sp-icon-checkmark75>\n `,\n m: html`\n <sp-icon-checkmark100\n id=\"checkmark\"\n class=\"spectrum-UIIcon-Checkmark100\"\n ></sp-icon-checkmark100>\n `,\n l: html`\n <sp-icon-checkmark200\n id=\"checkmark\"\n class=\"spectrum-UIIcon-Checkmark200\"\n ></sp-icon-checkmark200>\n `,\n xl: html`\n <sp-icon-checkmark300\n id=\"checkmark\"\n class=\"spectrum-UIIcon-Checkmark300\"\n ></sp-icon-checkmark300>\n `,\n};\n\nconst dashIcon = {\n s: html`\n <sp-icon-dash75\n id=\"partialCheckmark\"\n class=\"spectrum-UIIcon-Dash75\"\n ></sp-icon-dash75>\n `,\n m: html`\n <sp-icon-dash100\n id=\"partialCheckmark\"\n class=\"spectrum-UIIcon-Dash100\"\n ></sp-icon-dash100>\n `,\n l: html`\n <sp-icon-dash200\n id=\"partialCheckmark\"\n class=\"spectrum-UIIcon-Dash200\"\n ></sp-icon-dash200>\n `,\n xl: html`\n <sp-icon-dash300\n id=\"partialCheckmark\"\n class=\"spectrum-UIIcon-Dash300\"\n ></sp-icon-dash300>\n `,\n};\n\n/**\n * @element sp-checkbox\n * @slot - content to display as the label for the Checkbox\n */\nexport class Checkbox extends SizedMixin(CheckboxBase) {\n @property({ type: Boolean, reflect: true })\n public indeterminate = false;\n\n @property({ type: Boolean, reflect: true })\n public invalid = false;\n\n @property({ type: Boolean, reflect: true })\n public emphasized = false;\n\n public static override get styles(): CSSResultArray {\n return [checkboxStyles, checkmarkSmallStyles, dashSmallStyles];\n }\n\n protected override render(): TemplateResult {\n return html`\n ${super.render()}\n <span id=\"box\">\n ${checkmarkIcon[this.size as DefaultElementSize]}\n ${dashIcon[this.size as DefaultElementSize]}\n </span>\n <label id=\"label\"><slot></slot></label>\n `;\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('invalid')) {\n if (this.invalid) {\n this.inputElement.setAttribute('aria-invalid', 'true');\n } else {\n this.inputElement.removeAttribute('aria-invalid');\n }\n }\n if (changes.has('indeterminate')) {\n if (this.indeterminate) {\n this.inputElement.setAttribute('aria-checked', 'mixed');\n } else {\n this.inputElement.removeAttribute('aria-checked');\n }\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAAA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,gBAAgB;AAAA,EAClB,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMH,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMH,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMH,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAMR;AAEA,MAAM,WAAW;AAAA,EACb,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMH,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMH,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMH,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAMR;AAMO,aAAM,iBAAiB,WAAW,YAAY,EAAE;AAAA,EAAhD;AAAA;AAEI,yBAAgB;AAGhB,mBAAU;AAGV,sBAAa;AAAA;AAAA,aAEO,SAAyB;AAChD,WAAO,CAAC,gBAAgB,sBAAsB,eAAe;AAAA,EACjE;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA,cACD,MAAM,OAAO;AAAA;AAAA,kBAET,cAAc,KAAK;AAAA,kBACnB,SAAS,KAAK;AAAA;AAAA;AAAA;AAAA,EAI5B;AAAA,EAEmB,QAAQ,SAA+B;AACtD,UAAM,QAAQ,OAAO;AACrB,QAAI,QAAQ,IAAI,SAAS,GAAG;AACxB,UAAI,KAAK,SAAS;AACd,aAAK,aAAa,aAAa,gBAAgB,MAAM;AAAA,MACzD,OAAO;AACH,aAAK,aAAa,gBAAgB,cAAc;AAAA,MACpD;AAAA,IACJ;AACA,QAAI,QAAQ,IAAI,eAAe,GAAG;AAC9B,UAAI,KAAK,eAAe;AACpB,aAAK,aAAa,aAAa,gBAAgB,OAAO;AAAA,MAC1D,OAAO;AACH,aAAK,aAAa,gBAAgB,cAAc;AAAA,MACpD;AAAA,IACJ;AAAA,EACJ;AACJ;AAxCW;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AAFJ,SAEI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AALJ,SAKI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AARJ,SAQI;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/src/Checkbox.js
CHANGED
|
@@ -1,97 +1,95 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result)
|
|
9
|
+
__defProp(target, key, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
import {
|
|
13
|
+
html,
|
|
14
|
+
SizedMixin
|
|
15
|
+
} from "@spectrum-web-components/base";
|
|
16
|
+
import { property } from "@spectrum-web-components/base/src/decorators.js";
|
|
17
|
+
import { CheckboxBase } from "./CheckboxBase.js";
|
|
18
|
+
import "@spectrum-web-components/icons-ui/icons/sp-icon-checkmark75.js";
|
|
19
|
+
import "@spectrum-web-components/icons-ui/icons/sp-icon-checkmark100.js";
|
|
20
|
+
import "@spectrum-web-components/icons-ui/icons/sp-icon-checkmark200.js";
|
|
21
|
+
import "@spectrum-web-components/icons-ui/icons/sp-icon-checkmark300.js";
|
|
22
|
+
import "@spectrum-web-components/icons-ui/icons/sp-icon-dash75.js";
|
|
23
|
+
import "@spectrum-web-components/icons-ui/icons/sp-icon-dash100.js";
|
|
24
|
+
import "@spectrum-web-components/icons-ui/icons/sp-icon-dash200.js";
|
|
25
|
+
import "@spectrum-web-components/icons-ui/icons/sp-icon-dash300.js";
|
|
26
|
+
import checkboxStyles from "./checkbox.css.js";
|
|
27
|
+
import checkmarkSmallStyles from "@spectrum-web-components/icon/src/spectrum-icon-checkmark.css.js";
|
|
28
|
+
import dashSmallStyles from "@spectrum-web-components/icon/src/spectrum-icon-dash.css.js";
|
|
27
29
|
const checkmarkIcon = {
|
|
28
|
-
|
|
30
|
+
s: html`
|
|
29
31
|
<sp-icon-checkmark75
|
|
30
32
|
id="checkmark"
|
|
31
33
|
class="spectrum-UIIcon-Checkmark75"
|
|
32
34
|
></sp-icon-checkmark75>
|
|
33
35
|
`,
|
|
34
|
-
|
|
36
|
+
m: html`
|
|
35
37
|
<sp-icon-checkmark100
|
|
36
38
|
id="checkmark"
|
|
37
39
|
class="spectrum-UIIcon-Checkmark100"
|
|
38
40
|
></sp-icon-checkmark100>
|
|
39
41
|
`,
|
|
40
|
-
|
|
42
|
+
l: html`
|
|
41
43
|
<sp-icon-checkmark200
|
|
42
44
|
id="checkmark"
|
|
43
45
|
class="spectrum-UIIcon-Checkmark200"
|
|
44
46
|
></sp-icon-checkmark200>
|
|
45
47
|
`,
|
|
46
|
-
|
|
48
|
+
xl: html`
|
|
47
49
|
<sp-icon-checkmark300
|
|
48
50
|
id="checkmark"
|
|
49
51
|
class="spectrum-UIIcon-Checkmark300"
|
|
50
52
|
></sp-icon-checkmark300>
|
|
51
|
-
|
|
53
|
+
`
|
|
52
54
|
};
|
|
53
55
|
const dashIcon = {
|
|
54
|
-
|
|
56
|
+
s: html`
|
|
55
57
|
<sp-icon-dash75
|
|
56
58
|
id="partialCheckmark"
|
|
57
59
|
class="spectrum-UIIcon-Dash75"
|
|
58
60
|
></sp-icon-dash75>
|
|
59
61
|
`,
|
|
60
|
-
|
|
62
|
+
m: html`
|
|
61
63
|
<sp-icon-dash100
|
|
62
64
|
id="partialCheckmark"
|
|
63
65
|
class="spectrum-UIIcon-Dash100"
|
|
64
66
|
></sp-icon-dash100>
|
|
65
67
|
`,
|
|
66
|
-
|
|
68
|
+
l: html`
|
|
67
69
|
<sp-icon-dash200
|
|
68
70
|
id="partialCheckmark"
|
|
69
71
|
class="spectrum-UIIcon-Dash200"
|
|
70
72
|
></sp-icon-dash200>
|
|
71
73
|
`,
|
|
72
|
-
|
|
74
|
+
xl: html`
|
|
73
75
|
<sp-icon-dash300
|
|
74
76
|
id="partialCheckmark"
|
|
75
77
|
class="spectrum-UIIcon-Dash300"
|
|
76
78
|
></sp-icon-dash300>
|
|
77
|
-
|
|
79
|
+
`
|
|
78
80
|
};
|
|
79
|
-
/**
|
|
80
|
-
* @element sp-checkbox
|
|
81
|
-
* @slot - content to display as the label for the Checkbox
|
|
82
|
-
*/
|
|
83
81
|
export class Checkbox extends SizedMixin(CheckboxBase) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
82
|
+
constructor() {
|
|
83
|
+
super(...arguments);
|
|
84
|
+
this.indeterminate = false;
|
|
85
|
+
this.invalid = false;
|
|
86
|
+
this.emphasized = false;
|
|
87
|
+
}
|
|
88
|
+
static get styles() {
|
|
89
|
+
return [checkboxStyles, checkmarkSmallStyles, dashSmallStyles];
|
|
90
|
+
}
|
|
91
|
+
render() {
|
|
92
|
+
return html`
|
|
95
93
|
${super.render()}
|
|
96
94
|
<span id="box">
|
|
97
95
|
${checkmarkIcon[this.size]}
|
|
@@ -99,34 +97,32 @@ export class Checkbox extends SizedMixin(CheckboxBase) {
|
|
|
99
97
|
</span>
|
|
100
98
|
<label id="label"><slot></slot></label>
|
|
101
99
|
`;
|
|
100
|
+
}
|
|
101
|
+
updated(changes) {
|
|
102
|
+
super.updated(changes);
|
|
103
|
+
if (changes.has("invalid")) {
|
|
104
|
+
if (this.invalid) {
|
|
105
|
+
this.inputElement.setAttribute("aria-invalid", "true");
|
|
106
|
+
} else {
|
|
107
|
+
this.inputElement.removeAttribute("aria-invalid");
|
|
108
|
+
}
|
|
102
109
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
else {
|
|
110
|
-
this.inputElement.removeAttribute('aria-invalid');
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
if (changes.has('indeterminate')) {
|
|
114
|
-
if (this.indeterminate) {
|
|
115
|
-
this.inputElement.setAttribute('aria-checked', 'mixed');
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
this.inputElement.removeAttribute('aria-checked');
|
|
119
|
-
}
|
|
120
|
-
}
|
|
110
|
+
if (changes.has("indeterminate")) {
|
|
111
|
+
if (this.indeterminate) {
|
|
112
|
+
this.inputElement.setAttribute("aria-checked", "mixed");
|
|
113
|
+
} else {
|
|
114
|
+
this.inputElement.removeAttribute("aria-checked");
|
|
115
|
+
}
|
|
121
116
|
}
|
|
117
|
+
}
|
|
122
118
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
], Checkbox.prototype, "indeterminate",
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
], Checkbox.prototype, "invalid",
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
], Checkbox.prototype, "emphasized",
|
|
132
|
-
//# sourceMappingURL=Checkbox.js.map
|
|
119
|
+
__decorateClass([
|
|
120
|
+
property({ type: Boolean, reflect: true })
|
|
121
|
+
], Checkbox.prototype, "indeterminate", 2);
|
|
122
|
+
__decorateClass([
|
|
123
|
+
property({ type: Boolean, reflect: true })
|
|
124
|
+
], Checkbox.prototype, "invalid", 2);
|
|
125
|
+
__decorateClass([
|
|
126
|
+
property({ type: Boolean, reflect: true })
|
|
127
|
+
], Checkbox.prototype, "emphasized", 2);
|
|
128
|
+
//# sourceMappingURL=Checkbox.js.map
|
package/src/Checkbox.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["Checkbox.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n DefaultElementSize,\n html,\n PropertyValues,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { CheckboxBase } from './CheckboxBase.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-checkmark75.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-checkmark100.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-checkmark200.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-checkmark300.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-dash75.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-dash100.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-dash200.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-dash300.js';\nimport checkboxStyles from './checkbox.css.js';\nimport checkmarkSmallStyles from '@spectrum-web-components/icon/src/spectrum-icon-checkmark.css.js';\nimport dashSmallStyles from '@spectrum-web-components/icon/src/spectrum-icon-dash.css.js';\n\nconst checkmarkIcon = {\n s: html`\n <sp-icon-checkmark75\n id=\"checkmark\"\n class=\"spectrum-UIIcon-Checkmark75\"\n ></sp-icon-checkmark75>\n `,\n m: html`\n <sp-icon-checkmark100\n id=\"checkmark\"\n class=\"spectrum-UIIcon-Checkmark100\"\n ></sp-icon-checkmark100>\n `,\n l: html`\n <sp-icon-checkmark200\n id=\"checkmark\"\n class=\"spectrum-UIIcon-Checkmark200\"\n ></sp-icon-checkmark200>\n `,\n xl: html`\n <sp-icon-checkmark300\n id=\"checkmark\"\n class=\"spectrum-UIIcon-Checkmark300\"\n ></sp-icon-checkmark300>\n `,\n};\n\nconst dashIcon = {\n s: html`\n <sp-icon-dash75\n id=\"partialCheckmark\"\n class=\"spectrum-UIIcon-Dash75\"\n ></sp-icon-dash75>\n `,\n m: html`\n <sp-icon-dash100\n id=\"partialCheckmark\"\n class=\"spectrum-UIIcon-Dash100\"\n ></sp-icon-dash100>\n `,\n l: html`\n <sp-icon-dash200\n id=\"partialCheckmark\"\n class=\"spectrum-UIIcon-Dash200\"\n ></sp-icon-dash200>\n `,\n xl: html`\n <sp-icon-dash300\n id=\"partialCheckmark\"\n class=\"spectrum-UIIcon-Dash300\"\n ></sp-icon-dash300>\n `,\n};\n\n/**\n * @element sp-checkbox\n * @slot - content to display as the label for the Checkbox\n */\nexport class Checkbox extends SizedMixin(CheckboxBase) {\n @property({ type: Boolean, reflect: true })\n public indeterminate = false;\n\n @property({ type: Boolean, reflect: true })\n public invalid = false;\n\n @property({ type: Boolean, reflect: true })\n public emphasized = false;\n\n public static override get styles(): CSSResultArray {\n return [checkboxStyles, checkmarkSmallStyles, dashSmallStyles];\n }\n\n protected override render(): TemplateResult {\n return html`\n ${super.render()}\n <span id=\"box\">\n ${checkmarkIcon[this.size as DefaultElementSize]}\n ${dashIcon[this.size as DefaultElementSize]}\n </span>\n <label id=\"label\"><slot></slot></label>\n `;\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('invalid')) {\n if (this.invalid) {\n this.inputElement.setAttribute('aria-invalid', 'true');\n } else {\n this.inputElement.removeAttribute('aria-invalid');\n }\n }\n if (changes.has('indeterminate')) {\n if (this.indeterminate) {\n this.inputElement.setAttribute('aria-checked', 'mixed');\n } else {\n this.inputElement.removeAttribute('aria-checked');\n }\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAAA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,gBAAgB;AAAA,EAClB,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMH,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMH,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMH,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAMR;AAEA,MAAM,WAAW;AAAA,EACb,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMH,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMH,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMH,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAMR;AAMO,aAAM,iBAAiB,WAAW,YAAY,EAAE;AAAA,EAAhD;AAAA;AAEI,yBAAgB;AAGhB,mBAAU;AAGV,sBAAa;AAAA;AAAA,aAEO,SAAyB;AAChD,WAAO,CAAC,gBAAgB,sBAAsB,eAAe;AAAA,EACjE;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA,cACD,MAAM,OAAO;AAAA;AAAA,kBAET,cAAc,KAAK;AAAA,kBACnB,SAAS,KAAK;AAAA;AAAA;AAAA;AAAA,EAI5B;AAAA,EAEmB,QAAQ,SAA+B;AACtD,UAAM,QAAQ,OAAO;AACrB,QAAI,QAAQ,IAAI,SAAS,GAAG;AACxB,UAAI,KAAK,SAAS;AACd,aAAK,aAAa,aAAa,gBAAgB,MAAM;AAAA,MACzD,OAAO;AACH,aAAK,aAAa,gBAAgB,cAAc;AAAA,MACpD;AAAA,IACJ;AACA,QAAI,QAAQ,IAAI,eAAe,GAAG;AAC9B,UAAI,KAAK,eAAe;AACpB,aAAK,aAAa,aAAa,gBAAgB,OAAO;AAAA,MAC1D,OAAO;AACH,aAAK,aAAa,gBAAgB,cAAc;AAAA,MACpD;AAAA,IACJ;AAAA,EACJ;AACJ;AAxCW;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AAFJ,SAEI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AALJ,SAKI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AARJ,SAQI;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/src/CheckboxBase.d.ts
CHANGED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result)
|
|
9
|
+
__defProp(target, key, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
import { html } from "@spectrum-web-components/base";
|
|
13
|
+
import {
|
|
14
|
+
property,
|
|
15
|
+
query
|
|
16
|
+
} from "@spectrum-web-components/base/src/decorators.js";
|
|
17
|
+
import { Focusable } from "@spectrum-web-components/shared/src/focusable.js";
|
|
18
|
+
export class CheckboxBase extends Focusable {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this.checked = false;
|
|
22
|
+
this.readonly = false;
|
|
23
|
+
}
|
|
24
|
+
get focusElement() {
|
|
25
|
+
return this.inputElement;
|
|
26
|
+
}
|
|
27
|
+
handleChange() {
|
|
28
|
+
if (this.readonly) {
|
|
29
|
+
this.inputElement.checked = this.checked;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this.checked = this.inputElement.checked;
|
|
33
|
+
const changeEvent = new CustomEvent("change", {
|
|
34
|
+
bubbles: true,
|
|
35
|
+
cancelable: true,
|
|
36
|
+
composed: true
|
|
37
|
+
});
|
|
38
|
+
const applyDefault = this.dispatchEvent(changeEvent);
|
|
39
|
+
if (!applyDefault) {
|
|
40
|
+
this.checked = !this.inputElement.checked;
|
|
41
|
+
this.inputElement.checked = this.checked;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
render() {
|
|
45
|
+
return html`
|
|
46
|
+
<input
|
|
47
|
+
id="input"
|
|
48
|
+
aria-labelledby="label"
|
|
49
|
+
type="checkbox"
|
|
50
|
+
.checked=${this.checked}
|
|
51
|
+
@change=${this.handleChange}
|
|
52
|
+
/>
|
|
53
|
+
`;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
__decorateClass([
|
|
57
|
+
property({ type: Boolean, reflect: true })
|
|
58
|
+
], CheckboxBase.prototype, "checked", 2);
|
|
59
|
+
__decorateClass([
|
|
60
|
+
property({ type: Boolean, reflect: true })
|
|
61
|
+
], CheckboxBase.prototype, "readonly", 2);
|
|
62
|
+
__decorateClass([
|
|
63
|
+
query("#input")
|
|
64
|
+
], CheckboxBase.prototype, "inputElement", 2);
|
|
65
|
+
//# sourceMappingURL=CheckboxBase.dev.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["CheckboxBase.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { html, TemplateResult } from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\n\nexport class CheckboxBase extends Focusable {\n @property({ type: Boolean, reflect: true })\n public checked = false;\n\n @property({ type: Boolean, reflect: true })\n public readonly = false;\n\n @query('#input')\n protected inputElement!: HTMLInputElement;\n\n public override get focusElement(): HTMLElement {\n return this.inputElement;\n }\n\n public handleChange(): void {\n if (this.readonly) {\n this.inputElement.checked = this.checked;\n return;\n }\n this.checked = this.inputElement.checked;\n\n const changeEvent = new CustomEvent('change', {\n bubbles: true,\n cancelable: true,\n composed: true,\n });\n const applyDefault = this.dispatchEvent(changeEvent);\n\n if (!applyDefault) {\n this.checked = !this.inputElement.checked;\n this.inputElement.checked = this.checked;\n }\n }\n\n protected override render(): TemplateResult {\n return html`\n <input\n id=\"input\"\n aria-labelledby=\"label\"\n type=\"checkbox\"\n .checked=${this.checked}\n @change=${this.handleChange}\n />\n `;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAYA;AACA;AAAA;AAAA;AAAA;AAIA;AAEO,aAAM,qBAAqB,UAAU;AAAA,EAArC;AAAA;AAEI,mBAAU;AAGV,oBAAW;AAAA;AAAA,MAKE,eAA4B;AAC5C,WAAO,KAAK;AAAA,EAChB;AAAA,EAEO,eAAqB;AACxB,QAAI,KAAK,UAAU;AACf,WAAK,aAAa,UAAU,KAAK;AACjC;AAAA,IACJ;AACA,SAAK,UAAU,KAAK,aAAa;AAEjC,UAAM,cAAc,IAAI,YAAY,UAAU;AAAA,MAC1C,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,UAAU;AAAA,IACd,CAAC;AACD,UAAM,eAAe,KAAK,cAAc,WAAW;AAEnD,QAAI,CAAC,cAAc;AACf,WAAK,UAAU,CAAC,KAAK,aAAa;AAClC,WAAK,aAAa,UAAU,KAAK;AAAA,IACrC;AAAA,EACJ;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA;AAAA;AAAA;AAAA;AAAA,2BAKY,KAAK;AAAA,0BACN,KAAK;AAAA;AAAA;AAAA,EAG3B;AACJ;AA3CW;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AAFJ,aAEI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AALJ,aAKI;AAGG;AAAA,EADV,AAAC,MAAM,QAAQ;AAAA,GACL,AARP,aAQO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|