@aplus-frontend/ui 6.11.0 → 6.13.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 (92) hide show
  1. package/es/src/ap-descriptions/interface.d.ts +1 -1
  2. package/es/src/ap-form/ap-form.vue2.mjs +118 -108
  3. package/es/src/ap-form/items/number/index.vue.d.ts +2 -2
  4. package/es/src/ap-form/items/select/index.vue.d.ts +4 -4
  5. package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
  6. package/es/src/ap-form/items/text/password.vue.d.ts +2 -2
  7. package/es/src/ap-form/items/tree-select/index.vue.d.ts +4 -4
  8. package/es/src/ap-form/search-form/hooks/use-collapse-input-count.d.ts +8 -1
  9. package/es/src/ap-form/search-form/hooks/use-collapse-input-count.mjs +27 -19
  10. package/es/src/ap-form/search-form/hooks/use-sorter.mjs +31 -30
  11. package/es/src/ap-form/search-form/index.vue.d.ts +6 -2
  12. package/es/src/ap-form/search-form/index.vue.mjs +35 -35
  13. package/es/src/ap-grid/index.vue.mjs +221 -225
  14. package/es/src/ap-modal/interface.d.ts +8 -0
  15. package/es/src/ap-modal/utils/createModalStream.mjs +69 -66
  16. package/es/src/ap-table/ap-table.vue2.mjs +107 -111
  17. package/es/src/ap-table/constants.d.ts +7 -7
  18. package/es/src/ap-table/context.d.ts +1 -0
  19. package/es/src/ap-table/context.mjs +6 -5
  20. package/es/src/ap-table/utils.d.ts +5 -3247
  21. package/es/src/ap-table/utils.mjs +107 -121
  22. package/es/src/business/ap-card/ApCard.vue2.mjs +17 -17
  23. package/es/src/business/ap-summary/interface.d.ts +1 -1
  24. package/es/src/business/ap-view/ap-view.vue2.mjs +76 -74
  25. package/es/src/business/ap-view/interface.d.ts +1 -0
  26. package/es/src/business/batch-input-group/index.vue.d.ts +2 -1
  27. package/es/src/business/batch-input-group/index.vue.mjs +56 -52
  28. package/es/src/business/batch-input-group/interface.d.ts +5 -0
  29. package/es/src/business/batch-input-group/popover-input/index.vue2.mjs +36 -32
  30. package/es/src/business/batch-input-group/utils.d.ts +8 -0
  31. package/es/src/business/batch-input-group/utils.mjs +10 -0
  32. package/es/src/config-provider/config-provider-props.d.ts +5 -1
  33. package/es/src/config-provider/config-provider-props.mjs +4 -0
  34. package/es/src/config-provider/config-provider.d.ts +14 -5
  35. package/es/src/config-provider/config-provider.mjs +19 -18
  36. package/es/src/config-provider/constants.d.ts +3 -0
  37. package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
  38. package/es/src/config-provider/index.d.ts +28 -13
  39. package/es/src/utils/config-provider-preset.d.ts +6 -6
  40. package/es/src/version.d.ts +1 -1
  41. package/es/src/version.mjs +1 -1
  42. package/lib/src/ap-descriptions/interface.d.ts +1 -1
  43. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  44. package/lib/src/ap-form/items/number/index.vue.d.ts +2 -2
  45. package/lib/src/ap-form/items/select/index.vue.d.ts +4 -4
  46. package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
  47. package/lib/src/ap-form/items/text/password.vue.d.ts +2 -2
  48. package/lib/src/ap-form/items/tree-select/index.vue.d.ts +4 -4
  49. package/lib/src/ap-form/search-form/hooks/use-collapse-input-count.d.ts +8 -1
  50. package/lib/src/ap-form/search-form/hooks/use-collapse-input-count.js +1 -1
  51. package/lib/src/ap-form/search-form/hooks/use-sorter.js +1 -1
  52. package/lib/src/ap-form/search-form/index.vue.d.ts +6 -2
  53. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  54. package/lib/src/ap-grid/index.vue.js +1 -1
  55. package/lib/src/ap-modal/interface.d.ts +8 -0
  56. package/lib/src/ap-modal/utils/createModalStream.js +1 -1
  57. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  58. package/lib/src/ap-table/constants.d.ts +7 -7
  59. package/lib/src/ap-table/context.d.ts +1 -0
  60. package/lib/src/ap-table/context.js +1 -1
  61. package/lib/src/ap-table/utils.d.ts +5 -3247
  62. package/lib/src/ap-table/utils.js +1 -1
  63. package/lib/src/business/ap-card/ApCard.vue2.js +1 -1
  64. package/lib/src/business/ap-summary/interface.d.ts +1 -1
  65. package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
  66. package/lib/src/business/ap-view/interface.d.ts +1 -0
  67. package/lib/src/business/batch-input-group/index.vue.d.ts +2 -1
  68. package/lib/src/business/batch-input-group/index.vue.js +2 -2
  69. package/lib/src/business/batch-input-group/interface.d.ts +5 -0
  70. package/lib/src/business/batch-input-group/popover-input/index.vue2.js +3 -2
  71. package/lib/src/business/batch-input-group/utils.d.ts +8 -0
  72. package/lib/src/business/batch-input-group/utils.js +1 -0
  73. package/lib/src/config-provider/config-provider-props.d.ts +5 -1
  74. package/lib/src/config-provider/config-provider-props.js +1 -1
  75. package/lib/src/config-provider/config-provider.d.ts +14 -5
  76. package/lib/src/config-provider/config-provider.js +1 -1
  77. package/lib/src/config-provider/constants.d.ts +3 -0
  78. package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
  79. package/lib/src/config-provider/index.d.ts +28 -13
  80. package/lib/src/utils/config-provider-preset.d.ts +6 -6
  81. package/lib/src/version.d.ts +1 -1
  82. package/lib/src/version.js +1 -1
  83. package/package.json +3 -3
  84. package/theme/ap-grid/index.css +3 -0
  85. package/theme/ap-grid/index.less +3 -4
  86. package/theme/index.css +3 -0
  87. package/es/src/ap-table/components/dynamic-component/index.vue.d.ts +0 -4
  88. package/es/src/ap-table/components/dynamic-component/index.vue.mjs +0 -4
  89. package/es/src/ap-table/components/dynamic-component/index.vue2.mjs +0 -15
  90. package/lib/src/ap-table/components/dynamic-component/index.vue.d.ts +0 -4
  91. package/lib/src/ap-table/components/dynamic-component/index.vue.js +0 -1
  92. package/lib/src/ap-table/components/dynamic-component/index.vue2.js +0 -1
