@operato/scene-tab 1.1.5 → 1.1.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 (61) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/assets/favicon.ico +0 -0
  3. package/assets/images/spinner.png +0 -0
  4. package/demo/index.html +240 -204
  5. package/dist/index.d.ts +2 -0
  6. package/dist/index.js +2 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/tab-button.js +3 -1
  9. package/dist/tab-button.js.map +1 -1
  10. package/dist/tab-card.d.ts +10 -0
  11. package/dist/tab-card.js +65 -0
  12. package/dist/tab-card.js.map +1 -0
  13. package/dist/tab-container.d.ts +20 -0
  14. package/dist/tab-container.js +167 -0
  15. package/dist/tab-container.js.map +1 -0
  16. package/dist/tab.js +17 -13
  17. package/dist/tab.js.map +1 -1
  18. package/dist/templates/index.d.ts +16 -3
  19. package/dist/templates/index.js +3 -2
  20. package/dist/templates/index.js.map +1 -1
  21. package/dist/templates/tab-container.d.ts +16 -0
  22. package/dist/templates/tab-container.js +17 -0
  23. package/dist/templates/tab-container.js.map +1 -0
  24. package/dist/templates/tab.d.ts +0 -1
  25. package/dist/templates/tab.js +2 -3
  26. package/dist/templates/tab.js.map +1 -1
  27. package/helps/scene/component/tab-container.ko.md +58 -0
  28. package/helps/scene/component/tab-container.md +57 -0
  29. package/helps/scene/component/tab-container.zh.md +59 -0
  30. package/helps/scene/images/button-evnet-mapping-01.png +0 -0
  31. package/helps/scene/images/button-evnet-mapping-02.png +0 -0
  32. package/helps/scene/images/button-evnet-mapping-03.png +0 -0
  33. package/helps/scene/images/tab-button-finish-01.gif +0 -0
  34. package/helps/scene/images/tab-container-03.png +0 -0
  35. package/helps/scene/images/tab-container-create-01.png +0 -0
  36. package/helps/scene/images/tab-container-create-02.png +0 -0
  37. package/helps/scene/images/tab-container-create-03.png +0 -0
  38. package/helps/scene/images/tab-container-setting-01.png +0 -0
  39. package/icons/tab-container.png +0 -0
  40. package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +20 -0
  41. package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +20 -0
  42. package/logs/application-2022-11-13-11.log +14 -0
  43. package/logs/application-2022-11-13-12.log +6 -0
  44. package/logs/connections-2022-11-13-11.log +70 -0
  45. package/logs/connections-2022-11-13-12.log +35 -0
  46. package/package.json +2 -2
  47. package/src/index.ts +3 -0
  48. package/src/tab-button.ts +3 -3
  49. package/src/tab-card.ts +76 -0
  50. package/src/tab-container.ts +204 -0
  51. package/src/tab.ts +18 -12
  52. package/src/templates/index.ts +3 -2
  53. package/src/templates/tab-container.ts +17 -0
  54. package/src/templates/tab.ts +2 -3
  55. package/things-scene.config.js +2 -2
  56. package/translations/en.json +4 -0
  57. package/translations/ko.json +4 -0
  58. package/translations/ms.json +4 -0
  59. package/translations/zh.json +4 -0
  60. package/tsconfig.tsbuildinfo +1 -1
  61. package/images/icon-button.png +0 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,24 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ### [1.1.14](https://github.com/things-scene/operato-scene/compare/v1.1.13...v1.1.14) (2022-11-13)
