@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
package/dist/steps/Steps.svelte
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { useStepsComposition } from './steps-composition-context';
|
|
3
3
|
import { useConfig } from '../config-provider/config-context';
|
|
4
4
|
import { useComponentTheme } from '../theme/theme-component.svelte';
|
|
5
|
-
import {
|
|
5
|
+
import { inlineStyleText } from '../style/inline-style-layers.engine';
|
|
6
|
+
import { mergeComponentSemanticLayers } from '../style/semantic-style.engine';
|
|
6
7
|
import { getStepsPrefixCss } from './steps-prefix.engine';
|
|
7
8
|
import { useRuntimeStyles } from '../theme/theme-context.svelte';
|
|
8
9
|
import ThemeScopeStyle from '../theme/ThemeScopeStyle.svelte';
|
|
@@ -108,7 +109,7 @@
|
|
|
108
109
|
// Timeline's upstream InternalContext removes Steps semantics while retaining plain root style and class.
|
|
109
110
|
let componentConfig = $derived(composition?.timeline
|
|
110
111
|
? { style: config.steps?.style } : config.steps);
|
|
111
|
-
let semantic = $derived(
|
|
112
|
+
let semantic = $derived(mergeComponentSemanticLayers<keyof StepsSemanticSlots, StepsProps>(
|
|
112
113
|
componentConfig,
|
|
113
114
|
info.props,
|
|
114
115
|
['root', 'item', 'itemWrapper', 'itemIcon', 'itemSection', 'itemHeader',
|
|
@@ -211,11 +212,7 @@
|
|
|
211
212
|
rootClassName,
|
|
212
213
|
classes.root
|
|
213
214
|
]}
|
|
214
|
-
style={
|
|
215
|
-
Boolean
|
|
216
|
-
).join(
|
|
217
|
-
';'
|
|
218
|
-
)}>
|
|
215
|
+
style={inlineStyleText(componentTheme.style, `--ant-cmp-steps-items-offset:${offset}`, slots.root)}>
|
|
219
216
|
{#each displayed as step, index (step.key)}
|
|
220
217
|
<StepItem prefixCls={componentPrefix} item={step.item} index={step.originIndex >= 0 ? initial + step.originIndex : index} status={statuses[index]} active={index === display.current}
|
|
221
218
|
waveDisabled={!onChange} waveColorSource={variant === 'filled' ? 'color' : null}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { StepsStatus } from './steps.types';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { CSSStyle } from '../style/inline-style.types';
|
|
3
4
|
export type StepsDataContent = string | number | boolean | null | undefined | Snippet;
|
|
4
|
-
export type StepsSemanticSlots = Partial<Record<'root' | 'item' | 'itemWrapper' | 'itemIcon' | 'itemSection' | 'itemHeader' | 'itemTitle' | 'itemSubtitle' | 'itemContent' | 'itemRail',
|
|
5
|
-
export type StepsItemSlots = Partial<Record<'root' | 'wrapper' | 'icon' | 'section' | 'header' | 'title' | 'subtitle' | 'content' | 'rail',
|
|
5
|
+
export type StepsSemanticSlots<Value = string> = Partial<Record<'root' | 'item' | 'itemWrapper' | 'itemIcon' | 'itemSection' | 'itemHeader' | 'itemTitle' | 'itemSubtitle' | 'itemContent' | 'itemRail', Value>>;
|
|
6
|
+
export type StepsItemSlots<Value = string> = Partial<Record<'root' | 'wrapper' | 'icon' | 'section' | 'header' | 'title' | 'subtitle' | 'content' | 'rail', Value>>;
|
|
6
7
|
export interface StepsDataItem {
|
|
7
8
|
key?: string | number;
|
|
8
9
|
title?: StepsDataContent;
|
|
@@ -13,9 +14,9 @@ export interface StepsDataItem {
|
|
|
13
14
|
disabled?: boolean;
|
|
14
15
|
onClick?: (event: MouseEvent) => void;
|
|
15
16
|
class?: string;
|
|
16
|
-
style?:
|
|
17
|
+
style?: CSSStyle;
|
|
17
18
|
classNames?: StepsItemSlots;
|
|
18
|
-
styles?: StepsItemSlots
|
|
19
|
+
styles?: StepsItemSlots<CSSStyle>;
|
|
19
20
|
}
|
|
20
21
|
export interface NormalizedStepsDataItem extends Omit<StepsDataItem, 'key'> {
|
|
21
22
|
key: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import type StepIcon from './StepIcon.svelte';
|
|
3
3
|
import type { StepsStatus } from './steps.types';
|
|
4
|
+
import type { CSSStyle } from '../style/inline-style.types';
|
|
4
5
|
import type { NormalizedStepsDataItem, StepsDataItem, StepsSemanticSlots } from './steps-data.engine';
|
|
5
6
|
export type { StepsDataItem, StepsDataContent, StepsItemSlots, StepsSemanticSlots } from './steps-data.engine';
|
|
6
7
|
export type StepsType = 'default' | 'dot' | 'inline' | 'navigation' | 'panel';
|
|
@@ -28,7 +29,7 @@ export interface StepItemViewProps {
|
|
|
28
29
|
statusText?: string;
|
|
29
30
|
composed?: boolean;
|
|
30
31
|
classes: StepsSemanticSlots;
|
|
31
|
-
slots: StepsSemanticSlots
|
|
32
|
+
slots: StepsSemanticSlots<CSSStyle>;
|
|
32
33
|
dot?: boolean;
|
|
33
34
|
panel?: boolean;
|
|
34
35
|
inline?: boolean;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { CSSStyle } from '../style/inline-style.types';
|
|
1
2
|
export interface StepsIconContext {
|
|
2
3
|
readonly prefixCls?: string;
|
|
3
4
|
readonly className?: string;
|
|
4
|
-
readonly style?:
|
|
5
|
+
readonly style?: CSSStyle;
|
|
5
6
|
readonly decorative: boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare function setStepsIcon(context: StepsIconContext): void;
|
|
@@ -2,6 +2,7 @@ import type { HTMLAttributes } from 'svelte/elements';
|
|
|
2
2
|
import type { StepsDataItem, StepsSemanticSlots } from './steps-data.engine';
|
|
3
3
|
import type { StepsType, StepsIconRender } from './steps-expanded.types';
|
|
4
4
|
import type { Snippet } from 'svelte';
|
|
5
|
+
import type { CSSStyle } from '../style/inline-style.types';
|
|
5
6
|
export type StepsStatus = 'wait' | 'process' | 'finish' | 'error';
|
|
6
7
|
export type StepsOrientation = 'horizontal' | 'vertical';
|
|
7
8
|
export type StepsSize = 'medium' | 'small';
|
|
@@ -35,9 +36,9 @@ export interface StepsProps extends Omit<HTMLAttributes<HTMLOListElement>, 'chil
|
|
|
35
36
|
classNames?: StepsSemanticSlots | ((info: {
|
|
36
37
|
props: StepsProps;
|
|
37
38
|
}) => StepsSemanticSlots);
|
|
38
|
-
styles?: StepsSemanticSlots | ((info: {
|
|
39
|
+
styles?: StepsSemanticSlots<CSSStyle> | ((info: {
|
|
39
40
|
props: StepsProps;
|
|
40
|
-
}) => StepsSemanticSlots);
|
|
41
|
+
}) => StepsSemanticSlots<CSSStyle>);
|
|
41
42
|
rootClassName?: string;
|
|
42
43
|
/** The native ref is available after mount and cleared on unmount. */
|
|
43
44
|
nativeElement?: HTMLOListElement;
|
|
@@ -56,7 +57,7 @@ export interface StepsProps extends Omit<HTMLAttributes<HTMLOListElement>, 'chil
|
|
|
56
57
|
'aria-labelledby'?: string;
|
|
57
58
|
'aria-describedby'?: string;
|
|
58
59
|
class?: string;
|
|
59
|
-
style?:
|
|
60
|
+
style?: CSSStyle;
|
|
60
61
|
}
|
|
61
62
|
/** General classes/styles; Timeline inherits only class/style as internal Steps in source. */
|
|
62
63
|
export type StepsConfig = Pick<StepsProps, 'class' | 'style' | 'classNames' | 'styles'>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type InlineStyleLayer } from './inline-style.engine';
|
|
2
|
+
import type { CSSProperties, CSSStyle } from './inline-style.types';
|
|
3
|
+
type ComputedStyle = readonly (readonly [string, string])[];
|
|
4
|
+
export type InlineStyleInput = CSSStyle | ComputedStyle | undefined;
|
|
5
|
+
/** Retains authored properties when passing styles to a composed component. */
|
|
6
|
+
export declare function mergeInlineStyleLayers(...layers: readonly (CSSStyle | undefined)[]): string | CSSProperties;
|
|
7
|
+
/** Resolves object clears while keeping generated property values separate for the DOM updater. */
|
|
8
|
+
export declare function resolveInlineStyleLayers(layers: readonly InlineStyleInput[], readText?: (style: string) => string): readonly InlineStyleLayer[];
|
|
9
|
+
/** Produces the DOM style after applying the last authored value for each property. */
|
|
10
|
+
export declare function inlineStyleText(...layers: readonly (CSSStyle | undefined)[]): string;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// Merges provider and local semantic styles by property. Composed components preserve
|
|
2
|
+
// explicit empty property values until the final DOM style is serialized.
|
|
3
|
+
import { cssPropertyName, cssPropertyValueText, getInlineStyleDeclarations, serializeCssProperties, serializeInlineStyleLayers } from './inline-style.engine';
|
|
4
|
+
const styleLayers = Symbol('inline-style-layers');
|
|
5
|
+
/** Converts a parsed declaration to the same key used by a CSS object. */
|
|
6
|
+
function objectKey(property) {
|
|
7
|
+
if (property.startsWith('--'))
|
|
8
|
+
return property;
|
|
9
|
+
return property.replace(/^-ms-/, 'ms-').replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
10
|
+
}
|
|
11
|
+
/** Restores forwarded layers, including CSS fallbacks and property clears. */
|
|
12
|
+
function presentLayers(layers) {
|
|
13
|
+
const present = [];
|
|
14
|
+
for (const layer of layers) {
|
|
15
|
+
if (layer == null || layer === '')
|
|
16
|
+
continue;
|
|
17
|
+
if (typeof layer === 'object' && styleLayers in layer) {
|
|
18
|
+
// The private symbol is assigned only by mergeInlineStyleLayers.
|
|
19
|
+
present.push(...layer[styleLayers]);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
present.push(layer);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return present;
|
|
26
|
+
}
|
|
27
|
+
/** Keeps CSS text declarations in order and combines repeated object keys in place. */
|
|
28
|
+
function mixedDeclarations(layers) {
|
|
29
|
+
const declarations = [];
|
|
30
|
+
const objectEntries = new Map();
|
|
31
|
+
for (const layer of layers) {
|
|
32
|
+
if (typeof layer === 'string') {
|
|
33
|
+
for (const { property, value, priority } of getInlineStyleDeclarations([layer])) {
|
|
34
|
+
declarations.push({
|
|
35
|
+
property,
|
|
36
|
+
key: objectKey(property),
|
|
37
|
+
value,
|
|
38
|
+
fromText: true,
|
|
39
|
+
priority: priority === 'important' ? priority : ''
|
|
40
|
+
});
|
|
41
|
+
objectEntries.delete(property);
|
|
42
|
+
}
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
for (const [key, value] of Object.entries(layer)) {
|
|
46
|
+
const property = cssPropertyName(key);
|
|
47
|
+
if (value == null || value === '') {
|
|
48
|
+
for (const declaration of declarations) {
|
|
49
|
+
if (declaration.property === property)
|
|
50
|
+
declaration.value = undefined;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const previous = objectEntries.get(property);
|
|
54
|
+
if (previous) {
|
|
55
|
+
previous.key = key;
|
|
56
|
+
previous.value = value;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
const declaration = { property, key, value, fromText: false };
|
|
60
|
+
declarations.push(declaration);
|
|
61
|
+
objectEntries.set(property, declaration);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return declarations;
|
|
66
|
+
}
|
|
67
|
+
/** Retains authored properties when passing styles to a composed component. */
|
|
68
|
+
export function mergeInlineStyleLayers(...layers) {
|
|
69
|
+
const present = presentLayers(layers);
|
|
70
|
+
if (present.every(layer => typeof layer === 'string'))
|
|
71
|
+
return present.join(';');
|
|
72
|
+
if (present.every(layer => typeof layer !== 'string'))
|
|
73
|
+
return Object.assign({}, ...present);
|
|
74
|
+
const properties = Object.fromEntries(mixedDeclarations(present).map(({ key, value, priority }) => [key, priority && typeof value === 'string'
|
|
75
|
+
? `${value} !${priority}` : value]));
|
|
76
|
+
return Object.defineProperty(properties, styleLayers, { value: present });
|
|
77
|
+
}
|
|
78
|
+
/** Recognizes generated values already represented as single CSS declarations. */
|
|
79
|
+
function isComputedStyle(style) {
|
|
80
|
+
return Array.isArray(style);
|
|
81
|
+
}
|
|
82
|
+
/** Identifies layers that the native updater can use directly. */
|
|
83
|
+
function isDeclarationLayer(style) {
|
|
84
|
+
return style == null || typeof style === 'string' || isComputedStyle(style);
|
|
85
|
+
}
|
|
86
|
+
/** Resolves object clears while keeping generated property values separate for the DOM updater. */
|
|
87
|
+
export function resolveInlineStyleLayers(layers, readText) {
|
|
88
|
+
if (layers.every(isDeclarationLayer)) {
|
|
89
|
+
return layers.map(layer => layer ?? undefined);
|
|
90
|
+
}
|
|
91
|
+
const styles = layers.map(layer => {
|
|
92
|
+
if (isComputedStyle(layer))
|
|
93
|
+
return Object.fromEntries(layer);
|
|
94
|
+
return typeof layer === 'string' && readText ? readText(layer) : layer;
|
|
95
|
+
});
|
|
96
|
+
return [resolveStyleEntries(presentLayers(styles))];
|
|
97
|
+
}
|
|
98
|
+
/** Serializes CSS objects while preserving the original priority of CSS text. */
|
|
99
|
+
function resolveStyleEntries(layers) {
|
|
100
|
+
const entries = [];
|
|
101
|
+
for (const { property, key, value, fromText, priority } of mixedDeclarations(layers)) {
|
|
102
|
+
if (value == null || value === '')
|
|
103
|
+
continue;
|
|
104
|
+
const text = fromText ? String(value) : cssPropertyValueText(key, value);
|
|
105
|
+
if (text !== undefined)
|
|
106
|
+
entries.push([property, text, priority]);
|
|
107
|
+
}
|
|
108
|
+
return entries;
|
|
109
|
+
}
|
|
110
|
+
/** Produces the DOM style after applying the last authored value for each property. */
|
|
111
|
+
export function inlineStyleText(...layers) {
|
|
112
|
+
const present = presentLayers(layers);
|
|
113
|
+
if (present.every(layer => typeof layer === 'string'))
|
|
114
|
+
return present.join(';');
|
|
115
|
+
if (present.every(layer => typeof layer !== 'string')) {
|
|
116
|
+
const properties = Object.assign({}, ...present);
|
|
117
|
+
return serializeCssProperties(properties) ?? '';
|
|
118
|
+
}
|
|
119
|
+
return serializeInlineStyleLayers([resolveStyleEntries(present)]) ?? '';
|
|
120
|
+
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export type InlineStyleLayer = string | undefined | readonly (readonly [string, string, ('' | 'important')?])[];
|
|
2
|
+
/** Converts a DOM style key while keeping case-sensitive custom properties. */
|
|
3
|
+
export declare function cssPropertyName(property: string): string;
|
|
2
4
|
/** Converts Source CSS object in declarations with units React DOM. */
|
|
3
5
|
export declare function serializeCssProperties(style: object): string | undefined;
|
|
6
|
+
/** Produces one DOM property value without parsing its characters as other declarations. */
|
|
7
|
+
export declare function cssPropertyValueText(property: string, value: unknown): string | undefined;
|
|
4
8
|
export declare function serializeInlineStyleLayers(layers: readonly InlineStyleLayer[]): string | undefined;
|
|
5
9
|
/** Saves declaration keys, strings, comments and function values without shorthand deployment. */
|
|
6
10
|
export declare function getInlineStyleDeclarations(layers: readonly InlineStyleLayer[]): Generator<{
|
|
@@ -15,22 +15,30 @@ for (const property of unitlessNames) {
|
|
|
15
15
|
unitless.add(`${prefix}${property[0].toUpperCase()}${property.slice(1)}`);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
+
/** Converts a DOM style key while keeping case-sensitive custom properties. */
|
|
19
|
+
export function cssPropertyName(property) {
|
|
20
|
+
return property.startsWith('--') ? property : property.replace(/[A-Z]/g, '-$&')
|
|
21
|
+
.toLowerCase().replace(/^ms-/, '-ms-');
|
|
22
|
+
}
|
|
18
23
|
/** Converts Source CSS object in declarations with units React DOM. */
|
|
19
24
|
export function serializeCssProperties(style) {
|
|
20
25
|
const declarations = [];
|
|
21
26
|
for (const [property, value] of Object.entries(style)) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const name = custom ? property : property.replace(/[A-Z]/g, '-$&')
|
|
26
|
-
.toLowerCase().replace(/^ms-/, '-ms-');
|
|
27
|
-
const text = !custom && typeof value === 'number' && value !== 0 && !unitless.has(property)
|
|
28
|
-
? `${value}px` : String(value).trim();
|
|
29
|
-
if (text)
|
|
30
|
-
declarations.push(`${name}:${text}`);
|
|
27
|
+
const text = cssPropertyValueText(property, value);
|
|
28
|
+
if (text !== undefined)
|
|
29
|
+
declarations.push(`${cssPropertyName(property)}:${text}`);
|
|
31
30
|
}
|
|
32
31
|
return declarations.length ? declarations.join(';') : undefined;
|
|
33
32
|
}
|
|
33
|
+
/** Produces one DOM property value without parsing its characters as other declarations. */
|
|
34
|
+
export function cssPropertyValueText(property, value) {
|
|
35
|
+
if (value == null || typeof value === 'boolean' || value === '') {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
const needsUnit = !property.startsWith('--')
|
|
39
|
+
&& typeof value === 'number' && value !== 0 && !unitless.has(property);
|
|
40
|
+
return needsUnit ? `${value}px` : String(value).trim() || undefined;
|
|
41
|
+
}
|
|
34
42
|
export function serializeInlineStyleLayers(layers) {
|
|
35
43
|
return layers.map(layer => typeof layer === 'string' ? layer
|
|
36
44
|
: layer?.filter(([, value]) => value !== '')
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type CSSPropertyValue = string | number | null | undefined;
|
|
2
|
+
type DOMStringStyleKey = {
|
|
3
|
+
[Key in keyof CSSStyleDeclaration]-?: CSSStyleDeclaration[Key] extends string ? Key : never;
|
|
4
|
+
}[keyof CSSStyleDeclaration];
|
|
5
|
+
type DOMStyleKey = Exclude<Extract<DOMStringStyleKey, string>, 'cssText' | 'cssFloat'> | 'float';
|
|
6
|
+
type WebkitStyleKey = Extract<DOMStyleKey, `webkit${string}`> extends `webkit${infer Tail}` ? `Webkit${Tail}` : never;
|
|
7
|
+
type KnownCSSProperties = Readonly<Partial<Record<DOMStyleKey | WebkitStyleKey, CSSPropertyValue>>>;
|
|
8
|
+
type CustomStyleKey = `--${string}` | `Webkit${string}` | `Moz${string}` | `ms${string}` | `O${string}`;
|
|
9
|
+
/** Named CSS properties accept interfaces. Custom properties use the CSS variable name. */
|
|
10
|
+
export type CSSProperties = KnownCSSProperties | (KnownCSSProperties & Readonly<Partial<Record<CustomStyleKey, CSSPropertyValue>>>);
|
|
11
|
+
export type CSSStyle = string | CSSProperties | null;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
type Semantic<Key extends string, Props> = Partial<Record<Key,
|
|
1
|
+
import type { CSSStyle } from './inline-style.types';
|
|
2
|
+
type Semantic<Key extends string, Props, Value = string> = Partial<Record<Key, Value>> | ((info: {
|
|
3
3
|
props: Props;
|
|
4
|
-
}) => Partial<Record<Key,
|
|
5
|
-
|
|
6
|
-
style?: string | null;
|
|
7
|
-
}>(context: {
|
|
8
|
-
classNames?: Semantic<Key, Props>;
|
|
9
|
-
styles?: Semantic<Key, Props>;
|
|
10
|
-
style?: string | null;
|
|
11
|
-
} | undefined, props: Props & {
|
|
4
|
+
}) => Partial<Record<Key, Value>> | undefined);
|
|
5
|
+
interface SemanticConfig<Key extends string, Props> {
|
|
12
6
|
classNames?: Semantic<Key, Props>;
|
|
13
|
-
styles?: Semantic<Key, Props>;
|
|
14
|
-
|
|
7
|
+
styles?: Semantic<Key, Props, CSSStyle>;
|
|
8
|
+
style?: CSSStyle;
|
|
9
|
+
}
|
|
10
|
+
/** Serializes component styles when the resolved slots go directly to DOM elements. */
|
|
11
|
+
export declare function mergeComponentSemantics<Key extends string, Props extends {
|
|
12
|
+
style?: CSSStyle;
|
|
13
|
+
}>(context: SemanticConfig<Key, Props> | undefined, props: Props & SemanticConfig<Key, Props>, keys: readonly Key[]): {
|
|
15
14
|
classes: Partial<Record<Key, string>>;
|
|
16
15
|
styles: Partial<Record<Key, string>>;
|
|
17
16
|
};
|
|
17
|
+
/** Retains property clears until the component and its children apply their final style layers. */
|
|
18
|
+
export declare function mergeComponentSemanticLayers<Key extends string, Props extends {
|
|
19
|
+
style?: CSSStyle;
|
|
20
|
+
}>(context: SemanticConfig<Key, Props> | undefined, props: Props & SemanticConfig<Key, Props>, keys: readonly Key[]): {
|
|
21
|
+
classes: Partial<Record<Key, string>>;
|
|
22
|
+
styles: Partial<Record<Key, string | import("./inline-style.types").CSSProperties>>;
|
|
23
|
+
};
|
|
18
24
|
export {};
|
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
// Combines flat semantic slots for DOM owners and components that add their own style layers.
|
|
2
|
+
import { inlineStyleText, mergeInlineStyleLayers } from './inline-style-layers.engine';
|
|
3
|
+
/** Resolves configuration and local callbacks in order before combining their slot values. */
|
|
4
|
+
function combineComponentSemantics(context, props, keys, mergeStyles) {
|
|
5
|
+
/** Uses the same resolved props for each source and treats an omitted result as empty. */
|
|
2
6
|
const resolve = (value) => (typeof value === 'function' ? value({ props }) : value) ?? {};
|
|
3
7
|
const contextClasses = resolve(context?.classNames);
|
|
4
8
|
const localClasses = resolve(props.classNames);
|
|
5
9
|
const contextStyles = resolve(context?.styles);
|
|
6
10
|
const localStyles = resolve(props.styles);
|
|
7
|
-
const join = (values, separator) => values.filter(Boolean).join(separator) || undefined;
|
|
8
11
|
const classes = {};
|
|
9
12
|
const styles = {};
|
|
10
13
|
for (const key of keys) {
|
|
11
|
-
classes[key] =
|
|
12
|
-
styles[key] =
|
|
13
|
-
contextStyles[key],
|
|
14
|
-
key === 'root' ? context?.style : undefined,
|
|
15
|
-
localStyles[key],
|
|
16
|
-
key === 'root' ? props.style : undefined
|
|
17
|
-
], ';');
|
|
14
|
+
classes[key] = [contextClasses[key], localClasses[key]].filter(Boolean).join(' ') || undefined;
|
|
15
|
+
styles[key] = mergeStyles(contextStyles[key], key === 'root' ? context?.style : undefined, localStyles[key], key === 'root' ? props.style : undefined) || undefined;
|
|
18
16
|
}
|
|
19
17
|
return { classes, styles };
|
|
20
18
|
}
|
|
19
|
+
/** Serializes component styles when the resolved slots go directly to DOM elements. */
|
|
20
|
+
export function mergeComponentSemantics(context, props, keys) {
|
|
21
|
+
return combineComponentSemantics(context, props, keys, inlineStyleText);
|
|
22
|
+
}
|
|
23
|
+
/** Retains property clears until the component and its children apply their final style layers. */
|
|
24
|
+
export function mergeComponentSemanticLayers(context, props, keys) {
|
|
25
|
+
return combineComponentSemantics(context, props, keys, mergeInlineStyleLayers);
|
|
26
|
+
}
|
|
@@ -8,12 +8,14 @@
|
|
|
8
8
|
import { onDestroy, onMount, untrack } from 'svelte';
|
|
9
9
|
import { useConfig } from '../config-provider/config-context';
|
|
10
10
|
import { useComponentTheme } from '../theme/theme-component.svelte';
|
|
11
|
+
import { inlineStyleText } from '../style/inline-style-layers.engine';
|
|
11
12
|
import { useWave } from '../wave/wave.svelte';
|
|
12
13
|
import { useForm, useFormField } from '../form/form-context';
|
|
13
14
|
import { getSwitchPrefixCss } from './switch-prefix.engine';
|
|
14
15
|
import { useRuntimeStyles } from '../theme/theme-context.svelte';
|
|
15
16
|
import ThemeScopeStyle from '../theme/ThemeScopeStyle.svelte';
|
|
16
17
|
import Icon from '../icon/Icon.svelte';
|
|
18
|
+
import RenderContent from '../RenderContent.svelte';
|
|
17
19
|
import type { SwitchEvent, SwitchProps } from './switch.types';
|
|
18
20
|
|
|
19
21
|
let {
|
|
@@ -56,13 +58,16 @@
|
|
|
56
58
|
? config.switch.styles(info) : config.switch?.styles);
|
|
57
59
|
let localStyles = $derived(typeof props.styles === 'function'
|
|
58
60
|
? props.styles(info) : props.styles);
|
|
59
|
-
let rootStyle = $derived(
|
|
61
|
+
let rootStyle = $derived(inlineStyleText(
|
|
60
62
|
componentTheme.style,
|
|
61
63
|
contextStyles?.root,
|
|
62
64
|
config.switch?.style,
|
|
63
65
|
localStyles?.root,
|
|
64
66
|
props.style
|
|
65
|
-
|
|
67
|
+
) || undefined);
|
|
68
|
+
let contentStyle = $derived(inlineStyleText(
|
|
69
|
+
contextStyles?.content, localStyles?.content
|
|
70
|
+
) || undefined);
|
|
66
71
|
let blurCallbacks = untrack(() => ({ onBlur: props.onBlur, onblur: props.onblur }));
|
|
67
72
|
const owned = new Set([
|
|
68
73
|
'checked', 'value', 'defaultChecked', 'defaultValue', 'nativeElement', 'ref', 'loading',
|
|
@@ -247,20 +252,20 @@
|
|
|
247
252
|
onblur={handleBlur}
|
|
248
253
|
>
|
|
249
254
|
<span class={[`${prefix}-handle`, contextClasses?.indicator, localClasses?.indicator]}
|
|
250
|
-
style={
|
|
255
|
+
style={inlineStyleText(contextStyles?.indicator, localStyles?.indicator) || undefined}
|
|
251
256
|
aria-hidden="true">
|
|
252
257
|
{#if props.loading}<span class={`${prefix}-loading-icon anticon`}><Icon name="loading" /></span>{/if}
|
|
253
258
|
</span>
|
|
254
259
|
<span class={`${prefix}-inner`} aria-hidden="true">
|
|
255
260
|
<span class={[`${prefix}-inner-checked`, contextClasses?.content, localClasses?.content]}
|
|
256
|
-
style={
|
|
261
|
+
style={contentStyle}>
|
|
257
262
|
{#if typeof props.checkedChildren === 'function'}{@render props.checkedChildren()}
|
|
258
|
-
{:else}{props.checkedChildren
|
|
263
|
+
{:else}<RenderContent value={props.checkedChildren} />{/if}
|
|
259
264
|
</span>
|
|
260
265
|
<span class={[`${prefix}-inner-unchecked`, contextClasses?.content, localClasses?.content]}
|
|
261
|
-
style={
|
|
266
|
+
style={contentStyle}>
|
|
262
267
|
{#if typeof props.unCheckedChildren === 'function'}{@render props.unCheckedChildren()}
|
|
263
|
-
{:else}{props.unCheckedChildren
|
|
268
|
+
{:else}<RenderContent value={props.unCheckedChildren} />{/if}
|
|
264
269
|
</span>
|
|
265
270
|
</span>
|
|
266
271
|
{#if fieldName && resolvedChecked}<input type="hidden" name={fieldName} value="on" disabled={resolvedDisabled} form={attributes.form} />{/if}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
1
|
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
2
|
+
import type { CSSStyle } from '../style/inline-style.types';
|
|
3
|
+
import type { RenderEmptyContent } from '../types';
|
|
3
4
|
export type SwitchSize = 'small' | 'medium';
|
|
4
|
-
export type SwitchContent =
|
|
5
|
+
export type SwitchContent = RenderEmptyContent;
|
|
5
6
|
export type SwitchEvent = (MouseEvent | KeyboardEvent) & {
|
|
6
7
|
currentTarget: EventTarget & HTMLButtonElement;
|
|
7
8
|
};
|
|
8
9
|
export type SwitchChangeEventHandler = (checked: boolean, event: SwitchEvent) => void;
|
|
9
10
|
export type SwitchClickEventHandler = SwitchChangeEventHandler;
|
|
10
|
-
export interface SwitchSemanticSlots {
|
|
11
|
-
root?:
|
|
12
|
-
content?:
|
|
13
|
-
indicator?:
|
|
11
|
+
export interface SwitchSemanticSlots<Value = string> {
|
|
12
|
+
root?: Value;
|
|
13
|
+
content?: Value;
|
|
14
|
+
indicator?: Value;
|
|
14
15
|
}
|
|
15
|
-
export type SwitchSemantic = SwitchSemanticSlots | ((info: {
|
|
16
|
+
export type SwitchSemantic<Value = string> = SwitchSemanticSlots<Value> | ((info: {
|
|
16
17
|
props: Omit<SwitchProps, 'size'> & {
|
|
17
18
|
size?: SwitchSize | 'large';
|
|
18
19
|
};
|
|
19
|
-
}) => SwitchSemanticSlots);
|
|
20
|
+
}) => SwitchSemanticSlots<Value>);
|
|
20
21
|
/** Native Switch button with Svelte bindings, source callbacks and previous form/reset contracts. */
|
|
21
|
-
export interface SwitchProps extends Omit<HTMLButtonAttributes, 'type' | 'value' | 'children' | 'class' | 'onchange'> {
|
|
22
|
+
export interface SwitchProps extends Omit<HTMLButtonAttributes, 'type' | 'value' | 'children' | 'class' | 'style' | 'onchange'> {
|
|
22
23
|
/** Bindable; a certain checked takes precedence over value. */
|
|
23
24
|
checked?: boolean | undefined;
|
|
24
25
|
/** Bindable alias versed; checked is used in joint transmission. */
|
|
@@ -47,11 +48,12 @@ export interface SwitchProps extends Omit<HTMLButtonAttributes, 'type' | 'value'
|
|
|
47
48
|
prefixCls?: string;
|
|
48
49
|
rootClassName?: string;
|
|
49
50
|
classNames?: SwitchSemantic;
|
|
50
|
-
styles?: SwitchSemantic
|
|
51
|
+
styles?: SwitchSemantic<CSSStyle>;
|
|
51
52
|
/** Bindable native button; focus/blur is also available via bind:this. */
|
|
52
53
|
nativeElement?: HTMLButtonElement;
|
|
53
54
|
ref?: HTMLButtonElement;
|
|
54
55
|
class?: string;
|
|
56
|
+
style?: CSSStyle;
|
|
55
57
|
}
|
|
56
58
|
/**
|
|
57
59
|
* Inherited Switch design. Root style: config.styles.root, config.style, local styles.root, local
|
|
@@ -59,7 +61,7 @@ export interface SwitchProps extends Omit<HTMLButtonAttributes, 'type' | 'value'
|
|
|
59
61
|
*/
|
|
60
62
|
export interface SwitchConfig {
|
|
61
63
|
class?: string;
|
|
62
|
-
style?:
|
|
64
|
+
style?: CSSStyle;
|
|
63
65
|
classNames?: SwitchSemantic;
|
|
64
|
-
styles?: SwitchSemantic
|
|
66
|
+
styles?: SwitchSemantic<CSSStyle>;
|
|
65
67
|
}
|