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.
Files changed (60) hide show
  1. package/dist/{HAccordion-BXzQTj-T.js → HAccordion-CcqP8KVN.js} +1 -1
  2. package/dist/{HAccordion-2BXGsG5B.mjs → HAccordion-DABKXdkp.mjs} +2 -2
  3. package/dist/{HBaggie-DP-oXbIt.js → HBaggie-Dc-KPRDG.js} +1 -1
  4. package/dist/{HBaggie-DbUnI6Cg.mjs → HBaggie-Dnq5t8un.mjs} +2 -2
  5. package/dist/{HBanner-C_RVokKc.js → HBanner-ClmYECkp.js} +1 -1
  6. package/dist/{HBanner-DS1wAGBj.mjs → HBanner-Cxl_X-Ui.mjs} +2 -2
  7. package/dist/{HButton-CJZsjgRh.mjs → HButton-BuJp6l32.mjs} +2 -2
  8. package/dist/{HButton-EmsUduJx.js → HButton-D7w35fAT.js} +1 -1
  9. package/dist/{HCalendar-BHuielDt.mjs → HCalendar-Cg1Ejr3b.mjs} +1 -1
  10. package/dist/{HCalendar-BQcg95QP.js → HCalendar-GfsTZV86.js} +1 -1
  11. package/dist/{HCaption-B_TLREQt.mjs → HCaption-BP0zpAoh.mjs} +1 -1
  12. package/dist/{HCaption-DnnfU-4f.js → HCaption-BZklN1hJ.js} +1 -1
  13. package/dist/{HChart-CPILy-I8.js → HChart-BoIsUY-U.js} +1 -1
  14. package/dist/{HChart-C9gfq-PC.mjs → HChart-ZHMznCxo.mjs} +1 -1
  15. package/dist/{HDrawer-tfvUaRKv.js → HDrawer-BdNXB7bZ.js} +1 -1
  16. package/dist/{HDrawer-D_kSIGBU.mjs → HDrawer-BfMsOIMU.mjs} +1 -1
  17. package/dist/{HDropdown-BjUvzvFC.js → HDropdown-CFFwgLxP.js} +1 -1
  18. package/dist/{HDropdown-BIPy8aU4.mjs → HDropdown-KwBejxH6.mjs} +2 -2
  19. package/dist/{HFileset-PW9YCJgS.js → HFileset-BVwhCpWk.js} +1 -1
  20. package/dist/{HFileset-BtK0nmzk.mjs → HFileset-NrFG7upU.mjs} +1 -1
  21. package/dist/{HGap-BbdxTgBt.js → HGap-D-OpGS6f.js} +1 -1
  22. package/dist/{HGap-CW02Hxpc.mjs → HGap-DQ7KNksh.mjs} +1 -1
  23. package/dist/{HGrid-CJ4-xVpR.mjs → HGrid-Dgv2QLud.mjs} +1 -1
  24. package/dist/{HGrid-olge21bD.js → HGrid-PEaylCn3.js} +1 -1
  25. package/dist/{HImagebox-AXcA-jAB.js → HImagebox-CVmax7-2.js} +1 -1
  26. package/dist/{HImagebox-FTiJuOTN.mjs → HImagebox-DGj7kyoL.mjs} +1 -1
  27. package/dist/{HInput-CZ11eUJB.js → HInput-CRyozCxo.js} +1 -1
  28. package/dist/{HInput-Cqo_Tfru.mjs → HInput-DzT-VAwv.mjs} +1 -1
  29. package/dist/{HInputGroup-zaJVW7RE.js → HInputGroup-CaYUBopI.js} +1 -1
  30. package/dist/{HInputGroup-SzCxRqaF.mjs → HInputGroup-CjBmNgV9.mjs} +1 -1
  31. package/dist/HLabel-BA2ph0V-.js +1 -0
  32. package/dist/{HLabel-DEVMDggG.mjs → HLabel-c8gR7-ur.mjs} +148 -131
  33. package/dist/{HLayout-Fh65aaVI.js → HLayout-Da1XBfUi.js} +1 -1
  34. package/dist/{HLayout-x_jVkIo4.mjs → HLayout-GazOMB2h.mjs} +1 -1
  35. package/dist/{HList-JIhEylRe.js → HList-B14zIkzR.js} +1 -1
  36. package/dist/{HList-V-fyd5fw.mjs → HList-tAOQaX_Q.mjs} +2 -2
  37. package/dist/{HModal-M0YUil9A.js → HModal-Boe8kpBb.js} +1 -1
  38. package/dist/{HModal-B7pME4H2.mjs → HModal-oGryjRSc.mjs} +1 -1
  39. package/dist/{HNote-HqNrL-U2.mjs → HNote-CZ02WSkW.mjs} +1 -1
  40. package/dist/{HNote-C5nujdV1.js → HNote-JSNpTQXQ.js} +1 -1
  41. package/dist/{HPagination-6aWyrTI-.js → HPagination-DlPSez0N.js} +1 -1
  42. package/dist/{HPagination-h8MaMUIE.mjs → HPagination-ZJZWJ7HP.mjs} +2 -2
  43. package/dist/HParagraph-BPtGEwa6.js +1 -0
  44. package/dist/{HParagraph-CP1IofM4.mjs → HParagraph-D0bGPbRd.mjs} +174 -157
  45. package/dist/{HPopup-Cj5IaN9N.js → HPopup-DhNEnDcR.js} +1 -1
  46. package/dist/{HPopup-DUnn4AIb.mjs → HPopup-Dv018FIN.mjs} +1 -1
  47. package/dist/{HSpinner-HdIJ62aF.js → HSpinner-BHcYPH5-.js} +1 -1
  48. package/dist/{HSpinner-bShjHynQ.mjs → HSpinner-Bvk7nkiS.mjs} +1 -1
  49. package/dist/{HTable-BuGAaqrq.mjs → HTable-C1ZdeMIP.mjs} +1 -1
  50. package/dist/{HTable-BgZ-XAZx.js → HTable-Dq_ySJrZ.js} +1 -1
  51. package/dist/hisonvue.cjs.js +1 -1
  52. package/dist/hisonvue.d.ts +58 -0
  53. package/dist/hisonvue.es.js +2 -2
  54. package/dist/{index-BU8h1J_W.mjs → index-9uY2HzIO.mjs} +1 -1
  55. package/dist/{index-BzCcaeiL.js → index-Cp0RZa-k.js} +1 -1
  56. package/dist/{setButtonCssEvent-Oy4ojn9y.js → setButtonCssEvent-CEQ0vsUw.js} +1 -1
  57. package/dist/{setButtonCssEvent-C-ESkC60.mjs → setButtonCssEvent-C_OU9wiq.mjs} +1 -1
  58. package/package.json +1 -1
  59. package/dist/HLabel-jZG7tY-0.js +0 -1
  60. package/dist/HParagraph-IvsIOdD1.js +0 -1
