dcim-topology2d 1.1.6 → 2.0.2
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/chart-diagram/src/echarts/index.js +88 -96
- package/chart-diagram/src/register.js +3 -3
- package/chart-diagram/src/utils/changeOptions.d.ts +4 -4
- package/chart-diagram/src/utils/changeOptions.js +172 -144
- package/chart-diagram/src/utils/conversion.d.ts +12 -12
- package/chart-diagram/src/utils/conversion.js +278 -137
- package/chart-diagram/src/utils/render.d.ts +5 -0
- package/chart-diagram/src/utils/render.js +107 -0
- package/core/index.d.ts +1 -0
- package/core/index.js +1 -0
- package/core/src/activeLayer.js +0 -6
- package/core/src/canvas.js +1 -0
- package/core/src/common.d.ts +1 -2
- package/core/src/common.js +123 -540
- package/core/src/core.js +61 -46
- package/core/src/divLayer.d.ts +0 -3
- package/core/src/divLayer.js +13 -34
- package/core/src/element/common.d.ts +5 -0
- package/core/src/element/common.js +52 -0
- package/core/src/element/iframe.d.ts +3 -0
- package/core/src/element/iframe.js +12 -0
- package/core/src/element/index.d.ts +4 -0
- package/core/src/element/index.js +4 -0
- package/core/src/element/select.d.ts +11 -0
- package/core/src/element/select.js +199 -0
- package/core/src/element/tab.d.ts +1 -0
- package/core/src/element/tab.js +22 -0
- package/core/src/healps/changeData.d.ts +1 -2
- package/core/src/healps/changeData.js +16 -122
- package/core/src/middles/default.js +3 -1
- package/core/src/middles/nodes/arbitrarygraph.js +11 -9
- package/core/src/middles/nodes/formselect.d.ts +2 -0
- package/core/src/middles/nodes/formselect.js +73 -0
- package/core/src/middles/nodes/iframe.js +21 -4
- package/core/src/middles/nodes/index.d.ts +1 -0
- package/core/src/middles/nodes/index.js +1 -0
- package/core/src/models/node.d.ts +4 -0
- package/core/src/models/node.js +24 -22
- package/core/src/models/pen.js +1 -2
- package/core/src/models/rect.js +2 -2
- package/core/src/options.d.ts +1 -0
- package/core/src/preview.js +45 -31
- package/core/src/renderLayer.d.ts +10 -6
- package/core/src/renderLayer.js +36 -43
- package/core/src/store/data.d.ts +16 -17
- package/core/src/store/data.js +36 -14
- package/core/src/utils/assignment.d.ts +6 -3
- package/core/src/utils/assignment.js +84 -15
- package/core/src/utils/construction.d.ts +9 -3
- package/core/src/utils/construction.js +6 -1
- package/core/src/utils/conversion.d.ts +3 -0
- package/core/src/utils/conversion.js +67 -0
- package/core/src/utils/index.d.ts +1 -1
- package/core/src/utils/index.js +1 -1
- package/core/src/utils/math.d.ts +1 -0
- package/core/src/utils/math.js +3 -0
- package/core/src/utils/onmousevent.d.ts +3 -0
- package/core/src/utils/onmousevent.js +28 -7
- package/core/src/utils/params.d.ts +7 -0
- package/core/src/utils/params.js +125 -0
- package/package.json +1 -1
- package/static/echartsDefaultData.js +27 -107
- package/static/element.js +14 -0
- package/static/form.js +11 -0
- package/static/index.js +2 -1
- package/store/actions.js +17 -0
- package/store/clear.js +72 -0
- package/store/index.js +2 -0
- package/style/common.css +18 -0
- package/style/editor.css +13 -0
- package/style/index.css +3 -12
- package/style/select.css +143 -0
- package/core/src/utils/dom.d.ts +0 -9
- package/core/src/utils/dom.js +0 -103
- package/core/src/utils/dom.js.map +0 -1
- package/static/echartsStore.js +0 -14
package/style/select.css
ADDED
@@ -0,0 +1,143 @@
|
|
1
|
+
.topology-select {
|
2
|
+
width: 160px;
|
3
|
+
height: 30px;
|
4
|
+
display: flex;
|
5
|
+
position: relative;
|
6
|
+
background-size: 100%;
|
7
|
+
}
|
8
|
+
.topology-select .topology-select-remove{
|
9
|
+
display: none;
|
10
|
+
position: absolute;
|
11
|
+
top: 50%;
|
12
|
+
right: 10px;
|
13
|
+
width: 13px;
|
14
|
+
height: 13px;
|
15
|
+
line-height: 8px;
|
16
|
+
font-size: 10px;
|
17
|
+
color: #c0c4cc;
|
18
|
+
cursor: pointer;
|
19
|
+
text-align: center;
|
20
|
+
border: 1px solid #c0c4cc;
|
21
|
+
border-radius: 100%;
|
22
|
+
transform: translateY(-50%);
|
23
|
+
}
|
24
|
+
.topology-select .topology-select-icon-arrow{
|
25
|
+
display: block;
|
26
|
+
position: absolute;
|
27
|
+
top: 50%;
|
28
|
+
right: 10px;
|
29
|
+
width: 0;
|
30
|
+
height: 0;
|
31
|
+
border: 7px solid transparent;
|
32
|
+
border-top-color: #284689;
|
33
|
+
border-bottom-width: 0;
|
34
|
+
border-top-left-radius: 4px;
|
35
|
+
border-top-right-radius: 4px;
|
36
|
+
transform: translateY(-50%);
|
37
|
+
transition: all .3s;
|
38
|
+
}
|
39
|
+
.topology-select .topology-select-icon-arrow.reverse{
|
40
|
+
/* top: 39%; */
|
41
|
+
transform: translateY(-50%) rotate(180deg);
|
42
|
+
}
|
43
|
+
.topology-select input {
|
44
|
+
width: 100%;
|
45
|
+
height: 100%;
|
46
|
+
font-size: 14px;
|
47
|
+
padding: 0 10px;
|
48
|
+
border-radius: 4px;
|
49
|
+
border: 1px solid #284689;
|
50
|
+
background: transparent;
|
51
|
+
outline: none;
|
52
|
+
cursor: pointer;
|
53
|
+
color: #fff;
|
54
|
+
}
|
55
|
+
.topology-select-dropdown {
|
56
|
+
position: absolute;
|
57
|
+
width: 160px;
|
58
|
+
border-radius: 5px;
|
59
|
+
margin-top: 14px;
|
60
|
+
border: 1px solid #284689;
|
61
|
+
background-size: 100%;
|
62
|
+
background-color: #0b1531;
|
63
|
+
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
|
64
|
+
display: none;
|
65
|
+
}
|
66
|
+
.topology-select-dropdown .popper__arrow{
|
67
|
+
display: block;
|
68
|
+
position: absolute;
|
69
|
+
top: -7px;
|
70
|
+
left: 20%;
|
71
|
+
width: 0;
|
72
|
+
height: 0;
|
73
|
+
border: 6px solid transparent;
|
74
|
+
border-bottom-color: #284689;
|
75
|
+
border-top-width: 0;
|
76
|
+
}
|
77
|
+
/* 隐藏滚动条 */
|
78
|
+
.topology-select-dropdown-list::-webkit-scrollbar {
|
79
|
+
display: none;
|
80
|
+
}
|
81
|
+
.topology-select-dropdown .topology-select-dropdown-list {
|
82
|
+
max-height: 230px;
|
83
|
+
margin: 8px 0;
|
84
|
+
overflow: auto;
|
85
|
+
background-size: 100%;
|
86
|
+
}
|
87
|
+
.topology-select-dropdown .topology-select-dropdown-list li {
|
88
|
+
display: flex;
|
89
|
+
height: 30px;
|
90
|
+
line-height: 30px;
|
91
|
+
align-items: center;
|
92
|
+
color: #fff;
|
93
|
+
cursor: pointer;
|
94
|
+
font-size: 12px;
|
95
|
+
}
|
96
|
+
.topology-select-dropdown .topology-select-dropdown-list li:hover {
|
97
|
+
background-color: #265797;
|
98
|
+
color: #fff !important;
|
99
|
+
}
|
100
|
+
.topology-select-dropdown .topology-select-dropdown-list li.selected {
|
101
|
+
color: #409eff !important;
|
102
|
+
font-weight: 700;
|
103
|
+
}
|
104
|
+
.topology-select-dropdown .topology-select-dropdown-list li span {
|
105
|
+
display: block;
|
106
|
+
width: 100%;
|
107
|
+
height: 100%;
|
108
|
+
padding: 0 20px;
|
109
|
+
cursor: pointer;
|
110
|
+
}
|
111
|
+
.topology-select.theme1 input{
|
112
|
+
padding: 0 35px 0 20px;
|
113
|
+
border-color: rgb(56, 255, 255);
|
114
|
+
background-color: rgba(56, 255, 255, 0.2);
|
115
|
+
font-size: 14px;
|
116
|
+
font-weight: 400;
|
117
|
+
font-family: "Arial Black";
|
118
|
+
}
|
119
|
+
.topology-select.theme1 .topology-select-icon-arrow{
|
120
|
+
border-top-color: rgb(56, 255, 255);
|
121
|
+
}
|
122
|
+
.topology-select-dropdown.theme1{
|
123
|
+
margin-top: 3px;
|
124
|
+
padding: 5px 0;
|
125
|
+
border-color: rgb(56, 255, 255);
|
126
|
+
background-color: rgb(9, 57, 75);
|
127
|
+
}
|
128
|
+
.topology-select-dropdown.theme1 .topology-select-dropdown-list{
|
129
|
+
margin: 0;
|
130
|
+
}
|
131
|
+
.topology-select-dropdown.theme1 .topology-select-dropdown-list li {
|
132
|
+
font-size: 14px;
|
133
|
+
}
|
134
|
+
.topology-select-dropdown.theme1 .topology-select-dropdown-list li:hover {
|
135
|
+
background-color: rgba(56, 255, 255, 0.2);
|
136
|
+
color: rgb(56, 255, 255) !important;
|
137
|
+
}
|
138
|
+
.topology-select-dropdown.theme1 .topology-select-dropdown-list li.selected {
|
139
|
+
color: rgb(56, 255, 255) !important;
|
140
|
+
}
|
141
|
+
.topology-select-dropdown.theme1 .popper__arrow{
|
142
|
+
display: none;
|
143
|
+
}
|
package/core/src/utils/dom.d.ts
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
import { Node } from '../models';
|
2
|
-
import { visualization2DStore } from '../store';
|
3
|
-
export declare let DomElements: {};
|
4
|
-
export declare let DomIframes: {};
|
5
|
-
export declare function createChildrenDivByElementId(node: Node, data?: visualization2DStore): HTMLDivElement;
|
6
|
-
export declare function createIframeElement(node: Node): HTMLDivElement;
|
7
|
-
export declare function setStyleForElementIdDiv(node: Node, elem: HTMLElement, data: visualization2DStore): void;
|
8
|
-
export declare function createDiv(node: Node): HTMLDivElement;
|
9
|
-
export declare function loadJS(url: string, callback?: () => void, render?: boolean): void;
|
package/core/src/utils/dom.js
DELETED
@@ -1,103 +0,0 @@
|
|
1
|
-
import {Store} from 'le5le-store';
|
2
|
-
import {Lock} from '../models'
|
3
|
-
import {commonStore} from '../store';
|
4
|
-
|
5
|
-
export let DomElements = {};
|
6
|
-
export let DomIframes = {};
|
7
|
-
|
8
|
-
export function createChildrenDivByElementId(node, data) {
|
9
|
-
if (!data) data = commonStore[node.TID] && commonStore[node.TID].data;
|
10
|
-
// echarts图表的初始化渲染
|
11
|
-
if (node.elementId) {
|
12
|
-
if (!DomElements[node.id]) {
|
13
|
-
DomElements[node.id] = document.getElementById(node.id);
|
14
|
-
if (DomElements[node.id]) {
|
15
|
-
document.querySelector('.canvas-point').appendChild(DomElements[node.id]);
|
16
|
-
}
|
17
|
-
}
|
18
|
-
setStyleForElementIdDiv(node, DomElements[node.id], data);
|
19
|
-
}
|
20
|
-
// iframe元件的初始化渲染
|
21
|
-
if (node.iframe) {
|
22
|
-
if (!DomIframes[node.id]) {
|
23
|
-
let iframe = document.getElementById(`iframe${node.id}`);
|
24
|
-
if (!(iframe && iframe.length)) iframe = createIframeElement(node);
|
25
|
-
DomIframes[node.id] = iframe;
|
26
|
-
if (DomIframes[node.id]) {
|
27
|
-
commonStore[node.TID].parentElem.appendChild(DomIframes[node.id]);
|
28
|
-
}
|
29
|
-
}
|
30
|
-
setStyleForElementIdDiv(node, DomIframes[node.id], data);
|
31
|
-
}
|
32
|
-
}
|
33
|
-
|
34
|
-
export function createIframeElement(node) {
|
35
|
-
const iframe = document.createElement('iframe');
|
36
|
-
// iframe.scrolling = 'no';
|
37
|
-
iframe.frameBorder = '0';
|
38
|
-
iframe.src = node.iframe;
|
39
|
-
iframe.width = node.rect.width;
|
40
|
-
iframe.height = node.rect.height;
|
41
|
-
iframe.setAttribute('id', `iframe${node.id}`);
|
42
|
-
iframe.setAttribute('class', 'topology2dConfIfram');
|
43
|
-
return iframe;
|
44
|
-
}
|
45
|
-
|
46
|
-
export function setStyleForElementIdDiv(node, elem, data) {
|
47
|
-
if (!elem) {
|
48
|
-
return;
|
49
|
-
}
|
50
|
-
elem.style.position = 'absolute';
|
51
|
-
elem.style.outline = 'none';
|
52
|
-
elem.style.left = node.rect.x + 'px';
|
53
|
-
elem.style.top = node.rect.y + 'px';
|
54
|
-
elem.style.width = node.rect.width + 'px';
|
55
|
-
elem.style.height = node.rect.height + 'px';
|
56
|
-
if (node.rotate || node.offsetRotate) {
|
57
|
-
elem.style.transform = "rotate(" + (node.rotate + node.offsetRotate) + "deg)";
|
58
|
-
}
|
59
|
-
// if (node.video && this.videos[node.id] && this.videos[node.id].media) {
|
60
|
-
// this.videos[node.id].media.style.width = '100%';
|
61
|
-
// this.videos[node.id].media.style.height = '100%';
|
62
|
-
// }
|
63
|
-
if (data && data.locked > Lock.None || node.locked > Lock.None) {
|
64
|
-
elem.style.userSelect = 'initial';
|
65
|
-
elem.style.pointerEvents = 'initial';
|
66
|
-
} else {
|
67
|
-
elem.style.userSelect = 'none';
|
68
|
-
elem.style.pointerEvents = 'none';
|
69
|
-
}
|
70
|
-
}
|
71
|
-
|
72
|
-
export function createDiv(node) {
|
73
|
-
var div = document.createElement('div');
|
74
|
-
div.style.position = 'absolute';
|
75
|
-
div.style.outline = 'none';
|
76
|
-
div.style.left = '-9999px';
|
77
|
-
div.style.bottom = '-9999px';
|
78
|
-
div.style.width = node.rect.width + 'px';
|
79
|
-
div.style.height = node.rect.height + 'px';
|
80
|
-
// if (node.elementId) {
|
81
|
-
// div.id = node.elementId;
|
82
|
-
// }
|
83
|
-
div.id = node.id;
|
84
|
-
return div;
|
85
|
-
}
|
86
|
-
|
87
|
-
// export function loadJS(url, callback, render) {
|
88
|
-
// var loaderScript = document.createElement('script');
|
89
|
-
// loaderScript.type = 'text/javascript';
|
90
|
-
// loaderScript.src = url;
|
91
|
-
// loaderScript.addEventListener('load', function () {
|
92
|
-
// if (callback) {
|
93
|
-
// callback();
|
94
|
-
// }
|
95
|
-
// // how to do
|
96
|
-
// if (render) {
|
97
|
-
// Store.set('LT:render', true);
|
98
|
-
// }
|
99
|
-
// });
|
100
|
-
// document.body.appendChild(loaderScript);
|
101
|
-
// }
|
102
|
-
|
103
|
-
//# sourceMappingURL=dom.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"dom.js","sourceRoot":"","sources":["../../../../packages/core/src/utils/dom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIpC,MAAM,UAAU,SAAS,CAAC,IAAU;IAClC,IAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC1C,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;IAChC,GAAG,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;IAC3B,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC;IAC3B,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;IAC7B,GAAG,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACzC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IAC3C,IAAI,IAAI,CAAC,SAAS,EAAE;QAClB,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;KACzB;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,GAAW,EAAE,QAAqB,EAAE,MAAgB;IACzE,IAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACtD,YAAY,CAAC,IAAI,GAAG,iBAAiB,CAAC;IACtC,YAAY,CAAC,GAAG,GAAG,GAAG,CAAC;IACvB,YAAY,CAAC,gBAAgB,CAAC,MAAM,EAAE;QACpC,IAAI,QAAQ,EAAE;YACZ,QAAQ,EAAE,CAAC;SACZ;QACD,YAAY;QACZ,IAAI,MAAM,EAAE;YACV,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;SAC9B;IACH,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;AAC1C,CAAC"}
|
package/static/echartsStore.js
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
export let echartsDataStore = {};
|
2
|
-
export let echartsOptionsStore = {};
|
3
|
-
export const destroyEcharts = function(){
|
4
|
-
for (let node of Object.values(echartsDataStore)) {
|
5
|
-
if(node) {
|
6
|
-
clearInterval(node.timeTicket);
|
7
|
-
node.chart.off('mouseover');
|
8
|
-
node.chart.off('mouseout');
|
9
|
-
node.chart.dispose();
|
10
|
-
}
|
11
|
-
}
|
12
|
-
echartsDataStore = {};
|
13
|
-
echartsOptionsStore = {};
|
14
|
-
};
|