@aplus-frontend/ui 7.4.4 → 7.5.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 (59) hide show
  1. package/es/index.mjs +184 -180
  2. package/es/src/ap-form/item/index.vue.mjs +20 -20
  3. package/es/src/ap-form/item-group/helper.mjs +8 -8
  4. package/es/src/ap-pro-card/components/title/index.vue2.mjs +13 -13
  5. package/es/src/ap-pro-card/style/title.mjs +3 -3
  6. package/es/src/ap-table/ap-table.vue2.mjs +37 -36
  7. package/es/src/business/ap-image/ApImage.vue2.mjs +1 -1
  8. package/es/src/business/ap-label/group/ApLabelGroup.mjs +14 -14
  9. package/es/src/business/ap-title/ApTitle.vue2.mjs +6 -5
  10. package/es/src/index.d.ts +1 -0
  11. package/es/src/index.mjs +302 -297
  12. package/es/src/locale/lang/en.mjs +17 -0
  13. package/es/src/locale/lang/zh-cn.mjs +17 -0
  14. package/es/src/time-ago/index.d.ts +4 -0
  15. package/es/src/time-ago/index.mjs +6 -0
  16. package/es/src/time-ago/index.vue.d.ts +10 -0
  17. package/es/src/time-ago/index.vue.mjs +46 -0
  18. package/es/src/time-ago/index.vue2.mjs +4 -0
  19. package/es/src/time-ago/interface.d.ts +16 -0
  20. package/es/src/time-ago/interface.mjs +1 -0
  21. package/es/src/time-ago/style/index.d.ts +3 -0
  22. package/es/src/time-ago/style/index.mjs +12 -0
  23. package/es/src/time-ago/useTimeAgo.d.ts +42 -0
  24. package/es/src/time-ago/useTimeAgo.mjs +56 -0
  25. package/es/src/time-ago/utils.d.ts +4 -0
  26. package/es/src/time-ago/utils.mjs +23 -0
  27. package/es/src/version.d.ts +1 -1
  28. package/es/src/version.mjs +1 -1
  29. package/lib/index.js +1 -1
  30. package/lib/src/ap-form/item/index.vue.js +1 -1
  31. package/lib/src/ap-form/item-group/helper.js +1 -1
  32. package/lib/src/ap-pro-card/components/title/index.vue2.js +1 -1
  33. package/lib/src/ap-pro-card/style/title.js +1 -1
  34. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  35. package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
  36. package/lib/src/business/ap-label/group/ApLabelGroup.js +1 -1
  37. package/lib/src/business/ap-title/ApTitle.vue2.js +1 -1
  38. package/lib/src/index.d.ts +1 -0
  39. package/lib/src/index.js +1 -1
  40. package/lib/src/locale/lang/en.js +1 -1
  41. package/lib/src/locale/lang/zh-cn.js +1 -1
  42. package/lib/src/time-ago/index.d.ts +4 -0
  43. package/lib/src/time-ago/index.js +1 -0
  44. package/lib/src/time-ago/index.vue.d.ts +10 -0
  45. package/lib/src/time-ago/index.vue.js +1 -0
  46. package/lib/src/time-ago/index.vue2.js +1 -0
  47. package/lib/src/time-ago/interface.d.ts +16 -0
  48. package/lib/src/time-ago/interface.js +1 -0
  49. package/lib/src/time-ago/style/index.d.ts +3 -0
  50. package/lib/src/time-ago/style/index.js +1 -0
  51. package/lib/src/time-ago/useTimeAgo.d.ts +42 -0
  52. package/lib/src/time-ago/useTimeAgo.js +1 -0
  53. package/lib/src/time-ago/utils.d.ts +4 -0
  54. package/lib/src/time-ago/utils.js +1 -0
  55. package/lib/src/version.d.ts +1 -1
  56. package/lib/src/version.js +1 -1
  57. package/package.json +1 -1
  58. /package/es/src/business/ap-image/imgs/{aplus-fallback.jpg.mjs → user-fallback.jpg.mjs} +0 -0
  59. /package/lib/src/business/ap-image/imgs/{aplus-fallback.jpg.js → user-fallback.jpg.js} +0 -0
