centui 0.0.0-stage → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (301) hide show
  1. package/LICENSE +433 -0
  2. package/README.md +54 -2
  3. package/dist/Agree-DT46e5q5.cjs +1 -0
  4. package/dist/Agree-yTGTi4e6.js +44 -0
  5. package/dist/Amount-De-oObat.cjs +1 -0
  6. package/dist/Amount-wOtRYOdx.js +62 -0
  7. package/dist/Button-BIi6CrwM.js +61 -0
  8. package/dist/Button-Blpwwbnw.cjs +1 -0
  9. package/dist/CellItem-T78DHako.cjs +1 -0
  10. package/dist/CellItem-YZD-BxKt.js +72 -0
  11. package/dist/CheckBoxBase-BDsytL_r.cjs +1 -0
  12. package/dist/CheckBoxBase-BjyVzGqj.js +40 -0
  13. package/dist/CheckList-Bfy3B-eN.js +239 -0
  14. package/dist/CheckList-DEmLmccw.cjs +1 -0
  15. package/dist/Codebox-Cgj7wyzd.cjs +1 -0
  16. package/dist/Codebox-D0UtCj11.js +189 -0
  17. package/dist/DatePicker-B1AVbKhK.cjs +1 -0
  18. package/dist/DatePicker-TAHuve5t.js +177 -0
  19. package/dist/Field-CseJzTZz.js +51 -0
  20. package/dist/Field-DDmHa4zB.cjs +1 -0
  21. package/dist/FieldItem-Cc7bw5vU.js +88 -0
  22. package/dist/FieldItem-Dkpx5Kxk.cjs +1 -0
  23. package/dist/Icon-dWGSK6Ou.js +119 -0
  24. package/dist/Icon-jaEPn7d7.cjs +31 -0
  25. package/dist/InputItem-EJ4Y3tpU.cjs +1 -0
  26. package/dist/InputItem-bhFtp97z.js +322 -0
  27. package/dist/NoticeBar-DSf_EjTL.cjs +1 -0
  28. package/dist/NoticeBar-PEYcjXwD.js +84 -0
  29. package/dist/NumberKeyboard-BX0c0l2r.cjs +1 -0
  30. package/dist/NumberKeyboard-C7TRF5iC.js +320 -0
  31. package/dist/Picker-D-TPtSxf.cjs +1 -0
  32. package/dist/Picker-Dam0LEcc.js +476 -0
  33. package/dist/Popup-Cm4BuaOo.cjs +1 -0
  34. package/dist/Popup-DPYBBL95.js +116 -0
  35. package/dist/PopupTitleBar-B4vwxKC7.cjs +1 -0
  36. package/dist/PopupTitleBar-nVurLaOe.js +85 -0
  37. package/dist/Progress-CwIC6scr.js +67 -0
  38. package/dist/Progress-DukssNvl.cjs +1 -0
  39. package/dist/Radio-ZHivLdvi.cjs +1 -0
  40. package/dist/Radio-fsc7_N5K.js +65 -0
  41. package/dist/RadioGroup-BR_jSDR4.cjs +1 -0
  42. package/dist/RadioGroup-CMPmk8X_.js +82 -0
  43. package/dist/RadioList-CkerkQEY.js +127 -0
  44. package/dist/RadioList-upQgua8Z.cjs +1 -0
  45. package/dist/Roller-DALhjhfg.cjs +1 -0
  46. package/dist/Roller-DFJ7jMV0.js +92 -0
  47. package/dist/RollerSuccess--JecJ7bz.cjs +1 -0
  48. package/dist/RollerSuccess-CVEmS9gU.js +224 -0
  49. package/dist/ScrollViewMore-BWph-i1-.cjs +1 -0
  50. package/dist/ScrollViewMore-BgYJx-TP.js +278 -0
  51. package/dist/Skeleton--SCiydNl.cjs +1 -0
  52. package/dist/Skeleton-BG_j23KI.js +55 -0
  53. package/dist/Slider-D3wrE8hn.cjs +1 -0
  54. package/dist/Slider-DteN8p-L.js +95 -0
  55. package/dist/Stepper-1EOk4pCY.js +127 -0
  56. package/dist/Stepper-BJr4I6_8.cjs +1 -0
  57. package/dist/SwiperItem-B6TgjCsM.cjs +1 -0
  58. package/dist/SwiperItem-CKd-XKT7.js +337 -0
  59. package/dist/Switch-B6DvVj2p.js +30 -0
  60. package/dist/Switch-BVPjF8CM.cjs +1 -0
  61. package/dist/Tag-CPv77lC8.cjs +1 -0
  62. package/dist/Tag-bs5j40pF.js +66 -0
  63. package/dist/Tip-BFZSiRc1.js +166 -0
  64. package/dist/Tip-C3brAF9N.cjs +1 -0
  65. package/dist/action-sheet-DKpi2GLQ.js +118 -0
  66. package/dist/action-sheet-LJilF3EQ.cjs +1 -0
  67. package/dist/action-sheet.cjs +1 -0
  68. package/dist/action-sheet.d.ts +2 -0
  69. package/dist/action-sheet.js +2 -0
  70. package/dist/activity-indicator.cjs +1 -0
  71. package/dist/activity-indicator.d.ts +1 -0
  72. package/dist/activity-indicator.js +3 -0
  73. package/dist/agree.cjs +1 -0
  74. package/dist/agree.d.ts +1 -0
  75. package/dist/agree.js +2 -0
  76. package/dist/amount.cjs +1 -0
  77. package/dist/amount.d.ts +1 -0
  78. package/dist/amount.js +2 -0
  79. package/dist/button.cjs +1 -0
  80. package/dist/button.d.ts +1 -0
  81. package/dist/button.js +2 -0
  82. package/dist/cell-item.cjs +1 -0
  83. package/dist/cell-item.d.ts +1 -0
  84. package/dist/cell-item.js +2 -0
  85. package/dist/check-base.cjs +1 -0
  86. package/dist/check-base.d.ts +1 -0
  87. package/dist/check-base.js +2 -0
  88. package/dist/check.cjs +1 -0
  89. package/dist/check.d.ts +1 -0
  90. package/dist/check.js +2 -0
  91. package/dist/codebox.cjs +1 -0
  92. package/dist/codebox.d.ts +1 -0
  93. package/dist/codebox.js +2 -0
  94. package/dist/components/action-bar/ActionBar.vue.d.ts +34 -0
  95. package/dist/components/action-bar/index.d.ts +2 -0
  96. package/dist/components/action-sheet/ActionSheet.vue.d.ts +44 -0
  97. package/dist/components/action-sheet/index.d.ts +25 -0
  98. package/dist/components/activity-indicator/ActivityIndicator.vue.d.ts +31 -0
  99. package/dist/components/activity-indicator/Carousel.vue.d.ts +10 -0
  100. package/dist/components/activity-indicator/CarouselCircle.vue.d.ts +12 -0
  101. package/dist/components/activity-indicator/Roller.vue.d.ts +37 -0
  102. package/dist/components/activity-indicator/RollerSuccess.vue.d.ts +14 -0
  103. package/dist/components/activity-indicator/Spinning.vue.d.ts +10 -0
  104. package/dist/components/activity-indicator/index.d.ts +5 -0
  105. package/dist/components/agree/Agree.vue.d.ts +35 -0
  106. package/dist/components/agree/index.d.ts +1 -0
  107. package/dist/components/amount/Amount.vue.d.ts +25 -0
  108. package/dist/components/amount/index.d.ts +1 -0
  109. package/dist/components/bill/Bill.vue.d.ts +33 -0
  110. package/dist/components/bill/index.d.ts +1 -0
  111. package/dist/components/button/Button.vue.d.ts +38 -0
  112. package/dist/components/button/index.d.ts +1 -0
  113. package/dist/components/captcha/Captcha.vue.d.ts +76 -0
  114. package/dist/components/captcha/index.d.ts +1 -0
  115. package/dist/components/cashier/Cashier.vue.d.ts +101 -0
  116. package/dist/components/cashier/CashierChannel.vue.d.ts +54 -0
  117. package/dist/components/cashier/CashierChannelButton.vue.d.ts +14 -0
  118. package/dist/components/cashier/CashierChannelItem.vue.d.ts +30 -0
  119. package/dist/components/cashier/index.d.ts +4 -0
  120. package/dist/components/cell-item/CellItem.vue.d.ts +38 -0
  121. package/dist/components/cell-item/index.d.ts +1 -0
  122. package/dist/components/chart/Chart.vue.d.ts +30 -0
  123. package/dist/components/chart/index.d.ts +2 -0
  124. package/dist/components/check/Check.vue.d.ts +38 -0
  125. package/dist/components/check/CheckBox.vue.d.ts +31 -0
  126. package/dist/components/check/CheckGroup.vue.d.ts +27 -0
  127. package/dist/components/check/CheckList.vue.d.ts +58 -0
  128. package/dist/components/check/index.d.ts +6 -0
  129. package/dist/components/check/shared.d.ts +52 -0
  130. package/dist/components/check-base/CheckBoxBase.vue.d.ts +25 -0
  131. package/dist/components/check-base/index.d.ts +1 -0
  132. package/dist/components/codebox/Codebox.vue.d.ts +58 -0
  133. package/dist/components/codebox/index.d.ts +1 -0
  134. package/dist/components/date-picker/DatePicker.vue.d.ts +70 -0
  135. package/dist/components/date-picker/index.d.ts +1 -0
  136. package/dist/components/detail-item/DetailItem.vue.d.ts +22 -0
  137. package/dist/components/detail-item/index.d.ts +1 -0
  138. package/dist/components/dialog/Dialog.vue.d.ts +78 -0
  139. package/dist/components/dialog/index.d.ts +40 -0
  140. package/dist/components/drop-menu/DropMenu.vue.d.ts +55 -0
  141. package/dist/components/drop-menu/index.d.ts +1 -0
  142. package/dist/components/field/Field.vue.d.ts +30 -0
  143. package/dist/components/field/index.d.ts +1 -0
  144. package/dist/components/field-item/FieldItem.vue.d.ts +42 -0
  145. package/dist/components/field-item/index.d.ts +1 -0
  146. package/dist/components/icon/Icon.vue.d.ts +20 -0
  147. package/dist/components/icon/default-svg-list.d.ts +2 -0
  148. package/dist/components/icon/index.d.ts +1 -0
  149. package/dist/components/icon/load-sprite.d.ts +6 -0
  150. package/dist/components/image-reader/ImageReader.vue.d.ts +46 -0
  151. package/dist/components/image-reader/index.d.ts +1 -0
  152. package/dist/components/image-viewer/ImageViewer.vue.d.ts +25 -0
  153. package/dist/components/image-viewer/index.d.ts +1 -0
  154. package/dist/components/index.d.ts +3 -0
  155. package/dist/components/input-item/InputItem.vue.d.ts +97 -0
  156. package/dist/components/input-item/cursor.d.ts +7 -0
  157. package/dist/components/input-item/index.d.ts +1 -0
  158. package/dist/components/landscape/Landscape.vue.d.ts +38 -0
  159. package/dist/components/landscape/index.d.ts +1 -0
  160. package/dist/components/license-plate/LicensePlate.vue.d.ts +32 -0
  161. package/dist/components/license-plate/LicensePlateInput.vue.d.ts +14 -0
  162. package/dist/components/license-plate/LicensePlateKeyboard.vue.d.ts +30 -0
  163. package/dist/components/license-plate/index.d.ts +3 -0
  164. package/dist/components/notice-bar/NoticeBar.vue.d.ts +44 -0
  165. package/dist/components/notice-bar/index.d.ts +1 -0
  166. package/dist/components/number-keyboard/KeyboardBoard.vue.d.ts +33 -0
  167. package/dist/components/number-keyboard/KeyboardKey.vue.d.ts +16 -0
  168. package/dist/components/number-keyboard/NumberKeyboard.vue.d.ts +59 -0
  169. package/dist/components/number-keyboard/index.d.ts +3 -0
  170. package/dist/components/picker/Picker.vue.d.ts +64 -0
  171. package/dist/components/picker/PickerColumn.vue.d.ts +64 -0
  172. package/dist/components/picker/index.d.ts +3 -0
  173. package/dist/components/popup/Popup.vue.d.ts +50 -0
  174. package/dist/components/popup/PopupTitleBar.vue.d.ts +41 -0
  175. package/dist/components/popup/index.d.ts +2 -0
  176. package/dist/components/progress/Progress.vue.d.ts +39 -0
  177. package/dist/components/progress/index.d.ts +1 -0
  178. package/dist/components/radio/Radio.vue.d.ts +39 -0
  179. package/dist/components/radio/RadioBox.vue.d.ts +31 -0
  180. package/dist/components/radio/RadioGroup.vue.d.ts +24 -0
  181. package/dist/components/radio/index.d.ts +3 -0
  182. package/dist/components/radio-list/RadioList.vue.d.ts +72 -0
  183. package/dist/components/radio-list/index.d.ts +2 -0
  184. package/dist/components/result-page/ResultPage.vue.d.ts +28 -0
  185. package/dist/components/result-page/index.d.ts +1 -0
  186. package/dist/components/ruler/Ruler.vue.d.ts +34 -0
  187. package/dist/components/ruler/index.d.ts +1 -0
  188. package/dist/components/scroll-view/ScrollView.vue.d.ts +84 -0
  189. package/dist/components/scroll-view/ScrollViewMore.vue.d.ts +12 -0
  190. package/dist/components/scroll-view/ScrollViewRefresh.vue.d.ts +20 -0
  191. package/dist/components/scroll-view/index.d.ts +3 -0
  192. package/dist/components/selector/Selector.vue.d.ts +88 -0
  193. package/dist/components/selector/index.d.ts +2 -0
  194. package/dist/components/skeleton/Skeleton.vue.d.ts +30 -0
  195. package/dist/components/skeleton/index.d.ts +1 -0
  196. package/dist/components/slider/Slider.vue.d.ts +24 -0
  197. package/dist/components/slider/index.d.ts +1 -0
  198. package/dist/components/stepper/Stepper.vue.d.ts +32 -0
  199. package/dist/components/stepper/index.d.ts +1 -0
  200. package/dist/components/steps/Steps.vue.d.ts +56 -0
  201. package/dist/components/steps/index.d.ts +2 -0
  202. package/dist/components/swiper/Swiper.vue.d.ts +57 -0
  203. package/dist/components/swiper/SwiperItem.vue.d.ts +26 -0
  204. package/dist/components/swiper/index.d.ts +2 -0
  205. package/dist/components/switch/Switch.vue.d.ts +16 -0
  206. package/dist/components/switch/index.d.ts +1 -0
  207. package/dist/components/tab-picker/TabPicker.vue.d.ts +78 -0
  208. package/dist/components/tab-picker/index.d.ts +1 -0
  209. package/dist/components/tabs/TabBar.vue.d.ts +50 -0
  210. package/dist/components/tabs/TabPane.vue.d.ts +31 -0
  211. package/dist/components/tabs/Tabs.vue.d.ts +34 -0
  212. package/dist/components/tabs/index.d.ts +3 -0
  213. package/dist/components/tag/Tag.vue.d.ts +39 -0
  214. package/dist/components/tag/index.d.ts +1 -0
  215. package/dist/components/textarea-item/TextareaItem.vue.d.ts +80 -0
  216. package/dist/components/textarea-item/index.d.ts +1 -0
  217. package/dist/components/tip/Tip.vue.d.ts +98 -0
  218. package/dist/components/tip/TipContent.vue.d.ts +33 -0
  219. package/dist/components/tip/index.d.ts +2 -0
  220. package/dist/components/toast/Toast.vue.d.ts +45 -0
  221. package/dist/components/toast/index.d.ts +129 -0
  222. package/dist/components/transition/Transition.vue.d.ts +13 -0
  223. package/dist/components/transition/index.d.ts +1 -0
  224. package/dist/components/water-mark/WaterMark.vue.d.ts +35 -0
  225. package/dist/components/water-mark/index.d.ts +1 -0
  226. package/dist/date-picker.cjs +1 -0
  227. package/dist/date-picker.d.ts +1 -0
  228. package/dist/date-picker.js +2 -0
  229. package/dist/dialog-0-E4Vyc-.cjs +1 -0
  230. package/dist/dialog-DHIZ2SMK.js +227 -0
  231. package/dist/dialog.cjs +1 -0
  232. package/dist/dialog.d.ts +2 -0
  233. package/dist/dialog.js +2 -0
  234. package/dist/field-item.cjs +1 -0
  235. package/dist/field-item.d.ts +1 -0
  236. package/dist/field-item.js +2 -0
  237. package/dist/field.cjs +1 -0
  238. package/dist/field.d.ts +1 -0
  239. package/dist/field.js +2 -0
  240. package/dist/icon.cjs +1 -0
  241. package/dist/icon.d.ts +1 -0
  242. package/dist/icon.js +2 -0
  243. package/dist/index.cjs +1 -0
  244. package/dist/index.d.ts +63 -0
  245. package/dist/index.js +2669 -0
  246. package/dist/input-item.cjs +1 -0
  247. package/dist/input-item.d.ts +1 -0
  248. package/dist/input-item.js +2 -0
  249. package/dist/notice-bar.cjs +1 -0
  250. package/dist/notice-bar.d.ts +1 -0
  251. package/dist/notice-bar.js +2 -0
  252. package/dist/number-keyboard.cjs +1 -0
  253. package/dist/number-keyboard.d.ts +1 -0
  254. package/dist/number-keyboard.js +2 -0
  255. package/dist/picker.cjs +1 -0
  256. package/dist/picker.d.ts +1 -0
  257. package/dist/picker.js +2 -0
  258. package/dist/popup.cjs +1 -0
  259. package/dist/popup.d.ts +1 -0
  260. package/dist/popup.js +3 -0
  261. package/dist/progress.cjs +1 -0
  262. package/dist/progress.d.ts +1 -0
  263. package/dist/progress.js +2 -0
  264. package/dist/radio-list.cjs +1 -0
  265. package/dist/radio-list.d.ts +1 -0
  266. package/dist/radio-list.js +2 -0
  267. package/dist/radio.cjs +1 -0
  268. package/dist/radio.d.ts +1 -0
  269. package/dist/radio.js +3 -0
  270. package/dist/scroll-view.cjs +1 -0
  271. package/dist/scroll-view.d.ts +1 -0
  272. package/dist/scroll-view.js +2 -0
  273. package/dist/shared-BtSkmaWC.js +37 -0
  274. package/dist/shared-k9cbQbvK.cjs +1 -0
  275. package/dist/skeleton.cjs +1 -0
  276. package/dist/skeleton.d.ts +1 -0
  277. package/dist/skeleton.js +2 -0
  278. package/dist/slider.cjs +1 -0
  279. package/dist/slider.d.ts +1 -0
  280. package/dist/slider.js +2 -0
  281. package/dist/stepper.cjs +1 -0
  282. package/dist/stepper.d.ts +1 -0
  283. package/dist/stepper.js +2 -0
  284. package/dist/swiper.cjs +1 -0
  285. package/dist/swiper.d.ts +1 -0
  286. package/dist/swiper.js +2 -0
  287. package/dist/switch.cjs +1 -0
  288. package/dist/switch.d.ts +1 -0
  289. package/dist/switch.js +2 -0
  290. package/dist/tag.cjs +1 -0
  291. package/dist/tag.d.ts +1 -0
  292. package/dist/tag.js +2 -0
  293. package/dist/tip.cjs +1 -0
  294. package/dist/tip.d.ts +1 -0
  295. package/dist/tip.js +2 -0
  296. package/dist/toast-CAeyMc5r.cjs +1 -0
  297. package/dist/toast-DX-RoB7Q.js +146 -0
  298. package/dist/toast.cjs +1 -0
  299. package/dist/toast.d.ts +2 -0
  300. package/dist/toast.js +2 -0
  301. package/package.json +195 -3
