@web-utils/component 3.7.0 → 3.7.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/chunks/{ElementBaseInfo.jv89Vjy1.mjs → ElementBaseInfo.ZADwixb5.mjs} +25 -18
- package/code-mirror-editor/index.mjs +46 -465
- package/flow-designer/index.mjs +6 -1
- package/fy-form-design/index.mjs +3 -2
- package/index.mjs +331 -330
- package/monaco-editor/index.mjs +121 -72
- package/monaco-editor/style.css +1 -0
- package/package.json +2 -1
- package/vue-cron/index.mjs +863 -331
- package/vue-cron/style.css +1 -1
- package/web-types.json +49 -1
package/monaco-editor/index.mjs
CHANGED
|
@@ -1,28 +1,43 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
for (var i in
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
for (var i of
|
|
9
|
-
|
|
10
|
-
return
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
|
+
var u = Object.getOwnPropertySymbols;
|
|
3
|
+
var _ = Object.prototype.hasOwnProperty, M = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var c = (e, t, i) => t in e ? y(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, f = (e, t) => {
|
|
5
|
+
for (var i in t || (t = {}))
|
|
6
|
+
_.call(t, i) && c(e, i, t[i]);
|
|
7
|
+
if (u)
|
|
8
|
+
for (var i of u(t))
|
|
9
|
+
M.call(t, i) && c(e, i, t[i]);
|
|
10
|
+
return e;
|
|
11
11
|
};
|
|
12
|
+
var a = (e, t, i) => new Promise((d, s) => {
|
|
13
|
+
var r = (n) => {
|
|
14
|
+
try {
|
|
15
|
+
l(i.next(n));
|
|
16
|
+
} catch (h) {
|
|
17
|
+
s(h);
|
|
18
|
+
}
|
|
19
|
+
}, p = (n) => {
|
|
20
|
+
try {
|
|
21
|
+
l(i.throw(n));
|
|
22
|
+
} catch (h) {
|
|
23
|
+
s(h);
|
|
24
|
+
}
|
|
25
|
+
}, l = (n) => n.done ? d(n.value) : Promise.resolve(n.value).then(r, p);
|
|
26
|
+
l((i = i.apply(e, t)).next());
|
|
27
|
+
});
|
|
12
28
|
import * as o from "monaco-editor/esm/vs/editor/editor.api";
|
|
13
|
-
import "
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
const m = {
|
|
29
|
+
import { c as g } from "../chunks/json-beautifier.Bp3GslGm.mjs";
|
|
30
|
+
import { NOOP as m } from "@web-utils/core";
|
|
31
|
+
import { n as E } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
32
|
+
const v = {
|
|
18
33
|
name: "MonacoEditor",
|
|
19
34
|
props: {
|
|
20
35
|
diffEditor: { type: Boolean, default: !1 },
|
|
21
|
-
// 是否使用diff模式
|
|
36
|
+
// 是否使用 diff 模式
|
|
22
37
|
width: { type: [String, Number], default: "100%" },
|
|
23
38
|
height: { type: [String, Number], default: "100%" },
|
|
24
39
|
original: String,
|
|
25
|
-
// 只有在diff模式下有效
|
|
40
|
+
// 只有在 diff 模式下有效
|
|
26
41
|
value: [String, Object],
|
|
27
42
|
language: { type: String, default: "javascript" },
|
|
28
43
|
theme: { type: String, default: "vs" },
|
|
@@ -33,13 +48,18 @@ const m = {
|
|
|
33
48
|
return {};
|
|
34
49
|
}
|
|
35
50
|
},
|
|
36
|
-
editorMounted: { type: Function, default:
|
|
37
|
-
editorBeforeMount: { type: Function, default:
|
|
51
|
+
editorMounted: { type: Function, default: m },
|
|
52
|
+
editorBeforeMount: { type: Function, default: m },
|
|
38
53
|
keyIndex: { type: String }
|
|
39
54
|
},
|
|
55
|
+
data() {
|
|
56
|
+
return {
|
|
57
|
+
fullscreen: !1
|
|
58
|
+
};
|
|
59
|
+
},
|
|
40
60
|
computed: {
|
|
41
61
|
style() {
|
|
42
|
-
return {
|
|
62
|
+
return this.fullscreen ? {} : {
|
|
43
63
|
width: /^\d+$/.test(this.width) ? `${this.width}px` : this.width,
|
|
44
64
|
height: /^\d+$/.test(this.height) ? `${this.height}px` : this.height,
|
|
45
65
|
position: "relative"
|
|
@@ -49,20 +69,20 @@ const m = {
|
|
|
49
69
|
watch: {
|
|
50
70
|
options: {
|
|
51
71
|
deep: !0,
|
|
52
|
-
handler(
|
|
53
|
-
var
|
|
54
|
-
(
|
|
72
|
+
handler(e) {
|
|
73
|
+
var t;
|
|
74
|
+
(t = this.editor) == null || t.updateOptions(e);
|
|
55
75
|
}
|
|
56
76
|
},
|
|
57
77
|
keyIndex() {
|
|
58
|
-
let
|
|
59
|
-
typeof
|
|
78
|
+
let e = this.value;
|
|
79
|
+
typeof e == "object" && (e = g(e)), this.editor && e !== this._getValue() && this._setValue(e);
|
|
60
80
|
},
|
|
61
81
|
language() {
|
|
62
82
|
if (this.editor)
|
|
63
83
|
if (this.diffEditor) {
|
|
64
|
-
const { original:
|
|
65
|
-
o.editor.setModelLanguage(
|
|
84
|
+
const { original: e, modified: t } = this.editor.getModel();
|
|
85
|
+
o.editor.setModelLanguage(e, this.language), o.editor.setModelLanguage(t, this.language);
|
|
66
86
|
} else
|
|
67
87
|
o.editor.setModelLanguage(this.editor.getModel(), this.language);
|
|
68
88
|
},
|
|
@@ -71,30 +91,59 @@ const m = {
|
|
|
71
91
|
},
|
|
72
92
|
style() {
|
|
73
93
|
this.$nextTick(() => {
|
|
74
|
-
var
|
|
75
|
-
(
|
|
94
|
+
var e;
|
|
95
|
+
(e = this.editor) == null || e.layout();
|
|
76
96
|
});
|
|
77
97
|
},
|
|
78
|
-
value(
|
|
79
|
-
this.editor &&
|
|
98
|
+
value(e) {
|
|
99
|
+
this.editor && e !== this._getValue() && this._setValue(e);
|
|
80
100
|
}
|
|
81
101
|
},
|
|
82
102
|
mounted() {
|
|
83
|
-
this.initMonaco();
|
|
103
|
+
this.initMonaco(), window.addEventListener("resize", this.onResize);
|
|
84
104
|
},
|
|
85
105
|
beforeDestroy() {
|
|
86
|
-
var
|
|
87
|
-
(
|
|
106
|
+
var e;
|
|
107
|
+
window.removeEventListener("resize", this.onResize), (e = this.editor) == null || e.dispose();
|
|
88
108
|
},
|
|
89
109
|
methods: {
|
|
90
110
|
initMonaco() {
|
|
91
|
-
const { value:
|
|
92
|
-
Object.assign(s, this._editorBeforeMount()), this.editor = o.editor[this.diffEditor ? "createDiffEditor" : "create"](this.$el,
|
|
93
|
-
value: typeof
|
|
94
|
-
language:
|
|
111
|
+
const { value: e, language: t, theme: i, readOnly: d, options: s } = this;
|
|
112
|
+
Object.assign(s, this._editorBeforeMount()), this.editor = o.editor[this.diffEditor ? "createDiffEditor" : "create"](this.$el, f({
|
|
113
|
+
value: typeof e == "string" ? e : g(e),
|
|
114
|
+
language: t,
|
|
95
115
|
theme: i,
|
|
96
|
-
readOnly:
|
|
97
|
-
}, s)), this.diffEditor && this._setModel(this.value, this.original), this._editorMounted(this.editor)
|
|
116
|
+
readOnly: d
|
|
117
|
+
}, s)), this.diffEditor && this._setModel(this.value, this.original), this._editorMounted(this.editor), this.editor.addAction({
|
|
118
|
+
id: "f1",
|
|
119
|
+
label: "full screen",
|
|
120
|
+
keybindings: [o.KeyCode.F1],
|
|
121
|
+
run: (r) => {
|
|
122
|
+
this.toggleFullScreen();
|
|
123
|
+
}
|
|
124
|
+
}), this.editor.addAction({
|
|
125
|
+
id: "escape",
|
|
126
|
+
label: "exit full screen",
|
|
127
|
+
keybindings: [o.KeyCode.Escape],
|
|
128
|
+
run: (r) => {
|
|
129
|
+
this.fullscreen = !1;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
},
|
|
133
|
+
toggleFullScreen() {
|
|
134
|
+
return a(this, null, function* () {
|
|
135
|
+
this.fullscreen = !this.fullscreen;
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
onResize() {
|
|
139
|
+
return a(this, null, function* () {
|
|
140
|
+
yield this.$nextTick();
|
|
141
|
+
const e = this.$el;
|
|
142
|
+
this.editor.layout({
|
|
143
|
+
width: e.clientWidth,
|
|
144
|
+
height: e.clientHeight
|
|
145
|
+
});
|
|
146
|
+
});
|
|
98
147
|
},
|
|
99
148
|
_handleFullScreen() {
|
|
100
149
|
this.isMaximum ? this.minEditor() : this.maxEditor();
|
|
@@ -102,17 +151,17 @@ const m = {
|
|
|
102
151
|
// 放大
|
|
103
152
|
maxEditor() {
|
|
104
153
|
this.isMaximum = !0;
|
|
105
|
-
const
|
|
154
|
+
const e = this.$el;
|
|
106
155
|
this.originSize = {
|
|
107
|
-
width:
|
|
108
|
-
height:
|
|
109
|
-
},
|
|
156
|
+
width: e.clientWidth,
|
|
157
|
+
height: e.clientHeight
|
|
158
|
+
}, e.classList.add("editor-fullscreen"), this.editor.layout({
|
|
110
159
|
height: document.body.clientHeight,
|
|
111
160
|
width: document.body.clientWidth
|
|
112
161
|
}), document.addEventListener("keyup", this.handleEsc);
|
|
113
162
|
},
|
|
114
|
-
handleEsc(
|
|
115
|
-
|
|
163
|
+
handleEsc(e) {
|
|
164
|
+
e.keyCode === 27 && this.minEditor();
|
|
116
165
|
},
|
|
117
166
|
// 缩小
|
|
118
167
|
minEditor() {
|
|
@@ -124,41 +173,41 @@ const m = {
|
|
|
124
173
|
_getEditor() {
|
|
125
174
|
return this.editor ? this.diffEditor ? this.editor.modifiedEditor : this.editor : null;
|
|
126
175
|
},
|
|
127
|
-
_setModel(
|
|
128
|
-
const { language: i } = this,
|
|
176
|
+
_setModel(e, t) {
|
|
177
|
+
const { language: i } = this, d = o.editor.createModel(t, i), s = o.editor.createModel(e, i);
|
|
129
178
|
this.editor.setModel({
|
|
130
|
-
original:
|
|
179
|
+
original: d,
|
|
131
180
|
modified: s
|
|
132
181
|
});
|
|
133
182
|
},
|
|
134
|
-
_setValue(
|
|
135
|
-
const
|
|
136
|
-
if (
|
|
183
|
+
_setValue(e) {
|
|
184
|
+
const t = this._getEditor();
|
|
185
|
+
if (t) return t.setValue(e);
|
|
137
186
|
},
|
|
138
187
|
_getValue() {
|
|
139
|
-
const
|
|
140
|
-
return
|
|
188
|
+
const e = this._getEditor();
|
|
189
|
+
return e ? e.getValue() : "";
|
|
141
190
|
},
|
|
142
191
|
_editorBeforeMount() {
|
|
143
192
|
return this.editorBeforeMount(o) || {};
|
|
144
193
|
},
|
|
145
|
-
_editorMounted(
|
|
146
|
-
this.editorMounted(
|
|
194
|
+
_editorMounted(e) {
|
|
195
|
+
this.editorMounted(e, o), this.diffEditor ? e.onDidUpdateDiff((t) => {
|
|
147
196
|
const i = this._getValue();
|
|
148
|
-
this._emitChange(i,
|
|
149
|
-
}) :
|
|
197
|
+
this._emitChange(i, t);
|
|
198
|
+
}) : e.onDidChangeModelContent((t) => {
|
|
150
199
|
const i = this._getValue();
|
|
151
|
-
this._emitChange(i,
|
|
200
|
+
this._emitChange(i, t);
|
|
152
201
|
});
|
|
153
202
|
},
|
|
154
|
-
_emitChange(
|
|
155
|
-
this.$emit("change",
|
|
203
|
+
_emitChange(e, t) {
|
|
204
|
+
this.$emit("change", e, t), this.$emit("input", e);
|
|
156
205
|
}
|
|
157
206
|
},
|
|
158
|
-
render(
|
|
159
|
-
const
|
|
160
|
-
return
|
|
161
|
-
|
|
207
|
+
render(e) {
|
|
208
|
+
const t = this.options.fullScreen;
|
|
209
|
+
return e("div", { class: ["monaco_editor_container", this.fullscreen ? "fullscreen" : ""], style: this.style }, [
|
|
210
|
+
t ? e("i", {
|
|
162
211
|
class: "el-icon-full-screen",
|
|
163
212
|
style: {
|
|
164
213
|
width: "1.2em",
|
|
@@ -173,16 +222,16 @@ const m = {
|
|
|
173
222
|
}) : ""
|
|
174
223
|
]);
|
|
175
224
|
}
|
|
176
|
-
},
|
|
177
|
-
var
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
225
|
+
}, w = null, x = null;
|
|
226
|
+
var S = /* @__PURE__ */ E(
|
|
227
|
+
v,
|
|
228
|
+
w,
|
|
229
|
+
x,
|
|
181
230
|
!1,
|
|
182
231
|
null,
|
|
183
232
|
null
|
|
184
233
|
);
|
|
185
|
-
const
|
|
234
|
+
const V = S.exports;
|
|
186
235
|
export {
|
|
187
|
-
|
|
236
|
+
V as default
|
|
188
237
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.monaco_editor_container.fullscreen{z-index:9999;background:#fff;width:100%;height:100%;position:fixed;top:0;left:0}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@web-utils/component",
|
|
3
3
|
"description": "Web Components",
|
|
4
|
-
"version": "3.7.
|
|
4
|
+
"version": "3.7.2",
|
|
5
5
|
"author": "Simple",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"bpmn-js-token-simulation": "^0.38.1",
|
|
25
25
|
"codemirror": "^5.65.15",
|
|
26
26
|
"countup.js": "^2.8.2",
|
|
27
|
+
"cronosjs": "^1.7.1",
|
|
27
28
|
"dayjs": "^1.11.13",
|
|
28
29
|
"diagram-js": "15.3.0",
|
|
29
30
|
"echarts": "^5.6.0",
|