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
@@ -1 +1 @@
1
- {"file":"hb-time-picker.entry.js","mappings":";;;AAAA,MAAM,aAAa,GAAG,k0QAAk0Q,CAAC;AACz1Q,2BAAe,aAAa;;MCWf,UAAU;;;;;;;;;IAMI,UAAU,CAAU;;;;IAKrC,WAAW,GAAW,OAAO,CAAC;;;;;I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C,8BAA8B,IACtC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,MAClB,WACE,KAAK,EAAE;gBACL,sBAAsB,EAAE,IAAI;gBAC5B,gCAAgC,EAAE,MAAM,KAAK,IAAI,CAAC,cAAc;aACjE,EACD,OAAO,EAAE,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,IAEnF,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAC5B,CACP,CAAC,CACE,CACF,CACP,CACG,CACF,CACP,CACG,EACN;KACH;;;;;;;;;","names":[],"sources":["src/components/TimePicker/time-picker.css?tag=hb-time-picker&encapsulation=shadow","src/components/TimePicker/TimePicker.tsx"],"sourcesContent":[":host {\n display: inline-block;\n position: relative;\n --hb-time-picker-font-size: 14px;\n --hb-time-picker-height: 32px;\n --hb-time-picker-border-color: var(--hb-border-color, #dcdfe6);\n --hb-time-picker-border-color-hover: var(--hb-color-primary);\n --hb-time-picker-bg-color: var(--hb-color-white, #ffffff);\n}\n\n.hb-time-picker {\n display: inline-block;\n position: relative;\n width: 200px;\n}\n\n.hb-time-picker__input-wrapper {\n position: relative;\n display: inline-block;\n width: 100%;\n cursor: pointer;\n}\n\n.hb-time-picker__input {\n display: inline-block;\n width: 100%;\n height: var(--hb-time-picker-height);\n line-height: var(--hb-time-picker-height);\n padding: 0 30px 0 15px;\n font-size: var(--hb-time-picker-font-size);\n color: var(--hb-color-text-regular, #606266);\n background-color: var(--hb-time-picker-bg-color);\n border: 1px solid var(--hb-time-picker-border-color);\n border-radius: 4px;\n box-sizing: border-box;\n cursor: pointer;\n outline: none;\n transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n}\n\n.hb-time-picker__input:hover:not(:disabled) {\n border-color: var(--hb-time-picker-border-color-hover);\n}\n\n.hb-time-picker__suffix {\n position: absolute;\n right: 8px;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n}\n\n.hb-time-picker__clear {\n margin-right: 8px;\n cursor: pointer;\n font-size: 16px;\n color: var(--hb-color-text-placeholder, #c0c4cc);\n}\n\n.hb-time-picker__icon {\n font-size: 14px;\n}\n\n.hb-time-picker__dropdown {\n position: absolute;\n top: 100%;\n left: 0;\n margin-top: 4px;\n background-color: var(--hb-time-picker-bg-color);\n border: 1px solid var(--hb-time-picker-border-color);\n border-radius: 4px;\n box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);\n z-index: 1000;\n min-width: 200px;\n max-height: 300px;\n}\n\n.hb-time-picker__body {\n display: flex;\n padding: 8px;\n}\n\n.hb-time-picker__list {\n flex: 1;\n max-height: 280px;\n overflow-y: auto;\n}\n\n.hb-time-picker__list-title {\n text-align: center;\n font-size: 12px;\n color: var(--hb-color-text-placeholder, #c0c4cc);\n padding: 8px 0;\n border-bottom: 1px solid var(--hb-border-color-lighter, #e4e7ed);\n}\n\n.hb-time-picker__list-content {\n padding: 4px 0;\n}\n\n.hb-time-picker__item {\n padding: 8px 16px;\n text-align: center;\n font-size: 13px;\n color: var(--hb-color-text-regular, #606266);\n cursor: pointer;\n transition: background-color 0.2s;\n}\n\n.hb-time-picker__item:hover {\n background-color: var(--hb-fill-color-light, #f5f7fa);\n}\n\n.hb-time-picker__item--selected {\n background-color: var(--hb-color-primary-light-9, #ecf5ff);\n color: var(--hb-color-primary);\n font-weight: 600;\n}\n\n.hb-time-picker--small {\n width: 180px;\n}\n\n.hb-time-picker--small .hb-time-picker__input {\n height: 24px;\n line-height: 24px;\n font-size: 12px;\n}\n\n.hb-time-picker--large {\n width: 220px;\n}\n\n.hb-time-picker--large .hb-time-picker__input {\n height: 40px;\n line-height: 40px;\n font-size: 16px;\n}\n\n.hb-time-picker--disabled {\n cursor: not-allowed;\n}\n\n.hb-time-picker--disabled .hb-time-picker__input {\n background-color: var(--hb-fill-color-light, #f5f7fa);\n border-color: var(--hb-time-picker-border-color);\n color: var(--hb-color-text-disabled, #c0c4cc);\n cursor: not-allowed;\n}\n\n","import { Component, h, Prop, Event, EventEmitter, State, Element, Watch } from '@stencil/core';\nimport { createClickOutsideHandler } from '../../utils/click-outside';\n\n/**\n * TimePicker 时间选择器组件\n * 用于选择或输入时间\n */\n@Component({\n tag: 'hb-time-picker',\n styleUrl: 'time-picker.css',\n shadow: true,\n})\nexport class TimePicker {\n @Element() el: HTMLElement;\n\n /**\n * 绑定值\n */\n @Prop({ mutable: true }) modelValue?: string;\n\n /**\n * 输入框占位文本\n */\n @Prop() placeholder: string = '请选择时间';\n\n /**\n * 是否禁用\n * @default false\n */\n @Prop() disabled: boolean = false;\n\n /**\n * 输入框尺寸\n */\n @Prop() size: 'large' | 'default' | 'small' = 'default';\n\n /**\n * 是否可清空\n * @default false\n */\n @Prop() clearable: boolean = false;\n\n /**\n * 时间格式\n * @default 'HH:mm:ss'\n */\n @Prop() format: string = 'HH:mm:ss';\n\n /**\n * 原生 name 属性\n */\n @Prop() name?: string;\n\n /**\n * 原生 id 属性\n */\n @Prop() inputId?: string;\n\n @State() isOpen: boolean = false;\n @State() inputValue: string = '';\n @State() selectedHour: number = 0;\n @State() selectedMinute: number = 0;\n @State() selectedSecond: number = 0;\n\n /**\n * 值改变事件\n */\n @Event() hbChange: EventEmitter<string>;\n\n private clickOutside = createClickOutsideHandler({\n host: null as any,\n isOpen: () => this.isOpen,\n onClose: () => { this.isOpen = false; },\n });\n\n componentDidLoad() {\n this.clickOutside = createClickOutsideHandler({\n host: this.el,\n isOpen: () => this.isOpen,\n onClose: () => { this.isOpen = false; },\n });\n this.clickOutside.connect();\n this.updateInputValue();\n }\n\n disconnectedCallback() {\n this.clickOutside.disconnect();\n }\n\n @Watch('modelValue')\n handleValueChange() {\n this.updateInputValue();\n }\n\n private updateInputValue() {\n if (!this.modelValue) {\n this.inputValue = '';\n return;\n }\n\n const parts = this.modelValue.split(':');\n if (parts.length >= 2) {\n this.selectedHour = parseInt(parts[0]) || 0;\n this.selectedMinute = parseInt(parts[1]) || 0;\n this.selectedSecond = parseInt(parts[2]) || 0;\n this.inputValue = this.modelValue;\n }\n }\n\n private handleInputClick = () => {\n if (this.disabled) return;\n this.isOpen = !this.isOpen;\n };\n\n private handleClear = (e: Event) => {\n e.stopPropagation();\n this.modelValue = undefined;\n this.inputValue = '';\n this.isOpen = false;\n this.hbChange.emit(undefined);\n };\n\n private handleTimeSelect = (hour: number, minute: number, second: number) => {\n this.selectedHour = hour;\n this.selectedMinute = minute;\n this.selectedSecond = second;\n \n const timeStr = `${String(hour).padStart(2, '0')}:${String(minute).padStart(2, '0')}:${String(second).padStart(2, '0')}`;\n this.modelValue = timeStr;\n this.inputValue = timeStr;\n this.isOpen = false;\n this.hbChange.emit(timeStr);\n };\n\n private generateNumbers(max: number): number[] {\n return Array.from({ length: max + 1 }, (_, i) => i);\n }\n\n render() {\n const hours = this.generateNumbers(23);\n const minutes = this.generateNumbers(59);\n const seconds = this.generateNumbers(59);\n\n return (\n <div\n class={{\n 'hb-time-picker': true,\n 'hb-time-picker--open': this.isOpen,\n 'hb-time-picker--disabled': this.disabled,\n [`hb-time-picker--${this.size}`]: true,\n }}\n >\n <div class=\"hb-time-picker__input-wrapper\" onClick={this.handleInputClick}>\n <input\n type=\"text\"\n id={this.inputId}\n name={this.name}\n class=\"hb-time-picker__input\"\n placeholder={this.placeholder}\n value={this.inputValue}\n disabled={this.disabled}\n readonly\n />\n <span class=\"hb-time-picker__suffix\">\n {this.clearable && this.modelValue && (\n <span class=\"hb-time-picker__clear\" onClick={this.handleClear}>\n ×\n </span>\n )}\n <span class=\"hb-time-picker__icon\">🕐</span>\n </span>\n </div>\n {this.isOpen && (\n <div class=\"hb-time-picker__dropdown\">\n <div class=\"hb-time-picker__body\">\n <div class=\"hb-time-picker__list\">\n <div class=\"hb-time-picker__list-title\">时</div>\n <div class=\"hb-time-picker__list-content\">\n {hours.map((hour) => (\n <div\n class={{\n 'hb-time-picker__item': true,\n 'hb-time-picker__item--selected': hour === this.selectedHour,\n }}\n onClick={() => this.handleTimeSelect(hour, this.selectedMinute, this.selectedSecond)}\n >\n {String(hour).padStart(2, '0')}\n </div>\n ))}\n </div>\n </div>\n <div class=\"hb-time-picker__list\">\n <div class=\"hb-time-picker__list-title\">分</div>\n <div class=\"hb-time-picker__list-content\">\n {minutes.map((minute) => (\n <div\n class={{\n 'hb-time-picker__item': true,\n 'hb-time-picker__item--selected': minute === this.selectedMinute,\n }}\n onClick={() => this.handleTimeSelect(this.selectedHour, minute, this.selectedSecond)}\n >\n {String(minute).padStart(2, '0')}\n </div>\n ))}\n </div>\n </div>\n {this.format.includes('ss') && (\n <div class=\"hb-time-picker__list\">\n <div class=\"hb-time-picker__list-title\">秒</div>\n <div class=\"hb-time-picker__list-content\">\n {seconds.map((second) => (\n <div\n class={{\n 'hb-time-picker__item': true,\n 'hb-time-picker__item--selected': second === this.selectedSecond,\n }}\n onClick={() => this.handleTimeSelect(this.selectedHour, this.selectedMinute, second)}\n >\n {String(second).padStart(2, '0')}\n </div>\n ))}\n </div>\n </div>\n )}\n </div>\n </div>\n )}\n </div>\n );\n }\n}\n\n"],"version":3}
1
+ {"file":"hb-time-picker.entry.js","mappings":";;;AAAA,MAAM,aAAa,GAAG,k0QAAk0Q,CAAC;AACz1Q,2BAAe,aAAa;;MCWf,UAAU;;;;;;;;;IAMI,UAAU,CAAU;;;;IAKrC,WAAW,GAAW,OAAO,CAAC;;;;;IAM9B,QAAQ,GAAY,KAAK,CAAC;;;;IAK1B,IAAI,GAAkC,SAAS,CAAC;;;;;IAMhD,SAAS,GAAY,KAAK,CAAC;;;;;IAM3B,MAAM,GAAW,UAAU,CAAC;;;;IAK5B,IAAI,CAAU;;;;IAKd,OAAO,CAAU;IAEhB,MAAM,GAAY,KAAK,CAAC;IACxB,UAAU,GAAW,EAAE,CAAC;IACxB,YAAY,GAAW,CAAC,CAAC;IACzB,cAAc,GAAW,CAAC,CAAC;IAC3B,cAAc,GAAW,CAAC,CAAC;;;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,8BAA8B,IACtC,OAAO,CAAC,GAAG,CAAC,MAAM,KACjB,WACE,KAAK,EAAE;gBACL,sBAAsB,EAAE,IAAI;gBAC5B,gCAAgC,EAAE,MAAM,KAAK,IAAI,CAAC,cAAc;aACjE,EACD,OAAO,EAAE,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,IAEnF,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAC5B,CACP,CAAC,CACE,CACF,CACP,CACG,CACF,CACP,CACG,EACN;KACH;;;;;;;;;","names":[],"sources":["src/components/TimePicker/time-picker.css?tag=hb-time-picker&encapsulation=shadow","src/components/TimePicker/TimePicker.tsx"],"sourcesContent":[":host {\n display: inline-block;\n position: relative;\n --hb-time-picker-font-size: 14px;\n --hb-time-picker-height: 32px;\n --hb-time-picker-border-color: var(--hb-border-color, #dcdfe6);\n --hb-time-picker-border-color-hover: var(--hb-color-primary);\n --hb-time-picker-bg-color: var(--hb-color-white, #ffffff);\n}\n\n.hb-time-picker {\n display: inline-block;\n position: relative;\n width: 200px;\n}\n\n.hb-time-picker__input-wrapper {\n position: relative;\n display: inline-block;\n width: 100%;\n cursor: pointer;\n}\n\n.hb-time-picker__input {\n display: inline-block;\n width: 100%;\n height: var(--hb-time-picker-height);\n line-height: var(--hb-time-picker-height);\n padding: 0 30px 0 15px;\n font-size: var(--hb-time-picker-font-size);\n color: var(--hb-color-text-regular, #606266);\n background-color: var(--hb-time-picker-bg-color);\n border: 1px solid var(--hb-time-picker-border-color);\n border-radius: 4px;\n box-sizing: border-box;\n cursor: pointer;\n outline: none;\n transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n}\n\n.hb-time-picker__input:hover:not(:disabled) {\n border-color: var(--hb-time-picker-border-color-hover);\n}\n\n.hb-time-picker__suffix {\n position: absolute;\n right: 8px;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n}\n\n.hb-time-picker__clear {\n margin-right: 8px;\n cursor: pointer;\n font-size: 16px;\n color: var(--hb-color-text-placeholder, #c0c4cc);\n}\n\n.hb-time-picker__icon {\n font-size: 14px;\n}\n\n.hb-time-picker__dropdown {\n position: absolute;\n top: 100%;\n left: 0;\n margin-top: 4px;\n background-color: var(--hb-time-picker-bg-color);\n border: 1px solid var(--hb-time-picker-border-color);\n border-radius: 4px;\n box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);\n z-index: 1000;\n min-width: 200px;\n max-height: 300px;\n}\n\n.hb-time-picker__body {\n display: flex;\n padding: 8px;\n}\n\n.hb-time-picker__list {\n flex: 1;\n max-height: 280px;\n overflow-y: auto;\n}\n\n.hb-time-picker__list-title {\n text-align: center;\n font-size: 12px;\n color: var(--hb-color-text-placeholder, #c0c4cc);\n padding: 8px 0;\n border-bottom: 1px solid var(--hb-border-color-lighter, #e4e7ed);\n}\n\n.hb-time-picker__list-content {\n padding: 4px 0;\n}\n\n.hb-time-picker__item {\n padding: 8px 16px;\n text-align: center;\n font-size: 13px;\n color: var(--hb-color-text-regular, #606266);\n cursor: pointer;\n transition: background-color 0.2s;\n}\n\n.hb-time-picker__item:hover {\n background-color: var(--hb-fill-color-light, #f5f7fa);\n}\n\n.hb-time-picker__item--selected {\n background-color: var(--hb-color-primary-light-9, #ecf5ff);\n color: var(--hb-color-primary);\n font-weight: 600;\n}\n\n.hb-time-picker--small {\n width: 180px;\n}\n\n.hb-time-picker--small .hb-time-picker__input {\n height: 24px;\n line-height: 24px;\n font-size: 12px;\n}\n\n.hb-time-picker--large {\n width: 220px;\n}\n\n.hb-time-picker--large .hb-time-picker__input {\n height: 40px;\n line-height: 40px;\n font-size: 16px;\n}\n\n.hb-time-picker--disabled {\n cursor: not-allowed;\n}\n\n.hb-time-picker--disabled .hb-time-picker__input {\n background-color: var(--hb-fill-color-light, #f5f7fa);\n border-color: var(--hb-time-picker-border-color);\n color: var(--hb-color-text-disabled, #c0c4cc);\n cursor: not-allowed;\n}\n\n","import { Component, h, Prop, Event, EventEmitter, State, Element, Watch } from '@stencil/core';\nimport { createClickOutsideHandler } from '../../utils/click-outside';\n\n/**\n * TimePicker 时间选择器组件\n * 用于选择或输入时间\n */\n@Component({\n tag: 'hb-time-picker',\n styleUrl: 'time-picker.css',\n shadow: true,\n})\nexport class TimePicker {\n @Element() el: HTMLElement;\n\n /**\n * 绑定值\n */\n @Prop({ mutable: true }) modelValue?: string;\n\n /**\n * 输入框占位文本\n */\n @Prop() placeholder: string = '请选择时间';\n\n /**\n * 是否禁用\n * @default false\n */\n @Prop() disabled: boolean = false;\n\n /**\n * 输入框尺寸\n */\n @Prop() size: 'large' | 'default' | 'small' = 'default';\n\n /**\n * 是否可清空\n * @default false\n */\n @Prop() clearable: boolean = false;\n\n /**\n * 时间格式\n * @default 'HH:mm:ss'\n */\n @Prop() format: string = 'HH:mm:ss';\n\n /**\n * 原生 name 属性\n */\n @Prop() name?: string;\n\n /**\n * 原生 id 属性\n */\n @Prop() inputId?: string;\n\n @State() isOpen: boolean = false;\n @State() inputValue: string = '';\n @State() selectedHour: number = 0;\n @State() selectedMinute: number = 0;\n @State() selectedSecond: number = 0;\n\n /**\n * 值改变事件\n */\n @Event() hbChange: EventEmitter<string>;\n\n private clickOutside = createClickOutsideHandler({\n host: null as any,\n isOpen: () => this.isOpen,\n onClose: () => {\n this.isOpen = false;\n },\n });\n\n componentDidLoad() {\n this.clickOutside = createClickOutsideHandler({\n host: this.el,\n isOpen: () => this.isOpen,\n onClose: () => {\n this.isOpen = false;\n },\n });\n this.clickOutside.connect();\n this.updateInputValue();\n }\n\n disconnectedCallback() {\n this.clickOutside.disconnect();\n }\n\n @Watch('modelValue')\n handleValueChange() {\n this.updateInputValue();\n }\n\n private updateInputValue() {\n if (!this.modelValue) {\n this.inputValue = '';\n return;\n }\n\n const parts = this.modelValue.split(':');\n if (parts.length >= 2) {\n // O1:显式传 radix 10(与全库一致),并用 ?? 替代 || 以保留合法的 0。\n this.selectedHour = Number.isNaN(parseInt(parts[0], 10)) ? 0 : parseInt(parts[0], 10);\n this.selectedMinute = Number.isNaN(parseInt(parts[1], 10)) ? 0 : parseInt(parts[1], 10);\n this.selectedSecond = parts.length >= 3 ? (Number.isNaN(parseInt(parts[2], 10)) ? 0 : parseInt(parts[2], 10)) : 0;\n this.inputValue = this.modelValue;\n }\n }\n\n private handleInputClick = () => {\n if (this.disabled) return;\n this.isOpen = !this.isOpen;\n };\n\n private handleClear = (e: Event) => {\n e.stopPropagation();\n this.modelValue = undefined;\n this.inputValue = '';\n this.isOpen = false;\n this.hbChange.emit(undefined);\n };\n\n private handleTimeSelect = (hour: number, minute: number, second: number) => {\n this.selectedHour = hour;\n this.selectedMinute = minute;\n this.selectedSecond = second;\n\n const timeStr = `${String(hour).padStart(2, '0')}:${String(minute).padStart(2, '0')}:${String(second).padStart(2, '0')}`;\n this.modelValue = timeStr;\n this.inputValue = timeStr;\n this.isOpen = false;\n this.hbChange.emit(timeStr);\n };\n\n private generateNumbers(max: number): number[] {\n return Array.from({ length: max + 1 }, (_, i) => i);\n }\n\n render() {\n const hours = this.generateNumbers(23);\n const minutes = this.generateNumbers(59);\n const seconds = this.generateNumbers(59);\n\n return (\n <div\n class={{\n 'hb-time-picker': true,\n 'hb-time-picker--open': this.isOpen,\n 'hb-time-picker--disabled': this.disabled,\n [`hb-time-picker--${this.size}`]: true,\n }}\n >\n <div class=\"hb-time-picker__input-wrapper\" onClick={this.handleInputClick}>\n <input\n type=\"text\"\n id={this.inputId}\n name={this.name}\n class=\"hb-time-picker__input\"\n placeholder={this.placeholder}\n value={this.inputValue}\n disabled={this.disabled}\n readonly\n />\n <span class=\"hb-time-picker__suffix\">\n {this.clearable && this.modelValue && (\n <span class=\"hb-time-picker__clear\" onClick={this.handleClear}>\n ×\n </span>\n )}\n <span class=\"hb-time-picker__icon\">🕐</span>\n </span>\n </div>\n {this.isOpen && (\n <div class=\"hb-time-picker__dropdown\">\n <div class=\"hb-time-picker__body\">\n <div class=\"hb-time-picker__list\">\n <div class=\"hb-time-picker__list-title\">时</div>\n <div class=\"hb-time-picker__list-content\">\n {hours.map(hour => (\n <div\n class={{\n 'hb-time-picker__item': true,\n 'hb-time-picker__item--selected': hour === this.selectedHour,\n }}\n onClick={() => this.handleTimeSelect(hour, this.selectedMinute, this.selectedSecond)}\n >\n {String(hour).padStart(2, '0')}\n </div>\n ))}\n </div>\n </div>\n <div class=\"hb-time-picker__list\">\n <div class=\"hb-time-picker__list-title\">分</div>\n <div class=\"hb-time-picker__list-content\">\n {minutes.map(minute => (\n <div\n class={{\n 'hb-time-picker__item': true,\n 'hb-time-picker__item--selected': minute === this.selectedMinute,\n }}\n onClick={() => this.handleTimeSelect(this.selectedHour, minute, this.selectedSecond)}\n >\n {String(minute).padStart(2, '0')}\n </div>\n ))}\n </div>\n </div>\n {this.format.includes('ss') && (\n <div class=\"hb-time-picker__list\">\n <div class=\"hb-time-picker__list-title\">秒</div>\n <div class=\"hb-time-picker__list-content\">\n {seconds.map(second => (\n <div\n class={{\n 'hb-time-picker__item': true,\n 'hb-time-picker__item--selected': second === this.selectedSecond,\n }}\n onClick={() => this.handleTimeSelect(this.selectedHour, this.selectedMinute, second)}\n >\n {String(second).padStart(2, '0')}\n </div>\n ))}\n </div>\n </div>\n )}\n </div>\n </div>\n )}\n </div>\n );\n }\n}\n"],"version":3}
@@ -83,8 +83,17 @@ const TimeSelect = class {
83
83
  }
