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
package/dist/index.js CHANGED
@@ -1,2669 +1,61 @@
1
- import { t as e } from "./Icon-dWGSK6Ou.js";
2
- import { t } from "./Roller-DFJ7jMV0.js";
3
- import { i as n, n as r, r as i, t as a } from "./RollerSuccess-CVEmS9gU.js";
4
- import { t as o } from "./Button-BIi6CrwM.js";
5
- import { t as s } from "./Tag-bs5j40pF.js";
6
- import { t as c } from "./Amount-wOtRYOdx.js";
7
- import { t as l } from "./CellItem-YZD-BxKt.js";
8
- import { t as u } from "./Skeleton-BG_j23KI.js";
9
- import { t as d } from "./NoticeBar-PEYcjXwD.js";
10
- import { t as f } from "./Progress-CwIC6scr.js";
11
- import { t as p } from "./Switch-B6DvVj2p.js";
12
- import { t as m } from "./Agree-yTGTi4e6.js";
13
- import { t as h } from "./Stepper-1EOk4pCY.js";
14
- import { t as g } from "./Popup-DPYBBL95.js";
15
- import { t as _ } from "./PopupTitleBar-nVurLaOe.js";
16
- import { n as v, t as y } from "./toast-DX-RoB7Q.js";
17
- import { n as b, t as x } from "./dialog-DHIZ2SMK.js";
18
- import { n as S, t as C } from "./action-sheet-DKpi2GLQ.js";
19
- import { n as w, t as T } from "./Tip-BFZSiRc1.js";
20
- import { t as E } from "./Field-CseJzTZz.js";
21
- import { t as D } from "./CheckBoxBase-BjyVzGqj.js";
22
- import { i as ee, n as te, r as ne, t as re } from "./CheckList-Bfy3B-eN.js";
23
- import { t as ie } from "./Radio-fsc7_N5K.js";
24
- import { n as ae, t as oe } from "./RadioGroup-CMPmk8X_.js";
25
- import { t as se } from "./FieldItem-Cc7bw5vU.js";
26
- import { n as ce, r as le, t as ue } from "./NumberKeyboard-C7TRF5iC.js";
27
- import { n as de, r as fe, t as pe } from "./InputItem-bhFtp97z.js";
28
- import { t as me } from "./RadioList-CkerkQEY.js";
29
- import { t as he } from "./Codebox-D0UtCj11.js";
30
- import { n as ge, t as _e } from "./Picker-Dam0LEcc.js";
31
- import { t as ve } from "./DatePicker-TAHuve5t.js";
32
- import { n as ye, r as be, t as xe } from "./ScrollViewMore-BgYJx-TP.js";
33
- import { n as Se, t as Ce } from "./SwiperItem-CKd-XKT7.js";
34
- import { t as we } from "./Slider-DteN8p-L.js";
35
- import { Comment as Te, Fragment as O, Text as Ee, Transition as De, computed as k, createBlock as A, createCommentVNode as j, createElementBlock as M, createElementVNode as N, createSlots as P, createTextVNode as F, createVNode as I, defineComponent as L, getCurrentInstance as Oe, inject as ke, nextTick as R, normalizeClass as z, normalizeStyle as B, onActivated as Ae, onBeforeUnmount as je, onDeactivated as Me, onMounted as V, onUpdated as Ne, openBlock as H, provide as Pe, ref as U, renderList as W, renderSlot as G, toDisplayString as K, unref as Fe, useSlots as q, vModelText as Ie, vShow as J, watch as Y, withCtx as X, withDirectives as Z, withModifiers as Le } from "vue";
36
- import { t as Q, throttle as Re } from "@centui/core";
37
- import { Scroller as ze, getDpr as Be } from "@centui/core/web";
38
- //#region src/components/action-bar/ActionBar.vue?vue&type=script&setup=true&lang.ts
39
- var Ve = { class: "cu-action-bar" }, He = { class: "cu-action-bar-container" }, Ue = {
40
- key: 0,
41
- class: "cu-action-bar-text"
42
- }, We = { class: "cu-action-bar-group" }, Ge = /* @__PURE__ */ L({
43
- name: "cu-action-bar",
44
- __name: "ActionBar",
45
- props: { actions: { default: () => [] } },
46
- emits: ["click"],
47
- setup(e, { emit: t }) {
48
- let n = e, r = t, i = q(), a = k(() => n.actions.slice(0, 2));
49
- function s(e) {
50
- if (e.type === Te) return !0;
51
- if (e.type === Ee) return !String(e.children).trim();
52
- if (e.type === O) {
53
- let t = e.children;
54
- return !Array.isArray(t) || t.every(s);
55
- }
56
- return !1;
57
- }
58
- let c = k(() => {
59
- let e = i.default;
60
- return e ? e().some((e) => !s(e)) : !1;
61
- });
62
- function l(e, t) {
63
- t.onClick?.(e, t), r("click", e, t);
64
- }
65
- return (e, t) => (H(), M("div", Ve, [N("div", He, [c.value ? (H(), M("div", Ue, [G(e.$slots, "default")])) : j("", !0), N("div", We, [(H(!0), M(O, null, W(a.value, (e, t) => (H(), A(o, {
66
- key: t,
67
- class: "cu-action-bar-button",
68
- type: e.type || (e.disabled ? "disabled" : "primary"),
69
- plain: e.plain || t !== a.value.length - 1,
70
- round: e.round,
71
- inactive: e.inactive,
72
- loading: e.loading,
73
- icon: e.icon,
74
- "icon-svg": e.iconSvg,
75
- onClick: (t) => l(t, e)
76
- }, {
77
- default: X(() => [F(K(e.text), 1)]),
78
- _: 2
79
- }, 1032, [
80
- "type",
81
- "plain",
82
- "round",
83
- "inactive",
84
- "loading",
85
- "icon",
86
- "icon-svg",
87
- "onClick"
88
- ]))), 128))])])]));
89
- }
90
- }), Ke = ["textContent"], qe = { class: "cu-detail-content" }, Je = /* @__PURE__ */ L({
91
- name: "cu-detail-item",
92
- __name: "DetailItem",
93
- props: {
94
- title: { default: "" },
95
- content: { default: "" },
96
- bold: {
97
- type: Boolean,
98
- default: !1
99
- }
100
- },
101
- setup(e) {
102
- return (t, n) => (H(), M("div", { class: z(["cu-detail-item", { "is-bold": e.bold }]) }, [N("div", {
103
- class: "cu-detail-title",
104
- textContent: K(e.title)
105
- }, null, 8, Ke), N("div", qe, [G(t.$slots, "default", {}, () => [F(K(e.content), 1)])])], 2));
106
- }
107
- }), Ye = [
108
- "disabled",
109
- "readonly",
110
- "maxlength",
111
- "placeholder",
112
- "rows"
113
- ], Xe = {
114
- key: 0,
115
- class: "cu-textarea-item-msg"
116
- }, Ze = /* @__PURE__ */ L({
117
- name: "cu-textarea-item",
118
- __name: "TextareaItem",
119
- props: {
120
- title: { default: "" },
121
- name: { default: () => `textarea-item-${Math.floor(Math.random() * 1e4)}` },
122
- placeholder: { default: "" },
123
- modelValue: { default: "" },
124
- value: { default: "" },
125
- maxLength: { default: "" },
126
- maxHeight: { default: "" },
127
- solid: {
128
- type: Boolean,
129
- default: !0
130
- },
131
- readonly: {
132
- type: Boolean,
133
- default: !1
134
- },
135
- disabled: {
136
- type: Boolean,
137
- default: !1
138
- },
139
- clearable: {
140
- type: Boolean,
141
- default: !1
142
- },
143
- rows: { default: "3" },
144
- autosize: {
145
- type: Boolean,
146
- default: !1
147
- },
148
- error: { default: "" },
149
- formation: {
150
- type: Function,
151
- default: void 0
152
- }
153
- },
154
- emits: [
155
- "update:modelValue",
156
- "change",
157
- "input",
158
- "focus",
159
- "blur",
160
- "keyup",
161
- "keydown"
162
- ],
163
- setup(t, { expose: n, emit: r }) {
164
- let i = t, a = r, o = U(i.maxHeight), s = U(i.modelValue || i.value), c = U(!1), l = U(), u = k(() => i.disabled), d = k(() => i.error), f = k(() => !s.value.length);
165
- Y(() => i.modelValue === "" ? i.value : i.modelValue, (e) => {
166
- s.value = e, R(() => {
167
- x();
168
- });
169
- }), Y(s, (e) => {
170
- a("update:modelValue", e), a("change", e);
171
- }), Y(() => i.maxHeight, (e) => {
172
- o.value = e, x();
173
- }), V(() => {
174
- x();
175
- });
176
- function p(e) {
177
- let t = e.target, n = m(t.value, de(t));
178
- s.value = n.value, R(() => {
179
- fe(t, n.range), x();
180
- });
181
- }
182
- function m(e, t = 0) {
183
- return i.formation?.(i.name, e, t) || {
184
- value: e,
185
- range: t
186
- };
187
- }
188
- function h() {
189
- s.value = "", R(() => {
190
- x();
191
- }), S();
192
- }
193
- function g(e) {
194
- a("keyup", e);
195
- }
196
- function _(e) {
197
- a("keydown", e);
198
- }
199
- function v() {
200
- c.value = !0, a("focus");
201
- }
202
- function y() {
203
- setTimeout(() => {
204
- c.value = !1, a("blur");
205
- }, 100);
206
- }
207
- function b(e) {
208
- e.style.height = "auto";
209
- let t = e.scrollHeight;
210
- t !== 0 && (o.value && t > Number(o.value) && (t = Number(o.value)), e.style.height = t + "px");
211
- }
212
- function x() {
213
- i.autosize && b(l.value);
214
- }
215
- function S() {
216
- l.value?.focus(), setTimeout(() => {
217
- c.value = !0;
218
- }, 200);
219
- }
220
- function C() {
221
- l.value?.blur(), c.value = !1;
222
- }
223
- function w() {
224
- return s.value;
225
- }
226
- return n({
227
- resizeTextarea: x,
228
- focus: S,
229
- blur: C,
230
- getValue: w
231
- }), (n, r) => (H(), A(se, {
232
- class: z(["cu-textarea-item", [u.value ? "is-disabled" : "", d.value ? "is-error" : ""]]),
233
- title: t.title,
234
- solid: t.solid
235
- }, {
236
- right: X(() => [t.clearable && !u.value && !t.readonly ? Z((H(), M("div", {
237
- key: 0,
238
- class: "cu-textarea-item__clear",
239
- onClick: h
240
- }, [I(e, { name: "clear" })], 512)), [[J, !f.value && c.value]]) : j("", !0), G(n.$slots, "right")]),
241
- children: X(() => [d.value ? (H(), M("div", Xe, [N("p", null, K(d.value), 1)])) : j("", !0)]),
242
- default: X(() => [Z(N("textarea", {
243
- ref_key: "textarea",
244
- ref: l,
245
- "onUpdate:modelValue": r[0] ||= (e) => s.value = e,
246
- class: "cu-textarea-item__textarea",
247
- disabled: u.value,
248
- readonly: t.readonly,
249
- maxlength: t.maxLength,
250
- placeholder: t.placeholder,
251
- rows: t.rows,
252
- onInput: p,
253
- onFocus: v,
254
- onBlur: y,
255
- onKeyup: g,
256
- onKeydown: _
257
- }, null, 40, Ye), [[Ie, s.value]]), G(n.$slots, "footer")]),
258
- _: 3
259
- }, 8, [
260
- "class",
261
- "title",
262
- "solid"
263
- ]));
264
- }
265
- }), Qe = {
266
- key: 0,
267
- class: "icon-wrapper"
268
- }, $e = {
269
- key: 1,
270
- class: "icon-wrapper"
271
- }, et = {
272
- key: 1,
273
- class: "step-node-default"
274
- }, tt = {
275
- key: 1,
276
- class: "step-node-default"
277
- }, nt = { class: "text-wrapper" }, rt = { class: "name" }, it = {
278
- key: 0,
279
- class: "desc"
280
- }, at = .3, ot = /* @__PURE__ */ L({
281
- name: "cu-steps",
282
- __name: "Steps",
283
- props: {
284
- steps: { default: () => [] },
285
- current: { default: 0 },
286
- direction: { default: "horizontal" },
287
- transition: {
288
- type: Boolean,
289
- default: !1
290
- },
291
- verticalAdaptive: {
292
- type: Boolean,
293
- default: !1
294
- },
295
- custom: {
296
- type: Boolean,
297
- default: !1
298
- }
299
- },
300
- setup(t) {
301
- let n = t, r = U(), i = U(!1), a = U([]), o = U([]), s = U(0), c = null, l = (e) => {
302
- let t = a.value;
303
- return {
304
- transform: `translate3d${n.direction === "horizontal" ? `(${(t[e].len - 1) * 100}%, 0, 0)` : `(0, ${(t[e].len - 1) * 100}%, 0)`}`,
305
- transition: `all ${t[e].time}s linear`
306
- };
307
- };
308
- Y(() => n.current, (e, t) => {
309
- let r = p(e), i = m(r);
310
- if (n.transition) {
311
- let e = r >= t;
312
- c && clearTimeout(c), c = setTimeout(() => {
313
- h(i, e, (t) => {
314
- (e && t > s.value || !e && t < s.value) && (s.value = t);
315
- });
316
- }, 100);
317
- } else a.value = i, s.value = r;
318
- });
319
- {
320
- let e = p(n.current);
321
- s.value = e, a.value = m(e);
322
- }
323
- V(() => {
324
- u(), i.value = !0;
325
- }), Ne(() => {
326
- R(() => {
327
- u();
328
- });
329
- });
330
- function u() {
331
- if (n.direction !== "vertical" || n.verticalAdaptive) return;
332
- let e = r.value;
333
- if (!e) return;
334
- let t = e.querySelectorAll(".icon-wrapper"), i = e.querySelectorAll(".text-wrapper"), a = Array.from(i).map((e, n) => {
335
- let r = e.clientHeight, a = t[n]?.clientHeight ?? 0;
336
- return n === i.length - 1 ? r -= a : r += 40, r > 0 ? r : 0;
337
- });
338
- a.toString() !== o.value.toString() && (o.value = a);
339
- }
340
- function d(e) {
341
- let t = n.direction === "vertical" && !n.verticalAdaptive ? o.value[e] : 0;
342
- return t ? { height: `${t}px` } : null;
343
- }
344
- function f(e) {
345
- let t = s.value, n = [];
346
- return e < t && n.push("reached"), e === Math.floor(t) && n.push("current"), n.join(" ");
347
- }
348
- function p(e) {
349
- return e < 0 ? 0 : e > n.steps.length - 1 ? n.steps.length - 1 : e;
350
- }
351
- function m(e) {
352
- return n.steps.slice(0, n.steps.length - 1).map((t, n) => {
353
- let r = e - n, i = a.value[n], o = i === void 0, s;
354
- s = r <= 0 ? 0 : r >= 1 ? 1 : r;
355
- let c = (o ? s : Math.abs(i.len - s)) * at;
356
- return {
357
- len: s,
358
- time: c
359
- };
360
- });
361
- }
362
- function h(e, t, n) {
363
- let r = t ? 0 : s.value, i = (o) => {
364
- o < e.length && o > -1 && e[o] && (t ? r += e[o].len : r -= a.value[o].len - e[o].len, setTimeout(() => {
365
- i(t ? o + 1 : o - 1), n(r);
366
- }, e[o].time * 1e3)), a.value[o] = e[o];
367
- };
368
- i(t ? 0 : e.length - 1);
369
- }
370
- return (n, i) => (H(), M("div", {
371
- ref_key: "root",
372
- ref: r,
373
- class: z(["cu-steps", {
374
- "cu-steps-vertical": t.direction === "vertical",
375
- "cu-steps-horizontal": t.direction === "horizontal",
376
- "vertical-adaptive": t.direction === "vertical" && t.verticalAdaptive,
377
- "no-current": s.value % 1 != 0
378
- }])
379
- }, [t.custom ? G(n.$slots, "default", { steps: t.steps }, void 0, void 0, 0) : (H(!0), M(O, { key: 1 }, W(t.steps, (r, o) => (H(), M(O, { key: `steps-${o}` }, [N("div", { class: z(["step-wrapper", f(o)]) }, [n.$slots.icon ? (H(), M("div", Qe, [G(n.$slots, "icon", {
380
- index: o,
381
- currentIndex: s.value
382
- })])) : (H(), M("div", $e, [o < s.value ? (H(), M(O, { key: 0 }, [n.$slots.reached ? G(n.$slots, "reached", { index: o }, void 0, void 0, 0) : (H(), M("div", et, [...i[0] ||= [N("div", {
383
- class: "step-node-default-icon",
384
- style: {
385
- width: "6px",
386
- height: "6px",
387
- "border-radius": "50%"
388
- }
389
- }, null, -1)]]))], 64)) : o === s.value ? (H(), M(O, { key: 1 }, [n.$slots.current ? G(n.$slots, "current", { index: o }, void 0, void 0, 0) : (H(), A(e, {
390
- key: 1,
391
- name: "success"
392
- }))], 64)) : (H(), M(O, { key: 2 }, [n.$slots.unreached ? G(n.$slots, "unreached", { index: o }, void 0, void 0, 0) : (H(), M("div", tt, [...i[1] ||= [N("div", {
393
- class: "step-node-default-icon",
394
- style: {
395
- width: "6px",
396
- height: "6px",
397
- "border-radius": "50%"
398
- }
399
- }, null, -1)]]))], 64))])), N("div", nt, [n.$slots.content ? G(n.$slots, "content", {
400
- index: o,
401
- step: r
402
- }, void 0, void 0, 0) : (H(), M(O, { key: 1 }, [N("div", rt, K(r.name), 1), r.text ? (H(), M("div", it, K(r.text), 1)) : j("", !0)], 64))])], 2), N("div", {
403
- class: z(["bar", [t.direction === "horizontal" ? "horizontal-bar" : "vertical-bar"]]),
404
- style: B(d(o))
405
- }, [a.value[o] ? (H(), M("i", {
406
- key: 0,
407
- class: "bar-inner",
408
- style: B(l(o))
409
- }, null, 4)) : j("", !0)], 6)], 64))), 128))], 2));
410
- }
411
- }), st = { class: "cu-tab-bar" }, ct = { class: "cu-tab-bar-start" }, lt = { class: "cu-tab-bar-end" }, ut = ["onClick"], dt = /* @__PURE__ */ L({
412
- name: "cu-tab-bar",
413
- __name: "TabBar",
414
- props: {
415
- modelValue: { default: "" },
416
- value: { default: "" },
417
- items: { default: () => [] },
418
- hasInk: {
419
- type: Boolean,
420
- default: !0
421
- },
422
- inkLength: { default: "25" },
423
- immediate: {
424
- type: Boolean,
425
- default: !1
426
- }
427
- },
428
- emits: [
429
- "change",
430
- "update:modelValue",
431
- "input"
432
- ],
433
- setup(e, { expose: t, emit: n }) {
434
- let r = e, i = n, a = U(""), o = U(0), s = U(0), c = U(0), l = U(0), u = U(Date.now()), d = U(!1), f = U(!0), p = U(), m = U(null), h = [];
435
- function g(e, t) {
436
- e && (h[t] = e);
437
- }
438
- let _ = k(() => s.value > o.value), v = k(() => {
439
- for (let e = 0, t = r.items.length; e < t; e++) if (r.items[e].name === a.value) return e;
440
- return -1;
441
- }), y = k(() => {
442
- if (v.value) return r.items[v.value];
443
- });
444
- Y(() => r.modelValue === "" ? r.value : r.modelValue, (e) => {
445
- e !== a.value && (a.value = e);
446
- }, { immediate: !0 }), Y(c, () => {
447
- R(() => w());
448
- }), Y(() => r.items, () => {
449
- R(() => w());
450
- }), Y(v, () => {
451
- R(() => w());
452
- }), Y(_, () => {
453
- u.value = Date.now();
454
- }), a.value === "" && r.items.length && (a.value = r.items[0].name, i("change", r.items[0], 0, 0)), V(() => {
455
- S();
456
- }), Ae(() => {
457
- S();
458
- }), Me(() => {
459
- C();
460
- }), je(() => {
461
- C();
462
- });
463
- function b({ scrollLeft: e }) {
464
- e > 0 ? d.value = !0 : d.value = !1, f.value = !(s.value > 0 && e >= s.value - o.value);
465
- }
466
- function x(e, t) {
467
- e.disabled || (i("change", e, t, v.value), a.value = e.name, i("update:modelValue", e.name));
468
- }
469
- function S() {
470
- window.addEventListener("resize", w), w(), r.immediate && R(() => {
471
- let e = r.items[v.value];
472
- e && i("change", e, v.value, v.value);
473
- });
474
- }
475
- function C() {
476
- window.removeEventListener("resize", w);
477
- }
478
- function w() {
479
- if (!h.length) return;
480
- let e = p.value?.getBoundingClientRect();
481
- o.value = e?.width ?? 0;
482
- let t = 0;
483
- for (let e = 0, n = r.items.length; e < n; e++) {
484
- let n = h[e]?.getBoundingClientRect();
485
- t += n?.width ?? 0;
486
- }
487
- s.value = t, m.value?.reflowScroller(), R(() => {
488
- let e = h[v.value];
489
- if (!e) return;
490
- c.value = typeof r.inkLength == "string" ? Number(r.inkLength) : e.offsetWidth * r.inkLength / 100, l.value = e.offsetLeft + (e.offsetWidth - c.value) / 2;
491
- let t = h[v.value - 1], n = h[v.value + 1];
492
- if (!t) {
493
- m.value?.scrollTo(0, 0, !0);
494
- return;
495
- }
496
- if (!n) {
497
- m.value?.scrollTo(s.value, 0, !0);
498
- return;
499
- }
500
- let i = p.value?.getBoundingClientRect(), a = t.getBoundingClientRect(), u = n.getBoundingClientRect();
501
- i && a.left < i.left ? m.value?.scrollTo(t.offsetLeft, 0, !0) : i && u.right > i.right && m.value?.scrollTo(n.offsetLeft + n.offsetWidth - o.value, 0, !0);
502
- });
503
- }
504
- return t({ reflow: w }), (t, n) => (H(), M("nav", st, [N("div", {
505
- ref_key: "wrapper",
506
- ref: p,
507
- class: "cu-tab-bar-inner"
508
- }, [_.value ? (H(), M(O, { key: 0 }, [Z(N("div", ct, null, 512), [[J, d.value]]), Z(N("div", lt, null, 512), [[J, f.value]])], 64)) : j("", !0), (H(), A(be, {
509
- ref_key: "scroller",
510
- ref: m,
511
- "scrolling-x": _.value,
512
- "scrolling-y": !1,
513
- key: u.value,
514
- onScroll: b
515
- }, {
516
- default: X(() => [N("div", {
517
- class: "cu-tab-bar-list",
518
- style: B({ width: s.value + "px" })
519
- }, [(H(!0), M(O, null, W(e.items, (n, r) => (H(), M("a", {
520
- key: n.name,
521
- ref_for: !0,
522
- ref: (e) => g(e, r),
523
- class: z(["cu-tab-bar-item", {
524
- "is-active": a.value === n.name,
525
- "is-disabled": !!n.disabled,
526
- "more-than-five": e.items.length > 5 && r === 0
527
- }]),
528
- onClick: (e) => x(n, r)
529
- }, [G(t.$slots, "item", {
530
- item: n,
531
- items: e.items,
532
- index: r,
533
- currentName: a.value
534
- }, () => [F(K(n.label), 1)])], 10, ut))), 128))], 4), e.hasInk ? (H(), M("span", {
535
- key: 0,
536
- class: z(["cu-tab-bar-ink", { "is-disabled": y.value && y.value.disabled }]),
537
- style: B({
538
- width: c.value + "px",
539
- transform: "translateX(" + l.value + "px)"
540
- })
541
- }, null, 6)) : j("", !0)]),
542
- _: 3
543
- }, 8, ["scrolling-x"]))], 512)]));
544
- }
545
- }), ft = { class: "cu-tabs" }, pt = { class: "cu-tabs-content" }, mt = /* @__PURE__ */ L({
546
- name: "cu-tabs",
547
- __name: "Tabs",
548
- props: {
549
- modelValue: { default: void 0 },
550
- hasInk: {
551
- type: Boolean,
552
- default: !0
553
- },
554
- inkLength: { default: 25 },
555
- immediate: {
556
- type: Boolean,
557
- default: !1
558
- }
559
- },
560
- emits: ["update:modelValue", "change"],
561
- setup(e, { expose: t, emit: n }) {
562
- let r = e, i = n, a = U(null), o = U(r.modelValue), s = U(0), c = U([]), l = k(() => c.value.map((e) => ({
563
- name: e.name,
564
- label: e.label,
565
- disabled: e.disabled
566
- }))), u = k(() => {
567
- for (let e = 0, t = l.value.length; e < t; e++) if (l.value[e].name === o.value) return e;
568
- return 0;
569
- });
570
- Pe("rootTabs", {
571
- get currentName() {
572
- return o.value;
573
- },
574
- get prevIndex() {
575
- return s.value;
576
- },
577
- get currentIndex() {
578
- return u.value;
579
- },
580
- addPane(e) {
581
- c.value.indexOf(e) === -1 && c.value.push(e);
582
- },
583
- removePane(e) {
584
- let t = c.value.indexOf(e);
585
- t >= 0 && c.value.splice(t, 1);
586
- },
587
- forceUpdate() {
588
- c.value = [...c.value];
589
- }
590
- }), Y(() => r.modelValue, (e) => {
591
- e !== o.value && (o.value = e);
592
- }), V(() => {
593
- !o.value && l.value.length && (o.value = l.value[0].name);
594
- });
595
- function d(e, t, n) {
596
- o.value = e.name, s.value = n, i("update:modelValue", e.name), i("change", e);
597
- }
598
- function f() {
599
- a.value?.reflow();
600
- }
601
- return t({ reflowTabBar: f }), (t, n) => (H(), M("div", ft, [I(dt, {
602
- ref_key: "tabBar",
603
- ref: a,
604
- items: l.value,
605
- value: o.value,
606
- "has-ink": e.hasInk,
607
- "ink-length": e.inkLength,
608
- immediate: e.immediate,
609
- onChange: d,
610
- onInput: n[0] ||= (e) => o.value = e
611
- }, null, 8, [
612
- "items",
613
- "value",
614
- "has-ink",
615
- "ink-length",
616
- "immediate"
617
- ]), N("div", pt, [G(t.$slots, "default")])]));
618
- }
619
- }), ht = ["tab"], gt = /* @__PURE__ */ L({
620
- name: "cu-tab-pane",
621
- __name: "TabPane",
622
- props: {
623
- label: { default: void 0 },
624
- name: { default: void 0 },
625
- disabled: {
626
- type: Boolean,
627
- default: !1
628
- }
629
- },
630
- setup(e) {
631
- let t = e, n = Oe()?.proxy, r = ke("rootTabs", null), i = k(() => r?.currentName === t.name), a = k(() => r && r.prevIndex > r.currentIndex ? "cu-tab-slide-right" : "cu-tab-slide-left");
632
- return Y(() => t.label, () => r?.forceUpdate?.()), Y(() => t.disabled, () => r?.forceUpdate?.()), r && n && r.addPane(n), je(() => {
633
- r && n && r.removePane(n);
634
- }), (t, n) => (H(), A(De, { name: a.value }, {
635
- default: X(() => [Z(N("div", {
636
- class: "cu-tab-pane",
637
- role: "tabpanel",
638
- tab: e.name
639
- }, [G(t.$slots, "default")], 8, ht), [[J, i.value]])]),
640
- _: 3
641
- }, 8, ["name"]));
642
- }
643
- }), _t = /* @__PURE__ */ L({
644
- name: "cu-transition",
645
- inheritAttrs: !1,
646
- __name: "Transition",
647
- setup(e) {
648
- return (e, t) => (H(), A(De, null, {
649
- default: X(() => [G(e.$slots, "default")]),
650
- _: 3
651
- }));
652
- }
653
- }), vt = { class: "cu-water-mark" }, yt = { class: "water-mark-container" }, bt = 14, xt = "#858B9C", St = /* @__PURE__ */ L({
654
- name: "cu-water-mark",
655
- __name: "WaterMark",
656
- props: {
657
- content: { default: "" },
658
- spacing: { default: "20vw" },
659
- repeatX: {
660
- type: Boolean,
661
- default: !0
662
- },
663
- repeatY: {
664
- type: Boolean,
665
- default: !0
666
- },
667
- rotate: { default: -30 },
668
- opacity: { default: .1 }
669
- },
670
- setup(e) {
671
- let t = e, n = q(), r = U(), i = U(), a = typeof process < "u" && process.env.MAND_ENV === "test" ? 2 : 50, o = k(() => {
672
- let e = n.watermark;
673
- return e ? e({ coord: {
674
- row: 1,
675
- col: 1
676
- } }).some((e) => !c(e)) : !1;
677
- }), s = k(() => o.value || !!t.content);
678
- function c(e) {
679
- if (!e || typeof e != "object") return !0;
680
- let t = e;
681
- if (t.type === Te) return !0;
682
- if (t.type === O) {
683
- let e = t.children;
684
- return !Array.isArray(e) || e.every(c);
685
- }
686
- return !1;
687
- }
688
- let l = null, u = 2, d = 0, f = 0, p = 0;
689
- V(() => {
690
- t.content && (l = i.value?.getContext("2d") ?? null, l && (u = Math.max(Be(), 2), m(), h(), g()));
691
- });
692
- function m() {
693
- let e = r.value, t = i.value;
694
- e && t && (d = t.width = e.clientWidth * u, f = t.height = e.clientHeight * u, l.scale(1 / u, 1 / u));
695
- }
696
- function h() {
697
- let { spacing: e } = t;
698
- if (typeof e == "number") {
699
- p = e;
700
- return;
701
- }
702
- let [, n = "20", r = "vw"] = /([0-9]+)([A-Za-z]+)/.exec(e) ?? [];
703
- r === "px" ? p = Number(n) : r === "vh" ? p = Number(n) * window.screen.height / 100 : r === "vw" && (p = Number(n) * window.screen.width / 100), p *= u;
704
- }
705
- function g() {
706
- if (!l) return;
707
- let e = t.content.length * bt * u, n = Math.ceil(d * u / (e + p)), r = Math.ceil(f * u / (bt * u + p)), i = bt * u;
708
- l.font = `${i}px "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif`, l.fillStyle = xt;
709
- let a = 0, o = 0;
710
- for (let s = 0; s < r; s++) {
711
- a = 0;
712
- for (let r = 0; r < n; r++) l.fillText(t.content, a, o), a += e;
713
- o += i + p;
714
- }
715
- }
716
- return (t, n) => (H(), M("div", vt, [N("div", yt, [G(t.$slots, "default")]), s.value ? (H(), M("div", {
717
- key: 0,
718
- class: "water-mark-list",
719
- ref_key: "mark",
720
- ref: r
721
- }, [N("div", {
722
- class: "water-mark-list-wrapper",
723
- style: B({
724
- opacity: e.opacity,
725
- transform: `rotate(${e.rotate}deg)`
726
- })
727
- }, [e.content ? (H(), M("canvas", {
728
- key: 0,
729
- ref_key: "canvas",
730
- ref: i,
731
- class: "water-mark-canvas"
732
- }, null, 512)) : o.value ? (H(!0), M(O, { key: 1 }, W(e.repeatY ? Fe(a) : 1, (n) => (H(), M("ul", {
733
- key: `line-${n}`,
734
- class: "water-mark-line",
735
- style: B({ marginBottom: e.spacing })
736
- }, [(H(!0), M(O, null, W(e.repeatX ? Fe(a) : 1, (r) => (H(), M("li", {
737
- key: `item-${r}`,
738
- class: "water-mark-item",
739
- style: B(n % 2 == 0 ? { marginLeft: e.repeatX ? e.spacing : 0 } : { marginRight: e.repeatX ? e.spacing : 0 })
740
- }, [G(t.$slots, "watermark", { coord: {
741
- row: n,
742
- col: r
743
- } })], 4))), 128))], 4))), 128)) : j("", !0)], 4)], 512)) : j("", !0)]));
744
- }
745
- }), Ct = { class: "cu-result" }, wt = { class: "cu-result-image" }, Tt = ["src"], Et = {
746
- key: 0,
747
- class: "cu-result-text"
748
- }, Dt = {
749
- key: 1,
750
- class: "cu-result-subtext"
751
- }, Ot = {
752
- key: 2,
753
- class: "cu-result-buttons"
754
- }, kt = /* @__PURE__ */ L({
755
- name: "cu-result-page",
756
- __name: "ResultPage",
757
- props: {
758
- type: { default: "empty" },
759
- imgUrl: { default: "" },
760
- text: { default: "" },
761
- subtext: { default: "" },
762
- buttons: { default: () => [] }
763
- },
764
- setup(e) {
765
- let t = e, n = k(() => t.imgUrl || `//manhattan.didistatic.com/static/manhattan/mand-mobile/result-page/2.1/${t.type}.png`), r = k(() => t.text || {
766
- network: Q("md.result_page.networkError"),
767
- empty: Q("md.result_page.noInformation")
768
- }[t.type] || ""), i = k(() => t.subtext || { lost: Q("md.result_page.lostWay") }[t.type] || "");
769
- return (t, a) => (H(), M("div", Ct, [
770
- N("div", wt, [N("img", {
771
- src: n.value,
772
- class: z(!e.imgUrl && e.type)
773
- }, null, 10, Tt)]),
774
- r.value ? (H(), M("div", Et, K(r.value), 1)) : j("", !0),
775
- i.value ? (H(), M("div", Dt, K(i.value), 1)) : j("", !0),
776
- e.buttons.length ? (H(), M("div", Ot, [(H(!0), M(O, null, W(e.buttons, (e, t) => (H(), A(o, {
777
- key: t,
778
- type: e.type,
779
- plain: e.plain === void 0 || e.plain,
780
- round: e.round,
781
- inactive: e.inactive,
782
- loading: e.loading,
783
- icon: e.icon,
784
- "icon-svg": e.iconSvg,
785
- size: "small",
786
- inline: "",
787
- onClick: (t) => e.handler?.()
788
- }, {
789
- default: X(() => [F(K(e.text), 1)]),
790
- _: 2
791
- }, 1032, [
792
- "type",
793
- "plain",
794
- "round",
795
- "inactive",
796
- "loading",
797
- "icon",
798
- "icon-svg",
799
- "onClick"
800
- ]))), 128))])) : j("", !0)
801
- ]));
802
- }
803
- }), At = 60, jt = 2, $ = 30, Mt = /* @__PURE__ */ L({
804
- name: "cu-ruler",
805
- __name: "Ruler",
806
- props: {
807
- modelValue: { default: 0 },
808
- value: { default: 0 },
809
- scope: { default: () => [0, 100] },
810
- step: { default: 10 },
811
- unit: { default: 1 },
812
- min: { default: 0 },
813
- max: { default: 100 },
814
- stepTextPosition: { default: "top" },
815
- stepTextRender: {
816
- type: Function,
817
- default: () => void 0
818
- }
819
- },
820
- emits: [
821
- "update:modelValue",
822
- "input",
823
- "change"
824
- ],
825
- setup(e, { emit: t }) {
826
- let n = e, r = k(() => n.modelValue || n.value), i = t, a = U(), o = null, s = null, c = U(!1), l = U(!1), u = U(!1), d = U(0), f = 0, p = k(() => Math.ceil((n.scope[1] - n.scope[0]) / n.unit)), m = k(() => (a.value?.clientWidth ?? 0) * jt), h = k(() => {
827
- let [e, t] = n.scope;
828
- return n.min > t ? e : n.min > e ? n.min : e;
829
- }), g = k(() => {
830
- let [e, t] = n.scope;
831
- return e > n.max || n.max > t ? t : n.max;
832
- }), _ = k(() => Math.ceil((h.value - n.scope[0]) / n.unit) * $), v = k(() => Math.ceil((n.scope[1] - g.value) / n.unit) * $), y = k(() => n.stepTextPosition === "bottom");
833
- Y(() => r.value, () => {
834
- if (u.value) return;
835
- f = 0, u.value = !0;
836
- let e = S();
837
- C(e), s?.scrollTo(e, 0, !0);
838
- }), V(() => {
839
- o = a.value?.getContext("2d") ?? null, b(), d.value = m.value, x();
840
- });
841
- function b() {
842
- let e = a.value;
843
- e && o && (e.width = m.value, e.height = 120, o.scale(1 / jt, 1));
844
- }
845
- function x() {
846
- let e = Re((e) => C(e), 10), t = new ze((t) => {
847
- c.value ? e(t) : C(t);
848
- }, {
849
- scrollingX: !0,
850
- scrollingY: !1,
851
- snapping: !0,
852
- snappingVelocity: 1,
853
- animationDuration: 200,
854
- inRequestAnimationFrame: !0,
855
- scrollingComplete: () => {
856
- u.value = !1;
857
- }
858
- }), n = p.value * $ + m.value - _.value - v.value, r = S();
859
- C(r), t.setDimensions(m.value, At, n, At), t.setSnapSize($, 0), t.scrollTo(r, 0, !1), s = t, c.value = !0;
860
- }
861
- function S() {
862
- let [e] = n.scope;
863
- return d.value = m.value - Math.ceil((h.value - e) / n.unit) * $, r.value <= h.value ? 0 : r.value >= g.value ? p.value * $ : Math.ceil((r.value - h.value) / n.unit) * $;
864
- }
865
- function C(e) {
866
- o && (e = +e.toFixed(2), f = e, d.value += f - e, o.clearRect(0, 0, m.value * 4, 240), w());
867
- }
868
- function w() {
869
- if (!o) return;
870
- let e = o, [t] = n.scope, r = 120 - (y.value ? 62 : 0), i = Math.round(n.step / n.unit);
871
- e.lineWidth = 2, e.font = "44px DIDIFD-Medium, \"Helvetica Neue\",Helvetica,\"PingFang SC\",\"Hiragino Sans GB\",\"Microsoft YaHei\",\"微软雅黑\",Arial,sans-serif";
872
- for (let a = 0; a <= p.value; a++) {
873
- let o = d.value + a * $;
874
- if (!(o < 0 || o > m.value * 2)) {
875
- if (o < d.value + _.value || o > d.value + 1 + p.value * $ - v.value ? (e.fillStyle = "#E2E4EA", e.strokeStyle = "#E2E4EA") : (e.fillStyle = "#C5CAD5", e.strokeStyle = "#858B9C"), e.beginPath(), e.moveTo(o, r), a % i === 0) {
876
- let i = T(t + n.unit * a), s = String(i).length * 22 / 2;
877
- e.fillText(String(i), o - s, 44 + (y.value ? 70 : 0)), e.lineTo(o, r - 40);
878
- } else e.lineTo(o, r - 20);
879
- e.stroke();
880
- }
881
- }
882
- e.strokeStyle = "#E2E4EA", e.beginPath(), e.moveTo(d.value, r), e.lineTo(d.value + p.value * $, r), e.stroke(), te();
883
- }
884
- function T(e) {
885
- return n.stepTextRender?.(e) ?? e;
886
- }
887
- let E = !1;
888
- function D(e) {
889
- if (l.value || E) return;
890
- e.preventDefault(), e.stopPropagation(), s?.doTouchStart(Array.from(e.touches), e.timeStamp), l.value = !0, E = !0, u.value = !0;
891
- let t = (e) => {
892
- e.preventDefault(), e.stopPropagation(), l.value && s?.doTouchMove(Array.from(e.touches), e.timeStamp, e.scale);
893
- }, n = (e) => {
894
- e.preventDefault(), e.stopPropagation(), l.value = !1, E = !1, s?.doTouchEnd(e.timeStamp), window.removeEventListener("touchmove", t), window.removeEventListener("touchend", n);
895
- };
896
- window.addEventListener("touchmove", t), window.addEventListener("touchend", n);
897
- }
898
- let ee = (e) => {
899
- e.preventDefault();
900
- };
901
- function te() {
902
- if (!c.value) return;
903
- let [e] = n.scope;
904
- if (d.value > m.value) {
905
- ne(h.value);
906
- return;
907
- }
908
- let t = d.value >= 0 ? Math.abs(d.value - m.value) : Math.abs(d.value) + m.value, r = e + Math.round(t / $) * n.unit;
909
- r > g.value && (r = g.value), r < h.value && (r = h.value), ne(r);
910
- }
911
- function ne(e) {
912
- i("update:modelValue", e), i("input", e), i("change", e);
913
- }
914
- return (e, t) => (H(), M("div", {
915
- class: "cu-ruler",
916
- onTouchstart: D,
917
- onTouchend: ee
918
- }, [
919
- N("canvas", {
920
- ref_key: "canvas",
921
- ref: a,
922
- class: "cu-ruler-canvas"
923
- }, null, 512),
924
- N("div", { class: z(["cu-ruler-cursor", [y.value && "cu-ruler-cursor-bottom"]]) }, null, 2),
925
- t[0] ||= N("div", { class: "cu-ruler-arrow" }, null, -1)
926
- ], 32));
927
- }
928
- }), Nt = { class: "cu-landscape-content" }, Pt = /* @__PURE__ */ L({
929
- name: "cu-landscape",
930
- __name: "Landscape",
931
- props: {
932
- modelValue: {
933
- type: Boolean,
934
- default: !1
935
- },
936
- scroll: {
937
- type: Boolean,
938
- default: !1
939
- },
940
- fullScreen: {
941
- type: Boolean,
942
- default: !1
943
- },
944
- hasMask: {
945
- type: Boolean,
946
- default: !0
947
- },
948
- maskClosable: {
949
- type: Boolean,
950
- default: !1
951
- },
952
- transition: { default: void 0 }
953
- },
954
- emits: [
955
- "update:modelValue",
956
- "input",
957
- "show",
958
- "hide"
959
- ],
960
- setup(t, { emit: n }) {
961
- let r = t, i = n, a = U(r.modelValue), o = k(() => r.transition ?? (r.fullScreen ? "cu-fade" : "cu-punch"));
962
- Y(() => r.modelValue, (e) => {
963
- a.value = e;
964
- });
965
- function s(e) {
966
- a.value = e, i("update:modelValue", !1), i("input", !1);
967
- }
968
- function c() {
969
- a.value = !1;
970
- }
971
- return (n, r) => (H(), M("div", { class: z(["cu-landscape", { "is-full": t.fullScreen }]) }, [I(g, {
972
- modelValue: a.value,
973
- "onUpdate:modelValue": [r[0] ||= (e) => a.value = e, s],
974
- "mask-closable": t.maskClosable,
975
- "prevent-scroll": "",
976
- "prevent-scroll-exclude": ".cu-landscape-content",
977
- "has-mask": !t.fullScreen && t.hasMask,
978
- transition: o.value,
979
- onShow: r[1] ||= (e) => n.$emit("show"),
980
- onHide: r[2] ||= (e) => n.$emit("hide")
981
- }, {
982
- default: X(() => [N("div", { class: z(["cu-landscape-body", { scroll: t.scroll }]) }, [N("div", Nt, [G(n.$slots, "default")]), I(e, {
983
- class: z(["cu-landscape-close", { dark: !t.hasMask || t.fullScreen }]),
984
- name: t.fullScreen ? "clear" : "close",
985
- onClick: c
986
- }, null, 8, ["class", "name"])], 2)]),
987
- _: 3
988
- }, 8, [
989
- "modelValue",
990
- "mask-closable",
991
- "has-mask",
992
- "transition"
993
- ])], 2));
994
- }
995
- }), Ft = { class: "cu-selector-container" }, It = /* @__PURE__ */ L({
996
- name: "cu-selector",
997
- __name: "Selector",
998
- props: {
999
- modelValue: {
1000
- type: Boolean,
1001
- default: !1
1002
- },
1003
- data: { default: () => [] },
1004
- defaultValue: {
1005
- type: [
1006
- String,
1007
- Number,
1008
- Boolean,
1009
- Array
1010
- ],
1011
- default: ""
1012
- },
1013
- isCheck: {
1014
- type: Boolean,
1015
- default: !1
1016
- },
1017
- maxHeight: { default: "auto" },
1018
- minHeight: { default: "auto" },
1019
- title: { default: "" },
1020
- describe: { default: "" },
1021
- okText: { default: "" },
1022
- cancelText: { default: void 0 },
1023
- maskClosable: {
1024
- type: Boolean,
1025
- default: !0
1026
- },
1027
- hideTitleBar: {
1028
- type: Boolean,
1029
- default: !1
1030
- },
1031
- multi: {
1032
- type: Boolean,
1033
- default: !1
1034
- },
1035
- icon: { default: "checked" },
1036
- iconInverse: { default: "check" },
1037
- iconDisabled: { default: "check-disabled" },
1038
- iconSvg: {
1039
- type: Boolean,
1040
- default: !1
1041
- },
1042
- iconSize: { default: "md" },
1043
- iconPosition: { default: "right" },
1044
- largeRadius: {
1045
- type: Boolean,
1046
- default: !1
1047
- }
1048
- },
1049
- emits: [
1050
- "update:modelValue",
1051
- "choose",
1052
- "confirm",
1053
- "cancel",
1054
- "show",
1055
- "hide"
1056
- ],
1057
- setup(e, { emit: t }) {
1058
- let n = e, r = t, i = q(), a = U(null), o = U(n.modelValue), s = U(Date.now()), c = U(Date.now() + 1), l = U(-1), u = U(-1), d = U([]), f = k(() => n.okText !== ""), p = k(() => {
1059
- let e = i.default;
1060
- return !!e && e({
1061
- option: {},
1062
- index: -1,
1063
- selected: !1
1064
- }).some((e) => e.type !== Comment);
1065
- }), m = k(() => n.cancelText ?? (n.okText ? Q("md.selector.cancel") : ""));
1066
- Y(() => n.modelValue, (e) => {
1067
- o.value = e;
1068
- }), Y(o, (e) => {
1069
- r("update:modelValue", e);
1070
- }), Y(() => n.defaultValue, (e) => {
1071
- n.multi && e !== "" && (d.value = Array.isArray(e) ? e : [e]);
1072
- }, { immediate: !0 });
1073
- function h() {
1074
- if (n.multi) {
1075
- r("confirm", d.value.slice()), o.value = !1;
1076
- return;
1077
- }
1078
- u.value > -1 && (l.value = u.value, o.value = !1, r("confirm", n.data[l.value]));
1079
- }
1080
- function v() {
1081
- o.value = !1, u.value = l.value, u.value === -1 ? (s.value = Date.now(), c.value = Date.now() + 1) : a.value?.selectByIndex(u.value), r("cancel");
1082
- }
1083
- function y(e, t) {
1084
- u.value = t, f.value || (l.value = t, o.value = !1), r("choose", e);
1085
- }
1086
- return (t, n) => (H(), M("div", { class: z(["cu-selector", {
1087
- "is-normal": !e.isCheck,
1088
- "is-check": e.isCheck
1089
- }]) }, [I(g, {
1090
- class: "inner-popup",
1091
- modelValue: o.value,
1092
- "onUpdate:modelValue": n[1] ||= (e) => o.value = e,
1093
- position: "bottom",
1094
- "mask-closable": e.maskClosable,
1095
- onShow: n[2] ||= (e) => t.$emit("show"),
1096
- onHide: n[3] ||= (e) => t.$emit("hide"),
1097
- onMaskClick: v
1098
- }, {
1099
- default: X(() => [Z(I(_, {
1100
- title: e.title,
1101
- describe: e.describe,
1102
- "ok-text": e.okText,
1103
- "cancel-text": m.value,
1104
- "large-radius": e.largeRadius,
1105
- "only-close": !e.isCheck && !f.value && !e.cancelText,
1106
- onConfirm: h,
1107
- onCancel: v
1108
- }, null, 8, [
1109
- "title",
1110
- "describe",
1111
- "ok-text",
1112
- "cancel-text",
1113
- "large-radius",
1114
- "only-close"
1115
- ]), [[J, !e.hideTitleBar || f.value]]), N("div", Ft, [I(be, {
1116
- ref: "scroll",
1117
- "scrolling-x": !1,
1118
- style: B({
1119
- maxHeight: `${e.maxHeight}`,
1120
- minHeight: `${e.minHeight}`
1121
- })
1122
- }, {
1123
- default: X(() => [
1124
- G(t.$slots, "header"),
1125
- e.multi ? (H(), A(re, {
1126
- class: "cu-selector-list",
1127
- ref: "check",
1128
- key: c.value,
1129
- modelValue: d.value,
1130
- "onUpdate:modelValue": n[0] ||= (e) => d.value = e,
1131
- options: e.data,
1132
- "is-slot-scope": p.value,
1133
- icon: e.icon,
1134
- "icon-disabled": e.iconDisabled,
1135
- "icon-inverse": e.iconInverse,
1136
- "icon-position": e.iconPosition,
1137
- "icon-size": e.iconSize,
1138
- "icon-svg": e.iconSvg
1139
- }, P({ _: 2 }, [p.value ? {
1140
- name: "default",
1141
- fn: X(({ option: e, index: n, selected: r }) => [G(t.$slots, "default", {
1142
- option: e,
1143
- index: n,
1144
- selected: r
1145
- })]),
1146
- key: "0"
1147
- } : void 0]), 1032, [
1148
- "modelValue",
1149
- "options",
1150
- "is-slot-scope",
1151
- "icon",
1152
- "icon-disabled",
1153
- "icon-inverse",
1154
- "icon-position",
1155
- "icon-size",
1156
- "icon-svg"
1157
- ])) : (H(), A(me, {
1158
- class: "cu-selector-list",
1159
- ref_key: "radio",
1160
- ref: a,
1161
- key: s.value,
1162
- "model-value": e.defaultValue,
1163
- options: e.data,
1164
- "is-slot-scope": p.value,
1165
- icon: e.icon,
1166
- "icon-disabled": e.iconDisabled,
1167
- "icon-inverse": e.iconInverse,
1168
- "icon-position": e.iconPosition,
1169
- "icon-size": e.iconSize,
1170
- "icon-svg": e.iconSvg,
1171
- onChange: y
1172
- }, P({ _: 2 }, [p.value ? {
1173
- name: "default",
1174
- fn: X(({ option: e, index: n, selected: r }) => [G(t.$slots, "default", {
1175
- option: e,
1176
- index: n,
1177
- selected: r
1178
- })]),
1179
- key: "0"
1180
- } : void 0]), 1032, [
1181
- "model-value",
1182
- "options",
1183
- "is-slot-scope",
1184
- "icon",
1185
- "icon-disabled",
1186
- "icon-inverse",
1187
- "icon-position",
1188
- "icon-size",
1189
- "icon-svg"
1190
- ])),
1191
- G(t.$slots, "footer")
1192
- ]),
1193
- _: 3
1194
- }, 8, ["style"])])]),
1195
- _: 3
1196
- }, 8, ["modelValue", "mask-closable"])], 2));
1197
- }
1198
- }), Lt = { class: "cu-drop-menu" }, Rt = { class: "cu-drop-menu-bar" }, zt = ["onClick"], Bt = ["textContent"], Vt = { class: "cu-drop-menu-list" }, Ht = /* @__PURE__ */ L({
1199
- name: "cu-drop-menu",
1200
- __name: "DropMenu",
1201
- props: {
1202
- data: { default: () => [] },
1203
- defaultValue: { default: () => [] }
1204
- },
1205
- emits: [
1206
- "change",
1207
- "show",
1208
- "hide"
1209
- ],
1210
- setup(e, { expose: t, emit: n }) {
1211
- let r = e, i = n, a = q(), o = U(!1), s = U([]), c = U([]), l = U(-1), u = U(""), d = k(() => {
1212
- let e = a.default;
1213
- return e ? e({ option: {} }).some((e) => e.type !== Comment) : !1;
1214
- }), f = k(() => l.value < 0 || !r.data[l.value] ? [] : r.data[l.value].options ?? []);
1215
- Y(() => r.data, (e, t) => {
1216
- JSON.stringify(e) !== JSON.stringify(t) && p();
1217
- }), Y(() => r.defaultValue, (e, t) => {
1218
- JSON.stringify(e) !== JSON.stringify(t) && p();
1219
- }), V(() => {
1220
- p();
1221
- });
1222
- function p() {
1223
- c.value = r.defaultValue;
1224
- let e = (t, n, i) => {
1225
- t && t.forEach((t) => {
1226
- let a = i[0], o = r.defaultValue[a], c = t;
1227
- if (o !== void 0 && (c.value === o || c.text === o || c.label === o)) {
1228
- s.value[a] = c;
1229
- return;
1230
- }
1231
- n > 0 && e(c.options ?? void 0, n, i);
1232
- });
1233
- };
1234
- r.data.forEach((t, n) => {
1235
- e(t.options ?? [], 0, [n]);
1236
- });
1237
- }
1238
- function m(e) {
1239
- return !!(s.value[e] !== void 0 || r.defaultValue[e]);
1240
- }
1241
- function h(e, t) {
1242
- let n = s.value[t];
1243
- return n === void 0 ? e.text : String(n.text ?? "");
1244
- }
1245
- function _(e, t) {
1246
- e && !e.disabled && (o.value ? o.value = !1 : (o.value = !0, l.value = t));
1247
- }
1248
- function v(e) {
1249
- let t = l.value, n = r.data[t];
1250
- o.value = !1, c.value[t] = e.value, s.value[t] = e, i("change", n, e);
1251
- }
1252
- return t({
1253
- getSelectedValues: () => s.value,
1254
- getSelectedValue: (e) => s.value[e]
1255
- }), (t, n) => (H(), M("div", Lt, [N("div", Rt, [(H(!0), M(O, null, W(e.data, (e, t) => (H(), M("div", {
1256
- key: t,
1257
- class: z(["bar-item", {
1258
- active: t === l.value,
1259
- selected: m(t),
1260
- disabled: e.disabled
1261
- }]),
1262
- onClick: (n) => _(e, t)
1263
- }, [N("span", { textContent: K(h(e, t)) }, null, 8, Bt)], 10, zt))), 128))]), I(g, {
1264
- modelValue: o.value,
1265
- "onUpdate:modelValue": n[0] ||= (e) => o.value = e,
1266
- position: "top",
1267
- "prevent-scroll": "",
1268
- "prevent-scroll-exclude": u.value,
1269
- onShow: n[1] ||= (e) => t.$emit("show"),
1270
- onHide: n[2] ||= (e) => t.$emit("hide"),
1271
- onBeforeHide: n[3] ||= (e) => l.value = -1
1272
- }, {
1273
- default: X(() => [N("div", Vt, [I(me, {
1274
- "model-value": c.value[l.value],
1275
- options: f.value,
1276
- "is-slot-scope": d.value,
1277
- "align-center": "",
1278
- onChange: v
1279
- }, P({ _: 2 }, [d.value ? {
1280
- name: "default",
1281
- fn: X(({ option: e }) => [G(t.$slots, "default", { option: e })]),
1282
- key: "0"
1283
- } : void 0]), 1032, [
1284
- "model-value",
1285
- "options",
1286
- "is-slot-scope"
1287
- ])])]),
1288
- _: 3
1289
- }, 8, ["modelValue", "prevent-scroll-exclude"])]));
1290
- }
1291
- }), Ut = { class: "cu-tab-picker" }, Wt = { class: "cu-tab-picker-content" }, Gt = /* @__PURE__ */ L({
1292
- name: "cu-tab-picker",
1293
- __name: "TabPicker",
1294
- props: {
1295
- modelValue: {
1296
- type: Boolean,
1297
- default: !1
1298
- },
1299
- data: { default: () => ({}) },
1300
- defaultValue: { default: () => [] },
1301
- placeholder: { default: () => Q("md.tab_picker.choose") },
1302
- title: { default: "" },
1303
- describe: { default: "" },
1304
- maskClosable: {
1305
- type: Boolean,
1306
- default: !0
1307
- },
1308
- largeRadius: {
1309
- type: Boolean,
1310
- default: !1
1311
- }
1312
- },
1313
- emits: [
1314
- "update:modelValue",
1315
- "select",
1316
- "change",
1317
- "show",
1318
- "hide"
1319
- ],
1320
- setup(t, { expose: n, emit: r }) {
1321
- let i = t, a = r, o = q(), s = U(null), c = U(null), l = U(i.defaultValue.slice()), u = U([]), d = U(i.data.name ?? ""), f = U(""), p = U(Date.now()), m = k(() => {
1322
- let e = o.default;
1323
- return e ? e({ option: {} }).some((e) => e.type !== Comment) : !1;
1324
- }), h = k(() => {
1325
- let e = [], t = i.data, n = 0;
1326
- for (; t && t.name;) {
1327
- let r = {
1328
- name: t.name,
1329
- label: t.label || i.placeholder,
1330
- value: l.value[n],
1331
- selected: null,
1332
- options: t.options ?? []
1333
- }, a = !1, o = t.options ?? [];
1334
- for (let e = 0, i = o.length; e < i; e++) if (o[e].value === l.value[n]) {
1335
- r.label = o[e].label, r.selected = o[e], t = o[e].children, a = !0, n++;
1336
- break;
1337
- }
1338
- a || (t = void 0), e.push(r), d.value = r.name;
1339
- }
1340
- return e;
1341
- });
1342
- i.data && (d.value = i.data.name ?? "");
1343
- function v(e) {
1344
- a("update:modelValue", e);
1345
- }
1346
- function y() {
1347
- s.value?.reflowTabBar(), a("show"), setTimeout(() => {
1348
- u.value = l.value.slice(), f.value = d.value;
1349
- }, 100);
1350
- }
1351
- function b() {
1352
- a("update:modelValue", !1), setTimeout(() => {
1353
- l.value = u.value.slice(), d.value = f.value, p.value = Date.now();
1354
- }, 100);
1355
- }
1356
- function x(e, t) {
1357
- l.value.splice(t, l.value.length - t, e), Promise.resolve().then(() => {
1358
- let n = h.value[t + 1];
1359
- a("select", {
1360
- index: t,
1361
- value: e,
1362
- option: h.value[t]
1363
- }), n ? (d.value = n.name, c.value?.scrollTo(0, 0)) : e !== "" && setTimeout(() => {
1364
- a("change", {
1365
- values: S(),
1366
- options: C()
1367
- }), a("update:modelValue", !1);
1368
- }, 300);
1369
- });
1370
- }
1371
- function S() {
1372
- return l.value.slice();
1373
- }
1374
- function C() {
1375
- return h.value.filter((e) => e.value).map((e) => e.selected);
1376
- }
1377
- return n({
1378
- getSelectedValues: S,
1379
- getSelectedOptions: C
1380
- }), (n, r) => (H(), M("div", Ut, [I(g, {
1381
- "model-value": t.modelValue,
1382
- position: "bottom",
1383
- "mask-closable": t.maskClosable,
1384
- "onUpdate:modelValue": v,
1385
- onShow: y,
1386
- onHide: r[0] ||= (e) => n.$emit("hide"),
1387
- onMaskClick: b
1388
- }, {
1389
- default: X(() => [I(_, {
1390
- title: t.title,
1391
- describe: t.describe,
1392
- "large-radius": t.largeRadius,
1393
- "only-close": "",
1394
- onCancel: b
1395
- }, {
1396
- cancel: X(() => [I(e, {
1397
- name: "close",
1398
- size: "lg"
1399
- })]),
1400
- _: 1
1401
- }, 8, [
1402
- "title",
1403
- "describe",
1404
- "large-radius"
1405
- ]), N("div", Wt, [(H(), A(mt, {
1406
- ref_key: "tabs",
1407
- ref: s,
1408
- "model-value": d.value,
1409
- key: p.value,
1410
- "ink-length": 100
1411
- }, {
1412
- default: X(() => [I(be, {
1413
- ref_key: "scrollView",
1414
- ref: c,
1415
- "scrolling-x": !1,
1416
- "auto-reflow": ""
1417
- }, {
1418
- default: X(() => [(H(!0), M(O, null, W(h.value, (e, t) => (H(), A(gt, {
1419
- key: e.name,
1420
- name: e.name,
1421
- label: e.label
1422
- }, {
1423
- default: X(() => [I(me, {
1424
- "model-value": e.value,
1425
- options: e.options,
1426
- "is-slot-scope": m.value,
1427
- icon: "",
1428
- "icon-inverse": "",
1429
- "icon-position": "right",
1430
- "onUpdate:modelValue": (e) => x(e, t)
1431
- }, P({ _: 2 }, [m.value ? {
1432
- name: "default",
1433
- fn: X(({ option: e }) => [G(n.$slots, "default", { option: e })]),
1434
- key: "0"
1435
- } : void 0]), 1032, [
1436
- "model-value",
1437
- "options",
1438
- "is-slot-scope",
1439
- "onUpdate:modelValue"
1440
- ])]),
1441
- _: 2
1442
- }, 1032, ["name", "label"]))), 128))]),
1443
- _: 3
1444
- }, 512)]),
1445
- _: 3
1446
- }, 8, ["model-value"]))])]),
1447
- _: 3
1448
- }, 8, ["model-value", "mask-closable"])]));
1449
- }
1450
- }), Kt = { class: "cu-bill-header" }, qt = ["textContent"], Jt = {
1451
- key: 1,
1452
- class: "cu-bill-no"
1453
- }, Yt = { class: "cu-bill-content" }, Xt = { class: "cu-bill-detail" }, Zt = {
1454
- key: 0,
1455
- class: "cu-bill-footer"
1456
- }, Qt = /* @__PURE__ */ L({
1457
- name: "cu-bill",
1458
- __name: "Bill",
1459
- props: {
1460
- title: { default: "" },
1461
- no: { default: "" },
1462
- waterMark: { default: "" }
1463
- },
1464
- setup(e) {
1465
- let t = q();
1466
- function n(e) {
1467
- let n = t[e];
1468
- return n ? n(...e === "watermark" ? [{ coord: {
1469
- row: 1,
1470
- col: 1
1471
- } }] : []).some((e) => {
1472
- if (!e || typeof e != "object") return !1;
1473
- let t = e;
1474
- if (t.type === Te) return !1;
1475
- if (t.type === O) {
1476
- let e = t.children;
1477
- return Array.isArray(e) && e.length > 0;
1478
- }
1479
- return !0;
1480
- }) : !1;
1481
- }
1482
- let r = k(() => n("header")), i = k(() => n("footer")), a = k(() => n("watermark"));
1483
- return (t, n) => (H(), A(St, {
1484
- class: "cu-bill",
1485
- content: e.waterMark
1486
- }, P({
1487
- default: X(() => [
1488
- N("header", Kt, [r.value ? G(t.$slots, "header", {}, void 0, void 0, 1) : (H(), M(O, { key: 0 }, [e.title ? (H(), M("h4", {
1489
- key: 0,
1490
- class: "cu-bill-title",
1491
- textContent: K(e.title)
1492
- }, null, 8, qt)) : j("", !0), e.no ? (H(), M("div", Jt, "NO." + K(e.no), 1)) : j("", !0)], 64))]),
1493
- n[0] ||= N("div", { class: "cu-bill-neck" }, [N("span")], -1),
1494
- N("div", Yt, [N("div", Xt, [G(t.$slots, "default")]), i.value ? (H(), M("footer", Zt, [G(t.$slots, "footer")])) : j("", !0)])
1495
- ]),
1496
- _: 2
1497
- }, [a.value ? {
1498
- name: "watermark",
1499
- fn: X(({ coord: e }) => [G(t.$slots, "watermark", { coord: e })]),
1500
- key: "0"
1501
- } : void 0]), 1032, ["content"]));
1502
- }
1503
- }), $t = { class: "viewer-container" }, en = { class: "item" }, tn = ["src", "alt"], nn = {
1504
- key: 1,
1505
- class: "viewer-index"
1506
- }, rn = /* @__PURE__ */ L({
1507
- name: "cu-image-viewer",
1508
- __name: "ImageViewer",
1509
- props: {
1510
- modelValue: {
1511
- type: Boolean,
1512
- default: !1
1513
- },
1514
- list: { default: () => [] },
1515
- initialIndex: { default: 0 },
1516
- hasDots: {
1517
- type: Boolean,
1518
- default: !0
1519
- }
1520
- },
1521
- emits: ["update:modelValue", "change"],
1522
- setup(e, { emit: t }) {
1523
- let n = e, r = t, i = U(!1), a = U([]), o = U(0);
1524
- i.value = n.modelValue, i.value && (o.value = n.initialIndex, s()), Y(() => n.modelValue, (e) => {
1525
- o.value = n.initialIndex, i.value = e, R(() => {
1526
- s();
1527
- });
1528
- }), Y(i, (e) => {
1529
- r("update:modelValue", e);
1530
- });
1531
- function s() {
1532
- a.value = n.list.map((e) => typeof e == "object" ? e : { url: e });
1533
- }
1534
- function c(e, t) {
1535
- o.value = t, r("change", e, t);
1536
- }
1537
- function l() {
1538
- i.value = !1;
1539
- }
1540
- return (t, n) => Z((H(), M("div", {
1541
- class: "cu-image-viewer",
1542
- onClick: l
1543
- }, [N("div", $t, [i.value ? (H(), A(Se, {
1544
- key: 0,
1545
- ref: "swiper",
1546
- autoplay: 0,
1547
- "default-index": o.value,
1548
- "has-dots": !1,
1549
- "is-prevent": !1,
1550
- onAfterChange: c
1551
- }, {
1552
- default: X(() => [(H(!0), M(O, null, W(a.value, (e, t) => (H(), A(Ce, {
1553
- key: t,
1554
- class: "viewer-item-wrap"
1555
- }, {
1556
- default: X(() => [N("div", en, [e.url ? (H(), M("img", {
1557
- key: 0,
1558
- src: e.url,
1559
- alt: e.alt
1560
- }, null, 8, tn)) : j("", !0)])]),
1561
- _: 2
1562
- }, 1024))), 128))]),
1563
- _: 1
1564
- }, 8, ["default-index"])) : j("", !0), e.hasDots ? (H(), M("div", nn, K(o.value + 1) + "/" + K(e.list.length), 1)) : j("", !0)])], 512)), [[J, i.value]]);
1565
- }
1566
- }), an = { class: "cu-captcha" }, on = { class: "cu-captcha-content" }, sn = ["textContent"], cn = { class: "cu-captcha-message" }, ln = { class: "cu-captcha-footer" }, un = ["textContent"], dn = ["textContent"], fn = ["textContent", "disabled"], pn = { class: "cu-captcha-half-container" }, mn = { class: "cu-captcha-half-content" }, hn = ["textContent"], gn = ["textContent"], _n = ["textContent", "disabled"], vn = { class: "cu-captcha-content" }, yn = ["textContent"], bn = { class: "cu-captcha-message" }, xn = { class: "cu-captcha-footer" }, Sn = ["textContent"], Cn = ["textContent"], wn = ["textContent", "disabled"], Tn = /* @__PURE__ */ L({
1567
- name: "cu-captcha",
1568
- __name: "Captcha",
1569
- props: {
1570
- modelValue: {
1571
- type: Boolean,
1572
- default: !1
1573
- },
1574
- title: { default: void 0 },
1575
- subtitle: { default: void 0 },
1576
- brief: { default: "" },
1577
- maxlength: { default: 4 },
1578
- mask: {
1579
- type: Boolean,
1580
- default: !1
1581
- },
1582
- system: {
1583
- type: Boolean,
1584
- default: !1
1585
- },
1586
- autoSend: {
1587
- type: Boolean,
1588
- default: !0
1589
- },
1590
- autoCountdown: {
1591
- type: Boolean,
1592
- default: !0
1593
- },
1594
- count: { default: 60 },
1595
- countNormalText: { default: () => Q("md.captcha.sendCaptcha") },
1596
- countActiveText: { default: () => Q("md.captcha.countdown") },
1597
- isView: {
1598
- type: Boolean,
1599
- default: !1
1600
- },
1601
- type: { default: "dialog" },
1602
- inputType: { default: "tel" },
1603
- disableSend: {
1604
- type: Boolean,
1605
- default: !1
1606
- }
1607
- },
1608
- emits: [
1609
- "update:modelValue",
1610
- "show",
1611
- "hide",
1612
- "submit",
1613
- "send"
1614
- ],
1615
- setup(e, { expose: t, emit: n }) {
1616
- let r = e, i = n, a = U(null), o = U(""), s = U(!1), c = U(""), l = U(!1), u = U(!1), d = U(r.countNormalText), f = U(!1), p = U(0), m = k(() => r.isView || r.type === "inline"), h = k(() => c.value !== "" && !r.disableSend);
1617
- Y(() => r.modelValue, (e) => {
1618
- e && (o.value = "", u.value || (u.value = !0, E()));
1619
- }), Y(o, (e) => {
1620
- e && c.value && (c.value = "");
1621
- }), V(() => {
1622
- v() && r.type === "halfScreen" && (p.value = document.documentElement.clientHeight || document.body.clientHeight, window.addEventListener("resize", y, !1)), (r.modelValue || m.value) && (u.value = !0, E());
1623
- }), je(() => {
1624
- v() && r.type === "halfScreen" && window.removeEventListener("resize", y);
1625
- });
1626
- function v() {
1627
- let e = window.navigator.userAgent.toLocaleLowerCase();
1628
- return /android/.test(e);
1629
- }
1630
- function y() {
1631
- let e = document.documentElement.clientHeight || document.body.clientHeight;
1632
- p.value < e ? f.value = !1 : f.value = !0, p.value = e;
1633
- }
1634
- function x(e) {
1635
- i("update:modelValue", e);
1636
- }
1637
- function S() {
1638
- s.value = !0, a.value?.focus(), i("show");
1639
- }
1640
- function C() {
1641
- s.value = !1, a.value?.blur(), i("hide");
1642
- }
1643
- function w(e) {
1644
- i("submit", e);
1645
- }
1646
- function T() {
1647
- r.autoCountdown && ee(), i("send", ee);
1648
- }
1649
- function E() {
1650
- r.autoSend && T();
1651
- }
1652
- let D = null;
1653
- function ee() {
1654
- if (!r.count) return;
1655
- D && clearInterval(D);
1656
- let e = Date.now(), t = r.count;
1657
- l.value = !0, d.value = r.countActiveText.replace("{$1}", String(t)), D = setInterval(() => {
1658
- t <= 1 ? te() : (t = r.count - Math.floor((Date.now() - e) / 1e3), d.value = r.countActiveText.replace("{$1}", String(t)));
1659
- }, 1e3);
1660
- }
1661
- function te() {
1662
- l.value = !1, d.value = r.countNormalText, D && clearInterval(D);
1663
- }
1664
- function ne(e) {
1665
- Promise.resolve().then(() => {
1666
- c.value = e;
1667
- });
1668
- }
1669
- function re() {
1670
- i("update:modelValue", !1);
1671
- }
1672
- return t({
1673
- countdown: ee,
1674
- resetcount: te,
1675
- setError: ne,
1676
- close: re,
1677
- listenResize: y
1678
- }), (t, n) => Z((H(), M("div", an, [
1679
- m.value ? (H(), M(O, { key: 0 }, [N("div", on, [e.title ? (H(), M("h2", {
1680
- key: 0,
1681
- class: "cu-captcha-title",
1682
- textContent: K(e.title)
1683
- }, null, 8, sn)) : j("", !0), N("div", cn, [G(t.$slots, "default")])]), I(he, {
1684
- ref_key: "codebox",
1685
- ref: a,
1686
- modelValue: o.value,
1687
- "onUpdate:modelValue": n[0] ||= (e) => o.value = e,
1688
- maxlength: e.maxlength,
1689
- system: e.system,
1690
- mask: e.mask,
1691
- closable: !1,
1692
- "is-view": !0,
1693
- justify: !0,
1694
- autofocus: !1,
1695
- "input-type": e.inputType,
1696
- onSubmit: w
1697
- }, {
1698
- default: X(() => [N("footer", ln, [c.value ? (H(), M("div", {
1699
- key: 0,
1700
- class: "cu-captcha-error",
1701
- textContent: K(c.value)
1702
- }, null, 8, un)) : (H(), M("div", {
1703
- key: 1,
1704
- class: "cu-captcha-brief",
1705
- textContent: K(e.brief)
1706
- }, null, 8, dn)), e.count ? (H(), M("button", {
1707
- key: 2,
1708
- class: "cu-captcha-btn",
1709
- textContent: K(d.value),
1710
- disabled: l.value,
1711
- onClick: T
1712
- }, null, 8, fn)) : j("", !0)])]),
1713
- _: 1
1714
- }, 8, [
1715
- "modelValue",
1716
- "maxlength",
1717
- "system",
1718
- "mask",
1719
- "input-type"
1720
- ])], 64)) : j("", !0),
1721
- e.type === "halfScreen" ? (H(), A(g, {
1722
- key: 1,
1723
- "model-value": e.modelValue,
1724
- "has-mask": !0,
1725
- position: "bottom",
1726
- "mask-closable": !1,
1727
- "onUpdate:modelValue": x,
1728
- onShow: S,
1729
- onHide: C
1730
- }, {
1731
- default: X(() => [N("div", pn, [
1732
- I(_, {
1733
- "only-close": "",
1734
- "large-radius": "",
1735
- title: e.title,
1736
- describe: e.subtitle,
1737
- "title-align": "left",
1738
- onCancel: re
1739
- }, null, 8, ["title", "describe"]),
1740
- N("div", mn, [G(t.$slots, "default")]),
1741
- I(he, {
1742
- ref_key: "codebox",
1743
- ref: a,
1744
- modelValue: o.value,
1745
- "onUpdate:modelValue": n[1] ||= (e) => o.value = e,
1746
- maxlength: e.maxlength,
1747
- system: e.system,
1748
- mask: e.mask,
1749
- disabled: e.disableSend,
1750
- closable: !1,
1751
- "is-view": !0,
1752
- justify: !0,
1753
- autofocus: !1,
1754
- "input-type": e.inputType,
1755
- "is-error-style": h.value,
1756
- onSubmit: w
1757
- }, {
1758
- default: X(() => [N("footer", { class: z(["cu-captcha-footer", { halfStyle: f.value }]) }, [c.value ? (H(), M("div", {
1759
- key: 0,
1760
- class: "cu-captcha-error",
1761
- textContent: K(c.value)
1762
- }, null, 8, hn)) : (H(), M("div", {
1763
- key: 1,
1764
- class: "cu-captcha-brief",
1765
- textContent: K(e.brief)
1766
- }, null, 8, gn)), e.count ? (H(), M("button", {
1767
- key: 2,
1768
- class: z(["cu-captcha-btn", [e.disableSend && "is-disabled-send"]]),
1769
- textContent: K(d.value),
1770
- disabled: l.value,
1771
- onClick: T
1772
- }, null, 10, _n)) : j("", !0)], 2)]),
1773
- _: 1
1774
- }, 8, [
1775
- "modelValue",
1776
- "maxlength",
1777
- "system",
1778
- "mask",
1779
- "disabled",
1780
- "input-type",
1781
- "is-error-style"
1782
- ])
1783
- ])]),
1784
- _: 3
1785
- }, 8, ["model-value"])) : j("", !0),
1786
- e.type === "dialog" ? (H(), A(b, {
1787
- key: 2,
1788
- "model-value": e.modelValue,
1789
- closable: !0,
1790
- "append-to": !1,
1791
- position: "center",
1792
- "onUpdate:modelValue": x,
1793
- onShow: S,
1794
- onHide: C
1795
- }, {
1796
- default: X(() => [N("div", vn, [e.title ? (H(), M("h2", {
1797
- key: 0,
1798
- class: "cu-captcha-title",
1799
- textContent: K(e.title)
1800
- }, null, 8, yn)) : j("", !0), N("div", bn, [G(t.$slots, "default")])]), I(he, {
1801
- ref_key: "codebox",
1802
- ref: a,
1803
- modelValue: o.value,
1804
- "onUpdate:modelValue": n[2] ||= (e) => o.value = e,
1805
- maxlength: e.maxlength,
1806
- system: e.system,
1807
- closable: !1,
1808
- mask: e.mask,
1809
- justify: !0,
1810
- autofocus: !1,
1811
- "input-type": e.inputType,
1812
- onSubmit: w
1813
- }, {
1814
- default: X(() => [N("footer", xn, [c.value ? (H(), M("div", {
1815
- key: 0,
1816
- class: "cu-captcha-error",
1817
- textContent: K(c.value)
1818
- }, null, 8, Sn)) : (H(), M("div", {
1819
- key: 1,
1820
- class: "cu-captcha-brief",
1821
- textContent: K(e.brief)
1822
- }, null, 8, Cn)), e.count ? (H(), M("button", {
1823
- key: 2,
1824
- class: "cu-captcha-btn",
1825
- textContent: K(d.value),
1826
- disabled: l.value,
1827
- onClick: T
1828
- }, null, 8, wn)) : j("", !0)])]),
1829
- _: 1
1830
- }, 8, [
1831
- "modelValue",
1832
- "maxlength",
1833
- "system",
1834
- "mask",
1835
- "input-type"
1836
- ])]),
1837
- _: 3
1838
- }, 8, ["model-value"])) : j("", !0)
1839
- ], 512)), [[J, m.value || e.modelValue || s.value]]);
1840
- }
1841
- }), En = ["viewBox"], Dn = ["id"], On = ["transform"], kn = { class: "cu-chart-axis-y" }, An = ["transform"], jn = ["x2"], Mn = ["textContent"], Nn = ["transform"], Pn = ["transform"], Fn = ["textContent"], In = { class: "cu-chart-paths" }, Ln = ["d"], Rn = ["d"], zn = /* @__PURE__ */ L({
1842
- name: "cu-chart",
1843
- __name: "Chart",
1844
- props: {
1845
- labels: { default: () => [] },
1846
- datasets: { default: () => [] },
1847
- size: { default: () => [480, 320] },
1848
- max: { default: void 0 },
1849
- min: { default: void 0 },
1850
- lines: { default: 5 },
1851
- step: { default: void 0 },
1852
- shift: { default: .6 },
1853
- format: {
1854
- type: Function,
1855
- default: (e) => e
1856
- }
1857
- },
1858
- setup(e) {
1859
- let t = e, n = U(16), r = k(() => {
1860
- if (t.max !== void 0) return t.max;
1861
- let e = Math.max.apply(Math, t.datasets.map((e) => Math.max.apply(Math, e.values))), n = 1;
1862
- for (; e > 10;) n *= 10, e /= 10;
1863
- return Math.ceil(e) * n;
1864
- }), i = k(() => {
1865
- if (t.min !== void 0) return t.min;
1866
- let e = Math.min.apply(Math, t.datasets.map((e) => Math.min.apply(Math, e.values))), n = 1;
1867
- for (; e > 10;) n *= 10, e /= 10;
1868
- return Math.floor(e) * n;
1869
- }), a = k(() => t.step === void 0 ? (r.value - i.value) / t.lines : t.step), o = k(() => ({
1870
- top: .2 * n.value,
1871
- bottom: .5 * n.value,
1872
- left: t.shift * n.value,
1873
- right: .2 * n.value
1874
- })), s = k(() => typeof t.size[0] == "string" && t.size[0].indexOf("rem") !== -1 ? parseFloat(t.size[0]) * n.value : parseFloat(String(t.size[0]))), c = k(() => typeof t.size[1] == "string" && t.size[1].indexOf("rem") !== -1 ? parseFloat(t.size[1]) * n.value : parseFloat(String(t.size[1]))), l = k(() => s.value - o.value.left - o.value.right), u = k(() => c.value - o.value.top - o.value.bottom), d = k(() => {
1875
- let e = l.value / (t.labels.length - 1);
1876
- return t.labels.map((t, n) => ({
1877
- offset: n * e,
1878
- label: t
1879
- }));
1880
- }), f = k(() => {
1881
- let e = [], n = u.value / t.lines;
1882
- for (let i = 0; i < t.lines; i++) e.push({
1883
- offset: i * n,
1884
- label: t.format(r.value - i * a.value)
1885
- });
1886
- return e.push({
1887
- offset: u.value,
1888
- label: t.format(i.value)
1889
- }), e;
1890
- }), p = k(() => r.value - (t.lines - 1) * a.value), m = k(() => t.datasets.map((e) => {
1891
- let n = l.value / (e.values.length - 1), a = u.value / t.lines, o = e.values.map((e, t) => e < p.value ? {
1892
- x: t * n,
1893
- y: u.value - (1 - (p.value - e) / (p.value - i.value)) * a
1894
- } : {
1895
- x: t * n,
1896
- y: (1 - (e - p.value) / (r.value - p.value)) * (u.value - a)
1897
- }), s = {
1898
- style: {
1899
- fill: "none",
1900
- stroke: e.color || "#fa8919",
1901
- strokeWidth: e.width || 1
1902
- },
1903
- area: void 0,
1904
- value: ""
1905
- };
1906
- e.theme === "heat" ? s.style.stroke = `url(#path-fill-gradient-${e.color})` : e.theme === "region" && (s.area = {
1907
- value: `M0,${u.value} ` + o.map((e) => `L${e.x},${e.y}`).join(" ") + ` L${o[o.length - 1].x},${u.value}`,
1908
- style: {
1909
- fill: `url(#path-fill-gradient-${e.color})`,
1910
- stroke: "none"
1911
- }
1912
- });
1913
- let c = o.slice(1);
1914
- return s.value = `M0,${o.shift().y} ` + c.map((e) => `L${e.x},${e.y}`).join(" "), s;
1915
- })), h = k(() => {
1916
- let e = [];
1917
- return t.datasets.forEach((t) => {
1918
- t.color && e.indexOf(t.color) === -1 && e.push(t.color);
1919
- }), e;
1920
- });
1921
- function g() {
1922
- n.value = parseFloat(window.getComputedStyle(document.getElementsByTagName("html")[0]).getPropertyValue("font-size"));
1923
- }
1924
- return V(() => {
1925
- document.readyState !== "loading" && g(), document.addEventListener("DOMContentLoaded", g), window.addEventListener("resize", g);
1926
- }), je(() => {
1927
- document.removeEventListener("DOMContentLoaded", g), window.removeEventListener("resize", g);
1928
- }), (e, t) => (H(), M("svg", {
1929
- class: "cu-chart",
1930
- viewBox: `0 0 ${s.value} ${c.value}`
1931
- }, [N("defs", null, [(H(!0), M(O, null, W(h.value, (e) => (H(), M("linearGradient", {
1932
- key: e,
1933
- id: `path-fill-gradient-${e}`,
1934
- x1: "0",
1935
- x2: "0",
1936
- y1: "0",
1937
- y2: "1"
1938
- }, [
1939
- N("stop", {
1940
- style: B(`stop-color: ${e}`),
1941
- offset: "0%",
1942
- "stop-opacity": "0.4"
1943
- }, null, 4),
1944
- N("stop", {
1945
- style: B(`stop-color: ${e}`),
1946
- offset: "50%",
1947
- "stop-opacity": "0.3"
1948
- }, null, 4),
1949
- N("stop", {
1950
- style: B(`stop-color: ${e}`),
1951
- offset: "100%",
1952
- "stop-opacity": "0.1"
1953
- }, null, 4)
1954
- ], 8, Dn))), 128))]), N("g", {
1955
- class: "cu-chart-graph",
1956
- transform: `translate(${o.value.left}, ${o.value.top})`
1957
- }, [
1958
- N("g", kn, [(H(!0), M(O, null, W(f.value, (e, t) => (H(), M("g", {
1959
- key: t,
1960
- transform: `translate(0, ${e.offset})`
1961
- }, [N("line", {
1962
- x1: "0",
1963
- x2: l.value,
1964
- y1: "0",
1965
- y2: "0"
1966
- }, null, 8, jn), N("text", {
1967
- textContent: K(e.label),
1968
- x: "0",
1969
- y: "0",
1970
- dx: "-0.5em",
1971
- dy: "0.32em"
1972
- }, null, 8, Mn)], 8, An))), 128))]),
1973
- N("g", {
1974
- class: "cu-chart-axis-x",
1975
- transform: `translate(0, ${u.value})`
1976
- }, [(H(!0), M(O, null, W(d.value, (e, n) => (H(), M("g", {
1977
- key: n,
1978
- transform: `translate(${e.offset}, 0)`
1979
- }, [t[0] ||= N("line", {
1980
- x1: "0",
1981
- x2: "0",
1982
- y1: "0",
1983
- y2: "6"
1984
- }, null, -1), N("text", {
1985
- textContent: K(e.label),
1986
- x: "0",
1987
- y: "0",
1988
- dy: "2em"
1989
- }, null, 8, Fn)], 8, Pn))), 128))], 8, Nn),
1990
- N("g", In, [(H(!0), M(O, null, W(m.value, (e, t) => (H(), M(O, { key: `path-${t}` }, [N("path", {
1991
- class: "cu-chart-path",
1992
- style: B(e.style),
1993
- d: e.value
1994
- }, null, 12, Ln), e.area ? (H(), M("path", {
1995
- key: 0,
1996
- class: "cu-chart-path-area",
1997
- style: B(e.area.style),
1998
- d: e.area.value
1999
- }, null, 12, Rn)) : j("", !0)], 64))), 128))])
2000
- ], 8, On)], 8, En));
2001
- }
2002
- }), Bn = { class: "cu-image-reader" }, Vn = [
2003
- "name",
2004
- "accept",
2005
- "capture",
2006
- "multiple"
2007
- ], Hn = /* @__PURE__ */ L({
2008
- name: "cu-image-reader",
2009
- __name: "ImageReader",
2010
- props: {
2011
- name: { default: () => `image-reader-${Math.floor(Math.random() * 1e4)}` },
2012
- size: { default: 0 },
2013
- mime: { default: () => [] },
2014
- isCameraOnly: {
2015
- type: Boolean,
2016
- default: !1
2017
- },
2018
- isMultiple: {
2019
- type: Boolean,
2020
- default: !1
2021
- },
2022
- amount: { default: 0 }
2023
- },
2024
- emits: [
2025
- "select",
2026
- "complete",
2027
- "error"
2028
- ],
2029
- setup(e, { emit: t }) {
2030
- let n = {
2031
- 100: "browser does not support",
2032
- 101: "picture size is beyond the preset",
2033
- 102: "picture read failure",
2034
- 103: "the number of pictures exceeds the limit"
2035
- }, r = e, i = t, a = U(Date.now()), o = k(() => {
2036
- if (r.mime.length) {
2037
- let e = "";
2038
- return r.mime.forEach((t) => {
2039
- e += `image/${t},`;
2040
- }), e.substring(0, e.length - 1);
2041
- }
2042
- return "image/*";
2043
- });
2044
- function s(e, t) {
2045
- i(e, r.name, t);
2046
- }
2047
- function c(e) {
2048
- let t = e.target;
2049
- if (t.files && t.files.length) {
2050
- if (s("select", { files: Array.prototype.slice.call(t.files) }), r.amount && t.files.length > r.amount) {
2051
- s("error", {
2052
- code: "103",
2053
- msg: n[103]
2054
- }), f();
2055
- return;
2056
- }
2057
- l(t);
2058
- }
2059
- }
2060
- function l(e) {
2061
- let t = r.size * 1e3, n = e.files;
2062
- if (!n || !n.length) return;
2063
- let i = n.length, a = 0;
2064
- Array.prototype.slice.call(n).forEach((e) => {
2065
- u(e, t, () => {
2066
- a++, a >= i && f();
2067
- });
2068
- });
2069
- }
2070
- function u(e, t, r) {
2071
- let i = new FileReader();
2072
- i.onload = () => {
2073
- let a = String(i.result ?? "");
2074
- if (t && a.length > t) {
2075
- s("error", {
2076
- code: "101",
2077
- msg: n[101]
2078
- }), r();
2079
- return;
2080
- }
2081
- let o = new Image();
2082
- o.onload = () => {
2083
- s("complete", {
2084
- blob: d(a),
2085
- dataUrl: a,
2086
- file: e
2087
- }), o = null, r();
2088
- }, o.onerror = () => {
2089
- s("error", {
2090
- code: "102",
2091
- msg: n[102]
2092
- }), r();
2093
- }, o.src = a;
2094
- }, i.onerror = () => {
2095
- s("error", {
2096
- code: "102",
2097
- msg: n[102]
2098
- }), r();
2099
- }, i.readAsDataURL(e);
2100
- }
2101
- function d(e) {
2102
- let t = e.split(","), n = t[0].match(/:(.*?);/)?.[1] ?? "image/png", r = window.atob(t[1]), i = r.length, a = new Uint8Array(i);
2103
- for (; i--;) a[i] = r.charCodeAt(i);
2104
- return new Blob([a], { type: n });
2105
- }
2106
- function f() {
2107
- a.value = Date.now();
2108
- }
2109
- return (t, n) => (H(), M("div", Bn, [(H(), M("input", {
2110
- key: a.value,
2111
- class: "cu-image-reader-file",
2112
- type: "file",
2113
- name: e.name,
2114
- accept: o.value,
2115
- capture: e.isCameraOnly ? !0 : void 0,
2116
- multiple: e.isMultiple,
2117
- onChange: c
2118
- }, null, 40, Vn))]));
2119
- }
2120
- }), Un = { class: "cu-license-plate-input" }, Wn = ["onClick"], Gn = {
2121
- key: 0,
2122
- class: "cu-license-plate-input-item_content"
2123
- }, Kn = {
2124
- key: 1,
2125
- class: "cu-license-plate-input-item_content"
2126
- }, qn = { key: 0 }, Jn = {
2127
- key: 1,
2128
- class: "emptyValue"
2129
- }, Yn = /* @__PURE__ */ L({
2130
- name: "cu-license-plate-input",
2131
- __name: "LicensePlateInput",
2132
- props: {
2133
- keyArray: { default: () => [] },
2134
- selectedIndex: { default: 0 }
2135
- },
2136
- emits: ["key-mapping"],
2137
- setup(e) {
2138
- return (t, n) => (H(), M("div", Un, [(H(!0), M(O, null, W(e.keyArray, (n, r) => (H(), M("div", {
2139
- key: r,
2140
- class: z(["cu-license-plate-input-item", {
2141
- active: e.selectedIndex === r,
2142
- animation: e.selectedIndex === r && !n
2143
- }]),
2144
- onClick: (e) => t.$emit("key-mapping", r)
2145
- }, [r === e.keyArray.length - 1 ? (H(), M("div", Kn, [n && n !== " " ? (H(), M("div", qn, K(n), 1)) : (H(), M("div", Jn))])) : (H(), M("div", Gn, K(n), 1))], 10, Wn))), 128))]));
2146
- }
2147
- }), Xn = { class: "cu-license-plate-keyboard" }, Zn = {
2148
- key: 0,
2149
- class: "cu-shortcut-row"
2150
- }, Qn = ["onClick"], $n = {
2151
- key: 1,
2152
- class: "cu-mixed-key-board"
2153
- }, er = ["onClick"], tr = { key: 0 }, nr = ["onClick"], rr = /* @__PURE__ */ L({
2154
- name: "cu-license-plate-keyboard",
2155
- __name: "LicensePlateKeyboard",
2156
- props: { keyboard: { default: () => ({}) } },
2157
- emits: [
2158
- "enter",
2159
- "delete",
2160
- "confirm"
2161
- ],
2162
- setup(e) {
2163
- let t = e, n = k(() => t.keyboard.shortcuts || []), r = k(() => t.keyboard.keyboardType || 1), i = k(() => t.keyboard.mixedKeyboard || []);
2164
- return (e, t) => (H(), M("div", Xn, [r.value === 1 ? (H(), M("div", Zn, [(H(!0), M(O, null, W(n.value, (t, n) => (H(), M("div", {
2165
- key: n,
2166
- class: "cu-shortcut-row-item",
2167
- onClick: (n) => e.$emit("enter", t)
2168
- }, K(t), 9, Qn))), 128))])) : (H(), M("div", $n, [(H(!0), M(O, null, W(i.value, (t, n) => (H(), M("div", {
2169
- key: n,
2170
- class: z(["cu-mixed-key-board-item", { disabled: t.disabled }])
2171
- }, [t.type ? (H(), M("div", {
2172
- key: 0,
2173
- class: z(t.type),
2174
- onClick: (n) => t.type === "delete" ? e.$emit("delete") : e.$emit("confirm")
2175
- }, [t.type === "confirm" && t.text ? (H(), M("div", tr, K(t.text), 1)) : j("", !0)], 10, er)) : (H(), M("div", {
2176
- key: 1,
2177
- onClick: (n) => !t.disabled && e.$emit("enter", t.value)
2178
- }, K(t.value), 9, nr))], 2))), 128))]))]));
2179
- }
2180
- }), ir = { class: "cu-license-plate" }, ar = { key: 0 }, or = { class: "cu-license-plate-input-container division" }, sr = {
2181
- key: 0,
2182
- class: "cu-license-plate-keyboard-container division"
2183
- }, cr = { key: 1 }, lr = { class: "cu-popup-content" }, ur = { class: "cu-license-plate-input-container popUp" }, dr = { class: "cu-license-plate-keyboard-container popUp" }, fr = /* @__PURE__ */ L({
2184
- name: "cu-license-plate",
2185
- __name: "LicensePlate",
2186
- props: {
2187
- shortcuts: { default: () => /* @__PURE__ */ "京.津.渝.沪.冀.晋.辽.吉.黑.苏.浙.皖.闽.赣.鲁.豫.鄂.湘.粤.琼.川.贵.云.陕.甘.青.蒙.桂.宁.新.藏".split(".") },
2188
- modeShow: { default: "division" },
2189
- showPopUp: {
2190
- type: Boolean,
2191
- default: !1
2192
- },
2193
- title: { default: "请输入车牌号码" },
2194
- subtitle: { default: "" },
2195
- defaultValue: { default: "" },
2196
- disorderClick: {
2197
- type: Boolean,
2198
- default: !0
2199
- }
2200
- },
2201
- emits: [
2202
- "confirm",
2203
- "hide",
2204
- "sd-keyboard",
2205
- "hd-keyboard"
2206
- ],
2207
- setup(e, { emit: t }) {
2208
- let n = e, r = t, i = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").map((e) => ({
2209
- value: e,
2210
- disabled: e === "I" || e === "O"
2211
- })), a = [
2212
- 1,
2213
- 2,
2214
- 3,
2215
- 4,
2216
- 5,
2217
- 6,
2218
- 7,
2219
- 8,
2220
- 9,
2221
- 0
2222
- ].map((e) => ({
2223
- value: e,
2224
- disabled: !1
2225
- })), o = U([
2226
- "",
2227
- "",
2228
- "",
2229
- "",
2230
- "",
2231
- "",
2232
- "",
2233
- ""
2234
- ]), s = U(0), c = U(!1), l = k(() => {
2235
- let e = [], t;
2236
- if (s.value === 0) t = 1;
2237
- else {
2238
- t = 2;
2239
- let n = JSON.parse(JSON.stringify(i));
2240
- n.splice(19, 0, {
2241
- type: "delete",
2242
- disabled: !1
2243
- }), n.push({
2244
- type: "confirm",
2245
- text: "确定",
2246
- disabled: !1
2247
- });
2248
- let r = a;
2249
- s.value === 1 && (r = a.map((e) => ({
2250
- value: e.value,
2251
- disabled: !0
2252
- }))), e = r.concat(n);
2253
- }
2254
- return {
2255
- shortcuts: n.shortcuts,
2256
- mixedKeyboard: e,
2257
- keyboardType: t
2258
- };
2259
- }), u = k(() => o.value.map((e) => e || " "));
2260
- Y(() => n.defaultValue, (e) => {
2261
- if (e !== "") {
2262
- let t = e.split(""), n = JSON.parse(JSON.stringify(o.value));
2263
- n.forEach((e, r) => {
2264
- n[r] = t[r] ?? "";
2265
- }), o.value = n;
2266
- }
2267
- }, { immediate: !0 });
2268
- function d(e) {
2269
- c.value ||= !0, !(!n.disorderClick && !o.value[e + 1] && !o.value[e - 1] && e > 0) && (s.value = e);
2270
- }
2271
- function f(e) {
2272
- o.value[s.value] = String(e ?? ""), s.value === o.value.length - 1 ? m() : s.value += 1;
2273
- }
2274
- function p() {
2275
- o.value[s.value] = "", s.value <= 0 ? n.modeShow === "division" && (c.value = !1) : --s.value;
2276
- }
2277
- function m() {
2278
- n.modeShow === "division" && (c.value = !1), r("confirm", u.value.join(""));
2279
- }
2280
- return (t, n) => (H(), M("div", ir, [e.modeShow === "division" ? (H(), M("div", ar, [N("div", or, [I(Yn, {
2281
- "key-array": o.value,
2282
- "selected-index": s.value,
2283
- onKeyMapping: d
2284
- }, null, 8, ["key-array", "selected-index"])]), c.value ? (H(), M("div", sr, [I(rr, {
2285
- keyboard: l.value,
2286
- onEnter: f,
2287
- onDelete: p,
2288
- onConfirm: m
2289
- }, null, 8, ["keyboard"])])) : j("", !0)])) : j("", !0), e.modeShow === "popUp" ? (H(), M("div", cr, [I(g, {
2290
- "model-value": e.showPopUp,
2291
- "has-mask": !0,
2292
- position: "bottom",
2293
- "mask-closable": !1
2294
- }, {
2295
- default: X(() => [I(_, {
2296
- "only-close": "",
2297
- "large-radius": "",
2298
- title: e.title,
2299
- describe: e.subtitle,
2300
- "title-align": "left",
2301
- onCancel: n[0] ||= (e) => t.$emit("hide")
2302
- }, null, 8, ["title", "describe"]), N("div", lr, [N("div", ur, [I(Yn, {
2303
- "key-array": o.value,
2304
- "selected-index": s.value,
2305
- onKeyMapping: d
2306
- }, null, 8, ["key-array", "selected-index"])]), N("div", dr, [I(rr, {
2307
- keyboard: l.value,
2308
- onEnter: f,
2309
- onDelete: p,
2310
- onConfirm: m
2311
- }, null, 8, ["keyboard"])])])]),
2312
- _: 1
2313
- }, 8, ["model-value"])])) : j("", !0)]));
2314
- }
2315
- }), pr = { class: "cu-cashier-channel-item" }, mr = {
2316
- key: 1,
2317
- class: "item-image"
2318
- }, hr = ["src"], gr = { class: "item-label" }, _r = { class: "title" }, vr = ["innerHTML"], yr = ["innerHTML"], br = ["innerHTML"], xr = { class: "item-check-icon" }, Sr = /* @__PURE__ */ L({
2319
- name: "cu-cashier-channel-item",
2320
- __name: "CashierChannelItem",
2321
- props: {
2322
- data: { default: () => ({}) },
2323
- active: {
2324
- type: Boolean,
2325
- default: !1
2326
- }
2327
- },
2328
- setup(t) {
2329
- return (n, r) => (H(), M("div", pr, [
2330
- t.data.icon ? (H(), M("div", {
2331
- key: 0,
2332
- class: z(["item-icon", t.data.icon])
2333
- }, [I(e, {
2334
- name: t.data.icon,
2335
- size: "lg"
2336
- }, null, 8, ["name"])], 2)) : t.data.img ? (H(), M("div", mr, [N("img", { src: t.data.img }, null, 8, hr)])) : j("", !0),
2337
- N("div", gr, [N("p", _r, [N("span", { innerHTML: t.data.text || t.data }, null, 8, vr), t.data.action ? (H(), M("span", {
2338
- key: 0,
2339
- class: "title-active",
2340
- innerHTML: t.data.action.text,
2341
- onClick: r[0] ||= Le((...e) => t.data.action.handler && t.data.action.handler(...e), ["stop"])
2342
- }, null, 8, yr)) : j("", !0)]), t.data.desc ? (H(), M("p", {
2343
- key: 0,
2344
- class: "desc",
2345
- innerHTML: t.data.desc
2346
- }, null, 8, br)) : j("", !0)]),
2347
- N("div", xr, [t.data.disabled ? (H(), A(e, {
2348
- key: 0,
2349
- name: "check-disabled"
2350
- })) : t.active ? (H(), A(e, {
2351
- key: 1,
2352
- name: "checked"
2353
- })) : (H(), A(e, {
2354
- key: 2,
2355
- name: "check"
2356
- }))])
2357
- ]));
2358
- }
2359
- }), Cr = { class: "cu-cashier-channel" }, wr = { class: "choose-text" }, Tr = ["innerHTML"], Er = ["innerHTML"], Dr = ["innerHTML"], Or = {
2360
- key: 0,
2361
- class: "choose-channel-list"
2362
- }, kr = {
2363
- key: 1,
2364
- class: "choose-channel-list"
2365
- }, Ar = ["innerHTML"], jr = { class: "cu-cashier-block-btn" }, Mr = /* @__PURE__ */ L({
2366
- name: "cu-cashier-channel",
2367
- __name: "CashierChannel",
2368
- props: {
2369
- paymentTitle: { default: "" },
2370
- paymentAmount: { default: "" },
2371
- paymentDescribe: { default: "" },
2372
- moreButtonText: { default: "" },
2373
- payButtonText: { default: "" },
2374
- payButtonDisabled: {
2375
- type: Boolean,
2376
- default: !1
2377
- },
2378
- channels: { default: () => [] },
2379
- channelLimit: { default: 2 },
2380
- defaultIndex: { default: 0 }
2381
- },
2382
- emits: ["select", "pay"],
2383
- setup(e, { emit: t }) {
2384
- let n = e, r = t, i = U(!1), a = U(!1), s = U(n.defaultIndex), c = k(() => n.channelLimit < 1 || !(n.channels.length > n.channelLimit));
2385
- function l(e, t) {
2386
- e.disabled || (s.value = t, r("select", e));
2387
- }
2388
- function u() {
2389
- a.value || (i.value = !0, Promise.resolve().then(() => {
2390
- a.value = !0;
2391
- }));
2392
- }
2393
- function d() {
2394
- let e = n.channels[s.value];
2395
- r("pay", e);
2396
- }
2397
- return (t, n) => (H(), M("div", Cr, [
2398
- N("div", wr, [
2399
- e.paymentTitle ? (H(), M("p", {
2400
- key: 0,
2401
- class: "choose-title",
2402
- innerHTML: e.paymentTitle
2403
- }, null, 8, Tr)) : j("", !0),
2404
- e.paymentAmount ? (H(), M("p", {
2405
- key: 1,
2406
- class: "choose-number",
2407
- innerHTML: e.paymentAmount
2408
- }, null, 8, Er)) : j("", !0),
2409
- e.paymentDescribe ? (H(), M("p", {
2410
- key: 2,
2411
- class: "choose-describe",
2412
- innerHTML: e.paymentDescribe
2413
- }, null, 8, Dr)) : j("", !0)
2414
- ]),
2415
- N("div", { class: z(["choose-channel", { active: a.value }]) }, [
2416
- G(t.$slots, "default"),
2417
- i.value || c.value ? (H(), M("div", Or, [(H(!0), M(O, null, W(e.channels, (t, n) => (H(), A(Sr, {
2418
- key: n,
2419
- class: z({ default: n === e.defaultIndex }),
2420
- data: t,
2421
- active: n === s.value,
2422
- onClick: (e) => l(t, n)
2423
- }, null, 8, [
2424
- "class",
2425
- "data",
2426
- "active",
2427
- "onClick"
2428
- ]))), 128))])) : e.channels[e.defaultIndex] ? (H(), M("div", kr, [I(Sr, {
2429
- class: "default",
2430
- data: e.channels[e.defaultIndex],
2431
- active: "",
2432
- onClick: n[0] ||= (t) => l(e.channels[e.defaultIndex], e.defaultIndex)
2433
- }, null, 8, ["data"])])) : j("", !0),
2434
- c.value ? j("", !0) : (H(), M("div", {
2435
- key: 2,
2436
- class: z(["choose-channel-more", { disabled: a.value }]),
2437
- innerHTML: e.moreButtonText,
2438
- onClick: u
2439
- }, null, 10, Ar))
2440
- ], 2),
2441
- N("div", jr, [I(o, {
2442
- class: "cu-cashier-pay-button",
2443
- type: e.payButtonDisabled ? "disabled" : "primary",
2444
- onClick: d
2445
- }, {
2446
- default: X(() => [G(t.$slots, "button", {}, () => [F(K(e.payButtonText), 1)])]),
2447
- _: 3
2448
- }, 8, ["type"])])
2449
- ]));
2450
- }
2451
- }), Nr = { class: "cu-cashier-block-btn" }, Pr = /* @__PURE__ */ L({
2452
- name: "cu-cashier-channel-button",
2453
- __name: "CashierChannelButton",
2454
- props: { actions: { default: () => [] } },
2455
- setup(e) {
2456
- return (t, n) => (H(), M("div", Nr, [(H(!0), M(O, null, W(e.actions, (t, n) => (H(), A(o, {
2457
- key: n,
2458
- type: n === e.actions.length - 1 ? "primary" : "default",
2459
- inline: e.actions.length > 1,
2460
- onClick: () => t.handler && t.handler()
2461
- }, {
2462
- default: X(() => [F(K(t.buttonText), 1)]),
2463
- _: 2
2464
- }, 1032, [
2465
- "type",
2466
- "inline",
2467
- "onClick"
2468
- ]))), 128))]));
2469
- }
2470
- }), Fr = { class: "cu-cashier" }, Ir = { class: "cu-cashier-container" }, Lr = ["textContent"], Rr = { class: "cu-cashier-block-icon" }, zr = { class: "cu-cashier-block-text" }, Br = { class: "cu-cashier-block-icon" }, Vr = ["textContent"], Hr = /* @__PURE__ */ L({
2471
- name: "cu-cashier",
2472
- __name: "Cashier",
2473
- props: {
2474
- modelValue: {
2475
- type: Boolean,
2476
- default: !1
2477
- },
2478
- channels: { default: () => [] },
2479
- channelLimit: { default: 2 },
2480
- defaultIndex: { default: 0 },
2481
- paymentTitle: { default: () => Q("md.cashier.payCash") },
2482
- paymentAmount: { default: "0.00" },
2483
- paymentDescribe: { default: "" },
2484
- payButtonText: { default: () => Q("md.cashier.confirmPay") },
2485
- payButtonDisabled: {
2486
- type: Boolean,
2487
- default: !1
2488
- },
2489
- moreButtonText: { default: () => Q("md.cashier.morePayWays") },
2490
- title: { default: () => Q("md.cashier.pay") },
2491
- describe: { default: "" },
2492
- largeRadius: {
2493
- type: Boolean,
2494
- default: !1
2495
- }
2496
- },
2497
- emits: [
2498
- "update:modelValue",
2499
- "select",
2500
- "pay",
2501
- "show",
2502
- "hide",
2503
- "cancel"
2504
- ],
2505
- setup(t, { expose: n, emit: r }) {
2506
- let i = t, o = r, s = U(i.modelValue), c = U("choose"), l = U(Date.now()), u = U({
2507
- loading: { text: Q("md.cashier.payResultSearch") },
2508
- success: {
2509
- text: Q("md.cashier.paySuccess"),
2510
- buttonText: Q("md.cashier.confirm"),
2511
- handler: null
2512
- },
2513
- fail: {
2514
- text: Q("md.cashier.payFail"),
2515
- buttonText: Q("md.cashier.confirm"),
2516
- handler: null
2517
- },
2518
- captcha: {
2519
- text: "",
2520
- brief: "",
2521
- maxlength: 4,
2522
- count: 60,
2523
- autoCountdown: !0,
2524
- onSend: () => {},
2525
- onSubmit: () => {}
2526
- }
2527
- });
2528
- Y(() => i.modelValue, (e) => {
2529
- s.value = e;
2530
- }), Y(s, (e) => {
2531
- o("update:modelValue", e);
2532
- });
2533
- function d() {
2534
- p(), o("hide");
2535
- }
2536
- function f() {
2537
- s.value = !1, o("cancel");
2538
- }
2539
- function p() {
2540
- c.value = "choose";
2541
- }
2542
- function m(e, t = {}) {
2543
- if (u.value[e]) {
2544
- let n = u.value[e];
2545
- Object.assign(n, t);
2546
- }
2547
- c.value = e, l.value = Date.now();
2548
- }
2549
- return n({ next: m }), (n, r) => (H(), M("div", Fr, [I(g, {
2550
- class: "inner-popup",
2551
- modelValue: s.value,
2552
- "onUpdate:modelValue": r[2] ||= (e) => s.value = e,
2553
- position: "bottom",
2554
- "mask-closable": !1,
2555
- "prevent-scroll-exclude": ".choose-channel",
2556
- "prevent-scroll": "",
2557
- onShow: r[3] ||= (e) => n.$emit("show"),
2558
- onHide: d
2559
- }, {
2560
- default: X(() => [I(_, {
2561
- title: t.title,
2562
- describe: t.describe,
2563
- "large-radius": t.largeRadius,
2564
- "only-close": "",
2565
- onCancel: f
2566
- }, null, 8, [
2567
- "title",
2568
- "describe",
2569
- "large-radius"
2570
- ]), N("div", Ir, [
2571
- G(n.$slots, "header", { scene: c.value }),
2572
- c.value === "choose" ? (H(), M("div", {
2573
- key: l.value,
2574
- class: "cu-cashier-block cu-cashier-choose"
2575
- }, [I(Mr, {
2576
- "payment-title": t.paymentTitle,
2577
- "payment-amount": t.paymentAmount,
2578
- "payment-describe": t.paymentDescribe,
2579
- "more-button-text": t.moreButtonText,
2580
- "pay-button-text": t.payButtonText,
2581
- "pay-button-disabled": t.payButtonDisabled,
2582
- channels: t.channels,
2583
- "channel-limit": t.channelLimit,
2584
- "default-index": t.defaultIndex,
2585
- onSelect: r[0] ||= (e) => n.$emit("select", e),
2586
- onPay: r[1] ||= (e) => n.$emit("pay", e)
2587
- }, {
2588
- button: X(() => [G(n.$slots, "payButton")]),
2589
- default: X(() => [G(n.$slots, "channel")]),
2590
- _: 3
2591
- }, 8, [
2592
- "payment-title",
2593
- "payment-amount",
2594
- "payment-describe",
2595
- "more-button-text",
2596
- "pay-button-text",
2597
- "pay-button-disabled",
2598
- "channels",
2599
- "channel-limit",
2600
- "default-index"
2601
- ])])) : c.value === "captcha" ? (H(), M("div", {
2602
- key: l.value,
2603
- class: "cu-cashier-block cu-cashier-captcha"
2604
- }, [I(Tn, {
2605
- maxlength: u.value.captcha.maxlength,
2606
- count: u.value.captcha.count,
2607
- "count-normal-text": u.value.captcha.countNormalText,
2608
- "count-active-text": u.value.captcha.countActiveText,
2609
- "auto-countdown": u.value.captcha.autoCountdown,
2610
- brief: u.value.captcha.brief,
2611
- "is-view": "",
2612
- onSend: u.value.captcha.onSend,
2613
- onSubmit: u.value.captcha.onSubmit
2614
- }, {
2615
- default: X(() => [N("div", { textContent: K(u.value.captcha.text) }, null, 8, Lr)]),
2616
- _: 1
2617
- }, 8, [
2618
- "maxlength",
2619
- "count",
2620
- "count-normal-text",
2621
- "count-active-text",
2622
- "auto-countdown",
2623
- "brief",
2624
- "onSend",
2625
- "onSubmit"
2626
- ])])) : c.value === "loading" || c.value === "success" ? (H(), M("div", {
2627
- key: l.value,
2628
- class: z(["cu-cashier-block", {
2629
- "cu-cashier-loading": c.value === "loading",
2630
- "cu-cashier-success": c.value === "success"
2631
- }])
2632
- }, [
2633
- N("div", Rr, [I(a, {
2634
- ref: "rolling",
2635
- "is-success": c.value === "success"
2636
- }, null, 8, ["is-success"])]),
2637
- N("div", zr, K(c.value === "success" ? u.value.success.text : u.value.loading.text), 1),
2638
- c.value === "success" ? (H(), A(Pr, {
2639
- key: 0,
2640
- actions: u.value.success.actions || [{
2641
- buttonText: u.value.success.buttonText,
2642
- handler: u.value.success.handler
2643
- }]
2644
- }, null, 8, ["actions"])) : j("", !0)
2645
- ], 2)) : c.value === "fail" ? (H(), M("div", {
2646
- key: l.value,
2647
- class: "cu-cashier-block cu-cashier-fail"
2648
- }, [
2649
- N("div", Br, [I(e, { name: "warn-color" })]),
2650
- N("div", {
2651
- class: "cu-cashier-block-text",
2652
- textContent: K(u.value.fail.text)
2653
- }, null, 8, Vr),
2654
- I(Pr, { actions: u.value.fail.actions || [{
2655
- buttonText: u.value.fail.buttonText,
2656
- handler: u.value.fail.handler
2657
- }] }, null, 8, ["actions"])
2658
- ])) : c.value === "custom" ? (H(), M("div", {
2659
- key: l.value,
2660
- class: "cu-cashier-block cu-cashier-custom"
2661
- }, [G(n.$slots, "scene")])) : j("", !0),
2662
- G(n.$slots, "footer", { scene: c.value })
2663
- ])]),
2664
- _: 3
2665
- }, 8, ["modelValue"])]));
2666
- }
2667
- }), Ur = "3.0.0-alpha.0";
2668
- //#endregion
2669
- export { C as ActionSheet, Ge as CuActionBar, S as CuActionSheet, r as CuActivityIndicator, i as CuActivityIndicatorCarousel, t as CuActivityIndicatorRolling, n as CuActivityIndicatorSpinning, m as CuAgree, c as CuAmount, Qt as CuBill, o as CuButton, Tn as CuCaptcha, Hr as CuCashier, Mr as CuCashierChannel, Pr as CuCashierChannelButton, Sr as CuCashierChannelItem, l as CuCellItem, zn as CuChart, ee as CuCheck, D as CuCheckBaseBox, ne as CuCheckBox, te as CuCheckGroup, re as CuCheckList, he as CuCodebox, ve as CuDatePicker, Je as CuDetailItem, b as CuDialog, Ht as CuDropMenu, E as CuField, se as CuFieldItem, e as CuIcon, Hn as CuImageReader, rn as CuImageViewer, pe as CuInputItem, Pt as CuLandscape, fr as CuLicensePlate, Yn as CuLicensePlateInput, rr as CuLicensePlateKeyboard, d as CuNoticeBar, le as CuNumberKey, ue as CuNumberKeyboard, ce as CuNumberKeyboardContainer, _e as CuPicker, ge as CuPickerColumn, g as CuPopup, _ as CuPopupTitleBar, f as CuProgress, ie as CuRadio, ae as CuRadioBox, oe as CuRadioGroup, me as CuRadioList, kt as CuResultPage, a as CuRollerSuccess, Mt as CuRuler, be as CuScrollView, xe as CuScrollViewMore, ye as CuScrollViewRefresh, It as CuSelector, u as CuSkeleton, we as CuSlider, h as CuStepper, ot as CuSteps, Se as CuSwiper, Ce as CuSwiperItem, p as CuSwitch, dt as CuTabBar, gt as CuTabPane, Gt as CuTabPicker, mt as CuTabs, s as CuTag, Ze as CuTextareaItem, T as CuTip, w as CuTipContent, v as CuToast, _t as CuTransition, St as CuWaterMark, x as Dialog, y as Toast, Ur as VERSION };
1
+ import { t as e } from "./Icon-BgCtu0ZV.js";
2
+ import { t } from "./Roller-BznN57fL.js";
3
+ import { n, r, t as i } from "./ActivityIndicator-Cp20c1E0.js";
4
+ import { t as a } from "./Popup-qLk-BsRS.js";
5
+ import { t as o } from "./Button-D7e-cuA1.js";
6
+ import { t as s } from "./Tag-C7ygxOwU.js";
7
+ import { t as c } from "./Amount-B2StZGGW.js";
8
+ import { t as l } from "./CellItem-BHEh4Cp-.js";
9
+ import { t as u } from "./Skeleton-DqA5IxL5.js";
10
+ import { t as d } from "./NoticeBar-G5aKL6VO.js";
11
+ import { t as f } from "./Progress-Clet0W_n.js";
12
+ import { t as p } from "./Switch-B1rsBY-M.js";
13
+ import { t as m } from "./Agree-lAcOo38C.js";
14
+ import { t as h } from "./Stepper-BnDhL8IO.js";
15
+ import { t as g } from "./PopupTitleBar-9P4RUMC1.js";
16
+ import { n as _, t as v } from "./toast-ByIFvpMs.js";
17
+ import { t as y } from "./dialog-DdNA6YSe.js";
18
+ import { t as b } from "./Dialog-Bb7Gth3j.js";
19
+ import { n as x, t as S } from "./action-sheet-Da8dHevy.js";
20
+ import { n as C, t as w } from "./Tip-DHPmevlv.js";
21
+ import { t as T } from "./Field-0hdNWFNm.js";
22
+ import { t as E } from "./CheckBoxBase-BIPGJ-TD.js";
23
+ import { n as D, r as O, t as k } from "./CheckList-ViiCo4yi.js";
24
+ import { t as A } from "./CheckBox-D5bCJUXD.js";
25
+ import { t as j } from "./Radio-DY-ZX0BP.js";
26
+ import { n as M, t as N } from "./RadioGroup-B00aqM9e.js";
27
+ import { t as P } from "./RadioList-DNGsEzgf.js";
28
+ import { t as F } from "./FieldItem-D79w330m.js";
29
+ import { t as I } from "./InputItem-yHsLFvKt.js";
30
+ import { n as L, r as R, t as z } from "./NumberKeyboard-B_TJXxki.js";
31
+ import { t as B } from "./Codebox-BLPrFnIv.js";
32
+ import { n as V, t as H } from "./Picker-CA-JQ_OC.js";
33
+ import { t as U } from "./DatePicker-CYvPJatt.js";
34
+ import { t as W } from "./ScrollView-BNY62f7B.js";
35
+ import { n as G, t as K } from "./ScrollViewMore-DBhoiI1X.js";
36
+ import { n as q, t as J } from "./SwiperItem-BydyBdYU.js";
37
+ import { t as Y } from "./Slider-BB2Nhpys.js";
38
+ import { t as X } from "./ActionBar-CF1zMUMC.js";
39
+ import { t as Z } from "./DetailItem-D6-zbZmd.js";
40
+ import { t as Q } from "./TextareaItem-Dl-PCLl-.js";
41
+ import { t as $ } from "./Steps-BPQwab3T.js";
42
+ import { n as ee, r as te, t as ne } from "./TabPane-Q7oUFzmP.js";
43
+ import { t as re } from "./Transition-B-baX512.js";
44
+ import { t as ie } from "./WaterMark-CgkuQjv3.js";
45
+ import { t as ae } from "./ResultPage-DUs8ok5R.js";
46
+ import { t as oe } from "./Ruler-Bhf5J7hU.js";
47
+ import { t as se } from "./Landscape-Dd0abEy1.js";
48
+ import { t as ce } from "./Selector-DOU8Af55.js";
49
+ import { t as le } from "./DropMenu-5TA_6bas.js";
50
+ import { t as ue } from "./TabPicker-BicPrto7.js";
51
+ import { t as de } from "./Bill-qQ4LdkmR.js";
52
+ import { t as fe } from "./ImageViewer-_dTRCIsV.js";
53
+ import { t as pe } from "./Captcha-CgpynYTc.js";
54
+ import { t as me } from "./Chart-BINJAx7V.js";
55
+ import { t as he } from "./ImageReader-hUb5CEbV.js";
56
+ import { n as ge, r as _e, t as ve } from "./LicensePlate-CTcAIbcb.js";
57
+ import { i as ye, n as be, r as xe, t as Se } from "./Cashier-CJLfQOXm.js";
58
+ import { t as Ce } from "./RollerSuccess-CTh43Rh0.js";
59
+ // src/index.ts
60
+ var we = "3.1.0";
61
+ export { S as ActionSheet, X as CuActionBar, x as CuActionSheet, i as CuActivityIndicator, n as CuActivityIndicatorCarousel, t as CuActivityIndicatorRolling, r as CuActivityIndicatorSpinning, m as CuAgree, c as CuAmount, de as CuBill, o as CuButton, pe as CuCaptcha, Se as CuCashier, xe as CuCashierChannel, be as CuCashierChannelButton, ye as CuCashierChannelItem, l as CuCellItem, me as CuChart, O as CuCheck, E as CuCheckBaseBox, A as CuCheckBox, D as CuCheckGroup, k as CuCheckList, B as CuCodebox, U as CuDatePicker, Z as CuDetailItem, b as CuDialog, le as CuDropMenu, T as CuField, F as CuFieldItem, e as CuIcon, he as CuImageReader, fe as CuImageViewer, I as CuInputItem, se as CuLandscape, ve as CuLicensePlate, _e as CuLicensePlateInput, ge as CuLicensePlateKeyboard, d as CuNoticeBar, R as CuNumberKey, z as CuNumberKeyboard, L as CuNumberKeyboardContainer, H as CuPicker, V as CuPickerColumn, a as CuPopup, g as CuPopupTitleBar, f as CuProgress, j as CuRadio, M as CuRadioBox, N as CuRadioGroup, P as CuRadioList, ae as CuResultPage, Ce as CuRollerSuccess, oe as CuRuler, W as CuScrollView, K as CuScrollViewMore, G as CuScrollViewRefresh, ce as CuSelector, u as CuSkeleton, Y as CuSlider, h as CuStepper, $ as CuSteps, q as CuSwiper, J as CuSwiperItem, p as CuSwitch, te as CuTabBar, ne as CuTabPane, ue as CuTabPicker, ee as CuTabs, s as CuTag, Q as CuTextareaItem, w as CuTip, C as CuTipContent, _ as CuToast, re as CuTransition, ie as CuWaterMark, y as Dialog, v as Toast, we as VERSION };