Skip to content

Commit 7faa861

Browse files
authored
Remove double inits from snippets and check formatting (#2162)
1 parent abc58a9 commit 7faa861

File tree

17 files changed

+114
-299
lines changed

17 files changed

+114
-299
lines changed

site/content/docs/standard/components/chips/index.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,12 +1012,8 @@
10121012
{{< /twsnippet/code >}}
10131013
<!-- prettier-ignore -->
10141014
{{< twsnippet/code lang="js" >}}
1015-
import {
1016-
ChipsInput,
1017-
initTE,
1018-
} from "tw-elements";
1015+
import { ChipsInput } from "tw-elements";
10191016

1020-
initTE({ ChipsInput });
10211017

10221018
const chipsInitial = document.querySelector("#chips-initial");
10231019

site/content/docs/standard/components/popconfirm/index.html

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -475,13 +475,8 @@
475475
<!-- prettier-ignore -->
476476
{{< twsnippet/code lang="js" >}}
477477
// Initialization for ES Users
478-
import {
479-
Popconfirm,
480-
initTE,
481-
} from "tw-elements";
482-
483-
initTE({ Popconfirm });
484-
478+
import { Popconfirm } from "tw-elements";
479+
485480
const iconExample = document.getElementById("icon-example");
486481
new Popconfirm(iconExample, {
487482
popconfirmIconTemplate: `<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5">

site/content/docs/standard/components/rating/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2656,7 +2656,7 @@
26562656
initTE,
26572657
} from "tw-elements";
26582658

2659-
initTE({ Rating, Popover });
2659+
initTE({ Rating });
26602660

26612661
const popoverIcon = document.querySelectorAll('#popover-example [data-te-rating-icon-ref]');
26622662

site/content/docs/standard/content-styles/animations/index-js.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
animationRepeat: true,
3838
});
3939

40-
changeAnimation.init();
41-
4240
changeAnimationBtn.addEventListener("click", () => {
4341
if (animation === "pulse") {
4442
animation = "spin";

site/content/docs/standard/content-styles/animations/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,7 @@ <h2 class="mb-5 text-lg font-bold">Start animation manually</h2>
15741574
initTE,
15751575
} from "tw-elements";
15761576

1577-
initTE({ Animate, Ripple });
1577+
initTE({ Ripple });
15781578

15791579
const manuallyEl = document.getElementById("manually-example");
15801580
const manuallyBtnStart = document.querySelector(
@@ -1707,7 +1707,6 @@ <h2 class="mb-5 text-lg font-bold">Change animation type</h2>
17071707
animationStart: "onLoad",
17081708
animationRepeat: true,
17091709
});
1710-
changeAnimation.init();
17111710
changeAnimationBtn.addEventListener("click", () => {
17121711
if (animation === "pulse") {
17131712
animation = "spin";

site/content/docs/standard/data/charts-advanced/index.html

Lines changed: 10 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,8 @@
6565
{{< /twsnippet/code >}}
6666
<!-- prettier-ignore -->
6767
{{< twsnippet/code lang="js" >}}
68-
import {
69-
Chart,
70-
initTE,
71-
} from "tw-elements";
68+
import { Chart } from "tw-elements";
7269

73-
initTE({ Chart });
74-
7570
// Data
7671
const dataChartOptionsExample = {
7772
type: 'bar',
@@ -498,13 +493,8 @@
498493
{{< /twsnippet/code >}}
499494
<!-- prettier-ignore -->
500495
{{< twsnippet/code lang="js" >}}
501-
import {
502-
Chart,
503-
initTE,
504-
} from "tw-elements";
496+
import { Chart } from "tw-elements";
505497

506-
initTE({ Chart });
507-
508498
// Data
509499
const dataMixedChartExample = {
510500
type: 'bar',
@@ -609,13 +599,8 @@
609599
{{< /twsnippet/code >}}
610600
<!-- prettier-ignore -->
611601
{{< twsnippet/code lang="js" >}}
612-
import {
613-
Chart,
614-
initTE,
615-
} from "tw-elements";
602+
import { Chart } from "tw-elements";
616603

617-
initTE({ Chart });
618-
619604
const dataChartDataLabelsExample = {
620605
type: 'pie',
621606
data: {
@@ -773,13 +758,8 @@
773758
{{< /twsnippet/code >}}
774759
<!-- prettier-ignore -->
775760
{{< twsnippet/code lang="js" >}}
776-
import {
777-
Chart,
778-
initTE,
779-
} from "tw-elements";
761+
import { Chart } from "tw-elements";
780762

781-
initTE({ Chart });
782-
783763
const dataChartDobuleYAxisExample = {
784764
type: 'bar',
785765
data: {
@@ -1008,10 +988,7 @@
1008988
{{< /twsnippet/code >}}
1009989
<!-- prettier-ignore -->
1010990
{{< twsnippet/code lang="js" >}}
1011-
import {
1012-
Chart,
1013-
initTE,
1014-
} from "tw-elements";
991+
import { Chart } from "tw-elements";
1015992

1016993
// Data
1017994
const dataChartFunnelExample = {
@@ -1091,7 +1068,7 @@
10911068
}
10921069
}
10931070

1094-
new te.Chart(
1071+
new Chart(
10951072
document.getElementById("chart-funnel-example"),
10961073
dataChartFunnelExample,
10971074
optionsChartFunnelExample,
@@ -1224,13 +1201,8 @@
12241201
{{< /twsnippet/code >}}
12251202
<!-- prettier-ignore -->
12261203
{{< twsnippet/code lang="js" >}}
1227-
import {
1228-
Chart,
1229-
initTE,
1230-
} from "tw-elements";
1204+
import { Chart } from "tw-elements";
12311205

1232-
initTE({ Chart });
1233-
12341206
// Data
12351207
const dataChartValuesFormattingExample = {
12361208
type: 'bar',
@@ -1346,13 +1318,8 @@
13461318
{{< /twsnippet/code >}}
13471319
<!-- prettier-ignore -->
13481320
{{< twsnippet/code lang="js" >}}
1349-
import {
1350-
Chart,
1351-
initTE,
1352-
} from "tw-elements";
1321+
import { Chart } from "tw-elements";
13531322

1354-
initTE({ Chart });
1355-
13561323
// Data
13571324
const dataChartTooltipsFormattingExample = {
13581325
type: 'line',
@@ -1382,7 +1349,7 @@
13821349
},
13831350
};
13841351

1385-
new te.Chart(
1352+
new Chart(
13861353
document.getElementById('chart-tooltips-formatting-example'),
13871354
dataChartTooltipsFormattingExample,
13881355
optionsChartTooltipsFormattingExample
@@ -1461,13 +1428,8 @@
14611428
{{< /twsnippet/code >}}
14621429
<!-- prettier-ignore -->
14631430
{{< twsnippet/code lang="js" >}}
1464-
import {
1465-
Chart,
1466-
initTE,
1467-
} from "tw-elements";
1431+
import { Chart } from "tw-elements";
14681432

1469-
initTE({ Chart });
1470-
14711433
// Data
14721434
const dataChartBarDoubleDatasetsExample = {
14731435
type: 'bar',

site/content/docs/standard/data/charts/index.html

Lines changed: 13 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,8 @@
9898
{{< /twsnippet/code >}}
9999
<!-- prettier-ignore -->
100100
{{< twsnippet/code lang="js" >}}
101-
import {
102-
Chart,
103-
initTE,
104-
} from "tw-elements";
101+
import { Chart } from "tw-elements";
105102

106-
initTE({ Chart });
107-
108103
// Chart
109104
const dataBar = {
110105
type: 'bar',
@@ -492,13 +487,8 @@
492487
{{< /twsnippet/code >}}
493488
<!-- prettier-ignore -->
494489
{{< twsnippet/code lang="js" >}}
495-
import {
496-
Chart,
497-
initTE,
498-
} from "tw-elements";
490+
import { Chart } from "tw-elements";
499491

500-
initTE({ Chart });
501-
502492
// Chart
503493
const dataLine = {
504494
type: 'line',
@@ -576,13 +566,8 @@
576566
{{< /twsnippet/code >}}
577567
<!-- prettier-ignore -->
578568
{{< twsnippet/code lang="js" >}}
579-
import {
580-
Chart,
581-
initTE,
582-
} from "tw-elements";
569+
import { Chart } from "tw-elements";
583570

584-
initTE({ Chart });
585-
586571
// Chart
587572
const dataBarHorizontal = {
588573
type: "bar",
@@ -787,13 +772,8 @@
787772
{{< /twsnippet/code >}}
788773
<!-- prettier-ignore -->
789774
{{< twsnippet/code lang="js" >}}
790-
import {
791-
Chart,
792-
initTE,
793-
} from "tw-elements";
775+
import { Chart } from "tw-elements";
794776

795-
initTE({ Chart });
796-
797777
// Chart
798778
const dataPie = {
799779
type: 'pie',
@@ -932,13 +912,8 @@
932912
{{< /twsnippet/code >}}
933913
<!-- prettier-ignore -->
934914
{{< twsnippet/code lang="js" >}}
935-
import {
936-
Chart,
937-
initTE,
938-
} from "tw-elements";
915+
import { Chart } from "tw-elements";
939916

940-
initTE({ Chart });
941-
942917
// Chart
943918
const dataDoughnut = {
944919
type: 'doughnut',
@@ -1077,13 +1052,8 @@
10771052
{{< /twsnippet/code >}}
10781053
<!-- prettier-ignore -->
10791054
{{< twsnippet/code lang="js" >}}
1080-
import {
1081-
Chart,
1082-
initTE,
1083-
} from "tw-elements";
1055+
import { Chart } from "tw-elements";
10841056

1085-
initTE({ Chart });
1086-
10871057
// Chart
10881058
const dataPolar = {
10891059
type: 'polarArea',
@@ -1219,13 +1189,8 @@
12191189
{{< /twsnippet/code >}}
12201190
<!-- prettier-ignore -->
12211191
{{< twsnippet/code lang="js" >}}
1222-
import {
1223-
Chart,
1224-
initTE,
1225-
} from "tw-elements";
1192+
import { Chart } from "tw-elements";
12261193

1227-
initTE({ Chart });
1228-
12291194
// Chart
12301195
const dataRadar = {
12311196
type: 'radar',
@@ -1308,13 +1273,8 @@
13081273
{{< /twsnippet/code >}}
13091274
<!-- prettier-ignore -->
13101275
{{< twsnippet/code lang="js" >}}
1311-
import {
1312-
Chart,
1313-
initTE,
1314-
} from "tw-elements";
1276+
import { Chart } from "tw-elements";
13151277

1316-
initTE({ Chart });
1317-
13181278
// Chart
13191279
const dataBubble = {
13201280
type: "bubble",
@@ -1450,13 +1410,8 @@
14501410
{{< /twsnippet/code >}}
14511411
<!-- prettier-ignore -->
14521412
{{< twsnippet/code lang="js" >}}
1453-
import {
1454-
Chart,
1455-
initTE,
1456-
} from "tw-elements";
1413+
import { Chart } from "tw-elements";
14571414

1458-
initTE({ Chart });
1459-
14601415
// Chart
14611416
const dataScatter = {
14621417
type: "scatter",
@@ -1848,13 +1803,8 @@
18481803
{{< /twsnippet/code >}}
18491804
<!-- prettier-ignore -->
18501805
{{< twsnippet/code lang="js" >}}
1851-
import {
1852-
Chart,
1853-
initTE,
1854-
} from "tw-elements";
1806+
import { Chart } from "tw-elements";
18551807

1856-
initTE({ Chart });
1857-
18581808
const dataBarCustomOptions = {
18591809
type: "bar",
18601810
data: {
@@ -2020,13 +1970,8 @@
20201970
{{< /twsnippet/code >}}
20211971
<!-- prettier-ignore -->
20221972
{{< twsnippet/code lang="js" >}}
2023-
import {
2024-
Chart,
2025-
initTE,
2026-
} from "tw-elements";
1973+
import { Chart } from "tw-elements";
20271974

2028-
initTE({ Chart });
2029-
20301975
const dataBarCustomTooltip = {
20311976
type: "bar",
20321977
data: {
@@ -2235,13 +2180,8 @@
22352180
{{< /twsnippet/code >}}
22362181
<!-- prettier-ignore -->
22372182
{{< twsnippet/code lang="js" >}}
2238-
import {
2239-
Chart,
2240-
initTE,
2241-
} from "tw-elements";
2242-
2243-
initTE({ Chart });
2244-
2183+
import { Chart } from "tw-elements";
2184+
22452185
const dataBarDarkMode = {
22462186
type: "bar",
22472187
data: {

0 commit comments

Comments
 (0)