huibo-ui 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{a11y-802de67a.js → a11y-4385c871.js} +17 -2
- package/dist/cjs/a11y-4385c871.js.map +1 -0
- package/dist/cjs/{date-helpers-904747ff.js → date-helpers-c05ef385.js} +10 -17
- package/dist/cjs/date-helpers-c05ef385.js.map +1 -0
- package/dist/cjs/hb-affix.cjs.entry.js +1 -1
- package/dist/cjs/hb-alert.cjs.entry.js +2 -1
- package/dist/cjs/hb-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-aside.cjs.entry.js +1 -1
- package/dist/cjs/hb-avatar.cjs.entry.js +1 -1
- package/dist/cjs/hb-backtop.cjs.entry.js +2 -2
- package/dist/cjs/hb-badge.cjs.entry.js +1 -1
- package/dist/cjs/hb-breadcrumb-item.cjs.entry.js +1 -1
- package/dist/cjs/hb-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/hb-button.cjs.entry.js +2 -2
- package/dist/cjs/hb-calendar.cjs.entry.js +78 -10
- package/dist/cjs/hb-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-card.cjs.entry.js +1 -1
- package/dist/cjs/hb-cascader.cjs.entry.js +306 -146
- package/dist/cjs/hb-cascader.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-checkbox-group.cjs.entry.js +12 -8
- package/dist/cjs/hb-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-checkbox.cjs.entry.js +9 -4
- package/dist/cjs/hb-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-collapse-item.cjs.entry.js +13 -4
- package/dist/cjs/hb-collapse-item.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-collapse.cjs.entry.js +20 -15
- package/dist/cjs/hb-collapse.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-color-picker-panel.cjs.entry.js +2 -2
- package/dist/cjs/hb-color-picker.cjs.entry.js +108 -28
- package/dist/cjs/hb-color-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-config-provider.cjs.entry.js +1 -1
- package/dist/cjs/hb-container.cjs.entry.js +2 -2
- package/dist/cjs/hb-date-picker-pane.cjs.entry.js +2 -2
- package/dist/cjs/hb-date-picker.cjs.entry.js +90 -9
- package/dist/cjs/hb-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-date-range-picker.cjs.entry.js +3 -3
- package/dist/cjs/hb-date-time-picker.cjs.entry.js +3 -3
- package/dist/cjs/hb-descriptions.cjs.entry.js +2 -2
- package/dist/cjs/hb-descriptions.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-dialog.cjs.entry.js +51 -12
- package/dist/cjs/hb-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-divider.cjs.entry.js +2 -2
- package/dist/cjs/hb-drawer.cjs.entry.js +34 -4
- package/dist/cjs/hb-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-dropdown.cjs.entry.js +91 -11
- package/dist/cjs/hb-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-empty.cjs.entry.js +1 -1
- package/dist/cjs/hb-float-button.cjs.entry.js +2 -2
- package/dist/cjs/hb-footer.cjs.entry.js +1 -1
- package/dist/cjs/hb-form-item.cjs.entry.js +61 -9
- package/dist/cjs/hb-form-item.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-form.cjs.entry.js +13 -8
- package/dist/cjs/hb-form.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-header.cjs.entry.js +1 -1
- package/dist/cjs/hb-image-preview.cjs.entry.js +13 -9
- package/dist/cjs/hb-image-preview.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-image.cjs.entry.js +21 -3
- package/dist/cjs/hb-image.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-input-number.cjs.entry.js +7 -7
- package/dist/cjs/hb-input-number.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-input-tag.cjs.entry.js +2 -2
- package/dist/cjs/hb-input.cjs.entry.js +40 -3
- package/dist/cjs/hb-input.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-layout.cjs.entry.js +36 -14
- package/dist/cjs/hb-layout.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-link.cjs.entry.js +2 -2
- package/dist/cjs/hb-loading.cjs.entry.js +2 -2
- package/dist/cjs/hb-main.cjs.entry.js +1 -1
- package/dist/cjs/hb-menu-item.cjs.entry.js +14 -5
- package/dist/cjs/hb-menu-item.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-menu.cjs.entry.js +3 -3
- package/dist/cjs/hb-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-message.cjs.entry.js +13 -4
- package/dist/cjs/hb-message.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-notification.cjs.entry.js +2 -2
- package/dist/cjs/hb-page-header.cjs.entry.js +1 -1
- package/dist/cjs/hb-pagination.cjs.entry.js +24 -8
- package/dist/cjs/hb-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-popconfirm.cjs.entry.js +57 -8
- package/dist/cjs/hb-popconfirm.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-popover.cjs.entry.js +37 -5
- package/dist/cjs/hb-popover.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-progress.cjs.entry.js +1 -1
- package/dist/cjs/hb-radio.cjs.entry.js +8 -3
- package/dist/cjs/hb-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-rate.cjs.entry.js +46 -4
- package/dist/cjs/hb-rate.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-result.cjs.entry.js +1 -1
- package/dist/cjs/hb-row.cjs.entry.js +2 -2
- package/dist/cjs/hb-scrollbar.cjs.entry.js +5 -5
- package/dist/cjs/hb-scrollbar.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-segmented.cjs.entry.js +50 -5
- package/dist/cjs/hb-segmented.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-select.cjs.entry.js +64 -16
- package/dist/cjs/hb-select.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-slider.cjs.entry.js +186 -23
- package/dist/cjs/hb-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-space.cjs.entry.js +2 -2
- package/dist/cjs/hb-statistic.cjs.entry.js +1 -1
- package/dist/cjs/hb-step.cjs.entry.js +1 -1
- package/dist/cjs/hb-steps.cjs.entry.js +30 -9
- package/dist/cjs/hb-steps.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-sub-menu.cjs.entry.js +5 -5
- package/dist/cjs/hb-switch.cjs.entry.js +9 -4
- package/dist/cjs/hb-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-tab-pane.cjs.entry.js +1 -1
- package/dist/cjs/hb-table.cjs.entry.js +26 -17
- package/dist/cjs/hb-table.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-tabs.cjs.entry.js +31 -10
- package/dist/cjs/hb-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-tag.cjs.entry.js +3 -2
- package/dist/cjs/hb-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-text.cjs.entry.js +2 -2
- package/dist/cjs/hb-time-picker.cjs.entry.js +14 -9
- package/dist/cjs/hb-time-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-time-select.cjs.entry.js +13 -4
- package/dist/cjs/hb-time-select.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-timeline.cjs.entry.js +1 -1
- package/dist/cjs/hb-tooltip.cjs.entry.js +43 -6
- package/dist/cjs/hb-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-transfer.cjs.entry.js +2 -2
- package/dist/cjs/hb-tree-select.cjs.entry.js +215 -23
- package/dist/cjs/hb-tree-select.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-tree.cjs.entry.js +145 -12
- package/dist/cjs/hb-tree.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-upload.cjs.entry.js +3 -3
- package/dist/cjs/hb-watermark.cjs.entry.js +19 -11
- package/dist/cjs/hb-watermark.cjs.entry.js.map +1 -1
- package/dist/cjs/huibo-ui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/transition-59f1da0f.js +34 -0
- package/dist/cjs/transition-59f1da0f.js.map +1 -0
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/Affix/Affix.js +1 -1
- package/dist/collection/components/Alert/Alert.js +2 -1
- package/dist/collection/components/Alert/Alert.js.map +1 -1
- package/dist/collection/components/Avatar/Avatar.js +1 -1
- package/dist/collection/components/Backtop/Backtop.js +2 -2
- package/dist/collection/components/Badge/Badge.js +1 -1
- package/dist/collection/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/collection/components/Breadcrumb/BreadcrumbItem.js +1 -1
- package/dist/collection/components/Button/Button.js +2 -2
- package/dist/collection/components/Calendar/Calendar.js +84 -10
- package/dist/collection/components/Calendar/Calendar.js.map +1 -1
- package/dist/collection/components/Calendar/calendar.css +16 -0
- package/dist/collection/components/Card/Card.js +1 -1
- package/dist/collection/components/Cascader/Cascader.js +410 -194
- package/dist/collection/components/Cascader/Cascader.js.map +1 -1
- package/dist/collection/components/Cascader/cascader.css +170 -16
- package/dist/collection/components/Checkbox/Checkbox.js +9 -4
- package/dist/collection/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/collection/components/Checkbox/CheckboxGroup.js +12 -8
- package/dist/collection/components/Checkbox/CheckboxGroup.js.map +1 -1
- package/dist/collection/components/Collapse/Collapse.js +20 -15
- package/dist/collection/components/Collapse/Collapse.js.map +1 -1
- package/dist/collection/components/Collapse/CollapseItem.js +33 -4
- package/dist/collection/components/Collapse/CollapseItem.js.map +1 -1
- package/dist/collection/components/ColorPicker/ColorPicker.js +109 -28
- package/dist/collection/components/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/collection/components/ColorPicker/color-picker.css +21 -3
- package/dist/collection/components/ColorPickerPanel/ColorPickerPanel.js +2 -2
- package/dist/collection/components/ConfigProvider/ConfigProvider.js +1 -1
- package/dist/collection/components/Container/Aside.js +1 -1
- package/dist/collection/components/Container/Container.js +2 -2
- package/dist/collection/components/Container/Footer.js +1 -1
- package/dist/collection/components/Container/Header.js +1 -1
- package/dist/collection/components/Container/Main.js +1 -1
- package/dist/collection/components/DatePicker/DatePicker.js +94 -12
- package/dist/collection/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/collection/components/DatePicker/date-picker.css +63 -2
- package/dist/collection/components/DatePickerPane/DatePickerPane.js +1 -1
- package/dist/collection/components/DateRangePicker/DateRangePicker.js +2 -2
- package/dist/collection/components/DateTimePicker/DateTimePicker.js +2 -2
- package/dist/collection/components/Descriptions/Descriptions.js +1 -1
- package/dist/collection/components/Descriptions/descriptions.css +52 -10
- package/dist/collection/components/Dialog/Dialog.js +54 -10
- package/dist/collection/components/Dialog/Dialog.js.map +1 -1
- package/dist/collection/components/Dialog/dialog.css +57 -11
- package/dist/collection/components/Divider/Divider.js +2 -2
- package/dist/collection/components/Drawer/Drawer.js +34 -3
- package/dist/collection/components/Drawer/Drawer.js.map +1 -1
- package/dist/collection/components/Drawer/drawer.css +207 -17
- package/dist/collection/components/Dropdown/Dropdown.js +103 -12
- package/dist/collection/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/collection/components/Dropdown/dropdown.css +26 -3
- package/dist/collection/components/Empty/Empty.js +1 -1
- package/dist/collection/components/FloatButton/FloatButton.js +2 -2
- package/dist/collection/components/Form/Form.js +14 -9
- package/dist/collection/components/Form/Form.js.map +1 -1
- package/dist/collection/components/Form/FormItem.js +62 -10
- package/dist/collection/components/Form/FormItem.js.map +1 -1
- package/dist/collection/components/Form/form-item.css +57 -6
- package/dist/collection/components/Form/form.css +1 -0
- package/dist/collection/components/Image/Image.js +24 -3
- package/dist/collection/components/Image/Image.js.map +1 -1
- package/dist/collection/components/ImagePreview/ImagePreview.js +13 -9
- package/dist/collection/components/ImagePreview/ImagePreview.js.map +1 -1
- package/dist/collection/components/Input/Input.js +39 -2
- package/dist/collection/components/Input/Input.js.map +1 -1
- package/dist/collection/components/Input/input.css +22 -4
- package/dist/collection/components/InputNumber/InputNumber.js +6 -6
- package/dist/collection/components/InputNumber/InputNumber.js.map +1 -1
- package/dist/collection/components/InputNumber/input-number.css +11 -1
- package/dist/collection/components/InputTag/InputTag.js +2 -2
- package/dist/collection/components/Layout/Layout.js +87 -34
- package/dist/collection/components/Layout/Layout.js.map +1 -1
- package/dist/collection/components/Layout/Row.js +2 -2
- package/dist/collection/components/Layout/layout.css +1732 -71
- package/dist/collection/components/Link/Link.js +2 -2
- package/dist/collection/components/Loading/Loading.js +2 -2
- package/dist/collection/components/Menu/Menu.js +2 -2
- package/dist/collection/components/Menu/MenuItem.js +34 -5
- package/dist/collection/components/Menu/MenuItem.js.map +1 -1
- package/dist/collection/components/Menu/SubMenu.js +4 -4
- package/dist/collection/components/Menu/menu.css +25 -0
- package/dist/collection/components/Message/Message.js +13 -4
- package/dist/collection/components/Message/Message.js.map +1 -1
- package/dist/collection/components/Notification/Notification.js +2 -2
- package/dist/collection/components/PageHeader/PageHeader.js +1 -1
- package/dist/collection/components/Pagination/Pagination.js +26 -7
- package/dist/collection/components/Pagination/Pagination.js.map +1 -1
- package/dist/collection/components/Pagination/pagination.css +23 -0
- package/dist/collection/components/Popconfirm/Popconfirm.js +66 -7
- package/dist/collection/components/Popconfirm/Popconfirm.js.map +1 -1
- package/dist/collection/components/Popconfirm/popconfirm.css +80 -16
- package/dist/collection/components/Popover/Popover.js +46 -4
- package/dist/collection/components/Popover/Popover.js.map +1 -1
- package/dist/collection/components/Popover/popover.css +49 -8
- package/dist/collection/components/Progress/Progress.js +1 -1
- package/dist/collection/components/Radio/Radio.js +8 -3
- package/dist/collection/components/Radio/Radio.js.map +1 -1
- package/dist/collection/components/Rate/Rate.js +46 -4
- package/dist/collection/components/Rate/Rate.js.map +1 -1
- package/dist/collection/components/Result/Result.js +1 -1
- package/dist/collection/components/Scrollbar/Scrollbar.js +5 -5
- package/dist/collection/components/Scrollbar/Scrollbar.js.map +1 -1
- package/dist/collection/components/Segmented/Segmented.js +65 -6
- package/dist/collection/components/Segmented/Segmented.js.map +1 -1
- package/dist/collection/components/Select/Select.js +63 -15
- package/dist/collection/components/Select/Select.js.map +1 -1
- package/dist/collection/components/Select/select.css +50 -5
- package/dist/collection/components/Slider/Slider.js +218 -24
- package/dist/collection/components/Slider/Slider.js.map +1 -1
- package/dist/collection/components/Slider/slider.css +57 -7
- package/dist/collection/components/Space/Space.js +2 -2
- package/dist/collection/components/Statistic/Statistic.js +1 -1
- package/dist/collection/components/Steps/Step.js +1 -1
- package/dist/collection/components/Steps/Steps.js +35 -8
- package/dist/collection/components/Steps/Steps.js.map +1 -1
- package/dist/collection/components/Switch/Switch.js +8 -3
- package/dist/collection/components/Switch/Switch.js.map +1 -1
- package/dist/collection/components/Switch/switch.css +47 -1
- package/dist/collection/components/Table/Table.js +25 -16
- package/dist/collection/components/Table/Table.js.map +1 -1
- package/dist/collection/components/Table/table.css +26 -2
- package/dist/collection/components/Tabs/TabPane.js +1 -1
- package/dist/collection/components/Tabs/Tabs.js +31 -10
- package/dist/collection/components/Tabs/Tabs.js.map +1 -1
- package/dist/collection/components/Tag/Tag.js +3 -2
- package/dist/collection/components/Tag/Tag.js.map +1 -1
- package/dist/collection/components/Text/Text.js +2 -2
- package/dist/collection/components/TimePicker/TimePicker.js +14 -9
- package/dist/collection/components/TimePicker/TimePicker.js.map +1 -1
- package/dist/collection/components/TimeSelect/TimeSelect.js +13 -4
- package/dist/collection/components/TimeSelect/TimeSelect.js.map +1 -1
- package/dist/collection/components/Timeline/Timeline.js +1 -1
- package/dist/collection/components/Tooltip/Tooltip.js +52 -6
- package/dist/collection/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/collection/components/Tooltip/tooltip.css +24 -2
- package/dist/collection/components/Transfer/Transfer.js +2 -2
- package/dist/collection/components/Tree/Tree.js +147 -13
- package/dist/collection/components/Tree/Tree.js.map +1 -1
- package/dist/collection/components/TreeSelect/TreeSelect.js +219 -23
- package/dist/collection/components/TreeSelect/TreeSelect.js.map +1 -1
- package/dist/collection/components/TreeSelect/tree-select.css +41 -7
- package/dist/collection/components/Upload/Upload.js +3 -3
- package/dist/collection/components/Watermark/Watermark.js +19 -11
- package/dist/collection/components/Watermark/Watermark.js.map +1 -1
- package/dist/collection/utils/a11y.js +15 -1
- package/dist/collection/utils/a11y.js.map +1 -1
- package/dist/collection/utils/date-helpers.js +9 -16
- package/dist/collection/utils/date-helpers.js.map +1 -1
- package/dist/collection/utils/transition.js +29 -0
- package/dist/collection/utils/transition.js.map +1 -0
- package/dist/components/hb-affix.js +1 -1
- package/dist/components/hb-alert.js +2 -1
- package/dist/components/hb-alert.js.map +1 -1
- package/dist/components/hb-aside.js +1 -1
- package/dist/components/hb-avatar.js +1 -1
- package/dist/components/hb-backtop.js +2 -2
- package/dist/components/hb-badge.js +1 -1
- package/dist/components/hb-breadcrumb-item.js +1 -1
- package/dist/components/hb-breadcrumb.js +1 -1
- package/dist/components/hb-button.js +2 -2
- package/dist/components/hb-calendar.js +80 -11
- package/dist/components/hb-calendar.js.map +1 -1
- package/dist/components/hb-card.js +1 -1
- package/dist/components/hb-cascader.js +309 -146
- package/dist/components/hb-cascader.js.map +1 -1
- package/dist/components/hb-checkbox-group.js +12 -8
- package/dist/components/hb-checkbox-group.js.map +1 -1
- package/dist/components/hb-checkbox.js +9 -4
- package/dist/components/hb-checkbox.js.map +1 -1
- package/dist/components/hb-collapse-item.js +14 -4
- package/dist/components/hb-collapse-item.js.map +1 -1
- package/dist/components/hb-collapse.js +20 -15
- package/dist/components/hb-collapse.js.map +1 -1
- package/dist/components/hb-color-picker-panel.js +2 -2
- package/dist/components/hb-color-picker.js +110 -29
- package/dist/components/hb-color-picker.js.map +1 -1
- package/dist/components/hb-config-provider.js +1 -1
- package/dist/components/hb-container.js +2 -2
- package/dist/components/hb-date-picker-pane.js +2 -2
- package/dist/components/hb-date-picker.js +92 -10
- package/dist/components/hb-date-picker.js.map +1 -1
- package/dist/components/hb-date-range-picker.js +3 -3
- package/dist/components/hb-date-time-picker.js +3 -3
- package/dist/components/hb-descriptions.js +2 -2
- package/dist/components/hb-descriptions.js.map +1 -1
- package/dist/components/hb-dialog.js +53 -13
- package/dist/components/hb-dialog.js.map +1 -1
- package/dist/components/hb-divider.js +2 -2
- package/dist/components/hb-drawer.js +36 -5
- package/dist/components/hb-drawer.js.map +1 -1
- package/dist/components/hb-dropdown.js +94 -12
- package/dist/components/hb-dropdown.js.map +1 -1
- package/dist/components/hb-empty.js +1 -1
- package/dist/components/hb-float-button.js +2 -2
- package/dist/components/hb-footer.js +1 -1
- package/dist/components/hb-form-item.js +61 -9
- package/dist/components/hb-form-item.js.map +1 -1
- package/dist/components/hb-form.js +13 -8
- package/dist/components/hb-form.js.map +1 -1
- package/dist/components/hb-header.js +1 -1
- package/dist/components/hb-icon.js +1 -89
- package/dist/components/hb-icon.js.map +1 -1
- package/dist/components/hb-image-preview.js +13 -9
- package/dist/components/hb-image-preview.js.map +1 -1
- package/dist/components/hb-image.js +23 -3
- package/dist/components/hb-image.js.map +1 -1
- package/dist/components/hb-input-number.js +7 -7
- package/dist/components/hb-input-number.js.map +1 -1
- package/dist/components/hb-input-tag.js +2 -2
- package/dist/components/hb-input.js +40 -3
- package/dist/components/hb-input.js.map +1 -1
- package/dist/components/hb-layout.js +36 -14
- package/dist/components/hb-layout.js.map +1 -1
- package/dist/components/hb-link.js +2 -2
- package/dist/components/hb-loading.js +2 -2
- package/dist/components/hb-main.js +1 -1
- package/dist/components/hb-menu-item.js +15 -5
- package/dist/components/hb-menu-item.js.map +1 -1
- package/dist/components/hb-menu.js +3 -3
- package/dist/components/hb-menu.js.map +1 -1
- package/dist/components/hb-message.js +13 -4
- package/dist/components/hb-message.js.map +1 -1
- package/dist/components/hb-notification.js +2 -2
- package/dist/components/hb-page-header.js +1 -1
- package/dist/components/hb-pagination.js +28 -10
- package/dist/components/hb-pagination.js.map +1 -1
- package/dist/components/hb-popconfirm.js +58 -8
- package/dist/components/hb-popconfirm.js.map +1 -1
- package/dist/components/hb-popover.js +38 -5
- package/dist/components/hb-popover.js.map +1 -1
- package/dist/components/hb-progress.js +1 -1
- package/dist/components/hb-radio.js +8 -3
- package/dist/components/hb-radio.js.map +1 -1
- package/dist/components/hb-rate.js +46 -4
- package/dist/components/hb-rate.js.map +1 -1
- package/dist/components/hb-result.js +1 -1
- package/dist/components/hb-row.js +2 -2
- package/dist/components/hb-scrollbar.js +5 -5
- package/dist/components/hb-scrollbar.js.map +1 -1
- package/dist/components/hb-segmented.js +54 -6
- package/dist/components/hb-segmented.js.map +1 -1
- package/dist/components/hb-select.js +64 -16
- package/dist/components/hb-select.js.map +1 -1
- package/dist/components/hb-slider.js +191 -24
- package/dist/components/hb-slider.js.map +1 -1
- package/dist/components/hb-space.js +2 -2
- package/dist/components/hb-statistic.js +1 -1
- package/dist/components/hb-step.js +1 -1
- package/dist/components/hb-steps.js +35 -8
- package/dist/components/hb-steps.js.map +1 -1
- package/dist/components/hb-sub-menu.js +5 -5
- package/dist/components/hb-switch.js +9 -4
- package/dist/components/hb-switch.js.map +1 -1
- package/dist/components/hb-tab-pane.js +1 -1
- package/dist/components/hb-table.js +26 -17
- package/dist/components/hb-table.js.map +1 -1
- package/dist/components/hb-tabs.js +31 -10
- package/dist/components/hb-tabs.js.map +1 -1
- package/dist/components/hb-tag.js +3 -2
- package/dist/components/hb-tag.js.map +1 -1
- package/dist/components/hb-text.js +2 -2
- package/dist/components/hb-time-picker.js +14 -9
- package/dist/components/hb-time-picker.js.map +1 -1
- package/dist/components/hb-time-select.js +13 -4
- package/dist/components/hb-time-select.js.map +1 -1
- package/dist/components/hb-timeline.js +1 -1
- package/dist/components/hb-tooltip.js +44 -6
- package/dist/components/hb-tooltip.js.map +1 -1
- package/dist/components/hb-transfer.js +2 -2
- package/dist/components/hb-tree-select.js +219 -24
- package/dist/components/hb-tree-select.js.map +1 -1
- package/dist/components/hb-tree.js +147 -13
- package/dist/components/hb-tree.js.map +1 -1
- package/dist/components/hb-upload.js +3 -3
- package/dist/components/hb-watermark.js +19 -11
- package/dist/components/hb-watermark.js.map +1 -1
- package/dist/components/{p-cc0aeb50.js → p-00aa34c8.js} +17 -3
- package/dist/components/p-00aa34c8.js.map +1 -0
- package/dist/components/p-86d92faf.js +93 -0
- package/dist/components/p-86d92faf.js.map +1 -0
- package/dist/{esm/date-helpers-e4d85a67.js → components/p-e0876aca.js} +10 -17
- package/dist/components/p-e0876aca.js.map +1 -0
- package/dist/components/p-fad66d69.js +32 -0
- package/dist/components/p-fad66d69.js.map +1 -0
- package/dist/esm/{a11y-f9ab2964.js → a11y-e4cde5b0.js} +17 -3
- package/dist/esm/a11y-e4cde5b0.js.map +1 -0
- package/dist/{components/p-cf94cbf6.js → esm/date-helpers-259ed2f1.js} +10 -17
- package/dist/esm/date-helpers-259ed2f1.js.map +1 -0
- package/dist/esm/hb-affix.entry.js +1 -1
- package/dist/esm/hb-alert.entry.js +2 -1
- package/dist/esm/hb-alert.entry.js.map +1 -1
- package/dist/esm/hb-aside.entry.js +1 -1
- package/dist/esm/hb-avatar.entry.js +1 -1
- package/dist/esm/hb-backtop.entry.js +2 -2
- package/dist/esm/hb-badge.entry.js +1 -1
- package/dist/esm/hb-breadcrumb-item.entry.js +1 -1
- package/dist/esm/hb-breadcrumb.entry.js +1 -1
- package/dist/esm/hb-button.entry.js +2 -2
- package/dist/esm/hb-calendar.entry.js +78 -10
- package/dist/esm/hb-calendar.entry.js.map +1 -1
- package/dist/esm/hb-card.entry.js +1 -1
- package/dist/esm/hb-cascader.entry.js +306 -146
- package/dist/esm/hb-cascader.entry.js.map +1 -1
- package/dist/esm/hb-checkbox-group.entry.js +12 -8
- package/dist/esm/hb-checkbox-group.entry.js.map +1 -1
- package/dist/esm/hb-checkbox.entry.js +9 -4
- package/dist/esm/hb-checkbox.entry.js.map +1 -1
- package/dist/esm/hb-collapse-item.entry.js +13 -4
- package/dist/esm/hb-collapse-item.entry.js.map +1 -1
- package/dist/esm/hb-collapse.entry.js +20 -15
- package/dist/esm/hb-collapse.entry.js.map +1 -1
- package/dist/esm/hb-color-picker-panel.entry.js +2 -2
- package/dist/esm/hb-color-picker.entry.js +108 -28
- package/dist/esm/hb-color-picker.entry.js.map +1 -1
- package/dist/esm/hb-config-provider.entry.js +1 -1
- package/dist/esm/hb-container.entry.js +2 -2
- package/dist/esm/hb-date-picker-pane.entry.js +2 -2
- package/dist/esm/hb-date-picker.entry.js +90 -9
- package/dist/esm/hb-date-picker.entry.js.map +1 -1
- package/dist/esm/hb-date-range-picker.entry.js +3 -3
- package/dist/esm/hb-date-time-picker.entry.js +3 -3
- package/dist/esm/hb-descriptions.entry.js +2 -2
- package/dist/esm/hb-descriptions.entry.js.map +1 -1
- package/dist/esm/hb-dialog.entry.js +51 -12
- package/dist/esm/hb-dialog.entry.js.map +1 -1
- package/dist/esm/hb-divider.entry.js +2 -2
- package/dist/esm/hb-drawer.entry.js +34 -4
- package/dist/esm/hb-drawer.entry.js.map +1 -1
- package/dist/esm/hb-dropdown.entry.js +91 -11
- package/dist/esm/hb-dropdown.entry.js.map +1 -1
- package/dist/esm/hb-empty.entry.js +1 -1
- package/dist/esm/hb-float-button.entry.js +2 -2
- package/dist/esm/hb-footer.entry.js +1 -1
- package/dist/esm/hb-form-item.entry.js +61 -9
- package/dist/esm/hb-form-item.entry.js.map +1 -1
- package/dist/esm/hb-form.entry.js +13 -8
- package/dist/esm/hb-form.entry.js.map +1 -1
- package/dist/esm/hb-header.entry.js +1 -1
- package/dist/esm/hb-image-preview.entry.js +13 -9
- package/dist/esm/hb-image-preview.entry.js.map +1 -1
- package/dist/esm/hb-image.entry.js +21 -3
- package/dist/esm/hb-image.entry.js.map +1 -1
- package/dist/esm/hb-input-number.entry.js +7 -7
- package/dist/esm/hb-input-number.entry.js.map +1 -1
- package/dist/esm/hb-input-tag.entry.js +2 -2
- package/dist/esm/hb-input.entry.js +40 -3
- package/dist/esm/hb-input.entry.js.map +1 -1
- package/dist/esm/hb-layout.entry.js +36 -14
- package/dist/esm/hb-layout.entry.js.map +1 -1
- package/dist/esm/hb-link.entry.js +2 -2
- package/dist/esm/hb-loading.entry.js +2 -2
- package/dist/esm/hb-main.entry.js +1 -1
- package/dist/esm/hb-menu-item.entry.js +14 -5
- package/dist/esm/hb-menu-item.entry.js.map +1 -1
- package/dist/esm/hb-menu.entry.js +3 -3
- package/dist/esm/hb-menu.entry.js.map +1 -1
- package/dist/esm/hb-message.entry.js +13 -4
- package/dist/esm/hb-message.entry.js.map +1 -1
- package/dist/esm/hb-notification.entry.js +2 -2
- package/dist/esm/hb-page-header.entry.js +1 -1
- package/dist/esm/hb-pagination.entry.js +24 -8
- package/dist/esm/hb-pagination.entry.js.map +1 -1
- package/dist/esm/hb-popconfirm.entry.js +57 -8
- package/dist/esm/hb-popconfirm.entry.js.map +1 -1
- package/dist/esm/hb-popover.entry.js +37 -5
- package/dist/esm/hb-popover.entry.js.map +1 -1
- package/dist/esm/hb-progress.entry.js +1 -1
- package/dist/esm/hb-radio.entry.js +8 -3
- package/dist/esm/hb-radio.entry.js.map +1 -1
- package/dist/esm/hb-rate.entry.js +46 -4
- package/dist/esm/hb-rate.entry.js.map +1 -1
- package/dist/esm/hb-result.entry.js +1 -1
- package/dist/esm/hb-row.entry.js +2 -2
- package/dist/esm/hb-scrollbar.entry.js +5 -5
- package/dist/esm/hb-scrollbar.entry.js.map +1 -1
- package/dist/esm/hb-segmented.entry.js +51 -6
- package/dist/esm/hb-segmented.entry.js.map +1 -1
- package/dist/esm/hb-select.entry.js +64 -16
- package/dist/esm/hb-select.entry.js.map +1 -1
- package/dist/esm/hb-slider.entry.js +186 -23
- package/dist/esm/hb-slider.entry.js.map +1 -1
- package/dist/esm/hb-space.entry.js +2 -2
- package/dist/esm/hb-statistic.entry.js +1 -1
- package/dist/esm/hb-step.entry.js +1 -1
- package/dist/esm/hb-steps.entry.js +28 -7
- package/dist/esm/hb-steps.entry.js.map +1 -1
- package/dist/esm/hb-sub-menu.entry.js +5 -5
- package/dist/esm/hb-switch.entry.js +9 -4
- package/dist/esm/hb-switch.entry.js.map +1 -1
- package/dist/esm/hb-tab-pane.entry.js +1 -1
- package/dist/esm/hb-table.entry.js +26 -17
- package/dist/esm/hb-table.entry.js.map +1 -1
- package/dist/esm/hb-tabs.entry.js +31 -10
- package/dist/esm/hb-tabs.entry.js.map +1 -1
- package/dist/esm/hb-tag.entry.js +3 -2
- package/dist/esm/hb-tag.entry.js.map +1 -1
- package/dist/esm/hb-text.entry.js +2 -2
- package/dist/esm/hb-time-picker.entry.js +14 -9
- package/dist/esm/hb-time-picker.entry.js.map +1 -1
- package/dist/esm/hb-time-select.entry.js +13 -4
- package/dist/esm/hb-time-select.entry.js.map +1 -1
- package/dist/esm/hb-timeline.entry.js +1 -1
- package/dist/esm/hb-tooltip.entry.js +43 -6
- package/dist/esm/hb-tooltip.entry.js.map +1 -1
- package/dist/esm/hb-transfer.entry.js +2 -2
- package/dist/esm/hb-tree-select.entry.js +215 -23
- package/dist/esm/hb-tree-select.entry.js.map +1 -1
- package/dist/esm/hb-tree.entry.js +145 -12
- package/dist/esm/hb-tree.entry.js.map +1 -1
- package/dist/esm/hb-upload.entry.js +3 -3
- package/dist/esm/hb-watermark.entry.js +19 -11
- package/dist/esm/hb-watermark.entry.js.map +1 -1
- package/dist/esm/huibo-ui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/transition-4295d789.js +32 -0
- package/dist/esm/transition-4295d789.js.map +1 -0
- package/dist/huibo-ui/huibo-ui.css +1 -1
- package/dist/huibo-ui/huibo-ui.esm.js +1 -1
- package/dist/huibo-ui/huibo-ui.esm.js.map +1 -1
- package/dist/huibo-ui/p-00aa34c8.js +2 -0
- package/dist/huibo-ui/p-00aa34c8.js.map +1 -0
- package/dist/huibo-ui/p-02f15843.entry.js +2 -0
- package/dist/huibo-ui/p-0cc1e3f3.entry.js +2 -0
- package/dist/huibo-ui/p-0cc1e3f3.entry.js.map +1 -0
- package/dist/huibo-ui/{p-f1c084c5.entry.js → p-0ddae4e9.entry.js} +2 -2
- package/dist/huibo-ui/{p-672076c3.entry.js → p-10f6c184.entry.js} +2 -2
- package/dist/huibo-ui/p-10f6c184.entry.js.map +1 -0
- package/dist/huibo-ui/{p-6ac242fe.entry.js → p-14c3b47b.entry.js} +2 -2
- package/dist/huibo-ui/{p-8c80a765.entry.js → p-15db24e9.entry.js} +2 -2
- package/dist/huibo-ui/{p-8b027491.entry.js → p-193efdc0.entry.js} +2 -2
- package/dist/huibo-ui/{p-8d925e3d.entry.js → p-1b0fbe69.entry.js} +2 -2
- package/dist/huibo-ui/{p-85f68526.entry.js → p-1b98152b.entry.js} +2 -2
- package/dist/huibo-ui/p-1b98152b.entry.js.map +1 -0
- package/dist/huibo-ui/p-1f6d0adb.entry.js +2 -0
- package/dist/huibo-ui/p-1f6d0adb.entry.js.map +1 -0
- package/dist/huibo-ui/{p-f374d5a3.entry.js → p-20632186.entry.js} +2 -2
- package/dist/huibo-ui/{p-e6f2d71d.entry.js → p-20fc554b.entry.js} +2 -2
- package/dist/huibo-ui/{p-64ca0980.entry.js → p-29092b85.entry.js} +2 -2
- package/dist/huibo-ui/p-29092b85.entry.js.map +1 -0
- package/dist/huibo-ui/p-2bc30b1b.entry.js +2 -0
- package/dist/huibo-ui/p-2bc30b1b.entry.js.map +1 -0
- package/dist/huibo-ui/{p-fd19813c.entry.js → p-2bcda1bb.entry.js} +2 -2
- package/dist/huibo-ui/{p-231a7335.entry.js → p-2ca9796a.entry.js} +2 -2
- package/dist/huibo-ui/p-2ca9796a.entry.js.map +1 -0
- package/dist/huibo-ui/{p-e0768565.entry.js → p-3042f986.entry.js} +2 -2
- package/dist/huibo-ui/{p-be48d2aa.entry.js → p-3dacb26b.entry.js} +2 -2
- package/dist/huibo-ui/{p-6a1ec3ff.entry.js → p-3deff48c.entry.js} +2 -2
- package/dist/huibo-ui/{p-c321c4aa.entry.js → p-412ff618.entry.js} +2 -2
- package/dist/huibo-ui/p-415295f3.entry.js +2 -0
- package/dist/huibo-ui/p-415295f3.entry.js.map +1 -0
- package/dist/huibo-ui/p-494e6c25.entry.js +2 -0
- package/dist/huibo-ui/p-494e6c25.entry.js.map +1 -0
- package/dist/huibo-ui/p-4d87d7f4.entry.js +2 -0
- package/dist/huibo-ui/p-4d87d7f4.entry.js.map +1 -0
- package/dist/huibo-ui/p-54a28052.entry.js +2 -0
- package/dist/huibo-ui/p-54a28052.entry.js.map +1 -0
- package/dist/huibo-ui/{p-88127de1.entry.js → p-55cd13eb.entry.js} +2 -2
- package/dist/huibo-ui/{p-58ebb9b3.entry.js → p-5c839288.entry.js} +2 -2
- package/dist/huibo-ui/p-5e253c15.entry.js +2 -0
- package/dist/huibo-ui/p-5e253c15.entry.js.map +1 -0
- package/dist/huibo-ui/p-63d68c61.entry.js +2 -0
- package/dist/huibo-ui/p-63d68c61.entry.js.map +1 -0
- package/dist/huibo-ui/{p-a042e3d0.entry.js → p-6518c435.entry.js} +2 -2
- package/dist/huibo-ui/p-687d8dff.entry.js +2 -0
- package/dist/huibo-ui/p-687d8dff.entry.js.map +1 -0
- package/dist/huibo-ui/p-688460ce.entry.js +2 -0
- package/dist/huibo-ui/p-688460ce.entry.js.map +1 -0
- package/dist/huibo-ui/p-69bb1dd9.entry.js +2 -0
- package/dist/huibo-ui/p-69bb1dd9.entry.js.map +1 -0
- package/dist/huibo-ui/{p-a0015341.entry.js → p-6bfeab80.entry.js} +2 -2
- package/dist/huibo-ui/{p-4001c08d.entry.js → p-6c23fbd1.entry.js} +2 -2
- package/dist/huibo-ui/p-6c23fbd1.entry.js.map +1 -0
- package/dist/huibo-ui/p-6c8cf248.entry.js +2 -0
- package/dist/huibo-ui/p-6c8cf248.entry.js.map +1 -0
- package/dist/huibo-ui/p-6efed295.entry.js +2 -0
- package/dist/huibo-ui/p-6efed295.entry.js.map +1 -0
- package/dist/huibo-ui/{p-8b1ae77e.entry.js → p-746a11a3.entry.js} +2 -2
- package/dist/huibo-ui/{p-c3e8893d.entry.js → p-79b24b83.entry.js} +2 -2
- package/dist/huibo-ui/p-79b24b83.entry.js.map +1 -0
- package/dist/huibo-ui/p-7a38b3e2.entry.js +2 -0
- package/dist/huibo-ui/p-7a38b3e2.entry.js.map +1 -0
- package/dist/huibo-ui/{p-c922d672.entry.js → p-7a682c56.entry.js} +2 -2
- package/dist/huibo-ui/{p-8c987d57.entry.js → p-7f65dc36.entry.js} +2 -2
- package/dist/huibo-ui/{p-463de26d.entry.js → p-815fc943.entry.js} +2 -2
- package/dist/huibo-ui/{p-d87fc21a.entry.js → p-88a6c905.entry.js} +2 -2
- package/dist/huibo-ui/{p-77017274.entry.js → p-89be7973.entry.js} +2 -2
- package/dist/huibo-ui/p-8a202bc5.entry.js +2 -0
- package/dist/huibo-ui/p-8a202bc5.entry.js.map +1 -0
- package/dist/huibo-ui/{p-315feadf.entry.js → p-8c4415ed.entry.js} +2 -2
- package/dist/huibo-ui/p-8c4415ed.entry.js.map +1 -0
- package/dist/huibo-ui/{p-9319c650.entry.js → p-950e7465.entry.js} +2 -2
- package/dist/huibo-ui/{p-6b381d0e.entry.js → p-96cecd21.entry.js} +2 -2
- package/dist/huibo-ui/p-96cecd21.entry.js.map +1 -0
- package/dist/huibo-ui/{p-710f38de.entry.js → p-98b513cd.entry.js} +2 -2
- package/dist/huibo-ui/p-98b513cd.entry.js.map +1 -0
- package/dist/huibo-ui/{p-5df47135.entry.js → p-a190ca89.entry.js} +2 -2
- package/dist/huibo-ui/{p-0e65e1bd.entry.js → p-ac18c68b.entry.js} +2 -2
- package/dist/huibo-ui/p-ac18c68b.entry.js.map +1 -0
- package/dist/huibo-ui/{p-d64b91ef.entry.js → p-ac45291c.entry.js} +2 -2
- package/dist/huibo-ui/p-ac45291c.entry.js.map +1 -0
- package/dist/huibo-ui/{p-477d8568.entry.js → p-aeae83af.entry.js} +2 -2
- package/dist/huibo-ui/{p-b489a526.entry.js → p-b06c8020.entry.js} +2 -2
- package/dist/huibo-ui/{p-dfaf7e37.entry.js → p-b105cf76.entry.js} +2 -2
- package/dist/huibo-ui/p-b105cf76.entry.js.map +1 -0
- package/dist/huibo-ui/{p-c3e665f6.entry.js → p-b38802b0.entry.js} +2 -2
- package/dist/huibo-ui/p-b38802b0.entry.js.map +1 -0
- package/dist/huibo-ui/{p-ea74fcae.entry.js → p-b3fd12c7.entry.js} +2 -2
- package/dist/huibo-ui/p-b3fd12c7.entry.js.map +1 -0
- package/dist/huibo-ui/p-b5ea18ba.entry.js +2 -0
- package/dist/huibo-ui/p-b5ea18ba.entry.js.map +1 -0
- package/dist/huibo-ui/{p-e2a8a396.entry.js → p-b6afe81e.entry.js} +2 -2
- package/dist/huibo-ui/{p-2b286698.entry.js → p-b7885d4a.entry.js} +2 -2
- package/dist/huibo-ui/p-b7900dee.entry.js +2 -0
- package/dist/huibo-ui/p-b7900dee.entry.js.map +1 -0
- package/dist/huibo-ui/p-b8c83751.entry.js +2 -0
- package/dist/huibo-ui/p-b8c83751.entry.js.map +1 -0
- package/dist/huibo-ui/p-c7713947.entry.js +2 -0
- package/dist/huibo-ui/p-c7713947.entry.js.map +1 -0
- package/dist/huibo-ui/{p-e0ab9010.entry.js → p-c869842c.entry.js} +2 -2
- package/dist/huibo-ui/p-c869842c.entry.js.map +1 -0
- package/dist/huibo-ui/{p-476527c1.entry.js → p-c8e917db.entry.js} +2 -2
- package/dist/huibo-ui/p-c8e917db.entry.js.map +1 -0
- package/dist/huibo-ui/p-cb66dbef.entry.js +2 -0
- package/dist/huibo-ui/p-cb66dbef.entry.js.map +1 -0
- package/dist/huibo-ui/p-cde83f76.entry.js +2 -0
- package/dist/huibo-ui/p-cde83f76.entry.js.map +1 -0
- package/dist/huibo-ui/{p-10c088f3.entry.js → p-d9c7c378.entry.js} +2 -2
- package/dist/huibo-ui/{p-332c8877.entry.js → p-dd9c6459.entry.js} +2 -2
- package/dist/huibo-ui/{p-80aca641.entry.js → p-dfccc7aa.entry.js} +2 -2
- package/dist/huibo-ui/{p-21682e92.entry.js → p-dfd144d8.entry.js} +2 -2
- package/dist/huibo-ui/p-e0876aca.js +2 -0
- package/dist/huibo-ui/p-e0876aca.js.map +1 -0
- package/dist/huibo-ui/p-e1773c93.entry.js +2 -0
- package/dist/huibo-ui/p-e1773c93.entry.js.map +1 -0
- package/dist/huibo-ui/{p-079a4130.entry.js → p-e3155cd7.entry.js} +2 -2
- package/dist/huibo-ui/{p-59b2e61c.entry.js → p-e73c357f.entry.js} +2 -2
- package/dist/huibo-ui/p-e73c357f.entry.js.map +1 -0
- package/dist/huibo-ui/{p-c1b4eacb.entry.js → p-e7c73624.entry.js} +2 -2
- package/dist/huibo-ui/p-e7c73624.entry.js.map +1 -0
- package/dist/huibo-ui/{p-d7815b4f.entry.js → p-e9e7abca.entry.js} +2 -2
- package/dist/huibo-ui/{p-f81ec512.entry.js → p-ea0823f3.entry.js} +2 -2
- package/dist/huibo-ui/p-ea0823f3.entry.js.map +1 -0
- package/dist/huibo-ui/{p-2e6584ea.entry.js → p-f1f2483f.entry.js} +2 -2
- package/dist/huibo-ui/{p-465dcb4c.entry.js → p-f2c78699.entry.js} +2 -2
- package/dist/huibo-ui/p-fad66d69.js +2 -0
- package/dist/huibo-ui/p-fad66d69.js.map +1 -0
- package/dist/huibo-ui/{p-4d8b1404.entry.js → p-fd6831f9.entry.js} +2 -2
- package/dist/huibo-ui/p-ff6bc5cc.entry.js +2 -0
- package/dist/huibo-ui/p-ff6bc5cc.entry.js.map +1 -0
- package/dist/types/components/Calendar/Calendar.d.ts +13 -1
- package/dist/types/components/Cascader/Cascader.d.ts +80 -90
- package/dist/types/components/Checkbox/Checkbox.d.ts +5 -0
- package/dist/types/components/Checkbox/CheckboxGroup.d.ts +1 -0
- package/dist/types/components/Collapse/Collapse.d.ts +2 -0
- package/dist/types/components/Collapse/CollapseItem.d.ts +8 -1
- package/dist/types/components/ColorPicker/ColorPicker.d.ts +11 -0
- package/dist/types/components/DatePicker/DatePicker.d.ts +14 -3
- package/dist/types/components/Dialog/Dialog.d.ts +13 -1
- package/dist/types/components/Drawer/Drawer.d.ts +4 -0
- package/dist/types/components/Dropdown/Dropdown.d.ts +18 -1
- package/dist/types/components/Form/Form.d.ts +2 -0
- package/dist/types/components/Form/FormItem.d.ts +10 -0
- package/dist/types/components/Image/Image.d.ts +6 -0
- package/dist/types/components/ImagePreview/ImagePreview.d.ts +5 -1
- package/dist/types/components/Input/Input.d.ts +9 -0
- package/dist/types/components/Layout/Layout.d.ts +20 -10
- package/dist/types/components/Menu/MenuItem.d.ts +8 -1
- package/dist/types/components/Message/Message.d.ts +3 -0
- package/dist/types/components/Pagination/Pagination.d.ts +3 -0
- package/dist/types/components/Popconfirm/Popconfirm.d.ts +16 -0
- package/dist/types/components/Popover/Popover.d.ts +14 -0
- package/dist/types/components/Radio/Radio.d.ts +5 -0
- package/dist/types/components/Rate/Rate.d.ts +7 -0
- package/dist/types/components/Segmented/Segmented.d.ts +18 -1
- package/dist/types/components/Select/Select.d.ts +11 -0
- package/dist/types/components/Slider/Slider.d.ts +27 -1
- package/dist/types/components/Steps/Steps.d.ts +14 -6
- package/dist/types/components/Table/Table.d.ts +8 -2
- package/dist/types/components/Tabs/Tabs.d.ts +6 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +15 -1
- package/dist/types/components/Tree/Tree.d.ts +24 -0
- package/dist/types/components/TreeSelect/TreeSelect.d.ts +26 -0
- package/dist/types/components/Watermark/Watermark.d.ts +7 -1
- package/dist/types/components.d.ts +290 -98
- package/dist/types/utils/a11y.d.ts +9 -0
- package/dist/types/utils/date-helpers.d.ts +1 -1
- package/dist/types/utils/transition.d.ts +27 -0
- package/package.json +8 -2
- package/readme.md +88 -73
- package/dist/cjs/a11y-802de67a.js.map +0 -1
- package/dist/cjs/date-helpers-904747ff.js.map +0 -1
- package/dist/components/p-cc0aeb50.js.map +0 -1
- package/dist/components/p-cf94cbf6.js.map +0 -1
- package/dist/esm/a11y-f9ab2964.js.map +0 -1
- package/dist/esm/date-helpers-e4d85a67.js.map +0 -1
- package/dist/huibo-ui/p-003cee87.entry.js +0 -2
- package/dist/huibo-ui/p-003cee87.entry.js.map +0 -1
- package/dist/huibo-ui/p-0a033738.entry.js +0 -2
- package/dist/huibo-ui/p-0a033738.entry.js.map +0 -1
- package/dist/huibo-ui/p-0bef78ac.entry.js +0 -2
- package/dist/huibo-ui/p-0bef78ac.entry.js.map +0 -1
- package/dist/huibo-ui/p-0e65e1bd.entry.js.map +0 -1
- package/dist/huibo-ui/p-0f189251.entry.js +0 -2
- package/dist/huibo-ui/p-0f189251.entry.js.map +0 -1
- package/dist/huibo-ui/p-1b5acd6d.entry.js +0 -2
- package/dist/huibo-ui/p-1b5acd6d.entry.js.map +0 -1
- package/dist/huibo-ui/p-231a7335.entry.js.map +0 -1
- package/dist/huibo-ui/p-24ad7eec.entry.js +0 -2
- package/dist/huibo-ui/p-24ad7eec.entry.js.map +0 -1
- package/dist/huibo-ui/p-315feadf.entry.js.map +0 -1
- package/dist/huibo-ui/p-3c7f73c8.entry.js +0 -2
- package/dist/huibo-ui/p-3c7f73c8.entry.js.map +0 -1
- package/dist/huibo-ui/p-4001c08d.entry.js.map +0 -1
- package/dist/huibo-ui/p-44c48246.entry.js +0 -2
- package/dist/huibo-ui/p-44c48246.entry.js.map +0 -1
- package/dist/huibo-ui/p-476527c1.entry.js.map +0 -1
- package/dist/huibo-ui/p-4d0dff15.entry.js +0 -2
- package/dist/huibo-ui/p-58d20809.entry.js +0 -2
- package/dist/huibo-ui/p-58d20809.entry.js.map +0 -1
- package/dist/huibo-ui/p-59b2e61c.entry.js.map +0 -1
- package/dist/huibo-ui/p-64ca0980.entry.js.map +0 -1
- package/dist/huibo-ui/p-672076c3.entry.js.map +0 -1
- package/dist/huibo-ui/p-6b381d0e.entry.js.map +0 -1
- package/dist/huibo-ui/p-710f38de.entry.js.map +0 -1
- package/dist/huibo-ui/p-756acbdb.entry.js +0 -2
- package/dist/huibo-ui/p-756acbdb.entry.js.map +0 -1
- package/dist/huibo-ui/p-75a93de3.entry.js +0 -2
- package/dist/huibo-ui/p-75a93de3.entry.js.map +0 -1
- package/dist/huibo-ui/p-769960f4.entry.js +0 -2
- package/dist/huibo-ui/p-769960f4.entry.js.map +0 -1
- package/dist/huibo-ui/p-7f6975ad.entry.js +0 -2
- package/dist/huibo-ui/p-7f6975ad.entry.js.map +0 -1
- package/dist/huibo-ui/p-85f68526.entry.js.map +0 -1
- package/dist/huibo-ui/p-8d615521.entry.js +0 -2
- package/dist/huibo-ui/p-8d615521.entry.js.map +0 -1
- package/dist/huibo-ui/p-953b9514.entry.js +0 -2
- package/dist/huibo-ui/p-953b9514.entry.js.map +0 -1
- package/dist/huibo-ui/p-965d4d02.entry.js +0 -2
- package/dist/huibo-ui/p-965d4d02.entry.js.map +0 -1
- package/dist/huibo-ui/p-ad6b0c6e.entry.js +0 -2
- package/dist/huibo-ui/p-ad6b0c6e.entry.js.map +0 -1
- package/dist/huibo-ui/p-c1a059d9.entry.js +0 -2
- package/dist/huibo-ui/p-c1a059d9.entry.js.map +0 -1
- package/dist/huibo-ui/p-c1b4eacb.entry.js.map +0 -1
- package/dist/huibo-ui/p-c3e665f6.entry.js.map +0 -1
- package/dist/huibo-ui/p-c3e8893d.entry.js.map +0 -1
- package/dist/huibo-ui/p-cc0aeb50.js +0 -2
- package/dist/huibo-ui/p-cc0aeb50.js.map +0 -1
- package/dist/huibo-ui/p-cf94cbf6.js +0 -2
- package/dist/huibo-ui/p-cf94cbf6.js.map +0 -1
- package/dist/huibo-ui/p-d3939d44.entry.js +0 -2
- package/dist/huibo-ui/p-d3939d44.entry.js.map +0 -1
- package/dist/huibo-ui/p-d64b91ef.entry.js.map +0 -1
- package/dist/huibo-ui/p-dd05cb2c.entry.js +0 -2
- package/dist/huibo-ui/p-dd05cb2c.entry.js.map +0 -1
- package/dist/huibo-ui/p-dfaf7e37.entry.js.map +0 -1
- package/dist/huibo-ui/p-e0ab9010.entry.js.map +0 -1
- package/dist/huibo-ui/p-e9490259.entry.js +0 -2
- package/dist/huibo-ui/p-e9490259.entry.js.map +0 -1
- package/dist/huibo-ui/p-ea74fcae.entry.js.map +0 -1
- package/dist/huibo-ui/p-ebd04656.entry.js +0 -2
- package/dist/huibo-ui/p-ebd04656.entry.js.map +0 -1
- package/dist/huibo-ui/p-ed0ff857.entry.js +0 -2
- package/dist/huibo-ui/p-ed0ff857.entry.js.map +0 -1
- package/dist/huibo-ui/p-f0ac7db5.entry.js +0 -2
- package/dist/huibo-ui/p-f0ac7db5.entry.js.map +0 -1
- package/dist/huibo-ui/p-f81ec512.entry.js.map +0 -1
- /package/dist/huibo-ui/{p-4d0dff15.entry.js.map → p-02f15843.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-f1c084c5.entry.js.map → p-0ddae4e9.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-6ac242fe.entry.js.map → p-14c3b47b.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-8c80a765.entry.js.map → p-15db24e9.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-8b027491.entry.js.map → p-193efdc0.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-8d925e3d.entry.js.map → p-1b0fbe69.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-f374d5a3.entry.js.map → p-20632186.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-e6f2d71d.entry.js.map → p-20fc554b.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-fd19813c.entry.js.map → p-2bcda1bb.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-e0768565.entry.js.map → p-3042f986.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-be48d2aa.entry.js.map → p-3dacb26b.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-6a1ec3ff.entry.js.map → p-3deff48c.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-c321c4aa.entry.js.map → p-412ff618.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-88127de1.entry.js.map → p-55cd13eb.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-58ebb9b3.entry.js.map → p-5c839288.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-a042e3d0.entry.js.map → p-6518c435.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-a0015341.entry.js.map → p-6bfeab80.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-8b1ae77e.entry.js.map → p-746a11a3.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-c922d672.entry.js.map → p-7a682c56.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-8c987d57.entry.js.map → p-7f65dc36.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-463de26d.entry.js.map → p-815fc943.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-d87fc21a.entry.js.map → p-88a6c905.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-77017274.entry.js.map → p-89be7973.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-9319c650.entry.js.map → p-950e7465.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-5df47135.entry.js.map → p-a190ca89.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-477d8568.entry.js.map → p-aeae83af.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-b489a526.entry.js.map → p-b06c8020.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-e2a8a396.entry.js.map → p-b6afe81e.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-2b286698.entry.js.map → p-b7885d4a.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-10c088f3.entry.js.map → p-d9c7c378.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-332c8877.entry.js.map → p-dd9c6459.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-80aca641.entry.js.map → p-dfccc7aa.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-21682e92.entry.js.map → p-dfd144d8.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-079a4130.entry.js.map → p-e3155cd7.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-d7815b4f.entry.js.map → p-e9e7abca.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-2e6584ea.entry.js.map → p-f1f2483f.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-465dcb4c.entry.js.map → p-f2c78699.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-4d8b1404.entry.js.map → p-fd6831f9.entry.js.map} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h } from './p-1407a5e8.js';
|
|
2
2
|
import { g as getNextZIndex, l as lockScroll, u as unlockScroll } from './p-ecce2b5e.js';
|
|
3
|
-
import { c as createFocusTrap } from './p-
|
|
3
|
+
import { c as createFocusTrap } from './p-00aa34c8.js';
|
|
4
4
|
|
|
5
|
-
const dialogCss = "/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{appearance:button;background-color:#0000;border:0 solid;border-radius:0;box-sizing:border-box;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;margin:0;margin-inline-end:4px;opacity:1;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);line-height:1.5;tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex;padding-block:0}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.container{width:100%}.hidden{display:none}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}} /*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{}@layer base{}@layer components;:host{display:contents}.hb-dialog-wrapper{inset:0;pointer-events:none;position:fixed}.hb-dialog-wrapper--hidden{display:none}.hb-dialog__overlay{background-color:var(--hb-color-bg-mask);inset:0;
|
|
5
|
+
const dialogCss = "/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{appearance:button;background-color:#0000;border:0 solid;border-radius:0;box-sizing:border-box;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;margin:0;margin-inline-end:4px;opacity:1;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);line-height:1.5;tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex;padding-block:0}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.container{width:100%}.hidden{display:none}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}} /*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{}@layer base{}@layer components;:host{display:contents}.hb-dialog-wrapper{inset:0;pointer-events:none;position:fixed}.hb-dialog-wrapper--hidden{display:none}.hb-dialog__overlay{animation:hb-dialog-overlay-in .3s both;background-color:var(--hb-color-bg-mask);inset:0;pointer-events:auto;position:fixed}.hb-dialog__overlay--leaving{animation:hb-dialog-overlay-out .3s both}@keyframes hb-dialog-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes hb-dialog-overlay-out{0%{opacity:1}to{opacity:0}}.hb-dialog{animation:hb-dialog-in .3s cubic-bezier(.16,1,.3,1) both;background-color:var(--hb-dialog-bg);border-radius:var(--hb-dialog-radius);box-shadow:var(--hb-dialog-shadow);display:flex;flex-direction:column;left:50%;max-height:90vh;overflow:hidden;pointer-events:auto;position:fixed;top:50%}.hb-dialog--leaving{animation:hb-dialog-out .3s cubic-bezier(.5,0,.75,0) both}@keyframes hb-dialog-in{0%{opacity:0;transform:translate(-50%,-50%)scale(.9)}to{opacity:1;transform:translate(-50%,-50%)scale(1)}}@keyframes hb-dialog-out{0%{opacity:1;transform:translate(-50%,-50%)scale(1)}to{opacity:0;transform:translate(-50%,-50%)scale(.95)}}.hb-dialog--fullscreen{border-radius:0;height:100vh;left:0;max-height:100vh;top:0;width:100%!important}.hb-dialog--fullscreen,.hb-dialog--fullscreen.hb-dialog--leaving{animation:none}.hb-dialog__header{align-items:center;border-bottom:1px solid var(--hb-color-border-secondary);display:flex;justify-content:space-between;padding:var(--hb-spacing-md)var(--hb-spacing-lg)}.hb-dialog__title{color:var(--hb-color-text-primary);font-size:var(--hb-font-size-lg);font-weight:600}.hb-dialog__close{align-items:center;background:0 0;border:none;border-radius:var(--hb-border-radius-sm);color:var(--hb-color-text-secondary);cursor:pointer;display:inline-flex;height:28px;justify-content:center;padding:0;transition:all var(--hb-transition-duration);width:28px}.hb-dialog__close svg{height:16px;width:16px}.hb-dialog__close:hover{background-color:var(--hb-color-fill-tertiary);color:var(--hb-color-text-primary)}.hb-dialog__body{color:var(--hb-color-text);flex:1;font-size:var(--hb-font-size-base);overflow-y:auto;padding:var(--hb-spacing-lg)}.hb-dialog__footer{align-items:center;border-top:1px solid var(--hb-color-border-secondary);display:flex;gap:var(--hb-spacing-xs);justify-content:flex-end;padding:var(--hb-spacing-sm)var(--hb-spacing-lg)}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}";
|
|
6
6
|
const HbDialogStyle0 = dialogCss;
|
|
7
7
|
|
|
8
8
|
const Dialog = /*@__PURE__*/ proxyCustomElement(class Dialog extends H {
|
|
@@ -42,18 +42,28 @@ const Dialog = /*@__PURE__*/ proxyCustomElement(class Dialog extends H {
|
|
|
42
42
|
zIndex = 0;
|
|
43
43
|
panelRef;
|
|
44
44
|
trap;
|
|
45
|
-
|
|
45
|
+
/** 离场动画期间保留渲染(避免 display:none 打断 transition) */
|
|
46
|
+
leaving = false;
|
|
47
|
+
leaveTimer;
|
|
48
|
+
handleVisibleChange(newVal, oldVal) {
|
|
46
49
|
if (newVal) {
|
|
50
|
+
// 打开:清掉可能残留的离场定时器,重置 leaving
|
|
51
|
+
if (this.leaveTimer) {
|
|
52
|
+
clearTimeout(this.leaveTimer);
|
|
53
|
+
this.leaveTimer = undefined;
|
|
54
|
+
}
|
|
55
|
+
this.leaving = false;
|
|
47
56
|
this.zIndex = getNextZIndex();
|
|
48
57
|
if (this.modal)
|
|
49
58
|
lockScroll();
|
|
50
59
|
this.hbOpen.emit();
|
|
51
60
|
document.addEventListener('keydown', this.handleKeyDown);
|
|
52
61
|
}
|
|
53
|
-
else {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
62
|
+
else if (oldVal) {
|
|
63
|
+
// 关闭(受控或内部触发统一走这里):进入离场动画期,
|
|
64
|
+
// 动画结束(300ms)后才 emit closed + 真正卸载。
|
|
65
|
+
// 仅在「从打开→关闭」时执行,避免已关闭时重复 emit。
|
|
66
|
+
this.startLeave();
|
|
57
67
|
}
|
|
58
68
|
}
|
|
59
69
|
disconnectedCallback() {
|
|
@@ -61,6 +71,8 @@ const Dialog = /*@__PURE__*/ proxyCustomElement(class Dialog extends H {
|
|
|
61
71
|
unlockScroll();
|
|
62
72
|
document.removeEventListener('keydown', this.handleKeyDown);
|
|
63
73
|
this.trap?.disconnect();
|
|
74
|
+
if (this.leaveTimer)
|
|
75
|
+
clearTimeout(this.leaveTimer);
|
|
64
76
|
}
|
|
65
77
|
componentDidRender() {
|
|
66
78
|
if (!this.panelRef)
|
|
@@ -82,24 +94,51 @@ const Dialog = /*@__PURE__*/ proxyCustomElement(class Dialog extends H {
|
|
|
82
94
|
};
|
|
83
95
|
close = () => {
|
|
84
96
|
this.modelValue = false;
|
|
85
|
-
this.
|
|
86
|
-
setTimeout(() => this.hbClosed.emit(), 300);
|
|
97
|
+
this.startLeave();
|
|
87
98
|
};
|
|
99
|
+
/**
|
|
100
|
+
* 进入离场动画期:解锁滚动、移除监听、保留 DOM 播放动画,
|
|
101
|
+
* 结束(300ms)后重置 leaving 并 emit hbClosed。
|
|
102
|
+
* 受控关闭(父组件直接设 modelValue=false 经 @Watch)与内部关闭(ESC/遮罩/关闭按钮)
|
|
103
|
+
* 统一走这里,保证两者行为一致(都有动画 + 都 emit hbClose/hbClosed)。
|
|
104
|
+
*/
|
|
105
|
+
startLeave() {
|
|
106
|
+
if (this.modal)
|
|
107
|
+
unlockScroll();
|
|
108
|
+
document.removeEventListener('keydown', this.handleKeyDown);
|
|
109
|
+
this.hbClose.emit();
|
|
110
|
+
this.leaving = true;
|
|
111
|
+
if (this.leaveTimer)
|
|
112
|
+
clearTimeout(this.leaveTimer);
|
|
113
|
+
this.leaveTimer = setTimeout(() => {
|
|
114
|
+
this.leaving = false;
|
|
115
|
+
this.hbClosed.emit();
|
|
116
|
+
}, 300);
|
|
117
|
+
}
|
|
88
118
|
handleOverlayClick = () => {
|
|
89
119
|
if (this.closeOnClickModal)
|
|
90
120
|
this.close();
|
|
91
121
|
};
|
|
122
|
+
/** 是否应渲染弹层 DOM:打开中 或 离场动画期内 */
|
|
123
|
+
get shouldRender() {
|
|
124
|
+
return this.modelValue || this.leaving;
|
|
125
|
+
}
|
|
92
126
|
render() {
|
|
93
|
-
if (this.destroyOnClose && !this.
|
|
127
|
+
if (this.destroyOnClose && !this.shouldRender)
|
|
94
128
|
return null;
|
|
95
|
-
return (h("div", { class: { 'hb-dialog-wrapper': true, 'hb-dialog-wrapper--hidden': !this.
|
|
129
|
+
return (h("div", { class: { 'hb-dialog-wrapper': true, 'hb-dialog-wrapper--hidden': !this.shouldRender } }, this.modal && (h("div", { class: {
|
|
130
|
+
'hb-dialog__overlay': true,
|
|
131
|
+
'hb-dialog__overlay--visible': this.modelValue,
|
|
132
|
+
'hb-dialog__overlay--leaving': this.leaving,
|
|
133
|
+
}, style: { zIndex: String(this.zIndex) }, onClick: this.handleOverlayClick })), h("div", { ref: el => (this.panelRef = el), class: {
|
|
96
134
|
'hb-dialog': true,
|
|
97
135
|
'hb-dialog--fullscreen': this.fullscreen,
|
|
98
136
|
'hb-dialog--visible': this.modelValue,
|
|
137
|
+
'hb-dialog--leaving': this.leaving,
|
|
99
138
|
}, style: {
|
|
100
139
|
zIndex: String(this.zIndex + 1),
|
|
101
140
|
width: this.fullscreen ? '100%' : this.width,
|
|
102
|
-
}, role: "dialog", "aria-modal": "true" }, h("div", { class: "hb-dialog__header" }, h("span", { class: "hb-dialog__title" }, this.title), this.showClose && (h("button", { type: "button", class: "hb-dialog__close", "aria-label": "\u5173\u95ED", onClick: this.close }, "
|
|
141
|
+
}, role: "dialog", "aria-modal": "true", "aria-hidden": this.modelValue ? 'false' : 'true' }, h("div", { class: "hb-dialog__header" }, h("span", { class: "hb-dialog__title" }, this.title), this.showClose && (h("button", { type: "button", class: "hb-dialog__close", "aria-label": "\u5173\u95ED", onClick: this.close }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": 2, "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M6 6l12 12M18 6L6 18" }))))), h("div", { class: "hb-dialog__body" }, h("slot", null)), h("div", { class: "hb-dialog__footer" }, h("slot", { name: "footer" })))));
|
|
103
142
|
}
|
|
104
143
|
static get watchers() { return {
|
|
105
144
|
"modelValue": ["handleVisibleChange"]
|
|
@@ -114,7 +153,8 @@ const Dialog = /*@__PURE__*/ proxyCustomElement(class Dialog extends H {
|
|
|
114
153
|
"closeOnClickModal": [4, "close-on-click-modal"],
|
|
115
154
|
"closeOnPressEscape": [4, "close-on-press-escape"],
|
|
116
155
|
"showClose": [4, "show-close"],
|
|
117
|
-
"destroyOnClose": [4, "destroy-on-close"]
|
|
156
|
+
"destroyOnClose": [4, "destroy-on-close"],
|
|
157
|
+
"leaving": [32]
|
|
118
158
|
}, undefined, {
|
|
119
159
|
"modelValue": ["handleVisible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GAChC,CACH,EACD,WACE,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,QAAQ,GAAG,EAAiB,CAAC,EAChD,KAAK,EAAE;gBACL,WAAW,EAAE,IAAI;gBACjB,uBAAuB,EAAE,IAAI,CAAC,UAAU;gBACxC,oBAAoB,EAAE,IAAI,CAAC,UAAU;aACtC,EACD,KAAK,EAAE;gBACL,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;gBAC/B,KAAK,EAAE,IAAI,CAAC,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC,KAAK;aAC7C,EACD,IAAI,EAAC,QAAQ,gBACF,MAAM,IAEjB,WAAK,KAAK,EAAC,mBAAmB,IAC5B,YAAM,KAAK,EAAC,kBAAkB,IAAE,IAAI,CAAC,KAAK,CAAQ,EACjD,IAAI,CAAC,SAAS,KACb,cAAQ,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,kBAAkB,gBAAY,cAAI,EAAC,OAAO,EAAE,IAAI,CAAC,KAAK,aAAY,CAC/F,CACG,EACN,WAAK,KAAK,EAAC,iBAAiB,IAC1B,eAAQ,CACJ,EACN,WAAK,KAAK,EAAC,mBAAmB,IAC5B,YAAM,IAAI,EAAC,QAAQ,GAAG,CAClB,CACF,CACF,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/Dialog/dialog.css?tag=hb-dialog&encapsulation=shadow","src/components/Dialog/Dialog.tsx"],"sourcesContent":[":host {\n display: contents;\n}\n\n.hb-dialog-wrapper {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n}\n\n.hb-dialog-wrapper--hidden {\n display: none;\n}\n\n.hb-dialog__overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: var(--hb-color-bg-mask);\n transition: opacity 0.3s;\n pointer-events: auto;\n}\n\n.hb-dialog {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%) scale(0.9);\n background-color: var(--hb-dialog-bg);\n border-radius: var(--hb-dialog-radius);\n box-shadow: var(--hb-dialog-shadow);\n pointer-events: auto;\n opacity: 0;\n transition: opacity 0.3s, transform 0.3s;\n display: flex;\n flex-direction: column;\n max-height: 90vh;\n overflow: hidden;\n}\n\n.hb-dialog--visible {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n}\n\n.hb-dialog--fullscreen {\n width: 100% !important;\n height: 100vh;\n top: 0;\n left: 0;\n transform: none;\n border-radius: 0;\n max-height: 100vh;\n}\n.hb-dialog--fullscreen.hb-dialog--visible {\n transform: none;\n}\n\n.hb-dialog__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--hb-spacing-md) var(--hb-spacing-lg);\n border-bottom: 1px solid var(--hb-color-border-secondary);\n}\n\n.hb-dialog__title {\n font-size: var(--hb-font-size-lg);\n font-weight: 600;\n color: var(--hb-color-text-primary);\n}\n\n.hb-dialog__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: none;\n background: none;\n font-size: 18px;\n color: var(--hb-color-text-secondary);\n cursor: pointer;\n border-radius: var(--hb-border-radius-sm);\n transition: all var(--hb-transition-duration);\n}\n\n.hb-dialog__close:hover {\n background-color: var(--hb-color-fill-tertiary);\n color: var(--hb-color-text-primary);\n}\n\n.hb-dialog__body {\n flex: 1;\n padding: var(--hb-spacing-lg);\n overflow-y: auto;\n color: var(--hb-color-text);\n font-size: var(--hb-font-size-base);\n}\n\n.hb-dialog__footer {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: var(--hb-spacing-xs);\n padding: var(--hb-spacing-sm) var(--hb-spacing-lg);\n border-top: 1px solid var(--hb-color-border-secondary);\n}\n","import { Component, h, Prop, Event, EventEmitter, Watch, Element } from '@stencil/core';\nimport { lockScroll, unlockScroll, getNextZIndex } from '../../utils/popup-manager';\nimport { createFocusTrap, FocusTrap } from '../../utils/a11y';\n\n/**\n * Dialog 对话框组件\n * 在保留当前页面状态的情况下,告知用户并承载相关操作\n */\n@Component({\n tag: 'hb-dialog',\n styleUrl: 'dialog.css',\n shadow: true,\n})\nexport class Dialog {\n @Element() el: HTMLElement;\n\n /** 是否显示 */\n @Prop({ mutable: true }) modelValue: boolean = false;\n\n /** 标题 */\n @Prop() title: string = '';\n\n /** 宽度 */\n @Prop() width: string = '50%';\n\n /** 是否全屏 */\n @Prop() fullscreen: boolean = false;\n\n /** 是否显示遮罩 */\n @Prop() modal: boolean = true;\n\n /** 是否点击遮罩关闭 */\n @Prop() closeOnClickModal: boolean = true;\n\n /** 是否按 ESC 关闭 */\n @Prop() closeOnPressEscape: boolean = true;\n\n /** 是否显示关闭按钮 */\n @Prop() showClose: boolean = true;\n\n /** 关闭时销毁 */\n @Prop() destroyOnClose: boolean = false;\n\n /** 打开事件 */\n @Event() hbOpen: EventEmitter<void>;\n\n /** 关闭事件 */\n @Event() hbClose: EventEmitter<void>;\n\n /** 已关闭动画结束事件 */\n @Event() hbClosed: EventEmitter<void>;\n\n private zIndex: number = 0;\n private panelRef?: HTMLElement;\n private trap?: FocusTrap;\n\n @Watch('modelValue')\n handleVisibleChange(newVal: boolean) {\n if (newVal) {\n this.zIndex = getNextZIndex();\n if (this.modal) lockScroll();\n this.hbOpen.emit();\n document.addEventListener('keydown', this.handleKeyDown);\n } else {\n if (this.modal) unlockScroll();\n document.removeEventListener('keydown', this.handleKeyDown);\n }\n }\n\n disconnectedCallback() {\n if (this.modelValue && this.modal) unlockScroll();\n document.removeEventListener('keydown', this.handleKeyDown);\n this.trap?.disconnect();\n }\n\n componentDidRender() {\n if (!this.panelRef) return;\n if (this.modelValue) {\n if (!this.trap) {\n this.trap = createFocusTrap({ container: this.panelRef });\n }\n this.trap.connect();\n } else {\n this.trap?.disconnect();\n }\n }\n\n private handleKeyDown = (e: KeyboardEvent) => {\n if (this.closeOnPressEscape && e.key === 'Escape') {\n this.close();\n }\n };\n\n private close = () => {\n this.modelValue = false;\n this.hbClose.emit();\n setTimeout(() => this.hbClosed.emit(), 300);\n };\n\n private handleOverlayClick = () => {\n if (this.closeOnClickModal) this.close();\n };\n\n render() {\n if (this.destroyOnClose && !this.modelValue) return null;\n\n return (\n <div class={{ 'hb-dialog-wrapper': true, 'hb-dialog-wrapper--hidden': !this.modelValue }}>\n {this.modal && (\n <div\n class=\"hb-dialog__overlay\"\n style={{ zIndex: String(this.zIndex) }}\n onClick={this.handleOverlayClick}\n />\n )}\n <div\n ref={(el) => (this.panelRef = el as HTMLElement)}\n class={{\n 'hb-dialog': true,\n 'hb-dialog--fullscreen': this.fullscreen,\n 'hb-dialog--visible': this.modelValue,\n }}\n style={{\n zIndex: String(this.zIndex + 1),\n width: this.fullscreen ? '100%' : this.width,\n }}\n role=\"dialog\"\n aria-modal=\"true\"\n >\n <div class=\"hb-dialog__header\">\n <span class=\"hb-dialog__title\">{this.title}</span>\n {this.showClose && (\n <button type=\"button\" class=\"hb-dialog__close\" aria-label=\"关闭\" onClick={this.close}>×</button>\n )}\n </div>\n <div class=\"hb-dialog__body\">\n <slot />\n </div>\n <div class=\"hb-dialog__footer\">\n <slot name=\"footer\" />\n </div>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"hb-dialog.js","mappings":";;;;AAAA,MAAM,SAAS,GAAG,wtQAAwtQ,CAAC;AAC3uQ,uBAAe,SAAS;;MCYX,MAAM;;;;;;;;;;;IAIQ,UAAU,GAAY,KAAK,CAAC;;IAG7C,KAAK,GAAW,EAAE,CAAC;;IAGnB,KAAK,GAAW,KAAK,CAAC;;IAGtB,UAAU,GAAY,KAAK,CAAC;;IAG5B,KAAK,GAAY,IAAI,CAAC;;IAGtB,iBAAiB,GAAY,IAAI,CAAC;;IAGlC,kBAAkB,GAAY,IAAI,CAAC;;IAGnC,SAAS,GAAY,IAAI,CAAC;;IAG1B,cAAc,GAAY,KAAK,CAAC;;IAG/B,MAAM,CAAqB;;IAG3B,O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B,GAAG,CAC7B,CACC,CACV,CACG,EACN,WAAK,KAAK,EAAC,iBAAiB,IAC1B,eAAQ,CACJ,EACN,WAAK,KAAK,EAAC,mBAAmB,IAC5B,YAAM,IAAI,EAAC,QAAQ,GAAG,CAClB,CACF,CACF,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/Dialog/dialog.css?tag=hb-dialog&encapsulation=shadow","src/components/Dialog/Dialog.tsx"],"sourcesContent":[":host {\n display: contents;\n}\n\n.hb-dialog-wrapper {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n}\n\n.hb-dialog-wrapper--hidden {\n display: none;\n}\n\n.hb-dialog__overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: var(--hb-color-bg-mask);\n pointer-events: auto;\n /* 进场:opacity 0 → 1;离场由 --leaving class 反向播放 */\n animation: hb-dialog-overlay-in 0.3s ease both;\n}\n\n.hb-dialog__overlay--leaving {\n animation: hb-dialog-overlay-out 0.3s ease both;\n}\n\n@keyframes hb-dialog-overlay-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes hb-dialog-overlay-out {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n.hb-dialog {\n position: fixed;\n top: 50%;\n left: 50%;\n background-color: var(--hb-dialog-bg);\n border-radius: var(--hb-dialog-radius);\n box-shadow: var(--hb-dialog-shadow);\n pointer-events: auto;\n display: flex;\n flex-direction: column;\n max-height: 90vh;\n overflow: hidden;\n /* 进场:opacity + scale(对齐 antd Modal 的 fade+zoom) */\n animation: hb-dialog-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;\n}\n\n.hb-dialog--leaving {\n animation: hb-dialog-out 0.3s cubic-bezier(0.5, 0, 0.75, 0) both;\n}\n\n@keyframes hb-dialog-in {\n from {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.9);\n }\n to {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n@keyframes hb-dialog-out {\n from {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n to {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.95);\n }\n}\n\n.hb-dialog--fullscreen {\n width: 100% !important;\n height: 100vh;\n top: 0;\n left: 0;\n border-radius: 0;\n max-height: 100vh;\n}\n.hb-dialog--fullscreen,\n.hb-dialog--fullscreen.hb-dialog--leaving {\n animation: none;\n}\n\n.hb-dialog__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--hb-spacing-md) var(--hb-spacing-lg);\n border-bottom: 1px solid var(--hb-color-border-secondary);\n}\n\n.hb-dialog__title {\n font-size: var(--hb-font-size-lg);\n font-weight: 600;\n color: var(--hb-color-text-primary);\n}\n\n.hb-dialog__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: none;\n background: none;\n color: var(--hb-color-text-secondary);\n cursor: pointer;\n border-radius: var(--hb-border-radius-sm);\n transition: all var(--hb-transition-duration);\n padding: 0;\n}\n\n.hb-dialog__close svg {\n width: 16px;\n height: 16px;\n}\n\n.hb-dialog__close:hover {\n background-color: var(--hb-color-fill-tertiary);\n color: var(--hb-color-text-primary);\n}\n\n.hb-dialog__body {\n flex: 1;\n padding: var(--hb-spacing-lg);\n overflow-y: auto;\n color: var(--hb-color-text);\n font-size: var(--hb-font-size-base);\n}\n\n.hb-dialog__footer {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: var(--hb-spacing-xs);\n padding: var(--hb-spacing-sm) var(--hb-spacing-lg);\n border-top: 1px solid var(--hb-color-border-secondary);\n}\n","import { Component, h, Prop, Event, EventEmitter, Watch, Element, State } from '@stencil/core';\nimport { lockScroll, unlockScroll, getNextZIndex } from '../../utils/popup-manager';\nimport { createFocusTrap, FocusTrap } from '../../utils/a11y';\n\n/**\n * Dialog 对话框组件\n * 在保留当前页面状态的情况下,告知用户并承载相关操作\n */\n@Component({\n tag: 'hb-dialog',\n styleUrl: 'dialog.css',\n shadow: true,\n})\nexport class Dialog {\n @Element() el: HTMLElement;\n\n /** 是否显示 */\n @Prop({ mutable: true }) modelValue: boolean = false;\n\n /** 标题 */\n @Prop() title: string = '';\n\n /** 宽度 */\n @Prop() width: string = '50%';\n\n /** 是否全屏 */\n @Prop() fullscreen: boolean = false;\n\n /** 是否显示遮罩 */\n @Prop() modal: boolean = true;\n\n /** 是否点击遮罩关闭 */\n @Prop() closeOnClickModal: boolean = true;\n\n /** 是否按 ESC 关闭 */\n @Prop() closeOnPressEscape: boolean = true;\n\n /** 是否显示关闭按钮 */\n @Prop() showClose: boolean = true;\n\n /** 关闭时销毁 */\n @Prop() destroyOnClose: boolean = false;\n\n /** 打开事件 */\n @Event() hbOpen: EventEmitter<void>;\n\n /** 关闭事件 */\n @Event() hbClose: EventEmitter<void>;\n\n /** 已关闭动画结束事件 */\n @Event() hbClosed: EventEmitter<void>;\n\n private zIndex: number = 0;\n private panelRef?: HTMLElement;\n private trap?: FocusTrap;\n /** 离场动画期间保留渲染(避免 display:none 打断 transition) */\n @State() leaving: boolean = false;\n private leaveTimer?: ReturnType<typeof setTimeout>;\n\n @Watch('modelValue')\n handleVisibleChange(newVal: boolean, oldVal: boolean) {\n if (newVal) {\n // 打开:清掉可能残留的离场定时器,重置 leaving\n if (this.leaveTimer) {\n clearTimeout(this.leaveTimer);\n this.leaveTimer = undefined;\n }\n this.leaving = false;\n this.zIndex = getNextZIndex();\n if (this.modal) lockScroll();\n this.hbOpen.emit();\n document.addEventListener('keydown', this.handleKeyDown);\n } else if (oldVal) {\n // 关闭(受控或内部触发统一走这里):进入离场动画期,\n // 动画结束(300ms)后才 emit closed + 真正卸载。\n // 仅在「从打开→关闭」时执行,避免已关闭时重复 emit。\n this.startLeave();\n }\n }\n\n disconnectedCallback() {\n if (this.modelValue && this.modal) unlockScroll();\n document.removeEventListener('keydown', this.handleKeyDown);\n this.trap?.disconnect();\n if (this.leaveTimer) clearTimeout(this.leaveTimer);\n }\n\n componentDidRender() {\n if (!this.panelRef) return;\n if (this.modelValue) {\n if (!this.trap) {\n this.trap = createFocusTrap({ container: this.panelRef });\n }\n this.trap.connect();\n } else {\n this.trap?.disconnect();\n }\n }\n\n private handleKeyDown = (e: KeyboardEvent) => {\n if (this.closeOnPressEscape && e.key === 'Escape') {\n this.close();\n }\n };\n\n private close = () => {\n this.modelValue = false;\n this.startLeave();\n };\n\n /**\n * 进入离场动画期:解锁滚动、移除监听、保留 DOM 播放动画,\n * 结束(300ms)后重置 leaving 并 emit hbClosed。\n * 受控关闭(父组件直接设 modelValue=false 经 @Watch)与内部关闭(ESC/遮罩/关闭按钮)\n * 统一走这里,保证两者行为一致(都有动画 + 都 emit hbClose/hbClosed)。\n */\n private startLeave() {\n if (this.modal) unlockScroll();\n document.removeEventListener('keydown', this.handleKeyDown);\n this.hbClose.emit();\n this.leaving = true;\n if (this.leaveTimer) clearTimeout(this.leaveTimer);\n this.leaveTimer = setTimeout(() => {\n this.leaving = false;\n this.hbClosed.emit();\n }, 300);\n }\n\n private handleOverlayClick = () => {\n if (this.closeOnClickModal) this.close();\n };\n\n /** 是否应渲染弹层 DOM:打开中 或 离场动画期内 */\n private get shouldRender(): boolean {\n return this.modelValue || this.leaving;\n }\n\n render() {\n if (this.destroyOnClose && !this.shouldRender) return null;\n\n return (\n <div class={{ 'hb-dialog-wrapper': true, 'hb-dialog-wrapper--hidden': !this.shouldRender }}>\n {this.modal && (\n <div\n class={{\n 'hb-dialog__overlay': true,\n 'hb-dialog__overlay--visible': this.modelValue,\n 'hb-dialog__overlay--leaving': this.leaving,\n }}\n style={{ zIndex: String(this.zIndex) }}\n onClick={this.handleOverlayClick}\n />\n )}\n <div\n ref={el => (this.panelRef = el as HTMLElement)}\n class={{\n 'hb-dialog': true,\n 'hb-dialog--fullscreen': this.fullscreen,\n 'hb-dialog--visible': this.modelValue,\n 'hb-dialog--leaving': this.leaving,\n }}\n style={{\n zIndex: String(this.zIndex + 1),\n width: this.fullscreen ? '100%' : this.width,\n }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden={this.modelValue ? 'false' : 'true'}\n >\n <div class=\"hb-dialog__header\">\n <span class=\"hb-dialog__title\">{this.title}</span>\n {this.showClose && (\n <button type=\"button\" class=\"hb-dialog__close\" aria-label=\"关闭\" onClick={this.close}>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width={2} stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M6 6l12 12M18 6L6 18\" />\n </svg>\n </button>\n )}\n </div>\n <div class=\"hb-dialog__body\">\n <slot />\n </div>\n <div class=\"hb-dialog__footer\">\n <slot name=\"footer\" />\n </div>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -18,13 +18,13 @@ const Divider = /*@__PURE__*/ proxyCustomElement(class Divider extends H {
|
|
|
18
18
|
dashed = false;
|
|
19
19
|
render() {
|
|
20
20
|
const hasContent = this.el.childNodes.length > 0;
|
|
21
|
-
return (h("div", { key: '
|
|
21
|
+
return (h("div", { key: '72f2e4f0e52b38799b0c292e99565c683a2b455c', class: {
|
|
22
22
|
'hb-divider': true,
|
|
23
23
|
[`hb-divider--${this.direction}`]: true,
|
|
24
24
|
'hb-divider--dashed': this.dashed,
|
|
25
25
|
'hb-divider--with-text': hasContent,
|
|
26
26
|
[`hb-divider--with-text-${this.contentPosition}`]: hasContent,
|
|
27
|
-
} }, h("div", { key: '
|
|
27
|
+
} }, h("div", { key: 'afe16a81dee380655eaa42090dd1b760e9403e8c', class: "hb-divider__line hb-divider__line--before" }), h("div", { key: '9b64b270790df8794ae9bbbe13783fc1b77367f1', class: "hb-divider__text" }, h("slot", { key: '9e9a5a024fa6212026cca8e9e8d76e84af6523cb' })), h("div", { key: '6277539ebf37f4e295e8b9d9a8ce912de15efa71', class: "hb-divider__line hb-divider__line--after" })));
|
|
28
28
|
}
|
|
29
29
|
static get style() { return HbDividerStyle0; }
|
|
30
30
|
}, [1, "hb-divider", {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h } from './p-1407a5e8.js';
|
|
2
2
|
import { g as getNextZIndex, l as lockScroll, u as unlockScroll } from './p-ecce2b5e.js';
|
|
3
|
-
import { c as createFocusTrap } from './p-
|
|
3
|
+
import { c as createFocusTrap } from './p-00aa34c8.js';
|
|
4
4
|
|
|
5
|
-
const drawerCss = "/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{appearance:button;background-color:#0000;border:0 solid;border-radius:0;box-sizing:border-box;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;margin:0;margin-inline-end:4px;opacity:1;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);line-height:1.5;tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex;padding-block:0}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.container{width:100%}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}} /*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{}@layer base{}@layer components;:host{display:contents}.hb-drawer-wrapper{inset:0;pointer-events:none;position:fixed;z-index:1000}.hb-drawer__overlay{background:var(--hb-color-bg-mask);inset:0;
|
|
5
|
+
const drawerCss = "/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{appearance:button;background-color:#0000;border:0 solid;border-radius:0;box-sizing:border-box;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;margin:0;margin-inline-end:4px;opacity:1;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);line-height:1.5;tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex;padding-block:0}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.container{width:100%}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}} /*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{}@layer base{}@layer components;:host{display:contents}.hb-drawer-wrapper{inset:0;pointer-events:none;position:fixed;z-index:1000}.hb-drawer-wrapper:not(.hb-drawer-wrapper--visible){display:none}.hb-drawer__overlay{animation:hb-drawer-overlay-in .3s both;background:var(--hb-color-bg-mask);inset:0;pointer-events:auto;position:fixed}.hb-drawer__overlay--leaving{animation:hb-drawer-overlay-out .3s both}@keyframes hb-drawer-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes hb-drawer-overlay-out{0%{opacity:1}to{opacity:0}}.hb-drawer{background:var(--hb-color-bg-elevated);box-shadow:var(--hb-box-shadow-lg);display:flex;flex-direction:column;pointer-events:auto;position:fixed}.hb-drawer--rtl{bottom:0;right:0;top:0}.hb-drawer--ltr{bottom:0;left:0;top:0}.hb-drawer--ttb{left:0;right:0;top:0}.hb-drawer--btt{bottom:0;left:0;right:0}.hb-drawer--visible.hb-drawer--rtl{animation:hb-drawer-in-rtl .3s cubic-bezier(.16,1,.3,1) both}.hb-drawer--visible.hb-drawer--ltr{animation:hb-drawer-in-ltr .3s cubic-bezier(.16,1,.3,1) both}.hb-drawer--visible.hb-drawer--ttb{animation:hb-drawer-in-ttb .3s cubic-bezier(.16,1,.3,1) both}.hb-drawer--visible.hb-drawer--btt{animation:hb-drawer-in-btt .3s cubic-bezier(.16,1,.3,1) both}.hb-drawer--leaving.hb-drawer--rtl{animation:hb-drawer-out-rtl .3s cubic-bezier(.5,0,.75,0) both}.hb-drawer--leaving.hb-drawer--ltr{animation:hb-drawer-out-ltr .3s cubic-bezier(.5,0,.75,0) both}.hb-drawer--leaving.hb-drawer--ttb{animation:hb-drawer-out-ttb .3s cubic-bezier(.5,0,.75,0) both}.hb-drawer--leaving.hb-drawer--btt{animation:hb-drawer-out-btt .3s cubic-bezier(.5,0,.75,0) both}@keyframes hb-drawer-in-rtl{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes hb-drawer-out-rtl{0%{transform:translate(0)}to{transform:translate(100%)}}@keyframes hb-drawer-in-ltr{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes hb-drawer-out-ltr{0%{transform:translate(0)}to{transform:translate(-100%)}}@keyframes hb-drawer-in-ttb{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes hb-drawer-out-ttb{0%{transform:translateY(0)}to{transform:translateY(-100%)}}@keyframes hb-drawer-in-btt{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes hb-drawer-out-btt{0%{transform:translateY(0)}to{transform:translateY(100%)}}.hb-drawer__header{align-items:center;border-bottom:1px solid var(--hb-color-border-secondary);display:flex;justify-content:space-between;padding:var(--hb-spacing-md)var(--hb-spacing-lg)}.hb-drawer__title{font-size:var(--hb-font-size-lg);font-weight:600}.hb-drawer__close{align-items:center;background:0 0;border:none;border-radius:var(--hb-border-radius-sm);color:var(--hb-color-text-secondary);cursor:pointer;display:flex;height:28px;justify-content:center;padding:0;transition:all var(--hb-transition-duration);width:28px}.hb-drawer__close svg{height:16px;width:16px}.hb-drawer__close:hover{background:var(--hb-color-fill-tertiary);color:var(--hb-color-text-primary)}.hb-drawer__body{flex:1;overflow-y:auto;padding:var(--hb-spacing-lg)}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}";
|
|
6
6
|
const HbDrawerStyle0 = drawerCss;
|
|
7
7
|
|
|
8
8
|
const Drawer = /*@__PURE__*/ proxyCustomElement(class Drawer extends H {
|
|
@@ -26,10 +26,18 @@ const Drawer = /*@__PURE__*/ proxyCustomElement(class Drawer extends H {
|
|
|
26
26
|
zIndex = 0;
|
|
27
27
|
panelRef;
|
|
28
28
|
trap;
|
|
29
|
+
/** 离场动画期内保留渲染 */
|
|
30
|
+
leaving = false;
|
|
31
|
+
leaveTimer;
|
|
29
32
|
hbOpen;
|
|
30
33
|
hbClose;
|
|
31
34
|
handleVisible(val) {
|
|
32
35
|
if (val) {
|
|
36
|
+
if (this.leaveTimer) {
|
|
37
|
+
clearTimeout(this.leaveTimer);
|
|
38
|
+
this.leaveTimer = undefined;
|
|
39
|
+
}
|
|
40
|
+
this.leaving = false;
|
|
33
41
|
this.zIndex = getNextZIndex();
|
|
34
42
|
this.zIndexState = this.zIndex;
|
|
35
43
|
if (this.modal)
|
|
@@ -42,6 +50,13 @@ const Drawer = /*@__PURE__*/ proxyCustomElement(class Drawer extends H {
|
|
|
42
50
|
unlockScroll();
|
|
43
51
|
this.hbClose.emit();
|
|
44
52
|
document.removeEventListener('keydown', this.handleKeyDown);
|
|
53
|
+
// 进入离场动画期,结束后真正卸载
|
|
54
|
+
this.leaving = true;
|
|
55
|
+
if (this.leaveTimer)
|
|
56
|
+
clearTimeout(this.leaveTimer);
|
|
57
|
+
this.leaveTimer = setTimeout(() => {
|
|
58
|
+
this.leaving = false;
|
|
59
|
+
}, 300);
|
|
45
60
|
}
|
|
46
61
|
}
|
|
47
62
|
componentDidRender() {
|
|
@@ -62,19 +77,34 @@ const Drawer = /*@__PURE__*/ proxyCustomElement(class Drawer extends H {
|
|
|
62
77
|
unlockScroll();
|
|
63
78
|
document.removeEventListener('keydown', this.handleKeyDown);
|
|
64
79
|
this.trap?.disconnect();
|
|
80
|
+
if (this.leaveTimer)
|
|
81
|
+
clearTimeout(this.leaveTimer);
|
|
65
82
|
}
|
|
66
83
|
handleKeyDown = (e) => {
|
|
67
84
|
if (this.closeOnPressEscape && e.key === 'Escape') {
|
|
68
85
|
this.close();
|
|
69
86
|
}
|
|
70
87
|
};
|
|
71
|
-
close = () => {
|
|
88
|
+
close = () => {
|
|
89
|
+
this.modelValue = false;
|
|
90
|
+
};
|
|
91
|
+
get shouldRender() {
|
|
92
|
+
return this.modelValue || this.leaving;
|
|
93
|
+
}
|
|
72
94
|
render() {
|
|
73
95
|
const dir = this.direction;
|
|
74
96
|
const isVertical = dir === 'ttb' || dir === 'btt';
|
|
75
97
|
const sizeStyle = isVertical ? { height: this.size } : { width: this.size };
|
|
76
98
|
const translateClass = `hb-drawer--${dir}`;
|
|
77
|
-
return (h("div", { key: '
|
|
99
|
+
return (h("div", { key: '1b19a23690272c043ad80a8f4ad01470ef1f6627', class: { 'hb-drawer-wrapper': true, 'hb-drawer-wrapper--visible': this.shouldRender } }, this.modal && (h("div", { key: '6f1492a485eeb634e59a50300be5ad8af6ebfdcb', class: {
|
|
100
|
+
'hb-drawer__overlay': true,
|
|
101
|
+
'hb-drawer__overlay--leaving': this.leaving,
|
|
102
|
+
}, style: { zIndex: String(this.zIndexState) }, onClick: () => this.closeOnClickModal && this.close() })), h("div", { key: '4276468b6d5c2bc8628ccefeafc0de7acf372931', ref: el => (this.panelRef = el), class: {
|
|
103
|
+
'hb-drawer': true,
|
|
104
|
+
[translateClass]: true,
|
|
105
|
+
'hb-drawer--visible': this.modelValue,
|
|
106
|
+
'hb-drawer--leaving': this.leaving,
|
|
107
|
+
}, style: { ...sizeStyle, zIndex: String(this.zIndexState + 1) }, role: "dialog", "aria-modal": "true", "aria-label": this.title || undefined, "aria-hidden": this.modelValue ? 'false' : 'true' }, h("div", { key: '66c7aa0843425292845c3a3c5841abaca233efd4', class: "hb-drawer__header" }, h("span", { key: '07226dc7437adb12e0d08ccf2259c6e470d4eea3', class: "hb-drawer__title" }, this.title), this.showClose && (h("button", { key: '2658edb09e334c02fa0218b414c354b4cbb20220', type: "button", class: "hb-drawer__close", "aria-label": "\u5173\u95ED", onClick: this.close }, h("svg", { key: '8ad5e5558c02fdb0271fa93d6fa279dee949d9f0', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": 2, "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { key: 'ff3585922cdeb73e68dbf1755092ade914579506', d: "M6 6l12 12M18 6L6 18" }))))), h("div", { key: 'b64ddf86b2f5a0344b80e7fb729c19a2d6d6fe5c', class: "hb-drawer__body" }, h("slot", { key: '3e3904d5d149a765130eb5f59ac1d268d48c39f6' })))));
|
|
78
108
|
}
|
|
79
109
|
static get watchers() { return {
|
|
80
110
|
"modelValue": ["handleVisible"]
|
|
@@ -89,7 +119,8 @@ const Drawer = /*@__PURE__*/ proxyCustomElement(class Drawer extends H {
|
|
|
89
119
|
"showClose": [4, "show-close"],
|
|
90
120
|
"modal": [4],
|
|
91
121
|
"closeOnPressEscape": [4, "close-on-press-escape"],
|
|
92
|
-
"zIndexState": [32]
|
|
122
|
+
"zIndexState": [32],
|
|
123
|
+
"leaving": [32]
|
|
93
124
|
}, undefined, {
|
|
94
125
|
"modelValue": ["handleVisible"]
|
|
95
126
|
}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"hb-drawer.js","mappings":";;;;AAAA,MAAM,SAAS,GAAG,+1OAA+1O,CAAC;AACl3O,uBAAe,SAAS;;MCIX,MAAM;;;;;;;;IACQ,UAAU,GAAY,KAAK,CAAC;IAC7C,KAAK,GAAW,EAAE,CAAC;IACnB,IAAI,GAAW,KAAK,CAAC;IACrB,SAAS,GAAkC,KAAK,CAAC;IACjD,iBAAiB,GAAY,IAAI,CAAC;IAClC,SAAS,GAAY,IAAI,CAAC;IAC1B,KAAK,GAAY,IAAI,CAAC;;IAEtB,kBAAkB,GAAY,IAAI,CAAC;IAC1B,WAAW,GAAW,CAAC,CAAC;IACjC,MAAM,GAAW,CAAC,CAAC;IACnB,QAAQ,C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mBAAmB,IAC5B,6DAAM,KAAK,EAAC,kBAAkB,IAAE,IAAI,CAAC,KAAK,CAAQ,EACjD,IAAI,CAAC,SAAS,IAAI,+DAAQ,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,kBAAkB,gBAAY,cAAI,EAAC,OAAO,EAAE,IAAI,CAAC,KAAK,aAAY,CAC7G,EACN,4DAAK,KAAK,EAAC,iBAAiB,IAAC,8DAAQ,CAAM,CACvC,CACF,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/Drawer/drawer.css?tag=hb-drawer&encapsulation=shadow","src/components/Drawer/Drawer.tsx"],"sourcesContent":[":host { display: contents; }\n.hb-drawer-wrapper { position: fixed; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 1000; }\n.hb-drawer__overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--hb-color-bg-mask); pointer-events: auto; transition: opacity 0.3s; }\n.hb-drawer {\n position: fixed; background: var(--hb-color-bg-elevated); box-shadow: var(--hb-box-shadow-lg);\n display: flex; flex-direction: column; pointer-events: auto; transition: transform 0.3s ease;\n}\n.hb-drawer--rtl { top: 0; right: 0; bottom: 0; transform: translateX(100%); }\n.hb-drawer--ltr { top: 0; left: 0; bottom: 0; transform: translateX(-100%); }\n.hb-drawer--ttb { left: 0; right: 0; top: 0; transform: translateY(-100%); }\n.hb-drawer--btt { left: 0; right: 0; bottom: 0; transform: translateY(100%); }\n.hb-drawer--visible.hb-drawer--rtl, .hb-drawer--visible.hb-drawer--ltr { transform: translateX(0); }\n.hb-drawer--visible.hb-drawer--ttb, .hb-drawer--visible.hb-drawer--btt { transform: translateY(0); }\n.hb-drawer__header { display: flex; align-items: center; justify-content: space-between; padding: var(--hb-spacing-md) var(--hb-spacing-lg); border-bottom: 1px solid var(--hb-color-border-secondary); }\n.hb-drawer__title { font-size: var(--hb-font-size-lg); font-weight: 600; }\n.hb-drawer__close { border: none; background: none; font-size: 18px; cursor: pointer; color: var(--hb-color-text-secondary); width: 28px; height: 28px; border-radius: var(--hb-border-radius-sm); display: flex; align-items: center; justify-content: center; }\n.hb-drawer__close:hover { background: var(--hb-color-fill-tertiary); }\n.hb-drawer__body { flex: 1; padding: var(--hb-spacing-lg); overflow-y: auto; }\n","import { Component, h, Prop, Event, EventEmitter, Watch, State } from '@stencil/core';\nimport { lockScroll, unlockScroll, getNextZIndex } from '../../utils/popup-manager';\nimport { createFocusTrap, FocusTrap } from '../../utils/a11y';\n\n@Component({ tag: 'hb-drawer', styleUrl: 'drawer.css', shadow: true })\nexport class Drawer {\n @Prop({ mutable: true }) modelValue: boolean = false;\n @Prop() title: string = '';\n @Prop() size: string = '30%';\n @Prop() direction: 'ltr' | 'rtl' | 'ttb' | 'btt' = 'rtl';\n @Prop() closeOnClickModal: boolean = true;\n @Prop() showClose: boolean = true;\n @Prop() modal: boolean = true;\n /** 是否按 ESC 关闭 */\n @Prop() closeOnPressEscape: boolean = true;\n @State() private zIndexState: number = 0;\n private zIndex: number = 0;\n private panelRef?: HTMLElement;\n private trap?: FocusTrap;\n\n @Event() hbOpen: EventEmitter<void>;\n @Event() hbClose: EventEmitter<void>;\n\n @Watch('modelValue')\n handleVisible(val: boolean) {\n if (val) {\n this.zIndex = getNextZIndex();\n this.zIndexState = this.zIndex;\n if (this.modal) lockScroll();\n this.hbOpen.emit();\n document.addEventListener('keydown', this.handleKeyDown);\n } else {\n if (this.modal) unlockScroll();\n this.hbClose.emit();\n document.removeEventListener('keydown', this.handleKeyDown);\n }\n }\n\n componentDidRender() {\n if (!this.panelRef) return;\n if (this.modelValue) {\n if (!this.trap) {\n this.trap = createFocusTrap({ container: this.panelRef });\n }\n this.trap.connect();\n } else {\n this.trap?.disconnect();\n }\n }\n\n disconnectedCallback() {\n if (this.modelValue && this.modal) unlockScroll();\n document.removeEventListener('keydown', this.handleKeyDown);\n this.trap?.disconnect();\n }\n\n private handleKeyDown = (e: KeyboardEvent) => {\n if (this.closeOnPressEscape && e.key === 'Escape') {\n this.close();\n }\n };\n\n private close = () => { this.modelValue = false; };\n\n render() {\n const dir = this.direction;\n const isVertical = dir === 'ttb' || dir === 'btt';\n const sizeStyle = isVertical ? { height: this.size } : { width: this.size };\n const translateClass = `hb-drawer--${dir}`;\n\n return (\n <div class={{ 'hb-drawer-wrapper': true, 'hb-drawer-wrapper--visible': this.modelValue }}>\n {this.modal && <div class=\"hb-drawer__overlay\" style={{ zIndex: String(this.zIndexState) }} onClick={() => this.closeOnClickModal && this.close()} />}\n <div\n ref={(el) => (this.panelRef = el as HTMLElement)}\n class={{ 'hb-drawer': true, [translateClass]: true, 'hb-drawer--visible': this.modelValue }}\n style={{ ...sizeStyle, zIndex: String(this.zIndexState + 1) }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={this.title || undefined}\n >\n <div class=\"hb-drawer__header\">\n <span class=\"hb-drawer__title\">{this.title}</span>\n {this.showClose && <button type=\"button\" class=\"hb-drawer__close\" aria-label=\"关闭\" onClick={this.close}>×</button>}\n </div>\n <div class=\"hb-drawer__body\"><slot /></div>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"hb-drawer.js","mappings":";;;;AAAA,MAAM,SAAS,GAAG,81RAA81R,CAAC;AACj3R,uBAAe,SAAS;;MCIX,MAAM;;;;;;;;IACQ,UAAU,GAAY,KAAK,CAAC;IAC7C,KAAK,GAAW,EAAE,CAAC;IACnB,IAAI,GAAW,KAAK,CAAC;IACrB,SAAS,GAAkC,KAAK,CAAC;IACjD,iBAAiB,GAAY,IAAI,CAAC;IAClC,SAAS,GAAY,IAAI,CAAC;IAC1B,KAAK,GAAY,IAAI,CAAC;;IAEtB,kBAAkB,GAAY,IAAI,CAAC;IAC1B,WAAW,GAAW,CAAC,CAAC;IACjC,MAAM,GAAW,CAAC,CAAC;IACnB,QAAQ,CAAe;IACvB,IAAI,CAAa;;IAER,OAAO,GAAY,KAAK,CAAC;IAClC,UAAU,CAAiC;I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ources":["src/components/Drawer/drawer.css?tag=hb-drawer&encapsulation=shadow","src/components/Drawer/Drawer.tsx"],"sourcesContent":[":host {\n display: contents;\n}\n.hb-drawer-wrapper {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n z-index: 1000;\n}\n\n/* wrapper 默认不显示(modelValue=false 且离场结束时);打开/离场期都可见 */\n.hb-drawer-wrapper:not(.hb-drawer-wrapper--visible) {\n display: none;\n}\n\n.hb-drawer__overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: var(--hb-color-bg-mask);\n pointer-events: auto;\n animation: hb-drawer-overlay-in 0.3s ease both;\n}\n.hb-drawer__overlay--leaving {\n animation: hb-drawer-overlay-out 0.3s ease both;\n}\n@keyframes hb-drawer-overlay-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes hb-drawer-overlay-out {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n.hb-drawer {\n position: fixed;\n background: var(--hb-color-bg-elevated);\n box-shadow: var(--hb-box-shadow-lg);\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n}\n\n/* 四方向进场动画(从屏外滑入)。visible 时播放 in;leaving 时播放 out */\n.hb-drawer--rtl {\n top: 0;\n right: 0;\n bottom: 0;\n}\n.hb-drawer--ltr {\n top: 0;\n left: 0;\n bottom: 0;\n}\n.hb-drawer--ttb {\n left: 0;\n right: 0;\n top: 0;\n}\n.hb-drawer--btt {\n left: 0;\n right: 0;\n bottom: 0;\n}\n\n.hb-drawer--visible.hb-drawer--rtl {\n animation: hb-drawer-in-rtl 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;\n}\n.hb-drawer--visible.hb-drawer--ltr {\n animation: hb-drawer-in-ltr 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;\n}\n.hb-drawer--visible.hb-drawer--ttb {\n animation: hb-drawer-in-ttb 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;\n}\n.hb-drawer--visible.hb-drawer--btt {\n animation: hb-drawer-in-btt 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;\n}\n\n.hb-drawer--leaving.hb-drawer--rtl {\n animation: hb-drawer-out-rtl 0.3s cubic-bezier(0.5, 0, 0.75, 0) both;\n}\n.hb-drawer--leaving.hb-drawer--ltr {\n animation: hb-drawer-out-ltr 0.3s cubic-bezier(0.5, 0, 0.75, 0) both;\n}\n.hb-drawer--leaving.hb-drawer--ttb {\n animation: hb-drawer-out-ttb 0.3s cubic-bezier(0.5, 0, 0.75, 0) both;\n}\n.hb-drawer--leaving.hb-drawer--btt {\n animation: hb-drawer-out-btt 0.3s cubic-bezier(0.5, 0, 0.75, 0) both;\n}\n\n@keyframes hb-drawer-in-rtl {\n from {\n transform: translateX(100%);\n }\n to {\n transform: translateX(0);\n }\n}\n@keyframes hb-drawer-out-rtl {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(100%);\n }\n}\n@keyframes hb-drawer-in-ltr {\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(0);\n }\n}\n@keyframes hb-drawer-out-ltr {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(-100%);\n }\n}\n@keyframes hb-drawer-in-ttb {\n from {\n transform: translateY(-100%);\n }\n to {\n transform: translateY(0);\n }\n}\n@keyframes hb-drawer-out-ttb {\n from {\n transform: translateY(0);\n }\n to {\n transform: translateY(-100%);\n }\n}\n@keyframes hb-drawer-in-btt {\n from {\n transform: translateY(100%);\n }\n to {\n transform: translateY(0);\n }\n}\n@keyframes hb-drawer-out-btt {\n from {\n transform: translateY(0);\n }\n to {\n transform: translateY(100%);\n }\n}\n\n.hb-drawer__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--hb-spacing-md) var(--hb-spacing-lg);\n border-bottom: 1px solid var(--hb-color-border-secondary);\n}\n.hb-drawer__title {\n font-size: var(--hb-font-size-lg);\n font-weight: 600;\n}\n.hb-drawer__close {\n border: none;\n background: none;\n cursor: pointer;\n color: var(--hb-color-text-secondary);\n width: 28px;\n height: 28px;\n border-radius: var(--hb-border-radius-sm);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n transition: all var(--hb-transition-duration);\n}\n.hb-drawer__close svg {\n width: 16px;\n height: 16px;\n}\n.hb-drawer__close:hover {\n background: var(--hb-color-fill-tertiary);\n color: var(--hb-color-text-primary);\n}\n.hb-drawer__body {\n flex: 1;\n padding: var(--hb-spacing-lg);\n overflow-y: auto;\n}\n","import { Component, h, Prop, Event, EventEmitter, Watch, State } from '@stencil/core';\nimport { lockScroll, unlockScroll, getNextZIndex } from '../../utils/popup-manager';\nimport { createFocusTrap, FocusTrap } from '../../utils/a11y';\n\n@Component({ tag: 'hb-drawer', styleUrl: 'drawer.css', shadow: true })\nexport class Drawer {\n @Prop({ mutable: true }) modelValue: boolean = false;\n @Prop() title: string = '';\n @Prop() size: string = '30%';\n @Prop() direction: 'ltr' | 'rtl' | 'ttb' | 'btt' = 'rtl';\n @Prop() closeOnClickModal: boolean = true;\n @Prop() showClose: boolean = true;\n @Prop() modal: boolean = true;\n /** 是否按 ESC 关闭 */\n @Prop() closeOnPressEscape: boolean = true;\n @State() private zIndexState: number = 0;\n private zIndex: number = 0;\n private panelRef?: HTMLElement;\n private trap?: FocusTrap;\n /** 离场动画期内保留渲染 */\n @State() private leaving: boolean = false;\n private leaveTimer?: ReturnType<typeof setTimeout>;\n\n @Event() hbOpen: EventEmitter<void>;\n @Event() hbClose: EventEmitter<void>;\n\n @Watch('modelValue')\n handleVisible(val: boolean) {\n if (val) {\n if (this.leaveTimer) {\n clearTimeout(this.leaveTimer);\n this.leaveTimer = undefined;\n }\n this.leaving = false;\n this.zIndex = getNextZIndex();\n this.zIndexState = this.zIndex;\n if (this.modal) lockScroll();\n this.hbOpen.emit();\n document.addEventListener('keydown', this.handleKeyDown);\n } else {\n if (this.modal) unlockScroll();\n this.hbClose.emit();\n document.removeEventListener('keydown', this.handleKeyDown);\n // 进入离场动画期,结束后真正卸载\n this.leaving = true;\n if (this.leaveTimer) clearTimeout(this.leaveTimer);\n this.leaveTimer = setTimeout(() => {\n this.leaving = false;\n }, 300);\n }\n }\n\n componentDidRender() {\n if (!this.panelRef) return;\n if (this.modelValue) {\n if (!this.trap) {\n this.trap = createFocusTrap({ container: this.panelRef });\n }\n this.trap.connect();\n } else {\n this.trap?.disconnect();\n }\n }\n\n disconnectedCallback() {\n if (this.modelValue && this.modal) unlockScroll();\n document.removeEventListener('keydown', this.handleKeyDown);\n this.trap?.disconnect();\n if (this.leaveTimer) clearTimeout(this.leaveTimer);\n }\n\n private handleKeyDown = (e: KeyboardEvent) => {\n if (this.closeOnPressEscape && e.key === 'Escape') {\n this.close();\n }\n };\n\n private close = () => {\n this.modelValue = false;\n };\n\n private get shouldRender(): boolean {\n return this.modelValue || this.leaving;\n }\n\n render() {\n const dir = this.direction;\n const isVertical = dir === 'ttb' || dir === 'btt';\n const sizeStyle = isVertical ? { height: this.size } : { width: this.size };\n const translateClass = `hb-drawer--${dir}`;\n\n return (\n <div class={{ 'hb-drawer-wrapper': true, 'hb-drawer-wrapper--visible': this.shouldRender }}>\n {this.modal && (\n <div\n class={{\n 'hb-drawer__overlay': true,\n 'hb-drawer__overlay--leaving': this.leaving,\n }}\n style={{ zIndex: String(this.zIndexState) }}\n onClick={() => this.closeOnClickModal && this.close()}\n />\n )}\n <div\n ref={el => (this.panelRef = el as HTMLElement)}\n class={{\n 'hb-drawer': true,\n [translateClass]: true,\n 'hb-drawer--visible': this.modelValue,\n 'hb-drawer--leaving': this.leaving,\n }}\n style={{ ...sizeStyle, zIndex: String(this.zIndexState + 1) }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={this.title || undefined}\n aria-hidden={this.modelValue ? 'false' : 'true'}\n >\n <div class=\"hb-drawer__header\">\n <span class=\"hb-drawer__title\">{this.title}</span>\n {this.showClose && (\n <button type=\"button\" class=\"hb-drawer__close\" aria-label=\"关闭\" onClick={this.close}>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width={2} stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M6 6l12 12M18 6L6 18\" />\n </svg>\n </button>\n )}\n </div>\n <div class=\"hb-drawer__body\">\n <slot />\n </div>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h } from './p-1407a5e8.js';
|
|
2
2
|
import { c as createClickOutsideHandler } from './p-4ef5a884.js';
|
|
3
3
|
import { g as getNextZIndex } from './p-ecce2b5e.js';
|
|
4
|
+
import { i as isActivationKey, h as handleListKeyboard } from './p-00aa34c8.js';
|
|
5
|
+
import { c as createLeaveScheduler } from './p-fad66d69.js';
|
|
4
6
|
|
|
5
|
-
const dropdownCss = "/*! 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:inline-block;position:relative}.hb-dropdown__trigger{cursor:pointer;display:inline-block}.hb-dropdown__menu{animation:hb-dropdown-fade-in .15s ease-out;background-color:var(--hb-color-bg-elevated);border-radius:var(--hb-border-radius-base);box-shadow:var(--hb-box-shadow);left:0;margin-top:4px;min-width:120px;padding:4px 0;position:absolute;top:100%}.hb-dropdown__item{align-items:center;color:var(--hb-color-text);cursor:pointer;display:flex;font-size:var(--hb-font-size-sm);padding:6px 16px;transition:background-color var(--hb-transition-duration);white-space:nowrap}.hb-dropdown__item:hover:not(.hb-dropdown__item--disabled){background-color:var(--hb-color-fill-tertiary);color:var(--hb-color-primary)}.hb-dropdown__item--disabled{color:var(--hb-color-text-disabled);cursor:not-allowed}.hb-dropdown__item--divided{border-top:1px solid var(--hb-color-border-secondary);margin-top:4px;padding-top:8px}.hb-dropdown__item--danger{color:var(--hb-color-danger)}.hb-dropdown__item--danger:hover:not(.hb-dropdown__item--disabled){background-color:var(--hb-color-danger-bg);color:var(--hb-color-danger)}@keyframes hb-dropdown-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}";
|
|
7
|
+
const dropdownCss = "/*! 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:inline-block;position:relative}.hb-dropdown__trigger{cursor:pointer;display:inline-block}.hb-dropdown__menu{animation:hb-dropdown-fade-in .15s ease-out;background-color:var(--hb-color-bg-elevated);border-radius:var(--hb-border-radius-base);box-shadow:var(--hb-box-shadow);left:0;margin-top:4px;min-width:120px;padding:4px 0;position:absolute;top:100%}.hb-dropdown__item{align-items:center;color:var(--hb-color-text);cursor:pointer;display:flex;font-size:var(--hb-font-size-sm);padding:6px 16px;transition:background-color var(--hb-transition-duration);white-space:nowrap}.hb-dropdown__item--active:not(.hb-dropdown__item--disabled),.hb-dropdown__item:hover:not(.hb-dropdown__item--disabled){background-color:var(--hb-color-fill-tertiary);color:var(--hb-color-primary)}.hb-dropdown__item--disabled{color:var(--hb-color-text-disabled);cursor:not-allowed}.hb-dropdown__item--divided{border-top:1px solid var(--hb-color-border-secondary);margin-top:4px;padding-top:8px}.hb-dropdown__item--danger{color:var(--hb-color-danger)}.hb-dropdown__item--danger:hover:not(.hb-dropdown__item--disabled){background-color:var(--hb-color-danger-bg);color:var(--hb-color-danger)}@keyframes hb-dropdown-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.hb-dropdown__menu--leaving{animation:hb-dropdown-fade-out .15s ease-in forwards}@keyframes hb-dropdown-fade-out{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-4px)}}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}";
|
|
6
8
|
const HbDropdownStyle0 = dropdownCss;
|
|
7
9
|
|
|
8
10
|
const Dropdown = /*@__PURE__*/ proxyCustomElement(class Dropdown extends H {
|
|
@@ -20,18 +22,27 @@ const Dropdown = /*@__PURE__*/ proxyCustomElement(class Dropdown extends H {
|
|
|
20
22
|
/** 是否禁用 */
|
|
21
23
|
disabled = false;
|
|
22
24
|
isOpen = false;
|
|
25
|
+
/** 离场动画期(保留 DOM 让 fade-out 播完) */
|
|
26
|
+
leaving = false;
|
|
27
|
+
/** 键盘高亮项索引(-1 表示无) */
|
|
28
|
+
activeIndex = -1;
|
|
23
29
|
/** 命令事件 */
|
|
24
30
|
hbCommand;
|
|
31
|
+
leave = createLeaveScheduler(() => this.leaving, v => (this.leaving = v), 150);
|
|
25
32
|
clickOutside = createClickOutsideHandler({
|
|
26
33
|
host: null,
|
|
27
34
|
isOpen: () => this.isOpen,
|
|
28
|
-
onClose: () => {
|
|
35
|
+
onClose: () => {
|
|
36
|
+
this.close();
|
|
37
|
+
},
|
|
29
38
|
});
|
|
30
39
|
componentDidLoad() {
|
|
31
40
|
this.clickOutside = createClickOutsideHandler({
|
|
32
41
|
host: this.el,
|
|
33
42
|
isOpen: () => this.isOpen,
|
|
34
|
-
onClose: () => {
|
|
43
|
+
onClose: () => {
|
|
44
|
+
this.close();
|
|
45
|
+
},
|
|
35
46
|
});
|
|
36
47
|
if (this.trigger === 'click') {
|
|
37
48
|
this.clickOutside.connect();
|
|
@@ -39,35 +50,104 @@ const Dropdown = /*@__PURE__*/ proxyCustomElement(class Dropdown extends H {
|
|
|
39
50
|
}
|
|
40
51
|
disconnectedCallback() {
|
|
41
52
|
this.clickOutside.disconnect();
|
|
53
|
+
this.leave.dispose();
|
|
42
54
|
}
|
|
43
|
-
|
|
55
|
+
open = () => {
|
|
44
56
|
if (this.disabled)
|
|
45
57
|
return;
|
|
58
|
+
this.leave.cancel(); // 中途又打开:取消挂起的离场
|
|
46
59
|
this.isOpen = true;
|
|
60
|
+
this.activeIndex = this.items.findIndex(i => !i.disabled);
|
|
47
61
|
};
|
|
48
|
-
|
|
62
|
+
close = () => {
|
|
63
|
+
if (!this.isOpen && !this.leaving)
|
|
64
|
+
return;
|
|
49
65
|
this.isOpen = false;
|
|
66
|
+
this.activeIndex = -1;
|
|
67
|
+
this.leave.start();
|
|
68
|
+
};
|
|
69
|
+
show = () => {
|
|
70
|
+
if (this.disabled)
|
|
71
|
+
return;
|
|
72
|
+
this.open();
|
|
73
|
+
};
|
|
74
|
+
hide = () => {
|
|
75
|
+
this.close();
|
|
50
76
|
};
|
|
51
77
|
toggle = () => {
|
|
52
78
|
if (this.disabled)
|
|
53
79
|
return;
|
|
54
|
-
|
|
80
|
+
if (this.isOpen)
|
|
81
|
+
this.close();
|
|
82
|
+
else
|
|
83
|
+
this.open();
|
|
55
84
|
};
|
|
56
85
|
handleSelect = (item) => {
|
|
57
86
|
if (item.disabled)
|
|
58
87
|
return;
|
|
59
|
-
this.
|
|
88
|
+
this.close();
|
|
60
89
|
this.hbCommand.emit(item.key);
|
|
61
90
|
};
|
|
91
|
+
handleTriggerKeydown = (e) => {
|
|
92
|
+
if (this.disabled)
|
|
93
|
+
return;
|
|
94
|
+
if (this.trigger === 'hover')
|
|
95
|
+
return;
|
|
96
|
+
if (isActivationKey(e.key) || e.key === 'ArrowDown') {
|
|
97
|
+
e.preventDefault();
|
|
98
|
+
this.open();
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
handleMenuKeydown = (e) => {
|
|
102
|
+
const enabledCount = this.items.length;
|
|
103
|
+
const action = handleListKeyboard(e, {
|
|
104
|
+
activeIndex: this.activeIndex,
|
|
105
|
+
itemCount: enabledCount,
|
|
106
|
+
loop: true,
|
|
107
|
+
});
|
|
108
|
+
switch (action.type) {
|
|
109
|
+
case 'navigate':
|
|
110
|
+
e.preventDefault();
|
|
111
|
+
{
|
|
112
|
+
let idx = action.index;
|
|
113
|
+
for (let i = 0; i < enabledCount; i++) {
|
|
114
|
+
if (!this.items[idx]?.disabled)
|
|
115
|
+
break;
|
|
116
|
+
idx = (idx + 1) % enabledCount;
|
|
117
|
+
}
|
|
118
|
+
this.activeIndex = idx;
|
|
119
|
+
}
|
|
120
|
+
break;
|
|
121
|
+
case 'select': {
|
|
122
|
+
e.preventDefault();
|
|
123
|
+
const item = this.items[action.index];
|
|
124
|
+
if (item && !item.disabled)
|
|
125
|
+
this.handleSelect(item);
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
case 'close':
|
|
129
|
+
e.preventDefault();
|
|
130
|
+
this.close();
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
get shouldRender() {
|
|
135
|
+
return this.isOpen || this.leaving;
|
|
136
|
+
}
|
|
62
137
|
render() {
|
|
63
|
-
const triggerEvents = this.trigger === 'hover'
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
138
|
+
const triggerEvents = this.trigger === 'hover' ? { onMouseEnter: this.show, onMouseLeave: this.hide } : { onClick: this.toggle };
|
|
139
|
+
return (h("div", { key: '8855aa67978f0180ee22fa57d47d8a8530fcff59', class: "hb-dropdown", ...triggerEvents, onKeyDown: this.handleTriggerKeydown }, h("div", { key: 'f07514869b6c2fed33be57a882afbe3aad221f79', class: "hb-dropdown__trigger", role: "button", tabindex: this.disabled ? -1 : 0, "aria-haspopup": "menu", "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false' }, h("slot", { key: '077a8fdd63295eaeadda3124764dd51090a7019d' })), this.shouldRender && (h("div", { key: 'f17eba6ead1c841fdc97db4fc88c62937e6b7344', class: {
|
|
140
|
+
'hb-dropdown__menu': true,
|
|
141
|
+
'hb-dropdown__menu--leaving': this.leaving,
|
|
142
|
+
}, style: { zIndex: String(getNextZIndex()) }, role: "menu", onKeyDown: this.handleMenuKeydown }, this.items.map((item, index) => (h("div", { class: {
|
|
67
143
|
'hb-dropdown__item': true,
|
|
68
144
|
'hb-dropdown__item--disabled': item.disabled,
|
|
69
145
|
'hb-dropdown__item--divided': item.divided,
|
|
70
146
|
'hb-dropdown__item--danger': item.danger,
|
|
147
|
+
'hb-dropdown__item--active': index === this.activeIndex,
|
|
148
|
+
}, role: "menuitem", tabindex: -1, "aria-disabled": item.disabled ? 'true' : undefined, onMouseEnter: () => {
|
|
149
|
+
if (!item.disabled)
|
|
150
|
+
this.activeIndex = index;
|
|
71
151
|
}, onClick: () => this.handleSelect(item) }, item.label)))))));
|
|
72
152
|
}
|
|
73
153
|
static get style() { return HbDropdownStyle0; }
|
|
@@ -75,7 +155,9 @@ const Dropdown = /*@__PURE__*/ proxyCustomElement(class Dropdown extends H {
|
|
|
75
155
|
"items": [16],
|
|
76
156
|
"trigger": [1],
|
|
77
157
|
"disabled": [4],
|
|
78
|
-
"isOpen": [32]
|
|
158
|
+
"isOpen": [32],
|
|
159
|
+
"leaving": [32],
|
|
160
|
+
"activeIndex": [32]
|
|
79
161
|
}]);
|
|
80
162
|
function defineCustomElement$1() {
|
|
81
163
|
if (typeof customElements === "undefined") {
|