@aplus-frontend/ui 0.0.22 → 0.0.24

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 (41) hide show
  1. package/es/src/ap-field/date/index.vue.mjs +26 -26
  2. package/es/src/ap-field/number/helper.d.ts +9 -0
  3. package/es/src/ap-field/number/helper.mjs +20 -11
  4. package/es/src/ap-table/ap-table.vue.d.ts +2137 -112
  5. package/es/src/ap-table/ap-table.vue.mjs +31 -30
  6. package/es/src/check-card/group.vue.d.ts +1 -1
  7. package/es/src/check-card/group.vue.mjs +1 -1
  8. package/es/src/check-card/index.vue.d.ts +1 -1
  9. package/es/src/check-card/index.vue2.mjs +40 -36
  10. package/es/src/check-card/interface.d.ts +1 -1
  11. package/es/src/check-card/style/index.css +1 -0
  12. package/es/src/editable-table/form-item.vue.d.ts +755 -105
  13. package/es/src/editable-table/form-item.vue.mjs +80 -65
  14. package/es/src/editable-table/hooks/use-get-columns.mjs +27 -27
  15. package/es/src/editable-table/index.vue.d.ts +527 -112
  16. package/es/src/editable-table/index.vue.mjs +93 -78
  17. package/es/src/editable-table/interface.d.ts +11 -5
  18. package/es/src/editable-table/utils.d.ts +13 -0
  19. package/es/src/editable-table/utils.mjs +26 -6
  20. package/es/src/theme/check-card/index.css +1 -0
  21. package/lib/src/ap-field/date/index.vue.js +1 -1
  22. package/lib/src/ap-field/number/helper.d.ts +9 -0
  23. package/lib/src/ap-field/number/helper.js +1 -1
  24. package/lib/src/ap-table/ap-table.vue.d.ts +2137 -112
  25. package/lib/src/ap-table/ap-table.vue.js +1 -1
  26. package/lib/src/check-card/group.vue.d.ts +1 -1
  27. package/lib/src/check-card/group.vue.js +1 -1
  28. package/lib/src/check-card/index.vue.d.ts +1 -1
  29. package/lib/src/check-card/index.vue2.js +1 -1
  30. package/lib/src/check-card/interface.d.ts +1 -1
  31. package/lib/src/check-card/style/index.css +1 -0
  32. package/lib/src/editable-table/form-item.vue.d.ts +755 -105
  33. package/lib/src/editable-table/form-item.vue.js +1 -1
  34. package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
  35. package/lib/src/editable-table/index.vue.d.ts +527 -112
  36. package/lib/src/editable-table/index.vue.js +1 -1
  37. package/lib/src/editable-table/interface.d.ts +11 -5
  38. package/lib/src/editable-table/utils.d.ts +13 -0
  39. package/lib/src/editable-table/utils.js +1 -1
  40. package/lib/src/theme/check-card/index.css +1 -0
  41. package/package.json +5 -5
@@ -1,21 +1,22 @@
1
- import { defineComponent as ae, useSlots as te, computed as s, createVNode as d, mergeProps as f, unref as l, watch as oe, openBlock as i, createElementBlock as m, normalizeClass as F, normalizeStyle as R, createSlots as k, withCtx as p, Fragment as re, renderList as L, createBlock as le, resolveDynamicComponent as ne, renderSlot as x, createCommentVNode as E, createElementVNode as O, toDisplayString as se, normalizeProps as de, guardReactiveProps as ue } from "vue";
1
+ import { defineComponent as ae, useSlots as te, computed as s, createVNode as d, mergeProps as f, unref as l, watch as oe, openBlock as i, createElementBlock as m, normalizeClass as F, normalizeStyle as R, createSlots as k, withCtx as p, Fragment as re, renderList as L, createBlock as le, resolveDynamicComponent as ne, renderSlot as w, createCommentVNode as E, createElementVNode as O, toDisplayString as se, normalizeProps as de, guardReactiveProps as ue } from "vue";
2
2
  import { Typography as ie, Table as pe, Tooltip as ce } from "ant-design-vue";
3
3
  import { useToken as fe } from "ant-design-vue/es/theme/internal";
4
4
  import { ApForm as me } from "../ap-form/index.mjs";
