@woodger/antd 0.1.1 → 0.1.3
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/affix/Affix.svelte +12 -4
- package/dist/affix/affix.types.d.ts +3 -2
- package/dist/alert/Alert.svelte +22 -14
- package/dist/alert/alert.types.d.ts +12 -11
- package/dist/anchor/Anchor.svelte +5 -2
- package/dist/anchor/AnchorLink.svelte +4 -1
- package/dist/anchor/anchor.types.d.ts +10 -9
- package/dist/app/App.svelte +2 -1
- package/dist/app/app.types.d.ts +3 -2
- package/dist/auto-complete/AutoComplete.svelte +209 -43
- package/dist/auto-complete/auto-complete.types.d.ts +34 -3
- package/dist/avatar/Avatar.svelte +46 -32
- package/dist/avatar/AvatarGroup.svelte +34 -11
- package/dist/avatar/AvatarGroupOverflow.svelte +27 -8
- package/dist/avatar/AvatarGroupOverflow.svelte.d.ts +2 -0
- package/dist/avatar/avatar-group-context.d.ts +10 -0
- package/dist/avatar/avatar-group-context.js +11 -0
- package/dist/avatar/avatar-group.engine.d.ts +13 -4
- package/dist/avatar/avatar-group.engine.js +18 -0
- package/dist/avatar/avatar-group.types.d.ts +11 -5
- package/dist/avatar/avatar.component.d.ts +7 -0
- package/dist/avatar/avatar.component.js +4 -0
- package/dist/avatar/avatar.types.d.ts +6 -4
- package/dist/badge/Badge.svelte +37 -17
- package/dist/badge/BadgeRibbon.svelte +26 -21
- package/dist/badge/badge-ribbon.dom.d.ts +2 -4
- package/dist/badge/badge-ribbon.dom.js +14 -10
- package/dist/badge/badge-ribbon.types.d.ts +12 -11
- package/dist/badge/badge-style.dom.d.ts +2 -2
- package/dist/badge/badge-style.dom.js +9 -5
- package/dist/badge/badge-style.engine.d.ts +5 -0
- package/dist/badge/badge-style.engine.js +9 -2
- package/dist/badge/badge.component.d.ts +7 -0
- package/dist/badge/badge.component.js +4 -0
- package/dist/badge/badge.engine.js +1 -1
- package/dist/badge/badge.types.d.ts +15 -11
- package/dist/border-beam/BorderBeam.svelte +9 -5
- package/dist/border-beam/border-beam.engine.d.ts +2 -2
- package/dist/border-beam/border-beam.engine.js +7 -12
- package/dist/border-beam/border-beam.types.d.ts +4 -3
- package/dist/breadcrumb/Breadcrumb.svelte +9 -3
- package/dist/breadcrumb/BreadcrumbEntry.svelte +6 -19
- package/dist/breadcrumb/breadcrumb.engine.d.ts +5 -2
- package/dist/breadcrumb/breadcrumb.engine.js +25 -2
- package/dist/breadcrumb/breadcrumb.types.d.ts +30 -18
- package/dist/button/Button.svelte +35 -10
- package/dist/button/ButtonLabel.svelte +23 -0
- package/dist/button/ButtonLabel.svelte.d.ts +13 -0
- package/dist/button/button.engine.d.ts +6 -0
- package/dist/button/button.engine.js +35 -0
- package/dist/button/button.types.d.ts +11 -8
- package/dist/calendar/CalendarCore.svelte +26 -18
- package/dist/calendar/calendar.component.d.ts +7 -0
- package/dist/calendar/calendar.component.js +4 -0
- package/dist/calendar/calendar.types.d.ts +8 -7
- package/dist/card/Card.svelte +61 -19
- package/dist/card/CardGrid.svelte +4 -1
- package/dist/card/CardMeta.svelte +4 -1
- package/dist/card/card-semantic.engine.d.ts +1 -1
- package/dist/card/card-semantic.engine.js +2 -2
- package/dist/card/card.component.d.ts +9 -0
- package/dist/card/card.component.js +5 -0
- package/dist/card/card.engine.d.ts +2 -0
- package/dist/card/card.engine.js +7 -0
- package/dist/card/card.types.d.ts +19 -19
- package/dist/carousel/Carousel.svelte +11 -5
- package/dist/carousel/carousel-settings.engine.d.ts +1 -1
- package/dist/carousel/carousel.types.d.ts +4 -3
- package/dist/cascader/Cascader.svelte +8 -3
- package/dist/cascader/Cascader.svelte.d.ts +13 -13
- package/dist/cascader/CascaderColumns.svelte +25 -27
- package/dist/cascader/CascaderColumns.svelte.d.ts +9 -7
- package/dist/cascader/CascaderCore.svelte +814 -133
- package/dist/cascader/CascaderCore.svelte.d.ts +14 -14
- package/dist/cascader/CascaderPanel.svelte +9 -3
- package/dist/cascader/CascaderPanel.svelte.d.ts +13 -13
- package/dist/cascader/cascader.component.d.ts +17 -0
- package/dist/cascader/cascader.component.js +9 -0
- package/dist/cascader/cascader.dom.d.ts +1 -1
- package/dist/cascader/cascader.dom.js +2 -2
- package/dist/cascader/cascader.engine.d.ts +51 -24
- package/dist/cascader/cascader.engine.js +69 -6
- package/dist/cascader/cascader.types.d.ts +132 -43
- package/dist/checkbox/Checkbox.svelte +19 -10
- package/dist/checkbox/CheckboxGroup.svelte +14 -6
- package/dist/checkbox/checkbox-group.types.d.ts +7 -4
- package/dist/checkbox/checkbox.component.d.ts +7 -0
- package/dist/checkbox/checkbox.component.js +4 -0
- package/dist/checkbox/checkbox.types.d.ts +15 -13
- package/dist/collapse/Collapse.svelte +43 -11
- package/dist/collapse/CollapseItemView.svelte +5 -4
- package/dist/collapse/CollapsePanel.svelte +35 -3
- package/dist/collapse/CollapsePanel.svelte.d.ts +3 -0
- package/dist/collapse/collapse-context.d.ts +5 -1
- package/dist/collapse/collapse.engine.d.ts +5 -5
- package/dist/collapse/collapse.types.d.ts +20 -14
- package/dist/color-picker/ColorPicker.svelte +171 -110
- package/dist/color-picker/ColorPickerPresets.svelte +9 -4
- package/dist/color-picker/color-picker-alignment.dom.d.ts +17 -0
- package/dist/color-picker/color-picker-alignment.dom.js +144 -0
- package/dist/color-picker/color-picker.types.d.ts +14 -13
- package/dist/component-refs.types.d.ts +45 -0
- package/dist/component-refs.types.js +1 -0
- package/dist/component.types.d.ts +13 -0
- package/dist/component.types.js +1 -0
- package/dist/config-provider/ConfigProvider.svelte +18 -6
- package/dist/config-provider/ConfigProvider.svelte.d.ts +2 -0
- package/dist/config-provider/config-context.d.ts +7 -0
- package/dist/config-provider/config-context.js +1 -0
- package/dist/config-provider/config-provider.component.d.ts +6 -0
- package/dist/config-provider/config-provider.component.js +10 -1
- package/dist/descriptions/Descriptions.svelte +22 -13
- package/dist/descriptions/DescriptionsCell.svelte +19 -19
- package/dist/descriptions/DescriptionsCell.svelte.d.ts +2 -1
- package/dist/descriptions/descriptions-semantic.engine.d.ts +2 -2
- package/dist/descriptions/descriptions-semantic.engine.js +2 -2
- package/dist/descriptions/descriptions.types.d.ts +13 -13
- package/dist/dialog/dialog-container.model.svelte.d.ts +1 -1
- package/dist/dialog/dialog-container.model.svelte.js +14 -2
- package/dist/dialog/dialog-focus.dom.d.ts +3 -1
- package/dist/dialog/dialog-focus.dom.js +8 -7
- package/dist/divider/Divider.svelte +24 -14
- package/dist/divider/divider.types.d.ts +6 -5
- package/dist/drawer/Drawer.svelte +35 -19
- package/dist/drawer/DrawerPanel.svelte +8 -6
- package/dist/drawer/drawer-ancestor-clip.dom.d.ts +15 -0
- package/dist/drawer/drawer-ancestor-clip.dom.js +145 -0
- package/dist/drawer/drawer-clip-plane.dom.d.ts +22 -0
- package/dist/drawer/drawer-clip-plane.dom.js +100 -0
- package/dist/drawer/drawer-clip-shape.dom.d.ts +5 -0
- package/dist/drawer/drawer-clip-shape.dom.js +52 -0
- package/dist/drawer/drawer-clip-style.dom.d.ts +34 -0
- package/dist/drawer/drawer-clip-style.dom.js +190 -0
- package/dist/drawer/drawer-layout.dom.d.ts +6 -0
- package/dist/drawer/drawer-layout.dom.js +240 -0
- package/dist/drawer/drawer-overflow.dom.d.ts +9 -0
- package/dist/drawer/drawer-overflow.dom.js +249 -0
- package/dist/drawer/drawer-overflow.engine.d.ts +54 -0
- package/dist/drawer/drawer-overflow.engine.js +205 -0
- package/dist/drawer/drawer-panel.engine.d.ts +3 -2
- package/dist/drawer/drawer-panel.engine.js +4 -5
- package/dist/drawer/drawer-svg-clip.dom.d.ts +9 -0
- package/dist/drawer/drawer-svg-clip.dom.js +394 -0
- package/dist/drawer/drawer.dom.d.ts +2 -0
- package/dist/drawer/drawer.dom.js +16 -6
- package/dist/drawer/drawer.types.d.ts +22 -21
- package/dist/dropdown/Dropdown.svelte +131 -26
- package/dist/dropdown/dropdown-position.dom.d.ts +3 -1
- package/dist/dropdown/dropdown-position.dom.js +18 -7
- package/dist/dropdown/dropdown.engine.d.ts +10 -7
- package/dist/dropdown/dropdown.engine.js +29 -13
- package/dist/dropdown/dropdown.types.d.ts +7 -6
- package/dist/empty/Empty.svelte +17 -11
- package/dist/empty/empty.types.d.ts +9 -8
- package/dist/flex/Flex.svelte +26 -9
- package/dist/flex/flex.types.d.ts +2 -1
- package/dist/float-button/FloatButton.svelte +24 -13
- package/dist/float-button/FloatButtonBackTop.svelte +6 -6
- package/dist/float-button/FloatButtonGroup.svelte +26 -24
- package/dist/float-button/float-button-context.d.ts +2 -1
- package/dist/float-button/float-button.component.d.ts +9 -0
- package/dist/float-button/float-button.component.js +5 -0
- package/dist/float-button/float-button.types.d.ts +10 -8
- package/dist/form/Form.svelte +241 -42
- package/dist/form/Form.svelte.d.ts +4 -4
- package/dist/form/FormErrorList.svelte +19 -69
- package/dist/form/FormItem.svelte +296 -71
- package/dist/form/FormItem.svelte.d.ts +34 -6
- package/dist/form/FormItemControlBinding.svelte +68 -0
- package/dist/form/FormItemControlBinding.svelte.d.ts +10 -0
- package/dist/form/FormItemMessages.svelte +142 -0
- package/dist/form/FormItemMessages.svelte.d.ts +23 -0
- package/dist/form/FormItemTooltip.svelte +2 -2
- package/dist/form/FormList.svelte +49 -4
- package/dist/form/FormMessageMotion.svelte +133 -0
- package/dist/form/FormMessageMotion.svelte.d.ts +18 -0
- package/dist/form/FormProvider.svelte +9 -0
- package/dist/form/FormProvider.svelte.d.ts +4 -0
- package/dist/form/form-context.d.ts +24 -6
- package/dist/form/form-context.js +18 -0
- package/dist/form/form-control.engine.d.ts +2 -0
- package/dist/form/form-control.engine.js +13 -0
- package/dist/form/form-error-list-state.svelte.d.ts +21 -0
- package/dist/form/form-error-list-state.svelte.js +77 -0
- package/dist/form/form-error-list.engine.js +3 -1
- package/dist/form/form-error-list.types.d.ts +3 -2
- package/dist/form/form-field.dom.js +27 -4
- package/dist/form/form-internal.d.ts +33 -8
- package/dist/form/form-internal.js +2 -0
- package/dist/form/form-item-status.d.ts +2 -1
- package/dist/form/form-item-status.js +3 -1
- package/dist/form/form-list-context.d.ts +4 -0
- package/dist/form/form-list-context.js +3 -0
- package/dist/form/form-list.types.d.ts +5 -2
- package/dist/form/form-no-style.engine.d.ts +6 -5
- package/dist/form/form-provider-context.d.ts +13 -0
- package/dist/form/form-provider-context.js +74 -0
- package/dist/form/form-ref.engine.d.ts +5 -0
- package/dist/form/form-ref.engine.js +43 -0
- package/dist/form/form-store.engine.d.ts +3 -1
- package/dist/form/form-store.engine.js +25 -3
- package/dist/form/form-update.engine.d.ts +29 -0
- package/dist/form/form-update.engine.js +40 -0
- package/dist/form/form-watch.svelte.d.ts +25 -0
- package/dist/form/form-watch.svelte.js +56 -0
- package/dist/form/form.component.d.ts +28 -0
- package/dist/form/form.component.js +25 -0
- package/dist/form/form.model.svelte.d.ts +25 -3
- package/dist/form/form.model.svelte.js +764 -191
- package/dist/form/form.types.d.ts +135 -24
- package/dist/form/validation-message.engine.d.ts +17 -3
- package/dist/form/validation-message.engine.js +39 -2
- package/dist/form/validation-messages.types.d.ts +11 -0
- package/dist/form/validation-nested.engine.d.ts +5 -4
- package/dist/form/validation.engine.d.ts +8 -6
- package/dist/form/validation.engine.js +2 -2
- package/dist/grid/Col.svelte +18 -21
- package/dist/grid/Row.svelte +13 -15
- package/dist/grid/grid.engine.d.ts +4 -1
- package/dist/grid/grid.engine.js +15 -3
- package/dist/grid/grid.svelte.d.ts +7 -0
- package/dist/grid/grid.svelte.js +30 -0
- package/dist/grid/grid.types.d.ts +5 -2
- package/dist/image/Image.svelte +148 -58
- package/dist/image/ImagePreview.svelte +284 -137
- package/dist/image/ImagePreview.svelte.d.ts +11 -2
- package/dist/image/ImagePreviewGroup.svelte +40 -7
- package/dist/image/ImagePreviewIcons.svelte +18 -0
- package/dist/image/ImagePreviewIcons.svelte.d.ts +29 -0
- package/dist/image/ImageProgress.svelte +87 -0
- package/dist/image/ImageProgress.svelte.d.ts +14 -0
- package/dist/image/image-group-context.d.ts +2 -1
- package/dist/image/image-prefix.engine.js +4 -0
- package/dist/image/image-preview-group.types.d.ts +9 -8
- package/dist/image/image-preview-motion.dom.d.ts +16 -0
- package/dist/image/image-preview-motion.dom.js +72 -0
- package/dist/image/image-semantic.engine.d.ts +40 -0
- package/dist/image/image-semantic.engine.js +57 -0
- package/dist/image/image.component.d.ts +7 -0
- package/dist/image/image.component.js +4 -0
- package/dist/image/image.types.d.ts +86 -12
- package/dist/index.d.ts +58 -48
- package/dist/index.js +26 -21
- package/dist/input/Input.svelte +76 -55
- package/dist/input/InputOTP.svelte +14 -9
- package/dist/input/InputPassword.svelte +15 -27
- package/dist/input/InputSearch.svelte +45 -19
- package/dist/input/TextArea.svelte +30 -32
- package/dist/input/input-otp.types.d.ts +12 -9
- package/dist/input/input-password.types.d.ts +6 -6
- package/dist/input/input-search.types.d.ts +8 -8
- package/dist/input/input-value.svelte.d.ts +7 -0
- package/dist/input/input-value.svelte.js +21 -0
- package/dist/input/input.component.d.ts +13 -0
- package/dist/input/input.component.js +12 -0
- package/dist/input/input.types.d.ts +13 -8
- package/dist/input/textarea.types.d.ts +12 -8
- package/dist/input-number/InputNumberAction.svelte +2 -2
- package/dist/input-number/InputNumberControl.svelte +36 -23
- package/dist/input-number/input-number.types.d.ts +16 -16
- package/dist/layout/Layout.svelte +7 -3
- package/dist/layout/LayoutPart.svelte +9 -3
- package/dist/layout/LayoutSider.svelte +27 -17
- package/dist/layout/layout.component.d.ts +13 -0
- package/dist/layout/layout.component.js +7 -0
- package/dist/layout/layout.types.d.ts +6 -5
- package/dist/listy/Listy.svelte +20 -14
- package/dist/listy/ListyGroupHeader.svelte +8 -2
- package/dist/listy/ListyGroupHeader.svelte.d.ts +2 -1
- package/dist/listy/ListyRaw.svelte +7 -9
- package/dist/listy/ListyVirtual.svelte +5 -2
- package/dist/listy/listy.types.d.ts +13 -10
- package/dist/masonry/Masonry.svelte +32 -20
- package/dist/masonry/MasonryItem.svelte +0 -1
- package/dist/masonry/masonry.types.d.ts +8 -7
- package/dist/mentions/Mentions.svelte +44 -9
- package/dist/mentions/MentionsListbox.svelte +2 -1
- package/dist/mentions/mentions.component.d.ts +7 -0
- package/dist/mentions/mentions.component.js +4 -0
- package/dist/mentions/mentions.engine.d.ts +35 -0
- package/dist/mentions/mentions.engine.js +7 -0
- package/dist/mentions/mentions.types.d.ts +12 -8
- package/dist/menu/Menu.svelte +13 -6
- package/dist/menu/MenuItem.svelte +23 -14
- package/dist/menu/MenuItemTooltip.svelte +2 -1
- package/dist/menu/MenuList.svelte +7 -4
- package/dist/menu/MenuSubMenu.svelte +109 -32
- package/dist/menu/menu-motion.engine.js +3 -28
- package/dist/menu/menu-motion.svelte.d.ts +1 -7
- package/dist/menu/menu-motion.svelte.js +1 -33
- package/dist/menu/menu-popup-align.dom.d.ts +1 -1
- package/dist/menu/menu-popup-align.engine.d.ts +2 -2
- package/dist/menu/menu-popup-align.engine.js +1 -4
- package/dist/menu/menu-semantic.engine.d.ts +8 -8
- package/dist/menu/menu-semantic.engine.js +16 -6
- package/dist/menu/menu.engine.d.ts +5 -1
- package/dist/menu/menu.engine.js +15 -0
- package/dist/menu/menu.types.d.ts +25 -22
- package/dist/message/MessageHolder.svelte +9 -6
- package/dist/message/MessageNotice.svelte +12 -9
- package/dist/message/MessageNotice.svelte.d.ts +2 -1
- package/dist/message/message-semantic.engine.d.ts +1 -1
- package/dist/message/message.model.svelte.d.ts +2 -1
- package/dist/message/message.model.svelte.js +2 -1
- package/dist/message/message.types.d.ts +12 -10
- package/dist/modal/Modal.svelte +229 -57
- package/dist/modal/ModalConfirmation.svelte +9 -10
- package/dist/modal/ModalFooterScope.svelte +15 -0
- package/dist/modal/ModalFooterScope.svelte.d.ts +7 -0
- package/dist/modal/modal-close.engine.d.ts +1 -1
- package/dist/modal/modal-layout.engine.d.ts +1 -1
- package/dist/modal/modal-layout.engine.js +20 -3
- package/dist/modal/modal-motion.dom.d.ts +1 -0
- package/dist/modal/modal-motion.dom.js +21 -5
- package/dist/modal/modal-named-motion.dom.d.ts +1 -1
- package/dist/modal/modal-named-motion.dom.js +1 -2
- package/dist/modal/modal-semantic.engine.d.ts +8 -7
- package/dist/modal/modal-semantic.engine.js +2 -2
- package/dist/modal/modal.types.d.ts +27 -18
- package/dist/motion/collapse-motion.engine.d.ts +3 -0
- package/dist/motion/collapse-motion.engine.js +31 -0
- package/dist/motion/css-motion.svelte.d.ts +7 -0
- package/dist/motion/css-motion.svelte.js +35 -0
- package/dist/notice/notice-queue.model.svelte.js +4 -0
- package/dist/notice/notice-semantic.engine.d.ts +10 -7
- package/dist/notice/notice-semantic.engine.js +9 -4
- package/dist/notification/NotificationHolder.svelte +7 -5
- package/dist/notification/NotificationList.svelte +5 -2
- package/dist/notification/NotificationList.svelte.d.ts +2 -1
- package/dist/notification/NotificationNotice.svelte +16 -18
- package/dist/notification/NotificationNotice.svelte.d.ts +2 -1
- package/dist/notification/notification.model.svelte.d.ts +2 -1
- package/dist/notification/notification.types.d.ts +12 -9
- package/dist/pagination/Pagination.svelte +90 -18
- package/dist/pagination/PaginationControl.svelte +2 -0
- package/dist/pagination/pagination.types.d.ts +19 -14
- package/dist/picker/DatePicker.svelte +9 -1
- package/dist/picker/DatePicker.svelte.d.ts +4 -4
- package/dist/picker/DatePickerCalendar.svelte +15 -12
- package/dist/picker/DatePickerCalendar.svelte.d.ts +2 -2
- package/dist/picker/DatePickerTimePanel.svelte +5 -1
- package/dist/picker/DatePickerTimePanel.svelte.d.ts +2 -4
- package/dist/picker/PickerTimeColumn.svelte +27 -12
- package/dist/picker/PickerTimeColumn.svelte.d.ts +3 -0
- package/dist/picker/PickerTimePanel.svelte +16 -0
- package/dist/picker/PickerTimePanel.svelte.d.ts +3 -0
- package/dist/picker/RangePicker.svelte +3 -1
- package/dist/picker/RangePickerCore.svelte +874 -363
- package/dist/picker/RangePickerCore.svelte.d.ts +1 -0
- package/dist/picker/SinglePicker.svelte +684 -309
- package/dist/picker/SinglePicker.svelte.d.ts +1 -0
- package/dist/picker/TimePicker.svelte +3 -1
- package/dist/picker/TimeRangePicker.svelte +2 -0
- package/dist/picker/date-picker-semantic.engine.d.ts +7 -6
- package/dist/picker/date-picker-semantic.engine.js +5 -4
- package/dist/picker/date-picker.types.d.ts +58 -30
- package/dist/picker/picker-adapter-props.engine.d.ts +2 -0
- package/dist/picker/picker-adapter-props.engine.js +4 -0
- package/dist/picker/picker-mask-input.model.svelte.js +9 -5
- package/dist/picker/picker-panel-updates.d.ts +6 -0
- package/dist/picker/picker-panel-updates.js +33 -0
- package/dist/picker/picker-popup-portal.dom.d.ts +49 -0
- package/dist/picker/picker-popup-portal.dom.js +49 -0
- package/dist/picker/picker-popup.dom.d.ts +14 -2
- package/dist/picker/picker-popup.dom.js +153 -40
- package/dist/picker/picker-popup.model.svelte.d.ts +33 -8
- package/dist/picker/picker-popup.model.svelte.js +149 -19
- package/dist/picker/picker-prefix.engine.js +4 -1
- package/dist/picker/picker-style.engine.d.ts +27 -0
- package/dist/picker/picker-style.engine.js +64 -0
- package/dist/picker/picker-time-scroll.model.svelte.d.ts +16 -0
- package/dist/picker/picker-time-scroll.model.svelte.js +31 -0
- package/dist/picker/range-picker-interaction.engine.d.ts +3 -2
- package/dist/picker/range-picker-interaction.engine.js +10 -4
- package/dist/picker/range-picker-popup.dom.d.ts +2 -0
- package/dist/picker/range-picker-popup.dom.js +47 -0
- package/dist/picker/range-picker.types.d.ts +13 -6
- package/dist/picker/time-picker-column.dom.d.ts +6 -1
- package/dist/picker/time-picker-column.dom.js +27 -3
- package/dist/picker/time-picker-props.engine.js +3 -2
- package/dist/picker/time-picker-semantic.engine.d.ts +6 -2
- package/dist/picker/time-picker-semantic.engine.js +32 -18
- package/dist/picker/time-picker.component.d.ts +4 -1
- package/dist/picker/time-picker.component.js +3 -1
- package/dist/picker/time-picker.types.d.ts +28 -24
- package/dist/picker/time-range-picker-semantic.engine.d.ts +2 -0
- package/dist/picker/time-range-picker-semantic.engine.js +6 -8
- package/dist/picker/time-range-picker.types.d.ts +5 -4
- package/dist/popconfirm/Popconfirm.svelte +48 -12
- package/dist/popconfirm/popconfirm.types.d.ts +17 -11
- package/dist/popover/Popover.svelte +65 -42
- package/dist/popover/popover.types.d.ts +19 -12
- package/dist/popup/PopupContentContext.svelte +14 -0
- package/dist/popup/PopupContentContext.svelte.d.ts +7 -0
- package/dist/popup/overlay-motion.css +86 -3
- package/dist/popup/overlay-portal-alignment.dom.d.ts +34 -0
- package/dist/popup/overlay-portal-alignment.dom.js +166 -0
- package/dist/popup/overlay-semantic.engine.d.ts +16 -15
- package/dist/popup/overlay-semantic.engine.js +5 -6
- package/dist/popup/popup-container.model.svelte.d.ts +4 -1
- package/dist/popup/popup-container.model.svelte.js +7 -2
- package/dist/popup/popup-css-motion.dom.d.ts +24 -0
- package/dist/{tree-select/tree-select-motion.dom.js → popup/popup-css-motion.dom.js} +13 -3
- package/dist/popup/popup-css-motion.model.svelte.d.ts +25 -0
- package/dist/popup/popup-css-motion.model.svelte.js +73 -0
- package/dist/popup/popup-geometry.dom.d.ts +16 -0
- package/dist/popup/popup-geometry.dom.js +97 -0
- package/dist/popup/popup-plane.engine.d.ts +6 -0
- package/dist/popup/popup-plane.engine.js +18 -0
- package/dist/popup/popup-portal-fit.dom.d.ts +3 -0
- package/dist/popup/popup-portal-fit.dom.js +81 -0
- package/dist/popup/popup-portal-projection.dom.d.ts +52 -0
- package/dist/popup/popup-portal-projection.dom.js +208 -0
- package/dist/popup/popup-position.engine.d.ts +5 -3
- package/dist/popup/popup.dom.d.ts +7 -1
- package/dist/popup/popup.dom.js +69 -22
- package/dist/popup/select-popup-motion.engine.d.ts +4 -0
- package/dist/popup/select-popup-motion.engine.js +18 -0
- package/dist/progress/Progress.svelte +58 -28
- package/dist/progress/ProgressCircle.svelte +40 -22
- package/dist/progress/ProgressCircle.svelte.d.ts +2 -1
- package/dist/progress/progress-circle.engine.d.ts +1 -1
- package/dist/progress/progress.types.d.ts +6 -5
- package/dist/qr-code/QRCode.svelte +12 -8
- package/dist/qr-code/qrcode.types.d.ts +10 -9
- package/dist/radio/Radio.svelte +19 -10
- package/dist/radio/RadioGroup.svelte +14 -6
- package/dist/radio/radio.component.d.ts +9 -0
- package/dist/radio/radio.component.js +5 -0
- package/dist/radio/radio.types.d.ts +20 -18
- package/dist/rate/Rate.svelte +8 -4
- package/dist/rate/rate.types.d.ts +5 -4
- package/dist/render-content.engine.d.ts +9 -0
- package/dist/render-content.engine.js +21 -0
- package/dist/result/Result.svelte +19 -13
- package/dist/result/result.types.d.ts +11 -10
- package/dist/segmented/Segmented.svelte +28 -15
- package/dist/segmented/segmented.engine.js +2 -1
- package/dist/segmented/segmented.types.d.ts +11 -11
- package/dist/select/Select.svelte +309 -69
- package/dist/select/select-editor-focus.dom.d.ts +14 -0
- package/dist/select/select-editor-focus.dom.js +51 -0
- package/dist/select/select-icons.engine.d.ts +2 -0
- package/dist/select/select-icons.engine.js +17 -8
- package/dist/select/select-mouse-boundary.dom.d.ts +7 -0
- package/dist/select/select-mouse-boundary.dom.js +57 -0
- package/dist/select/select-semantic.engine.d.ts +2 -2
- package/dist/select/select-style.engine.d.ts +2 -2
- package/dist/select/select-style.engine.js +24 -2
- package/dist/select/select-token.engine.d.ts +4 -0
- package/dist/select/select-token.engine.js +13 -0
- package/dist/select/select.types.d.ts +35 -12
- package/dist/skeleton/Skeleton.svelte +25 -15
- package/dist/skeleton/SkeletonElement.svelte +16 -8
- package/dist/skeleton/skeleton.types.d.ts +11 -10
- package/dist/slider/SliderRange.svelte +35 -53
- package/dist/slider/SliderSingle.svelte +58 -73
- package/dist/slider/SliderTooltip.svelte +322 -0
- package/dist/slider/SliderTooltip.svelte.d.ts +18 -0
- package/dist/slider/slider-handle.dom.d.ts +5 -0
- package/dist/slider/slider-handle.dom.js +60 -0
- package/dist/slider/slider-range.engine.d.ts +4 -2
- package/dist/slider/slider-range.engine.js +15 -0
- package/dist/slider/slider-range.types.d.ts +10 -8
- package/dist/slider/slider-semantic.engine.d.ts +1 -1
- package/dist/slider/slider-semantic.engine.js +2 -6
- package/dist/slider/slider.types.d.ts +5 -3
- package/dist/space/Space.svelte +35 -16
- package/dist/space/SpaceAddon.svelte +11 -5
- package/dist/space/SpaceCompact.svelte +7 -2
- package/dist/space/SpaceCompactItem.svelte +4 -1
- package/dist/space/space-compact.types.d.ts +6 -6
- package/dist/space/space.component.d.ts +9 -0
- package/dist/space/space.component.js +5 -0
- package/dist/space/space.engine.d.ts +5 -1
- package/dist/space/space.engine.js +32 -7
- package/dist/space/space.types.d.ts +15 -12
- package/dist/spin/Spin.svelte +25 -14
- package/dist/spin/spin.types.d.ts +5 -3
- package/dist/splitter/Splitter.svelte +15 -14
- package/dist/splitter/SplitterArrow.svelte.d.ts +1 -1
- package/dist/splitter/SplitterBar.svelte +2 -1
- package/dist/splitter/SplitterPanel.svelte +14 -2
- package/dist/splitter/SplitterPanel.svelte.d.ts +2 -1
- package/dist/splitter/SplitterPanelDeclaration.svelte +20 -0
- package/dist/splitter/SplitterPanelDeclaration.svelte.d.ts +4 -0
- package/dist/splitter/SplitterPanelDeclarations.svelte +16 -0
- package/dist/splitter/SplitterPanelDeclarations.svelte.d.ts +10 -0
- package/dist/splitter/SplitterRoot.svelte +18 -0
- package/dist/splitter/SplitterRoot.svelte.d.ts +4 -0
- package/dist/splitter/splitter-panel-context.d.ts +10 -0
- package/dist/splitter/splitter-panel-context.js +11 -0
- package/dist/splitter/splitter.component.d.ts +7 -0
- package/dist/splitter/splitter.component.js +6 -0
- package/dist/splitter/splitter.engine.d.ts +6 -1
- package/dist/splitter/splitter.engine.js +18 -0
- package/dist/splitter/splitter.types.d.ts +13 -10
- package/dist/statistic/Statistic.svelte +25 -12
- package/dist/statistic/statistic.component.d.ts +7 -0
- package/dist/statistic/statistic.component.js +4 -0
- package/dist/statistic/statistic.types.d.ts +6 -4
- package/dist/steps/StepIcon.svelte +4 -2
- package/dist/steps/StepIcon.svelte.d.ts +2 -1
- package/dist/steps/StepItem.svelte +12 -16
- package/dist/steps/Steps.svelte +9 -9
- package/dist/steps/steps-data.engine.d.ts +5 -4
- package/dist/steps/steps-expanded.types.d.ts +2 -1
- package/dist/steps/steps-icon-context.d.ts +2 -1
- package/dist/steps/steps.types.d.ts +4 -3
- package/dist/style/inline-style-layers.engine.d.ts +11 -0
- package/dist/style/inline-style-layers.engine.js +120 -0
- package/dist/style/inline-style.engine.d.ts +4 -0
- package/dist/style/inline-style.engine.js +17 -9
- package/dist/style/inline-style.types.d.ts +12 -0
- package/dist/style/inline-style.types.js +1 -0
- package/dist/style/semantic-style.engine.d.ts +18 -12
- package/dist/style/semantic-style.engine.js +15 -9
- package/dist/styles.css +1 -0
- package/dist/styles.css.d.ts +1 -0
- package/dist/switch/Switch.svelte +17 -9
- package/dist/switch/switch.types.d.ts +14 -12
- package/dist/table/Table.svelte +30 -21
- package/dist/table/Table.svelte.d.ts +4 -2
- package/dist/table/TableColumn.svelte +20 -0
- package/dist/table/TableColumn.svelte.d.ts +25 -0
- package/dist/table/TableColumnDeclarations.svelte +18 -0
- package/dist/table/TableColumnDeclarations.svelte.d.ts +10 -0
- package/dist/table/TableColumnGroup.svelte +31 -0
- package/dist/table/TableColumnGroup.svelte.d.ts +25 -0
- package/dist/table/TableRoot.svelte +55 -0
- package/dist/table/TableRoot.svelte.d.ts +29 -0
- package/dist/table/table-cell.engine.d.ts +14 -14
- package/dist/table/table-column-declarations.svelte.d.ts +22 -0
- package/dist/table/table-column-declarations.svelte.js +45 -0
- package/dist/table/table-semantic.engine.d.ts +18 -6
- package/dist/table/table-semantic.engine.js +14 -14
- package/dist/table/table.component.d.ts +10 -2
- package/dist/table/table.component.js +4 -1
- package/dist/table/table.types.d.ts +55 -25
- package/dist/tabs/Tabs.svelte +35 -18
- package/dist/tabs/TabsNav.svelte +33 -18
- package/dist/tabs/TabsNav.svelte.d.ts +2 -1
- package/dist/tabs/TabsOverflow.svelte +98 -122
- package/dist/tabs/TabsOverflow.svelte.d.ts +2 -1
- package/dist/tabs/TabsPanel.svelte +10 -5
- package/dist/tabs/TabsPanel.svelte.d.ts +4 -3
- package/dist/tabs/tabs-more-alignment.dom.d.ts +32 -0
- package/dist/tabs/tabs-more-alignment.dom.js +158 -0
- package/dist/tabs/tabs-more.dom.d.ts +69 -13
- package/dist/tabs/tabs-more.dom.js +76 -65
- package/dist/tabs/tabs-motion.dom.d.ts +2 -1
- package/dist/tabs/tabs-motion.dom.js +2 -1
- package/dist/tabs/tabs-motion.types.d.ts +4 -3
- package/dist/tabs/tabs-nav.types.d.ts +6 -7
- package/dist/tabs/tabs-semantic.engine.d.ts +18 -12
- package/dist/tabs/tabs-semantic.engine.js +70 -19
- package/dist/tabs/tabs.types.d.ts +35 -29
- package/dist/tag/CheckableTag.svelte +8 -4
- package/dist/tag/CheckableTagGroup.svelte +42 -32
- package/dist/tag/CheckableTagGroup.svelte.d.ts +12 -12
- package/dist/tag/Tag.svelte +14 -20
- package/dist/tag/tag-style.dom.d.ts +3 -1
- package/dist/tag/tag-style.dom.js +19 -1
- package/dist/tag/tag.component.d.ts +10 -0
- package/dist/tag/tag.component.js +5 -0
- package/dist/tag/tag.types.d.ts +30 -27
- package/dist/theme/theme-context.svelte.d.ts +2 -0
- package/dist/theme/theme-context.svelte.js +6 -1
- package/dist/timeline/Timeline.svelte +13 -5
- package/dist/timeline/timeline.engine.js +3 -1
- package/dist/timeline/timeline.types.d.ts +7 -6
- package/dist/tooltip/Tooltip.svelte +18 -10
- package/dist/tooltip/TooltipPopup.svelte +44 -22
- package/dist/tooltip/TooltipUniqueContent.svelte +3 -6
- package/dist/tooltip/TooltipUniqueContent.svelte.d.ts +0 -1
- package/dist/tooltip/TooltipUniquePopup.svelte +1 -1
- package/dist/tooltip/tooltip-popup.types.d.ts +6 -0
- package/dist/tooltip/tooltip.engine.d.ts +58 -2
- package/dist/tooltip/tooltip.engine.js +54 -27
- package/dist/tooltip/tooltip.types.d.ts +38 -13
- package/dist/tour/Tour.svelte +37 -14
- package/dist/tour/TourPanel.svelte +13 -12
- package/dist/tour/TourPanel.svelte.d.ts +2 -1
- package/dist/tour/tour.engine.d.ts +7 -2
- package/dist/tour/tour.engine.js +58 -11
- package/dist/tour/tour.types.d.ts +20 -19
- package/dist/transfer/Transfer.svelte +44 -36
- package/dist/transfer/TransferAction.svelte +6 -7
- package/dist/transfer/TransferAction.svelte.d.ts +3 -2
- package/dist/transfer/TransferCheckbox.svelte +9 -3
- package/dist/transfer/TransferCheckbox.svelte.d.ts +2 -1
- package/dist/transfer/TransferList.svelte +18 -0
- package/dist/transfer/TransferList.svelte.d.ts +45 -0
- package/dist/transfer/TransferOperation.svelte +43 -0
- package/dist/transfer/TransferOperation.svelte.d.ts +4 -0
- package/dist/transfer/TransferPagination.svelte +3 -1
- package/dist/transfer/TransferSearch.svelte +44 -0
- package/dist/transfer/TransferSearch.svelte.d.ts +4 -0
- package/dist/transfer/TransferSection.svelte +42 -30
- package/dist/transfer/TransferSection.svelte.d.ts +2 -4
- package/dist/transfer/transfer-style.engine.d.ts +7 -0
- package/dist/transfer/transfer-style.engine.js +33 -0
- package/dist/transfer/transfer.component.d.ts +12 -0
- package/dist/transfer/transfer.component.js +6 -0
- package/dist/transfer/transfer.types.d.ts +44 -4
- package/dist/tree/Tree.svelte +8 -5
- package/dist/tree/TreeMotion.svelte +5 -1
- package/dist/tree/tree-motion.dom.js +12 -3
- package/dist/tree/tree-motion.types.d.ts +4 -3
- package/dist/tree/tree-semantic.engine.d.ts +9 -2
- package/dist/tree/tree-semantic.engine.js +37 -3
- package/dist/tree/tree.component.d.ts +10 -0
- package/dist/tree/tree.component.js +5 -0
- package/dist/tree/tree.types.d.ts +8 -6
- package/dist/tree-select/TreeSelectControl.svelte +127 -89
- package/dist/tree-select/tree-select-align.engine.d.ts +2 -6
- package/dist/tree-select/tree-select-align.engine.js +1 -18
- package/dist/tree-select/tree-select-motion-frame.dom.d.ts +2 -5
- package/dist/tree-select/tree-select-semantic.engine.d.ts +6 -6
- package/dist/tree-select/tree-select-semantic.engine.js +50 -25
- package/dist/tree-select/tree-select-token.engine.d.ts +1 -3
- package/dist/tree-select/tree-select-token.engine.js +1 -13
- package/dist/tree-select/tree-select.types.d.ts +9 -5
- package/dist/types.d.ts +5 -2
- package/dist/typography/TypographyEditable.svelte +11 -5
- package/dist/typography/TypographyEditable.svelte.d.ts +3 -2
- package/dist/typography/TypographyElement.svelte +13 -7
- package/dist/typography/TypographyElement.svelte.d.ts +3 -2
- package/dist/typography/TypographyTooltip.svelte +19 -8
- package/dist/typography/typography-semantic.engine.d.ts +9 -2
- package/dist/typography/typography-semantic.engine.js +15 -4
- package/dist/typography/typography.component.d.ts +13 -0
- package/dist/typography/typography.component.js +7 -0
- package/dist/typography/typography.types.d.ts +8 -7
- package/dist/upload/Upload.svelte +44 -4
- package/dist/upload/Upload.svelte.d.ts +1 -1
- package/dist/upload/UploadDragger.svelte +3 -2
- package/dist/upload/UploadDragger.svelte.d.ts +4 -4
- package/dist/upload/UploadList.svelte.d.ts +1 -1
- package/dist/upload/UploadListItem.svelte +52 -11
- package/dist/upload/upload.component.d.ts +9 -0
- package/dist/upload/upload.component.js +5 -0
- package/dist/upload/upload.engine.d.ts +8 -2
- package/dist/upload/upload.engine.js +80 -4
- package/dist/upload/upload.types.d.ts +2 -1
- package/dist/utils/declaration-order.svelte.d.ts +12 -0
- package/dist/utils/declaration-order.svelte.js +53 -0
- package/dist/vendor/compute-scroll-into-view.d.ts +3 -1
- package/dist/vendor/compute-scroll-into-view.js +3 -2
- package/dist/vendor/date-picker-prefix.css.js +2 -2
- package/dist/vendor/dropdown-motion.css +105 -0
- package/dist/vendor/image-prefix.css.js +3 -3
- package/dist/vendor/image.css +16 -2
- package/dist/vendor/tree-select-popup-motion.css +112 -112
- package/dist/vendor/tree-select-popup-motion.css.js +2 -2
- package/dist/version.d.ts +2 -0
- package/dist/version.js +3 -0
- package/dist/watermark/Watermark.svelte +8 -6
- package/dist/watermark/watermark.types.d.ts +3 -2
- package/package.json +15 -4
- package/readme.md +2 -2
- package/dist/picker/time-range-picker-popup.dom.d.ts +0 -2
- package/dist/picker/time-range-picker-popup.dom.js +0 -42
- package/dist/tree-select/tree-select-motion-css.engine.d.ts +0 -2
- package/dist/tree-select/tree-select-motion-css.engine.js +0 -11
- package/dist/tree-select/tree-select-motion.dom.d.ts +0 -18
- package/dist/tree-select/tree-select-motion.engine.d.ts +0 -2
- package/dist/tree-select/tree-select-motion.engine.js +0 -5
|
@@ -12,17 +12,19 @@
|
|
|
12
12
|
import { connectPopup, getPopupActiveElement, type PopupConnection } from '../popup/popup.dom';
|
|
13
13
|
import { getPopupArrowStyle, getPopupPlacements } from '../popup/popup-position.engine';
|
|
14
14
|
import { createDropdownPosition, dropdownFitVariables } from './dropdown-position.dom';
|
|
15
|
+
import { createPopupPortalFit } from '../popup/popup-portal-fit.dom';
|
|
15
16
|
import { createPopupContainer } from '../popup/popup-container.model.svelte.js';
|
|
16
17
|
import { connectPopoverTrigger, focusPopover } from '../popover/popover.dom';
|
|
17
18
|
import { connectTooltipOpenClass } from '../tooltip/tooltip.dom';
|
|
18
19
|
import { useComponentTheme } from '../theme/theme-component.svelte';
|
|
19
20
|
import { connectInlineStyle } from '../style/inline-style.dom';
|
|
20
|
-
import { serializeInlineStyleLayers } from '../style/inline-style.engine';
|
|
21
|
+
import { serializeInlineStyleLayers, type InlineStyleLayer } from '../style/inline-style.engine';
|
|
21
22
|
import { getInlineZIndex, provideZIndex, useZIndex } from '../popup/z-index-context.svelte';
|
|
22
|
-
import { useDesignTokenContext } from '../theme/theme-context.svelte';
|
|
23
|
+
import { useDesignTokenContext, useRuntimeStyles } from '../theme/theme-context.svelte';
|
|
23
24
|
import { getTooltipDelay, type TooltipPosition } from '../tooltip/tooltip.engine';
|
|
24
25
|
import {
|
|
25
|
-
dropdownSemantics, getDropdownMatch, getDropdownMotionName,
|
|
26
|
+
dropdownSemantics, getDropdownMatch, getDropdownMotionName, getDropdownSlideDirection,
|
|
27
|
+
isDropdownMenuKey
|
|
26
28
|
} from './dropdown.engine';
|
|
27
29
|
import type { DropdownMenuContext, DropdownMenuView } from './dropdown-menu-context';
|
|
28
30
|
import { useMenuMotion } from '../menu/menu-motion.svelte';
|
|
@@ -70,7 +72,10 @@
|
|
|
70
72
|
let componentPrefix = $derived(config.getPrefixCls('dropdown', customizePrefixCls));
|
|
71
73
|
let rootPrefix = $derived(config.getPrefixCls());
|
|
72
74
|
const menuPrefix = $derived(menu?.prefixCls || `${componentPrefix}-menu`);
|
|
73
|
-
|
|
75
|
+
const runtimeStyles = useRuntimeStyles();
|
|
76
|
+
let prefixCss = $derived(
|
|
77
|
+
runtimeStyles && getDropdownPrefixCss(componentPrefix, rootPrefix, menuPrefix)
|
|
78
|
+
);
|
|
74
79
|
const requestedPlacement = $derived(
|
|
75
80
|
placement ?? (config.direction === 'rtl' ? 'bottomRight' : 'bottomLeft')
|
|
76
81
|
);
|
|
@@ -141,7 +146,7 @@
|
|
|
141
146
|
const retain = $derived(Boolean(forceRender || visited && !destroyOnHidden));
|
|
142
147
|
const renderRequested = $derived(visible || retain);
|
|
143
148
|
const motionName = $derived(transitionName ?? getDropdownMotionName(rootPrefix, requestedPlacement));
|
|
144
|
-
const motionCss = $derived(getDropdownMotionCss(componentPrefix, rootPrefix));
|
|
149
|
+
const motionCss = $derived(runtimeStyles && getDropdownMotionCss(componentPrefix, rootPrefix));
|
|
145
150
|
const popupMotion = useMenuMotion(() => host, () => popup, () => ({
|
|
146
151
|
motion: {
|
|
147
152
|
motionName,
|
|
@@ -179,6 +184,17 @@
|
|
|
179
184
|
? 'left' as const
|
|
180
185
|
: requestedPlacement.endsWith('Right') ? 'right' as const : undefined
|
|
181
186
|
);
|
|
187
|
+
const sourcePlacements = $derived.by(() => {
|
|
188
|
+
const token = designTokens.state.token;
|
|
189
|
+
const pointAtCenter = typeof arrow === 'object' && arrow.pointAtCenter === true;
|
|
190
|
+
return getPopupPlacements(
|
|
191
|
+
pointAtCenter,
|
|
192
|
+
arrow ? token.sizePopupArrow : 0,
|
|
193
|
+
token.marginXXS,
|
|
194
|
+
token.borderRadius,
|
|
195
|
+
autoAdjustOverflow
|
|
196
|
+
);
|
|
197
|
+
});
|
|
182
198
|
const builtinPlacements = $derived.by(() => {
|
|
183
199
|
const lateral = requestedPlacement.startsWith('left') || requestedPlacement.startsWith('right');
|
|
184
200
|
if (!alignPoint && !lateral && !align && typeof arrow !== 'object'
|
|
@@ -186,19 +202,39 @@
|
|
|
186
202
|
return undefined;
|
|
187
203
|
}
|
|
188
204
|
|
|
189
|
-
|
|
190
|
-
const pointAtCenter = typeof arrow === 'object' && arrow.pointAtCenter === true;
|
|
191
|
-
return getPopupPlacements(pointAtCenter, arrow ? token.sizePopupArrow : 0, token.marginXXS,
|
|
192
|
-
token.borderRadius, autoAdjustOverflow);
|
|
205
|
+
return sourcePlacements;
|
|
193
206
|
});
|
|
207
|
+
let portalAligned = $state(false);
|
|
208
|
+
const sourceAligned = $derived(Boolean(builtinPlacements) || portalAligned);
|
|
194
209
|
const legacySuffix = $derived(legacyAlignment === 'left' ? 'Left'
|
|
195
210
|
: legacyAlignment === 'right' ? 'Right' : '');
|
|
196
211
|
const actualPlacement = $derived.by(() => {
|
|
197
212
|
if (!shown) return requestedPlacement;
|
|
198
213
|
|
|
199
|
-
return
|
|
214
|
+
return sourceAligned ? alignedPlacement : `${actualSide}${legacySuffix}`;
|
|
215
|
+
});
|
|
216
|
+
const portalMotion = $derived.by((): InlineStyleLayer => {
|
|
217
|
+
const { phase, step } = popupMotion.state;
|
|
218
|
+
if (!phase || step !== 'active' || transitionName !== undefined) return;
|
|
219
|
+
|
|
220
|
+
const requested = getDropdownSlideDirection(requestedPlacement);
|
|
221
|
+
const actual = actualPlacement ? getDropdownSlideDirection(actualPlacement) : requested;
|
|
222
|
+
const horizontal = isHorizontalSlide(requested);
|
|
223
|
+
// Source reverses the slide when a placement flips along its selected axis.
|
|
224
|
+
const motion = horizontal === isHorizontalSlide(actual) ? actual : requested;
|
|
225
|
+
const direction = phase === 'leave' ? 'out' : 'in';
|
|
226
|
+
return [
|
|
227
|
+
['animation-name', `ant-overlay-slide-${horizontal ? 'x' : 'y'}-${direction}`],
|
|
228
|
+
['--ant-overlay-motion-origin-x', motion === 'right' || motion === 'down'
|
|
229
|
+
? '100%' : '0px'],
|
|
230
|
+
['--ant-overlay-motion-origin-y', motion === 'down' ? '100%' : '0px']
|
|
231
|
+
];
|
|
200
232
|
});
|
|
201
233
|
|
|
234
|
+
function isHorizontalSlide(motion: ReturnType<typeof getDropdownSlideDirection>) {
|
|
235
|
+
return motion === 'left' || motion === 'right';
|
|
236
|
+
}
|
|
237
|
+
|
|
202
238
|
onMount(() => { mounted = true; });
|
|
203
239
|
|
|
204
240
|
$effect.pre(() => {
|
|
@@ -314,9 +350,18 @@
|
|
|
314
350
|
return;
|
|
315
351
|
}
|
|
316
352
|
|
|
353
|
+
return untrack(() => connectPosition(surface, source));
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
// Owns the ordinary fit-content insets and the portal projection for this surface.
|
|
357
|
+
function connectPosition(surface: HTMLDivElement, source: Element) {
|
|
358
|
+
const view = surface.ownerDocument.defaultView;
|
|
359
|
+
if (!view) return;
|
|
360
|
+
|
|
361
|
+
let projection: InlineStyleLayer;
|
|
317
362
|
const position = createDropdownPosition(surface, () => Boolean(builtinPlacements),
|
|
318
363
|
() => Boolean(getPopupContainer || config.getPopupContainer));
|
|
319
|
-
const disconnect =
|
|
364
|
+
const disconnect = connectPopup(surface, source, {
|
|
320
365
|
trigger: host,
|
|
321
366
|
get placement() { return builtinPlacements ? requestedPlacement : legacySide; },
|
|
322
367
|
get align() { return builtinPlacements ? undefined : legacyAlignment; },
|
|
@@ -337,8 +382,21 @@
|
|
|
337
382
|
getAnchorRect(rect) {
|
|
338
383
|
return alignPoint && pointer ? new DOMRect(pointer.x, pointer.y) : rect;
|
|
339
384
|
},
|
|
340
|
-
measurePopup: position.measure,
|
|
341
|
-
|
|
385
|
+
measurePopup: () => projection ? surface.getBoundingClientRect() : position.measure(),
|
|
386
|
+
applyPosition,
|
|
387
|
+
portalAlignment: {
|
|
388
|
+
getTarget: portal.getTarget,
|
|
389
|
+
getAuthoredStyle: () => popupStyle,
|
|
390
|
+
getAlignment: () => designTokens.enabled || builtinPlacements
|
|
391
|
+
? { placement: requestedPlacement, placements: sourcePlacements, align: align ?? {} }
|
|
392
|
+
: undefined,
|
|
393
|
+
fitPopup: createPopupPortalFit(surface, view, probe => {
|
|
394
|
+
const width = surface.style.getPropertyValue('--ant-dropdown-anchor-width');
|
|
395
|
+
probe.style.setProperty('--ant-dropdown-layout-width', 'auto');
|
|
396
|
+
probe.style.setProperty('--ant-dropdown-anchor-width', width);
|
|
397
|
+
}),
|
|
398
|
+
canProject: () => !transitionName || !designTokens.state.token.motion || reducedMotion
|
|
399
|
+
},
|
|
342
400
|
preserveFocus: false,
|
|
343
401
|
isRelatedTarget: ownsNestedTarget,
|
|
344
402
|
onPlacement: (_, current) => updatePlacement(current),
|
|
@@ -352,18 +410,39 @@
|
|
|
352
410
|
hoveredSurfaces.clear();
|
|
353
411
|
}
|
|
354
412
|
}
|
|
355
|
-
})
|
|
413
|
+
});
|
|
356
414
|
popupConnection = disconnect;
|
|
357
415
|
|
|
358
|
-
return
|
|
416
|
+
return disconnectPosition;
|
|
417
|
+
|
|
418
|
+
function applyPosition(current: TooltipPosition, next?: InlineStyleLayer) {
|
|
419
|
+
const wasProjected = Boolean(projection);
|
|
420
|
+
projection = next;
|
|
421
|
+
if (next) position.reset();
|
|
422
|
+
if (popupPaint?.node === surface) popupPaint.project(next);
|
|
423
|
+
if (next) {
|
|
424
|
+
position.applyArrow(current);
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
if (builtinPlacements || current.sourceAlign) {
|
|
429
|
+
if (wasProjected || !builtinPlacements) position.measure(true);
|
|
430
|
+
position.apply(current);
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
position.applyViewport(current);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
function disconnectPosition() {
|
|
359
438
|
resumeFocus = visible && Boolean(focusedInPopup());
|
|
360
439
|
closing = true;
|
|
361
440
|
disconnect();
|
|
362
441
|
position.reset();
|
|
363
442
|
if (popupConnection === disconnect) popupConnection = undefined;
|
|
364
443
|
closing = false;
|
|
365
|
-
}
|
|
366
|
-
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
367
446
|
|
|
368
447
|
$effect(() => {
|
|
369
448
|
const source = anchor;
|
|
@@ -394,7 +473,8 @@
|
|
|
394
473
|
}
|
|
395
474
|
|
|
396
475
|
function updatePlacement(position: TooltipPosition) {
|
|
397
|
-
|
|
476
|
+
portalAligned = Boolean(position.sourceAlign);
|
|
477
|
+
if (builtinPlacements || portalAligned) {
|
|
398
478
|
alignedPlacement = position.alignedPlacement;
|
|
399
479
|
arrowStyle = getPopupArrowStyle({
|
|
400
480
|
align: position.sourceAlign, arrowX: position.arrowX, arrowY: position.arrowY
|
|
@@ -814,9 +894,33 @@
|
|
|
814
894
|
};
|
|
815
895
|
}
|
|
816
896
|
|
|
897
|
+
let popupPaint: {
|
|
898
|
+
node: HTMLDivElement;
|
|
899
|
+
project: (styles: InlineStyleLayer) => void;
|
|
900
|
+
} | undefined;
|
|
901
|
+
|
|
817
902
|
function connectPopupStyle(surface: HTMLDivElement) {
|
|
818
|
-
const update = connectInlineStyle(surface);
|
|
819
|
-
|
|
903
|
+
const update = connectInlineStyle(surface, true);
|
|
904
|
+
let projection: InlineStyleLayer;
|
|
905
|
+
const connection = { node: surface, project };
|
|
906
|
+
|
|
907
|
+
function project(styles: InlineStyleLayer) {
|
|
908
|
+
if (projection || styles) {
|
|
909
|
+
projection = styles;
|
|
910
|
+
paint();
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
function paint() {
|
|
915
|
+
const motion = portalMotion;
|
|
916
|
+
update([...popupStyleLayers, projection, projection ? motion : undefined]);
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
popupPaint = connection;
|
|
920
|
+
$effect(paint);
|
|
921
|
+
return () => {
|
|
922
|
+
if (popupPaint === connection) popupPaint = undefined;
|
|
923
|
+
};
|
|
820
924
|
}
|
|
821
925
|
|
|
822
926
|
// The external portal extends focus and hover across the whole panel. Events from nested DOM bubble normally.
|
|
@@ -874,18 +978,18 @@
|
|
|
874
978
|
vertical-align: middle;
|
|
875
979
|
}
|
|
876
980
|
[data-ant-dropdown-popup] {
|
|
877
|
-
position: fixed;
|
|
981
|
+
position: var(--ant-overlay-position, fixed);
|
|
878
982
|
inset: auto;
|
|
879
983
|
margin: 0;
|
|
880
984
|
padding: 0;
|
|
881
985
|
border: 0;
|
|
882
986
|
background: transparent;
|
|
883
|
-
width: max-content;
|
|
987
|
+
width: var(--ant-dropdown-layout-width, max-content);
|
|
884
988
|
min-width: var(--ant-dropdown-anchor-width, 0px);
|
|
885
989
|
overflow: visible;
|
|
886
990
|
}
|
|
887
991
|
[data-ant-dropdown-popup][data-ant-dropdown-source-align] {
|
|
888
|
-
width: fit-content;
|
|
992
|
+
width: var(--ant-dropdown-layout-width, fit-content);
|
|
889
993
|
right: var(--ant-dropdown-fit-right, auto);
|
|
890
994
|
bottom: var(--ant-dropdown-fit-bottom, auto);
|
|
891
995
|
justify-self: var(--ant-dropdown-fit-justify, unsafe left);
|
|
@@ -917,12 +1021,13 @@
|
|
|
917
1021
|
{/snippet}
|
|
918
1022
|
|
|
919
1023
|
{#if prefixCss}<ThemeScopeStyle css={prefixCss}
|
|
920
|
-
scope={`dropdown-prefix:${componentPrefix}:${rootPrefix}${menu?.prefixCls ? `:${menuPrefix}` : ''}`} />{/if}{#if mounted}<ThemeScopeStyle css={motionCss}
|
|
1024
|
+
scope={`dropdown-prefix:${componentPrefix}:${rootPrefix}${menu?.prefixCls ? `:${menuPrefix}` : ''}`} />{/if}{#if mounted && motionCss}<ThemeScopeStyle css={motionCss}
|
|
921
1025
|
scope={`dropdown-motion:${componentPrefix}:${rootPrefix}`} />{/if}<span data-ant-dropdown-trigger data-ant-dropdown-prefix={componentPrefix} data-ant-dropdown-root-prefix={rootPrefix} data-ant-dropdown-menu-prefix={menuPrefix} bind:this={host} id={triggerId} role="presentation" class={[`${componentPrefix}-trigger`, className]} {style} onpointerenter={handleEnter} onpointerleave={handleLeave} ontouchstart={handleTouchStart} onclick={handleClick} oncontextmenucapture={handleContextMenu} onkeydown={handleTriggerKeydown}>{@render children()}</span>
|
|
922
1026
|
<NoCompactStyle>{#if rendered}
|
|
923
1027
|
<div data-ant-dropdown-popup data-ant-dropdown-prefix={componentPrefix} data-ant-dropdown-root-prefix={rootPrefix} data-ant-dropdown-menu-prefix={menuPrefix} data-ant-dropdown-source-theme={componentTheme.className ? true : undefined}
|
|
924
|
-
data-ant-dropdown-source-align={
|
|
925
|
-
data-ant-dropdown-motion data-ant-dropdown-
|
|
1028
|
+
data-ant-dropdown-source-align={sourceAligned || undefined}
|
|
1029
|
+
data-ant-dropdown-motion data-ant-dropdown-static-motion={!runtimeStyles || undefined}
|
|
1030
|
+
data-ant-dropdown-placement={actualPlacement}
|
|
926
1031
|
bind:this={popup} id={popupId} popover="manual" role={customContent ? 'dialog' : 'presentation'}
|
|
927
1032
|
tabindex="-1" aria-label={customContent ? ariaLabel : undefined}
|
|
928
1033
|
aria-labelledby={customContent ? ariaLabelledby ?? (ariaLabel ? undefined : triggerId) : undefined}
|
|
@@ -3,6 +3,8 @@ export declare const dropdownFitVariables: string[];
|
|
|
3
3
|
/** Applies a single position and restores the former geometry when removing the align. */
|
|
4
4
|
export declare function createDropdownPosition(surface: HTMLElement, useSourcePlacement: () => boolean, hasCustomContainer: () => boolean): {
|
|
5
5
|
apply: (position: TooltipPosition) => void;
|
|
6
|
-
|
|
6
|
+
applyArrow: (position: TooltipPosition) => void;
|
|
7
|
+
applyViewport: (position: TooltipPosition) => void;
|
|
8
|
+
measure: (sourcePlacement?: boolean) => DOMRect;
|
|
7
9
|
reset: () => void;
|
|
8
10
|
};
|
|
@@ -2,7 +2,7 @@ const rightInset = '--ant-dropdown-fit-right';
|
|
|
2
2
|
const bottomInset = '--ant-dropdown-fit-bottom';
|
|
3
3
|
const inlineAlignment = '--ant-dropdown-fit-justify';
|
|
4
4
|
export const dropdownFitVariables = [rightInset, bottomInset, inlineAlignment];
|
|
5
|
-
/** Finds
|
|
5
|
+
/** Finds the horizontal space available to the unprojected surface. */
|
|
6
6
|
function getInlineRegion(surface, customContainer) {
|
|
7
7
|
const document = surface.ownerDocument;
|
|
8
8
|
const viewport = document.documentElement;
|
|
@@ -21,7 +21,7 @@ function getInlineRegion(surface, customContainer) {
|
|
|
21
21
|
const left = -viewport.scrollLeft;
|
|
22
22
|
return { left, right: left + viewport.clientWidth };
|
|
23
23
|
}
|
|
24
|
-
/**
|
|
24
|
+
/** Detects CSS positioning and containment that create an absolute containing block. */
|
|
25
25
|
function establishesContainingBlock(view, node) {
|
|
26
26
|
const style = view.getComputedStyle(node);
|
|
27
27
|
const effects = [style.transform, style.translate, style.rotate, style.scale,
|
|
@@ -53,8 +53,8 @@ export function createDropdownPosition(surface, useSourcePlacement, hasCustomCon
|
|
|
53
53
|
available = 0;
|
|
54
54
|
}
|
|
55
55
|
// With a sufficient location in both positions, the re-measure does not change anything.
|
|
56
|
-
function measure() {
|
|
57
|
-
if (!
|
|
56
|
+
function measure(sourcePlacement = useSourcePlacement()) {
|
|
57
|
+
if (!sourcePlacement) {
|
|
58
58
|
reset();
|
|
59
59
|
bounds = surface.getBoundingClientRect();
|
|
60
60
|
return bounds;
|
|
@@ -69,6 +69,18 @@ export function createDropdownPosition(surface, useSourcePlacement, hasCustomCon
|
|
|
69
69
|
bounds = surface.getBoundingClientRect();
|
|
70
70
|
return bounds;
|
|
71
71
|
}
|
|
72
|
+
/** Writes ordinary viewport coordinates after releasing the fit-content insets. */
|
|
73
|
+
function applyViewport(position) {
|
|
74
|
+
reset();
|
|
75
|
+
write('left', `${position.left}px`);
|
|
76
|
+
write('top', `${position.top}px`);
|
|
77
|
+
applyArrow(position);
|
|
78
|
+
}
|
|
79
|
+
/** Updates the CSS arrow offsets in viewport or projected placement. */
|
|
80
|
+
function applyArrow(position) {
|
|
81
|
+
write('--arrow-x', `${position.arrowX}px`);
|
|
82
|
+
write('--arrow-y', `${position.arrowY}px`);
|
|
83
|
+
}
|
|
72
84
|
// Dynamic inset holds the right or bottom edge when transferring text to the menu.
|
|
73
85
|
function apply(position) {
|
|
74
86
|
if (!region)
|
|
@@ -87,8 +99,7 @@ export function createDropdownPosition(surface, useSourcePlacement, hasCustomCon
|
|
|
87
99
|
write(inlineAlignment, fromRight ? 'unsafe right' : 'unsafe left');
|
|
88
100
|
write(bottomInset, bottom);
|
|
89
101
|
write('top', fromBottom ? 'auto' : `${position.top}px`);
|
|
90
|
-
|
|
91
|
-
write('--arrow-y', `${position.arrowY}px`);
|
|
102
|
+
applyArrow(position);
|
|
92
103
|
}
|
|
93
|
-
return { apply, measure, reset };
|
|
104
|
+
return { apply, applyArrow, applyViewport, measure, reset };
|
|
94
105
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { DropdownConfig, DropdownMenuClickInfo, DropdownMenuEntry, DropdownPlacement, DropdownProps } from './dropdown.types';
|
|
2
|
+
import type { CSSStyle } from '../style/inline-style.types';
|
|
2
3
|
import type { MenuClickInfo, MenuItem, MenuItemType } from '../menu/menu.types';
|
|
3
4
|
export declare function normalizeDropdownItems<T extends DropdownMenuEntry>(items: readonly T[]): T[];
|
|
4
5
|
/** Dropdown commands are activated via click even when working with a keyboard. */
|
|
5
6
|
export declare function isDropdownClick(info: MenuClickInfo): info is DropdownMenuClickInfo;
|
|
6
7
|
/** Leaves system keyboard shortcuts and IME to the current focus holder. */
|
|
7
8
|
export declare function isDropdownMenuKey(event: KeyboardEvent): boolean;
|
|
8
|
-
/**
|
|
9
|
+
/** Names the phase before CSS accounts for the actual placement. */
|
|
9
10
|
export declare function getDropdownMotionName(prefix: string, placement: DropdownPlacement): string;
|
|
11
|
+
/** Chooses the slide direction that starts at the edge next to the trigger. */
|
|
12
|
+
export declare function getDropdownSlideDirection(placement: string): "right" | "left" | "down" | "up";
|
|
10
13
|
/** Prepares Menu parameters, saving the keys and the initial data of the items. */
|
|
11
14
|
export declare function toDropdownMenuItems(items: readonly DropdownMenuEntry[]): MenuItemType[];
|
|
12
15
|
/** The native attributes of the commands belong to Dropdown and pass through Menu data. */
|
|
@@ -33,12 +36,12 @@ export declare function dropdownSemantics(config: DropdownConfig | undefined, pr
|
|
|
33
36
|
itemIcon?: string | undefined;
|
|
34
37
|
};
|
|
35
38
|
styles: {
|
|
36
|
-
subMenu: Partial<Record<"item" | "root" | "itemContent" | "itemTitle" | "itemIcon",
|
|
37
|
-
item?:
|
|
38
|
-
root?:
|
|
39
|
-
itemContent?:
|
|
40
|
-
itemTitle?:
|
|
41
|
-
itemIcon?:
|
|
39
|
+
subMenu: Partial<Record<"item" | "root" | "itemContent" | "itemTitle" | "itemIcon", CSSStyle>>;
|
|
40
|
+
item?: CSSStyle | undefined;
|
|
41
|
+
root?: CSSStyle | undefined;
|
|
42
|
+
itemContent?: CSSStyle | undefined;
|
|
43
|
+
itemTitle?: CSSStyle | undefined;
|
|
44
|
+
itemIcon?: CSSStyle | undefined;
|
|
42
45
|
};
|
|
43
46
|
};
|
|
44
47
|
export declare function getDropdownMatch(commands: readonly {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
1
|
+
import { inlineStyleText, mergeInlineStyleLayers } from '../style/inline-style-layers.engine';
|
|
2
|
+
const menuSlots = ['item', 'itemTitle', 'itemIcon', 'itemContent'];
|
|
3
|
+
const dropdownSlots = ['root', ...menuSlots];
|
|
3
4
|
// The first item with this key remains in the rendering list.
|
|
4
5
|
export function normalizeDropdownItems(items) {
|
|
5
6
|
const seen = new Set();
|
|
@@ -24,15 +25,19 @@ export function isDropdownMenuKey(event) {
|
|
|
24
25
|
return !event.defaultPrevented && !event.isComposing
|
|
25
26
|
&& !event.ctrlKey && !event.altKey && !event.metaKey;
|
|
26
27
|
}
|
|
27
|
-
/**
|
|
28
|
+
/** Names the phase before CSS accounts for the actual placement. */
|
|
28
29
|
export function getDropdownMotionName(prefix, placement) {
|
|
30
|
+
return `${prefix}-slide-${getDropdownSlideDirection(placement)}`;
|
|
31
|
+
}
|
|
32
|
+
/** Chooses the slide direction that starts at the edge next to the trigger. */
|
|
33
|
+
export function getDropdownSlideDirection(placement) {
|
|
29
34
|
if (placement.startsWith('top'))
|
|
30
|
-
return
|
|
35
|
+
return 'down';
|
|
31
36
|
if (placement.startsWith('left'))
|
|
32
|
-
return
|
|
37
|
+
return 'right';
|
|
33
38
|
if (placement.startsWith('right'))
|
|
34
|
-
return
|
|
35
|
-
return
|
|
39
|
+
return 'left';
|
|
40
|
+
return 'up';
|
|
36
41
|
}
|
|
37
42
|
/** Prepares Menu parameters, saving the keys and the initial data of the items. */
|
|
38
43
|
export function toDropdownMenuItems(items) {
|
|
@@ -71,9 +76,9 @@ export function dropdownSemantics(config, props, providerProps) {
|
|
|
71
76
|
const localClasses = resolveDropdownSlots(props.classNames, props);
|
|
72
77
|
const { root: providerRootStyle, ...providerStyles } = resolveDropdownSlots(config?.styles, providerProps) ?? {};
|
|
73
78
|
const { root: localRootStyle, ...localStyles } = resolveDropdownSlots(props.styles, props) ?? {};
|
|
74
|
-
const { root: rootClass, ...classes } =
|
|
75
|
-
const styles =
|
|
76
|
-
const rootStyle =
|
|
79
|
+
const { root: rootClass, ...classes } = mergeDropdownClasses(providerClasses, localClasses);
|
|
80
|
+
const styles = mergeDropdownStyles(providerStyles, localStyles);
|
|
81
|
+
const rootStyle = inlineStyleText(providerRootStyle, config?.style, localRootStyle) || undefined;
|
|
77
82
|
return {
|
|
78
83
|
rootClass,
|
|
79
84
|
rootStyle,
|
|
@@ -85,19 +90,30 @@ export function dropdownSemantics(config, props, providerProps) {
|
|
|
85
90
|
function resolveDropdownSlots(value, props) {
|
|
86
91
|
return typeof value === 'function' ? value({ props }) : value;
|
|
87
92
|
}
|
|
88
|
-
/**
|
|
89
|
-
function
|
|
93
|
+
/** Appends slot classes in provider and local order. */
|
|
94
|
+
function mergeDropdownClasses(inherited, local) {
|
|
90
95
|
const merged = { ...inherited, ...local };
|
|
91
96
|
if (!inherited || !local)
|
|
92
97
|
return merged;
|
|
93
98
|
for (const slot of dropdownSlots) {
|
|
94
99
|
const inheritedValue = inherited[slot];
|
|
95
100
|
if (inheritedValue && Object.hasOwn(local, slot)) {
|
|
96
|
-
merged[slot] = [inheritedValue, local[slot]].filter(Boolean).join(
|
|
101
|
+
merged[slot] = [inheritedValue, local[slot]].filter(Boolean).join(' ');
|
|
97
102
|
}
|
|
98
103
|
}
|
|
99
104
|
return merged;
|
|
100
105
|
}
|
|
106
|
+
/** Preserves explicit property clears through the merge with ConfigProvider.menu. */
|
|
107
|
+
function mergeDropdownStyles(inherited, local) {
|
|
108
|
+
const styles = { ...inherited, ...local };
|
|
109
|
+
for (const slot of menuSlots) {
|
|
110
|
+
const inheritedValue = inherited[slot];
|
|
111
|
+
if (inheritedValue && Object.hasOwn(local, slot)) {
|
|
112
|
+
styles[slot] = mergeInlineStyleLayers(inheritedValue, local[slot]);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return styles;
|
|
116
|
+
}
|
|
101
117
|
// A single letter is looking after the current paragraph, so that the re-input will cross the matches.
|
|
102
118
|
export function getDropdownMatch(commands, current, query) {
|
|
103
119
|
const search = query.trim().toLocaleLowerCase();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { CSSStyle } from '../style/inline-style.types';
|
|
2
3
|
import type { MenuClickInfo, MenuDivider, MenuGroup, MenuItem, MenuProps, MenuSubMenu } from '../menu/menu.types';
|
|
3
4
|
import type { AdjustOverflow, TooltipAlignConfig, TooltipPlacement } from '../tooltip/tooltip.types';
|
|
4
5
|
/** Physical aspects and angles, including lateral placement. */
|
|
@@ -53,16 +54,16 @@ export interface DropdownMenuProps extends Omit<MenuProps, 'items' | 'nativeElem
|
|
|
53
54
|
activeKey?: string;
|
|
54
55
|
onClick?: (info: DropdownMenuClickInfo) => void;
|
|
55
56
|
}
|
|
56
|
-
export type DropdownSlots = Partial<Record<'root' | 'item' | 'itemTitle' | 'itemIcon' | 'itemContent',
|
|
57
|
-
export type DropdownSemantic = DropdownSlots | ((info: {
|
|
57
|
+
export type DropdownSlots<Value = string> = Partial<Record<'root' | 'item' | 'itemTitle' | 'itemIcon' | 'itemContent', Value>>;
|
|
58
|
+
export type DropdownSemantic<Value = string> = DropdownSlots<Value> | ((info: {
|
|
58
59
|
props: DropdownProps;
|
|
59
|
-
}) => DropdownSlots | undefined);
|
|
60
|
+
}) => DropdownSlots<Value> | undefined);
|
|
60
61
|
/** Shared classes and styles of the panel and its menu. The nested provider replaces the entire record. */
|
|
61
62
|
export interface DropdownConfig extends Pick<DropdownProps, 'classNames' | 'styles'> {
|
|
62
63
|
/** Additional panel root class. */
|
|
63
64
|
class?: string;
|
|
64
65
|
/** Root layer between styles.root provider and styles.root copies. */
|
|
65
|
-
style?:
|
|
66
|
+
style?: CSSStyle;
|
|
66
67
|
}
|
|
67
68
|
/** The command menu at trigger snippet with mouse, keyboard and focus return. */
|
|
68
69
|
export interface DropdownProps {
|
|
@@ -108,8 +109,8 @@ export interface DropdownProps {
|
|
|
108
109
|
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
109
110
|
/** Surfacing classes and lines at each menu level. */
|
|
110
111
|
classNames?: DropdownSemantic;
|
|
111
|
-
/** CSS
|
|
112
|
-
styles?: DropdownSemantic
|
|
112
|
+
/** CSS text or object styles for the surface and items at each menu level. */
|
|
113
|
+
styles?: DropdownSemantic<CSSStyle>;
|
|
113
114
|
'aria-label'?: string;
|
|
114
115
|
'aria-labelledby'?: string;
|
|
115
116
|
class?: string;
|
package/dist/empty/Empty.svelte
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount } from 'svelte';
|
|
3
|
+
import { inlineStyleText, mergeInlineStyleLayers } from '../style/inline-style-layers.engine';
|
|
4
|
+
import type { CSSStyle } from '../style/inline-style.types';
|
|
3
5
|
import { useConfig } from '../config-provider/config-context';
|
|
4
6
|
import { useComponentTheme } from '../theme/theme-component.svelte';
|
|
5
7
|
import { connectFeedbackFocus } from '../feedback.dom';
|
|
6
8
|
import { getEmptyPrefixCss } from './empty-prefix.engine';
|
|
9
|
+
import { useRuntimeStyles } from '../theme/theme-context.svelte';
|
|
7
10
|
import ThemeScopeStyle from '../theme/ThemeScopeStyle.svelte';
|
|
8
11
|
import BuiltinImage from './EmptyImage.svelte';
|
|
9
12
|
import { ruRU } from '../types';
|
|
@@ -33,7 +36,9 @@
|
|
|
33
36
|
const componentTheme = useComponentTheme('Empty');
|
|
34
37
|
let host = $state<HTMLDivElement>();
|
|
35
38
|
let prefix = $derived(config.getPrefixCls('empty', prefixCls));
|
|
36
|
-
|
|
39
|
+
const runtimeStyles = useRuntimeStyles();
|
|
40
|
+
const hasCustomPrefix = $derived(prefix !== 'ant-empty');
|
|
41
|
+
let prefixCss = $derived(runtimeStyles && getEmptyPrefixCss(prefix));
|
|
37
42
|
let mergedImage = $derived(image ?? config.empty?.image ?? 'default');
|
|
38
43
|
let strings = $derived({ ...ruRU.empty, ...config.locale.empty });
|
|
39
44
|
let content = $derived(description === undefined ? strings.description : description);
|
|
@@ -52,16 +57,17 @@
|
|
|
52
57
|
const localClasses = typeof classNames === 'function' ? classNames(info) : classNames;
|
|
53
58
|
const localStyles = typeof styles === 'function' ? styles(info) : styles;
|
|
54
59
|
const classes: EmptySemanticSlots = {};
|
|
55
|
-
const slots: EmptySemanticSlots = {};
|
|
60
|
+
const slots: EmptySemanticSlots<CSSStyle> = {};
|
|
56
61
|
|
|
57
62
|
for (const slot of ['root', 'image', 'description', 'footer'] as const) {
|
|
58
63
|
classes[slot] = [inheritedClasses?.[slot], localClasses?.[slot]].filter(Boolean).join(' ');
|
|
59
|
-
|
|
64
|
+
const root = slot === 'root';
|
|
65
|
+
slots[slot] = mergeInlineStyleLayers(
|
|
60
66
|
inheritedStyles?.[slot],
|
|
61
|
-
|
|
67
|
+
root ? config.empty?.style : undefined,
|
|
62
68
|
localStyles?.[slot],
|
|
63
|
-
|
|
64
|
-
|
|
69
|
+
root ? style : undefined
|
|
70
|
+
);
|
|
65
71
|
}
|
|
66
72
|
|
|
67
73
|
return { classes, styles: slots };
|
|
@@ -116,7 +122,7 @@
|
|
|
116
122
|
</style>
|
|
117
123
|
|
|
118
124
|
{#if prefixCss}<ThemeScopeStyle css={prefixCss} scope={`empty-prefix:${prefix}`} />{/if}<div
|
|
119
|
-
bind:this={host} {id} data-ant-empty data-ant-empty-prefix={
|
|
125
|
+
bind:this={host} {id} data-ant-empty data-ant-empty-prefix={hasCustomPrefix ? prefix : undefined}
|
|
120
126
|
role={ariaLabel || ariaLabelledby ? 'group' : undefined}
|
|
121
127
|
aria-label={ariaLabel} aria-labelledby={ariaLabelledby} aria-describedby={ariaDescribedby}
|
|
122
128
|
dir={config.direction} class={[
|
|
@@ -124,9 +130,9 @@
|
|
|
124
130
|
mergedImage === 'simple' && `${prefix}-normal`,
|
|
125
131
|
config.direction === 'rtl' && `${prefix}-rtl`,
|
|
126
132
|
className, rootClassName, semantics.classes.root
|
|
127
|
-
]} style={
|
|
133
|
+
]} style={inlineStyleText(componentTheme.style, semantics.styles.root) || undefined}>
|
|
128
134
|
{#if mergedImage !== false}<div class={[`${prefix}-image`, semantics.classes.image]}
|
|
129
|
-
data-ant-empty-part="image" style={semantics.styles.image || undefined} aria-hidden="true" inert>
|
|
135
|
+
data-ant-empty-part="image" style={inlineStyleText(semantics.styles.image) || undefined} aria-hidden="true" inert>
|
|
130
136
|
{#if mergedImage === 'default' || mergedImage === 'simple'}<BuiltinImage
|
|
131
137
|
simple={mergedImage === 'simple'} />
|
|
132
138
|
{:else if typeof mergedImage === 'string'}<img src={mergedImage} draggable={false}
|
|
@@ -135,12 +141,12 @@
|
|
|
135
141
|
{:else if typeof mergedImage !== 'boolean'}{mergedImage ?? ''}{/if}
|
|
136
142
|
</div>{/if}
|
|
137
143
|
{#if hasDescription}<div class={[`${prefix}-description`, semantics.classes.description]}
|
|
138
|
-
data-ant-empty-part="description" style={semantics.styles.description || undefined}>
|
|
144
|
+
data-ant-empty-part="description" style={inlineStyleText(semantics.styles.description) || undefined}>
|
|
139
145
|
{#if typeof content === 'function'}{@render content()}
|
|
140
146
|
{:else if typeof content !== 'boolean'}{content}{/if}
|
|
141
147
|
</div>{/if}
|
|
142
148
|
{#if hasChildren}<div class={[`${prefix}-footer`, semantics.classes.footer]}
|
|
143
|
-
data-ant-empty-part="footer" style={semantics.styles.footer || undefined}>
|
|
149
|
+
data-ant-empty-part="footer" style={inlineStyleText(semantics.styles.footer) || undefined}>
|
|
144
150
|
{#if typeof children === 'function'}{@render children()}
|
|
145
151
|
{:else if typeof children !== 'boolean'}{children}{/if}
|
|
146
152
|
</div>{/if}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { CSSStyle } from '../style/inline-style.types';
|
|
2
3
|
export type EmptyContent = string | number | boolean | null | Snippet;
|
|
3
4
|
/** default/simple – previous aliases of built-in images; other lines – URL. */
|
|
4
5
|
export type EmptyImage = EmptyContent;
|
|
5
6
|
export type EmptyDescription = EmptyContent;
|
|
6
|
-
export interface EmptySemanticSlots {
|
|
7
|
-
root?:
|
|
8
|
-
image?:
|
|
9
|
-
description?:
|
|
10
|
-
footer?:
|
|
7
|
+
export interface EmptySemanticSlots<Value = string> {
|
|
8
|
+
root?: Value;
|
|
9
|
+
image?: Value;
|
|
10
|
+
description?: Value;
|
|
11
|
+
footer?: Value;
|
|
11
12
|
}
|
|
12
13
|
export interface EmptySemanticInfo {
|
|
13
14
|
props: EmptyProps;
|
|
14
15
|
}
|
|
15
|
-
export type EmptySemantic = EmptySemanticSlots | ((info: EmptySemanticInfo) => EmptySemanticSlots | undefined);
|
|
16
|
+
export type EmptySemantic<Value = string> = EmptySemanticSlots<Value> | ((info: EmptySemanticInfo) => EmptySemanticSlots<Value> | undefined);
|
|
16
17
|
export interface EmptyRef {
|
|
17
18
|
readonly nativeElement: HTMLDivElement;
|
|
18
19
|
}
|
|
@@ -28,12 +29,12 @@ export interface EmptyProps {
|
|
|
28
29
|
'aria-labelledby'?: string;
|
|
29
30
|
'aria-describedby'?: string;
|
|
30
31
|
class?: string;
|
|
31
|
-
style?:
|
|
32
|
+
style?: CSSStyle;
|
|
32
33
|
/** Local CSS prefix. Omission and an empty string inherit ConfigProvider. */
|
|
33
34
|
prefixCls?: string;
|
|
34
35
|
rootClassName?: string;
|
|
35
36
|
classNames?: EmptySemantic;
|
|
36
|
-
styles?: EmptySemantic
|
|
37
|
+
styles?: EmptySemantic<CSSStyle>;
|
|
37
38
|
/** Assigned after mount and cleaned at unmount. */
|
|
38
39
|
nativeElement?: HTMLDivElement;
|
|
39
40
|
ref?: EmptyRef;
|