@things-factory/board-ui 4.0.13 → 4.0.18
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/client/index.js +0 -2
- package/client/pages/board-modeller-page.js +6 -75
- package/client/pages/board-player-page.js +1 -1
- package/client/pages/board-viewer-page.js +1 -1
- package/package.json +9 -9
- package/assets/images/icon-properties-ipattern.png +0 -0
- package/client/board-modeller/board-modeller.js +0 -229
- package/client/board-modeller/component-toolbar/component-menu.js +0 -153
- package/client/board-modeller/component-toolbar/component-toolbar.js +0 -193
- package/client/board-modeller/edit-toolbar-style.js +0 -228
- package/client/board-modeller/edit-toolbar.js +0 -637
- package/client/board-modeller/property-sidebar/abstract-property.js +0 -73
- package/client/board-modeller/property-sidebar/data-binding/data-binding-mapper.js +0 -366
- package/client/board-modeller/property-sidebar/data-binding/data-binding.js +0 -476
- package/client/board-modeller/property-sidebar/effects/effects-shared-style.js +0 -58
- package/client/board-modeller/property-sidebar/effects/effects.js +0 -64
- package/client/board-modeller/property-sidebar/effects/property-animation.js +0 -141
- package/client/board-modeller/property-sidebar/effects/property-animations.js +0 -92
- package/client/board-modeller/property-sidebar/effects/property-event-hover.js +0 -144
- package/client/board-modeller/property-sidebar/effects/property-event-tap.js +0 -146
- package/client/board-modeller/property-sidebar/effects/property-event.js +0 -72
- package/client/board-modeller/property-sidebar/effects/property-shadow.js +0 -122
- package/client/board-modeller/property-sidebar/effects/value-converter.js +0 -26
- package/client/board-modeller/property-sidebar/inspector/inspector.js +0 -338
- package/client/board-modeller/property-sidebar/property-shared-style.js +0 -132
- package/client/board-modeller/property-sidebar/property-sidebar.js +0 -324
- package/client/board-modeller/property-sidebar/shapes/box-padding-editor-styles.js +0 -94
- package/client/board-modeller/property-sidebar/shapes/shapes.js +0 -421
- package/client/board-modeller/property-sidebar/specifics/specific-properties-builder.js +0 -149
- package/client/board-modeller/property-sidebar/specifics/specifics.js +0 -248
- package/client/board-modeller/property-sidebar/styles/styles.js +0 -591
- package/client/board-modeller/scene-viewer/confidential-overlay.js +0 -18
- package/client/board-modeller/scene-viewer/things-scene-handler.js +0 -50
- package/client/board-modeller/scene-viewer/things-scene-layer.js +0 -52
- package/client/board-modeller/scene-viewer/things-scene-player.js +0 -115
- package/client/board-modeller/scene-viewer/things-scene-property.js +0 -25
- package/client/board-modeller/scene-viewer/things-scene-viewer.js +0 -312
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { LitElement, html } from 'lit-element'
|
|
6
|
-
|
|
7
|
-
import '@things-factory/i18n-base'
|
|
8
|
-
import '@things-factory/modeller-ui/client/editors/things-editor-angle-input'
|
|
9
|
-
|
|
10
|
-
import { EffectsSharedStyle } from './effects-shared-style'
|
|
11
|
-
import { convert } from './value-converter'
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* 컴포넌트의 animation 속성을 편집하는 element
|
|
15
|
-
|
|
16
|
-
Example:
|
|
17
|
-
|
|
18
|
-
<property-animation .value=${animation}>
|
|
19
|
-
</property-animation>
|
|
20
|
-
*/
|
|
21
|
-
export default class PropertyAnimation extends LitElement {
|
|
22
|
-
static get properties() {
|
|
23
|
-
return {
|
|
24
|
-
value: Object,
|
|
25
|
-
scene: Object
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
static get styles() {
|
|
30
|
-
return [EffectsSharedStyle]
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
constructor() {
|
|
34
|
-
super()
|
|
35
|
-
|
|
36
|
-
this.value = {}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
firstUpdated() {
|
|
40
|
-
this.shadowRoot.addEventListener('change', this._onValueChange.bind(this))
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
render() {
|
|
44
|
-
return html`
|
|
45
|
-
<label>Animation Type</label>
|
|
46
|
-
<select value-key="type" .value=${this.value && this.value.type}>
|
|
47
|
-
<option value="">None</option>
|
|
48
|
-
<option value="rotation">Rotation</option>
|
|
49
|
-
<option value="vibration">Vibration</option>
|
|
50
|
-
<option value="heartbeat">Heartbeat</option>
|
|
51
|
-
<option value="moving">Moving</option>
|
|
52
|
-
<option value="fade">Fade</option>
|
|
53
|
-
<option value="outline">Outline</option>
|
|
54
|
-
</select>
|
|
55
|
-
|
|
56
|
-
<label> <i18n-msg msgid="label.waiting-time">waiting time</i18n-msg> </label>
|
|
57
|
-
<input type="number" value-key="delay" .value=${this.value.delay} placeholder="ms" />
|
|
58
|
-
|
|
59
|
-
<label> <i18n-msg msgid="label.duration">duration</i18n-msg> </label>
|
|
60
|
-
<input type="number" value-key="duration" .value=${this.value.duration} placeholder="ms" />
|
|
61
|
-
|
|
62
|
-
${this.value.type == 'rotation' || this.value.type == 'vibration'
|
|
63
|
-
? html`
|
|
64
|
-
<label> <i18n-msg msgid="label.theta">theta</i18n-msg> </label>
|
|
65
|
-
<things-editor-angle-input value-key="theta" .radian=${this.value.theta}> </things-editor-angle-input>
|
|
66
|
-
`
|
|
67
|
-
: html``}
|
|
68
|
-
${this.value.type == 'heartbeat'
|
|
69
|
-
? html`
|
|
70
|
-
<label> <i18n-msg msgid="label.scale">scale</i18n-msg> </label>
|
|
71
|
-
<input type="number" value-key="scale" .value=${this.value.scale} />
|
|
72
|
-
`
|
|
73
|
-
: html``}
|
|
74
|
-
${this.value.type == 'moving'
|
|
75
|
-
? html`
|
|
76
|
-
<label> <i18n-msg msgid="label.x-axes">X-axes</i18n-msg> </label>
|
|
77
|
-
<input type="number" value-key="x" .value=${this.value.x} />
|
|
78
|
-
|
|
79
|
-
<label> <i18n-msg msgid="label.y-axes">Y-axes</i18n-msg> </label>
|
|
80
|
-
<input type="number" value-key="y" .value=${this.value.y} />
|
|
81
|
-
`
|
|
82
|
-
: html``}
|
|
83
|
-
${this.value.type == 'fade'
|
|
84
|
-
? html`
|
|
85
|
-
<label> <i18n-msg msgid="label.start-alpha">start alpha</i18n-msg> </label>
|
|
86
|
-
<input type="number" value-key="startAlpha" .value=${this.value.startAlpha} />
|
|
87
|
-
|
|
88
|
-
<label> <i18n-msg msgid="label.end-alpha">end alpha</i18n-msg> </label>
|
|
89
|
-
<input type="number" value-key="endAlpha" .value=${this.value.endAlpha} />
|
|
90
|
-
`
|
|
91
|
-
: html``}
|
|
92
|
-
${this.value.type == 'outline'
|
|
93
|
-
? html`
|
|
94
|
-
<label> <i18n-msg msgid="label.target">target</i18n-msg> </label>
|
|
95
|
-
<input value-key="rideOn" .value=${this.value.rideOn || ''} list="target-list" />
|
|
96
|
-
<datalist id="target-list">
|
|
97
|
-
${this.scene.ids.map(info => info.key).map(id => html` <option value=${id}></option> `)}
|
|
98
|
-
</datalist>
|
|
99
|
-
`
|
|
100
|
-
: html``}
|
|
101
|
-
|
|
102
|
-
<input id="checkbox-repeat" value-key="repeat" type="checkbox" .checked=${this.value.repeat} />
|
|
103
|
-
<label for="checkbox-repeat" class="checkbox-label"> <i18n-msg msgid="label.repeat">repeat</i18n-msg> </label>
|
|
104
|
-
|
|
105
|
-
<label>delta</label>
|
|
106
|
-
<select value-key="delta" .value=${this.value.delta}>
|
|
107
|
-
<option value="linear">linear</option>
|
|
108
|
-
<option value="quad">quad</option>
|
|
109
|
-
<option value="circ">circ</option>
|
|
110
|
-
<option value="back">back</option>
|
|
111
|
-
<option value="bounce">bounce</option>
|
|
112
|
-
<option value="elastic">elastic</option>
|
|
113
|
-
</select>
|
|
114
|
-
|
|
115
|
-
<label>ease</label>
|
|
116
|
-
<select value-key="ease" .value=${this.value.ease}>
|
|
117
|
-
<option value="in">in</option>
|
|
118
|
-
<option value="out">out</option>
|
|
119
|
-
<option value="inout">inout</option>
|
|
120
|
-
</select>
|
|
121
|
-
`
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
_onValueChange(e) {
|
|
125
|
-
var element = e.target
|
|
126
|
-
var key = element.getAttribute('value-key')
|
|
127
|
-
|
|
128
|
-
if (!key) {
|
|
129
|
-
return
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
this.value = {
|
|
133
|
-
...this.value,
|
|
134
|
-
[key]: convert(element)
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
customElements.define('property-animation', PropertyAnimation)
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { LitElement, html, css } from 'lit-element'
|
|
6
|
-
|
|
7
|
-
import '@things-factory/i18n-base'
|
|
8
|
-
import './property-animation'
|
|
9
|
-
import '@material/mwc-icon'
|
|
10
|
-
|
|
11
|
-
import { PropertySharedStyle } from '../property-shared-style'
|
|
12
|
-
import { convert } from './value-converter'
|
|
13
|
-
|
|
14
|
-
class PropertyAnimations extends LitElement {
|
|
15
|
-
static get properties() {
|
|
16
|
-
return {
|
|
17
|
-
value: Object,
|
|
18
|
-
scene: Object,
|
|
19
|
-
_expanded: Boolean
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
static get styles() {
|
|
24
|
-
return [
|
|
25
|
-
PropertySharedStyle,
|
|
26
|
-
css`
|
|
27
|
-
fieldset[collapsable] legend {
|
|
28
|
-
box-sizing: border-box;
|
|
29
|
-
width: 100%;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
fieldset[collapsable] legend mwc-icon {
|
|
33
|
-
float: right;
|
|
34
|
-
font-size: medium;
|
|
35
|
-
margin: 0;
|
|
36
|
-
cursor: pointer;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
fieldset[collapsable][collapsed] > :not(legend) {
|
|
40
|
-
display: none;
|
|
41
|
-
}
|
|
42
|
-
`
|
|
43
|
-
]
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
constructor() {
|
|
47
|
-
super()
|
|
48
|
-
|
|
49
|
-
this.value = {}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
firstUpdated() {
|
|
53
|
-
this.shadowRoot.addEventListener('change', this._onValueChange.bind(this))
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
render() {
|
|
57
|
-
return html`
|
|
58
|
-
<fieldset collapsable ?collapsed=${!this._expanded}>
|
|
59
|
-
<legend>
|
|
60
|
-
<title-with-help topic="board-modeller/effects/animation" msgid="label.animation">animation</title-with-help>
|
|
61
|
-
<mwc-icon
|
|
62
|
-
@click=${e => {
|
|
63
|
-
this._expanded = !this._expanded
|
|
64
|
-
}}
|
|
65
|
-
>${this._expanded ? 'expand_less' : 'expand_more'}</mwc-icon
|
|
66
|
-
>
|
|
67
|
-
</legend>
|
|
68
|
-
|
|
69
|
-
<property-animation value-key="oncreate" .scene=${this.scene} .value=${this.value.oncreate || {}}>
|
|
70
|
-
</property-animation>
|
|
71
|
-
</fieldset>
|
|
72
|
-
`
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
_onValueChange(e) {
|
|
76
|
-
var element = e.target
|
|
77
|
-
var key = element.getAttribute('value-key')
|
|
78
|
-
|
|
79
|
-
if (!key) {
|
|
80
|
-
return
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
this.value = {
|
|
84
|
-
...this.value,
|
|
85
|
-
[key]: convert(element)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
customElements.define('property-animations', PropertyAnimations)
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { LitElement, html } from 'lit-element'
|
|
6
|
-
|
|
7
|
-
import '@things-factory/i18n-base'
|
|
8
|
-
|
|
9
|
-
import { EffectsSharedStyle } from './effects-shared-style'
|
|
10
|
-
import { convert } from './value-converter'
|
|
11
|
-
|
|
12
|
-
class PropertyEventHover extends LitElement {
|
|
13
|
-
static get properties() {
|
|
14
|
-
return {
|
|
15
|
-
value: Object,
|
|
16
|
-
scene: Object
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
static get styles() {
|
|
21
|
-
return [EffectsSharedStyle]
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
constructor() {
|
|
25
|
-
super()
|
|
26
|
-
|
|
27
|
-
this.value = {}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
firstUpdated() {
|
|
31
|
-
this.shadowRoot.addEventListener('change', this._onValueChange.bind(this))
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
render() {
|
|
35
|
-
var { action, value = '', target = '', emphasize, restore } = this.value
|
|
36
|
-
|
|
37
|
-
return html`
|
|
38
|
-
<input id="checkbox-emphasize" type="checkbox" value-key="emphasize" .checked=${emphasize} />
|
|
39
|
-
<label for="checkbox-emphasize" class="checkbox-label">
|
|
40
|
-
<i18n-msg msgid="label.emphasize">emphasize</i18n-msg>
|
|
41
|
-
</label>
|
|
42
|
-
|
|
43
|
-
<label> <i18n-msg msgid="label.action">action</i18n-msg> </label>
|
|
44
|
-
<select id="tap-select" value-key="action" .value=${action || ''}>
|
|
45
|
-
<option value=""></option>
|
|
46
|
-
<option value="popup">popup target board</option>
|
|
47
|
-
<option value="infoWindow">open infowindow</option>
|
|
48
|
-
<option value="data-toggle">toggle(true/false) target component data</option>
|
|
49
|
-
<option value="data-tristate">tristate(0/1/2) target component data</option>
|
|
50
|
-
<option value="data-set">set value to target component data</option>
|
|
51
|
-
<option value="value-set">set value to target component value</option>
|
|
52
|
-
</select>
|
|
53
|
-
|
|
54
|
-
<label> <i18n-msg msgid="label.target">target</i18n-msg> </label>
|
|
55
|
-
|
|
56
|
-
${action == 'popup'
|
|
57
|
-
? html`
|
|
58
|
-
<things-editor-board-selector
|
|
59
|
-
value-key="target"
|
|
60
|
-
.value=${target}
|
|
61
|
-
custom-editor
|
|
62
|
-
></things-editor-board-selector>
|
|
63
|
-
`
|
|
64
|
-
: html`
|
|
65
|
-
<input
|
|
66
|
-
value-key="target"
|
|
67
|
-
.value=${target || ''}
|
|
68
|
-
list="target-list"
|
|
69
|
-
.placeholder="${this._getPlaceHoder(action)}"
|
|
70
|
-
/>
|
|
71
|
-
|
|
72
|
-
<datalist id="target-list">
|
|
73
|
-
${this._getTargetList(action).map(item => html` <option .value=${item}></option> `)}
|
|
74
|
-
</datalist>
|
|
75
|
-
`}
|
|
76
|
-
${action == 'data-set' || action == 'value-set'
|
|
77
|
-
? html`
|
|
78
|
-
<label> <i18n-msg msgid="label.value">value</i18n-msg> </label>
|
|
79
|
-
<things-editor-data value-key="value" .value=${value} custom-editor fullwidth></things-editor-data>
|
|
80
|
-
`
|
|
81
|
-
: html``}
|
|
82
|
-
|
|
83
|
-
<input id="checkbox-restore" type="checkbox" value-key="restore" .checked=${restore} />
|
|
84
|
-
<label for="checkbox-restore" class="checkbox-label">
|
|
85
|
-
<i18n-msg msgid="label.restore-on-leave">restore on leave</i18n-msg>
|
|
86
|
-
</label>
|
|
87
|
-
`
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
_getPlaceHoder(action) {
|
|
91
|
-
switch (action) {
|
|
92
|
-
case 'popup':
|
|
93
|
-
case 'goto':
|
|
94
|
-
return 'SCENE-100'
|
|
95
|
-
case 'link-open':
|
|
96
|
-
case 'link-move':
|
|
97
|
-
return 'http://www.hatiolab.com/'
|
|
98
|
-
default:
|
|
99
|
-
return ''
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
_getTargetList(action) {
|
|
104
|
-
switch (action) {
|
|
105
|
-
case 'data-toggle':
|
|
106
|
-
case 'data-tristate':
|
|
107
|
-
case 'data-set':
|
|
108
|
-
case 'value-set':
|
|
109
|
-
let ids = (this.scene && this.scene.ids.map(i => `#${i.key}`)) || []
|
|
110
|
-
ids.unshift('(self)')
|
|
111
|
-
return ids
|
|
112
|
-
case 'infoWindow':
|
|
113
|
-
return (
|
|
114
|
-
(this.scene &&
|
|
115
|
-
this.scene.ids
|
|
116
|
-
.filter(i => {
|
|
117
|
-
return this.scene.findById(i.key).get('type') == 'info-window'
|
|
118
|
-
})
|
|
119
|
-
.map(i => `${i.key}`)) ||
|
|
120
|
-
[]
|
|
121
|
-
)
|
|
122
|
-
default:
|
|
123
|
-
return []
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
_onValueChange(e) {
|
|
128
|
-
var element = e.target
|
|
129
|
-
var key = element.getAttribute('value-key')
|
|
130
|
-
|
|
131
|
-
if (!key) {
|
|
132
|
-
return
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
this.value = {
|
|
136
|
-
...this.value,
|
|
137
|
-
[key]: convert(element)
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
customElements.define('property-event-hover', PropertyEventHover)
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { LitElement, html } from 'lit-element'
|
|
6
|
-
|
|
7
|
-
import '@things-factory/i18n-base'
|
|
8
|
-
|
|
9
|
-
import { EffectsSharedStyle } from './effects-shared-style'
|
|
10
|
-
import '../../editors/things-editor-board-selector'
|
|
11
|
-
import { convert } from './value-converter'
|
|
12
|
-
|
|
13
|
-
class PropertyEventTap extends LitElement {
|
|
14
|
-
static get properties() {
|
|
15
|
-
return {
|
|
16
|
-
value: Object,
|
|
17
|
-
scene: Object
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
static get styles() {
|
|
22
|
-
return [EffectsSharedStyle]
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
constructor() {
|
|
26
|
-
super()
|
|
27
|
-
|
|
28
|
-
this.value = {}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
firstUpdated() {
|
|
32
|
-
this.shadowRoot.addEventListener('change', this._onValueChange.bind(this))
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
render() {
|
|
36
|
-
var { action, value = '', target = '', pressed } = this.value
|
|
37
|
-
|
|
38
|
-
return html`
|
|
39
|
-
<input id="checkbox-pressed" type="checkbox" value-key="pressed" .checked=${pressed} />
|
|
40
|
-
<label for="checkbox-pressed" class="checkbox-label"> <i18n-msg msgid="label.pressed">pressed</i18n-msg> </label>
|
|
41
|
-
|
|
42
|
-
<label> <i18n-msg msgid="label.action">action</i18n-msg> </label>
|
|
43
|
-
<select id="tap-select" value-key="action" .value=${action || ''}>
|
|
44
|
-
<option value=""></option>
|
|
45
|
-
<option value="goto">go to target board</option>
|
|
46
|
-
<option value="link-open">open new window for target link</option>
|
|
47
|
-
<option value="link-move">move to target link</option>
|
|
48
|
-
<option value="route-page">route to page</option>
|
|
49
|
-
<option value="popup">popup target board</option>
|
|
50
|
-
<option value="modal-popup">modal popup target board</option>
|
|
51
|
-
<option value="close-scene">close current board</option>
|
|
52
|
-
<option value="infoWindow">open infowindow</option>
|
|
53
|
-
<option value="toggle-info-window">toggle infowindow</option>
|
|
54
|
-
<option value="data-toggle">toggle(true/false) target component data</option>
|
|
55
|
-
<option value="data-tristate">tristate(0/1/2) target component data</option>
|
|
56
|
-
<option value="data-set">set value to target component data</option>
|
|
57
|
-
<option value="value-set">set value to target component value</option>
|
|
58
|
-
</select>
|
|
59
|
-
|
|
60
|
-
<label> <i18n-msg msgid="label.target">target</i18n-msg> </label>
|
|
61
|
-
|
|
62
|
-
${action == 'goto' || action == 'popup'
|
|
63
|
-
? html`
|
|
64
|
-
<things-editor-board-selector
|
|
65
|
-
value-key="target"
|
|
66
|
-
.value=${target}
|
|
67
|
-
custom-editor
|
|
68
|
-
></things-editor-board-selector>
|
|
69
|
-
`
|
|
70
|
-
: html`
|
|
71
|
-
<input
|
|
72
|
-
value-key="target"
|
|
73
|
-
.value=${target}
|
|
74
|
-
list="target-list"
|
|
75
|
-
.placeholder="${this._getPlaceHoder(action)}"
|
|
76
|
-
/>
|
|
77
|
-
|
|
78
|
-
<datalist id="target-list">
|
|
79
|
-
${this._getTargetList(action).map(item => html` <option .value=${item}></option> `)}
|
|
80
|
-
</datalist>
|
|
81
|
-
`}
|
|
82
|
-
${action == 'data-set' || action == 'value-set'
|
|
83
|
-
? html`
|
|
84
|
-
<label> <i18n-msg msgid="label.value">value</i18n-msg> </label>
|
|
85
|
-
<things-editor-data value-key="value" .value=${value} custom-editor fullwidth></things-editor-data>
|
|
86
|
-
`
|
|
87
|
-
: html``}
|
|
88
|
-
`
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
_getPlaceHoder(action) {
|
|
92
|
-
switch (action) {
|
|
93
|
-
case 'popup':
|
|
94
|
-
case 'goto':
|
|
95
|
-
return 'SCENE-100'
|
|
96
|
-
case 'link-open':
|
|
97
|
-
case 'link-move':
|
|
98
|
-
return 'http://www.hatiolab.com/'
|
|
99
|
-
default:
|
|
100
|
-
return ''
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
_getTargetList(action) {
|
|
105
|
-
switch (action) {
|
|
106
|
-
case 'data-toggle':
|
|
107
|
-
case 'data-tristate':
|
|
108
|
-
case 'data-set':
|
|
109
|
-
case 'value-set':
|
|
110
|
-
let ids = (this.scene && this.scene.ids.map(i => `#${i.key}`)) || []
|
|
111
|
-
ids.unshift('(self)')
|
|
112
|
-
return ids
|
|
113
|
-
case 'infoWindow':
|
|
114
|
-
case 'toggle-info-window':
|
|
115
|
-
return (
|
|
116
|
-
(this.scene &&
|
|
117
|
-
this.scene.ids
|
|
118
|
-
.filter(i => {
|
|
119
|
-
return this.scene.findById(i.key).get('type') == 'info-window'
|
|
120
|
-
})
|
|
121
|
-
.map(i => `${i.key}`)) ||
|
|
122
|
-
[]
|
|
123
|
-
)
|
|
124
|
-
default:
|
|
125
|
-
return []
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
_onValueChange(e) {
|
|
130
|
-
var element = e.target
|
|
131
|
-
var key = element.getAttribute('value-key')
|
|
132
|
-
|
|
133
|
-
if (!key) {
|
|
134
|
-
return
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
this.value = {
|
|
138
|
-
...this.value,
|
|
139
|
-
[key]: convert(element)
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
customElements.define('property-event-tap', PropertyEventTap)
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { LitElement, html } from 'lit-element'
|
|
6
|
-
|
|
7
|
-
import '@things-factory/i18n-base'
|
|
8
|
-
import './property-event-hover'
|
|
9
|
-
import './property-event-tap'
|
|
10
|
-
|
|
11
|
-
import { PropertySharedStyle } from '../property-shared-style'
|
|
12
|
-
import { convert } from './value-converter'
|
|
13
|
-
|
|
14
|
-
class PropertyEvent extends LitElement {
|
|
15
|
-
static get properties() {
|
|
16
|
-
return {
|
|
17
|
-
value: Object,
|
|
18
|
-
scene: Object
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
static get styles() {
|
|
23
|
-
return [PropertySharedStyle]
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
constructor() {
|
|
27
|
-
super()
|
|
28
|
-
|
|
29
|
-
this.value = {}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
firstUpdated() {
|
|
33
|
-
this.shadowRoot.addEventListener('change', this._onValueChange.bind(this))
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
render() {
|
|
37
|
-
return html`
|
|
38
|
-
<fieldset>
|
|
39
|
-
<legend>
|
|
40
|
-
<title-with-help msgid="label.hover-event" topic="board-modeller/effects/hover-event"></title-with-help>
|
|
41
|
-
</legend>
|
|
42
|
-
|
|
43
|
-
<property-event-hover value-key="hover" .scene=${this.scene} .value=${this.value.hover || {}}>
|
|
44
|
-
</property-event-hover>
|
|
45
|
-
</fieldset>
|
|
46
|
-
|
|
47
|
-
<fieldset>
|
|
48
|
-
<legend><title-with-help msgid="label.tap-event" topic="board-modeller/effects/tap-event"></title-with-help></legend>
|
|
49
|
-
|
|
50
|
-
<property-event-tap value-key="tap" .scene=${this.scene} .value=${this.value.tap || {}}> </property-event-tap>
|
|
51
|
-
</fieldset>
|
|
52
|
-
`
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
_onValueChange(e) {
|
|
56
|
-
var element = e.target
|
|
57
|
-
var key = element.getAttribute('value-key')
|
|
58
|
-
|
|
59
|
-
if (!key) {
|
|
60
|
-
return
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
this.value = {
|
|
64
|
-
...this.value,
|
|
65
|
-
[key]: convert(element)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
customElements.define('property-event', PropertyEvent)
|