@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.
Files changed (57) hide show
  1. package/es/src/ap-action/item/index.vue2.mjs +19 -20
  2. package/es/src/ap-action/item-modal/index.vue.mjs +7 -6
  3. package/es/src/ap-action/style/item.css +10 -25
  4. package/es/src/ap-field/checkbox/index.vue.mjs +32 -27
  5. package/es/src/ap-field/checkbox/style.css +7 -0
  6. package/es/src/ap-field/interface.d.ts +2 -0
  7. package/es/src/ap-field/radio/index.vue.d.ts +3 -0
  8. package/es/src/ap-field/radio/index.vue.mjs +44 -29
  9. package/es/src/ap-field/radio/style.css +4 -0
  10. package/es/src/ap-table/ap-table.vue.mjs +125 -126
  11. package/es/src/ap-table/constants.d.ts +15 -0
  12. package/es/src/ap-table/style/ap-table.css +1 -21
  13. package/es/src/business/ap-status/ApStatusGroup.vue2.mjs +10 -9
  14. package/es/src/check-card/index.vue2.mjs +44 -48
  15. package/es/src/check-card/style/index.css +10 -42
  16. package/es/src/design-token/index.mjs +4 -2
  17. package/es/src/editable-table/form-item.vue.mjs +57 -58
  18. package/es/src/editable-table/index.vue.mjs +54 -55
  19. package/es/src/editable-table/style/index.css +1 -21
  20. package/es/src/locale/lang/en.mjs +1 -1
  21. package/es/src/locale/lang/zh-cn.mjs +22 -22
  22. package/es/src/theme/ap-action/item.css +10 -25
  23. package/es/src/theme/ap-field/checkbox.css +7 -0
  24. package/es/src/theme/ap-field/radio.css +4 -0
  25. package/es/src/theme/ap-table/ap-table.css +1 -21
  26. package/es/src/theme/check-card/index.css +10 -42
  27. package/es/src/theme/css-var/index.mjs +83 -19
  28. package/es/src/theme/editable-table/index.css +1 -21
  29. package/lib/src/ap-action/item/index.vue2.js +1 -1
  30. package/lib/src/ap-action/item-modal/index.vue.js +1 -1
  31. package/lib/src/ap-action/style/item.css +10 -25
  32. package/lib/src/ap-field/checkbox/index.vue.js +1 -1
  33. package/lib/src/ap-field/checkbox/style.css +7 -0
  34. package/lib/src/ap-field/interface.d.ts +2 -0
  35. package/lib/src/ap-field/radio/index.vue.d.ts +3 -0
  36. package/lib/src/ap-field/radio/index.vue.js +1 -1
  37. package/lib/src/ap-field/radio/style.css +4 -0
  38. package/lib/src/ap-table/ap-table.vue.js +1 -1
  39. package/lib/src/ap-table/constants.d.ts +15 -0
  40. package/lib/src/ap-table/style/ap-table.css +1 -21
  41. package/lib/src/business/ap-status/ApStatusGroup.vue2.js +1 -1
  42. package/lib/src/check-card/index.vue2.js +1 -1
  43. package/lib/src/check-card/style/index.css +10 -42
  44. package/lib/src/design-token/index.js +1 -1
  45. package/lib/src/editable-table/form-item.vue.js +1 -1
  46. package/lib/src/editable-table/index.vue.js +1 -1
  47. package/lib/src/editable-table/style/index.css +1 -21
  48. package/lib/src/locale/lang/en.js +1 -1
  49. package/lib/src/locale/lang/zh-cn.js +1 -1
  50. package/lib/src/theme/ap-action/item.css +10 -25
  51. package/lib/src/theme/ap-field/checkbox.css +7 -0
  52. package/lib/src/theme/ap-field/radio.css +4 -0
  53. package/lib/src/theme/ap-table/ap-table.css +1 -21
  54. package/lib/src/theme/check-card/index.css +10 -42
  55. package/lib/src/theme/css-var/index.js +1 -1
  56. package/lib/src/theme/editable-table/index.css +1 -21
  57. package/package.json +2 -2
