@aplus-frontend/ui 0.6.4 → 0.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/es/src/ap-form/interface.d.ts +23 -3
  2. package/es/src/ap-form/item-group/index.vue.mjs +33 -27
  3. package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
  4. package/es/src/ap-form/items/text/password.vue.d.ts +2 -2
  5. package/es/src/ap-form/search-form/components/popover-sorter/index.vue.d.ts +4 -2
  6. package/es/src/ap-form/search-form/components/popover-sorter/index.vue2.mjs +70 -72
  7. package/es/src/ap-form/search-form/components/popover-sorter/sortable-item.vue.d.ts +3 -2
  8. package/es/src/ap-form/search-form/components/popover-sorter/sortable-item.vue2.mjs +16 -24
  9. package/es/src/ap-form/search-form/hooks/use-sorter.d.ts +7 -0
  10. package/es/src/ap-form/search-form/hooks/use-sorter.mjs +45 -0
  11. package/es/src/ap-form/search-form/index.vue.d.ts +6 -3
  12. package/es/src/ap-form/search-form/index.vue.mjs +101 -91
  13. package/es/src/ap-grid/index.vue.mjs +219 -201
  14. package/es/src/ap-grid/interface.d.ts +17 -1
  15. package/es/src/ap-table/ap-table.vue.d.ts +4 -0
  16. package/es/src/ap-table/ap-table.vue2.mjs +223 -205
  17. package/es/src/ap-table/constants.d.ts +2 -2
  18. package/es/src/ap-table/context.d.ts +4 -0
  19. package/es/src/ap-table/context.mjs +21 -21
  20. package/es/src/ap-table/interface.d.ts +17 -1
  21. package/es/src/ap-table/utils.d.ts +2 -2
  22. package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +4 -0
  23. package/es/src/business/ap-table-modal/hooks/use-table-modal.d.ts +4 -0
  24. package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +4 -0
  25. package/es/src/business/ap-table-modal/index.d.ts +13 -0
  26. package/es/src/business/ap-table-modal/table-modal.vue.d.ts +7 -0
  27. package/es/src/business/ap-view/ap-view.vue2.mjs +107 -109
  28. package/es/src/business/ap-view/components/main-button-content.vue2.mjs +72 -71
  29. package/es/src/business/ap-view/interface.d.ts +4 -0
  30. package/es/src/business/batch-input-group/index.vue.d.ts +1 -1
  31. package/es/src/business/hooks/usePageListApTable.d.ts +4 -0
  32. package/es/src/version.d.ts +1 -1
  33. package/es/src/version.mjs +1 -1
  34. package/lib/src/ap-form/interface.d.ts +23 -3
  35. package/lib/src/ap-form/item-group/index.vue.js +1 -1
  36. package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
  37. package/lib/src/ap-form/items/text/password.vue.d.ts +2 -2
  38. package/lib/src/ap-form/search-form/components/popover-sorter/index.vue.d.ts +4 -2
  39. package/lib/src/ap-form/search-form/components/popover-sorter/index.vue2.js +1 -1
  40. package/lib/src/ap-form/search-form/components/popover-sorter/sortable-item.vue.d.ts +3 -2
  41. package/lib/src/ap-form/search-form/components/popover-sorter/sortable-item.vue2.js +1 -1
  42. package/lib/src/ap-form/search-form/hooks/use-sorter.d.ts +7 -0
  43. package/lib/src/ap-form/search-form/hooks/use-sorter.js +1 -0
  44. package/lib/src/ap-form/search-form/index.vue.d.ts +6 -3
  45. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  46. package/lib/src/ap-grid/index.vue.js +1 -1
  47. package/lib/src/ap-grid/interface.d.ts +17 -1
  48. package/lib/src/ap-table/ap-table.vue.d.ts +4 -0
  49. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  50. package/lib/src/ap-table/constants.d.ts +2 -2
  51. package/lib/src/ap-table/context.d.ts +4 -0
  52. package/lib/src/ap-table/context.js +1 -1
  53. package/lib/src/ap-table/interface.d.ts +17 -1
  54. package/lib/src/ap-table/utils.d.ts +2 -2
  55. package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +4 -0
  56. package/lib/src/business/ap-table-modal/hooks/use-table-modal.d.ts +4 -0
  57. package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +4 -0
  58. package/lib/src/business/ap-table-modal/index.d.ts +13 -0
  59. package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +7 -0
  60. package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
  61. package/lib/src/business/ap-view/components/main-button-content.vue2.js +1 -1
  62. package/lib/src/business/ap-view/interface.d.ts +4 -0
  63. package/lib/src/business/batch-input-group/index.vue.d.ts +1 -1
  64. package/lib/src/business/hooks/usePageListApTable.d.ts +4 -0
  65. package/lib/src/version.d.ts +1 -1
  66. package/lib/src/version.js +1 -1
  67. package/package.json +1 -1
  68. package/theme/ap-grid/index.css +15 -0
  69. package/theme/ap-grid/index.less +14 -0
  70. package/theme/index.css +15 -0