@@ -1,19 +1,19 @@
1
- import { defineComponent as X, computed as E, ref as K, createVNode as N, watch as Z, createBlock as U, openBlock as R, unref as b, mergeProps as C, withCtx as S, createElementVNode as O, normalizeClass as D } from "vue";
1
+ import { defineComponent as Z, computed as E, ref as K, createVNode as N, watch as U, createBlock as R, openBlock as C, unref as b, mergeProps as S, withCtx as O, createElementVNode as D, normalizeClass as ee } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import ee from "./icons/line-down.vue.mjs";
4
- import { ApBatchActionGroup as te } from "../ap-batch-action-group/index.mjs";
3
+ import te from "./icons/line-down.vue.mjs";
4
+ import { ApBatchActionGroup as ie } from "../ap-batch-action-group/index.mjs";
5
5
  import "./components/main-button-content.vue.mjs";
6
6
  import "./components/menu-list-content.vue.mjs";
7
- import { useViewProvide as ie } from "./hooks/use-view-provide.mjs";
8
- import { useInjectApTable as le } from "../../ap-table/context.mjs";
7
+ import { useViewProvide as le } from "./hooks/use-view-provide.mjs";
8
+ import { useInjectApTable as se } from "../../ap-table/context.mjs";
9
9
  import { SYSTEM_VIEW_KEY as V } from "./utils/enum.mjs";
10
- import { isValid as se } from "@aplus-frontend/utils";
10
+ import { isValid as re } from "@aplus-frontend/utils";
11
11
  import { useGlobalConfig as me } from "../../config-provider/hooks/use-global-config.mjs";
12
12
  import { useNamespace as ne } from "../../config-provider/hooks/use-namespace.mjs";
13
13
  import { useLocale as oe } from "../../config-provider/hooks/use-locale.mjs";
