@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,147 @@
1
+ /**
2
+ * @license Copyright © HatioLab Inc. All rights reserved.
3
+ */
4
+ import { __decorate } from "tslib";
5
+ import '@operato/input/ox-input-angle.js';
6
+ import '@operato/i18n/ox-i18n.js';
7
+ import { css, html, LitElement } from 'lit';
8
+ import { property } from 'lit/decorators.js';
9
+ import { PropertyGridStyles } from '@operato/styles/property-grid-styles.js';
10
+ import { convert } from './value-converter.js';
11
+ /**
12
+ * 컴포넌트의 animation 속성을 편집하는 element
13
+
14
+ Example:
15
+
16
+ <property-animation .value=${animation}>
17
+ </property-animation>
18
+ */
19
+ export class PropertyAnimation extends LitElement {
20
+ firstUpdated() {
21
+ this.renderRoot.addEventListener('change', this.onValueChange.bind(this));
22
+ }
23
+ render() {
24
+ var _a;
25
+ const value = this.value || {};
26
+ return html `
27
+ <div class="property-grid">
28
+ <label>Animation Type</label>
29
+ <select value-key="type" .value=${value.type}>
30
+ <option value="">None</option>
31
+ <option value="rotation">Rotation</option>
32
+ <option value="vibration">Vibration</option>
33
+ <option value="heartbeat">Heartbeat</option>
34
+ <option value="moving">Moving</option>
35
+ <option value="fade">Fade</option>
36
+ <option value="outline">Outline</option>
37
+ </select>
38
+
39
+ <label> <ox-i18n msgid="label.waiting-time">waiting time</ox-i18n> </label>
40
+ <input type="number" value-key="delay" .value=${value.delay} placeholder="ms" />
41
+
42
+ <label> <ox-i18n msgid="label.duration">duration</ox-i18n> </label>
43
+ <input type="number" value-key="duration" .value=${value.duration} placeholder="ms" />
44
+
45
+ <label> <ox-i18n msgid="label.animation-interval">interval</ox-i18n> </label>
46
+ <input type="number" value-key="interval" .value=${value.interval} placeholder="ms" />
47
+
48
+ ${value.type == 'rotation' || value.type == 'vibration'
49
+ ? html `
50
+ <label> <ox-i18n msgid="label.theta">theta</ox-i18n> </label>
51
+ <ox-input-angle value-key="theta" .value=${value.theta}> </ox-input-angle>
52
+ `
53
+ : html ``}
54
+ ${value.type == 'heartbeat'
55
+ ? html `
56
+ <label> <ox-i18n msgid="label.scale">scale</ox-i18n> </label>
57
+ <input type="number" value-key="scale" .value=${value.scale} />
58
+ `
59
+ : html ``}
60
+ ${value.type == 'moving'
61
+ ? html `
62
+ <label> <ox-i18n msgid="label.x-axes">X-axes</ox-i18n> </label>
63
+ <input type="number" value-key="x" .value=${value.x} />
64
+
65
+ <label> <ox-i18n msgid="label.y-axes">Y-axes</ox-i18n> </label>
66
+ <input type="number" value-key="y" .value=${value.y} />
67
+ `
68
+ : html ``}
69
+ ${value.type == 'fade'
70
+ ? html `
71
+ <label> <ox-i18n msgid="label.start-alpha">start alpha</ox-i18n> </label>
72
+ <input type="number" value-key="startAlpha" .value=${value.startAlpha} />
73
+
74
+ <label> <ox-i18n msgid="label.end-alpha">end alpha</ox-i18n> </label>
75
+ <input type="number" value-key="endAlpha" .value=${value.endAlpha} />
76
+ `
77
+ : html ``}
78
+ ${value.type == 'outline'
79
+ ? html `
80
+ <label> <ox-i18n msgid="label.target">target</ox-i18n> </label>
81
+ <input value-key="rideOn" .value=${value.rideOn || ''} list="target-list" />
82
+ <datalist id="target-list">
83
+ ${this.scene.ids.map(info => info.key).map(id => html ` <option value=${id}></option> `)}
84
+ </datalist>
85
+ `
86
+ : html ``}
87
+
88
+ <input id="checkbox-repeat" value-key="repeat" type="checkbox" .checked=${value.repeat} />
89
+ <label for="checkbox-repeat" class="checkbox-label"> <ox-i18n msgid="label.repeat">repeat</ox-i18n> </label>
90
+
91
+ <input
92
+ id="checkbox-autoplay"
93
+ value-key="autoplay"
94
+ type="checkbox"
95
+ .checked=${value.autoplay || ((_a = value.autoplay) !== null && _a !== void 0 ? _a : true)}
96
+ />
97
+ <label for="checkbox-autoplay" class="checkbox-label">
98
+ <ox-i18n msgid="label.autoplay">autoplay</ox-i18n>
99
+ </label>
100
+
101
+ <label>delta</label>
102
+ <select value-key="delta" .value=${value.delta}>
103
+ <option value="linear">linear</option>
104
+ <option value="quad">quad</option>
105
+ <option value="circ">circ</option>
106
+ <option value="back">back</option>
107
+ <option value="bounce">bounce</option>
108
+ <option value="elastic">elastic</option>
109
+ </select>
110
+
111
+ <label>ease</label>
112
+ <select value-key="ease" .value=${value.ease}>
113
+ <option value="in">in</option>
114
+ <option value="out">out</option>
115
+ <option value="inout">inout</option>
116
+ </select>
117
+ </div>
118
+ `;
119
+ }
120
+ onValueChange(e) {
121
+ var element = e.target;
122
+ var key = element.getAttribute('value-key');
123
+ if (!key) {
124
+ return;
125
+ }
126
+ this.value = {
127
+ ...this.value,
128
+ [key]: convert(element)
129
+ };
130
+ this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
131
+ }
132
+ }
133
+ PropertyAnimation.styles = [
134
+ PropertyGridStyles,
135
+ css `
136
+ :host {
137
+ display: flex;
138
+ }
139
+ `
140
+ ];
141
+ __decorate([
142
+ property({ type: Object })
143
+ ], PropertyAnimation.prototype, "value", void 0);
144
+ __decorate([
145
+ property({ type: Object })
146
+ ], PropertyAnimation.prototype, "scene", void 0);
147
+ //# sourceMappingURL=property-animation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property-animation.js","sourceRoot":"","sources":["../../../../src/property-panel/effects/property-animation.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,kCAAkC,CAAA;AACzC,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG5C,OAAO,EAAE,kBAAkB,EAAE,MA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js'\n\nimport { css, html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\nimport { Properties, Scene } from '@hatiolab/things-scene'\nimport { PropertyGridStyles } from '@operato/styles/property-grid-styles.js'\n\nimport { convert } from './value-converter.js'\n\n/**\n * 컴포넌트의 animation 속성을 편집하는 element\n\nExample:\n\n <property-animation .value=${animation}>\n </property-animation>\n*/\n\nexport class PropertyAnimation extends LitElement {\n static styles = [\n PropertyGridStyles,\n css`\n :host {\n display: flex;\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 render() {\n const value = this.value || {}\n\n return html`\n <div class=\"property-grid\">\n <label>Animation Type</label>\n <select value-key=\"type\" .value=${value.type}>\n <option value=\"\">None</option>\n <option value=\"rotation\">Rotation</option>\n <option value=\"vibration\">Vibration</option>\n <option value=\"heartbeat\">Heartbeat</option>\n <option value=\"moving\">Moving</option>\n <option value=\"fade\">Fade</option>\n <option value=\"outline\">Outline</option>\n </select>\n\n <label> <ox-i18n msgid=\"label.waiting-time\">waiting time</ox-i18n> </label>\n <input type=\"number\" value-key=\"delay\" .value=${value.delay} placeholder=\"ms\" />\n\n <label> <ox-i18n msgid=\"label.duration\">duration</ox-i18n> </label>\n <input type=\"number\" value-key=\"duration\" .value=${value.duration} placeholder=\"ms\" />\n\n <label> <ox-i18n msgid=\"label.animation-interval\">interval</ox-i18n> </label>\n <input type=\"number\" value-key=\"interval\" .value=${value.interval} placeholder=\"ms\" />\n\n ${value.type == 'rotation' || value.type == 'vibration'\n ? html`\n <label> <ox-i18n msgid=\"label.theta\">theta</ox-i18n> </label>\n <ox-input-angle value-key=\"theta\" .value=${value.theta}> </ox-input-angle>\n `\n : html``}\n ${value.type == 'heartbeat'\n ? html`\n <label> <ox-i18n msgid=\"label.scale\">scale</ox-i18n> </label>\n <input type=\"number\" value-key=\"scale\" .value=${value.scale} />\n `\n : html``}\n ${value.type == 'moving'\n ? html`\n <label> <ox-i18n msgid=\"label.x-axes\">X-axes</ox-i18n> </label>\n <input type=\"number\" value-key=\"x\" .value=${value.x} />\n\n <label> <ox-i18n msgid=\"label.y-axes\">Y-axes</ox-i18n> </label>\n <input type=\"number\" value-key=\"y\" .value=${value.y} />\n `\n : html``}\n ${value.type == 'fade'\n ? html`\n <label> <ox-i18n msgid=\"label.start-alpha\">start alpha</ox-i18n> </label>\n <input type=\"number\" value-key=\"startAlpha\" .value=${value.startAlpha} />\n\n <label> <ox-i18n msgid=\"label.end-alpha\">end alpha</ox-i18n> </label>\n <input type=\"number\" value-key=\"endAlpha\" .value=${value.endAlpha} />\n `\n : html``}\n ${value.type == 'outline'\n ? html`\n <label> <ox-i18n msgid=\"label.target\">target</ox-i18n> </label>\n <input value-key=\"rideOn\" .value=${value.rideOn || ''} list=\"target-list\" />\n <datalist id=\"target-list\">\n ${this.scene!.ids.map(info => info.key).map(id => html` <option value=${id}></option> `)}\n </datalist>\n `\n : html``}\n\n <input id=\"checkbox-repeat\" value-key=\"repeat\" type=\"checkbox\" .checked=${value.repeat} />\n <label for=\"checkbox-repeat\" class=\"checkbox-label\"> <ox-i18n msgid=\"label.repeat\">repeat</ox-i18n> </label>\n\n <input\n id=\"checkbox-autoplay\"\n value-key=\"autoplay\"\n type=\"checkbox\"\n .checked=${value.autoplay || (value.autoplay ?? true)}\n />\n <label for=\"checkbox-autoplay\" class=\"checkbox-label\">\n <ox-i18n msgid=\"label.autoplay\">autoplay</ox-i18n>\n </label>\n\n <label>delta</label>\n <select value-key=\"delta\" .value=${value.delta}>\n <option value=\"linear\">linear</option>\n <option value=\"quad\">quad</option>\n <option value=\"circ\">circ</option>\n <option value=\"back\">back</option>\n <option value=\"bounce\">bounce</option>\n <option value=\"elastic\">elastic</option>\n </select>\n\n <label>ease</label>\n <select value-key=\"ease\" .value=${value.ease}>\n <option value=\"in\">in</option>\n <option value=\"out\">out</option>\n <option value=\"inout\">inout</option>\n </select>\n </div>\n `\n }\n\n onValueChange(e: Event) {\n var element = e.target as HTMLElement\n var key = element.getAttribute('value-key')\n\n if (!key) {\n return\n }\n\n this.value = {\n ...this.value,\n [key]: convert(element)\n }\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n}\n"]}
@@ -0,0 +1,22 @@
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 { LitElement } from 'lit';
7
+ import { Properties, Scene } from '@hatiolab/things-scene';
8
+ import { PropertyAnimation } from './property-animation.js';
9
+ declare const PropertyAnimations_base: typeof LitElement & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types.js").ScopedElementsHost>;
10
+ export declare class PropertyAnimations extends PropertyAnimations_base {
11
+ static styles: import("lit").CSSResult[];
12
+ value?: Properties;
13
+ scene: Scene;
14
+ _expanded: boolean;
15
+ firstUpdated(): void;
16
+ static get scopedElements(): {
17
+ 'property-animation': typeof PropertyAnimation;
18
+ };
19
+ render(): import("lit-html").TemplateResult<1>;
20
+ onValueChange(e: Event): void;
21
+ }
22
+ export {};
@@ -0,0 +1,70 @@
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 { html, LitElement } from 'lit';
8
+ import { property, state } from 'lit/decorators.js';
9
+ import { ScopedElementsMixin } from '@open-wc/scoped-elements';
10
+ import { PropertyGridStyles } from '@operato/styles/property-grid-styles.js';
11
+ import { PropertyAnimation } from './property-animation.js';
12
+ import { convert } from './value-converter.js';
13
+ export class PropertyAnimations extends ScopedElementsMixin(LitElement) {
14
+ constructor() {
15
+ super(...arguments);
16
+ this._expanded = false;
17
+ }
18
+ firstUpdated() {
19
+ this.renderRoot.addEventListener('change', this.onValueChange.bind(this));
20
+ }
21
+ static get scopedElements() {
22
+ return {
23
+ 'property-animation': PropertyAnimation
24
+ };
25
+ }
26
+ render() {
27
+ const value = this.value || {};
28
+ return html `
29
+ <fieldset collapsable ?collapsed=${!this._expanded}>
30
+ <legend>
31
+ <ox-title-with-help topic="board-modeller/effects/animation" msgid="label.animation"
32
+ >animation</ox-title-with-help
33
+ >
34
+ <md-icon
35
+ @click=${() => {
36
+ this._expanded = !this._expanded;
37
+ }}
38
+ >${this._expanded ? 'expand_less' : 'expand_more'}</md-icon
39
+ >
40
+ </legend>
41
+
42
+ <property-animation value-key="oncreate" .scene=${this.scene} .value=${value.oncreate || {}}>
43
+ </property-animation>
44
+ </fieldset>
45
+ `;
46
+ }
47
+ onValueChange(e) {
48
+ var element = e.target;
49
+ var key = element.getAttribute('value-key');
50
+ if (!key) {
51
+ return;
52
+ }
53
+ this.value = {
54
+ ...this.value,
55
+ [key]: convert(element)
56
+ };
57
+ this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
58
+ }
59
+ }
60
+ PropertyAnimations.styles = [PropertyGridStyles];
61
+ __decorate([
62
+ property({ type: Object })
63
+ ], PropertyAnimations.prototype, "value", void 0);
64
+ __decorate([
65
+ property({ type: Object })
66
+ ], PropertyAnimations.prototype, "scene", void 0);
67
+ __decorate([
68
+ state()
69
+ ], PropertyAnimations.prototype, "_expanded", void 0);
70
+ //# sourceMappingURL=property-animations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property-animations.js","sourceRoot":"","sources":["../../../../src/property-panel/effects/property-animations.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,4BAA4B,CAAA;AACnC,OAAO,qCAAqC,CAAA;AAE5C,OAAO,EAAO,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAG9D,OAAO,EAAE,k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AW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAClF,CAAC;;AAtDM,yBAAM,GAAG,CAAC,kBAAkB,CAAC,AAAvB,CAAuB;AAER;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAmB;AAClB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAc;AAEhC;IAAR,KAAK,EAAE;qDAA2B","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'\n\nimport { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\n\nimport { Properties, Scene } from '@hatiolab/things-scene'\nimport { PropertyGridStyles } from '@operato/styles/property-grid-styles.js'\n\nimport { PropertyAnimation } from './property-animation.js'\nimport { convert } from './value-converter.js'\n\nexport class PropertyAnimations extends ScopedElementsMixin(LitElement) {\n static styles = [PropertyGridStyles]\n\n @property({ type: Object }) value?: Properties\n @property({ type: Object }) scene!: Scene\n\n @state() _expanded: boolean = false\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', this.onValueChange.bind(this))\n }\n\n static get scopedElements() {\n return {\n 'property-animation': PropertyAnimation\n }\n }\n\n render() {\n const value = this.value || {}\n\n return html`\n <fieldset collapsable ?collapsed=${!this._expanded}>\n <legend>\n <ox-title-with-help topic=\"board-modeller/effects/animation\" msgid=\"label.animation\"\n >animation</ox-title-with-help\n >\n <md-icon\n @click=${() => {\n this._expanded = !this._expanded\n }}\n >${this._expanded ? 'expand_less' : 'expand_more'}</md-icon\n >\n </legend>\n\n <property-animation value-key=\"oncreate\" .scene=${this.scene} .value=${value.oncreate || {}}>\n </property-animation>\n </fieldset>\n `\n }\n\n onValueChange(e: Event) {\n var element = e.target as HTMLElement\n var key = element.getAttribute('value-key')\n\n if (!key) {\n return\n }\n\n this.value = {\n ...this.value,\n [key]: convert(element)\n }\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n}\n"]}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @license Copyright © HatioLab Inc. All rights reserved.
3
+ */
4
+ import '@operato/input/ox-input-data.js';
5
+ import '@operato/i18n/ox-i18n.js';
6
+ import { LitElement } from 'lit';
7
+ import { Properties, Scene } from '@hatiolab/things-scene';
8
+ export declare class PropertyEventHover extends LitElement {
9
+ static styles: import("lit").CSSResult[];
10
+ value?: Properties;
11
+ scene?: Scene;
12
+ firstUpdated(): void;
13
+ render(): import("lit-html").TemplateResult<1>;
14
+ _getPlaceHoder(action: string): "" | "SCENE-100" | "http://www.hatiolab.com/";
15
+ _getTargetList(action: string): {
16
+ value: string;
17
+ description?: string;
18
+ class?: string;
19
+ }[];
20
+ onValueChange(e: Event): void;
21
+ }
@@ -0,0 +1,193 @@
1
+ /**
2
+ * @license Copyright © HatioLab Inc. All rights reserved.
3
+ */
4
+ import { __decorate } from "tslib";
5
+ import '@operato/input/ox-input-data.js';
6
+ import '@operato/i18n/ox-i18n.js';
7
+ import { css, html, LitElement } from 'lit';
8
+ import { property } from 'lit/decorators.js';
9
+ import { ifDefined } from 'lit/directives/if-defined.js';
10
+ import { PropertyGridStyles } from '@operato/styles/property-grid-styles.js';
11
+ import { convert } from './value-converter.js';
12
+ const SETS_ACTION = ['data-set', 'partial-data-set', 'value-set', 'partial-value-set'];
13
+ export class PropertyEventHover extends LitElement {
14
+ firstUpdated() {
15
+ this.renderRoot.addEventListener('change', this.onValueChange.bind(this));
16
+ }
17
+ render() {
18
+ var { action, value = '', target = '', emphasize, restore } = this.value || {};
19
+ return html `
20
+ <div class="property-grid">
21
+ <input id="checkbox-emphasize" type="checkbox" value-key="emphasize" .checked=${emphasize} />
22
+ <label for="checkbox-emphasize" class="checkbox-label">
23
+ <ox-i18n msgid="label.emphasize">emphasize</ox-i18n>
24
+ </label>
25
+
26
+ <label> <ox-i18n msgid="label.action">action</ox-i18n> </label>
27
+ <select id="tap-select" value-key="action" .value=${action || ''}>
28
+ <option value=""></option>
29
+ <option value="popup">popup target board</option>
30
+ <option value="info-window">open infowindow</option>
31
+ <option value="data-toggle">toggle(true/false) target component data</option>
32
+ <option value="data-tristate">tristate(0/1/2) target component data</option>
33
+ <option value="data-set">set value to target component data</option>
34
+ <option value="value-set">set value to target component value</option>
35
+ <option value="mouse-cursor">change mouse cursor to target style</option>
36
+ </select>
37
+
38
+ <label> <ox-i18n msgid="label.target">target</ox-i18n> </label>
39
+
40
+ ${action == 'popup'
41
+ ? html `
42
+ <ox-editor-board-selector
43
+ class="custom-editor"
44
+ value-key="target"
45
+ .value=${target}
46
+ ></ox-editor-board-selector>
47
+ `
48
+ : html `
49
+ <input
50
+ value-key="target"
51
+ .value=${target || ''}
52
+ list="target-list"
53
+ .placeholder="${this._getPlaceHoder(action)}"
54
+ />
55
+
56
+ <datalist id="target-list">
57
+ ${this._getTargetList(action).map(({ value, description, class: clazz }) => html `
58
+ <option .value=${value} class=${ifDefined(clazz)}>${description}</option>
59
+ `)}
60
+ </datalist>
61
+ `}
62
+ ${SETS_ACTION.indexOf(action) != -1
63
+ ? html `
64
+ <label> <ox-i18n msgid="label.value">value</ox-i18n> </label>
65
+ <ox-input-data
66
+ class="custom-editor property-full-bleed"
67
+ value-key="value"
68
+ .value=${value}
69
+ fullwidth
70
+ ></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
+ <ox-i18n msgid="label.restore-on-leave">restore on leave</ox-i18n>
77
+ </label>
78
+ </div>
79
+ `;
80
+ }
81
+ _getPlaceHoder(action) {
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
+ _getTargetList(action) {
94
+ switch (action) {
95
+ case 'data-toggle':
96
+ case 'data-tristate':
97
+ case 'data-set':
98
+ case 'value-set':
99
+ case 'partial-data-set':
100
+ case 'partial-value-set':
101
+ let ids = (this.scene &&
102
+ this.scene.ids.map(i => {
103
+ var _a;
104
+ const id = i.key;
105
+ return { value: `#${id}`, description: (_a = this.scene.findById(id)) === null || _a === void 0 ? void 0 : _a.get('type') };
106
+ })) ||
107
+ [];
108
+ ids.unshift({ value: '(self)', description: 'self component' });
109
+ return ids;
110
+ case 'info-window':
111
+ return ((this.scene &&
112
+ this.scene.ids
113
+ .filter(i => {
114
+ return this.scene.findById(i.key).get('type') == 'info-window';
115
+ })
116
+ .map(i => {
117
+ var _a;
118
+ const id = i.key;
119
+ return { value: `#${id}`, description: (_a = this.scene.findById(id)) === null || _a === void 0 ? void 0 : _a.get('type') };
120
+ })) ||
121
+ []);
122
+ case 'mouse-cursor':
123
+ return ['auto', 'pointer', 'default', 'move', 'text', 'wait', 'help', 'crosshair', 'not-allowed', 'grab'].map(style => {
124
+ return { value: style, class: `cursor-${style}` };
125
+ });
126
+ default:
127
+ return [];
128
+ }
129
+ }
130
+ onValueChange(e) {
131
+ var element = e.target;
132
+ var key = element.getAttribute('value-key');
133
+ if (!key) {
134
+ return;
135
+ }
136
+ this.value = {
137
+ ...this.value,
138
+ [key]: convert(element)
139
+ };
140
+ this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
141
+ }
142
+ }
143
+ PropertyEventHover.styles = [
144
+ PropertyGridStyles,
145
+ css `
146
+ datalist option.cursor-auto {
147
+ cursor: auto;
148
+ }
149
+
150
+ datalist option.cursor-pointer {
151
+ cursor: pointer;
152
+ }
153
+
154
+ datalist option.cursor-default {
155
+ cursor: default;
156
+ }
157
+
158
+ datalist option.cursor-move {
159
+ cursor: move;
160
+ }
161
+
162
+ datalist option.cursor-text {
163
+ cursor: text;
164
+ }
165
+
166
+ datalist option.cursor-wait {
167
+ cursor: wait;
168
+ }
169
+
170
+ datalist option.cursor-help {
171
+ cursor: help;
172
+ }
173
+
174
+ datalist option.cursor-crosshair {
175
+ cursor: crosshair;
176
+ }
177
+
178
+ datalist option.cursor-not-allowed {
179
+ cursor: not-allowed;
180
+ }
181
+
182
+ datalist option.cursor-grab {
183
+ cursor: grab;
184
+ }
185
+ `
186
+ ];
187
+ __decorate([
188
+ property({ type: Object })
189
+ ], PropertyEventHover.prototype, "value", void 0);
190
+ __decorate([
191
+ property({ type: Object })
192
+ ], PropertyEventHover.prototype, "scene", void 0);
193
+ //# sourceMappingURL=property-event-hover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property-event-hover.js","sourceRoot":"","sources":["../../../../src/property-panel/effects/property-event-hover.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,iCAAiC,CAAA;AACxC,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAGxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAE5E,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAE9C,MAAM,WAAW,GAAG,CAAC,UAAU,EAAE,kBAAkB,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAA;AAEtF,MAAM,OAAO,kBAAmB,SAAQ,UAAU;IAiDhD,YAAY;QACV,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IAC3E,CAAC;IAED,MAAM;QACJ,IAAI,EAAE,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,GAAG,EAA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C3G,KAAK,CAAC,EAAE;oBACN,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,KAAK,EAAE,EAAE,CAAA;gBACnD,CAAC,CACF,CAAA;YAEH;gBACE,OAAO,EAAE,CAAA;QACb,CAAC;IACH,CAAC;IAED,aAAa,CAAC,CAAQ;QACpB,IAAI,OAAO,GAAG,CAAC,CAAC,MAAqB,CAAA;QACrC,IAAI,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAA;QAE3C,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAM;QACR,CAAC;QAED,IAAI,CAAC,KAAK,GAAG;YACX,GAAG,IAAI,CAAC,KAAK;YACb,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC;SACxB,CAAA;QAED,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAClF,CAAC;;AA/LM,yBAAM,GAAG;IACd,kBAAkB;IAClB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwCF;CACF,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAmB;AAClB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAc","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@operato/input/ox-input-data.js'\nimport '@operato/i18n/ox-i18n.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\n\nimport { Properties, Scene } from '@hatiolab/things-scene'\nimport { PropertyGridStyles } from '@operato/styles/property-grid-styles.js'\n\nimport { convert } from './value-converter.js'\n\nconst SETS_ACTION = ['data-set', 'partial-data-set', 'value-set', 'partial-value-set']\n\nexport class PropertyEventHover extends LitElement {\n static styles = [\n PropertyGridStyles,\n css`\n datalist option.cursor-auto {\n cursor: auto;\n }\n\n datalist option.cursor-pointer {\n cursor: pointer;\n }\n\n datalist option.cursor-default {\n cursor: default;\n }\n\n datalist option.cursor-move {\n cursor: move;\n }\n\n datalist option.cursor-text {\n cursor: text;\n }\n\n datalist option.cursor-wait {\n cursor: wait;\n }\n\n datalist option.cursor-help {\n cursor: help;\n }\n\n datalist option.cursor-crosshair {\n cursor: crosshair;\n }\n\n datalist option.cursor-not-allowed {\n cursor: not-allowed;\n }\n\n datalist option.cursor-grab {\n cursor: grab;\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 render() {\n var { action, value = '', target = '', emphasize, restore } = this.value || {}\n\n return html`\n <div class=\"property-grid\">\n <input id=\"checkbox-emphasize\" type=\"checkbox\" value-key=\"emphasize\" .checked=${emphasize} />\n <label for=\"checkbox-emphasize\" class=\"checkbox-label\">\n <ox-i18n msgid=\"label.emphasize\">emphasize</ox-i18n>\n </label>\n\n <label> <ox-i18n msgid=\"label.action\">action</ox-i18n> </label>\n <select id=\"tap-select\" value-key=\"action\" .value=${action || ''}>\n <option value=\"\"></option>\n <option value=\"popup\">popup target board</option>\n <option value=\"info-window\">open infowindow</option>\n <option value=\"data-toggle\">toggle(true/false) target component data</option>\n <option value=\"data-tristate\">tristate(0/1/2) target component data</option>\n <option value=\"data-set\">set value to target component data</option>\n <option value=\"value-set\">set value to target component value</option>\n <option value=\"mouse-cursor\">change mouse cursor to target style</option>\n </select>\n\n <label> <ox-i18n msgid=\"label.target\">target</ox-i18n> </label>\n\n ${action == 'popup'\n ? html`\n <ox-editor-board-selector\n class=\"custom-editor\"\n value-key=\"target\"\n .value=${target}\n ></ox-editor-board-selector>\n `\n : html`\n <input\n value-key=\"target\"\n .value=${target || ''}\n list=\"target-list\"\n .placeholder=\"${this._getPlaceHoder(action)}\"\n />\n\n <datalist id=\"target-list\">\n ${this._getTargetList(action).map(\n ({ value, description, class: clazz }) => html`\n <option .value=${value} class=${ifDefined(clazz)}>${description}</option>\n `\n )}\n </datalist>\n `}\n ${SETS_ACTION.indexOf(action) != -1\n ? html`\n <label> <ox-i18n msgid=\"label.value\">value</ox-i18n> </label>\n <ox-input-data\n class=\"custom-editor property-full-bleed\"\n value-key=\"value\"\n .value=${value}\n fullwidth\n ></ox-input-data>\n `\n : html``}\n\n <input id=\"checkbox-restore\" type=\"checkbox\" value-key=\"restore\" .checked=${restore} />\n <label for=\"checkbox-restore\" class=\"checkbox-label\">\n <ox-i18n msgid=\"label.restore-on-leave\">restore on leave</ox-i18n>\n </label>\n </div>\n `\n }\n\n _getPlaceHoder(action: string) {\n switch (action) {\n case 'popup':\n case 'goto':\n return 'SCENE-100'\n case 'link-open':\n case 'link-move':\n return 'http://www.hatiolab.com/'\n default:\n return ''\n }\n }\n\n _getTargetList(action: string): { value: string; description?: string; class?: string }[] {\n switch (action) {\n case 'data-toggle':\n case 'data-tristate':\n case 'data-set':\n case 'value-set':\n case 'partial-data-set':\n case 'partial-value-set':\n let ids =\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 ids.unshift({ value: '(self)', description: 'self component' })\n return ids\n\n case 'info-window':\n return (\n (this.scene &&\n this.scene.ids\n .filter(i => {\n return this.scene!.findById(i.key).get('type') == 'info-window'\n })\n .map(i => {\n const id = i.key\n return { value: `#${id}`, description: this.scene!.findById(id)?.get('type') }\n })) ||\n []\n )\n\n case 'mouse-cursor':\n return ['auto', 'pointer', 'default', 'move', 'text', 'wait', 'help', 'crosshair', 'not-allowed', 'grab'].map(\n style => {\n return { value: style, class: `cursor-${style}` }\n }\n )\n\n default:\n return []\n }\n }\n\n onValueChange(e: Event) {\n var element = e.target as HTMLElement\n var key = element.getAttribute('value-key')\n\n if (!key) {\n return\n }\n\n this.value = {\n ...this.value,\n [key]: convert(element)\n }\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n}\n"]}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @license Copyright © HatioLab Inc. All rights reserved.
3
+ */
4
+ import '@operato/input/ox-input-data.js';
5
+ import '@operato/i18n/ox-i18n.js';
6
+ import { LitElement } from 'lit';
7
+ import { Properties, Scene } from '@hatiolab/things-scene';
8
+ export declare class PropertyEventTap extends LitElement {
9
+ static styles: import("lit").CSSResult[];
10
+ value?: Properties;
11
+ scene?: Scene;
12
+ scenarios: {
13
+ value: string;
14
+ description: string;
15
+ }[];
16
+ playlists: {
17
+ value: string;
18
+ description: string;
19
+ }[];
20
+ targetList: {
21
+ value: string;
22
+ description: string;
23
+ }[];
24
+ firstUpdated(): Promise<void>;
25
+ render(): import("lit-html").TemplateResult<1>;
26
+ _getPlaceHoder(action: string): "" | "http://www.hatiolab.com/" | "abc.xlsx";
27
+ _getTargetList(action: string): {
28
+ value: string;
29
+ description: string;
30
+ }[];
31
+ _getInputList(action: string): {
32
+ value: string;
33
+ description: string;
34
+ }[];
35
+ onValueChange(e: Event): void;
36
+ }