@aplus-frontend/ui 0.4.13 → 0.4.14

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 (53) hide show
  1. package/es/index.mjs +84 -80
  2. package/es/src/ap-descriptions/help-message/index.vue2.mjs +17 -12
  3. package/es/src/ap-field/date/helper.mjs +9 -9
  4. package/es/src/ap-table/hooks/use-table-paging-ng.mjs +62 -62
  5. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +79 -67
  6. package/es/src/hooks/index.d.ts +1 -0
  7. package/es/src/hooks/index.mjs +6 -4
  8. package/es/src/hooks/useResize.d.ts +8 -0
  9. package/es/src/hooks/useResize.mjs +23 -0
  10. package/es/src/index.d.ts +1 -0
  11. package/es/src/index.mjs +212 -209
  12. package/es/src/path-map.mjs +2 -1
  13. package/es/src/resize-observer/index.d.ts +3 -0
  14. package/es/src/resize-observer/index.mjs +2 -0
  15. package/es/src/resize-observer/index.vue.d.ts +25 -0
  16. package/es/src/resize-observer/index.vue.mjs +45 -0
  17. package/es/src/resize-observer/index.vue2.mjs +4 -0
  18. package/es/src/resize-observer/interface.d.ts +27 -0
  19. package/es/src/resize-observer/interface.mjs +1 -0
  20. package/es/src/resize-observer/style/css.d.ts +1 -0
  21. package/es/src/resize-observer/style/css.js +1 -0
  22. package/es/src/resize-observer/style/index.d.ts +1 -0
  23. package/es/src/resize-observer/style/index.js +1 -0
  24. package/lib/index.js +1 -1
  25. package/lib/src/ap-descriptions/help-message/index.vue2.js +1 -1
  26. package/lib/src/ap-field/date/helper.js +1 -1
  27. package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
  28. package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
  29. package/lib/src/hooks/index.d.ts +1 -0
  30. package/lib/src/hooks/index.js +1 -1
  31. package/lib/src/hooks/useResize.d.ts +8 -0
  32. package/lib/src/hooks/useResize.js +1 -0
  33. package/lib/src/index.d.ts +1 -0
  34. package/lib/src/index.js +1 -1
  35. package/lib/src/path-map.js +1 -1
  36. package/lib/src/resize-observer/index.d.ts +3 -0
  37. package/lib/src/resize-observer/index.js +1 -0
  38. package/lib/src/resize-observer/index.vue.d.ts +25 -0
  39. package/lib/src/resize-observer/index.vue.js +1 -0
  40. package/lib/src/resize-observer/index.vue2.js +1 -0
  41. package/lib/src/resize-observer/interface.d.ts +27 -0
  42. package/lib/src/resize-observer/interface.js +1 -0
  43. package/lib/src/resize-observer/style/css.cjs +1 -0
  44. package/lib/src/resize-observer/style/css.d.ts +1 -0
  45. package/lib/src/resize-observer/style/index.cjs +1 -0
  46. package/lib/src/resize-observer/style/index.d.ts +1 -0
  47. package/package.json +3 -3
  48. package/theme/ap-descriptions/ap-descriptions.css +3 -0
  49. package/theme/ap-descriptions/ap-descriptions.less +7 -0
  50. package/theme/ap-table/ap-table.css +1 -1
  51. package/theme/ap-table/ap-table.less +1 -1
  52. package/theme/ap-table-modal/index.css +1 -1
  53. package/theme/index.css +4 -1
@@ -1,16 +1,16 @@
1
- import { defineComponent as j, computed as s, ref as I, openBlock as v, createBlock as x, unref as a, normalizeClass as N, withCtx as r, createVNode as g, createTextVNode as b, toDisplayString as p, mergeProps as O, createCommentVNode as V } from "vue";
2
- import { DownOutlined as q } from "@ant-design/icons-vue";
3
- import { message as z, Dropdown as $, Menu as H, MenuItem as C, Button as J } from "@aplus-frontend/antdv";
1
+ import { defineComponent as N, ref as L, computed as s, watch as O, openBlock as g, createBlock as p, unref as o, normalizeClass as V, withCtx as n, createVNode as b, createTextVNode as w, toDisplayString as h, mergeProps as q, createCommentVNode as z } from "vue";
2
+ import { DownOutlined as U } from "@ant-design/icons-vue";
3
+ import { message as $, Dropdown as H, Menu as J, MenuItem as S, Button as Q } from "@aplus-frontend/antdv";
4
4
  import "../../config-provider/index.mjs";
