huibo-ui 0.4.0 → 0.5.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 (656) hide show
  1. package/dist/cjs/{a11y-802de67a.js → a11y-4385c871.js} +17 -2
  2. package/dist/cjs/a11y-4385c871.js.map +1 -0
  3. package/dist/cjs/{date-helpers-1ffddc59.js → date-helpers-c05ef385.js} +5 -16
  4. package/dist/cjs/date-helpers-c05ef385.js.map +1 -0
  5. package/dist/cjs/hb-alert.cjs.entry.js +2 -1
  6. package/dist/cjs/hb-alert.cjs.entry.js.map +1 -1
  7. package/dist/cjs/hb-calendar.cjs.entry.js +2 -2
  8. package/dist/cjs/hb-calendar.cjs.entry.js.map +1 -1
  9. package/dist/cjs/hb-cascader.cjs.entry.js +48 -12
  10. package/dist/cjs/hb-cascader.cjs.entry.js.map +1 -1
  11. package/dist/cjs/hb-checkbox-group.cjs.entry.js +12 -8
  12. package/dist/cjs/hb-checkbox-group.cjs.entry.js.map +1 -1
  13. package/dist/cjs/hb-checkbox.cjs.entry.js +9 -4
  14. package/dist/cjs/hb-checkbox.cjs.entry.js.map +1 -1
  15. package/dist/cjs/hb-collapse-item.cjs.entry.js +13 -4
  16. package/dist/cjs/hb-collapse-item.cjs.entry.js.map +1 -1
  17. package/dist/cjs/hb-collapse.cjs.entry.js +20 -15
  18. package/dist/cjs/hb-collapse.cjs.entry.js.map +1 -1
  19. package/dist/cjs/hb-color-picker.cjs.entry.js +22 -19
  20. package/dist/cjs/hb-color-picker.cjs.entry.js.map +1 -1
  21. package/dist/cjs/hb-date-picker-pane.cjs.entry.js +1 -1
  22. package/dist/cjs/hb-date-picker.cjs.entry.js +13 -10
  23. package/dist/cjs/hb-date-picker.cjs.entry.js.map +1 -1
  24. package/dist/cjs/hb-date-range-picker.cjs.entry.js +1 -1
  25. package/dist/cjs/hb-date-time-picker.cjs.entry.js +1 -1
  26. package/dist/cjs/hb-descriptions.cjs.entry.js.map +1 -1
  27. package/dist/cjs/hb-dialog.cjs.entry.js +51 -12
  28. package/dist/cjs/hb-dialog.cjs.entry.js.map +1 -1
  29. package/dist/cjs/hb-drawer.cjs.entry.js +34 -4
  30. package/dist/cjs/hb-drawer.cjs.entry.js.map +1 -1
  31. package/dist/cjs/hb-dropdown.cjs.entry.js +27 -15
  32. package/dist/cjs/hb-dropdown.cjs.entry.js.map +1 -1
  33. package/dist/cjs/hb-empty.cjs.entry.js +1 -1
  34. package/dist/cjs/hb-float-button.cjs.entry.js +2 -2
  35. package/dist/cjs/hb-form-item.cjs.entry.js +11 -10
  36. package/dist/cjs/hb-form-item.cjs.entry.js.map +1 -1
  37. package/dist/cjs/hb-form.cjs.entry.js +12 -7
  38. package/dist/cjs/hb-form.cjs.entry.js.map +1 -1
  39. package/dist/cjs/hb-image-preview.cjs.entry.js +1 -1
  40. package/dist/cjs/hb-image-preview.cjs.entry.js.map +1 -1
  41. package/dist/cjs/hb-image.cjs.entry.js +21 -3
  42. package/dist/cjs/hb-image.cjs.entry.js.map +1 -1
  43. package/dist/cjs/hb-input-number.cjs.entry.js +7 -7
  44. package/dist/cjs/hb-input-number.cjs.entry.js.map +1 -1
  45. package/dist/cjs/hb-input-tag.cjs.entry.js +2 -2
  46. package/dist/cjs/hb-input.cjs.entry.js +3 -2
  47. package/dist/cjs/hb-input.cjs.entry.js.map +1 -1
  48. package/dist/cjs/hb-layout.cjs.entry.js.map +1 -1
  49. package/dist/cjs/hb-link.cjs.entry.js +2 -2
  50. package/dist/cjs/hb-loading.cjs.entry.js +2 -2
  51. package/dist/cjs/hb-menu-item.cjs.entry.js +14 -5
  52. package/dist/cjs/hb-menu-item.cjs.entry.js.map +1 -1
  53. package/dist/cjs/hb-menu.cjs.entry.js +2 -2
  54. package/dist/cjs/hb-message.cjs.entry.js +13 -4
  55. package/dist/cjs/hb-message.cjs.entry.js.map +1 -1
  56. package/dist/cjs/hb-page-header.cjs.entry.js +1 -1
  57. package/dist/cjs/hb-pagination.cjs.entry.js +8 -5
  58. package/dist/cjs/hb-pagination.cjs.entry.js.map +1 -1
  59. package/dist/cjs/hb-popconfirm.cjs.entry.js +27 -8
  60. package/dist/cjs/hb-popconfirm.cjs.entry.js.map +1 -1
  61. package/dist/cjs/hb-popover.cjs.entry.js +26 -14
  62. package/dist/cjs/hb-popover.cjs.entry.js.map +1 -1
  63. package/dist/cjs/hb-progress.cjs.entry.js +1 -1
  64. package/dist/cjs/hb-radio.cjs.entry.js +8 -3
  65. package/dist/cjs/hb-radio.cjs.entry.js.map +1 -1
  66. package/dist/cjs/hb-rate.cjs.entry.js +3 -3
  67. package/dist/cjs/hb-rate.cjs.entry.js.map +1 -1
  68. package/dist/cjs/hb-row.cjs.entry.js +2 -2
  69. package/dist/cjs/hb-scrollbar.cjs.entry.js +5 -5
  70. package/dist/cjs/hb-scrollbar.cjs.entry.js.map +1 -1
  71. package/dist/cjs/hb-segmented.cjs.entry.js +13 -2
  72. package/dist/cjs/hb-segmented.cjs.entry.js.map +1 -1
  73. package/dist/cjs/hb-select.cjs.entry.js +21 -12
  74. package/dist/cjs/hb-select.cjs.entry.js.map +1 -1
  75. package/dist/cjs/hb-slider.cjs.entry.js +6 -12
  76. package/dist/cjs/hb-slider.cjs.entry.js.map +1 -1
  77. package/dist/cjs/hb-space.cjs.entry.js +2 -2
  78. package/dist/cjs/hb-statistic.cjs.entry.js +1 -1
  79. package/dist/cjs/hb-step.cjs.entry.js +1 -1
  80. package/dist/cjs/hb-steps.cjs.entry.js +2 -2
  81. package/dist/cjs/hb-steps.cjs.entry.js.map +1 -1
  82. package/dist/cjs/hb-sub-menu.cjs.entry.js +5 -5
  83. package/dist/cjs/hb-switch.cjs.entry.js +3 -3
  84. package/dist/cjs/hb-switch.cjs.entry.js.map +1 -1
  85. package/dist/cjs/hb-tab-pane.cjs.entry.js +1 -1
  86. package/dist/cjs/hb-table.cjs.entry.js +25 -16
  87. package/dist/cjs/hb-table.cjs.entry.js.map +1 -1
  88. package/dist/cjs/hb-tabs.cjs.entry.js +31 -10
  89. package/dist/cjs/hb-tabs.cjs.entry.js.map +1 -1
  90. package/dist/cjs/hb-tag.cjs.entry.js +3 -2
  91. package/dist/cjs/hb-tag.cjs.entry.js.map +1 -1
  92. package/dist/cjs/hb-text.cjs.entry.js +2 -2
  93. package/dist/cjs/hb-time-picker.cjs.entry.js +14 -9
  94. package/dist/cjs/hb-time-picker.cjs.entry.js.map +1 -1
  95. package/dist/cjs/hb-time-select.cjs.entry.js +13 -4
  96. package/dist/cjs/hb-time-select.cjs.entry.js.map +1 -1
  97. package/dist/cjs/hb-tooltip.cjs.entry.js +30 -10
  98. package/dist/cjs/hb-tooltip.cjs.entry.js.map +1 -1
  99. package/dist/cjs/hb-tree-select.cjs.entry.js +125 -10
  100. package/dist/cjs/hb-tree-select.cjs.entry.js.map +1 -1
  101. package/dist/cjs/hb-tree.cjs.entry.js +145 -12
  102. package/dist/cjs/hb-tree.cjs.entry.js.map +1 -1
  103. package/dist/cjs/hb-watermark.cjs.entry.js +19 -11
  104. package/dist/cjs/hb-watermark.cjs.entry.js.map +1 -1
  105. package/dist/cjs/huibo-ui.cjs.js +1 -1
  106. package/dist/cjs/loader.cjs.js +1 -1
  107. package/dist/cjs/transition-59f1da0f.js +34 -0
  108. package/dist/cjs/transition-59f1da0f.js.map +1 -0
  109. package/dist/collection/components/Alert/Alert.js +2 -1
  110. package/dist/collection/components/Alert/Alert.js.map +1 -1
  111. package/dist/collection/components/Calendar/Calendar.js +2 -2
  112. package/dist/collection/components/Calendar/Calendar.js.map +1 -1
  113. package/dist/collection/components/Cascader/Cascader.js +47 -11
  114. package/dist/collection/components/Cascader/Cascader.js.map +1 -1
  115. package/dist/collection/components/Checkbox/Checkbox.js +9 -4
  116. package/dist/collection/components/Checkbox/Checkbox.js.map +1 -1
  117. package/dist/collection/components/Checkbox/CheckboxGroup.js +12 -8
  118. package/dist/collection/components/Checkbox/CheckboxGroup.js.map +1 -1
  119. package/dist/collection/components/Collapse/Collapse.js +20 -15
  120. package/dist/collection/components/Collapse/Collapse.js.map +1 -1
  121. package/dist/collection/components/Collapse/CollapseItem.js +33 -4
  122. package/dist/collection/components/Collapse/CollapseItem.js.map +1 -1
  123. package/dist/collection/components/ColorPicker/ColorPicker.js +22 -19
  124. package/dist/collection/components/ColorPicker/ColorPicker.js.map +1 -1
  125. package/dist/collection/components/ColorPicker/color-picker.css +8 -3
  126. package/dist/collection/components/DatePicker/DatePicker.js +12 -9
  127. package/dist/collection/components/DatePicker/DatePicker.js.map +1 -1
  128. package/dist/collection/components/DatePicker/date-picker.css +3 -2
  129. package/dist/collection/components/Descriptions/descriptions.css +30 -10
  130. package/dist/collection/components/Dialog/Dialog.js +54 -10
  131. package/dist/collection/components/Dialog/Dialog.js.map +1 -1
  132. package/dist/collection/components/Dialog/dialog.css +57 -11
  133. package/dist/collection/components/Drawer/Drawer.js +34 -3
  134. package/dist/collection/components/Drawer/Drawer.js.map +1 -1
  135. package/dist/collection/components/Drawer/drawer.css +207 -17
  136. package/dist/collection/components/Dropdown/Dropdown.js +28 -13
  137. package/dist/collection/components/Dropdown/Dropdown.js.map +1 -1
  138. package/dist/collection/components/Dropdown/dropdown.css +24 -2
  139. package/dist/collection/components/Empty/Empty.js +1 -1
  140. package/dist/collection/components/FloatButton/FloatButton.js +2 -2
  141. package/dist/collection/components/Form/Form.js +14 -9
  142. package/dist/collection/components/Form/Form.js.map +1 -1
  143. package/dist/collection/components/Form/FormItem.js +13 -12
  144. package/dist/collection/components/Form/FormItem.js.map +1 -1
  145. package/dist/collection/components/Form/form-item.css +8 -2
  146. package/dist/collection/components/Image/Image.js +24 -3
  147. package/dist/collection/components/Image/Image.js.map +1 -1
  148. package/dist/collection/components/ImagePreview/ImagePreview.js +1 -1
  149. package/dist/collection/components/ImagePreview/ImagePreview.js.map +1 -1
  150. package/dist/collection/components/Input/Input.js +3 -2
  151. package/dist/collection/components/Input/Input.js.map +1 -1
  152. package/dist/collection/components/Input/input.css +1 -2
  153. package/dist/collection/components/InputNumber/InputNumber.js +6 -6
  154. package/dist/collection/components/InputNumber/InputNumber.js.map +1 -1
  155. package/dist/collection/components/InputNumber/input-number.css +11 -1
  156. package/dist/collection/components/InputTag/InputTag.js +2 -2
  157. package/dist/collection/components/Layout/Layout.js.map +1 -1
  158. package/dist/collection/components/Layout/Row.js +2 -2
  159. package/dist/collection/components/Layout/layout.css +1713 -576
  160. package/dist/collection/components/Link/Link.js +2 -2
  161. package/dist/collection/components/Loading/Loading.js +2 -2
  162. package/dist/collection/components/Menu/Menu.js +2 -2
  163. package/dist/collection/components/Menu/MenuItem.js +34 -5
  164. package/dist/collection/components/Menu/MenuItem.js.map +1 -1
  165. package/dist/collection/components/Menu/SubMenu.js +4 -4
  166. package/dist/collection/components/Message/Message.js +13 -4
  167. package/dist/collection/components/Message/Message.js.map +1 -1
  168. package/dist/collection/components/PageHeader/PageHeader.js +1 -1
  169. package/dist/collection/components/Pagination/Pagination.js +8 -5
  170. package/dist/collection/components/Pagination/Pagination.js.map +1 -1
  171. package/dist/collection/components/Popconfirm/Popconfirm.js +28 -6
  172. package/dist/collection/components/Popconfirm/Popconfirm.js.map +1 -1
  173. package/dist/collection/components/Popconfirm/popconfirm.css +80 -16
  174. package/dist/collection/components/Popover/Popover.js +27 -12
  175. package/dist/collection/components/Popover/Popover.js.map +1 -1
  176. package/dist/collection/components/Popover/popover.css +49 -8
  177. package/dist/collection/components/Progress/Progress.js +1 -1
  178. package/dist/collection/components/Radio/Radio.js +8 -3
  179. package/dist/collection/components/Radio/Radio.js.map +1 -1
  180. package/dist/collection/components/Rate/Rate.js +3 -3
  181. package/dist/collection/components/Rate/Rate.js.map +1 -1
  182. package/dist/collection/components/Scrollbar/Scrollbar.js +5 -5
  183. package/dist/collection/components/Scrollbar/Scrollbar.js.map +1 -1
  184. package/dist/collection/components/Segmented/Segmented.js +15 -1
  185. package/dist/collection/components/Segmented/Segmented.js.map +1 -1
  186. package/dist/collection/components/Select/Select.js +21 -12
  187. package/dist/collection/components/Select/Select.js.map +1 -1
  188. package/dist/collection/components/Select/select.css +0 -1
  189. package/dist/collection/components/Slider/Slider.js +6 -12
  190. package/dist/collection/components/Slider/Slider.js.map +1 -1
  191. package/dist/collection/components/Slider/slider.css +0 -1
  192. package/dist/collection/components/Space/Space.js +2 -2
  193. package/dist/collection/components/Statistic/Statistic.js +1 -1
  194. package/dist/collection/components/Steps/Step.js +1 -1
  195. package/dist/collection/components/Steps/Steps.js +2 -2
  196. package/dist/collection/components/Steps/Steps.js.map +1 -1
  197. package/dist/collection/components/Switch/Switch.js +3 -3
  198. package/dist/collection/components/Switch/Switch.js.map +1 -1
  199. package/dist/collection/components/Switch/switch.css +3 -2
  200. package/dist/collection/components/Table/Table.js +25 -16
  201. package/dist/collection/components/Table/Table.js.map +1 -1
  202. package/dist/collection/components/Table/table.css +6 -2
  203. package/dist/collection/components/Tabs/TabPane.js +1 -1
  204. package/dist/collection/components/Tabs/Tabs.js +31 -10
  205. package/dist/collection/components/Tabs/Tabs.js.map +1 -1
  206. package/dist/collection/components/Tag/Tag.js +3 -2
  207. package/dist/collection/components/Tag/Tag.js.map +1 -1
  208. package/dist/collection/components/Text/Text.js +2 -2
  209. package/dist/collection/components/TimePicker/TimePicker.js +14 -9
  210. package/dist/collection/components/TimePicker/TimePicker.js.map +1 -1
  211. package/dist/collection/components/TimeSelect/TimeSelect.js +13 -4
  212. package/dist/collection/components/TimeSelect/TimeSelect.js.map +1 -1
  213. package/dist/collection/components/Tooltip/Tooltip.js +31 -8
  214. package/dist/collection/components/Tooltip/Tooltip.js.map +1 -1
  215. package/dist/collection/components/Tooltip/tooltip.css +24 -2
  216. package/dist/collection/components/Tree/Tree.js +147 -13
  217. package/dist/collection/components/Tree/Tree.js.map +1 -1
  218. package/dist/collection/components/TreeSelect/TreeSelect.js +130 -11
  219. package/dist/collection/components/TreeSelect/TreeSelect.js.map +1 -1
  220. package/dist/collection/components/Watermark/Watermark.js +19 -11
  221. package/dist/collection/components/Watermark/Watermark.js.map +1 -1
  222. package/dist/collection/utils/a11y.js +15 -1
  223. package/dist/collection/utils/a11y.js.map +1 -1
  224. package/dist/collection/utils/date-helpers.js +4 -15
  225. package/dist/collection/utils/date-helpers.js.map +1 -1
  226. package/dist/collection/utils/transition.js +29 -0
  227. package/dist/collection/utils/transition.js.map +1 -0
  228. package/dist/components/hb-alert.js +2 -1
  229. package/dist/components/hb-alert.js.map +1 -1
  230. package/dist/components/hb-calendar.js +2 -2
  231. package/dist/components/hb-calendar.js.map +1 -1
  232. package/dist/components/hb-cascader.js +48 -12
  233. package/dist/components/hb-cascader.js.map +1 -1
  234. package/dist/components/hb-checkbox-group.js +12 -8
  235. package/dist/components/hb-checkbox-group.js.map +1 -1
  236. package/dist/components/hb-checkbox.js +9 -4
  237. package/dist/components/hb-checkbox.js.map +1 -1
  238. package/dist/components/hb-collapse-item.js +14 -4
  239. package/dist/components/hb-collapse-item.js.map +1 -1
  240. package/dist/components/hb-collapse.js +20 -15
  241. package/dist/components/hb-collapse.js.map +1 -1
  242. package/dist/components/hb-color-picker.js +22 -19
  243. package/dist/components/hb-color-picker.js.map +1 -1
  244. package/dist/components/hb-date-picker-pane.js +1 -1
  245. package/dist/components/hb-date-picker.js +13 -10
  246. package/dist/components/hb-date-picker.js.map +1 -1
  247. package/dist/components/hb-date-range-picker.js +1 -1
  248. package/dist/components/hb-date-time-picker.js +1 -1
  249. package/dist/components/hb-descriptions.js.map +1 -1
  250. package/dist/components/hb-dialog.js +53 -13
  251. package/dist/components/hb-dialog.js.map +1 -1
  252. package/dist/components/hb-drawer.js +36 -5
  253. package/dist/components/hb-drawer.js.map +1 -1
  254. package/dist/components/hb-dropdown.js +28 -15
  255. package/dist/components/hb-dropdown.js.map +1 -1
  256. package/dist/components/hb-empty.js +1 -1
  257. package/dist/components/hb-float-button.js +2 -2
  258. package/dist/components/hb-form-item.js +11 -10
  259. package/dist/components/hb-form-item.js.map +1 -1
  260. package/dist/components/hb-form.js +12 -7
  261. package/dist/components/hb-form.js.map +1 -1
  262. package/dist/components/hb-image-preview.js +1 -1
  263. package/dist/components/hb-image-preview.js.map +1 -1
  264. package/dist/components/hb-image.js +23 -3
  265. package/dist/components/hb-image.js.map +1 -1
  266. package/dist/components/hb-input-number.js +7 -7
  267. package/dist/components/hb-input-number.js.map +1 -1
  268. package/dist/components/hb-input-tag.js +2 -2
  269. package/dist/components/hb-input.js +3 -2
  270. package/dist/components/hb-input.js.map +1 -1
  271. package/dist/components/hb-layout.js.map +1 -1
  272. package/dist/components/hb-link.js +2 -2
  273. package/dist/components/hb-loading.js +2 -2
  274. package/dist/components/hb-menu-item.js +15 -5
  275. package/dist/components/hb-menu-item.js.map +1 -1
  276. package/dist/components/hb-menu.js +2 -2
  277. package/dist/components/hb-message.js +13 -4
  278. package/dist/components/hb-message.js.map +1 -1
  279. package/dist/components/hb-page-header.js +1 -1
  280. package/dist/components/hb-pagination.js +8 -5
  281. package/dist/components/hb-pagination.js.map +1 -1
  282. package/dist/components/hb-popconfirm.js +28 -8
  283. package/dist/components/hb-popconfirm.js.map +1 -1
  284. package/dist/components/hb-popover.js +27 -14
  285. package/dist/components/hb-popover.js.map +1 -1
  286. package/dist/components/hb-progress.js +1 -1
  287. package/dist/components/hb-radio.js +8 -3
  288. package/dist/components/hb-radio.js.map +1 -1
  289. package/dist/components/hb-rate.js +3 -3
  290. package/dist/components/hb-rate.js.map +1 -1
  291. package/dist/components/hb-row.js +2 -2
  292. package/dist/components/hb-scrollbar.js +5 -5
  293. package/dist/components/hb-scrollbar.js.map +1 -1
  294. package/dist/components/hb-segmented.js +15 -2
  295. package/dist/components/hb-segmented.js.map +1 -1
  296. package/dist/components/hb-select.js +21 -12
  297. package/dist/components/hb-select.js.map +1 -1
  298. package/dist/components/hb-slider.js +6 -12
  299. package/dist/components/hb-slider.js.map +1 -1
  300. package/dist/components/hb-space.js +2 -2
  301. package/dist/components/hb-statistic.js +1 -1
  302. package/dist/components/hb-step.js +1 -1
  303. package/dist/components/hb-steps.js +2 -2
  304. package/dist/components/hb-steps.js.map +1 -1
  305. package/dist/components/hb-sub-menu.js +5 -5
  306. package/dist/components/hb-switch.js +3 -3
  307. package/dist/components/hb-switch.js.map +1 -1
  308. package/dist/components/hb-tab-pane.js +1 -1
  309. package/dist/components/hb-table.js +25 -16
  310. package/dist/components/hb-table.js.map +1 -1
  311. package/dist/components/hb-tabs.js +31 -10
  312. package/dist/components/hb-tabs.js.map +1 -1
  313. package/dist/components/hb-tag.js +3 -2
  314. package/dist/components/hb-tag.js.map +1 -1
  315. package/dist/components/hb-text.js +2 -2
  316. package/dist/components/hb-time-picker.js +14 -9
  317. package/dist/components/hb-time-picker.js.map +1 -1
  318. package/dist/components/hb-time-select.js +13 -4
  319. package/dist/components/hb-time-select.js.map +1 -1
  320. package/dist/components/hb-tooltip.js +31 -10
  321. package/dist/components/hb-tooltip.js.map +1 -1
  322. package/dist/components/hb-tree-select.js +129 -11
  323. package/dist/components/hb-tree-select.js.map +1 -1
  324. package/dist/components/hb-tree.js +147 -13
  325. package/dist/components/hb-tree.js.map +1 -1
  326. package/dist/components/hb-watermark.js +19 -11
  327. package/dist/components/hb-watermark.js.map +1 -1
  328. package/dist/{esm/a11y-f9ab2964.js → components/p-00aa34c8.js} +17 -3
  329. package/dist/components/p-00aa34c8.js.map +1 -0
  330. package/dist/components/{p-08b4005c.js → p-e0876aca.js} +5 -16
  331. package/dist/components/p-e0876aca.js.map +1 -0
  332. package/dist/components/p-fad66d69.js +32 -0
  333. package/dist/components/p-fad66d69.js.map +1 -0
  334. package/dist/{components/p-cc0aeb50.js → esm/a11y-e4cde5b0.js} +17 -3
  335. package/dist/esm/a11y-e4cde5b0.js.map +1 -0
  336. package/dist/esm/{date-helpers-44507189.js → date-helpers-259ed2f1.js} +5 -16
  337. package/dist/esm/date-helpers-259ed2f1.js.map +1 -0
  338. package/dist/esm/hb-alert.entry.js +2 -1
  339. package/dist/esm/hb-alert.entry.js.map +1 -1
  340. package/dist/esm/hb-calendar.entry.js +2 -2
  341. package/dist/esm/hb-calendar.entry.js.map +1 -1
  342. package/dist/esm/hb-cascader.entry.js +48 -12
  343. package/dist/esm/hb-cascader.entry.js.map +1 -1
  344. package/dist/esm/hb-checkbox-group.entry.js +12 -8
  345. package/dist/esm/hb-checkbox-group.entry.js.map +1 -1
  346. package/dist/esm/hb-checkbox.entry.js +9 -4
  347. package/dist/esm/hb-checkbox.entry.js.map +1 -1
  348. package/dist/esm/hb-collapse-item.entry.js +13 -4
  349. package/dist/esm/hb-collapse-item.entry.js.map +1 -1
  350. package/dist/esm/hb-collapse.entry.js +20 -15
  351. package/dist/esm/hb-collapse.entry.js.map +1 -1
  352. package/dist/esm/hb-color-picker.entry.js +22 -19
  353. package/dist/esm/hb-color-picker.entry.js.map +1 -1
  354. package/dist/esm/hb-date-picker-pane.entry.js +1 -1
  355. package/dist/esm/hb-date-picker.entry.js +13 -10
  356. package/dist/esm/hb-date-picker.entry.js.map +1 -1
  357. package/dist/esm/hb-date-range-picker.entry.js +1 -1
  358. package/dist/esm/hb-date-time-picker.entry.js +1 -1
  359. package/dist/esm/hb-descriptions.entry.js.map +1 -1
  360. package/dist/esm/hb-dialog.entry.js +51 -12
  361. package/dist/esm/hb-dialog.entry.js.map +1 -1
  362. package/dist/esm/hb-drawer.entry.js +34 -4
  363. package/dist/esm/hb-drawer.entry.js.map +1 -1
  364. package/dist/esm/hb-dropdown.entry.js +27 -15
  365. package/dist/esm/hb-dropdown.entry.js.map +1 -1
  366. package/dist/esm/hb-empty.entry.js +1 -1
  367. package/dist/esm/hb-float-button.entry.js +2 -2
  368. package/dist/esm/hb-form-item.entry.js +11 -10
  369. package/dist/esm/hb-form-item.entry.js.map +1 -1
  370. package/dist/esm/hb-form.entry.js +12 -7
  371. package/dist/esm/hb-form.entry.js.map +1 -1
  372. package/dist/esm/hb-image-preview.entry.js +1 -1
  373. package/dist/esm/hb-image-preview.entry.js.map +1 -1
  374. package/dist/esm/hb-image.entry.js +21 -3
  375. package/dist/esm/hb-image.entry.js.map +1 -1
  376. package/dist/esm/hb-input-number.entry.js +7 -7
  377. package/dist/esm/hb-input-number.entry.js.map +1 -1
  378. package/dist/esm/hb-input-tag.entry.js +2 -2
  379. package/dist/esm/hb-input.entry.js +3 -2
  380. package/dist/esm/hb-input.entry.js.map +1 -1
  381. package/dist/esm/hb-layout.entry.js.map +1 -1
  382. package/dist/esm/hb-link.entry.js +2 -2
  383. package/dist/esm/hb-loading.entry.js +2 -2
  384. package/dist/esm/hb-menu-item.entry.js +14 -5
  385. package/dist/esm/hb-menu-item.entry.js.map +1 -1
  386. package/dist/esm/hb-menu.entry.js +2 -2
  387. package/dist/esm/hb-message.entry.js +13 -4
  388. package/dist/esm/hb-message.entry.js.map +1 -1
  389. package/dist/esm/hb-page-header.entry.js +1 -1
  390. package/dist/esm/hb-pagination.entry.js +8 -5
  391. package/dist/esm/hb-pagination.entry.js.map +1 -1
  392. package/dist/esm/hb-popconfirm.entry.js +27 -8
  393. package/dist/esm/hb-popconfirm.entry.js.map +1 -1
  394. package/dist/esm/hb-popover.entry.js +26 -14
  395. package/dist/esm/hb-popover.entry.js.map +1 -1
  396. package/dist/esm/hb-progress.entry.js +1 -1
  397. package/dist/esm/hb-radio.entry.js +8 -3
  398. package/dist/esm/hb-radio.entry.js.map +1 -1
  399. package/dist/esm/hb-rate.entry.js +3 -3
  400. package/dist/esm/hb-rate.entry.js.map +1 -1
  401. package/dist/esm/hb-row.entry.js +2 -2
  402. package/dist/esm/hb-scrollbar.entry.js +5 -5
  403. package/dist/esm/hb-scrollbar.entry.js.map +1 -1
  404. package/dist/esm/hb-segmented.entry.js +13 -2
  405. package/dist/esm/hb-segmented.entry.js.map +1 -1
  406. package/dist/esm/hb-select.entry.js +21 -12
  407. package/dist/esm/hb-select.entry.js.map +1 -1
  408. package/dist/esm/hb-slider.entry.js +6 -12
  409. package/dist/esm/hb-slider.entry.js.map +1 -1
  410. package/dist/esm/hb-space.entry.js +2 -2
  411. package/dist/esm/hb-statistic.entry.js +1 -1
  412. package/dist/esm/hb-step.entry.js +1 -1
  413. package/dist/esm/hb-steps.entry.js +2 -2
  414. package/dist/esm/hb-steps.entry.js.map +1 -1
  415. package/dist/esm/hb-sub-menu.entry.js +5 -5
  416. package/dist/esm/hb-switch.entry.js +3 -3
  417. package/dist/esm/hb-switch.entry.js.map +1 -1
  418. package/dist/esm/hb-tab-pane.entry.js +1 -1
  419. package/dist/esm/hb-table.entry.js +25 -16
  420. package/dist/esm/hb-table.entry.js.map +1 -1
  421. package/dist/esm/hb-tabs.entry.js +31 -10
  422. package/dist/esm/hb-tabs.entry.js.map +1 -1
  423. package/dist/esm/hb-tag.entry.js +3 -2
  424. package/dist/esm/hb-tag.entry.js.map +1 -1
  425. package/dist/esm/hb-text.entry.js +2 -2
  426. package/dist/esm/hb-time-picker.entry.js +14 -9
  427. package/dist/esm/hb-time-picker.entry.js.map +1 -1
  428. package/dist/esm/hb-time-select.entry.js +13 -4
  429. package/dist/esm/hb-time-select.entry.js.map +1 -1
  430. package/dist/esm/hb-tooltip.entry.js +30 -10
  431. package/dist/esm/hb-tooltip.entry.js.map +1 -1
  432. package/dist/esm/hb-tree-select.entry.js +125 -10
  433. package/dist/esm/hb-tree-select.entry.js.map +1 -1
  434. package/dist/esm/hb-tree.entry.js +145 -12
  435. package/dist/esm/hb-tree.entry.js.map +1 -1
  436. package/dist/esm/hb-watermark.entry.js +19 -11
  437. package/dist/esm/hb-watermark.entry.js.map +1 -1
  438. package/dist/esm/huibo-ui.js +1 -1
  439. package/dist/esm/loader.js +1 -1
  440. package/dist/esm/transition-4295d789.js +32 -0
  441. package/dist/esm/transition-4295d789.js.map +1 -0
  442. package/dist/huibo-ui/huibo-ui.esm.js +1 -1
  443. package/dist/huibo-ui/huibo-ui.esm.js.map +1 -1
  444. package/dist/huibo-ui/p-00aa34c8.js +2 -0
  445. package/dist/huibo-ui/p-00aa34c8.js.map +1 -0
  446. package/dist/huibo-ui/p-0cc1e3f3.entry.js +2 -0
  447. package/dist/huibo-ui/p-0cc1e3f3.entry.js.map +1 -0
  448. package/dist/huibo-ui/{p-678b4212.entry.js → p-0ddae4e9.entry.js} +2 -2
  449. package/dist/huibo-ui/p-10f6c184.entry.js.map +1 -1
  450. package/dist/huibo-ui/{p-f4336be9.entry.js → p-14c3b47b.entry.js} +2 -2
  451. package/dist/huibo-ui/{p-c50ad398.entry.js → p-193efdc0.entry.js} +2 -2
  452. package/dist/huibo-ui/{p-735bceef.entry.js → p-1b98152b.entry.js} +2 -2
  453. package/dist/huibo-ui/p-1b98152b.entry.js.map +1 -0
  454. package/dist/huibo-ui/p-1f6d0adb.entry.js +2 -0
  455. package/dist/huibo-ui/p-1f6d0adb.entry.js.map +1 -0
  456. package/dist/huibo-ui/{p-2943f5d0.entry.js → p-29092b85.entry.js} +2 -2
  457. package/dist/huibo-ui/p-29092b85.entry.js.map +1 -0
  458. package/dist/huibo-ui/p-2bc30b1b.entry.js +2 -0
  459. package/dist/huibo-ui/p-2bc30b1b.entry.js.map +1 -0
  460. package/dist/huibo-ui/{p-0d4b2997.entry.js → p-2bcda1bb.entry.js} +2 -2
  461. package/dist/huibo-ui/{p-b8d87f7e.entry.js → p-2ca9796a.entry.js} +2 -2
  462. package/dist/huibo-ui/p-2ca9796a.entry.js.map +1 -0
  463. package/dist/huibo-ui/{p-7da14d7c.entry.js → p-3042f986.entry.js} +2 -2
  464. package/dist/huibo-ui/{p-e039155d.entry.js → p-3dacb26b.entry.js} +2 -2
  465. package/dist/huibo-ui/{p-a084b8e5.entry.js → p-412ff618.entry.js} +2 -2
  466. package/dist/huibo-ui/{p-6beb5b81.entry.js → p-415295f3.entry.js} +2 -2
  467. package/dist/huibo-ui/p-415295f3.entry.js.map +1 -0
  468. package/dist/huibo-ui/p-494e6c25.entry.js +2 -0
  469. package/dist/huibo-ui/p-494e6c25.entry.js.map +1 -0
  470. package/dist/huibo-ui/p-4d87d7f4.entry.js +2 -0
  471. package/dist/huibo-ui/p-4d87d7f4.entry.js.map +1 -0
  472. package/dist/huibo-ui/{p-2811e603.entry.js → p-54a28052.entry.js} +2 -2
  473. package/dist/huibo-ui/p-54a28052.entry.js.map +1 -0
  474. package/dist/huibo-ui/p-5e253c15.entry.js +2 -0
  475. package/dist/huibo-ui/p-5e253c15.entry.js.map +1 -0
  476. package/dist/huibo-ui/p-63d68c61.entry.js +2 -0
  477. package/dist/huibo-ui/p-63d68c61.entry.js.map +1 -0
  478. package/dist/huibo-ui/{p-ccd09d5a.entry.js → p-6518c435.entry.js} +2 -2
  479. package/dist/huibo-ui/{p-1f8db37a.entry.js → p-687d8dff.entry.js} +2 -2
  480. package/dist/huibo-ui/p-687d8dff.entry.js.map +1 -0
  481. package/dist/huibo-ui/p-688460ce.entry.js +2 -0
  482. package/dist/huibo-ui/p-688460ce.entry.js.map +1 -0
  483. package/dist/huibo-ui/p-69bb1dd9.entry.js +2 -0
  484. package/dist/huibo-ui/p-69bb1dd9.entry.js.map +1 -0
  485. package/dist/huibo-ui/{p-e5cbfa9e.entry.js → p-6c23fbd1.entry.js} +2 -2
  486. package/dist/huibo-ui/p-6c23fbd1.entry.js.map +1 -0
  487. package/dist/huibo-ui/p-6c8cf248.entry.js.map +1 -1
  488. package/dist/huibo-ui/p-6efed295.entry.js +2 -0
  489. package/dist/huibo-ui/p-6efed295.entry.js.map +1 -0
  490. package/dist/huibo-ui/{p-c80f8ace.entry.js → p-79b24b83.entry.js} +2 -2
  491. package/dist/huibo-ui/p-79b24b83.entry.js.map +1 -0
  492. package/dist/huibo-ui/p-7a38b3e2.entry.js +2 -0
  493. package/dist/huibo-ui/p-7a38b3e2.entry.js.map +1 -0
  494. package/dist/huibo-ui/{p-cad57c2d.entry.js → p-7a682c56.entry.js} +2 -2
  495. package/dist/huibo-ui/{p-a8996d22.entry.js → p-815fc943.entry.js} +2 -2
  496. package/dist/huibo-ui/{p-af74667d.entry.js → p-89be7973.entry.js} +2 -2
  497. package/dist/huibo-ui/p-8a202bc5.entry.js.map +1 -1
  498. package/dist/huibo-ui/{p-213b9de7.entry.js → p-8c4415ed.entry.js} +2 -2
  499. package/dist/huibo-ui/p-8c4415ed.entry.js.map +1 -0
  500. package/dist/huibo-ui/{p-8fdbd17c.entry.js → p-950e7465.entry.js} +2 -2
  501. package/dist/huibo-ui/{p-ab9cf0e4.entry.js → p-96cecd21.entry.js} +2 -2
  502. package/dist/huibo-ui/p-96cecd21.entry.js.map +1 -0
  503. package/dist/huibo-ui/{p-2b4556ff.entry.js → p-98b513cd.entry.js} +2 -2
  504. package/dist/huibo-ui/p-98b513cd.entry.js.map +1 -0
  505. package/dist/huibo-ui/{p-86bdc48a.entry.js → p-ac18c68b.entry.js} +2 -2
  506. package/dist/huibo-ui/p-ac18c68b.entry.js.map +1 -0
  507. package/dist/huibo-ui/{p-89ea1141.entry.js → p-ac45291c.entry.js} +2 -2
  508. package/dist/huibo-ui/{p-e10fcfbe.entry.js → p-b105cf76.entry.js} +2 -2
  509. package/dist/huibo-ui/p-b105cf76.entry.js.map +1 -0
  510. package/dist/huibo-ui/{p-9a5406f0.entry.js → p-b38802b0.entry.js} +2 -2
  511. package/dist/huibo-ui/{p-9a5406f0.entry.js.map → p-b38802b0.entry.js.map} +1 -1
  512. package/dist/huibo-ui/{p-ea74fcae.entry.js → p-b3fd12c7.entry.js} +2 -2
  513. package/dist/huibo-ui/p-b3fd12c7.entry.js.map +1 -0
  514. package/dist/huibo-ui/p-b5ea18ba.entry.js +2 -0
  515. package/dist/huibo-ui/p-b5ea18ba.entry.js.map +1 -0
  516. package/dist/huibo-ui/{p-41d9c846.entry.js → p-b6afe81e.entry.js} +2 -2
  517. package/dist/huibo-ui/p-b7900dee.entry.js +2 -0
  518. package/dist/huibo-ui/p-b7900dee.entry.js.map +1 -0
  519. package/dist/huibo-ui/p-b8c83751.entry.js +2 -0
  520. package/dist/huibo-ui/p-b8c83751.entry.js.map +1 -0
  521. package/dist/huibo-ui/p-c7713947.entry.js +2 -0
  522. package/dist/huibo-ui/p-c7713947.entry.js.map +1 -0
  523. package/dist/huibo-ui/{p-33de6878.entry.js → p-c869842c.entry.js} +2 -2
  524. package/dist/huibo-ui/p-c869842c.entry.js.map +1 -0
  525. package/dist/huibo-ui/p-c8e917db.entry.js.map +1 -1
  526. package/dist/huibo-ui/p-cb66dbef.entry.js +2 -0
  527. package/dist/huibo-ui/p-cb66dbef.entry.js.map +1 -0
  528. package/dist/huibo-ui/p-cde83f76.entry.js +2 -0
  529. package/dist/huibo-ui/p-cde83f76.entry.js.map +1 -0
  530. package/dist/huibo-ui/{p-f5969181.entry.js → p-dd9c6459.entry.js} +2 -2
  531. package/dist/huibo-ui/{p-08b4005c.js → p-e0876aca.js} +1 -1
  532. package/dist/huibo-ui/p-e0876aca.js.map +1 -0
  533. package/dist/huibo-ui/{p-aa5e5e02.entry.js → p-e1773c93.entry.js} +2 -2
  534. package/dist/huibo-ui/p-e1773c93.entry.js.map +1 -0
  535. package/dist/huibo-ui/{p-626b48f1.entry.js → p-e73c357f.entry.js} +2 -2
  536. package/dist/huibo-ui/p-e73c357f.entry.js.map +1 -0
  537. package/dist/huibo-ui/{p-60532a1f.entry.js → p-e7c73624.entry.js} +2 -2
  538. package/dist/huibo-ui/p-e7c73624.entry.js.map +1 -0
  539. package/dist/huibo-ui/{p-13010da2.entry.js → p-e9e7abca.entry.js} +2 -2
  540. package/dist/huibo-ui/{p-f6889710.entry.js → p-ea0823f3.entry.js} +2 -2
  541. package/dist/huibo-ui/p-ea0823f3.entry.js.map +1 -0
  542. package/dist/huibo-ui/{p-b468858e.entry.js → p-f1f2483f.entry.js} +2 -2
  543. package/dist/huibo-ui/p-fad66d69.js +2 -0
  544. package/dist/huibo-ui/p-fad66d69.js.map +1 -0
  545. package/dist/huibo-ui/{p-fd8301c6.entry.js → p-fd6831f9.entry.js} +2 -2
  546. package/dist/huibo-ui/p-ff6bc5cc.entry.js +2 -0
  547. package/dist/huibo-ui/p-ff6bc5cc.entry.js.map +1 -0
  548. package/dist/types/components/Cascader/Cascader.d.ts +12 -0
  549. package/dist/types/components/Checkbox/Checkbox.d.ts +5 -0
  550. package/dist/types/components/Checkbox/CheckboxGroup.d.ts +1 -0
  551. package/dist/types/components/Collapse/Collapse.d.ts +2 -0
  552. package/dist/types/components/Collapse/CollapseItem.d.ts +8 -1
  553. package/dist/types/components/Dialog/Dialog.d.ts +13 -1
  554. package/dist/types/components/Drawer/Drawer.d.ts +4 -0
  555. package/dist/types/components/Dropdown/Dropdown.d.ts +6 -2
  556. package/dist/types/components/Form/Form.d.ts +2 -0
  557. package/dist/types/components/Image/Image.d.ts +6 -0
  558. package/dist/types/components/Menu/MenuItem.d.ts +8 -1
  559. package/dist/types/components/Message/Message.d.ts +3 -0
  560. package/dist/types/components/Popconfirm/Popconfirm.d.ts +6 -2
  561. package/dist/types/components/Popover/Popover.d.ts +6 -1
  562. package/dist/types/components/Radio/Radio.d.ts +5 -0
  563. package/dist/types/components/Segmented/Segmented.d.ts +6 -0
  564. package/dist/types/components/Select/Select.d.ts +5 -0
  565. package/dist/types/components/Table/Table.d.ts +8 -2
  566. package/dist/types/components/Tabs/Tabs.d.ts +6 -0
  567. package/dist/types/components/Tooltip/Tooltip.d.ts +6 -0
  568. package/dist/types/components/Tree/Tree.d.ts +24 -0
  569. package/dist/types/components/TreeSelect/TreeSelect.d.ts +17 -0
  570. package/dist/types/components/Watermark/Watermark.d.ts +7 -1
  571. package/dist/types/components.d.ts +40 -4
  572. package/dist/types/utils/a11y.d.ts +9 -0
  573. package/dist/types/utils/transition.d.ts +27 -0
  574. package/package.json +1 -1
  575. package/dist/cjs/a11y-802de67a.js.map +0 -1
  576. package/dist/cjs/date-helpers-1ffddc59.js.map +0 -1
  577. package/dist/components/p-08b4005c.js.map +0 -1
  578. package/dist/components/p-cc0aeb50.js.map +0 -1
  579. package/dist/esm/a11y-f9ab2964.js.map +0 -1
  580. package/dist/esm/date-helpers-44507189.js.map +0 -1
  581. package/dist/huibo-ui/p-08b4005c.js.map +0 -1
  582. package/dist/huibo-ui/p-1f8db37a.entry.js.map +0 -1
  583. package/dist/huibo-ui/p-213b9de7.entry.js.map +0 -1
  584. package/dist/huibo-ui/p-25fd7d5c.entry.js +0 -2
  585. package/dist/huibo-ui/p-25fd7d5c.entry.js.map +0 -1
  586. package/dist/huibo-ui/p-2811e603.entry.js.map +0 -1
  587. package/dist/huibo-ui/p-2943f5d0.entry.js.map +0 -1
  588. package/dist/huibo-ui/p-2b4556ff.entry.js.map +0 -1
  589. package/dist/huibo-ui/p-33de6878.entry.js.map +0 -1
  590. package/dist/huibo-ui/p-3807da71.entry.js +0 -2
  591. package/dist/huibo-ui/p-3807da71.entry.js.map +0 -1
  592. package/dist/huibo-ui/p-47ef7a86.entry.js +0 -2
  593. package/dist/huibo-ui/p-47ef7a86.entry.js.map +0 -1
  594. package/dist/huibo-ui/p-4d34e43e.entry.js +0 -2
  595. package/dist/huibo-ui/p-4d34e43e.entry.js.map +0 -1
  596. package/dist/huibo-ui/p-54aa2fd8.entry.js +0 -2
  597. package/dist/huibo-ui/p-54aa2fd8.entry.js.map +0 -1
  598. package/dist/huibo-ui/p-60532a1f.entry.js.map +0 -1
  599. package/dist/huibo-ui/p-626b48f1.entry.js.map +0 -1
  600. package/dist/huibo-ui/p-639f167d.entry.js +0 -2
  601. package/dist/huibo-ui/p-639f167d.entry.js.map +0 -1
  602. package/dist/huibo-ui/p-6beb5b81.entry.js.map +0 -1
  603. package/dist/huibo-ui/p-735bceef.entry.js.map +0 -1
  604. package/dist/huibo-ui/p-76519752.entry.js +0 -2
  605. package/dist/huibo-ui/p-76519752.entry.js.map +0 -1
  606. package/dist/huibo-ui/p-79af2efa.entry.js +0 -2
  607. package/dist/huibo-ui/p-79af2efa.entry.js.map +0 -1
  608. package/dist/huibo-ui/p-7f6975ad.entry.js +0 -2
  609. package/dist/huibo-ui/p-7f6975ad.entry.js.map +0 -1
  610. package/dist/huibo-ui/p-86bdc48a.entry.js.map +0 -1
  611. package/dist/huibo-ui/p-8a8443b8.entry.js +0 -2
  612. package/dist/huibo-ui/p-8a8443b8.entry.js.map +0 -1
  613. package/dist/huibo-ui/p-8fd788c9.entry.js +0 -2
  614. package/dist/huibo-ui/p-8fd788c9.entry.js.map +0 -1
  615. package/dist/huibo-ui/p-92521c31.entry.js +0 -2
  616. package/dist/huibo-ui/p-92521c31.entry.js.map +0 -1
  617. package/dist/huibo-ui/p-965d4d02.entry.js +0 -2
  618. package/dist/huibo-ui/p-965d4d02.entry.js.map +0 -1
  619. package/dist/huibo-ui/p-aa5e5e02.entry.js.map +0 -1
  620. package/dist/huibo-ui/p-ab9cf0e4.entry.js.map +0 -1
  621. package/dist/huibo-ui/p-b8d87f7e.entry.js.map +0 -1
  622. package/dist/huibo-ui/p-c6c91664.entry.js +0 -2
  623. package/dist/huibo-ui/p-c6c91664.entry.js.map +0 -1
  624. package/dist/huibo-ui/p-c80f8ace.entry.js.map +0 -1
  625. package/dist/huibo-ui/p-cc0aeb50.js +0 -2
  626. package/dist/huibo-ui/p-cc0aeb50.js.map +0 -1
  627. package/dist/huibo-ui/p-d79a15b1.entry.js +0 -2
  628. package/dist/huibo-ui/p-d79a15b1.entry.js.map +0 -1
  629. package/dist/huibo-ui/p-e10fcfbe.entry.js.map +0 -1
  630. package/dist/huibo-ui/p-e5cbfa9e.entry.js.map +0 -1
  631. package/dist/huibo-ui/p-ea74fcae.entry.js.map +0 -1
  632. package/dist/huibo-ui/p-edbda423.entry.js +0 -2
  633. package/dist/huibo-ui/p-edbda423.entry.js.map +0 -1
  634. package/dist/huibo-ui/p-f6889710.entry.js.map +0 -1
  635. package/dist/huibo-ui/p-f9bb5217.entry.js +0 -2
  636. package/dist/huibo-ui/p-f9bb5217.entry.js.map +0 -1
  637. package/dist/huibo-ui/p-fea20295.entry.js +0 -2
  638. package/dist/huibo-ui/p-fea20295.entry.js.map +0 -1
  639. /package/dist/huibo-ui/{p-678b4212.entry.js.map → p-0ddae4e9.entry.js.map} +0 -0
  640. /package/dist/huibo-ui/{p-f4336be9.entry.js.map → p-14c3b47b.entry.js.map} +0 -0
  641. /package/dist/huibo-ui/{p-c50ad398.entry.js.map → p-193efdc0.entry.js.map} +0 -0
  642. /package/dist/huibo-ui/{p-0d4b2997.entry.js.map → p-2bcda1bb.entry.js.map} +0 -0
  643. /package/dist/huibo-ui/{p-7da14d7c.entry.js.map → p-3042f986.entry.js.map} +0 -0
  644. /package/dist/huibo-ui/{p-e039155d.entry.js.map → p-3dacb26b.entry.js.map} +0 -0
  645. /package/dist/huibo-ui/{p-a084b8e5.entry.js.map → p-412ff618.entry.js.map} +0 -0
  646. /package/dist/huibo-ui/{p-ccd09d5a.entry.js.map → p-6518c435.entry.js.map} +0 -0
  647. /package/dist/huibo-ui/{p-cad57c2d.entry.js.map → p-7a682c56.entry.js.map} +0 -0
  648. /package/dist/huibo-ui/{p-a8996d22.entry.js.map → p-815fc943.entry.js.map} +0 -0
  649. /package/dist/huibo-ui/{p-af74667d.entry.js.map → p-89be7973.entry.js.map} +0 -0
  650. /package/dist/huibo-ui/{p-8fdbd17c.entry.js.map → p-950e7465.entry.js.map} +0 -0
  651. /package/dist/huibo-ui/{p-89ea1141.entry.js.map → p-ac45291c.entry.js.map} +0 -0
  652. /package/dist/huibo-ui/{p-41d9c846.entry.js.map → p-b6afe81e.entry.js.map} +0 -0
  653. /package/dist/huibo-ui/{p-f5969181.entry.js.map → p-dd9c6459.entry.js.map} +0 -0
  654. /package/dist/huibo-ui/{p-13010da2.entry.js.map → p-e9e7abca.entry.js.map} +0 -0
  655. /package/dist/huibo-ui/{p-b468858e.entry.js.map → p-f1f2483f.entry.js.map} +0 -0
  656. /package/dist/huibo-ui/{p-fd8301c6.entry.js.map → p-fd6831f9.entry.js.map} +0 -0
