@aplus-frontend/ui 0.4.34 → 0.4.36
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/es/src/ap-form/hooks/use-watch.d.ts +4 -1
- package/es/src/ap-form/hooks/use-watch.mjs +31 -29
- package/es/src/ap-form/index.mjs +1 -1
- package/es/src/ap-form/search-form/index.vue.mjs +14 -15
- package/es/src/ap-modal/enums/modalMessage.d.ts +6 -0
- package/es/src/ap-modal/enums/modalMessage.mjs +4 -0
- package/es/src/ap-modal/index.d.ts +2 -1
- package/es/src/ap-modal/index.mjs +2 -0
- package/es/src/ap-modal/interface.d.ts +126 -1
- package/es/src/ap-modal/utils/createModalStream.d.ts +2 -0
- package/es/src/ap-modal/utils/createModalStream.mjs +99 -0
- package/es/src/ap-modal/utils/index.d.ts +1 -0
- package/es/src/ap-modal/utils/index.mjs +4 -2
- package/es/src/ap-table/components/dynamic-component/index.vue2.mjs +4 -7
- package/es/src/ap-table/utils.d.ts +1 -4
- package/es/src/ap-table/utils.mjs +43 -41
- package/es/src/business/ap-attachment/ApAttachment.mjs +13 -13
- package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +13 -13
- package/lib/src/ap-form/hooks/use-watch.d.ts +4 -1
- package/lib/src/ap-form/hooks/use-watch.js +1 -1
- package/lib/src/ap-form/index.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-modal/enums/modalMessage.d.ts +6 -0
- package/lib/src/ap-modal/enums/modalMessage.js +1 -0
- package/lib/src/ap-modal/index.d.ts +2 -1
- package/lib/src/ap-modal/index.js +1 -1
- package/lib/src/ap-modal/interface.d.ts +126 -1
- package/lib/src/ap-modal/utils/createModalStream.d.ts +2 -0
- package/lib/src/ap-modal/utils/createModalStream.js +1 -0
- package/lib/src/ap-modal/utils/index.d.ts +1 -0
- package/lib/src/ap-modal/utils/index.js +1 -1
- package/lib/src/ap-table/components/dynamic-component/index.vue2.js +1 -1
- package/lib/src/ap-table/utils.d.ts +1 -4
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue2.js +1 -1
- package/package.json +5 -5
- package/theme/ap-grid/index.css +302 -0
- package/theme/ap-grid/index.less +65 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { isVNode as E, createVNode as l, mergeProps as y, cloneVNode as j, Fragment as O } from "vue";
|
|
2
|
-
import { isObject as a, isArray as c, isUndefined as g, isFunction as T, omit as C, isBoolean as F, isString as N, isEqual as S, sortBy as p, isPlainObject as
|
|
2
|
+
import { isObject as a, isArray as c, isUndefined as g, isFunction as T, omit as C, isBoolean as F, isString as N, isEqual as S, sortBy as p, isPlainObject as d, every as I, isEmpty as v } from "lodash-unified";
|
|
3
3
|
import { apTableRenderItemMap as V, apTableFormItemMap as P } from "./constants.mjs";
|
|
4
4
|
import { isType as _ } from "@fruits-chain/utils";
|
|
5
5
|
import "../ap-form/index.mjs";
|
|
6
6
|
import { Tooltip as w } from "@aplus-frontend/antdv";
|
|
7
7
|
import { QuestionCircleOutlined as x } from "@ant-design/icons-vue";
|
|
8
8
|
import "./components/dynamic-component/index.vue.mjs";
|
|
9
|
-
import
|
|
9
|
+
import m from "./components/dynamic-component/index.vue2.mjs";
|
|
10
10
|
import A from "../ap-form/item/index.vue.mjs";
|
|
11
11
|
function R(t) {
|
|
12
12
|
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !E(t);
|
|
13
13
|
}
|
|
14
14
|
const q = (t, e, n) => {
|
|
15
|
-
let
|
|
15
|
+
let o = {};
|
|
16
16
|
return a(t) ? Object.keys(t).forEach((i) => {
|
|
17
|
-
a(t[i]) ?
|
|
18
|
-
}) :
|
|
17
|
+
a(t[i]) ? o[i] = q(t[i], e[i], n) : o[i] = n(t[i], e);
|
|
18
|
+
}) : o = n(t, e), o;
|
|
19
19
|
}, k = (t, e) => {
|
|
20
20
|
switch (t) {
|
|
21
21
|
case "dayjs":
|
|
@@ -23,8 +23,8 @@ const q = (t, e, n) => {
|
|
|
23
23
|
case "dayjsRange":
|
|
24
24
|
return e.map((n) => n.valueOf());
|
|
25
25
|
case "dayjsDayRange": {
|
|
26
|
-
const [n,
|
|
27
|
-
return [n.startOf("day").valueOf(),
|
|
26
|
+
const [n, o] = e;
|
|
27
|
+
return [n.startOf("day").valueOf(), o.endOf("day").valueOf()];
|
|
28
28
|
}
|
|
29
29
|
case "multiple":
|
|
30
30
|
case "multipleNumber":
|
|
@@ -46,21 +46,21 @@ function W(t) {
|
|
|
46
46
|
}
|
|
47
47
|
const $ = (t) => W(t) === "map" ? t : new Map(Object.entries(t || {})), b = (t) => {
|
|
48
48
|
const e = [], n = $(t);
|
|
49
|
-
return n.forEach((
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
if (typeof
|
|
49
|
+
return n.forEach((o, i) => {
|
|
50
|
+
const r = n.get(i) || n.get(`${i}`);
|
|
51
|
+
if (r) {
|
|
52
|
+
if (typeof r == "object" && (r != null && r.text)) {
|
|
53
53
|
e.push({
|
|
54
|
-
text:
|
|
54
|
+
text: r == null ? void 0 : r.text,
|
|
55
55
|
value: i,
|
|
56
|
-
label:
|
|
57
|
-
disabled:
|
|
56
|
+
label: r == null ? void 0 : r.text,
|
|
57
|
+
disabled: r.disabled
|
|
58
58
|
});
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
61
|
e.push({
|
|
62
|
-
text:
|
|
63
|
-
label:
|
|
62
|
+
text: r,
|
|
63
|
+
label: r,
|
|
64
64
|
value: i
|
|
65
65
|
});
|
|
66
66
|
}
|
|
@@ -73,20 +73,20 @@ function tt(t) {
|
|
|
73
73
|
let e = t.valueType || "text";
|
|
74
74
|
return t.valueEnum && (e = "status"), e;
|
|
75
75
|
}
|
|
76
|
-
function et(t, e, n,
|
|
76
|
+
function et(t, e, n, o) {
|
|
77
77
|
var s;
|
|
78
78
|
const i = V[t];
|
|
79
79
|
if (i)
|
|
80
80
|
return l(i, y(e, {
|
|
81
81
|
mode: "read"
|
|
82
82
|
}), null);
|
|
83
|
-
const
|
|
84
|
-
return ((s =
|
|
83
|
+
const r = o == null ? void 0 : o[t];
|
|
84
|
+
return ((s = r == null ? void 0 : r.render) == null ? void 0 : s.call(r, e.value, n, e)) || e.value;
|
|
85
85
|
}
|
|
86
86
|
function nt(t, e) {
|
|
87
87
|
if (t.customRenderFormItem)
|
|
88
88
|
return {
|
|
89
|
-
Comp:
|
|
89
|
+
Comp: m,
|
|
90
90
|
render: function(s) {
|
|
91
91
|
const u = s.item.customRenderFormItem(s.item);
|
|
92
92
|
return j(u, {
|
|
@@ -104,29 +104,31 @@ function nt(t, e) {
|
|
|
104
104
|
return {
|
|
105
105
|
Comp: n
|
|
106
106
|
};
|
|
107
|
-
const
|
|
108
|
-
function i(
|
|
107
|
+
const o = e == null ? void 0 : e[t.valueType];
|
|
108
|
+
function i(r) {
|
|
109
109
|
var u;
|
|
110
|
-
const s = (u =
|
|
111
|
-
return s ? l(A, y(
|
|
110
|
+
const s = (u = o == null ? void 0 : o.renderFormItem) == null ? void 0 : u.call(o, r.item.fieldProps.field);
|
|
111
|
+
return s ? l(A, y(r.item.fieldProps, {
|
|
112
|
+
hidden: r.hidden,
|
|
113
|
+
class: r.class,
|
|
112
114
|
span: t.span
|
|
113
115
|
}), R(s) ? s : {
|
|
114
116
|
default: () => [s]
|
|
115
117
|
}) : null;
|
|
116
118
|
}
|
|
117
119
|
return {
|
|
118
|
-
Comp:
|
|
120
|
+
Comp: m,
|
|
119
121
|
render: i
|
|
120
122
|
};
|
|
121
123
|
}
|
|
122
124
|
function rt(t, e) {
|
|
123
|
-
const n = B(t.fieldProps, e),
|
|
125
|
+
const n = B(t.fieldProps, e), o = (n == null ? void 0 : n.field) || n || {}, i = t.valueType === "switch", r = t.valueType === "index", s = i ? {
|
|
124
126
|
checked: e.value
|
|
125
127
|
} : {
|
|
126
|
-
value:
|
|
128
|
+
value: r ? e.index + 1 : e.value
|
|
127
129
|
};
|
|
128
|
-
return t.valueEnum && (
|
|
129
|
-
...C(
|
|
130
|
+
return t.valueEnum && (o.valueEnum = t.valueEnum), {
|
|
131
|
+
...C(o, ["request"]),
|
|
130
132
|
...s
|
|
131
133
|
};
|
|
132
134
|
}
|
|
@@ -137,9 +139,9 @@ function ot(t) {
|
|
|
137
139
|
return F(t.filters) && t.filters && t.valueEnum && (e.filters = b(t.valueEnum)), e;
|
|
138
140
|
}
|
|
139
141
|
function it(t, e) {
|
|
140
|
-
var
|
|
142
|
+
var o;
|
|
141
143
|
const n = e || {};
|
|
142
|
-
return t.valueEnum && !((
|
|
144
|
+
return t.valueEnum && !((o = n.field) != null && o.options) && (n.field = {
|
|
143
145
|
...n.field,
|
|
144
146
|
options: b(t.valueEnum)
|
|
145
147
|
}), n;
|
|
@@ -153,12 +155,12 @@ function st(t) {
|
|
|
153
155
|
return t;
|
|
154
156
|
}
|
|
155
157
|
}
|
|
156
|
-
function ut(t, e, n,
|
|
158
|
+
function ut(t, e, n, o) {
|
|
157
159
|
const i = n == null ? void 0 : n({
|
|
158
160
|
title: t.title,
|
|
159
161
|
column: t
|
|
160
|
-
}),
|
|
161
|
-
if (i &&
|
|
162
|
+
}), r = (i == null ? void 0 : i.filter((h) => h.type !== Symbol.for("v-cmt"))) || [];
|
|
163
|
+
if (i && r.length > 0)
|
|
162
164
|
return i;
|
|
163
165
|
const u = N(t.title) ? l("span", {
|
|
164
166
|
class: e,
|
|
@@ -177,7 +179,7 @@ function ut(t, e, n, r) {
|
|
|
177
179
|
default: () => [l(x, {
|
|
178
180
|
style: {
|
|
179
181
|
padding: "4px",
|
|
180
|
-
color:
|
|
182
|
+
color: o,
|
|
181
183
|
verticalAlign: "middle"
|
|
182
184
|
}
|
|
183
185
|
}, null)]
|
|
@@ -185,18 +187,18 @@ function ut(t, e, n, r) {
|
|
|
185
187
|
}
|
|
186
188
|
function lt(t, e) {
|
|
187
189
|
const n = [];
|
|
188
|
-
function
|
|
189
|
-
var
|
|
190
|
+
function o(i) {
|
|
191
|
+
var r;
|
|
190
192
|
for (const s of i)
|
|
191
|
-
(
|
|
193
|
+
(r = s.children) != null && r.length ? o(s.children) : n.push(e(s));
|
|
192
194
|
}
|
|
193
|
-
return
|
|
195
|
+
return o(t), n;
|
|
194
196
|
}
|
|
195
197
|
function ct(t, e) {
|
|
196
198
|
if (c(t) && c(e))
|
|
197
199
|
return S(p(t), p(e));
|
|
198
|
-
if (
|
|
199
|
-
const n = (
|
|
200
|
+
if (d(t) && d(e)) {
|
|
201
|
+
const n = (o) => I(o, (i) => i == null) || v(o);
|
|
200
202
|
if (n(t) && n(e))
|
|
201
203
|
return !0;
|
|
202
204
|
}
|
|
@@ -4,29 +4,29 @@ import "../../config-provider/index.mjs";
|
|
|
4
4
|
import { ApAttachmentProps as W } from "./constans.mjs";
|
|
5
5
|
import { getHexWithOpacity as q, getFileInfo as w } from "../../ap-download/utils/getFileInfo.mjs";
|
|
6
6
|
import { useOssInit as D } from "../../ap-download/hooks/index.mjs";
|
|
7
|
-
import {
|
|
7
|
+
import { debounce as E, isArray as J } from "lodash-unified";
|
|
8
8
|
import { LoadingOutlined as g } from "@ant-design/icons-vue";
|
|
9
|
-
import { useNamespace as
|
|
9
|
+
import { useNamespace as Q } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
10
|
import { useGlobalConfig as h } from "../../config-provider/hooks/use-global-config.mjs";
|
|
11
|
-
import { useLocale as
|
|
12
|
-
const
|
|
11
|
+
import { useLocale as X } from "../../config-provider/hooks/use-locale.mjs";
|
|
12
|
+
const se = /* @__PURE__ */ _({
|
|
13
13
|
name: "ApAttachment",
|
|
14
14
|
props: W(),
|
|
15
15
|
setup(e) {
|
|
16
16
|
const {
|
|
17
|
-
b
|
|
17
|
+
b,
|
|
18
18
|
e: a
|
|
19
|
-
} =
|
|
19
|
+
} = Q("ap-attachment"), O = h("uiMode"), T = h("apUpload"), N = h("downloadCenterTriggerConfig"), {
|
|
20
20
|
lang: x,
|
|
21
21
|
t: m
|
|
22
|
-
} =
|
|
22
|
+
} = X(), i = F(!1), c = F(""), d = j(), P = n(() => x.value === "zh-cn" ? "zh_CN" : "en_US"), u = n(() => e.attachmentList.length === 1), p = n(() => e.needName ? e.attachmentList.length > 0 && e.needName && e.needName.nameKey ? e.attachmentList[0][e.needName.nameKey] : "" : e.attachmentList.length > 0 ? e.attachmentList[0].fileName : ""), k = n(() => u.value ? p.value : m("ap.apAttachment.downloadall")), A = n(() => e.color ? e.color : O.value === "aplus" ? "#0070FF" : "#1890FF"), S = n(() => ({
|
|
23
23
|
width: u.value ? "auto" : "266px"
|
|
24
24
|
})), L = n(() => ({
|
|
25
25
|
"--download-main-color": A.value,
|
|
26
26
|
"--download-main-color-opacity": q(A.value, 0.6)
|
|
27
27
|
})), V = n(() => {
|
|
28
28
|
var t;
|
|
29
|
-
return e.getOssAccess || ((t =
|
|
29
|
+
return e.getOssAccess || ((t = T.value) == null ? void 0 : t.getOssAccess);
|
|
30
30
|
}), z = n(() => {
|
|
31
31
|
const t = d.default ? d.default()[0] : null;
|
|
32
32
|
return t ? K(t, {
|
|
@@ -34,12 +34,12 @@ const ce = /* @__PURE__ */ _({
|
|
|
34
34
|
"font-size": "16px"
|
|
35
35
|
}
|
|
36
36
|
}) : null;
|
|
37
|
-
}), f = async (t, s) => {
|
|
37
|
+
}), f = E(async (t, s) => {
|
|
38
38
|
var o, C;
|
|
39
39
|
if (!e.disabled) {
|
|
40
40
|
i.value = !0, s && (c.value = s);
|
|
41
41
|
try {
|
|
42
|
-
const r =
|
|
42
|
+
const r = J(v(t)) ? v(t) : [v(t)];
|
|
43
43
|
if ((o = N.value) != null && o.trigger) {
|
|
44
44
|
const U = w(e.needName, r).map((y) => ({
|
|
45
45
|
objectName: y.path,
|
|
@@ -54,7 +54,7 @@ const ce = /* @__PURE__ */ _({
|
|
|
54
54
|
i.value = !1, c.value = "";
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
}, I = (t) => t && t.length > 0 ? l("ul", {
|
|
57
|
+
}, 500), I = (t) => t && t.length > 0 ? l("ul", {
|
|
58
58
|
class: [a("file-list")],
|
|
59
59
|
style: L.value
|
|
60
60
|
}, [t.map((s, o) => l("li", {
|
|
@@ -76,7 +76,7 @@ const ce = /* @__PURE__ */ _({
|
|
|
76
76
|
return () => {
|
|
77
77
|
var t;
|
|
78
78
|
return ((t = e.attachmentList) == null ? void 0 : t.length) > 0 && l("div", {
|
|
79
|
-
class: [
|
|
79
|
+
class: [b()],
|
|
80
80
|
style: [S.value, L.value]
|
|
81
81
|
}, [l(H, {
|
|
82
82
|
title: k.value,
|
|
@@ -108,5 +108,5 @@ const ce = /* @__PURE__ */ _({
|
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
export {
|
|
111
|
-
|
|
111
|
+
se as default
|
|
112
112
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as _, ref as
|
|
1
|
+
import { defineComponent as _, ref as v, createBlock as a, openBlock as s, unref as u, withCtx as d, createElementBlock as h, Fragment as t, renderList as y, mergeProps as k, createElementVNode as w, withDirectives as g, createVNode as C, vShow as b, resolveDynamicComponent as L, h as M } from "vue";
|
|
2
2
|
import { LoadingOutlined as B } from "@ant-design/icons-vue";
|
|
3
3
|
import { Menu as R, MenuItem as x } from "@aplus-frontend/antdv";
|
|
4
4
|
const D = { style: { display: "flex", "align-items": "center" } }, P = /* @__PURE__ */ _({
|
|
@@ -9,31 +9,31 @@ const D = { style: { display: "flex", "align-items": "center" } }, P = /* @__PUR
|
|
|
9
9
|
menuList: {}
|
|
10
10
|
},
|
|
11
11
|
setup(f) {
|
|
12
|
-
const
|
|
13
|
-
async function p(
|
|
14
|
-
var
|
|
15
|
-
const n = (
|
|
12
|
+
const l = f, r = v({});
|
|
13
|
+
async function p(o, c) {
|
|
14
|
+
var e;
|
|
15
|
+
const n = (o == null ? void 0 : o.id) || c;
|
|
16
16
|
r.value[n] = !0;
|
|
17
17
|
try {
|
|
18
|
-
await ((
|
|
18
|
+
await ((e = o == null ? void 0 : o.onClick) == null ? void 0 : e.call(o, { selectedRows: l == null ? void 0 : l.selectedRows }));
|
|
19
19
|
} finally {
|
|
20
|
-
r.value[n] =
|
|
20
|
+
r.value[n] = void 0;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
return (
|
|
23
|
+
return (o, c) => (s(), a(u(R), null, {
|
|
24
24
|
default: d(() => [
|
|
25
|
-
(s(!0),
|
|
26
|
-
key: (n == null ? void 0 : n.id) ||
|
|
25
|
+
(s(!0), h(t, null, y(l.menuList, (n, e) => (s(), a(u(x), k({
|
|
26
|
+
key: (n == null ? void 0 : n.id) || e,
|
|
27
27
|
ref_for: !0
|
|
28
28
|
}, {
|
|
29
29
|
...n,
|
|
30
|
-
onClick: () => p(n,
|
|
31
|
-
disabled: r.value[(n == null ? void 0 : n.id) ||
|
|
30
|
+
onClick: () => p(n, e),
|
|
31
|
+
disabled: r.value[(n == null ? void 0 : n.id) || e] ?? (n == null ? void 0 : n.disabled) ?? !1
|
|
32
32
|
}), {
|
|
33
33
|
default: d(() => [
|
|
34
34
|
w("div", D, [
|
|
35
35
|
g(C(u(B), { style: { "margin-right": "10px" } }, null, 512), [
|
|
36
|
-
[b, r.value[(n == null ? void 0 : n.id) ||
|
|
36
|
+
[b, r.value[(n == null ? void 0 : n.id) || e]]
|
|
37
37
|
]),
|
|
38
38
|
(s(), a(L(M(t, [n == null ? void 0 : n.content]))))
|
|
39
39
|
])
|
|
@@ -2,5 +2,8 @@ import { NamePath } from '@aplus-frontend/antdv/es/form/interface';
|
|
|
2
2
|
import { ApFormExpose } from '../interface';
|
|
3
3
|
import { Ref } from 'vue';
|
|
4
4
|
type ApFormIns<T> = ApFormExpose<T>;
|
|
5
|
-
|
|
5
|
+
type WatchOptions<ValueType> = {
|
|
6
|
+
initialValue: ValueType;
|
|
7
|
+
};
|
|
8
|
+
export declare function useWatch<ValueType = any, StoreType = any>(name: NamePath | Ref<NamePath>, formOrOptions?: Ref<ApFormIns<StoreType> | undefined> | WatchOptions<ValueType>, options?: WatchOptions<ValueType>): Ref<ValueType | undefined, ValueType | undefined>;
|
|
6
9
|
export default useWatch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const _=require("../context.js"),u=require("vue"),o=require("lodash-unified"),q=require("../constant.js");function w(t,e){return o.isArray(e)?e.reduce((n,r)=>n==null?void 0:n[r],t):t==null?void 0:t[e]}function g(t){try{return JSON.stringify(t)}catch{return Math.random()}}function I(t,e,n){const{internalInstance:r,model:M}=_.useInjectForm(),V=(n==null?void 0:n.initialValue)||(e==null?void 0:e.initialValue)||void 0,i=u.ref(V);let c=g(V),d=!0;const s=e&&"value"in e?e:void 0;return u.watchEffect(f=>{var h;const a=((h=s==null?void 0:s.value)==null?void 0:h.getInternalInstance(q.INTERNAL_FORM_INSTANCE_MARK))||r;if(!a){d=!1;return}const l=a.registerWatch(N=>{const S=w(N,u.unref(t)),v=g(S);v!==c&&(i.value=S,c=v)},d);f(l)}),u.watch(()=>u.unref(t),f=>{const a=w(u.unref(M),f),l=g(a);l!==c&&(i.value=a,c=l)}),i}exports.default=I;exports.useWatch=I;
|
package/lib/src/ap-form/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./ap-form.vue.js");require("./item/index.vue2.js");require("./item-group/index.vue2.js");require("./list/index.vue2.js");require("./search-form/index.vue2.js");require("./modal-form/index.vue2.js");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./ap-form.vue.js");require("./item/index.vue2.js");require("./item-group/index.vue2.js");require("./list/index.vue2.js");require("./search-form/index.vue2.js");require("./modal-form/index.vue2.js");const l=require("./hooks/use-watch.js");require("./dependency/index.vue2.js");require("./set/index.vue2.js");require("./drawer-form/index.vue2.js");require("./render/control.vue2.js");require("./render/item.vue2.js");require("./provider/index.vue2.js");require("./items/index.js");require("./interface.js");const c=require("./ap-form.vue2.js"),r=require("./item/index.vue.js"),t=require("./item-group/index.vue.js"),u=require("./list/index.vue.js"),_=require("./search-form/index.vue.js"),i=require("./modal-form/index.vue.js"),p=require("./dependency/index.vue.js"),o=require("./set/index.vue.js"),n=require("./drawer-form/index.vue.js"),a=require("./render/control.vue.js"),s=require("./render/item.vue.js"),d=require("./provider/index.vue.js"),e=c.default;e.FormItem=r.default;e.FormItemGroup=t.default;e.FormList=u.default;e.SearchForm=_.default;e.ModalForm=i.default;e.useWatch=l.useWatch;e.Dependency=p.default;e.Set=o.default;e.DrawerForm=n.default;e.ControlRender=a.default;e.ItemRender=s.default;e.Provider=d.default;exports.ApFormItem=r.default;exports.ApFormItemGroup=t.default;exports.ApFormList=u.default;exports.ApFormSearchForm=_.default;exports.ApFormModalForm=i.default;exports.ApFormDependency=p.default;exports.ApFormSet=o.default;exports.ApFormDrawerForm=n.default;exports.ApFormControlRender=a.default;exports.ApFormItemRender=s.default;exports.ApFormProvider=d.default;exports.ApForm=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("@aplus-frontend/antdv");require("../ap-form.vue.js");require("../item/index.vue2.js");require("../../hooks/index.js");const q=require("../item-group/helper.js"),X=require("@ant-design/icons-vue");require("../../config-provider/index.js");const B=require("lodash-unified"),E=require("../../utils/index.js"),N=require("./utils.js"),Y=require("../../hooks/useControllableValue.js"),Z=require("../../config-provider/hooks/use-namespace.js"),ee=require("../../config-provider/hooks/use-global-config.js"),te=require("../../config-provider/hooks/use-locale.js"),I=require("../item/index.vue.js"),ne=require("../ap-form.vue2.js");function oe(m){return typeof m=="function"||Object.prototype.toString.call(m)==="[object Object]"&&!e.isVNode(m)}const l=24,ae=e.defineComponent({name:"ApFormSearchForm",__name:"index",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onFieldsChange:{},onFinish:{},onFinishFailed:{},onValidate:{},initialValues:{},onValuesChange:{},syncToUrl:{type:[Boolean,Function]},syncToUrlPriority:{type:Boolean},collapse:{type:Boolean,default:void 0},defaultCollapse:{type:Boolean,default:!1},"onUpdate:collapse":{},searchText:{},resetText:{},onReset:{},customReset:{type:Boolean,default:!1},extraInAction:{type:Boolean,default:!1},forceExpand:{type:Boolean,default:!1},countPerRow:{default:4},submitLoading:{type:Boolean}},emits:["update:collapse"],setup(m,{expose:P,emit:T}){var R;const c=e.useSlots(),o=m,O=T,{value:i,updateValue:D}=Y.useControllableValue(o,O,{valuePropName:"collapse",defaultValuePropName:"defaultCollapse"}),{b:M}=Z.useNamespace("ap-form-search-form"),j=ee.useGlobalConfig("uiMode"),{t:F}=te.useLocale(),y=e.ref();function L(){D(!e.unref(i))}function U(){var t,n;(n=(t=y.value)==null?void 0:t.validateFields())==null||n.then(r=>N.execFunc(o.onSubmit,r))}function W(){var t,n;o.customReset||(n=(t=y.value)==null?void 0:t.resetFields)==null||n.call(t),N.execFunc(o.onReset)}let v=[];const _=e.shallowRef(q.genRealChildren(c.default())),p=e.shallowRef((R=c.extra)==null?void 0:R.call(c)),S=e.computed(()=>Math.floor(l/o.countPerRow));e.watch(()=>c.default(),t=>{v=_.value,_.value=N.diffFormItem(v,q.genRealChildren(t))}),e.watch(()=>{var t;return(t=c.extra)==null?void 0:t.call(c)},t=>{p.value=t});const $=t=>E.isDef(t)?(B.isArray(t)?t:[t]).join(""):Date.now(),g=e.computed(()=>{const t=_.value,n=[],r=[],a=e.unref(S);let s=0;t.forEach(d=>{const f=d.props;if(B.isBoolean(f.hidden)?!!f.hidden:E.isDef(f.hidden))n.push(d);else{const x=l-s%l,C=f.span||a;x>=C?s+=C:s+=C+x,r.push(d)}});const V=l-s%l;V<a&&(s+=V);const k=l-(s+a)%l,G=s%l<a,H=k<a?l:k,b=l-a*(e.unref(p)&&!o.extraInAction?2:1),J=!o.forceExpand&&s>b;let w=0,A=0;const K=r.map((d,f)=>{const h=d.props,x=h.span||a;if(w+=x,!o.forceExpand&&e.unref(i)&&w>b){n.push(e.cloneVNode(d,{
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("@aplus-frontend/antdv");require("../ap-form.vue.js");require("../item/index.vue2.js");require("../../hooks/index.js");const q=require("../item-group/helper.js"),X=require("@ant-design/icons-vue");require("../../config-provider/index.js");const B=require("lodash-unified"),E=require("../../utils/index.js"),N=require("./utils.js"),Y=require("../../hooks/useControllableValue.js"),Z=require("../../config-provider/hooks/use-namespace.js"),ee=require("../../config-provider/hooks/use-global-config.js"),te=require("../../config-provider/hooks/use-locale.js"),I=require("../item/index.vue.js"),ne=require("../ap-form.vue2.js");function oe(m){return typeof m=="function"||Object.prototype.toString.call(m)==="[object Object]"&&!e.isVNode(m)}const l=24,ae=e.defineComponent({name:"ApFormSearchForm",__name:"index",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onFieldsChange:{},onFinish:{},onFinishFailed:{},onValidate:{},initialValues:{},onValuesChange:{},syncToUrl:{type:[Boolean,Function]},syncToUrlPriority:{type:Boolean},collapse:{type:Boolean,default:void 0},defaultCollapse:{type:Boolean,default:!1},"onUpdate:collapse":{},searchText:{},resetText:{},onReset:{},customReset:{type:Boolean,default:!1},extraInAction:{type:Boolean,default:!1},forceExpand:{type:Boolean,default:!1},countPerRow:{default:4},submitLoading:{type:Boolean}},emits:["update:collapse"],setup(m,{expose:P,emit:T}){var R;const c=e.useSlots(),o=m,O=T,{value:i,updateValue:D}=Y.useControllableValue(o,O,{valuePropName:"collapse",defaultValuePropName:"defaultCollapse"}),{b:M}=Z.useNamespace("ap-form-search-form"),j=ee.useGlobalConfig("uiMode"),{t:F}=te.useLocale(),y=e.ref();function L(){D(!e.unref(i))}function U(){var t,n;(n=(t=y.value)==null?void 0:t.validateFields())==null||n.then(r=>N.execFunc(o.onSubmit,r))}function W(){var t,n;o.customReset||(n=(t=y.value)==null?void 0:t.resetFields)==null||n.call(t),N.execFunc(o.onReset)}let v=[];const _=e.shallowRef(q.genRealChildren(c.default())),p=e.shallowRef((R=c.extra)==null?void 0:R.call(c)),S=e.computed(()=>Math.floor(l/o.countPerRow));e.watch(()=>c.default(),t=>{v=_.value,_.value=N.diffFormItem(v,q.genRealChildren(t))}),e.watch(()=>{var t;return(t=c.extra)==null?void 0:t.call(c)},t=>{p.value=t});const $=t=>E.isDef(t)?(B.isArray(t)?t:[t]).join(""):Date.now(),g=e.computed(()=>{const t=_.value,n=[],r=[],a=e.unref(S);let s=0;t.forEach(d=>{const f=d.props;if(B.isBoolean(f.hidden)?!!f.hidden:E.isDef(f.hidden))n.push(d);else{const x=l-s%l,C=f.span||a;x>=C?s+=C:s+=C+x,r.push(d)}});const V=l-s%l;V<a&&(s+=V);const k=l-(s+a)%l,G=s%l<a,H=k<a?l:k,b=l-a*(e.unref(p)&&!o.extraInAction?2:1),J=!o.forceExpand&&s>b;let w=0,A=0;const K=r.map((d,f)=>{const h=d.props,x=h.span||a;if(w+=x,!o.forceExpand&&e.unref(i)&&w>b){n.push(e.cloneVNode(d,{hidden:!0}));return}return A+=x,{node:d,span:h.span||a,key:`ApFormSearchFormItem-${f}-${$(h.name)}-${h._signal}`}}).filter(Boolean),Q=l-A-a;return{hideNode:e.createVNode(e.Fragment,null,[n]),nodes:K,defaultExtraSpan:H,actualExtraSpan:Q,showCollapse:J,lastRowOnlyIncludeActionAndExtra:G}}),z=e.computed(()=>{let t;const n=e.unref(g),r=e.createVNode(u.Col,{span:e.unref(S),key:"actionWrapper"},{default:()=>[e.createVNode(I.default,null,{default:()=>[e.createVNode(u.Flex,{justify:!e.unref(i)&&n.lastRowOnlyIncludeActionAndExtra&&!(e.unref(p)&&o.extraInAction)?"flex-end":"space-between"},{default:()=>[e.createVNode(u.Space,null,{default:()=>[e.createVNode(u.Button,{type:"primary",onClick:U,loading:o.submitLoading,htmlType:"submit"},{default:()=>[o.searchText||F("ap.apForm.search.search")]}),e.createVNode(u.Button,{onClick:W},{default:()=>[o.resetText||F("ap.apForm.search.reset")]}),n.showCollapse?e.createVNode(u.Button,{onClick:L,icon:e.createVNode(X.DoubleRightOutlined,{style:j.value==="aplus"?"color:#B8C3D1":"color:#BFBFBF",rotate:e.unref(i)?90:-90},null)},null):null]}),o.extraInAction?e.unref(p):null]})]})]}),a=!o.extraInAction&&e.unref(p)?e.createVNode(u.Col,{span:e.unref(i)?n.actualExtraSpan:n.defaultExtraSpan,key:"extraNode"},{default:()=>[e.createVNode(I.default,null,{default:()=>[e.createVNode(u.Flex,{justify:!e.unref(i)&&(n.defaultExtraSpan===l||n.lastRowOnlyIncludeActionAndExtra)?"start":"flex-end"},oe(t=e.unref(p))?t:{default:()=>[t]})]})]}):null,s=e.createVNode(u.Col,{span:n.defaultExtraSpan},null);return!e.unref(i)&&n.lastRowOnlyIncludeActionAndExtra?e.createVNode(e.Fragment,null,[a||s,r]):e.createVNode(e.Fragment,null,[r,a])});return P({apForm:e.computed(()=>e.unref(y))}),(t,n)=>(e.openBlock(),e.createBlock(ne.default,e.mergeProps({ref_key:"apForm",ref:y,class:e.unref(M)()},e.unref(B.omit)(o,["collapse","defaultCollapse","onUpdate:collapse","searchText","resetText","onSubmit","onReset","extraInAction","forceExpand","countPerRow"])),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g.value.hideNode))),e.createVNode(e.unref(u.Row),{gutter:16},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value.nodes,r=>(e.openBlock(),e.createBlock(e.unref(u.Col),{key:r.key,span:r.span},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.node)))]),_:2},1032,["span"]))),128)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(z.value)))]),_:1})]),_:1},16,["class"]))}});exports.default=ae;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var o=(e=>(e.NOT_NEED_CLOSE="Info: [aplus-ui: ApModal.createModalStream] The modal does not need to be closed",e))(o||{});exports.ModalMessage=o;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Modal as _Modal } from '@aplus-frontend/antdv';
|
|
2
|
-
import { CreateModalFunc } from './interface';
|
|
2
|
+
import { CreateModalFunc, CreateModalStreamFunc } from './interface';
|
|
3
3
|
export * from './interface';
|
|
4
4
|
type ApModalMixedProps = typeof _Modal & {
|
|
5
5
|
createModal: CreateModalFunc;
|
|
6
|
+
createModalStream: CreateModalStreamFunc;
|
|
6
7
|
};
|
|
7
8
|
declare const ApModal: ApModalMixedProps;
|
|
8
9
|
export { ApModal };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@aplus-frontend/antdv");require("./utils/index.js");require("./interface.js");const r=require("./utils/createModal.js"),t=require("./utils/createModalStream.js"),e=a.Modal;e.createModal=r.createModal;e.createModalStream=t.createModalStream;e.name="ApModal";exports.ApModal=e;
|
|
@@ -1,16 +1,141 @@
|
|
|
1
|
-
import { ModalProps } from '@aplus-frontend/antdv';
|
|
1
|
+
import { ModalProps, ModalFuncProps } from '@aplus-frontend/antdv';
|
|
2
|
+
import { ModalFunc } from '@aplus-frontend/antdv/lib/modal/confirm';
|
|
2
3
|
export type CreateModalFuncProps<ContentRecord = any> = Omit<ModalProps, 'open' | 'onUpdate:open' | 'destroyOnClose' | 'onCancel' | 'onOk' | 'getContainer' | 'icon'> & Partial<{
|
|
4
|
+
/**
|
|
5
|
+
* 点击取消回调
|
|
6
|
+
* @param params content组件内使用defineExpose导出的对象
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
3
9
|
onCancel: (params: ContentRecord) => any | Promise<any>;
|
|
10
|
+
/**
|
|
11
|
+
* 点击确定回调
|
|
12
|
+
* @param params content组件内使用defineExpose导出的对象
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
4
15
|
onOk: (params: ContentRecord) => any | Promise<any>;
|
|
16
|
+
/**
|
|
17
|
+
* 指定弹框挂载的 HTML 节点
|
|
18
|
+
*/
|
|
5
19
|
getContainer: HTMLElement;
|
|
20
|
+
/**
|
|
21
|
+
* 内容
|
|
22
|
+
*/
|
|
6
23
|
content: any;
|
|
24
|
+
/**
|
|
25
|
+
* 关闭时是否销毁弹框
|
|
26
|
+
*/
|
|
7
27
|
destroyOnClose: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 自适应高度
|
|
30
|
+
*/
|
|
8
31
|
wrapperOffset: boolean | number;
|
|
9
32
|
}>;
|
|
10
33
|
export type CreateModalFuncReturn = {
|
|
34
|
+
/**
|
|
35
|
+
* 销毁弹框
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
11
38
|
destroy: () => void;
|
|
39
|
+
/**
|
|
40
|
+
* 更新弹框 props 属性
|
|
41
|
+
* @param newConfig
|
|
42
|
+
* @returns
|
|
43
|
+
*/
|
|
12
44
|
update: (newConfig: CreateModalFuncProps) => void;
|
|
45
|
+
/**
|
|
46
|
+
* 打开弹框
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
13
49
|
open: () => void;
|
|
50
|
+
/**
|
|
51
|
+
* 关闭弹框,不销毁
|
|
52
|
+
* @returns
|
|
53
|
+
*/
|
|
14
54
|
close: () => void;
|
|
15
55
|
};
|
|
16
56
|
export type CreateModalFunc = (props: CreateModalFuncProps) => CreateModalFuncReturn;
|
|
57
|
+
export type ModalStreamNextFunc<ModalType extends ModalStreamTypeKey = ModalStreamTypeKey> = (option: {
|
|
58
|
+
/**
|
|
59
|
+
* 下一步弹框的id
|
|
60
|
+
*/
|
|
61
|
+
modalId?: string;
|
|
62
|
+
/**
|
|
63
|
+
* 下一步弹框传递的参数
|
|
64
|
+
*/
|
|
65
|
+
params?: any;
|
|
66
|
+
/**
|
|
67
|
+
* 本次弹框关闭前的回调,createModal默认关闭弹框,其他弹框类型默认销毁弹框,调用弹框实例的open方法可以不关闭弹框
|
|
68
|
+
*/
|
|
69
|
+
handleCurrentModal?: (
|
|
70
|
+
/**
|
|
71
|
+
* 本次弹框的实例方法
|
|
72
|
+
*/
|
|
73
|
+
modalExample: ModalStreamTypeExample[ModalType]) => any | Promise<any>;
|
|
74
|
+
}) => any | Promise<any>;
|
|
75
|
+
export type ModalStreamType = {
|
|
76
|
+
createModal: CreateModalStream<'createModal'>;
|
|
77
|
+
info: ModalFuncStream<'info'>;
|
|
78
|
+
success: ModalFuncStream<'success'>;
|
|
79
|
+
error: ModalFuncStream<'error'>;
|
|
80
|
+
warning: ModalFuncStream<'warning'>;
|
|
81
|
+
confirm: ModalFuncStream<'confirm'>;
|
|
82
|
+
};
|
|
83
|
+
export type ModalStreamFuncReturn = ReturnType<ModalFunc> & {
|
|
84
|
+
open: () => void;
|
|
85
|
+
};
|
|
86
|
+
export type ModalStreamTypeExample = {
|
|
87
|
+
createModal: CreateModalFuncReturn;
|
|
88
|
+
info: ModalStreamFuncReturn;
|
|
89
|
+
success: ModalStreamFuncReturn;
|
|
90
|
+
error: ModalStreamFuncReturn;
|
|
91
|
+
warning: ModalStreamFuncReturn;
|
|
92
|
+
confirm: ModalStreamFuncReturn;
|
|
93
|
+
};
|
|
94
|
+
export type ModalFuncStream<ModalType extends ModalStreamTypeKey = ModalStreamTypeKey> = Omit<ModalFuncProps, 'onOk' | 'onCancel'> & {
|
|
95
|
+
/**
|
|
96
|
+
* 点击确定回调
|
|
97
|
+
* @param next 下一步
|
|
98
|
+
* @returns
|
|
99
|
+
*/
|
|
100
|
+
onOk?: (next: ModalStreamNextFunc<ModalType>) => any | Promise<any>;
|
|
101
|
+
/**
|
|
102
|
+
* 点击取消回调
|
|
103
|
+
* @param next 下一步
|
|
104
|
+
* @returns
|
|
105
|
+
*/
|
|
106
|
+
onCancel?: (next: ModalStreamNextFunc<ModalType>) => any | Promise<any>;
|
|
107
|
+
};
|
|
108
|
+
export type CreateModalStream<ModalType extends ModalStreamTypeKey = ModalStreamTypeKey> = Omit<CreateModalFuncProps, 'destroyOnClose' | 'onOk' | 'onCancel'> & {
|
|
109
|
+
/**
|
|
110
|
+
* 点击确定回调
|
|
111
|
+
* * @param params content组件内使用defineExpose导出的对象
|
|
112
|
+
* @param next 下一步
|
|
113
|
+
* @returns
|
|
114
|
+
*/
|
|
115
|
+
onOk?: (params: any, next: ModalStreamNextFunc<ModalType>) => any | Promise<any>;
|
|
116
|
+
/**
|
|
117
|
+
* 点击取消回调
|
|
118
|
+
* * @param params content组件内使用defineExpose导出的对象
|
|
119
|
+
* @param next 下一步
|
|
120
|
+
* @returns
|
|
121
|
+
*/
|
|
122
|
+
onCancel?: (params: any, next: ModalStreamNextFunc<ModalType>) => any | Promise<any>;
|
|
123
|
+
};
|
|
124
|
+
export type ModalStreamTypeKey = keyof ModalStreamType;
|
|
125
|
+
export type CreateModalStreamProps<ModalType extends ModalStreamTypeKey = ModalStreamTypeKey> = ModalType extends ModalStreamTypeKey ? {
|
|
126
|
+
/**
|
|
127
|
+
* 弹框id
|
|
128
|
+
*/
|
|
129
|
+
modalId: string;
|
|
130
|
+
/**
|
|
131
|
+
* 弹框类型
|
|
132
|
+
*/
|
|
133
|
+
modalType?: ModalType;
|
|
134
|
+
/**
|
|
135
|
+
* 弹框属性
|
|
136
|
+
* @param params 上一步弹框传递的参数
|
|
137
|
+
* @returns
|
|
138
|
+
*/
|
|
139
|
+
props: (params: any) => Promise<ModalStreamType[ModalType]>;
|
|
140
|
+
} : never;
|
|
141
|
+
export type CreateModalStreamFunc<ModalType extends ModalStreamTypeKey = ModalStreamTypeKey> = (streamList: CreateModalStreamProps<ModalType>[], firstModalId?: string) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("@aplus-frontend/utils"),z=require("./createModal.js"),P=require("@aplus-frontend/antdv"),m=require("../enums/modalMessage.js"),j=(N,M)=>{var k;const I=M??(Array.isArray(N)?(k=N[0])==null?void 0:k.modalId:void 0),w=new Map;let y,S,l=1e3;const C=async({modalId:i,params:f,handleCurrentModal:t})=>{y=f;const d=N.find(s=>s.modalId===i);let n=!1;if(S){const s=w.get(S),o={...s,destroy:()=>{var a;(a=s==null?void 0:s.destroy)==null||a.call(s),w.delete(S)},open:()=>{n=!0}};await(t==null?void 0:t(o))}return d&&setTimeout(()=>{T(d)}),n},g=()=>{var i;for(const[f,t]of w)(i=t==null?void 0:t.destroy)==null||i.call(t)},T=async i=>{var q,D,_,A;const{modalId:f,modalType:t="createModal",props:d}=i;S=f;const n=w.get(f),s=await(d==null?void 0:d(y));l=Math.max((s==null?void 0:s.zIndex)??0,l),l+=1;let o,a=!1;if(t==="createModal"){const e=s,u=async r=>(a=!0,await C(r));o={...e,destroyOnClose:!1,zIndex:l,onOk:async r=>{var E;const c=await((E=e==null?void 0:e.onOk)==null?void 0:E.call(e,r,u));if(a||g(),c)throw new Error(m.ModalMessage.NOT_NEED_CLOSE)},onCancel:async r=>{var E;const c=await((E=e==null?void 0:e.onCancel)==null?void 0:E.call(e,r,u));if(a||g(),c)throw new Error(m.ModalMessage.NOT_NEED_CLOSE)}}}else{const e=s,u=async r=>(a=!0,await C(r));o={...e,zIndex:l,onOk:async()=>{var c;const r=await((c=e==null?void 0:e.onOk)==null?void 0:c.call(e,u));if(a||g(),r)throw new Error(m.ModalMessage.NOT_NEED_CLOSE)},onCancel:async()=>{var c;const r=await((c=e==null?void 0:e.onCancel)==null?void 0:c.call(e,u));if(a||g(),r)throw new Error(m.ModalMessage.NOT_NEED_CLOSE)}}}if(n){n==null||n.update(o),(q=n==null?void 0:n.open)==null||q.call(n);return}else if(t==="createModal"){const e=z.createModal(o);(D=e==null?void 0:e.open)==null||D.call(e),w.set(f,e)}else(A=(_=P.Modal)==null?void 0:_[t])==null||A.call(_,o)},O=N.find(i=>b.isValid(I)&&i.modalId===I);O!==void 0&&T(O)};exports.createModalStream=j;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./createModal.js");exports.createModal=e.createModal;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./createModal.js"),a=require("./createModalStream.js");exports.createModal=e.createModal;exports.createModalStream=a.createModalStream;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=e.defineComponent({name:"ApTableDynamicComponent",inheritAttrs:!1,__name:"index",props:{customRender:{type:Function}},setup(o){return(n,r)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.customRender(n.$attrs))))}});exports.default=t;
|
|
@@ -1010,10 +1010,7 @@ export declare function getSearchFormItemRenderNode(item: any, extraRenderMap?:
|
|
|
1010
1010
|
};
|
|
1011
1011
|
parser: {
|
|
1012
1012
|
type: PropType<(displayValue: string) => ValueType>;
|
|
1013
|
-
default: (displayValue: string) =>
|
|
1014
|
-
* 通常情况下,表格渲染是不需要请求网络数据的,因此这里删掉request,
|
|
1015
|
-
* 如果需要做映射,可以在外部发起一次网络请求,然后使用valueEnum设置匹配枚举。
|
|
1016
|
-
*/).ValueType;
|
|
1013
|
+
default: (displayValue: string) => ValueType;
|
|
1017
1014
|
};
|
|
1018
1015
|
formatter: {
|
|
1019
1016
|
type: PropType<(value: ValueType, info: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),u=require("lodash-unified"),p=require("./constants.js"),g=require("@fruits-chain/utils");require("../ap-form/index.js");const h=require("@aplus-frontend/antdv"),j=require("@ant-design/icons-vue");require("./components/dynamic-component/index.vue.js");const f=require("./components/dynamic-component/index.vue2.js"),O=require("../ap-form/item/index.vue.js");function E(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!l.isVNode(e)}const m=(e,t,n)=>{let o={};return u.isObject(e)?Object.keys(e).forEach(i=>{u.isObject(e[i])?o[i]=m(e[i],t[i],n):o[i]=n(e[i],t)}):o=n(e,t),o},N=(e,t)=>{switch(e){case"dayjs":return t.valueOf();case"dayjsRange":return t.map(n=>n.valueOf());case"dayjsDayRange":{const[n,o]=t;return[n.startOf("day").valueOf(),o.endOf("day").valueOf()]}case"multiple":case"multipleNumber":return u.isArray(t)?t:[t];case"boolean":return t;case"object":return t;default:return t}};function C(e){return u.isArray(e)?e.join("."):e}function F(e){const t=Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase();return t==="string"&&typeof e=="object"?"object":e===null?"null":e===void 0?"undefined":t}const y=e=>F(e)==="map"?e:new Map(Object.entries(e||{})),a=e=>{const t=[],n=y(e);return n.forEach((o,i)=>{const r=n.get(i)||n.get(`${i}`);if(r){if(typeof r=="object"&&(r!=null&&r.text)){t.push({text:r==null?void 0:r.text,value:i,label:r==null?void 0:r.text,disabled:r.disabled});return}t.push({text:r,label:r,value:i})}}),t},_=e=>u.isUndefined(e)||e<0?0:e;function T(e,t){return!e||!u.isFunction(e)?e:e(t)}function v(e){let t=e.valueType||"text";return e.valueEnum&&(t="status"),t}function S(e,t,n,o){var s;const i=p.apTableRenderItemMap[e];if(i)return l.createVNode(i,l.mergeProps(t,{mode:"read"}),null);const r=o==null?void 0:o[e];return((s=r==null?void 0:r.render)==null?void 0:s.call(r,t.value,n,t))||t.value}function V(e,t){if(e.customRenderFormItem){let r=function(s){const c=s.item.customRenderFormItem(s.item);return l.cloneVNode(c,{...s.item.fieldProps,span:s.item.span,...c.props||{},hidden:s.hidden,class:s.class})};return{Comp:f.default,render:r}}const n=p.apTableFormItemMap[e.valueType];if(n)return{Comp:n};const o=t==null?void 0:t[e.valueType];function i(r){var c;const s=(c=o==null?void 0:o.renderFormItem)==null?void 0:c.call(o,r.item.fieldProps.field);return s?l.createVNode(O.default,l.mergeProps(r.item.fieldProps,{hidden:r.hidden,class:r.class,span:e.span}),E(s)?s:{default:()=>[s]}):null}return{Comp:f.default,render:i}}function q(e,t){const n=T(e.fieldProps,t),o=(n==null?void 0:n.field)||n||{},i=e.valueType==="switch",r=e.valueType==="index",s=i?{checked:t.value}:{value:r?t.index+1:t.value};return e.valueEnum&&(o.valueEnum=e.valueEnum),{...u.omit(o,["request"]),...s}}function P(e){const t={...e};return u.isBoolean(e.filters)&&e.filters&&e.valueEnum&&(t.filters=a(e.valueEnum)),t}function I(e,t){var o;const n=t||{};return e.valueEnum&&!((o=n.field)!=null&&o.options)&&(n.field={...n.field,options:a(e.valueEnum)}),n}function A(e){if(!g.isType("Object")(e))return e;try{return JSON.stringify(e)}catch{return e}}function x(e,t,n,o){const i=n==null?void 0:n({title:e.title,column:e}),r=(i==null?void 0:i.filter(b=>b.type!==Symbol.for("v-cmt")))||[];if(i&&r.length>0)return i;const c=u.isString(e.title)?l.createVNode("span",{class:t,title:e.title},[e.title]):e.title,d=e.tooltip?u.isFunction(e.tooltip)?e.tooltip(e):l.createVNode(l.Fragment,null,[e.tooltip]):null;return d?l.createVNode("span",{style:{display:"inline-flex",alignItems:"center",maxWidth:"100%"}},[c,l.createVNode(h.Tooltip,{title:d,placement:"bottom"},{default:()=>[l.createVNode(j.QuestionCircleOutlined,{style:{padding:"4px",color:o,verticalAlign:"middle"}},null)]})]):c}function R(e,t){const n=[];function o(i){var r;for(const s of i)(r=s.children)!=null&&r.length?o(s.children):n.push(t(s))}return o(e),n}function w(e,t){if(u.isArray(e)&&u.isArray(t))return u.isEqual(u.sortBy(e),u.sortBy(t));if(u.isPlainObject(e)&&u.isPlainObject(t)){const n=o=>u.every(o,i=>i==null)||u.isEmpty(o);if(n(e)&&n(t))return!0}}function U(e){if(e!==!1)return e}exports.apColumnToColumn=P;exports.dataIndexToStr=C;exports.falseToUndefined=U;exports.formatParamsValueType=m;exports.getColumnOrder=_;exports.getFieldProps=T;exports.getSearchFormItemRenderNode=V;exports.getTableCellRenderNode=S;exports.getTableRenderProps=q;exports.getTableRenderType=v;exports.getTableTitle=x;exports.isEqualCustom=w;exports.objectToMap=y;exports.objectToString=A;exports.parseFieldValue=N;exports.recursionApColumns=R;exports.updateFormProps=I;exports.valueEnumToArray=a;
|