@operato/process 7.1.30 → 7.1.32
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 +18 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -14
- package/.storybook/main.js +0 -3
- package/.storybook/preview.js +0 -52
- package/.storybook/server.mjs +0 -8
- package/demo/index-modeller.html +0 -112
- package/demo/index-viewer.html +0 -112
- package/demo/index.html +0 -112
- package/src/data-storage/data-storage.ts +0 -47
- package/src/graphql/data-subscription.ts +0 -30
- package/src/graphql/favorite-process.ts +0 -25
- package/src/graphql/index.ts +0 -3
- package/src/graphql/process-group.ts +0 -138
- package/src/graphql/process.ts +0 -141
- package/src/graphql/scenario.ts +0 -79
- package/src/index.ts +0 -8
- package/src/modeller/component-toolbar/component-detail.ts +0 -58
- package/src/modeller/component-toolbar/component-menu.ts +0 -193
- package/src/modeller/component-toolbar/component-toolbar.ts +0 -196
- package/src/modeller/component-toolbar/mode-icons.ts +0 -88
- package/src/modeller/edit-toolbar-style.ts +0 -229
- package/src/modeller/edit-toolbar.ts +0 -576
- package/src/modeller/property-sidebar/abstract-property.ts +0 -69
- package/src/modeller/property-sidebar/data-binding/data-binding-mapper.ts +0 -475
- package/src/modeller/property-sidebar/data-binding/data-binding.ts +0 -479
- package/src/modeller/property-sidebar/effects/effects-shared-style.ts +0 -62
- package/src/modeller/property-sidebar/effects/effects.ts +0 -52
- package/src/modeller/property-sidebar/effects/property-event-hover.ts +0 -201
- package/src/modeller/property-sidebar/effects/property-event-tap.ts +0 -212
- package/src/modeller/property-sidebar/effects/property-event.ts +0 -76
- package/src/modeller/property-sidebar/effects/property-shadow.ts +0 -114
- package/src/modeller/property-sidebar/effects/value-converter.ts +0 -23
- package/src/modeller/property-sidebar/inspector/inspector.ts +0 -408
- package/src/modeller/property-sidebar/property-shared-style.ts +0 -136
- package/src/modeller/property-sidebar/property-sidebar.ts +0 -342
- package/src/modeller/property-sidebar/shapes/box-padding-editor-styles.ts +0 -94
- package/src/modeller/property-sidebar/shapes/shapes.ts +0 -410
- package/src/modeller/property-sidebar/specifics/specific-properties-builder.ts +0 -147
- package/src/modeller/property-sidebar/specifics/specifics.ts +0 -81
- package/src/modeller/property-sidebar/styles/styles.ts +0 -577
- package/src/ox-editor-process-selector.ts +0 -91
- package/src/ox-process-list.ts +0 -401
- package/src/ox-process-modeller.ts +0 -432
- package/src/ox-process-template-list.ts +0 -272
- package/src/ox-process-template-viewer.ts +0 -198
- package/src/ox-process-viewer.ts +0 -575
- package/src/ox-property-editor-process-selector.ts +0 -23
- package/src/selector/ox-process-creation-card.ts +0 -95
- package/src/selector/ox-process-selector.ts +0 -324
- package/src/selector/process-creation-popup.ts +0 -151
- package/src/selector/process-thumbnail-card.ts +0 -175
- package/src/types.ts +0 -57
- package/stories/index.stories.ts +0 -54
- package/tsconfig.json +0 -24
- package/web-dev-server.config.mjs +0 -30
- package/web-test-runner.config.mjs +0 -29
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import '@operato/input/ox-input-data.js'
|
|
6
|
-
import '@operato/i18n/ox-i18n.js'
|
|
7
|
-
|
|
8
|
-
import { css, html, LitElement } from 'lit'
|
|
9
|
-
import { property } from 'lit/decorators.js'
|
|
10
|
-
import { ifDefined } from 'lit/directives/if-defined.js'
|
|
11
|
-
|
|
12
|
-
import { Properties, Scene } from '@hatiolab/things-scene'
|
|
13
|
-
|
|
14
|
-
import { EffectsSharedStyle } from './effects-shared-style.js'
|
|
15
|
-
import { convert } from './value-converter'
|
|
16
|
-
|
|
17
|
-
const SETS_ACTION = ['data-set', 'partial-data-set', 'value-set', 'partial-value-set']
|
|
18
|
-
|
|
19
|
-
export class PropertyEventHover extends LitElement {
|
|
20
|
-
static styles = [
|
|
21
|
-
EffectsSharedStyle,
|
|
22
|
-
css`
|
|
23
|
-
datalist option.cursor-auto {
|
|
24
|
-
cursor: auto;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
datalist option.cursor-pointer {
|
|
28
|
-
cursor: pointer;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
datalist option.cursor-default {
|
|
32
|
-
cursor: default;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
datalist option.cursor-move {
|
|
36
|
-
cursor: move;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
datalist option.cursor-text {
|
|
40
|
-
cursor: text;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
datalist option.cursor-wait {
|
|
44
|
-
cursor: wait;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
datalist option.cursor-help {
|
|
48
|
-
cursor: help;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
datalist option.cursor-crosshair {
|
|
52
|
-
cursor: crosshair;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
datalist option.cursor-not-allowed {
|
|
56
|
-
cursor: not-allowed;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
datalist option.cursor-grab {
|
|
60
|
-
cursor: grab;
|
|
61
|
-
}
|
|
62
|
-
`
|
|
63
|
-
]
|
|
64
|
-
|
|
65
|
-
@property({ type: Object }) value?: Properties
|
|
66
|
-
@property({ type: Object }) scene?: Scene
|
|
67
|
-
|
|
68
|
-
firstUpdated() {
|
|
69
|
-
this.renderRoot.addEventListener('change', this._onValueChange.bind(this))
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
render() {
|
|
73
|
-
var { action, value = '', target = '', emphasize, restore } = this.value || {}
|
|
74
|
-
|
|
75
|
-
return html`
|
|
76
|
-
<input id="checkbox-emphasize" type="checkbox" value-key="emphasize" .checked=${emphasize} />
|
|
77
|
-
<label for="checkbox-emphasize" class="checkbox-label">
|
|
78
|
-
<ox-i18n msgid="label.emphasize">emphasize</ox-i18n>
|
|
79
|
-
</label>
|
|
80
|
-
|
|
81
|
-
<label> <ox-i18n msgid="label.action">action</ox-i18n> </label>
|
|
82
|
-
<select id="tap-select" value-key="action" .value=${action || ''}>
|
|
83
|
-
<option value=""></option>
|
|
84
|
-
<option value="popup">popup target board</option>
|
|
85
|
-
<option value="info-window">open infowindow</option>
|
|
86
|
-
<option value="data-toggle">toggle(true/false) target component data</option>
|
|
87
|
-
<option value="data-tristate">tristate(0/1/2) target component data</option>
|
|
88
|
-
<option value="data-set">set value to target component data</option>
|
|
89
|
-
<option value="value-set">set value to target component value</option>
|
|
90
|
-
<option value="mouse-cursor">change mouse cursor to target style</option>
|
|
91
|
-
</select>
|
|
92
|
-
|
|
93
|
-
<label> <ox-i18n msgid="label.target">target</ox-i18n> </label>
|
|
94
|
-
|
|
95
|
-
${action == 'popup'
|
|
96
|
-
? html`
|
|
97
|
-
<ox-editor-board-selector value-key="target" .value=${target} custom-editor></ox-editor-board-selector>
|
|
98
|
-
`
|
|
99
|
-
: html`
|
|
100
|
-
<input
|
|
101
|
-
value-key="target"
|
|
102
|
-
.value=${target || ''}
|
|
103
|
-
list="target-list"
|
|
104
|
-
.placeholder="${this._getPlaceHoder(action)}"
|
|
105
|
-
/>
|
|
106
|
-
|
|
107
|
-
<datalist id="target-list">
|
|
108
|
-
${this._getTargetList(action).map(
|
|
109
|
-
({ value, description, class: clazz }) =>
|
|
110
|
-
html` <option .value=${value} class=${ifDefined(clazz)}>${description}</option> `
|
|
111
|
-
)}
|
|
112
|
-
</datalist>
|
|
113
|
-
`}
|
|
114
|
-
${SETS_ACTION.indexOf(action) != -1
|
|
115
|
-
? html`
|
|
116
|
-
<label> <ox-i18n msgid="label.value">value</ox-i18n> </label>
|
|
117
|
-
<ox-input-data value-key="value" .value=${value} custom-editor fullwidth></ox-input-data>
|
|
118
|
-
`
|
|
119
|
-
: html``}
|
|
120
|
-
|
|
121
|
-
<input id="checkbox-restore" type="checkbox" value-key="restore" .checked=${restore} />
|
|
122
|
-
<label for="checkbox-restore" class="checkbox-label">
|
|
123
|
-
<ox-i18n msgid="label.restore-on-leave">restore on leave</ox-i18n>
|
|
124
|
-
</label>
|
|
125
|
-
`
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
_getPlaceHoder(action: string) {
|
|
129
|
-
switch (action) {
|
|
130
|
-
case 'popup':
|
|
131
|
-
case 'goto':
|
|
132
|
-
return 'SCENE-100'
|
|
133
|
-
case 'link-open':
|
|
134
|
-
case 'link-move':
|
|
135
|
-
return 'http://www.hatiolab.com/'
|
|
136
|
-
default:
|
|
137
|
-
return ''
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
_getTargetList(action: string): { value: string; description?: string; class?: string }[] {
|
|
142
|
-
switch (action) {
|
|
143
|
-
case 'data-toggle':
|
|
144
|
-
case 'data-tristate':
|
|
145
|
-
case 'data-set':
|
|
146
|
-
case 'value-set':
|
|
147
|
-
case 'partial-data-set':
|
|
148
|
-
case 'partial-value-set':
|
|
149
|
-
case 'data-spreading':
|
|
150
|
-
let ids =
|
|
151
|
-
(this.scene &&
|
|
152
|
-
this.scene.ids.map(i => {
|
|
153
|
-
const id = i.key
|
|
154
|
-
return { value: `#${id}`, description: this.scene!.findById(id)?.get('type') }
|
|
155
|
-
})) ||
|
|
156
|
-
[]
|
|
157
|
-
ids.unshift({ value: '(self)', description: 'self component' })
|
|
158
|
-
return ids
|
|
159
|
-
|
|
160
|
-
case 'info-window':
|
|
161
|
-
return (
|
|
162
|
-
(this.scene &&
|
|
163
|
-
this.scene.ids
|
|
164
|
-
.filter(i => {
|
|
165
|
-
return this.scene!.findById(i.key).get('type') == 'info-window'
|
|
166
|
-
})
|
|
167
|
-
.map(i => {
|
|
168
|
-
const id = i.key
|
|
169
|
-
return { value: `#${id}`, description: this.scene!.findById(id)?.get('type') }
|
|
170
|
-
})) ||
|
|
171
|
-
[]
|
|
172
|
-
)
|
|
173
|
-
|
|
174
|
-
case 'mouse-cursor':
|
|
175
|
-
return ['auto', 'pointer', 'default', 'move', 'text', 'wait', 'help', 'crosshair', 'not-allowed', 'grab'].map(
|
|
176
|
-
style => {
|
|
177
|
-
return { value: style, class: `cursor-${style}` }
|
|
178
|
-
}
|
|
179
|
-
)
|
|
180
|
-
|
|
181
|
-
default:
|
|
182
|
-
return []
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
_onValueChange(e: Event) {
|
|
187
|
-
var element = e.target as HTMLElement
|
|
188
|
-
var key = element.getAttribute('value-key')
|
|
189
|
-
|
|
190
|
-
if (!key) {
|
|
191
|
-
return
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
this.value = {
|
|
195
|
-
...this.value,
|
|
196
|
-
[key]: convert(element)
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
|
|
200
|
-
}
|
|
201
|
-
}
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import '@operato/input/ox-input-data.js'
|
|
6
|
-
import '@operato/i18n/ox-i18n.js'
|
|
7
|
-
|
|
8
|
-
import { html, LitElement } from 'lit'
|
|
9
|
-
import { property, state } from 'lit/decorators.js'
|
|
10
|
-
|
|
11
|
-
import { Properties, Scene } from '@hatiolab/things-scene'
|
|
12
|
-
|
|
13
|
-
import { scenarios } from '../../../graphql/scenario'
|
|
14
|
-
import { EffectsSharedStyle } from './effects-shared-style'
|
|
15
|
-
import { convert } from './value-converter'
|
|
16
|
-
|
|
17
|
-
const SETS_ACTION = ['data-set', 'partial-data-set', 'value-set', 'partial-value-set', 'start-scenario', 'run-scenario']
|
|
18
|
-
|
|
19
|
-
export class PropertyEventTap extends LitElement {
|
|
20
|
-
static styles = [EffectsSharedStyle]
|
|
21
|
-
|
|
22
|
-
@property({ type: Object }) value?: Properties
|
|
23
|
-
@property({ type: Object }) scene?: Scene
|
|
24
|
-
|
|
25
|
-
@state() scenarios: { value: string; description: string }[] = []
|
|
26
|
-
@state() targetList: { value: string; description: string }[] = []
|
|
27
|
-
|
|
28
|
-
async firstUpdated() {
|
|
29
|
-
this.renderRoot.addEventListener('change', this._onValueChange.bind(this))
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
render() {
|
|
33
|
-
var { action, value = '', target = '', pressed, options } = this.value || {}
|
|
34
|
-
var { input = '(self)', output = true } = options || {}
|
|
35
|
-
|
|
36
|
-
return html`
|
|
37
|
-
<input id="checkbox-pressed" type="checkbox" value-key="pressed" .checked=${pressed} />
|
|
38
|
-
<label for="checkbox-pressed" class="checkbox-label"> <ox-i18n msgid="label.pressed">pressed</ox-i18n> </label>
|
|
39
|
-
|
|
40
|
-
<label> <ox-i18n msgid="label.action">action</ox-i18n> </label>
|
|
41
|
-
<select
|
|
42
|
-
id="tap-select"
|
|
43
|
-
value-key="action"
|
|
44
|
-
.value=${action || ''}
|
|
45
|
-
@change=${async (e: Event) => {
|
|
46
|
-
if ((e.target as HTMLSelectElement).value.includes('scenario')) {
|
|
47
|
-
this.scenarios = (await scenarios()).map(({ name, description }) => {
|
|
48
|
-
return { value: name, description }
|
|
49
|
-
})
|
|
50
|
-
}
|
|
51
|
-
}}
|
|
52
|
-
>
|
|
53
|
-
<option value=""></option>
|
|
54
|
-
<option value="goto">go to target board</option>
|
|
55
|
-
<option value="link-open">open new window for target link</option>
|
|
56
|
-
<option value="link-move">move to target link</option>
|
|
57
|
-
<option value="route-page">route to page</option>
|
|
58
|
-
<option value="popup">popup target board</option>
|
|
59
|
-
<option value="modal-popup">modal popup target board</option>
|
|
60
|
-
<option value="close-scene">close current board</option>
|
|
61
|
-
<option value="infoWindow">open infowindow</option>
|
|
62
|
-
<option value="toggle-info-window">toggle infowindow</option>
|
|
63
|
-
<option value="data-toggle">toggle(true/false) target component data</option>
|
|
64
|
-
<option value="data-tristate">tristate(0/1/2) target component data</option>
|
|
65
|
-
<option value="data-set">set value to target component data</option>
|
|
66
|
-
<option value="value-set">set value to target component value</option>
|
|
67
|
-
<option value="start-scenario">start the given scenario</option>
|
|
68
|
-
<option value="run-scenario">run the given scenario</option>
|
|
69
|
-
</select>
|
|
70
|
-
|
|
71
|
-
<label> <ox-i18n msgid="label.target">target</ox-i18n> </label>
|
|
72
|
-
|
|
73
|
-
${action === 'goto' || action?.includes('popup')
|
|
74
|
-
? html`
|
|
75
|
-
<ox-editor-board-selector value-key="target" .value=${target} custom-editor></ox-editor-board-selector>
|
|
76
|
-
`
|
|
77
|
-
: html`
|
|
78
|
-
<input
|
|
79
|
-
value-key="target"
|
|
80
|
-
.value=${target}
|
|
81
|
-
list="target-list"
|
|
82
|
-
.placeholder=${this._getPlaceHoder(action)}
|
|
83
|
-
@focusin=${() => {
|
|
84
|
-
this.targetList = this._getInputList(action)
|
|
85
|
-
}}
|
|
86
|
-
/>
|
|
87
|
-
|
|
88
|
-
<datalist id="target-list">
|
|
89
|
-
${this.targetList.map(
|
|
90
|
-
({ value, description }) => html` <option .value=${value}>${description}</option> `
|
|
91
|
-
)}
|
|
92
|
-
</datalist>
|
|
93
|
-
`}
|
|
94
|
-
${action === 'goto' || action?.includes('popup')
|
|
95
|
-
? html`
|
|
96
|
-
<label for="input"> <ox-i18n msgid="label.input-data">input</ox-i18n> </label>
|
|
97
|
-
<input
|
|
98
|
-
id="input"
|
|
99
|
-
value-key="input"
|
|
100
|
-
.value=${input}
|
|
101
|
-
list="input-list"
|
|
102
|
-
@focusin=${() => {
|
|
103
|
-
this.targetList = this._getInputList(action)
|
|
104
|
-
}}
|
|
105
|
-
/>
|
|
106
|
-
<datalist id="input-list">
|
|
107
|
-
${this.targetList.map(
|
|
108
|
-
({ value, description }) => html` <option .value=${value}>${description}</option> `
|
|
109
|
-
)}
|
|
110
|
-
</datalist>
|
|
111
|
-
${
|
|
112
|
-
/* currently 'goto' does not support returning result */
|
|
113
|
-
action?.includes('popup')
|
|
114
|
-
? html` <input id="checkbox-output" type="checkbox" value-key="output" .checked=${output} />
|
|
115
|
-
<label for="checkbox-output" class="checkbox-label">
|
|
116
|
-
<ox-i18n msgid="label.will-get-return">will-get-return</ox-i18n>
|
|
117
|
-
</label>`
|
|
118
|
-
: html``
|
|
119
|
-
}
|
|
120
|
-
`
|
|
121
|
-
: SETS_ACTION.indexOf(action) != -1
|
|
122
|
-
? html`
|
|
123
|
-
<label> <ox-i18n msgid="label.value">value</ox-i18n> </label>
|
|
124
|
-
<ox-input-data value-key="value" .value=${value} custom-editor fullwidth></ox-input-data>
|
|
125
|
-
`
|
|
126
|
-
: html``}
|
|
127
|
-
`
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
_getPlaceHoder(action: string) {
|
|
131
|
-
switch (action) {
|
|
132
|
-
case 'link-open':
|
|
133
|
-
case 'link-move':
|
|
134
|
-
return 'http://www.hatiolab.com/'
|
|
135
|
-
default:
|
|
136
|
-
return ''
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
_getInputList(action: string): { value: string; description: string }[] {
|
|
141
|
-
switch (action) {
|
|
142
|
-
case 'data-toggle':
|
|
143
|
-
case 'data-tristate':
|
|
144
|
-
case 'data-set':
|
|
145
|
-
case 'value-set':
|
|
146
|
-
case 'popup':
|
|
147
|
-
case 'modal-popup':
|
|
148
|
-
let ids =
|
|
149
|
-
(this.scene &&
|
|
150
|
-
this.scene.ids.map(i => {
|
|
151
|
-
const id = i.key
|
|
152
|
-
return { value: `#${id}`, description: this.scene!.findById(id)?.get('type') }
|
|
153
|
-
})) ||
|
|
154
|
-
[]
|
|
155
|
-
ids.unshift({ value: '(self)', description: 'self component' })
|
|
156
|
-
return ids
|
|
157
|
-
case 'infoWindow':
|
|
158
|
-
case 'toggle-info-window':
|
|
159
|
-
return (
|
|
160
|
-
(this.scene &&
|
|
161
|
-
this.scene.ids
|
|
162
|
-
.filter(i => {
|
|
163
|
-
return this.scene!.findById(i.key).get('type') == 'info-window'
|
|
164
|
-
})
|
|
165
|
-
.map(i => {
|
|
166
|
-
const id = i.key
|
|
167
|
-
return { value: `#${id}`, description: this.scene!.findById(id)?.get('type') }
|
|
168
|
-
})) ||
|
|
169
|
-
[]
|
|
170
|
-
)
|
|
171
|
-
case 'start-scenario':
|
|
172
|
-
case 'run-scenario':
|
|
173
|
-
return this.scenarios
|
|
174
|
-
default:
|
|
175
|
-
return []
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
_onValueChange(e: Event) {
|
|
180
|
-
var element = e.target as HTMLElement
|
|
181
|
-
var key = element.getAttribute('value-key')
|
|
182
|
-
|
|
183
|
-
if (!key) {
|
|
184
|
-
return
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
if (key === 'input' || key === 'output') {
|
|
188
|
-
var { options = {} } = this.value || {}
|
|
189
|
-
|
|
190
|
-
this.value = {
|
|
191
|
-
...this.value,
|
|
192
|
-
options: {
|
|
193
|
-
...options,
|
|
194
|
-
[key]: convert(element)
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
} else {
|
|
198
|
-
this.value = {
|
|
199
|
-
...this.value,
|
|
200
|
-
[key]: convert(element)
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
var { action } = this.value
|
|
205
|
-
if (action !== 'goto' && !action?.includes('popup')) {
|
|
206
|
-
/* clear unused options */
|
|
207
|
-
delete this.value.options
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
|
|
211
|
-
}
|
|
212
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import '@operato/help/ox-title-with-help.js'
|
|
6
|
-
|
|
7
|
-
import { html, LitElement } from 'lit'
|
|
8
|
-
import { property } from 'lit/decorators.js'
|
|
9
|
-
|
|
10
|
-
import { Properties, Scene } from '@hatiolab/things-scene'
|
|
11
|
-
import { ScopedElementsMixin } from '@open-wc/scoped-elements'
|
|
12
|
-
|
|
13
|
-
import { PropertySharedStyle } from '../property-shared-style'
|
|
14
|
-
import { PropertyEventHover } from './property-event-hover'
|
|
15
|
-
import { PropertyEventTap } from './property-event-tap'
|
|
16
|
-
import { convert } from './value-converter'
|
|
17
|
-
|
|
18
|
-
export class PropertyEvent extends ScopedElementsMixin(LitElement) {
|
|
19
|
-
static styles = [PropertySharedStyle]
|
|
20
|
-
|
|
21
|
-
@property({ type: Object }) value?: Properties
|
|
22
|
-
@property({ type: Object }) scene?: Scene
|
|
23
|
-
|
|
24
|
-
firstUpdated() {
|
|
25
|
-
this.renderRoot.addEventListener('change', this._onValueChange.bind(this))
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
static get scopedElements() {
|
|
29
|
-
return {
|
|
30
|
-
'property-event-hover': PropertyEventHover,
|
|
31
|
-
'property-event-tap': PropertyEventTap
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
render() {
|
|
36
|
-
const value = this.value || {}
|
|
37
|
-
|
|
38
|
-
return html`
|
|
39
|
-
<fieldset>
|
|
40
|
-
<legend>
|
|
41
|
-
<ox-title-with-help
|
|
42
|
-
msgid="label.hover-event"
|
|
43
|
-
topic="process-modeller/effects/hover-event"
|
|
44
|
-
></ox-title-with-help>
|
|
45
|
-
</legend>
|
|
46
|
-
|
|
47
|
-
<property-event-hover value-key="hover" .scene=${this.scene} .value=${value.hover || {}}>
|
|
48
|
-
</property-event-hover>
|
|
49
|
-
</fieldset>
|
|
50
|
-
|
|
51
|
-
<fieldset>
|
|
52
|
-
<legend>
|
|
53
|
-
<ox-title-with-help msgid="label.tap-event" topic="process-modeller/effects/tap-event"></ox-title-with-help>
|
|
54
|
-
</legend>
|
|
55
|
-
|
|
56
|
-
<property-event-tap value-key="tap" .scene=${this.scene} .value=${value.tap || {}}> </property-event-tap>
|
|
57
|
-
</fieldset>
|
|
58
|
-
`
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
_onValueChange(e: Event) {
|
|
62
|
-
var element = e.target as HTMLElement
|
|
63
|
-
var key = element.getAttribute('value-key')
|
|
64
|
-
|
|
65
|
-
if (!key) {
|
|
66
|
-
return
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
this.value = {
|
|
70
|
-
...this.value,
|
|
71
|
-
[key]: convert(element)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
|
|
75
|
-
}
|
|
76
|
-
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import '@operato/i18n/ox-i18n.js'
|
|
6
|
-
import '@operato/input/ox-input-color.js'
|
|
7
|
-
|
|
8
|
-
import { css, html, LitElement } from 'lit'
|
|
9
|
-
import { property } from 'lit/decorators.js'
|
|
10
|
-
|
|
11
|
-
import { Properties } from '@hatiolab/things-scene'
|
|
12
|
-
|
|
13
|
-
import { convert } from './value-converter'
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* 컴포넌트의 그림자 속성을 편집하는 element
|
|
17
|
-
*
|
|
18
|
-
* Example:
|
|
19
|
-
* <property-shadow
|
|
20
|
-
* @change="${e => { this.shadow = e.target.value }}"
|
|
21
|
-
* value="${this.shadow}"
|
|
22
|
-
* ></property-shadow>
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
export class PropertyShadow extends LitElement {
|
|
26
|
-
static styles = [
|
|
27
|
-
css`
|
|
28
|
-
:host {
|
|
29
|
-
display: grid;
|
|
30
|
-
grid-template-columns: repeat(10, 1fr);
|
|
31
|
-
grid-gap: 5px;
|
|
32
|
-
grid-auto-rows: minmax(24px, auto);
|
|
33
|
-
|
|
34
|
-
align-items: center;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
* {
|
|
38
|
-
align-self: stretch;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
label {
|
|
42
|
-
grid-column: span 3;
|
|
43
|
-
text-align: right;
|
|
44
|
-
text-transform: capitalize;
|
|
45
|
-
|
|
46
|
-
align-self: center;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
input[type='number'],
|
|
50
|
-
ox-input-color {
|
|
51
|
-
grid-column: span 7;
|
|
52
|
-
}
|
|
53
|
-
input[type='number'] {
|
|
54
|
-
border: var(--property-sidebar-fieldset-border);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.icon-only-label {
|
|
58
|
-
grid-column: span 3;
|
|
59
|
-
background: var(--url-icon-properties-label) no-repeat;
|
|
60
|
-
float: left;
|
|
61
|
-
margin: 0;
|
|
62
|
-
align-self: stretch;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.icon-only-label.color {
|
|
66
|
-
background-position: 100% -500px;
|
|
67
|
-
}
|
|
68
|
-
`
|
|
69
|
-
]
|
|
70
|
-
|
|
71
|
-
@property({ type: Object }) value?: Properties
|
|
72
|
-
|
|
73
|
-
firstUpdated() {
|
|
74
|
-
this.renderRoot.addEventListener('change', this._onValueChange.bind(this))
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
render() {
|
|
78
|
-
const value = this.value || {}
|
|
79
|
-
|
|
80
|
-
return html`
|
|
81
|
-
<label> <ox-i18n msgid="label.shadowOffsetX">offset-X</ox-i18n> </label>
|
|
82
|
-
|
|
83
|
-
<input type="number" value-key="left" .value=${value.left} />
|
|
84
|
-
|
|
85
|
-
<label> <ox-i18n msgid="label.shadowOffsetY">offset-Y</ox-i18n> </label>
|
|
86
|
-
|
|
87
|
-
<input type="number" value-key="top" .value=${value.top} />
|
|
88
|
-
|
|
89
|
-
<label> <ox-i18n msgid="label.shadowSize">Size</ox-i18n> </label>
|
|
90
|
-
|
|
91
|
-
<input type="number" value-key="blurSize" .value=${value.blurSize} />
|
|
92
|
-
|
|
93
|
-
<label class="icon-only-label color"></label>
|
|
94
|
-
|
|
95
|
-
<ox-input-color value-key="color" .value=${value.color}> </ox-input-color>
|
|
96
|
-
`
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
_onValueChange(e: Event) {
|
|
100
|
-
var element = e.target as HTMLElement
|
|
101
|
-
var key = element.getAttribute('value-key')
|
|
102
|
-
|
|
103
|
-
if (!key) {
|
|
104
|
-
return
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
this.value = {
|
|
108
|
-
...this.value,
|
|
109
|
-
[key]: convert(element)
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
|
|
113
|
-
}
|
|
114
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export function convert(element: any) {
|
|
2
|
-
switch (element.tagName) {
|
|
3
|
-
case 'INPUT':
|
|
4
|
-
switch (element.type) {
|
|
5
|
-
case 'checkbox':
|
|
6
|
-
return element.checked
|
|
7
|
-
case 'number':
|
|
8
|
-
return Number(element.value) || 0
|
|
9
|
-
case 'text':
|
|
10
|
-
return String(element.value)
|
|
11
|
-
}
|
|
12
|
-
break
|
|
13
|
-
|
|
14
|
-
case 'PAPER-BUTTON':
|
|
15
|
-
return element.active
|
|
16
|
-
|
|
17
|
-
case 'PAPER-LISTBOX':
|
|
18
|
-
return element.selected
|
|
19
|
-
|
|
20
|
-
default:
|
|
21
|
-
return element.value
|
|
22
|
-
}
|
|
23
|
-
}
|