@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,380 @@
1
+ /**
2
+ * @license Copyright © HatioLab Inc. All rights reserved.
3
+ */
4
+ import { __decorate } from "tslib";
5
+ import '@operato/input/ox-buttons-radio.js';
6
+ import '@operato/input/ox-input-code.js';
7
+ import '@operato/i18n/ox-i18n.js';
8
+ import '@operato/help/ox-help-icon.js';
9
+ import './data-binding-value-map.js';
10
+ import './data-binding-value-range.js';
11
+ import { css, html, LitElement } from 'lit';
12
+ import { property, query, state } from 'lit/decorators.js';
13
+ import { PropertyGridStyles } from '@operato/styles/property-grid-styles.js';
14
+ /**
15
+ element for mapping data value editing
16
+
17
+ Example:
18
+
19
+ <data-binding-mapper mapping=${mapping}>
20
+ </data-binding-mapper>
21
+ */
22
+ export class DataBindingMapper extends LitElement {
23
+ constructor() {
24
+ super(...arguments);
25
+ this.mapping = {
26
+ rule: 'value'
27
+ };
28
+ this.rule = {};
29
+ this.properties = [];
30
+ this._valueTypes = {
31
+ play: 'boolean',
32
+ hidden: 'boolean',
33
+ started: 'boolean',
34
+ rotation: 'number',
35
+ value: 'number',
36
+ fillStyle: 'color',
37
+ strokeStyle: 'color',
38
+ fontColor: 'color',
39
+ data: 'object',
40
+ source: 'attachment',
41
+ location: 'object',
42
+ dimension: 'object',
43
+ text: 'string',
44
+ ref: 'string'
45
+ };
46
+ this._componentIds = [];
47
+ this._keep_saved_rule_params = false;
48
+ }
49
+ firstUpdated() {
50
+ this.renderRoot.addEventListener('change', e => this._onChange(e));
51
+ }
52
+ updated(changes) {
53
+ changes.has('mapping') && this._onChangedMapping();
54
+ }
55
+ findComponentIds() {
56
+ this._componentIds =
57
+ (this.scene &&
58
+ this.scene.ids.map(i => {
59
+ var _a;
60
+ const id = i.key;
61
+ return { value: `#${id}`, description: (_a = this.scene.findById(id)) === null || _a === void 0 ? void 0 : _a.get('type') };
62
+ })) ||
63
+ [];
64
+ }
65
+ render() {
66
+ const mapping = this.mapping || {
67
+ rule: 'value'
68
+ };
69
+ return html `
70
+ <div class="property-grid">
71
+ <label for="source-input"> <ox-i18n msgid="label.source">source</ox-i18n> </label>
72
+ <input
73
+ id="source-input"
74
+ type="text"
75
+ value-key="source"
76
+ list="source-list"
77
+ .value=${mapping.source || ''}
78
+ @focusin=${() => this.findComponentIds()}
79
+ />
80
+
81
+ <label for="accessor-input">
82
+ <ox-i18n msgid="label.accessor">accessor</ox-i18n
83
+ ><ox-help-icon topic="board-modeller/accessor"></ox-help-icon>
84
+ </label>
85
+ <input
86
+ id="accessor-input"
87
+ value-key="accessor"
88
+ type="text"
89
+ data-mapping-accessor
90
+ .value=${mapping.accessor || ''}
91
+ />
92
+
93
+ <label for="target-input"> <ox-i18n msgid="label.target">target</ox-i18n> </label>
94
+ <input
95
+ id="target-input"
96
+ type="text"
97
+ value-key="target"
98
+ list="target-list"
99
+ .value=${mapping.target || ''}
100
+ @focusin=${() => this.findComponentIds()}
101
+ />
102
+
103
+ <datalist id="source-list">
104
+ <option value="(self)"></option>
105
+ ${this._componentIds.length
106
+ ? html `
107
+ ${this._componentIds.map(({ value, description }) => html ` <option value=${value}>${description}</option> `)}
108
+ `
109
+ : html ``}
110
+ </datalist>
111
+
112
+ <datalist id="target-list">
113
+ <option value="(self)"></option>
114
+ <option value="(children)"></option>
115
+ <option value="(key)"></option>
116
+ <option value="[propkey]"></option>
117
+ ${this._componentIds.length
118
+ ? html `
119
+ ${this._componentIds.map(({ value, description }) => html ` <option value=${value}>${description}</option> `)}
120
+ `
121
+ : html ``}
122
+ </datalist>
123
+
124
+ <label for="property-input">
125
+ <ox-i18n msgid="label.property">property</ox-i18n
126
+ ><ox-help-icon topic="board-modeller/data-binding-property"></ox-help-icon
127
+ ></label>
128
+ <select id="property-input" value-key="property" .value=${mapping.property || ''}>
129
+ ${this.properties.map(item => html `
130
+ <option .value=${item.name} ?selected=${item.name == mapping.property}>${item.label}</option>
131
+ `)}
132
+ </select>
133
+
134
+ <label> <ox-i18n msgid="label.rule-type">rule type</ox-i18n> </label>
135
+ <ox-buttons-radio .value=${mapping.rule} @change=${(e) => this._onChangeRule(e)}>
136
+ <div data-value="value"><ox-i18n msgid="label.value"></ox-i18n></div>
137
+ <div data-value="map"><ox-i18n msgid="label.map"></ox-i18n></div>
138
+ <div data-value="range"><ox-i18n msgid="label.range"></ox-i18n></div>
139
+ <div data-value="eval"><ox-i18n msgid="label.eval"></ox-i18n></div>
140
+ </ox-buttons-radio>
141
+
142
+ <div class="property-full-bleed" rule-editors ?hidden=${mapping.rule == 'value'}>
143
+ <data-binding-value-map
144
+ value-key="map"
145
+ .value=${this.rule.map || {}}
146
+ .valuetype=${this._valuetype(mapping.property)}
147
+ ?active=${mapping.rule == 'map'}
148
+ >
149
+ </data-binding-value-map>
150
+
151
+ <data-binding-value-range
152
+ value-key="range"
153
+ .value=${this.rule.range || []}
154
+ .valuetype=${this._valuetype(mapping.property)}
155
+ ?active=${mapping.rule == 'range'}
156
+ >
157
+ </data-binding-value-range>
158
+
159
+ <ox-input-code
160
+ class="property-full-bleed"
161
+ value-key="eval"
162
+ id="eval-editor"
163
+ .value=${this.rule.eval || ''}
164
+ ?active=${mapping.rule == 'eval'}
165
+ language="javascript"
166
+ >
167
+ </ox-input-code>
168
+ </div>
169
+
170
+ <input id="checkbox-partial" type="checkbox" value-key="partial" .checked=${mapping.partial === true} />
171
+ <label for="checkbox-partial"> <ox-i18n msgid="label.partial-spreading">Partial Spreading</ox-i18n> </label>
172
+
173
+ <input id="checkbox-ndnsp" type="checkbox" value-key="ndnsp" .checked=${mapping.ndnsp === true} />
174
+ <label for="checkbox-ndnsp"> <ox-i18n msgid="label.ndnsp">No Data No Spreading</ox-i18n> </label>
175
+ </div>
176
+ `;
177
+ }
178
+ _valuetype(property) {
179
+ return this._valueTypes[property] || 'string';
180
+ }
181
+ async _onChangedMapping() {
182
+ if (this._keep_saved_rule_params) {
183
+ this._keep_saved_rule_params = false;
184
+ }
185
+ else {
186
+ await this.updateComplete;
187
+ var rule = {};
188
+ if (this.mapping) {
189
+ switch (this.mapping.rule) {
190
+ case 'map':
191
+ rule.map = this.mapping.param || {};
192
+ break;
193
+ case 'range':
194
+ rule.range = this.mapping.param || [];
195
+ break;
196
+ case 'eval':
197
+ rule.eval = this.mapping.param || '';
198
+ break;
199
+ default:
200
+ this.mapping.rule = 'value';
201
+ break;
202
+ }
203
+ }
204
+ this.rule = rule;
205
+ this.requestUpdate();
206
+ }
207
+ }
208
+ _onChangeRule(e) {
209
+ var element = e.target;
210
+ var value = element.value;
211
+ let param;
212
+ switch (value) {
213
+ case 'map':
214
+ param = this.rule.map;
215
+ break;
216
+ case 'range':
217
+ param = this.rule.range;
218
+ break;
219
+ case 'eval':
220
+ param = this.rule.eval || '';
221
+ // rule.eval에 값이 없을 때, ace-editor 내용이 초기화되지 않는 문제때문에 처리함.
222
+ if (!param) {
223
+ this.editor.value = 'return';
224
+ }
225
+ break;
226
+ default:
227
+ }
228
+ this.mapping = {
229
+ ...this.mapping,
230
+ rule: value,
231
+ param
232
+ };
233
+ this._keep_saved_rule_params = true;
234
+ this.dispatchEvent(new CustomEvent('value-change', { bubbles: true, composed: true }));
235
+ }
236
+ _onChange(e) {
237
+ var element = e.target;
238
+ var key = element.getAttribute('value-key');
239
+ if (!key)
240
+ return;
241
+ var value = element.value;
242
+ if (key === 'source') {
243
+ if (value.length > 0) {
244
+ value = value.trim();
245
+ this.source.value = value;
246
+ }
247
+ this.mapping = {
248
+ ...this.mapping,
249
+ source: value
250
+ };
251
+ }
252
+ else if (key === 'target') {
253
+ if (value.length > 0 && !/^[.#(\[]/.test(value)) {
254
+ value = '#' + value.trim();
255
+ this.target.value = value;
256
+ }
257
+ this.mapping = {
258
+ ...this.mapping,
259
+ target: value
260
+ };
261
+ }
262
+ else if (key === 'accessor') {
263
+ this.mapping = {
264
+ ...this.mapping,
265
+ accessor: (value || '').trim()
266
+ };
267
+ }
268
+ else if (key === 'property') {
269
+ this.mapping = {
270
+ ...this.mapping,
271
+ property: (value || '').trim()
272
+ };
273
+ }
274
+ else if (key === 'map' || key === 'range' || key === 'eval') {
275
+ this.rule[key] = value;
276
+ this.mapping = {
277
+ ...this.mapping,
278
+ param: value
279
+ };
280
+ }
281
+ else if (key === 'ndnsp' /* no data no spreading */) {
282
+ value = element.checked;
283
+ this.mapping = {
284
+ ...this.mapping,
285
+ ndnsp: value
286
+ };
287
+ }
288
+ else if (key === 'partial' /* partial spreading */) {
289
+ value = element.checked;
290
+ this.mapping = {
291
+ ...this.mapping,
292
+ partial: value
293
+ };
294
+ }
295
+ if (!this.mapping.rule) {
296
+ this.mapping.rule = 'value';
297
+ }
298
+ this._keep_saved_rule_params = true;
299
+ this.dispatchEvent(new CustomEvent('value-change', {
300
+ bubbles: true,
301
+ composed: true,
302
+ detail: {
303
+ changed: {
304
+ [key]: value
305
+ }
306
+ }
307
+ }));
308
+ }
309
+ }
310
+ DataBindingMapper.styles = [
311
+ PropertyGridStyles,
312
+ css `
313
+ :host {
314
+ display: flex;
315
+ overflow: hidden;
316
+ padding: 7px 0 0 0;
317
+ border: 1px solid rgba(0, 0, 0, 0.2);
318
+ border-width: 0 1px 1px 1px;
319
+ padding: 4px;
320
+ line-height: 2;
321
+ }
322
+
323
+ select {
324
+ height: 22px;
325
+ }
326
+
327
+ [mapping-rule] {
328
+ display: flex;
329
+ }
330
+
331
+ [mapping-rule] * {
332
+ flex: auto;
333
+ margin: 0;
334
+ text-align: left;
335
+ align-self: center;
336
+ }
337
+
338
+ [rule-editors] {
339
+ display: 'flex';
340
+ align-content: auto;
341
+ }
342
+
343
+ [rule-editors] :not([active]) {
344
+ display: none;
345
+ }
346
+
347
+ ox-input-code {
348
+ height: 300px;
349
+ overflow: auto;
350
+ }
351
+ `
352
+ ];
353
+ __decorate([
354
+ property({ type: Object })
355
+ ], DataBindingMapper.prototype, "mapping", void 0);
356
+ __decorate([
357
+ property({ type: Object })
358
+ ], DataBindingMapper.prototype, "rule", void 0);
359
+ __decorate([
360
+ property({ type: Array })
361
+ ], DataBindingMapper.prototype, "properties", void 0);
362
+ __decorate([
363
+ property({ type: Object })
364
+ ], DataBindingMapper.prototype, "scene", void 0);
365
+ __decorate([
366
+ state()
367
+ ], DataBindingMapper.prototype, "_valueTypes", void 0);
368
+ __decorate([
369
+ state()
370
+ ], DataBindingMapper.prototype, "_componentIds", void 0);
371
+ __decorate([
372
+ query('#eval-editor')
373
+ ], DataBindingMapper.prototype, "editor", void 0);
374
+ __decorate([
375
+ query('#source-input')
376
+ ], DataBindingMapper.prototype, "source", void 0);
377
+ __decorate([
378
+ query('#target-input')
379
+ ], DataBindingMapper.prototype, "target", void 0);
380
+ //# sourceMappingURL=data-binding-mapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-binding-mapper.js","sourceRoot":"","sources":["../../../../src/property-panel/data-binding/data-binding-mapper.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,oCAAoC,CAAA;AAC3C,OAAO,iCAAiC,CAAA;AACxC,OAAO,0BAA0B,CAAA;AACjC,OAAO,+BAA+B,CAAA;AACtC,OAAO,6BAA6B,CAAA;AACpC,OAAO,+BAA+B,CAAA;AAEtC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAG1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAqB5E;;;;;;;EAOE;AAEF,MAAM,OAAO,iBAAkB,SAAQ,UAAU;IAAjD;;QA6C8B,YAAO,GAAY;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AAE,MAAM,EAAE,CAAC;kDAE1B;AAC2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAgB;AAChB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;qDAA8B;AAC5B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAc;AAEhC;IAAR,KAAK,EAAE;sDAmBP;AACQ;IAAR,KAAK,EAAE;wDAA6D;AAE9C;IAAtB,KAAK,CAAC,cAAc,CAAC;iDAA0B;AACxB;IAAvB,KAAK,CAAC,eAAe,CAAC;iDAA0B;AACzB;IAAvB,KAAK,CAAC,eAAe,CAAC;iDAA0B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@operato/input/ox-buttons-radio.js'\nimport '@operato/input/ox-input-code.js'\nimport '@operato/i18n/ox-i18n.js'\nimport '@operato/help/ox-help-icon.js'\nimport './data-binding-value-map.js'\nimport './data-binding-value-range.js'\n\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { property, query, state } from 'lit/decorators.js'\n\nimport { Properties, Scene } from '@hatiolab/things-scene'\nimport { PropertyGridStyles } from '@operato/styles/property-grid-styles.js'\n\nexport type Rule =\n | {\n map?: Properties\n range?: Properties[]\n eval?: string\n }\n | any\n\nexport type Mapping = {\n source?: string\n rule: 'map' | 'range' | 'eval' | 'value'\n accessor?: string\n target?: string\n property?: string\n param?: Rule\n ndnsp?: boolean\n partial?: boolean\n}\n\n/**\nelement for mapping data value editing\n\nExample:\n\n <data-binding-mapper mapping=${mapping}>\n </data-binding-mapper>\n*/\n\nexport class DataBindingMapper extends LitElement {\n static styles = [\n PropertyGridStyles,\n css`\n :host {\n display: flex;\n overflow: hidden;\n padding: 7px 0 0 0;\n border: 1px solid rgba(0, 0, 0, 0.2);\n border-width: 0 1px 1px 1px;\n padding: 4px;\n line-height: 2;\n }\n\n select {\n height: 22px;\n }\n\n [mapping-rule] {\n display: flex;\n }\n\n [mapping-rule] * {\n flex: auto;\n margin: 0;\n text-align: left;\n align-self: center;\n }\n\n [rule-editors] {\n display: 'flex';\n align-content: auto;\n }\n\n [rule-editors] :not([active]) {\n display: none;\n }\n\n ox-input-code {\n height: 300px;\n overflow: auto;\n }\n `\n ]\n\n @property({ type: Object }) mapping: Mapping = {\n rule: 'value'\n }\n @property({ type: Object }) rule: Rule = {}\n @property({ type: Array }) properties: Properties[] = []\n @property({ type: Object }) scene?: Scene\n\n @state() _valueTypes: any = {\n play: 'boolean',\n hidden: 'boolean',\n started: 'boolean',\n\n rotation: 'number',\n value: 'number',\n\n fillStyle: 'color',\n strokeStyle: 'color',\n fontColor: 'color',\n\n data: 'object',\n source: 'attachment',\n location: 'object',\n dimension: 'object',\n\n text: 'string',\n ref: 'string'\n }\n @state() _componentIds: { value: string; description: string }[] = []\n\n @query('#eval-editor') editor!: HTMLInputElement\n @query('#source-input') source!: HTMLInputElement\n @query('#target-input') target!: HTMLInputElement\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', e => this._onChange(e))\n }\n\n updated(changes: PropertyValues<this>) {\n changes.has('mapping') && this._onChangedMapping()\n }\n\n findComponentIds() {\n this._componentIds =\n (this.scene &&\n this.scene.ids.map(i => {\n const id = i.key\n return { value: `#${id}`, description: this.scene!.findById(id)?.get('type') }\n })) ||\n []\n }\n\n render() {\n const mapping = this.mapping || {\n rule: 'value'\n }\n\n return html`\n <div class=\"property-grid\">\n <label for=\"source-input\"> <ox-i18n msgid=\"label.source\">source</ox-i18n> </label>\n <input\n id=\"source-input\"\n type=\"text\"\n value-key=\"source\"\n list=\"source-list\"\n .value=${mapping.source || ''}\n @focusin=${() => this.findComponentIds()}\n />\n\n <label for=\"accessor-input\">\n <ox-i18n msgid=\"label.accessor\">accessor</ox-i18n\n ><ox-help-icon topic=\"board-modeller/accessor\"></ox-help-icon>\n </label>\n <input\n id=\"accessor-input\"\n value-key=\"accessor\"\n type=\"text\"\n data-mapping-accessor\n .value=${mapping.accessor || ''}\n />\n\n <label for=\"target-input\"> <ox-i18n msgid=\"label.target\">target</ox-i18n> </label>\n <input\n id=\"target-input\"\n type=\"text\"\n value-key=\"target\"\n list=\"target-list\"\n .value=${mapping.target || ''}\n @focusin=${() => this.findComponentIds()}\n />\n\n <datalist id=\"source-list\">\n <option value=\"(self)\"></option>\n ${this._componentIds.length\n ? html`\n ${this._componentIds.map(\n ({ value, description }) => html` <option value=${value}>${description}</option> `\n )}\n `\n : html``}\n </datalist>\n\n <datalist id=\"target-list\">\n <option value=\"(self)\"></option>\n <option value=\"(children)\"></option>\n <option value=\"(key)\"></option>\n <option value=\"[propkey]\"></option>\n ${this._componentIds.length\n ? html`\n ${this._componentIds.map(\n ({ value, description }) => html` <option value=${value}>${description}</option> `\n )}\n `\n : html``}\n </datalist>\n\n <label for=\"property-input\">\n <ox-i18n msgid=\"label.property\">property</ox-i18n\n ><ox-help-icon topic=\"board-modeller/data-binding-property\"></ox-help-icon\n ></label>\n <select id=\"property-input\" value-key=\"property\" .value=${mapping.property || ''}>\n ${this.properties.map(\n item => html`\n <option .value=${item.name} ?selected=${item.name == mapping.property}>${item.label}</option>\n `\n )}\n </select>\n\n <label> <ox-i18n msgid=\"label.rule-type\">rule type</ox-i18n> </label>\n <ox-buttons-radio .value=${mapping.rule} @change=${(e: Event) => this._onChangeRule(e)}>\n <div data-value=\"value\"><ox-i18n msgid=\"label.value\"></ox-i18n></div>\n <div data-value=\"map\"><ox-i18n msgid=\"label.map\"></ox-i18n></div>\n <div data-value=\"range\"><ox-i18n msgid=\"label.range\"></ox-i18n></div>\n <div data-value=\"eval\"><ox-i18n msgid=\"label.eval\"></ox-i18n></div>\n </ox-buttons-radio>\n\n <div class=\"property-full-bleed\" rule-editors ?hidden=${mapping.rule == 'value'}>\n <data-binding-value-map\n value-key=\"map\"\n .value=${this.rule.map || {}}\n .valuetype=${this._valuetype(mapping.property!)}\n ?active=${mapping.rule == 'map'}\n >\n </data-binding-value-map>\n\n <data-binding-value-range\n value-key=\"range\"\n .value=${this.rule.range || []}\n .valuetype=${this._valuetype(mapping.property!)}\n ?active=${mapping.rule == 'range'}\n >\n </data-binding-value-range>\n\n <ox-input-code\n class=\"property-full-bleed\"\n value-key=\"eval\"\n id=\"eval-editor\"\n .value=${this.rule.eval || ''}\n ?active=${mapping.rule == 'eval'}\n language=\"javascript\"\n >\n </ox-input-code>\n </div>\n\n <input id=\"checkbox-partial\" type=\"checkbox\" value-key=\"partial\" .checked=${mapping.partial === true} />\n <label for=\"checkbox-partial\"> <ox-i18n msgid=\"label.partial-spreading\">Partial Spreading</ox-i18n> </label>\n\n <input id=\"checkbox-ndnsp\" type=\"checkbox\" value-key=\"ndnsp\" .checked=${mapping.ndnsp === true} />\n <label for=\"checkbox-ndnsp\"> <ox-i18n msgid=\"label.ndnsp\">No Data No Spreading</ox-i18n> </label>\n </div>\n `\n }\n\n _valuetype(property: string) {\n return this._valueTypes[property] || 'string'\n }\n\n private _keep_saved_rule_params: boolean = false\n\n async _onChangedMapping() {\n if (this._keep_saved_rule_params) {\n this._keep_saved_rule_params = false\n } else {\n await this.updateComplete\n\n var rule: Rule = {}\n\n if (this.mapping) {\n switch (this.mapping.rule) {\n case 'map':\n rule.map = this.mapping.param || {}\n break\n case 'range':\n rule.range = this.mapping.param || []\n break\n case 'eval':\n rule.eval = this.mapping.param || ''\n break\n default:\n this.mapping.rule = 'value'\n break\n }\n }\n\n this.rule = rule\n this.requestUpdate()\n }\n }\n\n _onChangeRule(e: Event) {\n var element = e.target as HTMLInputElement\n var value = element.value\n\n let param\n\n switch (value) {\n case 'map':\n param = this.rule.map\n break\n case 'range':\n param = this.rule.range\n break\n case 'eval':\n param = this.rule.eval || ''\n\n // rule.eval에 값이 없을 때, ace-editor 내용이 초기화되지 않는 문제때문에 처리함.\n if (!param) {\n this.editor.value = 'return'\n }\n break\n default:\n }\n\n this.mapping = {\n ...this.mapping,\n rule: value as 'value' | 'map' | 'range' | 'eval',\n param\n }\n\n this._keep_saved_rule_params = true\n this.dispatchEvent(new CustomEvent('value-change', { bubbles: true, composed: true }))\n }\n\n _onChange(e: Event) {\n var element = e.target as HTMLInputElement\n var key = element.getAttribute('value-key')\n\n if (!key) return\n\n var value: string | boolean = element.value\n\n if (key === 'source') {\n if (value.length > 0) {\n value = value.trim()\n\n this.source.value = value\n }\n\n this.mapping = {\n ...this.mapping,\n source: value\n }\n } else if (key === 'target') {\n if (value.length > 0 && !/^[.#(\\[]/.test(value)) {\n value = '#' + value.trim()\n\n this.target.value = value\n }\n\n this.mapping = {\n ...this.mapping,\n target: value\n }\n } else if (key === 'accessor') {\n this.mapping = {\n ...this.mapping,\n accessor: (value || '').trim()\n }\n } else if (key === 'property') {\n this.mapping = {\n ...this.mapping,\n property: (value || '').trim()\n }\n } else if (key === 'map' || key === 'range' || key === 'eval') {\n this.rule[key] = value\n this.mapping = {\n ...this.mapping,\n param: value\n }\n } else if (key === 'ndnsp' /* no data no spreading */) {\n value = element.checked\n\n this.mapping = {\n ...this.mapping,\n ndnsp: value\n }\n } else if (key === 'partial' /* partial spreading */) {\n value = element.checked\n\n this.mapping = {\n ...this.mapping,\n partial: value\n }\n }\n\n if (!this.mapping.rule) {\n this.mapping.rule = 'value'\n }\n\n this._keep_saved_rule_params = true\n this.dispatchEvent(\n new CustomEvent('value-change', {\n bubbles: true,\n composed: true,\n detail: {\n changed: {\n [key]: value\n }\n }\n })\n )\n }\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { OxInputValueMap } from '@operato/input';
2
+ import '@operato/attachment/ox-attachment-selector.js';
3
+ export declare class DataBindingValueMap extends OxInputValueMap {
4
+ static styles: import("lit").CSSResult;
5
+ valueInputTemplate(value?: any): import("lit-html").TemplateResult<1>;
6
+ }
@@ -0,0 +1,20 @@
1
+ import { __decorate } from "tslib";
2
+ import { html } from 'lit';
3
+ import { customElement } from 'lit/decorators.js';
4
+ import { ifDefined } from 'lit/directives/if-defined.js';
5
+ import { OxInputValueMap } from '@operato/input';
6
+ import '@operato/attachment/ox-attachment-selector.js';
7
+ let DataBindingValueMap = class DataBindingValueMap extends OxInputValueMap {
8
+ valueInputTemplate(value) {
9
+ if (this.valuetype == 'attachment') {
10
+ return html `<ox-attachment-selector data-value value=${ifDefined(value)}></ox-attachment-selector>`;
11
+ }
12
+ return super.valueInputTemplate(value);
13
+ }
14
+ };
15
+ DataBindingValueMap.styles = OxInputValueMap.styles;
16
+ DataBindingValueMap = __decorate([
17
+ customElement('data-binding-value-map')
18
+ ], DataBindingValueMap);
19
+ export { DataBindingValueMap };
20
+ //# sourceMappingURL=data-binding-value-map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-binding-value-map.js","sourceRoot":"","sources":["../../../../src/property-panel/data-binding/data-binding-value-map.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhD,OAAO,+CAA+C,CAAA;AAG/C,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,eAAe;IAGtD,kBAAkB,CAAC,KAAW;QAC5B,IAAI,IAAI,CAAC,SAAS,IAAI,YAAY,EAAE,CAAC;YACnC,OAAO,IAAI,CAAA,4CAA4C,SAAS,CAAC,KAAK,CAAC,4BAA4B,CAAA;QACrG,CAAC;QACD,OAAO,KAAK,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAA;IACxC,CAAC;;AAPM,0BAAM,GAAG,eAAe,CAAC,MAAM,AAAzB,CAAyB;AAD3B,mBAAmB;IAD/B,aAAa,CAAC,wBAAwB,CAAC;GAC3B,mBAAmB,CAS/B","sourcesContent":["import { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\n\nimport { OxInputValueMap } from '@operato/input'\n\nimport '@operato/attachment/ox-attachment-selector.js'\n\n@customElement('data-binding-value-map')\nexport class DataBindingValueMap extends OxInputValueMap {\n static styles = OxInputValueMap.styles\n\n valueInputTemplate(value?: any) {\n if (this.valuetype == 'attachment') {\n return html`<ox-attachment-selector data-value value=${ifDefined(value)}></ox-attachment-selector>`\n }\n return super.valueInputTemplate(value)\n }\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { OxInputValueRange } from '@operato/input';
2
+ import '@operato/attachment/ox-attachment-selector.js';
3
+ export declare class DataBindingValueRange extends OxInputValueRange {
4
+ static styles: import("lit").CSSResult;
5
+ valueInputTemplate(value?: any): import("lit-html").TemplateResult<1>;
6
+ }
@@ -0,0 +1,20 @@
1
+ import { __decorate } from "tslib";
2
+ import { html } from 'lit';
3
+ import { customElement } from 'lit/decorators.js';
4
+ import { ifDefined } from 'lit/directives/if-defined.js';
5
+ import { OxInputValueRange } from '@operato/input';
6
+ import '@operato/attachment/ox-attachment-selector.js';
7
+ let DataBindingValueRange = class DataBindingValueRange extends OxInputValueRange {
8
+ valueInputTemplate(value) {
9
+ if (this.valuetype == 'attachment') {
10
+ return html `<ox-attachment-selector data-value value=${ifDefined(value)}></ox-attachment-selector>`;
11
+ }
12
+ return super.valueInputTemplate(value);
13
+ }
14
+ };
15
+ DataBindingValueRange.styles = OxInputValueRange.styles;
16
+ DataBindingValueRange = __decorate([
17
+ customElement('data-binding-value-range')
18
+ ], DataBindingValueRange);
19
+ export { DataBindingValueRange };
20
+ //# sourceMappingURL=data-binding-value-range.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-binding-value-range.js","sourceRoot":"","sources":["../../../../src/property-panel/data-binding/data-binding-value-range.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAExD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAElD,OAAO,+CAA+C,CAAA;AAG/C,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,iBAAiB;IAG1D,kBAAkB,CAAC,KAAW;QAC5B,IAAI,IAAI,CAAC,SAAS,IAAI,YAAY,EAAE,CAAC;YACnC,OAAO,IAAI,CAAA,4CAA4C,SAAS,CAAC,KAAK,CAAC,4BAA4B,CAAA;QACrG,CAAC;QACD,OAAO,KAAK,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAA;IACxC,CAAC;;AAPM,4BAAM,GAAG,iBAAiB,CAAC,MAAM,AAA3B,CAA2B;AAD7B,qBAAqB;IADjC,aAAa,CAAC,0BAA0B,CAAC;GAC7B,qBAAqB,CASjC","sourcesContent":["import { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\n\nimport { OxInputValueRange } from '@operato/input'\n\nimport '@operato/attachment/ox-attachment-selector.js'\n\n@customElement('data-binding-value-range')\nexport class DataBindingValueRange extends OxInputValueRange {\n static styles = OxInputValueRange.styles\n\n valueInputTemplate(value?: any) {\n if (this.valuetype == 'attachment') {\n return html`<ox-attachment-selector data-value value=${ifDefined(value)}></ox-attachment-selector>`\n }\n return super.valueInputTemplate(value)\n }\n}\n"]}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @license Copyright © HatioLab Inc. All rights reserved.
3
+ */
4
+ import '@material/web/icon/icon.js';
5
+ import '@operato/help/ox-title-with-help.js';
6
+ import '@operato/input/ox-buttons-radio.js';
7
+ import '@operato/input/ox-input-data.js';
8
+ import '@operato/i18n/ox-i18n.js';
9
+ import { PropertyValues } from 'lit';
10
+ import { Properties, Scene } from '@hatiolab/things-scene';
11
+ import { AbstractProperty } from '../abstract-property.js';
12
+ import { DataBindingMapper } from './data-binding-mapper.js';
13
+ declare const PropertyDataBinding_base: typeof AbstractProperty & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types.js").ScopedElementsHost>;
14
+ export declare class PropertyDataBinding extends PropertyDataBinding_base {
15
+ static styles: import("lit").CSSResult[];
16
+ value?: Properties;
17
+ scene?: Scene;
18
+ mappingIndex: number;
19
+ _afterRender?: Function | null;
20
+ _dataExpanded: boolean;
21
+ tabs: HTMLElement;
22
+ tabNavLeftButton: HTMLElement;
23
+ tabNavRightButton: HTMLElement;
24
+ private mapping;
25
+ get mappings(): any;
26
+ firstUpdated(): void;
27
+ updated(changes: PropertyValues<this>): void;
28
+ static get scopedElements(): {
29
+ 'data-binding-mapper': typeof DataBindingMapper;
30
+ };
31
+ render(): import("lit-html").TemplateResult<1>;
32
+ _setMappingIndex(idx: number): void;
33
+ _clearDataBindingMapper(): void;
34
+ _copyDataBindingMapper(): void;
35
+ _pasteDataBindingMapper(): Promise<void>;
36
+ onValueChanged(): Promise<void>;
37
+ onValueChange(e: Event): void;
38
+ get tabContainer(): HTMLElement;
39
+ _onMappingChanged(e: CustomEvent): Promise<void>;
40
+ _onTabScroll(): void;
41
+ _onTabScrollNavLeft(): void;
42
+ _onTabScrollNavRight(): void;
43
+ }
44
+ export {};