@qynpm/ui 1.0.29 → 1.0.32
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 +79 -8
- package/dist/index.cjs +4 -2
- package/dist/index.mjs +67 -58
- package/dist/qy-action-bar/index.cjs +1 -1
- package/dist/qy-action-bar/index.mjs +1 -1
- package/dist/qy-button/index.cjs +1 -1
- package/dist/qy-button/index.mjs +1 -1
- package/dist/qy-checkbox/index.cjs +1 -1
- package/dist/qy-checkbox/index.mjs +1 -1
- package/dist/qy-checkbox-group/index.cjs +1 -1
- package/dist/qy-checkbox-group/index.mjs +1 -1
- package/dist/qy-dialog/index.cjs +1 -1
- package/dist/qy-dialog/index.mjs +1 -1
- package/dist/qy-drawer/index.cjs +1 -0
- package/dist/qy-drawer/index.mjs +5 -0
- package/dist/qy-dropdown/index.cjs +1 -1
- package/dist/qy-dropdown/index.mjs +1 -1
- package/dist/qy-file-picker/index.cjs +1 -1
- package/dist/qy-file-picker/index.mjs +1 -1
- package/dist/qy-form-section/index.cjs +1 -1
- package/dist/qy-form-section/index.mjs +1 -1
- package/dist/qy-fullscreen/index.cjs +1 -1
- package/dist/qy-fullscreen/index.mjs +1 -1
- package/dist/qy-icon-picker/index.cjs +1 -1
- package/dist/qy-icon-picker/index.mjs +1 -1
- package/dist/qy-image/index.cjs +1 -1
- package/dist/qy-image/index.mjs +1 -1
- package/dist/qy-image-upload/index.cjs +1 -1
- package/dist/qy-image-upload/index.mjs +1 -1
- package/dist/qy-input/index.cjs +1 -1
- package/dist/qy-input/index.mjs +1 -1
- package/dist/qy-input-number/index.cjs +1 -1
- package/dist/qy-input-number/index.mjs +1 -1
- package/dist/qy-legacy-selection-dialog/index.cjs +1 -1
- package/dist/qy-legacy-selection-dialog/index.mjs +1 -1
- package/dist/qy-loading/index.cjs +1 -0
- package/dist/qy-loading/index.mjs +9 -0
- package/dist/qy-menu-actions/index.cjs +1 -1
- package/dist/qy-menu-actions/index.mjs +1 -1
- package/dist/qy-money-input/index.cjs +1 -1
- package/dist/qy-money-input/index.mjs +1 -1
- package/dist/qy-radio/index.cjs +1 -1
- package/dist/qy-radio/index.mjs +1 -1
- package/dist/qy-radio-group/index.cjs +1 -1
- package/dist/qy-radio-group/index.mjs +1 -1
- package/dist/qy-record-quote-search/index.cjs +1 -1
- package/dist/qy-record-quote-search/index.mjs +1 -1
- package/dist/qy-remark-image/index.cjs +1 -1
- package/dist/qy-remark-image/index.mjs +1 -1
- package/dist/qy-remote-select/index.cjs +1 -1
- package/dist/qy-remote-select/index.mjs +1 -1
- package/dist/qy-result/index.cjs +1 -0
- package/dist/qy-result/index.mjs +7 -0
- package/dist/qy-scrollbar/index.cjs +1 -1
- package/dist/qy-scrollbar/index.mjs +1 -1
- package/dist/qy-search-input/index.cjs +1 -1
- package/dist/qy-search-input/index.mjs +1 -1
- package/dist/qy-select/index.cjs +1 -1
- package/dist/qy-select/index.mjs +1 -1
- package/dist/qy-selection-dialog/index.cjs +1 -1
- package/dist/qy-selection-dialog/index.mjs +1 -1
- package/dist/qy-switch/index.cjs +1 -1
- package/dist/qy-switch/index.mjs +1 -1
- package/dist/qy-table-column-settings/index.cjs +1 -1
- package/dist/qy-table-column-settings/index.mjs +1 -1
- package/dist/qy-tag/index.cjs +1 -1
- package/dist/qy-tag/index.mjs +1 -1
- package/dist/qy-tree/index.cjs +1 -1
- package/dist/qy-tree/index.mjs +1 -1
- package/dist/qy-tree-select/index.cjs +1 -1
- package/dist/qy-tree-select/index.mjs +1 -1
- package/dist/qy-upload/index.cjs +1 -1
- package/dist/qy-upload/index.mjs +1 -1
- package/dist/shared/{index-C7V-LeFg.mjs → index-1LT6Q6XJ.mjs} +1 -1
- package/dist/shared/{index-BQj_q6rA.mjs → index-4wZQbpy3.mjs} +833 -822
- package/dist/shared/index-B1zDCCqy.mjs +78 -0
- package/dist/shared/{index-B9RYNZUh.cjs → index-BWDaV6FO.cjs} +1 -1
- package/dist/shared/{index-Czrv5jUt.mjs → index-BmJPEXUM.mjs} +1 -1
- package/dist/shared/index-BvKFjDgX.cjs +1 -0
- package/dist/shared/{index-BNQxyXzB.cjs → index-D-YyFaZ6.cjs} +1 -1
- package/dist/shared/index-Dvf1zJ7h.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-BLF3RNlY.mjs +331 -0
- package/dist/shared/{index.vue_vue_type_script_setup_true_lang-DXtovY1E.mjs → index.vue_vue_type_script_setup_true_lang-C91DUwOD.mjs} +1 -1
- package/dist/shared/{index.vue_vue_type_script_setup_true_lang-DXGjuA2f.cjs → index.vue_vue_type_script_setup_true_lang-CuXBYNXZ.cjs} +1 -1
- package/dist/shared/{index.vue_vue_type_script_setup_true_lang-CUox3Lm-.mjs → index.vue_vue_type_script_setup_true_lang-DP-jqqo2.mjs} +1 -1
- package/dist/shared/{index.vue_vue_type_script_setup_true_lang-kje3Rtlw.cjs → index.vue_vue_type_script_setup_true_lang-DkDEcB4G.cjs} +1 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-S6QPMZay.cjs +1 -0
- package/dist/shared/{index.vue_vue_type_style_index_0_lang-BTqKOZ4L.cjs → index.vue_vue_type_style_index_0_lang-CL_IFx-Z.cjs} +1 -1
- package/dist/shared/index.vue_vue_type_style_index_0_lang-CUqnwExG.mjs +80 -0
- package/dist/shared/{index.vue_vue_type_style_index_0_lang-Bc-Ya_zS.mjs → index.vue_vue_type_style_index_0_lang-DXQ9l1XF.mjs} +1 -1
- package/dist/shared/index.vue_vue_type_style_index_0_lang-lmRmXLwB.cjs +1 -0
- package/index.d.ts +62 -30
- package/package.json +20 -1
- package/qy-drawer/index.d.ts +55 -0
- package/qy-loading/index.d.ts +25 -0
- package/qy-result/index.d.ts +64 -0
- package/dist/shared/index-qwzyfx9S.cjs +0 -1
- /package/dist/shared/{index-D7A0RzWH.cjs → index-BDdhBEFr.cjs} +0 -0
- /package/dist/shared/{index-PlyLRNmb.cjs → index-Bmw9BNXm.cjs} +0 -0
- /package/dist/shared/{index-UGOgNLvm.cjs → index-BpI0jwYK.cjs} +0 -0
- /package/dist/shared/{index-C2n0R6rA.mjs → index-Bs2OQHXk.mjs} +0 -0
- /package/dist/shared/{index-DA3GVIZY.cjs → index-BxvS3vlc.cjs} +0 -0
- /package/dist/shared/{index-DMiZy6gD.cjs → index-Bxz4crCd.cjs} +0 -0
- /package/dist/shared/{index-YsBzyp9n.mjs → index-C-ZAw_DP.mjs} +0 -0
- /package/dist/shared/{index-CUITnlPr.mjs → index-C31wpivi.mjs} +0 -0
- /package/dist/shared/{index-BqV6vW9P.cjs → index-CCZttbsg.cjs} +0 -0
- /package/dist/shared/{index-DjyaOKUS.cjs → index-CltDZpF9.cjs} +0 -0
- /package/dist/shared/{index-mTWXYnLm.mjs → index-CmRclPWX.mjs} +0 -0
- /package/dist/shared/{index-DvA3Wy_F.mjs → index-Co0_4YEV.mjs} +0 -0
- /package/dist/shared/{index-C509sCx9.cjs → index-CpvFUems.cjs} +0 -0
- /package/dist/shared/{index-YM4DcbBZ.cjs → index-CwzztWPU.cjs} +0 -0
- /package/dist/shared/{index-WP9Dbscv.mjs → index-D6ybNdgn.mjs} +0 -0
- /package/dist/shared/{index-CtF8Nz3g.mjs → index-DEZF-Fkt.mjs} +0 -0
- /package/dist/shared/{index-D30m6gKz.cjs → index-DIs6iPjF.cjs} +0 -0
- /package/dist/shared/{index-Bs6yjkZ5.cjs → index-DLLDXfic.cjs} +0 -0
- /package/dist/shared/{index-BSxEaYHx.mjs → index-D_rRdrge.mjs} +0 -0
- /package/dist/shared/{index-CR6yQfR2.mjs → index-DfR8Z9MN.mjs} +0 -0
- /package/dist/shared/{index-DJT4yz0h.mjs → index-hEy-3mcr.mjs} +0 -0
- /package/dist/shared/{index-DHJf8Zto.mjs → index-kiAR2M_e.mjs} +0 -0
- /package/dist/shared/{index-4cLP6sJP.cjs → index-rcu9CzSn.cjs} +0 -0
- /package/dist/shared/{index-D0L-u1nt.mjs → index-seQHtqdh.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-CJaF7Ecm.mjs → index.vue_vue_type_style_index_0_lang-B-FeHatv.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-CqKs13Fp.cjs → index.vue_vue_type_style_index_0_lang-Cn3P9d4L.cjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-CC2-igG3.cjs → index.vue_vue_type_style_index_0_lang-DOfJV2oz.cjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-Dc84vYSd.mjs → index.vue_vue_type_style_index_0_lang-DzfGx6ce.mjs} +0 -0
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import { defineComponent as F, computed as g, openBlock as V, createBlock as T, unref as p, normalizeClass as H, createSlots as P, withCtx as v, renderSlot as w, createElementVNode as C, toDisplayString as I, createElementBlock as G, createCommentVNode as U, ref as k, watch as Z, onMounted as j, onBeforeUnmount as Q, nextTick as K } from "vue";
|
|
2
|
+
import { ElDrawer as W } from "element-plus";
|
|
3
|
+
const J = { class: "qy-drawer__header" }, X = { class: "qy-drawer__header-content" }, Y = { class: "qy-drawer__title" }, ee = /* @__PURE__ */ F({
|
|
4
|
+
name: "QyDrawerElementRenderer",
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "ElementDrawerRenderer",
|
|
7
|
+
props: {
|
|
8
|
+
id: {},
|
|
9
|
+
modelValue: { type: Boolean },
|
|
10
|
+
direction: {},
|
|
11
|
+
size: {},
|
|
12
|
+
teleportTo: {},
|
|
13
|
+
title: {},
|
|
14
|
+
showHeader: { type: Boolean },
|
|
15
|
+
showClose: { type: Boolean },
|
|
16
|
+
showOverlay: { type: Boolean },
|
|
17
|
+
destroyOnClose: { type: Boolean },
|
|
18
|
+
bodyPadding: {},
|
|
19
|
+
overlayVariant: {},
|
|
20
|
+
close: { type: Function }
|
|
21
|
+
},
|
|
22
|
+
emits: ["opened", "closed"],
|
|
23
|
+
setup(e, { expose: o }) {
|
|
24
|
+
const t = e, r = g(
|
|
25
|
+
() => t.bodyPadding === "none" ? "qy-drawer__body--none" : "qy-drawer__body--default"
|
|
26
|
+
), f = g(
|
|
27
|
+
() => t.overlayVariant === "transparent" ? "qy-drawer__overlay--transparent" : "qy-drawer__overlay--default"
|
|
28
|
+
), s = g(() => [
|
|
29
|
+
"qy-drawer",
|
|
30
|
+
`qy-drawer--body-${t.bodyPadding}`,
|
|
31
|
+
`qy-drawer--overlay-${t.overlayVariant}`
|
|
32
|
+
]), d = t.close;
|
|
33
|
+
function y() {
|
|
34
|
+
return typeof document > "u" ? null : document.querySelector(
|
|
35
|
+
`[data-qy-drawer-id="${t.id}"]`
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
function m() {
|
|
39
|
+
const l = y();
|
|
40
|
+
return (l == null ? void 0 : l.closest(".el-overlay")) || null;
|
|
41
|
+
}
|
|
42
|
+
return o({ getPanelElement: y, getOverlayElement: m }), (l, i) => (V(), T(p(W), {
|
|
43
|
+
"model-value": e.modelValue,
|
|
44
|
+
direction: e.direction,
|
|
45
|
+
size: e.size,
|
|
46
|
+
"append-to": e.teleportTo,
|
|
47
|
+
title: e.title,
|
|
48
|
+
"with-header": e.showHeader,
|
|
49
|
+
"show-close": !1,
|
|
50
|
+
modal: e.showOverlay,
|
|
51
|
+
"close-on-click-modal": !1,
|
|
52
|
+
"close-on-press-escape": !1,
|
|
53
|
+
"destroy-on-close": e.destroyOnClose,
|
|
54
|
+
"lock-scroll": !1,
|
|
55
|
+
"body-class": r.value,
|
|
56
|
+
"modal-class": f.value,
|
|
57
|
+
class: H(s.value),
|
|
58
|
+
"data-qy-drawer-id": e.id,
|
|
59
|
+
onOpened: i[1] || (i[1] = (h) => l.$emit("opened")),
|
|
60
|
+
onClosed: i[2] || (i[2] = (h) => l.$emit("closed"))
|
|
61
|
+
}, P({
|
|
62
|
+
header: v(({ titleId: h }) => [
|
|
63
|
+
C("div", J, [
|
|
64
|
+
C("div", X, [
|
|
65
|
+
w(l.$slots, "header", {
|
|
66
|
+
close: p(d),
|
|
67
|
+
titleId: h
|
|
68
|
+
}, () => [
|
|
69
|
+
C("span", Y, I(e.title), 1)
|
|
70
|
+
])
|
|
71
|
+
]),
|
|
72
|
+
e.showClose ? (V(), G("button", {
|
|
73
|
+
key: 0,
|
|
74
|
+
"data-testid": "qy-drawer-close",
|
|
75
|
+
class: "qy-drawer__close",
|
|
76
|
+
type: "button",
|
|
77
|
+
"aria-label": "关闭抽屉",
|
|
78
|
+
onClick: i[0] || (i[0] = //@ts-ignore
|
|
79
|
+
(...b) => p(d) && p(d)(...b))
|
|
80
|
+
}, [...i[3] || (i[3] = [
|
|
81
|
+
C("span", { "aria-hidden": "true" }, "×", -1)
|
|
82
|
+
])])) : U("", !0)
|
|
83
|
+
])
|
|
84
|
+
]),
|
|
85
|
+
default: v(() => [
|
|
86
|
+
w(l.$slots, "default", { close: p(d) })
|
|
87
|
+
]),
|
|
88
|
+
_: 2
|
|
89
|
+
}, [
|
|
90
|
+
l.$slots.footer ? {
|
|
91
|
+
name: "footer",
|
|
92
|
+
fn: v(() => [
|
|
93
|
+
w(l.$slots, "footer", { close: p(d) })
|
|
94
|
+
]),
|
|
95
|
+
key: "0"
|
|
96
|
+
} : void 0
|
|
97
|
+
]), 1032, ["model-value", "direction", "size", "append-to", "title", "with-header", "modal", "destroy-on-close", "body-class", "modal-class", "class", "data-qy-drawer-id"]));
|
|
98
|
+
}
|
|
99
|
+
}), x = [
|
|
100
|
+
"a[href]",
|
|
101
|
+
"area[href]",
|
|
102
|
+
"button:not([disabled])",
|
|
103
|
+
'input:not([disabled]):not([type="hidden"])',
|
|
104
|
+
"select:not([disabled])",
|
|
105
|
+
"textarea:not([disabled])",
|
|
106
|
+
"iframe",
|
|
107
|
+
"object",
|
|
108
|
+
"embed",
|
|
109
|
+
'[contenteditable="true"]',
|
|
110
|
+
'[tabindex]:not([tabindex="-1"])'
|
|
111
|
+
].join(",");
|
|
112
|
+
function te() {
|
|
113
|
+
if (typeof document > "u") return null;
|
|
114
|
+
const e = document.activeElement;
|
|
115
|
+
return e instanceof HTMLElement ? e : null;
|
|
116
|
+
}
|
|
117
|
+
function oe(e) {
|
|
118
|
+
var t, r;
|
|
119
|
+
if (!e) return;
|
|
120
|
+
(r = (t = e.querySelector(x) || e).focus) == null || r.call(t);
|
|
121
|
+
}
|
|
122
|
+
function ne(e) {
|
|
123
|
+
return !!(e != null && e.querySelector(x));
|
|
124
|
+
}
|
|
125
|
+
function le(e) {
|
|
126
|
+
!e || !e.isConnected || e.focus();
|
|
127
|
+
}
|
|
128
|
+
const c = [], O = /* @__PURE__ */ new Set();
|
|
129
|
+
let q = null;
|
|
130
|
+
function A() {
|
|
131
|
+
return [...c].reverse().find((e) => e.isOpen());
|
|
132
|
+
}
|
|
133
|
+
function S(e) {
|
|
134
|
+
if (!e.isConnected) return !1;
|
|
135
|
+
const o = window.getComputedStyle(e);
|
|
136
|
+
return o.display !== "none" && o.visibility !== "hidden";
|
|
137
|
+
}
|
|
138
|
+
function re(e) {
|
|
139
|
+
const { panel: o, overlay: t } = e.getLayerElements();
|
|
140
|
+
return t && S(t) ? t : o && S(o) ? o : null;
|
|
141
|
+
}
|
|
142
|
+
function L(e) {
|
|
143
|
+
const o = Number.parseInt(window.getComputedStyle(e).zIndex, 10);
|
|
144
|
+
return Number.isFinite(o) ? o : 0;
|
|
145
|
+
}
|
|
146
|
+
function ae(e, o) {
|
|
147
|
+
const t = L(e), r = L(o);
|
|
148
|
+
return t !== r ? t > r : !!(o.compareDocumentPosition(e) & Node.DOCUMENT_POSITION_FOLLOWING);
|
|
149
|
+
}
|
|
150
|
+
function se(e) {
|
|
151
|
+
return Array.from(
|
|
152
|
+
document.querySelectorAll(".el-overlay, .el-drawer, .el-dialog")
|
|
153
|
+
).filter(S).some((t) => t === e || !t.matches(".el-overlay") && t.closest(".el-overlay") ? !1 : ae(t, e));
|
|
154
|
+
}
|
|
155
|
+
function de(e) {
|
|
156
|
+
const o = re(e);
|
|
157
|
+
return !!(o && !se(o));
|
|
158
|
+
}
|
|
159
|
+
function ie(e) {
|
|
160
|
+
return c.some((o) => o.id !== e && o.isOpen());
|
|
161
|
+
}
|
|
162
|
+
function ue(e) {
|
|
163
|
+
return [...c].reverse().filter((o) => o.id !== e).map((o) => o.getFocusTarget()).find((o) => o == null ? void 0 : o.isConnected) || null;
|
|
164
|
+
}
|
|
165
|
+
function ce(e) {
|
|
166
|
+
return c.push(e), () => {
|
|
167
|
+
const o = c.indexOf(e);
|
|
168
|
+
o >= 0 && c.splice(o, 1);
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function fe(e) {
|
|
172
|
+
const o = c.findIndex((r) => r.id === e);
|
|
173
|
+
if (o < 0) return;
|
|
174
|
+
const [t] = c.splice(o, 1);
|
|
175
|
+
c.push(t);
|
|
176
|
+
}
|
|
177
|
+
function B(e, o) {
|
|
178
|
+
if (!(typeof document > "u" || !document.body)) {
|
|
179
|
+
if (o) {
|
|
180
|
+
if (O.has(e)) return;
|
|
181
|
+
O.size === 0 && (q = document.body.style.overflow), O.add(e), document.body.style.overflow = "hidden";
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
!O.delete(e) || O.size > 0 || (document.body.style.overflow = q ?? "", q = null);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function ye(e) {
|
|
188
|
+
if (e.key !== "Escape" && e.code !== "Escape") return;
|
|
189
|
+
const o = A();
|
|
190
|
+
!o || !de(o) || (e.preventDefault(), e.stopPropagation(), o.requestClose("escape"));
|
|
191
|
+
}
|
|
192
|
+
function me(e) {
|
|
193
|
+
const o = A();
|
|
194
|
+
!o || !o.isMaskTarget(e.target) || (e.preventDefault(), e.stopPropagation(), o.requestClose("mask"));
|
|
195
|
+
}
|
|
196
|
+
typeof window < "u" && (window.addEventListener("keydown", ye, !0), document.addEventListener("click", me, !0));
|
|
197
|
+
const pe = { class: "qy-drawer__title" }, he = /* @__PURE__ */ F({
|
|
198
|
+
name: "QyDrawer",
|
|
199
|
+
inheritAttrs: !1,
|
|
200
|
+
__name: "index",
|
|
201
|
+
props: {
|
|
202
|
+
modelValue: { type: Boolean },
|
|
203
|
+
placement: { default: "right" },
|
|
204
|
+
size: { default: "30%" },
|
|
205
|
+
title: { default: "" },
|
|
206
|
+
showHeader: { type: Boolean, default: !0 },
|
|
207
|
+
showClose: { type: Boolean, default: !0 },
|
|
208
|
+
showOverlay: { type: Boolean, default: !0 },
|
|
209
|
+
closeOnMask: { type: Boolean, default: !0 },
|
|
210
|
+
closeOnEscape: { type: Boolean, default: !0 },
|
|
211
|
+
destroyOnClose: { type: Boolean, default: !0 },
|
|
212
|
+
lockScroll: { type: Boolean, default: !0 },
|
|
213
|
+
autoFocus: { type: Boolean, default: !0 },
|
|
214
|
+
restoreFocus: { type: Boolean, default: !0 },
|
|
215
|
+
closeDisabled: { type: Boolean, default: !1 },
|
|
216
|
+
teleportTo: { default: "body" },
|
|
217
|
+
bodyPadding: { default: "default" },
|
|
218
|
+
overlayVariant: { default: "default" }
|
|
219
|
+
},
|
|
220
|
+
emits: ["update:modelValue", "close", "opened", "closed"],
|
|
221
|
+
setup(e, { emit: o }) {
|
|
222
|
+
const t = e, r = o, f = k(null), s = `qy-drawer-${Math.random().toString(36).slice(2, 10)}`, d = k(!1), y = k(!1), m = k(null);
|
|
223
|
+
let l;
|
|
224
|
+
const i = g(() => ({
|
|
225
|
+
left: "ltr",
|
|
226
|
+
right: "rtl",
|
|
227
|
+
top: "ttb",
|
|
228
|
+
bottom: "btt"
|
|
229
|
+
})[t.placement]), h = g(
|
|
230
|
+
() => typeof t.size == "number" ? `${t.size}px` : t.size
|
|
231
|
+
), b = () => $("close-button");
|
|
232
|
+
function M() {
|
|
233
|
+
return t.modelValue;
|
|
234
|
+
}
|
|
235
|
+
function N(n) {
|
|
236
|
+
var E, z;
|
|
237
|
+
if (!t.showOverlay || !t.closeOnMask) return !1;
|
|
238
|
+
const a = (E = f.value) == null ? void 0 : E.getPanelElement(), u = (z = f.value) == null ? void 0 : z.getOverlayElement();
|
|
239
|
+
return !a || !u || !(n instanceof Node) ? !1 : u.contains(n) && !a.contains(n);
|
|
240
|
+
}
|
|
241
|
+
function $(n) {
|
|
242
|
+
!t.modelValue || t.closeDisabled || n === "mask" && !t.closeOnMask || n === "escape" && !t.closeOnEscape || d.value || (d.value = !0, r("update:modelValue", !1), r("close", n));
|
|
243
|
+
}
|
|
244
|
+
function D() {
|
|
245
|
+
t.modelValue && (d.value = !1, y.value = !0, m.value = te(), fe(s), B(s, t.lockScroll));
|
|
246
|
+
}
|
|
247
|
+
function R() {
|
|
248
|
+
!t.modelValue || !y.value || (t.autoFocus && K(() => {
|
|
249
|
+
var u;
|
|
250
|
+
const n = ((u = f.value) == null ? void 0 : u.getPanelElement()) || null, a = (n == null ? void 0 : n.querySelector(".el-drawer__body")) || null;
|
|
251
|
+
oe(ne(a) ? a : n);
|
|
252
|
+
}), r("opened"));
|
|
253
|
+
}
|
|
254
|
+
function _() {
|
|
255
|
+
var a;
|
|
256
|
+
if (t.modelValue || !y.value) return;
|
|
257
|
+
y.value = !1, B(s, !1), r("closed");
|
|
258
|
+
const n = ie(s);
|
|
259
|
+
if (t.restoreFocus && !n) {
|
|
260
|
+
const u = (a = m.value) != null && a.isConnected ? m.value : ue(s);
|
|
261
|
+
le(u);
|
|
262
|
+
}
|
|
263
|
+
n || (m.value = null), d.value = !1;
|
|
264
|
+
}
|
|
265
|
+
return Z(
|
|
266
|
+
() => t.modelValue,
|
|
267
|
+
(n, a) => {
|
|
268
|
+
n && D();
|
|
269
|
+
}
|
|
270
|
+
), j(() => {
|
|
271
|
+
l = ce({
|
|
272
|
+
id: s,
|
|
273
|
+
isOpen: M,
|
|
274
|
+
isMaskTarget: N,
|
|
275
|
+
requestClose: $,
|
|
276
|
+
getFocusTarget: () => m.value,
|
|
277
|
+
getLayerElements: () => {
|
|
278
|
+
var n, a;
|
|
279
|
+
return {
|
|
280
|
+
panel: ((n = f.value) == null ? void 0 : n.getPanelElement()) || null,
|
|
281
|
+
overlay: ((a = f.value) == null ? void 0 : a.getOverlayElement()) || null
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
}), D();
|
|
285
|
+
}), Q(() => {
|
|
286
|
+
l == null || l(), B(s, !1), y.value = !1;
|
|
287
|
+
}), (n, a) => (V(), T(ee, {
|
|
288
|
+
ref_key: "rendererRef",
|
|
289
|
+
ref: f,
|
|
290
|
+
id: s,
|
|
291
|
+
"model-value": t.modelValue,
|
|
292
|
+
direction: i.value,
|
|
293
|
+
size: h.value,
|
|
294
|
+
"teleport-to": t.teleportTo,
|
|
295
|
+
title: t.title,
|
|
296
|
+
"show-header": t.showHeader,
|
|
297
|
+
"show-close": t.showClose,
|
|
298
|
+
"show-overlay": t.showOverlay,
|
|
299
|
+
"destroy-on-close": t.destroyOnClose,
|
|
300
|
+
"body-padding": t.bodyPadding,
|
|
301
|
+
"overlay-variant": t.overlayVariant,
|
|
302
|
+
close: b,
|
|
303
|
+
onOpened: R,
|
|
304
|
+
onClosed: _
|
|
305
|
+
}, P({
|
|
306
|
+
header: v(({ close: u, titleId: E }) => [
|
|
307
|
+
w(n.$slots, "header", {
|
|
308
|
+
close: u,
|
|
309
|
+
titleId: E
|
|
310
|
+
}, () => [
|
|
311
|
+
C("span", pe, I(t.title), 1)
|
|
312
|
+
])
|
|
313
|
+
]),
|
|
314
|
+
default: v(() => [
|
|
315
|
+
w(n.$slots, "default", { close: b })
|
|
316
|
+
]),
|
|
317
|
+
_: 2
|
|
318
|
+
}, [
|
|
319
|
+
n.$slots.footer ? {
|
|
320
|
+
name: "footer",
|
|
321
|
+
fn: v(() => [
|
|
322
|
+
w(n.$slots, "footer", { close: b })
|
|
323
|
+
]),
|
|
324
|
+
key: "0"
|
|
325
|
+
} : void 0
|
|
326
|
+
]), 1032, ["model-value", "direction", "size", "teleport-to", "title", "show-header", "show-close", "show-overlay", "destroy-on-close", "body-padding", "overlay-variant"]));
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
export {
|
|
330
|
+
he as _
|
|
331
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as p, useAttrs as b, computed as h, openBlock as t, createBlock as s, unref as v, mergeProps as x, withCtx as i, renderSlot as g, createElementBlock as C, Fragment as V, renderList as _, createTextVNode as z, toDisplayString as B } from "vue";
|
|
2
2
|
import { ElCheckboxGroup as $ } from "element-plus";
|
|
3
|
-
import { C as A } from "./index-
|
|
3
|
+
import { C as A } from "./index-D6ybNdgn.mjs";
|
|
4
4
|
const k = /* @__PURE__ */ p({
|
|
5
5
|
name: "QyCheckboxGroup",
|
|
6
6
|
inheritAttrs: !1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),m=require("element-plus"),f=require("./index-
|
|
1
|
+
"use strict";const e=require("vue"),m=require("element-plus"),f=require("./index-Bmw9BNXm.cjs"),b=e.defineComponent({name:"QyCheckboxGroup",inheritAttrs:!1,__name:"index",props:{modelValue:{default:()=>[]},options:{default:()=>[]},disabled:{type:Boolean,default:!1},min:{},max:{},size:{default:void 0},ariaLabel:{}},emits:["update:modelValue","change"],setup(d,{emit:i}){const l=d,s=i,o=e.useAttrs(),n=e.computed(()=>Object.fromEntries(Object.entries(o).filter(([a])=>a==="class"||a==="style"||a==="role"||a==="title"||a==="id"||a.startsWith("data-")||a.startsWith("aria-"))));function r(a){s("update:modelValue",a.slice())}function u(a){s("change",a.slice())}return(a,p)=>(e.openBlock(),e.createBlock(e.unref(m.ElCheckboxGroup),e.mergeProps(n.value,{"model-value":l.modelValue,disabled:l.disabled,min:l.min,max:l.max,size:l.size,"aria-label":l.ariaLabel,"onUpdate:modelValue":r,onChange:u}),{default:e.withCtx(()=>[a.$slots.default?e.renderSlot(a.$slots,"default",{},void 0,void 0,0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(l.options,(t,c)=>(e.openBlock(),e.createBlock(f.Checkbox,{key:`${String(t.value)}-${c}`,"model-value":l.modelValue.includes(t.value),value:t.value,disabled:l.disabled||t.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:2},1032,["model-value","value","disabled"]))),128))]),_:3},16,["model-value","disabled","min","max","size","aria-label"]))}});exports._sfc_main=b;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as C, useAttrs as G, computed as d, ref as S, openBlock as o, createBlock as u, unref as $, mergeProps as i, withCtx as f, renderSlot as m, createElementBlock as E, Fragment as O, renderList as w, resolveDynamicComponent as x, createTextVNode as A, toDisplayString as P } from "vue";
|
|
2
2
|
import { ElRadioButton as j, ElRadioGroup as D } from "element-plus";
|
|
3
|
-
import { R as N } from "./index-
|
|
3
|
+
import { R as N } from "./index-C31wpivi.mjs";
|
|
4
4
|
const I = /* @__PURE__ */ C({
|
|
5
5
|
name: "QyRadioGroup",
|
|
6
6
|
inheritAttrs: !1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const a=require("vue"),u=require("element-plus"),R=require("./index-
|
|
1
|
+
"use strict";const a=require("vue"),u=require("element-plus"),R=require("./index-CCZttbsg.cjs"),_=a.defineComponent({name:"QyRadioGroup",inheritAttrs:!1,__name:"index",props:{modelValue:{type:[Boolean,String,Number,null],default:void 0},options:{default:()=>[]},labelKey:{default:"label"},valueKey:{default:"value"},disabledKey:{default:"disabled"},disabled:{type:Boolean,default:!1},size:{default:void 0},name:{default:void 0},type:{default:"radio"},border:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(s,{expose:i,emit:c}){const l=s,d=c,f=a.useAttrs(),m=a.computed(()=>Object.fromEntries(Object.entries(f).filter(([e])=>e==="class"||e==="style"||e==="role"||e==="title"||e==="id"||e.startsWith("data-")||e.startsWith("aria-")))),n=a.ref(null),b=a.computed(()=>l.type==="button"?u.ElRadioButton:R.Radio),p=a.computed(()=>l.options.map(e=>{const r=e[l.labelKey],t=e[l.valueKey],o=v(t)?t:e.value??e.label??"";return{raw:e,label:String(r??e.label??e.value??""),value:o,disabled:!!e[l.disabledKey]}}));function v(e){return typeof e=="boolean"||typeof e=="string"||typeof e=="number"}function y(e){const r={modelValue:l.modelValue??void 0,value:e.value,label:e.label,disabled:e.disabled,size:l.size,name:l.name};return l.type==="button"?r:{...r,border:l.border}}function g(e,r){return`${String(e.value??e.label)}-${r}`}function h(e){d("update:modelValue",e)}function V(e){d("change",e)}function B(){return n.value}return i({getRadioGroupInstance:B}),(e,r)=>(a.openBlock(),a.createBlock(a.unref(u.ElRadioGroup),a.mergeProps({ref_key:"radioGroupRef",ref:n},m.value,{"model-value":l.modelValue,disabled:l.disabled,size:l.size,name:l.name,"onUpdate:modelValue":h,onChange:V}),{default:a.withCtx(()=>[e.$slots.default?a.renderSlot(e.$slots,"default",{},void 0,void 0,0):(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:1},a.renderList(p.value,(t,o)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(b.value),a.mergeProps({key:g(t,o)},{ref_for:!0},y(t)),{default:a.withCtx(()=>[a.renderSlot(e.$slots,"option",{option:t.raw,label:t.label,value:t.value,disabled:t.disabled},()=>[a.createTextVNode(a.toDisplayString(t.label),1)])]),_:2},1040))),128))]),_:3},16,["model-value","disabled","size","name"]))}});exports._sfc_main=_;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("vue"),F=require("element-plus"),T={class:"qy-drawer__header"},x={class:"qy-drawer__header-content"},P={class:"qy-drawer__title"},N=o.defineComponent({name:"QyDrawerElementRenderer",inheritAttrs:!1,__name:"ElementDrawerRenderer",props:{id:{},modelValue:{type:Boolean},direction:{},size:{},teleportTo:{},title:{},showHeader:{type:Boolean},showClose:{type:Boolean},showOverlay:{type:Boolean},destroyOnClose:{type:Boolean},bodyPadding:{},overlayVariant:{},close:{type:Function}},emits:["opened","closed"],setup(e,{expose:n}){const t=e,a=o.computed(()=>t.bodyPadding==="none"?"qy-drawer__body--none":"qy-drawer__body--default"),y=o.computed(()=>t.overlayVariant==="transparent"?"qy-drawer__overlay--transparent":"qy-drawer__overlay--default"),d=o.computed(()=>["qy-drawer",`qy-drawer--body-${t.bodyPadding}`,`qy-drawer--overlay-${t.overlayVariant}`]),i=t.close;function m(){return typeof document>"u"?null:document.querySelector(`[data-qy-drawer-id="${t.id}"]`)}function p(){const r=m();return(r==null?void 0:r.closest(".el-overlay"))||null}return n({getPanelElement:m,getOverlayElement:p}),(r,u)=>(o.openBlock(),o.createBlock(o.unref(F.ElDrawer),{"model-value":e.modelValue,direction:e.direction,size:e.size,"append-to":e.teleportTo,title:e.title,"with-header":e.showHeader,"show-close":!1,modal:e.showOverlay,"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":e.destroyOnClose,"lock-scroll":!1,"body-class":a.value,"modal-class":y.value,class:o.normalizeClass(d.value),"data-qy-drawer-id":e.id,onOpened:u[1]||(u[1]=v=>r.$emit("opened")),onClosed:u[2]||(u[2]=v=>r.$emit("closed"))},o.createSlots({header:o.withCtx(({titleId:v})=>[o.createElementVNode("div",T,[o.createElementVNode("div",x,[o.renderSlot(r.$slots,"header",{close:o.unref(i),titleId:v},()=>[o.createElementVNode("span",P,o.toDisplayString(e.title),1)])]),e.showClose?(o.openBlock(),o.createElementBlock("button",{key:0,"data-testid":"qy-drawer-close",class:"qy-drawer__close",type:"button","aria-label":"关闭抽屉",onClick:u[0]||(u[0]=(...w)=>o.unref(i)&&o.unref(i)(...w))},[...u[3]||(u[3]=[o.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):o.createCommentVNode("",!0)])]),default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{close:o.unref(i)})]),_:2},[r.$slots.footer?{name:"footer",fn:o.withCtx(()=>[o.renderSlot(r.$slots,"footer",{close:o.unref(i)})]),key:"0"}:void 0]),1032,["model-value","direction","size","append-to","title","with-header","modal","destroy-on-close","body-class","modal-class","class","data-qy-drawer-id"]))}}),S=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","iframe","object","embed",'[contenteditable="true"]','[tabindex]:not([tabindex="-1"])'].join(",");function I(){if(typeof document>"u")return null;const e=document.activeElement;return e instanceof HTMLElement?e:null}function A(e){var t,a;if(!e)return;(a=(t=e.querySelector(S)||e).focus)==null||a.call(t)}function M(e){return!!(e!=null&&e.querySelector(S))}function _(e){!e||!e.isConnected||e.focus()}const f=[],h=new Set;let C=null;function V(){return[...f].reverse().find(e=>e.isOpen())}function g(e){if(!e.isConnected)return!1;const n=window.getComputedStyle(e);return n.display!=="none"&&n.visibility!=="hidden"}function R(e){const{panel:n,overlay:t}=e.getLayerElements();return t&&g(t)?t:n&&g(n)?n:null}function B(e){const n=Number.parseInt(window.getComputedStyle(e).zIndex,10);return Number.isFinite(n)?n:0}function H(e,n){const t=B(e),a=B(n);return t!==a?t>a:!!(n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING)}function G(e){return Array.from(document.querySelectorAll(".el-overlay, .el-drawer, .el-dialog")).filter(g).some(t=>t===e||!t.matches(".el-overlay")&&t.closest(".el-overlay")?!1:H(t,e))}function U(e){const n=R(e);return!!(n&&!G(n))}function Z(e){return f.some(n=>n.id!==e&&n.isOpen())}function j(e){return[...f].reverse().filter(n=>n.id!==e).map(n=>n.getFocusTarget()).find(n=>n==null?void 0:n.isConnected)||null}function Q(e){return f.push(e),()=>{const n=f.indexOf(e);n>=0&&f.splice(n,1)}}function K(e){const n=f.findIndex(a=>a.id===e);if(n<0)return;const[t]=f.splice(n,1);f.push(t)}function O(e,n){if(!(typeof document>"u"||!document.body)){if(n){if(h.has(e))return;h.size===0&&(C=document.body.style.overflow),h.add(e),document.body.style.overflow="hidden";return}!h.delete(e)||h.size>0||(document.body.style.overflow=C??"",C=null)}}function W(e){if(e.key!=="Escape"&&e.code!=="Escape")return;const n=V();!n||!U(n)||(e.preventDefault(),e.stopPropagation(),n.requestClose("escape"))}function J(e){const n=V();!n||!n.isMaskTarget(e.target)||(e.preventDefault(),e.stopPropagation(),n.requestClose("mask"))}typeof window<"u"&&(window.addEventListener("keydown",W,!0),document.addEventListener("click",J,!0));const X={class:"qy-drawer__title"},Y=o.defineComponent({name:"QyDrawer",inheritAttrs:!1,__name:"index",props:{modelValue:{type:Boolean},placement:{default:"right"},size:{default:"30%"},title:{default:""},showHeader:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},showOverlay:{type:Boolean,default:!0},closeOnMask:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!0},restoreFocus:{type:Boolean,default:!0},closeDisabled:{type:Boolean,default:!1},teleportTo:{default:"body"},bodyPadding:{default:"default"},overlayVariant:{default:"default"}},emits:["update:modelValue","close","opened","closed"],setup(e,{emit:n}){const t=e,a=n,y=o.ref(null),d=`qy-drawer-${Math.random().toString(36).slice(2,10)}`,i=o.ref(!1),m=o.ref(!1),p=o.ref(null);let r;const u=o.computed(()=>({left:"ltr",right:"rtl",top:"ttb",bottom:"btt"})[t.placement]),v=o.computed(()=>typeof t.size=="number"?`${t.size}px`:t.size),w=()=>E("close-button");function D(){return t.modelValue}function $(l){var b,q;if(!t.showOverlay||!t.closeOnMask)return!1;const s=(b=y.value)==null?void 0:b.getPanelElement(),c=(q=y.value)==null?void 0:q.getOverlayElement();return!s||!c||!(l instanceof Node)?!1:c.contains(l)&&!s.contains(l)}function E(l){!t.modelValue||t.closeDisabled||l==="mask"&&!t.closeOnMask||l==="escape"&&!t.closeOnEscape||i.value||(i.value=!0,a("update:modelValue",!1),a("close",l))}function k(){t.modelValue&&(i.value=!1,m.value=!0,p.value=I(),K(d),O(d,t.lockScroll))}function z(){!t.modelValue||!m.value||(t.autoFocus&&o.nextTick(()=>{var c;const l=((c=y.value)==null?void 0:c.getPanelElement())||null,s=(l==null?void 0:l.querySelector(".el-drawer__body"))||null;A(M(s)?s:l)}),a("opened"))}function L(){var s;if(t.modelValue||!m.value)return;m.value=!1,O(d,!1),a("closed");const l=Z(d);if(t.restoreFocus&&!l){const c=(s=p.value)!=null&&s.isConnected?p.value:j(d);_(c)}l||(p.value=null),i.value=!1}return o.watch(()=>t.modelValue,(l,s)=>{l&&k()}),o.onMounted(()=>{r=Q({id:d,isOpen:D,isMaskTarget:$,requestClose:E,getFocusTarget:()=>p.value,getLayerElements:()=>{var l,s;return{panel:((l=y.value)==null?void 0:l.getPanelElement())||null,overlay:((s=y.value)==null?void 0:s.getOverlayElement())||null}}}),k()}),o.onBeforeUnmount(()=>{r==null||r(),O(d,!1),m.value=!1}),(l,s)=>(o.openBlock(),o.createBlock(N,{ref_key:"rendererRef",ref:y,id:d,"model-value":t.modelValue,direction:u.value,size:v.value,"teleport-to":t.teleportTo,title:t.title,"show-header":t.showHeader,"show-close":t.showClose,"show-overlay":t.showOverlay,"destroy-on-close":t.destroyOnClose,"body-padding":t.bodyPadding,"overlay-variant":t.overlayVariant,close:w,onOpened:z,onClosed:L},o.createSlots({header:o.withCtx(({close:c,titleId:b})=>[o.renderSlot(l.$slots,"header",{close:c,titleId:b},()=>[o.createElementVNode("span",X,o.toDisplayString(t.title),1)])]),default:o.withCtx(()=>[o.renderSlot(l.$slots,"default",{close:w})]),_:2},[l.$slots.footer?{name:"footer",fn:o.withCtx(()=>[o.renderSlot(l.$slots,"footer",{close:w})]),key:"0"}:void 0]),1032,["model-value","direction","size","teleport-to","title","show-header","show-close","show-overlay","destroy-on-close","body-padding","overlay-variant"]))}});exports._sfc_main=Y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),E=require("./index-B6xIO6kg.cjs"),K=require("./index-
|
|
1
|
+
"use strict";const e=require("vue"),E=require("./index-B6xIO6kg.cjs"),K=require("./index-rcu9CzSn.cjs"),j=require("../qy-popover/index.cjs"),L=require("./index-AirHUQwm.cjs");function F(l,p){const f=p==null?"":String(p),n=l&&f?l.resolve(f):void 0;return Object.freeze({value:f,known:!!n,canonicalName:n==null?void 0:n.name,definition:n})}function Y(l,p,f=""){const n=(l==null?void 0:l.list())??[],c=p===void 0?void 0:new Set(p.map(r=>{var s;return(s=l==null?void 0:l.resolve(r))==null?void 0:s.name}).filter(r=>!!r).map(P)),h=String(f).trim().toLocaleLowerCase();return Object.freeze(n.filter(r=>c&&!c.has(P(r.name))?!1:h?[r.name,r.label,...r.keywords??[]].some(s=>typeof s=="string"&&s.toLocaleLowerCase().includes(h)):!0))}function P(l){return L.normalizeQyIconName(l).toLocaleLowerCase()}const W={class:"qy-icon-picker"},G=["onKeydown"],H={class:"qy-icon-picker__preview","aria-hidden":"true"},J={key:1,class:"qy-icon-picker__missing","aria-hidden":"true"},X=["id"],Z={class:"qy-icon-picker__search","data-testid":"qy-icon-picker-search"},ee=["aria-label"],ae=["id","data-qy-icon-option","data-qy-icon-active","aria-selected","tabindex","onClick","onFocus","onKeydown"],ne={class:"qy-icon-picker__option-label"},oe={key:1,class:"qy-icon-picker__empty"};let te=0;const le=e.defineComponent({name:"QyIconPicker",__name:"index",props:{modelValue:{default:""},allowedNames:{},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},size:{default:"default"},placeholder:{default:"点击选择图标"},searchPlaceholder:{default:"搜索图标名称、标签或关键词"},emptyText:{default:"暂无匹配图标"},panelWidth:{default:540},open:{type:Boolean,default:void 0},id:{},ariaLabel:{}},emits:["update:modelValue","change","clear","update:open","open-change"],setup(l,{expose:p,emit:f}){const n=l,c=f,h=e.inject(L.QY_ICON_REGISTRY_KEY,null),r=e.ref(""),s=e.ref(!1),i=e.ref(-1),b=e.ref([]),y=e.ref(null),x=e.ref(null),w=e.ref("pointer"),Q=`qy-icon-picker-${++te}`,v=e.computed(()=>F(h,n.modelValue)),d=e.computed(()=>Y(h,n.allowedNames,r.value)),k=e.computed(()=>n.open!==void 0),m=e.computed(()=>k.value?n.open===!0:s.value),R=e.computed(()=>"click"),g=e.computed(()=>`${n.id||Q}-panel`);e.watch(m,(a,o)=>{!a||o||(r.value="",i.value=M(),b.value=[],w.value==="keyboard"&&e.nextTick(()=>{var t,u;return(u=(t=x.value)==null?void 0:t.focus)==null?void 0:u.call(t)}))}),e.watch(d,()=>{if(!d.value.length){i.value=-1;return}i.value>=d.value.length&&(i.value=0),i.value<0&&(i.value=0)});function N(){n.disabled||(w.value="keyboard",I("keyboard"))}function T(a){n.disabled||k.value&&n.open!==!1||(a.stopImmediatePropagation(),I("pointer"))}function z(a){q(a)}function $(a){a===m.value&&(k.value||(s.value=a),c("open-change",a),a||e.nextTick(()=>{var o,t;return(t=(o=y.value)==null?void 0:o.focus)==null?void 0:t.call(o)}))}function q(a){a&&n.disabled||a!==m.value&&(k.value||(s.value=a),c("update:open",a))}function I(a="programmatic"){w.value=a,q(!0)}function B(){q(!1),e.nextTick(()=>{var a,o;return(o=(a=y.value)==null?void 0:a.focus)==null?void 0:o.call(a)})}function V(){n.disabled||(c("update:modelValue",""),c("change",""),c("clear"))}function C(a){n.disabled||(c("update:modelValue",a.name),c("change",a.name),B())}function S(a){if(a.key==="Escape"){a.preventDefault(),B();return}if(!d.value.length||!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(a.key))return;a.preventDefault();const o=a.key==="ArrowUp"||a.key==="ArrowLeft"?-1:1,t=d.value.length;i.value=(i.value+o+t)%t,e.nextTick(()=>{var u;return(u=b.value[i.value])==null?void 0:u.focus()})}function M(){const a=v.value.canonicalName;if(!a)return d.value.length?0:-1;const o=d.value.findIndex(({name:t})=>t===a);return o>=0?o:d.value.length?0:-1}function A(a,o){a instanceof HTMLElement&&(b.value[o]=a)}function O(a){return`${g.value}-${encodeURIComponent(a)}`}function D(){var a,o;(o=(a=y.value)==null?void 0:a.focus)==null||o.call(a)}function U(){var a,o;(o=(a=y.value)==null?void 0:a.blur)==null||o.call(a)}return p({focus:D,blur:U,open:I,close:B}),(a,o)=>(e.openBlock(),e.createElementBlock("div",W,[e.createVNode(e.unref(j.QyPopover),{ref:"popoverRef",class:"qy-icon-picker__popover",open:m.value,trigger:R.value,placement:"bottom-start",width:n.panelWidth,"show-delay":0,"hide-delay":0,disabled:n.disabled||k.value&&n.open===!1,"onUpdate:open":z,onOpenChange:$},{reference:e.withCtx(()=>[e.createElementVNode("div",{class:"qy-icon-picker__trigger","data-testid":"qy-icon-picker-trigger",onClick:T,onKeydown:[e.withKeys(e.withModifiers(N,["prevent"]),["enter"]),e.withKeys(e.withModifiers(N,["prevent"]),["space"])]},[e.createVNode(e.unref(K.QyInput),{ref_key:"triggerRef",ref:y,id:n.id,"model-value":v.value.value,size:n.size,disabled:n.disabled,clearable:n.clearable,readonly:"",placeholder:n.placeholder,"aria-label":n.ariaLabel,"aria-haspopup":"listbox","aria-expanded":m.value?"true":"false","aria-controls":g.value,onClear:V},{prefix:e.withCtx(()=>[e.createElementVNode("span",H,[v.value.definition?(e.openBlock(),e.createBlock(e.unref(E.QyIcon),{key:0,name:v.value.definition.name,size:18},null,8,["name"])):(e.openBlock(),e.createElementBlock("span",J,"?"))])]),suffix:e.withCtx(()=>[n.clearable&&v.value.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"qy-icon-picker__clear","data-testid":"qy-icon-picker-clear","aria-label":"清空图标",onClick:e.withModifiers(V,["stop","prevent"])},[...o[1]||(o[1]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):e.createCommentVNode("",!0)]),_:1},8,["id","model-value","size","disabled","clearable","placeholder","aria-label","aria-expanded","aria-controls"])],40,G)]),default:e.withCtx(()=>[m.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:g.value,class:"qy-icon-picker__panel",onKeydown:S},[e.createElementVNode("div",Z,[e.createVNode(e.unref(K.QyInput),{ref_key:"searchRef",ref:x,modelValue:r.value,"onUpdate:modelValue":o[0]||(o[0]=t=>r.value=t),type:"search",clearable:"",placeholder:n.searchPlaceholder,"aria-label":"搜索图标"},null,8,["modelValue","placeholder"])]),d.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:"qy-icon-picker__grid",role:"listbox","aria-label":n.ariaLabel||"图标列表"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(t,u)=>(e.openBlock(),e.createElementBlock("div",{id:O(t.name),key:t.name,ref_for:!0,ref:_=>A(_,u),class:e.normalizeClass(["qy-icon-picker__option",{"is-active":i.value===u}]),"data-qy-icon-option":t.name,"data-qy-icon-active":i.value===u?"true":void 0,role:"option","aria-selected":v.value.canonicalName===t.name?"true":"false",tabindex:i.value===u?0:-1,onClick:_=>C(t),onFocus:_=>i.value=u,onKeydown:[e.withKeys(e.withModifiers(_=>C(t),["prevent"]),["enter"]),e.withKeys(e.withModifiers(_=>C(t),["prevent"]),["space"])]},[e.createVNode(e.unref(E.QyIcon),{name:t.name,size:18,"aria-hidden":"true"},null,8,["name"]),e.createElementVNode("span",ne,e.toDisplayString(t.label||t.name),1)],42,ae))),128))],8,ee)):(e.openBlock(),e.createElementBlock("div",oe,[e.renderSlot(a.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(n.emptyText),1)])]))],40,X)):e.createCommentVNode("",!0)]),_:3},8,["open","trigger","width","disabled"])]))}});exports._sfc_main=le;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { defineComponent as m, computed as a, h as s } from "vue";
|
|
2
|
+
import { ElResult as o } from "element-plus";
|
|
3
|
+
const u = ["success", "warning", "info", "error"], r = ["401", "403", "404", "500"], g = (t) => t === "class" || t === "style" || t === "id" || t === "role" || t === "title" || t.startsWith("data-") || t.startsWith("aria-"), v = {
|
|
4
|
+
status: {
|
|
5
|
+
type: String,
|
|
6
|
+
default: "info",
|
|
7
|
+
validator: (t) => [...u, ...r].includes(t)
|
|
8
|
+
},
|
|
9
|
+
title: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: ""
|
|
12
|
+
},
|
|
13
|
+
description: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: ""
|
|
16
|
+
},
|
|
17
|
+
image: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ""
|
|
20
|
+
},
|
|
21
|
+
imageAlt: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: ""
|
|
24
|
+
}
|
|
25
|
+
}, h = m({
|
|
26
|
+
name: "QyResult",
|
|
27
|
+
inheritAttrs: !1,
|
|
28
|
+
props: v,
|
|
29
|
+
setup(t, { attrs: l, slots: e }) {
|
|
30
|
+
const n = a(
|
|
31
|
+
() => Object.fromEntries(Object.entries(l).filter(([i]) => g(i)))
|
|
32
|
+
), c = a(() => [
|
|
33
|
+
"qy-result",
|
|
34
|
+
`qy-result--${t.status}`,
|
|
35
|
+
n.value.class
|
|
36
|
+
]), d = a(() => [
|
|
37
|
+
"qy-result__renderer",
|
|
38
|
+
`qy-result--${t.status}`
|
|
39
|
+
]), f = () => {
|
|
40
|
+
if (e.visual) return e.visual();
|
|
41
|
+
if (t.image)
|
|
42
|
+
return s("img", {
|
|
43
|
+
class: "qy-result__image",
|
|
44
|
+
src: t.image,
|
|
45
|
+
alt: t.imageAlt
|
|
46
|
+
});
|
|
47
|
+
if (r.includes(t.status))
|
|
48
|
+
return s(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
class: "qy-result__http-visual",
|
|
52
|
+
"aria-hidden": "true"
|
|
53
|
+
},
|
|
54
|
+
t.status
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
return () => {
|
|
58
|
+
const i = {};
|
|
59
|
+
return (e.visual || t.image || r.includes(t.status)) && (i.icon = f), e.title && (i.title = e.title), e.description && (i["sub-title"] = e.description), e.actions && (i.extra = e.actions), s("div", {
|
|
60
|
+
...n.value,
|
|
61
|
+
class: c.value,
|
|
62
|
+
title: t.title
|
|
63
|
+
}, [
|
|
64
|
+
s(
|
|
65
|
+
o,
|
|
66
|
+
{
|
|
67
|
+
class: d.value,
|
|
68
|
+
icon: u.includes(t.status) ? t.status : void 0,
|
|
69
|
+
title: e.title ? "" : t.title,
|
|
70
|
+
subTitle: e.description ? "" : t.description
|
|
71
|
+
},
|
|
72
|
+
i
|
|
73
|
+
)
|
|
74
|
+
]);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
export {
|
|
79
|
+
h as _
|
|
80
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as oe, inject as le, ref as m, computed as _, watch as E, nextTick as L, openBlock as d, createElementBlock as f, createVNode as P, unref as q, withCtx as Q, createElementVNode as I, Fragment as te, renderList as re, withKeys as R, withModifiers as C, normalizeClass as ie, toDisplayString as O, renderSlot as ce, createTextVNode as ue, createCommentVNode as U, createBlock as se } from "vue";
|
|
2
2
|
import { Q as D } from "./index-xuTVtF4x.mjs";
|
|
3
|
-
import { Q as j } from "./index-
|
|
3
|
+
import { Q as j } from "./index-Bs2OQHXk.mjs";
|
|
4
4
|
import { QyPopover as de } from "../qy-popover/index.mjs";
|
|
5
5
|
import { n as pe, Q as fe } from "./index-CaNxcPSD.mjs";
|
|
6
6
|
function ve(l, p) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("vue"),f=require("element-plus"),n=["success","warning","info","error"],a=["401","403","404","500"],m=t=>t==="class"||t==="style"||t==="id"||t==="role"||t==="title"||t.startsWith("data-")||t.startsWith("aria-"),o={status:{type:String,default:"info",validator:t=>[...n,...a].includes(t)},title:{type:String,default:""},description:{type:String,default:""},image:{type:String,default:""},imageAlt:{type:String,default:""}},v=i.defineComponent({name:"QyResult",inheritAttrs:!1,props:o,setup(t,{attrs:r,slots:e}){const u=i.computed(()=>Object.fromEntries(Object.entries(r).filter(([s])=>m(s)))),l=i.computed(()=>["qy-result",`qy-result--${t.status}`,u.value.class]),c=i.computed(()=>["qy-result__renderer",`qy-result--${t.status}`]),d=()=>{if(e.visual)return e.visual();if(t.image)return i.h("img",{class:"qy-result__image",src:t.image,alt:t.imageAlt});if(a.includes(t.status))return i.h("div",{class:"qy-result__http-visual","aria-hidden":"true"},t.status)};return()=>{const s={};return(e.visual||t.image||a.includes(t.status))&&(s.icon=d),e.title&&(s.title=e.title),e.description&&(s["sub-title"]=e.description),e.actions&&(s.extra=e.actions),i.h("div",{...u.value,class:l.value,title:t.title},[i.h(f.ElResult,{class:c.value,icon:n.includes(t.status)?t.status:void 0,title:e.title?"":t.title,subTitle:e.description?"":t.description},s)])}}});exports._sfc_main=v;
|