zartui 0.1.112 → 3.0.2

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 (594) hide show
  1. package/README.md +6 -2
  2. package/es/badge/Badge.d.ts +66 -0
  3. package/es/badge/Badge.mjs +95 -0
  4. package/es/badge/index.css +1 -0
  5. package/es/badge/index.d.ts +49 -0
  6. package/es/badge/index.mjs +8 -0
  7. package/es/badge/style/index.d.ts +1 -0
  8. package/es/badge/style/index.mjs +2 -0
  9. package/es/button/Button.d.ts +154 -0
  10. package/es/button/Button.mjs +166 -0
  11. package/es/button/index.css +1 -0
  12. package/es/button/index.d.ts +113 -0
  13. package/es/button/index.mjs +8 -0
  14. package/es/button/style/index.d.ts +1 -0
  15. package/es/button/style/index.mjs +5 -0
  16. package/es/button/types.d.ts +5 -0
  17. package/es/button/types.mjs +0 -0
  18. package/es/cell/Cell.d.ts +128 -0
  19. package/es/cell/Cell.mjs +132 -0
  20. package/es/cell/index.css +1 -0
  21. package/es/cell/index.d.ts +74 -0
  22. package/es/cell/index.mjs +8 -0
  23. package/es/cell/style/index.d.ts +1 -0
  24. package/es/cell/style/index.mjs +4 -0
  25. package/es/col/Col.d.ts +38 -0
  26. package/es/col/Col.mjs +63 -0
  27. package/es/col/index.css +1 -0
  28. package/es/col/index.d.ts +31 -0
  29. package/es/col/index.mjs +8 -0
  30. package/es/col/style/index.d.ts +1 -0
  31. package/es/col/style/index.mjs +3 -0
  32. package/es/composables/on-popup-reopen.d.ts +3 -0
  33. package/es/composables/on-popup-reopen.mjs +16 -0
  34. package/es/composables/use-expose.d.ts +1 -0
  35. package/es/composables/use-expose.mjs +11 -0
  36. package/es/composables/use-height.d.ts +2 -0
  37. package/es/composables/use-height.mjs +20 -0
  38. package/es/composables/use-id.d.ts +1 -0
  39. package/es/composables/use-id.mjs +13 -0
  40. package/es/composables/use-lazy-render.d.ts +2 -0
  41. package/es/composables/use-lazy-render.mjs +17 -0
  42. package/es/composables/use-lock-scroll.d.ts +2 -0
  43. package/es/composables/use-lock-scroll.mjs +56 -0
  44. package/es/composables/use-placeholder.d.ts +3 -0
  45. package/es/composables/use-placeholder.mjs +14 -0
  46. package/es/composables/use-refs.d.ts +2 -0
  47. package/es/composables/use-refs.mjs +20 -0
  48. package/es/composables/use-route.d.ts +13 -0
  49. package/es/composables/use-route.mjs +29 -0
  50. package/es/composables/use-tab-status.d.ts +3 -0
  51. package/es/composables/use-tab-status.mjs +7 -0
  52. package/es/composables/use-touch.d.ts +16 -0
  53. package/es/composables/use-touch.mjs +61 -0
  54. package/es/composables/use-visibility-change.d.ts +2 -0
  55. package/es/composables/use-visibility-change.mjs +30 -0
  56. package/es/config-provider/ConfigProvider.d.ts +47 -0
  57. package/es/config-provider/ConfigProvider.mjs +64 -0
  58. package/es/config-provider/index.d.ts +33 -0
  59. package/es/config-provider/index.mjs +8 -0
  60. package/es/config-provider/style/index.d.ts +1 -0
  61. package/es/config-provider/style/index.mjs +1 -0
  62. package/es/divider/Divider.d.ts +40 -0
  63. package/es/divider/Divider.mjs +31 -0
  64. package/es/divider/index.css +1 -0
  65. package/es/divider/index.d.ts +32 -0
  66. package/es/divider/index.mjs +8 -0
  67. package/es/divider/style/index.d.ts +1 -0
  68. package/es/divider/style/index.mjs +2 -0
  69. package/es/empty/Empty.d.ts +29 -0
  70. package/es/empty/Empty.mjs +58 -0
  71. package/es/empty/Images.d.ts +4 -0
  72. package/es/empty/Images.mjs +2104 -0
  73. package/es/empty/index.css +1 -0
  74. package/es/empty/index.d.ts +24 -0
  75. package/es/empty/index.mjs +8 -0
  76. package/es/empty/style/index.d.ts +1 -0
  77. package/es/empty/style/index.mjs +2 -0
  78. package/es/icon/Icon.d.ts +45 -0
  79. package/es/icon/Icon.mjs +59 -0
  80. package/es/icon/config.d.ts +41 -0
  81. package/es/icon/config.mjs +139 -0
  82. package/es/icon/index.css +1 -0
  83. package/es/icon/index.d.ts +35 -0
  84. package/es/icon/index.mjs +8 -0
  85. package/es/icon/style/index.d.ts +1 -0
  86. package/es/icon/style/index.mjs +3 -0
  87. package/es/index.d.ts +35 -0
  88. package/es/index.mjs +105 -0
  89. package/es/list/List.d.ts +74 -0
  90. package/es/list/List.mjs +147 -0
  91. package/es/list/index.css +1 -0
  92. package/es/list/index.d.ts +59 -0
  93. package/es/list/index.mjs +8 -0
  94. package/es/list/style/index.d.ts +1 -0
  95. package/es/list/style/index.mjs +4 -0
  96. package/es/list/types.d.ts +7 -0
  97. package/es/list/types.mjs +0 -0
  98. package/es/loading/Loading.d.ts +39 -0
  99. package/es/loading/Loading.mjs +114 -0
  100. package/es/loading/index.css +1 -0
  101. package/es/loading/index.d.ts +31 -0
  102. package/es/loading/index.mjs +8 -0
  103. package/es/loading/style/index.d.ts +1 -0
  104. package/es/loading/style/index.mjs +2 -0
  105. package/es/locale/index.d.ts +7 -0
  106. package/es/locale/index.mjs +24 -0
  107. package/es/locale/lang/en-US.d.ts +62 -0
  108. package/es/locale/lang/en-US.mjs +64 -0
  109. package/es/locale/lang/zh-CN.d.ts +62 -0
  110. package/es/locale/lang/zh-CN.mjs +64 -0
  111. package/es/locale/style/index.d.ts +1 -0
  112. package/es/locale/style/index.mjs +1 -0
  113. package/es/notice-bar/NoticeBar.d.ts +71 -0
  114. package/es/notice-bar/NoticeBar.mjs +165 -0
  115. package/es/notice-bar/index.css +1 -0
  116. package/es/notice-bar/index.d.ts +56 -0
  117. package/es/notice-bar/index.mjs +8 -0
  118. package/es/notice-bar/style/index.d.ts +1 -0
  119. package/es/notice-bar/style/index.mjs +4 -0
  120. package/es/notice-bar/types.d.ts +7 -0
  121. package/es/notice-bar/types.mjs +0 -0
  122. package/es/notify/Notify.d.ts +134 -0
  123. package/es/notify/Notify.mjs +44 -0
  124. package/es/notify/function-call.d.ts +6 -0
  125. package/es/notify/function-call.mjs +68 -0
  126. package/es/notify/index.css +1 -0
  127. package/es/notify/index.d.ts +99 -0
  128. package/es/notify/index.mjs +18 -0
  129. package/es/notify/style/index.d.ts +1 -0
  130. package/es/notify/style/index.mjs +6 -0
  131. package/es/notify/types.d.ts +17 -0
  132. package/es/notify/types.mjs +0 -0
  133. package/es/number-keyboard/NumberKeyboard.d.ts +162 -0
  134. package/es/number-keyboard/NumberKeyboard.mjs +243 -0
  135. package/es/number-keyboard/NumberKeyboardKey.d.ts +24 -0
  136. package/es/number-keyboard/NumberKeyboardKey.mjs +89 -0
  137. package/es/number-keyboard/index.css +1 -0
  138. package/es/number-keyboard/index.d.ts +119 -0
  139. package/es/number-keyboard/index.mjs +8 -0
  140. package/es/number-keyboard/style/index.d.ts +1 -0
  141. package/es/number-keyboard/style/index.mjs +9 -0
  142. package/es/overlay/Overlay.d.ts +51 -0
  143. package/es/overlay/Overlay.mjs +47 -0
  144. package/es/overlay/index.css +1 -0
  145. package/es/overlay/index.d.ts +40 -0
  146. package/es/overlay/index.mjs +8 -0
  147. package/es/overlay/style/index.d.ts +1 -0
  148. package/es/overlay/style/index.mjs +2 -0
  149. package/es/password-input/PasswordInput.d.ts +63 -0
  150. package/es/password-input/PasswordInput.mjs +78 -0
  151. package/es/password-input/index.css +1 -0
  152. package/es/password-input/index.d.ts +49 -0
  153. package/es/password-input/index.mjs +8 -0
  154. package/es/password-input/style/index.d.ts +1 -0
  155. package/es/password-input/style/index.mjs +2 -0
  156. package/es/popup/Popup.d.ts +165 -0
  157. package/es/popup/Popup.mjs +205 -0
  158. package/es/popup/index.css +1 -0
  159. package/es/popup/index.d.ts +123 -0
  160. package/es/popup/index.mjs +8 -0
  161. package/es/popup/shared.d.ts +30 -0
  162. package/es/popup/shared.mjs +22 -0
  163. package/es/popup/style/index.d.ts +1 -0
  164. package/es/popup/style/index.mjs +5 -0
  165. package/es/popup/types.d.ts +8 -0
  166. package/es/popup/types.mjs +0 -0
  167. package/es/pull-refresh/PullRefresh.d.ts +75 -0
  168. package/es/pull-refresh/PullRefresh.mjs +191 -0
  169. package/es/pull-refresh/index.css +1 -0
  170. package/es/pull-refresh/index.d.ts +58 -0
  171. package/es/pull-refresh/index.mjs +8 -0
  172. package/es/pull-refresh/style/index.d.ts +1 -0
  173. package/es/pull-refresh/style/index.mjs +3 -0
  174. package/es/rate/Rate.d.ts +107 -0
  175. package/es/rate/Rate.mjs +217 -0
  176. package/es/rate/index.css +1 -0
  177. package/es/rate/index.d.ts +80 -0
  178. package/es/rate/index.mjs +8 -0
  179. package/es/rate/style/index.d.ts +1 -0
  180. package/es/rate/style/index.mjs +4 -0
  181. package/es/row/Row.d.ts +64 -0
  182. package/es/row/Row.mjs +91 -0
  183. package/es/row/index.css +1 -0
  184. package/es/row/index.d.ts +42 -0
  185. package/es/row/index.mjs +8 -0
  186. package/es/row/style/index.d.ts +1 -0
  187. package/es/row/style/index.mjs +2 -0
  188. package/es/stepper/Stepper.d.ts +181 -0
  189. package/es/stepper/Stepper.mjs +258 -0
  190. package/es/stepper/index.css +1 -0
  191. package/es/stepper/index.d.ts +132 -0
  192. package/es/stepper/index.mjs +8 -0
  193. package/es/stepper/style/index.d.ts +1 -0
  194. package/es/stepper/style/index.mjs +4 -0
  195. package/es/sticky/Sticky.d.ts +58 -0
  196. package/es/sticky/Sticky.mjs +119 -0
  197. package/es/sticky/index.css +1 -0
  198. package/es/sticky/index.d.ts +45 -0
  199. package/es/sticky/index.mjs +8 -0
  200. package/es/sticky/style/index.d.ts +1 -0
  201. package/es/sticky/style/index.mjs +2 -0
  202. package/es/style/animation.css +1 -0
  203. package/es/style/base.css +1 -0
  204. package/es/style/css-variables.css +1 -0
  205. package/es/style/mixins/clearfix.css +0 -0
  206. package/es/style/mixins/ellipsis.css +0 -0
  207. package/es/style/mixins/hairline.css +0 -0
  208. package/es/style/normalize.css +1 -0
  209. package/es/swipe/Swipe.d.ts +121 -0
  210. package/es/swipe/Swipe.mjs +353 -0
  211. package/es/swipe/index.css +1 -0
  212. package/es/swipe/index.d.ts +90 -0
  213. package/es/swipe/index.mjs +8 -0
  214. package/es/swipe/style/index.d.ts +1 -0
  215. package/es/swipe/style/index.mjs +2 -0
  216. package/es/swipe/types.d.ts +31 -0
  217. package/es/swipe/types.mjs +0 -0
  218. package/es/swipe-item/SwipeItem.d.ts +2 -0
  219. package/es/swipe-item/SwipeItem.mjs +82 -0
  220. package/es/swipe-item/index.css +1 -0
  221. package/es/swipe-item/index.d.ts +7 -0
  222. package/es/swipe-item/index.mjs +8 -0
  223. package/es/swipe-item/style/index.d.ts +1 -0
  224. package/es/swipe-item/style/index.mjs +3 -0
  225. package/es/switch/Switch.d.ts +58 -0
  226. package/es/switch/Switch.mjs +85 -0
  227. package/es/switch/index.css +1 -0
  228. package/es/switch/index.d.ts +46 -0
  229. package/es/switch/index.mjs +8 -0
  230. package/es/switch/style/index.d.ts +1 -0
  231. package/es/switch/style/index.mjs +3 -0
  232. package/es/tab/Tab.d.ts +58 -0
  233. package/es/tab/Tab.mjs +113 -0
  234. package/es/tab/index.css +1 -0
  235. package/es/tab/index.d.ts +45 -0
  236. package/es/tab/index.mjs +8 -0
  237. package/es/tab/style/index.d.ts +1 -0
  238. package/es/tab/style/index.mjs +7 -0
  239. package/es/tabs/Tabs.d.ts +154 -0
  240. package/es/tabs/Tabs.mjs +352 -0
  241. package/es/tabs/TabsContent.d.ts +43 -0
  242. package/es/tabs/TabsContent.mjs +64 -0
  243. package/es/tabs/TabsTitle.d.ts +45 -0
  244. package/es/tabs/TabsTitle.mjs +90 -0
  245. package/es/tabs/index.css +1 -0
  246. package/es/tabs/index.d.ts +114 -0
  247. package/es/tabs/index.mjs +8 -0
  248. package/es/tabs/style/index.d.ts +1 -0
  249. package/es/tabs/style/index.mjs +5 -0
  250. package/es/tabs/types.d.ts +23 -0
  251. package/es/tabs/types.mjs +0 -0
  252. package/es/tabs/utils.d.ts +3 -0
  253. package/es/tabs/utils.mjs +37 -0
  254. package/es/toast/Toast.d.ts +112 -0
  255. package/es/toast/Toast.mjs +119 -0
  256. package/es/toast/function-call.d.ts +10 -0
  257. package/es/toast/function-call.mjs +142 -0
  258. package/es/toast/index.css +1 -0
  259. package/es/toast/index.d.ts +79 -0
  260. package/es/toast/index.mjs +26 -0
  261. package/es/toast/lock-click.d.ts +1 -0
  262. package/es/toast/lock-click.mjs +17 -0
  263. package/es/toast/style/index.d.ts +1 -0
  264. package/es/toast/style/index.mjs +7 -0
  265. package/es/toast/types.d.ts +36 -0
  266. package/es/toast/types.mjs +0 -0
  267. package/es/utils/basic.d.ts +18 -0
  268. package/es/utils/basic.mjs +32 -0
  269. package/es/utils/constant.d.ts +8 -0
  270. package/es/utils/constant.mjs +18 -0
  271. package/es/utils/create.d.ts +17 -0
  272. package/es/utils/create.mjs +50 -0
  273. package/es/utils/deep-assign.d.ts +3 -0
  274. package/es/utils/deep-assign.mjs +22 -0
  275. package/es/utils/deep-clone.d.ts +1 -0
  276. package/es/utils/deep-clone.mjs +20 -0
  277. package/es/utils/dom.d.ts +12 -0
  278. package/es/utils/dom.mjs +67 -0
  279. package/es/utils/format.d.ts +13 -0
  280. package/es/utils/format.mjs +120 -0
  281. package/es/utils/index.d.ts +9 -0
  282. package/es/utils/index.mjs +9 -0
  283. package/es/utils/interceptor.d.ts +6 -0
  284. package/es/utils/interceptor.mjs +29 -0
  285. package/es/utils/mount-component.d.ts +14 -0
  286. package/es/utils/mount-component.mjs +39 -0
  287. package/es/utils/props.d.ts +31 -0
  288. package/es/utils/props.mjs +36 -0
  289. package/es/utils/validate.d.ts +9 -0
  290. package/es/utils/validate.mjs +22 -0
  291. package/es/utils/with-install.d.ts +13 -0
  292. package/es/utils/with-install.mjs +12 -0
  293. package/es/vue-sfc-shim.d.ts +6 -0
  294. package/es/vue-tsx-shim.d.ts +16 -0
  295. package/lib/badge/Badge.d.ts +66 -0
  296. package/lib/badge/Badge.js +114 -0
  297. package/lib/badge/index.css +1 -0
  298. package/lib/badge/index.d.ts +49 -0
  299. package/lib/badge/index.js +33 -0
  300. package/lib/badge/style/index.d.ts +1 -0
  301. package/lib/badge/style/index.js +2 -0
  302. package/lib/button/Button.d.ts +154 -0
  303. package/lib/button/Button.js +185 -0
  304. package/lib/button/index.css +1 -0
  305. package/lib/button/index.d.ts +113 -0
  306. package/lib/button/index.js +33 -0
  307. package/lib/button/style/index.d.ts +1 -0
  308. package/lib/button/style/index.js +5 -0
  309. package/lib/button/types.d.ts +5 -0
  310. package/lib/button/types.js +15 -0
  311. package/lib/cell/Cell.d.ts +128 -0
  312. package/lib/cell/Cell.js +151 -0
  313. package/lib/cell/index.css +1 -0
  314. package/lib/cell/index.d.ts +74 -0
  315. package/lib/cell/index.js +33 -0
  316. package/lib/cell/style/index.d.ts +1 -0
  317. package/lib/cell/style/index.js +4 -0
  318. package/lib/col/Col.d.ts +38 -0
  319. package/lib/col/Col.js +82 -0
  320. package/lib/col/index.css +1 -0
  321. package/lib/col/index.d.ts +31 -0
  322. package/lib/col/index.js +33 -0
  323. package/lib/col/style/index.d.ts +1 -0
  324. package/lib/col/style/index.js +3 -0
  325. package/lib/composables/on-popup-reopen.d.ts +3 -0
  326. package/lib/composables/on-popup-reopen.js +35 -0
  327. package/lib/composables/use-expose.d.ts +1 -0
  328. package/lib/composables/use-expose.js +30 -0
  329. package/lib/composables/use-height.d.ts +2 -0
  330. package/lib/composables/use-height.js +39 -0
  331. package/lib/composables/use-id.d.ts +1 -0
  332. package/lib/composables/use-id.js +32 -0
  333. package/lib/composables/use-lazy-render.d.ts +2 -0
  334. package/lib/composables/use-lazy-render.js +36 -0
  335. package/lib/composables/use-lock-scroll.d.ts +2 -0
  336. package/lib/composables/use-lock-scroll.js +75 -0
  337. package/lib/composables/use-placeholder.d.ts +3 -0
  338. package/lib/composables/use-placeholder.js +33 -0
  339. package/lib/composables/use-refs.d.ts +2 -0
  340. package/lib/composables/use-refs.js +39 -0
  341. package/lib/composables/use-route.d.ts +13 -0
  342. package/lib/composables/use-route.js +46 -0
  343. package/lib/composables/use-tab-status.d.ts +3 -0
  344. package/lib/composables/use-tab-status.js +26 -0
  345. package/lib/composables/use-touch.d.ts +16 -0
  346. package/lib/composables/use-touch.js +80 -0
  347. package/lib/composables/use-visibility-change.d.ts +2 -0
  348. package/lib/composables/use-visibility-change.js +49 -0
  349. package/lib/config-provider/ConfigProvider.d.ts +47 -0
  350. package/lib/config-provider/ConfigProvider.js +83 -0
  351. package/lib/config-provider/index.d.ts +33 -0
  352. package/lib/config-provider/index.js +33 -0
  353. package/lib/config-provider/style/index.d.ts +1 -0
  354. package/lib/config-provider/style/index.js +1 -0
  355. package/lib/divider/Divider.d.ts +40 -0
  356. package/lib/divider/Divider.js +50 -0
  357. package/lib/divider/index.css +1 -0
  358. package/lib/divider/index.d.ts +32 -0
  359. package/lib/divider/index.js +33 -0
  360. package/lib/divider/style/index.d.ts +1 -0
  361. package/lib/divider/style/index.js +2 -0
  362. package/lib/empty/Empty.d.ts +29 -0
  363. package/lib/empty/Empty.js +77 -0
  364. package/lib/empty/Images.d.ts +4 -0
  365. package/lib/empty/Images.js +2123 -0
  366. package/lib/empty/index.css +1 -0
  367. package/lib/empty/index.d.ts +24 -0
  368. package/lib/empty/index.js +33 -0
  369. package/lib/empty/style/index.d.ts +1 -0
  370. package/lib/empty/style/index.js +2 -0
  371. package/lib/icon/Icon.d.ts +45 -0
  372. package/lib/icon/Icon.js +78 -0
  373. package/lib/icon/config.d.ts +41 -0
  374. package/lib/icon/config.js +158 -0
  375. package/lib/icon/index.css +1 -0
  376. package/lib/icon/index.d.ts +35 -0
  377. package/lib/icon/index.js +33 -0
  378. package/lib/icon/style/index.d.ts +1 -0
  379. package/lib/icon/style/index.js +3 -0
  380. package/lib/index.css +1 -0
  381. package/lib/index.d.ts +35 -0
  382. package/lib/index.js +125 -0
  383. package/lib/list/List.d.ts +74 -0
  384. package/lib/list/List.js +166 -0
  385. package/lib/list/index.css +1 -0
  386. package/lib/list/index.d.ts +59 -0
  387. package/lib/list/index.js +33 -0
  388. package/lib/list/style/index.d.ts +1 -0
  389. package/lib/list/style/index.js +4 -0
  390. package/lib/list/types.d.ts +7 -0
  391. package/lib/list/types.js +15 -0
  392. package/lib/loading/Loading.d.ts +39 -0
  393. package/lib/loading/Loading.js +133 -0
  394. package/lib/loading/index.css +1 -0
  395. package/lib/loading/index.d.ts +31 -0
  396. package/lib/loading/index.js +33 -0
  397. package/lib/loading/style/index.d.ts +1 -0
  398. package/lib/loading/style/index.js +2 -0
  399. package/lib/locale/index.d.ts +7 -0
  400. package/lib/locale/index.js +49 -0
  401. package/lib/locale/lang/en-US.d.ts +62 -0
  402. package/lib/locale/lang/en-US.js +83 -0
  403. package/lib/locale/lang/zh-CN.d.ts +62 -0
  404. package/lib/locale/lang/zh-CN.js +83 -0
  405. package/lib/locale/style/index.d.ts +1 -0
  406. package/lib/locale/style/index.js +1 -0
  407. package/lib/notice-bar/NoticeBar.d.ts +71 -0
  408. package/lib/notice-bar/NoticeBar.js +190 -0
  409. package/lib/notice-bar/index.css +1 -0
  410. package/lib/notice-bar/index.d.ts +56 -0
  411. package/lib/notice-bar/index.js +33 -0
  412. package/lib/notice-bar/style/index.d.ts +1 -0
  413. package/lib/notice-bar/style/index.js +4 -0
  414. package/lib/notice-bar/types.d.ts +7 -0
  415. package/lib/notice-bar/types.js +15 -0
  416. package/lib/notify/Notify.d.ts +134 -0
  417. package/lib/notify/Notify.js +63 -0
  418. package/lib/notify/function-call.d.ts +6 -0
  419. package/lib/notify/function-call.js +93 -0
  420. package/lib/notify/index.css +1 -0
  421. package/lib/notify/index.d.ts +99 -0
  422. package/lib/notify/index.js +38 -0
  423. package/lib/notify/style/index.d.ts +1 -0
  424. package/lib/notify/style/index.js +6 -0
  425. package/lib/notify/types.d.ts +17 -0
  426. package/lib/notify/types.js +15 -0
  427. package/lib/number-keyboard/NumberKeyboard.d.ts +162 -0
  428. package/lib/number-keyboard/NumberKeyboard.js +268 -0
  429. package/lib/number-keyboard/NumberKeyboardKey.d.ts +24 -0
  430. package/lib/number-keyboard/NumberKeyboardKey.js +114 -0
  431. package/lib/number-keyboard/index.css +1 -0
  432. package/lib/number-keyboard/index.d.ts +119 -0
  433. package/lib/number-keyboard/index.js +33 -0
  434. package/lib/number-keyboard/style/index.d.ts +1 -0
  435. package/lib/number-keyboard/style/index.js +9 -0
  436. package/lib/overlay/Overlay.d.ts +51 -0
  437. package/lib/overlay/Overlay.js +66 -0
  438. package/lib/overlay/index.css +1 -0
  439. package/lib/overlay/index.d.ts +40 -0
  440. package/lib/overlay/index.js +33 -0
  441. package/lib/overlay/style/index.d.ts +1 -0
  442. package/lib/overlay/style/index.js +2 -0
  443. package/lib/password-input/PasswordInput.d.ts +63 -0
  444. package/lib/password-input/PasswordInput.js +97 -0
  445. package/lib/password-input/index.css +1 -0
  446. package/lib/password-input/index.d.ts +49 -0
  447. package/lib/password-input/index.js +33 -0
  448. package/lib/password-input/style/index.d.ts +1 -0
  449. package/lib/password-input/style/index.js +2 -0
  450. package/lib/popup/Popup.d.ts +165 -0
  451. package/lib/popup/Popup.js +224 -0
  452. package/lib/popup/index.css +1 -0
  453. package/lib/popup/index.d.ts +123 -0
  454. package/lib/popup/index.js +33 -0
  455. package/lib/popup/shared.d.ts +30 -0
  456. package/lib/popup/shared.js +41 -0
  457. package/lib/popup/style/index.d.ts +1 -0
  458. package/lib/popup/style/index.js +5 -0
  459. package/lib/popup/types.d.ts +8 -0
  460. package/lib/popup/types.js +15 -0
  461. package/lib/pull-refresh/PullRefresh.d.ts +75 -0
  462. package/lib/pull-refresh/PullRefresh.js +210 -0
  463. package/lib/pull-refresh/index.css +1 -0
  464. package/lib/pull-refresh/index.d.ts +58 -0
  465. package/lib/pull-refresh/index.js +33 -0
  466. package/lib/pull-refresh/style/index.d.ts +1 -0
  467. package/lib/pull-refresh/style/index.js +3 -0
  468. package/lib/rate/Rate.d.ts +107 -0
  469. package/lib/rate/Rate.js +236 -0
  470. package/lib/rate/index.css +1 -0
  471. package/lib/rate/index.d.ts +80 -0
  472. package/lib/rate/index.js +33 -0
  473. package/lib/rate/style/index.d.ts +1 -0
  474. package/lib/rate/style/index.js +4 -0
  475. package/lib/row/Row.d.ts +64 -0
  476. package/lib/row/Row.js +110 -0
  477. package/lib/row/index.css +1 -0
  478. package/lib/row/index.d.ts +42 -0
  479. package/lib/row/index.js +33 -0
  480. package/lib/row/style/index.d.ts +1 -0
  481. package/lib/row/style/index.js +2 -0
  482. package/lib/stepper/Stepper.d.ts +181 -0
  483. package/lib/stepper/Stepper.js +283 -0
  484. package/lib/stepper/index.css +1 -0
  485. package/lib/stepper/index.d.ts +132 -0
  486. package/lib/stepper/index.js +33 -0
  487. package/lib/stepper/style/index.d.ts +1 -0
  488. package/lib/stepper/style/index.js +4 -0
  489. package/lib/sticky/Sticky.d.ts +58 -0
  490. package/lib/sticky/Sticky.js +138 -0
  491. package/lib/sticky/index.css +1 -0
  492. package/lib/sticky/index.d.ts +45 -0
  493. package/lib/sticky/index.js +33 -0
  494. package/lib/sticky/style/index.d.ts +1 -0
  495. package/lib/sticky/style/index.js +2 -0
  496. package/lib/style/animation.css +1 -0
  497. package/lib/style/base.css +1 -0
  498. package/lib/style/css-variables.css +1 -0
  499. package/lib/style/mixins/clearfix.css +0 -0
  500. package/lib/style/mixins/ellipsis.css +0 -0
  501. package/lib/style/mixins/hairline.css +0 -0
  502. package/lib/style/normalize.css +1 -0
  503. package/lib/swipe/Swipe.d.ts +121 -0
  504. package/lib/swipe/Swipe.js +372 -0
  505. package/lib/swipe/index.css +1 -0
  506. package/lib/swipe/index.d.ts +90 -0
  507. package/lib/swipe/index.js +33 -0
  508. package/lib/swipe/style/index.d.ts +1 -0
  509. package/lib/swipe/style/index.js +2 -0
  510. package/lib/swipe/types.d.ts +31 -0
  511. package/lib/swipe/types.js +15 -0
  512. package/lib/swipe-item/SwipeItem.d.ts +2 -0
  513. package/lib/swipe-item/SwipeItem.js +101 -0
  514. package/lib/swipe-item/index.css +1 -0
  515. package/lib/swipe-item/index.d.ts +7 -0
  516. package/lib/swipe-item/index.js +33 -0
  517. package/lib/swipe-item/style/index.d.ts +1 -0
  518. package/lib/swipe-item/style/index.js +3 -0
  519. package/lib/switch/Switch.d.ts +58 -0
  520. package/lib/switch/Switch.js +104 -0
  521. package/lib/switch/index.css +1 -0
  522. package/lib/switch/index.d.ts +46 -0
  523. package/lib/switch/index.js +33 -0
  524. package/lib/switch/style/index.d.ts +1 -0
  525. package/lib/switch/style/index.js +3 -0
  526. package/lib/tab/Tab.d.ts +58 -0
  527. package/lib/tab/Tab.js +132 -0
  528. package/lib/tab/index.css +1 -0
  529. package/lib/tab/index.d.ts +45 -0
  530. package/lib/tab/index.js +33 -0
  531. package/lib/tab/style/index.d.ts +1 -0
  532. package/lib/tab/style/index.js +7 -0
  533. package/lib/tabs/Tabs.d.ts +154 -0
  534. package/lib/tabs/Tabs.js +377 -0
  535. package/lib/tabs/TabsContent.d.ts +43 -0
  536. package/lib/tabs/TabsContent.js +83 -0
  537. package/lib/tabs/TabsTitle.d.ts +45 -0
  538. package/lib/tabs/TabsTitle.js +109 -0
  539. package/lib/tabs/index.css +1 -0
  540. package/lib/tabs/index.d.ts +114 -0
  541. package/lib/tabs/index.js +33 -0
  542. package/lib/tabs/style/index.d.ts +1 -0
  543. package/lib/tabs/style/index.js +5 -0
  544. package/lib/tabs/types.d.ts +23 -0
  545. package/lib/tabs/types.js +15 -0
  546. package/lib/tabs/utils.d.ts +3 -0
  547. package/lib/tabs/utils.js +56 -0
  548. package/lib/toast/Toast.d.ts +112 -0
  549. package/lib/toast/Toast.js +138 -0
  550. package/lib/toast/function-call.d.ts +10 -0
  551. package/lib/toast/function-call.js +167 -0
  552. package/lib/toast/index.css +1 -0
  553. package/lib/toast/index.d.ts +79 -0
  554. package/lib/toast/index.js +42 -0
  555. package/lib/toast/lock-click.d.ts +1 -0
  556. package/lib/toast/lock-click.js +36 -0
  557. package/lib/toast/style/index.d.ts +1 -0
  558. package/lib/toast/style/index.js +7 -0
  559. package/lib/toast/types.d.ts +36 -0
  560. package/lib/toast/types.js +15 -0
  561. package/lib/utils/basic.d.ts +18 -0
  562. package/lib/utils/basic.js +51 -0
  563. package/lib/utils/constant.d.ts +8 -0
  564. package/lib/utils/constant.js +37 -0
  565. package/lib/utils/create.d.ts +17 -0
  566. package/lib/utils/create.js +75 -0
  567. package/lib/utils/deep-assign.d.ts +3 -0
  568. package/lib/utils/deep-assign.js +41 -0
  569. package/lib/utils/deep-clone.d.ts +1 -0
  570. package/lib/utils/deep-clone.js +39 -0
  571. package/lib/utils/dom.d.ts +12 -0
  572. package/lib/utils/dom.js +86 -0
  573. package/lib/utils/format.d.ts +13 -0
  574. package/lib/utils/format.js +139 -0
  575. package/lib/utils/index.d.ts +9 -0
  576. package/lib/utils/index.js +25 -0
  577. package/lib/utils/interceptor.d.ts +6 -0
  578. package/lib/utils/interceptor.js +48 -0
  579. package/lib/utils/mount-component.d.ts +14 -0
  580. package/lib/utils/mount-component.js +58 -0
  581. package/lib/utils/props.d.ts +31 -0
  582. package/lib/utils/props.js +55 -0
  583. package/lib/utils/validate.d.ts +9 -0
  584. package/lib/utils/validate.js +41 -0
  585. package/lib/utils/with-install.d.ts +13 -0
  586. package/lib/utils/with-install.js +31 -0
  587. package/lib/vue-sfc-shim.d.ts +6 -0
  588. package/lib/vue-tsx-shim.d.ts +16 -0
  589. package/lib/web-types.json +3197 -0
  590. package/lib/zartui.cjs.js +6740 -0
  591. package/lib/zartui.es.js +6740 -0
  592. package/lib/zartui.js +6974 -0
  593. package/lib/zartui.min.js +1 -0
  594. package/package.json +50 -61
