@aplus-frontend/ui 7.13.4 → 7.13.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/src/ap-field/select/index.vue.mjs +130 -118
- package/es/src/ap-field/style/select.mjs +16 -13
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-field/style/select.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Select as
|
|
3
|
-
import { debounce as
|
|
1
|
+
import { defineComponent as te, ref as V, shallowRef as le, computed as r, onMounted as ae, watch as ne, unref as l, createElementBlock as I, createBlock as x, openBlock as f, toDisplayString as C, mergeProps as re, h as se, createSlots as ue, withCtx as c, createVNode as w, normalizeClass as p, createCommentVNode as _, createElementVNode as S, withModifiers as ie, renderList as ce, renderSlot as pe, normalizeProps as de, guardReactiveProps as fe, resolveDynamicComponent as me } from "vue";
|
|
2
|
+
import { Select as ve, Flex as M, Checkbox as P, Spin as he } from "@aplus-frontend/antdv";
|
|
3
|
+
import { debounce as ye, isFunction as D, isArray as ge, isNil as Ce, omit as we, isNumber as Se } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
|
+
import "../../utils/index.mjs";
|
|
5
6
|
import "../../hooks/index.mjs";
|
|
6
|
-
import { useDefaultPlaceholder as
|
|
7
|
-
import
|
|
8
|
-
import { useSelectOptions as
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
import { useLocale as
|
|
11
|
-
import { useControllableValue as
|
|
12
|
-
|
|
7
|
+
import { useDefaultPlaceholder as be } from "../hooks/use-default-placeholder.mjs";
|
|
8
|
+
import Be from "../style/index.mjs";
|
|
9
|
+
import { useSelectOptions as ke } from "./use-select-options.mjs";
|
|
10
|
+
import { useNamespace as xe } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
import { useLocale as Oe } from "../../config-provider/hooks/use-locale.mjs";
|
|
12
|
+
import { useControllableValue as Fe } from "../../hooks/useControllableValue.mjs";
|
|
13
|
+
import { isDef as T } from "../../utils/is.mjs";
|
|
14
|
+
const Ne = { key: 0 }, Ae = ["onClick"], Ke = /* @__PURE__ */ te({
|
|
13
15
|
name: "ApFieldSelect",
|
|
14
16
|
__name: "index",
|
|
15
17
|
props: {
|
|
@@ -106,44 +108,44 @@ const Oe = { key: 0 }, xe = ["onClick"], ze = /* @__PURE__ */ Z({
|
|
|
106
108
|
allowOnlySelect: { type: Boolean, default: !0 }
|
|
107
109
|
},
|
|
108
110
|
emits: ["update:value"],
|
|
109
|
-
setup(
|
|
110
|
-
let
|
|
111
|
-
const e =
|
|
112
|
-
if (!
|
|
111
|
+
setup(q, { expose: R, emit: L }) {
|
|
112
|
+
let s = 0;
|
|
113
|
+
const e = q, { b: u } = xe("field-select"), z = Be("field"), O = V(!1), { t: F } = Oe(), U = ye((o) => {
|
|
114
|
+
if (!D(e.request))
|
|
113
115
|
return;
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
v([]),
|
|
117
|
-
|
|
116
|
+
s += 1;
|
|
117
|
+
const a = s;
|
|
118
|
+
v([]), n.value = !0, e.request(o).then((t) => {
|
|
119
|
+
s === a && (v(t), n.value = !1);
|
|
118
120
|
});
|
|
119
|
-
}, e.searchDelay),
|
|
121
|
+
}, e.searchDelay), $ = (o, a) => {
|
|
120
122
|
const t = e.fieldNames?.label || "label";
|
|
121
|
-
return typeof
|
|
122
|
-
}, { options: m, updateOptions: v } =
|
|
123
|
+
return typeof a?.[t] == "string" && a[t].toLowerCase().indexOf(o.toLowerCase()) > -1;
|
|
124
|
+
}, { options: m, updateOptions: v } = ke(e), b = le(), n = V(e?.loading || !1), K = L, j = r(() => {
|
|
123
125
|
if (e.multiple)
|
|
124
126
|
return e.tokenSeparators ? "tags" : "multiple";
|
|
125
127
|
});
|
|
126
128
|
async function h(o = !0) {
|
|
127
|
-
if (!
|
|
129
|
+
if (!D(e.request))
|
|
128
130
|
return;
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
+
n.value = !0, s += 1;
|
|
132
|
+
const a = s;
|
|
131
133
|
try {
|
|
132
134
|
o && v([]);
|
|
133
135
|
const t = await e.request(void 0, e.params);
|
|
134
|
-
if (
|
|
136
|
+
if (a !== s)
|
|
135
137
|
return;
|
|
136
138
|
v(t);
|
|
137
139
|
} finally {
|
|
138
|
-
|
|
140
|
+
n.value = !1;
|
|
139
141
|
}
|
|
140
142
|
}
|
|
141
|
-
function
|
|
142
|
-
e.onFocus?.(o), e.refetchOnFocus &&
|
|
143
|
+
function E(o) {
|
|
144
|
+
e.onFocus?.(o), e.refetchOnFocus && s > 0 && !n.value && h(!0);
|
|
143
145
|
}
|
|
144
|
-
|
|
146
|
+
ae(() => {
|
|
145
147
|
e.lazy || h();
|
|
146
|
-
}),
|
|
148
|
+
}), ne(
|
|
147
149
|
() => e.params,
|
|
148
150
|
() => {
|
|
149
151
|
h();
|
|
@@ -152,27 +154,27 @@ const Oe = { key: 0 }, xe = ["onClick"], ze = /* @__PURE__ */ Z({
|
|
|
152
154
|
deep: !0
|
|
153
155
|
}
|
|
154
156
|
);
|
|
155
|
-
const { value: i, updateValue: y } =
|
|
156
|
-
const o =
|
|
157
|
+
const { value: i, updateValue: y } = Fe(e, K), H = be("Select", e), W = r(() => {
|
|
158
|
+
const o = l(i);
|
|
157
159
|
if (!o)
|
|
158
160
|
return e.emptyText;
|
|
159
|
-
const
|
|
160
|
-
return
|
|
161
|
-
(
|
|
162
|
-
).filter(Boolean).join("、") || e.emptyText :
|
|
163
|
-
(
|
|
164
|
-
)?.[
|
|
165
|
-
}),
|
|
166
|
-
const o = !!e?.showSearch,
|
|
161
|
+
const a = e.fieldNames?.label || "label", t = e.fieldNames?.value || "value";
|
|
162
|
+
return ge(o) ? o.map(
|
|
163
|
+
(d) => l(m).find((oe) => oe[t] === d)?.[a]
|
|
164
|
+
).filter(Boolean).join("、") || e.emptyText : l(m).find(
|
|
165
|
+
(d) => d[t] === o
|
|
166
|
+
)?.[a] || e.emptyText;
|
|
167
|
+
}), G = r(() => {
|
|
168
|
+
const o = !!e?.showSearch, a = e.searchMode;
|
|
167
169
|
let t = {};
|
|
168
|
-
return o && (t =
|
|
170
|
+
return o && (t = a === "request" ? {
|
|
169
171
|
defaultActiveFirstOption: !1,
|
|
170
|
-
onSearch:
|
|
171
|
-
notFoundContent:
|
|
172
|
+
onSearch: U,
|
|
173
|
+
notFoundContent: n.value ? void 0 : null,
|
|
172
174
|
filterOption: !1,
|
|
173
175
|
suffixIcon: null
|
|
174
176
|
} : {
|
|
175
|
-
filterOption:
|
|
177
|
+
filterOption: Ce(e?.filterOption) ? $ : e?.filterOption
|
|
176
178
|
}), {
|
|
177
179
|
...we(e, [
|
|
178
180
|
"mode",
|
|
@@ -184,119 +186,129 @@ const Oe = { key: 0 }, xe = ["onClick"], ze = /* @__PURE__ */ Z({
|
|
|
184
186
|
"onFocus",
|
|
185
187
|
"onBeforeSelect"
|
|
186
188
|
]),
|
|
187
|
-
placeholder:
|
|
189
|
+
placeholder: l(H),
|
|
188
190
|
...t
|
|
189
191
|
};
|
|
190
|
-
}), g =
|
|
192
|
+
}), g = r(
|
|
191
193
|
() => m.value.map((o) => o[e.fieldNames?.value || "value"])
|
|
192
|
-
),
|
|
193
|
-
|
|
194
|
-
|
|
194
|
+
), N = r(() => !e.multiple || T(e.maxCount) ? !1 : Se(e.addAll) ? g.value.length >= e.addAll : !!e.addAll), J = r(
|
|
195
|
+
() => e.multiple && e.allowOnlySelect && (!T(e.maxCount) || e.maxCount >= 1)
|
|
196
|
+
);
|
|
197
|
+
function Q() {
|
|
198
|
+
b.value?.focus();
|
|
195
199
|
}
|
|
196
|
-
function
|
|
197
|
-
|
|
200
|
+
function X() {
|
|
201
|
+
b.value?.blur();
|
|
198
202
|
}
|
|
199
|
-
function
|
|
200
|
-
const t = e.fieldNames?.[
|
|
203
|
+
function B(o, a) {
|
|
204
|
+
const t = e.fieldNames?.[a] ?? a;
|
|
201
205
|
return o[t];
|
|
202
206
|
}
|
|
203
|
-
function
|
|
204
|
-
const
|
|
205
|
-
y(e.multiple ? [
|
|
207
|
+
function Y(o) {
|
|
208
|
+
const a = B(o, "value");
|
|
209
|
+
y(e.multiple ? [a] : a);
|
|
206
210
|
}
|
|
207
|
-
const A =
|
|
208
|
-
const o =
|
|
209
|
-
return
|
|
210
|
-
}),
|
|
211
|
-
function
|
|
211
|
+
const A = r(() => {
|
|
212
|
+
const o = l(i) || [], a = g.value;
|
|
213
|
+
return a.length > 0 && a.every((t) => o.includes(t));
|
|
214
|
+
}), Z = r(() => (l(i) || []).length > 0 && !A.value);
|
|
215
|
+
function ee() {
|
|
212
216
|
console.log("123");
|
|
213
|
-
const o =
|
|
214
|
-
|
|
217
|
+
const o = l(i) || [], a = g.value;
|
|
218
|
+
a.length && a.every((t) => o?.includes(t)) ? y([]) : y(g.value);
|
|
215
219
|
}
|
|
216
|
-
return
|
|
217
|
-
focus:
|
|
218
|
-
blur:
|
|
220
|
+
return R({
|
|
221
|
+
focus: Q,
|
|
222
|
+
blur: X,
|
|
219
223
|
request: h
|
|
220
|
-
}), (o,
|
|
224
|
+
}), (o, a) => o.mode === "read" ? (f(), I("span", Ne, C(W.value), 1)) : (f(), x(l(ve), re({
|
|
221
225
|
key: 1,
|
|
222
226
|
ref_key: "selectRef",
|
|
223
|
-
ref:
|
|
227
|
+
ref: b,
|
|
224
228
|
"allow-clear": ""
|
|
225
|
-
},
|
|
226
|
-
mode:
|
|
227
|
-
value:
|
|
228
|
-
options:
|
|
229
|
-
loading:
|
|
230
|
-
"menu-item-selected-icon":
|
|
231
|
-
"popup-class-name": `${
|
|
232
|
-
open:
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
229
|
+
}, G.value, {
|
|
230
|
+
mode: j.value,
|
|
231
|
+
value: l(i),
|
|
232
|
+
options: l(m),
|
|
233
|
+
loading: n.value,
|
|
234
|
+
"menu-item-selected-icon": se("span"),
|
|
235
|
+
"popup-class-name": `${l(u)("popup")} ${l(z)}`,
|
|
236
|
+
open: O.value,
|
|
237
|
+
virtual: !1,
|
|
238
|
+
"onUpdate:value": l(y),
|
|
239
|
+
onFocus: E,
|
|
240
|
+
onDropdownVisibleChange: a[0] || (a[0] = (t) => O.value = t)
|
|
241
|
+
}), ue({
|
|
242
|
+
option: c((t) => [
|
|
243
|
+
w(l(M), {
|
|
239
244
|
justify: "space-between",
|
|
240
245
|
align: "center",
|
|
241
|
-
class:
|
|
246
|
+
class: p(l(u)("popup-option-wrapper")),
|
|
242
247
|
gap: 8
|
|
243
248
|
}, {
|
|
244
|
-
default:
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
249
|
+
default: c(() => [
|
|
250
|
+
w(l(M), {
|
|
251
|
+
gap: 8,
|
|
252
|
+
align: "center"
|
|
253
|
+
}, {
|
|
254
|
+
default: c(() => [
|
|
255
|
+
N.value ? (f(), x(l(P), {
|
|
248
256
|
key: 0,
|
|
249
|
-
checked:
|
|
250
|
-
|
|
257
|
+
checked: l(i)?.includes(
|
|
258
|
+
B(t, "value")
|
|
251
259
|
)
|
|
252
260
|
}, null, 8, ["checked"])) : _("", !0),
|
|
253
|
-
|
|
254
|
-
class:
|
|
255
|
-
},
|
|
261
|
+
S("span", {
|
|
262
|
+
class: p(l(u)("popup-option-label"))
|
|
263
|
+
}, C(B(t, "label")), 3)
|
|
256
264
|
]),
|
|
257
265
|
_: 2
|
|
258
266
|
}, 1024),
|
|
259
|
-
|
|
267
|
+
J.value ? (f(), I("span", {
|
|
260
268
|
key: 0,
|
|
261
|
-
class:
|
|
262
|
-
onClick:
|
|
263
|
-
},
|
|
269
|
+
class: p(l(u)("popup-option-action")),
|
|
270
|
+
onClick: ie(() => Y(t), ["stop"])
|
|
271
|
+
}, C(l(F)("ap.field.chooseOnly")), 11, Ae)) : _("", !0)
|
|
264
272
|
]),
|
|
265
273
|
_: 2
|
|
266
274
|
}, 1032, ["class"])
|
|
267
275
|
]),
|
|
268
276
|
_: 2
|
|
269
277
|
}, [
|
|
270
|
-
|
|
271
|
-
name:
|
|
272
|
-
fn:
|
|
273
|
-
|
|
278
|
+
ce(o.$slots, (t, k) => ({
|
|
279
|
+
name: k,
|
|
280
|
+
fn: c((d) => [
|
|
281
|
+
pe(o.$slots, k, de(fe(d || {})))
|
|
274
282
|
])
|
|
275
283
|
})),
|
|
276
|
-
|
|
284
|
+
n.value ? {
|
|
277
285
|
name: "notFoundContent",
|
|
278
|
-
fn:
|
|
279
|
-
|
|
286
|
+
fn: c(() => [
|
|
287
|
+
w(l(he), { size: "small" })
|
|
280
288
|
]),
|
|
281
289
|
key: "0"
|
|
282
290
|
} : void 0,
|
|
283
|
-
|
|
291
|
+
N.value ? {
|
|
284
292
|
name: "dropdownRender",
|
|
285
|
-
fn:
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
class: f(n(u)("popup-all-option")),
|
|
289
|
-
onClick: X
|
|
293
|
+
fn: c(({ menuNode: t }) => [
|
|
294
|
+
S("div", {
|
|
295
|
+
class: p(l(u)("popup-all-option-wrapper"))
|
|
290
296
|
}, [
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
297
|
+
S("div", {
|
|
298
|
+
tabindex: -1,
|
|
299
|
+
class: p(l(u)("popup-all-option")),
|
|
300
|
+
onClick: ee
|
|
301
|
+
}, [
|
|
302
|
+
w(l(P), {
|
|
303
|
+
checked: A.value,
|
|
304
|
+
indeterminate: Z.value
|
|
305
|
+
}, null, 8, ["checked", "indeterminate"]),
|
|
306
|
+
S("span", {
|
|
307
|
+
class: p(l(u)("popup-all-option-label"))
|
|
308
|
+
}, C(l(F)("ap.field.selectAll")), 3)
|
|
309
|
+
], 2)
|
|
298
310
|
], 2),
|
|
299
|
-
(
|
|
311
|
+
(f(), x(me(t)))
|
|
300
312
|
]),
|
|
301
313
|
key: "1"
|
|
302
314
|
} : void 0
|
|
@@ -304,5 +316,5 @@ const Oe = { key: 0 }, xe = ["onClick"], ze = /* @__PURE__ */ Z({
|
|
|
304
316
|
}
|
|
305
317
|
});
|
|
306
318
|
export {
|
|
307
|
-
|
|
319
|
+
Ke as default
|
|
308
320
|
};
|
|
@@ -1,27 +1,32 @@
|
|
|
1
1
|
import { singleRow as l } from "../../style/index.mjs";
|
|
2
2
|
const n = (i) => {
|
|
3
|
-
const { componentCls:
|
|
3
|
+
const { componentCls: a } = i, p = `${a}-select-popup`;
|
|
4
4
|
return {
|
|
5
|
-
[`${
|
|
6
|
-
padding:
|
|
7
|
-
|
|
5
|
+
[`${p}`]: {
|
|
6
|
+
// padding: token.space,
|
|
7
|
+
padding: 0,
|
|
8
|
+
[`${p}-all-option-wrapper`]: {
|
|
9
|
+
padding: i.space,
|
|
10
|
+
paddingBlockEnd: i.spaceXS
|
|
11
|
+
},
|
|
12
|
+
[`${p}-all-option`]: {
|
|
8
13
|
width: "100%",
|
|
9
14
|
display: "inline-flex",
|
|
10
15
|
cursor: "pointer",
|
|
11
16
|
paddingInline: i.space,
|
|
12
17
|
paddingBlock: i.spaceSM,
|
|
13
|
-
[`${
|
|
18
|
+
[`${p}-all-option-label`]: {
|
|
14
19
|
paddingInline: i.space
|
|
15
20
|
}
|
|
16
21
|
},
|
|
17
|
-
[`${
|
|
22
|
+
[`${p}-option-wrapper`]: {
|
|
18
23
|
height: "22px"
|
|
19
24
|
},
|
|
20
|
-
[`${
|
|
25
|
+
[`${p}-option-label`]: {
|
|
21
26
|
...l(i),
|
|
22
27
|
color: "inherit"
|
|
23
28
|
},
|
|
24
|
-
[`${
|
|
29
|
+
[`${p}-option-action`]: {
|
|
25
30
|
display: "none",
|
|
26
31
|
color: i.colorPrimary,
|
|
27
32
|
paddingInline: i.spaceSM,
|
|
@@ -37,16 +42,14 @@ const n = (i) => {
|
|
|
37
42
|
paddingBlock: i.spaceXS,
|
|
38
43
|
fontWeight: "normal !important",
|
|
39
44
|
marginBottom: i.spaceXS,
|
|
45
|
+
marginInline: i.space,
|
|
40
46
|
"&:hover": {
|
|
41
|
-
[`${
|
|
47
|
+
[`${p}-option-action`]: {
|
|
42
48
|
display: "inline"
|
|
43
49
|
}
|
|
44
50
|
},
|
|
45
51
|
"&:last-child": {
|
|
46
|
-
marginBottom:
|
|
47
|
-
},
|
|
48
|
-
"&.ant-select-item-option-selected:not(.ant-select-item-option-disabled)": {
|
|
49
|
-
color: i.colorPrimary
|
|
52
|
+
marginBottom: i.space
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
55
|
}
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.13.
|
|
1
|
+
declare const _default: "7.13.6";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("@aplus-frontend/antdv"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("@aplus-frontend/antdv"),s=require("lodash-unified");require("../../config-provider/index.js");require("../../utils/index.js");require("../../hooks/index.js");const j=require("../hooks/use-default-placeholder.js"),K=require("../style/index.js"),H=require("./use-select-options.js"),W=require("../../config-provider/hooks/use-namespace.js"),G=require("../../config-provider/hooks/use-locale.js"),J=require("../../hooks/useControllableValue.js"),B=require("../../utils/is.js"),Q={key:0},X=["onClick"],Y=e.defineComponent({name:"ApFieldSelect",__name:"index",props:{mode:{default:"edit"},class:{},style:{},defaultValue:{},notFoundContent:{},suffixIcon:{},itemIcon:{},size:{},bordered:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:void 0},variant:{},maxCount:{},transitionName:{},choiceTransitionName:{},popupClassName:{},dropdownClassName:{},placement:{},status:{},children:{},listHeight:{},onMouseenter:{},onMouseleave:{},tabindex:{},onClick:{},onFocus:{},onBlur:{},onChange:{},onKeydown:{},onKeyup:{},onMousedown:{},onSelect:{},open:{type:Boolean,default:void 0},animation:{},direction:{},disabled:{type:Boolean,default:void 0},prefixCls:{},id:{},autofocus:{type:Boolean,default:void 0},getPopupContainer:{},virtual:{type:Boolean,default:void 0},dropdownMatchSelectWidth:{},placeholder:{},loading:{type:Boolean,default:void 0},prefix:{},clearIcon:{},allowClear:{type:Boolean,default:!0},fieldNames:{},inputValue:{},searchValue:{},autoClearSearchValue:{type:Boolean,default:void 0},onDeselect:{},onActive:{},filterOption:{},filterSort:{},optionFilterProp:{},optionLabelProp:{},options:{},defaultActiveFirstOption:{type:Boolean,default:void 0},listItemHeight:{},onClickOption:{},menuItemSelectedIcon:{},labelInValue:{type:Boolean,default:void 0},showSearch:{type:Boolean,default:void 0},tagRender:{},optionLabelRender:{},onClear:{},defaultOpen:{type:Boolean,default:void 0},onDropdownVisibleChange:{},maxTagTextLength:{},maxTagCount:{},maxTagPlaceholder:{},tokenSeparators:{},removeIcon:{},dropdownStyle:{},dropdownRender:{},dropdownAlign:{},showAction:{},onPopupScroll:{},onInputKeyDown:{},emptyText:{default:"--"},request:{},multiple:{type:Boolean,default:void 0},value:{},"onUpdate:value":{},searchMode:{default:"filter"},refetchOnFocus:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},addAll:{type:[Boolean,Number],default:5},params:{},searchDelay:{default:300},allowOnlySelect:{type:Boolean,default:!0}},emits:["update:value"],setup(x,{expose:N,emit:O}){let u=0;const t=x,{b:r}=W.useNamespace("field-select"),V=K.default("field"),w=e.ref(!1),{t:S}=G.useLocale(),F=s.debounce(o=>{if(!s.isFunction(t.request))return;u+=1;const n=u;f([]),a.value=!0,t.request(o).then(l=>{u===n&&(f(l),a.value=!1)})},t.searchDelay),q=(o,n)=>{const l=t.fieldNames?.label||"label";return typeof n?.[l]=="string"&&n[l].toLowerCase().indexOf(o.toLowerCase())>-1},{options:p,updateOptions:f}=H.useSelectOptions(t),y=e.shallowRef(),a=e.ref(t?.loading||!1),A=O,_=e.computed(()=>{if(t.multiple)return t.tokenSeparators?"tags":"multiple"});async function m(o=!0){if(!s.isFunction(t.request))return;a.value=!0,u+=1;const n=u;try{o&&f([]);const l=await t.request(void 0,t.params);if(n!==u)return;f(l)}finally{a.value=!1}}function I(o){t.onFocus?.(o),t.refetchOnFocus&&u>0&&!a.value&&m(!0)}e.onMounted(()=>{t.lazy||m()}),e.watch(()=>t.params,()=>{m()},{deep:!0});const{value:i,updateValue:v}=J.useControllableValue(t,A),D=j.useDefaultPlaceholder("Select",t),M=e.computed(()=>{const o=e.unref(i);if(!o)return t.emptyText;const n=t.fieldNames?.label||"label",l=t.fieldNames?.value||"value";return s.isArray(o)?o.map(d=>e.unref(p).find($=>$[l]===d)?.[n]).filter(Boolean).join("、")||t.emptyText:e.unref(p).find(d=>d[l]===o)?.[n]||t.emptyText}),P=e.computed(()=>{const o=!!t?.showSearch,n=t.searchMode;let l={};return o&&(l=n==="request"?{defaultActiveFirstOption:!1,onSearch:F,notFoundContent:a.value?void 0:null,filterOption:!1,suffixIcon:null}:{filterOption:s.isNil(t?.filterOption)?q:t?.filterOption}),{...s.omit(t,["mode","value","onUpdate:value","onSearch","request","searchMode","onFocus","onBeforeSelect"]),placeholder:e.unref(D),...l}}),h=e.computed(()=>p.value.map(o=>o[t.fieldNames?.value||"value"])),b=e.computed(()=>!t.multiple||B.isDef(t.maxCount)?!1:s.isNumber(t.addAll)?h.value.length>=t.addAll:!!t.addAll),z=e.computed(()=>t.multiple&&t.allowOnlySelect&&(!B.isDef(t.maxCount)||t.maxCount>=1));function T(){y.value?.focus()}function L(){y.value?.blur()}function C(o,n){const l=t.fieldNames?.[n]??n;return o[l]}function R(o){const n=C(o,"value");v(t.multiple?[n]:n)}const k=e.computed(()=>{const o=e.unref(i)||[],n=h.value;return n.length>0&&n.every(l=>o.includes(l))}),E=e.computed(()=>(e.unref(i)||[]).length>0&&!k.value);function U(){console.log("123");const o=e.unref(i)||[],n=h.value;n.length&&n.every(l=>o?.includes(l))?v([]):v(h.value)}return N({focus:T,blur:L,request:m}),(o,n)=>o.mode==="read"?(e.openBlock(),e.createElementBlock("span",Q,e.toDisplayString(M.value),1)):(e.openBlock(),e.createBlock(e.unref(c.Select),e.mergeProps({key:1,ref_key:"selectRef",ref:y,"allow-clear":""},P.value,{mode:_.value,value:e.unref(i),options:e.unref(p),loading:a.value,"menu-item-selected-icon":e.h("span"),"popup-class-name":`${e.unref(r)("popup")} ${e.unref(V)}`,open:w.value,virtual:!1,"onUpdate:value":e.unref(v),onFocus:I,onDropdownVisibleChange:n[0]||(n[0]=l=>w.value=l)}),e.createSlots({option:e.withCtx(l=>[e.createVNode(e.unref(c.Flex),{justify:"space-between",align:"center",class:e.normalizeClass(e.unref(r)("popup-option-wrapper")),gap:8},{default:e.withCtx(()=>[e.createVNode(e.unref(c.Flex),{gap:8,align:"center"},{default:e.withCtx(()=>[b.value?(e.openBlock(),e.createBlock(e.unref(c.Checkbox),{key:0,checked:e.unref(i)?.includes(C(l,"value"))},null,8,["checked"])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(e.unref(r)("popup-option-label"))},e.toDisplayString(C(l,"label")),3)]),_:2},1024),z.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(r)("popup-option-action")),onClick:e.withModifiers(()=>R(l),["stop"])},e.toDisplayString(e.unref(S)("ap.field.chooseOnly")),11,X)):e.createCommentVNode("",!0)]),_:2},1032,["class"])]),_:2},[e.renderList(o.$slots,(l,g)=>({name:g,fn:e.withCtx(d=>[e.renderSlot(o.$slots,g,e.normalizeProps(e.guardReactiveProps(d||{})))])})),a.value?{name:"notFoundContent",fn:e.withCtx(()=>[e.createVNode(e.unref(c.Spin),{size:"small"})]),key:"0"}:void 0,b.value?{name:"dropdownRender",fn:e.withCtx(({menuNode:l})=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r)("popup-all-option-wrapper"))},[e.createElementVNode("div",{tabindex:-1,class:e.normalizeClass(e.unref(r)("popup-all-option")),onClick:U},[e.createVNode(e.unref(c.Checkbox),{checked:k.value,indeterminate:E.value},null,8,["checked","indeterminate"]),e.createElementVNode("span",{class:e.normalizeClass(e.unref(r)("popup-all-option-label"))},e.toDisplayString(e.unref(S)("ap.field.selectAll")),3)],2)],2),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l)))]),key:"1"}:void 0]),1040,["mode","value","options","loading","menu-item-selected-icon","popup-class-name","open","onUpdate:value"]))}});exports.default=Y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../style/index.js"),n=i=>{const{componentCls:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../style/index.js"),n=i=>{const{componentCls:a}=i,p=`${a}-select-popup`;return{[`${p}`]:{padding:0,[`${p}-all-option-wrapper`]:{padding:i.space,paddingBlockEnd:i.spaceXS},[`${p}-all-option`]:{width:"100%",display:"inline-flex",cursor:"pointer",paddingInline:i.space,paddingBlock:i.spaceSM,[`${p}-all-option-label`]:{paddingInline:i.space}},[`${p}-option-wrapper`]:{height:"22px"},[`${p}-option-label`]:{...l.singleRow(i),color:"inherit"},[`${p}-option-action`]:{display:"none",color:i.colorPrimary,paddingInline:i.spaceSM,paddingBlock:i.spaceXXS,"&:hover":{background:i.colorPrimary,color:"#fff",borderRadius:"2px"}},"div.ant-select-item":{paddingInline:i.space,paddingBlock:i.spaceXS,fontWeight:"normal !important",marginBottom:i.spaceXS,marginInline:i.space,"&:hover":{[`${p}-option-action`]:{display:"inline"}},"&:last-child":{marginBottom:i.space}}}}};exports.genSelectStyle=n;
|
package/lib/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.13.
|
|
1
|
+
declare const _default: "7.13.6";
|
|
2
2
|
export default _default;
|
package/lib/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.13.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.13.6";exports.default=e;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aplus-frontend/ui",
|
|
3
|
-
"version": "7.13.
|
|
3
|
+
"version": "7.13.6",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
"@aplus-frontend/utils": "1.0.65"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@aplus-frontend/antdv": "^2.0.
|
|
47
|
+
"@aplus-frontend/antdv": "^2.0.5",
|
|
48
48
|
"@aplus-frontend/icon": "^2.0.6",
|
|
49
49
|
"@aplus-frontend/oss": "^2.0.1",
|
|
50
50
|
"vue": "^3.5.21",
|
|
51
51
|
"vxe-table": "^4.13.37"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@aplus-frontend/antdv": "^2.0.
|
|
54
|
+
"@aplus-frontend/antdv": "^2.0.5",
|
|
55
55
|
"@aplus-frontend/icon": "^2.0.6",
|
|
56
56
|
"@aplus-frontend/oss": "^2.0.1",
|
|
57
57
|
"@emotion/serialize": "^1.3.3",
|