7
+
8
+
9
+ ### :bug: Bug Fix
10
+
11
+ * add tab-container and tab-card ([92f7b36](https://github.com/things-scene/operato-scene/commit/92f7b367e5821f54eeb5f324266cd7dad5db2ad2))
12
+
13
+
14
+
15
+ ### [1.1.8](https://github.com/things-scene/operato-scene/compare/v1.1.7...v1.1.8) (2022-11-05)
16
+
17
+
18
+ ### :bug: Bug Fix
19
+
20
+ * padding default value ([2d55f81](https://github.com/things-scene/operato-scene/commit/2d55f81efffbbb1687e11380abfe293328e1e88d))
21
+
22
+
23
+
6
24
  ### [1.1.5](https://github.com/things-scene/operato-scene/compare/v1.1.4...v1.1.5) (2022-11-05)
7
25
 
8
26
 
Binary file
Binary file
package/demo/index.html CHANGED
@@ -1,252 +1,288 @@
1
- <!doctype html>
1
+ <!DOCTYPE html>
2
2
  <!--
3
3
  @license
4
4
  Copyright © HatioLab Inc. All rights reserved.
5
5
  -->
6
6
  <html>
7
7
  <head>
8
- <meta charset="utf-8">
9
- <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
8
+ <meta charset="utf-8" />
9
+ <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes" />
10
10
  <title>things-scene-tab Demo</title>
11
11
  <script src="../../webcomponentsjs/webcomponents-lite.min.js"></script>
12
12
 
13
- <link rel="import" href="../../things-scene-viewer/things-scene-viewer.html">
14
- <link rel="import" href="../../things-scene-indoor-map/things-scene-indoor-map.html">
15
- <link rel="import" href="../../things-scene-modeler/things-scene-properties.html">
13
+ <link rel="import" href="../../things-scene-viewer/things-scene-viewer.html" />
14
+ <link rel="import" href="../../things-scene-indoor-map/things-scene-indoor-map.html" />
15
+ <link rel="import" href="../../things-scene-modeler/things-scene-properties.html" />
16
16
 
17
17
  <script src="../things-scene-tab.js"></script>
18
18
 
19
19
  <style is="custom-style">
20
+ @font-face {
21
+ font-family: 'Bitstream Vera Serif Bold';
22
+ src: url('fonts/VeraSeBd.ttf');
23
+ }
20
24
 
21
- @font-face {
22
- font-family: "Bitstream Vera Serif Bold";
23
- src: url("fonts/VeraSeBd.ttf");
24
- }
25
-
26
- things-scene-viewer {
27
- display: block;
28
- width: 100%;
29
- height: 560px;
30
- }
25
+ things-scene-viewer {
26
+ display: block;
27
+ width: 100%;
28
+ height: 560px;
29
+ }
31
30
  </style>
32
31
  </head>
33
32
  <body unresolved>
34
-
35
33
  <template is="dom-bind" id="app">
36
34
  <p>An example of <code>&lt;things-scene-tab&gt;</code>:</p>
37
35
 
38
- <things-scene-viewer id='scene'
39
- scene='{{scene}}'
40
- selected='{{selected}}'
41
- model='[[model]]'
42
- mode="1">
36
+ <things-scene-viewer id="scene" scene="{{scene}}" selected="{{selected}}" model="[[model]]" mode="1">
43
37
  <things-scene-layer type="selection-layer"></things-scene-layer>
44
38
  <things-scene-layer type="modeling-layer"></things-scene-layer>
45
39
  <things-scene-handler type="text-editor"></things-scene-handler>
46
40
  <things-scene-handler type="move-handler"></things-scene-handler>
47
41
  </things-scene-viewer>
48
42
 
49
- <things-scene-properties scene="[[scene]]"
50
- selected="[[selected]]"
51
- model="{{target}}"
52
- bounds="{{bounds}}">
43
+ <things-scene-properties scene="[[scene]]" selected="[[selected]]" model="{{target}}" bounds="{{bounds}}">
53
44
  <fieldset class="same-width">
54
45
  <legend>Stack style</legend>
55
46
 
56
- <label>Active Floor</label>
57
- <input type="number" value-as-number="{{target.layoutConfig.activeIndex::change}}" min="0" max="100" step="1" numberonly="true" />
47
+ <label>Active TabCard</label>
48
+ <input
49
+ type="number"
50
+ value-as-number="{{target.layoutConfig.activeIndex::change}}"
51
+ min="0"
52
+ max="100"
53
+ step="1"
54
+ numberonly="true"
55
+ />
58
56
 
59
57
  <label>reference</label>
60
58
  <input type="text" value="{{target.reference::change}}" />
61
-
62
59
  </fieldset>
63
60
  </things-scene-properties>
64
-
65
61
  </template>
66
62
 
67
63
  <script>
68
- window.addEventListener('WebComponentsReady', function(e) {
64
+ window.addEventListener('WebComponentsReady', function (e) {
69
65
  var app = document.querySelector('#app')
70
66
 
71
67
  app.model = {
72
68
  width: 500,
73
69
  height: 500,
74
- components: [{
75
- type: 'tab',
76
- reference: 'indoor-map',
77
- left: 100,
78
- top: 100,
79
- width: 100,
80
- height: 400,
81
- lineWidth: 10,
82
- // lineWidth: 0,
83
- fillStyle: 'navy',
84
- strokeStyle: 'red',
85
- activeFillStyle: 'red',
86
- fontColor: 'black',
87
- activeFontColor: 'white',
88
- activeIndex: 2
89
- }, {
90
- type: 'indoor-map',
91
- id: 'indoor-map',
92
- left: 250,
93
- top: 100,
94
- width: 600,
95
- height: 400,
96
- fontSize: 80,
97
- fontColor: '#000000',
98
- lineWidth: 10,
99
- strokeStyle: 'red',
100
- active: 0,
101
- components: [{
102
- type: 'floor',
103
- fillStyle: 'orange',
70
+ components: [
71
+ {
72
+ type: 'tab',
73
+ reference: 'indoor-map',
74
+ left: 100,
75
+ top: 100,
104
76
  width: 100,
105
- height: 100,
106
- text: 'first',
107
- components: [{
108
- type: 'rect',
109
- left: 100,
110
- top: 220,
111
- width: 100,
112
- height: 100,
113
- fillStyle: 'red',
114
- lineWidth: 4
115
- }, {
116
- type: 'ellipse',
117
- cx: 400,
118
- cy: 200,
119
- rx: 100,
120
- ry: 100,
121
- fillStyle: 'blue',
122
- lineWidth: 4
123
- }, {
124
- type: 'polygon',
125
- path: [{
126
- x: 100,
127
- y: 100
128
- }, {
129
- x: 200,
130
- y: 150
131
- }, {
132
- x: 150,
133
- y: 200
134
- }],
135
- fillStyle: 'blue',
136
- lineWidth: 4
137
- }]
138
- }, {
139
- type: 'floor',
77
+ height: 400,
78
+ lineWidth: 10,
79
+ // lineWidth: 0,
140
80
  fillStyle: 'navy',
141
- width: 100,
142
- height: 100,
143
- components: [{
144
- type: 'rect',
145
- left: 100,
146
- top: 220,
147
- width: 100,
148
- height: 100,
149
- fillStyle: 'red',
150
- lineWidth: 4
151
- }, {
152
- type: 'ellipse',
153
- cx: 400,
154
- cy: 200,
155
- rx: 100,
156
- ry: 100,
157
- fillStyle: 'blue',
158
- lineWidth: 4
159
- }, {
160
- type: 'polygon',
161
- path: [{
162
- x: 100,
163
- y: 100
164
- }, {
165
- x: 200,
166
- y: 150
167
- }, {
168
- x: 150,
169
- y: 200
170
- }],
171
- fillStyle: 'blue',
172
- lineWidth: 4
173
- }]
174
- }, {
175
- type: 'floor',
176
- fillStyle: 'black',
177
- width: 100,
178
- height: 100,
179
- components: [{
180
- type: 'rect',
181
- left: 100,
182
- top: 220,
183
- width: 100,
184
- height: 100,
185
- fillStyle: 'red',
186
- lineWidth: 4
187
- }, {
188
- type: 'ellipse',
189
- cx: 400,
190
- cy: 200,
191
- rx: 100,
192
- ry: 100,
193
- fillStyle: 'blue',
194
- lineWidth: 4
195
- }, {
196
- type: 'polygon',
197
- path: [{
198
- x: 100,
199
- y: 100
200
- }, {
201
- x: 200,
202
- y: 150
203
- }, {
204
- x: 150,
205
- y: 200
206
- }],
207
- fillStyle: 'blue',
208
- lineWidth: 4
209
- }]
210
- }, {
211
- type: 'floor',
212
- fillStyle: 'green',
213
- width: 100,
214
- height: 100,
215
- components: [{
216
- type: 'rect',
217
- left: 100,
218
- top: 220,
219
- width: 100,
220
- height: 100,
221
- fillStyle: 'red',
222
- lineWidth: 4
223
- }, {
224
- type: 'ellipse',
225
- cx: 400,
226
- cy: 200,
227
- rx: 100,
228
- ry: 100,
229
- fillStyle: 'blue',
230
- lineWidth: 4
231
- }, {
232
- type: 'polygon',
233
- path: [{
234
- x: 100,
235
- y: 100
236
- }, {
237
- x: 200,
238
- y: 150
239
- }, {
240
- x: 150,
241
- y: 200
242
- }],
243
- fillStyle: 'blue',
244
- lineWidth: 4
245
- }]
246
- }]
247
- }]
81
+ strokeStyle: 'red',
82
+ activeFillStyle: 'red',
83
+ fontColor: 'black',
84
+ activeFontColor: 'white',
85
+ activeIndex: 2
86
+ },
87
+ {
88
+ type: 'tab-container',
89
+ id: 'tab-container',
90
+ left: 250,
91
+ top: 100,
92
+ width: 600,
93
+ height: 400,
94
+ fontSize: 80,
95
+ fontColor: '#000000',
96
+ lineWidth: 10,
97
+ strokeStyle: 'red',
98
+ active: 0,
99
+ components: [
100
+ {
101
+ type: 'tab-card',
102
+ fillStyle: 'orange',
103
+ width: 100,
104
+ height: 100,
105
+ text: 'first',
106
+ components: [
107
+ {
108
+ type: 'rect',
109
+ left: 100,
110
+ top: 220,
111
+ width: 100,
112
+ height: 100,
113
+ fillStyle: 'red',
114
+ lineWidth: 4
115
+ },
116
+ {
117
+ type: 'ellipse',
118
+ cx: 400,
119
+ cy: 200,
120
+ rx: 100,
121
+ ry: 100,
122
+ fillStyle: 'blue',
123
+ lineWidth: 4
124
+ },
125
+ {
126
+ type: 'polygon',
127
+ path: [
128
+ {
129
+ x: 100,
130
+ y: 100
131
+ },
132
+ {
133
+ x: 200,
134
+ y: 150
135
+ },
136
+ {
137
+ x: 150,
138
+ y: 200
139
+ }
140
+ ],
141
+ fillStyle: 'blue',
142
+ lineWidth: 4
143
+ }
144
+ ]
145
+ },
146
+ {
147
+ type: 'tab-card',
148
+ fillStyle: 'navy',
149
+ width: 100,
150
+ height: 100,
151
+ components: [
152
+ {
153
+ type: 'rect',
154
+ left: 100,
155
+ top: 220,
156
+ width: 100,
157
+ height: 100,
158
+ fillStyle: 'red',
159
+ lineWidth: 4
160
+ },
161
+ {
162
+ type: 'ellipse',
163
+ cx: 400,
164
+ cy: 200,
165
+ rx: 100,
166
+ ry: 100,
167
+ fillStyle: 'blue',
168
+ lineWidth: 4
169
+ },
170
+ {
171
+ type: 'polygon',
172
+ path: [
173
+ {
174
+ x: 100,
175
+ y: 100
176
+ },
177
+ {
178
+ x: 200,
179
+ y: 150
180
+ },
181
+ {
182
+ x: 150,
183
+ y: 200
184
+ }
185
+ ],
186
+ fillStyle: 'blue',
187
+ lineWidth: 4
188
+ }
189
+ ]
190
+ },
191
+ {
192
+ type: 'tab-card',
193
+ fillStyle: 'black',
194
+ width: 100,
195
+ height: 100,
196
+ components: [
197
+ {
198
+ type: 'rect',
199
+ left: 100,
200
+ top: 220,
201
+ width: 100,
202
+ height: 100,
203
+ fillStyle: 'red',
204
+ lineWidth: 4
205
+ },
206
+ {
207
+ type: 'ellipse',
208
+ cx: 400,
209
+ cy: 200,
210
+ rx: 100,
211
+ ry: 100,
212
+ fillStyle: 'blue',
213
+ lineWidth: 4
214
+ },
215
+ {
216
+ type: 'polygon',
217
+ path: [
218
+ {
219
+ x: 100,
220
+ y: 100
221
+ },
222
+ {
223
+ x: 200,
224
+ y: 150
225
+ },
226
+ {
227
+ x: 150,
228
+ y: 200
229
+ }
230
+ ],
231
+ fillStyle: 'blue',
232
+ lineWidth: 4
233
+ }
234
+ ]
235
+ },
236
+ {
237
+ type: 'tab-card',
238
+ fillStyle: 'green',
239
+ width: 100,
240
+ height: 100,
241
+ components: [
242
+ {
243
+ type: 'rect',
244
+ left: 100,
245
+ top: 220,
246
+ width: 100,
247
+ height: 100,
248
+ fillStyle: 'red',
249
+ lineWidth: 4
250
+ },
251
+ {
252
+ type: 'ellipse',
253
+ cx: 400,
254
+ cy: 200,
255
+ rx: 100,
256
+ ry: 100,
257
+ fillStyle: 'blue',
258
+ lineWidth: 4
259
+ },
260
+ {
261
+ type: 'polygon',
262
+ path: [
263
+ {
264
+ x: 100,
265
+ y: 100
266
+ },
267
+ {
268
+ x: 200,
269
+ y: 150
270
+ },
271
+ {
272
+ x: 150,
273
+ y: 200
274
+ }
275
+ ],
276
+ fillStyle: 'blue',
277
+ lineWidth: 4
278
+ }
279
+ ]
280
+ }
281
+ ]
282
+ }
283
+ ]
248
284
  }
249
- });
285
+ })
250
286
  </script>
251
287
  </body>
252
288
  </html>
package/dist/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
+ export { default as TabCard } from './tab-card';
2
+ export { default as TabContainer } from './tab-container';
1
3
  export { default as Tab } from './tab';
2
4
  export { default as TabButton } from './tab-button';
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Copyright © HatioLab Inc. All rights reserved.
3
3
  */
4
+ export { default as TabCard } from './tab-card';
5
+ export { default as TabContainer } from './tab-container';
4
6
  export { default as Tab } from './tab';
5
7
  export { default as TabButton } from './tab-button';
6
8
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,cAAc,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\nexport { default as Tab } from './tab'\nexport { default as TabButton } from './tab-button'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,cAAc,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nexport { default as TabCard } from './tab-card'\nexport { default as TabContainer } from './tab-container'\nexport { default as Tab } from './tab'\nexport { default as TabButton } from './tab-button'\n"]}
@@ -14,7 +14,7 @@ export default class TabButton extends RectPath(Component) {
14
14
  }
15
15
  prerender(context) {
16
16
  super.prerender(context);
17
- let { fillStyle, activeFillStyle, activeLineColor, activeLineWidth, fontColor, activeFontColor } = this.model;
17
+ let { fillStyle, activeFillStyle, activeLineColor, activeLineWidth, fontColor, activeFontColor } = this.state;
18
18
  // backup style
19
19
  if (!this.hasOwnProperty('_fillStyle')) {
20
20
  this._fillStyle = fillStyle;
@@ -56,6 +56,7 @@ export default class TabButton extends RectPath(Component) {
56
56
  delete this._lineWidth;
57
57
  }
58
58
  onclick(e) {
59
+ ;
59
60
  this.parent.activeIndex = this.index;
60
61
  this.parent.invalidate();
61
62
  }
@@ -69,6 +70,7 @@ export default class TabButton extends RectPath(Component) {
69
70
  if (after.hasOwnProperty('lineWidth'))
70
71
  this._fontColor = after.fontColor;
71
72
  if (after.hasOwnProperty('text')) {
73
+ ;
72
74
  this.parent.reference.getAt(this.index).set('text', after.text);
73
75
  }
74
76
  this.invalidate();
@@ -1 +1 @@
1
- {"version":3,"file":"tab-button.js","sourceRoot":"","sources":["../src/tab-button.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EA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;YAAE,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,SAAS,CAAA;QAExE,IAAI,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;YAAE,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,SAAS,CAAA;QAExE,IAAI,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC;YAAE,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,SAAS,CAAA;QAE1E,IAAI,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;YAAE,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,SAAS,CAAA;QAExE,IAAI,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE;YAC/B,IAAI,CAAC,MAAc,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;SACzE;QAED,IAAI,CAAC,UAAU,EAAE,CAAA;IACnB,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\nimport { Component, RectPath, State } from '@hatiolab/things-scene'\n\nimport Tab from './tab'\n\nexport default class TabButton extends RectPath(Component) {\n get index() {\n return this.model.index\n }\n\n get activated() {\n return (this.parent as Tab).activeIndex === this.index\n }\n\n removed(parent: Tab) {\n this.dispose()\n }\n\n private _fillStyle?: string\n private _fontColor?: string\n private _strokeStyle?: string\n private _lineWidth?: string\n\n prerender(context: CanvasRenderingContext2D) {\n super.prerender(context)\n let { fillStyle, activeFillStyle, activeLineColor, activeLineWidth, fontColor, activeFontColor } = this.model\n\n // backup style\n if (!this.hasOwnProperty('_fillStyle')) {\n this._fillStyle = fillStyle\n }\n if (!this.hasOwnProperty('_fontColor')) {\n this._fontColor = fontColor\n }\n\n if (this.activated) {\n this.model.fillStyle = activeFillStyle\n this.model.fontColor = activeFontColor\n this.model.strokeStyle = activeLineColor\n this.model.lineWidth = activeLineWidth\n } else {\n this.model.fillStyle = this._fillStyle\n this.model.fontColor = this._fontColor\n this.model.strokeStyle = this._strokeStyle\n this.model.lineWidth = this._lineWidth\n }\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left = 0, top = 0, width, height } = this.bounds\n\n // 컨테이너의 바운드를 표현한다.(컨테이너의 기본 그리기 기능)\n context.beginPath()\n\n context.rect(left, top, width, height)\n\n this.drawFill(context)\n this.drawStroke(context)\n }\n\n postrender(context: CanvasRenderingContext2D) {\n super.postrender(context)\n\n // restore style\n this.model.fillStyle = this._fillStyle\n this.model.fontColor = this._fontColor\n this.model.strokeStyle = this._strokeStyle\n this.model.lineWidth = this._lineWidth\n\n delete this._fillStyle\n delete this._fontColor\n delete this._strokeStyle\n delete this._lineWidth\n }\n\n onclick(e: MouseEvent) {\n (this.parent as Tab).activeIndex = this.index\n this.parent.invalidate()\n }\n\n onchange(after: State) {\n if (after.hasOwnProperty('fillStyle')) this._fillStyle = after.fillStyle\n\n if (after.hasOwnProperty('fontColor')) this._fontColor = after.fontColor\n\n if (after.hasOwnProperty('strokeStyle')) this._fontColor = after.fontColor\n\n if (after.hasOwnProperty('lineWidth')) this._fontColor = after.fontColor\n\n if (after.hasOwnProperty('text')) {\n (this.parent as Tab).reference.getAt(this.index).set('text', after.text)\n }\n\n this.invalidate()\n }\n}\n\nComponent.register('tab-button', TabButton)\n"]}
1
+ {"version":3,"file":"tab-button.js","sourceRoot":"","sources":["../src/tab-button.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAS,MAAM,wBAAwB,CAAA;AAInE,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,QAAQ,CAAC,SAAS,CAAC;IACxD,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAA;IACzB,CAAC;IAED,IAAI,SAAS;QACX,OAAQ,IAAI,CAAC,MAAc,CAAC,WAAW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,CAAC,SAAS,CAAA;QAE1E,IAAI,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;YAAE,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,SAAS,CAAA;QAExE,IAAI,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE;YAChC,CAAC;YAAC,IAAI,CAAC,MAAc,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;SAC1E;QAED,IAAI,CAAC,UAAU,EAAE,CAAA;IACnB,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\nimport { Component, RectPath, State } from '@hatiolab/things-scene'\n\nimport Tab from './tab'\n\nexport default class TabButton extends RectPath(Component) {\n get index() {\n return this.model.index\n }\n\n get activated() {\n return (this.parent as Tab).activeIndex === this.index\n }\n\n removed(parent: Tab) {\n this.dispose()\n }\n\n private _fillStyle?: string\n private _fontColor?: string\n private _strokeStyle?: string\n private _lineWidth?: string\n\n prerender(context: CanvasRenderingContext2D) {\n super.prerender(context)\n let { fillStyle, activeFillStyle, activeLineColor, activeLineWidth, fontColor, activeFontColor } = this.state\n\n // backup style\n if (!this.hasOwnProperty('_fillStyle')) {\n this._fillStyle = fillStyle\n }\n if (!this.hasOwnProperty('_fontColor')) {\n this._fontColor = fontColor\n }\n\n if (this.activated) {\n this.model.fillStyle = activeFillStyle\n this.model.fontColor = activeFontColor\n this.model.strokeStyle = activeLineColor\n this.model.lineWidth = activeLineWidth\n } else {\n this.model.fillStyle = this._fillStyle\n this.model.fontColor = this._fontColor\n this.model.strokeStyle = this._strokeStyle\n this.model.lineWidth = this._lineWidth\n }\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left = 0, top = 0, width, height } = this.bounds\n\n // 컨테이너의 바운드를 표현한다.(컨테이너의 기본 그리기 기능)\n context.beginPath()\n\n context.rect(left, top, width, height)\n\n this.drawFill(context)\n this.drawStroke(context)\n }\n\n postrender(context: CanvasRenderingContext2D) {\n super.postrender(context)\n\n // restore style\n this.model.fillStyle = this._fillStyle\n this.model.fontColor = this._fontColor\n this.model.strokeStyle = this._strokeStyle\n this.model.lineWidth = this._lineWidth\n\n delete this._fillStyle\n delete this._fontColor\n delete this._strokeStyle\n delete this._lineWidth\n }\n\n onclick(e: MouseEvent) {\n ;(this.parent as Tab).activeIndex = this.index\n this.parent.invalidate()\n }\n\n onchange(after: State) {\n if (after.hasOwnProperty('fillStyle')) this._fillStyle = after.fillStyle\n\n if (after.hasOwnProperty('fontColor')) this._fontColor = after.fontColor\n\n if (after.hasOwnProperty('strokeStyle')) this._fontColor = after.fontColor\n\n if (after.hasOwnProperty('lineWidth')) this._fontColor = after.fontColor\n\n if (after.hasOwnProperty('text')) {\n ;(this.parent as Tab).reference.getAt(this.index).set('text', after.text)\n }\n\n this.invalidate()\n }\n}\n\nComponent.register('tab-button', TabButton)\n"]}
@@ -0,0 +1,10 @@
1
+ import { ComponentNature, Container } from '@hatiolab/things-scene';
2
+ export default class TabCard extends Container {
3
+ private _clickPoint?;
4
+ get hasTextProperty(): boolean;
5
+ get showMoveHandle(): boolean;
6
+ get mutable(): boolean;
7
+ get resizable(): boolean;
8
+ get rotatable(): boolean;
9
+ get nature(): ComponentNature;
10
+ }