xmlui 0.10.13 → 0.10.15

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 (217) hide show
  1. package/dist/lib/{index-Db5iQkFp.mjs → index-axjeT2uJ.mjs} +1626 -1080
  2. package/dist/lib/index.css +1 -1
  3. package/dist/lib/{initMock-B9LtmFJG.mjs → initMock-BoTWMs19.mjs} +1 -1
  4. package/dist/lib/language-server-web-worker.mjs +1 -1
  5. package/dist/lib/language-server.mjs +1 -1
  6. package/dist/lib/{metadata-utils-D90qqMGc.mjs → metadata-utils-CtY0QcvH.mjs} +2 -1
  7. package/dist/lib/{server-common-lmBDLpUh.mjs → server-common-Cine5nRR.mjs} +1 -1
  8. package/dist/lib/xmlui.d.ts +99 -6
  9. package/dist/lib/xmlui.mjs +78 -42
  10. package/dist/metadata/{collectedComponentMetadata-BN8eg9Gr.mjs → collectedComponentMetadata-CQywuPDB.mjs} +17448 -16984
  11. package/dist/metadata/{initMock-J7pN8owj.mjs → initMock-Bi5kF5Af.mjs} +1 -1
  12. package/dist/metadata/style.css +1 -1
  13. package/dist/metadata/xmlui-metadata.mjs +1 -1
  14. package/dist/metadata/xmlui-metadata.umd.js +3 -3
  15. package/dist/scripts/bin/build-lib.js +21 -13
  16. package/dist/scripts/bin/viteConfig.js +3 -1
  17. package/dist/scripts/package.json +2 -3
  18. package/dist/scripts/src/abstractions/scripting/Token.js +2 -0
  19. package/dist/scripts/src/abstractions/scripting/TryScope.js +2 -0
  20. package/dist/scripts/src/abstractions/scripting/modules.js +2 -0
  21. package/dist/scripts/src/components/APICall/APICall.spec.js +910 -0
  22. package/dist/scripts/src/components/Accordion/Accordion.spec.js +969 -0
  23. package/dist/scripts/src/components/Animation/Animation.js +50 -0
  24. package/dist/scripts/src/components/App/App.spec.js +219 -0
  25. package/dist/scripts/src/components/AppHeader/AppHeader.spec.js +169 -0
  26. package/dist/scripts/src/components/AppState/AppState.js +32 -2
  27. package/dist/scripts/src/components/AppState/AppState.spec.js +268 -0
  28. package/dist/scripts/src/components/AppState/AppStateNative.js +27 -3
  29. package/dist/scripts/src/components/AutoComplete/AutoComplete.spec.js +383 -0
  30. package/dist/scripts/src/components/Avatar/Avatar.spec.js +1543 -0
  31. package/dist/scripts/src/components/Backdrop/Backdrop.spec.js +131 -0
  32. package/dist/scripts/src/components/Badge/Badge.spec.js +2214 -0
  33. package/dist/scripts/src/components/Bookmark/Bookmark.spec.js +230 -0
  34. package/dist/scripts/src/components/Breakout/Breakout.spec.js +56 -0
  35. package/dist/scripts/src/components/Button/Button-style.spec.js +274 -0
  36. package/dist/scripts/src/components/Button/Button.js +5 -1
  37. package/dist/scripts/src/components/Button/Button.spec.js +454 -0
  38. package/dist/scripts/src/components/Card/Card.spec.js +150 -0
  39. package/dist/scripts/src/components/Carousel/Carousel.spec.js +343 -0
  40. package/dist/scripts/src/components/Carousel/CarouselNative.js +2 -2
  41. package/dist/scripts/src/components/ChangeListener/ChangeListener.spec.js +169 -0
  42. package/dist/scripts/src/components/Charts/AreaChart/AreaChart.spec.js +999 -0
  43. package/dist/scripts/src/components/Charts/BarChart/BarChart.spec.js +597 -0
  44. package/dist/scripts/src/components/Charts/DonutChart/DonutChart.spec.js +608 -0
  45. package/dist/scripts/src/components/Charts/LabelList/LabelList.spec.js +539 -0
  46. package/dist/scripts/src/components/Charts/Legend/Legend.spec.js +558 -0
  47. package/dist/scripts/src/components/Charts/LineChart/LineChart.spec.js +450 -0
  48. package/dist/scripts/src/components/Charts/PieChart/PieChart.spec.js +584 -0
  49. package/dist/scripts/src/components/Charts/PieChart/PieChartNative.js +41 -2
  50. package/dist/scripts/src/components/Charts/RadarChart/RadarChart.spec.js +571 -0
  51. package/dist/scripts/src/components/Charts/Tooltip/TooltipContent.spec.js +449 -0
  52. package/dist/scripts/src/components/Checkbox/Checkbox.spec.js +964 -0
  53. package/dist/scripts/src/components/CodeBlock/CodeBlock.spec.js +196 -0
  54. package/dist/scripts/src/components/ColorPicker/ColorPicker.spec.js +283 -0
  55. package/dist/scripts/src/components/ColorPicker/ColorPickerNative.js +9 -26
  56. package/dist/scripts/src/components/Column/doc-resources/list-component-data.js +53 -0
  57. package/dist/scripts/src/components/ComponentProvider.js +6 -2
  58. package/dist/scripts/src/components/ContentSeparator/ContentSeparator.spec.js +338 -0
  59. package/dist/scripts/src/components/DateInput/DateInput.spec.js +918 -0
  60. package/dist/scripts/src/components/DatePicker/DatePicker.spec.js +362 -0
  61. package/dist/scripts/src/components/DatePicker/DatePickerNative.js +3 -3
  62. package/dist/scripts/src/components/DropdownMenu/DropdownMenu.spec.js +331 -0
  63. package/dist/scripts/src/components/DropdownMenu/DropdownMenuNative.js +7 -9
  64. package/dist/scripts/src/components/EmojiSelector/EmojiSelector.spec.js +29 -0
  65. package/dist/scripts/src/components/ExpandableItem/ExpandableItem.spec.js +435 -0
  66. package/dist/scripts/src/components/FileInput/FileInput.spec.js +249 -0
  67. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.spec.js +296 -0
  68. package/dist/scripts/src/components/FlowLayout/FlowLayout.spec.js +518 -0
  69. package/dist/scripts/src/components/Footer/Footer.spec.js +991 -0
  70. package/dist/scripts/src/components/Form/Form.spec.js +1257 -0
  71. package/dist/scripts/src/components/FormItem/FormItem.spec.js +723 -0
  72. package/dist/scripts/src/components/FormItem/ItemWithLabel.js +3 -3
  73. package/dist/scripts/src/components/FormSection/FormSection.js +6 -31
  74. package/dist/scripts/src/components/Fragment/Fragment.spec.js +50 -0
  75. package/dist/scripts/src/components/Heading/H1.spec.js +66 -0
  76. package/dist/scripts/src/components/Heading/H2.spec.js +66 -0
  77. package/dist/scripts/src/components/Heading/H3.spec.js +66 -0
  78. package/dist/scripts/src/components/Heading/H4.spec.js +66 -0
  79. package/dist/scripts/src/components/Heading/H5.spec.js +66 -0
  80. package/dist/scripts/src/components/Heading/H6.spec.js +66 -0
  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.spec.js +162 -0
  103. package/dist/scripts/src/components/NavGroup/NavGroup.spec.js +212 -0
  104. package/dist/scripts/src/components/NavGroup/NavGroupNative.js +15 -7
  105. package/dist/scripts/src/components/NavLink/NavLink.spec.js +864 -0
  106. package/dist/scripts/src/components/NavPanel/NavPanel.spec.js +864 -0
  107. package/dist/scripts/src/components/NoResult/NoResult.spec.js +863 -0
  108. package/dist/scripts/src/components/NumberBox/NumberBox.spec.js +1237 -0
  109. package/dist/scripts/src/components/Option/Option.spec.js +472 -0
  110. package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.spec.js +80 -0
  111. package/dist/scripts/src/components/Pagination/Pagination.spec.js +1003 -0
  112. package/dist/scripts/src/components/ProfileMenu/ProfileMenu.js +20 -0
  113. package/dist/scripts/src/components/ProgressBar/ProgressBar.spec.js +166 -0
  114. package/dist/scripts/src/components/Queue/Queue.spec.js +626 -0
  115. package/dist/scripts/src/components/RadioGroup/RadioGroup.spec.js +479 -0
  116. package/dist/scripts/src/components/Redirect/Redirect.spec.js +527 -0
  117. package/dist/scripts/src/components/ResponsiveBar/ResponsiveBar.spec.js +76 -0
  118. package/dist/scripts/src/components/Select/Select.spec.js +527 -0
  119. package/dist/scripts/src/components/SelectionStore/SelectionStoreNative.js +3 -1
  120. package/dist/scripts/src/components/Slider/Slider.js +2 -0
  121. package/dist/scripts/src/components/Slider/Slider.spec.js +574 -0
  122. package/dist/scripts/src/components/Slider/SliderNative.js +63 -26
  123. package/dist/scripts/src/components/Slot/Slot.spec.js +368 -0
  124. package/dist/scripts/src/components/SpaceFiller/SpaceFiller.spec.js +184 -0
  125. package/dist/scripts/src/components/Spinner/Spinner.spec.js +161 -0
  126. package/dist/scripts/src/components/Splitter/HSplitter.spec.js +104 -0
  127. package/dist/scripts/src/components/Splitter/Splitter.spec.js +543 -0
  128. package/dist/scripts/src/components/Splitter/VSplitter.spec.js +104 -0
  129. package/dist/scripts/src/components/Stack/CHStack.spec.js +86 -0
  130. package/dist/scripts/src/components/Stack/CVStack.spec.js +86 -0
  131. package/dist/scripts/src/components/Stack/HStack.spec.js +67 -0
  132. package/dist/scripts/src/components/Stack/Stack.spec.js +654 -0
  133. package/dist/scripts/src/components/Stack/VStack.spec.js +67 -0
  134. package/dist/scripts/src/components/Switch/Switch.spec.js +829 -0
  135. package/dist/scripts/src/components/Table/Table.js +7 -1
  136. package/dist/scripts/src/components/Table/Table.spec.js +555 -0
  137. package/dist/scripts/src/components/Table/TableNative.js +4 -1
  138. package/dist/scripts/src/components/Table/doc-resources/list-component-data.js +53 -0
  139. package/dist/scripts/src/components/Table/useRowSelection.js +215 -1
  140. package/dist/scripts/src/components/TableOfContents/TableOfContents.spec.js +838 -0
  141. package/dist/scripts/src/components/Tabs/Tabs.spec.js +875 -0
  142. package/dist/scripts/src/components/Text/Text.spec.js +1075 -0
  143. package/dist/scripts/src/components/TextArea/TextArea.spec.js +714 -0
  144. package/dist/scripts/src/components/TextBox/TextBox.js +1 -5
  145. package/dist/scripts/src/components/TextBox/TextBox.spec.js +687 -0
  146. package/dist/scripts/src/components/TextBox/TextBoxNative.js +10 -15
  147. package/dist/scripts/src/components/Theme/Theme.spec.js +124 -0
  148. package/dist/scripts/src/components/Theme/ThemeNative.js +2 -6
  149. package/dist/scripts/src/components/TimeInput/TimeInput.js +1 -5
  150. package/dist/scripts/src/components/TimeInput/TimeInput.spec.js +1122 -0
  151. package/dist/scripts/src/components/TimeInput/TimeInputNative.js +2 -9
  152. package/dist/scripts/src/components/Timer/Timer.spec.js +358 -0
  153. package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.spec.js +414 -0
  154. package/dist/scripts/src/components/ToneSwitch/ToneSwitch.spec.js +89 -0
  155. package/dist/scripts/src/components/Tooltip/Tooltip.spec.js +418 -0
  156. package/dist/scripts/src/components/chart-color-schemes.js +43 -0
  157. package/dist/scripts/src/components-core/ApiBoundComponent.js +38 -24
  158. package/dist/scripts/src/components-core/CompoundComponent.js +1 -1
  159. package/dist/scripts/src/components-core/RestApiProxy.js +84 -8
  160. package/dist/scripts/src/components-core/behaviors/BehaviorContext.js +54 -0
  161. package/dist/scripts/src/components-core/behaviors/CoreBehaviors.js +80 -0
  162. package/dist/scripts/src/components-core/descriptorHelper.js +1 -0
  163. package/dist/scripts/src/components-core/devtools/InspectorDialogVisibilityContext.js +8 -0
  164. package/dist/scripts/src/components-core/parts.js +4 -1
  165. package/dist/scripts/src/components-core/renderers.js +31 -0
  166. package/dist/scripts/src/components-core/rendering/AppRoot.js +2 -1
  167. package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +31 -46
  168. package/dist/scripts/src/components-core/rendering/nodeUtils.js +6 -0
  169. package/dist/scripts/src/components-core/script-runner/simplify-expression.js +386 -0
  170. package/dist/scripts/src/components-core/theming/component-layout-resolver.js +153 -0
  171. package/dist/scripts/src/components-core/theming/layout-resolver.js +2 -0
  172. package/dist/scripts/src/components-core/theming/parse-layout-props.js +98 -0
  173. package/dist/scripts/src/components-core/theming/themes/solid.js +16 -0
  174. package/dist/scripts/src/components-core/utils/audio-utils.js +83 -0
  175. package/dist/scripts/src/index-standalone.js +61 -0
  176. package/dist/scripts/src/index.js +39 -1
  177. package/dist/scripts/src/language-server/server-common.js +151 -0
  178. package/dist/scripts/src/language-server/server-web-worker.js +47 -0
  179. package/dist/scripts/src/language-server/server.js +42 -0
  180. package/dist/scripts/src/language-server/services/common/docs-generation.js +73 -0
  181. package/dist/scripts/src/language-server/services/common/lsp-utils.js +9 -0
  182. package/dist/scripts/src/language-server/services/common/syntax-node-utilities.js +135 -0
  183. package/dist/scripts/src/language-server/services/completion.js +270 -0
  184. package/dist/scripts/src/language-server/services/diagnostic.js +19 -0
  185. package/dist/scripts/src/language-server/services/format.js +430 -0
  186. package/dist/scripts/src/language-server/services/hover.js +164 -0
  187. package/dist/scripts/src/language-server/xmlui-metadata-generated.mjs +16266 -0
  188. package/dist/scripts/src/logging/xmlui.js +21 -0
  189. package/dist/scripts/src/parsers/common/utils.js +19 -0
  190. package/dist/scripts/src/syntax/monaco/grammar.monacoLanguage.js +286 -0
  191. package/dist/scripts/src/syntax/monaco/index.js +14 -0
  192. package/dist/scripts/src/syntax/monaco/xmlui-dark.js +25 -0
  193. package/dist/scripts/src/syntax/monaco/xmlui-light.js +25 -0
  194. package/dist/scripts/src/syntax/monaco/xmluiscript.monacoLanguage.js +310 -0
  195. package/dist/scripts/src/syntax/textMate/index.js +14 -0
  196. package/dist/scripts/src/syntax/textMate/xmlui-dark.json +631 -0
  197. package/dist/scripts/src/syntax/textMate/xmlui-light.json +565 -0
  198. package/dist/scripts/src/syntax/textMate/xmlui.json +564 -0
  199. package/dist/scripts/src/syntax/textMate/xmlui.tmLanguage.json +341 -0
  200. package/dist/scripts/src/testing/ComponentDrivers.js +1327 -0
  201. package/dist/scripts/src/testing/assertions.js +444 -0
  202. package/dist/scripts/src/testing/component-test-helpers.js +389 -0
  203. package/dist/scripts/src/testing/drivers/DateInputDriver.js +19 -0
  204. package/dist/scripts/src/testing/drivers/ModalDialogDriver.js +10 -0
  205. package/dist/scripts/src/testing/drivers/NumberBoxDriver.js +44 -0
  206. package/dist/scripts/src/testing/drivers/SliderDriver.js +20 -0
  207. package/dist/scripts/src/testing/drivers/TextBoxDriver.js +20 -0
  208. package/dist/scripts/src/testing/drivers/TimeInputDriver.js +22 -0
  209. package/dist/scripts/src/testing/drivers/TimerDriver.js +64 -0
  210. package/dist/scripts/src/testing/fixtures.js +513 -0
  211. package/dist/scripts/src/testing/infrastructure/TestBed.js +17 -0
  212. package/dist/scripts/src/testing/infrastructure/main.js +9 -0
  213. package/dist/scripts/src/testing/infrastructure/public/mockServiceWorker.js +266 -0
  214. package/dist/scripts/src/testing/themed-app-test-helpers.js +139 -0
  215. package/dist/standalone/xmlui-standalone.es.d.ts +172 -10
  216. package/dist/standalone/xmlui-standalone.umd.js +36 -36
  217. package/package.json +2 -3
