@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
|
@@ -17,7 +17,8 @@ const Z = /* @__PURE__ */ S({
|
|
|
17
17
|
disabledDate: { type: Function, default: void 0 },
|
|
18
18
|
shortcuts: { default: void 0 },
|
|
19
19
|
clearable: { type: Boolean, default: !0 },
|
|
20
|
-
|
|
20
|
+
validateEvent: { type: Boolean, default: !0 },
|
|
21
|
+
disabled: { type: Boolean, default: void 0 },
|
|
21
22
|
readonly: { type: Boolean },
|
|
22
23
|
size: { default: void 0 },
|
|
23
24
|
teleported: { type: Boolean, default: !0 },
|
|
@@ -26,20 +27,20 @@ const Z = /* @__PURE__ */ S({
|
|
|
26
27
|
normalizeRangeEndTime: { type: Boolean, default: !1 }
|
|
27
28
|
},
|
|
28
29
|
emits: ["update:modelValue", "change", "clear", "calendar-change", "panel-change", "visible-change", "focus", "blur"],
|
|
29
|
-
setup(
|
|
30
|
-
const
|
|
31
|
-
() => ["qy-date-picker__popper",
|
|
30
|
+
setup(t, { expose: p, emit: m }) {
|
|
31
|
+
const c = t, l = m, g = A(), u = M(null), y = q(
|
|
32
|
+
() => ["qy-date-picker__popper", c.popperClass].filter(Boolean).join(" ")
|
|
32
33
|
);
|
|
33
|
-
function
|
|
34
|
+
function v(e) {
|
|
34
35
|
return Array.isArray(e);
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
+
function b(e) {
|
|
37
38
|
if (e.getHours() !== 0 || e.getMinutes() !== 0 || e.getSeconds() !== 0 || e.getMilliseconds() !== 0)
|
|
38
39
|
return e;
|
|
39
40
|
const a = new Date(e);
|
|
40
41
|
return a.setHours(23, 59, 59, 0), a;
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
+
function C(e) {
|
|
43
44
|
const a = e.match(
|
|
44
45
|
/(T| )00:00:00(\.000)?(Z|[+-]\d{2}:?\d{2})?$/
|
|
45
46
|
);
|
|
@@ -48,21 +49,21 @@ const Z = /* @__PURE__ */ S({
|
|
|
48
49
|
`${a[1]}23:59:59${a[2] ?? ""}${a[3] ?? ""}`
|
|
49
50
|
) : e;
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
-
if (!
|
|
52
|
+
function s(e) {
|
|
53
|
+
if (!c.normalizeRangeEndTime || !v(e) || e.length < 2)
|
|
53
54
|
return e;
|
|
54
55
|
const a = e[1];
|
|
55
|
-
let
|
|
56
|
-
if (a instanceof Date ?
|
|
56
|
+
let n = a;
|
|
57
|
+
if (a instanceof Date ? n = b(a) : typeof a == "string" && (n = C(a)), n === a)
|
|
57
58
|
return e;
|
|
58
59
|
const f = [...e];
|
|
59
|
-
return f[1] =
|
|
60
|
+
return f[1] = n, f;
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
-
l("update:modelValue",
|
|
62
|
+
function P(e) {
|
|
63
|
+
l("update:modelValue", s(e));
|
|
63
64
|
}
|
|
64
65
|
function V(e) {
|
|
65
|
-
l("change",
|
|
66
|
+
l("change", s(e));
|
|
66
67
|
}
|
|
67
68
|
function z() {
|
|
68
69
|
l("clear");
|
|
@@ -70,27 +71,27 @@ const Z = /* @__PURE__ */ S({
|
|
|
70
71
|
function B(e) {
|
|
71
72
|
l("calendar-change", e);
|
|
72
73
|
}
|
|
73
|
-
function $(e, a,
|
|
74
|
-
if (
|
|
74
|
+
function $(e, a, n) {
|
|
75
|
+
if (n === void 0) {
|
|
75
76
|
l("panel-change", e, a);
|
|
76
77
|
return;
|
|
77
78
|
}
|
|
78
|
-
l("panel-change", e, a,
|
|
79
|
+
l("panel-change", e, a, n);
|
|
79
80
|
}
|
|
80
81
|
function k(e) {
|
|
81
82
|
l("visible-change", e);
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
+
function E(e) {
|
|
84
85
|
l("focus", e);
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
+
function D(e) {
|
|
87
88
|
l("blur", e);
|
|
88
89
|
}
|
|
89
|
-
function
|
|
90
|
+
function R() {
|
|
90
91
|
var e, a;
|
|
91
92
|
(a = (e = u.value) == null ? void 0 : e.focus) == null || a.call(e);
|
|
92
93
|
}
|
|
93
|
-
function
|
|
94
|
+
function T() {
|
|
94
95
|
var e, a;
|
|
95
96
|
(a = (e = u.value) == null ? void 0 : e.blur) == null || a.call(e);
|
|
96
97
|
}
|
|
@@ -103,8 +104,8 @@ const Z = /* @__PURE__ */ S({
|
|
|
103
104
|
(a = (e = u.value) == null ? void 0 : e.handleClose) == null || a.call(e);
|
|
104
105
|
}
|
|
105
106
|
return p({
|
|
106
|
-
focus:
|
|
107
|
-
blur:
|
|
107
|
+
focus: R,
|
|
108
|
+
blur: T,
|
|
108
109
|
open: x,
|
|
109
110
|
close: F
|
|
110
111
|
}), (e, a) => (H(), U(h(w), j({
|
|
@@ -112,53 +113,54 @@ const Z = /* @__PURE__ */ S({
|
|
|
112
113
|
ref: u,
|
|
113
114
|
class: "qy-date-picker"
|
|
114
115
|
}, h(g), {
|
|
115
|
-
"model-value":
|
|
116
|
-
type:
|
|
117
|
-
placeholder:
|
|
118
|
-
"start-placeholder":
|
|
119
|
-
"end-placeholder":
|
|
120
|
-
"range-separator":
|
|
121
|
-
format:
|
|
122
|
-
"value-format":
|
|
123
|
-
"default-time":
|
|
124
|
-
"disabled-date":
|
|
125
|
-
shortcuts:
|
|
126
|
-
clearable:
|
|
127
|
-
disabled:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
116
|
+
"model-value": t.modelValue,
|
|
117
|
+
type: t.type,
|
|
118
|
+
placeholder: t.placeholder,
|
|
119
|
+
"start-placeholder": t.startPlaceholder,
|
|
120
|
+
"end-placeholder": t.endPlaceholder,
|
|
121
|
+
"range-separator": t.rangeSeparator,
|
|
122
|
+
format: t.format,
|
|
123
|
+
"value-format": t.valueFormat,
|
|
124
|
+
"default-time": t.defaultTime,
|
|
125
|
+
"disabled-date": t.disabledDate,
|
|
126
|
+
shortcuts: t.shortcuts,
|
|
127
|
+
clearable: t.clearable,
|
|
128
|
+
disabled: t.disabled,
|
|
129
|
+
"validate-event": t.validateEvent,
|
|
130
|
+
readonly: t.readonly,
|
|
131
|
+
size: t.size,
|
|
132
|
+
teleported: t.teleported,
|
|
133
|
+
"append-to": t.appendTo,
|
|
132
134
|
"popper-class": y.value,
|
|
133
|
-
"onUpdate:modelValue":
|
|
135
|
+
"onUpdate:modelValue": P,
|
|
134
136
|
onChange: V,
|
|
135
137
|
onClear: z,
|
|
136
138
|
onCalendarChange: B,
|
|
137
139
|
onPanelChange: $,
|
|
138
140
|
onVisibleChange: k,
|
|
139
|
-
onFocus:
|
|
140
|
-
onBlur:
|
|
141
|
+
onFocus: E,
|
|
142
|
+
onBlur: D
|
|
141
143
|
}), {
|
|
142
|
-
default: o((
|
|
143
|
-
r(e.$slots, "default", d(i(
|
|
144
|
+
default: o((n) => [
|
|
145
|
+
r(e.$slots, "default", d(i(n)))
|
|
144
146
|
]),
|
|
145
|
-
"range-separator": o((
|
|
146
|
-
r(e.$slots, "range-separator", d(i(
|
|
147
|
+
"range-separator": o((n) => [
|
|
148
|
+
r(e.$slots, "range-separator", d(i(n)))
|
|
147
149
|
]),
|
|
148
|
-
"prev-month": o((
|
|
149
|
-
r(e.$slots, "prev-month", d(i(
|
|
150
|
+
"prev-month": o((n) => [
|
|
151
|
+
r(e.$slots, "prev-month", d(i(n)))
|
|
150
152
|
]),
|
|
151
|
-
"next-month": o((
|
|
152
|
-
r(e.$slots, "next-month", d(i(
|
|
153
|
+
"next-month": o((n) => [
|
|
154
|
+
r(e.$slots, "next-month", d(i(n)))
|
|
153
155
|
]),
|
|
154
|
-
"prev-year": o((
|
|
155
|
-
r(e.$slots, "prev-year", d(i(
|
|
156
|
+
"prev-year": o((n) => [
|
|
157
|
+
r(e.$slots, "prev-year", d(i(n)))
|
|
156
158
|
]),
|
|
157
|
-
"next-year": o((
|
|
158
|
-
r(e.$slots, "next-year", d(i(
|
|
159
|
+
"next-year": o((n) => [
|
|
160
|
+
r(e.$slots, "next-year", d(i(n)))
|
|
159
161
|
]),
|
|
160
162
|
_: 3
|
|
161
|
-
}, 16, ["model-value", "type", "placeholder", "start-placeholder", "end-placeholder", "range-separator", "format", "value-format", "default-time", "disabled-date", "shortcuts", "clearable", "disabled", "readonly", "size", "teleported", "append-to", "popper-class"]));
|
|
163
|
+
}, 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"]));
|
|
162
164
|
}
|
|
163
165
|
});
|
|
164
166
|
export {
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { defineComponent as M, computed as f, ref as y, getCurrentInstance as Q, useSlots as R, watch as w, onBeforeUnmount as G, onMounted as H, openBlock as k, createBlock as q, unref as J, withCtx as C, renderSlot as X, createElementBlock as Y, Fragment as Z, renderList as x, resolveDynamicComponent as V } from "vue";
|
|
2
|
+
import { ElPopover as _ } from "element-plus";
|
|
3
|
+
import { i as ee, c as te } from "./overlay-stack-CFFRngnU.mjs";
|
|
4
|
+
const ne = 1e3, le = /* @__PURE__ */ M({
|
|
5
|
+
name: "QyPopover",
|
|
6
|
+
inheritAttrs: !1,
|
|
7
|
+
__name: "index",
|
|
8
|
+
props: {
|
|
9
|
+
enterable: { type: Boolean, default: !0 },
|
|
10
|
+
teleported: { type: Boolean, default: !0 },
|
|
11
|
+
appendTo: { type: [String, Object], default: "body" },
|
|
12
|
+
trigger: { type: String, default: "click" },
|
|
13
|
+
placement: { type: String, default: "bottom" },
|
|
14
|
+
effect: { type: String, default: "light" },
|
|
15
|
+
width: { type: [Number, String], default: 240 },
|
|
16
|
+
offset: { type: Number, default: 12 },
|
|
17
|
+
showDelay: { type: Number, default: 0 },
|
|
18
|
+
hideDelay: { type: Number, default: 200 },
|
|
19
|
+
showArrow: { type: Boolean, default: !0 },
|
|
20
|
+
transition: { type: String, default: void 0 },
|
|
21
|
+
disabled: { type: Boolean, default: !1 },
|
|
22
|
+
open: { type: Boolean, default: void 0 }
|
|
23
|
+
},
|
|
24
|
+
emits: ["update:open", "open-change", "open", "close"],
|
|
25
|
+
setup(t, { expose: N, emit: I }) {
|
|
26
|
+
const n = t, s = I, i = f(() => n.open !== void 0), h = i.value && n.open === !0 && !n.disabled, u = y(h), l = y(h), A = y(h), o = y(null), D = f(() => n.disabled ? !1 : i.value ? n.open === !0 : u.value);
|
|
27
|
+
let r;
|
|
28
|
+
const L = `qy-popover-${Q().uid}`;
|
|
29
|
+
let d = !1, c;
|
|
30
|
+
const P = f(
|
|
31
|
+
() => typeof n.width == "number" ? `${n.width}px` : n.width
|
|
32
|
+
), O = f(() => ({
|
|
33
|
+
"--qy-popover-width": P.value,
|
|
34
|
+
"--qy-popover-mobile-gutter": "24px"
|
|
35
|
+
})), g = R(), W = f(
|
|
36
|
+
() => {
|
|
37
|
+
var e;
|
|
38
|
+
return ((e = g.reference) == null ? void 0 : e.call(g)) ?? [];
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
function E() {
|
|
42
|
+
r && (clearTimeout(r), r = void 0), o.value = null;
|
|
43
|
+
}
|
|
44
|
+
function $(e) {
|
|
45
|
+
r && clearTimeout(r), r = setTimeout(() => {
|
|
46
|
+
r = void 0, o.value === e && (o.value = null);
|
|
47
|
+
}, ne);
|
|
48
|
+
}
|
|
49
|
+
function a() {
|
|
50
|
+
if (d) return;
|
|
51
|
+
const e = D.value;
|
|
52
|
+
l.value !== e && (d = !0, c = e, l.value = e);
|
|
53
|
+
}
|
|
54
|
+
function p(e) {
|
|
55
|
+
if (!(e && n.disabled)) {
|
|
56
|
+
if (!i.value) {
|
|
57
|
+
if (u.value === e) return;
|
|
58
|
+
u.value = e, s("update:open", e), a();
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
o.value !== e && (o.value === null && n.open === e || (o.value = e, $(e), s("update:open", e), a()));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function S(e) {
|
|
65
|
+
e === l.value && (!d || c !== e || (d = !1, c = void 0, e !== A.value && (A.value = e, o.value === e && E(), s("open-change", e), s(e ? "open" : "close"), a())));
|
|
66
|
+
}
|
|
67
|
+
function K(e) {
|
|
68
|
+
p(e), a();
|
|
69
|
+
}
|
|
70
|
+
function U() {
|
|
71
|
+
S(!0);
|
|
72
|
+
}
|
|
73
|
+
function j() {
|
|
74
|
+
S(!1);
|
|
75
|
+
}
|
|
76
|
+
function z() {
|
|
77
|
+
p(!1);
|
|
78
|
+
}
|
|
79
|
+
const b = /* @__PURE__ */ new WeakSet();
|
|
80
|
+
function T(e) {
|
|
81
|
+
if (e.key !== "Escape" && e.code !== "Escape" || !l.value || e.defaultPrevented) return;
|
|
82
|
+
const m = document.querySelector(`.${L}`);
|
|
83
|
+
ee(m) && (te(e), b.add(e));
|
|
84
|
+
}
|
|
85
|
+
function v(e) {
|
|
86
|
+
b.has(e) && (b.delete(e), e.stopPropagation(), !e.defaultPrevented && (e.preventDefault(), e.stopImmediatePropagation(), p(!1), a()));
|
|
87
|
+
}
|
|
88
|
+
return w(
|
|
89
|
+
D,
|
|
90
|
+
() => a()
|
|
91
|
+
), w(i, (e) => {
|
|
92
|
+
E(), e ? u.value = n.open === !0 : u.value = l.value, a();
|
|
93
|
+
}), w(
|
|
94
|
+
() => n.open,
|
|
95
|
+
(e, m) => {
|
|
96
|
+
!i.value || o.value === null || (e === o.value || e !== m) && E();
|
|
97
|
+
}
|
|
98
|
+
), w(
|
|
99
|
+
() => n.disabled,
|
|
100
|
+
(e) => {
|
|
101
|
+
e ? p(!1) : a();
|
|
102
|
+
}
|
|
103
|
+
), G(() => {
|
|
104
|
+
window.removeEventListener("keydown", T, !0), document.body.removeEventListener("keydown", v), window.removeEventListener("keydown", v), d = !1, c = void 0, r && clearTimeout(r);
|
|
105
|
+
}), H(() => {
|
|
106
|
+
window.addEventListener("keydown", T, !0), document.body.addEventListener("keydown", v), window.addEventListener("keydown", v);
|
|
107
|
+
}), N({ close: z }), (e, m) => (k(), q(J(_), {
|
|
108
|
+
visible: l.value,
|
|
109
|
+
trigger: t.trigger,
|
|
110
|
+
placement: t.placement,
|
|
111
|
+
effect: t.effect,
|
|
112
|
+
width: t.width,
|
|
113
|
+
offset: t.offset,
|
|
114
|
+
"show-after": t.showDelay,
|
|
115
|
+
"hide-after": t.hideDelay,
|
|
116
|
+
"show-arrow": t.showArrow,
|
|
117
|
+
transition: t.transition,
|
|
118
|
+
disabled: t.disabled,
|
|
119
|
+
enterable: t.enterable,
|
|
120
|
+
teleported: t.teleported,
|
|
121
|
+
"append-to": t.appendTo,
|
|
122
|
+
"popper-style": O.value,
|
|
123
|
+
"popper-class": `qy-popover-popper ${L}`,
|
|
124
|
+
"onUpdate:visible": K,
|
|
125
|
+
onAfterEnter: U,
|
|
126
|
+
onAfterLeave: j
|
|
127
|
+
}, {
|
|
128
|
+
reference: C(() => [
|
|
129
|
+
(k(!0), Y(Z, null, x(W.value, (B, F) => (k(), q(V(B), {
|
|
130
|
+
key: B.key ?? F
|
|
131
|
+
}))), 128))
|
|
132
|
+
]),
|
|
133
|
+
default: C(() => [
|
|
134
|
+
X(e.$slots, "default")
|
|
135
|
+
]),
|
|
136
|
+
_: 3
|
|
137
|
+
}, 8, ["visible", "trigger", "placement", "effect", "width", "offset", "show-after", "hide-after", "show-arrow", "transition", "disabled", "enterable", "teleported", "append-to", "popper-style", "popper-class"]));
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
export {
|
|
141
|
+
le as _
|
|
142
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const l = /* @__PURE__ */ new WeakSet();
|
|
2
|
+
function n(t) {
|
|
3
|
+
l.add(t);
|
|
4
|
+
}
|
|
5
|
+
function s(t) {
|
|
6
|
+
return l.has(t);
|
|
7
|
+
}
|
|
8
|
+
function o(t) {
|
|
9
|
+
return Array.from(document.querySelectorAll(".el-overlay, .el-popper, .el-image-viewer__wrapper")).filter((r) => {
|
|
10
|
+
const e = getComputedStyle(r);
|
|
11
|
+
return e.display !== "none" && e.visibility !== "hidden" && r.getAttribute("aria-hidden") !== "true";
|
|
12
|
+
}).sort(
|
|
13
|
+
(r, e) => (Number.parseInt(getComputedStyle(r).zIndex, 10) || 0) - (Number.parseInt(getComputedStyle(e).zIndex, 10) || 0)
|
|
14
|
+
).at(-1) === t;
|
|
15
|
+
}
|
|
16
|
+
function p(t, a = 0) {
|
|
17
|
+
const r = typeof document > "u" ? [] : Array.from(
|
|
18
|
+
document.querySelectorAll(".el-overlay, .el-image-viewer__wrapper, .el-popper")
|
|
19
|
+
).filter((e) => {
|
|
20
|
+
const i = getComputedStyle(e);
|
|
21
|
+
return i.display !== "none" && i.visibility !== "hidden" && e.getAttribute("aria-hidden") !== "true";
|
|
22
|
+
});
|
|
23
|
+
return Math.max(
|
|
24
|
+
t,
|
|
25
|
+
Number.isFinite(a) ? a : 0,
|
|
26
|
+
...r.map((e) => (Number.parseInt(getComputedStyle(e).zIndex, 10) || 0) + 1)
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
s as a,
|
|
31
|
+
n as c,
|
|
32
|
+
o as i,
|
|
33
|
+
p as r
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=new WeakSet;function n(t){l.add(t)}function s(t){return l.has(t)}function o(t){return Array.from(document.querySelectorAll(".el-overlay, .el-popper, .el-image-viewer__wrapper")).filter(r=>{const e=getComputedStyle(r);return e.display!=="none"&&e.visibility!=="hidden"&&r.getAttribute("aria-hidden")!=="true"}).sort((r,e)=>(Number.parseInt(getComputedStyle(r).zIndex,10)||0)-(Number.parseInt(getComputedStyle(e).zIndex,10)||0)).at(-1)===t}function p(t,i=0){const r=typeof document>"u"?[]:Array.from(document.querySelectorAll(".el-overlay, .el-image-viewer__wrapper, .el-popper")).filter(e=>{const a=getComputedStyle(e);return a.display!=="none"&&a.visibility!=="hidden"&&e.getAttribute("aria-hidden")!=="true"});return Math.max(t,Number.isFinite(i)?i:0,...r.map(e=>(Number.parseInt(getComputedStyle(e).zIndex,10)||0)+1))}exports.claimOverlayEscape=n;exports.isOverlayEscapeClaimed=s;exports.isTopmostVisibleLayer=o;exports.resolveOverlayZIndex=p;
|
|
@@ -1,34 +1,45 @@
|
|
|
1
|
-
import { h as
|
|
2
|
-
import { ElImageViewer as
|
|
3
|
-
|
|
1
|
+
import { h as v, createApp as I } from "vue";
|
|
2
|
+
import { useZIndex as b, ElImageViewer as _ } from "element-plus";
|
|
3
|
+
import { r as R } from "./overlay-stack-CFFRngnU.mjs";
|
|
4
|
+
let p = 0, w = "";
|
|
5
|
+
function E() {
|
|
6
|
+
if (typeof document > "u") return () => {
|
|
7
|
+
};
|
|
8
|
+
p++ === 0 && (w = document.body.style.overflow, document.body.style.overflow = "hidden");
|
|
9
|
+
let e = !1;
|
|
10
|
+
return () => {
|
|
11
|
+
e || (e = !0, --p === 0 && (document.body.style.overflow = w));
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
const m = Symbol.for("qynpm.image-preview.runtime");
|
|
4
15
|
function c() {
|
|
5
16
|
const e = globalThis;
|
|
6
|
-
return e[
|
|
17
|
+
return e[m] || (e[m] = {
|
|
7
18
|
snapshot: null,
|
|
8
19
|
activeToken: null,
|
|
9
20
|
activeClose: null,
|
|
10
21
|
transitionDepth: 0
|
|
11
|
-
}), e[
|
|
22
|
+
}), e[m];
|
|
12
23
|
}
|
|
13
|
-
const
|
|
24
|
+
const S = {
|
|
14
25
|
w: 200,
|
|
15
26
|
h: 200,
|
|
16
27
|
q: 50
|
|
17
28
|
};
|
|
18
|
-
function
|
|
29
|
+
function h(e) {
|
|
19
30
|
const t = String(e || "").trim();
|
|
20
31
|
return t ? t.includes("ys.diansan.com") ? t.replace(/^http:\/\//, "https://").replace("ys.diansan.com", "admin.qiyinbz.com") : t : "";
|
|
21
32
|
}
|
|
22
|
-
function
|
|
33
|
+
function x(e, t = !0) {
|
|
23
34
|
const r = String(e || "").trim();
|
|
24
35
|
if (!r) return "";
|
|
25
|
-
const n =
|
|
36
|
+
const n = h(r);
|
|
26
37
|
if (!t) return n;
|
|
27
|
-
const o =
|
|
38
|
+
const o = y(t);
|
|
28
39
|
return r.includes("ys.diansan.com") ? `${n}?small=true&style=image/resize,h_${o.h},w_${o.w}` : `${n}?w=${o.w}`;
|
|
29
40
|
}
|
|
30
|
-
async function
|
|
31
|
-
const r =
|
|
41
|
+
async function Q(e, t = {}) {
|
|
42
|
+
const r = h(e);
|
|
32
43
|
if (!r) throw new Error("图片地址不能为空");
|
|
33
44
|
const n = t.compressor ?? !0;
|
|
34
45
|
if (!n)
|
|
@@ -36,58 +47,60 @@ async function x(e, t = {}) {
|
|
|
36
47
|
src: r,
|
|
37
48
|
source: "original"
|
|
38
49
|
};
|
|
39
|
-
const o =
|
|
50
|
+
const o = x(e, n), a = t.loadBlob ?? k, i = t.compressBlob ?? M;
|
|
40
51
|
try {
|
|
41
52
|
return await a(o), {
|
|
42
53
|
src: o,
|
|
43
54
|
source: "thumbnail"
|
|
44
55
|
};
|
|
45
56
|
} catch {
|
|
46
|
-
const
|
|
57
|
+
const u = await a(r);
|
|
47
58
|
return {
|
|
48
|
-
src: await i(
|
|
59
|
+
src: await i(u, y(n)),
|
|
49
60
|
source: "fallback"
|
|
50
61
|
};
|
|
51
62
|
}
|
|
52
63
|
}
|
|
53
|
-
function
|
|
64
|
+
function L(e = {}) {
|
|
54
65
|
if (typeof document > "u") return { close() {
|
|
55
66
|
} };
|
|
56
|
-
const t =
|
|
67
|
+
const t = P(e.urlList, e.url);
|
|
57
68
|
if (!t.length) return { close() {
|
|
58
69
|
} };
|
|
59
|
-
const r = globalThis.__QY_IMAGE_PREVIEW_CREATE_APP__ ??
|
|
70
|
+
const r = globalThis.__QY_IMAGE_PREVIEW_CREATE_APP__ ?? I, n = document.createElement("div"), o = E();
|
|
60
71
|
let a = !1, i;
|
|
61
|
-
const
|
|
62
|
-
s.snapshot =
|
|
63
|
-
const
|
|
64
|
-
var
|
|
65
|
-
a || (a = !0, s.activeToken ===
|
|
72
|
+
const u = { urlList: [...t], initialIndex: e.initialIndex ?? 0, hideOnClickModal: e.hideOnClickModal ?? !0 }, s = c(), f = {};
|
|
73
|
+
s.snapshot = u, s.activeToken = f;
|
|
74
|
+
const d = () => {
|
|
75
|
+
var l;
|
|
76
|
+
a || (a = !0, s.activeToken === f && (s.activeToken = null, s.activeClose = null, s.transitionDepth === 0 && (s.snapshot = null)), o(), (l = i == null ? void 0 : i.unmount) == null || l.call(i), n.parentNode && n.parentNode.removeChild(n));
|
|
66
77
|
};
|
|
67
|
-
return document.body.appendChild(n),
|
|
78
|
+
return document.body.appendChild(n), i = r({
|
|
68
79
|
setup() {
|
|
69
|
-
|
|
80
|
+
const l = R(b().nextZIndex());
|
|
81
|
+
return () => v(_, {
|
|
82
|
+
zIndex: l,
|
|
70
83
|
urlList: t,
|
|
71
84
|
initialIndex: e.initialIndex ?? 0,
|
|
72
85
|
hideOnClickModal: e.hideOnClickModal ?? !0,
|
|
73
86
|
teleported: !0,
|
|
74
|
-
onClose:
|
|
87
|
+
onClose: d
|
|
75
88
|
});
|
|
76
89
|
}
|
|
77
|
-
}), i.mount(n), s.activeClose =
|
|
90
|
+
}), i.mount(n), s.activeClose = d, { close: d };
|
|
78
91
|
}
|
|
79
|
-
function
|
|
92
|
+
function T() {
|
|
80
93
|
const e = c().snapshot;
|
|
81
94
|
return e ? { ...e, urlList: [...e.urlList] } : null;
|
|
82
95
|
}
|
|
83
|
-
function
|
|
96
|
+
function g(e) {
|
|
84
97
|
const t = c();
|
|
85
98
|
if (!(!e || t.activeToken))
|
|
86
|
-
return
|
|
99
|
+
return L(e);
|
|
87
100
|
}
|
|
88
|
-
const
|
|
89
|
-
getSnapshot:
|
|
90
|
-
restore:
|
|
101
|
+
const C = {
|
|
102
|
+
getSnapshot: T,
|
|
103
|
+
restore: g,
|
|
91
104
|
beginRendererTransition() {
|
|
92
105
|
c().transitionDepth += 1;
|
|
93
106
|
},
|
|
@@ -95,54 +108,55 @@ const E = {
|
|
|
95
108
|
const e = c();
|
|
96
109
|
if (e.transitionDepth = Math.max(0, e.transitionDepth - 1), e.transitionDepth === 0 && e.snapshot) {
|
|
97
110
|
const t = { ...e.snapshot, urlList: [...e.snapshot.urlList] };
|
|
98
|
-
e.activeClose && (e.transitionDepth = 1, e.activeClose(), e.transitionDepth = 0),
|
|
111
|
+
e.activeClose && (e.transitionDepth = 1, e.activeClose(), e.transitionDepth = 0), g(t);
|
|
99
112
|
}
|
|
100
113
|
}
|
|
101
114
|
};
|
|
102
|
-
globalThis.__QY_IMAGE_PREVIEW_INTERNAL__ =
|
|
103
|
-
function
|
|
115
|
+
globalThis.__QY_IMAGE_PREVIEW_INTERNAL__ = C;
|
|
116
|
+
function y(e) {
|
|
104
117
|
return {
|
|
105
|
-
...
|
|
118
|
+
...S,
|
|
106
119
|
...typeof e == "object" ? e : {}
|
|
107
120
|
};
|
|
108
121
|
}
|
|
109
|
-
function
|
|
110
|
-
return (Array.isArray(e) ? e : [t]).map((n) =>
|
|
122
|
+
function P(e, t) {
|
|
123
|
+
return (Array.isArray(e) ? e : [t]).map((n) => h(n)).filter(Boolean);
|
|
111
124
|
}
|
|
112
|
-
async function
|
|
125
|
+
async function k(e) {
|
|
113
126
|
const t = await fetch(e, { redirect: "follow" });
|
|
114
127
|
if (!t.ok) throw new Error(e);
|
|
115
128
|
return t.blob();
|
|
116
129
|
}
|
|
117
|
-
async function
|
|
130
|
+
async function M(e, t) {
|
|
118
131
|
if (typeof document > "u" || typeof Image > "u")
|
|
119
|
-
return
|
|
132
|
+
return A(e);
|
|
120
133
|
const r = URL.createObjectURL(e);
|
|
121
134
|
try {
|
|
122
|
-
const n = await
|
|
135
|
+
const n = await D(r), o = document.createElement("canvas"), a = O(n, t);
|
|
123
136
|
return o.width = Math.max(1, Math.round(n.naturalWidth * a)), o.height = Math.max(1, Math.round(n.naturalHeight * a)), o.getContext("2d").drawImage(n, 0, 0, o.width, o.height), o.toDataURL(e.type || "image/jpeg", t.q / 100);
|
|
124
137
|
} finally {
|
|
125
138
|
URL.revokeObjectURL(r);
|
|
126
139
|
}
|
|
127
140
|
}
|
|
128
|
-
function
|
|
141
|
+
function D(e) {
|
|
129
142
|
return new Promise((t, r) => {
|
|
130
143
|
const n = new Image();
|
|
131
144
|
n.onload = () => t(n), n.onerror = r, n.src = e;
|
|
132
145
|
});
|
|
133
146
|
}
|
|
134
|
-
function
|
|
147
|
+
function O(e, t) {
|
|
135
148
|
const r = t.w ? t.w / e.naturalWidth : 1, n = t.h ? t.h / e.naturalHeight : 1;
|
|
136
149
|
return Math.min(1, r, n);
|
|
137
150
|
}
|
|
138
|
-
function
|
|
151
|
+
function A(e) {
|
|
139
152
|
return new Promise((t, r) => {
|
|
140
153
|
const n = new FileReader();
|
|
141
154
|
n.onloadend = () => t(n.result), n.onerror = r, n.readAsDataURL(e);
|
|
142
155
|
});
|
|
143
156
|
}
|
|
144
157
|
export {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
158
|
+
E as a,
|
|
159
|
+
h as n,
|
|
160
|
+
L as o,
|
|
161
|
+
Q as r
|
|
148
162
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const w=require("vue"),g=require("element-plus"),R=require("./overlay-stack-DeKq7jZu.cjs");let p=0,v="";function I(){if(typeof document>"u")return()=>{};p++===0&&(v=document.body.style.overflow,document.body.style.overflow="hidden");let e=!1;return()=>{e||(e=!0,--p===0&&(document.body.style.overflow=v))}}const h=Symbol.for("qynpm.image-preview.runtime");function c(){const e=globalThis;return e[h]||(e[h]={snapshot:null,activeToken:null,activeClose:null,transitionDepth:0}),e[h]}const S={w:200,h:200,q:50};function u(e){const t=String(e||"").trim();return t?t.includes("ys.diansan.com")?t.replace(/^http:\/\//,"https://").replace("ys.diansan.com","admin.qiyinbz.com"):t:""}function E(e,t=!0){const r=String(e||"").trim();if(!r)return"";const n=u(r);if(!t)return n;const o=_(t);return r.includes("ys.diansan.com")?`${n}?small=true&style=image/resize,h_${o.h},w_${o.w}`:`${n}?w=${o.w}`}async function P(e,t={}){const r=u(e);if(!r)throw new Error("图片地址不能为空");const n=t.compressor??!0;if(!n)return{src:r,source:"original"};const o=E(e,n),a=t.loadBlob??x,i=t.compressBlob??C;try{return await a(o),{src:o,source:"thumbnail"}}catch{const d=await a(r);return{src:await i(d,_(n)),source:"fallback"}}}function b(e={}){if(typeof document>"u")return{close(){}};const t=T(e.urlList,e.url);if(!t.length)return{close(){}};const r=globalThis.__QY_IMAGE_PREVIEW_CREATE_APP__??w.createApp,n=document.createElement("div"),o=I();let a=!1,i;const d={urlList:[...t],initialIndex:e.initialIndex??0,hideOnClickModal:e.hideOnClickModal??!0},s=c(),f={};s.snapshot=d,s.activeToken=f;const m=()=>{var l;a||(a=!0,s.activeToken===f&&(s.activeToken=null,s.activeClose=null,s.transitionDepth===0&&(s.snapshot=null)),o(),(l=i==null?void 0:i.unmount)==null||l.call(i),n.parentNode&&n.parentNode.removeChild(n))};return document.body.appendChild(n),i=r({setup(){const l=R.resolveOverlayZIndex(g.useZIndex().nextZIndex());return()=>w.h(g.ElImageViewer,{zIndex:l,urlList:t,initialIndex:e.initialIndex??0,hideOnClickModal:e.hideOnClickModal??!0,teleported:!0,onClose:m})}}),i.mount(n),s.activeClose=m,{close:m}}function L(){const e=c().snapshot;return e?{...e,urlList:[...e.urlList]}:null}function y(e){const t=c();if(!(!e||t.activeToken))return b(e)}const k={getSnapshot:L,restore:y,beginRendererTransition(){c().transitionDepth+=1},endRendererTransition(){const e=c();if(e.transitionDepth=Math.max(0,e.transitionDepth-1),e.transitionDepth===0&&e.snapshot){const t={...e.snapshot,urlList:[...e.snapshot.urlList]};e.activeClose&&(e.transitionDepth=1,e.activeClose(),e.transitionDepth=0),y(t)}}};globalThis.__QY_IMAGE_PREVIEW_INTERNAL__=k;function _(e){return{...S,...typeof e=="object"?e:{}}}function T(e,t){return(Array.isArray(e)?e:[t]).map(n=>u(n)).filter(Boolean)}async function x(e){const t=await fetch(e,{redirect:"follow"});if(!t.ok)throw new Error(e);return t.blob()}async function C(e,t){if(typeof document>"u"||typeof Image>"u")return O(e);const r=URL.createObjectURL(e);try{const n=await D(r),o=document.createElement("canvas"),a=M(n,t);return o.width=Math.max(1,Math.round(n.naturalWidth*a)),o.height=Math.max(1,Math.round(n.naturalHeight*a)),o.getContext("2d").drawImage(n,0,0,o.width,o.height),o.toDataURL(e.type||"image/jpeg",t.q/100)}finally{URL.revokeObjectURL(r)}}function D(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>t(n),n.onerror=r,n.src=e})}function M(e,t){const r=t.w?t.w/e.naturalWidth:1,n=t.h?t.h/e.naturalHeight:1;return Math.min(1,r,n)}function O(e){return new Promise((t,r)=>{const n=new FileReader;n.onloadend=()=>t(n.result),n.onerror=r,n.readAsDataURL(e)})}exports.acquirePreviewScrollLock=I;exports.normalizeImageSrc=u;exports.openQyImagePreview=b;exports.resolveQyImageDisplaySrc=P;
|