@@ -0,0 +1,353 @@
1
+ import { createVNode as _createVNode } from "vue";
2
+ import { ref, watch, reactive, computed, onMounted, onActivated, onDeactivated, onBeforeUnmount, defineComponent, nextTick } from "vue";
3
+ import { clamp, isHidden, truthProp, numericProp, windowWidth, windowHeight, preventDefault, createNamespace, makeNumericProp } from "../utils/index.mjs";
4
+ import { doubleRaf, useChildren, usePageVisibility } from "@zartui/use";
5
+ import { useTouch } from "../composables/use-touch.mjs";
6
+ import { useExpose } from "../composables/use-expose.mjs";
7
+ import { onPopupReopen } from "../composables/on-popup-reopen.mjs";
8
+ const [name, bem] = createNamespace("swipe");
9
+ const swipeProps = {
10
+ loop: truthProp,
11
+ width: numericProp,
12
+ height: numericProp,
13
+ vertical: Boolean,
14
+ autoplay: makeNumericProp(0),
15
+ duration: makeNumericProp(500),
16
+ touchable: truthProp,
17
+ lazyRender: Boolean,
18
+ initialSwipe: makeNumericProp(0),
19
+ indicatorColor: String,
20
+ showIndicators: truthProp,
21
+ stopPropagation: truthProp
22
+ };
23
+ const SWIPE_KEY = Symbol(name);
24
+ var stdin_default = defineComponent({
25
+ name,
26
+ props: swipeProps,
27
+ emits: ["change"],
28
+ setup(props, {
29
+ emit,
30
+ slots
31
+ }) {
32
+ const root = ref();
33
+ const state = reactive({
34
+ rect: null,
35
+ width: 0,
36
+ height: 0,
37
+ offset: 0,
38
+ active: 0,
39
+ swiping: false
40
+ });
41
+ const touch = useTouch();
42
+ const {
43
+ children,
44
+ linkChildren
45
+ } = useChildren(SWIPE_KEY);
46
+ const count = computed(() => children.length);
47
+ const size = computed(() => state[props.vertical ? "height" : "width"]);
48
+ const delta = computed(() => props.vertical ? touch.deltaY.value : touch.deltaX.value);
49
+ const minOffset = computed(() => {
50
+ if (state.rect) {
51
+ const base = props.vertical ? state.rect.height : state.rect.width;
52
+ return base - size.value * count.value;
53
+ }
54
+ return 0;
55
+ });
56
+ const maxCount = computed(() => Math.ceil(Math.abs(minOffset.value) / size.value));
57
+ const trackSize = computed(() => count.value * size.value);
58
+ const activeIndicator = computed(() => (state.active + count.value) % count.value);
59
+ const isCorrectDirection = computed(() => {
60
+ const expect = props.vertical ? "vertical" : "horizontal";
61
+ return touch.direction.value === expect;
62
+ });
63
+ const trackStyle = computed(() => {
64
+ const style = {
65
+ transitionDuration: `${state.swiping ? 0 : props.duration}ms`,
66
+ transform: `translate${props.vertical ? "Y" : "X"}(${state.offset}px)`
67
+ };
68
+ if (size.value) {
69
+ const mainAxis = props.vertical ? "height" : "width";
70
+ const crossAxis = props.vertical ? "width" : "height";
71
+ style[mainAxis] = `${trackSize.value}px`;
72
+ style[crossAxis] = props[crossAxis] ? `${props[crossAxis]}px` : "";
73
+ }
74
+ return style;
75
+ });
76
+ const getTargetActive = (pace) => {
77
+ const {
78
+ active
79
+ } = state;
80
+ if (pace) {
81
+ if (props.loop) {
82
+ return clamp(active + pace, -1, count.value);
83
+ }
84
+ return clamp(active + pace, 0, maxCount.value);
85
+ }
86
+ return active;
87
+ };
88
+ const getTargetOffset = (targetActive, offset = 0) => {
89
+ let currentPosition = targetActive * size.value;
90
+ if (!props.loop) {
91
+ currentPosition = Math.min(currentPosition, -minOffset.value);
92
+ }
93
+ let targetOffset = offset - currentPosition;
94
+ if (!props.loop) {
95
+ targetOffset = clamp(targetOffset, minOffset.value, 0);
96
+ }
97
+ return targetOffset;
98
+ };
99
+ const move = ({
100
+ pace = 0,
101
+ offset = 0,
102
+ emitChange
103
+ }) => {
104
+ if (count.value <= 1) {
105
+ return;
106
+ }
107
+ const {
108
+ active
109
+ } = state;
110
+ const targetActive = getTargetActive(pace);
111
+ const targetOffset = getTargetOffset(targetActive, offset);
112
+ if (props.loop) {
113
+ if (children[0] && targetOffset !== minOffset.value) {
114
+ const outRightBound = targetOffset < minOffset.value;
115
+ children[0].setOffset(outRightBound ? trackSize.value : 0);
116
+ }
117
+ if (children[count.value - 1] && targetOffset !== 0) {
118
+ const outLeftBound = targetOffset > 0;
119
+ children[count.value - 1].setOffset(outLeftBound ? -trackSize.value : 0);
120
+ }
121
+ }
122
+ state.active = targetActive;
123
+ state.offset = targetOffset;
124
+ if (emitChange && targetActive !== active) {
125
+ emit("change", activeIndicator.value);
126
+ }
127
+ };
128
+ const correctPosition = () => {
129
+ state.swiping = true;
130
+ if (state.active <= -1) {
131
+ move({
132
+ pace: count.value
133
+ });
134
+ } else if (state.active >= count.value) {
135
+ move({
136
+ pace: -count.value
137
+ });
138
+ }
139
+ };
140
+ const prev = () => {
141
+ correctPosition();
142
+ touch.reset();
143
+ doubleRaf(() => {
144
+ state.swiping = false;
145
+ move({
146
+ pace: -1,
147
+ emitChange: true
148
+ });
149
+ });
150
+ };
151
+ const next = () => {
152
+ correctPosition();
153
+ touch.reset();
154
+ doubleRaf(() => {
155
+ state.swiping = false;
156
+ move({
157
+ pace: 1,
158
+ emitChange: true
159
+ });
160
+ });
161
+ };
162
+ let autoplayTimer;
163
+ const stopAutoplay = () => clearTimeout(autoplayTimer);
164
+ const autoplay = () => {
165
+ stopAutoplay();
166
+ if (props.autoplay > 0 && count.value > 1) {
167
+ autoplayTimer = setTimeout(() => {
168
+ next();
169
+ autoplay();
170
+ }, +props.autoplay);
171
+ }
172
+ };
173
+ const initialize = (active = +props.initialSwipe) => {
174
+ if (!root.value) {
175
+ return;
176
+ }
177
+ const cb = () => {
178
+ var _a, _b;
179
+ if (!isHidden(root)) {
180
+ const rect = {
181
+ width: root.value.offsetWidth,
182
+ height: root.value.offsetHeight
183
+ };
184
+ state.rect = rect;
185
+ state.width = +((_a = props.width) != null ? _a : rect.width);
186
+ state.height = +((_b = props.height) != null ? _b : rect.height);
187
+ }
188
+ if (count.value) {
189
+ active = Math.min(count.value - 1, active);
190
+ }
191
+ state.active = active;
192
+ state.swiping = true;
193
+ state.offset = getTargetOffset(active);
194
+ children.forEach((swipe) => {
195
+ swipe.setOffset(0);
196
+ });
197
+ autoplay();
198
+ };
199
+ if (isHidden(root)) {
200
+ nextTick().then(cb);
201
+ } else {
202
+ cb();
203
+ }
204
+ };
205
+ const resize = () => initialize(state.active);
206
+ let touchStartTime;
207
+ const onTouchStart = (event) => {
208
+ if (!props.touchable)
209
+ return;
210
+ touch.start(event);
211
+ touchStartTime = Date.now();
212
+ stopAutoplay();
213
+ correctPosition();
214
+ };
215
+ const onTouchMove = (event) => {
216
+ if (props.touchable && state.swiping) {
217
+ touch.move(event);
218
+ if (isCorrectDirection.value) {
219
+ preventDefault(event, props.stopPropagation);
220
+ move({
221
+ offset: delta.value
222
+ });
223
+ }
224
+ }
225
+ };
226
+ const onTouchEnd = () => {
227
+ if (!props.touchable || !state.swiping) {
228
+ return;
229
+ }
230
+ const duration = Date.now() - touchStartTime;
231
+ const speed = delta.value / duration;
232
+ const shouldSwipe = Math.abs(speed) > 0.25 || Math.abs(delta.value) > size.value / 2;
233
+ if (shouldSwipe && isCorrectDirection.value) {
234
+ const offset = props.vertical ? touch.offsetY.value : touch.offsetX.value;
235
+ let pace = 0;
236
+ if (props.loop) {
237
+ pace = offset > 0 ? delta.value > 0 ? -1 : 1 : 0;
238
+ } else {
239
+ pace = -Math[delta.value > 0 ? "ceil" : "floor"](delta.value / size.value);
240
+ }
241
+ move({
242
+ pace,
243
+ emitChange: true
244
+ });
245
+ } else if (delta.value) {
246
+ move({
247
+ pace: 0
248
+ });
249
+ }
250
+ state.swiping = false;
251
+ autoplay();
252
+ };
253
+ const swipeTo = (index, options = {}) => {
254
+ correctPosition();
255
+ touch.reset();
256
+ doubleRaf(() => {
257
+ let targetIndex;
258
+ if (props.loop && index === count.value) {
259
+ targetIndex = state.active === 0 ? 0 : index;
260
+ } else {
261
+ targetIndex = index % count.value;
262
+ }
263
+ if (options.immediate) {
264
+ doubleRaf(() => {
265
+ state.swiping = false;
266
+ });
267
+ } else {
268
+ state.swiping = false;
269
+ }
270
+ move({
271
+ pace: targetIndex - state.active,
272
+ emitChange: true
273
+ });
274
+ });
275
+ };
276
+ const renderDot = (_, index) => {
277
+ const active = index === activeIndicator.value;
278
+ const style = active ? {
279
+ backgroundColor: props.indicatorColor
280
+ } : void 0;
281
+ return _createVNode("i", {
282
+ "style": style,
283
+ "class": bem("indicator", {
284
+ active
285
+ })
286
+ }, null);
287
+ };
288
+ const renderIndicator = () => {
289
+ if (slots.indicator) {
290
+ return slots.indicator({
291
+ active: activeIndicator.value,
292
+ total: count.value
293
+ });
294
+ }
295
+ if (props.showIndicators && count.value > 1) {
296
+ return _createVNode("div", {
297
+ "class": bem("indicators", {
298
+ vertical: props.vertical
299
+ })
300
+ }, [Array(count.value).fill("").map(renderDot)]);
301
+ }
302
+ };
303
+ useExpose({
304
+ prev,
305
+ next,
306
+ state,
307
+ resize,
308
+ swipeTo
309
+ });
310
+ linkChildren({
311
+ size,
312
+ props,
313
+ count,
314
+ activeIndicator
315
+ });
316
+ watch(() => props.initialSwipe, (value) => initialize(+value));
317
+ watch(count, () => initialize(state.active));
318
+ watch(() => props.autoplay, autoplay);
319
+ watch([windowWidth, windowHeight], resize);
320
+ watch(usePageVisibility(), (visible) => {
321
+ if (visible === "visible") {
322
+ autoplay();
323
+ } else {
324
+ stopAutoplay();
325
+ }
326
+ });
327
+ onMounted(initialize);
328
+ onActivated(() => initialize(state.active));
329
+ onPopupReopen(() => initialize(state.active));
330
+ onDeactivated(stopAutoplay);
331
+ onBeforeUnmount(stopAutoplay);
332
+ return () => {
333
+ var _a;
334
+ return _createVNode("div", {
335
+ "ref": root,
336
+ "class": bem()
337
+ }, [_createVNode("div", {
338
+ "style": trackStyle.value,
339
+ "class": bem("track", {
340
+ vertical: props.vertical
341
+ }),
342
+ "onTouchstart": onTouchStart,
343
+ "onTouchmove": onTouchMove,
344
+ "onTouchend": onTouchEnd,
345
+ "onTouchcancel": onTouchEnd
346
+ }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]), renderIndicator()]);
347
+ };
348
+ }
349
+ });
350
+ export {
351
+ SWIPE_KEY,
352
+ stdin_default as default
353
+ };
@@ -0,0 +1 @@
1
+ body{--zt-swipe-indicator-size: 6px;--zt-swipe-indicator-margin: var(--zt-padding-sm);--zt-swipe-indicator-active-opacity: 1;--zt-swipe-indicator-inactive-opacity: .3;--zt-swipe-indicator-active-background: var(--zt-primary-color);--zt-swipe-indicator-inactive-background: var(--zt-border-color)}.zt-swipe{position:relative;overflow:hidden;transform:translateZ(0);cursor:-webkit-grab;cursor:grab;-webkit-user-select:none;user-select:none}.zt-swipe__track{display:flex;height:100%}.zt-swipe__track--vertical{flex-direction:column}.zt-swipe__indicators{position:absolute;bottom:var(--zt-swipe-indicator-margin);left:50%;display:flex;transform:translate(-50%)}.zt-swipe__indicators--vertical{top:50%;bottom:auto;left:var(--zt-swipe-indicator-margin);flex-direction:column;transform:translateY(-50%)}.zt-swipe__indicators--vertical .zt-swipe__indicator:not(:last-child){margin-bottom:var(--zt-swipe-indicator-size)}.zt-swipe__indicator{width:var(--zt-swipe-indicator-size);height:var(--zt-swipe-indicator-size);background-color:var(--zt-swipe-indicator-inactive-background);border-radius:100%;opacity:var(--zt-swipe-indicator-inactive-opacity);transition:opacity var(--zt-duration-fast),background-color var(--zt-duration-fast)}.zt-swipe__indicator:not(:last-child){margin-right:var(--zt-swipe-indicator-size)}.zt-swipe__indicator--active{background-color:var(--zt-swipe-indicator-active-background);opacity:var(--zt-swipe-indicator-active-opacity)}
@@ -0,0 +1,90 @@
1
+ import { SwipeProps } from './Swipe';
2
+ export declare const Swipe: import("../utils").WithInstall<import("vue").DefineComponent<{
3
+ loop: {
4
+ type: BooleanConstructor;
5
+ default: true;
6
+ };
7
+ width: (NumberConstructor | StringConstructor)[];
8
+ height: (NumberConstructor | StringConstructor)[];
9
+ vertical: BooleanConstructor;
10
+ autoplay: {
11
+ type: (NumberConstructor | StringConstructor)[];
12
+ default: number;
13
+ };
14
+ duration: {
15
+ type: (NumberConstructor | StringConstructor)[];
16
+ default: number;
17
+ };
18
+ touchable: {
19
+ type: BooleanConstructor;
20
+ default: true;
21
+ };
22
+ lazyRender: BooleanConstructor;
23
+ initialSwipe: {
24
+ type: (NumberConstructor | StringConstructor)[];
25
+ default: number;
26
+ };
27
+ indicatorColor: StringConstructor;
28
+ showIndicators: {
29
+ type: BooleanConstructor;
30
+ default: true;
31
+ };
32
+ stopPropagation: {
33
+ type: BooleanConstructor;
34
+ default: true;
35
+ };
36
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
37
+ loop: {
38
+ type: BooleanConstructor;
39
+ default: true;
40
+ };
41
+ width: (NumberConstructor | StringConstructor)[];
42
+ height: (NumberConstructor | StringConstructor)[];
43
+ vertical: BooleanConstructor;
44
+ autoplay: {
45
+ type: (NumberConstructor | StringConstructor)[];
46
+ default: number;
47
+ };
48
+ duration: {
49
+ type: (NumberConstructor | StringConstructor)[];
50
+ default: number;
51
+ };
52
+ touchable: {
53
+ type: BooleanConstructor;
54
+ default: true;
55
+ };
56
+ lazyRender: BooleanConstructor;
57
+ initialSwipe: {
58
+ type: (NumberConstructor | StringConstructor)[];
59
+ default: number;
60
+ };
61
+ indicatorColor: StringConstructor;
62
+ showIndicators: {
63
+ type: BooleanConstructor;
64
+ default: true;
65
+ };
66
+ stopPropagation: {
67
+ type: BooleanConstructor;
68
+ default: true;
69
+ };
70
+ }>> & {
71
+ onChange?: ((...args: any[]) => any) | undefined;
72
+ }, {
73
+ autoplay: string | number;
74
+ loop: boolean;
75
+ vertical: boolean;
76
+ duration: string | number;
77
+ lazyRender: boolean;
78
+ touchable: boolean;
79
+ initialSwipe: string | number;
80
+ showIndicators: boolean;
81
+ stopPropagation: boolean;
82
+ }>>;
83
+ export default Swipe;
84
+ export type { SwipeProps };
85
+ export type { SwipeInstance, SwipeToOptions } from './types';
86
+ declare module 'vue' {
87
+ interface GlobalComponents {
88
+ ZtSwipe: typeof Swipe;
89
+ }
90
+ }
@@ -0,0 +1,8 @@
1
+ import { withInstall } from "../utils/index.mjs";
2
+ import _Swipe from "./Swipe.mjs";
3
+ const Swipe = withInstall(_Swipe);
4
+ var stdin_default = Swipe;
5
+ export {
6
+ Swipe,
7
+ stdin_default as default
8
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import "../../style/base.css";
2
+ import "../index.css";
@@ -0,0 +1,31 @@
1
+ import type { ComponentPublicInstance, ComputedRef } from 'vue';
2
+ import type { SwipeProps } from './Swipe';
3
+ export declare type SwipeState = {
4
+ rect: {
5
+ width: number;
6
+ height: number;
7
+ } | null;
8
+ width: number;
9
+ height: number;
10
+ offset: number;
11
+ active: number;
12
+ swiping: boolean;
13
+ };
14
+ export declare type SwipeToOptions = {
15
+ immediate?: boolean;
16
+ };
17
+ export declare type SwipeExpose = {
18
+ prev: () => void;
19
+ next: () => void;
20
+ resize: () => void;
21
+ swipeTo: (index: number, options?: SwipeToOptions) => void;
22
+ /** @private */
23
+ state: SwipeState;
24
+ };
25
+ export declare type SwipeProvide = {
26
+ props: SwipeProps;
27
+ size: ComputedRef<number>;
28
+ count: ComputedRef<number>;
29
+ activeIndicator: ComputedRef<number>;
30
+ };
31
+ export declare type SwipeInstance = ComponentPublicInstance<SwipeProps, SwipeExpose>;
File without changes
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, (() => JSX.Element) | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,82 @@
1
+ import { createVNode as _createVNode } from "vue";
2
+ import { computed, nextTick, reactive, onMounted, defineComponent } from "vue";
3
+ import { createNamespace } from "../utils/index.mjs";
4
+ import { SWIPE_KEY } from "../swipe/Swipe.mjs";
5
+ import { useParent } from "@zartui/use";
6
+ import { useExpose } from "../composables/use-expose.mjs";
7
+ const [name, bem] = createNamespace("swipe-item");
8
+ var stdin_default = defineComponent({
9
+ name,
10
+ setup(props, {
11
+ slots
12
+ }) {
13
+ let rendered;
14
+ const state = reactive({
15
+ offset: 0,
16
+ inited: false,
17
+ mounted: false
18
+ });
19
+ const {
20
+ parent,
21
+ index
22
+ } = useParent(SWIPE_KEY);
23
+ if (!parent) {
24
+ if (process.env.NODE_ENV !== "production") {
25
+ console.error("[Zart] <SwipeItem> must be a child component of <Swipe>.");
26
+ }
27
+ return;
28
+ }
29
+ const style = computed(() => {
30
+ const style2 = {};
31
+ const {
32
+ vertical
33
+ } = parent.props;
34
+ if (parent.size.value) {
35
+ style2[vertical ? "height" : "width"] = `${parent.size.value}px`;
36
+ }
37
+ if (state.offset) {
38
+ style2.transform = `translate${vertical ? "Y" : "X"}(${state.offset}px)`;
39
+ }
40
+ return style2;
41
+ });
42
+ const shouldRender = computed(() => {
43
+ const {
44
+ loop,
45
+ lazyRender
46
+ } = parent.props;
47
+ if (!lazyRender || rendered) {
48
+ return true;
49
+ }
50
+ if (!state.mounted) {
51
+ return false;
52
+ }
53
+ const active = parent.activeIndicator.value;
54
+ const maxActive = parent.count.value - 1;
55
+ const prevActive = active === 0 && loop ? maxActive : active - 1;
56
+ const nextActive = active === maxActive && loop ? 0 : active + 1;
57
+ rendered = index.value === active || index.value === prevActive || index.value === nextActive;
58
+ return rendered;
59
+ });
60
+ const setOffset = (offset) => {
61
+ state.offset = offset;
62
+ };
63
+ onMounted(() => {
64
+ nextTick(() => {
65
+ state.mounted = true;
66
+ });
67
+ });
68
+ useExpose({
69
+ setOffset
70
+ });
71
+ return () => {
72
+ var _a;
73
+ return _createVNode("div", {
74
+ "class": bem(),
75
+ "style": style.value
76
+ }, [shouldRender.value ? (_a = slots.default) == null ? void 0 : _a.call(slots) : null]);
77
+ };
78
+ }
79
+ });
80
+ export {
81
+ stdin_default as default
82
+ };
@@ -0,0 +1 @@
1
+ .zt-swipe-item{position:relative;flex-shrink:0;width:100%;height:100%}
@@ -0,0 +1,7 @@
1
+ export declare const SwipeItem: import("../utils").WithInstall<import("vue").DefineComponent<{}, (() => JSX.Element) | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
2
+ export default SwipeItem;
3
+ declare module 'vue' {
4
+ interface GlobalComponents {
5
+ ZtSwipeItem: typeof SwipeItem;
6
+ }
7
+ }
@@ -0,0 +1,8 @@
1
+ import { withInstall } from "../utils/index.mjs";
2
+ import _SwipeItem from "./SwipeItem.mjs";
3
+ const SwipeItem = withInstall(_SwipeItem);
4
+ var stdin_default = SwipeItem;
5
+ export {
6
+ SwipeItem,
7
+ stdin_default as default
8
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import "../../style/base.css";
2
+ import "../../swipe/index.css";
3
+ import "../index.css";
@@ -0,0 +1,58 @@
1
+ import { ExtractPropTypes } from 'vue';
2
+ declare const switchProps: {
3
+ size: (NumberConstructor | StringConstructor)[];
4
+ loading: BooleanConstructor;
5
+ disabled: BooleanConstructor;
6
+ modelValue: import("vue").PropType<unknown>;
7
+ activeColor: StringConstructor;
8
+ inactiveColor: StringConstructor;
9
+ activeValue: {
10
+ type: import("vue").PropType<unknown>;
11
+ default: unknown;
12
+ };
13
+ inactiveValue: {
14
+ type: import("vue").PropType<unknown>;
15
+ default: unknown;
16
+ };
17
+ };
18
+ export declare type SwitchProps = ExtractPropTypes<typeof switchProps>;
19
+ declare const _default: import("vue").DefineComponent<{
20
+ size: (NumberConstructor | StringConstructor)[];
21
+ loading: BooleanConstructor;
22
+ disabled: BooleanConstructor;
23
+ modelValue: import("vue").PropType<unknown>;
24
+ activeColor: StringConstructor;
25
+ inactiveColor: StringConstructor;
26
+ activeValue: {
27
+ type: import("vue").PropType<unknown>;
28
+ default: unknown;
29
+ };
30
+ inactiveValue: {
31
+ type: import("vue").PropType<unknown>;
32
+ default: unknown;
33
+ };
34
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
35
+ size: (NumberConstructor | StringConstructor)[];
36
+ loading: BooleanConstructor;
37
+ disabled: BooleanConstructor;
38
+ modelValue: import("vue").PropType<unknown>;
39
+ activeColor: StringConstructor;
40
+ inactiveColor: StringConstructor;
41
+ activeValue: {
42
+ type: import("vue").PropType<unknown>;
43
+ default: unknown;
44
+ };
45
+ inactiveValue: {
46
+ type: import("vue").PropType<unknown>;
47
+ default: unknown;
48
+ };
49
+ }>> & {
50
+ onChange?: ((...args: any[]) => any) | undefined;
51
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
52
+ }, {
53
+ disabled: boolean;
54
+ loading: boolean;
55
+ activeValue: unknown;
56
+ inactiveValue: unknown;
57
+ }>;
58
+ export default _default;