zartui 3.0.5 → 3.0.7

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 (401) hide show
  1. package/es/button/Button.d.ts +3 -0
  2. package/es/button/Button.mjs +2 -0
  3. package/es/button/index.d.ts +2 -0
  4. package/es/cascader/Cascader.mjs +0 -2
  5. package/es/cascader/index.css +1 -1
  6. package/es/checkbox/Checkbox.d.ts +1 -1
  7. package/es/checkbox/Checker.d.ts +2 -2
  8. package/es/checkbox/index.d.ts +1 -1
  9. package/es/collapse-item/CollapseItem.mjs +3 -1
  10. package/es/date-time-picker/DateTimePicker.d.ts +1 -1
  11. package/es/date-time-picker/DateTimePicker.mjs +9 -3
  12. package/es/date-time-picker/DateTimePickerWrapper.d.ts +1 -1
  13. package/es/date-time-picker/index.d.ts +1 -1
  14. package/es/dialog/index.css +1 -1
  15. package/es/divider/index.css +1 -1
  16. package/es/dropdown-item/DropdownItem.mjs +7 -4
  17. package/es/dropdown-menu/DropdownMenu.mjs +2 -2
  18. package/es/dropdown-menu/types.d.ts +1 -0
  19. package/es/empty/Images.mjs +9 -9
  20. package/es/empty/index.css +1 -1
  21. package/es/hierarchy-select/Breadcrumb.d.ts +43 -0
  22. package/es/hierarchy-select/Breadcrumb.mjs +56 -0
  23. package/es/hierarchy-select/HierarchySelect.d.ts +104 -0
  24. package/es/hierarchy-select/HierarchySelect.mjs +221 -0
  25. package/es/hierarchy-select/index.css +1 -0
  26. package/es/hierarchy-select/index.d.ts +79 -0
  27. package/es/hierarchy-select/index.mjs +8 -0
  28. package/es/hierarchy-select/style/index.d.ts +1 -0
  29. package/es/hierarchy-select/style/index.mjs +8 -0
  30. package/es/hierarchy-select/svg/SubIcon.d.ts +1 -0
  31. package/es/hierarchy-select/svg/SubIcon.mjs +33 -0
  32. package/es/hierarchy-select/types.d.ts +7 -0
  33. package/es/hierarchy-select/types.mjs +0 -0
  34. package/es/icon/config.mjs +3 -1
  35. package/es/icon/index.css +1 -1
  36. package/es/image-preview/ImagePreview.mjs +1 -1
  37. package/es/index-anchor/IndexAnchor.d.ts +11 -0
  38. package/es/index-anchor/IndexAnchor.mjs +88 -0
  39. package/es/index-anchor/index.css +1 -0
  40. package/es/index-anchor/index.d.ts +14 -0
  41. package/es/index-anchor/index.mjs +10 -0
  42. package/es/index-anchor/style/index.d.ts +1 -0
  43. package/es/index-anchor/style/index.mjs +3 -0
  44. package/es/index-anchor/types.d.ts +11 -0
  45. package/es/index-anchor/types.mjs +0 -0
  46. package/es/index-bar/IndexBar.d.ts +64 -0
  47. package/es/index-bar/IndexBar.mjs +275 -0
  48. package/es/index-bar/index.css +1 -0
  49. package/es/index-bar/index.d.ts +50 -0
  50. package/es/index-bar/index.mjs +10 -0
  51. package/es/index-bar/style/index.d.ts +1 -0
  52. package/es/index-bar/style/index.mjs +2 -0
  53. package/es/index-bar/types.d.ts +16 -0
  54. package/es/index-bar/types.mjs +0 -0
  55. package/es/index.d.ts +8 -1
  56. package/es/index.mjs +22 -1
  57. package/es/lazyload/vue-lazyload/index.mjs +5 -0
  58. package/es/lazyload/vue-lazyload/lazy.mjs +81 -0
  59. package/es/lazyload/vue-lazyload/listener.mjs +45 -0
  60. package/es/list/List.mjs +2 -4
  61. package/es/list/index.css +1 -1
  62. package/es/locale/lang/en-US.d.ts +7 -23
  63. package/es/locale/lang/en-US.mjs +7 -23
  64. package/es/locale/lang/zh-CN.d.ts +7 -23
  65. package/es/locale/lang/zh-CN.mjs +7 -23
  66. package/es/media-picker/MediaPicker.mjs +20 -0
  67. package/es/media-picker/image/PickFileIcon.mjs +1 -1
  68. package/es/media-picker/image/PickPhotoIcon.mjs +1 -1
  69. package/es/media-picker/image/TakeAudioIcon.mjs +1 -1
  70. package/es/media-picker/image/TakePhotoIcon.mjs +1 -1
  71. package/es/media-picker/image/TakeVideoIcon.mjs +1 -1
  72. package/es/media-picker/index.css +1 -1
  73. package/es/media-picker/util/media-util.mjs +3 -0
  74. package/es/media-picker/watermark/image-processor.mjs +10 -6
  75. package/es/media-picker/watermark/resize-options.mjs +1 -0
  76. package/es/media-picker/watermark/watermark.mjs +4 -0
  77. package/es/multiple-picker/MultiplePicker.d.ts +4 -4
  78. package/es/multiple-picker/MultiplePicker.mjs +3 -3
  79. package/es/multiple-picker/MultiplePickerOptions.d.ts +4 -4
  80. package/es/multiple-picker/MultiplePickerOptions.mjs +3 -3
  81. package/es/multiple-picker/index.d.ts +3 -3
  82. package/es/notice-bar/index.css +1 -1
  83. package/es/picker/Picker.mjs +7 -4
  84. package/es/picker/PickerToolbar.mjs +1 -0
  85. package/es/popover/Popover.d.ts +13 -0
  86. package/es/popover/Popover.mjs +91 -4
  87. package/es/popover/index.css +1 -1
  88. package/es/popover/index.d.ts +9 -0
  89. package/es/popup/Popup.mjs +1 -0
  90. package/es/popup/index.css +1 -1
  91. package/es/popup/shared.mjs +12 -0
  92. package/es/radio/Radio.d.ts +1 -1
  93. package/es/radio/index.d.ts +1 -1
  94. package/es/rate/index.css +1 -1
  95. package/es/search/Search.d.ts +1 -1
  96. package/es/search/Search.mjs +1 -0
  97. package/es/search/index.d.ts +1 -1
  98. package/es/signature/Signature.mjs +13 -10
  99. package/es/signature/index.css +1 -1
  100. package/es/step/Step.mjs +10 -6
  101. package/es/step/index.css +1 -1
  102. package/es/stepper/Stepper.mjs +2 -0
  103. package/es/stepper/index.css +1 -1
  104. package/es/steps/index.css +1 -1
  105. package/es/sticky/Sticky.mjs +2 -0
  106. package/es/style/base.css +1 -1
  107. package/es/style/css-variables.css +1 -1
  108. package/es/swipe/Swipe.d.ts +3 -1
  109. package/es/swipe/Swipe.mjs +19 -2
  110. package/es/swipe/index.d.ts +3 -1
  111. package/es/swipe-cell/SwipeCell.d.ts +44 -0
  112. package/es/swipe-cell/SwipeCell.mjs +163 -0
  113. package/es/swipe-cell/index.css +1 -0
  114. package/es/swipe-cell/index.d.ts +39 -0
  115. package/es/swipe-cell/index.mjs +10 -0
  116. package/es/swipe-cell/style/index.d.ts +1 -0
  117. package/es/swipe-cell/style/index.mjs +2 -0
  118. package/es/swipe-cell/types.d.ts +9 -0
  119. package/es/swipe-cell/types.mjs +0 -0
  120. package/es/switch/index.css +1 -1
  121. package/es/tabbar-item/index.css +1 -1
  122. package/es/table/Table.d.ts +113 -0
  123. package/es/table/Table.mjs +118 -0
  124. package/es/table/index.css +1 -0
  125. package/es/table/index.d.ts +75 -0
  126. package/es/table/index.mjs +10 -0
  127. package/es/table/style/index.d.ts +1 -0
  128. package/es/table/style/index.mjs +2 -0
  129. package/es/tabs/Tabs.mjs +2 -0
  130. package/es/tabs/index.css +1 -1
  131. package/es/tag/Tag.d.ts +18 -1
  132. package/es/tag/Tag.mjs +47 -2
  133. package/es/tag/index.css +1 -1
  134. package/es/tag/index.d.ts +13 -1
  135. package/es/text-ellipsis/TextEllipsis.d.ts +76 -0
  136. package/es/text-ellipsis/TextEllipsis.mjs +118 -0
  137. package/es/text-ellipsis/index.css +1 -0
  138. package/es/text-ellipsis/index.d.ts +60 -0
  139. package/es/text-ellipsis/index.mjs +10 -0
  140. package/es/text-ellipsis/style/index.d.ts +1 -0
  141. package/es/text-ellipsis/style/index.mjs +2 -0
  142. package/es/text-ellipsis/types.d.ts +3 -0
  143. package/es/text-ellipsis/types.mjs +0 -0
  144. package/es/timeline/Timeline.d.ts +113 -0
  145. package/es/timeline/Timeline.mjs +162 -0
  146. package/es/timeline/index.css +1 -0
  147. package/es/timeline/index.d.ts +75 -0
  148. package/es/timeline/index.mjs +10 -0
  149. package/es/timeline/style/index.d.ts +1 -0
  150. package/es/timeline/style/index.mjs +4 -0
  151. package/es/uploader/Uploader.d.ts +1 -1
  152. package/es/uploader/index.d.ts +1 -1
  153. package/es/uploader/utils.mjs +1 -1
  154. package/es/utils/dom.d.ts +1 -0
  155. package/es/utils/dom.mjs +11 -0
  156. package/lib/action-sheet/index.js +4 -0
  157. package/lib/avatar/Avatar.js +4 -0
  158. package/lib/avatar/index.js +4 -0
  159. package/lib/badge/index.js +4 -0
  160. package/lib/button/Button.d.ts +3 -0
  161. package/lib/button/Button.js +2 -0
  162. package/lib/button/index.d.ts +2 -0
  163. package/lib/button/index.js +4 -0
  164. package/lib/calendar/Calendar.js +4 -0
  165. package/lib/calendar/CalendarMonth.js +4 -0
  166. package/lib/calendar/index.js +4 -0
  167. package/lib/cascader/Cascader.js +4 -2
  168. package/lib/cascader/index.css +1 -1
  169. package/lib/cascader/index.js +4 -0
  170. package/lib/cell/index.js +4 -0
  171. package/lib/cell-group/index.js +4 -0
  172. package/lib/checkbox/Checkbox.d.ts +1 -1
  173. package/lib/checkbox/Checkbox.js +4 -0
  174. package/lib/checkbox/Checker.d.ts +2 -2
  175. package/lib/checkbox/index.d.ts +1 -1
  176. package/lib/checkbox/index.js +4 -0
  177. package/lib/checkbox-group/index.js +4 -0
  178. package/lib/col/index.js +4 -0
  179. package/lib/collapse/index.js +4 -0
  180. package/lib/collapse-item/CollapseItem.js +7 -1
  181. package/lib/collapse-item/index.js +4 -0
  182. package/lib/config-provider/index.js +4 -0
  183. package/lib/date-time-picker/DateTimePicker.d.ts +1 -1
  184. package/lib/date-time-picker/DateTimePicker.js +13 -3
  185. package/lib/date-time-picker/DateTimePickerWrapper.d.ts +1 -1
  186. package/lib/date-time-picker/DateTimePickerWrapper.js +4 -0
  187. package/lib/date-time-picker/index.d.ts +1 -1
  188. package/lib/date-time-picker/index.js +4 -0
  189. package/lib/dialog/function-call.js +4 -0
  190. package/lib/dialog/index.css +1 -1
  191. package/lib/dialog/index.js +4 -0
  192. package/lib/divider/index.css +1 -1
  193. package/lib/divider/index.js +4 -0
  194. package/lib/dropdown-item/DropdownItem.js +6 -3
  195. package/lib/dropdown-item/index.js +4 -0
  196. package/lib/dropdown-menu/DropdownMenu.js +6 -2
  197. package/lib/dropdown-menu/index.js +4 -0
  198. package/lib/dropdown-menu/types.d.ts +1 -0
  199. package/lib/empty/Images.js +9 -9
  200. package/lib/empty/index.css +1 -1
  201. package/lib/empty/index.js +4 -0
  202. package/lib/field/index.js +4 -0
  203. package/lib/form/index.js +4 -0
  204. package/lib/grid/index.js +4 -0
  205. package/lib/grid-item/index.js +4 -0
  206. package/lib/hierarchy-select/Breadcrumb.d.ts +43 -0
  207. package/lib/hierarchy-select/Breadcrumb.js +85 -0
  208. package/lib/hierarchy-select/HierarchySelect.d.ts +104 -0
  209. package/lib/hierarchy-select/HierarchySelect.js +250 -0
  210. package/lib/hierarchy-select/index.css +1 -0
  211. package/lib/hierarchy-select/index.d.ts +79 -0
  212. package/lib/hierarchy-select/index.js +37 -0
  213. package/lib/hierarchy-select/style/index.d.ts +1 -0
  214. package/lib/hierarchy-select/style/index.js +8 -0
  215. package/lib/hierarchy-select/svg/SubIcon.d.ts +1 -0
  216. package/lib/hierarchy-select/svg/SubIcon.js +52 -0
  217. package/lib/hierarchy-select/types.d.ts +7 -0
  218. package/lib/hierarchy-select/types.js +15 -0
  219. package/lib/icon/config.js +3 -1
  220. package/lib/icon/index.css +1 -1
  221. package/lib/icon/index.js +4 -0
  222. package/lib/image/index.js +4 -0
  223. package/lib/image-preview/ImagePreview.js +5 -1
  224. package/lib/image-preview/function-call.js +4 -0
  225. package/lib/image-preview/index.js +4 -0
  226. package/lib/index-anchor/IndexAnchor.d.ts +11 -0
  227. package/lib/index-anchor/IndexAnchor.js +107 -0
  228. package/lib/index-anchor/index.css +1 -0
  229. package/lib/index-anchor/index.d.ts +14 -0
  230. package/lib/index-anchor/index.js +39 -0
  231. package/lib/index-anchor/style/index.d.ts +1 -0
  232. package/lib/index-anchor/style/index.js +3 -0
  233. package/lib/index-anchor/types.d.ts +11 -0
  234. package/lib/index-anchor/types.js +15 -0
  235. package/lib/index-bar/IndexBar.d.ts +64 -0
  236. package/lib/index-bar/IndexBar.js +294 -0
  237. package/lib/index-bar/index.css +1 -0
  238. package/lib/index-bar/index.d.ts +50 -0
  239. package/lib/index-bar/index.js +39 -0
  240. package/lib/index-bar/style/index.d.ts +1 -0
  241. package/lib/index-bar/style/index.js +2 -0
  242. package/lib/index-bar/types.d.ts +16 -0
  243. package/lib/index-bar/types.js +15 -0
  244. package/lib/index.css +1 -1
  245. package/lib/index.d.ts +8 -1
  246. package/lib/index.js +22 -1
  247. package/lib/lazyload/vue-lazyload/index.js +9 -0
  248. package/lib/lazyload/vue-lazyload/lazy.js +85 -0
  249. package/lib/lazyload/vue-lazyload/listener.js +45 -0
  250. package/lib/list/List.js +2 -4
  251. package/lib/list/index.css +1 -1
  252. package/lib/list/index.js +4 -0
  253. package/lib/loading/index.js +4 -0
  254. package/lib/locale/index.js +4 -0
  255. package/lib/locale/lang/en-US.d.ts +7 -23
  256. package/lib/locale/lang/en-US.js +7 -23
  257. package/lib/locale/lang/zh-CN.d.ts +7 -23
  258. package/lib/locale/lang/zh-CN.js +7 -23
  259. package/lib/media-picker/MediaPicker.js +24 -0
  260. package/lib/media-picker/image/PickFileIcon.js +1 -1
  261. package/lib/media-picker/image/PickPhotoIcon.js +1 -1
  262. package/lib/media-picker/image/TakeAudioIcon.js +1 -1
  263. package/lib/media-picker/image/TakePhotoIcon.js +1 -1
  264. package/lib/media-picker/image/TakeVideoIcon.js +1 -1
  265. package/lib/media-picker/index.css +1 -1
  266. package/lib/media-picker/index.js +4 -0
  267. package/lib/media-picker/util/media-util.js +3 -0
  268. package/lib/media-picker/watermark/image-processor.js +10 -6
  269. package/lib/media-picker/watermark/resize-options.js +1 -0
  270. package/lib/media-picker/watermark/watermark.js +4 -0
  271. package/lib/media-player/MediaPlayer.js +4 -0
  272. package/lib/media-player/index.js +4 -0
  273. package/lib/multiple-picker/MultiplePicker.d.ts +4 -4
  274. package/lib/multiple-picker/MultiplePicker.js +7 -3
  275. package/lib/multiple-picker/MultiplePickerOptions.d.ts +4 -4
  276. package/lib/multiple-picker/MultiplePickerOptions.js +3 -3
  277. package/lib/multiple-picker/index.d.ts +3 -3
  278. package/lib/multiple-picker/index.js +4 -0
  279. package/lib/nav-bar/index.js +4 -0
  280. package/lib/notice-bar/NoticeBar.js +4 -0
  281. package/lib/notice-bar/index.css +1 -1
  282. package/lib/notice-bar/index.js +4 -0
  283. package/lib/notify/function-call.js +4 -0
  284. package/lib/notify/index.js +4 -0
  285. package/lib/number-keyboard/NumberKeyboard.js +4 -0
  286. package/lib/number-keyboard/NumberKeyboardKey.js +4 -0
  287. package/lib/number-keyboard/index.js +4 -0
  288. package/lib/overlay/index.js +4 -0
  289. package/lib/password-input/index.js +4 -0
  290. package/lib/picker/Picker.js +10 -3
  291. package/lib/picker/PickerToolbar.js +1 -0
  292. package/lib/picker/index.js +4 -0
  293. package/lib/popover/Popover.d.ts +13 -0
  294. package/lib/popover/Popover.js +90 -3
  295. package/lib/popover/index.css +1 -1
  296. package/lib/popover/index.d.ts +9 -0
  297. package/lib/popover/index.js +4 -0
  298. package/lib/popup/Popup.js +1 -0
  299. package/lib/popup/index.css +1 -1
  300. package/lib/popup/index.js +4 -0
  301. package/lib/popup/shared.js +12 -0
  302. package/lib/pull-refresh/index.js +4 -0
  303. package/lib/radio/Radio.d.ts +1 -1
  304. package/lib/radio/Radio.js +4 -0
  305. package/lib/radio/index.d.ts +1 -1
  306. package/lib/radio/index.js +4 -0
  307. package/lib/radio-group/index.js +4 -0
  308. package/lib/rate/index.css +1 -1
  309. package/lib/rate/index.js +4 -0
  310. package/lib/row/index.js +4 -0
  311. package/lib/search/Search.d.ts +1 -1
  312. package/lib/search/Search.js +1 -0
  313. package/lib/search/index.d.ts +1 -1
  314. package/lib/search/index.js +4 -0
  315. package/lib/signature/Signature.js +16 -9
  316. package/lib/signature/index.css +1 -1
  317. package/lib/signature/index.js +4 -0
  318. package/lib/skeleton/index.js +4 -0
  319. package/lib/step/Step.js +10 -6
  320. package/lib/step/index.css +1 -1
  321. package/lib/step/index.js +4 -0
  322. package/lib/stepper/Stepper.js +6 -0
  323. package/lib/stepper/index.css +1 -1
  324. package/lib/stepper/index.js +4 -0
  325. package/lib/steps/index.css +1 -1
  326. package/lib/steps/index.js +4 -0
  327. package/lib/sticky/Sticky.js +2 -0
  328. package/lib/sticky/index.js +4 -0
  329. package/lib/style/base.css +1 -1
  330. package/lib/style/css-variables.css +1 -1
  331. package/lib/swipe/Swipe.d.ts +3 -1
  332. package/lib/swipe/Swipe.js +19 -2
  333. package/lib/swipe/index.d.ts +3 -1
  334. package/lib/swipe/index.js +4 -0
  335. package/lib/swipe-cell/SwipeCell.d.ts +44 -0
  336. package/lib/swipe-cell/SwipeCell.js +182 -0
  337. package/lib/swipe-cell/index.css +1 -0
  338. package/lib/swipe-cell/index.d.ts +39 -0
  339. package/lib/swipe-cell/index.js +39 -0
  340. package/lib/swipe-cell/style/index.d.ts +1 -0
  341. package/lib/swipe-cell/style/index.js +2 -0
  342. package/lib/swipe-cell/types.d.ts +9 -0
  343. package/lib/swipe-cell/types.js +15 -0
  344. package/lib/swipe-item/index.js +4 -0
  345. package/lib/switch/index.css +1 -1
  346. package/lib/switch/index.js +4 -0
  347. package/lib/tab/index.js +4 -0
  348. package/lib/tabbar/index.js +4 -0
  349. package/lib/tabbar-item/index.css +1 -1
  350. package/lib/tabbar-item/index.js +4 -0
  351. package/lib/table/Table.d.ts +113 -0
  352. package/lib/table/Table.js +137 -0
  353. package/lib/table/index.css +1 -0
  354. package/lib/table/index.d.ts +75 -0
  355. package/lib/table/index.js +39 -0
  356. package/lib/table/style/index.d.ts +1 -0
  357. package/lib/table/style/index.js +2 -0
  358. package/lib/tabs/Tabs.js +6 -0
  359. package/lib/tabs/index.css +1 -1
  360. package/lib/tabs/index.js +4 -0
  361. package/lib/tag/Tag.d.ts +18 -1
  362. package/lib/tag/Tag.js +47 -2
  363. package/lib/tag/index.css +1 -1
  364. package/lib/tag/index.d.ts +13 -1
  365. package/lib/tag/index.js +4 -0
  366. package/lib/text-ellipsis/TextEllipsis.d.ts +76 -0
  367. package/lib/text-ellipsis/TextEllipsis.js +137 -0
  368. package/lib/text-ellipsis/index.css +1 -0
  369. package/lib/text-ellipsis/index.d.ts +60 -0
  370. package/lib/text-ellipsis/index.js +39 -0
  371. package/lib/text-ellipsis/style/index.d.ts +1 -0
  372. package/lib/text-ellipsis/style/index.js +2 -0
  373. package/lib/text-ellipsis/types.d.ts +3 -0
  374. package/lib/text-ellipsis/types.js +15 -0
  375. package/lib/time-picker/TimePicker.js +4 -0
  376. package/lib/time-picker/TimePickerColumn.js +4 -0
  377. package/lib/time-picker/index.js +4 -0
  378. package/lib/timeline/Timeline.d.ts +113 -0
  379. package/lib/timeline/Timeline.js +191 -0
  380. package/lib/timeline/index.css +1 -0
  381. package/lib/timeline/index.d.ts +75 -0
  382. package/lib/timeline/index.js +39 -0
  383. package/lib/timeline/style/index.d.ts +1 -0
  384. package/lib/timeline/style/index.js +4 -0
  385. package/lib/toast/function-call.js +4 -0
  386. package/lib/toast/index.js +4 -0
  387. package/lib/uploader/Uploader.d.ts +1 -1
  388. package/lib/uploader/Uploader.js +4 -0
  389. package/lib/uploader/index.d.ts +1 -1
  390. package/lib/uploader/index.js +4 -0
  391. package/lib/uploader/utils.js +1 -1
  392. package/lib/utils/create.js +4 -0
  393. package/lib/utils/dom.d.ts +1 -0
  394. package/lib/utils/dom.js +11 -0
  395. package/lib/web-types.json +1 -1
  396. package/lib/zartui.cjs.js +2619 -1019
  397. package/lib/zartui.es.js +2671 -1071
  398. package/lib/zartui.js +3354 -1218
  399. package/lib/zartui.min.js +1 -1
  400. package/package.json +24 -23
  401. package/README.md +0 -25
