@aplus-frontend/ui 7.17.1-beta.0 → 7.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/es/src/ap-field/cascader/index.vue.mjs +86 -131
  2. package/es/src/ap-field/cascader/read.vue2.mjs +36 -35
  3. package/es/src/ap-field/checkbox/index.vue.d.ts +18 -1
  4. package/es/src/ap-field/checkbox/index.vue.mjs +42 -43
  5. package/es/src/ap-field/checkbox/read.vue2.mjs +1 -1
  6. package/es/src/ap-field/date/index.vue.mjs +48 -48
  7. package/es/src/ap-field/date/read.vue2.mjs +1 -1
  8. package/es/src/ap-field/date-range/index.vue.mjs +31 -31
  9. package/es/src/ap-field/date-range/read.vue2.mjs +1 -1
  10. package/es/src/ap-field/interface.d.ts +7 -22
  11. package/es/src/ap-field/number/index.vue.mjs +36 -34
  12. package/es/src/ap-field/number/read.vue2.mjs +1 -1
  13. package/es/src/ap-field/radio/index.vue.mjs +34 -42
  14. package/es/src/ap-field/radio/read.vue2.mjs +1 -1
  15. package/es/src/ap-field/rate/index.vue.mjs +23 -23
  16. package/es/src/ap-field/second/index.vue.mjs +27 -29
  17. package/es/src/ap-field/second/read.vue2.mjs +2 -2
  18. package/es/src/ap-field/segmented/index.vue.mjs +37 -37
  19. package/es/src/ap-field/select/index.vue.mjs +38 -38
  20. package/es/src/ap-field/select/read.vue2.mjs +1 -1
  21. package/es/src/ap-field/slider/index.vue.mjs +35 -37
  22. package/es/src/ap-field/switch/index.vue.mjs +38 -38
  23. package/es/src/ap-field/switch/read.vue2.mjs +3 -3
  24. package/es/src/ap-field/text/index.vue.d.ts +478 -3
  25. package/es/src/ap-field/text/index.vue2.mjs +47 -46
  26. package/es/src/ap-field/text/password.vue.d.ts +549 -3
  27. package/es/src/ap-field/text/password.vue.mjs +61 -56
  28. package/es/src/ap-field/text/read-password.vue2.mjs +16 -16
  29. package/es/src/ap-field/text/read.vue2.mjs +1 -1
  30. package/es/src/ap-field/text-area/index.vue.mjs +29 -31
  31. package/es/src/ap-field/text-area/read.vue2.mjs +1 -1
  32. package/es/src/ap-field/tree-select/index.vue.mjs +47 -47
  33. package/es/src/ap-field/tree-select/read.vue2.mjs +3 -3
  34. package/es/src/ap-form/drawer-form/index.vue.mjs +99 -90
  35. package/es/src/ap-form/hooks/use-regist-form.d.ts +7 -0
  36. package/es/src/ap-form/hooks/use-regist-form.mjs +24 -0
  37. package/es/src/ap-form/item/index.vue.d.ts +6 -6
  38. package/es/src/ap-form/item/index.vue.mjs +85 -94
  39. package/es/src/ap-form/item-group/index.vue.mjs +14 -14
  40. package/es/src/ap-form/items/cascader/index.vue.d.ts +2 -2
  41. package/es/src/ap-form/items/checkbox/index.vue.d.ts +159 -47
  42. package/es/src/ap-form/items/date/index.vue.d.ts +2 -2
  43. package/es/src/ap-form/items/date-range/index.vue.d.ts +2 -2
  44. package/es/src/ap-form/items/number/index.vue.d.ts +2 -2
  45. package/es/src/ap-form/items/select/index.vue.d.ts +2 -2
  46. package/es/src/ap-form/items/switch/index.vue.d.ts +2 -2
  47. package/es/src/ap-form/items/text/index.vue.d.ts +476 -4
  48. package/es/src/ap-form/items/text/password.vue.d.ts +547 -4
  49. package/es/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
  50. package/es/src/ap-form/list/index.vue.mjs +29 -34
  51. package/es/src/ap-form/modal-form/index.vue.mjs +77 -68
  52. package/es/src/ap-form/set/index.vue.d.ts +2 -4
  53. package/es/src/ap-form/set/index.vue.mjs +23 -18
  54. package/es/src/ap-grid/index.vue.mjs +1 -1
  55. package/es/src/ap-table/constants.d.ts +593 -31
  56. package/es/src/ap-table/utils.d.ts +1 -1
  57. package/es/src/business/batch-input-group/index.vue.d.ts +240 -3
  58. package/es/src/business/batch-input-group/index.vue.mjs +1 -1
  59. package/es/src/version.d.ts +1 -1
  60. package/es/src/version.mjs +1 -1
  61. package/lib/src/ap-field/cascader/index.vue.js +1 -1
  62. package/lib/src/ap-field/cascader/read.vue2.js +1 -1
  63. package/lib/src/ap-field/checkbox/index.vue.d.ts +18 -1
  64. package/lib/src/ap-field/checkbox/index.vue.js +1 -1
  65. package/lib/src/ap-field/checkbox/read.vue2.js +1 -1
  66. package/lib/src/ap-field/date/index.vue.js +1 -1
  67. package/lib/src/ap-field/date/read.vue2.js +1 -1
  68. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  69. package/lib/src/ap-field/date-range/read.vue2.js +1 -1
  70. package/lib/src/ap-field/interface.d.ts +7 -22
  71. package/lib/src/ap-field/number/index.vue.js +1 -1
  72. package/lib/src/ap-field/number/read.vue2.js +1 -1
  73. package/lib/src/ap-field/radio/index.vue.js +1 -1
  74. package/lib/src/ap-field/radio/read.vue2.js +1 -1
  75. package/lib/src/ap-field/rate/index.vue.js +1 -1
  76. package/lib/src/ap-field/second/index.vue.js +1 -1
  77. package/lib/src/ap-field/second/read.vue2.js +1 -1
  78. package/lib/src/ap-field/segmented/index.vue.js +1 -1
  79. package/lib/src/ap-field/select/index.vue.js +1 -1
  80. package/lib/src/ap-field/select/read.vue2.js +1 -1
  81. package/lib/src/ap-field/slider/index.vue.js +1 -1
  82. package/lib/src/ap-field/switch/index.vue.js +1 -1
  83. package/lib/src/ap-field/switch/read.vue2.js +1 -1
  84. package/lib/src/ap-field/text/index.vue.d.ts +478 -3
  85. package/lib/src/ap-field/text/index.vue2.js +1 -1
  86. package/lib/src/ap-field/text/password.vue.d.ts +549 -3
  87. package/lib/src/ap-field/text/password.vue.js +1 -1
  88. package/lib/src/ap-field/text/read-password.vue2.js +1 -1
  89. package/lib/src/ap-field/text/read.vue2.js +1 -1
  90. package/lib/src/ap-field/text-area/index.vue.js +1 -1
  91. package/lib/src/ap-field/text-area/read.vue2.js +1 -1
  92. package/lib/src/ap-field/tree-select/index.vue.js +1 -1
  93. package/lib/src/ap-field/tree-select/read.vue2.js +1 -1
  94. package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
  95. package/lib/src/ap-form/hooks/use-regist-form.d.ts +7 -0
  96. package/lib/src/ap-form/hooks/use-regist-form.js +1 -0
  97. package/lib/src/ap-form/item/index.vue.d.ts +6 -6
  98. package/lib/src/ap-form/item/index.vue.js +1 -1
  99. package/lib/src/ap-form/item-group/index.vue.js +1 -1
  100. package/lib/src/ap-form/items/cascader/index.vue.d.ts +2 -2
  101. package/lib/src/ap-form/items/checkbox/index.vue.d.ts +159 -47
  102. package/lib/src/ap-form/items/date/index.vue.d.ts +2 -2
  103. package/lib/src/ap-form/items/date-range/index.vue.d.ts +2 -2
  104. package/lib/src/ap-form/items/number/index.vue.d.ts +2 -2
  105. package/lib/src/ap-form/items/select/index.vue.d.ts +2 -2
  106. package/lib/src/ap-form/items/switch/index.vue.d.ts +2 -2
  107. package/lib/src/ap-form/items/text/index.vue.d.ts +476 -4
  108. package/lib/src/ap-form/items/text/password.vue.d.ts +547 -4
  109. package/lib/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
  110. package/lib/src/ap-form/list/index.vue.js +1 -1
  111. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  112. package/lib/src/ap-form/set/index.vue.d.ts +2 -4
  113. package/lib/src/ap-form/set/index.vue.js +1 -1
  114. package/lib/src/ap-grid/index.vue.js +1 -1
  115. package/lib/src/ap-table/constants.d.ts +593 -31
  116. package/lib/src/ap-table/utils.d.ts +1 -1
  117. package/lib/src/business/batch-input-group/index.vue.d.ts +240 -3
  118. package/lib/src/business/batch-input-group/index.vue.js +1 -1
  119. package/lib/src/version.d.ts +1 -1
  120. package/lib/src/version.js +1 -1
  121. package/package.json +1 -1