14
- import re from "./components/main-button-content.vue2.mjs";
15
- import fe from "./components/menu-list-content.vue2.mjs";
16
- const Ie = /* @__PURE__ */ X({
14
+ import fe from "./components/main-button-content.vue2.mjs";
15
+ import ae from "./components/menu-list-content.vue2.mjs";
16
+ const Ie = /* @__PURE__ */ Z({
17
17
  name: "ApView",
18
18
  __name: "ap-view",
19
19
  props: {
@@ -39,7 +39,7 @@ const Ie = /* @__PURE__ */ X({
39
39
  setup(k, {
40
40
  expose: A
41
41
  }) {
42
- const r = k, L = me("viewCacheOption"), {
42
+ const o = k, L = me("viewCacheOption"), {
43
43
  b: g
44
44
  } = ne("ap-view"), {
45
45
  t: P
@@ -51,19 +51,20 @@ const Ie = /* @__PURE__ */ X({
51
51
  setSearchFormValues: j,
52
52
  submit: G,
53
53
  reset: $,
54
- getSearchFormSorterItems: Y,
55
- setSearchFormSorterItems: z,
56
- resetSearchFormSorterItems: M
57
- } = le(), W = K(!1), F = K(!1), d = K("");
54
+ refresh: Y,
55
+ getSearchFormSorterItems: z,
56
+ setSearchFormSorterItems: M,
57
+ resetSearchFormSorterItems: W
58
+ } = se(), q = K(!1), F = K(!1), d = K("");
58
59
  let c = !1, _ = !1;
59
- const q = {
60
+ const H = {
60
61
  dropdownType: "dropdown",
61
- content: N(re, {
62
- maxViewNum: r.maxViewNum
62
+ content: N(fe, {
63
+ maxViewNum: o.maxViewNum
63
64
  }, null)
64
- }, m = K([v.value]), H = E(() => m.value.map((t) => ({
65
+ }, r = K([v.value]), J = E(() => r.value.map((t) => ({
65
66
  id: t.viewKey,
66
- content: N(fe, {
67
+ content: N(ae, {
67
68
  view: t
68
69
  }, null)
69
70
  }))), e = {
@@ -71,29 +72,30 @@ const Ie = /* @__PURE__ */ X({
71
72
  setSearchFormValues: j,
72
73
  submit: G,
73
74
  reset: $,
74
- getSearchFormSorterItems: Y,
75
- setSearchFormSorterItems: z,
76
- resetSearchFormSorterItems: M,
77
- ...r.saveDataSource
75
+ refresh: Y,
76
+ getSearchFormSorterItems: z,
77
+ setSearchFormSorterItems: M,
78
+ resetSearchFormSorterItems: W,
79
+ ...o.saveDataSource
78
80
  }, l = {
79
81
  ...L.value,
80
- ...r.viewCacheOption
81
- }, I = () => {
82
- if (r.isDefaultSystemView)
82
+ ...o.viewCacheOption
83
+ }, h = () => {
84
+ if (o.isDefaultSystemView)
83
85
  return V;
84
- if ((r.isFirstDefaultSystemView || _) && c)
86
+ if ((o.isFirstDefaultSystemView || _) && c)
85
87
  return V;
86
- const t = m.value.find((i) => i.isDefault);
88
+ const t = r.value.find((i) => i.isDefault);
87
89
  return (t == null ? void 0 : t.viewKey) ?? V;
88
90
  }, p = (t) => {
89
91
  d.value = t;
90
- const i = m.value.find((s) => s.viewKey === d.value);
92
+ const i = r.value.find((s) => s.viewKey === d.value);
91
93
  i && setTimeout(() => {
92
- var s, n, o, u, f, a, y, x, B, h;
93
- i.viewKey === V ? c ? r.manual || (s = e == null ? void 0 : e.submit) == null || s.call(e) : ((n = e == null ? void 0 : e.resetSearchFormSorterItems) == null || n.call(e), r.manual || (o = e == null ? void 0 : e.reset) == null || o.call(e)) : ((a = e == null ? void 0 : e.setSearchFormValues) == null || a.call(e, {
94
- ...Object.fromEntries(Object.keys(((u = e == null ? void 0 : e.getSearchFormValues) == null ? void 0 : u.call(e)) ?? {}).map((Q) => [Q, void 0])) ?? {},
94
+ var s, m, n, a, f, u, y, I, x, B;
95
+ i.viewKey === V ? c ? o.manual || (s = e == null ? void 0 : e.refresh) == null || s.call(e) : ((m = e == null ? void 0 : e.resetSearchFormSorterItems) == null || m.call(e), o.manual || (n = e == null ? void 0 : e.reset) == null || n.call(e)) : ((u = e == null ? void 0 : e.setSearchFormValues) == null || u.call(e, {
96
+ ...Object.fromEntries(Object.keys(((a = e == null ? void 0 : e.getSearchFormValues) == null ? void 0 : a.call(e)) ?? {}).map((X) => [X, void 0])) ?? {},
95
97
  ...((f = i.viewConfig) == null ? void 0 : f.searchForm) ?? {}
96
- }), (x = e == null ? void 0 : e.setSearchFormSorterItems) == null || x.call(e, ((y = i.viewConfig) == null ? void 0 : y.sorterItems) ?? []), c ? r.manual || (B = e == null ? void 0 : e.submit) == null || B.call(e) : (h = e == null ? void 0 : e.submit) == null || h.call(e)), c = !1;
98
+ }), (I = e == null ? void 0 : e.setSearchFormSorterItems) == null || I.call(e, ((y = i.viewConfig) == null ? void 0 : y.sorterItems) ?? []), c ? o.manual || (x = e == null ? void 0 : e.refresh) == null || x.call(e) : (B = e == null ? void 0 : e.submit) == null || B.call(e)), c = !1;
97
99
  });
98
100
  }, w = {
99
101
  getViewList: async (t) => {
@@ -101,12 +103,12 @@ const Ie = /* @__PURE__ */ X({
101
103
  try {
102
104
  const {
103
105
  tableKey: s
104
- } = t, n = await ((i = l == null ? void 0 : l.getViewList) == null ? void 0 : i.call(l, {
106
+ } = t, m = await ((i = l == null ? void 0 : l.getViewList) == null ? void 0 : i.call(l, {
105
107
  tableKey: s
106
108
  }));
107
- return m.value = [v.value, ...n ?? []], p(I()), m.value;
109
+ return r.value = [v.value, ...m ?? []], p(h()), r.value;
108
110
  } catch {
109
- return m.value = [v.value], p(V), m.value;
111
+ return r.value = [v.value], p(V), r.value;
110
112
  }
111
113
  },
112
114
  addView: async (t) => {
@@ -114,72 +116,72 @@ const Ie = /* @__PURE__ */ X({
114
116
  const {
115
117
  tableKey: i,
116
118
  viewKey: s,
117
- viewName: n,
118
- isDefault: o,
119
- viewConfig: u
119
+ viewName: m,
120
+ isDefault: n,
121
+ viewConfig: a
120
122
  } = t;
121
123
  await ((f = l == null ? void 0 : l.addView) == null ? void 0 : f.call(l, {
122
124
  tableKey: i,
123
125
  viewKey: s,
124
- viewName: n,
125
- isDefault: o,
126
- viewConfig: u
127
- })), o && (m.value = m.value.map((a) => ({
128
- ...a,
126
+ viewName: m,
127
+ isDefault: n,
128
+ viewConfig: a
129
+ })), n && (r.value = r.value.map((u) => ({
130
+ ...u,
129
131
  isDefault: !1
130
- }))), m.value = [...m.value, {
132
+ }))), r.value = [...r.value, {
131
133
  viewKey: s,
132
- viewName: n,
133
- isDefault: o,
134
- viewConfig: u
134
+ viewName: m,
135
+ isDefault: n,
136
+ viewConfig: a
135
137
  }], p(s);
136
138
  },
137
139
  changeView: async (t) => {
138
- var a;
140
+ var u;
139
141
  const {
140
142
  tableKey: i,
141
143
  viewKey: s,
142
- viewName: n,
143
- isDefault: o,
144
- viewConfig: u
144
+ viewName: m,
145
+ isDefault: n,
146
+ viewConfig: a
145
147
  } = t;
146
- await ((a = l == null ? void 0 : l.changeView) == null ? void 0 : a.call(l, {
148
+ await ((u = l == null ? void 0 : l.changeView) == null ? void 0 : u.call(l, {
147
149
  tableKey: i,
148
150
  viewKey: s,
149
- viewName: n,
150
- isDefault: o,
151
- viewConfig: u
152
- })), o && (m.value = m.value.map((y) => ({
151
+ viewName: m,
152
+ isDefault: n,
153
+ viewConfig: a
154
+ })), n && (r.value = r.value.map((y) => ({
153
155
  ...y,
154
156
  isDefault: !1
155
157
  })));
156
- const f = m.value.find((y) => y.viewKey === s);
157
- f && (f.viewName = n, f.isDefault = o, f.viewConfig = u), p(s);
158
+ const f = r.value.find((y) => y.viewKey === s);
159
+ f && (f.viewName = m, f.isDefault = n, f.viewConfig = a), p(s);
158
160
  },
159
161
  removeView: async (t) => {
160
- var n;
162
+ var m;
161
163
  const {
162
164
  tableKey: i,
163
165
  viewKey: s
164
166
  } = t;
165
- await ((n = l == null ? void 0 : l.removeView) == null ? void 0 : n.call(l, {
167
+ await ((m = l == null ? void 0 : l.removeView) == null ? void 0 : m.call(l, {
166
168
  tableKey: i,
167
169
  viewKey: s
168
- })), m.value = m.value.filter((o) => o.viewKey !== s), s === d.value && p(I());
170
+ })), r.value = r.value.filter((n) => n.viewKey !== s), s === d.value && p(h());
169
171
  }
170
- }, J = {
171
- tableKey: r.tableKey,
172
+ }, Q = {
173
+ tableKey: o.tableKey,
172
174
  currentViewKey: d,
173
175
  changeCurrentViewKey: p,
174
- popoverOpen: W,
176
+ popoverOpen: q,
175
177
  menuOpen: F,
176
- viewList: m,
178
+ viewList: r,
177
179
  viewListCRUD: w,
178
180
  saveDataSource: e
179
181
  };
180
- return ie(J), Z(() => r.tableKey, (t) => {
182
+ return le(Q), U(() => o.tableKey, (t) => {
181
183
  var i;
182
- se(t) && (c = !0, (i = w == null ? void 0 : w.getViewList) == null || i.call(w, {
184
+ re(t) && (c = !0, (i = w == null ? void 0 : w.getViewList) == null || i.call(w, {
183
185
  tableKey: t
184
186
  }));
185
187
  }, {
@@ -188,21 +190,21 @@ const Ie = /* @__PURE__ */ X({
188
190
  setFirstDefaultSystemView: (t) => {
189
191
  _ = t;
190
192
  }
191
- }), (t, i) => (R(), U(b(te), C({
193
+ }), (t, i) => (C(), R(b(ie), S({
192
194
  ...t.$attrs
193
195
  }, {
194
196
  open: F.value,
195
197
  "onUpdate:open": i[0] || (i[0] = (s) => F.value = s),
196
198
  class: [b(g)()],
197
- "button-props": q,
198
- "menu-list": H.value,
199
+ "button-props": H,
200
+ "menu-list": J.value,
199
201
  "overlay-class-name": [b(g)("overlay")],
200
202
  trigger: "click",
201
203
  placement: "bottom"
202
204
  }), {
203
- icon: S(() => [O("div", {
204
- class: D([b(g)("icon")])
205
- }, [N(ee)], 2)]),
205
+ icon: O(() => [D("div", {
206
+ class: ee([b(g)("icon")])
207
+ }, [N(te)], 2)]),
206
208
  _: 1
207
209
  }, 16, ["open", "class", "menu-list", "overlay-class-name"]));
208
210
  }
@@ -5,6 +5,7 @@ export interface SaveDataSource {
5
5
  setSearchFormValues?: (values: Partial<Recordable>) => void;
6
6
  submit?: () => void;
7
7
  reset?: () => void;
8
+ refresh?: () => void;
8
9
  getSearchFormSorterItems?: () => ApFormSearchFormPopoverSorterItem[];
9
10
  setSearchFormSorterItems?: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
10
11
  resetSearchFormSorterItems?: () => void;
@@ -19,6 +19,7 @@ declare const _default: DefineComponent<BatchInputGroupProps, {}, {}, {}, {}, Co
19
19
  emptyText: string;
20
20
  hasAll: boolean;
21
21
  popoverPlacement: "left" | "right" | number;
22
+ maxNum: number;
22
23
  }, {}, {}, {}, string, ComponentProvideOptions, false, {
23
24
  containerRef: HTMLDivElement;
24
25
  inputRef: ({
@@ -52,9 +53,9 @@ declare const _default: DefineComponent<BatchInputGroupProps, {}, {}, {}, {}, Co
52
53
  readonly suffix?: any;
53
54
  readonly focused?: boolean | undefined;
54
55
  readonly handleReset?: MouseEventHandler | undefined;
55
- readonly placeholder?: string | number | undefined;
56
56
  readonly defaultValue?: string | number | undefined;
57
57
  readonly id?: string | undefined;
58
+ readonly placeholder?: string | number | undefined;
58
59
  readonly autocomplete?: string | undefined;
59
60
  readonly maxlength?: number | undefined;
60
61
  readonly showCount?: boolean | ShowCountProps | undefined;
@@ -1,4 +1,4 @@
1
- import { defineComponent as N, ref as g, computed as u, unref as n, createElementBlock as $, openBlock as B, normalizeStyle as b, normalizeClass as K, createVNode as c, withCtx as A, createBlock as M, createCommentVNode as D, mergeProps as G } from "vue";
1
+ import { defineComponent as T, ref as g, computed as r, unref as l, createElementBlock as $, openBlock as B, normalizeStyle as b, normalizeClass as K, createVNode as c, withCtx as A, createBlock as M, createCommentVNode as D, mergeProps as G } from "vue";
2
2
  import "../../ap-field/index.mjs";
3
3
  import { Space as q } from "@aplus-frontend/antdv";
4
4
  import "../../config-provider/index.mjs";
@@ -7,13 +7,14 @@ import "./popover-input/index.vue.mjs";
7
7
  import "../../hooks/index.mjs";
8
8
  import { isDef as J } from "../../utils/index.mjs";
9
9
  import { useDefaultPlaceholder as Q } from "../../ap-field/hooks/use-default-placeholder.mjs";
10
- import { useControllableValue as W } from "../../hooks/useControllableValue.mjs";
11
- import { useLocale as X } from "../../config-provider/hooks/use-locale.mjs";
12
- import { useNamespace as Z } from "../../config-provider/hooks/use-namespace.mjs";
13
- import ee from "../../ap-field/select/index.vue.mjs";
14
- import { ApFieldText as te } from "../../ap-field/text/index.mjs";
15
- import oe from "./popover-input/index.vue2.mjs";
16
- const d = "GROUP_SEARCH_ALL", ge = /* @__PURE__ */ N({
10
+ import { splitValue as W } from "./utils.mjs";
11
+ import { useControllableValue as X } from "../../hooks/useControllableValue.mjs";
12
+ import { useLocale as Z } from "../../config-provider/hooks/use-locale.mjs";
13
+ import { useNamespace as ee } from "../../config-provider/hooks/use-namespace.mjs";
14
+ import te from "../../ap-field/select/index.vue.mjs";
15
+ import { ApFieldText as oe } from "../../ap-field/text/index.mjs";
16
+ import ne from "./popover-input/index.vue2.mjs";
17
+ const m = "GROUP_SEARCH_ALL", be = /* @__PURE__ */ T({
17
18
  name: "BatchInputGroup",
18
19
  __name: "index",
19
20
  props: {
@@ -24,6 +25,7 @@ const d = "GROUP_SEARCH_ALL", ge = /* @__PURE__ */ N({
24
25
  value: {},
25
26
  "onUpdate:value": {},
26
27
  popoverPlacement: { default: "left" },
28
+ maxNum: { default: 200 },
27
29
  mode: { default: "edit" },
28
30
  class: {},
29
31
  id: {},
@@ -72,38 +74,38 @@ const d = "GROUP_SEARCH_ALL", ge = /* @__PURE__ */ N({
72
74
  beforeInput: {}
73
75
  },
74
76
  emits: ["update:value"],
75
- setup(V, { emit: C }) {
76
- const l = V, S = Q("Text", l), I = C, { value: a, updateValue: p } = W(
77
- l,
78
- I
79
- ), i = g(), f = g(), { t: x } = X(), { b: U, cssVar: w } = Z("batch-input-group"), P = u(() => {
80
- const e = l.popoverPlacement;
77
+ setup(V, { emit: x }) {
78
+ const n = V, C = Q("Text", n), S = x, { value: a, updateValue: p } = X(
79
+ n,
80
+ S
81
+ ), i = g(), f = g(), { t: I } = Z(), { b: U, cssVar: w } = ee("batch-input-group"), P = r(() => {
82
+ const e = n.popoverPlacement;
81
83
  return {
82
84
  "popover-left": H(e) ? `${e}px` : e === "left" ? "0px" : "unset",
83
85
  "popover-right": e === "right" ? "0px" : "unset"
84
86
  };
85
- }), k = u(() => l.options ? l.options.length > 1 && l.hasAll ? [
86
- { value: d, label: x("ap.common.all") },
87
- ...l.options
88
- ] : l.options : []), R = u(() => l.options ? l.options.map((e) => e.value) : []), _ = u(() => {
87
+ }), k = r(() => n.options ? n.options.length > 1 && n.hasAll ? [
88
+ { value: m, label: I("ap.common.all") },
89
+ ...n.options
90
+ ] : n.options : []), R = r(() => n.options ? n.options.map((e) => e.value) : []), N = r(() => {
89
91
  var e, t;
90
- return (t = (e = n(a)) == null ? void 0 : e.value) != null && t.length ? n(a).value.join(",") : "";
91
- }), j = u(() => {
92
+ return (t = (e = l(a)) == null ? void 0 : e.value) != null && t.length ? l(a).value.join(",") : "";
93
+ }), j = r(() => {
92
94
  var e, t;
93
- return (t = (e = n(a)) == null ? void 0 : e.value) != null && t.length ? n(a).value.join(`
95
+ return (t = (e = l(a)) == null ? void 0 : e.value) != null && t.length ? l(a).value.join(`
94
96
  `) : "";
95
- }), E = u(() => {
97
+ }), E = r(() => {
96
98
  var t;
97
- const e = (t = n(a)) == null ? void 0 : t.key;
99
+ const e = (t = l(a)) == null ? void 0 : t.key;
98
100
  if (e != null && e.length)
99
- return e.length === 1 || !l.hasAll ? e[0] : d;
100
- }), F = u(() => {
101
+ return e.length === 1 || !n.hasAll ? e[0] : m;
102
+ }), F = r(() => {
101
103
  var o;
102
- const e = (o = n(a)) == null ? void 0 : o.key;
103
- return !e || (e == null ? void 0 : e.length) <= 1 ? n(S) : (l.options || []).filter((r) => e.includes(r.value)).map((r) => r.label).join("/");
104
+ const e = (o = l(a)) == null ? void 0 : o.key;
105
+ return !e || (e == null ? void 0 : e.length) <= 1 ? l(C) : (n.options || []).filter((u) => e.includes(u.value)).map((u) => u.label).join("/");
104
106
  });
105
107
  function L(e) {
106
- const t = n(a) || {}, o = e === d ? n(R) : J(e) ? [e] : [];
108
+ const t = l(a) || {}, o = e === m ? l(R) : J(e) ? [e] : [];
107
109
  p({
108
110
  ...t,
109
111
  key: o
@@ -111,52 +113,53 @@ const d = "GROUP_SEARCH_ALL", ge = /* @__PURE__ */ N({
111
113
  }
112
114
  function O(e) {
113
115
  var v, y;
114
- const t = n(a) || {}, o = e.target.value || "", r = o.replace(/[,]+/g, ",");
115
- if (o !== r) {
116
+ const t = l(a) || {}, o = e.target.value || "";
117
+ let u = W(o, ",", ",", n.maxNum);
118
+ if (o !== u) {
116
119
  const h = (y = (v = f.value) == null ? void 0 : v.$el) == null ? void 0 : y.querySelector("input");
117
- h && (h.value = r);
120
+ h && (h.value = u);
118
121
  }
119
- let s = r.split(",");
122
+ let s = u.split(",");
120
123
  s.length === 1 && s[0] === "" && (s = []), p({
121
124
  ...t,
122
125
  value: s
123
126
  });
124
127
  }
125
- function z(e) {
126
- const t = n(a) || {};
128
+ function _(e) {
129
+ const t = l(a) || {};
127
130
  let o = e.split(/,|\n/);
128
131
  p({
129
132
  ...t,
130
133
  value: o
131
134
  });
132
135
  }
133
- function m() {
136
+ function d() {
134
137
  var o;
135
- const e = n(a) || {}, t = (o = e.value) == null ? void 0 : o.filter(Boolean);
138
+ const e = l(a) || {}, t = (o = e.value) == null ? void 0 : o.filter(Boolean);
136
139
  p({
137
140
  ...e,
138
141
  value: t
139
142
  });
140
143
  }
141
- function T(e) {
144
+ function z(e) {
142
145
  var t;
143
- m(), (t = l.onBlur) == null || t.call(l, e);
146
+ d(), (t = n.onBlur) == null || t.call(n, e);
144
147
  }
145
148
  return (e, t) => (B(), $("div", {
146
149
  ref_key: "containerRef",
147
150
  ref: i,
148
- class: K(n(U)()),
149
- style: b(n(w)(P.value)),
151
+ class: K(l(U)()),
152
+ style: b(l(w)(P.value)),
150
153
  onFocus: t[0] || (t[0] = //@ts-ignore
151
154
  (...o) => e.onFocus && e.onFocus(...o)),
152
155
  onBlur: t[1] || (t[1] = //@ts-ignore
153
156
  (...o) => e.onBlur && e.onBlur(...o))
154
157
  }, [
155
- c(n(q).Compact, { block: "" }, {
158
+ c(l(q).Compact, { block: "" }, {
156
159
  default: A(() => {
157
160
  var o;
158
161
  return [
159
- (o = e.options) != null && o.length ? (B(), M(n(ee), {
162
+ (o = e.options) != null && o.length ? (B(), M(l(te), {
160
163
  key: 0,
161
164
  style: b(e.style),
162
165
  options: k.value,
@@ -167,8 +170,8 @@ const d = "GROUP_SEARCH_ALL", ge = /* @__PURE__ */ N({
167
170
  "get-popup-container": () => i.value,
168
171
  "onUpdate:value": L
169
172
  }, null, 8, ["style", "options", "value", "disabled", "get-popup-container"])) : D("", !0),
170
- c(n(te), G(
171
- n(Y)(l, [
173
+ c(l(oe), G(
174
+ l(Y)(n, [
172
175
  "style",
173
176
  "value",
174
177
  "onUpdate:value",
@@ -181,21 +184,22 @@ const d = "GROUP_SEARCH_ALL", ge = /* @__PURE__ */ N({
181
184
  ref_key: "inputRef",
182
185
  ref: f,
183
186
  style: e.inputStyle,
184
- value: _.value,
187
+ value: N.value,
185
188
  placeholder: F.value,
186
189
  onInput: O,
187
- onBlur: T
190
+ onBlur: z
188
191
  }
189
192
  ), {
190
193
  suffix: A(() => [
191
- c(oe, {
194
+ c(ne, {
192
195
  _parent: i.value,
193
196
  value: j.value,
194
197
  disabled: e.disabled,
195
- placement: l.popoverPlacement,
196
- "onUpdate:value": z,
197
- onClose: m
198
- }, null, 8, ["_parent", "value", "disabled", "placement"])
198
+ placement: n.popoverPlacement,
199
+ "max-num": e.maxNum,
200
+ "onUpdate:value": _,
201
+ onClose: d
202
+ }, null, 8, ["_parent", "value", "disabled", "placement", "max-num"])
199
203
  ]),
200
204
  _: 1
201
205
  }, 16, ["style", "value", "placeholder"])
@@ -207,5 +211,5 @@ const d = "GROUP_SEARCH_ALL", ge = /* @__PURE__ */ N({
207
211
  }
208
212
  });
209
213
  export {
210
- ge as default
214
+ be as default
211
215
  };
@@ -32,11 +32,16 @@ export interface BatchInputGroupProps extends Omit<ApFieldTextProps, 'value' | '
32
32
  * 设置弹出层弹出的位置,默认为`left`
33
33
  */
34
34
  popoverPlacement?: 'left' | 'right' | number;
35
+ /**
36
+ * 最大输入条数,默认为200
37
+ */
38
+ maxNum?: number;
35
39
  }
36
40
  export interface BatchInputGroupPopoverInputProps extends Pick<ApFieldTextAreaProps, 'value' | 'onUpdate:value'> {
37
41
  _parent?: HTMLElement;
38
42
  onClose?: () => void;
39
43
  disabled?: boolean;
44
+ maxNum?: number;
40
45
  }
41
46
  export type ApFormItemBatchInputProps = ApFormItemProps & {
42
47
  field?: Omit<BatchInputGroupProps, 'value' | 'onUpdate:value'>;
@@ -1,71 +1,75 @@
1
- import { defineComponent as A, ref as m, createElementBlock as w, openBlock as B, normalizeClass as p, unref as e, createVNode as c, withCtx as d, createElementVNode as L } from "vue";
2
- import { Popover as N, Textarea as P } from "@aplus-frontend/antdv";
1
+ import { defineComponent as k, ref as m, createElementBlock as A, openBlock as w, normalizeClass as p, unref as e, createVNode as u, withCtx as f, createElementVNode as B } from "vue";
2
+ import { Popover as L, Textarea as P } from "@aplus-frontend/antdv";
3
3
  import "../../../config-provider/index.mjs";
4
4
  import { IconApAdLineScreen as z } from "@aplus-frontend/icon";
5
5
  import "../../../hooks/index.mjs";
6
- import { useControllableValue as E } from "../../../hooks/useControllableValue.mjs";
7
- import { useLocale as F } from "../../../config-provider/hooks/use-locale.mjs";
8
- import { useNamespace as O } from "../../../config-provider/hooks/use-namespace.mjs";
9
- const D = /* @__PURE__ */ A({
6
+ import { splitValue as E } from "../utils.mjs";
7
+ import { useControllableValue as F } from "../../../hooks/useControllableValue.mjs";
8
+ import { useLocale as O } from "../../../config-provider/hooks/use-locale.mjs";
9
+ import { useNamespace as R } from "../../../config-provider/hooks/use-namespace.mjs";
10
+ const J = /* @__PURE__ */ k({
10
11
  __name: "index",
11
12
  props: {
12
13
  _parent: {},
13
14
  onClose: { type: Function },
14
15
  disabled: { type: Boolean },
16
+ maxNum: {},
15
17
  value: {},
16
18
  "onUpdate:value": { type: Function }
17
19
  },
18
20
  emits: ["update:value"],
19
- setup(f, { emit: v }) {
20
- const o = f, g = v, { value: b, updateValue: h } = E(o, g), n = m(!1), l = m(), C = (t) => o._parent || t, { t: _ } = F();
21
- function x(t) {
22
- var s;
23
- const a = t.target.value || "", r = a.replace(/[\n,]+/g, `
24
- `);
21
+ setup(d, { emit: v }) {
22
+ const o = d, g = v, { value: b, updateValue: h } = F(o, g), n = m(!1), l = m(), x = (t) => o._parent || t, { t: C } = O();
23
+ function _(t) {
24
+ var c;
25
+ const a = t.target.value || "";
26
+ let r = E(a, `
27
+ ,`, `
28
+ `, o.maxNum);
25
29
  if (r !== a) {
26
- const i = ((s = l.value) == null ? void 0 : s.$el) || l.value;
30
+ const i = ((c = l.value) == null ? void 0 : c.$el) || l.value;
27
31
  i && (i.value = r);
28
32
  }
29
33
  h(r);
30
34
  }
31
- function y(t) {
35
+ function V(t) {
32
36
  var a;
33
37
  o.disabled ? n.value = !1 : n.value = t, !t && ((a = o.onClose) == null || a.call(o));
34
38
  }
35
- const { b: u, e: I, em: V, bm: k } = O("batch-input-group-popover-input");
36
- return (t, a) => (B(), w("div", {
37
- class: p(e(u)())
39
+ const { b: s, e: y, em: I, bm: N } = R("batch-input-group-popover-input");
40
+ return (t, a) => (w(), A("div", {
41
+ class: p(e(s)())
38
42
  }, [
39
- c(e(N), {
40
- "overlay-class-name": e(I)("popover"),
41
- "get-popup-container": C,
43
+ u(e(L), {
44
+ "overlay-class-name": e(y)("popover"),
45
+ "get-popup-container": x,
42
46
  trigger: "click",
43
47
  placement: "bottomLeft",
44
48
  open: n.value,
45
- onOpenChange: y
49
+ onOpenChange: V
46
50
  }, {
47
- content: d(() => [
48
- L("div", {
49
- class: p(e(V)("popover", "content"))
51
+ content: f(() => [
52
+ B("div", {
53
+ class: p(e(I)("popover", "content"))
50
54
  }, [
51
- c(e(P), {
55
+ u(e(P), {
52
56
  ref_key: "textAreaRef",
53
57
  ref: l,
54
- placeholder: e(_)("ap.batchInputGroup.popoverInputPlaceholder"),
58
+ placeholder: e(C)("ap.batchInputGroup.popoverInputPlaceholder"),
55
59
  bordered: !1,
56
60
  rows: 10,
57
61
  value: e(b),
58
62
  "allow-clear": !1,
59
63
  "auto-size": !1,
60
- onInput: x
64
+ onInput: _
61
65
  }, null, 8, ["placeholder", "value"])
62
66
  ], 2)
63
67
  ]),
64
- default: d(() => [
65
- c(e(z), {
68
+ default: f(() => [
69
+ u(e(z), {
66
70
  class: p([
67
- e(u)("trigger-icon"),
68
- t.disabled ? e(k)("trigger-icon", "disabled") : null
71
+ e(s)("trigger-icon"),
72
+ t.disabled ? e(N)("trigger-icon", "disabled") : null
69
73
  ])
70
74
  }, null, 8, ["class"])
71
75
  ]),
@@ -75,5 +79,5 @@ const D = /* @__PURE__ */ A({
75
79
  }
76
80
  });
77
81
  export {
78
- D as default
82
+ J as default
79
83
  };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 输入信息格式分割处理
3
+ * @param inputValue
4
+ * @param spliter
5
+ * @param max
6
+ * @returns
7
+ */
8
+ export declare const splitValue: (inputValue: string, reg: string, spliter: string, max?: number) => string;
@@ -0,0 +1,10 @@
1
+ const u = (o, l, e, t = 200) => {
2
+ const n = o.replace(
3
+ new RegExp(`[${l}]+`, "g"),
4
+ e
5
+ ), r = n.split(e);
6
+ return r.length > t ? r.slice(0, t).join(e) : n;
7
+ };
8
+ export {
9
+ u as splitValue
10
+ };