@qynpm/ui 1.0.44 → 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-BweLwi2_.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-DNnWRAFl.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 +1 -1
- 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-5dxbpQb_.cjs +0 -1
- package/dist/shared/index-BEcS8y8g.mjs +0 -68
- package/dist/shared/index-BSTMCPDj.mjs +0 -72
- package/dist/shared/index-Bh9hxVFh.mjs +0 -766
- package/dist/shared/index-CGq7Q_hV.mjs +0 -119
- package/dist/shared/index-CVYNG8Fc.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-afOuq3YX.cjs +0 -1
- package/dist/shared/index-rSrDnOpu.cjs +0 -1
- package/dist/shared/index-rjciSHaR.mjs +0 -2362
- 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,219 @@
|
|
|
1
|
+
import { defineComponent as fe, useAttrs as pe, ref as l, computed as f, getCurrentInstance as me, watch as q, onMounted as ve, onBeforeUnmount as ye, openBlock as A, createElementBlock as X, mergeProps as ge, createVNode as I, unref as N, withCtx as T, createElementVNode as g, normalizeClass as we, renderSlot as R, createBlock as he, resolveDynamicComponent as be, createCommentVNode as Ee, createTextVNode as $, toDisplayString as F } from "vue";
|
|
2
|
+
import { CircleCloseFilled as Le, InfoFilled as ke, WarningFilled as Ce } from "@element-plus/icons-vue";
|
|
3
|
+
import { ElPopover as qe, ElButton as Y } from "element-plus";
|
|
4
|
+
import { i as Te, c as Se } from "./overlay-stack-CFFRngnU.mjs";
|
|
5
|
+
const p = [], Be = { class: "qy-popconfirm__message" }, De = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "qy-popconfirm__icon",
|
|
8
|
+
"aria-hidden": "true"
|
|
9
|
+
}, Pe = {
|
|
10
|
+
"data-testid": "qy-popconfirm-title",
|
|
11
|
+
class: "qy-popconfirm__title"
|
|
12
|
+
}, xe = { class: "qy-popconfirm__actions" }, $e = /* @__PURE__ */ fe({
|
|
13
|
+
name: "QyPopconfirm",
|
|
14
|
+
inheritAttrs: !1,
|
|
15
|
+
__name: "index",
|
|
16
|
+
props: {
|
|
17
|
+
title: { type: String, required: !0 },
|
|
18
|
+
open: { type: Boolean, default: void 0 },
|
|
19
|
+
disabled: { type: Boolean, default: !1 },
|
|
20
|
+
placement: { type: String, default: "bottom" },
|
|
21
|
+
width: { type: [Number, String], default: 220 },
|
|
22
|
+
confirmText: { type: String, default: "确认" },
|
|
23
|
+
cancelText: { type: String, default: "取消" },
|
|
24
|
+
variant: { type: String, default: "warning" },
|
|
25
|
+
confirmType: { type: String, default: "primary" },
|
|
26
|
+
showIcon: { type: Boolean, default: !0 },
|
|
27
|
+
confirmLoading: { type: Boolean, default: !1 },
|
|
28
|
+
closeOnConfirm: { type: Boolean, default: !0 }
|
|
29
|
+
},
|
|
30
|
+
emits: ["update:open", "open-change", "confirm", "cancel", "close"],
|
|
31
|
+
setup(o, { emit: Z }) {
|
|
32
|
+
const t = o, s = Z, _ = pe(), w = l(null), S = l(null), W = f(() => t.open !== void 0), B = t.open === !0 && !t.disabled, D = l(B), c = l(B), r = l(B), i = l(null), m = l(!1), h = l(null), b = {}, O = `qy-popconfirm-${me().uid}`, P = /* @__PURE__ */ new WeakSet();
|
|
33
|
+
let d = !1, v, E, L = !1, k = null;
|
|
34
|
+
const V = f(() => t.disabled ? !1 : W.value ? t.open === !0 : D.value), ee = f(() => {
|
|
35
|
+
const e = {};
|
|
36
|
+
for (const [n, y] of Object.entries(_))
|
|
37
|
+
(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] = y);
|
|
38
|
+
return e;
|
|
39
|
+
}), ne = f(
|
|
40
|
+
() => typeof t.width == "number" ? `${t.width}px` : t.width
|
|
41
|
+
), te = f(() => ({
|
|
42
|
+
"--qy-popconfirm-width": ne.value,
|
|
43
|
+
"--qy-popconfirm-mobile-gutter": "24px"
|
|
44
|
+
})), oe = f(() => t.variant === "danger" ? Le : t.variant === "info" ? ke : Ce);
|
|
45
|
+
function x() {
|
|
46
|
+
return p[p.length - 1] === b;
|
|
47
|
+
}
|
|
48
|
+
function z() {
|
|
49
|
+
p.includes(b) || p.push(b);
|
|
50
|
+
}
|
|
51
|
+
function M() {
|
|
52
|
+
const e = p.indexOf(b);
|
|
53
|
+
e >= 0 && p.splice(e, 1);
|
|
54
|
+
}
|
|
55
|
+
function H(e) {
|
|
56
|
+
var G, J;
|
|
57
|
+
const n = document.activeElement;
|
|
58
|
+
if (n instanceof HTMLElement && ((G = w.value) != null && G.contains(n))) {
|
|
59
|
+
h.value = n;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const y = e == null ? void 0 : e.target;
|
|
63
|
+
y instanceof HTMLElement && ((J = S.value) != null && J.contains(y)) && (h.value = y);
|
|
64
|
+
}
|
|
65
|
+
function ie() {
|
|
66
|
+
const e = h.value;
|
|
67
|
+
h.value = null, e != null && e.isConnected && e.focus();
|
|
68
|
+
}
|
|
69
|
+
function u() {
|
|
70
|
+
if (d) return;
|
|
71
|
+
const e = V.value;
|
|
72
|
+
c.value !== e && (d = !0, v = e, E = e ? void 0 : i.value ?? (t.disabled ? "disabled" : "external"), c.value = e);
|
|
73
|
+
}
|
|
74
|
+
function a(e, n) {
|
|
75
|
+
e && t.disabled || (!e && n && i.value === null && (i.value = n), W.value ? t.open !== e && s("update:open", e) : D.value !== e && (D.value = e, s("update:open", e)), u());
|
|
76
|
+
}
|
|
77
|
+
function re() {
|
|
78
|
+
var e;
|
|
79
|
+
return i.value ? i.value : k instanceof Node && ((e = w.value) != null && e.contains(k)) ? "trigger" : "outside";
|
|
80
|
+
}
|
|
81
|
+
function ae(e) {
|
|
82
|
+
if (e) {
|
|
83
|
+
H(), a(!0);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (t.confirmLoading) return;
|
|
87
|
+
const n = re();
|
|
88
|
+
!x() && n !== "external" && n !== "disabled" || a(!1, n);
|
|
89
|
+
}
|
|
90
|
+
function le(e) {
|
|
91
|
+
var n;
|
|
92
|
+
!(e.target instanceof Node) || !((n = S.value) != null && n.contains(e.target)) || t.confirmLoading || (r.value || c.value ? (i.value = "trigger", a(!1, "trigger")) : (H(e), a(!0)));
|
|
93
|
+
}
|
|
94
|
+
function se() {
|
|
95
|
+
t.disabled || t.confirmLoading || m.value || (m.value = !0, s("confirm"), t.closeOnConfirm && a(!1, "confirm"));
|
|
96
|
+
}
|
|
97
|
+
function ce() {
|
|
98
|
+
t.disabled || t.confirmLoading || (s("cancel"), a(!1, "cancel"));
|
|
99
|
+
}
|
|
100
|
+
function K(e) {
|
|
101
|
+
e.key !== "Escape" && e.code !== "Escape" || e.defaultPrevented || !r.value || !x() || Te(document.querySelector(`.${O}`)) && (Se(e), P.add(e));
|
|
102
|
+
}
|
|
103
|
+
function C(e) {
|
|
104
|
+
P.has(e) && (P.delete(e), e.stopPropagation(), !e.defaultPrevented && (e.preventDefault(), e.stopImmediatePropagation(), !t.confirmLoading && a(!1, "escape")));
|
|
105
|
+
}
|
|
106
|
+
function Q(e) {
|
|
107
|
+
k = e.target;
|
|
108
|
+
}
|
|
109
|
+
function U(e) {
|
|
110
|
+
k = e.target;
|
|
111
|
+
}
|
|
112
|
+
function j(e) {
|
|
113
|
+
var n;
|
|
114
|
+
t.confirmLoading || !r.value || !x() || e.target instanceof Node && ((n = w.value) != null && n.contains(e.target) || e.target instanceof Element && e.target.closest(".qy-popconfirm-popper") || a(!1, "outside"));
|
|
115
|
+
}
|
|
116
|
+
function de() {
|
|
117
|
+
!d || v !== !0 || (d = !1, v = void 0, r.value = !0, z(), i.value = null, E = void 0, s("open-change", !0), u());
|
|
118
|
+
}
|
|
119
|
+
function ue() {
|
|
120
|
+
!d || v !== !1 || (d = !1, v = void 0, r.value = !1, M(), s("open-change", !1), s("close", E ?? i.value ?? "external"), i.value = null, E = void 0, m.value = !1, L = !1, ie(), u());
|
|
121
|
+
}
|
|
122
|
+
return q(V, () => u()), q(
|
|
123
|
+
() => t.open,
|
|
124
|
+
(e, n) => {
|
|
125
|
+
e !== n && (e === !1 && (r.value || c.value) && i.value === null && (i.value = "external"), u());
|
|
126
|
+
}
|
|
127
|
+
), q(
|
|
128
|
+
() => t.disabled,
|
|
129
|
+
(e) => {
|
|
130
|
+
e && (r.value || c.value) && (i.value = "disabled"), u();
|
|
131
|
+
}
|
|
132
|
+
), q(
|
|
133
|
+
() => t.confirmLoading,
|
|
134
|
+
(e) => {
|
|
135
|
+
e ? L = !0 : L && (L = !1, r.value && (m.value = !1));
|
|
136
|
+
}
|
|
137
|
+
), ve(() => {
|
|
138
|
+
r.value && z(), window.addEventListener("keydown", K, !0), document.body.addEventListener("keydown", C), window.addEventListener("keydown", C), document.addEventListener("pointerdown", Q, !0), document.addEventListener("mousedown", U, !0), document.addEventListener("click", j);
|
|
139
|
+
}), ye(() => {
|
|
140
|
+
M(), window.removeEventListener("keydown", K, !0), document.body.removeEventListener("keydown", C), window.removeEventListener("keydown", C), document.removeEventListener("pointerdown", Q, !0), document.removeEventListener("mousedown", U, !0), document.removeEventListener("click", j);
|
|
141
|
+
}), (e, n) => (A(), X("span", ge({
|
|
142
|
+
ref_key: "rootRef",
|
|
143
|
+
ref: w,
|
|
144
|
+
class: "qy-popconfirm"
|
|
145
|
+
}, ee.value, { onClickCapture: le }), [
|
|
146
|
+
I(N(qe), {
|
|
147
|
+
visible: c.value,
|
|
148
|
+
trigger: "click",
|
|
149
|
+
placement: o.placement,
|
|
150
|
+
width: o.width,
|
|
151
|
+
disabled: o.disabled,
|
|
152
|
+
"popper-style": te.value,
|
|
153
|
+
"popper-class": `qy-popconfirm-popper ${O}`,
|
|
154
|
+
"onUpdate:visible": ae,
|
|
155
|
+
onAfterEnter: de,
|
|
156
|
+
onAfterLeave: ue
|
|
157
|
+
}, {
|
|
158
|
+
reference: T(() => [
|
|
159
|
+
g("span", {
|
|
160
|
+
ref_key: "referenceRef",
|
|
161
|
+
ref: S,
|
|
162
|
+
"data-qy-popconfirm-reference": ""
|
|
163
|
+
}, [
|
|
164
|
+
R(e.$slots, "reference")
|
|
165
|
+
], 512)
|
|
166
|
+
]),
|
|
167
|
+
default: T(() => [
|
|
168
|
+
g("div", {
|
|
169
|
+
class: we(["qy-popconfirm__content", `is-${o.variant}`]),
|
|
170
|
+
"data-qy-popconfirm-content": ""
|
|
171
|
+
}, [
|
|
172
|
+
g("div", Be, [
|
|
173
|
+
o.showIcon ? (A(), X("span", De, [
|
|
174
|
+
R(e.$slots, "icon", {}, () => [
|
|
175
|
+
(A(), he(be(oe.value)))
|
|
176
|
+
])
|
|
177
|
+
])) : Ee("", !0),
|
|
178
|
+
g("span", Pe, [
|
|
179
|
+
R(e.$slots, "title", {}, () => [
|
|
180
|
+
$(F(o.title), 1)
|
|
181
|
+
])
|
|
182
|
+
])
|
|
183
|
+
]),
|
|
184
|
+
g("div", xe, [
|
|
185
|
+
I(N(Y), {
|
|
186
|
+
"data-testid": "qy-popconfirm-cancel",
|
|
187
|
+
size: "small",
|
|
188
|
+
disabled: o.disabled || o.confirmLoading,
|
|
189
|
+
onClick: ce
|
|
190
|
+
}, {
|
|
191
|
+
default: T(() => [
|
|
192
|
+
$(F(o.cancelText), 1)
|
|
193
|
+
]),
|
|
194
|
+
_: 1
|
|
195
|
+
}, 8, ["disabled"]),
|
|
196
|
+
I(N(Y), {
|
|
197
|
+
"data-testid": "qy-popconfirm-confirm",
|
|
198
|
+
size: "small",
|
|
199
|
+
type: o.confirmType,
|
|
200
|
+
loading: o.confirmLoading,
|
|
201
|
+
disabled: o.disabled || o.confirmLoading || m.value,
|
|
202
|
+
onClick: se
|
|
203
|
+
}, {
|
|
204
|
+
default: T(() => [
|
|
205
|
+
$(F(o.confirmText), 1)
|
|
206
|
+
]),
|
|
207
|
+
_: 1
|
|
208
|
+
}, 8, ["type", "loading", "disabled"])
|
|
209
|
+
])
|
|
210
|
+
], 2)
|
|
211
|
+
]),
|
|
212
|
+
_: 3
|
|
213
|
+
}, 8, ["visible", "placement", "width", "disabled", "popper-style", "popper-class"])
|
|
214
|
+
], 16));
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
export {
|
|
218
|
+
$e as _
|
|
219
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("vue"),x=require("element-plus"),E=a.defineComponent({name:"QyDatePicker",inheritAttrs:!1,__name:"index",props:{modelValue:{default:void 0},type:{default:"date"},placeholder:{default:"请选择日期"},startPlaceholder:{default:"开始时间"},endPlaceholder:{default:"结束时间"},rangeSeparator:{default:"-"},format:{default:void 0},valueFormat:{default:void 0},defaultTime:{default:void 0},disabledDate:{type:Function,default:void 0},shortcuts:{default:void 0},clearable:{type:Boolean,default:!0},validateEvent:{type:Boolean,default:!0},disabled:{type:Boolean,default:void 0},readonly:{type:Boolean},size:{default:void 0},teleported:{type:Boolean,default:!0},appendTo:{default:"body"},popperClass:{default:""},normalizeRangeEndTime:{type:Boolean,default:!1}},emits:["update:modelValue","change","clear","calendar-change","panel-change","visible-change","focus","blur"],setup(n,{expose:s,emit:c}){const d=n,r=c,f=a.useAttrs(),o=a.ref(null),h=a.computed(()=>["qy-date-picker__popper",d.popperClass].filter(Boolean).join(" "));function p(e){return Array.isArray(e)}function m(e){if(e.getHours()!==0||e.getMinutes()!==0||e.getSeconds()!==0||e.getMilliseconds()!==0)return e;const t=new Date(e);return t.setHours(23,59,59,0),t}function g(e){const t=e.match(/(T| )00:00:00(\.000)?(Z|[+-]\d{2}:?\d{2})?$/);return t?e.replace(t[0],`${t[1]}23:59:59${t[2]??""}${t[3]??""}`):e}function i(e){if(!d.normalizeRangeEndTime||!p(e)||e.length<2)return e;const t=e[1];let l=t;if(t instanceof Date?l=m(t):typeof t=="string"&&(l=g(t)),l===t)return e;const u=[...e];return u[1]=l,u}function v(e){r("update:modelValue",i(e))}function y(e){r("change",i(e))}function P(){r("clear")}function C(e){r("calendar-change",e)}function b(e,t,l){if(l===void 0){r("panel-change",e,t);return}r("panel-change",e,t,l)}function z(e){r("visible-change",e)}function V(e){r("focus",e)}function R(e){r("blur",e)}function B(){var e,t;(t=(e=o.value)==null?void 0:e.focus)==null||t.call(e)}function S(){var e,t;(t=(e=o.value)==null?void 0:e.blur)==null||t.call(e)}function $(){var e,t;(t=(e=o.value)==null?void 0:e.handleOpen)==null||t.call(e)}function k(){var e,t;(t=(e=o.value)==null?void 0:e.handleClose)==null||t.call(e)}return s({focus:B,blur:S,open:$,close:k}),(e,t)=>(a.openBlock(),a.createBlock(a.unref(x.ElDatePicker),a.mergeProps({ref_key:"datePickerRef",ref:o,class:"qy-date-picker"},a.unref(f),{"model-value":n.modelValue,type:n.type,placeholder:n.placeholder,"start-placeholder":n.startPlaceholder,"end-placeholder":n.endPlaceholder,"range-separator":n.rangeSeparator,format:n.format,"value-format":n.valueFormat,"default-time":n.defaultTime,"disabled-date":n.disabledDate,shortcuts:n.shortcuts,clearable:n.clearable,disabled:n.disabled,"validate-event":n.validateEvent,readonly:n.readonly,size:n.size,teleported:n.teleported,"append-to":n.appendTo,"popper-class":h.value,"onUpdate:modelValue":v,onChange:y,onClear:P,onCalendarChange:C,onPanelChange:b,onVisibleChange:z,onFocus:V,onBlur:R}),{default:a.withCtx(l=>[a.renderSlot(e.$slots,"default",a.normalizeProps(a.guardReactiveProps(l)))]),"range-separator":a.withCtx(l=>[a.renderSlot(e.$slots,"range-separator",a.normalizeProps(a.guardReactiveProps(l)))]),"prev-month":a.withCtx(l=>[a.renderSlot(e.$slots,"prev-month",a.normalizeProps(a.guardReactiveProps(l)))]),"next-month":a.withCtx(l=>[a.renderSlot(e.$slots,"next-month",a.normalizeProps(a.guardReactiveProps(l)))]),"prev-year":a.withCtx(l=>[a.renderSlot(e.$slots,"prev-year",a.normalizeProps(a.guardReactiveProps(l)))]),"next-year":a.withCtx(l=>[a.renderSlot(e.$slots,"next-year",a.normalizeProps(a.guardReactiveProps(l)))]),_:3},16,["model-value","type","placeholder","start-placeholder","end-placeholder","range-separator","format","value-format","default-time","disabled-date","shortcuts","clearable","disabled","validate-event","readonly","size","teleported","append-to","popper-class"]))}});exports._sfc_main=E;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("vue"),R=require("element-plus"),j=["id","role","aria-disabled","tabindex","disabled","onKeydown"],G={class:"qy-color-picker__value","aria-hidden":"true"};let H=0;const J=()=>`qy-color-picker-${++H}`,X=a.defineComponent({name:"QyColorPicker",inheritAttrs:!1,__name:"index",props:{modelValue:{default:null},format:{default:void 0},showAlpha:{type:Boolean,default:!1},predefine:{default:void 0},size:{default:"default"},disabled:{type:Boolean,default:void 0},clearable:{type:Boolean,default:!1}},emits:["update:modelValue","active-change","change","visible-change"],setup(L,{emit:z}){const r=L,u=z,i=R.useFormDisabled();a.watch(i,e=>{e&&n.value&&v()});const f=a.useAttrs(),k=a.ref(null),w=a.ref(null),m=a.ref(null),t=a.ref(c(r.modelValue)),y=a.ref(t.value),n=a.ref(!1),o=a.ref(null),s=a.ref(!1),p=a.ref(!1),_=J(),B=a.computed(()=>typeof f.id=="string"&&f.id||_),C=`qy-color-picker__popper--${_}`,I=a.computed(()=>r.format||(r.showAlpha?"rgb":"hex")),h=a.computed(()=>c(r.modelValue)),K=a.computed(()=>String(f.role||"button")),N=a.computed(()=>f["aria-disabled"]??(i.value?"true":"false")),S=a.computed(()=>i.value?void 0:f.tabindex??0),T=a.computed(()=>{const e={};for(const[l,d]of Object.entries(f)){const b=l.toLowerCase();(l==="class"||l==="style"||l==="id"||l==="title"||l==="tabindex"||l==="role"||b.startsWith("data-")||b.startsWith("aria-")||["onkeydown","onkeyup","onkeypress"].includes(b))&&(e[l]=d)}return e});a.watch(()=>r.modelValue,e=>{t.value=c(e),n.value&&(y.value=t.value)});function c(e){return e==null||e===""?null:String(e)}function F(){if(!i.value){if(n.value){v();return}E()}}function V(){i.value||n.value||E()}function M(){n.value&&v()}function E(){n.value||i.value||(y.value=c(r.modelValue),t.value=y.value,o.value=null,s.value=!1,p.value=!1,n.value=!0,W(),u("visible-change",!0),a.nextTick(()=>{var e,l;return(l=(e=m.value)==null?void 0:e.show)==null?void 0:l.call(e)}))}function O(e){!n.value||o.value||(t.value=c(e),u("active-change",t.value))}function Q(e){!n.value||o.value==="cancel"||(t.value=c(e),s.value||(s.value=!0,o.value="commit",u("update:modelValue",t.value)))}function U(e){!n.value||o.value==="cancel"||(t.value=c(e),s.value||(s.value=!0,o.value="commit",u("update:modelValue",t.value)),p.value||(p.value=!0,u("change",t.value)),g())}function $(){!n.value||o.value==="cancel"||(s.value||(s.value=!0,o.value="commit",t.value=null,u("update:modelValue",null)),p.value||(p.value=!0,u("change",null)),g())}function v(){var e,l;!n.value||o.value||(o.value="cancel",t.value=c(r.modelValue),(l=(e=m.value)==null?void 0:e.hide)==null||l.call(e),g())}function g(){var e,l;n.value&&(n.value=!1,P(),(l=(e=m.value)==null?void 0:e.hide)==null||l.call(e),u("visible-change",!1),a.nextTick(()=>{var d;return(d=w.value)==null?void 0:d.focus()}))}function x(e){var l,d;return e instanceof Node?(l=k.value)!=null&&l.contains(e)?!0:!!((d=e.closest)!=null&&d.call(e,`.${C}`)):!1}function q(e){n.value&&!x(e.target)&&v()}function A(e){n.value&&!x(e.target)&&v()}function D(e){n.value&&e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),v())}function W(){document.addEventListener("pointerdown",q,!0),document.addEventListener("focusin",A,!0),document.addEventListener("keydown",D,!0)}function P(){document.removeEventListener("pointerdown",q,!0),document.removeEventListener("focusin",A,!0),document.removeEventListener("keydown",D,!0)}return a.onBeforeUnmount(()=>{P()}),(e,l)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"rootRef",ref:k,class:"qy-color-picker","data-qy-color-picker":""},[a.createElementVNode("button",a.mergeProps({ref_key:"triggerRef",ref:w,type:"button",class:"qy-color-picker__trigger"},T.value,{id:B.value,role:K.value,"aria-disabled":N.value,tabindex:S.value,disabled:a.unref(i),class:{"is-disabled":a.unref(i),"is-open":n.value},onClick:F,onKeydown:[a.withKeys(a.withModifiers(V,["prevent"]),["enter"]),a.withKeys(a.withModifiers(V,["prevent"]),["space"]),a.withKeys(a.withModifiers(M,["prevent"]),["esc"])]}),[a.createElementVNode("span",{class:a.normalizeClass(["qy-color-picker__swatch",{"is-empty":!h.value}]),style:a.normalizeStyle(h.value?{backgroundColor:h.value}:void 0),"aria-hidden":"true"},null,6),a.createElementVNode("span",G,a.toDisplayString(h.value||"选择颜色"),1),l[0]||(l[0]=a.createElementVNode("span",{class:"qy-color-picker__arrow","aria-hidden":"true"},"⌄",-1))],16,j),a.createVNode(a.unref(R.ElColorPicker),{ref_key:"rendererRef",ref:m,class:"qy-color-picker__renderer","model-value":t.value,"show-alpha":r.showAlpha,"color-format":I.value,predefine:r.predefine,size:r.size,disabled:!1,clearable:r.clearable,teleported:!0,tabindex:-1,"popper-class":C,"aria-hidden":"true",onActiveChange:O,"onUpdate:modelValue":Q,onChange:U,onClear:$},null,8,["model-value","show-alpha","color-format","predefine","size","clearable"])],512))}});exports._sfc_main=X;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { defineComponent as m, computed as n, ref as
|
|
2
|
-
import { ElTooltip as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as m, computed as n, ref as p, onBeforeUnmount as h, watch as y, openBlock as b, createBlock as g, unref as w, withCtx as f, renderSlot as d, createTextVNode as x, toDisplayString as v } from "vue";
|
|
2
|
+
import { ElTooltip as B } from "element-plus";
|
|
3
|
+
const k = /* @__PURE__ */ m({
|
|
4
4
|
name: "QyTooltip",
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "index",
|
|
7
7
|
props: {
|
|
8
8
|
content: { default: "" },
|
|
9
|
+
trigger: { default: () => ["hover", "focus"] },
|
|
10
|
+
enterable: { type: Boolean, default: !1 },
|
|
11
|
+
teleported: { type: Boolean, default: !0 },
|
|
12
|
+
appendTo: { default: "body" },
|
|
9
13
|
placement: { default: "top" },
|
|
10
14
|
effect: { default: "dark" },
|
|
11
15
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -15,18 +19,18 @@ const C = /* @__PURE__ */ m({
|
|
|
15
19
|
maxWidth: { default: 320 }
|
|
16
20
|
},
|
|
17
21
|
emits: ["open", "close"],
|
|
18
|
-
setup(e, { emit:
|
|
19
|
-
const
|
|
22
|
+
setup(e, { emit: i }) {
|
|
23
|
+
const r = i, c = n(
|
|
20
24
|
() => typeof e.maxWidth == "number" ? `${e.maxWidth}px` : e.maxWidth
|
|
21
|
-
),
|
|
25
|
+
), s = n(() => ({
|
|
22
26
|
"--qy-tooltip-max-width": c.value
|
|
23
|
-
})), a =
|
|
27
|
+
})), a = p(!1);
|
|
24
28
|
let l = !1;
|
|
25
|
-
|
|
29
|
+
h(() => {
|
|
26
30
|
l = !0;
|
|
27
31
|
});
|
|
28
32
|
function o(t) {
|
|
29
|
-
l || t === a.value || (a.value = t,
|
|
33
|
+
l || t === a.value || (a.value = t, r(t ? "open" : "close"));
|
|
30
34
|
}
|
|
31
35
|
function u(t) {
|
|
32
36
|
o(t);
|
|
@@ -36,7 +40,7 @@ const C = /* @__PURE__ */ m({
|
|
|
36
40
|
(t) => {
|
|
37
41
|
t && o(!1);
|
|
38
42
|
}
|
|
39
|
-
), (t,
|
|
43
|
+
), (t, D) => (b(), g(w(B), {
|
|
40
44
|
content: e.content,
|
|
41
45
|
placement: e.placement,
|
|
42
46
|
effect: e.effect,
|
|
@@ -44,25 +48,27 @@ const C = /* @__PURE__ */ m({
|
|
|
44
48
|
"show-after": e.showDelay,
|
|
45
49
|
"hide-after": e.hideDelay,
|
|
46
50
|
offset: e.offset,
|
|
47
|
-
trigger:
|
|
48
|
-
enterable:
|
|
51
|
+
trigger: e.trigger,
|
|
52
|
+
enterable: e.enterable,
|
|
53
|
+
teleported: e.teleported,
|
|
54
|
+
"append-to": e.appendTo,
|
|
49
55
|
"raw-content": !1,
|
|
50
56
|
"popper-class": "qy-tooltip-popper",
|
|
51
|
-
"popper-style":
|
|
57
|
+
"popper-style": s.value,
|
|
52
58
|
"onUpdate:visible": u
|
|
53
59
|
}, {
|
|
54
60
|
content: f(() => [
|
|
55
|
-
|
|
56
|
-
v(
|
|
61
|
+
d(t.$slots, "content", {}, () => [
|
|
62
|
+
x(v(e.content), 1)
|
|
57
63
|
])
|
|
58
64
|
]),
|
|
59
65
|
default: f(() => [
|
|
60
|
-
|
|
66
|
+
d(t.$slots, "default")
|
|
61
67
|
]),
|
|
62
68
|
_: 3
|
|
63
|
-
}, 8, ["content", "placement", "effect", "disabled", "show-after", "hide-after", "offset", "popper-style"]));
|
|
69
|
+
}, 8, ["content", "placement", "effect", "disabled", "show-after", "hide-after", "offset", "trigger", "enterable", "teleported", "append-to", "popper-style"]));
|
|
64
70
|
}
|
|
65
71
|
});
|
|
66
72
|
export {
|
|
67
|
-
|
|
73
|
+
k as _
|
|
68
74
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("vue"),U=require("element-plus"),L=require("./overlay-stack-DeKq7jZu.cjs"),j=1e3,z=t.defineComponent({name:"QyPopover",inheritAttrs:!1,__name:"index",props:{enterable:{type:Boolean,default:!0},teleported:{type:Boolean,default:!0},appendTo:{type:[String,Object],default:"body"},trigger:{type:String,default:"click"},placement:{type:String,default:"bottom"},effect:{type:String,default:"light"},width:{type:[Number,String],default:240},offset:{type:Number,default:12},showDelay:{type:Number,default:0},hideDelay:{type:Number,default:200},showArrow:{type:Boolean,default:!0},transition:{type:String,default:void 0},disabled:{type:Boolean,default:!1},open:{type:Boolean,default:void 0}},emits:["update:open","open-change","open","close"],setup(n,{expose:S,emit:q}){const o=n,f=q,i=t.computed(()=>o.open!==void 0),w=i.value&&o.open===!0&&!o.disabled,d=t.ref(w),u=t.ref(w),k=t.ref(w),r=t.ref(null),E=t.computed(()=>o.disabled?!1:i.value?o.open===!0:d.value);let a;const b=`qy-popover-${t.getCurrentInstance().uid}`;let c=!1,s;const T=t.computed(()=>typeof o.width=="number"?`${o.width}px`:o.width),C=t.computed(()=>({"--qy-popover-width":T.value,"--qy-popover-mobile-gutter":"24px"})),y=t.useSlots(),N=t.computed(()=>{var e;return((e=y.reference)==null?void 0:e.call(y))??[]});function h(){a&&(clearTimeout(a),a=void 0),r.value=null}function P(e){a&&clearTimeout(a),a=setTimeout(()=>{a=void 0,r.value===e&&(r.value=null)},j)}function l(){if(c)return;const e=E.value;u.value!==e&&(c=!0,s=e,u.value=e)}function p(e){if(!(e&&o.disabled)){if(!i.value){if(d.value===e)return;d.value=e,f("update:open",e),l();return}r.value!==e&&(r.value===null&&o.open===e||(r.value=e,P(e),f("update:open",e),l()))}}function A(e){e===u.value&&(!c||s!==e||(c=!1,s=void 0,e!==k.value&&(k.value=e,r.value===e&&h(),f("open-change",e),f(e?"open":"close"),l())))}function I(e){p(e),l()}function O(){A(!0)}function W(){A(!1)}function $(){p(!1)}const g=new WeakSet;function B(e){if(e.key!=="Escape"&&e.code!=="Escape"||!u.value||e.defaultPrevented)return;const m=document.querySelector(`.${b}`);L.isTopmostVisibleLayer(m)&&(L.claimOverlayEscape(e),g.add(e))}function v(e){g.has(e)&&(g.delete(e),e.stopPropagation(),!e.defaultPrevented&&(e.preventDefault(),e.stopImmediatePropagation(),p(!1),l()))}return t.watch(E,()=>l()),t.watch(i,e=>{h(),e?d.value=o.open===!0:d.value=u.value,l()}),t.watch(()=>o.open,(e,m)=>{!i.value||r.value===null||(e===r.value||e!==m)&&h()}),t.watch(()=>o.disabled,e=>{e?p(!1):l()}),t.onBeforeUnmount(()=>{window.removeEventListener("keydown",B,!0),document.body.removeEventListener("keydown",v),window.removeEventListener("keydown",v),c=!1,s=void 0,a&&clearTimeout(a)}),t.onMounted(()=>{window.addEventListener("keydown",B,!0),document.body.addEventListener("keydown",v),window.addEventListener("keydown",v)}),S({close:$}),(e,m)=>(t.openBlock(),t.createBlock(t.unref(U.ElPopover),{visible:u.value,trigger:n.trigger,placement:n.placement,effect:n.effect,width:n.width,offset:n.offset,"show-after":n.showDelay,"hide-after":n.hideDelay,"show-arrow":n.showArrow,transition:n.transition,disabled:n.disabled,enterable:n.enterable,teleported:n.teleported,"append-to":n.appendTo,"popper-style":C.value,"popper-class":`qy-popover-popper ${b}`,"onUpdate:visible":I,onAfterEnter:O,onAfterLeave:W},{reference:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(N.value,(D,K)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(D),{key:D.key??K}))),128))]),default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},8,["visible","trigger","placement","effect","width","offset","show-after","hide-after","show-arrow","transition","disabled","enterable","teleported","append-to","popper-style","popper-class"]))}});exports._sfc_main=z;
|