hisonvue 1.1.7 → 1.1.8
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/dist/{HAccordion-BXzQTj-T.js → HAccordion-CcqP8KVN.js} +1 -1
- package/dist/{HAccordion-2BXGsG5B.mjs → HAccordion-DABKXdkp.mjs} +2 -2
- package/dist/{HBaggie-DP-oXbIt.js → HBaggie-Dc-KPRDG.js} +1 -1
- package/dist/{HBaggie-DbUnI6Cg.mjs → HBaggie-Dnq5t8un.mjs} +2 -2
- package/dist/{HBanner-C_RVokKc.js → HBanner-ClmYECkp.js} +1 -1
- package/dist/{HBanner-DS1wAGBj.mjs → HBanner-Cxl_X-Ui.mjs} +2 -2
- package/dist/{HButton-CJZsjgRh.mjs → HButton-BuJp6l32.mjs} +2 -2
- package/dist/{HButton-EmsUduJx.js → HButton-D7w35fAT.js} +1 -1
- package/dist/{HCalendar-BHuielDt.mjs → HCalendar-Cg1Ejr3b.mjs} +1 -1
- package/dist/{HCalendar-BQcg95QP.js → HCalendar-GfsTZV86.js} +1 -1
- package/dist/{HCaption-B_TLREQt.mjs → HCaption-BP0zpAoh.mjs} +1 -1
- package/dist/{HCaption-DnnfU-4f.js → HCaption-BZklN1hJ.js} +1 -1
- package/dist/{HChart-CPILy-I8.js → HChart-BoIsUY-U.js} +1 -1
- package/dist/{HChart-C9gfq-PC.mjs → HChart-ZHMznCxo.mjs} +1 -1
- package/dist/{HDrawer-tfvUaRKv.js → HDrawer-BdNXB7bZ.js} +1 -1
- package/dist/{HDrawer-D_kSIGBU.mjs → HDrawer-BfMsOIMU.mjs} +1 -1
- package/dist/{HDropdown-BjUvzvFC.js → HDropdown-CFFwgLxP.js} +1 -1
- package/dist/{HDropdown-BIPy8aU4.mjs → HDropdown-KwBejxH6.mjs} +2 -2
- package/dist/{HFileset-PW9YCJgS.js → HFileset-BVwhCpWk.js} +1 -1
- package/dist/{HFileset-BtK0nmzk.mjs → HFileset-NrFG7upU.mjs} +1 -1
- package/dist/{HGap-BbdxTgBt.js → HGap-D-OpGS6f.js} +1 -1
- package/dist/{HGap-CW02Hxpc.mjs → HGap-DQ7KNksh.mjs} +1 -1
- package/dist/{HGrid-CJ4-xVpR.mjs → HGrid-Dgv2QLud.mjs} +1 -1
- package/dist/{HGrid-olge21bD.js → HGrid-PEaylCn3.js} +1 -1
- package/dist/{HImagebox-AXcA-jAB.js → HImagebox-CVmax7-2.js} +1 -1
- package/dist/{HImagebox-FTiJuOTN.mjs → HImagebox-DGj7kyoL.mjs} +1 -1
- package/dist/{HInput-CZ11eUJB.js → HInput-CRyozCxo.js} +1 -1
- package/dist/{HInput-Cqo_Tfru.mjs → HInput-DzT-VAwv.mjs} +1 -1
- package/dist/{HInputGroup-zaJVW7RE.js → HInputGroup-CaYUBopI.js} +1 -1
- package/dist/{HInputGroup-SzCxRqaF.mjs → HInputGroup-CjBmNgV9.mjs} +1 -1
- package/dist/HLabel-BA2ph0V-.js +1 -0
- package/dist/{HLabel-DEVMDggG.mjs → HLabel-c8gR7-ur.mjs} +148 -131
- package/dist/{HLayout-Fh65aaVI.js → HLayout-Da1XBfUi.js} +1 -1
- package/dist/{HLayout-x_jVkIo4.mjs → HLayout-GazOMB2h.mjs} +1 -1
- package/dist/{HList-JIhEylRe.js → HList-B14zIkzR.js} +1 -1
- package/dist/{HList-V-fyd5fw.mjs → HList-tAOQaX_Q.mjs} +2 -2
- package/dist/{HModal-M0YUil9A.js → HModal-Boe8kpBb.js} +1 -1
- package/dist/{HModal-B7pME4H2.mjs → HModal-oGryjRSc.mjs} +1 -1
- package/dist/{HNote-HqNrL-U2.mjs → HNote-CZ02WSkW.mjs} +1 -1
- package/dist/{HNote-C5nujdV1.js → HNote-JSNpTQXQ.js} +1 -1
- package/dist/{HPagination-6aWyrTI-.js → HPagination-DlPSez0N.js} +1 -1
- package/dist/{HPagination-h8MaMUIE.mjs → HPagination-ZJZWJ7HP.mjs} +2 -2
- package/dist/HParagraph-BPtGEwa6.js +1 -0
- package/dist/{HParagraph-CP1IofM4.mjs → HParagraph-D0bGPbRd.mjs} +174 -157
- package/dist/{HPopup-Cj5IaN9N.js → HPopup-DhNEnDcR.js} +1 -1
- package/dist/{HPopup-DUnn4AIb.mjs → HPopup-Dv018FIN.mjs} +1 -1
- package/dist/{HSpinner-HdIJ62aF.js → HSpinner-BHcYPH5-.js} +1 -1
- package/dist/{HSpinner-bShjHynQ.mjs → HSpinner-Bvk7nkiS.mjs} +1 -1
- package/dist/{HTable-BuGAaqrq.mjs → HTable-C1ZdeMIP.mjs} +1 -1
- package/dist/{HTable-BgZ-XAZx.js → HTable-Dq_ySJrZ.js} +1 -1
- package/dist/hisonvue.cjs.js +1 -1
- package/dist/hisonvue.d.ts +58 -0
- package/dist/hisonvue.es.js +2 -2
- package/dist/{index-BU8h1J_W.mjs → index-9uY2HzIO.mjs} +1 -1
- package/dist/{index-BzCcaeiL.js → index-Cp0RZa-k.js} +1 -1
- package/dist/{setButtonCssEvent-Oy4ojn9y.js → setButtonCssEvent-CEQ0vsUw.js} +1 -1
- package/dist/{setButtonCssEvent-C-ESkC60.mjs → setButtonCssEvent-C_OU9wiq.mjs} +1 -1
- package/package.json +1 -1
- package/dist/HLabel-jZG7tY-0.js +0 -1
- package/dist/HParagraph-IvsIOdD1.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { a0 as
|
|
3
|
-
import { _ as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as we, ref as o, computed as a, useSlots as Be, Text as Se, onMounted as X, onBeforeUnmount as ke, watch as l, unref as Ae, nextTick as Ee, resolveComponent as Ie, createElementBlock as H, openBlock as K, normalizeClass as x, createCommentVNode as Y, createElementVNode as Le, renderSlot as N, createVNode as Ue, createSlots as Ve, withCtx as J, normalizeStyle as Re, Fragment as $e, createTextVNode as De, toDisplayString as Ne } from "vue";
|
|
2
|
+
import { a0 as Pe, B as Fe, f as G, a1 as He, a2 as Ke, T as xe, g as Ge, u as qe, w as ze, j as Me, t as Q, e as je, b as Z, h as L, r as Oe, c as We, d as Xe } from "./index-9uY2HzIO.mjs";
|
|
3
|
+
import { _ as Ye } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
|
+
const Je = {
|
|
5
5
|
/**
|
|
6
6
|
* Unique identifier for the paragraph.
|
|
7
7
|
* - Access methods via `hison.component.getParagraph(id)`
|
|
@@ -66,7 +66,7 @@ const We = {
|
|
|
66
66
|
textAlign: {
|
|
67
67
|
type: String,
|
|
68
68
|
default: null,
|
|
69
|
-
validator: (t) => t == null ||
|
|
69
|
+
validator: (t) => t == null || xe.includes(t)
|
|
70
70
|
},
|
|
71
71
|
/**
|
|
72
72
|
* Vertical alignment (effective when the paragraph has vertical space).
|
|
@@ -75,8 +75,8 @@ const We = {
|
|
|
75
75
|
*/
|
|
76
76
|
verticalAlign: {
|
|
77
77
|
type: String,
|
|
78
|
-
default:
|
|
79
|
-
validator: (t) =>
|
|
78
|
+
default: Ke.top,
|
|
79
|
+
validator: (t) => He.includes(t)
|
|
80
80
|
},
|
|
81
81
|
/**
|
|
82
82
|
* Whether to show border (rendered as subtle box-shadow).
|
|
@@ -90,8 +90,8 @@ const We = {
|
|
|
90
90
|
*/
|
|
91
91
|
backgroundType: {
|
|
92
92
|
type: String,
|
|
93
|
-
default:
|
|
94
|
-
validator: (t) =>
|
|
93
|
+
default: G.empty,
|
|
94
|
+
validator: (t) => Fe.includes(t)
|
|
95
95
|
},
|
|
96
96
|
/**
|
|
97
97
|
* Whitespace rendering policy.
|
|
@@ -101,7 +101,7 @@ const We = {
|
|
|
101
101
|
whiteSpace: {
|
|
102
102
|
type: String,
|
|
103
103
|
default: null,
|
|
104
|
-
validator: (t) => t == null ||
|
|
104
|
+
validator: (t) => t == null || Pe.includes(t)
|
|
105
105
|
},
|
|
106
106
|
/**
|
|
107
107
|
* Enables content copy.
|
|
@@ -116,10 +116,16 @@ const We = {
|
|
|
116
116
|
/**
|
|
117
117
|
* Copy button label (also used for accessibility).
|
|
118
118
|
*/
|
|
119
|
-
copyButtonText: { type: String, default: "copy" }
|
|
120
|
-
|
|
119
|
+
copyButtonText: { type: String, default: "copy" },
|
|
120
|
+
/**
|
|
121
|
+
* Prevent auto-translation by browsers or translation plugins.
|
|
122
|
+
* - When false: adds `translate="no"` and `.notranslate` to the inner <p>
|
|
123
|
+
* - Default: true
|
|
124
|
+
*/
|
|
125
|
+
translate: { type: Boolean, default: !0 }
|
|
126
|
+
}, Qe = we({
|
|
121
127
|
name: "HParagraph",
|
|
122
|
-
props:
|
|
128
|
+
props: Je,
|
|
123
129
|
inheritAttrs: !1,
|
|
124
130
|
emits: [
|
|
125
131
|
"mounted",
|
|
@@ -129,31 +135,31 @@ const We = {
|
|
|
129
135
|
"copy-error"
|
|
130
136
|
],
|
|
131
137
|
setup(t, { emit: s }) {
|
|
132
|
-
const
|
|
133
|
-
() =>
|
|
134
|
-
),
|
|
135
|
-
|
|
138
|
+
const U = o(null), v = o(null), u = t.id ? t.id : Ge(), q = a(() => `hison_paragraph_copy_button_${u}`), g = `hparagraph:${u}`, c = qe(), V = Be(), h = o(t.visible), C = o(t.title || ""), f = o(t.text || ""), b = o(t.fontBold), m = o(t.fontItalic), T = o(t.fontThruline), w = o(t.fontUnderline), B = o(t.textAlign ?? ze.left), S = o(t.verticalAlign), k = o(t.border), p = o(t.backgroundType), A = o(t.whiteSpace), i = o(t.copyEnabled), E = o(t.showCopyButton), I = o(t.copyButtonText), R = a(() => V.default ? V.default() : []), z = a(
|
|
139
|
+
() => R.value.length > 0 && R.value.every((e) => e.type === Se)
|
|
140
|
+
), $ = a(() => !!V.default && !z.value), _ = a(() => !!V.default && R.value.length > 0);
|
|
141
|
+
X(() => {
|
|
136
142
|
if (z.value) {
|
|
137
|
-
const e =
|
|
138
|
-
|
|
143
|
+
const e = R.value.map((n) => String(n.children ?? "")).join("");
|
|
144
|
+
f.value = e;
|
|
139
145
|
}
|
|
140
146
|
});
|
|
141
|
-
const
|
|
142
|
-
switch (
|
|
143
|
-
case
|
|
147
|
+
const ee = a(() => h.value ? "" : "hison-display-none"), te = a(() => k.value ? "hison-border" : ""), ne = a(() => {
|
|
148
|
+
switch (p.value) {
|
|
149
|
+
case G.empty:
|
|
144
150
|
return "hison-bg-empty";
|
|
145
|
-
case
|
|
151
|
+
case G.transparent:
|
|
146
152
|
return "hison-bg-transparent";
|
|
147
153
|
default:
|
|
148
154
|
return "hison-bg-filled";
|
|
149
155
|
}
|
|
150
|
-
}),
|
|
151
|
-
|
|
152
|
-
},
|
|
156
|
+
}), ae = a(() => b.value ? "hison-font-bold" : ""), oe = a(() => m.value ? "hison-font-italic" : ""), le = a(() => T.value ? "hison-font-thruline" : ""), se = a(() => w.value ? "hison-font-underline" : ""), ie = a(() => i.value ? "" : "hison-no-select"), y = o(t.translate), re = a(() => y.value === !1 ? "notranslate" : ""), ue = a(() => y.value === !1 ? "no" : void 0), D = o([]), P = () => {
|
|
157
|
+
D.value = je(Q(t.class) || "", c.value), Z(D.value, "size", L.componentStyle.size), Z(D.value, "color", "primary");
|
|
158
|
+
}, ce = a(() => {
|
|
153
159
|
const e = [];
|
|
154
|
-
return e.push(...
|
|
155
|
-
}),
|
|
156
|
-
switch (
|
|
160
|
+
return e.push(...Me(Q(t.class) || "", "color")), e;
|
|
161
|
+
}), de = a(() => A.value ?? "pre-wrap"), ve = a(() => {
|
|
162
|
+
switch (de.value) {
|
|
157
163
|
case "normal":
|
|
158
164
|
return "hison-ws-normal";
|
|
159
165
|
case "pre":
|
|
@@ -167,8 +173,8 @@ const We = {
|
|
|
167
173
|
default:
|
|
168
174
|
return "";
|
|
169
175
|
}
|
|
170
|
-
}),
|
|
171
|
-
switch (
|
|
176
|
+
}), fe = a(() => {
|
|
177
|
+
switch (B.value) {
|
|
172
178
|
case "center":
|
|
173
179
|
return "hison-ta-center";
|
|
174
180
|
case "right":
|
|
@@ -176,7 +182,7 @@ const We = {
|
|
|
176
182
|
default:
|
|
177
183
|
return "hison-ta-left";
|
|
178
184
|
}
|
|
179
|
-
}),
|
|
185
|
+
}), pe = a(() => {
|
|
180
186
|
switch (S.value) {
|
|
181
187
|
case "middle":
|
|
182
188
|
return "hison-valign-middle";
|
|
@@ -185,262 +191,271 @@ const We = {
|
|
|
185
191
|
default:
|
|
186
192
|
return "";
|
|
187
193
|
}
|
|
188
|
-
}),
|
|
189
|
-
const e =
|
|
194
|
+
}), ye = () => {
|
|
195
|
+
const e = U.value;
|
|
190
196
|
return e ? e.innerText ?? "" : "";
|
|
191
197
|
};
|
|
192
|
-
function
|
|
198
|
+
function M() {
|
|
193
199
|
const e = typeof window < "u" ? window.getSelection() : null;
|
|
194
200
|
return !!e && !e.isCollapsed && e.toString().length > 0;
|
|
195
201
|
}
|
|
196
|
-
const
|
|
202
|
+
const j = async () => {
|
|
197
203
|
if (!i.value) return !1;
|
|
198
|
-
const e =
|
|
204
|
+
const e = ye();
|
|
199
205
|
try {
|
|
200
206
|
if (navigator.clipboard && typeof navigator.clipboard.writeText == "function")
|
|
201
207
|
return await navigator.clipboard.writeText(e), !0;
|
|
202
208
|
} catch {
|
|
203
209
|
}
|
|
204
210
|
try {
|
|
205
|
-
const n = document.createRange(), d =
|
|
211
|
+
const n = document.createRange(), d = U.value;
|
|
206
212
|
if (!d) throw new Error("no element");
|
|
207
213
|
n.selectNodeContents(d);
|
|
208
214
|
const r = window.getSelection();
|
|
209
215
|
r == null || r.removeAllRanges(), r == null || r.addRange(n);
|
|
210
|
-
const
|
|
211
|
-
return r == null || r.removeAllRanges(),
|
|
216
|
+
const Te = document.execCommand("copy");
|
|
217
|
+
return r == null || r.removeAllRanges(), Te;
|
|
212
218
|
} catch {
|
|
213
219
|
return !1;
|
|
214
220
|
}
|
|
215
|
-
},
|
|
216
|
-
s("copy-click", { src: e, event: n, api:
|
|
221
|
+
}, F = async (e, n) => {
|
|
222
|
+
s("copy-click", { src: e, event: n, api: v.value });
|
|
217
223
|
try {
|
|
218
|
-
const d = await
|
|
219
|
-
s("copied", d,
|
|
224
|
+
const d = await j();
|
|
225
|
+
s("copied", d, v.value);
|
|
220
226
|
} catch (d) {
|
|
221
|
-
s("copy-error", d,
|
|
227
|
+
s("copy-error", d, v.value);
|
|
222
228
|
}
|
|
223
|
-
},
|
|
224
|
-
await
|
|
225
|
-
},
|
|
229
|
+
}, ge = async (e) => {
|
|
230
|
+
await F("button", e);
|
|
231
|
+
}, he = async (e) => {
|
|
226
232
|
const n = /Mac|iPod|iPhone|iPad/.test(navigator.platform), d = (n ? e.metaKey : e.ctrlKey) && (e.key === "c" || e.key === "C"), r = (n ? e.metaKey : e.ctrlKey) && (e.key === "x" || e.key === "X");
|
|
227
233
|
if (!i.value && (d || r)) {
|
|
228
234
|
e.preventDefault(), e.stopPropagation();
|
|
229
235
|
return;
|
|
230
236
|
}
|
|
231
237
|
if (i.value && d) {
|
|
232
|
-
if (
|
|
233
|
-
e.preventDefault(), e.stopPropagation(), await
|
|
238
|
+
if (M()) return;
|
|
239
|
+
e.preventDefault(), e.stopPropagation(), await F("keyboard", e);
|
|
234
240
|
}
|
|
235
|
-
},
|
|
241
|
+
}, Ce = async (e) => {
|
|
236
242
|
if (!i.value) {
|
|
237
243
|
e.preventDefault();
|
|
238
244
|
return;
|
|
239
245
|
}
|
|
240
|
-
|
|
241
|
-
},
|
|
246
|
+
M() || (e.preventDefault(), await F("native", e));
|
|
247
|
+
}, be = (e) => {
|
|
242
248
|
i.value || e.preventDefault();
|
|
243
|
-
},
|
|
249
|
+
}, me = (e) => {
|
|
244
250
|
i.value || e.preventDefault();
|
|
245
|
-
},
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}),
|
|
251
|
+
}, O = () => {
|
|
252
|
+
L.component.paragraphList[u] && L.component.paragraphList[u].isHisonvueComponent && console.warn(`[Hisonvue] The paragraph ID is at risk of being duplicated. ${u}`), Oe(g, () => {
|
|
253
|
+
W(), Ee(O);
|
|
254
|
+
}), P(), v.value = {
|
|
249
255
|
isHisonvueComponent: !0,
|
|
250
256
|
getId: () => u,
|
|
251
257
|
getType: () => "paragraph",
|
|
252
|
-
isVisible: () =>
|
|
258
|
+
isVisible: () => h.value,
|
|
253
259
|
setVisible: (e) => {
|
|
254
|
-
|
|
260
|
+
h.value = e;
|
|
255
261
|
},
|
|
256
|
-
getTitle: () =>
|
|
262
|
+
getTitle: () => C.value,
|
|
257
263
|
setTitle: (e) => {
|
|
258
|
-
|
|
264
|
+
C.value = e || "";
|
|
259
265
|
},
|
|
260
|
-
getText: () =>
|
|
266
|
+
getText: () => $.value ? "" : f.value,
|
|
261
267
|
setText: (e) => {
|
|
262
|
-
|
|
268
|
+
$.value || (f.value = e ?? "");
|
|
263
269
|
},
|
|
264
|
-
getTextAlign: () =>
|
|
270
|
+
getTextAlign: () => B.value,
|
|
265
271
|
setTextAlign: (e) => {
|
|
266
|
-
(e === "left" || e === "center" || e === "right") && (
|
|
272
|
+
(e === "left" || e === "center" || e === "right") && (B.value = e);
|
|
267
273
|
},
|
|
268
274
|
getVerticalAlign: () => S.value,
|
|
269
275
|
setVerticalAlign: (e) => {
|
|
270
276
|
S.value = e;
|
|
271
277
|
},
|
|
272
|
-
isFontBold: () =>
|
|
278
|
+
isFontBold: () => b.value,
|
|
273
279
|
setFontBold: (e) => {
|
|
274
|
-
|
|
280
|
+
b.value = e;
|
|
275
281
|
},
|
|
276
|
-
isFontItalic: () =>
|
|
282
|
+
isFontItalic: () => m.value,
|
|
277
283
|
setFontItalic: (e) => {
|
|
278
|
-
|
|
284
|
+
m.value = e;
|
|
279
285
|
},
|
|
280
|
-
isFontThruline: () =>
|
|
286
|
+
isFontThruline: () => T.value,
|
|
281
287
|
setFontThruline: (e) => {
|
|
282
|
-
|
|
288
|
+
T.value = e;
|
|
283
289
|
},
|
|
284
|
-
isFontUnderline: () =>
|
|
290
|
+
isFontUnderline: () => w.value,
|
|
285
291
|
setFontUnderline: (e) => {
|
|
286
|
-
|
|
292
|
+
w.value = e;
|
|
287
293
|
},
|
|
288
|
-
isBorder: () =>
|
|
294
|
+
isBorder: () => k.value,
|
|
289
295
|
setBorder: (e) => {
|
|
290
|
-
|
|
296
|
+
k.value = e;
|
|
291
297
|
},
|
|
292
|
-
getBackgroundType: () =>
|
|
298
|
+
getBackgroundType: () => p.value,
|
|
293
299
|
setBackgroundType: (e) => {
|
|
294
|
-
|
|
300
|
+
p.value = e;
|
|
295
301
|
},
|
|
296
|
-
getWhiteSpace: () =>
|
|
302
|
+
getWhiteSpace: () => A.value,
|
|
297
303
|
setWhiteSpace: (e) => {
|
|
298
|
-
|
|
304
|
+
A.value = e;
|
|
299
305
|
},
|
|
300
|
-
getCopyButtonText: () =>
|
|
306
|
+
getCopyButtonText: () => I.value,
|
|
301
307
|
setCopyButtonText: (e) => {
|
|
302
|
-
|
|
308
|
+
I.value = e;
|
|
303
309
|
},
|
|
304
310
|
isCopyEnabled: () => i.value,
|
|
305
311
|
setCopyEnabled: (e) => {
|
|
306
312
|
i.value = e;
|
|
307
313
|
},
|
|
308
|
-
isShowCopyButton: () =>
|
|
314
|
+
isShowCopyButton: () => E.value,
|
|
309
315
|
setShowCopyButton: (e) => {
|
|
310
|
-
|
|
316
|
+
E.value = e;
|
|
311
317
|
},
|
|
312
|
-
copy: async () => await
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
318
|
+
copy: async () => await j(),
|
|
319
|
+
isTranslate: () => y.value,
|
|
320
|
+
setTranslate: (e) => {
|
|
321
|
+
y.value = e;
|
|
322
|
+
},
|
|
323
|
+
reload: () => We(g)
|
|
324
|
+
}, L.component.paragraphList[u] = v.value, s("mounted", v.value);
|
|
325
|
+
}, W = () => {
|
|
326
|
+
Xe(g), delete L.component.paragraphList[u];
|
|
317
327
|
};
|
|
318
|
-
return
|
|
319
|
-
|
|
328
|
+
return X(O), ke(W), l(c, (e) => {
|
|
329
|
+
P(), s("responsive-change", e);
|
|
320
330
|
}), l(() => t.visible, (e) => {
|
|
321
331
|
const n = !!e;
|
|
322
|
-
n !==
|
|
332
|
+
n !== h.value && (h.value = n);
|
|
323
333
|
}), l(() => t.title, (e) => {
|
|
324
334
|
const n = e ?? "";
|
|
325
|
-
n !==
|
|
335
|
+
n !== C.value && (C.value = n);
|
|
326
336
|
}), l(() => t.text, (e) => {
|
|
327
337
|
const n = e ?? "";
|
|
328
|
-
|
|
338
|
+
!$.value && n !== f.value && (f.value = n);
|
|
329
339
|
}), l(() => t.fontBold, (e) => {
|
|
330
340
|
const n = !!e;
|
|
331
|
-
n !==
|
|
341
|
+
n !== b.value && (b.value = n);
|
|
332
342
|
}), l(() => t.fontItalic, (e) => {
|
|
333
343
|
const n = !!e;
|
|
334
|
-
n !==
|
|
344
|
+
n !== m.value && (m.value = n);
|
|
335
345
|
}), l(() => t.fontThruline, (e) => {
|
|
336
346
|
const n = !!e;
|
|
337
|
-
n !==
|
|
347
|
+
n !== T.value && (T.value = n);
|
|
338
348
|
}), l(() => t.fontUnderline, (e) => {
|
|
339
349
|
const n = !!e;
|
|
340
|
-
n !==
|
|
350
|
+
n !== w.value && (w.value = n);
|
|
341
351
|
}), l(() => t.textAlign, (e) => {
|
|
342
|
-
e && e !==
|
|
352
|
+
e && e !== B.value && (e === "left" || e === "center" || e === "right") && (B.value = e);
|
|
343
353
|
}), l(() => t.verticalAlign, (e) => {
|
|
344
354
|
e && e !== S.value && (e === "top" || e === "middle" || e === "bottom") && (S.value = e);
|
|
345
355
|
}), l(() => t.whiteSpace, (e) => {
|
|
346
356
|
const n = e ?? null;
|
|
347
|
-
n !==
|
|
357
|
+
n !== A.value && (A.value = n);
|
|
348
358
|
}), l(() => t.border, (e) => {
|
|
349
359
|
const n = !!e;
|
|
350
|
-
n !==
|
|
360
|
+
n !== k.value && (k.value = n);
|
|
351
361
|
}), l(() => t.backgroundType, (e) => {
|
|
352
|
-
e && e !==
|
|
362
|
+
e && e !== p.value && (p.value = e);
|
|
353
363
|
}), l(() => t.copyEnabled, (e) => {
|
|
354
364
|
const n = !!e;
|
|
355
365
|
n !== i.value && (i.value = n);
|
|
356
366
|
}), l(() => t.showCopyButton, (e) => {
|
|
357
367
|
const n = !!e;
|
|
358
|
-
n !==
|
|
368
|
+
n !== E.value && (E.value = n);
|
|
359
369
|
}), l(() => t.copyButtonText, (e) => {
|
|
360
370
|
const n = e ?? "copy";
|
|
361
|
-
n !==
|
|
371
|
+
n !== I.value && (I.value = n);
|
|
372
|
+
}), l(() => t.translate, (e) => {
|
|
373
|
+
const n = !!e;
|
|
374
|
+
n !== y.value && (y.value = n);
|
|
362
375
|
}), l(() => t.class, () => {
|
|
363
|
-
|
|
376
|
+
P();
|
|
364
377
|
}), {
|
|
365
|
-
paraRef:
|
|
366
|
-
paragraphMethods: a(() =>
|
|
378
|
+
paraRef: U,
|
|
379
|
+
paragraphMethods: a(() => Ae(v)),
|
|
367
380
|
props: t,
|
|
368
381
|
id: u,
|
|
369
382
|
copyButtonId: q,
|
|
370
|
-
title:
|
|
371
|
-
visibleClass:
|
|
372
|
-
borderClass:
|
|
373
|
-
backgroundType:
|
|
374
|
-
backgroundTypeClass:
|
|
375
|
-
fontBoldClass:
|
|
376
|
-
fontItalicClass:
|
|
377
|
-
fontThrulineClass:
|
|
378
|
-
fontUnderlineClass:
|
|
379
|
-
responsiveClassList:
|
|
380
|
-
buttonClassList:
|
|
381
|
-
internalText:
|
|
382
|
-
copyButtonText:
|
|
383
|
+
title: C,
|
|
384
|
+
visibleClass: ee,
|
|
385
|
+
borderClass: te,
|
|
386
|
+
backgroundType: p,
|
|
387
|
+
backgroundTypeClass: ne,
|
|
388
|
+
fontBoldClass: ae,
|
|
389
|
+
fontItalicClass: oe,
|
|
390
|
+
fontThrulineClass: le,
|
|
391
|
+
fontUnderlineClass: se,
|
|
392
|
+
responsiveClassList: D,
|
|
393
|
+
buttonClassList: ce,
|
|
394
|
+
internalText: f,
|
|
395
|
+
copyButtonText: I,
|
|
383
396
|
copyEnabled: i,
|
|
384
|
-
showCopyButton:
|
|
385
|
-
hasElementSlot:
|
|
386
|
-
hasAnySlot:
|
|
387
|
-
whiteSpaceClass:
|
|
388
|
-
textAlignClass:
|
|
389
|
-
verticalAlignClass:
|
|
390
|
-
copyGuardClass:
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
397
|
+
showCopyButton: E,
|
|
398
|
+
hasElementSlot: $,
|
|
399
|
+
hasAnySlot: _,
|
|
400
|
+
whiteSpaceClass: ve,
|
|
401
|
+
textAlignClass: fe,
|
|
402
|
+
verticalAlignClass: pe,
|
|
403
|
+
copyGuardClass: ie,
|
|
404
|
+
translateClass: re,
|
|
405
|
+
translateAttr: ue,
|
|
406
|
+
onKeydown: he,
|
|
407
|
+
onCopyEvent: Ce,
|
|
408
|
+
onCutEvent: be,
|
|
409
|
+
onSelectStart: me,
|
|
410
|
+
onCopyButtonClick: ge
|
|
396
411
|
};
|
|
397
412
|
}
|
|
398
|
-
}),
|
|
413
|
+
}), Ze = {
|
|
399
414
|
key: 0,
|
|
400
415
|
class: "hison-paragraph-copybtn"
|
|
401
|
-
},
|
|
402
|
-
function
|
|
403
|
-
const
|
|
404
|
-
return
|
|
405
|
-
class:
|
|
416
|
+
}, _e = ["title", "translate"];
|
|
417
|
+
function et(t, s, U, v, u, q) {
|
|
418
|
+
const g = Ie("HButton");
|
|
419
|
+
return K(), H("div", {
|
|
420
|
+
class: x([
|
|
406
421
|
"hison-wrapper",
|
|
407
422
|
"hison-paragraph-wrapper",
|
|
408
423
|
...t.responsiveClassList,
|
|
409
424
|
t.visibleClass
|
|
410
425
|
])
|
|
411
426
|
}, [
|
|
412
|
-
t.copyEnabled && t.showCopyButton ? (
|
|
413
|
-
|
|
427
|
+
t.copyEnabled && t.showCopyButton ? (K(), H("div", Ze, [
|
|
428
|
+
N(t.$slots, "copy-button", {
|
|
414
429
|
onClick: t.onCopyButtonClick,
|
|
415
430
|
text: t.copyButtonText
|
|
416
431
|
}, () => [
|
|
417
|
-
|
|
432
|
+
Ue(g, {
|
|
418
433
|
id: t.copyButtonId,
|
|
419
|
-
class:
|
|
434
|
+
class: x([...t.buttonClassList, "hison-size-s"]),
|
|
420
435
|
border: !0,
|
|
421
436
|
text: t.copyButtonText,
|
|
422
437
|
"background-type": t.backgroundType,
|
|
423
438
|
onClick: t.onCopyButtonClick,
|
|
424
439
|
title: "Copy content"
|
|
425
|
-
},
|
|
426
|
-
default:
|
|
427
|
-
t.$slots["copy-label"] ?
|
|
440
|
+
}, Ve({
|
|
441
|
+
default: J(() => [
|
|
442
|
+
t.$slots["copy-label"] ? N(t.$slots, "copy-label", { key: 0 }) : Y("", !0)
|
|
428
443
|
]),
|
|
429
444
|
_: 2
|
|
430
445
|
}, [
|
|
431
446
|
t.$slots["copy-icon"] ? {
|
|
432
447
|
name: "icon",
|
|
433
|
-
fn:
|
|
434
|
-
|
|
448
|
+
fn: J(() => [
|
|
449
|
+
N(t.$slots, "copy-icon")
|
|
435
450
|
]),
|
|
436
451
|
key: "0"
|
|
437
452
|
} : void 0
|
|
438
453
|
]), 1032, ["id", "class", "text", "background-type", "onClick"])
|
|
439
454
|
])
|
|
440
|
-
])) :
|
|
441
|
-
|
|
455
|
+
])) : Y("", !0),
|
|
456
|
+
Le("p", {
|
|
442
457
|
ref: "paraRef",
|
|
443
|
-
class:
|
|
458
|
+
class: x(["hison-paragraph", [
|
|
444
459
|
t.borderClass,
|
|
445
460
|
t.backgroundTypeClass,
|
|
446
461
|
t.fontBoldClass,
|
|
@@ -450,23 +465,25 @@ function Qe(t, s, L, p, u, q) {
|
|
|
450
465
|
t.whiteSpaceClass,
|
|
451
466
|
t.textAlignClass,
|
|
452
467
|
t.verticalAlignClass,
|
|
453
|
-
t.copyGuardClass
|
|
468
|
+
t.copyGuardClass,
|
|
469
|
+
t.translateClass
|
|
454
470
|
]]),
|
|
455
|
-
style:
|
|
471
|
+
style: Re(t.props.style),
|
|
456
472
|
title: t.title || void 0,
|
|
473
|
+
translate: t.translateAttr,
|
|
457
474
|
tabindex: "0",
|
|
458
475
|
onKeydown: s[0] || (s[0] = (...c) => t.onKeydown && t.onKeydown(...c)),
|
|
459
476
|
onCopy: s[1] || (s[1] = (...c) => t.onCopyEvent && t.onCopyEvent(...c)),
|
|
460
477
|
onCut: s[2] || (s[2] = (...c) => t.onCutEvent && t.onCutEvent(...c)),
|
|
461
478
|
onSelectstart: s[3] || (s[3] = (...c) => t.onSelectStart && t.onSelectStart(...c))
|
|
462
479
|
}, [
|
|
463
|
-
t.hasElementSlot ?
|
|
464
|
-
|
|
480
|
+
t.hasElementSlot ? N(t.$slots, "default", { key: 0 }) : (K(), H($e, { key: 1 }, [
|
|
481
|
+
De(Ne(t.internalText), 1)
|
|
465
482
|
], 64))
|
|
466
|
-
], 46,
|
|
483
|
+
], 46, _e)
|
|
467
484
|
], 2);
|
|
468
485
|
}
|
|
469
|
-
const
|
|
486
|
+
const ot = /* @__PURE__ */ Ye(Qe, [["render", et]]);
|
|
470
487
|
export {
|
|
471
|
-
|
|
488
|
+
ot as default
|
|
472
489
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),n=require("./index-BzCcaeiL.js"),Z=require("./scrollManager-CEEWQwoK.js"),ge=require("./_plugin-vue_export-helper-BHFhmbuH.js"),Ce={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!1},border:{type:Boolean,default:!0},zIndex:{type:Number,default:1200},position:{type:String,default:n.ScreenPosition.middleCenter,validator:l=>n.SCREEN_POSITION_VALUES.includes(l)},left:{type:Number,default:null},top:{type:Number,default:null},width:{type:Number,default:null},height:{type:Number,default:null},draggable:{type:Boolean,default:!0},showOverlay:{type:Boolean,default:!0},closeClickOverlay:{type:Boolean,default:!0},overlayStyle:{type:[String,Object,Array],required:!1},scrollLock:{type:Boolean,default:!0},enterAnimationClass:{type:String,required:!1},leaveAnimationClass:{type:String,required:!1}},Se=t.defineComponent({name:"HPopup",props:Ce,inheritAttrs:!1,emits:["mounted","responsive-change","open","close"],setup(l,{emit:c,slots:G}){const i=l.id||n.getUUID(),z=`hpopup:${i}`,E=n.useDevice(),w=t.ref(null),v=t.ref(null),s=t.ref(l.visible),J=t.ref(!0),f=t.ref(l.zIndex??1100),L=t.ref(l.position),r=t.ref(l.left??null),u=t.ref(l.top??null),m=t.ref(l.width??null),h=t.ref(l.height??null),B=t.ref(l.showOverlay),P=t.ref(l.closeClickOverlay),y=t.ref(l.scrollLock),d=t.ref(l.enterAnimationClass||"hison-popup-enter"),p=t.ref(l.leaveAnimationClass||"hison-popup-leave"),K=t.computed(()=>s.value?"":"hison-display-none"),N=t.ref([]),I=()=>{N.value=n.extractResponsiveClasses(n.toClassString(l.class)||"",E.value),n.addComponentNameToClass(N.value,"size",n.hisonCloser.componentStyle.size),n.addComponentNameToClass(N.value,"color","primary")},Q=t.computed(()=>[...n.extractPrefixedClasses(n.toClassString(l.class)||"","color")]),_=t.computed(()=>s.value&&B.value),ee=()=>{P.value&&g()},te=t.computed(()=>{const e={zIndex:f.value,position:"fixed"};if(r.value!=null||u.value!=null)return e.left=`${r.value??0}px`,e.top=`${u.value??0}px`,e;switch(e.left="",e.right="",e.top="",e.bottom="",e.transform="none",L.value){case n.ScreenPosition.topLeft:e.left="0",e.top="0";break;case n.ScreenPosition.topCenter:e.left="50%",e.top="0",e.transform="translateX(-50%)";break;case n.ScreenPosition.topRight:e.right="0",e.top="0";break;case n.ScreenPosition.middleLeft:e.left="0",e.top="50%",e.transform="translateY(-50%)";break;case n.ScreenPosition.middleCenter:e.left="50%",e.top="50%",e.transform="translate(-50%, -50%)";break;case n.ScreenPosition.middleRight:e.right="0",e.top="50%",e.transform="translateY(-50%)";break;case n.ScreenPosition.bottomLeft:e.left="0",e.bottom="0";break;case n.ScreenPosition.bottomCenter:e.left="50%",e.bottom="0",e.transform="translateX(-50%)";break;case n.ScreenPosition.bottomRight:e.right="0",e.bottom="0";break}return e}),le=t.computed(()=>{const o={zIndex:(f.value??1100)-1},a=l.overlayStyle;return a?Array.isArray(a)?[{...o},...a]:typeof a=="string"?[o,a]:{...o,...a}:o}),oe=t.computed(()=>{const e={};return m.value!=null&&(e.width=`${m.value}px`),h.value!=null&&(e.height=`${h.value}px`),e}),b=t.ref(l.border),ne=t.computed(()=>b.value?"hison-border":"hison-border-none"),se=t.computed(()=>b.value?"filled":"empty"),A=()=>{y.value&&Z.acquireScrollLock(i)},V=()=>{y.value&&Z.releaseScrollLock(i)},D=async()=>{const e=v.value;!e||!d.value||(e.classList.remove(p.value),e.offsetWidth,e.classList.add(d.value))},ae=async()=>{const e=v.value;!e||!p.value||(e.classList.remove(d.value),e.offsetWidth,e.classList.add(p.value),await new Promise(o=>setTimeout(o,200)))},$=async()=>{s.value||(s.value=!0,A(),await t.nextTick(),D(),c("open",t.unref(k)))},g=async()=>{if(s.value)try{await ae()}finally{s.value=!1,V(),c("close",t.unref(k))}},ie=async()=>s.value?g():$(),re=()=>{g()},C=t.ref(l.draggable),T=t.ref(!1);let x=0,X=0,U=0,Y=0,S=null,O=null;const ue=()=>{if(r.value==null&&u.value==null){const e=w.value;if(!e)return;const o=e.getBoundingClientRect();r.value=Math.round(o.left),u.value=Math.round(o.top)}},ce=(e,o)=>{const a=w.value;if(!a)return{l:e,t:o};const q=window.innerWidth,W=window.innerHeight,pe=a.offsetWidth,fe=a.offsetHeight,me=0,he=0,ye=Math.max(0,q-pe),be=Math.max(0,W-fe);return{l:Math.min(Math.max(e,me),ye),t:Math.min(Math.max(o,he),be)}},ve=(e,o)=>{O={l:e,t:o},S==null&&(S=requestAnimationFrame(()=>{O&&(r.value=O.l,u.value=O.t,O=null),S=null}))},M=e=>{if(!T.value)return;const o=e.clientX-x,a=e.clientY-X,{l:q,t:W}=ce(U+o,Y+a);ve(q,W)},R=()=>{T.value&&(T.value=!1,document.removeEventListener("pointermove",M,!0),document.removeEventListener("pointerup",R,!0),document.body.style.userSelect="")},de=e=>{!C.value||e.target.closest(".hison-popup-close-btn")||(ue(),T.value=!0,x=e.clientX,X=e.clientY,U=r.value??0,Y=u.value??0,document.body.style.userSelect="none",document.addEventListener("pointermove",M,!0),document.addEventListener("pointerup",R,!0))},H=()=>{S!=null&&(cancelAnimationFrame(S),S=null),document.removeEventListener("pointermove",M,!0),document.removeEventListener("pointerup",R,!0),document.body.style.userSelect="",T.value=!1},k=t.ref(null),j=()=>{n.hisonCloser.component.popupList[i]&&n.hisonCloser.component.popupList[i].isHisonvueComponent&&console.warn(`[Hisonvue] The popup ID is at risk of being duplicated. ${i}`),n.registerReloadable(z,()=>{F(),t.nextTick(j)}),I(),s.value&&(A(),t.nextTick(D)),k.value={isHisonvueComponent:!0,getId:()=>i,getType:()=>"popup",isVisible:()=>s.value,open:$,close:g,toggle:ie,setVisible:e=>e?$():g(),getZIndex:()=>f.value,setZIndex:e=>{f.value=e},getPosition:()=>L.value,setPosition:e=>{L.value=e},getLeft:()=>r.value,setLeft:e=>{r.value=e},getTop:()=>u.value,setTop:e=>{u.value=e},getWidth:()=>m.value,setWidth:e=>{m.value=e},getHeight:()=>h.value,setHeight:e=>{h.value=e},isDraggable:()=>C.value,setDraggable:e=>{C.value=e,e||H()},isOverlayShown:()=>B.value,setOverlayShown:e=>{B.value=e},isCloseClickOverlay:()=>P.value,setCloseClickOverlay:e=>{P.value=e},isScrollLocked:()=>y.value,setScrollLock:e=>{y.value=e,s.value&&(e?A():V())},isBorder:()=>b.value,setBorder:e=>{b.value=e},getAnimationClasses:()=>({enter:d.value,leave:p.value}),setAnimationClasses:e=>{"enter"in e&&(d.value=e.enter||""),"leave"in e&&(p.value=e.leave||"")},reload:()=>n.reloadHisonComponent(z)},n.hisonCloser.component.popupList[i]=k.value,c("mounted",k.value)},F=()=>{H(),n.unregisterReloadable(z),delete n.hisonCloser.component.popupList[i],s.value&&V()};return t.onMounted(j),t.onBeforeUnmount(F),t.watch(E,e=>{I(),c("responsive-change",e)}),t.watch(()=>l.visible,e=>{const o=!!e;o!==s.value&&(o?$():g())}),t.watch(()=>l.zIndex,e=>{const o=Number(e??1100);o!==f.value&&(f.value=o)}),t.watch(()=>l.position,e=>{e&&e!==L.value&&(L.value=e)}),t.watch(()=>l.left,e=>{const o=e==null?null:Number(e);o!==r.value&&(r.value=o)}),t.watch(()=>l.top,e=>{const o=e==null?null:Number(e);o!==u.value&&(u.value=o)}),t.watch(()=>l.width,e=>{const o=e==null?null:Number(e);o!==m.value&&(m.value=o)}),t.watch(()=>l.height,e=>{const o=e==null?null:Number(e);o!==h.value&&(h.value=o)}),t.watch(()=>l.draggable,e=>{const o=!!e;o!==C.value&&(C.value=o,o||H())}),t.watch(()=>l.showOverlay,e=>{const o=!!e;o!==B.value&&(B.value=o)}),t.watch(()=>l.closeClickOverlay,e=>{const o=!!e;o!==P.value&&(P.value=o)}),t.watch(()=>l.scrollLock,e=>{const o=!!e;o!==y.value&&(y.value=o,s.value&&(o?A():V()))}),t.watch(()=>l.border,e=>{const o=!!e;o!==b.value&&(b.value=o)}),t.watch(()=>l.enterAnimationClass,e=>{const o=e||"hison-popup-enter";o!==d.value&&(d.value=o)}),t.watch(()=>l.leaveAnimationClass,e=>{const o=e||"hison-popup-leave";o!==p.value&&(p.value=o)}),t.watch(()=>l.class,()=>{I()}),{id:i,props:l,popupRef:v,popupWrapperRef:w,visibleClass:K,responsiveClassList:N,childClassList:Q,borderClass:ne,wrapperStyle:te,overlayStyleWithZ:le,isOverlayVisible:_,sizeStyle:oe,closeButtonVisible:J,closeButtonBackgroundType:se,closeButtonText:"X",closeButtonTitle:"Close",draggable:C,onClickCloseButton:re,onOverlayClick:ee,onTopbarPointerDown:de,popupMethods:t.computed(()=>t.unref(k))}}}),ke={class:t.normalizeClass(["hison-popup-body"])};function we(l,c,G,i,z,E){const w=t.resolveComponent("HButton");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["hison-layer-host",l.visibleClass])},[l.isOverlayVisible?(t.openBlock(),t.createElementBlock("div",{key:0,class:"hison-popup-overlay",style:t.normalizeStyle(l.overlayStyleWithZ),onClick:c[0]||(c[0]=(...v)=>l.onOverlayClick&&l.onOverlayClick(...v))},null,4)):t.createCommentVNode("",!0),t.createElementVNode("div",{ref:"popupWrapperRef",class:t.normalizeClass(["hison-popup-wrapper",...l.responsiveClassList]),style:t.normalizeStyle(l.wrapperStyle)},[t.createElementVNode("div",{ref:"popupRef",class:t.normalizeClass(["hison-popup",l.borderClass]),style:t.normalizeStyle([l.sizeStyle,l.props.style]),role:"dialog"},[t.createElementVNode("div",{class:t.normalizeClass(["hison-popup-topbar",l.draggable?"hison-draggable":""]),onPointerdown:c[1]||(c[1]=(...v)=>l.onTopbarPointerDown&&l.onTopbarPointerDown(...v))},[l.closeButtonVisible?t.renderSlot(l.$slots,"close-button",{key:0,onClick:l.onClickCloseButton,text:l.closeButtonText,title:l.closeButtonTitle||"Close"},()=>[t.createVNode(w,{id:`hison_popup_close_${l.id}`,class:t.normalizeClass(["hison-popup-close-btn","hison-pos-right","hison-pos-vertical-center","hison-size-s",...l.childClassList]),text:l.closeButtonText,title:l.closeButtonTitle||"Close",border:!1,"background-type":l.closeButtonBackgroundType,onClick:l.onClickCloseButton},t.createSlots({default:t.withCtx(()=>[l.$slots["close-label"]?t.renderSlot(l.$slots,"close-label",{key:0}):t.createCommentVNode("",!0)]),_:2},[l.$slots["close-icon"]?{name:"icon",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"close-icon")]),key:"0"}:void 0]),1032,["id","class","text","title","background-type","onClick"])]):t.createCommentVNode("",!0)],34),t.createElementVNode("div",ke,[t.renderSlot(l.$slots,"default")])],6)],6)],2)}const Le=ge._export_sfc(Se,[["render",we]]);exports.default=Le;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),n=require("./index-Cp0RZa-k.js"),Z=require("./scrollManager-CEEWQwoK.js"),ge=require("./_plugin-vue_export-helper-BHFhmbuH.js"),Ce={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!1},border:{type:Boolean,default:!0},zIndex:{type:Number,default:1200},position:{type:String,default:n.ScreenPosition.middleCenter,validator:l=>n.SCREEN_POSITION_VALUES.includes(l)},left:{type:Number,default:null},top:{type:Number,default:null},width:{type:Number,default:null},height:{type:Number,default:null},draggable:{type:Boolean,default:!0},showOverlay:{type:Boolean,default:!0},closeClickOverlay:{type:Boolean,default:!0},overlayStyle:{type:[String,Object,Array],required:!1},scrollLock:{type:Boolean,default:!0},enterAnimationClass:{type:String,required:!1},leaveAnimationClass:{type:String,required:!1}},Se=t.defineComponent({name:"HPopup",props:Ce,inheritAttrs:!1,emits:["mounted","responsive-change","open","close"],setup(l,{emit:c,slots:G}){const i=l.id||n.getUUID(),z=`hpopup:${i}`,E=n.useDevice(),w=t.ref(null),v=t.ref(null),s=t.ref(l.visible),J=t.ref(!0),f=t.ref(l.zIndex??1100),L=t.ref(l.position),r=t.ref(l.left??null),u=t.ref(l.top??null),m=t.ref(l.width??null),h=t.ref(l.height??null),B=t.ref(l.showOverlay),P=t.ref(l.closeClickOverlay),y=t.ref(l.scrollLock),d=t.ref(l.enterAnimationClass||"hison-popup-enter"),p=t.ref(l.leaveAnimationClass||"hison-popup-leave"),K=t.computed(()=>s.value?"":"hison-display-none"),N=t.ref([]),I=()=>{N.value=n.extractResponsiveClasses(n.toClassString(l.class)||"",E.value),n.addComponentNameToClass(N.value,"size",n.hisonCloser.componentStyle.size),n.addComponentNameToClass(N.value,"color","primary")},Q=t.computed(()=>[...n.extractPrefixedClasses(n.toClassString(l.class)||"","color")]),_=t.computed(()=>s.value&&B.value),ee=()=>{P.value&&g()},te=t.computed(()=>{const e={zIndex:f.value,position:"fixed"};if(r.value!=null||u.value!=null)return e.left=`${r.value??0}px`,e.top=`${u.value??0}px`,e;switch(e.left="",e.right="",e.top="",e.bottom="",e.transform="none",L.value){case n.ScreenPosition.topLeft:e.left="0",e.top="0";break;case n.ScreenPosition.topCenter:e.left="50%",e.top="0",e.transform="translateX(-50%)";break;case n.ScreenPosition.topRight:e.right="0",e.top="0";break;case n.ScreenPosition.middleLeft:e.left="0",e.top="50%",e.transform="translateY(-50%)";break;case n.ScreenPosition.middleCenter:e.left="50%",e.top="50%",e.transform="translate(-50%, -50%)";break;case n.ScreenPosition.middleRight:e.right="0",e.top="50%",e.transform="translateY(-50%)";break;case n.ScreenPosition.bottomLeft:e.left="0",e.bottom="0";break;case n.ScreenPosition.bottomCenter:e.left="50%",e.bottom="0",e.transform="translateX(-50%)";break;case n.ScreenPosition.bottomRight:e.right="0",e.bottom="0";break}return e}),le=t.computed(()=>{const o={zIndex:(f.value??1100)-1},a=l.overlayStyle;return a?Array.isArray(a)?[{...o},...a]:typeof a=="string"?[o,a]:{...o,...a}:o}),oe=t.computed(()=>{const e={};return m.value!=null&&(e.width=`${m.value}px`),h.value!=null&&(e.height=`${h.value}px`),e}),b=t.ref(l.border),ne=t.computed(()=>b.value?"hison-border":"hison-border-none"),se=t.computed(()=>b.value?"filled":"empty"),A=()=>{y.value&&Z.acquireScrollLock(i)},V=()=>{y.value&&Z.releaseScrollLock(i)},D=async()=>{const e=v.value;!e||!d.value||(e.classList.remove(p.value),e.offsetWidth,e.classList.add(d.value))},ae=async()=>{const e=v.value;!e||!p.value||(e.classList.remove(d.value),e.offsetWidth,e.classList.add(p.value),await new Promise(o=>setTimeout(o,200)))},$=async()=>{s.value||(s.value=!0,A(),await t.nextTick(),D(),c("open",t.unref(k)))},g=async()=>{if(s.value)try{await ae()}finally{s.value=!1,V(),c("close",t.unref(k))}},ie=async()=>s.value?g():$(),re=()=>{g()},C=t.ref(l.draggable),T=t.ref(!1);let x=0,X=0,U=0,Y=0,S=null,O=null;const ue=()=>{if(r.value==null&&u.value==null){const e=w.value;if(!e)return;const o=e.getBoundingClientRect();r.value=Math.round(o.left),u.value=Math.round(o.top)}},ce=(e,o)=>{const a=w.value;if(!a)return{l:e,t:o};const q=window.innerWidth,W=window.innerHeight,pe=a.offsetWidth,fe=a.offsetHeight,me=0,he=0,ye=Math.max(0,q-pe),be=Math.max(0,W-fe);return{l:Math.min(Math.max(e,me),ye),t:Math.min(Math.max(o,he),be)}},ve=(e,o)=>{O={l:e,t:o},S==null&&(S=requestAnimationFrame(()=>{O&&(r.value=O.l,u.value=O.t,O=null),S=null}))},M=e=>{if(!T.value)return;const o=e.clientX-x,a=e.clientY-X,{l:q,t:W}=ce(U+o,Y+a);ve(q,W)},R=()=>{T.value&&(T.value=!1,document.removeEventListener("pointermove",M,!0),document.removeEventListener("pointerup",R,!0),document.body.style.userSelect="")},de=e=>{!C.value||e.target.closest(".hison-popup-close-btn")||(ue(),T.value=!0,x=e.clientX,X=e.clientY,U=r.value??0,Y=u.value??0,document.body.style.userSelect="none",document.addEventListener("pointermove",M,!0),document.addEventListener("pointerup",R,!0))},H=()=>{S!=null&&(cancelAnimationFrame(S),S=null),document.removeEventListener("pointermove",M,!0),document.removeEventListener("pointerup",R,!0),document.body.style.userSelect="",T.value=!1},k=t.ref(null),j=()=>{n.hisonCloser.component.popupList[i]&&n.hisonCloser.component.popupList[i].isHisonvueComponent&&console.warn(`[Hisonvue] The popup ID is at risk of being duplicated. ${i}`),n.registerReloadable(z,()=>{F(),t.nextTick(j)}),I(),s.value&&(A(),t.nextTick(D)),k.value={isHisonvueComponent:!0,getId:()=>i,getType:()=>"popup",isVisible:()=>s.value,open:$,close:g,toggle:ie,setVisible:e=>e?$():g(),getZIndex:()=>f.value,setZIndex:e=>{f.value=e},getPosition:()=>L.value,setPosition:e=>{L.value=e},getLeft:()=>r.value,setLeft:e=>{r.value=e},getTop:()=>u.value,setTop:e=>{u.value=e},getWidth:()=>m.value,setWidth:e=>{m.value=e},getHeight:()=>h.value,setHeight:e=>{h.value=e},isDraggable:()=>C.value,setDraggable:e=>{C.value=e,e||H()},isOverlayShown:()=>B.value,setOverlayShown:e=>{B.value=e},isCloseClickOverlay:()=>P.value,setCloseClickOverlay:e=>{P.value=e},isScrollLocked:()=>y.value,setScrollLock:e=>{y.value=e,s.value&&(e?A():V())},isBorder:()=>b.value,setBorder:e=>{b.value=e},getAnimationClasses:()=>({enter:d.value,leave:p.value}),setAnimationClasses:e=>{"enter"in e&&(d.value=e.enter||""),"leave"in e&&(p.value=e.leave||"")},reload:()=>n.reloadHisonComponent(z)},n.hisonCloser.component.popupList[i]=k.value,c("mounted",k.value)},F=()=>{H(),n.unregisterReloadable(z),delete n.hisonCloser.component.popupList[i],s.value&&V()};return t.onMounted(j),t.onBeforeUnmount(F),t.watch(E,e=>{I(),c("responsive-change",e)}),t.watch(()=>l.visible,e=>{const o=!!e;o!==s.value&&(o?$():g())}),t.watch(()=>l.zIndex,e=>{const o=Number(e??1100);o!==f.value&&(f.value=o)}),t.watch(()=>l.position,e=>{e&&e!==L.value&&(L.value=e)}),t.watch(()=>l.left,e=>{const o=e==null?null:Number(e);o!==r.value&&(r.value=o)}),t.watch(()=>l.top,e=>{const o=e==null?null:Number(e);o!==u.value&&(u.value=o)}),t.watch(()=>l.width,e=>{const o=e==null?null:Number(e);o!==m.value&&(m.value=o)}),t.watch(()=>l.height,e=>{const o=e==null?null:Number(e);o!==h.value&&(h.value=o)}),t.watch(()=>l.draggable,e=>{const o=!!e;o!==C.value&&(C.value=o,o||H())}),t.watch(()=>l.showOverlay,e=>{const o=!!e;o!==B.value&&(B.value=o)}),t.watch(()=>l.closeClickOverlay,e=>{const o=!!e;o!==P.value&&(P.value=o)}),t.watch(()=>l.scrollLock,e=>{const o=!!e;o!==y.value&&(y.value=o,s.value&&(o?A():V()))}),t.watch(()=>l.border,e=>{const o=!!e;o!==b.value&&(b.value=o)}),t.watch(()=>l.enterAnimationClass,e=>{const o=e||"hison-popup-enter";o!==d.value&&(d.value=o)}),t.watch(()=>l.leaveAnimationClass,e=>{const o=e||"hison-popup-leave";o!==p.value&&(p.value=o)}),t.watch(()=>l.class,()=>{I()}),{id:i,props:l,popupRef:v,popupWrapperRef:w,visibleClass:K,responsiveClassList:N,childClassList:Q,borderClass:ne,wrapperStyle:te,overlayStyleWithZ:le,isOverlayVisible:_,sizeStyle:oe,closeButtonVisible:J,closeButtonBackgroundType:se,closeButtonText:"X",closeButtonTitle:"Close",draggable:C,onClickCloseButton:re,onOverlayClick:ee,onTopbarPointerDown:de,popupMethods:t.computed(()=>t.unref(k))}}}),ke={class:t.normalizeClass(["hison-popup-body"])};function we(l,c,G,i,z,E){const w=t.resolveComponent("HButton");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["hison-layer-host",l.visibleClass])},[l.isOverlayVisible?(t.openBlock(),t.createElementBlock("div",{key:0,class:"hison-popup-overlay",style:t.normalizeStyle(l.overlayStyleWithZ),onClick:c[0]||(c[0]=(...v)=>l.onOverlayClick&&l.onOverlayClick(...v))},null,4)):t.createCommentVNode("",!0),t.createElementVNode("div",{ref:"popupWrapperRef",class:t.normalizeClass(["hison-popup-wrapper",...l.responsiveClassList]),style:t.normalizeStyle(l.wrapperStyle)},[t.createElementVNode("div",{ref:"popupRef",class:t.normalizeClass(["hison-popup",l.borderClass]),style:t.normalizeStyle([l.sizeStyle,l.props.style]),role:"dialog"},[t.createElementVNode("div",{class:t.normalizeClass(["hison-popup-topbar",l.draggable?"hison-draggable":""]),onPointerdown:c[1]||(c[1]=(...v)=>l.onTopbarPointerDown&&l.onTopbarPointerDown(...v))},[l.closeButtonVisible?t.renderSlot(l.$slots,"close-button",{key:0,onClick:l.onClickCloseButton,text:l.closeButtonText,title:l.closeButtonTitle||"Close"},()=>[t.createVNode(w,{id:`hison_popup_close_${l.id}`,class:t.normalizeClass(["hison-popup-close-btn","hison-pos-right","hison-pos-vertical-center","hison-size-s",...l.childClassList]),text:l.closeButtonText,title:l.closeButtonTitle||"Close",border:!1,"background-type":l.closeButtonBackgroundType,onClick:l.onClickCloseButton},t.createSlots({default:t.withCtx(()=>[l.$slots["close-label"]?t.renderSlot(l.$slots,"close-label",{key:0}):t.createCommentVNode("",!0)]),_:2},[l.$slots["close-icon"]?{name:"icon",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"close-icon")]),key:"0"}:void 0]),1032,["id","class","text","title","background-type","onClick"])]):t.createCommentVNode("",!0)],34),t.createElementVNode("div",ke,[t.renderSlot(l.$slots,"default")])],6)],6)],2)}const Le=ge._export_sfc(Se,[["render",we]]);exports.default=Le;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as Ie, ref as o, computed as d, onMounted as Re, onBeforeUnmount as Me, watch as n, unref as F, nextTick as Z, resolveComponent as Ee, createElementBlock as ne, openBlock as se, normalizeClass as B, createCommentVNode as G, createElementVNode as V, normalizeStyle as J, renderSlot as W, createVNode as He, createSlots as Ve, withCtx as ae } from "vue";
|
|
2
|
-
import { S as We, i as c, g as De, u as qe, j as Xe, t as ie, e as xe, b as re, h as z, r as Ue, c as Ye, d as je } from "./index-
|
|
2
|
+
import { S as We, i as c, g as De, u as qe, j as Xe, t as ie, e as xe, b as re, h as z, r as Ue, c as Ye, d as je } from "./index-9uY2HzIO.mjs";
|
|
3
3
|
import { a as Fe, r as Ze } from "./scrollManager-BGnq4wyt.mjs";
|
|
4
4
|
import { _ as Ge } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
5
5
|
const Je = {
|