workdesktop-ai 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +155 -93
- package/README.md +123 -25
- package/dist/api-button/index.mjs +7 -0
- package/dist/api-button/index.mjs.map +1 -0
- package/dist/assets/Select-CNzSyvlZ.css +1 -0
- package/dist/auto-complete/index.mjs +7 -0
- package/dist/auto-complete/index.mjs.map +1 -0
- package/dist/auto-complete/style.css +1 -0
- package/dist/base.css +1 -0
- package/dist/checkbox-list/index.mjs +7 -0
- package/dist/checkbox-list/index.mjs.map +1 -0
- package/dist/checkbox-list/style.css +1 -0
- package/dist/chunks/ApiButton.vue_vue_type_script_setup_true_lang-CweWFfDE.mjs +80 -0
- package/dist/chunks/ApiButton.vue_vue_type_script_setup_true_lang-CweWFfDE.mjs.map +1 -0
- package/dist/chunks/AutoComplete-B_L169hU.mjs +80 -0
- package/dist/chunks/AutoComplete-B_L169hU.mjs.map +1 -0
- package/dist/chunks/CheckboxList-bPqpbd8d.mjs +129 -0
- package/dist/chunks/CheckboxList-bPqpbd8d.mjs.map +1 -0
- package/dist/chunks/ConfirmButton.vue_vue_type_script_setup_true_lang-DpdMPkka.mjs +99 -0
- package/dist/chunks/ConfirmButton.vue_vue_type_script_setup_true_lang-DpdMPkka.mjs.map +1 -0
- package/dist/chunks/DataForm-C6UW92Ds.mjs +305 -0
- package/dist/chunks/DataForm-C6UW92Ds.mjs.map +1 -0
- package/dist/chunks/DataGrid-BhgND4G_.mjs +1124 -0
- package/dist/chunks/DataGrid-BhgND4G_.mjs.map +1 -0
- package/dist/chunks/DialogButton.vue_vue_type_script_setup_true_lang-CTXP79zc.mjs +117 -0
- package/dist/chunks/DialogButton.vue_vue_type_script_setup_true_lang-CTXP79zc.mjs.map +1 -0
- package/dist/chunks/Drawer-ucXKUecL.mjs +259 -0
- package/dist/chunks/Drawer-ucXKUecL.mjs.map +1 -0
- package/dist/chunks/DrawerButton.vue_vue_type_script_setup_true_lang-DUda4p7_.mjs +125 -0
- package/dist/chunks/DrawerButton.vue_vue_type_script_setup_true_lang-DUda4p7_.mjs.map +1 -0
- package/dist/chunks/EditableGrid-Cx7ScWkW.mjs +1783 -0
- package/dist/chunks/EditableGrid-Cx7ScWkW.mjs.map +1 -0
- package/dist/chunks/FormItem-C1q0opnk.mjs +79 -0
- package/dist/chunks/FormItem-C1q0opnk.mjs.map +1 -0
- package/dist/chunks/Iframe-CeSiMnvR.mjs +65 -0
- package/dist/chunks/Iframe-CeSiMnvR.mjs.map +1 -0
- package/dist/chunks/ImageUpload-D3JGJjVO.mjs +193 -0
- package/dist/chunks/ImageUpload-D3JGJjVO.mjs.map +1 -0
- package/dist/chunks/Panel-d4chdlTA.mjs +113 -0
- package/dist/chunks/Panel-d4chdlTA.mjs.map +1 -0
- package/dist/chunks/PromptButton.vue_vue_type_script_setup_true_lang-BqoNAUoo.mjs +118 -0
- package/dist/chunks/PromptButton.vue_vue_type_script_setup_true_lang-BqoNAUoo.mjs.map +1 -0
- package/dist/chunks/RadioList-DT-8WSN2.mjs +129 -0
- package/dist/chunks/RadioList-DT-8WSN2.mjs.map +1 -0
- package/dist/chunks/Requester.vue_vue_type_script_setup_true_lang-5B1V-53c.mjs +80 -0
- package/dist/chunks/Requester.vue_vue_type_script_setup_true_lang-5B1V-53c.mjs.map +1 -0
- package/dist/chunks/RouteButton.vue_vue_type_script_setup_true_lang-Da0D3tKA.mjs +73 -0
- package/dist/chunks/RouteButton.vue_vue_type_script_setup_true_lang-Da0D3tKA.mjs.map +1 -0
- package/dist/chunks/SearchItem-pFO57lEO.mjs +79 -0
- package/dist/chunks/SearchItem-pFO57lEO.mjs.map +1 -0
- package/dist/chunks/SearchPanel-xQ1hPaNq.mjs +158 -0
- package/dist/chunks/SearchPanel-xQ1hPaNq.mjs.map +1 -0
- package/dist/chunks/Select-CMw-tWYm.mjs +114 -0
- package/dist/chunks/Select-CMw-tWYm.mjs.map +1 -0
- package/dist/chunks/Station-BF_QlQ8c.mjs +796 -0
- package/dist/chunks/Station-BF_QlQ8c.mjs.map +1 -0
- package/dist/chunks/Switch.vue_vue_type_script_setup_true_lang-CCU_d3jW.mjs +71 -0
- package/dist/chunks/Switch.vue_vue_type_script_setup_true_lang-CCU_d3jW.mjs.map +1 -0
- package/dist/chunks/Tips-IWCZcR1K.mjs +63 -0
- package/dist/chunks/Tips-IWCZcR1K.mjs.map +1 -0
- package/dist/chunks/TipsButton.vue_vue_type_script_setup_true_lang-DvcpRSV1.mjs +51 -0
- package/dist/chunks/TipsButton.vue_vue_type_script_setup_true_lang-DvcpRSV1.mjs.map +1 -0
- package/dist/chunks/Upload.vue_vue_type_script_setup_true_lang-CkxGO85H.mjs +200 -0
- package/dist/chunks/Upload.vue_vue_type_script_setup_true_lang-CkxGO85H.mjs.map +1 -0
- package/dist/chunks/Viewer-COLbtcgF.mjs +381 -0
- package/dist/chunks/Viewer-COLbtcgF.mjs.map +1 -0
- package/dist/chunks/_plugin-vue_export-helper-CHgC5LLL.mjs +10 -0
- package/dist/chunks/_plugin-vue_export-helper-CHgC5LLL.mjs.map +1 -0
- package/dist/chunks/containerContext-BgphFDeH.mjs +13 -0
- package/dist/chunks/containerContext-BgphFDeH.mjs.map +1 -0
- package/dist/chunks/http-DUPsbs2K.mjs +2951 -0
- package/dist/chunks/http-DUPsbs2K.mjs.map +1 -0
- package/dist/chunks/linkage-FbL1mcz3.mjs +66 -0
- package/dist/chunks/linkage-FbL1mcz3.mjs.map +1 -0
- package/dist/chunks/props-DAytpx7D.mjs +65 -0
- package/dist/chunks/props-DAytpx7D.mjs.map +1 -0
- package/dist/chunks/useApiAction-C1CdKGjt.mjs +30 -0
- package/dist/chunks/useApiAction-C1CdKGjt.mjs.map +1 -0
- package/dist/chunks/useColumnSettings-BDtF5-8R.mjs +216 -0
- package/dist/chunks/useColumnSettings-BDtF5-8R.mjs.map +1 -0
- package/dist/chunks/useOptionsLoader-D0RTB_ar.mjs +64 -0
- package/dist/chunks/useOptionsLoader-D0RTB_ar.mjs.map +1 -0
- package/dist/confirm-button/index.mjs +7 -0
- package/dist/confirm-button/index.mjs.map +1 -0
- package/dist/data-form/index.mjs +7 -0
- package/dist/data-form/index.mjs.map +1 -0
- package/dist/data-form/style.css +1 -0
- package/dist/data-grid/index.mjs +7 -0
- package/dist/data-grid/index.mjs.map +1 -0
- package/dist/data-grid/style.css +1 -0
- package/dist/dialog-button/index.mjs +7 -0
- package/dist/dialog-button/index.mjs.map +1 -0
- package/dist/drawer/index.mjs +7 -0
- package/dist/drawer/index.mjs.map +1 -0
- package/dist/drawer/style.css +1 -0
- package/dist/drawer-button/index.mjs +7 -0
- package/dist/drawer-button/index.mjs.map +1 -0
- package/dist/editable-grid/index.mjs +7 -0
- package/dist/editable-grid/index.mjs.map +1 -0
- package/dist/editable-grid/style.css +1 -0
- package/dist/form-item/index.mjs +7 -0
- package/dist/form-item/index.mjs.map +1 -0
- package/dist/form-item/style.css +1 -0
- package/dist/iframe/index.mjs +7 -0
- package/dist/iframe/index.mjs.map +1 -0
- package/dist/iframe/style.css +1 -0
- package/dist/image-upload/index.mjs +7 -0
- package/dist/image-upload/index.mjs.map +1 -0
- package/dist/image-upload/style.css +1 -0
- package/dist/index.esm.js +318 -6495
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +20 -9
- package/dist/index.umd.js.map +1 -1
- package/dist/panel/index.mjs +7 -0
- package/dist/panel/index.mjs.map +1 -0
- package/dist/panel/style.css +1 -0
- package/dist/prompt-button/index.mjs +7 -0
- package/dist/prompt-button/index.mjs.map +1 -0
- package/dist/radio-list/index.mjs +7 -0
- package/dist/radio-list/index.mjs.map +1 -0
- package/dist/radio-list/style.css +1 -0
- package/dist/requester/index.mjs +7 -0
- package/dist/requester/index.mjs.map +1 -0
- package/dist/route-button/index.mjs +7 -0
- package/dist/route-button/index.mjs.map +1 -0
- package/dist/search-item/index.mjs +7 -0
- package/dist/search-item/index.mjs.map +1 -0
- package/dist/search-item/style.css +1 -0
- package/dist/search-panel/index.mjs +7 -0
- package/dist/search-panel/index.mjs.map +1 -0
- package/dist/search-panel/style.css +1 -0
- package/dist/select/index.mjs +7 -0
- package/dist/select/index.mjs.map +1 -0
- package/dist/station/index.mjs +7 -0
- package/dist/station/index.mjs.map +1 -0
- package/dist/station/style.css +1 -0
- package/dist/style.css +1 -1
- package/dist/switch/index.mjs +7 -0
- package/dist/switch/index.mjs.map +1 -0
- package/dist/tips/index.mjs +7 -0
- package/dist/tips/index.mjs.map +1 -0
- package/dist/tips/style.css +1 -0
- package/dist/tips-button/index.mjs +7 -0
- package/dist/tips-button/index.mjs.map +1 -0
- package/dist/types/src/components/buttons/ApiButton.vue.d.ts +35 -6
- package/dist/types/src/components/buttons/ConfirmButton.vue.d.ts +37 -8
- package/dist/types/src/components/buttons/DialogButton.vue.d.ts +89 -29
- package/dist/types/src/components/buttons/DrawerButton.vue.d.ts +99 -31
- package/dist/types/src/components/buttons/PopconfirmButton.vue.d.ts +317 -0
- package/dist/types/src/components/buttons/PromptButton.vue.d.ts +45 -14
- package/dist/types/src/components/buttons/RouteButton.vue.d.ts +34 -5
- package/dist/types/src/components/buttons/TipsButton.vue.d.ts +8 -15
- package/dist/types/src/components/common/props.d.ts +32 -2
- package/dist/types/src/components/containers/Drawer.vue.d.ts +61 -8
- package/dist/types/src/components/containers/Iframe.vue.d.ts +39 -2
- package/dist/types/src/components/containers/containerContext.d.ts +1 -1
- package/dist/types/src/components/containers/useContainerController.d.ts +5 -0
- package/dist/types/src/components/containers/useIframeContainer.d.ts +20 -0
- package/dist/types/src/components/core/Requester.vue.d.ts +41 -0
- package/dist/types/src/components/data/datagrid/DataGrid.vue.d.ts +212 -5
- package/dist/types/src/components/data/datagrid/useColumnSettings.d.ts +14 -0
- package/dist/types/src/components/data/editable-grid/EditableGrid.vue.d.ts +586 -0
- package/dist/types/src/components/data/viewer/Viewer.vue.d.ts +187 -0
- package/dist/types/src/components/form/FormItem.vue.d.ts +62 -0
- package/dist/types/src/components/form/SearchItem.vue.d.ts +62 -0
- package/dist/types/src/components/{containers → form}/SearchPanel.vue.d.ts +17 -2
- package/dist/types/src/components/form/data-form/DataForm.vue.d.ts +6 -6
- package/dist/types/src/components/index.d.ts +10 -6
- package/dist/types/src/components/inputs/AutoComplete.vue.d.ts +10 -1
- package/dist/types/src/components/inputs/CheckboxList.vue.d.ts +28 -3
- package/dist/types/src/components/inputs/RadioList.vue.d.ts +28 -3
- package/dist/types/src/components/inputs/Select.vue.d.ts +11 -1
- package/dist/types/src/components/inputs/Switch.vue.d.ts +2 -2
- package/dist/types/src/components/inputs/useOptionsLoader.d.ts +3 -0
- package/dist/types/src/components/layout/Station.vue.d.ts +302 -0
- package/dist/types/src/components/layout/StationMenuNode.vue.d.ts +20 -0
- package/dist/types/src/components/layout/types.d.ts +54 -0
- package/dist/types/src/components/styles/Panel.vue.d.ts +47 -5
- package/dist/types/src/components/upload/ImageUpload.vue.d.ts +4 -4
- package/dist/types/src/components/upload/Upload.vue.d.ts +1 -1
- package/dist/types/src/entries/api-button.d.ts +9 -0
- package/dist/types/src/entries/auto-complete.d.ts +9 -0
- package/dist/types/src/entries/checkbox-list.d.ts +9 -0
- package/dist/types/src/entries/components-map.d.ts +8 -0
- package/dist/types/src/entries/confirm-button.d.ts +9 -0
- package/dist/types/src/entries/data-form.d.ts +9 -0
- package/dist/types/src/entries/data-grid.d.ts +9 -0
- package/dist/types/src/entries/dialog-button.d.ts +9 -0
- package/dist/types/src/entries/drawer-button.d.ts +9 -0
- package/dist/types/src/entries/drawer.d.ts +9 -0
- package/dist/types/src/entries/editable-grid.d.ts +9 -0
- package/dist/types/src/entries/form-item.d.ts +9 -0
- package/dist/types/src/entries/iframe.d.ts +9 -0
- package/dist/types/src/entries/image-upload.d.ts +9 -0
- package/dist/types/src/entries/panel.d.ts +9 -0
- package/dist/types/src/entries/prompt-button.d.ts +9 -0
- package/dist/types/src/entries/radio-list.d.ts +9 -0
- package/dist/types/src/entries/requester.d.ts +9 -0
- package/dist/types/src/entries/route-button.d.ts +9 -0
- package/dist/types/src/entries/search-item.d.ts +9 -0
- package/dist/types/src/entries/search-panel.d.ts +9 -0
- package/dist/types/src/entries/select.d.ts +9 -0
- package/dist/types/src/entries/station.d.ts +9 -0
- package/dist/types/src/entries/switch.d.ts +9 -0
- package/dist/types/src/entries/tips-button.d.ts +9 -0
- package/dist/types/src/entries/tips.d.ts +9 -0
- package/dist/types/src/entries/upload.d.ts +9 -0
- package/dist/types/src/entries/viewer.d.ts +9 -0
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/lib/composables/useDataGrid.d.ts +15 -0
- package/dist/types/src/lib/core/http.d.ts +21 -4
- package/dist/types/src/lib/core/station-linkage.d.ts +41 -0
- package/dist/types/src/types/config.d.ts +20 -3
- package/dist/types/vite.config.d.ts +6 -1
- package/dist/upload/index.mjs +7 -0
- package/dist/upload/index.mjs.map +1 -0
- package/dist/viewer/index.mjs +7 -0
- package/dist/viewer/index.mjs.map +1 -0
- package/dist/viewer/style.css +1 -0
- package/package.json +199 -68
- package/dist/types/src/components/containers/Dialog.vue.d.ts +0 -112
- package/dist/types/src/components/data/editable-table/EditableTable.vue.d.ts +0 -306
- package/dist/types/src/components/utils/Viewer.vue.d.ts +0 -131
|
@@ -0,0 +1,1783 @@
|
|
|
1
|
+
import { defineComponent as yt, useSlots as pn, ref as oe, computed as X, reactive as ye, watch as Se, nextTick as gn, onMounted as mn, onBeforeUnmount as vn, resolveComponent as H, resolveDirective as yn, openBlock as v, createElementBlock as j, normalizeStyle as hn, normalizeClass as Ue, createElementVNode as de, renderSlot as le, unref as x, createBlock as F, withCtx as _, createTextVNode as Z, toDisplayString as ae, createCommentVNode as K, createVNode as q, withDirectives as ht, Fragment as se, renderList as fe, isRef as wn } from "vue";
|
|
2
|
+
import { Plus as bn, Refresh as _n, ScaleToOriginal as Sn, Grid as kn, Menu as Cn, Setting as Vn, WarningFilled as wt } from "@element-plus/icons-vue";
|
|
3
|
+
import { ElMessage as he, ElMessageBox as qn } from "element-plus";
|
|
4
|
+
import { u as Fn, a as An, e as xn } from "./useColumnSettings-BDtF5-8R.mjs";
|
|
5
|
+
import { a as En, r as On } from "./linkage-FbL1mcz3.mjs";
|
|
6
|
+
import { c as Rn, a as Pn, r as bt } from "./http-DUPsbs2K.mjs";
|
|
7
|
+
import { h as Mn, f as zn } from "./props-DAytpx7D.mjs";
|
|
8
|
+
import { _ as Bn } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
9
|
+
function ce() {
|
|
10
|
+
return ce = Object.assign ? Object.assign.bind() : function(o) {
|
|
11
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
12
|
+
var t = arguments[e];
|
|
13
|
+
for (var a in t)
|
|
14
|
+
Object.prototype.hasOwnProperty.call(t, a) && (o[a] = t[a]);
|
|
15
|
+
}
|
|
16
|
+
return o;
|
|
17
|
+
}, ce.apply(this, arguments);
|
|
18
|
+
}
|
|
19
|
+
function jn(o, e) {
|
|
20
|
+
o.prototype = Object.create(e.prototype), o.prototype.constructor = o, Ve(o, e);
|
|
21
|
+
}
|
|
22
|
+
function Ke(o) {
|
|
23
|
+
return Ke = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
24
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
25
|
+
}, Ke(o);
|
|
26
|
+
}
|
|
27
|
+
function Ve(o, e) {
|
|
28
|
+
return Ve = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(a, n) {
|
|
29
|
+
return a.__proto__ = n, a;
|
|
30
|
+
}, Ve(o, e);
|
|
31
|
+
}
|
|
32
|
+
function Dn() {
|
|
33
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
34
|
+
if (typeof Proxy == "function") return !0;
|
|
35
|
+
try {
|
|
36
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
37
|
+
})), !0;
|
|
38
|
+
} catch {
|
|
39
|
+
return !1;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function Me(o, e, t) {
|
|
43
|
+
return Dn() ? Me = Reflect.construct.bind() : Me = function(n, l, d) {
|
|
44
|
+
var f = [null];
|
|
45
|
+
f.push.apply(f, l);
|
|
46
|
+
var w = Function.bind.apply(n, f), M = new w();
|
|
47
|
+
return d && Ve(M, d.prototype), M;
|
|
48
|
+
}, Me.apply(null, arguments);
|
|
49
|
+
}
|
|
50
|
+
function Nn(o) {
|
|
51
|
+
return Function.toString.call(o).indexOf("[native code]") !== -1;
|
|
52
|
+
}
|
|
53
|
+
function We(o) {
|
|
54
|
+
var e = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
55
|
+
return We = function(a) {
|
|
56
|
+
if (a === null || !Nn(a)) return a;
|
|
57
|
+
if (typeof a != "function")
|
|
58
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
59
|
+
if (typeof e < "u") {
|
|
60
|
+
if (e.has(a)) return e.get(a);
|
|
61
|
+
e.set(a, n);
|
|
62
|
+
}
|
|
63
|
+
function n() {
|
|
64
|
+
return Me(a, arguments, Ke(this).constructor);
|
|
65
|
+
}
|
|
66
|
+
return n.prototype = Object.create(a.prototype, {
|
|
67
|
+
constructor: {
|
|
68
|
+
value: n,
|
|
69
|
+
enumerable: !1,
|
|
70
|
+
writable: !0,
|
|
71
|
+
configurable: !0
|
|
72
|
+
}
|
|
73
|
+
}), Ve(n, a);
|
|
74
|
+
}, We(o);
|
|
75
|
+
}
|
|
76
|
+
var Tn = /%[sdj%]/g, qt = function() {
|
|
77
|
+
};
|
|
78
|
+
typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (qt = function(e, t) {
|
|
79
|
+
typeof console < "u" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING > "u" && t.every(function(a) {
|
|
80
|
+
return typeof a == "string";
|
|
81
|
+
}) && console.warn(e, t);
|
|
82
|
+
});
|
|
83
|
+
function Le(o) {
|
|
84
|
+
if (!o || !o.length) return null;
|
|
85
|
+
var e = {};
|
|
86
|
+
return o.forEach(function(t) {
|
|
87
|
+
var a = t.field;
|
|
88
|
+
e[a] = e[a] || [], e[a].push(t);
|
|
89
|
+
}), e;
|
|
90
|
+
}
|
|
91
|
+
function ee(o) {
|
|
92
|
+
for (var e = arguments.length, t = new Array(e > 1 ? e - 1 : 0), a = 1; a < e; a++)
|
|
93
|
+
t[a - 1] = arguments[a];
|
|
94
|
+
var n = 0, l = t.length;
|
|
95
|
+
if (typeof o == "function")
|
|
96
|
+
return o.apply(null, t);
|
|
97
|
+
if (typeof o == "string") {
|
|
98
|
+
var d = o.replace(Tn, function(f) {
|
|
99
|
+
if (f === "%%")
|
|
100
|
+
return "%";
|
|
101
|
+
if (n >= l)
|
|
102
|
+
return f;
|
|
103
|
+
switch (f) {
|
|
104
|
+
case "%s":
|
|
105
|
+
return String(t[n++]);
|
|
106
|
+
case "%d":
|
|
107
|
+
return Number(t[n++]);
|
|
108
|
+
case "%j":
|
|
109
|
+
try {
|
|
110
|
+
return JSON.stringify(t[n++]);
|
|
111
|
+
} catch {
|
|
112
|
+
return "[Circular]";
|
|
113
|
+
}
|
|
114
|
+
break;
|
|
115
|
+
default:
|
|
116
|
+
return f;
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
return d;
|
|
120
|
+
}
|
|
121
|
+
return o;
|
|
122
|
+
}
|
|
123
|
+
function Un(o) {
|
|
124
|
+
return o === "string" || o === "url" || o === "hex" || o === "email" || o === "date" || o === "pattern";
|
|
125
|
+
}
|
|
126
|
+
function T(o, e) {
|
|
127
|
+
return !!(o == null || e === "array" && Array.isArray(o) && !o.length || Un(e) && typeof o == "string" && !o);
|
|
128
|
+
}
|
|
129
|
+
function $n(o, e, t) {
|
|
130
|
+
var a = [], n = 0, l = o.length;
|
|
131
|
+
function d(f) {
|
|
132
|
+
a.push.apply(a, f || []), n++, n === l && t(a);
|
|
133
|
+
}
|
|
134
|
+
o.forEach(function(f) {
|
|
135
|
+
e(f, d);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function _t(o, e, t) {
|
|
139
|
+
var a = 0, n = o.length;
|
|
140
|
+
function l(d) {
|
|
141
|
+
if (d && d.length) {
|
|
142
|
+
t(d);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
var f = a;
|
|
146
|
+
a = a + 1, f < n ? e(o[f], l) : t([]);
|
|
147
|
+
}
|
|
148
|
+
l([]);
|
|
149
|
+
}
|
|
150
|
+
function Kn(o) {
|
|
151
|
+
var e = [];
|
|
152
|
+
return Object.keys(o).forEach(function(t) {
|
|
153
|
+
e.push.apply(e, o[t] || []);
|
|
154
|
+
}), e;
|
|
155
|
+
}
|
|
156
|
+
var St = /* @__PURE__ */ function(o) {
|
|
157
|
+
jn(e, o);
|
|
158
|
+
function e(t, a) {
|
|
159
|
+
var n;
|
|
160
|
+
return n = o.call(this, "Async Validation Error") || this, n.errors = t, n.fields = a, n;
|
|
161
|
+
}
|
|
162
|
+
return e;
|
|
163
|
+
}(/* @__PURE__ */ We(Error));
|
|
164
|
+
function Wn(o, e, t, a, n) {
|
|
165
|
+
if (e.first) {
|
|
166
|
+
var l = new Promise(function(N, z) {
|
|
167
|
+
var R = function(p) {
|
|
168
|
+
return a(p), p.length ? z(new St(p, Le(p))) : N(n);
|
|
169
|
+
}, b = Kn(o);
|
|
170
|
+
_t(b, t, R);
|
|
171
|
+
});
|
|
172
|
+
return l.catch(function(N) {
|
|
173
|
+
return N;
|
|
174
|
+
}), l;
|
|
175
|
+
}
|
|
176
|
+
var d = e.firstFields === !0 ? Object.keys(o) : e.firstFields || [], f = Object.keys(o), w = f.length, M = 0, O = [], D = new Promise(function(N, z) {
|
|
177
|
+
var R = function(E) {
|
|
178
|
+
if (O.push.apply(O, E), M++, M === w)
|
|
179
|
+
return a(O), O.length ? z(new St(O, Le(O))) : N(n);
|
|
180
|
+
};
|
|
181
|
+
f.length || (a(O), N(n)), f.forEach(function(b) {
|
|
182
|
+
var E = o[b];
|
|
183
|
+
d.indexOf(b) !== -1 ? _t(E, t, R) : $n(E, t, R);
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
return D.catch(function(N) {
|
|
187
|
+
return N;
|
|
188
|
+
}), D;
|
|
189
|
+
}
|
|
190
|
+
function Ln(o) {
|
|
191
|
+
return !!(o && o.message !== void 0);
|
|
192
|
+
}
|
|
193
|
+
function Hn(o, e) {
|
|
194
|
+
for (var t = o, a = 0; a < e.length; a++) {
|
|
195
|
+
if (t == null)
|
|
196
|
+
return t;
|
|
197
|
+
t = t[e[a]];
|
|
198
|
+
}
|
|
199
|
+
return t;
|
|
200
|
+
}
|
|
201
|
+
function kt(o, e) {
|
|
202
|
+
return function(t) {
|
|
203
|
+
var a;
|
|
204
|
+
return o.fullFields ? a = Hn(e, o.fullFields) : a = e[t.field || o.fullField], Ln(t) ? (t.field = t.field || o.fullField, t.fieldValue = a, t) : {
|
|
205
|
+
message: typeof t == "function" ? t() : t,
|
|
206
|
+
fieldValue: a,
|
|
207
|
+
field: t.field || o.fullField
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
function Ct(o, e) {
|
|
212
|
+
if (e) {
|
|
213
|
+
for (var t in e)
|
|
214
|
+
if (e.hasOwnProperty(t)) {
|
|
215
|
+
var a = e[t];
|
|
216
|
+
typeof a == "object" && typeof o[t] == "object" ? o[t] = ce({}, o[t], a) : o[t] = a;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
return o;
|
|
220
|
+
}
|
|
221
|
+
var Ft = function(e, t, a, n, l, d) {
|
|
222
|
+
e.required && (!a.hasOwnProperty(e.field) || T(t, d || e.type)) && n.push(ee(l.messages.required, e.fullField));
|
|
223
|
+
}, In = function(e, t, a, n, l) {
|
|
224
|
+
(/^\s+$/.test(t) || t === "") && n.push(ee(l.messages.whitespace, e.fullField));
|
|
225
|
+
}, Pe, Yn = function() {
|
|
226
|
+
if (Pe)
|
|
227
|
+
return Pe;
|
|
228
|
+
var o = "[a-fA-F\\d:]", e = function(c) {
|
|
229
|
+
return c && c.includeBoundaries ? "(?:(?<=\\s|^)(?=" + o + ")|(?<=" + o + ")(?=\\s|$))" : "";
|
|
230
|
+
}, t = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}", a = "[a-fA-F\\d]{1,4}", n = (`
|
|
231
|
+
(?:
|
|
232
|
+
(?:` + a + ":){7}(?:" + a + `|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|
233
|
+
(?:` + a + ":){6}(?:" + t + "|:" + a + `|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
|
|
234
|
+
(?:` + a + ":){5}(?::" + t + "|(?::" + a + `){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
|
|
235
|
+
(?:` + a + ":){4}(?:(?::" + a + "){0,1}:" + t + "|(?::" + a + `){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
|
|
236
|
+
(?:` + a + ":){3}(?:(?::" + a + "){0,2}:" + t + "|(?::" + a + `){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
|
|
237
|
+
(?:` + a + ":){2}(?:(?::" + a + "){0,3}:" + t + "|(?::" + a + `){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
|
|
238
|
+
(?:` + a + ":){1}(?:(?::" + a + "){0,4}:" + t + "|(?::" + a + `){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
|
239
|
+
(?::(?:(?::` + a + "){0,5}:" + t + "|(?::" + a + `){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
|
|
240
|
+
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
|
|
241
|
+
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), l = new RegExp("(?:^" + t + "$)|(?:^" + n + "$)"), d = new RegExp("^" + t + "$"), f = new RegExp("^" + n + "$"), w = function(c) {
|
|
242
|
+
return c && c.exact ? l : new RegExp("(?:" + e(c) + t + e(c) + ")|(?:" + e(c) + n + e(c) + ")", "g");
|
|
243
|
+
};
|
|
244
|
+
w.v4 = function(k) {
|
|
245
|
+
return k && k.exact ? d : new RegExp("" + e(k) + t + e(k), "g");
|
|
246
|
+
}, w.v6 = function(k) {
|
|
247
|
+
return k && k.exact ? f : new RegExp("" + e(k) + n + e(k), "g");
|
|
248
|
+
};
|
|
249
|
+
var M = "(?:(?:[a-z]+:)?//)", O = "(?:\\S+(?::\\S*)?@)?", D = w.v4().source, N = w.v6().source, z = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", R = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", b = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", E = "(?::\\d{2,5})?", p = '(?:[/?#][^\\s"]*)?', Q = "(?:" + M + "|www\\.)" + O + "(?:localhost|" + D + "|" + N + "|" + z + R + b + ")" + E + p;
|
|
250
|
+
return Pe = new RegExp("(?:^" + Q + "$)", "i"), Pe;
|
|
251
|
+
}, Vt = {
|
|
252
|
+
// http://emailregex.com/
|
|
253
|
+
email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
|
|
254
|
+
// url: new RegExp(
|
|
255
|
+
// '^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$',
|
|
256
|
+
// 'i',
|
|
257
|
+
// ),
|
|
258
|
+
hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
|
|
259
|
+
}, ke = {
|
|
260
|
+
integer: function(e) {
|
|
261
|
+
return ke.number(e) && parseInt(e, 10) === e;
|
|
262
|
+
},
|
|
263
|
+
float: function(e) {
|
|
264
|
+
return ke.number(e) && !ke.integer(e);
|
|
265
|
+
},
|
|
266
|
+
array: function(e) {
|
|
267
|
+
return Array.isArray(e);
|
|
268
|
+
},
|
|
269
|
+
regexp: function(e) {
|
|
270
|
+
if (e instanceof RegExp)
|
|
271
|
+
return !0;
|
|
272
|
+
try {
|
|
273
|
+
return !!new RegExp(e);
|
|
274
|
+
} catch {
|
|
275
|
+
return !1;
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
date: function(e) {
|
|
279
|
+
return typeof e.getTime == "function" && typeof e.getMonth == "function" && typeof e.getYear == "function" && !isNaN(e.getTime());
|
|
280
|
+
},
|
|
281
|
+
number: function(e) {
|
|
282
|
+
return isNaN(e) ? !1 : typeof e == "number";
|
|
283
|
+
},
|
|
284
|
+
object: function(e) {
|
|
285
|
+
return typeof e == "object" && !ke.array(e);
|
|
286
|
+
},
|
|
287
|
+
method: function(e) {
|
|
288
|
+
return typeof e == "function";
|
|
289
|
+
},
|
|
290
|
+
email: function(e) {
|
|
291
|
+
return typeof e == "string" && e.length <= 320 && !!e.match(Vt.email);
|
|
292
|
+
},
|
|
293
|
+
url: function(e) {
|
|
294
|
+
return typeof e == "string" && e.length <= 2048 && !!e.match(Yn());
|
|
295
|
+
},
|
|
296
|
+
hex: function(e) {
|
|
297
|
+
return typeof e == "string" && !!e.match(Vt.hex);
|
|
298
|
+
}
|
|
299
|
+
}, Gn = function(e, t, a, n, l) {
|
|
300
|
+
if (e.required && t === void 0) {
|
|
301
|
+
Ft(e, t, a, n, l);
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
var d = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], f = e.type;
|
|
305
|
+
d.indexOf(f) > -1 ? ke[f](t) || n.push(ee(l.messages.types[f], e.fullField, e.type)) : f && typeof t !== e.type && n.push(ee(l.messages.types[f], e.fullField, e.type));
|
|
306
|
+
}, Jn = function(e, t, a, n, l) {
|
|
307
|
+
var d = typeof e.len == "number", f = typeof e.min == "number", w = typeof e.max == "number", M = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, O = t, D = null, N = typeof t == "number", z = typeof t == "string", R = Array.isArray(t);
|
|
308
|
+
if (N ? D = "number" : z ? D = "string" : R && (D = "array"), !D)
|
|
309
|
+
return !1;
|
|
310
|
+
R && (O = t.length), z && (O = t.replace(M, "_").length), d ? O !== e.len && n.push(ee(l.messages[D].len, e.fullField, e.len)) : f && !w && O < e.min ? n.push(ee(l.messages[D].min, e.fullField, e.min)) : w && !f && O > e.max ? n.push(ee(l.messages[D].max, e.fullField, e.max)) : f && w && (O < e.min || O > e.max) && n.push(ee(l.messages[D].range, e.fullField, e.min, e.max));
|
|
311
|
+
}, we = "enum", Zn = function(e, t, a, n, l) {
|
|
312
|
+
e[we] = Array.isArray(e[we]) ? e[we] : [], e[we].indexOf(t) === -1 && n.push(ee(l.messages[we], e.fullField, e[we].join(", ")));
|
|
313
|
+
}, Qn = function(e, t, a, n, l) {
|
|
314
|
+
if (e.pattern) {
|
|
315
|
+
if (e.pattern instanceof RegExp)
|
|
316
|
+
e.pattern.lastIndex = 0, e.pattern.test(t) || n.push(ee(l.messages.pattern.mismatch, e.fullField, t, e.pattern));
|
|
317
|
+
else if (typeof e.pattern == "string") {
|
|
318
|
+
var d = new RegExp(e.pattern);
|
|
319
|
+
d.test(t) || n.push(ee(l.messages.pattern.mismatch, e.fullField, t, e.pattern));
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}, V = {
|
|
323
|
+
required: Ft,
|
|
324
|
+
whitespace: In,
|
|
325
|
+
type: Gn,
|
|
326
|
+
range: Jn,
|
|
327
|
+
enum: Zn,
|
|
328
|
+
pattern: Qn
|
|
329
|
+
}, Xn = function(e, t, a, n, l) {
|
|
330
|
+
var d = [], f = e.required || !e.required && n.hasOwnProperty(e.field);
|
|
331
|
+
if (f) {
|
|
332
|
+
if (T(t, "string") && !e.required)
|
|
333
|
+
return a();
|
|
334
|
+
V.required(e, t, n, d, l, "string"), T(t, "string") || (V.type(e, t, n, d, l), V.range(e, t, n, d, l), V.pattern(e, t, n, d, l), e.whitespace === !0 && V.whitespace(e, t, n, d, l));
|
|
335
|
+
}
|
|
336
|
+
a(d);
|
|
337
|
+
}, er = function(e, t, a, n, l) {
|
|
338
|
+
var d = [], f = e.required || !e.required && n.hasOwnProperty(e.field);
|
|
339
|
+
if (f) {
|
|
340
|
+
if (T(t) && !e.required)
|
|
341
|
+
return a();
|
|
342
|
+
V.required(e, t, n, d, l), t !== void 0 && V.type(e, t, n, d, l);
|
|
343
|
+
}
|
|
344
|
+
a(d);
|
|
345
|
+
}, tr = function(e, t, a, n, l) {
|
|
346
|
+
var d = [], f = e.required || !e.required && n.hasOwnProperty(e.field);
|
|
347
|
+
if (f) {
|
|
348
|
+
if (t === "" && (t = void 0), T(t) && !e.required)
|
|
349
|
+
return a();
|
|
350
|
+
V.required(e, t, n, d, l), t !== void 0 && (V.type(e, t, n, d, l), V.range(e, t, n, d, l));
|
|
351
|
+
}
|
|
352
|
+
a(d);
|
|
353
|
+
}, nr = function(e, t, a, n, l) {
|
|
354
|
+
var d = [], f = e.required || !e.required && n.hasOwnProperty(e.field);
|
|
355
|
+
if (f) {
|
|
356
|
+
if (T(t) && !e.required)
|
|
357
|
+
return a();
|
|
358
|
+
V.required(e, t, n, d, l), t !== void 0 && V.type(e, t, n, d, l);
|
|
359
|
+
}
|
|
360
|
+
a(d);
|
|
361
|
+
}, rr = function(e, t, a, n, l) {
|
|
362
|
+
var d = [], f = e.required || !e.required && n.hasOwnProperty(e.field);
|
|
363
|
+
if (f) {
|
|
364
|
+
if (T(t) && !e.required)
|
|
365
|
+
return a();
|
|
366
|
+
V.required(e, t, n, d, l), T(t) || V.type(e, t, n, d, l);
|
|
367
|
+
}
|
|
368
|
+
a(d);
|
|
369
|
+
}, ar = function(e, t, a, n, l) {
|
|
370
|
+
var d = [], f = e.required || !e.required && n.hasOwnProperty(e.field);
|
|
371
|
+
if (f) {
|
|
372
|
+
if (T(t) && !e.required)
|
|
373
|
+
return a();
|
|
374
|
+
V.required(e, t, n, d, l), t !== void 0 && (V.type(e, t, n, d, l), V.range(e, t, n, d, l));
|
|
375
|
+
}
|
|
376
|
+
a(d);
|
|
377
|
+
}, ir = function(e, t, a, n, l) {
|
|
378
|
+
var d = [], f = e.required || !e.required && n.hasOwnProperty(e.field);
|
|
379
|
+
if (f) {
|
|
380
|
+
if (T(t) && !e.required)
|
|
381
|
+
return a();
|
|
382
|
+
V.required(e, t, n, d, l), t !== void 0 && (V.type(e, t, n, d, l), V.range(e, t, n, d, l));
|
|
383
|
+
}
|
|
384
|
+
a(d);
|
|
385
|
+
}, or = function(e, t, a, n, l) {
|
|
386
|
+
var d = [], f = e.required || !e.required && n.hasOwnProperty(e.field);
|
|
387
|
+
if (f) {
|
|
388
|
+
if (t == null && !e.required)
|
|
389
|
+
return a();
|
|
390
|
+
V.required(e, t, n, d, l, "array"), t != null && (V.type(e, t, n, d, l), V.range(e, t, n, d, l));
|
|
391
|
+
}
|
|
392
|
+
a(d);
|
|
393
|
+
}, lr = function(e, t, a, n, l) {
|
|
394
|
+
var d = [], f = e.required || !e.required && n.hasOwnProperty(e.field);
|
|
395
|
+
if (f) {
|
|
396
|
+
if (T(t) && !e.required)
|
|
397
|
+
return a();
|
|
398
|
+
V.required(e, t, n, d, l), t !== void 0 && V.type(e, t, n, d, l);
|
|
399
|
+
}
|
|
400
|
+
a(d);
|
|
401
|
+
}, sr = "enum", ur = function(e, t, a, n, l) {
|
|
402
|
+
var d = [], f = e.required || !e.required && n.hasOwnProperty(e.field);
|
|
403
|
+
if (f) {
|
|
404
|
+
if (T(t) && !e.required)
|
|
405
|
+
return a();
|
|
406
|
+
V.required(e, t, n, d, l), t !== void 0 && V[sr](e, t, n, d, l);
|
|
407
|
+
}
|
|
408
|
+
a(d);
|
|
409
|
+
}, dr = function(e, t, a, n, l) {
|
|
410
|
+
var d = [], f = e.required || !e.required && n.hasOwnProperty(e.field);
|
|
411
|
+
if (f) {
|
|
412
|
+
if (T(t, "string") && !e.required)
|
|
413
|
+
return a();
|
|
414
|
+
V.required(e, t, n, d, l), T(t, "string") || V.pattern(e, t, n, d, l);
|
|
415
|
+
}
|
|
416
|
+
a(d);
|
|
417
|
+
}, fr = function(e, t, a, n, l) {
|
|
418
|
+
var d = [], f = e.required || !e.required && n.hasOwnProperty(e.field);
|
|
419
|
+
if (f) {
|
|
420
|
+
if (T(t, "date") && !e.required)
|
|
421
|
+
return a();
|
|
422
|
+
if (V.required(e, t, n, d, l), !T(t, "date")) {
|
|
423
|
+
var w;
|
|
424
|
+
t instanceof Date ? w = t : w = new Date(t), V.type(e, w, n, d, l), w && V.range(e, w.getTime(), n, d, l);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
a(d);
|
|
428
|
+
}, cr = function(e, t, a, n, l) {
|
|
429
|
+
var d = [], f = Array.isArray(t) ? "array" : typeof t;
|
|
430
|
+
V.required(e, t, n, d, l, f), a(d);
|
|
431
|
+
}, $e = function(e, t, a, n, l) {
|
|
432
|
+
var d = e.type, f = [], w = e.required || !e.required && n.hasOwnProperty(e.field);
|
|
433
|
+
if (w) {
|
|
434
|
+
if (T(t, d) && !e.required)
|
|
435
|
+
return a();
|
|
436
|
+
V.required(e, t, n, f, l, d), T(t, d) || V.type(e, t, n, f, l);
|
|
437
|
+
}
|
|
438
|
+
a(f);
|
|
439
|
+
}, pr = function(e, t, a, n, l) {
|
|
440
|
+
var d = [], f = e.required || !e.required && n.hasOwnProperty(e.field);
|
|
441
|
+
if (f) {
|
|
442
|
+
if (T(t) && !e.required)
|
|
443
|
+
return a();
|
|
444
|
+
V.required(e, t, n, d, l);
|
|
445
|
+
}
|
|
446
|
+
a(d);
|
|
447
|
+
}, Ce = {
|
|
448
|
+
string: Xn,
|
|
449
|
+
method: er,
|
|
450
|
+
number: tr,
|
|
451
|
+
boolean: nr,
|
|
452
|
+
regexp: rr,
|
|
453
|
+
integer: ar,
|
|
454
|
+
float: ir,
|
|
455
|
+
array: or,
|
|
456
|
+
object: lr,
|
|
457
|
+
enum: ur,
|
|
458
|
+
pattern: dr,
|
|
459
|
+
date: fr,
|
|
460
|
+
url: $e,
|
|
461
|
+
hex: $e,
|
|
462
|
+
email: $e,
|
|
463
|
+
required: cr,
|
|
464
|
+
any: pr
|
|
465
|
+
};
|
|
466
|
+
function He() {
|
|
467
|
+
return {
|
|
468
|
+
default: "Validation error on field %s",
|
|
469
|
+
required: "%s is required",
|
|
470
|
+
enum: "%s must be one of %s",
|
|
471
|
+
whitespace: "%s cannot be empty",
|
|
472
|
+
date: {
|
|
473
|
+
format: "%s date %s is invalid for format %s",
|
|
474
|
+
parse: "%s date could not be parsed, %s is invalid ",
|
|
475
|
+
invalid: "%s date %s is invalid"
|
|
476
|
+
},
|
|
477
|
+
types: {
|
|
478
|
+
string: "%s is not a %s",
|
|
479
|
+
method: "%s is not a %s (function)",
|
|
480
|
+
array: "%s is not an %s",
|
|
481
|
+
object: "%s is not an %s",
|
|
482
|
+
number: "%s is not a %s",
|
|
483
|
+
date: "%s is not a %s",
|
|
484
|
+
boolean: "%s is not a %s",
|
|
485
|
+
integer: "%s is not an %s",
|
|
486
|
+
float: "%s is not a %s",
|
|
487
|
+
regexp: "%s is not a valid %s",
|
|
488
|
+
email: "%s is not a valid %s",
|
|
489
|
+
url: "%s is not a valid %s",
|
|
490
|
+
hex: "%s is not a valid %s"
|
|
491
|
+
},
|
|
492
|
+
string: {
|
|
493
|
+
len: "%s must be exactly %s characters",
|
|
494
|
+
min: "%s must be at least %s characters",
|
|
495
|
+
max: "%s cannot be longer than %s characters",
|
|
496
|
+
range: "%s must be between %s and %s characters"
|
|
497
|
+
},
|
|
498
|
+
number: {
|
|
499
|
+
len: "%s must equal %s",
|
|
500
|
+
min: "%s cannot be less than %s",
|
|
501
|
+
max: "%s cannot be greater than %s",
|
|
502
|
+
range: "%s must be between %s and %s"
|
|
503
|
+
},
|
|
504
|
+
array: {
|
|
505
|
+
len: "%s must be exactly %s in length",
|
|
506
|
+
min: "%s cannot be less than %s in length",
|
|
507
|
+
max: "%s cannot be greater than %s in length",
|
|
508
|
+
range: "%s must be between %s and %s in length"
|
|
509
|
+
},
|
|
510
|
+
pattern: {
|
|
511
|
+
mismatch: "%s value %s does not match pattern %s"
|
|
512
|
+
},
|
|
513
|
+
clone: function() {
|
|
514
|
+
var e = JSON.parse(JSON.stringify(this));
|
|
515
|
+
return e.clone = this.clone, e;
|
|
516
|
+
}
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
var Ie = He(), qe = /* @__PURE__ */ function() {
|
|
520
|
+
function o(t) {
|
|
521
|
+
this.rules = null, this._messages = Ie, this.define(t);
|
|
522
|
+
}
|
|
523
|
+
var e = o.prototype;
|
|
524
|
+
return e.define = function(a) {
|
|
525
|
+
var n = this;
|
|
526
|
+
if (!a)
|
|
527
|
+
throw new Error("Cannot configure a schema with no rules");
|
|
528
|
+
if (typeof a != "object" || Array.isArray(a))
|
|
529
|
+
throw new Error("Rules must be an object");
|
|
530
|
+
this.rules = {}, Object.keys(a).forEach(function(l) {
|
|
531
|
+
var d = a[l];
|
|
532
|
+
n.rules[l] = Array.isArray(d) ? d : [d];
|
|
533
|
+
});
|
|
534
|
+
}, e.messages = function(a) {
|
|
535
|
+
return a && (this._messages = Ct(He(), a)), this._messages;
|
|
536
|
+
}, e.validate = function(a, n, l) {
|
|
537
|
+
var d = this;
|
|
538
|
+
n === void 0 && (n = {}), l === void 0 && (l = function() {
|
|
539
|
+
});
|
|
540
|
+
var f = a, w = n, M = l;
|
|
541
|
+
if (typeof w == "function" && (M = w, w = {}), !this.rules || Object.keys(this.rules).length === 0)
|
|
542
|
+
return M && M(null, f), Promise.resolve(f);
|
|
543
|
+
function O(b) {
|
|
544
|
+
var E = [], p = {};
|
|
545
|
+
function Q(c) {
|
|
546
|
+
if (Array.isArray(c)) {
|
|
547
|
+
var W;
|
|
548
|
+
E = (W = E).concat.apply(W, c);
|
|
549
|
+
} else
|
|
550
|
+
E.push(c);
|
|
551
|
+
}
|
|
552
|
+
for (var k = 0; k < b.length; k++)
|
|
553
|
+
Q(b[k]);
|
|
554
|
+
E.length ? (p = Le(E), M(E, p)) : M(null, f);
|
|
555
|
+
}
|
|
556
|
+
if (w.messages) {
|
|
557
|
+
var D = this.messages();
|
|
558
|
+
D === Ie && (D = He()), Ct(D, w.messages), w.messages = D;
|
|
559
|
+
} else
|
|
560
|
+
w.messages = this.messages();
|
|
561
|
+
var N = {}, z = w.keys || Object.keys(this.rules);
|
|
562
|
+
z.forEach(function(b) {
|
|
563
|
+
var E = d.rules[b], p = f[b];
|
|
564
|
+
E.forEach(function(Q) {
|
|
565
|
+
var k = Q;
|
|
566
|
+
typeof k.transform == "function" && (f === a && (f = ce({}, f)), p = f[b] = k.transform(p)), typeof k == "function" ? k = {
|
|
567
|
+
validator: k
|
|
568
|
+
} : k = ce({}, k), k.validator = d.getValidationMethod(k), k.validator && (k.field = b, k.fullField = k.fullField || b, k.type = d.getType(k), N[b] = N[b] || [], N[b].push({
|
|
569
|
+
rule: k,
|
|
570
|
+
value: p,
|
|
571
|
+
source: f,
|
|
572
|
+
field: b
|
|
573
|
+
}));
|
|
574
|
+
});
|
|
575
|
+
});
|
|
576
|
+
var R = {};
|
|
577
|
+
return Wn(N, w, function(b, E) {
|
|
578
|
+
var p = b.rule, Q = (p.type === "object" || p.type === "array") && (typeof p.fields == "object" || typeof p.defaultField == "object");
|
|
579
|
+
Q = Q && (p.required || !p.required && b.value), p.field = b.field;
|
|
580
|
+
function k(A, G) {
|
|
581
|
+
return ce({}, G, {
|
|
582
|
+
fullField: p.fullField + "." + A,
|
|
583
|
+
fullFields: p.fullFields ? [].concat(p.fullFields, [A]) : [A]
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
function c(A) {
|
|
587
|
+
A === void 0 && (A = []);
|
|
588
|
+
var G = Array.isArray(A) ? A : [A];
|
|
589
|
+
!w.suppressWarning && G.length && o.warning("async-validator:", G), G.length && p.message !== void 0 && (G = [].concat(p.message));
|
|
590
|
+
var I = G.map(kt(p, f));
|
|
591
|
+
if (w.first && I.length)
|
|
592
|
+
return R[p.field] = 1, E(I);
|
|
593
|
+
if (!Q)
|
|
594
|
+
E(I);
|
|
595
|
+
else {
|
|
596
|
+
if (p.required && !b.value)
|
|
597
|
+
return p.message !== void 0 ? I = [].concat(p.message).map(kt(p, f)) : w.error && (I = [w.error(p, ee(w.messages.required, p.field))]), E(I);
|
|
598
|
+
var L = {};
|
|
599
|
+
p.defaultField && Object.keys(b.value).map(function(P) {
|
|
600
|
+
L[P] = p.defaultField;
|
|
601
|
+
}), L = ce({}, L, b.rule.fields);
|
|
602
|
+
var J = {};
|
|
603
|
+
Object.keys(L).forEach(function(P) {
|
|
604
|
+
var Y = L[P], be = Array.isArray(Y) ? Y : [Y];
|
|
605
|
+
J[P] = be.map(k.bind(null, P));
|
|
606
|
+
});
|
|
607
|
+
var te = new o(J);
|
|
608
|
+
te.messages(w.messages), b.rule.options && (b.rule.options.messages = w.messages, b.rule.options.error = w.error), te.validate(b.value, b.rule.options || w, function(P) {
|
|
609
|
+
var Y = [];
|
|
610
|
+
I && I.length && Y.push.apply(Y, I), P && P.length && Y.push.apply(Y, P), E(Y.length ? Y : null);
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
var W;
|
|
615
|
+
if (p.asyncValidator)
|
|
616
|
+
W = p.asyncValidator(p, b.value, c, b.source, w);
|
|
617
|
+
else if (p.validator) {
|
|
618
|
+
try {
|
|
619
|
+
W = p.validator(p, b.value, c, b.source, w);
|
|
620
|
+
} catch (A) {
|
|
621
|
+
console.error == null || console.error(A), w.suppressValidatorError || setTimeout(function() {
|
|
622
|
+
throw A;
|
|
623
|
+
}, 0), c(A.message);
|
|
624
|
+
}
|
|
625
|
+
W === !0 ? c() : W === !1 ? c(typeof p.message == "function" ? p.message(p.fullField || p.field) : p.message || (p.fullField || p.field) + " fails") : W instanceof Array ? c(W) : W instanceof Error && c(W.message);
|
|
626
|
+
}
|
|
627
|
+
W && W.then && W.then(function() {
|
|
628
|
+
return c();
|
|
629
|
+
}, function(A) {
|
|
630
|
+
return c(A);
|
|
631
|
+
});
|
|
632
|
+
}, function(b) {
|
|
633
|
+
O(b);
|
|
634
|
+
}, f);
|
|
635
|
+
}, e.getType = function(a) {
|
|
636
|
+
if (a.type === void 0 && a.pattern instanceof RegExp && (a.type = "pattern"), typeof a.validator != "function" && a.type && !Ce.hasOwnProperty(a.type))
|
|
637
|
+
throw new Error(ee("Unknown rule type %s", a.type));
|
|
638
|
+
return a.type || "string";
|
|
639
|
+
}, e.getValidationMethod = function(a) {
|
|
640
|
+
if (typeof a.validator == "function")
|
|
641
|
+
return a.validator;
|
|
642
|
+
var n = Object.keys(a), l = n.indexOf("message");
|
|
643
|
+
return l !== -1 && n.splice(l, 1), n.length === 1 && n[0] === "required" ? Ce.required : Ce[this.getType(a)] || void 0;
|
|
644
|
+
}, o;
|
|
645
|
+
}();
|
|
646
|
+
qe.register = function(e, t) {
|
|
647
|
+
if (typeof t != "function")
|
|
648
|
+
throw new Error("Cannot register a validator by type, validator is not a function");
|
|
649
|
+
Ce[e] = t;
|
|
650
|
+
};
|
|
651
|
+
qe.warning = qt;
|
|
652
|
+
qe.messages = Ie;
|
|
653
|
+
qe.validators = Ce;
|
|
654
|
+
const gr = {
|
|
655
|
+
key: 0,
|
|
656
|
+
class: "wd-editable-grid__toolbar"
|
|
657
|
+
}, mr = { class: "wd-editable-grid__toolbar-left" }, vr = { class: "wd-editable-grid__toolbar-right" }, yr = { key: 0 }, hr = ["title"], wr = { key: 5 }, br = ["title"], _r = { key: 5 }, Sr = {
|
|
658
|
+
key: 2,
|
|
659
|
+
class: "wd-editable-grid__cards"
|
|
660
|
+
}, kr = { class: "wd-editable-grid__card-title" }, Cr = { class: "wd-editable-grid__card-body" }, Vr = { class: "wd-editable-grid__card-label" }, qr = { class: "wd-editable-grid__card-value" }, Fr = {
|
|
661
|
+
key: 3,
|
|
662
|
+
class: "wd-editable-grid__pager"
|
|
663
|
+
}, Ar = { class: "wd-editable-grid__col-setting" }, xr = { class: "wd-editable-grid__col-actions" }, Er = /* @__PURE__ */ yt({
|
|
664
|
+
name: "WdEditableGrid",
|
|
665
|
+
__name: "EditableGrid",
|
|
666
|
+
props: {
|
|
667
|
+
...zn,
|
|
668
|
+
...Mn,
|
|
669
|
+
// ---- 可编辑列与数据 ----
|
|
670
|
+
/** 可编辑列配置 */
|
|
671
|
+
columns: {
|
|
672
|
+
type: Array,
|
|
673
|
+
default: () => []
|
|
674
|
+
},
|
|
675
|
+
/** 行数据(v-model,静态数据推荐用法) */
|
|
676
|
+
modelValue: {
|
|
677
|
+
type: Array,
|
|
678
|
+
default: () => []
|
|
679
|
+
},
|
|
680
|
+
/** 编辑模式:cell=单元格点击编辑(默认);row=行编辑 */
|
|
681
|
+
editMode: {
|
|
682
|
+
type: String,
|
|
683
|
+
default: "cell"
|
|
684
|
+
},
|
|
685
|
+
/** 批量保存地址;为空时仅本地保存并 emit save */
|
|
686
|
+
saveApi: { type: String, default: "" },
|
|
687
|
+
saveMethod: {
|
|
688
|
+
type: String,
|
|
689
|
+
default: "post"
|
|
690
|
+
},
|
|
691
|
+
/** 新增行默认值(对象或工厂函数) */
|
|
692
|
+
defaultRow: {
|
|
693
|
+
type: [Object, Function],
|
|
694
|
+
default: void 0
|
|
695
|
+
},
|
|
696
|
+
// ---- 数据源(继承 DataGrid:API / 静态) ----
|
|
697
|
+
api: { type: String, default: "" },
|
|
698
|
+
apiMethod: { type: String, default: "post" },
|
|
699
|
+
apiParam: { type: Object, default: () => ({}) },
|
|
700
|
+
active: { type: Boolean, default: !1 },
|
|
701
|
+
/** 静态数据(数组);不传时回退到 modelValue */
|
|
702
|
+
dataSource: { type: [Array, Object], default: void 0 },
|
|
703
|
+
// ---- 分页 / 搜索 / 模式(继承 DataGrid) ----
|
|
704
|
+
withPager: { type: Boolean, default: !0 },
|
|
705
|
+
withSearch: { type: Boolean, default: !1 },
|
|
706
|
+
modeSwitch: { type: Boolean, default: !1 },
|
|
707
|
+
dynamicColumn: { type: Boolean, default: !1 },
|
|
708
|
+
columnStorageKey: { type: String, default: "" },
|
|
709
|
+
// ---- 表格展示(继承 DataGrid) ----
|
|
710
|
+
fix: { type: Boolean, default: !0 },
|
|
711
|
+
border: { type: Boolean, default: !0 },
|
|
712
|
+
stripe: { type: Boolean, default: !0 },
|
|
713
|
+
height: { type: [String, Number], default: void 0 },
|
|
714
|
+
autoHeight: { type: Boolean, default: !1 },
|
|
715
|
+
rowKey: { type: String, default: "id" },
|
|
716
|
+
tableSize: { type: String, default: "default" },
|
|
717
|
+
pagerStyle: { type: String, default: "normal" },
|
|
718
|
+
withIndex: { type: Boolean, default: !1 },
|
|
719
|
+
withSelection: { type: Boolean, default: !1 },
|
|
720
|
+
// 行合并
|
|
721
|
+
rowspanKey: { type: String, default: "" },
|
|
722
|
+
rowspanColumn: { type: Array, default: () => [] },
|
|
723
|
+
// 树形
|
|
724
|
+
treeProps: { type: Object, default: () => ({ children: "children", hasChildren: "hasChildren" }) },
|
|
725
|
+
defaultExpandAll: { type: Boolean, default: !1 },
|
|
726
|
+
// tools(继承 DataGrid)
|
|
727
|
+
tools: {
|
|
728
|
+
type: Object,
|
|
729
|
+
default: () => ({})
|
|
730
|
+
},
|
|
731
|
+
/** 内置只读操作列配置(渲染行操作按钮,点击 emit row-action) */
|
|
732
|
+
rowActions: {
|
|
733
|
+
type: Array,
|
|
734
|
+
default: () => []
|
|
735
|
+
},
|
|
736
|
+
// ---- 可编辑能力开关 ----
|
|
737
|
+
withToolbar: { type: Boolean, default: !0 },
|
|
738
|
+
withAdd: { type: Boolean, default: !0 },
|
|
739
|
+
withSave: { type: Boolean, default: !0 },
|
|
740
|
+
withDelete: { type: Boolean, default: !0 },
|
|
741
|
+
withActions: { type: Boolean, default: !0 },
|
|
742
|
+
// ---- 文案 ----
|
|
743
|
+
addButtonText: { type: String, default: "新增一行" },
|
|
744
|
+
saveButtonText: { type: String, default: "批量保存" },
|
|
745
|
+
actionWidth: { type: [String, Number], default: 150 }
|
|
746
|
+
},
|
|
747
|
+
emits: [
|
|
748
|
+
"update:modelValue",
|
|
749
|
+
"change",
|
|
750
|
+
"save",
|
|
751
|
+
"row-add",
|
|
752
|
+
"row-remove",
|
|
753
|
+
"validate-fail",
|
|
754
|
+
"row-action",
|
|
755
|
+
"page-change",
|
|
756
|
+
"selection-change",
|
|
757
|
+
"mode-change",
|
|
758
|
+
"loaded",
|
|
759
|
+
"apiBefore",
|
|
760
|
+
"apiSuccess",
|
|
761
|
+
"apiFail",
|
|
762
|
+
"apiException",
|
|
763
|
+
"apiAfter"
|
|
764
|
+
],
|
|
765
|
+
setup(o, { expose: e, emit: t }) {
|
|
766
|
+
const a = yt({
|
|
767
|
+
name: "WdColumnRenderer",
|
|
768
|
+
props: {
|
|
769
|
+
vnodes: { type: Array, default: () => [] }
|
|
770
|
+
},
|
|
771
|
+
render() {
|
|
772
|
+
return this.vnodes;
|
|
773
|
+
}
|
|
774
|
+
}), n = o, l = t, d = pn(), f = oe(null), w = oe(null), M = oe("table"), O = Pn(), D = O.page.pager.pageSizes, N = O.page.pager.hideOnSinglePage, z = X(() => Array.isArray(n.dataSource) || !n.api && n.modelValue.length > 0), R = Fn({
|
|
775
|
+
api: z.value ? "" : n.api,
|
|
776
|
+
apiMethod: n.apiMethod,
|
|
777
|
+
apiParam: n.apiParam,
|
|
778
|
+
pageSize: O.page.pager.pageSize,
|
|
779
|
+
immediate: !1
|
|
780
|
+
}), { total: b, loading: E, currentPage: p, pageSize: Q, selection: k } = R, c = oe([]), W = X(
|
|
781
|
+
() => Array.isArray(n.dataSource) ? n.dataSource : n.modelValue
|
|
782
|
+
), A = ye(/* @__PURE__ */ new Set()), G = ye(/* @__PURE__ */ new Set()), I = /* @__PURE__ */ new Map(), L = oe(""), J = ye(/* @__PURE__ */ new Map()), te = ye(/* @__PURE__ */ new Set()), P = ye(/* @__PURE__ */ new Map()), Y = ye(/* @__PURE__ */ new Set());
|
|
783
|
+
Se(
|
|
784
|
+
W,
|
|
785
|
+
(r) => {
|
|
786
|
+
z.value && (c.value = (r || []).map((i) => ({ ...i })), b.value = (r || []).length, ie());
|
|
787
|
+
},
|
|
788
|
+
{ immediate: !0, deep: !1 }
|
|
789
|
+
), Se(
|
|
790
|
+
R.list,
|
|
791
|
+
(r) => {
|
|
792
|
+
z.value || (c.value = (r || []).map((i) => ({ ...i })), ie());
|
|
793
|
+
},
|
|
794
|
+
{ immediate: !0 }
|
|
795
|
+
);
|
|
796
|
+
const be = oe(!1);
|
|
797
|
+
function ie() {
|
|
798
|
+
A.clear(), G.clear(), I.clear(), L.value = "", Y.clear(), J.clear(), te.clear(), P.clear();
|
|
799
|
+
}
|
|
800
|
+
const pe = X(() => [...A].map((r) => c.value[r]).filter(Boolean));
|
|
801
|
+
function ne(r, i) {
|
|
802
|
+
return `${r}-${i}`;
|
|
803
|
+
}
|
|
804
|
+
function ge(r) {
|
|
805
|
+
return G.has(r);
|
|
806
|
+
}
|
|
807
|
+
function ze() {
|
|
808
|
+
L.value = "";
|
|
809
|
+
}
|
|
810
|
+
function Be(r) {
|
|
811
|
+
var u, g;
|
|
812
|
+
if (!r) return;
|
|
813
|
+
const i = r != null && r.focus ? r : (g = (u = r == null ? void 0 : r.$el) == null ? void 0 : u.querySelector) == null ? void 0 : g.call(u, "input");
|
|
814
|
+
i != null && i.focus ? i.focus() : r != null && r.focus && r.focus();
|
|
815
|
+
}
|
|
816
|
+
function Ye(r, i) {
|
|
817
|
+
var g;
|
|
818
|
+
if (i.formatter) return i.formatter(r, i);
|
|
819
|
+
const u = r[i.prop];
|
|
820
|
+
if (u == null || u === "") return "";
|
|
821
|
+
if (i.editor === "select") {
|
|
822
|
+
const y = (g = i.options) == null ? void 0 : g.find((m) => m.value === u);
|
|
823
|
+
return y ? y.text : String(u);
|
|
824
|
+
}
|
|
825
|
+
return String(u);
|
|
826
|
+
}
|
|
827
|
+
function At(r, i) {
|
|
828
|
+
if (n.editMode !== "cell" || M.value !== "table") return;
|
|
829
|
+
const u = i == null ? void 0 : i.property;
|
|
830
|
+
if (!u) return;
|
|
831
|
+
const g = n.columns.find((m) => m.prop === u);
|
|
832
|
+
if (!g || g.editable === !1) return;
|
|
833
|
+
const y = c.value.indexOf(r);
|
|
834
|
+
y < 0 || (J.has(y) || J.set(y, { ...r }), L.value = ne(y, u));
|
|
835
|
+
}
|
|
836
|
+
function xt(r) {
|
|
837
|
+
A.add(r), l("change", c.value);
|
|
838
|
+
}
|
|
839
|
+
function re(r, i) {
|
|
840
|
+
xt(r), Pt(r), Ae(r, c.value[r], i);
|
|
841
|
+
}
|
|
842
|
+
function Et(r, i) {
|
|
843
|
+
re(r, i), L.value = "";
|
|
844
|
+
}
|
|
845
|
+
function Ot(r, i) {
|
|
846
|
+
re(r, i), L.value = "";
|
|
847
|
+
}
|
|
848
|
+
function Rt(r, i) {
|
|
849
|
+
return r === i || (r == null || r === "") && (i == null || i === "");
|
|
850
|
+
}
|
|
851
|
+
function Pt(r) {
|
|
852
|
+
const i = J.get(r), u = c.value[r];
|
|
853
|
+
if (!i || !u) return;
|
|
854
|
+
let g = !1;
|
|
855
|
+
for (const y of n.columns) {
|
|
856
|
+
if (y.editable === !1 || !(y.prop in i)) continue;
|
|
857
|
+
const m = ne(r, y.prop);
|
|
858
|
+
Rt(i[y.prop], u[y.prop]) ? te.delete(m) : (te.add(m), g = !0);
|
|
859
|
+
}
|
|
860
|
+
g ? A.add(r) : Y.has(r) || A.delete(r);
|
|
861
|
+
}
|
|
862
|
+
function Fe(r, i) {
|
|
863
|
+
const u = ne(r, i.prop);
|
|
864
|
+
return {
|
|
865
|
+
"is-editable": n.editMode === "cell" && i.editable !== !1,
|
|
866
|
+
"is-dirty": te.has(u),
|
|
867
|
+
"is-error": P.has(u)
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
function Ge(r, i) {
|
|
871
|
+
return P.get(ne(r, i.prop)) || "";
|
|
872
|
+
}
|
|
873
|
+
function Je(r) {
|
|
874
|
+
const i = `${r}-`;
|
|
875
|
+
for (const u of [...te]) u.startsWith(i) && te.delete(u);
|
|
876
|
+
for (const u of [...P.keys()]) u.startsWith(i) && P.delete(u);
|
|
877
|
+
}
|
|
878
|
+
async function Ae(r, i, u) {
|
|
879
|
+
var B, U;
|
|
880
|
+
const g = ne(r, u.prop);
|
|
881
|
+
P.delete(g);
|
|
882
|
+
const y = i[u.prop];
|
|
883
|
+
let m;
|
|
884
|
+
if (u.rules && u.rules.length)
|
|
885
|
+
try {
|
|
886
|
+
await new qe({ [u.prop]: u.rules }).validate({ [u.prop]: y }, { suppressWarning: !0 });
|
|
887
|
+
} catch ($) {
|
|
888
|
+
m = ((U = (B = $ == null ? void 0 : $.errors) == null ? void 0 : B[0]) == null ? void 0 : U.message) ?? `「${u.label}」校验未通过`;
|
|
889
|
+
}
|
|
890
|
+
else
|
|
891
|
+
u.required && (y == null || y === "") ? m = `「${u.label}」不能为空` : u.validator && (m = u.validator(y, i) || void 0);
|
|
892
|
+
return m && P.set(g, m), m;
|
|
893
|
+
}
|
|
894
|
+
async function Ze(r, i) {
|
|
895
|
+
let u;
|
|
896
|
+
for (const g of n.columns) {
|
|
897
|
+
const y = await Ae(r, i, g);
|
|
898
|
+
y && !u && (u = { error: y, column: g.prop });
|
|
899
|
+
}
|
|
900
|
+
return u ?? {};
|
|
901
|
+
}
|
|
902
|
+
function Mt(r) {
|
|
903
|
+
I.set(r, { ...c.value[r] }), G.add(r), J.has(r) || J.set(r, { ...c.value[r] });
|
|
904
|
+
}
|
|
905
|
+
async function zt(r) {
|
|
906
|
+
const i = c.value[r], u = await Ze(r, i);
|
|
907
|
+
if (u.error) {
|
|
908
|
+
he.warning(u.error), l("validate-fail", { index: r, row: i, column: u.column, error: u.error });
|
|
909
|
+
return;
|
|
910
|
+
}
|
|
911
|
+
G.delete(r), I.delete(r), J.set(r, { ...c.value[r] }), Je(r), A.add(r), l("change", c.value);
|
|
912
|
+
}
|
|
913
|
+
function Bt(r) {
|
|
914
|
+
const i = I.get(r);
|
|
915
|
+
i && (c.value[r] = { ...i }), I.delete(r), G.delete(r), A.delete(r), Y.delete(r), J.delete(r), Je(r);
|
|
916
|
+
}
|
|
917
|
+
function Qe() {
|
|
918
|
+
const r = typeof n.defaultRow == "function" ? n.defaultRow() : { ...n.defaultRow || {} };
|
|
919
|
+
c.value.push({ ...r });
|
|
920
|
+
const i = c.value.length - 1;
|
|
921
|
+
Y.add(i), J.set(i, { ...c.value[i] }), A.add(i), z.value && (b.value = c.value.length), n.editMode === "row" && (I.set(i, { ...c.value[i] }), G.add(i)), l("row-add", c.value[i]), l("update:modelValue", c.value), l("change", c.value);
|
|
922
|
+
}
|
|
923
|
+
async function jt(r) {
|
|
924
|
+
try {
|
|
925
|
+
await qn.confirm("确认删除该行?", "提示", {
|
|
926
|
+
confirmButtonText: "确定",
|
|
927
|
+
cancelButtonText: "取消",
|
|
928
|
+
type: "warning"
|
|
929
|
+
});
|
|
930
|
+
} catch {
|
|
931
|
+
return;
|
|
932
|
+
}
|
|
933
|
+
c.value.splice(r, 1);
|
|
934
|
+
const i = (m) => m < r ? m : m > r ? m - 1 : -1, u = (m) => {
|
|
935
|
+
const B = /* @__PURE__ */ new Set();
|
|
936
|
+
for (const U of m) {
|
|
937
|
+
const $ = i(U);
|
|
938
|
+
$ >= 0 && B.add($);
|
|
939
|
+
}
|
|
940
|
+
m.clear(), B.forEach((U) => m.add(U));
|
|
941
|
+
};
|
|
942
|
+
u(A), u(Y);
|
|
943
|
+
const g = /* @__PURE__ */ new Map();
|
|
944
|
+
J.forEach((m, B) => {
|
|
945
|
+
const U = i(B);
|
|
946
|
+
U >= 0 && g.set(U, m);
|
|
947
|
+
}), J.clear(), g.forEach((m, B) => J.set(B, m));
|
|
948
|
+
const y = (m) => {
|
|
949
|
+
const B = m.indexOf("-"), U = Number(m.slice(0, B)), $ = i(U);
|
|
950
|
+
return $ >= 0 ? `${$}-${m.slice(B + 1)}` : null;
|
|
951
|
+
};
|
|
952
|
+
for (const m of [...te]) {
|
|
953
|
+
const B = y(m);
|
|
954
|
+
te.delete(m), B && te.add(B);
|
|
955
|
+
}
|
|
956
|
+
for (const [m, B] of [...P.entries()]) {
|
|
957
|
+
const U = y(m);
|
|
958
|
+
P.delete(m), U && P.set(U, B);
|
|
959
|
+
}
|
|
960
|
+
G.clear(), L.value = "", z.value && (b.value = c.value.length), l("row-remove", r), l("update:modelValue", c.value), l("change", c.value);
|
|
961
|
+
}
|
|
962
|
+
async function Dt() {
|
|
963
|
+
const r = [...A].sort((i, u) => i - u);
|
|
964
|
+
for (const i of r) {
|
|
965
|
+
const u = c.value[i];
|
|
966
|
+
if (!u) continue;
|
|
967
|
+
const g = await Ze(i, u);
|
|
968
|
+
if (g.error)
|
|
969
|
+
return he.warning(`第 ${i + 1} 行:${g.error}`), l("validate-fail", { index: i, row: u, column: g.column, error: g.error }), !1;
|
|
970
|
+
}
|
|
971
|
+
return !0;
|
|
972
|
+
}
|
|
973
|
+
async function Xe() {
|
|
974
|
+
if (!A.size) {
|
|
975
|
+
he.info("没有需要保存的修改");
|
|
976
|
+
return;
|
|
977
|
+
}
|
|
978
|
+
if (!await Dt()) return;
|
|
979
|
+
const r = [...A].sort((i, u) => i - u).map((i) => c.value[i]);
|
|
980
|
+
if (!n.saveApi) {
|
|
981
|
+
ie(), l("update:modelValue", c.value), l("save", { rows: r, all: c.value }), he.success("保存成功");
|
|
982
|
+
return;
|
|
983
|
+
}
|
|
984
|
+
be.value = !0, l("apiBefore", { url: n.saveApi, rows: r });
|
|
985
|
+
try {
|
|
986
|
+
const i = n.saveMethod === "put" ? await bt.put(n.saveApi, { rows: r }) : await bt.post(n.saveApi, { rows: r });
|
|
987
|
+
i.success ? (ie(), l("apiSuccess", { data: i.data }), l("save", { rows: r, all: c.value, data: i.data }), l("update:modelValue", c.value), n.headRefreshDatagrid && On(n.headRefreshDatagrid, n.filter), z.value || R.fetchData()) : l("apiFail", { code: i.code, message: i.message });
|
|
988
|
+
} catch (i) {
|
|
989
|
+
l("apiException", { error: i, message: i == null ? void 0 : i.message });
|
|
990
|
+
} finally {
|
|
991
|
+
l("apiAfter", { url: n.saveApi }), be.value = !1;
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
const ue = X(() => ({
|
|
995
|
+
refresh: n.tools.refresh !== !1,
|
|
996
|
+
// 默认 true
|
|
997
|
+
columnSetting: n.tools.columnSetting === !0,
|
|
998
|
+
modeSwitch: n.tools.modeSwitch === !0,
|
|
999
|
+
size: n.tools.size === !0
|
|
1000
|
+
})), Nt = X(() => !!d.toolbar || n.withAdd), Tt = X(
|
|
1001
|
+
() => n.withSave || !!d.actions || ue.value.refresh || ue.value.columnSetting || ue.value.modeSwitch || ue.value.size || n.modeSwitch || n.dynamicColumn
|
|
1002
|
+
), xe = n.columnStorageKey ? `wd:tablesize:${n.columnStorageKey}` : "", et = xe ? Rn(localStorage.getItem(xe), null) : null, me = oe(et || n.tableSize);
|
|
1003
|
+
Se(
|
|
1004
|
+
() => n.tableSize,
|
|
1005
|
+
(r) => {
|
|
1006
|
+
et || (me.value = r);
|
|
1007
|
+
}
|
|
1008
|
+
);
|
|
1009
|
+
function Ut(r) {
|
|
1010
|
+
me.value = r, xe && localStorage.setItem(xe, JSON.stringify(r));
|
|
1011
|
+
}
|
|
1012
|
+
const tt = oe(0), je = oe(0), Ee = X(() => n.height === "fix"), $t = X(
|
|
1013
|
+
() => Ee.value ? { height: `${tt.value}px` } : void 0
|
|
1014
|
+
), Kt = X(() => {
|
|
1015
|
+
if (Ee.value) return je.value > 0 ? je.value : void 0;
|
|
1016
|
+
if (n.autoHeight) return "100%";
|
|
1017
|
+
const r = n.height;
|
|
1018
|
+
if (!(r == null || r === ""))
|
|
1019
|
+
return r;
|
|
1020
|
+
});
|
|
1021
|
+
function De() {
|
|
1022
|
+
const r = w.value;
|
|
1023
|
+
if (!r || !Ee.value) return;
|
|
1024
|
+
const i = window.innerHeight, u = r.getBoundingClientRect().top, g = Math.max(120, Math.floor(i - u));
|
|
1025
|
+
tt.value = g;
|
|
1026
|
+
const y = r.querySelector(".wd-editable-grid__toolbar"), m = r.querySelector(".wd-editable-grid__pager");
|
|
1027
|
+
je.value = Math.max(120, g - ((y == null ? void 0 : y.offsetHeight) ?? 0) - ((m == null ? void 0 : m.offsetHeight) ?? 0));
|
|
1028
|
+
}
|
|
1029
|
+
function Oe() {
|
|
1030
|
+
De();
|
|
1031
|
+
}
|
|
1032
|
+
Se(
|
|
1033
|
+
() => n.height,
|
|
1034
|
+
(r) => {
|
|
1035
|
+
r === "fix" ? (window.addEventListener("resize", Oe), gn(De)) : window.removeEventListener("resize", Oe);
|
|
1036
|
+
}
|
|
1037
|
+
);
|
|
1038
|
+
const Wt = X(() => n.pagerStyle === "simple" ? "prev, pager, next" : n.pagerStyle === "full" ? "total, sizes, prev, pager, next, jumper" : O.page.pager.layout), {
|
|
1039
|
+
controllableColumns: nt,
|
|
1040
|
+
hiddenKeys: rt,
|
|
1041
|
+
settingVisible: _e,
|
|
1042
|
+
init: Lt,
|
|
1043
|
+
initMetas: Ht,
|
|
1044
|
+
setVisible: It,
|
|
1045
|
+
move: at,
|
|
1046
|
+
reset: Yt
|
|
1047
|
+
} = An(n.columnStorageKey || void 0);
|
|
1048
|
+
let it = !1;
|
|
1049
|
+
const Gt = X(() => (ot(), n.columns.filter((r) => !rt.value.has(r.prop)))), Jt = X(() => {
|
|
1050
|
+
ot();
|
|
1051
|
+
const r = d.default;
|
|
1052
|
+
return r ? Zt(r(), rt.value) : [];
|
|
1053
|
+
});
|
|
1054
|
+
function ot() {
|
|
1055
|
+
if (it) return;
|
|
1056
|
+
const r = d.default ? d.default() : [], i = [
|
|
1057
|
+
...n.columns.map((u) => ({ key: u.prop, label: u.label, controllable: !0, visible: !0 })),
|
|
1058
|
+
...xn(r).filter((u) => u.controllable).map((u) => ({ key: u.key, label: u.label, controllable: !0, visible: u.visible }))
|
|
1059
|
+
];
|
|
1060
|
+
i.length ? Ht(i) : Lt(r), it = !0;
|
|
1061
|
+
}
|
|
1062
|
+
function Zt(r, i) {
|
|
1063
|
+
const u = [];
|
|
1064
|
+
return r.forEach((g) => {
|
|
1065
|
+
if (!g || typeof g != "object") {
|
|
1066
|
+
g && u.push(g);
|
|
1067
|
+
return;
|
|
1068
|
+
}
|
|
1069
|
+
const y = g.props || {}, m = String(y.prop || y.columnKey || "");
|
|
1070
|
+
y.type === "selection" || y.type === "index" || m && i.has(m) || u.push(g);
|
|
1071
|
+
}), u;
|
|
1072
|
+
}
|
|
1073
|
+
function Qt(r) {
|
|
1074
|
+
return (p.value - 1) * Q.value + r + 1;
|
|
1075
|
+
}
|
|
1076
|
+
function Xt({ row: r, column: i, rowIndex: u, columnIndex: g }) {
|
|
1077
|
+
if (!n.rowspanKey || !n.rowspanColumn.length) return { rowspan: 1, colspan: 1 };
|
|
1078
|
+
const y = i.property;
|
|
1079
|
+
if (!n.rowspanColumn.includes(y)) return { rowspan: 1, colspan: 1 };
|
|
1080
|
+
const m = c.value, B = r[n.rowspanKey], U = m.findIndex(($) => $[n.rowspanKey] === B);
|
|
1081
|
+
return u === U ? { rowspan: m.filter((ve) => ve[n.rowspanKey] === B).length, colspan: 1 } : { rowspan: 0, colspan: 0 };
|
|
1082
|
+
}
|
|
1083
|
+
function en(r) {
|
|
1084
|
+
R.setSelection(r), l("selection-change", r);
|
|
1085
|
+
}
|
|
1086
|
+
function lt(r) {
|
|
1087
|
+
ie(), R.onChangeCurrentpage(r), l("page-change", { currentPage: r, pageSize: Q.value });
|
|
1088
|
+
}
|
|
1089
|
+
function st(r) {
|
|
1090
|
+
ie(), R.onChangePagesize(r), l("page-change", { currentPage: p.value, pageSize: r });
|
|
1091
|
+
}
|
|
1092
|
+
function tn() {
|
|
1093
|
+
M.value = M.value === "table" ? "card" : "table", l("mode-change", M.value);
|
|
1094
|
+
}
|
|
1095
|
+
const nn = X(() => {
|
|
1096
|
+
const r = n.rowActions.reduce((i, u) => i + u.text.length * 14 + 16, 20);
|
|
1097
|
+
return Math.max(r, 90);
|
|
1098
|
+
});
|
|
1099
|
+
function rn(r, i) {
|
|
1100
|
+
l("row-action", { row: r, command: i.command ?? i.text, text: i.text });
|
|
1101
|
+
}
|
|
1102
|
+
function Ne(r) {
|
|
1103
|
+
return z.value ? Promise.resolve() : R.fetchData(r == null ? void 0 : r.apiParam).then((i) => l("loaded", i));
|
|
1104
|
+
}
|
|
1105
|
+
function Te() {
|
|
1106
|
+
return ie(), z.value ? (c.value = W.value.map((r) => ({ ...r })), Promise.resolve()) : R.fetchData().then((r) => l("loaded", r));
|
|
1107
|
+
}
|
|
1108
|
+
function an() {
|
|
1109
|
+
return R.getSelection();
|
|
1110
|
+
}
|
|
1111
|
+
function on() {
|
|
1112
|
+
var r, i;
|
|
1113
|
+
(i = (r = f.value) == null ? void 0 : r.clearSelection) == null || i.call(r), R.clearSelection();
|
|
1114
|
+
}
|
|
1115
|
+
function ut(r) {
|
|
1116
|
+
return z.value ? Promise.resolve() : (ie(), p.value = 1, R.fetchData(r).then((i) => l("loaded", i)));
|
|
1117
|
+
}
|
|
1118
|
+
function dt() {
|
|
1119
|
+
return ie(), R.reset();
|
|
1120
|
+
}
|
|
1121
|
+
async function ln(r) {
|
|
1122
|
+
if (r && r.length > 0) {
|
|
1123
|
+
for (let i = 0; i < c.value.length; i++) {
|
|
1124
|
+
const u = c.value[i];
|
|
1125
|
+
for (const g of r) {
|
|
1126
|
+
const y = n.columns.find((m) => m.prop === g);
|
|
1127
|
+
y && await Ae(i, u, y);
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
if (P.size > 0) {
|
|
1131
|
+
const i = Array.from(P.entries())[0], [u, g] = i, [y] = u.split("-");
|
|
1132
|
+
return he.warning(g), l("validate-fail", { index: Number(y), error: g }), !1;
|
|
1133
|
+
}
|
|
1134
|
+
return !0;
|
|
1135
|
+
}
|
|
1136
|
+
for (let i = 0; i < c.value.length; i++) {
|
|
1137
|
+
const u = c.value[i];
|
|
1138
|
+
for (const g of n.columns)
|
|
1139
|
+
await Ae(i, u, g);
|
|
1140
|
+
}
|
|
1141
|
+
if (P.size > 0) {
|
|
1142
|
+
const i = Array.from(P.entries())[0], [u, g] = i, [y] = u.split("-");
|
|
1143
|
+
return he.warning(g), l("validate-fail", { index: Number(y), error: g }), !1;
|
|
1144
|
+
}
|
|
1145
|
+
return !0;
|
|
1146
|
+
}
|
|
1147
|
+
function sn() {
|
|
1148
|
+
return pe.value;
|
|
1149
|
+
}
|
|
1150
|
+
e({
|
|
1151
|
+
// 数据能力
|
|
1152
|
+
requestApi: Ne,
|
|
1153
|
+
refresh: Te,
|
|
1154
|
+
search: ut,
|
|
1155
|
+
resetSearch: dt,
|
|
1156
|
+
onChangePagesize: st,
|
|
1157
|
+
onChangeCurrentpage: lt,
|
|
1158
|
+
getSelection: an,
|
|
1159
|
+
clearSelection: on,
|
|
1160
|
+
// 可编辑能力
|
|
1161
|
+
saveAll: Xe,
|
|
1162
|
+
validate: ln,
|
|
1163
|
+
addRow: Qe,
|
|
1164
|
+
getDirtyRows: sn,
|
|
1165
|
+
tableRef: f
|
|
1166
|
+
});
|
|
1167
|
+
let Re = null;
|
|
1168
|
+
return mn(() => {
|
|
1169
|
+
Re = En({
|
|
1170
|
+
filter: n.filter,
|
|
1171
|
+
refresh: () => Te(),
|
|
1172
|
+
search: (r) => ut(r),
|
|
1173
|
+
resetSearch: () => dt()
|
|
1174
|
+
}), n.active && !z.value && Ne(), Ee.value && (window.addEventListener("resize", Oe), De());
|
|
1175
|
+
}), vn(() => {
|
|
1176
|
+
window.removeEventListener("resize", Oe), Re == null || Re();
|
|
1177
|
+
}), Se(
|
|
1178
|
+
() => [n.api, n.apiMethod],
|
|
1179
|
+
() => {
|
|
1180
|
+
n.active && !z.value && Ne();
|
|
1181
|
+
}
|
|
1182
|
+
), (r, i) => {
|
|
1183
|
+
const u = H("el-button"), g = H("el-icon"), y = H("el-tooltip"), m = H("el-dropdown-item"), B = H("el-dropdown-menu"), U = H("el-dropdown"), $ = H("el-table-column"), ve = H("el-input"), ft = H("el-input-number"), ct = H("el-option"), pt = H("el-select"), gt = H("el-date-picker"), mt = H("el-empty"), un = H("el-table"), dn = H("el-pagination"), fn = H("el-checkbox"), cn = H("el-dialog"), vt = yn("loading");
|
|
1184
|
+
return v(), j("div", {
|
|
1185
|
+
ref_key: "rootRef",
|
|
1186
|
+
ref: w,
|
|
1187
|
+
class: Ue(["wd-editable-grid", { "wd-editable-grid--auto-height": o.autoHeight }]),
|
|
1188
|
+
style: hn($t.value)
|
|
1189
|
+
}, [
|
|
1190
|
+
o.withToolbar && (Nt.value || Tt.value) ? (v(), j("div", gr, [
|
|
1191
|
+
de("div", mr, [
|
|
1192
|
+
le(r.$slots, "toolbar", {
|
|
1193
|
+
dirtyRows: pe.value,
|
|
1194
|
+
rows: c.value,
|
|
1195
|
+
selection: x(k)
|
|
1196
|
+
}, () => [
|
|
1197
|
+
o.withAdd ? (v(), F(u, {
|
|
1198
|
+
key: 0,
|
|
1199
|
+
type: "primary",
|
|
1200
|
+
icon: x(bn),
|
|
1201
|
+
onClick: Qe
|
|
1202
|
+
}, {
|
|
1203
|
+
default: _(() => [
|
|
1204
|
+
Z(ae(o.addButtonText), 1)
|
|
1205
|
+
]),
|
|
1206
|
+
_: 1
|
|
1207
|
+
}, 8, ["icon"])) : K("", !0)
|
|
1208
|
+
], !0)
|
|
1209
|
+
]),
|
|
1210
|
+
de("div", vr, [
|
|
1211
|
+
o.withSave ? (v(), F(u, {
|
|
1212
|
+
key: 0,
|
|
1213
|
+
type: "success",
|
|
1214
|
+
loading: be.value,
|
|
1215
|
+
disabled: !pe.value.length,
|
|
1216
|
+
onClick: Xe
|
|
1217
|
+
}, {
|
|
1218
|
+
default: _(() => [
|
|
1219
|
+
Z(ae(o.saveButtonText), 1),
|
|
1220
|
+
pe.value.length ? (v(), j("span", yr, "(" + ae(pe.value.length) + ")", 1)) : K("", !0)
|
|
1221
|
+
]),
|
|
1222
|
+
_: 1
|
|
1223
|
+
}, 8, ["loading", "disabled"])) : K("", !0),
|
|
1224
|
+
le(r.$slots, "actions", {
|
|
1225
|
+
dirtyRows: pe.value,
|
|
1226
|
+
rows: c.value,
|
|
1227
|
+
selection: x(k)
|
|
1228
|
+
}, void 0, !0),
|
|
1229
|
+
ue.value.refresh ? (v(), F(y, {
|
|
1230
|
+
key: 1,
|
|
1231
|
+
content: "刷新",
|
|
1232
|
+
placement: "top"
|
|
1233
|
+
}, {
|
|
1234
|
+
default: _(() => [
|
|
1235
|
+
q(u, {
|
|
1236
|
+
circle: "",
|
|
1237
|
+
onClick: Te
|
|
1238
|
+
}, {
|
|
1239
|
+
default: _(() => [
|
|
1240
|
+
q(g, null, {
|
|
1241
|
+
default: _(() => [
|
|
1242
|
+
q(x(_n))
|
|
1243
|
+
]),
|
|
1244
|
+
_: 1
|
|
1245
|
+
})
|
|
1246
|
+
]),
|
|
1247
|
+
_: 1
|
|
1248
|
+
})
|
|
1249
|
+
]),
|
|
1250
|
+
_: 1
|
|
1251
|
+
})) : K("", !0),
|
|
1252
|
+
ue.value.size ? (v(), F(y, {
|
|
1253
|
+
key: 2,
|
|
1254
|
+
content: "调整大小",
|
|
1255
|
+
placement: "top"
|
|
1256
|
+
}, {
|
|
1257
|
+
default: _(() => [
|
|
1258
|
+
q(U, {
|
|
1259
|
+
trigger: "click",
|
|
1260
|
+
onCommand: Ut
|
|
1261
|
+
}, {
|
|
1262
|
+
dropdown: _(() => [
|
|
1263
|
+
q(B, null, {
|
|
1264
|
+
default: _(() => [
|
|
1265
|
+
q(m, {
|
|
1266
|
+
command: "large",
|
|
1267
|
+
disabled: me.value === "large"
|
|
1268
|
+
}, {
|
|
1269
|
+
default: _(() => [...i[4] || (i[4] = [
|
|
1270
|
+
Z("大", -1)
|
|
1271
|
+
])]),
|
|
1272
|
+
_: 1
|
|
1273
|
+
}, 8, ["disabled"]),
|
|
1274
|
+
q(m, {
|
|
1275
|
+
command: "default",
|
|
1276
|
+
disabled: me.value === "default"
|
|
1277
|
+
}, {
|
|
1278
|
+
default: _(() => [...i[5] || (i[5] = [
|
|
1279
|
+
Z("默认", -1)
|
|
1280
|
+
])]),
|
|
1281
|
+
_: 1
|
|
1282
|
+
}, 8, ["disabled"]),
|
|
1283
|
+
q(m, {
|
|
1284
|
+
command: "small",
|
|
1285
|
+
disabled: me.value === "small"
|
|
1286
|
+
}, {
|
|
1287
|
+
default: _(() => [...i[6] || (i[6] = [
|
|
1288
|
+
Z("小", -1)
|
|
1289
|
+
])]),
|
|
1290
|
+
_: 1
|
|
1291
|
+
}, 8, ["disabled"])
|
|
1292
|
+
]),
|
|
1293
|
+
_: 1
|
|
1294
|
+
})
|
|
1295
|
+
]),
|
|
1296
|
+
default: _(() => [
|
|
1297
|
+
q(u, { circle: "" }, {
|
|
1298
|
+
default: _(() => [
|
|
1299
|
+
q(g, null, {
|
|
1300
|
+
default: _(() => [
|
|
1301
|
+
q(x(Sn))
|
|
1302
|
+
]),
|
|
1303
|
+
_: 1
|
|
1304
|
+
})
|
|
1305
|
+
]),
|
|
1306
|
+
_: 1
|
|
1307
|
+
})
|
|
1308
|
+
]),
|
|
1309
|
+
_: 1
|
|
1310
|
+
})
|
|
1311
|
+
]),
|
|
1312
|
+
_: 1
|
|
1313
|
+
})) : K("", !0),
|
|
1314
|
+
ue.value.modeSwitch || o.modeSwitch ? (v(), F(y, {
|
|
1315
|
+
key: 3,
|
|
1316
|
+
content: "表格/列表切换",
|
|
1317
|
+
placement: "top"
|
|
1318
|
+
}, {
|
|
1319
|
+
default: _(() => [
|
|
1320
|
+
q(u, {
|
|
1321
|
+
circle: "",
|
|
1322
|
+
onClick: tn
|
|
1323
|
+
}, {
|
|
1324
|
+
default: _(() => [
|
|
1325
|
+
q(g, null, {
|
|
1326
|
+
default: _(() => [
|
|
1327
|
+
M.value === "card" ? (v(), F(x(kn), { key: 0 })) : (v(), F(x(Cn), { key: 1 }))
|
|
1328
|
+
]),
|
|
1329
|
+
_: 1
|
|
1330
|
+
})
|
|
1331
|
+
]),
|
|
1332
|
+
_: 1
|
|
1333
|
+
})
|
|
1334
|
+
]),
|
|
1335
|
+
_: 1
|
|
1336
|
+
})) : K("", !0),
|
|
1337
|
+
ue.value.columnSetting || o.dynamicColumn ? (v(), F(y, {
|
|
1338
|
+
key: 4,
|
|
1339
|
+
content: "列设置",
|
|
1340
|
+
placement: "top"
|
|
1341
|
+
}, {
|
|
1342
|
+
default: _(() => [
|
|
1343
|
+
q(u, {
|
|
1344
|
+
circle: "",
|
|
1345
|
+
onClick: i[0] || (i[0] = (s) => _e.value = !0)
|
|
1346
|
+
}, {
|
|
1347
|
+
default: _(() => [
|
|
1348
|
+
q(g, null, {
|
|
1349
|
+
default: _(() => [
|
|
1350
|
+
q(x(Vn))
|
|
1351
|
+
]),
|
|
1352
|
+
_: 1
|
|
1353
|
+
})
|
|
1354
|
+
]),
|
|
1355
|
+
_: 1
|
|
1356
|
+
})
|
|
1357
|
+
]),
|
|
1358
|
+
_: 1
|
|
1359
|
+
})) : K("", !0)
|
|
1360
|
+
])
|
|
1361
|
+
])) : K("", !0),
|
|
1362
|
+
M.value === "table" ? ht((v(), F(un, {
|
|
1363
|
+
key: 1,
|
|
1364
|
+
ref_key: "tableRef",
|
|
1365
|
+
ref: f,
|
|
1366
|
+
data: c.value,
|
|
1367
|
+
size: me.value,
|
|
1368
|
+
border: o.border,
|
|
1369
|
+
stripe: o.stripe,
|
|
1370
|
+
height: Kt.value,
|
|
1371
|
+
"row-key": o.rowKey || void 0,
|
|
1372
|
+
"tree-props": o.treeProps,
|
|
1373
|
+
"default-expand-all": o.defaultExpandAll,
|
|
1374
|
+
"span-method": Xt,
|
|
1375
|
+
class: "wd-editable-grid__table",
|
|
1376
|
+
onSelectionChange: en,
|
|
1377
|
+
onCellClick: At
|
|
1378
|
+
}, {
|
|
1379
|
+
empty: _(() => [
|
|
1380
|
+
le(r.$slots, "empty", {}, () => [
|
|
1381
|
+
q(mt, {
|
|
1382
|
+
description: x(E) ? "加载中..." : "暂无数据",
|
|
1383
|
+
"image-size": 80
|
|
1384
|
+
}, null, 8, ["description"])
|
|
1385
|
+
], !0)
|
|
1386
|
+
]),
|
|
1387
|
+
default: _(() => [
|
|
1388
|
+
o.withSelection ? (v(), F($, {
|
|
1389
|
+
key: 0,
|
|
1390
|
+
type: "selection",
|
|
1391
|
+
width: "60",
|
|
1392
|
+
align: "center",
|
|
1393
|
+
"reserve-selection": ""
|
|
1394
|
+
})) : K("", !0),
|
|
1395
|
+
o.withIndex ? (v(), F($, {
|
|
1396
|
+
key: 1,
|
|
1397
|
+
type: "index",
|
|
1398
|
+
label: "序号",
|
|
1399
|
+
width: "60",
|
|
1400
|
+
align: "center",
|
|
1401
|
+
index: Qt
|
|
1402
|
+
})) : K("", !0),
|
|
1403
|
+
(v(!0), j(se, null, fe(Gt.value, (s) => (v(), F($, {
|
|
1404
|
+
key: s.prop,
|
|
1405
|
+
prop: s.prop,
|
|
1406
|
+
label: s.label,
|
|
1407
|
+
width: s.width,
|
|
1408
|
+
"min-width": s.minWidth,
|
|
1409
|
+
align: s.align || "left",
|
|
1410
|
+
fixed: s.fixed
|
|
1411
|
+
}, {
|
|
1412
|
+
default: _(({ row: h, $index: C }) => [
|
|
1413
|
+
o.editMode === "row" ? (v(), j("div", {
|
|
1414
|
+
key: 0,
|
|
1415
|
+
class: Ue(["wd-editable-grid__cell", Fe(C, s)]),
|
|
1416
|
+
title: Ge(C, s) || void 0
|
|
1417
|
+
}, [
|
|
1418
|
+
ge(C) && s.editor === "input" ? (v(), F(ve, {
|
|
1419
|
+
key: 0,
|
|
1420
|
+
modelValue: h[s.prop],
|
|
1421
|
+
"onUpdate:modelValue": (S) => h[s.prop] = S,
|
|
1422
|
+
placeholder: s.placeholder,
|
|
1423
|
+
onChange: (S) => re(C, s)
|
|
1424
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onChange"])) : ge(C) && s.editor === "number" ? (v(), F(ft, {
|
|
1425
|
+
key: 1,
|
|
1426
|
+
modelValue: h[s.prop],
|
|
1427
|
+
"onUpdate:modelValue": (S) => h[s.prop] = S,
|
|
1428
|
+
min: s.min,
|
|
1429
|
+
max: s.max,
|
|
1430
|
+
precision: s.precision,
|
|
1431
|
+
onChange: (S) => re(C, s)
|
|
1432
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "min", "max", "precision", "onChange"])) : ge(C) && s.editor === "select" ? (v(), F(pt, {
|
|
1433
|
+
key: 2,
|
|
1434
|
+
modelValue: h[s.prop],
|
|
1435
|
+
"onUpdate:modelValue": (S) => h[s.prop] = S,
|
|
1436
|
+
placeholder: s.placeholder,
|
|
1437
|
+
onChange: (S) => re(C, s)
|
|
1438
|
+
}, {
|
|
1439
|
+
default: _(() => [
|
|
1440
|
+
(v(!0), j(se, null, fe(s.options || [], (S) => (v(), F(ct, {
|
|
1441
|
+
key: S.value,
|
|
1442
|
+
label: S.text,
|
|
1443
|
+
value: S.value
|
|
1444
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
1445
|
+
]),
|
|
1446
|
+
_: 2
|
|
1447
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "onChange"])) : ge(C) && s.editor === "date" ? (v(), F(gt, {
|
|
1448
|
+
key: 3,
|
|
1449
|
+
modelValue: h[s.prop],
|
|
1450
|
+
"onUpdate:modelValue": (S) => h[s.prop] = S,
|
|
1451
|
+
type: "date",
|
|
1452
|
+
"value-format": "YYYY-MM-DD",
|
|
1453
|
+
placeholder: s.placeholder,
|
|
1454
|
+
onChange: (S) => re(C, s)
|
|
1455
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onChange"])) : ge(C) ? le(r.$slots, `edit-${s.prop}`, {
|
|
1456
|
+
row: h,
|
|
1457
|
+
index: C,
|
|
1458
|
+
column: s
|
|
1459
|
+
}, () => [
|
|
1460
|
+
q(ve, {
|
|
1461
|
+
modelValue: h[s.prop],
|
|
1462
|
+
"onUpdate:modelValue": (S) => h[s.prop] = S,
|
|
1463
|
+
placeholder: s.placeholder,
|
|
1464
|
+
onChange: (S) => re(C, s)
|
|
1465
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onChange"])
|
|
1466
|
+
], !0, 4) : (v(), j("span", wr, ae(Ye(h, s)), 1)),
|
|
1467
|
+
Fe(C, s)["is-dirty"] ? (v(), F(y, {
|
|
1468
|
+
key: 6,
|
|
1469
|
+
content: "已修改",
|
|
1470
|
+
placement: "top"
|
|
1471
|
+
}, {
|
|
1472
|
+
default: _(() => [
|
|
1473
|
+
le(r.$slots, "dirty-tip-{{ col.prop }}", {
|
|
1474
|
+
row: h,
|
|
1475
|
+
column: s,
|
|
1476
|
+
index: C
|
|
1477
|
+
}, () => [
|
|
1478
|
+
q(g, { class: "wd-editable-grid__cell-dirty-icon" }, {
|
|
1479
|
+
default: _(() => [
|
|
1480
|
+
q(x(wt))
|
|
1481
|
+
]),
|
|
1482
|
+
_: 1
|
|
1483
|
+
})
|
|
1484
|
+
], !0)
|
|
1485
|
+
]),
|
|
1486
|
+
_: 2
|
|
1487
|
+
}, 1024)) : K("", !0)
|
|
1488
|
+
], 10, hr)) : (v(), j("div", {
|
|
1489
|
+
key: 1,
|
|
1490
|
+
class: Ue(["wd-editable-grid__cell", Fe(C, s)]),
|
|
1491
|
+
title: Ge(C, s) || void 0
|
|
1492
|
+
}, [
|
|
1493
|
+
L.value === ne(C, s.prop) && s.editor === "input" ? (v(), F(ve, {
|
|
1494
|
+
key: 0,
|
|
1495
|
+
modelValue: h[s.prop],
|
|
1496
|
+
"onUpdate:modelValue": (S) => h[s.prop] = S,
|
|
1497
|
+
ref_for: !0,
|
|
1498
|
+
ref: Be,
|
|
1499
|
+
placeholder: s.placeholder,
|
|
1500
|
+
onChange: (S) => re(C, s),
|
|
1501
|
+
onBlur: ze
|
|
1502
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onChange"])) : L.value === ne(C, s.prop) && s.editor === "number" ? (v(), F(ft, {
|
|
1503
|
+
key: 1,
|
|
1504
|
+
modelValue: h[s.prop],
|
|
1505
|
+
"onUpdate:modelValue": (S) => h[s.prop] = S,
|
|
1506
|
+
ref_for: !0,
|
|
1507
|
+
ref: Be,
|
|
1508
|
+
min: s.min,
|
|
1509
|
+
max: s.max,
|
|
1510
|
+
precision: s.precision,
|
|
1511
|
+
onChange: (S) => re(C, s),
|
|
1512
|
+
onBlur: ze
|
|
1513
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "min", "max", "precision", "onChange"])) : L.value === ne(C, s.prop) && s.editor === "select" ? (v(), F(pt, {
|
|
1514
|
+
key: 2,
|
|
1515
|
+
modelValue: h[s.prop],
|
|
1516
|
+
"onUpdate:modelValue": (S) => h[s.prop] = S,
|
|
1517
|
+
ref_for: !0,
|
|
1518
|
+
ref: Be,
|
|
1519
|
+
placeholder: s.placeholder,
|
|
1520
|
+
onChange: (S) => Et(C, s),
|
|
1521
|
+
onBlur: ze
|
|
1522
|
+
}, {
|
|
1523
|
+
default: _(() => [
|
|
1524
|
+
(v(!0), j(se, null, fe(s.options || [], (S) => (v(), F(ct, {
|
|
1525
|
+
key: S.value,
|
|
1526
|
+
label: S.text,
|
|
1527
|
+
value: S.value
|
|
1528
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
1529
|
+
]),
|
|
1530
|
+
_: 2
|
|
1531
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "onChange"])) : L.value === ne(C, s.prop) && s.editor === "date" ? (v(), F(gt, {
|
|
1532
|
+
key: 3,
|
|
1533
|
+
modelValue: h[s.prop],
|
|
1534
|
+
"onUpdate:modelValue": (S) => h[s.prop] = S,
|
|
1535
|
+
type: "date",
|
|
1536
|
+
"value-format": "YYYY-MM-DD",
|
|
1537
|
+
placeholder: s.placeholder,
|
|
1538
|
+
onChange: (S) => Ot(C, s)
|
|
1539
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onChange"])) : L.value === ne(C, s.prop) ? le(r.$slots, `edit-${s.prop}`, {
|
|
1540
|
+
row: h,
|
|
1541
|
+
index: C,
|
|
1542
|
+
column: s
|
|
1543
|
+
}, () => [
|
|
1544
|
+
q(ve, {
|
|
1545
|
+
modelValue: h[s.prop],
|
|
1546
|
+
"onUpdate:modelValue": (S) => h[s.prop] = S,
|
|
1547
|
+
placeholder: s.placeholder,
|
|
1548
|
+
onChange: (S) => re(C, s)
|
|
1549
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onChange"])
|
|
1550
|
+
], !0, 4) : (v(), j("span", _r, ae(Ye(h, s)), 1)),
|
|
1551
|
+
Fe(C, s)["is-dirty"] ? (v(), F(y, {
|
|
1552
|
+
key: 6,
|
|
1553
|
+
content: "已修改",
|
|
1554
|
+
placement: "top"
|
|
1555
|
+
}, {
|
|
1556
|
+
default: _(() => [
|
|
1557
|
+
le(r.$slots, "dirty-tip-{{ col.prop }}", {
|
|
1558
|
+
row: h,
|
|
1559
|
+
column: s,
|
|
1560
|
+
index: C
|
|
1561
|
+
}, () => [
|
|
1562
|
+
q(g, { class: "wd-editable-grid__cell-dirty-icon" }, {
|
|
1563
|
+
default: _(() => [
|
|
1564
|
+
q(x(wt))
|
|
1565
|
+
]),
|
|
1566
|
+
_: 1
|
|
1567
|
+
})
|
|
1568
|
+
], !0)
|
|
1569
|
+
]),
|
|
1570
|
+
_: 2
|
|
1571
|
+
}, 1024)) : K("", !0)
|
|
1572
|
+
], 10, br))
|
|
1573
|
+
]),
|
|
1574
|
+
_: 2
|
|
1575
|
+
}, 1032, ["prop", "label", "width", "min-width", "align", "fixed"]))), 128)),
|
|
1576
|
+
q(x(a), { vnodes: Jt.value }, null, 8, ["vnodes"]),
|
|
1577
|
+
o.rowActions.length ? (v(), F($, {
|
|
1578
|
+
key: 2,
|
|
1579
|
+
label: "操作",
|
|
1580
|
+
width: nn.value,
|
|
1581
|
+
align: "center",
|
|
1582
|
+
fixed: "right"
|
|
1583
|
+
}, {
|
|
1584
|
+
default: _(({ row: s }) => [
|
|
1585
|
+
(v(!0), j(se, null, fe(o.rowActions, (h) => (v(), F(u, {
|
|
1586
|
+
key: h.command || h.text,
|
|
1587
|
+
link: "",
|
|
1588
|
+
size: "small",
|
|
1589
|
+
type: h.type || "primary",
|
|
1590
|
+
onClick: (C) => rn(s, h)
|
|
1591
|
+
}, {
|
|
1592
|
+
default: _(() => [
|
|
1593
|
+
Z(ae(h.text), 1)
|
|
1594
|
+
]),
|
|
1595
|
+
_: 2
|
|
1596
|
+
}, 1032, ["type", "onClick"]))), 128))
|
|
1597
|
+
]),
|
|
1598
|
+
_: 1
|
|
1599
|
+
}, 8, ["width"])) : K("", !0),
|
|
1600
|
+
o.withActions ? (v(), F($, {
|
|
1601
|
+
key: 3,
|
|
1602
|
+
label: "操作",
|
|
1603
|
+
width: o.actionWidth,
|
|
1604
|
+
align: "center",
|
|
1605
|
+
fixed: "right"
|
|
1606
|
+
}, {
|
|
1607
|
+
default: _(({ row: s, $index: h }) => [
|
|
1608
|
+
o.editMode === "row" ? (v(), j(se, { key: 0 }, [
|
|
1609
|
+
ge(h) ? (v(), j(se, { key: 0 }, [
|
|
1610
|
+
q(u, {
|
|
1611
|
+
link: "",
|
|
1612
|
+
type: "primary",
|
|
1613
|
+
onClick: (C) => zt(h)
|
|
1614
|
+
}, {
|
|
1615
|
+
default: _(() => [...i[7] || (i[7] = [
|
|
1616
|
+
Z("保存", -1)
|
|
1617
|
+
])]),
|
|
1618
|
+
_: 1
|
|
1619
|
+
}, 8, ["onClick"]),
|
|
1620
|
+
q(u, {
|
|
1621
|
+
link: "",
|
|
1622
|
+
onClick: (C) => Bt(h)
|
|
1623
|
+
}, {
|
|
1624
|
+
default: _(() => [...i[8] || (i[8] = [
|
|
1625
|
+
Z("取消", -1)
|
|
1626
|
+
])]),
|
|
1627
|
+
_: 1
|
|
1628
|
+
}, 8, ["onClick"])
|
|
1629
|
+
], 64)) : (v(), F(u, {
|
|
1630
|
+
key: 1,
|
|
1631
|
+
link: "",
|
|
1632
|
+
type: "primary",
|
|
1633
|
+
onClick: (C) => Mt(h)
|
|
1634
|
+
}, {
|
|
1635
|
+
default: _(() => [...i[9] || (i[9] = [
|
|
1636
|
+
Z("编辑", -1)
|
|
1637
|
+
])]),
|
|
1638
|
+
_: 1
|
|
1639
|
+
}, 8, ["onClick"]))
|
|
1640
|
+
], 64)) : K("", !0),
|
|
1641
|
+
o.withDelete ? (v(), F(u, {
|
|
1642
|
+
key: 1,
|
|
1643
|
+
link: "",
|
|
1644
|
+
type: "danger",
|
|
1645
|
+
onClick: (C) => jt(h)
|
|
1646
|
+
}, {
|
|
1647
|
+
default: _(() => [...i[10] || (i[10] = [
|
|
1648
|
+
Z("删除", -1)
|
|
1649
|
+
])]),
|
|
1650
|
+
_: 1
|
|
1651
|
+
}, 8, ["onClick"])) : K("", !0),
|
|
1652
|
+
le(r.$slots, "row-actions", {
|
|
1653
|
+
row: s,
|
|
1654
|
+
index: h
|
|
1655
|
+
}, void 0, !0)
|
|
1656
|
+
]),
|
|
1657
|
+
_: 3
|
|
1658
|
+
}, 8, ["width"])) : K("", !0)
|
|
1659
|
+
]),
|
|
1660
|
+
_: 3
|
|
1661
|
+
}, 8, ["data", "size", "border", "stripe", "height", "row-key", "tree-props", "default-expand-all"])), [
|
|
1662
|
+
[vt, x(E)]
|
|
1663
|
+
]) : ht((v(), j("div", Sr, [
|
|
1664
|
+
c.value.length ? K("", !0) : (v(), F(mt, {
|
|
1665
|
+
key: 0,
|
|
1666
|
+
description: "暂无数据",
|
|
1667
|
+
"image-size": 80
|
|
1668
|
+
})),
|
|
1669
|
+
(v(!0), j(se, null, fe(c.value, (s, h) => (v(), j("div", {
|
|
1670
|
+
key: s[o.rowKey || "id"] ?? h,
|
|
1671
|
+
class: "wd-editable-grid__card"
|
|
1672
|
+
}, [
|
|
1673
|
+
le(r.$slots, "card-item", {
|
|
1674
|
+
row: s,
|
|
1675
|
+
index: h
|
|
1676
|
+
}, () => [
|
|
1677
|
+
de("div", kr, ae(s.name || s.title || `第 ${h + 1} 项`), 1),
|
|
1678
|
+
de("div", Cr, [
|
|
1679
|
+
(v(!0), j(se, null, fe(s, (C, S) => (v(), j("div", {
|
|
1680
|
+
key: S,
|
|
1681
|
+
class: "wd-editable-grid__card-line"
|
|
1682
|
+
}, [
|
|
1683
|
+
de("span", Vr, ae(S), 1),
|
|
1684
|
+
de("span", qr, ae(C), 1)
|
|
1685
|
+
]))), 128))
|
|
1686
|
+
])
|
|
1687
|
+
], !0)
|
|
1688
|
+
]))), 128))
|
|
1689
|
+
])), [
|
|
1690
|
+
[vt, x(E)]
|
|
1691
|
+
]),
|
|
1692
|
+
o.withPager && M.value === "table" ? (v(), j("div", Fr, [
|
|
1693
|
+
q(dn, {
|
|
1694
|
+
"current-page": x(p),
|
|
1695
|
+
"page-size": x(Q),
|
|
1696
|
+
total: x(b),
|
|
1697
|
+
"page-sizes": x(D),
|
|
1698
|
+
layout: Wt.value,
|
|
1699
|
+
small: o.pagerStyle === "simple",
|
|
1700
|
+
"hide-on-single-page": x(N),
|
|
1701
|
+
background: !0,
|
|
1702
|
+
onCurrentChange: lt,
|
|
1703
|
+
onSizeChange: st
|
|
1704
|
+
}, null, 8, ["current-page", "page-size", "total", "page-sizes", "layout", "small", "hide-on-single-page"])
|
|
1705
|
+
])) : K("", !0),
|
|
1706
|
+
q(cn, {
|
|
1707
|
+
modelValue: x(_e),
|
|
1708
|
+
"onUpdate:modelValue": i[3] || (i[3] = (s) => wn(_e) ? _e.value = s : null),
|
|
1709
|
+
title: "列设置",
|
|
1710
|
+
width: "360px",
|
|
1711
|
+
"append-to-body": ""
|
|
1712
|
+
}, {
|
|
1713
|
+
footer: _(() => [
|
|
1714
|
+
q(u, {
|
|
1715
|
+
onClick: i[1] || (i[1] = (s) => x(Yt)())
|
|
1716
|
+
}, {
|
|
1717
|
+
default: _(() => [...i[13] || (i[13] = [
|
|
1718
|
+
Z("恢复默认", -1)
|
|
1719
|
+
])]),
|
|
1720
|
+
_: 1
|
|
1721
|
+
}),
|
|
1722
|
+
q(u, {
|
|
1723
|
+
type: "primary",
|
|
1724
|
+
onClick: i[2] || (i[2] = (s) => _e.value = !1)
|
|
1725
|
+
}, {
|
|
1726
|
+
default: _(() => [...i[14] || (i[14] = [
|
|
1727
|
+
Z("完成", -1)
|
|
1728
|
+
])]),
|
|
1729
|
+
_: 1
|
|
1730
|
+
})
|
|
1731
|
+
]),
|
|
1732
|
+
default: _(() => [
|
|
1733
|
+
de("div", Ar, [
|
|
1734
|
+
(v(!0), j(se, null, fe(x(nt), (s) => (v(), j("div", {
|
|
1735
|
+
key: s.key,
|
|
1736
|
+
class: "wd-editable-grid__col-item"
|
|
1737
|
+
}, [
|
|
1738
|
+
q(fn, {
|
|
1739
|
+
"model-value": s.visible,
|
|
1740
|
+
"onUpdate:modelValue": (h) => x(It)(s.key, h)
|
|
1741
|
+
}, {
|
|
1742
|
+
default: _(() => [
|
|
1743
|
+
Z(ae(s.label), 1)
|
|
1744
|
+
]),
|
|
1745
|
+
_: 2
|
|
1746
|
+
}, 1032, ["model-value", "onUpdate:modelValue"]),
|
|
1747
|
+
de("div", xr, [
|
|
1748
|
+
q(u, {
|
|
1749
|
+
link: "",
|
|
1750
|
+
size: "small",
|
|
1751
|
+
disabled: s.order === 0,
|
|
1752
|
+
onClick: (h) => x(at)(s.key, -1)
|
|
1753
|
+
}, {
|
|
1754
|
+
default: _(() => [...i[11] || (i[11] = [
|
|
1755
|
+
Z("上移", -1)
|
|
1756
|
+
])]),
|
|
1757
|
+
_: 1
|
|
1758
|
+
}, 8, ["disabled", "onClick"]),
|
|
1759
|
+
q(u, {
|
|
1760
|
+
link: "",
|
|
1761
|
+
size: "small",
|
|
1762
|
+
disabled: s.order === x(nt).length - 1,
|
|
1763
|
+
onClick: (h) => x(at)(s.key, 1)
|
|
1764
|
+
}, {
|
|
1765
|
+
default: _(() => [...i[12] || (i[12] = [
|
|
1766
|
+
Z("下移", -1)
|
|
1767
|
+
])]),
|
|
1768
|
+
_: 1
|
|
1769
|
+
}, 8, ["disabled", "onClick"])
|
|
1770
|
+
])
|
|
1771
|
+
]))), 128))
|
|
1772
|
+
])
|
|
1773
|
+
]),
|
|
1774
|
+
_: 1
|
|
1775
|
+
}, 8, ["modelValue"])
|
|
1776
|
+
], 6);
|
|
1777
|
+
};
|
|
1778
|
+
}
|
|
1779
|
+
}), Nr = /* @__PURE__ */ Bn(Er, [["__scopeId", "data-v-34937ba1"]]);
|
|
1780
|
+
export {
|
|
1781
|
+
Nr as W
|
|
1782
|
+
};
|
|
1783
|
+
//# sourceMappingURL=EditableGrid-Cx7ScWkW.mjs.map
|