@@ -0,0 +1,64 @@
1
+ import { type PropType, type InjectionKey, type ExtractPropTypes } from 'vue';
2
+ import { type Numeric } from '../utils';
3
+ import { IndexBarProvide } from './types';
4
+ declare function genAlphabet(): string[];
5
+ export declare const indexBarProps: {
6
+ sticky: {
7
+ type: BooleanConstructor;
8
+ default: true;
9
+ };
10
+ zIndex: (NumberConstructor | StringConstructor)[];
11
+ teleport: PropType<string | import("vue").RendererElement | null | undefined>;
12
+ highlightColor: StringConstructor;
13
+ stickyOffsetTop: {
14
+ type: NumberConstructor;
15
+ default: number;
16
+ };
17
+ indexList: {
18
+ type: PropType<Numeric[]>;
19
+ default: typeof genAlphabet;
20
+ };
21
+ };
22
+ export declare type IndexBarProps = ExtractPropTypes<typeof indexBarProps>;
23
+ export declare const INDEX_BAR_KEY: InjectionKey<IndexBarProvide>;
24
+ declare const _default: import("vue").DefineComponent<{
25
+ sticky: {
26
+ type: BooleanConstructor;
27
+ default: true;
28
+ };
29
+ zIndex: (NumberConstructor | StringConstructor)[];
30
+ teleport: PropType<string | import("vue").RendererElement | null | undefined>;
31
+ highlightColor: StringConstructor;
32
+ stickyOffsetTop: {
33
+ type: NumberConstructor;
34
+ default: number;
35
+ };
36
+ indexList: {
37
+ type: PropType<Numeric[]>;
38
+ default: typeof genAlphabet;
39
+ };
40
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "change")[], "select" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
41
+ sticky: {
42
+ type: BooleanConstructor;
43
+ default: true;
44
+ };
45
+ zIndex: (NumberConstructor | StringConstructor)[];
46
+ teleport: PropType<string | import("vue").RendererElement | null | undefined>;
47
+ highlightColor: StringConstructor;
48
+ stickyOffsetTop: {
49
+ type: NumberConstructor;
50
+ default: number;
51
+ };
52
+ indexList: {
53
+ type: PropType<Numeric[]>;
54
+ default: typeof genAlphabet;
55
+ };
56
+ }>> & {
57
+ onChange?: ((...args: any[]) => any) | undefined;
58
+ onSelect?: ((...args: any[]) => any) | undefined;
59
+ }, {
60
+ sticky: boolean;
61
+ stickyOffsetTop: number;
62
+ indexList: Numeric[];
63
+ }>;
64
+ export default _default;
@@ -0,0 +1,294 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name2 in all)
7
+ __defProp(target, name2, { get: all[name2], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var stdin_exports = {};
19
+ __export(stdin_exports, {
20
+ INDEX_BAR_KEY: () => INDEX_BAR_KEY,
21
+ default: () => stdin_default,
22
+ indexBarProps: () => indexBarProps
23
+ });
24
+ module.exports = __toCommonJS(stdin_exports);
25
+ var import_vue = require("vue");
26
+ var import_vue2 = require("vue");
27
+ var import_utils = require("../utils");
28
+ var import_use = require("@zartui/use");
29
+ var import_use_touch = require("../composables/use-touch");
30
+ var import_use_expose = require("../composables/use-expose");
31
+ function genAlphabet() {
32
+ const charCodeOfA = "A".charCodeAt(0);
33
+ const indexList = Array(26).fill("").map((_, i) => String.fromCharCode(charCodeOfA + i));
34
+ return indexList;
35
+ }
36
+ const [name, bem] = (0, import_utils.createNamespace)("index-bar");
37
+ const indexBarProps = {
38
+ sticky: import_utils.truthProp,
39
+ zIndex: import_utils.numericProp,
40
+ teleport: [String, Object],
41
+ highlightColor: String,
42
+ stickyOffsetTop: (0, import_utils.makeNumberProp)(0),
43
+ indexList: {
44
+ type: Array,
45
+ default: genAlphabet
46
+ }
47
+ };
48
+ const INDEX_BAR_KEY = Symbol(name);
49
+ var stdin_default = (0, import_vue2.defineComponent)({
50
+ name,
51
+ props: indexBarProps,
52
+ emits: ["select", "change"],
53
+ setup(props, {
54
+ emit,
55
+ slots
56
+ }) {
57
+ const root = (0, import_vue2.ref)();
58
+ const sidebar = (0, import_vue2.ref)();
59
+ const activeAnchor = (0, import_vue2.ref)("");
60
+ const touchIndex = (0, import_vue2.ref)("");
61
+ const touch = (0, import_use_touch.useTouch)();
62
+ const scrollParent = (0, import_use.useScrollParent)(root);
63
+ const {
64
+ children,
65
+ linkChildren
66
+ } = (0, import_use.useChildren)(INDEX_BAR_KEY);
67
+ let selectActiveIndex;
68
+ linkChildren({
69
+ props
70
+ });
71
+ const sidebarStyle = (0, import_vue2.computed)(() => {
72
+ if ((0, import_utils.isDef)(props.zIndex)) {
73
+ return {
74
+ zIndex: +props.zIndex + 1
75
+ };
76
+ }
77
+ });
78
+ const highlightStyle = (0, import_vue2.computed)(() => {
79
+ if (props.highlightColor) {
80
+ return {
81
+ color: props.highlightColor
82
+ };
83
+ }
84
+ });
85
+ const getActiveAnchor = (scrollTop, rects) => {
86
+ for (let i = children.length - 1; i >= 0; i--) {
87
+ const prevHeight = i > 0 ? rects[i - 1].height : 0;
88
+ const reachTop = props.sticky ? prevHeight + props.stickyOffsetTop : 0;
89
+ if (scrollTop + reachTop >= rects[i].top) {
90
+ return i;
91
+ }
92
+ }
93
+ return -1;
94
+ };
95
+ const getMatchAnchor = (index) => children.find((item) => String(item.index) === index);
96
+ const onScroll = () => {
97
+ if ((0, import_utils.isHidden)(root)) {
98
+ return;
99
+ }
100
+ const {
101
+ sticky,
102
+ indexList
103
+ } = props;
104
+ const scrollTop = (0, import_utils.getScrollTop)(scrollParent.value);
105
+ const scrollParentRect = (0, import_use.useRect)(scrollParent);
106
+ const rects = children.map((item) => item.getRect(scrollParent.value, scrollParentRect));
107
+ let active = -1;
108
+ if (selectActiveIndex) {
109
+ const match = getMatchAnchor(selectActiveIndex);
110
+ if (match) {
111
+ const rect = match.getRect(scrollParent.value, scrollParentRect);
112
+ active = getActiveAnchor(rect.top, rects);
113
+ }
114
+ } else {
115
+ active = getActiveAnchor(scrollTop, rects);
116
+ }
117
+ activeAnchor.value = indexList[active];
118
+ if (sticky) {
119
+ children.forEach((item, index) => {
120
+ const {
121
+ state,
122
+ $el
123
+ } = item;
124
+ if (index === active || index === active - 1) {
125
+ const rect = $el.getBoundingClientRect();
126
+ state.left = rect.left;
127
+ state.width = rect.width;
128
+ } else {
129
+ state.left = null;
130
+ state.width = null;
131
+ }
132
+ if (index === active) {
133
+ state.active = true;
134
+ state.top = Math.max(props.stickyOffsetTop, rects[index].top - scrollTop) + scrollParentRect.top;
135
+ } else if (index === active - 1 && selectActiveIndex === "") {
136
+ const activeItemTop = rects[active].top - scrollTop;
137
+ state.active = activeItemTop > 0;
138
+ state.top = activeItemTop + scrollParentRect.top - rects[index].height;
139
+ } else {
140
+ state.active = false;
141
+ }
142
+ });
143
+ }
144
+ selectActiveIndex = "";
145
+ };
146
+ const init = () => {
147
+ (0, import_vue2.nextTick)(onScroll);
148
+ };
149
+ (0, import_use.useEventListener)("scroll", onScroll, {
150
+ target: scrollParent,
151
+ passive: true
152
+ });
153
+ (0, import_vue2.onMounted)(init);
154
+ (0, import_vue2.watch)(() => props.indexList, init);
155
+ (0, import_vue2.watch)(activeAnchor, (value) => {
156
+ if (value) {
157
+ emit("change", value);
158
+ }
159
+ });
160
+ const scrollTo = (index) => {
161
+ selectActiveIndex = String(index);
162
+ const match = getMatchAnchor(selectActiveIndex);
163
+ if (match) {
164
+ const scrollTop = (0, import_utils.getScrollTop)(scrollParent.value);
165
+ const scrollParentRect = (0, import_use.useRect)(scrollParent);
166
+ const {
167
+ offsetHeight
168
+ } = document.documentElement;
169
+ match.$el.scrollIntoView();
170
+ if (scrollTop === offsetHeight - scrollParentRect.height) {
171
+ onScroll();
172
+ return;
173
+ }
174
+ if (props.sticky && props.stickyOffsetTop) {
175
+ (0, import_utils.setRootScrollTop)((0, import_utils.getRootScrollTop)() - props.stickyOffsetTop);
176
+ }
177
+ emit("select", match.index);
178
+ }
179
+ };
180
+ const scrollToElement = (element) => {
181
+ const {
182
+ index
183
+ } = element.dataset;
184
+ if (index) {
185
+ scrollTo(index);
186
+ }
187
+ };
188
+ const onClickSidebar = (event) => {
189
+ scrollToElement(event.target);
190
+ };
191
+ const renderIndexes = () => props.indexList.map((index) => {
192
+ const active = index === activeAnchor.value;
193
+ const touch2 = index === touchIndex.value;
194
+ return (0, import_vue.createVNode)("div", {
195
+ "class": bem("index"),
196
+ "style": active ? highlightStyle.value : void 0
197
+ }, [(0, import_vue.createVNode)("div", {
198
+ "class": bem("touch", {
199
+ active: touch2
200
+ })
201
+ }, [(0, import_vue.createVNode)("div", {
202
+ "class": bem("touch-text")
203
+ }, [index]), (0, import_vue.createVNode)("svg", {
204
+ "class": bem("icon"),
205
+ "xmlns": "http://www.w3.org/2000/svg",
206
+ "viewBox": "0 0 20 32"
207
+ }, [(0, import_vue.createVNode)("defs", null, [(0, import_vue.createVNode)("path", {
208
+ "id": "7rkhbmqvk__gc482iacwa",
209
+ "d": "M0 0H20V32H0z"
210
+ }, null)]), (0, import_vue.createVNode)("g", {
211
+ "fill": "none",
212
+ "fill-rule": "evenodd"
213
+ }, [(0, import_vue.createVNode)("path", {
214
+ "d": "M-1,0 C7.836556,-1.623249e-15 15,7.163444 15,16 C15,24.836556 7.836556,32 -1,32 L-1,32 L-1,32 L-1,0 Z",
215
+ "fill": "#8093AB",
216
+ "mask": "url(#7rkhbmqvk__9ahlxl93tb)"
217
+ }, null), (0, import_vue.createVNode)("path", {
218
+ "d": "M12.2406862,7.01475705 L19.4355101,15.3463801 C19.7597461,15.7218113 19.7597461,16.2781887 19.4355101,16.6536199 L12.2406862,24.9852429 C13.9822172,22.423901 15,19.3308084 15,16 C15,12.6691916 13.9822172,9.57609904 12.2406862,7.01475705 Z",
219
+ "fill": "#8093AB",
220
+ "mask": "url(#7rkhbmqvk__9ahlxl93tb)"
221
+ }, null)])])]), (0, import_vue.createVNode)("div", {
222
+ "data-index": index,
223
+ "onClick": onClickSidebar,
224
+ "class": bem("index", {
225
+ active,
226
+ touch: touch2
227
+ })
228
+ }, [index])]);
229
+ });
230
+ let touchActiveIndex;
231
+ const onTouchStart = (event) => {
232
+ const {
233
+ clientX,
234
+ clientY
235
+ } = event.touches[0];
236
+ const target = document.elementFromPoint(clientX, clientY);
237
+ if (target) {
238
+ const {
239
+ index = ""
240
+ } = target.dataset;
241
+ touchIndex.value = index;
242
+ }
243
+ touch.start(event);
244
+ };
245
+ const onTouchend = () => {
246
+ touchIndex.value = "";
247
+ };
248
+ const onTouchMove = (event) => {
249
+ touch.move(event);
250
+ if (touch.isVertical()) {
251
+ (0, import_utils.preventDefault)(event);
252
+ const {
253
+ clientX,
254
+ clientY
255
+ } = event.touches[0];
256
+ const target = document.elementFromPoint(clientX, clientY);
257
+ if (target) {
258
+ const {
259
+ index
260
+ } = target.dataset;
261
+ if (index && touchActiveIndex !== index) {
262
+ touchActiveIndex = index;
263
+ touchIndex.value = index;
264
+ scrollToElement(target);
265
+ }
266
+ }
267
+ }
268
+ };
269
+ const renderSidebar = () => (0, import_vue.createVNode)("div", {
270
+ "ref": sidebar,
271
+ "class": bem("sidebar"),
272
+ "style": sidebarStyle.value,
273
+ "onTouchstartPassive": onTouchStart,
274
+ "onTouchend": onTouchend
275
+ }, [renderIndexes()]);
276
+ (0, import_use_expose.useExpose)({
277
+ scrollTo
278
+ });
279
+ (0, import_use.useEventListener)("touchmove", onTouchMove, {
280
+ target: sidebar
281
+ });
282
+ return () => {
283
+ var _a;
284
+ return (0, import_vue.createVNode)("div", {
285
+ "ref": root,
286
+ "class": bem()
287
+ }, [props.teleport ? (0, import_vue.createVNode)(import_vue2.Teleport, {
288
+ "to": props.teleport
289
+ }, {
290
+ default: () => [renderSidebar()]
291
+ }) : renderSidebar(), (_a = slots.default) == null ? void 0 : _a.call(slots)]);
292
+ };
293
+ }
294
+ });
@@ -0,0 +1 @@
1
+ :root{--zt-index-bar-sidebar-z-index: 2;--zt-index-bar-index-font-size: var(--zt-font-size-xs);--zt-index-bar-index-line-height: var(--zt-line-height-md);--zt-index-bar-index-active-color: var(--zt-primary-color)}.zt-index-bar__sidebar{position:fixed;top:50%;right:var(--zt-padding-xs);z-index:var(--zt-index-bar-sidebar-z-index);display:flex;flex-direction:column;align-items:end;text-align:center;transform:translateY(-50%);cursor:pointer;-webkit-user-select:none;user-select:none}.zt-index-bar__index{position:relative;color:var(--zt-text-color);padding:0 var(--zt-padding-base);font-size:var(--zt-index-bar-index-font-size);line-height:var(--zt-index-bar-index-line-height);display:flex;height:20px}.zt-index-bar__index--active{color:var(--zt-primary-color);font-weight:700}.zt-index-bar__index--touch{display:inline-block;box-sizing:border-box;padding:0 4px;min-width:var(--zt-index-bar-index-line-height);color:var(--zt-white);background:var(--zt-primary-color);border-radius:10px}.zt-index-bar__touch{display:none}.zt-index-bar__touch-text{position:relative;right:-1px;height:32px;line-height:32px;border-radius:16px 0 0 16px;padding:0 0 0 14px;font-size:16px;color:var(--zt-white);text-align:center;background:#8093ab}.zt-index-bar__touch--active{display:flex;position:relative;top:-6px;right:8px}.zt-index-bar__icon{position:relative;width:20px;height:32px}
@@ -0,0 +1,50 @@
1
+ import { IndexBarProps } from './IndexBar';
2
+ export declare const IndexBar: import("../utils").WithInstall<import("vue").DefineComponent<{
3
+ sticky: {
4
+ type: BooleanConstructor;
5
+ default: true;
6
+ };
7
+ zIndex: (NumberConstructor | StringConstructor)[];
8
+ teleport: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
9
+ highlightColor: StringConstructor;
10
+ stickyOffsetTop: {
11
+ type: NumberConstructor;
12
+ default: number;
13
+ };
14
+ indexList: {
15
+ type: import("vue").PropType<import("../utils").Numeric[]>;
16
+ default: () => string[];
17
+ };
18
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "change")[], "select" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
19
+ sticky: {
20
+ type: BooleanConstructor;
21
+ default: true;
22
+ };
23
+ zIndex: (NumberConstructor | StringConstructor)[];
24
+ teleport: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
25
+ highlightColor: StringConstructor;
26
+ stickyOffsetTop: {
27
+ type: NumberConstructor;
28
+ default: number;
29
+ };
30
+ indexList: {
31
+ type: import("vue").PropType<import("../utils").Numeric[]>;
32
+ default: () => string[];
33
+ };
34
+ }>> & {
35
+ onChange?: ((...args: any[]) => any) | undefined;
36
+ onSelect?: ((...args: any[]) => any) | undefined;
37
+ }, {
38
+ sticky: boolean;
39
+ stickyOffsetTop: number;
40
+ indexList: import("../utils").Numeric[];
41
+ }>>;
42
+ export default IndexBar;
43
+ export { indexBarProps } from './IndexBar';
44
+ export type { IndexBarProps };
45
+ export type { IndexBarInstance, IndexBarThemeVars } from './types';
46
+ declare module 'vue' {
47
+ interface GlobalComponents {
48
+ ZtIndexBar: typeof IndexBar;
49
+ }
50
+ }
@@ -0,0 +1,39 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var stdin_exports = {};
29
+ __export(stdin_exports, {
30
+ IndexBar: () => IndexBar,
31
+ default: () => stdin_default,
32
+ indexBarProps: () => import_IndexBar2.indexBarProps
33
+ });
34
+ module.exports = __toCommonJS(stdin_exports);
35
+ var import_utils = require("../utils");
36
+ var import_IndexBar = __toESM(require("./IndexBar"));
37
+ var import_IndexBar2 = require("./IndexBar");
38
+ const IndexBar = (0, import_utils.withInstall)(import_IndexBar.default);
39
+ var stdin_default = IndexBar;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ require("../../style/base.css");
2
+ require("../index.css");
@@ -0,0 +1,16 @@
1
+ import type { ComponentPublicInstance } from 'vue';
2
+ import type { Numeric } from '../utils';
3
+ import type { IndexBarProps } from './IndexBar';
4
+ export declare type IndexBarProvide = {
5
+ props: IndexBarProps;
6
+ };
7
+ export declare type IndexBarExpose = {
8
+ scrollTo: (index: Numeric) => void;
9
+ };
10
+ export declare type IndexBarInstance = ComponentPublicInstance<IndexBarProps, IndexBarExpose>;
11
+ export declare type IndexBarThemeVars = {
12
+ indexBarSidebarZIndex?: number | string;
13
+ indexBarIndexFontSize?: string;
14
+ indexBarIndexLineHeight?: number | string;
15
+ indexBarIndexActiveColor?: string;
16
+ };
@@ -0,0 +1,15 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var stdin_exports = {};
15
+ module.exports = __toCommonJS(stdin_exports);