@aplus-frontend/ui 0.4.12 → 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 (71) 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/business/ap-table-modal/hooks/use-table-select-modal.d.ts +5 -2
  7. package/es/src/business/ap-table-modal/hooks/use-table-select-modal.mjs +31 -21
  8. package/es/src/business/ap-table-modal/interface.d.ts +3 -1
  9. package/es/src/business/ap-table-modal/table-layout/index.vue.d.ts +4 -2
  10. package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +53 -46
  11. package/es/src/business/ap-title/interface.d.ts +1 -1
  12. package/es/src/hooks/index.d.ts +1 -0
  13. package/es/src/hooks/index.mjs +6 -4
  14. package/es/src/hooks/useResize.d.ts +8 -0
  15. package/es/src/hooks/useResize.mjs +23 -0
  16. package/es/src/index.d.ts +1 -0
  17. package/es/src/index.mjs +212 -209
  18. package/es/src/path-map.mjs +2 -1
  19. package/es/src/resize-observer/index.d.ts +3 -0
  20. package/es/src/resize-observer/index.mjs +2 -0
  21. package/es/src/resize-observer/index.vue.d.ts +25 -0
  22. package/es/src/resize-observer/index.vue.mjs +45 -0
  23. package/es/src/resize-observer/index.vue2.mjs +4 -0
  24. package/es/src/resize-observer/interface.d.ts +27 -0
  25. package/es/src/resize-observer/interface.mjs +1 -0
  26. package/es/src/resize-observer/style/css.d.ts +1 -0
  27. package/es/src/resize-observer/style/css.js +1 -0
  28. package/es/src/resize-observer/style/index.d.ts +1 -0
  29. package/es/src/resize-observer/style/index.js +1 -0
  30. package/lib/index.js +1 -1
  31. package/lib/src/ap-descriptions/help-message/index.vue2.js +1 -1
  32. package/lib/src/ap-field/date/helper.js +1 -1
  33. package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
  34. package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
  35. package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +5 -2
  36. package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.js +1 -1
  37. package/lib/src/business/ap-table-modal/interface.d.ts +3 -1
  38. package/lib/src/business/ap-table-modal/table-layout/index.vue.d.ts +4 -2
  39. package/lib/src/business/ap-table-modal/table-layout/index.vue2.js +1 -1
  40. package/lib/src/business/ap-title/interface.d.ts +1 -1
  41. package/lib/src/hooks/index.d.ts +1 -0
  42. package/lib/src/hooks/index.js +1 -1
  43. package/lib/src/hooks/useResize.d.ts +8 -0
  44. package/lib/src/hooks/useResize.js +1 -0
  45. package/lib/src/index.d.ts +1 -0
  46. package/lib/src/index.js +1 -1
  47. package/lib/src/path-map.js +1 -1
  48. package/lib/src/resize-observer/index.d.ts +3 -0
  49. package/lib/src/resize-observer/index.js +1 -0
  50. package/lib/src/resize-observer/index.vue.d.ts +25 -0
  51. package/lib/src/resize-observer/index.vue.js +1 -0
  52. package/lib/src/resize-observer/index.vue2.js +1 -0
  53. package/lib/src/resize-observer/interface.d.ts +27 -0
  54. package/lib/src/resize-observer/interface.js +1 -0
  55. package/lib/src/resize-observer/style/css.cjs +1 -0
  56. package/lib/src/resize-observer/style/css.d.ts +1 -0
  57. package/lib/src/resize-observer/style/index.cjs +1 -0
  58. package/lib/src/resize-observer/style/index.d.ts +1 -0
  59. package/package.json +1 -1
  60. package/theme/ap-descriptions/ap-descriptions.css +3 -0
  61. package/theme/ap-descriptions/ap-descriptions.less +7 -0
  62. package/theme/ap-form/ap-form-item.css +7 -4
  63. package/theme/ap-form/ap-form-item.less +10 -7
  64. package/theme/ap-form/index.css +7 -7
  65. package/theme/ap-form/search-form.css +7 -7
  66. package/theme/ap-form/search-form.less +0 -6
  67. package/theme/ap-table/ap-table.css +8 -8
  68. package/theme/ap-table/ap-table.less +1 -1
  69. package/theme/ap-table-modal/index.css +8 -8
  70. package/theme/editable-table/index.css +7 -7
  71. package/theme/index.css +11 -8
