@aplus-frontend/ui 0.1.13 → 0.1.15
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-download/ap-download.vue.mjs +27 -27
- package/es/src/ap-download/hooks/useStyle.d.ts +1 -1
- package/es/src/ap-download/hooks/useStyle.mjs +13 -13
- package/es/src/business/ap-input-radio/ApInputRadio.vue2.mjs +31 -28
- package/es/src/business/ap-input-radio/interface.d.ts +1 -1
- package/es/src/business/ap-label/style.css +3 -0
- package/es/src/business/ap-status/ApStatusGroup.vue2.mjs +12 -14
- package/es/src/business/index.d.ts +0 -2
- package/es/src/editable-table/index.vue.d.ts +1 -0
- package/es/src/editable-table/index.vue.mjs +97 -87
- package/es/src/editable-table/interface.d.ts +6 -1
- package/es/src/hooks/useControllableValue.mjs +3 -0
- package/es/src/theme/antd-global-overwrite/admin/form.css +5 -12
- package/es/src/theme/antd-global-overwrite/admin/index.css +128 -28
- package/es/src/theme/antd-global-overwrite/admin/pagination.css +16 -16
- package/es/src/theme/antd-global-overwrite/admin/table.css +107 -0
- package/es/src/theme/antd-global-overwrite/aplus/form.css +14 -21
- package/es/src/theme/antd-global-overwrite/aplus/index.css +174 -74
- package/es/src/theme/antd-global-overwrite/aplus/pagination.css +20 -20
- package/es/src/theme/antd-global-overwrite/aplus/table.css +140 -33
- package/es/src/theme/ap-label/ap-label.css +3 -0
- package/es/src/utils/ap-trans-data/index.d.ts +12 -0
- package/lib/src/ap-download/ap-download.vue.js +1 -1
- package/lib/src/ap-download/hooks/useStyle.d.ts +1 -1
- package/lib/src/ap-download/hooks/useStyle.js +1 -1
- package/lib/src/business/ap-input-radio/ApInputRadio.vue2.js +1 -1
- package/lib/src/business/ap-input-radio/interface.d.ts +1 -1
- package/lib/src/business/ap-label/style.css +3 -0
- package/lib/src/business/ap-status/ApStatusGroup.vue2.js +1 -1
- package/lib/src/business/index.d.ts +0 -2
- package/lib/src/editable-table/index.vue.d.ts +1 -0
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/editable-table/interface.d.ts +6 -1
- package/lib/src/hooks/useControllableValue.js +1 -1
- package/lib/src/theme/antd-global-overwrite/admin/form.css +5 -12
- package/lib/src/theme/antd-global-overwrite/admin/index.css +128 -28
- package/lib/src/theme/antd-global-overwrite/admin/pagination.css +16 -16
- package/lib/src/theme/antd-global-overwrite/admin/table.css +107 -0
- package/lib/src/theme/antd-global-overwrite/aplus/form.css +14 -21
- package/lib/src/theme/antd-global-overwrite/aplus/index.css +174 -74
- package/lib/src/theme/antd-global-overwrite/aplus/pagination.css +20 -20
- package/lib/src/theme/antd-global-overwrite/aplus/table.css +140 -33
- package/lib/src/theme/ap-label/ap-label.css +3 -0
- package/lib/src/utils/ap-trans-data/index.d.ts +12 -0
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as y, computed as s, unref as t, openBlock as w, createElementBlock as z, normalizeStyle as b, normalizeClass as n, createElementVNode as a, renderSlot as N, toDisplayString as O } from "vue";
|
|
2
2
|
import "../config-provider/index.mjs";
|
|
3
|
-
import { useOssInit as
|
|
3
|
+
import { useOssInit as S } from "./hooks/index.mjs";
|
|
4
4
|
import "./style/ap-download.css";
|
|
5
|
-
import { getFileInfo as
|
|
6
|
-
import { useStyle as
|
|
7
|
-
import { useLocale as
|
|
8
|
-
import { useGlobalConfig as
|
|
9
|
-
const
|
|
5
|
+
import { getFileInfo as h } from "./utils/getFileInfo.mjs";
|
|
6
|
+
import { useStyle as A } from "./hooks/useStyle.mjs";
|
|
7
|
+
import { useLocale as B } from "../config-provider/hooks/use-locale.mjs";
|
|
8
|
+
import { useGlobalConfig as F } from "../config-provider/hooks/use-global-config.mjs";
|
|
9
|
+
const k = { class: "icon" }, v = { class: "text" }, V = /* @__PURE__ */ y({
|
|
10
10
|
name: "ApDownload",
|
|
11
11
|
__name: "ap-download",
|
|
12
12
|
props: {
|
|
@@ -19,35 +19,35 @@ const A = { class: "icon" }, B = { class: "text" }, W = /* @__PURE__ */ g({
|
|
|
19
19
|
getOssAccess: {}
|
|
20
20
|
},
|
|
21
21
|
setup(l) {
|
|
22
|
-
const { lang: r } =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
),
|
|
22
|
+
const { lang: r } = B(), c = s(() => r.value === "zh-cn" ? "zh_CN" : "en_US"), e = l, i = F("apUpload"), p = s(() => e.disabled), d = s(() => e.color), m = s(() => e.size), { wrapperStyle: f, getWrapperClass: u, getInnerWrapperClass: g } = A(
|
|
23
|
+
d,
|
|
24
|
+
m,
|
|
25
|
+
p
|
|
26
|
+
), _ = s(() => {
|
|
27
27
|
var o;
|
|
28
28
|
return e.getOssAccess || ((o = i.value) == null ? void 0 : o.getOssAccess);
|
|
29
|
-
}),
|
|
30
|
-
e.disabled || await (await
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
)).downloadFile(
|
|
29
|
+
}), C = async () => {
|
|
30
|
+
e.disabled || await (await S(
|
|
31
|
+
_.value,
|
|
32
|
+
t(c)
|
|
33
|
+
)).downloadFile(h(e.needName, e.fileName));
|
|
34
34
|
};
|
|
35
|
-
return (o,
|
|
36
|
-
style:
|
|
37
|
-
class: n(
|
|
38
|
-
onClick:
|
|
35
|
+
return (o, x) => (w(), z("span", {
|
|
36
|
+
style: b(t(f)),
|
|
37
|
+
class: n(t(u)),
|
|
38
|
+
onClick: C
|
|
39
39
|
}, [
|
|
40
|
-
|
|
41
|
-
class: n(
|
|
40
|
+
a("span", {
|
|
41
|
+
class: n(t(g))
|
|
42
42
|
}, [
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
a("span", k, [
|
|
44
|
+
N(o.$slots, "icon")
|
|
45
45
|
]),
|
|
46
|
-
|
|
46
|
+
a("span", v, O(o.text), 1)
|
|
47
47
|
], 2)
|
|
48
48
|
], 6));
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
export {
|
|
52
|
-
|
|
52
|
+
V as default
|
|
53
53
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComputedRef } from 'vue';
|
|
2
|
-
export declare function useStyle(color: string
|
|
2
|
+
export declare function useStyle(color: ComputedRef<string>, size: ComputedRef<string>, disabled: ComputedRef<boolean>): {
|
|
3
3
|
wrapperStyle: ComputedRef<Record<string, any>>;
|
|
4
4
|
getWrapperClass: ComputedRef<string[]>;
|
|
5
5
|
getInnerWrapperClass: ComputedRef<string[]>;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { getHexWithOpacity as
|
|
1
|
+
import { computed as a } from "vue";
|
|
2
|
+
import { getHexWithOpacity as m } from "../utils/getFileInfo.mjs";
|
|
3
3
|
import "../../config-provider/index.mjs";
|
|
4
4
|
import { useNamespace as d } from "../../config-provider/hooks/use-namespace.mjs";
|
|
5
5
|
import { useGlobalConfig as c } from "../../config-provider/hooks/use-global-config.mjs";
|
|
6
|
-
function
|
|
7
|
-
const { b:
|
|
8
|
-
"--download-main-color":
|
|
9
|
-
"--download-main-color-opacity":
|
|
10
|
-
})),
|
|
11
|
-
const
|
|
12
|
-
return t && (i.value === "aplus" ?
|
|
6
|
+
function y(o, p, t) {
|
|
7
|
+
const { b: n, bm: e } = d("ap-download"), i = c("uiMode"), l = a(() => ({
|
|
8
|
+
"--download-main-color": o.value,
|
|
9
|
+
"--download-main-color-opacity": m(o.value, 0.6)
|
|
10
|
+
})), s = a(() => [n("wrapper"), e("wrapper", p.value)].filter(Boolean)), u = a(() => {
|
|
11
|
+
const r = [n("inner-wrapper"), e("inner-wrapper", p.value)];
|
|
12
|
+
return t.value && (i.value === "aplus" ? r.push(e("inner-wrapper", "disabled")) : r.push(e("inner-wrapper", "disabled-admin"))), r;
|
|
13
13
|
});
|
|
14
14
|
return {
|
|
15
|
-
wrapperStyle:
|
|
16
|
-
getWrapperClass:
|
|
17
|
-
getInnerWrapperClass:
|
|
15
|
+
wrapperStyle: l,
|
|
16
|
+
getWrapperClass: s,
|
|
17
|
+
getInnerWrapperClass: u
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
export {
|
|
21
|
-
|
|
21
|
+
y as useStyle
|
|
22
22
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as f, openBlock as g, createElementBlock as C, normalizeClass as h, unref as t, createVNode as u, mergeProps as B } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
|
-
import { Form as
|
|
4
|
-
import { omit as
|
|
3
|
+
import { Form as I, InputNumber as b, RadioGroup as _ } from "ant-design-vue";
|
|
4
|
+
import { omit as x } from "lodash-unified";
|
|
5
5
|
import "./style.css";
|
|
6
|
-
import { useNamespace as
|
|
7
|
-
const
|
|
6
|
+
import { useNamespace as y } from "../../config-provider/hooks/use-namespace.mjs";
|
|
7
|
+
const G = /* @__PURE__ */ f({
|
|
8
8
|
name: "ApInputRadio",
|
|
9
9
|
__name: "ApInputRadio",
|
|
10
10
|
props: {
|
|
@@ -29,31 +29,34 @@ const A = /* @__PURE__ */ d({
|
|
|
29
29
|
options: {}
|
|
30
30
|
},
|
|
31
31
|
emits: ["update:value"],
|
|
32
|
-
setup(
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
n({ inputval:
|
|
37
|
-
},
|
|
38
|
-
n({ radioVal:
|
|
32
|
+
setup(p, { emit: l }) {
|
|
33
|
+
const s = I.useInjectFormItemContext(), e = p, { b: i, e: m } = y("ap-input-radio"), c = l, n = (o) => {
|
|
34
|
+
c("update:value", { ...e.value, ...o }), s.onFieldChange();
|
|
35
|
+
}, d = (o) => {
|
|
36
|
+
n({ inputval: o });
|
|
37
|
+
}, v = (o) => {
|
|
38
|
+
n({ radioVal: o.target.value });
|
|
39
|
+
};
|
|
40
|
+
return (o, F) => {
|
|
41
|
+
var a, r;
|
|
42
|
+
return g(), C("div", {
|
|
43
|
+
class: h([t(i)()])
|
|
44
|
+
}, [
|
|
45
|
+
u(t(b), B({
|
|
46
|
+
class: t(m)("input-number")
|
|
47
|
+
}, t(x)(e, ["value", "options"]), {
|
|
48
|
+
value: e.value ? (a = e.value) == null ? void 0 : a.inputval : "",
|
|
49
|
+
onChange: d
|
|
50
|
+
}), null, 16, ["class", "value"]),
|
|
51
|
+
u(t(_), {
|
|
52
|
+
value: e.value ? (r = e.value) == null ? void 0 : r.radioVal : "",
|
|
53
|
+
options: e.options,
|
|
54
|
+
onChange: v
|
|
55
|
+
}, null, 8, ["value", "options"])
|
|
56
|
+
], 2);
|
|
39
57
|
};
|
|
40
|
-
return (e, x) => (f(), v("div", {
|
|
41
|
-
class: g([t(l)()])
|
|
42
|
-
}, [
|
|
43
|
-
a(t(B), C({
|
|
44
|
-
class: t(s)("input-number")
|
|
45
|
-
}, t(b)(o, ["value", "options"]), {
|
|
46
|
-
value: o.value.inputval,
|
|
47
|
-
onChange: m
|
|
48
|
-
}), null, 16, ["class", "value"]),
|
|
49
|
-
a(t(I), {
|
|
50
|
-
value: o.value.radioVal,
|
|
51
|
-
options: o.options,
|
|
52
|
-
onChange: c
|
|
53
|
-
}, null, 8, ["value", "options"])
|
|
54
|
-
], 2));
|
|
55
58
|
}
|
|
56
59
|
});
|
|
57
60
|
export {
|
|
58
|
-
|
|
61
|
+
G as default
|
|
59
62
|
};
|
|
@@ -2,7 +2,7 @@ import { InputNumberProps } from 'ant-design-vue/es/input-number';
|
|
|
2
2
|
type ApInputProps = Pick<InputNumberProps, 'disabled' | 'stringMode' | 'precision' | 'max' | 'min' | 'step' | 'bordered' | 'autofocus' | 'decimalSeparator' | 'controls' | 'formatter' | 'onInput' | 'onChange' | 'onPressEnter' | 'onStep' | 'onBlur' | 'onFocus'>;
|
|
3
3
|
type ApInputValyeName = 'inputval' | 'radioVal';
|
|
4
4
|
export type ApInputValType = {
|
|
5
|
-
value
|
|
5
|
+
value?: Record<ApInputValyeName, string | number>;
|
|
6
6
|
};
|
|
7
7
|
export type ApInputRadioOptions = Array<{
|
|
8
8
|
value: string | number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as p, computed as
|
|
1
|
+
import { defineComponent as p, computed as c, openBlock as r, createElementBlock as o, normalizeClass as d, unref as m, normalizeStyle as a, Fragment as i, renderList as f, createBlock as y, createCommentVNode as _ } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
3
|
import "./ApStatus.vue.mjs";
|
|
4
|
-
import { useNamespace as
|
|
5
|
-
import
|
|
4
|
+
import { useNamespace as g } from "../../config-provider/hooks/use-namespace.mjs";
|
|
5
|
+
import k from "./ApStatus.vue2.mjs";
|
|
6
6
|
const w = /* @__PURE__ */ p({
|
|
7
7
|
name: "ApStatusGroup",
|
|
8
8
|
__name: "ApStatusGroup",
|
|
@@ -14,25 +14,23 @@ const w = /* @__PURE__ */ p({
|
|
|
14
14
|
show: { type: Boolean, default: !0 }
|
|
15
15
|
},
|
|
16
16
|
setup(s) {
|
|
17
|
-
const t = s,
|
|
18
|
-
"padding-left": t.padding + "px",
|
|
19
|
-
"padding-right": t.padding + "px",
|
|
17
|
+
const t = s, u = c(() => ({
|
|
20
18
|
...t.style
|
|
21
|
-
})), { b:
|
|
22
|
-
return (
|
|
19
|
+
})), { b: l } = g("ap-status-group");
|
|
20
|
+
return (n, S) => t.statusList ? (r(), o("div", {
|
|
23
21
|
key: 0,
|
|
24
|
-
class:
|
|
25
|
-
style:
|
|
22
|
+
class: d([m(l)()]),
|
|
23
|
+
style: a(u.value)
|
|
26
24
|
}, [
|
|
27
|
-
(
|
|
25
|
+
(r(!0), o(i, null, f(t.statusList, (e) => (r(), y(k, {
|
|
28
26
|
key: e.value,
|
|
29
|
-
show: e.value ===
|
|
27
|
+
show: e.value === n.currentValue,
|
|
30
28
|
color: e.color,
|
|
31
29
|
text: e.text,
|
|
32
30
|
padding: t.padding,
|
|
33
|
-
style:
|
|
31
|
+
style: a(t.style)
|
|
34
32
|
}, null, 8, ["show", "color", "text", "padding", "style"]))), 128))
|
|
35
|
-
], 6)) :
|
|
33
|
+
], 6)) : _("", !0);
|
|
36
34
|
}
|
|
37
35
|
});
|
|
38
36
|
export {
|
|
@@ -1095,7 +1095,6 @@ export declare const ApInputRadio: DefineComponent<{
|
|
|
1095
1095
|
};
|
|
1096
1096
|
value: {
|
|
1097
1097
|
type: PropType<Record<"inputval" | "radioVal", string | number>>;
|
|
1098
|
-
required: true;
|
|
1099
1098
|
};
|
|
1100
1099
|
options: {
|
|
1101
1100
|
type: PropType<ApInputRadioOptions>;
|
|
@@ -1166,7 +1165,6 @@ export declare const ApInputRadio: DefineComponent<{
|
|
|
1166
1165
|
};
|
|
1167
1166
|
value: {
|
|
1168
1167
|
type: PropType<Record<"inputval" | "radioVal", string | number>>;
|
|
1169
|
-
required: true;
|
|
1170
1168
|
};
|
|
1171
1169
|
options: {
|
|
1172
1170
|
type: PropType<ApInputRadioOptions>;
|
|
@@ -19,6 +19,7 @@ declare const _default: <RecordType extends Recordable = any>(__VLS_props: NonNu
|
|
|
19
19
|
setRowData: (index: number, payload: any) => void;
|
|
20
20
|
addMultiple: (list: number | Partial<RecordType>[], insetIn?: "prefix" | "suffix") => void;
|
|
21
21
|
scrollTo: (index: number | "end", options?: StandardBehaviorOptions) => void;
|
|
22
|
+
clear: () => void;
|
|
22
23
|
}>): void;
|
|
23
24
|
attrs: any;
|
|
24
25
|
slots: ReturnType<() => Readonly<{
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Table as
|
|
3
|
-
import { ApForm as
|
|
4
|
-
import { isArray as
|
|
1
|
+
import { defineComponent as W, useSlots as $, ref as v, watch as w, unref as l, openBlock as R, createBlock as G, withCtx as c, createVNode as b, mergeProps as J, createSlots as Q, createElementBlock as X, Fragment as Y, createElementVNode as F, normalizeClass as Z, toDisplayString as ee, createCommentVNode as te, renderList as ae, renderSlot as ne, normalizeProps as oe, guardReactiveProps as le } from "vue";
|
|
2
|
+
import { Table as re } from "ant-design-vue";
|
|
3
|
+
import { ApForm as p } from "../ap-form/index.mjs";
|
|
4
|
+
import { isEqual as se, isArray as B, isNumber as h, cloneDeep as x, omit as ue } from "lodash-unified";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
6
|
import "../hooks/index.mjs";
|
|
7
|
-
import { isDef as
|
|
8
|
-
import { scrollToRowIndex as
|
|
9
|
-
import
|
|
7
|
+
import { isDef as g } from "../utils/index.mjs";
|
|
8
|
+
import { scrollToRowIndex as de, getColumnIsRequired as ie } from "./utils.mjs";
|
|
9
|
+
import me from "./hooks/use-get-columns.mjs";
|
|
10
10
|
import "./style/index.css";
|
|
11
|
-
import { useNamespace as
|
|
12
|
-
import { useControllableValue as
|
|
13
|
-
const
|
|
11
|
+
import { useNamespace as ce } from "../config-provider/hooks/use-namespace.mjs";
|
|
12
|
+
import { useControllableValue as fe } from "../hooks/useControllableValue.mjs";
|
|
13
|
+
const Ee = /* @__PURE__ */ W({
|
|
14
14
|
name: "EditableTable",
|
|
15
15
|
__name: "index",
|
|
16
16
|
props: {
|
|
@@ -109,121 +109,131 @@ const Be = /* @__PURE__ */ M({
|
|
|
109
109
|
onFieldChange: {}
|
|
110
110
|
},
|
|
111
111
|
emits: ["update:value"],
|
|
112
|
-
setup(
|
|
113
|
-
expose:
|
|
114
|
-
emit:
|
|
112
|
+
setup(E, {
|
|
113
|
+
expose: N,
|
|
114
|
+
emit: V
|
|
115
115
|
}) {
|
|
116
|
-
const o =
|
|
117
|
-
b:
|
|
118
|
-
em:
|
|
119
|
-
} =
|
|
116
|
+
const o = E, {
|
|
117
|
+
b: k,
|
|
118
|
+
em: D
|
|
119
|
+
} = ce("editable-table"), L = $(), _ = V, C = v(), {
|
|
120
120
|
value: s,
|
|
121
|
-
updateValue:
|
|
122
|
-
} =
|
|
123
|
-
|
|
124
|
-
var
|
|
125
|
-
|
|
121
|
+
updateValue: S
|
|
122
|
+
} = fe(o, _), u = v(), f = p.useWatch(o.name, u);
|
|
123
|
+
w(() => f.value, (e) => {
|
|
124
|
+
var t;
|
|
125
|
+
S(e), (t = o.onChange) == null || t.call(o, e);
|
|
126
|
+
}, {
|
|
127
|
+
deep: !0
|
|
128
|
+
}), w(s, (e) => {
|
|
129
|
+
var t;
|
|
130
|
+
e !== l(f) && (se(e, l(f)) || (t = u.value) == null || t.setFieldValue(o.name, e));
|
|
126
131
|
}, {
|
|
127
132
|
deep: !0
|
|
128
133
|
});
|
|
129
|
-
const
|
|
130
|
-
function
|
|
134
|
+
const A = me(o);
|
|
135
|
+
function T() {
|
|
131
136
|
var e;
|
|
132
137
|
(e = u.value) == null || e.resetFields();
|
|
133
138
|
}
|
|
134
|
-
function
|
|
135
|
-
return e ? (
|
|
139
|
+
function z(e) {
|
|
140
|
+
return e ? (B(e) ? e : [e]).map((a) => B(a) ? [o.name, ...a] : [o.name, a]) : void 0;
|
|
136
141
|
}
|
|
137
|
-
async function
|
|
138
|
-
var
|
|
139
|
-
const
|
|
140
|
-
return
|
|
142
|
+
async function I(e, t) {
|
|
143
|
+
var n;
|
|
144
|
+
const a = await ((n = u.value) == null ? void 0 : n.validateFields(z(e), t));
|
|
145
|
+
return a == null ? void 0 : a[o.name];
|
|
141
146
|
}
|
|
142
|
-
function
|
|
147
|
+
function P(e, t) {
|
|
143
148
|
var r, d, i;
|
|
144
|
-
const
|
|
145
|
-
if (
|
|
149
|
+
const a = ((r = l(s)) == null ? void 0 : r.length) || 0;
|
|
150
|
+
if (g(o.maxLength) && a >= o.maxLength)
|
|
146
151
|
return;
|
|
147
|
-
const
|
|
148
|
-
|
|
152
|
+
const n = [...l(s) || []];
|
|
153
|
+
g(t) ? n.splice(t, 0, {
|
|
149
154
|
...e || {}
|
|
150
|
-
}) :
|
|
155
|
+
}) : n.push({
|
|
151
156
|
...e || {}
|
|
152
|
-
}), (i = (d = u.value) == null ? void 0 : d.setFieldValue) == null || i.call(d, o.name,
|
|
157
|
+
}), (i = (d = u.value) == null ? void 0 : d.setFieldValue) == null || i.call(d, o.name, n);
|
|
153
158
|
}
|
|
154
|
-
function
|
|
155
|
-
var i, m,
|
|
156
|
-
const
|
|
157
|
-
if (
|
|
159
|
+
function j(e, t = "suffix") {
|
|
160
|
+
var i, m, y;
|
|
161
|
+
const a = ((i = l(s)) == null ? void 0 : i.length) || 0, n = h(e) ? e : e.length;
|
|
162
|
+
if (g(o.maxLength) && a + n > o.maxLength)
|
|
158
163
|
return;
|
|
159
|
-
const r = [...l(s) || []], d =
|
|
160
|
-
|
|
164
|
+
const r = [...l(s) || []], d = h(e) ? new Array(e).fill({}) : x(e);
|
|
165
|
+
t === "suffix" ? r.push(...d) : r.unshift(...d), (y = (m = u.value) == null ? void 0 : m.setFieldValue) == null || y.call(m, o.name, r);
|
|
161
166
|
}
|
|
162
|
-
function
|
|
163
|
-
var
|
|
164
|
-
let
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
+
function O(e) {
|
|
168
|
+
var n, r;
|
|
169
|
+
let t = x(l(s) || []);
|
|
170
|
+
const a = h(e) ? [e] : e;
|
|
171
|
+
t = t.filter((d, i) => !a.includes(i)), (r = (n = u.value) == null ? void 0 : n.setFieldValue) == null || r.call(n, o.name, t);
|
|
167
172
|
}
|
|
168
|
-
function
|
|
173
|
+
function q() {
|
|
169
174
|
return l(s);
|
|
170
175
|
}
|
|
171
176
|
function K(e) {
|
|
172
|
-
var
|
|
173
|
-
return (
|
|
177
|
+
var t;
|
|
178
|
+
return (t = l(s)) == null ? void 0 : t[e];
|
|
179
|
+
}
|
|
180
|
+
function H(e, t) {
|
|
181
|
+
var n, r;
|
|
182
|
+
const a = x(l(s));
|
|
183
|
+
a[e] && (a[e] = {
|
|
184
|
+
...a[e],
|
|
185
|
+
...t
|
|
186
|
+
}, (r = (n = u.value) == null ? void 0 : n.setFieldValue) == null || r.call(n, o.name, [...a]));
|
|
174
187
|
}
|
|
175
|
-
function
|
|
176
|
-
var
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
...t[e],
|
|
180
|
-
...n
|
|
181
|
-
}, (r = (a = u.value) == null ? void 0 : a.setFieldValue) == null || r.call(a, o.name, [...t]));
|
|
188
|
+
function M(e, t) {
|
|
189
|
+
var n;
|
|
190
|
+
const a = e === "end" ? s.value.length - 1 : e;
|
|
191
|
+
de(a, (n = C.value) == null ? void 0 : n.$el, t);
|
|
182
192
|
}
|
|
183
|
-
function
|
|
184
|
-
var
|
|
185
|
-
|
|
186
|
-
se(t, (a = g.value) == null ? void 0 : a.$el, n);
|
|
193
|
+
function U() {
|
|
194
|
+
var e, t;
|
|
195
|
+
(t = (e = u.value) == null ? void 0 : e.setFieldValue) == null || t.call(e, o.name, []);
|
|
187
196
|
}
|
|
188
|
-
return
|
|
189
|
-
resetFields:
|
|
190
|
-
validateFields:
|
|
191
|
-
add:
|
|
192
|
-
remove:
|
|
197
|
+
return N({
|
|
198
|
+
resetFields: T,
|
|
199
|
+
validateFields: I,
|
|
200
|
+
add: P,
|
|
201
|
+
remove: O,
|
|
193
202
|
getRowData: K,
|
|
194
|
-
getRowsData:
|
|
195
|
-
setRowData:
|
|
196
|
-
addMultiple:
|
|
197
|
-
scrollTo:
|
|
198
|
-
|
|
203
|
+
getRowsData: q,
|
|
204
|
+
setRowData: H,
|
|
205
|
+
addMultiple: j,
|
|
206
|
+
scrollTo: M,
|
|
207
|
+
clear: U
|
|
208
|
+
}), (e, t) => (R(), G(l(p), {
|
|
199
209
|
"initial-values": {
|
|
200
210
|
[o.name]: l(s)
|
|
201
211
|
},
|
|
202
212
|
ref_key: "formRef",
|
|
203
213
|
ref: u
|
|
204
214
|
}, {
|
|
205
|
-
default: c(() => [
|
|
215
|
+
default: c(() => [b(l(p).FormItem, {
|
|
206
216
|
name: e.name,
|
|
207
217
|
"no-style": ""
|
|
208
218
|
}, {
|
|
209
|
-
default: c(() => [
|
|
210
|
-
class: l(
|
|
211
|
-
columns: l(
|
|
219
|
+
default: c(() => [b(l(re), J(l(ue)(o, ["name", "value", "onUpdate:value", "maxLength", "onChange"]), {
|
|
220
|
+
class: l(k)(),
|
|
221
|
+
columns: l(A),
|
|
212
222
|
"data-source": l(s),
|
|
213
223
|
ref_key: "tableRef",
|
|
214
|
-
ref:
|
|
215
|
-
}),
|
|
224
|
+
ref: C
|
|
225
|
+
}), Q({
|
|
216
226
|
headerCell: c(({
|
|
217
|
-
column:
|
|
218
|
-
}) => [l(
|
|
227
|
+
column: a
|
|
228
|
+
}) => [l(ie)(a) ? (R(), X(Y, {
|
|
219
229
|
key: 0
|
|
220
|
-
}, [
|
|
221
|
-
class:
|
|
222
|
-
}, "*", 2),
|
|
230
|
+
}, [F("span", {
|
|
231
|
+
class: Z(l(D)("header-cell", "required"))
|
|
232
|
+
}, "*", 2), F("span", null, ee(a.title), 1)], 64)) : te("", !0)]),
|
|
223
233
|
_: 2
|
|
224
|
-
}, [
|
|
225
|
-
name:
|
|
226
|
-
fn: c((r) => [
|
|
234
|
+
}, [ae(L, (a, n) => ({
|
|
235
|
+
name: n,
|
|
236
|
+
fn: c((r) => [ne(e.$slots, n, oe(le(r || {})))])
|
|
227
237
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
228
238
|
_: 3
|
|
229
239
|
}, 8, ["name"])]),
|
|
@@ -232,5 +242,5 @@ const Be = /* @__PURE__ */ M({
|
|
|
232
242
|
}
|
|
233
243
|
});
|
|
234
244
|
export {
|
|
235
|
-
|
|
245
|
+
Ee as default
|
|
236
246
|
};
|
|
@@ -140,6 +140,11 @@ export type EditableTableExpose<ModelType = any, RecordType = any> = {
|
|
|
140
140
|
* @returns
|
|
141
141
|
*/
|
|
142
142
|
remove: (index: number | number[]) => void;
|
|
143
|
+
/**
|
|
144
|
+
* 清空所有数据
|
|
145
|
+
* @returns
|
|
146
|
+
*/
|
|
147
|
+
clear: () => void;
|
|
143
148
|
/**
|
|
144
149
|
* 获取所有行的数据
|
|
145
150
|
* @returns
|
|
@@ -169,4 +174,4 @@ export type EditableTableExpose<ModelType = any, RecordType = any> = {
|
|
|
169
174
|
* 可编辑表格作为表单项暴露的实例
|
|
170
175
|
* @description 作为Form表单使用时不再暴露表单相关的API
|
|
171
176
|
*/
|
|
172
|
-
export type EditableTableFormItemExpose<ModelType = any, RecordType = any> = Omit<EditableTableExpose<ModelType, RecordType>, 'resetFields' | 'validateFields'>;
|
|
177
|
+
export type EditableTableFormItemExpose<ModelType = any, RecordType = any> = Omit<EditableTableExpose<ModelType, RecordType>, 'resetFields' | 'validateFields' | 'clear'>;
|
|
@@ -10,13 +10,6 @@
|
|
|
10
10
|
.ant-form .ant-form-item-control .ant-form-item-explain-error {
|
|
11
11
|
font-size: 12px;
|
|
12
12
|
}
|
|
13
|
-
.ant-form .ant-form-item-control .ant-radio-wrapper .ant-radio.ant-radio-checked .ant-radio-inner {
|
|
14
|
-
background-color: #ffffff;
|
|
15
|
-
border-color: #34b77c;
|
|
16
|
-
}
|
|
17
|
-
.ant-form .ant-form-item-control .ant-radio-wrapper .ant-radio.ant-radio-checked .ant-radio-inner::after {
|
|
18
|
-
background-color: #34b77c;
|
|
19
|
-
}
|
|
20
13
|
.ant-form .ant-form-item-control .ant-select.ant-select-open .ant-select-selection-item {
|
|
21
14
|
color: #bfbfbf;
|
|
22
15
|
}
|
|
@@ -44,22 +37,22 @@
|
|
|
44
37
|
input.ant-input[disabled] {
|
|
45
38
|
color: #666666;
|
|
46
39
|
}
|
|
47
|
-
div[class
|
|
40
|
+
div[class*='-basic-table-form-container'] form[class$='-basic-form--compact'] {
|
|
48
41
|
padding: 16px;
|
|
49
42
|
}
|
|
50
|
-
div[class
|
|
43
|
+
div[class*='-basic-table-form-container'] form[class$='-basic-form--compact'] div.ant-col[tableaction] .ant-form-item-control-input-content {
|
|
51
44
|
display: flex;
|
|
52
45
|
align-items: center;
|
|
53
46
|
justify-content: flex-end;
|
|
54
47
|
}
|
|
55
|
-
div[class
|
|
48
|
+
div[class*='-basic-table-form-container'] form[class$='-basic-form--compact'] div.ant-col[tableaction] .ant-form-item-control-input-content button.ant-btn-primary {
|
|
56
49
|
order: 1;
|
|
57
50
|
}
|
|
58
|
-
div[class
|
|
51
|
+
div[class*='-basic-table-form-container'] form[class$='-basic-form--compact'] div.ant-col[tableaction] .ant-form-item-control-input-content button.ant-btn-default {
|
|
59
52
|
order: 2;
|
|
60
53
|
margin-right: 0;
|
|
61
54
|
}
|
|
62
|
-
div[class
|
|
55
|
+
div[class*='-basic-table-form-container'] form[class$='-basic-form--compact'] div.ant-col[tableaction] .ant-form-item-control-input-content button.ant-btn-link {
|
|
63
56
|
order: 3;
|
|
64
57
|
margin-left: 0.5rem;
|
|
65
58
|
}
|