@fmsim/board 0.0.49
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/.storybook/main.js +3 -0
- package/.storybook/server.mjs +8 -0
- package/custom-elements.json +6500 -0
- package/demo/index-modeller.html +102 -0
- package/demo/index-player.html +101 -0
- package/demo/index-viewer.html +101 -0
- package/demo/index.html +101 -0
- package/dist/src/component/etc.d.ts +2 -0
- package/dist/src/component/etc.js +104 -0
- package/dist/src/component/etc.js.map +1 -0
- package/dist/src/component/index.d.ts +1 -0
- package/dist/src/component/index.js +2 -0
- package/dist/src/component/index.js.map +1 -0
- package/dist/src/component/register-default-groups.d.ts +1 -0
- package/dist/src/component/register-default-groups.js +6 -0
- package/dist/src/component/register-default-groups.js.map +1 -0
- package/dist/src/data-storage/data-storage.d.ts +8 -0
- package/dist/src/data-storage/data-storage.js +28 -0
- package/dist/src/data-storage/data-storage.js.map +1 -0
- package/dist/src/graphql/board.d.ts +6 -0
- package/dist/src/graphql/board.js +139 -0
- package/dist/src/graphql/board.js.map +1 -0
- package/dist/src/graphql/data-subscription.d.ts +5 -0
- package/dist/src/graphql/data-subscription.js +24 -0
- package/dist/src/graphql/data-subscription.js.map +1 -0
- package/dist/src/graphql/favorite-board.d.ts +1 -0
- package/dist/src/graphql/favorite-board.js +23 -0
- package/dist/src/graphql/favorite-board.js.map +1 -0
- package/dist/src/graphql/group.d.ts +7 -0
- package/dist/src/graphql/group.js +125 -0
- package/dist/src/graphql/group.js.map +1 -0
- package/dist/src/graphql/index.d.ts +4 -0
- package/dist/src/graphql/index.js +5 -0
- package/dist/src/graphql/index.js.map +1 -0
- package/dist/src/graphql/play-group.d.ts +8 -0
- package/dist/src/graphql/play-group.js +173 -0
- package/dist/src/graphql/play-group.js.map +1 -0
- package/dist/src/graphql/scenario.d.ts +6 -0
- package/dist/src/graphql/scenario.js +69 -0
- package/dist/src/graphql/scenario.js.map +1 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/index.js +7 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/layers/bouncing-arrow-decorator.d.ts +1 -0
- package/dist/src/layers/bouncing-arrow-decorator.js +40 -0
- package/dist/src/layers/bouncing-arrow-decorator.js.map +1 -0
- package/dist/src/layers/event-handlers.d.ts +1 -0
- package/dist/src/layers/event-handlers.js +70 -0
- package/dist/src/layers/event-handlers.js.map +1 -0
- package/dist/src/layers/mcs-event-handlers.d.ts +1 -0
- package/dist/src/layers/mcs-event-handlers.js +73 -0
- package/dist/src/layers/mcs-event-handlers.js.map +1 -0
- package/dist/src/layers/movement-layer.d.ts +27 -0
- package/dist/src/layers/movement-layer.js +109 -0
- package/dist/src/layers/movement-layer.js.map +1 -0
- package/dist/src/layers/ox-mini-map.d.ts +1 -0
- package/dist/src/layers/ox-mini-map.js +189 -0
- package/dist/src/layers/ox-mini-map.js.map +1 -0
- package/dist/src/layers/scroll-layer.d.ts +24 -0
- package/dist/src/layers/scroll-layer.js +125 -0
- package/dist/src/layers/scroll-layer.js.map +1 -0
- package/dist/src/layers/shift-handler.d.ts +1 -0
- package/dist/src/layers/shift-handler.js +38 -0
- package/dist/src/layers/shift-handler.js.map +1 -0
- package/dist/src/layers/zoom-handler.d.ts +1 -0
- package/dist/src/layers/zoom-handler.js +36 -0
- package/dist/src/layers/zoom-handler.js.map +1 -0
- package/dist/src/modeller/component-toolbar/component-detail.d.ts +12 -0
- package/dist/src/modeller/component-toolbar/component-detail.js +53 -0
- package/dist/src/modeller/component-toolbar/component-detail.js.map +1 -0
- package/dist/src/modeller/component-toolbar/component-menu.d.ts +27 -0
- package/dist/src/modeller/component-toolbar/component-menu.js +192 -0
- package/dist/src/modeller/component-toolbar/component-menu.js.map +1 -0
- package/dist/src/modeller/component-toolbar/component-toolbar.d.ts +30 -0
- package/dist/src/modeller/component-toolbar/component-toolbar.js +188 -0
- package/dist/src/modeller/component-toolbar/component-toolbar.js.map +1 -0
- package/dist/src/modeller/component-toolbar/mode-icons.d.ts +2 -0
- package/dist/src/modeller/component-toolbar/mode-icons.js +86 -0
- package/dist/src/modeller/component-toolbar/mode-icons.js.map +1 -0
- package/dist/src/modeller/edit-toolbar-style.d.ts +4 -0
- package/dist/src/modeller/edit-toolbar-style.js +227 -0
- package/dist/src/modeller/edit-toolbar-style.js.map +1 -0
- package/dist/src/modeller/edit-toolbar.d.ts +61 -0
- package/dist/src/modeller/edit-toolbar.js +646 -0
- package/dist/src/modeller/edit-toolbar.js.map +1 -0
- package/dist/src/modeller/property-sidebar/abstract-property.d.ts +10 -0
- package/dist/src/modeller/property-sidebar/abstract-property.js +55 -0
- package/dist/src/modeller/property-sidebar/abstract-property.js.map +1 -0
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-mapper.d.ts +54 -0
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-mapper.js +392 -0
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-mapper.js.map +1 -0
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-value-map.d.ts +6 -0
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-value-map.js +19 -0
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-value-map.js.map +1 -0
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-value-range.d.ts +6 -0
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-value-range.js +19 -0
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-value-range.js.map +1 -0
- package/dist/src/modeller/property-sidebar/data-binding/data-binding.d.ts +43 -0
- package/dist/src/modeller/property-sidebar/data-binding/data-binding.js +416 -0
- package/dist/src/modeller/property-sidebar/data-binding/data-binding.js.map +1 -0
- package/dist/src/modeller/property-sidebar/effects/effects-shared-style.d.ts +4 -0
- package/dist/src/modeller/property-sidebar/effects/effects-shared-style.js +61 -0
- package/dist/src/modeller/property-sidebar/effects/effects-shared-style.js.map +1 -0
- package/dist/src/modeller/property-sidebar/effects/effects.d.ts +22 -0
- package/dist/src/modeller/property-sidebar/effects/effects.js +46 -0
- package/dist/src/modeller/property-sidebar/effects/effects.js.map +1 -0
- package/dist/src/modeller/property-sidebar/effects/property-event-hover.d.ts +20 -0
- package/dist/src/modeller/property-sidebar/effects/property-event-hover.js +128 -0
- package/dist/src/modeller/property-sidebar/effects/property-event-hover.js.map +1 -0
- package/dist/src/modeller/property-sidebar/effects/property-event-tap.d.ts +28 -0
- package/dist/src/modeller/property-sidebar/effects/property-event-tap.js +190 -0
- package/dist/src/modeller/property-sidebar/effects/property-event-tap.js.map +1 -0
- package/dist/src/modeller/property-sidebar/effects/property-event.d.ts +22 -0
- package/dist/src/modeller/property-sidebar/effects/property-event.js +55 -0
- package/dist/src/modeller/property-sidebar/effects/property-event.js.map +1 -0
- package/dist/src/modeller/property-sidebar/effects/property-shadow.d.ts +23 -0
- package/dist/src/modeller/property-sidebar/effects/property-shadow.js +103 -0
- package/dist/src/modeller/property-sidebar/effects/property-shadow.js.map +1 -0
- package/dist/src/modeller/property-sidebar/effects/value-converter.d.ts +1 -0
- package/dist/src/modeller/property-sidebar/effects/value-converter.js +21 -0
- package/dist/src/modeller/property-sidebar/effects/value-converter.js.map +1 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector.d.ts +29 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector.js +334 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector.js.map +1 -0
- package/dist/src/modeller/property-sidebar/property-shared-style.d.ts +4 -0
- package/dist/src/modeller/property-sidebar/property-shared-style.js +135 -0
- package/dist/src/modeller/property-sidebar/property-shared-style.js.map +1 -0
- package/dist/src/modeller/property-sidebar/property-sidebar.d.ts +47 -0
- package/dist/src/modeller/property-sidebar/property-sidebar.js +324 -0
- package/dist/src/modeller/property-sidebar/property-sidebar.js.map +1 -0
- package/dist/src/modeller/property-sidebar/shapes/box-padding-editor-styles.d.ts +1 -0
- package/dist/src/modeller/property-sidebar/shapes/box-padding-editor-styles.js +94 -0
- package/dist/src/modeller/property-sidebar/shapes/box-padding-editor-styles.js.map +1 -0
- package/dist/src/modeller/property-sidebar/shapes/shapes.d.ts +25 -0
- package/dist/src/modeller/property-sidebar/shapes/shapes.js +354 -0
- package/dist/src/modeller/property-sidebar/shapes/shapes.js.map +1 -0
- package/dist/src/modeller/property-sidebar/specifics/specific-properties-builder.d.ts +16 -0
- package/dist/src/modeller/property-sidebar/specifics/specific-properties-builder.js +132 -0
- package/dist/src/modeller/property-sidebar/specifics/specific-properties-builder.js.map +1 -0
- package/dist/src/modeller/property-sidebar/specifics/specifics.d.ts +28 -0
- package/dist/src/modeller/property-sidebar/specifics/specifics.js +129 -0
- package/dist/src/modeller/property-sidebar/specifics/specifics.js.map +1 -0
- package/dist/src/modeller/property-sidebar/styles/styles.d.ts +21 -0
- package/dist/src/modeller/property-sidebar/styles/styles.js +559 -0
- package/dist/src/modeller/property-sidebar/styles/styles.js.map +1 -0
- package/dist/src/modeller/scene-viewer/confidential-overlay.d.ts +4 -0
- package/dist/src/modeller/scene-viewer/confidential-overlay.js +14 -0
- package/dist/src/modeller/scene-viewer/confidential-overlay.js.map +1 -0
- package/dist/src/modeller/scene-viewer/ox-scene-handler.d.ts +11 -0
- package/dist/src/modeller/scene-viewer/ox-scene-handler.js +36 -0
- package/dist/src/modeller/scene-viewer/ox-scene-handler.js.map +1 -0
- package/dist/src/modeller/scene-viewer/ox-scene-layer.d.ts +10 -0
- package/dist/src/modeller/scene-viewer/ox-scene-layer.js +42 -0
- package/dist/src/modeller/scene-viewer/ox-scene-layer.js.map +1 -0
- package/dist/src/modeller/scene-viewer/ox-scene-property.d.ts +6 -0
- package/dist/src/modeller/scene-viewer/ox-scene-property.js +19 -0
- package/dist/src/modeller/scene-viewer/ox-scene-property.js.map +1 -0
- package/dist/src/modeller/scene-viewer/ox-scene-viewer.d.ts +40 -0
- package/dist/src/modeller/scene-viewer/ox-scene-viewer.js +253 -0
- package/dist/src/modeller/scene-viewer/ox-scene-viewer.js.map +1 -0
- package/dist/src/ox-board-list.d.ts +2 -0
- package/dist/src/ox-board-list.js +425 -0
- package/dist/src/ox-board-list.js.map +1 -0
- package/dist/src/ox-board-modeller.d.ts +57 -0
- package/dist/src/ox-board-modeller.js +401 -0
- package/dist/src/ox-board-modeller.js.map +1 -0
- package/dist/src/ox-board-viewer-backup.d.ts +64 -0
- package/dist/src/ox-board-viewer-backup.js +529 -0
- package/dist/src/ox-board-viewer-backup.js.map +1 -0
- package/dist/src/ox-board-viewer-other.d.ts +19 -0
- package/dist/src/ox-board-viewer-other.js +82 -0
- package/dist/src/ox-board-viewer-other.js.map +1 -0
- package/dist/src/ox-board-viewer.d.ts +60 -0
- package/dist/src/ox-board-viewer.js +503 -0
- package/dist/src/ox-board-viewer.js.map +1 -0
- package/dist/src/ox-editor-board-selector.d.ts +15 -0
- package/dist/src/ox-editor-board-selector.js +85 -0
- package/dist/src/ox-editor-board-selector.js.map +1 -0
- package/dist/src/ox-property-editor-board-selector.d.ts +4 -0
- package/dist/src/ox-property-editor-board-selector.js +22 -0
- package/dist/src/ox-property-editor-board-selector.js.map +1 -0
- package/dist/src/ox-property-editor-theme.d.ts +19 -0
- package/dist/src/ox-property-editor-theme.js +111 -0
- package/dist/src/ox-property-editor-theme.js.map +1 -0
- package/dist/src/selector/board-creation-popup.d.ts +19 -0
- package/dist/src/selector/board-creation-popup.js +100 -0
- package/dist/src/selector/board-creation-popup.js.map +1 -0
- package/dist/src/selector/board-thumbnail-card.d.ts +15 -0
- package/dist/src/selector/board-thumbnail-card.js +168 -0
- package/dist/src/selector/board-thumbnail-card.js.map +1 -0
- package/dist/src/selector/ox-board-creation-card.d.ts +14 -0
- package/dist/src/selector/ox-board-creation-card.js +84 -0
- package/dist/src/selector/ox-board-creation-card.js.map +1 -0
- package/dist/src/selector/ox-board-selector.d.ts +45 -0
- package/dist/src/selector/ox-board-selector.js +273 -0
- package/dist/src/selector/ox-board-selector.js.map +1 -0
- package/dist/src/types.d.ts +37 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/stories/index.stories.d.ts +33 -0
- package/dist/stories/index.stories.js +33 -0
- package/dist/stories/index.stories.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/icons/components/dash.png +0 -0
- package/icons/components/ellipse.png +0 -0
- package/icons/components/line.png +0 -0
- package/icons/components/no-image.png +0 -0
- package/icons/components/popup.png +0 -0
- package/icons/components/rect.png +0 -0
- package/icons/icon-collapse-active.png +0 -0
- package/icons/icon-collapse.png +0 -0
- package/icons/icon-fullscreen.png +0 -0
- package/icons/icon-htoolbar.png +0 -0
- package/icons/icon-properties-arrow-type.png +0 -0
- package/icons/icon-properties-gradient-direction.png +0 -0
- package/icons/icon-properties-label.png +0 -0
- package/icons/icon-properties-line-type.png +0 -0
- package/icons/icon-properties-padding.png +0 -0
- package/icons/icon-properties-ratio.png +0 -0
- package/icons/icon-properties-table.png +0 -0
- package/icons/icon-properties.png +0 -0
- package/icons/icon-shell-inspector.png +0 -0
- package/package.json +149 -0
- package/stories/index.stories.ts +52 -0
- package/web-dev-server.config.mjs +30 -0
- package/web-test-runner.config.mjs +29 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { __decorate } from "tslib";
|
|
5
|
+
import '@operato/i18n/ox-i18n.js';
|
|
6
|
+
import '@operato/help/ox-title-with-help.js';
|
|
7
|
+
import { html } from 'lit';
|
|
8
|
+
import { property } from 'lit/decorators.js';
|
|
9
|
+
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
10
|
+
import { AbstractProperty } from '../abstract-property.js';
|
|
11
|
+
import { PropertySharedStyle } from '../property-shared-style.js';
|
|
12
|
+
import { PropertyEvent } from './property-event.js';
|
|
13
|
+
import { PropertyShadow } from './property-shadow.js';
|
|
14
|
+
export class PropertyEffects extends ScopedElementsMixin(AbstractProperty) {
|
|
15
|
+
firstUpdated() {
|
|
16
|
+
this.renderRoot.addEventListener('change', this._onValueChange.bind(this));
|
|
17
|
+
}
|
|
18
|
+
static get scopedElements() {
|
|
19
|
+
return {
|
|
20
|
+
'property-shadow': PropertyShadow,
|
|
21
|
+
'property-event': PropertyEvent
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
const value = this.value || {};
|
|
26
|
+
return html `
|
|
27
|
+
<fieldset>
|
|
28
|
+
<legend>
|
|
29
|
+
<ox-title-with-help topic="board-modeller/effects/shadow" msgid="label.shadow">shadow</ox-title-with-help>
|
|
30
|
+
</legend>
|
|
31
|
+
|
|
32
|
+
<property-shadow value-key="shadow" .value=${value.shadow || {}}> </property-shadow>
|
|
33
|
+
</fieldset>
|
|
34
|
+
|
|
35
|
+
<property-event value-key="event" .scene=${this.scene} .value=${value.event || {}}> </property-event>
|
|
36
|
+
`;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
PropertyEffects.styles = [PropertySharedStyle];
|
|
40
|
+
__decorate([
|
|
41
|
+
property({ type: Object })
|
|
42
|
+
], PropertyEffects.prototype, "value", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
property({ type: Object })
|
|
45
|
+
], PropertyEffects.prototype, "scene", void 0);
|
|
46
|
+
//# sourceMappingURL=effects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effects.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/effects/effects.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,0BAA0B,CAAA;AACjC,OAAO,qCAAqC,CAAA;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,MAAM,OAAO,eAAgB,SAAQ,mBAAmB,CAAC,gBAAgB,CAAC;IAMxE,YAAY;QACV,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IAC5E,CAAC;IAED,MAAM,KAAK,cAAc;QACvB,OAAO;YACL,iBAAiB,EAAE,cAAc;YACjC,gBAAgB,EAAE,aAAa;SAChC,CAAA;IACH,CAAC;IAED,MAAM;QACJ,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;QAE9B,OAAO,IAAI,CAAA;;;;;;qDAMsC,KAAK,CAAC,MAAM,IAAI,EAAE;;;iDAGtB,IAAI,CAAC,KAAK,WAAW,KAAK,CAAC,KAAK,IAAI,EAAE;KAClF,CAAA;IACH,CAAC;;AA9BM,sBAAM,GAAG,CAAC,mBAAmB,CAAC,CAAA;AAET;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAmB;AAClB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAc","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@operato/i18n/ox-i18n.js'\nimport '@operato/help/ox-title-with-help.js'\n\nimport { html } from 'lit'\nimport { property } from 'lit/decorators.js'\n\nimport { Properties, Scene } from '@hatiolab/things-scene'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\n\nimport { AbstractProperty } from '../abstract-property.js'\nimport { PropertySharedStyle } from '../property-shared-style.js'\nimport { PropertyEvent } from './property-event.js'\nimport { PropertyShadow } from './property-shadow.js'\n\nexport class PropertyEffects extends ScopedElementsMixin(AbstractProperty) {\n static styles = [PropertySharedStyle]\n\n @property({ type: Object }) value?: Properties\n @property({ type: Object }) scene?: Scene\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', this._onValueChange.bind(this))\n }\n\n static get scopedElements() {\n return {\n 'property-shadow': PropertyShadow,\n 'property-event': PropertyEvent\n }\n }\n\n render() {\n const value = this.value || {}\n\n return html`\n <fieldset>\n <legend>\n <ox-title-with-help topic=\"board-modeller/effects/shadow\" msgid=\"label.shadow\">shadow</ox-title-with-help>\n </legend>\n\n <property-shadow value-key=\"shadow\" .value=${value.shadow || {}}> </property-shadow>\n </fieldset>\n\n <property-event value-key=\"event\" .scene=${this.scene} .value=${value.event || {}}> </property-event>\n `\n }\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import '@operato/input/ox-input-data.js';
|
|
5
|
+
import '@operato/i18n/ox-i18n.js';
|
|
6
|
+
import { LitElement } from 'lit';
|
|
7
|
+
import { Properties, Scene } from '@hatiolab/things-scene';
|
|
8
|
+
export declare class PropertyEventHover extends LitElement {
|
|
9
|
+
static styles: import("lit").CSSResult[];
|
|
10
|
+
value?: Properties;
|
|
11
|
+
scene?: Scene;
|
|
12
|
+
firstUpdated(): void;
|
|
13
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
14
|
+
_getPlaceHoder(action: string): "" | "SCENE-100" | "http://www.hatiolab.com/";
|
|
15
|
+
_getTargetList(action: string): {
|
|
16
|
+
value: string;
|
|
17
|
+
description: string;
|
|
18
|
+
}[];
|
|
19
|
+
_onValueChange(e: Event): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { __decorate } from "tslib";
|
|
5
|
+
import '@operato/input/ox-input-data.js';
|
|
6
|
+
import '@operato/i18n/ox-i18n.js';
|
|
7
|
+
import { html, LitElement } from 'lit';
|
|
8
|
+
import { property } from 'lit/decorators.js';
|
|
9
|
+
import { EffectsSharedStyle } from './effects-shared-style.js';
|
|
10
|
+
import { convert } from './value-converter';
|
|
11
|
+
export class PropertyEventHover extends LitElement {
|
|
12
|
+
firstUpdated() {
|
|
13
|
+
this.renderRoot.addEventListener('change', this._onValueChange.bind(this));
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
var { action, value = '', target = '', emphasize, restore } = this.value || {};
|
|
17
|
+
return html `
|
|
18
|
+
<input id="checkbox-emphasize" type="checkbox" value-key="emphasize" .checked=${emphasize} />
|
|
19
|
+
<label for="checkbox-emphasize" class="checkbox-label">
|
|
20
|
+
<ox-i18n msgid="label.emphasize">emphasize</ox-i18n>
|
|
21
|
+
</label>
|
|
22
|
+
|
|
23
|
+
<label> <ox-i18n msgid="label.action">action</ox-i18n> </label>
|
|
24
|
+
<select id="tap-select" value-key="action" .value=${action || ''}>
|
|
25
|
+
<option value=""></option>
|
|
26
|
+
<option value="popup">popup target board</option>
|
|
27
|
+
<option value="infoWindow">open infowindow</option>
|
|
28
|
+
<option value="data-toggle">toggle(true/false) target component data</option>
|
|
29
|
+
<option value="data-tristate">tristate(0/1/2) target component data</option>
|
|
30
|
+
<option value="data-set">set value to target component data</option>
|
|
31
|
+
<option value="value-set">set value to target component value</option>
|
|
32
|
+
</select>
|
|
33
|
+
|
|
34
|
+
<label> <ox-i18n msgid="label.target">target</ox-i18n> </label>
|
|
35
|
+
|
|
36
|
+
${action == 'popup'
|
|
37
|
+
? html `
|
|
38
|
+
<ox-editor-board-selector value-key="target" .value=${target} custom-editor></ox-editor-board-selector>
|
|
39
|
+
`
|
|
40
|
+
: html `
|
|
41
|
+
<input
|
|
42
|
+
value-key="target"
|
|
43
|
+
.value=${target || ''}
|
|
44
|
+
list="target-list"
|
|
45
|
+
.placeholder="${this._getPlaceHoder(action)}"
|
|
46
|
+
/>
|
|
47
|
+
|
|
48
|
+
<datalist id="target-list">
|
|
49
|
+
${this._getTargetList(action).map(({ value, description }) => html ` <option .value=${value}>${description}</option> `)}
|
|
50
|
+
</datalist>
|
|
51
|
+
`}
|
|
52
|
+
${action == 'data-set' || action == 'value-set'
|
|
53
|
+
? html `
|
|
54
|
+
<label> <ox-i18n msgid="label.value">value</ox-i18n> </label>
|
|
55
|
+
<ox-input-data value-key="value" .value=${value} custom-editor fullwidth></ox-input-data>
|
|
56
|
+
`
|
|
57
|
+
: html ``}
|
|
58
|
+
|
|
59
|
+
<input id="checkbox-restore" type="checkbox" value-key="restore" .checked=${restore} />
|
|
60
|
+
<label for="checkbox-restore" class="checkbox-label">
|
|
61
|
+
<ox-i18n msgid="label.restore-on-leave">restore on leave</ox-i18n>
|
|
62
|
+
</label>
|
|
63
|
+
`;
|
|
64
|
+
}
|
|
65
|
+
_getPlaceHoder(action) {
|
|
66
|
+
switch (action) {
|
|
67
|
+
case 'popup':
|
|
68
|
+
case 'goto':
|
|
69
|
+
return 'SCENE-100';
|
|
70
|
+
case 'link-open':
|
|
71
|
+
case 'link-move':
|
|
72
|
+
return 'http://www.hatiolab.com/';
|
|
73
|
+
default:
|
|
74
|
+
return '';
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
_getTargetList(action) {
|
|
78
|
+
switch (action) {
|
|
79
|
+
case 'data-toggle':
|
|
80
|
+
case 'data-tristate':
|
|
81
|
+
case 'data-set':
|
|
82
|
+
case 'value-set':
|
|
83
|
+
let ids = (this.scene &&
|
|
84
|
+
this.scene.ids.map(i => {
|
|
85
|
+
var _a;
|
|
86
|
+
const id = i.key;
|
|
87
|
+
return { value: `#${id}`, description: (_a = this.scene.findById(id)) === null || _a === void 0 ? void 0 : _a.get('type') };
|
|
88
|
+
})) ||
|
|
89
|
+
[];
|
|
90
|
+
ids.unshift({ value: '(self)', description: 'self component' });
|
|
91
|
+
return ids;
|
|
92
|
+
case 'infoWindow':
|
|
93
|
+
return ((this.scene &&
|
|
94
|
+
this.scene.ids
|
|
95
|
+
.filter(i => {
|
|
96
|
+
return this.scene.findById(i.key).get('type') == 'info-window';
|
|
97
|
+
})
|
|
98
|
+
.map(i => {
|
|
99
|
+
var _a;
|
|
100
|
+
const id = i.key;
|
|
101
|
+
return { value: `#${id}`, description: (_a = this.scene.findById(id)) === null || _a === void 0 ? void 0 : _a.get('type') };
|
|
102
|
+
})) ||
|
|
103
|
+
[]);
|
|
104
|
+
default:
|
|
105
|
+
return [];
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
_onValueChange(e) {
|
|
109
|
+
var element = e.target;
|
|
110
|
+
var key = element.getAttribute('value-key');
|
|
111
|
+
if (!key) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
this.value = {
|
|
115
|
+
...this.value,
|
|
116
|
+
[key]: convert(element)
|
|
117
|
+
};
|
|
118
|
+
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
PropertyEventHover.styles = [EffectsSharedStyle];
|
|
122
|
+
__decorate([
|
|
123
|
+
property({ type: Object })
|
|
124
|
+
], PropertyEventHover.prototype, "value", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
property({ type: Object })
|
|
127
|
+
], PropertyEventHover.prototype, "scene", void 0);
|
|
128
|
+
//# sourceMappingURL=property-event-hover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-event-hover.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/effects/property-event-hover.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,iCAAiC,CAAA;AACxC,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAI5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;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C,CAAQ;QACrB,IAAI,OAAO,GAAG,CAAC,CAAC,MAAqB,CAAA;QACrC,IAAI,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAA;QAE3C,IAAI,CAAC,GAAG,EAAE;YACR,OAAM;SACP;QAED,IAAI,CAAC,KAAK,GAAG;YACX,GAAG,IAAI,CAAC,KAAK;YACb,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC;SACxB,CAAA;QAED,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAClF,CAAC;;AA3HM,yBAAM,GAAG,CAAC,kBAAkB,CAAC,CAAA;AAER;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAmB;AAClB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAc","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@operato/input/ox-input-data.js'\nimport '@operato/i18n/ox-i18n.js'\n\nimport { html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\nimport { Properties, Scene } from '@hatiolab/things-scene'\n\nimport { EffectsSharedStyle } from './effects-shared-style.js'\nimport { convert } from './value-converter'\n\nexport class PropertyEventHover extends LitElement {\n static styles = [EffectsSharedStyle]\n\n @property({ type: Object }) value?: Properties\n @property({ type: Object }) scene?: Scene\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', this._onValueChange.bind(this))\n }\n\n render() {\n var { action, value = '', target = '', emphasize, restore } = this.value || {}\n\n return html`\n <input id=\"checkbox-emphasize\" type=\"checkbox\" value-key=\"emphasize\" .checked=${emphasize} />\n <label for=\"checkbox-emphasize\" class=\"checkbox-label\">\n <ox-i18n msgid=\"label.emphasize\">emphasize</ox-i18n>\n </label>\n\n <label> <ox-i18n msgid=\"label.action\">action</ox-i18n> </label>\n <select id=\"tap-select\" value-key=\"action\" .value=${action || ''}>\n <option value=\"\"></option>\n <option value=\"popup\">popup target board</option>\n <option value=\"infoWindow\">open infowindow</option>\n <option value=\"data-toggle\">toggle(true/false) target component data</option>\n <option value=\"data-tristate\">tristate(0/1/2) target component data</option>\n <option value=\"data-set\">set value to target component data</option>\n <option value=\"value-set\">set value to target component value</option>\n </select>\n\n <label> <ox-i18n msgid=\"label.target\">target</ox-i18n> </label>\n\n ${action == 'popup'\n ? html`\n <ox-editor-board-selector value-key=\"target\" .value=${target} custom-editor></ox-editor-board-selector>\n `\n : html`\n <input\n value-key=\"target\"\n .value=${target || ''}\n list=\"target-list\"\n .placeholder=\"${this._getPlaceHoder(action)}\"\n />\n\n <datalist id=\"target-list\">\n ${this._getTargetList(action).map(\n ({ value, description }) => html` <option .value=${value}>${description}</option> `\n )}\n </datalist>\n `}\n ${action == 'data-set' || action == 'value-set'\n ? html`\n <label> <ox-i18n msgid=\"label.value\">value</ox-i18n> </label>\n <ox-input-data value-key=\"value\" .value=${value} custom-editor fullwidth></ox-input-data>\n `\n : html``}\n\n <input id=\"checkbox-restore\" type=\"checkbox\" value-key=\"restore\" .checked=${restore} />\n <label for=\"checkbox-restore\" class=\"checkbox-label\">\n <ox-i18n msgid=\"label.restore-on-leave\">restore on leave</ox-i18n>\n </label>\n `\n }\n\n _getPlaceHoder(action: string) {\n switch (action) {\n case 'popup':\n case 'goto':\n return 'SCENE-100'\n case 'link-open':\n case 'link-move':\n return 'http://www.hatiolab.com/'\n default:\n return ''\n }\n }\n\n _getTargetList(action: string): { value: string; description: string }[] {\n switch (action) {\n case 'data-toggle':\n case 'data-tristate':\n case 'data-set':\n case 'value-set':\n let ids =\n (this.scene &&\n this.scene.ids.map(i => {\n const id = i.key\n return { value: `#${id}`, description: this.scene!.findById(id)?.get('type') }\n })) ||\n []\n ids.unshift({ value: '(self)', description: 'self component' })\n return ids\n case 'infoWindow':\n return (\n (this.scene &&\n this.scene.ids\n .filter(i => {\n return this.scene!.findById(i.key).get('type') == 'info-window'\n })\n .map(i => {\n const id = i.key\n return { value: `#${id}`, description: this.scene!.findById(id)?.get('type') }\n })) ||\n []\n )\n default:\n return []\n }\n }\n\n _onValueChange(e: Event) {\n var element = e.target as HTMLElement\n var key = element.getAttribute('value-key')\n\n if (!key) {\n return\n }\n\n this.value = {\n ...this.value,\n [key]: convert(element)\n }\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import '@operato/input/ox-input-data.js';
|
|
5
|
+
import '@operato/i18n/ox-i18n.js';
|
|
6
|
+
import { LitElement } from 'lit';
|
|
7
|
+
import { Properties, Scene } from '@hatiolab/things-scene';
|
|
8
|
+
export declare class PropertyEventTap extends LitElement {
|
|
9
|
+
static styles: import("lit").CSSResult[];
|
|
10
|
+
value?: Properties;
|
|
11
|
+
scene?: Scene;
|
|
12
|
+
scenarios: {
|
|
13
|
+
value: string;
|
|
14
|
+
description: string;
|
|
15
|
+
}[];
|
|
16
|
+
targetList: {
|
|
17
|
+
value: string;
|
|
18
|
+
description: string;
|
|
19
|
+
}[];
|
|
20
|
+
firstUpdated(): Promise<void>;
|
|
21
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
22
|
+
_getPlaceHoder(action: string): "" | "http://www.hatiolab.com/";
|
|
23
|
+
_getInputList(action: string): {
|
|
24
|
+
value: string;
|
|
25
|
+
description: string;
|
|
26
|
+
}[];
|
|
27
|
+
_onValueChange(e: Event): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { __decorate } from "tslib";
|
|
5
|
+
import '@operato/input/ox-input-data.js';
|
|
6
|
+
import '@operato/i18n/ox-i18n.js';
|
|
7
|
+
import { html, LitElement } from 'lit';
|
|
8
|
+
import { property, state } from 'lit/decorators.js';
|
|
9
|
+
import { scenarios } from '@fmsim/api';
|
|
10
|
+
import { EffectsSharedStyle } from './effects-shared-style';
|
|
11
|
+
import { convert } from './value-converter';
|
|
12
|
+
export class PropertyEventTap extends LitElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.scenarios = [];
|
|
16
|
+
this.targetList = [];
|
|
17
|
+
}
|
|
18
|
+
async firstUpdated() {
|
|
19
|
+
this.renderRoot.addEventListener('change', this._onValueChange.bind(this));
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
var { action, value = '', target = '', pressed, options } = this.value || {};
|
|
23
|
+
var { input = '(self)', output = true } = options || {};
|
|
24
|
+
return html `
|
|
25
|
+
<input id="checkbox-pressed" type="checkbox" value-key="pressed" .checked=${pressed} />
|
|
26
|
+
<label for="checkbox-pressed" class="checkbox-label"> <ox-i18n msgid="label.pressed">pressed</ox-i18n> </label>
|
|
27
|
+
|
|
28
|
+
<label> <ox-i18n msgid="label.action">action</ox-i18n> </label>
|
|
29
|
+
<select
|
|
30
|
+
id="tap-select"
|
|
31
|
+
value-key="action"
|
|
32
|
+
.value=${action || ''}
|
|
33
|
+
@change=${async (e) => {
|
|
34
|
+
if (e.target.value.includes('scenario')) {
|
|
35
|
+
this.scenarios = (await scenarios()).map(({ name, description }) => {
|
|
36
|
+
return { value: name, description };
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
<option value=""></option>
|
|
42
|
+
<option value="data-toggle">toggle(true/false) target component data</option>
|
|
43
|
+
<option value="data-tristate">tristate(0/1/2) target component data</option>
|
|
44
|
+
<option value="data-set">set value to target component data</option>
|
|
45
|
+
<option value="value-set">set value to target component value</option>
|
|
46
|
+
</select>
|
|
47
|
+
|
|
48
|
+
<label> <ox-i18n msgid="label.target">target</ox-i18n> </label>
|
|
49
|
+
|
|
50
|
+
${action === 'goto' || (action === null || action === void 0 ? void 0 : action.includes('popup'))
|
|
51
|
+
? html `
|
|
52
|
+
<ox-editor-board-selector value-key="target" .value=${target} custom-editor></ox-editor-board-selector>
|
|
53
|
+
`
|
|
54
|
+
: html `
|
|
55
|
+
<input
|
|
56
|
+
value-key="target"
|
|
57
|
+
.value=${target}
|
|
58
|
+
list="target-list"
|
|
59
|
+
.placeholder=${this._getPlaceHoder(action)}
|
|
60
|
+
@focusin=${() => {
|
|
61
|
+
this.targetList = this._getInputList(action);
|
|
62
|
+
}}
|
|
63
|
+
/>
|
|
64
|
+
|
|
65
|
+
<datalist id="target-list">
|
|
66
|
+
${this.targetList.map(({ value, description }) => html ` <option .value=${value}>${description}</option> `)}
|
|
67
|
+
</datalist>
|
|
68
|
+
`}
|
|
69
|
+
${action === 'goto' || (action === null || action === void 0 ? void 0 : action.includes('popup'))
|
|
70
|
+
? html `
|
|
71
|
+
<label for="input"> <ox-i18n msgid="label.input-data">input</ox-i18n> </label>
|
|
72
|
+
<input
|
|
73
|
+
id="input"
|
|
74
|
+
value-key="input"
|
|
75
|
+
.value=${input}
|
|
76
|
+
list="input-list"
|
|
77
|
+
@focusin=${() => {
|
|
78
|
+
this.targetList = this._getInputList(action);
|
|
79
|
+
}}
|
|
80
|
+
/>
|
|
81
|
+
<datalist id="input-list">
|
|
82
|
+
${this.targetList.map(({ value, description }) => html ` <option .value=${value}>${description}</option> `)}
|
|
83
|
+
</datalist>
|
|
84
|
+
${
|
|
85
|
+
/* currently 'goto' does not support returning result */
|
|
86
|
+
(action === null || action === void 0 ? void 0 : action.includes('popup'))
|
|
87
|
+
? html ` <input id="checkbox-output" type="checkbox" value-key="output" .checked=${output} />
|
|
88
|
+
<label for="checkbox-output" class="checkbox-label">
|
|
89
|
+
<ox-i18n msgid="label.will-get-return">will-get-return</ox-i18n>
|
|
90
|
+
</label>`
|
|
91
|
+
: html ``}
|
|
92
|
+
`
|
|
93
|
+
: action === 'data-set' || action === 'value-set' || action === 'start-scenario' || action === 'run-scenario'
|
|
94
|
+
? html `
|
|
95
|
+
<label> <ox-i18n msgid="label.value">value</ox-i18n> </label>
|
|
96
|
+
<ox-input-data value-key="value" .value=${value} custom-editor fullwidth></ox-input-data>
|
|
97
|
+
`
|
|
98
|
+
: html ``}
|
|
99
|
+
`;
|
|
100
|
+
}
|
|
101
|
+
_getPlaceHoder(action) {
|
|
102
|
+
switch (action) {
|
|
103
|
+
case 'link-open':
|
|
104
|
+
case 'link-move':
|
|
105
|
+
return 'http://www.hatiolab.com/';
|
|
106
|
+
default:
|
|
107
|
+
return '';
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
_getInputList(action) {
|
|
111
|
+
switch (action) {
|
|
112
|
+
case 'data-toggle':
|
|
113
|
+
case 'data-tristate':
|
|
114
|
+
case 'data-set':
|
|
115
|
+
case 'value-set':
|
|
116
|
+
case 'popup':
|
|
117
|
+
case 'modal-popup':
|
|
118
|
+
let ids = (this.scene &&
|
|
119
|
+
this.scene.ids.map(i => {
|
|
120
|
+
var _a;
|
|
121
|
+
const id = i.key;
|
|
122
|
+
return { value: `#${id}`, description: (_a = this.scene.findById(id)) === null || _a === void 0 ? void 0 : _a.get('type') };
|
|
123
|
+
})) ||
|
|
124
|
+
[];
|
|
125
|
+
ids.unshift({ value: '(self)', description: 'self component' });
|
|
126
|
+
return ids;
|
|
127
|
+
case 'infoWindow':
|
|
128
|
+
case 'toggle-info-window':
|
|
129
|
+
return ((this.scene &&
|
|
130
|
+
this.scene.ids
|
|
131
|
+
.filter(i => {
|
|
132
|
+
return this.scene.findById(i.key).get('type') == 'info-window';
|
|
133
|
+
})
|
|
134
|
+
.map(i => {
|
|
135
|
+
var _a;
|
|
136
|
+
const id = i.key;
|
|
137
|
+
return { value: `#${id}`, description: (_a = this.scene.findById(id)) === null || _a === void 0 ? void 0 : _a.get('type') };
|
|
138
|
+
})) ||
|
|
139
|
+
[]);
|
|
140
|
+
case 'start-scenario':
|
|
141
|
+
case 'run-scenario':
|
|
142
|
+
return this.scenarios;
|
|
143
|
+
default:
|
|
144
|
+
return [];
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
_onValueChange(e) {
|
|
148
|
+
var element = e.target;
|
|
149
|
+
var key = element.getAttribute('value-key');
|
|
150
|
+
if (!key) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (key === 'input' || key === 'output') {
|
|
154
|
+
var { options = {} } = this.value || {};
|
|
155
|
+
this.value = {
|
|
156
|
+
...this.value,
|
|
157
|
+
options: {
|
|
158
|
+
...options,
|
|
159
|
+
[key]: convert(element)
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
this.value = {
|
|
165
|
+
...this.value,
|
|
166
|
+
[key]: convert(element)
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
var { action } = this.value;
|
|
170
|
+
if (action !== 'goto' && !(action === null || action === void 0 ? void 0 : action.includes('popup'))) {
|
|
171
|
+
/* clear unused options */
|
|
172
|
+
delete this.value.options;
|
|
173
|
+
}
|
|
174
|
+
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
PropertyEventTap.styles = [EffectsSharedStyle];
|
|
178
|
+
__decorate([
|
|
179
|
+
property({ type: Object })
|
|
180
|
+
], PropertyEventTap.prototype, "value", void 0);
|
|
181
|
+
__decorate([
|
|
182
|
+
property({ type: Object })
|
|
183
|
+
], PropertyEventTap.prototype, "scene", void 0);
|
|
184
|
+
__decorate([
|
|
185
|
+
state()
|
|
186
|
+
], PropertyEventTap.prototype, "scenarios", void 0);
|
|
187
|
+
__decorate([
|
|
188
|
+
state()
|
|
189
|
+
], PropertyEventTap.prototype, "targetList", void 0);
|
|
190
|
+
//# sourceMappingURL=property-event-tap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,OAAO,CAAC;aACxB,CAAA;SACF;QAED,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAC3B,IAAI,MAAM,KAAK,MAAM,IAAI,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAC,OAAO,CAAC,CAAA,EAAE;YACnD,0BAA0B;YAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAA;SAC1B;QAED,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAClF,CAAC;;AApLM,uBAAM,GAAG,CAAC,kBAAkB,CAAC,AAAvB,CAAuB;AAER;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAmB;AAClB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAc;AAEhC;IAAR,KAAK,EAAE;mDAAyD;AACxD;IAAR,KAAK,EAAE;oDAA0D","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@operato/input/ox-input-data.js'\nimport '@operato/i18n/ox-i18n.js'\n\nimport { html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\n\nimport { Properties, Scene } from '@hatiolab/things-scene'\n\nimport { scenarios } from '@fmsim/api'\nimport { EffectsSharedStyle } from './effects-shared-style'\nimport { convert } from './value-converter'\n\nexport class PropertyEventTap extends LitElement {\n static styles = [EffectsSharedStyle]\n\n @property({ type: Object }) value?: Properties\n @property({ type: Object }) scene?: Scene\n\n @state() scenarios: { value: string; description: string }[] = []\n @state() targetList: { value: string; description: string }[] = []\n\n async firstUpdated() {\n this.renderRoot.addEventListener('change', this._onValueChange.bind(this))\n }\n\n render() {\n var { action, value = '', target = '', pressed, options } = this.value || {}\n var { input = '(self)', output = true } = options || {}\n\n return html`\n <input id=\"checkbox-pressed\" type=\"checkbox\" value-key=\"pressed\" .checked=${pressed} />\n <label for=\"checkbox-pressed\" class=\"checkbox-label\"> <ox-i18n msgid=\"label.pressed\">pressed</ox-i18n> </label>\n\n <label> <ox-i18n msgid=\"label.action\">action</ox-i18n> </label>\n <select\n id=\"tap-select\"\n value-key=\"action\"\n .value=${action || ''}\n @change=${async (e: Event) => {\n if ((e.target as HTMLSelectElement).value.includes('scenario')) {\n this.scenarios = (await scenarios()).map(({ name, description }) => {\n return { value: name, description }\n })\n }\n }}\n >\n <option value=\"\"></option>\n <option value=\"data-toggle\">toggle(true/false) target component data</option>\n <option value=\"data-tristate\">tristate(0/1/2) target component data</option>\n <option value=\"data-set\">set value to target component data</option>\n <option value=\"value-set\">set value to target component value</option>\n </select>\n\n <label> <ox-i18n msgid=\"label.target\">target</ox-i18n> </label>\n\n ${action === 'goto' || action?.includes('popup')\n ? html`\n <ox-editor-board-selector value-key=\"target\" .value=${target} custom-editor></ox-editor-board-selector>\n `\n : html`\n <input\n value-key=\"target\"\n .value=${target}\n list=\"target-list\"\n .placeholder=${this._getPlaceHoder(action)}\n @focusin=${() => {\n this.targetList = this._getInputList(action)\n }}\n />\n\n <datalist id=\"target-list\">\n ${this.targetList.map(\n ({ value, description }) => html` <option .value=${value}>${description}</option> `\n )}\n </datalist>\n `}\n ${action === 'goto' || action?.includes('popup')\n ? html`\n <label for=\"input\"> <ox-i18n msgid=\"label.input-data\">input</ox-i18n> </label>\n <input\n id=\"input\"\n value-key=\"input\"\n .value=${input}\n list=\"input-list\"\n @focusin=${() => {\n this.targetList = this._getInputList(action)\n }}\n />\n <datalist id=\"input-list\">\n ${this.targetList.map(\n ({ value, description }) => html` <option .value=${value}>${description}</option> `\n )}\n </datalist>\n ${\n /* currently 'goto' does not support returning result */\n action?.includes('popup')\n ? html` <input id=\"checkbox-output\" type=\"checkbox\" value-key=\"output\" .checked=${output} />\n <label for=\"checkbox-output\" class=\"checkbox-label\">\n <ox-i18n msgid=\"label.will-get-return\">will-get-return</ox-i18n>\n </label>`\n : html``\n }\n `\n : action === 'data-set' || action === 'value-set' || action === 'start-scenario' || action === 'run-scenario'\n ? html`\n <label> <ox-i18n msgid=\"label.value\">value</ox-i18n> </label>\n <ox-input-data value-key=\"value\" .value=${value} custom-editor fullwidth></ox-input-data>\n `\n : html``}\n `\n }\n\n _getPlaceHoder(action: string) {\n switch (action) {\n case 'link-open':\n case 'link-move':\n return 'http://www.hatiolab.com/'\n default:\n return ''\n }\n }\n\n _getInputList(action: string): { value: string; description: string }[] {\n switch (action) {\n case 'data-toggle':\n case 'data-tristate':\n case 'data-set':\n case 'value-set':\n case 'popup':\n case 'modal-popup':\n let ids =\n (this.scene &&\n this.scene.ids.map(i => {\n const id = i.key\n return { value: `#${id}`, description: this.scene!.findById(id)?.get('type') }\n })) ||\n []\n ids.unshift({ value: '(self)', description: 'self component' })\n return ids\n case 'infoWindow':\n case 'toggle-info-window':\n return (\n (this.scene &&\n this.scene.ids\n .filter(i => {\n return this.scene!.findById(i.key).get('type') == 'info-window'\n })\n .map(i => {\n const id = i.key\n return { value: `#${id}`, description: this.scene!.findById(id)?.get('type') }\n })) ||\n []\n )\n case 'start-scenario':\n case 'run-scenario':\n return this.scenarios\n default:\n return []\n }\n }\n\n _onValueChange(e: Event) {\n var element = e.target as HTMLElement\n var key = element.getAttribute('value-key')\n\n if (!key) {\n return\n }\n\n if (key === 'input' || key === 'output') {\n var { options = {} } = this.value || {}\n\n this.value = {\n ...this.value,\n options: {\n ...options,\n [key]: convert(element)\n }\n }\n } else {\n this.value = {\n ...this.value,\n [key]: convert(element)\n }\n }\n\n var { action } = this.value\n if (action !== 'goto' && !action?.includes('popup')) {\n /* clear unused options */\n delete this.value.options\n }\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import '@operato/help/ox-title-with-help.js';
|
|
5
|
+
import { LitElement } from 'lit';
|
|
6
|
+
import { Properties, Scene } from '@hatiolab/things-scene';
|
|
7
|
+
import { PropertyEventHover } from './property-event-hover';
|
|
8
|
+
import { PropertyEventTap } from './property-event-tap';
|
|
9
|
+
declare const PropertyEvent_base: typeof LitElement & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
|
|
10
|
+
export declare class PropertyEvent extends PropertyEvent_base {
|
|
11
|
+
static styles: import("lit").CSSResult[];
|
|
12
|
+
value?: Properties;
|
|
13
|
+
scene?: Scene;
|
|
14
|
+
firstUpdated(): void;
|
|
15
|
+
static get scopedElements(): {
|
|
16
|
+
'property-event-hover': typeof PropertyEventHover;
|
|
17
|
+
'property-event-tap': typeof PropertyEventTap;
|
|
18
|
+
};
|
|
19
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
20
|
+
_onValueChange(e: Event): void;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { __decorate } from "tslib";
|
|
5
|
+
import '@operato/help/ox-title-with-help.js';
|
|
6
|
+
import { html, LitElement } from 'lit';
|
|
7
|
+
import { property } from 'lit/decorators.js';
|
|
8
|
+
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
9
|
+
import { PropertySharedStyle } from '../property-shared-style';
|
|
10
|
+
import { PropertyEventHover } from './property-event-hover';
|
|
11
|
+
import { PropertyEventTap } from './property-event-tap';
|
|
12
|
+
import { convert } from './value-converter';
|
|
13
|
+
export class PropertyEvent extends ScopedElementsMixin(LitElement) {
|
|
14
|
+
firstUpdated() {
|
|
15
|
+
this.renderRoot.addEventListener('change', this._onValueChange.bind(this));
|
|
16
|
+
}
|
|
17
|
+
static get scopedElements() {
|
|
18
|
+
return {
|
|
19
|
+
'property-event-hover': PropertyEventHover,
|
|
20
|
+
'property-event-tap': PropertyEventTap
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
const value = this.value || {};
|
|
25
|
+
return html `
|
|
26
|
+
<fieldset>
|
|
27
|
+
<legend>
|
|
28
|
+
<ox-title-with-help msgid="label.tap-event" topic="board-modeller/effects/tap-event"></ox-title-with-help>
|
|
29
|
+
</legend>
|
|
30
|
+
|
|
31
|
+
<property-event-tap value-key="tap" .scene=${this.scene} .value=${value.tap || {}}> </property-event-tap>
|
|
32
|
+
</fieldset>
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
_onValueChange(e) {
|
|
36
|
+
var element = e.target;
|
|
37
|
+
var key = element.getAttribute('value-key');
|
|
38
|
+
if (!key) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
this.value = {
|
|
42
|
+
...this.value,
|
|
43
|
+
[key]: convert(element)
|
|
44
|
+
};
|
|
45
|
+
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
PropertyEvent.styles = [PropertySharedStyle];
|
|
49
|
+
__decorate([
|
|
50
|
+
property({ type: Object })
|
|
51
|
+
], PropertyEvent.prototype, "value", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
property({ type: Object })
|
|
54
|
+
], PropertyEvent.prototype, "scene", void 0);
|
|
55
|
+
//# sourceMappingURL=property-event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-event.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/effects/property-event.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,qCAAqC,CAAA;AAE5C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG5C,OAAO,EAAE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,CAAC,mBAAmB,CAAC,CAAA;AAET;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAmB;AAClB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAc","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@operato/help/ox-title-with-help.js'\n\nimport { html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\nimport { Properties, Scene } from '@hatiolab/things-scene'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\n\nimport { PropertySharedStyle } from '../property-shared-style'\nimport { PropertyEventHover } from './property-event-hover'\nimport { PropertyEventTap } from './property-event-tap'\nimport { convert } from './value-converter'\n\nexport class PropertyEvent extends ScopedElementsMixin(LitElement) {\n static styles = [PropertySharedStyle]\n\n @property({ type: Object }) value?: Properties\n @property({ type: Object }) scene?: Scene\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', this._onValueChange.bind(this))\n }\n\n static get scopedElements() {\n return {\n 'property-event-hover': PropertyEventHover,\n 'property-event-tap': PropertyEventTap\n }\n }\n\n render() {\n const value = this.value || {}\n\n return html`\n <fieldset>\n <legend>\n <ox-title-with-help msgid=\"label.tap-event\" topic=\"board-modeller/effects/tap-event\"></ox-title-with-help>\n </legend>\n\n <property-event-tap value-key=\"tap\" .scene=${this.scene} .value=${value.tap || {}}> </property-event-tap>\n </fieldset>\n `\n }\n\n _onValueChange(e: Event) {\n var element = e.target as HTMLElement\n var key = element.getAttribute('value-key')\n\n if (!key) {\n return\n }\n\n this.value = {\n ...this.value,\n [key]: convert(element)\n }\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import '@operato/i18n/ox-i18n.js';
|
|
5
|
+
import '@operato/input/ox-input-color.js';
|
|
6
|
+
import { LitElement } from 'lit';
|
|
7
|
+
import { Properties } from '@hatiolab/things-scene';
|
|
8
|
+
/**
|
|
9
|
+
* 컴포넌트의 그림자 속성을 편집하는 element
|
|
10
|
+
*
|
|
11
|
+
* Example:
|
|
12
|
+
* <property-shadow
|
|
13
|
+
* @change="${e => { this.shadow = e.target.value }}"
|
|
14
|
+
* value="${this.shadow}"
|
|
15
|
+
* ></property-shadow>
|
|
16
|
+
*/
|
|
17
|
+
export declare class PropertyShadow extends LitElement {
|
|
18
|
+
static styles: import("lit").CSSResult[];
|
|
19
|
+
value?: Properties;
|
|
20
|
+
firstUpdated(): void;
|
|
21
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
22
|
+
_onValueChange(e: Event): void;
|
|
23
|
+
}
|