centui 3.0.0 → 3.1.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 (280) hide show
  1. package/dist/ActionBar-Bs5fkyFH.cjs +1 -0
  2. package/dist/ActionBar-CF1zMUMC.js +56 -0
  3. package/dist/ActivityIndicator-BOZRJBDn.cjs +1 -0
  4. package/dist/{RollerSuccess-CVEmS9gU.js → ActivityIndicator-Cp20c1E0.js} +30 -92
  5. package/dist/{Agree-DT46e5q5.cjs → Agree-ZswFiFNy.cjs} +1 -1
  6. package/dist/{Agree-yTGTi4e6.js → Agree-lAcOo38C.js} +2 -3
  7. package/dist/Amount-B2StZGGW.js +56 -0
  8. package/dist/Amount-CU7Oc4vv.cjs +1 -0
  9. package/dist/Bill-DDVs3Lu3.cjs +1 -0
  10. package/dist/Bill-qQ4LdkmR.js +58 -0
  11. package/dist/{Button-Blpwwbnw.cjs → Button-Bu8liJQE.cjs} +1 -1
  12. package/dist/{Button-BIi6CrwM.js → Button-D7e-cuA1.js} +5 -6
  13. package/dist/Captcha-BEF-de8-.cjs +1 -0
  14. package/dist/Captcha-CgpynYTc.js +283 -0
  15. package/dist/Cashier-CJLfQOXm.js +363 -0
  16. package/dist/Cashier-CLJngM0n.cjs +1 -0
  17. package/dist/{CellItem-YZD-BxKt.js → CellItem-BHEh4Cp-.js} +2 -3
  18. package/dist/{CellItem-T78DHako.cjs → CellItem-J0LkwZNL.cjs} +1 -1
  19. package/dist/Chart-BINJAx7V.js +135 -0
  20. package/dist/Chart-DJ0Q1g1P.cjs +1 -0
  21. package/dist/CheckBox-D5bCJUXD.js +55 -0
  22. package/dist/CheckBox-DDeCshDK.cjs +1 -0
  23. package/dist/CheckBoxBase-BIPGJ-TD.js +43 -0
  24. package/dist/CheckBoxBase-CobK6-tL.cjs +1 -0
  25. package/dist/CheckList-BsKo_Fl3.cjs +1 -0
  26. package/dist/{CheckList-Bfy3B-eN.js → CheckList-ViiCo4yi.js} +47 -91
  27. package/dist/{Codebox-D0UtCj11.js → Codebox-BLPrFnIv.js} +4 -5
  28. package/dist/Codebox-yLkdTU7w.cjs +1 -0
  29. package/dist/{DatePicker-B1AVbKhK.cjs → DatePicker-CCU6gqG3.cjs} +1 -1
  30. package/dist/{DatePicker-TAHuve5t.js → DatePicker-CYvPJatt.js} +2 -4
  31. package/dist/DetailItem-D6-zbZmd.js +21 -0
  32. package/dist/DetailItem-DDJXXao0.cjs +1 -0
  33. package/dist/Dialog-208_XUAL.cjs +1 -0
  34. package/dist/Dialog-Bb7Gth3j.js +148 -0
  35. package/dist/DropMenu-5TA_6bas.js +95 -0
  36. package/dist/DropMenu-D_ZMGOOi.cjs +1 -0
  37. package/dist/{Field-CseJzTZz.js → Field-0hdNWFNm.js} +1 -2
  38. package/dist/{FieldItem-Cc7bw5vU.js → FieldItem-D79w330m.js} +2 -3
  39. package/dist/{FieldItem-Dkpx5Kxk.cjs → FieldItem-UFKrl_5J.cjs} +1 -1
  40. package/dist/{Icon-jaEPn7d7.cjs → Icon-83WWqE5z.cjs} +1 -1
  41. package/dist/{Icon-dWGSK6Ou.js → Icon-BgCtu0ZV.js} +3 -5
  42. package/dist/ImageReader-DjshA_hh.cjs +1 -0
  43. package/dist/ImageReader-hUb5CEbV.js +122 -0
  44. package/dist/ImageViewer-BCEK4DOF.cjs +1 -0
  45. package/dist/ImageViewer-_dTRCIsV.js +68 -0
  46. package/dist/InputItem-DO5Yo_IH.cjs +1 -0
  47. package/dist/InputItem-yHsLFvKt.js +327 -0
  48. package/dist/Landscape-BsHyoM4N.cjs +1 -0
  49. package/dist/Landscape-Dd0abEy1.js +73 -0
  50. package/dist/LicensePlate-CTcAIbcb.js +201 -0
  51. package/dist/LicensePlate-CfwpVw0G.cjs +1 -0
  52. package/dist/NoticeBar-CV355FeO.cjs +1 -0
  53. package/dist/NoticeBar-G5aKL6VO.js +92 -0
  54. package/dist/NumberKeyboard-BWpxsbYt.cjs +1 -0
  55. package/dist/{NumberKeyboard-C7TRF5iC.js → NumberKeyboard-B_TJXxki.js} +77 -62
  56. package/dist/Picker-BOEGTBaN.cjs +1 -0
  57. package/dist/{Picker-Dam0LEcc.js → Picker-CA-JQ_OC.js} +168 -151
  58. package/dist/Popup-Ca1jPi0t.cjs +1 -0
  59. package/dist/Popup-qLk-BsRS.js +116 -0
  60. package/dist/{PopupTitleBar-nVurLaOe.js → PopupTitleBar-9P4RUMC1.js} +2 -3
  61. package/dist/{PopupTitleBar-B4vwxKC7.cjs → PopupTitleBar-Bfl49eYJ.cjs} +1 -1
  62. package/dist/Progress-CT-LHaQ0.cjs +1 -0
  63. package/dist/{Progress-CwIC6scr.js → Progress-Clet0W_n.js} +20 -22
  64. package/dist/Radio-B_MxJ65X.cjs +1 -0
  65. package/dist/{Radio-fsc7_N5K.js → Radio-DY-ZX0BP.js} +16 -14
  66. package/dist/{RadioGroup-CMPmk8X_.js → RadioGroup-B00aqM9e.js} +8 -6
  67. package/dist/RadioGroup-B6ukqnm5.cjs +1 -0
  68. package/dist/{RadioList-upQgua8Z.cjs → RadioList-D-9PITpr.cjs} +1 -1
  69. package/dist/{RadioList-CkerkQEY.js → RadioList-DNGsEzgf.js} +6 -8
  70. package/dist/ResultPage-DUs8ok5R.js +64 -0
  71. package/dist/ResultPage-YQWDaFmz.cjs +1 -0
  72. package/dist/{Roller-DFJ7jMV0.js → Roller-BznN57fL.js} +1 -2
  73. package/dist/RollerSuccess-BbMzNlkv.cjs +1 -0
  74. package/dist/RollerSuccess-CTh43Rh0.js +65 -0
  75. package/dist/Ruler-Bhf5J7hU.js +136 -0
  76. package/dist/Ruler-CEzB0oqG.cjs +1 -0
  77. package/dist/ScrollView-BNY62f7B.js +228 -0
  78. package/dist/ScrollView-BnadVBJC.cjs +1 -0
  79. package/dist/ScrollViewMore-BL1vpyMj.cjs +1 -0
  80. package/dist/ScrollViewMore-DBhoiI1X.js +54 -0
  81. package/dist/Selector-DOU8Af55.js +209 -0
  82. package/dist/Selector-DnFvOGbv.cjs +1 -0
  83. package/dist/{Skeleton-BG_j23KI.js → Skeleton-DqA5IxL5.js} +1 -2
  84. package/dist/Slider-BB2Nhpys.js +100 -0
  85. package/dist/Slider-vV7_nULf.cjs +1 -0
  86. package/dist/Stepper-BnDhL8IO.js +137 -0
  87. package/dist/Stepper-n_mc16V2.cjs +1 -0
  88. package/dist/Steps-BPQwab3T.js +157 -0
  89. package/dist/Steps-Dfpmgl8B.cjs +1 -0
  90. package/dist/SwiperItem-BY5cUoGn.cjs +1 -0
  91. package/dist/SwiperItem-BydyBdYU.js +323 -0
  92. package/dist/Switch-B1rsBY-M.js +31 -0
  93. package/dist/Switch-CghubImq.cjs +1 -0
  94. package/dist/TabPane-BCVsdptu.cjs +1 -0
  95. package/dist/TabPane-Q7oUFzmP.js +237 -0
  96. package/dist/TabPicker-BcL9assY.cjs +1 -0
  97. package/dist/TabPicker-BicPrto7.js +173 -0
  98. package/dist/Tag-C7ygxOwU.js +78 -0
  99. package/dist/Tag-CIA2npnD.cjs +1 -0
  100. package/dist/TextareaItem-Dl-PCLl-.js +168 -0
  101. package/dist/TextareaItem-Du5nl7tv.cjs +1 -0
  102. package/dist/{Tip-BFZSiRc1.js → Tip-DHPmevlv.js} +2 -3
  103. package/dist/{Tip-C3brAF9N.cjs → Tip-De_3tKtb.cjs} +1 -1
  104. package/dist/Transition-B-baX512.js +14 -0
  105. package/dist/Transition-Bwbqr4Xr.cjs +1 -0
  106. package/dist/WaterMark-CgkuQjv3.js +103 -0
  107. package/dist/WaterMark-M81jg6T5.cjs +1 -0
  108. package/dist/action-bar.cjs +1 -0
  109. package/dist/action-bar.d.ts +1 -0
  110. package/dist/action-bar.js +1 -0
  111. package/dist/{action-sheet-LJilF3EQ.cjs → action-sheet-BjaReHkr.cjs} +1 -1
  112. package/dist/{action-sheet-DKpi2GLQ.js → action-sheet-Da8dHevy.js} +15 -12
  113. package/dist/action-sheet.cjs +1 -1
  114. package/dist/action-sheet.js +1 -2
  115. package/dist/activity-indicator.cjs +1 -1
  116. package/dist/activity-indicator.js +4 -3
  117. package/dist/agree.cjs +1 -1
  118. package/dist/agree.js +1 -2
  119. package/dist/amount.cjs +1 -1
  120. package/dist/amount.js +1 -2
  121. package/dist/bill.cjs +1 -0
  122. package/dist/bill.d.ts +1 -0
  123. package/dist/bill.js +1 -0
  124. package/dist/button.cjs +1 -1
  125. package/dist/button.js +1 -2
  126. package/dist/captcha.cjs +1 -0
  127. package/dist/captcha.d.ts +1 -0
  128. package/dist/captcha.js +1 -0
  129. package/dist/cashier.cjs +1 -0
  130. package/dist/cashier.d.ts +1 -0
  131. package/dist/cashier.js +1 -0
  132. package/dist/cell-item.cjs +1 -1
  133. package/dist/cell-item.js +1 -2
  134. package/dist/chart.cjs +1 -0
  135. package/dist/chart.d.ts +1 -0
  136. package/dist/chart.js +1 -0
  137. package/dist/check-base.cjs +1 -1
  138. package/dist/check-base.js +1 -2
  139. package/dist/check.cjs +1 -1
  140. package/dist/check.js +3 -2
  141. package/dist/codebox.cjs +1 -1
  142. package/dist/codebox.js +1 -2
  143. package/dist/components/action-sheet/ActionSheet.vue.d.ts +5 -0
  144. package/dist/components/cashier/CashierChannel.vue.d.ts +4 -0
  145. package/dist/components/dialog/Dialog.vue.d.ts +10 -0
  146. package/dist/components/index.d.ts +2 -2
  147. package/dist/components/number-keyboard/KeyboardKey.vue.d.ts +3 -0
  148. package/dist/components/popup/PopupTitleBar.vue.d.ts +4 -0
  149. package/dist/components/swiper/Swiper.vue.d.ts +2 -2
  150. package/dist/cursor-BIPoNm8V.js +11 -0
  151. package/dist/cursor-tQE3LcbU.cjs +1 -0
  152. package/dist/date-picker.cjs +1 -1
  153. package/dist/date-picker.js +1 -2
  154. package/dist/detail-item.cjs +1 -0
  155. package/dist/detail-item.d.ts +1 -0
  156. package/dist/detail-item.js +1 -0
  157. package/dist/dialog-C38EDWGJ.cjs +1 -0
  158. package/dist/dialog-DdNA6YSe.js +91 -0
  159. package/dist/dialog.cjs +1 -1
  160. package/dist/dialog.js +2 -1
  161. package/dist/drop-menu.cjs +1 -0
  162. package/dist/drop-menu.d.ts +1 -0
  163. package/dist/drop-menu.js +1 -0
  164. package/dist/field-item.cjs +1 -1
  165. package/dist/field-item.js +1 -2
  166. package/dist/field.js +1 -2
  167. package/dist/icon.cjs +1 -1
  168. package/dist/icon.js +1 -2
  169. package/dist/image-reader.cjs +1 -0
  170. package/dist/image-reader.d.ts +1 -0
  171. package/dist/image-reader.js +1 -0
  172. package/dist/image-viewer.cjs +1 -0
  173. package/dist/image-viewer.d.ts +1 -0
  174. package/dist/image-viewer.js +1 -0
  175. package/dist/index.cjs +1 -1
  176. package/dist/index.d.ts +2 -1
  177. package/dist/index.js +61 -2669
  178. package/dist/input-item.cjs +1 -1
  179. package/dist/input-item.js +1 -2
  180. package/dist/landscape.cjs +1 -0
  181. package/dist/landscape.d.ts +1 -0
  182. package/dist/landscape.js +1 -0
  183. package/dist/license-plate.cjs +1 -0
  184. package/dist/license-plate.d.ts +1 -0
  185. package/dist/license-plate.js +1 -0
  186. package/dist/notice-bar.cjs +1 -1
  187. package/dist/notice-bar.js +1 -2
  188. package/dist/number-keyboard.cjs +1 -1
  189. package/dist/number-keyboard.js +1 -2
  190. package/dist/picker.cjs +1 -1
  191. package/dist/picker.js +1 -2
  192. package/dist/popup.cjs +1 -1
  193. package/dist/popup.js +2 -2
  194. package/dist/progress.cjs +1 -1
  195. package/dist/progress.js +1 -2
  196. package/dist/radio-list.cjs +1 -1
  197. package/dist/radio-list.js +1 -2
  198. package/dist/radio.cjs +1 -1
  199. package/dist/radio.js +2 -2
  200. package/dist/result-page.cjs +1 -0
  201. package/dist/result-page.d.ts +1 -0
  202. package/dist/result-page.js +1 -0
  203. package/dist/ruler.cjs +1 -0
  204. package/dist/ruler.d.ts +1 -0
  205. package/dist/ruler.js +1 -0
  206. package/dist/scroll-view.cjs +1 -1
  207. package/dist/scroll-view.js +3 -2
  208. package/dist/selector.cjs +1 -0
  209. package/dist/selector.d.ts +1 -0
  210. package/dist/selector.js +1 -0
  211. package/dist/{shared-BtSkmaWC.js → shared-C9XlLe7F.js} +1 -2
  212. package/dist/skeleton.js +1 -2
  213. package/dist/slider.cjs +1 -1
  214. package/dist/slider.js +1 -2
  215. package/dist/stepper.cjs +1 -1
  216. package/dist/stepper.js +1 -2
  217. package/dist/steps.cjs +1 -0
  218. package/dist/steps.d.ts +1 -0
  219. package/dist/steps.js +1 -0
  220. package/dist/swiper.cjs +1 -1
  221. package/dist/swiper.js +1 -2
  222. package/dist/switch.cjs +1 -1
  223. package/dist/switch.js +1 -2
  224. package/dist/tab-picker.cjs +1 -0
  225. package/dist/tab-picker.d.ts +1 -0
  226. package/dist/tab-picker.js +1 -0
  227. package/dist/tabs.cjs +1 -0
  228. package/dist/tabs.d.ts +1 -0
  229. package/dist/tabs.js +1 -0
  230. package/dist/tag.cjs +1 -1
  231. package/dist/tag.js +1 -2
  232. package/dist/textarea-item.cjs +1 -0
  233. package/dist/textarea-item.d.ts +1 -0
  234. package/dist/textarea-item.js +1 -0
  235. package/dist/tip.cjs +1 -1
  236. package/dist/tip.js +1 -2
  237. package/dist/{toast-DX-RoB7Q.js → toast-ByIFvpMs.js} +6 -6
  238. package/dist/toast-C1K2_cOo.cjs +1 -0
  239. package/dist/toast.cjs +1 -1
  240. package/dist/toast.js +1 -2
  241. package/dist/transition.cjs +1 -0
  242. package/dist/transition.d.ts +1 -0
  243. package/dist/transition.js +1 -0
  244. package/dist/water-mark.cjs +1 -0
  245. package/dist/water-mark.d.ts +1 -0
  246. package/dist/water-mark.js +1 -0
  247. package/package.json +105 -4
  248. package/dist/Amount-De-oObat.cjs +0 -1
  249. package/dist/Amount-wOtRYOdx.js +0 -62
  250. package/dist/CheckBoxBase-BDsytL_r.cjs +0 -1
  251. package/dist/CheckBoxBase-BjyVzGqj.js +0 -40
  252. package/dist/CheckList-DEmLmccw.cjs +0 -1
  253. package/dist/Codebox-Cgj7wyzd.cjs +0 -1
  254. package/dist/InputItem-EJ4Y3tpU.cjs +0 -1
  255. package/dist/InputItem-bhFtp97z.js +0 -322
  256. package/dist/NoticeBar-DSf_EjTL.cjs +0 -1
  257. package/dist/NoticeBar-PEYcjXwD.js +0 -84
  258. package/dist/NumberKeyboard-BX0c0l2r.cjs +0 -1
  259. package/dist/Picker-D-TPtSxf.cjs +0 -1
  260. package/dist/Popup-Cm4BuaOo.cjs +0 -1
  261. package/dist/Popup-DPYBBL95.js +0 -116
  262. package/dist/Progress-DukssNvl.cjs +0 -1
  263. package/dist/Radio-ZHivLdvi.cjs +0 -1
  264. package/dist/RadioGroup-BR_jSDR4.cjs +0 -1
  265. package/dist/RollerSuccess--JecJ7bz.cjs +0 -1
  266. package/dist/ScrollViewMore-BWph-i1-.cjs +0 -1
  267. package/dist/ScrollViewMore-BgYJx-TP.js +0 -278
  268. package/dist/Slider-D3wrE8hn.cjs +0 -1
  269. package/dist/Slider-DteN8p-L.js +0 -95
  270. package/dist/Stepper-1EOk4pCY.js +0 -127
  271. package/dist/Stepper-BJr4I6_8.cjs +0 -1
  272. package/dist/SwiperItem-B6TgjCsM.cjs +0 -1
  273. package/dist/SwiperItem-CKd-XKT7.js +0 -337
  274. package/dist/Switch-B6DvVj2p.js +0 -30
  275. package/dist/Switch-BVPjF8CM.cjs +0 -1
  276. package/dist/Tag-CPv77lC8.cjs +0 -1
  277. package/dist/Tag-bs5j40pF.js +0 -66
  278. package/dist/dialog-0-E4Vyc-.cjs +0 -1
  279. package/dist/dialog-DHIZ2SMK.js +0 -227
  280. package/dist/toast-CAeyMc5r.cjs +0 -1
