@aplus-frontend/ui 6.30.0 → 6.30.1

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,21 +1,21 @@
1
- import { isVNode as se, defineComponent as ie, useSlots as ue, ref as D, shallowRef as U, computed as _, unref as a, watch as z, createVNode as o, Fragment as w, createBlock as y, openBlock as p, mergeProps as ce, withCtx as B, resolveDynamicComponent as I, createElementBlock as pe, renderList as de, normalizeStyle as fe } from "vue";
2
- import { Col as R, Flex as k, Button as M, Row as me } from "@aplus-frontend/antdv";
1
+ import { isVNode as se, defineComponent as ie, useSlots as ue, ref as U, shallowRef as z, computed as _, unref as a, watch as M, createVNode as o, Fragment as w, createBlock as y, openBlock as p, mergeProps as ce, withCtx as B, resolveDynamicComponent as I, createElementBlock as pe, renderList as de, normalizeStyle as fe } from "vue";
2
+ import { Col as R, Flex as k, Button as q, Row as me } from "@aplus-frontend/antdv";
3
3
  import "../ap-form.vue.mjs";
4
4
  import "../item/index.vue2.mjs";
5
- import { genRealChildren as q } from "../item-group/helper.mjs";
5
+ import { genRealChildren as H } from "../item-group/helper.mjs";
6
6
  import "../../config-provider/index.mjs";
7
7
  import { isArray as he, isBoolean as xe, omit as ye } from "lodash-unified";
8
- import { isDef as H } from "../../utils/index.mjs";
9
- import { execFunc as G, diffFormItem as ge } from "./utils.mjs";
8
+ import { isDef as G } from "../../utils/index.mjs";
9
+ import { execFunc as J, diffFormItem as ge } from "./utils.mjs";
10
10
  import "./components/popover-filter.vue.mjs";
11
11
  import { useCountPerRow as ve } from "./hooks/use-count-per-row.mjs";
12
12
  import "./components/popover-sorter/index.vue.mjs";
13
13
  import { useSorter as Ce } from "./hooks/use-sorter.mjs";
14
14
  import { getTargetNode as Se } from "./hooks/use-collapse-input-count.mjs";
15
- import { floorWith as J } from "@fruits-chain/utils";
15
+ import { floorWith as K } from "@fruits-chain/utils";
16
16
  import { useNamespace as _e } from "../../config-provider/hooks/use-namespace.mjs";
17
17
  import { useLocale as we } from "../../config-provider/hooks/use-locale.mjs";
18
- import K from "../item/index.vue.mjs";
18
+ import Q from "../item/index.vue.mjs";
19
19
  import Re from "./components/popover-filter.vue2.mjs";
20
20
  import be from "./components/popover-sorter/index.vue2.mjs";
21
21
  import Fe from "../ap-form.vue2.mjs";
@@ -119,57 +119,57 @@ const r = 100, Qe = /* @__PURE__ */ ie({
119
119
  }
120
120
  },