5
- import { apTableRenderItemMap as ge, noRenderAsFormItemValueList as z, apTableFormItemMap as ye } from "./constants.mjs";
5
+ import { apTableRenderItemMap as ge, noRenderAsFormItemValueList as V, apTableFormItemMap as ye } from "./constants.mjs";
6
6
  import "../config-provider/index.mjs";
7
7
  import { useTablePaging as be } from "./hooks/use-table-paging.mjs";
8
- import { omit as N, isUndefined as T, isBoolean as he } from "lodash-unified";
8
+ import { omit as z, isUndefined as x, isBoolean as he } from "lodash-unified";
9
9
  import "./style/ap-table.css";
10
10
  import { QuestionCircleOutlined as Ce } from "@ant-design/icons-vue";
11
- import { apColumnToColumn as Se, getTableRenderType as Fe, getTableRenderProps as Re, getColumnOrder as V, updateFormProps as xe, getFieldProps as Te, getPlaceholder as we } from "./utils.mjs";
11
+ import { apColumnToColumn as Se, getTableRenderType as Fe, getTableRenderProps as Re, getColumnOrder as N, updateFormProps as we, getFieldProps as xe, getPlaceholder as Te } from "./utils.mjs";
12
12
  import Be from "./hooks/use-table-content-height.mjs";