5
- import { ApExportGroupActionType as f } from "./interface.mjs";
6
- import { usePermission as Q } from "@aplus-frontend/hooks";
7
- import { handleExportDownload as U } from "./handleExportDownload.mjs";
8
- import { useInjectApTable as W } from "../../ap-table/context.mjs";
9
- import { convertExportField as X } from "./convertExportField.mjs";
10
- import { useNamespace as Y } from "../../config-provider/hooks/use-namespace.mjs";
11
- import { useLocale as Z } from "../../config-provider/hooks/use-locale.mjs";
12
- import { useGlobalConfig as _ } from "../../config-provider/hooks/use-global-config.mjs";
13
- const fe = /* @__PURE__ */ j({
5
+ import { ApExportGroupActionType as m } from "./interface.mjs";
6
+ import { usePermission as W } from "@aplus-frontend/hooks";
7
+ import { handleExportDownload as X } from "./handleExportDownload.mjs";
8
+ import { useInjectApTable as Y } from "../../ap-table/context.mjs";
9
+ import { convertExportField as Z } from "./convertExportField.mjs";
10
+ import { useNamespace as ee } from "../../config-provider/hooks/use-namespace.mjs";
11
+ import { useLocale as te } from "../../config-provider/hooks/use-locale.mjs";
12
+ import { useGlobalConfig as A } from "../../config-provider/hooks/use-global-config.mjs";
13
+ const ve = /* @__PURE__ */ N({
14
14
  __name: "ApExportGroup",
15
15
  props: {
16
16
  selectedRowKeys: {},
@@ -26,84 +26,96 @@ const fe = /* @__PURE__ */ j({
26
26
  successMessage: { type: [Boolean, String], default: !1 },
27
27
  exportField: { type: [Boolean, Object], default: void 0 }
28
28
  },
29
- setup(L) {
30
- const { hasPermission: S } = Q(), e = L, { columns: n, dataSource: u } = W(), { b: A } = Y("ap-export-group"), { t: i } = Z(), B = _("uiMode"), w = _("exportField"), G = s(() => {
29
+ setup(_) {
30
+ const { hasPermission: B } = W(), e = _, { columns: u, dataSource: r } = Y(), { b: G } = ee("ap-export-group"), { t: i } = te(), P = A("uiMode"), E = A("exportField"), c = L(!1), v = L(!1), K = s(() => {
31
31
  const t = {
32
32
  aplus: "#0070FF",
33
33
  admin: "#34b77c"
34
34
  };
35
- return h.value ? "" : t[B.value] || t.aplus;
36
- }), h = s(
35
+ return d.value ? "" : t[P.value] || t.aplus;
36
+ }), d = s(
37
37
  () => {
38
38
  var t;
39
- return !!(e != null && e.disabled) || (u !== void 0 ? !((t = u == null ? void 0 : u.value) != null && t.length) : !1) || c.value;
39
+ return !!(e != null && e.disabled) || (r !== void 0 ? !((t = r == null ? void 0 : r.value) != null && t.length) : !1) || c.value;
40
40
  }
41
- ), P = s(() => (e == null ? void 0 : e.successMessage) === !0 ? i("ap.apExportGroup.exportSuccess") : e != null && e.successMessage ? e.successMessage : ""), m = s(() => {
42
- const t = "exportFieldList", o = (e == null ? void 0 : e.exportField) ?? (w.value === "" ? !0 : w.value) ?? !1;
43
- return o === !0 ? {
41
+ );
42
+ O(
43
+ () => d.value,
44
+ () => {
45
+ d.value && (v.value = !1);
46
+ },
47
+ {
48
+ immediate: !0
49
+ }
50
+ );
51
+ const D = s(() => (e == null ? void 0 : e.successMessage) === !0 ? i("ap.apExportGroup.exportSuccess") : e != null && e.successMessage ? e.successMessage : ""), y = s(() => {
52
+ const t = "exportFieldList", a = (e == null ? void 0 : e.exportField) ?? (E.value === "" ? !0 : E.value) ?? !1;
53
+ return a === !0 ? {
44
54
  key: t
45
- } : typeof o == "object" ? {
46
- ...o,
47
- key: o.key ?? t
48
- } : o;
49
- }), K = {
55
+ } : typeof a == "object" ? {
56
+ ...a,
57
+ key: a.key ?? t
58
+ } : a;
59
+ }), R = {
50
60
  textAlign: "center"
51
- }, c = I(!1), E = s(() => (e == null ? void 0 : e.selectedRowKeys) || []), D = s(() => {
61
+ }, F = s(() => (e == null ? void 0 : e.selectedRowKeys) || []), T = s(() => {
52
62
  let t = e == null ? void 0 : e.ifShow;
53
- return !(e != null && e.ifShow) && (e != null && e.auth) && (t = () => S(e.auth)), (t == null ? void 0 : t()) ?? !0;
63
+ return !(e != null && e.ifShow) && (e != null && e.auth) && (t = () => B(e.auth)), (t == null ? void 0 : t()) ?? !0;
54
64
  });
55
- async function R({ key: t }) {
56
- var F, M, k;
57
- const { getRequestParams: o, request: l } = e || {};
58
- let y = {};
59
- t === f.SELECT ? y = {
60
- [(e == null ? void 0 : e.idKey) || "ids"]: E.value
61
- } : t === f.ALL && (y = (o == null ? void 0 : o()) || {});
62
- const T = ((F = e == null ? void 0 : e.getInitialParams) == null ? void 0 : F.call(e)) || {};
65
+ async function j({ key: t }) {
66
+ var M, k, C;
67
+ const { getRequestParams: a, request: l } = e || {};
68
+ let x = {};
69
+ t === m.SELECT ? x = {
70
+ [(e == null ? void 0 : e.idKey) || "ids"]: F.value
71
+ } : t === m.ALL && (x = (a == null ? void 0 : a()) || {});
72
+ const I = ((M = e == null ? void 0 : e.getInitialParams) == null ? void 0 : M.call(e)) || {};
63
73
  try {
64
74
  c.value = !0;
65
- let d = Object.assign(
75
+ let f = Object.assign(
66
76
  {
67
- ...y,
68
- ...T
77
+ ...x,
78
+ ...I
69
79
  },
70
- m.value && (n != null && n.value) ? {
71
- [m.value.key]: X(
72
- n.value,
73
- (M = m.value) == null ? void 0 : M.convertField
80
+ y.value && (u != null && u.value) ? {
81
+ [y.value.key]: Z(
82
+ u.value,
83
+ (k = y.value) == null ? void 0 : k.convertField
74
84
  )
75
85
  } : {}
76
86
  );
77
- d = ((k = e == null ? void 0 : e.beforeRequest) == null ? void 0 : k.call(e, d)) || d, await U(async () => await (l == null ? void 0 : l(d))), e != null && e.successMessage && z.success(P.value);
87
+ f = ((C = e == null ? void 0 : e.beforeRequest) == null ? void 0 : C.call(e, f)) || f, await X(async () => await (l == null ? void 0 : l(f))), e != null && e.successMessage && $.success(D.value);
78
88
  } finally {
79
89
  c.value = !1;
80
90
  }
81
91
  }
82
- return (t, o) => D.value ? (v(), x(a($), {
92
+ return (t, a) => T.value ? (g(), p(o(H), {
83
93
  key: 0,
84
- class: N([a(A)()]),
85
- "overlay-style": K,
86
- disabled: h.value
94
+ open: v.value,
95
+ "onUpdate:open": a[0] || (a[0] = (l) => v.value = l),
96
+ class: V([o(G)()]),
97
+ "overlay-style": R,
98
+ disabled: d.value
87
99
  }, {
88
- overlay: r(() => [
89
- g(a(H), { onClick: R }, {
90
- default: r(() => {
100
+ overlay: n(() => [
101
+ b(o(J), { onClick: j }, {
102
+ default: n(() => {
91
103
  var l;
92
104
  return [
93
- (v(), x(a(C), {
94
- key: a(f).SELECT,
95
- disabled: ((l = E.value) == null ? void 0 : l.length) === 0
105
+ (g(), p(o(S), {
106
+ key: o(m).SELECT,
107
+ disabled: ((l = F.value) == null ? void 0 : l.length) === 0
96
108
  }, {
97
- default: r(() => [
98
- b(p(a(i)("ap.apExportGroup.exportSelected")), 1)
109
+ default: n(() => [
110
+ w(h(o(i)("ap.apExportGroup.exportSelected")), 1)
99
111
  ]),
100
112
  _: 1
101
113
  }, 8, ["disabled"])),
102
- (v(), x(a(C), {
103
- key: a(f).ALL
114
+ (g(), p(o(S), {
115
+ key: o(m).ALL
104
116
  }, {
105
- default: r(() => [
106
- b(p(a(i)("ap.apExportGroup.exportAll")), 1)
117
+ default: n(() => [
118
+ w(h(o(i)("ap.apExportGroup.exportAll")), 1)
107
119
  ]),
108
120
  _: 1
109
121
  }))
@@ -112,26 +124,26 @@ const fe = /* @__PURE__ */ j({
112
124
  _: 1
113
125
  })
114
126
  ]),
115
- default: r(() => [
116
- g(a(J), O({
127
+ default: n(() => [
128
+ b(o(Q), q({
117
129
  ...t.$attrs
118
130
  }, {
119
131
  style: {
120
- color: G.value
132
+ color: K.value
121
133
  },
122
134
  loading: c.value
123
135
  }), {
124
- default: r(() => [
125
- b(p((e == null ? void 0 : e.text) ?? a(i)("ap.apExportGroup.export")) + " ", 1),
126
- g(a(q))
136
+ default: n(() => [
137
+ w(h((e == null ? void 0 : e.text) ?? o(i)("ap.apExportGroup.export")) + " ", 1),
138
+ b(o(U))
127
139
  ]),
128
140
  _: 1
129
141
  }, 16, ["style", "loading"])
130
142
  ]),
131
143
  _: 1
132
- }, 8, ["class", "disabled"])) : V("", !0);
144
+ }, 8, ["open", "class", "disabled"])) : z("", !0);
133
145
  }
134
146
  });
135
147
  export {
136
- fe as default
148
+ ve as default
137
149
  };
@@ -3,3 +3,4 @@ export { useControllableValue } from './useControllableValue';
3
3
  export { useManualRef } from './useManualRef';
4
4
  export { useThrottleRef } from './useThrottleRef';
5
5
  export { useFullScreen } from './useFullScreen';
6
+ export * from './useResize';
@@ -1,12 +1,14 @@
1
1
  import { useMessage as r } from "./useMessage.mjs";
2
2
  import { useControllableValue as t } from "./useControllableValue.mjs";
3
3
  import { useManualRef as f } from "./useManualRef.mjs";
4
- import { useThrottleRef as a } from "./useThrottleRef.mjs";
5
- import { useFullScreen as p } from "./useFullScreen.mjs";
4
+ import { useThrottleRef as m } from "./useThrottleRef.mjs";
5
+ import { useFullScreen as x } from "./useFullScreen.mjs";
6
+ import { useResize as n } from "./useResize.mjs";
6
7
  export {
7
8
  t as useControllableValue,
8
- p as useFullScreen,
9
+ x as useFullScreen,
9
10
  f as useManualRef,
10
11
  r as useMessage,
11
- a as useThrottleRef
12
+ n as useResize,
13
+ m as useThrottleRef
12
14
  };
@@ -0,0 +1,8 @@
1
+ export type ResizeHandlerFn = (entry: ResizeObserverEntry) => void;
2
+ declare function observe(el: Element, handler: ResizeHandlerFn): void;
3
+ declare function unobserve(el: Element): void;
4
+ export declare const useResize: () => {
5
+ observe: typeof observe;
6
+ unobserve: typeof unobserve;
7
+ };
8
+ export {};
@@ -0,0 +1,23 @@
1
+ import { isClient as s } from "@vueuse/core";
2
+ import { isFunction as a } from "lodash-unified";
3
+ const i = /* @__PURE__ */ new WeakMap();
4
+ let n;
5
+ s && (n = new ResizeObserver((e) => {
6
+ e.forEach((t) => {
7
+ const o = i.get(t.target);
8
+ a(o) && o(t);
9
+ });
10
+ }));
11
+ function f(e, t) {
12
+ i.set(e, t), n == null || n.observe(e);
13
+ }
14
+ function r(e) {
15
+ i.has(e) && i.delete(e), n == null || n.unobserve(e);
16
+ }
17
+ const p = () => ({
18
+ observe: f,
19
+ unobserve: r
20
+ });
21
+ export {
22
+ p as useResize
23
+ };
package/es/src/index.d.ts CHANGED
@@ -21,3 +21,4 @@ export * from './scroll-bar';
21
21
  export * from './scroll-view';
22
22
  export * from './portal';
23
23
  export * from './full-screen';
24
+ export * from './resize-observer';