@aplus-frontend/ui 7.15.0 → 7.15.2

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 (45) hide show
  1. package/es/src/ag-grid/editable/form-item.vue.mjs +8 -7
  2. package/es/src/ag-grid/editable/index.vue.mjs +19 -18
  3. package/es/src/ag-grid/index.vue.mjs +110 -105
  4. package/es/src/ag-grid/interface.d.ts +7 -0
  5. package/es/src/ap-form/drawer-form/index.vue.d.ts +1 -0
  6. package/es/src/ap-form/drawer-form/index.vue.mjs +107 -116
  7. package/es/src/ap-form/interface.d.ts +1 -1
  8. package/es/src/ap-form/items/checkbox/index.vue.mjs +2 -2
  9. package/es/src/ap-form/items/radio/index.vue.mjs +3 -2
  10. package/es/src/ap-table/components/setting/template/item.vue2.mjs +27 -26
  11. package/es/src/business/ap-descriptions/ap-descriptions.vue.mjs +23 -21
  12. package/es/src/business/ap-descriptions/style/index.mjs +7 -4
  13. package/es/src/time-ago/index.vue.mjs +21 -17
  14. package/es/src/time-ago/interface.d.ts +8 -0
  15. package/es/src/time-ago/useTimeAgo.d.ts +21 -0
  16. package/es/src/time-ago/useTimeAgo.mjs +36 -34
  17. package/es/src/time-ago/utils.d.ts +11 -0
  18. package/es/src/time-ago/utils.mjs +41 -9
  19. package/es/src/utils/index.d.ts +1 -0
  20. package/es/src/utils/index.mjs +18 -14
  21. package/es/src/version.d.ts +1 -1
  22. package/es/src/version.mjs +1 -1
  23. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  24. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  25. package/lib/src/ag-grid/index.vue.js +1 -1
  26. package/lib/src/ag-grid/interface.d.ts +7 -0
  27. package/lib/src/ap-form/drawer-form/index.vue.d.ts +1 -0
  28. package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
  29. package/lib/src/ap-form/interface.d.ts +1 -1
  30. package/lib/src/ap-form/items/checkbox/index.vue.js +1 -1
  31. package/lib/src/ap-form/items/radio/index.vue.js +1 -1
  32. package/lib/src/ap-table/components/setting/template/item.vue2.js +1 -1
  33. package/lib/src/business/ap-descriptions/ap-descriptions.vue.js +1 -1
  34. package/lib/src/business/ap-descriptions/style/index.js +1 -1
  35. package/lib/src/time-ago/index.vue.js +1 -1
  36. package/lib/src/time-ago/interface.d.ts +8 -0
  37. package/lib/src/time-ago/useTimeAgo.d.ts +21 -0
  38. package/lib/src/time-ago/useTimeAgo.js +1 -1
  39. package/lib/src/time-ago/utils.d.ts +11 -0
  40. package/lib/src/time-ago/utils.js +1 -1
  41. package/lib/src/utils/index.d.ts +1 -0
  42. package/lib/src/utils/index.js +1 -1
  43. package/lib/src/version.d.ts +1 -1
  44. package/lib/src/version.js +1 -1
  45. package/package.json +5 -5
@@ -343,6 +343,13 @@ export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
343
343
  * 自定义数据为空时展示的文本
344
344
  */
345
345
  emptyText?: string;
346
+ /**
347
+ * 列尺寸变化后的回调
348
+ * @param key
349
+ * @param width
350
+ * @returns
351
+ */
352
+ onColumnResized?: (key: string, width: number) => void;
346
353
  };