@@ -1,15 +1,14 @@
1
- import { defineComponent as I, computed as i, unref as l, createVNode as m, watch as U, watchEffect as W, openBlock as c, createElementBlock as N, normalizeStyle as j, normalizeClass as P, withModifiers as G, createBlock as f, renderSlot as O, resolveDynamicComponent as V, createCommentVNode as v, createElementVNode as $ } from "vue";
2
- import { Skeleton as q } from "ant-design-vue";
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 z } from "lodash-unified";
6
- import { useInjectCheckCard as A } from "./context.mjs";
5
+ import { isFunction as V } from "lodash-unified";
6
+ import { useInjectCheckCard as $ } from "./context.mjs";
7
7
  import "./style/index.css";
8
- import H from "./checked.svg.mjs";
9
- import { useNamespace as J } from "../config-provider/hooks/use-namespace.mjs";
10
- import { useGlobalConfig as K } from "../config-provider/hooks/use-global-config.mjs";
11
- import { useControllableValue as L } from "../hooks/useControllableValue.mjs";
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(S, {
52
- emit: _
50
+ setup(z, {
51
+ emit: S
53
52
  }) {
54
- const o = S, {
53
+ const o = z, {
55
54
  b: g,
56
- m: s,
55
+ m: c,
57
56
  e: p,
58
- bm: w,
57
+ bm: J,
59
58
  em: k
60
- } = J("check-card"), h = K("uiMode", "aplus"), D = _, n = A(), {
59
+ } = A("check-card"), _ = S, n = $(), {
61
60
  value: r,
62
- updateValue: b
63
- } = L(o, D, {
61
+ updateValue: h
62
+ } = G(o, _, {
64
63
  valuePropName: "checked",
65
64
  defaultValuePropName: "defaultChecked"
66
- }), a = i(() => {
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
- }), E = i(() => {
72
- const e = l(h), t = l(a);
73
- return [g(), ...t.disabled ? [] : [g(e), l(r) ? w(e, "checked") : null], s(t.size), t.bordered ? s("bordered") : null, t.disabled ? s("disabled") : null];
74
- }), M = i(() => ({
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 = z(o.title) ? o.title(l(r)) : m("span", null, [o.title]);
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
- }), C = i(() => {
80
+ }), y = s(() => {
85
81
  if (!o.content)
86
82
  return;
87
- const e = z(o.content) ? o.content(l(r)) : o.content;
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 F(e) {
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) : b(!l(r)));
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 U(() => n.value, (e) => {
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
- b(t);
100
+ h(t);
105
101
  }, {
106
102
  immediate: !0
107
- }), W((e) => {
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, B;
111
- return (B = (u = n.value) == null ? void 0 : u.cancelValue) == null ? void 0 : B.call(u, o.value);
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) => (c(), N("div", {
114
- style: j(M.value),
115
- class: P(E.value),
116
- onClick: G(F, ["stop"])
117
- }, [a.value.loading ? (c(), f(l(q), {
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
- }, () => [y.value ? (c(), f(V(y.value), {
119
+ }, () => [b.value ? (i(), f(P(b.value), {
124
120
  key: 0
125
- })) : v("", !0), C.value ? (c(), f(V(C.value), {
121
+ })) : v("", !0), y.value ? (i(), f(P(y.value), {
126
122
  key: 1
127
- })) : v("", !0)]), l(r) ? (c(), N("div", {
123
+ })) : v("", !0)]), l(r) ? (i(), B("div", {
128
124
  key: 2,
129
- class: P(l(p)("checked-icon"))
130
- }, [$("img", {
131
- src: l(H)
132
- }, null, 8, Q)], 2)) : v("", !0)], 6));
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
- re as default
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-border-color);
10
+ outline: 1px solid var(--check-card-outline-color);
11
11
  }
12
- .aplus-check-card-aplus:hover {
12
+ .aplus-check-card:hover {
13
13
  cursor: pointer;
14
- outline: 1px solid #0070ff;
14
+ outline: 1px solid var(--check-card-hover-outline-color);
15
15
  }
16
- .aplus-check-card-aplus::after {
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-aplus--checked {
29
- outline: 2px solid #0070ff;
28
+ .aplus-check-card--checked {
29
+ outline: 2px solid var(--check-card-checked-outline-color);
30
30
  }
31
- .aplus-check-card-aplus--checked:hover {
32
- outline: 2px solid #0070ff;
31
+ .aplus-check-card--checked:hover {
32
+ outline: 2px solid var(--check-card-checked-outline-color);
33
33
  }
34
- .aplus-check-card-aplus--checked::after {
34
+ .aplus-check-card--checked::after {
35
35
  opacity: 1;
36
- border: 16px solid #0070ff;
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 A, ref as C, unref as t, useSlots as O, watch as K, openBlock as b, createBlock as M, mergeProps as w, withCtx as u, createVNode as q, createSlots as G, createElementBlock as H, Fragment as I, createElementVNode as y, normalizeClass as W, toDisplayString as $, createCommentVNode as U, renderList as J, renderSlot as Q, normalizeProps as X, guardReactiveProps as Y } from "vue";
2
- import { Table as Z } from "ant-design-vue";
3
- import { ApForm as R } from "../ap-form/index.mjs";
4
- import { isNumber as m, cloneDeep as f, omit as ee } from "lodash-unified";
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 oe } from "../ap-form/context.mjs";
6
+ import { useInjectForm as ee } from "../ap-form/context.mjs";
7
7
  import "./style/index.css";
8
- import { isDef as i } from "../utils/index.mjs";
9
- import te from "./hooks/use-get-columns.mjs";
10
- import { scrollToRowIndex as ae, getColumnIsRequired as ne } from "./utils.mjs";
11
- import { useNamespace as le } from "../config-provider/hooks/use-namespace.mjs";
12
- import { useGlobalConfig as re } from "../config-provider/hooks/use-global-config.mjs";
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(B, {
114
- expose: D
112
+ setup(R, {
113
+ expose: B
115
114
  }) {
116
- var h;
117
- const n = B, {
115
+ var p;
116
+ const n = R, {
118
117
  internalInstance: l,
119
- model: v
120
- } = oe(), r = C(((h = t(v)) == null ? void 0 : h[n.name]) || []), F = O(), E = R.useWatch(n.name);
121
- K(() => E.value, (e) => {
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: c,
125
+ b: E,
127
126
  em: L
128
- } = le("editable-table"), N = re("uiMode", "aplus"), p = C(), k = te(n);
129
- function S(e, o) {
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 (i(n.maxLength) && a >= n.maxLength)
131
+ if (c(n.maxLength) && a >= n.maxLength)
133
132
  return;
134
133
  const s = [...t(r) || []];
135
- i(o) ? s.splice(o, 0, {
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 _(e, o = "suffix") {
142
- var x;
143
- const a = ((x = t(r)) == null ? void 0 : x.length) || 0, s = m(e) ? e : e.length;
144
- if (i(n.maxLength) && a + s > n.maxLength)
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) || []], g = m(e) ? new Array(e).fill({}) : f(e);
147
- o === "suffix" ? d.push(...g) : d.unshift(...g), l == null || l.setFieldValue(n.name, d);
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 T(e) {
148
+ function _(e) {
150
149
  let o = f(t(r) || []);
151
- const a = m(e) ? [e] : e;
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 j() {
153
+ function T() {
155
154
  return t(r);
156
155
  }
157
- function z(e) {
156
+ function j(e) {
158
157
  var o;
159
158
  return (o = t(r)) == null ? void 0 : o[e];
160
159
  }
161
- function P(e, o) {
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 V(e, o) {
167
+ function P(e, o) {
169
168
  var s;
170
169
  const a = e === "end" ? r.value.length - 1 : e;
171
- ae(a, (s = p.value) == null ? void 0 : s.$el, o);
170
+ te(a, (s = i.value) == null ? void 0 : s.$el, o);
172
171
  }
173
- return D({
174
- add: S,
175
- remove: T,
176
- getRowData: z,
177
- getRowsData: j,
178
- setRowData: P,
179
- addMultiple: _,
180
- scrollTo: V
181
- }), (e, o) => (b(), M(t(R).FormItem, w(e.formItem, {
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: u(() => [q(t(Z), w(t(ee)(n, ["name", "maxLength", "onChange"]), {
186
- class: [t(c)(), t(N) === "admin" ? t(c)("admin") : null],
187
- columns: t(k),
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: p
191
- }), G({
192
- headerCell: u(({
189
+ ref: i
190
+ }), H({
191
+ headerCell: m(({
193
192
  column: a
194
- }) => [t(ne)(a) ? (b(), H(I, {
193
+ }) => [t(ae)(a) ? (C(), I(W, {
195
194
  key: 0
196
- }, [y("span", {
197
- class: W(t(L)("header-cell", "required"))
198
- }, "*", 2), y("span", null, $(a.title), 1)], 64)) : U("", !0)]),
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
- }, [J(F, (a, s) => ({
199
+ }, [U(v, (a, s) => ({
201
200
  name: s,
202
- fn: u((d) => [Q(e.$slots, s, X(Y(d || {})))])
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
- be as default
208
+ ge as default
210
209
  };
@@ -1,17 +1,16 @@
1
- import { defineComponent as q, useSlots as G, ref as y, watch as H, unref as o, openBlock as b, createBlock as U, withCtx as c, createVNode as v, mergeProps as W, createSlots as $, createElementBlock as J, Fragment as Q, createElementVNode as R, normalizeClass as X, toDisplayString as Y, createCommentVNode as Z, renderList as ee, renderSlot as te, normalizeProps as ae, guardReactiveProps as ne } from "vue";
2
- import { Table as oe } from "ant-design-vue";
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 le } from "lodash-unified";
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 re, getColumnIsRequired as se } from "./utils.mjs";
9
- import ue from "./hooks/use-get-columns.mjs";
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 de } from "../config-provider/hooks/use-namespace.mjs";
12
- import { useGlobalConfig as ie } from "../config-provider/hooks/use-global-config.mjs";
13
- import { useControllableValue as me } from "../hooks/useControllableValue.mjs";
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(B, {
114
- expose: F,
115
- emit: D
112
+ setup(R, {
113
+ expose: B,
114
+ emit: F
116
115
  }) {
117
- const l = B, {
118
- b: g,
116
+ const l = R, {
117
+ b: D,
119
118
  em: _
120
- } = de("editable-table"), k = ie("uiMode", "aplus"), E = G(), L = D, C = y(), {
119
+ } = ue("editable-table"), k = H(), E = F, g = w(), {
121
120
  value: s,
122
- updateValue: N
123
- } = me(l, L), u = y(), S = f.useWatch(l.name, u);
124
- H(() => S.value, (e) => {
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
- N(e), (a = l.onChange) == null || a.call(l, e);
125
+ L(e), (a = l.onChange) == null || a.call(l, e);
127
126
  });
128
- const V = ue(l);
129
- function T() {
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 z(e, a) {
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 I(e, a) {
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 P(e, a = "suffix") {
151
- var i, m, w;
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), (w = (m = u.value) == null ? void 0 : m.setFieldValue) == null || w.call(m, l.name, r);
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 j(e) {
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 A() {
163
+ function j() {
165
164
  return o(s);
166
165
  }
167
- function O(e) {
166
+ function A(e) {
168
167
  var a;
169
168
  return (a = o(s)) == null ? void 0 : a[e];
170
169
  }
171
- function K(e, a) {
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 M(e, a) {
178
+ function K(e, a) {
180
179
  var t;
181
180
  const n = e === "end" ? s.value.length - 1 : e;
182
- re(n, (t = C.value) == null ? void 0 : t.$el, a);
181
+ le(n, (t = g.value) == null ? void 0 : t.$el, a);
183
182
  }
184
- return F({
185
- resetFields: T,
186
- validateFields: z,
187
- add: I,
188
- remove: j,
189
- getRowData: O,
190
- getRowsData: A,
191
- setRowData: K,
192
- addMultiple: P,
193
- scrollTo: M
194
- }), (e, a) => (b(), U(o(f), {
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(oe), W(o(le)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange"]), {
206
- class: [o(g)(), o(k) === "admin" ? o(g)("admin") : null],
207
- columns: o(V),
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: C
211
- }), $({
209
+ ref: g
210
+ }), G({
212
211
  headerCell: c(({
213
212
  column: n
214
- }) => [o(se)(n) ? (b(), J(Q, {
213
+ }) => [o(re)(n) ? (y(), M(J, {
215
214
  key: 0
216
- }, [R("span", {
217
- class: X(o(_)("header-cell", "required"))
218
- }, "*", 2), R("span", null, Y(n.title), 1)], 64)) : Z("", !0)]),
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
- }, [ee(E, (n, t) => ({
219
+ }, [Z(k, (n, t) => ({
221
220
  name: t,
222
- fn: c((r) => [te(e.$slots, t, ae(ne(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
- Fe as default
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: #F2F6F9;
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",