@aplus-frontend/ui 7.19.2 → 7.19.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.
@@ -1,112 +1,107 @@
1
- import { defineComponent as j, ref as x, computed as n, unref as p, watch as I, nextTick as L, onMounted as A, onUnmounted as F, createBlock as g, openBlock as a, mergeProps as w, withCtx as v, createElementVNode as t, normalizeStyle as C, normalizeClass as k, createElementBlock as _, createCommentVNode as G, Fragment as M, renderList as U, toDisplayString as b, renderSlot as q, createTextVNode as H } from "vue";
2
- import J from "@ant-design/icons-vue";
3
- import { Tooltip as K } from "@aplus-frontend/antdv";
4
- import { omit as O } from "lodash-unified";
1
+ import { defineComponent as A, ref as T, computed as p, unref as a, watch as F, nextTick as M, onMounted as U, onUnmounted as q, createBlock as m, openBlock as n, mergeProps as h, createSlots as H, withCtx as u, createElementVNode as t, normalizeStyle as _, normalizeClass as x, createElementBlock as k, createCommentVNode as J, Fragment as z, renderList as K, toDisplayString as f, renderSlot as V, createTextVNode as B } from "vue";
2
+ import O from "@ant-design/icons-vue";
3
+ import { Tooltip as E } from "@aplus-frontend/antdv";
4
+ import { omit as Q } from "lodash-unified";
5
5
  import "../../config-provider/index.mjs";
6
- import { useToken as Q } from "../../config-provider/hooks/use-token.mjs";
6
+ import { useToken as X } from "../../config-provider/hooks/use-token.mjs";
7
7
  import "../../hooks/index.mjs";
8
- import { useDevWarning as X } from "../../utils/warning.mjs";
8
+ import { useDevWarning as Y } from "../../utils/warning.mjs";
9
9
  import "./ap-tag.vue2.mjs";
