@qynpm/ui 1.0.6 → 1.0.7
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/dist/index.cjs +2 -2
- package/dist/index.mjs +19 -54
- package/dist/qy-action-bar/index.cjs +1 -1
- package/dist/qy-action-bar/index.mjs +2 -4
- package/dist/qy-dialog/index.cjs +1 -1
- package/dist/qy-dialog/index.mjs +2 -4
- package/dist/qy-form-section/index.cjs +1 -1
- package/dist/qy-form-section/index.mjs +2 -4
- package/dist/qy-input/index.cjs +1 -1
- package/dist/qy-input/index.mjs +2 -4
- package/dist/qy-money-input/index.cjs +1 -1
- package/dist/qy-money-input/index.mjs +2 -4
- package/dist/qy-radio-group/index.cjs +1 -1
- package/dist/qy-radio-group/index.mjs +2 -4
- package/dist/qy-record-quote-search/index.cjs +1 -1
- package/dist/qy-record-quote-search/index.mjs +2 -4
- package/dist/qy-remark-image/index.cjs +1 -1
- package/dist/qy-remark-image/index.mjs +2 -4
- package/dist/qy-remote-select/index.cjs +1 -1
- package/dist/qy-remote-select/index.mjs +2 -4
- package/dist/qy-search-input/index.cjs +1 -1
- package/dist/qy-search-input/index.mjs +2 -4
- package/dist/qy-select/index.cjs +1 -1
- package/dist/qy-select/index.mjs +2 -4
- package/dist/qy-upload/index.cjs +1 -1
- package/dist/qy-upload/index.mjs +2 -4
- package/dist/qy-voucher-upload/index.cjs +1 -1
- package/dist/qy-voucher-upload/index.mjs +2 -4
- package/dist/shared/index-CbFvRxuh.mjs +2592 -0
- package/dist/shared/index-GDrnDY44.cjs +1 -0
- package/package.json +1 -1
- package/qy-action-bar/index.js +1 -4
- package/qy-dialog/index.js +1 -4
- package/qy-form-section/index.js +1 -4
- package/qy-input/index.js +1 -4
- package/qy-money-input/index.js +1 -15
- package/qy-radio-group/index.js +1 -15
- package/qy-record-quote-search/index.js +1 -4
- package/qy-remark-image/index.js +1 -4
- package/qy-remote-select/index.js +1 -15
- package/qy-search-input/index.js +1 -4
- package/qy-select/index.js +1 -4
- package/qy-upload/index.js +1 -4
- package/qy-voucher-upload/index.js +1 -15
- package/dist/shared/_plugin-vue_export-helper-BHFhmbuH.cjs +0 -1
- package/dist/shared/_plugin-vue_export-helper-CHgC5LLL.mjs +0 -9
- package/dist/shared/index-Bw9kVFsm.mjs +0 -56
- package/dist/shared/index-BzV4959-.mjs +0 -205
- package/dist/shared/index-C0ADdL4S.mjs +0 -88
- package/dist/shared/index-CBSjmD0C.mjs +0 -217
- package/dist/shared/index-CJb1S7CP.cjs +0 -1
- package/dist/shared/index-CO8lz02r.cjs +0 -1
- package/dist/shared/index-ClPxDFKd.cjs +0 -1
- package/dist/shared/index-CtOqRiaj.cjs +0 -1
- package/dist/shared/index-DXB7_Tb5.cjs +0 -1
- package/dist/shared/index-DeWkPj3O.mjs +0 -484
- package/dist/shared/index-PUYQxK94.mjs +0 -123
- package/dist/shared/index-UzZbxoqZ.cjs +0 -1
- package/dist/shared/index-a90QeEC4.cjs +0 -1
- package/dist/shared/index-wW02nNOp.mjs +0 -277
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-BcZg8D-y.mjs +0 -214
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-BmeBeCu0.mjs +0 -162
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-C85575cL.cjs +0 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DkYwdYdF.mjs +0 -90
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-Do5SZ8yS.cjs +0 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DpZzyX5f.cjs +0 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DuUkOqwY.cjs +0 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-Dvh1BFaR.mjs +0 -143
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-RtfqJ73A.mjs +0 -171
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-VVjCLNMD.cjs +0 -1
- package/dist/shared/index.vue_vue_type_style_index_0_lang-DpIL_6vO.mjs +0 -325
- package/dist/shared/index.vue_vue_type_style_index_0_lang-haqCjB5x.cjs +0 -1
- package/dist/shared/install-CxBnxbuN.mjs +0 -8
- package/dist/shared/install-c8il9DQv.cjs +0 -1
- package/dist/shared/js.cookie-CojEIxHg.cjs +0 -1
- package/dist/shared/js.cookie-OLEfuq_g.mjs +0 -74
|
@@ -1,277 +0,0 @@
|
|
|
1
|
-
import { defineComponent as ae, useAttrs as re, ref as y, computed as b, watch as ue, createElementBlock as M, openBlock as V, normalizeClass as se, createVNode as ie, unref as w, mergeProps as E, withKeys as ce, createSlots as de, withCtx as i, renderSlot as d, createElementVNode as F, createCommentVNode as fe, toDisplayString as I, createBlock as pe, createTextVNode as ge } from "vue";
|
|
2
|
-
import { ElAutocomplete as he, ElButton as me } from "element-plus";
|
|
3
|
-
import { _ as ve } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
|
-
const ye = { class: "qy-search-input__item" }, be = ["innerHTML"], Ve = {
|
|
5
|
-
key: 0,
|
|
6
|
-
class: "qy-search-input__item-description"
|
|
7
|
-
}, we = /* @__PURE__ */ ae({
|
|
8
|
-
name: "QySearchInput",
|
|
9
|
-
inheritAttrs: !1,
|
|
10
|
-
__name: "index",
|
|
11
|
-
props: {
|
|
12
|
-
modelValue: { default: "" },
|
|
13
|
-
loading: { type: Boolean, default: !1 },
|
|
14
|
-
disabled: { type: Boolean, default: !1 },
|
|
15
|
-
placeholder: { default: "请输入搜索内容" },
|
|
16
|
-
removeSpace: { type: Boolean, default: !1 },
|
|
17
|
-
trimMode: { default: "none" },
|
|
18
|
-
clearable: { type: Boolean, default: !0 },
|
|
19
|
-
buttonText: { default: "搜索" },
|
|
20
|
-
buttonProps: { default: () => ({}) },
|
|
21
|
-
suggestions: { default: () => [] },
|
|
22
|
-
fetchSuggestions: { type: [Function, null], default: null },
|
|
23
|
-
fetchSuggestionsMethod: { type: [Function, null], default: null },
|
|
24
|
-
debounce: { default: 300 },
|
|
25
|
-
minLength: { default: 1 },
|
|
26
|
-
triggerOnFocus: { type: Boolean, default: !1 },
|
|
27
|
-
searchOnEnter: { type: Boolean, default: !0 },
|
|
28
|
-
searchOnSelect: { type: Boolean, default: !1 },
|
|
29
|
-
highlightKeyword: { type: Boolean, default: !0 },
|
|
30
|
-
teleported: { type: Boolean, default: !0 },
|
|
31
|
-
appendTo: { default: "body" },
|
|
32
|
-
popperClass: { default: "" },
|
|
33
|
-
fitInputWidth: { type: Boolean, default: !0 }
|
|
34
|
-
},
|
|
35
|
-
emits: ["update:modelValue", "search", "clear", "input", "change", "focus", "blur", "enter", "select", "visible-change", "suggestions-change", "error"],
|
|
36
|
-
setup(L, { expose: T, emit: _ }) {
|
|
37
|
-
const l = L, o = _, A = re(), u = y(null), c = y(r(l.modelValue)), p = b(() => r(l.modelValue)), O = b(
|
|
38
|
-
() => ["qy-search-input__popper", l.popperClass].filter(Boolean).join(" ")
|
|
39
|
-
), z = b(() => r(l.modelValue)), g = y("");
|
|
40
|
-
ue(
|
|
41
|
-
() => l.modelValue,
|
|
42
|
-
(e) => {
|
|
43
|
-
c.value = r(e);
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
function r(e) {
|
|
47
|
-
return e == null ? "" : String(e);
|
|
48
|
-
}
|
|
49
|
-
function P(e) {
|
|
50
|
-
return l.removeSpace ? e.replace(/\s+/g, "") : e;
|
|
51
|
-
}
|
|
52
|
-
function S(e, t) {
|
|
53
|
-
return l.trimMode !== t ? e : e.trim();
|
|
54
|
-
}
|
|
55
|
-
function h(e) {
|
|
56
|
-
return P(r(e));
|
|
57
|
-
}
|
|
58
|
-
function m(e) {
|
|
59
|
-
c.value = e, o("update:modelValue", e);
|
|
60
|
-
}
|
|
61
|
-
function k(e, t = "") {
|
|
62
|
-
return {
|
|
63
|
-
...e,
|
|
64
|
-
label: e.label || e.value,
|
|
65
|
-
value: e.value || e.label,
|
|
66
|
-
description: e.description || t
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
function v(e = []) {
|
|
70
|
-
return e.flatMap((t) => {
|
|
71
|
-
if (Array.isArray(t.items)) {
|
|
72
|
-
const n = t;
|
|
73
|
-
return n.items.map((a) => k(a, n.groupLabel));
|
|
74
|
-
}
|
|
75
|
-
return k(t);
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
function K(e) {
|
|
79
|
-
const t = e.toLowerCase();
|
|
80
|
-
return (n) => [n.label, n.value, n.description].filter(Boolean).some((a) => String(a).toLowerCase().includes(t));
|
|
81
|
-
}
|
|
82
|
-
function Q(e) {
|
|
83
|
-
return e ? e.length >= l.minLength : l.triggerOnFocus;
|
|
84
|
-
}
|
|
85
|
-
function s(e) {
|
|
86
|
-
o("suggestions-change", e), o("visible-change", e.length > 0);
|
|
87
|
-
}
|
|
88
|
-
async function R(e) {
|
|
89
|
-
if (!Q(e))
|
|
90
|
-
return s([]), [];
|
|
91
|
-
if (l.fetchSuggestionsMethod) {
|
|
92
|
-
const a = await new Promise((f) => {
|
|
93
|
-
var $;
|
|
94
|
-
($ = l.fetchSuggestionsMethod) == null || $.call(l, e, (oe) => {
|
|
95
|
-
f(v(oe));
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
return s(a), a;
|
|
99
|
-
}
|
|
100
|
-
if (l.fetchSuggestions) {
|
|
101
|
-
const a = await l.fetchSuggestions(e), f = v(Array.isArray(a) ? a : []);
|
|
102
|
-
return s(f), f;
|
|
103
|
-
}
|
|
104
|
-
const t = v(l.suggestions), n = e ? t.filter(K(e)) : t;
|
|
105
|
-
return s(n), n;
|
|
106
|
-
}
|
|
107
|
-
async function H(e, t) {
|
|
108
|
-
g.value = e;
|
|
109
|
-
try {
|
|
110
|
-
const n = await R(e);
|
|
111
|
-
t(n);
|
|
112
|
-
} catch (n) {
|
|
113
|
-
o("error", n), s([]), t([]);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
function N() {
|
|
117
|
-
var e, t;
|
|
118
|
-
g.value && ((t = (e = u.value) == null ? void 0 : e.getData) == null || t.call(e, g.value));
|
|
119
|
-
}
|
|
120
|
-
function q(e) {
|
|
121
|
-
const t = h(e);
|
|
122
|
-
m(t);
|
|
123
|
-
}
|
|
124
|
-
function D(e) {
|
|
125
|
-
const t = h(e);
|
|
126
|
-
c.value = t, o("input", t);
|
|
127
|
-
}
|
|
128
|
-
function U(e) {
|
|
129
|
-
const t = S(h(e), "change");
|
|
130
|
-
t !== r(l.modelValue) && m(t), o("change", t);
|
|
131
|
-
}
|
|
132
|
-
function W(e) {
|
|
133
|
-
o("focus", e);
|
|
134
|
-
}
|
|
135
|
-
function j(e) {
|
|
136
|
-
const t = S(c.value, "blur");
|
|
137
|
-
t !== r(l.modelValue) && m(t), o("blur", e), o("visible-change", !1);
|
|
138
|
-
}
|
|
139
|
-
function x() {
|
|
140
|
-
c.value = "", o("update:modelValue", ""), o("clear"), s([]);
|
|
141
|
-
}
|
|
142
|
-
function G(e) {
|
|
143
|
-
o("enter", e), l.searchOnEnter && B();
|
|
144
|
-
}
|
|
145
|
-
function B() {
|
|
146
|
-
o("search", r(l.modelValue));
|
|
147
|
-
}
|
|
148
|
-
function J(e) {
|
|
149
|
-
o("select", e), l.searchOnSelect && o("search", e.value);
|
|
150
|
-
}
|
|
151
|
-
function C(e) {
|
|
152
|
-
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
153
|
-
}
|
|
154
|
-
function X(e) {
|
|
155
|
-
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
156
|
-
}
|
|
157
|
-
function Y(e) {
|
|
158
|
-
const t = C(e || "");
|
|
159
|
-
if (!l.highlightKeyword || !p.value) return t;
|
|
160
|
-
const n = X(C(p.value));
|
|
161
|
-
return n ? t.replace(
|
|
162
|
-
new RegExp(`(${n})`, "ig"),
|
|
163
|
-
'<mark class="qy-search-input__mark">$1</mark>'
|
|
164
|
-
) : t;
|
|
165
|
-
}
|
|
166
|
-
function Z() {
|
|
167
|
-
var e, t;
|
|
168
|
-
(t = (e = u.value) == null ? void 0 : e.focus) == null || t.call(e);
|
|
169
|
-
}
|
|
170
|
-
function ee() {
|
|
171
|
-
var e, t;
|
|
172
|
-
(t = (e = u.value) == null ? void 0 : e.blur) == null || t.call(e);
|
|
173
|
-
}
|
|
174
|
-
function te() {
|
|
175
|
-
var e, t, n;
|
|
176
|
-
(n = (t = (e = u.value) == null ? void 0 : e.inputRef) == null ? void 0 : t.select) == null || n.call(t);
|
|
177
|
-
}
|
|
178
|
-
function ne() {
|
|
179
|
-
var e, t;
|
|
180
|
-
(t = (e = u.value) == null ? void 0 : e.clear) == null || t.call(e);
|
|
181
|
-
}
|
|
182
|
-
function le() {
|
|
183
|
-
var e, t;
|
|
184
|
-
(t = (e = u.value) == null ? void 0 : e.close) == null || t.call(e);
|
|
185
|
-
}
|
|
186
|
-
return T({
|
|
187
|
-
// 暴露搜索框常用控制方法,供弹窗打开后聚焦或失败后重试建议项。
|
|
188
|
-
focus: Z,
|
|
189
|
-
blur: ee,
|
|
190
|
-
select: te,
|
|
191
|
-
clear: ne,
|
|
192
|
-
closePanel: le,
|
|
193
|
-
retryFetch: N
|
|
194
|
-
}), (e, t) => (V(), M("div", {
|
|
195
|
-
class: se(["qy-search-input", { "is-disabled": e.disabled }])
|
|
196
|
-
}, [
|
|
197
|
-
ie(w(he), E({
|
|
198
|
-
ref_key: "autocompleteRef",
|
|
199
|
-
ref: u
|
|
200
|
-
}, w(A), {
|
|
201
|
-
"model-value": z.value,
|
|
202
|
-
disabled: e.disabled,
|
|
203
|
-
placeholder: e.placeholder,
|
|
204
|
-
clearable: e.clearable,
|
|
205
|
-
debounce: e.debounce,
|
|
206
|
-
"fetch-suggestions": H,
|
|
207
|
-
"trigger-on-focus": e.triggerOnFocus,
|
|
208
|
-
teleported: e.teleported,
|
|
209
|
-
"fit-input-width": e.fitInputWidth,
|
|
210
|
-
"popper-class": O.value,
|
|
211
|
-
"append-to": e.appendTo,
|
|
212
|
-
"value-key": "value",
|
|
213
|
-
"onUpdate:modelValue": q,
|
|
214
|
-
onInput: D,
|
|
215
|
-
onChange: U,
|
|
216
|
-
onFocus: W,
|
|
217
|
-
onBlur: j,
|
|
218
|
-
onClear: x,
|
|
219
|
-
onSelect: J,
|
|
220
|
-
onKeydown: ce(G, ["enter"])
|
|
221
|
-
}), de({
|
|
222
|
-
append: i(() => [
|
|
223
|
-
e.$slots.append ? d(e.$slots, "append", { key: 0 }, void 0, !0) : (V(), pe(w(me), E({ key: 1 }, e.buttonProps, {
|
|
224
|
-
loading: e.loading,
|
|
225
|
-
disabled: e.disabled,
|
|
226
|
-
onClick: B
|
|
227
|
-
}), {
|
|
228
|
-
default: i(() => [
|
|
229
|
-
ge(I(e.buttonText), 1)
|
|
230
|
-
]),
|
|
231
|
-
_: 1
|
|
232
|
-
}, 16, ["loading", "disabled"]))
|
|
233
|
-
]),
|
|
234
|
-
default: i(({ item: n }) => [
|
|
235
|
-
d(e.$slots, "item", {
|
|
236
|
-
item: n,
|
|
237
|
-
keyword: p.value
|
|
238
|
-
}, () => [
|
|
239
|
-
F("div", ye, [
|
|
240
|
-
F("div", {
|
|
241
|
-
class: "qy-search-input__item-label",
|
|
242
|
-
innerHTML: Y(n.label || n.value || "")
|
|
243
|
-
}, null, 8, be),
|
|
244
|
-
n.description ? (V(), M("div", Ve, I(n.description), 1)) : fe("", !0)
|
|
245
|
-
])
|
|
246
|
-
], !0)
|
|
247
|
-
]),
|
|
248
|
-
_: 2
|
|
249
|
-
}, [
|
|
250
|
-
e.$slots.prefix ? {
|
|
251
|
-
name: "prefix",
|
|
252
|
-
fn: i(() => [
|
|
253
|
-
d(e.$slots, "prefix", {}, void 0, !0)
|
|
254
|
-
]),
|
|
255
|
-
key: "0"
|
|
256
|
-
} : void 0,
|
|
257
|
-
e.$slots.suffix ? {
|
|
258
|
-
name: "suffix",
|
|
259
|
-
fn: i(() => [
|
|
260
|
-
d(e.$slots, "suffix", {}, void 0, !0)
|
|
261
|
-
]),
|
|
262
|
-
key: "1"
|
|
263
|
-
} : void 0,
|
|
264
|
-
e.$slots.prepend ? {
|
|
265
|
-
name: "prepend",
|
|
266
|
-
fn: i(() => [
|
|
267
|
-
d(e.$slots, "prepend", {}, void 0, !0)
|
|
268
|
-
]),
|
|
269
|
-
key: "2"
|
|
270
|
-
} : void 0
|
|
271
|
-
]), 1040, ["model-value", "disabled", "placeholder", "clearable", "debounce", "trigger-on-focus", "teleported", "fit-input-width", "popper-class", "append-to"])
|
|
272
|
-
], 2));
|
|
273
|
-
}
|
|
274
|
-
}), Ce = /* @__PURE__ */ ve(we, [["__scopeId", "data-v-f1f0e1f9"]]);
|
|
275
|
-
export {
|
|
276
|
-
Ce as Q
|
|
277
|
-
};
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import { defineComponent as W, useAttrs as Q, ref as r, computed as S, watch as V, onBeforeUnmount as j, createBlock as G, openBlock as H, mergeProps as J, unref as X, createSlots as Y, withCtx as d, renderSlot as f, createCommentVNode as Z, normalizeProps as x, guardReactiveProps as _ } from "vue";
|
|
2
|
-
import { _ as ee } from "./index.vue_vue_type_script_setup_true_lang-BmeBeCu0.mjs";
|
|
3
|
-
const te = /* @__PURE__ */ W({
|
|
4
|
-
name: "QyRemoteSelect",
|
|
5
|
-
inheritAttrs: !1,
|
|
6
|
-
__name: "index",
|
|
7
|
-
props: {
|
|
8
|
-
modelValue: { type: [String, Number, Boolean, Array, null], default: void 0 },
|
|
9
|
-
fetchMethod: {},
|
|
10
|
-
defaultOptions: { default: () => [] },
|
|
11
|
-
labelKey: { default: "label" },
|
|
12
|
-
valueKey: { default: "value" },
|
|
13
|
-
disabledKey: { default: "disabled" },
|
|
14
|
-
placeholder: { default: "请选择" },
|
|
15
|
-
disabled: { type: Boolean, default: !1 },
|
|
16
|
-
clearable: { type: Boolean, default: !0 },
|
|
17
|
-
multiple: { type: Boolean, default: !1 },
|
|
18
|
-
collapseTags: { type: Boolean, default: !1 },
|
|
19
|
-
collapseTagsTooltip: { type: Boolean, default: !1 },
|
|
20
|
-
autoSelectSingle: { type: Boolean, default: !1 },
|
|
21
|
-
size: { default: "default" },
|
|
22
|
-
teleported: { type: Boolean, default: !0 },
|
|
23
|
-
appendTo: { default: "body" },
|
|
24
|
-
fitInputWidth: { type: Boolean, default: !0 },
|
|
25
|
-
popperClass: { default: "" },
|
|
26
|
-
debounce: { default: 300 },
|
|
27
|
-
minLength: { default: 1 },
|
|
28
|
-
remoteOnFocus: { type: Boolean, default: !1 },
|
|
29
|
-
remoteShowSuffix: { type: Boolean, default: !0 },
|
|
30
|
-
loading: { type: Boolean, default: !1 },
|
|
31
|
-
reserveSelectedOption: { type: Boolean, default: !0 }
|
|
32
|
-
},
|
|
33
|
-
emits: ["update:modelValue", "change", "clear", "visible-change", "focus", "blur", "options-change", "loading-change", "error"],
|
|
34
|
-
setup(T, { expose: k, emit: C }) {
|
|
35
|
-
const l = T, t = C, $ = Q(), h = r(null), s = r([]), b = r(/* @__PURE__ */ new Map()), g = r(!1), c = r("");
|
|
36
|
-
let i = 0, n = null;
|
|
37
|
-
const F = S(() => l.loading || g.value), y = r(!1), u = S(() => {
|
|
38
|
-
const e = /* @__PURE__ */ new Map(), a = (o) => {
|
|
39
|
-
e.set(O(o), o);
|
|
40
|
-
};
|
|
41
|
-
return l.defaultOptions.forEach(a), l.reserveSelectedOption && b.value.forEach((o) => a(o)), s.value.forEach(a), Array.from(e.values());
|
|
42
|
-
});
|
|
43
|
-
V(
|
|
44
|
-
() => l.defaultOptions,
|
|
45
|
-
(e) => {
|
|
46
|
-
e.forEach(p);
|
|
47
|
-
},
|
|
48
|
-
{ immediate: !0 }
|
|
49
|
-
), V(
|
|
50
|
-
() => l.modelValue,
|
|
51
|
-
() => {
|
|
52
|
-
u.value.forEach(p);
|
|
53
|
-
},
|
|
54
|
-
{ immediate: !0 }
|
|
55
|
-
);
|
|
56
|
-
function O(e) {
|
|
57
|
-
return (e == null ? void 0 : e[l.valueKey]) ?? (e == null ? void 0 : e.value) ?? (e == null ? void 0 : e.label);
|
|
58
|
-
}
|
|
59
|
-
function w(e) {
|
|
60
|
-
return Array.isArray(l.modelValue) ? l.modelValue.includes(e) : l.modelValue === e;
|
|
61
|
-
}
|
|
62
|
-
function p(e) {
|
|
63
|
-
if (!l.reserveSelectedOption) return;
|
|
64
|
-
const a = O(e);
|
|
65
|
-
w(a) && b.value.set(a, e);
|
|
66
|
-
}
|
|
67
|
-
function A(e) {
|
|
68
|
-
return l.disabled ? !1 : e ? e.length >= l.minLength : l.remoteOnFocus;
|
|
69
|
-
}
|
|
70
|
-
function v(e) {
|
|
71
|
-
g.value !== e && (g.value = e, t("loading-change", e));
|
|
72
|
-
}
|
|
73
|
-
async function m(e) {
|
|
74
|
-
if (c.value = e, !A(e)) {
|
|
75
|
-
i += 1, s.value = [], v(!1), t("options-change", u.value);
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
const a = ++i;
|
|
79
|
-
v(!0);
|
|
80
|
-
try {
|
|
81
|
-
const o = await l.fetchMethod(e);
|
|
82
|
-
if (a !== i) return;
|
|
83
|
-
s.value = Array.isArray(o) ? o : [], s.value.forEach(p), t("options-change", u.value);
|
|
84
|
-
} catch (o) {
|
|
85
|
-
if (a !== i) return;
|
|
86
|
-
s.value = [], t("error", o), t("options-change", u.value);
|
|
87
|
-
} finally {
|
|
88
|
-
a === i && v(!1);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
function B() {
|
|
92
|
-
y.value || (y.value = !0, m(""));
|
|
93
|
-
}
|
|
94
|
-
function K(e) {
|
|
95
|
-
n && (clearTimeout(n), n = null), n = setTimeout(() => {
|
|
96
|
-
m(e);
|
|
97
|
-
}, l.debounce);
|
|
98
|
-
}
|
|
99
|
-
function E() {
|
|
100
|
-
y.value = !0, m("");
|
|
101
|
-
}
|
|
102
|
-
function M() {
|
|
103
|
-
m(c.value);
|
|
104
|
-
}
|
|
105
|
-
function I(e) {
|
|
106
|
-
t("update:modelValue", e);
|
|
107
|
-
}
|
|
108
|
-
function R(e) {
|
|
109
|
-
u.value.forEach(p), t("change", e);
|
|
110
|
-
}
|
|
111
|
-
function z() {
|
|
112
|
-
t("clear");
|
|
113
|
-
}
|
|
114
|
-
function L(e) {
|
|
115
|
-
e && l.remoteOnFocus && !c.value && B(), t("visible-change", e);
|
|
116
|
-
}
|
|
117
|
-
function P(e) {
|
|
118
|
-
l.remoteOnFocus && !c.value && B(), t("focus", e);
|
|
119
|
-
}
|
|
120
|
-
function U(e) {
|
|
121
|
-
t("blur", e);
|
|
122
|
-
}
|
|
123
|
-
function q() {
|
|
124
|
-
var e, a;
|
|
125
|
-
(a = (e = h.value) == null ? void 0 : e.focus) == null || a.call(e);
|
|
126
|
-
}
|
|
127
|
-
function D() {
|
|
128
|
-
var e, a;
|
|
129
|
-
(a = (e = h.value) == null ? void 0 : e.blur) == null || a.call(e);
|
|
130
|
-
}
|
|
131
|
-
function N() {
|
|
132
|
-
t("update:modelValue", l.multiple ? [] : ""), t("clear");
|
|
133
|
-
}
|
|
134
|
-
return j(() => {
|
|
135
|
-
n && clearTimeout(n);
|
|
136
|
-
}), k({
|
|
137
|
-
// 暴露远程选择常用控制方法,供弹窗打开后聚焦或请求失败后重试。
|
|
138
|
-
focus: q,
|
|
139
|
-
blur: D,
|
|
140
|
-
clear: N,
|
|
141
|
-
retryFetch: M,
|
|
142
|
-
fetchDefaultOptions: E
|
|
143
|
-
}), (e, a) => (H(), G(ee, J({
|
|
144
|
-
ref_key: "selectRef",
|
|
145
|
-
ref: h
|
|
146
|
-
}, X($), {
|
|
147
|
-
"model-value": e.modelValue,
|
|
148
|
-
options: u.value,
|
|
149
|
-
"label-key": e.labelKey,
|
|
150
|
-
"value-key": e.valueKey,
|
|
151
|
-
"disabled-key": e.disabledKey,
|
|
152
|
-
placeholder: e.placeholder,
|
|
153
|
-
disabled: e.disabled,
|
|
154
|
-
clearable: e.clearable,
|
|
155
|
-
filterable: !0,
|
|
156
|
-
multiple: e.multiple,
|
|
157
|
-
"collapse-tags": e.collapseTags,
|
|
158
|
-
"collapse-tags-tooltip": e.collapseTagsTooltip,
|
|
159
|
-
"auto-select-single": e.autoSelectSingle,
|
|
160
|
-
size: e.size,
|
|
161
|
-
teleported: e.teleported,
|
|
162
|
-
"append-to": e.appendTo,
|
|
163
|
-
"fit-input-width": e.fitInputWidth,
|
|
164
|
-
"popper-class": e.popperClass,
|
|
165
|
-
remote: "",
|
|
166
|
-
"remote-show-suffix": e.remoteShowSuffix,
|
|
167
|
-
"remote-method": K,
|
|
168
|
-
loading: F.value,
|
|
169
|
-
"onUpdate:modelValue": I,
|
|
170
|
-
onChange: R,
|
|
171
|
-
onClear: z,
|
|
172
|
-
onVisibleChange: L,
|
|
173
|
-
onFocus: P,
|
|
174
|
-
onBlur: U
|
|
175
|
-
}), Y({
|
|
176
|
-
default: d(() => [
|
|
177
|
-
e.$slots.default ? f(e.$slots, "default", { key: 0 }) : Z("", !0)
|
|
178
|
-
]),
|
|
179
|
-
_: 2
|
|
180
|
-
}, [
|
|
181
|
-
e.$slots.prefix ? {
|
|
182
|
-
name: "prefix",
|
|
183
|
-
fn: d(() => [
|
|
184
|
-
f(e.$slots, "prefix")
|
|
185
|
-
]),
|
|
186
|
-
key: "0"
|
|
187
|
-
} : void 0,
|
|
188
|
-
e.$slots.empty ? {
|
|
189
|
-
name: "empty",
|
|
190
|
-
fn: d(() => [
|
|
191
|
-
f(e.$slots, "empty")
|
|
192
|
-
]),
|
|
193
|
-
key: "1"
|
|
194
|
-
} : void 0,
|
|
195
|
-
e.$slots.loading ? {
|
|
196
|
-
name: "loading",
|
|
197
|
-
fn: d(() => [
|
|
198
|
-
f(e.$slots, "loading")
|
|
199
|
-
]),
|
|
200
|
-
key: "2"
|
|
201
|
-
} : void 0,
|
|
202
|
-
e.$slots.tag ? {
|
|
203
|
-
name: "tag",
|
|
204
|
-
fn: d((o) => [
|
|
205
|
-
f(e.$slots, "tag", x(_(o)))
|
|
206
|
-
]),
|
|
207
|
-
key: "3"
|
|
208
|
-
} : void 0
|
|
209
|
-
]), 1040, ["model-value", "options", "label-key", "value-key", "disabled-key", "placeholder", "disabled", "clearable", "multiple", "collapse-tags", "collapse-tags-tooltip", "auto-select-single", "size", "teleported", "append-to", "fit-input-width", "popper-class", "remote-show-suffix", "loading"]));
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
export {
|
|
213
|
-
te as _
|
|
214
|
-
};
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { defineComponent as E, useAttrs as P, useSlots as F, ref as O, computed as n, Comment as R, watch as I, createBlock as p, openBlock as o, unref as f, mergeProps as U, createSlots as W, withCtx as u, renderSlot as d, createElementBlock as j, Fragment as q, renderList as D, normalizeProps as L, guardReactiveProps as M } from "vue";
|
|
2
|
-
import { ElSelect as N, ElOption as Q } from "element-plus";
|
|
3
|
-
const J = /* @__PURE__ */ E({
|
|
4
|
-
name: "QySelect",
|
|
5
|
-
inheritAttrs: !1,
|
|
6
|
-
__name: "index",
|
|
7
|
-
props: {
|
|
8
|
-
modelValue: { type: [String, Number, Boolean, Array, null], default: void 0 },
|
|
9
|
-
options: { default: () => [] },
|
|
10
|
-
labelKey: { default: "label" },
|
|
11
|
-
valueKey: { default: "value" },
|
|
12
|
-
disabledKey: { default: "disabled" },
|
|
13
|
-
placeholder: { default: "请选择" },
|
|
14
|
-
disabled: { type: Boolean, default: !1 },
|
|
15
|
-
clearable: { type: Boolean, default: !0 },
|
|
16
|
-
filterable: { type: Boolean, default: !1 },
|
|
17
|
-
multiple: { type: Boolean, default: !1 },
|
|
18
|
-
collapseTags: { type: Boolean, default: !1 },
|
|
19
|
-
collapseTagsTooltip: { type: Boolean, default: !1 },
|
|
20
|
-
autoSelectSingle: { type: Boolean, default: !1 },
|
|
21
|
-
size: { default: "default" },
|
|
22
|
-
teleported: { type: Boolean, default: !0 },
|
|
23
|
-
appendTo: { default: "body" },
|
|
24
|
-
fitInputWidth: { type: Boolean, default: !0 },
|
|
25
|
-
popperClass: { default: "" }
|
|
26
|
-
},
|
|
27
|
-
emits: ["update:modelValue", "change", "clear", "visible-change", "focus", "blur"],
|
|
28
|
-
setup(c, { expose: m, emit: b }) {
|
|
29
|
-
const a = c, s = b, y = P(), g = F(), r = O(null), h = n(
|
|
30
|
-
() => ["qy-select__popper", a.popperClass].filter(Boolean).join(" ")
|
|
31
|
-
), i = n(
|
|
32
|
-
() => (a.options || []).map((e) => ({
|
|
33
|
-
raw: e,
|
|
34
|
-
label: (e == null ? void 0 : e[a.labelKey]) ?? (e == null ? void 0 : e.label) ?? (e == null ? void 0 : e.value) ?? "",
|
|
35
|
-
value: (e == null ? void 0 : e[a.valueKey]) ?? (e == null ? void 0 : e.value) ?? (e == null ? void 0 : e.label),
|
|
36
|
-
disabled: !!(e != null && e[a.disabledKey])
|
|
37
|
-
}))
|
|
38
|
-
), v = n(() => {
|
|
39
|
-
const e = g.default;
|
|
40
|
-
return e ? e().some((l) => l.type !== R) : !1;
|
|
41
|
-
});
|
|
42
|
-
function B(e) {
|
|
43
|
-
return Array.isArray(e) ? e.length === 0 : e === "" || e === null || e === void 0;
|
|
44
|
-
}
|
|
45
|
-
I(
|
|
46
|
-
[
|
|
47
|
-
i,
|
|
48
|
-
() => a.modelValue,
|
|
49
|
-
() => a.autoSelectSingle,
|
|
50
|
-
() => a.disabled,
|
|
51
|
-
() => a.multiple
|
|
52
|
-
],
|
|
53
|
-
([e]) => {
|
|
54
|
-
if (!a.autoSelectSingle || a.disabled || !B(a.modelValue) || e.length !== 1) return;
|
|
55
|
-
const [l] = e;
|
|
56
|
-
if (l.disabled) return;
|
|
57
|
-
const t = a.multiple ? [l.value] : l.value;
|
|
58
|
-
s("update:modelValue", t), s("change", t);
|
|
59
|
-
},
|
|
60
|
-
{ immediate: !0 }
|
|
61
|
-
);
|
|
62
|
-
function S(e, l) {
|
|
63
|
-
return `${String(e.value ?? e.label ?? "")}-${l}`;
|
|
64
|
-
}
|
|
65
|
-
function C(e) {
|
|
66
|
-
s("update:modelValue", e);
|
|
67
|
-
}
|
|
68
|
-
function V(e) {
|
|
69
|
-
s("change", e);
|
|
70
|
-
}
|
|
71
|
-
function k() {
|
|
72
|
-
s("clear");
|
|
73
|
-
}
|
|
74
|
-
function $(e) {
|
|
75
|
-
s("visible-change", e);
|
|
76
|
-
}
|
|
77
|
-
function T(e) {
|
|
78
|
-
s("focus", e);
|
|
79
|
-
}
|
|
80
|
-
function K(e) {
|
|
81
|
-
s("blur", e);
|
|
82
|
-
}
|
|
83
|
-
function z() {
|
|
84
|
-
var e, l;
|
|
85
|
-
(l = (e = r.value) == null ? void 0 : e.focus) == null || l.call(e);
|
|
86
|
-
}
|
|
87
|
-
function w() {
|
|
88
|
-
var e, l;
|
|
89
|
-
(l = (e = r.value) == null ? void 0 : e.blur) == null || l.call(e);
|
|
90
|
-
}
|
|
91
|
-
return m({
|
|
92
|
-
// 仅暴露业务常用焦点方法,复杂下拉行为仍交给 Element Plus 自身处理。
|
|
93
|
-
focus: z,
|
|
94
|
-
blur: w
|
|
95
|
-
}), (e, l) => (o(), p(f(N), U({
|
|
96
|
-
ref_key: "selectRef",
|
|
97
|
-
ref: r
|
|
98
|
-
}, f(y), {
|
|
99
|
-
"model-value": e.modelValue,
|
|
100
|
-
placeholder: e.placeholder,
|
|
101
|
-
disabled: e.disabled,
|
|
102
|
-
clearable: e.clearable,
|
|
103
|
-
filterable: e.filterable,
|
|
104
|
-
multiple: e.multiple,
|
|
105
|
-
"collapse-tags": e.collapseTags,
|
|
106
|
-
"collapse-tags-tooltip": e.collapseTagsTooltip,
|
|
107
|
-
size: e.size,
|
|
108
|
-
teleported: e.teleported,
|
|
109
|
-
"fit-input-width": e.fitInputWidth,
|
|
110
|
-
"popper-class": h.value,
|
|
111
|
-
"append-to": e.appendTo,
|
|
112
|
-
"onUpdate:modelValue": C,
|
|
113
|
-
onChange: V,
|
|
114
|
-
onClear: k,
|
|
115
|
-
onVisibleChange: $,
|
|
116
|
-
onFocus: T,
|
|
117
|
-
onBlur: K
|
|
118
|
-
}), W({
|
|
119
|
-
default: u(() => [
|
|
120
|
-
v.value ? d(e.$slots, "default", { key: 0 }) : (o(!0), j(q, { key: 1 }, D(i.value, (t, A) => (o(), p(f(Q), {
|
|
121
|
-
key: S(t, A),
|
|
122
|
-
label: t.label,
|
|
123
|
-
value: t.value,
|
|
124
|
-
disabled: t.disabled
|
|
125
|
-
}, null, 8, ["label", "value", "disabled"]))), 128))
|
|
126
|
-
]),
|
|
127
|
-
_: 2
|
|
128
|
-
}, [
|
|
129
|
-
e.$slots.prefix ? {
|
|
130
|
-
name: "prefix",
|
|
131
|
-
fn: u(() => [
|
|
132
|
-
d(e.$slots, "prefix")
|
|
133
|
-
]),
|
|
134
|
-
key: "0"
|
|
135
|
-
} : void 0,
|
|
136
|
-
e.$slots.empty ? {
|
|
137
|
-
name: "empty",
|
|
138
|
-
fn: u(() => [
|
|
139
|
-
d(e.$slots, "empty")
|
|
140
|
-
]),
|
|
141
|
-
key: "1"
|
|
142
|
-
} : void 0,
|
|
143
|
-
e.$slots.loading ? {
|
|
144
|
-
name: "loading",
|
|
145
|
-
fn: u(() => [
|
|
146
|
-
d(e.$slots, "loading")
|
|
147
|
-
]),
|
|
148
|
-
key: "2"
|
|
149
|
-
} : void 0,
|
|
150
|
-
e.$slots.tag ? {
|
|
151
|
-
name: "tag",
|
|
152
|
-
fn: u((t) => [
|
|
153
|
-
d(e.$slots, "tag", L(M(t)))
|
|
154
|
-
]),
|
|
155
|
-
key: "3"
|
|
156
|
-
} : void 0
|
|
157
|
-
]), 1040, ["model-value", "placeholder", "disabled", "clearable", "filterable", "multiple", "collapse-tags", "collapse-tags-tooltip", "size", "teleported", "fit-input-width", "popper-class", "append-to"]));
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
export {
|
|
161
|
-
J as _
|
|
162
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const l=require("vue"),r=require("element-plus"),k=l.defineComponent({name:"QyRadioGroup",inheritAttrs:!1,__name:"index",props:{modelValue:{type:[String,Number,Boolean,null],default:void 0},options:{default:()=>[]},labelKey:{default:"label"},valueKey:{default:"value"},disabledKey:{default:"disabled"},disabled:{type:Boolean,default:!1},size:{default:"default"},name:{default:void 0},type:{default:"radio"},border:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(n,{expose:f,emit:m}){const a=n,s=m,b=l.useAttrs(),t=l.ref(null),c=l.computed(()=>a.type==="button"?r.ElRadioButton:r.ElRadio),v=l.computed(()=>(a.options||[]).map(e=>({raw:e,label:(e==null?void 0:e[a.labelKey])??(e==null?void 0:e.label)??(e==null?void 0:e.value)??"",value:(e==null?void 0:e[a.valueKey])??(e==null?void 0:e.value)??(e==null?void 0:e.label),disabled:!!(e!=null&&e[a.disabledKey])})));function y(e){const u={value:e.value,label:e.value,disabled:e.disabled};return a.type==="button"?u:{...u,border:a.border}}function i(e,u){return`${String(e.value??e.label??"")}-${u}`}function g(e){s("update:modelValue",e)}function o(e){s("change",e)}function B(){return t.value}return f({getRadioGroupInstance:B}),(e,u)=>(l.openBlock(),l.createBlock(l.unref(r.ElRadioGroup),l.mergeProps({ref_key:"radioGroupRef",ref:t},l.unref(b),{"model-value":e.modelValue,disabled:e.disabled,size:e.size,name:e.name,"onUpdate:modelValue":g,onChange:o}),{default:l.withCtx(()=>[e.$slots.default?l.renderSlot(e.$slots,"default",{key:0}):(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(v.value,(d,h)=>(l.openBlock(),l.createBlock(l.resolveDynamicComponent(c.value),l.mergeProps({key:i(d,h)},{ref_for:!0},y(d)),{default:l.withCtx(()=>[l.renderSlot(e.$slots,"option",{option:d.raw,label:d.label,value:d.value,disabled:d.disabled},()=>[l.createTextVNode(l.toDisplayString(d.label),1)])]),_:2},1040))),128))]),_:3},16,["model-value","disabled","size","name"]))}});exports._sfc_main=k;
|