Skip to content

Commit 2a34f4f

Browse files
authored
fix: typed components update fix (#78)
1 parent 9c074ca commit 2a34f4f

File tree

10 files changed

+26
-10
lines changed

10 files changed

+26
-10
lines changed

.size-limit.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = [
1616
},
1717
{
1818
path: 'package/index.js',
19-
limit: '1.2 KB',
19+
limit: '1.25 KB',
2020
import: '{ Bar }',
2121
modifyWebpackConfig
2222
},

src/Bar.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
ChartJS.register(BarController);
1414
1515
export let chart: $$Props['chart'] = null;
16-
let props = $$props as $$Props;
16+
let props: $$Props;
1717
let baseChartRef: Chart;
1818
1919
useForwardEvents(() => baseChartRef);
20+
21+
$: props = $$props as $$Props;
2022
</script>
2123

2224
<Chart bind:this={baseChartRef} bind:chart type="bar" {...props} />

src/Bubble.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
ChartJS.register(BubbleController);
1414
1515
export let chart: $$Props['chart'] = null;
16-
let props = $$props as $$Props;
16+
let props: $$Props;
1717
let baseChartRef: Chart;
1818
1919
useForwardEvents(() => baseChartRef);
20+
21+
$: props = $$props as $$Props;
2022
</script>
2123

2224
<Chart bind:this={baseChartRef} bind:chart type="bubble" {...props} />

src/Chart.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
if (!chart) return;
4646
4747
chart.data = data;
48-
chart.options = options;
48+
Object.assign(chart.options, options);
4949
chart.update(updateMode);
5050
});
5151

src/Doughnut.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
ChartJS.register(DoughnutController);
1414
1515
export let chart: $$Props['chart'] = null;
16-
let props = $$props as $$Props;
16+
let props: $$Props;
1717
let baseChartRef: Chart;
1818
1919
useForwardEvents(() => baseChartRef);
20+
21+
$: props = $$props as $$Props;
2022
</script>
2123

2224
<Chart bind:this={baseChartRef} bind:chart type="doughnut" {...props} />

src/Line.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
ChartJS.register(LineController);
1414
1515
export let chart: $$Props['chart'] = null;
16-
let props = $$props as $$Props;
16+
let props: $$Props;
1717
let baseChartRef: Chart;
1818
1919
useForwardEvents(() => baseChartRef);
20+
21+
$: props = $$props as $$Props;
2022
</script>
2123

2224
<Chart bind:this={baseChartRef} bind:chart type="line" {...props} />

src/Pie.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
ChartJS.register(PieController);
1414
1515
export let chart: $$Props['chart'] = null;
16-
let props = $$props as $$Props;
16+
let props: $$Props;
1717
let baseChartRef: Chart;
1818
1919
useForwardEvents(() => baseChartRef);
20+
21+
$: props = $$props as $$Props;
2022
</script>
2123

2224
<Chart bind:this={baseChartRef} bind:chart type="pie" {...props} />

src/PolarArea.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
ChartJS.register(PolarAreaController);
1414
1515
export let chart: $$Props['chart'] = null;
16-
let props = $$props as $$Props;
16+
let props: $$Props;
1717
let baseChartRef: Chart;
1818
1919
useForwardEvents(() => baseChartRef);
20+
21+
$: props = $$props as $$Props;
2022
</script>
2123

2224
<Chart bind:this={baseChartRef} bind:chart type="polarArea" {...props} />

src/Radar.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
ChartJS.register(RadarController);
1414
1515
export let chart: $$Props['chart'] = null;
16-
let props = $$props as $$Props;
16+
let props: $$Props;
1717
let baseChartRef: Chart;
1818
1919
useForwardEvents(() => baseChartRef);
20+
21+
$: props = $$props as $$Props;
2022
</script>
2123

2224
<Chart bind:this={baseChartRef} bind:chart type="radar" {...props} />

src/Scatter.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
ChartJS.register(ScatterController);
1414
1515
export let chart: $$Props['chart'] = null;
16-
let props = $$props as $$Props;
16+
let props: $$Props;
1717
let baseChartRef: Chart;
1818
1919
useForwardEvents(() => baseChartRef);
20+
21+
$: props = $$props as $$Props;
2022
</script>
2123

2224
<Chart bind:this={baseChartRef} bind:chart type="scatter" {...props} />

0 commit comments

Comments
 (0)