@operato/scene-switch 9.0.0-beta.1 → 9.0.0-beta.2
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/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/simple-switch.d.ts +2 -2
- package/dist/simple-switch.js +1 -1
- package/dist/simple-switch.js.map +1 -1
- package/dist/templates/index.js +1 -1
- package/dist/templates/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,oBAAoB,CAAA;AAC7C,eAAe,CAAC,YAAY,CAAC,CAAA","sourcesContent":["import SimpleSwitch from './simple-switch.js'\nexport default [SimpleSwitch]\n"]}
|
package/dist/simple-switch.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import './simple-switch-element';
|
|
1
|
+
import './simple-switch-element.js';
|
|
2
2
|
import { ComponentNature, HTMLOverlayElement } from '@hatiolab/things-scene';
|
|
3
|
-
import { SimpleSwitchElement } from './simple-switch-element';
|
|
3
|
+
import { SimpleSwitchElement } from './simple-switch-element.js';
|
|
4
4
|
export default class SimpleSwitch extends HTMLOverlayElement {
|
|
5
5
|
get nature(): ComponentNature;
|
|
6
6
|
oncreate_element(toggle: SimpleSwitchElement): void;
|
package/dist/simple-switch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-switch.js","sourceRoot":"","sources":["../src/simple-switch.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"simple-switch.js","sourceRoot":"","s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QAAQ,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAEnE,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA;QACpB,MAAM,CAAC,KAAK,GAAG,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,CAAA;QAErC,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,6BAA6B,EAAE,OAAO,CAAC,CAAA;QAC3E,QAAQ,IAAI,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,8BAA8B,EAAE,QAAQ,CAAC,CAAA;QAC9E,cAAc,IAAI,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,oCAAoC,EAAE,cAAc,CAAC,CAAA;IAClG,CAAC;IAED;;;OAGG;IACH,UAAU;QACR,KAAK,CAAC,UAAU,EAAE,CAAA;QAElB,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE1B,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAM;QACR,CAAC;QAED,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAEnC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,8BAA8B,EAAE,GAAG,KAAK,IAAI,CAAC,CAAA;QACvE,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,+BAA+B,EAAE,GAAG,MAAM,IAAI,CAAC,CAAA;QACzE,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,mCAAmC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;IAChG,CAAC;IAED,IAAI,OAAO;QACT,OAAO,kBAAkB,CAAA;IAC3B,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,YAAY,CAAC,CAAA","sourcesContent":["import './simple-switch-element.js'\n\nimport { Component, ComponentNature, HTMLOverlayElement } from '@hatiolab/things-scene'\n\nimport { SimpleSwitchElement } from './simple-switch-element.js'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'checkbox',\n label: 'round',\n name: 'round'\n },\n {\n type: 'checkbox',\n label: 'on/off',\n name: 'data'\n },\n {\n type: 'color',\n label: 'on-color',\n name: 'onColor'\n },\n {\n type: 'color',\n label: 'off-color',\n name: 'offColor'\n },\n {\n type: 'color',\n label: 'thumbnail-color',\n name: 'thumbnailColor'\n }\n ],\n 'value-property': 'data',\n help: 'scene/component/simple-switch'\n}\n\nexport default class SimpleSwitch extends HTMLOverlayElement {\n get nature() {\n return NATURE\n }\n\n oncreate_element(toggle: SimpleSwitchElement) {\n toggle.addEventListener('value-change', (e: Event) => {\n var checked = (e as CustomEvent).detail\n\n this.setState({\n data: checked\n })\n })\n }\n\n dispose() {\n super.dispose()\n }\n\n /*\n * 컴포넌트의 생성 또는 속성 변화 시에 호출되며,\n * 그에 따른 html element의 반영이 필요한 부분을 구현한다.\n *\n * ThingsComponent state => HTML element properties\n */\n setElementProperties(toggle: SimpleSwitchElement) {\n var { round, data, onColor, offColor, thumbnailColor } = this.state\n\n toggle.round = round\n toggle.value = 'true' == String(data)\n\n onColor && toggle.style.setProperty('--ox-simple-switch-on-color', onColor)\n offColor && toggle.style.setProperty('--ox-simple-switch-off-color', offColor)\n thumbnailColor && toggle.style.setProperty('--ox-simple-switch-thumbnail-color', thumbnailColor)\n }\n\n /*\n * 컴포넌트가 ready 상태가 되거나, 컴포넌트의 속성이 변화될 시 setElementProperties 뒤에 호출된다.\n * 변화에 따른 기본적인 html 속성이 super.reposition()에서 진행되고, 그 밖의 작업이 필요할 때, 오버라이드 한다.\n */\n reposition() {\n super.reposition()\n\n var element = this.element\n\n if (!element) {\n return\n }\n\n var { height, width } = this.bounds\n\n element.style.setProperty('--ox-simple-switch-fullwidth', `${width}px`)\n element.style.setProperty('--ox-simple-switch-fullheight', `${height}px`)\n element.style.setProperty('--ox-simple-switch-thumbnail-size', `${Math.min(height, width)}px`)\n }\n\n get tagName() {\n return 'ox-simple-switch'\n }\n}\n\nComponent.register('simple-switch', SimpleSwitch)\n"]}
|
package/dist/templates/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,oBAAoB,CAAA;AAE7C,eAAe,CAAC,YAAY,CAAC,CAAA","sourcesContent":["import simpleSwitch from './simple-switch.js'\n\nexport default [simpleSwitch]\n"]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
"name": "@operato/scene-switch",
|
|
3
3
|
"description": "switch component for operato-scene",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "9.0.0-beta.
|
|
5
|
+
"version": "9.0.0-beta.2",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"main": "dist/index.js",
|
|
7
8
|
"module": "dist/index.js",
|
|
8
9
|
"license": "MIT",
|
|
@@ -58,5 +59,5 @@
|
|
|
58
59
|
"prettier --write"
|
|
59
60
|
]
|
|
60
61
|
},
|
|
61
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "69866123dfa29ef31089a5862be17832449fae1f"
|
|
62
63
|
}
|