13
- import { useLocale as Pe } from "../config-provider/hooks/use-locale.mjs";
14
- import { useNamespace as ve } from "../config-provider/hooks/use-namespace.mjs";
15
- import { useGlobalConfig as Ie } from "../config-provider/hooks/use-global-config.mjs";
16
- const ke = {
13
+ import { getRawDisplayValue as Pe } from "../editable-table/utils.mjs";
14
+ import { useLocale as ve } from "../config-provider/hooks/use-locale.mjs";
15
+ import { useNamespace as Ie } from "../config-provider/hooks/use-namespace.mjs";
16
+ import { useGlobalConfig as ke } from "../config-provider/hooks/use-global-config.mjs";
17
+ const Le = {
17
18
  key: 0
18
- }, $e = /* @__PURE__ */ ae({
19
+ }, Qe = /* @__PURE__ */ ae({
19
20
  name: "ApTable",
20
21
  __name: "ap-table",
21
22
  props: {
@@ -132,19 +133,19 @@ const ke = {
132
133
  setup(D, {
133
134
  expose: W
134
135
  }) {
135
- const o = D, w = te(), [, j] = fe(), {
136
+ const o = D, T = te(), [, j] = fe(), {
136
137
  t: _
137
- } = Pe(), {
138
+ } = ve(), {
138
139
  e: g,
139
140
  b: u
140
- } = ve("ap-table"), A = Ie("uiMode", "aplus"), {
141
+ } = Ie("ap-table"), A = ke("uiMode", "aplus"), {
141
142
  height: M,
142
143
  contentRef: q
143
144
  } = Be(), y = s(() => {
144
145
  var t;
145
146
  let e = ((t = o.columns) == null ? void 0 : t.filter((a) => !a.hideInTable)) || [];
146
147
  return e = e.map((a) => ({
147
- ...N(Se(a), ["ellipsis"]),
148
+ ...z(Se(a), ["ellipsis"]),
148
149
  customRender({
149
150
  value: r,
150
151
  ...n
@@ -166,11 +167,11 @@ const ke = {
166
167
  })), e;
167
168
  }), B = s(() => {
168
169
  var e, t, a;
169
- return ((a = (t = (e = o.columns) == null ? void 0 : e.filter((r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !z.includes(r.valueType))) == null ? void 0 : t.sort((r, n) => {
170
- let C = V(r.order);
171
- return V(n.order) - C;
170
+ return ((a = (t = (e = o.columns) == null ? void 0 : e.filter((r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !V.includes(r.valueType))) == null ? void 0 : t.sort((r, n) => {
171
+ let C = N(r.order);
172
+ return N(n.order) - C;
172
173
  })) == null ? void 0 : a.map((r) => {
173
- const n = xe(r, Te(r.fieldProps, {}));
174
+ const n = we(r, xe(r.fieldProps, {}));
174
175
  return {
175
176
  ...r,
176
177
  fieldProps: {
@@ -178,7 +179,7 @@ const ke = {
178
179
  name: r.dataIndex,
179
180
  ...n || {},
180
181
  // 格式化placeholder
181
- placeholder: we(_, r.valueType, n == null ? void 0 : n.placeholder)
182
+ placeholder: Te(_, r.valueType, n == null ? void 0 : n.placeholder)
182
183
  }
183
184
  };
184
185
  })) || [];
@@ -221,7 +222,7 @@ const ke = {
221
222
  if ((e = o.columns) != null && e.some((t) => t.ellipsis))
222
223
  return "fixed";
223
224
  }), U = s(() => {
224
- const e = l(c), t = T(o.dataSource) ? e : {
225
+ const e = l(c), t = x(o.dataSource) ? e : {
225
226
  ...e,
226
227
  dataSource: o.dataSource,
227
228
  onChange: o.onChange
@@ -229,13 +230,13 @@ const ke = {
229
230
  return {
230
231
  ...o,
231
232
  ...t,
232
- loading: T(o.loading) ? l(c).loading : o.loading,
233
+ loading: x(o.loading) ? l(c).loading : o.loading,
233
234
  pagination: o.pagination === !1 ? !1 : l(c).pagination,
234
235
  scroll: l(G)
235
236
  };
236
237
  }), J = s(() => [u(), o.card ? null : u("wrapper"), o.adaptive ? u("adaptive") : null].filter(Boolean));
237
238
  function X(e, t, a) {
238
- return z.includes(e.valueType) ? a : e.copyable || e.ellipsis ? d(ie.Paragraph, {
239
+ return V.includes(e.valueType) ? a : e.copyable || e.ellipsis ? d(ie.Paragraph, {
239
240
  copyable: e.copyable ? {
240
241
  text: t,
241
242
  tooltip: !1
@@ -246,7 +247,7 @@ const ke = {
246
247
  ...e.ellipsis,
247
248
  tooltip: t
248
249
  } : !1,
249
- content: e.ellipsis ? t : a
250
+ content: e.ellipsis ? Pe(e, t) : a
250
251
  }, null) : a;
251
252
  }
252
253
  oe(() => l(h).loading, (e) => {
@@ -269,7 +270,7 @@ const ke = {
269
270
  dataSource: s(() => l(h).records)
270
271
  }), (e, t) => (i(), m("div", {
271
272
  class: F(J.value)
272
- }, [l(T)(e.dataSource) && e.searchForm !== !1 && B.value.length > 0 ? (i(), m("div", {
273
+ }, [l(x)(e.dataSource) && e.searchForm !== !1 && B.value.length > 0 ? (i(), m("div", {
273
274
  key: 0,
274
275
  class: F(e.card ? l(g)("search-wrapper") : null),
275
276
  style: R(e.searchFormWrapperStyle)
@@ -288,16 +289,16 @@ const ke = {
288
289
  span: a.span
289
290
  }), null, 16, ["span"]))), 128))]),
290
291
  _: 2
291
- }, [w.searchFormExtra ? {
292
+ }, [T.searchFormExtra ? {
292
293
  name: "extra",
293
- fn: p(() => [x(e.$slots, "searchFormExtra")]),
294
+ fn: p(() => [w(e.$slots, "searchFormExtra")]),
294
295
  key: "0"
295
296
  } : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : E("", !0), O("div", {
296
297
  ref_key: "contentRef",
297
298
  ref: q,
298
299
  class: F([l(g)("table-wrapper"), e.card ? l(g)("table-wrapper-card") : null]),
299
300
  style: R(e.tableWrapperStyle)
300
- }, [x(e.$slots, "title"), d(l(pe), f({
301
+ }, [w(e.$slots, "title"), d(l(pe), f({
301
302
  class: l(A) === "admin" ? l(u)("table-admin") : l(u)("table")
302
303
  }, U.value, {
303
304
  "table-layout": Q.value,
@@ -307,7 +308,7 @@ const ke = {
307
308
  headerCell: p(({
308
309
  column: a,
309
310
  title: r
310
- }) => [a.tooltip ? (i(), m("span", ke, [O("span", null, se(r), 1), d(l(ce), {
311
+ }) => [a.tooltip ? (i(), m("span", Le, [O("span", null, se(r), 1), d(l(ce), {
311
312
  title: a.tooltip,
312
313
  placement: "bottom"
313
314
  }, {
@@ -320,12 +321,12 @@ const ke = {
320
321
  _: 2
321
322
  }, 1032, ["title"])])) : E("", !0)]),
322
323
  _: 2
323
- }, [L(l(N)(w, ["title", "searchFormExtra"]), (a, r) => ({
324
+ }, [L(l(z)(T, ["title", "searchFormExtra"]), (a, r) => ({
324
325
  name: r,
325
- fn: p((n) => [x(e.$slots, r, de(ue(n || {})))])
326
+ fn: p((n) => [w(e.$slots, r, de(ue(n || {})))])
326
327
  }))]), 1040, ["class", "table-layout", "onChange", "columns"])], 6)], 2));
327
328
  }
328
329
  });
329
330
  export {
330
- $e as default
331
+ Qe as default
331
332
  };
@@ -28,7 +28,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
28
28
  size: "small" | "middle";
29
29
  value: CheckCardValueType | CheckCardValueType[];
30
30
  bordered: boolean;
31
- stopPropagation: boolean;
31
+ stopPropagation: boolean | ((event: MouseEvent) => boolean);
32
32
  }, {}>, {
33
33
  default?(_: {}): any;
34
34
  }>;
@@ -11,7 +11,7 @@ const z = /* @__PURE__ */ g({
11
11
  disabled: { type: Boolean, default: void 0 },
12
12
  loading: { type: Boolean, default: void 0 },
13
13
  size: { default: void 0 },
14
- stopPropagation: { type: Boolean, default: void 0 },
14
+ stopPropagation: { type: [Boolean, Function], default: void 0 },
15
15
  multiple: { type: Boolean, default: !1 },
16
16
  defaultValue: { type: [String, Number, Boolean, Array] },
17
17
  value: { type: [String, Number, Boolean, Array], default: void 0 },
@@ -27,7 +27,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
27
27
  size: "small" | "middle";
28
28
  bordered: boolean;
29
29
  checked: boolean;
30
- stopPropagation: boolean;
30
+ stopPropagation: boolean | ((event: MouseEvent) => boolean);
31
31
  }, {}>, Readonly<CheckCardSlots> & CheckCardSlots>;
32
32
  export default _default;
33
33
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1,15 +1,15 @@
1
- import { defineComponent as F, computed as i, unref as l, createVNode as m, watch as I, watchEffect as U, openBlock as c, createElementBlock as N, normalizeStyle as W, normalizeClass as P, withModifiers as j, createBlock as f, renderSlot as G, resolveDynamicComponent as V, createCommentVNode as v, createElementVNode as O } from "vue";
2
- import { Skeleton as $ } from "ant-design-vue";
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";
3
3
  import "../config-provider/index.mjs";
4
4
  import "../hooks/index.mjs";
5
5
  import { isFunction as z } from "lodash-unified";
6
- import { useInjectCheckCard as q } from "./context.mjs";
6
+ import { useInjectCheckCard as A } from "./context.mjs";
7
7
  import "./style/index.css";
8
- import A from "./checked.svg.mjs";
9
- import { useNamespace as H } from "../config-provider/hooks/use-namespace.mjs";
10
- import { useGlobalConfig as J } from "../config-provider/hooks/use-global-config.mjs";
11
- import { useControllableValue as K } from "../hooks/useControllableValue.mjs";
12
- const L = ["src"], ne = /* @__PURE__ */ F({
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({
13
13
  name: "CheckCard",
14
14
  __name: "index",
15
15
  props: {
@@ -27,7 +27,7 @@ const L = ["src"], ne = /* @__PURE__ */ F({
27
27
  default: "middle"
28
28
  },
29
29
  stopPropagation: {
30
- type: Boolean,
30
+ type: [Boolean, Function],
31
31
  default: !1
32
32
  },
33
33
  checked: {
@@ -48,19 +48,19 @@ const L = ["src"], ne = /* @__PURE__ */ F({
48
48
  content: {}
49
49
  },
50
50
  emits: ["update:checked"],
51
- setup(_, {
52
- emit: w
51
+ setup(S, {
52
+ emit: _
53
53
  }) {
54
- const o = _, {
54
+ const o = S, {
55
55
  b: g,
56
- m: u,
56
+ m: s,
57
57
  e: p,
58
- bm: D,
58
+ bm: w,
59
59
  em: k
60
- } = H("check-card"), b = J("uiMode", "aplus"), E = w, n = q(), {
60
+ } = J("check-card"), h = K("uiMode", "aplus"), D = _, n = A(), {
61
61
  value: r,
62
- updateValue: h
63
- } = K(o, E, {
62
+ updateValue: b
63
+ } = L(o, D, {
64
64
  valuePropName: "checked",
65
65
  defaultValuePropName: "defaultChecked"
66
66
  }), a = i(() => {
@@ -68,12 +68,12 @@ const L = ["src"], ne = /* @__PURE__ */ F({
68
68
  ...o
69
69
  }, t = l(n);
70
70
  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
- }), S = i(() => {
72
- const e = l(b), t = l(a);
73
- return [g(), ...t.disabled ? [] : [g(e), l(r) ? D(e, "checked") : null], u(t.size), t.bordered ? u("bordered") : null, t.disabled ? u("disabled") : null];
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
74
  }), M = i(() => ({
75
75
  ...o.style,
76
- "--check-card-border-color": b.value === "admin" ? "#D9D9D9" : "#E9EDF3"
76
+ "--check-card-border-color": h.value === "admin" ? "#D9D9D9" : "#E9EDF3"
77
77
  })), y = i(() => {
78
78
  if (!o.title)
79
79
  return;
@@ -90,30 +90,34 @@ const L = ["src"], ne = /* @__PURE__ */ F({
90
90
  }, [e]);
91
91
  });
92
92
  function T(e) {
93
+ const t = l(a).stopPropagation;
94
+ return t ? t === !0 ? e.target !== e.currentTarget : t(e) : !1;
95
+ }
96
+ function F(e) {
93
97
  var t, d;
94
- a.value.stopPropagation && e.target !== e.currentTarget || 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)));
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)));
95
99
  }
96
- return I(() => n.value, (e) => {
100
+ return U(() => n.value, (e) => {
97
101
  if (!e)
98
102
  return;
99
103
  const t = e.multiple ? (e.value || []).includes(o.value) : e.value === o.value;
100
- h(t);
104
+ b(t);
101
105
  }, {
102
106
  immediate: !0
103
- }), U((e) => {
107
+ }), W((e) => {
104
108
  var t, d;
105
109
  (d = (t = n.value) == null ? void 0 : t.registerValue) == null || d.call(t, o.value), e(() => {
106
- var s, B;
107
- return (B = (s = n.value) == null ? void 0 : s.cancelValue) == null ? void 0 : B.call(s, o.value);
110
+ var u, B;
111
+ return (B = (u = n.value) == null ? void 0 : u.cancelValue) == null ? void 0 : B.call(u, o.value);
108
112
  });
109
113
  }), (e, t) => (c(), N("div", {
110
- style: W(M.value),
111
- class: P(S.value),
112
- onClick: j(T, ["stop"])
113
- }, [a.value.loading ? (c(), f(l($), {
114
+ style: j(M.value),
115
+ class: P(E.value),
116
+ onClick: G(F, ["stop"])
117
+ }, [a.value.loading ? (c(), f(l(q), {
114
118
  key: 0,
115
119
  active: ""
116
- })) : G(e.$slots, "default", {
120
+ })) : O(e.$slots, "default", {
117
121
  key: 1,
118
122
  checked: l(r)
119
123
  }, () => [y.value ? (c(), f(V(y.value), {
@@ -123,11 +127,11 @@ const L = ["src"], ne = /* @__PURE__ */ F({
123
127
  })) : v("", !0)]), l(r) ? (c(), N("div", {
124
128
  key: 2,
125
129
  class: P(l(p)("checked-icon"))
126
- }, [O("img", {
127
- src: l(A)
128
- }, null, 8, L)], 2)) : v("", !0)], 6));
130
+ }, [$("img", {
131
+ src: l(H)
132
+ }, null, 8, Q)], 2)) : v("", !0)], 6));
129
133
  }
130
134
  });
131
135
  export {
132
- ne as default
136
+ re as default
133
137
  };
@@ -24,7 +24,7 @@ type CheckCardCommonType = {
24
24
  /**
25
25
  * 是否阻止点击事件冒泡(对于自定义内容包含输入控件时需要设置)
26
26
  */
27
- stopPropagation?: boolean;
27
+ stopPropagation?: boolean | ((event: MouseEvent) => boolean);
28
28
  };
29
29
  export type CheckCardProps = CheckCardCommonType & {
30
30
  /**
@@ -102,6 +102,7 @@
102
102
  top: 0;
103
103
  right: 0;
104
104
  z-index: 1;
105
+ line-height: 1;
105
106
  -webkit-user-select: none;
106
107
  -moz-user-select: none;
107
108
  user-select: none;