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
|
@@ -13,7 +13,7 @@ export class Footer {
|
|
|
13
13
|
if (this.height) {
|
|
14
14
|
style.height = this.height;
|
|
15
15
|
}
|
|
16
|
-
return (h("footer", { key: '
|
|
16
|
+
return (h("footer", { key: '65847074853df09c57dd2bcead1470dac15f5951', class: "hb-footer", style: style }, h("slot", { key: 'e0f976bf1b3cd1f3a7ae2609bdf9b621070dac10' })));
|
|
17
17
|
}
|
|
18
18
|
static get is() { return "hb-footer"; }
|
|
19
19
|
static get encapsulation() { return "shadow"; }
|
|
@@ -13,7 +13,7 @@ export class Header {
|
|
|
13
13
|
if (this.height) {
|
|
14
14
|
style.height = this.height;
|
|
15
15
|
}
|
|
16
|
-
return (h("header", { key: '
|
|
16
|
+
return (h("header", { key: 'b0f4403c73f20d13b4513dd21266e5fea1004f7b', class: "hb-header", style: style }, h("slot", { key: '15f9743951c0183e7ee10124c0e3d2e8d071bee0' })));
|
|
17
17
|
}
|
|
18
18
|
static get is() { return "hb-header"; }
|
|
19
19
|
static get encapsulation() { return "shadow"; }
|
|
@@ -5,7 +5,7 @@ import { h } from "@stencil/core";
|
|
|
5
5
|
*/
|
|
6
6
|
export class Main {
|
|
7
7
|
render() {
|
|
8
|
-
return (h("main", { key: '
|
|
8
|
+
return (h("main", { key: '98dd998acef2d0cf91173425d84b5e14cd86c104', class: "hb-main" }, h("slot", { key: 'e508104800157f61bec0b0754371c83a4a76dabe' })));
|
|
9
9
|
}
|
|
10
10
|
static get is() { return "hb-main"; }
|
|
11
11
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { createClickOutsideHandler } from "../../utils/click-outside";
|
|
3
3
|
import { getCalendarDays, formatDate, parseDate, addMonths, MONTH_NAMES, WEEK_DAY_NAMES } from "../../utils/date-helpers";
|
|
4
|
+
import { activationClickHandler } from "../../utils/a11y";
|
|
4
5
|
/**
|
|
5
6
|
* DatePicker 日期选择器组件
|
|
6
7
|
* 用于选择或输入日期
|
|
@@ -22,8 +23,11 @@ export class DatePicker {
|
|
|
22
23
|
/** 显示在输入框中的格式 */
|
|
23
24
|
valueFormat;
|
|
24
25
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
26
|
+
* 日期选择器类型:
|
|
27
|
+
* - 'date':日选择(默认)
|
|
28
|
+
* - 'month':月选择(month 视图网格,emit YYYY-MM)
|
|
29
|
+
* - 'year':年选择(year 视图网格,emit YYYY)
|
|
30
|
+
* 注:'datetime'/'week' 请用独立的 DateTimePicker 组件 / 后续补全。
|
|
27
31
|
*/
|
|
28
32
|
type = 'date';
|
|
29
33
|
/**
|
|
@@ -38,18 +42,24 @@ export class DatePicker {
|
|
|
38
42
|
isOpen = false;
|
|
39
43
|
inputValue = '';
|
|
40
44
|
selectedDate;
|
|
45
|
+
/** month/year 模式的面板锚点(不随选择改变,仅导航用) */
|
|
46
|
+
panelViewDate = new Date();
|
|
41
47
|
/** 值改变事件 */
|
|
42
48
|
hbChange;
|
|
43
49
|
clickOutside = createClickOutsideHandler({
|
|
44
50
|
host: null,
|
|
45
51
|
isOpen: () => this.isOpen,
|
|
46
|
-
onClose: () => {
|
|
52
|
+
onClose: () => {
|
|
53
|
+
this.isOpen = false;
|
|
54
|
+
},
|
|
47
55
|
});
|
|
48
56
|
componentDidLoad() {
|
|
49
57
|
this.clickOutside = createClickOutsideHandler({
|
|
50
58
|
host: this.el,
|
|
51
59
|
isOpen: () => this.isOpen,
|
|
52
|
-
onClose: () => {
|
|
60
|
+
onClose: () => {
|
|
61
|
+
this.isOpen = false;
|
|
62
|
+
},
|
|
53
63
|
});
|
|
54
64
|
this.clickOutside.connect();
|
|
55
65
|
this.updateInputValue();
|
|
@@ -74,6 +84,10 @@ export class DatePicker {
|
|
|
74
84
|
if (this.disabled)
|
|
75
85
|
return;
|
|
76
86
|
this.isOpen = !this.isOpen;
|
|
87
|
+
// month/year 模式打开时,从已选值或今天初始化面板锚点
|
|
88
|
+
if (this.isOpen && (this.type === 'month' || this.type === 'year')) {
|
|
89
|
+
this.panelViewDate = this.selectedDate ? new Date(this.selectedDate) : new Date();
|
|
90
|
+
}
|
|
77
91
|
};
|
|
78
92
|
handleClear = (e) => {
|
|
79
93
|
e.stopPropagation();
|
|
@@ -93,9 +107,44 @@ export class DatePicker {
|
|
|
93
107
|
this.isOpen = false;
|
|
94
108
|
this.hbChange.emit(this.modelValue);
|
|
95
109
|
};
|
|
110
|
+
/** type='month':选某月 → 锚定到该月 1 号,emit YYYY-MM */
|
|
111
|
+
handleMonthSelect = (monthIndex) => {
|
|
112
|
+
const next = new Date(this.panelViewDate.getFullYear(), monthIndex, 1);
|
|
113
|
+
if (this.disabledDate && this.disabledDate(next))
|
|
114
|
+
return;
|
|
115
|
+
this.selectedDate = next;
|
|
116
|
+
this.panelViewDate = new Date(next);
|
|
117
|
+
const iso = `${next.getFullYear()}-${String(monthIndex + 1).padStart(2, '0')}`;
|
|
118
|
+
this.inputValue = iso;
|
|
119
|
+
this.modelValue = iso;
|
|
120
|
+
this.isOpen = false;
|
|
121
|
+
this.hbChange.emit(iso);
|
|
122
|
+
};
|
|
123
|
+
/** type='year':选某年 → 锚定到该年 1 月 1 日,emit YYYY */
|
|
124
|
+
handleYearSelect = (year) => {
|
|
125
|
+
const next = new Date(year, 0, 1);
|
|
126
|
+
if (this.disabledDate && this.disabledDate(next))
|
|
127
|
+
return;
|
|
128
|
+
this.selectedDate = next;
|
|
129
|
+
this.panelViewDate = new Date(next);
|
|
130
|
+
const iso = String(year);
|
|
131
|
+
this.inputValue = iso;
|
|
132
|
+
this.modelValue = iso;
|
|
133
|
+
this.isOpen = false;
|
|
134
|
+
this.hbChange.emit(iso);
|
|
135
|
+
};
|
|
96
136
|
changeMonth(delta) {
|
|
97
137
|
this.selectedDate = addMonths(this.selectedDate || new Date(), delta);
|
|
98
138
|
}
|
|
139
|
+
/** month/year 面板导航:month ±1 年、year ±12 年 */
|
|
140
|
+
changePanelView(delta) {
|
|
141
|
+
const next = new Date(this.panelViewDate);
|
|
142
|
+
if (this.type === 'month')
|
|
143
|
+
next.setFullYear(next.getFullYear() + delta);
|
|
144
|
+
else
|
|
145
|
+
next.setFullYear(next.getFullYear() + delta * 12);
|
|
146
|
+
this.panelViewDate = next;
|
|
147
|
+
}
|
|
99
148
|
/** 判断某日期是否被 disabledDate 禁用 */
|
|
100
149
|
isDateDisabled = (date) => {
|
|
101
150
|
return !!this.disabledDate && this.disabledDate(date);
|
|
@@ -103,12 +152,20 @@ export class DatePicker {
|
|
|
103
152
|
render() {
|
|
104
153
|
const days = getCalendarDays(this.selectedDate || new Date(), this.selectedDate);
|
|
105
154
|
const current = this.selectedDate || new Date();
|
|
106
|
-
|
|
155
|
+
// month/year 面板锚点:默认用 panelViewDate,未打开时回退到 selectedDate/today
|
|
156
|
+
const panelAnchor = this.panelViewDate || current;
|
|
157
|
+
const headerLabel = this.type === 'month'
|
|
158
|
+
? `${panelAnchor.getFullYear()} 年`
|
|
159
|
+
: this.type === 'year'
|
|
160
|
+
? `${Math.floor(panelAnchor.getFullYear() / 12) * 12} - ${Math.floor(panelAnchor.getFullYear() / 12) * 12 + 11}`
|
|
161
|
+
: `${current.getFullYear()}年 ${MONTH_NAMES[current.getMonth()]}`;
|
|
162
|
+
return (h("div", { key: '0568629a899d16bd00cf0acdc06c8bf12a50b21d', class: {
|
|
107
163
|
'hb-date-picker': true,
|
|
108
164
|
'hb-date-picker--open': this.isOpen,
|
|
109
165
|
'hb-date-picker--disabled': this.disabled,
|
|
110
166
|
[`hb-date-picker--${this.size}`]: true,
|
|
111
|
-
|
|
167
|
+
[`hb-date-picker--${this.type}`]: true,
|
|
168
|
+
} }, h("div", { key: 'd37d7631b2c16fb6f52c63aa96ce9752c348ceca', class: "hb-date-picker__input-wrapper", onClick: this.handleInputClick }, h("input", { key: 'b8c2381f26b88bce3032a58cbb74ae05fdb54b7c', type: "text", id: this.inputId, name: this.name, class: "hb-date-picker__input", placeholder: this.placeholder, value: this.inputValue, disabled: this.disabled, readonly: true, role: "combobox", "aria-haspopup": "dialog", "aria-expanded": this.isOpen ? 'true' : 'false', "aria-label": this.placeholder }), h("span", { key: 'df5059ba445476a946f9efc902da4f965c1f5eca', class: "hb-date-picker__suffix" }, this.clearable && this.modelValue && (h("span", { key: 'cab3328768cab68676ccece71bf12161449e52c2', class: "hb-date-picker__clear", role: "button", "aria-label": "\u6E05\u7A7A", tabIndex: 0, onClick: this.handleClear, onKeyDown: activationClickHandler }, h("svg", { key: 'e5970e157bf707bb49f39e800274927c73a79a82', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": 2, "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { key: '6fbe208a529abe7c01822d164f90d6ed80e1071d', d: "M6 6l12 12M18 6L6 18" })))), h("span", { key: 'ab1db32eccdf2e0c507e29de61cc30deaf0d3b9e', class: "hb-date-picker__icon", "aria-hidden": "true" }, h("svg", { key: 'd3439b59946891a511049d955e0d7362b2cca591', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": 2, "stroke-linecap": "round", "stroke-linejoin": "round" }, h("rect", { key: '9d6037217b01ff42357346ac092f6bd197414fb7', x: "3", y: "5", width: "18", height: "16", rx: "2" }), h("path", { key: '391e0d2b637622483036325d9c16187e3f2020bd', d: "M3 9h18M8 3v4M16 3v4" }))))), this.isOpen && (h("div", { key: 'b4985a01eadf9109127d599697485de875056be7', class: "hb-date-picker__dropdown", role: "dialog", "aria-label": this.type === 'month' ? '选择月份' : this.type === 'year' ? '选择年份' : '选择日期' }, h("div", { key: '369fae3c69f41c6c23e41598edb728510b41e73e', class: "hb-date-picker__header" }, h("button", { key: '9369433f5827e0bfbaa36ce4b3f06e4fc6d644c0', type: "button", class: "hb-date-picker__prev-btn", "aria-label": this.type === 'date' ? '上一月' : '上一年', onClick: () => (this.type === 'date' ? this.changeMonth(-1) : this.changePanelView(-1)) }, "\u2039"), h("span", { key: 'a7f946f76e088387784a8f5e49c38c8e47938c95', class: "hb-date-picker__header-label", "aria-live": "polite" }, headerLabel), h("button", { key: '2f5e2aca8db2fd8b9350334d3b211f4537b60277', type: "button", class: "hb-date-picker__next-btn", "aria-label": this.type === 'date' ? '下一月' : '下一年', onClick: () => (this.type === 'date' ? this.changeMonth(1) : this.changePanelView(1)) }, "\u203A")), this.type === 'date' && (h("div", { key: 'a8f0c0418770fedced9596685cec4d40c66350d1', class: "hb-date-picker__body", role: "grid" }, h("div", { key: '7b9c1d486b30408007024a6036a7813fcff982de', class: "hb-date-picker__weekdays", role: "row" }, WEEK_DAY_NAMES.map(day => (h("div", { class: "hb-date-picker__weekday", role: "columnheader", "aria-disabled": "true" }, day)))), h("div", { key: '63a5f9b115f2c3b2424064843bc36fe7b79d1ca3', class: "hb-date-picker__days", role: "row" }, days.map((day, index) => {
|
|
112
169
|
const dayDisabled = day.isCurrentMonth && this.isDateDisabled(day.date);
|
|
113
170
|
return (h("div", { key: index, class: {
|
|
114
171
|
'hb-date-picker__day': true,
|
|
@@ -117,7 +174,31 @@ export class DatePicker {
|
|
|
117
174
|
'hb-date-picker__day--selected': day.isSelected,
|
|
118
175
|
'hb-date-picker__day--disabled': dayDisabled,
|
|
119
176
|
}, role: "gridcell", "aria-selected": day.isSelected ? 'true' : 'false', "aria-disabled": !day.isCurrentMonth || dayDisabled ? 'true' : undefined, "aria-label": formatDate(day.date, this.format), onClick: () => day.isCurrentMonth && !dayDisabled && this.handleDateSelect(day.date) }, day.date.getDate()));
|
|
120
|
-
})))))
|
|
177
|
+
})))), this.type === 'month' && (h("div", { key: 'b62f03edcdca73c71ddded45079344778e65abb6', class: "hb-date-picker__body hb-date-picker__month-grid", role: "grid" }, MONTH_NAMES.map((name, idx) => {
|
|
178
|
+
const probe = new Date(panelAnchor.getFullYear(), idx, 1);
|
|
179
|
+
const monthDisabled = !!this.disabledDate && this.disabledDate(probe);
|
|
180
|
+
const isSelected = !!this.selectedDate && this.selectedDate.getFullYear() === panelAnchor.getFullYear() && this.selectedDate.getMonth() === idx;
|
|
181
|
+
return (h("div", { class: {
|
|
182
|
+
'hb-date-picker__month-cell': true,
|
|
183
|
+
'hb-date-picker__month-cell--selected': isSelected,
|
|
184
|
+
'hb-date-picker__month-cell--disabled': monthDisabled,
|
|
185
|
+
}, role: "gridcell", "aria-selected": isSelected ? 'true' : 'false', "aria-disabled": monthDisabled ? 'true' : undefined, onClick: () => !monthDisabled && this.handleMonthSelect(idx) }, name));
|
|
186
|
+
}))), this.type === 'year' && (h("div", { key: 'fb01386b11594c2b1bc14b1eae38f2fd51a5e20b', class: "hb-date-picker__body hb-date-picker__year-grid", role: "grid" }, (() => {
|
|
187
|
+
const startYear = Math.floor(panelAnchor.getFullYear() / 12) * 12;
|
|
188
|
+
const years = [];
|
|
189
|
+
for (let i = 0; i < 12; i++)
|
|
190
|
+
years.push(startYear + i);
|
|
191
|
+
return years.map(y => {
|
|
192
|
+
const probe = new Date(y, 0, 1);
|
|
193
|
+
const yearDisabled = !!this.disabledDate && this.disabledDate(probe);
|
|
194
|
+
const isSelected = !!this.selectedDate && this.selectedDate.getFullYear() === y;
|
|
195
|
+
return (h("div", { class: {
|
|
196
|
+
'hb-date-picker__year-cell': true,
|
|
197
|
+
'hb-date-picker__year-cell--selected': isSelected,
|
|
198
|
+
'hb-date-picker__year-cell--disabled': yearDisabled,
|
|
199
|
+
}, role: "gridcell", "aria-selected": isSelected ? 'true' : 'false', "aria-disabled": yearDisabled ? 'true' : undefined, onClick: () => !yearDisabled && this.handleYearSelect(y) }, y));
|
|
200
|
+
});
|
|
201
|
+
})()))))));
|
|
121
202
|
}
|
|
122
203
|
static get is() { return "hb-date-picker"; }
|
|
123
204
|
static get encapsulation() { return "shadow"; }
|
|
@@ -280,21 +361,21 @@ export class DatePicker {
|
|
|
280
361
|
"type": "string",
|
|
281
362
|
"mutable": false,
|
|
282
363
|
"complexType": {
|
|
283
|
-
"original": "
|
|
284
|
-
"resolved": "\"date\"",
|
|
364
|
+
"original": "'date' | 'month' | 'year'",
|
|
365
|
+
"resolved": "\"date\" | \"month\" | \"year\"",
|
|
285
366
|
"references": {}
|
|
286
367
|
},
|
|
287
368
|
"required": false,
|
|
288
369
|
"optional": false,
|
|
289
370
|
"docs": {
|
|
290
371
|
"tags": [],
|
|
291
|
-
"text": "\u65E5\u671F\u9009\u62E9\u5668\u7C7B\u578B\n\
|
|
372
|
+
"text": "\u65E5\u671F\u9009\u62E9\u5668\u7C7B\u578B\uFF1A\n- 'date'\uFF1A\u65E5\u9009\u62E9\uFF08\u9ED8\u8BA4\uFF09\n- 'month'\uFF1A\u6708\u9009\u62E9\uFF08month \u89C6\u56FE\u7F51\u683C\uFF0Cemit YYYY-MM\uFF09\n- 'year'\uFF1A\u5E74\u9009\u62E9\uFF08year \u89C6\u56FE\u7F51\u683C\uFF0Cemit YYYY\uFF09\n\u6CE8\uFF1A'datetime'/'week' \u8BF7\u7528\u72EC\u7ACB\u7684 DateTimePicker \u7EC4\u4EF6 / \u540E\u7EED\u8865\u5168\u3002"
|
|
292
373
|
},
|
|
293
374
|
"getter": false,
|
|
294
375
|
"setter": false,
|
|
295
376
|
"attribute": "type",
|
|
296
377
|
"reflect": false,
|
|
297
|
-
"defaultValue": "'date'
|
|
378
|
+
"defaultValue": "'date'"
|
|
298
379
|
},
|
|
299
380
|
"disabledDate": {
|
|
300
381
|
"type": "unknown",
|
|
@@ -365,7 +446,8 @@ export class DatePicker {
|
|
|
365
446
|
return {
|
|
366
447
|
"isOpen": {},
|
|
367
448
|
"inputValue": {},
|
|
368
|
-
"selectedDate": {}
|
|
449
|
+
"selectedDate": {},
|
|
450
|
+
"panelViewDate": {}
|
|
369
451
|
};
|
|
370
452
|
}
|
|
371
453
|
static get events() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.js","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1H;;;GAGG;AAMH,MAAM,OAAO,UAAU;IACV,EAAE,CAAc;IAE3B,UAAU;IACe,UAAU,CAAiB;IAEpD,cAAc;IACN,WAAW,GAAW,OAAO,CAAC;IAEtC,WAAW;IACH,QAAQ,GAAY,KAAK,CAAC;IAElC,YAAY;IACJ,IAAI,GAAkC,SAAS,CAAC;IAExD,YAAY;IACJ,SAAS,GAAY,KAAK,CAAC;IAEnC,WAAW;IACH,MAAM,GAAW,YAAY,CAAC;IAEtC,iBAAiB;IACT,WAAW,CAAU;IAE7B;;;OAGG;IACK,IAAI,GAAG,MAAe,CAAC;IAE/B;;;OAGG;IACK,YAAY,CAA2B;IAE/C,iBAAiB;IACT,IAAI,CAAU;IAEtB,eAAe;IACP,OAAO,CAAU;IAEhB,MAAM,GAAY,KAAK,CAAC;IACxB,UAAU,GAAW,EAAE,CAAC;IACxB,YAAY,CAAQ;IAE7B,YAAY;IACH,QAAQ,CAA8B;IAEvC,YAAY,GAAG,yBAAyB,CAAC;QAC/C,IAAI,EAAE,IAAW;QACjB,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM;QACzB,OAAO,EAAE,G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CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAC7C,OAAO,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,cAAc,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,IAEnF,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CACf,CACP,CAAC;oBACJ,CAAC,CAAC,CACE,CACF,CACF,CACP,CACG,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, Event, EventEmitter, State, Element, Watch } from '@stencil/core';\nimport { createClickOutsideHandler } from '../../utils/click-outside';\nimport { getCalendarDays, formatDate, parseDate, addMonths, MONTH_NAMES, WEEK_DAY_NAMES } from '../../utils/date-helpers';\n\n/**\n * DatePicker 日期选择器组件\n * 用于选择或输入日期\n */\n@Component({\n tag: 'hb-date-picker',\n styleUrl: 'date-picker.css',\n shadow: true,\n})\nexport class DatePicker {\n @Element() el: HTMLElement;\n\n /** 绑定值 */\n @Prop({ mutable: true }) modelValue?: string | Date;\n\n /** 输入框占位文本 */\n @Prop() placeholder: string = '请选择日期';\n\n /** 是否禁用 */\n @Prop() disabled: boolean = false;\n\n /** 输入框尺寸 */\n @Prop() size: 'large' | 'default' | 'small' = 'default';\n\n /** 是否可清空 */\n @Prop() clearable: boolean = false;\n\n /** 日期格式 */\n @Prop() format: string = 'YYYY-MM-DD';\n\n /** 显示在输入框中的格式 */\n @Prop() valueFormat?: string;\n\n /**\n * 日期选择器类型\n * 当前仅支持 'date',更多类型将在后续版本实现\n */\n @Prop() type = 'date' as const;\n\n /**\n * 禁用日期判定函数。返回 true 的日期在日历中不可选(加 disabled 态、不可点击、aria-disabled)。\n * @param date 当前日期格子的 Date 对象\n */\n @Prop() disabledDate?: (date: Date) => boolean;\n\n /** 原生 name 属性 */\n @Prop() name?: string;\n\n /** 原生 id 属性 */\n @Prop() inputId?: string;\n\n @State() isOpen: boolean = false;\n @State() inputValue: string = '';\n @State() selectedDate?: Date;\n\n /** 值改变事件 */\n @Event() hbChange: EventEmitter<string | Date>;\n\n private clickOutside = createClickOutsideHandler({\n host: null as any,\n isOpen: () => this.isOpen,\n onClose: () => { this.isOpen = false; },\n });\n\n componentDidLoad() {\n this.clickOutside = createClickOutsideHandler({\n host: this.el,\n isOpen: () => this.isOpen,\n onClose: () => { this.isOpen = false; },\n });\n this.clickOutside.connect();\n this.updateInputValue();\n }\n\n disconnectedCallback() {\n this.clickOutside.disconnect();\n }\n\n @Watch('modelValue')\n handleValueChange() {\n this.updateInputValue();\n }\n\n private updateInputValue() {\n const date = parseDate(this.modelValue);\n if (!date) {\n this.inputValue = '';\n this.selectedDate = undefined;\n return;\n }\n this.selectedDate = date;\n this.inputValue = formatDate(date, this.format);\n }\n\n private handleInputClick = () => {\n if (this.disabled) return;\n this.isOpen = !this.isOpen;\n };\n\n private handleClear = (e: Event) => {\n e.stopPropagation();\n this.modelValue = undefined;\n this.inputValue = '';\n this.selectedDate = undefined;\n this.isOpen = false;\n this.hbChange.emit(undefined);\n };\n\n private handleDateSelect = (date: Date) => {\n // disabledDate 返回 true 的日期不可选\n if (this.disabledDate && this.disabledDate(date)) return;\n this.selectedDate = date;\n this.modelValue = this.valueFormat ? formatDate(date, this.format) : date;\n this.updateInputValue();\n this.isOpen = false;\n this.hbChange.emit(this.modelValue);\n };\n\n private changeMonth(delta: number) {\n this.selectedDate = addMonths(this.selectedDate || new Date(), delta);\n }\n\n /** 判断某日期是否被 disabledDate 禁用 */\n private isDateDisabled = (date: Date): boolean => {\n return !!this.disabledDate && this.disabledDate(date);\n };\n\n render() {\n const days = getCalendarDays(this.selectedDate || new Date(), this.selectedDate);\n const current = this.selectedDate || new Date();\n\n return (\n <div\n class={{\n 'hb-date-picker': true,\n 'hb-date-picker--open': this.isOpen,\n 'hb-date-picker--disabled': this.disabled,\n [`hb-date-picker--${this.size}`]: true,\n }}\n >\n <div class=\"hb-date-picker__input-wrapper\" onClick={this.handleInputClick}>\n <input\n type=\"text\"\n id={this.inputId}\n name={this.name}\n class=\"hb-date-picker__input\"\n placeholder={this.placeholder}\n value={this.inputValue}\n disabled={this.disabled}\n readonly\n role=\"combobox\"\n aria-haspopup=\"dialog\"\n aria-expanded={this.isOpen ? 'true' : 'false'}\n aria-label={this.placeholder}\n />\n <span class=\"hb-date-picker__suffix\">\n {this.clearable && this.modelValue && (\n <span class=\"hb-date-picker__clear\" role=\"button\" aria-label=\"清空\" onClick={this.handleClear}>\n ×\n </span>\n )}\n <span class=\"hb-date-picker__icon\" aria-hidden=\"true\">📅</span>\n </span>\n </div>\n {this.isOpen && (\n <div class=\"hb-date-picker__dropdown\" role=\"dialog\" aria-label=\"选择日期\">\n <div class=\"hb-date-picker__header\">\n <button\n type=\"button\"\n class=\"hb-date-picker__prev-btn\"\n aria-label=\"上一月\"\n onClick={() => this.changeMonth(-1)}\n >\n ‹\n </button>\n <span class=\"hb-date-picker__header-label\" aria-live=\"polite\">\n {current.getFullYear()}年 {MONTH_NAMES[current.getMonth()]}\n </span>\n <button\n type=\"button\"\n class=\"hb-date-picker__next-btn\"\n aria-label=\"下一月\"\n onClick={() => this.changeMonth(1)}\n >\n ›\n </button>\n </div>\n <div class=\"hb-date-picker__body\" role=\"grid\">\n <div class=\"hb-date-picker__weekdays\" role=\"row\">\n {WEEK_DAY_NAMES.map(day => (\n <div class=\"hb-date-picker__weekday\" role=\"columnheader\" aria-disabled=\"true\">{day}</div>\n ))}\n </div>\n <div class=\"hb-date-picker__days\" role=\"row\">\n {days.map((day, index) => {\n const dayDisabled = day.isCurrentMonth && this.isDateDisabled(day.date);\n return (\n <div\n key={index}\n class={{\n 'hb-date-picker__day': true,\n 'hb-date-picker__day--other-month': !day.isCurrentMonth,\n 'hb-date-picker__day--today': day.isToday,\n 'hb-date-picker__day--selected': day.isSelected,\n 'hb-date-picker__day--disabled': dayDisabled,\n }}\n role=\"gridcell\"\n aria-selected={day.isSelected ? 'true' : 'false'}\n aria-disabled={!day.isCurrentMonth || dayDisabled ? 'true' : undefined}\n aria-label={formatDate(day.date, this.format)}\n onClick={() => day.isCurrentMonth && !dayDisabled && this.handleDateSelect(day.date)}\n >\n {day.date.getDate()}\n </div>\n );\n })}\n </div>\n </div>\n </div>\n )}\n </div>\n );\n }\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"DatePicker.js","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1H,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D;;;GAGG;AAMH,MAAM,OAAO,UAAU;IACV,EAAE,CAAc;IAE3B,UAAU;IACe,UAAU,CAAiB;IAEpD,cAAc;IACN,WAAW,GAAW,OAAO,CAAC;IAEtC,WAAW;IACH,QAAQ,GAAY,KAAK,CAAC;IAElC,YAAY;IACJ,IAAI,GAAkC,SAAS,CAAC;IAExD,YAAY;IACJ,SAAS,GAAY,KAAK,CAAC;IAEnC,WAAW;IACH,MAAM,GAAW,YAAY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;wBAChF,OAAO,CACL,WACE,KAAK,EAAE;gCACL,2BAA2B,EAAE,IAAI;gCACjC,qCAAqC,EAAE,UAAU;gCACjD,qCAAqC,EAAE,YAAY;6BACpD,EACD,IAAI,EAAC,UAAU,mBACA,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,mBAC7B,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAChD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,YAAY,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAEvD,CAAC,CACE,CACP,CAAC;oBACJ,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC,EAAE,CACA,CACP,CACG,CACP,CACG,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, Event, EventEmitter, State, Element, Watch } from '@stencil/core';\nimport { createClickOutsideHandler } from '../../utils/click-outside';\nimport { getCalendarDays, formatDate, parseDate, addMonths, MONTH_NAMES, WEEK_DAY_NAMES } from '../../utils/date-helpers';\nimport { activationClickHandler } from '../../utils/a11y';\n\n/**\n * DatePicker 日期选择器组件\n * 用于选择或输入日期\n */\n@Component({\n tag: 'hb-date-picker',\n styleUrl: 'date-picker.css',\n shadow: true,\n})\nexport class DatePicker {\n @Element() el: HTMLElement;\n\n /** 绑定值 */\n @Prop({ mutable: true }) modelValue?: string | Date;\n\n /** 输入框占位文本 */\n @Prop() placeholder: string = '请选择日期';\n\n /** 是否禁用 */\n @Prop() disabled: boolean = false;\n\n /** 输入框尺寸 */\n @Prop() size: 'large' | 'default' | 'small' = 'default';\n\n /** 是否可清空 */\n @Prop() clearable: boolean = false;\n\n /** 日期格式 */\n @Prop() format: string = 'YYYY-MM-DD';\n\n /** 显示在输入框中的格式 */\n @Prop() valueFormat?: string;\n\n /**\n * 日期选择器类型:\n * - 'date':日选择(默认)\n * - 'month':月选择(month 视图网格,emit YYYY-MM)\n * - 'year':年选择(year 视图网格,emit YYYY)\n * 注:'datetime'/'week' 请用独立的 DateTimePicker 组件 / 后续补全。\n */\n @Prop() type: 'date' | 'month' | 'year' = 'date';\n\n /**\n * 禁用日期判定函数。返回 true 的日期在日历中不可选(加 disabled 态、不可点击、aria-disabled)。\n * @param date 当前日期格子的 Date 对象\n */\n @Prop() disabledDate?: (date: Date) => boolean;\n\n /** 原生 name 属性 */\n @Prop() name?: string;\n\n /** 原生 id 属性 */\n @Prop() inputId?: string;\n\n @State() isOpen: boolean = false;\n @State() inputValue: string = '';\n @State() selectedDate?: Date;\n /** month/year 模式的面板锚点(不随选择改变,仅导航用) */\n @State() panelViewDate: Date = new Date();\n\n /** 值改变事件 */\n @Event() hbChange: EventEmitter<string | Date>;\n\n private clickOutside = createClickOutsideHandler({\n host: null as any,\n isOpen: () => this.isOpen,\n onClose: () => {\n this.isOpen = false;\n },\n });\n\n componentDidLoad() {\n this.clickOutside = createClickOutsideHandler({\n host: this.el,\n isOpen: () => this.isOpen,\n onClose: () => {\n this.isOpen = false;\n },\n });\n this.clickOutside.connect();\n this.updateInputValue();\n }\n\n disconnectedCallback() {\n this.clickOutside.disconnect();\n }\n\n @Watch('modelValue')\n handleValueChange() {\n this.updateInputValue();\n }\n\n private updateInputValue() {\n const date = parseDate(this.modelValue);\n if (!date) {\n this.inputValue = '';\n this.selectedDate = undefined;\n return;\n }\n this.selectedDate = date;\n this.inputValue = formatDate(date, this.format);\n }\n\n private handleInputClick = () => {\n if (this.disabled) return;\n this.isOpen = !this.isOpen;\n // month/year 模式打开时,从已选值或今天初始化面板锚点\n if (this.isOpen && (this.type === 'month' || this.type === 'year')) {\n this.panelViewDate = this.selectedDate ? new Date(this.selectedDate) : new Date();\n }\n };\n\n private handleClear = (e: Event) => {\n e.stopPropagation();\n this.modelValue = undefined;\n this.inputValue = '';\n this.selectedDate = undefined;\n this.isOpen = false;\n this.hbChange.emit(undefined);\n };\n\n private handleDateSelect = (date: Date) => {\n // disabledDate 返回 true 的日期不可选\n if (this.disabledDate && this.disabledDate(date)) return;\n this.selectedDate = date;\n this.modelValue = this.valueFormat ? formatDate(date, this.format) : date;\n this.updateInputValue();\n this.isOpen = false;\n this.hbChange.emit(this.modelValue);\n };\n\n /** type='month':选某月 → 锚定到该月 1 号,emit YYYY-MM */\n private handleMonthSelect = (monthIndex: number) => {\n const next = new Date(this.panelViewDate.getFullYear(), monthIndex, 1);\n if (this.disabledDate && this.disabledDate(next)) return;\n this.selectedDate = next;\n this.panelViewDate = new Date(next);\n const iso = `${next.getFullYear()}-${String(monthIndex + 1).padStart(2, '0')}`;\n this.inputValue = iso;\n this.modelValue = iso;\n this.isOpen = false;\n this.hbChange.emit(iso);\n };\n\n /** type='year':选某年 → 锚定到该年 1 月 1 日,emit YYYY */\n private handleYearSelect = (year: number) => {\n const next = new Date(year, 0, 1);\n if (this.disabledDate && this.disabledDate(next)) return;\n this.selectedDate = next;\n this.panelViewDate = new Date(next);\n const iso = String(year);\n this.inputValue = iso;\n this.modelValue = iso;\n this.isOpen = false;\n this.hbChange.emit(iso);\n };\n\n private changeMonth(delta: number) {\n this.selectedDate = addMonths(this.selectedDate || new Date(), delta);\n }\n\n /** month/year 面板导航:month ±1 年、year ±12 年 */\n private changePanelView(delta: number) {\n const next = new Date(this.panelViewDate);\n if (this.type === 'month') next.setFullYear(next.getFullYear() + delta);\n else next.setFullYear(next.getFullYear() + delta * 12);\n this.panelViewDate = next;\n }\n\n /** 判断某日期是否被 disabledDate 禁用 */\n private isDateDisabled = (date: Date): boolean => {\n return !!this.disabledDate && this.disabledDate(date);\n };\n\n render() {\n const days = getCalendarDays(this.selectedDate || new Date(), this.selectedDate);\n const current = this.selectedDate || new Date();\n\n // month/year 面板锚点:默认用 panelViewDate,未打开时回退到 selectedDate/today\n const panelAnchor = this.panelViewDate || current;\n const headerLabel =\n this.type === 'month'\n ? `${panelAnchor.getFullYear()} 年`\n : this.type === 'year'\n ? `${Math.floor(panelAnchor.getFullYear() / 12) * 12} - ${Math.floor(panelAnchor.getFullYear() / 12) * 12 + 11}`\n : `${current.getFullYear()}年 ${MONTH_NAMES[current.getMonth()]}`;\n\n return (\n <div\n class={{\n 'hb-date-picker': true,\n 'hb-date-picker--open': this.isOpen,\n 'hb-date-picker--disabled': this.disabled,\n [`hb-date-picker--${this.size}`]: true,\n [`hb-date-picker--${this.type}`]: true,\n }}\n >\n <div class=\"hb-date-picker__input-wrapper\" onClick={this.handleInputClick}>\n <input\n type=\"text\"\n id={this.inputId}\n name={this.name}\n class=\"hb-date-picker__input\"\n placeholder={this.placeholder}\n value={this.inputValue}\n disabled={this.disabled}\n readonly\n role=\"combobox\"\n aria-haspopup=\"dialog\"\n aria-expanded={this.isOpen ? 'true' : 'false'}\n aria-label={this.placeholder}\n />\n <span class=\"hb-date-picker__suffix\">\n {this.clearable && this.modelValue && (\n <span class=\"hb-date-picker__clear\" role=\"button\" aria-label=\"清空\" tabIndex={0} onClick={this.handleClear} onKeyDown={activationClickHandler}>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width={2} stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M6 6l12 12M18 6L6 18\" />\n </svg>\n </span>\n )}\n <span class=\"hb-date-picker__icon\" aria-hidden=\"true\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width={2} stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M3 9h18M8 3v4M16 3v4\" />\n </svg>\n </span>\n </span>\n </div>\n {this.isOpen && (\n <div class=\"hb-date-picker__dropdown\" role=\"dialog\" aria-label={this.type === 'month' ? '选择月份' : this.type === 'year' ? '选择年份' : '选择日期'}>\n <div class=\"hb-date-picker__header\">\n <button\n type=\"button\"\n class=\"hb-date-picker__prev-btn\"\n aria-label={this.type === 'date' ? '上一月' : '上一年'}\n onClick={() => (this.type === 'date' ? this.changeMonth(-1) : this.changePanelView(-1))}\n >\n ‹\n </button>\n <span class=\"hb-date-picker__header-label\" aria-live=\"polite\">\n {headerLabel}\n </span>\n <button\n type=\"button\"\n class=\"hb-date-picker__next-btn\"\n aria-label={this.type === 'date' ? '下一月' : '下一年'}\n onClick={() => (this.type === 'date' ? this.changeMonth(1) : this.changePanelView(1))}\n >\n ›\n </button>\n </div>\n {this.type === 'date' && (\n <div class=\"hb-date-picker__body\" role=\"grid\">\n <div class=\"hb-date-picker__weekdays\" role=\"row\">\n {WEEK_DAY_NAMES.map(day => (\n <div class=\"hb-date-picker__weekday\" role=\"columnheader\" aria-disabled=\"true\">\n {day}\n </div>\n ))}\n </div>\n <div class=\"hb-date-picker__days\" role=\"row\">\n {days.map((day, index) => {\n const dayDisabled = day.isCurrentMonth && this.isDateDisabled(day.date);\n return (\n <div\n key={index}\n class={{\n 'hb-date-picker__day': true,\n 'hb-date-picker__day--other-month': !day.isCurrentMonth,\n 'hb-date-picker__day--today': day.isToday,\n 'hb-date-picker__day--selected': day.isSelected,\n 'hb-date-picker__day--disabled': dayDisabled,\n }}\n role=\"gridcell\"\n aria-selected={day.isSelected ? 'true' : 'false'}\n aria-disabled={!day.isCurrentMonth || dayDisabled ? 'true' : undefined}\n aria-label={formatDate(day.date, this.format)}\n onClick={() => day.isCurrentMonth && !dayDisabled && this.handleDateSelect(day.date)}\n >\n {day.date.getDate()}\n </div>\n );\n })}\n </div>\n </div>\n )}\n {this.type === 'month' && (\n <div class=\"hb-date-picker__body hb-date-picker__month-grid\" role=\"grid\">\n {MONTH_NAMES.map((name, idx) => {\n const probe = new Date(panelAnchor.getFullYear(), idx, 1);\n const monthDisabled = !!this.disabledDate && this.disabledDate(probe);\n const isSelected = !!this.selectedDate && this.selectedDate.getFullYear() === panelAnchor.getFullYear() && this.selectedDate.getMonth() === idx;\n return (\n <div\n class={{\n 'hb-date-picker__month-cell': true,\n 'hb-date-picker__month-cell--selected': isSelected,\n 'hb-date-picker__month-cell--disabled': monthDisabled,\n }}\n role=\"gridcell\"\n aria-selected={isSelected ? 'true' : 'false'}\n aria-disabled={monthDisabled ? 'true' : undefined}\n onClick={() => !monthDisabled && this.handleMonthSelect(idx)}\n >\n {name}\n </div>\n );\n })}\n </div>\n )}\n {this.type === 'year' && (\n <div class=\"hb-date-picker__body hb-date-picker__year-grid\" role=\"grid\">\n {(() => {\n const startYear = Math.floor(panelAnchor.getFullYear() / 12) * 12;\n const years: number[] = [];\n for (let i = 0; i < 12; i++) years.push(startYear + i);\n return years.map(y => {\n const probe = new Date(y, 0, 1);\n const yearDisabled = !!this.disabledDate && this.disabledDate(probe);\n const isSelected = !!this.selectedDate && this.selectedDate.getFullYear() === y;\n return (\n <div\n class={{\n 'hb-date-picker__year-cell': true,\n 'hb-date-picker__year-cell--selected': isSelected,\n 'hb-date-picker__year-cell--disabled': yearDisabled,\n }}\n role=\"gridcell\"\n aria-selected={isSelected ? 'true' : 'false'}\n aria-disabled={yearDisabled ? 'true' : undefined}\n onClick={() => !yearDisabled && this.handleYearSelect(y)}\n >\n {y}\n </div>\n );\n });\n })()}\n </div>\n )}\n </div>\n )}\n </div>\n );\n }\n}\n"]}
|
|
@@ -58,17 +58,36 @@
|
|
|
58
58
|
.hb-date-picker__clear {
|
|
59
59
|
margin-right: 8px;
|
|
60
60
|
cursor: pointer;
|
|
61
|
-
|
|
61
|
+
display: inline-flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
width: 14px;
|
|
65
|
+
height: 14px;
|
|
62
66
|
color: var(--hb-color-text-placeholder, #c0c4cc);
|
|
63
67
|
transition: color 0.2s;
|
|
64
68
|
}
|
|
65
69
|
|
|
70
|
+
.hb-date-picker__clear svg {
|
|
71
|
+
width: 100%;
|
|
72
|
+
height: 100%;
|
|
73
|
+
}
|
|
74
|
+
|
|
66
75
|
.hb-date-picker__clear:hover {
|
|
67
76
|
color: var(--hb-color-text-regular, #606266);
|
|
68
77
|
}
|
|
69
78
|
|
|
70
79
|
.hb-date-picker__icon {
|
|
71
|
-
|
|
80
|
+
display: inline-flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
justify-content: center;
|
|
83
|
+
width: 14px;
|
|
84
|
+
height: 14px;
|
|
85
|
+
color: var(--hb-color-text-placeholder, #c0c4cc);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.hb-date-picker__icon svg {
|
|
89
|
+
width: 100%;
|
|
90
|
+
height: 100%;
|
|
72
91
|
}
|
|
73
92
|
|
|
74
93
|
.hb-date-picker__dropdown {
|
|
@@ -207,3 +226,45 @@
|
|
|
207
226
|
cursor: not-allowed;
|
|
208
227
|
}
|
|
209
228
|
|
|
229
|
+
/* ---- type=month / type=year 选择网格 ---- */
|
|
230
|
+
.hb-date-picker__month-grid,
|
|
231
|
+
.hb-date-picker__year-grid {
|
|
232
|
+
display: grid;
|
|
233
|
+
grid-template-columns: repeat(3, 1fr);
|
|
234
|
+
gap: 8px;
|
|
235
|
+
padding: 8px 12px;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.hb-date-picker__month-cell,
|
|
239
|
+
.hb-date-picker__year-cell {
|
|
240
|
+
display: flex;
|
|
241
|
+
align-items: center;
|
|
242
|
+
justify-content: center;
|
|
243
|
+
height: 40px;
|
|
244
|
+
font-size: var(--hb-cascader-font-size, 14px);
|
|
245
|
+
color: var(--hb-color-text-regular, #606266);
|
|
246
|
+
border-radius: 4px;
|
|
247
|
+
cursor: pointer;
|
|
248
|
+
transition:
|
|
249
|
+
background-color 0.2s,
|
|
250
|
+
color 0.2s;
|
|
251
|
+
user-select: none;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.hb-date-picker__month-cell:hover:not(.hb-date-picker__month-cell--disabled),
|
|
255
|
+
.hb-date-picker__year-cell:hover:not(.hb-date-picker__year-cell--disabled) {
|
|
256
|
+
background-color: var(--hb-fill-color-light, #f5f7fa);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.hb-date-picker__month-cell--selected,
|
|
260
|
+
.hb-date-picker__year-cell--selected {
|
|
261
|
+
color: var(--hb-color-primary, #1677ff);
|
|
262
|
+
font-weight: 600;
|
|
263
|
+
background-color: var(--hb-color-primary-bg, #e6f4ff);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.hb-date-picker__month-cell--disabled,
|
|
267
|
+
.hb-date-picker__year-cell--disabled {
|
|
268
|
+
color: var(--hb-color-text-disabled, #c0c4cc);
|
|
269
|
+
cursor: not-allowed;
|
|
270
|
+
}
|
|
@@ -99,7 +99,7 @@ export class DatePickerPane {
|
|
|
99
99
|
}
|
|
100
100
|
render() {
|
|
101
101
|
const current = this.selectedDate || new Date();
|
|
102
|
-
return (h("div", { key: '
|
|
102
|
+
return (h("div", { key: 'e85553514263ff1112d1d3a519f6e283f03e4eca', class: "hb-date-picker-pane" }, h("div", { key: '05f8dff146116f3f4e5b09ab1a16bba45bf81b55', class: "hb-date-picker-pane__header" }, h("button", { key: 'eff475c34cd894a60564e63feef88de2f86ca5eb', type: "button", class: "hb-date-picker-pane__prev-btn", "aria-label": "\u4E0A\u4E00\u4E2A", onClick: this.handlePrev }, "\u2039"), h("button", { key: 'da0443845d09f85ae024ef2dd66c65141f4fdd22', type: "button", class: "hb-date-picker-pane__header-label", "aria-live": "polite", onClick: this.handleHeaderTitleClick }, this.getHeaderTitle()), h("button", { key: 'd15be17b942f15bfcb58a43afa1c31aeed8fcd18', type: "button", class: "hb-date-picker-pane__next-btn", "aria-label": "\u4E0B\u4E00\u4E2A", onClick: this.handleNext }, "\u203A")), this.view === 'days' && this.renderDaysView(), this.view === 'months' && this.renderMonthsView(current), this.view === 'years' && this.renderYearsView(current)));
|
|
103
103
|
}
|
|
104
104
|
renderDaysView() {
|
|
105
105
|
const days = getCalendarDays(this.selectedDate || new Date(), this.selectedDate);
|
|
@@ -195,12 +195,12 @@ export class DateRangePicker {
|
|
|
195
195
|
render() {
|
|
196
196
|
const rightViewDate = addMonths(this.leftViewDate, 1);
|
|
197
197
|
const showClear = this.clearable && !!this.startDate && !!this.endDate && !this.disabled;
|
|
198
|
-
return (h("div", { key: '
|
|
198
|
+
return (h("div", { key: '2449050b8a140dcd90e5760813ec8fd430e1f86e', class: {
|
|
199
199
|
'hb-date-range-picker': true,
|
|
200
200
|
'hb-date-range-picker--open': this.isOpen,
|
|
201
201
|
'hb-date-range-picker--disabled': this.disabled,
|
|
202
202
|
[`hb-date-range-picker--${this.size}`]: true,
|
|
203
|
-
} }, h("div", { key: '
|
|
203
|
+
} }, h("div", { key: 'de9e91f0a42b8ddaf6b1157e0a4784e01e37ecbb', class: "hb-date-range-picker__input-wrapper", onClick: this.handleTriggerClick }, h("input", { key: 'c4d214489d6b01061889d04f83460802758fcd21', type: "text", name: this.name, class: "hb-date-range-picker__input", placeholder: this.placeholder[0] || '开始日期', value: this.displayStart, disabled: this.disabled, readonly: true }), h("span", { key: '40db9eb30725498a6d4860c6916c0f10b7787d02', class: "hb-date-range-picker__separator" }, "\u81F3"), h("input", { key: 'b8dbe546d411b21fab4a8c8e341c59315d8694e7', type: "text", class: "hb-date-range-picker__input", placeholder: this.placeholder[1] || '结束日期', value: this.displayEnd, disabled: this.disabled, readonly: true }), h("span", { key: 'dde8b66f4deacb6d7c7339a88b7403a650a2d985', class: "hb-date-range-picker__suffix" }, showClear && (h("span", { key: '984e99ed8af3de2d525cbb7d483af0a006fd77b9', class: "hb-date-range-picker__clear", onClick: this.handleClear }, "\u00D7")), h("span", { key: 'ca489ea7075035a405554477a525eb21f74ac72c', class: "hb-date-range-picker__icon" }, "\uD83D\uDCC5"))), this.isOpen && (h("div", { key: '3c53193d613b99f6ba3e7067ecf4a64cb948251f', class: "hb-date-range-picker__dropdown" }, this.renderMonth(this.leftViewDate, 'left'), this.renderMonth(rightViewDate, 'right')))));
|
|
204
204
|
}
|
|
205
205
|
static get is() { return "hb-date-range-picker"; }
|
|
206
206
|
static get encapsulation() { return "shadow"; }
|
|
@@ -97,12 +97,12 @@ export class DateTimePicker {
|
|
|
97
97
|
const hours = Array.from({ length: 24 }, (_, i) => i);
|
|
98
98
|
const minutes = Array.from({ length: 60 }, (_, i) => i);
|
|
99
99
|
const seconds = Array.from({ length: 60 }, (_, i) => i);
|
|
100
|
-
return (h("div", { key: '
|
|
100
|
+
return (h("div", { key: '55bfc24d36320660882db41b17902564989c11ad', class: {
|
|
101
101
|
'hb-date-time-picker': true,
|
|
102
102
|
'hb-date-time-picker--open': this.isOpen,
|
|
103
103
|
'hb-date-time-picker--disabled': this.disabled,
|
|
104
104
|
[`hb-date-time-picker--${this.size}`]: true,
|
|
105
|
-
} }, h("div", { key: '
|
|
105
|
+
} }, h("div", { key: 'cc339767373fdc5adc383e0c50a42df290a0dbf5', class: "hb-date-time-picker__input-wrapper", onClick: this.handleInputClick }, h("input", { key: '52de52179b54f039661a6d0cc2469567dbad1c8f', type: "text", id: this.inputId, name: this.name, class: "hb-date-time-picker__input", placeholder: this.placeholder, value: this.inputValue, disabled: this.disabled, readonly: true }), h("span", { key: '9e5f570884d0f5bc9e8715ac79f3117646a8a7c8', class: "hb-date-time-picker__suffix" }, this.clearable && this.modelValue && (h("span", { key: '8480660a74eb665b5b987fda8aeb8ef38878e110', class: "hb-date-time-picker__clear", onClick: this.handleClear }, "\u00D7")), h("span", { key: 'eb4910df6ca2df24fa2d91f6900180dc1fba4aa5', class: "hb-date-time-picker__icon" }, "\uD83D\uDCC5"))), this.isOpen && (h("div", { key: '69a2a1438cd788ad6a070c0bf170f75ac5204e8f', class: "hb-date-time-picker__dropdown" }, this.currentView === 'date' ? ([
|
|
106
106
|
h("div", { class: "hb-date-time-picker__header" }, h("button", { type: "button", class: "hb-date-time-picker__prev-btn", onClick: () => this.changeMonth(-1) }, "\u2039"), h("span", { class: "hb-date-time-picker__header-label" }, current.getFullYear(), "\u5E74 ", MONTH_NAMES[current.getMonth()]), h("button", { type: "button", class: "hb-date-time-picker__next-btn", onClick: () => this.changeMonth(1) }, "\u203A")),
|
|
107
107
|
h("div", { class: "hb-date-time-picker__body" }, h("div", { class: "hb-date-time-picker__weekdays" }, WEEK_DAY_NAMES.map(day => h("div", { class: "hb-date-time-picker__weekday" }, day))), h("div", { class: "hb-date-time-picker__days" }, days.map((day, index) => (h("div", { key: index, class: {
|
|
108
108
|
'hb-date-time-picker__day': true,
|
|
@@ -15,7 +15,7 @@ export class Descriptions {
|
|
|
15
15
|
/** 描述项数组 */
|
|
16
16
|
items = [];
|
|
17
17
|
render() {
|
|
18
|
-
return (h("div", { key: '
|
|
18
|
+
return (h("div", { key: '8eca1aa5621202c1e88d866e1eeab1246dce7294', class: { 'hb-descriptions': true, 'hb-descriptions--bordered': this.border } }, this.title && h("div", { key: 'b928e6f3e2cd9bc24fa5c84dd3c57b4f198c6514', class: "hb-descriptions__title" }, this.title), h("div", { key: '56ac04c6f168efdf5c67b71eaa959205d52bafdc', class: "hb-descriptions__view" }, h("div", { key: '3b2b1d157ee5220e27dab7460fa61447bec29c08', class: "hb-descriptions__row", style: { gridTemplateColumns: `repeat(${this.column}, minmax(0, 1fr))` } }, this.items.map((item) => (h("div", { class: "hb-descriptions__item", style: item.span ? { gridColumn: `span ${item.span}` } : undefined }, h("span", { class: "hb-descriptions__label" }, item.label, this.colon && h("span", { class: "hb-descriptions__colon" }, "\uFF1A")), h("span", { class: "hb-descriptions__value" }, item.value))))))));
|
|
19
19
|
}
|
|
20
20
|
static get is() { return "hb-descriptions"; }
|
|
21
21
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
:host {
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
2
4
|
.hb-descriptions {
|
|
3
5
|
font-size: var(--hb-font-size-sm);
|
|
4
6
|
color: var(--hb-color-text);
|
|
@@ -11,7 +13,9 @@
|
|
|
11
13
|
color: var(--hb-color-text-primary);
|
|
12
14
|
margin-bottom: var(--hb-spacing-sm);
|
|
13
15
|
}
|
|
14
|
-
.hb-descriptions__view {
|
|
16
|
+
.hb-descriptions__view {
|
|
17
|
+
width: 100%;
|
|
18
|
+
}
|
|
15
19
|
.hb-descriptions__row {
|
|
16
20
|
display: grid;
|
|
17
21
|
gap: 0;
|
|
@@ -22,11 +26,13 @@
|
|
|
22
26
|
padding: var(--hb-spacing-sm) var(--hb-spacing-md);
|
|
23
27
|
border-bottom: 1px solid var(--hb-color-border-secondary);
|
|
24
28
|
}
|
|
25
|
-
.hb-descriptions__row .hb-descriptions__item:nth-last-child(-n+3):not(:nth-last-child(1)) {
|
|
29
|
+
.hb-descriptions__row .hb-descriptions__item:nth-last-child(-n + 3):not(:nth-last-child(1)) {
|
|
26
30
|
/* 保留默认下边框,最后一项由下方规则移除 */
|
|
27
31
|
}
|
|
28
32
|
/* 简化:最后一个 item 无下边框 */
|
|
29
|
-
.hb-descriptions__row .hb-descriptions__item:last-child {
|
|
33
|
+
.hb-descriptions__row .hb-descriptions__item:last-child {
|
|
34
|
+
border-bottom: none;
|
|
35
|
+
}
|
|
30
36
|
|
|
31
37
|
.hb-descriptions__label {
|
|
32
38
|
color: var(--hb-color-text-secondary);
|
|
@@ -34,7 +40,9 @@
|
|
|
34
40
|
margin-right: var(--hb-spacing-sm);
|
|
35
41
|
flex-shrink: 0;
|
|
36
42
|
}
|
|
37
|
-
.hb-descriptions__colon {
|
|
43
|
+
.hb-descriptions__colon {
|
|
44
|
+
margin-left: 0;
|
|
45
|
+
}
|
|
38
46
|
.hb-descriptions__value {
|
|
39
47
|
color: var(--hb-color-text);
|
|
40
48
|
word-break: break-all;
|
|
@@ -45,8 +53,42 @@
|
|
|
45
53
|
border: 1px solid var(--hb-color-border-secondary);
|
|
46
54
|
overflow: hidden;
|
|
47
55
|
}
|
|
48
|
-
.hb-descriptions--bordered .hb-descriptions__title {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
.hb-descriptions--bordered .hb-descriptions__title {
|
|
57
|
+
padding: var(--hb-spacing-sm) var(--hb-spacing-md);
|
|
58
|
+
margin-bottom: 0;
|
|
59
|
+
border-bottom: 1px solid var(--hb-color-border-secondary);
|
|
60
|
+
}
|
|
61
|
+
.hb-descriptions--bordered .hb-descriptions__item {
|
|
62
|
+
border-right: 1px solid var(--hb-color-border-secondary);
|
|
63
|
+
}
|
|
64
|
+
.hb-descriptions--bordered .hb-descriptions__item:nth-child(3n) {
|
|
65
|
+
border-right: none;
|
|
66
|
+
}
|
|
67
|
+
.hb-descriptions--bordered .hb-descriptions__item {
|
|
68
|
+
padding: var(--hb-spacing-sm) var(--hb-spacing-md);
|
|
69
|
+
}
|
|
70
|
+
.hb-descriptions--bordered .hb-descriptions__item:last-child {
|
|
71
|
+
border-bottom: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* ============================================================
|
|
75
|
+
* 响应式(移动端):小屏 descriptions 改为单列纵向堆叠,
|
|
76
|
+
* label 与 value 上下排列,避免横向挤压。
|
|
77
|
+
* ============================================================ */
|
|
78
|
+
@media (max-width: 575.98px) {
|
|
79
|
+
.hb-descriptions__row {
|
|
80
|
+
grid-template-columns: 1fr !important;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.hb-descriptions__item {
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
align-items: flex-start;
|
|
86
|
+
gap: var(--hb-spacing-xxs, 2px);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.hb-descriptions__label {
|
|
90
|
+
margin-right: 0;
|
|
91
|
+
margin-bottom: var(--hb-spacing-xxs, 2px);
|
|
92
|
+
font-weight: 500;
|
|
93
|
+
}
|
|
94
|
+
}
|