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.
- package/dist/cjs/{a11y-802de67a.js → a11y-4385c871.js} +17 -2
- package/dist/cjs/a11y-4385c871.js.map +1 -0
- package/dist/cjs/{date-helpers-904747ff.js → date-helpers-c05ef385.js} +10 -17
- package/dist/cjs/date-helpers-c05ef385.js.map +1 -0
- package/dist/cjs/hb-affix.cjs.entry.js +1 -1
- package/dist/cjs/hb-alert.cjs.entry.js +2 -1
- package/dist/cjs/hb-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-aside.cjs.entry.js +1 -1
- package/dist/cjs/hb-avatar.cjs.entry.js +1 -1
- package/dist/cjs/hb-backtop.cjs.entry.js +2 -2
- package/dist/cjs/hb-badge.cjs.entry.js +1 -1
- package/dist/cjs/hb-breadcrumb-item.cjs.entry.js +1 -1
- package/dist/cjs/hb-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/hb-button.cjs.entry.js +2 -2
- package/dist/cjs/hb-calendar.cjs.entry.js +78 -10
- package/dist/cjs/hb-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-card.cjs.entry.js +1 -1
- package/dist/cjs/hb-cascader.cjs.entry.js +306 -146
- package/dist/cjs/hb-cascader.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-checkbox-group.cjs.entry.js +12 -8
- package/dist/cjs/hb-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-checkbox.cjs.entry.js +9 -4
- package/dist/cjs/hb-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-collapse-item.cjs.entry.js +13 -4
- package/dist/cjs/hb-collapse-item.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-collapse.cjs.entry.js +20 -15
- package/dist/cjs/hb-collapse.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-color-picker-panel.cjs.entry.js +2 -2
- package/dist/cjs/hb-color-picker.cjs.entry.js +108 -28
- package/dist/cjs/hb-color-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-config-provider.cjs.entry.js +1 -1
- package/dist/cjs/hb-container.cjs.entry.js +2 -2
- package/dist/cjs/hb-date-picker-pane.cjs.entry.js +2 -2
- package/dist/cjs/hb-date-picker.cjs.entry.js +90 -9
- package/dist/cjs/hb-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-date-range-picker.cjs.entry.js +3 -3
- package/dist/cjs/hb-date-time-picker.cjs.entry.js +3 -3
- package/dist/cjs/hb-descriptions.cjs.entry.js +2 -2
- package/dist/cjs/hb-descriptions.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-dialog.cjs.entry.js +51 -12
- package/dist/cjs/hb-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-divider.cjs.entry.js +2 -2
- package/dist/cjs/hb-drawer.cjs.entry.js +34 -4
- package/dist/cjs/hb-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-dropdown.cjs.entry.js +91 -11
- package/dist/cjs/hb-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-empty.cjs.entry.js +1 -1
- package/dist/cjs/hb-float-button.cjs.entry.js +2 -2
- package/dist/cjs/hb-footer.cjs.entry.js +1 -1
- package/dist/cjs/hb-form-item.cjs.entry.js +61 -9
- package/dist/cjs/hb-form-item.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-form.cjs.entry.js +13 -8
- package/dist/cjs/hb-form.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-header.cjs.entry.js +1 -1
- package/dist/cjs/hb-image-preview.cjs.entry.js +13 -9
- package/dist/cjs/hb-image-preview.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-image.cjs.entry.js +21 -3
- package/dist/cjs/hb-image.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-input-number.cjs.entry.js +7 -7
- package/dist/cjs/hb-input-number.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-input-tag.cjs.entry.js +2 -2
- package/dist/cjs/hb-input.cjs.entry.js +40 -3
- package/dist/cjs/hb-input.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-layout.cjs.entry.js +36 -14
- package/dist/cjs/hb-layout.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-link.cjs.entry.js +2 -2
- package/dist/cjs/hb-loading.cjs.entry.js +2 -2
- package/dist/cjs/hb-main.cjs.entry.js +1 -1
- package/dist/cjs/hb-menu-item.cjs.entry.js +14 -5
- package/dist/cjs/hb-menu-item.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-menu.cjs.entry.js +3 -3
- package/dist/cjs/hb-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-message.cjs.entry.js +13 -4
- package/dist/cjs/hb-message.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-notification.cjs.entry.js +2 -2
- package/dist/cjs/hb-page-header.cjs.entry.js +1 -1
- package/dist/cjs/hb-pagination.cjs.entry.js +24 -8
- package/dist/cjs/hb-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-popconfirm.cjs.entry.js +57 -8
- package/dist/cjs/hb-popconfirm.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-popover.cjs.entry.js +37 -5
- package/dist/cjs/hb-popover.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-progress.cjs.entry.js +1 -1
- package/dist/cjs/hb-radio.cjs.entry.js +8 -3
- package/dist/cjs/hb-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-rate.cjs.entry.js +46 -4
- package/dist/cjs/hb-rate.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-result.cjs.entry.js +1 -1
- package/dist/cjs/hb-row.cjs.entry.js +2 -2
- package/dist/cjs/hb-scrollbar.cjs.entry.js +5 -5
- package/dist/cjs/hb-scrollbar.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-segmented.cjs.entry.js +50 -5
- package/dist/cjs/hb-segmented.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-select.cjs.entry.js +64 -16
- package/dist/cjs/hb-select.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-slider.cjs.entry.js +186 -23
- package/dist/cjs/hb-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-space.cjs.entry.js +2 -2
- package/dist/cjs/hb-statistic.cjs.entry.js +1 -1
- package/dist/cjs/hb-step.cjs.entry.js +1 -1
- package/dist/cjs/hb-steps.cjs.entry.js +30 -9
- package/dist/cjs/hb-steps.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-sub-menu.cjs.entry.js +5 -5
- package/dist/cjs/hb-switch.cjs.entry.js +9 -4
- package/dist/cjs/hb-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-tab-pane.cjs.entry.js +1 -1
- package/dist/cjs/hb-table.cjs.entry.js +26 -17
- package/dist/cjs/hb-table.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-tabs.cjs.entry.js +31 -10
- package/dist/cjs/hb-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-tag.cjs.entry.js +3 -2
- package/dist/cjs/hb-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-text.cjs.entry.js +2 -2
- package/dist/cjs/hb-time-picker.cjs.entry.js +14 -9
- package/dist/cjs/hb-time-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-time-select.cjs.entry.js +13 -4
- package/dist/cjs/hb-time-select.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-timeline.cjs.entry.js +1 -1
- package/dist/cjs/hb-tooltip.cjs.entry.js +43 -6
- package/dist/cjs/hb-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-transfer.cjs.entry.js +2 -2
- package/dist/cjs/hb-tree-select.cjs.entry.js +215 -23
- package/dist/cjs/hb-tree-select.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-tree.cjs.entry.js +145 -12
- package/dist/cjs/hb-tree.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-upload.cjs.entry.js +3 -3
- package/dist/cjs/hb-watermark.cjs.entry.js +19 -11
- package/dist/cjs/hb-watermark.cjs.entry.js.map +1 -1
- package/dist/cjs/huibo-ui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/transition-59f1da0f.js +34 -0
- package/dist/cjs/transition-59f1da0f.js.map +1 -0
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/Affix/Affix.js +1 -1
- package/dist/collection/components/Alert/Alert.js +2 -1
- package/dist/collection/components/Alert/Alert.js.map +1 -1
- package/dist/collection/components/Avatar/Avatar.js +1 -1
- package/dist/collection/components/Backtop/Backtop.js +2 -2
- package/dist/collection/components/Badge/Badge.js +1 -1
- package/dist/collection/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/collection/components/Breadcrumb/BreadcrumbItem.js +1 -1
- package/dist/collection/components/Button/Button.js +2 -2
- package/dist/collection/components/Calendar/Calendar.js +84 -10
- package/dist/collection/components/Calendar/Calendar.js.map +1 -1
- package/dist/collection/components/Calendar/calendar.css +16 -0
- package/dist/collection/components/Card/Card.js +1 -1
- package/dist/collection/components/Cascader/Cascader.js +410 -194
- package/dist/collection/components/Cascader/Cascader.js.map +1 -1
- package/dist/collection/components/Cascader/cascader.css +170 -16
- package/dist/collection/components/Checkbox/Checkbox.js +9 -4
- package/dist/collection/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/collection/components/Checkbox/CheckboxGroup.js +12 -8
- package/dist/collection/components/Checkbox/CheckboxGroup.js.map +1 -1
- package/dist/collection/components/Collapse/Collapse.js +20 -15
- package/dist/collection/components/Collapse/Collapse.js.map +1 -1
- package/dist/collection/components/Collapse/CollapseItem.js +33 -4
- package/dist/collection/components/Collapse/CollapseItem.js.map +1 -1
- package/dist/collection/components/ColorPicker/ColorPicker.js +109 -28
- package/dist/collection/components/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/collection/components/ColorPicker/color-picker.css +21 -3
- package/dist/collection/components/ColorPickerPanel/ColorPickerPanel.js +2 -2
- package/dist/collection/components/ConfigProvider/ConfigProvider.js +1 -1
- package/dist/collection/components/Container/Aside.js +1 -1
- package/dist/collection/components/Container/Container.js +2 -2
- package/dist/collection/components/Container/Footer.js +1 -1
- package/dist/collection/components/Container/Header.js +1 -1
- package/dist/collection/components/Container/Main.js +1 -1
- package/dist/collection/components/DatePicker/DatePicker.js +94 -12
- package/dist/collection/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/collection/components/DatePicker/date-picker.css +63 -2
- package/dist/collection/components/DatePickerPane/DatePickerPane.js +1 -1
- package/dist/collection/components/DateRangePicker/DateRangePicker.js +2 -2
- package/dist/collection/components/DateTimePicker/DateTimePicker.js +2 -2
- package/dist/collection/components/Descriptions/Descriptions.js +1 -1
- package/dist/collection/components/Descriptions/descriptions.css +52 -10
- package/dist/collection/components/Dialog/Dialog.js +54 -10
- package/dist/collection/components/Dialog/Dialog.js.map +1 -1
- package/dist/collection/components/Dialog/dialog.css +57 -11
- package/dist/collection/components/Divider/Divider.js +2 -2
- package/dist/collection/components/Drawer/Drawer.js +34 -3
- package/dist/collection/components/Drawer/Drawer.js.map +1 -1
- package/dist/collection/components/Drawer/drawer.css +207 -17
- package/dist/collection/components/Dropdown/Dropdown.js +103 -12
- package/dist/collection/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/collection/components/Dropdown/dropdown.css +26 -3
- package/dist/collection/components/Empty/Empty.js +1 -1
- package/dist/collection/components/FloatButton/FloatButton.js +2 -2
- package/dist/collection/components/Form/Form.js +14 -9
- package/dist/collection/components/Form/Form.js.map +1 -1
- package/dist/collection/components/Form/FormItem.js +62 -10
- package/dist/collection/components/Form/FormItem.js.map +1 -1
- package/dist/collection/components/Form/form-item.css +57 -6
- package/dist/collection/components/Form/form.css +1 -0
- package/dist/collection/components/Image/Image.js +24 -3
- package/dist/collection/components/Image/Image.js.map +1 -1
- package/dist/collection/components/ImagePreview/ImagePreview.js +13 -9
- package/dist/collection/components/ImagePreview/ImagePreview.js.map +1 -1
- package/dist/collection/components/Input/Input.js +39 -2
- package/dist/collection/components/Input/Input.js.map +1 -1
- package/dist/collection/components/Input/input.css +22 -4
- package/dist/collection/components/InputNumber/InputNumber.js +6 -6
- package/dist/collection/components/InputNumber/InputNumber.js.map +1 -1
- package/dist/collection/components/InputNumber/input-number.css +11 -1
- package/dist/collection/components/InputTag/InputTag.js +2 -2
- package/dist/collection/components/Layout/Layout.js +87 -34
- package/dist/collection/components/Layout/Layout.js.map +1 -1
- package/dist/collection/components/Layout/Row.js +2 -2
- package/dist/collection/components/Layout/layout.css +1732 -71
- package/dist/collection/components/Link/Link.js +2 -2
- package/dist/collection/components/Loading/Loading.js +2 -2
- package/dist/collection/components/Menu/Menu.js +2 -2
- package/dist/collection/components/Menu/MenuItem.js +34 -5
- package/dist/collection/components/Menu/MenuItem.js.map +1 -1
- package/dist/collection/components/Menu/SubMenu.js +4 -4
- package/dist/collection/components/Menu/menu.css +25 -0
- package/dist/collection/components/Message/Message.js +13 -4
- package/dist/collection/components/Message/Message.js.map +1 -1
- package/dist/collection/components/Notification/Notification.js +2 -2
- package/dist/collection/components/PageHeader/PageHeader.js +1 -1
- package/dist/collection/components/Pagination/Pagination.js +26 -7
- package/dist/collection/components/Pagination/Pagination.js.map +1 -1
- package/dist/collection/components/Pagination/pagination.css +23 -0
- package/dist/collection/components/Popconfirm/Popconfirm.js +66 -7
- package/dist/collection/components/Popconfirm/Popconfirm.js.map +1 -1
- package/dist/collection/components/Popconfirm/popconfirm.css +80 -16
- package/dist/collection/components/Popover/Popover.js +46 -4
- package/dist/collection/components/Popover/Popover.js.map +1 -1
- package/dist/collection/components/Popover/popover.css +49 -8
- package/dist/collection/components/Progress/Progress.js +1 -1
- package/dist/collection/components/Radio/Radio.js +8 -3
- package/dist/collection/components/Radio/Radio.js.map +1 -1
- package/dist/collection/components/Rate/Rate.js +46 -4
- package/dist/collection/components/Rate/Rate.js.map +1 -1
- package/dist/collection/components/Result/Result.js +1 -1
- package/dist/collection/components/Scrollbar/Scrollbar.js +5 -5
- package/dist/collection/components/Scrollbar/Scrollbar.js.map +1 -1
- package/dist/collection/components/Segmented/Segmented.js +65 -6
- package/dist/collection/components/Segmented/Segmented.js.map +1 -1
- package/dist/collection/components/Select/Select.js +63 -15
- package/dist/collection/components/Select/Select.js.map +1 -1
- package/dist/collection/components/Select/select.css +50 -5
- package/dist/collection/components/Slider/Slider.js +218 -24
- package/dist/collection/components/Slider/Slider.js.map +1 -1
- package/dist/collection/components/Slider/slider.css +57 -7
- package/dist/collection/components/Space/Space.js +2 -2
- package/dist/collection/components/Statistic/Statistic.js +1 -1
- package/dist/collection/components/Steps/Step.js +1 -1
- package/dist/collection/components/Steps/Steps.js +35 -8
- package/dist/collection/components/Steps/Steps.js.map +1 -1
- package/dist/collection/components/Switch/Switch.js +8 -3
- package/dist/collection/components/Switch/Switch.js.map +1 -1
- package/dist/collection/components/Switch/switch.css +47 -1
- package/dist/collection/components/Table/Table.js +25 -16
- package/dist/collection/components/Table/Table.js.map +1 -1
- package/dist/collection/components/Table/table.css +26 -2
- package/dist/collection/components/Tabs/TabPane.js +1 -1
- package/dist/collection/components/Tabs/Tabs.js +31 -10
- package/dist/collection/components/Tabs/Tabs.js.map +1 -1
- package/dist/collection/components/Tag/Tag.js +3 -2
- package/dist/collection/components/Tag/Tag.js.map +1 -1
- package/dist/collection/components/Text/Text.js +2 -2
- package/dist/collection/components/TimePicker/TimePicker.js +14 -9
- package/dist/collection/components/TimePicker/TimePicker.js.map +1 -1
- package/dist/collection/components/TimeSelect/TimeSelect.js +13 -4
- package/dist/collection/components/TimeSelect/TimeSelect.js.map +1 -1
- package/dist/collection/components/Timeline/Timeline.js +1 -1
- package/dist/collection/components/Tooltip/Tooltip.js +52 -6
- package/dist/collection/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/collection/components/Tooltip/tooltip.css +24 -2
- package/dist/collection/components/Transfer/Transfer.js +2 -2
- package/dist/collection/components/Tree/Tree.js +147 -13
- package/dist/collection/components/Tree/Tree.js.map +1 -1
- package/dist/collection/components/TreeSelect/TreeSelect.js +219 -23
- package/dist/collection/components/TreeSelect/TreeSelect.js.map +1 -1
- package/dist/collection/components/TreeSelect/tree-select.css +41 -7
- package/dist/collection/components/Upload/Upload.js +3 -3
- package/dist/collection/components/Watermark/Watermark.js +19 -11
- package/dist/collection/components/Watermark/Watermark.js.map +1 -1
- package/dist/collection/utils/a11y.js +15 -1
- package/dist/collection/utils/a11y.js.map +1 -1
- package/dist/collection/utils/date-helpers.js +9 -16
- package/dist/collection/utils/date-helpers.js.map +1 -1
- package/dist/collection/utils/transition.js +29 -0
- package/dist/collection/utils/transition.js.map +1 -0
- package/dist/components/hb-affix.js +1 -1
- package/dist/components/hb-alert.js +2 -1
- package/dist/components/hb-alert.js.map +1 -1
- package/dist/components/hb-aside.js +1 -1
- package/dist/components/hb-avatar.js +1 -1
- package/dist/components/hb-backtop.js +2 -2
- package/dist/components/hb-badge.js +1 -1
- package/dist/components/hb-breadcrumb-item.js +1 -1
- package/dist/components/hb-breadcrumb.js +1 -1
- package/dist/components/hb-button.js +2 -2
- package/dist/components/hb-calendar.js +80 -11
- package/dist/components/hb-calendar.js.map +1 -1
- package/dist/components/hb-card.js +1 -1
- package/dist/components/hb-cascader.js +309 -146
- package/dist/components/hb-cascader.js.map +1 -1
- package/dist/components/hb-checkbox-group.js +12 -8
- package/dist/components/hb-checkbox-group.js.map +1 -1
- package/dist/components/hb-checkbox.js +9 -4
- package/dist/components/hb-checkbox.js.map +1 -1
- package/dist/components/hb-collapse-item.js +14 -4
- package/dist/components/hb-collapse-item.js.map +1 -1
- package/dist/components/hb-collapse.js +20 -15
- package/dist/components/hb-collapse.js.map +1 -1
- package/dist/components/hb-color-picker-panel.js +2 -2
- package/dist/components/hb-color-picker.js +110 -29
- package/dist/components/hb-color-picker.js.map +1 -1
- package/dist/components/hb-config-provider.js +1 -1
- package/dist/components/hb-container.js +2 -2
- package/dist/components/hb-date-picker-pane.js +2 -2
- package/dist/components/hb-date-picker.js +92 -10
- package/dist/components/hb-date-picker.js.map +1 -1
- package/dist/components/hb-date-range-picker.js +3 -3
- package/dist/components/hb-date-time-picker.js +3 -3
- package/dist/components/hb-descriptions.js +2 -2
- package/dist/components/hb-descriptions.js.map +1 -1
- package/dist/components/hb-dialog.js +53 -13
- package/dist/components/hb-dialog.js.map +1 -1
- package/dist/components/hb-divider.js +2 -2
- package/dist/components/hb-drawer.js +36 -5
- package/dist/components/hb-drawer.js.map +1 -1
- package/dist/components/hb-dropdown.js +94 -12
- package/dist/components/hb-dropdown.js.map +1 -1
- package/dist/components/hb-empty.js +1 -1
- package/dist/components/hb-float-button.js +2 -2
- package/dist/components/hb-footer.js +1 -1
- package/dist/components/hb-form-item.js +61 -9
- package/dist/components/hb-form-item.js.map +1 -1
- package/dist/components/hb-form.js +13 -8
- package/dist/components/hb-form.js.map +1 -1
- package/dist/components/hb-header.js +1 -1
- package/dist/components/hb-icon.js +1 -89
- package/dist/components/hb-icon.js.map +1 -1
- package/dist/components/hb-image-preview.js +13 -9
- package/dist/components/hb-image-preview.js.map +1 -1
- package/dist/components/hb-image.js +23 -3
- package/dist/components/hb-image.js.map +1 -1
- package/dist/components/hb-input-number.js +7 -7
- package/dist/components/hb-input-number.js.map +1 -1
- package/dist/components/hb-input-tag.js +2 -2
- package/dist/components/hb-input.js +40 -3
- package/dist/components/hb-input.js.map +1 -1
- package/dist/components/hb-layout.js +36 -14
- package/dist/components/hb-layout.js.map +1 -1
- package/dist/components/hb-link.js +2 -2
- package/dist/components/hb-loading.js +2 -2
- package/dist/components/hb-main.js +1 -1
- package/dist/components/hb-menu-item.js +15 -5
- package/dist/components/hb-menu-item.js.map +1 -1
- package/dist/components/hb-menu.js +3 -3
- package/dist/components/hb-menu.js.map +1 -1
- package/dist/components/hb-message.js +13 -4
- package/dist/components/hb-message.js.map +1 -1
- package/dist/components/hb-notification.js +2 -2
- package/dist/components/hb-page-header.js +1 -1
- package/dist/components/hb-pagination.js +28 -10
- package/dist/components/hb-pagination.js.map +1 -1
- package/dist/components/hb-popconfirm.js +58 -8
- package/dist/components/hb-popconfirm.js.map +1 -1
- package/dist/components/hb-popover.js +38 -5
- package/dist/components/hb-popover.js.map +1 -1
- package/dist/components/hb-progress.js +1 -1
- package/dist/components/hb-radio.js +8 -3
- package/dist/components/hb-radio.js.map +1 -1
- package/dist/components/hb-rate.js +46 -4
- package/dist/components/hb-rate.js.map +1 -1
- package/dist/components/hb-result.js +1 -1
- package/dist/components/hb-row.js +2 -2
- package/dist/components/hb-scrollbar.js +5 -5
- package/dist/components/hb-scrollbar.js.map +1 -1
- package/dist/components/hb-segmented.js +54 -6
- package/dist/components/hb-segmented.js.map +1 -1
- package/dist/components/hb-select.js +64 -16
- package/dist/components/hb-select.js.map +1 -1
- package/dist/components/hb-slider.js +191 -24
- package/dist/components/hb-slider.js.map +1 -1
- package/dist/components/hb-space.js +2 -2
- package/dist/components/hb-statistic.js +1 -1
- package/dist/components/hb-step.js +1 -1
- package/dist/components/hb-steps.js +35 -8
- package/dist/components/hb-steps.js.map +1 -1
- package/dist/components/hb-sub-menu.js +5 -5
- package/dist/components/hb-switch.js +9 -4
- package/dist/components/hb-switch.js.map +1 -1
- package/dist/components/hb-tab-pane.js +1 -1
- package/dist/components/hb-table.js +26 -17
- package/dist/components/hb-table.js.map +1 -1
- package/dist/components/hb-tabs.js +31 -10
- package/dist/components/hb-tabs.js.map +1 -1
- package/dist/components/hb-tag.js +3 -2
- package/dist/components/hb-tag.js.map +1 -1
- package/dist/components/hb-text.js +2 -2
- package/dist/components/hb-time-picker.js +14 -9
- package/dist/components/hb-time-picker.js.map +1 -1
- package/dist/components/hb-time-select.js +13 -4
- package/dist/components/hb-time-select.js.map +1 -1
- package/dist/components/hb-timeline.js +1 -1
- package/dist/components/hb-tooltip.js +44 -6
- package/dist/components/hb-tooltip.js.map +1 -1
- package/dist/components/hb-transfer.js +2 -2
- package/dist/components/hb-tree-select.js +219 -24
- package/dist/components/hb-tree-select.js.map +1 -1
- package/dist/components/hb-tree.js +147 -13
- package/dist/components/hb-tree.js.map +1 -1
- package/dist/components/hb-upload.js +3 -3
- package/dist/components/hb-watermark.js +19 -11
- package/dist/components/hb-watermark.js.map +1 -1
- package/dist/components/{p-cc0aeb50.js → p-00aa34c8.js} +17 -3
- package/dist/components/p-00aa34c8.js.map +1 -0
- package/dist/components/p-86d92faf.js +93 -0
- package/dist/components/p-86d92faf.js.map +1 -0
- package/dist/{esm/date-helpers-e4d85a67.js → components/p-e0876aca.js} +10 -17
- package/dist/components/p-e0876aca.js.map +1 -0
- package/dist/components/p-fad66d69.js +32 -0
- package/dist/components/p-fad66d69.js.map +1 -0
- package/dist/esm/{a11y-f9ab2964.js → a11y-e4cde5b0.js} +17 -3
- package/dist/esm/a11y-e4cde5b0.js.map +1 -0
- package/dist/{components/p-cf94cbf6.js → esm/date-helpers-259ed2f1.js} +10 -17
- package/dist/esm/date-helpers-259ed2f1.js.map +1 -0
- package/dist/esm/hb-affix.entry.js +1 -1
- package/dist/esm/hb-alert.entry.js +2 -1
- package/dist/esm/hb-alert.entry.js.map +1 -1
- package/dist/esm/hb-aside.entry.js +1 -1
- package/dist/esm/hb-avatar.entry.js +1 -1
- package/dist/esm/hb-backtop.entry.js +2 -2
- package/dist/esm/hb-badge.entry.js +1 -1
- package/dist/esm/hb-breadcrumb-item.entry.js +1 -1
- package/dist/esm/hb-breadcrumb.entry.js +1 -1
- package/dist/esm/hb-button.entry.js +2 -2
- package/dist/esm/hb-calendar.entry.js +78 -10
- package/dist/esm/hb-calendar.entry.js.map +1 -1
- package/dist/esm/hb-card.entry.js +1 -1
- package/dist/esm/hb-cascader.entry.js +306 -146
- package/dist/esm/hb-cascader.entry.js.map +1 -1
- package/dist/esm/hb-checkbox-group.entry.js +12 -8
- package/dist/esm/hb-checkbox-group.entry.js.map +1 -1
- package/dist/esm/hb-checkbox.entry.js +9 -4
- package/dist/esm/hb-checkbox.entry.js.map +1 -1
- package/dist/esm/hb-collapse-item.entry.js +13 -4
- package/dist/esm/hb-collapse-item.entry.js.map +1 -1
- package/dist/esm/hb-collapse.entry.js +20 -15
- package/dist/esm/hb-collapse.entry.js.map +1 -1
- package/dist/esm/hb-color-picker-panel.entry.js +2 -2
- package/dist/esm/hb-color-picker.entry.js +108 -28
- package/dist/esm/hb-color-picker.entry.js.map +1 -1
- package/dist/esm/hb-config-provider.entry.js +1 -1
- package/dist/esm/hb-container.entry.js +2 -2
- package/dist/esm/hb-date-picker-pane.entry.js +2 -2
- package/dist/esm/hb-date-picker.entry.js +90 -9
- package/dist/esm/hb-date-picker.entry.js.map +1 -1
- package/dist/esm/hb-date-range-picker.entry.js +3 -3
- package/dist/esm/hb-date-time-picker.entry.js +3 -3
- package/dist/esm/hb-descriptions.entry.js +2 -2
- package/dist/esm/hb-descriptions.entry.js.map +1 -1
- package/dist/esm/hb-dialog.entry.js +51 -12
- package/dist/esm/hb-dialog.entry.js.map +1 -1
- package/dist/esm/hb-divider.entry.js +2 -2
- package/dist/esm/hb-drawer.entry.js +34 -4
- package/dist/esm/hb-drawer.entry.js.map +1 -1
- package/dist/esm/hb-dropdown.entry.js +91 -11
- package/dist/esm/hb-dropdown.entry.js.map +1 -1
- package/dist/esm/hb-empty.entry.js +1 -1
- package/dist/esm/hb-float-button.entry.js +2 -2
- package/dist/esm/hb-footer.entry.js +1 -1
- package/dist/esm/hb-form-item.entry.js +61 -9
- package/dist/esm/hb-form-item.entry.js.map +1 -1
- package/dist/esm/hb-form.entry.js +13 -8
- package/dist/esm/hb-form.entry.js.map +1 -1
- package/dist/esm/hb-header.entry.js +1 -1
- package/dist/esm/hb-image-preview.entry.js +13 -9
- package/dist/esm/hb-image-preview.entry.js.map +1 -1
- package/dist/esm/hb-image.entry.js +21 -3
- package/dist/esm/hb-image.entry.js.map +1 -1
- package/dist/esm/hb-input-number.entry.js +7 -7
- package/dist/esm/hb-input-number.entry.js.map +1 -1
- package/dist/esm/hb-input-tag.entry.js +2 -2
- package/dist/esm/hb-input.entry.js +40 -3
- package/dist/esm/hb-input.entry.js.map +1 -1
- package/dist/esm/hb-layout.entry.js +36 -14
- package/dist/esm/hb-layout.entry.js.map +1 -1
- package/dist/esm/hb-link.entry.js +2 -2
- package/dist/esm/hb-loading.entry.js +2 -2
- package/dist/esm/hb-main.entry.js +1 -1
- package/dist/esm/hb-menu-item.entry.js +14 -5
- package/dist/esm/hb-menu-item.entry.js.map +1 -1
- package/dist/esm/hb-menu.entry.js +3 -3
- package/dist/esm/hb-menu.entry.js.map +1 -1
- package/dist/esm/hb-message.entry.js +13 -4
- package/dist/esm/hb-message.entry.js.map +1 -1
- package/dist/esm/hb-notification.entry.js +2 -2
- package/dist/esm/hb-page-header.entry.js +1 -1
- package/dist/esm/hb-pagination.entry.js +24 -8
- package/dist/esm/hb-pagination.entry.js.map +1 -1
- package/dist/esm/hb-popconfirm.entry.js +57 -8
- package/dist/esm/hb-popconfirm.entry.js.map +1 -1
- package/dist/esm/hb-popover.entry.js +37 -5
- package/dist/esm/hb-popover.entry.js.map +1 -1
- package/dist/esm/hb-progress.entry.js +1 -1
- package/dist/esm/hb-radio.entry.js +8 -3
- package/dist/esm/hb-radio.entry.js.map +1 -1
- package/dist/esm/hb-rate.entry.js +46 -4
- package/dist/esm/hb-rate.entry.js.map +1 -1
- package/dist/esm/hb-result.entry.js +1 -1
- package/dist/esm/hb-row.entry.js +2 -2
- package/dist/esm/hb-scrollbar.entry.js +5 -5
- package/dist/esm/hb-scrollbar.entry.js.map +1 -1
- package/dist/esm/hb-segmented.entry.js +51 -6
- package/dist/esm/hb-segmented.entry.js.map +1 -1
- package/dist/esm/hb-select.entry.js +64 -16
- package/dist/esm/hb-select.entry.js.map +1 -1
- package/dist/esm/hb-slider.entry.js +186 -23
- package/dist/esm/hb-slider.entry.js.map +1 -1
- package/dist/esm/hb-space.entry.js +2 -2
- package/dist/esm/hb-statistic.entry.js +1 -1
- package/dist/esm/hb-step.entry.js +1 -1
- package/dist/esm/hb-steps.entry.js +28 -7
- package/dist/esm/hb-steps.entry.js.map +1 -1
- package/dist/esm/hb-sub-menu.entry.js +5 -5
- package/dist/esm/hb-switch.entry.js +9 -4
- package/dist/esm/hb-switch.entry.js.map +1 -1
- package/dist/esm/hb-tab-pane.entry.js +1 -1
- package/dist/esm/hb-table.entry.js +26 -17
- package/dist/esm/hb-table.entry.js.map +1 -1
- package/dist/esm/hb-tabs.entry.js +31 -10
- package/dist/esm/hb-tabs.entry.js.map +1 -1
- package/dist/esm/hb-tag.entry.js +3 -2
- package/dist/esm/hb-tag.entry.js.map +1 -1
- package/dist/esm/hb-text.entry.js +2 -2
- package/dist/esm/hb-time-picker.entry.js +14 -9
- package/dist/esm/hb-time-picker.entry.js.map +1 -1
- package/dist/esm/hb-time-select.entry.js +13 -4
- package/dist/esm/hb-time-select.entry.js.map +1 -1
- package/dist/esm/hb-timeline.entry.js +1 -1
- package/dist/esm/hb-tooltip.entry.js +43 -6
- package/dist/esm/hb-tooltip.entry.js.map +1 -1
- package/dist/esm/hb-transfer.entry.js +2 -2
- package/dist/esm/hb-tree-select.entry.js +215 -23
- package/dist/esm/hb-tree-select.entry.js.map +1 -1
- package/dist/esm/hb-tree.entry.js +145 -12
- package/dist/esm/hb-tree.entry.js.map +1 -1
- package/dist/esm/hb-upload.entry.js +3 -3
- package/dist/esm/hb-watermark.entry.js +19 -11
- package/dist/esm/hb-watermark.entry.js.map +1 -1
- package/dist/esm/huibo-ui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/transition-4295d789.js +32 -0
- package/dist/esm/transition-4295d789.js.map +1 -0
- package/dist/huibo-ui/huibo-ui.css +1 -1
- package/dist/huibo-ui/huibo-ui.esm.js +1 -1
- package/dist/huibo-ui/huibo-ui.esm.js.map +1 -1
- package/dist/huibo-ui/p-00aa34c8.js +2 -0
- package/dist/huibo-ui/p-00aa34c8.js.map +1 -0
- package/dist/huibo-ui/p-02f15843.entry.js +2 -0
- package/dist/huibo-ui/p-0cc1e3f3.entry.js +2 -0
- package/dist/huibo-ui/p-0cc1e3f3.entry.js.map +1 -0
- package/dist/huibo-ui/{p-f1c084c5.entry.js → p-0ddae4e9.entry.js} +2 -2
- package/dist/huibo-ui/{p-672076c3.entry.js → p-10f6c184.entry.js} +2 -2
- package/dist/huibo-ui/p-10f6c184.entry.js.map +1 -0
- package/dist/huibo-ui/{p-6ac242fe.entry.js → p-14c3b47b.entry.js} +2 -2
- package/dist/huibo-ui/{p-8c80a765.entry.js → p-15db24e9.entry.js} +2 -2
- package/dist/huibo-ui/{p-8b027491.entry.js → p-193efdc0.entry.js} +2 -2
- package/dist/huibo-ui/{p-8d925e3d.entry.js → p-1b0fbe69.entry.js} +2 -2
- package/dist/huibo-ui/{p-85f68526.entry.js → p-1b98152b.entry.js} +2 -2
- package/dist/huibo-ui/p-1b98152b.entry.js.map +1 -0
- package/dist/huibo-ui/p-1f6d0adb.entry.js +2 -0
- package/dist/huibo-ui/p-1f6d0adb.entry.js.map +1 -0
- package/dist/huibo-ui/{p-f374d5a3.entry.js → p-20632186.entry.js} +2 -2
- package/dist/huibo-ui/{p-e6f2d71d.entry.js → p-20fc554b.entry.js} +2 -2
- package/dist/huibo-ui/{p-64ca0980.entry.js → p-29092b85.entry.js} +2 -2
- package/dist/huibo-ui/p-29092b85.entry.js.map +1 -0
- package/dist/huibo-ui/p-2bc30b1b.entry.js +2 -0
- package/dist/huibo-ui/p-2bc30b1b.entry.js.map +1 -0
- package/dist/huibo-ui/{p-fd19813c.entry.js → p-2bcda1bb.entry.js} +2 -2
- package/dist/huibo-ui/{p-231a7335.entry.js → p-2ca9796a.entry.js} +2 -2
- package/dist/huibo-ui/p-2ca9796a.entry.js.map +1 -0
- package/dist/huibo-ui/{p-e0768565.entry.js → p-3042f986.entry.js} +2 -2
- package/dist/huibo-ui/{p-be48d2aa.entry.js → p-3dacb26b.entry.js} +2 -2
- package/dist/huibo-ui/{p-6a1ec3ff.entry.js → p-3deff48c.entry.js} +2 -2
- package/dist/huibo-ui/{p-c321c4aa.entry.js → p-412ff618.entry.js} +2 -2
- package/dist/huibo-ui/p-415295f3.entry.js +2 -0
- package/dist/huibo-ui/p-415295f3.entry.js.map +1 -0
- package/dist/huibo-ui/p-494e6c25.entry.js +2 -0
- package/dist/huibo-ui/p-494e6c25.entry.js.map +1 -0
- package/dist/huibo-ui/p-4d87d7f4.entry.js +2 -0
- package/dist/huibo-ui/p-4d87d7f4.entry.js.map +1 -0
- package/dist/huibo-ui/p-54a28052.entry.js +2 -0
- package/dist/huibo-ui/p-54a28052.entry.js.map +1 -0
- package/dist/huibo-ui/{p-88127de1.entry.js → p-55cd13eb.entry.js} +2 -2
- package/dist/huibo-ui/{p-58ebb9b3.entry.js → p-5c839288.entry.js} +2 -2
- package/dist/huibo-ui/p-5e253c15.entry.js +2 -0
- package/dist/huibo-ui/p-5e253c15.entry.js.map +1 -0
- package/dist/huibo-ui/p-63d68c61.entry.js +2 -0
- package/dist/huibo-ui/p-63d68c61.entry.js.map +1 -0
- package/dist/huibo-ui/{p-a042e3d0.entry.js → p-6518c435.entry.js} +2 -2
- package/dist/huibo-ui/p-687d8dff.entry.js +2 -0
- package/dist/huibo-ui/p-687d8dff.entry.js.map +1 -0
- package/dist/huibo-ui/p-688460ce.entry.js +2 -0
- package/dist/huibo-ui/p-688460ce.entry.js.map +1 -0
- package/dist/huibo-ui/p-69bb1dd9.entry.js +2 -0
- package/dist/huibo-ui/p-69bb1dd9.entry.js.map +1 -0
- package/dist/huibo-ui/{p-a0015341.entry.js → p-6bfeab80.entry.js} +2 -2
- package/dist/huibo-ui/{p-4001c08d.entry.js → p-6c23fbd1.entry.js} +2 -2
- package/dist/huibo-ui/p-6c23fbd1.entry.js.map +1 -0
- package/dist/huibo-ui/p-6c8cf248.entry.js +2 -0
- package/dist/huibo-ui/p-6c8cf248.entry.js.map +1 -0
- package/dist/huibo-ui/p-6efed295.entry.js +2 -0
- package/dist/huibo-ui/p-6efed295.entry.js.map +1 -0
- package/dist/huibo-ui/{p-8b1ae77e.entry.js → p-746a11a3.entry.js} +2 -2
- package/dist/huibo-ui/{p-c3e8893d.entry.js → p-79b24b83.entry.js} +2 -2
- package/dist/huibo-ui/p-79b24b83.entry.js.map +1 -0
- package/dist/huibo-ui/p-7a38b3e2.entry.js +2 -0
- package/dist/huibo-ui/p-7a38b3e2.entry.js.map +1 -0
- package/dist/huibo-ui/{p-c922d672.entry.js → p-7a682c56.entry.js} +2 -2
- package/dist/huibo-ui/{p-8c987d57.entry.js → p-7f65dc36.entry.js} +2 -2
- package/dist/huibo-ui/{p-463de26d.entry.js → p-815fc943.entry.js} +2 -2
- package/dist/huibo-ui/{p-d87fc21a.entry.js → p-88a6c905.entry.js} +2 -2
- package/dist/huibo-ui/{p-77017274.entry.js → p-89be7973.entry.js} +2 -2
- package/dist/huibo-ui/p-8a202bc5.entry.js +2 -0
- package/dist/huibo-ui/p-8a202bc5.entry.js.map +1 -0
- package/dist/huibo-ui/{p-315feadf.entry.js → p-8c4415ed.entry.js} +2 -2
- package/dist/huibo-ui/p-8c4415ed.entry.js.map +1 -0
- package/dist/huibo-ui/{p-9319c650.entry.js → p-950e7465.entry.js} +2 -2
- package/dist/huibo-ui/{p-6b381d0e.entry.js → p-96cecd21.entry.js} +2 -2
- package/dist/huibo-ui/p-96cecd21.entry.js.map +1 -0
- package/dist/huibo-ui/{p-710f38de.entry.js → p-98b513cd.entry.js} +2 -2
- package/dist/huibo-ui/p-98b513cd.entry.js.map +1 -0
- package/dist/huibo-ui/{p-5df47135.entry.js → p-a190ca89.entry.js} +2 -2
- package/dist/huibo-ui/{p-0e65e1bd.entry.js → p-ac18c68b.entry.js} +2 -2
- package/dist/huibo-ui/p-ac18c68b.entry.js.map +1 -0
- package/dist/huibo-ui/{p-d64b91ef.entry.js → p-ac45291c.entry.js} +2 -2
- package/dist/huibo-ui/p-ac45291c.entry.js.map +1 -0
- package/dist/huibo-ui/{p-477d8568.entry.js → p-aeae83af.entry.js} +2 -2
- package/dist/huibo-ui/{p-b489a526.entry.js → p-b06c8020.entry.js} +2 -2
- package/dist/huibo-ui/{p-dfaf7e37.entry.js → p-b105cf76.entry.js} +2 -2
- package/dist/huibo-ui/p-b105cf76.entry.js.map +1 -0
- package/dist/huibo-ui/{p-c3e665f6.entry.js → p-b38802b0.entry.js} +2 -2
- package/dist/huibo-ui/p-b38802b0.entry.js.map +1 -0
- package/dist/huibo-ui/{p-ea74fcae.entry.js → p-b3fd12c7.entry.js} +2 -2
- package/dist/huibo-ui/p-b3fd12c7.entry.js.map +1 -0
- package/dist/huibo-ui/p-b5ea18ba.entry.js +2 -0
- package/dist/huibo-ui/p-b5ea18ba.entry.js.map +1 -0
- package/dist/huibo-ui/{p-e2a8a396.entry.js → p-b6afe81e.entry.js} +2 -2
- package/dist/huibo-ui/{p-2b286698.entry.js → p-b7885d4a.entry.js} +2 -2
- package/dist/huibo-ui/p-b7900dee.entry.js +2 -0
- package/dist/huibo-ui/p-b7900dee.entry.js.map +1 -0
- package/dist/huibo-ui/p-b8c83751.entry.js +2 -0
- package/dist/huibo-ui/p-b8c83751.entry.js.map +1 -0
- package/dist/huibo-ui/p-c7713947.entry.js +2 -0
- package/dist/huibo-ui/p-c7713947.entry.js.map +1 -0
- package/dist/huibo-ui/{p-e0ab9010.entry.js → p-c869842c.entry.js} +2 -2
- package/dist/huibo-ui/p-c869842c.entry.js.map +1 -0
- package/dist/huibo-ui/{p-476527c1.entry.js → p-c8e917db.entry.js} +2 -2
- package/dist/huibo-ui/p-c8e917db.entry.js.map +1 -0
- package/dist/huibo-ui/p-cb66dbef.entry.js +2 -0
- package/dist/huibo-ui/p-cb66dbef.entry.js.map +1 -0
- package/dist/huibo-ui/p-cde83f76.entry.js +2 -0
- package/dist/huibo-ui/p-cde83f76.entry.js.map +1 -0
- package/dist/huibo-ui/{p-10c088f3.entry.js → p-d9c7c378.entry.js} +2 -2
- package/dist/huibo-ui/{p-332c8877.entry.js → p-dd9c6459.entry.js} +2 -2
- package/dist/huibo-ui/{p-80aca641.entry.js → p-dfccc7aa.entry.js} +2 -2
- package/dist/huibo-ui/{p-21682e92.entry.js → p-dfd144d8.entry.js} +2 -2
- package/dist/huibo-ui/p-e0876aca.js +2 -0
- package/dist/huibo-ui/p-e0876aca.js.map +1 -0
- package/dist/huibo-ui/p-e1773c93.entry.js +2 -0
- package/dist/huibo-ui/p-e1773c93.entry.js.map +1 -0
- package/dist/huibo-ui/{p-079a4130.entry.js → p-e3155cd7.entry.js} +2 -2
- package/dist/huibo-ui/{p-59b2e61c.entry.js → p-e73c357f.entry.js} +2 -2
- package/dist/huibo-ui/p-e73c357f.entry.js.map +1 -0
- package/dist/huibo-ui/{p-c1b4eacb.entry.js → p-e7c73624.entry.js} +2 -2
- package/dist/huibo-ui/p-e7c73624.entry.js.map +1 -0
- package/dist/huibo-ui/{p-d7815b4f.entry.js → p-e9e7abca.entry.js} +2 -2
- package/dist/huibo-ui/{p-f81ec512.entry.js → p-ea0823f3.entry.js} +2 -2
- package/dist/huibo-ui/p-ea0823f3.entry.js.map +1 -0
- package/dist/huibo-ui/{p-2e6584ea.entry.js → p-f1f2483f.entry.js} +2 -2
- package/dist/huibo-ui/{p-465dcb4c.entry.js → p-f2c78699.entry.js} +2 -2
- package/dist/huibo-ui/p-fad66d69.js +2 -0
- package/dist/huibo-ui/p-fad66d69.js.map +1 -0
- package/dist/huibo-ui/{p-4d8b1404.entry.js → p-fd6831f9.entry.js} +2 -2
- package/dist/huibo-ui/p-ff6bc5cc.entry.js +2 -0
- package/dist/huibo-ui/p-ff6bc5cc.entry.js.map +1 -0
- package/dist/types/components/Calendar/Calendar.d.ts +13 -1
- package/dist/types/components/Cascader/Cascader.d.ts +80 -90
- package/dist/types/components/Checkbox/Checkbox.d.ts +5 -0
- package/dist/types/components/Checkbox/CheckboxGroup.d.ts +1 -0
- package/dist/types/components/Collapse/Collapse.d.ts +2 -0
- package/dist/types/components/Collapse/CollapseItem.d.ts +8 -1
- package/dist/types/components/ColorPicker/ColorPicker.d.ts +11 -0
- package/dist/types/components/DatePicker/DatePicker.d.ts +14 -3
- package/dist/types/components/Dialog/Dialog.d.ts +13 -1
- package/dist/types/components/Drawer/Drawer.d.ts +4 -0
- package/dist/types/components/Dropdown/Dropdown.d.ts +18 -1
- package/dist/types/components/Form/Form.d.ts +2 -0
- package/dist/types/components/Form/FormItem.d.ts +10 -0
- package/dist/types/components/Image/Image.d.ts +6 -0
- package/dist/types/components/ImagePreview/ImagePreview.d.ts +5 -1
- package/dist/types/components/Input/Input.d.ts +9 -0
- package/dist/types/components/Layout/Layout.d.ts +20 -10
- package/dist/types/components/Menu/MenuItem.d.ts +8 -1
- package/dist/types/components/Message/Message.d.ts +3 -0
- package/dist/types/components/Pagination/Pagination.d.ts +3 -0
- package/dist/types/components/Popconfirm/Popconfirm.d.ts +16 -0
- package/dist/types/components/Popover/Popover.d.ts +14 -0
- package/dist/types/components/Radio/Radio.d.ts +5 -0
- package/dist/types/components/Rate/Rate.d.ts +7 -0
- package/dist/types/components/Segmented/Segmented.d.ts +18 -1
- package/dist/types/components/Select/Select.d.ts +11 -0
- package/dist/types/components/Slider/Slider.d.ts +27 -1
- package/dist/types/components/Steps/Steps.d.ts +14 -6
- package/dist/types/components/Table/Table.d.ts +8 -2
- package/dist/types/components/Tabs/Tabs.d.ts +6 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +15 -1
- package/dist/types/components/Tree/Tree.d.ts +24 -0
- package/dist/types/components/TreeSelect/TreeSelect.d.ts +26 -0
- package/dist/types/components/Watermark/Watermark.d.ts +7 -1
- package/dist/types/components.d.ts +290 -98
- package/dist/types/utils/a11y.d.ts +9 -0
- package/dist/types/utils/date-helpers.d.ts +1 -1
- package/dist/types/utils/transition.d.ts +27 -0
- package/package.json +8 -2
- package/readme.md +88 -73
- package/dist/cjs/a11y-802de67a.js.map +0 -1
- package/dist/cjs/date-helpers-904747ff.js.map +0 -1
- package/dist/components/p-cc0aeb50.js.map +0 -1
- package/dist/components/p-cf94cbf6.js.map +0 -1
- package/dist/esm/a11y-f9ab2964.js.map +0 -1
- package/dist/esm/date-helpers-e4d85a67.js.map +0 -1
- package/dist/huibo-ui/p-003cee87.entry.js +0 -2
- package/dist/huibo-ui/p-003cee87.entry.js.map +0 -1
- package/dist/huibo-ui/p-0a033738.entry.js +0 -2
- package/dist/huibo-ui/p-0a033738.entry.js.map +0 -1
- package/dist/huibo-ui/p-0bef78ac.entry.js +0 -2
- package/dist/huibo-ui/p-0bef78ac.entry.js.map +0 -1
- package/dist/huibo-ui/p-0e65e1bd.entry.js.map +0 -1
- package/dist/huibo-ui/p-0f189251.entry.js +0 -2
- package/dist/huibo-ui/p-0f189251.entry.js.map +0 -1
- package/dist/huibo-ui/p-1b5acd6d.entry.js +0 -2
- package/dist/huibo-ui/p-1b5acd6d.entry.js.map +0 -1
- package/dist/huibo-ui/p-231a7335.entry.js.map +0 -1
- package/dist/huibo-ui/p-24ad7eec.entry.js +0 -2
- package/dist/huibo-ui/p-24ad7eec.entry.js.map +0 -1
- package/dist/huibo-ui/p-315feadf.entry.js.map +0 -1
- package/dist/huibo-ui/p-3c7f73c8.entry.js +0 -2
- package/dist/huibo-ui/p-3c7f73c8.entry.js.map +0 -1
- package/dist/huibo-ui/p-4001c08d.entry.js.map +0 -1
- package/dist/huibo-ui/p-44c48246.entry.js +0 -2
- package/dist/huibo-ui/p-44c48246.entry.js.map +0 -1
- package/dist/huibo-ui/p-476527c1.entry.js.map +0 -1
- package/dist/huibo-ui/p-4d0dff15.entry.js +0 -2
- package/dist/huibo-ui/p-58d20809.entry.js +0 -2
- package/dist/huibo-ui/p-58d20809.entry.js.map +0 -1
- package/dist/huibo-ui/p-59b2e61c.entry.js.map +0 -1
- package/dist/huibo-ui/p-64ca0980.entry.js.map +0 -1
- package/dist/huibo-ui/p-672076c3.entry.js.map +0 -1
- package/dist/huibo-ui/p-6b381d0e.entry.js.map +0 -1
- package/dist/huibo-ui/p-710f38de.entry.js.map +0 -1
- package/dist/huibo-ui/p-756acbdb.entry.js +0 -2
- package/dist/huibo-ui/p-756acbdb.entry.js.map +0 -1
- package/dist/huibo-ui/p-75a93de3.entry.js +0 -2
- package/dist/huibo-ui/p-75a93de3.entry.js.map +0 -1
- package/dist/huibo-ui/p-769960f4.entry.js +0 -2
- package/dist/huibo-ui/p-769960f4.entry.js.map +0 -1
- package/dist/huibo-ui/p-7f6975ad.entry.js +0 -2
- package/dist/huibo-ui/p-7f6975ad.entry.js.map +0 -1
- package/dist/huibo-ui/p-85f68526.entry.js.map +0 -1
- package/dist/huibo-ui/p-8d615521.entry.js +0 -2
- package/dist/huibo-ui/p-8d615521.entry.js.map +0 -1
- package/dist/huibo-ui/p-953b9514.entry.js +0 -2
- package/dist/huibo-ui/p-953b9514.entry.js.map +0 -1
- package/dist/huibo-ui/p-965d4d02.entry.js +0 -2
- package/dist/huibo-ui/p-965d4d02.entry.js.map +0 -1
- package/dist/huibo-ui/p-ad6b0c6e.entry.js +0 -2
- package/dist/huibo-ui/p-ad6b0c6e.entry.js.map +0 -1
- package/dist/huibo-ui/p-c1a059d9.entry.js +0 -2
- package/dist/huibo-ui/p-c1a059d9.entry.js.map +0 -1
- package/dist/huibo-ui/p-c1b4eacb.entry.js.map +0 -1
- package/dist/huibo-ui/p-c3e665f6.entry.js.map +0 -1
- package/dist/huibo-ui/p-c3e8893d.entry.js.map +0 -1
- package/dist/huibo-ui/p-cc0aeb50.js +0 -2
- package/dist/huibo-ui/p-cc0aeb50.js.map +0 -1
- package/dist/huibo-ui/p-cf94cbf6.js +0 -2
- package/dist/huibo-ui/p-cf94cbf6.js.map +0 -1
- package/dist/huibo-ui/p-d3939d44.entry.js +0 -2
- package/dist/huibo-ui/p-d3939d44.entry.js.map +0 -1
- package/dist/huibo-ui/p-d64b91ef.entry.js.map +0 -1
- package/dist/huibo-ui/p-dd05cb2c.entry.js +0 -2
- package/dist/huibo-ui/p-dd05cb2c.entry.js.map +0 -1
- package/dist/huibo-ui/p-dfaf7e37.entry.js.map +0 -1
- package/dist/huibo-ui/p-e0ab9010.entry.js.map +0 -1
- package/dist/huibo-ui/p-e9490259.entry.js +0 -2
- package/dist/huibo-ui/p-e9490259.entry.js.map +0 -1
- package/dist/huibo-ui/p-ea74fcae.entry.js.map +0 -1
- package/dist/huibo-ui/p-ebd04656.entry.js +0 -2
- package/dist/huibo-ui/p-ebd04656.entry.js.map +0 -1
- package/dist/huibo-ui/p-ed0ff857.entry.js +0 -2
- package/dist/huibo-ui/p-ed0ff857.entry.js.map +0 -1
- package/dist/huibo-ui/p-f0ac7db5.entry.js +0 -2
- package/dist/huibo-ui/p-f0ac7db5.entry.js.map +0 -1
- package/dist/huibo-ui/p-f81ec512.entry.js.map +0 -1
- /package/dist/huibo-ui/{p-4d0dff15.entry.js.map → p-02f15843.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-f1c084c5.entry.js.map → p-0ddae4e9.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-6ac242fe.entry.js.map → p-14c3b47b.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-8c80a765.entry.js.map → p-15db24e9.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-8b027491.entry.js.map → p-193efdc0.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-8d925e3d.entry.js.map → p-1b0fbe69.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-f374d5a3.entry.js.map → p-20632186.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-e6f2d71d.entry.js.map → p-20fc554b.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-fd19813c.entry.js.map → p-2bcda1bb.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-e0768565.entry.js.map → p-3042f986.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-be48d2aa.entry.js.map → p-3dacb26b.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-6a1ec3ff.entry.js.map → p-3deff48c.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-c321c4aa.entry.js.map → p-412ff618.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-88127de1.entry.js.map → p-55cd13eb.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-58ebb9b3.entry.js.map → p-5c839288.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-a042e3d0.entry.js.map → p-6518c435.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-a0015341.entry.js.map → p-6bfeab80.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-8b1ae77e.entry.js.map → p-746a11a3.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-c922d672.entry.js.map → p-7a682c56.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-8c987d57.entry.js.map → p-7f65dc36.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-463de26d.entry.js.map → p-815fc943.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-d87fc21a.entry.js.map → p-88a6c905.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-77017274.entry.js.map → p-89be7973.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-9319c650.entry.js.map → p-950e7465.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-5df47135.entry.js.map → p-a190ca89.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-477d8568.entry.js.map → p-aeae83af.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-b489a526.entry.js.map → p-b06c8020.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-e2a8a396.entry.js.map → p-b6afe81e.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-2b286698.entry.js.map → p-b7885d4a.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-10c088f3.entry.js.map → p-d9c7c378.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-332c8877.entry.js.map → p-dd9c6459.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-80aca641.entry.js.map → p-dfccc7aa.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-21682e92.entry.js.map → p-dfd144d8.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-079a4130.entry.js.map → p-e3155cd7.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-d7815b4f.entry.js.map → p-e9e7abca.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-2e6584ea.entry.js.map → p-f1f2483f.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-465dcb4c.entry.js.map → p-f2c78699.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-4d8b1404.entry.js.map → p-fd6831f9.entry.js.map} +0 -0
|
@@ -11,6 +11,20 @@
|
|
|
11
11
|
function isActivationKey(key) {
|
|
12
12
|
return key === 'Enter' || key === ' ' || key === 'Spacebar';
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* 生成一个 keydown 处理器:当按下激活键(Enter/Space)时触发元素 click。
|
|
16
|
+
* 用于给 `role="button"` 的 `<span>`/`<div>` 补齐键盘可达性(A3)。
|
|
17
|
+
*
|
|
18
|
+
* 用法:`onKeyDown={activationClickHandler}`
|
|
19
|
+
* 它会读 `event.currentTarget`(即绑定 onKeyDown 的元素)并调 .click(),
|
|
20
|
+
* 并 preventDefault 避免空格滚动页面。
|
|
21
|
+
*/
|
|
22
|
+
function activationClickHandler(e) {
|
|
23
|
+
if (isActivationKey(e.key)) {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
e.currentTarget.click();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
14
28
|
/** 查询容器内可聚焦的元素顺序(tabindex >= 0 的语义元素) */
|
|
15
29
|
const FOCUSABLE_SELECTOR = [
|
|
16
30
|
'a[href]',
|
|
@@ -22,7 +36,7 @@ const FOCUSABLE_SELECTOR = [
|
|
|
22
36
|
'[contenteditable="true"]',
|
|
23
37
|
].join(',');
|
|
24
38
|
function getFocusableElements(container) {
|
|
25
|
-
return Array.from(container.querySelectorAll(FOCUSABLE_SELECTOR)).filter(
|
|
39
|
+
return Array.from(container.querySelectorAll(FOCUSABLE_SELECTOR)).filter(el => el.getAttribute('aria-hidden') !== 'true' && el.style.display !== 'none');
|
|
26
40
|
}
|
|
27
41
|
/**
|
|
28
42
|
* 创建焦点陷阱(Dialog / Drawer 打开时把 Tab 循环限制在容器内)。
|
|
@@ -116,8 +130,9 @@ function handleListKeyboard(event, options) {
|
|
|
116
130
|
}
|
|
117
131
|
}
|
|
118
132
|
|
|
133
|
+
exports.activationClickHandler = activationClickHandler;
|
|
119
134
|
exports.createFocusTrap = createFocusTrap;
|
|
120
135
|
exports.handleListKeyboard = handleListKeyboard;
|
|
121
136
|
exports.isActivationKey = isActivationKey;
|
|
122
137
|
|
|
123
|
-
//# sourceMappingURL=a11y-
|
|
138
|
+
//# sourceMappingURL=a11y-4385c871.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"a11y-4385c871.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;;;;;;;;SAQgB,sBAAsB,CAAC,CAAgB;IACrD,IAAI,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;QAC1B,CAAC,CAAC,cAAc,EAAE,CAAC;QAClB,CAAC,CAAC,aAA6B,CAAC,KAAK,EAAE,CAAC;KAC1C;AACH,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,CAAC,EAAE,IAAI,EAAE,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,MAAM,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC;AACxK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F,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/**\n * 生成一个 keydown 处理器:当按下激活键(Enter/Space)时触发元素 click。\n * 用于给 `role=\"button\"` 的 `<span>`/`<div>` 补齐键盘可达性(A3)。\n *\n * 用法:`onKeyDown={activationClickHandler}`\n * 它会读 `event.currentTarget`(即绑定 onKeyDown 的元素)并调 .click(),\n * 并 preventDefault 避免空格滚动页面。\n */\nexport function activationClickHandler(e: KeyboardEvent): void {\n if (isActivationKey(e.key)) {\n e.preventDefault();\n (e.currentTarget as HTMLElement).click();\n }\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(el => el.getAttribute('aria-hidden') !== 'true' && el.style.display !== 'none');\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 = { type: 'navigate'; index: number } | { type: 'select'; index: number } | { type: 'close' } | { 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}
|
|
@@ -6,12 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
/** 判断两个日期是否为同一天 */
|
|
8
8
|
function isSameDay(date1, date2) {
|
|
9
|
-
return
|
|
10
|
-
date1.getMonth() === date2.getMonth() &&
|
|
11
|
-
date1.getDate() === date2.getDate());
|
|
9
|
+
return date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth() && date1.getDate() === date2.getDate();
|
|
12
10
|
}
|
|
13
11
|
/** 生成 42 天(6 周)的日历网格数据 */
|
|
14
|
-
function getCalendarDays(viewDate, selectedDate, today = new Date()) {
|
|
12
|
+
function getCalendarDays(viewDate, selectedDate, today = new Date(), firstDayOfWeek = 0) {
|
|
15
13
|
const days = [];
|
|
16
14
|
const year = viewDate.getFullYear();
|
|
17
15
|
const month = viewDate.getMonth();
|
|
@@ -19,9 +17,13 @@ function getCalendarDays(viewDate, selectedDate, today = new Date()) {
|
|
|
19
17
|
const lastDay = new Date(year, month + 1, 0);
|
|
20
18
|
const firstDayWeek = firstDay.getDay();
|
|
21
19
|
const daysInMonth = lastDay.getDate();
|
|
20
|
+
// 按 firstDayOfWeek 计算需要补多少上月天数。
|
|
21
|
+
// 默认 firstDayOfWeek=0(周日为首列)时,offset = firstDayWeek;
|
|
22
|
+
// firstDayOfWeek=1(周一为首列)时,周日的 offset 多 1、周一的 offset 为 0。
|
|
23
|
+
const offset = (firstDayWeek - firstDayOfWeek + 7) % 7;
|
|
22
24
|
// 上月填充
|
|
23
25
|
const prevMonth = new Date(year, month - 1, 0);
|
|
24
|
-
for (let i =
|
|
26
|
+
for (let i = offset - 1; i >= 0; i--) {
|
|
25
27
|
const date = new Date(year, month - 1, prevMonth.getDate() - i);
|
|
26
28
|
days.push({
|
|
27
29
|
date,
|
|
@@ -64,13 +66,7 @@ function formatDate(date, format) {
|
|
|
64
66
|
const hours = String(date.getHours()).padStart(2, '0');
|
|
65
67
|
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
66
68
|
const seconds = String(date.getSeconds()).padStart(2, '0');
|
|
67
|
-
return format
|
|
68
|
-
.replace('YYYY', String(year))
|
|
69
|
-
.replace('MM', month)
|
|
70
|
-
.replace('DD', day)
|
|
71
|
-
.replace('HH', hours)
|
|
72
|
-
.replace('mm', minutes)
|
|
73
|
-
.replace('ss', seconds);
|
|
69
|
+
return format.replace('YYYY', String(year)).replace('MM', month).replace('DD', day).replace('HH', hours).replace('mm', minutes).replace('ss', seconds);
|
|
74
70
|
}
|
|
75
71
|
/** 安全解析日期值 */
|
|
76
72
|
function parseDate(value) {
|
|
@@ -113,10 +109,7 @@ function getYearRangeStart(viewDate) {
|
|
|
113
109
|
return year - (year % 12);
|
|
114
110
|
}
|
|
115
111
|
/** 中文月份名称 */
|
|
116
|
-
const MONTH_NAMES = [
|
|
117
|
-
'一月', '二月', '三月', '四月', '五月', '六月',
|
|
118
|
-
'七月', '八月', '九月', '十月', '十一月', '十二月',
|
|
119
|
-
];
|
|
112
|
+
const MONTH_NAMES = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
|
|
120
113
|
/** 中文星期名称 */
|
|
121
114
|
const WEEK_DAY_NAMES = ['日', '一', '二', '三', '四', '五', '六'];
|
|
122
115
|
|
|
@@ -131,4 +124,4 @@ exports.getYearRangeStart = getYearRangeStart;
|
|
|
131
124
|
exports.isSameDay = isSameDay;
|
|
132
125
|
exports.parseDate = parseDate;
|
|
133
126
|
|
|
134
|
-
//# sourceMappingURL=date-helpers-
|
|
127
|
+
//# sourceMappingURL=date-helpers-c05ef385.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"date-helpers-c05ef385.js","mappings":";;AAAA;;;;AAYA;SACgB,SAAS,CAAC,KAAW,EAAE,KAAW;IAChD,OAAO,KAAK,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,WAAW,EAAE,IAAI,KAAK,CAAC,QAAQ,EAAE,KAAK,KAAK,CAAC,QAAQ,EAAE,IAAI,KAAK,CAAC,OAAO,EAAE,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;AACrI,CAAC;AAED;SACgB,eAAe,CAAC,QAAc,EAAE,YAAmB,EAAE,QAAc,IAAI,IAAI,EAAE,EAAE,iBAAyB,CAAC;IACvH,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;;;;IAKtC,MAAM,MAAM,GAAG,CAAC,YAAY,GAAG,cAAc,GAAG,CAAC,IAAI,CAAC,CAAC;;IAGvD,MAAM,S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C,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,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE;AAEtG;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 date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth() && date1.getDate() === date2.getDate();\n}\n\n/** 生成 42 天(6 周)的日历网格数据 */\nexport function getCalendarDays(viewDate: Date, selectedDate?: Date, today: Date = new Date(), firstDayOfWeek: number = 0): 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 // 按 firstDayOfWeek 计算需要补多少上月天数。\n // 默认 firstDayOfWeek=0(周日为首列)时,offset = firstDayWeek;\n // firstDayOfWeek=1(周一为首列)时,周日的 offset 多 1、周一的 offset 为 0。\n const offset = (firstDayWeek - firstDayOfWeek + 7) % 7;\n\n // 上月填充\n const prevMonth = new Date(year, month - 1, 0);\n for (let i = offset - 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.replace('YYYY', String(year)).replace('MM', month).replace('DD', day).replace('HH', hours).replace('mm', minutes).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(viewDate: Date, selectedDate?: Date, startYearBase?: number): 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/** 中文星期名称 */\nexport const WEEK_DAY_NAMES = ['日', '一', '二', '三', '四', '五', '六'];\n"],"version":3}
|
|
@@ -91,7 +91,7 @@ const Affix = class {
|
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
render() {
|
|
94
|
-
return (index.h("div", { key: '
|
|
94
|
+
return (index.h("div", { key: '374ccf4d24df0d0e4ca4dd35b915a34a39669056', class: { 'hb-affix': true, 'hb-affix--fixed': this.affixed }, style: this.affixed ? this.fixedStyle : undefined }, index.h("slot", { key: '5f7c0c1341c274663846cc6d4264129415c6fffc' })));
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
97
|
Affix.style = HbAffixStyle0;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-5aa5c817.js');
|
|
6
|
+
const a11y = require('./a11y-4385c871.js');
|
|
6
7
|
|
|
7
8
|
const alertCss = "/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{appearance:button;background-color:#0000;border:0 solid;border-radius:0;box-sizing:border-box;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;margin:0;margin-inline-end:4px;opacity:1;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);line-height:1.5;tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex;padding-block:0}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}} /*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{}@layer base{}@layer components;:host{display:block}.hb-alert{align-items:flex-start;border-radius:var(--hb-border-radius-base);display:flex;font-size:var(--hb-font-size-sm);gap:var(--hb-spacing-xs);line-height:1.5;padding:var(--hb-spacing-sm)var(--hb-spacing-md)}.hb-alert--center{justify-content:center;text-align:center}.hb-alert__icon{flex-shrink:0;font-size:16px;margin-top:2px}.hb-alert__body{flex:1}.hb-alert__title{font-weight:600}.hb-alert__description{font-size:var(--hb-font-size-xs);margin-top:4px;opacity:.85}.hb-alert__close{cursor:pointer;flex-shrink:0;font-size:16px;opacity:.6}.hb-alert__close:hover{opacity:1}.hb-alert--success{background:var(--hb-color-success-bg);border:1px solid var(--hb-color-success-border);color:var(--hb-color-success)}.hb-alert--warning{background:var(--hb-color-warning-bg);border:1px solid var(--hb-color-warning-border);color:var(--hb-color-warning)}.hb-alert--error{background:var(--hb-color-danger-bg);border:1px solid var(--hb-color-danger-border);color:var(--hb-color-danger)}.hb-alert--info{background:var(--hb-color-primary-bg);border:1px solid var(--hb-color-primary-border);color:var(--hb-color-primary)}@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}";
|
|
8
9
|
const HbAlertStyle0 = alertCss;
|
|
@@ -37,7 +38,7 @@ const Alert = class {
|
|
|
37
38
|
// error/warning 是紧急通告 → role=alert(断言式,屏幕阅读器即时朗读);
|
|
38
39
|
// info/success 是状态信息 → role=status(礼貌式,不打断)。
|
|
39
40
|
const liveRole = this.type === 'error' || this.type === 'warning' ? 'alert' : 'status';
|
|
40
|
-
return (index.h("div", { class: { 'hb-alert': true, [`hb-alert--${this.type}`]: true, 'hb-alert--center': this.center, 'hb-alert--with-description': !!this.description }, role: liveRole }, this.showIcon && index.h("span", { class: "hb-alert__icon", "aria-hidden": "true" }, icons[this.type]), index.h("div", { class: "hb-alert__body" }, index.h("div", { class: "hb-alert__title" }, this.title), this.description && index.h("div", { class: "hb-alert__description" }, this.description)), this.closable && index.h("span", { class: "hb-alert__close", role: "button", "aria-label": "\u5173\u95ED", tabIndex: 0, onClick: this.handleClose }, "\u00D7")));
|
|
41
|
+
return (index.h("div", { class: { 'hb-alert': true, [`hb-alert--${this.type}`]: true, 'hb-alert--center': this.center, 'hb-alert--with-description': !!this.description }, role: liveRole }, this.showIcon && (index.h("span", { class: "hb-alert__icon", "aria-hidden": "true" }, icons[this.type])), index.h("div", { class: "hb-alert__body" }, index.h("div", { class: "hb-alert__title" }, this.title), this.description && index.h("div", { class: "hb-alert__description" }, this.description)), this.closable && (index.h("span", { class: "hb-alert__close", role: "button", "aria-label": "\u5173\u95ED", tabIndex: 0, onClick: this.handleClose, onKeyDown: a11y.activationClickHandler }, "\u00D7"))));
|
|
41
42
|
}
|
|
42
43
|
};
|
|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,CAAC,IAAI,CAAC,CACZ,CACR,EACDA,iBAAK,KAAK,EAAC,gBAAgB,IACzBA,iBAAK,KAAK,EAAC,iBAAiB,IAAE,IAAI,CAAC,KAAK,CAAO,EAC9C,IAAI,CAAC,WAAW,IAAIA,iBAAK,KAAK,EAAC,uBAAuB,IAAE,IAAI,CAAC,WAAW,CAAO,CAC5E,EACL,IAAI,CAAC,QAAQ,KACZA,kBAAM,KAAK,EAAC,iBAAiB,EAAC,IAAI,EAAC,QAAQ,gBAAY,cAAI,EAAC,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,EAAEC,2BAAsB,aAE9H,CACR,CACG,EACN;KACH;;;;;;","names":["h","activationClickHandler"],"sources":["src/components/Alert/alert.css?tag=hb-alert&encapsulation=shadow","src/components/Alert/Alert.tsx"],"sourcesContent":[":host { display: block; }\n.hb-alert {\n display: flex; align-items: flex-start; gap: var(--hb-spacing-xs);\n padding: var(--hb-spacing-sm) var(--hb-spacing-md);\n border-radius: var(--hb-border-radius-base);\n font-size: var(--hb-font-size-sm);\n line-height: 1.5;\n}\n.hb-alert--center { justify-content: center; text-align: center; }\n.hb-alert__icon { font-size: 16px; margin-top: 2px; flex-shrink: 0; }\n.hb-alert__body { flex: 1; }\n.hb-alert__title { font-weight: 600; }\n.hb-alert__description { margin-top: 4px; font-size: var(--hb-font-size-xs); opacity: 0.85; }\n.hb-alert__close { cursor: pointer; font-size: 16px; opacity: 0.6; flex-shrink: 0; }\n.hb-alert__close:hover { opacity: 1; }\n\n.hb-alert--success { background: var(--hb-color-success-bg); color: var(--hb-color-success); border: 1px solid var(--hb-color-success-border); }\n.hb-alert--warning { background: var(--hb-color-warning-bg); color: var(--hb-color-warning); border: 1px solid var(--hb-color-warning-border); }\n.hb-alert--error { background: var(--hb-color-danger-bg); color: var(--hb-color-danger); border: 1px solid var(--hb-color-danger-border); }\n.hb-alert--info { background: var(--hb-color-primary-bg); color: var(--hb-color-primary); border: 1px solid var(--hb-color-primary-border); }\n","import { Component, h, Prop, Event, EventEmitter, State } from '@stencil/core';\nimport { activationClickHandler } from '../../utils/a11y';\n\n/**\n * Alert 警告提示组件\n * 展示需要关注的信息\n */\n@Component({\n tag: 'hb-alert',\n styleUrl: 'alert.css',\n shadow: true,\n})\nexport class Alert {\n /** 标题 */\n @Prop() title: string = '';\n\n /** 描述文字 */\n @Prop() description?: string;\n\n /** 类型 */\n @Prop() type: 'success' | 'warning' | 'info' | 'error' = 'info';\n\n /** 是否可关闭 */\n @Prop() closable: boolean = false;\n\n /** 是否显示图标 */\n @Prop() showIcon: boolean = true;\n\n /** 是否居中 */\n @Prop() center: boolean = false;\n\n @State() closed: boolean = false;\n\n @Event() hbClose: EventEmitter<void>;\n\n private handleClose = () => {\n this.closed = true;\n this.hbClose.emit();\n };\n\n render() {\n if (this.closed) return null;\n const icons: Record<string, string> = { success: '✓', warning: '⚠', info: 'ℹ', error: '✕' };\n // error/warning 是紧急通告 → role=alert(断言式,屏幕阅读器即时朗读);\n // info/success 是状态信息 → role=status(礼貌式,不打断)。\n const liveRole = this.type === 'error' || this.type === 'warning' ? 'alert' : 'status';\n return (\n <div class={{ 'hb-alert': true, [`hb-alert--${this.type}`]: true, 'hb-alert--center': this.center, 'hb-alert--with-description': !!this.description }} role={liveRole}>\n {this.showIcon && (\n <span class=\"hb-alert__icon\" aria-hidden=\"true\">\n {icons[this.type]}\n </span>\n )}\n <div class=\"hb-alert__body\">\n <div class=\"hb-alert__title\">{this.title}</div>\n {this.description && <div class=\"hb-alert__description\">{this.description}</div>}\n </div>\n {this.closable && (\n <span class=\"hb-alert__close\" role=\"button\" aria-label=\"关闭\" tabIndex={0} onClick={this.handleClose} onKeyDown={activationClickHandler}>\n ×\n </span>\n )}\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -20,7 +20,7 @@ const Aside = class {
|
|
|
20
20
|
if (this.width) {
|
|
21
21
|
style.width = this.width;
|
|
22
22
|
}
|
|
23
|
-
return (index.h("aside", { key: '
|
|
23
|
+
return (index.h("aside", { key: '2615bba7300b1d86fa82a1618718e07479f41348', class: "hb-aside", style: style }, index.h("slot", { key: 'dd4ad7e905f2ea8c72bc4d70c82ab0a13bed5e0f' })));
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
Aside.style = HbAsideStyle0;
|
|
@@ -21,7 +21,7 @@ const Avatar = class {
|
|
|
21
21
|
return typeof this.size === 'number' ? `${this.size}px` : map[this.size];
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
|
-
return (index.h("span", { key: '
|
|
24
|
+
return (index.h("span", { key: '41fda719b0c3d2ca0a562a0b4ff98e3705cac0c0', class: { 'hb-avatar': true, [`hb-avatar--${this.shape}`]: true }, style: { width: this.sizePx, height: this.sizePx, fontSize: `calc(${this.sizePx} * 0.45)` } }, this.src ? index.h("img", { src: this.src, alt: this.alt }) : this.icon ? index.h("span", null, this.icon) : index.h("slot", null)));
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
Avatar.style = HbAvatarStyle0;
|
|
@@ -85,12 +85,12 @@ const Backtop = class {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
render() {
|
|
88
|
-
return (index.h(index.Host, { key: '
|
|
88
|
+
return (index.h(index.Host, { key: '5406d83477f015dc770e46c3e495a5c036effa61', class: { 'hb-backtop': true, 'hb-backtop--hidden': !this.visible }, style: {
|
|
89
89
|
right: `${this.right}px`,
|
|
90
90
|
bottom: `${this.bottom}px`,
|
|
91
91
|
visibility: this.visible ? 'visible' : 'hidden',
|
|
92
92
|
opacity: this.visible ? '1' : '0',
|
|
93
|
-
} }, index.h("div", { key: '
|
|
93
|
+
} }, index.h("div", { key: 'dd75722c174dc48fd77ca0342955745a8e233f98', class: "hb-backtop__inner", onClick: this.scrollToTop }, index.h("slot", { key: '7dda375453258d76e61720d5689cbe79dd564046' }, index.h("span", { key: '96bf90719eff982610a4bcd44367c2250ebedfd4', class: "hb-backtop__icon" }, "\u2191")))));
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
Backtop.style = HbBacktopStyle0;
|
|
@@ -25,7 +25,7 @@ const Badge = class {
|
|
|
25
25
|
return String(this.value);
|
|
26
26
|
}
|
|
27
27
|
render() {
|
|
28
|
-
return (index.h("div", { key: '
|
|
28
|
+
return (index.h("div", { key: 'f8c6ce8c0c83e0a6332f305c4e1d83e42f0ed8da', class: "hb-badge" }, index.h("slot", { key: 'c7a52c406aaa545972888f4761b0e8637e5a76f9' }), !this.hidden && (index.h("sup", { key: '9786f19cb8fc171d7265b0d14624e51d6b72a250', class: { 'hb-badge__content': true, [`hb-badge__content--${this.type}`]: true, 'hb-badge__content--dot': this.isDot } }, this.displayValue))));
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
Badge.style = HbBadgeStyle0;
|
|
@@ -16,7 +16,7 @@ const BreadcrumbItem = class {
|
|
|
16
16
|
// 从父级 hb-breadcrumb 读取分隔符 prop
|
|
17
17
|
// 优先级:item 的 separator slot > breadcrumb.separator > 默认 '/'
|
|
18
18
|
const parentSeparator = this.el.closest('hb-breadcrumb')?.separator;
|
|
19
|
-
return (index.h("span", { key: '
|
|
19
|
+
return (index.h("span", { key: '181c8e289f83b6a95445bee02ae0e6405a3ac7c7', class: "hb-breadcrumb-item" }, index.h(Tag, { key: 'af828de3d06e5a41c52b23b874d0b211a44e4169', class: "hb-breadcrumb-item__inner", href: this.href }, index.h("slot", { key: '0c4b87ea5809acd5e2b2d53f59011a32fae8d370' })), index.h("span", { key: '106653462a241dcc2a64556b4a5bae60a548d766', class: "hb-breadcrumb-item__separator" }, index.h("slot", { key: '905f0e3fffa0a2d7452065f95f33c39c4c3382b8', name: "separator" }, parentSeparator ?? '/'))));
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -14,7 +14,7 @@ const Breadcrumb = class {
|
|
|
14
14
|
/** 分隔符 */
|
|
15
15
|
separator = '/';
|
|
16
16
|
render() {
|
|
17
|
-
return (index.h("nav", { key: '
|
|
17
|
+
return (index.h("nav", { key: '404e3b9cb740956fa8e3f12ca91efec1d3d0a03b', class: "hb-breadcrumb", "aria-label": "Breadcrumb" }, index.h("slot", { key: '8fac787347489530954f2edbe79dab5d05ce7ef4' })));
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
Breadcrumb.style = HbBreadcrumbStyle0;
|
|
@@ -22,14 +22,14 @@ const Button = class {
|
|
|
22
22
|
/** 是否加载中 */
|
|
23
23
|
loading = false;
|
|
24
24
|
render() {
|
|
25
|
-
return (index.h("button", { key: '
|
|
25
|
+
return (index.h("button", { key: '77ba452cfa960b02e746b2494aa1f471a85d33fd', disabled: this.disabled || this.loading, class: {
|
|
26
26
|
'hb-button': true,
|
|
27
27
|
[`hb-button--${this.type}`]: true,
|
|
28
28
|
[`hb-button--${this.size}`]: true,
|
|
29
29
|
'hb-button--disabled': this.disabled,
|
|
30
30
|
'hb-button--loading': this.loading,
|
|
31
31
|
[this.classNames]: !!this.classNames,
|
|
32
|
-
} }, this.loading && index.h("span", { key: '
|
|
32
|
+
} }, this.loading && index.h("span", { key: '152d4a7657ba8399554782c7abd38a6c5b26de17', class: "hb-button__loading-icon" }, "\u23F3"), index.h("slot", { key: '9381db3ab788d9bfe73c8b29d422642d1a8eacbc' })));
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
Button.style = HbButtonStyle0;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-5aa5c817.js');
|
|
6
|
-
const dateHelpers = require('./date-helpers-
|
|
6
|
+
const dateHelpers = require('./date-helpers-c05ef385.js');
|
|
7
7
|
|
|
8
|
-
const calendarCss = "/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{appearance:button;background-color:#0000;border:0 solid;border-radius:0;box-sizing:border-box;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;margin:0;margin-inline-end:4px;opacity:1;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);line-height:1.5;tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex;padding-block:0}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}} /*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{}@layer base{}@layer components;:host{display:block}.hb-calendar{background-color:var(--hb-color-white,#fff);border-radius:4px;box-sizing:border-box;padding:12px;width:100%}.hb-calendar__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:12px}.hb-calendar__header-label{color:var(--hb-color-text-regular,#606266);font-size:14px;font-weight:600}.hb-calendar__next-btn,.hb-calendar__prev-btn{background:0 0;border:none;color:var(--hb-color-text-regular,#606266);cursor:pointer;font-size:18px;line-height:1;padding:4px 8px;transition:color .2s}.hb-calendar__next-btn:hover,.hb-calendar__prev-btn:hover{color:var(--hb-color-primary)}.hb-calendar__weekdays{display:grid;gap:4px;grid-template-columns:repeat(7,1fr);margin-bottom:8px}.hb-calendar__weekday{color:var(--hb-color-text-placeholder,#c0c4cc);font-size:12px;font-weight:500;padding:4px 0;text-align:center}.hb-calendar__days{display:grid;gap:4px;grid-template-columns:repeat(7,1fr)}.hb-calendar__day{align-items:center;aspect-ratio:1;border-radius:4px;color:var(--hb-color-text-regular,#606266);cursor:pointer;display:flex;font-size:13px;justify-content:center;transition:all .2s;-webkit-user-select:none;user-select:none}.hb-calendar__day:hover:not(.hb-calendar__day--other-month){background-color:var(--hb-fill-color-light,#f5f7fa)}.hb-calendar__day--other-month{color:var(--hb-color-text-placeholder,#c0c4cc);cursor:default}.hb-calendar__day--today{color:var(--hb-color-primary);font-weight:600}.hb-calendar__day--selected{color:var(--hb-color-white,#fff)}.hb-calendar__day--selected,.hb-calendar__day--selected:hover{background-color:var(--hb-color-primary)}@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}";
|
|
8
|
+
const calendarCss = "/*! 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{.grid{display:grid}.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-calendar{background-color:var(--hb-color-white,#fff);border-radius:4px;box-sizing:border-box;padding:12px;width:100%}.hb-calendar__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:12px}.hb-calendar__header-label{color:var(--hb-color-text-regular,#606266);font-size:14px;font-weight:600}.hb-calendar__next-btn,.hb-calendar__prev-btn{background:0 0;border:none;color:var(--hb-color-text-regular,#606266);cursor:pointer;font-size:18px;line-height:1;padding:4px 8px;transition:color .2s}.hb-calendar__next-btn:hover,.hb-calendar__prev-btn:hover{color:var(--hb-color-primary)}.hb-calendar__weekdays{display:grid;gap:4px;grid-template-columns:repeat(7,1fr);margin-bottom:8px}.hb-calendar__weekday{color:var(--hb-color-text-placeholder,#c0c4cc);font-size:12px;font-weight:500;padding:4px 0;text-align:center}.hb-calendar__days{display:grid;gap:4px;grid-template-columns:repeat(7,1fr)}.hb-calendar__day{align-items:center;aspect-ratio:1;border-radius:4px;color:var(--hb-color-text-regular,#606266);cursor:pointer;display:flex;font-size:13px;justify-content:center;transition:all .2s;-webkit-user-select:none;user-select:none}.hb-calendar__day:hover:not(.hb-calendar__day--other-month){background-color:var(--hb-fill-color-light,#f5f7fa)}.hb-calendar__day--other-month{color:var(--hb-color-text-placeholder,#c0c4cc);cursor:default}.hb-calendar__day--today{color:var(--hb-color-primary);font-weight:600}.hb-calendar__day--selected{color:var(--hb-color-white,#fff)}.hb-calendar__day--selected,.hb-calendar__day--selected:hover{background-color:var(--hb-color-primary)}.hb-calendar__day--focused{outline:2px solid var(--hb-color-primary,#1677ff);outline-offset:-2px}.hb-calendar__day--disabled{color:var(--hb-color-text-disabled,#c0c4cc);cursor:not-allowed;opacity:.5}.hb-calendar__day--disabled:hover{background-color:#0000}@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}";
|
|
9
9
|
const HbCalendarStyle0 = calendarCss;
|
|
10
10
|
|
|
11
11
|
const Calendar = class {
|
|
@@ -32,6 +32,8 @@ const Calendar = class {
|
|
|
32
32
|
hbChange;
|
|
33
33
|
viewDate = new Date();
|
|
34
34
|
selectedDate;
|
|
35
|
+
/** 键盘导航的焦点日期(用于 role=gridcell 的 roving tabindex) */
|
|
36
|
+
focusDate = new Date();
|
|
35
37
|
componentDidLoad() {
|
|
36
38
|
this.initFromModelValue();
|
|
37
39
|
}
|
|
@@ -43,6 +45,11 @@ const Calendar = class {
|
|
|
43
45
|
this.selectedDate = parsed;
|
|
44
46
|
if (parsed) {
|
|
45
47
|
this.viewDate = new Date(parsed.getFullYear(), parsed.getMonth(), 1);
|
|
48
|
+
this.focusDate = new Date(parsed);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
// 无选中值时焦点默认到今天
|
|
52
|
+
this.focusDate = new Date();
|
|
46
53
|
}
|
|
47
54
|
}
|
|
48
55
|
handleSelect = (day) => {
|
|
@@ -51,10 +58,65 @@ const Calendar = class {
|
|
|
51
58
|
if (this.disabledDate && this.disabledDate(day.date))
|
|
52
59
|
return;
|
|
53
60
|
this.selectedDate = day.date;
|
|
61
|
+
this.focusDate = new Date(day.date);
|
|
54
62
|
const iso = this.toISODate(day.date);
|
|
55
63
|
this.modelValue = iso;
|
|
56
64
|
this.hbChange.emit(iso);
|
|
57
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
* 日期网格键盘导航(对齐 WAI-ARIA grid / antd Calendar):
|
|
68
|
+
* - ArrowRight/Left:±1 天
|
|
69
|
+
* - ArrowDown/Up:±7 天
|
|
70
|
+
* - Home/End:当周首/末日
|
|
71
|
+
* - PageDown/Up:±1 月
|
|
72
|
+
* - Enter:选中焦点日
|
|
73
|
+
* 焦点日跨月时同步滚动 viewDate。
|
|
74
|
+
*/
|
|
75
|
+
handleGridKeydown = (e) => {
|
|
76
|
+
const next = new Date(this.focusDate);
|
|
77
|
+
switch (e.key) {
|
|
78
|
+
case 'ArrowRight':
|
|
79
|
+
next.setDate(next.getDate() + 1);
|
|
80
|
+
break;
|
|
81
|
+
case 'ArrowLeft':
|
|
82
|
+
next.setDate(next.getDate() - 1);
|
|
83
|
+
break;
|
|
84
|
+
case 'ArrowDown':
|
|
85
|
+
next.setDate(next.getDate() + 7);
|
|
86
|
+
break;
|
|
87
|
+
case 'ArrowUp':
|
|
88
|
+
next.setDate(next.getDate() - 7);
|
|
89
|
+
break;
|
|
90
|
+
case 'Home': {
|
|
91
|
+
const d = next.getDay();
|
|
92
|
+
next.setDate(next.getDate() - d);
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
case 'End': {
|
|
96
|
+
const d = 6 - next.getDay();
|
|
97
|
+
next.setDate(next.getDate() + d);
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
case 'PageDown':
|
|
101
|
+
next.setMonth(next.getMonth() + 1);
|
|
102
|
+
break;
|
|
103
|
+
case 'PageUp':
|
|
104
|
+
next.setMonth(next.getMonth() - 1);
|
|
105
|
+
break;
|
|
106
|
+
case 'Enter':
|
|
107
|
+
e.preventDefault();
|
|
108
|
+
this.handleSelect({ date: this.focusDate, isCurrentMonth: true });
|
|
109
|
+
return;
|
|
110
|
+
default:
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
e.preventDefault();
|
|
114
|
+
// 焦点跨月:viewDate 跟随(PageUp/Down 或方向键滑出)
|
|
115
|
+
if (next.getMonth() !== this.viewDate.getMonth() || next.getFullYear() !== this.viewDate.getFullYear()) {
|
|
116
|
+
this.viewDate = new Date(next.getFullYear(), next.getMonth(), 1);
|
|
117
|
+
}
|
|
118
|
+
this.focusDate = next;
|
|
119
|
+
};
|
|
58
120
|
toISODate(date) {
|
|
59
121
|
const y = date.getFullYear();
|
|
60
122
|
const m = String(date.getMonth() + 1).padStart(2, '0');
|
|
@@ -64,20 +126,26 @@ const Calendar = class {
|
|
|
64
126
|
changeMonth(delta) {
|
|
65
127
|
this.viewDate = dateHelpers.addMonths(this.viewDate, delta);
|
|
66
128
|
}
|
|
67
|
-
/** 按 firstDayOfWeek
|
|
129
|
+
/** 按 firstDayOfWeek 重排星期标题;getCalendarDays 也按同一 firstDayOfWeek 对齐网格 */
|
|
68
130
|
get orderedWeekNames() {
|
|
69
131
|
const offset = ((this.firstDayOfWeek % 7) + 7) % 7;
|
|
70
132
|
return [...dateHelpers.WEEK_DAY_NAMES.slice(offset), ...dateHelpers.WEEK_DAY_NAMES.slice(0, offset)];
|
|
71
133
|
}
|
|
72
134
|
render() {
|
|
73
|
-
const days = dateHelpers.getCalendarDays(this.viewDate, this.selectedDate);
|
|
135
|
+
const days = dateHelpers.getCalendarDays(this.viewDate, this.selectedDate, new Date(), this.firstDayOfWeek);
|
|
74
136
|
const current = this.viewDate;
|
|
75
|
-
return (index.h("div", { key: '
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
137
|
+
return (index.h("div", { key: '93d05f6bffa7431d3e957d4e99113faeaa4c3314', class: "hb-calendar" }, index.h("div", { key: '27d4364c5d5302a284fa14b9a72421548808cd1d', class: "hb-calendar__header" }, index.h("button", { key: '0665e23eb52ceb41d89e79d3eea8f4de70085dd5', type: "button", class: "hb-calendar__prev-btn", onClick: () => this.changeMonth(-1), "aria-label": "\u4E0A\u4E00\u6708" }, "\u2039"), index.h("span", { key: '40620771f91edb847d4979d47a7bf35f6ccc3c8f', class: "hb-calendar__header-label", "aria-live": "polite" }, current.getFullYear(), "\u5E74 ", dateHelpers.MONTH_NAMES[current.getMonth()]), index.h("button", { key: '0707cec8950af171a6eabe1bf8872e5b6681109a', type: "button", class: "hb-calendar__next-btn", onClick: () => this.changeMonth(1), "aria-label": "\u4E0B\u4E00\u6708" }, "\u203A")), index.h("div", { key: '2637f3cbdf27e4a1883ec91421287129b16ed849', class: "hb-calendar__body", role: "grid", "aria-label": `${current.getFullYear()}年${current.getMonth() + 1}月日历` }, index.h("div", { key: '19123fefb853bf7c3cd64a7f47159406a8e36806', class: "hb-calendar__weekdays", role: "row" }, this.orderedWeekNames.map(day => (index.h("div", { class: "hb-calendar__weekday", role: "columnheader", "aria-disabled": "true" }, day)))), index.h("div", { key: '7eeee10f18915e83d3f9e7d5127768e6d67b5496', class: "hb-calendar__days", role: "row", onKeyDown: this.handleGridKeydown }, days.map((day, index$1) => {
|
|
138
|
+
const isFocused = dateHelpers.isSameDay(day.date, this.focusDate);
|
|
139
|
+
const dayDisabled = day.isCurrentMonth && !!this.disabledDate && this.disabledDate(day.date);
|
|
140
|
+
return (index.h("div", { key: index$1, class: {
|
|
141
|
+
'hb-calendar__day': true,
|
|
142
|
+
'hb-calendar__day--other-month': !day.isCurrentMonth,
|
|
143
|
+
'hb-calendar__day--today': day.isToday,
|
|
144
|
+
'hb-calendar__day--selected': day.isSelected,
|
|
145
|
+
'hb-calendar__day--focused': isFocused,
|
|
146
|
+
'hb-calendar__day--disabled': dayDisabled,
|
|
147
|
+
}, role: "gridcell", tabindex: isFocused ? 0 : -1, "aria-selected": day.isSelected ? 'true' : 'false', "aria-current": day.isToday ? 'date' : undefined, "aria-disabled": !day.isCurrentMonth || dayDisabled ? 'true' : undefined, "aria-label": this.toISODate(day.date), onClick: () => this.handleSelect(day) }, day.date.getDate()));
|
|
148
|
+
})))));
|
|
81
149
|
}
|
|
82
150
|
static get watchers() { return {
|
|
83
151
|
"modelValue": ["handleModelValueChange"]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"hb-calendar.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,WAAW,GAAG,4rOAA4rO,CAAC;AACjtO,yBAAe,WAAW;;MCiBb,QAAQ;;;;;;;;IAIM,UAAU,CAAU;;;;;IAMrC,cAAc,GAAW,CAAC,CAAC;;;;IAK3B,YAAY,CAA2B;;;;IAKtC,QAAQ,CAAuB;IAE/B,QAAQ,GAAS,IAAI,IAAI,EAAE,CAAC;IAC5B,YAAY,CAAQ;IAE7B,gBAAgB;QACd,IAAI,CAAC,kBAAkB,EAAE,CAAC;KAC3B;IAGD,sBAAsB;QACp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ACnBF,iBACE,GAAG,EAAEE,OAAK,EACV,KAAK,EAAE;gBACL,kBAAkB,EAAE,IAAI;gBACxB,+BAA+B,EAAE,CAAC,GAAG,CAAC,cAAc;gBACpD,yBAAyB,EAAE,GAAG,CAAC,OAAO;gBACtC,4BAA4B,EAAE,GAAG,CAAC,UAAU;aAC7C,EACD,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAEpC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CACf,CACP,CAAC,CACE,CACF,CACF,EACN;KACH;;;;;;;;;","names":["parseDate","addMonths","WEEK_DAY_NAMES","getCalendarDays","h","MONTH_NAMES","index"],"sources":["src/components/Calendar/calendar.css?tag=hb-calendar&encapsulation=shadow","src/components/Calendar/Calendar.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.hb-calendar {\n width: 100%;\n padding: 12px;\n box-sizing: border-box;\n background-color: var(--hb-color-white, #ffffff);\n border-radius: 4px;\n}\n\n/* 头部:年月 + 上下月按钮 */\n.hb-calendar__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 12px;\n}\n\n.hb-calendar__header-label {\n font-weight: 600;\n font-size: 14px;\n color: var(--hb-color-text-regular, #606266);\n}\n\n.hb-calendar__prev-btn,\n.hb-calendar__next-btn {\n background: none;\n border: none;\n font-size: 18px;\n cursor: pointer;\n color: var(--hb-color-text-regular, #606266);\n padding: 4px 8px;\n line-height: 1;\n transition: color 0.2s;\n}\n\n.hb-calendar__prev-btn:hover,\n.hb-calendar__next-btn:hover {\n color: var(--hb-color-primary);\n}\n\n/* 星期行 */\n.hb-calendar__weekdays {\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n gap: 4px;\n margin-bottom: 8px;\n}\n\n.hb-calendar__weekday {\n text-align: center;\n font-size: 12px;\n color: var(--hb-color-text-placeholder, #c0c4cc);\n font-weight: 500;\n padding: 4px 0;\n}\n\n/* 日期网格 */\n.hb-calendar__days {\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n gap: 4px;\n}\n\n.hb-calendar__day {\n aspect-ratio: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 13px;\n color: var(--hb-color-text-regular, #606266);\n cursor: pointer;\n border-radius: 4px;\n transition: all 0.2s;\n user-select: none;\n}\n\n.hb-calendar__day:hover:not(.hb-calendar__day--other-month) {\n background-color: var(--hb-fill-color-light, #f5f7fa);\n}\n\n.hb-calendar__day--other-month {\n color: var(--hb-color-text-placeholder, #c0c4cc);\n cursor: default;\n}\n\n.hb-calendar__day--today {\n color: var(--hb-color-primary);\n font-weight: 600;\n}\n\n.hb-calendar__day--selected {\n background-color: var(--hb-color-primary);\n color: var(--hb-color-white, #ffffff);\n}\n\n.hb-calendar__day--selected:hover {\n background-color: var(--hb-color-primary);\n}\n","import { Component, h, Prop, Event, EventEmitter, State, Watch } from '@stencil/core';\nimport {\n getCalendarDays,\n parseDate,\n addMonths,\n MONTH_NAMES,\n WEEK_DAY_NAMES,\n} from '../../utils/date-helpers';\n\n/**\n * Calendar 日历组件\n * 月份视图日历,支持选中日期与月份切换\n */\n@Component({\n tag: 'hb-calendar',\n styleUrl: 'calendar.css',\n shadow: true,\n})\nexport class Calendar {\n /**\n * 绑定值(ISO 日期字符串)\n */\n @Prop({ mutable: true }) modelValue?: string;\n\n /**\n * 每周第一天(0=周日,1=周一 …)\n * @default 0\n */\n @Prop() firstDayOfWeek: number = 0;\n\n /**\n * 禁用日期判定(声明预留,暂不强求实现)\n */\n @Prop() disabledDate?: (date: Date) => boolean;\n\n /**\n * 值改变事件,detail 为 ISO 日期字符串\n */\n @Event() hbChange: EventEmitter<string>;\n\n @State() viewDate: Date = new Date();\n @State() selectedDate?: Date;\n\n componentDidLoad() {\n this.initFromModelValue();\n }\n\n @Watch('modelValue')\n handleModelValueChange() {\n this.initFromModelValue();\n }\n\n private initFromModelValue() {\n const parsed = parseDate(this.modelValue);\n this.selectedDate = parsed;\n if (parsed) {\n this.viewDate = new Date(parsed.getFullYear(), parsed.getMonth(), 1);\n }\n }\n\n private handleSelect = (day: { date: Date; isCurrentMonth: boolean }) => {\n if (!day.isCurrentMonth) return;\n if (this.disabledDate && this.disabledDate(day.date)) return;\n this.selectedDate = day.date;\n const iso = this.toISODate(day.date);\n this.modelValue = iso;\n this.hbChange.emit(iso);\n };\n\n private toISODate(date: Date): string {\n const y = date.getFullYear();\n const m = String(date.getMonth() + 1).padStart(2, '0');\n const d = String(date.getDate()).padStart(2, '0');\n return `${y}-${m}-${d}`;\n }\n\n private changeMonth(delta: number) {\n this.viewDate = addMonths(this.viewDate, delta);\n }\n\n /** 按 firstDayOfWeek 重排星期标题(getCalendarDays 网格恒以周日为首列) */\n private get orderedWeekNames(): string[] {\n const offset = ((this.firstDayOfWeek % 7) + 7) % 7;\n return [...WEEK_DAY_NAMES.slice(offset), ...WEEK_DAY_NAMES.slice(0, offset)];\n }\n\n render() {\n const days = getCalendarDays(this.viewDate, this.selectedDate);\n const current = this.viewDate;\n\n return (\n <div class=\"hb-calendar\">\n <div class=\"hb-calendar__header\">\n <button\n type=\"button\"\n class=\"hb-calendar__prev-btn\"\n onClick={() => this.changeMonth(-1)}\n aria-label=\"上一月\"\n >\n ‹\n </button>\n <span class=\"hb-calendar__header-label\">\n {current.getFullYear()}年 {MONTH_NAMES[current.getMonth()]}\n </span>\n <button\n type=\"button\"\n class=\"hb-calendar__next-btn\"\n onClick={() => this.changeMonth(1)}\n aria-label=\"下一月\"\n >\n ›\n </button>\n </div>\n <div class=\"hb-calendar__body\">\n <div class=\"hb-calendar__weekdays\">\n {this.orderedWeekNames.map((day) => (\n <div class=\"hb-calendar__weekday\">{day}</div>\n ))}\n </div>\n <div class=\"hb-calendar__days\">\n {days.map((day, index) => (\n <div\n key={index}\n class={{\n 'hb-calendar__day': true,\n 'hb-calendar__day--other-month': !day.isCurrentMonth,\n 'hb-calendar__day--today': day.isToday,\n 'hb-calendar__day--selected': day.isSelected,\n }}\n onClick={() => this.handleSelect(day)}\n >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;KACH;;;;;;;;;","names":["parseDate","addMonths","WEEK_DAY_NAMES","getCalendarDays","h","MONTH_NAMES","index","isSameDay"],"sources":["src/components/Calendar/calendar.css?tag=hb-calendar&encapsulation=shadow","src/components/Calendar/Calendar.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.hb-calendar {\n width: 100%;\n padding: 12px;\n box-sizing: border-box;\n background-color: var(--hb-color-white, #ffffff);\n border-radius: 4px;\n}\n\n/* 头部:年月 + 上下月按钮 */\n.hb-calendar__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 12px;\n}\n\n.hb-calendar__header-label {\n font-weight: 600;\n font-size: 14px;\n color: var(--hb-color-text-regular, #606266);\n}\n\n.hb-calendar__prev-btn,\n.hb-calendar__next-btn {\n background: none;\n border: none;\n font-size: 18px;\n cursor: pointer;\n color: var(--hb-color-text-regular, #606266);\n padding: 4px 8px;\n line-height: 1;\n transition: color 0.2s;\n}\n\n.hb-calendar__prev-btn:hover,\n.hb-calendar__next-btn:hover {\n color: var(--hb-color-primary);\n}\n\n/* 星期行 */\n.hb-calendar__weekdays {\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n gap: 4px;\n margin-bottom: 8px;\n}\n\n.hb-calendar__weekday {\n text-align: center;\n font-size: 12px;\n color: var(--hb-color-text-placeholder, #c0c4cc);\n font-weight: 500;\n padding: 4px 0;\n}\n\n/* 日期网格 */\n.hb-calendar__days {\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n gap: 4px;\n}\n\n.hb-calendar__day {\n aspect-ratio: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 13px;\n color: var(--hb-color-text-regular, #606266);\n cursor: pointer;\n border-radius: 4px;\n transition: all 0.2s;\n user-select: none;\n}\n\n.hb-calendar__day:hover:not(.hb-calendar__day--other-month) {\n background-color: var(--hb-fill-color-light, #f5f7fa);\n}\n\n.hb-calendar__day--other-month {\n color: var(--hb-color-text-placeholder, #c0c4cc);\n cursor: default;\n}\n\n.hb-calendar__day--today {\n color: var(--hb-color-primary);\n font-weight: 600;\n}\n\n.hb-calendar__day--selected {\n background-color: var(--hb-color-primary);\n color: var(--hb-color-white, #ffffff);\n}\n\n.hb-calendar__day--selected:hover {\n background-color: var(--hb-color-primary);\n}\n\n/* 键盘焦点日(roving tabindex 的可见焦点态) */\n.hb-calendar__day--focused {\n outline: 2px solid var(--hb-color-primary, #1677ff);\n outline-offset: -2px;\n}\n\n.hb-calendar__day--disabled {\n color: var(--hb-color-text-disabled, #c0c4cc);\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n.hb-calendar__day--disabled:hover {\n background-color: transparent;\n}\n","import { Component, h, Prop, Event, EventEmitter, State, Watch } from '@stencil/core';\nimport { getCalendarDays, parseDate, addMonths, isSameDay, MONTH_NAMES, WEEK_DAY_NAMES } from '../../utils/date-helpers';\n\n/**\n * Calendar 日历组件\n * 月份视图日历,支持选中日期与月份切换\n */\n@Component({\n tag: 'hb-calendar',\n styleUrl: 'calendar.css',\n shadow: true,\n})\nexport class Calendar {\n /**\n * 绑定值(ISO 日期字符串)\n */\n @Prop({ mutable: true }) modelValue?: string;\n\n /**\n * 每周第一天(0=周日,1=周一 …)\n * @default 0\n */\n @Prop() firstDayOfWeek: number = 0;\n\n /**\n * 禁用日期判定(声明预留,暂不强求实现)\n */\n @Prop() disabledDate?: (date: Date) => boolean;\n\n /**\n * 值改变事件,detail 为 ISO 日期字符串\n */\n @Event() hbChange: EventEmitter<string>;\n\n @State() viewDate: Date = new Date();\n @State() selectedDate?: Date;\n /** 键盘导航的焦点日期(用于 role=gridcell 的 roving tabindex) */\n @State() focusDate: Date = new Date();\n\n componentDidLoad() {\n this.initFromModelValue();\n }\n\n @Watch('modelValue')\n handleModelValueChange() {\n this.initFromModelValue();\n }\n\n private initFromModelValue() {\n const parsed = parseDate(this.modelValue);\n this.selectedDate = parsed;\n if (parsed) {\n this.viewDate = new Date(parsed.getFullYear(), parsed.getMonth(), 1);\n this.focusDate = new Date(parsed);\n } else {\n // 无选中值时焦点默认到今天\n this.focusDate = new Date();\n }\n }\n\n private handleSelect = (day: { date: Date; isCurrentMonth: boolean }) => {\n if (!day.isCurrentMonth) return;\n if (this.disabledDate && this.disabledDate(day.date)) return;\n this.selectedDate = day.date;\n this.focusDate = new Date(day.date);\n const iso = this.toISODate(day.date);\n this.modelValue = iso;\n this.hbChange.emit(iso);\n };\n\n /**\n * 日期网格键盘导航(对齐 WAI-ARIA grid / antd Calendar):\n * - ArrowRight/Left:±1 天\n * - ArrowDown/Up:±7 天\n * - Home/End:当周首/末日\n * - PageDown/Up:±1 月\n * - Enter:选中焦点日\n * 焦点日跨月时同步滚动 viewDate。\n */\n private handleGridKeydown = (e: KeyboardEvent) => {\n const next = new Date(this.focusDate);\n let monthDelta = 0;\n switch (e.key) {\n case 'ArrowRight':\n next.setDate(next.getDate() + 1);\n break;\n case 'ArrowLeft':\n next.setDate(next.getDate() - 1);\n break;\n case 'ArrowDown':\n next.setDate(next.getDate() + 7);\n break;\n case 'ArrowUp':\n next.setDate(next.getDate() - 7);\n break;\n case 'Home': {\n const d = next.getDay();\n next.setDate(next.getDate() - d);\n break;\n }\n case 'End': {\n const d = 6 - next.getDay();\n next.setDate(next.getDate() + d);\n break;\n }\n case 'PageDown':\n next.setMonth(next.getMonth() + 1);\n monthDelta = 1;\n break;\n case 'PageUp':\n next.setMonth(next.getMonth() - 1);\n monthDelta = -1;\n break;\n case 'Enter':\n e.preventDefault();\n this.handleSelect({ date: this.focusDate, isCurrentMonth: true });\n return;\n default:\n return;\n }\n e.preventDefault();\n // 焦点跨月:viewDate 跟随(PageUp/Down 或方向键滑出)\n if (next.getMonth() !== this.viewDate.getMonth() || next.getFullYear() !== this.viewDate.getFullYear()) {\n this.viewDate = new Date(next.getFullYear(), next.getMonth(), 1);\n }\n if (monthDelta) void monthDelta;\n this.focusDate = next;\n };\n\n private toISODate(date: Date): string {\n const y = date.getFullYear();\n const m = String(date.getMonth() + 1).padStart(2, '0');\n const d = String(date.getDate()).padStart(2, '0');\n return `${y}-${m}-${d}`;\n }\n\n private changeMonth(delta: number) {\n this.viewDate = addMonths(this.viewDate, delta);\n }\n\n /** 按 firstDayOfWeek 重排星期标题;getCalendarDays 也按同一 firstDayOfWeek 对齐网格 */\n private get orderedWeekNames(): string[] {\n const offset = ((this.firstDayOfWeek % 7) + 7) % 7;\n return [...WEEK_DAY_NAMES.slice(offset), ...WEEK_DAY_NAMES.slice(0, offset)];\n }\n\n render() {\n const days = getCalendarDays(this.viewDate, this.selectedDate, new Date(), this.firstDayOfWeek);\n const current = this.viewDate;\n\n return (\n <div class=\"hb-calendar\">\n <div class=\"hb-calendar__header\">\n <button type=\"button\" class=\"hb-calendar__prev-btn\" onClick={() => this.changeMonth(-1)} aria-label=\"上一月\">\n ‹\n </button>\n <span class=\"hb-calendar__header-label\" aria-live=\"polite\">\n {current.getFullYear()}年 {MONTH_NAMES[current.getMonth()]}\n </span>\n <button type=\"button\" class=\"hb-calendar__next-btn\" onClick={() => this.changeMonth(1)} aria-label=\"下一月\">\n ›\n </button>\n </div>\n <div class=\"hb-calendar__body\" role=\"grid\" aria-label={`${current.getFullYear()}年${current.getMonth() + 1}月日历`}>\n <div class=\"hb-calendar__weekdays\" role=\"row\">\n {this.orderedWeekNames.map(day => (\n <div class=\"hb-calendar__weekday\" role=\"columnheader\" aria-disabled=\"true\">\n {day}\n </div>\n ))}\n </div>\n <div class=\"hb-calendar__days\" role=\"row\" onKeyDown={this.handleGridKeydown}>\n {days.map((day, index) => {\n const isFocused = isSameDay(day.date, this.focusDate);\n const dayDisabled = day.isCurrentMonth && !!this.disabledDate && this.disabledDate(day.date);\n return (\n <div\n key={index}\n class={{\n 'hb-calendar__day': true,\n 'hb-calendar__day--other-month': !day.isCurrentMonth,\n 'hb-calendar__day--today': day.isToday,\n 'hb-calendar__day--selected': day.isSelected,\n 'hb-calendar__day--focused': isFocused,\n 'hb-calendar__day--disabled': dayDisabled,\n }}\n role=\"gridcell\"\n tabindex={isFocused ? 0 : -1}\n aria-selected={day.isSelected ? 'true' : 'false'}\n aria-current={day.isToday ? 'date' : undefined}\n aria-disabled={!day.isCurrentMonth || dayDisabled ? 'true' : undefined}\n aria-label={this.toISODate(day.date)}\n onClick={() => this.handleSelect(day)}\n >\n {day.date.getDate()}\n </div>\n );\n })}\n </div>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -14,7 +14,7 @@ const Card = class {
|
|
|
14
14
|
header;
|
|
15
15
|
shadow = 'always';
|
|
16
16
|
render() {
|
|
17
|
-
return (index.h("div", { key: '
|
|
17
|
+
return (index.h("div", { key: 'f7608af1d9f0b49f69ae715158640746b0cef19d', class: { 'hb-card': true, [`hb-card--shadow-${this.shadow}`]: true } }, (this.header || this.elHasHeaderSlot) && (index.h("div", { key: '07d640827829fba28288c45643ea94553ae668bc', class: "hb-card__header" }, index.h("slot", { key: 'b48962d1f96d2c6caf8aeea54739d40ebd992a7b', name: "header" }, index.h("span", { key: '1c4701c4b0b478fdacfb950dab4da22ed92b8eca' }, this.header)))), index.h("div", { key: '3c98aa57aa0f8338dac90ff5a81baeb068473bd2', class: "hb-card__body" }, index.h("slot", { key: 'e4e3f11461bd73def3139e19cd3b945da1bc1365' }))));
|
|
18
18
|
}
|
|
19
19
|
get elHasHeaderSlot() {
|
|
20
20
|
return !!document.querySelector('hb-card [slot="header"]');
|