@meta2d/core 1.1.6 → 1.1.8

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.
@@ -23,13 +23,13 @@ export class Dialog {
23
23
  let header = document.createElement('div');
24
24
  this.title = document.createElement('div');
25
25
  this.close = document.createElement('span');
26
- this.close.innerHTML = `
27
- <svg fill="none" viewBox="0 0 16 16" width="1em" height="1em">
28
- <path
29
- fill="currentColor"
30
- d="M8 8.92L11.08 12l.92-.92L8.92 8 12 4.92 11.08 4 8 7.08 4.92 4 4 4.92 7.08 8 4 11.08l.92.92L8 8.92z"
31
- fill-opacity="0.9"
32
- ></path>
26
+ this.close.innerHTML = `
27
+ <svg fill="none" viewBox="0 0 16 16" width="1em" height="1em">
28
+ <path
29
+ fill="currentColor"
30
+ d="M8 8.92L11.08 12l.92-.92L8.92 8 12 4.92 11.08 4 8 7.08 4.92 4 4 4.92 7.08 8 4 11.08l.92.92L8 8.92z"
31
+ fill-opacity="0.9"
32
+ ></path>
33
33
  </svg>`;
34
34
  this.body = document.createElement('div');
35
35
  this.iframe = document.createElement('iframe');
@@ -74,68 +74,68 @@ export class Dialog {
74
74
  style.type = 'text/css';
75
75
  document.head.appendChild(style);
76
76
  sheet = style.sheet;
77
- sheet.insertRule(`.meta2d-dialog_mask {
78
- display: none;
79
- position: absolute;
80
- top: 0%;
81
- left: 0%;
82
- width: 100%;
83
- height: 100%;
84
- background-color: #0000006f;
77
+ sheet.insertRule(`.meta2d-dialog_mask {
78
+ display: none;
79
+ position: absolute;
80
+ top: 0%;
81
+ left: 0%;
82
+ width: 100%;
83
+ height: 100%;
84
+ background-color: #0000006f;
85
85
  z-index: 9999;`);
86
- sheet.insertRule(`.meta2d-dialog_mask .meta2d-dialog {
87
- position: absolute;
88
- top: 15vh;
89
- left: 10%;
90
- width: 80%;
91
- height:420px;
92
- padding: 16px 20px;
93
- border-radius: 9px;
94
- z-index: 19999;
95
- overflow: auto;
86
+ sheet.insertRule(`.meta2d-dialog_mask .meta2d-dialog {
87
+ position: absolute;
88
+ top: 15vh;
89
+ left: 10%;
90
+ width: 80%;
91
+ height:420px;
92
+ padding: 16px 20px;
93
+ border-radius: 9px;
94
+ z-index: 19999;
95
+ overflow: auto;
96
96
  }`);
97
- sheet.insertRule(`.meta2d-dialog_header {
98
- display: flex;
99
- position: relative;
100
- z-index: 999;
97
+ sheet.insertRule(`.meta2d-dialog_header {
98
+ display: flex;
99
+ position: relative;
100
+ z-index: 999;
101
101
  }`);
102
- sheet.insertRule(`.meta2d-dialog-content {
103
- width: calc(100% - 20px);
104
- font-weight: 600;
105
- font-size: 14px;
106
- color: #bdc7db;
107
- padding-bottom:8px;
102
+ sheet.insertRule(`.meta2d-dialog-content {
103
+ width: calc(100% - 20px);
104
+ font-weight: 600;
105
+ font-size: 14px;
106
+ color: #bdc7db;
107
+ padding-bottom:8px;
108
108
  }`);
109
- sheet.insertRule(`.meta2d-dialog-close {
110
- width: 20px;
111
- height: 20px;
112
- line-height: 20px;
113
- text-align: center;
114
- color: #617b91;
115
- position: absolute;
116
- right:20px;
117
- top:2px;
118
- display:none;
109
+ sheet.insertRule(`.meta2d-dialog-close {
110
+ width: 20px;
111
+ height: 20px;
112
+ line-height: 20px;
113
+ text-align: center;
114
+ color: #617b91;
115
+ position: absolute;
116
+ right:20px;
117
+ top:2px;
118
+ display:none;
119
119
  }`);
120
- sheet.insertRule(`.meta2d-dialog-close svg{
121
- width: 18px;
122
- height: 18px;
120
+ sheet.insertRule(`.meta2d-dialog-close svg{
121
+ width: 18px;
122
+ height: 18px;
123
123
  }`);
124
- sheet.insertRule(`.meta2d-dialog-close :hover{
125
- cursor: pointer;
124
+ sheet.insertRule(`.meta2d-dialog-close :hover{
125
+ cursor: pointer;
126
126
  }`);
127
- sheet.insertRule(`.meta2d-dialog_body{
128
- width: 100%;
129
- height: 100%;
127
+ sheet.insertRule(`.meta2d-dialog_body{
128
+ width: 100%;
129
+ height: 100%;
130
130
  } `);
131
- sheet.insertRule(`.meta2d-dialog_body iframe{
132
- width: 100%;
133
- height: 100%;
131
+ sheet.insertRule(`.meta2d-dialog_body iframe{
132
+ width: 100%;
133
+ height: 100%;
134
134
  }`);
135
- sheet.insertRule(`.meta2d-dialog_body .meta2d-dialog-meta2d{
136
- width: 100%;
137
- height: 100%;
138
- display: none;
135
+ sheet.insertRule(`.meta2d-dialog_body .meta2d-dialog-meta2d{
136
+ width: 100%;
137
+ height: 100%;
138
+ display: none;
139
139
  }`);
140
140
  }
141
141
  }
@@ -71,25 +71,25 @@ export class Message {
71
71
  style.type = 'text/css';
72
72
  document.head.appendChild(style);
73
73
  sheet = style.sheet;
74
- sheet.insertRule(`.meta2d-message{
75
- position:absolute;
76
- z-index:999;
77
- transform: translateX(-50%);
78
- padding:12px 16px;
79
- max-width:400px;
80
- background:#fff;
81
- border-radius:6px;
82
- box-shadow:0 3px 14px 2px rgba(0, 0, 0, .05),0 8px 10px 1px rgba(0, 0, 0, 6%),0 5px 5px -3px rgba(0, 0, 0, 10%);
83
- display:flex;
74
+ sheet.insertRule(`.meta2d-message{
75
+ position:absolute;
76
+ z-index:999;
77
+ transform: translateX(-50%);
78
+ padding:12px 16px;
79
+ max-width:400px;
80
+ background:#fff;
81
+ border-radius:6px;
82
+ box-shadow:0 3px 14px 2px rgba(0, 0, 0, .05),0 8px 10px 1px rgba(0, 0, 0, 6%),0 5px 5px -3px rgba(0, 0, 0, 10%);
83
+ display:flex;
84
84
  animation: fadein .5s;}`);
85
- sheet.insertRule(`
86
- @keyframes fadein {
87
- 0% {
88
- transform: translate(-50%, -100%);
89
- }
90
- 100% {
91
- transform: translate(-50%,0);
92
- }
85
+ sheet.insertRule(`
86
+ @keyframes fadein {
87
+ 0% {
88
+ transform: translate(-50%, -100%);
89
+ }
90
+ 100% {
91
+ transform: translate(-50%,0);
92
+ }
93
93
  }`);
94
94
  sheet.insertRule('.meta2d-message .icon{width:20px;height:20px;}');
95
95
  sheet.insertRule('.meta2d-message .text{color:rgba(0, 0, 0, 0.9);font-size:12px;margin-left:8px;line-height:20px;}');
@@ -62,13 +62,13 @@ function doWarning(meta2d, mess) {
62
62
  let topicName = mess.payload.topicName;
63
63
  let message = mess.payload.message;
64
64
  let notifyTime = mess.payload.notifyTime;
65
- let content = `<div style="padding:0px 12px 0px 0px;width:300px;">
66
- <div style="display:flex;height: 20px;justify-content: space-between">
67
- <div style="color: #000000d9;
68
- font-size: 14px;
69
- font-weight: 700;">${topicName}</div><div style="color: #00000073;">${getTime(notifyTime)}</div>
70
- </div>
71
- <span>${message}</span>
65
+ let content = `<div style="padding:0px 12px 0px 0px;width:300px;">
66
+ <div style="display:flex;height: 20px;justify-content: space-between">
67
+ <div style="color: #000000d9;
68
+ font-size: 14px;
69
+ font-weight: 700;">${topicName}</div><div style="color: #00000073;">${getTime(notifyTime)}</div>
70
+ </div>
71
+ <span>${message}</span>
72
72
  </div>`;
73
73
  meta2d.message({ content, duration: 0, closeBtn: true, placement: 'right', height: 75 });
74
74
  if (mess.payload.detail?.alarmConfigId) {
File without changes
@@ -1,109 +0,0 @@
1
- // import { Pen, setElemPosition } from '../pen';
2
- // import { Point } from '../point';
3
- // import { getMeta2dData, s8, debounce, deepClone } from '../utils';
4
- // import { renderPen } from '../pen';
5
- // import { ctxDrawCanvas, ctxDrawPath } from '../pen';
6
- // import { calcTextLines } from '../pen';
7
- // export function iterator(pen: Pen, ctx?: CanvasRenderingContext2D) {
8
- // if (!pen.onDestroy) {
9
- // pen.onAdd = add;
10
- // pen.onDestroy = destory;
11
- // pen.onMove = move;
12
- // // pen.onBeforeValue = beforeValue;
13
- // pen.onMouseDown = onMousedown;
14
- // pen.onMouseUp = onMouseUp;
15
- // }
16
- // const store = pen.calculative.canvas.store;
17
- // console.log()
18
- // pen.originalData = deepClone(store.data);
19
- // // pen.pens.forEach((cpen: any) => {
20
- // // if (!cpen.parentId) {
21
- // // cpen.width = cpen.width / c_scale;
22
- // // cpen.height = cpen.height / c_scale;
23
- // // cpen.x = (cpen.x - c_origin.x) / c_scale + (pen.x - origin.x) / scale;
24
- // // cpen.y = (cpen.y - c_origin.y) / c_scale + (pen.y - origin.y) / scale;
25
- // // }
26
- // // if (!cpen.p_sceneId) {
27
- // // cpen.p_sceneId = pen.sceneId;
28
- // // if (cpen.name !== 'sceneContainer') {
29
- // // cpen.p_vId = _vId;
30
- // // }
31
- // // }
32
- // // });
33
- // // for (let i = 0; i < pen.data.length; i++) {
34
- // // }
35
- // }
36
- // function destory(pen: Pen) {
37
- // }
38
- // function add(pen: Pen) {
39
- // if(!pen._iteratorID){
40
- // pen._iteratorID = s8();
41
- // }
42
- // generatePens(pen);
43
- // }
44
- // function generatePens(pen: Pen) {
45
- // let e = {
46
- // x:pen.x,
47
- // y:pen.y,
48
- // }
49
- // for(let i =0;i< 5;i++){
50
- // e.x += 100;
51
- // let pens = deepClone(pen.componentDatas);
52
- // pens._iteratorIdx = i;
53
- // pens.forEach((cpen: Pen) => {
54
- // cpen._iteratorID = pen._iteratorID;
55
- // })
56
- // pen.calculative.canvas.dropPens(deepClone(pens),e)
57
- // }
58
- // }
59
- // function collectPens(pen: Pen) {
60
- // let pens = [];
61
- // const meta2d = pen.calculative.canvas.parent;
62
- // meta2d.store.data.pens.forEach((cpen: any) => {
63
- // if (
64
- // cpen._iteratorID &&
65
- // cpen._iteratorID === pen._iteratorID &&
66
- // cpen.id !== pen.id
67
- // ) {
68
- // cpen.calculative.locked = 0;
69
- // cpen.locked = 0;
70
- // pens.push(cpen);
71
- // }
72
- // });
73
- // return pens;
74
- // }
75
- // function deletePens(pen: Pen) {
76
- // const meta2d = pen.calculative.canvas.parent;
77
- // let pens = collectPens(pen);
78
- // pens.forEach((cpen: Pen) => {
79
- // meta2d.canvas.delForce(cpen);
80
- // });
81
- // meta2d.canvas.canvasTemplate.init();
82
- // meta2d.canvas.canvasImage.init();
83
- // meta2d.canvas.canvasImageBottom.init();
84
- // meta2d.render();
85
- // }
86
- // function moveToLast(pen) {
87
- // let array = pen.calculative.canvas.store.data.pens;
88
- // let index = array.findIndex((item) => item.id === pen.id);
89
- // if (index < 0 || index >= array.length) return array;
90
- // const element = array.splice(index, 1)[0];
91
- // array.push(element);
92
- // }
93
- // function move(pen: Pen) {
94
- // debounce(reGeneratePens, 500, pen);
95
- // }
96
- // function reGeneratePens(pen: Pen){
97
- // if (pen.calculative.drag && pen.calculative.active && !(pen.locked > 1)) {
98
- // pen.calculative.drag = false;
99
- // deletePens(pen);
100
- // generatePens(pen);
101
- // }
102
- // }
103
- // function onMousedown(pen: any, e: Point) {
104
- // pen.calculative.drag = true;
105
- // }
106
- // function onMouseUp(pen: any, e: Point) {
107
- // pen.calculative.drag = false;
108
- // }
109
- //# sourceMappingURL=iterator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"iterator.js","sourceRoot":"","sources":["../../../../packages/core/src/diagrams/iterator.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,oCAAoC;AACpC,qEAAqE;AACrE,sCAAsC;AACtC,uDAAuD;AACvD,0CAA0C;AAE1C,uEAAuE;AACvE,yBAAyB;AACzB,uBAAuB;AACvB,+BAA+B;AAC/B,yBAAyB;AACzB,0CAA0C;AAC1C,qCAAqC;AACrC,iCAAiC;AACjC,MAAM;AACN,gDAAgD;AAChD,kBAAkB;AAClB,8CAA8C;AAC9C,yCAAyC;AACzC,iCAAiC;AACjC,gDAAgD;AAChD,kDAAkD;AAClD,oFAAoF;AACpF,oFAAoF;AACpF,aAAa;AACb,kCAAkC;AAClC,2CAA2C;AAC3C,mDAAmD;AACnD,kCAAkC;AAClC,eAAe;AACf,aAAa;AACb,aAAa;AACb,qDAAqD;AAErD,WAAW;AAEX,IAAI;AACJ,+BAA+B;AAE/B,IAAI;AAEJ,2BAA2B;AAC3B,0BAA0B;AAC1B,8BAA8B;AAC9B,MAAM;AAEN,uBAAuB;AACvB,IAAI;AAGJ,oCAAoC;AACpC,eAAe;AACf,eAAe;AACf,eAAe;AACf,MAAM;AACN,4BAA4B;AAC5B,k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