@aplus-frontend/ui 0.4.11 → 0.4.13

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 (50) hide show
  1. package/es/src/ap-field/date-range/index.vue.mjs +65 -57
  2. package/es/src/ap-field/hooks/use-default-presets.d.ts +7 -4
  3. package/es/src/ap-field/hooks/use-default-presets.mjs +24 -13
  4. package/es/src/business/ap-ladder/ApLadder.vue.d.ts +2 -0
  5. package/es/src/business/ap-ladder/ApLadder.vue2.mjs +109 -127
  6. package/es/src/business/ap-ladder/index.d.ts +1 -0
  7. package/es/src/business/ap-ladder/useWatchEllipsis.d.ts +3 -0
  8. package/es/src/business/ap-ladder/useWatchEllipsis.mjs +35 -0
  9. package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +5 -2
  10. package/es/src/business/ap-table-modal/hooks/use-table-select-modal.mjs +31 -21
  11. package/es/src/business/ap-table-modal/interface.d.ts +3 -1
  12. package/es/src/business/ap-table-modal/table-layout/index.vue.d.ts +4 -2
  13. package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +53 -46
  14. package/es/src/business/ap-title/interface.d.ts +1 -1
  15. package/es/src/config-provider/hooks/use-locale.mjs +7 -7
  16. package/es/src/full-screen/index.vue.d.ts +2 -2
  17. package/es/src/full-screen/index.vue.mjs +19 -18
  18. package/es/src/hooks/useFullScreen.mjs +12 -11
  19. package/es/src/utils/data-range-persets.d.ts +23 -40
  20. package/es/src/utils/data-range-persets.mjs +95 -102
  21. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  22. package/lib/src/ap-field/hooks/use-default-presets.d.ts +7 -4
  23. package/lib/src/ap-field/hooks/use-default-presets.js +1 -1
  24. package/lib/src/business/ap-ladder/ApLadder.vue.d.ts +2 -0
  25. package/lib/src/business/ap-ladder/ApLadder.vue2.js +1 -1
  26. package/lib/src/business/ap-ladder/index.d.ts +1 -0
  27. package/lib/src/business/ap-ladder/useWatchEllipsis.d.ts +3 -0
  28. package/lib/src/business/ap-ladder/useWatchEllipsis.js +1 -0
  29. package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +5 -2
  30. package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.js +1 -1
  31. package/lib/src/business/ap-table-modal/interface.d.ts +3 -1
  32. package/lib/src/business/ap-table-modal/table-layout/index.vue.d.ts +4 -2
  33. package/lib/src/business/ap-table-modal/table-layout/index.vue2.js +1 -1
  34. package/lib/src/business/ap-title/interface.d.ts +1 -1
  35. package/lib/src/config-provider/hooks/use-locale.js +1 -1
  36. package/lib/src/full-screen/index.vue.d.ts +2 -2
  37. package/lib/src/full-screen/index.vue.js +1 -1
  38. package/lib/src/hooks/useFullScreen.js +1 -1
  39. package/lib/src/utils/data-range-persets.d.ts +23 -40
  40. package/lib/src/utils/data-range-persets.js +1 -1
  41. package/package.json +3 -3
  42. package/theme/ap-form/ap-form-item.css +8 -5
  43. package/theme/ap-form/ap-form-item.less +11 -8
  44. package/theme/ap-form/index.css +8 -5
  45. package/theme/ap-form/search-form.css +8 -5
  46. package/theme/ap-form/search-form.less +0 -1
  47. package/theme/ap-table/ap-table.css +8 -5
  48. package/theme/ap-table-modal/index.css +8 -5
  49. package/theme/editable-table/index.css +8 -5
  50. package/theme/index.css +8 -5
@@ -1,12 +1,13 @@
1
- import { defineComponent as Y, useSlots as Z, ref as R, useTemplateRef as x, computed as C, unref as o, onMounted as ee, onUnmounted as te, openBlock as l, createElementBlock as r, normalizeClass as y, createBlock as p, normalizeProps as T, mergeProps as j, createSlots as z, withCtx as f, Fragment as k, createElementVNode as m, normalizeStyle as d, toDisplayString as i, renderSlot as W, createCommentVNode as S, renderList as D, createTextVNode as le, isVNode as V, resolveDynamicComponent as b, createVNode as $ } from "vue";
2
- import { Tooltip as v } from "@aplus-frontend/antdv";
1
+ import { defineComponent as Q, useSlots as U, ref as N, computed as h, unref as o, openBlock as l, createElementBlock as r, normalizeClass as a, createBlock as y, normalizeProps as E, mergeProps as C, createSlots as R, withCtx as c, Fragment as k, createElementVNode as m, normalizeStyle as p, toDisplayString as n, renderSlot as T, createCommentVNode as S, renderList as D, createTextVNode as X, isVNode as V, resolveDynamicComponent as b, createVNode as v } from "vue";
2
+ import { Tooltip as j } from "@aplus-frontend/antdv";
3
3
  import "../../config-provider/index.mjs";
