@operato/property-panel 9.0.0-beta.14

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.
Files changed (156) hide show
  1. package/.editorconfig +29 -0
  2. package/.storybook/main.js +5 -0
  3. package/.storybook/preview.js +52 -0
  4. package/.storybook/server.mjs +8 -0
  5. package/CHANGELOG.md +11 -0
  6. package/LICENSE +21 -0
  7. package/README.md +76 -0
  8. package/demo/index.html +30 -0
  9. package/dist/src/graphql/board.d.ts +6 -0
  10. package/dist/src/graphql/board.js +130 -0
  11. package/dist/src/graphql/board.js.map +1 -0
  12. package/dist/src/graphql/data-subscription.d.ts +5 -0
  13. package/dist/src/graphql/data-subscription.js +24 -0
  14. package/dist/src/graphql/data-subscription.js.map +1 -0
  15. package/dist/src/graphql/favorite-board.d.ts +1 -0
  16. package/dist/src/graphql/favorite-board.js +23 -0
  17. package/dist/src/graphql/favorite-board.js.map +1 -0
  18. package/dist/src/graphql/group.d.ts +7 -0
  19. package/dist/src/graphql/group.js +125 -0
  20. package/dist/src/graphql/group.js.map +1 -0
  21. package/dist/src/graphql/index.d.ts +4 -0
  22. package/dist/src/graphql/index.js +5 -0
  23. package/dist/src/graphql/index.js.map +1 -0
  24. package/dist/src/graphql/play-group.d.ts +13 -0
  25. package/dist/src/graphql/play-group.js +205 -0
  26. package/dist/src/graphql/play-group.js.map +1 -0
  27. package/dist/src/graphql/scenario.d.ts +6 -0
  28. package/dist/src/graphql/scenario.js +69 -0
  29. package/dist/src/graphql/scenario.js.map +1 -0
  30. package/dist/src/index.d.ts +7 -0
  31. package/dist/src/index.js +8 -0
  32. package/dist/src/index.js.map +1 -0
  33. package/dist/src/ox-property-panel.d.ts +46 -0
  34. package/dist/src/ox-property-panel.js +346 -0
  35. package/dist/src/ox-property-panel.js.map +1 -0
  36. package/dist/src/property-panel/abstract-property.d.ts +10 -0
  37. package/dist/src/property-panel/abstract-property.js +53 -0
  38. package/dist/src/property-panel/abstract-property.js.map +1 -0
  39. package/dist/src/property-panel/data-binding/data-binding-mapper.d.ts +58 -0
  40. package/dist/src/property-panel/data-binding/data-binding-mapper.js +380 -0
  41. package/dist/src/property-panel/data-binding/data-binding-mapper.js.map +1 -0
  42. package/dist/src/property-panel/data-binding/data-binding-value-map.d.ts +6 -0
  43. package/dist/src/property-panel/data-binding/data-binding-value-map.js +20 -0
  44. package/dist/src/property-panel/data-binding/data-binding-value-map.js.map +1 -0
  45. package/dist/src/property-panel/data-binding/data-binding-value-range.d.ts +6 -0
  46. package/dist/src/property-panel/data-binding/data-binding-value-range.js +20 -0
  47. package/dist/src/property-panel/data-binding/data-binding-value-range.js.map +1 -0
  48. package/dist/src/property-panel/data-binding/data-binding.d.ts +44 -0
  49. package/dist/src/property-panel/data-binding/data-binding.js +442 -0
  50. package/dist/src/property-panel/data-binding/data-binding.js.map +1 -0
  51. package/dist/src/property-panel/effects/effects.d.ts +24 -0
  52. package/dist/src/property-panel/effects/effects.js +72 -0
  53. package/dist/src/property-panel/effects/effects.js.map +1 -0
  54. package/dist/src/property-panel/effects/property-animation.d.ts +23 -0
  55. package/dist/src/property-panel/effects/property-animation.js +147 -0
  56. package/dist/src/property-panel/effects/property-animation.js.map +1 -0
  57. package/dist/src/property-panel/effects/property-animations.d.ts +22 -0
  58. package/dist/src/property-panel/effects/property-animations.js +70 -0
  59. package/dist/src/property-panel/effects/property-animations.js.map +1 -0
  60. package/dist/src/property-panel/effects/property-event-hover.d.ts +21 -0
  61. package/dist/src/property-panel/effects/property-event-hover.js +193 -0
  62. package/dist/src/property-panel/effects/property-event-hover.js.map +1 -0
  63. package/dist/src/property-panel/effects/property-event-tap.d.ts +36 -0
  64. package/dist/src/property-panel/effects/property-event-tap.js +262 -0
  65. package/dist/src/property-panel/effects/property-event-tap.js.map +1 -0
  66. package/dist/src/property-panel/effects/property-event.d.ts +22 -0
  67. package/dist/src/property-panel/effects/property-event.js +64 -0
  68. package/dist/src/property-panel/effects/property-event.js.map +1 -0
  69. package/dist/src/property-panel/effects/property-shadow.d.ts +23 -0
  70. package/dist/src/property-panel/effects/property-shadow.js +66 -0
  71. package/dist/src/property-panel/effects/property-shadow.js.map +1 -0
  72. package/dist/src/property-panel/effects/value-converter.d.ts +1 -0
  73. package/dist/src/property-panel/effects/value-converter.js +17 -0
  74. package/dist/src/property-panel/effects/value-converter.js.map +1 -0
  75. package/dist/src/property-panel/inspector/inspector.d.ts +27 -0
  76. package/dist/src/property-panel/inspector/inspector.js +357 -0
  77. package/dist/src/property-panel/inspector/inspector.js.map +1 -0
  78. package/dist/src/property-panel/shapes/shapes.d.ts +26 -0
  79. package/dist/src/property-panel/shapes/shapes.js +312 -0
  80. package/dist/src/property-panel/shapes/shapes.js.map +1 -0
  81. package/dist/src/property-panel/specifics/specific-properties-builder.d.ts +16 -0
  82. package/dist/src/property-panel/specifics/specific-properties-builder.js +138 -0
  83. package/dist/src/property-panel/specifics/specific-properties-builder.js.map +1 -0
  84. package/dist/src/property-panel/specifics/specifics.d.ts +25 -0
  85. package/dist/src/property-panel/specifics/specifics.js +84 -0
  86. package/dist/src/property-panel/specifics/specifics.js.map +1 -0
  87. package/dist/src/property-panel/styles/styles.d.ts +23 -0
  88. package/dist/src/property-panel/styles/styles.js +269 -0
  89. package/dist/src/property-panel/styles/styles.js.map +1 -0
  90. package/dist/src/types.d.ts +43 -0
  91. package/dist/src/types.js +2 -0
  92. package/dist/src/types.js.map +1 -0
  93. package/dist/stories/index.stories.d.ts +22 -0
  94. package/dist/stories/index.stories.js +121 -0
  95. package/dist/stories/index.stories.js.map +1 -0
  96. package/dist/stories/input-table-property.stories.d.ts +21 -0
  97. package/dist/stories/input-table-property.stories.js +84 -0
  98. package/dist/stories/input-table-property.stories.js.map +1 -0
  99. package/dist/test/ox-property-panel.test.d.ts +1 -0
  100. package/dist/test/ox-property-panel.test.js +24 -0
  101. package/dist/test/ox-property-panel.test.js.map +1 -0
  102. package/dist/tsconfig.tsbuildinfo +1 -0
  103. package/package.json +108 -0
  104. package/src/graphql/board.ts +144 -0
  105. package/src/graphql/data-subscription.ts +30 -0
  106. package/src/graphql/favorite-board.ts +25 -0
  107. package/src/graphql/group.ts +138 -0
  108. package/src/graphql/index.ts +4 -0
  109. package/src/graphql/play-group.ts +225 -0
  110. package/src/graphql/scenario.ts +79 -0
  111. package/src/index.ts +8 -0
  112. package/src/ox-property-panel.ts +347 -0
  113. package/src/property-panel/abstract-property.ts +67 -0
  114. package/src/property-panel/data-binding/data-binding-mapper.ts +412 -0
  115. package/src/property-panel/data-binding/data-binding-value-map.ts +19 -0
  116. package/src/property-panel/data-binding/data-binding-value-range.ts +19 -0
  117. package/src/property-panel/data-binding/data-binding.ts +464 -0
  118. package/src/property-panel/effects/effects.ts +77 -0
  119. package/src/property-panel/effects/property-animation.ts +155 -0
  120. package/src/property-panel/effects/property-animations.ts +74 -0
  121. package/src/property-panel/effects/property-event-hover.ts +212 -0
  122. package/src/property-panel/effects/property-event-tap.ts +269 -0
  123. package/src/property-panel/effects/property-event.ts +73 -0
  124. package/src/property-panel/effects/property-shadow.ts +77 -0
  125. package/src/property-panel/effects/value-converter.ts +17 -0
  126. package/src/property-panel/inspector/inspector.ts +407 -0
  127. package/src/property-panel/shapes/shapes.ts +321 -0
  128. package/src/property-panel/specifics/specific-properties-builder.ts +152 -0
  129. package/src/property-panel/specifics/specifics.ts +81 -0
  130. package/src/property-panel/styles/styles.ts +287 -0
  131. package/src/types.ts +63 -0
  132. package/stories/index.stories.ts +134 -0
  133. package/stories/input-table-property.stories.ts +96 -0
  134. package/test/ox-property-panel.test.ts +32 -0
  135. package/themes/app-theme.css +138 -0
  136. package/themes/calendar-theme.css +61 -0
  137. package/themes/dark.css +51 -0
  138. package/themes/grist-theme.css +175 -0
  139. package/themes/help-theme.css +57 -0
  140. package/themes/layout-theme.css +94 -0
  141. package/themes/light.css +51 -0
  142. package/themes/material-theme.css +23 -0
  143. package/themes/md-typescale-styles.css +100 -0
  144. package/themes/oops-theme.css +22 -0
  145. package/themes/report-theme.css +47 -0
  146. package/themes/spacing.css +23 -0
  147. package/themes/state-color.css +6 -0
  148. package/themes/tooltip-theme.css +11 -0
  149. package/translations/en.json +723 -0
  150. package/translations/ja.json +727 -0
  151. package/translations/ko.json +727 -0
  152. package/translations/ms.json +609 -0
  153. package/translations/zh.json +726 -0
  154. package/tsconfig.json +25 -0
  155. package/web-dev-server.config.mjs +27 -0
  156. package/web-test-runner.config.mjs +41 -0
