@aplus-frontend/ui 0.0.40 → 0.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/es/src/ap-action/item/index.vue2.mjs +19 -20
- package/es/src/ap-action/item-modal/index.vue.mjs +7 -6
- package/es/src/ap-action/style/item.css +10 -25
- package/es/src/ap-field/checkbox/index.vue.mjs +32 -27
- package/es/src/ap-field/checkbox/style.css +7 -0
- package/es/src/ap-field/interface.d.ts +2 -0
- package/es/src/ap-field/radio/index.vue.d.ts +3 -0
- package/es/src/ap-field/radio/index.vue.mjs +44 -29
- package/es/src/ap-field/radio/style.css +4 -0
- package/es/src/ap-table/ap-table.vue.mjs +125 -126
- package/es/src/ap-table/constants.d.ts +15 -0
- package/es/src/ap-table/style/ap-table.css +1 -21
- package/es/src/business/ap-status/ApStatusGroup.vue2.mjs +10 -9
- package/es/src/check-card/index.vue2.mjs +44 -48
- package/es/src/check-card/style/index.css +10 -42
- package/es/src/design-token/index.mjs +4 -2
- package/es/src/editable-table/form-item.vue.mjs +57 -58
- package/es/src/editable-table/index.vue.mjs +54 -55
- package/es/src/editable-table/style/index.css +1 -21
- package/es/src/locale/lang/en.mjs +1 -1
- package/es/src/locale/lang/zh-cn.mjs +22 -22
- package/es/src/theme/ap-action/item.css +10 -25
- package/es/src/theme/ap-field/checkbox.css +7 -0
- package/es/src/theme/ap-field/radio.css +4 -0
- package/es/src/theme/ap-table/ap-table.css +1 -21
- package/es/src/theme/check-card/index.css +10 -42
- package/es/src/theme/css-var/index.mjs +83 -19
- package/es/src/theme/editable-table/index.css +1 -21
- package/lib/src/ap-action/item/index.vue2.js +1 -1
- package/lib/src/ap-action/item-modal/index.vue.js +1 -1
- package/lib/src/ap-action/style/item.css +10 -25
- package/lib/src/ap-field/checkbox/index.vue.js +1 -1
- package/lib/src/ap-field/checkbox/style.css +7 -0
- package/lib/src/ap-field/interface.d.ts +2 -0
- package/lib/src/ap-field/radio/index.vue.d.ts +3 -0
- package/lib/src/ap-field/radio/index.vue.js +1 -1
- package/lib/src/ap-field/radio/style.css +4 -0
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +15 -0
- package/lib/src/ap-table/style/ap-table.css +1 -21
- package/lib/src/business/ap-status/ApStatusGroup.vue2.js +1 -1
- package/lib/src/check-card/index.vue2.js +1 -1
- package/lib/src/check-card/style/index.css +10 -42
- package/lib/src/design-token/index.js +1 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/editable-table/style/index.css +1 -21
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/theme/ap-action/item.css +10 -25
- package/lib/src/theme/ap-field/checkbox.css +7 -0
- package/lib/src/theme/ap-field/radio.css +4 -0
- package/lib/src/theme/ap-table/ap-table.css +1 -21
- package/lib/src/theme/check-card/index.css +10 -42
- package/lib/src/theme/css-var/index.js +1 -1
- package/lib/src/theme/editable-table/index.css +1 -21
- package/package.json +2 -2
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Skeleton as
|
|
1
|
+
import { defineComponent as F, computed as s, unref as l, createVNode as m, watch as I, watchEffect as j, openBlock as i, createElementBlock as B, normalizeStyle as D, normalizeClass as N, withModifiers as M, createBlock as f, renderSlot as O, resolveDynamicComponent as P, createCommentVNode as v, createElementVNode as U } from "vue";
|
|
2
|
+
import { Skeleton as W } from "ant-design-vue";
|
|
3
3
|
import "../config-provider/index.mjs";
|
|
4
4
|
import "../hooks/index.mjs";
|
|
5
|
-
import { isFunction as
|
|
6
|
-
import { useInjectCheckCard as
|
|
5
|
+
import { isFunction as V } from "lodash-unified";
|
|
6
|
+
import { useInjectCheckCard as $ } from "./context.mjs";
|
|
7
7
|
import "./style/index.css";
|
|
8
|
-
import
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
const Q = ["src"], re = /* @__PURE__ */ I({
|
|
8
|
+
import q from "./checked.svg.mjs";
|
|
9
|
+
import { useNamespace as A } from "../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
import { useControllableValue as G } from "../hooks/useControllableValue.mjs";
|
|
11
|
+
const H = ["src"], oe = /* @__PURE__ */ F({
|
|
13
12
|
name: "CheckCard",
|
|
14
13
|
__name: "index",
|
|
15
14
|
props: {
|
|
@@ -48,43 +47,40 @@ const Q = ["src"], re = /* @__PURE__ */ I({
|
|
|
48
47
|
content: {}
|
|
49
48
|
},
|
|
50
49
|
emits: ["update:checked"],
|
|
51
|
-
setup(
|
|
52
|
-
emit:
|
|
50
|
+
setup(z, {
|
|
51
|
+
emit: S
|
|
53
52
|
}) {
|
|
54
|
-
const o =
|
|
53
|
+
const o = z, {
|
|
55
54
|
b: g,
|
|
56
|
-
m:
|
|
55
|
+
m: c,
|
|
57
56
|
e: p,
|
|
58
|
-
bm:
|
|
57
|
+
bm: J,
|
|
59
58
|
em: k
|
|
60
|
-
} =
|
|
59
|
+
} = A("check-card"), _ = S, n = $(), {
|
|
61
60
|
value: r,
|
|
62
|
-
updateValue:
|
|
63
|
-
} =
|
|
61
|
+
updateValue: h
|
|
62
|
+
} = G(o, _, {
|
|
64
63
|
valuePropName: "checked",
|
|
65
64
|
defaultValuePropName: "defaultChecked"
|
|
66
|
-
}), a =
|
|
65
|
+
}), a = s(() => {
|
|
67
66
|
const e = {
|
|
68
67
|
...o
|
|
69
68
|
}, t = l(n);
|
|
70
69
|
return t && (e.disabled = e.disabled || t.disabled, e.bordered = e.bordered || t.bordered, e.loading = e.loading || t.loading, e.size = e.size || t.size, e.stopPropagation = e.stopPropagation || t.stopPropagation), e;
|
|
71
|
-
}),
|
|
72
|
-
const e = l(
|
|
73
|
-
return [g(), ...
|
|
74
|
-
}),
|
|
75
|
-
...o.style,
|
|
76
|
-
"--check-card-border-color": h.value === "admin" ? "#D9D9D9" : "#E9EDF3"
|
|
77
|
-
})), y = i(() => {
|
|
70
|
+
}), w = s(() => {
|
|
71
|
+
const e = l(a);
|
|
72
|
+
return [g(), ...e.disabled ? [] : [g(), l(r) ? c("checked") : null], c(e.size), e.bordered ? c("bordered") : null, e.disabled ? c("disabled") : null];
|
|
73
|
+
}), b = s(() => {
|
|
78
74
|
if (!o.title)
|
|
79
75
|
return;
|
|
80
|
-
const e =
|
|
76
|
+
const e = V(o.title) ? o.title(l(r)) : m("span", null, [o.title]);
|
|
81
77
|
return m("div", {
|
|
82
78
|
class: [p("title"), a.value.disabled ? k("title", "disabled") : null]
|
|
83
79
|
}, [e]);
|
|
84
|
-
}),
|
|
80
|
+
}), y = s(() => {
|
|
85
81
|
if (!o.content)
|
|
86
82
|
return;
|
|
87
|
-
const e =
|
|
83
|
+
const e = V(o.content) ? o.content(l(r)) : o.content;
|
|
88
84
|
return m("div", {
|
|
89
85
|
class: [p("content"), a.value.disabled ? k("content", "disabled") : null]
|
|
90
86
|
}, [e]);
|
|
@@ -93,45 +89,45 @@ const Q = ["src"], re = /* @__PURE__ */ I({
|
|
|
93
89
|
const t = l(a).stopPropagation;
|
|
94
90
|
return t ? t === !0 ? e.target !== e.currentTarget : t(e) : !1;
|
|
95
91
|
}
|
|
96
|
-
function
|
|
92
|
+
function E(e) {
|
|
97
93
|
var t, d;
|
|
98
|
-
T(e) || a.value.loading || a.value.disabled || (n.value ? (d = (t = n.value) == null ? void 0 : t.toggleOption) == null || d.call(t, o.value) :
|
|
94
|
+
T(e) || a.value.loading || a.value.disabled || (n.value ? (d = (t = n.value) == null ? void 0 : t.toggleOption) == null || d.call(t, o.value) : h(!l(r)));
|
|
99
95
|
}
|
|
100
|
-
return
|
|
96
|
+
return I(() => n.value, (e) => {
|
|
101
97
|
if (!e)
|
|
102
98
|
return;
|
|
103
99
|
const t = e.multiple ? (e.value || []).includes(o.value) : e.value === o.value;
|
|
104
|
-
|
|
100
|
+
h(t);
|
|
105
101
|
}, {
|
|
106
102
|
immediate: !0
|
|
107
|
-
}),
|
|
103
|
+
}), j((e) => {
|
|
108
104
|
var t, d;
|
|
109
105
|
(d = (t = n.value) == null ? void 0 : t.registerValue) == null || d.call(t, o.value), e(() => {
|
|
110
|
-
var u,
|
|
111
|
-
return (
|
|
106
|
+
var u, C;
|
|
107
|
+
return (C = (u = n.value) == null ? void 0 : u.cancelValue) == null ? void 0 : C.call(u, o.value);
|
|
112
108
|
});
|
|
113
|
-
}), (e, t) => (
|
|
114
|
-
style:
|
|
115
|
-
class:
|
|
116
|
-
onClick:
|
|
117
|
-
}, [a.value.loading ? (
|
|
109
|
+
}), (e, t) => (i(), B("div", {
|
|
110
|
+
style: D(e.style),
|
|
111
|
+
class: N(w.value),
|
|
112
|
+
onClick: M(E, ["stop"])
|
|
113
|
+
}, [a.value.loading ? (i(), f(l(W), {
|
|
118
114
|
key: 0,
|
|
119
115
|
active: ""
|
|
120
116
|
})) : O(e.$slots, "default", {
|
|
121
117
|
key: 1,
|
|
122
118
|
checked: l(r)
|
|
123
|
-
}, () => [
|
|
119
|
+
}, () => [b.value ? (i(), f(P(b.value), {
|
|
124
120
|
key: 0
|
|
125
|
-
})) : v("", !0),
|
|
121
|
+
})) : v("", !0), y.value ? (i(), f(P(y.value), {
|
|
126
122
|
key: 1
|
|
127
|
-
})) : v("", !0)]), l(r) ? (
|
|
123
|
+
})) : v("", !0)]), l(r) ? (i(), B("div", {
|
|
128
124
|
key: 2,
|
|
129
|
-
class:
|
|
130
|
-
}, [
|
|
131
|
-
src: l(
|
|
132
|
-
}, null, 8,
|
|
125
|
+
class: N(l(p)("checked-icon"))
|
|
126
|
+
}, [U("img", {
|
|
127
|
+
src: l(q)
|
|
128
|
+
}, null, 8, H)], 2)) : v("", !0)], 6));
|
|
133
129
|
}
|
|
134
130
|
});
|
|
135
131
|
export {
|
|
136
|
-
|
|
132
|
+
oe as default
|
|
137
133
|
};
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
cursor: not-allowed;
|
|
8
8
|
}
|
|
9
9
|
.aplus-check-card--bordered {
|
|
10
|
-
outline: 1px solid var(--check-card-
|
|
10
|
+
outline: 1px solid var(--check-card-outline-color);
|
|
11
11
|
}
|
|
12
|
-
.aplus-check-card
|
|
12
|
+
.aplus-check-card:hover {
|
|
13
13
|
cursor: pointer;
|
|
14
|
-
outline: 1px solid
|
|
14
|
+
outline: 1px solid var(--check-card-hover-outline-color);
|
|
15
15
|
}
|
|
16
|
-
.aplus-check-card
|
|
16
|
+
.aplus-check-card::after {
|
|
17
17
|
content: '';
|
|
18
18
|
position: absolute;
|
|
19
19
|
width: 0;
|
|
@@ -25,47 +25,15 @@
|
|
|
25
25
|
border-block-end: 16px solid transparent;
|
|
26
26
|
border-radius: 4px;
|
|
27
27
|
}
|
|
28
|
-
.aplus-check-card
|
|
29
|
-
outline: 2px solid
|
|
28
|
+
.aplus-check-card--checked {
|
|
29
|
+
outline: 2px solid var(--check-card-checked-outline-color);
|
|
30
30
|
}
|
|
31
|
-
.aplus-check-card
|
|
32
|
-
outline: 2px solid
|
|
31
|
+
.aplus-check-card--checked:hover {
|
|
32
|
+
outline: 2px solid var(--check-card-checked-outline-color);
|
|
33
33
|
}
|
|
34
|
-
.aplus-check-card
|
|
34
|
+
.aplus-check-card--checked::after {
|
|
35
35
|
opacity: 1;
|
|
36
|
-
border: 16px solid
|
|
37
|
-
border-inline-start: 16px solid transparent;
|
|
38
|
-
border-block-end: 16px solid transparent;
|
|
39
|
-
inset-block-start: -2px;
|
|
40
|
-
inset-inline-end: -2px;
|
|
41
|
-
transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
42
|
-
}
|
|
43
|
-
.aplus-check-card-admin:hover {
|
|
44
|
-
cursor: pointer;
|
|
45
|
-
outline: 1px solid #34b77c;
|
|
46
|
-
}
|
|
47
|
-
.aplus-check-card-admin::after {
|
|
48
|
-
content: '';
|
|
49
|
-
position: absolute;
|
|
50
|
-
width: 0px;
|
|
51
|
-
height: 0px;
|
|
52
|
-
opacity: 0;
|
|
53
|
-
inset-block-start: -2px;
|
|
54
|
-
inset-inline-end: -2px;
|
|
55
|
-
border-inline-start: 16px solid transparent;
|
|
56
|
-
border-block-end: 16px solid transparent;
|
|
57
|
-
border-radius: 4px;
|
|
58
|
-
}
|
|
59
|
-
.aplus-check-card-admin--checked {
|
|
60
|
-
outline: 2px solid #34b77c;
|
|
61
|
-
}
|
|
62
|
-
.aplus-check-card-admin--checked:hover {
|
|
63
|
-
outline: 2px solid #34b77c;
|
|
64
|
-
}
|
|
65
|
-
.aplus-check-card-admin--checked::after {
|
|
66
|
-
content: '';
|
|
67
|
-
opacity: 1;
|
|
68
|
-
border: 16px solid #34b77c;
|
|
36
|
+
border: 16px solid var(--check-card-checked-bg);
|
|
69
37
|
border-inline-start: 16px solid transparent;
|
|
70
38
|
border-block-end: 16px solid transparent;
|
|
71
39
|
inset-block-start: -2px;
|
|
@@ -30,7 +30,8 @@ const o = {
|
|
|
30
30
|
colorBgLayout: "#F2F6F9",
|
|
31
31
|
colorBgSpotlight: "#000000cc",
|
|
32
32
|
controlItemBgActive: "#F5F9FF",
|
|
33
|
-
controlItemBgActiveHover: "#EAF2FF"
|
|
33
|
+
controlItemBgActiveHover: "#EAF2FF",
|
|
34
|
+
colorBorderSecondary: "#E9EDF3"
|
|
34
35
|
}, c = {
|
|
35
36
|
...o,
|
|
36
37
|
// 主色
|
|
@@ -61,7 +62,8 @@ const o = {
|
|
|
61
62
|
colorBgLayout: "#FAFAFA",
|
|
62
63
|
colorBgSpotlight: "#000000cc",
|
|
63
64
|
controlItemBgActive: "#f3fbf7",
|
|
64
|
-
controlItemBgActiveHover: "#e6f6ef"
|
|
65
|
+
controlItemBgActiveHover: "#e6f6ef",
|
|
66
|
+
colorBorderSecondary: "#E9E9E9"
|
|
65
67
|
};
|
|
66
68
|
export {
|
|
67
69
|
c as adminToken,
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Table as
|
|
3
|
-
import { ApForm as
|
|
4
|
-
import { isNumber as
|
|
1
|
+
import { defineComponent as V, ref as x, unref as t, useSlots as A, watch as O, openBlock as C, createBlock as K, mergeProps as w, withCtx as m, createVNode as q, createSlots as H, createElementBlock as I, Fragment as W, createElementVNode as b, normalizeClass as $, toDisplayString as G, createCommentVNode as M, renderList as U, renderSlot as J, normalizeProps as Q, guardReactiveProps as X } from "vue";
|
|
2
|
+
import { Table as Y } from "ant-design-vue";
|
|
3
|
+
import { ApForm as y } from "../ap-form/index.mjs";
|
|
4
|
+
import { isNumber as u, cloneDeep as f, omit as Z } from "lodash-unified";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
|
-
import { useInjectForm as
|
|
6
|
+
import { useInjectForm as ee } from "../ap-form/context.mjs";
|
|
7
7
|
import "./style/index.css";
|
|
8
|
-
import { isDef as
|
|
9
|
-
import
|
|
10
|
-
import { scrollToRowIndex as
|
|
11
|
-
import { useNamespace as
|
|
12
|
-
|
|
13
|
-
const be = /* @__PURE__ */ A({
|
|
8
|
+
import { isDef as c } from "../utils/index.mjs";
|
|
9
|
+
import oe from "./hooks/use-get-columns.mjs";
|
|
10
|
+
import { scrollToRowIndex as te, getColumnIsRequired as ae } from "./utils.mjs";
|
|
11
|
+
import { useNamespace as ne } from "../config-provider/hooks/use-namespace.mjs";
|
|
12
|
+
const ge = /* @__PURE__ */ V({
|
|
14
13
|
name: "EditableTableInner",
|
|
15
14
|
__name: "form-item",
|
|
16
15
|
props: {
|
|
@@ -110,101 +109,101 @@ const be = /* @__PURE__ */ A({
|
|
|
110
109
|
default: () => ({})
|
|
111
110
|
}
|
|
112
111
|
},
|
|
113
|
-
setup(
|
|
114
|
-
expose:
|
|
112
|
+
setup(R, {
|
|
113
|
+
expose: B
|
|
115
114
|
}) {
|
|
116
|
-
var
|
|
117
|
-
const n =
|
|
115
|
+
var p;
|
|
116
|
+
const n = R, {
|
|
118
117
|
internalInstance: l,
|
|
119
|
-
model:
|
|
120
|
-
} =
|
|
121
|
-
|
|
118
|
+
model: D
|
|
119
|
+
} = ee(), r = x(((p = t(D)) == null ? void 0 : p[n.name]) || []), v = A(), F = y.useWatch(n.name);
|
|
120
|
+
O(() => F.value, (e) => {
|
|
122
121
|
var o;
|
|
123
122
|
r.value = e, (o = n.onChange) == null || o.call(n, e);
|
|
124
123
|
});
|
|
125
124
|
const {
|
|
126
|
-
b:
|
|
125
|
+
b: E,
|
|
127
126
|
em: L
|
|
128
|
-
} =
|
|
129
|
-
function
|
|
127
|
+
} = ne("editable-table"), i = x(), N = oe(n);
|
|
128
|
+
function k(e, o) {
|
|
130
129
|
var d;
|
|
131
130
|
const a = ((d = t(r)) == null ? void 0 : d.length) || 0;
|
|
132
|
-
if (
|
|
131
|
+
if (c(n.maxLength) && a >= n.maxLength)
|
|
133
132
|
return;
|
|
134
133
|
const s = [...t(r) || []];
|
|
135
|
-
|
|
134
|
+
c(o) ? s.splice(o, 0, {
|
|
136
135
|
...e || {}
|
|
137
136
|
}) : s.push({
|
|
138
137
|
...e || {}
|
|
139
138
|
}), l == null || l.setFieldValue(n.name, [...t(r) || [], e || {}]);
|
|
140
139
|
}
|
|
141
|
-
function
|
|
142
|
-
var
|
|
143
|
-
const a = ((
|
|
144
|
-
if (
|
|
140
|
+
function S(e, o = "suffix") {
|
|
141
|
+
var g;
|
|
142
|
+
const a = ((g = t(r)) == null ? void 0 : g.length) || 0, s = u(e) ? e : e.length;
|
|
143
|
+
if (c(n.maxLength) && a + s > n.maxLength)
|
|
145
144
|
return;
|
|
146
|
-
const d = [...t(r) || []],
|
|
147
|
-
o === "suffix" ? d.push(...
|
|
145
|
+
const d = [...t(r) || []], h = u(e) ? new Array(e).fill({}) : f(e);
|
|
146
|
+
o === "suffix" ? d.push(...h) : d.unshift(...h), l == null || l.setFieldValue(n.name, d);
|
|
148
147
|
}
|
|
149
|
-
function
|
|
148
|
+
function _(e) {
|
|
150
149
|
let o = f(t(r) || []);
|
|
151
|
-
const a =
|
|
150
|
+
const a = u(e) ? [e] : e;
|
|
152
151
|
o = o.filter((s, d) => !a.includes(d)), l == null || l.setFieldValue(n.name, o);
|
|
153
152
|
}
|
|
154
|
-
function
|
|
153
|
+
function T() {
|
|
155
154
|
return t(r);
|
|
156
155
|
}
|
|
157
|
-
function
|
|
156
|
+
function j(e) {
|
|
158
157
|
var o;
|
|
159
158
|
return (o = t(r)) == null ? void 0 : o[e];
|
|
160
159
|
}
|
|
161
|
-
function
|
|
160
|
+
function z(e, o) {
|
|
162
161
|
const a = f(t(r));
|
|
163
162
|
a[e] && (a[e] = {
|
|
164
163
|
...a[e],
|
|
165
164
|
...o
|
|
166
165
|
}, l == null || l.setFieldValue(n.name, [...a]));
|
|
167
166
|
}
|
|
168
|
-
function
|
|
167
|
+
function P(e, o) {
|
|
169
168
|
var s;
|
|
170
169
|
const a = e === "end" ? r.value.length - 1 : e;
|
|
171
|
-
|
|
170
|
+
te(a, (s = i.value) == null ? void 0 : s.$el, o);
|
|
172
171
|
}
|
|
173
|
-
return
|
|
174
|
-
add:
|
|
175
|
-
remove:
|
|
176
|
-
getRowData:
|
|
177
|
-
getRowsData:
|
|
178
|
-
setRowData:
|
|
179
|
-
addMultiple:
|
|
180
|
-
scrollTo:
|
|
181
|
-
}), (e, o) => (
|
|
172
|
+
return B({
|
|
173
|
+
add: k,
|
|
174
|
+
remove: _,
|
|
175
|
+
getRowData: j,
|
|
176
|
+
getRowsData: T,
|
|
177
|
+
setRowData: z,
|
|
178
|
+
addMultiple: S,
|
|
179
|
+
scrollTo: P
|
|
180
|
+
}), (e, o) => (C(), K(t(y).FormItem, w(e.formItem, {
|
|
182
181
|
name: e.name,
|
|
183
182
|
label: e.label
|
|
184
183
|
}), {
|
|
185
|
-
default:
|
|
186
|
-
class:
|
|
187
|
-
columns: t(
|
|
184
|
+
default: m(() => [q(t(Y), w(t(Z)(n, ["name", "maxLength", "onChange"]), {
|
|
185
|
+
class: t(E)(),
|
|
186
|
+
columns: t(N),
|
|
188
187
|
"data-source": r.value,
|
|
189
188
|
ref_key: "tableRef",
|
|
190
|
-
ref:
|
|
191
|
-
}),
|
|
192
|
-
headerCell:
|
|
189
|
+
ref: i
|
|
190
|
+
}), H({
|
|
191
|
+
headerCell: m(({
|
|
193
192
|
column: a
|
|
194
|
-
}) => [t(
|
|
193
|
+
}) => [t(ae)(a) ? (C(), I(W, {
|
|
195
194
|
key: 0
|
|
196
|
-
}, [
|
|
197
|
-
class:
|
|
198
|
-
}, "*", 2),
|
|
195
|
+
}, [b("span", {
|
|
196
|
+
class: $(t(L)("header-cell", "required"))
|
|
197
|
+
}, "*", 2), b("span", null, G(a.title), 1)], 64)) : M("", !0)]),
|
|
199
198
|
_: 2
|
|
200
|
-
}, [
|
|
199
|
+
}, [U(v, (a, s) => ({
|
|
201
200
|
name: s,
|
|
202
|
-
fn:
|
|
201
|
+
fn: m((d) => [J(e.$slots, s, Q(X(d || {})))])
|
|
203
202
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
204
203
|
_: 3
|
|
205
204
|
}, 16, ["name", "label"]));
|
|
206
205
|
}
|
|
207
206
|
});
|
|
208
207
|
export {
|
|
209
|
-
|
|
208
|
+
ge as default
|
|
210
209
|
};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { defineComponent as q, useSlots as
|
|
2
|
-
import { Table as
|
|
1
|
+
import { defineComponent as q, useSlots as H, ref as w, watch as U, unref as o, openBlock as y, createBlock as W, withCtx as c, createVNode as v, mergeProps as $, createSlots as G, createElementBlock as M, Fragment as J, createElementVNode as b, normalizeClass as Q, toDisplayString as X, createCommentVNode as Y, renderList as Z, renderSlot as ee, normalizeProps as te, guardReactiveProps as ae } from "vue";
|
|
2
|
+
import { Table as ne } from "ant-design-vue";
|
|
3
3
|
import { ApForm as f } from "../ap-form/index.mjs";
|
|
4
|
-
import { isNumber as p, cloneDeep as h, omit as
|
|
4
|
+
import { isNumber as p, cloneDeep as h, omit as oe } from "lodash-unified";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
6
|
import "../hooks/index.mjs";
|
|
7
7
|
import { isDef as x } from "../utils/index.mjs";
|
|
8
|
-
import { scrollToRowIndex as
|
|
9
|
-
import
|
|
8
|
+
import { scrollToRowIndex as le, getColumnIsRequired as re } from "./utils.mjs";
|
|
9
|
+
import se from "./hooks/use-get-columns.mjs";
|
|
10
10
|
import "./style/index.css";
|
|
11
|
-
import { useNamespace as
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
const Fe = /* @__PURE__ */ q({
|
|
11
|
+
import { useNamespace as ue } from "../config-provider/hooks/use-namespace.mjs";
|
|
12
|
+
import { useControllableValue as de } from "../hooks/useControllableValue.mjs";
|
|
13
|
+
const be = /* @__PURE__ */ q({
|
|
15
14
|
name: "EditableTable",
|
|
16
15
|
__name: "index",
|
|
17
16
|
props: {
|
|
@@ -110,32 +109,32 @@ const Fe = /* @__PURE__ */ q({
|
|
|
110
109
|
onFieldChange: {}
|
|
111
110
|
},
|
|
112
111
|
emits: ["update:value"],
|
|
113
|
-
setup(
|
|
114
|
-
expose:
|
|
115
|
-
emit:
|
|
112
|
+
setup(R, {
|
|
113
|
+
expose: B,
|
|
114
|
+
emit: F
|
|
116
115
|
}) {
|
|
117
|
-
const l =
|
|
118
|
-
b:
|
|
116
|
+
const l = R, {
|
|
117
|
+
b: D,
|
|
119
118
|
em: _
|
|
120
|
-
} =
|
|
119
|
+
} = ue("editable-table"), k = H(), E = F, g = w(), {
|
|
121
120
|
value: s,
|
|
122
|
-
updateValue:
|
|
123
|
-
} =
|
|
124
|
-
|
|
121
|
+
updateValue: L
|
|
122
|
+
} = de(l, E), u = w(), N = f.useWatch(l.name, u);
|
|
123
|
+
U(() => N.value, (e) => {
|
|
125
124
|
var a;
|
|
126
|
-
|
|
125
|
+
L(e), (a = l.onChange) == null || a.call(l, e);
|
|
127
126
|
});
|
|
128
|
-
const
|
|
129
|
-
function
|
|
127
|
+
const S = se(l);
|
|
128
|
+
function V() {
|
|
130
129
|
var e;
|
|
131
130
|
(e = u.value) == null || e.resetFields();
|
|
132
131
|
}
|
|
133
|
-
async function
|
|
132
|
+
async function T(e, a) {
|
|
134
133
|
var t;
|
|
135
134
|
const n = await ((t = u.value) == null ? void 0 : t.validateFields(e, a));
|
|
136
135
|
return n == null ? void 0 : n[l.name];
|
|
137
136
|
}
|
|
138
|
-
function
|
|
137
|
+
function z(e, a) {
|
|
139
138
|
var r, d, i;
|
|
140
139
|
const n = ((r = o(s)) == null ? void 0 : r.length) || 0;
|
|
141
140
|
if (x(l.maxLength) && n >= l.maxLength)
|
|
@@ -147,28 +146,28 @@ const Fe = /* @__PURE__ */ q({
|
|
|
147
146
|
...e || {}
|
|
148
147
|
}), (i = (d = u.value) == null ? void 0 : d.setFieldValue) == null || i.call(d, l.name, t);
|
|
149
148
|
}
|
|
150
|
-
function
|
|
151
|
-
var i, m,
|
|
149
|
+
function I(e, a = "suffix") {
|
|
150
|
+
var i, m, C;
|
|
152
151
|
const n = ((i = o(s)) == null ? void 0 : i.length) || 0, t = p(e) ? e : e.length;
|
|
153
152
|
if (x(l.maxLength) && n + t > l.maxLength)
|
|
154
153
|
return;
|
|
155
154
|
const r = [...o(s) || []], d = p(e) ? new Array(e).fill({}) : h(e);
|
|
156
|
-
a === "suffix" ? r.push(...d) : r.unshift(...d), (
|
|
155
|
+
a === "suffix" ? r.push(...d) : r.unshift(...d), (C = (m = u.value) == null ? void 0 : m.setFieldValue) == null || C.call(m, l.name, r);
|
|
157
156
|
}
|
|
158
|
-
function
|
|
157
|
+
function P(e) {
|
|
159
158
|
var t, r;
|
|
160
159
|
let a = h(o(s) || []);
|
|
161
160
|
const n = p(e) ? [e] : e;
|
|
162
161
|
a = a.filter((d, i) => !n.includes(i)), (r = (t = u.value) == null ? void 0 : t.setFieldValue) == null || r.call(t, l.name, a);
|
|
163
162
|
}
|
|
164
|
-
function
|
|
163
|
+
function j() {
|
|
165
164
|
return o(s);
|
|
166
165
|
}
|
|
167
|
-
function
|
|
166
|
+
function A(e) {
|
|
168
167
|
var a;
|
|
169
168
|
return (a = o(s)) == null ? void 0 : a[e];
|
|
170
169
|
}
|
|
171
|
-
function
|
|
170
|
+
function O(e, a) {
|
|
172
171
|
var t, r;
|
|
173
172
|
const n = h(o(s));
|
|
174
173
|
n[e] && (n[e] = {
|
|
@@ -176,22 +175,22 @@ const Fe = /* @__PURE__ */ q({
|
|
|
176
175
|
...a
|
|
177
176
|
}, (r = (t = u.value) == null ? void 0 : t.setFieldValue) == null || r.call(t, l.name, [...n]));
|
|
178
177
|
}
|
|
179
|
-
function
|
|
178
|
+
function K(e, a) {
|
|
180
179
|
var t;
|
|
181
180
|
const n = e === "end" ? s.value.length - 1 : e;
|
|
182
|
-
|
|
181
|
+
le(n, (t = g.value) == null ? void 0 : t.$el, a);
|
|
183
182
|
}
|
|
184
|
-
return
|
|
185
|
-
resetFields:
|
|
186
|
-
validateFields:
|
|
187
|
-
add:
|
|
188
|
-
remove:
|
|
189
|
-
getRowData:
|
|
190
|
-
getRowsData:
|
|
191
|
-
setRowData:
|
|
192
|
-
addMultiple:
|
|
193
|
-
scrollTo:
|
|
194
|
-
}), (e, a) => (
|
|
183
|
+
return B({
|
|
184
|
+
resetFields: V,
|
|
185
|
+
validateFields: T,
|
|
186
|
+
add: z,
|
|
187
|
+
remove: P,
|
|
188
|
+
getRowData: A,
|
|
189
|
+
getRowsData: j,
|
|
190
|
+
setRowData: O,
|
|
191
|
+
addMultiple: I,
|
|
192
|
+
scrollTo: K
|
|
193
|
+
}), (e, a) => (y(), W(o(f), {
|
|
195
194
|
"initial-values": {
|
|
196
195
|
[l.name]: o(s)
|
|
197
196
|
},
|
|
@@ -202,24 +201,24 @@ const Fe = /* @__PURE__ */ q({
|
|
|
202
201
|
name: e.name,
|
|
203
202
|
"no-style": ""
|
|
204
203
|
}, {
|
|
205
|
-
default: c(() => [v(o(
|
|
206
|
-
class:
|
|
207
|
-
columns: o(
|
|
204
|
+
default: c(() => [v(o(ne), $(o(oe)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange"]), {
|
|
205
|
+
class: o(D)(),
|
|
206
|
+
columns: o(S),
|
|
208
207
|
"data-source": o(s),
|
|
209
208
|
ref_key: "tableRef",
|
|
210
|
-
ref:
|
|
211
|
-
}),
|
|
209
|
+
ref: g
|
|
210
|
+
}), G({
|
|
212
211
|
headerCell: c(({
|
|
213
212
|
column: n
|
|
214
|
-
}) => [o(
|
|
213
|
+
}) => [o(re)(n) ? (y(), M(J, {
|
|
215
214
|
key: 0
|
|
216
|
-
}, [
|
|
217
|
-
class:
|
|
218
|
-
}, "*", 2),
|
|
215
|
+
}, [b("span", {
|
|
216
|
+
class: Q(o(_)("header-cell", "required"))
|
|
217
|
+
}, "*", 2), b("span", null, X(n.title), 1)], 64)) : Y("", !0)]),
|
|
219
218
|
_: 2
|
|
220
|
-
}, [
|
|
219
|
+
}, [Z(k, (n, t) => ({
|
|
221
220
|
name: t,
|
|
222
|
-
fn: c((r) => [
|
|
221
|
+
fn: c((r) => [ee(e.$slots, t, te(ae(r || {})))])
|
|
223
222
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
224
223
|
_: 3
|
|
225
224
|
}, 8, ["name"])]),
|
|
@@ -228,5 +227,5 @@ const Fe = /* @__PURE__ */ q({
|
|
|
228
227
|
}
|
|
229
228
|
});
|
|
230
229
|
export {
|
|
231
|
-
|
|
230
|
+
be as default
|
|
232
231
|
};
|
|
@@ -12,31 +12,11 @@
|
|
|
12
12
|
flex: 1;
|
|
13
13
|
}
|
|
14
14
|
.aplus-editable-table tr > th.ant-table-cell {
|
|
15
|
-
background-color:
|
|
16
|
-
border-bottom-color: #E9EDF3;
|
|
15
|
+
background-color: var(--ap-table-header-bg);
|
|
17
16
|
}
|
|
18
17
|
.aplus-editable-table tr > th.ant-table-cell::before {
|
|
19
18
|
display: none;
|
|
20
19
|
}
|
|
21
|
-
.aplus-editable-table tr > td.ant-table-cell {
|
|
22
|
-
border-top-color: #E9EDF3;
|
|
23
|
-
}
|
|
24
|
-
.aplus-editable-table-admin .ant-pagination {
|
|
25
|
-
margin-bottom: 0 !important;
|
|
26
|
-
}
|
|
27
|
-
.aplus-editable-table-admin .ant-pagination .ant-pagination-total-text {
|
|
28
|
-
flex: 1;
|
|
29
|
-
}
|
|
30
|
-
.aplus-editable-table-admin tr > th.ant-table-cell {
|
|
31
|
-
background-color: #FAFAFA;
|
|
32
|
-
border-bottom-color: #E9E9E9;
|
|
33
|
-
}
|
|
34
|
-
.aplus-editable-table-admin tr > th.ant-table-cell::before {
|
|
35
|
-
display: none;
|
|
36
|
-
}
|
|
37
|
-
.aplus-editable-table-admin tr > td.ant-table-cell {
|
|
38
|
-
border-top-color: #E9E9E9;
|
|
39
|
-
}
|
|
40
20
|
.aplus-editable-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell:has(.is-editable) {
|
|
41
21
|
padding: 20px 16px 0px;
|
|
42
22
|
}
|
|
@@ -99,7 +99,7 @@ const e = {
|
|
|
99
99
|
uploadFile: "上传文件",
|
|
100
100
|
fileInitializationException: "文件初始化个数超过{maxCount}个,后续上传的文件会与数据不同步",
|
|
101
101
|
maxUploadFiles: "最多上传{maxCount}个文件",
|
|
102
|
-
maxUploadPicture: "最多上传{maxCount}
|
|
102
|
+
maxUploadPicture: "最多上传{maxCount}张图片",
|
|
103
103
|
maxUploadFileSize: "文件大小不超过{maxSize}MB",
|
|
104
104
|
maxWarnUploadFileSize: "文件大小小于{maxSize}MB",
|
|
105
105
|
maxUploadPictureSize: "图片大小小于{maxSize}MB",
|