@woodger/antd 0.1.1 → 0.1.2
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 +5 -2
- package/dist/alert/Alert.svelte +5 -2
- package/dist/anchor/Anchor.svelte +5 -2
- package/dist/auto-complete/AutoComplete.svelte +3 -2
- package/dist/avatar/Avatar.svelte +3 -2
- package/dist/avatar/AvatarGroup.svelte +3 -1
- package/dist/avatar/avatar.component.d.ts +7 -0
- package/dist/avatar/avatar.component.js +4 -0
- package/dist/badge/Badge.svelte +3 -2
- package/dist/badge/BadgeRibbon.svelte +3 -2
- package/dist/badge/badge.component.d.ts +7 -0
- package/dist/badge/badge.component.js +4 -0
- package/dist/border-beam/BorderBeam.svelte +5 -3
- package/dist/breadcrumb/Breadcrumb.svelte +5 -2
- package/dist/button/Button.svelte +7 -4
- package/dist/calendar/CalendarCore.svelte +3 -1
- package/dist/calendar/calendar.component.d.ts +7 -0
- package/dist/calendar/calendar.component.js +4 -0
- package/dist/card/Card.svelte +6 -3
- package/dist/card/card.component.d.ts +9 -0
- package/dist/card/card.component.js +5 -0
- package/dist/carousel/Carousel.svelte +6 -3
- package/dist/cascader/CascaderCore.svelte +8 -2
- package/dist/cascader/cascader.component.d.ts +11 -0
- package/dist/cascader/cascader.component.js +9 -0
- package/dist/cascader/cascader.types.d.ts +8 -0
- package/dist/checkbox/Checkbox.svelte +9 -4
- package/dist/checkbox/CheckboxGroup.svelte +6 -3
- package/dist/checkbox/checkbox-group.types.d.ts +2 -0
- package/dist/checkbox/checkbox.component.d.ts +7 -0
- package/dist/checkbox/checkbox.component.js +4 -0
- package/dist/collapse/Collapse.svelte +5 -2
- package/dist/collapse/collapse.engine.d.ts +1 -1
- package/dist/color-picker/ColorPicker.svelte +6 -3
- package/dist/color-picker/ColorPickerPresets.svelte +5 -3
- package/dist/component-refs.types.d.ts +45 -0
- package/dist/component-refs.types.js +1 -0
- package/dist/component.types.d.ts +13 -0
- package/dist/component.types.js +1 -0
- package/dist/config-provider/ConfigProvider.svelte +18 -6
- package/dist/config-provider/ConfigProvider.svelte.d.ts +2 -0
- package/dist/config-provider/config-context.d.ts +7 -0
- package/dist/config-provider/config-context.js +1 -0
- package/dist/config-provider/config-provider.component.d.ts +6 -0
- package/dist/config-provider/config-provider.component.js +10 -1
- package/dist/descriptions/Descriptions.svelte +6 -4
- package/dist/dialog/dialog-container.model.svelte.d.ts +1 -1
- package/dist/dialog/dialog-container.model.svelte.js +14 -2
- package/dist/dialog/dialog-focus.dom.d.ts +3 -1
- package/dist/dialog/dialog-focus.dom.js +8 -7
- package/dist/divider/Divider.svelte +5 -2
- package/dist/drawer/Drawer.svelte +3 -2
- package/dist/dropdown/Dropdown.svelte +9 -5
- package/dist/empty/Empty.svelte +5 -2
- package/dist/flex/Flex.svelte +5 -2
- package/dist/float-button/FloatButton.svelte +6 -3
- package/dist/float-button/FloatButtonGroup.svelte +6 -3
- package/dist/float-button/float-button.component.d.ts +9 -0
- package/dist/float-button/float-button.component.js +5 -0
- package/dist/form/Form.svelte +237 -42
- package/dist/form/Form.svelte.d.ts +4 -4
- package/dist/form/FormErrorList.svelte +19 -69
- package/dist/form/FormItem.svelte +271 -62
- package/dist/form/FormItem.svelte.d.ts +31 -5
- package/dist/form/FormItemControlBinding.svelte +68 -0
- package/dist/form/FormItemControlBinding.svelte.d.ts +10 -0
- package/dist/form/FormItemMessages.svelte +142 -0
- package/dist/form/FormItemMessages.svelte.d.ts +23 -0
- package/dist/form/FormList.svelte +49 -4
- package/dist/form/FormMessageMotion.svelte +133 -0
- package/dist/form/FormMessageMotion.svelte.d.ts +18 -0
- package/dist/form/FormProvider.svelte +9 -0
- package/dist/form/FormProvider.svelte.d.ts +4 -0
- package/dist/form/form-context.d.ts +24 -6
- package/dist/form/form-context.js +18 -0
- package/dist/form/form-control.engine.d.ts +2 -0
- package/dist/form/form-control.engine.js +13 -0
- package/dist/form/form-error-list-state.svelte.d.ts +21 -0
- package/dist/form/form-error-list-state.svelte.js +77 -0
- package/dist/form/form-error-list.engine.js +3 -1
- package/dist/form/form-error-list.types.d.ts +3 -2
- package/dist/form/form-field.dom.js +27 -4
- package/dist/form/form-internal.d.ts +32 -8
- package/dist/form/form-internal.js +2 -0
- package/dist/form/form-item-status.d.ts +2 -1
- package/dist/form/form-item-status.js +3 -1
- package/dist/form/form-list-context.d.ts +4 -0
- package/dist/form/form-list-context.js +3 -0
- package/dist/form/form-list.types.d.ts +5 -2
- package/dist/form/form-no-style.engine.d.ts +6 -5
- package/dist/form/form-provider-context.d.ts +13 -0
- package/dist/form/form-provider-context.js +74 -0
- package/dist/form/form-ref.engine.d.ts +5 -0
- package/dist/form/form-ref.engine.js +43 -0
- package/dist/form/form-store.engine.d.ts +3 -1
- package/dist/form/form-store.engine.js +25 -3
- package/dist/form/form-update.engine.d.ts +29 -0
- package/dist/form/form-update.engine.js +40 -0
- package/dist/form/form-watch.svelte.d.ts +25 -0
- package/dist/form/form-watch.svelte.js +56 -0
- package/dist/form/form.component.d.ts +28 -0
- package/dist/form/form.component.js +25 -0
- package/dist/form/form.model.svelte.d.ts +25 -3
- package/dist/form/form.model.svelte.js +728 -179
- package/dist/form/form.types.d.ts +117 -11
- package/dist/form/validation-message.engine.d.ts +17 -3
- package/dist/form/validation-message.engine.js +39 -2
- package/dist/form/validation-messages.types.d.ts +11 -0
- package/dist/form/validation-nested.engine.d.ts +5 -4
- package/dist/form/validation.engine.d.ts +8 -6
- package/dist/form/validation.engine.js +2 -2
- package/dist/grid/Col.svelte +4 -6
- package/dist/grid/Row.svelte +7 -4
- package/dist/grid/grid.svelte.d.ts +7 -0
- package/dist/grid/grid.svelte.js +30 -0
- package/dist/image/Image.svelte +147 -58
- package/dist/image/ImagePreview.svelte +280 -137
- package/dist/image/ImagePreview.svelte.d.ts +10 -2
- package/dist/image/ImagePreviewGroup.svelte +40 -7
- package/dist/image/ImagePreviewIcons.svelte +18 -0
- package/dist/image/ImagePreviewIcons.svelte.d.ts +29 -0
- package/dist/image/ImageProgress.svelte +84 -0
- package/dist/image/ImageProgress.svelte.d.ts +13 -0
- package/dist/image/image-group-context.d.ts +2 -1
- package/dist/image/image-prefix.engine.js +4 -0
- package/dist/image/image-preview-group.types.d.ts +8 -8
- package/dist/image/image-preview-motion.dom.d.ts +16 -0
- package/dist/image/image-preview-motion.dom.js +72 -0
- package/dist/image/image-semantic.engine.d.ts +39 -0
- package/dist/image/image-semantic.engine.js +61 -0
- package/dist/image/image.component.d.ts +7 -0
- package/dist/image/image.component.js +4 -0
- package/dist/image/image.types.d.ts +84 -11
- package/dist/index.d.ts +51 -41
- package/dist/index.js +24 -19
- package/dist/input/Input.svelte +6 -3
- package/dist/input/InputOTP.svelte +5 -2
- package/dist/input/InputPassword.svelte +5 -1
- package/dist/input/InputSearch.svelte +6 -3
- package/dist/input/TextArea.svelte +6 -3
- package/dist/input/input.component.d.ts +13 -0
- package/dist/input/input.component.js +12 -0
- package/dist/input-number/InputNumberControl.svelte +5 -2
- package/dist/layout/Layout.svelte +5 -2
- package/dist/layout/LayoutPart.svelte +7 -2
- package/dist/layout/LayoutSider.svelte +5 -2
- package/dist/layout/layout.component.d.ts +13 -0
- package/dist/layout/layout.component.js +7 -0
- package/dist/listy/Listy.svelte +3 -2
- package/dist/masonry/Masonry.svelte +5 -3
- package/dist/mentions/Mentions.svelte +3 -2
- package/dist/mentions/mentions.component.d.ts +7 -0
- package/dist/mentions/mentions.component.js +4 -0
- package/dist/menu/Menu.svelte +7 -2
- package/dist/message/MessageHolder.svelte +3 -1
- package/dist/modal/Modal.svelte +112 -14
- package/dist/modal/ModalFooterScope.svelte +15 -0
- package/dist/modal/ModalFooterScope.svelte.d.ts +7 -0
- package/dist/modal/modal-layout.engine.d.ts +1 -1
- package/dist/modal/modal-layout.engine.js +20 -3
- package/dist/modal/modal-motion.dom.d.ts +1 -0
- package/dist/modal/modal-motion.dom.js +21 -5
- package/dist/modal/modal-named-motion.dom.d.ts +1 -1
- package/dist/modal/modal-named-motion.dom.js +1 -2
- package/dist/modal/modal-semantic.engine.d.ts +1 -1
- package/dist/modal/modal.types.d.ts +3 -1
- package/dist/notification/NotificationHolder.svelte +3 -1
- package/dist/pagination/Pagination.svelte +3 -2
- package/dist/picker/DatePicker.svelte.d.ts +1 -1
- package/dist/picker/RangePickerCore.svelte +3 -1
- package/dist/picker/SinglePicker.svelte +3 -1
- package/dist/picker/picker-popup.model.svelte.d.ts +3 -1
- package/dist/picker/time-picker.component.d.ts +4 -1
- package/dist/picker/time-picker.component.js +3 -1
- package/dist/popconfirm/Popconfirm.svelte +6 -1
- package/dist/popconfirm/popconfirm.types.d.ts +2 -0
- package/dist/popover/Popover.svelte +31 -13
- package/dist/popover/popover.types.d.ts +2 -0
- package/dist/popup/popup-container.model.svelte.d.ts +4 -1
- package/dist/popup/popup-container.model.svelte.js +7 -2
- package/dist/popup/popup-geometry.dom.d.ts +8 -0
- package/dist/popup/popup-geometry.dom.js +29 -0
- package/dist/popup/popup.dom.d.ts +3 -0
- package/dist/popup/popup.dom.js +3 -1
- package/dist/progress/Progress.svelte +5 -2
- package/dist/progress/progress-circle.engine.d.ts +1 -1
- package/dist/qr-code/QRCode.svelte +5 -3
- package/dist/radio/Radio.svelte +9 -4
- package/dist/radio/RadioGroup.svelte +6 -3
- package/dist/radio/radio.component.d.ts +9 -0
- package/dist/radio/radio.component.js +5 -0
- package/dist/rate/Rate.svelte +3 -2
- package/dist/result/Result.svelte +5 -2
- package/dist/segmented/Segmented.svelte +5 -2
- package/dist/select/Select.svelte +3 -2
- package/dist/select/select-style.engine.d.ts +1 -1
- package/dist/skeleton/Skeleton.svelte +5 -2
- package/dist/skeleton/SkeletonElement.svelte +5 -2
- package/dist/slider/SliderRange.svelte +9 -41
- package/dist/slider/SliderSingle.svelte +35 -30
- package/dist/slider/SliderTooltip.svelte +224 -0
- package/dist/slider/SliderTooltip.svelte.d.ts +17 -0
- package/dist/space/Space.svelte +6 -3
- package/dist/space/SpaceAddon.svelte +6 -3
- package/dist/space/SpaceCompact.svelte +5 -2
- package/dist/space/space.component.d.ts +9 -0
- package/dist/space/space.component.js +5 -0
- package/dist/spin/Spin.svelte +5 -2
- package/dist/splitter/Splitter.svelte +6 -3
- package/dist/splitter/SplitterArrow.svelte.d.ts +1 -1
- package/dist/statistic/Statistic.svelte +5 -3
- package/dist/statistic/statistic.component.d.ts +7 -0
- package/dist/statistic/statistic.component.js +4 -0
- package/dist/steps/Steps.svelte +5 -2
- package/dist/styles.css +1 -0
- package/dist/styles.css.d.ts +1 -0
- package/dist/switch/Switch.svelte +5 -2
- package/dist/table/Table.svelte +3 -2
- package/dist/table/table-cell.engine.d.ts +6 -6
- package/dist/table/table.types.d.ts +2 -0
- package/dist/tabs/Tabs.svelte +6 -4
- package/dist/tag/CheckableTag.svelte +3 -1
- package/dist/tag/CheckableTagGroup.svelte +3 -1
- package/dist/tag/Tag.svelte +3 -1
- package/dist/tag/tag.component.d.ts +10 -0
- package/dist/tag/tag.component.js +5 -0
- package/dist/theme/theme-context.svelte.d.ts +2 -0
- package/dist/theme/theme-context.svelte.js +6 -1
- package/dist/timeline/Timeline.svelte +5 -2
- package/dist/tooltip/Tooltip.svelte +16 -7
- package/dist/tooltip/TooltipPopup.svelte +22 -6
- package/dist/tooltip/tooltip-popup.types.d.ts +6 -0
- package/dist/tooltip/tooltip.types.d.ts +16 -0
- package/dist/tour/Tour.svelte +3 -1
- package/dist/transfer/Transfer.svelte +3 -1
- package/dist/transfer/TransferCheckbox.svelte +3 -1
- package/dist/transfer/TransferPagination.svelte +3 -1
- package/dist/tree/Tree.svelte +3 -2
- package/dist/tree/tree.component.d.ts +10 -0
- package/dist/tree/tree.component.js +5 -0
- package/dist/tree-select/TreeSelectControl.svelte +5 -4
- package/dist/types.d.ts +2 -2
- package/dist/typography/TypographyEditable.svelte +5 -2
- package/dist/typography/TypographyElement.svelte +6 -3
- package/dist/typography/TypographyTooltip.svelte +19 -8
- package/dist/typography/typography.component.d.ts +13 -0
- package/dist/typography/typography.component.js +7 -0
- package/dist/upload/Upload.svelte +44 -4
- package/dist/upload/Upload.svelte.d.ts +1 -1
- package/dist/upload/UploadDragger.svelte +3 -2
- package/dist/upload/UploadDragger.svelte.d.ts +4 -4
- package/dist/upload/UploadList.svelte.d.ts +1 -1
- package/dist/upload/UploadListItem.svelte +52 -11
- package/dist/upload/upload.component.d.ts +9 -0
- package/dist/upload/upload.component.js +5 -0
- package/dist/upload/upload.engine.d.ts +8 -2
- package/dist/upload/upload.engine.js +80 -4
- package/dist/upload/upload.types.d.ts +2 -1
- package/dist/vendor/compute-scroll-into-view.d.ts +3 -1
- package/dist/vendor/compute-scroll-into-view.js +3 -2
- package/dist/vendor/dropdown-motion.css +105 -0
- package/dist/vendor/image-prefix.css.js +3 -3
- package/dist/vendor/image.css +16 -2
- package/dist/version.d.ts +2 -0
- package/dist/version.js +3 -0
- package/package.json +15 -4
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// Slider owns visibility. The tooltip adapts input actions, tracks a pointer point per handle,
|
|
3
|
+
// and shares popup motion and geometry with standalone Tooltip.
|
|
4
|
+
import { onDestroy } from 'svelte';
|
|
5
|
+
import { on } from 'svelte/events';
|
|
6
|
+
import { useConfig } from '../config-provider/config-context';
|
|
7
|
+
import { getPopupEventPoint, type PopupPoint } from '../popup/popup-geometry.dom';
|
|
8
|
+
import { getTooltipActions, getTooltipDelay, hasTooltipContent } from '../tooltip/tooltip.engine';
|
|
9
|
+
import type { SliderTooltipConfig, TooltipPlacement } from '../tooltip/tooltip.types';
|
|
10
|
+
import TooltipPopup from '../tooltip/TooltipPopup.svelte';
|
|
11
|
+
|
|
12
|
+
let {
|
|
13
|
+
options,
|
|
14
|
+
anchor,
|
|
15
|
+
trigger,
|
|
16
|
+
ownerClassName,
|
|
17
|
+
title,
|
|
18
|
+
requestTitle = title,
|
|
19
|
+
open,
|
|
20
|
+
placement,
|
|
21
|
+
listenToInput = false,
|
|
22
|
+
onDismiss,
|
|
23
|
+
onHoverChange
|
|
24
|
+
}: {
|
|
25
|
+
options?: SliderTooltipConfig | false;
|
|
26
|
+
anchor?: HTMLDivElement;
|
|
27
|
+
trigger?: HTMLInputElement;
|
|
28
|
+
ownerClassName: string;
|
|
29
|
+
title: string;
|
|
30
|
+
requestTitle?: string;
|
|
31
|
+
open: boolean;
|
|
32
|
+
placement: TooltipPlacement;
|
|
33
|
+
listenToInput?: boolean;
|
|
34
|
+
onDismiss: () => void;
|
|
35
|
+
onHoverChange?: (hovered: boolean) => void;
|
|
36
|
+
} = $props();
|
|
37
|
+
|
|
38
|
+
const config = useConfig();
|
|
39
|
+
const tooltip = $derived(options === false ? undefined : options);
|
|
40
|
+
const tooltipTrigger = $derived(tooltip?.trigger ?? config.tooltip?.trigger ?? 'hover');
|
|
41
|
+
const actions = $derived(getTooltipActions(tooltipTrigger, tooltip?.showAction, tooltip?.hideAction));
|
|
42
|
+
const enterDelay = $derived(tooltip?.mouseEnterDelay ?? config.tooltip?.mouseEnterDelay ?? 0.1);
|
|
43
|
+
const leaveDelay = $derived(tooltip?.mouseLeaveDelay ?? config.tooltip?.mouseLeaveDelay ?? 0.1);
|
|
44
|
+
const clickToHide = $derived(actions.hide.has('click') || actions.hide.has('contextMenu'));
|
|
45
|
+
const delegated = $derived(tooltip?.onOpenChange !== undefined || tooltip?.trigger !== undefined
|
|
46
|
+
|| tooltip?.showAction !== undefined || tooltip?.hideAction !== undefined);
|
|
47
|
+
const visible = $derived(open && !tooltip?.disabled);
|
|
48
|
+
let anchorPoint = $state.raw<PopupPoint>();
|
|
49
|
+
let lastInput: HTMLInputElement | undefined;
|
|
50
|
+
let pending: ReturnType<typeof setTimeout> | undefined;
|
|
51
|
+
let active = true;
|
|
52
|
+
|
|
53
|
+
$effect(() => {
|
|
54
|
+
const input = trigger;
|
|
55
|
+
const withActions = delegated;
|
|
56
|
+
if (input !== lastInput) {
|
|
57
|
+
lastInput = input;
|
|
58
|
+
anchorPoint = undefined;
|
|
59
|
+
}
|
|
60
|
+
if (!input || !listenToInput) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
return connectInput(input, withActions);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
onDestroy(() => {
|
|
67
|
+
active = false;
|
|
68
|
+
cancelRequest();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
function cancelRequest() {
|
|
72
|
+
if (pending !== undefined) clearTimeout(pending);
|
|
73
|
+
pending = undefined;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function notify(next: boolean, current: boolean) {
|
|
77
|
+
if (!active || !trigger?.isConnected || next === current || !hasTooltipContent(requestTitle)) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const callback = tooltip?.onOpenChange;
|
|
81
|
+
callback?.(next);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Tooltip actions ask the owner for changes. Delayed requests compare at delivery time.
|
|
85
|
+
function request(next: boolean, delay = 0, current = open) {
|
|
86
|
+
cancelRequest();
|
|
87
|
+
if (!tooltip?.onOpenChange) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (delay === 0) {
|
|
91
|
+
notify(next, current);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
pending = setTimeout(() => {
|
|
96
|
+
pending = undefined;
|
|
97
|
+
notify(next, open);
|
|
98
|
+
}, delay);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Active range tooltips belong to the hidden upstream handle, so they skip these listeners.
|
|
102
|
+
function connectInput(input: HTMLInputElement, withActions: boolean) {
|
|
103
|
+
let connected = true;
|
|
104
|
+
let touched = false;
|
|
105
|
+
|
|
106
|
+
function hover(event: MouseEvent, next: boolean) {
|
|
107
|
+
const currentActions = next ? actions.show : actions.hide;
|
|
108
|
+
if (touched || !currentActions.has('hover')) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (next) {
|
|
113
|
+
anchorPoint = getPopupEventPoint(event);
|
|
114
|
+
}
|
|
115
|
+
request(next, getTooltipDelay(next ? enterDelay : leaveDelay));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function focus() {
|
|
119
|
+
if (actions.show.has('focus')) request(true, getTooltipDelay(tooltip?.focusDelay, 0));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function blur(event: FocusEvent) {
|
|
123
|
+
if (!input.isConnected || !actions.hide.has('focus')) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const current = open;
|
|
127
|
+
const delay = getTooltipDelay(tooltip?.blurDelay, 0);
|
|
128
|
+
if (event.relatedTarget) {
|
|
129
|
+
request(false, delay, current);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
// A native blur also fires when the focused input is removed.
|
|
133
|
+
queueMicrotask(() => {
|
|
134
|
+
if (connected && input.isConnected) request(false, delay, current);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function click(event: MouseEvent) {
|
|
140
|
+
const show = actions.show.has('click');
|
|
141
|
+
if (!show && !clickToHide) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (visible && clickToHide) request(false);
|
|
145
|
+
else if (!visible && show) {
|
|
146
|
+
anchorPoint = getPopupEventPoint(event);
|
|
147
|
+
request(true);
|
|
148
|
+
}
|
|
149
|
+
touched = false;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function contextMenu(event: MouseEvent) {
|
|
153
|
+
if (!actions.show.has('contextMenu')) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
event.preventDefault();
|
|
157
|
+
if (visible && actions.hide.has('contextMenu')) request(false);
|
|
158
|
+
else {
|
|
159
|
+
anchorPoint = getPopupEventPoint(event);
|
|
160
|
+
request(true);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function touch() {
|
|
165
|
+
if (!actions.show.has('touch') && !actions.hide.has('touch')) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
touched = true;
|
|
169
|
+
if (visible && actions.hide.has('touch')) request(false);
|
|
170
|
+
else if (!visible && actions.show.has('touch')) request(true);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const capture = { capture: true };
|
|
174
|
+
const disconnect = [on(input, 'pointerenter', event => hover(event, true), capture)];
|
|
175
|
+
if (withActions) {
|
|
176
|
+
disconnect.push(
|
|
177
|
+
on(input, 'mouseenter', event => hover(event, true), capture),
|
|
178
|
+
on(input, 'pointerleave', event => hover(event, false), capture),
|
|
179
|
+
on(input, 'mouseleave', event => hover(event, false), capture),
|
|
180
|
+
on(input, 'focus', focus, capture),
|
|
181
|
+
on(input, 'blur', blur, capture),
|
|
182
|
+
on(input, 'click', click, capture),
|
|
183
|
+
on(input, 'contextmenu', contextMenu, capture),
|
|
184
|
+
on(input, 'touchstart', touch, { ...capture, passive: true })
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return () => {
|
|
189
|
+
connected = false;
|
|
190
|
+
for (const dispose of disconnect) dispose();
|
|
191
|
+
cancelRequest();
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function hoverPopup(next: boolean) {
|
|
196
|
+
const currentActions = next ? actions.show : actions.hide;
|
|
197
|
+
if (currentActions.has('hover')) request(next, getTooltipDelay(next ? enterDelay : leaveDelay));
|
|
198
|
+
onHoverChange?.(next);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function dismiss(reason: 'escape' | 'outside') {
|
|
202
|
+
if (!delegated) {
|
|
203
|
+
onDismiss();
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
if (reason === 'escape' || clickToHide || actions.hide.has('touch')) request(false);
|
|
207
|
+
}
|
|
208
|
+
</script>
|
|
209
|
+
|
|
210
|
+
<TooltipPopup {title} {open} {anchor} describe={trigger} {trigger} {placement}
|
|
211
|
+
{ownerClassName} alignPoint={tooltip?.alignPoint} {anchorPoint}
|
|
212
|
+
arrow={options === false ? false : tooltip?.arrow}
|
|
213
|
+
color={tooltip?.color} prefixCls={tooltip?.prefixCls} openClassName={tooltip?.openClassName}
|
|
214
|
+
fresh={tooltip?.fresh} id={tooltip?.id} disabled={tooltip?.disabled}
|
|
215
|
+
unique={tooltip?.unique} forceRender={tooltip?.forceRender} zIndex={tooltip?.zIndex}
|
|
216
|
+
align={tooltip?.align} builtinPlacements={tooltip?.builtinPlacements}
|
|
217
|
+
onPopupAlign={tooltip?.onPopupAlign} destroyOnHidden={tooltip?.destroyOnHidden}
|
|
218
|
+
autoAdjustOverflow={tooltip?.autoAdjustOverflow}
|
|
219
|
+
getPopupContainer={tooltip?.getPopupContainer || config.getPopupContainer}
|
|
220
|
+
semanticProps={{ ...tooltip, title, open, placement, trigger: tooltipTrigger,
|
|
221
|
+
arrow: options === false ? false : tooltip?.arrow,
|
|
222
|
+
mouseEnterDelay: enterDelay, mouseLeaveDelay: leaveDelay }}
|
|
223
|
+
onViewportChange={clickToHide ? () => request(false) : undefined}
|
|
224
|
+
onDismiss={dismiss} onHoverChange={hoverPopup} />
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SliderTooltipConfig, TooltipPlacement } from '../tooltip/tooltip.types';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
options?: SliderTooltipConfig | false;
|
|
4
|
+
anchor?: HTMLDivElement;
|
|
5
|
+
trigger?: HTMLInputElement;
|
|
6
|
+
ownerClassName: string;
|
|
7
|
+
title: string;
|
|
8
|
+
requestTitle?: string;
|
|
9
|
+
open: boolean;
|
|
10
|
+
placement: TooltipPlacement;
|
|
11
|
+
listenToInput?: boolean;
|
|
12
|
+
onDismiss: () => void;
|
|
13
|
+
onHoverChange?: (hovered: boolean) => void;
|
|
14
|
+
};
|
|
15
|
+
declare const SliderTooltip: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
16
|
+
type SliderTooltip = ReturnType<typeof SliderTooltip>;
|
|
17
|
+
export default SliderTooltip;
|
package/dist/space/Space.svelte
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { useConfig } from '../config-provider/config-context';
|
|
3
3
|
import { useComponentTheme } from '../theme/theme-component.svelte';
|
|
4
4
|
import { getSpacePrefixCss } from './space-prefix.engine';
|
|
5
|
+
import { useRuntimeStyles } from '../theme/theme-context.svelte';
|
|
5
6
|
import ThemeScopeStyle from '../theme/ThemeScopeStyle.svelte';
|
|
6
7
|
import { spaceEntries, spaceGap, spaceHasContent, spaceOrientation } from './space.engine';
|
|
7
8
|
import { connectFeedbackFocus } from '../feedback.dom';
|
|
@@ -28,7 +29,9 @@
|
|
|
28
29
|
const config = useConfig();
|
|
29
30
|
let componentPrefix = $derived(config.getPrefixCls('space', prefixCls));
|
|
30
31
|
let rootPrefix = $derived(config.getPrefixCls());
|
|
31
|
-
|
|
32
|
+
const runtimeStyles = useRuntimeStyles();
|
|
33
|
+
const hasCustomPrefix = $derived(componentPrefix !== 'ant-space' || rootPrefix !== 'ant');
|
|
34
|
+
let prefixCss = $derived(runtimeStyles && getSpacePrefixCss(componentPrefix, rootPrefix));
|
|
32
35
|
const componentTheme = useComponentTheme('Space');
|
|
33
36
|
let size = $derived(customizeSize === undefined ? config.space?.size ?? 'small' : customizeSize);
|
|
34
37
|
let entries = $derived(spaceEntries(items, children));
|
|
@@ -144,8 +147,8 @@
|
|
|
144
147
|
className,
|
|
145
148
|
rootClassName,
|
|
146
149
|
classes.root
|
|
147
|
-
]} data-ant-space-prefix={
|
|
148
|
-
data-ant-space-global={
|
|
150
|
+
]} data-ant-space-prefix={hasCustomPrefix ? componentPrefix : undefined}
|
|
151
|
+
data-ant-space-global={hasCustomPrefix ? rootPrefix : undefined}
|
|
149
152
|
style={[componentTheme.style, wrap && 'flex-wrap:wrap', gap.style, slots.root].filter(
|
|
150
153
|
Boolean
|
|
151
154
|
).join(
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { useConfig } from '../config-provider/config-context';
|
|
3
3
|
import { useComponentTheme } from '../theme/theme-component.svelte';
|
|
4
4
|
import { getSpaceAddonPrefixCss } from './space-addon-prefix.engine';
|
|
5
|
+
import { useRuntimeStyles } from '../theme/theme-context.svelte';
|
|
5
6
|
import ThemeScopeStyle from '../theme/ThemeScopeStyle.svelte';
|
|
6
7
|
import { useCompact } from './space-compact-context';
|
|
7
8
|
import { compactClasses } from './space-compact.engine';
|
|
@@ -20,15 +21,17 @@
|
|
|
20
21
|
const config = useConfig();
|
|
21
22
|
let componentPrefix = $derived(config.getPrefixCls('space-addon', prefixCls));
|
|
22
23
|
let rootPrefix = $derived(config.getPrefixCls());
|
|
23
|
-
|
|
24
|
+
const runtimeStyles = useRuntimeStyles();
|
|
25
|
+
const hasCustomPrefix = $derived(componentPrefix !== 'ant-space-addon' || rootPrefix !== 'ant');
|
|
26
|
+
let prefixCss = $derived(runtimeStyles && getSpaceAddonPrefixCss(componentPrefix, rootPrefix));
|
|
24
27
|
const componentTheme = useComponentTheme('Addon');
|
|
25
28
|
const compact = useCompact();
|
|
26
29
|
let classes = $derived(compactClasses(componentPrefix, config.direction, compact));
|
|
27
30
|
</script>
|
|
28
31
|
|
|
29
32
|
{#if prefixCss}<ThemeScopeStyle css={prefixCss} scope={`space-addon-prefix:${componentPrefix}:${rootPrefix}`} />{/if}<div {...rest} bind:this={nativeElement} dir={config.direction}
|
|
30
|
-
data-ant-space-addon-prefix={
|
|
31
|
-
data-ant-space-addon-vars={
|
|
33
|
+
data-ant-space-addon-prefix={hasCustomPrefix ? componentPrefix : undefined}
|
|
34
|
+
data-ant-space-addon-vars={hasCustomPrefix ? rootPrefix.replace(/\./g, '') : undefined}
|
|
32
35
|
class={[
|
|
33
36
|
`${componentPrefix} ant-space-addon-css-var`,
|
|
34
37
|
componentTheme.className,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useConfig } from '../config-provider/config-context';
|
|
3
3
|
import { getSpaceCompactPrefixCss } from './space-compact-prefix.engine';
|
|
4
|
+
import { useRuntimeStyles } from '../theme/theme-context.svelte';
|
|
4
5
|
import ThemeScopeStyle from '../theme/ThemeScopeStyle.svelte';
|
|
5
6
|
import { useCompact } from './space-compact-context';
|
|
6
7
|
import { compactEntries } from './space-compact.engine';
|
|
@@ -25,7 +26,9 @@
|
|
|
25
26
|
}: SpaceCompactProps = $props();
|
|
26
27
|
const config = useConfig();
|
|
27
28
|
let componentPrefix = $derived(config.getPrefixCls('space-compact', prefixCls));
|
|
28
|
-
|
|
29
|
+
const runtimeStyles = useRuntimeStyles();
|
|
30
|
+
const hasCustomPrefix = $derived(componentPrefix !== 'ant-space-compact');
|
|
31
|
+
let prefixCss = $derived(runtimeStyles && getSpaceCompactPrefixCss(componentPrefix));
|
|
29
32
|
const parent = useCompact();
|
|
30
33
|
let entries = $derived(compactEntries(items, children));
|
|
31
34
|
let actualOrientation = $derived(spaceOrientation(orientation, vertical));
|
|
@@ -78,7 +81,7 @@
|
|
|
78
81
|
config.direction === 'rtl' && `${componentPrefix}-rtl`,
|
|
79
82
|
className,
|
|
80
83
|
rootClassName
|
|
81
|
-
]} data-ant-space-compact-prefix={
|
|
84
|
+
]} data-ant-space-compact-prefix={hasCustomPrefix ? componentPrefix : undefined} {style}>
|
|
82
85
|
{#each entries as item, index (item.key)}
|
|
83
86
|
<SpaceCompactItem children={item.children} size={actualSize} orientation={actualOrientation} first={index === 0 && (!parent || parent.first)} last={index === entries.length - 1 && (!parent || parent.last)} />
|
|
84
87
|
{/each}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import SpaceRoot from './Space.svelte';
|
|
2
|
+
import Compact from './SpaceCompact.svelte';
|
|
3
|
+
import Addon from './SpaceAddon.svelte';
|
|
4
|
+
declare const Space: typeof SpaceRoot & {
|
|
5
|
+
Compact: typeof Compact;
|
|
6
|
+
Addon: typeof Addon;
|
|
7
|
+
};
|
|
8
|
+
type Space = SpaceRoot;
|
|
9
|
+
export default Space;
|
package/dist/spin/Spin.svelte
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import { resolveSpinIndicator } from './spin-indicator';
|
|
9
9
|
import { getSpinPrefixCss } from './spin-prefix.engine';
|
|
10
10
|
import SpinProgress from './SpinProgress.svelte';
|
|
11
|
+
import { useRuntimeStyles } from '../theme/theme-context.svelte';
|
|
11
12
|
import ThemeScopeStyle from '../theme/ThemeScopeStyle.svelte';
|
|
12
13
|
import { ruRU } from '../types';
|
|
13
14
|
import type { SpinProps, SpinSemanticInfo, SpinSemanticSlots } from './spin.types';
|
|
@@ -51,7 +52,9 @@
|
|
|
51
52
|
const focus = createSpinFocus();
|
|
52
53
|
let visible = $derived(model.visible);
|
|
53
54
|
let prefix = $derived(config.getPrefixCls('spin', prefixCls));
|
|
54
|
-
|
|
55
|
+
const runtimeStyles = useRuntimeStyles();
|
|
56
|
+
const hasCustomPrefix = $derived(prefix !== 'ant-spin');
|
|
57
|
+
let prefixCss = $derived(runtimeStyles && getSpinPrefixCss(prefix));
|
|
55
58
|
let resolvedSize = $derived(size ?? config.explicitComponentSize);
|
|
56
59
|
let resolvedPercent = $derived(percent === 'auto' ? mockPercent : percent);
|
|
57
60
|
let hasChildren = $derived(children !== undefined);
|
|
@@ -229,7 +232,7 @@
|
|
|
229
232
|
|
|
230
233
|
{#if prefixCss}<ThemeScopeStyle css={prefixCss} scope={`spin-prefix:${prefix}`} />{/if}<!-- svelte-ignore a11y_no_noninteractive_tabindex (Negative tabindex temporarily holds focus outside inert children.) --><div
|
|
231
234
|
bind:this={host} {id} data-ant-spin-root
|
|
232
|
-
data-ant-spin-prefix={
|
|
235
|
+
data-ant-spin-prefix={hasCustomPrefix ? prefix : undefined}
|
|
233
236
|
role={ariaHidden ? undefined : hasChildren ? 'group' : announce ? 'status' : undefined}
|
|
234
237
|
aria-live={!hasChildren && announce ? 'polite' : undefined}
|
|
235
238
|
aria-atomic={!hasChildren && announce || undefined}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { useConfig } from '../config-provider/config-context';
|
|
3
3
|
import { useComponentTheme } from '../theme/theme-component.svelte';
|
|
4
4
|
import { getSplitterPrefixCss } from './splitter-prefix.engine';
|
|
5
|
+
import { useRuntimeStyles } from '../theme/theme-context.svelte';
|
|
5
6
|
import ThemeScopeStyle from '../theme/ThemeScopeStyle.svelte';
|
|
6
7
|
import { getSplitterAria, splitterDraggerClasses } from './splitter.engine';
|
|
7
8
|
import { observeSplitterSize } from './splitter.dom';
|
|
@@ -36,7 +37,9 @@
|
|
|
36
37
|
const config = useConfig();
|
|
37
38
|
let componentPrefix = $derived(config.getPrefixCls('splitter', prefixCls));
|
|
38
39
|
let rootPrefix = $derived(config.getPrefixCls());
|
|
39
|
-
|
|
40
|
+
const runtimeStyles = useRuntimeStyles();
|
|
41
|
+
const hasCustomPrefix = $derived(componentPrefix !== 'ant-splitter' || rootPrefix !== 'ant');
|
|
42
|
+
let prefixCss = $derived(runtimeStyles && getSplitterPrefixCss(componentPrefix, rootPrefix));
|
|
40
43
|
const componentTheme = useComponentTheme('Splitter');
|
|
41
44
|
let actualOrientation = $derived(spaceOrientation(orientation, vertical));
|
|
42
45
|
let isVertical = $derived(actualOrientation === 'vertical');
|
|
@@ -106,8 +109,8 @@
|
|
|
106
109
|
{#if prefixCss}<ThemeScopeStyle css={prefixCss} scope={`splitter-prefix:${componentPrefix}:${rootPrefix}`} />{/if}<div
|
|
107
110
|
bind:this={nativeElement}
|
|
108
111
|
data-ant-splitter-native={!componentTheme.className || undefined}
|
|
109
|
-
data-ant-splitter-prefix={
|
|
110
|
-
data-ant-splitter-vars={
|
|
112
|
+
data-ant-splitter-prefix={hasCustomPrefix ? componentPrefix : undefined}
|
|
113
|
+
data-ant-splitter-vars={hasCustomPrefix ? rootPrefix.replace(/\./g, '') : undefined}
|
|
111
114
|
class={[
|
|
112
115
|
componentPrefix,
|
|
113
116
|
componentTheme.className,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useConfig } from '../config-provider/config-context';
|
|
3
3
|
import { useComponentTheme } from '../theme/theme-component.svelte';
|
|
4
4
|
import { componentThemeVariables } from '../theme/theme-component-style.engine';
|
|
5
|
-
import { useDesignTokenContext } from '../theme/theme-context.svelte';
|
|
5
|
+
import { useDesignTokenContext, useRuntimeStyles } from '../theme/theme-context.svelte';
|
|
6
6
|
import { formatStatisticValue } from './statistic.engine';
|
|
7
7
|
import { mergeComponentSemantics } from '../style/semantic-style.engine';
|
|
8
8
|
import { getStatisticPrefixCss } from './statistic-prefix.engine';
|
|
@@ -34,7 +34,9 @@
|
|
|
34
34
|
}: StatisticProps = $props();
|
|
35
35
|
const config = useConfig();
|
|
36
36
|
let componentPrefix = $derived(config.getPrefixCls('statistic', prefixCls));
|
|
37
|
-
|
|
37
|
+
const runtimeStyles = useRuntimeStyles();
|
|
38
|
+
const hasCustomPrefix = $derived(componentPrefix !== 'ant-statistic');
|
|
39
|
+
let prefixCss = $derived(runtimeStyles && getStatisticPrefixCss(componentPrefix));
|
|
38
40
|
const componentTheme = useComponentTheme('Statistic');
|
|
39
41
|
const designTokens = useDesignTokenContext();
|
|
40
42
|
let skeletonPadding = $derived(componentThemeVariables('Skeleton', designTokens.state.token)
|
|
@@ -99,7 +101,7 @@
|
|
|
99
101
|
{/snippet}
|
|
100
102
|
|
|
101
103
|
{#if prefixCss}<ThemeScopeStyle css={prefixCss} scope={`statistic-prefix:${componentPrefix}`} />{/if}<div {...rest} bind:this={nativeElement} dir={config.direction}
|
|
102
|
-
data-ant-statistic-prefix={
|
|
104
|
+
data-ant-statistic-prefix={hasCustomPrefix ? componentPrefix : undefined}
|
|
103
105
|
class={[
|
|
104
106
|
componentPrefix, 'ant-statistic-css-var',
|
|
105
107
|
componentTheme.className,
|
package/dist/steps/Steps.svelte
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { useComponentTheme } from '../theme/theme-component.svelte';
|
|
5
5
|
import { mergeComponentSemantics } from '../style/semantic-style.engine';
|
|
6
6
|
import { getStepsPrefixCss } from './steps-prefix.engine';
|
|
7
|
+
import { useRuntimeStyles } from '../theme/theme-context.svelte';
|
|
7
8
|
import ThemeScopeStyle from '../theme/ThemeScopeStyle.svelte';
|
|
8
9
|
import StepItem from './StepItem.svelte';
|
|
9
10
|
import { connectStepsFocus } from './steps.dom';
|
|
@@ -47,7 +48,9 @@
|
|
|
47
48
|
}: StepsProps = $props();
|
|
48
49
|
const config = useConfig();
|
|
49
50
|
let componentPrefix = $derived(config.getPrefixCls('steps', prefixCls));
|
|
50
|
-
|
|
51
|
+
const runtimeStyles = useRuntimeStyles();
|
|
52
|
+
const hasCustomPrefix = $derived(componentPrefix !== 'ant-steps');
|
|
53
|
+
let prefixCss = $derived(runtimeStyles && getStepsPrefixCss(componentPrefix));
|
|
51
54
|
const componentTheme = useComponentTheme('Steps');
|
|
52
55
|
const composition = useStepsComposition();
|
|
53
56
|
const generatedId = $props.id();
|
|
@@ -183,7 +186,7 @@
|
|
|
183
186
|
</style>
|
|
184
187
|
|
|
185
188
|
{#if prefixCss}<ThemeScopeStyle css={prefixCss} scope={`steps-prefix:${componentPrefix}`} />{/if}<ol {...rest} bind:this={nativeElement} data-ant-steps-root=""
|
|
186
|
-
data-ant-steps-prefix={
|
|
189
|
+
data-ant-steps-prefix={hasCustomPrefix ? componentPrefix : undefined}
|
|
187
190
|
data-ant-steps-orientation={layout.vertical ? 'vertical' : 'horizontal'}
|
|
188
191
|
id={composition?.timeline ? id : rootId} role="list" aria-label={ariaLabel
|
|
189
192
|
?? (ariaLabelledby || composition?.timeline
|
package/dist/styles.css
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
@import './popup/overlay-motion.css';
|
|
12
12
|
@import './vendor/overlay-color.css';
|
|
13
13
|
@import './vendor/dropdown.css';
|
|
14
|
+
@import './vendor/dropdown-motion.css';
|
|
14
15
|
@import './vendor/tabs.css';
|
|
15
16
|
@import './vendor/tabs-editable.css';
|
|
16
17
|
@import './vendor/tabs-layout.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import { useWave } from '../wave/wave.svelte';
|
|
12
12
|
import { useForm, useFormField } from '../form/form-context';
|
|
13
13
|
import { getSwitchPrefixCss } from './switch-prefix.engine';
|
|
14
|
+
import { useRuntimeStyles } from '../theme/theme-context.svelte';
|
|
14
15
|
import ThemeScopeStyle from '../theme/ThemeScopeStyle.svelte';
|
|
15
16
|
import Icon from '../icon/Icon.svelte';
|
|
16
17
|
import type { SwitchEvent, SwitchProps } from './switch.types';
|
|
@@ -33,7 +34,9 @@
|
|
|
33
34
|
let alive = true;
|
|
34
35
|
let control = $derived(nativeElement);
|
|
35
36
|
let prefix = $derived(config.getPrefixCls('switch', props.prefixCls));
|
|
36
|
-
|
|
37
|
+
const runtimeStyles = useRuntimeStyles();
|
|
38
|
+
const hasCustomPrefix = $derived(prefix !== 'ant-switch');
|
|
39
|
+
let prefixCss = $derived(runtimeStyles && getSwitchPrefixCss(prefix));
|
|
37
40
|
let resolvedChecked = $derived(checked ?? value ?? initialDefault);
|
|
38
41
|
let resolvedDisabled = $derived(
|
|
39
42
|
Boolean(props.loading || (props.disabled ?? field?.disabled ?? form?.disabled
|
|
@@ -196,7 +199,7 @@
|
|
|
196
199
|
{...attributes}
|
|
197
200
|
bind:this={nativeElement}
|
|
198
201
|
data-ant-switch-root
|
|
199
|
-
data-ant-switch-prefix={
|
|
202
|
+
data-ant-switch-prefix={hasCustomPrefix ? prefix : undefined}
|
|
200
203
|
{@attach wave}
|
|
201
204
|
type="button"
|
|
202
205
|
role="switch"
|
package/dist/table/Table.svelte
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { getTablePrefixCss, getTableSpinTheme } from './table-prefix.engine';
|
|
8
8
|
import ThemeScopeStyle from '../theme/ThemeScopeStyle.svelte';
|
|
9
9
|
import { useComponentTheme } from '../theme/theme-component.svelte';
|
|
10
|
-
import { useDesignTokenContext } from '../theme/theme-context.svelte';
|
|
10
|
+
import { useDesignTokenContext, useRuntimeStyles } from '../theme/theme-context.svelte';
|
|
11
11
|
import { createBreakpoint } from '../grid/grid-breakpoint.model.svelte';
|
|
12
12
|
import { getGridMediaQueries } from '../grid/grid.engine';
|
|
13
13
|
import { getPaginationState } from '../pagination/pagination.engine';
|
|
@@ -164,7 +164,8 @@
|
|
|
164
164
|
let prefix = $derived(config.getPrefixCls('table', prefixCls));
|
|
165
165
|
let rootPrefix = $derived(config.getPrefixCls());
|
|
166
166
|
let dropdownPrefix = $derived(config.getPrefixCls('dropdown', dropdownPrefixCls));
|
|
167
|
-
|
|
167
|
+
const runtimeStyles = useRuntimeStyles();
|
|
168
|
+
let prefixCss = $derived(runtimeStyles && getTablePrefixCss(prefix, rootPrefix));
|
|
168
169
|
const componentTheme = useComponentTheme('Table');
|
|
169
170
|
const designTheme = useDesignTokenContext();
|
|
170
171
|
const breakpoint = createBreakpoint();
|
|
@@ -15,6 +15,8 @@ export declare function resolveTableCell(properties?: TableCellProps | void, col
|
|
|
15
15
|
attributes: {
|
|
16
16
|
[x: symbol]: false | import("svelte/attachments").Attachment<HTMLTableCellElement> | null | undefined;
|
|
17
17
|
[x: `data-${string}`]: any;
|
|
18
|
+
height?: number | string | undefined | null | undefined;
|
|
19
|
+
width?: number | string | undefined | null | undefined;
|
|
18
20
|
align?: "left" | "center" | "right" | "justify" | "char" | undefined | null | undefined;
|
|
19
21
|
placeholder?: string | undefined | null | undefined;
|
|
20
22
|
property?: string | undefined | null | undefined;
|
|
@@ -84,7 +86,7 @@ export declare function resolveTableCell(properties?: TableCellProps | void, col
|
|
|
84
86
|
'aria-colindex'?: number | undefined | null | undefined;
|
|
85
87
|
'aria-colspan'?: number | undefined | null | undefined;
|
|
86
88
|
'aria-controls'?: string | undefined | null | undefined;
|
|
87
|
-
'aria-current'?: "date" | "page" | "step" | "time" | import("svelte/elements").Booleanish |
|
|
89
|
+
'aria-current'?: "date" | "page" | "step" | "time" | "location" | import("svelte/elements").Booleanish | null | undefined;
|
|
88
90
|
'aria-details'?: string | undefined | null | undefined;
|
|
89
91
|
'aria-disabled'?: import("svelte/elements").Booleanish | null | undefined;
|
|
90
92
|
'aria-dropeffect'?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined | null | undefined;
|
|
@@ -445,8 +447,6 @@ export declare function resolveTableCell(properties?: TableCellProps | void, col
|
|
|
445
447
|
'bind:clientWidth'?: number | undefined | null;
|
|
446
448
|
'bind:clientHeight'?: number | undefined | null;
|
|
447
449
|
xmlns?: string | undefined | null | undefined;
|
|
448
|
-
height?: number | string | undefined | null | undefined;
|
|
449
|
-
width?: number | string | undefined | null | undefined;
|
|
450
450
|
abbr?: string | undefined | null | undefined;
|
|
451
451
|
headers?: string | undefined | null | undefined;
|
|
452
452
|
valign?: "top" | "middle" | "bottom" | "baseline" | undefined | null | undefined;
|
|
@@ -476,6 +476,8 @@ export declare function resolveTableVirtualCells<Row extends object>(rows: reado
|
|
|
476
476
|
attributes: {
|
|
477
477
|
[x: symbol]: false | import("svelte/attachments").Attachment<HTMLTableCellElement> | null | undefined;
|
|
478
478
|
[x: `data-${string}`]: any;
|
|
479
|
+
height?: number | string | undefined | null | undefined;
|
|
480
|
+
width?: number | string | undefined | null | undefined;
|
|
479
481
|
align?: "left" | "center" | "right" | "justify" | "char" | undefined | null | undefined;
|
|
480
482
|
placeholder?: string | undefined | null | undefined;
|
|
481
483
|
property?: string | undefined | null | undefined;
|
|
@@ -545,7 +547,7 @@ export declare function resolveTableVirtualCells<Row extends object>(rows: reado
|
|
|
545
547
|
'aria-colindex'?: number | undefined | null | undefined;
|
|
546
548
|
'aria-colspan'?: number | undefined | null | undefined;
|
|
547
549
|
'aria-controls'?: string | undefined | null | undefined;
|
|
548
|
-
'aria-current'?: "date" | "page" | "step" | "time" | import("svelte/elements").Booleanish |
|
|
550
|
+
'aria-current'?: "date" | "page" | "step" | "time" | "location" | import("svelte/elements").Booleanish | null | undefined;
|
|
549
551
|
'aria-details'?: string | undefined | null | undefined;
|
|
550
552
|
'aria-disabled'?: import("svelte/elements").Booleanish | null | undefined;
|
|
551
553
|
'aria-dropeffect'?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined | null | undefined;
|
|
@@ -906,8 +908,6 @@ export declare function resolveTableVirtualCells<Row extends object>(rows: reado
|
|
|
906
908
|
'bind:clientWidth'?: number | undefined | null;
|
|
907
909
|
'bind:clientHeight'?: number | undefined | null;
|
|
908
910
|
xmlns?: string | undefined | null | undefined;
|
|
909
|
-
height?: number | string | undefined | null | undefined;
|
|
910
|
-
width?: number | string | undefined | null | undefined;
|
|
911
911
|
abbr?: string | undefined | null | undefined;
|
|
912
912
|
headers?: string | undefined | null | undefined;
|
|
913
913
|
valign?: "top" | "middle" | "bottom" | "baseline" | undefined | null | undefined;
|
|
@@ -176,6 +176,8 @@ export interface TableColumnInput<Row extends object> extends Omit<TableColumn<R
|
|
|
176
176
|
key?: TableKey;
|
|
177
177
|
children?: readonly TableColumnInput<Row>[];
|
|
178
178
|
}
|
|
179
|
+
/** Column definition as accepted in Table's columns array. */
|
|
180
|
+
export type TableColumnProps<Row extends object = Record<string, unknown>> = TableColumnInput<Row>;
|
|
179
181
|
/** Common properties of columns. Subsidiary Tree is set in columns. */
|
|
180
182
|
export type TableColumnDefaults<Row extends object> = Partial<Omit<TableColumnInput<Row>, 'children'>>;
|
|
181
183
|
/** The group has its own title, and the data fields are at its child columns. */
|
package/dist/tabs/Tabs.svelte
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import ThemeScopeStyle from '../theme/ThemeScopeStyle.svelte';
|
|
11
11
|
import { tabsSemantics } from './tabs-semantic.engine';
|
|
12
12
|
import { getTabsAnimation } from './tabs-motion.engine';
|
|
13
|
-
import { useToken } from '../theme/theme-context.svelte';
|
|
13
|
+
import { useToken, useRuntimeStyles } from '../theme/theme-context.svelte';
|
|
14
14
|
import { getTabsClickEvent } from './tabs.dom';
|
|
15
15
|
import { isTabsMobileDevice } from './tabs-overflow.engine';
|
|
16
16
|
import type { TabsNavApi, TabsNavContext, TabsTabBarProps } from './tabs-nav.types';
|
|
@@ -71,7 +71,9 @@
|
|
|
71
71
|
const componentTheme = useComponentTheme('Tabs');
|
|
72
72
|
let prefixCls = $derived(config.getPrefixCls('tabs', customizePrefixCls));
|
|
73
73
|
let rootPrefixCls = $derived(config.getPrefixCls());
|
|
74
|
-
|
|
74
|
+
const runtimeStyles = useRuntimeStyles();
|
|
75
|
+
const hasCustomPrefix = $derived(prefixCls !== 'ant-tabs' || rootPrefixCls !== 'ant');
|
|
76
|
+
let prefixCss = $derived(runtimeStyles && getTabsPrefixCss(prefixCls, rootPrefixCls));
|
|
75
77
|
const designTokens = useToken();
|
|
76
78
|
const generatedId = $props.id();
|
|
77
79
|
const initialDefault = untrack(() => defaultActiveKey);
|
|
@@ -316,8 +318,8 @@
|
|
|
316
318
|
|
|
317
319
|
{#if prefixCss}<ThemeScopeStyle css={prefixCss} scope={`tabs-prefix:${prefixCls}:${rootPrefixCls}`} />{/if}<div {...attributes} bind:this={nativeElement} id={rootId} dir={config.direction}
|
|
318
320
|
data-ant-tabs-root
|
|
319
|
-
data-ant-tabs-prefix={
|
|
320
|
-
data-ant-tabs-global={
|
|
321
|
+
data-ant-tabs-prefix={hasCustomPrefix ? prefixCls : undefined}
|
|
322
|
+
data-ant-tabs-global={hasCustomPrefix ? rootPrefixCls : undefined} class={[
|
|
321
323
|
prefixCls,
|
|
322
324
|
'ant-tabs-css-var',
|
|
323
325
|
componentTheme.className,
|