@juspay/svelte-ui-components 3.1.5 → 3.2.0
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/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 +15 -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 +36 -3
- package/dist/Status/properties.d.ts +8 -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 +5 -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 +3572 -2673
- package/package.json +1 -1
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
|
};
|
|
@@ -3,19 +3,52 @@
|
|
|
3
3
|
import Button from '../Button/Button.svelte';
|
|
4
4
|
import Img from '../Img/Img.svelte';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* The documented default, kept as the default so this is not a breaking
|
|
8
|
+
* change. It is a relative URL resolved against whatever page renders the
|
|
9
|
+
* component, and the library ships no such file, so it only ever pointed at
|
|
10
|
+
* something real for an app serving that exact path at its own root -- and
|
|
11
|
+
* resolved to `<route>/icons/order-success-icon.svg` anywhere deeper.
|
|
12
|
+
*/
|
|
13
|
+
const LEGACY_DEFAULT_STATUS_ICON = 'icons/order-success-icon.svg';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Stands in when the legacy default cannot be fetched, so an app that does
|
|
17
|
+
* host that path keeps getting its own file and every other app stops
|
|
18
|
+
* rendering a broken image.
|
|
19
|
+
*
|
|
20
|
+
* Carries no `role` or `aria-label` of its own. Both are in `Img`'s
|
|
21
|
+
* allowlist, so a root declaring them would be copied onto the live host and
|
|
22
|
+
* would outrank the label `Img` derives from `alt` -- pinning every default
|
|
23
|
+
* icon to "Success", including on a failure screen.
|
|
24
|
+
*/
|
|
25
|
+
const BUILTIN_STATUS_ICON =
|
|
26
|
+
"data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2048%2048'%3E%3Ccircle%20cx%3D'24'%20cy%3D'24'%20r%3D'22'%20fill%3D'%23e6f6ec'%20stroke%3D'%232e994c'%20stroke-width%3D'2'%2F%3E%3Cpath%20d%3D'M15%2024.5l6.5%206.5L33%2019.5'%20fill%3D'none'%20stroke%3D'%232e994c'%20stroke-width%3D'3.5'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%2F%3E%3C%2Fsvg%3E";
|
|
27
|
+
|
|
6
28
|
let {
|
|
7
|
-
statusIcon =
|
|
29
|
+
statusIcon = LEGACY_DEFAULT_STATUS_ICON,
|
|
30
|
+
statusIconAlt = 'status',
|
|
8
31
|
statusText = '',
|
|
9
32
|
statusTextTag = 'div',
|
|
10
33
|
statusDescription = '',
|
|
11
34
|
buttonProperties,
|
|
12
35
|
classes,
|
|
13
|
-
onbuttonClick,
|
|
36
|
+
onbuttonClick: onbuttonClickLegacy,
|
|
37
|
+
onButtonClick,
|
|
14
38
|
icon,
|
|
15
39
|
descriptionSnippet,
|
|
16
40
|
children,
|
|
17
41
|
testId
|
|
18
42
|
}: StatusProperties = $props();
|
|
43
|
+
|
|
44
|
+
// Scoped to the untouched default on purpose. Applying it to a caller's own
|
|
45
|
+
// icon would answer a failed failure-icon with a success checkmark.
|
|
46
|
+
const statusIconFallback = $derived(
|
|
47
|
+
statusIcon === LEGACY_DEFAULT_STATUS_ICON ? BUILTIN_STATUS_ICON : null
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
51
|
+
const onbuttonClick = $derived(onButtonClick ?? onbuttonClickLegacy);
|
|
19
52
|
</script>
|
|
20
53
|
|
|
21
54
|
<div
|
|
@@ -28,7 +61,7 @@
|
|
|
28
61
|
{#if icon}
|
|
29
62
|
{@render icon()}
|
|
30
63
|
{:else}
|
|
31
|
-
<Img inlineSvg src={statusIcon} alt=
|
|
64
|
+
<Img inlineSvg src={statusIcon} fallback={statusIconFallback} alt={statusIconAlt} />
|
|
32
65
|
{/if}
|
|
33
66
|
</div>
|
|
34
67
|
<svelte:element
|
|
@@ -2,6 +2,13 @@ import type { Snippet } from 'svelte';
|
|
|
2
2
|
import type { ButtonProperties } from '../Button/properties';
|
|
3
3
|
export type StatusProperties = StatusEventProperties & {
|
|
4
4
|
statusIcon?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Accessible name for the `statusIcon` image. Defaults to `'status'`, which
|
|
7
|
+
* is deliberately generic because the icon is the same shape on a success and
|
|
8
|
+
* a failure screen. Set it to something the screen actually means, or to `''`
|
|
9
|
+
* to mark the icon decorative when `statusText` already carries the meaning.
|
|
10
|
+
*/
|
|
11
|
+
statusIconAlt?: string;
|
|
5
12
|
statusText: string;
|
|
6
13
|
statusDescription: string;
|
|
7
14
|
/**
|
|
@@ -49,4 +56,5 @@ export type StatusProperties = StatusEventProperties & {
|
|
|
49
56
|
};
|
|
50
57
|
export type StatusEventProperties = {
|
|
51
58
|
onbuttonClick?: () => void;
|
|
59
|
+
onButtonClick?: () => void;
|
|
52
60
|
};
|
|
@@ -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 & {
|