@das-fed/ui 6.4.0-test.20 → 6.4.0-test.21
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/package.json +5 -5
- package/packages/components/cascader/index.js +43 -43
- package/packages/components/cascader/index.js.gz +0 -0
- package/packages/components/cascader/style.css +1 -1
- package/packages/components/cascader/style.css.gz +0 -0
- package/packages/components/input/index.js +65 -65
- package/packages/components/input/index.js.gz +0 -0
- package/packages/components/input/style.css +1 -1
- package/packages/components/input/style.css.gz +0 -0
- package/packages/components/input-number/index.js +88 -86
- package/packages/components/input-number/index.js.gz +0 -0
- package/packages/components/input-number/style.css +1 -1
- package/packages/components/input-number/style.css.gz +0 -0
- package/packages/components/search/index.js +16 -21
- package/packages/components/search/index.js.gz +0 -0
- package/packages/components/search/style.css +1 -1
- package/packages/components/search/style.css.gz +0 -0
- package/packages/components/search-form/index.js +599 -606
- package/packages/components/search-form/index.js.gz +0 -0
- package/packages/components/search-form/style.css +1 -1
- package/packages/components/search-form/style.css.gz +0 -0
- package/packages/components/select/index.js +194 -189
- package/packages/components/select/index.js.gz +0 -0
- package/packages/components/select/style.css +1 -1
- package/packages/components/select/style.css.gz +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import '@das-fed/ui/packages/components/select/style.css';
|
|
2
2
|
import { withInstall as Oe } from "@das-fed/utils/with-install/index";
|
|
3
|
-
import { defineComponent as Pe, useCssVars as xl, ref as n, computed as i, watch as Y, useSlots as Cl, onMounted as me, onUnmounted as
|
|
3
|
+
import { defineComponent as Pe, useCssVars as xl, ref as n, computed as i, watch as Y, useSlots as Cl, onMounted as me, onUnmounted as Ae, watchEffect as he, nextTick as k, resolveComponent as wl, openBlock as d, createElementBlock as b, normalizeClass as Tl, normalizeStyle as S, createVNode as x, unref as r, withDirectives as be, createBlock as K, mergeProps as Re, isRef as kl, withModifiers as ee, createSlots as Sl, withCtx as m, renderSlot as C, normalizeProps as le, guardReactiveProps as te, Fragment as ge, createTextVNode as ye, toDisplayString as z, createElementVNode as h, withKeys as Il, createCommentVNode as xe, Teleport as zl } from "vue";
|
|
4
4
|
import { Select as Ml, Tag as Ce } from "ant-design-vue";
|
|
5
|
-
import { DasCheckbox as
|
|
5
|
+
import { DasCheckbox as De } from "@das-fed/ui/packages/components/checkbox/index";
|
|
6
6
|
import { vScrollbar as Vl } from "@das-fed/ui/packages/components/scrollbar/index";
|
|
7
|
-
import { DasTooltip as
|
|
7
|
+
import { DasTooltip as $l } from "@das-fed/ui/packages/components/tooltip/index";
|
|
8
8
|
import { vDasTooltip as Ee } from "@das-fed/ui/packages/components/text-tooltip/index";
|
|
9
|
-
import { DasInput as
|
|
10
|
-
import { DasIconXiala as
|
|
11
|
-
import { DasIconEmpty as
|
|
12
|
-
import { vHoverInside as
|
|
9
|
+
import { DasInput as Ll } from "@das-fed/ui/packages/components/input/index";
|
|
10
|
+
import { DasIconXiala as _l } from "@das-fed/ui/packages/icons/xiala/index";
|
|
11
|
+
import { DasIconEmpty as Fl } from "@das-fed/ui/packages/icons/empty/index";
|
|
12
|
+
import { vHoverInside as Nl } from "@das-fed/utils/directive";
|
|
13
13
|
import { getVarValue as We, getVar as He, setThemeRule as Bl } from "@das-fed/web/packages/theme/index";
|
|
14
|
-
import { t as
|
|
14
|
+
import { t as R, currentLang as Al, setI18nRule as Dl } from "@das-fed/web/packages/i18n/index";
|
|
15
15
|
import { useZIndex as El } from "@das-fed/utils/hooks/popup-manager/use-zindex";
|
|
16
16
|
import { useModelValue as Wl } from "@das-fed/utils/vue";
|
|
17
17
|
import { calcTextWidth as Hl } from "@das-fed/utils/common-tools";
|
|
@@ -27,7 +27,7 @@ const Pl = { key: 0 }, Rl = {
|
|
|
27
27
|
}, Jl = { class: "ant-select ant-select-multiple ant-select-selection-overflow-item ant-select-selection-overflow-item-rest" }, Ql = { class: "ant-select-selection-item" }, Yl = { class: "ant-select-selection-item-content" }, et = ["innerHTML"], lt = Pe({
|
|
28
28
|
inheritAttrs: !1,
|
|
29
29
|
components: {
|
|
30
|
-
VNodes: (
|
|
30
|
+
VNodes: (M, { attrs: B }) => B.vnodes
|
|
31
31
|
}
|
|
32
32
|
}), tt = /* @__PURE__ */ Pe({
|
|
33
33
|
...lt,
|
|
@@ -66,27 +66,29 @@ const Pl = { key: 0 }, Rl = {
|
|
|
66
66
|
dropdownMode: {}
|
|
67
67
|
},
|
|
68
68
|
emits: ["update:model-value", "change", "focus", "blur", "dropdownVisibleChange", "addCustomItem"],
|
|
69
|
-
setup(
|
|
69
|
+
setup(M, { expose: B, emit: A }) {
|
|
70
70
|
xl((e) => ({
|
|
71
|
-
"
|
|
72
|
-
"
|
|
71
|
+
"5a771b26": Ye.value,
|
|
72
|
+
"4ac56072": el.value
|
|
73
73
|
}));
|
|
74
|
-
const l =
|
|
74
|
+
const l = M, w = A, s = Wl(l, "modelValue"), Ze = n(null), oe = i(() => {
|
|
75
75
|
var e;
|
|
76
76
|
return `<span class='key'>${((e = s.value) == null ? void 0 : e.length) ?? 0}</span>`;
|
|
77
|
-
}), D = n(null), we = n(null), g = n(!1), U = i(() => l.isView ? l.noSetDefaultVal ? "" : "-" : l.placeholder ||
|
|
77
|
+
}), D = n(null), we = n(null), g = n(!1), U = i(() => l.isView ? l.noSetDefaultVal ? "" : "-" : l.placeholder || R("请选择")), Ke = i(() => D.value ? D.value.querySelector(".ant-select-selector") : null), E = n(0), W = n(0), Ue = i(() => l.isTooltip && V.value ? !1 : !l.isTooltip || L.value || !Le.value || !re.value), je = i(() => (Array.isArray(s.value) ? s.value.length : s.value) ? Le.value : U.value), Te = () => {
|
|
78
78
|
const e = l.size === "table" ? 12 : 14;
|
|
79
79
|
return Hl(U.value, e);
|
|
80
80
|
}, ke = () => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
var T;
|
|
82
|
+
const e = D.value.querySelector(".ant-select-selection-placeholder"), t = (T = y.value) == null ? void 0 : T.$el.querySelectorAll(".ant-select-selection-item");
|
|
83
|
+
t && t.length && t.forEach((N) => N.removeAttribute("title"));
|
|
84
|
+
let o = (e == null ? void 0 : e.offsetWidth) ?? 0;
|
|
85
|
+
if (o === 0) return o;
|
|
86
|
+
const a = window.getComputedStyle(e, null), v = parseFloat(a.paddingRight), f = parseFloat(a.paddingLeft);
|
|
87
|
+
return o - v - f;
|
|
88
|
+
}, V = n(!1);
|
|
87
89
|
Y(() => [U.value, s.value], () => {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
k(() => {
|
|
91
|
+
W.value = ke(), E.value = Te(), ((Array.isArray(s.value) ? s.value.length : s.value) || W.value === E.value || E.value - W.value < 1) && (V.value = !1);
|
|
90
92
|
});
|
|
91
93
|
}), Y(
|
|
92
94
|
() => {
|
|
@@ -95,44 +97,44 @@ const Pl = { key: 0 }, Rl = {
|
|
|
95
97
|
},
|
|
96
98
|
(e) => {
|
|
97
99
|
e && (e.addEventListener("mouseenter", function() {
|
|
98
|
-
|
|
100
|
+
V.value = !0, P.value && clearTimeout(P.value);
|
|
99
101
|
}), e.addEventListener("mouseleave", function() {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
+
P.value = setTimeout(() => {
|
|
103
|
+
V.value = !1;
|
|
102
104
|
}, 200);
|
|
103
105
|
}));
|
|
104
106
|
}
|
|
105
107
|
);
|
|
106
|
-
const Se = n(null), Ie = i(() => l.dropdownMode ?? l.mode ?? ""),
|
|
107
|
-
|
|
108
|
+
const Se = n(null), Ie = i(() => l.dropdownMode ?? l.mode ?? ""), H = n(null), Xe = n(null), O = n(""), Ge = () => {
|
|
109
|
+
H.value = !0;
|
|
108
110
|
}, Je = () => {
|
|
109
|
-
|
|
111
|
+
H.value = null;
|
|
110
112
|
}, ze = () => {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
+
O.value && (w("addCustomItem", O.value), k(() => {
|
|
114
|
+
y.value.focus(), O.value = "";
|
|
113
115
|
}));
|
|
114
116
|
}, Me = Cl(), ae = () => {
|
|
115
|
-
l.dropdownMode === "custom" && !Me.dropdownRender && (
|
|
116
|
-
|
|
117
|
+
l.dropdownMode === "custom" && !Me.dropdownRender && (H.value = !1, k(() => {
|
|
118
|
+
H.value = null;
|
|
117
119
|
}));
|
|
118
120
|
};
|
|
119
121
|
me(() => {
|
|
120
122
|
document.addEventListener("click", ae);
|
|
121
|
-
}),
|
|
123
|
+
}), Ae(() => {
|
|
122
124
|
document.removeEventListener("click", ae);
|
|
123
125
|
});
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
+
const y = n(), Ve = n(), se = n(!1), ne = i(() => {
|
|
127
|
+
if (H.value !== null) return H.value;
|
|
126
128
|
if (l.open !== void 0) return l.open;
|
|
127
|
-
}),
|
|
129
|
+
}), $ = 1e6, u = n(100), c = n(100), L = n(!1), re = n(!0), ue = n(!1);
|
|
128
130
|
he(() => {
|
|
129
131
|
s.value && l.mode == "combobox" && (re.value = !0, setTimeout(() => {
|
|
130
132
|
var t;
|
|
131
|
-
let e = (t =
|
|
133
|
+
let e = (t = y.value) == null ? void 0 : t.$el.querySelectorAll(".ant-select-selection-item");
|
|
132
134
|
if (e && e.length > 0)
|
|
133
|
-
for (let
|
|
134
|
-
let
|
|
135
|
-
|
|
135
|
+
for (let o = 0; o < e.length; o++) {
|
|
136
|
+
let a = e[o];
|
|
137
|
+
a.scrollWidth <= a.offsetWidth && (re.value = !1), a.title = "";
|
|
136
138
|
}
|
|
137
139
|
}, 300));
|
|
138
140
|
}), he(() => {
|
|
@@ -148,32 +150,32 @@ const Pl = { key: 0 }, Rl = {
|
|
|
148
150
|
}), me(() => {
|
|
149
151
|
ue.value = !0, l.focusOpen || (c.value = 1, u.value = c.value, g.value = !0);
|
|
150
152
|
});
|
|
151
|
-
const Ye = i(() => l.width ? l.width : "230px"), el = i(() => l.height ? l.height : "auto"),
|
|
152
|
-
"z-index":
|
|
153
|
-
})),
|
|
153
|
+
const Ye = i(() => l.width ? l.width : "230px"), el = i(() => l.height ? l.height : "auto"), $e = n(3e3), ll = i(() => ({
|
|
154
|
+
"z-index": $e.value
|
|
155
|
+
})), Le = i(() => {
|
|
154
156
|
var t;
|
|
155
157
|
let e = [];
|
|
156
158
|
if (l.mode != "combobox" && Array.isArray(s.value))
|
|
157
|
-
s.value.map((
|
|
159
|
+
s.value.map((o) => {
|
|
158
160
|
var v;
|
|
159
|
-
let
|
|
160
|
-
|
|
161
|
+
let a = (v = l.options) == null ? void 0 : v.find((f) => f[_.value] == o);
|
|
162
|
+
a && e.push(a[j.value]);
|
|
161
163
|
});
|
|
162
164
|
else if (l.mode == "combobox" && s.value) {
|
|
163
|
-
let
|
|
164
|
-
|
|
165
|
+
let o = (t = l.options) == null ? void 0 : t.find((a) => a[_.value] == s.value);
|
|
166
|
+
o && e.push(o[j.value]);
|
|
165
167
|
}
|
|
166
|
-
return
|
|
168
|
+
return Al.value === "zh-CN" ? e.join("、") : e.join(", ");
|
|
167
169
|
}), tl = i(() => {
|
|
168
170
|
var t;
|
|
169
171
|
if (l.mode === "combobox") return !1;
|
|
170
|
-
let e = l.options.filter((
|
|
172
|
+
let e = l.options.filter((o) => !o.disabled);
|
|
171
173
|
return !!(Array.isArray(s.value) && ((t = s.value) == null ? void 0 : t.length) == e.length);
|
|
172
174
|
}), ol = i(() => {
|
|
173
|
-
var t,
|
|
175
|
+
var t, o;
|
|
174
176
|
if (l.mode === "combobox") return !1;
|
|
175
|
-
let e = l.options.filter((
|
|
176
|
-
return !!(Array.isArray(s.value) && ((t = s.value) == null ? void 0 : t.length) > 0 && ((
|
|
177
|
+
let e = l.options.filter((a) => !a.disabled);
|
|
178
|
+
return !!(Array.isArray(s.value) && ((t = s.value) == null ? void 0 : t.length) > 0 && ((o = s.value) == null ? void 0 : o.length) < e.length);
|
|
177
179
|
}), al = i(() => {
|
|
178
180
|
var e, t;
|
|
179
181
|
return l.optionFilterProp ? l.optionFilterProp : (e = l.fieldNames) != null && e.label ? (t = l.fieldNames) == null ? void 0 : t.label : "label";
|
|
@@ -185,7 +187,7 @@ const Pl = { key: 0 }, Rl = {
|
|
|
185
187
|
return l.fieldNames && l.fieldNames.value ? (e = l.fieldNames) == null ? void 0 : e.value : "value";
|
|
186
188
|
}), sl = i(() => ({
|
|
187
189
|
width: typeof l.width == "number" ? l.width + "px" : l.width
|
|
188
|
-
})), ie = n(!1),
|
|
190
|
+
})), ie = n(!1), q = n({
|
|
189
191
|
x: 0,
|
|
190
192
|
y: 0
|
|
191
193
|
}), de = n(0), ce = i(() => ({
|
|
@@ -201,83 +203,86 @@ const Pl = { key: 0 }, Rl = {
|
|
|
201
203
|
width: de.value + "px",
|
|
202
204
|
position: "fixed",
|
|
203
205
|
visibility: "visible",
|
|
204
|
-
top:
|
|
205
|
-
left:
|
|
206
|
+
top: q.value.y + "px",
|
|
207
|
+
left: q.value.x + "px"
|
|
206
208
|
})), X = n({
|
|
207
209
|
display: "block",
|
|
208
210
|
color: We("--das-ui-select-overlay-error-color").value,
|
|
209
211
|
"white-space": "break-spaces"
|
|
210
212
|
}), rl = () => {
|
|
211
|
-
var
|
|
213
|
+
var N, p, Q, Fe;
|
|
212
214
|
const e = () => {
|
|
213
|
-
var
|
|
215
|
+
var I = document.createElement("div");
|
|
214
216
|
for (let [pe, Be] of Object.entries({
|
|
215
217
|
...ce.value,
|
|
216
218
|
...X.value,
|
|
217
219
|
width: de.value + "px"
|
|
218
220
|
}))
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
const
|
|
222
|
-
return document.body.removeChild(
|
|
221
|
+
I.style[pe] = Be;
|
|
222
|
+
I.textContent = l.errorLabel, document.body.appendChild(I);
|
|
223
|
+
const Ne = I.offsetHeight;
|
|
224
|
+
return document.body.removeChild(I), Ne;
|
|
223
225
|
}, t = () => {
|
|
224
|
-
const
|
|
225
|
-
return
|
|
226
|
+
const I = document.documentElement.clientHeight, pe = document.documentElement.scrollHeight - I;
|
|
227
|
+
return I - pe;
|
|
226
228
|
};
|
|
227
|
-
de.value = (
|
|
228
|
-
const { top:
|
|
229
|
-
|
|
230
|
-
},
|
|
231
|
-
|
|
229
|
+
de.value = (p = (N = y.value) == null ? void 0 : N.$el) == null ? void 0 : p.clientWidth;
|
|
230
|
+
const { top: o = 0, left: a = 0, height: v = 0 } = ((Fe = (Q = y.value) == null ? void 0 : Q.$el) == null ? void 0 : Fe.getBoundingClientRect()) ?? {}, f = t(), T = e();
|
|
231
|
+
o + v + T >= f ? q.value.y = o - T : q.value.y = o + v, q.value.x = a;
|
|
232
|
+
}, P = n(), ul = () => {
|
|
233
|
+
var o;
|
|
234
|
+
W.value = ke(), E.value = Te();
|
|
235
|
+
let e = (o = y.value) == null ? void 0 : o.$el.querySelectorAll(".ant-select-selection-item");
|
|
236
|
+
!!(Array.isArray(s.value) ? s.value.length : e != null && e.length) || W.value === E.value || E.value - W.value < 1 ? V.value = !1 : (V.value = !0, P.value && clearTimeout(P.value)), rl(), ie.value = !0;
|
|
232
237
|
}, il = () => {
|
|
233
|
-
|
|
234
|
-
|
|
238
|
+
P.value = setTimeout(() => {
|
|
239
|
+
V.value = !1;
|
|
235
240
|
}, 200), ie.value = !1;
|
|
236
241
|
}, dl = (e, t) => {
|
|
237
242
|
e ? ul() : il();
|
|
238
243
|
}, cl = (e) => {
|
|
239
|
-
e && (
|
|
240
|
-
var t,
|
|
241
|
-
(
|
|
242
|
-
})),
|
|
244
|
+
e && ($e.value = El().nextZIndex(), O.value = ""), G.value = e, l.mode == "combobox" && (e || setTimeout(() => {
|
|
245
|
+
var t, o;
|
|
246
|
+
(o = (t = y.value) == null ? void 0 : t.blur) == null || o.call(t);
|
|
247
|
+
})), w("dropdownVisibleChange", e);
|
|
243
248
|
}, vl = (e) => {
|
|
244
249
|
let t = e.toString();
|
|
245
250
|
return t.length > l.maxTagTextLength && (t = t.substr(0, l.maxTagTextLength) + "..."), t;
|
|
246
251
|
}, fl = (e) => l.isRenderNode ? D.value : l.getPopupContainer === void 0 ? document.body : l.getPopupContainer(e), pl = (e) => {
|
|
247
252
|
if (e) {
|
|
248
253
|
Array.isArray(s.value) || (s.value = []);
|
|
249
|
-
let t = s.value,
|
|
250
|
-
l.options.forEach((
|
|
251
|
-
!s.value.includes(
|
|
252
|
-
}), s.value = t, fe(s.value,
|
|
254
|
+
let t = s.value, o = [];
|
|
255
|
+
l.options.forEach((a) => {
|
|
256
|
+
!s.value.includes(a[_.value]) && !a.disabled && (t.push(a[_.value]), o.push(a));
|
|
257
|
+
}), s.value = t, fe(s.value, o);
|
|
253
258
|
} else {
|
|
254
259
|
let t = s.value;
|
|
255
|
-
s.value = t.filter((
|
|
260
|
+
s.value = t.filter((o) => !!l.options.find((a) => a[_.value] === o).disabled), fe(s.value, []);
|
|
256
261
|
}
|
|
257
262
|
}, ml = (e) => {
|
|
258
263
|
if (e.className.indexOf("ant-select-multiple") > -1 && e.children[0])
|
|
259
264
|
return e.children[0];
|
|
260
265
|
}, hl = (e) => {
|
|
261
266
|
if (l.mode == "combobox") {
|
|
262
|
-
|
|
267
|
+
w("focus", e);
|
|
263
268
|
return;
|
|
264
269
|
}
|
|
265
|
-
se.value = !0, l.focusOpen && !l.isExterControlCount && (u.value =
|
|
270
|
+
se.value = !0, l.focusOpen && !l.isExterControlCount && (u.value = $, g.value = !1), w("focus", e);
|
|
266
271
|
}, G = n(!1), bl = () => {
|
|
267
272
|
G.value || setTimeout(() => {
|
|
268
273
|
var e, t;
|
|
269
|
-
(t = (e =
|
|
274
|
+
(t = (e = y.value) == null ? void 0 : e.blur) == null || t.call(e);
|
|
270
275
|
}), l.mode != "combobox";
|
|
271
|
-
},
|
|
272
|
-
if (
|
|
276
|
+
}, _e = (e) => {
|
|
277
|
+
if (k(() => {
|
|
273
278
|
G.value = !1;
|
|
274
279
|
}), l.mode == "combobox") {
|
|
275
|
-
|
|
280
|
+
w("blur", e);
|
|
276
281
|
return;
|
|
277
282
|
}
|
|
278
|
-
se.value = !1, l.focusOpen && !l.isExterControlCount && (F(), u.value = c.value, g.value = !0),
|
|
283
|
+
se.value = !1, l.focusOpen && !l.isExterControlCount && (F(), u.value = c.value, g.value = !0), w("blur", e);
|
|
279
284
|
}, gl = (e) => {
|
|
280
|
-
e.onClose(), u.value = 100,
|
|
285
|
+
e.onClose(), u.value = 100, k(() => {
|
|
281
286
|
l.mode !== "combobox" && ne.value || l.focusOpen && (F(), u.value = c.value, g.value = !0);
|
|
282
287
|
});
|
|
283
288
|
};
|
|
@@ -287,49 +292,49 @@ const Pl = { key: 0 }, Rl = {
|
|
|
287
292
|
if (e && l.mode !== "combobox") {
|
|
288
293
|
se.value = !1;
|
|
289
294
|
let t = new Event("blur");
|
|
290
|
-
|
|
295
|
+
_e(t);
|
|
291
296
|
}
|
|
292
297
|
}
|
|
293
298
|
);
|
|
294
|
-
let
|
|
299
|
+
let Z = n(!1);
|
|
295
300
|
const yl = (e) => {
|
|
296
|
-
|
|
297
|
-
L.value = !1, l.focusOpen && (F(), u.value = e ?
|
|
301
|
+
Z.value = e, L.value = !0, k(() => {
|
|
302
|
+
L.value = !1, l.focusOpen && (F(), u.value = e ? $ : c.value, g.value = !e);
|
|
298
303
|
});
|
|
299
304
|
};
|
|
300
305
|
let J = null;
|
|
301
306
|
me(() => {
|
|
302
307
|
J = new IntersectionObserver((e) => {
|
|
303
|
-
e && e[0] && e[0].intersectionRatio > 0 && l.focusOpen && u.value === 0 && (u.value = 100,
|
|
308
|
+
e && e[0] && e[0].intersectionRatio > 0 && l.focusOpen && u.value === 0 && (u.value = 100, k(() => {
|
|
304
309
|
F(), u.value = c.value, g.value = !0;
|
|
305
310
|
}));
|
|
306
311
|
}), J.observe(D.value);
|
|
307
|
-
}),
|
|
312
|
+
}), Ae(() => {
|
|
308
313
|
J && J.disconnect();
|
|
309
314
|
});
|
|
310
315
|
const F = () => {
|
|
311
|
-
var
|
|
312
|
-
let e = (
|
|
316
|
+
var N;
|
|
317
|
+
let e = (N = y.value) == null ? void 0 : N.$el;
|
|
313
318
|
if (!e) return;
|
|
314
319
|
let t = e == null ? void 0 : e.querySelector(".ant-select-selection-overflow");
|
|
315
320
|
if (!t) return;
|
|
316
|
-
let
|
|
317
|
-
l.borderType === "underline" && (
|
|
321
|
+
let o = t.offsetWidth - 5;
|
|
322
|
+
l.borderType === "underline" && (o -= 10);
|
|
318
323
|
const v = Math.ceil(Se.value.querySelector(".ant-tag").offsetWidth) + 4;
|
|
319
|
-
let
|
|
320
|
-
if (
|
|
321
|
-
u.value =
|
|
322
|
-
let
|
|
323
|
-
for (let
|
|
324
|
-
if (
|
|
325
|
-
|
|
324
|
+
let f = e.querySelectorAll(".ant-select-selection-overflow-item");
|
|
325
|
+
if (f.length < 1) return;
|
|
326
|
+
u.value = $;
|
|
327
|
+
let T = 0;
|
|
328
|
+
for (let p = 0; p < f.length - 1 && !f[p].classList.contains("ant-select-selection-overflow-item-rest"); p++)
|
|
329
|
+
if (T += Math.ceil(f[p].offsetWidth), T <= o - v)
|
|
330
|
+
p >= s.value.length - 1 && T < o ? c.value = s.value.length : c.value = p + 1;
|
|
326
331
|
else {
|
|
327
|
-
|
|
332
|
+
p >= s.value.length - 1 && T < o ? c.value = s.value.length : c.value = p;
|
|
328
333
|
break;
|
|
329
334
|
}
|
|
330
335
|
if (c.value === 0) {
|
|
331
|
-
let
|
|
332
|
-
|
|
336
|
+
let p = f[0], Q = p.querySelector(".anticon-close") ? 86 : 69;
|
|
337
|
+
p && !p.classList.contains("ant-select-selection-overflow-item-rest") && Q <= o - v && !Me.tagRender && (c.value = 1, p.classList.add("ellipsis"));
|
|
333
338
|
}
|
|
334
339
|
}, ve = n(!1);
|
|
335
340
|
Y(
|
|
@@ -339,19 +344,19 @@ const Pl = { key: 0 }, Rl = {
|
|
|
339
344
|
ve.value = !1;
|
|
340
345
|
return;
|
|
341
346
|
}
|
|
342
|
-
l.mode !== "combobox" && ne.value || (L.value = !0, u.value =
|
|
347
|
+
l.mode !== "combobox" && ne.value || (L.value = !0, u.value = $, await k(), await F(), L.value = !1, l.isExterControlCount && l.focusOpen ? (u.value = Z.value ? $ : c.value, g.value = !Z.value) : (u.value = c.value, g.value = !0));
|
|
343
348
|
}
|
|
344
349
|
);
|
|
345
350
|
const fe = async (e, t) => {
|
|
346
351
|
ve.value = !0, G.value = !1, l.mode === "combobox" && ae();
|
|
347
|
-
const
|
|
348
|
-
l.noDropdown && l.maxTagsLength <
|
|
352
|
+
const o = e;
|
|
353
|
+
l.noDropdown && l.maxTagsLength < o.length && o.pop(), L.value = !0, w("update:model-value", o), w("change", o, t), u.value = $, await k(), await F(), L.value = !1, l.isExterControlCount && l.focusOpen && (u.value = Z.value ? $ : c.value, g.value = !Z.value), l.focusOpen || (u.value = c.value);
|
|
349
354
|
};
|
|
350
|
-
return
|
|
351
|
-
$select:
|
|
355
|
+
return B({
|
|
356
|
+
$select: y,
|
|
352
357
|
toChangeMaxCount: yl
|
|
353
358
|
}), (e, t) => {
|
|
354
|
-
const
|
|
359
|
+
const o = wl("v-nodes");
|
|
355
360
|
return d(), b("div", {
|
|
356
361
|
class: Tl(["das-ui-select", [
|
|
357
362
|
l.borderType,
|
|
@@ -361,9 +366,9 @@ const Pl = { key: 0 }, Rl = {
|
|
|
361
366
|
]]),
|
|
362
367
|
ref_key: "$selectBox",
|
|
363
368
|
ref: D,
|
|
364
|
-
style:
|
|
369
|
+
style: S(sl.value)
|
|
365
370
|
}, [
|
|
366
|
-
|
|
371
|
+
x(r($l), {
|
|
367
372
|
ref_key: "inputTooltipRef",
|
|
368
373
|
ref: we,
|
|
369
374
|
placement: "top",
|
|
@@ -374,9 +379,9 @@ const Pl = { key: 0 }, Rl = {
|
|
|
374
379
|
}, null, 8, ["virtual-ref", "disabled", "content"]),
|
|
375
380
|
be((d(), K(r(Ml), Re({ mode: e.mode }, e.$attrs, {
|
|
376
381
|
value: r(s),
|
|
377
|
-
"onUpdate:value": t[4] || (t[4] = (
|
|
382
|
+
"onUpdate:value": t[4] || (t[4] = (a) => kl(s) ? s.value = a : null),
|
|
378
383
|
ref_key: "$select",
|
|
379
|
-
ref:
|
|
384
|
+
ref: y,
|
|
380
385
|
options: Ve.value,
|
|
381
386
|
fieldNames: e.fieldNames,
|
|
382
387
|
bordered: l.borderType === "bordered",
|
|
@@ -399,29 +404,29 @@ const Pl = { key: 0 }, Rl = {
|
|
|
399
404
|
t[5] || (t[5] = ee(() => {
|
|
400
405
|
}, ["stop"]))
|
|
401
406
|
],
|
|
402
|
-
onBlur:
|
|
407
|
+
onBlur: _e
|
|
403
408
|
}), Sl({
|
|
404
|
-
option: m((
|
|
405
|
-
|
|
409
|
+
option: m((a) => [
|
|
410
|
+
C(e.$slots, "option", le(te(a)), () => {
|
|
406
411
|
var v;
|
|
407
412
|
return [
|
|
408
|
-
|
|
413
|
+
a.children && typeof a.children == "function" ? (d(), K(o, {
|
|
409
414
|
key: 0,
|
|
410
|
-
vnodes:
|
|
415
|
+
vnodes: a.children()
|
|
411
416
|
}, null, 8, ["vnodes"])) : (d(), b(ge, { key: 1 }, [
|
|
412
417
|
e.mode === "combobox" ? be((d(), b("div", Pl, [
|
|
413
|
-
ye(
|
|
418
|
+
ye(z(a[j.value]), 1)
|
|
414
419
|
])), [
|
|
415
420
|
[r(Ee)]
|
|
416
421
|
]) : (d(), b("div", Rl, [
|
|
417
|
-
(d(), K(r(
|
|
422
|
+
(d(), K(r(De), {
|
|
418
423
|
class: "das-select-checkbox",
|
|
419
|
-
modelValue: (v = r(s)) == null ? void 0 : v.includes(
|
|
420
|
-
key:
|
|
421
|
-
disabled:
|
|
424
|
+
modelValue: (v = r(s)) == null ? void 0 : v.includes(a[_.value]),
|
|
425
|
+
key: a[_.value],
|
|
426
|
+
disabled: a.disabled
|
|
422
427
|
}, null, 8, ["modelValue", "disabled"])),
|
|
423
428
|
be((d(), b("div", ql, [
|
|
424
|
-
ye(
|
|
429
|
+
ye(z(a[j.value]), 1)
|
|
425
430
|
])), [
|
|
426
431
|
[r(Ee)]
|
|
427
432
|
])
|
|
@@ -430,44 +435,44 @@ const Pl = { key: 0 }, Rl = {
|
|
|
430
435
|
];
|
|
431
436
|
}, !0)
|
|
432
437
|
]),
|
|
433
|
-
tagRender: m((
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
closable:
|
|
438
|
+
tagRender: m((a) => [
|
|
439
|
+
C(e.$slots, "tagRender", le(te(a)), () => [
|
|
440
|
+
x(r(Ce), {
|
|
441
|
+
closable: a.closable,
|
|
437
442
|
style: { "margin-right": "3px", "background-color": "transparent" },
|
|
438
|
-
onClose: (v) => gl(
|
|
443
|
+
onClose: (v) => gl(a)
|
|
439
444
|
}, {
|
|
440
445
|
default: m(() => [
|
|
441
446
|
h("span", {
|
|
442
447
|
class: "tag-span",
|
|
443
|
-
style:
|
|
444
|
-
},
|
|
448
|
+
style: S(l.size == "mini" || l.size == "table" ? { fontSize: "12px" } : {})
|
|
449
|
+
}, z(vl(a.label)), 5)
|
|
445
450
|
]),
|
|
446
451
|
_: 2
|
|
447
452
|
}, 1032, ["closable", "onClose"])
|
|
448
453
|
], !0)
|
|
449
454
|
]),
|
|
450
|
-
dropdownRender: m(({ menuNode:
|
|
451
|
-
|
|
455
|
+
dropdownRender: m(({ menuNode: a }) => [
|
|
456
|
+
C(e.$slots, "dropdownRender", le(te({ menuNode: a })), () => {
|
|
452
457
|
var v;
|
|
453
458
|
return [
|
|
454
459
|
Ie.value === "combobox" ? (d(), b("div", Zl, [
|
|
455
|
-
|
|
460
|
+
x(o, { vnodes: a }, null, 8, ["vnodes"])
|
|
456
461
|
])) : Ie.value === "custom" ? (d(), b("div", {
|
|
457
462
|
key: 1,
|
|
458
463
|
onClick: t[2] || (t[2] = ee(() => {
|
|
459
464
|
}, ["stop"]))
|
|
460
465
|
}, [
|
|
461
|
-
|
|
466
|
+
x(o, { vnodes: a }, null, 8, ["vnodes"]),
|
|
462
467
|
h("div", {
|
|
463
468
|
class: "customDropdown",
|
|
464
|
-
onMousedown: t[1] || (t[1] = (
|
|
469
|
+
onMousedown: t[1] || (t[1] = (f) => f.preventDefault())
|
|
465
470
|
}, [
|
|
466
|
-
|
|
471
|
+
x(r(Ll), {
|
|
467
472
|
ref_key: "testInput",
|
|
468
473
|
ref: Xe,
|
|
469
|
-
modelValue:
|
|
470
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
474
|
+
modelValue: O.value,
|
|
475
|
+
"onUpdate:modelValue": t[0] || (t[0] = (f) => O.value = f),
|
|
471
476
|
onKeyup: Il(ze, ["enter"]),
|
|
472
477
|
onFocus: ee(Ge, ["stop"]),
|
|
473
478
|
onBlur: ee(Je, ["stop"]),
|
|
@@ -477,31 +482,31 @@ const Pl = { key: 0 }, Rl = {
|
|
|
477
482
|
h("div", {
|
|
478
483
|
class: "addBtn",
|
|
479
484
|
onClick: ze
|
|
480
|
-
},
|
|
485
|
+
}, z(r(R)("添加")), 1)
|
|
481
486
|
], 32)
|
|
482
487
|
])) : (d(), b("div", Kl, [
|
|
483
|
-
|
|
488
|
+
x(o, { vnodes: a }, null, 8, ["vnodes"]),
|
|
484
489
|
(v = l.options) != null && v.length ? (d(), b("div", {
|
|
485
490
|
key: 0,
|
|
486
491
|
class: "das-ui-select-dropdown-checkall",
|
|
487
|
-
onMousedown: t[3] || (t[3] = (
|
|
492
|
+
onMousedown: t[3] || (t[3] = (f) => f.preventDefault())
|
|
488
493
|
}, [
|
|
489
494
|
h("div", Ul, [
|
|
490
|
-
|
|
495
|
+
x(r(De), {
|
|
491
496
|
modelValue: tl.value,
|
|
492
497
|
indeterminate: ol.value,
|
|
493
498
|
onChange: pl,
|
|
494
499
|
style: { display: "flex" }
|
|
495
500
|
}, {
|
|
496
501
|
default: m(() => [
|
|
497
|
-
ye(
|
|
502
|
+
ye(z(r(R)("全选")), 1)
|
|
498
503
|
]),
|
|
499
504
|
_: 1
|
|
500
505
|
}, 8, ["modelValue", "indeterminate"])
|
|
501
506
|
]),
|
|
502
507
|
h("span", {
|
|
503
508
|
class: "das-ui-dropdown-has-checked",
|
|
504
|
-
innerHTML: r(
|
|
509
|
+
innerHTML: r(R)("das-ui-select-selectedItemsCountWithPlaceholder", oe.value)
|
|
505
510
|
}, null, 8, jl)
|
|
506
511
|
], 32)) : xe("", !0)
|
|
507
512
|
]))
|
|
@@ -509,18 +514,18 @@ const Pl = { key: 0 }, Rl = {
|
|
|
509
514
|
}, !0)
|
|
510
515
|
]),
|
|
511
516
|
clearIcon: m(() => [
|
|
512
|
-
|
|
513
|
-
|
|
517
|
+
C(e.$slots, "clearIcon", {}, () => [
|
|
518
|
+
x(r(Fl), { size: "medium" })
|
|
514
519
|
], !0)
|
|
515
520
|
]),
|
|
516
|
-
maxTagPlaceholder: m((
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
style:
|
|
521
|
+
maxTagPlaceholder: m((a) => [
|
|
522
|
+
C(e.$slots, "maxTagPlaceholder", le(te(a)), () => [
|
|
523
|
+
x(r(Ce), {
|
|
524
|
+
style: S(l.size == "mini" || l.size == "table" ? { fontSize: "12px" } : {})
|
|
520
525
|
}, {
|
|
521
526
|
default: m(() => [
|
|
522
527
|
h("span", {
|
|
523
|
-
innerHTML: r(
|
|
528
|
+
innerHTML: r(R)("das-ui-select-selectedItemsCountWithPlaceholder", oe.value)
|
|
524
529
|
}, null, 8, Xl)
|
|
525
530
|
]),
|
|
526
531
|
_: 1
|
|
@@ -528,55 +533,55 @@ const Pl = { key: 0 }, Rl = {
|
|
|
528
533
|
], !0)
|
|
529
534
|
]),
|
|
530
535
|
suffixIcon: m(() => [
|
|
531
|
-
|
|
532
|
-
|
|
536
|
+
C(e.$slots, "suffixIcon", {}, () => [
|
|
537
|
+
x(r(_l), {
|
|
533
538
|
class: "das-suffix-icon",
|
|
534
539
|
size: "medium"
|
|
535
540
|
})
|
|
536
541
|
], !0)
|
|
537
542
|
]),
|
|
538
543
|
default: m(() => [
|
|
539
|
-
|
|
544
|
+
C(e.$slots, "default", {}, void 0, !0)
|
|
540
545
|
]),
|
|
541
546
|
_: 2
|
|
542
547
|
}, [
|
|
543
548
|
e.$slots.menuItemSelectedIcon ? {
|
|
544
549
|
name: "menuItemSelectedIcon",
|
|
545
550
|
fn: m(() => [
|
|
546
|
-
|
|
551
|
+
C(e.$slots, "menuItemSelectedIcon", {}, void 0, !0)
|
|
547
552
|
]),
|
|
548
553
|
key: "0"
|
|
549
554
|
} : void 0,
|
|
550
555
|
e.$slots.notFoundContent ? {
|
|
551
556
|
name: "notFoundContent",
|
|
552
557
|
fn: m(() => [
|
|
553
|
-
|
|
558
|
+
C(e.$slots, "notFoundContent", {}, void 0, !0)
|
|
554
559
|
]),
|
|
555
560
|
key: "1"
|
|
556
561
|
} : void 0,
|
|
557
562
|
e.$slots.placeholder ? {
|
|
558
563
|
name: "placeholder",
|
|
559
564
|
fn: m(() => [
|
|
560
|
-
|
|
565
|
+
C(e.$slots, "placeholder", {}, void 0, !0)
|
|
561
566
|
]),
|
|
562
567
|
key: "2"
|
|
563
568
|
} : void 0,
|
|
564
569
|
e.$slots.removeIcon ? {
|
|
565
570
|
name: "removeIcon",
|
|
566
571
|
fn: m(() => [
|
|
567
|
-
|
|
572
|
+
C(e.$slots, "removeIcon", {}, void 0, !0)
|
|
568
573
|
]),
|
|
569
574
|
key: "3"
|
|
570
575
|
} : void 0
|
|
571
576
|
]), 1040, ["mode", "value", "options", "fieldNames", "bordered", "disabled", "open", "placeholder", "optionFilterProp", "size", "style", "dropdownClassName", "maxTagCount", "dropdownStyle"])), [
|
|
572
577
|
[r(Vl), { target: ml, x: !1 }],
|
|
573
|
-
[r(
|
|
578
|
+
[r(Nl), dl]
|
|
574
579
|
]),
|
|
575
580
|
e.error && e.errorLabel ? (d(), b(ge, { key: 0 }, [
|
|
576
581
|
e.errorMode === "default" ? (d(), b("div", Gl, [
|
|
577
582
|
h("span", {
|
|
578
|
-
style:
|
|
579
|
-
},
|
|
583
|
+
style: S(X.value)
|
|
584
|
+
}, z(e.errorLabel), 5)
|
|
580
585
|
])) : e.errorMode === "overlay" && ie.value ? (d(), b(ge, { key: 1 }, [
|
|
581
586
|
e.teleported ? (d(), K(zl, {
|
|
582
587
|
key: 0,
|
|
@@ -585,20 +590,20 @@ const Pl = { key: 0 }, Rl = {
|
|
|
585
590
|
h("div", {
|
|
586
591
|
ref_key: "$errorModel",
|
|
587
592
|
ref: Ze,
|
|
588
|
-
style:
|
|
593
|
+
style: S(nl.value)
|
|
589
594
|
}, [
|
|
590
595
|
h("span", {
|
|
591
|
-
style:
|
|
592
|
-
},
|
|
596
|
+
style: S(X.value)
|
|
597
|
+
}, z(e.errorLabel), 5)
|
|
593
598
|
], 4)
|
|
594
599
|
])) : (d(), b("div", {
|
|
595
600
|
key: 1,
|
|
596
|
-
style:
|
|
601
|
+
style: S(ce.value),
|
|
597
602
|
class: "das-select-error-label label"
|
|
598
603
|
}, [
|
|
599
604
|
h("span", {
|
|
600
|
-
style:
|
|
601
|
-
},
|
|
605
|
+
style: S(X.value)
|
|
606
|
+
}, z(e.errorLabel), 5)
|
|
602
607
|
], 4))
|
|
603
608
|
], 64)) : xe("", !0)
|
|
604
609
|
], 64)) : xe("", !0),
|
|
@@ -611,12 +616,12 @@ const Pl = { key: 0 }, Rl = {
|
|
|
611
616
|
h("div", Jl, [
|
|
612
617
|
h("div", Ql, [
|
|
613
618
|
h("span", Yl, [
|
|
614
|
-
|
|
615
|
-
style:
|
|
619
|
+
x(r(Ce), {
|
|
620
|
+
style: S(l.size == "mini" || l.size == "table" ? { fontSize: "12px" } : {})
|
|
616
621
|
}, {
|
|
617
622
|
default: m(() => [
|
|
618
623
|
h("span", {
|
|
619
|
-
innerHTML: r(
|
|
624
|
+
innerHTML: r(R)("das-ui-select-selectedItemsCountWithPlaceholder", oe.value)
|
|
620
625
|
}, null, 8, et)
|
|
621
626
|
]),
|
|
622
627
|
_: 1
|
|
@@ -628,15 +633,15 @@ const Pl = { key: 0 }, Rl = {
|
|
|
628
633
|
], 6);
|
|
629
634
|
};
|
|
630
635
|
}
|
|
631
|
-
}), qe = (
|
|
632
|
-
const
|
|
633
|
-
for (const [l,
|
|
634
|
-
|
|
635
|
-
return
|
|
636
|
-
}, ot = /* @__PURE__ */ qe(tt, [["__scopeId", "data-v-
|
|
637
|
-
function st(
|
|
638
|
-
const
|
|
639
|
-
return d(), K(
|
|
636
|
+
}), qe = (M, B) => {
|
|
637
|
+
const A = M.__vccOpts || M;
|
|
638
|
+
for (const [l, w] of B)
|
|
639
|
+
A[l] = w;
|
|
640
|
+
return A;
|
|
641
|
+
}, ot = /* @__PURE__ */ qe(tt, [["__scopeId", "data-v-ef45506c"]]), at = {};
|
|
642
|
+
function st(M, B) {
|
|
643
|
+
const A = Ol;
|
|
644
|
+
return d(), K(A, Re({ class: "das-ui-select-option" }, M.$attrs), null, 16);
|
|
640
645
|
}
|
|
641
646
|
const nt = /* @__PURE__ */ qe(at, [["render", st]]), rt = {
|
|
642
647
|
"--das-ui-select-color-bg": "#FFFFFF",
|
|
@@ -695,11 +700,11 @@ const nt = /* @__PURE__ */ qe(at, [["render", st]]), rt = {
|
|
|
695
700
|
_appCode: "framework"
|
|
696
701
|
}
|
|
697
702
|
};
|
|
698
|
-
|
|
703
|
+
Dl(ut);
|
|
699
704
|
Bl(rt);
|
|
700
|
-
const Vt = Oe(ot),
|
|
705
|
+
const Vt = Oe(ot), $t = Oe(nt), Lt = { name: "select 选择器" };
|
|
701
706
|
export {
|
|
702
707
|
Vt as DasSelect,
|
|
703
|
-
|
|
704
|
-
|
|
708
|
+
$t as DasSelectOption,
|
|
709
|
+
Lt as default
|
|
705
710
|
};
|