@aplus-frontend/ui 0.1.34 → 0.1.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/index.mjs +128 -126
- package/es/src/ap-button/ap-action-button.vue.d.ts +5 -0
- package/es/src/ap-button/ap-action-button.vue.mjs +8 -8
- package/es/src/ap-form/ap-form.vue2.mjs +93 -93
- package/es/src/ap-form/index.d.ts +3 -1
- package/es/src/ap-form/index.mjs +5 -1
- package/es/src/ap-form/interface.d.ts +4 -0
- package/es/src/ap-form/set/index.vue.d.ts +43 -0
- package/es/src/ap-form/set/index.vue.mjs +35 -0
- package/es/src/ap-form/set/index.vue2.mjs +4 -0
- package/es/src/ap-table/ap-table.vue.d.ts +1 -0
- package/es/src/ap-table/ap-table.vue.mjs +109 -107
- package/es/src/ap-table/components/setting/utils.d.ts +1 -1
- package/es/src/ap-table/components/setting/utils.mjs +12 -21
- package/es/src/ap-table/components/style/setting/modal.css +15 -3
- package/es/src/ap-table/interface.d.ts +5 -0
- package/es/src/ap-table/utils.mjs +6 -5
- package/es/src/ap-upload/apUpload.vue.d.ts +2 -0
- package/es/src/ap-upload/apUpload.vue.mjs +42 -39
- package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -1
- package/es/src/business/ap-table-modal/hooks/use-create-table-modal.mjs +11 -11
- package/es/src/business/hooks/usePageListApTable.d.ts +1 -0
- package/es/src/editable-table/form-item.vue.mjs +76 -97
- package/es/src/editable-table/hooks/use-get-columns.mjs +41 -35
- package/es/src/editable-table/index.vue.mjs +79 -100
- package/es/src/editable-table/style/index.css +12 -0
- package/es/src/editable-table/utils.d.ts +8 -1
- package/es/src/editable-table/utils.mjs +103 -69
- package/es/src/index.mjs +105 -103
- package/es/src/theme/ap-table/setting/modal.css +15 -3
- package/es/src/theme/editable-table/index.css +12 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-button/ap-action-button.vue.d.ts +5 -0
- package/lib/src/ap-button/ap-action-button.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/index.d.ts +3 -1
- package/lib/src/ap-form/index.js +1 -1
- package/lib/src/ap-form/interface.d.ts +4 -0
- package/lib/src/ap-form/set/index.vue.d.ts +43 -0
- package/lib/src/ap-form/set/index.vue.js +1 -0
- package/lib/src/ap-form/set/index.vue2.js +1 -0
- package/lib/src/ap-table/ap-table.vue.d.ts +1 -0
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/components/setting/utils.d.ts +1 -1
- package/lib/src/ap-table/components/setting/utils.js +1 -1
- package/lib/src/ap-table/components/style/setting/modal.css +15 -3
- package/lib/src/ap-table/interface.d.ts +5 -0
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/ap-upload/apUpload.vue.d.ts +2 -0
- package/lib/src/ap-upload/apUpload.vue.js +1 -1
- package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -1
- package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.js +1 -1
- package/lib/src/business/hooks/usePageListApTable.d.ts +1 -0
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/editable-table/style/index.css +12 -0
- package/lib/src/editable-table/utils.d.ts +8 -1
- package/lib/src/editable-table/utils.js +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/theme/ap-table/setting/modal.css +15 -3
- package/lib/src/theme/editable-table/index.css +12 -0
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isVNode as m, createVNode as u, mergeProps as f, cloneVNode as T, Fragment as b } from "vue";
|
|
2
|
-
import { isObject as c, isArray as p, isUndefined as
|
|
2
|
+
import { isObject as c, isArray as p, isUndefined as h, isFunction as y, omit as g, isBoolean as j, isString as a } from "lodash-unified";
|
|
3
3
|
import { apTableRenderItemMap as F, apTableFormItemMap as O } from "./constants.mjs";
|
|
4
4
|
import { isType as E } from "@fruits-chain/utils";
|
|
5
5
|
import "../ap-form/index.mjs";
|
|
@@ -63,7 +63,7 @@ const V = (t) => P(t) === "map" ? t : new Map(Object.entries(t || {})), d = (t)
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
}), e;
|
|
66
|
-
}, L = (t) =>
|
|
66
|
+
}, L = (t) => h(t) || t < 0 ? 0 : t, Q = (t, e, n) => {
|
|
67
67
|
if (n)
|
|
68
68
|
return n;
|
|
69
69
|
const r = ["select", "date"], o = ["text", "textArea", "number"];
|
|
@@ -75,7 +75,7 @@ const V = (t) => P(t) === "map" ? t : new Map(Object.entries(t || {})), d = (t)
|
|
|
75
75
|
return t("ap.common.inputText");
|
|
76
76
|
};
|
|
77
77
|
function w(t, e) {
|
|
78
|
-
return !t || !
|
|
78
|
+
return !t || !y(t) ? t : t(e);
|
|
79
79
|
}
|
|
80
80
|
function U(t) {
|
|
81
81
|
let e = t.valueType || "text";
|
|
@@ -122,7 +122,7 @@ function K(t, e) {
|
|
|
122
122
|
value: i ? e.index + 1 : e.value
|
|
123
123
|
};
|
|
124
124
|
return t.valueEnum && (r.valueEnum = t.valueEnum), {
|
|
125
|
-
...
|
|
125
|
+
...g(r, ["request"]),
|
|
126
126
|
...s
|
|
127
127
|
};
|
|
128
128
|
}
|
|
@@ -163,7 +163,8 @@ function k(t, e, n, r) {
|
|
|
163
163
|
return l ? u("span", {
|
|
164
164
|
style: {
|
|
165
165
|
display: "inline-flex",
|
|
166
|
-
alignItems: "center"
|
|
166
|
+
alignItems: "center",
|
|
167
|
+
maxWidth: "100%"
|
|
167
168
|
}
|
|
168
169
|
}, [s, u(x, {
|
|
169
170
|
title: l,
|
|
@@ -43,6 +43,7 @@ declare const _default: DefineComponent<{
|
|
|
43
43
|
getOssAccess: {
|
|
44
44
|
type: PropType<GetOssAccess>;
|
|
45
45
|
};
|
|
46
|
+
onChange: FunctionConstructor;
|
|
46
47
|
}, {
|
|
47
48
|
done: ComputedRef<boolean>;
|
|
48
49
|
clear: typeof clear;
|
|
@@ -89,6 +90,7 @@ declare const _default: DefineComponent<{
|
|
|
89
90
|
getOssAccess: {
|
|
90
91
|
type: PropType<GetOssAccess>;
|
|
91
92
|
};
|
|
93
|
+
onChange: FunctionConstructor;
|
|
92
94
|
}>> & {
|
|
93
95
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
94
96
|
}, {
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as U, computed as d, provide as t, ref as f, openBlock as g, createElementBlock as j, normalizeClass as T, unref as z, createBlock as k, resolveDynamicComponent as B, normalizeProps as $, mergeProps as q, createCommentVNode as L } from "vue";
|
|
2
2
|
import "../config-provider/index.mjs";
|
|
3
3
|
import "./components/SingleFile.vue.mjs";
|
|
4
4
|
import "./components/MultipleFile.vue.mjs";
|
|
5
5
|
import "./components/Picture.vue.mjs";
|
|
6
6
|
import "./styles/upload.css";
|
|
7
|
-
import { injectLocaleToAccept as
|
|
8
|
-
import { injectLocaleToOss as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
|
|
7
|
+
import { injectLocaleToAccept as R } from "./utils/accept.mjs";
|
|
8
|
+
import { injectLocaleToOss as M } from "./hooks/useOss.mjs";
|
|
9
|
+
import { Form as P } from "ant-design-vue";
|
|
10
|
+
import { useLocale as w } from "../config-provider/hooks/use-locale.mjs";
|
|
11
|
+
import { useNamespace as D } from "../config-provider/hooks/use-namespace.mjs";
|
|
12
|
+
import E from "./components/SingleFile.vue2.mjs";
|
|
13
|
+
import G from "./components/MultipleFile.vue2.mjs";
|
|
14
|
+
import I from "./components/Picture.vue2.mjs";
|
|
15
|
+
import { useGlobalConfig as v } from "../config-provider/hooks/use-global-config.mjs";
|
|
16
|
+
const me = /* @__PURE__ */ U({
|
|
16
17
|
name: "AplusFileUpload",
|
|
17
18
|
__name: "apUpload",
|
|
18
19
|
props: {
|
|
@@ -55,50 +56,52 @@ const ae = /* @__PURE__ */ F({
|
|
|
55
56
|
},
|
|
56
57
|
getOssAccess: {
|
|
57
58
|
type: Function
|
|
58
|
-
}
|
|
59
|
+
},
|
|
60
|
+
onChange: Function
|
|
59
61
|
},
|
|
60
62
|
emits: ["update:value"],
|
|
61
|
-
setup(
|
|
62
|
-
var
|
|
63
|
-
const { t:
|
|
64
|
-
|
|
65
|
-
const { b:
|
|
66
|
-
singleFile:
|
|
67
|
-
multipleFile:
|
|
68
|
-
picture:
|
|
69
|
-
},
|
|
63
|
+
setup(y, { expose: C, emit: b }) {
|
|
64
|
+
var c, l, p, u;
|
|
65
|
+
const { t: r, lang: N } = w();
|
|
66
|
+
R(r), M(r, N);
|
|
67
|
+
const { b: _ } = D("ap-upload"), e = y, F = b, S = {
|
|
68
|
+
singleFile: E,
|
|
69
|
+
multipleFile: G,
|
|
70
|
+
picture: I
|
|
71
|
+
}, n = P.useInjectFormItemContext(), x = d({
|
|
70
72
|
get() {
|
|
71
|
-
return
|
|
73
|
+
return e.value;
|
|
72
74
|
},
|
|
73
|
-
set(
|
|
74
|
-
|
|
75
|
+
set(a) {
|
|
76
|
+
var m;
|
|
77
|
+
F("update:value", a), n == null || n.onFieldChange(), (m = e.onChange) == null || m.call(e, a);
|
|
75
78
|
}
|
|
76
|
-
}),
|
|
77
|
-
|
|
79
|
+
}), O = v("uiMode"), o = v("apUpload");
|
|
80
|
+
t("theme", O.value), t("value", x), t("dirName", e.dirName ?? ((c = o.value) == null ? void 0 : c.dirName)), t(
|
|
78
81
|
"needName",
|
|
79
|
-
|
|
80
|
-
),
|
|
82
|
+
e.needName ?? ((l = o.value) == null ? void 0 : l.needName) ?? !1
|
|
83
|
+
), t("accept", e.accept ?? ((p = o.value) == null ? void 0 : p.accept) ?? ""), t("maxSize", e.maxSize), t("title", e.title), t("subTitle", e.subTitle), t("maxCount", e.maxCount), t("beforeUpload", e.beforeUpload), t("customRequest", e.customRequest), t(
|
|
81
84
|
"getOssAccess",
|
|
82
|
-
|
|
85
|
+
e.getOssAccess ?? ((u = o.value) == null ? void 0 : u.getOssAccess)
|
|
83
86
|
);
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
+
const h = d(() => s.value === 0), s = f(0);
|
|
88
|
+
t("uploadingCount", s);
|
|
89
|
+
const i = f(!0);
|
|
87
90
|
function A() {
|
|
88
|
-
|
|
89
|
-
|
|
91
|
+
i.value = !1, setTimeout(() => {
|
|
92
|
+
i.value = !0;
|
|
90
93
|
});
|
|
91
94
|
}
|
|
92
|
-
return
|
|
93
|
-
done:
|
|
95
|
+
return C({
|
|
96
|
+
done: h,
|
|
94
97
|
clear: A
|
|
95
|
-
}), (
|
|
96
|
-
class: T(
|
|
98
|
+
}), (a, m) => (g(), j("div", {
|
|
99
|
+
class: T(z(_)())
|
|
97
100
|
}, [
|
|
98
|
-
|
|
101
|
+
i.value ? (g(), k(B(S[e.type]), $(q({ key: 0 }, a.$attrs)), null, 16)) : L("", !0)
|
|
99
102
|
], 2));
|
|
100
103
|
}
|
|
101
104
|
});
|
|
102
105
|
export {
|
|
103
|
-
|
|
106
|
+
me as default
|
|
104
107
|
};
|
|
@@ -3,5 +3,5 @@ export declare function useCreateTableModal(props: UseCreateTableModalProps): {
|
|
|
3
3
|
readonly openModal: <T>(selected?: any[], options?: OpenOptions) => Promise< OpenReturnType<T> | undefined>;
|
|
4
4
|
readonly closeModal: () => void;
|
|
5
5
|
readonly destroy: () => void;
|
|
6
|
-
readonly isDestroyed:
|
|
6
|
+
readonly isDestroyed: true;
|
|
7
7
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ref as v, defineComponent as C, h as r, render as
|
|
1
|
+
import { ref as v, defineComponent as C, h as r, render as a, onUnmounted as y } from "vue";
|
|
2
2
|
import "../table-modal.vue.mjs";
|
|
3
3
|
import "../../../index.mjs";
|
|
4
4
|
import { omit as h } from "lodash-unified";
|
|
5
5
|
import { ConfigProvider as M, globalConfigCached as b } from "../../../config-provider/config-provider.mjs";
|
|
6
6
|
import g from "../table-modal.vue2.mjs";
|
|
7
7
|
function E(d) {
|
|
8
|
-
let o = !
|
|
9
|
-
const
|
|
8
|
+
let o = !0;
|
|
9
|
+
const i = document.body, t = v(), { destroyOnUnmounted: s = !0 } = d, n = document.createElement("div"), u = () => {
|
|
10
10
|
const e = C({
|
|
11
11
|
setup() {
|
|
12
12
|
return () => r(
|
|
@@ -19,22 +19,22 @@ function E(d) {
|
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
|
|
23
|
-
},
|
|
22
|
+
i.appendChild(n), a(r(e), n), o = !1;
|
|
23
|
+
}, l = () => {
|
|
24
24
|
var e;
|
|
25
25
|
(e = t.value) == null || e.close(), o || setTimeout(() => {
|
|
26
|
-
|
|
26
|
+
a(null, n), i.removeChild(n), o = !0;
|
|
27
27
|
}, 400);
|
|
28
|
-
},
|
|
29
|
-
var
|
|
30
|
-
return t.value ||
|
|
28
|
+
}, c = async (e = [], p = {}) => {
|
|
29
|
+
var m;
|
|
30
|
+
return t.value || u(), (m = t.value) == null ? void 0 : m.open(e, p);
|
|
31
31
|
}, f = () => {
|
|
32
32
|
var e;
|
|
33
33
|
o || (e = t.value) == null || e.close();
|
|
34
34
|
};
|
|
35
35
|
return y(() => {
|
|
36
|
-
s &&
|
|
37
|
-
}), { openModal:
|
|
36
|
+
s && l();
|
|
37
|
+
}), { openModal: c, closeModal: f, destroy: l, isDestroyed: o };
|
|
38
38
|
}
|
|
39
39
|
export {
|
|
40
40
|
E as useCreateTableModal
|
|
@@ -34,6 +34,7 @@ export declare function usePageListApTable(props?: UsePageListApTable): [ApTable
|
|
|
34
34
|
getApTableInstance: () => {
|
|
35
35
|
submit: () => void;
|
|
36
36
|
reset: () => void;
|
|
37
|
+
refresh: () => void;
|
|
37
38
|
setSearchFormValues: (fields: Partial< Recordable>) => void;
|
|
38
39
|
getSearchFormValues: () => Partial< Recordable>;
|
|
39
40
|
dataSource: any;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Table as
|
|
3
|
-
import { ApForm as
|
|
4
|
-
import { isArray as
|
|
1
|
+
import { defineComponent as P, ref as h, unref as l, useSlots as z, watch as O, openBlock as K, createBlock as M, mergeProps as x, withCtx as g, createVNode as G, createSlots as H, renderList as W, renderSlot as $, normalizeProps as U, guardReactiveProps as q } from "vue";
|
|
2
|
+
import { Table as J } from "ant-design-vue";
|
|
3
|
+
import { ApForm as b } from "../ap-form/index.mjs";
|
|
4
|
+
import { isArray as Q, isNumber as d, cloneDeep as f, omit as w } from "lodash-unified";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
|
-
import { useInjectForm as
|
|
6
|
+
import { useInjectForm as X } from "../ap-form/context.mjs";
|
|
7
7
|
import "./style/index.css";
|
|
8
|
-
import { isDef as
|
|
9
|
-
import
|
|
10
|
-
import { scrollToRowIndex as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
import { useGlobalConfig as fe } from "../config-provider/hooks/use-global-config.mjs";
|
|
15
|
-
const Fe = /* @__PURE__ */ q({
|
|
8
|
+
import { isDef as m } from "../utils/index.mjs";
|
|
9
|
+
import Y from "./hooks/use-get-columns.mjs";
|
|
10
|
+
import { scrollToRowIndex as Z } from "./utils.mjs";
|
|
11
|
+
import { useNamespace as I } from "../config-provider/hooks/use-namespace.mjs";
|
|
12
|
+
import { useGlobalConfig as ee } from "../config-provider/hooks/use-global-config.mjs";
|
|
13
|
+
const ce = /* @__PURE__ */ P({
|
|
16
14
|
name: "EditableTableInner",
|
|
17
15
|
__name: "form-item",
|
|
18
16
|
props: {
|
|
@@ -112,121 +110,102 @@ const Fe = /* @__PURE__ */ q({
|
|
|
112
110
|
default: () => ({})
|
|
113
111
|
}
|
|
114
112
|
},
|
|
115
|
-
setup(
|
|
116
|
-
expose:
|
|
113
|
+
setup(C, {
|
|
114
|
+
expose: y
|
|
117
115
|
}) {
|
|
118
|
-
const
|
|
119
|
-
function
|
|
120
|
-
return
|
|
116
|
+
const a = C;
|
|
117
|
+
function R(e, o) {
|
|
118
|
+
return Q(o) ? o.reduce((r, t) => r == null ? void 0 : r[t], e) : e == null ? void 0 : e[o];
|
|
121
119
|
}
|
|
122
120
|
const {
|
|
123
|
-
internalInstance:
|
|
124
|
-
model:
|
|
125
|
-
} =
|
|
126
|
-
|
|
127
|
-
var
|
|
128
|
-
u.value = e, (
|
|
121
|
+
internalInstance: n,
|
|
122
|
+
model: B
|
|
123
|
+
} = X(), u = h(R(l(B), a.name) || []), D = z(), F = b.useWatch(a.name);
|
|
124
|
+
O(() => F.value, (e) => {
|
|
125
|
+
var o;
|
|
126
|
+
u.value = e, (o = a.onChange) == null || o.call(a, e);
|
|
129
127
|
}, {
|
|
130
128
|
deep: !0
|
|
131
129
|
});
|
|
132
130
|
const {
|
|
133
|
-
b:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
function v(e, t) {
|
|
131
|
+
b: L
|
|
132
|
+
} = I("editable-table"), i = h(), T = ee("valueTypeMap"), v = Y(a, T);
|
|
133
|
+
function E(e, o) {
|
|
137
134
|
var s;
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
135
|
+
const r = ((s = l(u)) == null ? void 0 : s.length) || 0;
|
|
136
|
+
if (m(a.maxLength) && r >= a.maxLength)
|
|
140
137
|
return;
|
|
141
|
-
const
|
|
142
|
-
|
|
138
|
+
const t = [...l(u) || []];
|
|
139
|
+
m(o) ? t.splice(o, 0, {
|
|
143
140
|
...e || {}
|
|
144
|
-
}) :
|
|
141
|
+
}) : t.push({
|
|
145
142
|
...e || {}
|
|
146
|
-
}),
|
|
143
|
+
}), n == null || n.setFieldValue(a.name, t);
|
|
147
144
|
}
|
|
148
|
-
function
|
|
149
|
-
var
|
|
150
|
-
const
|
|
151
|
-
if (
|
|
145
|
+
function N(e, o = "suffix") {
|
|
146
|
+
var p;
|
|
147
|
+
const r = ((p = l(u)) == null ? void 0 : p.length) || 0, t = d(e) ? e : e.length;
|
|
148
|
+
if (m(a.maxLength) && r + t > a.maxLength)
|
|
152
149
|
return;
|
|
153
|
-
const s = [...l(u) || []],
|
|
154
|
-
|
|
150
|
+
const s = [...l(u) || []], c = d(e) ? new Array(e).fill({}) : f(e);
|
|
151
|
+
o === "suffix" ? s.push(...c) : s.unshift(...c), n == null || n.setFieldValue(a.name, s);
|
|
155
152
|
}
|
|
156
|
-
function
|
|
157
|
-
let
|
|
158
|
-
const
|
|
159
|
-
|
|
153
|
+
function S(e) {
|
|
154
|
+
let o = f(l(u) || []);
|
|
155
|
+
const r = d(e) ? [e] : e;
|
|
156
|
+
o = o.filter((t, s) => !r.includes(s)), n == null || n.setFieldValue(a.name, o);
|
|
160
157
|
}
|
|
161
|
-
function
|
|
158
|
+
function V() {
|
|
162
159
|
return l(u);
|
|
163
160
|
}
|
|
164
|
-
function
|
|
165
|
-
var
|
|
166
|
-
return (
|
|
161
|
+
function _(e) {
|
|
162
|
+
var o;
|
|
163
|
+
return (o = l(u)) == null ? void 0 : o[e];
|
|
167
164
|
}
|
|
168
|
-
function
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
...
|
|
172
|
-
...
|
|
173
|
-
},
|
|
165
|
+
function k(e, o, r = !0) {
|
|
166
|
+
const t = f(l(u));
|
|
167
|
+
t[e] && (t[e] = {
|
|
168
|
+
...r ? t[e] : {},
|
|
169
|
+
...o
|
|
170
|
+
}, n == null || n.setFieldValue(a.name, [...t]));
|
|
174
171
|
}
|
|
175
|
-
function
|
|
176
|
-
|
|
172
|
+
function j(e) {
|
|
173
|
+
n == null || n.setFieldValue(a.name, e);
|
|
177
174
|
}
|
|
178
|
-
function
|
|
179
|
-
var
|
|
180
|
-
const
|
|
181
|
-
|
|
175
|
+
function A(e, o) {
|
|
176
|
+
var t;
|
|
177
|
+
const r = e === "end" ? u.value.length - 1 : e;
|
|
178
|
+
Z(r, (t = i.value) == null ? void 0 : t.$el, o);
|
|
182
179
|
}
|
|
183
|
-
return
|
|
184
|
-
add:
|
|
185
|
-
remove:
|
|
186
|
-
getRowData:
|
|
187
|
-
getRowsData:
|
|
188
|
-
setRowData:
|
|
189
|
-
addMultiple:
|
|
190
|
-
scrollTo:
|
|
191
|
-
setTableData:
|
|
192
|
-
}), (e,
|
|
180
|
+
return y({
|
|
181
|
+
add: E,
|
|
182
|
+
remove: S,
|
|
183
|
+
getRowData: _,
|
|
184
|
+
getRowsData: V,
|
|
185
|
+
setRowData: k,
|
|
186
|
+
addMultiple: N,
|
|
187
|
+
scrollTo: A,
|
|
188
|
+
setTableData: j
|
|
189
|
+
}), (e, o) => (K(), M(l(b).FormItem, x(e.formItem, {
|
|
193
190
|
name: e.name,
|
|
194
191
|
label: e.label
|
|
195
192
|
}), {
|
|
196
|
-
default:
|
|
197
|
-
class: l(
|
|
198
|
-
columns: l(
|
|
193
|
+
default: g(() => [G(l(J), x(l(w)(a, ["name", "maxLength", "onChange"]), {
|
|
194
|
+
class: l(L)(),
|
|
195
|
+
columns: l(v),
|
|
199
196
|
"data-source": u.value,
|
|
200
197
|
ref_key: "tableRef",
|
|
201
|
-
ref:
|
|
202
|
-
}),
|
|
203
|
-
headerCell: d(({
|
|
204
|
-
column: o
|
|
205
|
-
}) => [l(se)(o) ? (m(), $("span", {
|
|
206
|
-
key: 0,
|
|
207
|
-
class: Q(l(N)("header-cell", "required"))
|
|
208
|
-
}, "*", 2)) : w("", !0), U("span", null, I(o.title), 1), o.tooltip ? (m(), y(l(oe), {
|
|
209
|
-
key: 1,
|
|
210
|
-
title: o.tooltip,
|
|
211
|
-
placement: "bottom"
|
|
212
|
-
}, {
|
|
213
|
-
default: d(() => [b(l(de), {
|
|
214
|
-
style: J({
|
|
215
|
-
paddingLeft: "4px",
|
|
216
|
-
color: l(V).colorPrimary
|
|
217
|
-
})
|
|
218
|
-
}, null, 8, ["style"])]),
|
|
219
|
-
_: 2
|
|
220
|
-
}, 1032, ["title"])) : w("", !0)]),
|
|
198
|
+
ref: i
|
|
199
|
+
}), H({
|
|
221
200
|
_: 2
|
|
222
|
-
}, [
|
|
223
|
-
name:
|
|
224
|
-
fn:
|
|
201
|
+
}, [W(l(w)(D, ["headerCell"]), (r, t) => ({
|
|
202
|
+
name: t,
|
|
203
|
+
fn: g((s) => [$(e.$slots, t, U(q(s || {})))])
|
|
225
204
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
226
205
|
_: 3
|
|
227
206
|
}, 16, ["name", "label"]));
|
|
228
207
|
}
|
|
229
208
|
});
|
|
230
209
|
export {
|
|
231
|
-
|
|
210
|
+
ce as default
|
|
232
211
|
};
|
|
@@ -1,71 +1,77 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { omit as
|
|
3
|
-
import { mergeClass as
|
|
4
|
-
import { updateFormProps as
|
|
1
|
+
import { useSlots as y, computed as N, unref as m } from "vue";
|
|
2
|
+
import { omit as k, isFunction as v, isArray as f } from "lodash-unified";
|
|
3
|
+
import { getEditableTableTitle as w, mergeClass as A, getFinalNode as q } from "../utils.mjs";
|
|
4
|
+
import { updateFormProps as E, getFieldProps as G, getPlaceholder as L, getTableRenderProps as S } from "../../ap-table/utils.mjs";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import { useToken as U } from "ant-design-vue/es/theme/internal";
|
|
7
|
+
import { useLocale as $ } from "../../config-provider/hooks/use-locale.mjs";
|
|
8
|
+
import { useNamespace as j } from "../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
+
const W = (a, b) => {
|
|
8
10
|
const {
|
|
9
|
-
t:
|
|
10
|
-
} =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
t: g
|
|
12
|
+
} = $(), {
|
|
13
|
+
em: h,
|
|
14
|
+
be: x
|
|
15
|
+
} = j("editable-table"), F = y(), [, I] = U();
|
|
16
|
+
return N(() => {
|
|
17
|
+
const d = a.columns;
|
|
18
|
+
if (!d)
|
|
14
19
|
return [];
|
|
15
|
-
function c(
|
|
16
|
-
return
|
|
17
|
-
...
|
|
20
|
+
function c(R) {
|
|
21
|
+
return R.map((e) => ({
|
|
22
|
+
...k(e, ["ellipsis"]),
|
|
18
23
|
children: c(e.children || []),
|
|
24
|
+
title: w(e, x("table-header", "title"), h("header-cell", "required"), F.headerCell, m(I).colorPrimary),
|
|
19
25
|
customRender({
|
|
20
|
-
value:
|
|
26
|
+
value: o,
|
|
21
27
|
...n
|
|
22
28
|
}) {
|
|
23
|
-
const
|
|
29
|
+
const t = v(e.editable) ? e.editable(n.text, n.record, n.index) : !!e.editable;
|
|
24
30
|
if (!e.valueType && !e.customRender && !e.customRenderFormItem)
|
|
25
31
|
return console.warn("can not render table cell because no `valueType` / `customRender` / `customRenderFormItem`"), null;
|
|
26
32
|
let r;
|
|
27
|
-
if (
|
|
28
|
-
const
|
|
29
|
-
value:
|
|
33
|
+
if (t) {
|
|
34
|
+
const l = E(e, G(e.fieldProps, {
|
|
35
|
+
value: o,
|
|
30
36
|
...n
|
|
31
37
|
})), i = {};
|
|
32
|
-
|
|
33
|
-
var
|
|
34
|
-
return (
|
|
38
|
+
a.onFieldChange && (i[`onUpdate:${l.valuePropName || "value"}`] = (T) => {
|
|
39
|
+
var s;
|
|
40
|
+
return (s = a.onFieldChange) == null ? void 0 : s.call(a, n.index, e.dataIndex, T);
|
|
35
41
|
});
|
|
36
|
-
const
|
|
42
|
+
const C = f(e.dataIndex) ? e.dataIndex : [e.dataIndex];
|
|
37
43
|
r = {
|
|
38
|
-
name: [...
|
|
39
|
-
...
|
|
44
|
+
name: [...f(a.name) ? a.name : [a.name], n.index, ...C],
|
|
45
|
+
...l || {},
|
|
40
46
|
// 格式化placeholder
|
|
41
|
-
placeholder:
|
|
47
|
+
placeholder: L(g, e.valueType, l == null ? void 0 : l.placeholder),
|
|
42
48
|
field: {
|
|
43
49
|
style: "width: 100%",
|
|
44
|
-
...(
|
|
50
|
+
...(l == null ? void 0 : l.field) || {},
|
|
45
51
|
...i,
|
|
46
|
-
class:
|
|
52
|
+
class: A("is-editable", l.class)
|
|
47
53
|
}
|
|
48
54
|
};
|
|
49
55
|
} else
|
|
50
56
|
r = {
|
|
51
|
-
field:
|
|
52
|
-
value:
|
|
57
|
+
field: S(e, {
|
|
58
|
+
value: o,
|
|
53
59
|
...n
|
|
54
60
|
})
|
|
55
61
|
};
|
|
56
|
-
const u =
|
|
62
|
+
const u = q(e, t, r, o, n.record, m(b));
|
|
57
63
|
return e.customRender ? e.customRender({
|
|
58
|
-
value:
|
|
64
|
+
value: o,
|
|
59
65
|
...n,
|
|
60
|
-
editable:
|
|
66
|
+
editable: t,
|
|
61
67
|
originalNode: u
|
|
62
68
|
}) : u;
|
|
63
69
|
}
|
|
64
70
|
}));
|
|
65
71
|
}
|
|
66
|
-
return c(
|
|
72
|
+
return c(d);
|
|
67
73
|
});
|
|
68
74
|
};
|
|
69
75
|
export {
|
|
70
|
-
|
|
76
|
+
W as default
|
|
71
77
|
};
|