@aplus-frontend/ui 7.13.3 → 7.13.5
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 +89 -81
- package/es/src/ap-field/style/select.mjs +13 -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 ne, watch as ae, unref as n, createElementBlock as I, createBlock as k, openBlock as p, toDisplayString as C, mergeProps as re, h as se, createSlots as ue, withCtx as c, createVNode as w, normalizeClass as f, createCommentVNode as _, createElementVNode as x, withModifiers as ie, renderList as ce, renderSlot as de, normalizeProps as pe, 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 l =
|
|
116
|
+
s += 1;
|
|
117
|
+
const l = s;
|
|
116
118
|
v([]), a.value = !0, e.request(o).then((t) => {
|
|
117
|
-
|
|
119
|
+
s === l && (v(t), a.value = !1);
|
|
118
120
|
});
|
|
119
|
-
}, e.searchDelay),
|
|
121
|
+
}, e.searchDelay), $ = (o, l) => {
|
|
120
122
|
const t = e.fieldNames?.label || "label";
|
|
121
123
|
return typeof l?.[t] == "string" && l[t].toLowerCase().indexOf(o.toLowerCase()) > -1;
|
|
122
|
-
}, { options: m, updateOptions: v } =
|
|
124
|
+
}, { options: m, updateOptions: v } = ke(e), S = le(), a = 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
|
-
a.value = !0,
|
|
130
|
-
const l =
|
|
131
|
+
a.value = !0, s += 1;
|
|
132
|
+
const l = s;
|
|
131
133
|
try {
|
|
132
134
|
o && v([]);
|
|
133
135
|
const t = await e.request(void 0, e.params);
|
|
134
|
-
if (l !==
|
|
136
|
+
if (l !== s)
|
|
135
137
|
return;
|
|
136
138
|
v(t);
|
|
137
139
|
} finally {
|
|
138
140
|
a.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 && !a.value && h(!0);
|
|
143
145
|
}
|
|
144
|
-
|
|
146
|
+
ne(() => {
|
|
145
147
|
e.lazy || h();
|
|
146
|
-
}),
|
|
148
|
+
}), ae(
|
|
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 } =
|
|
157
|
+
const { value: i, updateValue: y } = Fe(e, K), H = be("Select", e), W = r(() => {
|
|
156
158
|
const o = n(i);
|
|
157
159
|
if (!o)
|
|
158
160
|
return e.emptyText;
|
|
159
161
|
const l = e.fieldNames?.label || "label", t = e.fieldNames?.value || "value";
|
|
160
|
-
return
|
|
161
|
-
(
|
|
162
|
+
return ge(o) ? o.map(
|
|
163
|
+
(d) => n(m).find((oe) => oe[t] === d)?.[l]
|
|
162
164
|
).filter(Boolean).join("、") || e.emptyText : n(m).find(
|
|
163
|
-
(
|
|
165
|
+
(d) => d[t] === o
|
|
164
166
|
)?.[l] || e.emptyText;
|
|
165
|
-
}),
|
|
167
|
+
}), G = r(() => {
|
|
166
168
|
const o = !!e?.showSearch, l = e.searchMode;
|
|
167
169
|
let t = {};
|
|
168
170
|
return o && (t = l === "request" ? {
|
|
169
171
|
defaultActiveFirstOption: !1,
|
|
170
|
-
onSearch:
|
|
172
|
+
onSearch: U,
|
|
171
173
|
notFoundContent: a.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,118 +186,124 @@ const Oe = { key: 0 }, xe = ["onClick"], ze = /* @__PURE__ */ Z({
|
|
|
184
186
|
"onFocus",
|
|
185
187
|
"onBeforeSelect"
|
|
186
188
|
]),
|
|
187
|
-
placeholder: n(
|
|
189
|
+
placeholder: n(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
|
+
), 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() {
|
|
194
198
|
S.value?.focus();
|
|
195
199
|
}
|
|
196
|
-
function
|
|
200
|
+
function X() {
|
|
197
201
|
S.value?.blur();
|
|
198
202
|
}
|
|
199
203
|
function b(o, l) {
|
|
200
204
|
const t = e.fieldNames?.[l] ?? l;
|
|
201
205
|
return o[t];
|
|
202
206
|
}
|
|
203
|
-
function
|
|
207
|
+
function Y(o) {
|
|
204
208
|
const l = b(o, "value");
|
|
205
209
|
y(e.multiple ? [l] : l);
|
|
206
210
|
}
|
|
207
|
-
const A =
|
|
211
|
+
const A = r(() => {
|
|
208
212
|
const o = n(i) || [], l = g.value;
|
|
209
213
|
return l.length > 0 && l.every((t) => o.includes(t));
|
|
210
|
-
}),
|
|
211
|
-
function
|
|
214
|
+
}), Z = r(() => (n(i) || []).length > 0 && !A.value);
|
|
215
|
+
function ee() {
|
|
212
216
|
console.log("123");
|
|
213
217
|
const o = n(i) || [], l = g.value;
|
|
214
218
|
l.length && l.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, l) => o.mode === "read" ? (p(), I("span",
|
|
224
|
+
}), (o, l) => o.mode === "read" ? (p(), I("span", Ne, C(W.value), 1)) : (p(), k(n(ve), re({
|
|
221
225
|
key: 1,
|
|
222
226
|
ref_key: "selectRef",
|
|
223
227
|
ref: S,
|
|
224
228
|
"allow-clear": ""
|
|
225
|
-
},
|
|
226
|
-
mode:
|
|
229
|
+
}, G.value, {
|
|
230
|
+
mode: j.value,
|
|
227
231
|
value: n(i),
|
|
228
232
|
options: n(m),
|
|
229
233
|
loading: a.value,
|
|
230
|
-
"menu-item-selected-icon":
|
|
231
|
-
"popup-class-name": `${n(u)("popup")} ${n(
|
|
232
|
-
open:
|
|
234
|
+
"menu-item-selected-icon": se("span"),
|
|
235
|
+
"popup-class-name": `${n(u)("popup")} ${n(z)}`,
|
|
236
|
+
open: O.value,
|
|
233
237
|
"onUpdate:value": n(y),
|
|
234
|
-
onFocus:
|
|
235
|
-
onDropdownVisibleChange: l[0] || (l[0] = (t) =>
|
|
236
|
-
}),
|
|
237
|
-
option:
|
|
238
|
-
|
|
238
|
+
onFocus: E,
|
|
239
|
+
onDropdownVisibleChange: l[0] || (l[0] = (t) => O.value = t)
|
|
240
|
+
}), ue({
|
|
241
|
+
option: c((t) => [
|
|
242
|
+
w(n(M), {
|
|
239
243
|
justify: "space-between",
|
|
240
244
|
align: "center",
|
|
241
245
|
class: f(n(u)("popup-option-wrapper")),
|
|
242
246
|
gap: 8
|
|
243
247
|
}, {
|
|
244
|
-
default:
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
+
default: c(() => [
|
|
249
|
+
w(n(M), {
|
|
250
|
+
gap: 8,
|
|
251
|
+
align: "center"
|
|
252
|
+
}, {
|
|
253
|
+
default: c(() => [
|
|
254
|
+
N.value ? (p(), k(n(P), {
|
|
248
255
|
key: 0,
|
|
249
256
|
checked: n(i)?.includes(
|
|
250
257
|
b(t, "value")
|
|
251
258
|
)
|
|
252
259
|
}, null, 8, ["checked"])) : _("", !0),
|
|
253
|
-
|
|
260
|
+
x("span", {
|
|
254
261
|
class: f(n(u)("popup-option-label"))
|
|
255
|
-
},
|
|
262
|
+
}, C(b(t, "label")), 3)
|
|
256
263
|
]),
|
|
257
264
|
_: 2
|
|
258
265
|
}, 1024),
|
|
259
|
-
|
|
266
|
+
J.value ? (p(), I("span", {
|
|
260
267
|
key: 0,
|
|
261
268
|
class: f(n(u)("popup-option-action")),
|
|
262
|
-
onClick:
|
|
263
|
-
},
|
|
269
|
+
onClick: ie(() => Y(t), ["stop"])
|
|
270
|
+
}, C(n(F)("ap.field.chooseOnly")), 11, Ae)) : _("", !0)
|
|
264
271
|
]),
|
|
265
272
|
_: 2
|
|
266
273
|
}, 1032, ["class"])
|
|
267
274
|
]),
|
|
268
275
|
_: 2
|
|
269
276
|
}, [
|
|
270
|
-
|
|
277
|
+
ce(o.$slots, (t, B) => ({
|
|
271
278
|
name: B,
|
|
272
|
-
fn:
|
|
273
|
-
|
|
279
|
+
fn: c((d) => [
|
|
280
|
+
de(o.$slots, B, pe(fe(d || {})))
|
|
274
281
|
])
|
|
275
282
|
})),
|
|
276
283
|
a.value ? {
|
|
277
284
|
name: "notFoundContent",
|
|
278
|
-
fn:
|
|
279
|
-
|
|
285
|
+
fn: c(() => [
|
|
286
|
+
w(n(he), { size: "small" })
|
|
280
287
|
]),
|
|
281
288
|
key: "0"
|
|
282
289
|
} : void 0,
|
|
283
|
-
|
|
290
|
+
N.value ? {
|
|
284
291
|
name: "dropdownRender",
|
|
285
|
-
fn:
|
|
286
|
-
|
|
292
|
+
fn: c(({ menuNode: t }) => [
|
|
293
|
+
x("div", {
|
|
294
|
+
tabindex: -1,
|
|
287
295
|
class: f(n(u)("popup-all-option")),
|
|
288
|
-
onClick:
|
|
296
|
+
onClick: ee
|
|
289
297
|
}, [
|
|
290
|
-
|
|
298
|
+
w(n(P), {
|
|
291
299
|
checked: A.value,
|
|
292
|
-
indeterminate:
|
|
300
|
+
indeterminate: Z.value
|
|
293
301
|
}, null, 8, ["checked", "indeterminate"]),
|
|
294
|
-
|
|
302
|
+
x("span", {
|
|
295
303
|
class: f(n(u)("popup-all-option-label"))
|
|
296
|
-
},
|
|
304
|
+
}, C(n(F)("ap.field.selectAll")), 3)
|
|
297
305
|
], 2),
|
|
298
|
-
(p(), k(
|
|
306
|
+
(p(), k(me(t)))
|
|
299
307
|
]),
|
|
300
308
|
key: "1"
|
|
301
309
|
} : void 0
|
|
@@ -303,5 +311,5 @@ const Oe = { key: 0 }, xe = ["onClick"], ze = /* @__PURE__ */ Z({
|
|
|
303
311
|
}
|
|
304
312
|
});
|
|
305
313
|
export {
|
|
306
|
-
|
|
314
|
+
Ke as default
|
|
307
315
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { singleRow as
|
|
1
|
+
import { singleRow as a } from "../../style/index.mjs";
|
|
2
2
|
const n = (i) => {
|
|
3
|
-
const { componentCls:
|
|
3
|
+
const { componentCls: o } = i, p = `${o}-select-popup`;
|
|
4
4
|
return {
|
|
5
|
-
[`${
|
|
5
|
+
[`${p}`]: {
|
|
6
6
|
padding: i.space,
|
|
7
|
-
[`${
|
|
7
|
+
[`${p}-all-option`]: {
|
|
8
8
|
width: "100%",
|
|
9
9
|
display: "inline-flex",
|
|
10
10
|
cursor: "pointer",
|
|
11
11
|
paddingInline: i.space,
|
|
12
12
|
paddingBlock: i.spaceSM,
|
|
13
|
-
[`${
|
|
13
|
+
[`${p}-all-option-label`]: {
|
|
14
14
|
paddingInline: i.space
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
|
-
[`${
|
|
17
|
+
[`${p}-option-wrapper`]: {
|
|
18
18
|
height: "22px"
|
|
19
19
|
},
|
|
20
|
-
[`${
|
|
21
|
-
...
|
|
20
|
+
[`${p}-option-label`]: {
|
|
21
|
+
...a(i),
|
|
22
22
|
color: "inherit"
|
|
23
23
|
},
|
|
24
|
-
[`${
|
|
24
|
+
[`${p}-option-action`]: {
|
|
25
25
|
display: "none",
|
|
26
26
|
color: i.colorPrimary,
|
|
27
27
|
paddingInline: i.spaceSM,
|
|
@@ -32,18 +32,18 @@ const n = (i) => {
|
|
|
32
32
|
borderRadius: "2px"
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
|
-
"div.ant-select-item
|
|
35
|
+
"div.ant-select-item": {
|
|
36
36
|
paddingInline: i.space,
|
|
37
37
|
paddingBlock: i.spaceXS,
|
|
38
38
|
fontWeight: "normal !important",
|
|
39
39
|
marginBottom: i.spaceXS,
|
|
40
40
|
"&:hover": {
|
|
41
|
-
[`${
|
|
41
|
+
[`${p}-option-action`]: {
|
|
42
42
|
display: "inline"
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
|
-
"
|
|
46
|
-
|
|
45
|
+
"&:last-child": {
|
|
46
|
+
marginBottom: 0
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.13.
|
|
1
|
+
declare const _default: "7.13.5";
|
|
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"),r=require("lodash-unified");require("../../config-provider/index.js");require("../../hooks/index.js");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("@aplus-frontend/antdv"),r=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:s}=W.useNamespace("field-select"),F=K.default("field"),w=e.ref(!1),{t:S}=G.useLocale(),V=r.debounce(o=>{if(!r.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(!r.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 r.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:V,notFoundContent:a.value?void 0:null,filterOption:!1,suffixIcon:null}:{filterOption:r.isNil(t?.filterOption)?q:t?.filterOption}),{...r.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:r.isNumber(t.addAll)?h.value.length>=t.addAll:!!t.addAll),T=e.computed(()=>t.multiple&&t.allowOnlySelect&&(!B.isDef(t.maxCount)||t.maxCount>=1));function z(){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:z,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(s)("popup")} ${e.unref(F)}`,open:w.value,"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(s)("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(s)("popup-option-label"))},e.toDisplayString(C(l,"label")),3)]),_:2},1024),T.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(s)("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",{tabindex:-1,class:e.normalizeClass(e.unref(s)("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(s)("popup-all-option-label"))},e.toDisplayString(e.unref(S)("ap.field.selectAll")),3)],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:e}=i,o=`${e}-select-popup`;return{[`${o}`]:{padding:i.space,[`${o}-all-option`]:{width:"100%",display:"inline-flex",cursor:"pointer",paddingInline:i.space,paddingBlock:i.spaceSM,[`${o}-all-option-label`]:{paddingInline:i.space}},[`${o}-option-wrapper`]:{height:"22px"},[`${o}-option-label`]:{...l.singleRow(i),color:"inherit"},[`${o}-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,"&:hover":{[`${o}-option-action`]:{display:"inline"}},"&:last-child":{marginBottom:0}}}}};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.5";
|
|
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.5";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.5",
|
|
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.4",
|
|
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.4",
|
|
55
55
|
"@aplus-frontend/icon": "^2.0.6",
|
|
56
56
|
"@aplus-frontend/oss": "^2.0.1",
|
|
57
57
|
"@emotion/serialize": "^1.3.3",
|