@aplus-frontend/ui 7.14.1 → 7.14.3

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 (35) hide show
  1. package/es/src/ag-grid/hooks/use-columns-def.mjs +36 -34
  2. package/es/src/ag-grid/index.vue.mjs +1 -1
  3. package/es/src/ap-table/components/setting/modal/index.vue.mjs +99 -94
  4. package/es/src/ap-table/components/setting/template/index.vue.d.ts +1 -4
  5. package/es/src/ap-table/components/setting/template/index.vue2.mjs +25 -29
  6. package/es/src/ap-table/hooks/use-table-template-storage.d.ts +1 -1
  7. package/es/src/ap-table/hooks/use-table-template-storage.mjs +104 -91
  8. package/es/src/business/ap-product-info/ApProductInfo.mjs +41 -35
  9. package/es/src/business/ap-product-info/style/index.mjs +29 -18
  10. package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +45 -44
  11. package/es/src/business/ap-upload/components/Picture.vue2.mjs +90 -89
  12. package/es/src/skeleton/components/list/item.vue2.mjs +12 -12
  13. package/es/src/skeleton/components/page-header/index.vue2.mjs +11 -10
  14. package/es/src/skeleton/components/table/index.vue2.mjs +11 -10
  15. package/es/src/skeleton/components/table/item.vue2.mjs +21 -21
  16. package/es/src/version.d.ts +1 -1
  17. package/es/src/version.mjs +1 -1
  18. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  19. package/lib/src/ag-grid/index.vue.js +1 -1
  20. package/lib/src/ap-table/components/setting/modal/index.vue.js +1 -1
  21. package/lib/src/ap-table/components/setting/template/index.vue.d.ts +1 -4
  22. package/lib/src/ap-table/components/setting/template/index.vue2.js +1 -1
  23. package/lib/src/ap-table/hooks/use-table-template-storage.d.ts +1 -1
  24. package/lib/src/ap-table/hooks/use-table-template-storage.js +1 -1
  25. package/lib/src/business/ap-product-info/ApProductInfo.js +1 -1
  26. package/lib/src/business/ap-product-info/style/index.js +1 -1
  27. package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
  28. package/lib/src/business/ap-upload/components/Picture.vue2.js +1 -1
  29. package/lib/src/skeleton/components/list/item.vue2.js +1 -1
  30. package/lib/src/skeleton/components/page-header/index.vue2.js +1 -1
  31. package/lib/src/skeleton/components/table/index.vue2.js +1 -1
  32. package/lib/src/skeleton/components/table/item.vue2.js +1 -1
  33. package/lib/src/version.d.ts +1 -1
  34. package/lib/src/version.js +1 -1
  35. package/package.json +6 -6
@@ -1,151 +1,164 @@
1
- import { useToken as C } from "@aplus-frontend/antdv/es/theme/internal";
2
- import { isBoolean as J, isNumber as v, isObject as x, mergeWith as y, omit as M, isString as j } from "lodash-unified";
3
- import { ref as S, unref as c, watch as h } from "vue";
1
+ import { useToken as j } from "@aplus-frontend/antdv/es/theme/internal";
2
+ import { isBoolean as G, isNumber as h, isObject as b, mergeWith as z, omit as P, isString as R } from "lodash-unified";
3
+ import { ref as y, unref as p, watch as v } from "vue";
4
4
  import "../../config-provider/index.mjs";
