@operato/scene-switch 10.0.0-beta.2 → 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
|
-
#
|
|
1
|
+
# @operato/scene-switch
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> switch component for operato-scene
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
##
|
|
16
|
-
|
|
17
|
-
To scan the project for linting and formatting errors, run
|
|
7
|
+
## Install
|
|
18
8
|
|
|
19
9
|
```bash
|
|
20
|
-
|
|
10
|
+
yarn add @operato/scene-switch
|
|
21
11
|
```
|
|
22
12
|
|
|
23
|
-
|
|
13
|
+
## Build
|
|
24
14
|
|
|
25
15
|
```bash
|
|
26
|
-
|
|
16
|
+
yarn build
|
|
27
17
|
```
|
|
28
18
|
|
|
29
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
npm start
|
|
39
|
-
```
|
|
21
|
+
_Version: 10.0.0-beta.4_
|
|
40
22
|
|
|
41
|
-
|
|
23
|
+
<!-- AUTOGEN_END -->
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-switch-element.js","sourceRoot":"","sources":["../src/simple-switch-element.ts"],"names":[],"mappings":";AAAA,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d;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: '
|
|
6
|
-
/* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|
|
|
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,
|
|
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.
|
|
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": "
|
|
62
|
+
"gitHead": "f48e52f4f5fdc30ec06af9da7cf253f6e29cfb0e"
|
|
63
63
|
}
|