@spectrum-web-components/switch 0.10.0 → 0.11.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/README.md +38 -1
- package/custom-elements.json +6 -0
- package/package.json +4 -4
- package/sp-switch.dev.js +1 -0
- package/sp-switch.dev.js.map +1 -1
- package/sp-switch.js +1 -1
- package/sp-switch.js.map +2 -2
- package/src/Switch.d.ts +6 -1
- package/src/Switch.dev.js +8 -3
- package/src/Switch.dev.js.map +2 -2
- package/src/Switch.js +1 -1
- package/src/Switch.js.map +3 -3
- package/src/index.dev.js +1 -0
- package/src/index.dev.js.map +1 -1
- package/src/index.js +1 -1
- package/src/index.js.map +1 -1
- package/src/spectrum-config.js +23 -0
- package/src/spectrum-switch.css.dev.js +270 -110
- package/src/spectrum-switch.css.dev.js.map +2 -2
- package/src/spectrum-switch.css.js +271 -112
- package/src/spectrum-switch.css.js.map +3 -3
- package/src/switch-legacy.css.dev.js +1 -0
- package/src/switch-legacy.css.dev.js.map +1 -1
- package/src/switch-legacy.css.js +1 -1
- package/src/switch-legacy.css.js.map +2 -2
- package/src/switch.css.dev.js +270 -112
- package/src/switch.css.dev.js.map +2 -2
- package/src/switch.css.js +271 -114
- package/src/switch.css.js.map +3 -3
- package/stories/switch-sizes.stories.js +23 -0
- package/stories/switch-sizes.stories.js.map +7 -0
- package/stories/switch.stories.js +68 -9
- package/stories/switch.stories.js.map +2 -2
- package/test/benchmark/test-basic.js +5 -1
- package/test/benchmark/test-basic.js.map +1 -1
- package/test/switch-sizes.test-vrt.js +5 -0
- package/test/switch-sizes.test-vrt.js.map +7 -0
- package/test/switch.test-vrt.js +4 -1
- package/test/switch.test-vrt.js.map +1 -1
- package/test/switch.test.js +36 -5
- package/test/switch.test.js.map +1 -1
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ import { Switch } from '@spectrum-web-components/switch';
|
|
|
32
32
|
</sp-switch>
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
### Standard
|
|
35
|
+
### Standard switch buttons
|
|
36
36
|
|
|
37
37
|
Standard switches are the default style for switches. They are optimal for
|
|
38
38
|
application panels where all visual elements are monochrome in order to direct
|
|
@@ -58,6 +58,43 @@ focus to the content.
|
|
|
58
58
|
</div>
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
+
## Sizes
|
|
62
|
+
|
|
63
|
+
<sp-tabs selected="m" auto label="Size Attribute Options">
|
|
64
|
+
<sp-tab value="s">Small</sp-tab>
|
|
65
|
+
<sp-tab-panel value="s">
|
|
66
|
+
|
|
67
|
+
```html
|
|
68
|
+
<sp-switch size="s">Small</sp-switch>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
</sp-tab-panel>
|
|
72
|
+
<sp-tab value="m">Medium</sp-tab>
|
|
73
|
+
<sp-tab-panel value="m">
|
|
74
|
+
|
|
75
|
+
```html
|
|
76
|
+
<sp-switch size="m">Medium</sp-switch>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
</sp-tab-panel>
|
|
80
|
+
<sp-tab value="l">Large</sp-tab>
|
|
81
|
+
<sp-tab-panel value="l">
|
|
82
|
+
|
|
83
|
+
```html
|
|
84
|
+
<sp-switch size="l">Large</sp-switch>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
</sp-tab-panel>
|
|
88
|
+
<sp-tab value="xl">Extra Large</sp-tab>
|
|
89
|
+
<sp-tab-panel value="xl">
|
|
90
|
+
|
|
91
|
+
```html
|
|
92
|
+
<sp-switch size="xl">Extra Large</sp-switch>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
</sp-tab-panel>
|
|
96
|
+
</sp-tabs>
|
|
97
|
+
|
|
61
98
|
### Emphasized radio buttons
|
|
62
99
|
|
|
63
100
|
Emphasized switches are a secondary style for switches. The blue color provides a
|
package/custom-elements.json
CHANGED
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
"fieldName": "emphasized"
|
|
55
55
|
}
|
|
56
56
|
],
|
|
57
|
+
"mixins": [
|
|
58
|
+
{
|
|
59
|
+
"name": "SizedMixin",
|
|
60
|
+
"package": "@spectrum-web-components/base"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
57
63
|
"superclass": {
|
|
58
64
|
"name": "CheckboxBase",
|
|
59
65
|
"package": "@spectrum-web-components/checkbox/src/CheckboxBase.js"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/switch",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -59,11 +59,11 @@
|
|
|
59
59
|
],
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@spectrum-web-components/base": "^0.7.0",
|
|
62
|
-
"@spectrum-web-components/checkbox": "^0.14.
|
|
62
|
+
"@spectrum-web-components/checkbox": "^0.14.1",
|
|
63
63
|
"tslib": "^2.0.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@spectrum-css/switch": "^
|
|
66
|
+
"@spectrum-css/switch": "^2.0.0"
|
|
67
67
|
},
|
|
68
68
|
"types": "./src/index.d.ts",
|
|
69
69
|
"customElements": "custom-elements.json",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"./sp-*.js",
|
|
72
72
|
"./**/*.dev.js"
|
|
73
73
|
],
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "15588c72c774b17cfac605b20ac52a27d123bd03"
|
|
75
75
|
}
|
package/sp-switch.dev.js
CHANGED
package/sp-switch.dev.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sp-switch.ts"],
|
|
4
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 { Switch } from './src/Switch.dev.js'\n\ncustomElements.define('sp-switch', Switch);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-switch': Switch;\n }\n}\n"],
|
|
5
|
-
"mappings": "AAWA;
|
|
5
|
+
"mappings": ";AAWA,SAAS,cAAc;AAEvB,eAAe,OAAO,aAAa,MAAM;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/sp-switch.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Switch as e}from"./src/Switch.js";customElements.define("sp-switch",e);
|
|
1
|
+
"use strict";import{Switch as e}from"./src/Switch.js";customElements.define("sp-switch",e);
|
|
2
2
|
//# sourceMappingURL=sp-switch.js.map
|
package/sp-switch.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sp-switch.ts"],
|
|
4
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 { Switch } from './src/Switch.js';\n\ncustomElements.define('sp-switch', Switch);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-switch': Switch;\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "aAWA,OAAS,UAAAA,MAAc,kBAEvB,eAAe,OAAO,YAAaA,CAAM",
|
|
6
|
+
"names": ["Switch"]
|
|
7
7
|
}
|
package/src/Switch.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { CSSResultArray, PropertyValues, TemplateResult } from '@spectrum-web-components/base';
|
|
2
2
|
import { CheckboxBase } from '@spectrum-web-components/checkbox/src/CheckboxBase.js';
|
|
3
|
+
declare const Switch_base: typeof CheckboxBase & {
|
|
4
|
+
new (...args: any[]): import("@spectrum-web-components/base").SizedElementInterface;
|
|
5
|
+
prototype: import("@spectrum-web-components/base").SizedElementInterface;
|
|
6
|
+
};
|
|
3
7
|
/**
|
|
4
8
|
* @element sp-switch
|
|
5
9
|
*
|
|
6
10
|
* @slot - text label of the Switch
|
|
7
11
|
*/
|
|
8
|
-
export declare class Switch extends
|
|
12
|
+
export declare class Switch extends Switch_base {
|
|
9
13
|
static get styles(): CSSResultArray;
|
|
10
14
|
emphasized: boolean;
|
|
11
15
|
protected render(): TemplateResult;
|
|
12
16
|
protected firstUpdated(changes: PropertyValues): void;
|
|
13
17
|
protected updated(changes: PropertyValues): void;
|
|
14
18
|
}
|
|
19
|
+
export {};
|
package/src/Switch.dev.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -10,13 +11,14 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
10
11
|
return result;
|
|
11
12
|
};
|
|
12
13
|
import {
|
|
13
|
-
html
|
|
14
|
+
html,
|
|
15
|
+
SizedMixin
|
|
14
16
|
} from "@spectrum-web-components/base";
|
|
15
17
|
import { property } from "@spectrum-web-components/base/src/decorators.js";
|
|
16
18
|
import { CheckboxBase } from "@spectrum-web-components/checkbox/src/CheckboxBase.js";
|
|
17
19
|
import switchStyles from "./switch.css.js";
|
|
18
20
|
import legacyStyles from "./switch-legacy.css.js";
|
|
19
|
-
export class Switch extends CheckboxBase {
|
|
21
|
+
export class Switch extends SizedMixin(CheckboxBase) {
|
|
20
22
|
constructor() {
|
|
21
23
|
super(...arguments);
|
|
22
24
|
this.emphasized = false;
|
|
@@ -40,7 +42,10 @@ export class Switch extends CheckboxBase {
|
|
|
40
42
|
}
|
|
41
43
|
updated(changes) {
|
|
42
44
|
if (changes.has("checked")) {
|
|
43
|
-
this.inputElement.setAttribute(
|
|
45
|
+
this.inputElement.setAttribute(
|
|
46
|
+
"aria-checked",
|
|
47
|
+
this.checked ? "true" : "false"
|
|
48
|
+
);
|
|
44
49
|
}
|
|
45
50
|
}
|
|
46
51
|
}
|
package/src/Switch.dev.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Switch.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 html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { CheckboxBase } from '@spectrum-web-components/checkbox/src/CheckboxBase.js';\nimport switchStyles from './switch.css.js';\nimport legacyStyles from './switch-legacy.css.js';\n\n/**\n * @element sp-switch\n *\n * @slot - text label of the Switch\n */\nexport class Switch extends CheckboxBase {\n public static override get styles(): CSSResultArray {\n /* c8 ignore next 4 */\n if (window.hasOwnProperty('ShadyDOM')) {\n // Override some styles if we are using the web component polyfill\n return [switchStyles, legacyStyles];\n }\n return [switchStyles];\n }\n\n @property({ type: Boolean, reflect: true })\n public emphasized = false;\n\n protected override render(): TemplateResult {\n return html`\n ${super.render()}\n <span id=\"switch\"></span>\n <label id=\"label\" for=\"input\"><slot></slot></label>\n `;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.inputElement.setAttribute('role', 'switch');\n }\n\n protected override updated(changes: PropertyValues): void {\n if (changes.has('checked')) {\n this.inputElement.setAttribute(\n 'aria-checked',\n this.checked ? 'true' : 'false'\n );\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
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 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 '@spectrum-web-components/checkbox/src/CheckboxBase.js';\nimport switchStyles from './switch.css.js';\nimport legacyStyles from './switch-legacy.css.js';\n\n/**\n * @element sp-switch\n *\n * @slot - text label of the Switch\n */\nexport class Switch extends SizedMixin(CheckboxBase) {\n public static override get styles(): CSSResultArray {\n /* c8 ignore next 4 */\n if (window.hasOwnProperty('ShadyDOM')) {\n // Override some styles if we are using the web component polyfill\n return [switchStyles, legacyStyles];\n }\n return [switchStyles];\n }\n\n @property({ type: Boolean, reflect: true })\n public emphasized = false;\n\n protected override render(): TemplateResult {\n return html`\n ${super.render()}\n <span id=\"switch\"></span>\n <label id=\"label\" for=\"input\"><slot></slot></label>\n `;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.inputElement.setAttribute('role', 'switch');\n }\n\n protected override updated(changes: PropertyValues): void {\n if (changes.has('checked')) {\n this.inputElement.setAttribute(\n 'aria-checked',\n this.checked ? 'true' : 'false'\n );\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EAEA;AAAA,OAEG;AACP,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,OAAO,kBAAkB;AACzB,OAAO,kBAAkB;AAOlB,aAAM,eAAe,WAAW,YAAY,EAAE;AAAA,EAA9C;AAAA;AAWH,SAAO,aAAa;AAAA;AAAA,EAVpB,WAA2B,SAAyB;AAEhD,QAAI,OAAO,eAAe,UAAU,GAAG;AAEnC,aAAO,CAAC,cAAc,YAAY;AAAA,IACtC;AACA,WAAO,CAAC,YAAY;AAAA,EACxB;AAAA,EAKmB,SAAyB;AACxC,WAAO;AAAA,cACD,MAAM,OAAO;AAAA;AAAA;AAAA;AAAA,EAIvB;AAAA,EAEmB,aAAa,SAA+B;AAC3D,UAAM,aAAa,OAAO;AAC1B,SAAK,aAAa,aAAa,QAAQ,QAAQ;AAAA,EACnD;AAAA,EAEmB,QAAQ,SAA+B;AACtD,QAAI,QAAQ,IAAI,SAAS,GAAG;AACxB,WAAK,aAAa;AAAA,QACd;AAAA,QACA,KAAK,UAAU,SAAS;AAAA,MAC5B;AAAA,IACJ;AAAA,EACJ;AACJ;AAvBW;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAVjC,OAWF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/Switch.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var d=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var p=(s,e,i
|
|
1
|
+
"use strict";var d=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var p=(s,r,e,i)=>{for(var t=i>1?void 0:i?u(r,e):r,o=s.length-1,l;o>=0;o--)(l=s[o])&&(t=(i?l(r,e,t):l(t))||t);return i&&t&&d(r,e,t),t};import{html as c,SizedMixin as n}from"@spectrum-web-components/base";import{property as m}from"@spectrum-web-components/base/src/decorators.js";import{CheckboxBase as h}from"@spectrum-web-components/checkbox/src/CheckboxBase.js";import a from"./switch.css.js";import f from"./switch-legacy.css.js";export class Switch extends n(h){constructor(){super(...arguments);this.emphasized=!1}static get styles(){return window.hasOwnProperty("ShadyDOM")?[a,f]:[a]}render(){return c`
|
|
2
2
|
${super.render()}
|
|
3
3
|
<span id="switch"></span>
|
|
4
4
|
<label id="label" for="input"><slot></slot></label>
|
package/src/Switch.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Switch.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 html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { CheckboxBase } from '@spectrum-web-components/checkbox/src/CheckboxBase.js';\nimport switchStyles from './switch.css.js';\nimport legacyStyles from './switch-legacy.css.js';\n\n/**\n * @element sp-switch\n *\n * @slot - text label of the Switch\n */\nexport class Switch extends CheckboxBase {\n public static override get styles(): CSSResultArray {\n /* c8 ignore next 4 */\n if (window.hasOwnProperty('ShadyDOM')) {\n // Override some styles if we are using the web component polyfill\n return [switchStyles, legacyStyles];\n }\n return [switchStyles];\n }\n\n @property({ type: Boolean, reflect: true })\n public emphasized = false;\n\n protected override render(): TemplateResult {\n return html`\n ${super.render()}\n <span id=\"switch\"></span>\n <label id=\"label\" for=\"input\"><slot></slot></label>\n `;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.inputElement.setAttribute('role', 'switch');\n }\n\n protected override updated(changes: PropertyValues): void {\n if (changes.has('checked')) {\n this.inputElement.setAttribute(\n 'aria-checked',\n this.checked ? 'true' : 'false'\n );\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
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 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 '@spectrum-web-components/checkbox/src/CheckboxBase.js';\nimport switchStyles from './switch.css.js';\nimport legacyStyles from './switch-legacy.css.js';\n\n/**\n * @element sp-switch\n *\n * @slot - text label of the Switch\n */\nexport class Switch extends SizedMixin(CheckboxBase) {\n public static override get styles(): CSSResultArray {\n /* c8 ignore next 4 */\n if (window.hasOwnProperty('ShadyDOM')) {\n // Override some styles if we are using the web component polyfill\n return [switchStyles, legacyStyles];\n }\n return [switchStyles];\n }\n\n @property({ type: Boolean, reflect: true })\n public emphasized = false;\n\n protected override render(): TemplateResult {\n return html`\n ${super.render()}\n <span id=\"switch\"></span>\n <label id=\"label\" for=\"input\"><slot></slot></label>\n `;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.inputElement.setAttribute('role', 'switch');\n }\n\n protected override updated(changes: PropertyValues): void {\n if (changes.has('checked')) {\n this.inputElement.setAttribute(\n 'aria-checked',\n this.checked ? 'true' : 'false'\n );\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "qNAYA,OAEI,QAAAA,EAEA,cAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,gBAAAC,MAAoB,wDAC7B,OAAOC,MAAkB,kBACzB,OAAOC,MAAkB,yBAOlB,aAAM,eAAeJ,EAAWE,CAAY,CAAE,CAA9C,kCAWH,KAAO,WAAa,GAVpB,WAA2B,QAAyB,CAEhD,OAAI,OAAO,eAAe,UAAU,EAEzB,CAACC,EAAcC,CAAY,EAE/B,CAACD,CAAY,CACxB,CAKmB,QAAyB,CACxC,OAAOJ;AAAA,cACD,MAAM,OAAO;AAAA;AAAA;AAAA,SAIvB,CAEmB,aAAaM,EAA+B,CAC3D,MAAM,aAAaA,CAAO,EAC1B,KAAK,aAAa,aAAa,OAAQ,QAAQ,CACnD,CAEmB,QAAQA,EAA+B,CAClDA,EAAQ,IAAI,SAAS,GACrB,KAAK,aAAa,aACd,eACA,KAAK,QAAU,OAAS,OAC5B,CAER,CACJ,CAvBWC,EAAA,CADNL,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAVjC,OAWF",
|
|
6
|
+
"names": ["html", "SizedMixin", "property", "CheckboxBase", "switchStyles", "legacyStyles", "changes", "__decorateClass"]
|
|
7
7
|
}
|
package/src/index.dev.js
CHANGED
package/src/index.dev.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.ts"],
|
|
4
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*/\nexport * from './Switch.dev.js'\n"],
|
|
5
|
-
"mappings": "AAWA;",
|
|
5
|
+
"mappings": ";AAWA,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./Switch.js";
|
|
1
|
+
"use strict";export*from"./Switch.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.ts"],
|
|
4
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*/\nexport * from './Switch.js';\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "aAWA,WAAc",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/spectrum-config.js
CHANGED
|
@@ -18,6 +18,29 @@ const config = {
|
|
|
18
18
|
host: '.spectrum-Switch',
|
|
19
19
|
focus: '#input',
|
|
20
20
|
attributes: [
|
|
21
|
+
{
|
|
22
|
+
type: 'enum',
|
|
23
|
+
name: 'size',
|
|
24
|
+
forceOntoHost: true,
|
|
25
|
+
values: [
|
|
26
|
+
{
|
|
27
|
+
name: 's',
|
|
28
|
+
selector: '.spectrum-Switch--sizeS',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'm',
|
|
32
|
+
selector: '.spectrum-Switch--sizeM',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'l',
|
|
36
|
+
selector: '.spectrum-Switch--sizeL',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'xl',
|
|
40
|
+
selector: '.spectrum-Switch--sizeXL',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
},
|
|
21
44
|
{
|
|
22
45
|
type: 'boolean',
|
|
23
46
|
selector: ':disabled',
|