@juspay/svelte-ui-components 3.4.1 → 3.5.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 +1 -1
- package/dist/Accordion/Accordion.svelte +1 -5
- package/dist/Accordion/properties.d.ts +0 -1
- package/dist/AreaChart/AreaChart.svelte +2 -8
- package/dist/AreaChart/properties.d.ts +0 -10
- package/dist/AttachmentChipRow/AttachmentChipRow.svelte +30 -30
- package/dist/AttachmentChipRow/properties.d.ts +6 -6
- package/dist/Banner/Banner.svelte +1 -5
- package/dist/Banner/properties.d.ts +0 -1
- package/dist/BarChart/BarChart.svelte +7 -13
- package/dist/BarChart/properties.d.ts +1 -9
- package/dist/Book/Book.svelte +1 -5
- package/dist/Book/properties.d.ts +0 -1
- package/dist/Button/Button.svelte +2 -0
- package/dist/Button/properties.d.ts +5 -0
- package/dist/Calendar/Calendar.svelte +3 -11
- package/dist/Calendar/properties.d.ts +0 -11
- package/dist/Chat/Chat.svelte +9 -29
- package/dist/Chat/properties.d.ts +0 -9
- package/dist/Chat/types.d.ts +7 -0
- package/dist/ChatBubble/ChatBubble.svelte +3 -11
- package/dist/ChatBubble/properties.d.ts +0 -3
- package/dist/ChatComposer/ChatComposer.svelte +18 -44
- package/dist/ChatComposer/properties.d.ts +0 -12
- package/dist/ChatHeader/ChatHeader.svelte +1 -5
- package/dist/ChatHeader/properties.d.ts +0 -1
- package/dist/ChatMessage/ChatMessage.svelte +164 -15
- package/dist/ChatMessage/properties.d.ts +34 -3
- package/dist/ChatMessageList/ChatMessageList.svelte +5 -11
- package/dist/ChatMessageList/properties.d.ts +0 -6
- package/dist/ChatSuggestions/ChatSuggestions.svelte +1 -5
- package/dist/ChatSuggestions/properties.d.ts +0 -1
- package/dist/CheckListItem/CheckListItem.svelte +1 -5
- package/dist/CheckListItem/properties.d.ts +0 -1
- package/dist/Checkbox/Checkbox.svelte +1 -5
- package/dist/Checkbox/properties.d.ts +0 -1
- package/dist/ChipInput/ChipInput.svelte +10 -20
- package/dist/ChipInput/properties.d.ts +0 -4
- package/dist/Choicebox/Choicebox.svelte +1 -5
- package/dist/Choicebox/properties.d.ts +0 -1
- package/dist/ColorPicker/ColorPicker.svelte +4 -10
- package/dist/ColorPicker/properties.d.ts +0 -2
- package/dist/Combobox/Combobox.svelte +15 -33
- package/dist/Combobox/properties.d.ts +0 -8
- package/dist/CommandMenu/CommandMenu.svelte +2 -8
- package/dist/CommandMenu/properties.d.ts +0 -2
- package/dist/ContextMenu/ContextMenu.svelte +3 -11
- package/dist/ContextMenu/properties.d.ts +0 -3
- package/dist/DateRangePicker/DateRangePicker.svelte +6 -20
- package/dist/DateRangePicker/properties.d.ts +0 -19
- package/dist/Draggable/Draggable.svelte +7 -7
- package/dist/Draggable/properties.d.ts +3 -3
- package/dist/DualAxisBarChart/DualAxisBarChart.svelte +1 -5
- package/dist/DualAxisBarChart/properties.d.ts +0 -4
- package/dist/FileDropzoneTrigger/FileDropzoneTrigger.svelte +1 -5
- package/dist/FileDropzoneTrigger/properties.d.ts +0 -1
- package/dist/FileInput/FileInput.svelte +2 -8
- package/dist/FileInput/properties.d.ts +0 -2
- package/dist/FunnelChart/FunnelChart.svelte +2 -8
- package/dist/FunnelChart/properties.d.ts +0 -8
- package/dist/Gallery/Gallery.svelte +15 -15
- package/dist/Gallery/properties.d.ts +6 -6
- package/dist/HITL/HITL.svelte +10 -8
- package/dist/HITL/properties.d.ts +2 -2
- package/dist/IframeViewer/IframeViewer.svelte +3 -2
- package/dist/IframeViewer/properties.d.ts +1 -1
- package/dist/Img/Img.svelte +119 -39
- package/dist/Img/properties.d.ts +0 -1
- package/dist/Input/Input.svelte +22 -37
- package/dist/Input/properties.d.ts +3 -10
- package/dist/InputButton/InputButton.svelte +2 -2
- package/dist/LineChart/LineChart.svelte +4 -10
- package/dist/LineChart/properties.d.ts +1 -11
- package/dist/ListItem/ListItem.svelte +10 -22
- package/dist/ListItem/properties.d.ts +5 -10
- package/dist/LottiePlayer/LottiePlayer.svelte +2 -8
- package/dist/LottiePlayer/properties.d.ts +0 -2
- package/dist/MediaPlayer/MediaPlayer.svelte +1 -5
- package/dist/MediaPlayer/properties.d.ts +0 -1
- package/dist/MediaUpload/MediaUpload.svelte +6 -6
- package/dist/MediaUpload/properties.d.ts +3 -3
- package/dist/Menu/Menu.svelte +3 -11
- package/dist/Menu/properties.d.ts +0 -3
- package/dist/Modal/Modal.svelte +15 -31
- package/dist/Modal/properties.d.ts +5 -11
- package/dist/Pagination/Pagination.svelte +3 -7
- package/dist/Pagination/properties.d.ts +1 -2
- package/dist/PieChart/PieChart.svelte +4 -10
- package/dist/PieChart/properties.d.ts +1 -9
- package/dist/Pill/Pill.svelte +1 -5
- package/dist/Pill/properties.d.ts +0 -1
- package/dist/Radio/Radio.svelte +1 -5
- package/dist/Radio/properties.d.ts +0 -1
- package/dist/Resizable/Resizable.svelte +3 -11
- package/dist/Resizable/properties.d.ts +0 -3
- package/dist/SankeyChart/SankeyChart.svelte +4 -14
- package/dist/SankeyChart/properties.d.ts +0 -12
- package/dist/Scroller/Scroller.svelte +1 -5
- package/dist/Scroller/properties.d.ts +0 -1
- package/dist/Select/Select.svelte +3 -11
- package/dist/Select/properties.d.ts +0 -3
- package/dist/Sheet/Sheet.svelte +3 -11
- package/dist/Sheet/properties.d.ts +0 -3
- package/dist/Slider/Slider.svelte +2 -8
- package/dist/Slider/properties.d.ts +0 -2
- package/dist/Snippet/Snippet.svelte +1 -5
- package/dist/Snippet/properties.d.ts +0 -1
- package/dist/SplitButton/SplitButton.svelte +1 -5
- package/dist/SplitButton/properties.d.ts +0 -1
- package/dist/SplitInput/SplitInput.svelte +6 -14
- package/dist/SplitInput/properties.d.ts +0 -3
- package/dist/StatCard/StatCard.svelte +2 -2
- package/dist/StatCard/properties.d.ts +1 -1
- package/dist/Status/Status.svelte +2 -6
- package/dist/Status/properties.d.ts +1 -2
- package/dist/Stepper/Stepper.svelte +2 -12
- package/dist/Stepper/properties.d.ts +1 -14
- package/dist/Table/BuiltinCell.svelte +1 -1
- package/dist/Table/Table.svelte +16 -17
- package/dist/Table/properties.d.ts +3 -35
- package/dist/Tabs/Tabs.svelte +2 -8
- package/dist/Tabs/properties.d.ts +0 -2
- package/dist/TaskList/TaskList.svelte +1 -4
- package/dist/TaskList/properties.d.ts +0 -1
- package/dist/ThemeSwitcher/ThemeSwitcher.svelte +1 -5
- package/dist/ThemeSwitcher/properties.d.ts +0 -1
- package/dist/ThinkingIndicator/ThinkingIndicator.svelte +4 -10
- package/dist/ThinkingIndicator/properties.d.ts +1 -3
- package/dist/Toast/Toast.svelte +2 -2
- package/dist/Toast/properties.d.ts +1 -1
- package/dist/Toggle/Toggle.svelte +1 -5
- package/dist/Toggle/properties.d.ts +0 -1
- package/dist/ToolCallLog/ToolCallLog.svelte +1 -10
- package/dist/ToolCallLog/properties.d.ts +0 -1
- package/dist/Toolbar/Toolbar.svelte +2 -6
- package/dist/Toolbar/properties.d.ts +1 -2
- package/dist/TypewriterText/TypewriterText.svelte +3 -3
- package/dist/TypewriterText/properties.d.ts +1 -1
- package/dist-codemod/bin.js +32 -0
- package/dist-codemod/cli.js +175 -0
- package/dist-codemod/legacy-pairs.js +228 -0
- package/dist-codemod/transform.js +278 -0
- package/dist-codemod/wc-children.js +66 -0
- package/dist-wc/index.js +4629 -5218
- package/package.json +9 -7
- package/scripts/postinstall.mjs +14 -12
- package/dist/deprecation.d.ts +0 -42
- package/dist/deprecation.js +0 -57
- package/scripts/codemod/README.md +0 -76
- package/scripts/codemod/cli.ts +0 -206
- package/scripts/codemod/map.ts +0 -118
- package/scripts/codemod/transform.ts +0 -549
- package/scripts/codemod/tsconfig.json +0 -15
- package/scripts/codemod/wc-children.ts +0 -75
|
@@ -9,14 +9,10 @@
|
|
|
9
9
|
showCopyButton = true,
|
|
10
10
|
testId,
|
|
11
11
|
copyIcon,
|
|
12
|
-
oncopy
|
|
13
|
-
onCopy,
|
|
12
|
+
oncopy,
|
|
14
13
|
classes
|
|
15
14
|
}: SnippetProperties = $props();
|
|
16
15
|
|
|
17
|
-
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
18
|
-
const oncopy = $derived(onCopy ?? oncopyLegacy);
|
|
19
|
-
|
|
20
16
|
let copied = $state(false);
|
|
21
17
|
|
|
22
18
|
async function handleCopy() {
|
|
@@ -13,13 +13,9 @@
|
|
|
13
13
|
dropdownIcon,
|
|
14
14
|
classes,
|
|
15
15
|
onclick,
|
|
16
|
-
onselect
|
|
17
|
-
onSelect
|
|
16
|
+
onselect
|
|
18
17
|
}: SplitButtonProperties = $props();
|
|
19
18
|
|
|
20
|
-
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
21
|
-
const onselect = $derived(onSelect ?? onselectLegacy);
|
|
22
|
-
|
|
23
19
|
let menuOpen = $state(false);
|
|
24
20
|
|
|
25
21
|
function handlePrimaryClick(event: MouseEvent): void {
|
|
@@ -12,19 +12,11 @@
|
|
|
12
12
|
separator,
|
|
13
13
|
testId,
|
|
14
14
|
classes,
|
|
15
|
-
onchange
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
onInput,
|
|
19
|
-
oncomplete: oncompleteLegacy,
|
|
20
|
-
onComplete
|
|
15
|
+
onchange,
|
|
16
|
+
oninput,
|
|
17
|
+
oncomplete
|
|
21
18
|
}: SplitInputProperties = $props();
|
|
22
19
|
|
|
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
|
-
|
|
28
20
|
let fieldCount = $derived(typeof fields !== 'undefined' ? fields.length : length);
|
|
29
21
|
|
|
30
22
|
let fieldConfigs: FieldConfig[] = $derived(
|
|
@@ -252,9 +244,9 @@
|
|
|
252
244
|
disable={disabled}
|
|
253
245
|
actionInput={true}
|
|
254
246
|
classes="field-group-input"
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
247
|
+
oninput={(v) => handleFieldInput(index, v)}
|
|
248
|
+
onkeydown={(e) => handleKeyDown(e, index)}
|
|
249
|
+
onpaste={(e) => handlePaste(e, index)}
|
|
258
250
|
bind:this={inputRefs[index]}
|
|
259
251
|
/>
|
|
260
252
|
{#if typeof config.label === 'string'}
|
|
@@ -15,9 +15,6 @@ export type OptionalSplitInputProperties = {
|
|
|
15
15
|
};
|
|
16
16
|
export type SplitInputEventProperties = {
|
|
17
17
|
onchange?: (values: string[]) => void;
|
|
18
|
-
onChange?: (values: string[]) => void;
|
|
19
18
|
oninput?: (values: string[]) => void;
|
|
20
|
-
onInput?: (values: string[]) => void;
|
|
21
19
|
oncomplete?: (values: string[]) => void;
|
|
22
|
-
onComplete?: (values: string[]) => void;
|
|
23
20
|
};
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
testId,
|
|
22
22
|
classes,
|
|
23
23
|
onclick,
|
|
24
|
-
|
|
24
|
+
oncheckboxchange
|
|
25
25
|
}: StatCardProperties = $props();
|
|
26
26
|
|
|
27
27
|
const isInteractive = $derived(typeof onclick === 'function');
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
const handleCheckboxChange = (checked: boolean): void => {
|
|
70
|
-
|
|
70
|
+
oncheckboxchange?.(checked);
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
/**
|
|
@@ -142,5 +142,5 @@ export type StatCardEventProperties = {
|
|
|
142
142
|
/** Makes the card interactive: adds `role="button"`, `tabindex=0`, and wires click/Enter/Space. */
|
|
143
143
|
onclick?: (event: MouseEvent) => void;
|
|
144
144
|
/** Fired when the header checkbox changes. */
|
|
145
|
-
|
|
145
|
+
oncheckboxchange?: (checked: boolean) => void;
|
|
146
146
|
};
|
|
@@ -33,8 +33,7 @@
|
|
|
33
33
|
statusDescription = '',
|
|
34
34
|
buttonProperties,
|
|
35
35
|
classes,
|
|
36
|
-
|
|
37
|
-
onButtonClick,
|
|
36
|
+
onbuttonclick,
|
|
38
37
|
icon,
|
|
39
38
|
descriptionSnippet,
|
|
40
39
|
children,
|
|
@@ -46,9 +45,6 @@
|
|
|
46
45
|
const statusIconFallback = $derived(
|
|
47
46
|
statusIcon === LEGACY_DEFAULT_STATUS_ICON ? BUILTIN_STATUS_ICON : null
|
|
48
47
|
);
|
|
49
|
-
|
|
50
|
-
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
51
|
-
const onbuttonClick = $derived(onButtonClick ?? onbuttonClickLegacy);
|
|
52
48
|
</script>
|
|
53
49
|
|
|
54
50
|
<div
|
|
@@ -78,7 +74,7 @@
|
|
|
78
74
|
{/if}
|
|
79
75
|
</div>
|
|
80
76
|
{#if typeof buttonProperties === 'object'}
|
|
81
|
-
<Button {...buttonProperties} onclick={
|
|
77
|
+
<Button {...buttonProperties} onclick={onbuttonclick} />
|
|
82
78
|
{/if}
|
|
83
79
|
{#if typeof children === 'function'}
|
|
84
80
|
{@render children()}
|
|
@@ -10,16 +10,9 @@
|
|
|
10
10
|
testId,
|
|
11
11
|
suppressRoleAndTabindex,
|
|
12
12
|
suppressContainerTestId,
|
|
13
|
-
|
|
14
|
-
onStepClick,
|
|
15
|
-
onhandleStepClick: onhandleStepClickLegacy,
|
|
16
|
-
onHandleStepClick
|
|
13
|
+
onhandlestepclick
|
|
17
14
|
}: StepperProperties = $props();
|
|
18
15
|
|
|
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
|
-
|
|
23
16
|
const resolveStatus = (stepIndex: number, explicitStatus: StepStatus | null): StepStatus => {
|
|
24
17
|
if (explicitStatus !== null) {
|
|
25
18
|
return explicitStatus;
|
|
@@ -33,9 +26,6 @@
|
|
|
33
26
|
return 'pending';
|
|
34
27
|
};
|
|
35
28
|
|
|
36
|
-
// Support the deprecated onhandleStepClick alias — onstepclick takes priority.
|
|
37
|
-
const effectiveStepClick = $derived(onstepclick ?? onhandleStepClick);
|
|
38
|
-
|
|
39
29
|
// Per-step ids always derive from testId, even when the container itself is
|
|
40
30
|
// opted out of claiming it — only the container's own data-pw/testID is suppressed.
|
|
41
31
|
const containerTestId = $derived(
|
|
@@ -61,7 +51,7 @@
|
|
|
61
51
|
: ''} {effectiveStatus === 'completed' ? 'completed-step' : ''}"
|
|
62
52
|
>
|
|
63
53
|
<Step
|
|
64
|
-
onclick={
|
|
54
|
+
onclick={onhandlestepclick}
|
|
65
55
|
label={currentStep.label}
|
|
66
56
|
icon={currentStep.icon}
|
|
67
57
|
stepIndex={stepIndex + 1}
|
|
@@ -52,17 +52,7 @@ export type OptionalStepperProperties = {
|
|
|
52
52
|
suppressContainerTestId?: boolean;
|
|
53
53
|
};
|
|
54
54
|
export type StepperEventProperties = {
|
|
55
|
-
|
|
56
|
-
selectedIndex: number;
|
|
57
|
-
}) => void;
|
|
58
|
-
onStepClick?: (event: {
|
|
59
|
-
selectedIndex: number;
|
|
60
|
-
}) => void;
|
|
61
|
-
/** @deprecated Use `onstepclick` instead. */
|
|
62
|
-
onhandleStepClick?: (event: {
|
|
63
|
-
selectedIndex: number;
|
|
64
|
-
}) => void;
|
|
65
|
-
onHandleStepClick?: (event: {
|
|
55
|
+
onhandlestepclick?: (event: {
|
|
66
56
|
selectedIndex: number;
|
|
67
57
|
}) => void;
|
|
68
58
|
};
|
|
@@ -84,9 +74,6 @@ export type StepEventProperties = {
|
|
|
84
74
|
onclick?: (event: {
|
|
85
75
|
selectedIndex: number;
|
|
86
76
|
}) => void;
|
|
87
|
-
onClick?: (event: {
|
|
88
|
-
selectedIndex: number;
|
|
89
|
-
}) => void;
|
|
90
77
|
onkeydown?: (event: KeyboardEvent) => void;
|
|
91
78
|
};
|
|
92
79
|
export type StepProperties = OptionalStepProperties & StepEventProperties & {
|
|
@@ -352,7 +352,7 @@
|
|
|
352
352
|
: null}
|
|
353
353
|
onErrorMessage={inputData.onErrorMessage ?? null}
|
|
354
354
|
actionInput={false}
|
|
355
|
-
|
|
355
|
+
oninput={(newValue) => column.onInput?.(rowIndex, newValue, originalIndex)}
|
|
356
356
|
{...inputData.iconUrl ? { leftIcon: inputLeadingIcon } : {}}
|
|
357
357
|
/>
|
|
358
358
|
</span>
|
package/dist/Table/Table.svelte
CHANGED
|
@@ -36,16 +36,15 @@
|
|
|
36
36
|
sortDefaultIcon,
|
|
37
37
|
cell,
|
|
38
38
|
empty,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
onCellChange: _onCellChange,
|
|
39
|
+
onrowclick,
|
|
40
|
+
onsort,
|
|
42
41
|
classes,
|
|
43
42
|
paginatorSlot,
|
|
44
43
|
getRowTestId,
|
|
45
44
|
getCellTestId,
|
|
46
45
|
checkboxSelection,
|
|
47
46
|
searchConfig,
|
|
48
|
-
|
|
47
|
+
onsearchchange,
|
|
49
48
|
pagination,
|
|
50
49
|
toolbarSlot,
|
|
51
50
|
rowNumberColumn = false,
|
|
@@ -111,12 +110,12 @@
|
|
|
111
110
|
sortColumn = colIndex;
|
|
112
111
|
sortDirection = 'asc';
|
|
113
112
|
}
|
|
114
|
-
|
|
113
|
+
onsort?.(colIndex, sortDirection);
|
|
115
114
|
};
|
|
116
115
|
|
|
117
116
|
// ─── Row click ───────────────────────────────────────────────────────────────
|
|
118
117
|
const handleRowClick = (rowIndex: number, rowData: JSONValue[], originalIndex: number): void => {
|
|
119
|
-
|
|
118
|
+
onrowclick?.(rowIndex, rowData, originalIndex);
|
|
120
119
|
};
|
|
121
120
|
|
|
122
121
|
const handleRowKeydown = (
|
|
@@ -127,11 +126,11 @@
|
|
|
127
126
|
): void => {
|
|
128
127
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
129
128
|
event.preventDefault();
|
|
130
|
-
|
|
129
|
+
onrowclick?.(rowIndex, rowData, originalIndex);
|
|
131
130
|
}
|
|
132
131
|
};
|
|
133
132
|
|
|
134
|
-
let isRowClickable = $derived(typeof
|
|
133
|
+
let isRowClickable = $derived(typeof onrowclick === 'function');
|
|
135
134
|
let isStickyHeader = $derived(stickyHeader || isTableScrollable);
|
|
136
135
|
|
|
137
136
|
// ─── Horizontal-scroll affordance ────────────────────────────────────────
|
|
@@ -168,7 +167,7 @@
|
|
|
168
167
|
// ─── C2-3: Search ─────────────────────────────────────────────────────────
|
|
169
168
|
let searchTerm = $state('');
|
|
170
169
|
let hasSearchConfig = $derived(!!searchConfig);
|
|
171
|
-
let isServerSearch = $derived(typeof
|
|
170
|
+
let isServerSearch = $derived(typeof onsearchchange === 'function');
|
|
172
171
|
let searchInputRef = $state<HTMLInputElement | null>(null);
|
|
173
172
|
let inlineSearchInputRef = $state<{ focus: () => void } | null>(null);
|
|
174
173
|
let inlineSearchTriggerRef = $state<HTMLElement | null>(null);
|
|
@@ -180,7 +179,7 @@
|
|
|
180
179
|
pageOverride = 1;
|
|
181
180
|
pagination?.onPageChange?.(1);
|
|
182
181
|
if (isServerSearch) {
|
|
183
|
-
|
|
182
|
+
onsearchchange?.(term);
|
|
184
183
|
}
|
|
185
184
|
};
|
|
186
185
|
|
|
@@ -217,7 +216,7 @@
|
|
|
217
216
|
|
|
218
217
|
// The expanded guard matters: collapsing unmounts the focused input, which can
|
|
219
218
|
// fire blur on the way out. Without it, an Escape (or close-button) collapse
|
|
220
|
-
// re-enters clearSearch and fires a second
|
|
219
|
+
// re-enters clearSearch and fires a second onsearchchange('') — a duplicate
|
|
221
220
|
// request on the server-search path.
|
|
222
221
|
const collapseInlineSearchIfEmpty = (): void => {
|
|
223
222
|
if (isInlineSearchExpanded && searchTerm.trim() === '') {
|
|
@@ -305,7 +304,7 @@
|
|
|
305
304
|
});
|
|
306
305
|
|
|
307
306
|
/**
|
|
308
|
-
* Client-side filtered rows. When `
|
|
307
|
+
* Client-side filtered rows. When `onsearchchange` is provided (server
|
|
309
308
|
* delegation) or `searchConfig` is absent, the sorted data passes through
|
|
310
309
|
* untouched.
|
|
311
310
|
*/
|
|
@@ -406,7 +405,7 @@
|
|
|
406
405
|
/**
|
|
407
406
|
* Offset that converts the render loop's page-local index back into an index
|
|
408
407
|
* into the consumer-supplied rows. Client-mode pagination slices internally,
|
|
409
|
-
* so page 2+ would otherwise hand handlers (
|
|
408
|
+
* so page 2+ would otherwise hand handlers (onrowclick, column handlers,
|
|
410
409
|
* cell snippets, test-id callbacks) an index that mis-addresses the
|
|
411
410
|
* consumer's full array. Server mode supplies the current page as the whole
|
|
412
411
|
* array, so no offset applies.
|
|
@@ -837,9 +836,9 @@
|
|
|
837
836
|
testId={searchConfig?.testId ?? ''}
|
|
838
837
|
ariaLabel={searchConfig?.placeholder ?? 'Search'}
|
|
839
838
|
autoComplete="off"
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
839
|
+
oninput={(value: string) => updateSearch(value)}
|
|
840
|
+
onblur={collapseInlineSearchIfEmpty}
|
|
841
|
+
onkeydown={handleInlineSearchKeyDown}
|
|
843
842
|
classes="table-inline-search-input"
|
|
844
843
|
/>
|
|
845
844
|
<span class="table-inline-search-clear">
|
|
@@ -1077,7 +1076,7 @@
|
|
|
1077
1076
|
prevButtonTestId={pagination.prevButtonTestId}
|
|
1078
1077
|
nextButtonTestId={pagination.nextButtonTestId}
|
|
1079
1078
|
onchange={handlePageChange}
|
|
1080
|
-
|
|
1079
|
+
onloadmore={pagination.onLoadMore}
|
|
1081
1080
|
/>
|
|
1082
1081
|
{/if}
|
|
1083
1082
|
</span>
|
|
@@ -526,44 +526,12 @@ export type OptionalTableProperties = {
|
|
|
526
526
|
searchConfig?: TableSearchConfig;
|
|
527
527
|
};
|
|
528
528
|
export type TableEventProperties = {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
/**
|
|
532
|
-
* C2-2: Callback invoked when a cell value changes via an editable element
|
|
533
|
-
* inside the consumer's `cell` snippet (e.g. an `<Input>` or `<Select>`).
|
|
534
|
-
*
|
|
535
|
-
* **How to wire it**: Svelte 5 snippets execute in the consumer's scope, so
|
|
536
|
-
* `onCellChange` is NOT forwarded by Table — you must close over your own
|
|
537
|
-
* handler directly inside the snippet:
|
|
538
|
-
*
|
|
539
|
-
* ```svelte
|
|
540
|
-
* <script>
|
|
541
|
-
* let rows = $state(myData);
|
|
542
|
-
* const handleCellChange = (rowIndex, colIndex, newValue) => {
|
|
543
|
-
* rows[rowIndex][colIndex] = newValue;
|
|
544
|
-
* };
|
|
545
|
-
* </script>
|
|
546
|
-
*
|
|
547
|
-
* <Table tableData={rows}>
|
|
548
|
-
* {#snippet cell(value, rowIndex, colIndex)}
|
|
549
|
-
* <Input
|
|
550
|
-
* value={String(value ?? '')}
|
|
551
|
-
* onInput={(newValue) => handleCellChange(rowIndex, colIndex, newValue)}
|
|
552
|
-
* />
|
|
553
|
-
* {/snippet}
|
|
554
|
-
* </Table>
|
|
555
|
-
* ```
|
|
556
|
-
*
|
|
557
|
-
* Table never mutates `tableData`; the consumer owns the source-of-truth
|
|
558
|
-
* array. Pass `onCellChange` as a top-level prop if you want Table to expose
|
|
559
|
-
* this handler to parent components via the standard props channel — it does
|
|
560
|
-
* not change the wiring inside the snippet.
|
|
561
|
-
*/
|
|
562
|
-
onCellChange?: (rowIndex: number, colIndex: number, newValue: JSONValue) => void;
|
|
529
|
+
onrowclick?: (rowIndex: number, rowData: JSONValue[], originalIndex: number) => void;
|
|
530
|
+
onsort?: (columnIndex: number, direction: SortDirection) => void;
|
|
563
531
|
/**
|
|
564
532
|
* C2-3: When provided, the built-in client-side filtering is disabled and
|
|
565
533
|
* this callback is called on every search input change instead, letting the
|
|
566
534
|
* server decide what rows to show.
|
|
567
535
|
*/
|
|
568
|
-
|
|
536
|
+
onsearchchange?: (searchTerm: string) => void;
|
|
569
537
|
};
|
package/dist/Tabs/Tabs.svelte
CHANGED
|
@@ -18,16 +18,10 @@
|
|
|
18
18
|
scrollRightIcon,
|
|
19
19
|
tab,
|
|
20
20
|
classes,
|
|
21
|
-
onchange
|
|
22
|
-
|
|
23
|
-
onkeychange: onkeychangeLegacy,
|
|
24
|
-
onKeyChange
|
|
21
|
+
onchange,
|
|
22
|
+
onkeychange
|
|
25
23
|
}: TabsProperties = $props();
|
|
26
24
|
|
|
27
|
-
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
28
|
-
const onchange = $derived(onChange ?? onchangeLegacy);
|
|
29
|
-
const onkeychange = $derived(onKeyChange ?? onkeychangeLegacy);
|
|
30
|
-
|
|
31
25
|
const isVertical = $derived(orientation === 'vertical');
|
|
32
26
|
|
|
33
27
|
const isObjectMode = $derived(items.length > 0 && typeof items.at(0) === 'object');
|
|
@@ -55,7 +55,5 @@ export type OptionalTabsProperties = {
|
|
|
55
55
|
};
|
|
56
56
|
export type TabsEventProperties = {
|
|
57
57
|
onchange?: (index: number, label: string) => void;
|
|
58
|
-
onChange?: (index: number, label: string) => void;
|
|
59
58
|
onkeychange?: (key: string) => void;
|
|
60
|
-
onKeyChange?: (key: string) => void;
|
|
61
59
|
};
|
|
@@ -4,10 +4,7 @@
|
|
|
4
4
|
import Button from '../Button/Button.svelte';
|
|
5
5
|
import type { TaskListProperties } from './properties';
|
|
6
6
|
|
|
7
|
-
let { rows, onretry
|
|
8
|
-
|
|
9
|
-
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
10
|
-
const onretry = $derived(onRetry ?? onretryLegacy);
|
|
7
|
+
let { rows, onretry, testId, classes }: TaskListProperties = $props();
|
|
11
8
|
|
|
12
9
|
// Rows appended in one update stagger relative to the batch, not the list start —
|
|
13
10
|
// mirrors ThinkingTrace's growthWatcher so a host that streams rows in gets the
|
|
@@ -19,7 +19,6 @@ export type MandatoryTaskListProperties = {
|
|
|
19
19
|
export type OptionalTaskListProperties = {
|
|
20
20
|
/** Fires when a failed row's retry button is clicked, with that row's index. */
|
|
21
21
|
onretry?: (index: number) => void;
|
|
22
|
-
onRetry?: (index: number) => void;
|
|
23
22
|
testId?: string;
|
|
24
23
|
classes?: string;
|
|
25
24
|
};
|
|
@@ -30,13 +30,9 @@
|
|
|
30
30
|
storageKey = 'theme-preference',
|
|
31
31
|
testId,
|
|
32
32
|
classes,
|
|
33
|
-
onchange
|
|
34
|
-
onChange
|
|
33
|
+
onchange
|
|
35
34
|
}: ThemeSwitcherProperties = $props();
|
|
36
35
|
|
|
37
|
-
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
38
|
-
const onchange = $derived(onChange ?? onchangeLegacy);
|
|
39
|
-
|
|
40
36
|
let currentValue: string = $state(value ?? 'system');
|
|
41
37
|
let systemPreference: string = $state('light');
|
|
42
38
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
expanded = $bindable(false),
|
|
13
13
|
variant = 'default',
|
|
14
14
|
showElapsed = false,
|
|
15
|
-
|
|
15
|
+
ontoggle,
|
|
16
16
|
avatar,
|
|
17
17
|
toggleIcon,
|
|
18
18
|
testId,
|
|
@@ -27,17 +27,11 @@
|
|
|
27
27
|
moreLabel,
|
|
28
28
|
selectable = false,
|
|
29
29
|
selected = $bindable(null),
|
|
30
|
-
onrowselect
|
|
31
|
-
|
|
32
|
-
onsettled: onsettledLegacy,
|
|
33
|
-
onSettled,
|
|
30
|
+
onrowselect,
|
|
31
|
+
onsettled,
|
|
34
32
|
collapseDelayMs = 2600
|
|
35
33
|
}: ThinkingIndicatorProperties = $props();
|
|
36
34
|
|
|
37
|
-
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
38
|
-
const onrowselect = $derived(onRowSelect ?? onrowselectLegacy);
|
|
39
|
-
const onsettled = $derived(onSettled ?? onsettledLegacy);
|
|
40
|
-
|
|
41
35
|
// `rows` being present at all (even `[]`) puts the indicator into trace mode: the
|
|
42
36
|
// Accordion body renders the kind-aware trace instead of the `detail` paragraph,
|
|
43
37
|
// and that alone is enough to make the indicator expandable.
|
|
@@ -68,7 +62,7 @@
|
|
|
68
62
|
const handleToggle = (): void => {
|
|
69
63
|
manuallyToggled = true;
|
|
70
64
|
expanded = !expanded;
|
|
71
|
-
|
|
65
|
+
ontoggle?.();
|
|
72
66
|
};
|
|
73
67
|
|
|
74
68
|
// Elapsed counter: ticks while the label is live (see `labelIsBusy`); freezes at its
|
|
@@ -43,7 +43,7 @@ export type OptionalThinkingIndicatorProperties = {
|
|
|
43
43
|
* shape). No effect on the `bare` or `chip` variants.
|
|
44
44
|
*/
|
|
45
45
|
showElapsed?: boolean;
|
|
46
|
-
|
|
46
|
+
ontoggle?: () => void;
|
|
47
47
|
/** Leading indicator. Falls back to the built-in `Loader` spinner. */
|
|
48
48
|
avatar?: Snippet;
|
|
49
49
|
/** Disclosure chevron. Falls back to a built-in chevron that rotates on expand. */
|
|
@@ -83,10 +83,8 @@ export type OptionalThinkingIndicatorProperties = {
|
|
|
83
83
|
/** Bindable index of the selected coding row (`null` = none). */
|
|
84
84
|
selected?: number | null;
|
|
85
85
|
onrowselect?: (index: number | null) => void;
|
|
86
|
-
onRowSelect?: (index: number | null) => void;
|
|
87
86
|
/** Fires exactly once, the moment `busy` flips false. No effect while `busy` is never set. */
|
|
88
87
|
onsettled?: () => void;
|
|
89
|
-
onSettled?: () => void;
|
|
90
88
|
/**
|
|
91
89
|
* Delay (ms) before the automatic post-settle collapse fires once `busy` flips
|
|
92
90
|
* false. `null` disables the automatic collapse. Has no effect while `busy` is
|
package/dist/Toast/Toast.svelte
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
messageTestId,
|
|
23
23
|
subTextTestId,
|
|
24
24
|
closeIconTestId,
|
|
25
|
-
|
|
25
|
+
ontoasthide,
|
|
26
26
|
bottomContent,
|
|
27
27
|
classes
|
|
28
28
|
}: ToastProperties = $props();
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
function handleAnimationEnd() {
|
|
43
|
-
|
|
43
|
+
ontoasthide?.();
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
function getAnimationConfig(
|
|
@@ -24,6 +24,6 @@ export type OptionalToastProperties = {
|
|
|
24
24
|
classes?: string;
|
|
25
25
|
};
|
|
26
26
|
export type ToastEventProperties = {
|
|
27
|
-
|
|
27
|
+
ontoasthide?: () => void;
|
|
28
28
|
};
|
|
29
29
|
export type ToastProperties = MandatoryToastProperties & OptionalToastProperties & ToastEventProperties;
|
|
@@ -10,13 +10,9 @@
|
|
|
10
10
|
id,
|
|
11
11
|
ariaLabel,
|
|
12
12
|
ariaLabelledby,
|
|
13
|
-
onclick
|
|
14
|
-
onClick
|
|
13
|
+
onclick
|
|
15
14
|
}: ToggleProperties = $props();
|
|
16
15
|
|
|
17
|
-
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
18
|
-
const onclick = $derived(onClick ?? onclickLegacy);
|
|
19
|
-
|
|
20
16
|
// Stable across hydration so the hidden input stays named and text remains clickable.
|
|
21
17
|
const generatedId = $props.id();
|
|
22
18
|
const inputId = $derived(id?.trim() || `toggle-${generatedId}`);
|
|
@@ -6,16 +6,7 @@
|
|
|
6
6
|
import { computeMenuDropdownPosition } from '../Menu/dropdownPosition';
|
|
7
7
|
import type { ToolCallChip, ToolCallLogProperties } from './properties';
|
|
8
8
|
|
|
9
|
-
let {
|
|
10
|
-
chips,
|
|
11
|
-
onchipclick: onchipclickLegacy,
|
|
12
|
-
onChipClick,
|
|
13
|
-
testId,
|
|
14
|
-
classes
|
|
15
|
-
}: ToolCallLogProperties = $props();
|
|
16
|
-
|
|
17
|
-
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
18
|
-
const onchipclick = $derived(onChipClick ?? onchipclickLegacy);
|
|
9
|
+
let { chips, onchipclick, testId, classes }: ToolCallLogProperties = $props();
|
|
19
10
|
|
|
20
11
|
// Exactly one popover open at a time, component-local.
|
|
21
12
|
let openIndex = $state<number | null>(null);
|
|
@@ -22,7 +22,6 @@ export type MandatoryToolCallLogProperties = {
|
|
|
22
22
|
};
|
|
23
23
|
export type OptionalToolCallLogProperties = {
|
|
24
24
|
onchipclick?: (index: number, chip: ToolCallChip) => void;
|
|
25
|
-
onChipClick?: (index: number, chip: ToolCallChip) => void;
|
|
26
25
|
testId?: string;
|
|
27
26
|
classes?: string;
|
|
28
27
|
};
|
|
@@ -11,16 +11,12 @@
|
|
|
11
11
|
rightContent,
|
|
12
12
|
additionalContent,
|
|
13
13
|
classes,
|
|
14
|
-
|
|
15
|
-
onBackClick,
|
|
14
|
+
onbackclick,
|
|
16
15
|
onkeydown,
|
|
17
16
|
testId,
|
|
18
17
|
headingTestId
|
|
19
18
|
}: ToolbarProperties = $props();
|
|
20
19
|
|
|
21
|
-
// Event-casing phase 1: both spellings accepted, the correct one wins.
|
|
22
|
-
const onbackClick = $derived(onBackClick ?? onbackClickLegacy);
|
|
23
|
-
|
|
24
20
|
// `backIcon={null}` (or '') has always meant "render no back control at all", and consumers
|
|
25
21
|
// rely on it; only the DEFAULT changes, from a CDN image to the inline icon.
|
|
26
22
|
const showBackControl = $derived(showBackButton && backIcon !== null && backIcon !== '');
|
|
@@ -42,7 +38,7 @@
|
|
|
42
38
|
type="button"
|
|
43
39
|
class="back"
|
|
44
40
|
aria-label={backAccessibleName}
|
|
45
|
-
onclick={
|
|
41
|
+
onclick={onbackclick}
|
|
46
42
|
{onkeydown}
|
|
47
43
|
>
|
|
48
44
|
{#if typeof backIcon === 'string'}
|
|
@@ -13,7 +13,6 @@ export type ToolbarProperties = ToolbarEventProperties & {
|
|
|
13
13
|
headingTestId?: string;
|
|
14
14
|
};
|
|
15
15
|
export type ToolbarEventProperties = {
|
|
16
|
-
|
|
17
|
-
onBackClick?: () => void;
|
|
16
|
+
onbackclick?: () => void;
|
|
18
17
|
onkeydown?: (event: KeyboardEvent) => void;
|
|
19
18
|
};
|