@@ -1,10 +1,10 @@
1
- import { t as e } from "./Popup-DPYBBL95.js";
2
- import { t } from "./PopupTitleBar-nVurLaOe.js";
3
- import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, nextTick as u, normalizeClass as d, normalizeStyle as f, onBeforeMount as p, onMounted as m, openBlock as h, ref as g, renderList as _, toDisplayString as v, unref as y, watch as b, withCtx as x } from "vue";
4
- import { cascade as S, compareObjects as C, inArray as w, t as T, traverse as E, warn as D } from "@centui/core";
5
- import { Scroller as O, getDpr as k, render as A } from "@centui/core/web";
6
- //#region src/components/picker/PickerColumn.vue?vue&type=script&setup=true&lang.ts
7
- var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-list" }, N = ["textContent"], P = { class: "cu-picker-column-hooks" }, F = [
1
+ import { t as e } from "./Popup-qLk-BsRS.js";
2
+ import { t } from "./PopupTitleBar-9P4RUMC1.js";
3
+ import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, nextTick as u, normalizeClass as d, normalizeStyle as f, onBeforeMount as p, onBeforeUnmount as m, onMounted as h, openBlock as g, ref as _, renderList as v, toDisplayString as y, unref as b, watch as x, withCtx as S } from "vue";
4
+ import { cascade as C, compareObjects as w, inArray as T, t as E, traverse as D, warn as O } from "@centui/core";
5
+ import { Scroller as k, getDpr as A, render as j } from "@centui/core/web";
6
+ // src/components/picker/PickerColumn.vue?vue&type=script&setup=true&lang.ts
7
+ var M = { class: "cu-picker-column-container" }, N = { class: "cu-picker-column-list" }, P = ["textContent"], ee = { class: "cu-picker-column-hooks" }, F = [
8
8
  "onTouchstart",
9
9
  "onMousedown",
10
10
  "onTouchmove",
@@ -28,219 +28,233 @@ var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-
28
28
  },