@@ -1,7 +1,7 @@
1
- import { defineComponent as be, ref as o, computed as a, useSlots as me, Text as Te, onMounted as W, onBeforeUnmount as we, watch as l, unref as Se, nextTick as Be, resolveComponent as ke, createElementBlock as F, openBlock as H, normalizeClass as K, createCommentVNode as X, createElementVNode as Ae, renderSlot as D, createVNode as Ee, createSlots as Ie, withCtx as Y, normalizeStyle as Le, Fragment as Ue, createTextVNode as Ve, toDisplayString as Re } from "vue";
2
- import { a0 as $e, B as De, f as x, a1 as Ne, a2 as Pe, T as Fe, g as He, u as Ke, w as xe, j as qe, t as J, e as ze, b as Q, h as I, r as Ge, c as Me, d as je } from "./index-BU8h1J_W.mjs";
3
- import { _ as Oe } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
4
- const We = {
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 || Fe.includes(t)
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: Pe.top,
79
- validator: (t) => Ne.includes(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: x.empty,
94
- validator: (t) => De.includes(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 || $e.includes(t)
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
- }, Xe = be({
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: We,
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 L = o(null), p = o(null), u = t.id ? t.id : He(), q = a(() => `hison_paragraph_copy_button_${u}`), y = `hparagraph:${u}`, c = Ke(), U = me(), g = o(t.visible), h = o(t.title || ""), v = o(t.text || ""), C = o(t.fontBold), b = o(t.fontItalic), m = o(t.fontThruline), T = o(t.fontUnderline), w = o(t.textAlign ?? xe.left), S = o(t.verticalAlign), B = o(t.border), f = o(t.backgroundType), k = o(t.whiteSpace), i = o(t.copyEnabled), A = o(t.showCopyButton), E = o(t.copyButtonText), V = a(() => U.default ? U.default() : []), z = a(
133
- () => V.value.length > 0 && V.value.every((e) => e.type === Te)
134
- ), R = a(() => !!U.default && !z.value), Z = a(() => !!U.default && V.value.length > 0);
135
- W(() => {
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 = V.value.map((n) => String(n.children ?? "")).join("");
138
- v.value = e;
143
+ const e = R.value.map((n) => String(n.children ?? "")).join("");
144
+ f.value = e;
139
145
  }
140
146
  });
141
- const _ = a(() => g.value ? "" : "hison-display-none"), ee = a(() => B.value ? "hison-border" : ""), te = a(() => {
142
- switch (f.value) {
143
- case x.empty:
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 x.transparent:
151
+ case G.transparent:
146
152
  return "hison-bg-transparent";
147
153
  default:
148
154
  return "hison-bg-filled";
149
155
  }
150
- }), ne = a(() => C.value ? "hison-font-bold" : ""), ae = a(() => b.value ? "hison-font-italic" : ""), oe = a(() => m.value ? "hison-font-thruline" : ""), le = a(() => T.value ? "hison-font-underline" : ""), se = a(() => i.value ? "" : "hison-no-select"), $ = o([]), N = () => {
151
- $.value = ze(J(t.class) || "", c.value), Q($.value, "size", I.componentStyle.size), Q($.value, "color", "primary");
152
- }, ie = a(() => {
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(...qe(J(t.class) || "", "color")), e;
155
- }), re = a(() => k.value ?? "pre-wrap"), ue = a(() => {
156
- switch (re.value) {
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
- }), ce = a(() => {
171
- switch (w.value) {
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
- }), de = a(() => {
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
- }), pe = () => {
189
- const e = L.value;
194
+ }), ye = () => {
195
+ const e = U.value;
190
196
  return e ? e.innerText ?? "" : "";
191
197
  };
192
- function G() {
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 M = async () => {
202
+ const j = async () => {
197
203
  if (!i.value) return !1;
198
- const e = pe();
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 = L.value;
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 Ce = document.execCommand("copy");
211
- return r == null || r.removeAllRanges(), Ce;
216
+ const Te = document.execCommand("copy");
217
+ return r == null || r.removeAllRanges(), Te;
212
218
  } catch {
213
219
  return !1;
214
220
  }
215
- }, P = async (e, n) => {
216
- s("copy-click", { src: e, event: n, api: p.value });
221
+ }, F = async (e, n) => {
222
+ s("copy-click", { src: e, event: n, api: v.value });
217
223
  try {
218
- const d = await M();
219
- s("copied", d, p.value);
224
+ const d = await j();
225
+ s("copied", d, v.value);
220
226
  } catch (d) {
221
- s("copy-error", d, p.value);
227
+ s("copy-error", d, v.value);
222
228
  }
223
- }, ve = async (e) => {
224
- await P("button", e);
225
- }, fe = async (e) => {
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 (G()) return;
233
- e.preventDefault(), e.stopPropagation(), await P("keyboard", e);
238
+ if (M()) return;
239
+ e.preventDefault(), e.stopPropagation(), await F("keyboard", e);
234
240
  }
235
- }, ye = async (e) => {
241
+ }, Ce = async (e) => {
236
242
  if (!i.value) {
237
243
  e.preventDefault();
238
244
  return;
239
245
  }
240
- G() || (e.preventDefault(), await P("native", e));
241
- }, ge = (e) => {
246
+ M() || (e.preventDefault(), await F("native", e));
247
+ }, be = (e) => {
242
248
  i.value || e.preventDefault();
243
- }, he = (e) => {
249
+ }, me = (e) => {
244
250
  i.value || e.preventDefault();
245
- }, j = () => {
246
- I.component.paragraphList[u] && I.component.paragraphList[u].isHisonvueComponent && console.warn(`[Hisonvue] The paragraph ID is at risk of being duplicated. ${u}`), Ge(y, () => {
247
- O(), Be(j);
248
- }), N(), p.value = {
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: () => g.value,
258
+ isVisible: () => h.value,
253
259
  setVisible: (e) => {
254
- g.value = e;
260
+ h.value = e;
255
261
  },
256
- getTitle: () => h.value,
262
+ getTitle: () => C.value,
257
263
  setTitle: (e) => {
258
- h.value = e || "";
264
+ C.value = e || "";
259
265
  },
260
- getText: () => R.value ? "" : v.value,
266
+ getText: () => $.value ? "" : f.value,
261
267
  setText: (e) => {
262
- R.value || (v.value = e ?? "");
268
+ $.value || (f.value = e ?? "");
263
269
  },
264
- getTextAlign: () => w.value,
270
+ getTextAlign: () => B.value,
265
271
  setTextAlign: (e) => {
266
- (e === "left" || e === "center" || e === "right") && (w.value = e);
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: () => C.value,
278
+ isFontBold: () => b.value,
273
279
  setFontBold: (e) => {
274
- C.value = e;
280
+ b.value = e;
275
281
  },
276
- isFontItalic: () => b.value,
282
+ isFontItalic: () => m.value,
277
283
  setFontItalic: (e) => {
278
- b.value = e;
284
+ m.value = e;
279
285
  },
280
- isFontThruline: () => m.value,
286
+ isFontThruline: () => T.value,
281
287
  setFontThruline: (e) => {
282
- m.value = e;
288
+ T.value = e;
283
289
  },
284
- isFontUnderline: () => T.value,
290
+ isFontUnderline: () => w.value,
285
291
  setFontUnderline: (e) => {
286
- T.value = e;
292
+ w.value = e;
287
293
  },
288
- isBorder: () => B.value,
294
+ isBorder: () => k.value,
289
295
  setBorder: (e) => {
290
- B.value = e;
296
+ k.value = e;
291
297
  },
292
- getBackgroundType: () => f.value,
298
+ getBackgroundType: () => p.value,
293
299
  setBackgroundType: (e) => {
294
- f.value = e;
300
+ p.value = e;
295
301
  },
296
- getWhiteSpace: () => k.value,
302
+ getWhiteSpace: () => A.value,
297
303
  setWhiteSpace: (e) => {
298
- k.value = e;
304
+ A.value = e;
299
305
  },
300
- getCopyButtonText: () => E.value,
306
+ getCopyButtonText: () => I.value,
301
307
  setCopyButtonText: (e) => {
302
- E.value = e;
308
+ I.value = e;
303
309
  },
304
310
  isCopyEnabled: () => i.value,
305
311
  setCopyEnabled: (e) => {
306
312
  i.value = e;
307
313
  },
308
- isShowCopyButton: () => A.value,
314
+ isShowCopyButton: () => E.value,
309
315
  setShowCopyButton: (e) => {
310
- A.value = e;
316
+ E.value = e;
311
317
  },
312
- copy: async () => await M(),
313
- reload: () => Me(y)
314
- }, I.component.paragraphList[u] = p.value, s("mounted", p.value);
315
- }, O = () => {
316
- je(y), delete I.component.paragraphList[u];
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 W(j), we(O), l(c, (e) => {
319
- N(), s("responsive-change", e);
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 !== g.value && (g.value = n);
332
+ n !== h.value && (h.value = n);
323
333
  }), l(() => t.title, (e) => {
324
334
  const n = e ?? "";
325
- n !== h.value && (h.value = n);
335
+ n !== C.value && (C.value = n);
326
336
  }), l(() => t.text, (e) => {
327
337
  const n = e ?? "";
328
- !R.value && n !== v.value && (v.value = n);
338
+ !$.value && n !== f.value && (f.value = n);
329
339
  }), l(() => t.fontBold, (e) => {
330
340
  const n = !!e;
331
- n !== C.value && (C.value = n);
341
+ n !== b.value && (b.value = n);
332
342
  }), l(() => t.fontItalic, (e) => {
333
343
  const n = !!e;
334
- n !== b.value && (b.value = n);
344
+ n !== m.value && (m.value = n);
335
345
  }), l(() => t.fontThruline, (e) => {
336
346
  const n = !!e;
337
- n !== m.value && (m.value = n);
347
+ n !== T.value && (T.value = n);
338
348
  }), l(() => t.fontUnderline, (e) => {
339
349
  const n = !!e;
340
- n !== T.value && (T.value = n);
350
+ n !== w.value && (w.value = n);
341
351
  }), l(() => t.textAlign, (e) => {
342
- e && e !== w.value && (e === "left" || e === "center" || e === "right") && (w.value = 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 !== k.value && (k.value = n);
357
+ n !== A.value && (A.value = n);
348
358
  }), l(() => t.border, (e) => {
349
359
  const n = !!e;
350
- n !== B.value && (B.value = n);
360
+ n !== k.value && (k.value = n);
351
361
  }), l(() => t.backgroundType, (e) => {
352
- e && e !== f.value && (f.value = 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 !== A.value && (A.value = n);
368
+ n !== E.value && (E.value = n);
359
369
  }), l(() => t.copyButtonText, (e) => {
360
370
  const n = e ?? "copy";
361
- n !== E.value && (E.value = 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
- N();
376
+ P();
364
377
  }), {
365
- paraRef: L,
366
- paragraphMethods: a(() => Se(p)),
378
+ paraRef: U,
379
+ paragraphMethods: a(() => Ae(v)),
367
380
  props: t,
368
381
  id: u,
369
382
  copyButtonId: q,
370
- title: h,
371
- visibleClass: _,
372
- borderClass: ee,
373
- backgroundType: f,
374
- backgroundTypeClass: te,
375
- fontBoldClass: ne,
376
- fontItalicClass: ae,
377
- fontThrulineClass: oe,
378
- fontUnderlineClass: le,
379
- responsiveClassList: $,
380
- buttonClassList: ie,
381
- internalText: v,
382
- copyButtonText: E,
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: A,
385
- hasElementSlot: R,
386
- hasAnySlot: Z,
387
- whiteSpaceClass: ue,
388
- textAlignClass: ce,
389
- verticalAlignClass: de,
390
- copyGuardClass: se,
391
- onKeydown: fe,
392
- onCopyEvent: ye,
393
- onCutEvent: ge,
394
- onSelectStart: he,
395
- onCopyButtonClick: ve
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
- }), Ye = {
413
+ }), Ze = {
399
414
  key: 0,
400
415
  class: "hison-paragraph-copybtn"
401
- }, Je = ["title"];
402
- function Qe(t, s, L, p, u, q) {
403
- const y = ke("HButton");
404
- return H(), F("div", {
405
- class: K([
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 ? (H(), F("div", Ye, [
413
- D(t.$slots, "copy-button", {
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
- Ee(y, {
432
+ Ue(g, {
418
433
  id: t.copyButtonId,
419
- class: K([...t.buttonClassList, "hison-size-s"]),
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
- }, Ie({
426
- default: Y(() => [
427
- t.$slots["copy-label"] ? D(t.$slots, "copy-label", { key: 0 }) : X("", !0)
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: Y(() => [
434
- D(t.$slots, "copy-icon")
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
- ])) : X("", !0),
441
- Ae("p", {
455
+ ])) : Y("", !0),
456
+ Le("p", {
442
457
  ref: "paraRef",
443
- class: K(["hison-paragraph", [
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: Le(t.props.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 ? D(t.$slots, "default", { key: 0 }) : (H(), F(Ue, { key: 1 }, [
464
- Ve(Re(t.internalText), 1)
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, Je)
483
+ ], 46, _e)
467
484
  ], 2);
468
485
  }
469
- const tt = /* @__PURE__ */ Oe(Xe, [["render", Qe]]);
486
+ const ot = /* @__PURE__ */ Ye(Qe, [["render", et]]);
470
487
  export {
471
- tt as default
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-BU8h1J_W.mjs";
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 = {