@@ -1,10 +1,10 @@
1
- import { defineComponent as u, computed as r, createElementBlock as i, openBlock as p, normalizeClass as m, renderSlot as c } from "vue";
1
+ import { defineComponent as s, computed as a, createElementBlock as i, openBlock as p, normalizeClass as m, renderSlot as c } from "vue";
2
2
  import "../../../config-provider/index.mjs";
3
3
  import { mergeClass as f } from "../../../editable-table/utils.mjs";
4
4
  import C from "../../style/title.mjs";
5
- import { useNamespace as $ } from "../../../config-provider/hooks/use-namespace.mjs";
6
- import { useGlobalConfig as v } from "../../../config-provider/hooks/use-global-config.mjs";
7
- const P = /* @__PURE__ */ u({
5
+ import { useNamespace as v } from "../../../config-provider/hooks/use-namespace.mjs";
6
+ import { useGlobalConfig as M } from "../../../config-provider/hooks/use-global-config.mjs";
7
+ const P = /* @__PURE__ */ s({
8
8
  name: "ApProCardTitle",
9
9
  __name: "index",
10
10
  props: {
@@ -15,18 +15,18 @@ const P = /* @__PURE__ */ u({
15
15
  default: void 0
16
16
  }
17
17
  },
18
- setup(a) {
18
+ setup(l) {
19
19
  const {
20
- b: l
21
- } = $("pro-card-title"), n = C("pro-card-title"), d = v("apProCard", {
20
+ b: u
21
+ } = v("pro-card-title"), d = C("pro-card-title"), t = M("apProCard", {
22
22
  uiMode: "aplus"
23
- }), o = a, t = r(() => o.uiMode || d.value?.uiMode), s = r(() => {
24
- const e = l();
25
- return f(`${e}`, [o.type ? `${e}-${o.type}` : void 0, t.value ? `${e}-${o.type ?? "default"}-${t.value}` : void 0, n.value].filter(Boolean));
23
+ }), e = l, r = a(() => (e.uiMode || t.value?.uiMode) === "aplus" ? "user" : e.uiMode || t.value?.uiMode), n = a(() => {
24
+ const o = u();
25
+ return f(`${o}`, [e.type ? `${o}-${e.type}` : void 0, r.value ? `${o}-${e.type ?? "default"}-${r.value}` : void 0, d.value].filter(Boolean));
26
26
  });
27
- return (e, y) => (p(), i("div", {
28
- class: m(s.value)
29
- }, [c(e.$slots, "default")], 2));
27
+ return (o, $) => (p(), i("div", {
28
+ class: m(n.value)
29
+ }, [c(o.$slots, "default")], 2));
30
30
  }
31
31
  });
32
32
  export {
@@ -9,7 +9,7 @@ const r = (t) => {
9
9
  fontSize: "12px",
10
10
  display: "flex",
11
11
  alignItems: "center",
12
- "&-aplus": {
12
+ "&-user": {
13
13
  paddingLeft: "10px",
14
14
  "&::before": {
15
15
  position: "absolute",
@@ -41,10 +41,10 @@ const r = (t) => {
41
41
  }
42
42
  }
43
43
  };
44
- }, a = e("ProCard.Title", (t) => [
44
+ }, i = e("ProCard.Title", (t) => [
45
45
  r(t)
46
46
  ]);
47
47
  export {
48
- a as default,
48
+ i as default,
49
49
  r as genProCardTitleStyle
50
50
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as $e, useSlots as je, ref as c, computed as n, unref as o, toRef as He, createVNode as p, Fragment as ae, watch as x, createElementBlock as B, openBlock as f, normalizeStyle as E, normalizeClass as m, createCommentVNode as le, createElementVNode as K, mergeProps as k, createSlots as ne, withCtx as w, renderList as se, createBlock as ue, resolveDynamicComponent as _e, renderSlot as v, normalizeProps as Ue, guardReactiveProps as qe } from "vue";
1
+ import { defineComponent as $e, useSlots as je, ref as c, computed as n, unref as o, toRef as He, createVNode as p, Fragment as ae, watch as B, createElementBlock as k, openBlock as f, normalizeStyle as E, normalizeClass as m, createCommentVNode as le, createElementVNode as K, mergeProps as z, createSlots as ne, withCtx as w, renderList as se, createBlock as ue, resolveDynamicComponent as _e, renderSlot as v, normalizeProps as Ue, guardReactiveProps as qe } from "vue";
2
2
  import { Divider as Me, Table as Ge } from "@aplus-frontend/antdv";
3
3
  import { useToken as Je } from "@aplus-frontend/antdv/es/theme/internal";
4
4
  import { ApForm as Qe } from "../ap-form/index.mjs";
@@ -167,7 +167,7 @@ const Gr = /* @__PURE__ */ $e({
167
167
  } = dr(), D = c(), $ = c(), {
168
168
  isStickyMode: j,
169
169
  scrollBarRef: R
170
- } = fr(D), z = c(r.size), s = c([]), H = c([]), _ = cr(), P = c(!0), U = n(() => (L++, r.columns?.filter((e) => !e.hideInSearch && e.dataIndex && (e.valueType || e.customRenderFormItem) && !de.includes(e.valueType))?.sort((e, a) => {
170
+ } = fr(D), C = c(r.size), s = c([]), H = c([]), _ = cr(), P = c(!0), U = n(() => (L++, r.columns?.filter((e) => !e.hideInSearch && e.dataIndex && (e.valueType || e.customRenderFormItem) && !de.includes(e.valueType))?.sort((e, a) => {
171
171
  let t = ce(e.order);
172
172
  return ce(a.order) - t;
173
173
  })?.map((e) => {
@@ -191,9 +191,9 @@ const Gr = /* @__PURE__ */ $e({
191
191
  if (e.filters && !e.onFilter)
192
192
  return e.key || e?.dataIndex;
193
193
  }).filter(Boolean)), Te = n(() => g(r.dataSource) ? y.records : r.dataSource), Fe = n(() => fe(r.manual) ? r.manual : mr(b.searchFormExtra?.() || []).some((a) => a.type?.name === "ApView")), {
194
- rowSelection: C,
195
- selectedRows: T,
196
- ...F
194
+ rowSelection: T,
195
+ selectedRows: F,
196
+ ...x
197
197
  } = ir({
198
198
  fixed: !0,
199
199
  ...r.rowSelection === !0 ? {} : r.rowSelection,
@@ -210,12 +210,12 @@ const Gr = /* @__PURE__ */ $e({
210
210
  getColumnSFConfig: G,
211
211
  sortedInfo: Be,
212
212
  filteredInfo: ke,
213
- setPaging: Ie,
214
- getPaging: ze,
213
+ setPaging: ze,
214
+ getPaging: Ie,
215
215
  submitWith: J
216
216
  } = Xe({
217
217
  async request(e) {
218
- if (!C.value.preserveSelectedRowKeys && g(r.dataSource) && !P.value && F.clearAll(), P.value && (P.value = !1), !g(r.dataSource))
218
+ if (!T.value.preserveSelectedRowKeys && g(r.dataSource) && !P.value && x.clearAll(), P.value && (P.value = !1), !g(r.dataSource))
219
219
  return {
220
220
  data: r.dataSource || [],
221
221
  total: r.dataSource.length || 0
@@ -237,12 +237,12 @@ const Gr = /* @__PURE__ */ $e({
237
237
  pr({
238
238
  columns: n(() => s.value),
239
239
  columnsBackup: n(() => H.value),
240
- size: n(() => z.value),
240
+ size: n(() => C.value),
241
241
  updateColumns(e) {
242
242
  s.value = e;
243
243
  },
244
244
  updateSize(e) {
245
- z.value = e;
245
+ C.value = e;
246
246
  },
247
247
  dataSource: n(() => o(y).records),
248
248
  getSearchFormValues: Y,
@@ -302,13 +302,13 @@ const Gr = /* @__PURE__ */ $e({
302
302
  }
303
303
  e(s.value);
304
304
  };
305
- x(() => [r.columns, r.columnResizable], () => {
305
+ B(() => [r.columns, r.columnResizable], () => {
306
306
  const e = Pe();
307
307
  s.value = e, H.value = e;
308
308
  }, {
309
309
  deep: !0,
310
310
  immediate: !0
311
- }), x(() => [Be.value, ke.value], () => {
311
+ }), B(() => [Be.value, ke.value], () => {
312
312
  Ne();
313
313
  }, {
314
314
  deep: !0
@@ -327,7 +327,7 @@ const Gr = /* @__PURE__ */ $e({
327
327
  if (r.columns?.some((e) => e.ellipsis))
328
328
  return "fixed";
329
329
  }), Q = n(() => {
330
- const e = o(q), a = o(C);
330
+ const e = o(q), a = o(T);
331
331
  return {
332
332
  ...r,
333
333
  ...e,
@@ -358,9 +358,9 @@ const Gr = /* @__PURE__ */ $e({
358
358
  content: t
359
359
  }, null) : t;
360
360
  }
361
- x(() => o(y).loading, (e) => {
361
+ B(() => o(y).loading, (e) => {
362
362
  r.onLoadingChange?.(e);
363
- }), x(() => r.dataSource, (e) => {
363
+ }), B(() => r.dataSource, (e) => {
364
364
  xe(e);
365
365
  }, {
366
366
  immediate: !0
@@ -391,13 +391,13 @@ const Gr = /* @__PURE__ */ $e({
391
391
  submitWith: () => J(),
392
392
  setSearchFormValues: X,
393
393
  getSearchFormValues: Y,
394
- setPaging: Ie,
395
- getPaging: ze,
394
+ setPaging: ze,
395
+ getPaging: Ie,
396
396
  getShownColumns: Le,
397
397
  dataSource: n(() => o(y).records),
398
398
  rowSelection: {
399
- selectedRows: n(() => o(T)),
400
- ...F
399
+ selectedRows: n(() => o(F)),
400
+ ...x
401
401
  },
402
402
  scrollBar: {
403
403
  x: {
@@ -409,18 +409,18 @@ const Gr = /* @__PURE__ */ $e({
409
409
  getSearchFormSorterItems: Z,
410
410
  setSearchFormSorterItems: ee,
411
411
  resetSearchFormSorterItems: re
412
- }), (e, a) => (f(), B("div", {
412
+ }), (e, a) => (f(), k("div", {
413
413
  ref_key: "tableWrapperRef",
414
414
  ref: D,
415
415
  class: m(Ee.value),
416
416
  style: E(o(Se)({
417
417
  "scroll-bar-width": `${o(_)}px`
418
418
  }))
419
- }, [o(g)(e.dataSource) && e.searchForm !== !1 && U.value.length > 0 ? (f(), B("div", {
419
+ }, [o(g)(e.dataSource) && e.searchForm !== !1 && U.value.length > 0 ? (f(), k("div", {
420
420
  key: 0,
421
421
  class: m(e.card ? o(I)("search-wrapper") : null),
422
422
  style: E(e.searchFormWrapperStyle)
423
- }, [p(o(Qe).SearchForm, k(e.searchForm || {}, {
423
+ }, [p(o(Qe).SearchForm, z(e.searchForm || {}, {
424
424
  ref_key: "formRef",
425
425
  ref: i,
426
426
  "custom-reset": "",
@@ -428,7 +428,7 @@ const Gr = /* @__PURE__ */ $e({
428
428
  onSubmit: o(N),
429
429
  onReset: o(V)
430
430
  }), ne({
431
- default: w(() => [(f(!0), B(ae, null, se(U.value, (t) => (f(), ue(_e(t.renderNode), {
431
+ default: w(() => [(f(!0), k(ae, null, se(U.value, (t) => (f(), ue(_e(t.renderNode), {
432
432
  key: t.dataIndex
433
433
  }))), 128))]),
434
434
  _: 2
@@ -443,31 +443,31 @@ const Gr = /* @__PURE__ */ $e({
443
443
  style: E(e.tableWrapperStyle)
444
444
  }, [K("div", {
445
445
  class: m(o(d)("header-wrapper"))
446
- }, [e.settings ? (f(), B("div", {
446
+ }, [e.settings ? (f(), k("div", {
447
447
  key: 0,
448
448
  class: m(o(d)("header"))
449
449
  }, [K("div", {
450
450
  class: m(o(O)("header", "title"))
451
- }, [v(e.$slots, "title", k({
452
- selectedRows: o(T),
453
- selectedRowKeys: o(C).selectedRowKeys,
451
+ }, [v(e.$slots, "title", z({
452
+ selectedRows: o(F),
453
+ selectedRowKeys: o(T).selectedRowKeys,
454
454
  shownColumns: s.value
455
- }, F))], 2), b.title ? (f(), ue(o(Me), {
455
+ }, x))], 2), b.title ? (f(), ue(o(Me), {
456
456
  key: 0,
457
457
  type: "vertical"
458
458
  })) : le("", !0), p(wr, {
459
459
  config: e.settings === !0 ? {} : e.settings
460
- }, null, 8, ["config"])], 2)) : v(e.$slots, "title", k({
460
+ }, null, 8, ["config"])], 2)) : v(e.$slots, "title", z({
461
461
  key: 1,
462
- selectedRows: o(T),
463
- selectedRowKeys: o(C).selectedRowKeys,
462
+ selectedRows: o(F),
463
+ selectedRowKeys: o(T).selectedRowKeys,
464
464
  shownColumns: s.value
465
- }, F))], 2), p(o(Ge), k({
465
+ }, x))], 2), p(o(Ge), z({
466
466
  ref_key: "antdTableRef",
467
467
  ref: $,
468
468
  class: o(d)("table")
469
469
  }, Q.value, {
470
- size: z.value,
470
+ size: C.value,
471
471
  "table-layout": Ae.value,
472
472
  columns: s.value,
473
473
  onResizeColumn: a[0] || (a[0] = (t, u) => u.width = t)
@@ -475,7 +475,7 @@ const Gr = /* @__PURE__ */ $e({
475
475
  summary: w(() => [v(e.$slots, "summary", {
476
476
  columns: s.value,
477
477
  records: Q.value.dataSource,
478
- selectedRows: o(T)
478
+ selectedRows: o(F)
479
479
  })]),
480
480
  _: 2
481
481
  }, [o(j) ? {
@@ -486,8 +486,9 @@ const Gr = /* @__PURE__ */ $e({
486
486
  "scroll-container": $.value?.table?.scrollBodyRef,
487
487
  direction: "horizontal",
488
488
  "bar-color": "var(--scrollbar-thumb-color-base)",
489
- "track-color": "var(--table-header-bg, #f2f6f9)"
490
- }, null, 8, ["scroll-container"])]),
489
+ "track-color": "var(--table-header-bg, #f2f6f9)",
490
+ "extra-size": C.value === "middle" ? 13 : 10
491
+ }, null, 8, ["scroll-container", "extra-size"])]),
491
492
  key: "0"
492
493
  } : void 0, se(o(ie)(b, ["title", "searchFormExtra", "headerCell", "summary"]), (t, u) => ({
493
494
  name: u,
@@ -5,7 +5,7 @@ import { injectLocaleToOss as G, getOssInstance as $, getSignatureUrl as q } fro
5
5
  import "../../config-provider/index.mjs";
6
6
  import H from "./style/index.mjs";
7
7
  import J from "./imgs/admin-fallback.jpg.mjs";
8
- import K from "./imgs/aplus-fallback.jpg.mjs";
8
+ import K from "./imgs/user-fallback.jpg.mjs";
9
9
  import { omit as Q } from "lodash-unified";
10
10
  import { useNamespace as X } from "../../config-provider/hooks/use-namespace.mjs";
11
11
  import { useGlobalConfig as c } from "../../config-provider/hooks/use-global-config.mjs";
@@ -1,29 +1,29 @@
1
- import { defineComponent as l, createVNode as o, mergeProps as t, createTextVNode as m } from "vue";
1
+ import { defineComponent as m, createVNode as o, mergeProps as t, createTextVNode as s } from "vue";
2
2
  import "../../../config-provider/index.mjs";
3
- import s from "../ApLabel.mjs";
3
+ import i from "../ApLabel.mjs";
4
4
  import { omit as n } from "lodash-unified";
5
- import { ApLabelGroupProps as i } from "../constans.mjs";
5
+ import { ApLabelGroupProps as p } from "../constans.mjs";
6
6
  import "../../ap-tag/index.mjs";
7
- import { useNamespace as p } from "../../../config-provider/hooks/use-namespace.mjs";
8
- import c from "../../ap-tag/ap-tag.vue.mjs";
9
- const {
10
- b: f
11
- } = p("ap-label-group"), _ = /* @__PURE__ */ l({
7
+ import { useNamespace as c } from "../../../config-provider/hooks/use-namespace.mjs";
8
+ import f from "../../ap-tag/ap-tag.vue.mjs";
9
+ const _ = /* @__PURE__ */ m({
12
10
  name: "ApLabelGroup",
13
- props: i(),
11
+ props: p(),
14
12
  setup(r) {
15
- const a = (e) => (r.tagValue || r.tagValue === 0) && e.tagConfig && e.tagConfig.length > 0 ? () => e.tagConfig.filter((u) => r.tagValue === u.value).map((u) => o(c, t(n(u, ["type", "size"]), {
13
+ const {
14
+ b: a
15
+ } = c("ap-label-group"), l = (e) => (r.tagValue || r.tagValue === 0) && e.tagConfig && e.tagConfig.length > 0 ? () => e.tagConfig.filter((u) => r.tagValue === u.value).map((u) => o(f, t(n(u, ["type", "size"]), {
16
16
  size: "small",
17
17
  type: "border"
18
18
  }), null)) : e.customRender ? () => o("div", null, [e.customRender(r.record)]) : null;
19
19
  return () => o("div", {
20
- class: f()
21
- }, [r.columns ? r.columns.map((e, u) => o(s, t({
20
+ class: a()
21
+ }, [r.columns ? r.columns.map((e, u) => o(i, t({
22
22
  key: u,
23
23
  show: r.value === e.value
24
24
  }, n(e, ["value", "tagConfig", "customRender"])), {
25
- custom: a(e)
26
- })) : o("div", null, [m("columns数组不能为空")])]);
25
+ custom: l(e)
26
+ })) : o("div", null, [s("columns数组不能为空")])]);
27
27
  }
28
28
  });
29
29
  export {
@@ -16,14 +16,15 @@ const O = /* @__PURE__ */ y({
16
16
  trigger: { default: "hover" },
17
17
  uiMode: {}
18
18
  },
19
- setup(m) {
20
- const o = m, { b: u, e: s, m: c } = B("ap-title"), d = A("ap-title"), f = V("apTitle", { uiMode: "aplus" }), g = a(
21
- () => o.uiMode || f.value?.uiMode
22
- ), h = a(() => o.helpIconColor ? {
19
+ setup(u) {
20
+ const o = u, { b: m, e: s, m: c } = B("ap-title"), d = A("ap-title"), f = V("apTitle", { uiMode: "aplus" }), g = a(() => {
21
+ const e = o.uiMode || f.value?.uiMode;
22
+ return e === "aplus" ? "user" : e;
23
+ }), h = a(() => o.helpIconColor ? {
23
24
  color: `${o.helpIconColor}`
24
25
  } : {});
25
26
  return (e, b) => (l(), n("div", {
26
- class: r([t(u)(), `${t(c)(g.value)}`, t(d)])
27
+ class: r([t(m)(), `${t(c)(g.value)}`, t(d)])
27
28
  }, [
28
29
  i("div", {
29
30
  class: r(t(s)("prefix"))
package/es/src/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export * from './ap-drawer';
11
11
  export * from './ap-pro-card';
12
12
  export * from './loading-bar';
13
13
  export * from './render';
14
+ export * from './time-ago';
14
15
  export * from './business';
15
16
  export * from './ap-table';
16
17
  export * from './editable-table';