29
29
  emits: ["initialed", "change"],
30
30
  setup(e, { expose: t, emit: i }) {
31
- let c = e, l = i, m = k(), y = g(), x = g([]), S = [], C = g(1), T = g(0), I = g([]), L = g(!1), R = g(!1), z = g(!1), B = r(() => ({
32
- maskerHeight: (c.lineHeight * 2 + 10) * m,
33
- indicatorHeight: c.lineHeight * m
31
+ let c = e, l = i, h = A(), b = _(), S = _([]), C = [], w = null, E = _(1), I = _(0), L = _([]), R = _(!1), z = _(!1), B = _(!1), V = r(() => ({
32
+ maskerHeight: (c.lineHeight * 2 + 10) * h,
33
+ indicatorHeight: c.lineHeight * h
34
34
  }));
35
- b(() => c.data, (e) => {
36
- x.value = [...e];
35
+ x(() => c.data, (e) => {
36
+ S.value = [...e], u(() => {
37
+ he();
38
+ });
37
39
  }, { deep: !0 }), p(() => {
38
- x.value = [...c.data];
40
+ S.value = [...c.data];
41
+ }), m(() => {
42
+ w &&= (clearTimeout(w), null), C.forEach((e) => {
43
+ H(e);
44
+ }), C.length = 0;
39
45
  });
40
- function V() {
41
- return y.value ? Array.from(y.value.querySelectorAll(".cu-picker-column-hook")) : [];
46
+ function H(e) {
47
+ if (!e) return;
48
+ let t = e.stop;
49
+ if (typeof t == "function") {
50
+ t.call(e);
51
+ return;
52
+ }
53
+ let n = e.getValues();
54
+ e.scrollTo(n.left, n.top, !1, n.zoom);
55
+ }
56
+ function U() {
57
+ return b.value ? Array.from(b.value.querySelectorAll(".cu-picker-column-hook")) : [];
42
58
  }
43
- function H(e = 0) {
44
- let t = V();
59
+ function W(e = 0) {
60
+ let t = U();
45
61
  for (let n = e, r = t.length; n < r; n++) {
46
62
  let e = t[n];
47
- e && U(e, n);
63
+ e && te(e, n);
48
64
  }
49
- e || (W(), L.value || (L.value = !0, setTimeout(() => {
50
- l("initialed");
51
- }, 0))), R.value = !0;
65
+ e || (ne(), R.value || (R.value = !0, w && clearTimeout(w), w = setTimeout(() => {
66
+ w = null, l("initialed");
67
+ }, 0))), z.value = !0;
52
68
  }
53
- function U(e, t) {
54
- if (!y.value) return;
55
- let n = y.value.querySelectorAll(".column-list"), r = n[t];
69
+ function te(e, t) {
70
+ if (!b.value) return;
71
+ let n = b.value.querySelectorAll(".column-list"), r = n[t];
56
72
  if (t === void 0 || !n || !e || !r) return;
57
- let i = e.getBoundingClientRect(), a = new O((e, t) => {
58
- A(r, e, t);
73
+ let i = e.getBoundingClientRect();
74
+ H(C[t]);
75
+ let a = new k((e, t) => {
76
+ j(r, e, t);
59
77
  }, {
60
78
  scrollingX: !1,
61
79
  snapping: !0,
62
80
  snappingVelocity: 1,
63
81
  animationDuration: 350,
64
82
  scrollingComplete: () => {
65
- ae(t);
83
+ ce(t);
66
84
  }
67
85
  });
68
- a.setPosition(i.left + e.clientLeft, i.top + e.clientTop), a.setDimensions(e.clientWidth, e.clientHeight, r.offsetWidth, r.offsetHeight + B.value.maskerHeight), a.setSnapSize(0, B.value.indicatorHeight), S[t] = a, re(t);
86
+ a.setPosition(i.left + e.clientLeft, i.top + e.clientTop), a.setDimensions(e.clientWidth, e.clientHeight, r.offsetWidth, r.offsetHeight + V.value.maskerHeight), a.setSnapSize(0, V.value.indicatorHeight), C[t] = a, Y(t);
69
87
  }
70
- function W() {
71
- let e = x.value, t = S;
88
+ function ne() {
89
+ let e = S.value, t = C;
72
90
  G(e, c.defaultIndex, c.defaultValue, (e, n) => {
73
91
  let r = t[e];
74
- if (!r) {
75
- D(`initialColumnIndex: scroller of column ${e} is undefined`);
76
- return;
77
- }
78
- q(e, n) ? X(r, e, n) : (Y(r, e, n), I.value[e] = n);
92
+ r ? q(e, n) ? Z(r, e, n) : (X(r, e, n), L.value[e] = n) : O(`initialColumnIndex: scroller of column ${e} is undefined`);
79
93
  });
80
94
  }
81
95
  function G(e, t = [], n, r = () => {}) {
82
- e && E(e, (e, i, a) => {
96
+ e && D(e, (e, i, a) => {
83
97
  let o = a[0], s = a[1], c = t[o], l = n[o];
84
98
  if (c === void 0 && l === void 0 && (c = 0), c !== void 0 && s === c || l !== void 0 && (e.text === l || e.label === l || e.value === l)) return r(o, s), 2;
85
99
  });
86
100
  }
87
- function ee(e) {
88
- return Math.round(e / B.value.indicatorHeight);
101
+ function re(e) {
102
+ return Math.round(e / V.value.indicatorHeight);
89
103
  }
90
104
  function K(e) {
91
- return e * B.value.indicatorHeight;
105
+ return e * V.value.indicatorHeight;
92
106
  }
93
- function te(e, t) {
94
- return I.value[e] === t;
107
+ function ie(e, t) {
108
+ return L.value[e] === t;
95
109
  }
96
110
  function q(e, t) {
97
111
  let n = c.invalidIndex[e];
98
- return w(n, t);
112
+ return T(n, t);
99
113
  }
100
- function ne(e) {
114
+ function ae(e) {
101
115
  for (let t of c.data[e].keys()) if (!q(e, t)) return !0;
102
- return D(`hasValidIndex: has no valid items in column index ${e}`), !1;
116
+ return O(`hasValidIndex: has no valid items in column index ${e}`), !1;
103
117
  }
104
118
  function J(e, t) {
105
- if (!ne(e)) return t;
119
+ if (!ae(e)) return t;
106
120
  let n = t;
107
- for (; q(e, n);) n += C.value;
108
- return n < 0 || n > c.data[e].length - 1 ? (C.value = -C.value, J(e, t)) : n;
121
+ for (; q(e, n);) n += E.value;
122
+ return n < 0 || n > c.data[e].length - 1 ? (E.value = -E.value, J(e, t)) : n;
109
123
  }
110
- function re(e) {
111
- let t = S[e], n = x.value[e] || [], r = I.value[e] || 0;
112
- t && r && (r > n.length - 1 && (r = n.length - 1), Y(t, e, r), I.value[e] = r);
124
+ function Y(e) {
125
+ let t = C[e], n = S.value[e] || [], r = L.value[e] || 0;
126
+ t && r && (r > n.length - 1 && (r = n.length - 1), X(t, e, r), L.value[e] = r);
113
127
  }
114
- function Y(e, t, n) {
128
+ function X(e, t, n) {
115
129
  let r = K(n);
116
130
  e.scrollTo(0, r);
117
131
  }
118
- function X(e, t, n) {
132
+ function Z(e, t, n) {
119
133
  let r = K(J(t, n));
120
- e.scrollTo(0, Z(e, r), !0);
134
+ e.scrollTo(0, Q(e, r), !0);
121
135
  }
122
- function Z(e, t) {
136
+ function Q(e, t) {
123
137
  let n = e.getScrollMax().top;
124
138
  return t < 0 ? 0 : t > n ? n : t;
125
139
  }
126
- function Q(e, t, n = !1) {
140
+ function oe(e, t, n = !1) {
127
141
  e.preventDefault();
128
- let r = S[t], i = n ? [{
142
+ let r = C[t], i = n ? [{
129
143
  pageX: e.pageX,
130
144
  pageY: e.pageY
131
145
  }] : Array.from(e.touches);
132
- if (!r) {
133
- D(`touchstart: scroller of column ${t} is undefined`);
134
- return;
135
- }
136
- T.value = n ? e.pageY : e.touches[0].pageY, r.doTouchStart(i, e.timeStamp), n && (z.value = !0);
146
+ r ? (I.value = n ? e.pageY : e.touches[0].pageY, r.doTouchStart(i, e.timeStamp), n && (B.value = !0)) : O(`touchstart: scroller of column ${t} is undefined`);
137
147
  }
138
148
  function $(e, t, n = !1) {
139
- let r = S[t], i = n ? [{
149
+ let r = C[t], i = n ? [{
140
150
  pageX: e.pageX,
141
151
  pageY: e.pageY
142
152
  }] : Array.from(e.touches);
143
- if (!r || n && !z.value) return;
144
- let a = T.value - (n ? e.pageY : e.touches[0].pageY);
145
- C.value = a ? a / Math.abs(a) : 1, r.doTouchMove(i, e.timeStamp), n && (z.value = !0);
153
+ if (!r || n && !B.value) return;
154
+ let a = I.value - (n ? e.pageY : e.touches[0].pageY);
155
+ E.value = a ? a / Math.abs(a) : 1, r.doTouchMove(i, e.timeStamp), n && (B.value = !0);
146
156
  }
147
- function ie(e, t, n = !1) {
148
- let r = S[t];
149
- !r || n && !z.value || (r.doTouchEnd(e.timeStamp), n && (z.value = !1));
157
+ function se(e, t, n = !1) {
158
+ let r = C[t];
159
+ !r || n && !B.value || (r.doTouchEnd(e.timeStamp), n && (B.value = !1));
150
160
  }
151
- function ae(e) {
152
- let t = S[e];
161
+ function ce(e) {
162
+ let t = C[e];
153
163
  if (!t) return;
154
- let n = t.getValues().top, r = ee(Z(t, n)), i = q(e, r);
155
- if (i || r === I.value[e]) {
156
- i && X(t, e, r), r === I.value[e] && Y(t, e, r);
157
- return;
158
- }
159
- I.value[e] = r, l("change", e, r, oe(e));
164
+ let n = t.getValues().top, r = re(Q(t, n)), i = q(e, r);
165
+ i || r === L.value[e] ? (i && Z(t, e, r), r === L.value[e] && X(t, e, r)) : (L.value[e] = r, l("change", e, r, le(e)));
160
166
  }
161
- function oe(e = 0) {
162
- return se()[e];
167
+ function le(e = 0) {
168
+ return ue()[e];
163
169
  }
164
- function se() {
165
- let e = x.value, t = I.value, n = [];
170
+ function ue() {
171
+ let e = S.value, t = L.value, n = [];
166
172
  return e.forEach((e, r) => {
167
173
  n[r] = e[t[r]];
168
174
  }), n;
169
175
  }
170
- function ce(e = 0) {
171
- return I.value[e];
176
+ function de(e = 0) {
177
+ return L.value[e];
172
178
  }
173
- function le() {
174
- return I.value;
179
+ function fe() {
180
+ return L.value;
175
181
  }
176
- function ue(e, t, n = () => {}) {
177
- e !== void 0 && t !== void 0 && (c.keepIndex || (I.value[e] = 0), x.value[e] = t, u(() => {
182
+ function pe(e, t, n = () => {}) {
183
+ e !== void 0 && t !== void 0 && (c.keepIndex || (L.value[e] = 0), S.value[e] = t, u(() => {
178
184
  n();
179
185
  }));
180
186
  }
181
- function de(e, t = 0) {
187
+ function me(e, t = 0) {
182
188
  u(() => {
183
- H(t), e && e();
189
+ W(t), e && e();
190
+ });
191
+ }
192
+ function he() {
193
+ if (!b.value) return;
194
+ let e = U(), t = b.value.querySelectorAll(".column-list");
195
+ e.forEach((e, n) => {
196
+ let r = C[n], i = t[n];
197
+ r && e && i && (r.setDimensions(e.clientWidth, e.clientHeight, i.offsetWidth, i.offsetHeight + V.value.maskerHeight), Y(n));
184
198
  });
185
199
  }
186
200
  return t({
187
- refresh: de,
188
- getColumnValue: oe,
189
- getColumnValues: se,
190
- getColumnIndex: ce,
191
- getColumnIndexs: le,
201
+ refresh: me,
202
+ getColumnValue: le,
203
+ getColumnValues: ue,
204
+ getColumnIndex: de,
205
+ getColumnIndexs: fe,
192
206
  getColumnIndexByDefault: G,
193
- setColumnValues: ue,
194
- isScrollInitialed: R,
195
- activedIndexs: I,
196
- scrollers: S
197
- }), (t, r) => (h(), o("div", {
207
+ setColumnValues: pe,
208
+ isScrollInitialed: z,
209
+ activedIndexs: L,
210
+ scrollers: C
211
+ }), (t, r) => (g(), o("div", {
198
212
  ref_key: "root",
199
- ref: y,
213
+ ref: b,
200
214
  class: "cu-picker-column",
201
- style: f({ height: `${B.value.indicatorHeight + 2 * B.value.maskerHeight}px` })
202
- }, [s("div", j, [
215
+ style: f({ height: `${V.value.indicatorHeight + 2 * V.value.maskerHeight}px` })
216
+ }, [s("div", M, [
203
217
  s("div", {
204
218
  class: "cu-picker-column-masker top",
205
- style: f({ height: `${B.value.maskerHeight}px` })
219
+ style: f({ height: `${V.value.maskerHeight}px` })
206
220
  }, null, 4),
207
221
  s("div", {
208
222
  class: "cu-picker-column-masker bottom",
209
- style: f({ height: `${B.value.maskerHeight}px` })
223
+ style: f({ height: `${V.value.maskerHeight}px` })
210
224
  }, null, 4),
211
- s("div", M, [(h(!0), o(n, null, _(x.value, (e, t) => (h(), o("div", {
225
+ s("div", N, [(g(!0), o(n, null, v(S.value, (e, t) => (g(), o("div", {
212
226
  key: t,
213
227
  class: "cu-picker-column-item"
214
228
  }, [s("ul", {
215
229
  class: "column-list",
216
- style: f({ "padding-top": `${B.value.maskerHeight}px` })
217
- }, [(h(!0), o(n, null, _(e, (e, n) => (h(), o("li", {
230
+ style: f({ "padding-top": `${V.value.maskerHeight}px` })
231
+ }, [(g(!0), o(n, null, v(e, (e, n) => (g(), o("li", {
218
232
  key: n,
219
233
  class: d(["column-item", {
220
- active: te(t, n),
234
+ active: ie(t, n),
221
235
  disabled: q(t, n)
222
236
  }]),
223
237
  style: f({
224
- height: `${B.value.indicatorHeight}px`,
225
- "line-height": `${B.value.indicatorHeight}px`
238
+ height: `${V.value.indicatorHeight}px`,
239
+ "line-height": `${V.value.indicatorHeight}px`
226
240
  }),
227
- textContent: v(e.text || e.label)
228
- }, null, 14, N))), 128))], 4)]))), 128)), e.cols ? (h(!0), o(n, { key: 0 }, _(e.cols - x.value.length, (e) => (h(), o("div", {
229
- key: e + x.value.length - 1,
241
+ textContent: y(e.text || e.label)
242
+ }, null, 14, P))), 128))], 4)]))), 128)), e.cols ? (g(!0), o(n, { key: 0 }, v(e.cols - S.value.length, (e) => (g(), o("div", {
243
+ key: e + S.value.length - 1,
230
244
  class: "cu-picker-column-item"
231
245
  }, [s("ul", {
232
246
  class: "column-list",
233
- style: f({ "padding-top": `${B.value.maskerHeight}px` })
247
+ style: f({ "padding-top": `${V.value.maskerHeight}px` })
234
248
  }, null, 4)]))), 128)) : a("", !0)]),
235
- s("div", P, [e.cols ? (h(!0), o(n, { key: 0 }, _(e.cols, (e) => (h(), o("div", {
249
+ s("div", ee, [e.cols ? (g(!0), o(n, { key: 0 }, v(e.cols, (e) => (g(), o("div", {
236
250
  key: e - 1,
237
251
  class: "cu-picker-column-hook",
238
- onTouchstart: (t) => Q(t, e - 1),
239
- onMousedown: (t) => Q(t, e - 1, !0),
252
+ onTouchstart: (t) => oe(t, e - 1),
253
+ onMousedown: (t) => oe(t, e - 1, !0),
240
254
  onTouchmove: (t) => $(t, e - 1),
241
255
  onMousemove: (t) => $(t, e - 1, !0),
242
- onTouchend: (t) => ie(t, e - 1),
243
- onMouseup: (t) => ie(t, e - 1, !0)
256
+ onTouchend: (t) => se(t, e - 1),
257
+ onMouseup: (t) => se(t, e - 1, !0)
244
258
  }, null, 40, F))), 128)) : a("", !0)])
245
259
  ])], 4));
246
260
  }
@@ -293,29 +307,29 @@ var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-
293
307
  "hide"
294
308
  ],
295
309
  setup(n, { expose: r, emit: a }) {
296
- let s = n, l = a, u = s.okText ?? T("md.picker.confirm"), f = s.cancelText ?? T("md.picker.cancel"), p = s.lineHeight ?? 45, _ = g(), v = g(!1), w = g(!0), E = g(null);
297
- b(() => s.modelValue, (e) => {
310
+ let s = n, l = a, u = s.okText ?? String(E("md.picker.confirm")), f = s.cancelText ?? String(E("md.picker.cancel")), p = s.lineHeight ?? 45, m = _(), v = _(!1), y = _(!0), T = _(null);
311
+ x(() => s.modelValue, (e) => {
298
312
  v.value = e, e && O();
299
- }), b(v, (e) => {
313
+ }), x(v, (e) => {
300
314
  e || l("update:modelValue", e);
301
- }), b(() => s.data, (e, t) => {
302
- C(e, t) || k();
315
+ }), x(() => s.data, (e, t) => {
316
+ w(e, t) || k();
303
317
  }, {
304
318
  deep: !0,
305
319
  immediate: !0
306
- }), b(() => s.defaultIndex, () => {
320
+ }), x(() => s.defaultIndex, () => {
307
321
  k();
308
- }, { deep: !0 }), m(() => {
322
+ }, { deep: !0 }), h(() => {
309
323
  O(), s.isView && setTimeout(() => {
310
- _.value?.refresh();
324
+ m.value?.refresh();
311
325
  });
312
326
  });
313
327
  function D() {
314
- return _.value;
328
+ return m.value;
315
329
  }
316
330
  function O() {
317
- !s.isView && s.modelValue && (v.value = s.modelValue), w.value ? w.value = !1 : setTimeout(() => {
318
- E.value = [...D()?.activedIndexs ?? []];
331
+ !s.isView && s.modelValue && (v.value = s.modelValue), y.value ? y.value = !1 : setTimeout(() => {
332
+ T.value = [...D()?.activedIndexs ?? []];
319
333
  }, 100);
320
334
  }
321
335
  function k() {
@@ -323,7 +337,7 @@ var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-
323
337
  let e = j(), t = M();
324
338
  setTimeout(() => {
325
339
  let n = D();
326
- n && S(n, {
340
+ n && C(n, {
327
341
  currentLevel: -1,
328
342
  maxLevel: s.cols,
329
343
  values: s.data || [],
@@ -336,20 +350,24 @@ var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-
336
350
  k();
337
351
  }
338
352
  function j() {
339
- return E.value || s.defaultIndex;
353
+ return T.value || s.defaultIndex;
340
354
  }
341
355
  function M() {
342
- return E.value ? [] : s.defaultValue;
356
+ return T.value ? [] : s.defaultValue;
343
357
  }
344
- function N() {
358
+ function N(e) {
359
+ let t = e;
360
+ if (typeof t.isScrolling == "function") return t.isScrolling();
361
+ let n = e;
362
+ return n._isAnimating !== !1 || n._isDecelerating !== !1 || n._isDragging !== !1 || n._isGesturing !== !1;
363
+ }
364
+ function P() {
345
365
  let e = D();
346
366
  if (!e) return;
347
- let t = e.getColumnValues(), n = !1;
348
- e.scrollers.forEach((e) => {
349
- (e._isAnimating !== !1 || e._isDecelerating !== !1 || e._isDragging !== !1 || e._isGesturing !== !1) && (n = !0);
350
- }), n || (v.value = !1, l("confirm", t));
367
+ let t = e.getColumnValues();
368
+ e.scrollers.some((e) => N(e)) || (v.value = !1, l("confirm", t));
351
369
  }
352
- function P() {
370
+ function ee() {
353
371
  l("initialed");
354
372
  }
355
373
  function F() {
@@ -360,7 +378,7 @@ var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-
360
378
  function L(e, t, n) {
361
379
  if (s.isCascade) {
362
380
  let t = D();
363
- t && S(t, {
381
+ t && C(t, {
364
382
  currentLevel: e,
365
383
  maxLevel: s.cols,
366
384
  values: [n]
@@ -399,15 +417,15 @@ var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-
399
417
  getColumnValues: H,
400
418
  getColumnIndex: U,
401
419
  getColumnIndexs: W
402
- }), (r, a) => (h(), o("div", { class: d(["cu-picker", { "with-popup": !n.isView }]) }, [n.isView ? (h(), i(I, {
420
+ }), (r, a) => (g(), o("div", { class: d(["cu-picker", { "with-popup": !n.isView }]) }, [n.isView ? (g(), i(I, {
403
421
  key: 0,
404
422
  ref_key: "pickerColumn",
405
- ref: _,
423
+ ref: m,
406
424
  data: n.data,
407
425
  "default-value": n.defaultValue,
408
426
  "default-index": n.defaultIndex,
409
427
  "invalid-index": n.invalidIndex,
410
- "line-height": y(p),
428
+ "line-height": b(p),
411
429
  "keep-index": n.keepIndex,
412
430
  cols: n.cols,
413
431
  onInitialed: a[0] ||= (e) => l("initialed"),
@@ -420,7 +438,7 @@ var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-
420
438
  "line-height",
421
439
  "keep-index",
422
440
  "cols"
423
- ])) : (h(), i(e, {
441
+ ])) : (g(), i(e, {
424
442
  key: 1,
425
443
  "model-value": v.value,
426
444
  class: "inner-popup",
@@ -433,13 +451,13 @@ var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-
433
451
  onHide: z,
434
452
  onMaskClick: F
435
453
  }, {
436
- default: x(() => [c(t, {
454
+ default: S(() => [c(t, {
437
455
  title: n.title,
438
456
  describe: n.describe,
439
- "ok-text": y(u),
440
- "cancel-text": y(f),
457
+ "ok-text": b(u),
458
+ "cancel-text": b(f),
441
459
  "large-radius": n.largeRadius,
442
- onConfirm: N,
460
+ onConfirm: P,
443
461
  onCancel: F
444
462
  }, null, 8, [
445
463
  "title",
@@ -449,15 +467,15 @@ var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-
449
467
  "large-radius"
450
468
  ]), c(I, {
451
469
  ref_key: "pickerColumn",
452
- ref: _,
470
+ ref: m,
453
471
  data: n.data,
454
472
  "default-value": M(),
455
473
  "default-index": j(),
456
474
  "invalid-index": n.invalidIndex,
457
- "line-height": y(p),
475
+ "line-height": b(p),
458
476
  "keep-index": n.keepIndex,
459
477
  cols: n.cols,
460
- onInitialed: P,
478
+ onInitialed: ee,
461
479
  onChange: L
462
480
  }, null, 8, [
463
481
  "data",
@@ -472,5 +490,4 @@ var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-
472
490
  }, 8, ["model-value", "mask-closable"]))], 2));
473
491
  }
474
492
  });
475
- //#endregion
476
493
  export { I as n, L as t };
@@ -0,0 +1 @@
1
+ let e=require("vue");var t=(0,e.defineComponent)({name:`cu-popup`,__name:`Popup`,props:{modelValue:{type:Boolean,default:!1},hasMask:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},position:{default:`center`},transition:{default:void 0},preventScroll:{type:Boolean,default:!1},preventScrollExclude:{default:``}},emits:[`update:modelValue`,`beforeShow`,`before-show`,`beforeHide`,`before-hide`,`show`,`hide`,`maskClick`],setup(t,{emit:n}){let r=t,i=n,a=typeof process<`u`&&process.env.MAND_ENV===`test`,o=(0,e.ref)(),s=null,c=(0,e.ref)(!1),l=(0,e.ref)(!1),u=(0,e.ref)(!1),d=(0,e.ref)(!1);(0,e.provide)(`mdPopupLargeRadius`,d);let f=(0,e.computed)(()=>r.transition??p(r.position));function p(e){switch(e){case`bottom`:return`cu-slide-up`;case`top`:return`cu-slide-down`;case`left`:return`cu-slide-right`;case`right`:return`cu-slide-left`;default:return`cu-fade`}}(0,e.watch)(()=>r.modelValue,e=>{e?u.value?(s&&clearTimeout(s),s=setTimeout(()=>{s=null,m()},50)):m():h()}),(0,e.watch)(()=>r.preventScrollExclude,(e,t)=>{_(!1,t),_(!0,e)}),(0,e.onMounted)(()=>{r.modelValue&&m()}),(0,e.onBeforeUnmount)(()=>{s&&=(clearTimeout(s),null)});function m(){c.value=!0,u.value=!0,l.value=!0,a&&(b(),x()),r.preventScroll&&g(!0)}function h(){u.value=!0,l.value=!1,r.preventScroll&&g(!1),i(`update:modelValue`,!1),a&&(b(),x())}function g(e){let t=e?`addEventListener`:`removeEventListener`,n=o.value?.querySelector(`.cu-popup-mask`),r=o.value?.querySelector(`.cu-popup-box`);n&&n[t](`touchmove`,v,!1),r&&r[t](`touchmove`,v,!1),_(e)}function _(e,t=r.preventScrollExclude){let n=e?`addEventListener`:`removeEventListener`,i=typeof t==`string`?t?o.value?.querySelector(t):void 0:t;i&&i[n](`touchmove`,y,!1)}function v(e){e.preventDefault()}function y(e){e.stopImmediatePropagation()}function b(){l.value?(i(`beforeShow`),i(`before-show`)):(i(`beforeHide`),i(`before-hide`))}function x(){u.value&&=(l.value?i(`show`):(c.value=!1,i(`hide`)),!1)}function S(){r.maskClosable&&(h(),i(`maskClick`))}return(n,r)=>(0,e.withDirectives)(((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{ref_key:`root`,ref:o,class:(0,e.normalizeClass)([`cu-popup`,[t.hasMask?`with-mask`:``,d.value?`large-radius`:``,t.position]])},[(0,e.createVNode)(e.Transition,{name:`cu-mask-fade`},{default:(0,e.withCtx)(()=>[(0,e.withDirectives)((0,e.createElementVNode)(`div`,{class:`cu-popup-mask`,onClick:S},null,512),[[e.vShow,t.hasMask&&l.value]])]),_:1}),(0,e.createVNode)(e.Transition,{name:f.value,onBeforeEnter:b,onBeforeLeave:b,onAfterEnter:x,onAfterLeave:x},{default:(0,e.withCtx)(()=>[(0,e.withDirectives)((0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`cu-popup-box`,[f.value]])},[(0,e.renderSlot)(n.$slots,`default`)],2),[[e.vShow,l.value]])]),_:3},8,[`name`])],2)),[[e.vShow,c.value]])}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
@@ -0,0 +1,116 @@
1
+ import { Transition as e, computed as t, createElementBlock as n, createElementVNode as r, createVNode as i, defineComponent as a, normalizeClass as o, onBeforeUnmount as s, onMounted as c, openBlock as l, provide as u, ref as d, renderSlot as f, vShow as p, watch as m, withCtx as h, withDirectives as g } from "vue";
2
+ // src/components/popup/Popup.vue
3
+ var _ = /* @__PURE__ */ a({
4
+ name: "cu-popup",
5
+ __name: "Popup",
6
+ props: {
7
+ modelValue: {
8
+ type: Boolean,
9
+ default: !1
10
+ },
11
+ hasMask: {
12
+ type: Boolean,
13
+ default: !0
14
+ },
15
+ maskClosable: {
16
+ type: Boolean,
17
+ default: !0
18
+ },
19
+ position: { default: "center" },
20
+ transition: { default: void 0 },
21
+ preventScroll: {
22
+ type: Boolean,
23
+ default: !1
24
+ },
25
+ preventScrollExclude: { default: "" }
26
+ },
27
+ emits: [
28
+ "update:modelValue",
29
+ "beforeShow",
30
+ "before-show",
31
+ "beforeHide",
32
+ "before-hide",
33
+ "show",
34
+ "hide",
35
+ "maskClick"
36
+ ],
37
+ setup(a, { emit: _ }) {
38
+ let v = a, y = _, b = typeof process < "u" && process.env.MAND_ENV === "test", x = d(), S = null, C = d(!1), w = d(!1), T = d(!1), E = d(!1);
39
+ u("mdPopupLargeRadius", E);
40
+ let D = t(() => v.transition ?? O(v.position));
41
+ function O(e) {
42
+ switch (e) {
43
+ case "bottom": return "cu-slide-up";
44
+ case "top": return "cu-slide-down";
45
+ case "left": return "cu-slide-right";
46
+ case "right": return "cu-slide-left";
47
+ default: return "cu-fade";
48
+ }
49
+ }
50
+ m(() => v.modelValue, (e) => {
51
+ e ? T.value ? (S && clearTimeout(S), S = setTimeout(() => {
52
+ S = null, k();
53
+ }, 50)) : k() : A();
54
+ }), m(() => v.preventScrollExclude, (e, t) => {
55
+ M(!1, t), M(!0, e);
56
+ }), c(() => {
57
+ v.modelValue && k();
58
+ }), s(() => {
59
+ S &&= (clearTimeout(S), null);
60
+ });
61
+ function k() {
62
+ C.value = !0, T.value = !0, w.value = !0, b && (F(), I()), v.preventScroll && j(!0);
63
+ }
64
+ function A() {
65
+ T.value = !0, w.value = !1, v.preventScroll && j(!1), y("update:modelValue", !1), b && (F(), I());
66
+ }
67
+ function j(e) {
68
+ let t = e ? "addEventListener" : "removeEventListener", n = x.value?.querySelector(".cu-popup-mask"), r = x.value?.querySelector(".cu-popup-box");
69
+ n && n[t]("touchmove", N, !1), r && r[t]("touchmove", N, !1), M(e);
70
+ }
71
+ function M(e, t = v.preventScrollExclude) {
72
+ let n = e ? "addEventListener" : "removeEventListener", r = typeof t == "string" ? t ? x.value?.querySelector(t) : void 0 : t;
73
+ r && r[n]("touchmove", P, !1);
74
+ }
75
+ function N(e) {
76
+ e.preventDefault();
77
+ }
78
+ function P(e) {
79
+ e.stopImmediatePropagation();
80
+ }
81
+ function F() {
82
+ w.value ? (y("beforeShow"), y("before-show")) : (y("beforeHide"), y("before-hide"));
83
+ }
84
+ function I() {
85
+ T.value &&= (w.value ? y("show") : (C.value = !1, y("hide")), !1);
86
+ }
87
+ function L() {
88
+ v.maskClosable && (A(), y("maskClick"));
89
+ }
90
+ return (t, s) => g((l(), n("div", {
91
+ ref_key: "root",
92
+ ref: x,
93
+ class: o(["cu-popup", [
94
+ a.hasMask ? "with-mask" : "",
95
+ E.value ? "large-radius" : "",
96
+ a.position
97
+ ]])
98
+ }, [i(e, { name: "cu-mask-fade" }, {
99
+ default: h(() => [g(r("div", {
100
+ class: "cu-popup-mask",
101
+ onClick: L
102
+ }, null, 512), [[p, a.hasMask && w.value]])]),
103
+ _: 1
104
+ }), i(e, {
105
+ name: D.value,
106
+ onBeforeEnter: F,
107
+ onBeforeLeave: F,
108
+ onAfterEnter: I,
109
+ onAfterLeave: I
110
+ }, {
111
+ default: h(() => [g(r("div", { class: o(["cu-popup-box", [D.value]]) }, [f(t.$slots, "default")], 2), [[p, w.value]])]),
112
+ _: 3
113
+ }, 8, ["name"])], 2)), [[p, C.value]]);
114
+ }
115
+ });
116
+ export { _ as t };
@@ -1,6 +1,6 @@
1
- import { t as e } from "./Icon-dWGSK6Ou.js";
1
+ import { t as e } from "./Icon-BgCtu0ZV.js";
2
2
  import { Fragment as t, createCommentVNode as n, createElementBlock as r, createVNode as i, defineComponent as a, inject as o, normalizeClass as s, openBlock as c, renderSlot as l, watch as u } from "vue";
3
- //#region src/components/popup/PopupTitleBar.vue?vue&type=script&setup=true&lang.ts
3
+ // src/components/popup/PopupTitleBar.vue?vue&type=script&setup=true&lang.ts
4
4
  var d = ["innerHTML"], f = {
5
5
  key: 1,
6
6
  class: "title-bar-title"
@@ -81,5 +81,4 @@ var d = ["innerHTML"], f = {
81
81
  ], 34));
82
82
  }
83
83
  });
84
- //#endregion
85
84
  export { _ as t };