@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.
- package/CHANGELOG.md +18 -0
- package/assets/favicon.ico +0 -0
- package/assets/images/spinner.png +0 -0
- package/demo/index.html +240 -204
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/tab-button.js +3 -1
- package/dist/tab-button.js.map +1 -1
- package/dist/tab-card.d.ts +10 -0
- package/dist/tab-card.js +65 -0
- package/dist/tab-card.js.map +1 -0
- package/dist/tab-container.d.ts +20 -0
- package/dist/tab-container.js +167 -0
- package/dist/tab-container.js.map +1 -0
- package/dist/tab.js +17 -13
- package/dist/tab.js.map +1 -1
- package/dist/templates/index.d.ts +16 -3
- package/dist/templates/index.js +3 -2
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/tab-container.d.ts +16 -0
- package/dist/templates/tab-container.js +17 -0
- package/dist/templates/tab-container.js.map +1 -0
- package/dist/templates/tab.d.ts +0 -1
- package/dist/templates/tab.js +2 -3
- package/dist/templates/tab.js.map +1 -1
- package/helps/scene/component/tab-container.ko.md +58 -0
- package/helps/scene/component/tab-container.md +57 -0
- package/helps/scene/component/tab-container.zh.md +59 -0
- package/helps/scene/images/button-evnet-mapping-01.png +0 -0
- package/helps/scene/images/button-evnet-mapping-02.png +0 -0
- package/helps/scene/images/button-evnet-mapping-03.png +0 -0
- package/helps/scene/images/tab-button-finish-01.gif +0 -0
- package/helps/scene/images/tab-container-03.png +0 -0
- package/helps/scene/images/tab-container-create-01.png +0 -0
- package/helps/scene/images/tab-container-create-02.png +0 -0
- package/helps/scene/images/tab-container-create-03.png +0 -0
- package/helps/scene/images/tab-container-setting-01.png +0 -0
- package/icons/tab-container.png +0 -0
- package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +20 -0
- package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +20 -0
- package/logs/application-2022-11-13-11.log +14 -0
- package/logs/application-2022-11-13-12.log +6 -0
- package/logs/connections-2022-11-13-11.log +70 -0
- package/logs/connections-2022-11-13-12.log +35 -0
- package/package.json +2 -2
- package/src/index.ts +3 -0
- package/src/tab-button.ts +3 -3
- package/src/tab-card.ts +76 -0
- package/src/tab-container.ts +204 -0
- package/src/tab.ts +18 -12
- package/src/templates/index.ts +3 -2
- package/src/templates/tab-container.ts +17 -0
- package/src/templates/tab.ts +2 -3
- package/things-scene.config.js +2 -2
- package/translations/en.json +4 -0
- package/translations/ko.json +4 -0
- package/translations/ms.json +4 -0
- package/translations/zh.json +4 -0
- package/tsconfig.tsbuildinfo +1 -1
- 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
|
-
<!
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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><things-scene-tab></code>:</p>
|
|
37
35
|
|
|
38
|
-
<things-scene-viewer id=
|
|
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
|
|
57
|
-
<input
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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:
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
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
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;
|
|
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"]}
|
package/dist/tab-button.js
CHANGED
|
@@ -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.
|
|
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();
|
package/dist/tab-button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,KAAK,IAAI,CAAC,KAAK,CAAA;IACxD,CAAC;IAED,OAAO,CAAC,MAAW;QACjB,IAAI,CAAC,OAAO,EAAE,CAAA;IAChB,CAAC;IAOD,SAAS,CAAC,OAAiC;QACzC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;QACxB,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAE7G,eAAe;QACf,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE;YACtC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAA;SAC5B;QACD,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE;YACtC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAA;SAC5B;QAED,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,eAAe,CAAA;YACtC,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,eAAe,CAAA;YACtC,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,eAAe,CAAA;YACxC,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,eAAe,CAAA;SACvC;aAAM;YAC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,CAAA;IAC1B,CAAC;IAED,QAAQ,CAAC,KAAY;QACnB,IAAI,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;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;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
|
+
}
|