halo-fe 1.0.28 → 1.0.29
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/main.js +536 -507
- package/esm/coms/pagers/index.d.ts +1 -1
- package/esm/drivers/https/IHttp.d.ts +1 -1
- package/esm/drivers/providers/implements/CookieProvider.d.ts +2 -1
- package/esm/drivers/providers/implements/IndexedDbProvider.d.ts +2 -2
- package/esm/drivers/providers/implements/StorageProvider.d.ts +2 -1
- package/esm/drivers/sockets/Socket.d.ts +15 -1
- package/esm/drivers/util/implements/JsonUtil.d.ts +9 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
var
|
2
|
-
var ut = (c, i, e) => i in c ?
|
1
|
+
var ot = Object.defineProperty;
|
2
|
+
var ut = (c, i, e) => i in c ? ot(c, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[i] = e;
|
3
3
|
var n = (c, i, e) => ut(c, typeof i != "symbol" ? i + "" : i, e);
|
4
|
-
import { reactive as _e, defineAsyncComponent as ct, watch as W, defineComponent as
|
4
|
+
import { reactive as _e, defineAsyncComponent as ct, watch as W, defineComponent as P, toRefs as z, openBlock as C, createElementBlock as T, createElementVNode as S, toDisplayString as N, unref as f, renderSlot as Q, createCommentVNode as ye, ref as H, onMounted as ae, onUnmounted as oe, normalizeStyle as ee, normalizeClass as ce, createTextVNode as Be, createBlock as Fe, withCtx as ue, mergeModels as Oe, useModel as Ne, nextTick as Ue, withDirectives as dt, createStaticVNode as pt, vShow as ht, createVNode as te, isRef as ve, Fragment as qe, renderList as Ve, computed as ge } from "vue";
|
5
5
|
import { L as gt } from "./assets/liquidjs-C2HVw1Ra.js";
|
6
6
|
import { _ as be } from "./assets/underscore-B0BCaBxV.js";
|
7
7
|
import { F as ft } from "./assets/file-saver-Cnua3zoa.js";
|
@@ -193,8 +193,8 @@ class vt extends We {
|
|
193
193
|
for (let r = 0; r < e.length; r++) {
|
194
194
|
let s = e[r], l = t[s.name];
|
195
195
|
if (l != null)
|
196
|
-
for (let
|
197
|
-
|
196
|
+
for (let a of l)
|
197
|
+
a[`Old_${s.key}`] = a[s.key];
|
198
198
|
}
|
199
199
|
return t;
|
200
200
|
});
|
@@ -218,10 +218,10 @@ class vt extends We {
|
|
218
218
|
updateTooltipByFields(e, t, r) {
|
219
219
|
if (r.length != 0)
|
220
220
|
for (let s of r) {
|
221
|
-
let l = s.control.tooltip,
|
221
|
+
let l = s.control.tooltip, a = `${e}.${s.name}.tooltip`;
|
222
222
|
for (let p of l.fields)
|
223
|
-
|
224
|
-
let
|
223
|
+
a += `.${t[p]}`;
|
224
|
+
let o = fe(a), u = d.json.deserialize(o);
|
225
225
|
u == null ? (l.title = null, l.content = null) : (l.title = u.title, l.content = d.json.serializeWithoutString(u.content));
|
226
226
|
}
|
227
227
|
}
|
@@ -233,25 +233,25 @@ class vt extends We {
|
|
233
233
|
if (e == null)
|
234
234
|
return [];
|
235
235
|
for (let s of e) {
|
236
|
-
for (let
|
237
|
-
let
|
238
|
-
if (
|
236
|
+
for (let a of s.fields) {
|
237
|
+
let o = (r = a.control.tooltip) == null ? void 0 : r.fields;
|
238
|
+
if (o != null && o.length > 0) {
|
239
239
|
let u = t[s.name];
|
240
240
|
for (let p of u)
|
241
|
-
this.updateTooltipByFields(s.name, p, [
|
241
|
+
this.updateTooltipByFields(s.name, p, [a]);
|
242
242
|
}
|
243
243
|
}
|
244
244
|
if (s.show != null) {
|
245
|
-
let
|
246
|
-
for (let
|
247
|
-
let u =
|
248
|
-
|
245
|
+
let a = [];
|
246
|
+
for (let o of s.show) {
|
247
|
+
let u = o.name ?? o, p = s.fields.find((h) => h.name == u);
|
248
|
+
a.push(p);
|
249
249
|
}
|
250
|
-
s.show =
|
250
|
+
s.show = a;
|
251
251
|
}
|
252
|
-
s.search = s.fields.filter((
|
252
|
+
s.search = s.fields.filter((a) => a.search != null);
|
253
253
|
let l = s.key.name ?? s.key;
|
254
|
-
s.key = s.fields.find((
|
254
|
+
s.key = s.fields.find((a) => a.name == l);
|
255
255
|
}
|
256
256
|
return e;
|
257
257
|
}
|
@@ -492,8 +492,8 @@ class Je extends Ke {
|
|
492
492
|
*/
|
493
493
|
n(this, "bindAsync", async (e) => {
|
494
494
|
for (let s of e) {
|
495
|
-
let
|
496
|
-
d.object.addProperties(this, [s.kind, s.type],
|
495
|
+
let a = await this.getAsync(s.kind, s.type) ?? s.content;
|
496
|
+
d.object.addProperties(this, [s.kind, s.type], a);
|
497
497
|
}
|
498
498
|
let t = this.sys.app, r = document.documentElement;
|
499
499
|
d.dom.removeClass(r, Qe.theme), d.dom.addClass(r, t.theme), d.mount.emit("theme", t.theme), d.dom.addClass(r, t.layout), this.setBackground(t.background), d.dom.addStyle(r, "font-family", t.font);
|
@@ -539,10 +539,10 @@ class Je extends Ke {
|
|
539
539
|
r.classList.remove(t.layout), r.classList.add(s), t.layout = s;
|
540
540
|
let l = e.theme;
|
541
541
|
d.dom.removeClass(r, t.theme), d.dom.addClass(r, l), t.theme = l, d.mount.emit("theme", l);
|
542
|
-
let
|
543
|
-
this.setBackground(
|
544
|
-
let
|
545
|
-
t.font =
|
542
|
+
let a = e.background;
|
543
|
+
this.setBackground(a), d.mount.emit("background", a);
|
544
|
+
let o = e.font;
|
545
|
+
t.font = o, d.dom.addStyle(r, "font-family", o);
|
546
546
|
}
|
547
547
|
//#region 配置
|
548
548
|
/**
|
@@ -815,7 +815,7 @@ class Ht extends D {
|
|
815
815
|
}
|
816
816
|
}
|
817
817
|
let kl = () => {
|
818
|
-
}, Qe = _e(new jt()), Z = new Je(), xl = _e(new Xe()), Al = new Et(), Le = new $t(),
|
818
|
+
}, Qe = _e(new jt()), Z = new Je(), xl = _e(new Xe()), Al = new Et(), Le = new $t(), Ot = new Dt();
|
819
819
|
class y {
|
820
820
|
//#endregion
|
821
821
|
//#region 驱动工厂
|
@@ -823,7 +823,7 @@ class y {
|
|
823
823
|
* Builder工厂
|
824
824
|
*/
|
825
825
|
static get builder() {
|
826
|
-
return this.create(
|
826
|
+
return this.create(Bt);
|
827
827
|
}
|
828
828
|
/**
|
829
829
|
* CDN工厂
|
@@ -964,7 +964,7 @@ class me {
|
|
964
964
|
n(this, "type");
|
965
965
|
}
|
966
966
|
}
|
967
|
-
class
|
967
|
+
class Ut extends me {
|
968
968
|
constructor() {
|
969
969
|
super(...arguments);
|
970
970
|
n(this, "type", "Json");
|
@@ -983,18 +983,18 @@ class Lt extends me {
|
|
983
983
|
}
|
984
984
|
insert(e) {
|
985
985
|
let { name: t, columns: r, rows: s } = e, l = "";
|
986
|
-
for (let
|
987
|
-
let
|
988
|
-
l += `db.${t}.insert(${u})`,
|
986
|
+
for (let a = 0; a < s.length; a++) {
|
987
|
+
let o = s[a], u = d.json.serialize(o, !0);
|
988
|
+
l += `db.${t}.insert(${u})`, a != s.length - 1 && (l += `\r
|
989
989
|
`);
|
990
990
|
}
|
991
991
|
return l;
|
992
992
|
}
|
993
993
|
update(e) {
|
994
|
-
let { name: t, columns: r, rows: s } = e, l = "",
|
995
|
-
for (let
|
996
|
-
let u = s[
|
997
|
-
l += `db.${t}.update(${h},{$set:${g})`,
|
994
|
+
let { name: t, columns: r, rows: s } = e, l = "", a = r.filter((o) => o.key).map((o) => o.name);
|
995
|
+
for (let o = 0; o < s.length; o++) {
|
996
|
+
let u = s[o], p = d.object.extract(u, a), h = d.json.serialize(p, !0), g = d.json.serialize(u, !0);
|
997
|
+
l += `db.${t}.update(${h},{$set:${g})`, o != s.length - 1 && (l += `\r
|
998
998
|
`);
|
999
999
|
}
|
1000
1000
|
return l;
|
@@ -1016,7 +1016,7 @@ class Ce {
|
|
1016
1016
|
}
|
1017
1017
|
//#endregion
|
1018
1018
|
}
|
1019
|
-
const
|
1019
|
+
const le = class le extends Ce {
|
1020
1020
|
constructor() {
|
1021
1021
|
super(...arguments);
|
1022
1022
|
//#region 属性
|
@@ -1057,8 +1057,8 @@ const te = class te extends Ce {
|
|
1057
1057
|
return await super.openAsync(e), new Promise((t, r) => {
|
1058
1058
|
let s = indexedDB.open(this.database);
|
1059
1059
|
s.onsuccess = (l) => {
|
1060
|
-
let
|
1061
|
-
|
1060
|
+
let a = l.target.result;
|
1061
|
+
le.version = a.version, this.objectStoreNames = a.objectStoreNames, t();
|
1062
1062
|
}, s.onerror = (l) => {
|
1063
1063
|
r(l.target);
|
1064
1064
|
};
|
@@ -1069,10 +1069,10 @@ const te = class te extends Ce {
|
|
1069
1069
|
*/
|
1070
1070
|
async createAsync(e) {
|
1071
1071
|
return e == null ? Promise.resolve() : this.objectStoreNames.contains(e) ? Promise.resolve(!0) : new Promise((t, r) => {
|
1072
|
-
let s = indexedDB.open(this.database, ++
|
1072
|
+
let s = indexedDB.open(this.database, ++le.version);
|
1073
1073
|
s.onupgradeneeded = (l) => {
|
1074
|
-
let
|
1075
|
-
|
1074
|
+
let a = l.target.result;
|
1075
|
+
a.objectStoreNames.contains(e) || a.createObjectStore(e);
|
1076
1076
|
}, s.onsuccess = (l) => {
|
1077
1077
|
t(l);
|
1078
1078
|
}, s.onerror = (l) => {
|
@@ -1085,7 +1085,7 @@ const te = class te extends Ce {
|
|
1085
1085
|
*/
|
1086
1086
|
async openDbAsync() {
|
1087
1087
|
return new Promise((e, t) => {
|
1088
|
-
let r = indexedDB.open(this.database,
|
1088
|
+
let r = indexedDB.open(this.database, le.version);
|
1089
1089
|
r.onsuccess = (s) => {
|
1090
1090
|
let l = s.target.result;
|
1091
1091
|
e(l);
|
@@ -1099,12 +1099,12 @@ const te = class te extends Ce {
|
|
1099
1099
|
*/
|
1100
1100
|
async openTransAsync(e, t, r) {
|
1101
1101
|
return new Promise((s, l) => {
|
1102
|
-
let
|
1103
|
-
|
1102
|
+
let a = r.transaction(e, t);
|
1103
|
+
a.oncomplete = (o) => {
|
1104
1104
|
r.close();
|
1105
|
-
},
|
1106
|
-
l(
|
1107
|
-
}, s(
|
1105
|
+
}, a.onerror = (o) => {
|
1106
|
+
l(o);
|
1107
|
+
}, s(a);
|
1108
1108
|
});
|
1109
1109
|
}
|
1110
1110
|
//#endregion
|
@@ -1127,12 +1127,12 @@ const te = class te extends Ce {
|
|
1127
1127
|
});
|
1128
1128
|
}
|
1129
1129
|
async getKeysAsync(e) {
|
1130
|
-
return e == null ? Promise.resolve() : new Promise(async (t, r) => {
|
1131
|
-
let s = await this.openDbAsync(),
|
1132
|
-
|
1130
|
+
return e == null ? Promise.resolve([]) : new Promise(async (t, r) => {
|
1131
|
+
let s = await this.openDbAsync(), o = (await this.openTransAsync(e, "readonly", s)).objectStore(e).getAllKeys();
|
1132
|
+
o.onsuccess = (u) => {
|
1133
1133
|
let p = u.target.result;
|
1134
1134
|
t(p);
|
1135
|
-
},
|
1135
|
+
}, o.onerror = (u) => {
|
1136
1136
|
r(u.target);
|
1137
1137
|
};
|
1138
1138
|
});
|
@@ -1146,14 +1146,14 @@ const te = class te extends Ce {
|
|
1146
1146
|
if (t == null || Object.is(t, NaN))
|
1147
1147
|
return;
|
1148
1148
|
let s = await this.openDbAsync();
|
1149
|
-
return new Promise(async (l,
|
1149
|
+
return new Promise(async (l, a) => {
|
1150
1150
|
let p = (await this.openTransAsync(e, "readwrite", s)).objectStore(e).add(r, t);
|
1151
1151
|
p.onsuccess = (h) => {
|
1152
1152
|
let g = h.target.result;
|
1153
1153
|
l(g);
|
1154
1154
|
}, p.onerror = (h) => {
|
1155
1155
|
let g = h.target.error;
|
1156
|
-
|
1156
|
+
a(g.message);
|
1157
1157
|
};
|
1158
1158
|
});
|
1159
1159
|
}
|
@@ -1174,14 +1174,14 @@ const te = class te extends Ce {
|
|
1174
1174
|
if (t == null || Object.is(t, NaN))
|
1175
1175
|
return;
|
1176
1176
|
let s = await this.openDbAsync();
|
1177
|
-
return new Promise(async (l,
|
1178
|
-
let
|
1177
|
+
return new Promise(async (l, a) => {
|
1178
|
+
let o = await this.openTransAsync(e, "readwrite", s), u = d.object.clone(r), h = o.objectStore(e).put(u, t);
|
1179
1179
|
h.onsuccess = (g) => {
|
1180
1180
|
let m = g.target.result;
|
1181
1181
|
l(m);
|
1182
1182
|
}, h.onerror = (g) => {
|
1183
1183
|
let m = g.target.error;
|
1184
|
-
|
1184
|
+
a(m.message);
|
1185
1185
|
};
|
1186
1186
|
});
|
1187
1187
|
}
|
@@ -1202,8 +1202,8 @@ const te = class te extends Ce {
|
|
1202
1202
|
/**
|
1203
1203
|
* 静态版本,保证所有数据库实例拿到最新版本信息
|
1204
1204
|
*/
|
1205
|
-
n(
|
1206
|
-
let ke =
|
1205
|
+
n(le, "version", null);
|
1206
|
+
let ke = le;
|
1207
1207
|
class Rt extends Ce {
|
1208
1208
|
constructor() {
|
1209
1209
|
super(...arguments);
|
@@ -1231,7 +1231,7 @@ class Rt extends Ce {
|
|
1231
1231
|
//#endregion
|
1232
1232
|
//#region 开启
|
1233
1233
|
openAsync(e) {
|
1234
|
-
return Promise.resolve(
|
1234
|
+
return Promise.resolve();
|
1235
1235
|
}
|
1236
1236
|
//#endregion
|
1237
1237
|
//#region 创建
|
@@ -1240,6 +1240,9 @@ class Rt extends Ce {
|
|
1240
1240
|
}
|
1241
1241
|
//#endregion
|
1242
1242
|
//#region 查询
|
1243
|
+
getKeysAsync(e) {
|
1244
|
+
return Promise.resolve([]);
|
1245
|
+
}
|
1243
1246
|
async getAsync(e, t) {
|
1244
1247
|
return localStorage.getItem(t);
|
1245
1248
|
}
|
@@ -1284,9 +1287,12 @@ class It extends Ce {
|
|
1284
1287
|
//#endregion
|
1285
1288
|
//#region 开启
|
1286
1289
|
openAsync(e) {
|
1287
|
-
return Promise.resolve(
|
1290
|
+
return Promise.resolve();
|
1288
1291
|
}
|
1289
1292
|
//#endregion
|
1293
|
+
getKeysAsync(e) {
|
1294
|
+
return Promise.resolve([]);
|
1295
|
+
}
|
1290
1296
|
createAsync(e) {
|
1291
1297
|
return Promise.resolve(void 0);
|
1292
1298
|
}
|
@@ -1371,32 +1377,32 @@ class xe extends me {
|
|
1371
1377
|
n(this, "type", "Sql");
|
1372
1378
|
}
|
1373
1379
|
insert(e) {
|
1374
|
-
let { name: t, columns: r, rows: s } = e, l = e.getIdentity(),
|
1380
|
+
let { name: t, columns: r, rows: s } = e, l = e.getIdentity(), a = "", p = r.filter((h) => !h.identity).map((h) => Re.getSqlName(h.name)).join(", ");
|
1375
1381
|
for (let h = 0; h < s.length; h++) {
|
1376
1382
|
let g = s[h];
|
1377
|
-
|
1378
|
-
`,
|
1379
|
-
`,
|
1380
|
-
`,
|
1383
|
+
a += `INSERT INTO ${t}\r
|
1384
|
+
`, a += `(${p})\r
|
1385
|
+
`, a += `VALUES\r
|
1386
|
+
`, a += "(";
|
1381
1387
|
let m = Object.keys(g);
|
1382
1388
|
for (let k = 0; k < m.length; k++) {
|
1383
|
-
let
|
1384
|
-
if (l != null && l.name ==
|
1389
|
+
let U = m[k];
|
1390
|
+
if (l != null && l.name == U)
|
1385
1391
|
continue;
|
1386
|
-
let
|
1387
|
-
|
1392
|
+
let B = g[U];
|
1393
|
+
a += `${Re.getValue(B)}`, k != m.length - 1 && (a += ", ");
|
1388
1394
|
}
|
1389
|
-
|
1395
|
+
a += ")", h != s.length - 1 && (a += `\r
|
1390
1396
|
\r
|
1391
1397
|
`);
|
1392
1398
|
}
|
1393
|
-
return
|
1399
|
+
return a;
|
1394
1400
|
}
|
1395
1401
|
update(e) {
|
1396
1402
|
return "";
|
1397
1403
|
}
|
1398
1404
|
}
|
1399
|
-
class
|
1405
|
+
class Pt extends me {
|
1400
1406
|
constructor() {
|
1401
1407
|
super(...arguments);
|
1402
1408
|
n(this, "type", "MySql");
|
@@ -1408,16 +1414,16 @@ class Bt extends me {
|
|
1408
1414
|
return new xe().update(e);
|
1409
1415
|
}
|
1410
1416
|
}
|
1411
|
-
class
|
1417
|
+
class Bt extends D {
|
1412
1418
|
constructor() {
|
1413
1419
|
super(...arguments);
|
1414
1420
|
n(this, "type", "Builder");
|
1415
1421
|
}
|
1416
1422
|
open() {
|
1417
1423
|
super.open(), super.register({
|
1418
|
-
Json:
|
1424
|
+
Json: Ut,
|
1419
1425
|
Mongo: Lt,
|
1420
|
-
MySql:
|
1426
|
+
MySql: Pt,
|
1421
1427
|
Sql: xe
|
1422
1428
|
});
|
1423
1429
|
}
|
@@ -1456,12 +1462,12 @@ class Ye {
|
|
1456
1462
|
n(this, "loadAsync", async (i) => {
|
1457
1463
|
let e = d.string.getArray(i), t = [];
|
1458
1464
|
for (let s of e) {
|
1459
|
-
let l = new Promise((
|
1465
|
+
let l = new Promise((a, o) => {
|
1460
1466
|
let u = d.dom.getByUrl(s);
|
1461
|
-
u != null ?
|
1462
|
-
|
1467
|
+
u != null ? a(u) : (u = d.dom.createByUrl(s), document.head.appendChild(u), u.onload = (p) => {
|
1468
|
+
a(u);
|
1463
1469
|
}, u.onerror = (p) => {
|
1464
|
-
|
1470
|
+
o(p);
|
1465
1471
|
let h;
|
1466
1472
|
throw p instanceof Event ? h = `${p.type}, 耗时: ${p.timeStamp}` : h = p, new Error(`脚本: ${s} 加载出错: ${h}`);
|
1467
1473
|
});
|
@@ -1493,10 +1499,10 @@ class Ye {
|
|
1493
1499
|
if (window.monaco)
|
1494
1500
|
return Promise.resolve();
|
1495
1501
|
await new Promise(async (s, l) => {
|
1496
|
-
let
|
1497
|
-
await this.loadFilesAsync(i,
|
1498
|
-
let
|
1499
|
-
|
1502
|
+
let a = ["/loader.js"];
|
1503
|
+
await this.loadFilesAsync(i, a);
|
1504
|
+
let o = window.require;
|
1505
|
+
o.config({ paths: { vs: i } }), o(["vs/editor/editor.main"], (u) => {
|
1500
1506
|
s(u);
|
1501
1507
|
});
|
1502
1508
|
});
|
@@ -1664,7 +1670,7 @@ class Vt extends Ge {
|
|
1664
1670
|
//#endregion
|
1665
1671
|
//#region 开启
|
1666
1672
|
async openAsync(e) {
|
1667
|
-
this.crypto = await
|
1673
|
+
this.crypto = await se.getCrypto();
|
1668
1674
|
}
|
1669
1675
|
//#endregion
|
1670
1676
|
encodeString(e) {
|
@@ -1731,7 +1737,7 @@ class Jt extends Kt {
|
|
1731
1737
|
//#endregion
|
1732
1738
|
//#region 开启
|
1733
1739
|
async openAsync(e) {
|
1734
|
-
this.xlsx = await
|
1740
|
+
this.xlsx = await se.getXlsx();
|
1735
1741
|
}
|
1736
1742
|
//#endregion
|
1737
1743
|
export(e, t) {
|
@@ -1750,12 +1756,12 @@ class Jt extends Kt {
|
|
1750
1756
|
m.push(g[k]);
|
1751
1757
|
}), s.push(m);
|
1752
1758
|
}
|
1753
|
-
let
|
1754
|
-
this.xlsx.utils.book_append_sheet(
|
1759
|
+
let a = this.xlsx.utils.book_new(), o = this.xlsx.utils.json_to_sheet(s, { skipHeader: !0 });
|
1760
|
+
this.xlsx.utils.book_append_sheet(a, o, "abc");
|
1755
1761
|
let u = 65;
|
1756
1762
|
for (let h = 0; h < r.length; h++) {
|
1757
1763
|
let m = `${String.fromCharCode(u + h)}1`;
|
1758
|
-
|
1764
|
+
o[m].s = {
|
1759
1765
|
alignment: { horizontal: "center" },
|
1760
1766
|
font: { bold: !0, color: { rgb: "000000" } },
|
1761
1767
|
fill: { fgColor: { rgb: "409eff" } }
|
@@ -1765,7 +1771,7 @@ class Jt extends Kt {
|
|
1765
1771
|
r.forEach((h) => {
|
1766
1772
|
let g = e[0][h], m = { wpx: 50 };
|
1767
1773
|
typeof g == "string" && (m.wpx = 100), p.push(m);
|
1768
|
-
}),
|
1774
|
+
}), o["!cols"] = p, this.xlsx.writeFile(a, t);
|
1769
1775
|
}
|
1770
1776
|
}
|
1771
1777
|
class Xt extends D {
|
@@ -1831,8 +1837,8 @@ class Zt extends Te {
|
|
1831
1837
|
resort(e, t, r) {
|
1832
1838
|
let s = r[e.name];
|
1833
1839
|
for (let l = 0; l < s.length; l++) {
|
1834
|
-
let
|
1835
|
-
|
1840
|
+
let a = s[l];
|
1841
|
+
a[t.name] = (l + 1) * 10;
|
1836
1842
|
}
|
1837
1843
|
}
|
1838
1844
|
}
|
@@ -1893,7 +1899,7 @@ class sr extends Ze {
|
|
1893
1899
|
//#endregion
|
1894
1900
|
n(this, "compute", async (e) => {
|
1895
1901
|
let r = new TextEncoder().encode(e), s = await crypto.subtle.digest("SHA-256", r);
|
1896
|
-
return Array.from(new Uint8Array(s)).map((
|
1902
|
+
return Array.from(new Uint8Array(s)).map((o) => o.toString(16).padStart(2, "0")).join("");
|
1897
1903
|
});
|
1898
1904
|
}
|
1899
1905
|
//#endregion
|
@@ -1916,7 +1922,7 @@ class lr extends Ze {
|
|
1916
1922
|
//#endregion
|
1917
1923
|
//#region 开启
|
1918
1924
|
async openAsync(e) {
|
1919
|
-
this.crypto = await
|
1925
|
+
this.crypto = await se.getCrypto();
|
1920
1926
|
}
|
1921
1927
|
}
|
1922
1928
|
class nr extends D {
|
@@ -2132,7 +2138,7 @@ class Ie extends et {
|
|
2132
2138
|
n(this, "request");
|
2133
2139
|
}
|
2134
2140
|
}
|
2135
|
-
class
|
2141
|
+
class ar extends Ee {
|
2136
2142
|
constructor() {
|
2137
2143
|
super(...arguments);
|
2138
2144
|
//#region 属性
|
@@ -2150,8 +2156,8 @@ class or extends Ee {
|
|
2150
2156
|
if (t.status == 0)
|
2151
2157
|
t.message = `网络异常,请检查接口访问是否正常: ${e.method} ${e.url} ${l}`;
|
2152
2158
|
else {
|
2153
|
-
let
|
2154
|
-
t.message = `接口加载异常: ${e.method}${
|
2159
|
+
let a = t.status ? `(${t.status})` : "";
|
2160
|
+
t.message = `接口加载异常: ${e.method}${a} ${e.url} ${l}`;
|
2155
2161
|
}
|
2156
2162
|
}
|
2157
2163
|
return await ((s = this.onResponse) == null ? void 0 : s.call(this, t)), t;
|
@@ -2198,28 +2204,28 @@ class or extends Ee {
|
|
2198
2204
|
return t.request = e, t.id = e.id, new Promise(async (r, s) => {
|
2199
2205
|
let l = new XMLHttpRequest();
|
2200
2206
|
if (l.open(e.method, e.url), e.headers != null)
|
2201
|
-
for (let
|
2202
|
-
let
|
2203
|
-
l.setRequestHeader(
|
2207
|
+
for (let a in e.headers) {
|
2208
|
+
let o = e.headers[a];
|
2209
|
+
l.setRequestHeader(a, o);
|
2204
2210
|
}
|
2205
2211
|
l.onreadystatechange = async () => {
|
2206
2212
|
if (l.readyState == 4) {
|
2207
2213
|
t.status = l.status, t.body = l.responseText;
|
2208
|
-
let
|
2209
|
-
`),
|
2210
|
-
for (let u = 0; u <
|
2211
|
-
let p =
|
2212
|
-
h == null || h == "" || (
|
2214
|
+
let a = l.getAllResponseHeaders().split(`\r
|
2215
|
+
`), o = {};
|
2216
|
+
for (let u = 0; u < a.length; u++) {
|
2217
|
+
let p = a[u].split(": "), h = p.shift();
|
2218
|
+
h == null || h == "" || (o[h] = p.join(": "));
|
2213
2219
|
}
|
2214
|
-
t.headers =
|
2220
|
+
t.headers = o, t.contentType = t.getHeader("content-type"), t.ok = l.status == 200, r(t);
|
2215
2221
|
}
|
2216
|
-
}, l.onerror = async (
|
2217
|
-
t.ok = !1, t.message =
|
2222
|
+
}, l.onerror = async (a) => {
|
2223
|
+
t.ok = !1, t.message = a.type, t.status = l.status, t.body = l.responseText, r(t);
|
2218
2224
|
}, l.send(e.body);
|
2219
2225
|
});
|
2220
2226
|
}
|
2221
2227
|
}
|
2222
|
-
class
|
2228
|
+
class or extends Ee {
|
2223
2229
|
constructor() {
|
2224
2230
|
super(...arguments);
|
2225
2231
|
//#region 属性
|
@@ -2263,12 +2269,12 @@ class ar extends Ee {
|
|
2263
2269
|
let l = d.url.deserialize(e.path);
|
2264
2270
|
for (let g in l)
|
2265
2271
|
s[g] = l[g];
|
2266
|
-
let
|
2272
|
+
let a = d.url.getPath(e.path);
|
2267
2273
|
s = d.dictionary.sort(s);
|
2268
|
-
let
|
2274
|
+
let o = d.sign.signDictionary(s, !1), u = `POST${a}?${o}${this.appSecret}`, p = await this.hasher.compute(u);
|
2269
2275
|
s.sign = p.toLowerCase(), delete s.jsonBody, s = d.dictionary.sort(s);
|
2270
2276
|
let h = d.url.serialize(s);
|
2271
|
-
e.url = d.url.concatUrl(this.baseUrl,
|
2277
|
+
e.url = d.url.concatUrl(this.baseUrl, a + "?" + h);
|
2272
2278
|
});
|
2273
2279
|
}
|
2274
2280
|
}
|
@@ -2319,8 +2325,8 @@ class ur extends Ee {
|
|
2319
2325
|
if (this.user == null)
|
2320
2326
|
r = this.platform;
|
2321
2327
|
else {
|
2322
|
-
let l = d.time.getTimestamp(),
|
2323
|
-
r = this.sso.getAuth(this.user.identity.token, l,
|
2328
|
+
let l = d.time.getTimestamp(), a = await this.signer.getSign(this.user.userId, e.url, e.body, l, this.user.secret);
|
2329
|
+
r = this.sso.getAuth(this.user.identity.token, l, a, this.platform, this.env);
|
2324
2330
|
}
|
2325
2331
|
let s = {};
|
2326
2332
|
s.Authorization = r, e.getHeader("Accept-Language") || (s["Accept-Language"] = this.language), e.addHeaders(s);
|
@@ -2345,8 +2351,8 @@ class cr extends D {
|
|
2345
2351
|
}
|
2346
2352
|
open() {
|
2347
2353
|
super.open(), super.register({
|
2348
|
-
Default:
|
2349
|
-
Mk:
|
2354
|
+
Default: ar,
|
2355
|
+
Mk: or,
|
2350
2356
|
Halo: ur
|
2351
2357
|
});
|
2352
2358
|
}
|
@@ -2465,21 +2471,21 @@ class pr extends dr {
|
|
2465
2471
|
e == null && (e = this.lang);
|
2466
2472
|
let t = new Promise(async (s) => {
|
2467
2473
|
let l = { conditions: [{ name: "lang", value: e }] };
|
2468
|
-
return _.post("/i18n/set", l).then(({ data:
|
2469
|
-
for (let
|
2470
|
-
let u = `${e}.${
|
2471
|
-
d.object.addProperties(this.messages, u,
|
2474
|
+
return _.post("/i18n/set", l).then(({ data: a }) => {
|
2475
|
+
for (let o of a) {
|
2476
|
+
let u = `${e}.${o.Kind}.${o.Key}`.split(".");
|
2477
|
+
d.object.addProperties(this.messages, u, o.Value);
|
2472
2478
|
}
|
2473
|
-
s(
|
2479
|
+
s(a);
|
2474
2480
|
});
|
2475
2481
|
}), r = new Promise((s) => {
|
2476
2482
|
let l = { conditions: [{ name: "lang", value: e }] };
|
2477
|
-
_.post("/i18n_business/set", l).then(({ data:
|
2478
|
-
for (let
|
2479
|
-
let u = `${e}._business.${
|
2480
|
-
d.object.addProperties(this.messages, u,
|
2483
|
+
_.post("/i18n_business/set", l).then(({ data: a }) => {
|
2484
|
+
for (let o of a) {
|
2485
|
+
let u = `${e}._business.${o.Table}.${o.Field}.${o.Key}`.split(".");
|
2486
|
+
d.object.addProperties(this.messages, u, o.Value);
|
2481
2487
|
}
|
2482
|
-
s(
|
2488
|
+
s(a);
|
2483
2489
|
});
|
2484
2490
|
});
|
2485
2491
|
await Promise.all([t, r]);
|
@@ -2562,8 +2568,8 @@ class vr extends mr {
|
|
2562
2568
|
super(...arguments);
|
2563
2569
|
n(this, "type", "Default");
|
2564
2570
|
n(this, "getSign", async (e, t, r, s, l) => {
|
2565
|
-
let
|
2566
|
-
return (await it.compute(
|
2571
|
+
let o = `${e}.${t}.${r ?? ""}.${s}.${l}`;
|
2572
|
+
return (await it.compute(o)).toUpperCase();
|
2567
2573
|
});
|
2568
2574
|
}
|
2569
2575
|
async openAsync(e) {
|
@@ -2597,6 +2603,18 @@ class br extends D {
|
|
2597
2603
|
class wr {
|
2598
2604
|
constructor() {
|
2599
2605
|
//#region 属性
|
2606
|
+
/**
|
2607
|
+
* 类型
|
2608
|
+
*/
|
2609
|
+
n(this, "type");
|
2610
|
+
/**
|
2611
|
+
* 是否已连接(空表示不需连接)
|
2612
|
+
*/
|
2613
|
+
n(this, "connected");
|
2614
|
+
/**
|
2615
|
+
* Socket消息处理程序
|
2616
|
+
*/
|
2617
|
+
n(this, "handler");
|
2600
2618
|
/**
|
2601
2619
|
* 已订阅的消息类型列表
|
2602
2620
|
*/
|
@@ -2605,7 +2623,7 @@ class wr {
|
|
2605
2623
|
//#endregion
|
2606
2624
|
//#region 开启
|
2607
2625
|
openAsync(i) {
|
2608
|
-
d.json.mergeTo(this, i);
|
2626
|
+
return d.json.mergeTo(this, i), Promise.resolve();
|
2609
2627
|
}
|
2610
2628
|
//#endregion
|
2611
2629
|
//#region 订阅
|
@@ -2614,8 +2632,8 @@ class wr {
|
|
2614
2632
|
await this.send(s);
|
2615
2633
|
let l = this.subscribed[i];
|
2616
2634
|
l == null && (l = {}, this.subscribed[i] = l);
|
2617
|
-
let
|
2618
|
-
|
2635
|
+
let a = l[e];
|
2636
|
+
a == null && (a = [], l[e] = a), a.push(...r);
|
2619
2637
|
}
|
2620
2638
|
async resubscribe() {
|
2621
2639
|
let i = Object.keys(this.subscribed);
|
@@ -2623,8 +2641,8 @@ class wr {
|
|
2623
2641
|
for (let e of i) {
|
2624
2642
|
let t = this.subscribed[e], r = Object.keys(t);
|
2625
2643
|
for (let s of r) {
|
2626
|
-
let l = t[s],
|
2627
|
-
await this.send(
|
2644
|
+
let l = t[s], a = { kind: "socket", type: "subscribe", data: { win: e, kind: s, types: l } };
|
2645
|
+
await this.send(a);
|
2628
2646
|
}
|
2629
2647
|
}
|
2630
2648
|
}
|
@@ -2632,6 +2650,8 @@ class wr {
|
|
2632
2650
|
let e = { kind: "socket", type: "unsubscribe", data: { win: i } };
|
2633
2651
|
await this.send(e), delete this.subscribed[i];
|
2634
2652
|
}
|
2653
|
+
dispose() {
|
2654
|
+
}
|
2635
2655
|
}
|
2636
2656
|
class kr extends wr {
|
2637
2657
|
constructor() {
|
@@ -2738,13 +2758,13 @@ class _l {
|
|
2738
2758
|
* 增加成功进度
|
2739
2759
|
*/
|
2740
2760
|
success(i) {
|
2741
|
-
this.
|
2761
|
+
this.succeed++, this.handled++, this.current = i;
|
2742
2762
|
}
|
2743
2763
|
/**
|
2744
2764
|
* 增加异常进度
|
2745
2765
|
*/
|
2746
2766
|
error(i, e) {
|
2747
|
-
this.
|
2767
|
+
this.errored++, this.handled++, this.current = i;
|
2748
2768
|
}
|
2749
2769
|
}
|
2750
2770
|
class Cl {
|
@@ -2924,7 +2944,7 @@ class Tr extends Cr {
|
|
2924
2944
|
return "";
|
2925
2945
|
}
|
2926
2946
|
async getUser() {
|
2927
|
-
let e = await this.provider.getAsync("anonymous");
|
2947
|
+
let e = await this.provider.getAsync("user", "anonymous");
|
2928
2948
|
if (!e) {
|
2929
2949
|
let r = d.string.getUniqueId();
|
2930
2950
|
await this.provider.saveAsync("anonymous", "anonymous", r), e = r;
|
@@ -2992,7 +3012,7 @@ class $r extends D {
|
|
2992
3012
|
* 获取指定SSO实例
|
2993
3013
|
*/
|
2994
3014
|
async createAsync(e, t) {
|
2995
|
-
let r = Qe.ssos.find((
|
3015
|
+
let r = Qe.ssos.find((a) => a.type.toUpperCase() == e.toUpperCase()), s = { url: r == null ? void 0 : r.url, app_id: r == null ? void 0 : r.appId }, l = await super.createAsync(e);
|
2996
3016
|
return await l.openAsync(s), l;
|
2997
3017
|
}
|
2998
3018
|
}
|
@@ -3033,7 +3053,7 @@ class Dr extends jr {
|
|
3033
3053
|
async execute(e, t, r) {
|
3034
3054
|
if (e.length == 0)
|
3035
3055
|
return;
|
3036
|
-
let s = d.array.getChunksByCount(e, t), l = d.array.create(s, (
|
3056
|
+
let s = d.array.getChunksByCount(e, t), l = d.array.create(s, (a, o) => r(a, o));
|
3037
3057
|
await Promise.all(l);
|
3038
3058
|
}
|
3039
3059
|
async frequency(e, t, r, s) {
|
@@ -3079,12 +3099,12 @@ class Hr extends D {
|
|
3079
3099
|
});
|
3080
3100
|
}
|
3081
3101
|
}
|
3082
|
-
class
|
3102
|
+
class Or {
|
3083
3103
|
constructor() {
|
3084
3104
|
n(this, "type");
|
3085
3105
|
}
|
3086
3106
|
}
|
3087
|
-
class
|
3107
|
+
class Ur extends Or {
|
3088
3108
|
constructor() {
|
3089
3109
|
super(...arguments);
|
3090
3110
|
n(this, "type", "Liquid");
|
@@ -3101,7 +3121,7 @@ class Lr extends D {
|
|
3101
3121
|
}
|
3102
3122
|
open() {
|
3103
3123
|
super.open(), super.register({
|
3104
|
-
Liquid:
|
3124
|
+
Liquid: Ur
|
3105
3125
|
});
|
3106
3126
|
}
|
3107
3127
|
}
|
@@ -3115,8 +3135,8 @@ class Rr extends D {
|
|
3115
3135
|
Array: Ir,
|
3116
3136
|
Browser: rs,
|
3117
3137
|
Component: Mr,
|
3118
|
-
Dictionary:
|
3119
|
-
Dom:
|
3138
|
+
Dictionary: Br,
|
3139
|
+
Dom: Pr,
|
3120
3140
|
Event: Fr,
|
3121
3141
|
File: Nr,
|
3122
3142
|
Html: qr,
|
@@ -3199,12 +3219,12 @@ class Rr extends D {
|
|
3199
3219
|
return super.createWithCache("sign");
|
3200
3220
|
}
|
3201
3221
|
}
|
3202
|
-
class
|
3222
|
+
class O {
|
3203
3223
|
constructor() {
|
3204
3224
|
n(this, "type");
|
3205
3225
|
}
|
3206
3226
|
}
|
3207
|
-
class Ir extends
|
3227
|
+
class Ir extends O {
|
3208
3228
|
constructor() {
|
3209
3229
|
super(...arguments);
|
3210
3230
|
n(this, "type", "array");
|
@@ -3232,11 +3252,11 @@ class Ir extends U {
|
|
3232
3252
|
n(this, "except", (e, t, r = null) => {
|
3233
3253
|
let s = t instanceof Array ? t : [t], l = [];
|
3234
3254
|
if (r == null)
|
3235
|
-
l = e.filter((
|
3255
|
+
l = e.filter((a) => s.indexOf(a) == -1);
|
3236
3256
|
else
|
3237
|
-
for (let
|
3238
|
-
let
|
3239
|
-
s.find((p) => r(
|
3257
|
+
for (let a = 0; a < e.length; a++) {
|
3258
|
+
let o = e[a];
|
3259
|
+
s.find((p) => r(o, p)) || l.push(o);
|
3240
3260
|
}
|
3241
3261
|
return l;
|
3242
3262
|
});
|
@@ -3262,8 +3282,8 @@ class Ir extends U {
|
|
3262
3282
|
*/
|
3263
3283
|
n(this, "sum", (e, t, r = null) => {
|
3264
3284
|
let s = 0;
|
3265
|
-
for (let
|
3266
|
-
s += t(e[
|
3285
|
+
for (let a = 0; a < e.length; a++)
|
3286
|
+
s += t(e[a]);
|
3267
3287
|
return r == null ? s : parseFloat(s.toFixed(r));
|
3268
3288
|
});
|
3269
3289
|
//#endregion
|
@@ -3280,11 +3300,11 @@ class Ir extends U {
|
|
3280
3300
|
if (!r)
|
3281
3301
|
return e;
|
3282
3302
|
for (let l = 0; l < e.length; l++) {
|
3283
|
-
let
|
3284
|
-
if (
|
3285
|
-
for (let
|
3286
|
-
let u = t[
|
3287
|
-
|
3303
|
+
let a = e[l];
|
3304
|
+
if (a)
|
3305
|
+
for (let o = 0; o < t.length; o++) {
|
3306
|
+
let u = t[o];
|
3307
|
+
a[u].toString().toUpperCase().includes(r.toUpperCase()) && s.push(a);
|
3288
3308
|
}
|
3289
3309
|
}
|
3290
3310
|
return s;
|
@@ -3319,9 +3339,9 @@ class Ir extends U {
|
|
3319
3339
|
if (!e || e.length == 0 || !t || t.length == 0)
|
3320
3340
|
return [];
|
3321
3341
|
let l = [];
|
3322
|
-
return e.forEach((
|
3323
|
-
let
|
3324
|
-
|
3342
|
+
return e.forEach((a) => {
|
3343
|
+
let o = t.find((u) => u[r] == a);
|
3344
|
+
o || (o = { [r]: a, [s]: a }), l.push(o);
|
3325
3345
|
}), l;
|
3326
3346
|
});
|
3327
3347
|
//#endregion
|
@@ -3344,15 +3364,15 @@ class Ir extends U {
|
|
3344
3364
|
n(this, "combine", (...e) => {
|
3345
3365
|
let t = [], r = be.max(e, (s) => s.length);
|
3346
3366
|
for (let s = 0; s < r.length; s++) {
|
3347
|
-
let l = [],
|
3348
|
-
for (let
|
3349
|
-
let u = e[
|
3350
|
-
u != null && (
|
3367
|
+
let l = [], a;
|
3368
|
+
for (let o = 0; o < e.length; o++) {
|
3369
|
+
let u = e[o][s];
|
3370
|
+
u != null && (a = u);
|
3351
3371
|
break;
|
3352
3372
|
}
|
3353
|
-
for (let
|
3354
|
-
let u = e[
|
3355
|
-
u != null ? l.push(u) : l.push(
|
3373
|
+
for (let o = 0; o < e.length; o++) {
|
3374
|
+
let u = e[o][s];
|
3375
|
+
u != null ? l.push(u) : l.push(a);
|
3356
3376
|
}
|
3357
3377
|
t.push(l);
|
3358
3378
|
}
|
@@ -3410,12 +3430,12 @@ class Ir extends U {
|
|
3410
3430
|
if (t == null || r == null || e == null || e.length == 0 || e.length == 1)
|
3411
3431
|
return e;
|
3412
3432
|
t instanceof Function && (t = [t]);
|
3413
|
-
let s = e.sort((
|
3414
|
-
let u = t[0], p = u(
|
3433
|
+
let s = e.sort((a, o) => {
|
3434
|
+
let u = t[0], p = u(a) - u(o);
|
3415
3435
|
if (p != 0)
|
3416
3436
|
return p;
|
3417
3437
|
let h = t[1];
|
3418
|
-
return h == null ? p : h(
|
3438
|
+
return h == null ? p : h(a) - h(o);
|
3419
3439
|
}), l;
|
3420
3440
|
return r == "asc" ? l = s : l = s.reverse(), l;
|
3421
3441
|
});
|
@@ -3427,12 +3447,12 @@ class Ir extends U {
|
|
3427
3447
|
n(this, "groupBy", (e, t, r = null) => {
|
3428
3448
|
let s = {};
|
3429
3449
|
if (e.forEach((l) => {
|
3430
|
-
let
|
3431
|
-
s[
|
3450
|
+
let a = t(l);
|
3451
|
+
s[a] == null && (s[a] = []), s[a].push(l);
|
3432
3452
|
}), r) {
|
3433
3453
|
let l = Object.keys(s);
|
3434
|
-
for (let
|
3435
|
-
s[
|
3454
|
+
for (let a of l)
|
3455
|
+
s[a] = r(s[a]);
|
3436
3456
|
}
|
3437
3457
|
return s;
|
3438
3458
|
});
|
@@ -3442,8 +3462,8 @@ class Ir extends U {
|
|
3442
3462
|
n(this, "groupByArray", (e, t) => {
|
3443
3463
|
let r = [];
|
3444
3464
|
return e.forEach((s) => {
|
3445
|
-
let l = t(s),
|
3446
|
-
|
3465
|
+
let l = t(s), a = r.find((o) => o.key == l);
|
3466
|
+
a == null && (a = { key: l, value: [] }, r.push(a)), a.value.push(s);
|
3447
3467
|
}), r;
|
3448
3468
|
});
|
3449
3469
|
}
|
@@ -3453,8 +3473,8 @@ class Ir extends U {
|
|
3453
3473
|
getChunksByCount(e, t) {
|
3454
3474
|
let r = [], s = d.math.ceil(e.length / t);
|
3455
3475
|
for (let l = 0; l < e.length; l += s) {
|
3456
|
-
let
|
3457
|
-
r.push(
|
3476
|
+
let a = this.getRange(e, l, s);
|
3477
|
+
r.push(a);
|
3458
3478
|
}
|
3459
3479
|
return r;
|
3460
3480
|
}
|
@@ -3465,7 +3485,7 @@ class Ir extends U {
|
|
3465
3485
|
*/
|
3466
3486
|
getRange(e, t, r = null) {
|
3467
3487
|
let s = r == null ? e.length : t + r;
|
3468
|
-
return e.filter((
|
3488
|
+
return e.filter((a, o) => o >= t && o < s);
|
3469
3489
|
}
|
3470
3490
|
/**
|
3471
3491
|
* 获取最后length个元素
|
@@ -3487,8 +3507,8 @@ class Ir extends U {
|
|
3487
3507
|
create(e, t) {
|
3488
3508
|
let r = [];
|
3489
3509
|
for (let s = 0; s < e.length; s++) {
|
3490
|
-
let l = e[s],
|
3491
|
-
r.push(
|
3510
|
+
let l = e[s], a = t(l, s);
|
3511
|
+
r.push(a);
|
3492
3512
|
}
|
3493
3513
|
return r;
|
3494
3514
|
}
|
@@ -3511,7 +3531,7 @@ class Ir extends U {
|
|
3511
3531
|
}
|
3512
3532
|
//#endregion
|
3513
3533
|
}
|
3514
|
-
class Mr extends
|
3534
|
+
class Mr extends O {
|
3515
3535
|
constructor() {
|
3516
3536
|
super(...arguments);
|
3517
3537
|
n(this, "type", "component");
|
@@ -3532,9 +3552,9 @@ class Mr extends U {
|
|
3532
3552
|
let s = {}, l = Object.keys(e);
|
3533
3553
|
if (l.length == 0)
|
3534
3554
|
return s;
|
3535
|
-
for (let
|
3536
|
-
const
|
3537
|
-
let u = d.string.trim(
|
3555
|
+
for (let a = 0; a < l.length; a++) {
|
3556
|
+
const o = l[a];
|
3557
|
+
let u = d.string.trim(o, t, ".vue"), h = (r ? r + "-" : "") + d.string.getDashName(u), g = e[o];
|
3538
3558
|
if (g.default)
|
3539
3559
|
s[h] = g.default;
|
3540
3560
|
else {
|
@@ -3553,7 +3573,7 @@ class Mr extends U {
|
|
3553
3573
|
}, 100);
|
3554
3574
|
}
|
3555
3575
|
}
|
3556
|
-
class
|
3576
|
+
class Pr extends O {
|
3557
3577
|
constructor() {
|
3558
3578
|
super(...arguments);
|
3559
3579
|
n(this, "type", "dom");
|
@@ -3583,8 +3603,8 @@ class Br extends U {
|
|
3583
3603
|
} else
|
3584
3604
|
s.push(e);
|
3585
3605
|
for (let l = 0; l < s.length; l++) {
|
3586
|
-
let
|
3587
|
-
r !=
|
3606
|
+
let a = s[l];
|
3607
|
+
r != a && a.classList.remove(t);
|
3588
3608
|
}
|
3589
3609
|
});
|
3590
3610
|
//#endregion
|
@@ -3595,12 +3615,12 @@ class Br extends U {
|
|
3595
3615
|
n(this, "getWidthOrHeight", (e, t, r = null) => {
|
3596
3616
|
let s = 0, l = [];
|
3597
3617
|
e instanceof Array && l.push(...e), e instanceof HTMLCollection ? l.push(...e) : l.push(e);
|
3598
|
-
for (let
|
3599
|
-
let
|
3600
|
-
if (!
|
3618
|
+
for (let a = 0; a < l.length; a++) {
|
3619
|
+
let o = l[a];
|
3620
|
+
if (!o || !o.getBoundingClientRect)
|
3601
3621
|
continue;
|
3602
|
-
let u =
|
3603
|
-
s += u[t], r && (s += r(
|
3622
|
+
let u = o.getBoundingClientRect();
|
3623
|
+
s += u[t], r && (s += r(o));
|
3604
3624
|
}
|
3605
3625
|
return s;
|
3606
3626
|
});
|
@@ -3649,16 +3669,16 @@ class Br extends U {
|
|
3649
3669
|
getColors(e) {
|
3650
3670
|
let t = {}, r = 0;
|
3651
3671
|
for (let s = 0; s < e.length; s++) {
|
3652
|
-
let l = e[s],
|
3653
|
-
for (let
|
3654
|
-
|
3655
|
-
|
3672
|
+
let l = e[s], a = 0;
|
3673
|
+
for (let o = 0; o < l.length; o++)
|
3674
|
+
a += l.charCodeAt(o);
|
3675
|
+
a > r && (r = a);
|
3656
3676
|
}
|
3657
3677
|
for (let s = 0; s < e.length; s++) {
|
3658
|
-
let l = e[s],
|
3678
|
+
let l = e[s], a = 0;
|
3659
3679
|
for (let g = 0; g < l.length; g++)
|
3660
|
-
|
3661
|
-
let
|
3680
|
+
a += l.charCodeAt(g);
|
3681
|
+
let o = a / r, u = 255 * o, p = 255 * (1 - o), h = 255 * (1 - o);
|
3662
3682
|
t[l] = `rgb(${u}, ${p}, ${h})`;
|
3663
3683
|
}
|
3664
3684
|
return t;
|
@@ -3704,8 +3724,8 @@ class Br extends U {
|
|
3704
3724
|
siblings(e) {
|
3705
3725
|
let r = e.parentElement.children, s = [];
|
3706
3726
|
for (let l = 0; l < r.length; l++) {
|
3707
|
-
let
|
3708
|
-
|
3727
|
+
let a = r[l];
|
3728
|
+
a != e && s.push(a);
|
3709
3729
|
}
|
3710
3730
|
return s;
|
3711
3731
|
}
|
@@ -3782,8 +3802,8 @@ class Br extends U {
|
|
3782
3802
|
*/
|
3783
3803
|
getAvailableHeight(e) {
|
3784
3804
|
return this.getWidthOrHeight(e, "height", (r) => {
|
3785
|
-
let s = getComputedStyle(r), l = parseFloat(s.paddingTop) + parseFloat(s.paddingBottom),
|
3786
|
-
return -(l +
|
3805
|
+
let s = getComputedStyle(r), l = parseFloat(s.paddingTop) + parseFloat(s.paddingBottom), a = parseFloat(s.borderTopWidth) + parseFloat(s.borderBottomWidth);
|
3806
|
+
return -(l + a);
|
3787
3807
|
});
|
3788
3808
|
}
|
3789
3809
|
//#endregion
|
@@ -3791,19 +3811,19 @@ class Br extends U {
|
|
3791
3811
|
* 获取指定元素在视口内的位置
|
3792
3812
|
*/
|
3793
3813
|
getViewportStyle(e, t, r, s, l) {
|
3794
|
-
let
|
3795
|
-
if (!
|
3814
|
+
let a = e.querySelector(r);
|
3815
|
+
if (!a)
|
3796
3816
|
return null;
|
3797
|
-
let
|
3817
|
+
let o = {}, u = e.getBoundingClientRect(), p = s.getBoundingClientRect(), g = e.querySelector(t).getBoundingClientRect(), m = a.getBoundingClientRect(), k = p.height - g.top;
|
3798
3818
|
if (l == "right") {
|
3799
|
-
|
3800
|
-
let
|
3801
|
-
m.height > p.height ?
|
3819
|
+
o.left = `${u.left + u.width}px`;
|
3820
|
+
let U;
|
3821
|
+
m.height > p.height ? U = p.height : U = m.height, o.height = `${U}px`, U + g.top > p.height ? (o.top = "initial", o.bottom = "0px") : o.top = `${u.top}px`;
|
3802
3822
|
} else if (l == "bottom")
|
3803
|
-
k -= g.height,
|
3823
|
+
k -= g.height, o.left = `${u.left}px`, o.top = `${u.top + u.height}px`, k < m.height ? o.height = `${k}px` : o.height = `${m.height}px`;
|
3804
3824
|
else
|
3805
3825
|
throw new Error(`暂未支持的position:${l}`);
|
3806
|
-
return
|
3826
|
+
return o;
|
3807
3827
|
}
|
3808
3828
|
//#region 索引
|
3809
3829
|
/**
|
@@ -3815,7 +3835,7 @@ class Br extends U {
|
|
3815
3835
|
return 0;
|
3816
3836
|
let r = [];
|
3817
3837
|
for (let l = 0; l < t.length; l++) {
|
3818
|
-
let
|
3838
|
+
let a = t[l], o = getComputedStyle(a), u = o.zIndex == "auto" ? 0 : o.zIndex;
|
3819
3839
|
r.push(u);
|
3820
3840
|
}
|
3821
3841
|
return Math.max(...r);
|
@@ -3826,8 +3846,8 @@ class Br extends U {
|
|
3826
3846
|
* 判断当前鼠标位置是否在指定范围之内
|
3827
3847
|
*/
|
3828
3848
|
inRange(e, t, r, s, l) {
|
3829
|
-
let
|
3830
|
-
return
|
3849
|
+
let a = e.x >= t && e.x <= t + s, o = e.y >= r && e.y <= r + l;
|
3850
|
+
return a && o;
|
3831
3851
|
}
|
3832
3852
|
//#endregion
|
3833
3853
|
//#region 创建
|
@@ -3879,7 +3899,7 @@ class Br extends U {
|
|
3879
3899
|
}
|
3880
3900
|
//#endregion
|
3881
3901
|
}
|
3882
|
-
class
|
3902
|
+
class Br extends O {
|
3883
3903
|
constructor() {
|
3884
3904
|
super(...arguments);
|
3885
3905
|
n(this, "type", "dictionary");
|
@@ -3917,10 +3937,10 @@ class Pr extends U {
|
|
3917
3937
|
let l = "";
|
3918
3938
|
if (e == null)
|
3919
3939
|
return l;
|
3920
|
-
let
|
3921
|
-
for (let
|
3922
|
-
let u = o
|
3923
|
-
l = l.concat(u).concat(r).concat(p),
|
3940
|
+
let a = Object.keys(e);
|
3941
|
+
for (let o = 0; o < a.length; o++) {
|
3942
|
+
let u = a[o], p = t == null ? e[u] : t(e[u]);
|
3943
|
+
l = l.concat(u).concat(r).concat(p), o != a.length - 1 && (l += s);
|
3924
3944
|
}
|
3925
3945
|
return l;
|
3926
3946
|
}
|
@@ -3937,8 +3957,8 @@ class Pr extends U {
|
|
3937
3957
|
if (s.length == 0)
|
3938
3958
|
return r;
|
3939
3959
|
for (let l of s) {
|
3940
|
-
let
|
3941
|
-
t != null && t(
|
3960
|
+
let a = e[l], o = { key: l, value: a };
|
3961
|
+
t != null && t(o), r.push(o);
|
3942
3962
|
}
|
3943
3963
|
return r;
|
3944
3964
|
}
|
@@ -3956,7 +3976,7 @@ class Pr extends U {
|
|
3956
3976
|
}
|
3957
3977
|
//#endregion
|
3958
3978
|
}
|
3959
|
-
class Fr extends
|
3979
|
+
class Fr extends O {
|
3960
3980
|
constructor() {
|
3961
3981
|
super(...arguments);
|
3962
3982
|
n(this, "type", "event");
|
@@ -4002,7 +4022,7 @@ class Fr extends U {
|
|
4002
4022
|
});
|
4003
4023
|
}
|
4004
4024
|
}
|
4005
|
-
class Nr extends
|
4025
|
+
class Nr extends O {
|
4006
4026
|
constructor() {
|
4007
4027
|
super(...arguments);
|
4008
4028
|
n(this, "type", "file");
|
@@ -4013,8 +4033,8 @@ class Nr extends U {
|
|
4013
4033
|
let r = window.atob(e), s = r.length, l = new Uint8Array(s);
|
4014
4034
|
for (; s--; )
|
4015
4035
|
l[s] = r.charCodeAt(s);
|
4016
|
-
let
|
4017
|
-
ft.saveAs(
|
4036
|
+
let a = new Blob([l]);
|
4037
|
+
ft.saveAs(a, t);
|
4018
4038
|
});
|
4019
4039
|
/**
|
4020
4040
|
* 获取文件扩展名
|
@@ -4039,7 +4059,7 @@ class Nr extends U {
|
|
4039
4059
|
});
|
4040
4060
|
}
|
4041
4061
|
}
|
4042
|
-
class qr extends
|
4062
|
+
class qr extends O {
|
4043
4063
|
constructor() {
|
4044
4064
|
super(...arguments);
|
4045
4065
|
n(this, "type", "html");
|
@@ -4060,7 +4080,7 @@ class qr extends U {
|
|
4060
4080
|
});
|
4061
4081
|
}
|
4062
4082
|
}
|
4063
|
-
class Vr extends
|
4083
|
+
class Vr extends O {
|
4064
4084
|
constructor() {
|
4065
4085
|
super(...arguments);
|
4066
4086
|
n(this, "type", "image");
|
@@ -4070,7 +4090,7 @@ class Vr extends U {
|
|
4070
4090
|
n(this, "base64", (e) => "data:image/png;base64," + e);
|
4071
4091
|
}
|
4072
4092
|
}
|
4073
|
-
class Wr extends
|
4093
|
+
class Wr extends O {
|
4074
4094
|
constructor() {
|
4075
4095
|
super(...arguments);
|
4076
4096
|
n(this, "type", "math");
|
@@ -4080,7 +4100,7 @@ class Wr extends U {
|
|
4080
4100
|
*/
|
4081
4101
|
n(this, "filterPage", (e, t, r) => {
|
4082
4102
|
let s = (t - 1) * r, l = t * r;
|
4083
|
-
return e.filter((
|
4103
|
+
return e.filter((o, u) => u >= s && u < l);
|
4084
4104
|
});
|
4085
4105
|
/**
|
4086
4106
|
* 总页数
|
@@ -4127,8 +4147,8 @@ class Wr extends U {
|
|
4127
4147
|
let l = s * 1024;
|
4128
4148
|
if (e < l)
|
4129
4149
|
return this.round(e / s, 2) + "GB";
|
4130
|
-
let
|
4131
|
-
if (e <
|
4150
|
+
let a = l * 1024;
|
4151
|
+
if (e < a)
|
4132
4152
|
return this.round(e / l, 2) + "TB";
|
4133
4153
|
throw new Error("暂未支持比TB更大的大小");
|
4134
4154
|
});
|
@@ -4168,7 +4188,7 @@ class Wr extends U {
|
|
4168
4188
|
return e;
|
4169
4189
|
}
|
4170
4190
|
}
|
4171
|
-
class zr extends
|
4191
|
+
class zr extends O {
|
4172
4192
|
constructor() {
|
4173
4193
|
super(...arguments);
|
4174
4194
|
n(this, "type", "micro");
|
@@ -4179,7 +4199,7 @@ class zr extends U {
|
|
4179
4199
|
});
|
4180
4200
|
}
|
4181
4201
|
}
|
4182
|
-
class Kr extends
|
4202
|
+
class Kr extends O {
|
4183
4203
|
constructor() {
|
4184
4204
|
super(...arguments);
|
4185
4205
|
n(this, "type", "mount");
|
@@ -4201,7 +4221,7 @@ class Kr extends U {
|
|
4201
4221
|
});
|
4202
4222
|
}
|
4203
4223
|
}
|
4204
|
-
class Jr extends
|
4224
|
+
class Jr extends O {
|
4205
4225
|
constructor() {
|
4206
4226
|
super(...arguments);
|
4207
4227
|
n(this, "type", "object");
|
@@ -4239,11 +4259,11 @@ class Jr extends U {
|
|
4239
4259
|
d.object.isObject(e) && r.push(e);
|
4240
4260
|
let s = [];
|
4241
4261
|
for (let l = 0; l < r.length; l++) {
|
4242
|
-
let
|
4243
|
-
Object.keys(
|
4244
|
-
let p =
|
4245
|
-
t && t[u] ?
|
4246
|
-
}), s.push(
|
4262
|
+
let a = r[l], o = {};
|
4263
|
+
Object.keys(a).forEach((u) => {
|
4264
|
+
let p = a[u];
|
4265
|
+
t && t[u] ? o[u] = t[u]() : o[u] = p;
|
4266
|
+
}), s.push(o);
|
4247
4267
|
}
|
4248
4268
|
return d.object.isObject(e) ? s[0] : s;
|
4249
4269
|
});
|
@@ -4255,8 +4275,8 @@ class Jr extends U {
|
|
4255
4275
|
n(this, "addProperties", (e, t, r) => {
|
4256
4276
|
let s = e;
|
4257
4277
|
for (let l = 0; l < t.length; l++) {
|
4258
|
-
let
|
4259
|
-
l == t.length - 1 ? s[
|
4278
|
+
let a = t[l];
|
4279
|
+
l == t.length - 1 ? s[a] = r : (s[a] || (s[a] = {}), s = s[a]);
|
4260
4280
|
}
|
4261
4281
|
});
|
4262
4282
|
}
|
@@ -4268,8 +4288,8 @@ class Jr extends U {
|
|
4268
4288
|
pure(e) {
|
4269
4289
|
let t = {}, r = Object.keys(e);
|
4270
4290
|
for (let s = 0; s < r.length; s++) {
|
4271
|
-
let l = r[s],
|
4272
|
-
|
4291
|
+
let l = r[s], a = e[l];
|
4292
|
+
a != null && (d.object.isObject(a) ? t[l] = this.pure(a) : t[l] = e[l]);
|
4273
4293
|
}
|
4274
4294
|
return t;
|
4275
4295
|
}
|
@@ -4281,8 +4301,8 @@ class Jr extends U {
|
|
4281
4301
|
filter(e, t, r) {
|
4282
4302
|
let s = [];
|
4283
4303
|
return Object.keys(e).forEach((l) => {
|
4284
|
-
let
|
4285
|
-
t(
|
4304
|
+
let a = { key: l, value: e[l] };
|
4305
|
+
t(a) && s.push(r(a));
|
4286
4306
|
}), s;
|
4287
4307
|
}
|
4288
4308
|
/**
|
@@ -4304,8 +4324,8 @@ class Jr extends U {
|
|
4304
4324
|
toObject(e, t, r) {
|
4305
4325
|
let s = {};
|
4306
4326
|
for (let l = 0; l < e.length; l++) {
|
4307
|
-
let
|
4308
|
-
s[t(
|
4327
|
+
let a = e[l];
|
4328
|
+
s[t(a)] = r(a);
|
4309
4329
|
}
|
4310
4330
|
return s;
|
4311
4331
|
}
|
@@ -4353,7 +4373,7 @@ class Jr extends U {
|
|
4353
4373
|
}
|
4354
4374
|
//#endregion
|
4355
4375
|
}
|
4356
|
-
class Xr extends
|
4376
|
+
class Xr extends O {
|
4357
4377
|
constructor() {
|
4358
4378
|
super(...arguments);
|
4359
4379
|
n(this, "type", "string");
|
@@ -4509,8 +4529,8 @@ class Xr extends U {
|
|
4509
4529
|
let s = e.indexOf(t);
|
4510
4530
|
if (s == -1)
|
4511
4531
|
return null;
|
4512
|
-
let l = s + t.length,
|
4513
|
-
return
|
4532
|
+
let l = s + t.length, a = e.substring(l), o = a.indexOf(r);
|
4533
|
+
return o == -1 ? null : a.substring(0, o);
|
4514
4534
|
});
|
4515
4535
|
//#endregion
|
4516
4536
|
//#region 格式化
|
@@ -4524,8 +4544,8 @@ class Xr extends U {
|
|
4524
4544
|
typeof t == "string" ? r.push(t) : r.push(...t);
|
4525
4545
|
let s = e;
|
4526
4546
|
for (let l = 0; l < r.length; l++) {
|
4527
|
-
let
|
4528
|
-
s = s.replace(`{${l}}`,
|
4547
|
+
let a = r[l];
|
4548
|
+
s = s.replace(`{${l}}`, a);
|
4529
4549
|
}
|
4530
4550
|
return s;
|
4531
4551
|
});
|
@@ -4552,7 +4572,7 @@ class Xr extends U {
|
|
4552
4572
|
}
|
4553
4573
|
//#endregion
|
4554
4574
|
}
|
4555
|
-
class Qr extends
|
4575
|
+
class Qr extends O {
|
4556
4576
|
constructor() {
|
4557
4577
|
super(...arguments);
|
4558
4578
|
n(this, "type", "task");
|
@@ -4610,7 +4630,7 @@ class Tl {
|
|
4610
4630
|
n(this, "value");
|
4611
4631
|
}
|
4612
4632
|
}
|
4613
|
-
class Yr extends
|
4633
|
+
class Yr extends O {
|
4614
4634
|
constructor() {
|
4615
4635
|
super(...arguments);
|
4616
4636
|
n(this, "type", "time");
|
@@ -4692,7 +4712,7 @@ class Yr extends U {
|
|
4692
4712
|
});
|
4693
4713
|
}
|
4694
4714
|
}
|
4695
|
-
class Gr extends
|
4715
|
+
class Gr extends O {
|
4696
4716
|
constructor() {
|
4697
4717
|
super(...arguments);
|
4698
4718
|
n(this, "type", "tree");
|
@@ -4702,13 +4722,13 @@ class Gr extends U {
|
|
4702
4722
|
n(this, "getById", (e, t, r, s) => {
|
4703
4723
|
if (!r)
|
4704
4724
|
return null;
|
4705
|
-
let l = r.find((
|
4725
|
+
let l = r.find((a) => a[t] == e) || null;
|
4706
4726
|
if (l != null)
|
4707
4727
|
return l;
|
4708
|
-
for (let
|
4709
|
-
let
|
4710
|
-
if (
|
4711
|
-
l =
|
4728
|
+
for (let a = 0; a < r.length; a++) {
|
4729
|
+
let o = this.getById(e, t, r[a][s], s);
|
4730
|
+
if (o != null) {
|
4731
|
+
l = o;
|
4712
4732
|
break;
|
4713
4733
|
}
|
4714
4734
|
}
|
@@ -4718,26 +4738,26 @@ class Gr extends U {
|
|
4718
4738
|
* 树节点
|
4719
4739
|
*/
|
4720
4740
|
n(this, "getByIds", (e, t, r, s) => {
|
4721
|
-
let l = d.array.distinct(e, (
|
4722
|
-
return l.forEach((
|
4723
|
-
let u = this.getById(
|
4724
|
-
|
4725
|
-
}),
|
4741
|
+
let l = d.array.distinct(e, (o) => o), a = [];
|
4742
|
+
return l.forEach((o) => {
|
4743
|
+
let u = this.getById(o, t, r, s);
|
4744
|
+
a.push(u);
|
4745
|
+
}), a;
|
4726
4746
|
});
|
4727
4747
|
/**
|
4728
4748
|
* 找出指定层级集合中,指定对象的下一个对象
|
4729
4749
|
*/
|
4730
4750
|
n(this, "getNextById", (e, t, r, s) => {
|
4731
|
-
let l = this.getById(e, t, r, s),
|
4732
|
-
if (
|
4751
|
+
let l = this.getById(e, t, r, s), a = this.getParentsById(e, t, r, s);
|
4752
|
+
if (a.length == 0) {
|
4733
4753
|
if (r.length == 1)
|
4734
4754
|
return null;
|
4735
4755
|
let h = r.indexOf(l);
|
4736
4756
|
return h == r.length - 1 ? r[h - 1] : r[h + 1];
|
4737
4757
|
}
|
4738
|
-
let
|
4758
|
+
let o = a[a.length - 1], u = o[s];
|
4739
4759
|
if (u.length == 1)
|
4740
|
-
return
|
4760
|
+
return o;
|
4741
4761
|
let p = u.indexOf(l);
|
4742
4762
|
return p == u.length - 1 ? u[p - 1] : u[p + 1];
|
4743
4763
|
});
|
@@ -4759,15 +4779,15 @@ class Gr extends U {
|
|
4759
4779
|
* 从树结构数据中,递归获取指定主键的父元素集合
|
4760
4780
|
*/
|
4761
4781
|
n(this, "getParentsById", (e, t, r, s, l = !1) => {
|
4762
|
-
let
|
4763
|
-
return r == null || st(e, t, r, s,
|
4782
|
+
let a = [];
|
4783
|
+
return r == null || st(e, t, r, s, a, l), a;
|
4764
4784
|
});
|
4765
4785
|
/**
|
4766
4786
|
* 获取当前节点的所有孩子节点的集合
|
4767
4787
|
*/
|
4768
4788
|
n(this, "getChildrenById", (e, t, r, s, l = !1) => {
|
4769
|
-
let
|
4770
|
-
return l &&
|
4789
|
+
let a = this.getById(e, t, r, s), o = [];
|
4790
|
+
return l && o.push(a), Ae(a, s, o), o;
|
4771
4791
|
});
|
4772
4792
|
/**
|
4773
4793
|
* 获取当前节点的所有孩子节点的集合
|
@@ -4783,13 +4803,13 @@ class Gr extends U {
|
|
4783
4803
|
let l = [];
|
4784
4804
|
if (!t)
|
4785
4805
|
return l;
|
4786
|
-
let
|
4806
|
+
let a = e ? e.toUpperCase() : "", o = d.object.isString(s) ? [s] : s;
|
4787
4807
|
for (let u of t) {
|
4788
4808
|
let p = !1, h = this.getChildren(u, r, !0);
|
4789
4809
|
for (let g of h) {
|
4790
|
-
for (let m of
|
4810
|
+
for (let m of o) {
|
4791
4811
|
let k = g[m];
|
4792
|
-
if ((k ? k.toUpperCase() : "").indexOf(
|
4812
|
+
if ((k ? k.toUpperCase() : "").indexOf(a) > -1) {
|
4793
4813
|
p = !0;
|
4794
4814
|
break;
|
4795
4815
|
}
|
@@ -4808,13 +4828,13 @@ class Gr extends U {
|
|
4808
4828
|
* 删除指定子元素
|
4809
4829
|
*/
|
4810
4830
|
n(this, "removeById", (e, t, r, s) => {
|
4811
|
-
let l = this.getById(e, t, r, s),
|
4812
|
-
if (
|
4831
|
+
let l = this.getById(e, t, r, s), a = this.getParentsById(e, t, r, s);
|
4832
|
+
if (a.length == 0) {
|
4813
4833
|
d.array.remove(r, l);
|
4814
4834
|
return;
|
4815
4835
|
}
|
4816
|
-
let
|
4817
|
-
d.array.remove(
|
4836
|
+
let o = a[a.length - 1];
|
4837
|
+
d.array.remove(o[s], l);
|
4818
4838
|
});
|
4819
4839
|
/**
|
4820
4840
|
* 获取树结构扁平化后的节点信息
|
@@ -4822,10 +4842,10 @@ class Gr extends U {
|
|
4822
4842
|
n(this, "getFlat", (e, t) => {
|
4823
4843
|
let r = [...e];
|
4824
4844
|
for (let s = 0; s < e.length; s++) {
|
4825
|
-
let
|
4826
|
-
if (
|
4827
|
-
let
|
4828
|
-
r.push(...
|
4845
|
+
let a = e[s][t];
|
4846
|
+
if (a.length > 0) {
|
4847
|
+
let o = this.getFlat(a, t);
|
4848
|
+
r.push(...o);
|
4829
4849
|
}
|
4830
4850
|
}
|
4831
4851
|
return r;
|
@@ -4835,10 +4855,10 @@ class Gr extends U {
|
|
4835
4855
|
*/
|
4836
4856
|
n(this, "map", (e, t, r, s) => {
|
4837
4857
|
let l = [];
|
4838
|
-
for (let
|
4839
|
-
let
|
4858
|
+
for (let a = 0; a < e.length; a++) {
|
4859
|
+
let o = e[a], u = s(o);
|
4840
4860
|
l.push(u);
|
4841
|
-
let p =
|
4861
|
+
let p = o[t];
|
4842
4862
|
if (p && p.length > 0) {
|
4843
4863
|
let h = this.map(p, t, r, s);
|
4844
4864
|
u[r] = h;
|
@@ -4850,12 +4870,12 @@ class Gr extends U {
|
|
4850
4870
|
}
|
4851
4871
|
function st(c, i, e, t, r, s) {
|
4852
4872
|
for (let l = 0; l < e.length; l++) {
|
4853
|
-
let
|
4854
|
-
if (
|
4855
|
-
s && r.push(
|
4873
|
+
let a = e[l];
|
4874
|
+
if (a[i] == c) {
|
4875
|
+
s && r.push(a);
|
4856
4876
|
break;
|
4857
4877
|
} else
|
4858
|
-
d.tree.getById(c, i,
|
4878
|
+
d.tree.getById(c, i, a[t], t) != null && (r.push(a), st(c, i, a[t], t, r, s));
|
4859
4879
|
}
|
4860
4880
|
return r;
|
4861
4881
|
}
|
@@ -4869,7 +4889,7 @@ function Ae(c, i, e) {
|
|
4869
4889
|
}
|
4870
4890
|
return e;
|
4871
4891
|
}
|
4872
|
-
class Zr extends
|
4892
|
+
class Zr extends O {
|
4873
4893
|
constructor() {
|
4874
4894
|
super(...arguments);
|
4875
4895
|
n(this, "type", "scroll");
|
@@ -4900,7 +4920,7 @@ class es {
|
|
4900
4920
|
n(this, "beautify", !1);
|
4901
4921
|
}
|
4902
4922
|
}
|
4903
|
-
class ts extends
|
4923
|
+
class ts extends O {
|
4904
4924
|
constructor() {
|
4905
4925
|
super(...arguments);
|
4906
4926
|
n(this, "type", "json");
|
@@ -4930,10 +4950,10 @@ class ts extends U {
|
|
4930
4950
|
t == null && (t = new es());
|
4931
4951
|
let s = (typeof t == "boolean" ? t : t.beautify) ? 2 : null, l;
|
4932
4952
|
if (typeof e == "string") {
|
4933
|
-
let
|
4934
|
-
if (
|
4953
|
+
let o = {};
|
4954
|
+
if (!this.tryDeserialize(e, o))
|
4935
4955
|
return e;
|
4936
|
-
l =
|
4956
|
+
l = o;
|
4937
4957
|
} else
|
4938
4958
|
l = e;
|
4939
4959
|
return JSON.stringify(l, null, s);
|
@@ -4947,22 +4967,31 @@ class ts extends U {
|
|
4947
4967
|
autoDeserialize(e) {
|
4948
4968
|
if (e == null)
|
4949
4969
|
return null;
|
4950
|
-
let t = e.replace(/\s+\/\/.*/g, (s) => "");
|
4951
|
-
|
4970
|
+
let t = e.replace(/\s+\/\/.*/g, (s) => ""), r = {};
|
4971
|
+
if (!this.tryDeserialize(t, r))
|
4972
|
+
throw new Error(`自动发序列化异常:${r.message}`);
|
4973
|
+
return r;
|
4952
4974
|
}
|
4953
4975
|
/**
|
4954
|
-
*
|
4976
|
+
* 反序列化为json对象,异常返回null
|
4955
4977
|
*/
|
4956
4978
|
deserialize(e) {
|
4979
|
+
let t = {};
|
4980
|
+
return this.tryDeserialize(e, t) ? t : null;
|
4981
|
+
}
|
4982
|
+
/**
|
4983
|
+
* 尝试反序列化成json对象
|
4984
|
+
* 异常时,结果返回异常消息对象
|
4985
|
+
*/
|
4986
|
+
tryDeserialize(e, t) {
|
4957
4987
|
if (e == null)
|
4958
4988
|
return null;
|
4959
|
-
let t;
|
4960
4989
|
try {
|
4961
|
-
|
4962
|
-
|
4963
|
-
|
4990
|
+
let r = JSON.parse(e);
|
4991
|
+
return Object.assign(t, r), !0;
|
4992
|
+
} catch (r) {
|
4993
|
+
return Object.assign(t, { message: r.message, stack: r.stack }), !1;
|
4964
4994
|
}
|
4965
|
-
return t;
|
4966
4995
|
}
|
4967
4996
|
//#endregion
|
4968
4997
|
//#region 获取键值
|
@@ -4990,10 +5019,10 @@ class ts extends U {
|
|
4990
5019
|
return null;
|
4991
5020
|
let s = e;
|
4992
5021
|
for (let l of r) {
|
4993
|
-
let
|
4994
|
-
if (
|
5022
|
+
let a = s[l];
|
5023
|
+
if (a == null)
|
4995
5024
|
return null;
|
4996
|
-
s =
|
5025
|
+
s = a;
|
4997
5026
|
}
|
4998
5027
|
return s;
|
4999
5028
|
}
|
@@ -5025,11 +5054,11 @@ class ts extends U {
|
|
5025
5054
|
return "{}";
|
5026
5055
|
let l = `{
|
5027
5056
|
`;
|
5028
|
-
for (let
|
5029
|
-
let
|
5057
|
+
for (let a = 0; a < e.length; a++) {
|
5058
|
+
let o = e[a], u = s(o);
|
5030
5059
|
u.type == "array" ? (u.remark && (l += this.fillSpace(2 * r) + "//" + u.remark + `
|
5031
|
-
`), l += this.fillKey(2 * r, u.key) + "[", l += this.buildObjectLevel(
|
5032
|
-
`), l += this.fillKey(2 * r, u.key), l += this.buildObjectLevel(
|
5060
|
+
`), l += this.fillKey(2 * r, u.key) + "[", l += this.buildObjectLevel(o[t], t, r + 1, s), l += "]", a != e.length - 1 && (l += ",")) : u.type == "object" ? (u.remark && (l += this.fillSpace(2 * r) + "//" + u.remark + `
|
5061
|
+
`), l += this.fillKey(2 * r, u.key), l += this.buildObjectLevel(o[t], t, r + 1, s), a != e.length - 1 && (l += ",")) : (l += this.fillKey(2 * r, u.key), u.type == "string" ? l += '""' : u.type == "date" ? l += `"${d.time.getDateTimeString()}"` : u.type == "int" || u.type == "number" ? l += "0" : u.type == "boolean" ? l += "false" : l += null, a != e.length - 1 && (l += ","), u.remark && (l += " //" + u.remark)), l += `
|
5033
5062
|
`;
|
5034
5063
|
}
|
5035
5064
|
return l += this.fillSpace(2 * (r - 1)), l += "}", l;
|
@@ -5052,7 +5081,7 @@ class ts extends U {
|
|
5052
5081
|
}
|
5053
5082
|
//#endregion
|
5054
5083
|
}
|
5055
|
-
class rs extends
|
5084
|
+
class rs extends O {
|
5056
5085
|
constructor() {
|
5057
5086
|
super(...arguments);
|
5058
5087
|
n(this, "type", "browser");
|
@@ -5064,7 +5093,7 @@ class rs extends U {
|
|
5064
5093
|
return navigator.language == "zh-CN" ? "zh-cn" : "en";
|
5065
5094
|
}
|
5066
5095
|
}
|
5067
|
-
class ss extends
|
5096
|
+
class ss extends O {
|
5068
5097
|
constructor() {
|
5069
5098
|
super(...arguments);
|
5070
5099
|
n(this, "type", "url");
|
@@ -5084,13 +5113,13 @@ class ss extends U {
|
|
5084
5113
|
} else if (e instanceof Object) {
|
5085
5114
|
let s = Object.keys(e);
|
5086
5115
|
for (let l of s) {
|
5087
|
-
let
|
5088
|
-
|
5116
|
+
let a = d.object.clone(t);
|
5117
|
+
a.push(l), r += this.handleQueryValue(e[l], a);
|
5089
5118
|
}
|
5090
5119
|
} else {
|
5091
5120
|
let s = "";
|
5092
|
-
for (let
|
5093
|
-
|
5121
|
+
for (let a = 0; a < t.length; a++)
|
5122
|
+
a > 0 && (s += "["), s += t[a], a > 0 && (s += "]");
|
5094
5123
|
let l = encodeURIComponent(e);
|
5095
5124
|
l = l.replace(/'/g, "%27"), l = l.replace(/%20/g, "+"), l = l.replace(/%5B/g, "["), l = l.replace(/%5D/g, "]"), l = l.replace(/%2C/g, ","), l = l.replace(/%3A/g, ":"), l = l.replace(/%24/g, "$"), r += `&${s}=${l}`;
|
5096
5125
|
}
|
@@ -5136,12 +5165,12 @@ class ss extends U {
|
|
5136
5165
|
getToUrl(e, t = !0) {
|
5137
5166
|
let r = {};
|
5138
5167
|
if (!this.getRoute(e).query.m) {
|
5139
|
-
let
|
5140
|
-
|
5168
|
+
let a = this.getQueryParam(location.search, "m");
|
5169
|
+
a && (r.m = a);
|
5141
5170
|
}
|
5142
5171
|
if (t) {
|
5143
|
-
let
|
5144
|
-
|
5172
|
+
let a = location.pathname + location.search;
|
5173
|
+
a && (r.return_url = a);
|
5145
5174
|
}
|
5146
5175
|
return this.getUrl(e, r);
|
5147
5176
|
}
|
@@ -5194,8 +5223,8 @@ class ss extends U {
|
|
5194
5223
|
return null;
|
5195
5224
|
let t = "", r = Object.keys(e);
|
5196
5225
|
for (let l of r) {
|
5197
|
-
let
|
5198
|
-
t +=
|
5226
|
+
let a = [l], o = this.handleQueryValue(e[l], a);
|
5227
|
+
t += o;
|
5199
5228
|
}
|
5200
5229
|
return t.substring(1);
|
5201
5230
|
}
|
@@ -5239,7 +5268,7 @@ class ss extends U {
|
|
5239
5268
|
deserializeQs(e, t = !0) {
|
5240
5269
|
let r = {}, s = e.split("&");
|
5241
5270
|
for (let l = 0; l < s.length; l++) {
|
5242
|
-
let
|
5271
|
+
let a = s[l], o = a.indexOf("="), u = a.substring(0, o), p = a.substring(o + 1);
|
5243
5272
|
r[u] = t ? decodeURIComponent(p) : p;
|
5244
5273
|
}
|
5245
5274
|
return r;
|
@@ -5267,7 +5296,7 @@ class ss extends U {
|
|
5267
5296
|
return e ? e.indexOf("http://") > -1 || e.indexOf("https://") > -1 : !1;
|
5268
5297
|
}
|
5269
5298
|
}
|
5270
|
-
class ls extends
|
5299
|
+
class ls extends O {
|
5271
5300
|
constructor() {
|
5272
5301
|
super(...arguments);
|
5273
5302
|
n(this, "type", "sign");
|
@@ -5317,12 +5346,12 @@ class El extends lt {
|
|
5317
5346
|
this.width = r, this.height = s;
|
5318
5347
|
}
|
5319
5348
|
}
|
5320
|
-
class
|
5349
|
+
class re {
|
5321
5350
|
constructor() {
|
5322
5351
|
n(this, "type");
|
5323
5352
|
}
|
5324
5353
|
}
|
5325
|
-
class $e extends
|
5354
|
+
class $e extends re {
|
5326
5355
|
constructor() {
|
5327
5356
|
super();
|
5328
5357
|
//#region 大小调整
|
@@ -5401,13 +5430,13 @@ class $e extends se {
|
|
5401
5430
|
if (e == null)
|
5402
5431
|
return;
|
5403
5432
|
this.dragElement = e;
|
5404
|
-
let r = !1, s = (
|
5433
|
+
let r = !1, s = (o) => (r = !0, o.preventDefault(), t.init(o)), l = (o) => {
|
5405
5434
|
let u = new ns(), p = t.range;
|
5406
5435
|
if (p == null)
|
5407
|
-
u.x =
|
5436
|
+
u.x = o.clientX, u.y = o.clientY;
|
5408
5437
|
else {
|
5409
5438
|
let { x: h, y: g, width: m, height: k } = p;
|
5410
|
-
|
5439
|
+
o.clientX < h ? u.x = h : o.clientX > h + m ? u.x = h + m : u.x = o.clientX, o.clientY < g ? u.y = g : o.clientY > g + k ? u.y = g + k : u.y = o.clientY;
|
5411
5440
|
}
|
5412
5441
|
if (t.affix) {
|
5413
5442
|
if (t.range == null)
|
@@ -5415,12 +5444,12 @@ class $e extends se {
|
|
5415
5444
|
let h = p.x + p.width, g = p.y + p.height;
|
5416
5445
|
u.x <= t.affix ? u.affix = "left" : u.x >= h - t.affix ? u.affix = "right" : u.y >= p.y && u.y <= p.y + t.affix ? u.affix = "top" : u.y >= g - t.affix && u.y <= g && (u.affix = "bottom");
|
5417
5446
|
}
|
5418
|
-
t.handler(u, this.dragStart, this.dragStartData, r,
|
5419
|
-
},
|
5420
|
-
window.removeEventListener("mousemove", l), window.removeEventListener("mouseup",
|
5447
|
+
t.handler(u, this.dragStart, this.dragStartData, r, o), r = !1;
|
5448
|
+
}, a = (o) => {
|
5449
|
+
window.removeEventListener("mousemove", l), window.removeEventListener("mouseup", a), t.end != null && t.end(o);
|
5421
5450
|
};
|
5422
|
-
this.dragMouseDownHandler = (
|
5423
|
-
this.dragStart =
|
5451
|
+
this.dragMouseDownHandler = (o) => {
|
5452
|
+
this.dragStart = o, this.dragStartData = s(o), window.addEventListener("mousemove", l), window.addEventListener("mouseup", a);
|
5424
5453
|
}, this.dragElement.addEventListener("mousedown", this.dragMouseDownHandler);
|
5425
5454
|
}
|
5426
5455
|
/**
|
@@ -5465,18 +5494,18 @@ class $e extends se {
|
|
5465
5494
|
}
|
5466
5495
|
//#endregion
|
5467
5496
|
}
|
5468
|
-
class is extends
|
5497
|
+
class is extends re {
|
5469
5498
|
constructor() {
|
5470
5499
|
super(...arguments);
|
5471
5500
|
n(this, "events", {});
|
5472
5501
|
/**
|
5473
5502
|
* 注册事件
|
5474
5503
|
*/
|
5475
|
-
n(this, "add", (e, t, r, s, l,
|
5476
|
-
let
|
5477
|
-
|
5504
|
+
n(this, "add", (e, t, r, s, l, a) => {
|
5505
|
+
let o = this.events[s];
|
5506
|
+
o || (o = function(u) {
|
5478
5507
|
r(u) && (t && t(u), l && u.preventDefault());
|
5479
|
-
}, this.events[s] =
|
5508
|
+
}, this.events[s] = o), e.addEventListener(a, o);
|
5480
5509
|
});
|
5481
5510
|
/**
|
5482
5511
|
* 移除事件
|
@@ -5531,8 +5560,8 @@ class is extends se {
|
|
5531
5560
|
this.keydown(e, t, (l) => {
|
5532
5561
|
if (l.key != r)
|
5533
5562
|
return !1;
|
5534
|
-
let
|
5535
|
-
return this.lastKeyTime =
|
5563
|
+
let a = (/* @__PURE__ */ new Date()).getTime(), o = a - this.lastKeyTime;
|
5564
|
+
return this.lastKeyTime = a, o < 200 && this.isKeyLastUp;
|
5536
5565
|
}, "double" + r, s), this.keyup(e, () => {
|
5537
5566
|
this.isKeyLastUp = !0;
|
5538
5567
|
}, (l) => l.key == r ? !0 : (this.isKeyLastUp = !1, !1), "double" + r + ".keyup");
|
@@ -5588,14 +5617,14 @@ class is extends se {
|
|
5588
5617
|
clearTimeout(this.timer);
|
5589
5618
|
}
|
5590
5619
|
}
|
5591
|
-
class
|
5620
|
+
class as extends re {
|
5592
5621
|
/**
|
5593
5622
|
* 对比数据变动
|
5594
5623
|
*/
|
5595
5624
|
delta(i, e, t, r) {
|
5596
5625
|
}
|
5597
5626
|
}
|
5598
|
-
class
|
5627
|
+
class os extends re {
|
5599
5628
|
/**
|
5600
5629
|
* 初始化,并绑定自动关闭上下文菜单事件
|
5601
5630
|
*/
|
@@ -5635,7 +5664,7 @@ class as extends se {
|
|
5635
5664
|
}
|
5636
5665
|
}
|
5637
5666
|
}
|
5638
|
-
class us extends
|
5667
|
+
class us extends re {
|
5639
5668
|
constructor() {
|
5640
5669
|
super(...arguments);
|
5641
5670
|
//#region 属性
|
@@ -5693,7 +5722,7 @@ class us extends se {
|
|
5693
5722
|
return this.current != null && this.history.push(e), this.current = this.history.length, e;
|
5694
5723
|
}
|
5695
5724
|
}
|
5696
|
-
const ne = class ne extends
|
5725
|
+
const ne = class ne extends re {
|
5697
5726
|
constructor() {
|
5698
5727
|
super(...arguments);
|
5699
5728
|
/**
|
@@ -5736,14 +5765,14 @@ const ne = class ne extends se {
|
|
5736
5765
|
s == null && (s = [], ne.opened[e] = s);
|
5737
5766
|
let l = await y.provider.getDefaultAsync(e);
|
5738
5767
|
this.key = t;
|
5739
|
-
let
|
5740
|
-
if (
|
5768
|
+
let a = await l.getAsync(e, this.key);
|
5769
|
+
if (a == null) {
|
5741
5770
|
let u = (await l.getKeysAsync(e)).filter((p) => isNaN(p) && !s.includes(p));
|
5742
|
-
u.length > 0 && (this.oldKey = u[0],
|
5771
|
+
u.length > 0 && (this.oldKey = u[0], a = await l.replaceEntityAsync(e, this.oldKey, this.key));
|
5743
5772
|
}
|
5744
|
-
return s.includes(this.key) || s.push(this.key),
|
5773
|
+
return s.includes(this.key) || s.push(this.key), a != null && d.object.mergeTo(r, a), W(() => JSON.stringify(r), (o, u) => {
|
5745
5774
|
l != null && this.task.debounce(async () => {
|
5746
|
-
let p = JSON.parse(
|
5775
|
+
let p = JSON.parse(o), h = JSON.parse(u);
|
5747
5776
|
this.form = p, await this.saveAsync(p), this.handler != null && await this.handler(p, h);
|
5748
5777
|
}, 500);
|
5749
5778
|
}, { deep: !0 }), this.provider = l, l;
|
@@ -5792,7 +5821,7 @@ const ne = class ne extends se {
|
|
5792
5821
|
*/
|
5793
5822
|
n(ne, "opened", {});
|
5794
5823
|
let Se = ne;
|
5795
|
-
class cs extends
|
5824
|
+
class cs extends re {
|
5796
5825
|
/**
|
5797
5826
|
* 初始化
|
5798
5827
|
*/
|
@@ -5815,7 +5844,7 @@ class ds extends D {
|
|
5815
5844
|
* 创建对比工具
|
5816
5845
|
*/
|
5817
5846
|
delta() {
|
5818
|
-
return new
|
5847
|
+
return new as();
|
5819
5848
|
}
|
5820
5849
|
/**
|
5821
5850
|
* 创建事件工具
|
@@ -5833,7 +5862,7 @@ class ds extends D {
|
|
5833
5862
|
* 创建鼠标工具
|
5834
5863
|
*/
|
5835
5864
|
mouse(e, t = null) {
|
5836
|
-
return new
|
5865
|
+
return new os(e, t);
|
5837
5866
|
}
|
5838
5867
|
/**
|
5839
5868
|
* 创建随机工具
|
@@ -5909,9 +5938,9 @@ class jl extends D {
|
|
5909
5938
|
});
|
5910
5939
|
}
|
5911
5940
|
}
|
5912
|
-
let gs = {},
|
5941
|
+
let gs = {}, se = {}, _ = {}, Me = {}, it = {}, je = {}, fs = {}, ie = {}, ys = async (c) => {
|
5913
5942
|
let e = await (await y.provider.getDefaultAsync("sys")).getAsync("sys", "app");
|
5914
|
-
(e == null ? void 0 : e.cdn) != null && (c.cdn = e.cdn),
|
5943
|
+
(e == null ? void 0 : e.cdn) != null && (c.cdn = e.cdn), se = await y.cdn.createWithCacheAsync(c.cdn), gs = await y.encoder.getBase64(), _ = y.http.halo, je = y.socket.default, Me = await y.i18n.createWithCacheAsync("Default", async (t) => {
|
5915
5944
|
let r = (e == null ? void 0 : e.language) ?? d.browser.getLanguage(), s = d.json.serialize({ lang: r });
|
5916
5945
|
await t.openAsync(s), fe = t.t, ms = t.t_exists, vs = t.t_sys, bs = t.t_enum, ws = t.t_field, ks = t.t_field_choose_placeholder, xs = t.t_field_placeholder, As = t.t_table, Ss = t.t_module, _s = t.t_menu;
|
5917
5946
|
}), Me.addMessages(c.lang), it = await y.hasher.getMd5(), fs = y.template.create("Liquid"), c.messenger == null ? ie = await y.messenger.getConsole() : ie = c.messenger;
|
@@ -5943,7 +5972,7 @@ class Cs {
|
|
5943
5972
|
const Ts = { class: "ha-empty" }, Es = { class: "empty-message" }, $s = {
|
5944
5973
|
key: 0,
|
5945
5974
|
class: "empty-content"
|
5946
|
-
}, Dl = /* @__PURE__ */
|
5975
|
+
}, Dl = /* @__PURE__ */ P({
|
5947
5976
|
__name: "Empty",
|
5948
5977
|
props: {
|
5949
5978
|
message: { type: String, default: "暂无数据" },
|
@@ -5958,21 +5987,21 @@ const Ts = { class: "ha-empty" }, Es = { class: "empty-message" }, $s = {
|
|
5958
5987
|
])) : ye("", !0)
|
5959
5988
|
]));
|
5960
5989
|
}
|
5961
|
-
}), js = /* @__PURE__ */
|
5990
|
+
}), js = /* @__PURE__ */ P({
|
5962
5991
|
__name: "Fill",
|
5963
5992
|
emits: ["resize"],
|
5964
5993
|
setup(c, { emit: i }) {
|
5965
|
-
let e = i, t = H(), r = H(), s = H(), l = new $e(),
|
5994
|
+
let e = i, t = H(), r = H(), s = H(), l = new $e(), a = () => {
|
5966
5995
|
let p = d.dom.siblings(t.value);
|
5967
5996
|
s.value = d.dom.getHeight(p);
|
5968
|
-
},
|
5997
|
+
}, o = () => {
|
5969
5998
|
r.value = d.dom.getHeight(t.value), e("resize", r.value);
|
5970
5999
|
}, u = () => {
|
5971
|
-
|
6000
|
+
o();
|
5972
6001
|
};
|
5973
|
-
return
|
5974
|
-
|
5975
|
-
}),
|
6002
|
+
return ae(() => {
|
6003
|
+
a(), o(), l.resize(t.value, u);
|
6004
|
+
}), oe(() => {
|
5976
6005
|
l.dispose();
|
5977
6006
|
}), (p, h) => (C(), T("div", {
|
5978
6007
|
class: "ha-fill",
|
@@ -5983,19 +6012,19 @@ const Ts = { class: "ha-empty" }, Es = { class: "empty-message" }, $s = {
|
|
5983
6012
|
Q(p.$slots, "default")
|
5984
6013
|
], 4));
|
5985
6014
|
}
|
5986
|
-
}), Ds = /* @__PURE__ */
|
6015
|
+
}), Ds = /* @__PURE__ */ P({
|
5987
6016
|
__name: "Scroller",
|
5988
6017
|
props: {
|
5989
6018
|
options: {}
|
5990
6019
|
},
|
5991
6020
|
emits: ["scroll"],
|
5992
6021
|
setup(c, { expose: i, emit: e }) {
|
5993
|
-
let t = e, r = c, { options: s } = z(r), l = H(),
|
6022
|
+
let t = e, r = c, { options: s } = z(r), l = H(), a = H(), o = H(), u = H(), p = H(!1), h = null, g = null, m = new $e(), k = H({ top: null, height: null }), U = (b) => {
|
5994
6023
|
if (g == 0)
|
5995
6024
|
return 0;
|
5996
6025
|
let w = g - h;
|
5997
6026
|
return b / w;
|
5998
|
-
},
|
6027
|
+
}, B = (b) => {
|
5999
6028
|
let w = h - k.value.height;
|
6000
6029
|
return b / w;
|
6001
6030
|
}, X = () => {
|
@@ -6007,47 +6036,47 @@ const Ts = { class: "ha-empty" }, Es = { class: "empty-message" }, $s = {
|
|
6007
6036
|
let w = h * b;
|
6008
6037
|
return d.math.between(w, 80, 500);
|
6009
6038
|
}, Y = (b, w) => {
|
6010
|
-
let E =
|
6039
|
+
let E = U(b), q = (h - w) * E;
|
6011
6040
|
return d.math.between(q, 0, h - w);
|
6012
6041
|
}, $ = (b) => {
|
6013
6042
|
let w = X();
|
6014
6043
|
return { top: Y(b, w), height: w };
|
6015
6044
|
}, F = (b) => {
|
6016
6045
|
}, A = (b) => {
|
6017
|
-
let w =
|
6046
|
+
let w = U(b);
|
6018
6047
|
R(w);
|
6019
6048
|
}, R = (b) => {
|
6020
6049
|
let w = d.math.between(b, 0, 1), E = h - k.value.height;
|
6021
6050
|
k.value.top = E * w;
|
6022
6051
|
let V = (g - h) * w;
|
6023
|
-
s.value.scrollTop = V,
|
6052
|
+
s.value.scrollTop = V, a.value.scrollTop != V && (a.value.scrollTop = V);
|
6024
6053
|
}, J = (b) => {
|
6025
|
-
let w = b.target, E =
|
6054
|
+
let w = b.target, E = U(w.scrollTop);
|
6026
6055
|
R(E), t("scroll", w);
|
6027
6056
|
}, v = () => {
|
6028
6057
|
let b = s.value.scrollTop;
|
6029
6058
|
k.value = $(b), A(b);
|
6030
6059
|
}, x = (b) => {
|
6031
|
-
h = d.dom.getHeight(
|
6060
|
+
h = d.dom.getHeight(a.value), g = a.value.scrollHeight;
|
6032
6061
|
let w = X();
|
6033
6062
|
k.value.height = w, k.value.top = Y(s.value.scrollTop, w);
|
6034
6063
|
}, j = (b) => {
|
6035
6064
|
let w = b.target;
|
6036
6065
|
return parseInt(w.style.top);
|
6037
6066
|
}, M = (b, w, E, q) => {
|
6038
|
-
let V = b.y - w.y, pe = E + V, G =
|
6067
|
+
let V = b.y - w.y, pe = E + V, G = B(pe);
|
6039
6068
|
R(G);
|
6040
6069
|
}, I = (b) => {
|
6041
6070
|
p.value = !0;
|
6042
6071
|
}, L = (b) => {
|
6043
6072
|
p.value = !1;
|
6044
6073
|
};
|
6045
|
-
return
|
6046
|
-
v(), m.scroll(
|
6047
|
-
}),
|
6074
|
+
return ae(() => {
|
6075
|
+
v(), m.scroll(a.value, J), m.drag(u.value, { init: j, handler: M }), m.observe(a.value, x), m.mouseDown(u.value, I, L);
|
6076
|
+
}), oe(() => {
|
6048
6077
|
m.dispose();
|
6049
6078
|
}), W(() => s.value.scrollTop, (b, w) => {
|
6050
|
-
let E =
|
6079
|
+
let E = U(b);
|
6051
6080
|
R(E);
|
6052
6081
|
}), i({ scrollTo: A, update: v }), (b, w) => (C(), T("div", {
|
6053
6082
|
ref_key: "scrollerRef",
|
@@ -6056,14 +6085,14 @@ const Ts = { class: "ha-empty" }, Es = { class: "empty-message" }, $s = {
|
|
6056
6085
|
}, [
|
6057
6086
|
S("div", {
|
6058
6087
|
ref_key: "containerRef",
|
6059
|
-
ref:
|
6088
|
+
ref: a,
|
6060
6089
|
class: "scroller-container"
|
6061
6090
|
}, [
|
6062
6091
|
Q(b.$slots, "default")
|
6063
6092
|
], 512),
|
6064
6093
|
S("div", {
|
6065
6094
|
ref_key: "trackRef",
|
6066
|
-
ref:
|
6095
|
+
ref: o,
|
6067
6096
|
class: "scroller-track",
|
6068
6097
|
onClick: w[0] || (w[0] = //@ts-ignore
|
6069
6098
|
(...E) => f(F) && f(F)(...E))
|
@@ -6077,26 +6106,26 @@ const Ts = { class: "ha-empty" }, Es = { class: "empty-message" }, $s = {
|
|
6077
6106
|
], 512)
|
6078
6107
|
], 2));
|
6079
6108
|
}
|
6080
|
-
}), Hl = /* @__PURE__ */
|
6109
|
+
}), Hl = /* @__PURE__ */ P({
|
6081
6110
|
__name: "Timer",
|
6082
6111
|
emits: ["change"],
|
6083
6112
|
setup(c, { expose: i, emit: e }) {
|
6084
|
-
let t = e, r = -8 * 60 * 60 * 1e3, s = H(r), l = null,
|
6113
|
+
let t = e, r = -8 * 60 * 60 * 1e3, s = H(r), l = null, a = 5, o = () => {
|
6085
6114
|
l == null && (l = setInterval(() => {
|
6086
|
-
s.value +=
|
6087
|
-
},
|
6115
|
+
s.value += a, t("change", s.value);
|
6116
|
+
}, a));
|
6088
6117
|
}, u = () => {
|
6089
|
-
h(),
|
6118
|
+
h(), o();
|
6090
6119
|
}, p = () => {
|
6091
6120
|
clearInterval(l), l = null;
|
6092
6121
|
}, h = () => {
|
6093
6122
|
clearInterval(l), s.value = r;
|
6094
6123
|
};
|
6095
|
-
return
|
6124
|
+
return oe(() => {
|
6096
6125
|
clearInterval(l);
|
6097
|
-
}), i({ restart: u, start:
|
6126
|
+
}), i({ restart: u, start: o, stop: p, reset: h }), (g, m) => (C(), T("span", null, [
|
6098
6127
|
Q(g.$slots, "default"),
|
6099
|
-
|
6128
|
+
Be(N(f(d).time.format(f(s), "HH:mm:ss SSS")), 1)
|
6100
6129
|
]));
|
6101
6130
|
}
|
6102
6131
|
}), de = (c, i) => {
|
@@ -6104,13 +6133,13 @@ const Ts = { class: "ha-empty" }, Es = { class: "empty-message" }, $s = {
|
|
6104
6133
|
for (const [t, r] of i)
|
6105
6134
|
e[t] = r;
|
6106
6135
|
return e;
|
6107
|
-
}, Hs = {},
|
6108
|
-
function
|
6109
|
-
return C(), T("div",
|
6136
|
+
}, Hs = {}, Os = { class: "ha-card" };
|
6137
|
+
function Us(c, i) {
|
6138
|
+
return C(), T("div", Os, [
|
6110
6139
|
Q(c.$slots, "default")
|
6111
6140
|
]);
|
6112
6141
|
}
|
6113
|
-
const
|
6142
|
+
const Pe = /* @__PURE__ */ de(Hs, [["render", Us]]), Ol = /* @__PURE__ */ P({
|
6114
6143
|
__name: "Code",
|
6115
6144
|
props: {
|
6116
6145
|
options: { default: {} },
|
@@ -6119,17 +6148,17 @@ const Be = /* @__PURE__ */ de(Hs, [["render", Os]]), Ul = /* @__PURE__ */ B({
|
|
6119
6148
|
},
|
6120
6149
|
emits: ["mounted", "change", "scroll", "update:modelValue"],
|
6121
6150
|
setup(c, { expose: i, emit: e }) {
|
6122
|
-
let t = e, r = c, { options: s, border: l, modelValue:
|
6151
|
+
let t = e, r = c, { options: s, border: l, modelValue: a } = z(r), o = null, u = null, p = null, h = { completion: null, hover: null }, g = H(), { app: m } = Z.sys, k = (v, x) => {
|
6123
6152
|
h.completion != null && h.completion.dispose();
|
6124
6153
|
let j = d.array.distinct(x, (M) => M);
|
6125
|
-
h.completion =
|
6126
|
-
},
|
6154
|
+
h.completion = U(v, j);
|
6155
|
+
}, U = (v, x) => v == null || o == null ? null : o.languages.registerCompletionItemProvider(v, {
|
6127
6156
|
provideCompletionItems: (M, I) => {
|
6128
|
-
let L = M.getWordUntilPosition(I), b = new
|
6157
|
+
let L = M.getWordUntilPosition(I), b = new o.Range(I.lineNumber, L.startColumn, I.lineNumber, L.endColumn), w = [];
|
6129
6158
|
for (let E = 0; E < x.length; E++) {
|
6130
6159
|
let q = x[E], V = {
|
6131
6160
|
label: q,
|
6132
|
-
kind:
|
6161
|
+
kind: o.languages.CompletionItemKind.Keyword,
|
6133
6162
|
insertText: q,
|
6134
6163
|
detail: q,
|
6135
6164
|
range: b
|
@@ -6138,11 +6167,11 @@ const Be = /* @__PURE__ */ de(Hs, [["render", Os]]), Ul = /* @__PURE__ */ B({
|
|
6138
6167
|
}
|
6139
6168
|
return { suggestions: w };
|
6140
6169
|
}
|
6141
|
-
}),
|
6170
|
+
}), B = async (v) => {
|
6142
6171
|
let x = Z.editor.intelli;
|
6143
6172
|
if (x[v] != null)
|
6144
6173
|
return;
|
6145
|
-
let j =
|
6174
|
+
let j = o.languages.getLanguages().find((L) => L.id == v);
|
6146
6175
|
if (j == null)
|
6147
6176
|
return;
|
6148
6177
|
let M = j.loader;
|
@@ -6152,17 +6181,17 @@ const Be = /* @__PURE__ */ de(Hs, [["render", Os]]), Ul = /* @__PURE__ */ B({
|
|
6152
6181
|
x[v] || (X(v, I), Y(v, I), x[v] = !0);
|
6153
6182
|
}, X = (v, x) => {
|
6154
6183
|
const j = ["builtinFunctions", "keywords", "operators"];
|
6155
|
-
return
|
6184
|
+
return o.languages.registerCompletionItemProvider(v, {
|
6156
6185
|
provideCompletionItems: (I, L) => {
|
6157
|
-
let b = I.getWordUntilPosition(L), w = new
|
6186
|
+
let b = I.getWordUntilPosition(L), w = new o.Range(L.lineNumber, b.startColumn, L.lineNumber, b.endColumn), E = [];
|
6158
6187
|
for (let q of j) {
|
6159
6188
|
let V = x.language[q];
|
6160
6189
|
if (V == null)
|
6161
6190
|
continue;
|
6162
6191
|
let pe = $(q), G, he;
|
6163
|
-
q == "keywords" ? (G =
|
6192
|
+
q == "keywords" ? (G = o.languages.CompletionItemKind.Keyword, he = " ") : q == "operators" ? (G = o.languages.CompletionItemKind.Operator, he = " ") : (G = o.languages.CompletionItemKind.Function, he = "()");
|
6164
6193
|
for (let De of V) {
|
6165
|
-
let He = De.toLowerCase(),
|
6194
|
+
let He = De.toLowerCase(), at = {
|
6166
6195
|
label: He,
|
6167
6196
|
documentation: De,
|
6168
6197
|
range: w,
|
@@ -6170,7 +6199,7 @@ const Be = /* @__PURE__ */ de(Hs, [["render", Os]]), Ul = /* @__PURE__ */ B({
|
|
6170
6199
|
insertText: He + he,
|
6171
6200
|
detail: pe
|
6172
6201
|
};
|
6173
|
-
E.push(
|
6202
|
+
E.push(at);
|
6174
6203
|
}
|
6175
6204
|
}
|
6176
6205
|
return { suggestions: E };
|
@@ -6178,7 +6207,7 @@ const Be = /* @__PURE__ */ de(Hs, [["render", Os]]), Ul = /* @__PURE__ */ B({
|
|
6178
6207
|
});
|
6179
6208
|
}, Y = (v, x) => {
|
6180
6209
|
const j = ["builtinFunctions", "keywords", "operators"];
|
6181
|
-
return
|
6210
|
+
return o.languages.registerHoverProvider(v, {
|
6182
6211
|
provideHover: (I, L) => {
|
6183
6212
|
let b = I.getWordAtPosition(L);
|
6184
6213
|
if (!b)
|
@@ -6189,7 +6218,7 @@ const Be = /* @__PURE__ */ de(Hs, [["render", Os]]), Ul = /* @__PURE__ */ B({
|
|
6189
6218
|
continue;
|
6190
6219
|
let V = $(w);
|
6191
6220
|
return {
|
6192
|
-
range: new
|
6221
|
+
range: new o.Range(L.lineNumber, L.lineNumber, b.startColumn, b.endColumn),
|
6193
6222
|
contents: [
|
6194
6223
|
{ value: "**" + b.word + "**" },
|
6195
6224
|
{ value: V }
|
@@ -6216,9 +6245,9 @@ const Be = /* @__PURE__ */ de(Hs, [["render", Os]]), Ul = /* @__PURE__ */ B({
|
|
6216
6245
|
trailingCommas: "ignore"
|
6217
6246
|
//允许末尾逗号
|
6218
6247
|
};
|
6219
|
-
|
6220
|
-
let j = v ?
|
6221
|
-
p =
|
6248
|
+
o.languages.json.jsonDefaults.setDiagnosticsOptions(x), await B(s.value.language);
|
6249
|
+
let j = v ? o.Uri.parse(v) : null;
|
6250
|
+
p = o.editor.createModel(a.value, s.value.language, j);
|
6222
6251
|
let M = {
|
6223
6252
|
tabSize: 2,
|
6224
6253
|
//Tab缩进大小
|
@@ -6235,7 +6264,7 @@ const Be = /* @__PURE__ */ de(Hs, [["render", Os]]), Ul = /* @__PURE__ */ B({
|
|
6235
6264
|
//根据父元素自动布局
|
6236
6265
|
model: p
|
6237
6266
|
};
|
6238
|
-
u =
|
6267
|
+
u = o.editor.create(g.value, M), s.value.scrollTop && u.setScrollTop(s.value.scrollTop);
|
6239
6268
|
let I = s.value.selection;
|
6240
6269
|
if (I) {
|
6241
6270
|
let L = {
|
@@ -6253,9 +6282,9 @@ const Be = /* @__PURE__ */ de(Hs, [["render", Os]]), Ul = /* @__PURE__ */ B({
|
|
6253
6282
|
t("update:modelValue", b), t("change", b);
|
6254
6283
|
});
|
6255
6284
|
};
|
6256
|
-
|
6257
|
-
|
6258
|
-
}),
|
6285
|
+
ae(async () => {
|
6286
|
+
o = await se.getMonaco(), await A(), t("mounted", o, u);
|
6287
|
+
}), oe(() => {
|
6259
6288
|
var v;
|
6260
6289
|
p == null || p.dispose(), u == null || u.dispose(), (v = h.completion) == null || v.dispose();
|
6261
6290
|
});
|
@@ -6264,9 +6293,9 @@ const Be = /* @__PURE__ */ de(Hs, [["render", Os]]), Ul = /* @__PURE__ */ B({
|
|
6264
6293
|
}, J = () => u;
|
6265
6294
|
return W(() => m.theme, (v, x) => {
|
6266
6295
|
let j = F(v);
|
6267
|
-
|
6296
|
+
o.editor.setTheme(j);
|
6268
6297
|
}), W(() => m.language, (v, x) => {
|
6269
|
-
}), W(() =>
|
6298
|
+
}), W(() => a.value, (v, x) => {
|
6270
6299
|
if (!u)
|
6271
6300
|
return;
|
6272
6301
|
let j = u.getValue();
|
@@ -6275,7 +6304,7 @@ const Be = /* @__PURE__ */ de(Hs, [["render", Os]]), Ul = /* @__PURE__ */ B({
|
|
6275
6304
|
if (!u)
|
6276
6305
|
return;
|
6277
6306
|
let j = u.getModel();
|
6278
|
-
|
6307
|
+
o.editor.setModelLanguage(j, v), await B(v);
|
6279
6308
|
}), i({ layout: R, getEditor: J, registerIntelli: k }), (v, x) => (C(), Fe(js, null, {
|
6280
6309
|
default: ue(() => [
|
6281
6310
|
S("div", {
|
@@ -6287,7 +6316,7 @@ const Be = /* @__PURE__ */ de(Hs, [["render", Os]]), Ul = /* @__PURE__ */ B({
|
|
6287
6316
|
_: 1
|
6288
6317
|
}));
|
6289
6318
|
}
|
6290
|
-
}),
|
6319
|
+
}), Ul = /* @__PURE__ */ P({
|
6291
6320
|
__name: "Compare",
|
6292
6321
|
props: {
|
6293
6322
|
inline: { type: Boolean, default: !1 },
|
@@ -6297,24 +6326,24 @@ const Be = /* @__PURE__ */ de(Hs, [["render", Os]]), Ul = /* @__PURE__ */ B({
|
|
6297
6326
|
},
|
6298
6327
|
emits: ["update:modelValue", "update:original", "change"],
|
6299
6328
|
setup(c, { emit: i }) {
|
6300
|
-
let e = i, t = c, { inline: r, language: s, original: l, modelValue:
|
6301
|
-
u = $.editor.createModel(l.value, s.value), p = $.editor.createModel(
|
6329
|
+
let e = i, t = c, { inline: r, language: s, original: l, modelValue: a } = z(t), o = null, u = null, p = null, h = null, g = null, m = null, k = H(), U = H(), { app: B } = Z.sys, X = ($) => $ == "default" ? null : "vs-dark", Y = ($) => {
|
6330
|
+
u = $.editor.createModel(l.value, s.value), p = $.editor.createModel(a.value, s.value), o = $.editor.createDiffEditor(k.value, {
|
6302
6331
|
originalEditable: !0,
|
6303
6332
|
automaticLayout: !0,
|
6304
6333
|
renderSideBySide: !r.value,
|
6305
6334
|
//是否启用行内模式
|
6306
|
-
theme: X(
|
6307
|
-
}),
|
6335
|
+
theme: X(B.theme)
|
6336
|
+
}), o.setModel({ original: u, modified: p }), h = o.getOriginalEditor(), h.onDidChangeModelContent((F) => {
|
6308
6337
|
let A = h.getValue();
|
6309
6338
|
e("update:original", A), e("change", A);
|
6310
|
-
}), g =
|
6339
|
+
}), g = o.getModifiedEditor(), g.onDidChangeModelContent((F) => {
|
6311
6340
|
let A = g.getValue();
|
6312
6341
|
e("update:modelValue", A);
|
6313
6342
|
});
|
6314
6343
|
};
|
6315
|
-
return
|
6316
|
-
m = await
|
6317
|
-
}), W(() =>
|
6344
|
+
return ae(async () => {
|
6345
|
+
m = await se.getMonaco(), Y(m);
|
6346
|
+
}), W(() => B.theme, ($, F) => {
|
6318
6347
|
let A = X($);
|
6319
6348
|
m.editor.setTheme(A);
|
6320
6349
|
}), W(() => s.value, ($, F) => {
|
@@ -6324,7 +6353,7 @@ const Be = /* @__PURE__ */ de(Hs, [["render", Os]]), Ul = /* @__PURE__ */ B({
|
|
6324
6353
|
return;
|
6325
6354
|
let A = u.getValue();
|
6326
6355
|
$ != A && u.setValue($ ?? "");
|
6327
|
-
}), W(() =>
|
6356
|
+
}), W(() => a.value, ($, F) => {
|
6328
6357
|
if (!p)
|
6329
6358
|
return;
|
6330
6359
|
let A = p.getValue();
|
@@ -6333,7 +6362,7 @@ const Be = /* @__PURE__ */ de(Hs, [["render", Os]]), Ul = /* @__PURE__ */ B({
|
|
6333
6362
|
ref_key: "compareRef",
|
6334
6363
|
ref: k,
|
6335
6364
|
class: "ha-compare",
|
6336
|
-
style: ee(f(
|
6365
|
+
style: ee(f(U))
|
6337
6366
|
}, null, 4));
|
6338
6367
|
}
|
6339
6368
|
}), Ls = {}, Rs = { class: "ha-input" };
|
@@ -6342,21 +6371,21 @@ function Is(c, i) {
|
|
6342
6371
|
S("input", { type: "text" }, null, -1)
|
6343
6372
|
]));
|
6344
6373
|
}
|
6345
|
-
const Ll = /* @__PURE__ */ de(Ls, [["render", Is]]), Ms = {},
|
6346
|
-
function
|
6347
|
-
return C(), T("div",
|
6374
|
+
const Ll = /* @__PURE__ */ de(Ls, [["render", Is]]), Ms = {}, Ps = { class: "ha-option" };
|
6375
|
+
function Bs(c, i) {
|
6376
|
+
return C(), T("div", Ps, "选项");
|
6348
6377
|
}
|
6349
|
-
const Fs = /* @__PURE__ */ de(Ms, [["render",
|
6378
|
+
const Fs = /* @__PURE__ */ de(Ms, [["render", Bs]]), Ns = { class: "ha-rich-text" }, Rl = /* @__PURE__ */ P({
|
6350
6379
|
__name: "RichText",
|
6351
|
-
props: /* @__PURE__ */
|
6380
|
+
props: /* @__PURE__ */ Oe({
|
6352
6381
|
options: {}
|
6353
6382
|
}, {
|
6354
6383
|
modelValue: {},
|
6355
6384
|
modelModifiers: {}
|
6356
6385
|
}),
|
6357
|
-
emits: /* @__PURE__ */
|
6386
|
+
emits: /* @__PURE__ */ Oe(["change", "scroll"], ["update:modelValue"]),
|
6358
6387
|
setup(c, { expose: i, emit: e }) {
|
6359
|
-
let t = e, r = c, { options: s } = z(r), l = Ne(c, "modelValue"),
|
6388
|
+
let t = e, r = c, { options: s } = z(r), l = Ne(c, "modelValue"), a, o = null, u = null, p = !1, h = !1, g = H(), m = H(), k = H(), U = H(!1), B = H({ style: null, options: { scrollTop: 0 } }), X = (A) => {
|
6360
6389
|
let R = d.time.getDateString(), J = getSelection(), v = J.getRangeAt(0), x = v.startContainer;
|
6361
6390
|
if (x.nodeName == "#text")
|
6362
6391
|
x.insertData(v.startOffset, R), v.setStart(x, v.startOffset + R.length), J.removeAllRanges(), J.addRange(v);
|
@@ -6367,14 +6396,14 @@ const Fs = /* @__PURE__ */ de(Ms, [["render", Ps]]), Ns = { class: "ha-rich-text
|
|
6367
6396
|
M.selectNodeContents(j), M.setStart(j, M.startOffset + R.length), J.removeAllRanges(), J.addRange(M);
|
6368
6397
|
}
|
6369
6398
|
}, Y = (A) => {
|
6370
|
-
if (
|
6399
|
+
if (o.scrollTop = A.scrollTop, p || h) {
|
6371
6400
|
p = !1, h = !1;
|
6372
6401
|
return;
|
6373
6402
|
}
|
6374
6403
|
u = A, t("scroll", A);
|
6375
6404
|
}, $ = () => `height: calc(100% - ${d.dom.getHeight(m.value)}px)`, F = async () => {
|
6376
|
-
let A = await
|
6377
|
-
|
6405
|
+
let A = await se.getQuill();
|
6406
|
+
a = new A(g.value, {
|
6378
6407
|
modules: {
|
6379
6408
|
toolbar: {
|
6380
6409
|
container: m.value,
|
@@ -6382,23 +6411,23 @@ const Fs = /* @__PURE__ */ de(Ms, [["render", Ps]]), Ns = { class: "ha-rich-text
|
|
6382
6411
|
}
|
6383
6412
|
},
|
6384
6413
|
theme: "snow"
|
6385
|
-
}),
|
6386
|
-
|
6387
|
-
}), s.value.readonly &&
|
6388
|
-
|
6389
|
-
}),
|
6414
|
+
}), U.value = !0, Ue(() => {
|
6415
|
+
B.value.style = $();
|
6416
|
+
}), s.value.readonly && a.disable(), o = g.value.querySelector(".ql-editor"), o.innerHTML = l.value, B.value.options.scrollTop = s.value.scrollTop, a.on("text-change", (R, J, v) => {
|
6417
|
+
o.innerHTML != l.value && (p = !0, l.value = o.innerHTML);
|
6418
|
+
}), o.addEventListener("paste", (R) => {
|
6390
6419
|
h = !0;
|
6391
6420
|
});
|
6392
6421
|
};
|
6393
|
-
return
|
6422
|
+
return ae(() => {
|
6394
6423
|
F();
|
6395
|
-
}),
|
6396
|
-
|
6424
|
+
}), oe(() => {
|
6425
|
+
a = null;
|
6397
6426
|
}), W(() => l.value, (A, R) => {
|
6398
|
-
|
6427
|
+
o && o.innerHTML != A && (o.innerHTML = A);
|
6399
6428
|
}), W(() => s.value.scrollTop, (A, R) => {
|
6400
|
-
A != null && (u == null ? void 0 : u.scrollTop) != A &&
|
6401
|
-
|
6429
|
+
A != null && (u == null ? void 0 : u.scrollTop) != A && Ue(() => {
|
6430
|
+
B.value.options.scrollTop = A;
|
6402
6431
|
});
|
6403
6432
|
}), i({}), (A, R) => (C(), T("div", Ns, [
|
6404
6433
|
dt(S("div", {
|
@@ -6407,15 +6436,15 @@ const Fs = /* @__PURE__ */ de(Ms, [["render", Ps]]), Ns = { class: "ha-rich-text
|
|
6407
6436
|
}, R[0] || (R[0] = [
|
6408
6437
|
pt('<div class="ql-formats"><button class="ql-bold" data-toggle="tooltip" data-placement="bottom" title="Bold"></button><button class="ql-italic" data-toggle="tooltip" data-placement="bottom" title="Italic <ctrl+i>"></button><button class="ql-date" data-toggle="tooltip" data-placement="bottom" title="Date"></button><button class="ql-underline" data-toggle="tooltip" data-placement="bottom" title="Underline"></button><button class="ql-strike" data-toggle="tooltip" data-placement="bottom" title="Strike"></button></div><div class="ql-formats"><button class="ql-list" data-toggle="tooltip" data-placement="bottom" value="ordered"></button><button class="ql-list" data-toggle="tooltip" data-placement="bottom" value="bullet"></button><select class="ql-color"><option selected></option><option value="#e60000"></option><option value="#ff9900"></option><option value="#ffff00"></option><option value="#008a00"></option><option value="#0066cc"></option><option value="#9933ff"></option><option value="#ffffff"></option><option value="#facccc"></option><option value="#ffebcc"></option><option value="#ffffcc"></option><option value="#cce8cc"></option><option value="#cce0f5"></option><option value="#ebd6ff"></option><option value="#bbbbbb"></option><option value="#f06666"></option><option value="#ffc266"></option><option value="#ffff66"></option><option value="#66b966"></option><option value="#66a3e0"></option><option value="#c285ff"></option><option value="#888888"></option><option value="#a10000"></option><option value="#b26b00"></option><option value="#b2b200"></option><option value="#006100"></option><option value="#0047b2"></option><option value="#6b24b2"></option><option value="#444444"></option><option value="#5c0000"></option><option value="#663d00"></option><option value="#666600"></option><option value="#003700"></option><option value="#002966"></option><option value="#3d1466"></option></select><select class="ql-background"><option selected></option><option value="#e60000"></option><option value="#ff9900"></option><option value="#ffff00"></option><option value="#008a00"></option><option value="#0066cc"></option><option value="#9933ff"></option><option value="#ffffff"></option><option value="#facccc"></option><option value="#ffebcc"></option><option value="#ffffcc"></option><option value="#cce8cc"></option><option value="#cce0f5"></option><option value="#ebd6ff"></option><option value="#bbbbbb"></option><option value="#f06666"></option><option value="#ffc266"></option><option value="#ffff66"></option><option value="#66b966"></option><option value="#66a3e0"></option><option value="#c285ff"></option><option value="#888888"></option><option value="#a10000"></option><option value="#b26b00"></option><option value="#b2b200"></option><option value="#006100"></option><option value="#0047b2"></option><option value="#6b24b2"></option><option value="#444444"></option><option value="#5c0000"></option><option value="#663d00"></option><option value="#666600"></option><option value="#003700"></option><option value="#002966"></option><option value="#3d1466"></option></select></div><div class="ql-formats"><button class="ql-code-block" data-toggle="tooltip" data-placement="bottom" title="Code"></button><button class="ql-blockquote" data-toggle="tooltip" data-placement="bottom" title="Block quote"></button><button class="ql-link" data-toggle="tooltip" data-placement="bottom" title="Link"></button></div><div class="ql-formats"><button class="ql-header" data-toggle="tooltip" data-placement="bottom" value="1"></button><button class="ql-header" data-toggle="tooltip" data-placement="bottom" value="2"></button><select class="ql-align"><option selected></option><option value="center"></option><option value="right"></option><option value="justify"></option></select></div><div class="ql-formats"><select class="ql-size"><option value="small"></option><option selected></option><option value="large"></option><option value="huge"></option></select><select class="ql-header"><option value=""></option><option value="1"></option><option value="2"></option><option value="3"></option><option value="4"></option><option value="5"></option><option value="6"></option></select></div><div class="ql-formats"><select class="ql-font"><option selected></option><option value="serif"></option><option value="monospace"></option></select></div><div class="ql-formats"><button class="ql-image" data-toggle="tooltip" data-placement="bottom" title="Image"></button><button class="ql-video" data-toggle="tooltip" data-placement="bottom" title="Video"></button><button class="ql-clean" data-toggle="tooltip" data-placement="bottom" title="Clean"></button></div>', 7)
|
6409
6438
|
]), 512), [
|
6410
|
-
[ht, f(
|
6439
|
+
[ht, f(U)]
|
6411
6440
|
]),
|
6412
|
-
|
6441
|
+
te(f(Ds), {
|
6413
6442
|
ref_key: "scrollerRef",
|
6414
6443
|
ref: k,
|
6415
6444
|
class: "ql-body",
|
6416
|
-
options: f(
|
6445
|
+
options: f(B).options,
|
6417
6446
|
onScroll: f(Y),
|
6418
|
-
style: ee(f(
|
6447
|
+
style: ee(f(B).style)
|
6419
6448
|
}, {
|
6420
6449
|
default: ue(() => [
|
6421
6450
|
S("div", {
|
@@ -6461,7 +6490,7 @@ class Il {
|
|
6461
6490
|
this.startLine = i, this.endLine = e, this.startColumn = t, this.endColumn = r;
|
6462
6491
|
}
|
6463
6492
|
}
|
6464
|
-
const zs = { class: "ha-condition" }, Ks = /* @__PURE__ */
|
6493
|
+
const zs = { class: "ha-condition" }, Ks = /* @__PURE__ */ P({
|
6465
6494
|
__name: "Condition",
|
6466
6495
|
props: {
|
6467
6496
|
name: {},
|
@@ -6471,26 +6500,26 @@ const zs = { class: "ha-condition" }, Ks = /* @__PURE__ */ B({
|
|
6471
6500
|
setup(c) {
|
6472
6501
|
let i = c, { name: e, operator: t, value: r } = z(i);
|
6473
6502
|
return (s, l) => (C(), T("div", zs, [
|
6474
|
-
|
6503
|
+
te(f(we), {
|
6475
6504
|
modelValue: f(e),
|
6476
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
6505
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => ve(e) ? e.value = a : e = a)
|
6477
6506
|
}, null, 8, ["modelValue"]),
|
6478
|
-
|
6507
|
+
te(f(we), {
|
6479
6508
|
modelValue: f(t),
|
6480
|
-
"onUpdate:modelValue": l[1] || (l[1] = (
|
6509
|
+
"onUpdate:modelValue": l[1] || (l[1] = (a) => ve(t) ? t.value = a : t = a)
|
6481
6510
|
}, {
|
6482
6511
|
default: ue(() => [
|
6483
|
-
|
6512
|
+
te(f(Fs))
|
6484
6513
|
]),
|
6485
6514
|
_: 1
|
6486
6515
|
}, 8, ["modelValue"]),
|
6487
|
-
|
6516
|
+
te(f(we), {
|
6488
6517
|
modelValue: f(r),
|
6489
|
-
"onUpdate:modelValue": l[2] || (l[2] = (
|
6518
|
+
"onUpdate:modelValue": l[2] || (l[2] = (a) => ve(r) ? r.value = a : r = a)
|
6490
6519
|
}, null, 8, ["modelValue"])
|
6491
6520
|
]));
|
6492
6521
|
}
|
6493
|
-
}), Js = { class: "ha-condition-group" }, Ml = /* @__PURE__ */
|
6522
|
+
}), Js = { class: "ha-condition-group" }, Ml = /* @__PURE__ */ P({
|
6494
6523
|
__name: "Index",
|
6495
6524
|
props: {
|
6496
6525
|
conditions: {}
|
@@ -6511,7 +6540,7 @@ function Ys(c, i) {
|
|
6511
6540
|
Q(c.$slots, "default")
|
6512
6541
|
]);
|
6513
6542
|
}
|
6514
|
-
const
|
6543
|
+
const Pl = /* @__PURE__ */ de(Xs, [["render", Ys]]), Bl = /* @__PURE__ */ P({
|
6515
6544
|
__name: "Container",
|
6516
6545
|
props: {
|
6517
6546
|
container: { type: Boolean, default: !0 }
|
@@ -6524,7 +6553,7 @@ const Bl = /* @__PURE__ */ de(Xs, [["render", Ys]]), Pl = /* @__PURE__ */ B({
|
|
6524
6553
|
Q(t.$slots, "default")
|
6525
6554
|
], 2));
|
6526
6555
|
}
|
6527
|
-
}), Fl = /* @__PURE__ */
|
6556
|
+
}), Fl = /* @__PURE__ */ P({
|
6528
6557
|
__name: "Row",
|
6529
6558
|
props: {
|
6530
6559
|
gap: {},
|
@@ -6532,19 +6561,19 @@ const Bl = /* @__PURE__ */ de(Xs, [["render", Ys]]), Pl = /* @__PURE__ */ B({
|
|
6532
6561
|
},
|
6533
6562
|
setup(c, { expose: i }) {
|
6534
6563
|
let e = c, { gap: t, direction: r } = z(e), s = H(), l = ge(() => {
|
6535
|
-
let
|
6536
|
-
return t.value && (
|
6564
|
+
let a = { gap: null };
|
6565
|
+
return t.value && (a.gap = t.value + "px"), a;
|
6537
6566
|
});
|
6538
|
-
return i({ ref: s }), (
|
6567
|
+
return i({ ref: s }), (a, o) => (C(), T("div", {
|
6539
6568
|
ref_key: "rowRef",
|
6540
6569
|
ref: s,
|
6541
6570
|
class: ce(["ha-row", f(r)]),
|
6542
6571
|
style: ee(f(l))
|
6543
6572
|
}, [
|
6544
|
-
Q(
|
6573
|
+
Q(a.$slots, "default")
|
6545
6574
|
], 6));
|
6546
6575
|
}
|
6547
|
-
}), Nl = /* @__PURE__ */
|
6576
|
+
}), Nl = /* @__PURE__ */ P({
|
6548
6577
|
__name: "Index",
|
6549
6578
|
props: {
|
6550
6579
|
modelValue: { type: Boolean },
|
@@ -6562,25 +6591,25 @@ const Bl = /* @__PURE__ */ de(Xs, [["render", Ys]]), Pl = /* @__PURE__ */ B({
|
|
6562
6591
|
}, 50);
|
6563
6592
|
}, l = () => {
|
6564
6593
|
clearInterval(r);
|
6565
|
-
let
|
6594
|
+
let a = 100 - t.value, o = 200, u = 20, p = a / (o / u), h = setInterval(() => {
|
6566
6595
|
t.value += p, !(t.value < 100) && (t.value = 100, clearInterval(h), setTimeout(() => {
|
6567
6596
|
e.value = !1;
|
6568
6597
|
}, 200));
|
6569
6598
|
}, u);
|
6570
6599
|
};
|
6571
|
-
return
|
6600
|
+
return ae(() => {
|
6572
6601
|
i.value && s();
|
6573
|
-
}),
|
6602
|
+
}), oe(() => {
|
6574
6603
|
clearInterval(r);
|
6575
|
-
}), W(() => i.value, (
|
6576
|
-
|
6577
|
-
}), (
|
6604
|
+
}), W(() => i.value, (a, o) => {
|
6605
|
+
a ? s() : l();
|
6606
|
+
}), (a, o) => f(e) ? (C(), T("div", {
|
6578
6607
|
key: 0,
|
6579
6608
|
class: "ha-progress",
|
6580
6609
|
style: ee({ width: f(t) + "%" })
|
6581
6610
|
}, null, 4)) : ye("", !0);
|
6582
6611
|
}
|
6583
|
-
}), Gs = { class: "progress-tip success" }, Zs = { class: "progress-tip error" }, el = { class: "progress-bar" }, tl = { class: "progress-info" }, rl = { key: 0 }, sl = { class: "progress-text" }, ql = /* @__PURE__ */
|
6612
|
+
}), Gs = { class: "progress-tip success" }, Zs = { class: "progress-tip error" }, el = { class: "progress-bar" }, tl = { class: "progress-info" }, rl = { key: 0 }, sl = { class: "progress-text" }, ql = /* @__PURE__ */ P({
|
6584
6613
|
__name: "SocketProgress",
|
6585
6614
|
props: {
|
6586
6615
|
title: {},
|
@@ -6588,22 +6617,22 @@ const Bl = /* @__PURE__ */ de(Xs, [["render", Ys]]), Pl = /* @__PURE__ */ B({
|
|
6588
6617
|
progress: {}
|
6589
6618
|
},
|
6590
6619
|
setup(c) {
|
6591
|
-
let i = c, { title: e, current: t, progress: r } = z(i), s = ge(() => d.math.getPercentage(r.value.handled, r.value.total)), l = ge(() => `${r.value.handled ?? "-"}/${r.value.total ?? "-"}`),
|
6592
|
-
return (
|
6620
|
+
let i = c, { title: e, current: t, progress: r } = z(i), s = ge(() => d.math.getPercentage(r.value.handled, r.value.total)), l = ge(() => `${r.value.handled ?? "-"}/${r.value.total ?? "-"}`), a = ge(() => d.math.getPercentageText(r.value.handled, r.value.total));
|
6621
|
+
return (o, u) => (C(), T("div", {
|
6593
6622
|
class: ce(["ha-socket-progress", {
|
6594
6623
|
error: f(r).errored > 0 && f(r).errored == f(r).handled,
|
6595
6624
|
warning: f(r).errored > 0 && f(r).errored < f(r).handled
|
6596
6625
|
}])
|
6597
6626
|
}, [
|
6598
|
-
|
6627
|
+
te(f(Pe), { class: "progress-tips" }, {
|
6599
6628
|
default: ue(() => [
|
6600
6629
|
S("div", Gs, "成功:" + N(f(r).succeed ?? "-"), 1),
|
6601
6630
|
S("div", Zs, "异常:" + N(f(r).errored ?? "-"), 1),
|
6602
|
-
Q(
|
6631
|
+
Q(o.$slots, "default")
|
6603
6632
|
]),
|
6604
6633
|
_: 3
|
6605
6634
|
}),
|
6606
|
-
|
6635
|
+
te(f(Pe), { class: "progress-chart" }, {
|
6607
6636
|
default: ue(() => {
|
6608
6637
|
var p;
|
6609
6638
|
return [
|
@@ -6618,7 +6647,7 @@ const Bl = /* @__PURE__ */ de(Xs, [["render", Ys]]), Pl = /* @__PURE__ */ B({
|
|
6618
6647
|
S("div", null, "进度:" + N(f(l)), 1)
|
6619
6648
|
])
|
6620
6649
|
]),
|
6621
|
-
S("div", sl, N(f(
|
6650
|
+
S("div", sl, N(f(a)) + "%", 1)
|
6622
6651
|
];
|
6623
6652
|
}),
|
6624
6653
|
_: 1
|
@@ -6631,10 +6660,10 @@ const Bl = /* @__PURE__ */ de(Xs, [["render", Ys]]), Pl = /* @__PURE__ */ B({
|
|
6631
6660
|
}, nl = { class: "spinner-title" }, il = {
|
6632
6661
|
key: 0,
|
6633
6662
|
class: "spinner-content"
|
6634
|
-
},
|
6663
|
+
}, al = { class: "stack" }, ol = {
|
6635
6664
|
key: 1,
|
6636
6665
|
class: "ha-spinner is-loading"
|
6637
|
-
}, ul = { class: "spinner-loading" }, cl = { class: "spinner-text" }, Vl = /* @__PURE__ */
|
6666
|
+
}, ul = { class: "spinner-loading" }, cl = { class: "spinner-text" }, Vl = /* @__PURE__ */ P({
|
6638
6667
|
__name: "Spinner",
|
6639
6668
|
props: {
|
6640
6669
|
title: { type: String },
|
@@ -6647,21 +6676,21 @@ const Bl = /* @__PURE__ */ de(Xs, [["render", Ys]]), Pl = /* @__PURE__ */ B({
|
|
6647
6676
|
let e = i, t = c, { title: r, content: s } = z(t), l = () => {
|
6648
6677
|
e("retry");
|
6649
6678
|
};
|
6650
|
-
return (
|
6679
|
+
return (a, o) => f(r) || f(s) ? (C(), T("div", ll, [
|
6651
6680
|
S("div", nl, [
|
6652
|
-
|
6681
|
+
Be(N(f(r)), 1),
|
6653
6682
|
S("a", {
|
6654
6683
|
class: "retry",
|
6655
|
-
onClick:
|
6684
|
+
onClick: o[0] || (o[0] = //@ts-ignore
|
6656
6685
|
(...u) => f(l) && f(l)(...u))
|
6657
6686
|
}, N(f(fe)("common.retry")), 1)
|
6658
6687
|
]),
|
6659
6688
|
f(s) ? (C(), T("div", il, [
|
6660
|
-
S("div",
|
6689
|
+
S("div", al, N(f(s)), 1)
|
6661
6690
|
])) : ye("", !0)
|
6662
|
-
])) : (C(), T("div",
|
6691
|
+
])) : (C(), T("div", ol, [
|
6663
6692
|
S("div", ul, [
|
6664
|
-
|
6693
|
+
o[1] || (o[1] = S("div", { class: "spinner-dots" }, [
|
6665
6694
|
S("i"),
|
6666
6695
|
S("i"),
|
6667
6696
|
S("i"),
|
@@ -6671,7 +6700,7 @@ const Bl = /* @__PURE__ */ de(Xs, [["render", Ys]]), Pl = /* @__PURE__ */ B({
|
|
6671
6700
|
])
|
6672
6701
|
]));
|
6673
6702
|
}
|
6674
|
-
}), dl = { class: "ha-tab" }, Wl = /* @__PURE__ */
|
6703
|
+
}), dl = { class: "ha-tab" }, Wl = /* @__PURE__ */ P({
|
6675
6704
|
__name: "Tab",
|
6676
6705
|
props: {
|
6677
6706
|
mode: {},
|
@@ -6683,7 +6712,7 @@ const Bl = /* @__PURE__ */ de(Xs, [["render", Ys]]), Pl = /* @__PURE__ */ B({
|
|
6683
6712
|
S("div", { class: "tab-body" }, null, -1)
|
6684
6713
|
])));
|
6685
6714
|
}
|
6686
|
-
}), pl = { class: "ha-dance" }, zl = /* @__PURE__ */
|
6715
|
+
}), pl = { class: "ha-dance" }, zl = /* @__PURE__ */ P({
|
6687
6716
|
__name: "Dance",
|
6688
6717
|
props: {
|
6689
6718
|
text: {},
|
@@ -6692,34 +6721,34 @@ const Bl = /* @__PURE__ */ de(Xs, [["render", Ys]]), Pl = /* @__PURE__ */ B({
|
|
6692
6721
|
setup(c) {
|
6693
6722
|
let i = c, { text: e, delay: t } = z(i);
|
6694
6723
|
return (r, s) => (C(), T("div", pl, [
|
6695
|
-
(C(!0), T(qe, null, Ve(f(e), (l,
|
6724
|
+
(C(!0), T(qe, null, Ve(f(e), (l, a) => (C(), T("div", {
|
6696
6725
|
class: "char",
|
6697
|
-
style: ee({ animationDelay: `${f(t) +
|
6726
|
+
style: ee({ animationDelay: `${f(t) + a * 0.1}s` })
|
6698
6727
|
}, N(l), 5))), 256))
|
6699
6728
|
]));
|
6700
6729
|
}
|
6701
6730
|
});
|
6702
6731
|
let Kl = async (c) => {
|
6703
6732
|
c == null && (c = new Cs()), await ys(c), await _t();
|
6704
|
-
let i = await
|
6733
|
+
let i = await Ot.getSso(), e = Z.sys.app, t = { baseUrl: c.baseUrl, language: e.language, user: i, platform: "pc" }, r = d.json.serialize(t);
|
6705
6734
|
await _.openAsync(r);
|
6706
6735
|
let s = { url: c.socketUrl }, l = d.json.serialize(s);
|
6707
|
-
await je.openAsync(l), _.onResponse = async (
|
6708
|
-
let { ok:
|
6709
|
-
return
|
6736
|
+
await je.openAsync(l), _.onResponse = async (a) => {
|
6737
|
+
let { ok: o, status: u, data: p } = a;
|
6738
|
+
return o == !1 ? (Le.add(u.toString(), a.message, "网络错误", a.elapsed), ie.error(a.message), Promise.reject(a)) : p.code == null || (Le.add(p.code, p.message, p.stack, p.elapsed), p.code == "Ok") ? Promise.resolve() : (ie.error(p.message), Promise.reject(p));
|
6710
6739
|
};
|
6711
6740
|
};
|
6712
6741
|
export {
|
6713
6742
|
Ir as ArrayUtil,
|
6714
6743
|
rs as BrowserUtil,
|
6715
|
-
|
6744
|
+
Bt as BuilderFactory,
|
6716
6745
|
Ye as Cdn,
|
6717
6746
|
qt as CdnFactory,
|
6718
6747
|
Mr as ComponentUtil,
|
6719
6748
|
Cs as CreateFeOptions,
|
6720
|
-
|
6721
|
-
|
6722
|
-
|
6749
|
+
as as DeltaUtility,
|
6750
|
+
Br as DictionaryUtil,
|
6751
|
+
Pr as DomUtil,
|
6723
6752
|
ns as DragEvent,
|
6724
6753
|
zt as EncoderFactory,
|
6725
6754
|
Fr as EventUtil,
|
@@ -6730,13 +6759,13 @@ export {
|
|
6730
6759
|
D as Factory,
|
6731
6760
|
rr as FeatureFactory,
|
6732
6761
|
Nr as FileUtil,
|
6733
|
-
|
6734
|
-
|
6735
|
-
|
6736
|
-
|
6762
|
+
Pe as HaCard,
|
6763
|
+
Ol as HaCode,
|
6764
|
+
Pl as HaCol,
|
6765
|
+
Ul as HaCompare,
|
6737
6766
|
Ks as HaCondition,
|
6738
6767
|
Ml as HaConditionGroup,
|
6739
|
-
|
6768
|
+
Bl as HaContainer,
|
6740
6769
|
zl as HaDance,
|
6741
6770
|
Dl as HaEmpty,
|
6742
6771
|
js as HaFill,
|
@@ -6767,7 +6796,7 @@ export {
|
|
6767
6796
|
yr as MessengerFactory,
|
6768
6797
|
zr as MicroUtil,
|
6769
6798
|
Kr as MountUtil,
|
6770
|
-
|
6799
|
+
os as MouseUtility,
|
6771
6800
|
Jr as ObjectUtil,
|
6772
6801
|
lt as Position,
|
6773
6802
|
Mt as ProviderFactory,
|
@@ -6801,7 +6830,7 @@ export {
|
|
6801
6830
|
$l as VideoFactory,
|
6802
6831
|
jl as VoiceFactory,
|
6803
6832
|
gs as base64,
|
6804
|
-
|
6833
|
+
se as cdn,
|
6805
6834
|
Z as configSvc,
|
6806
6835
|
Kl as createFe,
|
6807
6836
|
xl as driverSvc,
|
@@ -6831,5 +6860,5 @@ export {
|
|
6831
6860
|
vs as t_sys,
|
6832
6861
|
As as t_table,
|
6833
6862
|
fs as template,
|
6834
|
-
|
6863
|
+
Ot as userSvc
|
6835
6864
|
};
|