@@ -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
  };
@@ -1,4 +1,4 @@
1
- import { OpenOptions, UseTableSelectModalProps, OpenReturnType } from '../interface';
1
+ import { OpenOptions, UseTableSelectModalProps } from '../interface';
2
2
  import { Recordable } from '../../../type';
3
3
  import { TableColumnsType } from '@aplus-frontend/antdv';
4
4
  export declare function useTableSelectModal<TableRowType = Record<string, any>>(props: UseTableSelectModalProps<TableRowType>): {
@@ -24,7 +24,10 @@ export declare function useTableSelectModal<TableRowType = Record<string, any>>(
24
24
  getShownColumns: () => TableColumnsType<any>;
25
25
  } | null | undefined;
26
26
  isDestroyed: true;
27
- open: (selected?: any[], options?: OpenOptions) => Promise< OpenReturnType<TableRowType>>;
27
+ open: (selected?: any[], options?: OpenOptions) => Promise<{
28
+ keys: any[];
29
+ rows: TableRowType[];
30
+ }>;
28
31
  destroy: () => void;
29
32
  close: () => void;
30
33
  };
@@ -1,27 +1,37 @@
1
- import { onUnmounted as m } from "vue";
2
- import { useCreateTableModal as w } from "./use-create-table-modal.mjs";
3
- const f = (e) => e.id;
4
- function K(e) {
5
- const { finishCallback: o, getRowKey: r, ...a } = e, { destroy: t, openModal: c, closeModal: d, ...l } = w({
6
- ...a,
1
+ import { onUnmounted as f } from "vue";
2
+ import { useCreateTableModal as i } from "./use-create-table-modal.mjs";
3
+ import { AsyncOpenResultError as d } from "../interface.mjs";
4
+ const p = (t) => t.id;
5
+ function K(t) {
6
+ const { finishCallback: n, getRowKey: e, ...u } = t, { destroy: a, openModal: y, closeModal: c, ...m } = i({
7
+ ...u,
7
8
  destroyOnUnmounted: !1,
8
- getRowKey: r || f
9
- }), u = async (p = [], y = {}) => {
10
- const s = await c(p, y) || {
11
- keys: [],
12
- rows: []
13
- };
14
- return o == null || o(s), s;
15
- }, n = () => {
16
- d();
9
+ getRowKey: e || p
10
+ }), l = async (o = [], w = {}) => {
11
+ try {
12
+ const r = await y(o, w) || {
13
+ keys: [],
14
+ rows: []
15
+ };
16
+ return n == null || n(r), r;
17
+ } catch (r) {
18
+ if (r === d.ModalCancel)
19
+ return {
20
+ keys: o == null ? void 0 : o.map(e || p),
21
+ rows: o
22
+ };
23
+ throw r;
24
+ }
25
+ }, s = () => {
26
+ c();
17
27
  };
18
- return m(() => {
19
- n(), t();
28
+ return f(() => {
29
+ s(), a();
20
30
  }), {
21
- open: u,
22
- destroy: t,
23
- close: n,
24
- ...l
31
+ open: l,
32
+ destroy: a,
33
+ close: s,
34
+ ...m
25
35
  };
26
36
  }
27
37
  export {
@@ -72,7 +72,9 @@ export interface ModalTitleSlots {
72
72
  /** table-layout Props */
73
73
  export interface TableLayoutConfig {
74
74
  /** 左侧标题 */
75
- leftTitle?: string;
75
+ leftTitle?: string | VNodeChild;
76
+ /** 右侧标题 */
77
+ rightTitle?: (selectedCount: number) => string | VNodeChild;
76
78
  /** 已经选择item渲染, renderSelectedItem有值才为复杂布局 */
77
79
  renderSelectedItem?: (record: any, actions: {
78
80
  deleteItem: (record: any) => void;
@@ -1,5 +1,5 @@
1
1
  import { TableLayoutConfig } from '../interface';
2
- import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, VNodeArrayChildren, VNode, RendererNode, RendererElement, ComponentProvideOptions } from 'vue';
3
3
  type __VLS_Props = TableLayoutConfig & {
4
4
  selectedList: any[];
5
5
  };
@@ -20,7 +20,9 @@ declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, Comp
20
20
  onClear?: (() => any) | undefined;
21
21
  onDeleteItem?: ((record: any) => any) | undefined;
22
22
  }>, {
23
- leftTitle: string;
23
+ leftTitle: string | number | boolean | void | VNodeArrayChildren | VNode<RendererNode, RendererElement, {
24
+ [key: string]: any;
25
+ }> | null;
24
26
  selectedList: any[];
25
27
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
26
28
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -1,82 +1,89 @@
1
- import { defineComponent as S, openBlock as a, createElementBlock as n, normalizeClass as o, unref as t, Fragment as c, createElementVNode as r, createVNode as s, renderSlot as u, withCtx as f, createTextVNode as E, toDisplayString as C, renderList as L, createBlock as y, resolveDynamicComponent as T, createCommentVNode as v } from "vue";
1
+ import { defineComponent as v, openBlock as l, createElementBlock as o, normalizeClass as a, unref as t, Fragment as i, createVNode as m, withCtx as n, createBlock as s, resolveDynamicComponent as p, h, createElementVNode as c, renderSlot as b, createCommentVNode as T, createTextVNode as $, toDisplayString as B, renderList as M } from "vue";
2
2
  import "../../../config-provider/index.mjs";
3
3
  import "../../index.mjs";
4
- import { Button as N, Empty as g } from "@aplus-frontend/antdv";
5
- import { useLocale as B } from "../../../config-provider/hooks/use-locale.mjs";
6
- import { useNamespace as M } from "../../../config-provider/hooks/use-namespace.mjs";
7
- import { ApTitle as b } from "../../ap-title/index.mjs";
8
- const R = /* @__PURE__ */ S({
4
+ import { Button as V, Empty as k } from "@aplus-frontend/antdv";
5
+ import { useLocale as A } from "../../../config-provider/hooks/use-locale.mjs";
6
+ import { useNamespace as D } from "../../../config-provider/hooks/use-namespace.mjs";
7
+ import { ApTitle as I } from "../../ap-title/index.mjs";
8
+ const q = /* @__PURE__ */ v({
9
9
  __name: "index",
10
10
  props: {
11
- leftTitle: { default: "" },
11
+ leftTitle: { type: [String, Object, Number, Boolean, null, Array], default: "" },
12
+ rightTitle: {},
12
13
  renderSelectedItem: {},
13
14
  selectedList: { default: () => [] }
14
15
  },
15
16
  emits: ["clear", "deleteItem"],
16
- setup(V, { emit: h }) {
17
- const { t: i } = B(), d = h, I = () => {
18
- d("clear");
19
- }, k = (e) => {
20
- d("deleteItem", e);
21
- }, { m: l } = M("ap-table-modal");
22
- return (e, $) => (a(), n("div", {
23
- class: o([
24
- e.renderSelectedItem ? t(l)("table-layout") : "",
17
+ setup(S, { emit: E }) {
18
+ const { t: d } = A(), u = S, f = E, L = () => {
19
+ f("clear");
20
+ }, C = (e) => {
21
+ f("deleteItem", e);
22
+ }, N = (e) => typeof u.rightTitle == "function" ? u.rightTitle(e) : `${d("ap.apTableModal.selected")} (${e})`, { m: r } = D("ap-table-modal");
23
+ return (e, w) => (l(), o("div", {
24
+ class: a([
25
+ e.renderSelectedItem ? t(r)("table-layout") : "",
25
26
  { "complex-layout": !!e.renderSelectedItem }
26
27
  ])
27
28
  }, [
28
- e.renderSelectedItem ? (a(), n(c, { key: 0 }, [
29
- r("div", {
30
- class: o(t(l)("table-layout-left"))
29
+ e.renderSelectedItem ? (l(), o(i, { key: 0 }, [
30
+ e.leftTitle ? (l(), o("div", {
31
+ key: 0,
32
+ class: a(t(r)("table-layout-left"))
31
33
  }, [
32
- s(t(b), {
33
- style: { "margin-bottom": "16px" },
34
- title: e.leftTitle
35
- }, null, 8, ["title"]),
36
- r("div", {
37
- class: o(t(l)("table-layout-left-content"))
34
+ m(t(I), { style: { "margin-bottom": "16px" } }, {
35
+ prefix: n(() => [
36
+ (l(), s(p(h(i, [e.leftTitle]))))
37
+ ]),
38
+ _: 1
39
+ }),
40
+ c("div", {
41
+ class: a(t(r)("table-layout-left-content"))
38
42
  }, [
39
- u(e.$slots, "default")
43
+ b(e.$slots, "default")
40
44
  ], 2)
41
- ], 2),
42
- r("div", {
43
- class: o(t(l)("table-layout-right"))
45
+ ], 2)) : T("", !0),
46
+ c("div", {
47
+ class: a(t(r)("table-layout-right"))
44
48
  }, [
45
- s(t(b), {
46
- title: `${t(i)("ap.apTableModal.selected")} (${e.selectedList.length})`
49
+ m(t(I), {
50
+ title: `${t(d)("ap.apTableModal.selected")} (${e.selectedList.length})`
47
51
  }, {
48
- suffix: f(() => [
49
- s(t(N), {
52
+ prefix: n(() => [
53
+ (l(), s(p(h(i, [N(e.selectedList.length)]))))
54
+ ]),
55
+ suffix: n(() => [
56
+ m(t(V), {
50
57
  type: "link",
51
58
  style: { padding: "0px", height: "22px", "border-width": "0px" },
52
- onClick: I
59
+ onClick: L
53
60
  }, {
54
- default: f(() => [
55
- E(C(t(i)("ap.apTableModal.clear")), 1)
61
+ default: n(() => [
62
+ $(B(t(d)("ap.apTableModal.clear")), 1)
56
63
  ]),
57
64
  _: 1
58
65
  })
59
66
  ]),
60
67
  _: 1
61
68
  }, 8, ["title"]),
62
- r("div", {
63
- class: o(t(l)("table-layout-right-content"))
69
+ c("div", {
70
+ class: a(t(r)("table-layout-right-content"))
64
71
  }, [
65
- (a(!0), n(c, null, L(e.selectedList, (m) => {
66
- var p;
67
- return a(), y(T((p = e.renderSelectedItem) == null ? void 0 : p.call(e, m, { deleteItem: k })), { key: m });
72
+ (l(!0), o(i, null, M(e.selectedList, (y) => {
73
+ var g;
74
+ return l(), s(p((g = e.renderSelectedItem) == null ? void 0 : g.call(e, y, { deleteItem: C })), { key: y });
68
75
  }), 128)),
69
- e.selectedList.length === 0 ? (a(), y(t(g), {
76
+ e.selectedList.length === 0 ? (l(), s(t(k), {
70
77
  key: 0,
71
- image: t(g).PRESENTED_IMAGE_SIMPLE,
78
+ image: t(k).PRESENTED_IMAGE_SIMPLE,
72
79
  style: { "margin-top": "100px" }
73
- }, null, 8, ["image"])) : v("", !0)
80
+ }, null, 8, ["image"])) : T("", !0)
74
81
  ], 2)
75
82
  ], 2)
76
- ], 64)) : u(e.$slots, "default", { key: 1 })
83
+ ], 64)) : b(e.$slots, "default", { key: 1 })
77
84
  ], 2));
78
85
  }
79
86
  });
80
87
  export {
81
- R as default
88
+ q as default
82
89
  };
@@ -5,7 +5,7 @@ export interface ApTitleProps {
5
5
  /**
6
6
  * 小标题
7
7
  */
8
- title: string;
8
+ title?: string;
9
9
  /**
10
10
  * 帮助消息
11
11
  */
@@ -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';