@@ -0,0 +1,442 @@
1
+ /**
2
+ * @license Copyright © HatioLab Inc. All rights reserved.
3
+ */
4
+ import { __decorate } from "tslib";
5
+ import '@material/web/icon/icon.js';
6
+ import '@operato/help/ox-title-with-help.js';
7
+ import '@operato/input/ox-buttons-radio.js';
8
+ import '@operato/input/ox-input-data.js';
9
+ import '@operato/i18n/ox-i18n.js';
10
+ import { css, html } from 'lit';
11
+ import { property, query, state } from 'lit/decorators.js';
12
+ import { ScopedElementsMixin } from '@open-wc/scoped-elements';
13
+ import { PropertyGridStyles } from '@operato/styles/property-grid-styles.js';
14
+ import { AbstractProperty } from '../abstract-property.js';
15
+ import { DataBindingMapper } from './data-binding-mapper.js';
16
+ var clipboard = '{}';
17
+ const PROPS = [
18
+ '',
19
+ 'text',
20
+ ['fillStyle', 'fill style'],
21
+ ['strokeStyle', 'stroke style'],
22
+ ['fontColor', 'font color'],
23
+ 'value',
24
+ 'data',
25
+ 'source',
26
+ 'hidden',
27
+ 'started',
28
+ 'play',
29
+ ['ref', 'reference'],
30
+ 'action',
31
+ 'options',
32
+ 'rotate',
33
+ 'dimension',
34
+ 'location',
35
+ 'accessor',
36
+ ['tap', '(tap)'],
37
+ '(action)'
38
+ ].map(prop => {
39
+ return typeof prop == 'string' ? { name: prop, label: prop } : { name: prop[0], label: prop[1] };
40
+ });
41
+ export class PropertyDataBinding extends ScopedElementsMixin(AbstractProperty) {
42
+ constructor() {
43
+ super(...arguments);
44
+ this.mappingIndex = 0;
45
+ this._dataExpanded = false;
46
+ this.mapping = {};
47
+ }
48
+ get mappings() {
49
+ var _a;
50
+ return ((_a = this.value) === null || _a === void 0 ? void 0 : _a.mappings) || [];
51
+ }
52
+ firstUpdated() {
53
+ this.renderRoot.addEventListener('change', this.onValueChange.bind(this));
54
+ this.tabContainer.addEventListener('scroll', () => {
55
+ this._onTabScroll();
56
+ });
57
+ }
58
+ updated(changes) {
59
+ if (changes.has('value')) {
60
+ this.onValueChanged();
61
+ }
62
+ }
63
+ static get scopedElements() {
64
+ return {
65
+ 'data-binding-mapper': DataBindingMapper
66
+ };
67
+ }
68
+ render() {
69
+ const value = this.value || {
70
+ mappings: []
71
+ };
72
+ return html `
73
+ <fieldset>
74
+ <legend>
75
+ <ox-title-with-help topic="board-modeller/data-binding" msgid="label.identifier"
76
+ >identifier</ox-title-with-help
77
+ >
78
+ </legend>
79
+ <div class="property-grid">
80
+ <label> <ox-i18n msgid="label.id">ID</ox-i18n> </label>
81
+ <input value-key="id" .value=${value.id || ''} />
82
+
83
+ <label> <ox-i18n msgid="label.class">Class</ox-i18n> </label>
84
+ <input value-key="class" .value=${value.class || ''} />
85
+
86
+ <label> <ox-i18n msgid="label.tag">Tag</ox-i18n> </label>
87
+ <input value-key="tag" .value=${value.tag || ''} />
88
+
89
+ <label> <ox-i18n msgid="label.template-prefix">Template Prefix</ox-i18n> </label>
90
+ <input value-key="templatePrefix" .value=${value.templatePrefix || ''} />
91
+
92
+ <input id="checkbox-ndns" type="checkbox" value-key="ndns" .checked=${value.ndns} />
93
+ <label for="checkbox-ndns"> <ox-i18n msgid="label.ndns">No Data No Show</ox-i18n> </label>
94
+
95
+ <input id="checkbox-sensitive" type="checkbox" value-key="sensitive" .checked=${value.sensitive} />
96
+ <label for="checkbox-sensitive">
97
+ <ox-i18n msgid="label.intent-sensitive">Intent Sensitive</ox-i18n>
98
+ </label>
99
+
100
+ <input id="checkbox-persistent" type="checkbox" value-key="persistent" .checked=${value.persistent} />
101
+ <label for="checkbox-persistent">
102
+ <ox-i18n msgid="label.persistent-data">Persistent Data</ox-i18n>
103
+ </label>
104
+ </div>
105
+ </fieldset>
106
+
107
+ <fieldset collapsable ?collapsed=${!this._dataExpanded}>
108
+ <legend>
109
+ <ox-title-with-help topic="board-modeller/initial-data" msgid="label.initial-data"
110
+ >initial value</ox-title-with-help
111
+ >
112
+ <md-icon
113
+ @click=${() => {
114
+ this._dataExpanded = !this._dataExpanded;
115
+ }}
116
+ >${this._dataExpanded ? 'expand_less' : 'expand_more'}</md-icon
117
+ >
118
+ </legend>
119
+ <ox-input-data value-key="data" .value=${value.data}> </ox-input-data>
120
+ </fieldset>
121
+
122
+ <fieldset>
123
+ <legend>
124
+ <ox-title-with-help topic="board-modeller/data-spread" msgid="label.data-spread"
125
+ >Data Spread</ox-title-with-help
126
+ >
127
+ </legend>
128
+
129
+ <div id="tab-header">
130
+ <md-icon
131
+ id="tab-nav-left-button"
132
+ @click=${() => {
133
+ this._onTabScrollNavLeft();
134
+ }}
135
+ disabled
136
+ >chevron_left</md-icon
137
+ >
138
+
139
+ <ox-buttons-radio
140
+ id="tabs"
141
+ .value=${String(this.mappingIndex)}
142
+ @change=${(e) => {
143
+ e.stopPropagation();
144
+ this._setMappingIndex(e.target.value);
145
+ }}
146
+ >
147
+ ${this.mappings.map((m, i) => html ` <div data-value=${i} data-mapping>${i + 1}</div> `)}
148
+ <div data-value=${this.mappings.length} data-mapping disabled>${this.mappings.length + 1}</div>
149
+ </ox-buttons-radio>
150
+
151
+ <md-icon
152
+ id="tab-nav-right-button"
153
+ @click=${(e) => {
154
+ this._onTabScrollNavRight();
155
+ }}
156
+ disabled
157
+ >chevron_right</md-icon
158
+ >
159
+ </div>
160
+
161
+ <div binding>
162
+ <md-icon style="font-size:19px" @click=${() => this._clearDataBindingMapper()} title="delete current tab"
163
+ >delete_forever</md-icon
164
+ >
165
+ <md-icon @click=${() => this._pasteDataBindingMapper()} title="replace current tab">content_paste</md-icon>
166
+ <md-icon style="font-size:17px" @click=${() => this._copyDataBindingMapper()} title="copy current tab"
167
+ >content_copy</md-icon
168
+ >
169
+ </div>
170
+
171
+ <data-binding-mapper
172
+ @value-change=${(e) => this._onMappingChanged(e)}
173
+ .scene=${this.scene}
174
+ .mapping=${(value.mappings && value.mappings[this.mappingIndex]) || {}}
175
+ .properties=${PROPS}
176
+ >
177
+ </data-binding-mapper>
178
+ </fieldset>
179
+ `;
180
+ }
181
+ _setMappingIndex(idx) {
182
+ this.mappingIndex = isNaN(Number(idx)) ? 0 : Number(idx);
183
+ this._onTabScroll();
184
+ }
185
+ _clearDataBindingMapper() {
186
+ var _a;
187
+ var mappings = [...(((_a = this.value) === null || _a === void 0 ? void 0 : _a.mappings) || [])];
188
+ mappings.splice(this.mappingIndex, 1);
189
+ this.onAfterValueChange('mappings', mappings.filter(m => !!m));
190
+ }
191
+ _copyDataBindingMapper() {
192
+ clipboard = JSON.stringify(this.mappings[this.mappingIndex]);
193
+ }
194
+ async _pasteDataBindingMapper() {
195
+ var _a;
196
+ var index = this.mappingIndex;
197
+ var mappings = [...(((_a = this.value) === null || _a === void 0 ? void 0 : _a.mappings) || [])];
198
+ mappings[this.mappingIndex] = JSON.parse(clipboard);
199
+ this.onAfterValueChange('mappings', mappings);
200
+ setTimeout(() => {
201
+ this._setMappingIndex(index);
202
+ }, 100);
203
+ }
204
+ async onValueChanged() {
205
+ await this.updateComplete;
206
+ if (this._afterRender) {
207
+ this._afterRender();
208
+ }
209
+ else {
210
+ this._setMappingIndex(0);
211
+ }
212
+ this._afterRender = null;
213
+ }
214
+ onValueChange(e) {
215
+ var element = e.target;
216
+ var key = element.getAttribute('value-key');
217
+ var value = this.getValueFromEventTarget(element);
218
+ if (!key) {
219
+ return;
220
+ }
221
+ this.value = {
222
+ ...this.value,
223
+ [key]: value
224
+ };
225
+ this.onAfterValueChange(key, value);
226
+ }
227
+ get tabContainer() {
228
+ return this.tabs;
229
+ }
230
+ async _onMappingChanged(e) {
231
+ var _a, _b;
232
+ var mapping = e.target.mapping;
233
+ /* data spread target의 변경이 있는 경우, target 컴포넌트들의 태그를 블링크 시킨다 */
234
+ if (mapping && mapping.target) {
235
+ this.scene &&
236
+ this.scene.findAll(mapping.target, this.scene.selected && this.scene.selected[0]).forEach((c, i) => {
237
+ if (i == 0)
238
+ c.trigger('decotagreset');
239
+ c.trigger('decotag', {});
240
+ });
241
+ }
242
+ /* mapping의 모든 속성이 편집되면, 모델에 반영한다. */
243
+ var mappings = [...(((_a = this.value) === null || _a === void 0 ? void 0 : _a.mappings) || [])];
244
+ if (mapping.target && mapping.property && mapping.rule) {
245
+ mappings[this.mappingIndex] = mapping;
246
+ var mappingIdx = this.mappingIndex;
247
+ this._afterRender = () => {
248
+ this._setMappingIndex(mappingIdx);
249
+ this.tabContainer.scrollLeft = this.tabContainer.scrollWidth;
250
+ };
251
+ this.dispatchEvent(new CustomEvent('property-change', {
252
+ bubbles: true,
253
+ composed: true,
254
+ detail: {
255
+ mappings: mappings.filter(m => !!m)
256
+ }
257
+ }));
258
+ await this.requestUpdate();
259
+ }
260
+ else if (!mapping.target && !mapping.property) {
261
+ const { accessor, source } = ((_b = e.detail) === null || _b === void 0 ? void 0 : _b.changed) || {};
262
+ // accessor나 source를 입력중인 경우 tabIndex Change 방지
263
+ if (!accessor && !source) {
264
+ mappings[this.mappingIndex] = null;
265
+ var nextMappingIdx = Math.max(this.mappingIndex - 1, 0);
266
+ this._afterRender = () => {
267
+ this._setMappingIndex(nextMappingIdx);
268
+ };
269
+ this.dispatchEvent(new CustomEvent('property-change', {
270
+ bubbles: true,
271
+ composed: true,
272
+ detail: {
273
+ mappings: mappings.filter(m => !!m)
274
+ }
275
+ }));
276
+ }
277
+ }
278
+ }
279
+ _onTabScroll() {
280
+ if (this.tabContainer.clientWidth == this.tabContainer.scrollWidth) {
281
+ this.tabNavLeftButton.setAttribute('disabled', '');
282
+ this.tabNavRightButton.setAttribute('disabled', '');
283
+ }
284
+ // left-end
285
+ else if (this.tabContainer.scrollLeft == 0) {
286
+ this.tabNavLeftButton.setAttribute('disabled', '');
287
+ this.tabNavRightButton.removeAttribute('disabled');
288
+ }
289
+ // right-end
290
+ else if (this.tabContainer.scrollLeft + this.tabContainer.clientWidth >= this.tabContainer.scrollWidth) {
291
+ this.tabNavLeftButton.removeAttribute('disabled');
292
+ this.tabNavRightButton.setAttribute('disabled', '');
293
+ }
294
+ else {
295
+ this.tabNavLeftButton.removeAttribute('disabled');
296
+ this.tabNavRightButton.removeAttribute('disabled');
297
+ }
298
+ }
299
+ _onTabScrollNavLeft() {
300
+ this.tabContainer.style.scrollBehavior = 'smooth';
301
+ this.tabContainer.scrollLeft -= this.tabContainer.clientWidth;
302
+ this.tabContainer.style.scrollBehavior = 'auto';
303
+ }
304
+ _onTabScrollNavRight() {
305
+ this.tabContainer.style.scrollBehavior = 'smooth';
306
+ this.tabContainer.scrollLeft += this.tabContainer.clientWidth;
307
+ this.tabContainer.style.scrollBehavior = 'auto';
308
+ }
309
+ }
310
+ PropertyDataBinding.styles = [
311
+ PropertyGridStyles,
312
+ css `
313
+ #tab-header {
314
+ display: flex;
315
+ align-items: center;
316
+ justify-content: space-between;
317
+ }
318
+
319
+ #tab-header > md-icon {
320
+ padding: 0;
321
+ margin: 0;
322
+ width: 25px;
323
+ height: 25px;
324
+ font-size: x-large;
325
+ border-bottom: 1px solid rgba(0, 0, 0, 0.2);
326
+ }
327
+
328
+ fieldset[collapsable][collapsed] > :not(legend) {
329
+ display: none;
330
+ }
331
+
332
+ ox-buttons-radio {
333
+ flex: 1;
334
+ height: 25px;
335
+ border: 1px solid rgba(0, 0, 0, 0.2);
336
+ border-width: 1px 1px 0 1px;
337
+ text-align: center;
338
+
339
+ display: flex;
340
+ padding: 0;
341
+ box-sizing: border-box;
342
+
343
+ width: 0; /* limit width */
344
+ overflow-x: hidden;
345
+ }
346
+
347
+ ox-buttons-radio > div {
348
+ background-color: rgba(0, 0, 0, 0.2);
349
+ border: 1px solid rgba(0, 0, 0, 0.07);
350
+ border-width: 0 0 2px 0;
351
+ padding: 0;
352
+ margin: 0;
353
+ color: #fff;
354
+ font-size: 13px;
355
+ max-width: 25px;
356
+ min-width: 25px;
357
+ }
358
+
359
+ ox-buttons-radio > div[disabled] {
360
+ background-color: rgba(0, 0, 0, 0.1);
361
+ }
362
+
363
+ ox-buttons-radio > div[active] {
364
+ border-color: rgb(242, 71, 28);
365
+ }
366
+
367
+ ox-buttons-radio > div.iron-selected {
368
+ background-color: var(--md-sys-color-surface);
369
+ color: var(--md-sys-color-on-surface);
370
+ }
371
+
372
+ div[binding] {
373
+ display: flex;
374
+ flex-direction: row-reverse;
375
+ background-color: var(--md-sys-color-surface);
376
+ color: var(--md-sys-color-on-surface);
377
+ overflow: hidden;
378
+ border-style: solid;
379
+ border-color: rgba(0, 0, 0, 0.2);
380
+ border-image: initial;
381
+ border-width: 0px 1px;
382
+ padding: 7px 5px 2px 5px;
383
+ }
384
+
385
+ md-icon {
386
+ margin-left: 5px;
387
+ color: var(--md-sys-color-on-secondary-container);
388
+ opacity: 0.8;
389
+ cursor: pointer;
390
+ --md-icon-size: 18px;
391
+ }
392
+
393
+ md-icon:hover {
394
+ color: var(--md-sys-color-on-primary-container);
395
+ opacity: 1;
396
+ }
397
+
398
+ md-icon[disabled] {
399
+ color: rgba(0, 0, 0, 0.1);
400
+ }
401
+
402
+ data-binding-mapper {
403
+ --things-select: {
404
+ min-width: 50%;
405
+ margin-bottom: 10px;
406
+ padding: 3px 20px 2px 5px;
407
+ -webkit-border-radius: 4px;
408
+ -moz-border-radius: 4px;
409
+ border-radius: 4px;
410
+ border: 1px solid rgba(0, 0, 0, 0.15);
411
+ font-size: 15px;
412
+ font-weight: 300;
413
+ -webkit-appearance: none;
414
+ };
415
+ }
416
+ `
417
+ ];
418
+ __decorate([
419
+ property({ type: Object })
420
+ ], PropertyDataBinding.prototype, "value", void 0);
421
+ __decorate([
422
+ property({ type: Object })
423
+ ], PropertyDataBinding.prototype, "scene", void 0);
424
+ __decorate([
425
+ state()
426
+ ], PropertyDataBinding.prototype, "mappingIndex", void 0);
427
+ __decorate([
428
+ state()
429
+ ], PropertyDataBinding.prototype, "_afterRender", void 0);
430
+ __decorate([
431
+ state()
432
+ ], PropertyDataBinding.prototype, "_dataExpanded", void 0);
433
+ __decorate([
434
+ query('#tabs')
435
+ ], PropertyDataBinding.prototype, "tabs", void 0);
436
+ __decorate([
437
+ query('#tab-nav-left-button')
438
+ ], PropertyDataBinding.prototype, "tabNavLeftButton", void 0);
439
+ __decorate([
440
+ query('#tab-nav-right-button')
441
+ ], PropertyDataBinding.prototype, "tabNavRightButton", void 0);
442
+ //# sourceMappingURL=data-binding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-binding.js","sourceRoot":"","sources":["../../../../src/property-panel/data-binding/data-binding.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,4BAA4B,CAAA;AACnC,OAAO,qCAAqC,CAAA;AAC5C,OAAO,oCAAoC,CAAA;AAC3C,OAAO,iCAAiC,CAAA;AACxC,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAG1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAE5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAE5D,IAAI,SAAS,GAAG,IAAI,CAAA;AAEpB,MAAM,KAAK,GAAG;IACZ,EAAE;IACF,MAAM;IACN,CAAC,WAAW,EAAE,YAAY,CAAC;IAC3B,CAAC,aAAa,EAAE,cAAc,CAAC;IAC/B,CAAC,WAAW,EAAE,YAAY,CAAC;IAC3B,OAAO;IACP,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,MAAM;I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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwGF;CACF,AA3GY,CA2GZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAmB;AAClB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAc;AAEhC;IAAR,KAAK,EAAE;yDAAyB;AACxB;IAAR,KAAK,EAAE;yDAA+B;AAC9B;IAAR,KAAK,EAAE;0DAA+B;AAEvB;IAAf,KAAK,CAAC,OAAO,CAAC;iDAAmB;AACH;IAA9B,KAAK,CAAC,sBAAsB,CAAC;6DAA+B;AAC7B;IAA/B,KAAK,CAAC,uBAAuB,CAAC;8DAAgC","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@material/web/icon/icon.js'\nimport '@operato/help/ox-title-with-help.js'\nimport '@operato/input/ox-buttons-radio.js'\nimport '@operato/input/ox-input-data.js'\nimport '@operato/i18n/ox-i18n.js'\n\nimport { css, html, PropertyValues } from 'lit'\nimport { property, query, state } from 'lit/decorators.js'\n\nimport { Properties, Scene } from '@hatiolab/things-scene'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { PropertyGridStyles } from '@operato/styles/property-grid-styles.js'\n\nimport { AbstractProperty } from '../abstract-property.js'\nimport { DataBindingMapper } from './data-binding-mapper.js'\n\nvar clipboard = '{}'\n\nconst PROPS = [\n '',\n 'text',\n ['fillStyle', 'fill style'],\n ['strokeStyle', 'stroke style'],\n ['fontColor', 'font color'],\n 'value',\n 'data',\n 'source',\n 'hidden',\n 'started',\n 'play',\n ['ref', 'reference'],\n 'action',\n 'options',\n 'rotate',\n 'dimension',\n 'location',\n 'accessor',\n ['tap', '(tap)'],\n '(action)'\n].map(prop => {\n return typeof prop == 'string' ? { name: prop, label: prop } : { name: prop[0], label: prop[1] }\n})\n\nexport class PropertyDataBinding extends ScopedElementsMixin(AbstractProperty) {\n static styles = [\n PropertyGridStyles,\n css`\n #tab-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n #tab-header > md-icon {\n padding: 0;\n margin: 0;\n width: 25px;\n height: 25px;\n font-size: x-large;\n border-bottom: 1px solid rgba(0, 0, 0, 0.2);\n }\n\n fieldset[collapsable][collapsed] > :not(legend) {\n display: none;\n }\n\n ox-buttons-radio {\n flex: 1;\n height: 25px;\n border: 1px solid rgba(0, 0, 0, 0.2);\n border-width: 1px 1px 0 1px;\n text-align: center;\n\n display: flex;\n padding: 0;\n box-sizing: border-box;\n\n width: 0; /* limit width */\n overflow-x: hidden;\n }\n\n ox-buttons-radio > div {\n background-color: rgba(0, 0, 0, 0.2);\n border: 1px solid rgba(0, 0, 0, 0.07);\n border-width: 0 0 2px 0;\n padding: 0;\n margin: 0;\n color: #fff;\n font-size: 13px;\n max-width: 25px;\n min-width: 25px;\n }\n\n ox-buttons-radio > div[disabled] {\n background-color: rgba(0, 0, 0, 0.1);\n }\n\n ox-buttons-radio > div[active] {\n border-color: rgb(242, 71, 28);\n }\n\n ox-buttons-radio > div.iron-selected {\n background-color: var(--md-sys-color-surface);\n color: var(--md-sys-color-on-surface);\n }\n\n div[binding] {\n display: flex;\n flex-direction: row-reverse;\n background-color: var(--md-sys-color-surface);\n color: var(--md-sys-color-on-surface);\n overflow: hidden;\n border-style: solid;\n border-color: rgba(0, 0, 0, 0.2);\n border-image: initial;\n border-width: 0px 1px;\n padding: 7px 5px 2px 5px;\n }\n\n md-icon {\n margin-left: 5px;\n color: var(--md-sys-color-on-secondary-container);\n opacity: 0.8;\n cursor: pointer;\n --md-icon-size: 18px;\n }\n\n md-icon:hover {\n color: var(--md-sys-color-on-primary-container);\n opacity: 1;\n }\n\n md-icon[disabled] {\n color: rgba(0, 0, 0, 0.1);\n }\n\n data-binding-mapper {\n --things-select: {\n min-width: 50%;\n margin-bottom: 10px;\n padding: 3px 20px 2px 5px;\n -webkit-border-radius: 4px;\n -moz-border-radius: 4px;\n border-radius: 4px;\n border: 1px solid rgba(0, 0, 0, 0.15);\n font-size: 15px;\n font-weight: 300;\n -webkit-appearance: none;\n };\n }\n `\n ]\n\n @property({ type: Object }) value?: Properties\n @property({ type: Object }) scene?: Scene\n\n @state() mappingIndex: number = 0\n @state() _afterRender?: Function | null\n @state() _dataExpanded: boolean = false\n\n @query('#tabs') tabs!: HTMLElement\n @query('#tab-nav-left-button') tabNavLeftButton!: HTMLElement\n @query('#tab-nav-right-button') tabNavRightButton!: HTMLElement\n\n private mapping: Properties = {}\n\n get mappings() {\n return this.value?.mappings || []\n }\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', this.onValueChange.bind(this))\n\n this.tabContainer.addEventListener('scroll', () => {\n this._onTabScroll()\n })\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('value')) {\n this.onValueChanged()\n }\n }\n\n static get scopedElements() {\n return {\n 'data-binding-mapper': DataBindingMapper\n }\n }\n\n render() {\n const value = this.value || {\n mappings: []\n }\n\n return html`\n <fieldset>\n <legend>\n <ox-title-with-help topic=\"board-modeller/data-binding\" msgid=\"label.identifier\"\n >identifier</ox-title-with-help\n >\n </legend>\n <div class=\"property-grid\">\n <label> <ox-i18n msgid=\"label.id\">ID</ox-i18n> </label>\n <input value-key=\"id\" .value=${value.id || ''} />\n\n <label> <ox-i18n msgid=\"label.class\">Class</ox-i18n> </label>\n <input value-key=\"class\" .value=${value.class || ''} />\n\n <label> <ox-i18n msgid=\"label.tag\">Tag</ox-i18n> </label>\n <input value-key=\"tag\" .value=${value.tag || ''} />\n\n <label> <ox-i18n msgid=\"label.template-prefix\">Template Prefix</ox-i18n> </label>\n <input value-key=\"templatePrefix\" .value=${value.templatePrefix || ''} />\n\n <input id=\"checkbox-ndns\" type=\"checkbox\" value-key=\"ndns\" .checked=${value.ndns} />\n <label for=\"checkbox-ndns\"> <ox-i18n msgid=\"label.ndns\">No Data No Show</ox-i18n> </label>\n\n <input id=\"checkbox-sensitive\" type=\"checkbox\" value-key=\"sensitive\" .checked=${value.sensitive} />\n <label for=\"checkbox-sensitive\">\n <ox-i18n msgid=\"label.intent-sensitive\">Intent Sensitive</ox-i18n>\n </label>\n\n <input id=\"checkbox-persistent\" type=\"checkbox\" value-key=\"persistent\" .checked=${value.persistent} />\n <label for=\"checkbox-persistent\">\n <ox-i18n msgid=\"label.persistent-data\">Persistent Data</ox-i18n>\n </label>\n </div>\n </fieldset>\n\n <fieldset collapsable ?collapsed=${!this._dataExpanded}>\n <legend>\n <ox-title-with-help topic=\"board-modeller/initial-data\" msgid=\"label.initial-data\"\n >initial value</ox-title-with-help\n >\n <md-icon\n @click=${() => {\n this._dataExpanded = !this._dataExpanded\n }}\n >${this._dataExpanded ? 'expand_less' : 'expand_more'}</md-icon\n >\n </legend>\n <ox-input-data value-key=\"data\" .value=${value.data}> </ox-input-data>\n </fieldset>\n\n <fieldset>\n <legend>\n <ox-title-with-help topic=\"board-modeller/data-spread\" msgid=\"label.data-spread\"\n >Data Spread</ox-title-with-help\n >\n </legend>\n\n <div id=\"tab-header\">\n <md-icon\n id=\"tab-nav-left-button\"\n @click=${() => {\n this._onTabScrollNavLeft()\n }}\n disabled\n >chevron_left</md-icon\n >\n\n <ox-buttons-radio\n id=\"tabs\"\n .value=${String(this.mappingIndex)}\n @change=${(e: Event) => {\n e.stopPropagation()\n this._setMappingIndex((e.target as any).value)\n }}\n >\n ${this.mappings.map((m: string, i: number) => html` <div data-value=${i} data-mapping>${i + 1}</div> `)}\n <div data-value=${this.mappings.length} data-mapping disabled>${this.mappings.length + 1}</div>\n </ox-buttons-radio>\n\n <md-icon\n id=\"tab-nav-right-button\"\n @click=${(e: Event) => {\n this._onTabScrollNavRight()\n }}\n disabled\n >chevron_right</md-icon\n >\n </div>\n\n <div binding>\n <md-icon style=\"font-size:19px\" @click=${() => this._clearDataBindingMapper()} title=\"delete current tab\"\n >delete_forever</md-icon\n >\n <md-icon @click=${() => this._pasteDataBindingMapper()} title=\"replace current tab\">content_paste</md-icon>\n <md-icon style=\"font-size:17px\" @click=${() => this._copyDataBindingMapper()} title=\"copy current tab\"\n >content_copy</md-icon\n >\n </div>\n\n <data-binding-mapper\n @value-change=${(e: CustomEvent) => this._onMappingChanged(e)}\n .scene=${this.scene}\n .mapping=${(value.mappings && value.mappings[this.mappingIndex]) || {}}\n .properties=${PROPS}\n >\n </data-binding-mapper>\n </fieldset>\n `\n }\n\n _setMappingIndex(idx: number) {\n this.mappingIndex = isNaN(Number(idx)) ? 0 : Number(idx)\n\n this._onTabScroll()\n }\n\n _clearDataBindingMapper() {\n var mappings = [...(this.value?.mappings || [])]\n mappings.splice(this.mappingIndex, 1)\n this.onAfterValueChange(\n 'mappings',\n mappings.filter(m => !!m)\n )\n }\n\n _copyDataBindingMapper() {\n clipboard = JSON.stringify(this.mappings[this.mappingIndex])\n }\n\n async _pasteDataBindingMapper() {\n var index = this.mappingIndex\n var mappings = [...(this.value?.mappings || [])]\n mappings[this.mappingIndex] = JSON.parse(clipboard)\n\n this.onAfterValueChange('mappings', mappings)\n\n setTimeout(() => {\n this._setMappingIndex(index)\n }, 100)\n }\n\n async onValueChanged() {\n await this.updateComplete\n\n if (this._afterRender) {\n this._afterRender()\n } else {\n this._setMappingIndex(0)\n }\n\n this._afterRender = null\n }\n\n onValueChange(e: Event) {\n var element = e.target as HTMLElement\n var key = element.getAttribute('value-key')\n\n var value = this.getValueFromEventTarget(element)\n\n if (!key) {\n return\n }\n\n this.value = {\n ...this.value,\n [key]: value\n }\n\n this.onAfterValueChange(key, value)\n }\n\n get tabContainer() {\n return this.tabs\n }\n\n async _onMappingChanged(e: CustomEvent) {\n var mapping = (e.target as any).mapping\n\n /* data spread target의 변경이 있는 경우, target 컴포넌트들의 태그를 블링크 시킨다 */\n if (mapping && mapping.target) {\n this.scene &&\n this.scene.findAll(mapping.target, this.scene.selected && this.scene.selected[0]).forEach((c, i) => {\n if (i == 0) c.trigger('decotagreset')\n c.trigger('decotag', {})\n })\n }\n\n /* mapping의 모든 속성이 편집되면, 모델에 반영한다. */\n var mappings = [...(this.value?.mappings || [])]\n\n if (mapping.target && mapping.property && mapping.rule) {\n mappings[this.mappingIndex] = mapping\n\n var mappingIdx = this.mappingIndex\n this._afterRender = () => {\n this._setMappingIndex(mappingIdx)\n this.tabContainer.scrollLeft = this.tabContainer.scrollWidth\n }\n\n this.dispatchEvent(\n new CustomEvent('property-change', {\n bubbles: true,\n composed: true,\n detail: {\n mappings: mappings.filter(m => !!m)\n }\n })\n )\n\n await this.requestUpdate()\n } else if (!mapping.target && !mapping.property) {\n const { accessor, source } = e.detail?.changed || {}\n\n // accessor나 source를 입력중인 경우 tabIndex Change 방지\n if (!accessor && !source) {\n mappings[this.mappingIndex] = null\n var nextMappingIdx = Math.max(this.mappingIndex - 1, 0)\n this._afterRender = () => {\n this._setMappingIndex(nextMappingIdx)\n }\n this.dispatchEvent(\n new CustomEvent('property-change', {\n bubbles: true,\n composed: true,\n detail: {\n mappings: mappings.filter(m => !!m)\n }\n })\n )\n }\n }\n }\n\n _onTabScroll() {\n if (this.tabContainer.clientWidth == this.tabContainer.scrollWidth) {\n this.tabNavLeftButton.setAttribute('disabled', '')\n this.tabNavRightButton.setAttribute('disabled', '')\n }\n // left-end\n else if (this.tabContainer.scrollLeft == 0) {\n this.tabNavLeftButton.setAttribute('disabled', '')\n this.tabNavRightButton.removeAttribute('disabled')\n }\n // right-end\n else if (this.tabContainer.scrollLeft + this.tabContainer.clientWidth >= this.tabContainer.scrollWidth) {\n this.tabNavLeftButton.removeAttribute('disabled')\n this.tabNavRightButton.setAttribute('disabled', '')\n } else {\n this.tabNavLeftButton.removeAttribute('disabled')\n this.tabNavRightButton.removeAttribute('disabled')\n }\n }\n\n _onTabScrollNavLeft() {\n this.tabContainer.style.scrollBehavior = 'smooth'\n this.tabContainer.scrollLeft -= this.tabContainer.clientWidth\n this.tabContainer.style.scrollBehavior = 'auto'\n }\n\n _onTabScrollNavRight() {\n this.tabContainer.style.scrollBehavior = 'smooth'\n this.tabContainer.scrollLeft += this.tabContainer.clientWidth\n this.tabContainer.style.scrollBehavior = 'auto'\n }\n}\n"]}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @license Copyright © HatioLab Inc. All rights reserved.
3
+ */
4
+ import '@operato/i18n/ox-i18n.js';
5
+ import '@operato/help/ox-title-with-help.js';
6
+ import { Properties, Scene } from '@hatiolab/things-scene';
7
+ import { AbstractProperty } from '../abstract-property.js';
8
+ import { PropertyAnimations } from './property-animations.js';
9
+ import { PropertyEvent } from './property-event.js';
10
+ import { PropertyShadow } from './property-shadow.js';
11
+ declare const PropertyEffects_base: typeof AbstractProperty & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types.js").ScopedElementsHost>;
12
+ export declare class PropertyEffects extends PropertyEffects_base {
13
+ static styles: import("lit").CSSResult[];
14
+ value?: Properties;
15
+ scene?: Scene;
16
+ firstUpdated(): void;
17
+ static get scopedElements(): {
18
+ 'property-shadow': typeof PropertyShadow;
19
+ 'property-animations': typeof PropertyAnimations;
20
+ 'property-event': typeof PropertyEvent;
21
+ };
22
+ render(): import("lit-html").TemplateResult<1>;
23
+ }
24
+ export {};
@@ -0,0 +1,72 @@
1
+ /**
2
+ * @license Copyright © HatioLab Inc. All rights reserved.
3
+ */
4
+ import { __decorate } from "tslib";
5
+ import '@operato/i18n/ox-i18n.js';
6
+ import '@operato/help/ox-title-with-help.js';
7
+ import { css, html } from 'lit';
8
+ import { property } from 'lit/decorators.js';
9
+ import { ScopedElementsMixin } from '@open-wc/scoped-elements';
10
+ import { PropertyGridStyles } from '@operato/styles/property-grid-styles.js';
11
+ import { AbstractProperty } from '../abstract-property.js';
12
+ import { PropertyAnimations } from './property-animations.js';
13
+ import { PropertyEvent } from './property-event.js';
14
+ import { PropertyShadow } from './property-shadow.js';
15
+ export class PropertyEffects extends ScopedElementsMixin(AbstractProperty) {
16
+ firstUpdated() {
17
+ this.renderRoot.addEventListener('change', this.onValueChange.bind(this));
18
+ }
19
+ static get scopedElements() {
20
+ return {
21
+ 'property-shadow': PropertyShadow,
22
+ 'property-animations': PropertyAnimations,
23
+ 'property-event': PropertyEvent
24
+ };
25
+ }
26
+ render() {
27
+ const value = this.value || {};
28
+ return html `
29
+ <fieldset>
30
+ <legend>
31
+ <ox-title-with-help topic="board-modeller/effects/shadow" msgid="label.shadow">shadow</ox-title-with-help>
32
+ </legend>
33
+
34
+ <property-shadow value-key="shadow" .value=${value.shadow || {}}> </property-shadow>
35
+ </fieldset>
36
+
37
+ <fieldset>
38
+ <legend>
39
+ <ox-title-with-help topic="board-modeller/effects/retention" msgid="label.retention"
40
+ >retention</ox-title-with-help
41
+ >
42
+ </legend>
43
+
44
+ <div class="property-grid">
45
+ <label> <ox-i18n msgid="label.retention">retention</ox-i18n> </label>
46
+ <input type="number" value-key="retention" .value=${value.retention} placeholder="ms" />
47
+ </div>
48
+ </fieldset>
49
+
50
+ <property-animations value-key="animation" .scene=${this.scene} .value=${value.animation || {}}>
51
+ </property-animations>
52
+
53
+ <property-event value-key="event" .scene=${this.scene} .value=${value.event || {}}> </property-event>
54
+ `;
55
+ }
56
+ }
57
+ PropertyEffects.styles = [
58
+ PropertyGridStyles,
59
+ css `
60
+ :host {
61
+ display: flex;
62
+ flex-direction: column;
63
+ }
64
+ `
65
+ ];
66
+ __decorate([
67
+ property({ type: Object })
68
+ ], PropertyEffects.prototype, "value", void 0);
69
+ __decorate([
70
+ property({ type: Object })
71
+ ], PropertyEffects.prototype, "scene", void 0);
72
+ //# sourceMappingURL=effects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effects.js","sourceRoot":"","sources":["../../../../src/property-panel/effects/effects.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,0BAA0B,CAAA;AACjC,OAAO,qCAAqC,CAAA;AAE5C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG5C,OAAO,EAAE,m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.\n */\n\nimport '@operato/i18n/ox-i18n.js'\nimport '@operato/help/ox-title-with-help.js'\n\nimport { css, html } from 'lit'\nimport { property } from 'lit/decorators.js'\n\nimport { Properties, Scene } from '@hatiolab/things-scene'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { PropertyGridStyles } from '@operato/styles/property-grid-styles.js'\n\nimport { AbstractProperty } from '../abstract-property.js'\nimport { PropertyAnimations } from './property-animations.js'\nimport { PropertyEvent } from './property-event.js'\nimport { PropertyShadow } from './property-shadow.js'\n\nexport class PropertyEffects extends ScopedElementsMixin(AbstractProperty) {\n static styles = [\n PropertyGridStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n }\n `\n ]\n\n @property({ type: Object }) value?: Properties\n @property({ type: Object }) scene?: Scene\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', this.onValueChange.bind(this))\n }\n\n static get scopedElements() {\n return {\n 'property-shadow': PropertyShadow,\n 'property-animations': PropertyAnimations,\n 'property-event': PropertyEvent\n }\n }\n\n render() {\n const value = this.value || {}\n\n return html`\n <fieldset>\n <legend>\n <ox-title-with-help topic=\"board-modeller/effects/shadow\" msgid=\"label.shadow\">shadow</ox-title-with-help>\n </legend>\n\n <property-shadow value-key=\"shadow\" .value=${value.shadow || {}}> </property-shadow>\n </fieldset>\n\n <fieldset>\n <legend>\n <ox-title-with-help topic=\"board-modeller/effects/retention\" msgid=\"label.retention\"\n >retention</ox-title-with-help\n >\n </legend>\n\n <div class=\"property-grid\">\n <label> <ox-i18n msgid=\"label.retention\">retention</ox-i18n> </label>\n <input type=\"number\" value-key=\"retention\" .value=${value.retention} placeholder=\"ms\" />\n </div>\n </fieldset>\n\n <property-animations value-key=\"animation\" .scene=${this.scene} .value=${value.animation || {}}>\n </property-animations>\n\n <property-event value-key=\"event\" .scene=${this.scene} .value=${value.event || {}}> </property-event>\n `\n }\n}\n"]}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license Copyright © HatioLab Inc. All rights reserved.
3
+ */
4
+ import '@operato/input/ox-input-angle.js';
5
+ import '@operato/i18n/ox-i18n.js';
6
+ import { LitElement } from 'lit';
7
+ import { Properties, Scene } from '@hatiolab/things-scene';
8
+ /**
9
+ * 컴포넌트의 animation 속성을 편집하는 element
10
+
11
+ Example:
12
+
13
+ <property-animation .value=${animation}>
14
+ </property-animation>
15
+ */
16
+ export declare class PropertyAnimation extends LitElement {
17
+ static styles: import("lit").CSSResult[];
18
+ value?: Properties;
19
+ scene?: Scene;
20
+ firstUpdated(): void;
21
+ render(): import("lit-html").TemplateResult<1>;
22
+ onValueChange(e: Event): void;
23
+ }