@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,9 +1,9 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { c } from "react-compiler-runtime";
3
2
  import { FocusScope, FocusScopeBranchProvider, useFocusScopeBranchRegistry } from "@radix-ui/react-focus-scope";
4
- import { createContext, forwardRef, memo, useContext, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
3
+ import { createContext, forwardRef, memo, useCallback, useContext, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
5
4
  import { RemoveScroll } from "react-remove-scroll";
6
- import { TaoPortalScope, TaoProvider, useTaoConfig } from "../../provider/tao-provider.js";
5
+ import { useTaoConfig } from "../../provider/tao-context.js";
6
+ import { TaoPortalScope, TaoProvider } from "../../provider/tao-provider.js";
7
7
  import { resolveResponsiveValue, useBreakpoint } from "../../utils/breakpoint.js";
8
8
  import { DialogContent } from "../../utils/dialog-content.js";
9
9
  import { isEscapeForOpenCombobox, preventParentOutsideDismiss } from "../../utils/portal.js";
@@ -23,763 +23,317 @@ function OkBtn() {
23
23
  function CancelBtn() {
24
24
  return useContext(ModalActionContext).cancel;
25
25
  }
26
- function Modal(t0) {
27
- const $ = c(174);
28
- const { direction, open, onClose, title, footer, onOk, okText, cancelText, confirmLoading, okButtonProps, cancelButtonProps, width: t1, centered: t2, closable: t3, maskClosable: t4, keyboard: t5, getContainer, mask: t6, zIndex, scrollLock: t7, closeIcon, modalRender, wrapProps, transitionName, maskTransitionName, focusTriggerAfterClose, autoFocusButton, focusable, afterClose, destroyOnHidden: t8, children, classNames, styles: stylesProp, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy } = t0;
29
- const width = void 0 === t1 ? 520 : t1;
30
- const centered = void 0 === t2 ? true : t2;
31
- const closable = void 0 === t3 ? true : t3;
32
- const maskClosable = void 0 === t4 ? true : t4;
33
- const keyboard = void 0 === t5 ? true : t5;
34
- const mask = void 0 === t6 ? true : t6;
35
- const scrollLock = void 0 === t7 ? true : t7;
36
- const destroyOnHidden = void 0 === t8 ? true : t8;
26
+ function Modal({ direction, open, onClose, title, footer, onOk, okText, cancelText, confirmLoading, okButtonProps, cancelButtonProps, width = 520, centered = true, closable = true, maskClosable = true, keyboard = true, getContainer, mask = true, zIndex, scrollLock = true, closeIcon, modalRender, wrapProps, transitionName, maskTransitionName, focusTriggerAfterClose, autoFocusButton, focusable, afterClose, destroyOnHidden = true, children, classNames, styles: stylesProp, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy }) {
37
27
  const { locale } = useTaoConfig();
38
28
  const watermarkRef = useWatermarkPanelRef();
39
29
  const contentRef = useRef(null);
40
30
  const { nodes: focusBranches, registry: focusRegistry } = useFocusScopeBranchRegistry();
41
31
  const restoreFocusRef = useRef(null);
42
- let t9;
43
- if ($[0] !== watermarkRef) {
44
- t9 = (node)=>{
45
- contentRef.current = node;
46
- watermarkRef(node);
47
- };
48
- $[0] = watermarkRef;
49
- $[1] = t9;
50
- } else t9 = $[1];
51
- const setContentRef = t9;
32
+ const setContentRef = useCallback((node)=>{
33
+ contentRef.current = node;
34
+ watermarkRef(node);
35
+ }, [
36
+ watermarkRef
37
+ ]);
52
38
  const prevOpen = useRef(open);
53
- let t10;
54
- let t11;
55
- if ($[2] !== afterClose || $[3] !== closable || $[4] !== open) {
56
- t10 = ()=>{
57
- if (prevOpen.current && !open) {
58
- afterClose?.();
59
- if ("object" == typeof closable) closable.afterClose?.();
60
- }
61
- prevOpen.current = open;
62
- };
63
- t11 = [
64
- open,
65
- afterClose,
66
- closable
67
- ];
68
- $[2] = afterClose;
69
- $[3] = closable;
70
- $[4] = open;
71
- $[5] = t10;
72
- $[6] = t11;
73
- } else {
74
- t10 = $[5];
75
- t11 = $[6];
76
- }
77
- useEffect(t10, t11);
39
+ useEffect(()=>{
40
+ if (prevOpen.current && !open) {
41
+ afterClose?.();
42
+ if ('object' == typeof closable) closable.afterClose?.();
43
+ }
44
+ prevOpen.current = open;
45
+ }, [
46
+ open,
47
+ afterClose,
48
+ closable
49
+ ]);
78
50
  const screens = useBreakpoint();
79
- let t12;
80
- if ($[7] !== screens || $[8] !== width) {
81
- t12 = resolveResponsiveValue(width, screens) ?? 520;
82
- $[7] = screens;
83
- $[8] = width;
84
- $[9] = t12;
85
- } else t12 = $[9];
86
- const resolvedWidth = t12;
87
- const t13 = "number" == typeof resolvedWidth ? `${resolvedWidth}px` : resolvedWidth;
88
- const t14 = stylesProp?.root;
89
- const t15 = stylesProp?.container;
90
- let t16;
91
- if ($[10] !== t13 || $[11] !== t14 || $[12] !== t15) {
92
- t16 = {
93
- pointerEvents: "auto",
94
- width: t13,
95
- ...t14,
96
- ...t15
97
- };
98
- $[10] = t13;
99
- $[11] = t14;
100
- $[12] = t15;
101
- $[13] = t16;
102
- } else t16 = $[13];
103
- const contentStyle = t16;
104
- const t17 = cancelButtonProps?.disabled ?? false;
105
- let t18;
106
- if ($[14] !== cancelButtonProps || $[15] !== onClose) {
107
- t18 = (event)=>{
51
+ const resolvedWidth = resolveResponsiveValue(width, screens) ?? 520;
52
+ const contentStyle = {
53
+ pointerEvents: 'auto',
54
+ width: 'number' == typeof resolvedWidth ? `${resolvedWidth}px` : resolvedWidth,
55
+ ...stylesProp?.root,
56
+ ...stylesProp?.container
57
+ };
58
+ const cancelButton = /*#__PURE__*/ jsx(Button, {
59
+ variant: "secondary",
60
+ "data-tao-modal-action": "cancel",
61
+ ...cancelButtonProps,
62
+ disabled: cancelButtonProps?.disabled ?? false,
63
+ onClick: (event)=>{
108
64
  cancelButtonProps?.onClick?.(event);
109
65
  if (!event.defaultPrevented) onClose?.();
110
- };
111
- $[14] = cancelButtonProps;
112
- $[15] = onClose;
113
- $[16] = t18;
114
- } else t18 = $[16];
115
- const t19 = void 0 === cancelText ? locale.cancel : cancelText;
116
- let t20;
117
- if ($[17] !== cancelButtonProps || $[18] !== t17 || $[19] !== t18 || $[20] !== t19) {
118
- t20 = /*#__PURE__*/ jsx(Button, {
119
- variant: "secondary",
120
- "data-tao-modal-action": "cancel",
121
- ...cancelButtonProps,
122
- disabled: t17,
123
- onClick: t18,
124
- children: t19
125
- });
126
- $[17] = cancelButtonProps;
127
- $[18] = t17;
128
- $[19] = t18;
129
- $[20] = t19;
130
- $[21] = t20;
131
- } else t20 = $[21];
132
- const cancelButton = t20;
133
- const t21 = confirmLoading || okButtonProps?.loading;
134
- let t22;
135
- if ($[22] !== okButtonProps || $[23] !== onOk) {
136
- t22 = (event_0)=>{
137
- okButtonProps?.onClick?.(event_0);
138
- if (!event_0.defaultPrevented) onOk?.();
139
- };
140
- $[22] = okButtonProps;
141
- $[23] = onOk;
142
- $[24] = t22;
143
- } else t22 = $[24];
144
- const t23 = void 0 === okText ? locale.ok : okText;
145
- let t24;
146
- if ($[25] !== okButtonProps || $[26] !== t21 || $[27] !== t22 || $[28] !== t23) {
147
- t24 = /*#__PURE__*/ jsx(Button, {
148
- variant: "primary",
149
- "data-tao-modal-action": "ok",
150
- ...okButtonProps,
151
- loading: t21,
152
- onClick: t22,
153
- children: t23
154
- });
155
- $[25] = okButtonProps;
156
- $[26] = t21;
157
- $[27] = t22;
158
- $[28] = t23;
159
- $[29] = t24;
160
- } else t24 = $[29];
161
- const okButton = t24;
162
- let t25;
163
- if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
164
- t25 = /*#__PURE__*/ jsxs(Fragment, {
165
- children: [
166
- /*#__PURE__*/ jsx(CancelBtn, {}),
167
- /*#__PURE__*/ jsx(OkBtn, {})
168
- ]
169
- });
170
- $[30] = t25;
171
- } else t25 = $[30];
172
- const defaultFooter = t25;
66
+ },
67
+ children: void 0 === cancelText ? locale.cancel : cancelText
68
+ });
69
+ const okButton = /*#__PURE__*/ jsx(Button, {
70
+ variant: "primary",
71
+ "data-tao-modal-action": "ok",
72
+ ...okButtonProps,
73
+ loading: confirmLoading || okButtonProps?.loading,
74
+ onClick: (event)=>{
75
+ okButtonProps?.onClick?.(event);
76
+ if (!event.defaultPrevented) onOk?.();
77
+ },
78
+ children: void 0 === okText ? locale.ok : okText
79
+ });
80
+ const defaultFooter = /*#__PURE__*/ jsxs(Fragment, {
81
+ children: [
82
+ /*#__PURE__*/ jsx(CancelBtn, {}),
83
+ /*#__PURE__*/ jsx(OkBtn, {})
84
+ ]
85
+ });
173
86
  let footerContent;
174
- if (void 0 === footer) footerContent = defaultFooter;
175
- else if ("function" == typeof footer) {
176
- let t26;
177
- if ($[31] !== footer) {
178
- t26 = footer(defaultFooter, {
179
- OkBtn: OkBtn,
180
- CancelBtn: CancelBtn
181
- });
182
- $[31] = footer;
183
- $[32] = t26;
184
- } else t26 = $[32];
185
- footerContent = t26;
186
- } else footerContent = footer;
87
+ footerContent = void 0 === footer ? defaultFooter : 'function' == typeof footer ? footer(defaultFooter, {
88
+ OkBtn: OkBtn,
89
+ CancelBtn: CancelBtn
90
+ }) : footer;
187
91
  const keepAlive = !destroyOnHidden;
188
92
  const forceMount = keepAlive ? true : void 0;
189
- const closeOnMask = "object" == typeof mask ? mask.closable ?? maskClosable : maskClosable;
190
- const showMask = "object" == typeof mask ? false !== mask.enabled : mask;
191
- const closeConfig = "object" == typeof closable ? closable : void 0;
93
+ const closeOnMask = 'object' == typeof mask ? mask.closable ?? maskClosable : maskClosable;
94
+ const showMask = 'object' == typeof mask ? false !== mask.enabled : mask;
95
+ const closeConfig = 'object' == typeof closable ? closable : void 0;
192
96
  const mergedCloseIcon = closeConfig?.closeIcon !== void 0 ? closeConfig.closeIcon : closeIcon;
193
97
  const showClose = closable && null !== mergedCloseIcon && false !== mergedCloseIcon;
194
98
  const trapFocus = focusable?.trap ?? true;
195
99
  const customInteraction = !scrollLock || !trapFocus;
196
- let t26;
197
- if ($[33] !== autoFocusButton || $[34] !== focusable) {
198
- t26 = (event_1)=>{
199
- restoreFocusRef.current = document.activeElement;
200
- const button = focusable?.autoFocusButton !== void 0 ? focusable.autoFocusButton : autoFocusButton;
201
- if (null === button) event_1.preventDefault();
202
- else if (button) {
203
- const target = contentRef.current?.querySelector(`[data-tao-modal-action="${button}"]`);
204
- target?.focus();
205
- if (target && document.activeElement === target) event_1.preventDefault();
206
- }
207
- };
208
- $[33] = autoFocusButton;
209
- $[34] = focusable;
210
- $[35] = t26;
211
- } else t26 = $[35];
212
- const openAutoFocus = t26;
213
- let t27;
214
- if ($[36] !== focusTriggerAfterClose || $[37] !== focusable?.focusTriggerAfterClose) {
215
- t27 = (event_2)=>{
216
- const restore = focusable?.focusTriggerAfterClose ?? focusTriggerAfterClose;
217
- if (void 0 !== restore) event_2.preventDefault();
218
- if (restore) restoreFocusRef.current?.focus();
219
- };
220
- $[36] = focusTriggerAfterClose;
221
- $[37] = focusable?.focusTriggerAfterClose;
222
- $[38] = t27;
223
- } else t27 = $[38];
224
- const closeAutoFocus = t27;
225
- let t28;
226
- if ($[39] !== classNames?.close || $[40] !== classNames?.header || $[41] !== classNames?.title || $[42] !== closeConfig || $[43] !== locale || $[44] !== mergedCloseIcon || $[45] !== onClose || $[46] !== showClose || $[47] !== stylesProp?.close || $[48] !== stylesProp?.header || $[49] !== stylesProp?.title || $[50] !== title) {
227
- t28 = (null != title || showClose) && /*#__PURE__*/ jsxs("div", {
228
- "data-tao-modal-header": "",
229
- className: cx(classNames?.header),
230
- style: stylesProp?.header,
231
- children: [
232
- null != title ? /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Title, {
233
- "data-tao-modal-title": "",
234
- className: cx(classNames?.title),
235
- style: stylesProp?.title,
236
- children: title
237
- }) : /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Title, {
238
- "data-tao-modal-title": "",
239
- style: {
240
- display: "none"
241
- }
242
- }),
243
- showClose && /*#__PURE__*/ jsx("button", {
244
- type: "button",
245
- "data-tao-modal-close": "",
246
- className: cx(classNames?.close),
247
- style: stylesProp?.close,
248
- onClick: ()=>{
249
- closeConfig?.onClose?.();
250
- onClose?.();
100
+ const openAutoFocus = (event)=>{
101
+ restoreFocusRef.current = document.activeElement;
102
+ const button = focusable?.autoFocusButton !== void 0 ? focusable.autoFocusButton : autoFocusButton;
103
+ if (null === button) event.preventDefault();
104
+ else if (button) {
105
+ const target = contentRef.current?.querySelector(`[data-tao-modal-action="${button}"]`);
106
+ target?.focus();
107
+ if (target && document.activeElement === target) event.preventDefault();
108
+ }
109
+ };
110
+ const closeAutoFocus = (event)=>{
111
+ const restore = focusable?.focusTriggerAfterClose ?? focusTriggerAfterClose;
112
+ if (void 0 !== restore) event.preventDefault();
113
+ if (restore) restoreFocusRef.current?.focus();
114
+ };
115
+ const contents = /*#__PURE__*/ jsxs(Fragment, {
116
+ children: [
117
+ (null != title || showClose) && /*#__PURE__*/ jsxs("div", {
118
+ "data-tao-modal-header": "",
119
+ className: cx(classNames?.header),
120
+ style: stylesProp?.header,
121
+ children: [
122
+ null != title ? /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Title, {
123
+ "data-tao-modal-title": "",
124
+ className: cx(classNames?.title),
125
+ style: stylesProp?.title,
126
+ children: title
127
+ }) : /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Title, {
128
+ "data-tao-modal-title": "",
129
+ style: {
130
+ display: 'none'
131
+ }
132
+ }),
133
+ showClose && /*#__PURE__*/ jsx("button", {
134
+ type: "button",
135
+ "data-tao-modal-close": "",
136
+ className: cx(classNames?.close),
137
+ style: stylesProp?.close,
138
+ onClick: ()=>{
139
+ closeConfig?.onClose?.();
140
+ onClose?.();
141
+ },
142
+ disabled: closeConfig?.disabled,
143
+ "aria-label": closeConfig?.['aria-label'] ?? locale.close,
144
+ children: mergedCloseIcon ?? /*#__PURE__*/ jsx(CloseIcon, {})
145
+ })
146
+ ]
147
+ }),
148
+ /*#__PURE__*/ jsx("div", {
149
+ "data-tao-modal-body": "",
150
+ className: cx(classNames?.body),
151
+ style: stylesProp?.body,
152
+ children: children
153
+ }),
154
+ null != footerContent && /*#__PURE__*/ jsx("div", {
155
+ "data-tao-modal-footer": "",
156
+ className: cx(classNames?.footer),
157
+ style: stylesProp?.footer,
158
+ children: /*#__PURE__*/ jsx(ModalActionContext.Provider, {
159
+ value: {
160
+ ok: okButton,
161
+ cancel: cancelButton
251
162
  },
252
- disabled: closeConfig?.disabled,
253
- "aria-label": closeConfig?.["aria-label"] ?? locale.close,
254
- children: mergedCloseIcon ?? /*#__PURE__*/ jsx(CloseIcon, {})
163
+ children: footerContent
255
164
  })
256
- ]
257
- });
258
- $[39] = classNames?.close;
259
- $[40] = classNames?.header;
260
- $[41] = classNames?.title;
261
- $[42] = closeConfig;
262
- $[43] = locale;
263
- $[44] = mergedCloseIcon;
264
- $[45] = onClose;
265
- $[46] = showClose;
266
- $[47] = stylesProp?.close;
267
- $[48] = stylesProp?.header;
268
- $[49] = stylesProp?.title;
269
- $[50] = title;
270
- $[51] = t28;
271
- } else t28 = $[51];
272
- const t29 = classNames?.body;
273
- let t30;
274
- if ($[52] !== t29) {
275
- t30 = cx(t29);
276
- $[52] = t29;
277
- $[53] = t30;
278
- } else t30 = $[53];
279
- const t31 = stylesProp?.body;
280
- let t32;
281
- if ($[54] !== children || $[55] !== t30 || $[56] !== t31) {
282
- t32 = /*#__PURE__*/ jsx("div", {
283
- "data-tao-modal-body": "",
284
- className: t30,
285
- style: t31,
286
- children: children
287
- });
288
- $[54] = children;
289
- $[55] = t30;
290
- $[56] = t31;
291
- $[57] = t32;
292
- } else t32 = $[57];
293
- let t33;
294
- if ($[58] !== cancelButton || $[59] !== classNames?.footer || $[60] !== footerContent || $[61] !== okButton || $[62] !== stylesProp?.footer) {
295
- t33 = null != footerContent && /*#__PURE__*/ jsx("div", {
296
- "data-tao-modal-footer": "",
297
- className: cx(classNames?.footer),
298
- style: stylesProp?.footer,
299
- children: /*#__PURE__*/ jsx(ModalActionContext.Provider, {
300
- value: {
301
- ok: okButton,
302
- cancel: cancelButton
303
- },
304
- children: footerContent
305
165
  })
306
- });
307
- $[58] = cancelButton;
308
- $[59] = classNames?.footer;
309
- $[60] = footerContent;
310
- $[61] = okButton;
311
- $[62] = stylesProp?.footer;
312
- $[63] = t33;
313
- } else t33 = $[63];
314
- let t34;
315
- if ($[64] !== t28 || $[65] !== t32 || $[66] !== t33) {
316
- t34 = /*#__PURE__*/ jsxs(Fragment, {
317
- children: [
318
- t28,
319
- t32,
320
- t33
321
- ]
322
- });
323
- $[64] = t28;
324
- $[65] = t32;
325
- $[66] = t33;
326
- $[67] = t34;
327
- } else t34 = $[67];
328
- const contents = t34;
329
- const t35 = classNames?.root;
330
- const t36 = classNames?.container;
331
- let t37;
332
- if ($[68] !== t35 || $[69] !== t36 || $[70] !== transitionName) {
333
- t37 = cx(t35, t36, transitionName);
334
- $[68] = t35;
335
- $[69] = t36;
336
- $[70] = transitionName;
337
- $[71] = t37;
338
- } else t37 = $[71];
339
- let t38;
340
- if ($[72] !== ariaLabel || $[73] !== ariaLabelledBy) {
341
- t38 = ariaLabel || ariaLabelledBy ? {
342
- "aria-labelledby": ariaLabelledBy
343
- } : {};
344
- $[72] = ariaLabel;
345
- $[73] = ariaLabelledBy;
346
- $[74] = t38;
347
- } else t38 = $[74];
348
- let t39;
349
- if ($[75] !== customInteraction || $[76] !== openAutoFocus) {
350
- t39 = customInteraction ? _temp : openAutoFocus;
351
- $[75] = customInteraction;
352
- $[76] = openAutoFocus;
353
- $[77] = t39;
354
- } else t39 = $[77];
355
- let t40;
356
- if ($[78] !== closeAutoFocus || $[79] !== customInteraction) {
357
- t40 = customInteraction ? _temp2 : closeAutoFocus;
358
- $[78] = closeAutoFocus;
359
- $[79] = customInteraction;
360
- $[80] = t40;
361
- } else t40 = $[80];
362
- let t41;
363
- if ($[81] !== keyboard) {
364
- t41 = (event_5)=>{
365
- if (!keyboard || isEscapeForOpenCombobox(event_5)) event_5.preventDefault();
366
- };
367
- $[81] = keyboard;
368
- $[82] = t41;
369
- } else t41 = $[82];
370
- let t42;
371
- if ($[83] !== contents || $[84] !== customInteraction || $[85] !== focusRegistry) {
372
- t42 = customInteraction ? /*#__PURE__*/ jsx(ModalBranchProvider, {
166
+ ]
167
+ });
168
+ const content = /*#__PURE__*/ jsx(DialogContent, {
169
+ contentRef: setContentRef,
170
+ open: open,
171
+ keepAlive: keepAlive,
172
+ forceMount: forceMount,
173
+ "data-tao-modal": "",
174
+ style: contentStyle,
175
+ className: cx(classNames?.root, classNames?.container, transitionName),
176
+ "aria-modal": true,
177
+ "aria-label": ariaLabel,
178
+ ...ariaLabel || ariaLabelledBy ? {
179
+ 'aria-labelledby': ariaLabelledBy
180
+ } : {},
181
+ "aria-describedby": ariaDescribedBy,
182
+ onOpenAutoFocus: customInteraction ? (event)=>event.preventDefault() : openAutoFocus,
183
+ onCloseAutoFocus: customInteraction ? (event)=>event.preventDefault() : closeAutoFocus,
184
+ onEscapeKeyDown: (event)=>{
185
+ if (!keyboard || isEscapeForOpenCombobox(event)) event.preventDefault();
186
+ },
187
+ onPointerDownOutside: preventParentOutsideDismiss,
188
+ onInteractOutside: preventParentOutsideDismiss,
189
+ children: customInteraction ? /*#__PURE__*/ jsx(ModalBranchProvider, {
373
190
  registry: focusRegistry,
374
191
  children: contents
375
- }) : contents;
376
- $[83] = contents;
377
- $[84] = customInteraction;
378
- $[85] = focusRegistry;
379
- $[86] = t42;
380
- } else t42 = $[86];
381
- let t43;
382
- if ($[87] !== ariaDescribedBy || $[88] !== ariaLabel || $[89] !== contentStyle || $[90] !== forceMount || $[91] !== keepAlive || $[92] !== open || $[93] !== setContentRef || $[94] !== t37 || $[95] !== t38 || $[96] !== t39 || $[97] !== t40 || $[98] !== t41 || $[99] !== t42) {
383
- t43 = /*#__PURE__*/ jsx(DialogContent, {
384
- contentRef: setContentRef,
385
- open: open,
386
- keepAlive: keepAlive,
387
- forceMount: forceMount,
388
- "data-tao-modal": "",
389
- style: contentStyle,
390
- className: t37,
391
- "aria-modal": true,
392
- "aria-label": ariaLabel,
393
- ...t38,
394
- "aria-describedby": ariaDescribedBy,
395
- onOpenAutoFocus: t39,
396
- onCloseAutoFocus: t40,
397
- onEscapeKeyDown: t41,
398
- onPointerDownOutside: preventParentOutsideDismiss,
399
- onInteractOutside: preventParentOutsideDismiss,
400
- children: t42
401
- });
402
- $[87] = ariaDescribedBy;
403
- $[88] = ariaLabel;
404
- $[89] = contentStyle;
405
- $[90] = forceMount;
406
- $[91] = keepAlive;
407
- $[92] = open;
408
- $[93] = setContentRef;
409
- $[94] = t37;
410
- $[95] = t38;
411
- $[96] = t39;
412
- $[97] = t40;
413
- $[98] = t41;
414
- $[99] = t42;
415
- $[100] = t43;
416
- } else t43 = $[100];
417
- const content = t43;
418
- let t44;
419
- if ($[101] !== classNames?.mask || $[102] !== classNames?.overlay || $[103] !== closeOnMask || $[104] !== customInteraction || $[105] !== forceMount || $[106] !== keepAlive || $[107] !== mask || $[108] !== maskTransitionName || $[109] !== onClose || $[110] !== open || $[111] !== showMask || $[112] !== stylesProp?.mask || $[113] !== stylesProp?.overlay || $[114] !== zIndex) {
420
- t44 = !customInteraction && (!keepAlive || open) && /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Overlay, {
421
- forceMount: forceMount,
422
- "data-tao-modal-overlay": "",
423
- className: cx(classNames?.overlay, classNames?.mask, maskTransitionName),
424
- style: {
425
- zIndex,
426
- ...!showMask ? {
427
- background: "transparent",
428
- backdropFilter: "none",
429
- pointerEvents: "none"
430
- } : {},
431
- ..."object" == typeof mask && false === mask.blur ? {
432
- backdropFilter: "none"
433
- } : {},
434
- ...stylesProp?.overlay,
435
- ...stylesProp?.mask
436
- },
437
- onClick: closeOnMask ? onClose : void 0
438
- });
439
- $[101] = classNames?.mask;
440
- $[102] = classNames?.overlay;
441
- $[103] = closeOnMask;
442
- $[104] = customInteraction;
443
- $[105] = forceMount;
444
- $[106] = keepAlive;
445
- $[107] = mask;
446
- $[108] = maskTransitionName;
447
- $[109] = onClose;
448
- $[110] = open;
449
- $[111] = showMask;
450
- $[112] = stylesProp?.mask;
451
- $[113] = stylesProp?.overlay;
452
- $[114] = zIndex;
453
- $[115] = t44;
454
- } else t44 = $[115];
455
- let t45;
456
- if ($[116] !== classNames?.mask || $[117] !== classNames?.overlay || $[118] !== closeOnMask || $[119] !== customInteraction || $[120] !== mask || $[121] !== maskTransitionName || $[122] !== onClose || $[123] !== open || $[124] !== showMask || $[125] !== stylesProp?.mask || $[126] !== stylesProp?.overlay || $[127] !== zIndex) {
457
- t45 = customInteraction && showMask && open && /*#__PURE__*/ jsx("div", {
458
- "data-tao-modal-overlay": "",
459
- role: "presentation",
460
- className: cx(classNames?.overlay, classNames?.mask, maskTransitionName),
461
- style: {
462
- zIndex,
463
- ..."object" == typeof mask && false === mask.blur ? {
464
- backdropFilter: "none"
465
- } : {},
466
- ...stylesProp?.overlay,
467
- ...stylesProp?.mask
468
- },
469
- onPointerDown: (event_6)=>{
470
- if (closeOnMask && 0 === event_6.button) onClose?.();
471
- }
472
- });
473
- $[116] = classNames?.mask;
474
- $[117] = classNames?.overlay;
475
- $[118] = closeOnMask;
476
- $[119] = customInteraction;
477
- $[120] = mask;
478
- $[121] = maskTransitionName;
479
- $[122] = onClose;
480
- $[123] = open;
481
- $[124] = showMask;
482
- $[125] = stylesProp?.mask;
483
- $[126] = stylesProp?.overlay;
484
- $[127] = zIndex;
485
- $[128] = t45;
486
- } else t45 = $[128];
487
- const t46 = centered ? "" : void 0;
488
- const t47 = open ? "" : void 0;
489
- const t48 = classNames?.wrapper;
490
- const t49 = wrapProps?.className;
491
- let t50;
492
- if ($[129] !== t48 || $[130] !== t49) {
493
- t50 = cx(t48, t49);
494
- $[129] = t48;
495
- $[130] = t49;
496
- $[131] = t50;
497
- } else t50 = $[131];
498
- const t51 = void 0 === zIndex ? void 0 : zIndex + 1;
499
- const t52 = stylesProp?.wrapper;
500
- const t53 = wrapProps?.style;
501
- let t54;
502
- if ($[132] !== t51 || $[133] !== t52 || $[134] !== t53) {
503
- t54 = {
504
- pointerEvents: "none",
505
- zIndex: t51,
506
- ...t52,
507
- ...t53
508
- };
509
- $[132] = t51;
510
- $[133] = t52;
511
- $[134] = t53;
512
- $[135] = t54;
513
- } else t54 = $[135];
514
- let t55;
515
- if ($[136] !== closeAutoFocus || $[137] !== content || $[138] !== customInteraction || $[139] !== focusBranches || $[140] !== modalRender || $[141] !== open || $[142] !== openAutoFocus || $[143] !== scrollLock || $[144] !== trapFocus) {
516
- t55 = customInteraction ? /*#__PURE__*/ jsx(ModalInteractionScope, {
517
- open: open,
518
- scrollLock: scrollLock,
519
- trapFocus: trapFocus,
520
- branches: focusBranches,
521
- onOpenAutoFocus: openAutoFocus,
522
- onCloseAutoFocus: closeAutoFocus,
523
- children: modalRender ? modalRender(content) : content
524
- }) : modalRender ? modalRender(content) : content;
525
- $[136] = closeAutoFocus;
526
- $[137] = content;
527
- $[138] = customInteraction;
528
- $[139] = focusBranches;
529
- $[140] = modalRender;
530
- $[141] = open;
531
- $[142] = openAutoFocus;
532
- $[143] = scrollLock;
533
- $[144] = trapFocus;
534
- $[145] = t55;
535
- } else t55 = $[145];
536
- let t56;
537
- if ($[146] !== t46 || $[147] !== t47 || $[148] !== t50 || $[149] !== t54 || $[150] !== t55 || $[151] !== wrapProps) {
538
- t56 = /*#__PURE__*/ jsx("div", {
539
- ...wrapProps,
540
- role: "presentation",
541
- "data-tao-modal-wrap": "",
542
- "data-tao-centered": t46,
543
- "data-tao-open": t47,
544
- className: t50,
545
- style: t54,
546
- children: t55
547
- });
548
- $[146] = t46;
549
- $[147] = t47;
550
- $[148] = t50;
551
- $[149] = t54;
552
- $[150] = t55;
553
- $[151] = wrapProps;
554
- $[152] = t56;
555
- } else t56 = $[152];
556
- let t57;
557
- if ($[153] !== t44 || $[154] !== t45 || $[155] !== t56) {
558
- t57 = /*#__PURE__*/ jsxs(TaoPortalScope, {
559
- children: [
560
- t44,
561
- t45,
562
- t56
563
- ]
564
- });
565
- $[153] = t44;
566
- $[154] = t45;
567
- $[155] = t56;
568
- $[156] = t57;
569
- } else t57 = $[156];
570
- const layer = t57;
192
+ }) : contents
193
+ });
194
+ const layer = /*#__PURE__*/ jsxs(TaoPortalScope, {
195
+ children: [
196
+ !customInteraction && (!keepAlive || open) && /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Overlay, {
197
+ forceMount: forceMount,
198
+ "data-tao-modal-overlay": "",
199
+ className: cx(classNames?.overlay, classNames?.mask, maskTransitionName),
200
+ style: {
201
+ zIndex,
202
+ ...!showMask ? {
203
+ background: 'transparent',
204
+ backdropFilter: 'none',
205
+ pointerEvents: 'none'
206
+ } : {},
207
+ ...'object' == typeof mask && false === mask.blur ? {
208
+ backdropFilter: 'none'
209
+ } : {},
210
+ ...stylesProp?.overlay,
211
+ ...stylesProp?.mask
212
+ },
213
+ onClick: closeOnMask ? onClose : void 0
214
+ }),
215
+ customInteraction && showMask && open && /*#__PURE__*/ jsx("div", {
216
+ "data-tao-modal-overlay": "",
217
+ role: "presentation",
218
+ className: cx(classNames?.overlay, classNames?.mask, maskTransitionName),
219
+ style: {
220
+ zIndex,
221
+ ...'object' == typeof mask && false === mask.blur ? {
222
+ backdropFilter: 'none'
223
+ } : {},
224
+ ...stylesProp?.overlay,
225
+ ...stylesProp?.mask
226
+ },
227
+ onPointerDown: (event)=>{
228
+ if (closeOnMask && 0 === event.button) onClose?.();
229
+ }
230
+ }),
231
+ /*#__PURE__*/ jsx("div", {
232
+ ...wrapProps,
233
+ role: "presentation",
234
+ "data-tao-modal-wrap": "",
235
+ "data-tao-centered": centered ? '' : void 0,
236
+ "data-tao-open": open ? '' : void 0,
237
+ className: cx(classNames?.wrapper, wrapProps?.className),
238
+ style: {
239
+ pointerEvents: 'none',
240
+ zIndex: void 0 === zIndex ? void 0 : zIndex + 1,
241
+ ...stylesProp?.wrapper,
242
+ ...wrapProps?.style
243
+ },
244
+ children: customInteraction ? /*#__PURE__*/ jsx(ModalInteractionScope, {
245
+ open: open,
246
+ scrollLock: scrollLock,
247
+ trapFocus: trapFocus,
248
+ branches: focusBranches,
249
+ onOpenAutoFocus: openAutoFocus,
250
+ onCloseAutoFocus: closeAutoFocus,
251
+ children: modalRender ? modalRender(content) : content
252
+ }) : modalRender ? modalRender(content) : content
253
+ })
254
+ ]
255
+ });
571
256
  const [container, setContainer] = useState();
572
- let t58;
573
- if ($[157] !== getContainer) {
574
- t58 = ()=>{
575
- if (!getContainer) return;
576
- const next = "string" == typeof getContainer ? document.querySelector(getContainer) : "function" == typeof getContainer ? getContainer() : getContainer;
577
- if (!next) throw new Error(`Modal getContainer did not resolve an element: ${getContainer}`);
578
- setContainer(next);
579
- };
580
- $[157] = getContainer;
581
- $[158] = t58;
582
- } else t58 = $[158];
583
- useLayoutEffect(t58);
584
- const t59 = !customInteraction;
585
- let t60;
586
- if ($[159] !== onClose) {
587
- t60 = (value)=>{
588
- if (!value) onClose?.();
589
- };
590
- $[159] = onClose;
591
- $[160] = t60;
592
- } else t60 = $[160];
593
- let t61;
594
- if ($[161] !== container || $[162] !== forceMount || $[163] !== getContainer || $[164] !== layer) {
595
- t61 = false === getContainer ? layer : getContainer && !container ? null : /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Portal, {
596
- forceMount: forceMount,
597
- container: getContainer ? container : void 0,
598
- children: layer
599
- });
600
- $[161] = container;
601
- $[162] = forceMount;
602
- $[163] = getContainer;
603
- $[164] = layer;
604
- $[165] = t61;
605
- } else t61 = $[165];
606
- let t62;
607
- if ($[166] !== open || $[167] !== t59 || $[168] !== t60 || $[169] !== t61) {
608
- t62 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Root, {
257
+ useLayoutEffect(()=>{
258
+ if (!getContainer) return;
259
+ const next = 'string' == typeof getContainer ? document.querySelector(getContainer) : 'function' == typeof getContainer ? getContainer() : getContainer;
260
+ if (!next) throw new Error(`Modal getContainer did not resolve an element: ${getContainer}`);
261
+ setContainer(next);
262
+ });
263
+ return /*#__PURE__*/ jsx(TaoProvider, {
264
+ direction: direction,
265
+ children: /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Root, {
609
266
  open: open,
610
- modal: t59,
611
- onOpenChange: t60,
612
- children: t61
613
- });
614
- $[166] = open;
615
- $[167] = t59;
616
- $[168] = t60;
617
- $[169] = t61;
618
- $[170] = t62;
619
- } else t62 = $[170];
620
- let t63;
621
- if ($[171] !== direction || $[172] !== t62) {
622
- t63 = /*#__PURE__*/ jsx(TaoProvider, {
623
- direction: direction,
624
- children: t62
625
- });
626
- $[171] = direction;
627
- $[172] = t62;
628
- $[173] = t63;
629
- } else t63 = $[173];
630
- return t63;
631
- }
632
- function _temp2(event_4) {
633
- return event_4.preventDefault();
634
- }
635
- function _temp(event_3) {
636
- return event_3.preventDefault();
267
+ modal: !customInteraction,
268
+ onOpenChange: (value)=>{
269
+ if (!value) onClose?.();
270
+ },
271
+ children: false === getContainer ? layer : getContainer && !container ? null : /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Portal, {
272
+ forceMount: forceMount,
273
+ container: getContainer ? container : void 0,
274
+ children: layer
275
+ })
276
+ })
277
+ });
637
278
  }