@@ -176,17 +176,22 @@ export type ApFormSearchFormPopoverFilterProps = {
176
176
  onSubmit: () => void;
177
177
  submitLoading: boolean;
178
178
  };
179
+ export type ApFormSearchFormPopoverSorterItem = {
180
+ name: string;
181
+ label: string;
182
+ isHidden?: boolean;
183
+ };
179
184
  export type ApFormSearchFormPopoverSorterProps = {
180
185
  /**
181
- * 需要排序的全量节点
186
+ * 需要排序的节点对象
182
187
  */
183
- children: VNode[];
188
+ items: ApFormSearchFormPopoverSorterItem[];
184
189
  /**
185
190
  * 点击确定
186
191
  * @param sortedChildren
187
192
  * @returns
188
193
  */
189
- onClickConfirm: (sortedChildren: VNode[]) => void;
194
+ onClickConfirm: (sortedChildren: ApFormSearchFormPopoverSorterItem[]) => void;
190
195
  /**
191
196
  * 当前的children是否已经排序过了
192
197
  */
@@ -194,6 +199,21 @@ export type ApFormSearchFormPopoverSorterProps = {
194
199
  };
195
200
  export type ApFormSearchFormExpose = {
196
201
  apForm: ApFormExpose;
202
+ /**
203
+ * 获取排序结果
204
+ * @returns
205
+ */
206
+ getSorterItems: () => ApFormSearchFormPopoverSorterItem[];
207
+ /**
208
+ * 设置排序结果
209
+ * @param sortedItems
210
+ * @returns
211
+ */
212
+ setSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
213
+ /**
214
+ * 重设查询表单排序
215
+ */
216
+ resetSorterItems: () => void;
197
217
  };
198
218
  export type ApFormSubmitterConfig = {
199
219
  submitText?: string;
@@ -1,15 +1,15 @@
1
- import { isVNode as C, defineComponent as _, useSlots as k, unref as r, createVNode as w, mergeProps as u, createBlock as l, openBlock as i, withCtx as P, createElementBlock as R, Fragment as S, renderList as b, resolveDynamicComponent as h } from "vue";
2
- import { Col as x, Row as B } from "@aplus-frontend/antdv";
3
- import { pick as N, isBoolean as j, omit as F } from "lodash-unified";
4
- import { apFormItemColPropKeys as D } from "../constant.mjs";
5
- import { genRealChildren as I, buildColSpan as O, getStringName as V } from "./helper.mjs";
1
+ import { isVNode as _, defineComponent as k, useSlots as w, ref as h, onBeforeUpdate as B, watch as N, unref as a, createVNode as P, mergeProps as d, createBlock as f, openBlock as p, withCtx as R, createElementBlock as S, Fragment as b, renderList as x, resolveDynamicComponent as j } from "vue";
2
+ import { Col as v, Row as F } from "@aplus-frontend/antdv";
3
+ import { pick as D, isBoolean as I, omit as O } from "lodash-unified";
4
+ import { apFormItemColPropKeys as V } from "../constant.mjs";
5
+ import { genRealChildren as $, buildColSpan as A, getStringName as E } from "./helper.mjs";
6
6
  import "../../config-provider/index.mjs";
7
- import { isDef as $ } from "../../utils/index.mjs";
8
- import { useNamespace as v } from "../../config-provider/hooks/use-namespace.mjs";
9
- function A(o) {
10
- return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !C(o);
7
+ import { isDef as G } from "../../utils/index.mjs";
8
+ import { useNamespace as H } from "../../config-provider/hooks/use-namespace.mjs";
9
+ function K(o) {
10
+ return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !_(o);
11
11
  }
12
- const M = /* @__PURE__ */ _({
12
+ const W = /* @__PURE__ */ k({
13
13
  name: "ApFormItemGroup",
14
14
  __name: "index",
15
15
  props: {
@@ -28,28 +28,34 @@ const M = /* @__PURE__ */ _({
28
28
  }
29
29
  },
30
30
  setup(o) {
31
- const m = o, p = k(), {
32
- b: s
33
- } = v("ap-form-item-group");
34
- function d() {
35
- var a;
36
- const c = I(((a = p.default) == null ? void 0 : a.call(p)) || []);
37
- return r(c).map((e, f) => {
38
- const t = e.props, n = N(t, D), g = n != null && n.span ? {} : O(m.countPerRow), y = j(t.hidden) ? !!t.hidden : $(t.hidden);
31
+ const i = o, m = w(), {
32
+ b: c
33
+ } = H("ap-form-item-group"), s = h([]);
34
+ B(() => {
35
+ s.value = u(m.default());
36
+ }), N(() => m.default(), (r) => {
37
+ s.value = u(r);
38
+ }, {
39
+ immediate: !0
40
+ });
41
+ function u(r) {
42
+ const l = $(r || []);
43
+ return a(l).map((e, g) => {
44
+ const t = e.props, n = D(t, V), y = n != null && n.span ? {} : A(i.countPerRow), C = I(t.hidden) ? !!t.hidden : G(t.hidden);
39
45
  return {
40
- key: `${f}-${V(t.name)}`,
41
- node: w(x, u(g, n, {
42
- class: y ? s("col-hidden") : ""
43
- }), A(e) ? e : {
46
+ key: `${g}-${E(t.name)}`,
47
+ node: P(v, d(y, n, {
48
+ class: C ? c("col-hidden") : ""
49
+ }), K(e) ? e : {
44
50
  default: () => [e]
45
51
  })
46
52
  };
47
53
  });
48
54
  }
49
- return (c, a) => (i(), l(r(B), u({
50
- class: r(s)()
51
- }, r(F)(m, ["countPerRow"])), {
52
- default: P(() => [(i(!0), R(S, null, b(d(), (e) => (i(), l(h(e.node), {
55
+ return (r, l) => (p(), f(a(F), d({
56
+ class: a(c)()
57
+ }, a(O)(i, ["countPerRow"])), {
58
+ default: R(() => [(p(!0), S(b, null, x(s.value, (e) => (p(), f(j(e.node), {
53
59
  key: e.key
54
60
  }))), 128))]),
55
61
  _: 1
@@ -57,5 +63,5 @@ const M = /* @__PURE__ */ _({
57
63
  }
58
64
  });
59
65
  export {
60
- M as default
66
+ W as default
61
67
  };
@@ -53,8 +53,8 @@ declare function __VLS_template(): {
53
53
  readonly bordered?: boolean | undefined;
54
54
  readonly suffix?: any;
55
55
  readonly focused?: boolean | undefined;
56
- readonly placeholder?: string | number | undefined;
57
56
  readonly handleReset?: MouseEventHandler | undefined;
57
+ readonly placeholder?: string | number | undefined;
58
58
  readonly defaultValue?: string | number | undefined;
59
59
  readonly id?: string | undefined;
60
60
  readonly autocomplete?: string | undefined;
@@ -209,8 +209,8 @@ declare const __VLS_component: DefineComponent<ApFormItemTextProps, {
209
209
  readonly bordered?: boolean | undefined;
210
210
  readonly suffix?: any;
211
211
  readonly focused?: boolean | undefined;
212
- readonly placeholder?: string | number | undefined;
213
212
  readonly handleReset?: MouseEventHandler | undefined;
213
+ readonly placeholder?: string | number | undefined;
214
214
  readonly defaultValue?: string | number | undefined;
215
215
  readonly id?: string | undefined;
216
216
  readonly autocomplete?: string | undefined;
@@ -54,8 +54,8 @@ declare function __VLS_template(): {
54
54
  readonly bordered?: boolean | undefined;
55
55
  readonly suffix?: any;
56
56
  readonly focused?: boolean | undefined;
57
- readonly placeholder?: string | number | undefined;
58
57
  readonly handleReset?: MouseEventHandler | undefined;
58
+ readonly placeholder?: string | number | undefined;
59
59
  readonly defaultValue?: string | number | undefined;
60
60
  readonly id?: string | undefined;
61
61
  readonly autocomplete?: string | undefined;
@@ -216,8 +216,8 @@ declare const __VLS_component: DefineComponent<ApFormItemTextPasswordProps, {
216
216
  readonly bordered?: boolean | undefined;
217
217
  readonly suffix?: any;
218
218
  readonly focused?: boolean | undefined;
219
- readonly placeholder?: string | number | undefined;
220
219
  readonly handleReset?: MouseEventHandler | undefined;
220
+ readonly placeholder?: string | number | undefined;
221
221
  readonly defaultValue?: string | number | undefined;
222
222
  readonly id?: string | undefined;
223
223
  readonly autocomplete?: string | undefined;
@@ -1,4 +1,6 @@
1
- import { ApFormSearchFormPopoverSorterProps } from '../../../interface';
1
+ import { ApFormSearchFormPopoverSorterItem, ApFormSearchFormPopoverSorterProps } from '../../../interface';
2
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
- declare const _default: DefineComponent<ApFormSearchFormPopoverSorterProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApFormSearchFormPopoverSorterProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
3
+ declare const _default: DefineComponent<ApFormSearchFormPopoverSorterProps, {
4
+ getCachedList: () => ApFormSearchFormPopoverSorterItem[];
5
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApFormSearchFormPopoverSorterProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
4
6
  export default _default;
@@ -1,49 +1,47 @@
1
- import { defineComponent as S, ref as C, watch as k, unref as e, createBlock as D, openBlock as P, withCtx as a, createVNode as o, normalizeClass as r, createElementVNode as s, toDisplayString as m, createTextVNode as b } from "vue";
2
- import { Popover as V, Tooltip as j, Button as h, Flex as _, Divider as z } from "@aplus-frontend/antdv";
3
- import { IconApLayoutOutlined as A } from "@aplus-frontend/icon";
1
+ import { defineComponent as D, ref as y, watch as k, unref as e, createBlock as L, openBlock as P, withCtx as r, createVNode as t, normalizeClass as o, createElementVNode as n, toDisplayString as m, createTextVNode as b } from "vue";
2
+ import { Popover as S, Tooltip as V, Button as g, Flex as _, Divider as j } from "@aplus-frontend/antdv";
3
+ import { IconApLayoutOutlined as z } from "@aplus-frontend/icon";
4
4
  import "../../../../config-provider/index.mjs";
5
- import I from "vuedraggable";
5
+ import A from "vuedraggable";
6
6
  import "./sortable-item.vue.mjs";
7
- import { getStringName as L } from "../../../item-group/helper.mjs";
8
7
  import { useNamespace as F } from "../../../../config-provider/hooks/use-namespace.mjs";
9
8
  import { useLocale as R } from "../../../../config-provider/hooks/use-locale.mjs";
10
9
  import $ from "./sortable-item.vue2.mjs";
11
- const W = /* @__PURE__ */ S({
10
+ const M = /* @__PURE__ */ D({
12
11
  name: "ApFormSearchFormPopoverSorter",
13
12
  __name: "index",
14
13
  props: {
15
- children: {},
14
+ items: {},
16
15
  onClickConfirm: { type: Function },
17
16
  sorted: { type: Boolean }
18
17
  },
19
- setup(w) {
20
- const l = w, c = C(l.children);
21
- let v = [...l.children], g = [...l.children];
18
+ setup(x, { expose: w }) {
19
+ const l = x, i = y(l.items);
20
+ let v = [...l.items], h = [...l.items];
22
21
  k(
23
- () => l.children,
24
- (t) => {
25
- l.sorted || (c.value = t, g = t, v = t);
22
+ () => l.items,
23
+ (a) => {
24
+ i.value = a, v = a, l.sorted || (h = a);
26
25
  }
27
26
  );
28
- const { e: f, b: y } = F("ap-form-search-form"), { b: n } = F("search-form-sorter"), { t: i } = R(), p = C(!1);
29
- function x(t) {
30
- return t.closest(".ant-form") || document.body;
27
+ const { e: f, b: C } = F("ap-form-search-form"), { b: s } = F("search-form-sorter"), { t: c } = R(), p = y(!1);
28
+ function B(a) {
29
+ return a.closest(".ant-form") || document.body;
31
30
  }
32
- function B() {
33
- p.value = !1, v = [...e(c)], l.onClickConfirm(e(c));
31
+ function T() {
32
+ p.value = !1, v = [...e(i)], l.onClickConfirm(e(i));
34
33
  }
35
34
  function N() {
36
- c.value = [...g];
37
- }
38
- function T(t) {
39
- return L(t.props.name);
35
+ i.value = [...h];
40
36
  }
41
37
  return k(
42
38
  () => p.value,
43
- (t) => {
44
- t && (c.value = [...v]);
39
+ (a) => {
40
+ a && (i.value = [...v]);
45
41
  }
46
- ), (t, u) => (P(), D(e(V), {
42
+ ), w({
43
+ getCachedList: () => h
44
+ }), (a, u) => (P(), L(e(S), {
47
45
  open: p.value,
48
46
  "onUpdate:open": u[1] || (u[1] = (d) => p.value = d),
49
47
  "overlay-class-name": e(f)("popover"),
@@ -51,70 +49,70 @@ const W = /* @__PURE__ */ S({
51
49
  placement: "bottom",
52
50
  mask: "",
53
51
  "mask-style": { backgroundColor: "transparent" },
54
- "get-popup-container": x
52
+ "get-popup-container": B
55
53
  }, {
56
- content: a(() => [
57
- s("div", {
58
- class: r(e(n)("header"))
54
+ content: r(() => [
55
+ n("div", {
56
+ class: o(e(s)("header"))
59
57
  }, [
60
- s("span", {
61
- class: r(e(n)("header-title"))
62
- }, m(e(i)("ap.apForm.search.sorterTitle")), 3),
63
- o(e(_), {
58
+ n("span", {
59
+ class: o(e(s)("header-title"))
60
+ }, m(e(c)("ap.apForm.search.sorterTitle")), 3),
61
+ t(e(_), {
64
62
  justify: "space-between",
65
63
  align: "center"
66
64
  }, {
67
- default: a(() => [
68
- s("span", {
69
- class: r(e(n)("header-desc"))
70
- }, m(e(i)("ap.apForm.search.sorterDesc")), 3),
71
- s("div", {
72
- class: r(e(n)("header-action-wrapper")),
65
+ default: r(() => [
66
+ n("span", {
67
+ class: o(e(s)("header-desc"))
68
+ }, m(e(c)("ap.apForm.search.sorterDesc")), 3),
69
+ n("div", {
70
+ class: o(e(s)("header-action-wrapper")),
73
71
  onClick: N
74
72
  }, [
75
- s("span", {
76
- class: r(e(n)("header-reset-btn"))
77
- }, m(e(i)("ap.apForm.search.sorterReset")), 3)
73
+ n("span", {
74
+ class: o(e(s)("header-reset-btn"))
75
+ }, m(e(c)("ap.apForm.search.sorterReset")), 3)
78
76
  ], 2)
79
77
  ]),
80
78
  _: 1
81
79
  })
82
80
  ], 2),
83
- s("div", {
84
- class: r([e(f)("popover-content"), e(n)("content")])
81
+ n("div", {
82
+ class: o([e(f)("popover-content"), e(s)("content")])
85
83
  }, [
86
- o(e(I), {
87
- list: c.value,
88
- class: r(e(n)("sorter-wrapper")),
89
- "item-key": T
84
+ t(e(A), {
85
+ list: i.value,
86
+ class: o(e(s)("sorter-wrapper")),
87
+ "item-key": "name"
90
88
  }, {
91
- item: a(({ element: d }) => [
92
- o($, { item: d }, null, 8, ["item"])
89
+ item: r(({ element: d }) => [
90
+ t($, { item: d }, null, 8, ["item"])
93
91
  ]),
94
92
  _: 1
95
93
  }, 8, ["list", "class"])
96
94
  ], 2),
97
- o(e(z), { style: { margin: "0" } }),
98
- s("div", {
99
- class: r(e(f)("popover-footer"))
95
+ t(e(j), { style: { margin: "0" } }),
96
+ n("div", {
97
+ class: o(e(f)("popover-footer"))
100
98
  }, [
101
- o(e(_), { justify: "end" }, {
102
- default: a(() => [
103
- o(e(h), {
99
+ t(e(_), { justify: "end" }, {
100
+ default: r(() => [
101
+ t(e(g), {
104
102
  onClick: u[0] || (u[0] = (d) => p.value = !1)
105
103
  }, {
106
- default: a(() => [
107
- b(m(e(i)("ap.common.cancelText")), 1)
104
+ default: r(() => [
105
+ b(m(e(c)("ap.common.cancelText")), 1)
108
106
  ]),
109
107
  _: 1
110
108
  }),
111
- o(e(h), {
112
- class: r(e(f)("popover-footer-confirm-btn")),
109
+ t(e(g), {
110
+ class: o(e(f)("popover-footer-confirm-btn")),
113
111
  type: "primary",
114
- onClick: B
112
+ onClick: T
115
113
  }, {
116
- default: a(() => [
117
- b(m(e(i)("ap.apForm.search.sorterConfirmBtn")), 1)
114
+ default: r(() => [
115
+ b(m(e(c)("ap.apForm.search.sorterConfirmBtn")), 1)
118
116
  ]),
119
117
  _: 1
120
118
  }, 8, ["class"])
@@ -123,17 +121,17 @@ const W = /* @__PURE__ */ S({
123
121
  })
124
122
  ], 2)
125
123
  ]),
126
- default: a(() => [
127
- o(e(j), {
128
- title: e(i)("ap.apForm.search.sorterTitle"),
124
+ default: r(() => [
125
+ t(e(V), {
126
+ title: e(c)("ap.apForm.search.sorterTitle"),
129
127
  placement: "top"
130
128
  }, {
131
- default: a(() => [
132
- o(e(h), {
133
- class: r([e(y)("trigger-btn"), { [e(y)("trigger-btn-active")]: p.value }])
129
+ default: r(() => [
130
+ t(e(g), {
131
+ class: o([e(C)("trigger-btn"), { [e(C)("trigger-btn-active")]: p.value }])
134
132
  }, {
135
- icon: a(() => [
136
- o(e(A), { size: 14 })
133
+ icon: r(() => [
134
+ t(e(z), { size: 14 })
137
135
  ]),
138
136
  _: 1
139
137
  }, 8, ["class"])
@@ -146,5 +144,5 @@ const W = /* @__PURE__ */ S({
146
144
  }
147
145
  });
148
146
  export {
149
- W as default
147
+ M as default
150
148
  };
@@ -1,6 +1,7 @@
1
- import { VNode, DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
1
+ import { ApFormSearchFormPopoverSorterItem } from '../../../interface';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
3
  type __VLS_Props = {
3
- item: VNode;
4
+ item: ApFormSearchFormPopoverSorterItem;
4
5
  };
5
6
  declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
6
7
  export default _default;
@@ -1,39 +1,31 @@
1
- import { defineComponent as c, computed as n, createElementBlock as a, openBlock as d, normalizeClass as r, unref as t, createElementVNode as l, createVNode as u, toDisplayString as f } from "vue";
2
- import { HolderOutlined as h } from "@ant-design/icons-vue";
1
+ import { defineComponent as i, createElementBlock as l, openBlock as m, normalizeClass as o, unref as e, createElementVNode as s, createVNode as a, toDisplayString as n } from "vue";
2
+ import { HolderOutlined as c } from "@ant-design/icons-vue";
3
3
  import "../../../../config-provider/index.mjs";
4
- import { isBoolean as _ } from "lodash-unified";
5
- import { isDef as v } from "@fruits-chain/utils";
6
- import { useNamespace as b } from "../../../../config-provider/hooks/use-namespace.mjs";
7
- const x = ["title"], C = /* @__PURE__ */ c({
4
+ import { useNamespace as p } from "../../../../config-provider/hooks/use-namespace.mjs";
5
+ const d = ["title"], N = /* @__PURE__ */ i({
8
6
  name: "ApFormSearchFormPopoverSorterItem",
9
7
  __name: "sortable-item",
10
8
  props: {
11
9
  item: {}
12
10
  },
13
- setup(m) {
14
- const s = m, i = n(() => {
15
- const e = s.item.props;
16
- return e.description || e.label || e.placeholder;
17
- }), p = n(() => {
18
- const e = s.item.props;
19
- return _(e.hidden) ? !!e.hidden : v(e.hidden);
20
- }), { b: o } = b("search-form-sorter");
21
- return (e, B) => (d(), a("div", {
22
- class: r([t(o)("sorter-item"), { [t(o)("sorter-item--hidden")]: p.value }])
11
+ setup(f) {
12
+ const { b: t } = p("search-form-sorter");
13
+ return (r, u) => (m(), l("div", {
14
+ class: o([e(t)("sorter-item"), { [e(t)("sorter-item--hidden")]: r.item.isHidden }])
23
15
  }, [
24
- l("div", null, [
25
- u(t(h), {
26
- class: r(t(o)("sorter-item-holder")),
16
+ s("div", null, [
17
+ a(e(c), {
18
+ class: o(e(t)("sorter-item-holder")),
27
19
  style: { "font-size": "16px", color: "#abb7cc" }
28
20
  }, null, 8, ["class"]),
29
- l("span", {
30
- class: r(t(o)("sorter-item-text")),
31
- title: i.value
32
- }, f(i.value), 11, x)
21
+ s("span", {
22
+ class: o(e(t)("sorter-item-text")),
23
+ title: r.item.label
24
+ }, n(r.item.label), 11, d)
33
25
  ])
34
26
  ], 2));
35
27
  }
36
28
  });
37
29
  export {
38
- C as default
30
+ N as default
39
31
  };
@@ -0,0 +1,7 @@
1
+ import { ShallowRef, VNode, ComputedRef, Ref } from 'vue';
2
+ import { ApFormSearchFormPopoverSorterItem } from '../../interface';
3
+ export declare const useSorter: (children: ShallowRef<VNode[]>) => {
4
+ items: ComputedRef<ApFormSearchFormPopoverSorterItem[]>;
5
+ handleClickConfirm: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
6
+ sorted: Ref<boolean, boolean>;
7
+ };
@@ -0,0 +1,45 @@
1
+ import { isBoolean as d } from "lodash-unified";
2
+ import { ref as f, computed as c } from "vue";
3
+ import { getStringName as p } from "../../item-group/helper.mjs";
4
+ import { isDef as u } from "../../../utils/index.mjs";
5
+ function l(s, r) {
6
+ var e;
7
+ const m = new Set(s.map((o) => o.name)), i = /* @__PURE__ */ new Map();
8
+ for (const o of r) {
9
+ const t = String(p((e = o.props) == null ? void 0 : e.name));
10
+ t && m.has(t) && i.set(t, o);
11
+ }
12
+ const a = /* @__PURE__ */ new Set(), n = [];
13
+ for (const o of s) {
14
+ const t = i.get(o.name);
15
+ t && (n.push(t), a.add(t));
16
+ }
17
+ for (const o of r)
18
+ a.has(o) || n.push(o);
19
+ return n;
20
+ }
21
+ const w = (s) => {
22
+ const r = f(!1), m = c(() => (s.value || []).map((n) => {
23
+ const e = n.props;
24
+ return {
25
+ label: e.description || e.label || e.placeholder,
26
+ name: p(e.name),
27
+ isHidden: d(e.hidden) ? !!e.hidden : u(e.hidden)
28
+ };
29
+ }));
30
+ function i(a) {
31
+ const n = l(
32
+ a || [],
33
+ s.value || []
34
+ );
35
+ r.value = !0, s.value = n;
36
+ }
37
+ return {
38
+ items: m,
39
+ handleClickConfirm: i,
40
+ sorted: r
41
+ };
42
+ };
43
+ export {
44
+ w as useSorter
45
+ };
@@ -1,5 +1,5 @@
1
1
  import { ApFormExpose, ApFormSearchFormProps } from '../interface';
2
- import { ComponentInternalInstance, ExtractPropTypes, PropType, HTMLAttributes, VNodeProps, AllowedComponentProps, ComponentCustomProps, CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, Slot, ComponentPublicInstance, ComponentOptionsBase, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, DefineComponent, ComputedRef } from 'vue';
2
+ import { ComponentInternalInstance, ExtractPropTypes, PropType, HTMLAttributes, VNodeProps, AllowedComponentProps, ComponentCustomProps, CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, Slot, ComponentPublicInstance, ComponentOptionsBase, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, DefineComponent } from 'vue';
3
3
  import { ButtonSize, SizeType } from '@aplus-frontend/antdv/es/button';
4
4
  import { ColSize } from '@aplus-frontend/antdv/es/grid';
5
5
  import { FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity, NamePath, ValidateOptions, InternalNamePath } from '@aplus-frontend/antdv/es/form/interface';
@@ -9,7 +9,7 @@ import { Options } from '../../../node_modules/scroll-into-view-if-needed';
9
9
  import { Recordable } from '../../type';
10
10
  import { VueTypeDef, VueTypeValidableDef } from '../../../node_modules/vue-types';
11
11
  import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
12
- import { ApFormProps, UpdateModelOptimizeFn, ApFormInternalInstance, WatchFunc } from '..';
12
+ import { ApFormProps, UpdateModelOptimizeFn, ApFormInternalInstance, WatchFunc, ApFormSearchFormPopoverSorterItem } from '..';
13
13
  import { OnCleanup } from '@vue/reactivity';
14
14
  declare function __VLS_template(): {
15
15
  attrs: Partial<{}>;
@@ -839,7 +839,10 @@ declare function __VLS_template(): {
839
839
  };
840
840
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
841
841
  declare const __VLS_component: DefineComponent<ApFormSearchFormProps, {
842
- apForm: ComputedRef<ApFormExpose | undefined>;
842
+ apForm: ApFormExpose;
843
+ getSorterItems: () => ApFormSearchFormPopoverSorterItem[];
844
+ setSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
845
+ resetSorterItems: () => void;
843
846
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApFormSearchFormProps> & Readonly<{}>, {
844
847
  collapse: boolean;
845
848
  layout: string;