huibo-ui 0.3.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 (839) 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-904747ff.js → date-helpers-c05ef385.js} +10 -17
  4. package/dist/cjs/date-helpers-c05ef385.js.map +1 -0
  5. package/dist/cjs/hb-affix.cjs.entry.js +1 -1
  6. package/dist/cjs/hb-alert.cjs.entry.js +2 -1
  7. package/dist/cjs/hb-alert.cjs.entry.js.map +1 -1
  8. package/dist/cjs/hb-aside.cjs.entry.js +1 -1
  9. package/dist/cjs/hb-avatar.cjs.entry.js +1 -1
  10. package/dist/cjs/hb-backtop.cjs.entry.js +2 -2
  11. package/dist/cjs/hb-badge.cjs.entry.js +1 -1
  12. package/dist/cjs/hb-breadcrumb-item.cjs.entry.js +1 -1
  13. package/dist/cjs/hb-breadcrumb.cjs.entry.js +1 -1
  14. package/dist/cjs/hb-button.cjs.entry.js +2 -2
  15. package/dist/cjs/hb-calendar.cjs.entry.js +78 -10
  16. package/dist/cjs/hb-calendar.cjs.entry.js.map +1 -1
  17. package/dist/cjs/hb-card.cjs.entry.js +1 -1
  18. package/dist/cjs/hb-cascader.cjs.entry.js +306 -146
  19. package/dist/cjs/hb-cascader.cjs.entry.js.map +1 -1
  20. package/dist/cjs/hb-checkbox-group.cjs.entry.js +12 -8
  21. package/dist/cjs/hb-checkbox-group.cjs.entry.js.map +1 -1
  22. package/dist/cjs/hb-checkbox.cjs.entry.js +9 -4
  23. package/dist/cjs/hb-checkbox.cjs.entry.js.map +1 -1
  24. package/dist/cjs/hb-collapse-item.cjs.entry.js +13 -4
  25. package/dist/cjs/hb-collapse-item.cjs.entry.js.map +1 -1
  26. package/dist/cjs/hb-collapse.cjs.entry.js +20 -15
  27. package/dist/cjs/hb-collapse.cjs.entry.js.map +1 -1
  28. package/dist/cjs/hb-color-picker-panel.cjs.entry.js +2 -2
  29. package/dist/cjs/hb-color-picker.cjs.entry.js +108 -28
  30. package/dist/cjs/hb-color-picker.cjs.entry.js.map +1 -1
  31. package/dist/cjs/hb-config-provider.cjs.entry.js +1 -1
  32. package/dist/cjs/hb-container.cjs.entry.js +2 -2
  33. package/dist/cjs/hb-date-picker-pane.cjs.entry.js +2 -2
  34. package/dist/cjs/hb-date-picker.cjs.entry.js +90 -9
  35. package/dist/cjs/hb-date-picker.cjs.entry.js.map +1 -1
  36. package/dist/cjs/hb-date-range-picker.cjs.entry.js +3 -3
  37. package/dist/cjs/hb-date-time-picker.cjs.entry.js +3 -3
  38. package/dist/cjs/hb-descriptions.cjs.entry.js +2 -2
  39. package/dist/cjs/hb-descriptions.cjs.entry.js.map +1 -1
  40. package/dist/cjs/hb-dialog.cjs.entry.js +51 -12
  41. package/dist/cjs/hb-dialog.cjs.entry.js.map +1 -1
  42. package/dist/cjs/hb-divider.cjs.entry.js +2 -2
  43. package/dist/cjs/hb-drawer.cjs.entry.js +34 -4
  44. package/dist/cjs/hb-drawer.cjs.entry.js.map +1 -1
  45. package/dist/cjs/hb-dropdown.cjs.entry.js +91 -11
  46. package/dist/cjs/hb-dropdown.cjs.entry.js.map +1 -1
  47. package/dist/cjs/hb-empty.cjs.entry.js +1 -1
  48. package/dist/cjs/hb-float-button.cjs.entry.js +2 -2
  49. package/dist/cjs/hb-footer.cjs.entry.js +1 -1
  50. package/dist/cjs/hb-form-item.cjs.entry.js +61 -9
  51. package/dist/cjs/hb-form-item.cjs.entry.js.map +1 -1
  52. package/dist/cjs/hb-form.cjs.entry.js +13 -8
  53. package/dist/cjs/hb-form.cjs.entry.js.map +1 -1
  54. package/dist/cjs/hb-header.cjs.entry.js +1 -1
  55. package/dist/cjs/hb-image-preview.cjs.entry.js +13 -9
  56. package/dist/cjs/hb-image-preview.cjs.entry.js.map +1 -1
  57. package/dist/cjs/hb-image.cjs.entry.js +21 -3
  58. package/dist/cjs/hb-image.cjs.entry.js.map +1 -1
  59. package/dist/cjs/hb-input-number.cjs.entry.js +7 -7
  60. package/dist/cjs/hb-input-number.cjs.entry.js.map +1 -1
  61. package/dist/cjs/hb-input-tag.cjs.entry.js +2 -2
  62. package/dist/cjs/hb-input.cjs.entry.js +40 -3
  63. package/dist/cjs/hb-input.cjs.entry.js.map +1 -1
  64. package/dist/cjs/hb-layout.cjs.entry.js +36 -14
  65. package/dist/cjs/hb-layout.cjs.entry.js.map +1 -1
  66. package/dist/cjs/hb-link.cjs.entry.js +2 -2
  67. package/dist/cjs/hb-loading.cjs.entry.js +2 -2
  68. package/dist/cjs/hb-main.cjs.entry.js +1 -1
  69. package/dist/cjs/hb-menu-item.cjs.entry.js +14 -5
  70. package/dist/cjs/hb-menu-item.cjs.entry.js.map +1 -1
  71. package/dist/cjs/hb-menu.cjs.entry.js +3 -3
  72. package/dist/cjs/hb-menu.cjs.entry.js.map +1 -1
  73. package/dist/cjs/hb-message.cjs.entry.js +13 -4
  74. package/dist/cjs/hb-message.cjs.entry.js.map +1 -1
  75. package/dist/cjs/hb-notification.cjs.entry.js +2 -2
  76. package/dist/cjs/hb-page-header.cjs.entry.js +1 -1
  77. package/dist/cjs/hb-pagination.cjs.entry.js +24 -8
  78. package/dist/cjs/hb-pagination.cjs.entry.js.map +1 -1
  79. package/dist/cjs/hb-popconfirm.cjs.entry.js +57 -8
  80. package/dist/cjs/hb-popconfirm.cjs.entry.js.map +1 -1
  81. package/dist/cjs/hb-popover.cjs.entry.js +37 -5
  82. package/dist/cjs/hb-popover.cjs.entry.js.map +1 -1
  83. package/dist/cjs/hb-progress.cjs.entry.js +1 -1
  84. package/dist/cjs/hb-radio.cjs.entry.js +8 -3
  85. package/dist/cjs/hb-radio.cjs.entry.js.map +1 -1
  86. package/dist/cjs/hb-rate.cjs.entry.js +46 -4
  87. package/dist/cjs/hb-rate.cjs.entry.js.map +1 -1
  88. package/dist/cjs/hb-result.cjs.entry.js +1 -1
  89. package/dist/cjs/hb-row.cjs.entry.js +2 -2
  90. package/dist/cjs/hb-scrollbar.cjs.entry.js +5 -5
  91. package/dist/cjs/hb-scrollbar.cjs.entry.js.map +1 -1
  92. package/dist/cjs/hb-segmented.cjs.entry.js +50 -5
  93. package/dist/cjs/hb-segmented.cjs.entry.js.map +1 -1
  94. package/dist/cjs/hb-select.cjs.entry.js +64 -16
  95. package/dist/cjs/hb-select.cjs.entry.js.map +1 -1
  96. package/dist/cjs/hb-slider.cjs.entry.js +186 -23
  97. package/dist/cjs/hb-slider.cjs.entry.js.map +1 -1
  98. package/dist/cjs/hb-space.cjs.entry.js +2 -2
  99. package/dist/cjs/hb-statistic.cjs.entry.js +1 -1
  100. package/dist/cjs/hb-step.cjs.entry.js +1 -1
  101. package/dist/cjs/hb-steps.cjs.entry.js +30 -9
  102. package/dist/cjs/hb-steps.cjs.entry.js.map +1 -1
  103. package/dist/cjs/hb-sub-menu.cjs.entry.js +5 -5
  104. package/dist/cjs/hb-switch.cjs.entry.js +9 -4
  105. package/dist/cjs/hb-switch.cjs.entry.js.map +1 -1
  106. package/dist/cjs/hb-tab-pane.cjs.entry.js +1 -1
  107. package/dist/cjs/hb-table.cjs.entry.js +26 -17
  108. package/dist/cjs/hb-table.cjs.entry.js.map +1 -1
  109. package/dist/cjs/hb-tabs.cjs.entry.js +31 -10
  110. package/dist/cjs/hb-tabs.cjs.entry.js.map +1 -1
  111. package/dist/cjs/hb-tag.cjs.entry.js +3 -2
  112. package/dist/cjs/hb-tag.cjs.entry.js.map +1 -1
  113. package/dist/cjs/hb-text.cjs.entry.js +2 -2
  114. package/dist/cjs/hb-time-picker.cjs.entry.js +14 -9
  115. package/dist/cjs/hb-time-picker.cjs.entry.js.map +1 -1
  116. package/dist/cjs/hb-time-select.cjs.entry.js +13 -4
  117. package/dist/cjs/hb-time-select.cjs.entry.js.map +1 -1
  118. package/dist/cjs/hb-timeline.cjs.entry.js +1 -1
  119. package/dist/cjs/hb-tooltip.cjs.entry.js +43 -6
  120. package/dist/cjs/hb-tooltip.cjs.entry.js.map +1 -1
  121. package/dist/cjs/hb-transfer.cjs.entry.js +2 -2
  122. package/dist/cjs/hb-tree-select.cjs.entry.js +215 -23
  123. package/dist/cjs/hb-tree-select.cjs.entry.js.map +1 -1
  124. package/dist/cjs/hb-tree.cjs.entry.js +145 -12
  125. package/dist/cjs/hb-tree.cjs.entry.js.map +1 -1
  126. package/dist/cjs/hb-upload.cjs.entry.js +3 -3
  127. package/dist/cjs/hb-watermark.cjs.entry.js +19 -11
  128. package/dist/cjs/hb-watermark.cjs.entry.js.map +1 -1
  129. package/dist/cjs/huibo-ui.cjs.js +1 -1
  130. package/dist/cjs/loader.cjs.js +1 -1
  131. package/dist/cjs/transition-59f1da0f.js +34 -0
  132. package/dist/cjs/transition-59f1da0f.js.map +1 -0
  133. package/dist/collection/collection-manifest.json +3 -3
  134. package/dist/collection/components/Affix/Affix.js +1 -1
  135. package/dist/collection/components/Alert/Alert.js +2 -1
  136. package/dist/collection/components/Alert/Alert.js.map +1 -1
  137. package/dist/collection/components/Avatar/Avatar.js +1 -1
  138. package/dist/collection/components/Backtop/Backtop.js +2 -2
  139. package/dist/collection/components/Badge/Badge.js +1 -1
  140. package/dist/collection/components/Breadcrumb/Breadcrumb.js +1 -1
  141. package/dist/collection/components/Breadcrumb/BreadcrumbItem.js +1 -1
  142. package/dist/collection/components/Button/Button.js +2 -2
  143. package/dist/collection/components/Calendar/Calendar.js +84 -10
  144. package/dist/collection/components/Calendar/Calendar.js.map +1 -1
  145. package/dist/collection/components/Calendar/calendar.css +16 -0
  146. package/dist/collection/components/Card/Card.js +1 -1
  147. package/dist/collection/components/Cascader/Cascader.js +410 -194
  148. package/dist/collection/components/Cascader/Cascader.js.map +1 -1
  149. package/dist/collection/components/Cascader/cascader.css +170 -16
  150. package/dist/collection/components/Checkbox/Checkbox.js +9 -4
  151. package/dist/collection/components/Checkbox/Checkbox.js.map +1 -1
  152. package/dist/collection/components/Checkbox/CheckboxGroup.js +12 -8
  153. package/dist/collection/components/Checkbox/CheckboxGroup.js.map +1 -1
  154. package/dist/collection/components/Collapse/Collapse.js +20 -15
  155. package/dist/collection/components/Collapse/Collapse.js.map +1 -1
  156. package/dist/collection/components/Collapse/CollapseItem.js +33 -4
  157. package/dist/collection/components/Collapse/CollapseItem.js.map +1 -1
  158. package/dist/collection/components/ColorPicker/ColorPicker.js +109 -28
  159. package/dist/collection/components/ColorPicker/ColorPicker.js.map +1 -1
  160. package/dist/collection/components/ColorPicker/color-picker.css +21 -3
  161. package/dist/collection/components/ColorPickerPanel/ColorPickerPanel.js +2 -2
  162. package/dist/collection/components/ConfigProvider/ConfigProvider.js +1 -1
  163. package/dist/collection/components/Container/Aside.js +1 -1
  164. package/dist/collection/components/Container/Container.js +2 -2
  165. package/dist/collection/components/Container/Footer.js +1 -1
  166. package/dist/collection/components/Container/Header.js +1 -1
  167. package/dist/collection/components/Container/Main.js +1 -1
  168. package/dist/collection/components/DatePicker/DatePicker.js +94 -12
  169. package/dist/collection/components/DatePicker/DatePicker.js.map +1 -1
  170. package/dist/collection/components/DatePicker/date-picker.css +63 -2
  171. package/dist/collection/components/DatePickerPane/DatePickerPane.js +1 -1
  172. package/dist/collection/components/DateRangePicker/DateRangePicker.js +2 -2
  173. package/dist/collection/components/DateTimePicker/DateTimePicker.js +2 -2
  174. package/dist/collection/components/Descriptions/Descriptions.js +1 -1
  175. package/dist/collection/components/Descriptions/descriptions.css +52 -10
  176. package/dist/collection/components/Dialog/Dialog.js +54 -10
  177. package/dist/collection/components/Dialog/Dialog.js.map +1 -1
  178. package/dist/collection/components/Dialog/dialog.css +57 -11
  179. package/dist/collection/components/Divider/Divider.js +2 -2
  180. package/dist/collection/components/Drawer/Drawer.js +34 -3
  181. package/dist/collection/components/Drawer/Drawer.js.map +1 -1
  182. package/dist/collection/components/Drawer/drawer.css +207 -17
  183. package/dist/collection/components/Dropdown/Dropdown.js +103 -12
  184. package/dist/collection/components/Dropdown/Dropdown.js.map +1 -1
  185. package/dist/collection/components/Dropdown/dropdown.css +26 -3
  186. package/dist/collection/components/Empty/Empty.js +1 -1
  187. package/dist/collection/components/FloatButton/FloatButton.js +2 -2
  188. package/dist/collection/components/Form/Form.js +14 -9
  189. package/dist/collection/components/Form/Form.js.map +1 -1
  190. package/dist/collection/components/Form/FormItem.js +62 -10
  191. package/dist/collection/components/Form/FormItem.js.map +1 -1
  192. package/dist/collection/components/Form/form-item.css +57 -6
  193. package/dist/collection/components/Form/form.css +1 -0
  194. package/dist/collection/components/Image/Image.js +24 -3
  195. package/dist/collection/components/Image/Image.js.map +1 -1
  196. package/dist/collection/components/ImagePreview/ImagePreview.js +13 -9
  197. package/dist/collection/components/ImagePreview/ImagePreview.js.map +1 -1
  198. package/dist/collection/components/Input/Input.js +39 -2
  199. package/dist/collection/components/Input/Input.js.map +1 -1
  200. package/dist/collection/components/Input/input.css +22 -4
  201. package/dist/collection/components/InputNumber/InputNumber.js +6 -6
  202. package/dist/collection/components/InputNumber/InputNumber.js.map +1 -1
  203. package/dist/collection/components/InputNumber/input-number.css +11 -1
  204. package/dist/collection/components/InputTag/InputTag.js +2 -2
  205. package/dist/collection/components/Layout/Layout.js +87 -34
  206. package/dist/collection/components/Layout/Layout.js.map +1 -1
  207. package/dist/collection/components/Layout/Row.js +2 -2
  208. package/dist/collection/components/Layout/layout.css +1732 -71
  209. package/dist/collection/components/Link/Link.js +2 -2
  210. package/dist/collection/components/Loading/Loading.js +2 -2
  211. package/dist/collection/components/Menu/Menu.js +2 -2
  212. package/dist/collection/components/Menu/MenuItem.js +34 -5
  213. package/dist/collection/components/Menu/MenuItem.js.map +1 -1
  214. package/dist/collection/components/Menu/SubMenu.js +4 -4
  215. package/dist/collection/components/Menu/menu.css +25 -0
  216. package/dist/collection/components/Message/Message.js +13 -4
  217. package/dist/collection/components/Message/Message.js.map +1 -1
  218. package/dist/collection/components/Notification/Notification.js +2 -2
  219. package/dist/collection/components/PageHeader/PageHeader.js +1 -1
  220. package/dist/collection/components/Pagination/Pagination.js +26 -7
  221. package/dist/collection/components/Pagination/Pagination.js.map +1 -1
  222. package/dist/collection/components/Pagination/pagination.css +23 -0
  223. package/dist/collection/components/Popconfirm/Popconfirm.js +66 -7
  224. package/dist/collection/components/Popconfirm/Popconfirm.js.map +1 -1
  225. package/dist/collection/components/Popconfirm/popconfirm.css +80 -16
  226. package/dist/collection/components/Popover/Popover.js +46 -4
  227. package/dist/collection/components/Popover/Popover.js.map +1 -1
  228. package/dist/collection/components/Popover/popover.css +49 -8
  229. package/dist/collection/components/Progress/Progress.js +1 -1
  230. package/dist/collection/components/Radio/Radio.js +8 -3
  231. package/dist/collection/components/Radio/Radio.js.map +1 -1
  232. package/dist/collection/components/Rate/Rate.js +46 -4
  233. package/dist/collection/components/Rate/Rate.js.map +1 -1
  234. package/dist/collection/components/Result/Result.js +1 -1
  235. package/dist/collection/components/Scrollbar/Scrollbar.js +5 -5
  236. package/dist/collection/components/Scrollbar/Scrollbar.js.map +1 -1
  237. package/dist/collection/components/Segmented/Segmented.js +65 -6
  238. package/dist/collection/components/Segmented/Segmented.js.map +1 -1
  239. package/dist/collection/components/Select/Select.js +63 -15
  240. package/dist/collection/components/Select/Select.js.map +1 -1
  241. package/dist/collection/components/Select/select.css +50 -5
  242. package/dist/collection/components/Slider/Slider.js +218 -24
  243. package/dist/collection/components/Slider/Slider.js.map +1 -1
  244. package/dist/collection/components/Slider/slider.css +57 -7
  245. package/dist/collection/components/Space/Space.js +2 -2
  246. package/dist/collection/components/Statistic/Statistic.js +1 -1
  247. package/dist/collection/components/Steps/Step.js +1 -1
  248. package/dist/collection/components/Steps/Steps.js +35 -8
  249. package/dist/collection/components/Steps/Steps.js.map +1 -1
  250. package/dist/collection/components/Switch/Switch.js +8 -3
  251. package/dist/collection/components/Switch/Switch.js.map +1 -1
  252. package/dist/collection/components/Switch/switch.css +47 -1
  253. package/dist/collection/components/Table/Table.js +25 -16
  254. package/dist/collection/components/Table/Table.js.map +1 -1
  255. package/dist/collection/components/Table/table.css +26 -2
  256. package/dist/collection/components/Tabs/TabPane.js +1 -1
  257. package/dist/collection/components/Tabs/Tabs.js +31 -10
  258. package/dist/collection/components/Tabs/Tabs.js.map +1 -1
  259. package/dist/collection/components/Tag/Tag.js +3 -2
  260. package/dist/collection/components/Tag/Tag.js.map +1 -1
  261. package/dist/collection/components/Text/Text.js +2 -2
  262. package/dist/collection/components/TimePicker/TimePicker.js +14 -9
  263. package/dist/collection/components/TimePicker/TimePicker.js.map +1 -1
  264. package/dist/collection/components/TimeSelect/TimeSelect.js +13 -4
  265. package/dist/collection/components/TimeSelect/TimeSelect.js.map +1 -1
  266. package/dist/collection/components/Timeline/Timeline.js +1 -1
  267. package/dist/collection/components/Tooltip/Tooltip.js +52 -6
  268. package/dist/collection/components/Tooltip/Tooltip.js.map +1 -1
  269. package/dist/collection/components/Tooltip/tooltip.css +24 -2
  270. package/dist/collection/components/Transfer/Transfer.js +2 -2
  271. package/dist/collection/components/Tree/Tree.js +147 -13
  272. package/dist/collection/components/Tree/Tree.js.map +1 -1
  273. package/dist/collection/components/TreeSelect/TreeSelect.js +219 -23
  274. package/dist/collection/components/TreeSelect/TreeSelect.js.map +1 -1
  275. package/dist/collection/components/TreeSelect/tree-select.css +41 -7
  276. package/dist/collection/components/Upload/Upload.js +3 -3
  277. package/dist/collection/components/Watermark/Watermark.js +19 -11
  278. package/dist/collection/components/Watermark/Watermark.js.map +1 -1
  279. package/dist/collection/utils/a11y.js +15 -1
  280. package/dist/collection/utils/a11y.js.map +1 -1
  281. package/dist/collection/utils/date-helpers.js +9 -16
  282. package/dist/collection/utils/date-helpers.js.map +1 -1
  283. package/dist/collection/utils/transition.js +29 -0
  284. package/dist/collection/utils/transition.js.map +1 -0
  285. package/dist/components/hb-affix.js +1 -1
  286. package/dist/components/hb-alert.js +2 -1
  287. package/dist/components/hb-alert.js.map +1 -1
  288. package/dist/components/hb-aside.js +1 -1
  289. package/dist/components/hb-avatar.js +1 -1
  290. package/dist/components/hb-backtop.js +2 -2
  291. package/dist/components/hb-badge.js +1 -1
  292. package/dist/components/hb-breadcrumb-item.js +1 -1
  293. package/dist/components/hb-breadcrumb.js +1 -1
  294. package/dist/components/hb-button.js +2 -2
  295. package/dist/components/hb-calendar.js +80 -11
  296. package/dist/components/hb-calendar.js.map +1 -1
  297. package/dist/components/hb-card.js +1 -1
  298. package/dist/components/hb-cascader.js +309 -146
  299. package/dist/components/hb-cascader.js.map +1 -1
  300. package/dist/components/hb-checkbox-group.js +12 -8
  301. package/dist/components/hb-checkbox-group.js.map +1 -1
  302. package/dist/components/hb-checkbox.js +9 -4
  303. package/dist/components/hb-checkbox.js.map +1 -1
  304. package/dist/components/hb-collapse-item.js +14 -4
  305. package/dist/components/hb-collapse-item.js.map +1 -1
  306. package/dist/components/hb-collapse.js +20 -15
  307. package/dist/components/hb-collapse.js.map +1 -1
  308. package/dist/components/hb-color-picker-panel.js +2 -2
  309. package/dist/components/hb-color-picker.js +110 -29
  310. package/dist/components/hb-color-picker.js.map +1 -1
  311. package/dist/components/hb-config-provider.js +1 -1
  312. package/dist/components/hb-container.js +2 -2
  313. package/dist/components/hb-date-picker-pane.js +2 -2
  314. package/dist/components/hb-date-picker.js +92 -10
  315. package/dist/components/hb-date-picker.js.map +1 -1
  316. package/dist/components/hb-date-range-picker.js +3 -3
  317. package/dist/components/hb-date-time-picker.js +3 -3
  318. package/dist/components/hb-descriptions.js +2 -2
  319. package/dist/components/hb-descriptions.js.map +1 -1
  320. package/dist/components/hb-dialog.js +53 -13
  321. package/dist/components/hb-dialog.js.map +1 -1
  322. package/dist/components/hb-divider.js +2 -2
  323. package/dist/components/hb-drawer.js +36 -5
  324. package/dist/components/hb-drawer.js.map +1 -1
  325. package/dist/components/hb-dropdown.js +94 -12
  326. package/dist/components/hb-dropdown.js.map +1 -1
  327. package/dist/components/hb-empty.js +1 -1
  328. package/dist/components/hb-float-button.js +2 -2
  329. package/dist/components/hb-footer.js +1 -1
  330. package/dist/components/hb-form-item.js +61 -9
  331. package/dist/components/hb-form-item.js.map +1 -1
  332. package/dist/components/hb-form.js +13 -8
  333. package/dist/components/hb-form.js.map +1 -1
  334. package/dist/components/hb-header.js +1 -1
  335. package/dist/components/hb-icon.js +1 -89
  336. package/dist/components/hb-icon.js.map +1 -1
  337. package/dist/components/hb-image-preview.js +13 -9
  338. package/dist/components/hb-image-preview.js.map +1 -1
  339. package/dist/components/hb-image.js +23 -3
  340. package/dist/components/hb-image.js.map +1 -1
  341. package/dist/components/hb-input-number.js +7 -7
  342. package/dist/components/hb-input-number.js.map +1 -1
  343. package/dist/components/hb-input-tag.js +2 -2
  344. package/dist/components/hb-input.js +40 -3
  345. package/dist/components/hb-input.js.map +1 -1
  346. package/dist/components/hb-layout.js +36 -14
  347. package/dist/components/hb-layout.js.map +1 -1
  348. package/dist/components/hb-link.js +2 -2
  349. package/dist/components/hb-loading.js +2 -2
  350. package/dist/components/hb-main.js +1 -1
  351. package/dist/components/hb-menu-item.js +15 -5
  352. package/dist/components/hb-menu-item.js.map +1 -1
  353. package/dist/components/hb-menu.js +3 -3
  354. package/dist/components/hb-menu.js.map +1 -1
  355. package/dist/components/hb-message.js +13 -4
  356. package/dist/components/hb-message.js.map +1 -1
  357. package/dist/components/hb-notification.js +2 -2
  358. package/dist/components/hb-page-header.js +1 -1
  359. package/dist/components/hb-pagination.js +28 -10
  360. package/dist/components/hb-pagination.js.map +1 -1
  361. package/dist/components/hb-popconfirm.js +58 -8
  362. package/dist/components/hb-popconfirm.js.map +1 -1
  363. package/dist/components/hb-popover.js +38 -5
  364. package/dist/components/hb-popover.js.map +1 -1
  365. package/dist/components/hb-progress.js +1 -1
  366. package/dist/components/hb-radio.js +8 -3
  367. package/dist/components/hb-radio.js.map +1 -1
  368. package/dist/components/hb-rate.js +46 -4
  369. package/dist/components/hb-rate.js.map +1 -1
  370. package/dist/components/hb-result.js +1 -1
  371. package/dist/components/hb-row.js +2 -2
  372. package/dist/components/hb-scrollbar.js +5 -5
  373. package/dist/components/hb-scrollbar.js.map +1 -1
  374. package/dist/components/hb-segmented.js +54 -6
  375. package/dist/components/hb-segmented.js.map +1 -1
  376. package/dist/components/hb-select.js +64 -16
  377. package/dist/components/hb-select.js.map +1 -1
  378. package/dist/components/hb-slider.js +191 -24
  379. package/dist/components/hb-slider.js.map +1 -1
  380. package/dist/components/hb-space.js +2 -2
  381. package/dist/components/hb-statistic.js +1 -1
  382. package/dist/components/hb-step.js +1 -1
  383. package/dist/components/hb-steps.js +35 -8
  384. package/dist/components/hb-steps.js.map +1 -1
  385. package/dist/components/hb-sub-menu.js +5 -5
  386. package/dist/components/hb-switch.js +9 -4
  387. package/dist/components/hb-switch.js.map +1 -1
  388. package/dist/components/hb-tab-pane.js +1 -1
  389. package/dist/components/hb-table.js +26 -17
  390. package/dist/components/hb-table.js.map +1 -1
  391. package/dist/components/hb-tabs.js +31 -10
  392. package/dist/components/hb-tabs.js.map +1 -1
  393. package/dist/components/hb-tag.js +3 -2
  394. package/dist/components/hb-tag.js.map +1 -1
  395. package/dist/components/hb-text.js +2 -2
  396. package/dist/components/hb-time-picker.js +14 -9
  397. package/dist/components/hb-time-picker.js.map +1 -1
  398. package/dist/components/hb-time-select.js +13 -4
  399. package/dist/components/hb-time-select.js.map +1 -1
  400. package/dist/components/hb-timeline.js +1 -1
  401. package/dist/components/hb-tooltip.js +44 -6
  402. package/dist/components/hb-tooltip.js.map +1 -1
  403. package/dist/components/hb-transfer.js +2 -2
  404. package/dist/components/hb-tree-select.js +219 -24
  405. package/dist/components/hb-tree-select.js.map +1 -1
  406. package/dist/components/hb-tree.js +147 -13
  407. package/dist/components/hb-tree.js.map +1 -1
  408. package/dist/components/hb-upload.js +3 -3
  409. package/dist/components/hb-watermark.js +19 -11
  410. package/dist/components/hb-watermark.js.map +1 -1
  411. package/dist/components/{p-cc0aeb50.js → p-00aa34c8.js} +17 -3
  412. package/dist/components/p-00aa34c8.js.map +1 -0
  413. package/dist/components/p-86d92faf.js +93 -0
  414. package/dist/components/p-86d92faf.js.map +1 -0
  415. package/dist/{esm/date-helpers-e4d85a67.js → components/p-e0876aca.js} +10 -17
  416. package/dist/components/p-e0876aca.js.map +1 -0
  417. package/dist/components/p-fad66d69.js +32 -0
  418. package/dist/components/p-fad66d69.js.map +1 -0
  419. package/dist/esm/{a11y-f9ab2964.js → a11y-e4cde5b0.js} +17 -3
  420. package/dist/esm/a11y-e4cde5b0.js.map +1 -0
  421. package/dist/{components/p-cf94cbf6.js → esm/date-helpers-259ed2f1.js} +10 -17
  422. package/dist/esm/date-helpers-259ed2f1.js.map +1 -0
  423. package/dist/esm/hb-affix.entry.js +1 -1
  424. package/dist/esm/hb-alert.entry.js +2 -1
  425. package/dist/esm/hb-alert.entry.js.map +1 -1
  426. package/dist/esm/hb-aside.entry.js +1 -1
  427. package/dist/esm/hb-avatar.entry.js +1 -1
  428. package/dist/esm/hb-backtop.entry.js +2 -2
  429. package/dist/esm/hb-badge.entry.js +1 -1
  430. package/dist/esm/hb-breadcrumb-item.entry.js +1 -1
  431. package/dist/esm/hb-breadcrumb.entry.js +1 -1
  432. package/dist/esm/hb-button.entry.js +2 -2
  433. package/dist/esm/hb-calendar.entry.js +78 -10
  434. package/dist/esm/hb-calendar.entry.js.map +1 -1
  435. package/dist/esm/hb-card.entry.js +1 -1
  436. package/dist/esm/hb-cascader.entry.js +306 -146
  437. package/dist/esm/hb-cascader.entry.js.map +1 -1
  438. package/dist/esm/hb-checkbox-group.entry.js +12 -8
  439. package/dist/esm/hb-checkbox-group.entry.js.map +1 -1
  440. package/dist/esm/hb-checkbox.entry.js +9 -4
  441. package/dist/esm/hb-checkbox.entry.js.map +1 -1
  442. package/dist/esm/hb-collapse-item.entry.js +13 -4
  443. package/dist/esm/hb-collapse-item.entry.js.map +1 -1
  444. package/dist/esm/hb-collapse.entry.js +20 -15
  445. package/dist/esm/hb-collapse.entry.js.map +1 -1
  446. package/dist/esm/hb-color-picker-panel.entry.js +2 -2
  447. package/dist/esm/hb-color-picker.entry.js +108 -28
  448. package/dist/esm/hb-color-picker.entry.js.map +1 -1
  449. package/dist/esm/hb-config-provider.entry.js +1 -1
  450. package/dist/esm/hb-container.entry.js +2 -2
  451. package/dist/esm/hb-date-picker-pane.entry.js +2 -2
  452. package/dist/esm/hb-date-picker.entry.js +90 -9
  453. package/dist/esm/hb-date-picker.entry.js.map +1 -1
  454. package/dist/esm/hb-date-range-picker.entry.js +3 -3
  455. package/dist/esm/hb-date-time-picker.entry.js +3 -3
  456. package/dist/esm/hb-descriptions.entry.js +2 -2
  457. package/dist/esm/hb-descriptions.entry.js.map +1 -1
  458. package/dist/esm/hb-dialog.entry.js +51 -12
  459. package/dist/esm/hb-dialog.entry.js.map +1 -1
  460. package/dist/esm/hb-divider.entry.js +2 -2
  461. package/dist/esm/hb-drawer.entry.js +34 -4
  462. package/dist/esm/hb-drawer.entry.js.map +1 -1
  463. package/dist/esm/hb-dropdown.entry.js +91 -11
  464. package/dist/esm/hb-dropdown.entry.js.map +1 -1
  465. package/dist/esm/hb-empty.entry.js +1 -1
  466. package/dist/esm/hb-float-button.entry.js +2 -2
  467. package/dist/esm/hb-footer.entry.js +1 -1
  468. package/dist/esm/hb-form-item.entry.js +61 -9
  469. package/dist/esm/hb-form-item.entry.js.map +1 -1
  470. package/dist/esm/hb-form.entry.js +13 -8
  471. package/dist/esm/hb-form.entry.js.map +1 -1
  472. package/dist/esm/hb-header.entry.js +1 -1
  473. package/dist/esm/hb-image-preview.entry.js +13 -9
  474. package/dist/esm/hb-image-preview.entry.js.map +1 -1
  475. package/dist/esm/hb-image.entry.js +21 -3
  476. package/dist/esm/hb-image.entry.js.map +1 -1
  477. package/dist/esm/hb-input-number.entry.js +7 -7
  478. package/dist/esm/hb-input-number.entry.js.map +1 -1
  479. package/dist/esm/hb-input-tag.entry.js +2 -2
  480. package/dist/esm/hb-input.entry.js +40 -3
  481. package/dist/esm/hb-input.entry.js.map +1 -1
  482. package/dist/esm/hb-layout.entry.js +36 -14
  483. package/dist/esm/hb-layout.entry.js.map +1 -1
  484. package/dist/esm/hb-link.entry.js +2 -2
  485. package/dist/esm/hb-loading.entry.js +2 -2
  486. package/dist/esm/hb-main.entry.js +1 -1
  487. package/dist/esm/hb-menu-item.entry.js +14 -5
  488. package/dist/esm/hb-menu-item.entry.js.map +1 -1
  489. package/dist/esm/hb-menu.entry.js +3 -3
  490. package/dist/esm/hb-menu.entry.js.map +1 -1
  491. package/dist/esm/hb-message.entry.js +13 -4
  492. package/dist/esm/hb-message.entry.js.map +1 -1
  493. package/dist/esm/hb-notification.entry.js +2 -2
  494. package/dist/esm/hb-page-header.entry.js +1 -1
  495. package/dist/esm/hb-pagination.entry.js +24 -8
  496. package/dist/esm/hb-pagination.entry.js.map +1 -1
  497. package/dist/esm/hb-popconfirm.entry.js +57 -8
  498. package/dist/esm/hb-popconfirm.entry.js.map +1 -1
  499. package/dist/esm/hb-popover.entry.js +37 -5
  500. package/dist/esm/hb-popover.entry.js.map +1 -1
  501. package/dist/esm/hb-progress.entry.js +1 -1
  502. package/dist/esm/hb-radio.entry.js +8 -3
  503. package/dist/esm/hb-radio.entry.js.map +1 -1
  504. package/dist/esm/hb-rate.entry.js +46 -4
  505. package/dist/esm/hb-rate.entry.js.map +1 -1
  506. package/dist/esm/hb-result.entry.js +1 -1
  507. package/dist/esm/hb-row.entry.js +2 -2
  508. package/dist/esm/hb-scrollbar.entry.js +5 -5
  509. package/dist/esm/hb-scrollbar.entry.js.map +1 -1
  510. package/dist/esm/hb-segmented.entry.js +51 -6
  511. package/dist/esm/hb-segmented.entry.js.map +1 -1
  512. package/dist/esm/hb-select.entry.js +64 -16
  513. package/dist/esm/hb-select.entry.js.map +1 -1
  514. package/dist/esm/hb-slider.entry.js +186 -23
  515. package/dist/esm/hb-slider.entry.js.map +1 -1
  516. package/dist/esm/hb-space.entry.js +2 -2
  517. package/dist/esm/hb-statistic.entry.js +1 -1
  518. package/dist/esm/hb-step.entry.js +1 -1
  519. package/dist/esm/hb-steps.entry.js +28 -7
  520. package/dist/esm/hb-steps.entry.js.map +1 -1
  521. package/dist/esm/hb-sub-menu.entry.js +5 -5
  522. package/dist/esm/hb-switch.entry.js +9 -4
  523. package/dist/esm/hb-switch.entry.js.map +1 -1
  524. package/dist/esm/hb-tab-pane.entry.js +1 -1
  525. package/dist/esm/hb-table.entry.js +26 -17
  526. package/dist/esm/hb-table.entry.js.map +1 -1
  527. package/dist/esm/hb-tabs.entry.js +31 -10
  528. package/dist/esm/hb-tabs.entry.js.map +1 -1
  529. package/dist/esm/hb-tag.entry.js +3 -2
  530. package/dist/esm/hb-tag.entry.js.map +1 -1
  531. package/dist/esm/hb-text.entry.js +2 -2
  532. package/dist/esm/hb-time-picker.entry.js +14 -9
  533. package/dist/esm/hb-time-picker.entry.js.map +1 -1
  534. package/dist/esm/hb-time-select.entry.js +13 -4
  535. package/dist/esm/hb-time-select.entry.js.map +1 -1
  536. package/dist/esm/hb-timeline.entry.js +1 -1
  537. package/dist/esm/hb-tooltip.entry.js +43 -6
  538. package/dist/esm/hb-tooltip.entry.js.map +1 -1
  539. package/dist/esm/hb-transfer.entry.js +2 -2
  540. package/dist/esm/hb-tree-select.entry.js +215 -23
  541. package/dist/esm/hb-tree-select.entry.js.map +1 -1
  542. package/dist/esm/hb-tree.entry.js +145 -12
  543. package/dist/esm/hb-tree.entry.js.map +1 -1
  544. package/dist/esm/hb-upload.entry.js +3 -3
  545. package/dist/esm/hb-watermark.entry.js +19 -11
  546. package/dist/esm/hb-watermark.entry.js.map +1 -1
  547. package/dist/esm/huibo-ui.js +1 -1
  548. package/dist/esm/loader.js +1 -1
  549. package/dist/esm/transition-4295d789.js +32 -0
  550. package/dist/esm/transition-4295d789.js.map +1 -0
  551. package/dist/huibo-ui/huibo-ui.css +1 -1
  552. package/dist/huibo-ui/huibo-ui.esm.js +1 -1
  553. package/dist/huibo-ui/huibo-ui.esm.js.map +1 -1
  554. package/dist/huibo-ui/p-00aa34c8.js +2 -0
  555. package/dist/huibo-ui/p-00aa34c8.js.map +1 -0
  556. package/dist/huibo-ui/p-02f15843.entry.js +2 -0
  557. package/dist/huibo-ui/p-0cc1e3f3.entry.js +2 -0
  558. package/dist/huibo-ui/p-0cc1e3f3.entry.js.map +1 -0
  559. package/dist/huibo-ui/{p-f1c084c5.entry.js → p-0ddae4e9.entry.js} +2 -2
  560. package/dist/huibo-ui/{p-672076c3.entry.js → p-10f6c184.entry.js} +2 -2
  561. package/dist/huibo-ui/p-10f6c184.entry.js.map +1 -0
  562. package/dist/huibo-ui/{p-6ac242fe.entry.js → p-14c3b47b.entry.js} +2 -2
  563. package/dist/huibo-ui/{p-8c80a765.entry.js → p-15db24e9.entry.js} +2 -2
  564. package/dist/huibo-ui/{p-8b027491.entry.js → p-193efdc0.entry.js} +2 -2
  565. package/dist/huibo-ui/{p-8d925e3d.entry.js → p-1b0fbe69.entry.js} +2 -2
  566. package/dist/huibo-ui/{p-85f68526.entry.js → p-1b98152b.entry.js} +2 -2
  567. package/dist/huibo-ui/p-1b98152b.entry.js.map +1 -0
  568. package/dist/huibo-ui/p-1f6d0adb.entry.js +2 -0
  569. package/dist/huibo-ui/p-1f6d0adb.entry.js.map +1 -0
  570. package/dist/huibo-ui/{p-f374d5a3.entry.js → p-20632186.entry.js} +2 -2
  571. package/dist/huibo-ui/{p-e6f2d71d.entry.js → p-20fc554b.entry.js} +2 -2
  572. package/dist/huibo-ui/{p-64ca0980.entry.js → p-29092b85.entry.js} +2 -2
  573. package/dist/huibo-ui/p-29092b85.entry.js.map +1 -0
  574. package/dist/huibo-ui/p-2bc30b1b.entry.js +2 -0
  575. package/dist/huibo-ui/p-2bc30b1b.entry.js.map +1 -0
  576. package/dist/huibo-ui/{p-fd19813c.entry.js → p-2bcda1bb.entry.js} +2 -2
  577. package/dist/huibo-ui/{p-231a7335.entry.js → p-2ca9796a.entry.js} +2 -2
  578. package/dist/huibo-ui/p-2ca9796a.entry.js.map +1 -0
  579. package/dist/huibo-ui/{p-e0768565.entry.js → p-3042f986.entry.js} +2 -2
  580. package/dist/huibo-ui/{p-be48d2aa.entry.js → p-3dacb26b.entry.js} +2 -2
  581. package/dist/huibo-ui/{p-6a1ec3ff.entry.js → p-3deff48c.entry.js} +2 -2
  582. package/dist/huibo-ui/{p-c321c4aa.entry.js → p-412ff618.entry.js} +2 -2
  583. package/dist/huibo-ui/p-415295f3.entry.js +2 -0
  584. package/dist/huibo-ui/p-415295f3.entry.js.map +1 -0
  585. package/dist/huibo-ui/p-494e6c25.entry.js +2 -0
  586. package/dist/huibo-ui/p-494e6c25.entry.js.map +1 -0
  587. package/dist/huibo-ui/p-4d87d7f4.entry.js +2 -0
  588. package/dist/huibo-ui/p-4d87d7f4.entry.js.map +1 -0
  589. package/dist/huibo-ui/p-54a28052.entry.js +2 -0
  590. package/dist/huibo-ui/p-54a28052.entry.js.map +1 -0
  591. package/dist/huibo-ui/{p-88127de1.entry.js → p-55cd13eb.entry.js} +2 -2
  592. package/dist/huibo-ui/{p-58ebb9b3.entry.js → p-5c839288.entry.js} +2 -2
  593. package/dist/huibo-ui/p-5e253c15.entry.js +2 -0
  594. package/dist/huibo-ui/p-5e253c15.entry.js.map +1 -0
  595. package/dist/huibo-ui/p-63d68c61.entry.js +2 -0
  596. package/dist/huibo-ui/p-63d68c61.entry.js.map +1 -0
  597. package/dist/huibo-ui/{p-a042e3d0.entry.js → p-6518c435.entry.js} +2 -2
  598. package/dist/huibo-ui/p-687d8dff.entry.js +2 -0
  599. package/dist/huibo-ui/p-687d8dff.entry.js.map +1 -0
  600. package/dist/huibo-ui/p-688460ce.entry.js +2 -0
  601. package/dist/huibo-ui/p-688460ce.entry.js.map +1 -0
  602. package/dist/huibo-ui/p-69bb1dd9.entry.js +2 -0
  603. package/dist/huibo-ui/p-69bb1dd9.entry.js.map +1 -0
  604. package/dist/huibo-ui/{p-a0015341.entry.js → p-6bfeab80.entry.js} +2 -2
  605. package/dist/huibo-ui/{p-4001c08d.entry.js → p-6c23fbd1.entry.js} +2 -2
  606. package/dist/huibo-ui/p-6c23fbd1.entry.js.map +1 -0
  607. package/dist/huibo-ui/p-6c8cf248.entry.js +2 -0
  608. package/dist/huibo-ui/p-6c8cf248.entry.js.map +1 -0
  609. package/dist/huibo-ui/p-6efed295.entry.js +2 -0
  610. package/dist/huibo-ui/p-6efed295.entry.js.map +1 -0
  611. package/dist/huibo-ui/{p-8b1ae77e.entry.js → p-746a11a3.entry.js} +2 -2
  612. package/dist/huibo-ui/{p-c3e8893d.entry.js → p-79b24b83.entry.js} +2 -2
  613. package/dist/huibo-ui/p-79b24b83.entry.js.map +1 -0
  614. package/dist/huibo-ui/p-7a38b3e2.entry.js +2 -0
  615. package/dist/huibo-ui/p-7a38b3e2.entry.js.map +1 -0
  616. package/dist/huibo-ui/{p-c922d672.entry.js → p-7a682c56.entry.js} +2 -2
  617. package/dist/huibo-ui/{p-8c987d57.entry.js → p-7f65dc36.entry.js} +2 -2
  618. package/dist/huibo-ui/{p-463de26d.entry.js → p-815fc943.entry.js} +2 -2
  619. package/dist/huibo-ui/{p-d87fc21a.entry.js → p-88a6c905.entry.js} +2 -2
  620. package/dist/huibo-ui/{p-77017274.entry.js → p-89be7973.entry.js} +2 -2
  621. package/dist/huibo-ui/p-8a202bc5.entry.js +2 -0
  622. package/dist/huibo-ui/p-8a202bc5.entry.js.map +1 -0
  623. package/dist/huibo-ui/{p-315feadf.entry.js → p-8c4415ed.entry.js} +2 -2
  624. package/dist/huibo-ui/p-8c4415ed.entry.js.map +1 -0
  625. package/dist/huibo-ui/{p-9319c650.entry.js → p-950e7465.entry.js} +2 -2
  626. package/dist/huibo-ui/{p-6b381d0e.entry.js → p-96cecd21.entry.js} +2 -2
  627. package/dist/huibo-ui/p-96cecd21.entry.js.map +1 -0
  628. package/dist/huibo-ui/{p-710f38de.entry.js → p-98b513cd.entry.js} +2 -2
  629. package/dist/huibo-ui/p-98b513cd.entry.js.map +1 -0
  630. package/dist/huibo-ui/{p-5df47135.entry.js → p-a190ca89.entry.js} +2 -2
  631. package/dist/huibo-ui/{p-0e65e1bd.entry.js → p-ac18c68b.entry.js} +2 -2
  632. package/dist/huibo-ui/p-ac18c68b.entry.js.map +1 -0
  633. package/dist/huibo-ui/{p-d64b91ef.entry.js → p-ac45291c.entry.js} +2 -2
  634. package/dist/huibo-ui/p-ac45291c.entry.js.map +1 -0
  635. package/dist/huibo-ui/{p-477d8568.entry.js → p-aeae83af.entry.js} +2 -2
  636. package/dist/huibo-ui/{p-b489a526.entry.js → p-b06c8020.entry.js} +2 -2
  637. package/dist/huibo-ui/{p-dfaf7e37.entry.js → p-b105cf76.entry.js} +2 -2
  638. package/dist/huibo-ui/p-b105cf76.entry.js.map +1 -0
  639. package/dist/huibo-ui/{p-c3e665f6.entry.js → p-b38802b0.entry.js} +2 -2
  640. package/dist/huibo-ui/p-b38802b0.entry.js.map +1 -0
  641. package/dist/huibo-ui/{p-ea74fcae.entry.js → p-b3fd12c7.entry.js} +2 -2
  642. package/dist/huibo-ui/p-b3fd12c7.entry.js.map +1 -0
  643. package/dist/huibo-ui/p-b5ea18ba.entry.js +2 -0
  644. package/dist/huibo-ui/p-b5ea18ba.entry.js.map +1 -0
  645. package/dist/huibo-ui/{p-e2a8a396.entry.js → p-b6afe81e.entry.js} +2 -2
  646. package/dist/huibo-ui/{p-2b286698.entry.js → p-b7885d4a.entry.js} +2 -2
  647. package/dist/huibo-ui/p-b7900dee.entry.js +2 -0
  648. package/dist/huibo-ui/p-b7900dee.entry.js.map +1 -0
  649. package/dist/huibo-ui/p-b8c83751.entry.js +2 -0
  650. package/dist/huibo-ui/p-b8c83751.entry.js.map +1 -0
  651. package/dist/huibo-ui/p-c7713947.entry.js +2 -0
  652. package/dist/huibo-ui/p-c7713947.entry.js.map +1 -0
  653. package/dist/huibo-ui/{p-e0ab9010.entry.js → p-c869842c.entry.js} +2 -2
  654. package/dist/huibo-ui/p-c869842c.entry.js.map +1 -0
  655. package/dist/huibo-ui/{p-476527c1.entry.js → p-c8e917db.entry.js} +2 -2
  656. package/dist/huibo-ui/p-c8e917db.entry.js.map +1 -0
  657. package/dist/huibo-ui/p-cb66dbef.entry.js +2 -0
  658. package/dist/huibo-ui/p-cb66dbef.entry.js.map +1 -0
  659. package/dist/huibo-ui/p-cde83f76.entry.js +2 -0
  660. package/dist/huibo-ui/p-cde83f76.entry.js.map +1 -0
  661. package/dist/huibo-ui/{p-10c088f3.entry.js → p-d9c7c378.entry.js} +2 -2
  662. package/dist/huibo-ui/{p-332c8877.entry.js → p-dd9c6459.entry.js} +2 -2
  663. package/dist/huibo-ui/{p-80aca641.entry.js → p-dfccc7aa.entry.js} +2 -2
  664. package/dist/huibo-ui/{p-21682e92.entry.js → p-dfd144d8.entry.js} +2 -2
  665. package/dist/huibo-ui/p-e0876aca.js +2 -0
  666. package/dist/huibo-ui/p-e0876aca.js.map +1 -0
  667. package/dist/huibo-ui/p-e1773c93.entry.js +2 -0
  668. package/dist/huibo-ui/p-e1773c93.entry.js.map +1 -0
  669. package/dist/huibo-ui/{p-079a4130.entry.js → p-e3155cd7.entry.js} +2 -2
  670. package/dist/huibo-ui/{p-59b2e61c.entry.js → p-e73c357f.entry.js} +2 -2
  671. package/dist/huibo-ui/p-e73c357f.entry.js.map +1 -0
  672. package/dist/huibo-ui/{p-c1b4eacb.entry.js → p-e7c73624.entry.js} +2 -2
  673. package/dist/huibo-ui/p-e7c73624.entry.js.map +1 -0
  674. package/dist/huibo-ui/{p-d7815b4f.entry.js → p-e9e7abca.entry.js} +2 -2
  675. package/dist/huibo-ui/{p-f81ec512.entry.js → p-ea0823f3.entry.js} +2 -2
  676. package/dist/huibo-ui/p-ea0823f3.entry.js.map +1 -0
  677. package/dist/huibo-ui/{p-2e6584ea.entry.js → p-f1f2483f.entry.js} +2 -2
  678. package/dist/huibo-ui/{p-465dcb4c.entry.js → p-f2c78699.entry.js} +2 -2
  679. package/dist/huibo-ui/p-fad66d69.js +2 -0
  680. package/dist/huibo-ui/p-fad66d69.js.map +1 -0
  681. package/dist/huibo-ui/{p-4d8b1404.entry.js → p-fd6831f9.entry.js} +2 -2
  682. package/dist/huibo-ui/p-ff6bc5cc.entry.js +2 -0
  683. package/dist/huibo-ui/p-ff6bc5cc.entry.js.map +1 -0
  684. package/dist/types/components/Calendar/Calendar.d.ts +13 -1
  685. package/dist/types/components/Cascader/Cascader.d.ts +80 -90
  686. package/dist/types/components/Checkbox/Checkbox.d.ts +5 -0
  687. package/dist/types/components/Checkbox/CheckboxGroup.d.ts +1 -0
  688. package/dist/types/components/Collapse/Collapse.d.ts +2 -0
  689. package/dist/types/components/Collapse/CollapseItem.d.ts +8 -1
  690. package/dist/types/components/ColorPicker/ColorPicker.d.ts +11 -0
  691. package/dist/types/components/DatePicker/DatePicker.d.ts +14 -3
  692. package/dist/types/components/Dialog/Dialog.d.ts +13 -1
  693. package/dist/types/components/Drawer/Drawer.d.ts +4 -0
  694. package/dist/types/components/Dropdown/Dropdown.d.ts +18 -1
  695. package/dist/types/components/Form/Form.d.ts +2 -0
  696. package/dist/types/components/Form/FormItem.d.ts +10 -0
  697. package/dist/types/components/Image/Image.d.ts +6 -0
  698. package/dist/types/components/ImagePreview/ImagePreview.d.ts +5 -1
  699. package/dist/types/components/Input/Input.d.ts +9 -0
  700. package/dist/types/components/Layout/Layout.d.ts +20 -10
  701. package/dist/types/components/Menu/MenuItem.d.ts +8 -1
  702. package/dist/types/components/Message/Message.d.ts +3 -0
  703. package/dist/types/components/Pagination/Pagination.d.ts +3 -0
  704. package/dist/types/components/Popconfirm/Popconfirm.d.ts +16 -0
  705. package/dist/types/components/Popover/Popover.d.ts +14 -0
  706. package/dist/types/components/Radio/Radio.d.ts +5 -0
  707. package/dist/types/components/Rate/Rate.d.ts +7 -0
  708. package/dist/types/components/Segmented/Segmented.d.ts +18 -1
  709. package/dist/types/components/Select/Select.d.ts +11 -0
  710. package/dist/types/components/Slider/Slider.d.ts +27 -1
  711. package/dist/types/components/Steps/Steps.d.ts +14 -6
  712. package/dist/types/components/Table/Table.d.ts +8 -2
  713. package/dist/types/components/Tabs/Tabs.d.ts +6 -0
  714. package/dist/types/components/Tooltip/Tooltip.d.ts +15 -1
  715. package/dist/types/components/Tree/Tree.d.ts +24 -0
  716. package/dist/types/components/TreeSelect/TreeSelect.d.ts +26 -0
  717. package/dist/types/components/Watermark/Watermark.d.ts +7 -1
  718. package/dist/types/components.d.ts +290 -98
  719. package/dist/types/utils/a11y.d.ts +9 -0
  720. package/dist/types/utils/date-helpers.d.ts +1 -1
  721. package/dist/types/utils/transition.d.ts +27 -0
  722. package/package.json +8 -2
  723. package/readme.md +88 -73
  724. package/dist/cjs/a11y-802de67a.js.map +0 -1
  725. package/dist/cjs/date-helpers-904747ff.js.map +0 -1
  726. package/dist/components/p-cc0aeb50.js.map +0 -1
  727. package/dist/components/p-cf94cbf6.js.map +0 -1
  728. package/dist/esm/a11y-f9ab2964.js.map +0 -1
  729. package/dist/esm/date-helpers-e4d85a67.js.map +0 -1
  730. package/dist/huibo-ui/p-003cee87.entry.js +0 -2
  731. package/dist/huibo-ui/p-003cee87.entry.js.map +0 -1
  732. package/dist/huibo-ui/p-0a033738.entry.js +0 -2
  733. package/dist/huibo-ui/p-0a033738.entry.js.map +0 -1
  734. package/dist/huibo-ui/p-0bef78ac.entry.js +0 -2
  735. package/dist/huibo-ui/p-0bef78ac.entry.js.map +0 -1
  736. package/dist/huibo-ui/p-0e65e1bd.entry.js.map +0 -1
  737. package/dist/huibo-ui/p-0f189251.entry.js +0 -2
  738. package/dist/huibo-ui/p-0f189251.entry.js.map +0 -1
  739. package/dist/huibo-ui/p-1b5acd6d.entry.js +0 -2
  740. package/dist/huibo-ui/p-1b5acd6d.entry.js.map +0 -1
  741. package/dist/huibo-ui/p-231a7335.entry.js.map +0 -1
  742. package/dist/huibo-ui/p-24ad7eec.entry.js +0 -2
  743. package/dist/huibo-ui/p-24ad7eec.entry.js.map +0 -1
  744. package/dist/huibo-ui/p-315feadf.entry.js.map +0 -1
  745. package/dist/huibo-ui/p-3c7f73c8.entry.js +0 -2
  746. package/dist/huibo-ui/p-3c7f73c8.entry.js.map +0 -1
  747. package/dist/huibo-ui/p-4001c08d.entry.js.map +0 -1
  748. package/dist/huibo-ui/p-44c48246.entry.js +0 -2
  749. package/dist/huibo-ui/p-44c48246.entry.js.map +0 -1
  750. package/dist/huibo-ui/p-476527c1.entry.js.map +0 -1
  751. package/dist/huibo-ui/p-4d0dff15.entry.js +0 -2
  752. package/dist/huibo-ui/p-58d20809.entry.js +0 -2
  753. package/dist/huibo-ui/p-58d20809.entry.js.map +0 -1
  754. package/dist/huibo-ui/p-59b2e61c.entry.js.map +0 -1
  755. package/dist/huibo-ui/p-64ca0980.entry.js.map +0 -1
  756. package/dist/huibo-ui/p-672076c3.entry.js.map +0 -1
  757. package/dist/huibo-ui/p-6b381d0e.entry.js.map +0 -1
  758. package/dist/huibo-ui/p-710f38de.entry.js.map +0 -1
  759. package/dist/huibo-ui/p-756acbdb.entry.js +0 -2
  760. package/dist/huibo-ui/p-756acbdb.entry.js.map +0 -1
  761. package/dist/huibo-ui/p-75a93de3.entry.js +0 -2
  762. package/dist/huibo-ui/p-75a93de3.entry.js.map +0 -1
  763. package/dist/huibo-ui/p-769960f4.entry.js +0 -2
  764. package/dist/huibo-ui/p-769960f4.entry.js.map +0 -1
  765. package/dist/huibo-ui/p-7f6975ad.entry.js +0 -2
  766. package/dist/huibo-ui/p-7f6975ad.entry.js.map +0 -1
  767. package/dist/huibo-ui/p-85f68526.entry.js.map +0 -1
  768. package/dist/huibo-ui/p-8d615521.entry.js +0 -2
  769. package/dist/huibo-ui/p-8d615521.entry.js.map +0 -1
  770. package/dist/huibo-ui/p-953b9514.entry.js +0 -2
  771. package/dist/huibo-ui/p-953b9514.entry.js.map +0 -1
  772. package/dist/huibo-ui/p-965d4d02.entry.js +0 -2
  773. package/dist/huibo-ui/p-965d4d02.entry.js.map +0 -1
  774. package/dist/huibo-ui/p-ad6b0c6e.entry.js +0 -2
  775. package/dist/huibo-ui/p-ad6b0c6e.entry.js.map +0 -1
  776. package/dist/huibo-ui/p-c1a059d9.entry.js +0 -2
  777. package/dist/huibo-ui/p-c1a059d9.entry.js.map +0 -1
  778. package/dist/huibo-ui/p-c1b4eacb.entry.js.map +0 -1
  779. package/dist/huibo-ui/p-c3e665f6.entry.js.map +0 -1
  780. package/dist/huibo-ui/p-c3e8893d.entry.js.map +0 -1
  781. package/dist/huibo-ui/p-cc0aeb50.js +0 -2
  782. package/dist/huibo-ui/p-cc0aeb50.js.map +0 -1
  783. package/dist/huibo-ui/p-cf94cbf6.js +0 -2
  784. package/dist/huibo-ui/p-cf94cbf6.js.map +0 -1
  785. package/dist/huibo-ui/p-d3939d44.entry.js +0 -2
  786. package/dist/huibo-ui/p-d3939d44.entry.js.map +0 -1
  787. package/dist/huibo-ui/p-d64b91ef.entry.js.map +0 -1
  788. package/dist/huibo-ui/p-dd05cb2c.entry.js +0 -2
  789. package/dist/huibo-ui/p-dd05cb2c.entry.js.map +0 -1
  790. package/dist/huibo-ui/p-dfaf7e37.entry.js.map +0 -1
  791. package/dist/huibo-ui/p-e0ab9010.entry.js.map +0 -1
  792. package/dist/huibo-ui/p-e9490259.entry.js +0 -2
  793. package/dist/huibo-ui/p-e9490259.entry.js.map +0 -1
  794. package/dist/huibo-ui/p-ea74fcae.entry.js.map +0 -1
  795. package/dist/huibo-ui/p-ebd04656.entry.js +0 -2
  796. package/dist/huibo-ui/p-ebd04656.entry.js.map +0 -1
  797. package/dist/huibo-ui/p-ed0ff857.entry.js +0 -2
  798. package/dist/huibo-ui/p-ed0ff857.entry.js.map +0 -1
  799. package/dist/huibo-ui/p-f0ac7db5.entry.js +0 -2
  800. package/dist/huibo-ui/p-f0ac7db5.entry.js.map +0 -1
  801. package/dist/huibo-ui/p-f81ec512.entry.js.map +0 -1
  802. /package/dist/huibo-ui/{p-4d0dff15.entry.js.map → p-02f15843.entry.js.map} +0 -0
  803. /package/dist/huibo-ui/{p-f1c084c5.entry.js.map → p-0ddae4e9.entry.js.map} +0 -0
  804. /package/dist/huibo-ui/{p-6ac242fe.entry.js.map → p-14c3b47b.entry.js.map} +0 -0
  805. /package/dist/huibo-ui/{p-8c80a765.entry.js.map → p-15db24e9.entry.js.map} +0 -0
  806. /package/dist/huibo-ui/{p-8b027491.entry.js.map → p-193efdc0.entry.js.map} +0 -0
  807. /package/dist/huibo-ui/{p-8d925e3d.entry.js.map → p-1b0fbe69.entry.js.map} +0 -0
  808. /package/dist/huibo-ui/{p-f374d5a3.entry.js.map → p-20632186.entry.js.map} +0 -0
  809. /package/dist/huibo-ui/{p-e6f2d71d.entry.js.map → p-20fc554b.entry.js.map} +0 -0
  810. /package/dist/huibo-ui/{p-fd19813c.entry.js.map → p-2bcda1bb.entry.js.map} +0 -0
  811. /package/dist/huibo-ui/{p-e0768565.entry.js.map → p-3042f986.entry.js.map} +0 -0
  812. /package/dist/huibo-ui/{p-be48d2aa.entry.js.map → p-3dacb26b.entry.js.map} +0 -0
  813. /package/dist/huibo-ui/{p-6a1ec3ff.entry.js.map → p-3deff48c.entry.js.map} +0 -0
  814. /package/dist/huibo-ui/{p-c321c4aa.entry.js.map → p-412ff618.entry.js.map} +0 -0
  815. /package/dist/huibo-ui/{p-88127de1.entry.js.map → p-55cd13eb.entry.js.map} +0 -0
  816. /package/dist/huibo-ui/{p-58ebb9b3.entry.js.map → p-5c839288.entry.js.map} +0 -0
  817. /package/dist/huibo-ui/{p-a042e3d0.entry.js.map → p-6518c435.entry.js.map} +0 -0
  818. /package/dist/huibo-ui/{p-a0015341.entry.js.map → p-6bfeab80.entry.js.map} +0 -0
  819. /package/dist/huibo-ui/{p-8b1ae77e.entry.js.map → p-746a11a3.entry.js.map} +0 -0
  820. /package/dist/huibo-ui/{p-c922d672.entry.js.map → p-7a682c56.entry.js.map} +0 -0
  821. /package/dist/huibo-ui/{p-8c987d57.entry.js.map → p-7f65dc36.entry.js.map} +0 -0
  822. /package/dist/huibo-ui/{p-463de26d.entry.js.map → p-815fc943.entry.js.map} +0 -0
  823. /package/dist/huibo-ui/{p-d87fc21a.entry.js.map → p-88a6c905.entry.js.map} +0 -0
  824. /package/dist/huibo-ui/{p-77017274.entry.js.map → p-89be7973.entry.js.map} +0 -0
  825. /package/dist/huibo-ui/{p-9319c650.entry.js.map → p-950e7465.entry.js.map} +0 -0
  826. /package/dist/huibo-ui/{p-5df47135.entry.js.map → p-a190ca89.entry.js.map} +0 -0
  827. /package/dist/huibo-ui/{p-477d8568.entry.js.map → p-aeae83af.entry.js.map} +0 -0
  828. /package/dist/huibo-ui/{p-b489a526.entry.js.map → p-b06c8020.entry.js.map} +0 -0
  829. /package/dist/huibo-ui/{p-e2a8a396.entry.js.map → p-b6afe81e.entry.js.map} +0 -0
  830. /package/dist/huibo-ui/{p-2b286698.entry.js.map → p-b7885d4a.entry.js.map} +0 -0
  831. /package/dist/huibo-ui/{p-10c088f3.entry.js.map → p-d9c7c378.entry.js.map} +0 -0
  832. /package/dist/huibo-ui/{p-332c8877.entry.js.map → p-dd9c6459.entry.js.map} +0 -0
  833. /package/dist/huibo-ui/{p-80aca641.entry.js.map → p-dfccc7aa.entry.js.map} +0 -0
  834. /package/dist/huibo-ui/{p-21682e92.entry.js.map → p-dfd144d8.entry.js.map} +0 -0
  835. /package/dist/huibo-ui/{p-079a4130.entry.js.map → p-e3155cd7.entry.js.map} +0 -0
  836. /package/dist/huibo-ui/{p-d7815b4f.entry.js.map → p-e9e7abca.entry.js.map} +0 -0
  837. /package/dist/huibo-ui/{p-2e6584ea.entry.js.map → p-f1f2483f.entry.js.map} +0 -0
  838. /package/dist/huibo-ui/{p-465dcb4c.entry.js.map → p-f2c78699.entry.js.map} +0 -0
  839. /package/dist/huibo-ui/{p-4d8b1404.entry.js.map → p-fd6831f9.entry.js.map} +0 -0
