@spectrum-web-components/switch 0.9.10 → 0.9.11

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/switch",
3
- "version": "0.9.10",
3
+ "version": "0.9.11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -44,8 +44,8 @@
44
44
  "lit-html"
45
45
  ],
46
46
  "dependencies": {
47
- "@spectrum-web-components/base": "^0.5.6",
48
- "@spectrum-web-components/checkbox": "^0.13.2",
47
+ "@spectrum-web-components/base": "^0.5.7",
48
+ "@spectrum-web-components/checkbox": "^0.13.3",
49
49
  "tslib": "^2.0.0"
50
50
  },
51
51
  "devDependencies": {
@@ -56,5 +56,5 @@
56
56
  "sideEffects": [
57
57
  "./sp-*.js"
58
58
  ],
59
- "gitHead": "8f5ea3556e160b6e30815edb2414dc5a5999a925"
59
+ "gitHead": "275ee61b152ac3eed0cd1603d8eab2aec90876a0"
60
60
  }
package/src/Switch.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","sourceRoot":"","sources":["Switch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,GAGP,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,uDAAuD,CAAC;AACrF,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAElD;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,YAAY;IAAxC;;QAWW,eAAU,GAAG,KAAK,CAAC;IAuB9B,CAAC;IAjCU,MAAM,KAAK,MAAM;QACpB,sBAAsB;QACtB,IAAI,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE;YACnC,kEAAkE;YAClE,OAAO,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;SACvC;QACD,OAAO,CAAC,YAAY,CAAC,CAAC;IAC1B,CAAC;IAKS,MAAM;QACZ,OAAO,IAAI,CAAA;cACL,KAAK,CAAC,MAAM,EAAE;;;SAGnB,CAAC;IACN,CAAC;IAES,YAAY,CAAC,OAAuB;QAC1C,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC5B,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACrD,CAAC;IAES,OAAO,CAAC,OAAuB;QACrC,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;YACxB,IAAI,CAAC,YAAY,CAAC,YAAY,CAC1B,cAAc,EACd,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAClC,CAAC;SACL;IACL,CAAC;CACJ;AAvBG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CACjB","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 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 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 firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.inputElement.setAttribute('role', 'switch');\n }\n\n protected 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"]}
1
+ {"version":3,"file":"Switch.js","sourceRoot":"","sources":["Switch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,GAGP,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,uDAAuD,CAAC;AACrF,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAElD;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,YAAY;IAAxC;;QAWW,eAAU,GAAG,KAAK,CAAC;IAuB9B,CAAC;IAjCU,MAAM,KAAc,MAAM;QAC7B,sBAAsB;QACtB,IAAI,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE;YACnC,kEAAkE;YAClE,OAAO,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;SACvC;QACD,OAAO,CAAC,YAAY,CAAC,CAAC;IAC1B,CAAC;IAKkB,MAAM;QACrB,OAAO,IAAI,CAAA;cACL,KAAK,CAAC,MAAM,EAAE;;;SAGnB,CAAC;IACN,CAAC;IAEkB,YAAY,CAAC,OAAuB;QACnD,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC5B,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACrD,CAAC;IAEkB,OAAO,CAAC,OAAuB;QAC9C,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;YACxB,IAAI,CAAC,YAAY,CAAC,YAAY,CAC1B,cAAc,EACd,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAClC,CAAC;SACL;IACL,CAAC;CACJ;AAvBG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CACjB","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"]}