4
- import { locales as oe } from "./interface.mjs";
4
+ import { locales as Y } from "./interface.mjs";
5
5
  import "./HelpMessageIcon.vue.mjs";
6
- import { useNamespace as re } from "../../config-provider/hooks/use-namespace.mjs";
7
- import { useGlobalConfig as se } from "../../config-provider/hooks/use-global-config.mjs";
8
- import B from "./HelpMessageIcon.vue2.mjs";
9
- const ne = { key: 1 }, ie = { key: 0 }, ae = { key: 1 }, ue = { key: 0 }, ye = ["onClick"], pe = { key: 0 }, de = { key: 1 }, Ce = /* @__PURE__ */ Y({
6
+ import { useWatchEllipsis as Z, ellipsisElementCls as A } from "./useWatchEllipsis.mjs";
7
+ import { useNamespace as x } from "../../config-provider/hooks/use-namespace.mjs";
8
+ import { useGlobalConfig as ee } from "../../config-provider/hooks/use-global-config.mjs";
9
+ import M from "./HelpMessageIcon.vue2.mjs";
10
+ const te = { key: 1 }, le = { key: 0 }, oe = { key: 1 }, re = { key: 0 }, ie = ["onClick"], ne = { key: 0 }, se = { key: 1 }, Se = /* @__PURE__ */ Q({
10
11
  name: "ApLadder",
11
12
  __name: "ApLadder",
12
13
  props: {
@@ -45,30 +46,30 @@ const ne = { key: 1 }, ie = { key: 0 }, ae = { key: 1 }, ue = { key: 0 }, ye = [
45
46
  tooltipValueStyles: { type: [Boolean, null, String, Object, Array], default: void 0 }
46
47
  },
47
48
  setup(F) {
48
- const P = Z(), s = F, { b: G, e: n, m: I } = re("ap-ladder"), q = se("uiMode", "aplus"), O = `ap-ladder-${Math.floor(Math.random() * 1e7)}`, H = n("ellipsis"), h = R(!1), _ = R(), g = x("valueRefs");
49
- function U(t) {
50
- var u;
51
- const a = (u = g.value) == null ? void 0 : u[t];
52
- return a ? getComputedStyle(a).color : void 0;
49
+ const P = U(), i = F, { b: z, e: s, m: G } = x("ap-ladder"), W = ee("uiMode", "aplus"), g = N([]), w = N(), H = Z(w);
50
+ function I(t) {
51
+ var f;
52
+ const u = (f = g.value) == null ? void 0 : f[t];
53
+ return u ? getComputedStyle(u).color : void 0;
53
54
  }
54
- const J = C(() => s.labelValues.length === 0), K = C(() => s.labelValues.length > 0), w = C(() => s.majorColor ? {
55
- color: `${s.majorColor}`
56
- } : {}), E = C(() => s.minorColor ? {
57
- color: `${s.minorColor}`
58
- } : {}), A = (t) => t == null || typeof t == "string" && t.trim() === "", c = (t, a = {}) => {
55
+ const q = h(() => i.labelValues.length === 0), J = h(() => i.labelValues.length > 0), B = h(() => i.majorColor ? {
56
+ color: `${i.majorColor}`
57
+ } : {}), $ = h(() => i.minorColor ? {
58
+ color: `${i.minorColor}`
59
+ } : {}), _ = (t) => t == null || typeof t == "string" && t.trim() === "", d = (t, u = {}) => {
59
60
  const e = {
60
- rawValue: a.rawValue,
61
- precision: a.precision === void 0 ? 2 : a.precision,
62
- thousand: a.thousand,
63
- thousandSeparator: a.thousandSeparator || ",",
64
- currency: a.currency,
65
- percent: a.percent
61
+ rawValue: u.rawValue,
62
+ precision: u.precision === void 0 ? 2 : u.precision,
63
+ thousand: u.thousand,
64
+ thousandSeparator: u.thousandSeparator || ",",
65
+ currency: u.currency,
66
+ percent: u.percent
66
67
  };
67
68
  if (t === null || typeof t == "object" || typeof t == "function" || typeof t > "u")
68
69
  return "--";
69
70
  if (typeof t == "boolean")
70
71
  return t;
71
- if (A(t))
72
+ if (_(t))
72
73
  return "--";
73
74
  if (e.rawValue)
74
75
  return t;
@@ -76,194 +77,175 @@ const ne = { key: 1 }, ie = { key: 0 }, ae = { key: 1 }, ue = { key: 0 }, ye = [
76
77
  if (e.percent)
77
78
  return `${t.toFixed(e.precision)}%`;
78
79
  if (e.currency)
79
- return t.toLocaleString(oe[e.currency], {
80
+ return t.toLocaleString(Y[e.currency], {
80
81
  style: "currency",
81
82
  currency: e.currency
82
83
  });
83
84
  if (e.thousand) {
84
- const [u, M] = t.toFixed(e.precision).split(".");
85
- return `${u.replace(
85
+ const [f, L] = t.toFixed(e.precision).split(".");
86
+ return `${f.replace(
86
87
  /(\d)(?=(\d{3})+(?!\d))/g,
87
88
  `$1${e.thousandSeparator}`
88
- )}.${M}`;
89
+ )}.${L}`;
89
90
  }
90
91
  return t.toFixed(e.precision);
91
92
  }
92
93
  return t;
93
- }, Q = () => {
94
- var e;
95
- const t = document.getElementById(O);
96
- if (!t)
97
- return;
98
- const a = t.querySelectorAll(`.${H}`);
99
- _.value = new ResizeObserver((u) => {
100
- u.forEach((M) => {
101
- M.target === t && (h.value = !1, a.forEach((N) => {
102
- N.clientWidth < N.scrollWidth && (h.value = !0);
103
- }));
104
- });
105
- }), (e = o(_)) == null || e.observe(t), h.value = !1, a.forEach((u) => {
106
- u.clientWidth < u.scrollWidth && (h.value = !0);
107
- });
108
- }, L = C(() => P.title ? !0 : s.tooltip && o(h)), X = (t) => {
94
+ }, O = h(() => P.title ? !0 : i.tooltip && o(H)), K = (t) => {
109
95
  t.link && window.open(t.link, "_blank"), typeof t.handleClickLink == "function" && t.handleClickLink();
110
96
  };
111
- return ee(() => {
112
- Q();
113
- }), te(() => {
114
- var t;
115
- o(_) && ((t = o(_)) == null || t.disconnect());
116
- }), (t, a) => (l(), r("div", {
117
- id: O,
118
- class: y([o(G)(), `${o(I)(o(q))}`])
97
+ return (t, u) => (l(), r("div", {
98
+ ref_key: "wrapperRef",
99
+ ref: w,
100
+ class: a([o(z)(), `${o(G)(o(W))}`])
119
101
  }, [
120
- J.value ? (l(), p(o(v), T(j({ key: 0 }, { ...s.tooltipProps })), z({
121
- default: f(() => [
122
- !A(t.major) || !A(t.minor) ? (l(), r(k, { key: 0 }, [
123
- s.layout === "vertical" ? (l(), r(k, { key: 0 }, [
102
+ q.value ? (l(), y(o(j), E(C({ key: 0 }, { ...i.tooltipProps })), R({
103
+ default: c(() => [
104
+ !_(t.major) || !_(t.minor) ? (l(), r(k, { key: 0 }, [
105
+ i.layout === "vertical" ? (l(), r(k, { key: 0 }, [
124
106
  m("div", {
125
- class: y([o(n)("major"), o(n)("ellipsis")]),
126
- style: d([t.majorStyles, w.value])
127
- }, i(c(t.major)), 7),
107
+ class: a([o(s)("major"), o(s)("ellipsis"), o(A)]),
108
+ style: p([t.majorStyles, B.value])
109
+ }, n(d(t.major)), 7),
128
110
  m("div", {
129
- class: y([o(n)("minor"), o(n)("ellipsis")]),
130
- style: d([t.minorStyles, E.value])
131
- }, i(c(t.minor)), 7)
111
+ class: a([o(s)("minor"), o(s)("ellipsis"), o(A)]),
112
+ style: p([t.minorStyles, $.value])
113
+ }, n(d(t.minor)), 7)
132
114
  ], 64)) : (l(), r("div", {
133
115
  key: 1,
134
- class: y(o(n)("ellipsis"))
116
+ class: a([o(s)("ellipsis"), o(A)])
135
117
  }, [
136
118
  m("span", {
137
- class: y([o(n)("major")]),
138
- style: d([t.majorStyles, w.value])
139
- }, i(c(t.major)), 7),
119
+ class: a([o(s)("major")]),
120
+ style: p([t.majorStyles, B.value])
121
+ }, n(d(t.major)), 7),
140
122
  m("span", {
141
- class: y([o(n)("minor")]),
142
- style: d([t.minorStyles, E.value])
143
- }, i(c(t.minor)), 7)
123
+ class: a([o(s)("minor")]),
124
+ style: p([t.minorStyles, $.value])
125
+ }, n(d(t.minor)), 7)
144
126
  ], 2))
145
- ], 64)) : (l(), r("div", ne, i("--")))
127
+ ], 64)) : (l(), r("div", te, n("--")))
146
128
  ]),
147
129
  _: 2
148
130
  }, [
149
- L.value ? {
131
+ O.value ? {
150
132
  name: "title",
151
- fn: f(() => [
152
- P.title ? W(t.$slots, "title", { key: 0 }) : (l(), r(k, { key: 1 }, [
153
- s.tooltipProps.title ? (l(), r("div", ie, i(s.tooltipProps.title), 1)) : (l(), r("div", ae, [
154
- m("div", null, i(c(t.major)), 1),
155
- m("div", null, i(c(t.minor)), 1)
133
+ fn: c(() => [
134
+ P.title ? T(t.$slots, "title", { key: 0 }) : (l(), r(k, { key: 1 }, [
135
+ i.tooltipProps.title ? (l(), r("div", le, n(i.tooltipProps.title), 1)) : (l(), r("div", oe, [
136
+ m("div", null, n(d(t.major)), 1),
137
+ m("div", null, n(d(t.minor)), 1)
156
138
  ]))
157
139
  ], 64))
158
140
  ]),
159
141
  key: "0"
160
142
  } : void 0
161
143
  ]), 1040)) : S("", !0),
162
- K.value ? (l(), p(o(v), T(j({ key: 1 }, { ...s.tooltipProps })), z({
163
- default: f(() => [
164
- (l(!0), r(k, null, D(s.labelValues, (e, u) => (l(), r("div", {
165
- key: u,
166
- class: y([o(n)("cross-bar")])
144
+ J.value ? (l(), y(o(j), E(C({ key: 1 }, { ...i.tooltipProps })), R({
145
+ default: c(() => [
146
+ (l(!0), r(k, null, D(i.labelValues, (e, f) => (l(), r("div", {
147
+ key: f,
148
+ class: a([o(s)("cross-bar")])
167
149
  }, [
168
150
  m("div", {
169
- class: y([o(n)("ellipsis")]),
170
- style: d({ color: U(u) })
151
+ class: a([o(s)("ellipsis"), o(A)]),
152
+ style: p({ color: I(f) })
171
153
  }, [
172
154
  m("span", {
173
- class: y(o(n)("label")),
174
- style: d([
155
+ class: a(o(s)("label")),
156
+ style: p([
175
157
  t.labelStyles,
176
158
  e.labelStyles,
177
159
  e.labelColor ? { color: e.labelColor } : void 0,
178
160
  { textAlign: e.labelAlign || t.labelAlign }
179
161
  ])
180
162
  }, [
181
- le(i(e.label), 1),
182
- e.label ? (l(), r("span", ue, ":")) : S("", !0)
163
+ X(n(e.label), 1),
164
+ e.label ? (l(), r("span", re, ":")) : S("", !0)
183
165
  ], 6),
184
- V(e.value) ? (l(), p(b(e.value), {
166
+ V(e.value) ? (l(), y(b(e.value), {
185
167
  key: 0,
186
168
  ref_for: !0,
187
169
  ref_key: "valueRefs",
188
170
  ref: g,
189
171
  style: { display: "inline-block" }
190
- }, null, 512)) : typeof e.value == "function" ? (l(), p(b(e.value()), {
172
+ }, null, 512)) : typeof e.value == "function" ? (l(), y(b(e.value()), {
191
173
  key: 1,
192
174
  ref_for: !0,
193
175
  ref_key: "valueRefs",
194
176
  ref: g,
195
177
  style: { display: "inline-block" }
196
178
  }, null, 512)) : (l(), r(k, { key: 2 }, [
197
- A(e.link) ? (l(), r("span", {
179
+ _(e.link) ? (l(), r("span", {
198
180
  key: 1,
199
181
  ref_for: !0,
200
182
  ref_key: "valueRefs",
201
183
  ref: g,
202
- class: y(o(n)("value")),
203
- style: d([
184
+ class: a(o(s)("value")),
185
+ style: p([
204
186
  t.valueStyles,
205
187
  e.valueStyles,
206
188
  e.valueColor ? { color: e.valueColor } : void 0
207
189
  ])
208
- }, i(c(e.value, { ...e })), 7)) : (l(), r("span", {
190
+ }, n(d(e.value, { ...e })), 7)) : (l(), r("span", {
209
191
  key: 0,
210
192
  ref_for: !0,
211
193
  ref_key: "valueRefs",
212
194
  ref: g,
213
- class: y(o(n)("link")),
214
- style: d([
195
+ class: a(o(s)("link")),
196
+ style: p([
215
197
  t.linkStyles,
216
198
  e.linkStyles,
217
199
  e.linkColor ? { color: e.linkColor } : void 0
218
200
  ]),
219
- onClick: (M) => X(e)
220
- }, i(c(e.value, { ...e })), 15, ye))
201
+ onClick: (L) => K(e)
202
+ }, n(d(e.value, { ...e })), 15, ie))
221
203
  ], 64)),
222
204
  e.unit ? (l(), r("span", {
223
205
  key: 3,
224
- class: y(o(n)("unit")),
225
- style: d([
206
+ class: a(o(s)("unit")),
207
+ style: p([
226
208
  t.unitStyles,
227
209
  e.unitStyles,
228
210
  e.unitColor ? { color: e.unitColor } : void 0
229
211
  ])
230
- }, i(e.unit), 7)) : S("", !0)
212
+ }, n(e.unit), 7)) : S("", !0)
231
213
  ], 6),
232
214
  e.helpMessage ? (l(), r("div", {
233
215
  key: 0,
234
- class: y([o(n)("help-message")])
216
+ class: a([o(s)("help-message")])
235
217
  }, [
236
- V(e.helpMessage) ? (l(), p(o(v), j({
218
+ V(e.helpMessage) ? (l(), y(o(j), C({
237
219
  key: 0,
238
220
  ref_for: !0
239
221
  }, { ...e.helpMessageTooltipProps }), {
240
- title: f(() => [
241
- (l(), p(b(e.helpMessage)))
222
+ title: c(() => [
223
+ (l(), y(b(e.helpMessage)))
242
224
  ]),
243
- default: f(() => [
244
- $(B, { lv: e }, null, 8, ["lv"])
225
+ default: c(() => [
226
+ v(M, { lv: e }, null, 8, ["lv"])
245
227
  ]),
246
228
  _: 2
247
- }, 1040)) : typeof e.helpMessage == "function" ? (l(), p(o(v), j({
229
+ }, 1040)) : typeof e.helpMessage == "function" ? (l(), y(o(j), C({
248
230
  key: 1,
249
231
  ref_for: !0
250
232
  }, { ...e.helpMessageTooltipProps }), {
251
- title: f(() => [
252
- (l(), p(b(e.helpMessage())))
233
+ title: c(() => [
234
+ (l(), y(b(e.helpMessage())))
253
235
  ]),
254
- default: f(() => [
255
- $(B, { lv: e }, null, 8, ["lv"])
236
+ default: c(() => [
237
+ v(M, { lv: e }, null, 8, ["lv"])
256
238
  ]),
257
239
  _: 2
258
- }, 1040)) : (l(), p(o(v), j({
240
+ }, 1040)) : (l(), y(o(j), C({
259
241
  key: 2,
260
242
  ref_for: !0
261
243
  }, { ...e.helpMessageTooltipProps }, {
262
244
  placement: "bottom",
263
245
  title: e.helpMessage
264
246
  }), {
265
- default: f(() => [
266
- $(B, { lv: e }, null, 8, ["lv"])
247
+ default: c(() => [
248
+ v(M, { lv: e }, null, 8, ["lv"])
267
249
  ]),
268
250
  _: 2
269
251
  }, 1040, ["title"]))
@@ -272,29 +254,29 @@ const ne = { key: 1 }, ie = { key: 0 }, ae = { key: 1 }, ue = { key: 0 }, ye = [
272
254
  ]),
273
255
  _: 2
274
256
  }, [
275
- L.value ? {
257
+ O.value ? {
276
258
  name: "title",
277
- fn: f(() => [
278
- P.title ? W(t.$slots, "title", { key: 0 }) : (l(), r(k, { key: 1 }, [
279
- s.tooltipProps.title ? (l(), r("div", pe, i(s.tooltipProps.title), 1)) : (l(), r("div", de, [
280
- (l(!0), r(k, null, D(s.labelValues, (e, u) => (l(), r("div", {
281
- key: u,
259
+ fn: c(() => [
260
+ P.title ? T(t.$slots, "title", { key: 0 }) : (l(), r(k, { key: 1 }, [
261
+ i.tooltipProps.title ? (l(), r("div", ne, n(i.tooltipProps.title), 1)) : (l(), r("div", se, [
262
+ (l(!0), r(k, null, D(i.labelValues, (e, f) => (l(), r("div", {
263
+ key: f,
282
264
  style: { "word-break": "break-all" }
283
265
  }, [
284
266
  e.label ? (l(), r("span", {
285
267
  key: 0,
286
- style: d([t.tooltipLabelStyles, e.tooltipLabelStyles])
287
- }, i(e.label) + ":", 5)) : S("", !0),
288
- V(e.value) ? (l(), p(b(e.value), {
268
+ style: p([t.tooltipLabelStyles, e.tooltipLabelStyles])
269
+ }, n(e.label) + ":", 5)) : S("", !0),
270
+ V(e.value) ? (l(), y(b(e.value), {
289
271
  key: 1,
290
272
  style: { display: "inline-block" }
291
- })) : typeof e.value == "function" ? (l(), p(b(e.value()), {
273
+ })) : typeof e.value == "function" ? (l(), y(b(e.value()), {
292
274
  key: 2,
293
275
  style: { display: "inline-block" }
294
276
  })) : (l(), r("span", {
295
277
  key: 3,
296
- style: d([t.tooltipValueStyles, e.tooltipValueStyles])
297
- }, i(c(e.value, { ...e })), 5))
278
+ style: p([t.tooltipValueStyles, e.tooltipValueStyles])
279
+ }, n(d(e.value, { ...e })), 5))
298
280
  ]))), 128))
299
281
  ]))
300
282
  ], 64))
@@ -306,5 +288,5 @@ const ne = { key: 1 }, ie = { key: 0 }, ae = { key: 1 }, ue = { key: 0 }, ye = [
306
288
  }
307
289
  });
308
290
  export {
309
- Ce as default
291
+ Se as default
310
292
  };
@@ -88,6 +88,7 @@ declare const ApLadder: {
88
88
  tooltipLabelStyles: string | false | CSSProperties | StyleValue[] | null;
89
89
  tooltipValueStyles: string | false | CSSProperties | StyleValue[] | null;
90
90
  }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
91
+ wrapperRef: HTMLDivElement;
91
92
  valueRefs: HTMLSpanElement;
92
93
  }, HTMLDivElement, ComponentProvideOptions, {
93
94
  P: {};
@@ -0,0 +1,3 @@
1
+ import { Ref } from 'vue';
2
+ export declare const ellipsisElementCls = "ap-ladder-is-ellipsised";
3
+ export declare const useWatchEllipsis: (target: Ref<HTMLElement | undefined>) => Ref<boolean, boolean>;
@@ -0,0 +1,35 @@
1
+ import { isClient as a } from "@vueuse/core";
2
+ import { ref as c, watch as n } from "vue";
3
+ const r = /* @__PURE__ */ new WeakMap();
4
+ let l;
5
+ const p = "ap-ladder-is-ellipsised";
6
+ function o(i) {
7
+ const t = i.querySelectorAll(`.${p}`);
8
+ let e = !1;
9
+ return t.forEach((s) => {
10
+ s.clientWidth < s.scrollWidth && (e = !0);
11
+ }), e;
12
+ }
13
+ a && (l = new ResizeObserver((i) => {
14
+ for (const t of i) {
15
+ const e = t.target;
16
+ if (r.has(e)) {
17
+ const s = o(e);
18
+ r.get(e).value = s;
19
+ }
20
+ }
21
+ }));
22
+ const h = (i) => {
23
+ const t = c(!1);
24
+ return n(
25
+ () => i.value,
26
+ (e, s) => {
27
+ e && l.observe(e), s && l.unobserve(s), e && r.set(e, t), s && r.delete(s), e && (t.value = o(e));
28
+ },
29
+ { flush: "post", immediate: !0 }
30
+ ), t;
31
+ };
32
+ export {
33
+ p as ellipsisElementCls,
34
+ h as useWatchEllipsis
35
+ };
@@ -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"]>;