@aplus-frontend/ui 0.2.16 → 0.2.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- import { ref as P, nextTick as at, unref as o, onMounted as ot, computed as V, createVNode as b } from "vue";
2
- import { parseFieldValue as nt, dataIndexToStr as rt, isEqualCustom as st } from "../utils.mjs";
3
- import { isArray as q, isEqualWith as it } from "lodash-unified";
1
+ import { ref as P, nextTick as ae, unref as o, onMounted as oe, computed as V, createVNode as b } from "vue";
2
+ import { parseFieldValue as re, dataIndexToStr as ne, isEqualCustom as se } from "../utils.mjs";
3
+ import { isArray as q, isEqualWith as ie } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
5
- import { useTableSortedAndFiltered as lt } from "./use-sorted-filtered.mjs";
6
- import { useLocale as ct } from "../../config-provider/hooks/use-locale.mjs";
7
- import { useNamespace as ut } from "../../config-provider/hooks/use-namespace.mjs";
8
- const Ft = ({
5
+ import { useTableSortedAndFiltered as le } from "./use-sorted-filtered.mjs";
6
+ import { useLocale as ce } from "../../config-provider/hooks/use-locale.mjs";
7
+ import { useNamespace as ue } from "../../config-provider/hooks/use-namespace.mjs";
8
+ const Te = ({
9
9
  manual: B = !1,
10
10
  defaultCurrent: K = 1,
11
11
  defaultPageSize: y = 10,
@@ -21,63 +21,63 @@ const Ft = ({
21
21
  showTotal: Q = !0
22
22
  }) => {
23
23
  let C = 0, s = {};
24
- const W = (t) => w ? w(t) : t, u = P(), c = P(K), p = P(y), {
24
+ const W = (e) => w ? w(e) : e, u = P(), c = P(K), p = P(y), {
25
25
  getColumnSFConfig: G,
26
26
  setSF: H,
27
27
  clearAll: U
28
- } = lt(), {
29
- t: F
30
- } = ct(), {
31
- b: S
32
- } = ut("ap-table"), n = P({
28
+ } = le(), {
29
+ t: T
30
+ } = ce(), {
31
+ b: F
32
+ } = ue("ap-table"), r = P({
33
33
  total: 0,
34
34
  records: $,
35
35
  loading: !1
36
- }), E = async (t) => {
37
- var r;
38
- const a = W(t), e = Date.now();
39
- C = e, n.value.loading = !0;
36
+ }), E = async (e) => {
37
+ var n;
38
+ const a = W(e), t = Date.now();
39
+ C = t, r.value.loading = !0;
40
40
  try {
41
41
  const i = await M({
42
42
  ...N,
43
43
  ...a
44
44
  });
45
- C === e && (n.value.total = i.total || ((r = i.data) == null ? void 0 : r.length) || 0, n.value.records = [...i.data || []]);
45
+ C === t && (r.value.total = i.total || ((n = i.data) == null ? void 0 : n.length) || 0, r.value.records = [...i.data || []]);
46
46
  } catch {
47
- C === e && (n.value.records = [], n.value.total = 0);
47
+ C === t && (r.value.records = [], r.value.total = 0);
48
48
  } finally {
49
- n.value.loading = !1;
49
+ r.value.loading = !1;
50
50
  }
51
- }, O = (t) => {
51
+ }, O = (e) => {
52
52
  const a = {};
53
- return Object.entries(t).forEach(([e, r]) => {
54
- if (a[e] = r, A && r) {
55
- const i = A[e];
56
- i && (a[e] = nt(i, r));
53
+ return Object.entries(e).forEach(([t, n]) => {
54
+ if (a[t] = n, A && n) {
55
+ const i = A[t];
56
+ i && (a[t] = re(i, n));
57
57
  }
58
58
  }), a;
59
- }, X = async (t) => {
60
- var r, i, g, d, m, f, h;
61
- const a = ((i = (r = u.value) == null ? void 0 : r.apForm) == null ? void 0 : i.getFieldsValue()) || {}, e = {};
59
+ }, X = async (e) => {
60
+ var n, i, g, d, m, f, h;
61
+ const a = ((i = (n = u.value) == null ? void 0 : n.apForm) == null ? void 0 : i.getFieldsValueTransformed(!0)) || {}, t = {};
62
62
  Object.entries(a).forEach(([v, x]) => {
63
- D && D.indexOf(v) > -1 && (e[v] = x);
64
- }), await ((d = (g = u.value) == null ? void 0 : g.apForm) == null ? void 0 : d.resetFields()), (h = (f = (m = u.value) == null ? void 0 : m.apForm) == null ? void 0 : f.setFieldsValue) == null || h.call(f, e), at(() => {
65
- t == null || t();
63
+ D && D.indexOf(v) > -1 && (t[v] = x);
64
+ }), await ((d = (g = u.value) == null ? void 0 : g.apForm) == null ? void 0 : d.resetFields()), (h = (f = (m = u.value) == null ? void 0 : m.apForm) == null ? void 0 : f.setFieldsValue) == null || h.call(f, t), ae(() => {
65
+ e == null || e();
66
66
  });
67
- }, T = (t) => {
68
- s = t;
69
- const a = O(t);
67
+ }, S = (e) => {
68
+ s = e;
69
+ const a = O(e);
70
70
  E(a);
71
- }, Y = (t) => {
72
- T({
71
+ }, Y = (e) => {
72
+ S({
73
73
  ...s,
74
- ...t
74
+ ...e
75
75
  });
76
76
  }, R = () => {
77
- var a, e;
78
- const t = ((e = (a = u.value) == null ? void 0 : a.apForm) == null ? void 0 : e.getFieldsValue(!0)) || {};
79
- c.value = 1, T({
80
- ...t,
77
+ var a, t;
78
+ const e = ((t = (a = u.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValueTransformed(!0)) || {};
79
+ c.value = 1, S({
80
+ ...e,
81
81
  filter: s.filter,
82
82
  sort: s.sort,
83
83
  current: 1,
@@ -86,71 +86,71 @@ const Ft = ({
86
86
  }, Z = () => {
87
87
  U(), s.sort = {}, s.filter = {}, X(R);
88
88
  }, _ = () => {
89
- T(s);
90
- }, I = (t) => {
91
- const a = o(n).total - t, e = Math.ceil(a / o(p)), r = o(c) > e ? e : o(c);
89
+ S(s);
90
+ }, I = (e) => {
91
+ const a = o(r).total - e, t = Math.ceil(a / o(p)), n = o(c) > t ? t : o(c);
92
92
  Y({
93
- current: r > 0 ? r : 1
93
+ current: n > 0 ? n : 1
94
94
  });
95
- }, j = (t, a, e) => {
95
+ }, j = (e, a, t) => {
96
96
  var f, h, v, x;
97
- const r = ((h = (f = u.value) == null ? void 0 : f.apForm) == null ? void 0 : h.getFieldsValue(!0)) || {};
98
- c.value = t.current, p.value = t.pageSize, H(a, e);
99
- const i = q(e) ? [...e] : [e], g = {};
97
+ const n = ((h = (f = u.value) == null ? void 0 : f.apForm) == null ? void 0 : h.getFieldsValueTransformed(!0)) || {};
98
+ c.value = e.current, p.value = e.pageSize, H(a, t);
99
+ const i = q(t) ? [...t] : [t], g = {};
100
100
  for (const l of i)
101
- (v = o(L)) != null && v.includes(l.columnKey || l.field) && (g[rt(l.columnKey || l.field)] = l.order);
101
+ (v = o(L)) != null && v.includes(l.columnKey || l.field) && (g[ne(l.columnKey || l.field)] = l.order);
102
102
  const d = {};
103
103
  for (const l of Object.keys(a))
104
104
  (x = o(J)) != null && x.includes(l) && (d[l] = a[l]);
105
105
  const m = {
106
- ...r,
106
+ ...n,
107
107
  filter: d,
108
108
  sort: g,
109
- current: t.current,
110
- pageSize: t.pageSize
109
+ current: e.current,
110
+ pageSize: e.pageSize
111
111
  };
112
- it(s, m, st) || T(m);
112
+ ie(s, m, se) || S(m);
113
113
  };
114
- ot(() => {
115
- var a, e;
116
- const t = ((e = (a = u.value) == null ? void 0 : a.apForm) == null ? void 0 : e.getFieldsValue(!0)) || {};
114
+ oe(() => {
115
+ var a, t;
116
+ const e = ((t = (a = u.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValueTransformed(!0)) || {};
117
117
  if (s = {
118
118
  current: o(c),
119
119
  pageSize: o(p),
120
120
  filter: {},
121
121
  sort: {},
122
- ...t
122
+ ...e
123
123
  }, !B) {
124
- const r = O(s);
125
- E(r);
124
+ const n = O(s);
125
+ E(n);
126
126
  }
127
127
  });
128
- const k = V(() => o(n).total === 0 ? "-" : `${o(c.value)}/${Math.ceil(o(n).total / o(p))}`);
129
- function tt(t) {
130
- q(t) && (n.value.records = t, n.value.total = t.length);
128
+ const k = V(() => o(r).total === 0 ? "-" : `${o(c.value)}/${Math.ceil(o(r).total / o(p))}`);
129
+ function ee(e) {
130
+ q(e) && (r.value.records = e, r.value.total = e.length);
131
131
  }
132
- const et = V(() => ({
133
- loading: o(n).loading,
132
+ const te = V(() => ({
133
+ loading: o(r).loading,
134
134
  pagination: {
135
135
  current: o(c),
136
136
  pageSize: o(p),
137
- total: o(n).total,
137
+ total: o(r).total,
138
138
  showSizeChanger: !z,
139
139
  showQuickJumper: !z,
140
140
  showLessItems: z,
141
141
  size: "default",
142
- showTotal: Q ? (t) => b("span", {
143
- class: S("pagination-total-wrapper")
144
- }, [F("ap.apTable.pagination.totalLeftPrefix"), " ", b("span", {
145
- class: S("pagination-count-text")
146
- }, [t]), " ", F("ap.apTable.pagination.totalLeftSuffix"), b("span", {
147
- class: S("pagination--total-right")
148
- }, [F("ap.apTable.pagination.totalRightPrefix"), " ", b("span", {
149
- class: S("pagination-count-text")
150
- }, [o(k)]), " ", F("ap.apTable.pagination.totalRightSuffix")])]) : void 0
142
+ showTotal: Q ? (e) => b("span", {
143
+ class: F("pagination-total-wrapper")
144
+ }, [T("ap.apTable.pagination.totalLeftPrefix"), " ", b("span", {
145
+ class: F("pagination-count-text")
146
+ }, [e]), " ", T("ap.apTable.pagination.totalLeftSuffix"), b("span", {
147
+ class: F("pagination--total-right")
148
+ }, [T("ap.apTable.pagination.totalRightPrefix"), " ", b("span", {
149
+ class: F("pagination-count-text")
150
+ }, [o(k)]), " ", T("ap.apTable.pagination.totalRightSuffix")])]) : void 0
151
151
  },
152
152
  onChange: j,
153
- dataSource: o(n).records
153
+ dataSource: o(r).records
154
154
  }));
155
155
  return {
156
156
  formRef: u,
@@ -158,16 +158,16 @@ const Ft = ({
158
158
  reset: Z,
159
159
  refresh: _,
160
160
  refreshByDelete: I,
161
- data: n,
161
+ data: r,
162
162
  current: c,
163
163
  pageSize: p,
164
164
  handleTableChange: j,
165
- tableProps: et,
166
- dataSource: V(() => o(n).records),
167
- setDataSource: tt,
165
+ tableProps: te,
166
+ dataSource: V(() => o(r).records),
167
+ setDataSource: ee,
168
168
  getColumnSFConfig: G
169
169
  };
170
170
  };
171
171
  export {
172
- Ft as useTablePaging
172
+ Te as useTablePaging
173
173
  };
@@ -1,67 +1,83 @@
1
- import { defineComponent as A, useSlots as B, computed as _, ref as S, watch as C, openBlock as f, createElementBlock as h, normalizeClass as d, unref as t, renderSlot as p, createCommentVNode as b, createElementVNode as a, createTextVNode as m, toDisplayString as c, createVNode as k, withCtx as N } from "vue";
2
- import { Button as g } from "@aplus-frontend/antdv";
1
+ import { defineComponent as k, useSlots as N, computed as V, ref as $, watch as x, openBlock as d, createElementBlock as C, normalizeClass as v, unref as c, renderSlot as A, createCommentVNode as P, createElementVNode as u, createTextVNode as S, toDisplayString as m, createVNode as D, withCtx as E } from "vue";
2
+ import { Button as K } from "@aplus-frontend/antdv";
3
3
  import "../../config-provider/index.mjs";
4
- import { useNamespace as w } from "../../config-provider/hooks/use-namespace.mjs";
5
- import { useLocale as V } from "../../config-provider/hooks/use-locale.mjs";
6
- const $ = { class: "selected-desc" }, x = { class: "selected-desc-conut" }, D = { class: "selected-desc-clean" }, H = /* @__PURE__ */ A({
4
+ import { usePermission as L } from "@aplus-frontend/hooks";
5
+ import { useNamespace as R } from "../../config-provider/hooks/use-namespace.mjs";
6
+ import { useLocale as z } from "../../config-provider/hooks/use-locale.mjs";
7
+ const F = { class: "selected-desc" }, H = { class: "selected-desc-conut" }, O = { class: "selected-desc-clean" }, M = /* @__PURE__ */ k({
7
8
  __name: "ApBatchAction",
8
9
  props: {
9
10
  selectedRowKeys: {},
10
11
  clearAll: { type: Function }
11
12
  },
12
- setup(y) {
13
- const { b: l } = w("ap-batch-action"), { t: r } = V(), n = y, o = B(), v = _(() => {
14
- var e;
15
- return ((e = n.selectedRowKeys) == null ? void 0 : e.length) || 0;
16
- }), u = S(!1);
17
- return C(
18
- () => o.header,
13
+ setup(b) {
14
+ const { b: f } = R("ap-batch-action"), { t: h } = z(), y = b, { hasPermission: w } = L(), l = N(), g = V(() => {
15
+ var s;
16
+ return ((s = y.selectedRowKeys) == null ? void 0 : s.length) || 0;
17
+ }), B = $(!1);
18
+ return x(
19
+ () => l.header,
19
20
  () => {
20
- var s;
21
- const e = (s = o == null ? void 0 : o.header) == null ? void 0 : s.call(o);
22
- u.value = Array.isArray(e) && e.filter(Boolean).filter(
23
- (i) => i.type !== Symbol.for("v-cmt") && i.type !== Symbol.for("v-fgt")
24
- ).length > 0;
21
+ var p;
22
+ const s = (p = l == null ? void 0 : l.header) == null ? void 0 : p.call(l);
23
+ B.value = Array.isArray(s) && s.filter(Boolean).filter(
24
+ (t) => (
25
+ // 兼容 v-if 和 空标签
26
+ t.type !== Symbol.for("v-cmt") && t.type !== Symbol.for("v-fgt")
27
+ )
28
+ ).filter((t) => {
29
+ var i, e, a, _;
30
+ const o = ((i = t == null ? void 0 : t.props) == null ? void 0 : i["if-show"]) ?? ((e = t == null ? void 0 : t.props) == null ? void 0 : e.ifShow), n = (a = t == null ? void 0 : t.props) == null ? void 0 : a.auth;
31
+ let r = o;
32
+ return !((_ = t == null ? void 0 : t.props) != null && _.ifShow) && n && (r = () => w(n)), (r == null ? void 0 : r()) ?? !0;
33
+ }).filter((t) => {
34
+ var r, i;
35
+ const o = ((r = t == null ? void 0 : t.props) == null ? void 0 : r["menu-list"]) ?? ((i = t == null ? void 0 : t.props) == null ? void 0 : i.menuList), n = (o == null ? void 0 : o.filter((e) => {
36
+ let a = e == null ? void 0 : e.ifShow;
37
+ return !(e != null && e.ifShow) && (e != null && e.auth) && (a = () => w(e.auth)), (a == null ? void 0 : a()) ?? !0;
38
+ })) || [];
39
+ return o === void 0 ? !0 : n.length > 0;
40
+ }).length > 0;
25
41
  },
26
42
  {
27
43
  immediate: !0
28
44
  }
29
- ), (e, s) => (f(), h("div", {
30
- class: d([t(l)()])
45
+ ), (s, p) => (d(), C("div", {
46
+ class: v([c(f)()])
31
47
  }, [
32
- u.value ? (f(), h("div", {
48
+ B.value ? (d(), C("div", {
33
49
  key: 0,
34
- class: d(t(l)("header"))
50
+ class: v(c(f)("header"))
35
51
  }, [
36
- p(e.$slots, "header")
37
- ], 2)) : b("", !0),
38
- a("div", {
39
- class: d(t(l)("body"))
52
+ A(s.$slots, "header")
53
+ ], 2)) : P("", !0),
54
+ u("div", {
55
+ class: v(c(f)("body"))
40
56
  }, [
41
- p(e.$slots, "prefix"),
42
- a("div", $, [
43
- a("div", x, [
44
- m(c(t(r)("ap.apBatchAction.selected")) + " ", 1),
45
- a("span", null, c(v.value), 1),
46
- m(" " + c(t(r)("ap.apBatchAction.piecesOfData")), 1)
57
+ A(s.$slots, "prefix"),
58
+ u("div", F, [
59
+ u("div", H, [
60
+ S(m(c(h)("ap.apBatchAction.selected")) + " ", 1),
61
+ u("span", null, m(g.value), 1),
62
+ S(" " + m(c(h)("ap.apBatchAction.piecesOfData")), 1)
47
63
  ]),
48
- a("div", D, [
49
- k(t(g), {
64
+ u("div", O, [
65
+ D(c(K), {
50
66
  type: "link",
51
- onClick: s[0] || (s[0] = (i) => n.clearAll && n.clearAll())
67
+ onClick: p[0] || (p[0] = (t) => y.clearAll && y.clearAll())
52
68
  }, {
53
- default: N(() => [
54
- m(c(t(r)("ap.apBatchAction.empty")), 1)
69
+ default: E(() => [
70
+ S(m(c(h)("ap.apBatchAction.empty")), 1)
55
71
  ]),
56
72
  _: 1
57
73
  })
58
74
  ])
59
75
  ]),
60
- p(e.$slots, "suffix")
76
+ A(s.$slots, "suffix")
61
77
  ], 2)
62
78
  ], 2));
63
79
  }
64
80
  });
65
81
  export {
66
- H as default
82
+ M as default
67
83
  };
@@ -1,17 +1,18 @@
1
- import { defineComponent as k, ref as I, computed as r, unref as l, openBlock as d, createElementBlock as E, createVNode as p, withCtx as m, createBlock as L, normalizeStyle as O, createCommentVNode as j, mergeProps as w } from "vue";
1
+ import { defineComponent as P, ref as g, computed as u, unref as o, openBlock as B, createElementBlock as T, createVNode as s, withCtx as A, createBlock as z, normalizeStyle as F, createCommentVNode as K, mergeProps as $ } from "vue";
2
2
  import "../../ap-field/index.mjs";
3
- import { Space as R } from "@aplus-frontend/antdv";
3
+ import { Space as D } from "@aplus-frontend/antdv";
4
4
  import "../../config-provider/index.mjs";
5
- import { omit as z } from "lodash-unified";
5
+ import { omit as G } from "lodash-unified";
6
6
  import "./popover-input/index.vue.mjs";
7
7
  import "../../hooks/index.mjs";
8
- import { isDef as T } from "../../utils/index.mjs";
9
- import { useControllableValue as F } from "../../hooks/useControllableValue.mjs";
10
- import { useLocale as K } from "../../config-provider/hooks/use-locale.mjs";
11
- import P from "../../ap-field/select/index.vue.mjs";
12
- import { ApFieldText as G } from "../../ap-field/text/index.mjs";
13
- import N from "./popover-input/index.vue2.mjs";
14
- const s = "GROUP_SEARCH_ALL", oe = /* @__PURE__ */ k({
8
+ import { isDef as N } from "../../utils/index.mjs";
9
+ import { useDefaultPlaceholder as q } from "../../ap-field/hooks/use-default-placeholder.mjs";
10
+ import { useControllableValue as H } from "../../hooks/useControllableValue.mjs";
11
+ import { useLocale as M } from "../../config-provider/hooks/use-locale.mjs";
12
+ import Y from "../../ap-field/select/index.vue.mjs";
13
+ import { ApFieldText as J } from "../../ap-field/text/index.mjs";
14
+ import Q from "./popover-input/index.vue2.mjs";
15
+ const c = "GROUP_SEARCH_ALL", ce = /* @__PURE__ */ P({
15
16
  __name: "index",
16
17
  props: {
17
18
  style: { type: [Boolean, null, String, Object, Array] },
@@ -64,83 +65,91 @@ const s = "GROUP_SEARCH_ALL", oe = /* @__PURE__ */ k({
64
65
  emptyText: { default: "--" }
65
66
  },
66
67
  emits: ["update:value"],
67
- setup(v, { emit: y }) {
68
- const n = v, h = y, { value: a, updateValue: u } = F(
68
+ setup(_, { emit: V }) {
69
+ const n = _, x = q("Text", n), C = V, { value: a, updateValue: i } = H(
69
70
  n,
70
- h
71
- ), c = I(), { t: B } = K(), g = r(() => n.options ? n.options.length > 1 && n.hasAll ? [
72
- { value: s, label: B("ap.apGroupSearch.all") },
71
+ C
72
+ ), f = g(), d = g(), { t: S } = M(), b = u(() => n.options ? n.options.length > 1 && n.hasAll ? [
73
+ { value: c, label: S("ap.apGroupSearch.all") },
73
74
  ...n.options
74
- ] : n.options : []), A = r(() => n.options ? n.options.map((e) => e.value) : []), _ = r(() => {
75
+ ] : n.options : []), I = u(() => n.options ? n.options.map((e) => e.value) : []), U = u(() => {
75
76
  var e, t;
76
- return (t = (e = l(a)) == null ? void 0 : e.value) != null && t.length ? l(a).value.join(",") : "";
77
- }), C = r(() => {
77
+ return (t = (e = o(a)) == null ? void 0 : e.value) != null && t.length ? o(a).value.join(",") : "";
78
+ }), k = u(() => {
78
79
  var e, t;
79
- return (t = (e = l(a)) == null ? void 0 : e.value) != null && t.length ? l(a).value.join(`
80
+ return (t = (e = o(a)) == null ? void 0 : e.value) != null && t.length ? o(a).value.join(`
80
81
  `) : "";
81
- }), x = r(() => {
82
+ }), w = u(() => {
82
83
  var t;
83
- const e = (t = l(a)) == null ? void 0 : t.key;
84
+ const e = (t = o(a)) == null ? void 0 : t.key;
84
85
  if (e != null && e.length)
85
- return e.length === 1 ? e[0] : s;
86
+ return e.length === 1 ? e[0] : c;
87
+ }), R = u(() => {
88
+ var l;
89
+ const e = (l = o(a)) == null ? void 0 : l.key;
90
+ return !e || (e == null ? void 0 : e.length) <= 1 ? o(x) : (n.options || []).filter((r) => e.includes(r.value)).map((r) => r.label).join("/");
86
91
  });
87
- function S(e) {
88
- const t = l(a) || {}, o = e === s ? l(A) : T(e) ? [e] : [];
89
- u({
92
+ function j(e) {
93
+ const t = o(a) || {}, l = e === c ? o(I) : N(e) ? [e] : [];
94
+ i({
90
95
  ...t,
91
- key: o
96
+ key: l
92
97
  });
93
98
  }
94
- function V(e) {
95
- const t = l(a) || {};
96
- let o = e;
97
- for (; o.startsWith(","); )
98
- o = o.slice(1);
99
- let i = o.replaceAll(",,", ",").split(",");
100
- i.length === 1 && i[0] === "" && (i = []), u({
99
+ function E(e) {
100
+ var v, y;
101
+ const t = o(a) || {}, l = e.target.value || "", r = l.replace(/[,]+/g, ",");
102
+ if (l !== r) {
103
+ const h = (y = (v = d.value) == null ? void 0 : v.$el) == null ? void 0 : y.querySelector("input");
104
+ h && (h.value = r);
105
+ }
106
+ let p = r.split(",");
107
+ p.length === 1 && p[0] === "" && (p = []), i({
101
108
  ...t,
102
- value: i
109
+ value: p
103
110
  });
104
111
  }
105
- function U(e) {
106
- const t = l(a) || {};
107
- let o = e.split(/,|\n/);
108
- u({
112
+ function L(e) {
113
+ const t = o(a) || {};
114
+ let l = e.split(/,|\n/);
115
+ i({
109
116
  ...t,
110
- value: o
117
+ value: l
111
118
  });
112
119
  }
113
- function f() {
114
- var o;
115
- const e = l(a) || {}, t = (o = e.value) == null ? void 0 : o.filter(Boolean);
116
- u({
120
+ function m() {
121
+ var l;
122
+ const e = o(a) || {}, t = (l = e.value) == null ? void 0 : l.filter(Boolean);
123
+ i({
117
124
  ...e,
118
125
  value: t
119
126
  });
120
127
  }
121
- function b(e) {
128
+ function O(e) {
122
129
  var t;
123
- f(), (t = n.onBlur) == null || t.call(n, e);
130
+ m(), (t = n.onBlur) == null || t.call(n, e);
124
131
  }
125
- return (e, t) => (d(), E("div", {
132
+ return (e, t) => (B(), T("div", {
126
133
  ref_key: "containerRef",
127
- ref: c,
134
+ ref: f,
128
135
  style: { position: "relative" }
129
136
  }, [
130
- p(l(R).Compact, { block: "" }, {
131
- default: m(() => {
132
- var o;
137
+ s(o(D).Compact, { block: "" }, {
138
+ default: A(() => {
139
+ var l;
133
140
  return [
134
- (o = e.options) != null && o.length ? (d(), L(l(P), {
141
+ (l = e.options) != null && l.length ? (B(), z(o(Y), {
135
142
  key: 0,
136
- style: O(e.style),
137
- options: g.value,
138
- value: x.value,
139
- "onUpdate:value": S
140
- }, null, 8, ["style", "options", "value"])) : j("", !0),
141
- p(l(G), w(
143
+ style: F(e.style),
144
+ options: b.value,
145
+ value: w.value,
146
+ "onUpdate:value": j,
147
+ "allow-clear": !1,
148
+ "dropdown-match-select-width": !1
149
+ }, null, 8, ["style", "options", "value"])) : K("", !0),
150
+ s(o(J), $(
142
151
  { style: e.inputStyle },
143
- l(z)(n, [
152
+ o(G)(n, [
144
153
  "style",
145
154
  "value",
146
155
  "onUpdate:value",
@@ -149,21 +158,24 @@ const s = "GROUP_SEARCH_ALL", oe = /* @__PURE__ */ k({
149
158
  "options"
150
159
  ]),
151
160
  {
152
- value: _.value,
153
- "onUpdate:value": V,
154
- onBlur: b
161
+ ref_key: "inputRef",
162
+ ref: d,
163
+ value: U.value,
164
+ onInput: E,
165
+ onBlur: O,
166
+ placeholder: R.value
155
167
  }
156
168
  ), {
157
- suffix: m(() => [
158
- p(N, {
159
- _parent: c.value,
160
- value: C.value,
161
- "onUpdate:value": U,
162
- onClose: f
169
+ suffix: A(() => [
170
+ s(Q, {
171
+ _parent: f.value,
172
+ value: k.value,
173
+ "onUpdate:value": L,
174
+ onClose: m
163
175
  }, null, 8, ["_parent", "value"])
164
176
  ]),
165
177
  _: 1
166
- }, 16, ["style", "value"])
178
+ }, 16, ["style", "value", "placeholder"])
167
179
  ];
168
180
  }),
169
181
  _: 1
@@ -172,5 +184,5 @@ const s = "GROUP_SEARCH_ALL", oe = /* @__PURE__ */ k({
172
184
  }
173
185
  });
174
186
  export {
175
- oe as default
187
+ ce as default
176
188
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),x=require("../utils.js"),V=require("lodash-unified");require("../../config-provider/index.js");const ee=require("./use-sorted-filtered.js"),te=require("../../config-provider/hooks/use-locale.js"),ae=require("../../config-provider/hooks/use-namespace.js"),re=({manual:D=!1,defaultCurrent:E=1,defaultPageSize:y=10,request:R,defaultParams:M={},defaultData:B=[],formatParams:z,paramsValueTypeMap:C,resetFieldsIgnores:N,filterFields:K,sortFields:L,showLessItems:P=!1,showTotal:$=!0})=>{let q=0,s={};const J=e=>z?z(e):e,c=t.ref(),l=t.ref(E),d=t.ref(y),{getColumnSFConfig:Q,setSF:U,clearAll:W}=ee.useTableSortedAndFiltered(),{t:S}=te.useLocale(),{b:F}=ae.useNamespace("ap-table"),n=t.ref({total:0,records:B,loading:!1}),w=async e=>{var o;const r=J(e),a=Date.now();q=a,n.value.loading=!0;try{const u=await R({...M,...r});q===a&&(n.value.total=u.total||((o=u.data)==null?void 0:o.length)||0,n.value.records=[...u.data||[]])}catch{q===a&&(n.value.records=[],n.value.total=0)}finally{n.value.loading=!1}},A=e=>{const r={};return Object.entries(e).forEach(([a,o])=>{if(r[a]=o,C&&o){const u=C[a];u&&(r[a]=x.parseFieldValue(u,o))}}),r},G=async e=>{var o,u,g,p,m,f,h;const r=((u=(o=c.value)==null?void 0:o.apForm)==null?void 0:u.getFieldsValue())||{},a={};Object.entries(r).forEach(([v,b])=>{N&&N.indexOf(v)>-1&&(a[v]=b)}),await((p=(g=c.value)==null?void 0:g.apForm)==null?void 0:p.resetFields()),(h=(f=(m=c.value)==null?void 0:m.apForm)==null?void 0:f.setFieldsValue)==null||h.call(f,a),t.nextTick(()=>{e==null||e()})},T=e=>{s=e;const r=A(e);w(r)},H=e=>{T({...s,...e})},O=()=>{var r,a;const e=((a=(r=c.value)==null?void 0:r.apForm)==null?void 0:a.getFieldsValue(!0))||{};l.value=1,T({...e,filter:s.filter,sort:s.sort,current:1,pageSize:s.pageSize||y})},X=()=>{W(),s.sort={},s.filter={},G(O)},Y=()=>{T(s)},Z=e=>{const r=t.unref(n).total-e,a=Math.ceil(r/t.unref(d)),o=t.unref(l)>a?a:t.unref(l);H({current:o>0?o:1})},j=(e,r,a)=>{var f,h,v,b;const o=((h=(f=c.value)==null?void 0:f.apForm)==null?void 0:h.getFieldsValue(!0))||{};l.value=e.current,d.value=e.pageSize,U(r,a);const u=V.isArray(a)?[...a]:[a],g={};for(const i of u)(v=t.unref(L))!=null&&v.includes(i.columnKey||i.field)&&(g[x.dataIndexToStr(i.columnKey||i.field)]=i.order);const p={};for(const i of Object.keys(r))(b=t.unref(K))!=null&&b.includes(i)&&(p[i]=r[i]);const m={...o,filter:p,sort:g,current:e.current,pageSize:e.pageSize};V.isEqualWith(s,m,x.isEqualCustom)||T(m)};t.onMounted(()=>{var r,a;const e=((a=(r=c.value)==null?void 0:r.apForm)==null?void 0:a.getFieldsValue(!0))||{};if(s={current:t.unref(l),pageSize:t.unref(d),filter:{},sort:{},...e},!D){const o=A(s);w(o)}});const _=t.computed(()=>t.unref(n).total===0?"-":`${t.unref(l.value)}/${Math.ceil(t.unref(n).total/t.unref(d))}`);function I(e){V.isArray(e)&&(n.value.records=e,n.value.total=e.length)}const k=t.computed(()=>({loading:t.unref(n).loading,pagination:{current:t.unref(l),pageSize:t.unref(d),total:t.unref(n).total,showSizeChanger:!P,showQuickJumper:!P,showLessItems:P,size:"default",showTotal:$?e=>t.createVNode("span",{class:F("pagination-total-wrapper")},[S("ap.apTable.pagination.totalLeftPrefix")," ",t.createVNode("span",{class:F("pagination-count-text")},[e])," ",S("ap.apTable.pagination.totalLeftSuffix"),t.createVNode("span",{class:F("pagination--total-right")},[S("ap.apTable.pagination.totalRightPrefix")," ",t.createVNode("span",{class:F("pagination-count-text")},[t.unref(_)])," ",S("ap.apTable.pagination.totalRightSuffix")])]):void 0},onChange:j,dataSource:t.unref(n).records}));return{formRef:c,submit:O,reset:X,refresh:Y,refreshByDelete:Z,data:n,current:l,pageSize:d,handleTableChange:j,tableProps:k,dataSource:t.computed(()=>t.unref(n).records),setDataSource:I,getColumnSFConfig:Q}};exports.useTablePaging=re;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),x=require("../utils.js"),V=require("lodash-unified");require("../../config-provider/index.js");const ee=require("./use-sorted-filtered.js"),te=require("../../config-provider/hooks/use-locale.js"),ae=require("../../config-provider/hooks/use-namespace.js"),re=({manual:D=!1,defaultCurrent:E=1,defaultPageSize:y=10,request:R,defaultParams:M={},defaultData:B=[],formatParams:z,paramsValueTypeMap:C,resetFieldsIgnores:N,filterFields:K,sortFields:L,showLessItems:P=!1,showTotal:$=!0})=>{let q=0,s={};const J=e=>z?z(e):e,c=t.ref(),l=t.ref(E),d=t.ref(y),{getColumnSFConfig:Q,setSF:U,clearAll:W}=ee.useTableSortedAndFiltered(),{t:S}=te.useLocale(),{b:T}=ae.useNamespace("ap-table"),n=t.ref({total:0,records:B,loading:!1}),w=async e=>{var o;const r=J(e),a=Date.now();q=a,n.value.loading=!0;try{const u=await R({...M,...r});q===a&&(n.value.total=u.total||((o=u.data)==null?void 0:o.length)||0,n.value.records=[...u.data||[]])}catch{q===a&&(n.value.records=[],n.value.total=0)}finally{n.value.loading=!1}},A=e=>{const r={};return Object.entries(e).forEach(([a,o])=>{if(r[a]=o,C&&o){const u=C[a];u&&(r[a]=x.parseFieldValue(u,o))}}),r},G=async e=>{var o,u,g,p,m,f,h;const r=((u=(o=c.value)==null?void 0:o.apForm)==null?void 0:u.getFieldsValueTransformed(!0))||{},a={};Object.entries(r).forEach(([v,b])=>{N&&N.indexOf(v)>-1&&(a[v]=b)}),await((p=(g=c.value)==null?void 0:g.apForm)==null?void 0:p.resetFields()),(h=(f=(m=c.value)==null?void 0:m.apForm)==null?void 0:f.setFieldsValue)==null||h.call(f,a),t.nextTick(()=>{e==null||e()})},F=e=>{s=e;const r=A(e);w(r)},H=e=>{F({...s,...e})},O=()=>{var r,a;const e=((a=(r=c.value)==null?void 0:r.apForm)==null?void 0:a.getFieldsValueTransformed(!0))||{};l.value=1,F({...e,filter:s.filter,sort:s.sort,current:1,pageSize:s.pageSize||y})},X=()=>{W(),s.sort={},s.filter={},G(O)},Y=()=>{F(s)},Z=e=>{const r=t.unref(n).total-e,a=Math.ceil(r/t.unref(d)),o=t.unref(l)>a?a:t.unref(l);H({current:o>0?o:1})},j=(e,r,a)=>{var f,h,v,b;const o=((h=(f=c.value)==null?void 0:f.apForm)==null?void 0:h.getFieldsValueTransformed(!0))||{};l.value=e.current,d.value=e.pageSize,U(r,a);const u=V.isArray(a)?[...a]:[a],g={};for(const i of u)(v=t.unref(L))!=null&&v.includes(i.columnKey||i.field)&&(g[x.dataIndexToStr(i.columnKey||i.field)]=i.order);const p={};for(const i of Object.keys(r))(b=t.unref(K))!=null&&b.includes(i)&&(p[i]=r[i]);const m={...o,filter:p,sort:g,current:e.current,pageSize:e.pageSize};V.isEqualWith(s,m,x.isEqualCustom)||F(m)};t.onMounted(()=>{var r,a;const e=((a=(r=c.value)==null?void 0:r.apForm)==null?void 0:a.getFieldsValueTransformed(!0))||{};if(s={current:t.unref(l),pageSize:t.unref(d),filter:{},sort:{},...e},!D){const o=A(s);w(o)}});const _=t.computed(()=>t.unref(n).total===0?"-":`${t.unref(l.value)}/${Math.ceil(t.unref(n).total/t.unref(d))}`);function I(e){V.isArray(e)&&(n.value.records=e,n.value.total=e.length)}const k=t.computed(()=>({loading:t.unref(n).loading,pagination:{current:t.unref(l),pageSize:t.unref(d),total:t.unref(n).total,showSizeChanger:!P,showQuickJumper:!P,showLessItems:P,size:"default",showTotal:$?e=>t.createVNode("span",{class:T("pagination-total-wrapper")},[S("ap.apTable.pagination.totalLeftPrefix")," ",t.createVNode("span",{class:T("pagination-count-text")},[e])," ",S("ap.apTable.pagination.totalLeftSuffix"),t.createVNode("span",{class:T("pagination--total-right")},[S("ap.apTable.pagination.totalRightPrefix")," ",t.createVNode("span",{class:T("pagination-count-text")},[t.unref(_)])," ",S("ap.apTable.pagination.totalRightSuffix")])]):void 0},onChange:j,dataSource:t.unref(n).records}));return{formRef:c,submit:O,reset:X,refresh:Y,refreshByDelete:Z,data:n,current:l,pageSize:d,handleTableChange:j,tableProps:k,dataSource:t.computed(()=>t.unref(n).records),setDataSource:I,getColumnSFConfig:Q}};exports.useTablePaging=re;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("@aplus-frontend/antdv");require("../../config-provider/index.js");const p=require("../../config-provider/hooks/use-namespace.js"),m=require("../../config-provider/hooks/use-locale.js"),f={class:"selected-desc"},y={class:"selected-desc-conut"},h={class:"selected-desc-clean"},v=e.defineComponent({__name:"ApBatchAction",props:{selectedRowKeys:{},clearAll:{type:Function}},setup(i){const{b:r}=p.useNamespace("ap-batch-action"),{t:l}=m.useLocale(),s=i,o=e.useSlots(),d=e.computed(()=>{var t;return((t=s.selectedRowKeys)==null?void 0:t.length)||0}),n=e.ref(!1);return e.watch(()=>o.header,()=>{var a;const t=(a=o==null?void 0:o.header)==null?void 0:a.call(o);n.value=Array.isArray(t)&&t.filter(Boolean).filter(c=>c.type!==Symbol.for("v-cmt")&&c.type!==Symbol.for("v-fgt")).length>0},{immediate:!0}),(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(r)()])},[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(r)("header"))},[e.renderSlot(t.$slots,"header")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(r)("body"))},[e.renderSlot(t.$slots,"prefix"),e.createElementVNode("div",f,[e.createElementVNode("div",y,[e.createTextVNode(e.toDisplayString(e.unref(l)("ap.apBatchAction.selected"))+" ",1),e.createElementVNode("span",null,e.toDisplayString(d.value),1),e.createTextVNode(" "+e.toDisplayString(e.unref(l)("ap.apBatchAction.piecesOfData")),1)]),e.createElementVNode("div",h,[e.createVNode(e.unref(u.Button),{type:"link",onClick:a[0]||(a[0]=c=>s.clearAll&&s.clearAll())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("ap.apBatchAction.empty")),1)]),_:1})])]),e.renderSlot(t.$slots,"suffix")],2)],2))}});exports.default=v;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),N=require("@aplus-frontend/antdv");require("../../config-provider/index.js");const g=require("@aplus-frontend/hooks"),A=require("../../config-provider/hooks/use-namespace.js"),B=require("../../config-provider/hooks/use-locale.js"),V={class:"selected-desc"},_={class:"selected-desc-conut"},k={class:"selected-desc-clean"},w=e.defineComponent({__name:"ApBatchAction",props:{selectedRowKeys:{},clearAll:{type:Function}},setup(v){const{b:p}=A.useNamespace("ap-batch-action"),{t:f}=B.useLocale(),m=v,{hasPermission:h}=g.usePermission(),c=e.useSlots(),S=e.computed(()=>{var s;return((s=m.selectedRowKeys)==null?void 0:s.length)||0}),d=e.ref(!1);return e.watch(()=>c.header,()=>{var n;const s=(n=c==null?void 0:c.header)==null?void 0:n.call(c);d.value=Array.isArray(s)&&s.filter(Boolean).filter(t=>t.type!==Symbol.for("v-cmt")&&t.type!==Symbol.for("v-fgt")).filter(t=>{var u,r,l,y;const o=((u=t==null?void 0:t.props)==null?void 0:u["if-show"])??((r=t==null?void 0:t.props)==null?void 0:r.ifShow),i=(l=t==null?void 0:t.props)==null?void 0:l.auth;let a=o;return!((y=t==null?void 0:t.props)!=null&&y.ifShow)&&i&&(a=()=>h(i)),(a==null?void 0:a())??!0}).filter(t=>{var a,u;const o=((a=t==null?void 0:t.props)==null?void 0:a["menu-list"])??((u=t==null?void 0:t.props)==null?void 0:u.menuList),i=(o==null?void 0:o.filter(r=>{let l=r==null?void 0:r.ifShow;return!(r!=null&&r.ifShow)&&(r!=null&&r.auth)&&(l=()=>h(r.auth)),(l==null?void 0:l())??!0}))||[];return o===void 0?!0:i.length>0}).length>0},{immediate:!0}),(s,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(p)()])},[d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(p)("header"))},[e.renderSlot(s.$slots,"header")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(p)("body"))},[e.renderSlot(s.$slots,"prefix"),e.createElementVNode("div",V,[e.createElementVNode("div",_,[e.createTextVNode(e.toDisplayString(e.unref(f)("ap.apBatchAction.selected"))+" ",1),e.createElementVNode("span",null,e.toDisplayString(S.value),1),e.createTextVNode(" "+e.toDisplayString(e.unref(f)("ap.apBatchAction.piecesOfData")),1)]),e.createElementVNode("div",k,[e.createVNode(e.unref(N.Button),{type:"link",onClick:n[0]||(n[0]=t=>m.clearAll&&m.clearAll())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)("ap.apBatchAction.empty")),1)]),_:1})])]),e.renderSlot(s.$slots,"suffix")],2)],2))}});exports.default=w;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../ap-field/index.js");const V=require("@aplus-frontend/antdv");require("../../config-provider/index.js");const S=require("lodash-unified");require("./popover-input/index.vue.js");require("../../hooks/index.js");const q=require("../../utils/index.js"),b=require("../../hooks/useControllableValue.js"),U=require("../../config-provider/hooks/use-locale.js"),k=require("../../ap-field/select/index.vue.js"),I=require("../../ap-field/text/index.js"),L=require("./popover-input/index.vue2.js"),i="GROUP_SEARCH_ALL",O=e.defineComponent({__name:"index",props:{style:{type:[Boolean,null,String,Object,Array]},inputStyle:{type:[Boolean,null,String,Object,Array]},options:{},hasAll:{type:Boolean,default:!0},value:{},"onUpdate:value":{},mode:{default:"edit"},class:{},id:{},placeholder:{},autocomplete:{},type:{default:"text"},name:{},size:{},autofocus:{type:Boolean},lazy:{type:Boolean,default:!0},maxlength:{},loading:{type:Boolean},bordered:{type:Boolean,default:!0},showCount:{type:[Boolean,Object]},htmlSize:{},onPressEnter:{},onKeydown:{},onKeyup:{},onFocus:{},onBlur:{},onChange:{},onInput:{},onCompositionstart:{},onCompositionend:{},valueModifiers:{},hidden:{type:Boolean},status:{},defaultValue:{},inputElement:{},prefixCls:{},disabled:{type:Boolean},focused:{type:Boolean},triggerFocus:{},readonly:{type:Boolean},handleReset:{},addonBefore:{},addonAfter:{},prefix:{},suffix:{},clearIcon:{},allowClear:{type:Boolean,default:!0},emptyText:{default:"--"}},emits:["update:value"],setup(c,{emit:d}){const o=c,f=d,{value:u,updateValue:a}=b.useControllableValue(o,f),s=e.ref(),{t:v}=U.useLocale(),y=e.computed(()=>o.options?o.options.length>1&&o.hasAll?[{value:i,label:v("ap.apGroupSearch.all")},...o.options]:o.options:[]),h=e.computed(()=>o.options?o.options.map(t=>t.value):[]),m=e.computed(()=>{var t,n;return(n=(t=e.unref(u))==null?void 0:t.value)!=null&&n.length?e.unref(u).value.join(","):""}),_=e.computed(()=>{var t,n;return(n=(t=e.unref(u))==null?void 0:t.value)!=null&&n.length?e.unref(u).value.join(`
2
- `):""}),g=e.computed(()=>{var n;const t=(n=e.unref(u))==null?void 0:n.key;if(t!=null&&t.length)return t.length===1?t[0]:i});function B(t){const n=e.unref(u)||{},l=t===i?e.unref(h):q.isDef(t)?[t]:[];a({...n,key:l})}function A(t){const n=e.unref(u)||{};let l=t;for(;l.startsWith(",");)l=l.slice(1);let r=l.replaceAll(",,",",").split(",");r.length===1&&r[0]===""&&(r=[]),a({...n,value:r})}function x(t){const n=e.unref(u)||{};let l=t.split(/,|\n/);a({...n,value:l})}function p(){var l;const t=e.unref(u)||{},n=(l=t.value)==null?void 0:l.filter(Boolean);a({...t,value:n})}function C(t){var n;p(),(n=o.onBlur)==null||n.call(o,t)}return(t,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:s,style:{position:"relative"}},[e.createVNode(e.unref(V.Space).Compact,{block:""},{default:e.withCtx(()=>{var l;return[(l=t.options)!=null&&l.length?(e.openBlock(),e.createBlock(e.unref(k.default),{key:0,style:e.normalizeStyle(t.style),options:y.value,value:g.value,"onUpdate:value":B},null,8,["style","options","value"])):e.createCommentVNode("",!0),e.createVNode(e.unref(I.ApFieldText),e.mergeProps({style:t.inputStyle},e.unref(S.omit)(o,["style","value","onUpdate:value","inputStyle","hasAll","options"]),{value:m.value,"onUpdate:value":A,onBlur:C}),{suffix:e.withCtx(()=>[e.createVNode(L.default,{_parent:s.value,value:_.value,"onUpdate:value":x,onClose:p},null,8,["_parent","value"])]),_:1},16,["style","value"])]}),_:1})],512))}});exports.default=O;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../ap-field/index.js");const w=require("@aplus-frontend/antdv");require("../../config-provider/index.js");const j=require("lodash-unified");require("./popover-input/index.vue.js");require("../../hooks/index.js");const L=require("../../utils/index.js"),O=require("../../ap-field/hooks/use-default-placeholder.js"),P=require("../../hooks/useControllableValue.js"),R=require("../../config-provider/hooks/use-locale.js"),E=require("../../ap-field/select/index.vue.js"),T=require("../../ap-field/text/index.js"),z=require("./popover-input/index.vue2.js"),s="GROUP_SEARCH_ALL",N=e.defineComponent({__name:"index",props:{style:{type:[Boolean,null,String,Object,Array]},inputStyle:{type:[Boolean,null,String,Object,Array]},options:{},hasAll:{type:Boolean,default:!0},value:{},"onUpdate:value":{},mode:{default:"edit"},class:{},id:{},placeholder:{},autocomplete:{},type:{default:"text"},name:{},size:{},autofocus:{type:Boolean},lazy:{type:Boolean,default:!0},maxlength:{},loading:{type:Boolean},bordered:{type:Boolean,default:!0},showCount:{type:[Boolean,Object]},htmlSize:{},onPressEnter:{},onKeydown:{},onKeyup:{},onFocus:{},onBlur:{},onChange:{},onInput:{},onCompositionstart:{},onCompositionend:{},valueModifiers:{},hidden:{type:Boolean},status:{},defaultValue:{},inputElement:{},prefixCls:{},disabled:{type:Boolean},focused:{type:Boolean},triggerFocus:{},readonly:{type:Boolean},handleReset:{},addonBefore:{},addonAfter:{},prefix:{},suffix:{},clearIcon:{},allowClear:{type:Boolean,default:!0},emptyText:{default:"--"}},emits:["update:value"],setup(h,{emit:m}){const o=h,_=O.useDefaultPlaceholder("Text",o),g=m,{value:u,updateValue:r}=P.useControllableValue(o,g),p=e.ref(),c=e.ref(),{t:B}=R.useLocale(),x=e.computed(()=>o.options?o.options.length>1&&o.hasAll?[{value:s,label:B("ap.apGroupSearch.all")},...o.options]:o.options:[]),V=e.computed(()=>o.options?o.options.map(t=>t.value):[]),A=e.computed(()=>{var t,n;return(n=(t=e.unref(u))==null?void 0:t.value)!=null&&n.length?e.unref(u).value.join(","):""}),C=e.computed(()=>{var t,n;return(n=(t=e.unref(u))==null?void 0:t.value)!=null&&n.length?e.unref(u).value.join(`
2
+ `):""}),q=e.computed(()=>{var n;const t=(n=e.unref(u))==null?void 0:n.key;if(t!=null&&t.length)return t.length===1?t[0]:s}),S=e.computed(()=>{var l;const t=(l=e.unref(u))==null?void 0:l.key;return!t||(t==null?void 0:t.length)<=1?e.unref(_):(o.options||[]).filter(a=>t.includes(a.value)).map(a=>a.label).join("/")});function b(t){const n=e.unref(u)||{},l=t===s?e.unref(V):L.isDef(t)?[t]:[];r({...n,key:l})}function U(t){var f,v;const n=e.unref(u)||{},l=t.target.value||"",a=l.replace(/[,]+/g,",");if(l!==a){const y=(v=(f=c.value)==null?void 0:f.$el)==null?void 0:v.querySelector("input");y&&(y.value=a)}let i=a.split(",");i.length===1&&i[0]===""&&(i=[]),r({...n,value:i})}function k(t){const n=e.unref(u)||{};let l=t.split(/,|\n/);r({...n,value:l})}function d(){var l;const t=e.unref(u)||{},n=(l=t.value)==null?void 0:l.filter(Boolean);r({...t,value:n})}function I(t){var n;d(),(n=o.onBlur)==null||n.call(o,t)}return(t,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:p,style:{position:"relative"}},[e.createVNode(e.unref(w.Space).Compact,{block:""},{default:e.withCtx(()=>{var l;return[(l=t.options)!=null&&l.length?(e.openBlock(),e.createBlock(e.unref(E.default),{key:0,style:e.normalizeStyle(t.style),options:x.value,value:q.value,"onUpdate:value":b,"allow-clear":!1,"dropdown-match-select-width":!1},null,8,["style","options","value"])):e.createCommentVNode("",!0),e.createVNode(e.unref(T.ApFieldText),e.mergeProps({style:t.inputStyle},e.unref(j.omit)(o,["style","value","onUpdate:value","inputStyle","hasAll","options"]),{ref_key:"inputRef",ref:c,value:A.value,onInput:U,onBlur:I,placeholder:S.value}),{suffix:e.withCtx(()=>[e.createVNode(z.default,{_parent:p.value,value:C.value,"onUpdate:value":k,onClose:d},null,8,["_parent","value"])]),_:1},16,["style","value","placeholder"])]}),_:1})],512))}});exports.default=N;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "0.2.16",
3
+ "version": "0.2.18",
4
4
  "main": "./lib/index.js",
5
5
  "type": "module",
6
6
  "files": [
@@ -67,15 +67,15 @@
67
67
  "@aplus-frontend/utils": "1.0.42"
68
68
  },
69
69
  "peerDependencies": {
70
- "@aplus-frontend/antdv": "^1.0.3",
71
- "@aplus-frontend/icon": "^1.1.1",
70
+ "@aplus-frontend/antdv": "^1.0.5",
71
+ "@aplus-frontend/icon": "^1.1.3",
72
72
  "@aplus-frontend/oss": "^1.1.2",
73
73
  "vue": "3.4.38",
74
74
  "@aplus-frontend/ui-theme": "1.0.15"
75
75
  },
76
76
  "devDependencies": {
77
- "@aplus-frontend/antdv": "^1.0.2",
78
- "@aplus-frontend/icon": "^1.1.1",
77
+ "@aplus-frontend/antdv": "^1.0.5",
78
+ "@aplus-frontend/icon": "^1.1.3",
79
79
  "@aplus-frontend/oss": "^1.1.2",
80
80
  "@types/sortablejs": "^1.15.8",
81
81
  "@vue/test-utils": "^2.4.6",