@@ -1,31 +1,21 @@
1
- import { isVNode as O, defineComponent as j, useSlots as z, ref as F, computed as L, unref as e, createVNode as u, Fragment as C, resolveComponent as M, createBlock as b, openBlock as w, resolveDynamicComponent as A, mergeProps as U, createSlots as K, renderList as q, withCtx as S, renderSlot as E, normalizeProps as W, guardReactiveProps as $ } from "vue";
2
- import { Space as G, Cascader as H } from "@aplus-frontend/antdv";
3
- import { isArray as J, omit as Q } from "lodash-unified";
1
+ import { defineComponent as A, computed as w, useSlots as L, ref as O, unref as e, resolveComponent as U, createElementBlock as d, createBlock as B, openBlock as l, Fragment as S, toDisplayString as x, withCtx as f, renderList as N, mergeProps as E, createSlots as K, renderSlot as j, normalizeProps as q, guardReactiveProps as G, createVNode as W } from "vue";
2
+ import { Space as $, Cascader as H } from "@aplus-frontend/antdv";
3
+ import { omit as J, isArray as Q } from "lodash-unified";
4
4
  import "../../hooks/index.mjs";
5
5
  import { useDefaultPlaceholder as X } from "../hooks/use-default-placeholder.mjs";
6
6
  import { useOptions as Y } from "./use-options.mjs";