347
354
  export type AgGridExpose<SearchParamsType = Recordable, RecordType = any> = {
348
355
  /**
@@ -926,6 +926,7 @@ declare const __VLS_component: DefineComponent<ApFormDrawerFormProps, {
926
926
  type: PropType<sizeType>;
927
927
  };
928
928
  maxSize: NumberConstructor;
929
+ minSize: NumberConstructor;
929
930
  drawerStyle: {
930
931
  type: PropType<CSSProperties>;
931
932
  default: CSSProperties;
@@ -1,20 +1,20 @@
1
- import { isVNode as Q, defineComponent as Y, useSlots as Z, shallowRef as ee, ref as y, computed as w, unref as n, watch as P, cloneVNode as te, createVNode as s, mergeProps as p, createElementBlock as N, openBlock as h, Fragment as ie, createBlock as S, createCommentVNode as M, withCtx as v, renderSlot as _, withModifiers as ne, normalizeClass as oe, resolveDynamicComponent as I, createTextVNode as ae, toDisplayString as se } from "vue";
2
- import { Button as z, Flex as le, Space as re, Drawer as ue } from "@aplus-frontend/antdv";
3
- import { isBoolean as de, isUndefined as me, omit as ce } from "lodash-unified";
1
+ import { isVNode as q, defineComponent as A, useSlots as E, shallowRef as L, ref as v, watch as G, computed as T, unref as l, cloneVNode as H, createVNode as o, mergeProps as m, createElementBlock as J, openBlock as h, Fragment as K, createBlock as w, createCommentVNode as Q, withCtx as c, renderSlot as B, resolveDynamicComponent as R, createTextVNode as X, toDisplayString as Y } from "vue";
2
+ import { Button as b, Flex as Z, Space as ee, Drawer as te } from "@aplus-frontend/antdv";
3
+ import { isBoolean as ie, isUndefined as ae, omit as le } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
5
5
  import "../../hooks/index.mjs";
6
- import { convertReactiveToRaw as fe } from "../../utils/index.mjs";
7
- import { getSingleVNode as pe } from "../../utils/slot.mjs";
6
+ import { getNumberPx as F, convertReactiveToRaw as ne } from "../../utils/index.mjs";
7
+ import { getSingleVNode as oe } from "../../utils/slot.mjs";
8
8
  import "../ap-form.vue.mjs";
9
- import he from "../style/drawer-form.mjs";
10
- import { useControllableValue as ve } from "../../hooks/useControllableValue.mjs";
11
- import { useLocale as be } from "../../config-provider/hooks/use-locale.mjs";
12
- import { useNamespace as Fe } from "../../config-provider/hooks/use-namespace.mjs";
13
- import ge from "../ap-form.vue2.mjs";
14
- function L(r) {
15
- return typeof r == "function" || Object.prototype.toString.call(r) === "[object Object]" && !Q(r);
9
+ import se from "../style/drawer-form.mjs";
10
+ import { useControllableValue as re } from "../../hooks/useControllableValue.mjs";
11
+ import { useLocale as ue } from "../../config-provider/hooks/use-locale.mjs";
12
+ import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
13
+ import me from "../ap-form.vue2.mjs";
14
+ function x(s) {
15
+ return typeof s == "function" || Object.prototype.toString.call(s) === "[object Object]" && !q(s);
16
16
  }
17
- const De = /* @__PURE__ */ Y({
17
+ const Se = /* @__PURE__ */ A({
18
18
  name: "ApFormDrawerForm",
19
19
  __name: "index",
20
20
  props: {
@@ -100,17 +100,25 @@ const De = /* @__PURE__ */ Y({
100
100
  }
101
101
  },
102
102
  emits: ["update:open"],
103
- setup(r, {
104
- expose: U,
105
- emit: j
103
+ setup(s, {
104
+ expose: O,
105
+ emit: k
106
106
  }) {
107
- const t = r, b = Z(), E = j, o = ee(), d = y(), a = y(!1), {
108
- value: C,
109
- updateValue: m
110
- } = ve(t, E, {
107
+ const t = s, f = E(), W = k, a = L(), r = v(), n = v(!1), {
108
+ value: P,
109
+ updateValue: u
110
+ } = re(t, W, {
111
111
  valuePropName: "open",
112
112
  defaultValue: !1
113
- }), l = w(() => {
113
+ }), {
114
+ t: p
115
+ } = ue(), N = se("ap-form-drawer-form"), {
116
+ b: S
117
+ } = de("ap-form-drawer-form");
118
+ G(() => a.value, (e) => {
119
+ e && r.value && (e.setFieldsValue?.(r.value), r.value = void 0);
120
+ });
121
+ const d = T(() => {
114
122
  const e = {
115
123
  onResize: () => {
116
124
  },
@@ -118,160 +126,143 @@ const De = /* @__PURE__ */ Y({
118
126
  maxWidth: window.innerWidth * 0.8,
119
127
  resizeOnOpen: !0
120
128
  };
121
- return de(t.resize) ? t.resize ? e : {} : {
129
+ return ie(t.resize) ? t.resize ? e : {} : {
122
130
  minWidth: t.resize?.minWidth ?? e.minWidth,
123
131
  maxWidth: t.resize?.maxWidth ?? e.maxWidth,
124
132
  onResize: t.resize?.onResize ?? e.onResize,
125
- resizeOnOpen: me(t.resize?.resizeOnOpen) ? e.onResize : t.resize.resizeOnOpen
133
+ resizeOnOpen: ae(t.resize?.resizeOnOpen) ? e.resizeOnOpen : t.resize.resizeOnOpen
126
134
  };
127
- }), u = y(T()), {
128
- t: F
129
- } = be(), D = he("ap-form-drawer-form"), {
130
- b: $,
131
- e: q,
132
- em: V
133
- } = Fe("ap-form-drawer-form"), A = w(() => [q("resize-bar"), {
134
- [V("resize-bar", "min-disabled")]: n(u) === n(l).minWidth
135
- }, {
136
- [V("resize-bar", "max-disabled")]: n(u) === n(l).maxWidth
137
- }]);
138
- P(() => o.value, (e) => {
139
- e && d.value && (e.setFieldsValue?.(d.value), d.value = void 0);
140
- }), P(() => n(C), (e) => {
141
- e && n(l)?.resizeOnOpen && (u.value = T());
142
135
  });
143
- function T() {
144
- const e = n(l)?.minWidth;
136
+ function _() {
137
+ const e = l(d)?.minWidth;
145
138
  return !e || e && e < t.width ? t.width : e;
146
139
  }
147
- const R = pe(b.trigger), W = R ? te(R, {
140
+ const g = v(F(_()));
141
+ function I(e) {
142
+ const {
143
+ resizeOnOpen: i,
144
+ onResize: C
145
+ } = d.value;
146
+ i && (g.value = e, C?.(e));
147
+ }
148
+ const y = oe(f.trigger), z = y ? H(y, {
148
149
  onClick: () => {
149
- m(!0);
150
+ u(!0);
150
151
  }
151
- }) : null, X = w(() => {
152
+ }) : null, j = T(() => {
152
153
  const e = [];
153
154
  if (t.submitter === !1)
154
155
  return null;
155
156
  if (t.showCancel) {
156
157
  let i;
157
- e.push(s(z, {
158
- onClick: k,
159
- disabled: a.value
160
- }, L(i = F("ap.common.cancelText")) ? i : {
158
+ e.push(o(b, {
159
+ onClick: V,
160
+ disabled: n.value
161
+ }, x(i = p("ap.common.cancelText")) ? i : {
161
162
  default: () => [i]
162
163
  }));
163
164
  }
164
- return t.submitter?.resetButtonProps !== !1 && e.push(s(z, p(t.submitter?.resetButtonProps || {}, {
165
+ return t.submitter?.resetButtonProps !== !1 && e.push(o(b, m(t.submitter?.resetButtonProps || {}, {
165
166
  key: "submit",
166
- disabled: a.value,
167
- onClick: H
167
+ disabled: n.value,
168
+ onClick: U
168
169
  }), {
169
- default: () => [t.submitter?.resetText || F("ap.common.resetText")]
170
- })), t.submitter?.submitButtonProps !== !1 && e.push(s(z, p({
170
+ default: () => [t.submitter?.resetText || p("ap.common.resetText")]
171
+ })), t.submitter?.submitButtonProps !== !1 && e.push(o(b, m({
171
172
  type: "primary",
172
173
  key: "submit"
173
174
  }, t.submitter?.submitButtonProps || {}, {
174
- loading: a.value,
175
- onClick: J
175
+ loading: n.value,
176
+ onClick: D
176
177
  }), {
177
- default: () => [t.submitter?.submitText || F("ap.common.okText")]
178
- })), s(le, {
178
+ default: () => [t.submitter?.submitText || p("ap.common.okText")]
179
+ })), o(Z, {
179
180
  justify: "flex-end"
180
181
  }, {
181
- default: () => [b.submitter ? b.submitter(e) : s(re, null, L(e) ? e : {
182
+ default: () => [f.submitter ? f.submitter(e) : o(ee, null, x(e) ? e : {
182
183
  default: () => [e]
183
184
  })]
184
185
  });
185
186
  });
186
- function G() {
187
- l.value?.onResize?.(), document.addEventListener("mousemove", B), document.addEventListener("mouseup", x);
188
- }
189
- function B(e) {
190
- const i = n(l), c = (document.body.offsetWidth || 1e3) - (e.clientX - document.body.offsetLeft), f = i?.minWidth ?? (t.width || 800), O = i?.maxWidth ?? window.innerWidth * 0.8;
191
- let g = c;
192
- c < f && (g = f), c > O && (g = O), u.value = g;
187
+ function U() {
188
+ t.submitter !== !1 && (a.value?.resetFields(), t.submitter?.onReset?.());
193
189
  }
194
- function x() {
195
- document.removeEventListener("mousemove", B), document.removeEventListener("mouseup", x);
196
- }
197
- function H() {
198
- t.submitter !== !1 && (o.value?.resetFields(), t.submitter?.onReset?.());
199
- }
200
- async function J() {
190
+ async function D() {
201
191
  if (t.submitter !== !1)
202
192
  try {
203
- const e = await o.value?.validateFieldsReturnTransformed();
204
- t.submitter?.onSubmit?.(), a.value = !0;
205
- const i = t.onFinish?.(fe(e));
193
+ const e = await a.value?.validateFieldsReturnTransformed();
194
+ t.submitter?.onSubmit?.(), n.value = !0;
195
+ const i = t.onFinish?.(ne(e));
206
196
  if (t.submitTimeout && i instanceof Promise) {
207
- const f = setTimeout(() => a.value = !1, t.submitTimeout);
197
+ const $ = setTimeout(() => n.value = !1, t.submitTimeout);
208
198
  i.finally(() => {
209
- clearTimeout(f), a.value = !1;
199
+ clearTimeout($), n.value = !1;
210
200
  });
211
201
  }
212
- await i && m(!1);
202
+ await i && u(!1);
213
203
  } finally {
214
- a.value = !1;
204
+ n.value = !1;
215
205
  }
216
206
  }
217
- function k() {
218
- n(a) || m(!1);
207
+ function V() {
208
+ l(n) || u(!1);
219
209
  }
220
- function K(e) {
221
- !e && n(a) || m(e);
210
+ function M(e) {
211
+ !e && l(n) || u(e);
222
212
  }
223
- return U({
213
+ return O({
224
214
  resetFields: async () => {
225
- o.value?.resetFields();
215
+ a.value?.resetFields();
226
216
  },
227
217
  clearValidate: (e) => {
228
- o.value?.clearValidate(e);
218
+ a.value?.clearValidate(e);
229
219
  },
230
- validateFields: (e, i) => o.value?.validateFields(e, i),
231
- getFieldsValue: (e) => o.value?.getFieldsValue(e),
232
- validate: (e, i) => o.value?.validate(e, i),
220
+ validateFields: (e, i) => a.value?.validateFields(e, i),
221
+ getFieldsValue: (e) => a.value?.getFieldsValue(e),
222
+ validate: (e, i) => a.value?.validate(e, i),
233
223
  scrollToField: (e, i = {}) => {
234
- o.value?.scrollToField(e, i);
224
+ a.value?.scrollToField(e, i);
235
225
  },
236
226
  setFieldValue: (e, i) => {
237
- o.value?.setFieldValue?.(e, i);
227
+ a.value?.setFieldValue?.(e, i);
238
228
  },
239
229
  setFieldsValue: (e) => {
240
- if (!o.value) {
241
- d.value = e;
230
+ if (!a.value) {
231
+ r.value = e;
242
232
  return;
243
233
  }
244
- o.value?.setFieldsValue?.(e);
234
+ a.value?.setFieldsValue?.(e);
235
+ },
236
+ getInternalInstance: (e) => a.value?.getInternalInstance(e),
237
+ getFieldsValueTransformed: (e) => a.value?.getFieldsValueTransformed(e),
238
+ validateFieldsReturnTransformed: (e) => a.value?.validateFieldsReturnTransformed(e)
239
+ }), (e, i) => (h(), J(K, null, [o(l(te), m(e.drawerProps, {
240
+ open: l(P),
241
+ size: g.value,
242
+ "max-size": l(F)(d.value.maxWidth),
243
+ "min-size": l(F)(d.value.minWidth),
244
+ resizable: {
245
+ onResize: I
245
246
  },
246
- getInternalInstance: (e) => o.value?.getInternalInstance(e),
247
- getFieldsValueTransformed: (e) => o.value?.getFieldsValueTransformed(e),
248
- validateFieldsReturnTransformed: (e) => o.value?.validateFieldsReturnTransformed(e)
249
- }), (e, i) => (h(), N(ie, null, [s(n(ue), p(e.drawerProps, {
250
- open: n(C),
251
- width: u.value,
252
- class: [n($)(), n(D)],
253
- "onUpdate:open": K,
254
- onCancel: k
247
+ class: [l(S)(), l(N)],
248
+ "onUpdate:open": M,
249
+ onCancel: V
255
250
  }), {
256
- title: v(() => [_(e.$slots, "title", {}, () => [ae(se(t.title), 1)])]),
257
- footer: v(() => [(h(), S(I(X.value)))]),
258
- default: v(() => [s(ge, p({
251
+ title: c(() => [B(e.$slots, "title", {}, () => [X(Y(t.title), 1)])]),
252
+ footer: c(() => [(h(), w(R(j.value)))]),
253
+ default: c(() => [o(me, m({
259
254
  ref_key: "formRef",
260
- ref: o
261
- }, n(ce)(t, ["drawerProps", "open", "onUpdate:open", "title", "width", "onFinish", "submitter"])), {
262
- default: v(() => [_(e.$slots, "default")]),
255
+ ref: a
256
+ }, l(le)(t, ["drawerProps", "open", "onUpdate:open", "title", "width", "onFinish", "submitter"])), {
257
+ default: c(() => [B(e.$slots, "default")]),
263
258
  _: 3
264
- }, 16), e.resize ? (h(), N("div", {
265
- key: 0,
266
- class: oe(A.value),
267
- onMousedown: ne(G, ["stop", "prevent"])
268
- }, null, 34)) : M("", !0)]),
259
+ }, 16)]),
269
260
  _: 3
270
- }, 16, ["open", "width", "class"]), n(W) ? (h(), S(I(n(W)), {
261
+ }, 16, ["open", "size", "max-size", "min-size", "resizable", "class"]), l(z) ? (h(), w(R(l(z)), {
271
262
  key: 0
272
- })) : M("", !0)], 64));
263
+ })) : Q("", !0)], 64));
273
264
  }
274
265
  });
275
266
  export {
276
- De as default
267
+ Se as default
277
268
  };
@@ -278,7 +278,7 @@ export type ApFormModalFormProps = Omit<ApFormProps, 'onFinish'> & {
278
278
  submitTimeout?: number;
279
279
  };
280
280
  export type CustomizeResizeType = {
281
- onResize?: () => void;
281
+ onResize?: (_size: number) => void;
282
282
  maxWidth?: DrawerProps['width'];
283
283
  minWidth?: DrawerProps['width'];
284
284
  resizeOnOpen?: boolean;
@@ -58,11 +58,11 @@ const A = /* @__PURE__ */ m({
58
58
  request: () => l.value?.request()
59
59
  }), (e, F) => (y(), x(k, a(r(o(i)(p, ["field"]))), B({
60
60
  default: s(() => [
61
- _(o(C), h(e.field, {
61
+ _(o(C), h({
62
62
  ref_key: "checkboxRef",
63
63
  ref: l,
64
64
  disabled: e.disabled
65
- }), null, 16, ["disabled"])
65
+ }, e.field), null, 16, ["disabled"])
66
66
  ]),
67
67
  _: 2
68
68
  }, [
@@ -60,8 +60,9 @@ const A = /* @__PURE__ */ u({
60
60
  default: s(() => [
61
61
  v(r(k), b({
62
62
  ref_key: "radioRef",
63
- ref: o
64
- }, e.field, { disabled: e.disabled }), null, 16, ["disabled"])
63
+ ref: o,
64
+ disabled: e.disabled
65
+ }, e.field), null, 16, ["disabled"])
65
66
  ]),
66
67
  _: 2
67
68
  }, [
@@ -1,4 +1,4 @@
1
- import { defineComponent as g, ref as b, createElementBlock as c, openBlock as s, normalizeClass as n, unref as t, createElementVNode as f, createBlock as w, createCommentVNode as v, toDisplayString as B, withCtx as r, createVNode as i, withModifiers as d } from "vue";
1
+ import { defineComponent as g, ref as b, createElementBlock as c, openBlock as r, normalizeClass as a, unref as t, createElementVNode as f, createBlock as w, createCommentVNode as v, toDisplayString as B, withCtx as p, createVNode as s, withModifiers as d } from "vue";
2
2
  import { EditOutlined as N, DeleteOutlined as A } from "@ant-design/icons-vue";
3
3
  import { Flex as D, Popover as E } from "@aplus-frontend/antdv";
4
4
  import "../../../../config-provider/index.mjs";
@@ -15,58 +15,59 @@ const K = /* @__PURE__ */ g({
15
15
  shouldRemove: { type: Boolean }
16
16
  },
17
17
  setup(C) {
18
- const p = C, { b: l } = V("ap-column-setting-template-item"), a = b(!1), { deleteTemplate: k, cacheConfig: m } = S();
18
+ const m = C, { b: l } = V("ap-column-setting-template-item"), n = b(!1), { deleteTemplate: k, cacheConfig: u } = S();
19
19
  function y(o) {
20
- if (!o || o === p.value.label)
20
+ if (!o || o === m.value.label)
21
21
  return;
22
- const e = p.value;
23
- e.label = o, m.value?.onChange?.(e.columnState, e), a.value = !1;
22
+ const e = m.value;
23
+ e.label = o, u.value?.onChange?.(e.columnState, e), n.value = !1;
24
24
  }
25
- return (o, e) => (s(), c("div", {
26
- class: n([t(l)(), { [t(l)("active")]: o.isActive }]),
27
- onClick: e[3] || (e[3] = //@ts-ignore
28
- (...u) => o.onClick && o.onClick(...u))
25
+ return (o, e) => (r(), c("div", {
26
+ class: a([t(l)(), { [t(l)("active")]: o.isActive }]),
27
+ onClick: e[4] || (e[4] = //@ts-ignore
28
+ (...i) => o.onClick && o.onClick(...i))
29
29
  }, [
30
30
  f("span", {
31
- class: n(t(l)("label"))
31
+ class: a(t(l)("label"))
32
32
  }, B(o.value.label), 3),
33
- t(m).persistenceKey ? (s(), w(t(D), {
33
+ t(u).persistenceKey ? (r(), w(t(D), {
34
34
  key: 0,
35
35
  gap: 8,
36
- class: n(t(l)("action-wrapper"))
36
+ class: a(t(l)("action-wrapper"))
37
37
  }, {
38
- default: r(() => [
39
- i(t(E), {
40
- open: a.value,
38
+ default: p(() => [
39
+ s(t(E), {
40
+ open: n.value,
41
+ "onUpdate:open": e[2] || (e[2] = (i) => n.value = i),
41
42
  trigger: "click",
42
43
  arrow: !1,
43
44
  placement: "bottom",
44
45
  "destroy-tooltip-on-hide": ""
45
46
  }, {
46
- content: r(() => [
47
- i(F, {
47
+ content: p(() => [
48
+ s(F, {
48
49
  "is-edit": "",
49
50
  "initial-values": { label: o.value.label },
50
51
  onConfirm: y,
51
- onCancel: e[1] || (e[1] = () => a.value = !1)
52
+ onCancel: e[1] || (e[1] = () => n.value = !1)
52
53
  }, null, 8, ["initial-values"])
53
54
  ]),
54
- default: r(() => [
55
+ default: p(() => [
55
56
  f("span", {
56
- class: n(t(l)("icon-wrapper")),
57
- onClick: e[0] || (e[0] = d((u) => a.value = !0, ["stop"]))
57
+ class: a(t(l)("icon-wrapper")),
58
+ onClick: e[0] || (e[0] = d((i) => n.value = !0, ["stop"]))
58
59
  }, [
59
- i(t(N))
60
+ s(t(N))
60
61
  ], 2)
61
62
  ]),
62
63
  _: 1
63
64
  }, 8, ["open"]),
64
- o.shouldRemove ? (s(), c("span", {
65
+ o.shouldRemove ? (r(), c("span", {
65
66
  key: 0,
66
- class: n(t(l)("icon-wrapper")),
67
- onClick: e[2] || (e[2] = d(() => t(k)(o.value.key), ["stop"]))
67
+ class: a(t(l)("icon-wrapper")),
68
+ onClick: e[3] || (e[3] = d(() => t(k)(o.value.key), ["stop"]))
68
69
  }, [
69
- i(t(A))
70
+ s(t(A))
70
71
  ], 2)) : v("", !0)
71
72
  ]),
72
73
  _: 1
@@ -1,11 +1,11 @@
1
1
  import { defineComponent as N, useSlots as T, createVNode as l, createTextVNode as D, Fragment as V, shallowRef as w, watch as E, createElementBlock as _, openBlock as k, normalizeStyle as A, normalizeClass as B, unref as n, mergeProps as I } from "vue";
2
2
  import { Descriptions as R } from "@aplus-frontend/antdv";
3
- import { get as p } from "lodash-unified";
3
+ import { get as u } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
5
5
  import "./help-message/index.vue.mjs";
6
6
  import { mixinsAttachmentExtraProps as j, transformValue as z, isEmptyWithType as F } from "./helper.mjs";
7
7
  import G from "./style/index.mjs";
8
- import { useGlobalConfig as u } from "../../config-provider/hooks/use-global-config.mjs";
8
+ import { useGlobalConfig as f } from "../../config-provider/hooks/use-global-config.mjs";
9
9
  import { useNamespace as M } from "../../config-provider/hooks/use-namespace.mjs";
10
10
  import L from "./help-message/index.vue2.mjs";
11
11
  const Z = /* @__PURE__ */ N({
@@ -20,30 +20,30 @@ const Z = /* @__PURE__ */ N({
20
20
  },
21
21
  className: {}
22
22
  },
23
- setup(f) {
24
- const o = f, c = u("apDescriptions"), d = u("downloadCenterTriggerConfig"), {
25
- b: y,
26
- be: m
23
+ setup(c) {
24
+ const o = c, d = f("apDescriptions"), y = f("downloadCenterTriggerConfig"), {
25
+ b: m,
26
+ be: s
27
27
  } = M("ap-descriptions"), b = G("ap-descriptions"), g = T(), S = (e = {}) => {
28
28
  let r = "";
29
29
  return o.descriptionsProps?.layout === "vertical" && (r = "start"), {
30
30
  justifyContent: r,
31
31
  ...e
32
32
  };
33
- }, s = (e) => {
34
- const r = p(o.dataSource, e.field);
33
+ }, i = (e) => {
34
+ const r = u(o.dataSource, e.field);
35
35
  if (e.customRender)
36
36
  return e.customRender(o.dataSource);
37
37
  e.valueType === "attachment" && (e.extraProps = j(e.extraProps, {
38
- fromConfig: c.value?.downloadFile,
39
- fromGlobal: d.value?.trigger
38
+ fromConfig: d.value?.downloadFile,
39
+ fromGlobal: y.value?.trigger
40
40
  }));
41
41
  const t = e.format ? e.format(r, o.dataSource || {}) : r;
42
42
  return z({
43
43
  value: t,
44
44
  record: o.dataSource
45
45
  }, e);
46
- }, v = (e) => e.valueType === "text" && !!e.extraProps?.ellipsis, C = (e, r) => {
46
+ }, v = (e) => e.valueType === "text" && !!e.extraProps?.ellipsis, x = (e, r) => {
47
47
  if (e.visible != null) {
48
48
  if (typeof e.visible == "boolean")
49
49
  return e.visible;
@@ -54,11 +54,13 @@ const Z = /* @__PURE__ */ N({
54
54
  });
55
55
  }
56
56
  return !0;
57
- }, P = (e, r, t) => e.valueType === "empty" ? null : F(p(t, e.field), e) ? l("span", null, [D("--")]) : e.contentSlotName ? g?.[e.contentSlotName]?.({
57
+ }, C = (e, r, t) => e.valueType === "empty" ? null : F(u(t, e.field), e) ? l("span", null, [D("--")]) : e.contentSlotName ? g?.[e.contentSlotName]?.({
58
58
  index: r,
59
59
  record: t,
60
- item: s(e)
61
- }) : l(V, null, [e.prefix, s(e), e.suffix]), x = (e = [], r) => e.filter((t) => C(t, r)).map((t, a) => ({
60
+ item: i(e)
61
+ }) : l(V, null, [e.prefix, i(e), e.suffix && l("span", {
62
+ class: s("content", "suffix")
63
+ }, [e.suffix])]), P = (e = [], r) => e.filter((t) => x(t, r)).map((t, p) => ({
62
64
  label: t.label && l(L, {
63
65
  helpMessage: t.helpMessage,
64
66
  label: t.label
@@ -67,23 +69,23 @@ const Z = /* @__PURE__ */ N({
67
69
  style: t.style,
68
70
  contentStyle: t.contentStyle,
69
71
  labelStyle: t.labelStyle,
70
- key: t.field?.toString() || "empty" + a,
71
- class: v(t) ? m("item", "ellipsis") : "",
72
- children: P(t, a, r)
73
- })), i = w([]);
72
+ key: t.field?.toString() || "empty" + p,
73
+ class: v(t) ? s("item", "ellipsis") : "",
74
+ children: C(t, p, r)
75
+ })), a = w([]);
74
76
  return E([() => o.schemas, () => o.dataSource], () => {
75
- i.value = x(o.schemas, o.dataSource);
77
+ a.value = P(o.schemas, o.dataSource);
76
78
  }, {
77
79
  immediate: !0,
78
80
  deep: !0
79
81
  }), (e, r) => (k(), _("div", {
80
- class: B([e.className, n(y)(), n(b)]),
82
+ class: B([e.className, n(m)(), n(b)]),
81
83
  style: A(e.style)
82
84
  }, [l(n(R), I(e.descriptionsProps, {
83
85
  "label-style": S({
84
86
  ...e.descriptionsProps?.labelStyle || {}
85
87
  }),
86
- items: i.value
88
+ items: a.value
87
89
  }), null, 16, ["label-style", "items"])], 6));
88
90
  }
89
91
  });
@@ -1,5 +1,5 @@
1
- import { genComponentStyleHook as n } from "../../../utils/cssinjs/index.mjs";
2
- const e = (t) => {
1
+ import { genComponentStyleHook as e } from "../../../utils/cssinjs/index.mjs";
2
+ const n = (t) => {
3
3
  const { componentCls: i } = t;
4
4
  return {
5
5
  [i]: {
@@ -60,6 +60,9 @@ const e = (t) => {
60
60
  },
61
61
  ".ant-descriptions-item-content": {
62
62
  color: t.textColor1,
63
+ [`${i}-content__suffix`]: {
64
+ whiteSpace: "pre-wrap"
65
+ },
63
66
  ".ap-descriptions-item-content__link": {
64
67
  color: t.colorLink,
65
68
  cursor: "pointer"
@@ -68,8 +71,8 @@ const e = (t) => {
68
71
  }
69
72
  }
70
73
  };
71
- }, a = n("ApDescriptions", (t) => [
72
- e(t)
74
+ }, a = e("ApDescriptions", (t) => [
75
+ n(t)
73
76
  ]);
74
77
  export {
75
78
  a as default
@@ -1,4 +1,4 @@
1
- import { defineComponent as f, toRef as r, computed as a, createElementBlock as d, openBlock as g, normalizeClass as v, unref as n, toDisplayString as _ } from "vue";
1
+ import { defineComponent as f, toRef as r, computed as a, createElementBlock as d, openBlock as g, normalizeClass as _, unref as m, toDisplayString as v } from "vue";
2
2
  import y from "dayjs";
3
3
  import "../config-provider/index.mjs";
4
4
  import D from "./style/index.mjs";
@@ -6,7 +6,7 @@ import h from "./useTimeAgo.mjs";
6
6
  import { getTimeAgoStr as B } from "./utils.mjs";
7
7
  import { useLocale as S } from "../config-provider/hooks/use-locale.mjs";
8
8
  import { useNamespace as T } from "../config-provider/hooks/use-namespace.mjs";
9
- const Y = ["title"], M = /* @__PURE__ */ f({
9
+ const Y = ["title"], H = /* @__PURE__ */ f({
10
10
  name: "TimeAgo",
11
11
  __name: "index",
12
12
  props: {
@@ -20,28 +20,32 @@ const Y = ["title"], M = /* @__PURE__ */ f({
20
20
  interval: {
21
21
  type: [Boolean, Number],
22
22
  default: 1e4
23
- }
23
+ },
24
+ customFormat: {}
24
25
  },
25
- setup(m) {
26
- const t = m, {
27
- locale: s
26
+ setup(s) {
27
+ const e = s, {
28
+ locale: n
28
29
  } = S(), {
29
30
  b: l
30
- } = T("time-ago"), i = D("time-ago"), u = h(r(t, "value"), Date.now(), r(t, "interval")), c = a(() => B(u.value, s.value)), p = a(() => {
31
- const e = t.title;
32
- if (e === !1)
31
+ } = T("time-ago"), i = D("time-ago"), u = h(r(e, "value"), Date.now(), r(e, "interval")), c = a(() => {
32
+ const t = u.value;
33
+ return e.customFormat ? e.customFormat(t) : B(t, n.value);
34
+ }), p = a(() => {
35
+ const t = e.title;
36
+ if (t === !1)
33
37
  return;
34
- if (typeof e == "string")
35
- return e;
36
- const o = e === !0 ? "YYYY-MM-DD HH:mm:ss" : e.format;
37
- return y(t.value).format(o);
38
+ if (typeof t == "string")
39
+ return t;
40
+ const o = t === !0 ? "YYYY-MM-DD HH:mm:ss" : t.format;
41
+ return y(e.value).format(o);
38
42
  });
39
- return (e, o) => (g(), d("span", {
43
+ return (t, o) => (g(), d("span", {
40
44
  title: p.value,
41
- class: v([n(l)(), n(i)])
42
- }, _(c.value), 11, Y));
45
+ class: _([m(l)(), m(i)])
46
+ }, v(c.value), 11, Y));
43
47
  }
44
48
  });
45
49
  export {
46
- M as default
50
+ H as default
47
51
  };