@operato/scene-switch 10.0.0-beta.1 → 10.0.0-beta.22

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 CHANGED
@@ -1,41 +1,23 @@
1
- # \<scene-switch>
1
+ # @operato/scene-switch
2
2
 
3
- ## Installation
3
+ > switch component for operato-scene
4
4
 
5
- ```bash
6
- npm i scene-switch
7
- ```
8
-
9
- ## Usage
10
-
11
- ```html
12
-
13
- ```
5
+ <!-- AUTOGEN_BEGIN: do not edit between markers (run scripts/regenerate-readmes.mjs to update) -->
14
6
 
15
- ## Linting and formatting
16
-
17
- To scan the project for linting and formatting errors, run
7
+ ## Install
18
8
 
19
9
  ```bash
20
- npm run lint
10
+ yarn add @operato/scene-switch
21
11
  ```
22
12
 
23
- To automatically fix linting and formatting errors, run
13
+ ## Build
24
14
 
25
15
  ```bash
26
- npm run format
16
+ yarn build
27
17
  ```
28
18
 
29
- ## Tooling configs
30
-
31
- For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
32
-
33
- If you customize the configuration a lot, you can consider moving them to individual files.
19
+ Output: ESM module at `dist/index.js` (single bundle, no UMD/IE legacy).
34
20
 
35
- ## Local Demo with `web-dev-server`
36
-
37
- ```bash
38
- npm start
39
- ```
21
+ _Version: 10.0.0-beta.4_
40
22
 
41
- To run a local development server that serves the basic demo located in `demo/index.html`
23
+ <!-- AUTOGEN_END -->
@@ -65,8 +65,6 @@ let SimpleSwitchElement = class SimpleSwitchElement extends LitElement {
65
65
  border-radius: calc((var(--ox-simple-switch-thumbnail-size) - 8px) / 2);
66
66
  }
67
67
  `;
68
- round = false;
69
- value = false;
70
68
  render() {
71
69
  return html `
72
70
  <label>
