@operato/board 0.2.44 → 0.2.48
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/@types/global/index.d.ts +1 -0
- package/CHANGELOG.md +57 -0
- package/assets/images/components/no-image.png +0 -0
- package/custom-elements.json +4272 -174
- package/demo/index-modeller.html +101 -0
- package/demo/index.html +3 -3
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/modeller/component-toolbar/component-detail.d.ts +4 -0
- package/dist/src/modeller/component-toolbar/component-detail.js +56 -0
- package/dist/src/modeller/component-toolbar/component-detail.js.map +1 -0
- package/dist/src/modeller/component-toolbar/component-menu.d.ts +4 -0
- package/dist/src/modeller/component-toolbar/component-menu.js +194 -0
- package/dist/src/modeller/component-toolbar/component-menu.js.map +1 -0
- package/dist/src/modeller/component-toolbar/component-toolbar.d.ts +4 -0
- package/dist/src/modeller/component-toolbar/component-toolbar.js +170 -0
- package/dist/src/modeller/component-toolbar/component-toolbar.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 +644 -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 +58 -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 +48 -0
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-mapper.js +351 -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.d.ts +8 -0
- package/dist/src/modeller/property-sidebar/data-binding/data-binding.js +432 -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 +57 -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 +6 -0
- package/dist/src/modeller/property-sidebar/effects/effects.js +55 -0
- package/dist/src/modeller/property-sidebar/effects/effects.js.map +1 -0
- package/dist/src/modeller/property-sidebar/effects/property-animation.d.ts +22 -0
- package/dist/src/modeller/property-sidebar/effects/property-animation.js +127 -0
- package/dist/src/modeller/property-sidebar/effects/property-animation.js.map +1 -0
- package/dist/src/modeller/property-sidebar/effects/property-animations.d.ts +5 -0
- package/dist/src/modeller/property-sidebar/effects/property-animations.js +83 -0
- package/dist/src/modeller/property-sidebar/effects/property-animations.js.map +1 -0
- package/dist/src/modeller/property-sidebar/effects/property-event-hover.d.ts +4 -0
- package/dist/src/modeller/property-sidebar/effects/property-event-hover.js +124 -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 +4 -0
- package/dist/src/modeller/property-sidebar/effects/property-event-tap.js +120 -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 +5 -0
- package/dist/src/modeller/property-sidebar/effects/property-event.js +59 -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 +22 -0
- package/dist/src/modeller/property-sidebar/effects/property-shadow.js +106 -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 +23 -0
- package/dist/src/modeller/property-sidebar/effects/value-converter.js.map +1 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector.d.ts +24 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector.js +290 -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 +131 -0
- package/dist/src/modeller/property-sidebar/property-shared-style.js.map +1 -0
- package/dist/src/modeller/property-sidebar/property-sidebar.d.ts +10 -0
- package/dist/src/modeller/property-sidebar/property-sidebar.js +313 -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 +6 -0
- package/dist/src/modeller/property-sidebar/shapes/shapes.js +406 -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 +4 -0
- package/dist/src/modeller/property-sidebar/specifics/specific-properties-builder.js +127 -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 +5 -0
- package/dist/src/modeller/property-sidebar/specifics/specifics.js +78 -0
- package/dist/src/modeller/property-sidebar/specifics/specifics.js.map +1 -0
- package/dist/src/modeller/property-sidebar/styles/styles.d.ts +8 -0
- package/dist/src/modeller/property-sidebar/styles/styles.js +562 -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-player.d.ts +1 -0
- package/dist/src/modeller/scene-viewer/ox-scene-player.js +99 -0
- package/dist/src/modeller/scene-viewer/ox-scene-player.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 +39 -0
- package/dist/src/modeller/scene-viewer/ox-scene-viewer.js +245 -0
- package/dist/src/modeller/scene-viewer/ox-scene-viewer.js.map +1 -0
- package/dist/src/ox-board-modeller.d.ts +13 -4
- package/dist/src/ox-board-modeller.js +130 -40
- package/dist/src/ox-board-modeller.js.map +1 -1
- package/dist/src/types.d.ts +12 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +26 -5
- package/src/index.ts +1 -0
- package/src/modeller/component-toolbar/component-detail.ts +53 -0
- package/src/modeller/component-toolbar/component-menu.ts +190 -0
- package/src/modeller/component-toolbar/component-toolbar.ts +161 -0
- package/src/modeller/edit-toolbar-style.ts +228 -0
- package/src/modeller/edit-toolbar.ts +640 -0
- package/src/modeller/property-sidebar/abstract-property.ts +73 -0
- package/src/modeller/property-sidebar/data-binding/data-binding-mapper.ts +371 -0
- package/src/modeller/property-sidebar/data-binding/data-binding.ts +449 -0
- package/src/modeller/property-sidebar/effects/effects-shared-style.ts +58 -0
- package/src/modeller/property-sidebar/effects/effects.ts +57 -0
- package/src/modeller/property-sidebar/effects/property-animation.ts +133 -0
- package/src/modeller/property-sidebar/effects/property-animations.ts +84 -0
- package/src/modeller/property-sidebar/effects/property-event-hover.ts +133 -0
- package/src/modeller/property-sidebar/effects/property-event-tap.ts +129 -0
- package/src/modeller/property-sidebar/effects/property-event.ts +65 -0
- package/src/modeller/property-sidebar/effects/property-shadow.ts +114 -0
- package/src/modeller/property-sidebar/effects/value-converter.ts +26 -0
- package/src/modeller/property-sidebar/inspector/inspector.ts +327 -0
- package/src/modeller/property-sidebar/property-shared-style.ts +132 -0
- package/src/modeller/property-sidebar/property-sidebar.ts +308 -0
- package/src/modeller/property-sidebar/shapes/box-padding-editor-styles.ts +94 -0
- package/src/modeller/property-sidebar/shapes/shapes.ts +409 -0
- package/src/modeller/property-sidebar/specifics/specific-properties-builder.ts +135 -0
- package/src/modeller/property-sidebar/specifics/specifics.ts +72 -0
- package/src/modeller/property-sidebar/styles/styles.ts +578 -0
- package/src/modeller/scene-viewer/confidential-overlay.ts +18 -0
- package/src/modeller/scene-viewer/ox-scene-handler.ts +40 -0
- package/src/modeller/scene-viewer/ox-scene-layer.ts +42 -0
- package/src/modeller/scene-viewer/ox-scene-player.ts +104 -0
- package/src/modeller/scene-viewer/ox-scene-property.ts +10 -0
- package/src/modeller/scene-viewer/ox-scene-viewer.ts +248 -0
- package/src/ox-board-modeller.ts +138 -42
- package/src/types.ts +26 -0
- package/yarn-error.log +18355 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import './property-animation'
|
|
6
|
+
import '@material/mwc-icon'
|
|
7
|
+
|
|
8
|
+
import { css, html, LitElement } from 'lit'
|
|
9
|
+
import { customElement, property, state } from 'lit/decorators'
|
|
10
|
+
|
|
11
|
+
import { Properties, Scene } from '@hatiolab/things-scene'
|
|
12
|
+
|
|
13
|
+
import { PropertySharedStyle } from '../property-shared-style'
|
|
14
|
+
import { convert } from './value-converter'
|
|
15
|
+
|
|
16
|
+
@customElement('property-animations')
|
|
17
|
+
class PropertyAnimations extends LitElement {
|
|
18
|
+
static styles = [
|
|
19
|
+
PropertySharedStyle,
|
|
20
|
+
css`
|
|
21
|
+
fieldset[collapsable] legend {
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
width: 100%;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
fieldset[collapsable] legend mwc-icon {
|
|
27
|
+
float: right;
|
|
28
|
+
font-size: medium;
|
|
29
|
+
margin: 0;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
fieldset[collapsable][collapsed] > :not(legend) {
|
|
34
|
+
display: none;
|
|
35
|
+
}
|
|
36
|
+
`
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
@property({ type: Object }) value?: Properties
|
|
40
|
+
@property({ type: Object }) scene!: Scene
|
|
41
|
+
|
|
42
|
+
@state() _expanded: boolean = false
|
|
43
|
+
|
|
44
|
+
firstUpdated() {
|
|
45
|
+
this.renderRoot.addEventListener('change', this._onValueChange.bind(this))
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
render() {
|
|
49
|
+
const value = this.value || {}
|
|
50
|
+
|
|
51
|
+
return html`
|
|
52
|
+
<fieldset collapsable ?collapsed=${!this._expanded}>
|
|
53
|
+
<legend>
|
|
54
|
+
<title-with-help topic="board-modeller/effects/animation" msgid="label.animation">animation</title-with-help>
|
|
55
|
+
<mwc-icon
|
|
56
|
+
@click=${() => {
|
|
57
|
+
this._expanded = !this._expanded
|
|
58
|
+
}}
|
|
59
|
+
>${this._expanded ? 'expand_less' : 'expand_more'}</mwc-icon
|
|
60
|
+
>
|
|
61
|
+
</legend>
|
|
62
|
+
|
|
63
|
+
<property-animation value-key="oncreate" .scene=${this.scene} .value=${value.oncreate || {}}>
|
|
64
|
+
</property-animation>
|
|
65
|
+
</fieldset>
|
|
66
|
+
`
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
_onValueChange(e: Event) {
|
|
70
|
+
var element = e.target as HTMLElement
|
|
71
|
+
var key = element.getAttribute('value-key')
|
|
72
|
+
|
|
73
|
+
if (!key) {
|
|
74
|
+
return
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
this.value = {
|
|
78
|
+
...this.value,
|
|
79
|
+
[key]: convert(element)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import '@operato/input/dist/src/ox-input-data'
|
|
6
|
+
|
|
7
|
+
import { LitElement, html } from 'lit'
|
|
8
|
+
import { Properties, Scene } from '@hatiolab/things-scene'
|
|
9
|
+
import { customElement, property } from 'lit/decorators'
|
|
10
|
+
|
|
11
|
+
import { EffectsSharedStyle } from './effects-shared-style'
|
|
12
|
+
import { convert } from './value-converter'
|
|
13
|
+
|
|
14
|
+
@customElement('property-event-hover')
|
|
15
|
+
class PropertyEventHover extends LitElement {
|
|
16
|
+
static styles = [EffectsSharedStyle]
|
|
17
|
+
|
|
18
|
+
@property({ type: Object }) value?: Properties
|
|
19
|
+
@property({ type: Object }) scene?: Scene
|
|
20
|
+
|
|
21
|
+
firstUpdated() {
|
|
22
|
+
this.renderRoot.addEventListener('change', this._onValueChange.bind(this))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
render() {
|
|
26
|
+
var { action, value = '', target = '', emphasize, restore } = this.value || {}
|
|
27
|
+
|
|
28
|
+
return html`
|
|
29
|
+
<input id="checkbox-emphasize" type="checkbox" value-key="emphasize" .checked=${emphasize} />
|
|
30
|
+
<label for="checkbox-emphasize" class="checkbox-label">
|
|
31
|
+
<i18n-msg msgid="label.emphasize">emphasize</i18n-msg>
|
|
32
|
+
</label>
|
|
33
|
+
|
|
34
|
+
<label> <i18n-msg msgid="label.action">action</i18n-msg> </label>
|
|
35
|
+
<select id="tap-select" value-key="action" .value=${action || ''}>
|
|
36
|
+
<option value=""></option>
|
|
37
|
+
<option value="popup">popup target board</option>
|
|
38
|
+
<option value="infoWindow">open infowindow</option>
|
|
39
|
+
<option value="data-toggle">toggle(true/false) target component data</option>
|
|
40
|
+
<option value="data-tristate">tristate(0/1/2) target component data</option>
|
|
41
|
+
<option value="data-set">set value to target component data</option>
|
|
42
|
+
<option value="value-set">set value to target component value</option>
|
|
43
|
+
</select>
|
|
44
|
+
|
|
45
|
+
<label> <i18n-msg msgid="label.target">target</i18n-msg> </label>
|
|
46
|
+
|
|
47
|
+
${action == 'popup'
|
|
48
|
+
? html`
|
|
49
|
+
<things-editor-board-selector
|
|
50
|
+
value-key="target"
|
|
51
|
+
.value=${target}
|
|
52
|
+
custom-editor
|
|
53
|
+
></things-editor-board-selector>
|
|
54
|
+
`
|
|
55
|
+
: html`
|
|
56
|
+
<input
|
|
57
|
+
value-key="target"
|
|
58
|
+
.value=${target || ''}
|
|
59
|
+
list="target-list"
|
|
60
|
+
.placeholder="${this._getPlaceHoder(action)}"
|
|
61
|
+
/>
|
|
62
|
+
|
|
63
|
+
<datalist id="target-list">
|
|
64
|
+
${this._getTargetList(action).map(item => html` <option .value=${item}></option> `)}
|
|
65
|
+
</datalist>
|
|
66
|
+
`}
|
|
67
|
+
${action == 'data-set' || action == 'value-set'
|
|
68
|
+
? html`
|
|
69
|
+
<label> <i18n-msg msgid="label.value">value</i18n-msg> </label>
|
|
70
|
+
<ox-input-data value-key="value" .value=${value} custom-editor fullwidth></ox-input-data>
|
|
71
|
+
`
|
|
72
|
+
: html``}
|
|
73
|
+
|
|
74
|
+
<input id="checkbox-restore" type="checkbox" value-key="restore" .checked=${restore} />
|
|
75
|
+
<label for="checkbox-restore" class="checkbox-label">
|
|
76
|
+
<i18n-msg msgid="label.restore-on-leave">restore on leave</i18n-msg>
|
|
77
|
+
</label>
|
|
78
|
+
`
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
_getPlaceHoder(action: string) {
|
|
82
|
+
switch (action) {
|
|
83
|
+
case 'popup':
|
|
84
|
+
case 'goto':
|
|
85
|
+
return 'SCENE-100'
|
|
86
|
+
case 'link-open':
|
|
87
|
+
case 'link-move':
|
|
88
|
+
return 'http://www.hatiolab.com/'
|
|
89
|
+
default:
|
|
90
|
+
return ''
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
_getTargetList(action: string) {
|
|
95
|
+
switch (action) {
|
|
96
|
+
case 'data-toggle':
|
|
97
|
+
case 'data-tristate':
|
|
98
|
+
case 'data-set':
|
|
99
|
+
case 'value-set':
|
|
100
|
+
let ids = (this.scene && this.scene.ids.map(i => `#${i.key}`)) || []
|
|
101
|
+
ids.unshift('(self)')
|
|
102
|
+
return ids
|
|
103
|
+
case 'infoWindow':
|
|
104
|
+
return (
|
|
105
|
+
(this.scene &&
|
|
106
|
+
this.scene.ids
|
|
107
|
+
.filter(i => {
|
|
108
|
+
return this.scene!.findById(i.key).get('type') == 'info-window'
|
|
109
|
+
})
|
|
110
|
+
.map(i => `${i.key}`)) ||
|
|
111
|
+
[]
|
|
112
|
+
)
|
|
113
|
+
default:
|
|
114
|
+
return []
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
_onValueChange(e: Event) {
|
|
119
|
+
var element = e.target as HTMLElement
|
|
120
|
+
var key = element.getAttribute('value-key')
|
|
121
|
+
|
|
122
|
+
if (!key) {
|
|
123
|
+
return
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
this.value = {
|
|
127
|
+
...this.value,
|
|
128
|
+
[key]: convert(element)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import '@operato/input/dist/src/ox-input-data'
|
|
6
|
+
|
|
7
|
+
import { LitElement, html } from 'lit'
|
|
8
|
+
import { Properties, Scene } from '@hatiolab/things-scene'
|
|
9
|
+
import { customElement, property } from 'lit/decorators'
|
|
10
|
+
|
|
11
|
+
import { EffectsSharedStyle } from './effects-shared-style'
|
|
12
|
+
import { convert } from './value-converter'
|
|
13
|
+
|
|
14
|
+
@customElement('property-event-tap')
|
|
15
|
+
class PropertyEventTap extends LitElement {
|
|
16
|
+
static styles = [EffectsSharedStyle]
|
|
17
|
+
|
|
18
|
+
@property({ type: Object }) value?: Properties
|
|
19
|
+
@property({ type: Object }) scene?: Scene
|
|
20
|
+
|
|
21
|
+
firstUpdated() {
|
|
22
|
+
this.renderRoot.addEventListener('change', this._onValueChange.bind(this))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
render() {
|
|
26
|
+
var { action, value = '', target = '', pressed } = this.value || {}
|
|
27
|
+
|
|
28
|
+
return html`
|
|
29
|
+
<input id="checkbox-pressed" type="checkbox" value-key="pressed" .checked=${pressed} />
|
|
30
|
+
<label for="checkbox-pressed" class="checkbox-label"> <i18n-msg msgid="label.pressed">pressed</i18n-msg> </label>
|
|
31
|
+
|
|
32
|
+
<label> <i18n-msg msgid="label.action">action</i18n-msg> </label>
|
|
33
|
+
<select id="tap-select" value-key="action" .value=${action || ''}>
|
|
34
|
+
<option value=""></option>
|
|
35
|
+
<option value="goto">go to target board</option>
|
|
36
|
+
<option value="link-open">open new window for target link</option>
|
|
37
|
+
<option value="link-move">move to target link</option>
|
|
38
|
+
<option value="route-page">route to page</option>
|
|
39
|
+
<option value="popup">popup target board</option>
|
|
40
|
+
<option value="modal-popup">modal popup target board</option>
|
|
41
|
+
<option value="close-scene">close current board</option>
|
|
42
|
+
<option value="infoWindow">open infowindow</option>
|
|
43
|
+
<option value="toggle-info-window">toggle infowindow</option>
|
|
44
|
+
<option value="data-toggle">toggle(true/false) target component data</option>
|
|
45
|
+
<option value="data-tristate">tristate(0/1/2) target component data</option>
|
|
46
|
+
<option value="data-set">set value to target component data</option>
|
|
47
|
+
<option value="value-set">set value to target component value</option>
|
|
48
|
+
</select>
|
|
49
|
+
|
|
50
|
+
<label> <i18n-msg msgid="label.target">target</i18n-msg> </label>
|
|
51
|
+
|
|
52
|
+
${action == 'goto' || action == 'popup'
|
|
53
|
+
? html`
|
|
54
|
+
<things-editor-board-selector
|
|
55
|
+
value-key="target"
|
|
56
|
+
.value=${target}
|
|
57
|
+
custom-editor
|
|
58
|
+
></things-editor-board-selector>
|
|
59
|
+
`
|
|
60
|
+
: html`
|
|
61
|
+
<input value-key="target" .value=${target} list="target-list" .placeholder=${this._getPlaceHoder(action)} />
|
|
62
|
+
|
|
63
|
+
<datalist id="target-list">
|
|
64
|
+
${this._getTargetList(action).map(item => html` <option .value=${item}></option> `)}
|
|
65
|
+
</datalist>
|
|
66
|
+
`}
|
|
67
|
+
${action == 'data-set' || action == 'value-set'
|
|
68
|
+
? html`
|
|
69
|
+
<label> <i18n-msg msgid="label.value">value</i18n-msg> </label>
|
|
70
|
+
<ox-input-data value-key="value" .value=${value} custom-editor fullwidth></ox-input-data>
|
|
71
|
+
`
|
|
72
|
+
: html``}
|
|
73
|
+
`
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
_getPlaceHoder(action: string) {
|
|
77
|
+
switch (action) {
|
|
78
|
+
case 'popup':
|
|
79
|
+
case 'goto':
|
|
80
|
+
return 'SCENE-100'
|
|
81
|
+
case 'link-open':
|
|
82
|
+
case 'link-move':
|
|
83
|
+
return 'http://www.hatiolab.com/'
|
|
84
|
+
default:
|
|
85
|
+
return ''
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
_getTargetList(action: string) {
|
|
90
|
+
switch (action) {
|
|
91
|
+
case 'data-toggle':
|
|
92
|
+
case 'data-tristate':
|
|
93
|
+
case 'data-set':
|
|
94
|
+
case 'value-set':
|
|
95
|
+
let ids = (this.scene && this.scene.ids.map(i => `#${i.key}`)) || []
|
|
96
|
+
ids.unshift('(self)')
|
|
97
|
+
return ids
|
|
98
|
+
case 'infoWindow':
|
|
99
|
+
case 'toggle-info-window':
|
|
100
|
+
return (
|
|
101
|
+
(this.scene &&
|
|
102
|
+
this.scene.ids
|
|
103
|
+
.filter(i => {
|
|
104
|
+
return this.scene!.findById(i.key).get('type') == 'info-window'
|
|
105
|
+
})
|
|
106
|
+
.map(i => `${i.key}`)) ||
|
|
107
|
+
[]
|
|
108
|
+
)
|
|
109
|
+
default:
|
|
110
|
+
return []
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
_onValueChange(e: Event) {
|
|
115
|
+
var element = e.target as HTMLElement
|
|
116
|
+
var key = element.getAttribute('value-key')
|
|
117
|
+
|
|
118
|
+
if (!key) {
|
|
119
|
+
return
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
this.value = {
|
|
123
|
+
...this.value,
|
|
124
|
+
[key]: convert(element)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import './property-event-hover'
|
|
6
|
+
import './property-event-tap'
|
|
7
|
+
|
|
8
|
+
import { html, LitElement } from 'lit'
|
|
9
|
+
import { customElement, property } from 'lit/decorators'
|
|
10
|
+
|
|
11
|
+
import { Properties, Scene } from '@hatiolab/things-scene'
|
|
12
|
+
|
|
13
|
+
import { PropertySharedStyle } from '../property-shared-style'
|
|
14
|
+
import { convert } from './value-converter'
|
|
15
|
+
|
|
16
|
+
@customElement('property-event')
|
|
17
|
+
class PropertyEvent extends LitElement {
|
|
18
|
+
static styles = [PropertySharedStyle]
|
|
19
|
+
|
|
20
|
+
@property({ type: Object }) value?: Properties
|
|
21
|
+
@property({ type: Object }) scene?: Scene
|
|
22
|
+
|
|
23
|
+
firstUpdated() {
|
|
24
|
+
this.renderRoot.addEventListener('change', this._onValueChange.bind(this))
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
render() {
|
|
28
|
+
const value = this.value || {}
|
|
29
|
+
|
|
30
|
+
return html`
|
|
31
|
+
<fieldset>
|
|
32
|
+
<legend>
|
|
33
|
+
<title-with-help msgid="label.hover-event" topic="board-modeller/effects/hover-event"></title-with-help>
|
|
34
|
+
</legend>
|
|
35
|
+
|
|
36
|
+
<property-event-hover value-key="hover" .scene=${this.scene} .value=${value.hover || {}}>
|
|
37
|
+
</property-event-hover>
|
|
38
|
+
</fieldset>
|
|
39
|
+
|
|
40
|
+
<fieldset>
|
|
41
|
+
<legend>
|
|
42
|
+
<title-with-help msgid="label.tap-event" topic="board-modeller/effects/tap-event"></title-with-help>
|
|
43
|
+
</legend>
|
|
44
|
+
|
|
45
|
+
<property-event-tap value-key="tap" .scene=${this.scene} .value=${value.tap || {}}> </property-event-tap>
|
|
46
|
+
</fieldset>
|
|
47
|
+
`
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
_onValueChange(e: Event) {
|
|
51
|
+
var element = e.target as HTMLElement
|
|
52
|
+
var key = element.getAttribute('value-key')
|
|
53
|
+
|
|
54
|
+
if (!key) {
|
|
55
|
+
return
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
this.value = {
|
|
59
|
+
...this.value,
|
|
60
|
+
[key]: convert(element)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import '@things-factory/modeller-ui/client/editors/things-editor-color'
|
|
6
|
+
|
|
7
|
+
import { css, html, LitElement } from 'lit'
|
|
8
|
+
import { customElement, property } from 'lit/decorators'
|
|
9
|
+
|
|
10
|
+
import { Properties } from '@hatiolab/things-scene'
|
|
11
|
+
|
|
12
|
+
import { convert } from './value-converter'
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 컴포넌트의 그림자 속성을 편집하는 element
|
|
16
|
+
*
|
|
17
|
+
* Example:
|
|
18
|
+
* <property-shadow
|
|
19
|
+
* @change="${e => { this.shadow = e.target.value }}"
|
|
20
|
+
* value="${this.shadow}"
|
|
21
|
+
* ></property-shadow>
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
@customElement('property-shadow')
|
|
25
|
+
export default 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
|
+
things-editor-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: url(/assets/images/icon-properties-label.png) 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> <i18n-msg msgid="label.shadowOffsetX">offset-X</i18n-msg> </label>
|
|
82
|
+
|
|
83
|
+
<input type="number" value-key="left" .value=${value.left} />
|
|
84
|
+
|
|
85
|
+
<label> <i18n-msg msgid="label.shadowOffsetY">offset-Y</i18n-msg> </label>
|
|
86
|
+
|
|
87
|
+
<input type="number" value-key="top" .value=${value.top} />
|
|
88
|
+
|
|
89
|
+
<label> <i18n-msg msgid="label.shadowSize">Size</i18n-msg> </label>
|
|
90
|
+
|
|
91
|
+
<input type="number" value-key="blurSize" .value=${value.blurSize} />
|
|
92
|
+
|
|
93
|
+
<label class="icon-only-label color"></label>
|
|
94
|
+
|
|
95
|
+
<things-editor-color value-key="color" .value=${value.color}> </things-editor-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
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export function convert(element: any) {
|
|
2
|
+
switch (element.tagName) {
|
|
3
|
+
case 'THINGS-EDITOR-ANGLE-INPUT':
|
|
4
|
+
return Number(element.radian) || 0
|
|
5
|
+
|
|
6
|
+
case 'INPUT':
|
|
7
|
+
switch (element.type) {
|
|
8
|
+
case 'checkbox':
|
|
9
|
+
return element.checked
|
|
10
|
+
case 'number':
|
|
11
|
+
return Number(element.value) || 0
|
|
12
|
+
case 'text':
|
|
13
|
+
return String(element.value)
|
|
14
|
+
}
|
|
15
|
+
break
|
|
16
|
+
|
|
17
|
+
case 'PAPER-BUTTON':
|
|
18
|
+
return element.active
|
|
19
|
+
|
|
20
|
+
case 'PAPER-LISTBOX':
|
|
21
|
+
return element.selected
|
|
22
|
+
|
|
23
|
+
default:
|
|
24
|
+
return element.value
|
|
25
|
+
}
|
|
26
|
+
}
|