@aplus-frontend/ui 7.13.11 → 7.14.0

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 (115) hide show
  1. package/es/index.mjs +58 -56
  2. package/es/src/ap-field/select/index.vue.d.ts +8 -18
  3. package/es/src/ap-field/text/index.vue2.mjs +2 -2
  4. package/es/src/ap-field/text/password.vue.mjs +8 -8
  5. package/es/src/ap-form/ap-form.vue.d.ts +1 -0
  6. package/es/src/ap-form/ap-form.vue2.mjs +122 -106
  7. package/es/src/ap-form/drawer-form/index.vue.d.ts +4 -0
  8. package/es/src/ap-form/drawer-form/index.vue.mjs +13 -10
  9. package/es/src/ap-form/interface.d.ts +5 -0
  10. package/es/src/ap-form/item/index.vue.d.ts +1 -0
  11. package/es/src/ap-form/item/index.vue.mjs +84 -70
  12. package/es/src/ap-form/items/checkbox/index.vue.mjs +9 -8
  13. package/es/src/ap-form/items/date/index.vue.mjs +10 -9
  14. package/es/src/ap-form/items/date-range/index.vue.mjs +10 -9
  15. package/es/src/ap-form/items/number/index.vue.mjs +7 -6
  16. package/es/src/ap-form/items/radio/index.vue.mjs +9 -8
  17. package/es/src/ap-form/items/select/index.vue.d.ts +6 -6
  18. package/es/src/ap-form/items/select/index.vue.mjs +3 -2
  19. package/es/src/ap-form/items/switch/index.vue.mjs +10 -9
  20. package/es/src/ap-form/items/text/index.vue2.mjs +6 -5
  21. package/es/src/ap-form/items/text/password.vue.mjs +10 -9
  22. package/es/src/ap-form/items/text-area/index.vue.mjs +4 -3
  23. package/es/src/ap-form/items/tree-select/index.vue.mjs +1 -0
  24. package/es/src/ap-form/modal-form/index.vue.d.ts +4 -0
  25. package/es/src/ap-form/modal-form/index.vue.mjs +3 -0
  26. package/es/src/ap-form/render/item.vue.mjs +6 -5
  27. package/es/src/ap-form/search-form/index.vue.d.ts +4 -0
  28. package/es/src/ap-form/search-form/index.vue.mjs +26 -23
  29. package/es/src/ap-table/ap-table.vue2.mjs +2 -2
  30. package/es/src/ap-table/components/setting/index.d.ts +2 -0
  31. package/es/src/ap-table/components/setting/index.mjs +5 -0
  32. package/es/src/ap-table/components/setting/modal/index.vue.mjs +277 -2
  33. package/es/src/ap-table/components/setting/modal/index.vue2.mjs +2 -273
  34. package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +11 -8
  35. package/es/src/ap-table/components/setting/template/edit-form.vue.d.ts +2 -0
  36. package/es/src/ap-table/components/setting/template/item.vue2.mjs +35 -35
  37. package/es/src/ap-table/constants.d.ts +3 -3
  38. package/es/src/ap-table/hooks/use-table-template-storage.mjs +55 -54
  39. package/es/src/ap-table/index.d.ts +2 -2
  40. package/es/src/ap-table/index.mjs +7 -6
  41. package/es/src/ap-table/interface.d.ts +16 -0
  42. package/es/src/business/ap-size-input/form-item.vue.mjs +6 -5
  43. package/es/src/business/ap-view/components/main-button-content.vue.d.ts +2 -0
  44. package/es/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -0
  45. package/es/src/business/batch-input-group/form-item.vue.mjs +8 -7
  46. package/es/src/business/hooks/usePageListAgGrid.mjs +2 -2
  47. package/es/src/index.mjs +54 -52
  48. package/es/src/locale/lang/en.mjs +1 -0
  49. package/es/src/locale/lang/zh-cn.mjs +1 -0
  50. package/es/src/render/render.d.ts +7 -4
  51. package/es/src/render/render.mjs +17 -7
  52. package/es/src/splitter/SplitBar.vue2.mjs +7 -7
  53. package/es/src/splitter/hooks/sizeUtil.d.ts +3 -0
  54. package/es/src/splitter/hooks/sizeUtil.mjs +44 -0
  55. package/es/src/splitter/hooks/useSizes.mjs +38 -41
  56. package/es/src/version.d.ts +1 -1
  57. package/es/src/version.mjs +1 -1
  58. package/lib/index.js +1 -1
  59. package/lib/src/ap-field/select/index.vue.d.ts +8 -18
  60. package/lib/src/ap-field/text/index.vue2.js +1 -1
  61. package/lib/src/ap-field/text/password.vue.js +1 -1
  62. package/lib/src/ap-form/ap-form.vue.d.ts +1 -0
  63. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  64. package/lib/src/ap-form/drawer-form/index.vue.d.ts +4 -0
  65. package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
  66. package/lib/src/ap-form/interface.d.ts +5 -0
  67. package/lib/src/ap-form/item/index.vue.d.ts +1 -0
  68. package/lib/src/ap-form/item/index.vue.js +1 -1
  69. package/lib/src/ap-form/items/checkbox/index.vue.js +1 -1
  70. package/lib/src/ap-form/items/date/index.vue.js +1 -1
  71. package/lib/src/ap-form/items/date-range/index.vue.js +1 -1
  72. package/lib/src/ap-form/items/number/index.vue.js +1 -1
  73. package/lib/src/ap-form/items/radio/index.vue.js +1 -1
  74. package/lib/src/ap-form/items/select/index.vue.d.ts +6 -6
  75. package/lib/src/ap-form/items/select/index.vue.js +1 -1
  76. package/lib/src/ap-form/items/switch/index.vue.js +1 -1
  77. package/lib/src/ap-form/items/text/index.vue2.js +1 -1
  78. package/lib/src/ap-form/items/text/password.vue.js +1 -1
  79. package/lib/src/ap-form/items/text-area/index.vue.js +1 -1
  80. package/lib/src/ap-form/items/tree-select/index.vue.js +1 -1
  81. package/lib/src/ap-form/modal-form/index.vue.d.ts +4 -0
  82. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  83. package/lib/src/ap-form/render/item.vue.js +1 -1
  84. package/lib/src/ap-form/search-form/index.vue.d.ts +4 -0
  85. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  86. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  87. package/lib/src/ap-table/components/setting/index.d.ts +2 -0
  88. package/lib/src/ap-table/components/setting/index.js +1 -0
  89. package/lib/src/ap-table/components/setting/modal/index.vue.js +1 -1
  90. package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
  91. package/lib/src/ap-table/components/setting/select-group/index.vue2.js +1 -1
  92. package/lib/src/ap-table/components/setting/template/edit-form.vue.d.ts +2 -0
  93. package/lib/src/ap-table/components/setting/template/item.vue2.js +1 -1
  94. package/lib/src/ap-table/constants.d.ts +3 -3
  95. package/lib/src/ap-table/hooks/use-table-template-storage.js +1 -1
  96. package/lib/src/ap-table/index.d.ts +2 -2
  97. package/lib/src/ap-table/index.js +1 -1
  98. package/lib/src/ap-table/interface.d.ts +16 -0
  99. package/lib/src/business/ap-size-input/form-item.vue.js +1 -1
  100. package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +2 -0
  101. package/lib/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -0
  102. package/lib/src/business/batch-input-group/form-item.vue.js +1 -1
  103. package/lib/src/business/hooks/usePageListAgGrid.js +1 -1
  104. package/lib/src/index.js +1 -1
  105. package/lib/src/locale/lang/en.js +1 -1
  106. package/lib/src/locale/lang/zh-cn.js +1 -1
  107. package/lib/src/render/render.d.ts +7 -4
  108. package/lib/src/render/render.js +1 -1
  109. package/lib/src/splitter/SplitBar.vue2.js +1 -1
  110. package/lib/src/splitter/hooks/sizeUtil.d.ts +3 -0
  111. package/lib/src/splitter/hooks/sizeUtil.js +1 -0
  112. package/lib/src/splitter/hooks/useSizes.js +1 -1
  113. package/lib/src/version.d.ts +1 -1
  114. package/lib/src/version.js +1 -1
  115. package/package.json +3 -3