@@ -1 +1 @@
1
- {"version":3,"file":"simple-switch-element.js","sourceRoot":"","sources":["../src/simple-switch-element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAGpD,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,UAAU;IACjD,MAAM,CAAC,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DlB,CAAA;IAE4B,KAAK,GAAY,KAAK,CAAA;IACtB,KAAK,GAAY,KAAK,CAAA;IAEnD,MAAM;QACJ,OAAO,IAAI,CAAA;;0CAE2B,IAAI,CAAC,KAAK;uBAC7B,IAAI,CAAC,KAAK;;KAE5B,CAAA;IACH,CAAC;IAED,YAAY;QACV,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CAAQ,EAAE,EAAE;YACtD,IAAI,CAAC,KAAK,GAAI,CAAC,CAAC,MAA2B,EAAE,OAAO,CAAA;YACpD,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,cAAc,EAAE;gBAC9B,MAAM,EAAE,IAAI,CAAC,KAAK;aACnB,CAAC,CACH,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;;AArB4B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDAAuB;AACtB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDAAuB;AAlExC,mBAAmB;IAD/B,aAAa,CAAC,kBAAkB,CAAC;GACrB,mBAAmB,CAuF/B","sourcesContent":["import { LitElement, css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n@customElement('ox-simple-switch')\nexport class SimpleSwitchElement extends LitElement {\n static styles = css`\n /* The switch - the box around the slider */\n label {\n position: relative;\n display: inline-block;\n width: 100%;\n height: 100%;\n }\n\n /* Hide default HTML checkbox */\n label input {\n opacity: 0;\n width: 0;\n height: 0;\n }\n\n /* The slider */\n span {\n position: absolute;\n cursor: pointer;\n width: var(--ox-simple-switch-fullwidth);\n height: var(--ox-simple-switch-fullheight);\n top: calc(0 - var(--ox-simple-switch-thumbnail-size));\n left: 0;\n background-color: var(--ox-simple-switch-off-color, #ccc);\n -webkit-transition: 0.4s;\n transition: 0.4s;\n }\n\n span:before {\n position: absolute;\n content: '';\n height: calc(var(--ox-simple-switch-thumbnail-size) - 8px);\n width: calc(var(--ox-simple-switch-thumbnail-size) - 8px);\n left: 4px;\n top: 4px;\n background-color: var(--ox-simple-switch-thumbnail-color, white);\n -webkit-transition: 0.4s;\n transition: 0.4s;\n }\n\n input:checked + span {\n background-color: var(--ox-simple-switch-on-color, #2196f3);\n }\n\n input:checked + span:before {\n -webkit-transform: translateX(calc(var(--ox-simple-switch-fullwidth) - var(--ox-simple-switch-thumbnail-size)))\n translateY(calc(var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)));\n -ms-transform: translateX(calc(var(--ox-simple-switch-fullwidth) - var(--ox-simple-switch-thumbnail-size)))\n translateY(calc(var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)));\n transform: translateX(calc(var(--ox-simple-switch-fullwidth) - var(--ox-simple-switch-thumbnail-size)))\n translateY(calc(var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)));\n }\n\n /* Rounded sliders */\n span[round] {\n border-radius: calc(var(--ox-simple-switch-thumbnail-size) / 2);\n }\n\n span[round]:before {\n border-radius: calc((var(--ox-simple-switch-thumbnail-size) - 8px) / 2);\n }\n `\n\n @property({ type: Boolean }) round: boolean = false\n @property({ type: Boolean }) value: boolean = false\n\n render() {\n return html`\n <label>\n <input type=\"checkbox\" .checked=${this.value} />\n <span ?round=${this.round}></span>\n </label>\n `\n }\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', (e: Event) => {\n this.value = (e.target as HTMLInputElement)?.checked\n this.dispatchEvent(\n new CustomEvent('value-change', {\n detail: this.value\n })\n )\n })\n }\n}\n"]}
1
+ {"version":3,"file":"simple-switch-element.js","sourceRoot":"","sources":["../src/simple-switch-element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAGpD,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,UAAU;IACjD,MAAM,CAAC,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DlB,CAAA;IAKD,MAAM;QACJ,OAAO,IAAI,CAAA;;0CAE2B,IAAI,CAAC,KAAK;uBAC7B,IAAI,CAAC,KAAK;;KAE5B,CAAA;IACH,CAAC;IAED,YAAY;QACV,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CAAQ,EAAE,EAAE;YACtD,IAAI,CAAC,KAAK,GAAI,CAAC,CAAC,MAA2B,EAAE,OAAO,CAAA;YACpD,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,cAAc,EAAE;gBAC9B,MAAM,EAAE,IAAI,CAAC,KAAK;aACnB,CAAC,CACH,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;;AArBoC;IAApC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDAAuB;AACd;IAApC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDAAuB;AAlExC,mBAAmB;IAD/B,aAAa,CAAC,kBAAkB,CAAC;GACrB,mBAAmB,CAuF/B","sourcesContent":["import { LitElement, css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n@customElement('ox-simple-switch')\nexport class SimpleSwitchElement extends LitElement {\n static styles = css`\n /* The switch - the box around the slider */\n label {\n position: relative;\n display: inline-block;\n width: 100%;\n height: 100%;\n }\n\n /* Hide default HTML checkbox */\n label input {\n opacity: 0;\n width: 0;\n height: 0;\n }\n\n /* The slider */\n span {\n position: absolute;\n cursor: pointer;\n width: var(--ox-simple-switch-fullwidth);\n height: var(--ox-simple-switch-fullheight);\n top: calc(0 - var(--ox-simple-switch-thumbnail-size));\n left: 0;\n background-color: var(--ox-simple-switch-off-color, #ccc);\n -webkit-transition: 0.4s;\n transition: 0.4s;\n }\n\n span:before {\n position: absolute;\n content: '';\n height: calc(var(--ox-simple-switch-thumbnail-size) - 8px);\n width: calc(var(--ox-simple-switch-thumbnail-size) - 8px);\n left: 4px;\n top: 4px;\n background-color: var(--ox-simple-switch-thumbnail-color, white);\n -webkit-transition: 0.4s;\n transition: 0.4s;\n }\n\n input:checked + span {\n background-color: var(--ox-simple-switch-on-color, #2196f3);\n }\n\n input:checked + span:before {\n -webkit-transform: translateX(calc(var(--ox-simple-switch-fullwidth) - var(--ox-simple-switch-thumbnail-size)))\n translateY(calc(var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)));\n -ms-transform: translateX(calc(var(--ox-simple-switch-fullwidth) - var(--ox-simple-switch-thumbnail-size)))\n translateY(calc(var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)));\n transform: translateX(calc(var(--ox-simple-switch-fullwidth) - var(--ox-simple-switch-thumbnail-size)))\n translateY(calc(var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)));\n }\n\n /* Rounded sliders */\n span[round] {\n border-radius: calc(var(--ox-simple-switch-thumbnail-size) / 2);\n }\n\n span[round]:before {\n border-radius: calc((var(--ox-simple-switch-thumbnail-size) - 8px) / 2);\n }\n `\n\n @property({ type: Boolean }) declare round: boolean\n @property({ type: Boolean }) declare value: boolean\n\n render() {\n return html`\n <label>\n <input type=\"checkbox\" .checked=${this.value} />\n <span ?round=${this.round}></span>\n </label>\n `\n }\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', (e: Event) => {\n this.value = (e.target as HTMLInputElement)?.checked\n this.dispatchEvent(\n new CustomEvent('value-change', {\n detail: this.value\n })\n )\n })\n }\n}\n"]}
@@ -2,8 +2,8 @@ const icon = new URL('../../icons/icon-simple-switch.png', import.meta.url).href
2
2
  export default {
3
3
  type: 'simple-switch',
4
4
  description: 'simple-switch',
5
- group: 'IoT',
6
- /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */
5
+ group: 'form',
6
+ /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|3D|facility|storage|conveyance|transport|form|etc */
7
7
  icon,
8
8
  model: {
9
9
  type: 'simple-switch',
@@ -1 +1 @@
1
- {"version":3,"file":"simple-switch.js","sourceRoot":"","sources":["../../src/templates/simple-switch.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,oCAAoC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEhF,eAAe;IACb,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,KAAK,EAAE,KAAK;IACZ,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,EAAE;QACV,cAAc,EAAE,SAAS;QACzB,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,SAAS;KACpB;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/icon-simple-switch.png', import.meta.url).href\n\nexport default {\n type: 'simple-switch',\n description: 'simple-switch',\n group: 'IoT',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'simple-switch',\n left: 10,\n top: 10,\n width: 100,\n height: 40,\n thumbnailColor: '#ffffff',\n onColor: '#2196f3',\n offColor: '#cccccc'\n }\n}\n"]}
1
+ {"version":3,"file":"simple-switch.js","sourceRoot":"","sources":["../../src/templates/simple-switch.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,oCAAoC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEhF,eAAe;IACb,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,KAAK,EAAE,MAAM;IACb,wHAAwH;IACxH,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,EAAE;QACV,cAAc,EAAE,SAAS;QACzB,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,SAAS;KACpB;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/icon-simple-switch.png', import.meta.url).href\n\nexport default {\n type: 'simple-switch',\n description: 'simple-switch',\n group: 'form',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|3D|facility|storage|conveyance|transport|form|etc */\n icon,\n model: {\n type: 'simple-switch',\n left: 10,\n top: 10,\n width: 100,\n height: 40,\n thumbnailColor: '#ffffff',\n onColor: '#2196f3',\n offColor: '#cccccc'\n }\n}\n"]}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/scene-switch",
3
3
  "description": "switch component for operato-scene",
4
4
  "author": "heartyoh",
5
- "version": "10.0.0-beta.1",
5
+ "version": "10.0.0-beta.22",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.js",
@@ -59,5 +59,5 @@
59
59
  "prettier --write"
60
60
  ]
61
61
  },
62
- "gitHead": "bb127dd516b9e962fb2d0a24bc2d8c5e108f06fb"
62
+ "gitHead": "f48e52f4f5fdc30ec06af9da7cf253f6e29cfb0e"
63
63
  }