@qynpm/ui 1.0.5 → 1.0.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/README.md +228 -228
- package/dist/index.cjs +2 -1
- package/dist/index.mjs +54 -19
- package/dist/qy-action-bar/index.cjs +1 -1
- package/dist/qy-action-bar/index.mjs +4 -4
- package/dist/qy-dialog/index.cjs +1 -1
- package/dist/qy-dialog/index.mjs +4 -5
- package/dist/qy-form-section/index.cjs +1 -1
- package/dist/qy-form-section/index.mjs +2 -2
- package/dist/qy-input/index.cjs +1 -1
- package/dist/qy-input/index.mjs +4 -4
- package/dist/qy-money-input/index.cjs +1 -1
- package/dist/qy-money-input/index.mjs +4 -4
- package/dist/qy-radio-group/index.cjs +1 -1
- package/dist/qy-radio-group/index.mjs +4 -4
- package/dist/qy-record-quote-search/index.cjs +1 -1
- package/dist/qy-record-quote-search/index.mjs +2 -2
- package/dist/qy-remark-image/index.cjs +1 -2
- package/dist/qy-remark-image/index.mjs +3 -4
- package/dist/qy-remote-select/index.cjs +1 -1
- package/dist/qy-remote-select/index.mjs +4 -4
- package/dist/qy-search-input/index.cjs +1 -1
- package/dist/qy-search-input/index.mjs +3 -3
- package/dist/qy-select/index.cjs +1 -1
- package/dist/qy-select/index.mjs +4 -4
- package/dist/qy-upload/index.cjs +1 -1
- package/dist/qy-upload/index.mjs +3 -3
- package/dist/qy-voucher-upload/index.cjs +1 -1
- package/dist/qy-voucher-upload/index.mjs +4 -4
- package/dist/shared/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
- package/dist/shared/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
- package/dist/{lib/qy-action-bar/index.vue2.mjs → shared/index-Bw9kVFsm.mjs} +14 -13
- package/dist/{lib/qy-record-quote-search/index.vue2.mjs → shared/index-BzV4959-.mjs} +58 -57
- package/dist/{lib/qy-form-section/index.vue2.mjs → shared/index-C0ADdL4S.mjs} +20 -19
- package/dist/shared/index-CBSjmD0C.mjs +217 -0
- package/dist/shared/index-CJb1S7CP.cjs +1 -0
- package/dist/shared/index-CO8lz02r.cjs +1 -0
- package/dist/shared/index-ClPxDFKd.cjs +1 -0
- package/dist/shared/index-CtOqRiaj.cjs +1 -0
- package/dist/shared/index-DXB7_Tb5.cjs +1 -0
- package/dist/{lib/upload/index.vue.mjs → shared/index-DeWkPj3O.mjs} +121 -119
- package/dist/{lib/qy-voucher-upload/index.vue.mjs → shared/index-PUYQxK94.mjs} +2 -2
- package/dist/shared/index-UzZbxoqZ.cjs +1 -0
- package/dist/shared/index-a90QeEC4.cjs +1 -0
- package/dist/{lib/qy-search-input/index.vue2.mjs → shared/index-wW02nNOp.mjs} +50 -49
- package/dist/{lib/qy-remote-select/index.vue.mjs → shared/index.vue_vue_type_script_setup_true_lang-BcZg8D-y.mjs} +2 -2
- package/dist/{lib/qy-select/index.vue.mjs → shared/index.vue_vue_type_script_setup_true_lang-BmeBeCu0.mjs} +1 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-C85575cL.cjs +1 -0
- package/dist/{lib/qy-radio-group/index.vue.mjs → shared/index.vue_vue_type_script_setup_true_lang-DkYwdYdF.mjs} +4 -4
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-Do5SZ8yS.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DpZzyX5f.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DuUkOqwY.cjs +1 -0
- package/dist/{lib/qy-input/index.vue.mjs → shared/index.vue_vue_type_script_setup_true_lang-Dvh1BFaR.mjs} +7 -7
- package/dist/{lib/qy-money-input/index.vue.mjs → shared/index.vue_vue_type_script_setup_true_lang-RtfqJ73A.mjs} +24 -24
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-VVjCLNMD.cjs +1 -0
- package/dist/{lib/dialog/index.vue.mjs → shared/index.vue_vue_type_style_index_0_lang-DpIL_6vO.mjs} +1 -1
- package/dist/shared/index.vue_vue_type_style_index_0_lang-haqCjB5x.cjs +1 -0
- package/dist/{lib/utils/install.mjs → shared/install-CxBnxbuN.mjs} +2 -2
- package/dist/shared/install-c8il9DQv.cjs +1 -0
- package/dist/shared/js.cookie-CojEIxHg.cjs +1 -0
- package/dist/{node_modules/.pnpm/js-cookie@3.0.5/node_modules/js-cookie/dist/js.cookie.mjs → shared/js.cookie-OLEfuq_g.mjs} +13 -13
- package/index.d.ts +20 -20
- package/package.json +1 -1
- package/qy-money-input/index.d.ts +12 -12
- package/qy-money-input/index.js +15 -15
- package/qy-radio-group/index.d.ts +12 -12
- package/qy-radio-group/index.js +15 -15
- package/qy-remote-select/index.d.ts +12 -12
- package/qy-remote-select/index.js +15 -15
- package/qy-voucher-upload/index.d.ts +12 -12
- package/qy-voucher-upload/index.js +15 -15
- package/dist/_virtual/_plugin-vue_export-helper.cjs +0 -1
- package/dist/_virtual/_plugin-vue_export-helper.mjs +0 -9
- package/dist/lib/dialog/index.vue.cjs +0 -1
- package/dist/lib/dialog/index.vue3.cjs +0 -1
- package/dist/lib/dialog/index.vue3.mjs +0 -5
- package/dist/lib/index.cjs +0 -1
- package/dist/lib/index.mjs +0 -53
- package/dist/lib/qy-action-bar/index.vue.cjs +0 -1
- package/dist/lib/qy-action-bar/index.vue.mjs +0 -7
- package/dist/lib/qy-action-bar/index.vue2.cjs +0 -1
- package/dist/lib/qy-form-section/index.vue.cjs +0 -1
- package/dist/lib/qy-form-section/index.vue.mjs +0 -7
- package/dist/lib/qy-form-section/index.vue2.cjs +0 -1
- package/dist/lib/qy-input/index.vue.cjs +0 -1
- package/dist/lib/qy-input/index.vue2.cjs +0 -1
- package/dist/lib/qy-input/index.vue2.mjs +0 -4
- package/dist/lib/qy-money-input/index.vue.cjs +0 -1
- package/dist/lib/qy-money-input/index.vue2.cjs +0 -1
- package/dist/lib/qy-money-input/index.vue2.mjs +0 -4
- package/dist/lib/qy-radio-group/index.vue.cjs +0 -1
- package/dist/lib/qy-radio-group/index.vue2.cjs +0 -1
- package/dist/lib/qy-radio-group/index.vue2.mjs +0 -4
- package/dist/lib/qy-record-quote-search/index.vue.cjs +0 -1
- package/dist/lib/qy-record-quote-search/index.vue.mjs +0 -7
- package/dist/lib/qy-record-quote-search/index.vue2.cjs +0 -1
- package/dist/lib/qy-remote-select/index.vue.cjs +0 -1
- package/dist/lib/qy-remote-select/index.vue2.cjs +0 -1
- package/dist/lib/qy-remote-select/index.vue2.mjs +0 -4
- package/dist/lib/qy-search-input/index.vue.cjs +0 -1
- package/dist/lib/qy-search-input/index.vue.mjs +0 -7
- package/dist/lib/qy-search-input/index.vue2.cjs +0 -1
- package/dist/lib/qy-select/index.vue.cjs +0 -1
- package/dist/lib/qy-select/index.vue2.cjs +0 -1
- package/dist/lib/qy-select/index.vue2.mjs +0 -4
- package/dist/lib/qy-voucher-upload/index.vue.cjs +0 -1
- package/dist/lib/remark-image/index.vue.cjs +0 -1
- package/dist/lib/remark-image/index.vue.mjs +0 -7
- package/dist/lib/remark-image/index.vue2.cjs +0 -1
- package/dist/lib/remark-image/index.vue2.mjs +0 -197
- package/dist/lib/remark-image/utils.cjs +0 -1
- package/dist/lib/remark-image/utils.mjs +0 -22
- package/dist/lib/upload/index.vue.cjs +0 -1
- package/dist/lib/utils/auth.cjs +0 -1
- package/dist/lib/utils/auth.mjs +0 -8
- package/dist/lib/utils/install.cjs +0 -1
- package/dist/node_modules/.pnpm/js-cookie@3.0.5/node_modules/js-cookie/dist/js.cookie.cjs +0 -1
|
@@ -1,9 +1,10 @@
|
|
|
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
|
|
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
2
|
import { ElAutocomplete as he, ElButton as me } from "element-plus";
|
|
3
|
-
|
|
3
|
+
import { _ as ve } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
|
+
const ye = { class: "qy-search-input__item" }, be = ["innerHTML"], Ve = {
|
|
4
5
|
key: 0,
|
|
5
6
|
class: "qy-search-input__item-description"
|
|
6
|
-
},
|
|
7
|
+
}, we = /* @__PURE__ */ ae({
|
|
7
8
|
name: "QySearchInput",
|
|
8
9
|
inheritAttrs: !1,
|
|
9
10
|
__name: "index",
|
|
@@ -32,10 +33,10 @@ const ve = { class: "qy-search-input__item" }, ye = ["innerHTML"], be = {
|
|
|
32
33
|
fitInputWidth: { type: Boolean, default: !0 }
|
|
33
34
|
},
|
|
34
35
|
emits: ["update:modelValue", "search", "clear", "input", "change", "focus", "blur", "enter", "select", "visible-change", "suggestions-change", "error"],
|
|
35
|
-
setup(
|
|
36
|
-
const l =
|
|
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(
|
|
37
38
|
() => ["qy-search-input__popper", l.popperClass].filter(Boolean).join(" ")
|
|
38
|
-
),
|
|
39
|
+
), z = b(() => r(l.modelValue)), g = y("");
|
|
39
40
|
ue(
|
|
40
41
|
() => l.modelValue,
|
|
41
42
|
(e) => {
|
|
@@ -45,19 +46,19 @@ const ve = { class: "qy-search-input__item" }, ye = ["innerHTML"], be = {
|
|
|
45
46
|
function r(e) {
|
|
46
47
|
return e == null ? "" : String(e);
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
+
function P(e) {
|
|
49
50
|
return l.removeSpace ? e.replace(/\s+/g, "") : e;
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
+
function S(e, t) {
|
|
52
53
|
return l.trimMode !== t ? e : e.trim();
|
|
53
54
|
}
|
|
54
55
|
function h(e) {
|
|
55
|
-
return
|
|
56
|
+
return P(r(e));
|
|
56
57
|
}
|
|
57
58
|
function m(e) {
|
|
58
59
|
c.value = e, o("update:modelValue", e);
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
+
function k(e, t = "") {
|
|
61
62
|
return {
|
|
62
63
|
...e,
|
|
63
64
|
label: e.label || e.value,
|
|
@@ -69,23 +70,23 @@ const ve = { class: "qy-search-input__item" }, ye = ["innerHTML"], be = {
|
|
|
69
70
|
return e.flatMap((t) => {
|
|
70
71
|
if (Array.isArray(t.items)) {
|
|
71
72
|
const n = t;
|
|
72
|
-
return n.items.map((a) =>
|
|
73
|
+
return n.items.map((a) => k(a, n.groupLabel));
|
|
73
74
|
}
|
|
74
|
-
return
|
|
75
|
+
return k(t);
|
|
75
76
|
});
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
+
function K(e) {
|
|
78
79
|
const t = e.toLowerCase();
|
|
79
80
|
return (n) => [n.label, n.value, n.description].filter(Boolean).some((a) => String(a).toLowerCase().includes(t));
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
+
function Q(e) {
|
|
82
83
|
return e ? e.length >= l.minLength : l.triggerOnFocus;
|
|
83
84
|
}
|
|
84
85
|
function s(e) {
|
|
85
86
|
o("suggestions-change", e), o("visible-change", e.length > 0);
|
|
86
87
|
}
|
|
87
|
-
async function
|
|
88
|
-
if (!
|
|
88
|
+
async function R(e) {
|
|
89
|
+
if (!Q(e))
|
|
89
90
|
return s([]), [];
|
|
90
91
|
if (l.fetchSuggestionsMethod) {
|
|
91
92
|
const a = await new Promise((f) => {
|
|
@@ -100,19 +101,19 @@ const ve = { class: "qy-search-input__item" }, ye = ["innerHTML"], be = {
|
|
|
100
101
|
const a = await l.fetchSuggestions(e), f = v(Array.isArray(a) ? a : []);
|
|
101
102
|
return s(f), f;
|
|
102
103
|
}
|
|
103
|
-
const t = v(l.suggestions), n = e ? t.filter(
|
|
104
|
+
const t = v(l.suggestions), n = e ? t.filter(K(e)) : t;
|
|
104
105
|
return s(n), n;
|
|
105
106
|
}
|
|
106
|
-
async function
|
|
107
|
+
async function H(e, t) {
|
|
107
108
|
g.value = e;
|
|
108
109
|
try {
|
|
109
|
-
const n = await
|
|
110
|
+
const n = await R(e);
|
|
110
111
|
t(n);
|
|
111
112
|
} catch (n) {
|
|
112
113
|
o("error", n), s([]), t([]);
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
|
-
function
|
|
116
|
+
function N() {
|
|
116
117
|
var e, t;
|
|
117
118
|
g.value && ((t = (e = u.value) == null ? void 0 : e.getData) == null || t.call(e, g.value));
|
|
118
119
|
}
|
|
@@ -125,44 +126,44 @@ const ve = { class: "qy-search-input__item" }, ye = ["innerHTML"], be = {
|
|
|
125
126
|
c.value = t, o("input", t);
|
|
126
127
|
}
|
|
127
128
|
function U(e) {
|
|
128
|
-
const t =
|
|
129
|
+
const t = S(h(e), "change");
|
|
129
130
|
t !== r(l.modelValue) && m(t), o("change", t);
|
|
130
131
|
}
|
|
131
132
|
function W(e) {
|
|
132
133
|
o("focus", e);
|
|
133
134
|
}
|
|
134
135
|
function j(e) {
|
|
135
|
-
const t =
|
|
136
|
+
const t = S(c.value, "blur");
|
|
136
137
|
t !== r(l.modelValue) && m(t), o("blur", e), o("visible-change", !1);
|
|
137
138
|
}
|
|
138
|
-
function
|
|
139
|
+
function x() {
|
|
139
140
|
c.value = "", o("update:modelValue", ""), o("clear"), s([]);
|
|
140
141
|
}
|
|
141
|
-
function
|
|
142
|
-
o("enter", e), l.searchOnEnter &&
|
|
142
|
+
function G(e) {
|
|
143
|
+
o("enter", e), l.searchOnEnter && B();
|
|
143
144
|
}
|
|
144
|
-
function
|
|
145
|
+
function B() {
|
|
145
146
|
o("search", r(l.modelValue));
|
|
146
147
|
}
|
|
147
|
-
function
|
|
148
|
+
function J(e) {
|
|
148
149
|
o("select", e), l.searchOnSelect && o("search", e.value);
|
|
149
150
|
}
|
|
150
151
|
function C(e) {
|
|
151
152
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
152
153
|
}
|
|
153
|
-
function
|
|
154
|
+
function X(e) {
|
|
154
155
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
155
156
|
}
|
|
156
|
-
function
|
|
157
|
+
function Y(e) {
|
|
157
158
|
const t = C(e || "");
|
|
158
159
|
if (!l.highlightKeyword || !p.value) return t;
|
|
159
|
-
const n =
|
|
160
|
+
const n = X(C(p.value));
|
|
160
161
|
return n ? t.replace(
|
|
161
162
|
new RegExp(`(${n})`, "ig"),
|
|
162
163
|
'<mark class="qy-search-input__mark">$1</mark>'
|
|
163
164
|
) : t;
|
|
164
165
|
}
|
|
165
|
-
function
|
|
166
|
+
function Z() {
|
|
166
167
|
var e, t;
|
|
167
168
|
(t = (e = u.value) == null ? void 0 : e.focus) == null || t.call(e);
|
|
168
169
|
}
|
|
@@ -182,31 +183,31 @@ const ve = { class: "qy-search-input__item" }, ye = ["innerHTML"], be = {
|
|
|
182
183
|
var e, t;
|
|
183
184
|
(t = (e = u.value) == null ? void 0 : e.close) == null || t.call(e);
|
|
184
185
|
}
|
|
185
|
-
return
|
|
186
|
+
return T({
|
|
186
187
|
// 暴露搜索框常用控制方法,供弹窗打开后聚焦或失败后重试建议项。
|
|
187
|
-
focus:
|
|
188
|
+
focus: Z,
|
|
188
189
|
blur: ee,
|
|
189
190
|
select: te,
|
|
190
191
|
clear: ne,
|
|
191
192
|
closePanel: le,
|
|
192
|
-
retryFetch:
|
|
193
|
+
retryFetch: N
|
|
193
194
|
}), (e, t) => (V(), M("div", {
|
|
194
195
|
class: se(["qy-search-input", { "is-disabled": e.disabled }])
|
|
195
196
|
}, [
|
|
196
197
|
ie(w(he), E({
|
|
197
198
|
ref_key: "autocompleteRef",
|
|
198
199
|
ref: u
|
|
199
|
-
}, w(
|
|
200
|
-
"model-value":
|
|
200
|
+
}, w(A), {
|
|
201
|
+
"model-value": z.value,
|
|
201
202
|
disabled: e.disabled,
|
|
202
203
|
placeholder: e.placeholder,
|
|
203
204
|
clearable: e.clearable,
|
|
204
205
|
debounce: e.debounce,
|
|
205
|
-
"fetch-suggestions":
|
|
206
|
+
"fetch-suggestions": H,
|
|
206
207
|
"trigger-on-focus": e.triggerOnFocus,
|
|
207
208
|
teleported: e.teleported,
|
|
208
209
|
"fit-input-width": e.fitInputWidth,
|
|
209
|
-
"popper-class":
|
|
210
|
+
"popper-class": O.value,
|
|
210
211
|
"append-to": e.appendTo,
|
|
211
212
|
"value-key": "value",
|
|
212
213
|
"onUpdate:modelValue": q,
|
|
@@ -214,18 +215,18 @@ const ve = { class: "qy-search-input__item" }, ye = ["innerHTML"], be = {
|
|
|
214
215
|
onChange: U,
|
|
215
216
|
onFocus: W,
|
|
216
217
|
onBlur: j,
|
|
217
|
-
onClear:
|
|
218
|
-
onSelect:
|
|
219
|
-
onKeydown: ce(
|
|
218
|
+
onClear: x,
|
|
219
|
+
onSelect: J,
|
|
220
|
+
onKeydown: ce(G, ["enter"])
|
|
220
221
|
}), de({
|
|
221
222
|
append: i(() => [
|
|
222
223
|
e.$slots.append ? d(e.$slots, "append", { key: 0 }, void 0, !0) : (V(), pe(w(me), E({ key: 1 }, e.buttonProps, {
|
|
223
224
|
loading: e.loading,
|
|
224
225
|
disabled: e.disabled,
|
|
225
|
-
onClick:
|
|
226
|
+
onClick: B
|
|
226
227
|
}), {
|
|
227
228
|
default: i(() => [
|
|
228
|
-
ge(
|
|
229
|
+
ge(I(e.buttonText), 1)
|
|
229
230
|
]),
|
|
230
231
|
_: 1
|
|
231
232
|
}, 16, ["loading", "disabled"]))
|
|
@@ -235,12 +236,12 @@ const ve = { class: "qy-search-input__item" }, ye = ["innerHTML"], be = {
|
|
|
235
236
|
item: n,
|
|
236
237
|
keyword: p.value
|
|
237
238
|
}, () => [
|
|
238
|
-
F("div",
|
|
239
|
+
F("div", ye, [
|
|
239
240
|
F("div", {
|
|
240
241
|
class: "qy-search-input__item-label",
|
|
241
|
-
innerHTML:
|
|
242
|
-
}, null, 8,
|
|
243
|
-
n.description ? (V(), M("div",
|
|
242
|
+
innerHTML: Y(n.label || n.value || "")
|
|
243
|
+
}, null, 8, be),
|
|
244
|
+
n.description ? (V(), M("div", Ve, I(n.description), 1)) : fe("", !0)
|
|
244
245
|
])
|
|
245
246
|
], !0)
|
|
246
247
|
]),
|
|
@@ -270,7 +271,7 @@ const ve = { class: "qy-search-input__item" }, ye = ["innerHTML"], be = {
|
|
|
270
271
|
]), 1040, ["model-value", "disabled", "placeholder", "clearable", "debounce", "trigger-on-focus", "teleported", "fit-input-width", "popper-class", "append-to"])
|
|
271
272
|
], 2));
|
|
272
273
|
}
|
|
273
|
-
});
|
|
274
|
+
}), Ce = /* @__PURE__ */ ve(we, [["__scopeId", "data-v-f1f0e1f9"]]);
|
|
274
275
|
export {
|
|
275
|
-
|
|
276
|
+
Ce as Q
|
|
276
277
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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 ee from "
|
|
2
|
+
import { _ as ee } from "./index.vue_vue_type_script_setup_true_lang-BmeBeCu0.mjs";
|
|
3
3
|
const te = /* @__PURE__ */ W({
|
|
4
4
|
name: "QyRemoteSelect",
|
|
5
5
|
inheritAttrs: !1,
|
|
@@ -210,5 +210,5 @@ const te = /* @__PURE__ */ W({
|
|
|
210
210
|
}
|
|
211
211
|
});
|
|
212
212
|
export {
|
|
213
|
-
te as
|
|
213
|
+
te as _
|
|
214
214
|
};
|
|
@@ -0,0 +1 @@
|
|
|
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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as z, useAttrs as G, ref as $, computed as t, createBlock as f, openBlock as u, unref as n, mergeProps as m, withCtx as b, renderSlot as c, createElementBlock as E, Fragment as S, renderList as
|
|
1
|
+
import { defineComponent as z, useAttrs as G, ref as $, computed as t, createBlock as f, openBlock as u, unref as n, mergeProps as m, withCtx as b, renderSlot as c, createElementBlock as E, Fragment as S, renderList as _, resolveDynamicComponent as w, createTextVNode as P, toDisplayString as A } from "vue";
|
|
2
2
|
import { ElRadioButton as D, ElRadio as N, ElRadioGroup as O } from "element-plus";
|
|
3
3
|
const I = /* @__PURE__ */ z({
|
|
4
4
|
name: "QyRadioGroup",
|
|
@@ -65,7 +65,7 @@ const I = /* @__PURE__ */ z({
|
|
|
65
65
|
onChange: K
|
|
66
66
|
}), {
|
|
67
67
|
default: b(() => [
|
|
68
|
-
e.$slots.default ? c(e.$slots, "default", { key: 0 }) : (u(!0), E(S, { key: 1 },
|
|
68
|
+
e.$slots.default ? c(e.$slots, "default", { key: 0 }) : (u(!0), E(S, { key: 1 }, _(B.value, (l, C) => (u(), f(w(h.value), m({
|
|
69
69
|
key: k(l, C)
|
|
70
70
|
}, { ref_for: !0 }, R(l)), {
|
|
71
71
|
default: b(() => [
|
|
@@ -75,7 +75,7 @@ const I = /* @__PURE__ */ z({
|
|
|
75
75
|
value: l.value,
|
|
76
76
|
disabled: l.disabled
|
|
77
77
|
}, () => [
|
|
78
|
-
|
|
78
|
+
P(A(l.label), 1)
|
|
79
79
|
])
|
|
80
80
|
]),
|
|
81
81
|
_: 2
|
|
@@ -86,5 +86,5 @@ const I = /* @__PURE__ */ z({
|
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
export {
|
|
89
|
-
I as
|
|
89
|
+
I as _
|
|
90
90
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("vue"),T=require("element-plus"),q=t.defineComponent({name:"QyInput",inheritAttrs:!1,__name:"index",props:{modelValue:{default:""},removeSpace:{type:Boolean,default:!1},trimMode:{default:"none"}},emits:["update:modelValue","input","change","focus","blur","clear","enter"],setup(c,{expose:d,emit:p}){const a=c,u=p,m=t.useAttrs(),l=t.ref(null),r=t.ref(o(a.modelValue)),h=t.computed(()=>o(a.modelValue));t.watch(()=>a.modelValue,e=>{r.value=o(e)});function o(e){return e==null?"":String(e)}function v(e){return a.removeSpace?e.replace(/\s+/g,""):e}function s(e,n){return a.trimMode!==n?e:e.trim()}function f(e){return v(o(e))}function i(e){r.value=e,u("update:modelValue",e)}function V(e){const n=f(e);i(n)}function x(e){r.value=o(e),u("input",o(e))}function g(e){const n=s(f(e),"change");n!==o(a.modelValue)&&i(n),u("change",n)}function y(e){u("focus",e)}function C(e){const n=s(r.value,"blur");n!==o(a.modelValue)&&i(n),u("blur",e)}function S(){r.value="",u("update:modelValue",""),u("clear")}function $(e){u("enter",e)}function k(){var e,n;(n=(e=l.value)==null?void 0:e.focus)==null||n.call(e)}function w(){var e,n;(n=(e=l.value)==null?void 0:e.blur)==null||n.call(e)}function I(){var e,n;(n=(e=l.value)==null?void 0:e.select)==null||n.call(e)}function b(){var e,n;(n=(e=l.value)==null?void 0:e.clear)==null||n.call(e)}function z(){var e,n;(n=(e=l.value)==null?void 0:e.resizeTextarea)==null||n.call(e)}function B(){var e;return((e=l.value)==null?void 0:e.input)||null}function M(){var e;return((e=l.value)==null?void 0:e.textarea)||null}return d({focus:k,blur:w,select:I,clear:b,resizeTextarea:z,getNativeInput:B,getTextarea:M}),(e,n)=>(t.openBlock(),t.createBlock(t.unref(T.ElInput),t.mergeProps({ref_key:"inputRef",ref:l},t.unref(m),{"model-value":h.value,"onUpdate:modelValue":V,onInput:x,onChange:g,onFocus:y,onBlur:C,onClear:S,onKeydown:t.withKeys($,["enter"])}),t.createSlots({_:2},[e.$slots.prefix?{name:"prefix",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"prefix")]),key:"0"}:void 0,e.$slots.suffix?{name:"suffix",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"suffix")]),key:"1"}:void 0,e.$slots.prepend?{name:"prepend",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"prepend")]),key:"2"}:void 0,e.$slots.append?{name:"append",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"append")]),key:"3"}:void 0]),1040,["model-value"]))}});exports._sfc_main=q;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("vue"),n=require("element-plus"),T=l.defineComponent({name:"QySelect",inheritAttrs:!1,__name:"index",props:{modelValue:{type:[String,Number,Boolean,Array,null],default:void 0},options:{default:()=>[]},labelKey:{default:"label"},valueKey:{default:"value"},disabledKey:{default:"disabled"},placeholder:{default:"请选择"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},filterable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},collapseTagsTooltip:{type:Boolean,default:!1},autoSelectSingle:{type:Boolean,default:!1},size:{default:"default"},teleported:{type:Boolean,default:!0},appendTo:{default:"body"},fitInputWidth:{type:Boolean,default:!0},popperClass:{default:""}},emits:["update:modelValue","change","clear","visible-change","focus","blur"],setup(o,{expose:f,emit:i}){const t=o,u=i,c=l.useAttrs(),p=l.useSlots(),r=l.ref(null),m=l.computed(()=>["qy-select__popper",t.popperClass].filter(Boolean).join(" ")),d=l.computed(()=>(t.options||[]).map(e=>({raw:e,label:(e==null?void 0:e[t.labelKey])??(e==null?void 0:e.label)??(e==null?void 0:e.value)??"",value:(e==null?void 0:e[t.valueKey])??(e==null?void 0:e.value)??(e==null?void 0:e.label),disabled:!!(e!=null&&e[t.disabledKey])}))),b=l.computed(()=>{const e=p.default;return e?e().some(a=>a.type!==l.Comment):!1});function y(e){return Array.isArray(e)?e.length===0:e===""||e===null||e===void 0}l.watch([d,()=>t.modelValue,()=>t.autoSelectSingle,()=>t.disabled,()=>t.multiple],([e])=>{if(!t.autoSelectSingle||t.disabled||!y(t.modelValue)||e.length!==1)return;const[a]=e;if(a.disabled)return;const s=t.multiple?[a.value]:a.value;u("update:modelValue",s),u("change",s)},{immediate:!0});function g(e,a){return`${String(e.value??e.label??"")}-${a}`}function h(e){u("update:modelValue",e)}function v(e){u("change",e)}function B(){u("clear")}function S(e){u("visible-change",e)}function C(e){u("focus",e)}function k(e){u("blur",e)}function V(){var e,a;(a=(e=r.value)==null?void 0:e.focus)==null||a.call(e)}function $(){var e,a;(a=(e=r.value)==null?void 0:e.blur)==null||a.call(e)}return f({focus:V,blur:$}),(e,a)=>(l.openBlock(),l.createBlock(l.unref(n.ElSelect),l.mergeProps({ref_key:"selectRef",ref:r},l.unref(c),{"model-value":e.modelValue,placeholder:e.placeholder,disabled:e.disabled,clearable:e.clearable,filterable:e.filterable,multiple:e.multiple,"collapse-tags":e.collapseTags,"collapse-tags-tooltip":e.collapseTagsTooltip,size:e.size,teleported:e.teleported,"fit-input-width":e.fitInputWidth,"popper-class":m.value,"append-to":e.appendTo,"onUpdate:modelValue":h,onChange:v,onClear:B,onVisibleChange:S,onFocus:C,onBlur:k}),l.createSlots({default:l.withCtx(()=>[b.value?l.renderSlot(e.$slots,"default",{key:0}):(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(d.value,(s,w)=>(l.openBlock(),l.createBlock(l.unref(n.ElOption),{key:g(s,w),label:s.label,value:s.value,disabled:s.disabled},null,8,["label","value","disabled"]))),128))]),_:2},[e.$slots.prefix?{name:"prefix",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"prefix")]),key:"0"}:void 0,e.$slots.empty?{name:"empty",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"empty")]),key:"1"}:void 0,e.$slots.loading?{name:"loading",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"loading")]),key:"2"}:void 0,e.$slots.tag?{name:"tag",fn:l.withCtx(s=>[l.renderSlot(e.$slots,"tag",l.normalizeProps(l.guardReactiveProps(s)))]),key:"3"}:void 0]),1040,["model-value","placeholder","disabled","clearable","filterable","multiple","collapse-tags","collapse-tags-tooltip","size","teleported","fit-input-width","popper-class","append-to"]))}});exports._sfc_main=T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("vue"),P=require("./index.vue_vue_type_script_setup_true_lang-DpZzyX5f.cjs"),U=l.defineComponent({name:"QyRemoteSelect",inheritAttrs:!1,__name:"index",props:{modelValue:{type:[String,Number,Boolean,Array,null],default:void 0},fetchMethod:{},defaultOptions:{default:()=>[]},labelKey:{default:"label"},valueKey:{default:"value"},disabledKey:{default:"disabled"},placeholder:{default:"请选择"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},collapseTagsTooltip:{type:Boolean,default:!1},autoSelectSingle:{type:Boolean,default:!1},size:{default:"default"},teleported:{type:Boolean,default:!0},appendTo:{default:"body"},fitInputWidth:{type:Boolean,default:!0},popperClass:{default:""},debounce:{default:300},minLength:{default:1},remoteOnFocus:{type:Boolean,default:!1},remoteShowSuffix:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},reserveSelectedOption:{type:Boolean,default:!0}},emits:["update:modelValue","change","clear","visible-change","focus","blur","options-change","loading-change","error"],setup(S,{expose:O,emit:B}){const a=S,o=B,V=l.useAttrs(),p=l.ref(null),s=l.ref([]),v=l.ref(new Map),m=l.ref(!1),d=l.ref("");let i=0,u=null;const C=l.computed(()=>a.loading||m.value),h=l.ref(!1),r=l.computed(()=>{const e=new Map,t=n=>{e.set(y(n),n)};return a.defaultOptions.forEach(t),a.reserveSelectedOption&&v.value.forEach(n=>t(n)),s.value.forEach(t),Array.from(e.values())});l.watch(()=>a.defaultOptions,e=>{e.forEach(f)},{immediate:!0}),l.watch(()=>a.modelValue,()=>{r.value.forEach(f)},{immediate:!0});function y(e){return(e==null?void 0:e[a.valueKey])??(e==null?void 0:e.value)??(e==null?void 0:e.label)}function w(e){return Array.isArray(a.modelValue)?a.modelValue.includes(e):a.modelValue===e}function f(e){if(!a.reserveSelectedOption)return;const t=y(e);w(t)&&v.value.set(t,e)}function T(e){return a.disabled?!1:e?e.length>=a.minLength:a.remoteOnFocus}function g(e){m.value!==e&&(m.value=e,o("loading-change",e))}async function c(e){if(d.value=e,!T(e)){i+=1,s.value=[],g(!1),o("options-change",r.value);return}const t=++i;g(!0);try{const n=await a.fetchMethod(e);if(t!==i)return;s.value=Array.isArray(n)?n:[],s.value.forEach(f),o("options-change",r.value)}catch(n){if(t!==i)return;s.value=[],o("error",n),o("options-change",r.value)}finally{t===i&&g(!1)}}function b(){h.value||(h.value=!0,c(""))}function k(e){u&&(clearTimeout(u),u=null),u=setTimeout(()=>{c(e)},a.debounce)}function F(){h.value=!0,c("")}function $(){c(d.value)}function A(e){o("update:modelValue",e)}function K(e){r.value.forEach(f),o("change",e)}function E(){o("clear")}function M(e){e&&a.remoteOnFocus&&!d.value&&b(),o("visible-change",e)}function I(e){a.remoteOnFocus&&!d.value&&b(),o("focus",e)}function R(e){o("blur",e)}function z(){var e,t;(t=(e=p.value)==null?void 0:e.focus)==null||t.call(e)}function L(){var e,t;(t=(e=p.value)==null?void 0:e.blur)==null||t.call(e)}function q(){o("update:modelValue",a.multiple?[]:""),o("clear")}return l.onBeforeUnmount(()=>{u&&clearTimeout(u)}),O({focus:z,blur:L,clear:q,retryFetch:$,fetchDefaultOptions:F}),(e,t)=>(l.openBlock(),l.createBlock(P._sfc_main,l.mergeProps({ref_key:"selectRef",ref:p},l.unref(V),{"model-value":e.modelValue,options:r.value,"label-key":e.labelKey,"value-key":e.valueKey,"disabled-key":e.disabledKey,placeholder:e.placeholder,disabled:e.disabled,clearable:e.clearable,filterable:!0,multiple:e.multiple,"collapse-tags":e.collapseTags,"collapse-tags-tooltip":e.collapseTagsTooltip,"auto-select-single":e.autoSelectSingle,size:e.size,teleported:e.teleported,"append-to":e.appendTo,"fit-input-width":e.fitInputWidth,"popper-class":e.popperClass,remote:"","remote-show-suffix":e.remoteShowSuffix,"remote-method":k,loading:C.value,"onUpdate:modelValue":A,onChange:K,onClear:E,onVisibleChange:M,onFocus:I,onBlur:R}),l.createSlots({default:l.withCtx(()=>[e.$slots.default?l.renderSlot(e.$slots,"default",{key:0}):l.createCommentVNode("",!0)]),_:2},[e.$slots.prefix?{name:"prefix",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"prefix")]),key:"0"}:void 0,e.$slots.empty?{name:"empty",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"empty")]),key:"1"}:void 0,e.$slots.loading?{name:"loading",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"loading")]),key:"2"}:void 0,e.$slots.tag?{name:"tag",fn:l.withCtx(n=>[l.renderSlot(e.$slots,"tag",l.normalizeProps(l.guardReactiveProps(n)))]),key:"3"}:void 0]),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"]))}});exports._sfc_main=U;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as F, useAttrs as K, ref as d, computed as R, watch as U, createBlock as N, openBlock as P, unref as p, mergeProps as Q, withKeys as
|
|
2
|
-
import { ElInput as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as F, useAttrs as K, ref as d, computed as R, watch as U, createBlock as N, openBlock as P, unref as p, mergeProps as Q, withKeys as _, createSlots as j, withCtx as r, renderSlot as i } from "vue";
|
|
2
|
+
import { ElInput as q } from "element-plus";
|
|
3
|
+
const H = /* @__PURE__ */ F({
|
|
4
4
|
name: "QyInput",
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "index",
|
|
@@ -94,7 +94,7 @@ const J = /* @__PURE__ */ F({
|
|
|
94
94
|
resizeTextarea: T,
|
|
95
95
|
getNativeInput: A,
|
|
96
96
|
getTextarea: E
|
|
97
|
-
}), (e, n) => (P(), N(p(
|
|
97
|
+
}), (e, n) => (P(), N(p(q), Q({
|
|
98
98
|
ref_key: "inputRef",
|
|
99
99
|
ref: u
|
|
100
100
|
}, p(v), {
|
|
@@ -105,8 +105,8 @@ const J = /* @__PURE__ */ F({
|
|
|
105
105
|
onFocus: C,
|
|
106
106
|
onBlur: I,
|
|
107
107
|
onClear: S,
|
|
108
|
-
onKeydown:
|
|
109
|
-
}),
|
|
108
|
+
onKeydown: _(b, ["enter"])
|
|
109
|
+
}), j({ _: 2 }, [
|
|
110
110
|
e.$slots.prefix ? {
|
|
111
111
|
name: "prefix",
|
|
112
112
|
fn: r(() => [
|
|
@@ -139,5 +139,5 @@ const J = /* @__PURE__ */ F({
|
|
|
139
139
|
}
|
|
140
140
|
});
|
|
141
141
|
export {
|
|
142
|
-
|
|
142
|
+
H as _
|
|
143
143
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as U, useAttrs as D, ref as v, computed as Q, watch as
|
|
2
|
-
import { ElInput as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as U, useAttrs as D, ref as v, computed as Q, watch as _, createBlock as j, openBlock as q, unref as x, mergeProps as G, withKeys as H, createSlots as J, withCtx as m, renderSlot as p } from "vue";
|
|
2
|
+
import { ElInput as L } from "element-plus";
|
|
3
|
+
const X = /* @__PURE__ */ U({
|
|
4
4
|
name: "QyMoneyInput",
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "index",
|
|
@@ -15,8 +15,8 @@ const Y = /* @__PURE__ */ U({
|
|
|
15
15
|
},
|
|
16
16
|
emits: ["update:modelValue", "input", "change", "focus", "blur", "clear", "enter"],
|
|
17
17
|
setup(b, { expose: N, emit: $ }) {
|
|
18
|
-
const t = b, l = $, M = D(),
|
|
19
|
-
|
|
18
|
+
const t = b, l = $, M = D(), a = v(null), s = v(o(t.modelValue)), k = Q(() => o(t.modelValue));
|
|
19
|
+
_(
|
|
20
20
|
() => t.modelValue,
|
|
21
21
|
(e) => {
|
|
22
22
|
s.value = o(e);
|
|
@@ -30,25 +30,25 @@ const Y = /* @__PURE__ */ U({
|
|
|
30
30
|
}
|
|
31
31
|
function c(e) {
|
|
32
32
|
const n = o(e);
|
|
33
|
-
let
|
|
33
|
+
let i = "", f = !1, y = !1;
|
|
34
34
|
const h = V(t.precision);
|
|
35
35
|
for (let r = 0; r < n.length; r += 1) {
|
|
36
36
|
const u = n[r];
|
|
37
37
|
if (u >= "0" && u <= "9") {
|
|
38
|
-
|
|
38
|
+
i += u;
|
|
39
39
|
continue;
|
|
40
40
|
}
|
|
41
41
|
if (u === "." && h > 0 && !f) {
|
|
42
|
-
|
|
42
|
+
i += u, f = !0;
|
|
43
43
|
continue;
|
|
44
44
|
}
|
|
45
|
-
u === "-" && t.allowNegative && r === 0 && !y && (
|
|
45
|
+
u === "-" && t.allowNegative && r === 0 && !y && (i += u, y = !0);
|
|
46
46
|
}
|
|
47
47
|
if (h > 0 && f) {
|
|
48
|
-
const [r, u = ""] =
|
|
48
|
+
const [r, u = ""] = i.split(".");
|
|
49
49
|
return `${r}.${u.slice(0, h)}`;
|
|
50
50
|
}
|
|
51
|
-
return
|
|
51
|
+
return i;
|
|
52
52
|
}
|
|
53
53
|
function w(e) {
|
|
54
54
|
let n = e;
|
|
@@ -58,10 +58,10 @@ const Y = /* @__PURE__ */ U({
|
|
|
58
58
|
const n = c(e);
|
|
59
59
|
if (!n || n === "-" || n === ".")
|
|
60
60
|
return o(t.emptyValue);
|
|
61
|
-
const
|
|
62
|
-
if (Number.isNaN(
|
|
61
|
+
const i = Number(n);
|
|
62
|
+
if (Number.isNaN(i)) return o(t.emptyValue);
|
|
63
63
|
const f = V(t.precision);
|
|
64
|
-
return w(
|
|
64
|
+
return w(i).toFixed(f);
|
|
65
65
|
}
|
|
66
66
|
function d(e) {
|
|
67
67
|
s.value = e, l("update:modelValue", e);
|
|
@@ -97,23 +97,23 @@ const Y = /* @__PURE__ */ U({
|
|
|
97
97
|
}
|
|
98
98
|
function T() {
|
|
99
99
|
var e, n;
|
|
100
|
-
(n = (e =
|
|
100
|
+
(n = (e = a.value) == null ? void 0 : e.focus) == null || n.call(e);
|
|
101
101
|
}
|
|
102
102
|
function E() {
|
|
103
103
|
var e, n;
|
|
104
|
-
(n = (e =
|
|
104
|
+
(n = (e = a.value) == null ? void 0 : e.blur) == null || n.call(e);
|
|
105
105
|
}
|
|
106
106
|
function K() {
|
|
107
107
|
var e, n;
|
|
108
|
-
(n = (e =
|
|
108
|
+
(n = (e = a.value) == null ? void 0 : e.select) == null || n.call(e);
|
|
109
109
|
}
|
|
110
110
|
function P() {
|
|
111
111
|
var e, n;
|
|
112
|
-
(n = (e =
|
|
112
|
+
(n = (e = a.value) == null ? void 0 : e.clear) == null || n.call(e);
|
|
113
113
|
}
|
|
114
114
|
function R() {
|
|
115
115
|
var e;
|
|
116
|
-
return ((e =
|
|
116
|
+
return ((e = a.value) == null ? void 0 : e.input) || null;
|
|
117
117
|
}
|
|
118
118
|
return N({
|
|
119
119
|
focus: T,
|
|
@@ -121,9 +121,9 @@ const Y = /* @__PURE__ */ U({
|
|
|
121
121
|
select: K,
|
|
122
122
|
clear: P,
|
|
123
123
|
getNativeInput: R
|
|
124
|
-
}), (e, n) => (
|
|
124
|
+
}), (e, n) => (q(), j(x(L), G({
|
|
125
125
|
ref_key: "inputRef",
|
|
126
|
-
ref:
|
|
126
|
+
ref: a
|
|
127
127
|
}, x(M), {
|
|
128
128
|
"model-value": k.value,
|
|
129
129
|
inputmode: "decimal",
|
|
@@ -133,8 +133,8 @@ const Y = /* @__PURE__ */ U({
|
|
|
133
133
|
onFocus: B,
|
|
134
134
|
onBlur: z,
|
|
135
135
|
onClear: A,
|
|
136
|
-
onKeydown:
|
|
137
|
-
}),
|
|
136
|
+
onKeydown: H(S, ["enter"])
|
|
137
|
+
}), J({ _: 2 }, [
|
|
138
138
|
e.$slots.prefix ? {
|
|
139
139
|
name: "prefix",
|
|
140
140
|
fn: m(() => [
|
|
@@ -167,5 +167,5 @@ const Y = /* @__PURE__ */ U({
|
|
|
167
167
|
}
|
|
168
168
|
});
|
|
169
169
|
export {
|
|
170
|
-
|
|
170
|
+
X as _
|
|
171
171
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("vue"),q=require("element-plus"),E=t.defineComponent({name:"QyMoneyInput",inheritAttrs:!1,__name:"index",props:{modelValue:{default:""},precision:{default:2},min:{default:void 0},max:{default:void 0},allowNegative:{type:Boolean,default:!1},formatTrigger:{default:"blur"},emptyValue:{default:""}},emits:["update:modelValue","input","change","focus","blur","clear","enter"],setup(g,{expose:v,emit:y}){const u=g,i=y,b=t.useAttrs(),r=t.ref(null),f=t.ref(o(u.modelValue)),N=t.computed(()=>o(u.modelValue));t.watch(()=>u.modelValue,e=>{f.value=o(e)});function o(e){return e==null?"":String(e)}function h(e){return Number.isFinite(e)?Math.max(0,Math.floor(e)):2}function d(e){const n=o(e);let a="",c=!1,x=!1;const p=h(u.precision);for(let s=0;s<n.length;s+=1){const l=n[s];if(l>="0"&&l<="9"){a+=l;continue}if(l==="."&&p>0&&!c){a+=l,c=!0;continue}l==="-"&&u.allowNegative&&s===0&&!x&&(a+=l,x=!0)}if(p>0&&c){const[s,l=""]=a.split(".");return`${s}.${l.slice(0,p)}`}return a}function $(e){let n=e;return typeof u.min=="number"&&Number.isFinite(u.min)&&(n=Math.max(n,u.min)),typeof u.max=="number"&&Number.isFinite(u.max)&&(n=Math.min(n,u.max)),n}function V(e){const n=d(e);if(!n||n==="-"||n===".")return o(u.emptyValue);const a=Number(n);if(Number.isNaN(a))return o(u.emptyValue);const c=h(u.precision);return $(a).toFixed(c)}function m(e){f.value=e,i("update:modelValue",e)}function w(e){const n=d(e);m(n)}function C(e){const n=d(e);f.value=n,i("input",n)}function M(e){const n=u.formatTrigger==="change"?V(e):d(e);n!==o(u.modelValue)&&m(n),i("change",n)}function k(e){i("focus",e)}function F(e){if(u.formatTrigger==="blur"){const n=V(f.value);n!==o(u.modelValue)&&m(n)}i("blur",e)}function I(){const e=o(u.emptyValue);f.value=e,i("update:modelValue",e),i("clear")}function S(e){i("enter",e)}function B(){var e,n;(n=(e=r.value)==null?void 0:e.focus)==null||n.call(e)}function z(){var e,n;(n=(e=r.value)==null?void 0:e.blur)==null||n.call(e)}function A(){var e,n;(n=(e=r.value)==null?void 0:e.select)==null||n.call(e)}function P(){var e,n;(n=(e=r.value)==null?void 0:e.clear)==null||n.call(e)}function T(){var e;return((e=r.value)==null?void 0:e.input)||null}return v({focus:B,blur:z,select:A,clear:P,getNativeInput:T}),(e,n)=>(t.openBlock(),t.createBlock(t.unref(q.ElInput),t.mergeProps({ref_key:"inputRef",ref:r},t.unref(b),{"model-value":N.value,inputmode:"decimal","onUpdate:modelValue":w,onInput:C,onChange:M,onFocus:k,onBlur:F,onClear:I,onKeydown:t.withKeys(S,["enter"])}),t.createSlots({_:2},[e.$slots.prefix?{name:"prefix",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"prefix")]),key:"0"}:void 0,e.$slots.suffix?{name:"suffix",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"suffix")]),key:"1"}:void 0,e.$slots.prepend?{name:"prepend",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"prepend")]),key:"2"}:void 0,e.$slots.append?{name:"append",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"append")]),key:"3"}:void 0]),1040,["model-value"]))}});exports._sfc_main=E;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const Z=require("element-plus/es"),e=require("vue"),U=require("clsx"),A=require("element-plus"),H=require("@vueuse/core"),X={class:"text-lg flex items-center pt-2 pl-[var(--content-padding)]"},W={key:0},Y={key:1},G={key:0,class:"icon-[material-symbols--square-outline-rounded]",role:"img","aria-hidden":"true"},J={key:1,class:"icon-[tdesign--fullscreen-exit-1]",role:"img","aria-hidden":"true"},K={key:0,class:"fixed -right-12 top-2 h-9 w-9 hover:bg-gray-600/80 transition-all"},Q={class:"flex justify-between h-[var(--footer-height)] px-[var(--content-padding)] items-center"},ee={class:"flex items-center justify-between w-full pl-1 pr-4 h-full ml-2"},te={class:"flex items-center gap-2"},oe={class:"text-sm text-gray-700 truncate max-w-[200px]"},le={class:"flex items-center gap-2"},L=5,C=2e3,ne=e.defineComponent({__name:"index",props:e.mergeModels({layout:{type:[Array,String,Boolean],default:()=>["confirm","cancel"]},fullscreen:{type:Boolean,default:!1},showFullscreen:{type:Boolean,default:!1},confirmProps:{default:()=>({})},size:{default:"default"},zIndex:{default:2e3}},{modelValue:{default:!0},modelModifiers:{}}),emits:e.mergeModels(["confirm","cancel","close","opened","ok"],["update:modelValue"]),setup(E,{expose:O,emit:j}){const l=E,y=e.useSlots(),M=e.ref(!0),v=e.ref(!1),z=e.ref(C),F=H.useBreakpoints({mobile:0,tablet:640,laptop:1024,desktop:1280}).isSmaller("tablet"),w=e.computed(()=>{if(Array.isArray(l.layout))return l.layout;if(typeof l.layout=="string")return l.layout.split(",").map(o=>o.trim())}),B=e.computed(()=>({CancelButton:e.createVNode(I),ConfirmButton:e.createVNode(S)})),b=e.computed(()=>y.footer||l.layout!==!1),h=e.ref(!1),s=e.ref(l.showFullscreen&&F?!0:l.fullscreen),d=j,x=e.useModel(E,"modelValue");e.watchEffect(()=>{x.value&&(h.value=!1)}),O({});const k=e.useAttrs(),i=`qy-dialog-${Math.random().toString(36).slice(2,11)}`,a=e.ref(!1),u=e.ref(null);window.minimizedCount||(window.minimizedCount=0);const{x:V,y:_}=H.useDraggable(u,{initialValue:{x:5,y:window.innerHeight-100-(window.minimizedCount||0)*60},onMove(o){var t;(t=u.value)==null||t.classList.add("dragging"),document.body.classList.add("qy-dialog--dragging"),V.value=Math.max(0,Math.min(window.innerWidth-300,o.x)),_.value=Math.max(0,Math.min(window.innerHeight-50,o.y))},onEnd(){var o;(o=u.value)==null||o.classList.remove("dragging"),document.body.classList.remove("qy-dialog--dragging")}}),P=e.computed(()=>({transform:`translate(${V.value}px, ${_.value}px)`,willChange:"transform"}));function q(o){const t=o.target,{scrollTop:n,scrollHeight:r,clientHeight:f}=t;M.value=n<=L,v.value=r-(n+f)<=L}function T(){document.querySelector(`.${i}.el-dialog`).addEventListener("scroll",q),m(),d("opened")}function N(){s.value=!s.value,m()}function c(){h.value||(h.value=!0,a.value=!1,x.value=!1,d("cancel"),d("close"))}function R(o){l.showFullscreen&&o.detail>=2&&N()}function S(){return e.h(A.ElButton,{...e.unref(l.confirmProps),type:"primary",class:"dialog__footerBtn",onClick:()=>{d("confirm"),d("ok")}},()=>e.unref(l.confirmProps).title||"确 认")}function I(){return e.h(A.ElButton,{class:"dialog__footerBtn",onClick:()=>c()},()=>"取 消")}e.onMounted(()=>{typeof window.qyDialogMaxZIndex>"u"&&(window.qyDialogMaxZIndex=C),m()});function m(){var $;const o=Array.from(document.querySelectorAll(".el-overlay")).filter(p=>window.getComputedStyle(p).display!=="none"&&!p.classList.contains("is-message")),t=($=document.querySelector(`.${i}`))==null?void 0:$.closest(".el-overlay"),n=document.querySelector(`.${i}.el-dialog`);if(!t||!n)return;const r=C;window.qyDialogMaxZIndex=window.qyDialogMaxZIndex||r;const g=Math.max(window.qyDialogMaxZIndex,...o.map(p=>parseInt(window.getComputedStyle(p).zIndex||r.toString())))+2;window.qyDialogMaxZIndex=g,e.nextTick(()=>{t.style.zIndex=g.toString(),n.style.zIndex=(g+1).toString(),z.value=g+1})}e.onUnmounted(()=>{const o=document.querySelector(`.${i} .qy-dialog__wrapper-container`);o&&o.removeEventListener("scroll",q),a.value&&window.minimizedCount--});function D(){var t;a.value=!a.value;const o=(t=document.querySelector(`.${i}`))==null?void 0:t.closest(".el-overlay");a.value?(o.style.display="none",window.minimizedCount++,_.value=window.innerHeight-50-(window.minimizedCount||0)*60):(o.style.display="block",window.minimizedCount--,m())}return(o,t)=>{const n=e.resolveComponent("Close"),r=Z.ElIcon,f=Z.ElDialog;return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(f,e.mergeProps({ref:"dialogRef",class:["qy-dialog",[l.size==="small"&&"[&_.el-dialog__header]:!hidden",i]],"model-value":x.value,"align-center":"","append-to-body":"",style:{"--el-dialog-padding-primary":0},"show-close":!1,fullscreen:s.value,"z-index":z.value,onClosed:c,onOpened:T,draggable:""},e.unref(k)),e.createSlots({header:e.withCtx(()=>[l.size==="default"?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({borderBottom:"1px solid",borderColor:M.value?"transparent":"var(--block-outline-color)",transition:"border-color .2s linear"}),class:"flex justify-between h-[var(--header-height)]",onDblclick:R},[e.createElementVNode("div",X,[e.unref(y).header?e.unref(y).header?(e.openBlock(),e.createElementBlock("div",Y,[e.renderSlot(o.$slots,"header")])):e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",W,e.toDisplayString(e.unref(k).title),1))]),e.createElementVNode("div",{class:"flex",onMousedown:t[3]||(t[3]=e.withModifiers(()=>{},["stop"]))},[l.size==="default"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"qy-dialog__btn qy-dialog__btn--default",onClick:e.withModifiers(D,["stop"]),onMousedown:t[0]||(t[0]=e.withModifiers(()=>{},["stop"]))},t[4]||(t[4]=[e.createElementVNode("span",{class:"icon-[material-symbols--minimize] text-xl mb-3",role:"img","aria-hidden":"true"},null,-1)]),32)):e.createCommentVNode("",!0),l.showFullscreen?(e.openBlock(),e.createElementBlock("div",{key:1,class:"qy-dialog__btn qy-dialog__btn--default",onClick:e.withModifiers(N,["stop"]),onMousedown:t[1]||(t[1]=e.withModifiers(()=>{},["stop"]))},[s.value?(e.openBlock(),e.createElementBlock("span",J)):(e.openBlock(),e.createElementBlock("span",G))],32)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"qy-dialog__btn qy-dialog__btn--danger",onClick:e.withModifiers(c,["stop"]),onMousedown:t[2]||(t[2]=e.withModifiers(()=>{},["stop"]))},t[5]||(t[5]=[e.createElementVNode("span",{class:"icon-[ri--close-line] text-xl",role:"img","aria-hidden":"true"},null,-1)]),32)],32)],36)):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["qy-dialog__wrapper",e.unref(U)(s.value&&"qy-dialog__wrapper--fullscreen")]),style:e.normalizeStyle({maxHeight:b.value?"calc(100vh - var(--header-height) - var(--footer-height) - var(--sides-gap))":"calc(100vh - var(--header-height) - var(--sides-gap))",padding:l.size==="small"?"var(--small-content-padding)":"var(--content-padding)"})},[l.size==="small"?(e.openBlock(),e.createElementBlock("div",K,[e.createVNode(r,{size:36,class:"cursor-pointer text-gray-100 active:scale-75 rounded-sm transition-all",onClick:c},{default:e.withCtx(()=>[e.createVNode(n)]),_:1})])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default")],6)]),_:2},[!o.$slots.footer&&Array.isArray(w.value)?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",Q,[e.createElementVNode("div",null,[e.renderSlot(o.$slots,"footer-left")]),e.createElementVNode("div",{class:e.normalizeClass([{"qy-dialog__footer--outline":v.value},"qy-dialog__footer flex items-center justify-end"])},[w.value.includes("cancel")?(e.openBlock(),e.createBlock(I,{key:0})):e.createCommentVNode("",!0),w.value.includes("confirm")?(e.openBlock(),e.createBlock(S,{key:1})):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"footer-append")],2)])]),key:"0"}:b.value?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass([{"qy-dialog__footer--outline":v.value},"qy-dialog__footer px-[var(--content-padding)] min-h-[var(--footer-height)] flex items-center justify-end"])},[e.renderSlot(o.$slots,"footer",{layouts:B.value,layoutsNode:Object.values(B.value)})],2)]),key:"1"}:void 0]),1040,["class","model-value","fullscreen","z-index"]),e.withDirectives(e.createElementVNode("div",{ref_key:"minimizedRef",ref:u,class:"fixed left-0 top-0 bg-white rounded shadow-lg cursor-pointer z-[9999] hover:bg-gray-50",style:e.normalizeStyle([P.value,{width:"300px",height:"50px","will-change":"transform"}])},[e.createElementVNode("div",ee,[e.createElementVNode("div",te,[t[6]||(t[6]=e.createElementVNode("div",{class:"icon-[mdi--window-restore] text-gray-600"},null,-1)),e.createElementVNode("span",oe,e.toDisplayString(e.unref(k).title),1)]),e.createElementVNode("div",le,[e.createElementVNode("div",{class:"p-1 hover:bg-gray-200 rounded",onClick:e.withModifiers(D,["stop"])},t[7]||(t[7]=[e.createElementVNode("div",{class:"icon-[mdi--window-maximize] text-gray-600"},null,-1)])),e.createElementVNode("div",{class:"p-1 hover:bg-red-100 rounded",onClick:e.withModifiers(c,["stop"])},t[8]||(t[8]=[e.createElementVNode("div",{class:"icon-[mdi--close] text-red-600"},null,-1)]))])])],4),[[e.vShow,a.value]])])}}});exports._sfc_main=ne;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function s(i,l=i==null?void 0:i.name){return l&&(i.install=r=>{r.component(l,i)}),i}exports.withInstall=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";/*! js-cookie v3.0.5 | MIT */function d(r){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var p in f)r[p]=f[p]}return r}var g={read:function(r){return r[0]==='"'&&(r=r.slice(1,-1)),r.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(r){return encodeURIComponent(r).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function s(r,c){function f(n,t,e){if(!(typeof document>"u")){e=d({},c,e),typeof e.expires=="number"&&(e.expires=new Date(Date.now()+e.expires*864e5)),e.expires&&(e.expires=e.expires.toUTCString()),n=encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var i in e)e[i]&&(o+="; "+i,e[i]!==!0&&(o+="="+e[i].split(";")[0]));return document.cookie=n+"="+r.write(t,n)+o}}function p(n){if(!(typeof document>"u"||arguments.length&&!n)){for(var t=document.cookie?document.cookie.split("; "):[],e={},o=0;o<t.length;o++){var i=t[o].split("="),v=i.slice(1).join("=");try{var u=decodeURIComponent(i[0]);if(e[u]=r.read(v,u),n===u)break}catch{}}return n?e[n]:e}}return Object.create({set:f,get:p,remove:function(n,t){f(n,"",d({},t,{expires:-1}))},withAttributes:function(n){return s(this.converter,d({},this.attributes,n))},withConverter:function(n){return s(d({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(c)},converter:{value:Object.freeze(r)}})}var C=s(g,{path:"/"});exports.api=C;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! js-cookie v3.0.5 | MIT */
|
|
2
2
|
function d(r) {
|
|
3
|
-
for (var
|
|
4
|
-
var f = arguments[
|
|
3
|
+
for (var c = 1; c < arguments.length; c++) {
|
|
4
|
+
var f = arguments[c];
|
|
5
5
|
for (var p in f)
|
|
6
6
|
r[p] = f[p];
|
|
7
7
|
}
|
|
@@ -18,20 +18,20 @@ var g = {
|
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
function s(r,
|
|
22
|
-
function f(n,
|
|
21
|
+
function s(r, c) {
|
|
22
|
+
function f(n, t, e) {
|
|
23
23
|
if (!(typeof document > "u")) {
|
|
24
|
-
e = d({},
|
|
24
|
+
e = d({}, c, e), typeof e.expires == "number" && (e.expires = new Date(Date.now() + e.expires * 864e5)), e.expires && (e.expires = e.expires.toUTCString()), n = encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
25
25
|
var o = "";
|
|
26
26
|
for (var i in e)
|
|
27
27
|
e[i] && (o += "; " + i, e[i] !== !0 && (o += "=" + e[i].split(";")[0]));
|
|
28
|
-
return document.cookie = n + "=" + r.write(
|
|
28
|
+
return document.cookie = n + "=" + r.write(t, n) + o;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
function p(n) {
|
|
32
32
|
if (!(typeof document > "u" || arguments.length && !n)) {
|
|
33
|
-
for (var
|
|
34
|
-
var i =
|
|
33
|
+
for (var t = document.cookie ? document.cookie.split("; ") : [], e = {}, o = 0; o < t.length; o++) {
|
|
34
|
+
var i = t[o].split("="), v = i.slice(1).join("=");
|
|
35
35
|
try {
|
|
36
36
|
var u = decodeURIComponent(i[0]);
|
|
37
37
|
if (e[u] = r.read(v, u), n === u)
|
|
@@ -46,11 +46,11 @@ function s(r, t) {
|
|
|
46
46
|
{
|
|
47
47
|
set: f,
|
|
48
48
|
get: p,
|
|
49
|
-
remove: function(n,
|
|
49
|
+
remove: function(n, t) {
|
|
50
50
|
f(
|
|
51
51
|
n,
|
|
52
52
|
"",
|
|
53
|
-
d({},
|
|
53
|
+
d({}, t, {
|
|
54
54
|
expires: -1
|
|
55
55
|
})
|
|
56
56
|
);
|
|
@@ -63,12 +63,12 @@ function s(r, t) {
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
|
-
attributes: { value: Object.freeze(
|
|
66
|
+
attributes: { value: Object.freeze(c) },
|
|
67
67
|
converter: { value: Object.freeze(r) }
|
|
68
68
|
}
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
|
-
var
|
|
71
|
+
var a = s(g, { path: "/" });
|
|
72
72
|
export {
|
|
73
|
-
|
|
73
|
+
a
|
|
74
74
|
};
|