huibo-ui 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{date-helpers-904747ff.js → date-helpers-1ffddc59.js} +7 -3
- package/dist/cjs/date-helpers-1ffddc59.js.map +1 -0
- package/dist/cjs/hb-affix.cjs.entry.js +1 -1
- package/dist/cjs/hb-aside.cjs.entry.js +1 -1
- package/dist/cjs/hb-avatar.cjs.entry.js +1 -1
- package/dist/cjs/hb-backtop.cjs.entry.js +2 -2
- package/dist/cjs/hb-badge.cjs.entry.js +1 -1
- package/dist/cjs/hb-breadcrumb-item.cjs.entry.js +1 -1
- package/dist/cjs/hb-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/hb-button.cjs.entry.js +2 -2
- package/dist/cjs/hb-calendar.cjs.entry.js +78 -10
- package/dist/cjs/hb-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-card.cjs.entry.js +1 -1
- package/dist/cjs/hb-cascader.cjs.entry.js +270 -146
- package/dist/cjs/hb-cascader.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/hb-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/hb-collapse-item.cjs.entry.js +1 -1
- package/dist/cjs/hb-collapse.cjs.entry.js +1 -1
- package/dist/cjs/hb-color-picker-panel.cjs.entry.js +2 -2
- package/dist/cjs/hb-color-picker.cjs.entry.js +91 -14
- package/dist/cjs/hb-color-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-config-provider.cjs.entry.js +1 -1
- package/dist/cjs/hb-container.cjs.entry.js +2 -2
- package/dist/cjs/hb-date-picker-pane.cjs.entry.js +2 -2
- package/dist/cjs/hb-date-picker.cjs.entry.js +85 -7
- package/dist/cjs/hb-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-date-range-picker.cjs.entry.js +3 -3
- package/dist/cjs/hb-date-time-picker.cjs.entry.js +3 -3
- package/dist/cjs/hb-descriptions.cjs.entry.js +2 -2
- package/dist/cjs/hb-descriptions.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-divider.cjs.entry.js +2 -2
- package/dist/cjs/hb-drawer.cjs.entry.js +1 -1
- package/dist/cjs/hb-dropdown.cjs.entry.js +74 -6
- package/dist/cjs/hb-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-empty.cjs.entry.js +1 -1
- package/dist/cjs/hb-float-button.cjs.entry.js +2 -2
- package/dist/cjs/hb-footer.cjs.entry.js +1 -1
- package/dist/cjs/hb-form-item.cjs.entry.js +59 -8
- package/dist/cjs/hb-form-item.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-form.cjs.entry.js +3 -3
- package/dist/cjs/hb-form.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-header.cjs.entry.js +1 -1
- package/dist/cjs/hb-image-preview.cjs.entry.js +12 -8
- package/dist/cjs/hb-image-preview.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-image.cjs.entry.js +1 -1
- package/dist/cjs/hb-input-number.cjs.entry.js +5 -5
- package/dist/cjs/hb-input-tag.cjs.entry.js +2 -2
- package/dist/cjs/hb-input.cjs.entry.js +39 -3
- package/dist/cjs/hb-input.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-layout.cjs.entry.js +36 -14
- package/dist/cjs/hb-layout.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-link.cjs.entry.js +2 -2
- package/dist/cjs/hb-loading.cjs.entry.js +2 -2
- package/dist/cjs/hb-main.cjs.entry.js +1 -1
- package/dist/cjs/hb-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/hb-menu.cjs.entry.js +3 -3
- package/dist/cjs/hb-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-message.cjs.entry.js +2 -2
- package/dist/cjs/hb-notification.cjs.entry.js +2 -2
- package/dist/cjs/hb-page-header.cjs.entry.js +1 -1
- package/dist/cjs/hb-pagination.cjs.entry.js +21 -8
- package/dist/cjs/hb-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-popconfirm.cjs.entry.js +37 -7
- package/dist/cjs/hb-popconfirm.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-popover.cjs.entry.js +22 -2
- package/dist/cjs/hb-popover.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-progress.cjs.entry.js +1 -1
- package/dist/cjs/hb-radio.cjs.entry.js +2 -2
- package/dist/cjs/hb-rate.cjs.entry.js +45 -3
- package/dist/cjs/hb-rate.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-result.cjs.entry.js +1 -1
- package/dist/cjs/hb-row.cjs.entry.js +2 -2
- package/dist/cjs/hb-segmented.cjs.entry.js +39 -5
- package/dist/cjs/hb-segmented.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-select.cjs.entry.js +47 -8
- package/dist/cjs/hb-select.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-slider.cjs.entry.js +189 -20
- package/dist/cjs/hb-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-space.cjs.entry.js +2 -2
- package/dist/cjs/hb-statistic.cjs.entry.js +1 -1
- package/dist/cjs/hb-step.cjs.entry.js +1 -1
- package/dist/cjs/hb-steps.cjs.entry.js +30 -9
- package/dist/cjs/hb-steps.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-sub-menu.cjs.entry.js +4 -4
- package/dist/cjs/hb-switch.cjs.entry.js +9 -4
- package/dist/cjs/hb-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-tab-pane.cjs.entry.js +1 -1
- package/dist/cjs/hb-table.cjs.entry.js +1 -1
- package/dist/cjs/hb-table.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-tabs.cjs.entry.js +2 -2
- package/dist/cjs/hb-tag.cjs.entry.js +2 -2
- package/dist/cjs/hb-text.cjs.entry.js +2 -2
- package/dist/cjs/hb-time-picker.cjs.entry.js +4 -4
- package/dist/cjs/hb-time-select.cjs.entry.js +2 -2
- package/dist/cjs/hb-timeline.cjs.entry.js +1 -1
- package/dist/cjs/hb-tooltip.cjs.entry.js +18 -1
- package/dist/cjs/hb-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-transfer.cjs.entry.js +2 -2
- package/dist/cjs/hb-tree-select.cjs.entry.js +95 -18
- package/dist/cjs/hb-tree-select.cjs.entry.js.map +1 -1
- package/dist/cjs/hb-tree.cjs.entry.js +1 -1
- package/dist/cjs/hb-upload.cjs.entry.js +3 -3
- package/dist/cjs/hb-watermark.cjs.entry.js +1 -1
- package/dist/cjs/huibo-ui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/Affix/Affix.js +1 -1
- package/dist/collection/components/Avatar/Avatar.js +1 -1
- package/dist/collection/components/Backtop/Backtop.js +2 -2
- package/dist/collection/components/Badge/Badge.js +1 -1
- package/dist/collection/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/collection/components/Breadcrumb/BreadcrumbItem.js +1 -1
- package/dist/collection/components/Button/Button.js +2 -2
- package/dist/collection/components/Calendar/Calendar.js +84 -10
- package/dist/collection/components/Calendar/Calendar.js.map +1 -1
- package/dist/collection/components/Calendar/calendar.css +16 -0
- package/dist/collection/components/Card/Card.js +1 -1
- package/dist/collection/components/Cascader/Cascader.js +374 -194
- package/dist/collection/components/Cascader/Cascader.js.map +1 -1
- package/dist/collection/components/Cascader/cascader.css +170 -16
- package/dist/collection/components/Checkbox/Checkbox.js +3 -3
- package/dist/collection/components/Checkbox/CheckboxGroup.js +2 -2
- package/dist/collection/components/Collapse/Collapse.js +1 -1
- package/dist/collection/components/Collapse/CollapseItem.js +1 -1
- package/dist/collection/components/ColorPicker/ColorPicker.js +92 -14
- package/dist/collection/components/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/collection/components/ColorPicker/color-picker.css +13 -0
- package/dist/collection/components/ColorPickerPanel/ColorPickerPanel.js +2 -2
- package/dist/collection/components/ConfigProvider/ConfigProvider.js +1 -1
- package/dist/collection/components/Container/Aside.js +1 -1
- package/dist/collection/components/Container/Container.js +2 -2
- package/dist/collection/components/Container/Footer.js +1 -1
- package/dist/collection/components/Container/Header.js +1 -1
- package/dist/collection/components/Container/Main.js +1 -1
- package/dist/collection/components/DatePicker/DatePicker.js +89 -10
- package/dist/collection/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/collection/components/DatePicker/date-picker.css +62 -2
- package/dist/collection/components/DatePickerPane/DatePickerPane.js +1 -1
- package/dist/collection/components/DateRangePicker/DateRangePicker.js +2 -2
- package/dist/collection/components/DateTimePicker/DateTimePicker.js +2 -2
- package/dist/collection/components/Descriptions/Descriptions.js +1 -1
- package/dist/collection/components/Descriptions/descriptions.css +22 -0
- package/dist/collection/components/Divider/Divider.js +2 -2
- package/dist/collection/components/Drawer/Drawer.js +1 -1
- package/dist/collection/components/Dropdown/Dropdown.js +83 -7
- package/dist/collection/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/collection/components/Dropdown/dropdown.css +2 -1
- package/dist/collection/components/Empty/Empty.js +1 -1
- package/dist/collection/components/FloatButton/FloatButton.js +2 -2
- package/dist/collection/components/Form/Form.js +2 -2
- package/dist/collection/components/Form/FormItem.js +60 -9
- package/dist/collection/components/Form/FormItem.js.map +1 -1
- package/dist/collection/components/Form/form-item.css +49 -4
- package/dist/collection/components/Form/form.css +1 -0
- package/dist/collection/components/Image/Image.js +1 -1
- package/dist/collection/components/ImagePreview/ImagePreview.js +12 -8
- package/dist/collection/components/ImagePreview/ImagePreview.js.map +1 -1
- package/dist/collection/components/Input/Input.js +38 -2
- package/dist/collection/components/Input/Input.js.map +1 -1
- package/dist/collection/components/Input/input.css +21 -2
- package/dist/collection/components/InputNumber/InputNumber.js +5 -5
- package/dist/collection/components/InputTag/InputTag.js +2 -2
- package/dist/collection/components/Layout/Layout.js +87 -34
- package/dist/collection/components/Layout/Layout.js.map +1 -1
- package/dist/collection/components/Layout/Row.js +2 -2
- package/dist/collection/components/Layout/layout.css +524 -0
- package/dist/collection/components/Link/Link.js +2 -2
- package/dist/collection/components/Loading/Loading.js +2 -2
- package/dist/collection/components/Menu/Menu.js +2 -2
- package/dist/collection/components/Menu/MenuItem.js +2 -2
- package/dist/collection/components/Menu/SubMenu.js +4 -4
- package/dist/collection/components/Menu/menu.css +25 -0
- package/dist/collection/components/Message/Message.js +2 -2
- package/dist/collection/components/Notification/Notification.js +2 -2
- package/dist/collection/components/PageHeader/PageHeader.js +1 -1
- package/dist/collection/components/Pagination/Pagination.js +23 -7
- package/dist/collection/components/Pagination/Pagination.js.map +1 -1
- package/dist/collection/components/Pagination/pagination.css +23 -0
- package/dist/collection/components/Popconfirm/Popconfirm.js +44 -7
- package/dist/collection/components/Popconfirm/Popconfirm.js.map +1 -1
- package/dist/collection/components/Popover/Popover.js +29 -2
- package/dist/collection/components/Popover/Popover.js.map +1 -1
- package/dist/collection/components/Progress/Progress.js +1 -1
- package/dist/collection/components/Radio/Radio.js +2 -2
- package/dist/collection/components/Rate/Rate.js +45 -3
- package/dist/collection/components/Rate/Rate.js.map +1 -1
- package/dist/collection/components/Result/Result.js +1 -1
- package/dist/collection/components/Segmented/Segmented.js +51 -6
- package/dist/collection/components/Segmented/Segmented.js.map +1 -1
- package/dist/collection/components/Select/Select.js +46 -7
- package/dist/collection/components/Select/Select.js.map +1 -1
- package/dist/collection/components/Select/select.css +50 -4
- package/dist/collection/components/Slider/Slider.js +221 -21
- package/dist/collection/components/Slider/Slider.js.map +1 -1
- package/dist/collection/components/Slider/slider.css +58 -7
- package/dist/collection/components/Space/Space.js +2 -2
- package/dist/collection/components/Statistic/Statistic.js +1 -1
- package/dist/collection/components/Steps/Step.js +1 -1
- package/dist/collection/components/Steps/Steps.js +35 -8
- package/dist/collection/components/Steps/Steps.js.map +1 -1
- package/dist/collection/components/Switch/Switch.js +8 -3
- package/dist/collection/components/Switch/Switch.js.map +1 -1
- package/dist/collection/components/Switch/switch.css +45 -0
- package/dist/collection/components/Table/table.css +20 -0
- package/dist/collection/components/Tabs/TabPane.js +1 -1
- package/dist/collection/components/Tabs/Tabs.js +2 -2
- package/dist/collection/components/Tag/Tag.js +2 -2
- package/dist/collection/components/Text/Text.js +2 -2
- package/dist/collection/components/TimePicker/TimePicker.js +4 -4
- package/dist/collection/components/TimeSelect/TimeSelect.js +2 -2
- package/dist/collection/components/Timeline/Timeline.js +1 -1
- package/dist/collection/components/Tooltip/Tooltip.js +25 -2
- package/dist/collection/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/collection/components/Transfer/Transfer.js +2 -2
- package/dist/collection/components/Tree/Tree.js +1 -1
- package/dist/collection/components/TreeSelect/TreeSelect.js +94 -17
- package/dist/collection/components/TreeSelect/TreeSelect.js.map +1 -1
- package/dist/collection/components/TreeSelect/tree-select.css +41 -7
- package/dist/collection/components/Upload/Upload.js +3 -3
- package/dist/collection/components/Watermark/Watermark.js +1 -1
- package/dist/collection/utils/date-helpers.js +6 -2
- package/dist/collection/utils/date-helpers.js.map +1 -1
- package/dist/components/hb-affix.js +1 -1
- package/dist/components/hb-aside.js +1 -1
- package/dist/components/hb-avatar.js +1 -1
- package/dist/components/hb-backtop.js +2 -2
- package/dist/components/hb-badge.js +1 -1
- package/dist/components/hb-breadcrumb-item.js +1 -1
- package/dist/components/hb-breadcrumb.js +1 -1
- package/dist/components/hb-button.js +2 -2
- package/dist/components/hb-calendar.js +80 -11
- package/dist/components/hb-calendar.js.map +1 -1
- package/dist/components/hb-card.js +1 -1
- package/dist/components/hb-cascader.js +273 -146
- package/dist/components/hb-cascader.js.map +1 -1
- package/dist/components/hb-checkbox-group.js +2 -2
- package/dist/components/hb-checkbox.js +3 -3
- package/dist/components/hb-collapse-item.js +1 -1
- package/dist/components/hb-collapse.js +1 -1
- package/dist/components/hb-color-picker-panel.js +2 -2
- package/dist/components/hb-color-picker.js +93 -15
- package/dist/components/hb-color-picker.js.map +1 -1
- package/dist/components/hb-config-provider.js +1 -1
- package/dist/components/hb-container.js +2 -2
- package/dist/components/hb-date-picker-pane.js +2 -2
- package/dist/components/hb-date-picker.js +87 -8
- package/dist/components/hb-date-picker.js.map +1 -1
- package/dist/components/hb-date-range-picker.js +3 -3
- package/dist/components/hb-date-time-picker.js +3 -3
- package/dist/components/hb-descriptions.js +2 -2
- package/dist/components/hb-descriptions.js.map +1 -1
- package/dist/components/hb-divider.js +2 -2
- package/dist/components/hb-drawer.js +1 -1
- package/dist/components/hb-dropdown.js +76 -7
- package/dist/components/hb-dropdown.js.map +1 -1
- package/dist/components/hb-empty.js +1 -1
- package/dist/components/hb-float-button.js +2 -2
- package/dist/components/hb-footer.js +1 -1
- package/dist/components/hb-form-item.js +59 -8
- package/dist/components/hb-form-item.js.map +1 -1
- package/dist/components/hb-form.js +3 -3
- package/dist/components/hb-form.js.map +1 -1
- package/dist/components/hb-header.js +1 -1
- package/dist/components/hb-icon.js +1 -89
- package/dist/components/hb-icon.js.map +1 -1
- package/dist/components/hb-image-preview.js +12 -8
- package/dist/components/hb-image-preview.js.map +1 -1
- package/dist/components/hb-image.js +1 -1
- package/dist/components/hb-input-number.js +5 -5
- package/dist/components/hb-input-tag.js +2 -2
- package/dist/components/hb-input.js +39 -3
- package/dist/components/hb-input.js.map +1 -1
- package/dist/components/hb-layout.js +36 -14
- package/dist/components/hb-layout.js.map +1 -1
- package/dist/components/hb-link.js +2 -2
- package/dist/components/hb-loading.js +2 -2
- package/dist/components/hb-main.js +1 -1
- package/dist/components/hb-menu-item.js +2 -2
- package/dist/components/hb-menu.js +3 -3
- package/dist/components/hb-menu.js.map +1 -1
- package/dist/components/hb-message.js +2 -2
- package/dist/components/hb-notification.js +2 -2
- package/dist/components/hb-page-header.js +1 -1
- package/dist/components/hb-pagination.js +25 -10
- package/dist/components/hb-pagination.js.map +1 -1
- package/dist/components/hb-popconfirm.js +37 -7
- package/dist/components/hb-popconfirm.js.map +1 -1
- package/dist/components/hb-popover.js +22 -2
- package/dist/components/hb-popover.js.map +1 -1
- package/dist/components/hb-progress.js +1 -1
- package/dist/components/hb-radio.js +2 -2
- package/dist/components/hb-rate.js +45 -3
- package/dist/components/hb-rate.js.map +1 -1
- package/dist/components/hb-result.js +1 -1
- package/dist/components/hb-row.js +2 -2
- package/dist/components/hb-segmented.js +41 -6
- package/dist/components/hb-segmented.js.map +1 -1
- package/dist/components/hb-select.js +47 -8
- package/dist/components/hb-select.js.map +1 -1
- package/dist/components/hb-slider.js +194 -21
- package/dist/components/hb-slider.js.map +1 -1
- package/dist/components/hb-space.js +2 -2
- package/dist/components/hb-statistic.js +1 -1
- package/dist/components/hb-step.js +1 -1
- package/dist/components/hb-steps.js +35 -8
- package/dist/components/hb-steps.js.map +1 -1
- package/dist/components/hb-sub-menu.js +4 -4
- package/dist/components/hb-switch.js +9 -4
- package/dist/components/hb-switch.js.map +1 -1
- package/dist/components/hb-tab-pane.js +1 -1
- package/dist/components/hb-table.js +1 -1
- package/dist/components/hb-table.js.map +1 -1
- package/dist/components/hb-tabs.js +2 -2
- package/dist/components/hb-tag.js +2 -2
- package/dist/components/hb-text.js +2 -2
- package/dist/components/hb-time-picker.js +4 -4
- package/dist/components/hb-time-select.js +2 -2
- package/dist/components/hb-timeline.js +1 -1
- package/dist/components/hb-tooltip.js +18 -1
- package/dist/components/hb-tooltip.js.map +1 -1
- package/dist/components/hb-transfer.js +2 -2
- package/dist/components/hb-tree-select.js +95 -18
- package/dist/components/hb-tree-select.js.map +1 -1
- package/dist/components/hb-tree.js +1 -1
- package/dist/components/hb-upload.js +3 -3
- package/dist/components/hb-watermark.js +1 -1
- package/dist/components/{p-cf94cbf6.js → p-08b4005c.js} +7 -3
- package/dist/components/p-08b4005c.js.map +1 -0
- package/dist/components/p-86d92faf.js +93 -0
- package/dist/components/p-86d92faf.js.map +1 -0
- package/dist/esm/{date-helpers-e4d85a67.js → date-helpers-44507189.js} +7 -3
- package/dist/esm/date-helpers-44507189.js.map +1 -0
- package/dist/esm/hb-affix.entry.js +1 -1
- package/dist/esm/hb-aside.entry.js +1 -1
- package/dist/esm/hb-avatar.entry.js +1 -1
- package/dist/esm/hb-backtop.entry.js +2 -2
- package/dist/esm/hb-badge.entry.js +1 -1
- package/dist/esm/hb-breadcrumb-item.entry.js +1 -1
- package/dist/esm/hb-breadcrumb.entry.js +1 -1
- package/dist/esm/hb-button.entry.js +2 -2
- package/dist/esm/hb-calendar.entry.js +78 -10
- package/dist/esm/hb-calendar.entry.js.map +1 -1
- package/dist/esm/hb-card.entry.js +1 -1
- package/dist/esm/hb-cascader.entry.js +270 -146
- package/dist/esm/hb-cascader.entry.js.map +1 -1
- package/dist/esm/hb-checkbox-group.entry.js +2 -2
- package/dist/esm/hb-checkbox.entry.js +3 -3
- package/dist/esm/hb-collapse-item.entry.js +1 -1
- package/dist/esm/hb-collapse.entry.js +1 -1
- package/dist/esm/hb-color-picker-panel.entry.js +2 -2
- package/dist/esm/hb-color-picker.entry.js +91 -14
- package/dist/esm/hb-color-picker.entry.js.map +1 -1
- package/dist/esm/hb-config-provider.entry.js +1 -1
- package/dist/esm/hb-container.entry.js +2 -2
- package/dist/esm/hb-date-picker-pane.entry.js +2 -2
- package/dist/esm/hb-date-picker.entry.js +85 -7
- package/dist/esm/hb-date-picker.entry.js.map +1 -1
- package/dist/esm/hb-date-range-picker.entry.js +3 -3
- package/dist/esm/hb-date-time-picker.entry.js +3 -3
- package/dist/esm/hb-descriptions.entry.js +2 -2
- package/dist/esm/hb-descriptions.entry.js.map +1 -1
- package/dist/esm/hb-divider.entry.js +2 -2
- package/dist/esm/hb-drawer.entry.js +1 -1
- package/dist/esm/hb-dropdown.entry.js +74 -6
- package/dist/esm/hb-dropdown.entry.js.map +1 -1
- package/dist/esm/hb-empty.entry.js +1 -1
- package/dist/esm/hb-float-button.entry.js +2 -2
- package/dist/esm/hb-footer.entry.js +1 -1
- package/dist/esm/hb-form-item.entry.js +59 -8
- package/dist/esm/hb-form-item.entry.js.map +1 -1
- package/dist/esm/hb-form.entry.js +3 -3
- package/dist/esm/hb-form.entry.js.map +1 -1
- package/dist/esm/hb-header.entry.js +1 -1
- package/dist/esm/hb-image-preview.entry.js +12 -8
- package/dist/esm/hb-image-preview.entry.js.map +1 -1
- package/dist/esm/hb-image.entry.js +1 -1
- package/dist/esm/hb-input-number.entry.js +5 -5
- package/dist/esm/hb-input-tag.entry.js +2 -2
- package/dist/esm/hb-input.entry.js +39 -3
- package/dist/esm/hb-input.entry.js.map +1 -1
- package/dist/esm/hb-layout.entry.js +36 -14
- package/dist/esm/hb-layout.entry.js.map +1 -1
- package/dist/esm/hb-link.entry.js +2 -2
- package/dist/esm/hb-loading.entry.js +2 -2
- package/dist/esm/hb-main.entry.js +1 -1
- package/dist/esm/hb-menu-item.entry.js +2 -2
- package/dist/esm/hb-menu.entry.js +3 -3
- package/dist/esm/hb-menu.entry.js.map +1 -1
- package/dist/esm/hb-message.entry.js +2 -2
- package/dist/esm/hb-notification.entry.js +2 -2
- package/dist/esm/hb-page-header.entry.js +1 -1
- package/dist/esm/hb-pagination.entry.js +21 -8
- package/dist/esm/hb-pagination.entry.js.map +1 -1
- package/dist/esm/hb-popconfirm.entry.js +37 -7
- package/dist/esm/hb-popconfirm.entry.js.map +1 -1
- package/dist/esm/hb-popover.entry.js +22 -2
- package/dist/esm/hb-popover.entry.js.map +1 -1
- package/dist/esm/hb-progress.entry.js +1 -1
- package/dist/esm/hb-radio.entry.js +2 -2
- package/dist/esm/hb-rate.entry.js +45 -3
- package/dist/esm/hb-rate.entry.js.map +1 -1
- package/dist/esm/hb-result.entry.js +1 -1
- package/dist/esm/hb-row.entry.js +2 -2
- package/dist/esm/hb-segmented.entry.js +40 -6
- package/dist/esm/hb-segmented.entry.js.map +1 -1
- package/dist/esm/hb-select.entry.js +47 -8
- package/dist/esm/hb-select.entry.js.map +1 -1
- package/dist/esm/hb-slider.entry.js +189 -20
- package/dist/esm/hb-slider.entry.js.map +1 -1
- package/dist/esm/hb-space.entry.js +2 -2
- package/dist/esm/hb-statistic.entry.js +1 -1
- package/dist/esm/hb-step.entry.js +1 -1
- package/dist/esm/hb-steps.entry.js +28 -7
- package/dist/esm/hb-steps.entry.js.map +1 -1
- package/dist/esm/hb-sub-menu.entry.js +4 -4
- package/dist/esm/hb-switch.entry.js +9 -4
- package/dist/esm/hb-switch.entry.js.map +1 -1
- package/dist/esm/hb-tab-pane.entry.js +1 -1
- package/dist/esm/hb-table.entry.js +1 -1
- package/dist/esm/hb-table.entry.js.map +1 -1
- package/dist/esm/hb-tabs.entry.js +2 -2
- package/dist/esm/hb-tag.entry.js +2 -2
- package/dist/esm/hb-text.entry.js +2 -2
- package/dist/esm/hb-time-picker.entry.js +4 -4
- package/dist/esm/hb-time-select.entry.js +2 -2
- package/dist/esm/hb-timeline.entry.js +1 -1
- package/dist/esm/hb-tooltip.entry.js +18 -1
- package/dist/esm/hb-tooltip.entry.js.map +1 -1
- package/dist/esm/hb-transfer.entry.js +2 -2
- package/dist/esm/hb-tree-select.entry.js +95 -18
- package/dist/esm/hb-tree-select.entry.js.map +1 -1
- package/dist/esm/hb-tree.entry.js +1 -1
- package/dist/esm/hb-upload.entry.js +3 -3
- package/dist/esm/hb-watermark.entry.js +1 -1
- package/dist/esm/huibo-ui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/huibo-ui/huibo-ui.css +1 -1
- package/dist/huibo-ui/huibo-ui.esm.js +1 -1
- package/dist/huibo-ui/huibo-ui.esm.js.map +1 -1
- package/dist/huibo-ui/p-02f15843.entry.js +2 -0
- package/dist/huibo-ui/p-08b4005c.js +2 -0
- package/dist/huibo-ui/p-08b4005c.js.map +1 -0
- package/dist/huibo-ui/{p-fd19813c.entry.js → p-0d4b2997.entry.js} +2 -2
- package/dist/huibo-ui/{p-672076c3.entry.js → p-10f6c184.entry.js} +2 -2
- package/dist/huibo-ui/p-10f6c184.entry.js.map +1 -0
- package/dist/huibo-ui/{p-d7815b4f.entry.js → p-13010da2.entry.js} +2 -2
- package/dist/huibo-ui/{p-8c80a765.entry.js → p-15db24e9.entry.js} +2 -2
- package/dist/huibo-ui/{p-8d925e3d.entry.js → p-1b0fbe69.entry.js} +2 -2
- package/dist/huibo-ui/p-1f8db37a.entry.js +2 -0
- package/dist/huibo-ui/p-1f8db37a.entry.js.map +1 -0
- package/dist/huibo-ui/{p-f374d5a3.entry.js → p-20632186.entry.js} +2 -2
- package/dist/huibo-ui/{p-e6f2d71d.entry.js → p-20fc554b.entry.js} +2 -2
- package/dist/huibo-ui/{p-315feadf.entry.js → p-213b9de7.entry.js} +2 -2
- package/dist/huibo-ui/p-25fd7d5c.entry.js +2 -0
- package/dist/huibo-ui/p-25fd7d5c.entry.js.map +1 -0
- package/dist/huibo-ui/p-2811e603.entry.js +2 -0
- package/dist/huibo-ui/p-2811e603.entry.js.map +1 -0
- package/dist/huibo-ui/{p-64ca0980.entry.js → p-2943f5d0.entry.js} +2 -2
- package/dist/huibo-ui/p-2943f5d0.entry.js.map +1 -0
- package/dist/huibo-ui/{p-710f38de.entry.js → p-2b4556ff.entry.js} +2 -2
- package/dist/huibo-ui/{p-e0ab9010.entry.js → p-33de6878.entry.js} +2 -2
- package/dist/huibo-ui/{p-ebd04656.entry.js → p-3807da71.entry.js} +2 -2
- package/dist/huibo-ui/{p-6a1ec3ff.entry.js → p-3deff48c.entry.js} +2 -2
- package/dist/huibo-ui/{p-e2a8a396.entry.js → p-41d9c846.entry.js} +2 -2
- package/dist/huibo-ui/{p-0a033738.entry.js → p-47ef7a86.entry.js} +2 -2
- package/dist/huibo-ui/p-4d34e43e.entry.js +2 -0
- package/dist/huibo-ui/p-4d34e43e.entry.js.map +1 -0
- package/dist/huibo-ui/p-54aa2fd8.entry.js +2 -0
- package/dist/huibo-ui/p-54aa2fd8.entry.js.map +1 -0
- package/dist/huibo-ui/{p-88127de1.entry.js → p-55cd13eb.entry.js} +2 -2
- package/dist/huibo-ui/{p-58ebb9b3.entry.js → p-5c839288.entry.js} +2 -2
- package/dist/huibo-ui/{p-c1b4eacb.entry.js → p-60532a1f.entry.js} +2 -2
- package/dist/huibo-ui/{p-59b2e61c.entry.js → p-626b48f1.entry.js} +2 -2
- package/dist/huibo-ui/p-626b48f1.entry.js.map +1 -0
- package/dist/huibo-ui/p-639f167d.entry.js +2 -0
- package/dist/huibo-ui/p-639f167d.entry.js.map +1 -0
- package/dist/huibo-ui/{p-f1c084c5.entry.js → p-678b4212.entry.js} +2 -2
- package/dist/huibo-ui/p-6beb5b81.entry.js +2 -0
- package/dist/huibo-ui/p-6beb5b81.entry.js.map +1 -0
- package/dist/huibo-ui/{p-a0015341.entry.js → p-6bfeab80.entry.js} +2 -2
- package/dist/huibo-ui/p-6c8cf248.entry.js +2 -0
- package/dist/huibo-ui/p-6c8cf248.entry.js.map +1 -0
- package/dist/huibo-ui/{p-85f68526.entry.js → p-735bceef.entry.js} +2 -2
- package/dist/huibo-ui/{p-8b1ae77e.entry.js → p-746a11a3.entry.js} +2 -2
- package/dist/huibo-ui/p-76519752.entry.js +2 -0
- package/dist/huibo-ui/{p-d3939d44.entry.js → p-79af2efa.entry.js} +2 -2
- package/dist/huibo-ui/{p-e0768565.entry.js → p-7da14d7c.entry.js} +2 -2
- package/dist/huibo-ui/{p-8c987d57.entry.js → p-7f65dc36.entry.js} +2 -2
- package/dist/huibo-ui/{p-0e65e1bd.entry.js → p-86bdc48a.entry.js} +2 -2
- package/dist/huibo-ui/p-86bdc48a.entry.js.map +1 -0
- package/dist/huibo-ui/{p-d87fc21a.entry.js → p-88a6c905.entry.js} +2 -2
- package/dist/huibo-ui/{p-d64b91ef.entry.js → p-89ea1141.entry.js} +2 -2
- package/dist/huibo-ui/p-89ea1141.entry.js.map +1 -0
- package/dist/huibo-ui/p-8a202bc5.entry.js +2 -0
- package/dist/huibo-ui/p-8a202bc5.entry.js.map +1 -0
- package/dist/huibo-ui/p-8a8443b8.entry.js +2 -0
- package/dist/huibo-ui/p-8a8443b8.entry.js.map +1 -0
- package/dist/huibo-ui/p-8fd788c9.entry.js +2 -0
- package/dist/huibo-ui/p-8fd788c9.entry.js.map +1 -0
- package/dist/huibo-ui/{p-9319c650.entry.js → p-8fdbd17c.entry.js} +2 -2
- package/dist/huibo-ui/p-92521c31.entry.js +2 -0
- package/dist/huibo-ui/p-92521c31.entry.js.map +1 -0
- package/dist/huibo-ui/{p-c3e665f6.entry.js → p-9a5406f0.entry.js} +2 -2
- package/dist/huibo-ui/p-9a5406f0.entry.js.map +1 -0
- package/dist/huibo-ui/{p-c321c4aa.entry.js → p-a084b8e5.entry.js} +2 -2
- package/dist/huibo-ui/{p-5df47135.entry.js → p-a190ca89.entry.js} +2 -2
- package/dist/huibo-ui/{p-463de26d.entry.js → p-a8996d22.entry.js} +2 -2
- package/dist/huibo-ui/p-aa5e5e02.entry.js +2 -0
- package/dist/huibo-ui/p-aa5e5e02.entry.js.map +1 -0
- package/dist/huibo-ui/{p-6b381d0e.entry.js → p-ab9cf0e4.entry.js} +2 -2
- package/dist/huibo-ui/{p-477d8568.entry.js → p-aeae83af.entry.js} +2 -2
- package/dist/huibo-ui/{p-77017274.entry.js → p-af74667d.entry.js} +2 -2
- package/dist/huibo-ui/{p-b489a526.entry.js → p-b06c8020.entry.js} +2 -2
- package/dist/huibo-ui/{p-2e6584ea.entry.js → p-b468858e.entry.js} +2 -2
- package/dist/huibo-ui/{p-2b286698.entry.js → p-b7885d4a.entry.js} +2 -2
- package/dist/huibo-ui/{p-231a7335.entry.js → p-b8d87f7e.entry.js} +2 -2
- package/dist/huibo-ui/{p-8b027491.entry.js → p-c50ad398.entry.js} +2 -2
- package/dist/huibo-ui/p-c6c91664.entry.js +2 -0
- package/dist/huibo-ui/{p-c3e8893d.entry.js → p-c80f8ace.entry.js} +2 -2
- package/dist/huibo-ui/p-c80f8ace.entry.js.map +1 -0
- package/dist/huibo-ui/{p-476527c1.entry.js → p-c8e917db.entry.js} +2 -2
- package/dist/huibo-ui/p-c8e917db.entry.js.map +1 -0
- package/dist/huibo-ui/{p-c922d672.entry.js → p-cad57c2d.entry.js} +2 -2
- package/dist/huibo-ui/{p-a042e3d0.entry.js → p-ccd09d5a.entry.js} +2 -2
- package/dist/huibo-ui/p-d79a15b1.entry.js +2 -0
- package/dist/huibo-ui/p-d79a15b1.entry.js.map +1 -0
- package/dist/huibo-ui/{p-10c088f3.entry.js → p-d9c7c378.entry.js} +2 -2
- package/dist/huibo-ui/{p-80aca641.entry.js → p-dfccc7aa.entry.js} +2 -2
- package/dist/huibo-ui/{p-21682e92.entry.js → p-dfd144d8.entry.js} +2 -2
- package/dist/huibo-ui/{p-be48d2aa.entry.js → p-e039155d.entry.js} +2 -2
- package/dist/huibo-ui/{p-dfaf7e37.entry.js → p-e10fcfbe.entry.js} +2 -2
- package/dist/huibo-ui/{p-079a4130.entry.js → p-e3155cd7.entry.js} +2 -2
- package/dist/huibo-ui/{p-4001c08d.entry.js → p-e5cbfa9e.entry.js} +2 -2
- package/dist/huibo-ui/p-e5cbfa9e.entry.js.map +1 -0
- package/dist/huibo-ui/p-edbda423.entry.js +2 -0
- package/dist/huibo-ui/p-edbda423.entry.js.map +1 -0
- package/dist/huibo-ui/{p-465dcb4c.entry.js → p-f2c78699.entry.js} +2 -2
- package/dist/huibo-ui/{p-6ac242fe.entry.js → p-f4336be9.entry.js} +2 -2
- package/dist/huibo-ui/{p-332c8877.entry.js → p-f5969181.entry.js} +2 -2
- package/dist/huibo-ui/{p-f81ec512.entry.js → p-f6889710.entry.js} +2 -2
- package/dist/huibo-ui/{p-24ad7eec.entry.js → p-f9bb5217.entry.js} +2 -2
- package/dist/huibo-ui/{p-4d8b1404.entry.js → p-fd8301c6.entry.js} +2 -2
- package/dist/huibo-ui/{p-dd05cb2c.entry.js → p-fea20295.entry.js} +2 -2
- package/dist/types/components/Calendar/Calendar.d.ts +13 -1
- package/dist/types/components/Cascader/Cascader.d.ts +68 -90
- package/dist/types/components/ColorPicker/ColorPicker.d.ts +11 -0
- package/dist/types/components/DatePicker/DatePicker.d.ts +14 -3
- package/dist/types/components/Dropdown/Dropdown.d.ts +14 -1
- package/dist/types/components/Form/FormItem.d.ts +10 -0
- package/dist/types/components/ImagePreview/ImagePreview.d.ts +5 -1
- package/dist/types/components/Input/Input.d.ts +9 -0
- package/dist/types/components/Layout/Layout.d.ts +20 -10
- package/dist/types/components/Pagination/Pagination.d.ts +3 -0
- package/dist/types/components/Popconfirm/Popconfirm.d.ts +12 -0
- package/dist/types/components/Popover/Popover.d.ts +9 -0
- package/dist/types/components/Rate/Rate.d.ts +7 -0
- package/dist/types/components/Segmented/Segmented.d.ts +12 -1
- package/dist/types/components/Select/Select.d.ts +6 -0
- package/dist/types/components/Slider/Slider.d.ts +27 -1
- package/dist/types/components/Steps/Steps.d.ts +14 -6
- package/dist/types/components/Tooltip/Tooltip.d.ts +9 -1
- package/dist/types/components/TreeSelect/TreeSelect.d.ts +9 -0
- package/dist/types/components.d.ts +250 -94
- package/dist/types/utils/date-helpers.d.ts +1 -1
- package/package.json +8 -2
- package/readme.md +88 -73
- package/dist/cjs/date-helpers-904747ff.js.map +0 -1
- package/dist/components/p-cf94cbf6.js.map +0 -1
- package/dist/esm/date-helpers-e4d85a67.js.map +0 -1
- package/dist/huibo-ui/p-003cee87.entry.js +0 -2
- package/dist/huibo-ui/p-003cee87.entry.js.map +0 -1
- package/dist/huibo-ui/p-0bef78ac.entry.js +0 -2
- package/dist/huibo-ui/p-0bef78ac.entry.js.map +0 -1
- package/dist/huibo-ui/p-0e65e1bd.entry.js.map +0 -1
- package/dist/huibo-ui/p-0f189251.entry.js +0 -2
- package/dist/huibo-ui/p-0f189251.entry.js.map +0 -1
- package/dist/huibo-ui/p-1b5acd6d.entry.js +0 -2
- package/dist/huibo-ui/p-1b5acd6d.entry.js.map +0 -1
- package/dist/huibo-ui/p-3c7f73c8.entry.js +0 -2
- package/dist/huibo-ui/p-3c7f73c8.entry.js.map +0 -1
- package/dist/huibo-ui/p-4001c08d.entry.js.map +0 -1
- package/dist/huibo-ui/p-44c48246.entry.js +0 -2
- package/dist/huibo-ui/p-44c48246.entry.js.map +0 -1
- package/dist/huibo-ui/p-476527c1.entry.js.map +0 -1
- package/dist/huibo-ui/p-4d0dff15.entry.js +0 -2
- package/dist/huibo-ui/p-58d20809.entry.js +0 -2
- package/dist/huibo-ui/p-58d20809.entry.js.map +0 -1
- package/dist/huibo-ui/p-59b2e61c.entry.js.map +0 -1
- package/dist/huibo-ui/p-64ca0980.entry.js.map +0 -1
- package/dist/huibo-ui/p-672076c3.entry.js.map +0 -1
- package/dist/huibo-ui/p-756acbdb.entry.js +0 -2
- package/dist/huibo-ui/p-756acbdb.entry.js.map +0 -1
- package/dist/huibo-ui/p-75a93de3.entry.js +0 -2
- package/dist/huibo-ui/p-75a93de3.entry.js.map +0 -1
- package/dist/huibo-ui/p-769960f4.entry.js +0 -2
- package/dist/huibo-ui/p-8d615521.entry.js +0 -2
- package/dist/huibo-ui/p-8d615521.entry.js.map +0 -1
- package/dist/huibo-ui/p-953b9514.entry.js +0 -2
- package/dist/huibo-ui/p-ad6b0c6e.entry.js +0 -2
- package/dist/huibo-ui/p-ad6b0c6e.entry.js.map +0 -1
- package/dist/huibo-ui/p-c1a059d9.entry.js +0 -2
- package/dist/huibo-ui/p-c1a059d9.entry.js.map +0 -1
- package/dist/huibo-ui/p-c3e665f6.entry.js.map +0 -1
- package/dist/huibo-ui/p-c3e8893d.entry.js.map +0 -1
- package/dist/huibo-ui/p-cf94cbf6.js +0 -2
- package/dist/huibo-ui/p-cf94cbf6.js.map +0 -1
- package/dist/huibo-ui/p-d64b91ef.entry.js.map +0 -1
- package/dist/huibo-ui/p-e9490259.entry.js +0 -2
- package/dist/huibo-ui/p-e9490259.entry.js.map +0 -1
- package/dist/huibo-ui/p-ed0ff857.entry.js +0 -2
- package/dist/huibo-ui/p-ed0ff857.entry.js.map +0 -1
- package/dist/huibo-ui/p-f0ac7db5.entry.js +0 -2
- package/dist/huibo-ui/p-f0ac7db5.entry.js.map +0 -1
- /package/dist/huibo-ui/{p-4d0dff15.entry.js.map → p-02f15843.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-fd19813c.entry.js.map → p-0d4b2997.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-d7815b4f.entry.js.map → p-13010da2.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-8c80a765.entry.js.map → p-15db24e9.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-8d925e3d.entry.js.map → p-1b0fbe69.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-f374d5a3.entry.js.map → p-20632186.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-e6f2d71d.entry.js.map → p-20fc554b.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-315feadf.entry.js.map → p-213b9de7.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-710f38de.entry.js.map → p-2b4556ff.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-e0ab9010.entry.js.map → p-33de6878.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-ebd04656.entry.js.map → p-3807da71.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-6a1ec3ff.entry.js.map → p-3deff48c.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-e2a8a396.entry.js.map → p-41d9c846.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-0a033738.entry.js.map → p-47ef7a86.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-88127de1.entry.js.map → p-55cd13eb.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-58ebb9b3.entry.js.map → p-5c839288.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-c1b4eacb.entry.js.map → p-60532a1f.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-f1c084c5.entry.js.map → p-678b4212.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-a0015341.entry.js.map → p-6bfeab80.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-85f68526.entry.js.map → p-735bceef.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-8b1ae77e.entry.js.map → p-746a11a3.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-953b9514.entry.js.map → p-76519752.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-d3939d44.entry.js.map → p-79af2efa.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-e0768565.entry.js.map → p-7da14d7c.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-8c987d57.entry.js.map → p-7f65dc36.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-d87fc21a.entry.js.map → p-88a6c905.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-9319c650.entry.js.map → p-8fdbd17c.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-c321c4aa.entry.js.map → p-a084b8e5.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-5df47135.entry.js.map → p-a190ca89.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-463de26d.entry.js.map → p-a8996d22.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-6b381d0e.entry.js.map → p-ab9cf0e4.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-477d8568.entry.js.map → p-aeae83af.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-77017274.entry.js.map → p-af74667d.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-b489a526.entry.js.map → p-b06c8020.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-2e6584ea.entry.js.map → p-b468858e.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-2b286698.entry.js.map → p-b7885d4a.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-231a7335.entry.js.map → p-b8d87f7e.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-8b027491.entry.js.map → p-c50ad398.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-769960f4.entry.js.map → p-c6c91664.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-c922d672.entry.js.map → p-cad57c2d.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-a042e3d0.entry.js.map → p-ccd09d5a.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-10c088f3.entry.js.map → p-d9c7c378.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-80aca641.entry.js.map → p-dfccc7aa.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-21682e92.entry.js.map → p-dfd144d8.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-be48d2aa.entry.js.map → p-e039155d.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-dfaf7e37.entry.js.map → p-e10fcfbe.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-079a4130.entry.js.map → p-e3155cd7.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-465dcb4c.entry.js.map → p-f2c78699.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-6ac242fe.entry.js.map → p-f4336be9.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-332c8877.entry.js.map → p-f5969181.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-f81ec512.entry.js.map → p-f6889710.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-24ad7eec.entry.js.map → p-f9bb5217.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-4d8b1404.entry.js.map → p-fd8301c6.entry.js.map} +0 -0
- /package/dist/huibo-ui/{p-dd05cb2c.entry.js.map → p-fea20295.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"hb-pagination.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,aAAa,GAAG,uuOAAuuO,CAAC;AAC9vO,2BAAe,aAAa;;MCUf,UAAU;;;;;;;IAEb,KAAK,GAAW,CAAC,CAAC;;IAGlB,QAAQ,GAAW,EAAE,CAAC;;IAGL,WAAW,GAAW,CAAC,CAAC;;IAGzC,SAAS,GAAa,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;;IAGxC,UAAU,GAAW,CAAC,CAAC;;IAGvB,QAAQ,GAAY,KAAK,CAAC;;IAG1B,SAAS,GAAY,KAA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AQ,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,UAAU,EAClE,OAAO,EAAE,MAAM,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,aAGtD,CACL,EACN;KACH;;;;;;;;;","names":["h"],"sources":["src/components/Pagination/pagination.css?tag=hb-pagination&encapsulation=shadow","src/components/Pagination/Pagination.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.hb-pagination {\n display: flex;\n align-items: center;\n gap: var(--hb-spacing-xxs);\n font-size: var(--hb-font-size-sm);\n color: var(--hb-color-text);\n user-select: none;\n}\n\n.hb-pagination--disabled {\n opacity: 0.5;\n pointer-events: none;\n}\n\n.hb-pagination__total {\n margin-right: var(--hb-spacing-xs);\n color: var(--hb-color-text-secondary);\n}\n\n.hb-pagination__sizes {\n height: 28px;\n padding: 0 var(--hb-spacing-xs);\n border: 1px solid var(--hb-color-border);\n border-radius: var(--hb-border-radius-sm);\n background: var(--hb-color-bg);\n color: var(--hb-color-text);\n font-size: var(--hb-font-size-sm);\n cursor: pointer;\n outline: none;\n margin-right: var(--hb-spacing-xs);\n}\n\n.hb-pagination__sizes:focus {\n border-color: var(--hb-color-primary);\n}\n\n.hb-pagination__btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 28px;\n height: 28px;\n padding: 0 4px;\n border: 1px solid var(--hb-color-border);\n border-radius: var(--hb-border-radius-sm);\n background: var(--hb-color-bg);\n color: var(--hb-color-text);\n font-size: var(--hb-font-size-sm);\n cursor: pointer;\n outline: none;\n transition: all var(--hb-transition-duration) var(--hb-transition-function);\n}\n\n.hb-pagination__btn:hover:not(:disabled):not(.hb-pagination__btn--active) {\n color: var(--hb-color-primary);\n border-color: var(--hb-color-primary);\n}\n\n.hb-pagination__btn:disabled {\n color: var(--hb-color-text-disabled);\n cursor: not-allowed;\n background: var(--hb-color-fill-quaternary);\n}\n\n.hb-pagination__btn--active {\n background-color: var(--hb-color-primary);\n border-color: var(--hb-color-primary);\n color: #fff;\n}\n\n.hb-pagination__ellipsis {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 28px;\n height: 28px;\n color: var(--hb-color-text-secondary);\n letter-spacing: 2px;\n}\n","import { Component, h, Prop, Event, EventEmitter, State, Watch } from '@stencil/core';\n\n/**\n * Pagination 分页组件\n * 当数据量过多时,使用分页分解数据\n */\n@Component({\n tag: 'hb-pagination',\n styleUrl: 'pagination.css',\n shadow: true,\n})\nexport class Pagination {\n /** 总条目数 */\n @Prop() total: number = 0;\n\n /** 每页显示条目数 */\n @Prop() pageSize: number = 10;\n\n /** 当前页数 */\n @Prop({ mutable: true }) currentPage: number = 1;\n\n /** 每页显示个数选择器的选项设置 */\n @Prop() pageSizes: number[] = [10, 20, 50, 100];\n\n /** 最大页码按钮数 */\n @Prop() pagerCount: number = 7;\n\n /** 是否禁用 */\n @Prop() disabled: boolean = false;\n\n /** 是否显示总条数 */\n @Prop() showTotal: boolean = false;\n\n /** 是否显示每页条数选择器 */\n @Prop() showPageSize: boolean = false;\n\n @State() internalCurrent: number = 1;\n\n /** 当前页改变事件 */\n @Event() hbCurrentChange: EventEmitter<number>;\n\n /** 每页条数改变事件 */\n @Event() hbSizeChange: EventEmitter<number>;\n\n @Watch('currentPage')\n handleCurrentPageChange() {\n this.internalCurrent = this.currentPage;\n }\n\n componentDidLoad() {\n this.internalCurrent = this.currentPage;\n }\n\n private get totalPages(): number {\n return Math.max(1, Math.ceil(this.total / this.pageSize));\n }\n\n private handlePageClick(page: number) {\n if (this.disabled || page === this.internalCurrent || page < 1 || page > this.totalPages) return;\n this.internalCurrent = page;\n this.currentPage = page;\n this.hbCurrentChange.emit(page);\n }\n\n private handleSizeChange(e: Event) {\n const target = e.target as HTMLSelectElement;\n const size = parseInt(target.value, 10);\n this.hbSizeChange.emit(size);\n this.internalCurrent = 1;\n this.currentPage = 1;\n this.hbCurrentChange.emit(1);\n }\n\n private getPages(): (number | '...')[] {\n const pages: (number | '...')[] = [];\n const total = this.totalPages;\n const current = this.internalCurrent;\n const pager = this.pagerCount;\n\n if (total <= pager) {\n for (let i = 1; i <= total; i++) pages.push(i);\n return pages;\n }\n\n const half = Math.floor((pager - 2) / 2);\n let start = current - half;\n let end = current + half;\n\n if (start < 2) {\n start = 2;\n end = Math.min(pager - 1, total - 1);\n }\n if (end > total - 1) {\n end = total - 1;\n start = Math.max(2, total - pager + 2);\n }\n\n pages.push(1);\n if (start > 2) pages.push('...');\n for (let i = start; i <= end; i++) pages.push(i);\n if (end < total - 1) pages.push('...');\n pages.push(total);\n\n return pages;\n }\n\n render() {\n const pages = this.getPages();\n\n return (\n <div class={{ 'hb-pagination': true, 'hb-pagination--disabled': this.disabled }}>\n {this.showTotal && (\n <span class=\"hb-pagination__total\">共 {this.total} 条</span>\n )}\n\n {this.showPageSize && (\n <select class=\"hb-pagination__sizes\" onChange={this.handleSizeChange} disabled={this.disabled}>\n {this.pageSizes.map(size => (\n <option value={size} selected={size === this.pageSize}>{size} 条/页</option>\n ))}\n </select>\n )}\n\n <button\n type=\"button\"\n class=\"hb-pagination__btn hb-pagination__prev\"\n disabled={this.disabled || this.internalCurrent <= 1}\n onClick={() => this.handlePageClick(this.internalCurrent - 1)}\n >\n ‹\n </button>\n\n {pages.map(page =>\n page === '...' ? (\n <span class=\"hb-pagination__ellipsis\">...</span>\n ) : (\n <button\n type=\"button\"\n class={{\n 'hb-pagination__btn': true,\n 'hb-pagination__btn--active': page === this.internalCurrent,\n }}\n disabled={this.disabled}\n onClick={() => this.handlePageClick(page as number)}\n >\n {page}\n </button>\n )\n )}\n\n <button\n type=\"button\"\n class=\"hb-pagination__btn hb-pagination__next\"\n disabled={this.disabled || this.internalCurrent >= this.totalPages}\n onClick={() => this.handlePageClick(this.internalCurrent + 1)}\n >\n ›\n </button>\n </div>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"hb-pagination.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,aAA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":["src/components/Pagination/pagination.css?tag=hb-pagination&encapsulation=shadow","src/components/Pagination/Pagination.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.hb-pagination {\n display: flex;\n align-items: center;\n gap: var(--hb-spacing-xxs);\n font-size: var(--hb-font-size-sm);\n color: var(--hb-color-text);\n user-select: none;\n}\n\n.hb-pagination--disabled {\n opacity: 0.5;\n pointer-events: none;\n}\n\n.hb-pagination__total {\n margin-right: var(--hb-spacing-xs);\n color: var(--hb-color-text-secondary);\n}\n\n.hb-pagination__sizes {\n height: 28px;\n padding: 0 var(--hb-spacing-xs);\n border: 1px solid var(--hb-color-border);\n border-radius: var(--hb-border-radius-sm);\n background: var(--hb-color-bg);\n color: var(--hb-color-text);\n font-size: var(--hb-font-size-sm);\n cursor: pointer;\n outline: none;\n margin-right: var(--hb-spacing-xs);\n}\n\n.hb-pagination__sizes:focus {\n border-color: var(--hb-color-primary);\n}\n\n.hb-pagination__btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 28px;\n height: 28px;\n padding: 0 4px;\n border: 1px solid var(--hb-color-border);\n border-radius: var(--hb-border-radius-sm);\n background: var(--hb-color-bg);\n color: var(--hb-color-text);\n font-size: var(--hb-font-size-sm);\n cursor: pointer;\n outline: none;\n transition: all var(--hb-transition-duration) var(--hb-transition-function);\n}\n\n.hb-pagination__btn:hover:not(:disabled):not(.hb-pagination__btn--active) {\n color: var(--hb-color-primary);\n border-color: var(--hb-color-primary);\n}\n\n.hb-pagination__btn:disabled {\n color: var(--hb-color-text-disabled);\n cursor: not-allowed;\n background: var(--hb-color-fill-quaternary);\n}\n\n.hb-pagination__btn--active {\n background-color: var(--hb-color-primary);\n border-color: var(--hb-color-primary);\n color: #fff;\n}\n\n.hb-pagination__ellipsis {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 28px;\n height: 28px;\n color: var(--hb-color-text-secondary);\n letter-spacing: 2px;\n}\n\n/* ============================================================\n * 响应式(移动端):小屏简化分页,\n * 隐藏非相邻页码与省略号,仅保留 首页/上一页/当前页/下一页/末页。\n * 通过 aria-hidden 而非 display:none,保持键盘可达性由 active 决定。\n * ============================================================ */\n@media (max-width: 575.98px) {\n /* 隐藏中间页码(保留 active 与首末按钮) */\n .hb-pagination__btn:not(.hb-pagination__btn--active):not(.hb-pagination__prev):not(.hb-pagination__next) {\n display: none;\n }\n\n /* 隐藏省略号 */\n .hb-pagination__ellipsis {\n display: none;\n }\n\n /* 隐藏\"共 N 条\"和\"每页 N 条\"选择器以节省空间(信息保留在 aria-label) */\n .hb-pagination__total,\n .hb-pagination__sizes {\n display: none;\n }\n}\n","import { Component, h, Prop, Event, EventEmitter, State, Watch } from '@stencil/core';\n\n/**\n * Pagination 分页组件\n * 当数据量过多时,使用分页分解数据\n */\n@Component({\n tag: 'hb-pagination',\n styleUrl: 'pagination.css',\n shadow: true,\n})\nexport class Pagination {\n /** 总条目数 */\n @Prop() total: number = 0;\n\n /** 每页显示条目数 */\n @Prop() pageSize: number = 10;\n\n /** 当前页数 */\n @Prop({ mutable: true }) currentPage: number = 1;\n\n /** 每页显示个数选择器的选项设置 */\n @Prop() pageSizes: number[] = [10, 20, 50, 100];\n\n /** 最大页码按钮数 */\n @Prop() pagerCount: number = 7;\n\n /** 是否禁用 */\n @Prop() disabled: boolean = false;\n\n /** 是否显示总条数 */\n @Prop() showTotal: boolean = false;\n\n /** 是否显示每页条数选择器 */\n @Prop() showPageSize: boolean = false;\n\n @State() internalCurrent: number = 1;\n /** 内部每页条数:pageSize 变更时同步;size 切换后立即生效重算 totalPages */\n @State() internalPageSize: number = 10;\n\n /** 当前页改变事件 */\n @Event() hbCurrentChange: EventEmitter<number>;\n\n /** 每页条数改变事件 */\n @Event() hbSizeChange: EventEmitter<number>;\n\n @Watch('currentPage')\n handleCurrentPageChange() {\n this.internalCurrent = this.currentPage;\n }\n\n @Watch('pageSize')\n handlePageSizeChange() {\n this.internalPageSize = this.pageSize;\n }\n\n componentDidLoad() {\n this.internalCurrent = this.currentPage;\n this.internalPageSize = this.pageSize;\n }\n\n private get totalPages(): number {\n return Math.max(1, Math.ceil(this.total / this.internalPageSize));\n }\n\n private handlePageClick(page: number) {\n if (this.disabled || page === this.internalCurrent || page < 1 || page > this.totalPages) return;\n this.internalCurrent = page;\n this.currentPage = page;\n this.hbCurrentChange.emit(page);\n }\n\n private handleSizeChange(e: Event) {\n const target = e.target as HTMLSelectElement;\n const size = parseInt(target.value, 10);\n // 切 pageSize 后立即重算 totalPages,并防止 currentPage 越界\n this.internalPageSize = size;\n const newTotal = Math.max(1, Math.ceil(this.total / size));\n const safePage = Math.min(this.internalCurrent, newTotal);\n this.hbSizeChange.emit(size);\n this.internalCurrent = safePage;\n this.currentPage = safePage;\n if (safePage !== this.internalCurrent) {\n this.hbCurrentChange.emit(safePage);\n }\n }\n\n private getPages(): (number | '...')[] {\n const pages: (number | '...')[] = [];\n const total = this.totalPages;\n const current = this.internalCurrent;\n const pager = this.pagerCount;\n\n if (total <= pager) {\n for (let i = 1; i <= total; i++) pages.push(i);\n return pages;\n }\n\n const half = Math.floor((pager - 2) / 2);\n let start = current - half;\n let end = current + half;\n\n if (start < 2) {\n start = 2;\n end = Math.min(pager - 1, total - 1);\n }\n if (end > total - 1) {\n end = total - 1;\n start = Math.max(2, total - pager + 2);\n }\n\n pages.push(1);\n if (start > 2) pages.push('...');\n for (let i = start; i <= end; i++) pages.push(i);\n if (end < total - 1) pages.push('...');\n pages.push(total);\n\n return pages;\n }\n\n render() {\n const pages = this.getPages();\n\n return (\n <nav\n class={{ 'hb-pagination': true, 'hb-pagination--disabled': this.disabled }}\n role=\"navigation\"\n aria-label=\"分页\"\n >\n {this.showTotal && (\n <span class=\"hb-pagination__total\" aria-live=\"polite\">共 {this.total} 条</span>\n )}\n\n {this.showPageSize && (\n <select\n class=\"hb-pagination__sizes\"\n onChange={this.handleSizeChange}\n disabled={this.disabled}\n aria-label=\"每页条数\"\n >\n {this.pageSizes.map(size => (\n <option value={size} selected={size === this.internalPageSize}>{size} 条/页</option>\n ))}\n </select>\n )}\n\n <button\n type=\"button\"\n class=\"hb-pagination__btn hb-pagination__prev\"\n disabled={this.disabled || this.internalCurrent <= 1}\n onClick={() => this.handlePageClick(this.internalCurrent - 1)}\n aria-label=\"上一页\"\n >\n ‹\n </button>\n\n {pages.map(page =>\n page === '...' ? (\n <span class=\"hb-pagination__ellipsis\" aria-hidden=\"true\">...</span>\n ) : (\n <button\n type=\"button\"\n class={{\n 'hb-pagination__btn': true,\n 'hb-pagination__btn--active': page === this.internalCurrent,\n }}\n disabled={this.disabled}\n onClick={() => this.handlePageClick(page as number)}\n aria-label={`第 ${page} 页`}\n aria-current={page === this.internalCurrent ? 'page' : undefined}\n >\n {page}\n </button>\n )\n )}\n\n <button\n type=\"button\"\n class=\"hb-pagination__btn hb-pagination__next\"\n disabled={this.disabled || this.internalCurrent >= this.totalPages}\n onClick={() => this.handlePageClick(this.internalCurrent + 1)}\n aria-label=\"下一页\"\n >\n ›\n </button>\n </nav>\n );\n }\n}\n"],"version":3}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-5aa5c817.js');
|
|
6
6
|
const popupManager = require('./popup-manager-cde53b2f.js');
|
|
7
|
+
const a11y = require('./a11y-802de67a.js');
|
|
7
8
|
|
|
8
9
|
const popconfirmCss = "/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{appearance:button;background-color:#0000;border:0 solid;border-radius:0;box-sizing:border-box;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;margin:0;margin-inline-end:4px;opacity:1;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);line-height:1.5;tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex;padding-block:0}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}} /*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{}@layer base{}@layer components;:host{display:inline-block}.hb-popconfirm__trigger{cursor:pointer;display:inline-block}.hb-popconfirm__popup{animation:hb-popconfirm-fade .15s ease-out;background:var(--hb-color-bg-elevated);border-radius:var(--hb-border-radius-base);box-shadow:var(--hb-box-shadow);min-width:200px;padding:var(--hb-spacing-md);pointer-events:auto;position:fixed}.hb-popconfirm__main{align-items:flex-start;display:flex;gap:var(--hb-spacing-xs);margin-bottom:var(--hb-spacing-sm)}.hb-popconfirm__icon{color:var(--hb-color-warning);flex-shrink:0;font-size:16px}.hb-popconfirm__title{color:var(--hb-color-text);font-size:var(--hb-font-size-sm);line-height:1.5}.hb-popconfirm__action{display:flex;gap:var(--hb-spacing-xs);justify-content:flex-end}.hb-popconfirm__btn{background:var(--hb-color-bg);border:1px solid var(--hb-color-border);border-radius:var(--hb-border-radius-sm);cursor:pointer;font-size:var(--hb-font-size-xs);padding:4px 12px;transition:all var(--hb-transition-duration)}.hb-popconfirm__btn--cancel:hover{border-color:var(--hb-color-primary);color:var(--hb-color-primary)}.hb-popconfirm__btn--confirm{background:var(--hb-color-primary);border-color:var(--hb-color-primary);color:#fff}.hb-popconfirm__btn--confirm:hover{background:var(--hb-color-primary-hover)}@keyframes hb-popconfirm-fade{0%{opacity:0}to{opacity:1}}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}";
|
|
9
10
|
const HbPopconfirmStyle0 = popconfirmCss;
|
|
@@ -23,13 +24,34 @@ const Popconfirm = class {
|
|
|
23
24
|
popupStyle = {};
|
|
24
25
|
triggerRef;
|
|
25
26
|
popupRef;
|
|
27
|
+
confirmBtnRef;
|
|
26
28
|
show = () => {
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
if (this.disabled)
|
|
30
|
+
return;
|
|
31
|
+
this.visible = true;
|
|
32
|
+
requestAnimationFrame(() => {
|
|
33
|
+
this.updatePosition();
|
|
34
|
+
// 打开后自动聚焦确认按钮(对齐 antd:Enter 直接确认)
|
|
35
|
+
this.confirmBtnRef?.focus();
|
|
36
|
+
});
|
|
31
37
|
};
|
|
32
38
|
hide = () => { this.visible = false; };
|
|
39
|
+
/** 键盘:Esc 取消关闭(Enter 由聚焦的确认按钮原生处理) */
|
|
40
|
+
handleKeydown = (e) => {
|
|
41
|
+
if (e.key === 'Escape' && this.visible) {
|
|
42
|
+
e.preventDefault();
|
|
43
|
+
this.handleCancel(e);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
/** 触发器键盘:Enter/Space 打开 */
|
|
47
|
+
handleTriggerKeydown = (e) => {
|
|
48
|
+
if (this.disabled)
|
|
49
|
+
return;
|
|
50
|
+
if (a11y.isActivationKey(e.key)) {
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
this.show();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
33
55
|
updatePosition() {
|
|
34
56
|
if (!this.triggerRef || !this.popupRef)
|
|
35
57
|
return;
|
|
@@ -38,10 +60,18 @@ const Popconfirm = class {
|
|
|
38
60
|
const pos = popupManager.computePosition(rect, pw, ph, this.placement, 8);
|
|
39
61
|
this.popupStyle = { top: `${pos.top}px`, left: `${pos.left}px`, zIndex: String(popupManager.getNextZIndex()) };
|
|
40
62
|
}
|
|
41
|
-
handleConfirm = (e) => {
|
|
42
|
-
|
|
63
|
+
handleConfirm = (e) => {
|
|
64
|
+
e.stopPropagation();
|
|
65
|
+
this.hide();
|
|
66
|
+
this.el.dispatchEvent(new CustomEvent('hbConfirm', { bubbles: true }));
|
|
67
|
+
};
|
|
68
|
+
handleCancel = (e) => {
|
|
69
|
+
e.stopPropagation();
|
|
70
|
+
this.hide();
|
|
71
|
+
this.el.dispatchEvent(new CustomEvent('hbCancel', { bubbles: true }));
|
|
72
|
+
};
|
|
43
73
|
render() {
|
|
44
|
-
return (index.h("div", { key: '
|
|
74
|
+
return (index.h("div", { key: 'a3610b2320192960baa690acf9f0127fb36d206f', class: "hb-popconfirm", onClick: this.show, onKeyDown: this.handleKeydown }, index.h("div", { key: '7164d998c2d989ed702d7dac318ef4e354e74dba', ref: (el) => { this.triggerRef = el; }, class: "hb-popconfirm__trigger", role: "button", tabindex: this.disabled ? -1 : 0, "aria-haspopup": "dialog", "aria-expanded": this.visible ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', onKeyDown: this.handleTriggerKeydown }, index.h("slot", { key: '0c62f0d5fe58d4aec55aa22c64b7f7f66aa7780d' })), this.visible && (index.h("div", { key: '450446dc51b40f62b3496bea2717e95b6807a7ca', ref: (el) => { this.popupRef = el; }, class: "hb-popconfirm__popup", style: this.popupStyle, role: "dialog", "aria-live": "polite", "aria-labelledby": "hb-popconfirm__title" }, index.h("div", { key: '4fb63a0a1c89c0866b30acadcfeea20d6936f39a', class: "hb-popconfirm__main" }, index.h("span", { key: '9cb5583abfc8822f0217a43b809ca9766c35b63e', class: "hb-popconfirm__icon", "aria-hidden": "true" }, this.icon), index.h("span", { key: '75419c7cecb35e91134f62d9d0cfb71331813e0a', id: "hb-popconfirm__title", class: "hb-popconfirm__title" }, this.title)), index.h("div", { key: '6cf55c098e1926b418869ce9015ae2f25e4b41c0', class: "hb-popconfirm__action" }, index.h("button", { key: '07334e3915c17333808c5341e902ac5609f3ee2c', type: "button", class: "hb-popconfirm__btn hb-popconfirm__btn--cancel", onClick: this.handleCancel }, this.cancelButtonText), index.h("button", { key: 'ca133eab1ef2e8a043cf546bd57277df89d73616', type: "button", ref: (el) => { this.confirmBtnRef = el; }, class: "hb-popconfirm__btn hb-popconfirm__btn--confirm", onClick: this.handleConfirm }, this.confirmButtonText))))));
|
|
45
75
|
}
|
|
46
76
|
};
|
|
47
77
|
Popconfirm.style = HbPopconfirmStyle0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"hb-popconfirm.entry.cjs.js","mappings":"
|
|
1
|
+
{"file":"hb-popconfirm.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,aAAa,GAAG,26NAA26N,CAAC;AACl8N,2BAAe,aAAa;;MCWf,UAAU;;;;;IAEb,KAAK,GAAW,UAAU,CAAC;IAC3B,iBAAiB,GAAW,IAAI,CAAC;IACjC,gBAAgB,GAAW,IAAI,CAAC;IAChC,SAAS,GAAc,KAAK,CAAC;IAC7B,QAAQ,GAAY,KAAK,CAAC;IAC1B,IAAI,GAAW,GAAG,CAAC;IAClB,OAAO,GAAY,KAAK,CAAC;IACzB,UAAU,GAA2B,EAAE,CAAC;IAEzC,UAAU,CAAe;IACzB,QAAQ,CAAkB;IAC1B,aAAa,CAAqB;IAElC,IAAI,GAAG;QACb,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO;QAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,qBAAqB,CAAC;YACpB,IAAI,CAAC,cAAc,EAAE,CAAC;;YAEtB,IAAI,CAAC,aAAa,EAAE,KAAK,EAAE,CAAC;SAC7B,CAAC,CAAC;KACJ,CAAC;IACM,IAAI,GAAG,QAAQ,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,EAAE,CAAC;;IAGvC,aAAa,GAAG,CAAC,CAAgB;QACvC,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE;YACtC,CAAC,CAAC,cA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BAAgB,CACf,EACTA,qEACE,IAAI,EAAC,QAAQ,EACb,GAAG,EAAE,CAAC,EAAO,OAAO,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC,EAAE,EAC9C,KAAK,EAAC,gDAAgD,EACtD,OAAO,EAAE,IAAI,CAAC,aAAa,IAE1B,IAAI,CAAC,iBAAiB,CAChB,CACL,CACF,CACP,CACG,EACN;KACH;;;;;;","names":["isActivationKey","computePosition","getNextZIndex","h"],"sources":["src/components/Popconfirm/popconfirm.css?tag=hb-popconfirm&encapsulation=shadow","src/components/Popconfirm/Popconfirm.tsx"],"sourcesContent":[":host { display: inline-block; }\n.hb-popconfirm__trigger { display: inline-block; cursor: pointer; }\n.hb-popconfirm__popup {\n position: fixed; background: var(--hb-color-bg-elevated);\n border-radius: var(--hb-border-radius-base); box-shadow: var(--hb-box-shadow);\n padding: var(--hb-spacing-md); min-width: 200px; animation: hb-popconfirm-fade 0.15s ease-out; pointer-events: auto;\n}\n.hb-popconfirm__main { display: flex; align-items: flex-start; gap: var(--hb-spacing-xs); margin-bottom: var(--hb-spacing-sm); }\n.hb-popconfirm__icon { color: var(--hb-color-warning); font-size: 16px; flex-shrink: 0; }\n.hb-popconfirm__title { font-size: var(--hb-font-size-sm); color: var(--hb-color-text); line-height: 1.5; }\n.hb-popconfirm__action { display: flex; justify-content: flex-end; gap: var(--hb-spacing-xs); }\n.hb-popconfirm__btn {\n padding: 4px 12px; font-size: var(--hb-font-size-xs); border-radius: var(--hb-border-radius-sm);\n cursor: pointer; border: 1px solid var(--hb-color-border); background: var(--hb-color-bg);\n transition: all var(--hb-transition-duration);\n}\n.hb-popconfirm__btn--cancel:hover { color: var(--hb-color-primary); border-color: var(--hb-color-primary); }\n.hb-popconfirm__btn--confirm { background: var(--hb-color-primary); color: #fff; border-color: var(--hb-color-primary); }\n.hb-popconfirm__btn--confirm:hover { background: var(--hb-color-primary-hover); }\n@keyframes hb-popconfirm-fade { from { opacity: 0; } to { opacity: 1; } }\n","import { Component, h, Prop, State, Element } from '@stencil/core';\nimport { computePosition, getNextZIndex, Placement } from '../../utils/popup-manager';\nimport { isActivationKey } from '../../utils/a11y';\n\n/**\n * Popconfirm 气泡确认框\n * 无障碍(对齐 antd / WAI-ARIA):\n * - 触发器 role=button + aria-haspopup=dialog + aria-expanded + aria-describedby\n * - 浮层 role=dialog + aria-live=polite(确认文屏幕阅读器实时播报)\n * - 键盘:trigger Enter/Space 打开;Esc=取消关闭;打开时自动聚焦确认按钮\n */\n@Component({ tag: 'hb-popconfirm', styleUrl: 'popconfirm.css', shadow: true })\nexport class Popconfirm {\n @Element() el: HTMLElement;\n @Prop() title: string = '确定执行此操作?';\n @Prop() confirmButtonText: string = '确定';\n @Prop() cancelButtonText: string = '取消';\n @Prop() placement: Placement = 'top';\n @Prop() disabled: boolean = false;\n @Prop() icon: string = '⚠';\n @State() visible: boolean = false;\n @State() popupStyle: Record<string, string> = {};\n\n private triggerRef?: HTMLElement;\n private popupRef?: HTMLDivElement;\n private confirmBtnRef?: HTMLButtonElement;\n\n private show = () => {\n if (this.disabled) return;\n this.visible = true;\n requestAnimationFrame(() => {\n this.updatePosition();\n // 打开后自动聚焦确认按钮(对齐 antd:Enter 直接确认)\n this.confirmBtnRef?.focus();\n });\n };\n private hide = () => { this.visible = false; };\n\n /** 键盘:Esc 取消关闭(Enter 由聚焦的确认按钮原生处理) */\n private handleKeydown = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && this.visible) {\n e.preventDefault();\n this.handleCancel(e);\n }\n };\n\n /** 触发器键盘:Enter/Space 打开 */\n private handleTriggerKeydown = (e: KeyboardEvent) => {\n if (this.disabled) return;\n if (isActivationKey(e.key)) {\n e.preventDefault();\n this.show();\n }\n };\n\n private updatePosition() {\n if (!this.triggerRef || !this.popupRef) return;\n const rect = this.triggerRef.getBoundingClientRect();\n const { width: pw, height: ph } = this.popupRef.getBoundingClientRect();\n const pos = computePosition(rect, pw, ph, this.placement, 8);\n this.popupStyle = { top: `${pos.top}px`, left: `${pos.left}px`, zIndex: String(getNextZIndex()) };\n }\n\n private handleConfirm = (e: Event) => {\n e.stopPropagation();\n this.hide();\n this.el.dispatchEvent(new CustomEvent('hbConfirm', { bubbles: true }));\n };\n private handleCancel = (e: Event) => {\n e.stopPropagation();\n this.hide();\n this.el.dispatchEvent(new CustomEvent('hbCancel', { bubbles: true }));\n };\n\n render() {\n return (\n <div\n class=\"hb-popconfirm\"\n onClick={this.show}\n onKeyDown={this.handleKeydown}\n >\n <div\n ref={(el: any) => { this.triggerRef = el; }}\n class=\"hb-popconfirm__trigger\"\n role=\"button\"\n tabindex={this.disabled ? -1 : 0}\n aria-haspopup=\"dialog\"\n aria-expanded={this.visible ? 'true' : 'false'}\n aria-disabled={this.disabled ? 'true' : 'false'}\n onKeyDown={this.handleTriggerKeydown}\n >\n <slot />\n </div>\n {this.visible && (\n <div\n ref={(el: any) => { this.popupRef = el; }}\n class=\"hb-popconfirm__popup\"\n style={this.popupStyle}\n role=\"dialog\"\n aria-live=\"polite\"\n aria-labelledby=\"hb-popconfirm__title\"\n >\n <div class=\"hb-popconfirm__main\">\n <span class=\"hb-popconfirm__icon\" aria-hidden=\"true\">{this.icon}</span>\n <span id=\"hb-popconfirm__title\" class=\"hb-popconfirm__title\">{this.title}</span>\n </div>\n <div class=\"hb-popconfirm__action\">\n <button\n type=\"button\"\n class=\"hb-popconfirm__btn hb-popconfirm__btn--cancel\"\n onClick={this.handleCancel}\n >\n {this.cancelButtonText}\n </button>\n <button\n type=\"button\"\n ref={(el: any) => { this.confirmBtnRef = el; }}\n class=\"hb-popconfirm__btn hb-popconfirm__btn--confirm\"\n onClick={this.handleConfirm}\n >\n {this.confirmButtonText}\n </button>\n </div>\n </div>\n )}\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-5aa5c817.js');
|
|
6
6
|
const popupManager = require('./popup-manager-cde53b2f.js');
|
|
7
|
+
const a11y = require('./a11y-802de67a.js');
|
|
7
8
|
|
|
8
9
|
const popoverCss = "/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{appearance:button;background-color:#0000;border:0 solid;border-radius:0;box-sizing:border-box;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;margin:0;margin-inline-end:4px;opacity:1;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);line-height:1.5;tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex;padding-block:0}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.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;.hb-popover__trigger,:host{display:inline-block}.hb-popover__popup{animation:hb-popover-fade .15s ease-out;background:var(--hb-color-bg-elevated);border-radius:var(--hb-border-radius-base);box-shadow:var(--hb-box-shadow);padding:var(--hb-spacing-sm)0;pointer-events:auto;position:fixed}.hb-popover__title{border-bottom:1px solid var(--hb-color-border-secondary);font-size:var(--hb-font-size-sm);font-weight:600;padding:var(--hb-spacing-xs)var(--hb-spacing-md)}.hb-popover__body{color:var(--hb-color-text);font-size:var(--hb-font-size-sm);padding:var(--hb-spacing-sm)var(--hb-spacing-md)}@keyframes hb-popover-fade{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}";
|
|
9
10
|
const HbPopoverStyle0 = popoverCss;
|
|
@@ -39,6 +40,21 @@ const Popover = class {
|
|
|
39
40
|
this.show();
|
|
40
41
|
}
|
|
41
42
|
};
|
|
43
|
+
/** 触发器键盘:Enter/Space 切换;Esc 关闭(click 触发模式) */
|
|
44
|
+
handleKeydown = (e) => {
|
|
45
|
+
if (this.disabled)
|
|
46
|
+
return;
|
|
47
|
+
if (e.key === 'Escape' && this.visible) {
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
this.hide();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
// click 触发模式才允许键盘打开;hover 模式 focus 时已由 onFocus 展开
|
|
53
|
+
if (this.trigger === 'click' && a11y.isActivationKey(e.key)) {
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
this.toggle();
|
|
56
|
+
}
|
|
57
|
+
};
|
|
42
58
|
updatePosition() {
|
|
43
59
|
if (!this.triggerRef || !this.popupRef)
|
|
44
60
|
return;
|
|
@@ -48,8 +64,12 @@ const Popover = class {
|
|
|
48
64
|
this.popupStyle = { top: `${pos.top}px`, left: `${pos.left}px`, zIndex: String(popupManager.getNextZIndex()) };
|
|
49
65
|
}
|
|
50
66
|
render() {
|
|
51
|
-
const events = this.trigger === 'hover'
|
|
52
|
-
|
|
67
|
+
const events = this.trigger === 'hover'
|
|
68
|
+
? { onMouseEnter: this.show, onMouseLeave: this.hide }
|
|
69
|
+
: { onClick: this.toggle };
|
|
70
|
+
return (index.h("div", { key: '8085a1ce5c74415b6a54b30edb12cd894b6d6407', class: "hb-popover", ...events, onKeyDown: this.handleKeydown }, index.h("div", { key: 'ca51e0624265da38c99ec4f035776429616a4444', ref: (el) => { this.triggerRef = el; }, class: "hb-popover__trigger", role: "button", tabindex: this.disabled ? -1 : 0, "aria-haspopup": "dialog", "aria-expanded": this.visible ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false',
|
|
71
|
+
// hover 触发模式:focus 也展开(键盘用户可见)
|
|
72
|
+
onFocus: this.trigger === 'hover' ? this.show : undefined, onBlur: this.trigger === 'hover' ? this.hide : undefined }, index.h("slot", { key: 'b2717c611c8f73c54e2463724c9b76bef24d5a88' })), this.visible && (index.h("div", { key: '13cc85f0c1a2b52c59afa6c9d90f3b70a7b4dbd9', ref: (el) => { this.popupRef = el; }, class: "hb-popover__popup", style: { ...this.popupStyle, width: this.width }, role: "dialog", "aria-labelledby": this.title ? 'hb-popover__title' : undefined, onMouseEnter: () => this.trigger === 'hover' && this.show(), onMouseLeave: () => this.trigger === 'hover' && this.hide() }, this.title && index.h("div", { key: 'e89dc3689137445d896cccd3a50a2ab9fa34d677', id: "hb-popover__title", class: "hb-popover__title" }, this.title), index.h("div", { key: '27ab058045cd181074e3436a58ce234d23a648dc', class: "hb-popover__body" }, index.h("slot", { key: '1fc7515e13a753f34d390c10dc8b87d376705a20', name: "content" }))))));
|
|
53
73
|
}
|
|
54
74
|
};
|
|
55
75
|
Popover.style = HbPopoverStyle0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"hb-popover.entry.cjs.js","mappings":"
|
|
1
|
+
{"file":"hb-popover.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,UAAU,GAAG,kzMAAkzM,CAAC;AACt0M,wBAAe,UAAU;;MCWZ,OAAO;;;;;;;IAIV,KAAK,GAAW,EAAE,CAAC;IACnB,KAAK,GAAW,OAAO,CAAC;IACxB,SAAS,GAAc,QAAQ,CAAC;IAChC,OAAO,GAAsB,OAAO,CAAC;IACrC,QAAQ,GAAY,KAAK,CAAC;IACzB,OAAO,GAAY,KAAK,CAAC;IACzB,UAAU,GAA2B,EAAE,CAAC;IAEzC,UAAU,CAAe;IACzB,QAAQ,CAAkB;IAE1B,IAAI,GAAG;QAAQ,IAAI,C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AAG,mBAAmB,GAAG,SAAS,EAC7D,YAAY,EAAE,MAAM,IAAI,CAAC,OAAO,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,EAC3D,YAAY,EAAE,MAAM,IAAI,CAAC,OAAO,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,IAE1D,IAAI,CAAC,KAAK,IAAIA,kEAAK,EAAE,EAAC,mBAAmB,EAAC,KAAK,EAAC,mBAAmB,IAAE,IAAI,CAAC,KAAK,CAAO,EACvFA,kEAAK,KAAK,EAAC,kBAAkB,IAACA,mEAAM,IAAI,EAAC,SAAS,GAAG,CAAM,CACvD,CACP,CACG,EACN;KACH;;;;;;","names":["isActivationKey","computePosition","getNextZIndex","h"],"sources":["src/components/Popover/popover.css?tag=hb-popover&encapsulation=shadow","src/components/Popover/Popover.tsx"],"sourcesContent":[":host { display: inline-block; }\n.hb-popover__trigger { display: inline-block; }\n.hb-popover__popup {\n position: fixed; background: var(--hb-color-bg-elevated);\n border-radius: var(--hb-border-radius-base); box-shadow: var(--hb-box-shadow);\n padding: var(--hb-spacing-sm) 0; animation: hb-popover-fade 0.15s ease-out; pointer-events: auto;\n}\n.hb-popover__title { padding: var(--hb-spacing-xs) var(--hb-spacing-md); font-weight: 600; font-size: var(--hb-font-size-sm); border-bottom: 1px solid var(--hb-color-border-secondary); }\n.hb-popover__body { padding: var(--hb-spacing-sm) var(--hb-spacing-md); font-size: var(--hb-font-size-sm); color: var(--hb-color-text); }\n@keyframes hb-popover-fade { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }\n","import { Component, h, Prop, State, Element } from '@stencil/core';\nimport { computePosition, getNextZIndex, Placement } from '../../utils/popup-manager';\nimport { isActivationKey } from '../../utils/a11y';\n\n/**\n * Popover 气泡卡片\n * 无障碍(对齐 antd / WAI-ARIA):\n * - 触发器 role=button + aria-haspopup=dialog + aria-expanded\n * - 浮层 role=dialog + aria-labelledby(title)\n * - 键盘:trigger 上 Enter/Space 打开/关闭;Esc 关闭\n */\n@Component({ tag: 'hb-popover', styleUrl: 'popover.css', shadow: true })\nexport class Popover {\n @Element() el: HTMLElement;\n // 注意:使用默认值使其成为 required string,避免与 HTMLElement.title(string)\n // 的可选类型冲突;同时保留 Ant Design 兼容的 `title` API。\n @Prop() title: string = '';\n @Prop() width: string = '240px';\n @Prop() placement: Placement = 'bottom';\n @Prop() trigger: 'hover' | 'click' = 'hover';\n @Prop() disabled: boolean = false;\n @State() visible: boolean = false;\n @State() popupStyle: Record<string, string> = {};\n\n private triggerRef?: HTMLElement;\n private popupRef?: HTMLDivElement;\n\n private show = () => { if (!this.disabled) { this.visible = true; requestAnimationFrame(() => this.updatePosition()); } };\n private hide = () => { this.visible = false; };\n private toggle = () => {\n if (this.visible) {\n this.hide();\n } else {\n this.show();\n }\n };\n\n /** 触发器键盘:Enter/Space 切换;Esc 关闭(click 触发模式) */\n private handleKeydown = (e: KeyboardEvent) => {\n if (this.disabled) return;\n if (e.key === 'Escape' && this.visible) {\n e.preventDefault();\n this.hide();\n return;\n }\n // click 触发模式才允许键盘打开;hover 模式 focus 时已由 onFocus 展开\n if (this.trigger === 'click' && isActivationKey(e.key)) {\n e.preventDefault();\n this.toggle();\n }\n };\n\n private updatePosition() {\n if (!this.triggerRef || !this.popupRef) return;\n const rect = this.triggerRef.getBoundingClientRect();\n const { width: pw, height: ph } = this.popupRef.getBoundingClientRect();\n const pos = computePosition(rect, pw, ph, this.placement, 8);\n this.popupStyle = { top: `${pos.top}px`, left: `${pos.left}px`, zIndex: String(getNextZIndex()) };\n }\n\n render() {\n const events = this.trigger === 'hover'\n ? { onMouseEnter: this.show, onMouseLeave: this.hide }\n : { onClick: this.toggle };\n\n return (\n <div\n class=\"hb-popover\"\n {...events}\n onKeyDown={this.handleKeydown}\n >\n <div\n ref={(el: any) => { this.triggerRef = el; }}\n class=\"hb-popover__trigger\"\n role=\"button\"\n tabindex={this.disabled ? -1 : 0}\n aria-haspopup=\"dialog\"\n aria-expanded={this.visible ? 'true' : 'false'}\n aria-disabled={this.disabled ? 'true' : 'false'}\n // hover 触发模式:focus 也展开(键盘用户可见)\n onFocus={this.trigger === 'hover' ? this.show : undefined}\n onBlur={this.trigger === 'hover' ? this.hide : undefined}\n >\n <slot />\n </div>\n {this.visible && (\n <div\n ref={(el: any) => { this.popupRef = el; }}\n class=\"hb-popover__popup\"\n style={{ ...this.popupStyle, width: this.width }}\n role=\"dialog\"\n aria-labelledby={this.title ? 'hb-popover__title' : undefined}\n onMouseEnter={() => this.trigger === 'hover' && this.show()}\n onMouseLeave={() => this.trigger === 'hover' && this.hide()}\n >\n {this.title && <div id=\"hb-popover__title\" class=\"hb-popover__title\">{this.title}</div>}\n <div class=\"hb-popover__body\"><slot name=\"content\" /></div>\n </div>\n )}\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -29,7 +29,7 @@ const Progress = class {
|
|
|
29
29
|
}
|
|
30
30
|
render() {
|
|
31
31
|
const clampedPct = Math.max(0, Math.min(100, this.percentage));
|
|
32
|
-
return (index.h("div", { key: '
|
|
32
|
+
return (index.h("div", { key: '0378f701fdab1a467c441925938dd15750e2440d', class: "hb-progress" }, index.h("div", { key: '06a661fff31f8dfe79b96d769dcdd907fb6e4ff6', class: "hb-progress__bar", style: { height: `${this.strokeWidth}px` } }, index.h("div", { key: 'fdcf3c300fd700f1779203ea7733d276313bf567', class: "hb-progress__bar-inner", style: { width: `${clampedPct}%`, backgroundColor: this.barColor } })), this.showText && index.h("span", { key: '101821cfa8592f03ef47695b46f32c18f96b07ff', class: "hb-progress__text" }, clampedPct, "%")));
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
Progress.style = HbProgressStyle0;
|
|
@@ -98,13 +98,13 @@ const Radio = class {
|
|
|
98
98
|
};
|
|
99
99
|
render() {
|
|
100
100
|
const inputId = this.radioId || `hb-radio-${Math.random().toString(36).substr(2, 9)}`;
|
|
101
|
-
return (index.h("label", { key: '
|
|
101
|
+
return (index.h("label", { key: '463c0d18fd65a81e2a2bf5618362e35461ab554f', class: {
|
|
102
102
|
'hb-radio': true,
|
|
103
103
|
'hb-radio--checked': this.isChecked,
|
|
104
104
|
'hb-radio--disabled': this.disabled,
|
|
105
105
|
'hb-radio--border': this.border,
|
|
106
106
|
[`hb-radio--${this.size}`]: true,
|
|
107
|
-
} }, index.h("span", { key: '
|
|
107
|
+
} }, index.h("span", { key: '292c166d1b83d7b2e0f4a0ae9dad244515eb8cc6', class: "hb-radio__input" }, index.h("input", { key: '1adc442e06c276252c7b2824b1fb5cb4d2e65087', type: "radio", id: inputId, name: this.name, checked: this.isChecked, disabled: this.disabled, value: this.value, onChange: this.handleChange, class: "hb-radio__original" }), index.h("span", { key: '6b2c538c1c1e1dd8e2de0eeffe073d7621febe8b', class: "hb-radio__inner" })), (this.label || this.value !== undefined) && (index.h("span", { key: '0b1a0f58465b4f159902ff573233f617000114de', class: "hb-radio__label" }, index.h("slot", { key: 'e4ff0c4d859ffd28d9c82b8c1b4cebed39f00b93' }, this.label || this.value)))));
|
|
108
108
|
}
|
|
109
109
|
static get watchers() { return {
|
|
110
110
|
"modelValue": ["handleValueChange"],
|
|
@@ -75,6 +75,48 @@ const Rate = class {
|
|
|
75
75
|
this.hoverValue = 0;
|
|
76
76
|
this.hbChange.emit(newValue);
|
|
77
77
|
};
|
|
78
|
+
/**
|
|
79
|
+
* 键盘调节评分(对齐 WAI-ARIA slider / antd Rate):
|
|
80
|
+
* - ArrowRight/ArrowUp:增加(allowHalf 时步进 0.5,否则 1)
|
|
81
|
+
* - ArrowLeft/ArrowDown:减少
|
|
82
|
+
* - Home:归 0;End:满分
|
|
83
|
+
*/
|
|
84
|
+
handleKeydown = (e) => {
|
|
85
|
+
if (this.disabled || this.readonly)
|
|
86
|
+
return;
|
|
87
|
+
const step = this.allowHalf ? 0.5 : 1;
|
|
88
|
+
let next = null;
|
|
89
|
+
switch (e.key) {
|
|
90
|
+
case 'ArrowRight':
|
|
91
|
+
case 'ArrowUp':
|
|
92
|
+
next = this.currentValue + step;
|
|
93
|
+
break;
|
|
94
|
+
case 'ArrowLeft':
|
|
95
|
+
case 'ArrowDown':
|
|
96
|
+
next = this.currentValue - step;
|
|
97
|
+
break;
|
|
98
|
+
case 'Home':
|
|
99
|
+
next = 0;
|
|
100
|
+
break;
|
|
101
|
+
case 'End':
|
|
102
|
+
next = this.max;
|
|
103
|
+
break;
|
|
104
|
+
default:
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
e.preventDefault();
|
|
108
|
+
if (next === null)
|
|
109
|
+
return;
|
|
110
|
+
// 夹取到 [0, max],且按 step 对齐
|
|
111
|
+
const clamped = Math.max(0, Math.min(next, this.max));
|
|
112
|
+
// 修正浮点:allowHalf 时保留一位小数
|
|
113
|
+
const snapped = this.allowHalf ? Math.round(clamped * 2) / 2 : Math.round(clamped);
|
|
114
|
+
if (snapped === this.currentValue)
|
|
115
|
+
return;
|
|
116
|
+
this.currentValue = snapped;
|
|
117
|
+
this.modelValue = snapped;
|
|
118
|
+
this.hbChange.emit(snapped);
|
|
119
|
+
};
|
|
78
120
|
handleMouseEnter = (value) => {
|
|
79
121
|
if (this.disabled || this.readonly)
|
|
80
122
|
return;
|
|
@@ -104,7 +146,7 @@ const Rate = class {
|
|
|
104
146
|
render() {
|
|
105
147
|
const displayValue = this.getDisplayValue();
|
|
106
148
|
const stars = Array.from({ length: this.max }, (_, i) => i + 1);
|
|
107
|
-
return (index.h("div", { key: '
|
|
149
|
+
return (index.h("div", { key: '6e1ff9a1ed597f2dba1111893a32d079bdce38a4', class: "hb-rate", role: "slider", tabindex: this.disabled || this.readonly ? -1 : 0, "aria-valuemin": 0, "aria-valuemax": this.max, "aria-valuenow": this.currentValue, "aria-valuetext": this.scoreTemplate ? this.getScoreText() : `${this.currentValue} 分`, "aria-orientation": "horizontal", "aria-disabled": this.disabled ? 'true' : 'false', "aria-readonly": this.readonly ? 'true' : 'false', onKeyDown: this.handleKeydown }, stars.map((value) => {
|
|
108
150
|
const isFull = displayValue >= value;
|
|
109
151
|
const isHalf = this.allowHalf && displayValue >= value - 0.5 && displayValue < value;
|
|
110
152
|
const isActive = isFull || isHalf;
|
|
@@ -118,8 +160,8 @@ const Rate = class {
|
|
|
118
160
|
}, onClick: (e) => {
|
|
119
161
|
e.stopPropagation();
|
|
120
162
|
this.handleClick(value, true);
|
|
121
|
-
} }, "\u2605")), index.h("span", { class: "hb-rate__icon" }, "\u2605")));
|
|
122
|
-
}), this.showScore && (index.h("span", { key: '
|
|
163
|
+
} }, "\u2605")), index.h("span", { class: "hb-rate__icon", "aria-hidden": "true" }, "\u2605")));
|
|
164
|
+
}), this.showScore && (index.h("span", { key: '8bea6243ef85f5cab68eff37b3d259cf3793f9c9', class: "hb-rate__text" }, this.getScoreText())), this.showText && this.getText() && (index.h("span", { key: '714f24cacb7bc8dfd04f0a984658d845197ef82d', class: "hb-rate__text" }, this.getText()))));
|
|
123
165
|
}
|
|
124
166
|
static get watchers() { return {
|
|
125
167
|
"modelValue": ["handleValueChange"]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"hb-rate.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,OAAO,GAAG,47MAA47M,CAAC;AAC78M,qBAAe,OAAO;;MCUT,IAAI;;;;;;;;IAIU,UAAU,GAAW,CAAC,CAAC;;;;;IAMxC,GAAG,GAAW,CAAC,CAAC;;;;;IAMhB,QAAQ,GAAY,KAAK,CAAC;;;;;IAM1B,SAAS,GAAY,KAAK,CAAC;;;;;IAM3B,QAAQ,GAAY,KAAK,CAAC;;;;;IAM1B,SAAS,GAAY,KAAK,CAAC;;;;;IAM3B,QAAQ,GAAY,KAAK,CAAC;;;;IAK1B,KAAK,CAAY;;;;IAKjB,aAAa,CAAU;IAEtB,UAAU,GAAW,CAAC,CAAC;IACvB,YAAY,GAAW,CAAC,CAAC;;;;IAKzB,QAAQ,CAAuB;IAExC,gBAAgB;QACd,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC;K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AAK,EAAC,eAAe,aAAS,CAC/B,EACP;SACH,CAAC,EACD,IAAI,CAAC,SAAS,KACbA,mEAAM,KAAK,EAAC,eAAe,IAAE,IAAI,CAAC,YAAY,EAAE,CAAQ,CACzD,EACA,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE,KAC9BA,mEAAM,KAAK,EAAC,eAAe,IAAE,IAAI,CAAC,OAAO,EAAE,CAAQ,CACpD,CACG,EACN;KACH;;;;;;;;;","names":["h"],"sources":["src/components/Rate/rate.css?tag=hb-rate&encapsulation=shadow","src/components/Rate/Rate.tsx"],"sourcesContent":[":host {\n display: inline-block;\n --hb-rate-font-size: 20px;\n --hb-rate-color: var(--hb-color-warning, #e6a23c);\n --hb-rate-void-color: var(--hb-color-text-placeholder, #c0c4cc);\n}\n\n.hb-rate {\n display: inline-block;\n height: var(--hb-rate-font-size);\n line-height: var(--hb-rate-font-size);\n vertical-align: middle;\n}\n\n.hb-rate__item {\n position: relative;\n display: inline-block;\n font-size: var(--hb-rate-font-size);\n margin-right: 6px;\n color: var(--hb-rate-void-color);\n cursor: pointer;\n transition: transform 0.2s;\n}\n\n.hb-rate__item:hover {\n transform: scale(1.1);\n}\n\n.hb-rate__item--active {\n color: var(--hb-rate-color);\n}\n\n.hb-rate__icon {\n display: block;\n}\n\n.hb-rate__half {\n position: absolute;\n left: 0;\n top: 0;\n width: 50%;\n overflow: hidden;\n color: var(--hb-rate-void-color);\n}\n\n.hb-rate__half--active {\n color: var(--hb-rate-color);\n}\n\n.hb-rate__text {\n margin-left: 8px;\n font-size: 14px;\n color: var(--hb-color-text-regular, #606266);\n vertical-align: middle;\n}\n\n","import { Component, h, Prop, Event, EventEmitter, State, Watch } from '@stencil/core';\n\n/**\n * Rate 评分组件\n * 评分组件\n */\n@Component({\n tag: 'hb-rate',\n styleUrl: 'rate.css',\n shadow: true,\n})\nexport class Rate {\n /**\n * 绑定值\n */\n @Prop({ mutable: true }) modelValue: number = 0;\n\n /**\n * 最大分值\n * @default 5\n */\n @Prop() max: number = 5;\n\n /**\n * 是否禁用\n * @default false\n */\n @Prop() disabled: boolean = false;\n\n /**\n * 是否允许半选\n * @default false\n */\n @Prop() allowHalf: boolean = false;\n\n /**\n * 只读\n * @default false\n */\n @Prop() readonly: boolean = false;\n\n /**\n * 是否显示分数\n * @default false\n */\n @Prop() showScore: boolean = false;\n\n /**\n * 是否显示文本\n * @default false\n */\n @Prop() showText: boolean = false;\n\n /**\n * 辅助文字数组\n */\n @Prop() texts?: string[];\n\n /**\n * 分数显示模板\n */\n @Prop() scoreTemplate?: string;\n\n @State() hoverValue: number = 0;\n @State() currentValue: number = 0;\n\n /**\n * 值改变事件\n */\n @Event() hbChange: EventEmitter<number>;\n\n componentDidLoad() {\n this.currentValue = this.modelValue;\n }\n\n @Watch('modelValue')\n handleValueChange() {\n this.currentValue = this.modelValue;\n }\n\n private handleClick = (value: number, isHalf: boolean) => {\n if (this.disabled || this.readonly) return;\n \n const newValue = isHalf && this.allowHalf ? value - 0.5 : value;\n this.currentValue = newValue;\n this.modelValue = newValue;\n this.hoverValue = 0;\n this.hbChange.emit(newValue);\n };\n\n private handleMouseEnter = (value: number) => {\n if (this.disabled || this.readonly) return;\n this.hoverValue = value;\n };\n\n private handleMouseLeave = () => {\n if (this.disabled || this.readonly) return;\n this.hoverValue = 0;\n };\n\n private getDisplayValue(): number {\n return this.hoverValue || this.currentValue;\n }\n\n private getText(): string {\n const value = Math.ceil(this.currentValue);\n if (this.texts && this.texts[value - 1]) {\n return this.texts[value - 1];\n }\n return '';\n }\n\n private getScoreText(): string {\n if (this.scoreTemplate) {\n return this.scoreTemplate.replace('{value}', String(this.currentValue));\n }\n return `${this.currentValue} / ${this.max}`;\n }\n\n render() {\n const displayValue = this.getDisplayValue();\n const stars = Array.from({ length: this.max }, (_, i) => i + 1);\n\n return (\n <div class=\"hb-rate\">\n {stars.map((value) => {\n const isFull = displayValue >= value;\n const isHalf = this.allowHalf && displayValue >= value - 0.5 && displayValue < value;\n const isActive = isFull || isHalf;\n\n return (\n <span\n class={{\n 'hb-rate__item': true,\n 'hb-rate__item--active': isActive,\n 'hb-rate__item--half': isHalf,\n }}\n onMouseEnter={() => this.handleMouseEnter(value)}\n onMouseLeave={this.handleMouseLeave}\n onClick={() => this.handleClick(value, false)}\n >\n {this.allowHalf && (\n <span\n class={{\n 'hb-rate__half': true,\n 'hb-rate__half--active': isHalf,\n }}\n onClick={(e) => {\n e.stopPropagation();\n this.handleClick(value, true);\n }}\n >\n ★\n </span>\n )}\n <span class=\"hb-rate__icon\">★</span>\n </span>\n );\n })}\n {this.showScore && (\n <span class=\"hb-rate__text\">{this.getScoreText()}</span>\n )}\n {this.showText && this.getText() && (\n <span class=\"hb-rate__text\">{this.getText()}</span>\n )}\n </div>\n );\n }\n}\n\n"],"version":3}
|
|
1
|
+
{"file":"hb-rate.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,OAAO,GAAG,47MAA47M,CAAC;AAC78M,qBAAe,OAAO;;MCUT,IAAI;;;;;;;;IAIU,UAAU,GAAW,CAAC,CAAC;;;;;IAMxC,GAAG,GAAW,CAAC,CAAC;;;;;IAMhB,QAAQ,GAAY,KAAK,CAAC;;;;;IAM1B,SAAS,GAAY,KAAK,CAAC;;;;;IAM3B,QAAQ,GAAY,KAAK,CAAC;;;;;IAM1B,SAAS,GAAY,KAAK,CAAC;;;;;IAM3B,QAAQ,GAAY,KAAK,CAAC;;;;IAK1B,KAAK,CAAY;;;;IAKjB,aAAa,CAAU;IAEtB,UAAU,GAAW,CAAC,CAAC;IACvB,YAAY,GAAW,CAAC,CAAC;;;;IAKzB,QAAQ,CAAuB;IAExC,gBAAgB;QACd,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC;KACrC;IAGD,iBAAiB;QACf,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC;KACrC;IAEO,WAAW,GAAG,CAAC,KAAa,EAAE,MAAe;QACnD,IAAI,IAAI,CAAC,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C,SAAS,KACbA,kBACE,KAAK,EAAE;oBACL,eAAe,EAAE,IAAI;oBACrB,uBAAuB,EAAE,MAAM;iBAChC,EACD,OAAO,EAAE,CAAC,CAAC;oBACT,CAAC,CAAC,eAAe,EAAE,CAAC;oBACpB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;iBAC/B,aAGI,CACR,EACDA,kBAAM,KAAK,EAAC,eAAe,iBAAa,MAAM,aAAS,CAClD,EACP;SACH,CAAC,EACD,IAAI,CAAC,SAAS,KACbA,mEAAM,KAAK,EAAC,eAAe,IAAE,IAAI,CAAC,YAAY,EAAE,CAAQ,CACzD,EACA,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE,KAC9BA,mEAAM,KAAK,EAAC,eAAe,IAAE,IAAI,CAAC,OAAO,EAAE,CAAQ,CACpD,CACG,EACN;KACH;;;;;;;;;","names":["h"],"sources":["src/components/Rate/rate.css?tag=hb-rate&encapsulation=shadow","src/components/Rate/Rate.tsx"],"sourcesContent":[":host {\n display: inline-block;\n --hb-rate-font-size: 20px;\n --hb-rate-color: var(--hb-color-warning, #e6a23c);\n --hb-rate-void-color: var(--hb-color-text-placeholder, #c0c4cc);\n}\n\n.hb-rate {\n display: inline-block;\n height: var(--hb-rate-font-size);\n line-height: var(--hb-rate-font-size);\n vertical-align: middle;\n}\n\n.hb-rate__item {\n position: relative;\n display: inline-block;\n font-size: var(--hb-rate-font-size);\n margin-right: 6px;\n color: var(--hb-rate-void-color);\n cursor: pointer;\n transition: transform 0.2s;\n}\n\n.hb-rate__item:hover {\n transform: scale(1.1);\n}\n\n.hb-rate__item--active {\n color: var(--hb-rate-color);\n}\n\n.hb-rate__icon {\n display: block;\n}\n\n.hb-rate__half {\n position: absolute;\n left: 0;\n top: 0;\n width: 50%;\n overflow: hidden;\n color: var(--hb-rate-void-color);\n}\n\n.hb-rate__half--active {\n color: var(--hb-rate-color);\n}\n\n.hb-rate__text {\n margin-left: 8px;\n font-size: 14px;\n color: var(--hb-color-text-regular, #606266);\n vertical-align: middle;\n}\n\n","import { Component, h, Prop, Event, EventEmitter, State, Watch } from '@stencil/core';\n\n/**\n * Rate 评分组件\n * 评分组件\n */\n@Component({\n tag: 'hb-rate',\n styleUrl: 'rate.css',\n shadow: true,\n})\nexport class Rate {\n /**\n * 绑定值\n */\n @Prop({ mutable: true }) modelValue: number = 0;\n\n /**\n * 最大分值\n * @default 5\n */\n @Prop() max: number = 5;\n\n /**\n * 是否禁用\n * @default false\n */\n @Prop() disabled: boolean = false;\n\n /**\n * 是否允许半选\n * @default false\n */\n @Prop() allowHalf: boolean = false;\n\n /**\n * 只读\n * @default false\n */\n @Prop() readonly: boolean = false;\n\n /**\n * 是否显示分数\n * @default false\n */\n @Prop() showScore: boolean = false;\n\n /**\n * 是否显示文本\n * @default false\n */\n @Prop() showText: boolean = false;\n\n /**\n * 辅助文字数组\n */\n @Prop() texts?: string[];\n\n /**\n * 分数显示模板\n */\n @Prop() scoreTemplate?: string;\n\n @State() hoverValue: number = 0;\n @State() currentValue: number = 0;\n\n /**\n * 值改变事件\n */\n @Event() hbChange: EventEmitter<number>;\n\n componentDidLoad() {\n this.currentValue = this.modelValue;\n }\n\n @Watch('modelValue')\n handleValueChange() {\n this.currentValue = this.modelValue;\n }\n\n private handleClick = (value: number, isHalf: boolean) => {\n if (this.disabled || this.readonly) return;\n\n const newValue = isHalf && this.allowHalf ? value - 0.5 : value;\n this.currentValue = newValue;\n this.modelValue = newValue;\n this.hoverValue = 0;\n this.hbChange.emit(newValue);\n };\n\n /**\n * 键盘调节评分(对齐 WAI-ARIA slider / antd Rate):\n * - ArrowRight/ArrowUp:增加(allowHalf 时步进 0.5,否则 1)\n * - ArrowLeft/ArrowDown:减少\n * - Home:归 0;End:满分\n */\n private handleKeydown = (e: KeyboardEvent) => {\n if (this.disabled || this.readonly) return;\n const step = this.allowHalf ? 0.5 : 1;\n let next: number | null = null;\n switch (e.key) {\n case 'ArrowRight':\n case 'ArrowUp':\n next = this.currentValue + step;\n break;\n case 'ArrowLeft':\n case 'ArrowDown':\n next = this.currentValue - step;\n break;\n case 'Home':\n next = 0;\n break;\n case 'End':\n next = this.max;\n break;\n default:\n return;\n }\n e.preventDefault();\n if (next === null) return;\n // 夹取到 [0, max],且按 step 对齐\n const clamped = Math.max(0, Math.min(next, this.max));\n // 修正浮点:allowHalf 时保留一位小数\n const snapped = this.allowHalf ? Math.round(clamped * 2) / 2 : Math.round(clamped);\n if (snapped === this.currentValue) return;\n this.currentValue = snapped;\n this.modelValue = snapped;\n this.hbChange.emit(snapped);\n };\n\n private handleMouseEnter = (value: number) => {\n if (this.disabled || this.readonly) return;\n this.hoverValue = value;\n };\n\n private handleMouseLeave = () => {\n if (this.disabled || this.readonly) return;\n this.hoverValue = 0;\n };\n\n private getDisplayValue(): number {\n return this.hoverValue || this.currentValue;\n }\n\n private getText(): string {\n const value = Math.ceil(this.currentValue);\n if (this.texts && this.texts[value - 1]) {\n return this.texts[value - 1];\n }\n return '';\n }\n\n private getScoreText(): string {\n if (this.scoreTemplate) {\n return this.scoreTemplate.replace('{value}', String(this.currentValue));\n }\n return `${this.currentValue} / ${this.max}`;\n }\n\n render() {\n const displayValue = this.getDisplayValue();\n const stars = Array.from({ length: this.max }, (_, i) => i + 1);\n\n return (\n <div\n class=\"hb-rate\"\n role=\"slider\"\n tabindex={this.disabled || this.readonly ? -1 : 0}\n aria-valuemin={0}\n aria-valuemax={this.max}\n aria-valuenow={this.currentValue}\n aria-valuetext={this.scoreTemplate ? this.getScoreText() : `${this.currentValue} 分`}\n aria-orientation=\"horizontal\"\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-readonly={this.readonly ? 'true' : 'false'}\n onKeyDown={this.handleKeydown}\n >\n {stars.map((value) => {\n const isFull = displayValue >= value;\n const isHalf = this.allowHalf && displayValue >= value - 0.5 && displayValue < value;\n const isActive = isFull || isHalf;\n\n return (\n <span\n class={{\n 'hb-rate__item': true,\n 'hb-rate__item--active': isActive,\n 'hb-rate__item--half': isHalf,\n }}\n onMouseEnter={() => this.handleMouseEnter(value)}\n onMouseLeave={this.handleMouseLeave}\n onClick={() => this.handleClick(value, false)}\n >\n {this.allowHalf && (\n <span\n class={{\n 'hb-rate__half': true,\n 'hb-rate__half--active': isHalf,\n }}\n onClick={(e) => {\n e.stopPropagation();\n this.handleClick(value, true);\n }}\n >\n ★\n </span>\n )}\n <span class=\"hb-rate__icon\" aria-hidden=\"true\">★</span>\n </span>\n );\n })}\n {this.showScore && (\n <span class=\"hb-rate__text\">{this.getScoreText()}</span>\n )}\n {this.showText && this.getText() && (\n <span class=\"hb-rate__text\">{this.getText()}</span>\n )}\n </div>\n );\n }\n}\n\n"],"version":3}
|
|
@@ -47,7 +47,7 @@ const Result = class {
|
|
|
47
47
|
}
|
|
48
48
|
render() {
|
|
49
49
|
const color = this.getColor();
|
|
50
|
-
return (index.h("div", { key: '
|
|
50
|
+
return (index.h("div", { key: '2e1cbc3672080bcab9211f186212c2bae44bc3af', class: { 'hb-result': true, [`hb-result--${this.status}`]: true } }, index.h("div", { key: 'a016fc8c7ca5684e8d52ee1305fe2e71b3ba502f', class: "hb-result__icon", style: { color } }, index.h("span", { key: '534b33fbd62e51b05c6a28660ce439c12fb3da2b', class: "hb-result__icon-symbol" }, this.getIcon())), this.title && index.h("div", { key: '51b722e6a0beef39adfbef3d3c1dadfad9c70dd1', class: "hb-result__title" }, this.title), this.subTitle !== undefined && index.h("div", { key: '3bc005594f74cc9c1806100001509441b9c357d4', class: "hb-result__subtitle" }, this.subTitle), index.h("div", { key: '41702ad25f27484659b4e7437a05cb4227f9e7a9', class: "hb-result__extra" }, index.h("slot", { key: 'd973cd7a63731803a460e9dfe61583a79aec483f' }))));
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
Result.style = HbResultStyle0;
|
|
@@ -41,13 +41,13 @@ const Row = class {
|
|
|
41
41
|
render() {
|
|
42
42
|
const gutter = this.getGutterValue();
|
|
43
43
|
const Tag = this.tag;
|
|
44
|
-
return (index.h(Tag, { key: '
|
|
44
|
+
return (index.h(Tag, { key: 'e7f2593080241151fc0a4998433c6e0892b92408', class: {
|
|
45
45
|
'hb-row': true,
|
|
46
46
|
[`hb-row--justify-${this.justify}`]: true,
|
|
47
47
|
[`hb-row--align-${this.align}`]: true,
|
|
48
48
|
}, style: {
|
|
49
49
|
'--hb-row-gutter': gutter ? `${gutter}px` : '0',
|
|
50
|
-
} }, index.h("slot", { key: '
|
|
50
|
+
} }, index.h("slot", { key: '135d4bbac362e79f2980f627b78f27dd5d679283' })));
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
Row.style = HbRowStyle0;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-5aa5c817.js');
|
|
6
|
+
const a11y = require('./a11y-802de67a.js');
|
|
6
7
|
|
|
7
8
|
const segmentedCss = "/*! 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{.block{display:block}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}} /*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{}@layer base{}@layer components;:host{display:block}.hb-segmented{background:var(--hb-color-fill);border-radius:var(--hb-border-radius-base);box-sizing:border-box;display:inline-flex;padding:2px}.hb-segmented--block{display:flex;width:100%}.hb-segmented__items{display:inline-flex;gap:2px;width:100%}.hb-segmented--large .hb-segmented__item{font-size:var(--hb-font-size-base);padding:6px 18px}.hb-segmented--default .hb-segmented__item{font-size:var(--hb-font-size-sm);padding:4px 14px}.hb-segmented--small .hb-segmented__item{font-size:var(--hb-font-size-xs);padding:2px 10px}.hb-segmented__item{align-items:center;background:0 0;border:none;border-radius:var(--hb-border-radius-sm);color:var(--hb-color-text);cursor:pointer;display:inline-flex;flex:1;font-family:inherit;justify-content:center;line-height:1.5;transition:background .2s,color .2s;white-space:nowrap}.hb-segmented__item:hover:not(.hb-segmented__item--active):not(.hb-segmented__item--disabled){background:var(--hb-color-fill-secondary)}.hb-segmented__item--active{background:var(--hb-color-bg-container);box-shadow:0 2px 8px #00000014;color:var(--hb-color-primary);font-weight:500}.hb-segmented__item--disabled{color:var(--hb-color-text-disabled);cursor:not-allowed}.hb-segmented__item-label{pointer-events:none}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}";
|
|
8
9
|
const HbSegmentedStyle0 = segmentedCss;
|
|
@@ -12,6 +13,7 @@ const Segmented = class {
|
|
|
12
13
|
index.registerInstance(this, hostRef);
|
|
13
14
|
this.hbChange = index.createEvent(this, "hbChange", 7);
|
|
14
15
|
}
|
|
16
|
+
get el() { return index.getElement(this); }
|
|
15
17
|
/** 当前选中值 */
|
|
16
18
|
modelValue = '';
|
|
17
19
|
/** 是否撑满宽度 */
|
|
@@ -20,20 +22,52 @@ const Segmented = class {
|
|
|
20
22
|
size = 'default';
|
|
21
23
|
/** 选项数组 */
|
|
22
24
|
options = [];
|
|
25
|
+
activeIndex = -1;
|
|
23
26
|
/** 选中值变化事件 */
|
|
24
27
|
hbChange;
|
|
28
|
+
componentWillLoad() {
|
|
29
|
+
this.syncActiveIndex();
|
|
30
|
+
}
|
|
31
|
+
syncActiveIndex() {
|
|
32
|
+
this.activeIndex = this.options.findIndex(o => o.value === this.modelValue);
|
|
33
|
+
}
|
|
25
34
|
handleSelect = (option) => {
|
|
26
35
|
if (option.disabled || option.value === this.modelValue)
|
|
27
36
|
return;
|
|
28
37
|
this.modelValue = option.value;
|
|
38
|
+
this.syncActiveIndex();
|
|
29
39
|
this.hbChange.emit(option.value);
|
|
30
40
|
};
|
|
41
|
+
/** 键盘导航:radiogroup 模式,←→/Home/End 移动并选中(跳过禁用项) */
|
|
42
|
+
handleKeydown = (e) => {
|
|
43
|
+
const enabled = this.options.map((o, i) => ({ o, i })).filter(x => !x.o.disabled);
|
|
44
|
+
if (enabled.length === 0)
|
|
45
|
+
return;
|
|
46
|
+
const enabledIndices = enabled.map(x => x.i);
|
|
47
|
+
// 在启用项索引空间内做导航
|
|
48
|
+
const action = a11y.handleListKeyboard(e, {
|
|
49
|
+
activeIndex: enabledIndices.indexOf(this.activeIndex),
|
|
50
|
+
itemCount: enabled.length,
|
|
51
|
+
loop: true,
|
|
52
|
+
});
|
|
53
|
+
if (action.type === 'navigate') {
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
const targetIdx = enabledIndices[action.index];
|
|
56
|
+
this.handleSelect(this.options[targetIdx]);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
31
59
|
render() {
|
|
32
|
-
return (index.h("div", { key: '
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
60
|
+
return (index.h("div", { key: '99415aec6f05594d101a2e11d32405f818c6cad4', class: { 'hb-segmented': true, [`hb-segmented--${this.size}`]: true, 'hb-segmented--block': this.block }, role: "radiogroup", onKeyDown: this.handleKeydown }, index.h("div", { key: '2c8fc90cebe0c11853918cb6c7c11630450d06cd', class: "hb-segmented__items" }, this.options.map((option, index$1) => {
|
|
61
|
+
const checked = option.value === this.modelValue;
|
|
62
|
+
// roving tabindex:仅选中项(或未选中时首个启用项)可达 Tab
|
|
63
|
+
const isFirstEnabled = this.options.findIndex(o => !o.disabled) === index$1;
|
|
64
|
+
const tabindex = checked || (this.activeIndex < 0 && isFirstEnabled) ? 0 : -1;
|
|
65
|
+
return (index.h("button", { type: "button", class: {
|
|
66
|
+
'hb-segmented__item': true,
|
|
67
|
+
'hb-segmented__item--active': checked,
|
|
68
|
+
'hb-segmented__item--disabled': !!option.disabled,
|
|
69
|
+
}, disabled: !!option.disabled, role: "radio", "aria-checked": checked ? 'true' : 'false', tabindex: option.disabled ? -1 : tabindex, onClick: () => this.handleSelect(option) }, index.h("span", { class: "hb-segmented__item-label" }, option.label)));
|
|
70
|
+
}))));
|
|
37
71
|
}
|
|
38
72
|
};
|
|
39
73
|
Segmented.style = HbSegmentedStyle0;
|