@@ -0,0 +1,224 @@
1
+ import { t as e } from "./Icon-dWGSK6Ou.js";
2
+ import { t } from "./Roller-DFJ7jMV0.js";
3
+ import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, normalizeStyle as d, openBlock as f, renderList as p, renderSlot as m, withCtx as h } from "vue";
4
+ //#endregion
5
+ //#region src/components/activity-indicator/Spinning.vue
6
+ var g = /* @__PURE__ */ l({
7
+ name: "cu-activity-indicator-spinning",
8
+ __name: "Spinning",
9
+ props: {
10
+ size: { default: 70 },
11
+ color: { default: "dark" }
12
+ },
13
+ setup(t) {
14
+ return (n, r) => (f(), o("div", { class: u(["cu-activity-indicator-spinning", { dark: t.color === "dark" }]) }, [c(e, {
15
+ class: "cu-activity-indicator-svg",
16
+ name: "spinner",
17
+ style: d({
18
+ width: `${t.size}px`,
19
+ height: `${t.size}px`
20
+ })
21
+ }, null, 8, ["style"])], 2));
22
+ }
23
+ }), _ = [
24
+ "cx",
25
+ "cy",
26
+ "r"
27
+ ], v = ["values"], y = ["values"], b = /* @__PURE__ */ l({
28
+ name: "cu-activity-indicator-carousel-circle",
29
+ __name: "CarouselCircle",
30
+ props: {
31
+ size: { default: 30 },
32
+ index: { default: 0 },
33
+ animateValues: { default: () => [] }
34
+ },
35
+ setup(e) {
36
+ let t = e, n = r(() => t.index * t.size * 1.5 + t.size / 2), i = r(() => t.animateValues.join(";")), a = r(() => t.animateValues.map((e) => e * t.size / 2).join(";"));
37
+ return (t, r) => (f(), o("circle", {
38
+ cx: n.value,
39
+ cy: e.size / 2,
40
+ r: e.size / 2
41
+ }, [s("animate", {
42
+ attributeName: "fill-opacity",
43
+ attributeType: "XML",
44
+ begin: "0s",
45
+ dur: "1s",
46
+ values: i.value,
47
+ calcMode: "linear",
48
+ repeatCount: "indefinite"
49
+ }, null, 8, v), s("animate", {
50
+ attributeName: "r",
51
+ attributeType: "XML",
52
+ begin: "0s",
53
+ dur: "1s",
54
+ values: a.value,
55
+ calcMode: "linear",
56
+ repeatCount: "indefinite"
57
+ }, null, 8, y)], 8, _));
58
+ }
59
+ }), x = { class: "cu-activity-indicator-carousel" }, S = ["viewBox", "fill"], C = /* @__PURE__ */ l({
60
+ name: "cu-activity-indicator-carousel",
61
+ __name: "Carousel",
62
+ props: {
63
+ size: { default: 30 },
64
+ color: { default: "#2F86F6" }
65
+ },
66
+ setup(e) {
67
+ let t = e, i = [
68
+ [
69
+ 1,
70
+ .8,
71
+ .6,
72
+ .6,
73
+ .6,
74
+ .8,
75
+ 1
76
+ ],
77
+ [
78
+ .6,
79
+ .8,
80
+ 1,
81
+ .8,
82
+ .6,
83
+ .6,
84
+ .6
85
+ ],
86
+ [
87
+ .6,
88
+ .6,
89
+ .6,
90
+ .8,
91
+ 1,
92
+ .8,
93
+ .6
94
+ ]
95
+ ], a = r(() => {
96
+ let e = i.length;
97
+ return e * t.size + (e - 1) * t.size / 2;
98
+ }), s = r(() => `0 0 ${a.value} ${t.size}`);
99
+ return (t, r) => (f(), o("div", x, [(f(), o("svg", {
100
+ xmlns: "http://www.w3.org/2000/svg",
101
+ viewBox: s.value,
102
+ fill: e.color,
103
+ style: d({
104
+ width: `${a.value}px`,
105
+ height: `${e.size}px`
106
+ }),
107
+ class: "cu-activity-indicator-svg carouseling"
108
+ }, [(f(), o(n, null, p(i, (t, n) => c(b, {
109
+ key: `carousel-circle-${n}`,
110
+ size: e.size,
111
+ index: n,
112
+ "animate-values": t
113
+ }, null, 8, [
114
+ "size",
115
+ "index",
116
+ "animate-values"
117
+ ])), 64))], 12, S))]));
118
+ }
119
+ }), w = { class: "indicator-loading" }, T = /* @__PURE__ */ l({
120
+ name: "cu-activity-indicator",
121
+ __name: "ActivityIndicator",
122
+ props: {
123
+ type: { default: "roller" },
124
+ size: { default: 70 },
125
+ width: { default: void 0 },
126
+ color: { default: void 0 },
127
+ textColor: { default: "#999" },
128
+ textSize: { default: void 0 },
129
+ vertical: {
130
+ type: Boolean,
131
+ default: !1
132
+ }
133
+ },
134
+ setup(e) {
135
+ let n = e, c = r(() => n.color ?? (n.type === "spinner" ? "dark" : "#2F86F6"));
136
+ return (n, r) => (f(), o("div", { class: u(["cu-activity-indicator", e.type]) }, [s("div", { class: u(["indicator-container", { vertical: e.vertical }]) }, [s("div", w, [e.type === "roller" ? (f(), i(t, {
137
+ key: 0,
138
+ size: e.size,
139
+ color: c.value,
140
+ width: e.width
141
+ }, null, 8, [
142
+ "size",
143
+ "color",
144
+ "width"
145
+ ])) : e.type === "spinner" ? (f(), i(g, {
146
+ key: 1,
147
+ size: e.size,
148
+ color: c.value
149
+ }, null, 8, ["size", "color"])) : e.type === "carousel" ? (f(), i(C, {
150
+ key: 2,
151
+ size: e.size,
152
+ color: c.value
153
+ }, null, 8, ["size", "color"])) : a("", !0)]), n.$slots.default ? (f(), o("div", {
154
+ key: 0,
155
+ style: d({
156
+ fontSize: `${e.textSize}px`,
157
+ color: e.textColor
158
+ }),
159
+ class: "cu-activity-indicator-text indicator-text"
160
+ }, [m(n.$slots, "default")], 4)) : a("", !0)], 2)], 2));
161
+ }
162
+ }), E = { class: "cu-activity-indicator-rolling-success" }, D = {
163
+ key: 0,
164
+ name: "circle",
165
+ slot: "circle"
166
+ }, O = /* @__PURE__ */ l({
167
+ name: "cu-activity-indicator-rolling-success",
168
+ __name: "RollerSuccess",
169
+ props: {
170
+ isSuccess: {
171
+ type: Boolean,
172
+ default: !0
173
+ },
174
+ size: { default: 70 },
175
+ color: { default: "#28AA8F" },
176
+ strokeWidth: { default: 8 }
177
+ },
178
+ setup(e) {
179
+ return (n, r) => (f(), o("div", E, [c(t, {
180
+ size: e.size,
181
+ width: e.strokeWidth,
182
+ fill: "#FFF6F1",
183
+ "border-color": "transparent"
184
+ }, {
185
+ default: h(() => [e.isSuccess ? (f(), o("g", D, [...r[0] ||= [s("circle", {
186
+ class: "success",
187
+ cx: "50",
188
+ cy: "50",
189
+ fill: "#FFF6F1",
190
+ stroke: "none",
191
+ r: "40"
192
+ }, null, -1)]])) : a("", !0), e.isSuccess ? (f(), o("svg", {
193
+ key: 1,
194
+ viewBox: "0 0 100 100",
195
+ preserveAspectRatio: "xMidYMid",
196
+ class: "right",
197
+ style: d({ transform: `translate(-50%, -50%) scale(${e.size / 70})` })
198
+ }, [s("g", null, [s("line", {
199
+ x1: "32",
200
+ y1: "47",
201
+ x2: "45",
202
+ y2: "62",
203
+ style: d({
204
+ strokeWidth: e.strokeWidth,
205
+ stroke: e.color
206
+ }),
207
+ "stroke-dasharray": "20"
208
+ }, null, 4), s("line", {
209
+ x1: "42",
210
+ y1: "62",
211
+ x2: "68.4",
212
+ y2: "40",
213
+ style: d({
214
+ strokeWidth: e.strokeWidth,
215
+ stroke: e.color
216
+ }),
217
+ "stroke-dasharray": "35"
218
+ }, null, 4)])], 4)) : a("", !0)]),
219
+ _: 1
220
+ }, 8, ["size", "width"])]));
221
+ }
222
+ });
223
+ //#endregion
224
+ export { g as i, T as n, C as r, O as t };
@@ -0,0 +1 @@
1
+ const e=require("./Roller-DALhjhfg.cjs");let t=require("vue"),n=require("@centui/core"),r=require("@centui/core/web");var i={key:0,class:`scroll-view-header`},a={key:1,class:`scroll-view-footer`},o=(0,t.defineComponent)({name:`cu-scroll-view`,__name:`ScrollView`,props:{scrollingX:{type:Boolean,default:!0},scrollingY:{type:Boolean,default:!0},bouncing:{type:Boolean,default:!0},autoReflow:{type:Boolean,default:!1},manualInit:{type:Boolean,default:!1},endReachedThreshold:{default:0},immediateCheckEndReaching:{type:Boolean,default:!1},touchAngle:{default:45},isPrevent:{type:Boolean,default:!0}},emits:[`refreshActive`,`refreshing`,`endReached`,`end-reached`,`scroll`],setup(e,{expose:o,emit:s}){let c=e,l=s,u=(0,t.useSlots)(),d=(0,t.ref)(),f=(0,t.ref)(null),p=(0,t.ref)(!1),m=(0,t.ref)(!1),h=(0,t.ref)(!1),g=(0,t.ref)(!1),_=(0,t.ref)(!1),v=(0,t.ref)(!1),y=(0,t.ref)(null),b=(0,t.ref)(null),x=null,S=null,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=null,N=null,P=(0,t.computed)(()=>!!u.refresh),F=(0,t.computed)(()=>!!u.more);(0,t.watch)(()=>c.autoReflow,e=>{e?L():R()}),(0,t.onMounted)(()=>{c.manualInit||I()}),(0,t.onBeforeUnmount)(()=>{R()});function I(){if(p.value)return;x=d.value??null;let e=x?.querySelector(`.scroll-view-refresh`)??null,t=x?.querySelector(`.scroll-view-more`)??null;S=x?.querySelector(`.scroll-view-container`)??null;let i=e?e.clientHeight:0;if(C=t?t.clientHeight:0,!x||!S)return;let a=x.getBoundingClientRect(),o=new r.Scroller((e,t)=>{(0,r.render)(S,e,t),p.value&&q(e,t)},{scrollingX:c.scrollingX,scrollingY:c.scrollingY,bouncing:c.bouncing,zooming:!1,animationDuration:200,speedMultiplier:1.2,inRequestAnimationFrame:!0});o.setPosition(a.left+x.clientLeft,a.top+x.clientTop),P.value&&o.activatePullToRefresh(i,()=>{g.value=!0,h.value=!1,l(`refreshActive`)},()=>{g.value=!1,h.value=!1},()=>{g.value=!1,h.value=!0,l(`refreshing`)}),f.value=o,Z(!0),c.autoReflow&&L(),N=(0,n.debounce)(()=>{v.value=!0,l(`endReached`),l(`end-reached`)},50),setTimeout(()=>{p.value=!0},50),c.immediateCheckEndReaching&&z()}function L(){R(),M=setInterval(()=>{Z()},100)}function R(){M&&=(clearInterval(M),null)}function z(){let e=f.value;if(!e)return;let t=e._clientHeight,n=e._contentHeight,r=e._scrollTop,i=c.endReachedThreshold,a=n-t-(r+C+i);r>=0&&!v.value&&a<=0&&N&&(_.value=!0,N())}function B(){let e=E-w,t=D-T,n=Math.atan2(Math.abs(t),Math.abs(e))*180/Math.PI;return c.scrollingX?90-n:n}function V(e){let t=f.value;t&&(w=e.targetTouches[0].pageX,T=e.targetTouches[0].pageY,t.doTouchStart(Array.from(e.touches),e.timeStamp))}function H(e){let t=f.value;if(!t)return;let n=!1;if(c.isPrevent&&(e.preventDefault(),n=!0),E=e.targetTouches[0].pageX,D=e.targetTouches[0].pageY,(!c.scrollingX||!c.scrollingY)&&B()<c.touchAngle)return;!n&&e.cancelable&&e.preventDefault(),t.doTouchMove(Array.from(e.touches),e.timeStamp,e.scale);let r=document.documentElement.scrollLeft||window.pageXOffset||document.body.scrollLeft,i=document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop,a=E-r,o=D-i;(a>document.documentElement.clientWidth-15||o>document.documentElement.clientHeight-15||a<15||o<15)&&t.doTouchEnd(e.timeStamp)}function U(e){let t=f.value;t&&t.doTouchEnd(e.timeStamp)}function W(e){let t=f.value;t&&(w=e.pageX,T=e.pageY,t.doTouchStart([{pageX:e.pageX,pageY:e.pageY}],e.timeStamp),m.value=!0)}function G(e){let t=f.value;t&&m.value&&(E=e.pageX,D=e.pageY,!((!c.scrollingX||!c.scrollingY)&&B()<c.touchAngle)&&(t.doTouchMove([{pageX:e.pageX,pageY:e.pageY}],e.timeStamp),m.value=!0))}function K(e){let t=f.value;t&&m.value&&(t.doTouchEnd(e.timeStamp),m.value=!1)}function q(e,t){e=+e.toFixed(2),t=+t.toFixed(2),(y.value!==e||b.value!==t)&&(y.value=e,b.value=t,z(),l(`scroll`,{scrollLeft:e,scrollTop:t}))}function J(){setTimeout(()=>{I()},0)}function Y(e,t,n=!1){f.value?.scrollTo(e,t,n)}function X(){return f.value?.getValues()??{left:0,top:0}}function Z(e=!1){let t=f.value;t&&x&&S&&setTimeout(()=>{let n=x.clientWidth,r=x.clientHeight,i=S.offsetWidth,a=S.offsetHeight;(e||O!==n||k!==r||A!==i||j!==a)&&(t.setDimensions(x.clientWidth,x.clientHeight,S.offsetWidth,S.offsetHeight),O=n,k=r,A=i,j=a)},0)}function Q(){f.value?.triggerPullToRefresh()}function $(){f.value?.finishPullToRefresh(),Z()}function ee(){_.value=!1,v.value=!1,Z()}return o({init:J,scrollTo:Y,getOffsets:X,reflowScroller:Z,triggerRefresh:Q,finishRefresh:$,finishLoadMore:ee}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`root`,ref:d,class:`cu-scroll-view`,onTouchstart:V,onTouchmove:H,onTouchend:U,onTouchcancel:U,onMousedown:W,onMousemove:G,onMouseup:K,onMouseleave:K},[n.$slots.header?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,i,[(0,t.renderSlot)(n.$slots,`header`)])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`scroll-view-container`,{horizon:e.scrollingX&&!e.scrollingY}]),"scroll-wrapper":``},[P.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)([`scroll-view-refresh`,{refreshing:h.value,"refresh-active":g.value}])},[(0,t.renderSlot)(n.$slots,`refresh`,{scrollTop:b.value??0,isRefreshing:h.value,isRefreshActive:g.value})],2)):(0,t.createCommentVNode)(``,!0),(0,t.renderSlot)(n.$slots,`default`),F.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:(0,t.normalizeClass)([`scroll-view-more`,{active:_.value||v.value}])},[(0,t.renderSlot)(n.$slots,`more`,{isEndReaching:_.value||v.value})],2)):(0,t.createCommentVNode)(``,!0)],2),n.$slots.footer?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,a,[(0,t.renderSlot)(n.$slots,`footer`)])):(0,t.createCommentVNode)(``,!0)],544))}}),s={class:`refresh-tip`},c=(0,t.defineComponent)({name:`cu-scroll-view-refresh`,__name:`ScrollViewRefresh`,props:{scrollTop:{default:0},isRefreshing:{type:Boolean,default:!1},isRefreshActive:{type:Boolean,default:!1},refreshText:{default:void 0},refreshActiveText:{default:void 0},refreshingText:{default:void 0},rollerColor:{default:`#2F86F6`}},setup(r){let i=r,a=(0,t.ref)(),o=(0,t.computed)(()=>{if(!a.value||a.value.clientHeight<=0||!i.scrollTop)return+i.scrollTop;let e=a.value.clientHeight;return Math.abs(i.scrollTop)<e/2?0:(Math.abs(i.scrollTop)-e/2)/(e/2)}),c=(0,t.computed)(()=>i.isRefreshing?i.refreshingText??(0,n.t)(`md.scroll_view.refresh.refreshing`):i.isRefreshActive?i.refreshActiveText??(0,n.t)(`md.scroll_view.refresh.freedRefresh`):i.refreshText??(0,n.t)(`md.scroll_view.refresh.pullDownRefresh`));return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`el`,ref:a,class:`cu-scroll-view-refresh`},[(0,t.createVNode)(e.t,{process:r.isRefreshing?void 0:o.value,width:10,color:r.rollerColor},null,8,[`process`,`color`]),(0,t.createElementVNode)(`p`,s,(0,t.toDisplayString)(c.value),1)],512))}}),l={class:`cu-scroll-view-more`},u=(0,t.defineComponent)({name:`cu-scroll-view-more`,__name:`ScrollViewMore`,props:{loadingText:{default:()=>(0,n.t)(`md.scroll_view.more.loading`)},finishedText:{default:()=>(0,n.t)(`md.scroll_view.more.allLoaded`)},isFinished:{type:Boolean,default:!1}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,l,[e.isFinished?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createTextVNode)((0,t.toDisplayString)(e.finishedText),1)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createTextVNode)((0,t.toDisplayString)(e.loadingText),1)],64))]))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}});
@@ -0,0 +1,278 @@
1
+ import { t as e } from "./Roller-DFJ7jMV0.js";
2
+ import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, normalizeClass as l, onBeforeUnmount as ee, onMounted as u, openBlock as d, ref as f, renderSlot as p, toDisplayString as m, useSlots as h, watch as g } from "vue";
3
+ import { debounce as te, t as _ } from "@centui/core";
4
+ import { Scroller as v, render as y } from "@centui/core/web";
5
+ //#region src/components/scroll-view/ScrollView.vue?vue&type=script&setup=true&lang.ts
6
+ var b = {
7
+ key: 0,
8
+ class: "scroll-view-header"
9
+ }, ne = {
10
+ key: 1,
11
+ class: "scroll-view-footer"
12
+ }, x = /* @__PURE__ */ c({
13
+ name: "cu-scroll-view",
14
+ __name: "ScrollView",
15
+ props: {
16
+ scrollingX: {
17
+ type: Boolean,
18
+ default: !0
19
+ },
20
+ scrollingY: {
21
+ type: Boolean,
22
+ default: !0
23
+ },
24
+ bouncing: {
25
+ type: Boolean,
26
+ default: !0
27
+ },
28
+ autoReflow: {
29
+ type: Boolean,
30
+ default: !1
31
+ },
32
+ manualInit: {
33
+ type: Boolean,
34
+ default: !1
35
+ },
36
+ endReachedThreshold: { default: 0 },
37
+ immediateCheckEndReaching: {
38
+ type: Boolean,
39
+ default: !1
40
+ },
41
+ touchAngle: { default: 45 },
42
+ isPrevent: {
43
+ type: Boolean,
44
+ default: !0
45
+ }
46
+ },
47
+ emits: [
48
+ "refreshActive",
49
+ "refreshing",
50
+ "endReached",
51
+ "end-reached",
52
+ "scroll"
53
+ ],
54
+ setup(e, { expose: t, emit: o }) {
55
+ let s = e, c = o, m = h(), _ = f(), x = f(null), S = f(!1), C = f(!1), w = f(!1), T = f(!1), E = f(!1), D = f(!1), O = f(null), k = f(null), A = null, j = null, M = 0, N = 0, P = 0, F = 0, I = 0, L = 0, R = 0, z = 0, B = 0, V = null, H = null, U = n(() => !!m.refresh), re = n(() => !!m.more);
56
+ g(() => s.autoReflow, (e) => {
57
+ e ? G() : K();
58
+ }), u(() => {
59
+ s.manualInit || W();
60
+ }), ee(() => {
61
+ K();
62
+ });
63
+ function W() {
64
+ if (S.value) return;
65
+ A = _.value ?? null;
66
+ let e = A?.querySelector(".scroll-view-refresh") ?? null, t = A?.querySelector(".scroll-view-more") ?? null;
67
+ j = A?.querySelector(".scroll-view-container") ?? null;
68
+ let n = e ? e.clientHeight : 0;
69
+ if (M = t ? t.clientHeight : 0, !A || !j) return;
70
+ let r = A.getBoundingClientRect(), i = new v((e, t) => {
71
+ y(j, e, t), S.value && oe(e, t);
72
+ }, {
73
+ scrollingX: s.scrollingX,
74
+ scrollingY: s.scrollingY,
75
+ bouncing: s.bouncing,
76
+ zooming: !1,
77
+ animationDuration: 200,
78
+ speedMultiplier: 1.2,
79
+ inRequestAnimationFrame: !0
80
+ });
81
+ i.setPosition(r.left + A.clientLeft, r.top + A.clientTop), U.value && i.activatePullToRefresh(n, () => {
82
+ T.value = !0, w.value = !1, c("refreshActive");
83
+ }, () => {
84
+ T.value = !1, w.value = !1;
85
+ }, () => {
86
+ T.value = !1, w.value = !0, c("refreshing");
87
+ }), x.value = i, $(!0), s.autoReflow && G(), H = te(() => {
88
+ D.value = !0, c("endReached"), c("end-reached");
89
+ }, 50), setTimeout(() => {
90
+ S.value = !0;
91
+ }, 50), s.immediateCheckEndReaching && q();
92
+ }
93
+ function G() {
94
+ K(), V = setInterval(() => {
95
+ $();
96
+ }, 100);
97
+ }
98
+ function K() {
99
+ V &&= (clearInterval(V), null);
100
+ }
101
+ function q() {
102
+ let e = x.value;
103
+ if (!e) return;
104
+ let t = e._clientHeight, n = e._contentHeight, r = e._scrollTop, i = s.endReachedThreshold, a = n - t - (r + M + i);
105
+ r >= 0 && !D.value && a <= 0 && H && (E.value = !0, H());
106
+ }
107
+ function J() {
108
+ let e = F - N, t = I - P, n = Math.atan2(Math.abs(t), Math.abs(e)) * 180 / Math.PI;
109
+ return s.scrollingX ? 90 - n : n;
110
+ }
111
+ function Y(e) {
112
+ let t = x.value;
113
+ t && (N = e.targetTouches[0].pageX, P = e.targetTouches[0].pageY, t.doTouchStart(Array.from(e.touches), e.timeStamp));
114
+ }
115
+ function ie(e) {
116
+ let t = x.value;
117
+ if (!t) return;
118
+ let n = !1;
119
+ if (s.isPrevent && (e.preventDefault(), n = !0), F = e.targetTouches[0].pageX, I = e.targetTouches[0].pageY, (!s.scrollingX || !s.scrollingY) && J() < s.touchAngle) return;
120
+ !n && e.cancelable && e.preventDefault(), t.doTouchMove(Array.from(e.touches), e.timeStamp, e.scale);
121
+ let r = document.documentElement.scrollLeft || window.pageXOffset || document.body.scrollLeft, i = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop, a = F - r, o = I - i;
122
+ (a > document.documentElement.clientWidth - 15 || o > document.documentElement.clientHeight - 15 || a < 15 || o < 15) && t.doTouchEnd(e.timeStamp);
123
+ }
124
+ function X(e) {
125
+ let t = x.value;
126
+ t && t.doTouchEnd(e.timeStamp);
127
+ }
128
+ function Z(e) {
129
+ let t = x.value;
130
+ t && (N = e.pageX, P = e.pageY, t.doTouchStart([{
131
+ pageX: e.pageX,
132
+ pageY: e.pageY
133
+ }], e.timeStamp), C.value = !0);
134
+ }
135
+ function ae(e) {
136
+ let t = x.value;
137
+ t && C.value && (F = e.pageX, I = e.pageY, !((!s.scrollingX || !s.scrollingY) && J() < s.touchAngle) && (t.doTouchMove([{
138
+ pageX: e.pageX,
139
+ pageY: e.pageY
140
+ }], e.timeStamp), C.value = !0));
141
+ }
142
+ function Q(e) {
143
+ let t = x.value;
144
+ t && C.value && (t.doTouchEnd(e.timeStamp), C.value = !1);
145
+ }
146
+ function oe(e, t) {
147
+ e = +e.toFixed(2), t = +t.toFixed(2), (O.value !== e || k.value !== t) && (O.value = e, k.value = t, q(), c("scroll", {
148
+ scrollLeft: e,
149
+ scrollTop: t
150
+ }));
151
+ }
152
+ function se() {
153
+ setTimeout(() => {
154
+ W();
155
+ }, 0);
156
+ }
157
+ function ce(e, t, n = !1) {
158
+ x.value?.scrollTo(e, t, n);
159
+ }
160
+ function le() {
161
+ return x.value?.getValues() ?? {
162
+ left: 0,
163
+ top: 0
164
+ };
165
+ }
166
+ function $(e = !1) {
167
+ let t = x.value;
168
+ t && A && j && setTimeout(() => {
169
+ let n = A.clientWidth, r = A.clientHeight, i = j.offsetWidth, a = j.offsetHeight;
170
+ (e || L !== n || R !== r || z !== i || B !== a) && (t.setDimensions(A.clientWidth, A.clientHeight, j.offsetWidth, j.offsetHeight), L = n, R = r, z = i, B = a);
171
+ }, 0);
172
+ }
173
+ function ue() {
174
+ x.value?.triggerPullToRefresh();
175
+ }
176
+ function de() {
177
+ x.value?.finishPullToRefresh(), $();
178
+ }
179
+ function fe() {
180
+ E.value = !1, D.value = !1, $();
181
+ }
182
+ return t({
183
+ init: se,
184
+ scrollTo: ce,
185
+ getOffsets: le,
186
+ reflowScroller: $,
187
+ triggerRefresh: ue,
188
+ finishRefresh: de,
189
+ finishLoadMore: fe
190
+ }), (t, n) => (d(), i("div", {
191
+ ref_key: "root",
192
+ ref: _,
193
+ class: "cu-scroll-view",
194
+ onTouchstart: Y,
195
+ onTouchmove: ie,
196
+ onTouchend: X,
197
+ onTouchcancel: X,
198
+ onMousedown: Z,
199
+ onMousemove: ae,
200
+ onMouseup: Q,
201
+ onMouseleave: Q
202
+ }, [
203
+ t.$slots.header ? (d(), i("div", b, [p(t.$slots, "header")])) : r("", !0),
204
+ a("div", {
205
+ class: l(["scroll-view-container", { horizon: e.scrollingX && !e.scrollingY }]),
206
+ "scroll-wrapper": ""
207
+ }, [
208
+ U.value ? (d(), i("div", {
209
+ key: 0,
210
+ class: l(["scroll-view-refresh", {
211
+ refreshing: w.value,
212
+ "refresh-active": T.value
213
+ }])
214
+ }, [p(t.$slots, "refresh", {
215
+ scrollTop: k.value ?? 0,
216
+ isRefreshing: w.value,
217
+ isRefreshActive: T.value
218
+ })], 2)) : r("", !0),
219
+ p(t.$slots, "default"),
220
+ re.value ? (d(), i("div", {
221
+ key: 1,
222
+ class: l(["scroll-view-more", { active: E.value || D.value }])
223
+ }, [p(t.$slots, "more", { isEndReaching: E.value || D.value })], 2)) : r("", !0)
224
+ ], 2),
225
+ t.$slots.footer ? (d(), i("div", ne, [p(t.$slots, "footer")])) : r("", !0)
226
+ ], 544));
227
+ }
228
+ }), S = { class: "refresh-tip" }, C = /* @__PURE__ */ c({
229
+ name: "cu-scroll-view-refresh",
230
+ __name: "ScrollViewRefresh",
231
+ props: {
232
+ scrollTop: { default: 0 },
233
+ isRefreshing: {
234
+ type: Boolean,
235
+ default: !1
236
+ },
237
+ isRefreshActive: {
238
+ type: Boolean,
239
+ default: !1
240
+ },
241
+ refreshText: { default: void 0 },
242
+ refreshActiveText: { default: void 0 },
243
+ refreshingText: { default: void 0 },
244
+ rollerColor: { default: "#2F86F6" }
245
+ },
246
+ setup(t) {
247
+ let r = t, o = f(), c = n(() => {
248
+ if (!o.value || o.value.clientHeight <= 0 || !r.scrollTop) return +r.scrollTop;
249
+ let e = o.value.clientHeight;
250
+ return Math.abs(r.scrollTop) < e / 2 ? 0 : (Math.abs(r.scrollTop) - e / 2) / (e / 2);
251
+ }), l = n(() => r.isRefreshing ? r.refreshingText ?? _("md.scroll_view.refresh.refreshing") : r.isRefreshActive ? r.refreshActiveText ?? _("md.scroll_view.refresh.freedRefresh") : r.refreshText ?? _("md.scroll_view.refresh.pullDownRefresh"));
252
+ return (n, r) => (d(), i("div", {
253
+ ref_key: "el",
254
+ ref: o,
255
+ class: "cu-scroll-view-refresh"
256
+ }, [s(e, {
257
+ process: t.isRefreshing ? void 0 : c.value,
258
+ width: 10,
259
+ color: t.rollerColor
260
+ }, null, 8, ["process", "color"]), a("p", S, m(l.value), 1)], 512));
261
+ }
262
+ }), w = { class: "cu-scroll-view-more" }, T = /* @__PURE__ */ c({
263
+ name: "cu-scroll-view-more",
264
+ __name: "ScrollViewMore",
265
+ props: {
266
+ loadingText: { default: () => _("md.scroll_view.more.loading") },
267
+ finishedText: { default: () => _("md.scroll_view.more.allLoaded") },
268
+ isFinished: {
269
+ type: Boolean,
270
+ default: !1
271
+ }
272
+ },
273
+ setup(e) {
274
+ return (n, r) => (d(), i("div", w, [e.isFinished ? (d(), i(t, { key: 1 }, [o(m(e.finishedText), 1)], 64)) : (d(), i(t, { key: 0 }, [o(m(e.loadingText), 1)], 64))]));
275
+ }
276
+ });
277
+ //#endregion
278
+ export { C as n, x as r, T as t };
@@ -0,0 +1 @@
1
+ let e=require("vue");var t={key:0,class:`cu-skeleton`},n={class:`cu-skeleton-content`},r={key:1},i=`40%`,a=`100%`,o=(0,e.defineComponent)({__name:`Skeleton`,props:{loading:{type:Boolean,default:!0},avatar:{type:Boolean,default:!1},row:{default:3},title:{type:Boolean,default:!1},titleWidth:{default:i},rowWidth:{default:a},avatarSize:{default:`md`}},setup(i){let o=i;function s(e){return typeof e==`number`}function c(e){let{rowWidth:t}=o;return Array.isArray(t)?t[e]==null?a:s(t[e])?`${t[e]}%`:String(t[e]):t?s(t)?`${t}%`:String(t):a}let l=s(o.titleWidth)?`${o.titleWidth}%`:String(o.titleWidth);return(a,o)=>i.loading?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,t,[i.avatar?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,class:(0,e.normalizeClass)({"cu-skeleton-avatar":!0,"cu-skeleton-avatar-large":i.avatarSize===`lg`,"cu-skeleton-avatar-small":i.avatarSize===`sm`})},null,2)):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`div`,n,[i.title?((0,e.openBlock)(),(0,e.createElementBlock)(`h4`,{key:0,class:`cu-skeleton-title`,style:(0,e.normalizeStyle)({width:(0,e.unref)(l)})},null,4)):(0,e.createCommentVNode)(``,!0),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(i.row,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:t,class:`cu-skeleton-row`,style:(0,e.normalizeStyle)({width:t===i.row?`60%`:c(t-1)})},null,4))),128))])])):((0,e.openBlock)(),(0,e.createElementBlock)(`div`,r,[(0,e.renderSlot)(a.$slots,`default`)]))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
@@ -0,0 +1,55 @@
1
+ import { Fragment as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, normalizeClass as a, normalizeStyle as o, openBlock as s, renderList as c, renderSlot as l, unref as u } from "vue";
2
+ //#region src/components/skeleton/Skeleton.vue?vue&type=script&setup=true&lang.ts
3
+ var d = {
4
+ key: 0,
5
+ class: "cu-skeleton"
6
+ }, f = { class: "cu-skeleton-content" }, p = { key: 1 }, m = "40%", h = "100%", g = /* @__PURE__ */ i({
7
+ __name: "Skeleton",
8
+ props: {
9
+ loading: {
10
+ type: Boolean,
11
+ default: !0
12
+ },
13
+ avatar: {
14
+ type: Boolean,
15
+ default: !1
16
+ },
17
+ row: { default: 3 },
18
+ title: {
19
+ type: Boolean,
20
+ default: !1
21
+ },
22
+ titleWidth: { default: m },
23
+ rowWidth: { default: h },
24
+ avatarSize: { default: "md" }
25
+ },
26
+ setup(i) {
27
+ let m = i;
28
+ function g(e) {
29
+ return typeof e == "number";
30
+ }
31
+ function _(e) {
32
+ let { rowWidth: t } = m;
33
+ return Array.isArray(t) ? t[e] == null ? h : g(t[e]) ? `${t[e]}%` : String(t[e]) : t ? g(t) ? `${t}%` : String(t) : h;
34
+ }
35
+ let v = g(m.titleWidth) ? `${m.titleWidth}%` : String(m.titleWidth);
36
+ return (m, h) => i.loading ? (s(), n("div", d, [i.avatar ? (s(), n("div", {
37
+ key: 0,
38
+ class: a({
39
+ "cu-skeleton-avatar": !0,
40
+ "cu-skeleton-avatar-large": i.avatarSize === "lg",
41
+ "cu-skeleton-avatar-small": i.avatarSize === "sm"
42
+ })
43
+ }, null, 2)) : t("", !0), r("div", f, [i.title ? (s(), n("h4", {
44
+ key: 0,
45
+ class: "cu-skeleton-title",
46
+ style: o({ width: u(v) })
47
+ }, null, 4)) : t("", !0), (s(!0), n(e, null, c(i.row, (e) => (s(), n("div", {
48
+ key: e,
49
+ class: "cu-skeleton-row",
50
+ style: o({ width: e === i.row ? "60%" : _(e - 1) })
51
+ }, null, 4))), 128))])])) : (s(), n("div", p, [l(m.$slots, "default")]));
52
+ }
53
+ });
54
+ //#endregion
55
+ export { g as t };
@@ -0,0 +1 @@
1
+ let e=require("vue");var t=[`data-hint`],n=[`data-hint`],r=[`data-hint`],i=(0,e.defineComponent)({name:`cu-slider`,__name:`Slider`,props:{modelValue:{default:0},min:{default:0},max:{default:100},step:{default:1},range:{type:Boolean,default:!1},format:{type:Function,default:void 0},disabled:{type:Boolean,default:!1}},emits:[`update:modelValue`],setup(i,{emit:a}){let o=i,s=a,c=(0,e.ref)(!1),l=(0,e.ref)(!1),u=(0,e.ref)([o.min,o.max]),d=0,f=0,p=e=>o.format?.(e)??e;(0,e.watch)(()=>o.modelValue,e=>{(Array.isArray(e)&&(e[0]!==u.value[0]||e[1]!==u.value[1])||!Array.isArray(e)&&e!==u.value[0])&&_(e)},{immediate:!0}),(0,e.watch)(()=>o.disabled,e=>{e||S()});let m=(0,e.computed)(()=>(u.value[0]-o.min)/(o.max-o.min)*100),h=(0,e.computed)(()=>(u.value[1]-o.min)/(o.max-o.min)*100),g=(0,e.computed)(()=>o.range?{width:(u.value[1]-u.value[0])/(o.max-o.min)*100+`%`,left:m.value+`%`}:{width:(u.value[0]-o.min)/(o.max-o.min)*100+`%`});function _(e){let t=[void 0,void 0];Array.isArray(e)?(t[0]=e[0],t[1]=e[1]):t[0]=e,t[0]=typeof t[0]==`number`?Math.round((t[0]-o.min)/o.step)*o.step+o.min:u.value[0],t[1]=typeof t[1]==`number`?Math.round((t[1]-o.min)/o.step)*o.step+o.min:u.value[1],t[0]<o.min&&(t[0]=o.min),t[1]>o.max&&(t[1]=o.max),t[0]>t[1]&&(t[0]===u.value[0]?t[1]=t[0]:t[0]=t[1]),(u.value[0]!==t[0]||u.value[1]!==t[1])&&(u.value=[t[0],t[1]],o.range?s(`update:modelValue`,u.value):s(`update:modelValue`,u.value[0]))}function v(e){o.disabled||(e.preventDefault(),e.stopPropagation(),d=(`changedTouches`in e?e.changedTouches[0]:e).pageX,f=u.value[0],l.value=!1,c.value=!0,window.addEventListener(`mousemove`,b),window.addEventListener(`touchmove`,b),window.addEventListener(`mouseup`,x),window.addEventListener(`touchend`,x))}function y(e){o.disabled||(e.preventDefault(),e.stopPropagation(),d=(`changedTouches`in e?e.changedTouches[0]:e).pageX,f=u.value[1],l.value=!0,c.value=!0,window.addEventListener(`mousemove`,b),window.addEventListener(`touchmove`,b),window.addEventListener(`mouseup`,x),window.addEventListener(`touchend`,x))}function b(e){if(o.disabled||(e.preventDefault(),e.stopPropagation(),!c.value))return;let t=`changedTouches`in e?e.changedTouches[0]:e,n=document.querySelector(`.cu-slider`);window.requestAnimationFrame(()=>{let e=(t.pageX-d)/n.offsetWidth*(o.max-o.min),r=f+e;c.value&&(l.value?_([null,r]):_([r,null]))})}function x(e){e.preventDefault(),e.stopPropagation(),S()}function S(){c.value=!1,l.value=!1,window.removeEventListener(`mousemove`,b),window.removeEventListener(`touchmove`,b),window.removeEventListener(`mouseup`,x),window.removeEventListener(`touchend`,x)}return(a,o)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:(0,e.normalizeClass)([`cu-slider`,{"is-disabled":i.disabled}])},[i.range?((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:0},[(0,e.createElementVNode)(`div`,{class:`cu-slider-bar`,style:(0,e.normalizeStyle)(g.value)},null,4),(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`cu-slider-handle is-lower`,{"is-active":c.value&&!l.value}]),"data-hint":p(u.value[0]),style:(0,e.normalizeStyle)({left:m.value+`%`})},[(0,e.createElementVNode)(`span`,{onMousedown:v,onTouchstart:v},null,32)],14,t),(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`cu-slider-handle is-higher`,{"is-active":c.value&&l.value}]),"data-hint":p(u.value[1]),style:(0,e.normalizeStyle)({left:h.value+`%`})},[(0,e.createElementVNode)(`span`,{onMousedown:y,onTouchstart:y},null,32)],14,n)],64)):((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:1},[(0,e.createElementVNode)(`div`,{class:`cu-slider-bar`,style:(0,e.normalizeStyle)(g.value)},null,4),(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`cu-slider-handle`,{"is-active":c.value}]),"data-hint":p(u.value[0]),style:(0,e.normalizeStyle)({left:m.value+`%`})},[(0,e.createElementVNode)(`span`,{onMousedown:v,onTouchstart:v},null,32)],14,r)],64))],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
@@ -0,0 +1,95 @@
1
+ import { Fragment as e, computed as t, createElementBlock as n, createElementVNode as r, defineComponent as i, normalizeClass as a, normalizeStyle as o, openBlock as s, ref as c, watch as l } from "vue";
2
+ //#region src/components/slider/Slider.vue?vue&type=script&setup=true&lang.ts
3
+ var u = ["data-hint"], d = ["data-hint"], f = ["data-hint"], p = /* @__PURE__ */ i({
4
+ name: "cu-slider",
5
+ __name: "Slider",
6
+ props: {
7
+ modelValue: { default: 0 },
8
+ min: { default: 0 },
9
+ max: { default: 100 },
10
+ step: { default: 1 },
11
+ range: {
12
+ type: Boolean,
13
+ default: !1
14
+ },
15
+ format: {
16
+ type: Function,
17
+ default: void 0
18
+ },
19
+ disabled: {
20
+ type: Boolean,
21
+ default: !1
22
+ }
23
+ },
24
+ emits: ["update:modelValue"],
25
+ setup(i, { emit: p }) {
26
+ let m = i, h = p, g = c(!1), _ = c(!1), v = c([m.min, m.max]), y = 0, b = 0, x = (e) => m.format?.(e) ?? e;
27
+ l(() => m.modelValue, (e) => {
28
+ (Array.isArray(e) && (e[0] !== v.value[0] || e[1] !== v.value[1]) || !Array.isArray(e) && e !== v.value[0]) && T(e);
29
+ }, { immediate: !0 }), l(() => m.disabled, (e) => {
30
+ e || A();
31
+ });
32
+ let S = t(() => (v.value[0] - m.min) / (m.max - m.min) * 100), C = t(() => (v.value[1] - m.min) / (m.max - m.min) * 100), w = t(() => m.range ? {
33
+ width: (v.value[1] - v.value[0]) / (m.max - m.min) * 100 + "%",
34
+ left: S.value + "%"
35
+ } : { width: (v.value[0] - m.min) / (m.max - m.min) * 100 + "%" });
36
+ function T(e) {
37
+ let t = [void 0, void 0];
38
+ Array.isArray(e) ? (t[0] = e[0], t[1] = e[1]) : t[0] = e, t[0] = typeof t[0] == "number" ? Math.round((t[0] - m.min) / m.step) * m.step + m.min : v.value[0], t[1] = typeof t[1] == "number" ? Math.round((t[1] - m.min) / m.step) * m.step + m.min : v.value[1], t[0] < m.min && (t[0] = m.min), t[1] > m.max && (t[1] = m.max), t[0] > t[1] && (t[0] === v.value[0] ? t[1] = t[0] : t[0] = t[1]), (v.value[0] !== t[0] || v.value[1] !== t[1]) && (v.value = [t[0], t[1]], m.range ? h("update:modelValue", v.value) : h("update:modelValue", v.value[0]));
39
+ }
40
+ function E(e) {
41
+ m.disabled || (e.preventDefault(), e.stopPropagation(), y = ("changedTouches" in e ? e.changedTouches[0] : e).pageX, b = v.value[0], _.value = !1, g.value = !0, window.addEventListener("mousemove", O), window.addEventListener("touchmove", O), window.addEventListener("mouseup", k), window.addEventListener("touchend", k));
42
+ }
43
+ function D(e) {
44
+ m.disabled || (e.preventDefault(), e.stopPropagation(), y = ("changedTouches" in e ? e.changedTouches[0] : e).pageX, b = v.value[1], _.value = !0, g.value = !0, window.addEventListener("mousemove", O), window.addEventListener("touchmove", O), window.addEventListener("mouseup", k), window.addEventListener("touchend", k));
45
+ }
46
+ function O(e) {
47
+ if (m.disabled || (e.preventDefault(), e.stopPropagation(), !g.value)) return;
48
+ let t = "changedTouches" in e ? e.changedTouches[0] : e, n = document.querySelector(".cu-slider");
49
+ window.requestAnimationFrame(() => {
50
+ let e = (t.pageX - y) / n.offsetWidth * (m.max - m.min), r = b + e;
51
+ g.value && (_.value ? T([null, r]) : T([r, null]));
52
+ });
53
+ }
54
+ function k(e) {
55
+ e.preventDefault(), e.stopPropagation(), A();
56
+ }
57
+ function A() {
58
+ g.value = !1, _.value = !1, window.removeEventListener("mousemove", O), window.removeEventListener("touchmove", O), window.removeEventListener("mouseup", k), window.removeEventListener("touchend", k);
59
+ }
60
+ return (t, c) => (s(), n("div", { class: a(["cu-slider", { "is-disabled": i.disabled }]) }, [i.range ? (s(), n(e, { key: 0 }, [
61
+ r("div", {
62
+ class: "cu-slider-bar",
63
+ style: o(w.value)
64
+ }, null, 4),
65
+ r("div", {
66
+ class: a(["cu-slider-handle is-lower", { "is-active": g.value && !_.value }]),
67
+ "data-hint": x(v.value[0]),
68
+ style: o({ left: S.value + "%" })
69
+ }, [r("span", {
70
+ onMousedown: E,
71
+ onTouchstart: E
72
+ }, null, 32)], 14, u),
73
+ r("div", {
74
+ class: a(["cu-slider-handle is-higher", { "is-active": g.value && _.value }]),
75
+ "data-hint": x(v.value[1]),
76
+ style: o({ left: C.value + "%" })
77
+ }, [r("span", {
78
+ onMousedown: D,
79
+ onTouchstart: D
80
+ }, null, 32)], 14, d)
81
+ ], 64)) : (s(), n(e, { key: 1 }, [r("div", {
82
+ class: "cu-slider-bar",
83
+ style: o(w.value)
84
+ }, null, 4), r("div", {
85
+ class: a(["cu-slider-handle", { "is-active": g.value }]),
86
+ "data-hint": x(v.value[0]),
87
+ style: o({ left: S.value + "%" })
88
+ }, [r("span", {
89
+ onMousedown: E,
90
+ onTouchstart: E
91
+ }, null, 32)], 14, f)], 64))], 2));
92
+ }
93
+ });
94
+ //#endregion
95
+ export { p as t };