hisonvue 1.0.0

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 (155) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +248 -0
  3. package/dist/HAccordion-CPtgQUK0.js +1 -0
  4. package/dist/HAccordion-ll-4cIAw.mjs +262 -0
  5. package/dist/HBaggie-D6omQoFh.js +1 -0
  6. package/dist/HBaggie-D_7mEiuV.mjs +283 -0
  7. package/dist/HBanner-DmcMOFqS.mjs +420 -0
  8. package/dist/HBanner-Io4SdGGs.js +1 -0
  9. package/dist/HButton-DAVuDmOQ.js +1 -0
  10. package/dist/HButton-DAriO81x.mjs +256 -0
  11. package/dist/HCalendar-DKwGatUk.js +2 -0
  12. package/dist/HCalendar-w18iIB90.mjs +3387 -0
  13. package/dist/HCaption-6CbSqRA7.js +1 -0
  14. package/dist/HCaption-DwsXHDNK.mjs +275 -0
  15. package/dist/HChart-C86JXUyW.js +1 -0
  16. package/dist/HChart-CcArHFr0.mjs +179 -0
  17. package/dist/HDrawer-DG1O42iF.mjs +439 -0
  18. package/dist/HDrawer-U5VC_okK.js +1 -0
  19. package/dist/HDropdown-Bs7AfefJ.mjs +393 -0
  20. package/dist/HDropdown-D4RAGmjE.js +1 -0
  21. package/dist/HFileset-BGuP9O4l.mjs +578 -0
  22. package/dist/HFileset-CuPR6Hwf.js +2 -0
  23. package/dist/HGap-BPAdnOQz.js +1 -0
  24. package/dist/HGap-DzGrfWVt.mjs +233 -0
  25. package/dist/HGrid-BiIhVCv_.mjs +345 -0
  26. package/dist/HGrid-C3EV_pgM.js +1 -0
  27. package/dist/HImagebox-D_DKeCrO.mjs +654 -0
  28. package/dist/HImagebox-t_UdFjQO.js +2 -0
  29. package/dist/HInput-BEyJqYkD.mjs +1103 -0
  30. package/dist/HInput-DMGLY473.js +1 -0
  31. package/dist/HInputGroup-D37WTYoI.mjs +281 -0
  32. package/dist/HInputGroup-Dcfr23sZ.js +1 -0
  33. package/dist/HLabel-B2FOqSiS.mjs +369 -0
  34. package/dist/HLabel-Dm48mSwn.js +1 -0
  35. package/dist/HLayout-BbCEm_aO.mjs +196 -0
  36. package/dist/HLayout-C1e4BZ_K.js +1 -0
  37. package/dist/HList-CAeYb-hz.mjs +419 -0
  38. package/dist/HList-eNXmMf27.js +1 -0
  39. package/dist/HModal-BDBEEpKm.mjs +778 -0
  40. package/dist/HModal-GODLq3wH.js +1 -0
  41. package/dist/HNote-CWnUjt3_.mjs +934 -0
  42. package/dist/HNote-D_Xwu9oL.js +1 -0
  43. package/dist/HPagination-Db_L9wv-.js +1 -0
  44. package/dist/HPagination-e5e2a5GS.mjs +496 -0
  45. package/dist/HParagraph-BRuSeOMU.js +1 -0
  46. package/dist/HParagraph-DYuB-qjY.mjs +463 -0
  47. package/dist/HPopup-Brp1FVpm.mjs +431 -0
  48. package/dist/HPopup-ChkoI3xm.js +1 -0
  49. package/dist/HSpinner-DDtU9PL_.js +1 -0
  50. package/dist/HSpinner-DOq2k5kT.mjs +281 -0
  51. package/dist/HTable-DGFnzD4u.js +1 -0
  52. package/dist/HTable-GCDP5O_J.mjs +620 -0
  53. package/dist/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
  54. package/dist/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
  55. package/dist/ar.es-CKau4tBl.js +5 -0
  56. package/dist/ar.es-XxSuE68c.mjs +57 -0
  57. package/dist/bg.es-BJ7fu6yy.mjs +57 -0
  58. package/dist/bg.es-Melqx1M5.js +5 -0
  59. package/dist/bn.es-CYlBkxc5.mjs +57 -0
  60. package/dist/bn.es-ClbAZ4WP.js +5 -0
  61. package/dist/bs.es-KjOcbE96.js +5 -0
  62. package/dist/bs.es-yMnaKmdi.mjs +57 -0
  63. package/dist/ca.es-BaGTENcW.js +5 -0
  64. package/dist/ca.es-DIhlxmQc.mjs +67 -0
  65. package/dist/cs.es-BN8oxRXQ.mjs +57 -0
  66. package/dist/cs.es-ChOlHqBr.js +5 -0
  67. package/dist/da.es-DJB5lAli.mjs +57 -0
  68. package/dist/da.es-DOFXbf8-.js +5 -0
  69. package/dist/de.es-DwE82Kaw.js +5 -0
  70. package/dist/de.es-glb8GeJh.mjs +57 -0
  71. package/dist/drag-and-drop.es-4ttM1tRs.js +5 -0
  72. package/dist/drag-and-drop.es-Ckzp6XEn.mjs +183 -0
  73. package/dist/el.es-CNrCgzYI.js +5 -0
  74. package/dist/el.es-_bBZf22h.mjs +76 -0
  75. package/dist/en.es-CV9nmQGr.mjs +57 -0
  76. package/dist/en.es-CgL601qd.js +5 -0
  77. package/dist/es.es-CZjcWK54.mjs +57 -0
  78. package/dist/es.es-IdFGKY7Q.js +5 -0
  79. package/dist/et.es-BygWmV3P.js +5 -0
  80. package/dist/et.es-CjvQAzNF.mjs +57 -0
  81. package/dist/fa.es-DW_0SmsT.js +5 -0
  82. package/dist/fa.es-DykeFwDA.mjs +57 -0
  83. package/dist/fi.es-Bl7Pp7AO.mjs +57 -0
  84. package/dist/fi.es-pgfJlZ8i.js +5 -0
  85. package/dist/fr.es-CNKVhFfO.mjs +57 -0
  86. package/dist/fr.es-OENguFuM.js +5 -0
  87. package/dist/he.es-bixEnAeH.js +5 -0
  88. package/dist/he.es-nF4GFhjH.mjs +57 -0
  89. package/dist/hisonvue.cjs.js +1 -0
  90. package/dist/hisonvue.css +1 -0
  91. package/dist/hisonvue.d.ts +19934 -0
  92. package/dist/hisonvue.es.js +114 -0
  93. package/dist/hr.es-CkRAP94O.js +5 -0
  94. package/dist/hr.es-QFfz660j.mjs +57 -0
  95. package/dist/hu.es-Ck2rE01V.mjs +57 -0
  96. package/dist/hu.es-DG6HeiQJ.js +5 -0
  97. package/dist/id.es-D4tPi6wP.js +5 -0
  98. package/dist/id.es-Je7FEUJ5.mjs +57 -0
  99. package/dist/index-BmKMHsSZ.js +153 -0
  100. package/dist/index-DUh7pai4.mjs +19976 -0
  101. package/dist/is.es-CDFqLYCV.js +5 -0
  102. package/dist/is.es-bzprHvXI.mjs +57 -0
  103. package/dist/it.es-BHgrw_C6.js +5 -0
  104. package/dist/it.es-CJtfqmNS.mjs +57 -0
  105. package/dist/ja.es-BaiGjqZ6.mjs +57 -0
  106. package/dist/ja.es-D-lxWwyb.js +5 -0
  107. package/dist/ka.es-CnnB6q4A.js +5 -0
  108. package/dist/ka.es-x9QJo_dl.mjs +57 -0
  109. package/dist/ko.es-6c447eTS.mjs +57 -0
  110. package/dist/ko.es-b18aaB3V.js +5 -0
  111. package/dist/lt.es-2twYdvmJ.mjs +57 -0
  112. package/dist/lt.es-BY9UQ6wZ.js +5 -0
  113. package/dist/mn.es-BLQRG1uu.mjs +57 -0
  114. package/dist/mn.es-YFS7gSdf.js +5 -0
  115. package/dist/nl.es-BEx-4hnj.js +5 -0
  116. package/dist/nl.es-bB1qWR_S.mjs +57 -0
  117. package/dist/no.es-BQnRWlWR.js +5 -0
  118. package/dist/no.es-CWDVXpTf.mjs +57 -0
  119. package/dist/pl.es-CKCsZ_02.js +5 -0
  120. package/dist/pl.es-Dzct23w9.mjs +57 -0
  121. package/dist/pt-br.es-BeBuiitI.mjs +57 -0
  122. package/dist/pt-br.es-oH7qh6Fd.js +5 -0
  123. package/dist/pt-pt.es-BeBuiitI.mjs +57 -0
  124. package/dist/pt-pt.es-DLk5I0ej.js +5 -0
  125. package/dist/ro.es-DfMVJ30M.mjs +57 -0
  126. package/dist/ro.es-DgTen1Dh.js +5 -0
  127. package/dist/ru.es-Bv9UvrBe.mjs +67 -0
  128. package/dist/ru.es-jGIQfREl.js +5 -0
  129. package/dist/scrollManager-BGnq4wyt.mjs +14 -0
  130. package/dist/scrollManager-CEEWQwoK.js +1 -0
  131. package/dist/setButtonCssEvent-B9WTs2X7.js +1 -0
  132. package/dist/setButtonCssEvent-dBs1GcAh.mjs +70 -0
  133. package/dist/sk.es-CUOTpLuL.mjs +57 -0
  134. package/dist/sk.es-D2bhVb26.js +5 -0
  135. package/dist/sl.es-DeIGgZbR.mjs +57 -0
  136. package/dist/sl.es-TV8Uraa1.js +5 -0
  137. package/dist/sq.es-CQJJrZHv.mjs +67 -0
  138. package/dist/sq.es-Cc65zxbr.js +5 -0
  139. package/dist/sr.es-CKS0AkiW.mjs +57 -0
  140. package/dist/sr.es-D5VNA_GW.js +5 -0
  141. package/dist/sv.es-ChHQRrAe.mjs +57 -0
  142. package/dist/sv.es-dBeK_DZs.js +5 -0
  143. package/dist/tr.es-B3v90gVv.mjs +57 -0
  144. package/dist/tr.es-BUz4S13G.js +5 -0
  145. package/dist/uk.es-B8uaeLcK.js +5 -0
  146. package/dist/uk.es-CiR4NnbN.mjs +67 -0
  147. package/dist/vi.es-2OFMtbQI.js +5 -0
  148. package/dist/vi.es-DFDi5l7p.mjs +67 -0
  149. package/dist/zh-cn.es-9cbEAuAi.mjs +67 -0
  150. package/dist/zh-cn.es-fDHCbCIg.js +5 -0
  151. package/dist/zh-hk.es-COzeh5F8.js +5 -0
  152. package/dist/zh-hk.es-z0tio4jE.mjs +67 -0
  153. package/nuxt/module.mjs +39 -0
  154. package/nuxt/plugin.mjs +21 -0
  155. package/package.json +53 -0
