@rockshin/tao-ui 0.0.59 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (420) hide show
  1. package/README.md +5 -1
  2. package/component-manifest.json +1 -1
  3. package/dist/components/affix/affix.css +1 -1
  4. package/dist/components/affix/affix.d.ts +1 -0
  5. package/dist/components/affix/affix.js +18 -17
  6. package/dist/components/alert/alert.css +123 -119
  7. package/dist/components/alert/alert.js +78 -188
  8. package/dist/components/app/app-modals.js +49 -98
  9. package/dist/components/app/app-notices.d.ts +2 -2
  10. package/dist/components/app/app-notices.js +294 -243
  11. package/dist/components/app/app-types.d.ts +6 -3
  12. package/dist/components/app/app.css +185 -183
  13. package/dist/components/app/app.js +1 -1
  14. package/dist/components/auto-complete/auto-complete.css +30 -28
  15. package/dist/components/auto-complete/auto-complete.d.ts +3 -1
  16. package/dist/components/auto-complete/auto-complete.js +2 -1
  17. package/dist/components/badge/badge.js +42 -127
  18. package/dist/components/border-beam/border-beam.css +1 -1
  19. package/dist/components/border-beam/border-beam.d.ts +1 -0
  20. package/dist/components/border-beam/border-beam.js +1 -0
  21. package/dist/components/breadcrumb/breadcrumb.css +123 -120
  22. package/dist/components/breadcrumb/breadcrumb.js +160 -265
  23. package/dist/components/button/button.d.ts +1 -1
  24. package/dist/components/button/button.js +52 -151
  25. package/dist/components/calendar/calendar.js +28 -27
  26. package/dist/components/card/card-tabs.d.ts +56 -5
  27. package/dist/components/card/card-tabs.js +214 -468
  28. package/dist/components/card/card.d.ts +1 -2
  29. package/dist/components/card/card.js +64 -226
  30. package/dist/components/carousel/carousel.css +1 -1
  31. package/dist/components/carousel/carousel.d.ts +59 -4
  32. package/dist/components/carousel/carousel.js +299 -243
  33. package/dist/components/cascader/cascader.css +186 -184
  34. package/dist/components/cascader/cascader.d.ts +3 -1
  35. package/dist/components/cascader/cascader.js +29 -34
  36. package/dist/components/checkbox/checkbox.css +93 -90
  37. package/dist/components/checkbox/checkbox.d.ts +1 -1
  38. package/dist/components/checkbox/checkbox.js +171 -499
  39. package/dist/components/collapse/collapse-panels.js +145 -400
  40. package/dist/components/collapse/collapse.css +172 -170
  41. package/dist/components/collapse/collapse.d.ts +1 -1
  42. package/dist/components/collapse/collapse.js +62 -181
  43. package/dist/components/color-picker/color-picker.css +1 -1
  44. package/dist/components/color-picker/color-picker.js +418 -981
  45. package/dist/components/context-menu/context-menu.css +4 -4
  46. package/dist/components/context-menu/context-menu.d.ts +3 -1
  47. package/dist/components/context-menu/context-menu.js +54 -135
  48. package/dist/components/date-picker/calendar/calendar-grid.js +41 -41
  49. package/dist/components/date-picker/calendar/calendar-header.js +171 -337
  50. package/dist/components/date-picker/calendar/month-grid.js +33 -103
  51. package/dist/components/date-picker/calendar/time-panel.js +84 -209
  52. package/dist/components/date-picker/calendar/year-grid.js +36 -105
  53. package/dist/components/date-picker/date-localization.js +1 -1
  54. package/dist/components/date-picker/date-picker.css +599 -642
  55. package/dist/components/date-picker/date-picker.d.ts +2 -1
  56. package/dist/components/date-picker/date-picker.js +96 -105
  57. package/dist/components/date-picker/presets.js +12 -37
  58. package/dist/components/date-picker/range-picker.d.ts +2 -1
  59. package/dist/components/date-picker/range-picker.js +222 -255
  60. package/dist/components/date-picker/types.d.ts +2 -1
  61. package/dist/components/descriptions/descriptions.css +1 -1
  62. package/dist/components/descriptions/descriptions.js +30 -39
  63. package/dist/components/drawer/drawer.css +202 -200
  64. package/dist/components/drawer/drawer.js +28 -34
  65. package/dist/components/dropdown/dropdown-core.d.ts +32 -0
  66. package/dist/components/dropdown/dropdown-core.js +156 -0
  67. package/dist/components/dropdown/dropdown.css +38 -36
  68. package/dist/components/dropdown/dropdown.d.ts +4 -30
  69. package/dist/components/dropdown/dropdown.js +91 -271
  70. package/dist/components/empty/empty.css +30 -28
  71. package/dist/components/empty/empty.js +81 -236
  72. package/dist/components/float-button/float-button.css +1 -1
  73. package/dist/components/float-button/float-button.js +38 -48
  74. package/dist/components/form/field-control.js +2 -3
  75. package/dist/components/form/form-item.js +67 -129
  76. package/dist/components/form/form.css +36 -34
  77. package/dist/components/form/form.d.ts +1 -1
  78. package/dist/components/form/form.js +29 -100
  79. package/dist/components/form/index.d.ts +1 -1
  80. package/dist/components/form/use-form.js +48 -66
  81. package/dist/components/form-actions/form-actions.d.ts +1 -0
  82. package/dist/components/form-actions/form-actions.js +10 -36
  83. package/dist/components/form-field/form-field-view.d.ts +1 -0
  84. package/dist/components/form-field/form-field-view.js +81 -288
  85. package/dist/components/form-field/form-field.js +13 -31
  86. package/dist/components/form-field/form.css +74 -72
  87. package/dist/components/form-section/form-section.d.ts +1 -0
  88. package/dist/components/form-section/form-section.js +38 -91
  89. package/dist/components/image/image-icons.js +16 -31
  90. package/dist/components/image/image.css +1 -1
  91. package/dist/components/image/image.js +298 -911
  92. package/dist/components/input/base-input.d.ts +3 -1
  93. package/dist/components/input/base-input.js +8 -7
  94. package/dist/components/input/input-shared.css +62 -60
  95. package/dist/components/input/input-shared.d.ts +1 -1
  96. package/dist/components/input/input-shared.js +56 -100
  97. package/dist/components/input/input.css +222 -220
  98. package/dist/components/input/otp.d.ts +2 -1
  99. package/dist/components/input/otp.js +143 -324
  100. package/dist/components/input/password.js +12 -67
  101. package/dist/components/input/search.js +13 -13
  102. package/dist/components/input-number/input-number.d.ts +4 -2
  103. package/dist/components/input-number/input-number.js +30 -137
  104. package/dist/components/list/list-pagination.css +107 -105
  105. package/dist/components/list/list-pagination.d.ts +56 -5
  106. package/dist/components/list/list-pagination.js +249 -316
  107. package/dist/components/list/list.css +179 -177
  108. package/dist/components/list/list.js +170 -604
  109. package/dist/components/listy/listy.css +55 -53
  110. package/dist/components/listy/listy.d.ts +43 -4
  111. package/dist/components/listy/listy.js +198 -216
  112. package/dist/components/masonry/masonry.css +1 -1
  113. package/dist/components/masonry/masonry.d.ts +1 -0
  114. package/dist/components/masonry/masonry.js +90 -244
  115. package/dist/components/mentions/mentions.css +153 -151
  116. package/dist/components/mentions/mentions.d.ts +53 -11
  117. package/dist/components/mentions/mentions.js +291 -75
  118. package/dist/components/menu/menu-render.d.ts +7 -0
  119. package/dist/components/menu/menu-render.js +156 -302
  120. package/dist/components/menu/menu.css +142 -140
  121. package/dist/components/modal/confirm-dialog.js +19 -24
  122. package/dist/components/modal/modal.css +165 -162
  123. package/dist/components/modal/modal.js +285 -731
  124. package/dist/components/modal/use-modal.js +25 -25
  125. package/dist/components/pagination/pagination.css +134 -131
  126. package/dist/components/pagination/pagination.d.ts +4 -3
  127. package/dist/components/pagination/pagination.js +138 -281
  128. package/dist/components/popconfirm/popconfirm.css +38 -36
  129. package/dist/components/popconfirm/popconfirm.js +105 -288
  130. package/dist/components/popover/popover.css +89 -87
  131. package/dist/components/popover/popover.js +189 -469
  132. package/dist/components/progress/progress.css +153 -151
  133. package/dist/components/progress/progress.js +34 -43
  134. package/dist/components/qr-code/qr-code.css +36 -34
  135. package/dist/components/qr-code/qr-code.js +83 -277
  136. package/dist/components/radio/radio.css +95 -92
  137. package/dist/components/radio/radio.d.ts +1 -1
  138. package/dist/components/radio/radio.js +114 -376
  139. package/dist/components/rate/rate.css +80 -78
  140. package/dist/components/rate/rate.d.ts +34 -6
  141. package/dist/components/rate/rate.js +160 -244
  142. package/dist/components/result/result.css +59 -57
  143. package/dist/components/result/result.d.ts +1 -0
  144. package/dist/components/result/result.js +118 -291
  145. package/dist/components/scroll-area/scroll-area.css +160 -148
  146. package/dist/components/scroll-area/scroll-area.js +284 -488
  147. package/dist/components/segmented/segmented.css +1 -1
  148. package/dist/components/segmented/segmented.js +59 -58
  149. package/dist/components/select/mobile-select.css +166 -164
  150. package/dist/components/select/mobile-select.js +48 -131
  151. package/dist/components/select/select-icons.js +59 -128
  152. package/dist/components/select/select-model.js +1 -1
  153. package/dist/components/select/select-searchable-list.js +19 -19
  154. package/dist/components/select/select-tags.js +70 -156
  155. package/dist/components/select/select-types.d.ts +2 -1
  156. package/dist/components/select/select.css +509 -506
  157. package/dist/components/select/select.d.ts +1 -0
  158. package/dist/components/select/select.js +67 -65
  159. package/dist/components/select/use-select-selection.js +181 -261
  160. package/dist/components/skeleton/skeleton.css +105 -103
  161. package/dist/components/skeleton/skeleton.js +140 -399
  162. package/dist/components/slider/slider.css +160 -158
  163. package/dist/components/slider/slider.d.ts +45 -6
  164. package/dist/components/slider/slider.js +359 -74
  165. package/dist/components/sonner/index.d.ts +1 -1
  166. package/dist/components/sonner/sonner.css +190 -182
  167. package/dist/components/sonner/sonner.js +12 -11
  168. package/dist/components/spinner/spinner.css +80 -76
  169. package/dist/components/spinner/spinner.d.ts +1 -1
  170. package/dist/components/spinner/spinner.js +75 -219
  171. package/dist/components/splitter/splitter.css +157 -154
  172. package/dist/components/splitter/splitter.js +271 -448
  173. package/dist/components/statistic/statistic.css +1 -1
  174. package/dist/components/statistic/statistic.js +121 -406
  175. package/dist/components/status-icon/status-icon.js +14 -26
  176. package/dist/components/steps/steps-icons.js +63 -100
  177. package/dist/components/steps/steps.css +817 -807
  178. package/dist/components/steps/steps.d.ts +1 -1
  179. package/dist/components/steps/steps.js +38 -94
  180. package/dist/components/steps/use-display-steps.js +21 -54
  181. package/dist/components/switch/switch-touch.css +17 -15
  182. package/dist/components/switch/switch.css +192 -190
  183. package/dist/components/switch/switch.js +63 -196
  184. package/dist/components/table/table-filter.d.ts +3 -1
  185. package/dist/components/table/table-filter.js +72 -133
  186. package/dist/components/table/table-icons.js +77 -152
  187. package/dist/components/table/table-summary.js +30 -77
  188. package/dist/components/table/table-types.d.ts +2 -1
  189. package/dist/components/table/table.css +468 -465
  190. package/dist/components/table/table.js +86 -84
  191. package/dist/components/table/use-table-data.js +137 -248
  192. package/dist/components/tabs/tabs.css +123 -120
  193. package/dist/components/tabs/tabs.d.ts +4 -3
  194. package/dist/components/tabs/tabs.js +157 -322
  195. package/dist/components/tag/tag.css +231 -221
  196. package/dist/components/tag/tag.js +110 -248
  197. package/dist/components/textarea/textarea.css +2 -1
  198. package/dist/components/textarea/textarea.d.ts +3 -1
  199. package/dist/components/textarea/textarea.js +16 -15
  200. package/dist/components/time-picker/time-picker.d.ts +1 -0
  201. package/dist/components/time-picker/time-picker.js +91 -221
  202. package/dist/components/timeline/timeline.css +1 -1
  203. package/dist/components/timeline/timeline.js +17 -17
  204. package/dist/components/tooltip/tooltip.css +79 -77
  205. package/dist/components/tooltip/tooltip.d.ts +1 -1
  206. package/dist/components/tooltip/tooltip.js +111 -263
  207. package/dist/components/tour/tour.css +1 -1
  208. package/dist/components/tour/tour.d.ts +59 -6
  209. package/dist/components/tour/tour.js +343 -622
  210. package/dist/components/transfer/transfer-list.js +19 -19
  211. package/dist/components/transfer/transfer-parts.js +63 -139
  212. package/dist/components/transfer/transfer.css +192 -190
  213. package/dist/components/transfer/transfer.js +57 -56
  214. package/dist/components/tree/tree-check.js +25 -32
  215. package/dist/components/tree/tree-keyboard.js +1 -1
  216. package/dist/components/tree/tree.css +204 -200
  217. package/dist/components/tree/tree.js +139 -277
  218. package/dist/components/tree-select/select-engine.css +200 -197
  219. package/dist/components/tree-select/select-engine.js +11 -38
  220. package/dist/components/tree-select/tree-select.css +21 -19
  221. package/dist/components/tree-select/tree-select.d.ts +3 -1
  222. package/dist/components/tree-select/tree-select.js +12 -10
  223. package/dist/components/upload/upload.js +193 -308
  224. package/dist/components/watermark/watermark-context.js +8 -14
  225. package/dist/components/watermark/watermark.css +1 -1
  226. package/dist/components/watermark/watermark.js +209 -400
  227. package/dist/docs/components/stack.doc.js +1 -1
  228. package/dist/docs/components/table.doc.js +1 -1
  229. package/dist/entries/affix.d.ts +0 -2
  230. package/dist/entries/affix.js +0 -2
  231. package/dist/entries/alert.d.ts +0 -2
  232. package/dist/entries/alert.js +0 -2
  233. package/dist/entries/app.d.ts +0 -2
  234. package/dist/entries/app.js +0 -2
  235. package/dist/entries/auto-complete.d.ts +0 -2
  236. package/dist/entries/auto-complete.js +0 -2
  237. package/dist/entries/avatar.d.ts +0 -2
  238. package/dist/entries/avatar.js +0 -2
  239. package/dist/entries/badge.d.ts +0 -2
  240. package/dist/entries/badge.js +0 -2
  241. package/dist/entries/border-beam.d.ts +0 -2
  242. package/dist/entries/border-beam.js +0 -2
  243. package/dist/entries/breadcrumb.d.ts +0 -2
  244. package/dist/entries/breadcrumb.js +0 -2
  245. package/dist/entries/button.d.ts +0 -2
  246. package/dist/entries/button.js +0 -2
  247. package/dist/entries/calendar.d.ts +0 -2
  248. package/dist/entries/calendar.js +0 -2
  249. package/dist/entries/card.d.ts +0 -2
  250. package/dist/entries/card.js +0 -2
  251. package/dist/entries/carousel.d.ts +0 -2
  252. package/dist/entries/carousel.js +0 -2
  253. package/dist/entries/cascader.d.ts +0 -2
  254. package/dist/entries/cascader.js +0 -2
  255. package/dist/entries/checkbox.d.ts +0 -2
  256. package/dist/entries/checkbox.js +0 -2
  257. package/dist/entries/collapse.d.ts +0 -2
  258. package/dist/entries/collapse.js +0 -2
  259. package/dist/entries/color-picker.d.ts +0 -2
  260. package/dist/entries/color-picker.js +0 -2
  261. package/dist/entries/context-menu.d.ts +0 -2
  262. package/dist/entries/context-menu.js +0 -2
  263. package/dist/entries/date-picker.d.ts +0 -2
  264. package/dist/entries/date-picker.js +0 -2
  265. package/dist/entries/descriptions.d.ts +0 -2
  266. package/dist/entries/descriptions.js +0 -2
  267. package/dist/entries/divider.d.ts +0 -2
  268. package/dist/entries/divider.js +0 -2
  269. package/dist/entries/drawer.d.ts +0 -2
  270. package/dist/entries/drawer.js +0 -2
  271. package/dist/entries/dropdown.d.ts +0 -2
  272. package/dist/entries/dropdown.js +0 -2
  273. package/dist/entries/empty.d.ts +0 -2
  274. package/dist/entries/empty.js +0 -2
  275. package/dist/entries/float-button.d.ts +0 -2
  276. package/dist/entries/float-button.js +0 -2
  277. package/dist/entries/form-actions.d.ts +0 -2
  278. package/dist/entries/form-actions.js +0 -2
  279. package/dist/entries/form-field.d.ts +0 -2
  280. package/dist/entries/form-field.js +0 -2
  281. package/dist/entries/form-layout.d.ts +0 -2
  282. package/dist/entries/form-layout.js +0 -2
  283. package/dist/entries/form-section.d.ts +0 -2
  284. package/dist/entries/form-section.js +0 -2
  285. package/dist/entries/form.d.ts +1 -3
  286. package/dist/entries/form.js +0 -2
  287. package/dist/entries/image.d.ts +0 -2
  288. package/dist/entries/image.js +0 -2
  289. package/dist/entries/input-number.d.ts +0 -2
  290. package/dist/entries/input-number.js +0 -2
  291. package/dist/entries/input.d.ts +1 -3
  292. package/dist/entries/input.js +0 -2
  293. package/dist/entries/list.d.ts +0 -2
  294. package/dist/entries/list.js +0 -2
  295. package/dist/entries/listy.d.ts +0 -2
  296. package/dist/entries/listy.js +0 -2
  297. package/dist/entries/masonry.d.ts +0 -2
  298. package/dist/entries/masonry.js +0 -2
  299. package/dist/entries/mentions.d.ts +0 -2
  300. package/dist/entries/mentions.js +0 -2
  301. package/dist/entries/modal.d.ts +0 -2
  302. package/dist/entries/modal.js +0 -2
  303. package/dist/entries/number-input.d.ts +0 -2
  304. package/dist/entries/number-input.js +0 -2
  305. package/dist/entries/pagination.d.ts +0 -2
  306. package/dist/entries/pagination.js +0 -2
  307. package/dist/entries/popconfirm.d.ts +0 -2
  308. package/dist/entries/popconfirm.js +0 -2
  309. package/dist/entries/popover.d.ts +0 -2
  310. package/dist/entries/popover.js +0 -2
  311. package/dist/entries/progress.d.ts +0 -2
  312. package/dist/entries/progress.js +0 -2
  313. package/dist/entries/provider.d.ts +1 -3
  314. package/dist/entries/provider.js +1 -3
  315. package/dist/entries/qr-code.d.ts +0 -2
  316. package/dist/entries/qr-code.js +0 -2
  317. package/dist/entries/radio.d.ts +0 -2
  318. package/dist/entries/radio.js +0 -2
  319. package/dist/entries/range-picker.d.ts +0 -2
  320. package/dist/entries/range-picker.js +0 -2
  321. package/dist/entries/rate.d.ts +0 -2
  322. package/dist/entries/rate.js +0 -2
  323. package/dist/entries/result.d.ts +0 -2
  324. package/dist/entries/result.js +0 -2
  325. package/dist/entries/scroll-area.d.ts +0 -2
  326. package/dist/entries/scroll-area.js +0 -2
  327. package/dist/entries/segmented.d.ts +0 -2
  328. package/dist/entries/segmented.js +0 -2
  329. package/dist/entries/select.d.ts +0 -2
  330. package/dist/entries/select.js +0 -2
  331. package/dist/entries/skeleton.d.ts +0 -2
  332. package/dist/entries/skeleton.js +0 -2
  333. package/dist/entries/slider.d.ts +0 -2
  334. package/dist/entries/slider.js +0 -2
  335. package/dist/entries/sonner.d.ts +0 -2
  336. package/dist/entries/sonner.js +0 -2
  337. package/dist/entries/spinner.d.ts +0 -2
  338. package/dist/entries/spinner.js +0 -2
  339. package/dist/entries/splitter.d.ts +0 -2
  340. package/dist/entries/splitter.js +0 -2
  341. package/dist/entries/stack.d.ts +0 -2
  342. package/dist/entries/stack.js +0 -2
  343. package/dist/entries/statistic.d.ts +0 -2
  344. package/dist/entries/statistic.js +0 -2
  345. package/dist/entries/steps.d.ts +0 -2
  346. package/dist/entries/steps.js +0 -2
  347. package/dist/entries/switch.d.ts +0 -2
  348. package/dist/entries/switch.js +0 -2
  349. package/dist/entries/table.d.ts +0 -2
  350. package/dist/entries/table.js +0 -2
  351. package/dist/entries/tabs.d.ts +0 -2
  352. package/dist/entries/tabs.js +0 -2
  353. package/dist/entries/tag.d.ts +0 -2
  354. package/dist/entries/tag.js +0 -2
  355. package/dist/entries/textarea.d.ts +0 -2
  356. package/dist/entries/textarea.js +0 -2
  357. package/dist/entries/time-picker.d.ts +0 -2
  358. package/dist/entries/time-picker.js +0 -2
  359. package/dist/entries/timeline.d.ts +0 -2
  360. package/dist/entries/timeline.js +0 -2
  361. package/dist/entries/tooltip.d.ts +0 -2
  362. package/dist/entries/tooltip.js +0 -2
  363. package/dist/entries/tour.d.ts +0 -2
  364. package/dist/entries/tour.js +0 -2
  365. package/dist/entries/transfer.d.ts +0 -2
  366. package/dist/entries/transfer.js +0 -2
  367. package/dist/entries/tree-select.d.ts +0 -2
  368. package/dist/entries/tree-select.js +0 -2
  369. package/dist/entries/tree.d.ts +0 -2
  370. package/dist/entries/tree.js +0 -2
  371. package/dist/entries/upload.d.ts +0 -2
  372. package/dist/entries/upload.js +0 -2
  373. package/dist/entries/watermark.d.ts +0 -2
  374. package/dist/entries/watermark.js +0 -2
  375. package/dist/index.d.ts +5 -7
  376. package/dist/index.js +2 -4
  377. package/dist/layouts/form-layout/form-layout.d.ts +1 -0
  378. package/dist/layouts/form-layout/form-layout.js +10 -36
  379. package/dist/layouts/stack/layout.css +46 -44
  380. package/dist/layouts/stack/stack.d.ts +1 -0
  381. package/dist/layouts/stack/stack.js +16 -69
  382. package/dist/locales/ar-EG.js +25 -2
  383. package/dist/locales/create-locale.d.ts +1 -2
  384. package/dist/locales/create-locale.js +0 -28
  385. package/dist/locales/de-DE.js +25 -2
  386. package/dist/locales/en-US.js +24 -1
  387. package/dist/locales/es-ES.js +25 -2
  388. package/dist/locales/fr-FR.js +25 -2
  389. package/dist/locales/hi-IN.js +25 -2
  390. package/dist/locales/id-ID.js +25 -2
  391. package/dist/locales/index.d.ts +10 -10
  392. package/dist/locales/index.js +9 -9
  393. package/dist/locales/it-IT.js +25 -2
  394. package/dist/locales/ja-JP.js +25 -2
  395. package/dist/locales/ko-KR.js +25 -2
  396. package/dist/locales/pt-BR.js +25 -2
  397. package/dist/locales/ru-RU.js +25 -2
  398. package/dist/locales/th-TH.js +25 -2
  399. package/dist/locales/tr-TR.js +25 -2
  400. package/dist/locales/vi-VN.js +25 -2
  401. package/dist/locales/zh-CN.js +25 -2
  402. package/dist/locales/zh-TW.js +25 -2
  403. package/dist/number-input/number-input.js +24 -81
  404. package/dist/number-input/use-number-input.d.ts +1 -0
  405. package/dist/number-input/use-number-input.js +47 -43
  406. package/dist/provider/locale.d.ts +1 -1
  407. package/dist/provider/tao-context.d.ts +38 -0
  408. package/dist/provider/tao-context.js +92 -0
  409. package/dist/provider/tao-portal-scope.d.ts +14 -0
  410. package/dist/provider/tao-portal-scope.js +54 -0
  411. package/dist/provider/tao-provider.d.ts +5 -55
  412. package/dist/provider/tao-provider.js +94 -364
  413. package/dist/theme/control.css +106 -122
  414. package/dist/theme/theme.css +4 -2
  415. package/dist/utils/dialog-content.js +55 -210
  416. package/dist/utils/overlay.js +15 -30
  417. package/dist/utils/rc-compat.d.ts +13 -0
  418. package/dist/utils/rc-compat.js +48 -0
  419. package/dist/utils/refs.js +5 -19
  420. package/package.json +10 -16
