@woodger/antd 0.1.2 → 0.1.4
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 +7 -2
- package/dist/affix/affix.types.d.ts +3 -2
- package/dist/alert/Alert.svelte +17 -12
- package/dist/alert/alert.types.d.ts +12 -11
- 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 +280 -69
- package/dist/auto-complete/auto-complete.types.d.ts +34 -3
- package/dist/avatar/Avatar.svelte +43 -30
- package/dist/avatar/AvatarGroup.svelte +31 -10
- 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.types.d.ts +6 -4
- package/dist/badge/Badge.svelte +34 -15
- package/dist/badge/BadgeRibbon.svelte +23 -19
- 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.engine.js +1 -1
- package/dist/badge/badge.types.d.ts +15 -11
- package/dist/border-beam/BorderBeam.svelte +4 -2
- 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 +4 -1
- 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 +28 -6
- 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 +23 -17
- package/dist/calendar/calendar.types.d.ts +8 -7
- package/dist/card/Card.svelte +55 -16
- 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.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 +5 -2
- 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 +884 -145
- 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 +9 -3
- 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 +126 -45
- package/dist/checkbox/Checkbox.svelte +10 -6
- package/dist/checkbox/CheckboxGroup.svelte +8 -3
- package/dist/checkbox/checkbox-group.types.d.ts +5 -4
- package/dist/checkbox/checkbox.types.d.ts +15 -13
- package/dist/collapse/Collapse.svelte +39 -10
- 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 +4 -4
- package/dist/collapse/collapse.types.d.ts +20 -14
- package/dist/color-picker/ColorPicker.svelte +165 -107
- package/dist/color-picker/ColorPickerPresets.svelte +4 -1
- 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 +1 -1
- package/dist/descriptions/Descriptions.svelte +16 -9
- 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.js +2 -2
- package/dist/divider/Divider.svelte +19 -12
- package/dist/divider/divider.types.d.ts +6 -5
- package/dist/drawer/Drawer.svelte +32 -17
- 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 +122 -21
- 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 +12 -9
- package/dist/empty/empty.types.d.ts +9 -8
- package/dist/flex/Flex.svelte +21 -7
- package/dist/flex/flex.types.d.ts +2 -1
- package/dist/float-button/FloatButton.svelte +18 -10
- package/dist/float-button/FloatButtonBackTop.svelte +6 -6
- package/dist/float-button/FloatButtonGroup.svelte +20 -21
- package/dist/float-button/float-button-context.d.ts +2 -1
- package/dist/float-button/float-button.types.d.ts +10 -8
- package/dist/form/Form.svelte +6 -2
- package/dist/form/FormItem.svelte +39 -23
- package/dist/form/FormItem.svelte.d.ts +4 -2
- package/dist/form/FormItemTooltip.svelte +2 -2
- package/dist/form/form-internal.d.ts +1 -0
- package/dist/form/form.model.svelte.js +37 -13
- package/dist/form/form.types.d.ts +18 -13
- package/dist/grid/Col.svelte +14 -15
- package/dist/grid/Row.svelte +6 -11
- package/dist/grid/grid.engine.d.ts +4 -1
- package/dist/grid/grid.engine.js +15 -3
- package/dist/grid/grid.types.d.ts +5 -2
- package/dist/image/Image.svelte +9 -8
- package/dist/image/ImagePreview.svelte +15 -11
- package/dist/image/ImagePreview.svelte.d.ts +2 -1
- package/dist/image/ImageProgress.svelte +8 -5
- package/dist/image/ImageProgress.svelte.d.ts +2 -1
- package/dist/image/image-preview-group.types.d.ts +2 -1
- package/dist/image/image-semantic.engine.d.ts +14 -13
- package/dist/image/image-semantic.engine.js +5 -9
- package/dist/image/image.types.d.ts +23 -22
- package/dist/index.d.ts +12 -12
- package/dist/index.js +2 -2
- package/dist/input/Input.svelte +70 -52
- package/dist/input/InputOTP.svelte +9 -7
- package/dist/input/InputPassword.svelte +10 -26
- package/dist/input/InputSearch.svelte +39 -16
- package/dist/input/TextArea.svelte +116 -87
- 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.types.d.ts +13 -8
- package/dist/input/textarea-value.svelte.d.ts +14 -0
- package/dist/input/textarea-value.svelte.js +48 -0
- package/dist/input/textarea.dom.d.ts +2 -0
- package/dist/input/textarea.dom.js +17 -0
- package/dist/input/textarea.types.d.ts +12 -8
- package/dist/input-number/InputNumberAction.svelte +2 -2
- package/dist/input-number/InputNumberControl.svelte +31 -21
- package/dist/input-number/input-number.types.d.ts +16 -16
- package/dist/layout/Layout.svelte +2 -1
- package/dist/layout/LayoutPart.svelte +2 -1
- package/dist/layout/LayoutSider.svelte +22 -15
- package/dist/layout/layout.types.d.ts +6 -5
- package/dist/listy/Listy.svelte +17 -12
- 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 +27 -17
- package/dist/masonry/MasonryItem.svelte +0 -1
- package/dist/masonry/masonry.types.d.ts +8 -7
- package/dist/mentions/Mentions.svelte +112 -59
- package/dist/mentions/MentionsListbox.svelte +2 -1
- package/dist/mentions/mentions.dom.d.ts +0 -2
- package/dist/mentions/mentions.dom.js +0 -54
- 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 +6 -4
- 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 +6 -5
- 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 +120 -46
- package/dist/modal/ModalConfirmation.svelte +9 -10
- package/dist/modal/modal-close.engine.d.ts +1 -1
- package/dist/modal/modal-semantic.engine.d.ts +7 -6
- package/dist/modal/modal-semantic.engine.js +2 -2
- package/dist/modal/modal.types.d.ts +25 -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 +4 -4
- 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 +87 -16
- 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 +3 -3
- 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 +5 -1
- package/dist/picker/RangePickerCore.svelte +1066 -418
- package/dist/picker/RangePickerCore.svelte.d.ts +1 -0
- package/dist/picker/SinglePicker.svelte +859 -372
- 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 +64 -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-components.types.d.ts +2 -2
- package/dist/picker/picker-editor.model.svelte.d.ts +13 -0
- package/dist/picker/picker-editor.model.svelte.js +40 -0
- package/dist/picker/picker-mask-input.model.svelte.js +11 -6
- 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 +155 -40
- package/dist/picker/picker-popup.model.svelte.d.ts +33 -7
- package/dist/picker/picker-popup.model.svelte.js +183 -20
- 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 +1 -1
- package/dist/picker/time-picker.types.d.ts +30 -25
- 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 +42 -11
- package/dist/popconfirm/popconfirm.types.d.ts +15 -11
- package/dist/popover/Popover.svelte +34 -29
- package/dist/popover/popover.types.d.ts +17 -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-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 +8 -0
- package/dist/popup/popup-geometry.dom.js +68 -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 +4 -1
- package/dist/popup/popup.dom.js +66 -21
- 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 +53 -26
- package/dist/progress/ProgressCircle.svelte +40 -22
- package/dist/progress/ProgressCircle.svelte.d.ts +2 -1
- package/dist/progress/progress.types.d.ts +6 -5
- package/dist/qr-code/QRCode.svelte +7 -5
- package/dist/qr-code/qrcode.types.d.ts +10 -9
- package/dist/radio/Radio.svelte +10 -6
- package/dist/radio/RadioGroup.svelte +8 -3
- package/dist/radio/radio.types.d.ts +20 -18
- package/dist/rate/Rate.svelte +5 -2
- 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 +14 -11
- package/dist/result/result.types.d.ts +11 -10
- package/dist/segmented/Segmented.svelte +23 -13
- package/dist/segmented/segmented.engine.js +2 -1
- package/dist/segmented/segmented.types.d.ts +11 -11
- package/dist/select/Select.svelte +418 -111
- 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 +20 -13
- package/dist/skeleton/SkeletonElement.svelte +11 -6
- package/dist/skeleton/skeleton.types.d.ts +11 -10
- package/dist/slider/SliderRange.svelte +26 -12
- package/dist/slider/SliderSingle.svelte +47 -67
- package/dist/slider/SliderTooltip.svelte +111 -13
- package/dist/slider/SliderTooltip.svelte.d.ts +4 -3
- 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 +29 -13
- package/dist/space/SpaceAddon.svelte +5 -2
- package/dist/space/SpaceCompact.svelte +3 -1
- package/dist/space/SpaceCompactItem.svelte +4 -1
- package/dist/space/space-compact.types.d.ts +6 -6
- 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 +20 -12
- package/dist/spin/spin.types.d.ts +5 -3
- package/dist/splitter/Splitter.svelte +9 -11
- 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 +20 -9
- 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 +4 -7
- 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/switch/Switch.svelte +12 -7
- package/dist/switch/switch.types.d.ts +14 -12
- package/dist/table/Table.svelte +27 -19
- 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 +8 -8
- 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 +53 -25
- package/dist/tabs/Tabs.svelte +29 -14
- 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 +5 -3
- package/dist/tag/CheckableTagGroup.svelte +39 -31
- package/dist/tag/CheckableTagGroup.svelte.d.ts +12 -12
- package/dist/tag/Tag.svelte +11 -19
- package/dist/tag/tag-style.dom.d.ts +3 -1
- package/dist/tag/tag-style.dom.js +19 -1
- package/dist/tag/tag.types.d.ts +30 -27
- package/dist/timeline/Timeline.svelte +8 -3
- package/dist/timeline/timeline.engine.js +3 -1
- package/dist/timeline/timeline.types.d.ts +7 -6
- package/dist/tooltip/Tooltip.svelte +2 -3
- package/dist/tooltip/TooltipPopup.svelte +22 -16
- 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.engine.d.ts +58 -2
- package/dist/tooltip/tooltip.engine.js +54 -27
- package/dist/tooltip/tooltip.types.d.ts +22 -13
- package/dist/tour/Tour.svelte +34 -13
- 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 +41 -35
- package/dist/transfer/TransferAction.svelte +6 -7
- package/dist/transfer/TransferAction.svelte.d.ts +3 -2
- package/dist/transfer/TransferCheckbox.svelte +6 -2
- 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/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 +5 -3
- 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.types.d.ts +8 -6
- package/dist/tree-select/TreeSelectControl.svelte +303 -155
- 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 +3 -0
- package/dist/typography/TypographyEditable.svelte +6 -3
- package/dist/typography/TypographyEditable.svelte.d.ts +3 -2
- package/dist/typography/TypographyElement.svelte +7 -4
- package/dist/typography/TypographyElement.svelte.d.ts +3 -2
- package/dist/typography/typography-semantic.engine.d.ts +9 -2
- package/dist/typography/typography-semantic.engine.js +15 -4
- package/dist/typography/typography.types.d.ts +8 -7
- package/dist/utils/declaration-order.svelte.d.ts +12 -0
- package/dist/utils/declaration-order.svelte.js +53 -0
- package/dist/vendor/date-picker-prefix.css.js +2 -2
- package/dist/vendor/tree-select-popup-motion.css +112 -112
- package/dist/vendor/tree-select-popup-motion.css.js +2 -2
- package/dist/watermark/Watermark.svelte +8 -6
- package/dist/watermark/watermark.types.d.ts +3 -2
- package/package.json +1 -1
- package/readme.md +16 -16
- 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
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';
|
|
@@ -182,6 +184,17 @@
|
|
|
182
184
|
? 'left' as const
|
|
183
185
|
: requestedPlacement.endsWith('Right') ? 'right' as const : undefined
|
|
184
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
|
+
});
|
|
185
198
|
const builtinPlacements = $derived.by(() => {
|
|
186
199
|
const lateral = requestedPlacement.startsWith('left') || requestedPlacement.startsWith('right');
|
|
187
200
|
if (!alignPoint && !lateral && !align && typeof arrow !== 'object'
|
|
@@ -189,18 +202,38 @@
|
|
|
189
202
|
return undefined;
|
|
190
203
|
}
|
|
191
204
|
|
|
192
|
-
|
|
193
|
-
const pointAtCenter = typeof arrow === 'object' && arrow.pointAtCenter === true;
|
|
194
|
-
return getPopupPlacements(pointAtCenter, arrow ? token.sizePopupArrow : 0, token.marginXXS,
|
|
195
|
-
token.borderRadius, autoAdjustOverflow);
|
|
205
|
+
return sourcePlacements;
|
|
196
206
|
});
|
|
207
|
+
let portalAligned = $state(false);
|
|
208
|
+
const sourceAligned = $derived(Boolean(builtinPlacements) || portalAligned);
|
|
197
209
|
const legacySuffix = $derived(legacyAlignment === 'left' ? 'Left'
|
|
198
210
|
: legacyAlignment === 'right' ? 'Right' : '');
|
|
199
211
|
const actualPlacement = $derived.by(() => {
|
|
200
212
|
if (!shown) return requestedPlacement;
|
|
201
213
|
|
|
202
|
-
return
|
|
214
|
+
return sourceAligned ? alignedPlacement : `${actualSide}${legacySuffix}`;
|
|
203
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
|
+
];
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
function isHorizontalSlide(motion: ReturnType<typeof getDropdownSlideDirection>) {
|
|
235
|
+
return motion === 'left' || motion === 'right';
|
|
236
|
+
}
|
|
204
237
|
|
|
205
238
|
onMount(() => { mounted = true; });
|
|
206
239
|
|
|
@@ -317,9 +350,18 @@
|
|
|
317
350
|
return;
|
|
318
351
|
}
|
|
319
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;
|
|
320
362
|
const position = createDropdownPosition(surface, () => Boolean(builtinPlacements),
|
|
321
363
|
() => Boolean(getPopupContainer || config.getPopupContainer));
|
|
322
|
-
const disconnect =
|
|
364
|
+
const disconnect = connectPopup(surface, source, {
|
|
323
365
|
trigger: host,
|
|
324
366
|
get placement() { return builtinPlacements ? requestedPlacement : legacySide; },
|
|
325
367
|
get align() { return builtinPlacements ? undefined : legacyAlignment; },
|
|
@@ -340,8 +382,21 @@
|
|
|
340
382
|
getAnchorRect(rect) {
|
|
341
383
|
return alignPoint && pointer ? new DOMRect(pointer.x, pointer.y) : rect;
|
|
342
384
|
},
|
|
343
|
-
measurePopup: position.measure,
|
|
344
|
-
|
|
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
|
+
},
|
|
345
400
|
preserveFocus: false,
|
|
346
401
|
isRelatedTarget: ownsNestedTarget,
|
|
347
402
|
onPlacement: (_, current) => updatePlacement(current),
|
|
@@ -355,18 +410,39 @@
|
|
|
355
410
|
hoveredSurfaces.clear();
|
|
356
411
|
}
|
|
357
412
|
}
|
|
358
|
-
})
|
|
413
|
+
});
|
|
359
414
|
popupConnection = disconnect;
|
|
360
415
|
|
|
361
|
-
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() {
|
|
362
438
|
resumeFocus = visible && Boolean(focusedInPopup());
|
|
363
439
|
closing = true;
|
|
364
440
|
disconnect();
|
|
365
441
|
position.reset();
|
|
366
442
|
if (popupConnection === disconnect) popupConnection = undefined;
|
|
367
443
|
closing = false;
|
|
368
|
-
}
|
|
369
|
-
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
370
446
|
|
|
371
447
|
$effect(() => {
|
|
372
448
|
const source = anchor;
|
|
@@ -397,7 +473,8 @@
|
|
|
397
473
|
}
|
|
398
474
|
|
|
399
475
|
function updatePlacement(position: TooltipPosition) {
|
|
400
|
-
|
|
476
|
+
portalAligned = Boolean(position.sourceAlign);
|
|
477
|
+
if (builtinPlacements || portalAligned) {
|
|
401
478
|
alignedPlacement = position.alignedPlacement;
|
|
402
479
|
arrowStyle = getPopupArrowStyle({
|
|
403
480
|
align: position.sourceAlign, arrowX: position.arrowX, arrowY: position.arrowY
|
|
@@ -817,9 +894,33 @@
|
|
|
817
894
|
};
|
|
818
895
|
}
|
|
819
896
|
|
|
897
|
+
let popupPaint: {
|
|
898
|
+
node: HTMLDivElement;
|
|
899
|
+
project: (styles: InlineStyleLayer) => void;
|
|
900
|
+
} | undefined;
|
|
901
|
+
|
|
820
902
|
function connectPopupStyle(surface: HTMLDivElement) {
|
|
821
|
-
const update = connectInlineStyle(surface);
|
|
822
|
-
|
|
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
|
+
};
|
|
823
924
|
}
|
|
824
925
|
|
|
825
926
|
// The external portal extends focus and hover across the whole panel. Events from nested DOM bubble normally.
|
|
@@ -877,18 +978,18 @@
|
|
|
877
978
|
vertical-align: middle;
|
|
878
979
|
}
|
|
879
980
|
[data-ant-dropdown-popup] {
|
|
880
|
-
position: fixed;
|
|
981
|
+
position: var(--ant-overlay-position, fixed);
|
|
881
982
|
inset: auto;
|
|
882
983
|
margin: 0;
|
|
883
984
|
padding: 0;
|
|
884
985
|
border: 0;
|
|
885
986
|
background: transparent;
|
|
886
|
-
width: max-content;
|
|
987
|
+
width: var(--ant-dropdown-layout-width, max-content);
|
|
887
988
|
min-width: var(--ant-dropdown-anchor-width, 0px);
|
|
888
989
|
overflow: visible;
|
|
889
990
|
}
|
|
890
991
|
[data-ant-dropdown-popup][data-ant-dropdown-source-align] {
|
|
891
|
-
width: fit-content;
|
|
992
|
+
width: var(--ant-dropdown-layout-width, fit-content);
|
|
892
993
|
right: var(--ant-dropdown-fit-right, auto);
|
|
893
994
|
bottom: var(--ant-dropdown-fit-bottom, auto);
|
|
894
995
|
justify-self: var(--ant-dropdown-fit-justify, unsafe left);
|
|
@@ -924,7 +1025,7 @@
|
|
|
924
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>
|
|
925
1026
|
<NoCompactStyle>{#if rendered}
|
|
926
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}
|
|
927
|
-
data-ant-dropdown-source-align={
|
|
1028
|
+
data-ant-dropdown-source-align={sourceAligned || undefined}
|
|
928
1029
|
data-ant-dropdown-motion data-ant-dropdown-static-motion={!runtimeStyles || undefined}
|
|
929
1030
|
data-ant-dropdown-placement={actualPlacement}
|
|
930
1031
|
bind:this={popup} id={popupId} popover="manual" role={customContent ? 'dialog' : 'presentation'}
|
|
@@ -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,5 +1,7 @@
|
|
|
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';
|
|
@@ -55,16 +57,17 @@
|
|
|
55
57
|
const localClasses = typeof classNames === 'function' ? classNames(info) : classNames;
|
|
56
58
|
const localStyles = typeof styles === 'function' ? styles(info) : styles;
|
|
57
59
|
const classes: EmptySemanticSlots = {};
|
|
58
|
-
const slots: EmptySemanticSlots = {};
|
|
60
|
+
const slots: EmptySemanticSlots<CSSStyle> = {};
|
|
59
61
|
|
|
60
62
|
for (const slot of ['root', 'image', 'description', 'footer'] as const) {
|
|
61
63
|
classes[slot] = [inheritedClasses?.[slot], localClasses?.[slot]].filter(Boolean).join(' ');
|
|
62
|
-
|
|
64
|
+
const root = slot === 'root';
|
|
65
|
+
slots[slot] = mergeInlineStyleLayers(
|
|
63
66
|
inheritedStyles?.[slot],
|
|
64
|
-
|
|
67
|
+
root ? config.empty?.style : undefined,
|
|
65
68
|
localStyles?.[slot],
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
root ? style : undefined
|
|
70
|
+
);
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
return { classes, styles: slots };
|
|
@@ -127,9 +130,9 @@
|
|
|
127
130
|
mergedImage === 'simple' && `${prefix}-normal`,
|
|
128
131
|
config.direction === 'rtl' && `${prefix}-rtl`,
|
|
129
132
|
className, rootClassName, semantics.classes.root
|
|
130
|
-
]} style={
|
|
133
|
+
]} style={inlineStyleText(componentTheme.style, semantics.styles.root) || undefined}>
|
|
131
134
|
{#if mergedImage !== false}<div class={[`${prefix}-image`, semantics.classes.image]}
|
|
132
|
-
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>
|
|
133
136
|
{#if mergedImage === 'default' || mergedImage === 'simple'}<BuiltinImage
|
|
134
137
|
simple={mergedImage === 'simple'} />
|
|
135
138
|
{:else if typeof mergedImage === 'string'}<img src={mergedImage} draggable={false}
|
|
@@ -138,12 +141,12 @@
|
|
|
138
141
|
{:else if typeof mergedImage !== 'boolean'}{mergedImage ?? ''}{/if}
|
|
139
142
|
</div>{/if}
|
|
140
143
|
{#if hasDescription}<div class={[`${prefix}-description`, semantics.classes.description]}
|
|
141
|
-
data-ant-empty-part="description" style={semantics.styles.description || undefined}>
|
|
144
|
+
data-ant-empty-part="description" style={inlineStyleText(semantics.styles.description) || undefined}>
|
|
142
145
|
{#if typeof content === 'function'}{@render content()}
|
|
143
146
|
{:else if typeof content !== 'boolean'}{content}{/if}
|
|
144
147
|
</div>{/if}
|
|
145
148
|
{#if hasChildren}<div class={[`${prefix}-footer`, semantics.classes.footer]}
|
|
146
|
-
data-ant-empty-part="footer" style={semantics.styles.footer || undefined}>
|
|
149
|
+
data-ant-empty-part="footer" style={inlineStyleText(semantics.styles.footer) || undefined}>
|
|
147
150
|
{#if typeof children === 'function'}{@render children()}
|
|
148
151
|
{:else if typeof children !== 'boolean'}{children}{/if}
|
|
149
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;
|
package/dist/flex/Flex.svelte
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { getFlexPrefixCss } from './flex-prefix.engine';
|
|
5
5
|
import { useRuntimeStyles } from '../theme/theme-context.svelte';
|
|
6
6
|
import ThemeScopeStyle from '../theme/ThemeScopeStyle.svelte';
|
|
7
|
+
import { inlineStyleText } from '../style/inline-style-layers.engine';
|
|
7
8
|
import type { FlexComponentProps, FlexRootProps } from './flex.types';
|
|
8
9
|
|
|
9
10
|
let {
|
|
@@ -36,13 +37,26 @@
|
|
|
36
37
|
let presetGap = $derived(
|
|
37
38
|
typeof gap === 'string' && ['small', 'medium', 'large'].includes(gap)
|
|
38
39
|
);
|
|
39
|
-
let rootStyle = $derived(
|
|
40
|
-
componentTheme.style,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
let rootStyle = $derived.by(() => {
|
|
41
|
+
const layers = [componentTheme.style, config.flex?.style, style];
|
|
42
|
+
const customGap = presetGap || gap == null ? undefined
|
|
43
|
+
: typeof gap === 'number' ? `${gap}px` : gap;
|
|
44
|
+
|
|
45
|
+
if (layers.some(layer => typeof layer === 'object' && layer !== null)) {
|
|
46
|
+
// Overwriting flex or gap keeps its position relative to authored longhands.
|
|
47
|
+
const layoutStyle = {
|
|
48
|
+
...(flex == null ? undefined : { flex }),
|
|
49
|
+
...(customGap === undefined ? undefined : { gap: customGap })
|
|
50
|
+
};
|
|
51
|
+
return inlineStyleText(...layers, layoutStyle);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return [
|
|
55
|
+
...layers,
|
|
56
|
+
flex == null ? undefined : `flex:${flex}`,
|
|
57
|
+
customGap === undefined ? undefined : `gap:${customGap}`
|
|
58
|
+
].filter(value => value != null).join(';');
|
|
59
|
+
});
|
|
46
60
|
let rootProps = $derived({
|
|
47
61
|
...rest,
|
|
48
62
|
dir: config.direction,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Component, Snippet } from 'svelte';
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import type { CSSStyle } from '../style/inline-style.types';
|
|
3
4
|
export type FlexAlign = 'center' | 'start' | 'end' | 'flex-start' | 'flex-end' | 'self-start' | 'self-end' | 'baseline' | 'normal' | 'stretch';
|
|
4
5
|
export type FlexJustify = 'flex-start' | 'flex-end' | 'start' | 'end' | 'center' | 'space-between' | 'space-around' | 'space-evenly' | 'stretch' | 'normal' | 'left' | 'right';
|
|
5
6
|
export type FlexGap = 'small' | 'medium' | 'large' | string | number;
|
|
@@ -29,7 +30,7 @@ export interface FlexProps<Props extends object = {}> extends Omit<HTMLAttribute
|
|
|
29
30
|
component?: keyof HTMLElementTagNameMap | Component<Props>;
|
|
30
31
|
class?: HTMLAttributes<HTMLElement>['class'];
|
|
31
32
|
rootClassName?: string;
|
|
32
|
-
style?:
|
|
33
|
+
style?: CSSStyle;
|
|
33
34
|
/**
|
|
34
35
|
* The native ref is available after mount and cleared on unmount. A custom component must forward
|
|
35
36
|
* it through a $bindable nativeElement, or the ref is undefined.
|