@@ -0,0 +1,439 @@
1
+ import { defineComponent as ze, ref as n, computed as u, onMounted as Ve, onBeforeUnmount as Pe, watch as a, unref as j, nextTick as A, resolveComponent as He, createElementBlock as se, openBlock as ne, normalizeClass as R, createCommentVNode as Y, createElementVNode as F, normalizeStyle as G, renderSlot as D, createVNode as Re, createSlots as De, withCtx as ae } from "vue";
2
+ import { g as Ne, u as We, j as qe, t as ie, e as Ue, b as re, h as O, r as Xe, c as Ze, d as Me } from "./index-DUh7pai4.mjs";
3
+ import { a as je, r as Ye } from "./scrollManager-BGnq4wyt.mjs";
4
+ import { _ as Fe } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
5
+ const Ge = ["top", "bottom", "left", "right"], Je = {
6
+ /**
7
+ * Unique identifier for the drawer instance.
8
+ * - Retrieve runtime methods via `hison.component.getDrawer(id)`
9
+ * - Duplicate `id` values will throw an error at mount time
10
+ */
11
+ id: { type: String, required: !1 },
12
+ /**
13
+ * Custom class applied to the drawer wrapper scope.
14
+ * - Accepts string/array/object (Vue class binding formats)
15
+ * - You can use responsive tokens such as `hison-col-*`, `hison-size-*`, `hison-color-*`
16
+ * - Processed internally to apply device-specific classes
17
+ */
18
+ class: {
19
+ type: [String, Array, Object],
20
+ required: !1
21
+ },
22
+ /**
23
+ * Inline style(s) for the drawer **dialog element** (not the overlay nor the fixed wrapper).
24
+ * - Accepts string, object, or array of objects (Vue style binding formats)
25
+ * - Note: inline width/height here override `width`/`height` props
26
+ */
27
+ style: {
28
+ type: [String, Object, Array],
29
+ required: !1
30
+ },
31
+ /**
32
+ * Initial visibility of the drawer.
33
+ * - Runtime visibility is controlled **only** via methods (`open/close/toggle/setVisible`)
34
+ * - Default: `false`
35
+ */
36
+ visible: { type: Boolean, default: !1 },
37
+ /**
38
+ * Whether the drawer has border/shadow styling.
39
+ * - Default: `true`
40
+ */
41
+ border: { type: Boolean, default: !0 },
42
+ /**
43
+ * Stacking order for this drawer **wrapper** (fixed container).
44
+ * - Applied to `.hison-drawer-wrapper`; the overlay uses `zIndex - 1`
45
+ * - Default: `1100`
46
+ */
47
+ zIndex: { type: Number, default: 1100 },
48
+ /**
49
+ * On-screen position of the drawer (anchored to screen edge).
50
+ * - Tokens: 'top' | 'bottom' | 'left' | 'right'
51
+ * - Default: `'bottom'`
52
+ */
53
+ position: {
54
+ type: String,
55
+ default: "bottom",
56
+ validator: (t) => Ge.includes(t)
57
+ },
58
+ /**
59
+ * Drawer width in pixels.
60
+ * - For left/right drawers: applied as horizontal size
61
+ * - For top/bottom drawers: default is `100vw`, but explicit `width` overrides it
62
+ * - Inline `style.width` (if provided) takes precedence over this prop
63
+ */
64
+ width: { type: Number, default: null },
65
+ /**
66
+ * Drawer height in pixels.
67
+ * - For top/bottom drawers: applied as vertical size
68
+ * - For left/right drawers: default is `100vh`, but explicit `height` overrides it
69
+ * - Inline `style.height` (if provided) takes precedence over this prop
70
+ */
71
+ height: { type: Number, default: null },
72
+ /**
73
+ * Whether an internal close button is shown (top-right inside drawer).
74
+ * - Default: `true`
75
+ */
76
+ closeButtonVisible: { type: Boolean, default: !0 },
77
+ /**
78
+ * Label text for the close button.
79
+ * - Default: `'X'`
80
+ */
81
+ closeButtonText: { type: String, default: "X" },
82
+ /**
83
+ * Title attribute (tooltip) for the close button.
84
+ * - Default: `'close'`
85
+ */
86
+ closeButtonTitle: { type: String, default: "close" },
87
+ /**
88
+ * Enables swipe-to-close gestures.
89
+ * - Top: swipe down closes
90
+ * - Bottom: swipe up closes
91
+ * - Left: swipe left closes
92
+ * - Right: swipe right closes
93
+ * - Default: `true`
94
+ */
95
+ swipeClose: { type: Boolean, default: !0 },
96
+ /**
97
+ * Whether the overlay (backdrop) is rendered at all.
98
+ * - Default: `true`
99
+ */
100
+ showOverlay: { type: Boolean, default: !0 },
101
+ /**
102
+ * Whether clicking the overlay closes the drawer.
103
+ * - Default: `true`
104
+ */
105
+ closeClickOverlay: { type: Boolean, default: !0 },
106
+ /**
107
+ * Styles applied to the overlay element.
108
+ * - Accepts string/object/array; merged with an internal `{ zIndex: (zIndex - 1) }`
109
+ */
110
+ overlayStyle: {
111
+ type: [String, Object, Array],
112
+ required: !1
113
+ },
114
+ /**
115
+ * Locks page scroll while the drawer is open (reference-counted across nested overlays).
116
+ * - Default: `true`
117
+ */
118
+ scrollLock: { type: Boolean, default: !0 },
119
+ /**
120
+ * Optional enter animation class for the drawer.
121
+ * - Default: chosen internally by `position` if not provided
122
+ */
123
+ enterAnimationClass: { type: String, required: !1 },
124
+ /**
125
+ * Optional leave animation class for the drawer.
126
+ * - Default: chosen internally by `position` if not provided
127
+ */
128
+ leaveAnimationClass: { type: String, required: !1 }
129
+ }, Ke = ze({
130
+ name: "HDrawer",
131
+ props: Je,
132
+ inheritAttrs: !1,
133
+ emits: ["mounted", "responsive-change", "open", "close"],
134
+ setup(t, { emit: y, slots: ue }) {
135
+ const c = t.id || Ne(), $ = `hdrawer:${c}`, N = We(), W = n(null), h = n(null), r = n(t.visible), g = n(t.zIndex ?? 1050), b = n(t.border), k = n(t.showOverlay), S = n(t.closeClickOverlay), p = n(t.scrollLock), o = n(t.position), v = n(t.width ?? null), d = n(t.height ?? null), L = n(t.closeButtonVisible), ce = u(() => b.value), ve = u(() => b.value ? "filled" : "empty"), q = n(t.closeButtonText || "X"), U = n(t.closeButtonTitle || "Close"), T = n(t.swipeClose), I = {
136
+ top: "hison-drawer-enter-top",
137
+ bottom: "hison-drawer-enter-bottom",
138
+ left: "hison-drawer-enter-left",
139
+ right: "hison-drawer-enter-right"
140
+ }, E = {
141
+ top: "hison-drawer-leave-top",
142
+ bottom: "hison-drawer-leave-bottom",
143
+ left: "hison-drawer-leave-left",
144
+ right: "hison-drawer-leave-right"
145
+ }, m = n(t.enterAnimationClass || I[o.value]), w = n(t.leaveAnimationClass || E[o.value]), de = u(() => "hison-bg-empty"), fe = u(() => b.value ? "hison-border" : ""), ye = u(() => r.value ? "" : "hison-display-none"), z = n([]), X = () => {
146
+ var e;
147
+ z.value = Ue(ie(t.class) || "", N.value), re(z.value, "size", ((e = O.componentStyle) == null ? void 0 : e.size) || "m"), re(z.value, "color", "primary");
148
+ }, he = u(() => [
149
+ ...qe(ie(t.class) || "", "color")
150
+ ]), me = u(() => r.value && k.value), we = u(() => {
151
+ const l = { zIndex: (g.value ?? 1050) - 1 }, s = t.overlayStyle;
152
+ return s ? Array.isArray(s) ? [{ ...l }, ...s] : typeof s == "string" ? [l, s] : { ...l, ...s } : l;
153
+ }), be = () => {
154
+ S.value && f();
155
+ }, Ce = u(() => {
156
+ const e = { zIndex: g.value, position: "fixed", inset: "auto" };
157
+ switch (e.left = "", e.right = "", e.top = "", e.bottom = "", o.value) {
158
+ case "top":
159
+ e.left = "0", e.right = "0", e.top = "0";
160
+ break;
161
+ case "bottom":
162
+ e.left = "0", e.right = "0", e.bottom = "0";
163
+ break;
164
+ case "left":
165
+ e.left = "0", e.top = "0", e.bottom = "0";
166
+ break;
167
+ case "right":
168
+ e.right = "0", e.top = "0", e.bottom = "0";
169
+ break;
170
+ }
171
+ return e;
172
+ }), ge = u(() => {
173
+ const e = {};
174
+ return o.value === "top" || o.value === "bottom" ? (e.width = "100vw", d.value != null && (e.height = `${d.value}px`), v.value != null && (e.width = `${v.value}px`)) : (e.height = "100vh", v.value != null && (e.width = `${v.value}px`), d.value != null && (e.height = `${d.value}px`)), e;
175
+ }), V = () => {
176
+ p.value && je(c);
177
+ }, P = () => {
178
+ p.value && Ye(c);
179
+ }, J = async () => {
180
+ const e = h.value;
181
+ !e || !m.value || (e.classList.remove(w.value), e.offsetWidth, e.classList.add(m.value));
182
+ }, pe = async () => {
183
+ const e = h.value;
184
+ !e || !w.value || (e.classList.remove(m.value), e.offsetWidth, e.classList.add(w.value), await new Promise((l) => setTimeout(l, 200)));
185
+ }, H = async () => {
186
+ r.value || (r.value = !0, V(), await A(), J(), y("open", j(B)));
187
+ }, f = async () => {
188
+ if (r.value)
189
+ try {
190
+ await pe();
191
+ } finally {
192
+ r.value = !1, P(), y("close", j(B));
193
+ }
194
+ }, Be = async () => r.value ? f() : H(), ke = () => f();
195
+ let Z = !1, K = 0, Q = 0;
196
+ const x = 40, Se = (e) => {
197
+ T.value && (Z = !0, K = e.clientX, Q = e.clientY, window.addEventListener("pointerup", Le, { once: !0, capture: !0 }));
198
+ }, Le = (e) => {
199
+ if (!Z) return;
200
+ Z = !1;
201
+ const l = e.clientX - K, s = e.clientY - Q, i = Math.abs(l), C = Math.abs(s);
202
+ (o.value === "top" && C > i && s > x || o.value === "bottom" && C > i && s < -40 || o.value === "left" && i > C && l < -40 || o.value === "right" && i > C && l > x) && f();
203
+ }, Te = 200, Ae = "ease";
204
+ function _(e, l, s, i, C = Te, Ie = Ae) {
205
+ return new Promise((Ee) => {
206
+ e.style.transition = "none", e.style[l] = `${s}px`, e.offsetWidth, e.style.transition = `${l} ${C}ms ${Ie}`, e.style[l] = `${i}px`;
207
+ const M = () => {
208
+ e.removeEventListener("transitionend", M), e.style.transition = "", Ee();
209
+ };
210
+ e.addEventListener("transitionend", M), setTimeout(M, C + 50);
211
+ });
212
+ }
213
+ const Oe = u(() => o.value === "left" || o.value === "right"), $e = u(() => o.value === "top" || o.value === "bottom");
214
+ async function ee(e, l = !0) {
215
+ const s = h.value;
216
+ if (!s) {
217
+ v.value = e;
218
+ return;
219
+ }
220
+ const i = s.getBoundingClientRect().width;
221
+ if ((e ?? i) === i) {
222
+ v.value = e;
223
+ return;
224
+ }
225
+ if (!l || e == null || !Oe.value) {
226
+ v.value = e;
227
+ return;
228
+ }
229
+ v.value = e, await A(), await _(s, "width", i, e);
230
+ }
231
+ async function te(e, l = !0) {
232
+ const s = h.value;
233
+ if (!s) {
234
+ d.value = e;
235
+ return;
236
+ }
237
+ const i = s.getBoundingClientRect().height;
238
+ if ((e ?? i) === i) {
239
+ d.value = e;
240
+ return;
241
+ }
242
+ if (!l || e == null || !$e.value) {
243
+ d.value = e;
244
+ return;
245
+ }
246
+ d.value = e, await A(), await _(s, "height", i, e);
247
+ }
248
+ const B = n(null), le = () => {
249
+ O.component.drawerList[c] && O.component.drawerList[c].isHisonvueComponent && console.warn(`[Hisonvue] The drawer ID is at risk of being duplicated. ${c}`), Xe($, () => {
250
+ oe(), A(le);
251
+ }), X(), r.value && (V(), A(J)), B.value = {
252
+ isHisonvueComponent: !0,
253
+ getId: () => c,
254
+ getType: () => "drawer",
255
+ isVisible: () => r.value,
256
+ open: H,
257
+ close: f,
258
+ toggle: Be,
259
+ setVisible: (e) => e ? H() : f(),
260
+ getZIndex: () => g.value,
261
+ setZIndex: (e) => {
262
+ g.value = e;
263
+ },
264
+ getPosition: () => o.value,
265
+ setPosition: (e) => {
266
+ o.value = e, t.enterAnimationClass || (m.value = I[o.value]), t.leaveAnimationClass || (w.value = E[o.value]);
267
+ },
268
+ getWidth: () => v.value,
269
+ setWidth: (e, l = !0) => ee(e, l),
270
+ getHeight: () => d.value,
271
+ setHeight: (e, l = !0) => te(e, l),
272
+ isSwipeCloseEnabled: () => T.value,
273
+ setSwipeCloseEnabled: (e) => {
274
+ T.value = e;
275
+ },
276
+ isCloseButtonVisible: () => L.value,
277
+ setCloseButtonVisible: (e) => {
278
+ L.value = e;
279
+ },
280
+ isOverlayShown: () => k.value,
281
+ setOverlayShown: (e) => {
282
+ k.value = e;
283
+ },
284
+ isCloseClickOverlay: () => S.value,
285
+ setCloseClickOverlay: (e) => {
286
+ S.value = e;
287
+ },
288
+ isScrollLocked: () => p.value,
289
+ setScrollLock: (e) => {
290
+ p.value = e, r.value && (e ? V() : P());
291
+ },
292
+ isBorder: () => b.value,
293
+ setBorder: (e) => {
294
+ b.value = e;
295
+ },
296
+ getAnimationClasses: () => ({ enter: m.value, leave: w.value }),
297
+ setAnimationClasses: (e) => {
298
+ "enter" in e && (m.value = e.enter || ""), "leave" in e && (w.value = e.leave || "");
299
+ },
300
+ reload: () => Ze($)
301
+ }, O.component.drawerList[c] = B.value, y("mounted", B.value);
302
+ }, oe = () => {
303
+ Me($), delete O.component.drawerList[c], r.value && P();
304
+ };
305
+ return Ve(le), Pe(oe), a(N, (e) => {
306
+ X(), y("responsive-change", e);
307
+ }), a(() => t.visible, (e) => {
308
+ !!e !== r.value && (e ? H() : f());
309
+ }), a(() => t.zIndex, (e) => {
310
+ const l = Number(e);
311
+ Number.isFinite(l) && l !== g.value && (g.value = l);
312
+ }), a(() => t.border, (e) => {
313
+ const l = !!e;
314
+ l !== b.value && (b.value = l);
315
+ }), a(() => t.showOverlay, (e) => {
316
+ const l = !!e;
317
+ l !== k.value && (k.value = l);
318
+ }), a(() => t.closeClickOverlay, (e) => {
319
+ const l = !!e;
320
+ l !== S.value && (S.value = l);
321
+ }), a(() => t.scrollLock, (e) => {
322
+ const l = !!e;
323
+ l !== p.value && (p.value = l, r.value && (l ? V() : P()));
324
+ }), a(() => t.position, (e) => {
325
+ e && e !== o.value && (o.value = e, t.enterAnimationClass || (m.value = I[o.value]), t.leaveAnimationClass || (w.value = E[o.value]));
326
+ }), a(() => t.width, (e) => {
327
+ const l = e == null ? null : Number(e);
328
+ l !== v.value && ee(l, !1);
329
+ }), a(() => t.height, (e) => {
330
+ const l = e == null ? null : Number(e);
331
+ l !== d.value && te(l, !1);
332
+ }), a(() => t.closeButtonVisible, (e) => {
333
+ const l = !!e;
334
+ l !== L.value && (L.value = l);
335
+ }), a(() => t.closeButtonText, (e) => {
336
+ const l = e ?? "X";
337
+ l !== q.value && (q.value = l);
338
+ }), a(() => t.closeButtonTitle, (e) => {
339
+ const l = e ?? "Close";
340
+ l !== U.value && (U.value = l);
341
+ }), a(() => t.swipeClose, (e) => {
342
+ const l = !!e;
343
+ l !== T.value && (T.value = l);
344
+ }), a(() => t.enterAnimationClass, (e) => {
345
+ const l = e || I[o.value];
346
+ l !== m.value && (m.value = l);
347
+ }), a(() => t.leaveAnimationClass, (e) => {
348
+ const l = e || E[o.value];
349
+ l !== w.value && (w.value = l);
350
+ }), a(() => t.class, () => X()), {
351
+ id: c,
352
+ props: t,
353
+ wrapperRef: W,
354
+ drawerRef: h,
355
+ position: o,
356
+ visibleClass: ye,
357
+ responsiveClassList: z,
358
+ childClassList: he,
359
+ borderClass: fe,
360
+ backgroundTypeClass: de,
361
+ wrapperStyle: Ce,
362
+ overlayStyleWithZ: we,
363
+ isOverlayVisible: me,
364
+ sizeStyle: ge,
365
+ closeButtonVisible: L,
366
+ closeButtonBorder: ce,
367
+ closeButtonBackgroundType: ve,
368
+ closeButtonText: q,
369
+ closeButtonTitle: U,
370
+ onOverlayClick: be,
371
+ onClickClose: ke,
372
+ onSwipePointerDown: Se,
373
+ drawerMethods: u(() => j(B))
374
+ };
375
+ }
376
+ }), Qe = { class: "hison-drawer-body" };
377
+ function xe(t, y, ue, c, $, N) {
378
+ const W = He("HButton");
379
+ return ne(), se("div", {
380
+ class: R(["hison-layer-host", t.visibleClass])
381
+ }, [
382
+ t.isOverlayVisible ? (ne(), se("div", {
383
+ key: 0,
384
+ class: "hison-drawer-overlay",
385
+ style: G(t.overlayStyleWithZ),
386
+ onClick: y[0] || (y[0] = (...h) => t.onOverlayClick && t.onOverlayClick(...h))
387
+ }, null, 4)) : Y("", !0),
388
+ F("div", {
389
+ ref: "wrapperRef",
390
+ class: R(["hison-drawer-wrapper", `hison-pos-${t.position}`, ...t.responsiveClassList]),
391
+ style: G(t.wrapperStyle)
392
+ }, [
393
+ F("div", {
394
+ ref: "drawerRef",
395
+ class: R(["hison-drawer", t.borderClass, t.backgroundTypeClass]),
396
+ style: G([t.sizeStyle, t.props.style]),
397
+ role: "dialog",
398
+ onPointerdown: y[1] || (y[1] = (...h) => t.onSwipePointerDown && t.onSwipePointerDown(...h))
399
+ }, [
400
+ t.closeButtonVisible ? D(t.$slots, "close-button", {
401
+ key: 0,
402
+ onClick: t.onClickClose,
403
+ text: t.closeButtonText,
404
+ title: t.closeButtonTitle || "Close"
405
+ }, () => [
406
+ Re(W, {
407
+ id: `hison_drawer_close_${t.id}`,
408
+ class: R(["hison-drawer-close-btn", "hison-pos-right", "hison-pos-top", "hison-size-s", ...t.childClassList]),
409
+ text: t.closeButtonText,
410
+ title: t.closeButtonTitle || "Close",
411
+ border: t.closeButtonBorder,
412
+ "background-type": t.closeButtonBackgroundType,
413
+ onClick: t.onClickClose
414
+ }, De({
415
+ default: ae(() => [
416
+ t.$slots["close-label"] ? D(t.$slots, "close-label", { key: 0 }) : Y("", !0)
417
+ ]),
418
+ _: 2
419
+ }, [
420
+ t.$slots["close-icon"] ? {
421
+ name: "icon",
422
+ fn: ae(() => [
423
+ D(t.$slots, "close-icon")
424
+ ]),
425
+ key: "0"
426
+ } : void 0
427
+ ]), 1032, ["id", "class", "text", "title", "border", "background-type", "onClick"])
428
+ ]) : Y("", !0),
429
+ F("div", Qe, [
430
+ D(t.$slots, "default")
431
+ ])
432
+ ], 38)
433
+ ], 6)
434
+ ], 2);
435
+ }
436
+ const ot = /* @__PURE__ */ Fe(Ke, [["render", xe]]);
437
+ export {
438
+ ot as default
439
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),a=require("./index-BmKMHsSZ.js"),J=require("./scrollManager-CEEWQwoK.js"),be=require("./_plugin-vue_export-helper-BHFhmbuH.js"),ge=["top","bottom","left","right"],pe={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:1100},position:{type:String,default:"bottom",validator:l=>ge.includes(l)},width:{type:Number,default:null},height:{type:Number,default:null},closeButtonVisible:{type:Boolean,default:!0},closeButtonText:{type:String,default:"X"},closeButtonTitle:{type:String,default:"close"},swipeClose:{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:"HDrawer",props:pe,inheritAttrs:!1,emits:["mounted","responsive-change","open","close"],setup(l,{emit:f,slots:K}){const u=l.id||a.getUUID(),L=`hdrawer:${u}`,I=a.useDevice(),N=t.ref(null),h=t.ref(null),r=t.ref(l.visible),b=t.ref(l.zIndex??1050),w=t.ref(l.border),S=t.ref(l.showOverlay),k=t.ref(l.closeClickOverlay),g=t.ref(l.scrollLock),s=t.ref(l.position),c=t.ref(l.width??null),v=t.ref(l.height??null),B=t.ref(l.closeButtonVisible),Q=t.computed(()=>w.value),x=t.computed(()=>w.value?"filled":"empty"),P=t.ref(l.closeButtonText||"X"),H=t.ref(l.closeButtonTitle||"Close"),T=t.ref(l.swipeClose),O={top:"hison-drawer-enter-top",bottom:"hison-drawer-enter-bottom",left:"hison-drawer-enter-left",right:"hison-drawer-enter-right"},A={top:"hison-drawer-leave-top",bottom:"hison-drawer-leave-bottom",left:"hison-drawer-leave-left",right:"hison-drawer-leave-right"},m=t.ref(l.enterAnimationClass||O[s.value]),y=t.ref(l.leaveAnimationClass||A[s.value]),_=t.computed(()=>"hison-bg-empty"),ee=t.computed(()=>w.value?"hison-border":""),te=t.computed(()=>r.value?"":"hison-display-none"),$=t.ref([]),R=()=>{var e;$.value=a.extractResponsiveClasses(a.toClassString(l.class)||"",I.value),a.addComponentNameToClass($.value,"size",((e=a.hisonCloser.componentStyle)==null?void 0:e.size)||"m"),a.addComponentNameToClass($.value,"color","primary")},le=t.computed(()=>[...a.extractPrefixedClasses(a.toClassString(l.class)||"","color")]),oe=t.computed(()=>r.value&&S.value),se=t.computed(()=>{const o={zIndex:(b.value??1050)-1},n=l.overlayStyle;return n?Array.isArray(n)?[{...o},...n]:typeof n=="string"?[o,n]:{...o,...n}:o}),ne=()=>{k.value&&d()},ae=t.computed(()=>{const e={zIndex:b.value,position:"fixed",inset:"auto"};switch(e.left="",e.right="",e.top="",e.bottom="",s.value){case"top":e.left="0",e.right="0",e.top="0";break;case"bottom":e.left="0",e.right="0",e.bottom="0";break;case"left":e.left="0",e.top="0",e.bottom="0";break;case"right":e.right="0",e.top="0",e.bottom="0";break}return e}),ie=t.computed(()=>{const e={};return s.value==="top"||s.value==="bottom"?(e.width="100vw",v.value!=null&&(e.height=`${v.value}px`),c.value!=null&&(e.width=`${c.value}px`)):(e.height="100vh",c.value!=null&&(e.width=`${c.value}px`),v.value!=null&&(e.height=`${v.value}px`)),e}),z=()=>{g.value&&J.acquireScrollLock(u)},V=()=>{g.value&&J.releaseScrollLock(u)},W=async()=>{const e=h.value;!e||!m.value||(e.classList.remove(y.value),e.offsetWidth,e.classList.add(m.value))},re=async()=>{const e=h.value;!e||!y.value||(e.classList.remove(m.value),e.offsetWidth,e.classList.add(y.value),await new Promise(o=>setTimeout(o,200)))},E=async()=>{r.value||(r.value=!0,z(),await t.nextTick(),W(),f("open",t.unref(p)))},d=async()=>{if(r.value)try{await re()}finally{r.value=!1,V(),f("close",t.unref(p))}},ue=async()=>r.value?d():E(),ce=()=>d();let D=!1,M=0,U=0;const X=40,ve=e=>{T.value&&(D=!0,M=e.clientX,U=e.clientY,window.addEventListener("pointerup",de,{once:!0,capture:!0}))},de=e=>{if(!D)return;D=!1;const o=e.clientX-M,n=e.clientY-U,i=Math.abs(o),C=Math.abs(n);(s.value==="top"&&C>i&&n>X||s.value==="bottom"&&C>i&&n<-40||s.value==="left"&&i>C&&o<-40||s.value==="right"&&i>C&&o>X)&&d()},fe=200,he="ease";function Z(e,o,n,i,C=fe,we=he){return new Promise(Ce=>{e.style.transition="none",e.style[o]=`${n}px`,e.offsetWidth,e.style.transition=`${o} ${C}ms ${we}`,e.style[o]=`${i}px`;const q=()=>{e.removeEventListener("transitionend",q),e.style.transition="",Ce()};e.addEventListener("transitionend",q),setTimeout(q,C+50)})}const me=t.computed(()=>s.value==="left"||s.value==="right"),ye=t.computed(()=>s.value==="top"||s.value==="bottom");async function j(e,o=!0){const n=h.value;if(!n){c.value=e;return}const i=n.getBoundingClientRect().width;if((e??i)===i){c.value=e;return}if(!o||e==null||!me.value){c.value=e;return}c.value=e,await t.nextTick(),await Z(n,"width",i,e)}async function Y(e,o=!0){const n=h.value;if(!n){v.value=e;return}const i=n.getBoundingClientRect().height;if((e??i)===i){v.value=e;return}if(!o||e==null||!ye.value){v.value=e;return}v.value=e,await t.nextTick(),await Z(n,"height",i,e)}const p=t.ref(null),F=()=>{a.hisonCloser.component.drawerList[u]&&a.hisonCloser.component.drawerList[u].isHisonvueComponent&&console.warn(`[Hisonvue] The drawer ID is at risk of being duplicated. ${u}`),a.registerReloadable(L,()=>{G(),t.nextTick(F)}),R(),r.value&&(z(),t.nextTick(W)),p.value={isHisonvueComponent:!0,getId:()=>u,getType:()=>"drawer",isVisible:()=>r.value,open:E,close:d,toggle:ue,setVisible:e=>e?E():d(),getZIndex:()=>b.value,setZIndex:e=>{b.value=e},getPosition:()=>s.value,setPosition:e=>{s.value=e,l.enterAnimationClass||(m.value=O[s.value]),l.leaveAnimationClass||(y.value=A[s.value])},getWidth:()=>c.value,setWidth:(e,o=!0)=>j(e,o),getHeight:()=>v.value,setHeight:(e,o=!0)=>Y(e,o),isSwipeCloseEnabled:()=>T.value,setSwipeCloseEnabled:e=>{T.value=e},isCloseButtonVisible:()=>B.value,setCloseButtonVisible:e=>{B.value=e},isOverlayShown:()=>S.value,setOverlayShown:e=>{S.value=e},isCloseClickOverlay:()=>k.value,setCloseClickOverlay:e=>{k.value=e},isScrollLocked:()=>g.value,setScrollLock:e=>{g.value=e,r.value&&(e?z():V())},isBorder:()=>w.value,setBorder:e=>{w.value=e},getAnimationClasses:()=>({enter:m.value,leave:y.value}),setAnimationClasses:e=>{"enter"in e&&(m.value=e.enter||""),"leave"in e&&(y.value=e.leave||"")},reload:()=>a.reloadHisonComponent(L)},a.hisonCloser.component.drawerList[u]=p.value,f("mounted",p.value)},G=()=>{a.unregisterReloadable(L),delete a.hisonCloser.component.drawerList[u],r.value&&V()};return t.onMounted(F),t.onBeforeUnmount(G),t.watch(I,e=>{R(),f("responsive-change",e)}),t.watch(()=>l.visible,e=>{!!e!==r.value&&(e?E():d())}),t.watch(()=>l.zIndex,e=>{const o=Number(e);Number.isFinite(o)&&o!==b.value&&(b.value=o)}),t.watch(()=>l.border,e=>{const o=!!e;o!==w.value&&(w.value=o)}),t.watch(()=>l.showOverlay,e=>{const o=!!e;o!==S.value&&(S.value=o)}),t.watch(()=>l.closeClickOverlay,e=>{const o=!!e;o!==k.value&&(k.value=o)}),t.watch(()=>l.scrollLock,e=>{const o=!!e;o!==g.value&&(g.value=o,r.value&&(o?z():V()))}),t.watch(()=>l.position,e=>{e&&e!==s.value&&(s.value=e,l.enterAnimationClass||(m.value=O[s.value]),l.leaveAnimationClass||(y.value=A[s.value]))}),t.watch(()=>l.width,e=>{const o=e==null?null:Number(e);o!==c.value&&j(o,!1)}),t.watch(()=>l.height,e=>{const o=e==null?null:Number(e);o!==v.value&&Y(o,!1)}),t.watch(()=>l.closeButtonVisible,e=>{const o=!!e;o!==B.value&&(B.value=o)}),t.watch(()=>l.closeButtonText,e=>{const o=e??"X";o!==P.value&&(P.value=o)}),t.watch(()=>l.closeButtonTitle,e=>{const o=e??"Close";o!==H.value&&(H.value=o)}),t.watch(()=>l.swipeClose,e=>{const o=!!e;o!==T.value&&(T.value=o)}),t.watch(()=>l.enterAnimationClass,e=>{const o=e||O[s.value];o!==m.value&&(m.value=o)}),t.watch(()=>l.leaveAnimationClass,e=>{const o=e||A[s.value];o!==y.value&&(y.value=o)}),t.watch(()=>l.class,()=>R()),{id:u,props:l,wrapperRef:N,drawerRef:h,position:s,visibleClass:te,responsiveClassList:$,childClassList:le,borderClass:ee,backgroundTypeClass:_,wrapperStyle:ae,overlayStyleWithZ:se,isOverlayVisible:oe,sizeStyle:ie,closeButtonVisible:B,closeButtonBorder:Q,closeButtonBackgroundType:x,closeButtonText:P,closeButtonTitle:H,onOverlayClick:ne,onClickClose:ce,onSwipePointerDown:ve,drawerMethods:t.computed(()=>t.unref(p))}}}),ke={class:"hison-drawer-body"};function Be(l,f,K,u,L,I){const N=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-drawer-overlay",style:t.normalizeStyle(l.overlayStyleWithZ),onClick:f[0]||(f[0]=(...h)=>l.onOverlayClick&&l.onOverlayClick(...h))},null,4)):t.createCommentVNode("",!0),t.createElementVNode("div",{ref:"wrapperRef",class:t.normalizeClass(["hison-drawer-wrapper",`hison-pos-${l.position}`,...l.responsiveClassList]),style:t.normalizeStyle(l.wrapperStyle)},[t.createElementVNode("div",{ref:"drawerRef",class:t.normalizeClass(["hison-drawer",l.borderClass,l.backgroundTypeClass]),style:t.normalizeStyle([l.sizeStyle,l.props.style]),role:"dialog",onPointerdown:f[1]||(f[1]=(...h)=>l.onSwipePointerDown&&l.onSwipePointerDown(...h))},[l.closeButtonVisible?t.renderSlot(l.$slots,"close-button",{key:0,onClick:l.onClickClose,text:l.closeButtonText,title:l.closeButtonTitle||"Close"},()=>[t.createVNode(N,{id:`hison_drawer_close_${l.id}`,class:t.normalizeClass(["hison-drawer-close-btn","hison-pos-right","hison-pos-top","hison-size-s",...l.childClassList]),text:l.closeButtonText,title:l.closeButtonTitle||"Close",border:l.closeButtonBorder,"background-type":l.closeButtonBackgroundType,onClick:l.onClickClose},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","border","background-type","onClick"])]):t.createCommentVNode("",!0),t.createElementVNode("div",ke,[t.renderSlot(l.$slots,"default")])],38)],6)],2)}const Te=be._export_sfc(Se,[["render",Be]]);exports.default=Te;