@@ -1,55 +1,57 @@
1
- [data-tao-listy] {
2
- min-width: 0;
3
- color: var(--tao-color-text);
4
- font-family: var(--tao-font-family);
5
- font-size: var(--tao-font-size-base);
6
- line-height: var(--tao-line-height);
7
- --rc-virtual-list-scrollbar-bg: var(--tao-color-fill-secondary);
8
- }
9
-
10
- [data-tao-listy] > div {
11
- background: var(--tao-color-bg-container);
12
- border-radius: var(--tao-radius);
13
- min-width: 0;
14
- position: relative;
15
- }
16
-
17
- [data-tao-listy] .tao-listy-item-slot {
18
- box-sizing: border-box;
19
- min-width: 0;
20
- padding: var(--tao-listy-item-padding-block, 12px)
21
- var(--tao-listy-item-padding-inline, 16px);
22
- overflow-wrap: anywhere;
23
- }
24
-
25
- [data-tao-listy][data-tao-hoverable] .tao-listy-item-slot:hover {
26
- background: var(--tao-listy-item-hover-bg, var(--tao-color-fill-quaternary));
27
- }
28
-
29
- [data-tao-listy] .tao-listy-group-slot {
30
- padding: var(--tao-listy-item-padding-block, 12px)
31
- var(--tao-listy-item-padding-inline, 16px);
32
- color: var(--tao-color-text-secondary);
33
- background: var(--tao-color-bg-container);
34
- box-sizing: border-box;
35
- font-weight: 600;
36
- }
37
-
38
- [data-tao-listy] [class*="-group-header-sticky"] {
39
- z-index: 1;
40
- position: sticky;
41
- top: 0;
42
- }
43
-
44
- [data-tao-listy] [class*="-group-header-fixed"] {
45
- inset-inline: 0;
46
- z-index: 1;
47
- position: absolute;
48
- top: 0;
49
- }
50
-
51
- [data-tao-listy] [class*="-scrollbar-thumb"] {
52
- border-radius: var(--tao-radius);
53
- background: var(--tao-color-fill-secondary);
1
+ @layer components {
2
+ [data-tao-listy] {
3
+ min-width: 0;
4
+ color: var(--tao-color-text);
5
+ font-family: var(--tao-font-family);
6
+ font-size: var(--tao-font-size-base);
7
+ line-height: var(--tao-line-height);
8
+ --rc-virtual-list-scrollbar-bg: var(--tao-color-fill-secondary);
9
+ }
10
+
11
+ [data-tao-listy] > div {
12
+ background: var(--tao-color-bg-container);
13
+ border-radius: var(--tao-radius);
14
+ min-width: 0;
15
+ position: relative;
16
+ }
17
+
18
+ [data-tao-listy] .tao-listy-item-slot {
19
+ box-sizing: border-box;
20
+ min-width: 0;
21
+ padding: var(--tao-listy-item-padding-block, 12px)
22
+ var(--tao-listy-item-padding-inline, 16px);
23
+ overflow-wrap: anywhere;
24
+ }
25
+
26
+ [data-tao-listy][data-tao-hoverable] .tao-listy-item-slot:hover {
27
+ background: var(--tao-listy-item-hover-bg, var(--tao-color-fill-quaternary));
28
+ }
29
+
30
+ [data-tao-listy] .tao-listy-group-slot {
31
+ padding: var(--tao-listy-item-padding-block, 12px)
32
+ var(--tao-listy-item-padding-inline, 16px);
33
+ color: var(--tao-color-text-secondary);
34
+ background: var(--tao-color-bg-container);
35
+ box-sizing: border-box;
36
+ font-weight: 600;
37
+ }
38
+
39
+ [data-tao-listy] [class*="-group-header-sticky"] {
40
+ z-index: 1;
41
+ position: sticky;
42
+ top: 0;
43
+ }
44
+
45
+ [data-tao-listy] [class*="-group-header-fixed"] {
46
+ inset-inline: 0;
47
+ z-index: 1;
48
+ position: absolute;
49
+ top: 0;
50
+ }
51
+
52
+ [data-tao-listy] [class*="-scrollbar-thumb"] {
53
+ border-radius: var(--tao-radius);
54
+ background: var(--tao-color-fill-secondary);
55
+ }
54
56
  }
55
57
 
@@ -1,13 +1,52 @@
1
- import { type ListyClassNames, type ListyRef, type ListyStyles, type ListyProps as RcListyProps } from '@rc-component/listy';
2
- import { type CSSProperties, type Key, type ReactElement, type Ref } from 'react';
1
+ import { type CSSProperties, type Key, type ReactElement, type ReactNode, type Ref, type UIEventHandler } from 'react';
3
2
  import './listy.css';
4
- export type { ListyClassNames, ListyRef, ListyScrollToConfig, ListyStyles, ScrollAlign, } from '@rc-component/listy';
3
+ export type ScrollAlign = 'top' | 'bottom' | 'auto';
4
+ export interface ListyClassNames {
5
+ root?: string;
6
+ item?: string;
7
+ groupHeader?: string;
8
+ }
9
+ export interface ListyStyles {
10
+ root?: CSSProperties;
11
+ item?: CSSProperties;
12
+ groupHeader?: CSSProperties;
13
+ }
14
+ export type ListyScrollToConfig = number | {
15
+ top?: number;
16
+ left?: number;
17
+ } | {
18
+ key: Key;
19
+ align?: ScrollAlign;
20
+ offset?: number;
21
+ } | {
22
+ groupKey: Key;
23
+ align?: ScrollAlign;
24
+ offset?: number;
25
+ };
26
+ export interface ListyRef {
27
+ scrollTo: (config: ListyScrollToConfig) => void;
28
+ }
29
+ export interface ListyGroupConfig<T, K extends Key = Key> {
30
+ key: (item: T) => K;
31
+ title?: (key: K, items: T[]) => ReactNode;
32
+ }
5
33
  export type ListySemanticPart = 'root' | 'item' | 'groupHeader';
6
- export interface ListyProps<T = Record<string, unknown>, K extends Key = Key> extends Omit<RcListyProps<T, K>, 'classNames' | 'styles' | 'itemHeight'> {
34
+ export interface ListyProps<T = Record<string, unknown>, K extends Key = Key> {
35
+ prefixCls?: string;
7
36
  rootClassName?: string;
8
37
  className?: string;
9
38
  style?: CSSProperties;
39
+ items?: T[];
40
+ rowKey?: keyof T | ((item: T, index: number) => Key);
41
+ itemRender: (item: T, index: number) => ReactNode;
42
+ group?: ListyGroupConfig<T, K>;
43
+ height?: number;
44
+ scrollWidth?: number;
45
+ virtual?: boolean;
46
+ sticky?: boolean;
10
47
  rowHoverable?: boolean;
48
+ direction?: 'ltr' | 'rtl';
49
+ onScroll?: UIEventHandler<HTMLDivElement>;
11
50
  classNames?: ListyClassNames | ((info: {
12
51
  props: ListyProps<T, K>;
13
52
  }) => ListyClassNames);
@@ -1,227 +1,209 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { c } from "react-compiler-runtime";
3
- import listy from "@rc-component/listy";
4
- import { forwardRef, useImperativeHandle, useRef } from "react";
5
- import { useTaoDirection } from "../../provider/tao-provider.js";
2
+ import { forwardRef, useImperativeHandle, useMemo, useRef, useState } from "react";
3
+ import { useTaoDirection } from "../../provider/tao-context.js";
6
4
  import { cx } from "../../utils/semantic.js";
7
5
  import "./listy.css";
8
- import { interopDefault } from "../../utils/interop-default.js";
9
- const RcListyComponent = /*#__PURE__*/ interopDefault(listy);
6
+ const ITEM_HEIGHT = 46;
7
+ const OVERSCAN = 4;
8
+ function resolveRowKey(item, index, rowKey) {
9
+ if ('function' == typeof rowKey) return rowKey(item, index);
10
+ if (void 0 !== rowKey && item && 'object' == typeof item) return item[rowKey] ?? index;
11
+ return index;
12
+ }
13
+ function alignToBlock(align) {
14
+ if ('top' === align) return 'start';
15
+ if ('bottom' === align) return 'end';
16
+ return 'nearest';
17
+ }
10
18
  function ListyRoot(props, ref) {
11
- const $ = c(63);
12
- let className;
13
- let classNames;
14
- let directionProp;
15
- let rest;
16
- let rootClassName;
17
- let scrollWidth;
18
- let style;
19
- let styles;
20
- let t0;
21
- let t1;
22
- let t2;
23
- if ($[0] !== props) {
24
- ({ prefixCls: t0, className, rootClassName, style, classNames, styles, rowHoverable: t1, virtual: t2, direction: directionProp, scrollWidth, ...rest } = props);
25
- $[0] = props;
26
- $[1] = className;
27
- $[2] = classNames;
28
- $[3] = directionProp;
29
- $[4] = rest;
30
- $[5] = rootClassName;
31
- $[6] = scrollWidth;
32
- $[7] = style;
33
- $[8] = styles;
34
- $[9] = t0;
35
- $[10] = t1;
36
- $[11] = t2;
37
- } else {
38
- className = $[1];
39
- classNames = $[2];
40
- directionProp = $[3];
41
- rest = $[4];
42
- rootClassName = $[5];
43
- scrollWidth = $[6];
44
- style = $[7];
45
- styles = $[8];
46
- t0 = $[9];
47
- t1 = $[10];
48
- t2 = $[11];
49
- }
50
- const prefixCls = void 0 === t0 ? "tao-listy" : t0;
51
- const rowHoverable = void 0 === t1 ? true : t1;
52
- const virtual = void 0 === t2 ? false : t2;
19
+ const { prefixCls = 'tao-listy', className, rootClassName, style, classNames, styles, items = [], rowKey, itemRender, group, height, scrollWidth, virtual = false, sticky = false, rowHoverable = true, direction: directionProp, onScroll } = props;
53
20
  const [direction, directionRef] = useTaoDirection(directionProp);
54
- const listRef = useRef(null);
55
- let t3;
56
- let t4;
57
- if ($[12] !== direction || $[13] !== virtual) {
58
- t3 = ()=>({
59
- scrollTo (config) {
60
- if (!virtual && "rtl" === direction && config && "object" == typeof config && "left" in config && void 0 !== config.left) return void listRef.current?.scrollTo({
61
- ...config,
62
- left: -Math.abs(config.left)
21
+ const holderRef = useRef(null);
22
+ const itemNodes = useRef(new Map());
23
+ const groupNodes = useRef(new Map());
24
+ const [scrollTop, setScrollTop] = useState(0);
25
+ const flatEntries = useMemo(()=>{
26
+ if (!group) return items.map((item, index)=>({
27
+ kind: 'item',
28
+ item,
29
+ index,
30
+ key: resolveRowKey(item, index, rowKey)
31
+ }));
32
+ const order = [];
33
+ const buckets = new Map();
34
+ items.forEach((item, index)=>{
35
+ const gk = group.key(item);
36
+ const list = buckets.get(gk);
37
+ if (list) list.push({
38
+ item,
39
+ index
40
+ });
41
+ else {
42
+ order.push(gk);
43
+ buckets.set(gk, [
44
+ {
45
+ item,
46
+ index
47
+ }
48
+ ]);
49
+ }
50
+ });
51
+ const out = [];
52
+ for (const gk of order){
53
+ const entries = buckets.get(gk);
54
+ out.push({
55
+ kind: 'group',
56
+ groupKey: gk,
57
+ title: group.title ? group.title(gk, entries.map((e)=>e.item)) : String(gk)
58
+ });
59
+ for (const { item, index } of entries)out.push({
60
+ kind: 'item',
61
+ item,
62
+ index,
63
+ key: resolveRowKey(item, index, rowKey)
64
+ });
65
+ }
66
+ return out;
67
+ }, [
68
+ group,
69
+ items,
70
+ rowKey
71
+ ]);
72
+ useImperativeHandle(ref, ()=>({
73
+ scrollTo (config) {
74
+ const holder = holderRef.current;
75
+ if (!holder) return;
76
+ if ('number' == typeof config) {
77
+ holder.scrollTop = config;
78
+ if (virtual) setScrollTop(config);
79
+ return;
80
+ }
81
+ if ('key' in config) {
82
+ const el = itemNodes.current.get(config.key);
83
+ if (el) el.scrollIntoView({
84
+ block: alignToBlock(config.align),
85
+ inline: 'nearest'
63
86
  });
64
- listRef.current?.scrollTo(config);
87
+ else if (virtual) {
88
+ const idx = flatEntries.findIndex((entry)=>'item' === entry.kind && entry.key === config.key);
89
+ if (idx >= 0) {
90
+ const nextTop = idx * ITEM_HEIGHT + (config.offset ?? 0);
91
+ holder.scrollTop = nextTop;
92
+ setScrollTop(nextTop);
93
+ }
94
+ }
95
+ return;
65
96
  }
66
- });
67
- t4 = [
68
- direction,
69
- virtual
70
- ];
71
- $[12] = direction;
72
- $[13] = virtual;
73
- $[14] = t3;
74
- $[15] = t4;
75
- } else {
76
- t3 = $[14];
77
- t4 = $[15];
78
- }
79
- useImperativeHandle(ref, t3, t4);
97
+ if ('groupKey' in config) {
98
+ const el = groupNodes.current.get(config.groupKey);
99
+ if (el) el.scrollIntoView({
100
+ block: alignToBlock(config.align),
101
+ inline: 'nearest'
102
+ });
103
+ else if (virtual) {
104
+ const idx = flatEntries.findIndex((entry)=>'group' === entry.kind && entry.groupKey === config.groupKey);
105
+ if (idx >= 0) {
106
+ const nextTop = idx * ITEM_HEIGHT + (config.offset ?? 0);
107
+ holder.scrollTop = nextTop;
108
+ setScrollTop(nextTop);
109
+ }
110
+ }
111
+ return;
112
+ }
113
+ if (void 0 !== config.top) {
114
+ holder.scrollTop = config.top;
115
+ if (virtual) setScrollTop(config.top);
116
+ }
117
+ if (void 0 !== config.left) holder.scrollLeft = virtual || 'rtl' !== direction ? config.left : -Math.abs(config.left);
118
+ }
119
+ }), [
120
+ direction,
121
+ flatEntries,
122
+ virtual
123
+ ]);
124
+ const classes = 'function' == typeof classNames ? classNames({
125
+ props
126
+ }) : classNames;
127
+ const semanticStyles = 'function' == typeof styles ? styles({
128
+ props
129
+ }) : styles;
80
130
  const rawWidth = virtual ? void 0 : scrollWidth;
81
- let t5;
82
- if ($[16] !== classNames || $[17] !== props) {
83
- t5 = "function" == typeof classNames ? classNames({
84
- props
85
- }) : classNames;
86
- $[16] = classNames;
87
- $[17] = props;
88
- $[18] = t5;
89
- } else t5 = $[18];
90
- const classes = t5;
91
- let t6;
92
- if ($[19] !== props || $[20] !== styles) {
93
- t6 = "function" == typeof styles ? styles({
94
- props
95
- }) : styles;
96
- $[19] = props;
97
- $[20] = styles;
98
- $[21] = t6;
99
- } else t6 = $[21];
100
- const semanticStyles = t6;
101
- const t7 = rowHoverable ? "" : void 0;
102
- const t8 = classes?.root;
103
- let t9;
104
- if ($[22] !== className || $[23] !== rootClassName || $[24] !== t8) {
105
- t9 = cx(t8, rootClassName, className);
106
- $[22] = className;
107
- $[23] = rootClassName;
108
- $[24] = t8;
109
- $[25] = t9;
110
- } else t9 = $[25];
111
- const t10 = classes?.item;
112
- let t11;
113
- if ($[26] !== t10) {
114
- t11 = cx("tao-listy-item-slot", t10);
115
- $[26] = t10;
116
- $[27] = t11;
117
- } else t11 = $[27];
118
- const t12 = classes?.groupHeader;
119
- let t13;
120
- if ($[28] !== t12) {
121
- t13 = cx("tao-listy-group-slot", t12);
122
- $[28] = t12;
123
- $[29] = t13;
124
- } else t13 = $[29];
125
- let t14;
126
- if ($[30] !== classes || $[31] !== t11 || $[32] !== t13 || $[33] !== t9) {
127
- t14 = {
128
- ...classes,
129
- root: t9,
130
- item: t11,
131
- groupHeader: t13
132
- };
133
- $[30] = classes;
134
- $[31] = t11;
135
- $[32] = t13;
136
- $[33] = t9;
137
- $[34] = t14;
138
- } else t14 = $[34];
139
- const t15 = rawWidth ? "auto" : void 0;
140
- const t16 = semanticStyles?.root;
141
- let t17;
142
- if ($[35] !== style || $[36] !== t15 || $[37] !== t16) {
143
- t17 = {
144
- overflowX: t15,
145
- ...t16,
146
- ...style
147
- };
148
- $[35] = style;
149
- $[36] = t15;
150
- $[37] = t16;
151
- $[38] = t17;
152
- } else t17 = $[38];
153
- let t18;
154
- if ($[39] !== rawWidth || $[40] !== semanticStyles?.item) {
155
- t18 = rawWidth ? {
156
- minWidth: rawWidth,
157
- ...semanticStyles?.item
158
- } : semanticStyles?.item;
159
- $[39] = rawWidth;
160
- $[40] = semanticStyles?.item;
161
- $[41] = t18;
162
- } else t18 = $[41];
163
- let t19;
164
- if ($[42] !== rawWidth || $[43] !== semanticStyles?.groupHeader) {
165
- t19 = rawWidth ? {
166
- minWidth: rawWidth,
167
- ...semanticStyles?.groupHeader
168
- } : semanticStyles?.groupHeader;
169
- $[42] = rawWidth;
170
- $[43] = semanticStyles?.groupHeader;
171
- $[44] = t19;
172
- } else t19 = $[44];
173
- let t20;
174
- if ($[45] !== semanticStyles || $[46] !== t17 || $[47] !== t18 || $[48] !== t19) {
175
- t20 = {
176
- ...semanticStyles,
177
- root: t17,
178
- item: t18,
179
- groupHeader: t19
180
- };
181
- $[45] = semanticStyles;
182
- $[46] = t17;
183
- $[47] = t18;
184
- $[48] = t19;
185
- $[49] = t20;
186
- } else t20 = $[49];
187
- let t21;
188
- if ($[50] !== direction || $[51] !== prefixCls || $[52] !== rest || $[53] !== scrollWidth || $[54] !== t14 || $[55] !== t20 || $[56] !== virtual) {
189
- t21 = /*#__PURE__*/ jsx(RcListyComponent, {
190
- ...rest,
191
- ref: listRef,
192
- prefixCls: prefixCls,
193
- direction: direction,
194
- scrollWidth: scrollWidth,
195
- virtual: virtual,
196
- itemHeight: 46,
197
- classNames: t14,
198
- styles: t20
199
- });
200
- $[50] = direction;
201
- $[51] = prefixCls;
202
- $[52] = rest;
203
- $[53] = scrollWidth;
204
- $[54] = t14;
205
- $[55] = t20;
206
- $[56] = virtual;
207
- $[57] = t21;
208
- } else t21 = $[57];
209
- let t22;
210
- if ($[58] !== direction || $[59] !== directionRef || $[60] !== t21 || $[61] !== t7) {
211
- t22 = /*#__PURE__*/ jsx("div", {
212
- ref: directionRef,
213
- dir: direction,
214
- "data-tao-listy": "",
215
- "data-tao-hoverable": t7,
216
- children: t21
217
- });
218
- $[58] = direction;
219
- $[59] = directionRef;
220
- $[60] = t21;
221
- $[61] = t7;
222
- $[62] = t22;
223
- } else t22 = $[62];
224
- return t22;
131
+ const isVirtualActive = virtual && void 0 !== height && height > 0;
132
+ const visibleCount = isVirtualActive ? Math.ceil(height / ITEM_HEIGHT) + 2 * OVERSCAN : flatEntries.length;
133
+ const startIndex = isVirtualActive ? Math.max(0, Math.floor(scrollTop / ITEM_HEIGHT) - OVERSCAN) : 0;
134
+ const endIndex = isVirtualActive ? Math.min(flatEntries.length, startIndex + visibleCount) : flatEntries.length;
135
+ const renderedEntries = isVirtualActive ? flatEntries.slice(startIndex, endIndex) : flatEntries;
136
+ const itemStyle = void 0 !== scrollWidth ? {
137
+ ...virtual ? {
138
+ width: scrollWidth
139
+ } : {
140
+ minWidth: scrollWidth
141
+ },
142
+ ...semanticStyles?.item
143
+ } : semanticStyles?.item;
144
+ const groupStyle = void 0 !== scrollWidth ? {
145
+ ...virtual ? {
146
+ width: scrollWidth
147
+ } : {
148
+ minWidth: scrollWidth
149
+ },
150
+ ...semanticStyles?.groupHeader
151
+ } : semanticStyles?.groupHeader;
152
+ const renderEntry = (entry)=>{
153
+ if ('group' === entry.kind) return /*#__PURE__*/ jsx("div", {
154
+ ref: (el)=>{
155
+ if (el) groupNodes.current.set(entry.groupKey, el);
156
+ else groupNodes.current.delete(entry.groupKey);
157
+ },
158
+ className: cx(`${prefixCls}-group-header`, sticky && `${prefixCls}-group-header-sticky`, 'tao-listy-group-slot', classes?.groupHeader),
159
+ style: groupStyle,
160
+ children: entry.title
161
+ }, `group-${String(entry.groupKey)}`);
162
+ return /*#__PURE__*/ jsx("div", {
163
+ ref: (el)=>{
164
+ if (el) itemNodes.current.set(entry.key, el);
165
+ else itemNodes.current.delete(entry.key);
166
+ },
167
+ className: cx(`${prefixCls}-item`, 'tao-listy-item-slot', classes?.item),
168
+ style: itemStyle,
169
+ children: itemRender(entry.item, entry.index)
170
+ }, entry.key);
171
+ };
172
+ return /*#__PURE__*/ jsx("div", {
173
+ ref: directionRef,
174
+ dir: direction,
175
+ "data-tao-listy": "",
176
+ "data-tao-hoverable": rowHoverable ? '' : void 0,
177
+ children: /*#__PURE__*/ jsx("div", {
178
+ ref: holderRef,
179
+ dir: 'rtl' === direction ? 'rtl' : void 0,
180
+ className: cx(prefixCls, classes?.root, rootClassName, className),
181
+ style: {
182
+ maxHeight: height,
183
+ overflowY: void 0 !== height ? 'auto' : void 0,
184
+ overflowX: rawWidth || scrollWidth ? 'auto' : void 0,
185
+ ...semanticStyles?.root,
186
+ ...style
187
+ },
188
+ onScroll: (event)=>{
189
+ if (isVirtualActive) setScrollTop(event.currentTarget.scrollTop);
190
+ onScroll?.(event);
191
+ },
192
+ children: isVirtualActive ? /*#__PURE__*/ jsx("div", {
193
+ style: {
194
+ height: flatEntries.length * ITEM_HEIGHT,
195
+ position: 'relative',
196
+ minWidth: scrollWidth
197
+ },
198
+ children: /*#__PURE__*/ jsx("div", {
199
+ style: {
200
+ transform: `translateY(${startIndex * ITEM_HEIGHT}px)`
201
+ },
202
+ children: renderedEntries.map(renderEntry)
203
+ })
204
+ }) : renderedEntries.map(renderEntry)
205
+ })
206
+ });
225
207
  }
226
208
  const Listy = /*#__PURE__*/ forwardRef(ListyRoot);
227
209
  export { Listy };
@@ -1,4 +1,4 @@
1
- @layer tao {
1
+ @layer components {
2
2
  [data-tao-masonry] {
3
3
  min-width: 0;
4
4
  position: relative;
@@ -1,6 +1,7 @@
1
1
  import { type HTMLAttributes, type Key, type ReactElement, type ReactNode, type RefAttributes } from 'react';
2
2
  import { type TaoBreakpointMap } from '../../utils/breakpoint.js';
3
3
  import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic.js';
4
+ import '../../theme/theme.css';
4
5
  import './masonry.css';
5
6
  export type MasonrySemanticPart = 'root' | 'item';
6
7
  export type MasonryGutter = number | string | undefined | TaoBreakpointMap<number>;