@@ -7,6 +7,15 @@
7
7
  */
8
8
  /** 判定按键是否为「激活」键(Enter / Space),用于自定义可聚焦元素的点击替代 */
9
9
  export declare function isActivationKey(key: string | undefined): boolean;
10
+ /**
11
+ * 生成一个 keydown 处理器:当按下激活键(Enter/Space)时触发元素 click。
12
+ * 用于给 `role="button"` 的 `<span>`/`<div>` 补齐键盘可达性(A3)。
13
+ *
14
+ * 用法:`onKeyDown={activationClickHandler}`
15
+ * 它会读 `event.currentTarget`(即绑定 onKeyDown 的元素)并调 .click(),
16
+ * 并 preventDefault 避免空格滚动页面。
17
+ */
18
+ export declare function activationClickHandler(e: KeyboardEvent): void;
10
19
  export declare function getFocusableElements(container: HTMLElement): HTMLElement[];
11
20
  /** 焦点陷阱选项 */
12
21
  export interface FocusTrapOptions {
@@ -11,7 +11,7 @@ export interface CalendarDay {
11
11
  /** 判断两个日期是否为同一天 */
12
12
  export declare function isSameDay(date1: Date, date2: Date): boolean;
13
13
  /** 生成 42 天(6 周)的日历网格数据 */
14
- export declare function getCalendarDays(viewDate: Date, selectedDate?: Date, today?: Date): CalendarDay[];
14
+ export declare function getCalendarDays(viewDate: Date, selectedDate?: Date, today?: Date, firstDayOfWeek?: number): CalendarDay[];
15
15
  /**
16
16
  * 格式化日期为指定格式字符串
17
17
  * 支持:YYYY, MM, DD, HH, mm, ss
@@ -0,0 +1,27 @@
1
+ /**
2
+ * 弹层进出场动画编排工具
3
+ *
4
+ * 问题背景:Stencil 声明式渲染里 `{visible && <El/>}` 会在关闭瞬间卸载 DOM,
5
+ * CSS 离场动画没机会播放——出现"打开有动画、关闭瞬间消失"的体验缺陷。
6
+ *
7
+ * 方案:组件维护一个 `leaving` state,关闭时先设 leaving=true 播放离场动画,
8
+ * 动画时长(默认 200ms)后再 leaving=false 真正卸载。`shouldRender = visible || leaving`。
9
+ *
10
+ * 用法(在组件里):
11
+ * ```ts
12
+ * private leave = createLeaveScheduler(() => this.leaving, (v) => this.leaving = v, 200);
13
+ * // visible 变 false 时:this.leave.start(() => 真正关闭的清理);
14
+ * // render 里:{this.shouldRender && <El class={{ '--leaving': this.leaving }}/>}
15
+ * ```
16
+ */
17
+ export type LeavingSetter = (leaving: boolean) => void;
18
+ export type LeavingGetter = () => boolean;
19
+ export interface LeaveScheduler {
20
+ /** 开始离场:设 leaving=true,duration 后回调 onDone 并 leaving=false */
21
+ start(onDone?: () => void): void;
22
+ /** 取消挂起的离场(用于关闭中途又打开的场景) */
23
+ cancel(): void;
24
+ /** disconnectedCallback 时调用,避免组件卸载后还在 setState */
25
+ dispose(): void;
26
+ }
27
+ export declare function createLeaveScheduler(getLeaving: LeavingGetter, setLeaving: LeavingSetter, duration?: number): LeaveScheduler;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "huibo-ui",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "description": "Stencil Component Starter",
6
6
  "main": "dist/index.cjs.js",
@@ -32,7 +32,11 @@
32
32
  },
33
33
  "repository": {
34
34
  "type": "git",
35
- "url": "https://github.com/stenciljs/component-starter.git"
35
+ "url": "http://192.168.0.20:3000/web-components/huibo-ui.git"
36
+ },
37
+ "publishConfig": {
38
+ "access": "public",
39
+ "registry": "https://registry.npmjs.org/"
36
40
  },
37
41
  "files": [
38
42
  "dist/",
@@ -64,6 +68,7 @@
64
68
  "jest": "^29.7.0",
65
69
  "jest-cli": "^29.7.0",
66
70
  "lint-staged": "^17.0.7",
71
+ "prettier": "^3.8.4",
67
72
  "puppeteer": "^24.3.0",
68
73
  "react": "^19.2.7",
69
74
  "react-dom": "^19.2.7",
@@ -85,6 +90,7 @@
85
90
  "docs:dev": "vitepress dev docs",
86
91
  "docs:build": "vitepress build docs",
87
92
  "docs:preview": "vitepress preview docs",
93
+ "docs:deploy": "bash scripts/deploy-docs.sh",
88
94
  "changeset": "changeset",
89
95
  "version": "changeset version",
90
96
  "release": "changeset publish",
package/readme.md CHANGED
@@ -1,111 +1,126 @@
1
- [![Built With Stencil](https://img.shields.io/badge/-Built%20With%20Stencil-16161d.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI%2BCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI%2BCgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU%2BCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MjQuNywzNzMuOWMwLDM3LjYtNTUuMSw2OC42LTkyLjcsNjguNkgxODAuNGMtMzcuOSwwLTkyLjctMzAuNy05Mi43LTY4LjZ2LTMuNmgzMzYuOVYzNzMuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTQyNC43LDI5Mi4xSDE4MC40Yy0zNy42LDAtOTIuNy0zMS05Mi43LTY4LjZ2LTMuNkgzMzJjMzcuNiwwLDkyLjcsMzEsOTIuNyw2OC42VjI5Mi4xeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNDI0LjcsMTQxLjdIODcuN3YtMy42YzAtMzcuNiw1NC44LTY4LjYsOTIuNy02OC42SDMzMmMzNy45LDAsOTIuNywzMC43LDkyLjcsNjguNlYxNDEuN3oiLz4KPC9zdmc%2BCg%3D%3D&colorA=16161d&style=flat-square)](https://stenciljs.com)
1
+ # huibo-ui
2
2
 
3
- # Stencil Component Starter
3
+ > 面向企业级后台管理系统的 Web Components 组件库 —— 框架无关,一处编写,React / Vue / Angular / 原生皆可用。
4
4
 
5
- > This is a starter project for building a standalone Web Components using Stencil.
5
+ [![npm version](https://img.shields.io/npm/v/huibo-ui.svg)](https://www.npmjs.com/package/huibo-ui)
6
+ [![npm](https://img.shields.io/npm/v/@huibo-ui/react.svg?label=%40huibo-ui%2Freact)](https://www.npmjs.com/package/@huibo-ui/react)
7
+ [![license](https://img.shields.io/badge/license-MIT-blue.svg)](#license)
8
+ [![coverage](https://img.shields.io/badge/coverage-91%25-brightgreen.svg)](#质量)
6
9
 
7
- Stencil is a compiler for building fast web apps using Web Components.
10
+ huibo-ui 基于 [Stencil.js](https://stenciljs.com/) 构建,所有组件以**原生 Custom Elements**形式输出(标签前缀 `hb-`,命名空间 `huibo-ui`),可被任意前端框架直接使用。同时通过 [`@huibo-ui/react`](./packages/react) 提供一等 React 支持(自动生成包装组件 + 类型)。API 设计参照 Ant Design,以降低团队现有 10+ 个 React + AntD 后台的迁移成本。
8
11
 
9
- Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than runtime tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements specification.
12
+ ## 为什么用 huibo-ui
10
13
 
11
- Stencil components are just Web Components, so they work in any major framework or with no framework at all.
14
+ - **框架无关**:组件编译为标准 Web Components,React、Vue、Angular、原生项目都能直接用,不绑定技术栈。
15
+ - **平替 Ant Design**:覆盖 73 个组件(表单、布局、数据展示、导航、反馈),API 风格对齐 AntD,迁移成本低。
16
+ - **主题系统**:三层设计令牌(原始 → 语义 → 组件级)+ 暗色模式,198+ 个 `--hb-*` CSS 变量,按需定制。
17
+ - **样式隔离**:Shadow DOM 天然隔离,可与 AntD 等 UI 库共存、渐进迁移。
18
+ - **体积可控**:单组件 < 10KB gzip,支持按需引入。
12
19
 
13
- ## Getting Started
14
-
15
- To start building a new web component using Stencil, clone this repo to a new directory:
20
+ ## 安装
16
21
 
17
22
  ```bash
18
- git clone https://github.com/stenciljs/component-starter.git my-component
19
- cd my-component
20
- git remote rm origin
23
+ # 基础组件库(任意框架)
24
+ npm install huibo-ui
25
+ # React 包装
26
+ npm install @huibo-ui/react huibo-ui
21
27
  ```
22
28
 
23
- and run:
24
-
25
- ```bash
26
- npm install
27
- npm start
28
- ```
29
+ ## 快速开始
29
30
 
30
- To build the component for production, run:
31
+ ### React
31
32
 
32
- ```bash
33
- npm run build
34
- ```
35
-
36
- To run the unit tests for the components, run:
37
-
38
- ```bash
39
- npm test
33
+ ```tsx
34
+ import { HbButton, HbInput, HbTable } from '@huibo-ui/react';
35
+ // 1) 注册 hb-* 自定义元素(打包器场景用 components 包,不要用 loader)
36
+ import 'huibo-ui/components/hb-button';
37
+ import 'huibo-ui/components/hb-input';
38
+ import 'huibo-ui/components/hb-table';
39
+ // 2) 导入全局设计令牌(一次即可,否则组件无主题色/背景)
40
+ import 'huibo-ui/styles.css';
41
+
42
+ export default function App() {
43
+ return <HbButton type="primary">确定</HbButton>;
44
+ }
40
45
  ```
41
46
 
42
- Need help? Check out our docs [here](https://stenciljs.com/docs/my-first-component).
47
+ > ⚠️ 打包器(Vite/webpack/Next)场景必须用 `huibo-ui/components/hb-*` 注册组件、`huibo-ui/styles.css` 注入令牌;`huibo-ui/loader`(懒加载)仅用于 CDN / `<script>` 标签场景。详见 [React 接入指南](./docs/guide/react.md)
43
48
 
44
- ## Naming Components
49
+ ### Vue / Angular / 原生
45
50
 
46
- When creating new component tags, we recommend _not_ using `stencil` in the component name (ex: `<stencil-datepicker>`). This is because the generated component has little to nothing to do with Stencil; it's just a web component!
51
+ ```html
52
+ <script type="module">
53
+ // 注册 + 注入令牌
54
+ import 'huibo-ui/components/hb-button';
55
+ import 'huibo-ui/styles.css';
56
+ </script>
47
57
 
48
- Instead, use a prefix that fits your company or any name for a group of related components. For example, all of the [Ionic-generated](https://ionicframework.com/) web components use the prefix `ion`.
58
+ <hb-button type="primary">确定</hb-button>
59
+ ```
49
60
 
50
- ## Using this component
61
+ ## 文档
51
62
 
52
- There are two strategies we recommend for using web components built with Stencil.
63
+ - **文档站(VitePress)**:`pnpm docs:dev` 启动本地(`pnpm docs:build` 生成静态站可部署)。
64
+ - [快速开始](./docs/guide/getting-started.md) · [React 接入](./docs/guide/react.md) · [主题定制](./docs/guide/theming.md) · [从 AntD 迁移](./docs/guide/migration.md)
65
+ - **ROADMAP**:[ROADMAP_v2.md](./ROADMAP_v2.md)(5 个 Phase、73 组件、覆盖率 91%、跨浏览器验证等进度)。
53
66
 
54
- The first step for all two of these strategies is to [publish to NPM](https://docs.npmjs.com/getting-started/publishing-npm-packages).
67
+ ## 组件总览
55
68
 
56
- You can read more about these different approaches in the [Stencil docs](https://stenciljs.com/docs/publishing).
69
+ 覆盖 73 个组件,分组如下(详见文档站 / 迁移指南映射表):
57
70
 
58
- ### Lazy Loading
71
+ - **表单输入**:Button、Input、InputNumber、InputTag、Select、Cascader、Checkbox、Radio、Switch、Slider、Rate、DatePicker、DateTimePicker、DatePickerPane、TimePicker、TimeSelect、ColorPicker、ColorPickerPanel、Upload、Form、FormItem
72
+ - **数据展示**:Table(虚拟滚动/树形/行内编辑/排序/选择)、Tree、TreeSelect、Transfer、Tag、Badge、Avatar、Card、Collapse、Descriptions、Statistic、Timeline、Progress、Skeleton、Result、Empty、Image、ImagePreview
73
+ - **导航**:Menu、Tabs、Breadcrumb、Steps、Pagination、Segmented、Anchor、PageHeader、Backtop、Affix、FloatButton
74
+ - **布局**:Layout、Container、Header、Aside、Main、Footer、Row、Col、Space、Divider、Scrollbar
75
+ - **反馈/弹出**:Dialog、Drawer、Message、Notification、Tooltip、Popover、Popconfirm、Dropdown、Popconfirm、Alert、Loading、Tour、Carousel
76
+ - **其他**:Icon、Text、Link、ConfigProvider、Calendar、Watermark
59
77
 
60
- If your Stencil project is built with the [`dist`](https://stenciljs.com/docs/distribution) output target, you can import a small bootstrap script that registers all components and allows you to load individual component scripts lazily.
78
+ ## 主题
61
79
 
62
- For example, given your Stencil project namespace is called `my-design-system`, to use `my-component` on any website, inject this into your HTML:
80
+ 令牌分四层,组件只引用语义层,便于全局换肤:
63
81
 
64
- ```html
65
- <script type="module" src="https://unpkg.com/my-design-system"></script>
66
- <!--
67
- To avoid unpkg.com redirects to the actual file, you can also directly import:
68
- https://unpkg.com/foobar-design-system@0.0.1/dist/foobar-design-system/foobar-design-system.esm.js
69
- -->
70
- <my-component first="Stencil" middle="'Don't call me a framework'" last="JS"></my-component>
82
+ ```
83
+ tokens/
84
+ primitives.css 原始色值/字号/间距(组件不直接引用)
85
+ semantic.css --hb-color-primary、--hb-color-text
86
+ components.css --hb-button-primary-bg 等组件级覆盖
87
+ dark.css [data-theme="dark"] 暗色覆盖
71
88
  ```
72
89
 
73
- This will only load the necessary scripts needed to render `<my-component />`. Once more components of this package are used, they will automatically be loaded lazily.
90
+ 暗色:在根元素加 `data-theme="dark"` 即可。
74
91
 
75
- You can also import the script as part of your `node_modules` in your applications entry file:
92
+ ## 开发
76
93
 
77
- ```tsx
78
- import 'foobar-design-system/dist/foobar-design-system/foobar-design-system.esm.js';
94
+ ```bash
95
+ pnpm install # 安装依赖
96
+ pnpm start # 开发模式(构建 + watch + serve,http://localhost:3333)
97
+ pnpm run build # 生产构建
98
+ pnpm test # 单元 + e2e 测试
99
+ pnpm run docs:dev # 文档站开发
100
+ pnpm run docs:build # 文档站构建
101
+ pnpm smoke:cross-browser # 跨浏览器冒烟(Chromium+Firefox+WebKit,需 npx playwright install)
79
102
  ```
80
103
 
81
- Check out this [Live Demo](https://stackblitz.com/edit/vitejs-vite-y6v26a?file=src%2Fmain.tsx).
104
+ - 技术栈:Stencil.js v4 + TypeScript + TailwindCSS v4 + Jest/Puppeteer + VitePress。
105
+ - 三大质量门:`tsc --noEmit` 0 错误 / `pnpm run build` / `pnpm test --ci`(961 测试,行覆盖率 91%)。
106
+ - 组件目录约定:`src/components/<Name>/<Name>.tsx` + `<name>.css` + `readme.md`(自动生成)。
82
107
 
83
- ### Standalone
108
+ ## 质量门与状态
84
109
 
85
- If you are using a Stencil component library with `dist-custom-elements`, we recommend importing Stencil components individually in those files where they are needed.
110
+ - 组件数:73(覆盖 TIER 1–4,详见 ROADMAP)。
111
+ - 测试:79 个 spec 套件 / 961 个用例,行覆盖率 **91.34%**。
112
+ - 性能:单组件 < 10KB gzip,Table 8.9KB。
113
+ - 跨浏览器:Chromium + Firefox + WebKit 冒烟通过。
114
+ - React 集成:试点 demo(`examples/react-crud`)CRUD + 表单校验端到端验证通过;AntD 共存示例(`examples/antd-coexistence`)验证可渐进迁移。
86
115
 
87
- To export Stencil components as standalone components make sure you have the [`dist-custom-elements`](https://stenciljs.com/docs/custom-elements) output target defined in your `stencil.config.ts`.
116
+ ## AntD 迁移
88
117
 
89
- For example, given you'd like to use `<my-component />` as part of a React component, you can import the component directly via:
118
+ 提供 [迁移指南](./docs/guide/migration.md)(73 组件映射表 + 代码对照)与 **codemod**(自动改 import / JSX 标签 / 关键 prop):
90
119
 
91
- ```tsx
92
- import 'foobar-design-system/my-component';
93
-
94
- function App() {
95
- return (
96
- <>
97
- <div>
98
- <my-component
99
- first="Stencil"
100
- middle="'Don't call me a framework'"
101
- last="JS"
102
- ></my-component>
103
- </div>
104
- </>
105
- );
106
- }
107
-
108
- export default App;
120
+ ```bash
121
+ node tools/migrate-from-antd.mjs <你的源码目录或文件>
109
122
  ```
110
123
 
111
- Check out this [Live Demo](https://stackblitz.com/edit/vitejs-vite-b6zuds?file=src%2FApp.tsx).
124
+ ## License
125
+
126
+ [MIT](./LICENSE) © huibo-ui
@@ -1 +0,0 @@
1
- {"file":"a11y-802de67a.js","mappings":";;AAAA;;;;;;;AAQA;SACgB,eAAe,CAAC,GAAuB;IACrD,OAAO,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,UAAU,CAAC;AAC9D,CAAC;AAED;AACA,MAAM,kBAAkB,GAA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S,IAAI,SAAS,CAAC;IAC7D,MAAM,MAAM,GAAG,CAAC,GAAW,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC;IAE1E,QAAQ,KAAK,CAAC,GAAG;QACf,KAAK,WAAW,CAAC;QACjB,KAAK,YAAY;YACf,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,GAAG,KAAK,CAAC,WAAW,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC;QAC9F,KAAK,SAAS,CAAC;QACf,KAAK,WAAW;YACd,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,GAAG,KAAK,CAAC,WAAW,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC;QAC9F,KAAK,MAAM;YACT,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QACxC,KAAK,KAAK;YACR,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,GAAG,CAAC,EAAE,CAAC;QACpD,KAAK,OAAO,CAAC;QACb,KAAK,GAAG,CAAC;QACT,KAAK,UAAU;YACb,OAAO,WAAW,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QACtF,KAAK,QAAQ;YACX,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAC3B;YACE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;KAC3B;AACH;;;;;;","names":[],"sources":["src/utils/a11y.ts"],"sourcesContent":["/**\n * 无障碍(a11y)工具集\n * 统一 ARIA 属性辅助、焦点陷阱、列表键盘导航等在交互组件(Dialog / Drawer / Menu /\n * Dropdown / Select 等)中重复出现且容易写错的可访问性逻辑。\n *\n * 参考标准:WAI-ARIA Authoring Practices 1.2。\n */\n\n/** 判定按键是否为「激活」键(Enter / Space),用于自定义可聚焦元素的点击替代 */\nexport function isActivationKey(key: string | undefined): boolean {\n return key === 'Enter' || key === ' ' || key === 'Spacebar';\n}\n\n/** 查询容器内可聚焦的元素顺序(tabindex >= 0 的语义元素) */\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'button:not([disabled])',\n 'textarea:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n '[contenteditable=\"true\"]',\n].join(',');\n\nexport function getFocusableElements(container: HTMLElement): HTMLElement[] {\n return Array.from(container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR)).filter(\n (el) => el.getAttribute('aria-hidden') !== 'true' && el.style.display !== 'none',\n );\n}\n\n/** 焦点陷阱选项 */\nexport interface FocusTrapOptions {\n /** 焦点受限的容器元素 */\n container: HTMLElement;\n /** 打开时是否自动聚焦容器内首个可聚焦元素 */\n autoFocus?: boolean;\n /** 容器激活前的元素(用于关闭时归还焦点) */\n returnFocusTo?: HTMLElement | null;\n}\n\n/** 焦点陷阱句柄 */\nexport interface FocusTrap {\n /** 启用:绑定 Tab 拦截,可选自动聚焦 */\n connect: () => void;\n /** 关闭:解除拦截,归还焦点 */\n disconnect: () => void;\n}\n\n/**\n * 创建焦点陷阱(Dialog / Drawer 打开时把 Tab 循环限制在容器内)。\n * 关键点:Tab 与 Shift+Tab 在容器边界时回环到另一端,防止焦点逃逸到背景。\n * 返回句柄,组件在打开时 connect()、关闭时 disconnect()。\n */\nexport function createFocusTrap(options: FocusTrapOptions): FocusTrap {\n const { container, autoFocus = true, returnFocusTo } = options;\n let active = false;\n let previouslyFocused: HTMLElement | null = null;\n\n const handleKeydown = (e: KeyboardEvent) => {\n if (e.key !== 'Tab') return;\n const focusable = getFocusableElements(container);\n if (focusable.length === 0) {\n e.preventDefault();\n container.focus();\n return;\n }\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n const activeEl = document.activeElement;\n\n if (e.shiftKey) {\n if (activeEl === first || !container.contains(activeEl)) {\n e.preventDefault();\n last.focus();\n }\n } else {\n if (activeEl === last) {\n e.preventDefault();\n first.focus();\n }\n }\n };\n\n const connect = () => {\n if (active) return;\n active = true;\n previouslyFocused = (returnFocusTo ?? document.activeElement) as HTMLElement | null;\n container.addEventListener('keydown', handleKeydown);\n if (autoFocus) {\n const focusable = getFocusableElements(container);\n (focusable[0] ?? container).focus();\n }\n };\n\n const disconnect = () => {\n if (!active) return;\n active = false;\n container.removeEventListener('keydown', handleKeydown);\n if (previouslyFocused && typeof previouslyFocused.focus === 'function') {\n previouslyFocused.focus();\n }\n previouslyFocused = null;\n };\n\n return { connect, disconnect };\n}\n\n/** 列表键盘导航产生的动作 */\nexport type ListKeyAction =\n | { type: 'navigate'; index: number }\n | { type: 'select'; index: number }\n | { type: 'close' }\n | { type: 'none' };\n\n/** 列表键盘导航参数 */\nexport interface ListKeyboardOptions {\n /** 当前高亮项索引(-1 表示无高亮) */\n activeIndex: number;\n /** 列表项总数 */\n itemCount: number;\n /** 是否允许循环(首尾跳转) */\n loop?: boolean;\n}\n\n/**\n * 列表 / 菜单 / 下拉选项的键盘导航核心逻辑(listbox / menu / combobox 通用)。\n * 返回应执行的动作,由调用方据此更新 activeIndex / 触发选中 / 关闭。\n *\n * 支持:ArrowDown/ArrowUp(竖排)/ArrowRight/ArrowLeft(横排)移动、Home/End 跳首尾、\n * Enter/Space 选中、Escape 关闭。\n */\nexport function handleListKeyboard(event: KeyboardEvent, options: ListKeyboardOptions): ListKeyAction {\n const { activeIndex, itemCount, loop = true } = options;\n if (itemCount <= 0) return { type: 'none' };\n\n const clamp = (idx: number) => (idx + itemCount) % itemCount;\n const within = (idx: number) => Math.max(0, Math.min(idx, itemCount - 1));\n\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowRight':\n return { type: 'navigate', index: loop ? clamp(activeIndex + 1) : within(activeIndex + 1) };\n case 'ArrowUp':\n case 'ArrowLeft':\n return { type: 'navigate', index: loop ? clamp(activeIndex - 1) : within(activeIndex - 1) };\n case 'Home':\n return { type: 'navigate', index: 0 };\n case 'End':\n return { type: 'navigate', index: itemCount - 1 };\n case 'Enter':\n case ' ':\n case 'Spacebar':\n return activeIndex >= 0 ? { type: 'select', index: activeIndex } : { type: 'none' };\n case 'Escape':\n return { type: 'close' };\n default:\n return { type: 'none' };\n }\n}\n\n/**\n * 为元素批量设置 ARIA 属性(不可变:返回新映射,但直接操作 DOM 属性是 a11y 的固有需求)。\n * 组件挂载后调用一次即可,避免每次 render 重复写 setAttribute。\n */\nexport function applyAria(el: HTMLElement, attrs: Record<string, string | boolean | undefined>): void {\n Object.entries(attrs).forEach(([key, value]) => {\n if (value === undefined || value === null) {\n el.removeAttribute(`aria-${key}`);\n } else {\n el.setAttribute(`aria-${key}`, String(value));\n }\n });\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"date-helpers-904747ff.js","mappings":";;AAAA;;;;AAYA;SACgB,SAAS,CAAC,KAAW,EAAE,KAAW;IAChD,QACE,KAAK,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,WAAW,EAAE;QAC3C,KAAK,CAAC,QAAQ,EAAE,KAAK,KAAK,CAAC,QAAQ,EAAE;QACrC,KAAK,CAAC,OAAO,EAAE,KAAK,KAAK,CAAC,OAAO,EAAE,EACnC;AACJ,CAAC;AAED;SACgB,eAAe,CAC7B,QAAc,EACd,YAAmB,EACnB,QAAc,IAAI,IAAI,EAAE;IAExB,MAAM,IAAI,GAAkB,EAAE,CAAC;IAC/B,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IACpC,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAElC,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,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,EAAE,EAAE;QAC3B,MAAM,CAAC,GAAG,UAAU,GAAG,CAAC,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC;YACT,IAAI,EAAE,CAAC;YACP,kBAAkB,EAAE,CAAC,KAAK,IAAI;YAC9B,UAAU,EAAE,CAAC,CAAC,YAAY,IAAI,YAAY,CAAC,WAAW,EAAE,KAAK,CAAC;SAC/D,CAAC,CAAC;KACJ;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;SACgB,iBAAiB,CAAC,QAAc;IAC9C,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IACpC,OAAO,IAAI,IAAI,IAAI,GAAG,EAAE,CAAC,CAAC;AAC5B,CAAC;AAED;MACa,WAAW,GAAG;IACzB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAClC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK;EACpC;AAEF;MACa,cAAc,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;;;;;;;;;;;;;","names":[],"sources":["src/utils/date-helpers.ts"],"sourcesContent":["/**\n * 日历和日期工具函数\n * 从 DatePicker / DateTimePicker / DatePickerPane 中提取的共享逻辑\n */\n\nexport interface CalendarDay {\n date: Date;\n isCurrentMonth: boolean;\n isToday: boolean;\n isSelected: boolean;\n}\n\n/** 判断两个日期是否为同一天 */\nexport function isSameDay(date1: Date, date2: Date): boolean {\n return (\n date1.getFullYear() === date2.getFullYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate()\n );\n}\n\n/** 生成 42 天(6 周)的日历网格数据 */\nexport function getCalendarDays(\n viewDate: Date,\n selectedDate?: Date,\n today: Date = new Date()\n): CalendarDay[] {\n const days: CalendarDay[] = [];\n const year = viewDate.getFullYear();\n const month = viewDate.getMonth();\n\n const firstDay = new Date(year, month, 1);\n const lastDay = new Date(year, month + 1, 0);\n const firstDayWeek = firstDay.getDay();\n const daysInMonth = lastDay.getDate();\n\n // 上月填充\n const prevMonth = new Date(year, month - 1, 0);\n for (let i = firstDayWeek - 1; i >= 0; i--) {\n const date = new Date(year, month - 1, prevMonth.getDate() - i);\n days.push({\n date,\n isCurrentMonth: false,\n isToday: isSameDay(date, today),\n isSelected: !!selectedDate && isSameDay(date, selectedDate),\n });\n }\n\n // 当月日期\n for (let i = 1; i <= daysInMonth; i++) {\n const date = new Date(year, month, i);\n days.push({\n date,\n isCurrentMonth: true,\n isToday: isSameDay(date, today),\n isSelected: !!selectedDate && isSameDay(date, selectedDate),\n });\n }\n\n // 下月填充(补齐 42 天)\n const remainingDays = 42 - days.length;\n for (let i = 1; i <= remainingDays; i++) {\n const date = new Date(year, month + 1, i);\n days.push({\n date,\n isCurrentMonth: false,\n isToday: isSameDay(date, today),\n isSelected: !!selectedDate && isSameDay(date, selectedDate),\n });\n }\n\n return days;\n}\n\n/**\n * 格式化日期为指定格式字符串\n * 支持:YYYY, MM, DD, HH, mm, ss\n */\nexport function formatDate(date: Date, format: string): string {\n const year = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const day = String(date.getDate()).padStart(2, '0');\n const hours = String(date.getHours()).padStart(2, '0');\n const minutes = String(date.getMinutes()).padStart(2, '0');\n const seconds = String(date.getSeconds()).padStart(2, '0');\n\n return format\n .replace('YYYY', String(year))\n .replace('MM', month)\n .replace('DD', day)\n .replace('HH', hours)\n .replace('mm', minutes)\n .replace('ss', seconds);\n}\n\n/** 安全解析日期值 */\nexport function parseDate(value: string | Date | undefined): Date | undefined {\n if (!value) return undefined;\n const date = value instanceof Date ? value : new Date(value);\n if (isNaN(date.getTime())) return undefined;\n return date;\n}\n\n/** 月份偏移,返回新日期对象(不可变) */\nexport function addMonths(date: Date, delta: number): Date {\n const result = new Date(date);\n result.setMonth(result.getMonth() + delta);\n return result;\n}\n\n/** 年份偏移,返回新日期对象(不可变) */\nexport function addYears(date: Date, delta: number): Date {\n const result = new Date(date);\n result.setFullYear(result.getFullYear() + delta);\n return result;\n}\n\n/**\n * 生成 years 视图的 12 年档数据(每档 12 年)。\n * 以 viewDate 所在年份向下取整到 12 的倍数作为起点。\n */\nexport interface CalendarYear {\n year: number;\n isCurrentYearRange: boolean;\n isSelected: boolean;\n}\n\nexport function getCalendarYears(\n viewDate: Date,\n selectedDate?: Date,\n startYearBase?: number\n): CalendarYear[] {\n const year = viewDate.getFullYear();\n const rangeStart = startYearBase ?? year - (year % 12);\n const years: CalendarYear[] = [];\n for (let i = 0; i < 12; i++) {\n const y = rangeStart + i;\n years.push({\n year: y,\n isCurrentYearRange: y === year,\n isSelected: !!selectedDate && selectedDate.getFullYear() === y,\n });\n }\n return years;\n}\n\n/** 获取 years 视图标题所显示的年份档区间起点 */\nexport function getYearRangeStart(viewDate: Date): number {\n const year = viewDate.getFullYear();\n return year - (year % 12);\n}\n\n/** 中文月份名称 */\nexport const MONTH_NAMES = [\n '一月', '二月', '三月', '四月', '五月', '六月',\n '七月', '八月', '九月', '十月', '十一月', '十二月',\n];\n\n/** 中文星期名称 */\nexport const WEEK_DAY_NAMES = ['日', '一', '二', '三', '四', '五', '六'];\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"p-cc0aeb50.js","mappings":"AAAA;;;;;;;AAQA;SACgB,eAAe,CAAC,GAAuB;IACrD,OAAO,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,UAAU,CAAC;AAC9D,CAAC;AAED;AACA,MAAM,kBAAkB,GAAG;IACzB,SAAS;IACT,wBAAwB;IACxB,0BAA0B;IAC1B,uBAAuB;IACvB,wBAAwB;IACxB,iCAAiC;IACjC,0BAA0B;CAC3B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAEI,oBAAoB,CAAC,SAAsB;IACzD,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,gBAA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C;QACjB,KAAK,YAAY;YACf,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,GAAG,KAAK,CAAC,WAAW,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC;QAC9F,KAAK,SAAS,CAAC;QACf,KAAK,WAAW;YACd,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,GAAG,KAAK,CAAC,WAAW,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC;QAC9F,KAAK,MAAM;YACT,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QACxC,KAAK,KAAK;YACR,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,GAAG,CAAC,EAAE,CAAC;QACpD,KAAK,OAAO,CAAC;QACb,KAAK,GAAG,CAAC;QACT,KAAK,UAAU;YACb,OAAO,WAAW,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QACtF,KAAK,QAAQ;YACX,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAC3B;YACE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;KAC3B;AACH;;;;","names":[],"sources":["src/utils/a11y.ts"],"sourcesContent":["/**\n * 无障碍(a11y)工具集\n * 统一 ARIA 属性辅助、焦点陷阱、列表键盘导航等在交互组件(Dialog / Drawer / Menu /\n * Dropdown / Select 等)中重复出现且容易写错的可访问性逻辑。\n *\n * 参考标准:WAI-ARIA Authoring Practices 1.2。\n */\n\n/** 判定按键是否为「激活」键(Enter / Space),用于自定义可聚焦元素的点击替代 */\nexport function isActivationKey(key: string | undefined): boolean {\n return key === 'Enter' || key === ' ' || key === 'Spacebar';\n}\n\n/** 查询容器内可聚焦的元素顺序(tabindex >= 0 的语义元素) */\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'button:not([disabled])',\n 'textarea:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n '[contenteditable=\"true\"]',\n].join(',');\n\nexport function getFocusableElements(container: HTMLElement): HTMLElement[] {\n return Array.from(container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR)).filter(\n (el) => el.getAttribute('aria-hidden') !== 'true' && el.style.display !== 'none',\n );\n}\n\n/** 焦点陷阱选项 */\nexport interface FocusTrapOptions {\n /** 焦点受限的容器元素 */\n container: HTMLElement;\n /** 打开时是否自动聚焦容器内首个可聚焦元素 */\n autoFocus?: boolean;\n /** 容器激活前的元素(用于关闭时归还焦点) */\n returnFocusTo?: HTMLElement | null;\n}\n\n/** 焦点陷阱句柄 */\nexport interface FocusTrap {\n /** 启用:绑定 Tab 拦截,可选自动聚焦 */\n connect: () => void;\n /** 关闭:解除拦截,归还焦点 */\n disconnect: () => void;\n}\n\n/**\n * 创建焦点陷阱(Dialog / Drawer 打开时把 Tab 循环限制在容器内)。\n * 关键点:Tab 与 Shift+Tab 在容器边界时回环到另一端,防止焦点逃逸到背景。\n * 返回句柄,组件在打开时 connect()、关闭时 disconnect()。\n */\nexport function createFocusTrap(options: FocusTrapOptions): FocusTrap {\n const { container, autoFocus = true, returnFocusTo } = options;\n let active = false;\n let previouslyFocused: HTMLElement | null = null;\n\n const handleKeydown = (e: KeyboardEvent) => {\n if (e.key !== 'Tab') return;\n const focusable = getFocusableElements(container);\n if (focusable.length === 0) {\n e.preventDefault();\n container.focus();\n return;\n }\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n const activeEl = document.activeElement;\n\n if (e.shiftKey) {\n if (activeEl === first || !container.contains(activeEl)) {\n e.preventDefault();\n last.focus();\n }\n } else {\n if (activeEl === last) {\n e.preventDefault();\n first.focus();\n }\n }\n };\n\n const connect = () => {\n if (active) return;\n active = true;\n previouslyFocused = (returnFocusTo ?? document.activeElement) as HTMLElement | null;\n container.addEventListener('keydown', handleKeydown);\n if (autoFocus) {\n const focusable = getFocusableElements(container);\n (focusable[0] ?? container).focus();\n }\n };\n\n const disconnect = () => {\n if (!active) return;\n active = false;\n container.removeEventListener('keydown', handleKeydown);\n if (previouslyFocused && typeof previouslyFocused.focus === 'function') {\n previouslyFocused.focus();\n }\n previouslyFocused = null;\n };\n\n return { connect, disconnect };\n}\n\n/** 列表键盘导航产生的动作 */\nexport type ListKeyAction =\n | { type: 'navigate'; index: number }\n | { type: 'select'; index: number }\n | { type: 'close' }\n | { type: 'none' };\n\n/** 列表键盘导航参数 */\nexport interface ListKeyboardOptions {\n /** 当前高亮项索引(-1 表示无高亮) */\n activeIndex: number;\n /** 列表项总数 */\n itemCount: number;\n /** 是否允许循环(首尾跳转) */\n loop?: boolean;\n}\n\n/**\n * 列表 / 菜单 / 下拉选项的键盘导航核心逻辑(listbox / menu / combobox 通用)。\n * 返回应执行的动作,由调用方据此更新 activeIndex / 触发选中 / 关闭。\n *\n * 支持:ArrowDown/ArrowUp(竖排)/ArrowRight/ArrowLeft(横排)移动、Home/End 跳首尾、\n * Enter/Space 选中、Escape 关闭。\n */\nexport function handleListKeyboard(event: KeyboardEvent, options: ListKeyboardOptions): ListKeyAction {\n const { activeIndex, itemCount, loop = true } = options;\n if (itemCount <= 0) return { type: 'none' };\n\n const clamp = (idx: number) => (idx + itemCount) % itemCount;\n const within = (idx: number) => Math.max(0, Math.min(idx, itemCount - 1));\n\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowRight':\n return { type: 'navigate', index: loop ? clamp(activeIndex + 1) : within(activeIndex + 1) };\n case 'ArrowUp':\n case 'ArrowLeft':\n return { type: 'navigate', index: loop ? clamp(activeIndex - 1) : within(activeIndex - 1) };\n case 'Home':\n return { type: 'navigate', index: 0 };\n case 'End':\n return { type: 'navigate', index: itemCount - 1 };\n case 'Enter':\n case ' ':\n case 'Spacebar':\n return activeIndex >= 0 ? { type: 'select', index: activeIndex } : { type: 'none' };\n case 'Escape':\n return { type: 'close' };\n default:\n return { type: 'none' };\n }\n}\n\n/**\n * 为元素批量设置 ARIA 属性(不可变:返回新映射,但直接操作 DOM 属性是 a11y 的固有需求)。\n * 组件挂载后调用一次即可,避免每次 render 重复写 setAttribute。\n */\nexport function applyAria(el: HTMLElement, attrs: Record<string, string | boolean | undefined>): void {\n Object.entries(attrs).forEach(([key, value]) => {\n if (value === undefined || value === null) {\n el.removeAttribute(`aria-${key}`);\n } else {\n el.setAttribute(`aria-${key}`, String(value));\n }\n });\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"p-cf94cbf6.js","mappings":"AAAA;;;;AAYA;SACgB,SAAS,CAAC,KAAW,EAAE,KAAW;IAChD,QACE,KAAK,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,WAAW,EAAE;QAC3C,KAAK,CAAC,QAAQ,EAAE,KAAK,KAAK,CAAC,QAAQ,EAAE;QACrC,KAAK,CAAC,OAAO,EAAE,KAAK,KAAK,CAAC,OAAO,EAAE,EACnC;AACJ,CAAC;AAED;SACgB,eAAe,CAC7B,QAAc,EACd,YAAmB,EACnB,QAAc,IAAI,IAAI,EAAE;IAExB,MAAM,IAAI,GAAkB,EAAE,CAAC;IAC/B,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IACpC,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAElC,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAC1C,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7C,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC;IACvC,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;;IA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C;SAC/D,CAAC,CAAC;KACJ;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;SACgB,iBAAiB,CAAC,QAAc;IAC9C,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IACpC,OAAO,IAAI,IAAI,IAAI,GAAG,EAAE,CAAC,CAAC;AAC5B,CAAC;AAED;MACa,WAAW,GAAG;IACzB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAClC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK;EACpC;AAEF;MACa,cAAc,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;;;;","names":[],"sources":["src/utils/date-helpers.ts"],"sourcesContent":["/**\n * 日历和日期工具函数\n * 从 DatePicker / DateTimePicker / DatePickerPane 中提取的共享逻辑\n */\n\nexport interface CalendarDay {\n date: Date;\n isCurrentMonth: boolean;\n isToday: boolean;\n isSelected: boolean;\n}\n\n/** 判断两个日期是否为同一天 */\nexport function isSameDay(date1: Date, date2: Date): boolean {\n return (\n date1.getFullYear() === date2.getFullYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate()\n );\n}\n\n/** 生成 42 天(6 周)的日历网格数据 */\nexport function getCalendarDays(\n viewDate: Date,\n selectedDate?: Date,\n today: Date = new Date()\n): CalendarDay[] {\n const days: CalendarDay[] = [];\n const year = viewDate.getFullYear();\n const month = viewDate.getMonth();\n\n const firstDay = new Date(year, month, 1);\n const lastDay = new Date(year, month + 1, 0);\n const firstDayWeek = firstDay.getDay();\n const daysInMonth = lastDay.getDate();\n\n // 上月填充\n const prevMonth = new Date(year, month - 1, 0);\n for (let i = firstDayWeek - 1; i >= 0; i--) {\n const date = new Date(year, month - 1, prevMonth.getDate() - i);\n days.push({\n date,\n isCurrentMonth: false,\n isToday: isSameDay(date, today),\n isSelected: !!selectedDate && isSameDay(date, selectedDate),\n });\n }\n\n // 当月日期\n for (let i = 1; i <= daysInMonth; i++) {\n const date = new Date(year, month, i);\n days.push({\n date,\n isCurrentMonth: true,\n isToday: isSameDay(date, today),\n isSelected: !!selectedDate && isSameDay(date, selectedDate),\n });\n }\n\n // 下月填充(补齐 42 天)\n const remainingDays = 42 - days.length;\n for (let i = 1; i <= remainingDays; i++) {\n const date = new Date(year, month + 1, i);\n days.push({\n date,\n isCurrentMonth: false,\n isToday: isSameDay(date, today),\n isSelected: !!selectedDate && isSameDay(date, selectedDate),\n });\n }\n\n return days;\n}\n\n/**\n * 格式化日期为指定格式字符串\n * 支持:YYYY, MM, DD, HH, mm, ss\n */\nexport function formatDate(date: Date, format: string): string {\n const year = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const day = String(date.getDate()).padStart(2, '0');\n const hours = String(date.getHours()).padStart(2, '0');\n const minutes = String(date.getMinutes()).padStart(2, '0');\n const seconds = String(date.getSeconds()).padStart(2, '0');\n\n return format\n .replace('YYYY', String(year))\n .replace('MM', month)\n .replace('DD', day)\n .replace('HH', hours)\n .replace('mm', minutes)\n .replace('ss', seconds);\n}\n\n/** 安全解析日期值 */\nexport function parseDate(value: string | Date | undefined): Date | undefined {\n if (!value) return undefined;\n const date = value instanceof Date ? value : new Date(value);\n if (isNaN(date.getTime())) return undefined;\n return date;\n}\n\n/** 月份偏移,返回新日期对象(不可变) */\nexport function addMonths(date: Date, delta: number): Date {\n const result = new Date(date);\n result.setMonth(result.getMonth() + delta);\n return result;\n}\n\n/** 年份偏移,返回新日期对象(不可变) */\nexport function addYears(date: Date, delta: number): Date {\n const result = new Date(date);\n result.setFullYear(result.getFullYear() + delta);\n return result;\n}\n\n/**\n * 生成 years 视图的 12 年档数据(每档 12 年)。\n * 以 viewDate 所在年份向下取整到 12 的倍数作为起点。\n */\nexport interface CalendarYear {\n year: number;\n isCurrentYearRange: boolean;\n isSelected: boolean;\n}\n\nexport function getCalendarYears(\n viewDate: Date,\n selectedDate?: Date,\n startYearBase?: number\n): CalendarYear[] {\n const year = viewDate.getFullYear();\n const rangeStart = startYearBase ?? year - (year % 12);\n const years: CalendarYear[] = [];\n for (let i = 0; i < 12; i++) {\n const y = rangeStart + i;\n years.push({\n year: y,\n isCurrentYearRange: y === year,\n isSelected: !!selectedDate && selectedDate.getFullYear() === y,\n });\n }\n return years;\n}\n\n/** 获取 years 视图标题所显示的年份档区间起点 */\nexport function getYearRangeStart(viewDate: Date): number {\n const year = viewDate.getFullYear();\n return year - (year % 12);\n}\n\n/** 中文月份名称 */\nexport const MONTH_NAMES = [\n '一月', '二月', '三月', '四月', '五月', '六月',\n '七月', '八月', '九月', '十月', '十一月', '十二月',\n];\n\n/** 中文星期名称 */\nexport const WEEK_DAY_NAMES = ['日', '一', '二', '三', '四', '五', '六'];\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"a11y-f9ab2964.js","mappings":"AAAA;;;;;;;AAQA;SACgB,eAAe,CAAC,GAAuB;IACrD,OAAO,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,UAAU,CAAC;AAC9D,CAAC;AAED;AACA,MAAM,kBAAkB,GAAG;IACzB,SAAS;IACT,wBAAwB;IACxB,0BAA0B;IAC1B,uBAAuB;IACvB,wBAAwB;IACxB,iCAAiC;IACjC,0BAA0B;CAC3B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAEI,oBAAoB,CAAC,SAAsB;IACzD,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAc,kBAAkB,CAAC,CAAC,CAAC,MAAM,CACnF,CAAC,EAAE,KAAK,EAAE,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,MAAM,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,KAAK,MAAM,CACjF,CAAC;AACJ,CAAC;AAoBD;;;;;SAKgB,eAAe,CAAC,OAAyB;IACvD,MAAM,EA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,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,GAAG,KAAK,CAAC,WAAW,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC;QAC9F,KAAK,MAAM;YACT,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QACxC,KAAK,KAAK;YACR,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,GAAG,CAAC,EAAE,CAAC;QACpD,KAAK,OAAO,CAAC;QACb,KAAK,GAAG,CAAC;QACT,KAAK,UAAU;YACb,OAAO,WAAW,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QACtF,KAAK,QAAQ;YACX,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAC3B;YACE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;KAC3B;AACH;;;;","names":[],"sources":["src/utils/a11y.ts"],"sourcesContent":["/**\n * 无障碍(a11y)工具集\n * 统一 ARIA 属性辅助、焦点陷阱、列表键盘导航等在交互组件(Dialog / Drawer / Menu /\n * Dropdown / Select 等)中重复出现且容易写错的可访问性逻辑。\n *\n * 参考标准:WAI-ARIA Authoring Practices 1.2。\n */\n\n/** 判定按键是否为「激活」键(Enter / Space),用于自定义可聚焦元素的点击替代 */\nexport function isActivationKey(key: string | undefined): boolean {\n return key === 'Enter' || key === ' ' || key === 'Spacebar';\n}\n\n/** 查询容器内可聚焦的元素顺序(tabindex >= 0 的语义元素) */\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'button:not([disabled])',\n 'textarea:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n '[contenteditable=\"true\"]',\n].join(',');\n\nexport function getFocusableElements(container: HTMLElement): HTMLElement[] {\n return Array.from(container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR)).filter(\n (el) => el.getAttribute('aria-hidden') !== 'true' && el.style.display !== 'none',\n );\n}\n\n/** 焦点陷阱选项 */\nexport interface FocusTrapOptions {\n /** 焦点受限的容器元素 */\n container: HTMLElement;\n /** 打开时是否自动聚焦容器内首个可聚焦元素 */\n autoFocus?: boolean;\n /** 容器激活前的元素(用于关闭时归还焦点) */\n returnFocusTo?: HTMLElement | null;\n}\n\n/** 焦点陷阱句柄 */\nexport interface FocusTrap {\n /** 启用:绑定 Tab 拦截,可选自动聚焦 */\n connect: () => void;\n /** 关闭:解除拦截,归还焦点 */\n disconnect: () => void;\n}\n\n/**\n * 创建焦点陷阱(Dialog / Drawer 打开时把 Tab 循环限制在容器内)。\n * 关键点:Tab 与 Shift+Tab 在容器边界时回环到另一端,防止焦点逃逸到背景。\n * 返回句柄,组件在打开时 connect()、关闭时 disconnect()。\n */\nexport function createFocusTrap(options: FocusTrapOptions): FocusTrap {\n const { container, autoFocus = true, returnFocusTo } = options;\n let active = false;\n let previouslyFocused: HTMLElement | null = null;\n\n const handleKeydown = (e: KeyboardEvent) => {\n if (e.key !== 'Tab') return;\n const focusable = getFocusableElements(container);\n if (focusable.length === 0) {\n e.preventDefault();\n container.focus();\n return;\n }\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n const activeEl = document.activeElement;\n\n if (e.shiftKey) {\n if (activeEl === first || !container.contains(activeEl)) {\n e.preventDefault();\n last.focus();\n }\n } else {\n if (activeEl === last) {\n e.preventDefault();\n first.focus();\n }\n }\n };\n\n const connect = () => {\n if (active) return;\n active = true;\n previouslyFocused = (returnFocusTo ?? document.activeElement) as HTMLElement | null;\n container.addEventListener('keydown', handleKeydown);\n if (autoFocus) {\n const focusable = getFocusableElements(container);\n (focusable[0] ?? container).focus();\n }\n };\n\n const disconnect = () => {\n if (!active) return;\n active = false;\n container.removeEventListener('keydown', handleKeydown);\n if (previouslyFocused && typeof previouslyFocused.focus === 'function') {\n previouslyFocused.focus();\n }\n previouslyFocused = null;\n };\n\n return { connect, disconnect };\n}\n\n/** 列表键盘导航产生的动作 */\nexport type ListKeyAction =\n | { type: 'navigate'; index: number }\n | { type: 'select'; index: number }\n | { type: 'close' }\n | { type: 'none' };\n\n/** 列表键盘导航参数 */\nexport interface ListKeyboardOptions {\n /** 当前高亮项索引(-1 表示无高亮) */\n activeIndex: number;\n /** 列表项总数 */\n itemCount: number;\n /** 是否允许循环(首尾跳转) */\n loop?: boolean;\n}\n\n/**\n * 列表 / 菜单 / 下拉选项的键盘导航核心逻辑(listbox / menu / combobox 通用)。\n * 返回应执行的动作,由调用方据此更新 activeIndex / 触发选中 / 关闭。\n *\n * 支持:ArrowDown/ArrowUp(竖排)/ArrowRight/ArrowLeft(横排)移动、Home/End 跳首尾、\n * Enter/Space 选中、Escape 关闭。\n */\nexport function handleListKeyboard(event: KeyboardEvent, options: ListKeyboardOptions): ListKeyAction {\n const { activeIndex, itemCount, loop = true } = options;\n if (itemCount <= 0) return { type: 'none' };\n\n const clamp = (idx: number) => (idx + itemCount) % itemCount;\n const within = (idx: number) => Math.max(0, Math.min(idx, itemCount - 1));\n\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowRight':\n return { type: 'navigate', index: loop ? clamp(activeIndex + 1) : within(activeIndex + 1) };\n case 'ArrowUp':\n case 'ArrowLeft':\n return { type: 'navigate', index: loop ? clamp(activeIndex - 1) : within(activeIndex - 1) };\n case 'Home':\n return { type: 'navigate', index: 0 };\n case 'End':\n return { type: 'navigate', index: itemCount - 1 };\n case 'Enter':\n case ' ':\n case 'Spacebar':\n return activeIndex >= 0 ? { type: 'select', index: activeIndex } : { type: 'none' };\n case 'Escape':\n return { type: 'close' };\n default:\n return { type: 'none' };\n }\n}\n\n/**\n * 为元素批量设置 ARIA 属性(不可变:返回新映射,但直接操作 DOM 属性是 a11y 的固有需求)。\n * 组件挂载后调用一次即可,避免每次 render 重复写 setAttribute。\n */\nexport function applyAria(el: HTMLElement, attrs: Record<string, string | boolean | undefined>): void {\n Object.entries(attrs).forEach(([key, value]) => {\n if (value === undefined || value === null) {\n el.removeAttribute(`aria-${key}`);\n } else {\n el.setAttribute(`aria-${key}`, String(value));\n }\n });\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"date-helpers-e4d85a67.js","mappings":"AAAA;;;;AAYA;SACgB,SAAS,CAAC,KAAW,EAAE,KAAW;IAChD,QACE,KAAK,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,WAAW,EAAE;QAC3C,KAAK,CAAC,QAAQ,EAAE,KAAK,KAAK,CAAC,QAAQ,EAAE;QACrC,KAAK,CAAC,OAAO,EAAE,KAAK,KAAK,CAAC,OAAO,EAAE,EACnC;AACJ,CAAC;AAED;SACgB,eAAe,CAC7B,QAAc,EACd,YAAmB,EACnB,QAAc,IAAI,IAAI,EAAE;IAExB,MAAM,IAAI,GAAkB,EAAE,CAAC;IAC/B,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IACpC,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAElC,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAC1C,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7C,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC;IACvC,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;;IAGtC,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/C,KAAK,IAAI,CAAC,GAAG,YAAY,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;QAC1C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,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G;IACzB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAClC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK;EACpC;AAEF;MACa,cAAc,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;;;;","names":[],"sources":["src/utils/date-helpers.ts"],"sourcesContent":["/**\n * 日历和日期工具函数\n * 从 DatePicker / DateTimePicker / DatePickerPane 中提取的共享逻辑\n */\n\nexport interface CalendarDay {\n date: Date;\n isCurrentMonth: boolean;\n isToday: boolean;\n isSelected: boolean;\n}\n\n/** 判断两个日期是否为同一天 */\nexport function isSameDay(date1: Date, date2: Date): boolean {\n return (\n date1.getFullYear() === date2.getFullYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate()\n );\n}\n\n/** 生成 42 天(6 周)的日历网格数据 */\nexport function getCalendarDays(\n viewDate: Date,\n selectedDate?: Date,\n today: Date = new Date()\n): CalendarDay[] {\n const days: CalendarDay[] = [];\n const year = viewDate.getFullYear();\n const month = viewDate.getMonth();\n\n const firstDay = new Date(year, month, 1);\n const lastDay = new Date(year, month + 1, 0);\n const firstDayWeek = firstDay.getDay();\n const daysInMonth = lastDay.getDate();\n\n // 上月填充\n const prevMonth = new Date(year, month - 1, 0);\n for (let i = firstDayWeek - 1; i >= 0; i--) {\n const date = new Date(year, month - 1, prevMonth.getDate() - i);\n days.push({\n date,\n isCurrentMonth: false,\n isToday: isSameDay(date, today),\n isSelected: !!selectedDate && isSameDay(date, selectedDate),\n });\n }\n\n // 当月日期\n for (let i = 1; i <= daysInMonth; i++) {\n const date = new Date(year, month, i);\n days.push({\n date,\n isCurrentMonth: true,\n isToday: isSameDay(date, today),\n isSelected: !!selectedDate && isSameDay(date, selectedDate),\n });\n }\n\n // 下月填充(补齐 42 天)\n const remainingDays = 42 - days.length;\n for (let i = 1; i <= remainingDays; i++) {\n const date = new Date(year, month + 1, i);\n days.push({\n date,\n isCurrentMonth: false,\n isToday: isSameDay(date, today),\n isSelected: !!selectedDate && isSameDay(date, selectedDate),\n });\n }\n\n return days;\n}\n\n/**\n * 格式化日期为指定格式字符串\n * 支持:YYYY, MM, DD, HH, mm, ss\n */\nexport function formatDate(date: Date, format: string): string {\n const year = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const day = String(date.getDate()).padStart(2, '0');\n const hours = String(date.getHours()).padStart(2, '0');\n const minutes = String(date.getMinutes()).padStart(2, '0');\n const seconds = String(date.getSeconds()).padStart(2, '0');\n\n return format\n .replace('YYYY', String(year))\n .replace('MM', month)\n .replace('DD', day)\n .replace('HH', hours)\n .replace('mm', minutes)\n .replace('ss', seconds);\n}\n\n/** 安全解析日期值 */\nexport function parseDate(value: string | Date | undefined): Date | undefined {\n if (!value) return undefined;\n const date = value instanceof Date ? value : new Date(value);\n if (isNaN(date.getTime())) return undefined;\n return date;\n}\n\n/** 月份偏移,返回新日期对象(不可变) */\nexport function addMonths(date: Date, delta: number): Date {\n const result = new Date(date);\n result.setMonth(result.getMonth() + delta);\n return result;\n}\n\n/** 年份偏移,返回新日期对象(不可变) */\nexport function addYears(date: Date, delta: number): Date {\n const result = new Date(date);\n result.setFullYear(result.getFullYear() + delta);\n return result;\n}\n\n/**\n * 生成 years 视图的 12 年档数据(每档 12 年)。\n * 以 viewDate 所在年份向下取整到 12 的倍数作为起点。\n */\nexport interface CalendarYear {\n year: number;\n isCurrentYearRange: boolean;\n isSelected: boolean;\n}\n\nexport function getCalendarYears(\n viewDate: Date,\n selectedDate?: Date,\n startYearBase?: number\n): CalendarYear[] {\n const year = viewDate.getFullYear();\n const rangeStart = startYearBase ?? year - (year % 12);\n const years: CalendarYear[] = [];\n for (let i = 0; i < 12; i++) {\n const y = rangeStart + i;\n years.push({\n year: y,\n isCurrentYearRange: y === year,\n isSelected: !!selectedDate && selectedDate.getFullYear() === y,\n });\n }\n return years;\n}\n\n/** 获取 years 视图标题所显示的年份档区间起点 */\nexport function getYearRangeStart(viewDate: Date): number {\n const year = viewDate.getFullYear();\n return year - (year % 12);\n}\n\n/** 中文月份名称 */\nexport const MONTH_NAMES = [\n '一月', '二月', '三月', '四月', '五月', '六月',\n '七月', '八月', '九月', '十月', '十一月', '十二月',\n];\n\n/** 中文星期名称 */\nexport const WEEK_DAY_NAMES = ['日', '一', '二', '三', '四', '五', '六'];\n"],"version":3}
@@ -1,2 +0,0 @@
1
- import{r as e,g as t,h as i}from"./p-e42dfa95.js";const o='/*! 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{.inline{display:inline}.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-form-item{align-items:flex-start;display:flex;gap:var(--hb-spacing-sm)}.hb-form-item__label{align-items:center;color:var(--hb-color-text);display:inline-flex;flex-shrink:0;font-size:var(--hb-font-size-sm);height:var(--hb-size-default);justify-content:flex-end;white-space:nowrap}.hb-form-item__required{color:var(--hb-color-danger);margin-right:4px}.hb-form-item__content{flex:1;position:relative}.hb-form-item__error{animation:hb-form-error-fade-in .2s ease-out;color:var(--hb-color-danger);font-size:var(--hb-font-size-xs);line-height:1;margin-top:4px}@keyframes hb-form-error-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@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}';const r=o;const n=class{constructor(t){e(this,t)}get el(){return t(this)}prop="";label="";labelWidth;required=false;rules=[];size="default";errors=[];isvalidating=false;componentDidLoad(){this.el.dispatchEvent(new CustomEvent("hbFormFieldRegister",{detail:{prop:this.prop,validate:this.validate,resetValue:this.resetValue,getValue:this.getValue},bubbles:true}))}get formRules(){const e=this.el.closest("hb-form");const t=e?e.rules?.[this.prop]||[]:[];return[...t,...this.rules]}validate=async()=>{const e=this.getValue();const t=this.formRules;if(t.length===0){this.errors=[];return[]}this.isvalidating=true;const i=[];for(const o of t){if(o.required&&(!e&&e!==0)){i.push(o.message||`${this.label||this.prop}不能为空`);continue}if(o.pattern&&!o.pattern.test(e)){i.push(o.message||`${this.label||this.prop}格式不正确`);continue}if(o.min!==undefined&&typeof e==="string"&&e.length<o.min){i.push(o.message||`${this.label||this.prop}最少${o.min}个字符`);continue}if(o.max!==undefined&&typeof e==="string"&&e.length>o.max){i.push(o.message||`${this.label||this.prop}最多${o.max}个字符`);continue}if(o.validator){try{await o.validator(e,this.formRules)}catch(e){i.push(e.message||o.message||`${this.label||this.prop}验证失败`)}}}this.errors=i;this.isvalidating=false;return i};resetValue=()=>{this.errors=[]};getValue=()=>{const e=this.el.querySelector("hb-input, hb-select, hb-cascader, hb-date-picker, hb-input-number, hb-textarea, hb-checkbox, hb-radio, hb-switch");if(e){return e.modelValue}return undefined};render(){return i("div",{key:"9ea6c55b9159936a572eef459adea96234fbe2fa",class:{"hb-form-item":true,"hb-form-item--error":this.errors.length>0,"hb-form-item--validating":this.isvalidating}},this.label&&i("label",{key:"3f21b8777f7cddba09e797a706edfb9539fd2aa6",class:"hb-form-item__label",style:this.labelWidth?{width:this.labelWidth}:undefined},this.required&&i("span",{key:"fd89829e1469ff625d30e3b38624e9fc2a9566b4",class:"hb-form-item__required"},"*"),this.label),i("div",{key:"83ac6765623cf8c0c897ab945abdb0f1f0c3cde2",class:"hb-form-item__content"},i("slot",{key:"83f01e59dc6f984141ff26dc58ebf72ff77a4fe1"}),this.errors.length>0&&i("div",{key:"17d938b71257dedb8154b4f019127f03b43f1910",class:"hb-form-item__error"},this.errors[0])))}};n.style=r;export{n as hb_form_item};
2
- //# sourceMappingURL=p-003cee87.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["formItemCss","HbFormItemStyle0","FormItem","prop","label","labelWidth","required","rules","size","errors","isvalidating","componentDidLoad","this","el","dispatchEvent","CustomEvent","detail","validate","resetValue","getValue","bubbles","formRules","form","closest","formLevelRules","async","value","length","rule","push","message","pattern","test","min","undefined","max","validator","err","input","querySelector","modelValue","render","h","key","class","style","width"],"sources":["src/components/Form/form-item.css?tag=hb-form-item&encapsulation=shadow","src/components/Form/FormItem.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.hb-form-item {\n display: flex;\n align-items: flex-start;\n gap: var(--hb-spacing-sm);\n}\n\n.hb-form-item__label {\n display: inline-flex;\n align-items: center;\n justify-content: flex-end;\n height: var(--hb-size-default);\n font-size: var(--hb-font-size-sm);\n color: var(--hb-color-text);\n white-space: nowrap;\n flex-shrink: 0;\n}\n\n.hb-form-item__required {\n color: var(--hb-color-danger);\n margin-right: 4px;\n}\n\n.hb-form-item__content {\n flex: 1;\n position: relative;\n}\n\n.hb-form-item__error {\n font-size: var(--hb-font-size-xs);\n color: var(--hb-color-danger);\n margin-top: 4px;\n line-height: 1;\n animation: hb-form-error-fade-in 0.2s ease-out;\n}\n\n@keyframes hb-form-error-fade-in {\n from { opacity: 0; transform: translateY(-4px); }\n to { opacity: 1; transform: translateY(0); }\n}\n","import { Component, h, Prop, State, Element } from '@stencil/core';\n\n/**\n * FormItem 表单项组件\n * 表单中的每一项\n */\n@Component({\n tag: 'hb-form-item',\n styleUrl: 'form-item.css',\n shadow: true,\n})\nexport class FormItem {\n @Element() el: HTMLElement;\n\n /** 字段名 */\n @Prop() prop: string = '';\n\n /** 标签文本 */\n @Prop() label: string = '';\n\n /** 标签宽度 */\n @Prop() labelWidth?: string;\n\n /** 是否必填 */\n @Prop() required: boolean = false;\n\n /** 该表单项的验证规则 */\n @Prop() rules: any[] = [];\n\n /** 表单尺寸 */\n @Prop() size: 'large' | 'default' | 'small' = 'default';\n\n @State() errors: string[] = [];\n @State() isvalidating: boolean = false;\n\n componentDidLoad() {\n // 向父级 hb-form 注册\n this.el.dispatchEvent(new CustomEvent('hbFormFieldRegister', {\n detail: {\n prop: this.prop,\n validate: this.validate,\n resetValue: this.resetValue,\n getValue: this.getValue,\n },\n bubbles: true,\n }));\n }\n\n private get formRules(): any[] {\n // 合并 prop 对应的 form rules 和自身 rules\n const form = this.el.closest('hb-form');\n const formLevelRules = form ? (form as any).rules?.[this.prop] || [] : [];\n return [...formLevelRules, ...this.rules];\n }\n\n /**\n * 验证此字段\n */\n @Prop() validate = async (): Promise<string[]> => {\n const value = this.getValue();\n const rules = this.formRules;\n\n if (rules.length === 0) {\n this.errors = [];\n return [];\n }\n\n this.isvalidating = true;\n const errors: string[] = [];\n\n for (const rule of rules) {\n if (rule.required && (!value && value !== 0)) {\n errors.push(rule.message || `${this.label || this.prop}不能为空`);\n continue;\n }\n if (rule.pattern && !rule.pattern.test(value)) {\n errors.push(rule.message || `${this.label || this.prop}格式不正确`);\n continue;\n }\n if (rule.min !== undefined && typeof value === 'string' && value.length < rule.min) {\n errors.push(rule.message || `${this.label || this.prop}最少${rule.min}个字符`);\n continue;\n }\n if (rule.max !== undefined && typeof value === 'string' && value.length > rule.max) {\n errors.push(rule.message || `${this.label || this.prop}最多${rule.max}个字符`);\n continue;\n }\n if (rule.validator) {\n try {\n await rule.validator(value, this.formRules);\n } catch (err: any) {\n errors.push(err.message || rule.message || `${this.label || this.prop}验证失败`);\n }\n }\n }\n\n this.errors = errors;\n this.isvalidating = false;\n return errors;\n };\n\n @Prop() resetValue = () => {\n this.errors = [];\n };\n\n @Prop() getValue = (): any => {\n // 尝试从子元素中获取值\n const input = this.el.querySelector('hb-input, hb-select, hb-cascader, hb-date-picker, hb-input-number, hb-textarea, hb-checkbox, hb-radio, hb-switch');\n if (input) {\n return (input as any).modelValue;\n }\n return undefined;\n };\n\n render() {\n return (\n <div\n class={{\n 'hb-form-item': true,\n 'hb-form-item--error': this.errors.length > 0,\n 'hb-form-item--validating': this.isvalidating,\n }}\n >\n {this.label && (\n <label\n class=\"hb-form-item__label\"\n style={this.labelWidth ? { width: this.labelWidth } : undefined}\n >\n {this.required && <span class=\"hb-form-item__required\">*</span>}\n {this.label}\n </label>\n )}\n <div class=\"hb-form-item__content\">\n <slot />\n {this.errors.length > 0 && (\n <div class=\"hb-form-item__error\">{this.errors[0]}</div>\n )}\n </div>\n </div>\n );\n }\n}\n"],"mappings":"kDAAA,MAAMA,EAAc,kwMACpB,MAAAC,EAAeD,E,MCUFE,EAAQ,M,iDAIXC,KAAe,GAGfC,MAAgB,GAGhBC,WAGAC,SAAoB,MAGpBC,MAAe,GAGfC,KAAsC,UAErCC,OAAmB,GACnBC,aAAwB,MAEjC,gBAAAC,GAEEC,KAAKC,GAAGC,cAAc,IAAIC,YAAY,sBAAuB,CAC3DC,OAAQ,CACNb,KAAMS,KAAKT,KACXc,SAAUL,KAAKK,SACfC,WAAYN,KAAKM,WACjBC,SAAUP,KAAKO,UAEjBC,QAAS,O,CAIb,aAAYC,GAEV,MAAMC,EAAOV,KAAKC,GAAGU,QAAQ,WAC7B,MAAMC,EAAiBF,EAAQA,EAAaf,QAAQK,KAAKT,OAAS,GAAK,GACvE,MAAO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AAS,EAGlB,MAAAO,GACE,OACEC,EAAA,OAAAC,IAAA,2CACEC,MAAO,CACL,eAAgB,KAChB,sBAAuBhC,KAAKH,OAAOkB,OAAS,EAC5C,2BAA4Bf,KAAKF,eAGlCE,KAAKR,OACJsC,EAAA,SAAAC,IAAA,2CACEC,MAAM,sBACNC,MAAOjC,KAAKP,WAAa,CAAEyC,MAAOlC,KAAKP,YAAe6B,WAErDtB,KAAKN,UAAYoC,EAAA,QAAAC,IAAA,2CAAMC,MAAM,0BAAwB,KACrDhC,KAAKR,OAGVsC,EAAA,OAAAC,IAAA,2CAAKC,MAAM,yBACTF,EAAA,QAAAC,IAAA,6CACC/B,KAAKH,OAAOkB,OAAS,GACpBe,EAAA,OAAAC,IAAA,2CAAKC,MAAM,uBAAuBhC,KAAKH,OAAO,K","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import{r as e,c as t,h as i}from"./p-e42dfa95.js";import{g as r,l as a,u as o}from"./p-ecce2b5e.js";import{c as n}from"./p-cc0aeb50.js";const s='/*! 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}.container{width:100%}.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:contents}.hb-drawer-wrapper{inset:0;pointer-events:none;position:fixed;z-index:1000}.hb-drawer__overlay{background:var(--hb-color-bg-mask);inset:0;transition:opacity .3s}.hb-drawer,.hb-drawer__overlay{pointer-events:auto;position:fixed}.hb-drawer{background:var(--hb-color-bg-elevated);box-shadow:var(--hb-box-shadow-lg);display:flex;flex-direction:column;transition:transform .3s}.hb-drawer--rtl{bottom:0;right:0;top:0;transform:translate(100%)}.hb-drawer--ltr{bottom:0;left:0;top:0;transform:translate(-100%)}.hb-drawer--ttb{left:0;right:0;top:0;transform:translateY(-100%)}.hb-drawer--btt{bottom:0;left:0;right:0;transform:translateY(100%)}.hb-drawer--visible.hb-drawer--ltr,.hb-drawer--visible.hb-drawer--rtl{transform:translate(0)}.hb-drawer--visible.hb-drawer--btt,.hb-drawer--visible.hb-drawer--ttb{transform:translateY(0)}.hb-drawer__header{align-items:center;border-bottom:1px solid var(--hb-color-border-secondary);display:flex;justify-content:space-between;padding:var(--hb-spacing-md)var(--hb-spacing-lg)}.hb-drawer__title{font-size:var(--hb-font-size-lg);font-weight:600}.hb-drawer__close{align-items:center;background:0 0;border:none;border-radius:var(--hb-border-radius-sm);color:var(--hb-color-text-secondary);cursor:pointer;display:flex;font-size:18px;height:28px;justify-content:center;width:28px}.hb-drawer__close:hover{background:var(--hb-color-fill-tertiary)}.hb-drawer__body{flex:1;overflow-y:auto;padding:var(--hb-spacing-lg)}@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}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}';const l=s;const d=class{constructor(i){e(this,i);this.hbOpen=t(this,"hbOpen",7);this.hbClose=t(this,"hbClose",7)}modelValue=false;title="";size="30%";direction="rtl";closeOnClickModal=true;showClose=true;modal=true;closeOnPressEscape=true;zIndexState=0;zIndex=0;panelRef;trap;hbOpen;hbClose;handleVisible(e){if(e){this.zIndex=r();this.zIndexState=this.zIndex;if(this.modal)a();this.hbOpen.emit();document.addEventListener("keydown",this.handleKeyDown)}else{if(this.modal)o();this.hbClose.emit();document.removeEventListener("keydown",this.handleKeyDown)}}componentDidRender(){if(!this.panelRef)return;if(this.modelValue){if(!this.trap){this.trap=n({container:this.panelRef})}this.trap.connect()}else{this.trap?.disconnect()}}disconnectedCallback(){if(this.modelValue&&this.modal)o();document.removeEventListener("keydown",this.handleKeyDown);this.trap?.disconnect()}handleKeyDown=e=>{if(this.closeOnPressEscape&&e.key==="Escape"){this.close()}};close=()=>{this.modelValue=false};render(){const e=this.direction;const t=e==="ttb"||e==="btt";const r=t?{height:this.size}:{width:this.size};const a=`hb-drawer--${e}`;return i("div",{key:"fdcae509a34a2de7ba9405106b217fda8ce765fa",class:{"hb-drawer-wrapper":true,"hb-drawer-wrapper--visible":this.modelValue}},this.modal&&i("div",{key:"439a2a35c0936bc0e347e7826f801dbf87d1047b",class:"hb-drawer__overlay",style:{zIndex:String(this.zIndexState)},onClick:()=>this.closeOnClickModal&&this.close()}),i("div",{key:"924fc27dc43f9d7b466b81a7b70cbfb1a6ba199e",ref:e=>this.panelRef=e,class:{"hb-drawer":true,[a]:true,"hb-drawer--visible":this.modelValue},style:{...r,zIndex:String(this.zIndexState+1)},role:"dialog","aria-modal":"true","aria-label":this.title||undefined},i("div",{key:"6c0c1e6e4938ad96c51add0e4be93de8ef72a056",class:"hb-drawer__header"},i("span",{key:"bc061a418b7358364b19190cc6b042fb5a049c95",class:"hb-drawer__title"},this.title),this.showClose&&i("button",{key:"52ceeac26c55f0e89c8c4410959c25b13ab2e28b",type:"button",class:"hb-drawer__close","aria-label":"关闭",onClick:this.close},"×")),i("div",{key:"ca916f681e9c7e4fb33d1d0b7cee03a20f42f7eb",class:"hb-drawer__body"},i("slot",{key:"f8a3fb1d251d5c16c98257bb8896c081623f321e"}))))}static get watchers(){return{modelValue:["handleVisible"]}}};d.style=l;export{d as hb_drawer};
2
- //# sourceMappingURL=p-0a033738.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["drawerCss","HbDrawerStyle0","Drawer","modelValue","title","size","direction","closeOnClickModal","showClose","modal","closeOnPressEscape","zIndexState","zIndex","panelRef","trap","hbOpen","hbClose","handleVisible","val","this","getNextZIndex","lockScroll","emit","document","addEventListener","handleKeyDown","unlockScroll","removeEventListener","componentDidRender","createFocusTrap","container","connect","disconnect","disconnectedCallback","e","key","close","render","dir","isVertical","sizeStyle","height","width","translateClass","h","class","style","String","onClick","ref","el","role","undefined","type"],"sources":["src/components/Drawer/drawer.css?tag=hb-drawer&encapsulation=shadow","src/components/Drawer/Drawer.tsx"],"sourcesContent":[":host { display: contents; }\n.hb-drawer-wrapper { position: fixed; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 1000; }\n.hb-drawer__overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--hb-color-bg-mask); pointer-events: auto; transition: opacity 0.3s; }\n.hb-drawer {\n position: fixed; background: var(--hb-color-bg-elevated); box-shadow: var(--hb-box-shadow-lg);\n display: flex; flex-direction: column; pointer-events: auto; transition: transform 0.3s ease;\n}\n.hb-drawer--rtl { top: 0; right: 0; bottom: 0; transform: translateX(100%); }\n.hb-drawer--ltr { top: 0; left: 0; bottom: 0; transform: translateX(-100%); }\n.hb-drawer--ttb { left: 0; right: 0; top: 0; transform: translateY(-100%); }\n.hb-drawer--btt { left: 0; right: 0; bottom: 0; transform: translateY(100%); }\n.hb-drawer--visible.hb-drawer--rtl, .hb-drawer--visible.hb-drawer--ltr { transform: translateX(0); }\n.hb-drawer--visible.hb-drawer--ttb, .hb-drawer--visible.hb-drawer--btt { transform: translateY(0); }\n.hb-drawer__header { display: flex; align-items: center; justify-content: space-between; padding: var(--hb-spacing-md) var(--hb-spacing-lg); border-bottom: 1px solid var(--hb-color-border-secondary); }\n.hb-drawer__title { font-size: var(--hb-font-size-lg); font-weight: 600; }\n.hb-drawer__close { border: none; background: none; font-size: 18px; cursor: pointer; color: var(--hb-color-text-secondary); width: 28px; height: 28px; border-radius: var(--hb-border-radius-sm); display: flex; align-items: center; justify-content: center; }\n.hb-drawer__close:hover { background: var(--hb-color-fill-tertiary); }\n.hb-drawer__body { flex: 1; padding: var(--hb-spacing-lg); overflow-y: auto; }\n","import { Component, h, Prop, Event, EventEmitter, Watch, State } from '@stencil/core';\nimport { lockScroll, unlockScroll, getNextZIndex } from '../../utils/popup-manager';\nimport { createFocusTrap, FocusTrap } from '../../utils/a11y';\n\n@Component({ tag: 'hb-drawer', styleUrl: 'drawer.css', shadow: true })\nexport class Drawer {\n @Prop({ mutable: true }) modelValue: boolean = false;\n @Prop() title: string = '';\n @Prop() size: string = '30%';\n @Prop() direction: 'ltr' | 'rtl' | 'ttb' | 'btt' = 'rtl';\n @Prop() closeOnClickModal: boolean = true;\n @Prop() showClose: boolean = true;\n @Prop() modal: boolean = true;\n /** 是否按 ESC 关闭 */\n @Prop() closeOnPressEscape: boolean = true;\n @State() private zIndexState: number = 0;\n private zIndex: number = 0;\n private panelRef?: HTMLElement;\n private trap?: FocusTrap;\n\n @Event() hbOpen: EventEmitter<void>;\n @Event() hbClose: EventEmitter<void>;\n\n @Watch('modelValue')\n handleVisible(val: boolean) {\n if (val) {\n this.zIndex = getNextZIndex();\n this.zIndexState = this.zIndex;\n if (this.modal) lockScroll();\n this.hbOpen.emit();\n document.addEventListener('keydown', this.handleKeyDown);\n } else {\n if (this.modal) unlockScroll();\n this.hbClose.emit();\n document.removeEventListener('keydown', this.handleKeyDown);\n }\n }\n\n componentDidRender() {\n if (!this.panelRef) return;\n if (this.modelValue) {\n if (!this.trap) {\n this.trap = createFocusTrap({ container: this.panelRef });\n }\n this.trap.connect();\n } else {\n this.trap?.disconnect();\n }\n }\n\n disconnectedCallback() {\n if (this.modelValue && this.modal) unlockScroll();\n document.removeEventListener('keydown', this.handleKeyDown);\n this.trap?.disconnect();\n }\n\n private handleKeyDown = (e: KeyboardEvent) => {\n if (this.closeOnPressEscape && e.key === 'Escape') {\n this.close();\n }\n };\n\n private close = () => { this.modelValue = false; };\n\n render() {\n const dir = this.direction;\n const isVertical = dir === 'ttb' || dir === 'btt';\n const sizeStyle = isVertical ? { height: this.size } : { width: this.size };\n const translateClass = `hb-drawer--${dir}`;\n\n return (\n <div class={{ 'hb-drawer-wrapper': true, 'hb-drawer-wrapper--visible': this.modelValue }}>\n {this.modal && <div class=\"hb-drawer__overlay\" style={{ zIndex: String(this.zIndexState) }} onClick={() => this.closeOnClickModal && this.close()} />}\n <div\n ref={(el) => (this.panelRef = el as HTMLElement)}\n class={{ 'hb-drawer': true, [translateClass]: true, 'hb-drawer--visible': this.modelValue }}\n style={{ ...sizeStyle, zIndex: String(this.zIndexState + 1) }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={this.title || undefined}\n >\n <div class=\"hb-drawer__header\">\n <span class=\"hb-drawer__title\">{this.title}</span>\n {this.showClose && <button type=\"button\" class=\"hb-drawer__close\" aria-label=\"关闭\" onClick={this.close}>×</button>}\n </div>\n <div class=\"hb-drawer__body\"><slot /></div>\n </div>\n </div>\n );\n }\n}\n"],"mappings":"wIAAA,MAAMA,EAAY,4yOAClB,MAAAC,EAAeD,E,MCIFE,EAAM,M,yFACQC,WAAsB,MACvCC,MAAgB,GAChBC,KAAe,MACfC,UAA2C,MAC3CC,kBAA6B,KAC7BC,UAAqB,KACrBC,MAAiB,KAEjBC,mBAA8B,KACrBC,YAAsB,EAC/BC,OAAiB,EACjBC,SACAC,KAECC,OACAC,QAGT,aAAAC,CAAcC,GACZ,GAAIA,EAAK,CACPC,KAAKP,OAASQ,IACdD,KAA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AC/E2C,MAAO,IAAKN,EAAW5B,OAAQmC,OAAO5B,KAAKR,YAAc,IACzDwC,KAAK,SAAQ,aACF,OAAM,aACLhC,KAAKf,OAASgD,WAE1BR,EAAA,OAAAT,IAAA,2CAAKU,MAAM,qBACTD,EAAA,QAAAT,IAAA,2CAAMU,MAAM,oBAAoB1B,KAAKf,OACpCe,KAAKX,WAAaoC,EAAA,UAAAT,IAAA,2CAAQkB,KAAK,SAASR,MAAM,mBAAkB,aAAY,KAAKG,QAAS7B,KAAKiB,OAAK,MAEvGQ,EAAA,OAAAT,IAAA,2CAAKU,MAAM,mBAAkBD,EAAA,QAAAT,IAAA,+C","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import{r as e,c as a,g as t,h as r}from"./p-e42dfa95.js";import{c as i}from"./p-4ef5a884.js";const o='/*! 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{--hb-cascader-font-size:14px;--hb-cascader-font-size-large:16px;--hb-cascader-font-size-small:12px;--hb-cascader-border-color:var(--hb-border-color,#dcdfe6);--hb-cascader-border-color-hover:var(--hb-color-primary);--hb-cascader-bg-color:var(--hb-color-white,#fff);--hb-cascader-text-color:var(--hb-color-text-regular,#606266);--hb-cascader-placeholder-color:var(--hb-color-text-placeholder,#c0c4cc);--hb-cascader-disabled-color:var(--hb-color-text-disabled,#c0c4cc);--hb-cascader-disabled-bg-color:var(--hb-fill-color-light,#f5f7fa);display:inline-block;position:relative}.hb-cascader{display:inline-block;font-size:var(--hb-cascader-font-size);line-height:32px;position:relative}.hb-cascader__input-wrapper{cursor:pointer;display:inline-block;position:relative;width:100%}.hb-cascader__input{background-color:var(--hb-cascader-bg-color);border:1px solid var(--hb-cascader-border-color);border-radius:4px;box-sizing:border-box;color:var(--hb-cascader-text-color);cursor:pointer;display:inline-block;font-size:var(--hb-cascader-font-size);height:32px;line-height:32px;outline:none;padding:0 30px 0 15px;transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:100%}.hb-cascader__input::placeholder{color:var(--hb-cascader-placeholder-color)}.hb-cascader__input:focus,.hb-cascader__input:hover:not(:disabled){border-color:var(--hb-cascader-border-color-hover)}.hb-cascader__input:disabled{background-color:var(--hb-cascader-disabled-bg-color);border-color:var(--hb-cascader-border-color);color:var(--hb-cascader-disabled-color);cursor:not-allowed}.hb-cascader__suffix{align-items:center;color:var(--hb-cascader-text-color);display:flex;position:absolute;right:8px;top:50%;transform:translateY(-50%)}.hb-cascader__clear{color:var(--hb-cascader-placeholder-color);cursor:pointer;font-size:16px;margin-right:8px;transition:color .2s}.hb-cascader__clear:hover{color:var(--hb-cascader-text-color)}.hb-cascader__arrow{font-size:12px;transition:transform .3s}.hb-cascader--open .hb-cascader__arrow{transform:rotate(180deg)}.hb-cascader__dropdown{background-color:var(--hb-cascader-bg-color);border:1px solid var(--hb-cascader-border-color);border-radius:4px;box-shadow:0 2px 12px #0000001a;left:0;margin-top:4px;max-height:300px;min-width:180px;overflow-y:auto;position:absolute;top:100%;width:max-content;z-index:1000}.hb-cascader__menus{display:flex;padding:6px 0}.hb-cascader__menu{border-right:1px solid var(--hb-cascader-border-color);max-height:300px;min-width:180px;overflow-y:auto}.hb-cascader__menu:last-child{border-right:none}.hb-cascader__menu-list{list-style:none;margin:0;padding:0}.hb-cascader__menu-item{align-items:center;color:var(--hb-cascader-text-color);cursor:pointer;display:flex;font-size:var(--hb-cascader-font-size);justify-content:space-between;padding:8px 20px;transition:background-color .2s}.hb-cascader__menu-item:hover:not(.hb-cascader__menu-item--disabled){background-color:var(--hb-fill-color-light,#f5f7fa)}.hb-cascader__menu-item--selected{color:var(--hb-color-primary);font-weight:600}.hb-cascader__menu-item--disabled{color:var(--hb-cascader-disabled-color);cursor:not-allowed}.hb-cascader__menu-item-label{flex:1}.hb-cascader__menu-item-arrow{color:var(--hb-cascader-placeholder-color);font-size:12px;margin-left:8px}.hb-cascader__menu-item-loading{animation:hb-cascader-spin .8s linear infinite;color:var(--hb-color-primary,#1677ff);font-size:12px;margin-left:8px}.hb-cascader__menu-list--loading .hb-cascader__menu-item--loading{color:var(--hb-color-text-placeholder,#c0c4cc);justify-content:center}@keyframes hb-cascader-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.hb-cascader--large,.hb-cascader--large .hb-cascader__input{font-size:var(--hb-cascader-font-size-large);line-height:40px}.hb-cascader--large .hb-cascader__input{height:40px}.hb-cascader--small,.hb-cascader--small .hb-cascader__input{font-size:var(--hb-cascader-font-size-small);line-height:24px}.hb-cascader--small .hb-cascader__input{height:24px;padding:0 25px 0 12px}.hb-cascader--disabled{cursor:not-allowed}.hb-cascader__search{border-bottom:1px solid var(--hb-cascader-border-color);padding:8px}.hb-cascader__search-input{background-color:var(--hb-cascader-bg-color);border:1px solid var(--hb-cascader-border-color);border-radius:4px;box-sizing:border-box;color:var(--hb-cascader-text-color);cursor:text;font-size:var(--hb-cascader-font-size);height:28px;line-height:28px;outline:none;padding:0 8px;transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:100%}.hb-cascader__search-input:focus{border-color:var(--hb-cascader-border-color-hover)}.hb-cascader__search-results{max-height:264px;min-width:180px;overflow-y:auto;padding:6px 0}.hb-cascader__search-item{color:var(--hb-cascader-text-color);cursor:pointer;font-size:var(--hb-cascader-font-size);padding:8px 20px;transition:background-color .2s;white-space:nowrap}.hb-cascader__search-item:hover:not(.hb-cascader__search-item--disabled){background-color:var(--hb-fill-color-light,#f5f7fa)}.hb-cascader__search-item--selected{color:var(--hb-color-primary);font-weight:600}.hb-cascader__search-item--disabled{color:var(--hb-cascader-disabled-color);cursor:not-allowed}.hb-cascader__search-empty{color:var(--hb-cascader-placeholder-color);font-size:var(--hb-cascader-font-size);padding:16px 0;text-align:center}@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}';const s=o;const n=class{constructor(t){e(this,t);this.hbChange=a(this,"hbChange",7);this.hbExpandChange=a(this,"hbExpandChange",7)}get el(){return t(this)}modelValue;options=[];placeholder="请选择";disabled=false;size="default";clearable=false;showAllLevels=true;name;inputId;separator=" / ";emitPath=true;filterable=false;lazy=false;load;isOpen=false;inputValue="";searchValue="";loadingKeys=new Set;filteredPaths=[];activePath=[];hbChange;hbExpandChange;clickOutside=i({host:null,isOpen:()=>this.isOpen,onClose:()=>{this.closeAndClearSearch()}});componentDidLoad(){this.clickOutside=i({host:this.el,isOpen:()=>this.isOpen,onClose:()=>{this.closeAndClearSearch()}});this.clickOutside.connect();this.updateInputValue()}closeAndClearSearch(){this.isOpen=false;this.searchValue="";this.filteredPaths=[]}disconnectedCallback(){this.clickOutside.disconnect()}handleValueChange(){this.updateInputValue()}updateInputValue(){if(!this.modelValue||this.modelValue.length===0){this.inputValue="";return}if(!this.showAllLevels){const e=this.modelValue[this.modelValue.length-1];const a=this.findOptionByValue(this.options,e);this.inputValue=a?a.label:"";return}const e=[];let a=this.options;for(const t of this.modelValue){const r=a.find((e=>e.value===t));if(r){e.push(r.label);a=r.children||[]}else{break}}this.inputValue=e.join(this.separator)}findOptionByValue(e,a){for(const t of e){if(t.value===a){return t}if(t.children){const e=this.findOptionByValue(t.children,a);if(e)return e}}return null}handleInputClick=()=>{if(this.disabled)return;if(this.isOpen){this.closeAndClearSearch()}else{this.isOpen=true}};handleSearchInput=e=>{const a=e.target;this.searchValue=a.value;this.filteredPaths=this.collectFilteredPaths(this.searchValue)};collectFilteredPaths(e){const a=e.trim().toLowerCase();if(!a)return[];const t=[];const r=(e,i)=>{for(const o of e){const e=[...i,o];if(o.label.toLowerCase().includes(a)){t.push(e)}if(o.children&&o.children.length>0){r(o.children,e)}}};r(this.options,[]);return t}handleSearchSelect=e=>{const a=e.map((e=>e.value));const t=e[e.length-1];const r=!t.children||t.children.length===0||t.leaf;this.searchValue="";this.filteredPaths=[];if(r){this.modelValue=a;this.updateInputValue();this.hbChange.emit(a);this.isOpen=false;this.activePath=[]}else{this.activePath=a;this.hbExpandChange.emit(a)}};handleClear=e=>{e.stopPropagation();this.modelValue=undefined;this.inputValue="";this.isOpen=false;this.hbChange.emit(undefined)};handleSelect=(e,a)=>{const t=[...a,e];let r=this.options;let i=null;for(const e of t){i=r.find((a=>a.value===e))||null;if(!i)break;r=i.children||[]}if(this.lazy&&this.load&&i&&i.children===undefined&&!i.leaf){this.activePath=t;this.hbExpandChange.emit(t);void this.loadChildren(i,t);return}if(!i||!i.children||i.children.length===0||i.leaf){this.modelValue=t;this.updateInputValue();this.hbChange.emit(t);this.isOpen=false;this.activePath=[]}else{this.activePath=t;this.hbExpandChange.emit(t)}};async loadChildren(e,a){if(!this.load)return;this.loadingKeys=new Set([...this.loadingKeys,e.value]);try{const a=await this.load(e);this.options=this.replaceOptionChildren(this.options,e.value,a)}catch(a){console.error("[hb-cascader] lazy load failed:",a);this.activePath=this.activePath.slice(0,this.activePath.indexOf(e.value)+1)}finally{const a=new Set(this.loadingKeys);a.delete(e.value);this.loadingKeys=a}}replaceOptionChildren(e,a,t){return e.map((e=>{if(e.value===a){return{...e,children:t}}if(e.children&&e.children.length>0){return{...e,children:this.replaceOptionChildren(e.children,a,t)}}return e}))}render(){return r("div",{key:"c842622737b0464fca8807b2e6e673de26e66f6c",class:{"hb-cascader":true,"hb-cascader--open":this.isOpen,"hb-cascader--disabled":this.disabled,[`hb-cascader--${this.size}`]:true}},r("div",{key:"23279bca07ba9263b6b7daa87fcc6ecf89cfa707",class:"hb-cascader__input-wrapper",onClick:this.handleInputClick},r("input",{key:"56253203d0684b374ee755d669ce1ef61eebb2e2",type:"text",id:this.inputId,name:this.name,class:"hb-cascader__input",placeholder:this.placeholder,value:this.inputValue,disabled:this.disabled,readonly:true,role:"combobox","aria-haspopup":"listbox","aria-expanded":this.isOpen?"true":"false"}),r("span",{key:"27eb1713ab7eabc760652d60d48960685dfdb0ce",class:"hb-cascader__suffix"},this.clearable&&this.modelValue&&this.modelValue.length>0&&r("span",{key:"26c75b651d82806019f514e9dc030df394419e46",class:"hb-cascader__clear",role:"button","aria-label":"清空",onClick:this.handleClear},"×"),r("span",{key:"01cc98144fa2cf70fcc7588efadd7bbeea17738b",class:"hb-cascader__arrow"},"▼"))),this.isOpen&&r("div",{key:"23a6230933ffaf0ee98c2c70a8dc9a8444be0555",class:"hb-cascader__dropdown"},this.filterable&&r("div",{key:"628a293edf4d2f22975801e2e9155f46a5cf90fa",class:"hb-cascader__search"},r("input",{key:"bedac6a61a99b8a64d27eaf95880ff4891c33f04",type:"text",class:"hb-cascader__search-input",placeholder:"搜索",value:this.searchValue,onInput:this.handleSearchInput,"aria-label":"搜索选项"})),this.filterable&&this.searchValue.trim()!==""?this.renderSearchResults():r("div",{class:"hb-cascader__menus",role:"listbox","aria-multiselectable":"false"},this.renderCascaderMenus())))}renderCascaderMenus(){const e=[];let a=this.options;let t=[];e.push(this.renderMenu(a,t));for(let r=0;r<this.activePath.length;r++){const i=this.activePath[r];const o=a.find((e=>e.value===i));if(!o)break;if(o.children===undefined&&this.loadingKeys.has(o.value)){e.push(this.renderLoadingMenu());break}if(o.children&&o.children.length>0){t=[...t,i];a=o.children;e.push(this.renderMenu(a,t))}else{break}}return e}renderLoadingMenu(){return r("ul",{class:"hb-cascader__menu-list hb-cascader__menu-list--loading",role:"status","aria-live":"polite"},r("li",{class:"hb-cascader__menu-item hb-cascader__menu-item--loading"},r("span",{class:"hb-cascader__menu-item-label"},"加载中…")))}renderSearchResults(){if(this.filteredPaths.length===0){return r("div",{class:"hb-cascader__search-empty",role:"status"},"无匹配数据")}return r("div",{class:"hb-cascader__search-results",role:"listbox","aria-label":"搜索结果"},this.filteredPaths.map((e=>{const a=e.map((e=>e.label)).join(this.separator);const t=e.map((e=>e.value));const i=e[e.length-1];const o=!!i.disabled;const s=!!this.modelValue&&this.modelValue.length===t.length&&t.every(((e,a)=>this.modelValue&&this.modelValue[a]===e));return r("div",{class:{"hb-cascader__search-item":true,"hb-cascader__search-item--selected":s,"hb-cascader__search-item--disabled":o},role:"option","aria-selected":s?"true":"false","aria-disabled":o?"true":undefined,onClick:()=>!o&&this.handleSearchSelect(e)},a)})))}renderMenu(e,a){if(!e||e.length===0){return null}return r("ul",{class:"hb-cascader__menu-list",role:"group"},e.map((e=>{const t=a.length>0&&a[a.length-1]===e.value;const i=this.modelValue&&a.length>0&&a.every(((e,a)=>this.modelValue&&this.modelValue[a]===e))&&this.modelValue.length===a.length+1&&this.modelValue[a.length]===e.value;return r("li",{class:{"hb-cascader__menu-item":true,"hb-cascader__menu-item--selected":t||i,"hb-cascader__menu-item--disabled":e.disabled},role:"option","aria-selected":t||i?"true":"false","aria-disabled":e.disabled?"true":undefined,onClick:()=>!e.disabled&&this.handleSelect(e.value,a)},r("span",{class:"hb-cascader__menu-item-label"},e.label),this.loadingKeys.has(e.value)?r("span",{class:"hb-cascader__menu-item-loading","aria-hidden":"true"},"⟳"):e.children&&e.children.length>0||this.lazy&&e.children===undefined&&!e.leaf?r("span",{class:"hb-cascader__menu-item-arrow"},"▶"):null)})))}static get watchers(){return{modelValue:["handleValueChange"]}}};n.style=s;export{n as hb_cascader};
2
- //# sourceMappingURL=p-0bef78ac.entry.js.map