7
7
  import { useControllableValue as Z } from "../../hooks/useControllableValue.mjs";
8
- function ee(t) {
9
- return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !O(t);
10
- }
11
- const ue = /* @__PURE__ */ j({
8
+ const ee = { key: 0 }, de = /* @__PURE__ */ A({
12
9
  name: "ApFieldCascader",
13
10
  __name: "index",
14
11
  props: {
15
- mode: {
16
- default: "edit"
17
- },
12
+ mode: { default: "edit" },
18
13
  class: {},
19
14
  style: {},
20
- multiple: {
21
- type: Boolean,
22
- default: void 0
23
- },
15
+ emptyText: { default: "--" },
16
+ multiple: { type: Boolean, default: void 0 },
24
17
  size: {},
25
- bordered: {
26
- type: Boolean,
27
- default: !0
28
- },
18
+ bordered: { type: Boolean, default: !0 },
29
19
  placement: {},
30
20
  suffixIcon: {},
31
21
  status: {},
@@ -46,54 +36,34 @@ const ue = /* @__PURE__ */ j({
46
36
  onKeydown: {},
47
37
  onKeyup: {},
48
38
  onMousedown: {},
49
- open: {
50
- type: Boolean,
51
- default: void 0
52
- },
39
+ open: { type: Boolean, default: void 0 },
53
40
  animation: {},
54
41
  direction: {},
55
- disabled: {
56
- type: Boolean
57
- },
42
+ disabled: { type: Boolean },
58
43
  prefixCls: {},
59
44
  id: {},
60
- autofocus: {
61
- type: Boolean
62
- },
45
+ autofocus: { type: Boolean },
63
46
  getPopupContainer: {},
64
- dropdownMatchSelectWidth: {
65
- type: [Number, Boolean]
66
- },
47
+ dropdownMatchSelectWidth: { type: [Number, Boolean] },
67
48
  placeholder: {},
68
- loading: {
69
- type: Boolean
70
- },
49
+ loading: { type: Boolean },
71
50
  defaultValue: {},
72
51
  prefix: {},
73
52
  clearIcon: {},
74
- allowClear: {
75
- type: Boolean,
76
- default: !0
77
- },
53
+ allowClear: { type: Boolean, default: !0 },
78
54
  getInputElement: {},
79
55
  getRawInputElement: {},
80
56
  fieldNames: {},
81
57
  searchValue: {},
82
58
  onSearch: {},
83
59
  maxCount: {},
84
- showSearch: {
85
- type: [Boolean, Object],
86
- default: !1
87
- },
60
+ showSearch: { type: [Boolean, Object], default: !1 },
88
61
  tagRender: {},
89
62
  optionLabelRender: {},
90
63
  notFoundContent: {},
91
64
  onClear: {},
92
65
  choiceTransitionName: {},
93
- defaultOpen: {
94
- type: Boolean,
95
- default: void 0
96
- },
66
+ defaultOpen: { type: Boolean, default: void 0 },
97
67
  onDropdownVisibleChange: {},
98
68
  maxTagTextLength: {},
99
69
  maxTagCount: {},
@@ -109,109 +79,94 @@ const ue = /* @__PURE__ */ j({
109
79
  onPopupVisibleChange: {},
110
80
  popupStyle: {},
111
81
  popupPlacement: {},
112
- popupVisible: {
113
- type: Boolean,
114
- default: void 0
115
- },
82
+ popupVisible: { type: Boolean, default: void 0 },
116
83
  expandIcon: {},
117
- changeOnSelect: {
118
- type: Boolean
119
- },
84
+ changeOnSelect: { type: Boolean },
120
85
  displayRender: {},
121
86
  showCheckedStrategy: {},
122
87
  expandTrigger: {},
123
88
  dropdownPrefixCls: {},
124
89
  dropdownMenuColumnStyle: {},
125
90
  loadingIcon: {},
126
- emptyText: {
127
- default: "--"
128
- },
129
91
  request: {},
130
- lazy: {
131
- type: Boolean
132
- },
92
+ lazy: { type: Boolean },
133
93
  params: {},
134
- loadData: {
135
- type: Boolean
136
- }
94
+ loadData: { type: Boolean }
137
95
  },
138
96
  emits: ["update:value"],
139
- setup(t, {
140
- expose: x,
141
- emit: B
142
- }) {
143
- const o = t, N = z(), T = B, f = F(), {
144
- value: m,
145
- updateValue: P
146
- } = Z(o, T), V = X("Cascader", o), {
147
- options: y,
148
- request: h,
149
- loading: g
150
- } = Y(o), _ = L(() => {
151
- let n;
152
- const a = e(m);
153
- if (!a.length)
154
- return u(C, null, [o.emptyText]);
155
- const l = [], v = o.fieldNames?.label || "label", s = o.fieldNames?.value || "value";
156
- function i(r, d) {
157
- const p = [];
158
- for (const c of r) {
159
- if (d.find((R) => R === c[s]) && p.push(c[v]), p.length === d.length)
160
- return p;
161
- c.children?.length && p.push(...i(c.children, d));
97
+ setup(k, { expose: P, emit: T }) {
98
+ const a = k, _ = w(
99
+ () => J(a, ["onUpdate:value", "value", "options", "loadData"])
100
+ ), I = L(), V = T, u = O(), { value: h, updateValue: D } = Z(a, V), R = X("Cascader", a), { options: g, request: y, loading: v } = Y(a), C = w(() => {
101
+ const o = e(h);
102
+ if (!o?.length) return [];
103
+ const b = a.fieldNames?.label || "label", i = a.fieldNames?.value || "value";
104
+ function r(m, t) {
105
+ const s = [];
106
+ for (const p of m || []) {
107
+ if (t.find(
108
+ (M) => M === p[i]
109
+ ) && s.push(p[b]), s.length === t.length)
110
+ return s;
111
+ p.children?.length && s.push(...r(p.children, t));
162
112
  }
163
- return p;
113
+ return s;
114
+ }
115
+ const n = [], c = Q(o[0]) ? o : [o];
116
+ for (const m of c) {
117
+ const t = r(g.value, m);
118
+ t.length && n.push(t);
164
119
  }
165
- const D = J(a[0]) ? a : [a];
166
- for (const r of D)
167
- l.push(i(y.value, r));
168
- return l.length ? u(G, {
169
- size: 4
170
- }, ee(n = l.map((r, d) => u("span", {
171
- key: d
172
- }, [r.join(", ")]))) ? n : {
173
- default: () => [n]
174
- }) : u(C, null, [o.emptyText]);
120
+ return n;
175
121
  });
176
- function k() {
177
- f.value?.focus?.();
122
+ function z() {
123
+ u.value?.focus?.();
178
124
  }
179
- function I() {
180
- f.value?.blur?.();
125
+ function F() {
126
+ u.value?.blur?.();
181
127
  }
182
- return x({
183
- focus: k,
184
- blur: I,
185
- request: h
186
- }), (n, a) => {
187
- const l = M("Spin");
188
- return n.mode === "read" ? (w(), b(A(_.value), {
189
- key: 0
190
- })) : (w(), b(e(H), U({
191
- key: 1
192
- }, e(Q)(o, ["onUpdate:value", "value", "options", "loadData"]), {
193
- ref: f.value,
194
- value: e(m),
195
- loading: e(g),
196
- options: e(y),
197
- placeholder: e(V),
198
- "load-data": n.loadData ? e(h) : void 0,
199
- "onUpdate:value": e(P)
200
- }), K({
201
- _: 2
202
- }, [q(N, (v, s) => ({
203
- name: s,
204
- fn: S((i) => [E(n.$slots, s, W($(i || {})))])
205
- })), e(g) ? {
206
- name: "notFoundContent",
207
- fn: S(() => [u(l, {
208
- size: "small"
209
- })]),
210
- key: "0"
211
- } : void 0]), 1040, ["value", "loading", "options", "placeholder", "load-data", "onUpdate:value"]));
128
+ return P({
129
+ focus: z,
130
+ blur: F,
131
+ request: y
132
+ }), (o, b) => {
133
+ const i = U("Spin");
134
+ return o.mode === "read" ? (l(), d(S, { key: 0 }, [
135
+ C.value.length ? (l(), B(e($), {
136
+ key: 1,
137
+ size: 4
138
+ }, {
139
+ default: f(() => [
140
+ (l(!0), d(S, null, N(C.value, (r, n) => (l(), d("span", { key: n }, x(r.join(", ")), 1))), 128))
141
+ ]),
142
+ _: 1
143
+ })) : (l(), d("span", ee, x(o.emptyText), 1))
144
+ ], 64)) : (l(), B(e(H), E({ key: 1 }, _.value, {
145
+ ref: u.value,
146
+ value: e(h),
147
+ loading: e(v),
148
+ options: e(g),
149
+ placeholder: e(R),
150
+ "load-data": o.loadData ? e(y) : void 0,
151
+ "onUpdate:value": e(D)
152
+ }), K({ _: 2 }, [
153
+ N(I, (r, n) => ({
154
+ name: n,
155
+ fn: f((c) => [
156
+ j(o.$slots, n, q(G(c || {})))
157
+ ])
158
+ })),
159
+ e(v) ? {
160
+ name: "notFoundContent",
161
+ fn: f(() => [
162
+ W(i, { size: "small" })
163
+ ]),
164
+ key: "0"
165
+ } : void 0
166
+ ]), 1040, ["value", "loading", "options", "placeholder", "load-data", "onUpdate:value"]));
212
167
  };
213
168
  }
214
169
  });
215
170
  export {
216
- ue as default
171
+ de as default
217
172
  };
@@ -1,10 +1,9 @@
1
- import { isVNode as g, defineComponent as C, computed as b, createVNode as d, Fragment as c, createBlock as w, openBlock as x, resolveDynamicComponent as B } from "vue";
1
+ import { defineComponent as C, computed as w, unref as m, createElementBlock as d, createBlock as B, openBlock as p, toDisplayString as f, withCtx as x, Fragment as b, renderList as v } from "vue";
2
2
  import { Space as N } from "@aplus-frontend/antdv";
3
- import { isArray as v } from "lodash-unified";
4
- function S(o) {
5
- return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !g(o);
6
- }
7
- const P = /* @__PURE__ */ C({
3
+ import { isArray as S } from "lodash-unified";
4
+ const T = {
5
+ key: 0
6
+ }, R = /* @__PURE__ */ C({
8
7
  name: "ApFieldCascaderRead",
9
8
  __name: "read",
10
9
  props: {
@@ -13,6 +12,9 @@ const P = /* @__PURE__ */ C({
13
12
  },
14
13
  class: {},
15
14
  style: {},
15
+ emptyText: {
16
+ default: "--"
17
+ },
16
18
  multiple: {
17
19
  type: Boolean
18
20
  },
@@ -112,9 +114,6 @@ const P = /* @__PURE__ */ C({
112
114
  dropdownPrefixCls: {},
113
115
  dropdownMenuColumnStyle: {},
114
116
  loadingIcon: {},
115
- emptyText: {
116
- default: "--"
117
- },
118
117
  request: {},
119
118
  lazy: {
120
119
  type: Boolean
@@ -124,36 +123,38 @@ const P = /* @__PURE__ */ C({
124
123
  type: Boolean
125
124
  }
126
125
  },
127
- setup(o) {
128
- const e = o, u = b(() => {
129
- let p;
130
- const n = e.value;
131
- if (!n.length)
132
- return d(c, null, [e.emptyText]);
133
- const i = [], m = e.fieldNames?.label || "label", f = e.fieldNames?.value || "value";
134
- function s(t, a) {
135
- const l = [];
136
- for (const r of t) {
137
- if (a.find((h) => h === r[f]) && l.push(r[m]), l.length === a.length)
138
- return l;
139
- r.children?.length && l.push(...s(r.children, a));
126
+ setup(h) {
127
+ const a = h, i = w(() => {
128
+ const e = m(a.value);
129
+ if (!e?.length) return [];
130
+ const u = a.fieldNames?.label || "label", r = a.fieldNames?.value || "value";
131
+ function t(s, o) {
132
+ const n = [];
133
+ for (const l of s || []) {
134
+ if (o.find((g) => g === l[r]) && n.push(l[u]), n.length === o.length)
135
+ return n;
136
+ l.children?.length && n.push(...t(l.children, o));
140
137
  }
141
- return l;
138
+ return n;
139
+ }
140
+ const c = [], y = S(e[0]) ? e : [e];
141
+ for (const s of y) {
142
+ const o = t(a.options, s);
143
+ o.length && c.push(o);
142
144
  }
143
- const y = v(n[0]) ? n : [n];
144
- for (const t of y)
145
- i.push(s(e.options, t));
146
- return i.length ? d(N, {
147
- size: 4
148
- }, S(p = i.map((t, a) => d("span", {
149
- key: a
150
- }, [t.join(", ")]))) ? p : {
151
- default: () => [p]
152
- }) : d(c, null, [e.emptyText]);
145
+ return c;
153
146
  });
154
- return (p, n) => (x(), w(B(u.value)));
147
+ return (e, u) => i.value.length ? (p(), B(m(N), {
148
+ key: 1,
149
+ size: 4
150
+ }, {
151
+ default: x(() => [(p(!0), d(b, null, v(i.value, (r, t) => (p(), d("span", {
152
+ key: t
153
+ }, f(r.join(", ")), 1))), 128))]),
154
+ _: 1
155
+ })) : (p(), d("span", T, f(e.emptyText), 1));
155
156
  }
156
157
  });
157
158
  export {
158
- P as default
159
+ R as default
159
160
  };
@@ -2,7 +2,18 @@ import { ApFieldCheckboxProps } from '../interface';
2
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
3
  import { FieldMode } from '..';
4
4
  import { CheckboxOptionType } from '@aplus-frontend/antdv';
5
- declare const _default: DefineComponent<ApFieldCheckboxProps, {
5
+ type CheckboxGroupSlots = {
6
+ label?: any;
7
+ default?: any;
8
+ };
9
+ declare function __VLS_template(): {
10
+ attrs: Partial<{}>;
11
+ slots: Readonly<CheckboxGroupSlots> & CheckboxGroupSlots;
12
+ refs: {};
13
+ rootEl: any;
14
+ };
15
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
+ declare const __VLS_component: DefineComponent<ApFieldCheckboxProps, {
6
17
  request: () => void;
7
18
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
8
19
  "update:value": (...args: any[]) => void;
@@ -14,4 +25,10 @@ declare const _default: DefineComponent<ApFieldCheckboxProps, {
14
25
  options: (string | number | CheckboxOptionType)[];
15
26
  emptyText: string;
16
27
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
28
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
17
29
  export default _default;
30
+ type __VLS_WithTemplateSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
33
+ };
34
+ };
@@ -1,14 +1,14 @@
1
- import { defineComponent as V, ref as q, onMounted as B, createElementBlock as l, openBlock as o, Fragment as n, unref as e, createTextVNode as m, toDisplayString as d, createBlock as c, mergeProps as O } from "vue";
2
- import { Spin as T, CheckboxGroup as U } from "@aplus-frontend/antdv";
3
- import { isFunction as _, isNil as F, omit as N } from "lodash-unified";
1
+ import { defineComponent as O, computed as T, useSlots as _, ref as P, onMounted as U, createElementBlock as r, openBlock as o, Fragment as s, unref as e, createTextVNode as d, toDisplayString as c, createBlock as f, mergeProps as F, createSlots as N, renderList as z, withCtx as A, renderSlot as L, normalizeProps as j, guardReactiveProps as w } from "vue";
2
+ import { Spin as D, CheckboxGroup as E } from "@aplus-frontend/antdv";
3
+ import { omit as G, isFunction as I, isNil as M } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
5
5
  import "../../hooks/index.mjs";
6
- import S from "../hooks/use-options.mjs";
7
- import A from "../style/index.mjs";
8
- import { getOptionValue as j, getOptionLabel as z } from "./helper.mjs";
9
- import { useNamespace as D } from "../../config-provider/hooks/use-namespace.mjs";
10
- import { useControllableValue as E } from "../../hooks/useControllableValue.mjs";
11
- const W = /* @__PURE__ */ V({
6
+ import R from "../hooks/use-options.mjs";
7
+ import $ from "../style/index.mjs";
8
+ import { getOptionValue as H, getOptionLabel as J } from "./helper.mjs";
9
+ import { useNamespace as K } from "../../config-provider/hooks/use-namespace.mjs";
10
+ import { useControllableValue as Q } from "../../hooks/useControllableValue.mjs";
11
+ const ne = /* @__PURE__ */ O({
12
12
  name: "ApFieldCheckbox",
13
13
  inheritAttrs: !1,
14
14
  __name: "index",
@@ -16,6 +16,7 @@ const W = /* @__PURE__ */ V({
16
16
  mode: { default: "edit" },
17
17
  class: {},
18
18
  style: {},
19
+ emptyText: { default: "--" },
19
20
  defaultValue: {},
20
21
  value: {},
21
22
  onChange: {},
@@ -25,60 +26,58 @@ const W = /* @__PURE__ */ V({
25
26
  options: { default: () => [] },
26
27
  disabled: { type: Boolean, default: void 0 },
27
28
  id: {},
28
- emptyText: { default: "--" },
29
29
  request: {},
30
30
  vertical: { type: Boolean }
31
31
  },
32
32
  emits: ["update:value"],
33
- setup(f, { expose: v, emit: y }) {
34
- const k = y, t = f, { options: u, updateOptions: x } = S(t), { b: h, m: b } = D("field-checkbox"), g = A("field"), r = q(!1);
33
+ setup(v, { expose: y, emit: k }) {
34
+ const x = k, t = v, h = T(
35
+ () => G(t, ["onUpdate:value", "value", "request", "vertical", "emptyText"])
36
+ ), g = _(), { options: u, updateOptions: b } = R(t), { b: C, m: S } = K("field-checkbox"), V = $("field"), n = P(!1);
35
37
  async function p() {
36
- if (_(t.request))
37
- return r.value = !0, t.request().then((a) => x(a)).finally(() => {
38
- r.value = !1;
38
+ if (I(t.request))
39
+ return n.value = !0, t.request().then((a) => b(a)).finally(() => {
40
+ n.value = !1;
39
41
  });
40
42
  }
41
- B(() => {
43
+ U(() => {
42
44
  p();
43
45
  });
44
- const { value: i, updateValue: C } = E(
46
+ const { value: i, updateValue: q } = Q(
45
47
  t,
46
- k,
48
+ x,
47
49
  {
48
50
  defaultValue: []
49
51
  }
50
52
  );
51
- return v({
53
+ return y({
52
54
  request: p
53
- }), (a, G) => a.mode === "read" ? (o(), l(n, { key: 0 }, [
54
- e(F)(e(i)) ? (o(), l(n, { key: 0 }, [
55
- m(d(t.emptyText), 1)
56
- ], 64)) : (o(), l(n, { key: 1 }, [
57
- m(d(e(u)?.filter((s) => e(i).indexOf(e(j)(s)) > -1).map((s) => e(z)(s)).join("、") || t.emptyText), 1)
55
+ }), (a, W) => a.mode === "read" ? (o(), r(s, { key: 0 }, [
56
+ e(M)(e(i)) ? (o(), r(s, { key: 0 }, [
57
+ d(c(t.emptyText), 1)
58
+ ], 64)) : (o(), r(s, { key: 1 }, [
59
+ d(c(e(u)?.filter((l) => e(i).indexOf(e(H)(l)) > -1).map((l) => e(J)(l)).join("、") || t.emptyText), 1)
58
60
  ], 64))
59
- ], 64)) : (o(), l(n, { key: 1 }, [
60
- r.value ? (o(), c(e(T), {
61
+ ], 64)) : (o(), r(s, { key: 1 }, [
62
+ n.value ? (o(), f(e(D), {
61
63
  key: 0,
62
64
  size: "small"
63
- })) : (o(), c(e(U), O(
64
- { key: 1 },
65
- e(N)(t, [
66
- "onUpdate:value",
67
- "value",
68
- "request",
69
- "vertical",
70
- "emptyText"
71
- ]),
72
- {
73
- options: e(u),
74
- value: e(i),
75
- class: [e(h)(), a.vertical ? e(b)("vertical") : null, e(g)],
76
- "onUpdate:value": e(C)
77
- }
78
- ), null, 16, ["options", "value", "class", "onUpdate:value"]))
65
+ })) : (o(), f(e(E), F({ key: 1 }, h.value, {
66
+ options: e(u),
67
+ value: e(i),
68
+ class: [e(C)(), a.vertical ? e(S)("vertical") : null, e(V)],
69
+ "onUpdate:value": e(q)
70
+ }), N({ _: 2 }, [
71
+ z(g, (l, m) => ({
72
+ name: m,
73
+ fn: A((B) => [
74
+ L(a.$slots, m, j(w(B || {})))
75
+ ])
76
+ }))
77
+ ]), 1040, ["options", "value", "class", "onUpdate:value"]))
79
78
  ], 64));
80
79
  }
81
80
  });
82
81
  export {
83
- W as default
82
+ ne as default
84
83
  };
@@ -8,6 +8,7 @@ const g = /* @__PURE__ */ r({
8
8
  mode: { default: "edit" },
9
9
  class: {},
10
10
  style: {},
11
+ emptyText: { default: "--" },
11
12
  defaultValue: {},
12
13
  value: {},
13
14
  onChange: {},
@@ -17,7 +18,6 @@ const g = /* @__PURE__ */ r({
17
18
  options: { default: () => [] },
18
19
  disabled: { type: Boolean, default: void 0 },
19
20
  id: {},
20
- emptyText: { default: "--" },
21
21
  request: {},
22
22
  vertical: { type: Boolean }
23
23
  },