huibo-ui 0.4.0 → 0.6.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-1ffddc59.js → date-helpers-c05ef385.js} +5 -16
- package/dist/cjs/date-helpers-c05ef385.js.map +1 -0
- 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-calendar.cjs.entry.js +2 -2
- package/dist/cjs/hb-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-cascader.cjs.entry.js +48 -12
- 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.cjs.entry.js +22 -19
- package/dist/cjs/hb-color-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-date-picker-pane.cjs.entry.js +1 -1
- package/dist/cjs/hb-date-picker.cjs.entry.js +13 -10
- package/dist/cjs/hb-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-date-range-picker.cjs.entry.js +1 -1
- package/dist/cjs/hb-date-time-picker.cjs.entry.js +1 -1
- 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-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 +27 -15
- 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-form-item.cjs.entry.js +67 -16
- package/dist/cjs/hb-form-item.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-form.cjs.entry.js +115 -7
- package/dist/cjs/hb-form.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-image-preview.cjs.entry.js +1 -1
- 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 +3 -2
- package/dist/cjs/hb-input.cjs.entry.js.map +1 -1
- 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-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 +2 -2
- 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-page-header.cjs.entry.js +1 -1
- package/dist/cjs/hb-pagination.cjs.entry.js +8 -5
- package/dist/cjs/hb-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-popconfirm.cjs.entry.js +27 -8
- package/dist/cjs/hb-popconfirm.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-popover.cjs.entry.js +26 -14
- 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 +3 -3
- package/dist/cjs/hb-rate.cjs.entry.js.map +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 +13 -2
- package/dist/cjs/hb-segmented.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-select.cjs.entry.js +100 -19
- package/dist/cjs/hb-select.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-slider.cjs.entry.js +6 -12
- 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 +3 -3
- 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 +3 -3
- 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 +218 -41
- 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-tooltip.cjs.entry.js +30 -10
- package/dist/cjs/hb-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-tree-select.cjs.entry.js +125 -10
- 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-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/components/Alert/Alert.js +2 -1
- package/dist/collection/components/Alert/Alert.js.map +1 -1
- package/dist/collection/components/Calendar/Calendar.js +2 -2
- package/dist/collection/components/Calendar/Calendar.js.map +1 -1
- package/dist/collection/components/Cascader/Cascader.js +47 -11
- package/dist/collection/components/Cascader/Cascader.js.map +1 -1
- 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 +22 -19
- package/dist/collection/components/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/collection/components/ColorPicker/color-picker.css +8 -3
- package/dist/collection/components/DatePicker/DatePicker.js +12 -9
- package/dist/collection/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/collection/components/DatePicker/date-picker.css +3 -2
- package/dist/collection/components/Descriptions/descriptions.css +30 -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/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 +28 -13
- package/dist/collection/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/collection/components/Dropdown/dropdown.css +24 -2
- 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 +217 -9
- package/dist/collection/components/Form/Form.js.map +1 -1
- package/dist/collection/components/Form/FormItem.js +126 -18
- package/dist/collection/components/Form/FormItem.js.map +1 -1
- package/dist/collection/components/Form/form-item.css +8 -2
- 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 +1 -1
- package/dist/collection/components/ImagePreview/ImagePreview.js.map +1 -1
- package/dist/collection/components/Input/Input.js +3 -2
- package/dist/collection/components/Input/Input.js.map +1 -1
- package/dist/collection/components/Input/input.css +1 -2
- 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.map +1 -1
- package/dist/collection/components/Layout/Row.js +2 -2
- package/dist/collection/components/Layout/layout.css +1713 -576
- 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/Message/Message.js +13 -4
- package/dist/collection/components/Message/Message.js.map +1 -1
- package/dist/collection/components/PageHeader/PageHeader.js +1 -1
- package/dist/collection/components/Pagination/Pagination.js +8 -5
- package/dist/collection/components/Pagination/Pagination.js.map +1 -1
- package/dist/collection/components/Popconfirm/Popconfirm.js +28 -6
- 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 +27 -12
- 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 +3 -3
- package/dist/collection/components/Rate/Rate.js.map +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 +15 -1
- package/dist/collection/components/Segmented/Segmented.js.map +1 -1
- package/dist/collection/components/Select/Select.js +123 -19
- package/dist/collection/components/Select/Select.js.map +1 -1
- package/dist/collection/components/Select/select.css +0 -1
- package/dist/collection/components/Slider/Slider.js +6 -12
- package/dist/collection/components/Slider/Slider.js.map +1 -1
- package/dist/collection/components/Slider/slider.css +0 -1
- 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 +2 -2
- package/dist/collection/components/Steps/Steps.js.map +1 -1
- package/dist/collection/components/Switch/Switch.js +3 -3
- package/dist/collection/components/Switch/Switch.js.map +1 -1
- package/dist/collection/components/Switch/switch.css +3 -2
- package/dist/collection/components/Table/Table.js +296 -41
- package/dist/collection/components/Table/Table.js.map +1 -1
- package/dist/collection/components/Table/table.css +6 -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/Tooltip/Tooltip.js +31 -8
- package/dist/collection/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/collection/components/Tooltip/tooltip.css +24 -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 +130 -11
- package/dist/collection/components/TreeSelect/TreeSelect.js.map +1 -1
- 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 +4 -15
- 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/collection/utils/virtual-scroll.js +39 -0
- package/dist/collection/utils/virtual-scroll.js.map +1 -0
- package/dist/components/hb-alert.js +2 -1
- package/dist/components/hb-alert.js.map +1 -1
- package/dist/components/hb-calendar.js +2 -2
- package/dist/components/hb-calendar.js.map +1 -1
- package/dist/components/hb-cascader.js +48 -12
- 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.js +22 -19
- package/dist/components/hb-color-picker.js.map +1 -1
- package/dist/components/hb-date-picker-pane.js +1 -1
- package/dist/components/hb-date-picker.js +13 -10
- package/dist/components/hb-date-picker.js.map +1 -1
- package/dist/components/hb-date-range-picker.js +1 -1
- package/dist/components/hb-date-time-picker.js +1 -1
- 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-drawer.js +36 -5
- package/dist/components/hb-drawer.js.map +1 -1
- package/dist/components/hb-dropdown.js +28 -15
- 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-form-item.js +70 -16
- package/dist/components/hb-form-item.js.map +1 -1
- package/dist/components/hb-form.js +120 -7
- package/dist/components/hb-form.js.map +1 -1
- package/dist/components/hb-image-preview.js +1 -1
- 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 +3 -2
- package/dist/components/hb-input.js.map +1 -1
- 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-menu-item.js +15 -5
- package/dist/components/hb-menu-item.js.map +1 -1
- package/dist/components/hb-menu.js +2 -2
- package/dist/components/hb-message.js +13 -4
- package/dist/components/hb-message.js.map +1 -1
- package/dist/components/hb-page-header.js +1 -1
- package/dist/components/hb-pagination.js +8 -5
- package/dist/components/hb-pagination.js.map +1 -1
- package/dist/components/hb-popconfirm.js +28 -8
- package/dist/components/hb-popconfirm.js.map +1 -1
- package/dist/components/hb-popover.js +27 -14
- 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 +3 -3
- package/dist/components/hb-rate.js.map +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 +15 -2
- package/dist/components/hb-segmented.js.map +1 -1
- package/dist/components/hb-select.js +105 -20
- package/dist/components/hb-select.js.map +1 -1
- package/dist/components/hb-slider.js +6 -12
- 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 +3 -3
- package/dist/components/hb-steps.js.map +1 -1
- package/dist/components/hb-sub-menu.js +5 -5
- package/dist/components/hb-switch.js +3 -3
- package/dist/components/hb-switch.js.map +1 -1
- package/dist/components/hb-tab-pane.js +1 -1
- package/dist/components/hb-table.js +226 -43
- 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-tooltip.js +31 -10
- package/dist/components/hb-tooltip.js.map +1 -1
- package/dist/components/hb-tree-select.js +129 -11
- 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-watermark.js +19 -11
- package/dist/components/hb-watermark.js.map +1 -1
- package/dist/{esm/a11y-f9ab2964.js → components/p-00aa34c8.js} +17 -3
- package/dist/components/p-00aa34c8.js.map +1 -0
- package/dist/components/{p-08b4005c.js → p-e0876aca.js} +5 -16
- 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/{components/p-cc0aeb50.js → esm/a11y-e4cde5b0.js} +17 -3
- package/dist/esm/a11y-e4cde5b0.js.map +1 -0
- package/dist/esm/{date-helpers-44507189.js → date-helpers-259ed2f1.js} +5 -16
- package/dist/esm/date-helpers-259ed2f1.js.map +1 -0
- package/dist/esm/hb-alert.entry.js +2 -1
- package/dist/esm/hb-alert.entry.js.map +1 -1
- package/dist/esm/hb-calendar.entry.js +2 -2
- package/dist/esm/hb-calendar.entry.js.map +1 -1
- package/dist/esm/hb-cascader.entry.js +48 -12
- 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.entry.js +22 -19
- package/dist/esm/hb-color-picker.entry.js.map +1 -1
- package/dist/esm/hb-date-picker-pane.entry.js +1 -1
- package/dist/esm/hb-date-picker.entry.js +13 -10
- package/dist/esm/hb-date-picker.entry.js.map +1 -1
- package/dist/esm/hb-date-range-picker.entry.js +1 -1
- package/dist/esm/hb-date-time-picker.entry.js +1 -1
- 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-drawer.entry.js +34 -4
- package/dist/esm/hb-drawer.entry.js.map +1 -1
- package/dist/esm/hb-dropdown.entry.js +27 -15
- 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-form-item.entry.js +67 -16
- package/dist/esm/hb-form-item.entry.js.map +1 -1
- package/dist/esm/hb-form.entry.js +115 -7
- package/dist/esm/hb-form.entry.js.map +1 -1
- package/dist/esm/hb-image-preview.entry.js +1 -1
- 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 +3 -2
- package/dist/esm/hb-input.entry.js.map +1 -1
- 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-menu-item.entry.js +14 -5
- package/dist/esm/hb-menu-item.entry.js.map +1 -1
- package/dist/esm/hb-menu.entry.js +2 -2
- package/dist/esm/hb-message.entry.js +13 -4
- package/dist/esm/hb-message.entry.js.map +1 -1
- package/dist/esm/hb-page-header.entry.js +1 -1
- package/dist/esm/hb-pagination.entry.js +8 -5
- package/dist/esm/hb-pagination.entry.js.map +1 -1
- package/dist/esm/hb-popconfirm.entry.js +27 -8
- package/dist/esm/hb-popconfirm.entry.js.map +1 -1
- package/dist/esm/hb-popover.entry.js +26 -14
- 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 +3 -3
- package/dist/esm/hb-rate.entry.js.map +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 +13 -2
- package/dist/esm/hb-segmented.entry.js.map +1 -1
- package/dist/esm/hb-select.entry.js +100 -19
- package/dist/esm/hb-select.entry.js.map +1 -1
- package/dist/esm/hb-slider.entry.js +6 -12
- 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 +3 -3
- 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 +3 -3
- 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 +218 -41
- 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-tooltip.entry.js +30 -10
- package/dist/esm/hb-tooltip.entry.js.map +1 -1
- package/dist/esm/hb-tree-select.entry.js +125 -10
- 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-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.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-0cc1e3f3.entry.js +2 -0
- package/dist/huibo-ui/p-0cc1e3f3.entry.js.map +1 -0
- package/dist/huibo-ui/{p-678b4212.entry.js → p-0ddae4e9.entry.js} +2 -2
- package/dist/huibo-ui/p-10f6c184.entry.js.map +1 -1
- package/dist/huibo-ui/{p-f4336be9.entry.js → p-14c3b47b.entry.js} +2 -2
- package/dist/huibo-ui/{p-c50ad398.entry.js → p-193efdc0.entry.js} +2 -2
- package/dist/huibo-ui/{p-735bceef.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-0d4b2997.entry.js → p-2bcda1bb.entry.js} +2 -2
- package/dist/huibo-ui/{p-b8d87f7e.entry.js → p-2ca9796a.entry.js} +2 -2
- package/dist/huibo-ui/p-2ca9796a.entry.js.map +1 -0
- package/dist/huibo-ui/{p-c80f8ace.entry.js → p-2cf5bf20.entry.js} +2 -2
- package/dist/huibo-ui/p-2cf5bf20.entry.js.map +1 -0
- package/dist/huibo-ui/{p-7da14d7c.entry.js → p-3042f986.entry.js} +2 -2
- package/dist/huibo-ui/{p-e039155d.entry.js → p-3dacb26b.entry.js} +2 -2
- package/dist/huibo-ui/{p-a084b8e5.entry.js → p-412ff618.entry.js} +2 -2
- package/dist/huibo-ui/p-4148d875.entry.js +2 -0
- package/dist/huibo-ui/p-4148d875.entry.js.map +1 -0
- package/dist/huibo-ui/{p-6beb5b81.entry.js → p-415295f3.entry.js} +2 -2
- 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-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-ccd09d5a.entry.js → p-6518c435.entry.js} +2 -2
- package/dist/huibo-ui/{p-1f8db37a.entry.js → p-687d8dff.entry.js} +2 -2
- 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-2811e603.entry.js → p-6bfe1954.entry.js} +2 -2
- package/dist/huibo-ui/p-6bfe1954.entry.js.map +1 -0
- package/dist/huibo-ui/{p-e5cbfa9e.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.map +1 -1
- 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-7a38b3e2.entry.js +2 -0
- package/dist/huibo-ui/p-7a38b3e2.entry.js.map +1 -0
- package/dist/huibo-ui/{p-cad57c2d.entry.js → p-7a682c56.entry.js} +2 -2
- package/dist/huibo-ui/{p-a8996d22.entry.js → p-815fc943.entry.js} +2 -2
- package/dist/huibo-ui/{p-af74667d.entry.js → p-89be7973.entry.js} +2 -2
- package/dist/huibo-ui/p-8a202bc5.entry.js.map +1 -1
- package/dist/huibo-ui/{p-213b9de7.entry.js → p-8c4415ed.entry.js} +2 -2
- package/dist/huibo-ui/p-8c4415ed.entry.js.map +1 -0
- package/dist/huibo-ui/{p-8fdbd17c.entry.js → p-950e7465.entry.js} +2 -2
- package/dist/huibo-ui/{p-ab9cf0e4.entry.js → p-96cecd21.entry.js} +2 -2
- package/dist/huibo-ui/p-96cecd21.entry.js.map +1 -0
- package/dist/huibo-ui/{p-2b4556ff.entry.js → p-98b513cd.entry.js} +2 -2
- package/dist/huibo-ui/p-98b513cd.entry.js.map +1 -0
- package/dist/huibo-ui/{p-89ea1141.entry.js → p-ac45291c.entry.js} +2 -2
- package/dist/huibo-ui/{p-e10fcfbe.entry.js → p-b105cf76.entry.js} +2 -2
- package/dist/huibo-ui/p-b105cf76.entry.js.map +1 -0
- package/dist/huibo-ui/{p-9a5406f0.entry.js → p-b38802b0.entry.js} +2 -2
- package/dist/huibo-ui/{p-9a5406f0.entry.js.map → p-b38802b0.entry.js.map} +1 -1
- 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-41d9c846.entry.js → p-b6afe81e.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-33de6878.entry.js → p-c869842c.entry.js} +2 -2
- package/dist/huibo-ui/p-c869842c.entry.js.map +1 -0
- package/dist/huibo-ui/p-c8e917db.entry.js.map +1 -1
- 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-f5969181.entry.js → p-dd9c6459.entry.js} +2 -2
- package/dist/huibo-ui/{p-08b4005c.js → p-e0876aca.js} +1 -1
- package/dist/huibo-ui/p-e0876aca.js.map +1 -0
- package/dist/huibo-ui/{p-aa5e5e02.entry.js → p-e1773c93.entry.js} +2 -2
- package/dist/huibo-ui/p-e1773c93.entry.js.map +1 -0
- package/dist/huibo-ui/{p-626b48f1.entry.js → p-e73c357f.entry.js} +2 -2
- package/dist/huibo-ui/p-e73c357f.entry.js.map +1 -0
- package/dist/huibo-ui/{p-60532a1f.entry.js → p-e7c73624.entry.js} +2 -2
- package/dist/huibo-ui/p-e7c73624.entry.js.map +1 -0
- package/dist/huibo-ui/{p-86bdc48a.entry.js → p-e8824b2c.entry.js} +2 -2
- package/dist/huibo-ui/p-e8824b2c.entry.js.map +1 -0
- package/dist/huibo-ui/{p-13010da2.entry.js → p-e9e7abca.entry.js} +2 -2
- package/dist/huibo-ui/{p-f6889710.entry.js → p-ea0823f3.entry.js} +2 -2
- package/dist/huibo-ui/p-ea0823f3.entry.js.map +1 -0
- package/dist/huibo-ui/{p-b468858e.entry.js → p-f1f2483f.entry.js} +2 -2
- package/dist/huibo-ui/p-f69599fa.entry.js +2 -0
- package/dist/huibo-ui/p-f69599fa.entry.js.map +1 -0
- package/dist/huibo-ui/p-fad66d69.js +2 -0
- package/dist/huibo-ui/p-fad66d69.js.map +1 -0
- package/dist/huibo-ui/{p-fd8301c6.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/Cascader/Cascader.d.ts +12 -0
- 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/Dialog/Dialog.d.ts +13 -1
- package/dist/types/components/Drawer/Drawer.d.ts +4 -0
- package/dist/types/components/Dropdown/Dropdown.d.ts +6 -2
- package/dist/types/components/Form/Form.d.ts +59 -0
- package/dist/types/components/Form/FormItem.d.ts +23 -0
- package/dist/types/components/Image/Image.d.ts +6 -0
- package/dist/types/components/Menu/MenuItem.d.ts +8 -1
- package/dist/types/components/Message/Message.d.ts +3 -0
- package/dist/types/components/Popconfirm/Popconfirm.d.ts +6 -2
- package/dist/types/components/Popover/Popover.d.ts +6 -1
- package/dist/types/components/Radio/Radio.d.ts +5 -0
- package/dist/types/components/Segmented/Segmented.d.ts +6 -0
- package/dist/types/components/Select/Select.d.ts +24 -0
- package/dist/types/components/Table/Table.d.ts +110 -9
- package/dist/types/components/Tabs/Tabs.d.ts +6 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +6 -0
- package/dist/types/components/Tree/Tree.d.ts +24 -0
- package/dist/types/components/TreeSelect/TreeSelect.d.ts +17 -0
- package/dist/types/components/Watermark/Watermark.d.ts +7 -1
- package/dist/types/components.d.ts +188 -6
- package/dist/types/utils/a11y.d.ts +9 -0
- package/dist/types/utils/transition.d.ts +27 -0
- package/dist/types/utils/virtual-scroll.d.ts +38 -0
- package/package.json +1 -1
- package/dist/cjs/a11y-802de67a.js.map +0 -1
- package/dist/cjs/date-helpers-1ffddc59.js.map +0 -1
- package/dist/components/p-08b4005c.js.map +0 -1
- package/dist/components/p-cc0aeb50.js.map +0 -1
- package/dist/esm/a11y-f9ab2964.js.map +0 -1
- package/dist/esm/date-helpers-44507189.js.map +0 -1
- package/dist/huibo-ui/p-08b4005c.js.map +0 -1
- package/dist/huibo-ui/p-1f8db37a.entry.js.map +0 -1
- package/dist/huibo-ui/p-213b9de7.entry.js.map +0 -1
- package/dist/huibo-ui/p-25fd7d5c.entry.js +0 -2
- package/dist/huibo-ui/p-25fd7d5c.entry.js.map +0 -1
- package/dist/huibo-ui/p-2811e603.entry.js.map +0 -1
- package/dist/huibo-ui/p-2943f5d0.entry.js +0 -2
- package/dist/huibo-ui/p-2943f5d0.entry.js.map +0 -1
- package/dist/huibo-ui/p-2b4556ff.entry.js.map +0 -1
- package/dist/huibo-ui/p-33de6878.entry.js.map +0 -1
- package/dist/huibo-ui/p-3807da71.entry.js +0 -2
- package/dist/huibo-ui/p-3807da71.entry.js.map +0 -1
- package/dist/huibo-ui/p-47ef7a86.entry.js +0 -2
- package/dist/huibo-ui/p-47ef7a86.entry.js.map +0 -1
- package/dist/huibo-ui/p-4d34e43e.entry.js +0 -2
- package/dist/huibo-ui/p-4d34e43e.entry.js.map +0 -1
- package/dist/huibo-ui/p-54aa2fd8.entry.js +0 -2
- package/dist/huibo-ui/p-54aa2fd8.entry.js.map +0 -1
- package/dist/huibo-ui/p-60532a1f.entry.js.map +0 -1
- package/dist/huibo-ui/p-626b48f1.entry.js.map +0 -1
- package/dist/huibo-ui/p-639f167d.entry.js +0 -2
- package/dist/huibo-ui/p-639f167d.entry.js.map +0 -1
- package/dist/huibo-ui/p-6beb5b81.entry.js.map +0 -1
- package/dist/huibo-ui/p-735bceef.entry.js.map +0 -1
- package/dist/huibo-ui/p-76519752.entry.js +0 -2
- package/dist/huibo-ui/p-76519752.entry.js.map +0 -1
- package/dist/huibo-ui/p-79af2efa.entry.js +0 -2
- package/dist/huibo-ui/p-79af2efa.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-86bdc48a.entry.js.map +0 -1
- package/dist/huibo-ui/p-8a8443b8.entry.js +0 -2
- package/dist/huibo-ui/p-8a8443b8.entry.js.map +0 -1
- package/dist/huibo-ui/p-8fd788c9.entry.js +0 -2
- package/dist/huibo-ui/p-8fd788c9.entry.js.map +0 -1
- package/dist/huibo-ui/p-92521c31.entry.js +0 -2
- package/dist/huibo-ui/p-92521c31.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-aa5e5e02.entry.js.map +0 -1
- package/dist/huibo-ui/p-ab9cf0e4.entry.js.map +0 -1
- package/dist/huibo-ui/p-b8d87f7e.entry.js.map +0 -1
- package/dist/huibo-ui/p-c6c91664.entry.js +0 -2
- package/dist/huibo-ui/p-c6c91664.entry.js.map +0 -1
- package/dist/huibo-ui/p-c80f8ace.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-d79a15b1.entry.js +0 -2
- package/dist/huibo-ui/p-d79a15b1.entry.js.map +0 -1
- package/dist/huibo-ui/p-e10fcfbe.entry.js.map +0 -1
- package/dist/huibo-ui/p-e5cbfa9e.entry.js.map +0 -1
- package/dist/huibo-ui/p-ea74fcae.entry.js.map +0 -1
- package/dist/huibo-ui/p-edbda423.entry.js +0 -2
- package/dist/huibo-ui/p-edbda423.entry.js.map +0 -1
- package/dist/huibo-ui/p-f6889710.entry.js.map +0 -1
- package/dist/huibo-ui/p-f9bb5217.entry.js +0 -2
- package/dist/huibo-ui/p-f9bb5217.entry.js.map +0 -1
- package/dist/huibo-ui/p-fea20295.entry.js +0 -2
- package/dist/huibo-ui/p-fea20295.entry.js.map +0 -1
- /package/dist/huibo-ui/{p-678b4212.entry.js.map → p-0ddae4e9.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-f4336be9.entry.js.map → p-14c3b47b.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-c50ad398.entry.js.map → p-193efdc0.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-0d4b2997.entry.js.map → p-2bcda1bb.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-7da14d7c.entry.js.map → p-3042f986.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-e039155d.entry.js.map → p-3dacb26b.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-a084b8e5.entry.js.map → p-412ff618.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-ccd09d5a.entry.js.map → p-6518c435.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-cad57c2d.entry.js.map → p-7a682c56.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-a8996d22.entry.js.map → p-815fc943.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-af74667d.entry.js.map → p-89be7973.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-8fdbd17c.entry.js.map → p-950e7465.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-89ea1141.entry.js.map → p-ac45291c.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-41d9c846.entry.js.map → p-b6afe81e.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-f5969181.entry.js.map → p-dd9c6459.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-13010da2.entry.js.map → p-e9e7abca.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-b468858e.entry.js.map → p-f1f2483f.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-fd8301c6.entry.js.map → p-fd6831f9.entry.js.map} +0 -0
|
@@ -1,8 +1,47 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, g as getElement, h } from './index-fdf7135e.js';
|
|
2
2
|
import { c as createClickOutsideHandler } from './click-outside-291294f9.js';
|
|
3
|
-
import { h as handleListKeyboard } from './a11y-
|
|
3
|
+
import { a as activationClickHandler, h as handleListKeyboard } from './a11y-e4cde5b0.js';
|
|
4
4
|
|
|
5
|
-
const selectCss = "/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{appearance:button;background-color:#0000;border:0 solid;border-radius:0;box-sizing:border-box;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;margin:0;margin-inline-end:4px;opacity:1;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);line-height:1.5;tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex;padding-block:0}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}} /*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{}@layer base{}@layer components;:host{--hb-select-font-size:14px;--hb-select-height:32px;--hb-select-border-color:var(--hb-border-color,#dcdfe6);--hb-select-border-color-hover:var(--hb-color-primary);--hb-select-bg-color:var(--hb-color-white,#fff);--hb-select-text-color:var(--hb-color-text-regular,#606266);--hb-select-placeholder-color:var(--hb-color-text-placeholder,#c0c4cc);display:inline-block;position:relative}.hb-select{display:inline-block;position:relative;width:240px}.hb-select__input-wrapper{position:relative}.hb-select__input,.hb-select__input-wrapper{cursor:pointer;display:inline-block;width:100%}.hb-select__input{background-color:var(--hb-select-bg-color);border:1px solid var(--hb-select-border-color);border-radius:4px;box-sizing:border-box;color:var(--hb-select-text-color);font-size:var(--hb-select-font-size);height:var(--hb-select-height);line-height:var(--hb-select-height);outline:none;padding:0 30px 0 15px;transition:border-color .2s cubic-bezier(.645,.045,.355,1)}.hb-select__input::placeholder{color:var(--hb-select-placeholder-color)}.hb-select__input:focus,.hb-select__input:hover:not(:disabled){border-color:var(--hb-select-border-color-hover)}.hb-select__tags{align-items:center;background-color:var(--hb-select-bg-color);border:1px solid var(--hb-select-border-color);border-radius:4px;display:flex;flex-wrap:wrap;min-height:var(--hb-select-height);padding:0 30px 0 5px}.hb-select__tag{align-items:center;background-color:var(--hb-fill-color-light,#f0f2f5);border:1px solid var(--hb-border-color-lighter,#e4e7ed);border-radius:4px;color:var(--hb-color-text-regular,#606266);display:inline-flex;font-size:12px;height:24px;margin:2px 0 2px 6px;padding:0 8px}.hb-select__tag-text{margin-right:4px}.hb-select__tag-close{align-items:center;color:var(--hb-color-text-placeholder,#c0c4cc);cursor:pointer;display:inline-flex;height:12px;justify-content:center;transition:color .2s;width:12px}.hb-select__tag-close svg{height:100%;width:100%}.hb-select__tag-close:hover{color:var(--hb-color-text-regular,#606266)}.hb-select__suffix{align-items:center;color:var(--hb-select-text-color);display:flex;position:absolute;right:8px;top:50%;transform:translateY(-50%)}.hb-select__clear{align-items:center;color:var(--hb-select-placeholder-color);cursor:pointer;display:inline-flex;height:14px;justify-content:center;margin-right:8px;transition:color .2s;width:14px}.hb-select__clear svg{height:100%;width:100%}.hb-select__clear:hover{color:var(--hb-select-text-color)}.hb-select__arrow{align-items:center;color:var(--hb-select-placeholder-color);display:inline-flex;height:12px;justify-content:center;transition:transform .3s;width:12px}.hb-select__arrow svg{height:100%;width:100%}.hb-select--open .hb-select__arrow{transform:rotate(180deg)}.hb-select__dropdown{background-color:var(--hb-select-bg-color);border:1px solid var(--hb-select-border-color);border-radius:4px;box-shadow:0 2px 12px #0000001a;left:0;margin-top:4px;max-height:300px;min-width:100%;overflow-y:auto;position:absolute;top:100%;z-index:1000}.hb-select__menu{list-style:none;margin:0;padding:6px 0}.hb-select__menu-item{align-items:center;color:var(--hb-select-text-color);cursor:pointer;display:flex;font-size:var(--hb-select-font-size);padding:8px 20px;transition:background-color .2s}.hb-select__menu-item:hover:not(.hb-select__menu-item--disabled):not(.hb-select__menu-item--divided){background-color:var(--hb-fill-color-light,#f5f7fa)}.hb-select__menu-item--selected{color:var(--hb-color-primary);font-weight:600}.hb-select__menu-item--disabled{color:var(--hb-color-text-disabled,#c0c4cc);cursor:not-allowed}.hb-select__menu-item--divided{border-top:1px solid var(--hb-border-color-lighter,#e4e7ed);margin-top:6px;padding-top:6px}.hb-select__menu-item--empty{color:var(--hb-select-placeholder-color);cursor:default}.hb-select__menu-item-checkbox{align-items:center;color:var(--hb-color-primary,#1677ff);display:inline-flex;height:14px;justify-content:center;margin-right:8px;width:14px}.hb-select__menu-item-checkbox svg{height:100%;width:100%}.hb-select__menu-item--create{color:var(--hb-color-primary,#1677ff);font-weight:500}.hb-select__menu-item--create:hover{background-color:var(--hb-color-primary-bg,#e6f4ff)}.hb-select__menu-item-label{flex:1}.hb-select--small{font-size:12px}.hb-select--small .hb-select__input{font-size:12px;height:24px;line-height:24px;padding:0 25px 0 12px}.hb-select--large{font-size:16px}.hb-select--large .hb-select__input{font-size:16px;height:40px;line-height:40px;padding:0 35px 0 18px}.hb-select--disabled{cursor:not-allowed}.hb-select--disabled .hb-select__input{background-color:var(--hb-fill-color-light,#f5f7fa);border-color:var(--hb-select-border-color);color:var(--hb-color-text-disabled,#c0c4cc);cursor:not-allowed}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}";
|
|
5
|
+
/**
|
|
6
|
+
* 通用虚拟滚动工具(V1,包2)。
|
|
7
|
+
*
|
|
8
|
+
* 从 Table 的虚拟滚动逻辑提取,供 Select/Cascader/Tree/TreeSelect/Menu 复用。
|
|
9
|
+
* 仅渲染「可见窗口 + 上下缓冲」范围的项,而非全量列表——1000+ 选项时 DOM 节点数恒定。
|
|
10
|
+
*
|
|
11
|
+
* 用法(组件内):
|
|
12
|
+
* 1. 维护 scrollTop state(onScroll 回调更新)
|
|
13
|
+
* 2. 调 getVirtualRange({ total, itemHeight, viewportHeight, scrollTop, buffer }) 得 [start, end)
|
|
14
|
+
* 3. 仅渲染 list.slice(start, end),用 getOffsetTop(start, itemHeight) 撑出顶部空白
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* 计算可见窗口 [startIndex, endIndex)。
|
|
18
|
+
* startIndex 夹到 [0, total),endIndex 夹到 [0, total]。
|
|
19
|
+
*/
|
|
20
|
+
function getVirtualRange(opts) {
|
|
21
|
+
const { total, viewportHeight, scrollTop, buffer = 5 } = opts;
|
|
22
|
+
if (total <= 0)
|
|
23
|
+
return { startIndex: 0, endIndex: 0 };
|
|
24
|
+
const itemHeight = opts.itemHeight > 0 ? opts.itemHeight : 1;
|
|
25
|
+
let startIndex = Math.floor(scrollTop / itemHeight) - buffer;
|
|
26
|
+
if (startIndex < 0)
|
|
27
|
+
startIndex = 0;
|
|
28
|
+
let endIndex = Math.ceil((scrollTop + viewportHeight) / itemHeight) + buffer;
|
|
29
|
+
if (endIndex > total)
|
|
30
|
+
endIndex = total;
|
|
31
|
+
return { startIndex, endIndex };
|
|
32
|
+
}
|
|
33
|
+
/** 撑出顶部空白高度(px),用于偏移可见窗口到正确滚动位置。 */
|
|
34
|
+
function getOffsetTop(startIndex, itemHeight) {
|
|
35
|
+
const h = itemHeight > 0 ? itemHeight : 1;
|
|
36
|
+
return startIndex * h;
|
|
37
|
+
}
|
|
38
|
+
/** 容器总高度(px),用于撑出滚动条。 */
|
|
39
|
+
function getTotalHeight(total, itemHeight) {
|
|
40
|
+
const h = itemHeight > 0 ? itemHeight : 1;
|
|
41
|
+
return total * h;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const selectCss = "/*! 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-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--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{.relative{position:relative}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}} /*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{}@layer base{}@layer components;:host{--hb-select-font-size:14px;--hb-select-height:32px;--hb-select-border-color:var(--hb-border-color,#dcdfe6);--hb-select-border-color-hover:var(--hb-color-primary);--hb-select-bg-color:var(--hb-color-white,#fff);--hb-select-text-color:var(--hb-color-text-regular,#606266);--hb-select-placeholder-color:var(--hb-color-text-placeholder,#c0c4cc);display:inline-block;position:relative}.hb-select{display:inline-block;position:relative;width:240px}.hb-select__input-wrapper{position:relative}.hb-select__input,.hb-select__input-wrapper{cursor:pointer;display:inline-block;width:100%}.hb-select__input{background-color:var(--hb-select-bg-color);border:1px solid var(--hb-select-border-color);border-radius:4px;box-sizing:border-box;color:var(--hb-select-text-color);font-size:var(--hb-select-font-size);height:var(--hb-select-height);line-height:var(--hb-select-height);outline:none;padding:0 30px 0 15px;transition:border-color .2s cubic-bezier(.645,.045,.355,1)}.hb-select__input::placeholder{color:var(--hb-select-placeholder-color)}.hb-select__input:focus,.hb-select__input:hover:not(:disabled){border-color:var(--hb-select-border-color-hover)}.hb-select__tags{align-items:center;background-color:var(--hb-select-bg-color);border:1px solid var(--hb-select-border-color);border-radius:4px;display:flex;flex-wrap:wrap;min-height:var(--hb-select-height);padding:0 30px 0 5px}.hb-select__tag{align-items:center;background-color:var(--hb-fill-color-light,#f0f2f5);border:1px solid var(--hb-border-color-lighter,#e4e7ed);border-radius:4px;color:var(--hb-color-text-regular,#606266);display:inline-flex;font-size:12px;height:24px;margin:2px 0 2px 6px;padding:0 8px}.hb-select__tag-text{margin-right:4px}.hb-select__tag-close{align-items:center;color:var(--hb-color-text-placeholder,#c0c4cc);cursor:pointer;display:inline-flex;height:12px;justify-content:center;transition:color .2s;width:12px}.hb-select__tag-close svg{height:100%;width:100%}.hb-select__tag-close:hover{color:var(--hb-color-text-regular,#606266)}.hb-select__suffix{align-items:center;color:var(--hb-select-text-color);display:flex;position:absolute;right:8px;top:50%;transform:translateY(-50%)}.hb-select__clear{align-items:center;color:var(--hb-select-placeholder-color);cursor:pointer;display:inline-flex;height:14px;justify-content:center;margin-right:8px;transition:color .2s;width:14px}.hb-select__clear svg{height:100%;width:100%}.hb-select__clear:hover{color:var(--hb-select-text-color)}.hb-select__arrow{align-items:center;color:var(--hb-select-placeholder-color);display:inline-flex;height:12px;justify-content:center;transition:transform .3s;width:12px}.hb-select__arrow svg{height:100%;width:100%}.hb-select--open .hb-select__arrow{transform:rotate(180deg)}.hb-select__dropdown{background-color:var(--hb-select-bg-color);border:1px solid var(--hb-select-border-color);border-radius:4px;box-shadow:0 2px 12px #0000001a;left:0;margin-top:4px;max-height:300px;min-width:100%;overflow-y:auto;position:absolute;top:100%;z-index:1000}.hb-select__menu{list-style:none;margin:0;padding:6px 0}.hb-select__menu-item{align-items:center;color:var(--hb-select-text-color);cursor:pointer;display:flex;font-size:var(--hb-select-font-size);padding:8px 20px;transition:background-color .2s}.hb-select__menu-item:hover:not(.hb-select__menu-item--disabled):not(.hb-select__menu-item--divided){background-color:var(--hb-fill-color-light,#f5f7fa)}.hb-select__menu-item--selected{color:var(--hb-color-primary);font-weight:600}.hb-select__menu-item--disabled{color:var(--hb-color-text-disabled,#c0c4cc);cursor:not-allowed}.hb-select__menu-item--divided{border-top:1px solid var(--hb-border-color-lighter,#e4e7ed);margin-top:6px;padding-top:6px}.hb-select__menu-item--empty{color:var(--hb-select-placeholder-color);cursor:default}.hb-select__menu-item-checkbox{align-items:center;color:var(--hb-color-primary,#1677ff);display:inline-flex;height:14px;justify-content:center;margin-right:8px;width:14px}.hb-select__menu-item-checkbox svg{height:100%;width:100%}.hb-select__menu-item--create{color:var(--hb-color-primary,#1677ff);font-weight:500}.hb-select__menu-item--create:hover{background-color:var(--hb-color-primary-bg,#e6f4ff)}.hb-select__menu-item-label{flex:1}.hb-select--small{font-size:12px}.hb-select--small .hb-select__input{font-size:12px;height:24px;line-height:24px;padding:0 25px 0 12px}.hb-select--large{font-size:16px}.hb-select--large .hb-select__input{font-size:16px;height:40px;line-height:40px;padding:0 35px 0 18px}.hb-select--disabled{cursor:not-allowed}.hb-select--disabled .hb-select__input{background-color:var(--hb-fill-color-light,#f5f7fa);border-color:var(--hb-select-border-color);color:var(--hb-color-text-disabled,#c0c4cc);cursor:not-allowed}@property --tw-rotate-x{syntax:\"*\";inherits:false}@property --tw-rotate-y{syntax:\"*\";inherits:false}@property --tw-rotate-z{syntax:\"*\";inherits:false}@property --tw-skew-x{syntax:\"*\";inherits:false}@property --tw-skew-y{syntax:\"*\";inherits:false}@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
45
|
const HbSelectStyle0 = selectCss;
|
|
7
46
|
|
|
8
47
|
const Select = class {
|
|
@@ -71,12 +110,37 @@ const Select = class {
|
|
|
71
110
|
* 多选时最多显示多少个tag
|
|
72
111
|
*/
|
|
73
112
|
maxCollapseTags;
|
|
113
|
+
/**
|
|
114
|
+
* V1:是否开启虚拟滚动(1000+ 选项时推荐)。默认 false。
|
|
115
|
+
* 开启后下拉仅渲染可见窗口内的选项,DOM 节点数恒定。
|
|
116
|
+
*/
|
|
117
|
+
virtual = false;
|
|
118
|
+
/**
|
|
119
|
+
* V1:下拉最大高度(px)。virtual=true 时必填(定义视口高度)。默认 256。
|
|
120
|
+
*/
|
|
121
|
+
dropdownMaxHeight = 256;
|
|
122
|
+
/**
|
|
123
|
+
* V1:虚拟滚动每项预估高度(px)。默认 34。
|
|
124
|
+
*/
|
|
125
|
+
virtualItemHeight = 34;
|
|
74
126
|
isOpen = false;
|
|
75
127
|
inputValue = '';
|
|
76
128
|
searchValue = '';
|
|
77
129
|
filteredOptions = [];
|
|
78
130
|
/** 键盘高亮的选项索引(-1 表示无) */
|
|
79
131
|
activeOptionIndex = -1;
|
|
132
|
+
/** V1:下拉滚动位置(px),驱动虚拟滚动可见窗口重算 */
|
|
133
|
+
dropdownScrollTop = 0;
|
|
134
|
+
/** V1:下拉滚动回调 */
|
|
135
|
+
handleDropdownScroll = (e) => {
|
|
136
|
+
const target = e.target;
|
|
137
|
+
this.dropdownScrollTop = target.scrollTop;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* O4:实例级稳定 id,用于 combobox 的 aria-controls / aria-activedescendant 关联,
|
|
141
|
+
* 让读屏在键盘导航时播报当前高亮项。
|
|
142
|
+
*/
|
|
143
|
+
listboxId = `hb-select-listbox-${Math.random().toString(36).slice(2, 11)}`;
|
|
80
144
|
/**
|
|
81
145
|
* 值改变事件
|
|
82
146
|
*/
|
|
@@ -88,13 +152,19 @@ const Select = class {
|
|
|
88
152
|
clickOutside = createClickOutsideHandler({
|
|
89
153
|
host: null,
|
|
90
154
|
isOpen: () => this.isOpen,
|
|
91
|
-
onClose: () => {
|
|
155
|
+
onClose: () => {
|
|
156
|
+
this.isOpen = false;
|
|
157
|
+
this.hbVisibleChange.emit(false);
|
|
158
|
+
},
|
|
92
159
|
});
|
|
93
160
|
componentDidLoad() {
|
|
94
161
|
this.clickOutside = createClickOutsideHandler({
|
|
95
162
|
host: this.el,
|
|
96
163
|
isOpen: () => this.isOpen,
|
|
97
|
-
onClose: () => {
|
|
164
|
+
onClose: () => {
|
|
165
|
+
this.isOpen = false;
|
|
166
|
+
this.hbVisibleChange.emit(false);
|
|
167
|
+
},
|
|
98
168
|
});
|
|
99
169
|
this.clickOutside.connect();
|
|
100
170
|
this.updateInputValue();
|
|
@@ -148,8 +218,7 @@ const Select = class {
|
|
|
148
218
|
const displayOptions = this.filterable ? this.filteredOptions : this.options;
|
|
149
219
|
if (!this.isOpen) {
|
|
150
220
|
// 关闭态:Enter / Space / 方向键 展开
|
|
151
|
-
if (e.key === 'Enter' || e.key === ' ' || e.key === 'Spacebar' ||
|
|
152
|
-
e.key === 'ArrowDown' || e.key === 'ArrowUp') {
|
|
221
|
+
if (e.key === 'Enter' || e.key === ' ' || e.key === 'Spacebar' || e.key === 'ArrowDown' || e.key === 'ArrowUp') {
|
|
153
222
|
e.preventDefault();
|
|
154
223
|
this.isOpen = true;
|
|
155
224
|
this.activeOptionIndex = -1;
|
|
@@ -262,28 +331,40 @@ const Select = class {
|
|
|
262
331
|
this.updateInputValue();
|
|
263
332
|
this.hbChange.emit(this.modelValue);
|
|
264
333
|
};
|
|
334
|
+
/** 渲染单个选项 <li>(普通 + 虚拟滚动共用,V1 提取) */
|
|
335
|
+
renderOption(option, index) {
|
|
336
|
+
return (h("li", { id: `${this.listboxId}-opt-${index}`, class: {
|
|
337
|
+
'hb-select__menu-item': true,
|
|
338
|
+
'hb-select__menu-item--selected': this.isSelected(option),
|
|
339
|
+
'hb-select__menu-item--disabled': option.disabled,
|
|
340
|
+
'hb-select__menu-item--divided': option.divided,
|
|
341
|
+
'hb-select__menu-item--active': index === this.activeOptionIndex,
|
|
342
|
+
}, style: this.virtual ? { height: `${this.virtualItemHeight}px` } : undefined, role: "option", "aria-selected": this.isSelected(option) ? 'true' : 'false', "aria-disabled": option.disabled ? 'true' : undefined, onClick: () => this.handleSelect(option) }, this.multiple && (h("span", { class: "hb-select__menu-item-checkbox", "aria-hidden": "true" }, this.isSelected(option) ? (h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": 3, "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M5 12l5 5L20 7" }))) : null)), h("span", { class: "hb-select__menu-item-label" }, option.label)));
|
|
343
|
+
}
|
|
265
344
|
render() {
|
|
266
345
|
const displayOptions = this.filterable ? this.filteredOptions : this.options;
|
|
267
|
-
const showClear = this.clearable && this.modelValue !== undefined &&
|
|
268
|
-
|
|
269
|
-
return (h("div", { key: 'dded29eec6498d2f1e64ecdfac47b3a38827d0b1', class: {
|
|
346
|
+
const showClear = this.clearable && this.modelValue !== undefined && (this.multiple ? this.modelValue.length > 0 : true);
|
|
347
|
+
return (h("div", { key: '711a2660ec0ff788a027b7097a64f74ee535ae58', class: {
|
|
270
348
|
'hb-select': true,
|
|
271
349
|
'hb-select--open': this.isOpen,
|
|
272
350
|
'hb-select--disabled': this.disabled,
|
|
273
351
|
[`hb-select--${this.size}`]: true,
|
|
274
|
-
}, "aria-haspopup": "listbox", "aria-expanded": this.isOpen ? 'true' : 'false' }, h("div", { key: '
|
|
352
|
+
}, role: "combobox", "aria-haspopup": "listbox", "aria-expanded": this.isOpen ? 'true' : 'false', "aria-controls": this.isOpen ? this.listboxId : undefined, "aria-activedescendant": this.isOpen && this.activeOptionIndex >= 0 ? `${this.listboxId}-opt-${this.activeOptionIndex}` : undefined }, h("div", { key: '7719c10931fd36306a7bc302b167c43a782158bd', class: "hb-select__input-wrapper", onClick: this.handleInputClick, onKeyDown: this.handleWrapperKeydown }, this.multiple && Array.isArray(this.modelValue) && this.modelValue.length > 0 ? (h("div", { class: "hb-select__tags" }, this.modelValue.slice(0, this.collapseTags && this.maxCollapseTags ? this.maxCollapseTags : undefined).map(val => {
|
|
275
353
|
const option = this.options.find(opt => opt.value === val);
|
|
276
|
-
return (h("span", { class: "hb-select__tag" }, h("span", { class: "hb-select__tag-text" }, option ? option.label : val), h("span", { class: "hb-select__tag-close", role: "button", "aria-label": "\u79FB\u9664\u6807\u7B7E", onClick:
|
|
354
|
+
return (h("span", { class: "hb-select__tag" }, h("span", { class: "hb-select__tag-text" }, option ? option.label : val), h("span", { class: "hb-select__tag-close", role: "button", "aria-label": "\u79FB\u9664\u6807\u7B7E", tabIndex: 0, onClick: e => {
|
|
277
355
|
e.stopPropagation();
|
|
278
356
|
this.handleSelect(option || { value: val, label: String(val) });
|
|
279
|
-
} }, 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" })))));
|
|
280
|
-
}), this.collapseTags && this.maxCollapseTags && this.modelValue.length > this.maxCollapseTags && (h("span", { class: "hb-select__tag" }, h("span", { class: "hb-select__tag-text" }, "+", this.modelValue.length - this.maxCollapseTags))))) : (h("input", { type: "text", class: "hb-select__input", placeholder: this.placeholder, value: this.filterable && this.isOpen ? this.searchValue : this.inputValue, disabled: this.disabled, readonly: !this.filterable || !this.isOpen, onInput: this.handleSearch, "aria-haspopup": "listbox", "aria-expanded": this.isOpen ? 'true' : 'false', role: "combobox" })), h("span", { key: '
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
357
|
+
}, onKeyDown: activationClickHandler }, 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" })))));
|
|
358
|
+
}), this.collapseTags && this.maxCollapseTags && this.modelValue.length > this.maxCollapseTags && (h("span", { class: "hb-select__tag" }, h("span", { class: "hb-select__tag-text" }, "+", this.modelValue.length - this.maxCollapseTags))))) : (h("input", { type: "text", class: "hb-select__input", placeholder: this.placeholder, value: this.filterable && this.isOpen ? this.searchValue : this.inputValue, disabled: this.disabled, readonly: !this.filterable || !this.isOpen, onInput: this.handleSearch, "aria-haspopup": "listbox", "aria-expanded": this.isOpen ? 'true' : 'false', role: "combobox" })), h("span", { key: 'a9dc4ecd508bb6828296cf2a9465ab5c24595573', class: "hb-select__suffix" }, showClear && (h("span", { key: 'cde7a95063f12c03844303681a3a95da1f5aaa66', class: "hb-select__clear", role: "button", "aria-label": "\u6E05\u7A7A", tabIndex: 0, onClick: this.handleClear, onKeyDown: activationClickHandler }, h("svg", { key: 'a9abef626a4a3da495afffe7e562fb557a26f8e7', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": 2, "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { key: 'a95c9113f3c7ef741dc9a8111576827571668ecf', d: "M6 6l12 12M18 6L6 18" })))), h("span", { key: '184023640706c01ed18854cb5b1975f9def18dc4', class: "hb-select__arrow", "aria-hidden": "true" }, h("svg", { key: '14fec9c7d46ad1d22ddf07de502aedabe8b19b18', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": 2, "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { key: 'd280de7e1545be150238126b65f6c37e499bb83a', d: "M6 9l6 6 6-6" }))))), this.isOpen && (h("div", { key: 'e9a10e24e49095535c232ec39be458780789fde4', class: "hb-select__dropdown" }, h("ul", { key: '874854750698dcb2346cbd3a965ba0e500b5bafc', class: "hb-select__menu", role: "listbox", id: this.listboxId,
|
|
359
|
+
// V1:虚拟滚动时滚动容器限高 + onScroll 更新可见窗口
|
|
360
|
+
style: this.virtual ? { maxHeight: `${this.dropdownMaxHeight}px`, overflowY: 'auto' } : undefined, onScroll: this.virtual ? this.handleDropdownScroll : undefined }, this.createOption && (h("li", { key: '5ca5a633a0d69ddb1ba065bb08d947d663b774ac', class: { 'hb-select__menu-item': true, 'hb-select__menu-item--create': true }, role: "option", "aria-selected": "false", onClick: this.handleCreate }, h("span", { key: 'f986194f0456c910bba2447603505edce6cb6e60', class: "hb-select__menu-item-label" }, "\u521B\u5EFA\u300C", this.createOption.label, "\u300D"))), displayOptions.length === 0 && !this.createOption ? (h("li", { class: "hb-select__menu-item hb-select__menu-item--empty", "aria-disabled": "true" }, "\u65E0\u6570\u636E")) : this.virtual ? (
|
|
361
|
+
// V1:虚拟滚动——仅渲染可见窗口 + 顶部撑高 spacer
|
|
362
|
+
h("div", { style: { height: `${getTotalHeight(displayOptions.length, this.virtualItemHeight)}px`, position: 'relative' } }, h("div", { style: { transform: `translateY(${getOffsetTop(getVirtualRange({ total: displayOptions.length, itemHeight: this.virtualItemHeight, viewportHeight: this.dropdownMaxHeight, scrollTop: this.dropdownScrollTop }).startIndex, this.virtualItemHeight)}px)` } }, displayOptions
|
|
363
|
+
.slice(getVirtualRange({ total: displayOptions.length, itemHeight: this.virtualItemHeight, viewportHeight: this.dropdownMaxHeight, scrollTop: this.dropdownScrollTop }).startIndex, getVirtualRange({ total: displayOptions.length, itemHeight: this.virtualItemHeight, viewportHeight: this.dropdownMaxHeight, scrollTop: this.dropdownScrollTop }).endIndex)
|
|
364
|
+
.map((option, i) => {
|
|
365
|
+
const absIndex = getVirtualRange({ total: displayOptions.length, itemHeight: this.virtualItemHeight, viewportHeight: this.dropdownMaxHeight, scrollTop: this.dropdownScrollTop }).startIndex + i;
|
|
366
|
+
return this.renderOption(option, absIndex);
|
|
367
|
+
})))) : (displayOptions.map((option, index) => this.renderOption(option, index))))))));
|
|
287
368
|
}
|
|
288
369
|
static get watchers() { return {
|
|
289
370
|
"modelValue": ["handleValueChange"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"hb-select.entry.js","mappings":";;;;AAAA,MAAM,SAAS,GAAG,guUAAguU,CAAC;AACnvU,uBAAe,SAAS;;MCmBX,MAAM;;;;;;;;;;IAMQ,UAAU,CAAyC;;;;IAKpE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AE,KAAK,MAC/B,UACE,KAAK,EAAE;gBACL,sBAAsB,EAAE,IAAI;gBAC5B,gCAAgC,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;gBACzD,gCAAgC,EAAE,MAAM,CAAC,QAAQ;gBACjD,+BAA+B,EAAE,MAAM,CAAC,OAAO;gBAC/C,8BAA8B,EAAE,KAAK,KAAK,IAAI,CAAC,iBAAiB;aACjE,EACD,IAAI,EAAC,QAAQ,mBACE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,OAAO,mBAC1C,MAAM,CAAC,QAAQ,GAAG,MAAM,GAAG,SAAS,EACnD,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,IAEvC,IAAI,CAAC,QAAQ,KACZ,YAAM,KAAK,EAAC,+BAA+B,iBAAa,MAAM,IAC3D,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IACtB,WAAK,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,kBAAe,CAAC,oBAAiB,OAAO,qBAAiB,OAAO,IACxH,YAAM,CAAC,EAAC,gBAAgB,GAAG,CACvB,IACJ,IAAI,CACH,CACR,EACD,YAAM,KAAK,EAAC,4BAA4B,IAAE,MAAM,CAAC,KAAK,CAAQ,CAC3D,CACN,CAAC,CACH,CACE,CACD,CACP,CACG,EACN;KACH;;;;;;;;;;","names":[],"sources":["src/components/Select/select.css?tag=hb-select&encapsulation=shadow","src/components/Select/Select.tsx"],"sourcesContent":[":host {\n display: inline-block;\n position: relative;\n --hb-select-font-size: 14px;\n --hb-select-height: 32px;\n --hb-select-border-color: var(--hb-border-color, #dcdfe6);\n --hb-select-border-color-hover: var(--hb-color-primary);\n --hb-select-bg-color: var(--hb-color-white, #ffffff);\n --hb-select-text-color: var(--hb-color-text-regular, #606266);\n --hb-select-placeholder-color: var(--hb-color-text-placeholder, #c0c4cc);\n}\n\n.hb-select {\n display: inline-block;\n position: relative;\n width: 240px;\n}\n\n.hb-select__input-wrapper {\n position: relative;\n display: inline-block;\n width: 100%;\n cursor: pointer;\n}\n\n.hb-select__input {\n display: inline-block;\n width: 100%;\n height: var(--hb-select-height);\n line-height: var(--hb-select-height);\n padding: 0 30px 0 15px;\n font-size: var(--hb-select-font-size);\n color: var(--hb-select-text-color);\n background-color: var(--hb-select-bg-color);\n border: 1px solid var(--hb-select-border-color);\n border-radius: 4px;\n box-sizing: border-box;\n cursor: pointer;\n outline: none;\n transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n}\n\n.hb-select__input::placeholder {\n color: var(--hb-select-placeholder-color);\n}\n\n.hb-select__input:hover:not(:disabled) {\n border-color: var(--hb-select-border-color-hover);\n}\n\n.hb-select__input:focus {\n border-color: var(--hb-select-border-color-hover);\n}\n\n.hb-select__tags {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n padding: 0 30px 0 5px;\n min-height: var(--hb-select-height);\n border: 1px solid var(--hb-select-border-color);\n border-radius: 4px;\n background-color: var(--hb-select-bg-color);\n}\n\n.hb-select__tag {\n display: inline-flex;\n align-items: center;\n height: 24px;\n padding: 0 8px;\n margin: 2px 0 2px 6px;\n background-color: var(--hb-fill-color-light, #f0f2f5);\n border: 1px solid var(--hb-border-color-lighter, #e4e7ed);\n border-radius: 4px;\n font-size: 12px;\n color: var(--hb-color-text-regular, #606266);\n}\n\n.hb-select__tag-text {\n margin-right: 4px;\n}\n\n.hb-select__tag-close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 12px;\n height: 12px;\n cursor: pointer;\n color: var(--hb-color-text-placeholder, #c0c4cc);\n transition: color 0.2s;\n}\n\n.hb-select__tag-close svg {\n width: 100%;\n height: 100%;\n}\n\n.hb-select__tag-close:hover {\n color: var(--hb-color-text-regular, #606266);\n}\n\n.hb-select__suffix {\n position: absolute;\n right: 8px;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n color: var(--hb-select-text-color);\n}\n\n.hb-select__clear {\n margin-right: 8px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 14px;\n height: 14px;\n cursor: pointer;\n color: var(--hb-select-placeholder-color);\n transition: color 0.2s;\n}\n\n.hb-select__clear svg {\n width: 100%;\n height: 100%;\n}\n\n.hb-select__clear:hover {\n color: var(--hb-select-text-color);\n}\n\n.hb-select__arrow {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 12px;\n height: 12px;\n color: var(--hb-select-placeholder-color);\n transition: transform 0.3s;\n}\n\n.hb-select__arrow svg {\n width: 100%;\n height: 100%;\n}\n\n.hb-select--open .hb-select__arrow {\n transform: rotate(180deg);\n}\n\n.hb-select__dropdown {\n position: absolute;\n top: 100%;\n left: 0;\n margin-top: 4px;\n background-color: var(--hb-select-bg-color);\n border: 1px solid var(--hb-select-border-color);\n border-radius: 4px;\n box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);\n z-index: 1000;\n min-width: 100%;\n max-height: 300px;\n overflow-y: auto;\n}\n\n.hb-select__menu {\n margin: 0;\n padding: 6px 0;\n list-style: none;\n}\n\n.hb-select__menu-item {\n display: flex;\n align-items: center;\n padding: 8px 20px;\n font-size: var(--hb-select-font-size);\n color: var(--hb-select-text-color);\n cursor: pointer;\n transition: background-color 0.2s;\n}\n\n.hb-select__menu-item:hover:not(.hb-select__menu-item--disabled):not(.hb-select__menu-item--divided) {\n background-color: var(--hb-fill-color-light, #f5f7fa);\n}\n\n.hb-select__menu-item--selected {\n color: var(--hb-color-primary);\n font-weight: 600;\n}\n\n.hb-select__menu-item--disabled {\n color: var(--hb-color-text-disabled, #c0c4cc);\n cursor: not-allowed;\n}\n\n.hb-select__menu-item--divided {\n border-top: 1px solid var(--hb-border-color-lighter, #e4e7ed);\n margin-top: 6px;\n padding-top: 6px;\n}\n\n.hb-select__menu-item--empty {\n color: var(--hb-select-placeholder-color);\n cursor: default;\n}\n\n.hb-select__menu-item-checkbox {\n margin-right: 8px;\n width: 14px;\n height: 14px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n color: var(--hb-color-primary, #1677ff);\n}\n\n.hb-select__menu-item-checkbox svg {\n width: 100%;\n height: 100%;\n}\n\n.hb-select__menu-item--create {\n color: var(--hb-color-primary, #1677ff);\n font-weight: 500;\n}\n\n.hb-select__menu-item--create:hover {\n background-color: var(--hb-color-primary-bg, #e6f4ff);\n}\n\n.hb-select__menu-item-label {\n flex: 1;\n}\n\n.hb-select--small {\n font-size: 12px;\n}\n\n.hb-select--small .hb-select__input {\n height: 24px;\n line-height: 24px;\n font-size: 12px;\n padding: 0 25px 0 12px;\n}\n\n.hb-select--large {\n font-size: 16px;\n}\n\n.hb-select--large .hb-select__input {\n height: 40px;\n line-height: 40px;\n font-size: 16px;\n padding: 0 35px 0 18px;\n}\n\n.hb-select--disabled {\n cursor: not-allowed;\n}\n\n.hb-select--disabled .hb-select__input {\n background-color: var(--hb-fill-color-light, #f5f7fa);\n border-color: var(--hb-select-border-color);\n color: var(--hb-color-text-disabled, #c0c4cc);\n cursor: not-allowed;\n}\n\n","import { Component, h, Prop, Event, EventEmitter, State, Element, Watch } from '@stencil/core';\nimport { createClickOutsideHandler } from '../../utils/click-outside';\nimport { handleListKeyboard } from '../../utils/a11y';\n\nexport interface SelectOption {\n value: string | number;\n label: string;\n disabled?: boolean;\n divided?: boolean;\n}\n\n/**\n * Select 选择器组件\n * 当选项过多时,使用下拉菜单展示并选择内容\n */\n@Component({\n tag: 'hb-select',\n styleUrl: 'select.css',\n shadow: true,\n})\nexport class Select {\n @Element() el: HTMLElement;\n\n /**\n * 绑定值\n */\n @Prop({ mutable: true }) modelValue?: string | number | (string | number)[];\n\n /**\n * 可选项数据源\n */\n @Prop() options: SelectOption[] = [];\n\n /**\n * 输入框占位文本\n */\n @Prop() placeholder: string = '请选择';\n\n /**\n * 是否禁用\n * @default false\n */\n @Prop() disabled: boolean = false;\n\n /**\n * 输入框尺寸\n */\n @Prop() size: 'large' | 'default' | 'small' = 'default';\n\n /**\n * 是否可清空\n * @default false\n */\n @Prop() clearable: boolean = false;\n\n /**\n * 是否多选\n * @default false\n */\n @Prop() multiple: boolean = false;\n\n /**\n * 是否可搜索\n * @default false\n */\n @Prop() filterable: boolean = false;\n\n /**\n * 自定义过滤方法\n */\n @Prop() filterMethod?: (query: string) => void;\n\n /**\n * 是否默认展开\n * @default false\n */\n @Prop() defaultFirstOption: boolean = false;\n\n /**\n * 是否允许创建新条目\n * @default false\n */\n @Prop() allowCreate: boolean = false;\n\n /**\n * 多选时是否将选中值按文字的形式展示\n * @default false\n */\n @Prop() collapseTags: boolean = false;\n\n /**\n * 多选时最多显示多少个tag\n */\n @Prop() maxCollapseTags?: number;\n\n @State() isOpen: boolean = false;\n @State() inputValue: string = '';\n @State() searchValue: string = '';\n @State() filteredOptions: SelectOption[] = [];\n /** 键盘高亮的选项索引(-1 表示无) */\n @State() activeOptionIndex: number = -1;\n\n /**\n * 值改变事件\n */\n @Event() hbChange: EventEmitter<string | number | (string | number)[]>;\n\n /**\n * 下拉框出现/隐藏时触发\n */\n @Event() hbVisibleChange: EventEmitter<boolean>;\n\n private clickOutside = createClickOutsideHandler({\n host: null as any,\n isOpen: () => this.isOpen,\n onClose: () => { this.isOpen = false; this.hbVisibleChange.emit(false); },\n });\n\n componentDidLoad() {\n this.clickOutside = createClickOutsideHandler({\n host: this.el,\n isOpen: () => this.isOpen,\n onClose: () => { this.isOpen = false; this.hbVisibleChange.emit(false); },\n });\n this.clickOutside.connect();\n this.updateInputValue();\n if (this.filterable) {\n this.filteredOptions = this.options;\n }\n }\n\n disconnectedCallback() {\n this.clickOutside.disconnect();\n }\n\n @Watch('modelValue')\n handleValueChange() {\n this.updateInputValue();\n }\n\n @Watch('options')\n handleOptionsChange() {\n if (this.filterable) {\n this.filteredOptions = this.options;\n }\n }\n\n private updateInputValue() {\n if (!this.modelValue) {\n this.inputValue = '';\n return;\n }\n\n if (this.multiple && Array.isArray(this.modelValue)) {\n const labels = this.modelValue.map(val => {\n const option = this.options.find(opt => opt.value === val);\n return option ? option.label : String(val);\n });\n this.inputValue = labels.join(', ');\n } else {\n const option = this.options.find(opt => opt.value === this.modelValue);\n this.inputValue = option ? option.label : String(this.modelValue);\n }\n }\n\n private handleInputClick = () => {\n if (this.disabled) return;\n this.isOpen = !this.isOpen;\n if (this.isOpen) {\n // defaultFirstOption=true:打开时自动高亮第一个可选(非禁用)项\n this.activeOptionIndex = this.defaultFirstOption\n ? Math.max(-1, this.options.findIndex(o => !o.disabled))\n : -1;\n }\n this.hbVisibleChange.emit(this.isOpen);\n };\n\n private handleWrapperKeydown = (e: KeyboardEvent) => {\n if (this.disabled) return;\n const displayOptions = this.filterable ? this.filteredOptions : this.options;\n\n if (!this.isOpen) {\n // 关闭态:Enter / Space / 方向键 展开\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Spacebar' ||\n e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n this.isOpen = true;\n this.activeOptionIndex = -1;\n this.hbVisibleChange.emit(true);\n }\n return;\n }\n\n const action = handleListKeyboard(e, {\n activeIndex: this.activeOptionIndex,\n itemCount: displayOptions.length,\n loop: true,\n });\n switch (action.type) {\n case 'navigate':\n e.preventDefault();\n this.activeOptionIndex = action.index;\n break;\n case 'select': {\n e.preventDefault();\n const opt = displayOptions[action.index];\n if (opt && !opt.disabled) this.handleSelect(opt);\n break;\n }\n case 'close':\n e.preventDefault();\n this.isOpen = false;\n this.hbVisibleChange.emit(false);\n break;\n default:\n break;\n }\n };\n\n private handleSelect = (option: SelectOption) => {\n if (option.disabled) return;\n\n if (this.multiple) {\n const currentValue = (this.modelValue as (string | number)[]) || [];\n const index = currentValue.indexOf(option.value);\n \n if (index > -1) {\n currentValue.splice(index, 1);\n } else {\n currentValue.push(option.value);\n }\n \n this.modelValue = [...currentValue];\n } else {\n this.modelValue = option.value;\n this.isOpen = false;\n this.hbVisibleChange.emit(false);\n }\n \n this.updateInputValue();\n this.hbChange.emit(this.modelValue);\n };\n\n private handleClear = (e: Event) => {\n e.stopPropagation();\n this.modelValue = this.multiple ? [] : undefined;\n this.inputValue = '';\n this.isOpen = false;\n this.hbChange.emit(this.modelValue);\n this.hbVisibleChange.emit(false);\n };\n\n private handleSearch = (e: Event) => {\n const target = e.target as HTMLInputElement;\n this.searchValue = target.value;\n \n if (this.filterMethod) {\n this.filterMethod(target.value);\n } else {\n this.filteredOptions = this.options.filter(opt =>\n opt.label.toLowerCase().includes(target.value.toLowerCase())\n );\n }\n };\n\n private isSelected(option: SelectOption): boolean {\n if (this.multiple && Array.isArray(this.modelValue)) {\n return this.modelValue.includes(option.value);\n }\n return this.modelValue === option.value;\n }\n\n /**\n * allowCreate + filterable:当用户输入的文本在已有选项中不存在时,\n * 渲染一个\"创建 xxx\"项。返回待创建的文本(已 trim);无需创建返回 null。\n */\n private get createOption(): SelectOption | null {\n if (!this.allowCreate || !this.filterable || !this.isOpen) return null;\n const q = this.searchValue.trim();\n if (!q) return null;\n const exists = this.options.some(o => String(o.label).toLowerCase() === q.toLowerCase() || String(o.value).toLowerCase() === q.toLowerCase());\n if (exists) return null;\n return { value: q, label: q };\n }\n\n private handleCreate = () => {\n const opt = this.createOption;\n if (!opt) return;\n if (this.multiple) {\n const arr = ((this.modelValue as (string | number)[]) || []).slice();\n if (!arr.includes(opt.value)) arr.push(opt.value);\n this.modelValue = arr;\n } else {\n this.modelValue = opt.value;\n this.isOpen = false;\n this.hbVisibleChange.emit(false);\n }\n this.searchValue = '';\n this.filteredOptions = this.options;\n this.updateInputValue();\n this.hbChange.emit(this.modelValue);\n };\n\n render() {\n const displayOptions = this.filterable ? this.filteredOptions : this.options;\n const showClear = this.clearable && this.modelValue !== undefined &&\n (this.multiple ? (this.modelValue as any[]).length > 0 : true);\n\n return (\n <div\n class={{\n 'hb-select': true,\n 'hb-select--open': this.isOpen,\n 'hb-select--disabled': this.disabled,\n [`hb-select--${this.size}`]: true,\n }}\n aria-haspopup=\"listbox\"\n aria-expanded={this.isOpen ? 'true' : 'false'}\n >\n <div class=\"hb-select__input-wrapper\" onClick={this.handleInputClick} onKeyDown={this.handleWrapperKeydown}>\n {this.multiple && Array.isArray(this.modelValue) && this.modelValue.length > 0 ? (\n <div class=\"hb-select__tags\">\n {this.modelValue.slice(0, this.collapseTags && this.maxCollapseTags ? this.maxCollapseTags : undefined).map((val) => {\n const option = this.options.find(opt => opt.value === val);\n return (\n <span class=\"hb-select__tag\">\n <span class=\"hb-select__tag-text\">{option ? option.label : val}</span>\n <span\n class=\"hb-select__tag-close\"\n role=\"button\"\n aria-label=\"移除标签\"\n onClick={(e) => {\n e.stopPropagation();\n this.handleSelect(option || { value: val, label: String(val) });\n }}\n >\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width={2} stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M6 6l12 12M18 6L6 18\" />\n </svg>\n </span>\n </span>\n );\n })}\n {this.collapseTags && this.maxCollapseTags && this.modelValue.length > this.maxCollapseTags && (\n <span class=\"hb-select__tag\">\n <span class=\"hb-select__tag-text\">+{this.modelValue.length - this.maxCollapseTags}</span>\n </span>\n )}\n </div>\n ) : (\n <input\n type=\"text\"\n class=\"hb-select__input\"\n placeholder={this.placeholder}\n value={this.filterable && this.isOpen ? this.searchValue : this.inputValue}\n disabled={this.disabled}\n readonly={!this.filterable || !this.isOpen}\n onInput={this.handleSearch}\n aria-haspopup=\"listbox\"\n aria-expanded={this.isOpen ? 'true' : 'false'}\n role=\"combobox\"\n />\n )}\n <span class=\"hb-select__suffix\">\n {showClear && (\n <span class=\"hb-select__clear\" role=\"button\" aria-label=\"清空\" onClick={this.handleClear}>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width={2} stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M6 6l12 12M18 6L6 18\" />\n </svg>\n </span>\n )}\n <span class=\"hb-select__arrow\" aria-hidden=\"true\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width={2} stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M6 9l6 6 6-6\" />\n </svg>\n </span>\n </span>\n </div>\n {this.isOpen && (\n <div class=\"hb-select__dropdown\">\n <ul class=\"hb-select__menu\" role=\"listbox\">\n {/* allowCreate:用户输入文本不存在时,渲染创建项(置顶) */}\n {this.createOption && (\n <li\n class={{ 'hb-select__menu-item': true, 'hb-select__menu-item--create': true }}\n role=\"option\"\n aria-selected=\"false\"\n onClick={this.handleCreate}\n >\n <span class=\"hb-select__menu-item-label\">\n 创建「{this.createOption.label}」\n </span>\n </li>\n )}\n {displayOptions.length === 0 && !this.createOption ? (\n <li class=\"hb-select__menu-item hb-select__menu-item--empty\" aria-disabled=\"true\">无数据</li>\n ) : (\n displayOptions.map((option, index) => (\n <li\n class={{\n 'hb-select__menu-item': true,\n 'hb-select__menu-item--selected': this.isSelected(option),\n 'hb-select__menu-item--disabled': option.disabled,\n 'hb-select__menu-item--divided': option.divided,\n 'hb-select__menu-item--active': index === this.activeOptionIndex,\n }}\n role=\"option\"\n aria-selected={this.isSelected(option) ? 'true' : 'false'}\n aria-disabled={option.disabled ? 'true' : undefined}\n onClick={() => this.handleSelect(option)}\n >\n {this.multiple && (\n <span class=\"hb-select__menu-item-checkbox\" aria-hidden=\"true\">\n {this.isSelected(option) ? (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width={3} stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M5 12l5 5L20 7\" />\n </svg>\n ) : null}\n </span>\n )}\n <span class=\"hb-select__menu-item-label\">{option.label}</span>\n </li>\n ))\n )}\n </ul>\n </div>\n )}\n </div>\n );\n }\n}\n\n"],"version":3}
|
|
1
|
+
{"file":"hb-select.entry.js","mappings":";;;;AAAA;;;;;;;;;;;AAgCA;;;;SAIgB,eAAe,CAAC,IAAyB;IACvD,MAAM,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AAE,cAAc,EAAE,IAAI,CAAC,iBAAiB,EAAE,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC,UAAU,EAC3K,eAAe,CAAC,EAAE,KAAK,EAAE,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,iBAAiB,EAAE,cAAc,EAAE,IAAI,CAAC,iBAAiB,EAAE,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC,QAAQ,CAC1K;aACA,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;YACb,MAAM,QAAQ,GAAG,eAAe,CAAC,EAAE,KAAK,EAAE,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,iBAAiB,EAAE,cAAc,EAAE,IAAI,CAAC,iBAAiB,EAAE,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC;YACjM,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;SAC5C,CAAC,CACA,CACF,KAEN,cAAc,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,KAAK,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CACxE,CACE,CACD,CACP,CACG,EACN;KACH;;;;;;;;;;","names":[],"sources":["src/utils/virtual-scroll.ts","src/components/Select/select.css?tag=hb-select&encapsulation=shadow","src/components/Select/Select.tsx"],"sourcesContent":["/**\n * 通用虚拟滚动工具(V1,包2)。\n *\n * 从 Table 的虚拟滚动逻辑提取,供 Select/Cascader/Tree/TreeSelect/Menu 复用。\n * 仅渲染「可见窗口 + 上下缓冲」范围的项,而非全量列表——1000+ 选项时 DOM 节点数恒定。\n *\n * 用法(组件内):\n * 1. 维护 scrollTop state(onScroll 回调更新)\n * 2. 调 getVirtualRange({ total, itemHeight, viewportHeight, scrollTop, buffer }) 得 [start, end)\n * 3. 仅渲染 list.slice(start, end),用 getOffsetTop(start, itemHeight) 撑出顶部空白\n */\n\nexport interface VirtualRangeOptions {\n /** 列表总项数 */\n total: number;\n /** 每项高度(px),>0 */\n itemHeight: number;\n /** 视口高度(px) */\n viewportHeight: number;\n /** 当前滚动位置(px) */\n scrollTop: number;\n /** 上下缓冲行数(默认 5) */\n buffer?: number;\n}\n\nexport interface VirtualRange {\n /** 起始索引(含) */\n startIndex: number;\n /** 结束索引(不含) */\n endIndex: number;\n}\n\n/**\n * 计算可见窗口 [startIndex, endIndex)。\n * startIndex 夹到 [0, total),endIndex 夹到 [0, total]。\n */\nexport function getVirtualRange(opts: VirtualRangeOptions): VirtualRange {\n const { total, viewportHeight, scrollTop, buffer = 5 } = opts;\n if (total <= 0) return { startIndex: 0, endIndex: 0 };\n const itemHeight = opts.itemHeight > 0 ? opts.itemHeight : 1;\n\n let startIndex = Math.floor(scrollTop / itemHeight) - buffer;\n if (startIndex < 0) startIndex = 0;\n\n let endIndex = Math.ceil((scrollTop + viewportHeight) / itemHeight) + buffer;\n if (endIndex > total) endIndex = total;\n\n return { startIndex, endIndex };\n}\n\n/** 撑出顶部空白高度(px),用于偏移可见窗口到正确滚动位置。 */\nexport function getOffsetTop(startIndex: number, itemHeight: number): number {\n const h = itemHeight > 0 ? itemHeight : 1;\n return startIndex * h;\n}\n\n/** 容器总高度(px),用于撑出滚动条。 */\nexport function getTotalHeight(total: number, itemHeight: number): number {\n const h = itemHeight > 0 ? itemHeight : 1;\n return total * h;\n}\n",":host {\n display: inline-block;\n position: relative;\n --hb-select-font-size: 14px;\n --hb-select-height: 32px;\n --hb-select-border-color: var(--hb-border-color, #dcdfe6);\n --hb-select-border-color-hover: var(--hb-color-primary);\n --hb-select-bg-color: var(--hb-color-white, #ffffff);\n --hb-select-text-color: var(--hb-color-text-regular, #606266);\n --hb-select-placeholder-color: var(--hb-color-text-placeholder, #c0c4cc);\n}\n\n.hb-select {\n display: inline-block;\n position: relative;\n width: 240px;\n}\n\n.hb-select__input-wrapper {\n position: relative;\n display: inline-block;\n width: 100%;\n cursor: pointer;\n}\n\n.hb-select__input {\n display: inline-block;\n width: 100%;\n height: var(--hb-select-height);\n line-height: var(--hb-select-height);\n padding: 0 30px 0 15px;\n font-size: var(--hb-select-font-size);\n color: var(--hb-select-text-color);\n background-color: var(--hb-select-bg-color);\n border: 1px solid var(--hb-select-border-color);\n border-radius: 4px;\n box-sizing: border-box;\n cursor: pointer;\n outline: none;\n transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n}\n\n.hb-select__input::placeholder {\n color: var(--hb-select-placeholder-color);\n}\n\n.hb-select__input:hover:not(:disabled) {\n border-color: var(--hb-select-border-color-hover);\n}\n\n.hb-select__input:focus {\n border-color: var(--hb-select-border-color-hover);\n}\n\n.hb-select__tags {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n padding: 0 30px 0 5px;\n min-height: var(--hb-select-height);\n border: 1px solid var(--hb-select-border-color);\n border-radius: 4px;\n background-color: var(--hb-select-bg-color);\n}\n\n.hb-select__tag {\n display: inline-flex;\n align-items: center;\n height: 24px;\n padding: 0 8px;\n margin: 2px 0 2px 6px;\n background-color: var(--hb-fill-color-light, #f0f2f5);\n border: 1px solid var(--hb-border-color-lighter, #e4e7ed);\n border-radius: 4px;\n font-size: 12px;\n color: var(--hb-color-text-regular, #606266);\n}\n\n.hb-select__tag-text {\n margin-right: 4px;\n}\n\n.hb-select__tag-close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 12px;\n height: 12px;\n cursor: pointer;\n color: var(--hb-color-text-placeholder, #c0c4cc);\n transition: color 0.2s;\n}\n\n.hb-select__tag-close svg {\n width: 100%;\n height: 100%;\n}\n\n.hb-select__tag-close:hover {\n color: var(--hb-color-text-regular, #606266);\n}\n\n.hb-select__suffix {\n position: absolute;\n right: 8px;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n color: var(--hb-select-text-color);\n}\n\n.hb-select__clear {\n margin-right: 8px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 14px;\n height: 14px;\n cursor: pointer;\n color: var(--hb-select-placeholder-color);\n transition: color 0.2s;\n}\n\n.hb-select__clear svg {\n width: 100%;\n height: 100%;\n}\n\n.hb-select__clear:hover {\n color: var(--hb-select-text-color);\n}\n\n.hb-select__arrow {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 12px;\n height: 12px;\n color: var(--hb-select-placeholder-color);\n transition: transform 0.3s;\n}\n\n.hb-select__arrow svg {\n width: 100%;\n height: 100%;\n}\n\n.hb-select--open .hb-select__arrow {\n transform: rotate(180deg);\n}\n\n.hb-select__dropdown {\n position: absolute;\n top: 100%;\n left: 0;\n margin-top: 4px;\n background-color: var(--hb-select-bg-color);\n border: 1px solid var(--hb-select-border-color);\n border-radius: 4px;\n box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);\n z-index: 1000;\n min-width: 100%;\n max-height: 300px;\n overflow-y: auto;\n}\n\n.hb-select__menu {\n margin: 0;\n padding: 6px 0;\n list-style: none;\n}\n\n.hb-select__menu-item {\n display: flex;\n align-items: center;\n padding: 8px 20px;\n font-size: var(--hb-select-font-size);\n color: var(--hb-select-text-color);\n cursor: pointer;\n transition: background-color 0.2s;\n}\n\n.hb-select__menu-item:hover:not(.hb-select__menu-item--disabled):not(.hb-select__menu-item--divided) {\n background-color: var(--hb-fill-color-light, #f5f7fa);\n}\n\n.hb-select__menu-item--selected {\n color: var(--hb-color-primary);\n font-weight: 600;\n}\n\n.hb-select__menu-item--disabled {\n color: var(--hb-color-text-disabled, #c0c4cc);\n cursor: not-allowed;\n}\n\n.hb-select__menu-item--divided {\n border-top: 1px solid var(--hb-border-color-lighter, #e4e7ed);\n margin-top: 6px;\n padding-top: 6px;\n}\n\n.hb-select__menu-item--empty {\n color: var(--hb-select-placeholder-color);\n cursor: default;\n}\n\n.hb-select__menu-item-checkbox {\n margin-right: 8px;\n width: 14px;\n height: 14px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n color: var(--hb-color-primary, #1677ff);\n}\n\n.hb-select__menu-item-checkbox svg {\n width: 100%;\n height: 100%;\n}\n\n.hb-select__menu-item--create {\n color: var(--hb-color-primary, #1677ff);\n font-weight: 500;\n}\n\n.hb-select__menu-item--create:hover {\n background-color: var(--hb-color-primary-bg, #e6f4ff);\n}\n\n.hb-select__menu-item-label {\n flex: 1;\n}\n\n.hb-select--small {\n font-size: 12px;\n}\n\n.hb-select--small .hb-select__input {\n height: 24px;\n line-height: 24px;\n font-size: 12px;\n padding: 0 25px 0 12px;\n}\n\n.hb-select--large {\n font-size: 16px;\n}\n\n.hb-select--large .hb-select__input {\n height: 40px;\n line-height: 40px;\n font-size: 16px;\n padding: 0 35px 0 18px;\n}\n\n.hb-select--disabled {\n cursor: not-allowed;\n}\n\n.hb-select--disabled .hb-select__input {\n background-color: var(--hb-fill-color-light, #f5f7fa);\n border-color: var(--hb-select-border-color);\n color: var(--hb-color-text-disabled, #c0c4cc);\n cursor: not-allowed;\n}\n","import { Component, h, Prop, Event, EventEmitter, State, Element, Watch } from '@stencil/core';\nimport { createClickOutsideHandler } from '../../utils/click-outside';\nimport { handleListKeyboard, activationClickHandler } from '../../utils/a11y';\nimport { getVirtualRange, getOffsetTop, getTotalHeight } from '../../utils/virtual-scroll';\n\nexport interface SelectOption {\n value: string | number;\n label: string;\n disabled?: boolean;\n divided?: boolean;\n}\n\n/**\n * Select 选择器组件\n * 当选项过多时,使用下拉菜单展示并选择内容\n */\n@Component({\n tag: 'hb-select',\n styleUrl: 'select.css',\n shadow: true,\n})\nexport class Select {\n @Element() el: HTMLElement;\n\n /**\n * 绑定值\n */\n @Prop({ mutable: true }) modelValue?: string | number | (string | number)[];\n\n /**\n * 可选项数据源\n */\n @Prop() options: SelectOption[] = [];\n\n /**\n * 输入框占位文本\n */\n @Prop() placeholder: string = '请选择';\n\n /**\n * 是否禁用\n * @default false\n */\n @Prop() disabled: boolean = false;\n\n /**\n * 输入框尺寸\n */\n @Prop() size: 'large' | 'default' | 'small' = 'default';\n\n /**\n * 是否可清空\n * @default false\n */\n @Prop() clearable: boolean = false;\n\n /**\n * 是否多选\n * @default false\n */\n @Prop() multiple: boolean = false;\n\n /**\n * 是否可搜索\n * @default false\n */\n @Prop() filterable: boolean = false;\n\n /**\n * 自定义过滤方法\n */\n @Prop() filterMethod?: (query: string) => void;\n\n /**\n * 是否默认展开\n * @default false\n */\n @Prop() defaultFirstOption: boolean = false;\n\n /**\n * 是否允许创建新条目\n * @default false\n */\n @Prop() allowCreate: boolean = false;\n\n /**\n * 多选时是否将选中值按文字的形式展示\n * @default false\n */\n @Prop() collapseTags: boolean = false;\n\n /**\n * 多选时最多显示多少个tag\n */\n @Prop() maxCollapseTags?: number;\n\n /**\n * V1:是否开启虚拟滚动(1000+ 选项时推荐)。默认 false。\n * 开启后下拉仅渲染可见窗口内的选项,DOM 节点数恒定。\n */\n @Prop() virtual: boolean = false;\n\n /**\n * V1:下拉最大高度(px)。virtual=true 时必填(定义视口高度)。默认 256。\n */\n @Prop() dropdownMaxHeight: number = 256;\n\n /**\n * V1:虚拟滚动每项预估高度(px)。默认 34。\n */\n @Prop() virtualItemHeight: number = 34;\n\n @State() isOpen: boolean = false;\n @State() inputValue: string = '';\n @State() searchValue: string = '';\n @State() filteredOptions: SelectOption[] = [];\n /** 键盘高亮的选项索引(-1 表示无) */\n @State() activeOptionIndex: number = -1;\n /** V1:下拉滚动位置(px),驱动虚拟滚动可见窗口重算 */\n @State() dropdownScrollTop: number = 0;\n\n /** V1:下拉滚动回调 */\n private handleDropdownScroll = (e: Event) => {\n const target = e.target as HTMLElement;\n this.dropdownScrollTop = target.scrollTop;\n };\n\n /**\n * O4:实例级稳定 id,用于 combobox 的 aria-controls / aria-activedescendant 关联,\n * 让读屏在键盘导航时播报当前高亮项。\n */\n private listboxId = `hb-select-listbox-${Math.random().toString(36).slice(2, 11)}`;\n\n /**\n * 值改变事件\n */\n @Event() hbChange: EventEmitter<string | number | (string | number)[]>;\n\n /**\n * 下拉框出现/隐藏时触发\n */\n @Event() hbVisibleChange: EventEmitter<boolean>;\n\n private clickOutside = createClickOutsideHandler({\n host: null as any,\n isOpen: () => this.isOpen,\n onClose: () => {\n this.isOpen = false;\n this.hbVisibleChange.emit(false);\n },\n });\n\n componentDidLoad() {\n this.clickOutside = createClickOutsideHandler({\n host: this.el,\n isOpen: () => this.isOpen,\n onClose: () => {\n this.isOpen = false;\n this.hbVisibleChange.emit(false);\n },\n });\n this.clickOutside.connect();\n this.updateInputValue();\n if (this.filterable) {\n this.filteredOptions = this.options;\n }\n }\n\n disconnectedCallback() {\n this.clickOutside.disconnect();\n }\n\n @Watch('modelValue')\n handleValueChange() {\n this.updateInputValue();\n }\n\n @Watch('options')\n handleOptionsChange() {\n if (this.filterable) {\n this.filteredOptions = this.options;\n }\n }\n\n private updateInputValue() {\n if (!this.modelValue) {\n this.inputValue = '';\n return;\n }\n\n if (this.multiple && Array.isArray(this.modelValue)) {\n const labels = this.modelValue.map(val => {\n const option = this.options.find(opt => opt.value === val);\n return option ? option.label : String(val);\n });\n this.inputValue = labels.join(', ');\n } else {\n const option = this.options.find(opt => opt.value === this.modelValue);\n this.inputValue = option ? option.label : String(this.modelValue);\n }\n }\n\n private handleInputClick = () => {\n if (this.disabled) return;\n this.isOpen = !this.isOpen;\n if (this.isOpen) {\n // defaultFirstOption=true:打开时自动高亮第一个可选(非禁用)项\n this.activeOptionIndex = this.defaultFirstOption\n ? Math.max(\n -1,\n this.options.findIndex(o => !o.disabled),\n )\n : -1;\n }\n this.hbVisibleChange.emit(this.isOpen);\n };\n\n private handleWrapperKeydown = (e: KeyboardEvent) => {\n if (this.disabled) return;\n const displayOptions = this.filterable ? this.filteredOptions : this.options;\n\n if (!this.isOpen) {\n // 关闭态:Enter / Space / 方向键 展开\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Spacebar' || e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n this.isOpen = true;\n this.activeOptionIndex = -1;\n this.hbVisibleChange.emit(true);\n }\n return;\n }\n\n const action = handleListKeyboard(e, {\n activeIndex: this.activeOptionIndex,\n itemCount: displayOptions.length,\n loop: true,\n });\n switch (action.type) {\n case 'navigate':\n e.preventDefault();\n this.activeOptionIndex = action.index;\n break;\n case 'select': {\n e.preventDefault();\n const opt = displayOptions[action.index];\n if (opt && !opt.disabled) this.handleSelect(opt);\n break;\n }\n case 'close':\n e.preventDefault();\n this.isOpen = false;\n this.hbVisibleChange.emit(false);\n break;\n default:\n break;\n }\n };\n\n private handleSelect = (option: SelectOption) => {\n if (option.disabled) return;\n\n if (this.multiple) {\n const currentValue = (this.modelValue as (string | number)[]) || [];\n const index = currentValue.indexOf(option.value);\n\n if (index > -1) {\n currentValue.splice(index, 1);\n } else {\n currentValue.push(option.value);\n }\n\n this.modelValue = [...currentValue];\n } else {\n this.modelValue = option.value;\n this.isOpen = false;\n this.hbVisibleChange.emit(false);\n }\n\n this.updateInputValue();\n this.hbChange.emit(this.modelValue);\n };\n\n private handleClear = (e: Event) => {\n e.stopPropagation();\n this.modelValue = this.multiple ? [] : undefined;\n this.inputValue = '';\n this.isOpen = false;\n this.hbChange.emit(this.modelValue);\n this.hbVisibleChange.emit(false);\n };\n\n private handleSearch = (e: Event) => {\n const target = e.target as HTMLInputElement;\n this.searchValue = target.value;\n\n if (this.filterMethod) {\n this.filterMethod(target.value);\n } else {\n this.filteredOptions = this.options.filter(opt => opt.label.toLowerCase().includes(target.value.toLowerCase()));\n }\n };\n\n private isSelected(option: SelectOption): boolean {\n if (this.multiple && Array.isArray(this.modelValue)) {\n return this.modelValue.includes(option.value);\n }\n return this.modelValue === option.value;\n }\n\n /**\n * allowCreate + filterable:当用户输入的文本在已有选项中不存在时,\n * 渲染一个\"创建 xxx\"项。返回待创建的文本(已 trim);无需创建返回 null。\n */\n private get createOption(): SelectOption | null {\n if (!this.allowCreate || !this.filterable || !this.isOpen) return null;\n const q = this.searchValue.trim();\n if (!q) return null;\n const exists = this.options.some(o => String(o.label).toLowerCase() === q.toLowerCase() || String(o.value).toLowerCase() === q.toLowerCase());\n if (exists) return null;\n return { value: q, label: q };\n }\n\n private handleCreate = () => {\n const opt = this.createOption;\n if (!opt) return;\n if (this.multiple) {\n const arr = ((this.modelValue as (string | number)[]) || []).slice();\n if (!arr.includes(opt.value)) arr.push(opt.value);\n this.modelValue = arr;\n } else {\n this.modelValue = opt.value;\n this.isOpen = false;\n this.hbVisibleChange.emit(false);\n }\n this.searchValue = '';\n this.filteredOptions = this.options;\n this.updateInputValue();\n this.hbChange.emit(this.modelValue);\n };\n\n /** 渲染单个选项 <li>(普通 + 虚拟滚动共用,V1 提取) */\n private renderOption(option: SelectOption, index: number) {\n return (\n <li\n id={`${this.listboxId}-opt-${index}`}\n class={{\n 'hb-select__menu-item': true,\n 'hb-select__menu-item--selected': this.isSelected(option),\n 'hb-select__menu-item--disabled': option.disabled,\n 'hb-select__menu-item--divided': option.divided,\n 'hb-select__menu-item--active': index === this.activeOptionIndex,\n }}\n style={this.virtual ? { height: `${this.virtualItemHeight}px` } : undefined}\n role=\"option\"\n aria-selected={this.isSelected(option) ? 'true' : 'false'}\n aria-disabled={option.disabled ? 'true' : undefined}\n onClick={() => this.handleSelect(option)}\n >\n {this.multiple && (\n <span class=\"hb-select__menu-item-checkbox\" aria-hidden=\"true\">\n {this.isSelected(option) ? (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width={3} stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M5 12l5 5L20 7\" />\n </svg>\n ) : null}\n </span>\n )}\n <span class=\"hb-select__menu-item-label\">{option.label}</span>\n </li>\n );\n }\n\n render() {\n const displayOptions = this.filterable ? this.filteredOptions : this.options;\n const showClear = this.clearable && this.modelValue !== undefined && (this.multiple ? (this.modelValue as any[]).length > 0 : true);\n\n return (\n <div\n class={{\n 'hb-select': true,\n 'hb-select--open': this.isOpen,\n 'hb-select--disabled': this.disabled,\n [`hb-select--${this.size}`]: true,\n }}\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-expanded={this.isOpen ? 'true' : 'false'}\n aria-controls={this.isOpen ? this.listboxId : undefined}\n aria-activedescendant={this.isOpen && this.activeOptionIndex >= 0 ? `${this.listboxId}-opt-${this.activeOptionIndex}` : undefined}\n >\n <div class=\"hb-select__input-wrapper\" onClick={this.handleInputClick} onKeyDown={this.handleWrapperKeydown}>\n {this.multiple && Array.isArray(this.modelValue) && this.modelValue.length > 0 ? (\n <div class=\"hb-select__tags\">\n {this.modelValue.slice(0, this.collapseTags && this.maxCollapseTags ? this.maxCollapseTags : undefined).map(val => {\n const option = this.options.find(opt => opt.value === val);\n return (\n <span class=\"hb-select__tag\">\n <span class=\"hb-select__tag-text\">{option ? option.label : val}</span>\n <span\n class=\"hb-select__tag-close\"\n role=\"button\"\n aria-label=\"移除标签\"\n tabIndex={0}\n onClick={e => {\n e.stopPropagation();\n this.handleSelect(option || { value: val, label: String(val) });\n }}\n onKeyDown={activationClickHandler}\n >\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width={2} stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M6 6l12 12M18 6L6 18\" />\n </svg>\n </span>\n </span>\n );\n })}\n {this.collapseTags && this.maxCollapseTags && this.modelValue.length > this.maxCollapseTags && (\n <span class=\"hb-select__tag\">\n <span class=\"hb-select__tag-text\">+{this.modelValue.length - this.maxCollapseTags}</span>\n </span>\n )}\n </div>\n ) : (\n <input\n type=\"text\"\n class=\"hb-select__input\"\n placeholder={this.placeholder}\n value={this.filterable && this.isOpen ? this.searchValue : this.inputValue}\n disabled={this.disabled}\n readonly={!this.filterable || !this.isOpen}\n onInput={this.handleSearch}\n aria-haspopup=\"listbox\"\n aria-expanded={this.isOpen ? 'true' : 'false'}\n role=\"combobox\"\n />\n )}\n <span class=\"hb-select__suffix\">\n {showClear && (\n <span class=\"hb-select__clear\" role=\"button\" aria-label=\"清空\" tabIndex={0} onClick={this.handleClear} onKeyDown={activationClickHandler}>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width={2} stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M6 6l12 12M18 6L6 18\" />\n </svg>\n </span>\n )}\n <span class=\"hb-select__arrow\" aria-hidden=\"true\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width={2} stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M6 9l6 6 6-6\" />\n </svg>\n </span>\n </span>\n </div>\n {this.isOpen && (\n <div class=\"hb-select__dropdown\">\n <ul\n class=\"hb-select__menu\"\n role=\"listbox\"\n id={this.listboxId}\n // V1:虚拟滚动时滚动容器限高 + onScroll 更新可见窗口\n style={this.virtual ? { maxHeight: `${this.dropdownMaxHeight}px`, overflowY: 'auto' } : undefined}\n onScroll={this.virtual ? this.handleDropdownScroll : undefined}\n >\n {/* allowCreate:用户输入文本不存在时,渲染创建项(置顶) */}\n {this.createOption && (\n <li class={{ 'hb-select__menu-item': true, 'hb-select__menu-item--create': true }} role=\"option\" aria-selected=\"false\" onClick={this.handleCreate}>\n <span class=\"hb-select__menu-item-label\">创建「{this.createOption.label}」</span>\n </li>\n )}\n {displayOptions.length === 0 && !this.createOption ? (\n <li class=\"hb-select__menu-item hb-select__menu-item--empty\" aria-disabled=\"true\">\n 无数据\n </li>\n ) : this.virtual ? (\n // V1:虚拟滚动——仅渲染可见窗口 + 顶部撑高 spacer\n <div style={{ height: `${getTotalHeight(displayOptions.length, this.virtualItemHeight)}px`, position: 'relative' }}>\n <div style={{ transform: `translateY(${getOffsetTop(getVirtualRange({ total: displayOptions.length, itemHeight: this.virtualItemHeight, viewportHeight: this.dropdownMaxHeight, scrollTop: this.dropdownScrollTop }).startIndex, this.virtualItemHeight)}px)` }}>\n {displayOptions\n .slice(\n getVirtualRange({ total: displayOptions.length, itemHeight: this.virtualItemHeight, viewportHeight: this.dropdownMaxHeight, scrollTop: this.dropdownScrollTop }).startIndex,\n getVirtualRange({ total: displayOptions.length, itemHeight: this.virtualItemHeight, viewportHeight: this.dropdownMaxHeight, scrollTop: this.dropdownScrollTop }).endIndex,\n )\n .map((option, i) => {\n const absIndex = getVirtualRange({ total: displayOptions.length, itemHeight: this.virtualItemHeight, viewportHeight: this.dropdownMaxHeight, scrollTop: this.dropdownScrollTop }).startIndex + i;\n return this.renderOption(option, absIndex);\n })}\n </div>\n </div>\n ) : (\n displayOptions.map((option, index) => this.renderOption(option, index))\n )}\n </ul>\n </div>\n )}\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -100,7 +100,7 @@ const Slider = class {
|
|
|
100
100
|
}
|
|
101
101
|
return [this.min, this.max];
|
|
102
102
|
}
|
|
103
|
-
return typeof v === 'number' ? v :
|
|
103
|
+
return typeof v === 'number' ? v : Array.isArray(v) ? (v[0] ?? this.min) : this.min;
|
|
104
104
|
}
|
|
105
105
|
addEventListeners() {
|
|
106
106
|
document.addEventListener('mousemove', this.handleMouseMove);
|
|
@@ -156,9 +156,7 @@ const Slider = class {
|
|
|
156
156
|
if (!this.sliderRef)
|
|
157
157
|
return;
|
|
158
158
|
const rect = this.sliderRef.getBoundingClientRect();
|
|
159
|
-
const percentage = this.vertical
|
|
160
|
-
? 1 - (e.clientY - rect.top) / rect.height
|
|
161
|
-
: (e.clientX - rect.left) / rect.width;
|
|
159
|
+
const percentage = this.vertical ? 1 - (e.clientY - rect.top) / rect.height : (e.clientX - rect.left) / rect.width;
|
|
162
160
|
const clampedPercentage = Math.max(0, Math.min(100, percentage * 100));
|
|
163
161
|
const value = this.getValueFromPercentage(clampedPercentage);
|
|
164
162
|
if (this.range) {
|
|
@@ -198,9 +196,7 @@ const Slider = class {
|
|
|
198
196
|
if (!isDecrease && !isIncrease && !isBigDecrease && !isBigIncrease)
|
|
199
197
|
return;
|
|
200
198
|
e.preventDefault();
|
|
201
|
-
const delta = isBigDecrease ? -this.max :
|
|
202
|
-
isBigIncrease ? this.max :
|
|
203
|
-
(isDecrease ? -1 : 1) * this.step;
|
|
199
|
+
const delta = isBigDecrease ? -this.max : isBigIncrease ? this.max : (isDecrease ? -1 : 1) * this.step;
|
|
204
200
|
if (this.range) {
|
|
205
201
|
const vals = this.currentValue;
|
|
206
202
|
let [lo, hi] = [vals[0], vals[1]];
|
|
@@ -255,14 +251,14 @@ const Slider = class {
|
|
|
255
251
|
return (h("div", { class: {
|
|
256
252
|
'hb-slider__button-wrapper': true,
|
|
257
253
|
'hb-slider__button-wrapper--hover': isActive,
|
|
258
|
-
}, style: { [posProp]: `${pct}%` }, onMouseDown: (e) => this.handleMouseDown(e, handle), onTouchStart: (e) => this.handleTouchStart(e, handle), role: "slider", tabindex: this.disabled ? -1 : 0, "aria-valuemin": this.min, "aria-valuemax": this.max, "aria-valuenow": tooltipVal, "aria-valuetext": this.formatValue(tooltipVal), "aria-orientation": this.vertical ? 'vertical' : 'horizontal', "aria-disabled": this.disabled ? 'true' : 'false', onKeyDown: this.handleKeyDown }, this.showTooltip && isActive &&
|
|
254
|
+
}, style: { [posProp]: `${pct}%` }, onMouseDown: (e) => this.handleMouseDown(e, handle), onTouchStart: (e) => this.handleTouchStart(e, handle), role: "slider", tabindex: this.disabled ? -1 : 0, "aria-valuemin": this.min, "aria-valuemax": this.max, "aria-valuenow": tooltipVal, "aria-valuetext": this.formatValue(tooltipVal), "aria-orientation": this.vertical ? 'vertical' : 'horizontal', "aria-disabled": this.disabled ? 'true' : 'false', onKeyDown: this.handleKeyDown }, this.showTooltip && isActive && h("div", { class: "hb-slider__tooltip" }, this.formatValue(this.tooltipValue)), h("div", { class: "hb-slider__button" })));
|
|
259
255
|
};
|
|
260
256
|
return (h("div", { class: {
|
|
261
257
|
'hb-slider': true,
|
|
262
258
|
'hb-slider--vertical': this.vertical,
|
|
263
259
|
'hb-slider--disabled': this.disabled,
|
|
264
260
|
'hb-slider--with-marks': this.markList.length > 0,
|
|
265
|
-
}, style: this.vertical && this.height ? { height: this.height } : undefined }, h("div", { class: "hb-slider__runway", ref:
|
|
261
|
+
}, style: this.vertical && this.height ? { height: this.height } : undefined }, h("div", { class: "hb-slider__runway", ref: el => (this.sliderRef = el), onMouseDown: (e) => this.handleMouseDown(e, null), onTouchStart: (e) => this.handleTouchStart(e, null) }, h("div", { class: "hb-slider__bar", style: {
|
|
266
262
|
[sizeProp]: `${Math.max(0, barSize)}%`,
|
|
267
263
|
[posProp]: `${barStart}%`,
|
|
268
264
|
} }), this.markList.map(m => {
|
|
@@ -300,9 +296,7 @@ const Slider = class {
|
|
|
300
296
|
if (!this.sliderRef)
|
|
301
297
|
return;
|
|
302
298
|
const rect = this.sliderRef.getBoundingClientRect();
|
|
303
|
-
const percentage = this.vertical
|
|
304
|
-
? 1 - (clientY - rect.top) / rect.height
|
|
305
|
-
: (clientX - rect.left) / rect.width;
|
|
299
|
+
const percentage = this.vertical ? 1 - (clientY - rect.top) / rect.height : (clientX - rect.left) / rect.width;
|
|
306
300
|
const clamped = Math.max(0, Math.min(100, percentage * 100));
|
|
307
301
|
const value = this.getValueFromPercentage(clamped);
|
|
308
302
|
if (this.range) {
|