5
- import { randomStr as A } from "../../utils/index.mjs";
6
- import { getColumnStateString as G } from "../components/setting/utils.mjs";
7
- import { useInjectApTable as P } from "../context.mjs";
8
- import { getTableTitle as R } from "../utils.mjs";
9
- import { useLocale as U } from "../../config-provider/hooks/use-locale.mjs";
10
- import { useNamespace as W } from "../../config-provider/hooks/use-namespace.mjs";
11
- function X(t, e, i, o) {
12
- return o ? o.fixed : e ? e.fixed : i && "fixed" in i ? i.fixed : J(t.fixed) ? t.fixed ? "left" : void 0 : t.fixed;
5
+ import { randomStr as E } from "../../utils/index.mjs";
6
+ import { getColumnStateString as U } from "../components/setting/utils.mjs";
7
+ import { useInjectApTable as W } from "../context.mjs";
8
+ import { getTableTitle as X } from "../utils.mjs";
9
+ import { useLocale as q } from "../../config-provider/hooks/use-locale.mjs";
10
+ import { useNamespace as D } from "../../config-provider/hooks/use-namespace.mjs";
11
+ function H(t, e, o, a) {
12
+ return a ? a.fixed : e ? e.fixed : o && "fixed" in o ? o.fixed : G(t.fixed) ? t.fixed ? "left" : void 0 : t.fixed;
13
13
  }
14
- const b = Number.MAX_SAFE_INTEGER, q = A();
15
- function D(t, e) {
16
- const i = v(t.order) ? t.order : b;
17
- let o = v(e.order) ? e.order : b;
18
- return t.fixed === "right" && e.fixed !== "right" && (o = i - 1), e.fixed === "left" && t.fixed !== "left" && (o = i - 1), i - o;
14
+ const k = Number.MAX_SAFE_INTEGER, A = E();
15
+ function Q(t, e) {
16
+ const o = h(t.order) ? t.order : k;
17
+ let a = h(e.order) ? e.order : k;
18
+ return t.fixed === "right" && e.fixed !== "right" && (a = o - 1), e.fixed === "left" && t.fixed !== "left" && (a = o - 1), o - a;
19
19
  }
20
- function H(t, e) {
20
+ function V(t, e) {
21
21
  e && t.removeItem(e);
22
22
  }
23
- function K(t, e) {
23
+ function I(t, e) {
24
24
  if (!e)
25
25
  return [];
26
- const i = t.getItem(e);
27
- if (!i)
26
+ const o = t.getItem(e);
27
+ if (!o)
28
28
  return [];
29
- const o = JSON.parse(i);
30
- return Array.isArray(o) ? o : (H(t, e), []);
29
+ const a = JSON.parse(o);
30
+ return Array.isArray(a) ? a : (V(t, e), []);
31
31
  }
32
- function k(t, e) {
33
- if (x(t) && x(e))
34
- return y({}, t, e, k);
32
+ function N(t, e) {
33
+ if (b(t) && b(e))
34
+ return z({}, t, e, N);
35
35
  }
36
- const ae = (t, e) => {
37
- const { columnsBackup: i, size: o } = P(), { t: I } = U(), { be: E } = W("ap-table"), [Q, N] = C(), m = S(), l = S(
38
- z(
39
- K(localStorage, c(e))
36
+ const le = (t, e, o) => {
37
+ const { columnsBackup: a, size: d } = W(), { t: _ } = q(), { be: L } = D("ap-table"), [Y, O] = j(), s = y(), l = y(
38
+ T(
39
+ I(localStorage, p(e))
40
40
  )
41
41
  );
42
- h(
43
- [i, o],
44
- ([r, n]) => {
45
- r && (m.value = {
42
+ v(
43
+ [a, d],
44
+ ([r, i]) => {
45
+ r && (s.value = {
46
46
  label: "basic_template",
47
47
  columnState: f(r),
48
- key: q,
49
- size: n
48
+ key: A,
49
+ size: i
50
50
  });
51
51
  },
52
52
  { immediate: !0, deep: !0 }
53
+ ), v(
54
+ () => e.value,
55
+ (r) => {
56
+ const i = T(
57
+ I(localStorage, r)
58
+ );
59
+ l.value = i, s.value = {
60
+ label: "basic_template",
61
+ columnState: f(a?.value || []),
62
+ key: A,
63
+ size: d?.value
64
+ }, o(i ?? []);
65
+ }
53
66
  );
54
- function z(r) {
55
- return r.length ? r.map((n) => ({
56
- ...n,
67
+ function T(r) {
68
+ return r.length ? r.map((i) => ({
69
+ ...i,
57
70
  columnState: f(
58
- i.value,
59
- n.columnState,
71
+ a.value,
72
+ i.columnState,
60
73
  !1
61
74
  )
62
75
  })) : [
63
76
  {
64
- label: I("ap.apTable.setting.defaultTemplate"),
65
- key: t.getActiveKey?.("DEFAULT_TEMPLATE") ?? A(),
66
- size: o?.value,
67
- columnState: f(i?.value || [])
77
+ label: _("ap.apTable.setting.defaultTemplate"),
78
+ key: t.getActiveKey?.("DEFAULT_TEMPLATE") ?? E(),
79
+ size: d?.value,
80
+ columnState: f(a?.value || [])
68
81
  }
69
82
  ];
70
83
  }
71
- function f(r, n = {}, a = !0) {
72
- const d = y(
84
+ function f(r, i = {}, n = !0) {
85
+ const c = z(
73
86
  {},
74
- a ? t.defaultValue || {} : {},
75
- n,
76
- k
87
+ n ? t.defaultValue || {} : {},
88
+ i,
89
+ N
77
90
  );
78
- function T(B, F, w) {
79
- return B.map((u) => {
80
- const g = F?.[u.key] || {}, s = {
91
+ function x(C, J, M) {
92
+ return C.map((u) => {
93
+ const S = J?.[u.key] || {}, m = {
81
94
  key: u.key,
82
- label: j(u.title) ? R(
95
+ label: R(u.title) ? X(
83
96
  u,
84
- E("table-header", "title"),
97
+ L("table-header", "title"),
85
98
  void 0,
86
- N.value.colorTextTertiary
99
+ O.value.colorTextTertiary
87
100
  ) : u.title,
88
101
  show: !0,
89
- fixed: X(
102
+ fixed: H(
90
103
  u,
91
104
  void 0,
92
- a ? t.defaultValue?.[u.key] : void 0,
93
- w
105
+ n ? t.defaultValue?.[u.key] : void 0,
106
+ M
94
107
  ),
95
108
  disabled: !1,
96
- ...M(g, ["children", "fixed"])
109
+ ...P(S, ["children", "fixed"])
97
110
  };
98
- return s.children = u.children?.length ? T(
111
+ return m.children = u.children?.length ? x(
99
112
  u.children,
100
- g.children,
101
- s
102
- ) : void 0, s;
103
- }).sort(D);
113
+ S.children,
114
+ m
115
+ ) : void 0, m;
116
+ }).sort(Q);
104
117
  }
105
- return T(r || [], d);
118
+ return x(r || [], c);
106
119
  }
107
- function p(r) {
108
- if (c(e)) {
109
- const n = r.map((a) => ({
110
- ...a,
111
- columnState: G(a.columnState)
120
+ function g(r) {
121
+ if (p(e)) {
122
+ const i = r.map((n) => ({
123
+ ...n,
124
+ columnState: U(n.columnState)
112
125
  }));
113
- localStorage.setItem(c(e), JSON.stringify(n));
126
+ localStorage.setItem(p(e), JSON.stringify(i));
114
127
  }
115
128
  }
116
- function L(r) {
129
+ function B(r) {
117
130
  l.value.push(r);
118
131
  }
119
- function _(r) {
120
- const n = l.value.findIndex(
121
- (a) => a.key === r
132
+ function F(r) {
133
+ const i = l.value.findIndex(
134
+ (n) => n.key === r
122
135
  );
123
- l.value.splice(n, 1);
136
+ l.value.splice(i, 1);
124
137
  }
125
- function O(r, n) {
126
- const a = l.value.findIndex(
127
- (d) => d.key === r
138
+ function w(r, i) {
139
+ const n = l.value.findIndex(
140
+ (c) => c.key === r
128
141
  );
129
- return l.value[a] = {
130
- ...l.value[a],
131
- ...n
132
- }, l.value[a];
142
+ return l.value[n] = {
143
+ ...l.value[n],
144
+ ...i
145
+ }, l.value[n];
133
146
  }
134
- return h(
147
+ return v(
135
148
  () => l.value,
136
149
  (r) => {
137
- p(r);
150
+ g(r);
138
151
  },
139
152
  { deep: !0, immediate: !0 }
140
153
  ), {
141
- basicTemplate: m,
154
+ basicTemplate: s,
142
155
  customizeTemplateList: l,
143
- syncTemplateListToStorage: p,
144
- addTemplate: L,
145
- deleteTemplate: _,
146
- updateTemplate: O
156
+ syncTemplateListToStorage: g,
157
+ addTemplate: B,
158
+ deleteTemplate: F,
159
+ updateTemplate: w
147
160
  };
148
161
  };
149
162
  export {
150
- ae as useTableTemplateStorage
163
+ le as useTableTemplateStorage
151
164
  };
@@ -1,69 +1,75 @@
1
- import { defineComponent as f, h as t, createVNode as e, createTextVNode as v } from "vue";
2
- import { Space as h, Tooltip as y } from "@aplus-frontend/antdv";
3
- import { IconApAdFillWarn as g } from "@aplus-frontend/icon";
1
+ import { defineComponent as v, useSlots as h, h as s, createVNode as e, createTextVNode as y } from "vue";
2
+ import { Space as g, Tooltip as m } from "@aplus-frontend/antdv";
3
+ import { IconApAdFillWarn as k } from "@aplus-frontend/icon";
4
4
  import "../../config-provider/index.mjs";
5
- import { ApCopy as s } from "../ap-copy/index.mjs";
6
- import { ApImage as m } from "../ap-image/index.mjs";
7
- import { ApProductInfoProps as k } from "./constans.mjs";
8
- import b from "./style/index.mjs";
9
- import { useNamespace as w } from "../../config-provider/hooks/use-namespace.mjs";
10
- const T = /* @__PURE__ */ f({
5
+ import { ApCopy as i } from "../ap-copy/index.mjs";
6
+ import { ApImage as w } from "../ap-image/index.mjs";
7
+ import { ApProductInfoProps as b } from "./constans.mjs";
8
+ import x from "./style/index.mjs";
9
+ import { useNamespace as A } from "../../config-provider/hooks/use-namespace.mjs";
10
+ const W = /* @__PURE__ */ v({
11
11
  name: "ApProductInfo",
12
- props: k(),
13
- setup(r) {
12
+ props: b(),
13
+ setup(t) {
14
14
  const {
15
- b: i,
15
+ b: n,
16
16
  e: o,
17
- m: a
18
- } = w("ap-product-info"), c = b("ap-product-info"), p = (l) => typeof l.value == "function" ? l.value() : l.helpMessage ? t(h.Compact, {}, [t(s, {
17
+ m: r
18
+ } = A("ap-product-info"), c = x("ap-product-info"), p = h(), u = (l) => typeof l.value == "function" ? l.value() : l.helpMessage ? s(g.Compact, {}, [s(i, {
19
19
  text: l.value,
20
20
  link: l.link,
21
21
  textStyle: l.link ? "link" : "minor"
22
- }), t(y, {
22
+ }), s(m, {
23
23
  placement: "top",
24
24
  color: l.toolTipBgColor,
25
- title: typeof l.helpMessage == "string" ? l.helpMessage : t(l.helpMessage)
26
- }, () => t(g, {
25
+ title: typeof l.helpMessage == "string" ? l.helpMessage : s(l.helpMessage)
26
+ }, () => s(k, {
27
27
  color: "#FFA940",
28
28
  style: {
29
29
  cursor: "pointer"
30
30
  }
31
- }))]) : t(s, {
31
+ }))]) : s(i, {
32
32
  text: l.value,
33
33
  textStyle: l.link ? "link" : "minor",
34
34
  link: l.link,
35
- disableCopy: r.disableCopy
35
+ disableCopy: t.disableCopy
36
36
  }, l.value);
37
37
  return () => e("div", {
38
- class: [i(), c.value]
39
- }, [r.showImg && e("div", {
38
+ class: [n(), c.value]
39
+ }, [t.showImg && e("div", {
40
40
  class: o("img")
41
- }, [e(m, {
42
- src: r.imgSrc,
41
+ }, [e(w, {
42
+ src: t.imgSrc,
43
43
  width: 44,
44
44
  height: 44,
45
- preview: r.preview
45
+ preview: t.preview
46
46
  }, null)]), e("div", {
47
47
  class: [o("content")]
48
- }, [e(s, {
49
- disableCopy: r.disableCopy
48
+ }, [e("div", {
49
+ class: o("wrap-title")
50
+ }, [e("div", {
51
+ class: o("title")
52
+ }, [e(i, {
53
+ disableCopy: t.disableCopy
50
54
  }, {
51
- default: () => [r.title]
52
- }), e("div", {
55
+ default: () => [t.title]
56
+ })]), e("div", {
57
+ class: o("title-suffix")
58
+ }, [p["title-suffix"]?.()])]), e("div", {
53
59
  class: o("row-container")
54
- }, [r.values.map((l, u) => {
55
- const n = l.col === 2, d = l.col !== 2 && u % 2 === 0;
60
+ }, [t.values.map((l, d) => {
61
+ const a = l.col === 2, f = l.col !== 2 && d % 2 === 0;
56
62
  return e("div", {
57
63
  key: JSON.stringify(l),
58
- class: [o("row-item"), a(n ? "full" : "half")]
64
+ class: [o("row-item"), r(a ? "full" : "half")]
59
65
  }, [e("div", {
60
66
  class: [o("item")]
61
67
  }, [l.label && e("div", {
62
68
  class: o("label")
63
- }, [l.label, e("span", null, [v(":")])]), e("div", {
64
- class: [o("value"), !n && a("overflow")],
69
+ }, [l.label, e("span", null, [y(":")])]), e("div", {
70
+ class: [o("value"), !a && r("overflow")],
65
71
  title: typeof l.value != "function" ? String(l.value || "") : ""
66
- }, [p(l)])]), d && e("div", {
72
+ }, [u(l)])]), f && e("div", {
67
73
  class: o("divider"),
68
74
  style: {
69
75
  right: 0
@@ -75,5 +81,5 @@ const T = /* @__PURE__ */ f({
75
81
  }
76
82
  });
77
83
  export {
78
- T as default
84
+ W as default
79
85
  };
@@ -1,30 +1,41 @@
1
- import { genComponentStyleHook as e } from "../../../utils/cssinjs/index.mjs";
2
- const o = (i) => {
3
- const { componentCls: l } = i;
1
+ import { genComponentStyleHook as l } from "../../../utils/cssinjs/index.mjs";
2
+ const a = (i) => {
3
+ const { componentCls: e } = i;
4
4
  return {
5
- [l]: {
5
+ [e]: {
6
6
  display: "flex",
7
- [`${l}__img`]: {
7
+ [`${e}__img`]: {
8
8
  width: i.apProductInfoImageSize,
9
9
  height: i.apProductInfoImageSize,
10
10
  marginInlineEnd: i.space,
11
11
  flexShrink: 0
12
12
  },
13
- [`${l}__content`]: {
13
+ [`${e}__content`]: {
14
14
  flex: 1,
15
15
  display: "flex",
16
16
  flexDirection: "column",
17
17
  overflow: "hidden"
18
18
  },
19
- [`${l}__row-container `]: {
19
+ [`${e}__wrap-title`]: {
20
+ display: "flex",
21
+ alignItems: "center"
22
+ },
23
+ [`${e}__title`]: {
24
+ flex: 1,
25
+ minWidth: 0
26
+ },
27
+ [`${e}__title-suffix`]: {
28
+ marginLeft: "4px"
29
+ },
30
+ [`${e}__row-container `]: {
20
31
  display: "flex",
21
32
  flexWrap: "wrap"
22
33
  },
23
- [`${l}__row-item`]: {
34
+ [`${e}__row-item`]: {
24
35
  position: "relative",
25
36
  display: "flex"
26
37
  },
27
- [`${l}__divider`]: {
38
+ [`${e}__divider`]: {
28
39
  width: i.lineWidth,
29
40
  position: "relative",
30
41
  height: "12px",
@@ -34,21 +45,21 @@ const o = (i) => {
34
45
  marginInlineStart: i.spaceSM,
35
46
  zIndex: 1
36
47
  },
37
- [`${l}__divider-vertical`]: {
48
+ [`${e}__divider-vertical`]: {
38
49
  width: i.lineWidth,
39
50
  height: "100%",
40
51
  backgroundColor: i.colorBg1,
41
52
  position: "absolute",
42
53
  transform: "translateX(-50%)"
43
54
  },
44
- [`${l}__item`]: {
55
+ [`${e}__item`]: {
45
56
  display: "flex",
46
57
  alignItems: "baseline"
47
58
  },
48
- [`${l}--full`]: {
59
+ [`${e}--full`]: {
49
60
  width: "100%"
50
61
  },
51
- [`${l}__label`]: {
62
+ [`${e}__label`]: {
52
63
  color: i.textColor3,
53
64
  flexShrink: 0,
54
65
  span: {
@@ -57,27 +68,27 @@ const o = (i) => {
57
68
  paddingBlock: 0
58
69
  }
59
70
  },
60
- [`${l}__value`]: {
71
+ [`${e}__value`]: {
61
72
  maxWidth: i.apProductInfoMaxWidth,
62
73
  color: i.textColor3,
63
74
  overflow: "hidden",
64
75
  textOverflow: "ellipsis",
65
76
  whiteSpace: "nowrap"
66
77
  },
67
- [`${l}--link`]: {
78
+ [`${e}--link`]: {
68
79
  color: i.colorLink,
69
80
  cursor: "pointer"
70
81
  }
71
82
  }
72
83
  };
73
- }, r = e(
84
+ }, o = l(
74
85
  "ApProductInfo",
75
- (i) => [o(i)],
86
+ (i) => [a(i)],
76
87
  {
77
88
  apProductInfoImageSize: 44,
78
89
  apProductInfoMaxWidth: 300
79
90
  }
80
91
  );
81
92
  export {
82
- r as default
93
+ o as default
83
94
  };