@qynpm/ui 1.0.43 → 1.0.45
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 +2 -0
- package/dist/index.cjs +12 -12
- package/dist/index.mjs +13 -13
- package/dist/qy-action-bar/index.cjs +1 -1
- package/dist/qy-action-bar/index.mjs +1 -1
- package/dist/qy-autocomplete/index.cjs +1 -1
- package/dist/qy-autocomplete/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-color-picker/index.cjs +1 -1
- package/dist/qy-color-picker/index.mjs +1 -1
- package/dist/qy-date-picker/index.cjs +1 -1
- package/dist/qy-date-picker/index.mjs +1 -1
- package/dist/qy-dialog/index.cjs +1 -1
- package/dist/qy-dialog/index.mjs +1 -1
- package/dist/qy-dropdown/index.cjs +2 -2
- package/dist/qy-dropdown/index.mjs +2 -2
- 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-image/index.cjs +1 -1
- package/dist/qy-image/index.mjs +1 -1
- package/dist/qy-image-preview/index.cjs +1 -1
- package/dist/qy-image-preview/index.mjs +2 -2
- package/dist/qy-image-upload/index.cjs +1 -1
- package/dist/qy-image-upload/index.mjs +1 -1
- package/dist/qy-input-tag/index.cjs +1 -1
- package/dist/qy-input-tag/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-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-pagination/index.cjs +1 -1
- package/dist/qy-pagination/index.mjs +1 -1
- package/dist/qy-popconfirm/index.cjs +1 -1
- package/dist/qy-popconfirm/index.mjs +1 -1
- package/dist/qy-popover/index.cjs +1 -1
- package/dist/qy-popover/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-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-tooltip/index.cjs +1 -1
- package/dist/qy-tooltip/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-BNssRW4d.mjs → index-9G8dxxVx.mjs} +13 -13
- package/dist/shared/{index-DRIoLeFE.mjs → index-B1gnVI8Y.mjs} +44 -45
- package/dist/shared/{index-CiE6qJCJ.mjs → index-BcDt1tKY.mjs} +151 -143
- package/dist/shared/index-BfA7ZJnJ.cjs +1 -0
- package/dist/shared/index-BfXhDFFn.cjs +1 -0
- package/dist/shared/index-Bfmf0msc.mjs +71 -0
- package/dist/shared/index-BhpomD_C.cjs +1 -0
- package/dist/shared/index-BvXyRAhX.cjs +1 -0
- package/dist/shared/index-Bz9WjKdL.cjs +1 -0
- package/dist/shared/{index-Co84fsS5.mjs → index-C5hzCMaD.mjs} +88 -80
- package/dist/shared/index-CPW3gKgP.mjs +2429 -0
- package/dist/shared/index-CUwUz-Le.cjs +1 -0
- package/dist/shared/index-CjImIyvI.mjs +124 -0
- package/dist/shared/{index-gMrQlV5n.cjs → index-CsfcDlq4.cjs} +1 -1
- package/dist/shared/{index-DAztNKSp.cjs → index-D359jZg_.cjs} +1 -1
- package/dist/shared/{index-DvFMgAcu.mjs → index-DEoy2IfN.mjs} +1 -1
- package/dist/shared/{index-BjqJCq-6.mjs → index-DM0zanTb.mjs} +3 -3
- package/dist/shared/index-DOpfxPDq.cjs +1 -0
- package/dist/shared/index-DPqFEuPp.mjs +798 -0
- package/dist/shared/index-DWBkjY5O.cjs +1 -0
- package/dist/shared/index-DaUdmOjn.cjs +1 -0
- package/dist/shared/index-MEzLM_rM.cjs +1 -0
- package/dist/shared/index-MyPNS-OR.cjs +1 -0
- package/dist/shared/{index-C4F8hXzQ.mjs → index-XSV-GmR2.mjs} +90 -81
- package/dist/shared/index-_e-HwHF0.mjs +79 -0
- package/dist/shared/{index-DXZ6Y6wd.mjs → index-uMEKxoXj.mjs} +1 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-B38X3tvf.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-BNKC9382.cjs +1 -0
- package/dist/shared/{index.vue_vue_type_script_setup_true_lang-DIWWHODS.mjs → index.vue_vue_type_script_setup_true_lang-BtMkNw_I.mjs} +49 -47
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-Byp7e--Y.mjs +63 -0
- package/dist/shared/{index.vue_vue_type_script_setup_true_lang-Dn29lZTs.mjs → index.vue_vue_type_script_setup_true_lang-Bypkl4Ty.mjs} +20 -18
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-CPm8gzId.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-CYaK3oDY.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-CeVvm5Ph.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-Cn0JqB5r.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DMHhx9lY.mjs +133 -0
- package/dist/shared/{index.vue_vue_type_script_setup_true_lang-DwFGEW4B.mjs → index.vue_vue_type_script_setup_true_lang-DkMm40Ac.mjs} +50 -42
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-qXBKqHCs.mjs +40 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-BI4abIsm.mjs +219 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-BNBJu1Mq.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-BZZ8vhEf.cjs +1 -0
- package/dist/shared/{index.vue_vue_type_style_index_0_lang-DSur831A.mjs → index.vue_vue_type_style_index_0_lang-Bpe6LkvL.mjs} +24 -18
- package/dist/shared/index.vue_vue_type_style_index_0_lang-CYIUfOy9.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-D2iiEHqM.mjs +413 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-Dt19xolk.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-DzvboHR2.mjs +176 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-E92uiH6Q.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-W44zpeKW.cjs +1 -0
- package/dist/shared/{index.vue_vue_type_style_index_0_lang-CcVf5MXE.mjs → index.vue_vue_type_style_index_0_lang-shJS7iXC.mjs} +59 -57
- package/dist/shared/index.vue_vue_type_style_index_0_lang-z2Unl0WQ.mjs +142 -0
- package/dist/shared/overlay-stack-CFFRngnU.mjs +34 -0
- package/dist/shared/overlay-stack-DeKq7jZu.cjs +1 -0
- package/dist/shared/{utils-DoyI5oM8.mjs → utils-CUXINmHY.mjs} +63 -49
- package/dist/shared/utils-DpkN3Zat.cjs +1 -0
- package/index.d.ts +44 -12
- package/package.json +2 -3
- package/qy-action-bar/index.d.ts +16 -4
- package/qy-autocomplete/index.d.ts +43 -2
- package/qy-checkbox/index.d.ts +1 -0
- package/qy-checkbox-group/index.d.ts +1 -0
- package/qy-date-picker/index.d.ts +1 -0
- package/qy-dialog/index.d.ts +4 -0
- package/qy-form-section/index.d.ts +22 -4
- package/qy-image/index.d.ts +1 -0
- package/qy-image-preview/index.d.ts +8 -4
- package/qy-menu-actions/index.d.ts +21 -2
- package/qy-money-input/index.d.ts +1 -0
- package/qy-pagination/index.d.ts +4 -0
- package/qy-popover/index.d.ts +4 -0
- package/qy-radio-group/index.d.ts +1 -0
- package/qy-record-quote-search/index.d.ts +53 -4
- package/qy-remark-image/index.d.ts +44 -4
- package/qy-remote-select/index.d.ts +53 -2
- package/qy-search-input/index.d.ts +66 -4
- package/qy-select/index.d.ts +4 -0
- package/qy-selection-dialog/index.d.ts +63 -2
- package/qy-switch/index.d.ts +1 -0
- package/qy-table-column-settings/index.d.ts +19 -2
- package/qy-tooltip/index.d.ts +5 -0
- package/qy-tree-select/index.d.ts +1 -0
- package/dist/shared/index-7MG12FbD.mjs +0 -2362
- package/dist/shared/index-BEcS8y8g.mjs +0 -68
- package/dist/shared/index-BSTMCPDj.mjs +0 -72
- package/dist/shared/index-BhvOSOfi.mjs +0 -766
- package/dist/shared/index-CGq7Q_hV.mjs +0 -119
- package/dist/shared/index-CVYNG8Fc.cjs +0 -1
- package/dist/shared/index-CbNd9JEx.cjs +0 -1
- package/dist/shared/index-CmgTSaFS.cjs +0 -1
- package/dist/shared/index-CnVhquq5.cjs +0 -1
- package/dist/shared/index-D27mwR57.cjs +0 -1
- package/dist/shared/index-DKw-seoh.cjs +0 -1
- package/dist/shared/index-DRugp8x0.cjs +0 -1
- package/dist/shared/index-DTbGlDqr.cjs +0 -1
- package/dist/shared/index-MyDDX-zj.cjs +0 -1
- package/dist/shared/index-d76Z3yrB.cjs +0 -1
- package/dist/shared/index-rSrDnOpu.cjs +0 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-BiIgNax-.cjs +0 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-CKp87br2.cjs +0 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-CqSJ_8hG.cjs +0 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DbLp1kvW.cjs +0 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-EiHoQBXt.mjs +0 -94
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-IyZesuKm.mjs +0 -48
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-UBQQ6Z03.cjs +0 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-ccFLNRry.cjs +0 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-r7iyZzDS.mjs +0 -61
- package/dist/shared/index.vue_vue_type_style_index_0_lang-1cTut9Ql.cjs +0 -1
- package/dist/shared/index.vue_vue_type_style_index_0_lang-B2thgQml.cjs +0 -1
- package/dist/shared/index.vue_vue_type_style_index_0_lang-BMZqMPZb.mjs +0 -215
- package/dist/shared/index.vue_vue_type_style_index_0_lang-Bb3L64L8.mjs +0 -406
- package/dist/shared/index.vue_vue_type_style_index_0_lang-BoaO6MKl.cjs +0 -1
- package/dist/shared/index.vue_vue_type_style_index_0_lang-C4Yk-UdJ.mjs +0 -172
- package/dist/shared/index.vue_vue_type_style_index_0_lang-D9-2GN18.cjs +0 -1
- package/dist/shared/index.vue_vue_type_style_index_0_lang-DHK86rdP.cjs +0 -1
- package/dist/shared/index.vue_vue_type_style_index_0_lang-DsOg_Rum.mjs +0 -128
- package/dist/shared/index.vue_vue_type_style_index_0_lang-RiwA2WPO.cjs +0 -1
- package/dist/shared/utils-BjEXwY3L.cjs +0 -1
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import { ElDialog as xe, ElIcon as be } from "element-plus/es";
|
|
2
|
+
import { defineComponent as ke, useSlots as _e, ref as r, computed as C, createVNode as z, watchEffect as Ce, watch as ie, h as se, nextTick as M, onMounted as ze, onUnmounted as Be, openBlock as a, createBlock as R, unref as B, withCtx as b, createElementVNode as l, normalizeClass as O, createSlots as Ee, normalizeStyle as Z, createElementBlock as u, createCommentVNode as y, renderSlot as E, toDisplayString as re, withModifiers as d, withDirectives as Se, vShow as Le } from "vue";
|
|
3
|
+
import qe from "clsx";
|
|
4
|
+
import { useZIndex as Me, ElButton as de, ElConfigProvider as Oe } from "element-plus";
|
|
5
|
+
import { r as V, a as Ie } from "./overlay-stack-CFFRngnU.mjs";
|
|
6
|
+
import { Close as $e } from "@element-plus/icons-vue";
|
|
7
|
+
import { useBreakpoints as Te, useDraggable as De } from "@vueuse/core";
|
|
8
|
+
const He = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]" }, Fe = { key: 0 }, Ne = { key: 1 }, je = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "icon-[material-symbols--square-outline-rounded]",
|
|
11
|
+
role: "img",
|
|
12
|
+
"aria-hidden": "true"
|
|
13
|
+
}, Ae = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "icon-[tdesign--fullscreen-exit-1]",
|
|
16
|
+
role: "img",
|
|
17
|
+
"aria-hidden": "true"
|
|
18
|
+
}, Re = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "fixed -right-12 top-2 h-9 w-9 hover:bg-gray-600/80 transition-all"
|
|
21
|
+
}, Ze = { class: "flex justify-between h-[var(--footer-height)] px-[var(--content-padding)] items-center" }, Ve = { class: "flex items-center justify-between w-full pl-1 pr-4 h-full ml-2" }, We = { class: "flex items-center gap-2" }, Pe = { class: "text-sm text-gray-700 truncate max-w-[200px]" }, Ue = { class: "flex items-center gap-2" }, ue = 5, to = /* @__PURE__ */ ke({
|
|
22
|
+
inheritAttrs: !1,
|
|
23
|
+
__name: "index",
|
|
24
|
+
props: {
|
|
25
|
+
open: { type: Boolean, default: !1 },
|
|
26
|
+
title: { default: "" },
|
|
27
|
+
width: { default: "50%" },
|
|
28
|
+
showFooter: { type: Boolean, default: !0 },
|
|
29
|
+
showConfirm: { type: Boolean, default: !0 },
|
|
30
|
+
showCancel: { type: Boolean, default: !0 },
|
|
31
|
+
confirmText: { default: "确 认" },
|
|
32
|
+
cancelText: { default: "取 消" },
|
|
33
|
+
confirmLoading: { type: Boolean, default: !1 },
|
|
34
|
+
confirmDisabled: { type: Boolean, default: !1 },
|
|
35
|
+
closeOnConfirm: { type: Boolean, default: !1 },
|
|
36
|
+
closeOnEscape: { type: Boolean, default: !0 },
|
|
37
|
+
closeOnOverlay: { type: Boolean, default: !0 },
|
|
38
|
+
minimizable: { type: Boolean, default: !0 },
|
|
39
|
+
destroyOnClose: { type: Boolean, default: !1 },
|
|
40
|
+
draggable: { type: Boolean, default: !0 },
|
|
41
|
+
lockScroll: { type: Boolean, default: !0 },
|
|
42
|
+
top: { default: "15vh" },
|
|
43
|
+
alignCenter: { type: Boolean, default: !0 },
|
|
44
|
+
appendToBody: { type: Boolean, default: !0 },
|
|
45
|
+
appendTo: { default: "body" },
|
|
46
|
+
fullscreen: { type: Boolean, default: !1 },
|
|
47
|
+
showFullscreen: { type: Boolean, default: !1 },
|
|
48
|
+
size: { default: "default" },
|
|
49
|
+
zIndex: { default: 2e3 }
|
|
50
|
+
},
|
|
51
|
+
emits: ["update:open", "open-change", "confirm", "cancel", "close", "opened", "closed"],
|
|
52
|
+
setup(ce, { expose: fe, emit: me }) {
|
|
53
|
+
let c = 0;
|
|
54
|
+
const o = ce, I = _e(), W = r(!0), $ = r(!1), { nextZIndex: T } = Me(), S = r(V(T(), o.zIndex)), P = r(null), pe = Te({
|
|
55
|
+
mobile: 0,
|
|
56
|
+
tablet: 640,
|
|
57
|
+
laptop: 1024,
|
|
58
|
+
desktop: 1280
|
|
59
|
+
}).isSmaller("tablet"), D = C(() => {
|
|
60
|
+
const e = [];
|
|
61
|
+
return o.showCancel && e.push("cancel"), o.showConfirm && e.push("confirm"), e;
|
|
62
|
+
}), U = C(() => ({
|
|
63
|
+
CancelButton: z(ee),
|
|
64
|
+
ConfirmButton: z(Q)
|
|
65
|
+
})), K = C(() => !!(I.footer || o.showFooter)), f = r(!1), h = r(!1);
|
|
66
|
+
let H = !1, w = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
67
|
+
const k = r(
|
|
68
|
+
o.showFullscreen && pe ? !0 : o.fullscreen
|
|
69
|
+
), i = me, X = C(() => o.open);
|
|
70
|
+
Ce(() => {
|
|
71
|
+
X.value && (f.value = !1);
|
|
72
|
+
}), ie(
|
|
73
|
+
() => o.open,
|
|
74
|
+
(e, t) => {
|
|
75
|
+
if (e) {
|
|
76
|
+
S.value = V(T(), o.zIndex), f.value = !1, h.value = !1, w = document.activeElement instanceof HTMLElement ? document.activeElement : w, t === !1 && i("open-change", !0);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
t && !f.value && (f.value = !0, i("open-change", !1), i("close", "external"));
|
|
80
|
+
}
|
|
81
|
+
), ie(
|
|
82
|
+
() => o.confirmLoading,
|
|
83
|
+
(e) => {
|
|
84
|
+
e ? H = !0 : H && (H = !1, h.value = !1);
|
|
85
|
+
}
|
|
86
|
+
), fe({
|
|
87
|
+
handleMinimize: A
|
|
88
|
+
});
|
|
89
|
+
const m = `qy-dialog-${Math.random().toString(36).slice(2, 11)}`, x = r(!1);
|
|
90
|
+
let _ = !1;
|
|
91
|
+
const L = r(null), { x: Y, y: F } = De(L, {
|
|
92
|
+
initialValue: {
|
|
93
|
+
x: 5,
|
|
94
|
+
y: window.innerHeight - 100 - c * 60
|
|
95
|
+
},
|
|
96
|
+
onMove(e) {
|
|
97
|
+
var t;
|
|
98
|
+
(t = L.value) == null || t.classList.add("dragging"), document.body.classList.add("qy-dialog--dragging"), Y.value = Math.max(
|
|
99
|
+
0,
|
|
100
|
+
Math.min(window.innerWidth - 300, e.x)
|
|
101
|
+
), F.value = Math.max(
|
|
102
|
+
0,
|
|
103
|
+
Math.min(window.innerHeight - 50, e.y)
|
|
104
|
+
);
|
|
105
|
+
},
|
|
106
|
+
onEnd() {
|
|
107
|
+
var e;
|
|
108
|
+
(e = L.value) == null || e.classList.remove("dragging"), document.body.classList.remove("qy-dialog--dragging");
|
|
109
|
+
}
|
|
110
|
+
}), ve = C(() => ({
|
|
111
|
+
transform: `translate(${Y.value}px, ${F.value}px)`,
|
|
112
|
+
willChange: "transform"
|
|
113
|
+
}));
|
|
114
|
+
function G(e) {
|
|
115
|
+
const t = e.target, { scrollTop: n, scrollHeight: s, clientHeight: v } = t;
|
|
116
|
+
W.value = n <= ue, $.value = s - (n + v) <= ue;
|
|
117
|
+
}
|
|
118
|
+
function ge() {
|
|
119
|
+
const e = document.querySelector(`.${m}.el-dialog`);
|
|
120
|
+
e && (P.value = e, e.addEventListener("scroll", G)), i("opened");
|
|
121
|
+
}
|
|
122
|
+
function J() {
|
|
123
|
+
k.value = !k.value, j();
|
|
124
|
+
}
|
|
125
|
+
function p(e) {
|
|
126
|
+
o.confirmLoading && e !== "external" || f.value || (f.value = !0, ae(), i("update:open", !1), i("open-change", !1), (e === "cancel" || e === "header") && i("cancel"), i("close", e), M(() => {
|
|
127
|
+
o.open && (f.value = !1);
|
|
128
|
+
}));
|
|
129
|
+
}
|
|
130
|
+
function ye() {
|
|
131
|
+
i("closed"), M(() => {
|
|
132
|
+
w != null && w.isConnected && w.focus();
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function he(e) {
|
|
136
|
+
o.showFullscreen && e.detail >= 2 && J();
|
|
137
|
+
}
|
|
138
|
+
function Q() {
|
|
139
|
+
return se(
|
|
140
|
+
de,
|
|
141
|
+
{
|
|
142
|
+
type: "primary",
|
|
143
|
+
class: "dialog__footerBtn",
|
|
144
|
+
loading: o.confirmLoading,
|
|
145
|
+
disabled: o.confirmDisabled || o.confirmLoading || h.value,
|
|
146
|
+
onClick: we
|
|
147
|
+
},
|
|
148
|
+
() => o.confirmText
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
function we() {
|
|
152
|
+
h.value || o.confirmLoading || o.confirmDisabled || (h.value = !0, i("confirm"), M(() => {
|
|
153
|
+
o.confirmLoading || (h.value = !1);
|
|
154
|
+
}), o.closeOnConfirm && p("confirm"));
|
|
155
|
+
}
|
|
156
|
+
function ee() {
|
|
157
|
+
return se(
|
|
158
|
+
de,
|
|
159
|
+
{ class: "dialog__footerBtn", onClick: () => p("cancel") },
|
|
160
|
+
() => o.cancelText
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
ze(() => {
|
|
164
|
+
j(), document.addEventListener("keydown", te, !0), document.addEventListener("keydown", le), document.addEventListener("mousedown", ne, !0);
|
|
165
|
+
});
|
|
166
|
+
function oe() {
|
|
167
|
+
var s, v;
|
|
168
|
+
const e = (s = document.querySelector(`.${m}`)) == null ? void 0 : s.closest(".el-overlay");
|
|
169
|
+
if (!e) return !1;
|
|
170
|
+
const n = Array.from(
|
|
171
|
+
document.querySelectorAll(".el-overlay, .el-image-viewer__wrapper")
|
|
172
|
+
).filter((g) => window.getComputedStyle(g).display !== "none").map((g, q) => ({
|
|
173
|
+
overlay: g,
|
|
174
|
+
order: q,
|
|
175
|
+
zIndex: Number.parseInt(
|
|
176
|
+
window.getComputedStyle(g).zIndex || "0",
|
|
177
|
+
10
|
|
178
|
+
)
|
|
179
|
+
}));
|
|
180
|
+
return n.sort(
|
|
181
|
+
(g, q) => g.zIndex - q.zIndex || g.order - q.order
|
|
182
|
+
), ((v = n.at(-1)) == null ? void 0 : v.overlay) === e;
|
|
183
|
+
}
|
|
184
|
+
const N = /* @__PURE__ */ new WeakSet();
|
|
185
|
+
function te(e) {
|
|
186
|
+
e.key !== "Escape" || Ie(e) || !o.open || !o.closeOnEscape || o.confirmLoading || !oe() || N.add(e);
|
|
187
|
+
}
|
|
188
|
+
function le(e) {
|
|
189
|
+
!N.has(e) || e.defaultPrevented || (N.delete(e), e.preventDefault(), p("escape"));
|
|
190
|
+
}
|
|
191
|
+
function ne(e) {
|
|
192
|
+
if (!o.open || !o.closeOnOverlay || o.confirmLoading || !oe() || !(e.target instanceof Node))
|
|
193
|
+
return;
|
|
194
|
+
const t = document.querySelector(`.${m}.el-dialog`), n = t == null ? void 0 : t.closest(".el-overlay");
|
|
195
|
+
!t || !n || !n.contains(e.target) || t.contains(e.target) || p("overlay");
|
|
196
|
+
}
|
|
197
|
+
function j() {
|
|
198
|
+
var s;
|
|
199
|
+
const e = (s = document.querySelector(`.${m}`)) == null ? void 0 : s.closest(".el-overlay"), t = document.querySelector(
|
|
200
|
+
`.${m}.el-dialog`
|
|
201
|
+
);
|
|
202
|
+
if (!e || !t) return;
|
|
203
|
+
const n = V(T(), o.zIndex);
|
|
204
|
+
M(() => {
|
|
205
|
+
e.style.zIndex = n.toString(), t.style.zIndex = n.toString(), S.value = n;
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
Be(() => {
|
|
209
|
+
var e;
|
|
210
|
+
document.removeEventListener("keydown", te, !0), document.removeEventListener("keydown", le), document.removeEventListener("mousedown", ne, !0), (e = P.value) == null || e.removeEventListener("scroll", G), ae();
|
|
211
|
+
});
|
|
212
|
+
function ae() {
|
|
213
|
+
if (!_) {
|
|
214
|
+
x.value = !1;
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
_ = !1, c = Math.max(0, c - 1), x.value = !1;
|
|
218
|
+
}
|
|
219
|
+
function A() {
|
|
220
|
+
var t;
|
|
221
|
+
const e = (t = document.querySelector(`.${m}`)) == null ? void 0 : t.closest(".el-overlay");
|
|
222
|
+
!e || !o.open || (x.value ? (x.value = !1, e.style.display = "block", _ && (_ = !1, c = Math.max(0, c - 1)), j()) : (x.value = !0, e.style.display = "none", _ = !0, c += 1, F.value = window.innerHeight - 50 - c * 60));
|
|
223
|
+
}
|
|
224
|
+
return (e, t) => {
|
|
225
|
+
const n = be, s = xe;
|
|
226
|
+
return a(), R(B(Oe), { "z-index": S.value }, {
|
|
227
|
+
default: b(() => [
|
|
228
|
+
l("div", null, [
|
|
229
|
+
z(s, {
|
|
230
|
+
ref: "dialogRef",
|
|
231
|
+
class: O(["qy-dialog", [
|
|
232
|
+
o.size === "small" && "[&_.el-dialog__header]:!hidden",
|
|
233
|
+
m
|
|
234
|
+
]]),
|
|
235
|
+
"model-value": X.value,
|
|
236
|
+
title: o.title,
|
|
237
|
+
width: o.width,
|
|
238
|
+
top: o.top,
|
|
239
|
+
"align-center": o.alignCenter,
|
|
240
|
+
"append-to-body": o.appendToBody,
|
|
241
|
+
"append-to": o.appendTo,
|
|
242
|
+
"destroy-on-close": o.destroyOnClose,
|
|
243
|
+
"lock-scroll": o.lockScroll,
|
|
244
|
+
style: {
|
|
245
|
+
"--el-dialog-padding-primary": 0
|
|
246
|
+
},
|
|
247
|
+
"show-close": !1,
|
|
248
|
+
"close-on-press-escape": !1,
|
|
249
|
+
"close-on-click-modal": !1,
|
|
250
|
+
fullscreen: k.value,
|
|
251
|
+
"z-index": S.value,
|
|
252
|
+
onClosed: ye,
|
|
253
|
+
onOpened: ge,
|
|
254
|
+
draggable: o.draggable
|
|
255
|
+
}, Ee({
|
|
256
|
+
header: b(() => [
|
|
257
|
+
o.size === "default" ? (a(), u("div", {
|
|
258
|
+
key: 0,
|
|
259
|
+
style: Z({
|
|
260
|
+
borderBottom: "1px solid",
|
|
261
|
+
borderColor: W.value ? "transparent" : "var(--block-outline-color)",
|
|
262
|
+
transition: "border-color .2s linear"
|
|
263
|
+
}),
|
|
264
|
+
class: "flex justify-between h-[var(--header-height)]",
|
|
265
|
+
onDblclick: he
|
|
266
|
+
}, [
|
|
267
|
+
l("div", He, [
|
|
268
|
+
B(I).header ? B(I).header ? (a(), u("div", Ne, [
|
|
269
|
+
E(e.$slots, "header")
|
|
270
|
+
])) : y("", !0) : (a(), u("span", Fe, re(o.title), 1))
|
|
271
|
+
]),
|
|
272
|
+
l("div", {
|
|
273
|
+
class: "flex",
|
|
274
|
+
onMousedown: t[4] || (t[4] = d(() => {
|
|
275
|
+
}, ["stop"]))
|
|
276
|
+
}, [
|
|
277
|
+
o.size === "default" && o.minimizable ? (a(), u("div", {
|
|
278
|
+
key: 0,
|
|
279
|
+
class: "qy-dialog__btn qy-dialog__btn--default",
|
|
280
|
+
onClick: d(A, ["stop"]),
|
|
281
|
+
onMousedown: t[0] || (t[0] = d(() => {
|
|
282
|
+
}, ["stop"]))
|
|
283
|
+
}, [...t[7] || (t[7] = [
|
|
284
|
+
l("span", {
|
|
285
|
+
class: "icon-[material-symbols--minimize] text-xl mb-3",
|
|
286
|
+
role: "img",
|
|
287
|
+
"aria-hidden": "true"
|
|
288
|
+
}, null, -1)
|
|
289
|
+
])], 32)) : y("", !0),
|
|
290
|
+
o.showFullscreen ? (a(), u("div", {
|
|
291
|
+
key: 1,
|
|
292
|
+
class: "qy-dialog__btn qy-dialog__btn--default",
|
|
293
|
+
onClick: d(J, ["stop"]),
|
|
294
|
+
onMousedown: t[1] || (t[1] = d(() => {
|
|
295
|
+
}, ["stop"]))
|
|
296
|
+
}, [
|
|
297
|
+
k.value ? (a(), u("span", Ae)) : (a(), u("span", je))
|
|
298
|
+
], 32)) : y("", !0),
|
|
299
|
+
l("div", {
|
|
300
|
+
class: "qy-dialog__btn qy-dialog__btn--danger",
|
|
301
|
+
onClick: t[2] || (t[2] = d((v) => p("header"), ["stop"])),
|
|
302
|
+
onMousedown: t[3] || (t[3] = d(() => {
|
|
303
|
+
}, ["stop"]))
|
|
304
|
+
}, [...t[8] || (t[8] = [
|
|
305
|
+
l("span", {
|
|
306
|
+
class: "icon-[ri--close-line] text-xl",
|
|
307
|
+
role: "img",
|
|
308
|
+
"aria-hidden": "true"
|
|
309
|
+
}, null, -1)
|
|
310
|
+
])], 32)
|
|
311
|
+
], 32)
|
|
312
|
+
], 36)) : y("", !0)
|
|
313
|
+
]),
|
|
314
|
+
default: b(() => [
|
|
315
|
+
l("div", {
|
|
316
|
+
class: O(["qy-dialog__wrapper", B(qe)(k.value && "qy-dialog__wrapper--fullscreen")]),
|
|
317
|
+
style: Z({
|
|
318
|
+
maxHeight: K.value ? "calc(100vh - var(--header-height) - var(--footer-height) - var(--sides-gap))" : "calc(100vh - var(--header-height) - var(--sides-gap))",
|
|
319
|
+
padding: o.size === "small" ? "var(--small-content-padding)" : "var(--content-padding)"
|
|
320
|
+
})
|
|
321
|
+
}, [
|
|
322
|
+
o.size === "small" ? (a(), u("div", Re, [
|
|
323
|
+
z(n, {
|
|
324
|
+
size: 36,
|
|
325
|
+
class: "cursor-pointer text-gray-100 active:scale-75 rounded-sm transition-all",
|
|
326
|
+
onClick: t[5] || (t[5] = (v) => p("header"))
|
|
327
|
+
}, {
|
|
328
|
+
default: b(() => [
|
|
329
|
+
z(B($e))
|
|
330
|
+
]),
|
|
331
|
+
_: 1
|
|
332
|
+
})
|
|
333
|
+
])) : y("", !0),
|
|
334
|
+
E(e.$slots, "default")
|
|
335
|
+
], 6)
|
|
336
|
+
]),
|
|
337
|
+
_: 2
|
|
338
|
+
}, [
|
|
339
|
+
o.showFooter && !e.$slots.footer && Array.isArray(D.value) ? {
|
|
340
|
+
name: "footer",
|
|
341
|
+
fn: b(() => [
|
|
342
|
+
l("div", Ze, [
|
|
343
|
+
l("div", null, [
|
|
344
|
+
E(e.$slots, "footer-left")
|
|
345
|
+
]),
|
|
346
|
+
l("div", {
|
|
347
|
+
class: O([{
|
|
348
|
+
"qy-dialog__footer--outline": $.value
|
|
349
|
+
}, "qy-dialog__footer flex items-center justify-end"])
|
|
350
|
+
}, [
|
|
351
|
+
D.value.includes("cancel") ? (a(), R(ee, { key: 0 })) : y("", !0),
|
|
352
|
+
D.value.includes("confirm") ? (a(), R(Q, { key: 1 })) : y("", !0),
|
|
353
|
+
E(e.$slots, "footer-append")
|
|
354
|
+
], 2)
|
|
355
|
+
])
|
|
356
|
+
]),
|
|
357
|
+
key: "0"
|
|
358
|
+
} : K.value ? {
|
|
359
|
+
name: "footer",
|
|
360
|
+
fn: b(() => [
|
|
361
|
+
l("div", {
|
|
362
|
+
class: O([{
|
|
363
|
+
"qy-dialog__footer--outline": $.value
|
|
364
|
+
}, "qy-dialog__footer px-[var(--content-padding)] min-h-[var(--footer-height)] flex items-center justify-end"])
|
|
365
|
+
}, [
|
|
366
|
+
E(e.$slots, "footer", {
|
|
367
|
+
layouts: U.value,
|
|
368
|
+
layoutsNode: Object.values(U.value)
|
|
369
|
+
})
|
|
370
|
+
], 2)
|
|
371
|
+
]),
|
|
372
|
+
key: "1"
|
|
373
|
+
} : void 0
|
|
374
|
+
]), 1032, ["class", "model-value", "title", "width", "top", "align-center", "append-to-body", "append-to", "destroy-on-close", "lock-scroll", "fullscreen", "z-index", "draggable"]),
|
|
375
|
+
Se(l("div", {
|
|
376
|
+
ref_key: "minimizedRef",
|
|
377
|
+
ref: L,
|
|
378
|
+
class: "fixed left-0 top-0 bg-white rounded shadow-lg cursor-pointer z-[9999] hover:bg-gray-50",
|
|
379
|
+
style: Z([ve.value, { width: "300px", height: "50px", "will-change": "transform" }])
|
|
380
|
+
}, [
|
|
381
|
+
l("div", Ve, [
|
|
382
|
+
l("div", We, [
|
|
383
|
+
t[9] || (t[9] = l("div", { class: "icon-[mdi--window-restore] text-gray-600" }, null, -1)),
|
|
384
|
+
l("span", Pe, re(o.title), 1)
|
|
385
|
+
]),
|
|
386
|
+
l("div", Ue, [
|
|
387
|
+
l("div", {
|
|
388
|
+
class: "p-1 hover:bg-gray-200 rounded",
|
|
389
|
+
onClick: d(A, ["stop"])
|
|
390
|
+
}, [...t[10] || (t[10] = [
|
|
391
|
+
l("div", { class: "icon-[mdi--window-maximize] text-gray-600" }, null, -1)
|
|
392
|
+
])]),
|
|
393
|
+
l("div", {
|
|
394
|
+
class: "p-1 hover:bg-red-100 rounded",
|
|
395
|
+
onClick: t[6] || (t[6] = d((v) => p("header"), ["stop"]))
|
|
396
|
+
}, [...t[11] || (t[11] = [
|
|
397
|
+
l("div", { class: "icon-[mdi--close] text-red-600" }, null, -1)
|
|
398
|
+
])])
|
|
399
|
+
])
|
|
400
|
+
])
|
|
401
|
+
], 4), [
|
|
402
|
+
[Le, x.value]
|
|
403
|
+
])
|
|
404
|
+
])
|
|
405
|
+
]),
|
|
406
|
+
_: 3
|
|
407
|
+
}, 8, ["z-index"]);
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
export {
|
|
412
|
+
to as _
|
|
413
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("vue"),T=require("@element-plus/icons-vue"),B=require("element-plus"),M=require("./overlay-stack-DeKq7jZu.cjs"),f=[],oe={class:"qy-popconfirm__message"},ie={key:0,class:"qy-popconfirm__icon","aria-hidden":"true"},re={"data-testid":"qy-popconfirm-title",class:"qy-popconfirm__title"},ae={class:"qy-popconfirm__actions"},le=t.defineComponent({name:"QyPopconfirm",inheritAttrs:!1,__name:"index",props:{title:{type:String,required:!0},open:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},placement:{type:String,default:"bottom"},width:{type:[Number,String],default:220},confirmText:{type:String,default:"确认"},cancelText:{type:String,default:"取消"},variant:{type:String,default:"warning"},confirmType:{type:String,default:"primary"},showIcon:{type:Boolean,default:!0},confirmLoading:{type:Boolean,default:!1},closeOnConfirm:{type:Boolean,default:!0}},emits:["update:open","open-change","confirm","cancel","close"],setup(i,{emit:H}){const o=i,c=H,K=t.useAttrs(),y=t.ref(null),L=t.ref(null),V=t.computed(()=>o.open!==void 0),C=o.open===!0&&!o.disabled,q=t.ref(C),s=t.ref(C),a=t.ref(C),r=t.ref(null),p=t.ref(!1),g=t.ref(null),w={},x=`qy-popconfirm-${t.getCurrentInstance().uid}`,S=new WeakSet;let d=!1,m,h,E=!1,b=null;const D=t.computed(()=>o.disabled?!1:V.value?o.open===!0:q.value),Q=t.computed(()=>{const e={};for(const[n,v]of Object.entries(K))(n==="class"||n==="style"||n==="id"||n==="title"||n==="tabindex"||n==="role"||n.startsWith("data-")||n.startsWith("aria-")||/^onKey(?:down|up|press)/i.test(n))&&(e[n]=v);return e}),U=t.computed(()=>typeof o.width=="number"?`${o.width}px`:o.width),j=t.computed(()=>({"--qy-popconfirm-width":U.value,"--qy-popconfirm-mobile-gutter":"24px"})),G=t.computed(()=>o.variant==="danger"?T.CircleCloseFilled:o.variant==="info"?T.InfoFilled:T.WarningFilled);function N(){return f[f.length-1]===w}function P(){f.includes(w)||f.push(w)}function A(){const e=f.indexOf(w);e>=0&&f.splice(e,1)}function I(e){var O,z;const n=document.activeElement;if(n instanceof HTMLElement&&((O=y.value)!=null&&O.contains(n))){g.value=n;return}const v=e==null?void 0:e.target;v instanceof HTMLElement&&((z=L.value)!=null&&z.contains(v))&&(g.value=v)}function J(){const e=g.value;g.value=null,e!=null&&e.isConnected&&e.focus()}function u(){if(d)return;const e=D.value;s.value!==e&&(d=!0,m=e,h=e?void 0:r.value??(o.disabled?"disabled":"external"),s.value=e)}function l(e,n){e&&o.disabled||(!e&&n&&r.value===null&&(r.value=n),V.value?o.open!==e&&c("update:open",e):q.value!==e&&(q.value=e,c("update:open",e)),u())}function X(){var e;return r.value?r.value:b instanceof Node&&((e=y.value)!=null&&e.contains(b))?"trigger":"outside"}function Y(e){if(e){I(),l(!0);return}if(o.confirmLoading)return;const n=X();!N()&&n!=="external"&&n!=="disabled"||l(!1,n)}function Z(e){var n;!(e.target instanceof Node)||!((n=L.value)!=null&&n.contains(e.target))||o.confirmLoading||(a.value||s.value?(r.value="trigger",l(!1,"trigger")):(I(e),l(!0)))}function _(){o.disabled||o.confirmLoading||p.value||(p.value=!0,c("confirm"),o.closeOnConfirm&&l(!1,"confirm"))}function ee(){o.disabled||o.confirmLoading||(c("cancel"),l(!1,"cancel"))}function R(e){e.key!=="Escape"&&e.code!=="Escape"||e.defaultPrevented||!a.value||!N()||M.isTopmostVisibleLayer(document.querySelector(`.${x}`))&&(M.claimOverlayEscape(e),S.add(e))}function k(e){S.has(e)&&(S.delete(e),e.stopPropagation(),!e.defaultPrevented&&(e.preventDefault(),e.stopImmediatePropagation(),!o.confirmLoading&&l(!1,"escape")))}function $(e){b=e.target}function F(e){b=e.target}function W(e){var n;o.confirmLoading||!a.value||!N()||e.target instanceof Node&&((n=y.value)!=null&&n.contains(e.target)||e.target instanceof Element&&e.target.closest(".qy-popconfirm-popper")||l(!1,"outside"))}function te(){!d||m!==!0||(d=!1,m=void 0,a.value=!0,P(),r.value=null,h=void 0,c("open-change",!0),u())}function ne(){!d||m!==!1||(d=!1,m=void 0,a.value=!1,A(),c("open-change",!1),c("close",h??r.value??"external"),r.value=null,h=void 0,p.value=!1,E=!1,J(),u())}return t.watch(D,()=>u()),t.watch(()=>o.open,(e,n)=>{e!==n&&(e===!1&&(a.value||s.value)&&r.value===null&&(r.value="external"),u())}),t.watch(()=>o.disabled,e=>{e&&(a.value||s.value)&&(r.value="disabled"),u()}),t.watch(()=>o.confirmLoading,e=>{e?E=!0:E&&(E=!1,a.value&&(p.value=!1))}),t.onMounted(()=>{a.value&&P(),window.addEventListener("keydown",R,!0),document.body.addEventListener("keydown",k),window.addEventListener("keydown",k),document.addEventListener("pointerdown",$,!0),document.addEventListener("mousedown",F,!0),document.addEventListener("click",W)}),t.onBeforeUnmount(()=>{A(),window.removeEventListener("keydown",R,!0),document.body.removeEventListener("keydown",k),window.removeEventListener("keydown",k),document.removeEventListener("pointerdown",$,!0),document.removeEventListener("mousedown",F,!0),document.removeEventListener("click",W)}),(e,n)=>(t.openBlock(),t.createElementBlock("span",t.mergeProps({ref_key:"rootRef",ref:y,class:"qy-popconfirm"},Q.value,{onClickCapture:Z}),[t.createVNode(t.unref(B.ElPopover),{visible:s.value,trigger:"click",placement:i.placement,width:i.width,disabled:i.disabled,"popper-style":j.value,"popper-class":`qy-popconfirm-popper ${x}`,"onUpdate:visible":Y,onAfterEnter:te,onAfterLeave:ne},{reference:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"referenceRef",ref:L,"data-qy-popconfirm-reference":""},[t.renderSlot(e.$slots,"reference")],512)]),default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["qy-popconfirm__content",`is-${i.variant}`]),"data-qy-popconfirm-content":""},[t.createElementVNode("div",oe,[i.showIcon?(t.openBlock(),t.createElementBlock("span",ie,[t.renderSlot(e.$slots,"icon",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(G.value)))])])):t.createCommentVNode("",!0),t.createElementVNode("span",re,[t.renderSlot(e.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(i.title),1)])])]),t.createElementVNode("div",ae,[t.createVNode(t.unref(B.ElButton),{"data-testid":"qy-popconfirm-cancel",size:"small",disabled:i.disabled||i.confirmLoading,onClick:ee},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(i.cancelText),1)]),_:1},8,["disabled"]),t.createVNode(t.unref(B.ElButton),{"data-testid":"qy-popconfirm-confirm",size:"small",type:i.confirmType,loading:i.confirmLoading,disabled:i.disabled||i.confirmLoading||p.value,onClick:_},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(i.confirmText),1)]),_:1},8,["type","loading","disabled"])])],2)]),_:3},8,["visible","placement","width","disabled","popper-style","popper-class"])],16))}});exports._sfc_main=le;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { defineComponent as Z, watch as K, useAttrs as ee, ref as o, computed as v, nextTick as N, onBeforeUnmount as ae, openBlock as le, createElementBlock as ne, createElementVNode as y, mergeProps as te, withKeys as w, withModifiers as C, unref as V, normalizeStyle as re, normalizeClass as oe, toDisplayString as ue, createVNode as ie } from "vue";
|
|
2
|
+
import { useFormDisabled as se, ElColorPicker as ce } from "element-plus";
|
|
3
|
+
const de = ["id", "role", "aria-disabled", "tabindex", "disabled", "onKeydown"], ve = {
|
|
4
|
+
class: "qy-color-picker__value",
|
|
5
|
+
"aria-hidden": "true"
|
|
6
|
+
};
|
|
7
|
+
let fe = 0;
|
|
8
|
+
const pe = () => `qy-color-picker-${++fe}`, ge = /* @__PURE__ */ Z({
|
|
9
|
+
name: "QyColorPicker",
|
|
10
|
+
inheritAttrs: !1,
|
|
11
|
+
__name: "index",
|
|
12
|
+
props: {
|
|
13
|
+
modelValue: { default: null },
|
|
14
|
+
format: { default: void 0 },
|
|
15
|
+
showAlpha: { type: Boolean, default: !1 },
|
|
16
|
+
predefine: { default: void 0 },
|
|
17
|
+
size: { default: "default" },
|
|
18
|
+
disabled: { type: Boolean, default: void 0 },
|
|
19
|
+
clearable: { type: Boolean, default: !1 }
|
|
20
|
+
},
|
|
21
|
+
emits: ["update:modelValue", "active-change", "change", "visible-change"],
|
|
22
|
+
setup(S, { emit: F }) {
|
|
23
|
+
const t = S, u = F, i = se();
|
|
24
|
+
K(i, (e) => {
|
|
25
|
+
e && l.value && p();
|
|
26
|
+
});
|
|
27
|
+
const f = ee(), E = o(null), x = o(null), h = o(null), n = o(s(t.modelValue)), b = o(n.value), l = o(!1), r = o(null), c = o(!1), m = o(!1), A = pe(), O = v(() => typeof f.id == "string" && f.id || A), D = `qy-color-picker__popper--${A}`, Q = v(
|
|
28
|
+
() => t.format || (t.showAlpha ? "rgb" : "hex")
|
|
29
|
+
), g = v(() => s(t.modelValue)), T = v(() => String(f.role || "button")), U = v(
|
|
30
|
+
() => f["aria-disabled"] ?? (i.value ? "true" : "false")
|
|
31
|
+
), $ = v(
|
|
32
|
+
() => i.value ? void 0 : f.tabindex ?? 0
|
|
33
|
+
), W = v(() => {
|
|
34
|
+
const e = {};
|
|
35
|
+
for (const [a, d] of Object.entries(f)) {
|
|
36
|
+
const _ = a.toLowerCase();
|
|
37
|
+
(a === "class" || a === "style" || a === "id" || a === "title" || a === "tabindex" || a === "role" || _.startsWith("data-") || _.startsWith("aria-") || ["onkeydown", "onkeyup", "onkeypress"].includes(_)) && (e[a] = d);
|
|
38
|
+
}
|
|
39
|
+
return e;
|
|
40
|
+
});
|
|
41
|
+
K(
|
|
42
|
+
() => t.modelValue,
|
|
43
|
+
(e) => {
|
|
44
|
+
n.value = s(e), l.value && (b.value = n.value);
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
function s(e) {
|
|
48
|
+
return e == null || e === "" ? null : String(e);
|
|
49
|
+
}
|
|
50
|
+
function j() {
|
|
51
|
+
if (!i.value) {
|
|
52
|
+
if (l.value) {
|
|
53
|
+
p();
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
P();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function R() {
|
|
60
|
+
i.value || l.value || P();
|
|
61
|
+
}
|
|
62
|
+
function M() {
|
|
63
|
+
l.value && p();
|
|
64
|
+
}
|
|
65
|
+
function P() {
|
|
66
|
+
l.value || i.value || (b.value = s(t.modelValue), n.value = b.value, r.value = null, c.value = !1, m.value = !1, l.value = !0, Y(), u("visible-change", !0), N(() => {
|
|
67
|
+
var e, a;
|
|
68
|
+
return (a = (e = h.value) == null ? void 0 : e.show) == null ? void 0 : a.call(e);
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
function G(e) {
|
|
72
|
+
!l.value || r.value || (n.value = s(e), u("active-change", n.value));
|
|
73
|
+
}
|
|
74
|
+
function H(e) {
|
|
75
|
+
!l.value || r.value === "cancel" || (n.value = s(e), c.value || (c.value = !0, r.value = "commit", u("update:modelValue", n.value)));
|
|
76
|
+
}
|
|
77
|
+
function J(e) {
|
|
78
|
+
!l.value || r.value === "cancel" || (n.value = s(e), c.value || (c.value = !0, r.value = "commit", u("update:modelValue", n.value)), m.value || (m.value = !0, u("change", n.value)), k());
|
|
79
|
+
}
|
|
80
|
+
function X() {
|
|
81
|
+
!l.value || r.value === "cancel" || (c.value || (c.value = !0, r.value = "commit", n.value = null, u("update:modelValue", null)), m.value || (m.value = !0, u("change", null)), k());
|
|
82
|
+
}
|
|
83
|
+
function p() {
|
|
84
|
+
var e, a;
|
|
85
|
+
!l.value || r.value || (r.value = "cancel", n.value = s(t.modelValue), (a = (e = h.value) == null ? void 0 : e.hide) == null || a.call(e), k());
|
|
86
|
+
}
|
|
87
|
+
function k() {
|
|
88
|
+
var e, a;
|
|
89
|
+
l.value && (l.value = !1, I(), (a = (e = h.value) == null ? void 0 : e.hide) == null || a.call(e), u("visible-change", !1), N(() => {
|
|
90
|
+
var d;
|
|
91
|
+
return (d = x.value) == null ? void 0 : d.focus();
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
function q(e) {
|
|
95
|
+
var a, d;
|
|
96
|
+
return e instanceof Node ? (a = E.value) != null && a.contains(e) ? !0 : !!((d = e.closest) != null && d.call(e, `.${D}`)) : !1;
|
|
97
|
+
}
|
|
98
|
+
function L(e) {
|
|
99
|
+
l.value && !q(e.target) && p();
|
|
100
|
+
}
|
|
101
|
+
function z(e) {
|
|
102
|
+
l.value && !q(e.target) && p();
|
|
103
|
+
}
|
|
104
|
+
function B(e) {
|
|
105
|
+
l.value && e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), p());
|
|
106
|
+
}
|
|
107
|
+
function Y() {
|
|
108
|
+
document.addEventListener("pointerdown", L, !0), document.addEventListener("focusin", z, !0), document.addEventListener("keydown", B, !0);
|
|
109
|
+
}
|
|
110
|
+
function I() {
|
|
111
|
+
document.removeEventListener("pointerdown", L, !0), document.removeEventListener("focusin", z, !0), document.removeEventListener("keydown", B, !0);
|
|
112
|
+
}
|
|
113
|
+
return ae(() => {
|
|
114
|
+
I();
|
|
115
|
+
}), (e, a) => (le(), ne("div", {
|
|
116
|
+
ref_key: "rootRef",
|
|
117
|
+
ref: E,
|
|
118
|
+
class: "qy-color-picker",
|
|
119
|
+
"data-qy-color-picker": ""
|
|
120
|
+
}, [
|
|
121
|
+
y("button", te({
|
|
122
|
+
ref_key: "triggerRef",
|
|
123
|
+
ref: x,
|
|
124
|
+
type: "button",
|
|
125
|
+
class: "qy-color-picker__trigger"
|
|
126
|
+
}, W.value, {
|
|
127
|
+
id: O.value,
|
|
128
|
+
role: T.value,
|
|
129
|
+
"aria-disabled": U.value,
|
|
130
|
+
tabindex: $.value,
|
|
131
|
+
disabled: V(i),
|
|
132
|
+
class: { "is-disabled": V(i), "is-open": l.value },
|
|
133
|
+
onClick: j,
|
|
134
|
+
onKeydown: [
|
|
135
|
+
w(C(R, ["prevent"]), ["enter"]),
|
|
136
|
+
w(C(R, ["prevent"]), ["space"]),
|
|
137
|
+
w(C(M, ["prevent"]), ["esc"])
|
|
138
|
+
]
|
|
139
|
+
}), [
|
|
140
|
+
y("span", {
|
|
141
|
+
class: oe(["qy-color-picker__swatch", { "is-empty": !g.value }]),
|
|
142
|
+
style: re(g.value ? { backgroundColor: g.value } : void 0),
|
|
143
|
+
"aria-hidden": "true"
|
|
144
|
+
}, null, 6),
|
|
145
|
+
y("span", ve, ue(g.value || "选择颜色"), 1),
|
|
146
|
+
a[0] || (a[0] = y("span", {
|
|
147
|
+
class: "qy-color-picker__arrow",
|
|
148
|
+
"aria-hidden": "true"
|
|
149
|
+
}, "⌄", -1))
|
|
150
|
+
], 16, de),
|
|
151
|
+
ie(V(ce), {
|
|
152
|
+
ref_key: "rendererRef",
|
|
153
|
+
ref: h,
|
|
154
|
+
class: "qy-color-picker__renderer",
|
|
155
|
+
"model-value": n.value,
|
|
156
|
+
"show-alpha": t.showAlpha,
|
|
157
|
+
"color-format": Q.value,
|
|
158
|
+
predefine: t.predefine,
|
|
159
|
+
size: t.size,
|
|
160
|
+
disabled: !1,
|
|
161
|
+
clearable: t.clearable,
|
|
162
|
+
teleported: !0,
|
|
163
|
+
tabindex: -1,
|
|
164
|
+
"popper-class": D,
|
|
165
|
+
"aria-hidden": "true",
|
|
166
|
+
onActiveChange: G,
|
|
167
|
+
"onUpdate:modelValue": H,
|
|
168
|
+
onChange: J,
|
|
169
|
+
onClear: X
|
|
170
|
+
}, null, 8, ["model-value", "show-alpha", "color-format", "predefine", "size", "clearable"])
|
|
171
|
+
], 512));
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
export {
|
|
175
|
+
ge as _
|
|
176
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const U=require("element-plus"),e=require("vue"),ae=require("clsx"),k=require("element-plus"),E=require("./overlay-stack-DeKq7jZu.cjs"),re=require("@element-plus/icons-vue"),K=require("@vueuse/core"),ie={class:"text-lg flex items-center pt-2 pl-[var(--content-padding)]"},se={key:0},de={key:1},ce={key:0,class:"icon-[material-symbols--square-outline-rounded]",role:"img","aria-hidden":"true"},ue={key:1,class:"icon-[tdesign--fullscreen-exit-1]",role:"img","aria-hidden":"true"},fe={key:0,class:"fixed -right-12 top-2 h-9 w-9 hover:bg-gray-600/80 transition-all"},me={class:"flex justify-between h-[var(--footer-height)] px-[var(--content-padding)] items-center"},pe={class:"flex items-center justify-between w-full pl-1 pr-4 h-full ml-2"},ve={class:"flex items-center gap-2"},ye={class:"text-sm text-gray-700 truncate max-w-[200px]"},ge={class:"flex items-center gap-2"},X=5,he=e.defineComponent({inheritAttrs:!1,__name:"index",props:{open:{type:Boolean,default:!1},title:{default:""},width:{default:"50%"},showFooter:{type:Boolean,default:!0},showConfirm:{type:Boolean,default:!0},showCancel:{type:Boolean,default:!0},confirmText:{default:"确 认"},cancelText:{default:"取 消"},confirmLoading:{type:Boolean,default:!1},confirmDisabled:{type:Boolean,default:!1},closeOnConfirm:{type:Boolean,default:!1},closeOnEscape:{type:Boolean,default:!0},closeOnOverlay:{type:Boolean,default:!0},minimizable:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!1},draggable:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},top:{default:"15vh"},alignCenter:{type:Boolean,default:!0},appendToBody:{type:Boolean,default:!0},appendTo:{default:"body"},fullscreen:{type:Boolean,default:!1},showFullscreen:{type:Boolean,default:!1},size:{default:"default"},zIndex:{default:2e3}},emits:["update:open","open-change","confirm","cancel","close","opened","closed"],setup(Y,{expose:G,emit:J}){let i=0;const o=Y,C=e.useSlots(),M=e.ref(!0),B=e.ref(!1),{nextZIndex:b}=k.useZIndex(),h=e.ref(E.resolveOverlayZIndex(b(),o.zIndex)),L=e.ref(null),Q=K.useBreakpoints({mobile:0,tablet:640,laptop:1024,desktop:1280}).isSmaller("tablet"),z=e.computed(()=>{const t=[];return o.showCancel&&t.push("cancel"),o.showConfirm&&t.push("confirm"),t}),O=e.computed(()=>({CancelButton:e.createVNode(Z),ConfirmButton:e.createVNode(F)})),I=e.computed(()=>!!(C.footer||o.showFooter)),s=e.ref(!1),m=e.ref(!1);let _=!1,p=document.activeElement instanceof HTMLElement?document.activeElement:null;const y=e.ref(o.showFullscreen&&Q?!0:o.fullscreen),a=J,T=e.computed(()=>o.open);e.watchEffect(()=>{T.value&&(s.value=!1)}),e.watch(()=>o.open,(t,l)=>{if(t){h.value=E.resolveOverlayZIndex(b(),o.zIndex),s.value=!1,m.value=!1,p=document.activeElement instanceof HTMLElement?document.activeElement:p,l===!1&&a("open-change",!0);return}l&&!s.value&&(s.value=!0,a("open-change",!1),a("close","external"))}),e.watch(()=>o.confirmLoading,t=>{t?_=!0:_&&(_=!1,m.value=!1)}),G({handleMinimize:q});const d=`qy-dialog-${Math.random().toString(36).slice(2,11)}`,v=e.ref(!1);let g=!1;const w=e.ref(null),{x:$,y:N}=K.useDraggable(w,{initialValue:{x:5,y:window.innerHeight-100-i*60},onMove(t){var l;(l=w.value)==null||l.classList.add("dragging"),document.body.classList.add("qy-dialog--dragging"),$.value=Math.max(0,Math.min(window.innerWidth-300,t.x)),N.value=Math.max(0,Math.min(window.innerHeight-50,t.y))},onEnd(){var t;(t=w.value)==null||t.classList.remove("dragging"),document.body.classList.remove("qy-dialog--dragging")}}),ee=e.computed(()=>({transform:`translate(${$.value}px, ${N.value}px)`,willChange:"transform"}));function D(t){const l=t.target,{scrollTop:n,scrollHeight:r,clientHeight:u}=l;M.value=n<=X,B.value=r-(n+u)<=X}function te(){const t=document.querySelector(`.${d}.el-dialog`);t&&(L.value=t,t.addEventListener("scroll",D)),a("opened")}function H(){y.value=!y.value,V()}function c(t){o.confirmLoading&&t!=="external"||s.value||(s.value=!0,W(),a("update:open",!1),a("open-change",!1),(t==="cancel"||t==="header")&&a("cancel"),a("close",t),e.nextTick(()=>{o.open&&(s.value=!1)}))}function oe(){a("closed"),e.nextTick(()=>{p!=null&&p.isConnected&&p.focus()})}function le(t){o.showFullscreen&&t.detail>=2&&H()}function F(){return e.h(k.ElButton,{type:"primary",class:"dialog__footerBtn",loading:o.confirmLoading,disabled:o.confirmDisabled||o.confirmLoading||m.value,onClick:ne},()=>o.confirmText)}function ne(){m.value||o.confirmLoading||o.confirmDisabled||(m.value=!0,a("confirm"),e.nextTick(()=>{o.confirmLoading||(m.value=!1)}),o.closeOnConfirm&&c("confirm"))}function Z(){return e.h(k.ElButton,{class:"dialog__footerBtn",onClick:()=>c("cancel")},()=>o.cancelText)}e.onMounted(()=>{V(),document.addEventListener("keydown",A,!0),document.addEventListener("keydown",R),document.addEventListener("mousedown",P,!0)});function j(){var r,u;const t=(r=document.querySelector(`.${d}`))==null?void 0:r.closest(".el-overlay");if(!t)return!1;const n=Array.from(document.querySelectorAll(".el-overlay, .el-image-viewer__wrapper")).filter(f=>window.getComputedStyle(f).display!=="none").map((f,x)=>({overlay:f,order:x,zIndex:Number.parseInt(window.getComputedStyle(f).zIndex||"0",10)}));return n.sort((f,x)=>f.zIndex-x.zIndex||f.order-x.order),((u=n.at(-1))==null?void 0:u.overlay)===t}const S=new WeakSet;function A(t){t.key!=="Escape"||E.isOverlayEscapeClaimed(t)||!o.open||!o.closeOnEscape||o.confirmLoading||!j()||S.add(t)}function R(t){!S.has(t)||t.defaultPrevented||(S.delete(t),t.preventDefault(),c("escape"))}function P(t){if(!o.open||!o.closeOnOverlay||o.confirmLoading||!j()||!(t.target instanceof Node))return;const l=document.querySelector(`.${d}.el-dialog`),n=l==null?void 0:l.closest(".el-overlay");!l||!n||!n.contains(t.target)||l.contains(t.target)||c("overlay")}function V(){var r;const t=(r=document.querySelector(`.${d}`))==null?void 0:r.closest(".el-overlay"),l=document.querySelector(`.${d}.el-dialog`);if(!t||!l)return;const n=E.resolveOverlayZIndex(b(),o.zIndex);e.nextTick(()=>{t.style.zIndex=n.toString(),l.style.zIndex=n.toString(),h.value=n})}e.onUnmounted(()=>{var t;document.removeEventListener("keydown",A,!0),document.removeEventListener("keydown",R),document.removeEventListener("mousedown",P,!0),(t=L.value)==null||t.removeEventListener("scroll",D),W()});function W(){if(!g){v.value=!1;return}g=!1,i=Math.max(0,i-1),v.value=!1}function q(){var l;const t=(l=document.querySelector(`.${d}`))==null?void 0:l.closest(".el-overlay");!t||!o.open||(v.value?(v.value=!1,t.style.display="block",g&&(g=!1,i=Math.max(0,i-1)),V()):(v.value=!0,t.style.display="none",g=!0,i+=1,N.value=window.innerHeight-50-i*60))}return(t,l)=>{const n=U.ElIcon,r=U.ElDialog;return e.openBlock(),e.createBlock(e.unref(k.ElConfigProvider),{"z-index":h.value},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(r,{ref:"dialogRef",class:e.normalizeClass(["qy-dialog",[o.size==="small"&&"[&_.el-dialog__header]:!hidden",d]]),"model-value":T.value,title:o.title,width:o.width,top:o.top,"align-center":o.alignCenter,"append-to-body":o.appendToBody,"append-to":o.appendTo,"destroy-on-close":o.destroyOnClose,"lock-scroll":o.lockScroll,style:{"--el-dialog-padding-primary":0},"show-close":!1,"close-on-press-escape":!1,"close-on-click-modal":!1,fullscreen:y.value,"z-index":h.value,onClosed:oe,onOpened:te,draggable:o.draggable},e.createSlots({header:e.withCtx(()=>[o.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:le},[e.createElementVNode("div",ie,[e.unref(C).header?e.unref(C).header?(e.openBlock(),e.createElementBlock("div",de,[e.renderSlot(t.$slots,"header")])):e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",se,e.toDisplayString(o.title),1))]),e.createElementVNode("div",{class:"flex",onMousedown:l[4]||(l[4]=e.withModifiers(()=>{},["stop"]))},[o.size==="default"&&o.minimizable?(e.openBlock(),e.createElementBlock("div",{key:0,class:"qy-dialog__btn qy-dialog__btn--default",onClick:e.withModifiers(q,["stop"]),onMousedown:l[0]||(l[0]=e.withModifiers(()=>{},["stop"]))},[...l[7]||(l[7]=[e.createElementVNode("span",{class:"icon-[material-symbols--minimize] text-xl mb-3",role:"img","aria-hidden":"true"},null,-1)])],32)):e.createCommentVNode("",!0),o.showFullscreen?(e.openBlock(),e.createElementBlock("div",{key:1,class:"qy-dialog__btn qy-dialog__btn--default",onClick:e.withModifiers(H,["stop"]),onMousedown:l[1]||(l[1]=e.withModifiers(()=>{},["stop"]))},[y.value?(e.openBlock(),e.createElementBlock("span",ue)):(e.openBlock(),e.createElementBlock("span",ce))],32)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"qy-dialog__btn qy-dialog__btn--danger",onClick:l[2]||(l[2]=e.withModifiers(u=>c("header"),["stop"])),onMousedown:l[3]||(l[3]=e.withModifiers(()=>{},["stop"]))},[...l[8]||(l[8]=[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(ae)(y.value&&"qy-dialog__wrapper--fullscreen")]),style:e.normalizeStyle({maxHeight:I.value?"calc(100vh - var(--header-height) - var(--footer-height) - var(--sides-gap))":"calc(100vh - var(--header-height) - var(--sides-gap))",padding:o.size==="small"?"var(--small-content-padding)":"var(--content-padding)"})},[o.size==="small"?(e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(n,{size:36,class:"cursor-pointer text-gray-100 active:scale-75 rounded-sm transition-all",onClick:l[5]||(l[5]=u=>c("header"))},{default:e.withCtx(()=>[e.createVNode(e.unref(re.Close))]),_:1})])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"default")],6)]),_:2},[o.showFooter&&!t.$slots.footer&&Array.isArray(z.value)?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",me,[e.createElementVNode("div",null,[e.renderSlot(t.$slots,"footer-left")]),e.createElementVNode("div",{class:e.normalizeClass([{"qy-dialog__footer--outline":B.value},"qy-dialog__footer flex items-center justify-end"])},[z.value.includes("cancel")?(e.openBlock(),e.createBlock(Z,{key:0})):e.createCommentVNode("",!0),z.value.includes("confirm")?(e.openBlock(),e.createBlock(F,{key:1})):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"footer-append")],2)])]),key:"0"}:I.value?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass([{"qy-dialog__footer--outline":B.value},"qy-dialog__footer px-[var(--content-padding)] min-h-[var(--footer-height)] flex items-center justify-end"])},[e.renderSlot(t.$slots,"footer",{layouts:O.value,layoutsNode:Object.values(O.value)})],2)]),key:"1"}:void 0]),1032,["class","model-value","title","width","top","align-center","append-to-body","append-to","destroy-on-close","lock-scroll","fullscreen","z-index","draggable"]),e.withDirectives(e.createElementVNode("div",{ref_key:"minimizedRef",ref:w,class:"fixed left-0 top-0 bg-white rounded shadow-lg cursor-pointer z-[9999] hover:bg-gray-50",style:e.normalizeStyle([ee.value,{width:"300px",height:"50px","will-change":"transform"}])},[e.createElementVNode("div",pe,[e.createElementVNode("div",ve,[l[9]||(l[9]=e.createElementVNode("div",{class:"icon-[mdi--window-restore] text-gray-600"},null,-1)),e.createElementVNode("span",ye,e.toDisplayString(o.title),1)]),e.createElementVNode("div",ge,[e.createElementVNode("div",{class:"p-1 hover:bg-gray-200 rounded",onClick:e.withModifiers(q,["stop"])},[...l[10]||(l[10]=[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:l[6]||(l[6]=e.withModifiers(u=>c("header"),["stop"]))},[...l[11]||(l[11]=[e.createElementVNode("div",{class:"icon-[mdi--close] text-red-600"},null,-1)])])])])],4),[[e.vShow,v.value]])])]),_:3},8,["z-index"])}}});exports._sfc_main=he;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("vue"),s=require("element-plus"),u=t.defineComponent({name:"QyTooltip",inheritAttrs:!1,__name:"index",props:{content:{default:""},trigger:{default:()=>["hover","focus"]},enterable:{type:Boolean,default:!1},teleported:{type:Boolean,default:!0},appendTo:{default:"body"},placement:{default:"top"},effect:{default:"dark"},disabled:{type:Boolean,default:!1},showDelay:{default:0},hideDelay:{default:200},offset:{default:12},maxWidth:{default:320}},emits:["open","close"],setup(e,{emit:d}){const f=d,i=t.computed(()=>typeof e.maxWidth=="number"?`${e.maxWidth}px`:e.maxWidth),c=t.computed(()=>({"--qy-tooltip-max-width":i.value})),l=t.ref(!1);let n=!1;t.onBeforeUnmount(()=>{n=!0});function o(a){n||a===l.value||(l.value=a,f(a?"open":"close"))}function r(a){o(a)}return t.watch(()=>e.disabled,a=>{a&&o(!1)}),(a,m)=>(t.openBlock(),t.createBlock(t.unref(s.ElTooltip),{content:e.content,placement:e.placement,effect:e.effect,disabled:e.disabled,"show-after":e.showDelay,"hide-after":e.hideDelay,offset:e.offset,trigger:e.trigger,enterable:e.enterable,teleported:e.teleported,"append-to":e.appendTo,"raw-content":!1,"popper-class":"qy-tooltip-popper","popper-style":c.value,"onUpdate:visible":r},{content:t.withCtx(()=>[t.renderSlot(a.$slots,"content",{},()=>[t.createTextVNode(t.toDisplayString(e.content),1)])]),default:t.withCtx(()=>[t.renderSlot(a.$slots,"default")]),_:3},8,["content","placement","effect","disabled","show-after","hide-after","offset","trigger","enterable","teleported","append-to","popper-style"]))}});exports._sfc_main=u;
|