@juspay/svelte-ui-components 3.1.6 → 3.2.1
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/README.md +55 -2
- package/dist/Accordion/Accordion.svelte +5 -1
- package/dist/Accordion/properties.d.ts +1 -0
- package/dist/AreaChart/AreaChart.svelte +8 -2
- package/dist/AreaChart/properties.d.ts +10 -0
- package/dist/Banner/Banner.svelte +5 -1
- package/dist/Banner/properties.d.ts +1 -0
- package/dist/BarChart/BarChart.svelte +8 -2
- package/dist/BarChart/properties.d.ts +8 -0
- package/dist/Book/Book.svelte +5 -1
- package/dist/Book/properties.d.ts +1 -0
- package/dist/Calendar/Calendar.svelte +11 -3
- package/dist/Calendar/properties.d.ts +11 -0
- package/dist/Chat/Chat.svelte +29 -9
- package/dist/Chat/properties.d.ts +9 -0
- package/dist/ChatBubble/ChatBubble.svelte +11 -3
- package/dist/ChatBubble/properties.d.ts +3 -0
- package/dist/ChatComposer/ChatComposer.svelte +38 -12
- package/dist/ChatComposer/properties.d.ts +12 -0
- package/dist/ChatHeader/ChatHeader.svelte +5 -1
- package/dist/ChatHeader/properties.d.ts +1 -0
- package/dist/ChatMessage/ChatMessage.svelte +11 -3
- package/dist/ChatMessage/properties.d.ts +3 -0
- package/dist/ChatMessageList/ChatMessageList.svelte +11 -3
- package/dist/ChatMessageList/properties.d.ts +6 -0
- package/dist/ChatSuggestions/ChatSuggestions.svelte +5 -1
- package/dist/ChatSuggestions/properties.d.ts +1 -0
- package/dist/CheckListItem/CheckListItem.svelte +5 -1
- package/dist/CheckListItem/properties.d.ts +1 -0
- package/dist/Checkbox/Checkbox.svelte +5 -1
- package/dist/Checkbox/properties.d.ts +1 -0
- package/dist/ChipInput/ChipInput.svelte +14 -4
- package/dist/ChipInput/properties.d.ts +4 -0
- package/dist/Choicebox/Choicebox.svelte +5 -1
- package/dist/Choicebox/properties.d.ts +1 -0
- package/dist/ColorPicker/ColorPicker.svelte +8 -2
- package/dist/ColorPicker/properties.d.ts +2 -0
- package/dist/Combobox/Combobox.svelte +26 -8
- package/dist/Combobox/properties.d.ts +8 -0
- package/dist/CommandMenu/CommandMenu.svelte +8 -2
- package/dist/CommandMenu/properties.d.ts +2 -0
- package/dist/ContextMenu/ContextMenu.svelte +11 -3
- package/dist/ContextMenu/properties.d.ts +3 -0
- package/dist/DateRangePicker/DateRangePicker.svelte +20 -6
- package/dist/DateRangePicker/properties.d.ts +19 -0
- package/dist/DualAxisBarChart/DualAxisBarChart.svelte +5 -1
- package/dist/DualAxisBarChart/properties.d.ts +4 -0
- package/dist/FileDropzoneTrigger/FileDropzoneTrigger.svelte +5 -1
- package/dist/FileDropzoneTrigger/properties.d.ts +1 -0
- package/dist/FileInput/FileInput.svelte +8 -2
- package/dist/FileInput/properties.d.ts +2 -0
- package/dist/FunnelChart/FunnelChart.svelte +8 -2
- package/dist/FunnelChart/properties.d.ts +8 -0
- package/dist/Img/Img.svelte +14 -2
- package/dist/Img/properties.d.ts +1 -0
- package/dist/Input/Input.svelte +23 -7
- package/dist/Input/properties.d.ts +7 -0
- package/dist/LineChart/LineChart.svelte +8 -2
- package/dist/LineChart/properties.d.ts +10 -0
- package/dist/ListItem/ListItem.svelte +17 -5
- package/dist/ListItem/properties.d.ts +5 -0
- package/dist/LottiePlayer/LottiePlayer.svelte +8 -2
- package/dist/LottiePlayer/properties.d.ts +2 -0
- package/dist/MediaPlayer/MediaPlayer.svelte +5 -1
- package/dist/MediaPlayer/properties.d.ts +1 -0
- package/dist/Menu/Menu.svelte +11 -3
- package/dist/Menu/properties.d.ts +3 -0
- package/dist/Modal/Modal.svelte +22 -6
- package/dist/Modal/properties.d.ts +6 -0
- package/dist/Pagination/Pagination.svelte +5 -1
- package/dist/Pagination/properties.d.ts +1 -0
- package/dist/PieChart/PieChart.svelte +8 -2
- package/dist/PieChart/properties.d.ts +8 -0
- package/dist/Pill/Pill.svelte +5 -1
- package/dist/Pill/properties.d.ts +1 -0
- package/dist/Radio/Radio.svelte +5 -1
- package/dist/Radio/properties.d.ts +1 -0
- package/dist/Resizable/Resizable.svelte +11 -3
- package/dist/Resizable/properties.d.ts +3 -0
- package/dist/SankeyChart/SankeyChart.svelte +14 -4
- package/dist/SankeyChart/properties.d.ts +12 -0
- package/dist/Scroller/Scroller.svelte +5 -1
- package/dist/Scroller/properties.d.ts +1 -0
- package/dist/Select/Select.svelte +11 -3
- package/dist/Select/properties.d.ts +3 -0
- package/dist/Sheet/Sheet.svelte +11 -3
- package/dist/Sheet/properties.d.ts +3 -0
- package/dist/Slider/Slider.svelte +8 -2
- package/dist/Slider/properties.d.ts +2 -0
- package/dist/Snippet/Snippet.svelte +5 -1
- package/dist/Snippet/properties.d.ts +1 -0
- package/dist/SplitButton/SplitButton.svelte +5 -1
- package/dist/SplitButton/properties.d.ts +1 -0
- package/dist/SplitInput/SplitInput.svelte +11 -3
- package/dist/SplitInput/properties.d.ts +3 -0
- package/dist/Status/Status.svelte +5 -1
- package/dist/Status/properties.d.ts +1 -0
- package/dist/Stepper/Stepper.svelte +8 -2
- package/dist/Stepper/properties.d.ts +9 -0
- package/dist/Tabs/Tabs.svelte +8 -2
- package/dist/Tabs/properties.d.ts +2 -0
- package/dist/TaskList/TaskList.svelte +4 -1
- package/dist/TaskList/properties.d.ts +1 -0
- package/dist/ThemeSwitcher/ThemeSwitcher.svelte +9 -1
- package/dist/ThemeSwitcher/properties.d.ts +1 -0
- package/dist/ThinkingIndicator/ThinkingIndicator.svelte +8 -2
- package/dist/ThinkingIndicator/properties.d.ts +2 -0
- package/dist/Toggle/Toggle.svelte +5 -1
- package/dist/Toggle/properties.d.ts +1 -0
- package/dist/ToolCallLog/ToolCallLog.svelte +10 -1
- package/dist/ToolCallLog/properties.d.ts +1 -0
- package/dist/Toolbar/Toolbar.svelte +5 -1
- package/dist/Toolbar/properties.d.ts +1 -0
- package/dist-wc/index.js +5542 -3454
- package/package.json +20 -5
- package/scripts/codemod/README.md +76 -0
- package/scripts/codemod/cli.ts +206 -0
- package/scripts/codemod/map.ts +118 -0
- package/scripts/codemod/transform.ts +549 -0
- package/scripts/codemod/tsconfig.json +15 -0
- package/scripts/codemod/wc-children.ts +75 -0
- package/scripts/postinstall.mjs +56 -0
|
@@ -18,10 +18,16 @@
|
|
|
18
18
|
ariaHidden = true,
|
|
19
19
|
testId,
|
|
20
20
|
classes,
|
|
21
|
-
oncomplete,
|
|
22
|
-
|
|
21
|
+
oncomplete: oncompleteLegacy,
|
|
22
|
+
onComplete,
|
|
23
|
+
onerror: onerrorLegacy,
|
|
24
|
+
onError
|
|
23
25
|
}: LottiePlayerProperties = $props();
|
|
24
26
|
|
|
27
|
+
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
28
|
+
const oncomplete = $derived(onComplete ?? oncompleteLegacy);
|
|
29
|
+
const onerror = $derived(onError ?? onerrorLegacy);
|
|
30
|
+
|
|
25
31
|
let containerEl: HTMLDivElement | null = $state(null);
|
|
26
32
|
let animationItem: LocalAnimationItem | null = $state(null);
|
|
27
33
|
|
|
@@ -31,6 +31,8 @@ export type OptionalLottiePlayerProperties = {
|
|
|
31
31
|
export type LottiePlayerEventProperties = {
|
|
32
32
|
/** Fired when the animation completes (non-looping). */
|
|
33
33
|
oncomplete?: () => void;
|
|
34
|
+
onComplete?: () => void;
|
|
34
35
|
/** Fired when the animation fails to load. */
|
|
35
36
|
onerror?: () => void;
|
|
37
|
+
onError?: () => void;
|
|
36
38
|
};
|
|
@@ -26,11 +26,15 @@
|
|
|
26
26
|
captionsSrcLang,
|
|
27
27
|
onplay,
|
|
28
28
|
onpause,
|
|
29
|
-
onvolumechange,
|
|
29
|
+
onvolumechange: onvolumechangeLegacy,
|
|
30
|
+
onVolumeChange,
|
|
30
31
|
testId,
|
|
31
32
|
classes
|
|
32
33
|
}: MediaPlayerProperties = $props();
|
|
33
34
|
|
|
35
|
+
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
36
|
+
const onvolumechange = $derived(onVolumeChange ?? onvolumechangeLegacy);
|
|
37
|
+
|
|
34
38
|
let videoPlayer: HTMLVideoElement | null = $state(null);
|
|
35
39
|
|
|
36
40
|
function togglePlayback(): void {
|
package/dist/Menu/Menu.svelte
CHANGED
|
@@ -11,9 +11,12 @@
|
|
|
11
11
|
testId,
|
|
12
12
|
trigger,
|
|
13
13
|
interactiveTrigger = false,
|
|
14
|
-
onselect,
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
onselect: onselectLegacy,
|
|
15
|
+
onSelect,
|
|
16
|
+
onopen: onopenLegacy,
|
|
17
|
+
onOpen,
|
|
18
|
+
onclose: oncloseLegacy,
|
|
19
|
+
onClose,
|
|
17
20
|
classes,
|
|
18
21
|
transformSvg,
|
|
19
22
|
selectedValue = null,
|
|
@@ -25,6 +28,11 @@
|
|
|
25
28
|
usePortal = false
|
|
26
29
|
}: MenuProperties = $props();
|
|
27
30
|
|
|
31
|
+
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
32
|
+
const onclose = $derived(onClose ?? oncloseLegacy);
|
|
33
|
+
const onopen = $derived(onOpen ?? onopenLegacy);
|
|
34
|
+
const onselect = $derived(onSelect ?? onselectLegacy);
|
|
35
|
+
|
|
28
36
|
let itemRole = $derived(menuRole === 'listbox' ? 'option' : 'menuitem');
|
|
29
37
|
|
|
30
38
|
let menuContainerEl: HTMLDivElement | null = $state(null);
|
|
@@ -88,6 +88,9 @@ export type OptionalMenuProperties = {
|
|
|
88
88
|
};
|
|
89
89
|
export type MenuEventProperties = {
|
|
90
90
|
onselect?: (item: MenuItem) => void;
|
|
91
|
+
onSelect?: (item: MenuItem) => void;
|
|
91
92
|
onopen?: () => void;
|
|
93
|
+
onOpen?: () => void;
|
|
92
94
|
onclose?: () => void;
|
|
95
|
+
onClose?: () => void;
|
|
93
96
|
};
|
package/dist/Modal/Modal.svelte
CHANGED
|
@@ -26,12 +26,18 @@
|
|
|
26
26
|
testId,
|
|
27
27
|
content,
|
|
28
28
|
footerSnippet,
|
|
29
|
-
onclose,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
onclose: oncloseLegacy,
|
|
30
|
+
onClose,
|
|
31
|
+
onheaderRightImageClick: onheaderRightImageClickLegacy,
|
|
32
|
+
onHeaderRightImageClick,
|
|
33
|
+
onheaderLeftImageClick: onheaderLeftImageClickLegacy,
|
|
34
|
+
onHeaderLeftImageClick,
|
|
35
|
+
onprimaryButtonClick: onprimaryButtonClickLegacy,
|
|
36
|
+
onPrimaryButtonClick,
|
|
37
|
+
onsecondaryButtonClick: onsecondaryButtonClickLegacy,
|
|
38
|
+
onSecondaryButtonClick,
|
|
39
|
+
onoverlayClick: onoverlayClickLegacy,
|
|
40
|
+
onOverlayClick,
|
|
35
41
|
onkeydown,
|
|
36
42
|
classes,
|
|
37
43
|
overlayBackdropFilter,
|
|
@@ -41,6 +47,16 @@
|
|
|
41
47
|
autoDismissAfter = null
|
|
42
48
|
}: ModalProperties = $props();
|
|
43
49
|
|
|
50
|
+
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
51
|
+
const onclose = $derived(onClose ?? oncloseLegacy);
|
|
52
|
+
const onheaderLeftImageClick = $derived(onHeaderLeftImageClick ?? onheaderLeftImageClickLegacy);
|
|
53
|
+
const onheaderRightImageClick = $derived(
|
|
54
|
+
onHeaderRightImageClick ?? onheaderRightImageClickLegacy
|
|
55
|
+
);
|
|
56
|
+
const onoverlayClick = $derived(onOverlayClick ?? onoverlayClickLegacy);
|
|
57
|
+
const onprimaryButtonClick = $derived(onPrimaryButtonClick ?? onprimaryButtonClickLegacy);
|
|
58
|
+
const onsecondaryButtonClick = $derived(onSecondaryButtonClick ?? onsecondaryButtonClickLegacy);
|
|
59
|
+
|
|
44
60
|
let dismissTimer: ReturnType<typeof setTimeout> | null = null;
|
|
45
61
|
|
|
46
62
|
// Fix [major]: plain const so the debouncer closure retains its internal lastCallTime state
|
|
@@ -55,10 +55,16 @@ export type OptionalModalProperties = {
|
|
|
55
55
|
};
|
|
56
56
|
export type ModalEventProperties = {
|
|
57
57
|
onclose?: () => void;
|
|
58
|
+
onClose?: () => void;
|
|
58
59
|
onheaderRightImageClick?: (event: MouseEvent) => void;
|
|
60
|
+
onHeaderRightImageClick?: (event: MouseEvent) => void;
|
|
59
61
|
onheaderLeftImageClick?: (event: MouseEvent) => void;
|
|
62
|
+
onHeaderLeftImageClick?: (event: MouseEvent) => void;
|
|
60
63
|
onprimaryButtonClick?: (event: MouseEvent) => void;
|
|
64
|
+
onPrimaryButtonClick?: (event: MouseEvent) => void;
|
|
61
65
|
onsecondaryButtonClick?: (event: MouseEvent) => void;
|
|
66
|
+
onSecondaryButtonClick?: (event: MouseEvent) => void;
|
|
62
67
|
onoverlayClick?: () => void;
|
|
68
|
+
onOverlayClick?: () => void;
|
|
63
69
|
onkeydown?: (event: KeyboardEvent) => void;
|
|
64
70
|
};
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
siblingCount = 1,
|
|
8
8
|
disabled = false,
|
|
9
9
|
testId,
|
|
10
|
-
onchange,
|
|
10
|
+
onchange: onchangeLegacy,
|
|
11
|
+
onChange,
|
|
11
12
|
classes,
|
|
12
13
|
hasMore = false,
|
|
13
14
|
prevButtonTestId,
|
|
@@ -15,6 +16,9 @@
|
|
|
15
16
|
onLoadMore
|
|
16
17
|
}: PaginationProperties = $props();
|
|
17
18
|
|
|
19
|
+
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
20
|
+
const onchange = $derived(onChange ?? onchangeLegacy);
|
|
21
|
+
|
|
18
22
|
function generatePages(total: number, current: number, siblings: number): (number | '...')[] {
|
|
19
23
|
const pages: (number | '...')[] = [];
|
|
20
24
|
pages.push(1);
|
|
@@ -24,6 +24,7 @@ export type OptionalPaginationProperties = {
|
|
|
24
24
|
};
|
|
25
25
|
export type PaginationEventProperties = {
|
|
26
26
|
onchange?: (page: number) => void;
|
|
27
|
+
onChange?: (page: number) => void;
|
|
27
28
|
/** Fired when the load-more CTA is clicked (cursor mode). */
|
|
28
29
|
onLoadMore?: () => void;
|
|
29
30
|
};
|
|
@@ -34,8 +34,10 @@
|
|
|
34
34
|
tooltipSnippet,
|
|
35
35
|
center,
|
|
36
36
|
empty,
|
|
37
|
-
onsliceclick,
|
|
38
|
-
|
|
37
|
+
onsliceclick: onsliceclickLegacy,
|
|
38
|
+
onSliceClick,
|
|
39
|
+
onslicehover: onslicehoverLegacy,
|
|
40
|
+
onSliceHover,
|
|
39
41
|
testId,
|
|
40
42
|
classes,
|
|
41
43
|
semiCircle = false,
|
|
@@ -47,6 +49,10 @@
|
|
|
47
49
|
changeInvertColors = false
|
|
48
50
|
}: PieChartProperties = $props();
|
|
49
51
|
|
|
52
|
+
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
53
|
+
const onsliceclick = $derived(onSliceClick ?? onsliceclickLegacy);
|
|
54
|
+
const onslicehover = $derived(onSliceHover ?? onslicehoverLegacy);
|
|
55
|
+
|
|
50
56
|
// ── State ──────────────────────────────────────────────────────
|
|
51
57
|
|
|
52
58
|
let containerEl: HTMLDivElement | null = $state(null);
|
|
@@ -65,8 +65,16 @@ export type PieChartEventProperties = {
|
|
|
65
65
|
index: number;
|
|
66
66
|
slice: PieChartSlice;
|
|
67
67
|
}) => void;
|
|
68
|
+
onSliceClick?: (event: {
|
|
69
|
+
index: number;
|
|
70
|
+
slice: PieChartSlice;
|
|
71
|
+
}) => void;
|
|
68
72
|
onslicehover?: (event: {
|
|
69
73
|
index: number;
|
|
70
74
|
slice: PieChartSlice;
|
|
71
75
|
} | null) => void;
|
|
76
|
+
onSliceHover?: (event: {
|
|
77
|
+
index: number;
|
|
78
|
+
slice: PieChartSlice;
|
|
79
|
+
} | null) => void;
|
|
72
80
|
};
|
package/dist/Pill/Pill.svelte
CHANGED
|
@@ -12,10 +12,14 @@
|
|
|
12
12
|
dismissIcon,
|
|
13
13
|
leadingIcon,
|
|
14
14
|
onclick,
|
|
15
|
-
ondismiss,
|
|
15
|
+
ondismiss: ondismissLegacy,
|
|
16
|
+
onDismiss,
|
|
16
17
|
classes
|
|
17
18
|
}: PillProperties = $props();
|
|
18
19
|
|
|
20
|
+
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
21
|
+
const ondismiss = $derived(onDismiss ?? ondismissLegacy);
|
|
22
|
+
|
|
19
23
|
let interactive = $derived(typeof onclick === 'function');
|
|
20
24
|
|
|
21
25
|
function handleClick(event: MouseEvent): void {
|
package/dist/Radio/Radio.svelte
CHANGED
|
@@ -8,10 +8,14 @@
|
|
|
8
8
|
text = '',
|
|
9
9
|
disabled = false,
|
|
10
10
|
testId,
|
|
11
|
-
onchange,
|
|
11
|
+
onchange: onchangeLegacy,
|
|
12
|
+
onChange,
|
|
12
13
|
classes
|
|
13
14
|
}: RadioProperties = $props();
|
|
14
15
|
|
|
16
|
+
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
17
|
+
const onchange = $derived(onChange ?? onchangeLegacy);
|
|
18
|
+
|
|
15
19
|
let checked = $derived(selectedValue === value);
|
|
16
20
|
|
|
17
21
|
function handleChange(): void {
|
|
@@ -13,13 +13,21 @@
|
|
|
13
13
|
disabled = false,
|
|
14
14
|
handleLabel = 'Resize',
|
|
15
15
|
children,
|
|
16
|
-
onresize,
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
onresize: onresizeLegacy,
|
|
17
|
+
onResize,
|
|
18
|
+
onresizestart: onresizestartLegacy,
|
|
19
|
+
onResizeStart,
|
|
20
|
+
onresizeend: onresizeendLegacy,
|
|
21
|
+
onResizeEnd,
|
|
19
22
|
testId,
|
|
20
23
|
classes
|
|
21
24
|
}: ResizableProperties = $props();
|
|
22
25
|
|
|
26
|
+
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
27
|
+
const onresize = $derived(onResize ?? onresizeLegacy);
|
|
28
|
+
const onresizeend = $derived(onResizeEnd ?? onresizeendLegacy);
|
|
29
|
+
const onresizestart = $derived(onResizeStart ?? onresizestartLegacy);
|
|
30
|
+
|
|
23
31
|
const DIRS: Record<ResizeEdge, { x: -1 | 0 | 1; y: -1 | 0 | 1 }> = {
|
|
24
32
|
top: { x: 0, y: -1 },
|
|
25
33
|
right: { x: 1, y: 0 },
|
|
@@ -22,6 +22,9 @@ export type OptionalResizableProperties = {
|
|
|
22
22
|
};
|
|
23
23
|
export type ResizableEventProperties = {
|
|
24
24
|
onresize?: (size: ResizeSize) => void;
|
|
25
|
+
onResize?: (size: ResizeSize) => void;
|
|
25
26
|
onresizestart?: (size: ResizeSize) => void;
|
|
27
|
+
onResizeStart?: (size: ResizeSize) => void;
|
|
26
28
|
onresizeend?: (size: ResizeSize) => void;
|
|
29
|
+
onResizeEnd?: (size: ResizeSize) => void;
|
|
27
30
|
};
|
|
@@ -26,10 +26,14 @@
|
|
|
26
26
|
valueFormat,
|
|
27
27
|
tooltipSnippet,
|
|
28
28
|
empty,
|
|
29
|
-
onnodeclick,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
onnodeclick: onnodeclickLegacy,
|
|
30
|
+
onNodeClick,
|
|
31
|
+
onlinkclick: onlinkclickLegacy,
|
|
32
|
+
onLinkClick,
|
|
33
|
+
onnodehover: onnodehoverLegacy,
|
|
34
|
+
onNodeHover,
|
|
35
|
+
onlinkhover: onlinkhoverLegacy,
|
|
36
|
+
onLinkHover,
|
|
33
37
|
testId,
|
|
34
38
|
classes,
|
|
35
39
|
columnLabels,
|
|
@@ -42,6 +46,12 @@
|
|
|
42
46
|
marginX = 40
|
|
43
47
|
}: SankeyChartProperties = $props();
|
|
44
48
|
|
|
49
|
+
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
50
|
+
const onlinkclick = $derived(onLinkClick ?? onlinkclickLegacy);
|
|
51
|
+
const onlinkhover = $derived(onLinkHover ?? onlinkhoverLegacy);
|
|
52
|
+
const onnodeclick = $derived(onNodeClick ?? onnodeclickLegacy);
|
|
53
|
+
const onnodehover = $derived(onNodeHover ?? onnodehoverLegacy);
|
|
54
|
+
|
|
45
55
|
// ── State ──────────────────────────────────────────────────────
|
|
46
56
|
|
|
47
57
|
let containerEl: HTMLDivElement | null = $state(null);
|
|
@@ -112,13 +112,25 @@ export type SankeyChartEventProperties = {
|
|
|
112
112
|
onnodeclick?: (event: {
|
|
113
113
|
node: SankeyNode;
|
|
114
114
|
}) => void;
|
|
115
|
+
onNodeClick?: (event: {
|
|
116
|
+
node: SankeyNode;
|
|
117
|
+
}) => void;
|
|
115
118
|
onlinkclick?: (event: {
|
|
116
119
|
link: SankeyLink;
|
|
117
120
|
}) => void;
|
|
121
|
+
onLinkClick?: (event: {
|
|
122
|
+
link: SankeyLink;
|
|
123
|
+
}) => void;
|
|
118
124
|
onnodehover?: (event: {
|
|
119
125
|
node: SankeyNode;
|
|
120
126
|
} | null) => void;
|
|
127
|
+
onNodeHover?: (event: {
|
|
128
|
+
node: SankeyNode;
|
|
129
|
+
} | null) => void;
|
|
121
130
|
onlinkhover?: (event: {
|
|
122
131
|
link: SankeyLink;
|
|
123
132
|
} | null) => void;
|
|
133
|
+
onLinkHover?: (event: {
|
|
134
|
+
link: SankeyLink;
|
|
135
|
+
} | null) => void;
|
|
124
136
|
};
|
|
@@ -21,10 +21,14 @@
|
|
|
21
21
|
testId,
|
|
22
22
|
arrowPrevious,
|
|
23
23
|
arrowNext,
|
|
24
|
-
onscrollposition,
|
|
24
|
+
onscrollposition: onscrollpositionLegacy,
|
|
25
|
+
onScrollPosition,
|
|
25
26
|
classes
|
|
26
27
|
}: ScrollerProperties = $props();
|
|
27
28
|
|
|
29
|
+
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
30
|
+
const onscrollposition = $derived(onScrollPosition ?? onscrollpositionLegacy);
|
|
31
|
+
|
|
28
32
|
let containerEl: HTMLDivElement | null = $state(null);
|
|
29
33
|
let canScrollPrev = $state(false);
|
|
30
34
|
let canScrollNext = $state(false);
|
|
@@ -22,9 +22,12 @@
|
|
|
22
22
|
triggerSummary,
|
|
23
23
|
testId,
|
|
24
24
|
itemTestId,
|
|
25
|
-
onchange,
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
onchange: onchangeLegacy,
|
|
26
|
+
onChange,
|
|
27
|
+
onopen: onopenLegacy,
|
|
28
|
+
onOpen,
|
|
29
|
+
onclose: oncloseLegacy,
|
|
30
|
+
onClose,
|
|
28
31
|
classes,
|
|
29
32
|
open = $bindable(false),
|
|
30
33
|
dropdownAlign = 'left',
|
|
@@ -34,6 +37,11 @@
|
|
|
34
37
|
usePortal = false
|
|
35
38
|
}: SelectProperties = $props();
|
|
36
39
|
|
|
40
|
+
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
41
|
+
const onchange = $derived(onChange ?? onchangeLegacy);
|
|
42
|
+
const onclose = $derived(onClose ?? oncloseLegacy);
|
|
43
|
+
const onopen = $derived(onOpen ?? onopenLegacy);
|
|
44
|
+
|
|
37
45
|
function normalizeItems(source: SelectItem[] | string[]): SelectItem[] {
|
|
38
46
|
return source.map((entry) => (typeof entry === 'string' ? { id: entry, label: entry } : entry));
|
|
39
47
|
}
|
|
@@ -97,6 +97,9 @@ export type OptionalSelectProperties = {
|
|
|
97
97
|
};
|
|
98
98
|
export type SelectEventProperties = {
|
|
99
99
|
onchange?: (value: string[]) => void;
|
|
100
|
+
onChange?: (value: string[]) => void;
|
|
100
101
|
onopen?: () => void;
|
|
102
|
+
onOpen?: () => void;
|
|
101
103
|
onclose?: () => void;
|
|
104
|
+
onClose?: () => void;
|
|
102
105
|
};
|
package/dist/Sheet/Sheet.svelte
CHANGED
|
@@ -15,12 +15,20 @@
|
|
|
15
15
|
testId,
|
|
16
16
|
content,
|
|
17
17
|
footer,
|
|
18
|
-
onclose,
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
onclose: oncloseLegacy,
|
|
19
|
+
onClose,
|
|
20
|
+
onafteropen: onafteropenLegacy,
|
|
21
|
+
onAfterOpen,
|
|
22
|
+
onafterclose: onaftercloseLegacy,
|
|
23
|
+
onAfterClose,
|
|
21
24
|
classes
|
|
22
25
|
}: SheetProperties = $props();
|
|
23
26
|
|
|
27
|
+
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
28
|
+
const onafterclose = $derived(onAfterClose ?? onaftercloseLegacy);
|
|
29
|
+
const onafteropen = $derived(onAfterOpen ?? onafteropenLegacy);
|
|
30
|
+
const onclose = $derived(onClose ?? oncloseLegacy);
|
|
31
|
+
|
|
24
32
|
let overlayDiv: HTMLDivElement | null = $state(null);
|
|
25
33
|
let sheetPanel: HTMLDivElement | null = $state(null);
|
|
26
34
|
|
|
@@ -24,8 +24,11 @@ export type OptionalSheetProperties = {
|
|
|
24
24
|
};
|
|
25
25
|
export type SheetEventProperties = {
|
|
26
26
|
onclose?: () => void;
|
|
27
|
+
onClose?: () => void;
|
|
27
28
|
/** Called once after the open transition has fully completed. */
|
|
28
29
|
onafteropen?: () => void;
|
|
30
|
+
onAfterOpen?: () => void;
|
|
29
31
|
/** Called once after the close transition has fully completed. */
|
|
30
32
|
onafterclose?: () => void;
|
|
33
|
+
onAfterClose?: () => void;
|
|
31
34
|
};
|
|
@@ -10,11 +10,17 @@
|
|
|
10
10
|
showValue = false,
|
|
11
11
|
labelFormatter,
|
|
12
12
|
testId,
|
|
13
|
-
onchange,
|
|
14
|
-
|
|
13
|
+
onchange: onchangeLegacy,
|
|
14
|
+
onChange,
|
|
15
|
+
oninput: oninputLegacy,
|
|
16
|
+
onInput,
|
|
15
17
|
classes
|
|
16
18
|
}: SliderProperties = $props();
|
|
17
19
|
|
|
20
|
+
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
21
|
+
const onchange = $derived(onChange ?? onchangeLegacy);
|
|
22
|
+
const oninput = $derived(onInput ?? oninputLegacy);
|
|
23
|
+
|
|
18
24
|
let percentage = $derived(((value - min) / (max - min)) * 100);
|
|
19
25
|
let displayValue = $derived(labelFormatter ? labelFormatter(value) : String(value));
|
|
20
26
|
|
|
@@ -9,10 +9,14 @@
|
|
|
9
9
|
showCopyButton = true,
|
|
10
10
|
testId,
|
|
11
11
|
copyIcon,
|
|
12
|
-
oncopy,
|
|
12
|
+
oncopy: oncopyLegacy,
|
|
13
|
+
onCopy,
|
|
13
14
|
classes
|
|
14
15
|
}: SnippetProperties = $props();
|
|
15
16
|
|
|
17
|
+
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
18
|
+
const oncopy = $derived(onCopy ?? oncopyLegacy);
|
|
19
|
+
|
|
16
20
|
let copied = $state(false);
|
|
17
21
|
|
|
18
22
|
async function handleCopy() {
|
|
@@ -13,9 +13,13 @@
|
|
|
13
13
|
dropdownIcon,
|
|
14
14
|
classes,
|
|
15
15
|
onclick,
|
|
16
|
-
onselect
|
|
16
|
+
onselect: onselectLegacy,
|
|
17
|
+
onSelect
|
|
17
18
|
}: SplitButtonProperties = $props();
|
|
18
19
|
|
|
20
|
+
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
21
|
+
const onselect = $derived(onSelect ?? onselectLegacy);
|
|
22
|
+
|
|
19
23
|
let menuOpen = $state(false);
|
|
20
24
|
|
|
21
25
|
function handlePrimaryClick(event: MouseEvent): void {
|
|
@@ -12,11 +12,19 @@
|
|
|
12
12
|
separator,
|
|
13
13
|
testId,
|
|
14
14
|
classes,
|
|
15
|
-
onchange,
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
onchange: onchangeLegacy,
|
|
16
|
+
onChange,
|
|
17
|
+
oninput: oninputLegacy,
|
|
18
|
+
onInput,
|
|
19
|
+
oncomplete: oncompleteLegacy,
|
|
20
|
+
onComplete
|
|
18
21
|
}: SplitInputProperties = $props();
|
|
19
22
|
|
|
23
|
+
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
24
|
+
const onchange = $derived(onChange ?? onchangeLegacy);
|
|
25
|
+
const oncomplete = $derived(onComplete ?? oncompleteLegacy);
|
|
26
|
+
const oninput = $derived(onInput ?? oninputLegacy);
|
|
27
|
+
|
|
20
28
|
let fieldCount = $derived(typeof fields !== 'undefined' ? fields.length : length);
|
|
21
29
|
|
|
22
30
|
let fieldConfigs: FieldConfig[] = $derived(
|
|
@@ -15,6 +15,9 @@ export type OptionalSplitInputProperties = {
|
|
|
15
15
|
};
|
|
16
16
|
export type SplitInputEventProperties = {
|
|
17
17
|
onchange?: (values: string[]) => void;
|
|
18
|
+
onChange?: (values: string[]) => void;
|
|
18
19
|
oninput?: (values: string[]) => void;
|
|
20
|
+
onInput?: (values: string[]) => void;
|
|
19
21
|
oncomplete?: (values: string[]) => void;
|
|
22
|
+
onComplete?: (values: string[]) => void;
|
|
20
23
|
};
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
statusDescription = '',
|
|
34
34
|
buttonProperties,
|
|
35
35
|
classes,
|
|
36
|
-
onbuttonClick,
|
|
36
|
+
onbuttonClick: onbuttonClickLegacy,
|
|
37
|
+
onButtonClick,
|
|
37
38
|
icon,
|
|
38
39
|
descriptionSnippet,
|
|
39
40
|
children,
|
|
@@ -45,6 +46,9 @@
|
|
|
45
46
|
const statusIconFallback = $derived(
|
|
46
47
|
statusIcon === LEGACY_DEFAULT_STATUS_ICON ? BUILTIN_STATUS_ICON : null
|
|
47
48
|
);
|
|
49
|
+
|
|
50
|
+
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
51
|
+
const onbuttonClick = $derived(onButtonClick ?? onbuttonClickLegacy);
|
|
48
52
|
</script>
|
|
49
53
|
|
|
50
54
|
<div
|
|
@@ -10,10 +10,16 @@
|
|
|
10
10
|
testId,
|
|
11
11
|
suppressRoleAndTabindex,
|
|
12
12
|
suppressContainerTestId,
|
|
13
|
-
onstepclick,
|
|
14
|
-
|
|
13
|
+
onstepclick: onstepclickLegacy,
|
|
14
|
+
onStepClick,
|
|
15
|
+
onhandleStepClick: onhandleStepClickLegacy,
|
|
16
|
+
onHandleStepClick
|
|
15
17
|
}: StepperProperties = $props();
|
|
16
18
|
|
|
19
|
+
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
20
|
+
const onhandleStepClick = $derived(onHandleStepClick ?? onhandleStepClickLegacy);
|
|
21
|
+
const onstepclick = $derived(onStepClick ?? onstepclickLegacy);
|
|
22
|
+
|
|
17
23
|
const resolveStatus = (stepIndex: number, explicitStatus: StepStatus | null): StepStatus => {
|
|
18
24
|
if (explicitStatus !== null) {
|
|
19
25
|
return explicitStatus;
|
|
@@ -55,10 +55,16 @@ export type StepperEventProperties = {
|
|
|
55
55
|
onstepclick?: (event: {
|
|
56
56
|
selectedIndex: number;
|
|
57
57
|
}) => void;
|
|
58
|
+
onStepClick?: (event: {
|
|
59
|
+
selectedIndex: number;
|
|
60
|
+
}) => void;
|
|
58
61
|
/** @deprecated Use `onstepclick` instead. */
|
|
59
62
|
onhandleStepClick?: (event: {
|
|
60
63
|
selectedIndex: number;
|
|
61
64
|
}) => void;
|
|
65
|
+
onHandleStepClick?: (event: {
|
|
66
|
+
selectedIndex: number;
|
|
67
|
+
}) => void;
|
|
62
68
|
};
|
|
63
69
|
export type StepperProperties = MandatoryStepperProperties & OptionalStepperProperties & StepperEventProperties;
|
|
64
70
|
export type OptionalStepProperties = {
|
|
@@ -78,6 +84,9 @@ export type StepEventProperties = {
|
|
|
78
84
|
onclick?: (event: {
|
|
79
85
|
selectedIndex: number;
|
|
80
86
|
}) => void;
|
|
87
|
+
onClick?: (event: {
|
|
88
|
+
selectedIndex: number;
|
|
89
|
+
}) => void;
|
|
81
90
|
onkeydown?: (event: KeyboardEvent) => void;
|
|
82
91
|
};
|
|
83
92
|
export type StepProperties = OptionalStepProperties & StepEventProperties & {
|