10
- import Y from "./style/group.mjs";
11
- import { getTextWidth as W } from "./utils.mjs";
12
- import { useLocale as Z } from "../../config-provider/hooks/use-locale.mjs";
13
- import { useNamespace as ee } from "../../config-provider/hooks/use-namespace.mjs";
14
- import { useResize as te } from "../../hooks/useResize.mjs";
15
- import oe from "./ap-tag.vue.mjs";
16
- const xe = /* @__PURE__ */ j({
10
+ import Z from "./style/group.mjs";
11
+ import { getTextWidth as S } from "./utils.mjs";
12
+ import { useLocale as ee } from "../../config-provider/hooks/use-locale.mjs";
13
+ import { useNamespace as te } from "../../config-provider/hooks/use-namespace.mjs";
14
+ import { useResize as oe } from "../../hooks/useResize.mjs";
15
+ import le from "./ap-tag.vue.mjs";
16
+ const ke = /* @__PURE__ */ A({
17
17
  __name: "ap-tag-group",
18
18
  props: {
19
19
  list: { default: () => [] },
20
20
  space: { default: 4 },
21
21
  ellipsisColor: {},
22
- ellipsis: { default: () => ({}) }
22
+ ellipsis: { default: () => ({ isWrapGroup: !0 }) }
23
23
  },
24
- setup(T) {
25
- const { t: z } = Z(), l = T, { token: V } = Q(), B = X("ApTagGroup"), { b: d } = ee("tag-group"), E = Y("tag-group"), i = x(), { observe: D, unobserve: P } = te(), r = n(() => ({
24
+ setup(D) {
25
+ const { t: G } = ee(), l = D, { token: P } = X(), $ = Y("ApTagGroup"), { b: g } = te("tag-group"), N = Z("tag-group"), i = T(), { observe: R, unobserve: j } = oe(), r = p(() => ({
26
26
  ...{
27
- iconColor: V.value?.textColor1,
27
+ iconColor: P.value?.textColor1,
28
28
  symbol: "icon",
29
- text: z("ap.common.more")
29
+ text: G("ap.common.more")
30
30
  },
31
31
  ...l.ellipsis
32
- })), S = n(() => r.value.tooltip && typeof r.value.tooltip == "object" ? O(r.value.tooltip, ["trigger", "title"]) : {}), c = n(() => p(m) < l.list.length), m = x(0), N = n(() => l.list.map((e) => e.text).join("、")), R = n(() => [d(), E.value].filter(Boolean)), h = () => {
32
+ })), w = p(() => r.value.tooltip && typeof r.value.tooltip == "object" ? Q(r.value.tooltip, ["trigger", "title"]) : {}), v = p(() => a(d) < l.list.length), d = T(0), C = p(() => l.list.map((e) => e.text).join("、")), I = p(() => [g(), N.value].filter(Boolean)), W = () => {
33
33
  let e = 0, o = 0;
34
34
  if (!i.value) return;
35
- const u = i.value.offsetWidth;
35
+ const c = i.value.offsetWidth;
36
36
  for (let s of l.list) {
37
- const f = s.size === "small" ? 8 : 12, y = W(
37
+ const y = s.size === "small" ? 8 : 12, b = S(
38
38
  s.size === "large" ? 14 : 12,
39
39
  s.text
40
- ) + f + l.space;
41
- if (e += y, e > u) {
42
- e -= y;
40
+ ) + y + l.space;
41
+ if (e += b, e > c) {
42
+ e -= b;
43
43
  break;
44
44
  }
45
45
  o++;
46
46
  }
47
47
  if (o < l.list.length) {
48
- const f = W(12, r.value.text);
49
- l.ellipsis.symbol === "icon" ? e += 16 : e += f, e > u && o--;
48
+ const y = S(12, r.value.text);
49
+ l.ellipsis.symbol === "icon" ? e += 16 : e += y, e > c && o--;
50
50
  }
51
- m.value = o;
51
+ d.value = o;
52
52
  };
53
- I(
53
+ F(
54
54
  () => l.list,
55
55
  (e, o) => {
56
- e !== o && L(() => {
57
- h();
56
+ e !== o && M(() => {
57
+ W();
58
58
  });
59
59
  },
60
60
  {
61
61
  immediate: !0
62
62
  }
63
63
  );
64
- const $ = () => {
65
- h();
64
+ const L = () => {
65
+ W();
66
66
  };
67
- return A(() => {
67
+ return U(() => {
68
68
  [["ellipsisColor", "ellipse.color"]].forEach(
69
69
  ([e, o]) => {
70
- B.deprecated(
70
+ $.deprecated(
71
71
  !l[e],
72
72
  e,
73
73
  o
74
74
  );
75
75
  }
76
- ), i.value && D(i.value, $);
77
- }), F(() => {
78
- i.value && P(i.value);
79
- }), (e, o) => (a(), g(p(K), w({ trigger: "hover" }, S.value), {
80
- title: v(() => [
81
- q(e.$slots, "tooltip", { tags: e.list }, () => [
82
- H(b(N.value), 1)
83
- ])
84
- ]),
85
- default: v(() => [
76
+ ), i.value && R(i.value, L);
77
+ }), q(() => {
78
+ i.value && j(i.value);
79
+ }), (e, o) => (n(), m(a(E), h({ trigger: "hover" }, w.value), H({
80
+ default: u(() => [
86
81
  t("div", {
87
82
  ref_key: "container",
88
83
  ref: i,
89
- class: k(R.value),
90
- style: C({
91
- pointerEvents: c.value ? "auto" : "none"
84
+ class: x(I.value),
85
+ style: _({
86
+ pointerEvents: v.value ? "auto" : "none"
92
87
  // opacity: isUpdating ? '0' : '1'
93
88
  })
94
89
  }, [
95
- (a(!0), _(M, null, U(e.list, (u, s) => (a(), g(oe, w({ ref_for: !0 }, u, {
90
+ (n(!0), k(z, null, K(e.list, (c, s) => (n(), m(le, h({ ref_for: !0 }, c, {
96
91
  key: s,
97
92
  style: {
98
- display: s >= m.value ? "none" : "inline-flex",
93
+ display: s >= d.value ? "none" : "inline-flex",
99
94
  marginRight: `${e.space}px`
100
95
  }
101
96
  }), null, 16, ["style"]))), 128)),
102
- c.value && r.value.symbol === "icon" ? (a(), g(p(J), {
97
+ v.value && r.value.symbol === "icon" ? (n(), m(a(O), {
103
98
  key: 0,
104
- style: C({
99
+ style: _({
105
100
  color: e.ellipsisColor || r.value.iconColor,
106
101
  cursor: "pointer"
107
102
  })
108
103
  }, {
109
- component: v(() => [...o[0] || (o[0] = [
104
+ component: u(() => [...o[0] || (o[0] = [
110
105
  t("svg", {
111
106
  xmlns: "http://www.w3.org/2000/svg",
112
107
  "xmlns:xlink": "http://www.w3.org/1999/xlink",
@@ -162,17 +157,45 @@ const xe = /* @__PURE__ */ j({
162
157
  ], -1)
163
158
  ])]),
164
159
  _: 1
165
- }, 8, ["style"])) : c.value && r.value.symbol === "text" ? (a(), _("span", {
166
- key: 1,
167
- class: k(p(d)("ellipsis-text")),
168
- style: { cursor: "pointer" }
169
- }, b(r.value.text), 3)) : G("", !0)
160
+ }, 8, ["style"])) : v.value && r.value.symbol === "text" ? (n(), k(z, { key: 1 }, [
161
+ e.ellipsis.isWrapGroup ? (n(), k("span", {
162
+ key: 0,
163
+ class: x(a(g)("ellipsis-text")),
164
+ style: { cursor: "pointer" }
165
+ }, f(r.value.text), 3)) : (n(), m(a(E), h({
166
+ key: 1,
167
+ trigger: "hover"
168
+ }, w.value), {
169
+ title: u(() => [
170
+ V(e.$slots, "tooltip", { tags: e.list }, () => [
171
+ B(f(C.value), 1)
172
+ ])
173
+ ]),
174
+ default: u(() => [
175
+ t("span", {
176
+ class: x(a(g)("ellipsis-text")),
177
+ style: { cursor: "pointer" }
178
+ }, f(r.value.text), 3)
179
+ ]),
180
+ _: 3
181
+ }, 16))
182
+ ], 64)) : J("", !0)
170
183
  ], 6)
171
184
  ]),
172
- _: 3
173
- }, 16));
185
+ _: 2
186
+ }, [
187
+ e.ellipsis.isWrapGroup ? {
188
+ name: "title",
189
+ fn: u(() => [
190
+ V(e.$slots, "tooltip", { tags: e.list }, () => [
191
+ B(f(C.value), 1)
192
+ ])
193
+ ]),
194
+ key: "0"
195
+ } : void 0
196
+ ]), 1040));
174
197
  }
175
198
  });
176
199
  export {
177
- xe as default
200
+ ke as default
178
201
  };
@@ -48,6 +48,10 @@ export type EllipsisProps = {
48
48
  * 省略号气泡内容
49
49
  */
50
50
  tooltip?: Omit<TooltipProps, 'trigger' | 'title'>;
51
+ /**
52
+ * tooltip是否包围整个group
53
+ */
54
+ isWrapGroup?: boolean;
51
55
  };
52
56
  export interface ApTagGroupProps {
53
57
  /**
@@ -1,22 +1,22 @@
1
- import { defineComponent as R, computed as n, ref as d, createVNode as g, watch as q, createBlock as H, openBlock as J, unref as f, mergeProps as Q, withCtx as X, createElementVNode as Z, normalizeClass as ee } from "vue";
2
- import { isValid as te } from "@aplus-frontend/utils";
3
- import { useInjectForm as ae } from "../../ap-form/context.mjs";
4
- import { useInjectApTable as ie } from "../../ap-table/context.mjs";
1
+ import { defineComponent as q, computed as n, ref as V, createVNode as F, watch as H, createBlock as J, openBlock as Q, unref as f, mergeProps as X, withCtx as Z, createElementVNode as ee, normalizeClass as te } from "vue";
2
+ import { isValid as ae } from "@aplus-frontend/utils";
3
+ import { useInjectForm as ie } from "../../ap-form/context.mjs";
4
+ import { useInjectApTable as oe } from "../../ap-table/context.mjs";
5
5
  import "../../config-provider/index.mjs";
6
- import { ApBatchActionGroup as oe } from "../ap-batch-action-group/index.mjs";
6
+ import { ApBatchActionGroup as re } from "../ap-batch-action-group/index.mjs";
7
7
  import "./components/main-button-content.vue.mjs";
8
8
  import "./components/menu-list-content.vue.mjs";
9
- import { useSendToUrl as re } from "./hooks/use-send-to-url.mjs";
10
- import { useViewProvide as se } from "./hooks/use-view-provide.mjs";
11
- import le from "./icons/line-down.vue.mjs";
12
- import ne from "./style/index.mjs";
9
+ import { useSendToUrl as se } from "./hooks/use-send-to-url.mjs";
10
+ import { useViewProvide as le } from "./hooks/use-view-provide.mjs";
11
+ import ne from "./icons/line-down.vue.mjs";
12
+ import me from "./style/index.mjs";
13
13
  import { SYSTEM_VIEW_KEY as v } from "./utils/enum.mjs";
14
- import { useGlobalConfig as me } from "../../config-provider/hooks/use-global-config.mjs";
15
- import { useNamespace as ue } from "../../config-provider/hooks/use-namespace.mjs";
16
- import { useLocale as ce } from "../../config-provider/hooks/use-locale.mjs";
17
- import fe from "./components/main-button-content.vue2.mjs";
18
- import ve from "./components/menu-list-content.vue2.mjs";
19
- const _e = /* @__PURE__ */ R({
14
+ import { useGlobalConfig as ue } from "../../config-provider/hooks/use-global-config.mjs";
15
+ import { useNamespace as ce } from "../../config-provider/hooks/use-namespace.mjs";
16
+ import { useLocale as fe } from "../../config-provider/hooks/use-locale.mjs";
17
+ import ve from "./components/main-button-content.vue2.mjs";
18
+ import pe from "./components/menu-list-content.vue2.mjs";
19
+ const Oe = /* @__PURE__ */ q({
20
20
  name: "ApView",
21
21
  __name: "ap-view",
22
22
  props: {
@@ -50,66 +50,67 @@ const _e = /* @__PURE__ */ R({
50
50
  },
51
51
  extraUrlParams: {}
52
52
  },
53
- setup(x, {
54
- expose: N
53
+ setup(N, {
54
+ expose: _
55
55
  }) {
56
- const a = x, _ = me("viewCacheOption"), {
57
- b: V
58
- } = ue("ap-view"), {
59
- t: O
60
- } = ce(), F = ne("ap-view"), S = n(() => ({
56
+ const a = N, O = ue("viewCacheOption"), {
57
+ b: S
58
+ } = ce("ap-view"), {
59
+ t: P
60
+ } = fe(), C = me("ap-view"), h = n(() => ({
61
61
  viewKey: v,
62
- viewName: O("ap.apView.systemView")
62
+ viewName: P("ap.apView.systemView")
63
63
  })), {
64
- getSearchFormValues: P,
65
- setSearchFormValues: B,
66
- submit: L,
67
- reset: E,
68
- submitWith: M,
69
- getSearchFormSorterItems: j,
70
- setSearchFormSorterItems: k,
71
- resetSearchFormSorterItems: A
72
- } = ie(), {
73
- model: W
74
- } = ae(), G = d(!1), h = d(!1), w = d("");
75
- let m = !1, C = !1, K = !0;
76
- const $ = {
64
+ getSearchFormValues: B,
65
+ setSearchFormValues: L,
66
+ submit: E,
67
+ reset: M,
68
+ submitWith: j,
69
+ getSearchFormSorterItems: k,
70
+ setSearchFormSorterItems: A,
71
+ resetSearchFormSorterItems: W
72
+ } = oe(), {
73
+ model: G
74
+ } = ie(), $ = V(!1), K = V(!1), w = V("");
75
+ let m = !1, U = !1, b = !0;
76
+ const Y = {
77
77
  dropdownType: "dropdown",
78
- content: g(fe, {
78
+ content: F(ve, {
79
79
  maxViewNum: a.maxViewNum
80
80
  }, null)
81
- }, o = d([S.value]), Y = n(() => o.value.map((t) => ({
81
+ }, o = V([h.value]), z = n(() => o.value.map((t) => ({
82
82
  id: t.viewKey,
83
- content: g(ve, {
83
+ content: F(pe, {
84
84
  view: t
85
85
  }, null)
86
86
  }))), r = {
87
- getSearchFormValues: P,
88
- setSearchFormValues: B,
89
- submit: L,
90
- reset: E,
91
- submitWith: M,
92
- getSearchFormSorterItems: j,
93
- setSearchFormSorterItems: k,
94
- resetSearchFormSorterItems: A,
87
+ getSearchFormValues: B,
88
+ setSearchFormValues: L,
89
+ submit: E,
90
+ reset: M,
91
+ submitWith: j,
92
+ getSearchFormSorterItems: k,
93
+ setSearchFormSorterItems: A,
94
+ resetSearchFormSorterItems: W,
95
95
  ...a.saveDataSource
96
- }, y = {
97
- ..._.value,
96
+ }, d = {
97
+ ...O.value,
98
98
  ...a.viewCacheOption
99
99
  }, {
100
- mountedData: b,
101
- isValidMountedData: U
102
- } = re({
100
+ mountedData: D,
101
+ isValidMountedData: T,
102
+ isFirstSendToUrl: y
103
+ } = se({
103
104
  saveDataSource: r,
104
105
  sendToUrl: n(() => a.sendToUrl),
105
106
  tableKey: n(() => a.tableKey),
106
- searchFormModel: n(() => a?.saveDataSource?.searchFormModel || W?.value),
107
+ searchFormModel: n(() => a?.saveDataSource?.searchFormModel || G?.value),
107
108
  extraUrlParams: n(() => a.extraUrlParams)
108
- }), T = () => a.isDefaultSystemView ? v : (a.isFirstDefaultSystemView || C) && m ? v : o.value.find((i) => i.isDefault)?.viewKey ?? v, u = (t) => {
109
+ }), I = () => a.isDefaultSystemView ? v : (a.isFirstDefaultSystemView || U) && m ? v : o.value.find((i) => i.isDefault)?.viewKey ?? v, u = (t) => {
109
110
  w.value = t;
110
111
  const i = o.value.find((e) => e.viewKey === w.value);
111
112
  i && setTimeout(() => {
112
- i.viewKey === v ? m ? a.manual || (a.sendToUrl && K && a.initToUrl && U.value && r?.setSearchFormValues?.(b.value), r?.submitWith?.()) : a.manual || (r?.resetSearchFormSorterItems?.(), r?.reset?.()) : (a.sendToUrl && K && a.initToUrl && U.value && m ? r?.setSearchFormValues?.(b.value) : r?.setSearchFormValues?.({
113
+ i.viewKey === v ? m ? a.manual || (a.sendToUrl && b && a.initToUrl && T.value && y.value && (r?.setSearchFormValues?.(D.value), y.value = !1), r?.submitWith?.()) : a.manual || (r?.resetSearchFormSorterItems?.(), r?.reset?.()) : (a.sendToUrl && b && a.initToUrl && T.value && m && y.value ? (r?.setSearchFormValues?.(D.value), y.value = !1) : r?.setSearchFormValues?.({
113
114
  ...Object.fromEntries(Object.keys(r?.getSearchFormValues?.() ?? {}).map((e) => [e, void 0])) ?? {},
114
115
  ...a?.emptyData ?? {},
115
116
  ...[...r?.getSearchFormSorterItems?.() ?? [], ...a?.extraParams?.map((e) => ({
@@ -117,17 +118,17 @@ const _e = /* @__PURE__ */ R({
117
118
  })) ?? []].reduce((e, s) => (i.viewConfig?.searchForm?.[s.name] && (e[s.name] = i.viewConfig?.searchForm?.[s.name]), e), {}) ?? {}
118
119
  }), r?.setSearchFormSorterItems?.(i.viewConfig?.sorterItems ?? []), m ? a.manual || r?.submitWith?.() : r?.submit?.()), m = !1;
119
120
  });
120
- }, I = {
121
+ }, x = {
121
122
  getViewList: async (t) => {
122
123
  try {
123
124
  const {
124
125
  tableKey: i
125
- } = t, e = await y?.getViewList?.({
126
+ } = t, e = await d?.getViewList?.({
126
127
  tableKey: i
127
128
  });
128
- return o.value = [S.value, ...e ?? []], u(T()), o.value;
129
+ return o.value = [h.value, ...e ?? []], u(I()), o.value;
129
130
  } catch {
130
- return o.value = [S.value], u(v), o.value;
131
+ return o.value = [h.value], u(v), o.value;
131
132
  }
132
133
  },
133
134
  addView: async (t) => {
@@ -138,7 +139,7 @@ const _e = /* @__PURE__ */ R({
138
139
  isDefault: l,
139
140
  viewConfig: p
140
141
  } = t;
141
- await y?.addView?.({
142
+ await d?.addView?.({
142
143
  tableKey: i,
143
144
  viewKey: e,
144
145
  viewName: s,
@@ -162,17 +163,17 @@ const _e = /* @__PURE__ */ R({
162
163
  isDefault: l,
163
164
  viewConfig: p
164
165
  } = t;
165
- await y?.changeView?.({
166
+ await d?.changeView?.({
166
167
  tableKey: i,
167
168
  viewKey: e,
168
169
  viewName: s,
169
170
  isDefault: l,
170
171
  viewConfig: p
171
- }), l && (o.value = o.value.map((D) => ({
172
- ...D,
172
+ }), l && (o.value = o.value.map((g) => ({
173
+ ...g,
173
174
  isDefault: !1
174
175
  })));
175
- const c = o.value.find((D) => D.viewKey === e);
176
+ const c = o.value.find((g) => g.viewKey === e);
176
177
  c && (c.viewName = s, c.isDefault = l, c.viewConfig = p), u(e);
177
178
  },
178
179
  removeView: async (t) => {
@@ -180,54 +181,54 @@ const _e = /* @__PURE__ */ R({
180
181
  tableKey: i,
181
182
  viewKey: e
182
183
  } = t;
183
- await y?.removeView?.({
184
+ await d?.removeView?.({
184
185
  tableKey: i,
185
186
  viewKey: e
186
- }), o.value = o.value.filter((s) => s.viewKey !== e), e === w.value && u(T());
187
+ }), o.value = o.value.filter((s) => s.viewKey !== e), e === w.value && u(I());
187
188
  }
188
- }, z = {
189
+ }, R = {
189
190
  tableKey: n(() => a.tableKey),
190
191
  currentViewKey: w,
191
192
  changeCurrentViewKey: u,
192
- popoverOpen: G,
193
- menuOpen: h,
193
+ popoverOpen: $,
194
+ menuOpen: K,
194
195
  viewList: o,
195
- viewListCRUD: I,
196
+ viewListCRUD: x,
196
197
  saveDataSource: r
197
198
  };
198
- return se(z), q(() => a.tableKey, (t) => {
199
- te(t) && (m = !0, I?.getViewList?.({
199
+ return le(R), H(() => a.tableKey, (t) => {
200
+ ae(t) && (m = !0, x?.getViewList?.({
200
201
  tableKey: t
201
202
  }));
202
203
  }, {
203
204
  immediate: !0
204
- }), N({
205
+ }), _({
205
206
  setFirstDefaultSystemView: (t) => {
206
- C = t;
207
+ U = t;
207
208
  },
208
209
  setInitToUrl: (t) => {
209
- K = t;
210
+ b = t;
210
211
  },
211
- getMountedData: () => b.value
212
- }), (t, i) => (J(), H(f(oe), Q({
212
+ getMountedData: () => D.value
213
+ }), (t, i) => (Q(), J(f(re), X({
213
214
  ...t.$attrs
214
215
  }, {
215
- open: h.value,
216
- "onUpdate:open": i[0] || (i[0] = (e) => h.value = e),
217
- class: [f(V)(), f(F)],
218
- "button-props": $,
219
- "menu-list": Y.value,
220
- "overlay-class-name": [f(V)("overlay"), f(F)],
216
+ open: K.value,
217
+ "onUpdate:open": i[0] || (i[0] = (e) => K.value = e),
218
+ class: [f(S)(), f(C)],
219
+ "button-props": Y,
220
+ "menu-list": z.value,
221
+ "overlay-class-name": [f(S)("overlay"), f(C)],
221
222
  trigger: "click",
222
223
  placement: "bottom"
223
224
  }), {
224
- icon: X(() => [Z("div", {
225
- class: ee([f(V)("icon")])
226
- }, [g(le)], 2)]),
225
+ icon: Z(() => [ee("div", {
226
+ class: te([f(S)("icon")])
227
+ }, [F(ne)], 2)]),
227
228
  _: 1
228
229
  }, 16, ["open", "class", "menu-list", "overlay-class-name"]));
229
230
  }
230
231
  });
231
232
  export {
232
- _e as default
233
+ Oe as default
233
234
  };
@@ -1,4 +1,4 @@
1
- import { ComputedRef } from 'vue';
1
+ import { ComputedRef, Ref } from 'vue';
2
2
  import { Recordable } from '../../../type';
3
3
  import { SaveDataSource } from '../interface';
4
4
  export declare const useSendToUrl: (option: {
@@ -10,4 +10,5 @@ export declare const useSendToUrl: (option: {
10
10
  }) => {
11
11
  mountedData: ComputedRef<Recordable>;
12
12
  isValidMountedData: ComputedRef<boolean>;
13
+ isFirstSendToUrl: Ref<boolean, boolean>;
13
14
  };
@@ -1,51 +1,52 @@
1
- import { isObjectWithContent as h } from "@aplus-frontend/utils";
2
- import { debounce as f } from "lodash-unified";
3
- import { ref as p, watch as v, onMounted as g, computed as l } from "vue";
4
- import { setUrlQuery as C, getUrlQuery as U } from "../utils/query.mjs";
5
- const I = (d) => {
1
+ import { isObjectWithContent as v } from "@aplus-frontend/utils";
2
+ import { debounce as p } from "lodash-unified";
3
+ import { ref as d, watch as U, onMounted as g, computed as u } from "vue";
4
+ import { setUrlQuery as C, getUrlQuery as y } from "../utils/query.mjs";
5
+ const I = (s) => {
6
6
  const {
7
- saveDataSource: u,
8
- sendToUrl: n,
9
- tableKey: r,
10
- extraUrlParams: c,
11
- searchFormModel: s
12
- } = d;
7
+ saveDataSource: c,
8
+ sendToUrl: r,
9
+ tableKey: n,
10
+ extraUrlParams: i,
11
+ searchFormModel: m
12
+ } = s;
13
13
  let t, o = !1;
14
- const a = p({}), m = f(() => {
14
+ const a = d({}), l = d(!1), f = p(() => {
15
15
  try {
16
16
  const e = encodeURIComponent(
17
17
  JSON.stringify({
18
- ...u?.getSearchFormValues?.(),
19
- ...c?.value?.() ?? {}
18
+ ...c?.getSearchFormValues?.(),
19
+ ...i?.value?.() ?? {}
20
20
  })
21
21
  );
22
22
  e !== t && (t = e, o = !0);
23
23
  } catch {
24
24
  t = "";
25
25
  }
26
- o && (C({ [r.value]: t }), o = !1);
27
- }, 500), i = () => {
26
+ o && (C({ [n.value]: t }), o = !1);
27
+ }, 500), h = () => {
28
28
  try {
29
- const e = U()[r.value] ?? "";
30
- a.value = e ? JSON.parse(decodeURIComponent(e)) : {};
29
+ const e = y()[n.value] ?? "";
30
+ a.value = e ? JSON.parse(decodeURIComponent(e)) : {}, l.value = !0;
31
31
  } catch {
32
32
  a.value = {};
33
33
  }
34
34
  };
35
- return v(
36
- s,
35
+ return U(
36
+ m,
37
37
  () => {
38
- n?.value && m();
38
+ r?.value && f();
39
39
  },
40
40
  {
41
41
  deep: !0,
42
42
  immediate: !0
43
43
  }
44
44
  ), g(() => {
45
- n?.value && i();
45
+ r?.value && h();
46
46
  }), {
47
- mountedData: l(() => a.value),
48
- isValidMountedData: l(() => h(a.value))
47
+ mountedData: u(() => a.value),
48
+ isValidMountedData: u(() => v(a.value)),
49
+ isFirstSendToUrl: l
49
50
  };
50
51
  };
51
52
  export {
@@ -1,2 +1,2 @@
1
- declare const _default: "7.19.2";
1
+ declare const _default: "7.19.3";
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
- const e = "7.19.2";
1
+ const e = "7.19.3";
2
2
  export {
3
3
  e as default
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),q=require("@ant-design/icons-vue"),N=require("@aplus-frontend/antdv"),b=require("lodash-unified");require("../../config-provider/index.js");const B=require("../../config-provider/hooks/use-token.js");require("../../hooks/index.js");const T=require("../../utils/warning.js");require("./ap-tag.vue2.js");const W=require("./style/group.js"),g=require("./utils.js"),z=require("../../config-provider/hooks/use-locale.js"),S=require("../../config-provider/hooks/use-namespace.js"),P=require("../../hooks/useResize.js"),D=require("./ap-tag.vue.js"),R=e.defineComponent({__name:"ap-tag-group",props:{list:{default:()=>[]},space:{default:4},ellipsisColor:{},ellipsis:{default:()=>({})}},setup(f){const{t:v}=z.useLocale(),o=f,{token:h}=B.useToken(),y=T.useDevWarning("ApTagGroup"),{b:p}=S.useNamespace("tag-group"),x=W.default("tag-group"),n=e.ref(),{observe:k,unobserve:w}=P.useResize(),r=e.computed(()=>({...{iconColor:h.value?.textColor1,symbol:"icon",text:v("ap.common.more")},...o.ellipsis})),C=e.computed(()=>r.value.tooltip&&typeof r.value.tooltip=="object"?b.omit(r.value.tooltip,["trigger","title"]):{}),a=e.computed(()=>e.unref(u)<o.list.length),u=e.ref(0),_=e.computed(()=>o.list.map(t=>t.text).join("、")),E=e.computed(()=>[p(),x.value].filter(Boolean)),d=()=>{let t=0,l=0;if(!n.value)return;const i=n.value.offsetWidth;for(let s of o.list){const c=s.size==="small"?8:12,m=g.getTextWidth(s.size==="large"?14:12,s.text)+c+o.space;if(t+=m,t>i){t-=m;break}l++}if(l<o.list.length){const c=g.getTextWidth(12,r.value.text);o.ellipsis.symbol==="icon"?t+=16:t+=c,t>i&&l--}u.value=l};e.watch(()=>o.list,(t,l)=>{t!==l&&e.nextTick(()=>{d()})},{immediate:!0});const V=()=>{d()};return e.onMounted(()=>{[["ellipsisColor","ellipse.color"]].forEach(([t,l])=>{y.deprecated(!o[t],t,l)}),n.value&&k(n.value,V)}),e.onUnmounted(()=>{n.value&&w(n.value)}),(t,l)=>(e.openBlock(),e.createBlock(e.unref(N.Tooltip),e.mergeProps({trigger:"hover"},C.value),{title:e.withCtx(()=>[e.renderSlot(t.$slots,"tooltip",{tags:t.list},()=>[e.createTextVNode(e.toDisplayString(_.value),1)])]),default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"container",ref:n,class:e.normalizeClass(E.value),style:e.normalizeStyle({pointerEvents:a.value?"auto":"none"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.list,(i,s)=>(e.openBlock(),e.createBlock(D.default,e.mergeProps({ref_for:!0},i,{key:s,style:{display:s>=u.value?"none":"inline-flex",marginRight:`${t.space}px`}}),null,16,["style"]))),128)),a.value&&r.value.symbol==="icon"?(e.openBlock(),e.createBlock(e.unref(q),{key:0,style:e.normalizeStyle({color:t.ellipsisColor||r.value.iconColor,cursor:"pointer"})},{component:e.withCtx(()=>[...l[0]||(l[0]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"none",version:"1.1",width:"16",height:"16",viewBox:"0 0 16 16"},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:"master_svg0_1133_24991"},[e.createElementVNode("rect",{x:"0",y:"0",width:"16",height:"16",rx:"0"})])]),e.createElementVNode("g",{"clip-path":"url(#master_svg0_1133_24991)"},[e.createElementVNode("g",null,[e.createElementVNode("ellipse",{cx:"8",cy:"8",rx:"1",ry:"1",fill:"currentColor","fill-opacity":"1"})]),e.createElementVNode("g",null,[e.createElementVNode("ellipse",{cx:"3.25",cy:"8",rx:"1",ry:"1",fill:"currentColor","fill-opacity":"1"})]),e.createElementVNode("g",null,[e.createElementVNode("ellipse",{cx:"12.75",cy:"8",rx:"1",ry:"1",fill:"currentColor","fill-opacity":"1"})])])],-1)])]),_:1},8,["style"])):a.value&&r.value.symbol==="text"?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(p)("ellipsis-text")),style:{cursor:"pointer"}},e.toDisplayString(r.value.text),3)):e.createCommentVNode("",!0)],6)]),_:3},16))}});exports.default=R;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),q=require("@ant-design/icons-vue"),v=require("@aplus-frontend/antdv"),_=require("lodash-unified");require("../../config-provider/index.js");const T=require("../../config-provider/hooks/use-token.js");require("../../hooks/index.js");const W=require("../../utils/warning.js");require("./ap-tag.vue2.js");const b=require("./style/group.js"),y=require("./utils.js"),S=require("../../config-provider/hooks/use-locale.js"),z=require("../../config-provider/hooks/use-namespace.js"),D=require("../../hooks/useResize.js"),P=require("./ap-tag.vue.js"),G=e.defineComponent({__name:"ap-tag-group",props:{list:{default:()=>[]},space:{default:4},ellipsisColor:{},ellipsis:{default:()=>({isWrapGroup:!0})}},setup(h){const{t:k}=S.useLocale(),o=h,{token:x}=T.useToken(),C=W.useDevWarning("ApTagGroup"),{b:a}=z.useNamespace("tag-group"),w=b.default("tag-group"),s=e.ref(),{observe:E,unobserve:V}=D.useResize(),r=e.computed(()=>({...{iconColor:x.value?.textColor1,symbol:"icon",text:k("ap.common.more")},...o.ellipsis})),d=e.computed(()=>r.value.tooltip&&typeof r.value.tooltip=="object"?_.omit(r.value.tooltip,["trigger","title"]):{}),u=e.computed(()=>e.unref(c)<o.list.length),c=e.ref(0),m=e.computed(()=>o.list.map(t=>t.text).join("、")),N=e.computed(()=>[a(),w.value].filter(Boolean)),g=()=>{let t=0,l=0;if(!s.value)return;const i=s.value.offsetWidth;for(let n of o.list){const p=n.size==="small"?8:12,f=y.getTextWidth(n.size==="large"?14:12,n.text)+p+o.space;if(t+=f,t>i){t-=f;break}l++}if(l<o.list.length){const p=y.getTextWidth(12,r.value.text);o.ellipsis.symbol==="icon"?t+=16:t+=p,t>i&&l--}c.value=l};e.watch(()=>o.list,(t,l)=>{t!==l&&e.nextTick(()=>{g()})},{immediate:!0});const B=()=>{g()};return e.onMounted(()=>{[["ellipsisColor","ellipse.color"]].forEach(([t,l])=>{C.deprecated(!o[t],t,l)}),s.value&&E(s.value,B)}),e.onUnmounted(()=>{s.value&&V(s.value)}),(t,l)=>(e.openBlock(),e.createBlock(e.unref(v.Tooltip),e.mergeProps({trigger:"hover"},d.value),e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"container",ref:s,class:e.normalizeClass(N.value),style:e.normalizeStyle({pointerEvents:u.value?"auto":"none"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.list,(i,n)=>(e.openBlock(),e.createBlock(P.default,e.mergeProps({ref_for:!0},i,{key:n,style:{display:n>=c.value?"none":"inline-flex",marginRight:`${t.space}px`}}),null,16,["style"]))),128)),u.value&&r.value.symbol==="icon"?(e.openBlock(),e.createBlock(e.unref(q),{key:0,style:e.normalizeStyle({color:t.ellipsisColor||r.value.iconColor,cursor:"pointer"})},{component:e.withCtx(()=>[...l[0]||(l[0]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"none",version:"1.1",width:"16",height:"16",viewBox:"0 0 16 16"},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:"master_svg0_1133_24991"},[e.createElementVNode("rect",{x:"0",y:"0",width:"16",height:"16",rx:"0"})])]),e.createElementVNode("g",{"clip-path":"url(#master_svg0_1133_24991)"},[e.createElementVNode("g",null,[e.createElementVNode("ellipse",{cx:"8",cy:"8",rx:"1",ry:"1",fill:"currentColor","fill-opacity":"1"})]),e.createElementVNode("g",null,[e.createElementVNode("ellipse",{cx:"3.25",cy:"8",rx:"1",ry:"1",fill:"currentColor","fill-opacity":"1"})]),e.createElementVNode("g",null,[e.createElementVNode("ellipse",{cx:"12.75",cy:"8",rx:"1",ry:"1",fill:"currentColor","fill-opacity":"1"})])])],-1)])]),_:1},8,["style"])):u.value&&r.value.symbol==="text"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.ellipsis.isWrapGroup?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(a)("ellipsis-text")),style:{cursor:"pointer"}},e.toDisplayString(r.value.text),3)):(e.openBlock(),e.createBlock(e.unref(v.Tooltip),e.mergeProps({key:1,trigger:"hover"},d.value),{title:e.withCtx(()=>[e.renderSlot(t.$slots,"tooltip",{tags:t.list},()=>[e.createTextVNode(e.toDisplayString(m.value),1)])]),default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(e.unref(a)("ellipsis-text")),style:{cursor:"pointer"}},e.toDisplayString(r.value.text),3)]),_:3},16))],64)):e.createCommentVNode("",!0)],6)]),_:2},[t.ellipsis.isWrapGroup?{name:"title",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"tooltip",{tags:t.list},()=>[e.createTextVNode(e.toDisplayString(m.value),1)])]),key:"0"}:void 0]),1040))}});exports.default=G;
@@ -48,6 +48,10 @@ export type EllipsisProps = {
48
48
  * 省略号气泡内容
49
49
  */
50
50
  tooltip?: Omit<TooltipProps, 'trigger' | 'title'>;
51
+ /**
52
+ * tooltip是否包围整个group
53
+ */
54
+ isWrapGroup?: boolean;
51
55
  };
52
56
  export interface ApTagGroupProps {
53
57
  /**
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),A=require("@aplus-frontend/utils"),G=require("../../ap-form/context.js"),$=require("../../ap-table/context.js");require("../../config-provider/index.js");const z=require("../ap-batch-action-group/index.js");require("./components/main-button-content.vue.js");require("./components/menu-list-content.vue.js");const R=require("./hooks/use-send-to-url.js"),H=require("./hooks/use-view-provide.js"),J=require("./icons/line-down.vue.js"),Q=require("./style/index.js"),v=require("./utils/enum.js"),X=require("../../config-provider/hooks/use-global-config.js"),Z=require("../../config-provider/hooks/use-namespace.js"),ee=require("../../config-provider/hooks/use-locale.js"),te=require("./components/main-button-content.vue2.js"),ae=require("./components/menu-list-content.vue2.js"),se=e.defineComponent({name:"ApView",__name:"ap-view",props:{tableKey:{},saveDataSource:{},viewCacheOption:{},maxViewNum:{default:20},isDefaultSystemView:{type:Boolean,default:!1},isFirstDefaultSystemView:{type:Boolean,default:!1},manual:{type:Boolean,default:!1},emptyData:{},extraParams:{},sendToUrl:{type:Boolean,default:!0},initToUrl:{type:Boolean,default:!0},extraUrlParams:{}},setup(F,{expose:C}){const s=F,E=X.useGlobalConfig("viewCacheOption"),{b:p}=Z.useNamespace("ap-view"),{t:q}=ee.useLocale(),K=Q.default("ap-view"),y=e.computed(()=>({viewKey:v.SYSTEM_VIEW_KEY,viewName:q("ap.apView.systemView")})),{getSearchFormValues:I,setSearchFormValues:U,submit:x,reset:N,submitWith:M,getSearchFormSorterItems:Y,setSearchFormSorterItems:P,resetSearchFormSorterItems:O}=$.useInjectApTable(),{model:B}=G.useInjectForm(),L=e.ref(!1),V=e.ref(!1),d=e.ref("");let l=!1,b=!1,S=!0;const W={dropdownType:"dropdown",content:e.createVNode(te.default,{maxViewNum:s.maxViewNum},null)},i=e.ref([y.value]),j=e.computed(()=>i.value.map(a=>({id:a.viewKey,content:e.createVNode(ae.default,{view:a},null)}))),o={getSearchFormValues:I,setSearchFormValues:U,submit:x,reset:N,submitWith:M,getSearchFormSorterItems:Y,setSearchFormSorterItems:P,resetSearchFormSorterItems:O,...s.saveDataSource},w={...E.value,...s.viewCacheOption},{mountedData:_,isValidMountedData:g}=R.useSendToUrl({saveDataSource:o,sendToUrl:e.computed(()=>s.sendToUrl),tableKey:e.computed(()=>s.tableKey),searchFormModel:e.computed(()=>s?.saveDataSource?.searchFormModel||B?.value),extraUrlParams:e.computed(()=>s.extraUrlParams)}),D=()=>s.isDefaultSystemView||(s.isFirstDefaultSystemView||b)&&l?v.SYSTEM_VIEW_KEY:i.value.find(r=>r.isDefault)?.viewKey??v.SYSTEM_VIEW_KEY,c=a=>{d.value=a;const r=i.value.find(t=>t.viewKey===d.value);r&&setTimeout(()=>{r.viewKey===v.SYSTEM_VIEW_KEY?l?s.manual||(s.sendToUrl&&S&&s.initToUrl&&g.value&&o?.setSearchFormValues?.(_.value),o?.submitWith?.()):s.manual||(o?.resetSearchFormSorterItems?.(),o?.reset?.()):(s.sendToUrl&&S&&s.initToUrl&&g.value&&l?o?.setSearchFormValues?.(_.value):o?.setSearchFormValues?.({...Object.fromEntries(Object.keys(o?.getSearchFormValues?.()??{}).map(t=>[t,void 0]))??{},...s?.emptyData??{},...[...o?.getSearchFormSorterItems?.()??[],...s?.extraParams?.map(t=>({name:t}))??[]].reduce((t,n)=>(r.viewConfig?.searchForm?.[n.name]&&(t[n.name]=r.viewConfig?.searchForm?.[n.name]),t),{})??{}}),o?.setSearchFormSorterItems?.(r.viewConfig?.sorterItems??[]),l?s.manual||o?.submitWith?.():o?.submit?.()),l=!1})},T={getViewList:async a=>{try{const{tableKey:r}=a,t=await w?.getViewList?.({tableKey:r});return i.value=[y.value,...t??[]],c(D()),i.value}catch{return i.value=[y.value],c(v.SYSTEM_VIEW_KEY),i.value}},addView:async a=>{const{tableKey:r,viewKey:t,viewName:n,isDefault:u,viewConfig:f}=a;await w?.addView?.({tableKey:r,viewKey:t,viewName:n,isDefault:u,viewConfig:f}),u&&(i.value=i.value.map(m=>({...m,isDefault:!1}))),i.value=[...i.value,{viewKey:t,viewName:n,isDefault:u,viewConfig:f}],c(t)},changeView:async a=>{const{tableKey:r,viewKey:t,viewName:n,isDefault:u,viewConfig:f}=a;await w?.changeView?.({tableKey:r,viewKey:t,viewName:n,isDefault:u,viewConfig:f}),u&&(i.value=i.value.map(h=>({...h,isDefault:!1})));const m=i.value.find(h=>h.viewKey===t);m&&(m.viewName=n,m.isDefault=u,m.viewConfig=f),c(t)},removeView:async a=>{const{tableKey:r,viewKey:t}=a;await w?.removeView?.({tableKey:r,viewKey:t}),i.value=i.value.filter(n=>n.viewKey!==t),t===d.value&&c(D())}},k={tableKey:e.computed(()=>s.tableKey),currentViewKey:d,changeCurrentViewKey:c,popoverOpen:L,menuOpen:V,viewList:i,viewListCRUD:T,saveDataSource:o};return H.useViewProvide(k),e.watch(()=>s.tableKey,a=>{A.isValid(a)&&(l=!0,T?.getViewList?.({tableKey:a}))},{immediate:!0}),C({setFirstDefaultSystemView:a=>{b=a},setInitToUrl:a=>{S=a},getMountedData:()=>_.value}),(a,r)=>(e.openBlock(),e.createBlock(e.unref(z.ApBatchActionGroup),e.mergeProps({...a.$attrs},{open:V.value,"onUpdate:open":r[0]||(r[0]=t=>V.value=t),class:[e.unref(p)(),e.unref(K)],"button-props":W,"menu-list":j.value,"overlay-class-name":[e.unref(p)("overlay"),e.unref(K)],trigger:"click",placement:"bottom"}),{icon:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass([e.unref(p)("icon")])},[e.createVNode(J.default)],2)]),_:1},16,["open","class","menu-list","overlay-class-name"]))}});exports.default=se;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),G=require("@aplus-frontend/utils"),$=require("../../ap-form/context.js"),z=require("../../ap-table/context.js");require("../../config-provider/index.js");const R=require("../ap-batch-action-group/index.js");require("./components/main-button-content.vue.js");require("./components/menu-list-content.vue.js");const H=require("./hooks/use-send-to-url.js"),J=require("./hooks/use-view-provide.js"),Q=require("./icons/line-down.vue.js"),X=require("./style/index.js"),v=require("./utils/enum.js"),Z=require("../../config-provider/hooks/use-global-config.js"),ee=require("../../config-provider/hooks/use-namespace.js"),te=require("../../config-provider/hooks/use-locale.js"),ae=require("./components/main-button-content.vue2.js"),se=require("./components/menu-list-content.vue2.js"),re=e.defineComponent({name:"ApView",__name:"ap-view",props:{tableKey:{},saveDataSource:{},viewCacheOption:{},maxViewNum:{default:20},isDefaultSystemView:{type:Boolean,default:!1},isFirstDefaultSystemView:{type:Boolean,default:!1},manual:{type:Boolean,default:!1},emptyData:{},extraParams:{},sendToUrl:{type:Boolean,default:!0},initToUrl:{type:Boolean,default:!0},extraUrlParams:{}},setup(C,{expose:E}){const s=C,q=Z.useGlobalConfig("viewCacheOption"),{b:y}=ee.useNamespace("ap-view"),{t:U}=te.useLocale(),b=X.default("ap-view"),S=e.computed(()=>({viewKey:v.SYSTEM_VIEW_KEY,viewName:U("ap.apView.systemView")})),{getSearchFormValues:I,setSearchFormValues:x,submit:N,reset:M,submitWith:Y,getSearchFormSorterItems:P,setSearchFormSorterItems:O,resetSearchFormSorterItems:B}=z.useInjectApTable(),{model:L}=$.useInjectForm(),W=e.ref(!1),V=e.ref(!1),d=e.ref("");let l=!1,g=!1,_=!0;const j={dropdownType:"dropdown",content:e.createVNode(ae.default,{maxViewNum:s.maxViewNum},null)},i=e.ref([S.value]),k=e.computed(()=>i.value.map(a=>({id:a.viewKey,content:e.createVNode(se.default,{view:a},null)}))),o={getSearchFormValues:I,setSearchFormValues:x,submit:N,reset:M,submitWith:Y,getSearchFormSorterItems:P,setSearchFormSorterItems:O,resetSearchFormSorterItems:B,...s.saveDataSource},w={...q.value,...s.viewCacheOption},{mountedData:h,isValidMountedData:D,isFirstSendToUrl:p}=H.useSendToUrl({saveDataSource:o,sendToUrl:e.computed(()=>s.sendToUrl),tableKey:e.computed(()=>s.tableKey),searchFormModel:e.computed(()=>s?.saveDataSource?.searchFormModel||L?.value),extraUrlParams:e.computed(()=>s.extraUrlParams)}),T=()=>s.isDefaultSystemView||(s.isFirstDefaultSystemView||g)&&l?v.SYSTEM_VIEW_KEY:i.value.find(r=>r.isDefault)?.viewKey??v.SYSTEM_VIEW_KEY,c=a=>{d.value=a;const r=i.value.find(t=>t.viewKey===d.value);r&&setTimeout(()=>{r.viewKey===v.SYSTEM_VIEW_KEY?l?s.manual||(s.sendToUrl&&_&&s.initToUrl&&D.value&&p.value&&(o?.setSearchFormValues?.(h.value),p.value=!1),o?.submitWith?.()):s.manual||(o?.resetSearchFormSorterItems?.(),o?.reset?.()):(s.sendToUrl&&_&&s.initToUrl&&D.value&&l&&p.value?(o?.setSearchFormValues?.(h.value),p.value=!1):o?.setSearchFormValues?.({...Object.fromEntries(Object.keys(o?.getSearchFormValues?.()??{}).map(t=>[t,void 0]))??{},...s?.emptyData??{},...[...o?.getSearchFormSorterItems?.()??[],...s?.extraParams?.map(t=>({name:t}))??[]].reduce((t,u)=>(r.viewConfig?.searchForm?.[u.name]&&(t[u.name]=r.viewConfig?.searchForm?.[u.name]),t),{})??{}}),o?.setSearchFormSorterItems?.(r.viewConfig?.sorterItems??[]),l?s.manual||o?.submitWith?.():o?.submit?.()),l=!1})},F={getViewList:async a=>{try{const{tableKey:r}=a,t=await w?.getViewList?.({tableKey:r});return i.value=[S.value,...t??[]],c(T()),i.value}catch{return i.value=[S.value],c(v.SYSTEM_VIEW_KEY),i.value}},addView:async a=>{const{tableKey:r,viewKey:t,viewName:u,isDefault:n,viewConfig:f}=a;await w?.addView?.({tableKey:r,viewKey:t,viewName:u,isDefault:n,viewConfig:f}),n&&(i.value=i.value.map(m=>({...m,isDefault:!1}))),i.value=[...i.value,{viewKey:t,viewName:u,isDefault:n,viewConfig:f}],c(t)},changeView:async a=>{const{tableKey:r,viewKey:t,viewName:u,isDefault:n,viewConfig:f}=a;await w?.changeView?.({tableKey:r,viewKey:t,viewName:u,isDefault:n,viewConfig:f}),n&&(i.value=i.value.map(K=>({...K,isDefault:!1})));const m=i.value.find(K=>K.viewKey===t);m&&(m.viewName=u,m.isDefault=n,m.viewConfig=f),c(t)},removeView:async a=>{const{tableKey:r,viewKey:t}=a;await w?.removeView?.({tableKey:r,viewKey:t}),i.value=i.value.filter(u=>u.viewKey!==t),t===d.value&&c(T())}},A={tableKey:e.computed(()=>s.tableKey),currentViewKey:d,changeCurrentViewKey:c,popoverOpen:W,menuOpen:V,viewList:i,viewListCRUD:F,saveDataSource:o};return J.useViewProvide(A),e.watch(()=>s.tableKey,a=>{G.isValid(a)&&(l=!0,F?.getViewList?.({tableKey:a}))},{immediate:!0}),E({setFirstDefaultSystemView:a=>{g=a},setInitToUrl:a=>{_=a},getMountedData:()=>h.value}),(a,r)=>(e.openBlock(),e.createBlock(e.unref(R.ApBatchActionGroup),e.mergeProps({...a.$attrs},{open:V.value,"onUpdate:open":r[0]||(r[0]=t=>V.value=t),class:[e.unref(y)(),e.unref(b)],"button-props":j,"menu-list":k.value,"overlay-class-name":[e.unref(y)("overlay"),e.unref(b)],trigger:"click",placement:"bottom"}),{icon:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass([e.unref(y)("icon")])},[e.createVNode(Q.default)],2)]),_:1},16,["open","class","menu-list","overlay-class-name"]))}});exports.default=re;
@@ -1,4 +1,4 @@
1
- import { ComputedRef } from 'vue';
1
+ import { ComputedRef, Ref } from 'vue';
2
2
  import { Recordable } from '../../../type';
3
3
  import { SaveDataSource } from '../interface';
4
4
  export declare const useSendToUrl: (option: {
@@ -10,4 +10,5 @@ export declare const useSendToUrl: (option: {
10
10
  }) => {
11
11
  mountedData: ComputedRef<Recordable>;
12
12
  isValidMountedData: ComputedRef<boolean>;
13
+ isFirstSendToUrl: Ref<boolean, boolean>;
13
14
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@aplus-frontend/utils"),y=require("lodash-unified"),t=require("vue"),l=require("../utils/query.js"),U=d=>{const{saveDataSource:s,sendToUrl:r,tableKey:u,extraUrlParams:c,searchFormModel:i}=d;let a,o=!1;const n=t.ref({}),h=()=>{try{const e=encodeURIComponent(JSON.stringify({...s?.getSearchFormValues?.(),...c?.value?.()??{}}));e!==a&&(a=e,o=!0)}catch{a=""}o&&(l.setUrlQuery({[u.value]:a}),o=!1)},m=y.debounce(h,500),v=()=>{try{const e=l.getUrlQuery()[u.value]??"";n.value=e?JSON.parse(decodeURIComponent(e)):{}}catch{n.value={}}};return t.watch(i,()=>{r?.value&&m()},{deep:!0,immediate:!0}),t.onMounted(()=>{r?.value&&v()}),{mountedData:t.computed(()=>n.value),isValidMountedData:t.computed(()=>f.isObjectWithContent(n.value))}};exports.useSendToUrl=U;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("@aplus-frontend/utils"),y=require("lodash-unified"),e=require("vue"),s=require("../utils/query.js"),S=d=>{const{saveDataSource:c,sendToUrl:o,tableKey:u,extraUrlParams:i,searchFormModel:v}=d;let a,n=!1;const r=e.ref({}),l=e.ref(!1),f=()=>{try{const t=encodeURIComponent(JSON.stringify({...c?.getSearchFormValues?.(),...i?.value?.()??{}}));t!==a&&(a=t,n=!0)}catch{a=""}n&&(s.setUrlQuery({[u.value]:a}),n=!1)},h=y.debounce(f,500),m=()=>{try{const t=s.getUrlQuery()[u.value]??"";r.value=t?JSON.parse(decodeURIComponent(t)):{},l.value=!0}catch{r.value={}}};return e.watch(v,()=>{o?.value&&h()},{deep:!0,immediate:!0}),e.onMounted(()=>{o?.value&&m()}),{mountedData:e.computed(()=>r.value),isValidMountedData:e.computed(()=>U.isObjectWithContent(r.value)),isFirstSendToUrl:l}};exports.useSendToUrl=S;
@@ -1,2 +1,2 @@
1
- declare const _default: "7.19.2";
1
+ declare const _default: "7.19.3";
2
2
  export default _default;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.19.2";exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.19.3";exports.default=e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "7.19.2",
3
+ "version": "7.19.3",
4
4
  "main": "./lib/index.js",
5
5
  "type": "module",
6
6
  "typings": "./lib/index.d.ts",