@operato/process 1.1.4 → 1.1.6
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/CHANGELOG.md +17 -0
- package/dist/src/modeller/property-sidebar/effects/effects.d.ts +2 -0
- package/dist/src/modeller/property-sidebar/effects/effects.js +6 -1
- package/dist/src/modeller/property-sidebar/effects/effects.js.map +1 -1
- 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 +127 -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 +199 -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 +67 -0
- package/dist/src/modeller/property-sidebar/effects/property-event.js.map +1 -0
- package/dist/src/modeller/property-sidebar/property-sidebar.d.ts +2 -0
- package/dist/src/modeller/property-sidebar/property-sidebar.js +7 -0
- package/dist/src/modeller/property-sidebar/property-sidebar.js.map +1 -1
- package/dist/src/modeller/property-sidebar/shapes/shapes.d.ts +5 -7
- package/dist/src/modeller/property-sidebar/shapes/shapes.js +84 -17
- package/dist/src/modeller/property-sidebar/shapes/shapes.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/modeller/property-sidebar/effects/effects.ts +6 -1
- package/src/modeller/property-sidebar/effects/property-event-hover.ts +140 -0
- package/src/modeller/property-sidebar/effects/property-event-tap.ts +208 -0
- package/src/modeller/property-sidebar/effects/property-event.ts +76 -0
- package/src/modeller/property-sidebar/property-sidebar.ts +7 -0
- package/src/modeller/property-sidebar/shapes/shapes.ts +85 -18
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
### [1.1.6](https://github.com/heartyoh/ioperato/compare/v1.1.5...v1.1.6) (2022-11-09)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :bug: Bug Fix
|
|
10
|
+
|
|
11
|
+
* process modeller ([19cb2ca](https://github.com/heartyoh/ioperato/commit/19cb2ca5d78b9a32a0dd58a8b5c330f52d151a16))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### [1.1.5](https://github.com/heartyoh/ioperato/compare/v1.1.4...v1.1.5) (2022-11-09)
|
|
16
|
+
|
|
17
|
+
**Note:** Version bump only for package @operato/process
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
### [1.1.4](https://github.com/heartyoh/ioperato/compare/v1.1.3...v1.1.4) (2022-11-06)
|
|
7
24
|
|
|
8
25
|
|
|
@@ -5,6 +5,7 @@ import '@operato/i18n/ox-i18n.js';
|
|
|
5
5
|
import '@operato/help/ox-title-with-help.js';
|
|
6
6
|
import { Properties, Scene } from '@hatiolab/things-scene';
|
|
7
7
|
import { AbstractProperty } from '../abstract-property.js';
|
|
8
|
+
import { PropertyEvent } from './property-event.js';
|
|
8
9
|
import { PropertyShadow } from './property-shadow.js';
|
|
9
10
|
declare const PropertyEffects_base: typeof AbstractProperty & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types.js").ScopedElementsHost>;
|
|
10
11
|
export declare class PropertyEffects extends PropertyEffects_base {
|
|
@@ -14,6 +15,7 @@ export declare class PropertyEffects extends PropertyEffects_base {
|
|
|
14
15
|
firstUpdated(): void;
|
|
15
16
|
static get scopedElements(): {
|
|
16
17
|
'process-property-shadow': typeof PropertyShadow;
|
|
18
|
+
'process-property-event': typeof PropertyEvent;
|
|
17
19
|
};
|
|
18
20
|
render(): import("lit-html").TemplateResult<1>;
|
|
19
21
|
}
|
|
@@ -9,6 +9,7 @@ import { property } from 'lit/decorators.js';
|
|
|
9
9
|
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
10
10
|
import { AbstractProperty } from '../abstract-property.js';
|
|
11
11
|
import { PropertySharedStyle } from '../property-shared-style.js';
|
|
12
|
+
import { PropertyEvent } from './property-event.js';
|
|
12
13
|
import { PropertyShadow } from './property-shadow.js';
|
|
13
14
|
export class PropertyEffects extends ScopedElementsMixin(AbstractProperty) {
|
|
14
15
|
firstUpdated() {
|
|
@@ -16,7 +17,8 @@ export class PropertyEffects extends ScopedElementsMixin(AbstractProperty) {
|
|
|
16
17
|
}
|
|
17
18
|
static get scopedElements() {
|
|
18
19
|
return {
|
|
19
|
-
'process-property-shadow': PropertyShadow
|
|
20
|
+
'process-property-shadow': PropertyShadow,
|
|
21
|
+
'process-property-event': PropertyEvent
|
|
20
22
|
};
|
|
21
23
|
}
|
|
22
24
|
render() {
|
|
@@ -29,6 +31,9 @@ export class PropertyEffects extends ScopedElementsMixin(AbstractProperty) {
|
|
|
29
31
|
|
|
30
32
|
<process-property-shadow value-key="shadow" .value=${value.shadow || {}}> </process-property-shadow>
|
|
31
33
|
</fieldset>
|
|
34
|
+
|
|
35
|
+
<process-property-event value-key="event" .scene=${this.scene} .value=${value.event || {}}>
|
|
36
|
+
</process-property-event>
|
|
32
37
|
`;
|
|
33
38
|
}
|
|
34
39
|
}
|
|
@@ -1 +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,C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B,EAAE,aAAa;SACxC,CAAA;IACH,CAAC;IAED,MAAM;QACJ,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;QAE9B,OAAO,IAAI,CAAA;;;;;;6DAM8C,KAAK,CAAC,MAAM,IAAI,EAAE;;;yDAGtB,IAAI,CAAC,KAAK,WAAW,KAAK,CAAC,KAAK,IAAI,EAAE;;KAE1F,CAAA;IACH,CAAC;;AA/BM,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 'process-property-shadow': PropertyShadow,\n 'process-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=\"process-modeller/effects/shadow\" msgid=\"label.shadow\">shadow</ox-title-with-help>\n </legend>\n\n <process-property-shadow value-key=\"shadow\" .value=${value.shadow || {}}> </process-property-shadow>\n </fieldset>\n\n <process-property-event value-key=\"event\" .scene=${this.scene} .value=${value.event || {}}>\n </process-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,127 @@
|
|
|
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
|
+
</select>
|
|
28
|
+
|
|
29
|
+
<label> <ox-i18n msgid="label.target">target</ox-i18n> </label>
|
|
30
|
+
|
|
31
|
+
${action == 'popup'
|
|
32
|
+
? html `
|
|
33
|
+
<things-editor-board-selector
|
|
34
|
+
value-key="target"
|
|
35
|
+
.value=${target}
|
|
36
|
+
custom-editor
|
|
37
|
+
></things-editor-board-selector>
|
|
38
|
+
`
|
|
39
|
+
: html `
|
|
40
|
+
<input
|
|
41
|
+
value-key="target"
|
|
42
|
+
.value=${target || ''}
|
|
43
|
+
list="target-list"
|
|
44
|
+
.placeholder="${this._getPlaceHoder(action)}"
|
|
45
|
+
/>
|
|
46
|
+
|
|
47
|
+
<datalist id="target-list">
|
|
48
|
+
${this._getTargetList(action).map(({ value, description }) => html ` <option .value=${value}>${description}</option> `)}
|
|
49
|
+
</datalist>
|
|
50
|
+
`}
|
|
51
|
+
${action == 'data-set' || action == 'value-set'
|
|
52
|
+
? html `
|
|
53
|
+
<label> <ox-i18n msgid="label.value">value</ox-i18n> </label>
|
|
54
|
+
<ox-input-data value-key="value" .value=${value} custom-editor fullwidth></ox-input-data>
|
|
55
|
+
`
|
|
56
|
+
: html ``}
|
|
57
|
+
|
|
58
|
+
<input id="checkbox-restore" type="checkbox" value-key="restore" .checked=${restore} />
|
|
59
|
+
<label for="checkbox-restore" class="checkbox-label">
|
|
60
|
+
<ox-i18n msgid="label.restore-on-leave">restore on leave</ox-i18n>
|
|
61
|
+
</label>
|
|
62
|
+
`;
|
|
63
|
+
}
|
|
64
|
+
_getPlaceHoder(action) {
|
|
65
|
+
switch (action) {
|
|
66
|
+
case 'popup':
|
|
67
|
+
case 'goto':
|
|
68
|
+
return 'SCENE-100';
|
|
69
|
+
case 'link-open':
|
|
70
|
+
case 'link-move':
|
|
71
|
+
return 'http://www.hatiolab.com/';
|
|
72
|
+
default:
|
|
73
|
+
return '';
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
_getTargetList(action) {
|
|
77
|
+
switch (action) {
|
|
78
|
+
case 'data-toggle':
|
|
79
|
+
case 'data-tristate':
|
|
80
|
+
case 'data-set':
|
|
81
|
+
case 'value-set':
|
|
82
|
+
let ids = (this.scene &&
|
|
83
|
+
this.scene.ids.map(i => {
|
|
84
|
+
var _a;
|
|
85
|
+
const id = i.key;
|
|
86
|
+
return { value: `#${id}`, description: (_a = this.scene.findById(id)) === null || _a === void 0 ? void 0 : _a.get('type') };
|
|
87
|
+
})) ||
|
|
88
|
+
[];
|
|
89
|
+
ids.unshift({ value: '(self)', description: 'self component' });
|
|
90
|
+
return ids;
|
|
91
|
+
case 'infoWindow':
|
|
92
|
+
return ((this.scene &&
|
|
93
|
+
this.scene.ids
|
|
94
|
+
.filter(i => {
|
|
95
|
+
return this.scene.findById(i.key).get('type') == 'info-window';
|
|
96
|
+
})
|
|
97
|
+
.map(i => {
|
|
98
|
+
var _a;
|
|
99
|
+
const id = i.key;
|
|
100
|
+
return { value: `#${id}`, description: (_a = this.scene.findById(id)) === null || _a === void 0 ? void 0 : _a.get('type') };
|
|
101
|
+
})) ||
|
|
102
|
+
[]);
|
|
103
|
+
default:
|
|
104
|
+
return [];
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
_onValueChange(e) {
|
|
108
|
+
var element = e.target;
|
|
109
|
+
var key = element.getAttribute('value-key');
|
|
110
|
+
if (!key) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
this.value = {
|
|
114
|
+
...this.value,
|
|
115
|
+
[key]: convert(element)
|
|
116
|
+
};
|
|
117
|
+
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
PropertyEventHover.styles = [EffectsSharedStyle];
|
|
121
|
+
__decorate([
|
|
122
|
+
property({ type: Object })
|
|
123
|
+
], PropertyEventHover.prototype, "value", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
property({ type: Object })
|
|
126
|
+
], PropertyEventHover.prototype, "scene", void 0);
|
|
127
|
+
//# 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;AAE3C,MAAM,OAAO,kBAAmB,SAAQ,UAAU;IAMhD,YAAY;QACV,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IAC5E,CAAC;IAED,MAAM;QACJ,IAAI,EAAE,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;QAE9E,OAAO,IAAI,CAAA;sFACuE,SAAS;;;;;;0DAMrC,MAAM,IAAI,EAAE;;;;;;;QAO9D,MAAM,IAAI,OAAO;YACjB,CAAC,CAAC,IAAI,CAAA;;;uBAGS,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AAA;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 </select>\n\n <label> <ox-i18n msgid=\"label.target\">target</ox-i18n> </label>\n\n ${action == 'popup'\n ? html`\n <things-editor-board-selector\n value-key=\"target\"\n .value=${target}\n custom-editor\n ></things-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,199 @@
|
|
|
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 '../../../graphql/scenario';
|
|
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 === 'start-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="goto">go to target board</option>
|
|
43
|
+
<option value="link-open">open new window for target link</option>
|
|
44
|
+
<option value="link-move">move to target link</option>
|
|
45
|
+
<option value="route-page">route to page</option>
|
|
46
|
+
<option value="popup">popup target board</option>
|
|
47
|
+
<option value="modal-popup">modal popup target board</option>
|
|
48
|
+
<option value="close-scene">close current board</option>
|
|
49
|
+
<option value="infoWindow">open infowindow</option>
|
|
50
|
+
<option value="toggle-info-window">toggle infowindow</option>
|
|
51
|
+
</select>
|
|
52
|
+
|
|
53
|
+
<label> <ox-i18n msgid="label.target">target</ox-i18n> </label>
|
|
54
|
+
|
|
55
|
+
${action === 'goto' || (action === null || action === void 0 ? void 0 : action.includes('popup'))
|
|
56
|
+
? html `
|
|
57
|
+
<things-editor-board-selector
|
|
58
|
+
value-key="target"
|
|
59
|
+
.value=${target}
|
|
60
|
+
custom-editor
|
|
61
|
+
></things-editor-board-selector>
|
|
62
|
+
`
|
|
63
|
+
: html `
|
|
64
|
+
<input
|
|
65
|
+
value-key="target"
|
|
66
|
+
.value=${target}
|
|
67
|
+
list="target-list"
|
|
68
|
+
.placeholder=${this._getPlaceHoder(action)}
|
|
69
|
+
@focusin=${() => {
|
|
70
|
+
this.targetList = this._getInputList(action);
|
|
71
|
+
}}
|
|
72
|
+
/>
|
|
73
|
+
|
|
74
|
+
<datalist id="target-list">
|
|
75
|
+
${this.targetList.map(({ value, description }) => html ` <option .value=${value}>${description}</option> `)}
|
|
76
|
+
</datalist>
|
|
77
|
+
`}
|
|
78
|
+
${action === 'goto' || (action === null || action === void 0 ? void 0 : action.includes('popup'))
|
|
79
|
+
? html `
|
|
80
|
+
<label for="input"> <ox-i18n msgid="label.input-data">input</ox-i18n> </label>
|
|
81
|
+
<input
|
|
82
|
+
id="input"
|
|
83
|
+
value-key="input"
|
|
84
|
+
.value=${input}
|
|
85
|
+
list="input-list"
|
|
86
|
+
@focusin=${() => {
|
|
87
|
+
this.targetList = this._getInputList(action);
|
|
88
|
+
}}
|
|
89
|
+
/>
|
|
90
|
+
<datalist id="input-list">
|
|
91
|
+
${this.targetList.map(({ value, description }) => html ` <option .value=${value}>${description}</option> `)}
|
|
92
|
+
</datalist>
|
|
93
|
+
${
|
|
94
|
+
/* currently 'goto' does not support returning result */
|
|
95
|
+
(action === null || action === void 0 ? void 0 : action.includes('popup'))
|
|
96
|
+
? html ` <input id="checkbox-output" type="checkbox" value-key="output" .checked=${output} />
|
|
97
|
+
<label for="checkbox-output" class="checkbox-label">
|
|
98
|
+
<ox-i18n msgid="label.will-get-return">will-get-return</ox-i18n>
|
|
99
|
+
</label>`
|
|
100
|
+
: html ``}
|
|
101
|
+
`
|
|
102
|
+
: action === 'data-set' || action === 'value-set' || action === 'start-scenario' || action === 'run-scenario'
|
|
103
|
+
? html `
|
|
104
|
+
<label> <ox-i18n msgid="label.value">value</ox-i18n> </label>
|
|
105
|
+
<ox-input-data value-key="value" .value=${value} custom-editor fullwidth></ox-input-data>
|
|
106
|
+
`
|
|
107
|
+
: html ``}
|
|
108
|
+
`;
|
|
109
|
+
}
|
|
110
|
+
_getPlaceHoder(action) {
|
|
111
|
+
switch (action) {
|
|
112
|
+
case 'link-open':
|
|
113
|
+
case 'link-move':
|
|
114
|
+
return 'http://www.hatiolab.com/';
|
|
115
|
+
default:
|
|
116
|
+
return '';
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
_getInputList(action) {
|
|
120
|
+
switch (action) {
|
|
121
|
+
case 'data-toggle':
|
|
122
|
+
case 'data-tristate':
|
|
123
|
+
case 'data-set':
|
|
124
|
+
case 'value-set':
|
|
125
|
+
case 'popup':
|
|
126
|
+
case 'modal-popup':
|
|
127
|
+
let ids = (this.scene &&
|
|
128
|
+
this.scene.ids.map(i => {
|
|
129
|
+
var _a;
|
|
130
|
+
const id = i.key;
|
|
131
|
+
return { value: `#${id}`, description: (_a = this.scene.findById(id)) === null || _a === void 0 ? void 0 : _a.get('type') };
|
|
132
|
+
})) ||
|
|
133
|
+
[];
|
|
134
|
+
ids.unshift({ value: '(self)', description: 'self component' });
|
|
135
|
+
return ids;
|
|
136
|
+
case 'infoWindow':
|
|
137
|
+
case 'toggle-info-window':
|
|
138
|
+
return ((this.scene &&
|
|
139
|
+
this.scene.ids
|
|
140
|
+
.filter(i => {
|
|
141
|
+
return this.scene.findById(i.key).get('type') == 'info-window';
|
|
142
|
+
})
|
|
143
|
+
.map(i => {
|
|
144
|
+
var _a;
|
|
145
|
+
const id = i.key;
|
|
146
|
+
return { value: `#${id}`, description: (_a = this.scene.findById(id)) === null || _a === void 0 ? void 0 : _a.get('type') };
|
|
147
|
+
})) ||
|
|
148
|
+
[]);
|
|
149
|
+
case 'start-scenario':
|
|
150
|
+
case 'run-scenario':
|
|
151
|
+
return this.scenarios;
|
|
152
|
+
default:
|
|
153
|
+
return [];
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
_onValueChange(e) {
|
|
157
|
+
var element = e.target;
|
|
158
|
+
var key = element.getAttribute('value-key');
|
|
159
|
+
if (!key) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (key === 'input' || key === 'output') {
|
|
163
|
+
var { options = {} } = this.value || {};
|
|
164
|
+
this.value = {
|
|
165
|
+
...this.value,
|
|
166
|
+
options: {
|
|
167
|
+
...options,
|
|
168
|
+
[key]: convert(element)
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
this.value = {
|
|
174
|
+
...this.value,
|
|
175
|
+
[key]: convert(element)
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
var { action } = this.value;
|
|
179
|
+
if (action !== 'goto' && !(action === null || action === void 0 ? void 0 : action.includes('popup'))) {
|
|
180
|
+
/* clear unused options */
|
|
181
|
+
delete this.value.options;
|
|
182
|
+
}
|
|
183
|
+
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
PropertyEventTap.styles = [EffectsSharedStyle];
|
|
187
|
+
__decorate([
|
|
188
|
+
property({ type: Object })
|
|
189
|
+
], PropertyEventTap.prototype, "value", void 0);
|
|
190
|
+
__decorate([
|
|
191
|
+
property({ type: Object })
|
|
192
|
+
], PropertyEventTap.prototype, "scene", void 0);
|
|
193
|
+
__decorate([
|
|
194
|
+
state()
|
|
195
|
+
], PropertyEventTap.prototype, "scenarios", void 0);
|
|
196
|
+
__decorate([
|
|
197
|
+
state()
|
|
198
|
+
], PropertyEventTap.prototype, "targetList", void 0);
|
|
199
|
+
//# sourceMappingURL=property-event-tap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-event-tap.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/effects/property-event-tap.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,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAInD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,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7LM,uBAAM,GAAG,CAAC,kBAAkB,CAAC,CAAA;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 '../../../graphql/scenario'\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 === 'start-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=\"goto\">go to target board</option>\n <option value=\"link-open\">open new window for target link</option>\n <option value=\"link-move\">move to target link</option>\n <option value=\"route-page\">route to page</option>\n <option value=\"popup\">popup target board</option>\n <option value=\"modal-popup\">modal popup target board</option>\n <option value=\"close-scene\">close current board</option>\n <option value=\"infoWindow\">open infowindow</option>\n <option value=\"toggle-info-window\">toggle infowindow</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 <things-editor-board-selector\n value-key=\"target\"\n .value=${target}\n custom-editor\n ></things-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,67 @@
|
|
|
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
|
|
29
|
+
msgid="label.hover-event"
|
|
30
|
+
topic="process-modeller/effects/hover-event"
|
|
31
|
+
></ox-title-with-help>
|
|
32
|
+
</legend>
|
|
33
|
+
|
|
34
|
+
<property-event-hover value-key="hover" .scene=${this.scene} .value=${value.hover || {}}>
|
|
35
|
+
</property-event-hover>
|
|
36
|
+
</fieldset>
|
|
37
|
+
|
|
38
|
+
<fieldset>
|
|
39
|
+
<legend>
|
|
40
|
+
<ox-title-with-help msgid="label.tap-event" topic="process-modeller/effects/tap-event"></ox-title-with-help>
|
|
41
|
+
</legend>
|
|
42
|
+
|
|
43
|
+
<property-event-tap value-key="tap" .scene=${this.scene} .value=${value.tap || {}}> </property-event-tap>
|
|
44
|
+
</fieldset>
|
|
45
|
+
`;
|
|
46
|
+
}
|
|
47
|
+
_onValueChange(e) {
|
|
48
|
+
var element = e.target;
|
|
49
|
+
var key = element.getAttribute('value-key');
|
|
50
|
+
if (!key) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
this.value = {
|
|
54
|
+
...this.value,
|
|
55
|
+
[key]: convert(element)
|
|
56
|
+
};
|
|
57
|
+
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
PropertyEvent.styles = [PropertySharedStyle];
|
|
61
|
+
__decorate([
|
|
62
|
+
property({ type: Object })
|
|
63
|
+
], PropertyEvent.prototype, "value", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
property({ type: Object })
|
|
66
|
+
], PropertyEvent.prototype, "scene", void 0);
|
|
67
|
+
//# 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,mBAAmB,EAAE,MAAM,0BAA0B,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,CAAC,CAAA;IAClF,CAAC;;AAxDM,oBAAM,GAAG,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\n msgid=\"label.hover-event\"\n topic=\"process-modeller/effects/hover-event\"\n ></ox-title-with-help>\n </legend>\n\n <property-event-hover value-key=\"hover\" .scene=${this.scene} .value=${value.hover || {}}>\n </property-event-hover>\n </fieldset>\n\n <fieldset>\n <legend>\n <ox-title-with-help msgid=\"label.tap-event\" topic=\"process-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"]}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import '@material/mwc-icon';
|
|
5
5
|
import { LitElement, PropertyValues } from 'lit';
|
|
6
6
|
import { BOUNDS, Component, Model, Scene } from '@hatiolab/things-scene';
|
|
7
|
+
import { PropertyEffects } from './effects/effects.js';
|
|
7
8
|
import { PropertyShapes } from './shapes/shapes.js';
|
|
8
9
|
import { PropertySpecific } from './specifics/specifics.js';
|
|
9
10
|
import { PropertyStyles } from './styles/styles.js';
|
|
@@ -26,6 +27,7 @@ export declare class PropertySidebar extends PropertySidebar_base {
|
|
|
26
27
|
static get scopedElements(): {
|
|
27
28
|
'process-property-shape': typeof PropertyShapes;
|
|
28
29
|
'process-property-style': typeof PropertyStyles;
|
|
30
|
+
'process-property-effect': typeof PropertyEffects;
|
|
29
31
|
'process-property-specific': typeof PropertySpecific;
|
|
30
32
|
'process-scene-inspector': typeof SceneInspector;
|
|
31
33
|
};
|