@operato/scene-tab 1.1.8 → 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 +9 -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-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 +9 -6
- 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-card.ts +76 -0
- package/src/tab-container.ts +204 -0
- package/src/tab.ts +9 -5
- 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
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { CardLayout, Component, Container, Model } from '@hatiolab/things-scene';
|
|
5
|
+
const LABEL_WIDTH = 25;
|
|
6
|
+
const LABEL_HEIGHT = 25;
|
|
7
|
+
function rgba(r, g, b, a) {
|
|
8
|
+
return `rgba(${r}, ${g}, ${b}, ${a})`;
|
|
9
|
+
}
|
|
10
|
+
const NATURE = {
|
|
11
|
+
mutable: false,
|
|
12
|
+
resizable: true,
|
|
13
|
+
rotatable: true,
|
|
14
|
+
properties: [
|
|
15
|
+
{
|
|
16
|
+
type: 'action',
|
|
17
|
+
label: 'add-card',
|
|
18
|
+
name: 'addCard',
|
|
19
|
+
property: {
|
|
20
|
+
icon: 'add_circle',
|
|
21
|
+
action: (tabContainer) => {
|
|
22
|
+
tabContainer.addCard();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
type: 'number',
|
|
28
|
+
label: 'active index',
|
|
29
|
+
name: 'activeIndex'
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
'value-property': 'activeIndex',
|
|
33
|
+
help: 'scene/component/tab-container'
|
|
34
|
+
};
|
|
35
|
+
export default class TabContainer extends Container {
|
|
36
|
+
constructor() {
|
|
37
|
+
super(...arguments);
|
|
38
|
+
this._focused = false;
|
|
39
|
+
}
|
|
40
|
+
get nature() {
|
|
41
|
+
return NATURE;
|
|
42
|
+
}
|
|
43
|
+
get layout() {
|
|
44
|
+
return CardLayout;
|
|
45
|
+
}
|
|
46
|
+
get layoutConfig() {
|
|
47
|
+
return this.get('layoutConfig');
|
|
48
|
+
}
|
|
49
|
+
set layoutConfig(config) {
|
|
50
|
+
this.set('layoutConfig', config);
|
|
51
|
+
}
|
|
52
|
+
get activeCard() {
|
|
53
|
+
return this.components[this.get('layoutConfig').activeIndex];
|
|
54
|
+
}
|
|
55
|
+
get activeIndex() {
|
|
56
|
+
return this.get('activeIndex');
|
|
57
|
+
}
|
|
58
|
+
set activeIndex(activeIndex) {
|
|
59
|
+
this.set('activeIndex', Number(activeIndex));
|
|
60
|
+
}
|
|
61
|
+
ready() {
|
|
62
|
+
super.ready();
|
|
63
|
+
if (this.components.length == 0)
|
|
64
|
+
this.addCard();
|
|
65
|
+
}
|
|
66
|
+
postrender(context) {
|
|
67
|
+
if (!this.app.isViewMode && this._focused) {
|
|
68
|
+
var { left, top, width, fillStyle } = this.state;
|
|
69
|
+
// tabCard 선택 탭 그리기
|
|
70
|
+
for (let i = 0; i < this.components.length; i++) {
|
|
71
|
+
context.beginPath();
|
|
72
|
+
context.rect(left - LABEL_WIDTH, top + i * LABEL_HEIGHT, LABEL_WIDTH, LABEL_HEIGHT);
|
|
73
|
+
let color = 255 - ((20 * (i + 1)) % 255);
|
|
74
|
+
context.fillStyle = rgba(color, color, color, 1);
|
|
75
|
+
context.fill();
|
|
76
|
+
context.closePath();
|
|
77
|
+
}
|
|
78
|
+
context.beginPath();
|
|
79
|
+
context.moveTo(left, top);
|
|
80
|
+
context.lineTo(left - LABEL_WIDTH, top);
|
|
81
|
+
context.lineTo(left - LABEL_WIDTH, top + this.components.length * LABEL_HEIGHT);
|
|
82
|
+
context.lineTo(left, top + this.components.length * LABEL_HEIGHT);
|
|
83
|
+
context.strokeStyle = '#ccc';
|
|
84
|
+
context.stroke();
|
|
85
|
+
context.closePath();
|
|
86
|
+
}
|
|
87
|
+
super.postrender(context);
|
|
88
|
+
}
|
|
89
|
+
contains(x, y) {
|
|
90
|
+
var contains = super.contains(x, y);
|
|
91
|
+
if (this.app.isViewMode)
|
|
92
|
+
return contains;
|
|
93
|
+
var { left, top, width } = this.bounds;
|
|
94
|
+
var h = LABEL_HEIGHT;
|
|
95
|
+
contains =
|
|
96
|
+
contains ||
|
|
97
|
+
// card selector 영역에 포함되는지
|
|
98
|
+
(x < Math.max(left - LABEL_WIDTH, left) &&
|
|
99
|
+
x > Math.min(left - LABEL_WIDTH, left) &&
|
|
100
|
+
y < Math.max(top + h * this.size(), top) &&
|
|
101
|
+
y > Math.min(top + h * this.size(), top));
|
|
102
|
+
if (contains)
|
|
103
|
+
this._focused = true;
|
|
104
|
+
else
|
|
105
|
+
this._focused = false;
|
|
106
|
+
this.invalidate();
|
|
107
|
+
return contains;
|
|
108
|
+
}
|
|
109
|
+
onchange(after) {
|
|
110
|
+
if ('activeIndex' in after) {
|
|
111
|
+
this.layoutConfig = {
|
|
112
|
+
...this.layoutConfig,
|
|
113
|
+
activeIndex: after.activeIndex
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
onmouseup(e) {
|
|
118
|
+
var down_point = this.__down_point;
|
|
119
|
+
delete this.__down_point;
|
|
120
|
+
if (!down_point || down_point.x != e.offsetX || down_point.y != e.offsetY) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
var point = this.transcoordC2S(e.offsetX, e.offsetY);
|
|
124
|
+
var { left, top } = this.state;
|
|
125
|
+
var x = point.x - left;
|
|
126
|
+
var y = point.y - top;
|
|
127
|
+
if (x > 0)
|
|
128
|
+
return;
|
|
129
|
+
y /= LABEL_HEIGHT;
|
|
130
|
+
y = Math.floor(y);
|
|
131
|
+
if (!this.layoutConfig)
|
|
132
|
+
this.layoutConfig = {};
|
|
133
|
+
if (y >= this.components.length)
|
|
134
|
+
return;
|
|
135
|
+
// /* 생성 버튼이 클릭되면, 새로운 tabCard를 추가한다. */
|
|
136
|
+
// if(y == this.components.length) {
|
|
137
|
+
// this.add(Model.compile({
|
|
138
|
+
// type: 'tab-card',
|
|
139
|
+
// width: 100,
|
|
140
|
+
// height: 100
|
|
141
|
+
// }))
|
|
142
|
+
// }
|
|
143
|
+
this.set('activeIndex', y);
|
|
144
|
+
}
|
|
145
|
+
onmousedown(e) {
|
|
146
|
+
this.__down_point = {
|
|
147
|
+
x: e.offsetX,
|
|
148
|
+
y: e.offsetY
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
addCard() {
|
|
152
|
+
const color = 255 - ((20 * (this.components.length + 1)) % 255);
|
|
153
|
+
const hex = color.toString(16);
|
|
154
|
+
const tabCard = Model.compile({
|
|
155
|
+
type: 'tab-card',
|
|
156
|
+
fillStyle: `#${hex}${hex}${hex}`,
|
|
157
|
+
top: 0,
|
|
158
|
+
left: 0,
|
|
159
|
+
width: 100,
|
|
160
|
+
height: 100
|
|
161
|
+
});
|
|
162
|
+
this.addComponent(tabCard);
|
|
163
|
+
this.set('activeIndex', this.components.length - 1);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
Component.register('tab-container', TabContainer);
|
|
167
|
+
//# sourceMappingURL=tab-container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tab-container.js","sourceRoot":"","sources":["../src/tab-container.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAmB,SAAS,EAAE,KAAK,EAAgB,MAAM,wBAAwB,CAAA;AAI/G,MAAM,WAAW,GAAG,EAAE,CAAA;AACtB,MAAM,YAAY,GAAG,EAAE,CAAA;AAEvB,SAAS,IAAI,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IACtD,OAAO,QAAQ,CAAC,KAAK,CAAC,KAAK,C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AAC,YAAY,GAAG;YAClB,CAAC,EAAE,CAAC,CAAC,OAAO;YACZ,CAAC,EAAE,CAAC,CAAC,OAAO;SACb,CAAA;IACH,CAAC;IAED,OAAO;QACL,MAAM,KAAK,GAAG,GAAG,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAA;QAC/D,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;QAE9B,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;YAC5B,IAAI,EAAE,UAAU;YAChB,SAAS,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,EAAE;YAChC,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,GAAG;SACZ,CAAC,CAAA;QAEF,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA;QAC1B,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IACrD,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,YAAY,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\nimport { CardLayout, Component, ComponentNature, Container, Model, POINT, State } from '@hatiolab/things-scene'\n\nimport TabCard from './tab-card'\n\nconst LABEL_WIDTH = 25\nconst LABEL_HEIGHT = 25\n\nfunction rgba(r: number, g: number, b: number, a: number) {\n return `rgba(${r}, ${g}, ${b}, ${a})`\n}\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'action',\n label: 'add-card',\n name: 'addCard',\n property: {\n icon: 'add_circle',\n action: (tabContainer: TabContainer) => {\n tabContainer.addCard()\n }\n }\n },\n {\n type: 'number',\n label: 'active index',\n name: 'activeIndex'\n }\n ],\n 'value-property': 'activeIndex',\n help: 'scene/component/tab-container'\n}\n\nexport default class TabContainer extends Container {\n private _focused: boolean = false\n private __down_point?: POINT\n\n get nature() {\n return NATURE\n }\n\n get layout() {\n return CardLayout\n }\n\n get layoutConfig() {\n return this.get('layoutConfig')\n }\n\n set layoutConfig(config) {\n this.set('layoutConfig', config)\n }\n\n get activeCard(): TabCard {\n return this.components[this.get('layoutConfig').activeIndex] as TabCard\n }\n\n get activeIndex() {\n return this.get('activeIndex')\n }\n\n set activeIndex(activeIndex: number) {\n this.set('activeIndex', Number(activeIndex))\n }\n\n ready() {\n super.ready()\n\n if (this.components.length == 0) this.addCard()\n }\n\n postrender(context: CanvasRenderingContext2D) {\n if (!this.app.isViewMode && this._focused) {\n var { left, top, width, fillStyle } = this.state\n\n // tabCard 선택 탭 그리기\n for (let i = 0; i < this.components.length; i++) {\n context.beginPath()\n\n context.rect(left - LABEL_WIDTH, top + i * LABEL_HEIGHT, LABEL_WIDTH, LABEL_HEIGHT)\n\n let color = 255 - ((20 * (i + 1)) % 255)\n context.fillStyle = rgba(color, color, color, 1)\n context.fill()\n\n context.closePath()\n }\n\n context.beginPath()\n\n context.moveTo(left, top)\n context.lineTo(left - LABEL_WIDTH, top)\n context.lineTo(left - LABEL_WIDTH, top + this.components.length * LABEL_HEIGHT)\n context.lineTo(left, top + this.components.length * LABEL_HEIGHT)\n\n context.strokeStyle = '#ccc'\n context.stroke()\n\n context.closePath()\n }\n\n super.postrender(context)\n }\n\n contains(x: number, y: number) {\n var contains = super.contains(x, y)\n\n if (this.app.isViewMode) return contains\n\n var { left, top, width } = this.bounds\n var h = LABEL_HEIGHT\n\n contains =\n contains ||\n // card selector 영역에 포함되는지\n (x < Math.max(left - LABEL_WIDTH, left) &&\n x > Math.min(left - LABEL_WIDTH, left) &&\n y < Math.max(top + h * this.size(), top) &&\n y > Math.min(top + h * this.size(), top))\n\n if (contains) this._focused = true\n else this._focused = false\n\n this.invalidate()\n return contains\n }\n\n onchange(after: State) {\n if ('activeIndex' in after) {\n this.layoutConfig = {\n ...this.layoutConfig,\n activeIndex: after.activeIndex\n }\n }\n }\n\n onmouseup(e: MouseEvent) {\n var down_point = this.__down_point\n delete this.__down_point\n\n if (!down_point || down_point.x != e.offsetX || down_point.y != e.offsetY) {\n return\n }\n\n var point = this.transcoordC2S(e.offsetX, e.offsetY)\n\n var { left, top } = this.state\n\n var x = point.x - left\n var y = point.y - top\n\n if (x > 0) return\n\n y /= LABEL_HEIGHT\n y = Math.floor(y)\n\n if (!this.layoutConfig) this.layoutConfig = {}\n\n if (y >= this.components.length) return\n\n // /* 생성 버튼이 클릭되면, 새로운 tabCard를 추가한다. */\n // if(y == this.components.length) {\n // this.add(Model.compile({\n // type: 'tab-card',\n // width: 100,\n // height: 100\n // }))\n // }\n this.set('activeIndex', y)\n }\n\n onmousedown(e: MouseEvent) {\n this.__down_point = {\n x: e.offsetX,\n y: e.offsetY\n }\n }\n\n addCard() {\n const color = 255 - ((20 * (this.components.length + 1)) % 255)\n const hex = color.toString(16)\n\n const tabCard = Model.compile({\n type: 'tab-card',\n fillStyle: `#${hex}${hex}${hex}`,\n top: 0,\n left: 0,\n width: 100,\n height: 100\n })\n\n this.addComponent(tabCard)\n this.set('activeIndex', this.components.length - 1)\n }\n}\n\nComponent.register('tab-container', TabContainer)\n"]}
|
package/dist/tab.js
CHANGED
|
@@ -17,7 +17,11 @@ const NATURE = {
|
|
|
17
17
|
label: 'tab-reference',
|
|
18
18
|
name: 'reference',
|
|
19
19
|
property: {
|
|
20
|
-
component:
|
|
20
|
+
component: (c) => {
|
|
21
|
+
/* this means compare target component */
|
|
22
|
+
const ret = ['tab-container', 'indoor-map'].includes(c.model.type);
|
|
23
|
+
return ret;
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
26
|
},
|
|
23
27
|
{
|
|
@@ -121,8 +125,7 @@ export default class Tab extends Container {
|
|
|
121
125
|
}
|
|
122
126
|
postrender(context) {
|
|
123
127
|
super.postrender(context);
|
|
124
|
-
if (!this.app.isEditMode)
|
|
125
|
-
return;
|
|
128
|
+
// if (!this.app.isEditMode) return
|
|
126
129
|
var { left, top, width, fillStyle } = this.state;
|
|
127
130
|
// 이동 핸들 그리기
|
|
128
131
|
context.beginPath();
|
|
@@ -161,13 +164,13 @@ export default class Tab extends Container {
|
|
|
161
164
|
this.removeComponent(this.components[i]);
|
|
162
165
|
}
|
|
163
166
|
for (let i = 0; i < components.length; i++) {
|
|
164
|
-
if (components[i].model.type != '
|
|
167
|
+
if (components[i].model.type != 'tab-card')
|
|
165
168
|
continue;
|
|
166
|
-
let
|
|
169
|
+
let tabCardText = components[i].text || '';
|
|
167
170
|
children.push(Model.compile({
|
|
168
171
|
type: 'tab-button',
|
|
169
172
|
index: i,
|
|
170
|
-
text:
|
|
173
|
+
text: tabCardText || String(i + 1),
|
|
171
174
|
fillStyle: fillStyle || 'transparent',
|
|
172
175
|
activeFillStyle: activeFillStyle,
|
|
173
176
|
activeLineColor: activeLineColor,
|
package/dist/tab.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab.js","sourceRoot":"","sources":["../src/tab.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,SAAS,EAET,SAAS,EACT,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,EAGN,MAAM,wBAAwB,CAAA;AAE/B,MAAM,YAAY,GAAG,EAAE,CAAA;AACvB,MAAM,aAAa,GAAG,EAAE,CAAA;AAExB,SAAS,IAAI,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IACtD,OAAO,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAA;AACvC,CAAC;AAED,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,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CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAA;IAChC,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\nimport {\n Component,\n ComponentNature,\n Container,\n LinearHorizontalLayout,\n LinearVerticalLayout,\n Model,\n State,\n Style\n} from '@hatiolab/things-scene'\n\nconst HANDLE_WIDTH = 25\nconst HANDLE_HEIGHT = 25\n\nfunction rgba(r: number, g: number, b: number, a: number) {\n return `rgba(${r}, ${g}, ${b}, ${a})`\n}\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'id-input',\n label: 'tab-reference',\n name: 'reference',\n property: {\n component: 'indoor-map'\n }\n },\n {\n type: 'number',\n label: 'tab-active-index',\n name: 'activeIndex',\n property: {\n min: 0,\n step: 1\n }\n },\n {\n type: 'color',\n label: 'active-fill-style',\n name: 'activeFillStyle',\n property: 'activeFillStyle'\n },\n {\n type: 'color',\n label: 'active-font-color',\n name: 'activeFontColor',\n property: 'activeFontColor'\n },\n {\n type: 'color',\n label: 'active-line-color',\n name: 'activeLineColor',\n property: 'activeLineColor'\n },\n {\n type: 'number',\n label: 'active-line-width',\n name: 'activeLineWidth',\n property: 'activeLineWidth'\n }\n ]\n}\n\nexport default class Tab extends Container {\n get layout() {\n let { width, height } = this.state\n\n if (width >= height) {\n return LinearHorizontalLayout\n } else {\n return LinearVerticalLayout\n }\n }\n\n get nature() {\n return NATURE\n }\n\n // 컴포넌트를 임의로 추가 및 삭제할 수 있는 지를 지정하는 속성임.\n get focusible() {\n return false\n }\n\n get reference() {\n var { reference } = this.state\n if (!reference) {\n return null\n }\n\n if (!this._reference) {\n this._reference = this.root.findById(reference)\n if (this._reference) this._reference.on('change', this.onRefChanged, this)\n }\n\n return this._reference\n }\n\n get labelHeight() {\n var components = this.reference.components.length\n var { height } = this.state\n\n return (components > 0 && height / components) || height\n }\n\n get activeIndex() {\n return this.get('activeIndex')\n }\n\n private _reference: any\n\n set reference(reference) {\n if (this.reference) this.reference.off('change', this.onRefChanged, this)\n\n this._reference = null\n this.model.reference = reference\n }\n\n set activeIndex(index) {\n this.set('activeIndex', index)\n if (this.reference) {\n this.reference.activeIndex = index\n }\n }\n\n render(context: CanvasRenderingContext2D) {\n super.render(context)\n\n if (this.reference) {\n if (this.size() !== this.reference.size()) this.rebuildTabButtons()\n } else {\n // TODO reference 가 잘못되거나 안되어있다는 경고 의미로 뭔가 그려라..\n var componentsLength = this.components.length\n for (var i = componentsLength - 1; i >= 0; i--) {\n var tabBtn = this.components[i]\n this.removeComponent(tabBtn)\n }\n }\n }\n\n postrender(context: CanvasRenderingContext2D) {\n super.postrender(context)\n\n if (!this.app.isEditMode) return\n\n var { left, top, width, fillStyle } = this.state\n\n // 이동 핸들 그리기\n context.beginPath()\n\n context.rect(left + width, top, HANDLE_WIDTH, HANDLE_HEIGHT)\n\n let color = 255 - (20 % 255)\n context.fillStyle = rgba(color, color, color, 1)\n context.fill()\n\n context.closePath()\n }\n\n contains(x: number, y: number) {\n if (!this.app.isEditMode) return super.contains(x, y)\n\n if (super.contains(x, y)) return true\n\n var { left, top, width } = this.bounds\n\n var right = left + width\n\n var h = HANDLE_HEIGHT\n\n return (\n x < Math.max(right + HANDLE_WIDTH, right) &&\n x > Math.min(right + HANDLE_WIDTH, right) &&\n y < Math.max(top + h, top) &&\n y > Math.min(top + h, top)\n )\n }\n\n dispose() {\n if (this.reference) this.reference.off('change', this.onRefChanged, this)\n\n super.dispose()\n }\n\n rebuildTabButtons() {\n var {\n tabIndex = 0,\n left,\n top,\n width,\n height,\n fillStyle,\n activeFillStyle,\n activeLineColor,\n activeLineWidth,\n strokeStyle,\n fontColor,\n activeFontColor,\n fontFamily,\n fontSize,\n lineHeight,\n italic,\n bold,\n lineWidth = 0\n } = this.state\n\n var reference = this.reference\n let children = []\n\n let components = reference.components\n let label_height = this.labelHeight\n\n let componentsLength = this.components.length\n\n for (var i = componentsLength - 1; i >= 0; i--) {\n this.removeComponent(this.components[i])\n }\n\n for (let i = 0; i < components.length; i++) {\n if (components[i].model.type != 'floor') continue\n\n let floorText = components[i].text || ''\n\n children.push(\n Model.compile({\n type: 'tab-button',\n index: i,\n text: floorText || String(i + 1),\n fillStyle: fillStyle || 'transparent',\n activeFillStyle: activeFillStyle,\n activeLineColor: activeLineColor,\n activeLineWidth: activeLineWidth,\n fontColor: fontColor,\n activeFontColor: activeFontColor || fontColor,\n fontFamily: fontFamily,\n fontSize: fontSize,\n lineHeight: lineHeight,\n italic: italic,\n bold: bold,\n strokeStyle: strokeStyle,\n lineWidth: lineWidth,\n left: 0,\n top: 0,\n width: width,\n height: height\n })\n )\n }\n\n this.add(children)\n\n this.reflow()\n\n this.activeIndex = this.state.activeIndex || 0\n }\n\n setTabButtonsStyle(style: Style) {\n // var {\n // fillStyle,\n // activeFillStyle,\n // fontColor,\n // activeFontColor,\n // strokeStyle,\n // lineWidth = 0,\n // fontFamily,\n // fontSize,\n // lineHeight,\n // italic,\n // bold\n // } = style\n\n var children = this.components\n\n for (var i in children) {\n var tabBtn = children[i]\n tabBtn.set(style)\n // tabBtn.set({\n // fillStyle: fillStyle,\n // activeFillStyle: activeFillStyle,\n // fontColor: fontColor,\n // activeFontColor: activeFontColor,\n // strokeStyle: strokeStyle,\n // lineWidth: lineWidth,\n // fontFamily: fontFamily,\n // fontSize: fontSize,\n // lineHeight: lineHeight,\n // italic: italic,\n // bold: bold\n // })\n }\n }\n\n // reference가 변했을 때 (tab에 변화를 주기위해)\n onRefChanged(after: any, before: any, hint: any) {\n // let sourceIndex = hint.deliverer.indexOf(hint.origin)\n // if(this.components[sourceIndex]) {\n // this.components[sourceIndex].set(after)\n // this.invalidate()\n // }\n }\n\n onchange(after: State, before: State) {\n if (after.hasOwnProperty('reference')) {\n this.reference = after.reference\n this.invalidate()\n }\n\n // if(after.hasOwnProperty(\"activeFillStyle\")\n // || after.hasOwnProperty(\"activeFontColor\")\n // || after.hasOwnProperty(\"fillStyle\")\n // || after.hasOwnProperty(\"fontColor\")\n // || after.hasOwnProperty(\"strokeStyle\")\n // || after.hasOwnProperty(\"lineWidth\")\n // || after.hasOwnProperty(\"fontFamily\")\n // || after.hasOwnProperty(\"fontSize\")\n // || after.hasOwnProperty(\"lineHeight\")\n // || after.hasOwnProperty(\"italic\")\n // || after.hasOwnProperty(\"bold\")) {\n //\n // }\n this.setTabButtonsStyle(after)\n }\n}\n\nComponent.register('tab', Tab)\n"]}
|
|
1
|
+
{"version":3,"file":"tab.js","sourceRoot":"","sources":["../src/tab.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,SAAS,EAET,SAAS,EACT,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,EAGN,MAAM,wBAAwB,CAAA;AAE/B,MAAM,YAAY,GAAG,EAAE,CAAA;AACvB,MAAM,aAAa,GAAG,EAAE,CAAA;AAExB,SAAS,IAAI,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IACtD,OAAO,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAA;AACvC,CAAC;AAED,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE;gBACR,SAAS,EAAE,CAAC,CAAY,EAAE,EAAE;oBAC1B,yCAAyC;oBACzC,MAAM,GAAG,GAAG,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAc,CAAC,CAAA;oBAC5E,OAAO,GAAG,CAAA;gBACZ,CAAC;aACF;SACF;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,kBAAkB;YACz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BAAqB;QACrB,iBAAiB;QACjB,mBAAmB;QACnB,gBAAgB;QAChB,cAAc;QACd,gBAAgB;QAChB,YAAY;QACZ,SAAS;QACT,YAAY;QAEZ,IAAI,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAA;QAE9B,KAAK,IAAI,CAAC,IAAI,QAAQ,EAAE;YACtB,IAAI,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;YACxB,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;YACjB,eAAe;YACf,0BAA0B;YAC1B,sCAAsC;YACtC,0BAA0B;YAC1B,sCAAsC;YACtC,8BAA8B;YAC9B,0BAA0B;YAC1B,4BAA4B;YAC5B,wBAAwB;YACxB,4BAA4B;YAC5B,oBAAoB;YACpB,eAAe;YACf,KAAK;SACN;IACH,CAAC;IAED,mCAAmC;IACnC,YAAY,CAAC,KAAU,EAAE,MAAW,EAAE,IAAS;QAC7C,wDAAwD;QACxD,qCAAqC;QACrC,4CAA4C;QAC5C,sBAAsB;QACtB,IAAI;IACN,CAAC;IAED,QAAQ,CAAC,KAAY,EAAE,MAAa;QAClC,IAAI,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE;YACrC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAA;YAChC,IAAI,CAAC,UAAU,EAAE,CAAA;SAClB;QAED,6CAA6C;QAC7C,+CAA+C;QAC/C,yCAAyC;QACzC,yCAAyC;QACzC,2CAA2C;QAC3C,yCAAyC;QACzC,0CAA0C;QAC1C,wCAAwC;QACxC,0CAA0C;QAC1C,sCAAsC;QACtC,uCAAuC;QACvC,EAAE;QACF,IAAI;QACJ,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAA;IAChC,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\nimport {\n Component,\n ComponentNature,\n Container,\n LinearHorizontalLayout,\n LinearVerticalLayout,\n Model,\n State,\n Style\n} from '@hatiolab/things-scene'\n\nconst HANDLE_WIDTH = 25\nconst HANDLE_HEIGHT = 25\n\nfunction rgba(r: number, g: number, b: number, a: number) {\n return `rgba(${r}, ${g}, ${b}, ${a})`\n}\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'id-input',\n label: 'tab-reference',\n name: 'reference',\n property: {\n component: (c: Component) => {\n /* this means compare target component */\n const ret = ['tab-container', 'indoor-map'].includes(c.model.type as string)\n return ret\n }\n }\n },\n {\n type: 'number',\n label: 'tab-active-index',\n name: 'activeIndex',\n property: {\n min: 0,\n step: 1\n }\n },\n {\n type: 'color',\n label: 'active-fill-style',\n name: 'activeFillStyle',\n property: 'activeFillStyle'\n },\n {\n type: 'color',\n label: 'active-font-color',\n name: 'activeFontColor',\n property: 'activeFontColor'\n },\n {\n type: 'color',\n label: 'active-line-color',\n name: 'activeLineColor',\n property: 'activeLineColor'\n },\n {\n type: 'number',\n label: 'active-line-width',\n name: 'activeLineWidth',\n property: 'activeLineWidth'\n }\n ]\n}\n\nexport default class Tab extends Container {\n get layout() {\n let { width, height } = this.state\n\n if (width >= height) {\n return LinearHorizontalLayout\n } else {\n return LinearVerticalLayout\n }\n }\n\n get nature() {\n return NATURE\n }\n\n // 컴포넌트를 임의로 추가 및 삭제할 수 있는 지를 지정하는 속성임.\n get focusible() {\n return false\n }\n\n get reference() {\n var { reference } = this.state\n if (!reference) {\n return null\n }\n\n if (!this._reference) {\n this._reference = this.root.findById(reference)\n if (this._reference) this._reference.on('change', this.onRefChanged, this)\n }\n\n return this._reference\n }\n\n get labelHeight() {\n var components = this.reference.components.length\n var { height } = this.state\n\n return (components > 0 && height / components) || height\n }\n\n get activeIndex() {\n return this.get('activeIndex')\n }\n\n private _reference: any\n\n set reference(reference) {\n if (this.reference) this.reference.off('change', this.onRefChanged, this)\n\n this._reference = null\n this.model.reference = reference\n }\n\n set activeIndex(index) {\n this.set('activeIndex', index)\n if (this.reference) {\n this.reference.activeIndex = index\n }\n }\n\n render(context: CanvasRenderingContext2D) {\n super.render(context)\n\n if (this.reference) {\n if (this.size() !== this.reference.size()) this.rebuildTabButtons()\n } else {\n // TODO reference 가 잘못되거나 안되어있다는 경고 의미로 뭔가 그려라..\n var componentsLength = this.components.length\n for (var i = componentsLength - 1; i >= 0; i--) {\n var tabBtn = this.components[i]\n this.removeComponent(tabBtn)\n }\n }\n }\n\n postrender(context: CanvasRenderingContext2D) {\n super.postrender(context)\n\n // if (!this.app.isEditMode) return\n\n var { left, top, width, fillStyle } = this.state\n\n // 이동 핸들 그리기\n context.beginPath()\n\n context.rect(left + width, top, HANDLE_WIDTH, HANDLE_HEIGHT)\n\n let color = 255 - (20 % 255)\n context.fillStyle = rgba(color, color, color, 1)\n context.fill()\n\n context.closePath()\n }\n\n contains(x: number, y: number) {\n if (!this.app.isEditMode) return super.contains(x, y)\n\n if (super.contains(x, y)) return true\n\n var { left, top, width } = this.bounds\n\n var right = left + width\n\n var h = HANDLE_HEIGHT\n\n return (\n x < Math.max(right + HANDLE_WIDTH, right) &&\n x > Math.min(right + HANDLE_WIDTH, right) &&\n y < Math.max(top + h, top) &&\n y > Math.min(top + h, top)\n )\n }\n\n dispose() {\n if (this.reference) this.reference.off('change', this.onRefChanged, this)\n\n super.dispose()\n }\n\n rebuildTabButtons() {\n var {\n tabIndex = 0,\n left,\n top,\n width,\n height,\n fillStyle,\n activeFillStyle,\n activeLineColor,\n activeLineWidth,\n strokeStyle,\n fontColor,\n activeFontColor,\n fontFamily,\n fontSize,\n lineHeight,\n italic,\n bold,\n lineWidth = 0\n } = this.state\n\n var reference = this.reference\n let children = []\n\n let components = reference.components\n let label_height = this.labelHeight\n\n let componentsLength = this.components.length\n\n for (var i = componentsLength - 1; i >= 0; i--) {\n this.removeComponent(this.components[i])\n }\n\n for (let i = 0; i < components.length; i++) {\n if (components[i].model.type != 'tab-card') continue\n\n let tabCardText = components[i].text || ''\n\n children.push(\n Model.compile({\n type: 'tab-button',\n index: i,\n text: tabCardText || String(i + 1),\n fillStyle: fillStyle || 'transparent',\n activeFillStyle: activeFillStyle,\n activeLineColor: activeLineColor,\n activeLineWidth: activeLineWidth,\n fontColor: fontColor,\n activeFontColor: activeFontColor || fontColor,\n fontFamily: fontFamily,\n fontSize: fontSize,\n lineHeight: lineHeight,\n italic: italic,\n bold: bold,\n strokeStyle: strokeStyle,\n lineWidth: lineWidth,\n left: 0,\n top: 0,\n width: width,\n height: height\n })\n )\n }\n\n this.add(children)\n\n this.reflow()\n\n this.activeIndex = this.state.activeIndex || 0\n }\n\n setTabButtonsStyle(style: Style) {\n // var {\n // fillStyle,\n // activeFillStyle,\n // fontColor,\n // activeFontColor,\n // strokeStyle,\n // lineWidth = 0,\n // fontFamily,\n // fontSize,\n // lineHeight,\n // italic,\n // bold\n // } = style\n\n var children = this.components\n\n for (var i in children) {\n var tabBtn = children[i]\n tabBtn.set(style)\n // tabBtn.set({\n // fillStyle: fillStyle,\n // activeFillStyle: activeFillStyle,\n // fontColor: fontColor,\n // activeFontColor: activeFontColor,\n // strokeStyle: strokeStyle,\n // lineWidth: lineWidth,\n // fontFamily: fontFamily,\n // fontSize: fontSize,\n // lineHeight: lineHeight,\n // italic: italic,\n // bold: bold\n // })\n }\n }\n\n // reference가 변했을 때 (tab에 변화를 주기위해)\n onRefChanged(after: any, before: any, hint: any) {\n // let sourceIndex = hint.deliverer.indexOf(hint.origin)\n // if(this.components[sourceIndex]) {\n // this.components[sourceIndex].set(after)\n // this.invalidate()\n // }\n }\n\n onchange(after: State, before: State) {\n if (after.hasOwnProperty('reference')) {\n this.reference = after.reference\n this.invalidate()\n }\n\n // if(after.hasOwnProperty(\"activeFillStyle\")\n // || after.hasOwnProperty(\"activeFontColor\")\n // || after.hasOwnProperty(\"fillStyle\")\n // || after.hasOwnProperty(\"fontColor\")\n // || after.hasOwnProperty(\"strokeStyle\")\n // || after.hasOwnProperty(\"lineWidth\")\n // || after.hasOwnProperty(\"fontFamily\")\n // || after.hasOwnProperty(\"fontSize\")\n // || after.hasOwnProperty(\"lineHeight\")\n // || after.hasOwnProperty(\"italic\")\n // || after.hasOwnProperty(\"bold\")) {\n //\n // }\n this.setTabButtonsStyle(after)\n }\n}\n\nComponent.register('tab', Tab)\n"]}
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
declare const _default: {
|
|
1
|
+
declare const _default: ({
|
|
2
|
+
type: string;
|
|
3
|
+
description: string;
|
|
4
|
+
group: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
model: {
|
|
7
|
+
type: string;
|
|
8
|
+
left: number;
|
|
9
|
+
top: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
fontSize: number;
|
|
13
|
+
lineWidth: number;
|
|
14
|
+
};
|
|
15
|
+
} | {
|
|
2
16
|
type: string;
|
|
3
17
|
description: string;
|
|
4
18
|
group: string;
|
|
@@ -15,6 +29,5 @@ declare const _default: {
|
|
|
15
29
|
strokeStyle: string;
|
|
16
30
|
fontColor: string;
|
|
17
31
|
};
|
|
18
|
-
|
|
19
|
-
}[];
|
|
32
|
+
})[];
|
|
20
33
|
export default _default;
|
package/dist/templates/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,OAAO,CAAA;AAEvB,eAAe,CAAC,GAAG,CAAC,CAAA","sourcesContent":["import tab from './tab'\n\nexport default [
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,iBAAiB,CAAA;AAC1C,OAAO,GAAG,MAAM,OAAO,CAAA;AAEvB,eAAe,CAAC,YAAY,EAAE,GAAG,CAAC,CAAA","sourcesContent":["import TabContainer from './tab-container'\nimport Tab from './tab'\n\nexport default [TabContainer, Tab]\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
type: string;
|
|
3
|
+
description: string;
|
|
4
|
+
group: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
model: {
|
|
7
|
+
type: string;
|
|
8
|
+
left: number;
|
|
9
|
+
top: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
fontSize: number;
|
|
13
|
+
lineWidth: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const icon = new URL('../../icons/tab-container.png', import.meta.url).href;
|
|
2
|
+
export default {
|
|
3
|
+
type: 'tab-container',
|
|
4
|
+
description: 'tab container(card layout)',
|
|
5
|
+
group: 'container' /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */,
|
|
6
|
+
icon,
|
|
7
|
+
model: {
|
|
8
|
+
type: 'tab-container',
|
|
9
|
+
left: 100,
|
|
10
|
+
top: 100,
|
|
11
|
+
width: 200,
|
|
12
|
+
height: 200,
|
|
13
|
+
fontSize: 80,
|
|
14
|
+
lineWidth: 1
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=tab-container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tab-container.js","sourceRoot":"","sources":["../../src/templates/tab-container.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,+BAA+B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAE3E,eAAe;IACb,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,4BAA4B;IACzC,KAAK,EAAE,WAAW,CAAC,gGAAgG;IACnH,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,GAAG;QACT,GAAG,EAAE,GAAG;QACR,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,CAAC;KACb;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/tab-container.png', import.meta.url).href\n\nexport default {\n type: 'tab-container',\n description: 'tab container(card layout)',\n group: 'container' /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */,\n icon,\n model: {\n type: 'tab-container',\n left: 100,\n top: 100,\n width: 200,\n height: 200,\n fontSize: 80,\n lineWidth: 1\n }\n}\n"]}
|
package/dist/templates/tab.d.ts
CHANGED
package/dist/templates/tab.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const icon = new URL('../../icons/tab.png', import.meta.url).href;
|
|
2
2
|
export default {
|
|
3
3
|
type: 'tab',
|
|
4
|
-
description: 'container tab',
|
|
4
|
+
description: 'tab-container control tab',
|
|
5
5
|
group: 'container' /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */,
|
|
6
6
|
icon,
|
|
7
7
|
model: {
|
|
@@ -15,7 +15,6 @@ export default {
|
|
|
15
15
|
activeFillStyle: 'red',
|
|
16
16
|
strokeStyle: 'white',
|
|
17
17
|
fontColor: 'white'
|
|
18
|
-
}
|
|
19
|
-
about: '/helps/scene/component/tab.md'
|
|
18
|
+
}
|
|
20
19
|
};
|
|
21
20
|
//# sourceMappingURL=tab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab.js","sourceRoot":"","sources":["../../src/templates/tab.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,qBAAqB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEjE,eAAe;IACb,IAAI,EAAE,KAAK;IACX,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"tab.js","sourceRoot":"","sources":["../../src/templates/tab.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,qBAAqB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEjE,eAAe;IACb,IAAI,EAAE,KAAK;IACX,WAAW,EAAE,2BAA2B;IACxC,KAAK,EAAE,WAAW,CAAC,gGAAgG;IACnH,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,GAAG;QACT,GAAG,EAAE,GAAG;QACR,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,MAAM;QACjB,eAAe,EAAE,KAAK;QACtB,WAAW,EAAE,OAAO;QACpB,SAAS,EAAE,OAAO;KACnB;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/tab.png', import.meta.url).href\n\nexport default {\n type: 'tab',\n description: 'tab-container control tab',\n group: 'container' /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */,\n icon,\n model: {\n type: 'tab',\n left: 100,\n top: 100,\n width: 100,\n height: 400,\n lineWidth: 5,\n fillStyle: 'navy',\n activeFillStyle: 'red',\n strokeStyle: 'white',\n fontColor: 'white'\n }\n}\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# 탭컨테이너(tab-container)
|
|
2
|
+
|
|
3
|
+
## example
|
|
4
|
+
|
|
5
|
+
사각형 컴포넌트에 이벤트를 걸어 탭컨테이너(TabContainer) 활성 카드(TabCard)을 제어
|
|
6
|
+
|
|
7
|
+
> - **사각형 컴포넌트에 click이벤트를 걸어 탭컨테이너(TabContainer)에 전달**
|
|
8
|
+
> - **탭컨테이너(TabContainer)의 value속성을 바꿔주면 TabCard가 변경된다.**
|
|
9
|
+
|
|
10
|
+
![gif][gif-01]
|
|
11
|
+
|
|
12
|
+
[gif-01]: ../images/tab-button-finish-01.gif
|
|
13
|
+
|
|
14
|
+
1. 3개의 층을 가진 탭컨테이너(TabContainer)를 생성한다.
|
|
15
|
+
|
|
16
|
+
![탭컨테이너(TabContainer)][tab-container-create]
|
|
17
|
+
|
|
18
|
+
2. 구별을 위해 층마다 텍스트를 넣었다.
|
|
19
|
+
|
|
20
|
+
![탭컨테이너(TabContainer)][tab-container-text]
|
|
21
|
+
|
|
22
|
+
3. 탭컨테이너(TabContainer)의 아이디를 'indoor'로 지정한다.
|
|
23
|
+
|
|
24
|
+
![탭컨테이너(TabContainer)][tab-container-id]
|
|
25
|
+
|
|
26
|
+
4. 버튼 이벤트 추가
|
|
27
|
+
|
|
28
|
+
- 사각형 3개를 그린 후, '효과 창'에서 변수정보에 'indoor'를 선택한다.
|
|
29
|
+
(변수 정보에는 기본 이벤트와 컴포넌트들의 아이디 리스트가 나온다.)
|
|
30
|
+
![버튼이벤트][button-02]
|
|
31
|
+
|
|
32
|
+
- 각 사각형마다 값을 매핑한다. (사각형을 클릭할 시, 'indoor' 아이디를 가진 컴포넌트에 '0'이란 데이터를 넘겨주게 된다.)
|
|
33
|
+
- 1층 - 0
|
|
34
|
+
- 2층 - 1
|
|
35
|
+
- 3층 - 2
|
|
36
|
+
|
|
37
|
+
![버튼이벤트][button-03]
|
|
38
|
+
|
|
39
|
+
[button-02]: ../images/button-evnet-mapping-02.png
|
|
40
|
+
[button-03]: ../images/button-evnet-mapping-03.png
|
|
41
|
+
|
|
42
|
+
5. 탭컨테이너(TabContainer) 설정
|
|
43
|
+
|
|
44
|
+
- 탭컨테이너(TabContainer) 컴포넌트의 데이터 바인딩 설정을 아래의 그림과 같이 설정한다.
|
|
45
|
+
(데이터를 받을때 자신의 value 속성을 같이 바꿔주는 설정)
|
|
46
|
+
|
|
47
|
+
![버튼이벤트][tab-container-setting]
|
|
48
|
+
|
|
49
|
+
6. 결과 확인
|
|
50
|
+
|
|
51
|
+
- 모든 설정이 완료되었다면 아래와 같이 **사각형을 클릭할 때마다 탭컨테이너(TabContainer)의 층이 바뀌는 것**을 확인할 수 있다.
|
|
52
|
+
![gif-01]
|
|
53
|
+
|
|
54
|
+
[gif-01]: ../images/tab-button-finish-01.gif
|
|
55
|
+
[tab-container-create]: ../images/tab-container-create-01.png
|
|
56
|
+
[tab-container-text]: ../images/tab-container-create-02.png
|
|
57
|
+
[tab-container-id]: ../images/tab-container-create-03.png
|
|
58
|
+
[tab-container-setting]: ../images/tab-container-setting-01.png
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# tab-container
|
|
2
|
+
|
|
3
|
+
## example
|
|
4
|
+
|
|
5
|
+
Control the TabContainer layer by triggering events on the rectangular component
|
|
6
|
+
|
|
7
|
+
> -**Apply a click event to a square component and deliver it to TabContainers** -**If you change the value property of TabContainer, the TabCard will be changed.**
|
|
8
|
+
|
|
9
|
+
![gif][gif-01]
|
|
10
|
+
|
|
11
|
+
[gif-01]: ../images/tab-button-finish-01.gif
|
|
12
|
+
|
|
13
|
+
1. It creates TabContainer with three layers.
|
|
14
|
+
|
|
15
|
+
![tab-container][tab-container-create]
|
|
16
|
+
|
|
17
|
+
2. Text is put in each layer for distinction.
|
|
18
|
+
|
|
19
|
+
![tab-container][tab-container-text]
|
|
20
|
+
|
|
21
|
+
3. The ID of the TabContainer is designated as 'indoor'.
|
|
22
|
+
|
|
23
|
+
![tab-container][tab-container-id]
|
|
24
|
+
|
|
25
|
+
4. Add button event
|
|
26
|
+
|
|
27
|
+
- After drawing 3 squares, select 'indoor' as the variable information in the 'effect window'.
|
|
28
|
+
(In the variable information, a list of IDs of basic events and components is shown.)
|
|
29
|
+
![buttonEvent][button-02]
|
|
30
|
+
|
|
31
|
+
- Map values for each square. (When clicking the square, data of '0' is passed to the component with the 'indoor' ID.)
|
|
32
|
+
- 1layer - 0
|
|
33
|
+
- 2layer - 1
|
|
34
|
+
- 3layer - 2
|
|
35
|
+
|
|
36
|
+
![buttonEvent][button-03]
|
|
37
|
+
|
|
38
|
+
[button-02]: ../images/button-evnet-mapping-02.png
|
|
39
|
+
[button-03]: ../images/button-evnet-mapping-03.png
|
|
40
|
+
|
|
41
|
+
5. TabContainer setting
|
|
42
|
+
|
|
43
|
+
- Set the data binding setting of the TabContainer component as shown in the figure below.
|
|
44
|
+
(Setting to change its value property when receiving data)
|
|
45
|
+
|
|
46
|
+
![buttonEvent][tab-container-setting]
|
|
47
|
+
|
|
48
|
+
6. check result
|
|
49
|
+
|
|
50
|
+
- If all settings are complete, you can see that the TabContainer layer changes every time you click the square as shown below.
|
|
51
|
+
![gif-01]
|
|
52
|
+
|
|
53
|
+
[gif-01]: ../images/tab-button-finish-01.gif
|
|
54
|
+
[tab-container-create]: ../images/tab-container-create-01.png
|
|
55
|
+
[tab-container-text]: ../images/tab-container-create-02.png
|
|
56
|
+
[tab-container-id]: ../images/tab-container-create-03.png
|
|
57
|
+
[tab-container-setting]: ../images/tab-container-setting-01.png
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# tab-container
|
|
2
|
+
|
|
3
|
+
## example
|
|
4
|
+
|
|
5
|
+
通过触发矩形组件上的事件来控制室内层
|
|
6
|
+
|
|
7
|
+
> - **将矩形组件的 click 事件传递到 TabContainer 组件**
|
|
8
|
+
> - **更改 TabContainer 组件的 value 属性 TabCard 会发生变化**
|
|
9
|
+
|
|
10
|
+
![gif][gif-01]
|
|
11
|
+
|
|
12
|
+
[gif-01]: ../images/tab-button-finish-01.gif
|
|
13
|
+
|
|
14
|
+
1. 创建具有三层的 tab-container
|
|
15
|
+
|
|
16
|
+
![tab-container][tab-container-create]
|
|
17
|
+
|
|
18
|
+
2. 为了区分为每层更改显示层数
|
|
19
|
+
|
|
20
|
+
![tab-container][tab-container-text]
|
|
21
|
+
|
|
22
|
+
3. 指定室内地图的 ID。
|
|
23
|
+
|
|
24
|
+
![tab-container][tab-container-id]
|
|
25
|
+
|
|
26
|
+
4. 增加按钮
|
|
27
|
+
|
|
28
|
+
- 绘制 3 个矩形后,在“效果窗口”中的点击事件中 'indoor' 作为变量信息。
|
|
29
|
+
(在变量信息中,显示基本事件处理方法和组件的 ID 的列表。)
|
|
30
|
+
![buttonEvent][button-02]
|
|
31
|
+
|
|
32
|
+
- 每个矩形的地图值。 (单击矩形时,数据“0”将传递到具有 'indoor' ID 的组件。)
|
|
33
|
+
- 1층 - 0
|
|
34
|
+
- 2층 - 1
|
|
35
|
+
- 3층 - 2
|
|
36
|
+
|
|
37
|
+
![buttonEvent][button-03]
|
|
38
|
+
|
|
39
|
+
[button-02]: ../images/button-evnet-mapping-02.png
|
|
40
|
+
[button-03]: ../images/button-evnet-mapping-03.png
|
|
41
|
+
|
|
42
|
+
5. tab-container 配置
|
|
43
|
+
|
|
44
|
+
- 如下图设置室内地图组件的数据绑定设置。
|
|
45
|
+
(设置为在接收数据时更改其 value 属性)
|
|
46
|
+
|
|
47
|
+
![buttonEvent][tab-container-setting]
|
|
48
|
+
|
|
49
|
+
6. 确认结果
|
|
50
|
+
|
|
51
|
+
- 如果所有设置均已完成,则每次单击矩形时,都可以看到室内地图图层发生变化,如下所示。
|
|
52
|
+
![gif-01]
|
|
53
|
+
|
|
54
|
+
[gif-01]: ../images/tab-button-finish-01.gif
|
|
55
|
+
|
|
56
|
+
[tab-container-create]: ../images/tab-container-create-01.png
|
|
57
|
+
[tab-container-text]: ../images/tab-container-create-02.png
|
|
58
|
+
[tab-container-id]: ../images/tab-container-create-03.png
|
|
59
|
+
[tab-container-setting]: ../images/tab-container-setting-01.png
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"keep": {
|
|
3
|
+
"days": true,
|
|
4
|
+
"amount": 2
|
|
5
|
+
},
|
|
6
|
+
"auditLog": "logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json",
|
|
7
|
+
"files": [
|
|
8
|
+
{
|
|
9
|
+
"date": 1668305631867,
|
|
10
|
+
"name": "logs/application-2022-11-13-11.log",
|
|
11
|
+
"hash": "1a4fca34a06957f0bc9147bd1998aaea9986f560f3845b16e24ba2561354870c"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"date": 1668310621750,
|
|
15
|
+
"name": "logs/application-2022-11-13-12.log",
|
|
16
|
+
"hash": "a6e92b1ff5d1c59348091f85a4b8ce1ebea0994b1d64a91dae0e13226b57bbc5"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"hashType": "sha256"
|
|
20
|
+
}
|