121
121
  setup(d, {
122
- expose: Q
122
+ expose: X
123
123
  }) {
124
124
  const g = ue(), t = d, {
125
125
  b: f
126
126
  } = _e("ap-form-search-form"), {
127
127
  t: T
128
- } = we(), X = ve(t), v = D(), Y = D();
129
- function P() {
128
+ } = we(), Y = ve(t), v = U(), P = U();
129
+ function E() {
130
130
  const e = v.value?.getFieldsValueTransformed(!0);
131
- G(t.onSubmit, e);
131
+ J(t.onSubmit, e);
132
132
  }
133
133
  function Z() {
134
- t.customReset || v.value?.resetFields?.(), G(t.onReset);
134
+ t.customReset || v.value?.resetFields?.(), J(t.onReset);
135
135
  }
136
- const ee = (e) => H(e) ? (he(e) ? e : [e]).join("") : Date.now();
137
- let E = [];
138
- const m = U(q(g.default())), u = U(g.extra?.()), O = _(() => J(r / a(X), 4)), {
136
+ const ee = (e) => G(e) ? (he(e) ? e : [e]).join("") : Date.now();
137
+ let O = [];
138
+ const m = z(H(g.default())), u = z(g.extra?.()), L = _(() => K(r / a(Y), 4)), {
139
139
  items: b,
140
- sorted: L,
140
+ sorted: W,
141
141
  handleClickConfirm: F
142
142
  } = Ce(m);
143
- z(() => g.default(), (e) => {
144
- E = m.value, m.value = ge(E, q(e)), L.value = !1;
145
- }), z(() => g.extra?.(), (e) => {
143
+ M(() => g.default(), (e) => {
144
+ O = m.value, m.value = ge(O, H(e)), W.value = !1;
145
+ }), M(() => g.extra?.(), (e) => {
146
146
  u.value = e;
147
147
  });
148
148
  function te(e) {
149
- return J(e * (r / 24), 4);
149
+ return K(e * (r / 24), 4);
150
150
  }
151
151
  const n = _(() => {
152
- const e = m.value, c = [], l = [], x = [], s = a(O);
152
+ const e = m.value, c = [], l = [], x = [], s = a(L);
153
153
  let C = 0, A = 0;
154
154
  const ne = r * t.maxRows - s * (a(u) && !t.extraInAction ? 2 : 1);
155
155
  e.forEach((N) => {
156
- const $ = Se(N);
157
- if (!$)
156
+ const j = Se(N);
157
+ if (!j)
158
158
  return;
159
- const i = $.props;
160
- if (xe(i.hidden) ? !!i.hidden : H(i.hidden))
159
+ const i = j.props;
160
+ if (xe(i.hidden) ? !!i.hidden : G(i.hidden))
161
161
  c.push(N);
162
162
  else {
163
163
  let S = i.span ? te(i.span) : s;
164
- const j = {
164
+ const V = {
165
165
  node: N,
166
166
  span: S,
167
167
  key: `ApFormSearchFormItem-${ee(i.name)}-${i._signal}`
168
- }, V = r - C % r;
169
- V < S && (S += V), C += S, C > ne ? l.push(j) : (A = C, x.push(j));
168
+ }, D = r - C % r;
169
+ D < S && (S += D), C += S, C > ne ? l.push(V) : (A = C, x.push(V));
170
170
  }
171
171
  });
172
- const W = r - (A + s) % r, le = Math.ceil(A) % r < s, re = W < s ? r : W;
172
+ const $ = r - (A + s) % r, le = Math.ceil(A) % r < s, re = $ < s ? r : $;
173
173
  return {
174
174
  hideNode: o(w, null, [c]),
175
175
  nodes: x,
@@ -180,10 +180,10 @@ const r = 100, Qe = /* @__PURE__ */ ie({
180
180
  }), h = (e) => `${e}%`, oe = _(() => {
181
181
  let e;
182
182
  const c = n.value.collapseNodes.length || t.sortable && m.value.length, l = o(R, {
183
- flex: h(a(O)),
183
+ flex: h(a(L)),
184
184
  key: "actionWrapper"
185
185
  }, {
186
- default: () => [o(K, null, {
186
+ default: () => [o(Q, null, {
187
187
  default: () => [o(k, {
188
188
  wrap: "wrap",
189
189
  justify: n.value.lastRowOnlyIncludeActionAndExtra && !(a(u) && t.extraInAction) ? "flex-end" : "space-between"
@@ -195,17 +195,17 @@ const r = 100, Qe = /* @__PURE__ */ ie({
195
195
  default: () => [c ? o("div", {
196
196
  class: f("column-setting-trigger-wrapper")
197
197
  }, [n.value.collapseNodes.length ? o(Re, {
198
- onSubmit: P,
198
+ onSubmit: E,
199
199
  config: n.value.collapseNodes,
200
200
  submitLoading: t.submitLoading
201
201
  }, null) : null, t.sortable && b.value.length ? o(be, {
202
- ref: "sorterIns",
202
+ ref: P,
203
203
  items: b.value,
204
204
  onClickConfirm: F,
205
- sorted: L.value
206
- }, null) : null]) : null, o(M, {
205
+ sorted: W.value
206
+ }, null) : null]) : null, o(q, {
207
207
  type: "primary",
208
- onClick: P,
208
+ onClick: E,
209
209
  loading: t.submitLoading ? {
210
210
  delay: t.loadingDelay
211
211
  } : !1,
@@ -213,7 +213,7 @@ const r = 100, Qe = /* @__PURE__ */ ie({
213
213
  class: f("action-btn")
214
214
  }, {
215
215
  default: () => [t.searchText || T("ap.apForm.search.search")]
216
- }), o(M, {
216
+ }), o(q, {
217
217
  onClick: Z,
218
218
  type: "text",
219
219
  class: [f("action-btn"), f("action-btn-reset")]
@@ -227,7 +227,7 @@ const r = 100, Qe = /* @__PURE__ */ ie({
227
227
  flex: h(n.value.extraSpan),
228
228
  key: "extraNode"
229
229
  }, {
230
- default: () => [o(K, null, {
230
+ default: () => [o(Q, null, {
231
231
  default: () => [o(k, {
232
232
  justify: n.value.extraSpan === r || n.value.lastRowOnlyIncludeActionAndExtra ? "start" : "flex-end"
233
233
  }, Ae(e = a(u)) ? e : {
@@ -240,10 +240,10 @@ const r = 100, Qe = /* @__PURE__ */ ie({
240
240
  return n.value.lastRowOnlyIncludeActionAndExtra ? o(w, null, [x || s, l]) : o(w, null, [l, x]);
241
241
  });
242
242
  function ae() {
243
- const e = Y.value?.getCachedList();
243
+ const e = P.value?.getCachedList();
244
244
  F(e);
245
245
  }
246
- return Q({
246
+ return X({
247
247
  apForm: _(() => a(v)),
248
248
  getSorterItems: () => b.value,
249
249
  setSorterItems: F,
@@ -39,15 +39,15 @@ const Ke = /* @__PURE__ */ $({
39
39
  setup(F, {
40
40
  expose: N
41
41
  }) {
42
- const s = F, _ = te("viewCacheOption"), {
42
+ const o = F, _ = te("viewCacheOption"), {
43
43
  b: V
44
44
  } = ae("ap-view"), {
45
- t: O
45
+ t: I
46
46
  } = ie(), d = C(() => ({
47
47
  viewKey: u,
48
- viewName: O("ap.apView.systemView")
48
+ viewName: I("ap.apView.systemView")
49
49
  })), {
50
- getSearchFormValues: I,
50
+ getSearchFormValues: O,
51
51
  setSearchFormValues: L,
52
52
  submit: x,
53
53
  reset: B,
@@ -55,20 +55,20 @@ const Ke = /* @__PURE__ */ $({
55
55
  getSearchFormSorterItems: k,
56
56
  setSearchFormSorterItems: A,
57
57
  resetSearchFormSorterItems: P
58
- } = Z(), T = p(!1), S = p(!1), v = p("");
58
+ } = Z(), T = p(!1), S = p(!1), w = p("");
59
59
  let c = !1, b = !1;
60
60
  const W = {
61
61
  dropdownType: "dropdown",
62
62
  content: K(se, {
63
- maxViewNum: s.maxViewNum
63
+ maxViewNum: o.maxViewNum
64
64
  }, null)
65
- }, a = p([d.value]), j = C(() => a.value.map((e) => ({
66
- id: e.viewKey,
65
+ }, i = p([d.value]), j = C(() => i.value.map((t) => ({
66
+ id: t.viewKey,
67
67
  content: K(oe, {
68
- view: e
68
+ view: t
69
69
  }, null)
70
- }))), o = {
71
- getSearchFormValues: I,
70
+ }))), r = {
71
+ getSearchFormValues: O,
72
72
  setSearchFormValues: L,
73
73
  submit: x,
74
74
  reset: B,
@@ -76,112 +76,112 @@ const Ke = /* @__PURE__ */ $({
76
76
  getSearchFormSorterItems: k,
77
77
  setSearchFormSorterItems: A,
78
78
  resetSearchFormSorterItems: P,
79
- ...s.saveDataSource
80
- }, w = {
79
+ ...o.saveDataSource
80
+ }, v = {
81
81
  ..._.value,
82
- ...s.viewCacheOption
83
- }, g = () => s.isDefaultSystemView ? u : (s.isFirstDefaultSystemView || b) && c ? u : a.value.find((i) => i.isDefault)?.viewKey ?? u, n = (e) => {
84
- v.value = e;
85
- const i = a.value.find((t) => t.viewKey === v.value);
86
- i && setTimeout(() => {
87
- i.viewKey === u ? c ? s.manual || o?.submitWith?.() : (o?.resetSearchFormSorterItems?.(), s.manual || o?.reset?.()) : (o?.setSearchFormValues?.({
88
- ...Object.fromEntries(Object.keys(o?.getSearchFormValues?.() ?? {}).map((t) => [t, void 0])) ?? {},
89
- ...i.viewConfig?.searchForm ?? {}
90
- }), o?.setSearchFormSorterItems?.(i.viewConfig?.sorterItems ?? []), c ? s.manual || o?.submitWith?.() : o?.submit?.()), c = !1;
82
+ ...o.viewCacheOption
83
+ }, g = () => o.isDefaultSystemView ? u : (o.isFirstDefaultSystemView || b) && c ? u : i.value.find((a) => a.isDefault)?.viewKey ?? u, l = (t) => {
84
+ w.value = t;
85
+ const a = i.value.find((e) => e.viewKey === w.value);
86
+ a && setTimeout(() => {
87
+ a.viewKey === u ? c ? o.manual || r?.submitWith?.() : o.manual || (r?.resetSearchFormSorterItems?.(), r?.reset?.()) : (r?.setSearchFormValues?.({
88
+ ...Object.fromEntries(Object.keys(r?.getSearchFormValues?.() ?? {}).map((e) => [e, void 0])) ?? {},
89
+ ...r?.getSearchFormSorterItems?.()?.reduce((e, s) => (a.viewConfig?.searchForm?.[s.name] && (e[s.name] = a.viewConfig?.searchForm?.[s.name]), e), {}) ?? {}
90
+ }), r?.setSearchFormSorterItems?.(a.viewConfig?.sorterItems ?? []), c ? o.manual || r?.submitWith?.() : r?.submit?.()), c = !1;
91
91
  });
92
92
  }, D = {
93
- getViewList: async (e) => {
93
+ getViewList: async (t) => {
94
94
  try {
95
95
  const {
96
- tableKey: i
97
- } = e, t = await w?.getViewList?.({
98
- tableKey: i
96
+ tableKey: a
97
+ } = t, e = await v?.getViewList?.({
98
+ tableKey: a
99
99
  });
100
- return a.value = [d.value, ...t ?? []], n(g()), a.value;
100
+ return i.value = [d.value, ...e ?? []], l(g()), i.value;
101
101
  } catch {
102
- return a.value = [d.value], n(u), a.value;
102
+ return i.value = [d.value], l(u), i.value;
103
103
  }
104
104
  },
105
- addView: async (e) => {
105
+ addView: async (t) => {
106
106
  const {
107
- tableKey: i,
108
- viewKey: t,
109
- viewName: r,
110
- isDefault: l,
107
+ tableKey: a,
108
+ viewKey: e,
109
+ viewName: s,
110
+ isDefault: n,
111
111
  viewConfig: f
112
- } = e;
113
- await w?.addView?.({
114
- tableKey: i,
115
- viewKey: t,
116
- viewName: r,
117
- isDefault: l,
112
+ } = t;
113
+ await v?.addView?.({
114
+ tableKey: a,
115
+ viewKey: e,
116
+ viewName: s,
117
+ isDefault: n,
118
118
  viewConfig: f
119
- }), l && (a.value = a.value.map((m) => ({
119
+ }), n && (i.value = i.value.map((m) => ({
120
120
  ...m,
121
121
  isDefault: !1
122
- }))), a.value = [...a.value, {
123
- viewKey: t,
124
- viewName: r,
125
- isDefault: l,
122
+ }))), i.value = [...i.value, {
123
+ viewKey: e,
124
+ viewName: s,
125
+ isDefault: n,
126
126
  viewConfig: f
127
- }], n(t);
127
+ }], l(e);
128
128
  },
129
- changeView: async (e) => {
129
+ changeView: async (t) => {
130
130
  const {
131
- tableKey: i,
132
- viewKey: t,
133
- viewName: r,
134
- isDefault: l,
131
+ tableKey: a,
132
+ viewKey: e,
133
+ viewName: s,
134
+ isDefault: n,
135
135
  viewConfig: f
136
- } = e;
137
- await w?.changeView?.({
138
- tableKey: i,
139
- viewKey: t,
140
- viewName: r,
141
- isDefault: l,
136
+ } = t;
137
+ await v?.changeView?.({
138
+ tableKey: a,
139
+ viewKey: e,
140
+ viewName: s,
141
+ isDefault: n,
142
142
  viewConfig: f
143
- }), l && (a.value = a.value.map((h) => ({
143
+ }), n && (i.value = i.value.map((h) => ({
144
144
  ...h,
145
145
  isDefault: !1
146
146
  })));
147
- const m = a.value.find((h) => h.viewKey === t);
148
- m && (m.viewName = r, m.isDefault = l, m.viewConfig = f), n(t);
147
+ const m = i.value.find((h) => h.viewKey === e);
148
+ m && (m.viewName = s, m.isDefault = n, m.viewConfig = f), l(e);
149
149
  },
150
- removeView: async (e) => {
150
+ removeView: async (t) => {
151
151
  const {
152
- tableKey: i,
153
- viewKey: t
154
- } = e;
155
- await w?.removeView?.({
156
- tableKey: i,
157
- viewKey: t
158
- }), a.value = a.value.filter((r) => r.viewKey !== t), t === v.value && n(g());
152
+ tableKey: a,
153
+ viewKey: e
154
+ } = t;
155
+ await v?.removeView?.({
156
+ tableKey: a,
157
+ viewKey: e
158
+ }), i.value = i.value.filter((s) => s.viewKey !== e), e === w.value && l(g());
159
159
  }
160
160
  }, G = {
161
- tableKey: s.tableKey,
162
- currentViewKey: v,
163
- changeCurrentViewKey: n,
161
+ tableKey: o.tableKey,
162
+ currentViewKey: w,
163
+ changeCurrentViewKey: l,
164
164
  popoverOpen: T,
165
165
  menuOpen: S,
166
- viewList: a,
166
+ viewList: i,
167
167
  viewListCRUD: D,
168
- saveDataSource: o
168
+ saveDataSource: r
169
169
  };
170
- return X(G), U(() => s.tableKey, (e) => {
171
- ee(e) && (c = !0, D?.getViewList?.({
172
- tableKey: e
170
+ return X(G), U(() => o.tableKey, (t) => {
171
+ ee(t) && (c = !0, D?.getViewList?.({
172
+ tableKey: t
173
173
  }));
174
174
  }, {
175
175
  immediate: !0
176
176
  }), N({
177
- setFirstDefaultSystemView: (e) => {
178
- b = e;
177
+ setFirstDefaultSystemView: (t) => {
178
+ b = t;
179
179
  }
180
- }), (e, i) => (z(), Y(y(Q), M({
181
- ...e.$attrs
180
+ }), (t, a) => (z(), Y(y(Q), M({
181
+ ...t.$attrs
182
182
  }, {
183
183
  open: S.value,
184
- "onUpdate:open": i[0] || (i[0] = (t) => S.value = t),
184
+ "onUpdate:open": a[0] || (a[0] = (e) => S.value = e),
185
185
  class: [y(V)()],
186
186
  "button-props": W,
187
187
  "menu-list": j.value,
@@ -1,23 +1,31 @@
1
1
  import { ApFormSearchFormPopoverSorterItem } from '../../ap-form';
2
2
  import { Recordable } from '../../type';
3
3
  export interface SaveDataSource {
4
+ /** 获取表单数据 */
4
5
  getSearchFormValues?: (transform?: boolean) => (Partial<Recordable> & Recordable<any>) | undefined;
6
+ /** 设置表单数据 */
5
7
  setSearchFormValues?: (values: Partial<Recordable>) => void;
8
+ /** 提交 */
6
9
  submit?: () => void;
10
+ /** 表格submitWith,非表格则和submit传递一致函数即可 */
7
11
  submitWith?: () => void;
12
+ /** 重置 */
8
13
  reset?: () => void;
14
+ /** 获取表单排序 */
9
15
  getSearchFormSorterItems?: () => ApFormSearchFormPopoverSorterItem[];
16
+ /** 设置表单排序 */
10
17
  setSearchFormSorterItems?: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
18
+ /** 重置表单排序 */
11
19
  resetSearchFormSorterItems?: () => void;
12
- /**
13
- * 是否转换搜索表单,默认为 false
14
- */
20
+ /** 是否转换搜索表单,默认为 false */
15
21
  searchFormTransform?: boolean;
16
22
  }
17
23
  export interface ViewCacheOption {
24
+ /** 获取视图列表 */
18
25
  getViewList?: (option: {
19
26
  tableKey: string;
20
27
  }) => Promise<ViewListModel[]>;
28
+ /** 添加视图 */
21
29
  addView?: (option: {
22
30
  tableKey: string;
23
31
  viewName: string;
@@ -25,6 +33,7 @@ export interface ViewCacheOption {
25
33
  viewConfig?: Recordable;
26
34
  isDefault?: boolean;
27
35
  }) => Promise<void>;
36
+ /** 设置视图 */
28
37
  changeView?: (option: {
29
38
  tableKey: string;
30
39
  viewName: string;
@@ -32,6 +41,7 @@ export interface ViewCacheOption {
32
41
  viewConfig?: Recordable;
33
42
  isDefault?: boolean;
34
43
  }) => Promise<void>;
44
+ /** 删除视图 */
35
45
  removeView?: (option: {
36
46
  tableKey: string;
37
47
  viewKey: string;
@@ -1,2 +1,2 @@
1
- export declare function lockScrollable(): () => void;
1
+ export declare function lockScrollable(): (() => void) | undefined;
2
2
  export declare const getMaskZIndex: () => number;
@@ -1,21 +1,37 @@
1
- function o() {
2
- const t = `aplus-ui-locker-${Date.now()}`;
3
- let e = document.querySelector(`style#${t}`);
4
- return e || (e = document.createElement("style"), e.id = t, e.innerHTML = `
1
+ import { getScrollbarSize as i } from "../utils/index.mjs";
2
+ function d(o) {
3
+ if (!o || o.nodeType !== Node.ELEMENT_NODE)
4
+ return {
5
+ x: !1,
6
+ y: !1
7
+ };
8
+ const e = window.getComputedStyle(o), l = e.overflowX, t = e.overflowY, n = l === "scroll" || l === "auto", r = t === "scroll" || t === "auto", c = o.scrollWidth > o.clientWidth, s = o.scrollHeight > o.clientHeight;
9
+ return {
10
+ x: n && c,
11
+ y: r && s
12
+ };
13
+ }
14
+ function f() {
15
+ const o = `aplus-ui-locker-${Date.now()}`, { y: e } = d(document.body);
16
+ if (!e)
17
+ return;
18
+ const l = i();
19
+ let t = document.querySelector(`style#${o}`);
20
+ return t || (t = document.createElement("style"), t.id = o, t.innerHTML = `
5
21
  html body {
6
22
  overflow-y: hidden;
7
- width: calc(100% - 15px);
23
+ width: calc(100% - ${l || 15}px);
8
24
  }
9
- `, document.head.appendChild(e)), () => {
10
- e.remove();
25
+ `, document.head.appendChild(t)), () => {
26
+ t.remove();
11
27
  };
12
28
  }
13
- function n() {
14
- let t = 99;
15
- return () => ++t;
29
+ function a() {
30
+ let o = 99;
31
+ return () => ++o;
16
32
  }
17
- const r = n();
33
+ const y = a();
18
34
  export {
19
- r as getMaskZIndex,
20
- o as lockScrollable
35
+ y as getMaskZIndex,
36
+ f as lockScrollable
21
37
  };
@@ -1,2 +1,2 @@
1
- declare const _default: "6.30.0";
1
+ declare const _default: "6.30.1";
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
- const e = "6.30.0";
1
+ const e = "6.30.1";
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"),l=require("@aplus-frontend/antdv");require("../ap-form.vue.js");require("../item/index.vue2.js");const P=require("../item-group/helper.js");require("../../config-provider/index.js");const w=require("lodash-unified"),E=require("../../utils/index.js"),F=require("./utils.js");require("./components/popover-filter.vue.js");const Q=require("./hooks/use-count-per-row.js");require("./components/popover-sorter/index.vue.js");const X=require("./hooks/use-sorter.js"),Y=require("./hooks/use-collapse-input-count.js"),O=require("@fruits-chain/utils"),Z=require("../../config-provider/hooks/use-namespace.js"),ee=require("../../config-provider/hooks/use-locale.js"),D=require("../item/index.vue.js"),te=require("./components/popover-filter.vue2.js"),oe=require("./components/popover-sorter/index.vue2.js"),ne=require("../ap-form.vue2.js");function ae(d){return typeof d=="function"||Object.prototype.toString.call(d)==="[object Object]"&&!e.isVNode(d)}const r=100,le=e.defineComponent({name:"ApFormSearchForm",__name:"index",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onFieldsChange:{},onFinish:{},onFinishFailed:{},onValidate:{},variant:{},initialValues:{},onValuesChange:{},syncToUrl:{type:[Boolean,Function]},syncToUrlPriority:{type:Boolean},collapse:{type:Boolean,default:void 0},defaultCollapse:{type:Boolean,default:!0},"onUpdate:collapse":{},searchText:{},resetText:{},onReset:{},customReset:{type:Boolean,default:!1},extraInAction:{type:Boolean,default:!1},forceExpand:{type:Boolean,default:!1},countPerRow:{default:5},submitLoading:{type:Boolean},maxRows:{default:2},sortable:{type:Boolean,default:!0},resizeTarget:{},loadingDelay:{default:300}},setup(d,{expose:L}){const x=e.useSlots(),o=d,{b:p}=Z.useNamespace("ap-form-search-form"),{t:B}=ee.useLocale(),W=Q.useCountPerRow(o),g=e.ref(),j=e.ref();function R(){const t=g.value?.getFieldsValueTransformed(!0);F.execFunc(o.onSubmit,t)}function M(){o.customReset||g.value?.resetFields?.(),F.execFunc(o.onReset)}const U=t=>E.isDef(t)?(w.isArray(t)?t:[t]).join(""):Date.now();let b=[];const f=e.shallowRef(P.genRealChildren(x.default())),c=e.shallowRef(x.extra?.()),k=e.computed(()=>O.floorWith(r/e.unref(W),4)),{items:v,sorted:q,handleClickConfirm:C}=X.useSorter(f);e.watch(()=>x.default(),t=>{b=f.value,f.value=F.diffFormItem(b,P.genRealChildren(t)),q.value=!1}),e.watch(()=>x.extra?.(),t=>{c.value=t});function $(t){return O.floorWith(t*(r/24),4)}const n=e.computed(()=>{const t=f.value,i=[],a=[],h=[],s=e.unref(k);let y=0,N=0;const G=r*o.maxRows-s*(e.unref(c)&&!o.extraInAction?2:1);t.forEach(S=>{const A=Y.getTargetNode(S);if(!A)return;const u=A.props;if(w.isBoolean(u.hidden)?!!u.hidden:E.isDef(u.hidden))i.push(S);else{let _=u.span?$(u.span):s;const I={node:S,span:_,key:`ApFormSearchFormItem-${U(u.name)}-${u._signal}`},T=r-y%r;T<_&&(_+=T),y+=_,y>G?a.push(I):(N=y,h.push(I))}});const V=r-(N+s)%r,J=Math.ceil(N)%r<s,K=V<s?r:V;return{hideNode:e.createVNode(e.Fragment,null,[i]),nodes:h,collapseNodes:a,extraSpan:K,lastRowOnlyIncludeActionAndExtra:J}}),m=t=>`${t}%`,z=e.computed(()=>{let t;const i=n.value.collapseNodes.length||o.sortable&&f.value.length,a=e.createVNode(l.Col,{flex:m(e.unref(k)),key:"actionWrapper"},{default:()=>[e.createVNode(D.default,null,{default:()=>[e.createVNode(l.Flex,{wrap:"wrap",justify:n.value.lastRowOnlyIncludeActionAndExtra&&!(e.unref(c)&&o.extraInAction)?"flex-end":"space-between"},{default:()=>[e.createVNode(l.Flex,{gap:8,wrap:"wrap"},{default:()=>[i?e.createVNode("div",{class:p("column-setting-trigger-wrapper")},[n.value.collapseNodes.length?e.createVNode(te.default,{onSubmit:R,config:n.value.collapseNodes,submitLoading:o.submitLoading},null):null,o.sortable&&v.value.length?e.createVNode(oe.default,{ref:"sorterIns",items:v.value,onClickConfirm:C,sorted:q.value},null):null]):null,e.createVNode(l.Button,{type:"primary",onClick:R,loading:o.submitLoading?{delay:o.loadingDelay}:!1,htmlType:"submit",class:p("action-btn")},{default:()=>[o.searchText||B("ap.apForm.search.search")]}),e.createVNode(l.Button,{onClick:M,type:"text",class:[p("action-btn"),p("action-btn-reset")]},{default:()=>[o.resetText||B("ap.apForm.search.reset")]})]}),o.extraInAction?e.unref(c):null]})]})]}),h=!o.extraInAction&&e.unref(c)?e.createVNode(l.Col,{flex:m(n.value.extraSpan),key:"extraNode"},{default:()=>[e.createVNode(D.default,null,{default:()=>[e.createVNode(l.Flex,{justify:n.value.extraSpan===r||n.value.lastRowOnlyIncludeActionAndExtra?"start":"flex-end"},ae(t=e.unref(c))?t:{default:()=>[t]})]})]}):null,s=e.createVNode(l.Col,{flex:m(n.value.extraSpan)},null);return n.value.lastRowOnlyIncludeActionAndExtra?e.createVNode(e.Fragment,null,[h||s,a]):e.createVNode(e.Fragment,null,[a,h])});function H(){const t=j.value?.getCachedList();C(t)}return L({apForm:e.computed(()=>e.unref(g)),getSorterItems:()=>v.value,setSorterItems:C,resetSorterItems:H}),(t,i)=>(e.openBlock(),e.createBlock(ne.default,e.mergeProps({ref_key:"apForm",ref:g,class:e.unref(p)()},e.unref(w.omit)(o,["collapse","defaultCollapse","onUpdate:collapse","searchText","resetText","onSubmit","onReset","extraInAction","forceExpand","countPerRow"])),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value.hideNode))),e.createVNode(e.unref(l.Row),{gutter:8},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value.nodes,a=>(e.openBlock(),e.createBlock(e.unref(l.Col),{key:a.key,flex:m(a.span),style:e.normalizeStyle({maxWidth:m(a.span)})},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.node)))]),_:2},1032,["flex","style"]))),128)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(z.value)))]),_:1})]),_:1},16,["class"]))}});exports.default=le;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("@aplus-frontend/antdv");require("../ap-form.vue.js");require("../item/index.vue2.js");const E=require("../item-group/helper.js");require("../../config-provider/index.js");const w=require("lodash-unified"),O=require("../../utils/index.js"),F=require("./utils.js");require("./components/popover-filter.vue.js");const Q=require("./hooks/use-count-per-row.js");require("./components/popover-sorter/index.vue.js");const X=require("./hooks/use-sorter.js"),Y=require("./hooks/use-collapse-input-count.js"),D=require("@fruits-chain/utils"),Z=require("../../config-provider/hooks/use-namespace.js"),ee=require("../../config-provider/hooks/use-locale.js"),L=require("../item/index.vue.js"),te=require("./components/popover-filter.vue2.js"),oe=require("./components/popover-sorter/index.vue2.js"),ne=require("../ap-form.vue2.js");function ae(d){return typeof d=="function"||Object.prototype.toString.call(d)==="[object Object]"&&!e.isVNode(d)}const r=100,le=e.defineComponent({name:"ApFormSearchForm",__name:"index",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onFieldsChange:{},onFinish:{},onFinishFailed:{},onValidate:{},variant:{},initialValues:{},onValuesChange:{},syncToUrl:{type:[Boolean,Function]},syncToUrlPriority:{type:Boolean},collapse:{type:Boolean,default:void 0},defaultCollapse:{type:Boolean,default:!0},"onUpdate:collapse":{},searchText:{},resetText:{},onReset:{},customReset:{type:Boolean,default:!1},extraInAction:{type:Boolean,default:!1},forceExpand:{type:Boolean,default:!1},countPerRow:{default:5},submitLoading:{type:Boolean},maxRows:{default:2},sortable:{type:Boolean,default:!0},resizeTarget:{},loadingDelay:{default:300}},setup(d,{expose:W}){const x=e.useSlots(),o=d,{b:p}=Z.useNamespace("ap-form-search-form"),{t:B}=ee.useLocale(),j=Q.useCountPerRow(o),g=e.ref(),R=e.ref();function b(){const t=g.value?.getFieldsValueTransformed(!0);F.execFunc(o.onSubmit,t)}function M(){o.customReset||g.value?.resetFields?.(),F.execFunc(o.onReset)}const U=t=>O.isDef(t)?(w.isArray(t)?t:[t]).join(""):Date.now();let k=[];const f=e.shallowRef(E.genRealChildren(x.default())),c=e.shallowRef(x.extra?.()),q=e.computed(()=>D.floorWith(r/e.unref(j),4)),{items:v,sorted:V,handleClickConfirm:C}=X.useSorter(f);e.watch(()=>x.default(),t=>{k=f.value,f.value=F.diffFormItem(k,E.genRealChildren(t)),V.value=!1}),e.watch(()=>x.extra?.(),t=>{c.value=t});function $(t){return D.floorWith(t*(r/24),4)}const n=e.computed(()=>{const t=f.value,i=[],a=[],h=[],s=e.unref(q);let y=0,N=0;const G=r*o.maxRows-s*(e.unref(c)&&!o.extraInAction?2:1);t.forEach(S=>{const I=Y.getTargetNode(S);if(!I)return;const u=I.props;if(w.isBoolean(u.hidden)?!!u.hidden:O.isDef(u.hidden))i.push(S);else{let _=u.span?$(u.span):s;const T={node:S,span:_,key:`ApFormSearchFormItem-${U(u.name)}-${u._signal}`},P=r-y%r;P<_&&(_+=P),y+=_,y>G?a.push(T):(N=y,h.push(T))}});const A=r-(N+s)%r,J=Math.ceil(N)%r<s,K=A<s?r:A;return{hideNode:e.createVNode(e.Fragment,null,[i]),nodes:h,collapseNodes:a,extraSpan:K,lastRowOnlyIncludeActionAndExtra:J}}),m=t=>`${t}%`,z=e.computed(()=>{let t;const i=n.value.collapseNodes.length||o.sortable&&f.value.length,a=e.createVNode(l.Col,{flex:m(e.unref(q)),key:"actionWrapper"},{default:()=>[e.createVNode(L.default,null,{default:()=>[e.createVNode(l.Flex,{wrap:"wrap",justify:n.value.lastRowOnlyIncludeActionAndExtra&&!(e.unref(c)&&o.extraInAction)?"flex-end":"space-between"},{default:()=>[e.createVNode(l.Flex,{gap:8,wrap:"wrap"},{default:()=>[i?e.createVNode("div",{class:p("column-setting-trigger-wrapper")},[n.value.collapseNodes.length?e.createVNode(te.default,{onSubmit:b,config:n.value.collapseNodes,submitLoading:o.submitLoading},null):null,o.sortable&&v.value.length?e.createVNode(oe.default,{ref:R,items:v.value,onClickConfirm:C,sorted:V.value},null):null]):null,e.createVNode(l.Button,{type:"primary",onClick:b,loading:o.submitLoading?{delay:o.loadingDelay}:!1,htmlType:"submit",class:p("action-btn")},{default:()=>[o.searchText||B("ap.apForm.search.search")]}),e.createVNode(l.Button,{onClick:M,type:"text",class:[p("action-btn"),p("action-btn-reset")]},{default:()=>[o.resetText||B("ap.apForm.search.reset")]})]}),o.extraInAction?e.unref(c):null]})]})]}),h=!o.extraInAction&&e.unref(c)?e.createVNode(l.Col,{flex:m(n.value.extraSpan),key:"extraNode"},{default:()=>[e.createVNode(L.default,null,{default:()=>[e.createVNode(l.Flex,{justify:n.value.extraSpan===r||n.value.lastRowOnlyIncludeActionAndExtra?"start":"flex-end"},ae(t=e.unref(c))?t:{default:()=>[t]})]})]}):null,s=e.createVNode(l.Col,{flex:m(n.value.extraSpan)},null);return n.value.lastRowOnlyIncludeActionAndExtra?e.createVNode(e.Fragment,null,[h||s,a]):e.createVNode(e.Fragment,null,[a,h])});function H(){const t=R.value?.getCachedList();C(t)}return W({apForm:e.computed(()=>e.unref(g)),getSorterItems:()=>v.value,setSorterItems:C,resetSorterItems:H}),(t,i)=>(e.openBlock(),e.createBlock(ne.default,e.mergeProps({ref_key:"apForm",ref:g,class:e.unref(p)()},e.unref(w.omit)(o,["collapse","defaultCollapse","onUpdate:collapse","searchText","resetText","onSubmit","onReset","extraInAction","forceExpand","countPerRow"])),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value.hideNode))),e.createVNode(e.unref(l.Row),{gutter:8},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value.nodes,a=>(e.openBlock(),e.createBlock(e.unref(l.Col),{key:a.key,flex:m(a.span),style:e.normalizeStyle({maxWidth:m(a.span)})},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.node)))]),_:2},1032,["flex","style"]))),128)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(z.value)))]),_:1})]),_:1},16,["class"]))}});exports.default=le;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../config-provider/index.js");const B=require("./icons/line-down.vue.js"),P=require("../ap-batch-action-group/index.js");require("./components/main-button-content.vue.js");require("./components/menu-list-content.vue.js");const j=require("./hooks/use-view-provide.js"),k=require("../../ap-table/context.js"),m=require("./utils/enum.js"),A=require("@aplus-frontend/utils"),G=require("../../config-provider/hooks/use-global-config.js"),U=require("../../config-provider/hooks/use-namespace.js"),z=require("../../config-provider/hooks/use-locale.js"),R=require("./components/main-button-content.vue2.js"),$=require("./components/menu-list-content.vue2.js"),H=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}},setup(g,{expose:h}){const r=g,E=G.useGlobalConfig("viewCacheOption"),{b:y}=U.useNamespace("ap-view"),{t:C}=z.useLocale(),d=e.computed(()=>({viewKey:m.SYSTEM_VIEW_KEY,viewName:C("ap.apView.systemView")})),{getSearchFormValues:D,setSearchFormValues:q,submit:F,reset:I,submitWith:N,getSearchFormSorterItems:Y,setSearchFormSorterItems:O,resetSearchFormSorterItems:T}=k.useInjectApTable(),L=e.ref(!1),V=e.ref(!1),w=e.ref("");let v=!1,_=!1;const W={dropdownType:"dropdown",content:e.createVNode(R.default,{maxViewNum:r.maxViewNum},null)},i=e.ref([d.value]),M=e.computed(()=>i.value.map(t=>({id:t.viewKey,content:e.createVNode($.default,{view:t},null)}))),o={getSearchFormValues:D,setSearchFormValues:q,submit:F,reset:I,submitWith:N,getSearchFormSorterItems:Y,setSearchFormSorterItems:O,resetSearchFormSorterItems:T,...r.saveDataSource},p={...E.value,...r.viewCacheOption},K=()=>r.isDefaultSystemView||(r.isFirstDefaultSystemView||_)&&v?m.SYSTEM_VIEW_KEY:i.value.find(s=>s.isDefault)?.viewKey??m.SYSTEM_VIEW_KEY,l=t=>{w.value=t;const s=i.value.find(a=>a.viewKey===w.value);s&&setTimeout(()=>{s.viewKey===m.SYSTEM_VIEW_KEY?v?r.manual||o?.submitWith?.():(o?.resetSearchFormSorterItems?.(),r.manual||o?.reset?.()):(o?.setSearchFormValues?.({...Object.fromEntries(Object.keys(o?.getSearchFormValues?.()??{}).map(a=>[a,void 0]))??{},...s.viewConfig?.searchForm??{}}),o?.setSearchFormSorterItems?.(s.viewConfig?.sorterItems??[]),v?r.manual||o?.submitWith?.():o?.submit?.()),v=!1})},b={getViewList:async t=>{try{const{tableKey:s}=t,a=await p?.getViewList?.({tableKey:s});return i.value=[d.value,...a??[]],l(K()),i.value}catch{return i.value=[d.value],l(m.SYSTEM_VIEW_KEY),i.value}},addView:async t=>{const{tableKey:s,viewKey:a,viewName:u,isDefault:n,viewConfig:f}=t;await p?.addView?.({tableKey:s,viewKey:a,viewName:u,isDefault:n,viewConfig:f}),n&&(i.value=i.value.map(c=>({...c,isDefault:!1}))),i.value=[...i.value,{viewKey:a,viewName:u,isDefault:n,viewConfig:f}],l(a)},changeView:async t=>{const{tableKey:s,viewKey:a,viewName:u,isDefault:n,viewConfig:f}=t;await p?.changeView?.({tableKey:s,viewKey:a,viewName:u,isDefault:n,viewConfig:f}),n&&(i.value=i.value.map(S=>({...S,isDefault:!1})));const c=i.value.find(S=>S.viewKey===a);c&&(c.viewName=u,c.isDefault=n,c.viewConfig=f),l(a)},removeView:async t=>{const{tableKey:s,viewKey:a}=t;await p?.removeView?.({tableKey:s,viewKey:a}),i.value=i.value.filter(u=>u.viewKey!==a),a===w.value&&l(K())}},x={tableKey:r.tableKey,currentViewKey:w,changeCurrentViewKey:l,popoverOpen:L,menuOpen:V,viewList:i,viewListCRUD:b,saveDataSource:o};return j.useViewProvide(x),e.watch(()=>r.tableKey,t=>{A.isValid(t)&&(v=!0,b?.getViewList?.({tableKey:t}))},{immediate:!0}),h({setFirstDefaultSystemView:t=>{_=t}}),(t,s)=>(e.openBlock(),e.createBlock(e.unref(P.ApBatchActionGroup),e.mergeProps({...t.$attrs},{open:V.value,"onUpdate:open":s[0]||(s[0]=a=>V.value=a),class:[e.unref(y)()],"button-props":W,"menu-list":M.value,"overlay-class-name":[e.unref(y)("overlay")],trigger:"click",placement:"bottom"}),{icon:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass([e.unref(y)("icon")])},[e.createVNode(B.default)],2)]),_:1},16,["open","class","menu-list","overlay-class-name"]))}});exports.default=H;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue");require("../../config-provider/index.js");const B=require("./icons/line-down.vue.js"),P=require("../ap-batch-action-group/index.js");require("./components/main-button-content.vue.js");require("./components/menu-list-content.vue.js");const j=require("./hooks/use-view-provide.js"),k=require("../../ap-table/context.js"),m=require("./utils/enum.js"),A=require("@aplus-frontend/utils"),G=require("../../config-provider/hooks/use-global-config.js"),U=require("../../config-provider/hooks/use-namespace.js"),z=require("../../config-provider/hooks/use-locale.js"),R=require("./components/main-button-content.vue2.js"),$=require("./components/menu-list-content.vue2.js"),H=t.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}},setup(g,{expose:h}){const o=g,C=G.useGlobalConfig("viewCacheOption"),{b:y}=U.useNamespace("ap-view"),{t:E}=z.useLocale(),d=t.computed(()=>({viewKey:m.SYSTEM_VIEW_KEY,viewName:E("ap.apView.systemView")})),{getSearchFormValues:D,setSearchFormValues:F,submit:q,reset:I,submitWith:N,getSearchFormSorterItems:Y,setSearchFormSorterItems:O,resetSearchFormSorterItems:T}=k.useInjectApTable(),L=t.ref(!1),V=t.ref(!1),w=t.ref("");let v=!1,_=!1;const W={dropdownType:"dropdown",content:t.createVNode(R.default,{maxViewNum:o.maxViewNum},null)},s=t.ref([d.value]),M=t.computed(()=>s.value.map(a=>({id:a.viewKey,content:t.createVNode($.default,{view:a},null)}))),n={getSearchFormValues:D,setSearchFormValues:F,submit:q,reset:I,submitWith:N,getSearchFormSorterItems:Y,setSearchFormSorterItems:O,resetSearchFormSorterItems:T,...o.saveDataSource},p={...C.value,...o.viewCacheOption},K=()=>o.isDefaultSystemView||(o.isFirstDefaultSystemView||_)&&v?m.SYSTEM_VIEW_KEY:s.value.find(i=>i.isDefault)?.viewKey??m.SYSTEM_VIEW_KEY,l=a=>{w.value=a;const i=s.value.find(e=>e.viewKey===w.value);i&&setTimeout(()=>{i.viewKey===m.SYSTEM_VIEW_KEY?v?o.manual||n?.submitWith?.():o.manual||(n?.resetSearchFormSorterItems?.(),n?.reset?.()):(n?.setSearchFormValues?.({...Object.fromEntries(Object.keys(n?.getSearchFormValues?.()??{}).map(e=>[e,void 0]))??{},...n?.getSearchFormSorterItems?.()?.reduce((e,r)=>(i.viewConfig?.searchForm?.[r.name]&&(e[r.name]=i.viewConfig?.searchForm?.[r.name]),e),{})??{}}),n?.setSearchFormSorterItems?.(i.viewConfig?.sorterItems??[]),v?o.manual||n?.submitWith?.():n?.submit?.()),v=!1})},b={getViewList:async a=>{try{const{tableKey:i}=a,e=await p?.getViewList?.({tableKey:i});return s.value=[d.value,...e??[]],l(K()),s.value}catch{return s.value=[d.value],l(m.SYSTEM_VIEW_KEY),s.value}},addView:async a=>{const{tableKey:i,viewKey:e,viewName:r,isDefault:u,viewConfig:f}=a;await p?.addView?.({tableKey:i,viewKey:e,viewName:r,isDefault:u,viewConfig:f}),u&&(s.value=s.value.map(c=>({...c,isDefault:!1}))),s.value=[...s.value,{viewKey:e,viewName:r,isDefault:u,viewConfig:f}],l(e)},changeView:async a=>{const{tableKey:i,viewKey:e,viewName:r,isDefault:u,viewConfig:f}=a;await p?.changeView?.({tableKey:i,viewKey:e,viewName:r,isDefault:u,viewConfig:f}),u&&(s.value=s.value.map(S=>({...S,isDefault:!1})));const c=s.value.find(S=>S.viewKey===e);c&&(c.viewName=r,c.isDefault=u,c.viewConfig=f),l(e)},removeView:async a=>{const{tableKey:i,viewKey:e}=a;await p?.removeView?.({tableKey:i,viewKey:e}),s.value=s.value.filter(r=>r.viewKey!==e),e===w.value&&l(K())}},x={tableKey:o.tableKey,currentViewKey:w,changeCurrentViewKey:l,popoverOpen:L,menuOpen:V,viewList:s,viewListCRUD:b,saveDataSource:n};return j.useViewProvide(x),t.watch(()=>o.tableKey,a=>{A.isValid(a)&&(v=!0,b?.getViewList?.({tableKey:a}))},{immediate:!0}),h({setFirstDefaultSystemView:a=>{_=a}}),(a,i)=>(t.openBlock(),t.createBlock(t.unref(P.ApBatchActionGroup),t.mergeProps({...a.$attrs},{open:V.value,"onUpdate:open":i[0]||(i[0]=e=>V.value=e),class:[t.unref(y)()],"button-props":W,"menu-list":M.value,"overlay-class-name":[t.unref(y)("overlay")],trigger:"click",placement:"bottom"}),{icon:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass([t.unref(y)("icon")])},[t.createVNode(B.default)],2)]),_:1},16,["open","class","menu-list","overlay-class-name"]))}});exports.default=H;
@@ -1,23 +1,31 @@
1
1
  import { ApFormSearchFormPopoverSorterItem } from '../../ap-form';
2
2
  import { Recordable } from '../../type';
3
3
  export interface SaveDataSource {
4
+ /** 获取表单数据 */
4
5
  getSearchFormValues?: (transform?: boolean) => (Partial<Recordable> & Recordable<any>) | undefined;
6
+ /** 设置表单数据 */
5
7
  setSearchFormValues?: (values: Partial<Recordable>) => void;
8
+ /** 提交 */
6
9
  submit?: () => void;
10
+ /** 表格submitWith,非表格则和submit传递一致函数即可 */
7
11
  submitWith?: () => void;
12
+ /** 重置 */
8
13
  reset?: () => void;
14
+ /** 获取表单排序 */
9
15
  getSearchFormSorterItems?: () => ApFormSearchFormPopoverSorterItem[];
16
+ /** 设置表单排序 */
10
17
  setSearchFormSorterItems?: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
18
+ /** 重置表单排序 */
11
19
  resetSearchFormSorterItems?: () => void;
12
- /**
13
- * 是否转换搜索表单,默认为 false
14
- */
20
+ /** 是否转换搜索表单,默认为 false */
15
21
  searchFormTransform?: boolean;
16
22
  }
17
23
  export interface ViewCacheOption {
24
+ /** 获取视图列表 */
18
25
  getViewList?: (option: {
19
26
  tableKey: string;
20
27
  }) => Promise<ViewListModel[]>;
28
+ /** 添加视图 */
21
29
  addView?: (option: {
22
30
  tableKey: string;
23
31
  viewName: string;
@@ -25,6 +33,7 @@ export interface ViewCacheOption {
25
33
  viewConfig?: Recordable;
26
34
  isDefault?: boolean;
27
35
  }) => Promise<void>;
36
+ /** 设置视图 */
28
37
  changeView?: (option: {
29
38
  tableKey: string;
30
39
  viewName: string;
@@ -32,6 +41,7 @@ export interface ViewCacheOption {
32
41
  viewConfig?: Recordable;
33
42
  isDefault?: boolean;
34
43
  }) => Promise<void>;
44
+ /** 删除视图 */
35
45
  removeView?: (option: {
36
46
  tableKey: string;
37
47
  viewKey: string;
@@ -1,2 +1,2 @@
1
- export declare function lockScrollable(): () => void;
1
+ export declare function lockScrollable(): (() => void) | undefined;
2
2
  export declare const getMaskZIndex: () => number;
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(){const t=`aplus-ui-locker-${Date.now()}`;let e=document.querySelector(`style#${t}`);return e||(e=document.createElement("style"),e.id=t,e.innerHTML=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../utils/index.js");function d(o){if(!o||o.nodeType!==Node.ELEMENT_NODE)return{x:!1,y:!1};const t=window.getComputedStyle(o),l=t.overflowX,e=t.overflowY,n=l==="scroll"||l==="auto",c=e==="scroll"||e==="auto",r=o.scrollWidth>o.clientWidth,s=o.scrollHeight>o.clientHeight;return{x:n&&r,y:c&&s}}function a(){const o=`aplus-ui-locker-${Date.now()}`,{y:t}=d(document.body);if(!t)return;const l=i.getScrollbarSize();let e=document.querySelector(`style#${o}`);return e||(e=document.createElement("style"),e.id=o,e.innerHTML=`
2
2
  html body {
3
3
  overflow-y: hidden;
4
- width: calc(100% - 15px);
4
+ width: calc(100% - ${l||15}px);
5
5
  }
6
- `,document.head.appendChild(e)),()=>{e.remove()}}function l(){let t=99;return()=>++t}const o=l();exports.getMaskZIndex=o;exports.lockScrollable=n;
6
+ `,document.head.appendChild(e)),()=>{e.remove()}}function u(){let o=99;return()=>++o}const f=u();exports.getMaskZIndex=f;exports.lockScrollable=a;
@@ -1,2 +1,2 @@
1
- declare const _default: "6.30.0";
1
+ declare const _default: "6.30.1";
2
2
  export default _default;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.30.0";exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.30.1";exports.default=e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "6.30.0",
3
+ "version": "6.30.1",
4
4
  "main": "./lib/index.js",
5
5
  "type": "module",
6
6
  "files": [
@@ -262,9 +262,6 @@
262
262
  [data-aplus-ui-mode='aplus'] .ant-input-number .ant-input-number-input-wrap > input::placeholder {
263
263
  color: #abb7cc;
264
264
  }
265
- [data-aplus-ui-mode='aplus'] .ant-input-clear-icon {
266
- line-height: 18px;
267
- }
268
265
  [data-aplus-ui-mode='aplus'] .ant-tooltip div[role='tooltip'] {
269
266
  padding-block: 6px;
270
267
  }
@@ -542,9 +539,6 @@
542
539
  [data-aplus-ui-mode='admin'] .ant-input-number .ant-input-number-input-wrap > input::placeholder {
543
540
  color: #bfbfbf;
544
541
  }
545
- [data-aplus-ui-mode='admin'] .ant-input-clear-icon {
546
- line-height: 18px;
547
- }
548
542
  [data-aplus-ui-mode='admin'] .ant-drawer-right .ant-drawer-content-wrapper {
549
543
  box-shadow: -8px 2px 24px 0 rgba(51, 51, 51, 0.2);
550
544
  }
@@ -299,10 +299,6 @@
299
299
  .ant-input-number .ant-input-number-input-wrap > input::placeholder {
300
300
  color: #abb7cc;
301
301
  }
302
-
303
- .ant-input-clear-icon {
304
- line-height: 18px;
305
- }
306
302
  // Tooltip
307
303
  .ant-tooltip div[role='tooltip'] {
308
304
  padding-block: 6px;
@@ -624,10 +620,6 @@
624
620
  color: #bfbfbf;
625
621
  }
626
622
 
627
- .ant-input-clear-icon {
628
- line-height: 18px;
629
- }
630
-
631
623
  // Drawer
632
624
  .ant-drawer {
633
625
  &-right {
@@ -60,11 +60,7 @@
60
60
  transition: all 0.3s;
61
61
  transform: rotateZ(0deg);
62
62
  }
63
- .aplus-ap-expand-alert__alertContent {
64
- color: #182948;
65
- }
66
63
  .aplus-ap-expand-alert__prefix {
67
- color: #182948;
68
64
  display: inline-block;
69
65
  }
70
66
  .aplus-ap-expand-alert__showItem {
@@ -26,13 +26,14 @@
26
26
 
27
27
  }
28
28
 
29
- &__alertContent {
30
- color: #182948;
31
- }
29
+ // 此处颜色不写死,根据UIMode自动切换
30
+ // &__alertContent {
31
+ // color: #182948;
32
+ // }
32
33
 
33
- // 考虑多端样式
34
+ // 此处颜色不写死,根据UIMode自动切换
34
35
  &__prefix {
35
- color: #182948;
36
+ // color: #182948;
36
37
  display: inline-block;
37
38
  }
38
39
  &__text {
@@ -136,6 +136,10 @@
136
136
  align-items: center;
137
137
  color: var(--ap-text-color-3);
138
138
  }
139
+ .aplus-ap-view-menu-list-content .menu-list-content-action-delete svg {
140
+ outline: none;
141
+ box-shadow: none;
142
+ }
139
143
  .aplus-ap-view-menu-list-content .menu-list-content-edit {
140
144
  display: flex;
141
145
  align-items: center;
@@ -88,6 +88,10 @@
88
88
  display: flex;
89
89
  align-items: center;
90
90
  color: var(--ap-text-color-3);
91
+ svg {
92
+ outline: none;
93
+ box-shadow: none;
94
+ }
91
95
  }
92
96
  }
93
97
 
package/theme/index.css CHANGED
@@ -363,9 +363,6 @@
363
363
  [data-aplus-ui-mode='aplus'] .ant-input-number .ant-input-number-input-wrap > input::placeholder {
364
364
  color: #abb7cc;
365
365
  }
366
- [data-aplus-ui-mode='aplus'] .ant-input-clear-icon {
367
- line-height: 18px;
368
- }
369
366
  [data-aplus-ui-mode='aplus'] .ant-tooltip div[role='tooltip'] {
370
367
  padding-block: 6px;
371
368
  }
@@ -643,9 +640,6 @@
643
640
  [data-aplus-ui-mode='admin'] .ant-input-number .ant-input-number-input-wrap > input::placeholder {
644
641
  color: #bfbfbf;
645
642
  }
646
- [data-aplus-ui-mode='admin'] .ant-input-clear-icon {
647
- line-height: 18px;
648
- }
649
643
  [data-aplus-ui-mode='admin'] .ant-drawer-right .ant-drawer-content-wrapper {
650
644
  box-shadow: -8px 2px 24px 0 rgba(51, 51, 51, 0.2);
651
645
  }
@@ -1022,11 +1016,7 @@
1022
1016
  transition: all 0.3s;
1023
1017
  transform: rotateZ(0deg);
1024
1018
  }
1025
- .aplus-ap-expand-alert__alertContent {
1026
- color: #182948;
1027
- }
1028
1019
  .aplus-ap-expand-alert__prefix {
1029
- color: #182948;
1030
1020
  display: inline-block;
1031
1021
  }
1032
1022
  .aplus-ap-expand-alert__showItem {
@@ -4087,6 +4077,10 @@ div.aplus-ap-info-layout-admin__header-shadow.aplus-ap-info-layout-admin__sticky
4087
4077
  align-items: center;
4088
4078
  color: var(--ap-text-color-3);
4089
4079
  }
4080
+ .aplus-ap-view-menu-list-content .menu-list-content-action-delete svg {
4081
+ outline: none;
4082
+ box-shadow: none;
4083
+ }
4090
4084
  .aplus-ap-view-menu-list-content .menu-list-content-edit {
4091
4085
  display: flex;
4092
4086
  align-items: center;