638
- function ModalInteractionScope(t0) {
639
- const $ = c(19);
640
- const { open, scrollLock, trapFocus, branches, onOpenAutoFocus, onCloseAutoFocus, children } = t0;
279
+ function ModalInteractionScope({ open, scrollLock, trapFocus, branches, onOpenAutoFocus, onCloseAutoFocus, children }) {
641
280
  const [node, setNode] = useState(null);
642
- let t1;
643
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
644
- t1 = {};
645
- $[0] = t1;
646
- } else t1 = $[0];
647
- const [scopeProps, setScopeProps] = useState(t1);
648
- const t2 = open && scrollLock;
649
- const t3 = open ? scopeProps : void 0;
650
- let t4;
651
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
652
- t4 = {
653
- display: "contents"
654
- };
655
- $[1] = t4;
656
- } else t4 = $[1];
657
- let t5;
658
- if ($[2] !== children || $[3] !== t3) {
659
- t5 = /*#__PURE__*/ jsx("div", {
660
- ...t3,
661
- style: t4,
662
- children: children
663
- });
664
- $[2] = children;
665
- $[3] = t3;
666
- $[4] = t5;
667
- } else t5 = $[4];
668
- let t6;
669
- if ($[5] !== branches || $[6] !== t2 || $[7] !== t5) {
670
- t6 = /*#__PURE__*/ jsx(RemoveScroll, {
671
- ref: setNode,
672
- enabled: t2,
673
- allowPinchZoom: true,
674
- shards: branches,
675
- forwardProps: true,
676
- children: t5
677
- });
678
- $[5] = branches;
679
- $[6] = t2;
680
- $[7] = t5;
681
- $[8] = t6;
682
- } else t6 = $[8];
683
- let t7;
684
- if ($[9] !== branches || $[10] !== node || $[11] !== onCloseAutoFocus || $[12] !== onOpenAutoFocus || $[13] !== open || $[14] !== trapFocus) {
685
- t7 = open && node && /*#__PURE__*/ jsx(FocusScope, {
686
- asChild: true,
687
- loop: trapFocus,
688
- trapped: trapFocus,
689
- branches: branches,
690
- onMountAutoFocus: onOpenAutoFocus,
691
- onUnmountAutoFocus: onCloseAutoFocus,
692
- children: /*#__PURE__*/ jsx(modal_ModalScopeHost, {
693
- node: node,
694
- onPropsChange: setScopeProps
281
+ const [scopeProps, setScopeProps] = useState({});
282
+ return /*#__PURE__*/ jsxs(Fragment, {
283
+ children: [
284
+ /*#__PURE__*/ jsx(RemoveScroll, {
285
+ ref: setNode,
286
+ enabled: open && scrollLock,
287
+ allowPinchZoom: true,
288
+ shards: branches,
289
+ forwardProps: true,
290
+ children: /*#__PURE__*/ jsx("div", {
291
+ ...open ? scopeProps : void 0,
292
+ style: {
293
+ display: 'contents'
294
+ },
295
+ children: children
296
+ })
297
+ }),
298
+ open && node && /*#__PURE__*/ jsx(FocusScope, {
299
+ asChild: true,
300
+ loop: trapFocus,
301
+ trapped: trapFocus,
302
+ branches: branches,
303
+ onMountAutoFocus: onOpenAutoFocus,
304
+ onUnmountAutoFocus: onCloseAutoFocus,
305
+ children: /*#__PURE__*/ jsx(modal_ModalScopeHost, {
306
+ node: node,
307
+ onPropsChange: setScopeProps
308
+ })
695
309
  })
696
- });
697
- $[9] = branches;
698
- $[10] = node;
699
- $[11] = onCloseAutoFocus;
700
- $[12] = onOpenAutoFocus;
701
- $[13] = open;
702
- $[14] = trapFocus;
703
- $[15] = t7;
704
- } else t7 = $[15];
705
- let t8;
706
- if ($[16] !== t6 || $[17] !== t7) {
707
- t8 = /*#__PURE__*/ jsxs(Fragment, {
708
- children: [
709
- t6,
710
- t7
711
- ]
712
- });
713
- $[16] = t6;
714
- $[17] = t7;
715
- $[18] = t8;
716
- } else t8 = $[18];
717
- return t8;
310
+ ]
311
+ });
718
312
  }
719
- const modal_ModalScopeHost = /*#__PURE__*/ memo(/*#__PURE__*/ forwardRef(function(t0, ref) {
720
- const $ = c(10);
721
- let node;
722
- let onPropsChange;
723
- let props;
724
- if ($[0] !== t0) {
725
- ({ node, onPropsChange, ...props } = t0);
726
- $[0] = t0;
727
- $[1] = node;
728
- $[2] = onPropsChange;
729
- $[3] = props;
730
- } else {
731
- node = $[1];
732
- onPropsChange = $[2];
733
- props = $[3];
734
- }
735
- let t1;
736
- let t2;
737
- if ($[4] !== node) {
738
- t1 = ()=>node;
739
- t2 = [
740
- node
741
- ];
742
- $[4] = node;
743
- $[5] = t1;
744
- $[6] = t2;
745
- } else {
746
- t1 = $[5];
747
- t2 = $[6];
748
- }
749
- useImperativeHandle(ref, t1, t2);
750
- let t3;
751
- if ($[7] !== onPropsChange || $[8] !== props) {
752
- t3 = ()=>{
753
- onPropsChange(props);
754
- };
755
- $[7] = onPropsChange;
756
- $[8] = props;
757
- $[9] = t3;
758
- } else t3 = $[9];
759
- useLayoutEffect(t3);
313
+ const modal_ModalScopeHost = /*#__PURE__*/ memo(/*#__PURE__*/ forwardRef(function({ node, onPropsChange, ...props }, ref) {
314
+ useImperativeHandle(ref, ()=>node, [
315
+ node
316
+ ]);
317
+ useLayoutEffect(()=>{
318
+ onPropsChange(props);
319
+ });
760
320
  return null;
761
321
  }));
762
322
  function CloseIcon() {
763
- const $ = c(1);
764
- let t0;
765
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
766
- t0 = /*#__PURE__*/ jsx("svg", {
767
- "aria-hidden": "true",
768
- focusable: "false",
769
- width: "16",
770
- height: "16",
771
- viewBox: "0 0 24 24",
772
- fill: "none",
773
- stroke: "currentColor",
774
- strokeWidth: "2",
775
- strokeLinecap: "round",
776
- strokeLinejoin: "round",
777
- children: /*#__PURE__*/ jsx("path", {
778
- d: "M18 6 6 18M6 6l12 12"
779
- })
780
- });
781
- $[0] = t0;
782
- } else t0 = $[0];
783
- return t0;
323
+ return /*#__PURE__*/ jsx("svg", {
324
+ "aria-hidden": "true",
325
+ focusable: "false",
326
+ width: "16",
327
+ height: "16",
328
+ viewBox: "0 0 24 24",
329
+ fill: "none",
330
+ stroke: "currentColor",
331
+ strokeWidth: "2",
332
+ strokeLinecap: "round",
333
+ strokeLinejoin: "round",
334
+ children: /*#__PURE__*/ jsx("path", {
335
+ d: "M18 6 6 18M6 6l12 12"
336
+ })
337
+ });
784
338
  }
785
339
  export { Modal };