84
84
  generateTimeOptions() {
85
85
  const options = [];
86
- const [startHour, startMinute] = this.start.split(':').map(Number);
87
- const [endHour, endMinute] = this.end.split(':').map(Number);
86
+ // O2:校验 split 长度,避免传 "9" 或 "" 时得 NaN → 空下拉无报错。
87
+ const startParts = this.start.split(':');
88
+ const endParts = this.end.split(':');
89
+ if (startParts.length < 2 || endParts.length < 2)
90
+ return options;
91
+ const startHour = Number(startParts[0]);
92
+ const startMinute = Number(startParts[1]);
93
+ const endHour = Number(endParts[0]);
94
+ const endMinute = Number(endParts[1]);
95
+ if ([startHour, startMinute, endHour, endMinute].some(Number.isNaN))
96
+ return options;
88
97
  const startMinutes = startHour * 60 + startMinute;
89
98
  const endMinutes = endHour * 60 + endMinute;
90
99
  for (let minutes = startMinutes; minutes <= endMinutes; minutes += this.step) {
@@ -120,12 +129,12 @@ const TimeSelect = class {
120
129
  render() {
121
130
  const timeOptions = this.generateTimeOptions();
122
131
  const showClear = this.clearable && this.modelValue;
123
- return (h("div", { key: '80b6173862d1e0951ef347de5193caedcac932fe', class: {
132
+ return (h("div", { key: '925f796c7bcbb7c9aab0ce4d84605ac1165c3847', class: {
124
133
  'hb-time-select': true,
125
134
  'hb-time-select--open': this.isOpen,
126
135
  'hb-time-select--disabled': this.disabled,
127
136
  [`hb-time-select--${this.size}`]: true,
128
- } }, h("div", { key: '1641232ea00cc0867c5b6bc654d803af01883607', class: "hb-time-select__input-wrapper", onClick: this.handleInputClick }, h("input", { key: 'b896fb8c57ad48d448b15b92eeee853c70d168d4', type: "text", class: "hb-time-select__input", placeholder: this.placeholder, value: this.inputValue, disabled: this.disabled, readonly: true }), h("span", { key: '5056a36aaa17a2d5c2b47db106f6c7ddff0607d0', class: "hb-time-select__suffix" }, showClear && (h("span", { key: '12b24a90b988d6f351547b351b35c03bc277c611', class: "hb-time-select__clear", onClick: this.handleClear }, "\u00D7")), h("span", { key: '2a3f3187510fb01428d429237ec2a8213f3cab2b', class: "hb-time-select__arrow" }, "\u25BC"))), this.isOpen && (h("div", { key: '3f8d01ce99076e93b672642fa0c40eed4df0bf12', class: "hb-time-select__dropdown" }, h("ul", { key: '50c21be3d365710617ce81f8411873ee3cecbc4b', class: "hb-time-select__menu" }, timeOptions.map((time) => (h("li", { class: {
137
+ } }, h("div", { key: '04c127edd61105261df535e13214ebab8b263c48', class: "hb-time-select__input-wrapper", onClick: this.handleInputClick }, h("input", { key: 'ae6b93c66b415cf8dab94406af62e26e45564aa4', type: "text", class: "hb-time-select__input", placeholder: this.placeholder, value: this.inputValue, disabled: this.disabled, readonly: true }), h("span", { key: '7ab6337ba0008b186fdc9d421efaed7063e95a7a', class: "hb-time-select__suffix" }, showClear && (h("span", { key: 'd1b322f46ebe8705743d37e159959aa8eb3b5d1c', class: "hb-time-select__clear", onClick: this.handleClear }, "\u00D7")), h("span", { key: '7fb0894ba59f6366af81a90689c6530b78fa5807', class: "hb-time-select__arrow" }, "\u25BC"))), this.isOpen && (h("div", { key: 'ccfa2ea217df443a4f8177f6a65d351f12ad33bc', class: "hb-time-select__dropdown" }, h("ul", { key: 'a5f75285a9c42c782479e0c825208411efbf6048', class: "hb-time-select__menu" }, timeOptions.map(time => (h("li", { class: {
129
138
  'hb-time-select__menu-item': true,
130
139
  'hb-time-select__menu-item--selected': time === this.modelValue,
131
140
  }, onClick: () => this.handleSelect(time) }, time))))))));
@@ -1 +1 @@
1
- {"file":"hb-time-select.entry.js","mappings":";;AAAA,MAAM,aAAa,GAAG,orQAAorQ,CAAC;AAC3sQ,2BAAe,aAAa;;MCUf,UAAU;;;;;;;;;IAMI,UAAU,CAAU;;;;IAKrC,WAAW,GAAW,OAAO,CAAC;;;;;IAM9B,QAAQ,GAAY,KAAK,CAAC;;;;IAK1B,IAAI,GAAkC,SAAS,CAAC;;;;;IAMhD,SAAS,GAAY,KAAK,CAAC;;;;;IAM3B,KAAK,GAAW,OAAO,CAAC;;;;;IAMxB,GAAG,GAAW,OAAO,CAAC;;;;;IAMtB,IAAI,GAAW,EAAE,CAAC;;;;IAKlB,OAAO,CAAU;;;;IAKjB,OAAO,CAAU;IAEhB,MAAM,GAAY,KAAK,CAAC;IACxB,UAAU,GAAW,EAAE,CAAC;;;;IAKxB,QAAQ,CAAuB;IAExC,gBAAgB;QACd,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;KAC9D;IAED,oBAAoB;QAClB,QAAQ,CAAC,mBAAmB,CAAC,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AC,QAAQ;gBACzC,CAAC,mBAAmB,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI;aACvC,IAED,4DAAK,KAAK,EAAC,+BAA+B,EAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,IACvE,8DACE,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,uBAAuB,EAC7B,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,KAAK,EAAE,IAAI,CAAC,UAAU,EACtB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,SACR,EACF,6DAAM,KAAK,EAAC,wBAAwB,IACjC,SAAS,KACR,6DAAM,KAAK,EAAC,uBAAuB,EAAC,OAAO,EAAE,IAAI,CAAC,WAAW,aAEtD,CACR,EACD,6DAAM,KAAK,EAAC,uBAAuB,aAAS,CACvC,CACH,EACL,IAAI,CAAC,MAAM,KACV,4DAAK,KAAK,EAAC,0BAA0B,IACnC,2DAAI,KAAK,EAAC,sBAAsB,IAC7B,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,MACpB,UACE,KAAK,EAAE;gBACL,2BAA2B,EAAE,IAAI;gBACjC,qCAAqC,EAAE,IAAI,KAAK,IAAI,CAAC,UAAU;aAChE,EACD,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAErC,IAAI,CACF,CACN,CAAC,CACC,CACD,CACP,CACG,EACN;KACH;;;;;;;;;","names":[],"sources":["src/components/TimeSelect/time-select.css?tag=hb-time-select&encapsulation=shadow","src/components/TimeSelect/TimeSelect.tsx"],"sourcesContent":[":host {\n display: inline-block;\n position: relative;\n --hb-time-select-font-size: 14px;\n --hb-time-select-height: 32px;\n --hb-time-select-border-color: var(--hb-border-color, #dcdfe6);\n --hb-time-select-border-color-hover: var(--hb-color-primary);\n --hb-time-select-bg-color: var(--hb-color-white, #ffffff);\n}\n\n.hb-time-select {\n display: inline-block;\n position: relative;\n width: 200px;\n}\n\n.hb-time-select__input-wrapper {\n position: relative;\n display: inline-block;\n width: 100%;\n cursor: pointer;\n}\n\n.hb-time-select__input {\n display: inline-block;\n width: 100%;\n height: var(--hb-time-select-height);\n line-height: var(--hb-time-select-height);\n padding: 0 30px 0 15px;\n font-size: var(--hb-time-select-font-size);\n color: var(--hb-color-text-regular, #606266);\n background-color: var(--hb-time-select-bg-color);\n border: 1px solid var(--hb-time-select-border-color);\n border-radius: 4px;\n box-sizing: border-box;\n cursor: pointer;\n outline: none;\n transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n}\n\n.hb-time-select__input:hover:not(:disabled) {\n border-color: var(--hb-time-select-border-color-hover);\n}\n\n.hb-time-select__suffix {\n position: absolute;\n right: 8px;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n}\n\n.hb-time-select__clear {\n margin-right: 8px;\n cursor: pointer;\n font-size: 16px;\n color: var(--hb-color-text-placeholder, #c0c4cc);\n}\n\n.hb-time-select__arrow {\n font-size: 12px;\n transition: transform 0.3s;\n}\n\n.hb-time-select--open .hb-time-select__arrow {\n transform: rotate(180deg);\n}\n\n.hb-time-select__dropdown {\n position: absolute;\n top: 100%;\n left: 0;\n margin-top: 4px;\n background-color: var(--hb-time-select-bg-color);\n border: 1px solid var(--hb-time-select-border-color);\n border-radius: 4px;\n box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);\n z-index: 1000;\n min-width: 100%;\n max-height: 300px;\n overflow-y: auto;\n}\n\n.hb-time-select__menu {\n margin: 0;\n padding: 6px 0;\n list-style: none;\n}\n\n.hb-time-select__menu-item {\n padding: 8px 20px;\n font-size: var(--hb-time-select-font-size);\n color: var(--hb-color-text-regular, #606266);\n cursor: pointer;\n transition: background-color 0.2s;\n}\n\n.hb-time-select__menu-item:hover {\n background-color: var(--hb-fill-color-light, #f5f7fa);\n}\n\n.hb-time-select__menu-item--selected {\n color: var(--hb-color-primary);\n font-weight: 600;\n background-color: var(--hb-color-primary-light-9, #ecf5ff);\n}\n\n.hb-time-select--small {\n width: 180px;\n}\n\n.hb-time-select--small .hb-time-select__input {\n height: 24px;\n line-height: 24px;\n font-size: 12px;\n}\n\n.hb-time-select--large {\n width: 220px;\n}\n\n.hb-time-select--large .hb-time-select__input {\n height: 40px;\n line-height: 40px;\n font-size: 16px;\n}\n\n.hb-time-select--disabled {\n cursor: not-allowed;\n}\n\n.hb-time-select--disabled .hb-time-select__input {\n background-color: var(--hb-fill-color-light, #f5f7fa);\n border-color: var(--hb-time-select-border-color);\n color: var(--hb-color-text-disabled, #c0c4cc);\n cursor: not-allowed;\n}\n\n","import { Component, h, Prop, Event, EventEmitter, State, Element, Watch } from '@stencil/core';\n\n/**\n * TimeSelect 时间选择组件\n * 可用于时间选择\n */\n@Component({\n tag: 'hb-time-select',\n styleUrl: 'time-select.css',\n shadow: true,\n})\nexport class TimeSelect {\n @Element() el: HTMLElement;\n\n /**\n * 绑定值\n */\n @Prop({ mutable: true }) modelValue?: string;\n\n /**\n * 输入框占位文本\n */\n @Prop() placeholder: string = '请选择时间';\n\n /**\n * 是否禁用\n * @default false\n */\n @Prop() disabled: boolean = false;\n\n /**\n * 输入框尺寸\n */\n @Prop() size: 'large' | 'default' | 'small' = 'default';\n\n /**\n * 是否可清空\n * @default false\n */\n @Prop() clearable: boolean = false;\n\n /**\n * 开始时间\n * @default '09:00'\n */\n @Prop() start: string = '09:00';\n\n /**\n * 结束时间\n * @default '18:00'\n */\n @Prop() end: string = '18:00';\n\n /**\n * 间隔时间\n * @default 60\n */\n @Prop() step: number = 60;\n\n /**\n * 最小时间\n */\n @Prop() minTime?: string;\n\n /**\n * 最大时间\n */\n @Prop() maxTime?: string;\n\n @State() isOpen: boolean = false;\n @State() inputValue: string = '';\n\n /**\n * 值改变事件\n */\n @Event() hbChange: EventEmitter<string>;\n\n componentDidLoad() {\n this.updateInputValue();\n document.addEventListener('click', this.handleDocumentClick);\n }\n\n disconnectedCallback() {\n document.removeEventListener('click', this.handleDocumentClick);\n }\n\n private handleDocumentClick = (e: MouseEvent) => {\n if (!this.isOpen) return;\n const target = e.target as HTMLElement;\n if (!this.el.contains(target)) {\n this.isOpen = false;\n }\n };\n\n @Watch('modelValue')\n handleValueChange() {\n this.updateInputValue();\n }\n\n private updateInputValue() {\n this.inputValue = this.modelValue || '';\n }\n\n private generateTimeOptions(): string[] {\n const options: string[] = [];\n const [startHour, startMinute] = this.start.split(':').map(Number);\n const [endHour, endMinute] = this.end.split(':').map(Number);\n \n const startMinutes = startHour * 60 + startMinute;\n const endMinutes = endHour * 60 + endMinute;\n \n for (let minutes = startMinutes; minutes <= endMinutes; minutes += this.step) {\n const hour = Math.floor(minutes / 60);\n const minute = minutes % 60;\n const timeStr = `${String(hour).padStart(2, '0')}:${String(minute).padStart(2, '0')}`;\n \n if (this.minTime && timeStr < this.minTime) continue;\n if (this.maxTime && timeStr > this.maxTime) continue;\n \n options.push(timeStr);\n }\n \n return options;\n }\n\n private handleInputClick = () => {\n if (this.disabled) return;\n this.isOpen = !this.isOpen;\n };\n\n private handleClear = (e: Event) => {\n e.stopPropagation();\n this.modelValue = undefined;\n this.inputValue = '';\n this.isOpen = false;\n this.hbChange.emit(undefined);\n };\n\n private handleSelect = (time: string) => {\n this.modelValue = time;\n this.inputValue = time;\n this.isOpen = false;\n this.hbChange.emit(time);\n };\n\n render() {\n const timeOptions = this.generateTimeOptions();\n const showClear = this.clearable && this.modelValue;\n\n return (\n <div\n class={{\n 'hb-time-select': true,\n 'hb-time-select--open': this.isOpen,\n 'hb-time-select--disabled': this.disabled,\n [`hb-time-select--${this.size}`]: true,\n }}\n >\n <div class=\"hb-time-select__input-wrapper\" onClick={this.handleInputClick}>\n <input\n type=\"text\"\n class=\"hb-time-select__input\"\n placeholder={this.placeholder}\n value={this.inputValue}\n disabled={this.disabled}\n readonly\n />\n <span class=\"hb-time-select__suffix\">\n {showClear && (\n <span class=\"hb-time-select__clear\" onClick={this.handleClear}>\n ×\n </span>\n )}\n <span class=\"hb-time-select__arrow\">▼</span>\n </span>\n </div>\n {this.isOpen && (\n <div class=\"hb-time-select__dropdown\">\n <ul class=\"hb-time-select__menu\">\n {timeOptions.map((time) => (\n <li\n class={{\n 'hb-time-select__menu-item': true,\n 'hb-time-select__menu-item--selected': time === this.modelValue,\n }}\n onClick={() => this.handleSelect(time)}\n >\n {time}\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n }\n}\n\n"],"version":3}
1
+ {"file":"hb-time-select.entry.js","mappings":";;AAAA,MAAM,aAAa,GAAG,orQAAorQ,CAAC;AAC3sQ,2BAAe,aAAa;;MCUf,UAAU;;;;;;;;;IAMI,UAAU,CAAU;;;;IAKrC,WAAW,GAAW,OAAO,CAAC;;;;;IAM9B,QAAQ,GAAY,KAAK,CAAC;;;;IAK1B,IAAI,GAAkC,SAAS,CAAC;;;;;IAMhD,SAAS,GAAY,KAAK,CAAC;;;;;IAM3B,KAAK,GAAW,OAAO,CAAC;;;;;IAMxB,GAAG,GAAW,OAAO,CAAC;;;;;IAMtB,IAAI,GAAW,EAAE,CAAC;;;;IAKlB,OAAO,CAAU;;;;IAKjB,OAAO,CAAU;IAEhB,MAAM,GAAY,KAAK,CAAC;IACxB,UAAU,GAAW,EAAE,CAAC;;;;IAKxB,QAAQ,CAAuB;IAExC,gBAAgB;QACd,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;KAC9D;IAED,oBAAoB;QAClB,QAAQ,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;KACjE;IAEO,mBAAmB,GAAG,CAAC,CAAa;QAC1C,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,OAAO;QACzB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAqB,CAAC;QACvC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;YAC7B,IAAI,CAAC,MAAM,GAAG,KAAK,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AC;QAEpD,QACE,4DACE,KAAK,EAAE;gBACL,gBAAgB,EAAE,IAAI;gBACtB,sBAAsB,EAAE,IAAI,CAAC,MAAM;gBACnC,0BAA0B,EAAE,IAAI,CAAC,QAAQ;gBACzC,CAAC,mBAAmB,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI;aACvC,IAED,4DAAK,KAAK,EAAC,+BAA+B,EAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,IACvE,8DAAO,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,uBAAuB,EAAC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,SAAG,EAC5I,6DAAM,KAAK,EAAC,wBAAwB,IACjC,SAAS,KACR,6DAAM,KAAK,EAAC,uBAAuB,EAAC,OAAO,EAAE,IAAI,CAAC,WAAW,aAEtD,CACR,EACD,6DAAM,KAAK,EAAC,uBAAuB,aAAS,CACvC,CACH,EACL,IAAI,CAAC,MAAM,KACV,4DAAK,KAAK,EAAC,0BAA0B,IACnC,2DAAI,KAAK,EAAC,sBAAsB,IAC7B,WAAW,CAAC,GAAG,CAAC,IAAI,KACnB,UACE,KAAK,EAAE;gBACL,2BAA2B,EAAE,IAAI;gBACjC,qCAAqC,EAAE,IAAI,KAAK,IAAI,CAAC,UAAU;aAChE,EACD,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAErC,IAAI,CACF,CACN,CAAC,CACC,CACD,CACP,CACG,EACN;KACH;;;;;;;;;","names":[],"sources":["src/components/TimeSelect/time-select.css?tag=hb-time-select&encapsulation=shadow","src/components/TimeSelect/TimeSelect.tsx"],"sourcesContent":[":host {\n display: inline-block;\n position: relative;\n --hb-time-select-font-size: 14px;\n --hb-time-select-height: 32px;\n --hb-time-select-border-color: var(--hb-border-color, #dcdfe6);\n --hb-time-select-border-color-hover: var(--hb-color-primary);\n --hb-time-select-bg-color: var(--hb-color-white, #ffffff);\n}\n\n.hb-time-select {\n display: inline-block;\n position: relative;\n width: 200px;\n}\n\n.hb-time-select__input-wrapper {\n position: relative;\n display: inline-block;\n width: 100%;\n cursor: pointer;\n}\n\n.hb-time-select__input {\n display: inline-block;\n width: 100%;\n height: var(--hb-time-select-height);\n line-height: var(--hb-time-select-height);\n padding: 0 30px 0 15px;\n font-size: var(--hb-time-select-font-size);\n color: var(--hb-color-text-regular, #606266);\n background-color: var(--hb-time-select-bg-color);\n border: 1px solid var(--hb-time-select-border-color);\n border-radius: 4px;\n box-sizing: border-box;\n cursor: pointer;\n outline: none;\n transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n}\n\n.hb-time-select__input:hover:not(:disabled) {\n border-color: var(--hb-time-select-border-color-hover);\n}\n\n.hb-time-select__suffix {\n position: absolute;\n right: 8px;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n}\n\n.hb-time-select__clear {\n margin-right: 8px;\n cursor: pointer;\n font-size: 16px;\n color: var(--hb-color-text-placeholder, #c0c4cc);\n}\n\n.hb-time-select__arrow {\n font-size: 12px;\n transition: transform 0.3s;\n}\n\n.hb-time-select--open .hb-time-select__arrow {\n transform: rotate(180deg);\n}\n\n.hb-time-select__dropdown {\n position: absolute;\n top: 100%;\n left: 0;\n margin-top: 4px;\n background-color: var(--hb-time-select-bg-color);\n border: 1px solid var(--hb-time-select-border-color);\n border-radius: 4px;\n box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);\n z-index: 1000;\n min-width: 100%;\n max-height: 300px;\n overflow-y: auto;\n}\n\n.hb-time-select__menu {\n margin: 0;\n padding: 6px 0;\n list-style: none;\n}\n\n.hb-time-select__menu-item {\n padding: 8px 20px;\n font-size: var(--hb-time-select-font-size);\n color: var(--hb-color-text-regular, #606266);\n cursor: pointer;\n transition: background-color 0.2s;\n}\n\n.hb-time-select__menu-item:hover {\n background-color: var(--hb-fill-color-light, #f5f7fa);\n}\n\n.hb-time-select__menu-item--selected {\n color: var(--hb-color-primary);\n font-weight: 600;\n background-color: var(--hb-color-primary-light-9, #ecf5ff);\n}\n\n.hb-time-select--small {\n width: 180px;\n}\n\n.hb-time-select--small .hb-time-select__input {\n height: 24px;\n line-height: 24px;\n font-size: 12px;\n}\n\n.hb-time-select--large {\n width: 220px;\n}\n\n.hb-time-select--large .hb-time-select__input {\n height: 40px;\n line-height: 40px;\n font-size: 16px;\n}\n\n.hb-time-select--disabled {\n cursor: not-allowed;\n}\n\n.hb-time-select--disabled .hb-time-select__input {\n background-color: var(--hb-fill-color-light, #f5f7fa);\n border-color: var(--hb-time-select-border-color);\n color: var(--hb-color-text-disabled, #c0c4cc);\n cursor: not-allowed;\n}\n\n","import { Component, h, Prop, Event, EventEmitter, State, Element, Watch } from '@stencil/core';\n\n/**\n * TimeSelect 时间选择组件\n * 可用于时间选择\n */\n@Component({\n tag: 'hb-time-select',\n styleUrl: 'time-select.css',\n shadow: true,\n})\nexport class TimeSelect {\n @Element() el: HTMLElement;\n\n /**\n * 绑定值\n */\n @Prop({ mutable: true }) modelValue?: string;\n\n /**\n * 输入框占位文本\n */\n @Prop() placeholder: string = '请选择时间';\n\n /**\n * 是否禁用\n * @default false\n */\n @Prop() disabled: boolean = false;\n\n /**\n * 输入框尺寸\n */\n @Prop() size: 'large' | 'default' | 'small' = 'default';\n\n /**\n * 是否可清空\n * @default false\n */\n @Prop() clearable: boolean = false;\n\n /**\n * 开始时间\n * @default '09:00'\n */\n @Prop() start: string = '09:00';\n\n /**\n * 结束时间\n * @default '18:00'\n */\n @Prop() end: string = '18:00';\n\n /**\n * 间隔时间\n * @default 60\n */\n @Prop() step: number = 60;\n\n /**\n * 最小时间\n */\n @Prop() minTime?: string;\n\n /**\n * 最大时间\n */\n @Prop() maxTime?: string;\n\n @State() isOpen: boolean = false;\n @State() inputValue: string = '';\n\n /**\n * 值改变事件\n */\n @Event() hbChange: EventEmitter<string>;\n\n componentDidLoad() {\n this.updateInputValue();\n document.addEventListener('click', this.handleDocumentClick);\n }\n\n disconnectedCallback() {\n document.removeEventListener('click', this.handleDocumentClick);\n }\n\n private handleDocumentClick = (e: MouseEvent) => {\n if (!this.isOpen) return;\n const target = e.target as HTMLElement;\n if (!this.el.contains(target)) {\n this.isOpen = false;\n }\n };\n\n @Watch('modelValue')\n handleValueChange() {\n this.updateInputValue();\n }\n\n private updateInputValue() {\n this.inputValue = this.modelValue || '';\n }\n\n private generateTimeOptions(): string[] {\n const options: string[] = [];\n // O2:校验 split 长度,避免传 \"9\" 或 \"\" 时得 NaN → 空下拉无报错。\n const startParts = this.start.split(':');\n const endParts = this.end.split(':');\n if (startParts.length < 2 || endParts.length < 2) return options;\n const startHour = Number(startParts[0]);\n const startMinute = Number(startParts[1]);\n const endHour = Number(endParts[0]);\n const endMinute = Number(endParts[1]);\n if ([startHour, startMinute, endHour, endMinute].some(Number.isNaN)) return options;\n\n const startMinutes = startHour * 60 + startMinute;\n const endMinutes = endHour * 60 + endMinute;\n\n for (let minutes = startMinutes; minutes <= endMinutes; minutes += this.step) {\n const hour = Math.floor(minutes / 60);\n const minute = minutes % 60;\n const timeStr = `${String(hour).padStart(2, '0')}:${String(minute).padStart(2, '0')}`;\n\n if (this.minTime && timeStr < this.minTime) continue;\n if (this.maxTime && timeStr > this.maxTime) continue;\n\n options.push(timeStr);\n }\n\n return options;\n }\n\n private handleInputClick = () => {\n if (this.disabled) return;\n this.isOpen = !this.isOpen;\n };\n\n private handleClear = (e: Event) => {\n e.stopPropagation();\n this.modelValue = undefined;\n this.inputValue = '';\n this.isOpen = false;\n this.hbChange.emit(undefined);\n };\n\n private handleSelect = (time: string) => {\n this.modelValue = time;\n this.inputValue = time;\n this.isOpen = false;\n this.hbChange.emit(time);\n };\n\n render() {\n const timeOptions = this.generateTimeOptions();\n const showClear = this.clearable && this.modelValue;\n\n return (\n <div\n class={{\n 'hb-time-select': true,\n 'hb-time-select--open': this.isOpen,\n 'hb-time-select--disabled': this.disabled,\n [`hb-time-select--${this.size}`]: true,\n }}\n >\n <div class=\"hb-time-select__input-wrapper\" onClick={this.handleInputClick}>\n <input type=\"text\" class=\"hb-time-select__input\" placeholder={this.placeholder} value={this.inputValue} disabled={this.disabled} readonly />\n <span class=\"hb-time-select__suffix\">\n {showClear && (\n <span class=\"hb-time-select__clear\" onClick={this.handleClear}>\n ×\n </span>\n )}\n <span class=\"hb-time-select__arrow\">▼</span>\n </span>\n </div>\n {this.isOpen && (\n <div class=\"hb-time-select__dropdown\">\n <ul class=\"hb-time-select__menu\">\n {timeOptions.map(time => (\n <li\n class={{\n 'hb-time-select__menu-item': true,\n 'hb-time-select__menu-item--selected': time === this.modelValue,\n }}\n onClick={() => this.handleSelect(time)}\n >\n {time}\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n }\n}\n"],"version":3}
@@ -1,8 +1,9 @@
1
1
  import { r as registerInstance, g as getElement, h } from './index-fdf7135e.js';
2
2
  import { c as computePosition, g as getNextZIndex } from './popup-manager-128cc685.js';
3
- import { i as isActivationKey } from './a11y-f9ab2964.js';
3
+ import { i as isActivationKey } from './a11y-e4cde5b0.js';
4
+ import { c as createLeaveScheduler } from './transition-4295d789.js';
4
5
 
5
- const tooltipCss = "/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{appearance:button;background-color:#0000;border:0 solid;border-radius:0;box-sizing:border-box;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;margin:0;margin-inline-end:4px;opacity:1;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);line-height:1.5;tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex;padding-block:0}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}} /*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{}@layer base{}@layer components;.hb-tooltip__trigger,:host{display:inline-block}.hb-tooltip__popup{background-color:var(--hb-p-gray-800);border-radius:var(--hb-border-radius-sm);box-shadow:var(--hb-box-shadow);color:#fff;font-size:var(--hb-font-size-sm);pointer-events:auto;word-wrap:break-word;animation:hb-tooltip-fade-in .15s ease-out;line-height:1.4;max-width:300px;padding:6px 12px;position:fixed}.hb-tooltip__arrow{background-color:var(--hb-p-gray-800);height:8px;position:absolute;transform:rotate(45deg);width:8px}.hb-tooltip__content{position:relative;z-index:1}@keyframes hb-tooltip-fade-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}";
6
+ const tooltipCss = "/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{appearance:button;background-color:#0000;border:0 solid;border-radius:0;box-sizing:border-box;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;margin:0;margin-inline-end:4px;opacity:1;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);line-height:1.5;tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex;padding-block:0}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}} /*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{}@layer base{}@layer components;.hb-tooltip__trigger,:host{display:inline-block}.hb-tooltip__popup{background-color:var(--hb-p-gray-800);border-radius:var(--hb-border-radius-sm);box-shadow:var(--hb-box-shadow);color:#fff;font-size:var(--hb-font-size-sm);pointer-events:auto;word-wrap:break-word;animation:hb-tooltip-fade-in .15s ease-out;line-height:1.4;max-width:300px;padding:6px 12px;position:fixed}.hb-tooltip__arrow{background-color:var(--hb-p-gray-800);height:8px;position:absolute;transform:rotate(45deg);width:8px}.hb-tooltip__content{position:relative;z-index:1}@keyframes hb-tooltip-fade-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.hb-tooltip__popup--leaving{animation:hb-tooltip-fade-out .15s ease-in forwards}@keyframes hb-tooltip-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.95)}}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}";
6
7
  const HbTooltipStyle0 = tooltipCss;
7
8
 
8
9
  const Tooltip = class {
@@ -21,19 +22,25 @@ const Tooltip = class {
21
22
  /** 是否显示箭头 */
22
23
  showArrow = true;
23
24
  visible = false;
25
+ leaving = false;
24
26
  popupStyle = {};
25
27
  triggerRef;
26
28
  popupRef;
27
29
  hideTimer;
30
+ leave = createLeaveScheduler(() => this.leaving, v => (this.leaving = v), 150);
28
31
  show = () => {
29
32
  if (this.disabled)
30
33
  return;
31
34
  clearTimeout(this.hideTimer);
35
+ this.leave.cancel(); // 中途又打开:取消挂起的离场
32
36
  this.visible = true;
33
37
  requestAnimationFrame(() => this.updatePosition());
34
38
  };
35
39
  hide = () => {
36
- this.hideTimer = setTimeout(() => { this.visible = false; }, 100);
40
+ this.hideTimer = setTimeout(() => {
41
+ this.visible = false;
42
+ this.leave.start();
43
+ }, 100);
37
44
  };
38
45
  toggle = () => {
39
46
  if (this.disabled)
@@ -45,13 +52,18 @@ const Tooltip = class {
45
52
  this.show();
46
53
  }
47
54
  };
55
+ disconnectedCallback() {
56
+ // L6:清掉挂起的 hideTimer,避免卸载后 100ms 内触发 detached 实例
57
+ clearTimeout(this.hideTimer);
58
+ this.leave.dispose();
59
+ }
48
60
  /** 键盘:Esc 关闭;click 模式 Enter/Space 切换 */
49
61
  handleKeydown = (e) => {
50
- if (e.key === 'Escape' && this.visible) {
62
+ if (e.key === 'Escape' && (this.visible || this.leaving)) {
51
63
  e.preventDefault();
52
- // 立即关(不等延迟)
53
64
  clearTimeout(this.hideTimer);
54
65
  this.visible = false;
66
+ this.leave.start();
55
67
  return;
56
68
  }
57
69
  if (this.trigger === 'click' && isActivationKey(e.key)) {
@@ -71,13 +83,21 @@ const Tooltip = class {
71
83
  zIndex: String(getNextZIndex()),
72
84
  };
73
85
  }
86
+ get shouldRender() {
87
+ return this.visible || this.leaving;
88
+ }
74
89
  render() {
75
- const triggerEvents = this.trigger === 'hover'
76
- ? { onMouseEnter: this.show, onMouseLeave: this.hide }
77
- : { onClick: this.toggle };
78
- return (h("div", { key: 'a3a485a0fc8b99e61ef0c4fd30208ac6f42af2e2', class: "hb-tooltip", ...triggerEvents, onKeyDown: this.handleKeydown }, h("div", { key: '24e68cfd99dc409e5a1f3a396b506fc97827da5f', ref: (el) => { this.triggerRef = el; }, class: "hb-tooltip__trigger", tabindex: this.disabled ? -1 : 0, "aria-describedby": this.visible ? 'hb-tooltip__popup' : undefined,
90
+ const triggerEvents = this.trigger === 'hover' ? { onMouseEnter: this.show, onMouseLeave: this.hide } : { onClick: this.toggle };
91
+ return (h("div", { key: '27f941dba6404552eae2a84e231e5549d5542863', class: "hb-tooltip", ...triggerEvents, onKeyDown: this.handleKeydown }, h("div", { key: '3705c79e383098b8d44360d178de43e89612857e', ref: (el) => {
92
+ this.triggerRef = el;
93
+ }, class: "hb-tooltip__trigger", tabindex: this.disabled ? -1 : 0, "aria-describedby": this.shouldRender ? 'hb-tooltip__popup' : undefined,
79
94
  // hover 触发:focus 展开让键盘用户也能读到提示(对齐 antd 行为)
80
- onFocus: this.trigger === 'hover' ? this.show : undefined, onBlur: this.trigger === 'hover' ? this.hide : undefined }, h("slot", { key: 'd947c801efabae564e012cbe7a19c938e2ae2f7c' })), this.visible && (h("div", { key: 'e88b4aad5403c495b0484aff6a2fcb56c32efb4c', id: "hb-tooltip__popup", ref: (el) => { this.popupRef = el; }, class: "hb-tooltip__popup", style: this.popupStyle, role: "tooltip", onMouseEnter: () => this.trigger === 'hover' && this.show(), onMouseLeave: () => this.trigger === 'hover' && this.hide() }, this.showArrow && h("div", { key: 'b16d5c23542c60f2ad398eb055c33cc995af89f7', class: "hb-tooltip__arrow" }), h("div", { key: '600a64459740e735a5d7b9487debd1e8ca590ea3', class: "hb-tooltip__content" }, this.content)))));
95
+ onFocus: this.trigger === 'hover' ? this.show : undefined, onBlur: this.trigger === 'hover' ? this.hide : undefined }, h("slot", { key: 'ba8916663ed4866bd59747eab9c00300282df193' })), this.shouldRender && (h("div", { key: '8b6510eb948a19352c67fa7996d37e010e9c7b6b', id: "hb-tooltip__popup", ref: (el) => {
96
+ this.popupRef = el;
97
+ }, class: {
98
+ 'hb-tooltip__popup': true,
99
+ 'hb-tooltip__popup--leaving': this.leaving,
100
+ }, style: this.popupStyle, role: "tooltip", onMouseEnter: () => this.trigger === 'hover' && this.show(), onMouseLeave: () => this.trigger === 'hover' && this.hide() }, this.showArrow && h("div", { key: '6e26a2e2ce3e7d89c8c918c32aab375b12ac9351', class: "hb-tooltip__arrow" }), h("div", { key: '68b39d002a53094a34c8583137a74bd27edd4e23', class: "hb-tooltip__content" }, this.content)))));
81
101
  }
82
102
  };
83
103
  Tooltip.style = HbTooltipStyle0;
@@ -1 +1 @@
1
- {"file":"hb-tooltip.entry.js","mappings":";;;;AAAA,MAAM,UAAU,GAAG,qwMAAqwM,CAAC;AACzxM,wBAAe,UAAU;;MCkBZ,OAAO;;;;;;IAIV,OAAO,GAAW,EAAE,CAAC;;IAGrB,SAAS,GAAc,KAAK,CAAC;;IAG7B,OAAO,GAAsB,OAAO,CAAC;;IAGrC,QAAQ,GAAY,KAAK,CAAC;;IAG1B,SAAS,GAAY,IAAI,CAAC;IAEzB,OAAO,GAAY,KAAK,CAAC;IACzB,UAAU,GAA2B,EAAE,CAAC;IAEzC,UAAU,CAAe;IACzB,QAAQ,CAAkB;IAC1B,SAAS,CAAiC;IAE1C,IAAI,GAAG;QACb,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO;QAC1B,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,qBAAqB,CAAC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;KACpD,CAAC;IAEM,IAAI,GAAG;QACb,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,QAAQ,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;KACnE,CAAC;IAEM,MAAM,GAAG;QACf,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO;QAC1B,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,IAAI,CAAC,IAAI,EAAE,CAAC;SACb;aAAM;YACL,IAAI,CAAC,IAAI,EAAE,CAAC;SACb;KACF,CAAC;;IAGM,aAAa,GAAG,CAAC,CAAgB;QACvC,IAAI,CAAC,CAAC,GAAG,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GAAG,EAAE,CAAC,EAAO,OAAO,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC,EAAE,EAC3C,KAAK,EAAC,qBAAqB,EAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,sBACd,IAAI,CAAC,OAAO,GAAG,mBAAmB,GAAG,SAAS;;YAEhE,OAAO,EAAE,IAAI,CAAC,OAAO,KAAK,OAAO,GAAG,IAAI,CAAC,IAAI,GAAG,SAAS,EACzD,MAAM,EAAE,IAAI,CAAC,OAAO,KAAK,OAAO,GAAG,IAAI,CAAC,IAAI,GAAG,SAAS,IAExD,8DAAQ,CACJ,EACL,IAAI,CAAC,OAAO,KACX,4DACE,EAAE,EAAC,mBAAmB,EACtB,GAAG,EAAE,CAAC,EAAO,OAAO,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC,EAAE,EACzC,KAAK,EAAC,mBAAmB,EACzB,KAAK,EAAE,IAAI,CAAC,UAAU,EACtB,IAAI,EAAC,SAAS,EACd,YAAY,EAAE,MAAM,IAAI,CAAC,OAAO,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,EAC3D,YAAY,EAAE,MAAM,IAAI,CAAC,OAAO,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,IAE1D,IAAI,CAAC,SAAS,IAAI,4DAAK,KAAK,EAAC,mBAAmB,GAAG,EACpD,4DAAK,KAAK,EAAC,qBAAqB,IAAE,IAAI,CAAC,OAAO,CAAO,CACjD,CACP,CACG,EACN;KACH;;;;;;","names":[],"sources":["src/components/Tooltip/tooltip.css?tag=hb-tooltip&encapsulation=shadow","src/components/Tooltip/Tooltip.tsx"],"sourcesContent":[":host {\n display: inline-block;\n}\n\n.hb-tooltip__trigger {\n display: inline-block;\n}\n\n.hb-tooltip__popup {\n position: fixed;\n padding: 6px 12px;\n border-radius: var(--hb-border-radius-sm);\n background-color: var(--hb-p-gray-800);\n color: #fff;\n font-size: var(--hb-font-size-sm);\n line-height: 1.4;\n pointer-events: auto;\n box-shadow: var(--hb-box-shadow);\n animation: hb-tooltip-fade-in 0.15s ease-out;\n max-width: 300px;\n word-wrap: break-word;\n}\n\n.hb-tooltip__arrow {\n position: absolute;\n width: 8px;\n height: 8px;\n background-color: var(--hb-p-gray-800);\n transform: rotate(45deg);\n}\n\n.hb-tooltip__content {\n position: relative;\n z-index: 1;\n}\n\n@keyframes hb-tooltip-fade-in {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n}\n","import { Component, h, Prop, State, Element } from '@stencil/core';\nimport { computePosition, getNextZIndex, Placement } from '../../utils/popup-manager';\nimport { isActivationKey } from '../../utils/a11y';\n\n/**\n * Tooltip 文字提示组件\n * 鼠标悬停或点击时显示提示文字。\n *\n * 无障碍(对齐 antd / WAI-ARIA):\n * - 触发器 aria-describedby 关联浮层 id(屏幕阅读器读出 content)\n * - 浮层 role=tooltip\n * - hover 触发时:focus 也显示(键盘用户可见,关键修复)\n * - click 触发时:Enter/Space 切换;任意模式 Esc 关闭\n */\n@Component({\n tag: 'hb-tooltip',\n styleUrl: 'tooltip.css',\n shadow: true,\n})\nexport class Tooltip {\n @Element() el: HTMLElement;\n\n /** 提示文字 */\n @Prop() content: string = '';\n\n /** 弹出位置 */\n @Prop() placement: Placement = 'top';\n\n /** 触发方式 */\n @Prop() trigger: 'hover' | 'click' = 'hover';\n\n /** 是否禁用 */\n @Prop() disabled: boolean = false;\n\n /** 是否显示箭头 */\n @Prop() showArrow: boolean = true;\n\n @State() visible: boolean = false;\n @State() popupStyle: Record<string, string> = {};\n\n private triggerRef?: HTMLElement;\n private popupRef?: HTMLDivElement;\n private hideTimer?: ReturnType<typeof setTimeout>;\n\n private show = () => {\n if (this.disabled) return;\n clearTimeout(this.hideTimer);\n this.visible = true;\n requestAnimationFrame(() => this.updatePosition());\n };\n\n private hide = () => {\n this.hideTimer = setTimeout(() => { this.visible = false; }, 100);\n };\n\n private toggle = () => {\n if (this.disabled) return;\n if (this.visible) {\n this.hide();\n } else {\n this.show();\n }\n };\n\n /** 键盘:Esc 关闭;click 模式 Enter/Space 切换 */\n private handleKeydown = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && this.visible) {\n e.preventDefault();\n // 立即关(不等延迟)\n clearTimeout(this.hideTimer);\n this.visible = false;\n return;\n }\n if (this.trigger === 'click' && isActivationKey(e.key)) {\n e.preventDefault();\n this.toggle();\n }\n };\n\n private updatePosition() {\n if (!this.triggerRef || !this.popupRef) return;\n const triggerRect = this.triggerRef.getBoundingClientRect();\n const { width, height } = this.popupRef.getBoundingClientRect();\n const pos = computePosition(triggerRect, width, height, this.placement, 8);\n this.popupStyle = {\n top: `${pos.top}px`,\n left: `${pos.left}px`,\n zIndex: String(getNextZIndex()),\n };\n }\n\n render() {\n const triggerEvents = this.trigger === 'hover'\n ? { onMouseEnter: this.show, onMouseLeave: this.hide }\n : { onClick: this.toggle };\n\n return (\n <div class=\"hb-tooltip\" {...triggerEvents} onKeyDown={this.handleKeydown}>\n <div\n ref={(el: any) => { this.triggerRef = el; }}\n class=\"hb-tooltip__trigger\"\n tabindex={this.disabled ? -1 : 0}\n aria-describedby={this.visible ? 'hb-tooltip__popup' : undefined}\n // hover 触发:focus 展开让键盘用户也能读到提示(对齐 antd 行为)\n onFocus={this.trigger === 'hover' ? this.show : undefined}\n onBlur={this.trigger === 'hover' ? this.hide : undefined}\n >\n <slot />\n </div>\n {this.visible && (\n <div\n id=\"hb-tooltip__popup\"\n ref={(el: any) => { this.popupRef = el; }}\n class=\"hb-tooltip__popup\"\n style={this.popupStyle}\n role=\"tooltip\"\n onMouseEnter={() => this.trigger === 'hover' && this.show()}\n onMouseLeave={() => this.trigger === 'hover' && this.hide()}\n >\n {this.showArrow && <div class=\"hb-tooltip__arrow\" />}\n <div class=\"hb-tooltip__content\">{this.content}</div>\n </div>\n )}\n </div>\n );\n }\n}\n"],"version":3}
1
+ {"file":"hb-tooltip.entry.js","mappings":";;;;;AAAA,MAAM,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AK,EAAC,qBAAqB,IAAE,IAAI,CAAC,OAAO,CAAO,CACjD,CACP,CACG,EACN;KACH;;;;;;","names":[],"sources":["src/components/Tooltip/tooltip.css?tag=hb-tooltip&encapsulation=shadow","src/components/Tooltip/Tooltip.tsx"],"sourcesContent":[":host {\n display: inline-block;\n}\n\n.hb-tooltip__trigger {\n display: inline-block;\n}\n\n.hb-tooltip__popup {\n position: fixed;\n padding: 6px 12px;\n border-radius: var(--hb-border-radius-sm);\n background-color: var(--hb-p-gray-800);\n color: #fff;\n font-size: var(--hb-font-size-sm);\n line-height: 1.4;\n pointer-events: auto;\n box-shadow: var(--hb-box-shadow);\n animation: hb-tooltip-fade-in 0.15s ease-out;\n max-width: 300px;\n word-wrap: break-word;\n}\n\n.hb-tooltip__arrow {\n position: absolute;\n width: 8px;\n height: 8px;\n background-color: var(--hb-p-gray-800);\n transform: rotate(45deg);\n}\n\n.hb-tooltip__content {\n position: relative;\n z-index: 1;\n}\n\n@keyframes hb-tooltip-fade-in {\n from {\n opacity: 0;\n transform: scale(0.95);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n\n/* 离场动画:leaving class 触发 fade-out,播完后由 shouldRender=false 卸载 */\n.hb-tooltip__popup--leaving {\n animation: hb-tooltip-fade-out 0.15s ease-in forwards;\n}\n\n@keyframes hb-tooltip-fade-out {\n from {\n opacity: 1;\n transform: scale(1);\n }\n to {\n opacity: 0;\n transform: scale(0.95);\n }\n}\n","import { Component, h, Prop, State, Element } from '@stencil/core';\nimport { computePosition, getNextZIndex, Placement } from '../../utils/popup-manager';\nimport { isActivationKey } from '../../utils/a11y';\nimport { createLeaveScheduler } from '../../utils/transition';\n\n/**\n * Tooltip 文字提示组件\n * 鼠标悬停或点击时显示提示文字。\n *\n * 无障碍(对齐 antd / WAI-ARIA):\n * - 触发器 aria-describedby 关联浮层 id(屏幕阅读器读出 content)\n * - 浮层 role=tooltip\n * - hover 触发时:focus 也显示(键盘用户可见,关键修复)\n * - click 触发时:Enter/Space 切换;任意模式 Esc 关闭\n *\n * 进出场动画:用 leaving state 延迟卸载,让 fade-out 有机会播放。\n */\n@Component({\n tag: 'hb-tooltip',\n styleUrl: 'tooltip.css',\n shadow: true,\n})\nexport class Tooltip {\n @Element() el: HTMLElement;\n\n /** 提示文字 */\n @Prop() content: string = '';\n\n /** 弹出位置 */\n @Prop() placement: Placement = 'top';\n\n /** 触发方式 */\n @Prop() trigger: 'hover' | 'click' = 'hover';\n\n /** 是否禁用 */\n @Prop() disabled: boolean = false;\n\n /** 是否显示箭头 */\n @Prop() showArrow: boolean = true;\n\n @State() visible: boolean = false;\n @State() leaving: boolean = false;\n @State() popupStyle: Record<string, string> = {};\n\n private triggerRef?: HTMLElement;\n private popupRef?: HTMLDivElement;\n private hideTimer?: ReturnType<typeof setTimeout>;\n private leave = createLeaveScheduler(\n () => this.leaving,\n v => (this.leaving = v),\n 150,\n );\n\n private show = () => {\n if (this.disabled) return;\n clearTimeout(this.hideTimer);\n this.leave.cancel(); // 中途又打开:取消挂起的离场\n this.visible = true;\n requestAnimationFrame(() => this.updatePosition());\n };\n\n private hide = () => {\n this.hideTimer = setTimeout(() => {\n this.visible = false;\n this.leave.start();\n }, 100);\n };\n\n private toggle = () => {\n if (this.disabled) return;\n if (this.visible) {\n this.hide();\n } else {\n this.show();\n }\n };\n\n disconnectedCallback() {\n // L6:清掉挂起的 hideTimer,避免卸载后 100ms 内触发 detached 实例\n clearTimeout(this.hideTimer);\n this.leave.dispose();\n }\n\n /** 键盘:Esc 关闭;click 模式 Enter/Space 切换 */\n private handleKeydown = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && (this.visible || this.leaving)) {\n e.preventDefault();\n clearTimeout(this.hideTimer);\n this.visible = false;\n this.leave.start();\n return;\n }\n if (this.trigger === 'click' && isActivationKey(e.key)) {\n e.preventDefault();\n this.toggle();\n }\n };\n\n private updatePosition() {\n if (!this.triggerRef || !this.popupRef) return;\n const triggerRect = this.triggerRef.getBoundingClientRect();\n const { width, height } = this.popupRef.getBoundingClientRect();\n const pos = computePosition(triggerRect, width, height, this.placement, 8);\n this.popupStyle = {\n top: `${pos.top}px`,\n left: `${pos.left}px`,\n zIndex: String(getNextZIndex()),\n };\n }\n\n private get shouldRender(): boolean {\n return this.visible || this.leaving;\n }\n\n render() {\n const triggerEvents = this.trigger === 'hover' ? { onMouseEnter: this.show, onMouseLeave: this.hide } : { onClick: this.toggle };\n\n return (\n <div class=\"hb-tooltip\" {...triggerEvents} onKeyDown={this.handleKeydown}>\n <div\n ref={(el: any) => {\n this.triggerRef = el;\n }}\n class=\"hb-tooltip__trigger\"\n tabindex={this.disabled ? -1 : 0}\n aria-describedby={this.shouldRender ? 'hb-tooltip__popup' : undefined}\n // hover 触发:focus 展开让键盘用户也能读到提示(对齐 antd 行为)\n onFocus={this.trigger === 'hover' ? this.show : undefined}\n onBlur={this.trigger === 'hover' ? this.hide : undefined}\n >\n <slot />\n </div>\n {this.shouldRender && (\n <div\n id=\"hb-tooltip__popup\"\n ref={(el: any) => {\n this.popupRef = el;\n }}\n class={{\n 'hb-tooltip__popup': true,\n 'hb-tooltip__popup--leaving': this.leaving,\n }}\n style={this.popupStyle}\n role=\"tooltip\"\n onMouseEnter={() => this.trigger === 'hover' && this.show()}\n onMouseLeave={() => this.trigger === 'hover' && this.hide()}\n >\n {this.showArrow && <div class=\"hb-tooltip__arrow\" />}\n <div class=\"hb-tooltip__content\">{this.content}</div>\n </div>\n )}\n </div>\n );\n }\n}\n"],"version":3}
@@ -1,5 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, g as getElement, h } from './index-fdf7135e.js';
2
2
  import { c as createClickOutsideHandler } from './click-outside-291294f9.js';
3
+ import { a as activationClickHandler } from './a11y-e4cde5b0.js';
3
4
 
4
5
  const treeSelectCss = "/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{appearance:button;background-color:#0000;border:0 solid;border-radius:0;box-sizing:border-box;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;margin:0;margin-inline-end:4px;opacity:1;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);line-height:1.5;tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex;padding-block:0}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}} /*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{}@layer base{}@layer components;:host{display:block}.hb-tree-select{box-sizing:border-box;color:var(--hb-color-text);font-size:var(--hb-font-size-base);position:relative;width:100%}.hb-tree-select__input-wrapper{align-items:center;background-color:var(--hb-color-bg-container);border:1px solid var(--hb-input-border-color,var(--hb-color-border));border-radius:var(--hb-input-radius,var(--hb-border-radius-sm));box-sizing:border-box;cursor:pointer;display:flex;height:var(--hb-size-default,32px);padding:0 var(--hb-spacing-sm);transition:border-color var(--hb-transition-duration,.2s)}.hb-tree-select__input-wrapper:hover{border-color:var(--hb-input-hover-border-color,var(--hb-color-primary))}.hb-tree-select--open .hb-tree-select__input-wrapper{border-color:var(--hb-input-focus-border-color,var(--hb-color-primary))}.hb-tree-select--disabled .hb-tree-select__input-wrapper{background-color:var(--hb-color-fill-tertiary);cursor:not-allowed;opacity:.6}.hb-tree-select__display{flex:1;overflow:hidden;text-overflow:ellipsis;-webkit-user-select:none;user-select:none;white-space:nowrap}.hb-tree-select__display--placeholder{color:var(--hb-input-placeholder-color,var(--hb-color-text-placeholder))}.hb-tree-select__suffix{gap:var(--hb-spacing-xxs)}.hb-tree-select__clear,.hb-tree-select__suffix{align-items:center;color:var(--hb-color-text-tertiary);display:inline-flex}.hb-tree-select__clear{background-color:var(--hb-color-fill);border-radius:50%;cursor:pointer;height:16px;justify-content:center;width:16px}.hb-tree-select__clear svg{height:10px;width:10px}.hb-tree-select__clear:hover{color:var(--hb-color-text-secondary)}.hb-tree-select__arrow-icon{align-items:center;color:var(--hb-color-text-tertiary);display:inline-flex;height:12px;transition:transform var(--hb-transition-duration,.2s);width:12px}.hb-tree-select__arrow-icon svg{height:100%;width:100%}.hb-tree-select__arrow-icon--open{transform:rotate(180deg)}.hb-tree-select__dropdown{background-color:var(--hb-color-bg-elevated);border:1px solid var(--hb-color-border-secondary);border-radius:var(--hb-border-radius-sm);box-shadow:0 6px 16px #00000014;box-sizing:border-box;left:0;max-height:280px;overflow-y:auto;padding:var(--hb-spacing-xxs);position:absolute;top:calc(100% + 4px);width:100%;z-index:1050}.hb-tree-select__empty{color:var(--hb-color-text-tertiary);font-size:var(--hb-font-size-sm);padding:var(--hb-spacing-md);text-align:center}.hb-tree-select__children,.hb-tree-select__tree{list-style:none;margin:0;padding:0}.hb-tree-select__node{list-style:none;white-space:nowrap}.hb-tree-select__node-content{align-items:center;border-radius:var(--hb-border-radius-sm);box-sizing:border-box;cursor:pointer;display:flex;gap:var(--hb-spacing-xxs);height:28px;padding-right:var(--hb-spacing-xs);transition:background-color var(--hb-transition-duration,.2s)}.hb-tree-select__node-content:hover{background-color:var(--hb-color-fill-tertiary)}.hb-tree-select__node-content--selected{color:var(--hb-color-primary);font-weight:500}.hb-tree-select__node-content--checked,.hb-tree-select__node-content--selected{background-color:var(--hb-color-primary-bg)}.hb-tree-select__node--disabled>.hb-tree-select__node-content{cursor:not-allowed;opacity:.5}.hb-tree-select__node--disabled>.hb-tree-select__node-content:hover{background-color:#0000}.hb-tree-select__switcher{flex-shrink:0;height:18px;width:18px}.hb-tree-select__arrow,.hb-tree-select__switcher{align-items:center;color:var(--hb-color-text-tertiary);display:inline-flex;justify-content:center}.hb-tree-select__arrow{height:12px;transition:transform var(--hb-transition-duration,.2s);width:12px}.hb-tree-select__arrow svg{height:100%;width:100%}.hb-tree-select__arrow--expanded{transform:rotate(90deg)}.hb-tree-select__checkbox{align-items:center;background-color:var(--hb-color-bg-container);border:1px solid var(--hb-color-border);border-radius:var(--hb-border-radius-xs,2px);color:#fff;display:inline-flex;flex-shrink:0;height:16px;justify-content:center;transition:all var(--hb-transition-duration,.2s);width:16px}.hb-tree-select__checkbox svg{height:12px;width:12px}.hb-tree-select__checkbox-dash{background-color:#fff;border-radius:1px;display:block;height:2px;width:10px}.hb-tree-select__checkbox:hover:not(.hb-tree-select__checkbox--disabled){border-color:var(--hb-color-primary)}.hb-tree-select__checkbox--checked,.hb-tree-select__checkbox--indeterminate{background-color:var(--hb-color-primary);border-color:var(--hb-color-primary)}.hb-tree-select__checkbox--disabled{cursor:not-allowed}.hb-tree-select__title{flex:1;overflow:hidden;text-overflow:ellipsis;-webkit-user-select:none;user-select:none}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}";
5
6
  const HbTreeSelectStyle0 = treeSelectCss;
@@ -48,6 +49,8 @@ const TreeSelect = class {
48
49
  internalExpanded = [];
49
50
  internalSelected = [];
50
51
  internalChecked = [];
52
+ /** 键盘焦点节点 key(A2:roving tabindex,与选中态解耦) */
53
+ focusKey = null;
51
54
  /**
52
55
  * 值变化事件(单选为 string,多选为 string[])
53
56
  */
@@ -69,6 +72,13 @@ const TreeSelect = class {
69
72
  this.internalExpanded = all;
70
73
  }
71
74
  }
75
+ /**
76
+ * 受控同步:父组件后续修改 modelValue 时,重算 internalSelected/internalChecked。
77
+ * 修复 B4——修复前仅 componentWillLoad 同步一次,受控改值后选中/勾选状态不更新。
78
+ */
79
+ handleModelValueChange() {
80
+ this.syncFromModelValue();
81
+ }
72
82
  componentDidLoad() {
73
83
  this.clickOutside = createClickOutsideHandler({
74
84
  host: this.el,
@@ -92,6 +102,106 @@ const TreeSelect = class {
92
102
  this.internalChecked = single ? [single] : [];
93
103
  }
94
104
  }
105
+ /**
106
+ * 构建当前可见节点的扁平列表(仅含已展开父节点的后代),用于键盘线性导航(A2)。
107
+ */
108
+ getFlattenedVisibleNodes() {
109
+ const out = [];
110
+ const walk = (nodes, level, parentKey) => {
111
+ for (const node of nodes) {
112
+ out.push({ node, level, parentKey });
113
+ if (node.children && node.children.length > 0 && this.internalExpanded.includes(node.key)) {
114
+ walk(node.children, level + 1, node.key);
115
+ }
116
+ }
117
+ };
118
+ walk(this.data, 0, null);
119
+ return out;
120
+ }
121
+ /**
122
+ * Tree 键盘导航(WAI-ARIA Tree View 模式,A2 修复):
123
+ * ↑↓ 线性移动、→ 展开/进子、← 折叠/回父、Enter/Space 选中、Home/End 跳首尾。
124
+ * 焦点(focusKey)与选中态(internalSelected/internalChecked)解耦。
125
+ */
126
+ handleTreeKeydown = (e) => {
127
+ const flat = this.getFlattenedVisibleNodes();
128
+ if (flat.length === 0)
129
+ return;
130
+ let focusKey = this.focusKey;
131
+ if (!focusKey && this.internalSelected.length > 0)
132
+ focusKey = this.internalSelected[this.internalSelected.length - 1];
133
+ let focusIdx = focusKey ? flat.findIndex(x => x.node.key === focusKey) : -1;
134
+ if (focusIdx < 0 || flat[focusIdx].node.disabled) {
135
+ focusIdx = flat.findIndex(x => !x.node.disabled);
136
+ if (focusIdx < 0)
137
+ return;
138
+ }
139
+ const enabledFlatIndices = flat
140
+ .map((x, i) => ({ x, i }))
141
+ .filter(o => !o.x.node.disabled)
142
+ .map(o => o.i);
143
+ const posInEnabled = enabledFlatIndices.indexOf(focusIdx);
144
+ const current = flat[focusIdx];
145
+ const isLeaf = !(current.node.children && current.node.children.length > 0);
146
+ const expanded = !isLeaf && this.internalExpanded.includes(current.node.key);
147
+ switch (e.key) {
148
+ case 'ArrowDown': {
149
+ e.preventDefault();
150
+ this.focusKey = flat[enabledFlatIndices[(posInEnabled + 1) % enabledFlatIndices.length]].node.key;
151
+ break;
152
+ }
153
+ case 'ArrowUp': {
154
+ e.preventDefault();
155
+ const n = enabledFlatIndices.length;
156
+ this.focusKey = flat[enabledFlatIndices[(posInEnabled - 1 + n) % n]].node.key;
157
+ break;
158
+ }
159
+ case 'ArrowRight': {
160
+ e.preventDefault();
161
+ if (isLeaf)
162
+ return;
163
+ if (!expanded) {
164
+ this.handleToggleExpand(current.node, { stopPropagation: () => { } });
165
+ }
166
+ else {
167
+ const firstChildIdx = flat.findIndex((x, i) => i > focusIdx && x.parentKey === current.node.key && !x.node.disabled);
168
+ if (firstChildIdx >= 0)
169
+ this.focusKey = flat[firstChildIdx].node.key;
170
+ }
171
+ break;
172
+ }
173
+ case 'ArrowLeft': {
174
+ e.preventDefault();
175
+ if (!isLeaf && expanded) {
176
+ this.handleToggleExpand(current.node, { stopPropagation: () => { } });
177
+ }
178
+ else if (current.parentKey && !flat.find(x => x.node.key === current.parentKey).node.disabled) {
179
+ this.focusKey = current.parentKey;
180
+ }
181
+ break;
182
+ }
183
+ case 'Home':
184
+ e.preventDefault();
185
+ this.focusKey = flat[enabledFlatIndices[0]].node.key;
186
+ break;
187
+ case 'End':
188
+ e.preventDefault();
189
+ this.focusKey = flat[enabledFlatIndices[enabledFlatIndices.length - 1]].node.key;
190
+ break;
191
+ case 'Enter':
192
+ case ' ':
193
+ case 'Spacebar': {
194
+ e.preventDefault();
195
+ if (this.checkable)
196
+ this.handleNodeCheck(current.node);
197
+ else
198
+ this.handleNodeSelect(current.node.key);
199
+ break;
200
+ }
201
+ default:
202
+ return;
203
+ }
204
+ };
95
205
  collectExpandableKeys(nodes, out) {
96
206
  for (const node of nodes) {
97
207
  if (node.children && node.children.length > 0) {
@@ -117,7 +227,7 @@ const TreeSelect = class {
117
227
  const arr = Array.isArray(this.modelValue) ? this.modelValue : [];
118
228
  if (arr.length === 0)
119
229
  return '';
120
- const titles = arr.map((k) => this.findTitle(this.data, k) || k);
230
+ const titles = arr.map(k => this.findTitle(this.data, k) || k);
121
231
  return titles.join(' / ');
122
232
  }
123
233
  const single = typeof this.modelValue === 'string' ? this.modelValue : '';
@@ -274,33 +384,38 @@ const TreeSelect = class {
274
384
  const checked = this.internalChecked.includes(node.key);
275
385
  const indeterminate = indeterminateKeys.has(node.key);
276
386
  const disabled = !!node.disabled;
277
- return (h("li", { class: { 'hb-tree-select__node': true, 'hb-tree-select__node--disabled': disabled }, role: "treeitem" }, h("div", { class: {
387
+ // A2:roving tabindex 跟随 focusKey;无键盘焦点时回退到选中项
388
+ const fallbackFocus = this.internalSelected.length > 0 ? this.internalSelected[this.internalSelected.length - 1] : null;
389
+ const effectiveFocus = this.focusKey ?? fallbackFocus;
390
+ const isFocused = effectiveFocus === node.key;
391
+ return (h("li", { class: { 'hb-tree-select__node': true, 'hb-tree-select__node--disabled': disabled }, "data-tree-key": node.key, role: "treeitem", "aria-level": level + 1, "aria-expanded": hasChildren ? String(expanded) : undefined, "aria-selected": selected ? 'true' : 'false', "aria-disabled": disabled ? 'true' : undefined, tabindex: isFocused ? 0 : -1 }, h("div", { class: {
278
392
  'hb-tree-select__node-content': true,
279
393
  'hb-tree-select__node-content--selected': selected,
280
394
  'hb-tree-select__node-content--checked': checked,
281
- }, style: { paddingLeft: `${level * 18 + 8}px` } }, h("span", { class: "hb-tree-select__switcher", onClick: (e) => hasChildren && this.handleToggleExpand(node, e) }, hasChildren ? (h("span", { class: { 'hb-tree-select__arrow': true, 'hb-tree-select__arrow--expanded': expanded }, "aria-hidden": "true" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": 2, "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M9 6l6 6-6 6" })))) : null), this.checkable && (h("span", { class: {
395
+ }, style: { paddingLeft: `${level * 18 + 8}px` } }, h("span", { class: "hb-tree-select__switcher", onClick: e => hasChildren && this.handleToggleExpand(node, e) }, hasChildren ? (h("span", { class: { 'hb-tree-select__arrow': true, 'hb-tree-select__arrow--expanded': expanded }, "aria-hidden": "true" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": 2, "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M9 6l6 6-6 6" })))) : null), this.checkable && (h("span", { class: {
282
396
  'hb-tree-select__checkbox': true,
283
397
  'hb-tree-select__checkbox--checked': checked,
284
398
  'hb-tree-select__checkbox--indeterminate': indeterminate,
285
399
  'hb-tree-select__checkbox--disabled': disabled,
286
- }, role: "checkbox", "aria-checked": indeterminate ? 'mixed' : checked ? 'true' : 'false', onClick: () => !disabled && this.handleNodeCheck(node) }, checked ? (h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": 3, "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M5 12l5 5L20 7" }))) : indeterminate ? (h("span", { class: "hb-tree-select__checkbox-dash" })) : null)), h("span", { class: "hb-tree-select__title", onClick: () => !disabled && this.handleNodeSelect(node.key) }, node.title)), hasChildren && expanded && (h("ul", { class: "hb-tree-select__children", role: "group" }, node.children.map((child) => this.renderNode(child, level + 1, indeterminateKeys))))));
400
+ }, role: "checkbox", "aria-checked": indeterminate ? 'mixed' : checked ? 'true' : 'false', onClick: () => !disabled && this.handleNodeCheck(node) }, checked ? (h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": 3, "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M5 12l5 5L20 7" }))) : indeterminate ? (h("span", { class: "hb-tree-select__checkbox-dash" })) : null)), h("span", { class: "hb-tree-select__title", onClick: () => !disabled && this.handleNodeSelect(node.key) }, node.title)), hasChildren && expanded && (h("ul", { class: "hb-tree-select__children", role: "group" }, node.children.map(child => this.renderNode(child, level + 1, indeterminateKeys))))));
287
401
  };
288
402
  render() {
289
403
  const displayText = this.getDisplayText();
290
- const hasValue = this.multiple
291
- ? Array.isArray(this.modelValue) && this.modelValue.length > 0
292
- : typeof this.modelValue === 'string' && this.modelValue !== '';
404
+ const hasValue = this.multiple ? Array.isArray(this.modelValue) && this.modelValue.length > 0 : typeof this.modelValue === 'string' && this.modelValue !== '';
293
405
  const indeterminateKeys = this.checkable ? this.computeIndeterminateKeys() : new Set();
294
- return (h("div", { key: 'f79d67b1bb02e0d51a9fe2b35a36a156801e9584', class: {
406
+ return (h("div", { key: '46d75f2c1014766b178e35a6f1684ea311f080df', class: {
295
407
  'hb-tree-select': true,
296
408
  'hb-tree-select--open': this.isOpen,
297
409
  'hb-tree-select--disabled': this.disabled,
298
410
  'hb-tree-select--multiple': this.multiple,
299
- } }, h("div", { key: '59355a67c4316c98a682df3c27cd19387a8d4742', class: "hb-tree-select__input-wrapper", onClick: this.toggleDropdown }, h("span", { key: '7b4fd7b9a4c15193f687f1f579eb2e8268b975df', class: {
411
+ } }, h("div", { key: '9921be6e6ce72570f8b3b9fcd5921219ec8c77e7', class: "hb-tree-select__input-wrapper", onClick: this.toggleDropdown }, h("span", { key: '503b5691f216ae8bba1bff142ad0c0d62a28c19c', class: {
300
412
  'hb-tree-select__display': true,
301
413
  'hb-tree-select__display--placeholder': !hasValue,
302
- } }, hasValue ? displayText : this.placeholder), h("span", { key: '1640eacb50af399e02785b14d72c547afe8fcfcf', class: "hb-tree-select__suffix" }, hasValue && (h("span", { key: 'c16d5a458d3738bccb3c70cc985df43dcacb4220', class: "hb-tree-select__clear", onClick: this.handleClear, role: "button", "aria-label": "\u6E05\u7A7A" }, h("svg", { key: '757db41a4651d25df357d2c975810bbfdddcca22', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": 2, "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { key: 'a72adce81b2900cdf11faa663f92dbaa7053921e', d: "M6 6l12 12M18 6L6 18" })))), h("span", { key: '0b40c484fe2f7e23b04cfb26cb0018f050522fec', class: { 'hb-tree-select__arrow-icon': true, 'hb-tree-select__arrow-icon--open': this.isOpen }, "aria-hidden": "true" }, h("svg", { key: '30523c9183feaab984ff557e8c735b7a04423f0c', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": 2, "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { key: '15eae62246639d6e05071123e89ad31c82ea576a', d: "M6 9l6 6 6-6" }))))), this.isOpen && (h("div", { key: 'e6eb7b145fe8b71b09511e8e0c3a3a9073508397', class: "hb-tree-select__dropdown" }, this.data.length === 0 ? (h("div", { class: "hb-tree-select__empty" }, "\u6682\u65E0\u6570\u636E")) : (h("ul", { class: "hb-tree-select__tree", role: "tree" }, this.data.map((node) => this.renderNode(node, 0, indeterminateKeys))))))));
414
+ } }, hasValue ? displayText : this.placeholder), h("span", { key: 'dd879d7ab4bc3cdff8fda6e5555e445fd2353b08', class: "hb-tree-select__suffix" }, hasValue && (h("span", { key: '7891ba744427d27eebdf077eca94555e6252b79d', class: "hb-tree-select__clear", onClick: this.handleClear, role: "button", "aria-label": "\u6E05\u7A7A", tabIndex: 0, onKeyDown: activationClickHandler }, h("svg", { key: '39de157416b682136d7fd17f034af52467812086', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": 2, "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { key: '06556664f1fdd4f2e497abb4ffd3fe4b478ee2db', d: "M6 6l12 12M18 6L6 18" })))), h("span", { key: '2f3ad915c327519223f73fed8e4fe51b291a2647', class: { 'hb-tree-select__arrow-icon': true, 'hb-tree-select__arrow-icon--open': this.isOpen }, "aria-hidden": "true" }, h("svg", { key: 'bed9693364d571477d6540250e3c93a4bfcea2cd', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": 2, "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { key: '830a03a1f977a0a577e03728c471dd8d2cd85c6d', d: "M6 9l6 6 6-6" }))))), this.isOpen && (h("div", { key: '25754f9eeaea710c0f7facc4d57213db0e0755d3', class: "hb-tree-select__dropdown" }, this.data.length === 0 ? (h("div", { class: "hb-tree-select__empty" }, "\u6682\u65E0\u6570\u636E")) : (h("ul", { class: "hb-tree-select__tree", role: "tree", tabindex: -1, onKeyDown: this.handleTreeKeydown }, this.data.map(node => this.renderNode(node, 0, indeterminateKeys))))))));
303
415
  }
416
+ static get watchers() { return {
417
+ "modelValue": ["handleModelValueChange"]
418
+ }; }
304
419
  };
305
420
  TreeSelect.style = HbTreeSelectStyle0;
306
421