@@ -1,10 +1,10 @@
1
- import { defineComponent as B, useSlots as _, shallowRef as g, createBlock as x, openBlock as F, normalizeProps as t, guardReactiveProps as s, unref as e, createSlots as n, withCtx as d, createVNode as k, mergeProps as w, renderList as i, renderSlot as f } from "vue";
2
- import { omit as u, pick as P } from "lodash-unified";
1
+ import { defineComponent as v, useSlots as _, shallowRef as g, createBlock as F, openBlock as x, normalizeProps as t, guardReactiveProps as s, unref as e, createSlots as n, withCtx as d, createVNode as k, mergeProps as w, renderList as i, renderSlot as u } from "vue";
2
+ import { omit as f, pick as P } from "lodash-unified";
3
3
  import { ApField as S } from "../../../ap-field/index.mjs";
4
4
  import { apFormItemSlotNames as m } from "../../constant.mjs";
5
5
  import "../../item/index.vue2.mjs";
6
6
  import C from "../../item/index.vue.mjs";
7
- const z = /* @__PURE__ */ B({
7
+ const z = /* @__PURE__ */ v({
8
8
  name: "ApFormItemPassword",
9
9
  __name: "password",
10
10
  props: {
@@ -50,11 +50,12 @@ const z = /* @__PURE__ */ B({
50
50
  description: {},
51
51
  customFilled: {},
52
52
  disabled: { type: Boolean, default: void 0 },
53
+ autoFocus: { type: Boolean },
53
54
  field: { default: () => ({}) },
54
55
  placeholder: {}
55
56
  },
56
57
  setup(c, { expose: b }) {
57
- const { Text: h } = S, p = _(), v = c, a = g();
58
+ const { Text: h } = S, p = _(), y = c, a = g();
58
59
  return b({
59
60
  focus: () => {
60
61
  a.value?.focus();
@@ -62,7 +63,7 @@ const z = /* @__PURE__ */ B({
62
63
  blur: () => {
63
64
  a.value?.blur();
64
65
  }
65
- }), (o, N) => (F(), x(C, t(s(e(u)(v, ["field", "disabled", "placeholder"]))), n({
66
+ }), (o, N) => (x(), F(C, t(s(e(f)(y, ["field", "disabled", "placeholder"]))), n({
66
67
  default: d(() => [
67
68
  k(e(h).Password, w({
68
69
  ref_key: "inputRef",
@@ -70,20 +71,20 @@ const z = /* @__PURE__ */ B({
70
71
  disabled: o.disabled,
71
72
  placeholder: o.placeholder
72
73
  }, o.field), n({ _: 2 }, [
73
- i(e(u)(p, e(m)), (y, l) => ({
74
+ i(e(f)(p, e(m)), (B, l) => ({
74
75
  name: l,
75
76
  fn: d((r) => [
76
- f(o.$slots, l, t(s(r || {})))
77
+ u(o.$slots, l, t(s(r || {})))
77
78
  ])
78
79
  }))
79
80
  ]), 1040, ["disabled", "placeholder"])
80
81
  ]),
81
82
  _: 2
82
83
  }, [
83
- i(e(P)(p, e(m)), (y, l) => ({
84
+ i(e(P)(p, e(m)), (B, l) => ({
84
85
  name: l,
85
86
  fn: d((r) => [
86
- f(o.$slots, l, t(s(r || {})))
87
+ u(o.$slots, l, t(s(r || {})))
87
88
  ])
88
89
  }))
89
90
  ]), 1040));
@@ -1,9 +1,9 @@
1
- import { defineComponent as m, useSlots as c, shallowRef as b, computed as x, createBlock as h, openBlock as v, normalizeProps as a, guardReactiveProps as t, unref as r, createSlots as y, withCtx as s, createVNode as B, mergeProps as A, renderList as g, renderSlot as _ } from "vue";
1
+ import { defineComponent as c, useSlots as m, shallowRef as b, computed as x, createBlock as h, openBlock as v, normalizeProps as a, guardReactiveProps as t, unref as r, createSlots as y, withCtx as s, createVNode as B, mergeProps as A, renderList as g, renderSlot as _ } from "vue";
2
2
  import { omit as F } from "lodash-unified";
3
3
  import { ApField as k } from "../../../ap-field/index.mjs";
4
4
  import "../../item/index.vue2.mjs";
5
5
  import C from "../../item/index.vue.mjs";
6
- const $ = /* @__PURE__ */ m({
6
+ const $ = /* @__PURE__ */ c({
7
7
  name: "ApFormItemTextArea",
8
8
  __name: "index",
9
9
  props: {
@@ -48,11 +48,12 @@ const $ = /* @__PURE__ */ m({
48
48
  description: {},
49
49
  customFilled: {},
50
50
  disabled: { type: Boolean, default: void 0 },
51
+ autoFocus: { type: Boolean },
51
52
  field: { default: () => ({}) },
52
53
  placeholder: {}
53
54
  },
54
55
  setup(d, { expose: i }) {
55
- const { TextArea: n } = k, p = c(), u = d, l = b();
56
+ const { TextArea: n } = k, p = m(), u = d, l = b();
56
57
  return i({
57
58
  focus: (e) => {
58
59
  l.value?.focus(e);
@@ -51,6 +51,7 @@ const E = /* @__PURE__ */ B({
51
51
  description: {},
52
52
  customFilled: {},
53
53
  disabled: { type: Boolean, default: void 0 },
54
+ autoFocus: { type: Boolean },
54
55
  field: { default: () => ({}) },
55
56
  placeholder: {}
56
57
  },
@@ -122,6 +122,7 @@ declare function __VLS_template(): {
122
122
  readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
123
123
  readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
124
124
  readonly syncToUrlPriority?: boolean | undefined;
125
+ readonly autoFocusFirstInput?: boolean | undefined;
125
126
  } & VNodeProps & AllowedComponentProps & ComponentCustomProps;
126
127
  $attrs: {
127
128
  [x: string]: unknown;
@@ -847,6 +848,7 @@ declare function __VLS_template(): {
847
848
  }> & {} & ComponentCustomProperties & {} & {
848
849
  $slots: {
849
850
  default?(_: {}): any;
851
+ default?(_: {}): any;
850
852
  };
851
853
  }) | null;
852
854
  };
@@ -1325,6 +1327,7 @@ declare const __VLS_component: DefineComponent<ApFormModalFormProps, {
1325
1327
  readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
1326
1328
  readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
1327
1329
  readonly syncToUrlPriority?: boolean | undefined;
1330
+ readonly autoFocusFirstInput?: boolean | undefined;
1328
1331
  } & VNodeProps & AllowedComponentProps & ComponentCustomProps;
1329
1332
  $attrs: {
1330
1333
  [x: string]: unknown;
@@ -2050,6 +2053,7 @@ declare const __VLS_component: DefineComponent<ApFormModalFormProps, {
2050
2053
  }> & {} & ComponentCustomProperties & {} & {
2051
2054
  $slots: {
2052
2055
  default?(_: {}): any;
2056
+ default?(_: {}): any;
2053
2057
  };
2054
2058
  }) | null;
2055
2059
  }, any>;
@@ -66,6 +66,9 @@ const Ne = /* @__PURE__ */ z({
66
66
  syncToUrlPriority: {
67
67
  type: Boolean
68
68
  },
69
+ autoFocusFirstInput: {
70
+ type: Boolean
71
+ },
69
72
  open: {
70
73
  type: Boolean,
71
74
  default: void 0
@@ -1,5 +1,5 @@
1
- import { defineComponent as m, useSlots as c, createBlock as B, openBlock as y, unref as e, normalizeProps as o, guardReactiveProps as l, createSlots as v, withCtx as t, createVNode as x, renderSlot as s, renderList as _ } from "vue";
2
- import { omit as b } from "lodash-unified";
1
+ import { defineComponent as m, useSlots as c, createBlock as B, openBlock as y, unref as e, normalizeProps as o, guardReactiveProps as l, createSlots as v, withCtx as t, createVNode as x, renderSlot as s, renderList as F } from "vue";
2
+ import { omit as _ } from "lodash-unified";
3
3
  import { ApForm as d } from "../index.mjs";
4
4
  const S = /* @__PURE__ */ m({
5
5
  name: "ApFormItemRender",
@@ -46,11 +46,12 @@ const S = /* @__PURE__ */ m({
46
46
  transform: {},
47
47
  description: {},
48
48
  customFilled: {},
49
- disabled: { type: Boolean }
49
+ disabled: { type: Boolean },
50
+ autoFocus: { type: Boolean }
50
51
  },
51
52
  setup(p) {
52
53
  const i = p, u = c();
53
- return (a, g) => (y(), B(e(d).FormItem, o(l(i)), v({
54
+ return (a, b) => (y(), B(e(d).FormItem, o(l(i)), v({
54
55
  default: t(() => [
55
56
  x(e(d).ControlRender, null, {
56
57
  default: t((r) => [
@@ -61,7 +62,7 @@ const S = /* @__PURE__ */ m({
61
62
  ]),
62
63
  _: 2
63
64
  }, [
64
- _(e(b)(u, "default"), (r, n) => ({
65
+ F(e(_)(u, "default"), (r, n) => ({
65
66
  name: n,
66
67
  fn: t((f) => [
67
68
  s(a.$slots, n, o(l(f || {})))
@@ -120,6 +120,7 @@ declare function __VLS_template(): {
120
120
  readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
121
121
  readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
122
122
  readonly syncToUrlPriority?: boolean | undefined;
123
+ readonly autoFocusFirstInput?: boolean | undefined;
123
124
  } & VNodeProps & AllowedComponentProps & ComponentCustomProps;
124
125
  $attrs: {
125
126
  [x: string]: unknown;
@@ -845,6 +846,7 @@ declare function __VLS_template(): {
845
846
  }> & {} & ComponentCustomProperties & {} & {
846
847
  $slots: {
847
848
  default?(_: {}): any;
849
+ default?(_: {}): any;
848
850
  };
849
851
  }) | null;
850
852
  contentWrapperRef: CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
@@ -1108,6 +1110,7 @@ declare const __VLS_component: DefineComponent<ApFormSearchFormProps, {
1108
1110
  readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
1109
1111
  readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
1110
1112
  readonly syncToUrlPriority?: boolean | undefined;
1113
+ readonly autoFocusFirstInput?: boolean | undefined;
1111
1114
  } & VNodeProps & AllowedComponentProps & ComponentCustomProps;
1112
1115
  $attrs: {
1113
1116
  [x: string]: unknown;
@@ -1833,6 +1836,7 @@ declare const __VLS_component: DefineComponent<ApFormSearchFormProps, {
1833
1836
  }> & {} & ComponentCustomProperties & {} & {
1834
1837
  $slots: {
1835
1838
  default?(_: {}): any;
1839
+ default?(_: {}): any;
1836
1840
  };
1837
1841
  }) | null;
1838
1842
  contentWrapperRef: CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
@@ -1,5 +1,5 @@
1
1
  import { isVNode as ie, defineComponent as ce, useSlots as ue, ref as pe, shallowRef as w, computed as R, unref as a, watch as M, createVNode as o, Fragment as _, createBlock as x, openBlock as p, mergeProps as de, withCtx as I, resolveDynamicComponent as T, createElementBlock as fe, renderList as me, normalizeStyle as he } from "vue";
2
- import { Col as b, Flex as k, Button as q, Row as ge } from "@aplus-frontend/antdv";
2
+ import { Col as F, Flex as k, Button as q, Row as ge } from "@aplus-frontend/antdv";
3
3
  import { isArray as xe, isBoolean as ye, omit as ve } from "lodash-unified";
4
4
  import { floorWith as H } from "../../utils/format.mjs";
5
5
  import { useDevWarning as Se } from "../../utils/warning.mjs";
@@ -14,13 +14,13 @@ import "./components/popover-sorter/index.vue.mjs";
14
14
  import { getTargetNode as we } from "./hooks/use-collapse-input-count.mjs";
15
15
  import { useCountPerRow as Re } from "./hooks/use-count-per-row.mjs";
16
16
  import { useSorter as _e } from "./hooks/use-sorter.mjs";
17
- import { execFunc as J, diffFormItem as be } from "./utils.mjs";
18
- import { useNamespace as Fe } from "../../config-provider/hooks/use-namespace.mjs";
17
+ import { execFunc as J, diffFormItem as Fe } from "./utils.mjs";
18
+ import { useNamespace as be } from "../../config-provider/hooks/use-namespace.mjs";
19
19
  import { useLocale as Ae } from "../../config-provider/hooks/use-locale.mjs";
20
20
  import { isDef as K } from "../../utils/is.mjs";
21
21
  import Q from "../item/index.vue.mjs";
22
- import Ne from "./components/popover-filter.vue2.mjs";
23
- import Be from "./components/popover-sorter/index.vue2.mjs";
22
+ import Be from "./components/popover-filter.vue2.mjs";
23
+ import Ne from "./components/popover-sorter/index.vue2.mjs";
24
24
  import Ie from "../ap-form.vue2.mjs";
25
25
  function Te(d) {
26
26
  return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !ie(d);
@@ -79,6 +79,9 @@ const r = 100, nt = /* @__PURE__ */ ce({
79
79
  syncToUrlPriority: {
80
80
  type: Boolean
81
81
  },
82
+ autoFocusFirstInput: {
83
+ type: Boolean
84
+ },
82
85
  collapse: {
83
86
  type: Boolean,
84
87
  default: void 0
@@ -129,7 +132,7 @@ const r = 100, nt = /* @__PURE__ */ ce({
129
132
  Se("SearchForm").deprecated(typeof t.resizeTarget < "u", "resizeTarget", "resize.target");
130
133
  const Y = Ce("ap-form-search-form"), {
131
134
  b: f
132
- } = Fe("ap-form-search-form"), {
135
+ } = be("ap-form-search-form"), {
133
136
  t: P
134
137
  } = Ae(), v = pe(), E = w(), Z = Re(t, E), W = w();
135
138
  function z() {
@@ -142,12 +145,12 @@ const r = 100, nt = /* @__PURE__ */ ce({
142
145
  const te = (e) => K(e) ? (xe(e) ? e : [e]).join("") : Date.now();
143
146
  let O = [];
144
147
  const m = w(G(y.default())), c = w(y.extra?.()), L = R(() => H(r / a(Z), 4)), {
145
- items: F,
148
+ items: b,
146
149
  sorted: $,
147
150
  handleClickConfirm: A
148
151
  } = _e(m);
149
152
  M(() => y.default(), (e) => {
150
- O = m.value, m.value = be(O, G(e)), $.value = !1;
153
+ O = m.value, m.value = Fe(O, G(e)), $.value = !1;
151
154
  }), M(() => y.extra?.(), (e) => {
152
155
  c.value = e;
153
156
  });
@@ -156,26 +159,26 @@ const r = 100, nt = /* @__PURE__ */ ce({
156
159
  }
157
160
  const n = R(() => {
158
161
  const e = m.value, u = [], l = [], g = [], s = a(L);
159
- let S = 0, N = 0;
162
+ let S = 0, B = 0;
160
163
  const le = r * t.maxRows - s * (a(c) && !t.extraInAction ? 2 : 1);
161
- e.forEach((B) => {
162
- const D = we(B);
164
+ e.forEach((N) => {
165
+ const D = we(N);
163
166
  if (!D)
164
167
  return;
165
168
  const i = D.props;
166
169
  if (ye(i.hidden) ? !!i.hidden : K(i.hidden))
167
- u.push(B);
170
+ u.push(N);
168
171
  else {
169
172
  let C = i.span ? oe(i.span) : s;
170
173
  const V = {
171
- node: B,
174
+ node: N,
172
175
  span: C,
173
176
  key: `ApFormSearchFormItem-${te(i.name)}-${i._signal}`
174
177
  }, U = r - S % r;
175
- U < C && (C += U), S += C, S > le ? l.push(V) : (N = S, g.push(V));
178
+ U < C && (C += U), S += C, S > le ? l.push(V) : (B = S, g.push(V));
176
179
  }
177
180
  });
178
- const j = r - (N + s) % r, re = Math.ceil(N) % r < s, se = j < s ? r : j;
181
+ const j = r - (B + s) % r, re = Math.ceil(B) % r < s, se = j < s ? r : j;
179
182
  return {
180
183
  hideNode: o(_, null, [u]),
181
184
  nodes: g,
@@ -185,7 +188,7 @@ const r = 100, nt = /* @__PURE__ */ ce({
185
188
  };
186
189
  }), h = (e) => `${e}%`, ae = R(() => {
187
190
  let e;
188
- const u = n.value.collapseNodes.length || t.sortable && m.value.length, l = o(b, {
191
+ const u = n.value.collapseNodes.length || t.sortable && m.value.length, l = o(F, {
189
192
  flex: h(a(L)),
190
193
  key: "actionWrapper"
191
194
  }, {
@@ -200,13 +203,13 @@ const r = 100, nt = /* @__PURE__ */ ce({
200
203
  }, {
201
204
  default: () => [u ? o("div", {
202
205
  class: f("column-setting-trigger-wrapper")
203
- }, [n.value.collapseNodes.length ? o(Ne, {
206
+ }, [n.value.collapseNodes.length ? o(Be, {
204
207
  onSubmit: z,
205
208
  config: n.value.collapseNodes,
206
209
  submitLoading: t.submitLoading
207
- }, null) : null, t.sortable && F.value.length ? o(Be, {
210
+ }, null) : null, t.sortable && b.value.length ? o(Ne, {
208
211
  ref: W,
209
- items: F.value,
212
+ items: b.value,
210
213
  onClickConfirm: A,
211
214
  sorted: $.value
212
215
  }, null) : null]) : null, o(q, {
@@ -229,7 +232,7 @@ const r = 100, nt = /* @__PURE__ */ ce({
229
232
  }), t.extraInAction ? a(c) : null]
230
233
  })]
231
234
  })]
232
- }), g = !t.extraInAction && a(c) ? o(b, {
235
+ }), g = !t.extraInAction && a(c) ? o(F, {
233
236
  flex: h(n.value.extraSpan),
234
237
  key: "extraNode"
235
238
  }, {
@@ -240,7 +243,7 @@ const r = 100, nt = /* @__PURE__ */ ce({
240
243
  default: () => [e]
241
244
  })]
242
245
  })]
243
- }) : null, s = o(b, {
246
+ }) : null, s = o(F, {
244
247
  flex: h(n.value.extraSpan)
245
248
  }, null);
246
249
  return n.value.lastRowOnlyIncludeActionAndExtra ? o(_, null, [g || s, l]) : o(_, null, [l, g]);
@@ -251,7 +254,7 @@ const r = 100, nt = /* @__PURE__ */ ce({
251
254
  }
252
255
  return X({
253
256
  apForm: R(() => a(v)),
254
- getSorterItems: () => F.value,
257
+ getSorterItems: () => b.value,
255
258
  setSorterItems: A,
256
259
  resetSorterItems: ne
257
260
  }), (e, u) => (p(), x(Ie, de({
@@ -264,7 +267,7 @@ const r = 100, nt = /* @__PURE__ */ ce({
264
267
  ref: E,
265
268
  gutter: 8
266
269
  }, {
267
- default: I(() => [(p(!0), fe(_, null, me(n.value.nodes, (l) => (p(), x(a(b), {
270
+ default: I(() => [(p(!0), fe(_, null, me(n.value.nodes, (l) => (p(), x(a(F), {
268
271
  key: l.key,
269
272
  flex: h(l.span),
270
273
  style: he({
@@ -9,7 +9,7 @@ import { ApForm as er } from "../ap-form/index.mjs";
9
9
  import "../config-provider/index.mjs";
10
10
  import { getScrollbarSize as rr } from "../utils/index.mjs";
11
11
  import "./components/paragraph-ellipsis/index.vue.mjs";
12
- import "./components/setting/modal/index.vue.mjs";
12
+ import "./components/setting/modal/index.vue2.mjs";
13
13
  import { noRenderAsFormItemValueList as ie } from "./constants.mjs";
14
14
  import { useProvideApTable as or } from "./context.mjs";
15
15
  import { useStickyScroll as tr } from "./hooks/use-sticky-scroll.mjs";
@@ -22,7 +22,7 @@ import { useNamespace as Sr } from "../config-provider/hooks/use-namespace.mjs";
22
22
  import { useGlobalConfig as hr } from "../config-provider/hooks/use-global-config.mjs";
23
23
  import { isDef as fe } from "../utils/is.mjs";
24
24
  import wr from "./components/paragraph-ellipsis/index.vue2.mjs";
25
- import vr from "./components/setting/modal/index.vue2.mjs";
25
+ import vr from "./components/setting/modal/index.vue.mjs";
26
26
  import Rr from "../scroll-bar/index.vue.mjs";
27
27
  const Qr = /* @__PURE__ */ je({
28
28
  name: "ApTable",
@@ -0,0 +1,2 @@
1
+ import { default as ApTableSetting } from './modal/index.vue';
2
+ export default ApTableSetting;
@@ -0,0 +1,5 @@
1
+ import "./modal/index.vue2.mjs";
2
+ import r from "./modal/index.vue.mjs";
3
+ export {
4
+ r as default
5
+ };
@@ -1,4 +1,279 @@
1
- import f from "./index.vue2.mjs";
1
+ import { defineComponent as ce, ref as v, computed as pe, toRef as me, useSlots as de, createVNode as n, cloneVNode as fe, unref as e, watch as x, createElementBlock as P, openBlock as T, Fragment as ge, createBlock as A, createCommentVNode as j, resolveDynamicComponent as w, withCtx as o, withDirectives as ve, createElementVNode as m, normalizeClass as u, toDisplayString as y, createTextVNode as h, isRef as ye, vShow as Se } from "vue";
2
+ import { SettingOutlined as Te, SaveOutlined as Ce } from "@ant-design/icons-vue";
3
+ import { Button as F, Modal as be, Divider as B, RadioGroup as he, RadioButton as M, Flex as ke, Space as q, Popover as _e } from "@aplus-frontend/antdv";
4
+ import "../../../../ap-button/index.mjs";
5
+ import { randomStr as ze } from "../../../../utils/index.mjs";
6
+ import "../../../../config-provider/index.mjs";
7
+ import { getSingleVNode as xe } from "../../../../utils/slot.mjs";
8
+ import { useInjectApTable as Ae } from "../../../context.mjs";
9
+ import { useTableColumnState as we } from "../../../hooks/use-table-column-state.mjs";
10
+ import { useTableTemplateStorage as Be } from "../../../hooks/use-table-template-storage.mjs";
11
+ import Ke from "../../../style/setting.mjs";
12
+ import { useProvideApColumnSetting as Ne } from "../context.mjs";
13
+ import "../sorter/index.vue.mjs";
14
+ import "../template/edit-form.vue.mjs";
15
+ import "../template/index.vue.mjs";
16
+ import "../tree-select/index.vue.mjs";
17
+ import $e, { customCloneColumnStates as K, isEqualColumnStateIgnoreLabel as Ie } from "../utils.mjs";
18
+ import { useLocale as Le } from "../../../../config-provider/hooks/use-locale.mjs";
19
+ import { useNamespace as G } from "../../../../config-provider/hooks/use-namespace.mjs";
20
+ import Re from "../template/index.vue2.mjs";
21
+ import Ve from "../tree-select/index.vue2.mjs";
22
+ import De from "../sorter/index.vue2.mjs";
23
+ import Oe from "../../../../ap-button/ap-button.vue.mjs";
24
+ import Ue from "../template/edit-form.vue2.mjs";
25
+ const Ee = {
26
+ style: {
27
+ "padding-inline": "8px"
28
+ }
29
+ }, pt = /* @__PURE__ */ ce({
30
+ name: "ApTableSetting",
31
+ __name: "index",
32
+ props: {
33
+ config: {
34
+ default: () => ({
35
+ persistenceKey: ""
36
+ })
37
+ }
38
+ },
39
+ setup(H) {
40
+ const c = H, {
41
+ columnsBackup: J,
42
+ updateSize: Q,
43
+ updateColumns: W
44
+ } = Ae(), d = v(), k = pe(() => c.config.persistenceKey), C = v(!1), {
45
+ basicTemplate: X,
46
+ customizeTemplateList: f,
47
+ addTemplate: Y,
48
+ deleteTemplate: N,
49
+ updateTemplate: Z
50
+ } = Be(c.config, k), {
51
+ columnState: p,
52
+ setColumnState: $,
53
+ isAllSelected: ee,
54
+ toggleSelectAll: te
55
+ } = we([]), I = `${k.value}__active_key`;
56
+ function L(a) {
57
+ localStorage.setItem(I, a);
58
+ }
59
+ function R() {
60
+ return localStorage.getItem(I);
61
+ }
62
+ const i = v(c.config.defaultActiveKey ?? R() ?? f.value?.[0].key);
63
+ Ne({
64
+ activeKey: i,
65
+ cacheConfig: me(c, "config"),
66
+ deleteTemplate: re
67
+ });
68
+ const {
69
+ t: r
70
+ } = Le(), {
71
+ b: g,
72
+ be: b
73
+ } = G("ap-column-setting"), {
74
+ b: ae
75
+ } = G("ap-table"), le = Ke("ap-column-setting"), S = v(!1), V = v(!1), ne = de(), D = xe(ne.trigger) || n(F, {
76
+ icon: n(Te, null, null),
77
+ class: ae("setting-trigger-button")
78
+ }, null), O = D ? fe(D, {
79
+ onClick: () => {
80
+ S.value = !0;
81
+ }
82
+ }) : null;
83
+ function oe() {
84
+ $(K(e(X).columnState));
85
+ }
86
+ function U(a, t) {
87
+ W?.($e(e(J), a)), Q?.(t);
88
+ }
89
+ function ie() {
90
+ U(e(p), e(d)), S.value = !1;
91
+ const a = K(p.value), t = Z(i.value, {
92
+ columnState: a,
93
+ size: d.value
94
+ });
95
+ L(i.value), c.config?.onChange?.(a, t);
96
+ }
97
+ function se(a) {
98
+ const t = c.config.getActiveKey?.(a) ?? ze(), l = {
99
+ key: t,
100
+ label: a,
101
+ columnState: p.value,
102
+ size: d.value
103
+ };
104
+ Y(l), C.value = !1, i.value = t, c.config.onChange?.(l.columnState, l);
105
+ }
106
+ function E(a) {
107
+ const t = [...f.value].find((l) => l?.key === a);
108
+ t && ($(K(t.columnState)), d.value = t.size);
109
+ }
110
+ function re(a) {
111
+ if (a !== i.value) {
112
+ N(a);
113
+ return;
114
+ }
115
+ const t = f.value, l = t.findIndex((z) => z.key === a), s = t[l + 1]?.key ?? t[l - 1]?.key;
116
+ N(a), i.value = s, L(s);
117
+ }
118
+ function ue(a) {
119
+ if (V.value = a, !a) {
120
+ const t = R();
121
+ t && t !== i.value && (i.value = t);
122
+ }
123
+ }
124
+ x(() => i.value, (a, t) => {
125
+ if (!t && a) {
126
+ const l = [...f.value].find((s) => s?.key === a);
127
+ if (!l)
128
+ return;
129
+ U(l.columnState, l.size);
130
+ }
131
+ E(a);
132
+ }, {
133
+ immediate: !0
134
+ });
135
+ const _ = v(!1);
136
+ return x([d, p, S], ([a, t, l]) => {
137
+ if (!l)
138
+ return;
139
+ const s = f.value.find((z) => z.key === i.value);
140
+ s && (s.size !== a || !Ie(t, s.columnState)) ? _.value = !0 : _.value = !1;
141
+ }, {
142
+ deep: !0
143
+ }), x(() => i.value, (a) => {
144
+ c.config.onActiveChange?.(a);
145
+ }, {
146
+ immediate: !0
147
+ }), (a, t) => (T(), P(ge, null, [e(O) ? (T(), A(w(e(O)), {
148
+ key: 0
149
+ })) : j("", !0), n(e(be), {
150
+ open: S.value,
151
+ "onUpdate:open": t[4] || (t[4] = (l) => S.value = l),
152
+ title: e(r)("ap.apTable.setting.title"),
153
+ width: 1e3,
154
+ centered: !0,
155
+ "body-style": {
156
+ padding: "0px !important",
157
+ height: "516px"
158
+ },
159
+ "after-open-change": ue,
160
+ "wrap-class-name": `${e(g)()} ${e(le)}`,
161
+ "ok-text": e(r)("ap.apTable.setting.saveAndApply"),
162
+ "mask-closable": !1,
163
+ onOk: ie
164
+ }, {
165
+ footer: o(({
166
+ extra: l
167
+ }) => [n(e(ke), {
168
+ justify: "space-between"
169
+ }, {
170
+ default: o(() => [n(e(q), {
171
+ size: 12
172
+ }, {
173
+ default: o(() => [n(e(_e), {
174
+ open: C.value,
175
+ "onUpdate:open": t[3] || (t[3] = (s) => C.value = s),
176
+ trigger: "click",
177
+ arrow: !1,
178
+ placement: "topLeft",
179
+ "destroy-tooltip-on-hide": ""
180
+ }, {
181
+ content: o(() => [n(Ue, {
182
+ onConfirm: se,
183
+ onCancel: t[2] || (t[2] = () => C.value = !1)
184
+ })]),
185
+ default: o(() => [n(e(Oe), {
186
+ type: "borderLink",
187
+ disabled: !a.config.persistenceKey
188
+ }, {
189
+ icon: o(() => [n(e(Ce))]),
190
+ default: o(() => [h(y(e(r)("ap.apTable.setting.saveAsTemplate")) + " ", 1)]),
191
+ _: 1
192
+ }, 8, ["disabled"])]),
193
+ _: 1
194
+ }, 8, ["open"]), _.value ? (T(), P("span", {
195
+ key: 0,
196
+ class: u(e(g)("modify-tip"))
197
+ }, y(e(r)("ap.apTable.setting.modifyNotification")), 3)) : j("", !0)]),
198
+ _: 1
199
+ }), n(e(q), {
200
+ size: 10
201
+ }, {
202
+ default: o(() => [(T(), A(w(l.cancelBtn))), (T(), A(w(l.okBtn)))]),
203
+ _: 2
204
+ }, 1024)]),
205
+ _: 2
206
+ }, 1024)]),
207
+ default: o(() => [ve(m("div", {
208
+ class: u(e(g)("wrapper"))
209
+ }, [m("div", {
210
+ class: u(e(g)("left"))
211
+ }, [n(Re, {
212
+ "customize-template-list": e(f),
213
+ "persistence-key": k.value,
214
+ onActiveChange: E
215
+ }, null, 8, ["customize-template-list", "persistence-key"])], 2), n(e(B), {
216
+ type: "vertical",
217
+ style: {
218
+ height: "100%",
219
+ margin: "0px"
220
+ }
221
+ }), m("div", {
222
+ class: u(e(g)("center"))
223
+ }, [m("div", {
224
+ class: u(e(b)("center", "header"))
225
+ }, [m("div", {
226
+ class: u(e(b)("center", "tip-wrapper"))
227
+ }, [m("span", {
228
+ class: u(e(b)("center", "header-tips"))
229
+ }, y(e(r)("ap.apTable.setting.selectAllTip")), 3), n(e(F), {
230
+ type: "link",
231
+ size: "small",
232
+ onClick: e(te)
233
+ }, {
234
+ default: o(() => [h(y(e(ee) ? e(r)("ap.apTable.setting.unSelectAll") : e(r)("ap.apTable.setting.selectAll")), 1)]),
235
+ _: 1
236
+ }, 8, ["onClick"])], 2), n(e(he), {
237
+ value: d.value,
238
+ "onUpdate:value": t[0] || (t[0] = (l) => d.value = l)
239
+ }, {
240
+ default: o(() => [n(e(M), {
241
+ value: "small"
242
+ }, {
243
+ default: o(() => [h(y(e(r)("ap.apTable.setting.sizeSmall")), 1)]),
244
+ _: 1
245
+ }), n(e(M), {
246
+ value: "middle"
247
+ }, {
248
+ default: o(() => [h(y(e(r)("ap.apTable.setting.sizeNormal")), 1)]),
249
+ _: 1
250
+ })]),
251
+ _: 1
252
+ }, 8, ["value"])], 2), m("div", Ee, [n(e(B), {
253
+ dashed: "",
254
+ style: {
255
+ margin: "0px"
256
+ }
257
+ })]), n(Ve, {
258
+ class: u(e(b)("center", "content")),
259
+ value: e(p)
260
+ }, null, 8, ["class", "value"])], 2), n(e(B), {
261
+ type: "vertical",
262
+ style: {
263
+ height: "100%",
264
+ margin: "0px"
265
+ }
266
+ }), m("div", {
267
+ class: u(e(g)("right"))
268
+ }, [n(De, {
269
+ value: e(p),
270
+ "onUpdate:value": t[1] || (t[1] = (l) => ye(p) ? p.value = l : null),
271
+ onReset: oe
272
+ }, null, 8, ["value"])], 2)], 2), [[Se, V.value]])]),
273
+ _: 1
274
+ }, 8, ["open", "title", "wrap-class-name", "ok-text"])], 64));
275
+ }
276
+ });
2
277
  export {
3
- f as default
278
+ pt as default
4
279
  };