xmlui 0.10.12 → 0.10.14

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.
Files changed (209) hide show
  1. package/dist/lib/{index-CDOoBf2R.mjs → index-779mp2Bm.mjs} +1508 -1287
  2. package/dist/lib/index.css +1 -1
  3. package/dist/lib/{initMock-BAV9RKui.mjs → initMock-CAXdczCj.mjs} +1 -1
  4. package/dist/lib/scss/components-core/theming/_themes.scss +1 -1
  5. package/dist/lib/xmlui.d.ts +17 -2
  6. package/dist/lib/xmlui.mjs +33 -32
  7. package/dist/metadata/{collectedComponentMetadata-Dp8BqWQO.mjs → collectedComponentMetadata-7DFXlw-J.mjs} +14957 -14751
  8. package/dist/metadata/{initMock-BvEO8W8r.mjs → initMock-AFWEftc6.mjs} +1 -1
  9. package/dist/metadata/style.css +1 -1
  10. package/dist/metadata/xmlui-metadata.mjs +1 -1
  11. package/dist/metadata/xmlui-metadata.umd.js +3 -3
  12. package/dist/scripts/bin/build-lib.js +21 -13
  13. package/dist/scripts/bin/viteConfig.js +3 -1
  14. package/dist/scripts/package.json +1 -1
  15. package/dist/scripts/src/abstractions/scripting/Token.js +2 -0
  16. package/dist/scripts/src/abstractions/scripting/TryScope.js +2 -0
  17. package/dist/scripts/src/abstractions/scripting/modules.js +2 -0
  18. package/dist/scripts/src/components/APICall/APICall.spec.js +910 -0
  19. package/dist/scripts/src/components/Accordion/Accordion.spec.js +969 -0
  20. package/dist/scripts/src/components/Animation/Animation.js +50 -0
  21. package/dist/scripts/src/components/App/App.spec.js +219 -0
  22. package/dist/scripts/src/components/AppHeader/AppHeader.spec.js +169 -0
  23. package/dist/scripts/src/components/AppState/AppState.spec.js +268 -0
  24. package/dist/scripts/src/components/AutoComplete/AutoComplete.spec.js +383 -0
  25. package/dist/scripts/src/components/Avatar/Avatar.spec.js +1543 -0
  26. package/dist/scripts/src/components/Backdrop/Backdrop.spec.js +131 -0
  27. package/dist/scripts/src/components/Badge/Badge.spec.js +2214 -0
  28. package/dist/scripts/src/components/Bookmark/Bookmark.spec.js +230 -0
  29. package/dist/scripts/src/components/Breakout/Breakout.spec.js +56 -0
  30. package/dist/scripts/src/components/Button/Button-style.spec.js +274 -0
  31. package/dist/scripts/src/components/Button/Button.spec.js +454 -0
  32. package/dist/scripts/src/components/Card/Card.spec.js +150 -0
  33. package/dist/scripts/src/components/Carousel/Carousel.spec.js +343 -0
  34. package/dist/scripts/src/components/Carousel/CarouselNative.js +2 -2
  35. package/dist/scripts/src/components/ChangeListener/ChangeListener.spec.js +169 -0
  36. package/dist/scripts/src/components/Charts/AreaChart/AreaChart.spec.js +999 -0
  37. package/dist/scripts/src/components/Charts/BarChart/BarChart.spec.js +597 -0
  38. package/dist/scripts/src/components/Charts/DonutChart/DonutChart.spec.js +608 -0
  39. package/dist/scripts/src/components/Charts/LabelList/LabelList.spec.js +539 -0
  40. package/dist/scripts/src/components/Charts/Legend/Legend.spec.js +558 -0
  41. package/dist/scripts/src/components/Charts/LineChart/LineChart.spec.js +450 -0
  42. package/dist/scripts/src/components/Charts/PieChart/PieChart.spec.js +584 -0
  43. package/dist/scripts/src/components/Charts/RadarChart/RadarChart.spec.js +571 -0
  44. package/dist/scripts/src/components/Charts/Tooltip/TooltipContent.spec.js +449 -0
  45. package/dist/scripts/src/components/Checkbox/Checkbox.spec.js +964 -0
  46. package/dist/scripts/src/components/CodeBlock/CodeBlock.spec.js +196 -0
  47. package/dist/scripts/src/components/ColorPicker/ColorPicker.js +3 -3
  48. package/dist/scripts/src/components/ColorPicker/ColorPicker.spec.js +283 -0
  49. package/dist/scripts/src/components/ColorPicker/ColorPickerNative.js +16 -5
  50. package/dist/scripts/src/components/Column/doc-resources/list-component-data.js +53 -0
  51. package/dist/scripts/src/components/ComponentProvider.js +6 -6
  52. package/dist/scripts/src/components/ContentSeparator/ContentSeparator.spec.js +338 -0
  53. package/dist/scripts/src/components/DateInput/DateInput.spec.js +918 -0
  54. package/dist/scripts/src/components/DatePicker/DatePicker.spec.js +362 -0
  55. package/dist/scripts/src/components/DatePicker/DatePickerNative.js +3 -3
  56. package/dist/scripts/src/components/DropdownMenu/DropdownMenu.spec.js +331 -0
  57. package/dist/scripts/src/components/DropdownMenu/DropdownMenuNative.js +1 -1
  58. package/dist/scripts/src/components/EmojiSelector/EmojiSelector.spec.js +29 -0
  59. package/dist/scripts/src/components/ExpandableItem/ExpandableItem.spec.js +435 -0
  60. package/dist/scripts/src/components/FileInput/FileInput.spec.js +249 -0
  61. package/dist/scripts/src/components/FileInput/FileInputNative.js +14 -10
  62. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.spec.js +296 -0
  63. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +1 -1
  64. package/dist/scripts/src/components/FlowLayout/FlowLayout.spec.js +518 -0
  65. package/dist/scripts/src/components/Footer/Footer.spec.js +991 -0
  66. package/dist/scripts/src/components/Form/Form.js +6 -0
  67. package/dist/scripts/src/components/Form/Form.spec.js +1257 -0
  68. package/dist/scripts/src/components/Form/FormNative.js +13 -3
  69. package/dist/scripts/src/components/FormItem/FormItem.spec.js +723 -0
  70. package/dist/scripts/src/components/FormItem/ItemWithLabel.js +2 -2
  71. package/dist/scripts/src/components/FormSection/FormSection.js +6 -31
  72. package/dist/scripts/src/components/Fragment/Fragment.js +5 -1
  73. package/dist/scripts/src/components/Fragment/Fragment.spec.js +50 -0
  74. package/dist/scripts/src/components/Heading/H1.spec.js +66 -0
  75. package/dist/scripts/src/components/Heading/H2.spec.js +66 -0
  76. package/dist/scripts/src/components/Heading/H3.spec.js +66 -0
  77. package/dist/scripts/src/components/Heading/H4.spec.js +66 -0
  78. package/dist/scripts/src/components/Heading/H5.spec.js +66 -0
  79. package/dist/scripts/src/components/Heading/H6.spec.js +66 -0
  80. package/dist/scripts/src/components/Heading/Heading.js +0 -12
  81. package/dist/scripts/src/components/Heading/Heading.spec.js +897 -0
  82. package/dist/scripts/src/components/HtmlTags/HtmlTags.spec.js +69 -0
  83. package/dist/scripts/src/components/IFrame/IFrame.spec.js +527 -0
  84. package/dist/scripts/src/components/Icon/ArrowDropDown.js +11 -0
  85. package/dist/scripts/src/components/Icon/ArrowDropUp.js +11 -0
  86. package/dist/scripts/src/components/Icon/ArrowLeft.js +11 -0
  87. package/dist/scripts/src/components/Icon/ArrowRight.js +11 -0
  88. package/dist/scripts/src/components/Icon/ChevronDownIcon.js +7 -0
  89. package/dist/scripts/src/components/Icon/ChevronUpIcon.js +7 -0
  90. package/dist/scripts/src/components/Icon/Icon.spec.js +527 -0
  91. package/dist/scripts/src/components/Icon/SunIcon.js +10 -0
  92. package/dist/scripts/src/components/Image/Image.js +2 -1
  93. package/dist/scripts/src/components/Image/Image.spec.js +198 -0
  94. package/dist/scripts/src/components/Image/ImageNative.js +30 -2
  95. package/dist/scripts/src/components/Input/InputLabel.js +25 -0
  96. package/dist/scripts/src/components/Input/index.js +5 -0
  97. package/dist/scripts/src/components/Items/Items.spec.js +397 -0
  98. package/dist/scripts/src/components/Link/Link.spec.js +894 -0
  99. package/dist/scripts/src/components/List/List.spec.js +927 -0
  100. package/dist/scripts/src/components/List/doc-resources/list-component-data.js +53 -0
  101. package/dist/scripts/src/components/Markdown/Markdown.spec.js +188 -0
  102. package/dist/scripts/src/components/ModalDialog/ModalDialog.js +1 -1
  103. package/dist/scripts/src/components/ModalDialog/ModalDialog.spec.js +162 -0
  104. package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +1 -1
  105. package/dist/scripts/src/components/NavGroup/NavGroup.spec.js +153 -0
  106. package/dist/scripts/src/components/NavGroup/NavGroupNative.js +2 -2
  107. package/dist/scripts/src/components/NavLink/NavLink.spec.js +864 -0
  108. package/dist/scripts/src/components/NavPanel/NavPanel.spec.js +864 -0
  109. package/dist/scripts/src/components/NoResult/NoResult.spec.js +863 -0
  110. package/dist/scripts/src/components/NumberBox/NumberBox.spec.js +1231 -0
  111. package/dist/scripts/src/components/Option/Option.spec.js +472 -0
  112. package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.spec.js +80 -0
  113. package/dist/scripts/src/components/Pagination/Pagination.spec.js +1003 -0
  114. package/dist/scripts/src/components/ProfileMenu/ProfileMenu.js +20 -0
  115. package/dist/scripts/src/components/ProgressBar/ProgressBar.spec.js +166 -0
  116. package/dist/scripts/src/components/Queue/Queue.spec.js +626 -0
  117. package/dist/scripts/src/components/RadioGroup/RadioGroup.spec.js +479 -0
  118. package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +17 -1
  119. package/dist/scripts/src/components/Redirect/Redirect.spec.js +527 -0
  120. package/dist/scripts/src/components/ResponsiveBar/ResponsiveBar.spec.js +76 -0
  121. package/dist/scripts/src/components/Select/Select.spec.js +527 -0
  122. package/dist/scripts/src/components/Slider/Slider.js +2 -0
  123. package/dist/scripts/src/components/Slider/Slider.spec.js +574 -0
  124. package/dist/scripts/src/components/Slider/SliderNative.js +62 -25
  125. package/dist/scripts/src/components/Slot/Slot.spec.js +368 -0
  126. package/dist/scripts/src/components/SpaceFiller/SpaceFiller.spec.js +184 -0
  127. package/dist/scripts/src/components/Spinner/Spinner.spec.js +161 -0
  128. package/dist/scripts/src/components/Splitter/HSplitter.spec.js +104 -0
  129. package/dist/scripts/src/components/Splitter/Splitter.spec.js +543 -0
  130. package/dist/scripts/src/components/Splitter/VSplitter.spec.js +104 -0
  131. package/dist/scripts/src/components/Stack/CHStack.spec.js +86 -0
  132. package/dist/scripts/src/components/Stack/CVStack.spec.js +86 -0
  133. package/dist/scripts/src/components/Stack/HStack.spec.js +67 -0
  134. package/dist/scripts/src/components/Stack/Stack.spec.js +654 -0
  135. package/dist/scripts/src/components/Stack/VStack.spec.js +67 -0
  136. package/dist/scripts/src/components/Switch/Switch.spec.js +829 -0
  137. package/dist/scripts/src/components/Table/Table.js +8 -5
  138. package/dist/scripts/src/components/Table/Table.spec.js +555 -0
  139. package/dist/scripts/src/components/Table/TableNative.js +1 -1
  140. package/dist/scripts/src/components/Table/doc-resources/list-component-data.js +53 -0
  141. package/dist/scripts/src/components/TableOfContents/TableOfContents.spec.js +838 -0
  142. package/dist/scripts/src/components/Tabs/Tabs.spec.js +875 -0
  143. package/dist/scripts/src/components/Text/Text.js +0 -13
  144. package/dist/scripts/src/components/Text/Text.spec.js +1075 -0
  145. package/dist/scripts/src/components/TextArea/TextArea.spec.js +714 -0
  146. package/dist/scripts/src/components/TextArea/TextAreaNative.js +8 -1
  147. package/dist/scripts/src/components/TextBox/TextBox.spec.js +643 -0
  148. package/dist/scripts/src/components/Theme/NotificationToast.js +4 -1
  149. package/dist/scripts/src/components/Theme/Theme.spec.js +124 -0
  150. package/dist/scripts/src/components/TimeInput/TimeInput.spec.js +1122 -0
  151. package/dist/scripts/src/components/Timer/Timer.spec.js +358 -0
  152. package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.spec.js +414 -0
  153. package/dist/scripts/src/components/ToneSwitch/ToneSwitch.spec.js +89 -0
  154. package/dist/scripts/src/components/Tooltip/Tooltip.spec.js +418 -0
  155. package/dist/scripts/src/components/chart-color-schemes.js +43 -0
  156. package/dist/scripts/src/components-core/CompoundComponent.js +5 -5
  157. package/dist/scripts/src/components-core/RestApiProxy.js +89 -11
  158. package/dist/scripts/src/components-core/devtools/InspectorDialogVisibilityContext.js +8 -0
  159. package/dist/scripts/src/components-core/renderers.js +31 -0
  160. package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +1 -1
  161. package/dist/scripts/src/components-core/rendering/Container.js +19 -8
  162. package/dist/scripts/src/components-core/rendering/reducer.js +1 -1
  163. package/dist/scripts/src/components-core/script-runner/simplify-expression.js +386 -0
  164. package/dist/scripts/src/components-core/theming/component-layout-resolver.js +153 -0
  165. package/dist/scripts/src/components-core/theming/parse-layout-props.js +98 -0
  166. package/dist/scripts/src/components-core/theming/themes/root.js +13 -20
  167. package/dist/scripts/src/components-core/theming/themes/solid.js +16 -0
  168. package/dist/scripts/src/components-core/utils/audio-utils.js +83 -0
  169. package/dist/scripts/src/index-standalone.js +61 -0
  170. package/dist/scripts/src/index.js +2 -1
  171. package/dist/scripts/src/language-server/server-common.js +151 -0
  172. package/dist/scripts/src/language-server/server-web-worker.js +47 -0
  173. package/dist/scripts/src/language-server/server.js +42 -0
  174. package/dist/scripts/src/language-server/services/common/docs-generation.js +73 -0
  175. package/dist/scripts/src/language-server/services/common/lsp-utils.js +9 -0
  176. package/dist/scripts/src/language-server/services/common/syntax-node-utilities.js +135 -0
  177. package/dist/scripts/src/language-server/services/completion.js +270 -0
  178. package/dist/scripts/src/language-server/services/diagnostic.js +19 -0
  179. package/dist/scripts/src/language-server/services/format.js +430 -0
  180. package/dist/scripts/src/language-server/services/hover.js +164 -0
  181. package/dist/scripts/src/language-server/xmlui-metadata-generated.mjs +16266 -0
  182. package/dist/scripts/src/logging/xmlui.js +21 -0
  183. package/dist/scripts/src/parsers/common/utils.js +19 -0
  184. package/dist/scripts/src/syntax/monaco/grammar.monacoLanguage.js +286 -0
  185. package/dist/scripts/src/syntax/monaco/index.js +14 -0
  186. package/dist/scripts/src/syntax/monaco/xmlui-dark.js +25 -0
  187. package/dist/scripts/src/syntax/monaco/xmlui-light.js +25 -0
  188. package/dist/scripts/src/syntax/monaco/xmluiscript.monacoLanguage.js +310 -0
  189. package/dist/scripts/src/syntax/textMate/index.js +14 -0
  190. package/dist/scripts/src/syntax/textMate/xmlui-dark.json +631 -0
  191. package/dist/scripts/src/syntax/textMate/xmlui-light.json +565 -0
  192. package/dist/scripts/src/syntax/textMate/xmlui.json +564 -0
  193. package/dist/scripts/src/syntax/textMate/xmlui.tmLanguage.json +341 -0
  194. package/dist/scripts/src/testing/ComponentDrivers.js +1355 -0
  195. package/dist/scripts/src/testing/assertions.js +444 -0
  196. package/dist/scripts/src/testing/component-test-helpers.js +389 -0
  197. package/dist/scripts/src/testing/drivers/DateInputDriver.js +19 -0
  198. package/dist/scripts/src/testing/drivers/ModalDialogDriver.js +10 -0
  199. package/dist/scripts/src/testing/drivers/TimeInputDriver.js +22 -0
  200. package/dist/scripts/src/testing/drivers/TimerDriver.js +64 -0
  201. package/dist/scripts/src/testing/fixtures.js +487 -0
  202. package/dist/scripts/src/testing/infrastructure/TestBed.js +17 -0
  203. package/dist/scripts/src/testing/infrastructure/main.js +9 -0
  204. package/dist/scripts/src/testing/infrastructure/public/mockServiceWorker.js +266 -0
  205. package/dist/scripts/src/testing/themed-app-test-helpers.js +139 -0
  206. package/dist/standalone/xmlui-standalone.es.d.ts +19 -2
  207. package/dist/standalone/xmlui-standalone.umd.js +36 -36
  208. package/package.json +1 -1
  209. package/dist/scripts/src/components/RadioGroup/RadioItem.js +0 -28