@@ -34,18 +34,28 @@ export class Dialog {
34
34
  zIndex = 0;
35
35
  panelRef;
36
36
  trap;
37
- handleVisibleChange(newVal) {
37
+ /** 离场动画期间保留渲染(避免 display:none 打断 transition) */
38
+ leaving = false;
39
+ leaveTimer;
40
+ handleVisibleChange(newVal, oldVal) {
38
41
  if (newVal) {
42
+ // 打开:清掉可能残留的离场定时器,重置 leaving
43
+ if (this.leaveTimer) {
44
+ clearTimeout(this.leaveTimer);
45
+ this.leaveTimer = undefined;
46
+ }
47
+ this.leaving = false;
39
48
  this.zIndex = getNextZIndex();
40
49
  if (this.modal)
41
50
  lockScroll();
42
51
  this.hbOpen.emit();
43
52
  document.addEventListener('keydown', this.handleKeyDown);
44
53
  }
45
- else {
46
- if (this.modal)
47
- unlockScroll();
48
- document.removeEventListener('keydown', this.handleKeyDown);
54
+ else if (oldVal) {
55
+ // 关闭(受控或内部触发统一走这里):进入离场动画期,
56
+ // 动画结束(300ms)后才 emit closed + 真正卸载。
57
+ // 仅在「从打开→关闭」时执行,避免已关闭时重复 emit。
58
+ this.startLeave();
49
59
  }
50
60
  }
51
61
  disconnectedCallback() {
@@ -53,6 +63,8 @@ export class Dialog {
53
63
  unlockScroll();
54
64
  document.removeEventListener('keydown', this.handleKeyDown);
55
65
  this.trap?.disconnect();
66
+ if (this.leaveTimer)
67
+ clearTimeout(this.leaveTimer);
56
68
  }
57
69
  componentDidRender() {
58
70
  if (!this.panelRef)
@@ -74,24 +86,51 @@ export class Dialog {
74
86
  };
75
87
  close = () => {
76
88
  this.modelValue = false;
77
- this.hbClose.emit();
78
- setTimeout(() => this.hbClosed.emit(), 300);
89
+ this.startLeave();
79
90
  };
91
+ /**
92
+ * 进入离场动画期:解锁滚动、移除监听、保留 DOM 播放动画,
93
+ * 结束(300ms)后重置 leaving 并 emit hbClosed。
94
+ * 受控关闭(父组件直接设 modelValue=false 经 @Watch)与内部关闭(ESC/遮罩/关闭按钮)
95
+ * 统一走这里,保证两者行为一致(都有动画 + 都 emit hbClose/hbClosed)。
96
+ */
97
+ startLeave() {
98
+ if (this.modal)
99
+ unlockScroll();
100
+ document.removeEventListener('keydown', this.handleKeyDown);
101
+ this.hbClose.emit();
102
+ this.leaving = true;
103
+ if (this.leaveTimer)
104
+ clearTimeout(this.leaveTimer);
105
+ this.leaveTimer = setTimeout(() => {
106
+ this.leaving = false;
107
+ this.hbClosed.emit();
108
+ }, 300);
109
+ }
80
110
  handleOverlayClick = () => {
81
111
  if (this.closeOnClickModal)
82
112
  this.close();
83
113
  };
114
+ /** 是否应渲染弹层 DOM:打开中 或 离场动画期内 */
115
+ get shouldRender() {
116
+ return this.modelValue || this.leaving;
117
+ }
84
118
  render() {
85
- if (this.destroyOnClose && !this.modelValue)
119
+ if (this.destroyOnClose && !this.shouldRender)
86
120
  return null;
87
- return (h("div", { class: { 'hb-dialog-wrapper': true, 'hb-dialog-wrapper--hidden': !this.modelValue } }, this.modal && (h("div", { class: "hb-dialog__overlay", style: { zIndex: String(this.zIndex) }, onClick: this.handleOverlayClick })), h("div", { ref: (el) => (this.panelRef = el), class: {
121
+ return (h("div", { class: { 'hb-dialog-wrapper': true, 'hb-dialog-wrapper--hidden': !this.shouldRender } }, this.modal && (h("div", { class: {
122
+ 'hb-dialog__overlay': true,
123
+ 'hb-dialog__overlay--visible': this.modelValue,
124
+ 'hb-dialog__overlay--leaving': this.leaving,
125
+ }, style: { zIndex: String(this.zIndex) }, onClick: this.handleOverlayClick })), h("div", { ref: el => (this.panelRef = el), class: {
88
126
  'hb-dialog': true,
89
127
  'hb-dialog--fullscreen': this.fullscreen,
90
128
  'hb-dialog--visible': this.modelValue,
129
+ 'hb-dialog--leaving': this.leaving,
91
130
  }, style: {
92
131
  zIndex: String(this.zIndex + 1),
93
132
  width: this.fullscreen ? '100%' : this.width,
94
- }, role: "dialog", "aria-modal": "true" }, h("div", { class: "hb-dialog__header" }, h("span", { class: "hb-dialog__title" }, this.title), this.showClose && (h("button", { type: "button", class: "hb-dialog__close", "aria-label": "\u5173\u95ED", onClick: this.close }, "\u00D7"))), h("div", { class: "hb-dialog__body" }, h("slot", null)), h("div", { class: "hb-dialog__footer" }, h("slot", { name: "footer" })))));
133
+ }, role: "dialog", "aria-modal": "true", "aria-hidden": this.modelValue ? 'false' : 'true' }, h("div", { class: "hb-dialog__header" }, h("span", { class: "hb-dialog__title" }, this.title), this.showClose && (h("button", { type: "button", class: "hb-dialog__close", "aria-label": "\u5173\u95ED", onClick: this.close }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": 2, "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M6 6l12 12M18 6L6 18" }))))), h("div", { class: "hb-dialog__body" }, h("slot", null)), h("div", { class: "hb-dialog__footer" }, h("slot", { name: "footer" })))));
95
134
  }
96
135
  static get is() { return "hb-dialog"; }
97
136
  static get encapsulation() { return "shadow"; }
@@ -289,6 +328,11 @@ export class Dialog {
289
328
  }
290
329
  };
291
330
  }
331
+ static get states() {
332
+ return {
333
+ "leaving": {}
334
+ };
335
+ }
292
336
  static get events() {
293
337
  return [{
294
338
  "method": "hbOpen",
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAE,eAAe,EAAa,MAAM,kBAAkB,CAAC;AAE9D;;;GAGG;AAMH,MAAM,OAAO,MAAM;IACN,EAAE,CAAc;IAE3B,WAAW;IACc,UAAU,GAAY,KAAK,CAAC;IAErD,SAAS;IACD,KAAK,GAAW,EAAE,CAAC;IAE3B,SAAS;IACD,KAAK,GAAW,KAAK,CAAC;IAE9B,WAAW;IACH,UAAU,GAAY,KAAK,CAAC;IAEpC,aAAa;IACL,KAAK,GAAY,IAAI,CAAC;IAE9B,eAAe;IACP,iBAAiB,GAAY,IAAI,CAAC;IAE1C,iBAAiB;IACT,kBAAkB,GAAY,IAAI,CAAC;IAE3C,eAAe;IACP,SAAS,GAAY,IAA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AAI,CAAC,UAAU;iBACtC,EACD,KAAK,EAAE;oBACL,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;oBAC/B,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK;iBAC7C,EACD,IAAI,EAAC,QAAQ,gBACF,MAAM;gBAEjB,WAAK,KAAK,EAAC,mBAAmB;oBAC5B,YAAM,KAAK,EAAC,kBAAkB,IAAE,IAAI,CAAC,KAAK,CAAQ;oBACjD,IAAI,CAAC,SAAS,IAAI,CACjB,cAAQ,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,kBAAkB,gBAAY,cAAI,EAAC,OAAO,EAAE,IAAI,CAAC,KAAK,aAAY,CAC/F,CACG;gBACN,WAAK,KAAK,EAAC,iBAAiB;oBAC1B,eAAQ,CACJ;gBACN,WAAK,KAAK,EAAC,mBAAmB;oBAC5B,YAAM,IAAI,EAAC,QAAQ,GAAG,CAClB,CACF,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, Event, EventEmitter, Watch, Element } from '@stencil/core';\nimport { lockScroll, unlockScroll, getNextZIndex } from '../../utils/popup-manager';\nimport { createFocusTrap, FocusTrap } from '../../utils/a11y';\n\n/**\n * Dialog 对话框组件\n * 在保留当前页面状态的情况下,告知用户并承载相关操作\n */\n@Component({\n tag: 'hb-dialog',\n styleUrl: 'dialog.css',\n shadow: true,\n})\nexport class Dialog {\n @Element() el: HTMLElement;\n\n /** 是否显示 */\n @Prop({ mutable: true }) modelValue: boolean = false;\n\n /** 标题 */\n @Prop() title: string = '';\n\n /** 宽度 */\n @Prop() width: string = '50%';\n\n /** 是否全屏 */\n @Prop() fullscreen: boolean = false;\n\n /** 是否显示遮罩 */\n @Prop() modal: boolean = true;\n\n /** 是否点击遮罩关闭 */\n @Prop() closeOnClickModal: boolean = true;\n\n /** 是否按 ESC 关闭 */\n @Prop() closeOnPressEscape: boolean = true;\n\n /** 是否显示关闭按钮 */\n @Prop() showClose: boolean = true;\n\n /** 关闭时销毁 */\n @Prop() destroyOnClose: boolean = false;\n\n /** 打开事件 */\n @Event() hbOpen: EventEmitter<void>;\n\n /** 关闭事件 */\n @Event() hbClose: EventEmitter<void>;\n\n /** 已关闭动画结束事件 */\n @Event() hbClosed: EventEmitter<void>;\n\n private zIndex: number = 0;\n private panelRef?: HTMLElement;\n private trap?: FocusTrap;\n\n @Watch('modelValue')\n handleVisibleChange(newVal: boolean) {\n if (newVal) {\n this.zIndex = getNextZIndex();\n if (this.modal) lockScroll();\n this.hbOpen.emit();\n document.addEventListener('keydown', this.handleKeyDown);\n } else {\n if (this.modal) unlockScroll();\n document.removeEventListener('keydown', this.handleKeyDown);\n }\n }\n\n disconnectedCallback() {\n if (this.modelValue && this.modal) unlockScroll();\n document.removeEventListener('keydown', this.handleKeyDown);\n this.trap?.disconnect();\n }\n\n componentDidRender() {\n if (!this.panelRef) return;\n if (this.modelValue) {\n if (!this.trap) {\n this.trap = createFocusTrap({ container: this.panelRef });\n }\n this.trap.connect();\n } else {\n this.trap?.disconnect();\n }\n }\n\n private handleKeyDown = (e: KeyboardEvent) => {\n if (this.closeOnPressEscape && e.key === 'Escape') {\n this.close();\n }\n };\n\n private close = () => {\n this.modelValue = false;\n this.hbClose.emit();\n setTimeout(() => this.hbClosed.emit(), 300);\n };\n\n private handleOverlayClick = () => {\n if (this.closeOnClickModal) this.close();\n };\n\n render() {\n if (this.destroyOnClose && !this.modelValue) return null;\n\n return (\n <div class={{ 'hb-dialog-wrapper': true, 'hb-dialog-wrapper--hidden': !this.modelValue }}>\n {this.modal && (\n <div\n class=\"hb-dialog__overlay\"\n style={{ zIndex: String(this.zIndex) }}\n onClick={this.handleOverlayClick}\n />\n )}\n <div\n ref={(el) => (this.panelRef = el as HTMLElement)}\n class={{\n 'hb-dialog': true,\n 'hb-dialog--fullscreen': this.fullscreen,\n 'hb-dialog--visible': this.modelValue,\n }}\n style={{\n zIndex: String(this.zIndex + 1),\n width: this.fullscreen ? '100%' : this.width,\n }}\n role=\"dialog\"\n aria-modal=\"true\"\n >\n <div class=\"hb-dialog__header\">\n <span class=\"hb-dialog__title\">{this.title}</span>\n {this.showClose && (\n <button type=\"button\" class=\"hb-dialog__close\" aria-label=\"关闭\" onClick={this.close}>×</button>\n )}\n </div>\n <div class=\"hb-dialog__body\">\n <slot />\n </div>\n <div class=\"hb-dialog__footer\">\n <slot name=\"footer\" />\n </div>\n </div>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAE,eAAe,EAAa,MAAM,kBAAkB,CAAC;AAE9D;;;GAGG;AAMH,MAAM,OAAO,MAAM;IACN,EAAE,CAAc;IAE3B,WAAW;IACc,UAAU,GAAY,KAAK,CAAC;IAErD,SAAS;IACD,KAAK,GAAW,EAAE,CAAC;IAE3B,SAAS;IACD,KAAK,GAAW,KAAK,CAAC;IAE9B,WAAW;IACH,UAAU,GAAY,KAAK,CAAC;IAEpC,aAAa;IACL,KAAK,GAAY,IAAI,CAA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EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK;iBAC7C,EACD,IAAI,EAAC,QAAQ,gBACF,MAAM,iBACJ,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;gBAE/C,WAAK,KAAK,EAAC,mBAAmB;oBAC5B,YAAM,KAAK,EAAC,kBAAkB,IAAE,IAAI,CAAC,KAAK,CAAQ;oBACjD,IAAI,CAAC,SAAS,IAAI,CACjB,cAAQ,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,kBAAkB,gBAAY,cAAI,EAAC,OAAO,EAAE,IAAI,CAAC,KAAK;wBAChF,WAAK,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,kBAAe,CAAC,oBAAiB,OAAO,qBAAiB,OAAO,iBAAa,MAAM;4BAC3I,YAAM,CAAC,EAAC,sBAAsB,GAAG,CAC7B,CACC,CACV,CACG;gBACN,WAAK,KAAK,EAAC,iBAAiB;oBAC1B,eAAQ,CACJ;gBACN,WAAK,KAAK,EAAC,mBAAmB;oBAC5B,YAAM,IAAI,EAAC,QAAQ,GAAG,CAClB,CACF,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, Event, EventEmitter, Watch, Element, State } from '@stencil/core';\nimport { lockScroll, unlockScroll, getNextZIndex } from '../../utils/popup-manager';\nimport { createFocusTrap, FocusTrap } from '../../utils/a11y';\n\n/**\n * Dialog 对话框组件\n * 在保留当前页面状态的情况下,告知用户并承载相关操作\n */\n@Component({\n tag: 'hb-dialog',\n styleUrl: 'dialog.css',\n shadow: true,\n})\nexport class Dialog {\n @Element() el: HTMLElement;\n\n /** 是否显示 */\n @Prop({ mutable: true }) modelValue: boolean = false;\n\n /** 标题 */\n @Prop() title: string = '';\n\n /** 宽度 */\n @Prop() width: string = '50%';\n\n /** 是否全屏 */\n @Prop() fullscreen: boolean = false;\n\n /** 是否显示遮罩 */\n @Prop() modal: boolean = true;\n\n /** 是否点击遮罩关闭 */\n @Prop() closeOnClickModal: boolean = true;\n\n /** 是否按 ESC 关闭 */\n @Prop() closeOnPressEscape: boolean = true;\n\n /** 是否显示关闭按钮 */\n @Prop() showClose: boolean = true;\n\n /** 关闭时销毁 */\n @Prop() destroyOnClose: boolean = false;\n\n /** 打开事件 */\n @Event() hbOpen: EventEmitter<void>;\n\n /** 关闭事件 */\n @Event() hbClose: EventEmitter<void>;\n\n /** 已关闭动画结束事件 */\n @Event() hbClosed: EventEmitter<void>;\n\n private zIndex: number = 0;\n private panelRef?: HTMLElement;\n private trap?: FocusTrap;\n /** 离场动画期间保留渲染(避免 display:none 打断 transition) */\n @State() leaving: boolean = false;\n private leaveTimer?: ReturnType<typeof setTimeout>;\n\n @Watch('modelValue')\n handleVisibleChange(newVal: boolean, oldVal: boolean) {\n if (newVal) {\n // 打开:清掉可能残留的离场定时器,重置 leaving\n if (this.leaveTimer) {\n clearTimeout(this.leaveTimer);\n this.leaveTimer = undefined;\n }\n this.leaving = false;\n this.zIndex = getNextZIndex();\n if (this.modal) lockScroll();\n this.hbOpen.emit();\n document.addEventListener('keydown', this.handleKeyDown);\n } else if (oldVal) {\n // 关闭(受控或内部触发统一走这里):进入离场动画期,\n // 动画结束(300ms)后才 emit closed + 真正卸载。\n // 仅在「从打开→关闭」时执行,避免已关闭时重复 emit。\n this.startLeave();\n }\n }\n\n disconnectedCallback() {\n if (this.modelValue && this.modal) unlockScroll();\n document.removeEventListener('keydown', this.handleKeyDown);\n this.trap?.disconnect();\n if (this.leaveTimer) clearTimeout(this.leaveTimer);\n }\n\n componentDidRender() {\n if (!this.panelRef) return;\n if (this.modelValue) {\n if (!this.trap) {\n this.trap = createFocusTrap({ container: this.panelRef });\n }\n this.trap.connect();\n } else {\n this.trap?.disconnect();\n }\n }\n\n private handleKeyDown = (e: KeyboardEvent) => {\n if (this.closeOnPressEscape && e.key === 'Escape') {\n this.close();\n }\n };\n\n private close = () => {\n this.modelValue = false;\n this.startLeave();\n };\n\n /**\n * 进入离场动画期:解锁滚动、移除监听、保留 DOM 播放动画,\n * 结束(300ms)后重置 leaving 并 emit hbClosed。\n * 受控关闭(父组件直接设 modelValue=false 经 @Watch)与内部关闭(ESC/遮罩/关闭按钮)\n * 统一走这里,保证两者行为一致(都有动画 + 都 emit hbClose/hbClosed)。\n */\n private startLeave() {\n if (this.modal) unlockScroll();\n document.removeEventListener('keydown', this.handleKeyDown);\n this.hbClose.emit();\n this.leaving = true;\n if (this.leaveTimer) clearTimeout(this.leaveTimer);\n this.leaveTimer = setTimeout(() => {\n this.leaving = false;\n this.hbClosed.emit();\n }, 300);\n }\n\n private handleOverlayClick = () => {\n if (this.closeOnClickModal) this.close();\n };\n\n /** 是否应渲染弹层 DOM:打开中 或 离场动画期内 */\n private get shouldRender(): boolean {\n return this.modelValue || this.leaving;\n }\n\n render() {\n if (this.destroyOnClose && !this.shouldRender) return null;\n\n return (\n <div class={{ 'hb-dialog-wrapper': true, 'hb-dialog-wrapper--hidden': !this.shouldRender }}>\n {this.modal && (\n <div\n class={{\n 'hb-dialog__overlay': true,\n 'hb-dialog__overlay--visible': this.modelValue,\n 'hb-dialog__overlay--leaving': this.leaving,\n }}\n style={{ zIndex: String(this.zIndex) }}\n onClick={this.handleOverlayClick}\n />\n )}\n <div\n ref={el => (this.panelRef = el as HTMLElement)}\n class={{\n 'hb-dialog': true,\n 'hb-dialog--fullscreen': this.fullscreen,\n 'hb-dialog--visible': this.modelValue,\n 'hb-dialog--leaving': this.leaving,\n }}\n style={{\n zIndex: String(this.zIndex + 1),\n width: this.fullscreen ? '100%' : this.width,\n }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden={this.modelValue ? 'false' : 'true'}\n >\n <div class=\"hb-dialog__header\">\n <span class=\"hb-dialog__title\">{this.title}</span>\n {this.showClose && (\n <button type=\"button\" class=\"hb-dialog__close\" aria-label=\"关闭\" onClick={this.close}>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width={2} stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M6 6l12 12M18 6L6 18\" />\n </svg>\n </button>\n )}\n </div>\n <div class=\"hb-dialog__body\">\n <slot />\n </div>\n <div class=\"hb-dialog__footer\">\n <slot name=\"footer\" />\n </div>\n </div>\n </div>\n );\n }\n}\n"]}
@@ -22,30 +22,71 @@
22
22
  right: 0;
23
23
  bottom: 0;
24
24
  background-color: var(--hb-color-bg-mask);
25
- transition: opacity 0.3s;
26
25
  pointer-events: auto;
26
+ /* 进场:opacity 0 → 1;离场由 --leaving class 反向播放 */
27
+ animation: hb-dialog-overlay-in 0.3s ease both;
28
+ }
29
+
30
+ .hb-dialog__overlay--leaving {
31
+ animation: hb-dialog-overlay-out 0.3s ease both;
32
+ }
33
+
34
+ @keyframes hb-dialog-overlay-in {
35
+ from {
36
+ opacity: 0;
37
+ }
38
+ to {
39
+ opacity: 1;
40
+ }
41
+ }
42
+ @keyframes hb-dialog-overlay-out {
43
+ from {
44
+ opacity: 1;
45
+ }
46
+ to {
47
+ opacity: 0;
48
+ }
27
49
  }
28
50
 
29
51
  .hb-dialog {
30
52
  position: fixed;
31
53
  top: 50%;
32
54
  left: 50%;
33
- transform: translate(-50%, -50%) scale(0.9);
34
55
  background-color: var(--hb-dialog-bg);
35
56
  border-radius: var(--hb-dialog-radius);
36
57
  box-shadow: var(--hb-dialog-shadow);
37
58
  pointer-events: auto;
38
- opacity: 0;
39
- transition: opacity 0.3s, transform 0.3s;
40
59
  display: flex;
41
60
  flex-direction: column;
42
61
  max-height: 90vh;
43
62
  overflow: hidden;
63
+ /* 进场:opacity + scale(对齐 antd Modal 的 fade+zoom) */
64
+ animation: hb-dialog-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
44
65
  }
45
66
 
46
- .hb-dialog--visible {
47
- opacity: 1;
48
- transform: translate(-50%, -50%) scale(1);
67
+ .hb-dialog--leaving {
68
+ animation: hb-dialog-out 0.3s cubic-bezier(0.5, 0, 0.75, 0) both;
69
+ }
70
+
71
+ @keyframes hb-dialog-in {
72
+ from {
73
+ opacity: 0;
74
+ transform: translate(-50%, -50%) scale(0.9);
75
+ }
76
+ to {
77
+ opacity: 1;
78
+ transform: translate(-50%, -50%) scale(1);
79
+ }
80
+ }
81
+ @keyframes hb-dialog-out {
82
+ from {
83
+ opacity: 1;
84
+ transform: translate(-50%, -50%) scale(1);
85
+ }
86
+ to {
87
+ opacity: 0;
88
+ transform: translate(-50%, -50%) scale(0.95);
89
+ }
49
90
  }
50
91
 
51
92
  .hb-dialog--fullscreen {
@@ -53,12 +94,12 @@
53
94
  height: 100vh;
54
95
  top: 0;
55
96
  left: 0;
56
- transform: none;
57
97
  border-radius: 0;
58
98
  max-height: 100vh;
59
99
  }
60
- .hb-dialog--fullscreen.hb-dialog--visible {
61
- transform: none;
100
+ .hb-dialog--fullscreen,
101
+ .hb-dialog--fullscreen.hb-dialog--leaving {
102
+ animation: none;
62
103
  }
63
104
 
64
105
  .hb-dialog__header {
@@ -83,11 +124,16 @@
83
124
  height: 28px;
84
125
  border: none;
85
126
  background: none;
86
- font-size: 18px;
87
127
  color: var(--hb-color-text-secondary);
88
128
  cursor: pointer;
89
129
  border-radius: var(--hb-border-radius-sm);
90
130
  transition: all var(--hb-transition-duration);
131
+ padding: 0;
132
+ }
133
+
134
+ .hb-dialog__close svg {
135
+ width: 16px;
136
+ height: 16px;
91
137
  }
92
138
 
93
139
  .hb-dialog__close:hover {
@@ -15,10 +15,18 @@ export class Drawer {
15
15
  zIndex = 0;
16
16
  panelRef;
17
17
  trap;
18
+ /** 离场动画期内保留渲染 */
19
+ leaving = false;
20
+ leaveTimer;
18
21
  hbOpen;
19
22
  hbClose;
20
23
  handleVisible(val) {
21
24
  if (val) {
25
+ if (this.leaveTimer) {
26
+ clearTimeout(this.leaveTimer);
27
+ this.leaveTimer = undefined;
28
+ }
29
+ this.leaving = false;
22
30
  this.zIndex = getNextZIndex();
23
31
  this.zIndexState = this.zIndex;
24
32
  if (this.modal)
@@ -31,6 +39,13 @@ export class Drawer {
31
39
  unlockScroll();
32
40
  this.hbClose.emit();
33
41
  document.removeEventListener('keydown', this.handleKeyDown);
42
+ // 进入离场动画期,结束后真正卸载
43
+ this.leaving = true;
44
+ if (this.leaveTimer)
45
+ clearTimeout(this.leaveTimer);
46
+ this.leaveTimer = setTimeout(() => {
47
+ this.leaving = false;
48
+ }, 300);
34
49
  }
35
50
  }
36
51
  componentDidRender() {
@@ -51,19 +66,34 @@ export class Drawer {
51
66
  unlockScroll();
52
67
  document.removeEventListener('keydown', this.handleKeyDown);
53
68
  this.trap?.disconnect();
69
+ if (this.leaveTimer)
70
+ clearTimeout(this.leaveTimer);
54
71
  }
55
72
  handleKeyDown = (e) => {
56
73
  if (this.closeOnPressEscape && e.key === 'Escape') {
57
74
  this.close();
58
75
  }
59
76
  };
60
- close = () => { this.modelValue = false; };
77
+ close = () => {
78
+ this.modelValue = false;
79
+ };
80
+ get shouldRender() {
81
+ return this.modelValue || this.leaving;
82
+ }
61
83
  render() {
62
84
  const dir = this.direction;
63
85
  const isVertical = dir === 'ttb' || dir === 'btt';
64
86
  const sizeStyle = isVertical ? { height: this.size } : { width: this.size };
65
87
  const translateClass = `hb-drawer--${dir}`;
66
- return (h("div", { key: 'e85f1040fdaacbf6e5d329f5561cdae25b2d4bc7', class: { 'hb-drawer-wrapper': true, 'hb-drawer-wrapper--visible': this.modelValue } }, this.modal && h("div", { key: '274cc165c21ea6490ca8f08be672b0605abc5d64', class: "hb-drawer__overlay", style: { zIndex: String(this.zIndexState) }, onClick: () => this.closeOnClickModal && this.close() }), h("div", { key: '8be6526f044035cfa31aebc66c5d459dbb2102af', ref: (el) => (this.panelRef = el), class: { 'hb-drawer': true, [translateClass]: true, 'hb-drawer--visible': this.modelValue }, style: { ...sizeStyle, zIndex: String(this.zIndexState + 1) }, role: "dialog", "aria-modal": "true", "aria-label": this.title || undefined }, h("div", { key: '826172fbe94e295fa146ef451455307fc97c7925', class: "hb-drawer__header" }, h("span", { key: 'a9fc420dea4707d6bd9ae38752c1ef08892ee44b', class: "hb-drawer__title" }, this.title), this.showClose && h("button", { key: 'b10452826b00e8fddc37a895af118c88b6c90ea4', type: "button", class: "hb-drawer__close", "aria-label": "\u5173\u95ED", onClick: this.close }, "\u00D7")), h("div", { key: 'f251c9c87ec21647c9bbc5363c6818b7fba4f7b5', class: "hb-drawer__body" }, h("slot", { key: '48e06fdeac538ec34aded9216c4a6ea98bd262ca' })))));
88
+ return (h("div", { key: '1b19a23690272c043ad80a8f4ad01470ef1f6627', class: { 'hb-drawer-wrapper': true, 'hb-drawer-wrapper--visible': this.shouldRender } }, this.modal && (h("div", { key: '6f1492a485eeb634e59a50300be5ad8af6ebfdcb', class: {
89
+ 'hb-drawer__overlay': true,
90
+ 'hb-drawer__overlay--leaving': this.leaving,
91
+ }, style: { zIndex: String(this.zIndexState) }, onClick: () => this.closeOnClickModal && this.close() })), h("div", { key: '4276468b6d5c2bc8628ccefeafc0de7acf372931', ref: el => (this.panelRef = el), class: {
92
+ 'hb-drawer': true,
93
+ [translateClass]: true,
94
+ 'hb-drawer--visible': this.modelValue,
95
+ 'hb-drawer--leaving': this.leaving,
96
+ }, style: { ...sizeStyle, zIndex: String(this.zIndexState + 1) }, role: "dialog", "aria-modal": "true", "aria-label": this.title || undefined, "aria-hidden": this.modelValue ? 'false' : 'true' }, h("div", { key: '66c7aa0843425292845c3a3c5841abaca233efd4', class: "hb-drawer__header" }, h("span", { key: '07226dc7437adb12e0d08ccf2259c6e470d4eea3', class: "hb-drawer__title" }, this.title), this.showClose && (h("button", { key: '2658edb09e334c02fa0218b414c354b4cbb20220', type: "button", class: "hb-drawer__close", "aria-label": "\u5173\u95ED", onClick: this.close }, h("svg", { key: '8ad5e5558c02fdb0271fa93d6fa279dee949d9f0', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": 2, "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { key: 'ff3585922cdeb73e68dbf1755092ade914579506', d: "M6 6l12 12M18 6L6 18" }))))), h("div", { key: 'b64ddf86b2f5a0344b80e7fb729c19a2d6d6fe5c', class: "hb-drawer__body" }, h("slot", { key: '3e3904d5d149a765130eb5f59ac1d268d48c39f6' })))));
67
97
  }
68
98
  static get is() { return "hb-drawer"; }
69
99
  static get encapsulation() { return "shadow"; }
@@ -243,7 +273,8 @@ export class Drawer {
243
273
  }
244
274
  static get states() {
245
275
  return {
246
- "zIndexState": {}
276
+ "zIndexState": {},
277
+ "leaving": {}
247
278
  };
248
279
  }
249
280
  static get events() {
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAE,eAAe,EAAa,MAAM,kBAAkB,CAAC;AAG9D,MAAM,OAAO,MAAM;IACQ,UAAU,GAAY,KAAK,CAAC;IAC7C,KAAK,GAAW,EAAE,CAAC;IACnB,IAAI,GAAW,KAAK,CAAC;IACrB,SAAS,GAAkC,KAAK,CAAC;IACjD,iBAAiB,GAAY,IAAI,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,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,EAAiB,CAAC,EAChD,KAAK,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,CAAC,UAAU,EAAE,EAC3F,KAAK,EAAE,EAAE,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE,EAC7D,IAAI,EAAC,QAAQ,gBACF,MAAM,gBACL,IAAI,CAAC,KAAK,IAAI,SAAS;gBAEnC,4DAAK,KAAK,EAAC,mBAAmB;oBAC5B,6DAAM,KAAK,EAAC,kBAAkB,IAAE,IAAI,CAAC,KAAK,CAAQ;oBACjD,IAAI,CAAC,SAAS,IAAI,+DAAQ,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,kBAAkB,gBAAY,cAAI,EAAC,OAAO,EAAE,IAAI,CAAC,KAAK,aAAY,CAC7G;gBACN,4DAAK,KAAK,EAAC,iBAAiB;oBAAC,8DAAQ,CAAM,CACvC,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, Event, EventEmitter, Watch, State } from '@stencil/core';\nimport { lockScroll, unlockScroll, getNextZIndex } from '../../utils/popup-manager';\nimport { createFocusTrap, FocusTrap } from '../../utils/a11y';\n\n@Component({ tag: 'hb-drawer', styleUrl: 'drawer.css', shadow: true })\nexport class Drawer {\n @Prop({ mutable: true }) modelValue: boolean = false;\n @Prop() title: string = '';\n @Prop() size: string = '30%';\n @Prop() direction: 'ltr' | 'rtl' | 'ttb' | 'btt' = 'rtl';\n @Prop() closeOnClickModal: boolean = true;\n @Prop() showClose: boolean = true;\n @Prop() modal: boolean = true;\n /** 是否按 ESC 关闭 */\n @Prop() closeOnPressEscape: boolean = true;\n @State() private zIndexState: number = 0;\n private zIndex: number = 0;\n private panelRef?: HTMLElement;\n private trap?: FocusTrap;\n\n @Event() hbOpen: EventEmitter<void>;\n @Event() hbClose: EventEmitter<void>;\n\n @Watch('modelValue')\n handleVisible(val: boolean) {\n if (val) {\n this.zIndex = getNextZIndex();\n this.zIndexState = this.zIndex;\n if (this.modal) lockScroll();\n this.hbOpen.emit();\n document.addEventListener('keydown', this.handleKeyDown);\n } else {\n if (this.modal) unlockScroll();\n this.hbClose.emit();\n document.removeEventListener('keydown', this.handleKeyDown);\n }\n }\n\n componentDidRender() {\n if (!this.panelRef) return;\n if (this.modelValue) {\n if (!this.trap) {\n this.trap = createFocusTrap({ container: this.panelRef });\n }\n this.trap.connect();\n } else {\n this.trap?.disconnect();\n }\n }\n\n disconnectedCallback() {\n if (this.modelValue && this.modal) unlockScroll();\n document.removeEventListener('keydown', this.handleKeyDown);\n this.trap?.disconnect();\n }\n\n private handleKeyDown = (e: KeyboardEvent) => {\n if (this.closeOnPressEscape && e.key === 'Escape') {\n this.close();\n }\n };\n\n private close = () => { this.modelValue = false; };\n\n render() {\n const dir = this.direction;\n const isVertical = dir === 'ttb' || dir === 'btt';\n const sizeStyle = isVertical ? { height: this.size } : { width: this.size };\n const translateClass = `hb-drawer--${dir}`;\n\n return (\n <div class={{ 'hb-drawer-wrapper': true, 'hb-drawer-wrapper--visible': this.modelValue }}>\n {this.modal && <div class=\"hb-drawer__overlay\" style={{ zIndex: String(this.zIndexState) }} onClick={() => this.closeOnClickModal && this.close()} />}\n <div\n ref={(el) => (this.panelRef = el as HTMLElement)}\n class={{ 'hb-drawer': true, [translateClass]: true, 'hb-drawer--visible': this.modelValue }}\n style={{ ...sizeStyle, zIndex: String(this.zIndexState + 1) }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={this.title || undefined}\n >\n <div class=\"hb-drawer__header\">\n <span class=\"hb-drawer__title\">{this.title}</span>\n {this.showClose && <button type=\"button\" class=\"hb-drawer__close\" aria-label=\"关闭\" onClick={this.close}>×</button>}\n </div>\n <div class=\"hb-drawer__body\"><slot /></div>\n </div>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAE,eAAe,EAAa,MAAM,kBAAkB,CAAC;AAG9D,MAAM,OAAO,MAAM;IACQ,UAAU,GAAY,KAAK,CAAC;IAC7C,KAAK,GAAW,EAAE,CAAC;IACnB,IAAI,GAAW,KAAK,CAAC;IACrB,SAAS,GAAkC,KAAK,CAAC;IACjD,iBAAiB,GAAY,IAAI,CAAC;IAClC,SAAS,GAAY,IAAI,CAAC;IAC1B,KAAK,GAAY,IAAI,CAAC;IAC9B,iBAAiB;IACT,kBAAkB,GAAY,IAAI,CAAC;IAC1B,WAAW,GAAW,CAAC,CAAC;IACjC,MAAM,GAAW,CAAC,CAAC;IACnB,QAAQ,CAAe;IACvB,IAAI,CAAa;IACzB,iBAAiB;IACA,OAAO,GAAY,KAAK,CAAC;IAClC,UAAU,CAAiC;IAE1C,MAAM,CAAqB;IAC3B,OAAO,CAAqB;IAGrC,aAAa,CAAC,GAAY;QACxB,IAAI,GAAG,EAAE,CAAC;YACR,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACpB,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAC9B,IAAI,CAAC,UAAU,GAAG,SA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CACF,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, Event, EventEmitter, Watch, State } from '@stencil/core';\nimport { lockScroll, unlockScroll, getNextZIndex } from '../../utils/popup-manager';\nimport { createFocusTrap, FocusTrap } from '../../utils/a11y';\n\n@Component({ tag: 'hb-drawer', styleUrl: 'drawer.css', shadow: true })\nexport class Drawer {\n @Prop({ mutable: true }) modelValue: boolean = false;\n @Prop() title: string = '';\n @Prop() size: string = '30%';\n @Prop() direction: 'ltr' | 'rtl' | 'ttb' | 'btt' = 'rtl';\n @Prop() closeOnClickModal: boolean = true;\n @Prop() showClose: boolean = true;\n @Prop() modal: boolean = true;\n /** 是否按 ESC 关闭 */\n @Prop() closeOnPressEscape: boolean = true;\n @State() private zIndexState: number = 0;\n private zIndex: number = 0;\n private panelRef?: HTMLElement;\n private trap?: FocusTrap;\n /** 离场动画期内保留渲染 */\n @State() private leaving: boolean = false;\n private leaveTimer?: ReturnType<typeof setTimeout>;\n\n @Event() hbOpen: EventEmitter<void>;\n @Event() hbClose: EventEmitter<void>;\n\n @Watch('modelValue')\n handleVisible(val: boolean) {\n if (val) {\n if (this.leaveTimer) {\n clearTimeout(this.leaveTimer);\n this.leaveTimer = undefined;\n }\n this.leaving = false;\n this.zIndex = getNextZIndex();\n this.zIndexState = this.zIndex;\n if (this.modal) lockScroll();\n this.hbOpen.emit();\n document.addEventListener('keydown', this.handleKeyDown);\n } else {\n if (this.modal) unlockScroll();\n this.hbClose.emit();\n document.removeEventListener('keydown', this.handleKeyDown);\n // 进入离场动画期,结束后真正卸载\n this.leaving = true;\n if (this.leaveTimer) clearTimeout(this.leaveTimer);\n this.leaveTimer = setTimeout(() => {\n this.leaving = false;\n }, 300);\n }\n }\n\n componentDidRender() {\n if (!this.panelRef) return;\n if (this.modelValue) {\n if (!this.trap) {\n this.trap = createFocusTrap({ container: this.panelRef });\n }\n this.trap.connect();\n } else {\n this.trap?.disconnect();\n }\n }\n\n disconnectedCallback() {\n if (this.modelValue && this.modal) unlockScroll();\n document.removeEventListener('keydown', this.handleKeyDown);\n this.trap?.disconnect();\n if (this.leaveTimer) clearTimeout(this.leaveTimer);\n }\n\n private handleKeyDown = (e: KeyboardEvent) => {\n if (this.closeOnPressEscape && e.key === 'Escape') {\n this.close();\n }\n };\n\n private close = () => {\n this.modelValue = false;\n };\n\n private get shouldRender(): boolean {\n return this.modelValue || this.leaving;\n }\n\n render() {\n const dir = this.direction;\n const isVertical = dir === 'ttb' || dir === 'btt';\n const sizeStyle = isVertical ? { height: this.size } : { width: this.size };\n const translateClass = `hb-drawer--${dir}`;\n\n return (\n <div class={{ 'hb-drawer-wrapper': true, 'hb-drawer-wrapper--visible': this.shouldRender }}>\n {this.modal && (\n <div\n class={{\n 'hb-drawer__overlay': true,\n 'hb-drawer__overlay--leaving': this.leaving,\n }}\n style={{ zIndex: String(this.zIndexState) }}\n onClick={() => this.closeOnClickModal && this.close()}\n />\n )}\n <div\n ref={el => (this.panelRef = el as HTMLElement)}\n class={{\n 'hb-drawer': true,\n [translateClass]: true,\n 'hb-drawer--visible': this.modelValue,\n 'hb-drawer--leaving': this.leaving,\n }}\n style={{ ...sizeStyle, zIndex: String(this.zIndexState + 1) }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={this.title || undefined}\n aria-hidden={this.modelValue ? 'false' : 'true'}\n >\n <div class=\"hb-drawer__header\">\n <span class=\"hb-drawer__title\">{this.title}</span>\n {this.showClose && (\n <button type=\"button\" class=\"hb-drawer__close\" aria-label=\"关闭\" onClick={this.close}>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width={2} stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M6 6l12 12M18 6L6 18\" />\n </svg>\n </button>\n )}\n </div>\n <div class=\"hb-drawer__body\">\n <slot />\n </div>\n </div>\n </div>\n );\n }\n}\n"]}
@@ -1,18 +1,208 @@
1
- :host { display: contents; }
2
- .hb-drawer-wrapper { position: fixed; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 1000; }
3
- .hb-drawer__overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--hb-color-bg-mask); pointer-events: auto; transition: opacity 0.3s; }
1
+ :host {
2
+ display: contents;
3
+ }
4
+ .hb-drawer-wrapper {
5
+ position: fixed;
6
+ top: 0;
7
+ left: 0;
8
+ right: 0;
9
+ bottom: 0;
10
+ pointer-events: none;
11
+ z-index: 1000;
12
+ }
13
+
14
+ /* wrapper 默认不显示(modelValue=false 且离场结束时);打开/离场期都可见 */
15
+ .hb-drawer-wrapper:not(.hb-drawer-wrapper--visible) {
16
+ display: none;
17
+ }
18
+
19
+ .hb-drawer__overlay {
20
+ position: fixed;
21
+ top: 0;
22
+ left: 0;
23
+ right: 0;
24
+ bottom: 0;
25
+ background: var(--hb-color-bg-mask);
26
+ pointer-events: auto;
27
+ animation: hb-drawer-overlay-in 0.3s ease both;
28
+ }
29
+ .hb-drawer__overlay--leaving {
30
+ animation: hb-drawer-overlay-out 0.3s ease both;
31
+ }
32
+ @keyframes hb-drawer-overlay-in {
33
+ from {
34
+ opacity: 0;
35
+ }
36
+ to {
37
+ opacity: 1;
38
+ }
39
+ }
40
+ @keyframes hb-drawer-overlay-out {
41
+ from {
42
+ opacity: 1;
43
+ }
44
+ to {
45
+ opacity: 0;
46
+ }
47
+ }
48
+
4
49
  .hb-drawer {
5
- position: fixed; background: var(--hb-color-bg-elevated); box-shadow: var(--hb-box-shadow-lg);
6
- display: flex; flex-direction: column; pointer-events: auto; transition: transform 0.3s ease;
7
- }
8
- .hb-drawer--rtl { top: 0; right: 0; bottom: 0; transform: translateX(100%); }
9
- .hb-drawer--ltr { top: 0; left: 0; bottom: 0; transform: translateX(-100%); }
10
- .hb-drawer--ttb { left: 0; right: 0; top: 0; transform: translateY(-100%); }
11
- .hb-drawer--btt { left: 0; right: 0; bottom: 0; transform: translateY(100%); }
12
- .hb-drawer--visible.hb-drawer--rtl, .hb-drawer--visible.hb-drawer--ltr { transform: translateX(0); }
13
- .hb-drawer--visible.hb-drawer--ttb, .hb-drawer--visible.hb-drawer--btt { transform: translateY(0); }
14
- .hb-drawer__header { display: flex; align-items: center; justify-content: space-between; padding: var(--hb-spacing-md) var(--hb-spacing-lg); border-bottom: 1px solid var(--hb-color-border-secondary); }
15
- .hb-drawer__title { font-size: var(--hb-font-size-lg); font-weight: 600; }
16
- .hb-drawer__close { border: none; background: none; font-size: 18px; cursor: pointer; color: var(--hb-color-text-secondary); width: 28px; height: 28px; border-radius: var(--hb-border-radius-sm); display: flex; align-items: center; justify-content: center; }
17
- .hb-drawer__close:hover { background: var(--hb-color-fill-tertiary); }
18
- .hb-drawer__body { flex: 1; padding: var(--hb-spacing-lg); overflow-y: auto; }
50
+ position: fixed;
51
+ background: var(--hb-color-bg-elevated);
52
+ box-shadow: var(--hb-box-shadow-lg);
53
+ display: flex;
54
+ flex-direction: column;
55
+ pointer-events: auto;
56
+ }
57
+
58
+ /* 四方向进场动画(从屏外滑入)。visible 时播放 in;leaving 时播放 out */
59
+ .hb-drawer--rtl {
60
+ top: 0;
61
+ right: 0;
62
+ bottom: 0;
63
+ }
64
+ .hb-drawer--ltr {
65
+ top: 0;
66
+ left: 0;
67
+ bottom: 0;
68
+ }
69
+ .hb-drawer--ttb {
70
+ left: 0;
71
+ right: 0;
72
+ top: 0;
73
+ }
74
+ .hb-drawer--btt {
75
+ left: 0;
76
+ right: 0;
77
+ bottom: 0;
78
+ }
79
+
80
+ .hb-drawer--visible.hb-drawer--rtl {
81
+ animation: hb-drawer-in-rtl 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
82
+ }
83
+ .hb-drawer--visible.hb-drawer--ltr {
84
+ animation: hb-drawer-in-ltr 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
85
+ }
86
+ .hb-drawer--visible.hb-drawer--ttb {
87
+ animation: hb-drawer-in-ttb 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
88
+ }
89
+ .hb-drawer--visible.hb-drawer--btt {
90
+ animation: hb-drawer-in-btt 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
91
+ }
92
+
93
+ .hb-drawer--leaving.hb-drawer--rtl {
94
+ animation: hb-drawer-out-rtl 0.3s cubic-bezier(0.5, 0, 0.75, 0) both;
95
+ }
96
+ .hb-drawer--leaving.hb-drawer--ltr {
97
+ animation: hb-drawer-out-ltr 0.3s cubic-bezier(0.5, 0, 0.75, 0) both;
98
+ }
99
+ .hb-drawer--leaving.hb-drawer--ttb {
100
+ animation: hb-drawer-out-ttb 0.3s cubic-bezier(0.5, 0, 0.75, 0) both;
101
+ }
102
+ .hb-drawer--leaving.hb-drawer--btt {
103
+ animation: hb-drawer-out-btt 0.3s cubic-bezier(0.5, 0, 0.75, 0) both;
104
+ }
105
+
106
+ @keyframes hb-drawer-in-rtl {
107
+ from {
108
+ transform: translateX(100%);
109
+ }
110
+ to {
111
+ transform: translateX(0);
112
+ }
113
+ }
114
+ @keyframes hb-drawer-out-rtl {
115
+ from {
116
+ transform: translateX(0);
117
+ }
118
+ to {
119
+ transform: translateX(100%);
120
+ }
121
+ }
122
+ @keyframes hb-drawer-in-ltr {
123
+ from {
124
+ transform: translateX(-100%);
125
+ }
126
+ to {
127
+ transform: translateX(0);
128
+ }
129
+ }
130
+ @keyframes hb-drawer-out-ltr {
131
+ from {
132
+ transform: translateX(0);
133
+ }
134
+ to {
135
+ transform: translateX(-100%);
136
+ }
137
+ }
138
+ @keyframes hb-drawer-in-ttb {
139
+ from {
140
+ transform: translateY(-100%);
141
+ }
142
+ to {
143
+ transform: translateY(0);
144
+ }
145
+ }
146
+ @keyframes hb-drawer-out-ttb {
147
+ from {
148
+ transform: translateY(0);
149
+ }
150
+ to {
151
+ transform: translateY(-100%);
152
+ }
153
+ }
154
+ @keyframes hb-drawer-in-btt {
155
+ from {
156
+ transform: translateY(100%);
157
+ }
158
+ to {
159
+ transform: translateY(0);
160
+ }
161
+ }
162
+ @keyframes hb-drawer-out-btt {
163
+ from {
164
+ transform: translateY(0);
165
+ }
166
+ to {
167
+ transform: translateY(100%);
168
+ }
169
+ }
170
+
171
+ .hb-drawer__header {
172
+ display: flex;
173
+ align-items: center;
174
+ justify-content: space-between;
175
+ padding: var(--hb-spacing-md) var(--hb-spacing-lg);
176
+ border-bottom: 1px solid var(--hb-color-border-secondary);
177
+ }
178
+ .hb-drawer__title {
179
+ font-size: var(--hb-font-size-lg);
180
+ font-weight: 600;
181
+ }
182
+ .hb-drawer__close {
183
+ border: none;
184
+ background: none;
185
+ cursor: pointer;
186
+ color: var(--hb-color-text-secondary);
187
+ width: 28px;
188
+ height: 28px;
189
+ border-radius: var(--hb-border-radius-sm);
190
+ display: flex;
191
+ align-items: center;
192
+ justify-content: center;
193
+ padding: 0;
194
+ transition: all var(--hb-transition-duration);
195
+ }
196
+ .hb-drawer__close svg {
197
+ width: 16px;
198
+ height: 16px;
199
+ }
200
+ .hb-drawer__close:hover {
201
+ background: var(--hb-color-fill-tertiary);
202
+ color: var(--hb-color-text-primary);
203
+ }
204
+ .hb-drawer__body {
205
+ flex: 1;
206
+ padding: var(--hb-spacing-lg);
207
+ overflow-y: auto;
208
+ }