huibo-ui 0.3.0 → 0.4.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/{date-helpers-904747ff.js → date-helpers-1ffddc59.js} +7 -3
- package/dist/cjs/date-helpers-1ffddc59.js.map +1 -0
- package/dist/cjs/hb-affix.cjs.entry.js +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 +270 -146
- package/dist/cjs/hb-cascader.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/hb-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/hb-collapse-item.cjs.entry.js +1 -1
- package/dist/cjs/hb-collapse.cjs.entry.js +1 -1
- package/dist/cjs/hb-color-picker-panel.cjs.entry.js +2 -2
- package/dist/cjs/hb-color-picker.cjs.entry.js +91 -14
- 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 +85 -7
- 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-divider.cjs.entry.js +2 -2
- package/dist/cjs/hb-drawer.cjs.entry.js +1 -1
- package/dist/cjs/hb-dropdown.cjs.entry.js +74 -6
- 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 +59 -8
- package/dist/cjs/hb-form-item.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-form.cjs.entry.js +3 -3
- 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 +12 -8
- package/dist/cjs/hb-image-preview.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-image.cjs.entry.js +1 -1
- package/dist/cjs/hb-input-number.cjs.entry.js +5 -5
- package/dist/cjs/hb-input-tag.cjs.entry.js +2 -2
- package/dist/cjs/hb-input.cjs.entry.js +39 -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 +2 -2
- 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 +2 -2
- 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 +21 -8
- package/dist/cjs/hb-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-popconfirm.cjs.entry.js +37 -7
- package/dist/cjs/hb-popconfirm.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-popover.cjs.entry.js +22 -2
- 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 +2 -2
- package/dist/cjs/hb-rate.cjs.entry.js +45 -3
- 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-segmented.cjs.entry.js +39 -5
- package/dist/cjs/hb-segmented.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-select.cjs.entry.js +47 -8
- package/dist/cjs/hb-select.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-slider.cjs.entry.js +189 -20
- 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 +4 -4
- 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 +1 -1
- package/dist/cjs/hb-table.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-tabs.cjs.entry.js +2 -2
- package/dist/cjs/hb-tag.cjs.entry.js +2 -2
- package/dist/cjs/hb-text.cjs.entry.js +2 -2
- package/dist/cjs/hb-time-picker.cjs.entry.js +4 -4
- package/dist/cjs/hb-time-select.cjs.entry.js +2 -2
- package/dist/cjs/hb-timeline.cjs.entry.js +1 -1
- package/dist/cjs/hb-tooltip.cjs.entry.js +18 -1
- 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 +95 -18
- package/dist/cjs/hb-tree-select.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-tree.cjs.entry.js +1 -1
- package/dist/cjs/hb-upload.cjs.entry.js +3 -3
- package/dist/cjs/hb-watermark.cjs.entry.js +1 -1
- package/dist/cjs/huibo-ui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/Affix/Affix.js +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 +374 -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 +3 -3
- package/dist/collection/components/Checkbox/CheckboxGroup.js +2 -2
- package/dist/collection/components/Collapse/Collapse.js +1 -1
- package/dist/collection/components/Collapse/CollapseItem.js +1 -1
- package/dist/collection/components/ColorPicker/ColorPicker.js +92 -14
- package/dist/collection/components/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/collection/components/ColorPicker/color-picker.css +13 -0
- 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 +89 -10
- package/dist/collection/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/collection/components/DatePicker/date-picker.css +62 -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 +22 -0
- package/dist/collection/components/Divider/Divider.js +2 -2
- package/dist/collection/components/Drawer/Drawer.js +1 -1
- package/dist/collection/components/Dropdown/Dropdown.js +83 -7
- package/dist/collection/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/collection/components/Dropdown/dropdown.css +2 -1
- 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 +2 -2
- package/dist/collection/components/Form/FormItem.js +60 -9
- package/dist/collection/components/Form/FormItem.js.map +1 -1
- package/dist/collection/components/Form/form-item.css +49 -4
- package/dist/collection/components/Form/form.css +1 -0
- package/dist/collection/components/Image/Image.js +1 -1
- package/dist/collection/components/ImagePreview/ImagePreview.js +12 -8
- package/dist/collection/components/ImagePreview/ImagePreview.js.map +1 -1
- package/dist/collection/components/Input/Input.js +38 -2
- package/dist/collection/components/Input/Input.js.map +1 -1
- package/dist/collection/components/Input/input.css +21 -2
- package/dist/collection/components/InputNumber/InputNumber.js +5 -5
- 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 +524 -0
- 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 +2 -2
- 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 +2 -2
- 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 +23 -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 +44 -7
- package/dist/collection/components/Popconfirm/Popconfirm.js.map +1 -1
- package/dist/collection/components/Popover/Popover.js +29 -2
- package/dist/collection/components/Popover/Popover.js.map +1 -1
- package/dist/collection/components/Progress/Progress.js +1 -1
- package/dist/collection/components/Radio/Radio.js +2 -2
- package/dist/collection/components/Rate/Rate.js +45 -3
- package/dist/collection/components/Rate/Rate.js.map +1 -1
- package/dist/collection/components/Result/Result.js +1 -1
- package/dist/collection/components/Segmented/Segmented.js +51 -6
- package/dist/collection/components/Segmented/Segmented.js.map +1 -1
- package/dist/collection/components/Select/Select.js +46 -7
- package/dist/collection/components/Select/Select.js.map +1 -1
- package/dist/collection/components/Select/select.css +50 -4
- package/dist/collection/components/Slider/Slider.js +221 -21
- package/dist/collection/components/Slider/Slider.js.map +1 -1
- package/dist/collection/components/Slider/slider.css +58 -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 +45 -0
- package/dist/collection/components/Table/table.css +20 -0
- package/dist/collection/components/Tabs/TabPane.js +1 -1
- package/dist/collection/components/Tabs/Tabs.js +2 -2
- package/dist/collection/components/Tag/Tag.js +2 -2
- package/dist/collection/components/Text/Text.js +2 -2
- package/dist/collection/components/TimePicker/TimePicker.js +4 -4
- package/dist/collection/components/TimeSelect/TimeSelect.js +2 -2
- package/dist/collection/components/Timeline/Timeline.js +1 -1
- package/dist/collection/components/Tooltip/Tooltip.js +25 -2
- package/dist/collection/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/collection/components/Transfer/Transfer.js +2 -2
- package/dist/collection/components/Tree/Tree.js +1 -1
- package/dist/collection/components/TreeSelect/TreeSelect.js +94 -17
- 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 +1 -1
- package/dist/collection/utils/date-helpers.js +6 -2
- package/dist/collection/utils/date-helpers.js.map +1 -1
- package/dist/components/hb-affix.js +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 +273 -146
- package/dist/components/hb-cascader.js.map +1 -1
- package/dist/components/hb-checkbox-group.js +2 -2
- package/dist/components/hb-checkbox.js +3 -3
- package/dist/components/hb-collapse-item.js +1 -1
- package/dist/components/hb-collapse.js +1 -1
- package/dist/components/hb-color-picker-panel.js +2 -2
- package/dist/components/hb-color-picker.js +93 -15
- 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 +87 -8
- 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-divider.js +2 -2
- package/dist/components/hb-drawer.js +1 -1
- package/dist/components/hb-dropdown.js +76 -7
- 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 +59 -8
- package/dist/components/hb-form-item.js.map +1 -1
- package/dist/components/hb-form.js +3 -3
- 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 +12 -8
- package/dist/components/hb-image-preview.js.map +1 -1
- package/dist/components/hb-image.js +1 -1
- package/dist/components/hb-input-number.js +5 -5
- package/dist/components/hb-input-tag.js +2 -2
- package/dist/components/hb-input.js +39 -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 +2 -2
- package/dist/components/hb-menu.js +3 -3
- package/dist/components/hb-menu.js.map +1 -1
- package/dist/components/hb-message.js +2 -2
- package/dist/components/hb-notification.js +2 -2
- package/dist/components/hb-page-header.js +1 -1
- package/dist/components/hb-pagination.js +25 -10
- package/dist/components/hb-pagination.js.map +1 -1
- package/dist/components/hb-popconfirm.js +37 -7
- package/dist/components/hb-popconfirm.js.map +1 -1
- package/dist/components/hb-popover.js +22 -2
- package/dist/components/hb-popover.js.map +1 -1
- package/dist/components/hb-progress.js +1 -1
- package/dist/components/hb-radio.js +2 -2
- package/dist/components/hb-rate.js +45 -3
- 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-segmented.js +41 -6
- package/dist/components/hb-segmented.js.map +1 -1
- package/dist/components/hb-select.js +47 -8
- package/dist/components/hb-select.js.map +1 -1
- package/dist/components/hb-slider.js +194 -21
- 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 +4 -4
- 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 +1 -1
- package/dist/components/hb-table.js.map +1 -1
- package/dist/components/hb-tabs.js +2 -2
- package/dist/components/hb-tag.js +2 -2
- package/dist/components/hb-text.js +2 -2
- package/dist/components/hb-time-picker.js +4 -4
- package/dist/components/hb-time-select.js +2 -2
- package/dist/components/hb-timeline.js +1 -1
- package/dist/components/hb-tooltip.js +18 -1
- package/dist/components/hb-tooltip.js.map +1 -1
- package/dist/components/hb-transfer.js +2 -2
- package/dist/components/hb-tree-select.js +95 -18
- package/dist/components/hb-tree-select.js.map +1 -1
- package/dist/components/hb-tree.js +1 -1
- package/dist/components/hb-upload.js +3 -3
- package/dist/components/hb-watermark.js +1 -1
- package/dist/components/{p-cf94cbf6.js → p-08b4005c.js} +7 -3
- package/dist/components/p-08b4005c.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 → date-helpers-44507189.js} +7 -3
- package/dist/esm/date-helpers-44507189.js.map +1 -0
- package/dist/esm/hb-affix.entry.js +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 +270 -146
- package/dist/esm/hb-cascader.entry.js.map +1 -1
- package/dist/esm/hb-checkbox-group.entry.js +2 -2
- package/dist/esm/hb-checkbox.entry.js +3 -3
- package/dist/esm/hb-collapse-item.entry.js +1 -1
- package/dist/esm/hb-collapse.entry.js +1 -1
- package/dist/esm/hb-color-picker-panel.entry.js +2 -2
- package/dist/esm/hb-color-picker.entry.js +91 -14
- 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 +85 -7
- 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-divider.entry.js +2 -2
- package/dist/esm/hb-drawer.entry.js +1 -1
- package/dist/esm/hb-dropdown.entry.js +74 -6
- 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 +59 -8
- package/dist/esm/hb-form-item.entry.js.map +1 -1
- package/dist/esm/hb-form.entry.js +3 -3
- 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 +12 -8
- package/dist/esm/hb-image-preview.entry.js.map +1 -1
- package/dist/esm/hb-image.entry.js +1 -1
- package/dist/esm/hb-input-number.entry.js +5 -5
- package/dist/esm/hb-input-tag.entry.js +2 -2
- package/dist/esm/hb-input.entry.js +39 -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 +2 -2
- 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 +2 -2
- 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 +21 -8
- package/dist/esm/hb-pagination.entry.js.map +1 -1
- package/dist/esm/hb-popconfirm.entry.js +37 -7
- package/dist/esm/hb-popconfirm.entry.js.map +1 -1
- package/dist/esm/hb-popover.entry.js +22 -2
- 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 +2 -2
- package/dist/esm/hb-rate.entry.js +45 -3
- 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-segmented.entry.js +40 -6
- package/dist/esm/hb-segmented.entry.js.map +1 -1
- package/dist/esm/hb-select.entry.js +47 -8
- package/dist/esm/hb-select.entry.js.map +1 -1
- package/dist/esm/hb-slider.entry.js +189 -20
- 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 +4 -4
- 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 +1 -1
- package/dist/esm/hb-table.entry.js.map +1 -1
- package/dist/esm/hb-tabs.entry.js +2 -2
- package/dist/esm/hb-tag.entry.js +2 -2
- package/dist/esm/hb-text.entry.js +2 -2
- package/dist/esm/hb-time-picker.entry.js +4 -4
- package/dist/esm/hb-time-select.entry.js +2 -2
- package/dist/esm/hb-timeline.entry.js +1 -1
- package/dist/esm/hb-tooltip.entry.js +18 -1
- 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 +95 -18
- package/dist/esm/hb-tree-select.entry.js.map +1 -1
- package/dist/esm/hb-tree.entry.js +1 -1
- package/dist/esm/hb-upload.entry.js +3 -3
- package/dist/esm/hb-watermark.entry.js +1 -1
- package/dist/esm/huibo-ui.js +1 -1
- package/dist/esm/loader.js +1 -1
- 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-02f15843.entry.js +2 -0
- package/dist/huibo-ui/p-08b4005c.js +2 -0
- package/dist/huibo-ui/p-08b4005c.js.map +1 -0
- package/dist/huibo-ui/{p-fd19813c.entry.js → p-0d4b2997.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-d7815b4f.entry.js → p-13010da2.entry.js} +2 -2
- package/dist/huibo-ui/{p-8c80a765.entry.js → p-15db24e9.entry.js} +2 -2
- package/dist/huibo-ui/{p-8d925e3d.entry.js → p-1b0fbe69.entry.js} +2 -2
- package/dist/huibo-ui/p-1f8db37a.entry.js +2 -0
- package/dist/huibo-ui/p-1f8db37a.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-315feadf.entry.js → p-213b9de7.entry.js} +2 -2
- package/dist/huibo-ui/p-25fd7d5c.entry.js +2 -0
- package/dist/huibo-ui/p-25fd7d5c.entry.js.map +1 -0
- package/dist/huibo-ui/p-2811e603.entry.js +2 -0
- package/dist/huibo-ui/p-2811e603.entry.js.map +1 -0
- package/dist/huibo-ui/{p-64ca0980.entry.js → p-2943f5d0.entry.js} +2 -2
- package/dist/huibo-ui/p-2943f5d0.entry.js.map +1 -0
- package/dist/huibo-ui/{p-710f38de.entry.js → p-2b4556ff.entry.js} +2 -2
- package/dist/huibo-ui/{p-e0ab9010.entry.js → p-33de6878.entry.js} +2 -2
- package/dist/huibo-ui/{p-ebd04656.entry.js → p-3807da71.entry.js} +2 -2
- package/dist/huibo-ui/{p-6a1ec3ff.entry.js → p-3deff48c.entry.js} +2 -2
- package/dist/huibo-ui/{p-e2a8a396.entry.js → p-41d9c846.entry.js} +2 -2
- package/dist/huibo-ui/{p-0a033738.entry.js → p-47ef7a86.entry.js} +2 -2
- package/dist/huibo-ui/p-4d34e43e.entry.js +2 -0
- package/dist/huibo-ui/p-4d34e43e.entry.js.map +1 -0
- package/dist/huibo-ui/p-54aa2fd8.entry.js +2 -0
- package/dist/huibo-ui/p-54aa2fd8.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-c1b4eacb.entry.js → p-60532a1f.entry.js} +2 -2
- package/dist/huibo-ui/{p-59b2e61c.entry.js → p-626b48f1.entry.js} +2 -2
- package/dist/huibo-ui/p-626b48f1.entry.js.map +1 -0
- package/dist/huibo-ui/p-639f167d.entry.js +2 -0
- package/dist/huibo-ui/p-639f167d.entry.js.map +1 -0
- package/dist/huibo-ui/{p-f1c084c5.entry.js → p-678b4212.entry.js} +2 -2
- package/dist/huibo-ui/p-6beb5b81.entry.js +2 -0
- package/dist/huibo-ui/p-6beb5b81.entry.js.map +1 -0
- package/dist/huibo-ui/{p-a0015341.entry.js → p-6bfeab80.entry.js} +2 -2
- 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-85f68526.entry.js → p-735bceef.entry.js} +2 -2
- package/dist/huibo-ui/{p-8b1ae77e.entry.js → p-746a11a3.entry.js} +2 -2
- package/dist/huibo-ui/p-76519752.entry.js +2 -0
- package/dist/huibo-ui/{p-d3939d44.entry.js → p-79af2efa.entry.js} +2 -2
- package/dist/huibo-ui/{p-e0768565.entry.js → p-7da14d7c.entry.js} +2 -2
- package/dist/huibo-ui/{p-8c987d57.entry.js → p-7f65dc36.entry.js} +2 -2
- package/dist/huibo-ui/{p-0e65e1bd.entry.js → p-86bdc48a.entry.js} +2 -2
- package/dist/huibo-ui/p-86bdc48a.entry.js.map +1 -0
- package/dist/huibo-ui/{p-d87fc21a.entry.js → p-88a6c905.entry.js} +2 -2
- package/dist/huibo-ui/{p-d64b91ef.entry.js → p-89ea1141.entry.js} +2 -2
- package/dist/huibo-ui/p-89ea1141.entry.js.map +1 -0
- 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-8a8443b8.entry.js +2 -0
- package/dist/huibo-ui/p-8a8443b8.entry.js.map +1 -0
- package/dist/huibo-ui/p-8fd788c9.entry.js +2 -0
- package/dist/huibo-ui/p-8fd788c9.entry.js.map +1 -0
- package/dist/huibo-ui/{p-9319c650.entry.js → p-8fdbd17c.entry.js} +2 -2
- package/dist/huibo-ui/p-92521c31.entry.js +2 -0
- package/dist/huibo-ui/p-92521c31.entry.js.map +1 -0
- package/dist/huibo-ui/{p-c3e665f6.entry.js → p-9a5406f0.entry.js} +2 -2
- package/dist/huibo-ui/p-9a5406f0.entry.js.map +1 -0
- package/dist/huibo-ui/{p-c321c4aa.entry.js → p-a084b8e5.entry.js} +2 -2
- package/dist/huibo-ui/{p-5df47135.entry.js → p-a190ca89.entry.js} +2 -2
- package/dist/huibo-ui/{p-463de26d.entry.js → p-a8996d22.entry.js} +2 -2
- package/dist/huibo-ui/p-aa5e5e02.entry.js +2 -0
- package/dist/huibo-ui/p-aa5e5e02.entry.js.map +1 -0
- package/dist/huibo-ui/{p-6b381d0e.entry.js → p-ab9cf0e4.entry.js} +2 -2
- package/dist/huibo-ui/{p-477d8568.entry.js → p-aeae83af.entry.js} +2 -2
- package/dist/huibo-ui/{p-77017274.entry.js → p-af74667d.entry.js} +2 -2
- package/dist/huibo-ui/{p-b489a526.entry.js → p-b06c8020.entry.js} +2 -2
- package/dist/huibo-ui/{p-2e6584ea.entry.js → p-b468858e.entry.js} +2 -2
- package/dist/huibo-ui/{p-2b286698.entry.js → p-b7885d4a.entry.js} +2 -2
- package/dist/huibo-ui/{p-231a7335.entry.js → p-b8d87f7e.entry.js} +2 -2
- package/dist/huibo-ui/{p-8b027491.entry.js → p-c50ad398.entry.js} +2 -2
- package/dist/huibo-ui/p-c6c91664.entry.js +2 -0
- package/dist/huibo-ui/{p-c3e8893d.entry.js → p-c80f8ace.entry.js} +2 -2
- package/dist/huibo-ui/p-c80f8ace.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-c922d672.entry.js → p-cad57c2d.entry.js} +2 -2
- package/dist/huibo-ui/{p-a042e3d0.entry.js → p-ccd09d5a.entry.js} +2 -2
- package/dist/huibo-ui/p-d79a15b1.entry.js +2 -0
- package/dist/huibo-ui/p-d79a15b1.entry.js.map +1 -0
- package/dist/huibo-ui/{p-10c088f3.entry.js → p-d9c7c378.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-be48d2aa.entry.js → p-e039155d.entry.js} +2 -2
- package/dist/huibo-ui/{p-dfaf7e37.entry.js → p-e10fcfbe.entry.js} +2 -2
- package/dist/huibo-ui/{p-079a4130.entry.js → p-e3155cd7.entry.js} +2 -2
- package/dist/huibo-ui/{p-4001c08d.entry.js → p-e5cbfa9e.entry.js} +2 -2
- package/dist/huibo-ui/p-e5cbfa9e.entry.js.map +1 -0
- package/dist/huibo-ui/p-edbda423.entry.js +2 -0
- package/dist/huibo-ui/p-edbda423.entry.js.map +1 -0
- package/dist/huibo-ui/{p-465dcb4c.entry.js → p-f2c78699.entry.js} +2 -2
- package/dist/huibo-ui/{p-6ac242fe.entry.js → p-f4336be9.entry.js} +2 -2
- package/dist/huibo-ui/{p-332c8877.entry.js → p-f5969181.entry.js} +2 -2
- package/dist/huibo-ui/{p-f81ec512.entry.js → p-f6889710.entry.js} +2 -2
- package/dist/huibo-ui/{p-24ad7eec.entry.js → p-f9bb5217.entry.js} +2 -2
- package/dist/huibo-ui/{p-4d8b1404.entry.js → p-fd8301c6.entry.js} +2 -2
- package/dist/huibo-ui/{p-dd05cb2c.entry.js → p-fea20295.entry.js} +2 -2
- package/dist/types/components/Calendar/Calendar.d.ts +13 -1
- package/dist/types/components/Cascader/Cascader.d.ts +68 -90
- package/dist/types/components/ColorPicker/ColorPicker.d.ts +11 -0
- package/dist/types/components/DatePicker/DatePicker.d.ts +14 -3
- package/dist/types/components/Dropdown/Dropdown.d.ts +14 -1
- package/dist/types/components/Form/FormItem.d.ts +10 -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/Pagination/Pagination.d.ts +3 -0
- package/dist/types/components/Popconfirm/Popconfirm.d.ts +12 -0
- package/dist/types/components/Popover/Popover.d.ts +9 -0
- package/dist/types/components/Rate/Rate.d.ts +7 -0
- package/dist/types/components/Segmented/Segmented.d.ts +12 -1
- package/dist/types/components/Select/Select.d.ts +6 -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/Tooltip/Tooltip.d.ts +9 -1
- package/dist/types/components/TreeSelect/TreeSelect.d.ts +9 -0
- package/dist/types/components.d.ts +250 -94
- package/dist/types/utils/date-helpers.d.ts +1 -1
- package/package.json +8 -2
- package/readme.md +88 -73
- package/dist/cjs/date-helpers-904747ff.js.map +0 -1
- package/dist/components/p-cf94cbf6.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-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-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-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-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-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-c3e665f6.entry.js.map +0 -1
- package/dist/huibo-ui/p-c3e8893d.entry.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-d64b91ef.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-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-4d0dff15.entry.js.map → p-02f15843.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-fd19813c.entry.js.map → p-0d4b2997.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-d7815b4f.entry.js.map → p-13010da2.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-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-315feadf.entry.js.map → p-213b9de7.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-710f38de.entry.js.map → p-2b4556ff.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-e0ab9010.entry.js.map → p-33de6878.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-ebd04656.entry.js.map → p-3807da71.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-e2a8a396.entry.js.map → p-41d9c846.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-0a033738.entry.js.map → p-47ef7a86.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-c1b4eacb.entry.js.map → p-60532a1f.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-f1c084c5.entry.js.map → p-678b4212.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-85f68526.entry.js.map → p-735bceef.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-953b9514.entry.js.map → p-76519752.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-d3939d44.entry.js.map → p-79af2efa.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-e0768565.entry.js.map → p-7da14d7c.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-d87fc21a.entry.js.map → p-88a6c905.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-9319c650.entry.js.map → p-8fdbd17c.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-c321c4aa.entry.js.map → p-a084b8e5.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-463de26d.entry.js.map → p-a8996d22.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-6b381d0e.entry.js.map → p-ab9cf0e4.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-77017274.entry.js.map → p-af74667d.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-2e6584ea.entry.js.map → p-b468858e.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-231a7335.entry.js.map → p-b8d87f7e.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-8b027491.entry.js.map → p-c50ad398.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-769960f4.entry.js.map → p-c6c91664.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-c922d672.entry.js.map → p-cad57c2d.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-a042e3d0.entry.js.map → p-ccd09d5a.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-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-be48d2aa.entry.js.map → p-e039155d.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-dfaf7e37.entry.js.map → p-e10fcfbe.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-465dcb4c.entry.js.map → p-f2c78699.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-6ac242fe.entry.js.map → p-f4336be9.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-332c8877.entry.js.map → p-f5969181.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-f81ec512.entry.js.map → p-f6889710.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-24ad7eec.entry.js.map → p-f9bb5217.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-4d8b1404.entry.js.map → p-fd8301c6.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-dd05cb2c.entry.js.map → p-fea20295.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeSelect.js","sourceRoot":"","sources":["../../../src/components/TreeSelect/TreeSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAGtE;;;GAGG;AAMH,MAAM,OAAO,UAAU;IACV,EAAE,CAAc;IAE3B;;OAEG;IACK,IAAI,GAAe,EAAE,CAAC;IAE9B;;OAEG;IACsB,UAAU,GAAsB,EAAE,C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Element } from '@stencil/core';\nimport { createClickOutsideHandler } from '../../utils/click-outside';\nimport type { TreeNode } from '../Tree/Tree';\n\n/**\n * TreeSelect 树形选择器\n * 类似 Select,但下拉选项以树形结构展示,支持单选与多选\n */\n@Component({\n tag: 'hb-tree-select',\n styleUrl: 'tree-select.css',\n shadow: true,\n})\nexport class TreeSelect {\n @Element() el: HTMLElement;\n\n /**\n * 可选项数据源(与 Tree 相同的递归树结构)\n */\n @Prop() data: TreeNode[] = [];\n\n /**\n * (受控)绑定值,单选为 string,多选为 string[]\n */\n @Prop({ mutable: true }) modelValue: string | string[] = '';\n\n /**\n * 是否多选\n * @default false\n */\n @Prop() multiple: boolean = false;\n\n /**\n * 占位文本\n * @default '请选择'\n */\n @Prop() placeholder: string = '请选择';\n\n /**\n * 是否禁用\n * @default false\n */\n @Prop() disabled: boolean = false;\n\n /**\n * 是否显示 checkbox(多选模式下推荐开启)\n * @default false\n */\n @Prop() checkable: boolean = false;\n\n /**\n * 是否默认展开全部节点\n * @default false\n */\n @Prop() defaultExpandAll: boolean = false;\n\n @State() isOpen: boolean = false;\n @State() internalExpanded: string[] = [];\n @State() internalSelected: string[] = [];\n @State() internalChecked: string[] = [];\n\n /**\n * 值变化事件(单选为 string,多选为 string[])\n */\n @Event() hbChange: EventEmitter<string | string[]>;\n\n /**\n * 下拉浮层显隐变化事件\n */\n @Event() hbVisibleChange: EventEmitter<boolean>;\n\n private clickOutside = createClickOutsideHandler({\n host: null as any,\n isOpen: () => this.isOpen,\n onClose: () => this.closeDropdown(),\n });\n\n componentWillLoad() {\n this.syncFromModelValue();\n if (this.defaultExpandAll) {\n const all: string[] = [];\n this.collectExpandableKeys(this.data, all);\n this.internalExpanded = all;\n }\n }\n\n componentDidLoad() {\n this.clickOutside = createClickOutsideHandler({\n host: this.el,\n isOpen: () => this.isOpen,\n onClose: () => this.closeDropdown(),\n });\n this.clickOutside.connect();\n }\n\n disconnectedCallback() {\n this.clickOutside.disconnect();\n }\n\n private syncFromModelValue() {\n if (this.multiple) {\n const arr = Array.isArray(this.modelValue) ? this.modelValue : [];\n this.internalSelected = [...arr];\n this.internalChecked = [...arr];\n } else {\n const single = typeof this.modelValue === 'string' ? this.modelValue : '';\n this.internalSelected = single ? [single] : [];\n this.internalChecked = single ? [single] : [];\n }\n }\n\n private collectExpandableKeys(nodes: TreeNode[], out: string[]) {\n for (const node of nodes) {\n if (node.children && node.children.length > 0) {\n out.push(node.key);\n this.collectExpandableKeys(node.children, out);\n }\n }\n }\n\n private findTitle(nodes: TreeNode[], key: string): string | null {\n for (const node of nodes) {\n if (node.key === key) return node.title;\n if (node.children) {\n const found = this.findTitle(node.children, key);\n if (found) return found;\n }\n }\n return null;\n }\n\n private getDisplayText(): string {\n if (this.multiple) {\n const arr = Array.isArray(this.modelValue) ? this.modelValue : [];\n if (arr.length === 0) return '';\n const titles = arr.map((k) => this.findTitle(this.data, k) || k);\n return titles.join(' / ');\n }\n const single = typeof this.modelValue === 'string' ? this.modelValue : '';\n return single ? this.findTitle(this.data, single) || single : '';\n }\n\n private openDropdown = () => {\n if (this.disabled || this.isOpen) return;\n this.isOpen = true;\n this.hbVisibleChange.emit(true);\n };\n\n private closeDropdown = () => {\n if (!this.isOpen) return;\n this.isOpen = false;\n this.hbVisibleChange.emit(false);\n };\n\n private toggleDropdown = () => {\n if (this.disabled) return;\n if (this.isOpen) this.closeDropdown();\n else this.openDropdown();\n };\n\n private handleNodeSelect = (key: string) => {\n if (this.multiple) {\n const current = [...this.internalSelected];\n const idx = current.indexOf(key);\n if (idx >= 0) current.splice(idx, 1);\n else current.push(key);\n this.internalSelected = current;\n this.modelValue = current;\n this.hbChange.emit(current);\n } else {\n this.internalSelected = [key];\n this.modelValue = key;\n this.hbChange.emit(key);\n this.closeDropdown();\n }\n };\n\n private handleNodeCheck = (key: string) => {\n // TODO: 父子联动 —— 当前仅管理单个节点勾选状态。\n const current = [...this.internalChecked];\n const idx = current.indexOf(key);\n if (idx >= 0) current.splice(idx, 1);\n else current.push(key);\n this.internalChecked = current;\n this.modelValue = current;\n this.hbChange.emit(current);\n };\n\n private handleToggleExpand = (node: TreeNode, e: Event) => {\n e.stopPropagation();\n const current = [...this.internalExpanded];\n const idx = current.indexOf(node.key);\n if (idx >= 0) current.splice(idx, 1);\n else current.push(node.key);\n this.internalExpanded = current;\n };\n\n private handleClear = (e: Event) => {\n e.stopPropagation();\n if (this.disabled) return;\n this.internalSelected = [];\n this.internalChecked = [];\n this.modelValue = this.multiple ? [] : '';\n this.hbChange.emit(this.modelValue);\n };\n\n private renderNode = (node: TreeNode, level: number): any => {\n const hasChildren = !!(node.children && node.children.length > 0);\n const expanded = this.internalExpanded.includes(node.key);\n const selected = this.internalSelected.includes(node.key);\n const checked = this.internalChecked.includes(node.key);\n const disabled = !!node.disabled;\n\n return (\n <li class={{ 'hb-tree-select__node': true, 'hb-tree-select__node--disabled': disabled }} role=\"treeitem\">\n <div\n class={{\n 'hb-tree-select__node-content': true,\n 'hb-tree-select__node-content--selected': selected,\n 'hb-tree-select__node-content--checked': checked,\n }}\n style={{ paddingLeft: `${level * 18 + 8}px` }}\n >\n <span class=\"hb-tree-select__switcher\" onClick={(e) => hasChildren && this.handleToggleExpand(node, e)}>\n {hasChildren ? (\n <span class={{ 'hb-tree-select__arrow': true, 'hb-tree-select__arrow--expanded': expanded }}>▶</span>\n ) : null}\n </span>\n\n {this.checkable && (\n <span\n class={{\n 'hb-tree-select__checkbox': true,\n 'hb-tree-select__checkbox--checked': checked,\n 'hb-tree-select__checkbox--disabled': disabled,\n }}\n onClick={() => !disabled && this.handleNodeCheck(node.key)}\n >\n {checked ? '✓' : ''}\n </span>\n )}\n\n <span class=\"hb-tree-select__title\" onClick={() => !disabled && this.handleNodeSelect(node.key)}>\n {node.title}\n </span>\n </div>\n\n {hasChildren && expanded && (\n <ul class=\"hb-tree-select__children\" role=\"group\">\n {node.children!.map((child) => this.renderNode(child, level + 1))}\n </ul>\n )}\n </li>\n );\n };\n\n render() {\n const displayText = this.getDisplayText();\n const hasValue = this.multiple\n ? Array.isArray(this.modelValue) && this.modelValue.length > 0\n : typeof this.modelValue === 'string' && this.modelValue !== '';\n\n return (\n <div\n class={{\n 'hb-tree-select': true,\n 'hb-tree-select--open': this.isOpen,\n 'hb-tree-select--disabled': this.disabled,\n 'hb-tree-select--multiple': this.multiple,\n }}\n >\n <div class=\"hb-tree-select__input-wrapper\" onClick={this.toggleDropdown}>\n <span\n class={{\n 'hb-tree-select__display': true,\n 'hb-tree-select__display--placeholder': !hasValue,\n }}\n >\n {hasValue ? displayText : this.placeholder}\n </span>\n <span class=\"hb-tree-select__suffix\">\n {hasValue && (\n <span class=\"hb-tree-select__clear\" onClick={this.handleClear}>\n ×\n </span>\n )}\n <span class={{ 'hb-tree-select__arrow-icon': true, 'hb-tree-select__arrow-icon--open': this.isOpen }}>▼</span>\n </span>\n </div>\n\n {this.isOpen && (\n <div class=\"hb-tree-select__dropdown\">\n {this.data.length === 0 ? (\n <div class=\"hb-tree-select__empty\">暂无数据</div>\n ) : (\n <ul class=\"hb-tree-select__tree\" role=\"tree\">\n {this.data.map((node) => this.renderNode(node, 0))}\n </ul>\n )}\n </div>\n )}\n </div>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TreeSelect.js","sourceRoot":"","sources":["../../../src/components/TreeSelect/TreeSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAGtE;;;GAGG;AAMH,MAAM,OAAO,UAAU;IACV,EAAE,CAAc;IAE3B;;OAEG;IACK,IAAI,GAAe,EAAE,CAAC;IAE9B;;OAEG;IACsB,UAAU,GAAsB,EAAE,CAAC;IAE5D;;;OAGG;IACK,QAAQ,GAAY,KAAK,CAAC;IAElC;;;OAGG;IACK,WAAW,GAAW,KAAK,CA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uB,+BAAW,CAC9C,CAAC,CAAC,CAAC,CACF,UAAI,KAAK,EAAC,sBAAsB,EAAC,IAAI,EAAC,MAAM,IACzC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAClE,CACN,CACG,CACP,CACG,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, Event, EventEmitter, State, Element } from '@stencil/core';\nimport { createClickOutsideHandler } from '../../utils/click-outside';\nimport type { TreeNode } from '../Tree/Tree';\n\n/**\n * TreeSelect 树形选择器\n * 类似 Select,但下拉选项以树形结构展示,支持单选与多选\n */\n@Component({\n tag: 'hb-tree-select',\n styleUrl: 'tree-select.css',\n shadow: true,\n})\nexport class TreeSelect {\n @Element() el: HTMLElement;\n\n /**\n * 可选项数据源(与 Tree 相同的递归树结构)\n */\n @Prop() data: TreeNode[] = [];\n\n /**\n * (受控)绑定值,单选为 string,多选为 string[]\n */\n @Prop({ mutable: true }) modelValue: string | string[] = '';\n\n /**\n * 是否多选\n * @default false\n */\n @Prop() multiple: boolean = false;\n\n /**\n * 占位文本\n * @default '请选择'\n */\n @Prop() placeholder: string = '请选择';\n\n /**\n * 是否禁用\n * @default false\n */\n @Prop() disabled: boolean = false;\n\n /**\n * 是否显示 checkbox(多选模式下推荐开启)\n * @default false\n */\n @Prop() checkable: boolean = false;\n\n /**\n * 是否默认展开全部节点\n * @default false\n */\n @Prop() defaultExpandAll: boolean = false;\n\n @State() isOpen: boolean = false;\n @State() internalExpanded: string[] = [];\n @State() internalSelected: string[] = [];\n @State() internalChecked: string[] = [];\n\n /**\n * 值变化事件(单选为 string,多选为 string[])\n */\n @Event() hbChange: EventEmitter<string | string[]>;\n\n /**\n * 下拉浮层显隐变化事件\n */\n @Event() hbVisibleChange: EventEmitter<boolean>;\n\n private clickOutside = createClickOutsideHandler({\n host: null as any,\n isOpen: () => this.isOpen,\n onClose: () => this.closeDropdown(),\n });\n\n componentWillLoad() {\n this.syncFromModelValue();\n if (this.defaultExpandAll) {\n const all: string[] = [];\n this.collectExpandableKeys(this.data, all);\n this.internalExpanded = all;\n }\n }\n\n componentDidLoad() {\n this.clickOutside = createClickOutsideHandler({\n host: this.el,\n isOpen: () => this.isOpen,\n onClose: () => this.closeDropdown(),\n });\n this.clickOutside.connect();\n }\n\n disconnectedCallback() {\n this.clickOutside.disconnect();\n }\n\n private syncFromModelValue() {\n if (this.multiple) {\n const arr = Array.isArray(this.modelValue) ? this.modelValue : [];\n this.internalSelected = [...arr];\n this.internalChecked = [...arr];\n } else {\n const single = typeof this.modelValue === 'string' ? this.modelValue : '';\n this.internalSelected = single ? [single] : [];\n this.internalChecked = single ? [single] : [];\n }\n }\n\n private collectExpandableKeys(nodes: TreeNode[], out: string[]) {\n for (const node of nodes) {\n if (node.children && node.children.length > 0) {\n out.push(node.key);\n this.collectExpandableKeys(node.children, out);\n }\n }\n }\n\n private findTitle(nodes: TreeNode[], key: string): string | null {\n for (const node of nodes) {\n if (node.key === key) return node.title;\n if (node.children) {\n const found = this.findTitle(node.children, key);\n if (found) return found;\n }\n }\n return null;\n }\n\n private getDisplayText(): string {\n if (this.multiple) {\n const arr = Array.isArray(this.modelValue) ? this.modelValue : [];\n if (arr.length === 0) return '';\n const titles = arr.map((k) => this.findTitle(this.data, k) || k);\n return titles.join(' / ');\n }\n const single = typeof this.modelValue === 'string' ? this.modelValue : '';\n return single ? this.findTitle(this.data, single) || single : '';\n }\n\n private openDropdown = () => {\n if (this.disabled || this.isOpen) return;\n this.isOpen = true;\n this.hbVisibleChange.emit(true);\n };\n\n private closeDropdown = () => {\n if (!this.isOpen) return;\n this.isOpen = false;\n this.hbVisibleChange.emit(false);\n };\n\n private toggleDropdown = () => {\n if (this.disabled) return;\n if (this.isOpen) this.closeDropdown();\n else this.openDropdown();\n };\n\n private handleNodeSelect = (key: string) => {\n if (this.multiple) {\n const current = [...this.internalSelected];\n const idx = current.indexOf(key);\n if (idx >= 0) current.splice(idx, 1);\n else current.push(key);\n this.internalSelected = current;\n this.modelValue = current;\n this.hbChange.emit(current);\n } else {\n this.internalSelected = [key];\n this.modelValue = key;\n this.hbChange.emit(key);\n this.closeDropdown();\n }\n };\n\n private handleNodeCheck = (node: TreeNode) => {\n // 父子联动(对齐 Tree 组件算法):勾选/取消自身 + 级联后代 + 自底向上修正祖先\n const next = new Set(this.internalChecked);\n const wasChecked = next.has(node.key);\n if (wasChecked) {\n this.removeDescendantKeys(node, next);\n next.delete(node.key);\n } else {\n next.add(node.key);\n this.collectCheckableDescendantKeys(node, next);\n }\n this.reconcileAncestors(node, next);\n const result = Array.from(next);\n this.internalChecked = result;\n this.modelValue = result;\n this.hbChange.emit(result);\n };\n\n /** 取消父级时级联取消所有后代(含禁用项,因为它们是被父带选的) */\n private removeDescendantKeys(node: TreeNode, out: Set<string>) {\n if (!node.children) return;\n for (const child of node.children) {\n out.delete(child.key);\n this.removeDescendantKeys(child, out);\n }\n }\n\n /** 勾选父级时级联勾选所有非禁用后代 */\n private collectCheckableDescendantKeys(node: TreeNode, out: Set<string>) {\n if (!node.children) return;\n for (const child of node.children) {\n if (!child.disabled) out.add(child.key);\n this.collectCheckableDescendantKeys(child, out);\n }\n }\n\n /** 自底向上修正祖先:所有非禁用子节点全选 → 父勾选;否则移出(部分选体现为 indeterminate) */\n private reconcileAncestors(node: TreeNode, next: Set<string>) {\n const parents = this.findAncestors(this.data, node.key, []);\n for (const parent of parents) {\n if (parent.disabled || !parent.children || parent.children.length === 0) continue;\n const checkable = parent.children.filter(c => !c.disabled);\n if (checkable.length === 0) continue;\n if (checkable.every(c => next.has(c.key))) next.add(parent.key);\n else next.delete(parent.key);\n }\n }\n\n private findAncestors(nodes: TreeNode[], key: string, acc: TreeNode[]): TreeNode[] | null {\n for (const node of nodes) {\n if (node.key === key) return acc;\n if (node.children && node.children.length > 0) {\n const found = this.findAncestors(node.children, key, [node, ...acc]);\n if (found) return found;\n }\n }\n return null;\n }\n\n /** 计算当前 checked 集合下处于「部分选中」的节点(用于三方态渲染) */\n private computeIndeterminateKeys(): Set<string> {\n const result = new Set<string>();\n const checked = new Set(this.internalChecked);\n const walk = (node: TreeNode): boolean => {\n if (!node.children || node.children.length === 0) return false;\n let hasChecked = false;\n for (const child of node.children) {\n if (walk(child)) hasChecked = true;\n if (checked.has(child.key)) hasChecked = true;\n }\n if (hasChecked && !checked.has(node.key)) result.add(node.key);\n return hasChecked;\n };\n for (const root of this.data) walk(root);\n return result;\n }\n\n private handleToggleExpand = (node: TreeNode, e: Event) => {\n e.stopPropagation();\n const current = [...this.internalExpanded];\n const idx = current.indexOf(node.key);\n if (idx >= 0) current.splice(idx, 1);\n else current.push(node.key);\n this.internalExpanded = current;\n };\n\n private handleClear = (e: Event) => {\n e.stopPropagation();\n if (this.disabled) return;\n this.internalSelected = [];\n this.internalChecked = [];\n this.modelValue = this.multiple ? [] : '';\n this.hbChange.emit(this.modelValue);\n };\n\n private renderNode = (node: TreeNode, level: number, indeterminateKeys: Set<string>): any => {\n const hasChildren = !!(node.children && node.children.length > 0);\n const expanded = this.internalExpanded.includes(node.key);\n const selected = this.internalSelected.includes(node.key);\n const checked = this.internalChecked.includes(node.key);\n const indeterminate = indeterminateKeys.has(node.key);\n const disabled = !!node.disabled;\n\n return (\n <li class={{ 'hb-tree-select__node': true, 'hb-tree-select__node--disabled': disabled }} role=\"treeitem\">\n <div\n class={{\n 'hb-tree-select__node-content': true,\n 'hb-tree-select__node-content--selected': selected,\n 'hb-tree-select__node-content--checked': checked,\n }}\n style={{ paddingLeft: `${level * 18 + 8}px` }}\n >\n <span class=\"hb-tree-select__switcher\" onClick={(e) => hasChildren && this.handleToggleExpand(node, e)}>\n {hasChildren ? (\n <span class={{ 'hb-tree-select__arrow': true, 'hb-tree-select__arrow--expanded': expanded }} aria-hidden=\"true\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width={2} stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M9 6l6 6-6 6\" />\n </svg>\n </span>\n ) : null}\n </span>\n\n {this.checkable && (\n <span\n class={{\n 'hb-tree-select__checkbox': true,\n 'hb-tree-select__checkbox--checked': checked,\n 'hb-tree-select__checkbox--indeterminate': indeterminate,\n 'hb-tree-select__checkbox--disabled': disabled,\n }}\n role=\"checkbox\"\n aria-checked={indeterminate ? 'mixed' : checked ? 'true' : 'false'}\n onClick={() => !disabled && this.handleNodeCheck(node)}\n >\n {checked ? (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width={3} stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M5 12l5 5L20 7\" />\n </svg>\n ) : indeterminate ? (\n <span class=\"hb-tree-select__checkbox-dash\" />\n ) : null}\n </span>\n )}\n\n <span class=\"hb-tree-select__title\" onClick={() => !disabled && this.handleNodeSelect(node.key)}>\n {node.title}\n </span>\n </div>\n\n {hasChildren && expanded && (\n <ul class=\"hb-tree-select__children\" role=\"group\">\n {node.children!.map((child) => this.renderNode(child, level + 1, indeterminateKeys))}\n </ul>\n )}\n </li>\n );\n };\n\n render() {\n const displayText = this.getDisplayText();\n const hasValue = this.multiple\n ? Array.isArray(this.modelValue) && this.modelValue.length > 0\n : typeof this.modelValue === 'string' && this.modelValue !== '';\n const indeterminateKeys = this.checkable ? this.computeIndeterminateKeys() : new Set<string>();\n\n return (\n <div\n class={{\n 'hb-tree-select': true,\n 'hb-tree-select--open': this.isOpen,\n 'hb-tree-select--disabled': this.disabled,\n 'hb-tree-select--multiple': this.multiple,\n }}\n >\n <div class=\"hb-tree-select__input-wrapper\" onClick={this.toggleDropdown}>\n <span\n class={{\n 'hb-tree-select__display': true,\n 'hb-tree-select__display--placeholder': !hasValue,\n }}\n >\n {hasValue ? displayText : this.placeholder}\n </span>\n <span class=\"hb-tree-select__suffix\">\n {hasValue && (\n <span class=\"hb-tree-select__clear\" onClick={this.handleClear} role=\"button\" aria-label=\"清空\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width={2} stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M6 6l12 12M18 6L6 18\" />\n </svg>\n </span>\n )}\n <span class={{ 'hb-tree-select__arrow-icon': true, 'hb-tree-select__arrow-icon--open': this.isOpen }} aria-hidden=\"true\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width={2} stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M6 9l6 6 6-6\" />\n </svg>\n </span>\n </span>\n </div>\n\n {this.isOpen && (\n <div class=\"hb-tree-select__dropdown\">\n {this.data.length === 0 ? (\n <div class=\"hb-tree-select__empty\">暂无数据</div>\n ) : (\n <ul class=\"hb-tree-select__tree\" role=\"tree\">\n {this.data.map((node) => this.renderNode(node, 0, indeterminateKeys))}\n </ul>\n )}\n </div>\n )}\n </div>\n );\n }\n}\n"]}
|
|
@@ -62,22 +62,35 @@
|
|
|
62
62
|
justify-content: center;
|
|
63
63
|
width: 16px;
|
|
64
64
|
height: 16px;
|
|
65
|
-
font-size: 12px;
|
|
66
65
|
border-radius: 50%;
|
|
67
66
|
color: var(--hb-color-text-tertiary);
|
|
68
67
|
background-color: var(--hb-color-fill);
|
|
69
68
|
cursor: pointer;
|
|
70
69
|
}
|
|
71
70
|
|
|
71
|
+
.hb-tree-select__clear svg {
|
|
72
|
+
width: 10px;
|
|
73
|
+
height: 10px;
|
|
74
|
+
}
|
|
75
|
+
|
|
72
76
|
.hb-tree-select__clear:hover {
|
|
73
77
|
color: var(--hb-color-text-secondary);
|
|
74
78
|
}
|
|
75
79
|
|
|
76
80
|
.hb-tree-select__arrow-icon {
|
|
77
|
-
|
|
81
|
+
display: inline-flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
width: 12px;
|
|
84
|
+
height: 12px;
|
|
85
|
+
color: var(--hb-color-text-tertiary);
|
|
78
86
|
transition: transform var(--hb-transition-duration, 0.2s);
|
|
79
87
|
}
|
|
80
88
|
|
|
89
|
+
.hb-tree-select__arrow-icon svg {
|
|
90
|
+
width: 100%;
|
|
91
|
+
height: 100%;
|
|
92
|
+
}
|
|
93
|
+
|
|
81
94
|
.hb-tree-select__arrow-icon--open {
|
|
82
95
|
transform: rotate(180deg);
|
|
83
96
|
}
|
|
@@ -163,11 +176,20 @@
|
|
|
163
176
|
}
|
|
164
177
|
|
|
165
178
|
.hb-tree-select__arrow {
|
|
166
|
-
|
|
167
|
-
|
|
179
|
+
display: inline-flex;
|
|
180
|
+
align-items: center;
|
|
181
|
+
justify-content: center;
|
|
182
|
+
width: 12px;
|
|
183
|
+
height: 12px;
|
|
184
|
+
color: var(--hb-color-text-tertiary);
|
|
168
185
|
transition: transform var(--hb-transition-duration, 0.2s);
|
|
169
186
|
}
|
|
170
187
|
|
|
188
|
+
.hb-tree-select__arrow svg {
|
|
189
|
+
width: 100%;
|
|
190
|
+
height: 100%;
|
|
191
|
+
}
|
|
192
|
+
|
|
171
193
|
.hb-tree-select__arrow--expanded {
|
|
172
194
|
transform: rotate(90deg);
|
|
173
195
|
}
|
|
@@ -182,17 +204,29 @@
|
|
|
182
204
|
border-radius: var(--hb-border-radius-xs, 2px);
|
|
183
205
|
background-color: var(--hb-color-bg-container);
|
|
184
206
|
color: #fff;
|
|
185
|
-
font-size: 11px;
|
|
186
|
-
line-height: 1;
|
|
187
207
|
flex-shrink: 0;
|
|
188
208
|
transition: all var(--hb-transition-duration, 0.2s);
|
|
189
209
|
}
|
|
190
210
|
|
|
211
|
+
.hb-tree-select__checkbox svg {
|
|
212
|
+
width: 12px;
|
|
213
|
+
height: 12px;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.hb-tree-select__checkbox-dash {
|
|
217
|
+
display: block;
|
|
218
|
+
width: 10px;
|
|
219
|
+
height: 2px;
|
|
220
|
+
background-color: #fff;
|
|
221
|
+
border-radius: 1px;
|
|
222
|
+
}
|
|
223
|
+
|
|
191
224
|
.hb-tree-select__checkbox:hover:not(.hb-tree-select__checkbox--disabled) {
|
|
192
225
|
border-color: var(--hb-color-primary);
|
|
193
226
|
}
|
|
194
227
|
|
|
195
|
-
.hb-tree-select__checkbox--checked
|
|
228
|
+
.hb-tree-select__checkbox--checked,
|
|
229
|
+
.hb-tree-select__checkbox--indeterminate {
|
|
196
230
|
background-color: var(--hb-color-primary);
|
|
197
231
|
border-color: var(--hb-color-primary);
|
|
198
232
|
}
|
|
@@ -153,14 +153,14 @@ export class Upload {
|
|
|
153
153
|
return null;
|
|
154
154
|
}
|
|
155
155
|
render() {
|
|
156
|
-
return (h("div", { key: '
|
|
156
|
+
return (h("div", { key: 'f3d7afc72dbdef70156bab23467daaf538a98221', class: "hb-upload" }, h("div", { key: '04bbe9db8bc37125022550e309a14644a245166e', class: {
|
|
157
157
|
'hb-upload__trigger': true,
|
|
158
158
|
'hb-upload__trigger--drag': this.drag,
|
|
159
159
|
'hb-upload__trigger--dragover': this.isDragover,
|
|
160
160
|
'hb-upload__trigger--disabled': this.disabled,
|
|
161
|
-
}, onClick: this.handleClick, onDrop: this.drag ? this.handleDrop : undefined, onDragOver: this.drag ? this.handleDragOver : undefined, onDragLeave: this.drag ? this.handleDragLeave : undefined }, this.drag ? h("span", null, "\u5C06\u6587\u4EF6\u62D6\u5230\u6B64\u5904\uFF0C\u6216\u70B9\u51FB\u4E0A\u4F20") : h("slot", null, h("button", { type: "button", class: "hb-upload__btn" }, "\u70B9\u51FB\u4E0A\u4F20"))), h("input", { key: '
|
|
161
|
+
}, onClick: this.handleClick, onDrop: this.drag ? this.handleDrop : undefined, onDragOver: this.drag ? this.handleDragOver : undefined, onDragLeave: this.drag ? this.handleDragLeave : undefined }, this.drag ? h("span", null, "\u5C06\u6587\u4EF6\u62D6\u5230\u6B64\u5904\uFF0C\u6216\u70B9\u51FB\u4E0A\u4F20") : h("slot", null, h("button", { type: "button", class: "hb-upload__btn" }, "\u70B9\u51FB\u4E0A\u4F20"))), h("input", { key: '01315d2df66505338104d01b675775e197806d39', type: "file", ref: (el) => {
|
|
162
162
|
this.inputRef = el;
|
|
163
|
-
}, multiple: this.multiple, accept: this.accept, disabled: this.disabled, style: { display: 'none' }, onChange: this.handleChange }), this.fileList.length > 0 && (h("ul", { key: '
|
|
163
|
+
}, multiple: this.multiple, accept: this.accept, disabled: this.disabled, style: { display: 'none' }, onChange: this.handleChange }), this.fileList.length > 0 && (h("ul", { key: '9d30b8fce405c1cbcec9b27ff8f819a0d2cfede4', class: "hb-upload__list" }, this.fileList.map((file, i) => (h("li", { class: { 'hb-upload__item': true, [`hb-upload__item--${file.status}`]: true } }, h("span", { class: "hb-upload__item-name" }, file.name), h("span", { class: "hb-upload__item-size" }, this.formatSize(file.size)), this.renderStatus(file), h("span", { class: "hb-upload__item-remove", onClick: () => this.handleRemove(i) }, "\u00D7"))))))));
|
|
164
164
|
}
|
|
165
165
|
static get is() { return "hb-upload"; }
|
|
166
166
|
static get encapsulation() { return "shadow"; }
|
|
@@ -42,7 +42,7 @@ export class Watermark {
|
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
render() {
|
|
45
|
-
return (h("div", { key: '
|
|
45
|
+
return (h("div", { key: 'f87f4534f042780b2d9845d2433aaca2089dd123', class: "hb-watermark" }, h("div", { key: '15da20909c1eff4f2d2aa2d582e3e575e38839df', class: "hb-watermark__content" }, h("slot", { key: '44db3f4ae92cd8f19ddfb4fbd79962fc71dad1d6' })), h("div", { key: '15c1b61915ab1e6429503f19e93cc7631221a03a', class: "hb-watermark__layer", style: this.layerStyle, "aria-hidden": "true" })));
|
|
46
46
|
}
|
|
47
47
|
static get is() { return "hb-watermark"; }
|
|
48
48
|
static get encapsulation() { return "shadow"; }
|
|
@@ -9,7 +9,7 @@ export function isSameDay(date1, date2) {
|
|
|
9
9
|
date1.getDate() === date2.getDate());
|
|
10
10
|
}
|
|
11
11
|
/** 生成 42 天(6 周)的日历网格数据 */
|
|
12
|
-
export function getCalendarDays(viewDate, selectedDate, today = new Date()) {
|
|
12
|
+
export function getCalendarDays(viewDate, selectedDate, today = new Date(), firstDayOfWeek = 0) {
|
|
13
13
|
const days = [];
|
|
14
14
|
const year = viewDate.getFullYear();
|
|
15
15
|
const month = viewDate.getMonth();
|
|
@@ -17,9 +17,13 @@ export function getCalendarDays(viewDate, selectedDate, today = new Date()) {
|
|
|
17
17
|
const lastDay = new Date(year, month + 1, 0);
|
|
18
18
|
const firstDayWeek = firstDay.getDay();
|
|
19
19
|
const daysInMonth = lastDay.getDate();
|
|
20
|
+
// 按 firstDayOfWeek 计算需要补多少上月天数。
|
|
21
|
+
// 默认 firstDayOfWeek=0(周日为首列)时,offset = firstDayWeek;
|
|
22
|
+
// firstDayOfWeek=1(周一为首列)时,周日的 offset 多 1、周一的 offset 为 0。
|
|
23
|
+
const offset = ((firstDayWeek - firstDayOfWeek) + 7) % 7;
|
|
20
24
|
// 上月填充
|
|
21
25
|
const prevMonth = new Date(year, month - 1, 0);
|
|
22
|
-
for (let i =
|
|
26
|
+
for (let i = offset - 1; i >= 0; i--) {
|
|
23
27
|
const date = new Date(year, month - 1, prevMonth.getDate() - i);
|
|
24
28
|
days.push({
|
|
25
29
|
date,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-helpers.js","sourceRoot":"","sources":["../../src/utils/date-helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,mBAAmB;AACnB,MAAM,UAAU,SAAS,CAAC,KAAW,EAAE,KAAW;IAChD,OAAO,CACL,KAAK,CAAC,WAAW,EAAE,KAA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,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5B,MAAM,CAAC,GAAG,UAAU,GAAG,CAAC,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC;YACT,IAAI,EAAE,CAAC;YACP,kBAAkB,EAAE,CAAC,KAAK,IAAI;YAC9B,UAAU,EAAE,CAAC,CAAC,YAAY,IAAI,YAAY,CAAC,WAAW,EAAE,KAAK,CAAC;SAC/D,CAAC,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,+BAA+B;AAC/B,MAAM,UAAU,iBAAiB,CAAC,QAAc;IAC9C,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IACpC,OAAO,IAAI,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;AAC5B,CAAC;AAED,aAAa;AACb,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAClC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK;CACrC,CAAC;AAEF,aAAa;AACb,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC","sourcesContent":["/**\n * 日历和日期工具函数\n * 从 DatePicker / DateTimePicker / DatePickerPane 中提取的共享逻辑\n */\n\nexport interface CalendarDay {\n date: Date;\n isCurrentMonth: boolean;\n isToday: boolean;\n isSelected: boolean;\n}\n\n/** 判断两个日期是否为同一天 */\nexport function isSameDay(date1: Date, date2: Date): boolean {\n return (\n date1.getFullYear() === date2.getFullYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate()\n );\n}\n\n/** 生成 42 天(6 周)的日历网格数据 */\nexport function getCalendarDays(\n viewDate: Date,\n selectedDate?: Date,\n today: Date = new Date(),\n firstDayOfWeek: number = 0\n): CalendarDay[] {\n const days: CalendarDay[] = [];\n const year = viewDate.getFullYear();\n const month = viewDate.getMonth();\n\n const firstDay = new Date(year, month, 1);\n const lastDay = new Date(year, month + 1, 0);\n const firstDayWeek = firstDay.getDay();\n const daysInMonth = lastDay.getDate();\n\n // 按 firstDayOfWeek 计算需要补多少上月天数。\n // 默认 firstDayOfWeek=0(周日为首列)时,offset = firstDayWeek;\n // firstDayOfWeek=1(周一为首列)时,周日的 offset 多 1、周一的 offset 为 0。\n const offset = ((firstDayWeek - firstDayOfWeek) + 7) % 7;\n\n // 上月填充\n const prevMonth = new Date(year, month - 1, 0);\n for (let i = offset - 1; i >= 0; i--) {\n const date = new Date(year, month - 1, prevMonth.getDate() - i);\n days.push({\n date,\n isCurrentMonth: false,\n isToday: isSameDay(date, today),\n isSelected: !!selectedDate && isSameDay(date, selectedDate),\n });\n }\n\n // 当月日期\n for (let i = 1; i <= daysInMonth; i++) {\n const date = new Date(year, month, i);\n days.push({\n date,\n isCurrentMonth: true,\n isToday: isSameDay(date, today),\n isSelected: !!selectedDate && isSameDay(date, selectedDate),\n });\n }\n\n // 下月填充(补齐 42 天)\n const remainingDays = 42 - days.length;\n for (let i = 1; i <= remainingDays; i++) {\n const date = new Date(year, month + 1, i);\n days.push({\n date,\n isCurrentMonth: false,\n isToday: isSameDay(date, today),\n isSelected: !!selectedDate && isSameDay(date, selectedDate),\n });\n }\n\n return days;\n}\n\n/**\n * 格式化日期为指定格式字符串\n * 支持:YYYY, MM, DD, HH, mm, ss\n */\nexport function formatDate(date: Date, format: string): string {\n const year = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const day = String(date.getDate()).padStart(2, '0');\n const hours = String(date.getHours()).padStart(2, '0');\n const minutes = String(date.getMinutes()).padStart(2, '0');\n const seconds = String(date.getSeconds()).padStart(2, '0');\n\n return format\n .replace('YYYY', String(year))\n .replace('MM', month)\n .replace('DD', day)\n .replace('HH', hours)\n .replace('mm', minutes)\n .replace('ss', seconds);\n}\n\n/** 安全解析日期值 */\nexport function parseDate(value: string | Date | undefined): Date | undefined {\n if (!value) return undefined;\n const date = value instanceof Date ? value : new Date(value);\n if (isNaN(date.getTime())) return undefined;\n return date;\n}\n\n/** 月份偏移,返回新日期对象(不可变) */\nexport function addMonths(date: Date, delta: number): Date {\n const result = new Date(date);\n result.setMonth(result.getMonth() + delta);\n return result;\n}\n\n/** 年份偏移,返回新日期对象(不可变) */\nexport function addYears(date: Date, delta: number): Date {\n const result = new Date(date);\n result.setFullYear(result.getFullYear() + delta);\n return result;\n}\n\n/**\n * 生成 years 视图的 12 年档数据(每档 12 年)。\n * 以 viewDate 所在年份向下取整到 12 的倍数作为起点。\n */\nexport interface CalendarYear {\n year: number;\n isCurrentYearRange: boolean;\n isSelected: boolean;\n}\n\nexport function getCalendarYears(\n viewDate: Date,\n selectedDate?: Date,\n startYearBase?: number\n): CalendarYear[] {\n const year = viewDate.getFullYear();\n const rangeStart = startYearBase ?? year - (year % 12);\n const years: CalendarYear[] = [];\n for (let i = 0; i < 12; i++) {\n const y = rangeStart + i;\n years.push({\n year: y,\n isCurrentYearRange: y === year,\n isSelected: !!selectedDate && selectedDate.getFullYear() === y,\n });\n }\n return years;\n}\n\n/** 获取 years 视图标题所显示的年份档区间起点 */\nexport function getYearRangeStart(viewDate: Date): number {\n const year = viewDate.getFullYear();\n return year - (year % 12);\n}\n\n/** 中文月份名称 */\nexport const MONTH_NAMES = [\n '一月', '二月', '三月', '四月', '五月', '六月',\n '七月', '八月', '九月', '十月', '十一月', '十二月',\n];\n\n/** 中文星期名称 */\nexport const WEEK_DAY_NAMES = ['日', '一', '二', '三', '四', '五', '六'];\n"]}
|
|
@@ -89,7 +89,7 @@ const Affix = /*@__PURE__*/ proxyCustomElement(class Affix extends H {
|
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
render() {
|
|
92
|
-
return (h("div", { key: '
|
|
92
|
+
return (h("div", { key: '374ccf4d24df0d0e4ca4dd35b915a34a39669056', class: { 'hb-affix': true, 'hb-affix--fixed': this.affixed }, style: this.affixed ? this.fixedStyle : undefined }, h("slot", { key: '5f7c0c1341c274663846cc6d4264129415c6fffc' })));
|
|
93
93
|
}
|
|
94
94
|
static get style() { return HbAffixStyle0; }
|
|
95
95
|
}, [1, "hb-affix", {
|
|
@@ -18,7 +18,7 @@ const Aside = /*@__PURE__*/ proxyCustomElement(class Aside extends H {
|
|
|
18
18
|
if (this.width) {
|
|
19
19
|
style.width = this.width;
|
|
20
20
|
}
|
|
21
|
-
return (h("aside", { key: '
|
|
21
|
+
return (h("aside", { key: '2615bba7300b1d86fa82a1618718e07479f41348', class: "hb-aside", style: style }, h("slot", { key: 'dd4ad7e905f2ea8c72bc4d70c82ab0a13bed5e0f' })));
|
|
22
22
|
}
|
|
23
23
|
static get style() { return HbAsideStyle0; }
|
|
24
24
|
}, [1, "hb-aside", {
|
|
@@ -19,7 +19,7 @@ const Avatar = /*@__PURE__*/ proxyCustomElement(class Avatar extends H {
|
|
|
19
19
|
return typeof this.size === 'number' ? `${this.size}px` : map[this.size];
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
return (h("span", { key: '
|
|
22
|
+
return (h("span", { key: '41fda719b0c3d2ca0a562a0b4ff98e3705cac0c0', class: { 'hb-avatar': true, [`hb-avatar--${this.shape}`]: true }, style: { width: this.sizePx, height: this.sizePx, fontSize: `calc(${this.sizePx} * 0.45)` } }, this.src ? h("img", { src: this.src, alt: this.alt }) : this.icon ? h("span", null, this.icon) : h("slot", null)));
|
|
23
23
|
}
|
|
24
24
|
static get style() { return HbAvatarStyle0; }
|
|
25
25
|
}, [1, "hb-avatar", {
|
|
@@ -83,12 +83,12 @@ const Backtop = /*@__PURE__*/ proxyCustomElement(class Backtop extends H {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
render() {
|
|
86
|
-
return (h(Host, { key: '
|
|
86
|
+
return (h(Host, { key: '5406d83477f015dc770e46c3e495a5c036effa61', class: { 'hb-backtop': true, 'hb-backtop--hidden': !this.visible }, style: {
|
|
87
87
|
right: `${this.right}px`,
|
|
88
88
|
bottom: `${this.bottom}px`,
|
|
89
89
|
visibility: this.visible ? 'visible' : 'hidden',
|
|
90
90
|
opacity: this.visible ? '1' : '0',
|
|
91
|
-
} }, h("div", { key: '
|
|
91
|
+
} }, h("div", { key: 'dd75722c174dc48fd77ca0342955745a8e233f98', class: "hb-backtop__inner", onClick: this.scrollToTop }, h("slot", { key: '7dda375453258d76e61720d5689cbe79dd564046' }, h("span", { key: '96bf90719eff982610a4bcd44367c2250ebedfd4', class: "hb-backtop__icon" }, "\u2191")))));
|
|
92
92
|
}
|
|
93
93
|
static get style() { return HbBacktopStyle0; }
|
|
94
94
|
}, [1, "hb-backtop", {
|
|
@@ -23,7 +23,7 @@ const Badge = /*@__PURE__*/ proxyCustomElement(class Badge extends H {
|
|
|
23
23
|
return String(this.value);
|
|
24
24
|
}
|
|
25
25
|
render() {
|
|
26
|
-
return (h("div", { key: '
|
|
26
|
+
return (h("div", { key: 'f8c6ce8c0c83e0a6332f305c4e1d83e42f0ed8da', class: "hb-badge" }, h("slot", { key: 'c7a52c406aaa545972888f4761b0e8637e5a76f9' }), !this.hidden && (h("sup", { key: '9786f19cb8fc171d7265b0d14624e51d6b72a250', class: { 'hb-badge__content': true, [`hb-badge__content--${this.type}`]: true, 'hb-badge__content--dot': this.isDot } }, this.displayValue))));
|
|
27
27
|
}
|
|
28
28
|
static get style() { return HbBadgeStyle0; }
|
|
29
29
|
}, [1, "hb-badge", {
|
|
@@ -14,7 +14,7 @@ const BreadcrumbItem = /*@__PURE__*/ proxyCustomElement(class BreadcrumbItem ext
|
|
|
14
14
|
// 从父级 hb-breadcrumb 读取分隔符 prop
|
|
15
15
|
// 优先级:item 的 separator slot > breadcrumb.separator > 默认 '/'
|
|
16
16
|
const parentSeparator = this.el.closest('hb-breadcrumb')?.separator;
|
|
17
|
-
return (h("span", { key: '
|
|
17
|
+
return (h("span", { key: '181c8e289f83b6a95445bee02ae0e6405a3ac7c7', class: "hb-breadcrumb-item" }, h(Tag, { key: 'af828de3d06e5a41c52b23b874d0b211a44e4169', class: "hb-breadcrumb-item__inner", href: this.href }, h("slot", { key: '0c4b87ea5809acd5e2b2d53f59011a32fae8d370' })), h("span", { key: '106653462a241dcc2a64556b4a5bae60a548d766', class: "hb-breadcrumb-item__separator" }, h("slot", { key: '905f0e3fffa0a2d7452065f95f33c39c4c3382b8', name: "separator" }, parentSeparator ?? '/'))));
|
|
18
18
|
}
|
|
19
19
|
}, [1, "hb-breadcrumb-item", {
|
|
20
20
|
"href": [1]
|
|
@@ -12,7 +12,7 @@ const Breadcrumb = /*@__PURE__*/ proxyCustomElement(class Breadcrumb extends H {
|
|
|
12
12
|
/** 分隔符 */
|
|
13
13
|
separator = '/';
|
|
14
14
|
render() {
|
|
15
|
-
return (h("nav", { key: '
|
|
15
|
+
return (h("nav", { key: '404e3b9cb740956fa8e3f12ca91efec1d3d0a03b', class: "hb-breadcrumb", "aria-label": "Breadcrumb" }, h("slot", { key: '8fac787347489530954f2edbe79dab5d05ce7ef4' })));
|
|
16
16
|
}
|
|
17
17
|
static get style() { return HbBreadcrumbStyle0; }
|
|
18
18
|
}, [1, "hb-breadcrumb", {
|
|
@@ -20,14 +20,14 @@ const Button = /*@__PURE__*/ proxyCustomElement(class Button extends H {
|
|
|
20
20
|
/** 是否加载中 */
|
|
21
21
|
loading = false;
|
|
22
22
|
render() {
|
|
23
|
-
return (h("button", { key: '
|
|
23
|
+
return (h("button", { key: '77ba452cfa960b02e746b2494aa1f471a85d33fd', disabled: this.disabled || this.loading, class: {
|
|
24
24
|
'hb-button': true,
|
|
25
25
|
[`hb-button--${this.type}`]: true,
|
|
26
26
|
[`hb-button--${this.size}`]: true,
|
|
27
27
|
'hb-button--disabled': this.disabled,
|
|
28
28
|
'hb-button--loading': this.loading,
|
|
29
29
|
[this.classNames]: !!this.classNames,
|
|
30
|
-
} }, this.loading && h("span", { key: '
|
|
30
|
+
} }, this.loading && h("span", { key: '152d4a7657ba8399554782c7abd38a6c5b26de17', class: "hb-button__loading-icon" }, "\u23F3"), h("slot", { key: '9381db3ab788d9bfe73c8b29d422642d1a8eacbc' })));
|
|
31
31
|
}
|
|
32
32
|
static get style() { return HbButtonStyle0; }
|
|
33
33
|
}, [1, "hb-button", {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h } from './p-1407a5e8.js';
|
|
2
|
-
import { p as parseDate, a as addMonths, W as WEEK_DAY_NAMES, g as getCalendarDays, M as MONTH_NAMES } from './p-
|
|
2
|
+
import { p as parseDate, a as addMonths, W as WEEK_DAY_NAMES, g as getCalendarDays, i as isSameDay, M as MONTH_NAMES } from './p-08b4005c.js';
|
|
3
3
|
|
|
4
|
-
const calendarCss = "/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{appearance:button;background-color:#0000;border:0 solid;border-radius:0;box-sizing:border-box;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;margin:0;margin-inline-end:4px;opacity:1;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);line-height:1.5;tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex;padding-block:0}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}} /*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{}@layer base{}@layer components;:host{display:block}.hb-calendar{background-color:var(--hb-color-white,#fff);border-radius:4px;box-sizing:border-box;padding:12px;width:100%}.hb-calendar__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:12px}.hb-calendar__header-label{color:var(--hb-color-text-regular,#606266);font-size:14px;font-weight:600}.hb-calendar__next-btn,.hb-calendar__prev-btn{background:0 0;border:none;color:var(--hb-color-text-regular,#606266);cursor:pointer;font-size:18px;line-height:1;padding:4px 8px;transition:color .2s}.hb-calendar__next-btn:hover,.hb-calendar__prev-btn:hover{color:var(--hb-color-primary)}.hb-calendar__weekdays{display:grid;gap:4px;grid-template-columns:repeat(7,1fr);margin-bottom:8px}.hb-calendar__weekday{color:var(--hb-color-text-placeholder,#c0c4cc);font-size:12px;font-weight:500;padding:4px 0;text-align:center}.hb-calendar__days{display:grid;gap:4px;grid-template-columns:repeat(7,1fr)}.hb-calendar__day{align-items:center;aspect-ratio:1;border-radius:4px;color:var(--hb-color-text-regular,#606266);cursor:pointer;display:flex;font-size:13px;justify-content:center;transition:all .2s;-webkit-user-select:none;user-select:none}.hb-calendar__day:hover:not(.hb-calendar__day--other-month){background-color:var(--hb-fill-color-light,#f5f7fa)}.hb-calendar__day--other-month{color:var(--hb-color-text-placeholder,#c0c4cc);cursor:default}.hb-calendar__day--today{color:var(--hb-color-primary);font-weight:600}.hb-calendar__day--selected{color:var(--hb-color-white,#fff)}.hb-calendar__day--selected,.hb-calendar__day--selected:hover{background-color:var(--hb-color-primary)}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}";
|
|
4
|
+
const calendarCss = "/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{appearance:button;background-color:#0000;border:0 solid;border-radius:0;box-sizing:border-box;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;margin:0;margin-inline-end:4px;opacity:1;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);line-height:1.5;tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex;padding-block:0}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.grid{display:grid}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}} /*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{}@layer base{}@layer components;:host{display:block}.hb-calendar{background-color:var(--hb-color-white,#fff);border-radius:4px;box-sizing:border-box;padding:12px;width:100%}.hb-calendar__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:12px}.hb-calendar__header-label{color:var(--hb-color-text-regular,#606266);font-size:14px;font-weight:600}.hb-calendar__next-btn,.hb-calendar__prev-btn{background:0 0;border:none;color:var(--hb-color-text-regular,#606266);cursor:pointer;font-size:18px;line-height:1;padding:4px 8px;transition:color .2s}.hb-calendar__next-btn:hover,.hb-calendar__prev-btn:hover{color:var(--hb-color-primary)}.hb-calendar__weekdays{display:grid;gap:4px;grid-template-columns:repeat(7,1fr);margin-bottom:8px}.hb-calendar__weekday{color:var(--hb-color-text-placeholder,#c0c4cc);font-size:12px;font-weight:500;padding:4px 0;text-align:center}.hb-calendar__days{display:grid;gap:4px;grid-template-columns:repeat(7,1fr)}.hb-calendar__day{align-items:center;aspect-ratio:1;border-radius:4px;color:var(--hb-color-text-regular,#606266);cursor:pointer;display:flex;font-size:13px;justify-content:center;transition:all .2s;-webkit-user-select:none;user-select:none}.hb-calendar__day:hover:not(.hb-calendar__day--other-month){background-color:var(--hb-fill-color-light,#f5f7fa)}.hb-calendar__day--other-month{color:var(--hb-color-text-placeholder,#c0c4cc);cursor:default}.hb-calendar__day--today{color:var(--hb-color-primary);font-weight:600}.hb-calendar__day--selected{color:var(--hb-color-white,#fff)}.hb-calendar__day--selected,.hb-calendar__day--selected:hover{background-color:var(--hb-color-primary)}.hb-calendar__day--focused{outline:2px solid var(--hb-color-primary,#1677ff);outline-offset:-2px}.hb-calendar__day--disabled{color:var(--hb-color-text-disabled,#c0c4cc);cursor:not-allowed;opacity:.5}.hb-calendar__day--disabled:hover{background-color:#0000}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}";
|
|
5
5
|
const HbCalendarStyle0 = calendarCss;
|
|
6
6
|
|
|
7
7
|
const Calendar = /*@__PURE__*/ proxyCustomElement(class Calendar extends H {
|
|
@@ -30,6 +30,8 @@ const Calendar = /*@__PURE__*/ proxyCustomElement(class Calendar extends H {
|
|
|
30
30
|
hbChange;
|
|
31
31
|
viewDate = new Date();
|
|
32
32
|
selectedDate;
|
|
33
|
+
/** 键盘导航的焦点日期(用于 role=gridcell 的 roving tabindex) */
|
|
34
|
+
focusDate = new Date();
|
|
33
35
|
componentDidLoad() {
|
|
34
36
|
this.initFromModelValue();
|
|
35
37
|
}
|
|
@@ -41,6 +43,11 @@ const Calendar = /*@__PURE__*/ proxyCustomElement(class Calendar extends H {
|
|
|
41
43
|
this.selectedDate = parsed;
|
|
42
44
|
if (parsed) {
|
|
43
45
|
this.viewDate = new Date(parsed.getFullYear(), parsed.getMonth(), 1);
|
|
46
|
+
this.focusDate = new Date(parsed);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
// 无选中值时焦点默认到今天
|
|
50
|
+
this.focusDate = new Date();
|
|
44
51
|
}
|
|
45
52
|
}
|
|
46
53
|
handleSelect = (day) => {
|
|
@@ -49,10 +56,65 @@ const Calendar = /*@__PURE__*/ proxyCustomElement(class Calendar extends H {
|
|
|
49
56
|
if (this.disabledDate && this.disabledDate(day.date))
|
|
50
57
|
return;
|
|
51
58
|
this.selectedDate = day.date;
|
|
59
|
+
this.focusDate = new Date(day.date);
|
|
52
60
|
const iso = this.toISODate(day.date);
|
|
53
61
|
this.modelValue = iso;
|
|
54
62
|
this.hbChange.emit(iso);
|
|
55
63
|
};
|
|
64
|
+
/**
|
|
65
|
+
* 日期网格键盘导航(对齐 WAI-ARIA grid / antd Calendar):
|
|
66
|
+
* - ArrowRight/Left:±1 天
|
|
67
|
+
* - ArrowDown/Up:±7 天
|
|
68
|
+
* - Home/End:当周首/末日
|
|
69
|
+
* - PageDown/Up:±1 月
|
|
70
|
+
* - Enter:选中焦点日
|
|
71
|
+
* 焦点日跨月时同步滚动 viewDate。
|
|
72
|
+
*/
|
|
73
|
+
handleGridKeydown = (e) => {
|
|
74
|
+
const next = new Date(this.focusDate);
|
|
75
|
+
switch (e.key) {
|
|
76
|
+
case 'ArrowRight':
|
|
77
|
+
next.setDate(next.getDate() + 1);
|
|
78
|
+
break;
|
|
79
|
+
case 'ArrowLeft':
|
|
80
|
+
next.setDate(next.getDate() - 1);
|
|
81
|
+
break;
|
|
82
|
+
case 'ArrowDown':
|
|
83
|
+
next.setDate(next.getDate() + 7);
|
|
84
|
+
break;
|
|
85
|
+
case 'ArrowUp':
|
|
86
|
+
next.setDate(next.getDate() - 7);
|
|
87
|
+
break;
|
|
88
|
+
case 'Home': {
|
|
89
|
+
const d = next.getDay();
|
|
90
|
+
next.setDate(next.getDate() - d);
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
case 'End': {
|
|
94
|
+
const d = 6 - next.getDay();
|
|
95
|
+
next.setDate(next.getDate() + d);
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
case 'PageDown':
|
|
99
|
+
next.setMonth(next.getMonth() + 1);
|
|
100
|
+
break;
|
|
101
|
+
case 'PageUp':
|
|
102
|
+
next.setMonth(next.getMonth() - 1);
|
|
103
|
+
break;
|
|
104
|
+
case 'Enter':
|
|
105
|
+
e.preventDefault();
|
|
106
|
+
this.handleSelect({ date: this.focusDate, isCurrentMonth: true });
|
|
107
|
+
return;
|
|
108
|
+
default:
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
e.preventDefault();
|
|
112
|
+
// 焦点跨月:viewDate 跟随(PageUp/Down 或方向键滑出)
|
|
113
|
+
if (next.getMonth() !== this.viewDate.getMonth() || next.getFullYear() !== this.viewDate.getFullYear()) {
|
|
114
|
+
this.viewDate = new Date(next.getFullYear(), next.getMonth(), 1);
|
|
115
|
+
}
|
|
116
|
+
this.focusDate = next;
|
|
117
|
+
};
|
|
56
118
|
toISODate(date) {
|
|
57
119
|
const y = date.getFullYear();
|
|
58
120
|
const m = String(date.getMonth() + 1).padStart(2, '0');
|
|
@@ -62,20 +124,26 @@ const Calendar = /*@__PURE__*/ proxyCustomElement(class Calendar extends H {
|
|
|
62
124
|
changeMonth(delta) {
|
|
63
125
|
this.viewDate = addMonths(this.viewDate, delta);
|
|
64
126
|
}
|
|
65
|
-
/** 按 firstDayOfWeek
|
|
127
|
+
/** 按 firstDayOfWeek 重排星期标题;getCalendarDays 也按同一 firstDayOfWeek 对齐网格 */
|
|
66
128
|
get orderedWeekNames() {
|
|
67
129
|
const offset = ((this.firstDayOfWeek % 7) + 7) % 7;
|
|
68
130
|
return [...WEEK_DAY_NAMES.slice(offset), ...WEEK_DAY_NAMES.slice(0, offset)];
|
|
69
131
|
}
|
|
70
132
|
render() {
|
|
71
|
-
const days = getCalendarDays(this.viewDate, this.selectedDate);
|
|
133
|
+
const days = getCalendarDays(this.viewDate, this.selectedDate, new Date(), this.firstDayOfWeek);
|
|
72
134
|
const current = this.viewDate;
|
|
73
|
-
return (h("div", { key: '
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
135
|
+
return (h("div", { key: '9c18ef6f549973316bcfe0343290e442f72dfdb8', class: "hb-calendar" }, h("div", { key: 'ab177ab7cd14aec0c52a3806ed098e7abc245283', class: "hb-calendar__header" }, h("button", { key: '5e7c773130c63479f806c33a085e5a82ba5c2fe7', type: "button", class: "hb-calendar__prev-btn", onClick: () => this.changeMonth(-1), "aria-label": "\u4E0A\u4E00\u6708" }, "\u2039"), h("span", { key: 'bfcd78f5119f461878e7a8c8fbfc260e97b58458', class: "hb-calendar__header-label", "aria-live": "polite" }, current.getFullYear(), "\u5E74 ", MONTH_NAMES[current.getMonth()]), h("button", { key: '4eb5cf7d57c0288f895b35b889bd5016b8c78075', type: "button", class: "hb-calendar__next-btn", onClick: () => this.changeMonth(1), "aria-label": "\u4E0B\u4E00\u6708" }, "\u203A")), h("div", { key: '2b643cc4f0a121c349018e502745212adae5dfe9', class: "hb-calendar__body", role: "grid", "aria-label": `${current.getFullYear()}年${current.getMonth() + 1}月日历` }, h("div", { key: '546e2f58e40732ee2cc270152d4e69bb044fdef6', class: "hb-calendar__weekdays", role: "row" }, this.orderedWeekNames.map((day) => (h("div", { class: "hb-calendar__weekday", role: "columnheader", "aria-disabled": "true" }, day)))), h("div", { key: '36178be8edbf59348396b7355066f45aa1adcc81', class: "hb-calendar__days", role: "row", onKeyDown: this.handleGridKeydown }, days.map((day, index) => {
|
|
136
|
+
const isFocused = isSameDay(day.date, this.focusDate);
|
|
137
|
+
const dayDisabled = day.isCurrentMonth && !!this.disabledDate && this.disabledDate(day.date);
|
|
138
|
+
return (h("div", { key: index, class: {
|
|
139
|
+
'hb-calendar__day': true,
|
|
140
|
+
'hb-calendar__day--other-month': !day.isCurrentMonth,
|
|
141
|
+
'hb-calendar__day--today': day.isToday,
|
|
142
|
+
'hb-calendar__day--selected': day.isSelected,
|
|
143
|
+
'hb-calendar__day--focused': isFocused,
|
|
144
|
+
'hb-calendar__day--disabled': dayDisabled,
|
|
145
|
+
}, role: "gridcell", tabindex: isFocused ? 0 : -1, "aria-selected": day.isSelected ? 'true' : 'false', "aria-current": day.isToday ? 'date' : undefined, "aria-disabled": !day.isCurrentMonth || dayDisabled ? 'true' : undefined, "aria-label": this.toISODate(day.date), onClick: () => this.handleSelect(day) }, day.date.getDate()));
|
|
146
|
+
})))));
|
|
79
147
|
}
|
|
80
148
|
static get watchers() { return {
|
|
81
149
|
"modelValue": ["handleModelValueChange"]
|
|
@@ -86,7 +154,8 @@ const Calendar = /*@__PURE__*/ proxyCustomElement(class Calendar extends H {
|
|
|
86
154
|
"firstDayOfWeek": [2, "first-day-of-week"],
|
|
87
155
|
"disabledDate": [16],
|
|
88
156
|
"viewDate": [32],
|
|
89
|
-
"selectedDate": [32]
|
|
157
|
+
"selectedDate": [32],
|
|
158
|
+
"focusDate": [32]
|
|
90
159
|
}, undefined, {
|
|
91
160
|
"modelValue": ["handleModelValueChange"]
|
|
92
161
|
}]);
|