@@ -0,0 +1,584 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const fixtures_1 = require("../../../testing/fixtures");
13
+ // Test data helpers - using proper XMLUI data format
14
+ const sampleData = `[
15
+ { name: 'Desktop', value: 400, fill: '#8884d8' },
16
+ { name: 'Mobile', value: 300, fill: '#82ca9d' },
17
+ { name: 'Tablet', value: 200, fill: '#ffc658' },
18
+ { name: 'Other', value: 100, fill: '#ff7300' }
19
+ ]`;
20
+ const emptyData = `[]`;
21
+ const singlePointData = `[
22
+ { name: 'Desktop', value: 400 }
23
+ ]`;
24
+ const largeDataset = `[
25
+ { name: 'Category A', value: 400 },
26
+ { name: 'Category B', value: 300 },
27
+ { name: 'Category C', value: 200 },
28
+ { name: 'Category D', value: 100 },
29
+ { name: 'Category E', value: 150 },
30
+ { name: 'Category F', value: 250 },
31
+ { name: 'Category G', value: 180 }
32
+ ]`;
33
+ // Chart selectors - PieChart specific
34
+ const chartRoot = ".recharts-responsive-container";
35
+ const chartSvg = ".recharts-surface";
36
+ const pieSelector = ".recharts-pie";
37
+ const pieSectorSelector = ".recharts-pie-sector";
38
+ const legendSelector = ".recharts-legend-wrapper";
39
+ const tooltipSelector = ".recharts-tooltip-wrapper";
40
+ const labelListSelector = ".recharts-label-list";
41
+ // --- Smoke Tests
42
+ fixtures_1.test.describe("smoke tests", { tag: "@smoke" }, () => {
43
+ (0, fixtures_1.test)("component renders with basic props", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
44
+ yield initTestBed(`
45
+ <PieChart
46
+ nameKey="name"
47
+ dataKey="value"
48
+ data="{${sampleData}}"
49
+ width="400px"
50
+ height="400px"
51
+ />
52
+ `);
53
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
54
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
55
+ }));
56
+ (0, fixtures_1.test)("renders pie sectors for data points", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
57
+ yield initTestBed(`
58
+ <PieChart
59
+ nameKey="name"
60
+ dataKey="value"
61
+ data="{${sampleData}}"
62
+ width="400px"
63
+ height="400px"
64
+ />
65
+ `);
66
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
67
+ // Should have 4 pie sectors for 4 data points
68
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
69
+ }));
70
+ (0, fixtures_1.test)("renders pie chart with correct structure", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
71
+ yield initTestBed(`
72
+ <PieChart
73
+ nameKey="name"
74
+ dataKey="value"
75
+ data="{${sampleData}}"
76
+ width="400px"
77
+ height="400px"
78
+ />
79
+ `);
80
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
81
+ yield (0, fixtures_1.expect)(page.locator(pieSelector)).toBeVisible();
82
+ yield (0, fixtures_1.expect)(page.locator(chartSvg)).toBeVisible();
83
+ }));
84
+ });
85
+ // --- Data Handling Tests
86
+ fixtures_1.test.describe("data handling", () => {
87
+ (0, fixtures_1.test)("renders with empty data array", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
88
+ yield initTestBed(`
89
+ <PieChart
90
+ nameKey="name"
91
+ dataKey="value"
92
+ data="{${emptyData}}"
93
+ width="400px"
94
+ height="400px"
95
+ />
96
+ `);
97
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
98
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(0);
99
+ }));
100
+ (0, fixtures_1.test)("renders with single data point", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
101
+ yield initTestBed(`
102
+ <PieChart
103
+ nameKey="name"
104
+ dataKey="value"
105
+ data="{${singlePointData}}"
106
+ width="400px"
107
+ height="400px"
108
+ />
109
+ `);
110
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
111
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(1);
112
+ }));
113
+ (0, fixtures_1.test)("handles non-array data gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
114
+ yield initTestBed(`
115
+ <PieChart
116
+ nameKey="name"
117
+ dataKey="value"
118
+ data="{null}"
119
+ width="400px"
120
+ height="400px"
121
+ />
122
+ `);
123
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
124
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(0);
125
+ }));
126
+ (0, fixtures_1.test)("handles large datasets", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
127
+ yield initTestBed(`
128
+ <PieChart
129
+ nameKey="name"
130
+ dataKey="value"
131
+ data="{${largeDataset}}"
132
+ width="400px"
133
+ height="400px"
134
+ />
135
+ `);
136
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
137
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(7);
138
+ }));
139
+ });
140
+ // --- Legend Tests
141
+ fixtures_1.test.describe("legend", () => {
142
+ (0, fixtures_1.test)("legend is hidden by default", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
143
+ yield initTestBed(`
144
+ <PieChart
145
+ nameKey="name"
146
+ dataKey="value"
147
+ data="{${sampleData}}"
148
+ width="400px"
149
+ height="400px"
150
+ />
151
+ `);
152
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
153
+ yield (0, fixtures_1.expect)(page.locator(legendSelector)).not.toBeVisible();
154
+ }));
155
+ (0, fixtures_1.test)("legend is shown when showLegend is true", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
156
+ yield initTestBed(`
157
+ <PieChart
158
+ nameKey="name"
159
+ dataKey="value"
160
+ data="{${sampleData}}"
161
+ showLegend
162
+ width="400px"
163
+ height="400px"
164
+ />
165
+ `);
166
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
167
+ yield (0, fixtures_1.expect)(page.locator(legendSelector)).toBeVisible();
168
+ }));
169
+ });
170
+ // --- Tooltip Tests
171
+ fixtures_1.test.describe("tooltip", () => {
172
+ (0, fixtures_1.test)("tooltip appears on hover by default", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
173
+ yield initTestBed(`
174
+ <PieChart
175
+ nameKey="name"
176
+ dataKey="value"
177
+ data="{${sampleData}}"
178
+ width="400px"
179
+ height="400px"
180
+ />
181
+ `);
182
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
183
+ const pieSector = page.locator(pieSectorSelector).first();
184
+ yield pieSector.hover();
185
+ // Wait for tooltip to appear
186
+ yield page.waitForTimeout(500);
187
+ yield (0, fixtures_1.expect)(page.locator(tooltipSelector)).toBeVisible();
188
+ }));
189
+ (0, fixtures_1.test)("tooltip shows correct data on hover", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
190
+ yield initTestBed(`
191
+ <PieChart
192
+ nameKey="name"
193
+ dataKey="value"
194
+ data="{${sampleData}}"
195
+ width="400px"
196
+ height="400px"
197
+ />
198
+ `);
199
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
200
+ const pieSector = page.locator(pieSectorSelector).first();
201
+ yield pieSector.hover();
202
+ yield page.waitForTimeout(500);
203
+ const tooltip = page.locator(tooltipSelector);
204
+ yield (0, fixtures_1.expect)(tooltip).toBeVisible();
205
+ // Tooltip should contain data from the first sector
206
+ yield (0, fixtures_1.expect)(tooltip).toContainText("Desktop");
207
+ yield (0, fixtures_1.expect)(tooltip).toContainText("400");
208
+ }));
209
+ });
210
+ // --- Label Tests
211
+ fixtures_1.test.describe("labels", () => {
212
+ (0, fixtures_1.test)("labels are shown by default (showLabel=true)", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
213
+ yield initTestBed(`
214
+ <PieChart
215
+ nameKey="name"
216
+ dataKey="value"
217
+ data="{${sampleData}}"
218
+ width="400px"
219
+ height="400px"
220
+ />
221
+ `);
222
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
223
+ // Labels should be rendered as text elements
224
+ const labels = page.locator('text').filter({ hasText: /Desktop|Mobile|Tablet|Other/ });
225
+ yield (0, fixtures_1.expect)(labels).toHaveCount(4);
226
+ }));
227
+ (0, fixtures_1.test)("labels are hidden when showLabel is false", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
228
+ yield initTestBed(`
229
+ <PieChart
230
+ nameKey="name"
231
+ dataKey="value"
232
+ data="{${sampleData}}"
233
+ showLabel="{false}"
234
+ width="400px"
235
+ height="400px"
236
+ />
237
+ `);
238
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
239
+ // Should have pie sectors but no labels
240
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
241
+ const labels = page.locator('text').filter({ hasText: /Desktop|Mobile|Tablet|Other/ });
242
+ yield (0, fixtures_1.expect)(labels).toHaveCount(0);
243
+ }));
244
+ (0, fixtures_1.test)("label list is hidden by default", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
245
+ yield initTestBed(`
246
+ <PieChart
247
+ nameKey="name"
248
+ dataKey="value"
249
+ data="{${sampleData}}"
250
+ width="400px"
251
+ height="400px"
252
+ />
253
+ `);
254
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
255
+ // When showLabelList is false (default), there should be no LabelList elements
256
+ // We check for the absence of the recharts-label-list class
257
+ yield (0, fixtures_1.expect)(page.locator(labelListSelector)).toHaveCount(0);
258
+ }));
259
+ (0, fixtures_1.test)("label list is shown when showLabelList is true", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
260
+ yield initTestBed(`
261
+ <PieChart
262
+ nameKey="name"
263
+ dataKey="value"
264
+ data="{${sampleData}}"
265
+ showLabel="{false}"
266
+ showLabelList
267
+ width="400px"
268
+ height="400px"
269
+ />
270
+ `);
271
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
272
+ // LabelList creates text elements with the label content
273
+ const labelTexts = page.locator('text').filter({ hasText: /Desktop|Mobile|Tablet|Other/ });
274
+ yield (0, fixtures_1.expect)(labelTexts).toHaveCount(4);
275
+ }));
276
+ (0, fixtures_1.test)("label list position can be configured", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
277
+ yield initTestBed(`
278
+ <PieChart
279
+ nameKey="name"
280
+ dataKey="value"
281
+ data="{${sampleData}}"
282
+ showLabel="{false}"
283
+ showLabelList
284
+ labelListPosition="outside"
285
+ width="400px"
286
+ height="400px"
287
+ />
288
+ `);
289
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
290
+ // LabelList creates text elements with the label content
291
+ const labelTexts = page.locator('text').filter({ hasText: /Desktop|Mobile|Tablet|Other/ });
292
+ yield (0, fixtures_1.expect)(labelTexts).toHaveCount(4);
293
+ }));
294
+ });
295
+ // --- Radius Tests (PieChart specific)
296
+ fixtures_1.test.describe("radius configuration", () => {
297
+ (0, fixtures_1.test)("renders with default outer radius", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
298
+ yield initTestBed(`
299
+ <PieChart
300
+ nameKey="name"
301
+ dataKey="value"
302
+ data="{${sampleData}}"
303
+ width="400px"
304
+ height="400px"
305
+ />
306
+ `);
307
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
308
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
309
+ }));
310
+ (0, fixtures_1.test)("renders with custom outer radius", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
311
+ yield initTestBed(`
312
+ <PieChart
313
+ nameKey="name"
314
+ dataKey="value"
315
+ data="{${sampleData}}"
316
+ outerRadius="{100}"
317
+ width="400px"
318
+ height="400px"
319
+ />
320
+ `);
321
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
322
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
323
+ }));
324
+ (0, fixtures_1.test)("renders as donut chart with inner radius", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
325
+ yield initTestBed(`
326
+ <PieChart
327
+ nameKey="name"
328
+ dataKey="value"
329
+ data="{${sampleData}}"
330
+ innerRadius="{50}"
331
+ width="400px"
332
+ height="400px"
333
+ />
334
+ `);
335
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
336
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
337
+ // With inner radius, it becomes a donut chart
338
+ }));
339
+ (0, fixtures_1.test)("renders with both inner and outer radius", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
340
+ yield initTestBed(`
341
+ <PieChart
342
+ nameKey="name"
343
+ dataKey="value"
344
+ data="{${sampleData}}"
345
+ innerRadius="{40}"
346
+ outerRadius="{80}"
347
+ width="400px"
348
+ height="400px"
349
+ />
350
+ `);
351
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
352
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
353
+ }));
354
+ });
355
+ // --- Responsive Behavior Tests
356
+ fixtures_1.test.describe("responsive behavior", () => {
357
+ (0, fixtures_1.test)("renders in small containers", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
358
+ yield initTestBed(`
359
+ <PieChart
360
+ nameKey="name"
361
+ dataKey="value"
362
+ data="{${sampleData}}"
363
+ width="200px"
364
+ height="200px"
365
+ />
366
+ `);
367
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
368
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
369
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
370
+ }));
371
+ (0, fixtures_1.test)("renders in very small containers", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
372
+ yield initTestBed(`
373
+ <PieChart
374
+ nameKey="name"
375
+ dataKey="value"
376
+ data="{${sampleData}}"
377
+ width="100px"
378
+ height="100px"
379
+ />
380
+ `);
381
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
382
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
383
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
384
+ }));
385
+ (0, fixtures_1.test)("renders in large containers", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
386
+ yield initTestBed(`
387
+ <PieChart
388
+ nameKey="name"
389
+ dataKey="value"
390
+ data="{${sampleData}}"
391
+ width="800px"
392
+ height="600px"
393
+ />
394
+ `);
395
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
396
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
397
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
398
+ }));
399
+ (0, fixtures_1.test)("handles rectangular containers", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
400
+ yield initTestBed(`
401
+ <PieChart
402
+ nameKey="name"
403
+ dataKey="value"
404
+ data="{${sampleData}}"
405
+ width="600px"
406
+ height="300px"
407
+ />
408
+ `);
409
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
410
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
411
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
412
+ }));
413
+ });
414
+ // --- Interaction Tests
415
+ fixtures_1.test.describe("interaction", () => {
416
+ (0, fixtures_1.test)("pie sectors are interactive on hover", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
417
+ yield initTestBed(`
418
+ <PieChart
419
+ nameKey="name"
420
+ dataKey="value"
421
+ data="{${sampleData}}"
422
+ width="400px"
423
+ height="400px"
424
+ />
425
+ `);
426
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
427
+ const pieSector = page.locator(pieSectorSelector).first();
428
+ // Hover should trigger active shape rendering
429
+ yield pieSector.hover();
430
+ yield page.waitForTimeout(300);
431
+ // The sector should still be visible (active shape effect)
432
+ yield (0, fixtures_1.expect)(pieSector).toBeVisible();
433
+ }));
434
+ (0, fixtures_1.test)("multiple sectors can be hovered", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
435
+ yield initTestBed(`
436
+ <PieChart
437
+ nameKey="name"
438
+ dataKey="value"
439
+ data="{${sampleData}}"
440
+ width="400px"
441
+ height="400px"
442
+ />
443
+ `);
444
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
445
+ const sectors = page.locator(pieSectorSelector);
446
+ // Hover over different sectors
447
+ yield sectors.nth(0).hover();
448
+ yield page.waitForTimeout(200);
449
+ yield sectors.nth(1).hover();
450
+ yield page.waitForTimeout(200);
451
+ yield sectors.nth(2).hover();
452
+ yield page.waitForTimeout(200);
453
+ // All sectors should still be present
454
+ yield (0, fixtures_1.expect)(sectors).toHaveCount(4);
455
+ }));
456
+ });
457
+ // --- Children Support Tests
458
+ fixtures_1.test.describe("children support", () => {
459
+ (0, fixtures_1.test)("renders with child components", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
460
+ yield initTestBed(`
461
+ <PieChart
462
+ nameKey="name"
463
+ dataKey="value"
464
+ data="{${sampleData}}"
465
+ width="400px"
466
+ height="400px"
467
+ >
468
+ <Text>Chart Title</Text>
469
+ </PieChart>
470
+ `);
471
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
472
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
473
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
474
+ yield (0, fixtures_1.expect)(page.getByText("Chart Title")).toBeVisible();
475
+ }));
476
+ });
477
+ // --- Edge Cases
478
+ fixtures_1.test.describe("edge cases", () => {
479
+ (0, fixtures_1.test)("handles missing dataKey gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
480
+ yield initTestBed(`
481
+ <PieChart
482
+ nameKey="name"
483
+ data="{${sampleData}}"
484
+ width="400px"
485
+ height="400px"
486
+ />
487
+ `);
488
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
489
+ // Should still render the container but may not have sectors
490
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
491
+ }));
492
+ (0, fixtures_1.test)("handles missing nameKey gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
493
+ yield initTestBed(`
494
+ <PieChart
495
+ dataKey="value"
496
+ data="{${sampleData}}"
497
+ width="400px"
498
+ height="400px"
499
+ />
500
+ `);
501
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
502
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
503
+ }));
504
+ (0, fixtures_1.test)("handles data with missing values", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
505
+ const dataWithMissingValues = `[
506
+ { name: 'Desktop', value: 400 },
507
+ { name: 'Mobile', value: null },
508
+ { name: 'Tablet', value: 200 },
509
+ { name: 'Other' }
510
+ ]`;
511
+ yield initTestBed(`
512
+ <PieChart
513
+ nameKey="name"
514
+ dataKey="value"
515
+ data="{${dataWithMissingValues}}"
516
+ width="400px"
517
+ height="400px"
518
+ />
519
+ `);
520
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
521
+ // Should render sectors for valid data points
522
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
523
+ }));
524
+ (0, fixtures_1.test)("handles data with zero values", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
525
+ const dataWithZeros = `[
526
+ { name: 'Desktop', value: 400 },
527
+ { name: 'Mobile', value: 0 },
528
+ { name: 'Tablet', value: 200 },
529
+ { name: 'Other', value: 0 }
530
+ ]`;
531
+ yield initTestBed(`
532
+ <PieChart
533
+ nameKey="name"
534
+ dataKey="value"
535
+ data="{${dataWithZeros}}"
536
+ width="400px"
537
+ height="400px"
538
+ />
539
+ `);
540
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
541
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
542
+ // Should handle zero values appropriately
543
+ }));
544
+ (0, fixtures_1.test)("handles negative values", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
545
+ const dataWithNegatives = `[
546
+ { name: 'Desktop', value: 400 },
547
+ { name: 'Mobile', value: -100 },
548
+ { name: 'Tablet', value: 200 },
549
+ { name: 'Other', value: 100 }
550
+ ]`;
551
+ yield initTestBed(`
552
+ <PieChart
553
+ nameKey="name"
554
+ dataKey="value"
555
+ data="{${dataWithNegatives}}"
556
+ width="400px"
557
+ height="400px"
558
+ />
559
+ `);
560
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
561
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
562
+ // Should handle negative values (though they may not render as sectors)
563
+ }));
564
+ (0, fixtures_1.test)("handles very large values", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
565
+ const dataWithLargeValues = `[
566
+ { name: 'Desktop', value: 1000000 },
567
+ { name: 'Mobile', value: 2000000 },
568
+ { name: 'Tablet', value: 500000 },
569
+ { name: 'Other', value: 100000 }
570
+ ]`;
571
+ yield initTestBed(`
572
+ <PieChart
573
+ nameKey="name"
574
+ dataKey="value"
575
+ data="{${dataWithLargeValues}}"
576
+ width="400px"
577
+ height="400px"
578
+ />
579
+ `);
580
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
581
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
582
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
583
+ }));
584
+ });