@@ -0,0 +1,597 @@
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: 'Jan', sales: 100, profit: 20 },
16
+ { name: 'Feb', sales: 150, profit: 30 },
17
+ { name: 'Mar', sales: 120, profit: 25 },
18
+ { name: 'Apr', sales: 180, profit: 40 }
19
+ ]`;
20
+ const emptyData = `[]`;
21
+ const singlePointData = `[
22
+ { name: 'Jan', sales: 100, profit: 20 }
23
+ ]`;
24
+ // Chart selectors - updated for actual Recharts BarChart output
25
+ const chartRoot = ".recharts-responsive-container";
26
+ const chartSvg = ".recharts-surface";
27
+ const barsSelector = ".recharts-bar";
28
+ const legendSelector = ".recharts-legend-wrapper";
29
+ const tooltipSelector = ".recharts-tooltip-wrapper";
30
+ const xAxisSelector = ".recharts-xAxis";
31
+ const yAxisSelector = ".recharts-yAxis";
32
+ const xTicksSelector = ".recharts-xAxis .recharts-cartesian-axis-tick-value";
33
+ const yTicksSelector = ".recharts-yAxis .recharts-cartesian-axis-tick-value";
34
+ // --- Smoke Tests
35
+ fixtures_1.test.describe("smoke tests", { tag: "@smoke" }, () => {
36
+ (0, fixtures_1.test)("component renders with basic props", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
37
+ yield initTestBed(`
38
+ <BarChart
39
+ xKey="name"
40
+ data="{${sampleData}}"
41
+ yKeys="{['sales', 'profit']}"
42
+ width="600px"
43
+ height="400px"
44
+ />
45
+ `);
46
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
47
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
48
+ }));
49
+ (0, fixtures_1.test)("renders correct number of bar series", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
50
+ yield initTestBed(`
51
+ <BarChart
52
+ xKey="name"
53
+ data="{${sampleData}}"
54
+ yKeys="{['sales', 'profit']}"
55
+ width="600px"
56
+ height="400px"
57
+ />
58
+ `);
59
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
60
+ // Should have 2 bar series (sales and profit)
61
+ yield (0, fixtures_1.expect)(page.locator(barsSelector)).toHaveCount(2);
62
+ }));
63
+ });
64
+ // --- Data Handling Tests
65
+ fixtures_1.test.describe("data handling", () => {
66
+ (0, fixtures_1.test)("renders with empty data array", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
67
+ yield initTestBed(`
68
+ <BarChart
69
+ xKey="name"
70
+ data="{${emptyData}}"
71
+ yKeys="{['sales', 'profit']}"
72
+ width="600px"
73
+ height="400px"
74
+ />
75
+ `);
76
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
77
+ yield (0, fixtures_1.expect)(page.locator(barsSelector)).toHaveCount(0);
78
+ }));
79
+ (0, fixtures_1.test)("renders with single data point", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
80
+ yield initTestBed(`
81
+ <BarChart
82
+ xKey="name"
83
+ data="{${singlePointData}}"
84
+ yKeys="{['sales', 'profit']}"
85
+ width="600px"
86
+ height="400px"
87
+ />
88
+ `);
89
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
90
+ yield (0, fixtures_1.expect)(page.locator(barsSelector)).toHaveCount(2);
91
+ }));
92
+ (0, fixtures_1.test)("handles non-array data gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
93
+ yield initTestBed(`
94
+ <BarChart
95
+ xKey="name"
96
+ data="{null}"
97
+ yKeys="{['sales', 'profit']}"
98
+ width="600px"
99
+ height="400px"
100
+ />
101
+ `);
102
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
103
+ yield (0, fixtures_1.expect)(page.locator(barsSelector)).toHaveCount(0);
104
+ }));
105
+ });
106
+ // --- Layout Tests (BarChart specific)
107
+ fixtures_1.test.describe("layout", () => {
108
+ (0, fixtures_1.test)("renders vertical layout by default", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
109
+ yield initTestBed(`
110
+ <BarChart
111
+ xKey="name"
112
+ data="{${sampleData}}"
113
+ yKeys="{['sales', 'profit']}"
114
+ width="600px"
115
+ height="400px"
116
+ />
117
+ `);
118
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
119
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
120
+ // In vertical layout, bars should be oriented vertically
121
+ yield (0, fixtures_1.expect)(page.locator(barsSelector)).toHaveCount(2);
122
+ }));
123
+ (0, fixtures_1.test)("renders horizontal layout when specified", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
124
+ yield initTestBed(`
125
+ <BarChart
126
+ xKey="name"
127
+ data="{${sampleData}}"
128
+ yKeys="{['sales', 'profit']}"
129
+ orientation="horizontal"
130
+ width="600px"
131
+ height="400px"
132
+ />
133
+ `);
134
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
135
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
136
+ // In horizontal layout, bars should be oriented horizontally
137
+ yield (0, fixtures_1.expect)(page.locator(barsSelector)).toHaveCount(2);
138
+ }));
139
+ });
140
+ // --- Stacked Tests (BarChart specific)
141
+ fixtures_1.test.describe("stacked", () => {
142
+ (0, fixtures_1.test)("renders grouped bars by default (stacked=false)", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
143
+ yield initTestBed(`
144
+ <BarChart
145
+ xKey="name"
146
+ data="{${sampleData}}"
147
+ yKeys="{['sales', 'profit']}"
148
+ width="600px"
149
+ height="400px"
150
+ />
151
+ `);
152
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
153
+ yield (0, fixtures_1.expect)(page.locator(barsSelector)).toHaveCount(2);
154
+ }));
155
+ (0, fixtures_1.test)("renders stacked bars when stacked=true", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
156
+ yield initTestBed(`
157
+ <BarChart
158
+ xKey="name"
159
+ data="{${sampleData}}"
160
+ yKeys="{['sales', 'profit']}"
161
+ stacked
162
+ width="600px"
163
+ height="400px"
164
+ />
165
+ `);
166
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
167
+ yield (0, fixtures_1.expect)(page.locator(barsSelector)).toHaveCount(2);
168
+ }));
169
+ });
170
+ // --- Legend Tests
171
+ fixtures_1.test.describe("legend", () => {
172
+ (0, fixtures_1.test)("legend is hidden by default", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
173
+ yield initTestBed(`
174
+ <BarChart
175
+ xKey="name"
176
+ data="{${sampleData}}"
177
+ yKeys="{['sales', 'profit']}"
178
+ width="600px"
179
+ height="400px"
180
+ />
181
+ `);
182
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
183
+ yield (0, fixtures_1.expect)(page.locator(legendSelector)).not.toBeVisible();
184
+ }));
185
+ (0, fixtures_1.test)("legend is shown when showLegend is true", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
186
+ yield initTestBed(`
187
+ <BarChart
188
+ xKey="name"
189
+ data="{${sampleData}}"
190
+ yKeys="{['sales', 'profit']}"
191
+ showLegend
192
+ width="600px"
193
+ height="400px"
194
+ />
195
+ `);
196
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
197
+ yield (0, fixtures_1.expect)(page.locator(legendSelector)).toBeVisible();
198
+ }));
199
+ });
200
+ // --- Tooltip Tests
201
+ fixtures_1.test.describe("tooltip", () => {
202
+ (0, fixtures_1.test)("tooltip appears on hover by default", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
203
+ yield initTestBed(`
204
+ <BarChart
205
+ xKey="name"
206
+ data="{${sampleData}}"
207
+ yKeys="{['sales', 'profit']}"
208
+ width="600px"
209
+ height="400px"
210
+ />
211
+ `);
212
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
213
+ const chart = page.locator(chartSvg).first();
214
+ yield chart.hover({ position: { x: 200, y: 100 } });
215
+ // Wait for tooltip to appear
216
+ yield page.waitForTimeout(500);
217
+ yield (0, fixtures_1.expect)(page.locator(tooltipSelector)).toBeVisible();
218
+ }));
219
+ (0, fixtures_1.test)("tooltip is hidden when hideTooltip is true", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
220
+ yield initTestBed(`
221
+ <BarChart
222
+ xKey="name"
223
+ data="{${sampleData}}"
224
+ yKeys="{['sales', 'profit']}"
225
+ hideTooltip
226
+ width="600px"
227
+ height="400px"
228
+ />
229
+ `);
230
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
231
+ const chart = page.locator(chartSvg).first();
232
+ yield chart.hover({ position: { x: 200, y: 100 } });
233
+ yield page.waitForTimeout(500);
234
+ yield (0, fixtures_1.expect)(page.locator(tooltipSelector)).not.toBeVisible();
235
+ }));
236
+ });
237
+ // --- Axis Tests
238
+ fixtures_1.test.describe("x-axis", () => {
239
+ (0, fixtures_1.test)("x-axis is shown by default", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
240
+ yield initTestBed(`
241
+ <BarChart
242
+ xKey="name"
243
+ data="{${sampleData}}"
244
+ yKeys="{['sales', 'profit']}"
245
+ width="600px"
246
+ height="400px"
247
+ />
248
+ `);
249
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
250
+ yield (0, fixtures_1.expect)(page.locator(xAxisSelector)).toBeVisible();
251
+ // Check that at least one tick is present
252
+ const tickCount = yield page.locator(xTicksSelector).count();
253
+ (0, fixtures_1.expect)(tickCount).toBeGreaterThan(0);
254
+ }));
255
+ (0, fixtures_1.test)("x-axis is hidden when hideX is true", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
256
+ yield initTestBed(`
257
+ <BarChart
258
+ xKey="name"
259
+ data="{${sampleData}}"
260
+ yKeys="{['sales', 'profit']}"
261
+ hideX
262
+ width="600px"
263
+ height="400px"
264
+ />
265
+ `);
266
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
267
+ yield (0, fixtures_1.expect)(page.locator(xTicksSelector)).toHaveCount(0);
268
+ }));
269
+ (0, fixtures_1.test)("x-axis ticks are hidden when hideTickX is true", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
270
+ yield initTestBed(`
271
+ <BarChart
272
+ xKey="name"
273
+ data="{${sampleData}}"
274
+ yKeys="{['sales', 'profit']}"
275
+ hideTickX
276
+ width="600px"
277
+ height="400px"
278
+ />
279
+ `);
280
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
281
+ // When hideTickX is true, ticks should not be rendered in DOM
282
+ yield (0, fixtures_1.expect)(page.locator(xTicksSelector)).toHaveCount(0);
283
+ // But the axis line itself should still be present (though not visible due to tickLine=false)
284
+ yield (0, fixtures_1.expect)(page.locator(xAxisSelector)).toBeAttached();
285
+ }));
286
+ });
287
+ fixtures_1.test.describe("y-axis", () => {
288
+ (0, fixtures_1.test)("y-axis is shown by default", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
289
+ yield initTestBed(`
290
+ <BarChart
291
+ xKey="name"
292
+ data="{${sampleData}}"
293
+ yKeys="{['sales', 'profit']}"
294
+ width="600px"
295
+ height="400px"
296
+ />
297
+ `);
298
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
299
+ yield (0, fixtures_1.expect)(page.locator(yAxisSelector)).toBeVisible();
300
+ // Check that at least one tick is present
301
+ const tickCount = yield page.locator(yTicksSelector).count();
302
+ (0, fixtures_1.expect)(tickCount).toBeGreaterThan(0);
303
+ }));
304
+ (0, fixtures_1.test)("y-axis is hidden when hideY is true", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
305
+ yield initTestBed(`
306
+ <BarChart
307
+ xKey="name"
308
+ data="{${sampleData}}"
309
+ yKeys="{['sales', 'profit']}"
310
+ hideY
311
+ width="600px"
312
+ height="400px"
313
+ />
314
+ `);
315
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
316
+ yield (0, fixtures_1.expect)(page.locator(yTicksSelector)).toHaveCount(0);
317
+ }));
318
+ (0, fixtures_1.test)("y-axis ticks are hidden when hideTickY is true", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
319
+ yield initTestBed(`
320
+ <BarChart
321
+ xKey="name"
322
+ data="{${sampleData}}"
323
+ yKeys="{['sales', 'profit']}"
324
+ hideTickY
325
+ width="600px"
326
+ height="400px"
327
+ />
328
+ `);
329
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
330
+ // When hideTickY is true, ticks should not be rendered in DOM
331
+ // But the axis line itself should still be present (though not visible due to tickLine=false)
332
+ yield (0, fixtures_1.expect)(page.locator(yAxisSelector)).toBeAttached();
333
+ yield (0, fixtures_1.expect)(page.locator(yTicksSelector)).toHaveCount(0);
334
+ }));
335
+ });
336
+ // --- Formatter Tests
337
+ fixtures_1.test.describe("formatters", () => {
338
+ (0, fixtures_1.test)("applies tickFormatterX when provided", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
339
+ yield initTestBed(`
340
+ <BarChart
341
+ xKey="name"
342
+ data="{${sampleData}}"
343
+ yKeys="{['sales', 'profit']}"
344
+ tickFormatterX="{(value) => value + ' (X)'}"
345
+ width="600px"
346
+ height="400px"
347
+ />
348
+ `);
349
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
350
+ // Check that formatted text appears in x-axis ticks
351
+ yield (0, fixtures_1.expect)(page.locator(xTicksSelector).first()).toContainText("(X)");
352
+ }));
353
+ (0, fixtures_1.test)("applies tickFormatterY when provided", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
354
+ yield initTestBed(`
355
+ <BarChart
356
+ xKey="name"
357
+ data="{${sampleData}}"
358
+ yKeys="{['sales', 'profit']}"
359
+ tickFormatterY="{(value) => '$' + value}"
360
+ width="600px"
361
+ height="400px"
362
+ />
363
+ `);
364
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
365
+ // Check that formatted text appears in y-axis ticks
366
+ yield (0, fixtures_1.expect)(page.locator(yTicksSelector).first()).toContainText("$");
367
+ }));
368
+ });
369
+ // --- Margin Tests
370
+ fixtures_1.test.describe("margins", () => {
371
+ (0, fixtures_1.test)("applies custom margins", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
372
+ yield initTestBed(`
373
+ <BarChart
374
+ xKey="name"
375
+ data="{${sampleData}}"
376
+ yKeys="{['sales', 'profit']}"
377
+ marginTop="{20}"
378
+ marginRight="{30}"
379
+ marginBottom="{40}"
380
+ marginLeft="{50}"
381
+ width="600px"
382
+ height="400px"
383
+ />
384
+ `);
385
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
386
+ // Chart should render with custom margins applied
387
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
388
+ }));
389
+ });
390
+ // --- Responsive Behavior Tests
391
+ fixtures_1.test.describe("responsive behavior", () => {
392
+ (0, fixtures_1.test)("enters mini mode with very small container height", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
393
+ yield initTestBed(`
394
+ <BarChart
395
+ xKey="name"
396
+ data="{${sampleData}}"
397
+ yKeys="{['sales', 'profit']}"
398
+ width="600px"
399
+ height="50px"
400
+ />
401
+ `);
402
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
403
+ // In mini mode, x-axis ticks should be hidden (tick=false)
404
+ yield (0, fixtures_1.expect)(page.locator(xTicksSelector)).toHaveCount(0);
405
+ // Y-axis ticks should also be hidden in mini mode
406
+ yield (0, fixtures_1.expect)(page.locator(yTicksSelector)).toHaveCount(0);
407
+ // Chart should still render the bars
408
+ yield (0, fixtures_1.expect)(page.locator(barsSelector)).toHaveCount(2);
409
+ }));
410
+ (0, fixtures_1.test)("renders normally with adequate height", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
411
+ yield initTestBed(`
412
+ <BarChart
413
+ xKey="name"
414
+ data="{${sampleData}}"
415
+ yKeys="{['sales', 'profit']}"
416
+ width="600px"
417
+ height="200px"
418
+ />
419
+ `);
420
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
421
+ // With adequate height, should have ticks
422
+ const tickCount = yield page.locator(xTicksSelector).count();
423
+ (0, fixtures_1.expect)(tickCount).toBeGreaterThan(0);
424
+ }));
425
+ (0, fixtures_1.test)("handles narrow containers gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
426
+ yield initTestBed(`
427
+ <BarChart
428
+ xKey="name"
429
+ data="{${sampleData}}"
430
+ yKeys="{['sales', 'profit']}"
431
+ width="100px"
432
+ height="400px"
433
+ />
434
+ `);
435
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
436
+ // Chart should still render even in narrow container
437
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
438
+ yield (0, fixtures_1.expect)(page.locator(barsSelector)).toHaveCount(2);
439
+ }));
440
+ });
441
+ // --- Layout-specific Tests (BarChart specific)
442
+ fixtures_1.test.describe("layout-specific behavior", () => {
443
+ (0, fixtures_1.test)("vertical layout has correct axis orientation", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
444
+ yield initTestBed(`
445
+ <BarChart
446
+ xKey="name"
447
+ data="{${sampleData}}"
448
+ yKeys="{['sales', 'profit']}"
449
+ orientation="vertical"
450
+ width="600px"
451
+ height="400px"
452
+ />
453
+ `);
454
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
455
+ // In vertical layout, category names should be on X-axis, values on Y-axis
456
+ yield (0, fixtures_1.expect)(page.locator(xAxisSelector)).toBeVisible();
457
+ yield (0, fixtures_1.expect)(page.locator(yAxisSelector)).toBeVisible();
458
+ }));
459
+ (0, fixtures_1.test)("horizontal layout has correct axis orientation", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
460
+ yield initTestBed(`
461
+ <BarChart
462
+ xKey="name"
463
+ data="{${sampleData}}"
464
+ yKeys="{['sales', 'profit']}"
465
+ orientation="horizontal"
466
+ width="600px"
467
+ height="400px"
468
+ />
469
+ `);
470
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
471
+ // In horizontal layout, category names should be on Y-axis, values on X-axis
472
+ yield (0, fixtures_1.expect)(page.locator(xAxisSelector)).toBeVisible();
473
+ yield (0, fixtures_1.expect)(page.locator(yAxisSelector)).toBeVisible();
474
+ }));
475
+ });
476
+ // --- Edge Cases
477
+ fixtures_1.test.describe("edge cases", () => {
478
+ (0, fixtures_1.test)("handles missing yKeys gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
479
+ yield initTestBed(`
480
+ <BarChart
481
+ xKey="name"
482
+ data="{${sampleData}}"
483
+ yKeys="{[]}"
484
+ width="600px"
485
+ height="400px"
486
+ />
487
+ `);
488
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
489
+ yield (0, fixtures_1.expect)(page.locator(barsSelector)).toHaveCount(0);
490
+ }));
491
+ (0, fixtures_1.test)("handles missing xKey gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
492
+ yield initTestBed(`
493
+ <BarChart
494
+ data="{${sampleData}}"
495
+ yKeys="{['sales', 'profit']}"
496
+ width="600px"
497
+ height="400px"
498
+ />
499
+ `);
500
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
501
+ // Should still render but may not have proper category labels
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: 'Jan', sales: 100, profit: 20 },
507
+ { name: 'Feb', sales: null, profit: 30 },
508
+ { name: 'Mar', sales: 120 },
509
+ { name: 'Apr', sales: 180, profit: 40 }
510
+ ]`;
511
+ yield initTestBed(`
512
+ <BarChart
513
+ xKey="name"
514
+ data="{${dataWithMissingValues}}"
515
+ yKeys="{['sales', 'profit']}"
516
+ width="600px"
517
+ height="400px"
518
+ />
519
+ `);
520
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
521
+ // Should render bars for available data points
522
+ yield (0, fixtures_1.expect)(page.locator(barsSelector)).toHaveCount(2);
523
+ }));
524
+ });
525
+ // --- Tooltip Template Tests
526
+ fixtures_1.test.describe("tooltipTemplate", () => {
527
+ (0, fixtures_1.test)("renders custom tooltip template", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
528
+ yield initTestBed(`
529
+ <BarChart
530
+ xKey="name"
531
+ data="{${sampleData}}"
532
+ yKeys="{['sales', 'profit']}"
533
+ width="600px"
534
+ height="400px"
535
+ >
536
+ <property name="tooltipTemplate">
537
+ <VStack>
538
+ <Text>Custom Tooltip</Text>
539
+ <Text>Label: {$tooltip.label}</Text>
540
+ <Text>Active: {$tooltip.active}</Text>
541
+ </VStack>
542
+ </property>
543
+ </BarChart>
544
+ `);
545
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
546
+ const chart = page.locator(chartSvg).first();
547
+ yield chart.hover({ position: { x: 200, y: 100 } });
548
+ // Wait for tooltip to appear
549
+ yield page.waitForTimeout(500);
550
+ yield (0, fixtures_1.expect)(page.locator(tooltipSelector)).toBeVisible();
551
+ // Check for custom tooltip content
552
+ yield (0, fixtures_1.expect)(page.getByText("Custom Tooltip")).toBeVisible();
553
+ yield (0, fixtures_1.expect)(page.getByText(/Label:/)).toBeVisible();
554
+ yield (0, fixtures_1.expect)(page.getByText(/Active:/)).toBeVisible();
555
+ }));
556
+ (0, fixtures_1.test)("tooltip template is not rendered when hideTooltip is true", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
557
+ yield initTestBed(`
558
+ <BarChart
559
+ xKey="name"
560
+ data="{${sampleData}}"
561
+ yKeys="{['sales', 'profit']}"
562
+ hideTooltip
563
+ width="600px"
564
+ height="400px"
565
+ >
566
+ <property name="tooltipTemplate">
567
+ <Text>This tooltip should not appear</Text>
568
+ </property>
569
+ </BarChart>
570
+ `);
571
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
572
+ const chart = page.locator(chartSvg).first();
573
+ yield chart.hover({ position: { x: 200, y: 100 } });
574
+ yield page.waitForTimeout(500);
575
+ yield (0, fixtures_1.expect)(page.locator(tooltipSelector)).not.toBeVisible();
576
+ yield (0, fixtures_1.expect)(page.getByText("This tooltip should not appear")).not.toBeVisible();
577
+ }));
578
+ (0, fixtures_1.test)("falls back to default tooltip when tooltipTemplate is not provided", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
579
+ yield initTestBed(`
580
+ <BarChart
581
+ xKey="name"
582
+ data="{${sampleData}}"
583
+ yKeys="{['sales', 'profit']}"
584
+ width="600px"
585
+ height="400px"
586
+ />
587
+ `);
588
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
589
+ const chart = page.locator(chartSvg).first();
590
+ yield chart.hover({ position: { x: 200, y: 100 } });
591
+ yield page.waitForTimeout(500);
592
+ yield (0, fixtures_1.expect)(page.locator(tooltipSelector)).toBeVisible();
593
+ // Default tooltip should contain standard recharts tooltip content
594
+ const tooltip = page.locator(tooltipSelector);
595
+ yield (0, fixtures_1.expect)(tooltip).toBeVisible();
596
+ }));
597
+ });