devextreme-react 24.2.1-alpha-24256-1935 → 24.2.3

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 (361) hide show
  1. package/cjs/accordion.d.ts +23 -7
  2. package/cjs/accordion.js +21 -16
  3. package/cjs/action-sheet.d.ts +23 -10
  4. package/cjs/action-sheet.js +17 -12
  5. package/cjs/autocomplete.d.ts +383 -86
  6. package/cjs/autocomplete.js +203 -123
  7. package/cjs/bar-gauge.d.ts +435 -107
  8. package/cjs/bar-gauge.js +263 -144
  9. package/cjs/box.d.ts +23 -8
  10. package/cjs/box.js +17 -12
  11. package/cjs/bullet.d.ts +118 -33
  12. package/cjs/bullet.js +76 -41
  13. package/cjs/button-group.d.ts +21 -7
  14. package/cjs/button-group.js +17 -12
  15. package/cjs/button.d.ts +2 -2
  16. package/cjs/button.js +2 -2
  17. package/cjs/calendar.d.ts +5 -5
  18. package/cjs/calendar.js +2 -2
  19. package/cjs/chart.d.ts +2989 -780
  20. package/cjs/chart.js +1121 -622
  21. package/cjs/chat.d.ts +112 -13
  22. package/cjs/chat.js +94 -17
  23. package/cjs/check-box.d.ts +4 -4
  24. package/cjs/check-box.js +2 -2
  25. package/cjs/circular-gauge.d.ts +451 -113
  26. package/cjs/circular-gauge.js +268 -148
  27. package/cjs/color-box.d.ts +369 -82
  28. package/cjs/color-box.js +187 -112
  29. package/cjs/common/charts.d.ts +2 -2
  30. package/cjs/common/charts.js +2 -2
  31. package/cjs/common/core/animation.d.ts +14 -0
  32. package/cjs/common/core/animation.js +22 -0
  33. package/cjs/common/core/environment.d.ts +14 -0
  34. package/cjs/common/core/environment.js +20 -0
  35. package/cjs/common/core/events.d.ts +14 -0
  36. package/cjs/common/core/events.js +21 -0
  37. package/cjs/common/core/index.d.ts +17 -0
  38. package/cjs/common/core/index.js +43 -0
  39. package/cjs/common/core/localization.d.ts +14 -0
  40. package/cjs/common/core/localization.js +24 -0
  41. package/cjs/common/data/custom-store.d.ts +2 -2
  42. package/cjs/common/data/custom-store.js +2 -2
  43. package/cjs/common/data.d.ts +14 -0
  44. package/cjs/common/data.js +36 -0
  45. package/cjs/common/export/excel.d.ts +14 -0
  46. package/cjs/common/export/excel.js +19 -0
  47. package/cjs/{core/__tests__/integration/integration.test.d.ts → common/export/index.d.ts} +4 -3
  48. package/cjs/common/export/index.js +41 -0
  49. package/cjs/common/export/pdf.d.ts +14 -0
  50. package/cjs/common/export/pdf.js +19 -0
  51. package/cjs/common/grids.d.ts +3 -3
  52. package/cjs/common/grids.js +2 -2
  53. package/cjs/common/index.d.ts +8 -3
  54. package/cjs/common/index.js +35 -2
  55. package/cjs/context-menu.d.ts +205 -61
  56. package/cjs/context-menu.js +157 -82
  57. package/cjs/core/component-base.d.ts +19 -5
  58. package/cjs/core/component-base.js +47 -30
  59. package/cjs/core/component.d.ts +21 -6
  60. package/cjs/core/component.js +4 -6
  61. package/cjs/core/config.d.ts +2 -2
  62. package/cjs/core/config.js +2 -2
  63. package/cjs/core/configuration/comparer.d.ts +2 -2
  64. package/cjs/core/configuration/comparer.js +16 -14
  65. package/cjs/core/configuration/config-node.d.ts +20 -5
  66. package/cjs/core/configuration/config-node.js +102 -2
  67. package/cjs/core/configuration/react/element.d.ts +5 -12
  68. package/cjs/core/configuration/react/element.js +35 -38
  69. package/cjs/core/configuration/react/templates.d.ts +2 -2
  70. package/cjs/core/configuration/react/templates.js +2 -2
  71. package/cjs/core/configuration/tree.d.ts +2 -2
  72. package/cjs/core/configuration/tree.js +5 -3
  73. package/cjs/core/configuration/utils.d.ts +2 -2
  74. package/cjs/core/configuration/utils.js +2 -2
  75. package/cjs/core/contexts.d.ts +34 -0
  76. package/cjs/core/contexts.js +30 -0
  77. package/cjs/core/extension-component.d.ts +20 -8
  78. package/cjs/core/extension-component.js +4 -3
  79. package/cjs/core/helpers.d.ts +3 -6
  80. package/cjs/core/helpers.js +3 -8
  81. package/cjs/core/nested-option.d.ts +6 -3
  82. package/cjs/core/nested-option.js +31 -10
  83. package/cjs/core/options-manager.d.ts +2 -2
  84. package/cjs/core/options-manager.js +2 -2
  85. package/cjs/core/template-manager.d.ts +2 -2
  86. package/cjs/core/template-manager.js +5 -4
  87. package/cjs/core/template-wrapper.d.ts +2 -2
  88. package/cjs/core/template-wrapper.js +4 -4
  89. package/cjs/core/template.d.ts +2 -2
  90. package/cjs/core/template.js +2 -2
  91. package/cjs/core/types.d.ts +6 -6
  92. package/cjs/core/types.js +2 -2
  93. package/cjs/core/use-option-scanning.d.ts +21 -0
  94. package/cjs/core/use-option-scanning.js +65 -0
  95. package/cjs/core/widget-config.d.ts +2 -2
  96. package/cjs/core/widget-config.js +3 -2
  97. package/cjs/data-grid.d.ts +2232 -467
  98. package/cjs/data-grid.js +1101 -653
  99. package/cjs/date-box.d.ts +456 -104
  100. package/cjs/date-box.js +214 -129
  101. package/cjs/date-range-box.d.ts +456 -104
  102. package/cjs/date-range-box.js +214 -129
  103. package/cjs/defer-rendering.d.ts +129 -41
  104. package/cjs/defer-rendering.js +97 -52
  105. package/cjs/diagram.d.ts +439 -132
  106. package/cjs/diagram.js +305 -172
  107. package/cjs/draggable.d.ts +11 -5
  108. package/cjs/draggable.js +11 -6
  109. package/cjs/drawer.d.ts +2 -2
  110. package/cjs/drawer.js +2 -2
  111. package/cjs/drop-down-box.d.ts +369 -82
  112. package/cjs/drop-down-box.js +187 -112
  113. package/cjs/drop-down-button.d.ts +330 -70
  114. package/cjs/drop-down-button.js +175 -105
  115. package/cjs/file-manager.d.ts +195 -65
  116. package/cjs/file-manager.js +130 -70
  117. package/cjs/file-uploader.d.ts +2 -2
  118. package/cjs/file-uploader.js +2 -2
  119. package/cjs/filter-builder.d.ts +132 -35
  120. package/cjs/filter-builder.js +72 -42
  121. package/cjs/form.d.ts +650 -173
  122. package/cjs/form.js +379 -252
  123. package/cjs/funnel.d.ts +577 -147
  124. package/cjs/funnel.js +326 -182
  125. package/cjs/gallery.d.ts +19 -7
  126. package/cjs/gallery.js +17 -12
  127. package/cjs/gantt.d.ts +486 -126
  128. package/cjs/gantt.js +303 -173
  129. package/cjs/html-editor.d.ts +286 -64
  130. package/cjs/html-editor.js +175 -102
  131. package/cjs/index.d.ts +4 -2
  132. package/cjs/index.js +30 -4
  133. package/cjs/linear-gauge.d.ts +461 -115
  134. package/cjs/linear-gauge.js +278 -153
  135. package/cjs/list.d.ts +227 -53
  136. package/cjs/list.js +95 -60
  137. package/cjs/load-indicator.d.ts +2 -2
  138. package/cjs/load-indicator.js +2 -2
  139. package/cjs/load-panel.d.ts +158 -50
  140. package/cjs/load-panel.js +112 -57
  141. package/cjs/lookup.d.ts +302 -85
  142. package/cjs/lookup.js +196 -116
  143. package/cjs/map.d.ts +83 -18
  144. package/cjs/map.js +78 -35
  145. package/cjs/menu.d.ts +209 -60
  146. package/cjs/menu.js +167 -92
  147. package/cjs/multi-view.d.ts +18 -7
  148. package/cjs/multi-view.js +17 -12
  149. package/cjs/number-box.d.ts +72 -21
  150. package/cjs/number-box.js +38 -23
  151. package/cjs/pagination.d.ts +33 -0
  152. package/cjs/{core/__tests__/integration/integration.test.js → pagination.js} +30 -28
  153. package/cjs/pie-chart.d.ts +966 -263
  154. package/cjs/pie-chart.js +432 -248
  155. package/cjs/pivot-grid-field-chooser.d.ts +67 -14
  156. package/cjs/pivot-grid-field-chooser.js +52 -27
  157. package/cjs/pivot-grid.d.ts +196 -36
  158. package/cjs/pivot-grid.js +132 -67
  159. package/cjs/polar-chart.d.ts +2072 -508
  160. package/cjs/polar-chart.js +854 -473
  161. package/cjs/popover.d.ts +209 -67
  162. package/cjs/popover.js +149 -79
  163. package/cjs/popup.d.ts +189 -59
  164. package/cjs/popup.js +131 -71
  165. package/cjs/progress-bar.d.ts +2 -2
  166. package/cjs/progress-bar.js +2 -2
  167. package/cjs/radio-group.d.ts +17 -6
  168. package/cjs/radio-group.js +17 -12
  169. package/cjs/range-selector.d.ts +1628 -423
  170. package/cjs/range-selector.js +693 -366
  171. package/cjs/range-slider.d.ts +42 -16
  172. package/cjs/range-slider.js +35 -20
  173. package/cjs/recurrence-editor.d.ts +2 -2
  174. package/cjs/recurrence-editor.js +2 -2
  175. package/cjs/resizable.d.ts +2 -2
  176. package/cjs/resizable.js +2 -2
  177. package/cjs/responsive-box.d.ts +64 -21
  178. package/cjs/responsive-box.js +50 -30
  179. package/cjs/sankey.d.ts +396 -110
  180. package/cjs/sankey.js +219 -124
  181. package/cjs/scheduler.d.ts +167 -28
  182. package/cjs/scheduler.js +85 -60
  183. package/cjs/scroll-view.d.ts +2 -2
  184. package/cjs/scroll-view.js +2 -2
  185. package/cjs/select-box.d.ts +383 -86
  186. package/cjs/select-box.js +203 -123
  187. package/cjs/slider.d.ts +42 -16
  188. package/cjs/slider.js +35 -20
  189. package/cjs/sortable.d.ts +11 -5
  190. package/cjs/sortable.js +11 -6
  191. package/cjs/sparkline.d.ts +118 -33
  192. package/cjs/sparkline.js +76 -41
  193. package/cjs/speed-dial-action.d.ts +2 -2
  194. package/cjs/speed-dial-action.js +2 -2
  195. package/cjs/splitter.d.ts +29 -12
  196. package/cjs/splitter.js +17 -12
  197. package/cjs/switch.d.ts +2 -2
  198. package/cjs/switch.js +2 -2
  199. package/cjs/tab-panel.d.ts +24 -7
  200. package/cjs/tab-panel.js +21 -16
  201. package/cjs/tabs.d.ts +20 -7
  202. package/cjs/tabs.js +17 -12
  203. package/cjs/tag-box.d.ts +383 -86
  204. package/cjs/tag-box.js +203 -123
  205. package/cjs/text-area.d.ts +2 -2
  206. package/cjs/text-area.js +2 -2
  207. package/cjs/text-box.d.ts +59 -18
  208. package/cjs/text-box.js +29 -19
  209. package/cjs/tile-view.d.ts +20 -7
  210. package/cjs/tile-view.js +17 -12
  211. package/cjs/toast.d.ts +156 -48
  212. package/cjs/toast.js +112 -57
  213. package/cjs/toolbar.d.ts +33 -13
  214. package/cjs/toolbar.js +21 -16
  215. package/cjs/tooltip.d.ts +178 -58
  216. package/cjs/tooltip.js +130 -65
  217. package/cjs/tree-list.d.ts +1971 -429
  218. package/cjs/tree-list.js +958 -570
  219. package/cjs/tree-map.d.ts +388 -115
  220. package/cjs/tree-map.js +242 -134
  221. package/cjs/tree-view.d.ts +160 -40
  222. package/cjs/tree-view.js +59 -39
  223. package/cjs/validation-group.d.ts +2 -2
  224. package/cjs/validation-group.js +2 -2
  225. package/cjs/validation-summary.d.ts +18 -7
  226. package/cjs/validation-summary.js +17 -12
  227. package/cjs/validator.d.ts +162 -42
  228. package/cjs/validator.js +142 -87
  229. package/cjs/vector-map.d.ts +628 -155
  230. package/cjs/vector-map.js +328 -189
  231. package/common/core/animation/package.json +6 -0
  232. package/common/core/environment/package.json +6 -0
  233. package/common/core/events/package.json +6 -0
  234. package/common/core/localization/package.json +6 -0
  235. package/common/core/package.json +6 -0
  236. package/common/data/package.json +6 -0
  237. package/common/export/excel/package.json +6 -0
  238. package/common/export/package.json +6 -0
  239. package/common/export/pdf/package.json +6 -0
  240. package/esm/accordion.js +21 -16
  241. package/esm/action-sheet.js +17 -12
  242. package/esm/autocomplete.js +203 -123
  243. package/esm/bar-gauge.js +263 -144
  244. package/esm/box.js +17 -12
  245. package/esm/bullet.js +76 -41
  246. package/esm/button-group.js +17 -12
  247. package/esm/button.js +2 -2
  248. package/esm/calendar.js +2 -2
  249. package/esm/chart.js +1121 -622
  250. package/esm/chat.js +90 -17
  251. package/esm/check-box.js +2 -2
  252. package/esm/circular-gauge.js +268 -148
  253. package/esm/color-box.js +187 -112
  254. package/esm/common/charts.js +2 -2
  255. package/esm/common/core/animation.js +14 -0
  256. package/esm/common/core/environment.js +14 -0
  257. package/esm/common/core/events.js +14 -0
  258. package/esm/common/core/index.js +17 -0
  259. package/esm/common/core/localization.js +14 -0
  260. package/esm/common/data/custom-store.js +2 -2
  261. package/esm/common/data.js +14 -0
  262. package/esm/common/export/excel.js +14 -0
  263. package/esm/common/export/index.js +15 -0
  264. package/esm/common/export/pdf.js +14 -0
  265. package/esm/common/grids.js +2 -2
  266. package/esm/common/index.js +8 -3
  267. package/esm/context-menu.js +157 -82
  268. package/esm/core/component-base.js +46 -29
  269. package/esm/core/component.js +4 -6
  270. package/esm/core/config.js +2 -2
  271. package/esm/core/configuration/comparer.js +16 -14
  272. package/esm/core/configuration/config-node.js +77 -3
  273. package/esm/core/configuration/react/element.js +33 -37
  274. package/esm/core/configuration/react/templates.js +2 -2
  275. package/esm/core/configuration/tree.js +5 -3
  276. package/esm/core/configuration/utils.js +2 -2
  277. package/esm/core/contexts.js +27 -0
  278. package/esm/core/extension-component.js +4 -3
  279. package/esm/core/helpers.js +2 -7
  280. package/esm/core/nested-option.js +32 -11
  281. package/esm/core/options-manager.js +2 -2
  282. package/esm/core/template-manager.js +5 -4
  283. package/esm/core/template-wrapper.js +3 -3
  284. package/esm/core/template.js +2 -2
  285. package/esm/core/types.js +2 -2
  286. package/esm/core/use-option-scanning.js +61 -0
  287. package/esm/core/widget-config.js +3 -2
  288. package/esm/data-grid.js +1100 -653
  289. package/esm/date-box.js +214 -129
  290. package/esm/date-range-box.js +214 -129
  291. package/esm/defer-rendering.js +97 -52
  292. package/esm/diagram.js +305 -172
  293. package/esm/draggable.js +11 -6
  294. package/esm/drawer.js +2 -2
  295. package/esm/drop-down-box.js +187 -112
  296. package/esm/drop-down-button.js +175 -105
  297. package/esm/file-manager.js +130 -70
  298. package/esm/file-uploader.js +2 -2
  299. package/esm/filter-builder.js +72 -42
  300. package/esm/form.js +379 -252
  301. package/esm/funnel.js +326 -182
  302. package/esm/gallery.js +17 -12
  303. package/esm/gantt.js +303 -173
  304. package/esm/html-editor.js +175 -103
  305. package/esm/index.js +4 -2
  306. package/esm/linear-gauge.js +278 -153
  307. package/esm/list.js +95 -60
  308. package/esm/load-indicator.js +2 -2
  309. package/esm/load-panel.js +112 -57
  310. package/esm/lookup.js +196 -116
  311. package/esm/map.js +77 -35
  312. package/esm/menu.js +167 -92
  313. package/esm/multi-view.js +17 -12
  314. package/esm/number-box.js +38 -23
  315. package/esm/pagination.js +42 -0
  316. package/esm/pie-chart.js +432 -248
  317. package/esm/pivot-grid-field-chooser.js +52 -27
  318. package/esm/pivot-grid.js +132 -67
  319. package/esm/polar-chart.js +854 -473
  320. package/esm/popover.js +149 -79
  321. package/esm/popup.js +131 -71
  322. package/esm/progress-bar.js +2 -2
  323. package/esm/radio-group.js +17 -12
  324. package/esm/range-selector.js +693 -366
  325. package/esm/range-slider.js +35 -20
  326. package/esm/recurrence-editor.js +2 -2
  327. package/esm/resizable.js +2 -2
  328. package/esm/responsive-box.js +50 -30
  329. package/esm/sankey.js +219 -124
  330. package/esm/scheduler.js +85 -60
  331. package/esm/scroll-view.js +2 -2
  332. package/esm/select-box.js +203 -123
  333. package/esm/slider.js +35 -20
  334. package/esm/sortable.js +11 -6
  335. package/esm/sparkline.js +76 -41
  336. package/esm/speed-dial-action.js +2 -2
  337. package/esm/splitter.js +17 -12
  338. package/esm/switch.js +2 -2
  339. package/esm/tab-panel.js +21 -16
  340. package/esm/tabs.js +17 -12
  341. package/esm/tag-box.js +203 -123
  342. package/esm/text-area.js +2 -2
  343. package/esm/text-box.js +29 -19
  344. package/esm/tile-view.js +17 -12
  345. package/esm/toast.js +112 -57
  346. package/esm/toolbar.js +21 -16
  347. package/esm/tooltip.js +130 -65
  348. package/esm/tree-list.js +957 -570
  349. package/esm/tree-map.js +242 -134
  350. package/esm/tree-view.js +59 -39
  351. package/esm/validation-group.js +2 -2
  352. package/esm/validation-summary.js +17 -12
  353. package/esm/validator.js +142 -87
  354. package/esm/vector-map.js +328 -189
  355. package/index/package.json +6 -0
  356. package/package.json +2 -2
  357. package/pagination/package.json +6 -0
  358. package/cjs/core/configuration/react/tree.d.ts +0 -30
  359. package/cjs/core/configuration/react/tree.js +0 -121
  360. package/esm/core/__tests__/integration/integration.test.js +0 -41
  361. package/esm/core/configuration/react/tree.js +0 -94
@@ -1,121 +0,0 @@
1
- /*!
2
- * devextreme-react
3
- * Version: 24.2.1-alpha-24256-1935
4
- * Build date: Thu Sep 12 2024
5
- *
6
- * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
7
- *
8
- * This software may be modified and distributed under the terms
9
- * of the MIT license. See the LICENSE file in the root of the project for details.
10
- *
11
- * https://github.com/DevExpress/devextreme-react
12
- */
13
-
14
- "use strict";
15
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
- if (k2 === undefined) k2 = k;
17
- var desc = Object.getOwnPropertyDescriptor(m, k);
18
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
- desc = { enumerable: true, get: function() { return m[k]; } };
20
- }
21
- Object.defineProperty(o, k2, desc);
22
- }) : (function(o, m, k, k2) {
23
- if (k2 === undefined) k2 = k;
24
- o[k2] = m[k];
25
- }));
26
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
27
- Object.defineProperty(o, "default", { enumerable: true, value: v });
28
- }) : function(o, v) {
29
- o["default"] = v;
30
- });
31
- var __importStar = (this && this.__importStar) || function (mod) {
32
- if (mod && mod.__esModule) return mod;
33
- var result = {};
34
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
35
- __setModuleDefault(result, mod);
36
- return result;
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.buildConfigTree = exports.processChildren = void 0;
40
- const React = __importStar(require("react"));
41
- const widget_config_1 = require("../../widget-config");
42
- const element_1 = require("./element");
43
- const utils_1 = require("../utils");
44
- const templates_1 = require("./templates");
45
- function processChildren(parentElement, parentFullName) {
46
- const templates = [];
47
- const configCollections = {};
48
- const configs = {};
49
- let hasTranscludedContent = false;
50
- React.Children.map(parentElement.props.children, (child) => {
51
- const element = (0, element_1.getElementInfo)(child, parentElement.descriptor.expectedChildren);
52
- if (element.type === element_1.ElementType.Unknown) {
53
- if (child !== null && child !== undefined && child !== false) {
54
- hasTranscludedContent = true;
55
- }
56
- return;
57
- }
58
- if (element.type === element_1.ElementType.Template) {
59
- const template = (0, templates_1.getNamedTemplate)(element.props);
60
- if (template) {
61
- templates.push(template);
62
- }
63
- return;
64
- }
65
- if (element.descriptor.isCollection) {
66
- let collection = configCollections[element.descriptor.name];
67
- if (!collection) {
68
- collection = [];
69
- configCollections[element.descriptor.name] = collection;
70
- }
71
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
72
- const collectionItem = createConfigNode(element, `${(0, utils_1.mergeNameParts)(parentFullName, element.descriptor.name)}[${collection.length}]`);
73
- collection.push(collectionItem);
74
- return;
75
- }
76
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
77
- const configNode = createConfigNode(element, parentFullName);
78
- configs[element.descriptor.name] = configNode;
79
- });
80
- return {
81
- configs,
82
- configCollections,
83
- templates,
84
- hasTranscludedContent,
85
- };
86
- }
87
- exports.processChildren = processChildren;
88
- function createConfigNode(element, path) {
89
- const fullName = element.descriptor.isCollection
90
- ? path
91
- : (0, utils_1.mergeNameParts)(path, element.descriptor.name);
92
- const separatedValues = (0, widget_config_1.separateProps)(element.props, element.descriptor.initialValuesProps, element.descriptor.templates);
93
- const childrenData = processChildren(element, fullName);
94
- element.descriptor.templates.forEach((templateMeta) => {
95
- const template = (0, templates_1.getAnonymousTemplate)(element.props, templateMeta, path.length > 0 ? childrenData.hasTranscludedContent : false);
96
- if (template) {
97
- childrenData.templates.push(template);
98
- }
99
- });
100
- return {
101
- fullName,
102
- predefinedOptions: element.descriptor.predefinedValuesProps,
103
- initialOptions: separatedValues.defaults,
104
- options: separatedValues.options,
105
- templates: childrenData.templates,
106
- configCollections: childrenData.configCollections,
107
- configs: childrenData.configs,
108
- };
109
- }
110
- function buildConfigTree(widgetDescriptor, props) {
111
- return createConfigNode({
112
- type: element_1.ElementType.Option,
113
- descriptor: {
114
- name: '',
115
- isCollection: false,
116
- ...widgetDescriptor,
117
- },
118
- props,
119
- }, '');
120
- }
121
- exports.buildConfigTree = buildConfigTree;
@@ -1,41 +0,0 @@
1
- /*!
2
- * devextreme-react
3
- * Version: 24.2.1-alpha-24256-1935
4
- * Build date: Thu Sep 12 2024
5
- *
6
- * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
7
- *
8
- * This software may be modified and distributed under the terms
9
- * of the MIT license. See the LICENSE file in the root of the project for details.
10
- *
11
- * https://github.com/DevExpress/devextreme-react
12
- */
13
-
14
- import * as testingLib from '@testing-library/react';
15
- import * as React from 'react';
16
- import { useState, useEffect } from 'react';
17
- import SelectBox from '../../../select-box';
18
- import TextBox from '../../../text-box';
19
- jest.useFakeTimers();
20
- describe('selectbox', () => {
21
- afterEach(() => {
22
- jest.clearAllMocks();
23
- testingLib.cleanup();
24
- });
25
- it('renders selectbox in strict mode when data source is specified dynamically without errors', () => {
26
- const Field = (data) => {
27
- return (React.createElement(TextBox, { defaultValue: data && data.Name }));
28
- };
29
- const list = [{ ID: 1, Name: 'Item 1' }];
30
- const SelectBoxWithDynamicDataSource = () => {
31
- const [items, setItems] = useState([{}]);
32
- useEffect(() => {
33
- setItems(list);
34
- }, []);
35
- return (React.createElement(SelectBox, { dataSource: items, displayExpr: "Name", valueExpr: "ID", fieldRender: Field }));
36
- };
37
- const renderSelectBox = () => testingLib.render(React.createElement(React.StrictMode, null,
38
- React.createElement(SelectBoxWithDynamicDataSource, null)));
39
- expect(renderSelectBox).not.toThrow();
40
- });
41
- });
@@ -1,94 +0,0 @@
1
- /*!
2
- * devextreme-react
3
- * Version: 24.2.1-alpha-24256-1935
4
- * Build date: Thu Sep 12 2024
5
- *
6
- * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
7
- *
8
- * This software may be modified and distributed under the terms
9
- * of the MIT license. See the LICENSE file in the root of the project for details.
10
- *
11
- * https://github.com/DevExpress/devextreme-react
12
- */
13
-
14
- import * as React from 'react';
15
- import { separateProps } from '../../widget-config';
16
- import { ElementType, getElementInfo, } from './element';
17
- import { mergeNameParts } from '../utils';
18
- import { getAnonymousTemplate, getNamedTemplate } from './templates';
19
- export function processChildren(parentElement, parentFullName) {
20
- const templates = [];
21
- const configCollections = {};
22
- const configs = {};
23
- let hasTranscludedContent = false;
24
- React.Children.map(parentElement.props.children, (child) => {
25
- const element = getElementInfo(child, parentElement.descriptor.expectedChildren);
26
- if (element.type === ElementType.Unknown) {
27
- if (child !== null && child !== undefined && child !== false) {
28
- hasTranscludedContent = true;
29
- }
30
- return;
31
- }
32
- if (element.type === ElementType.Template) {
33
- const template = getNamedTemplate(element.props);
34
- if (template) {
35
- templates.push(template);
36
- }
37
- return;
38
- }
39
- if (element.descriptor.isCollection) {
40
- let collection = configCollections[element.descriptor.name];
41
- if (!collection) {
42
- collection = [];
43
- configCollections[element.descriptor.name] = collection;
44
- }
45
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
46
- const collectionItem = createConfigNode(element, `${mergeNameParts(parentFullName, element.descriptor.name)}[${collection.length}]`);
47
- collection.push(collectionItem);
48
- return;
49
- }
50
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
51
- const configNode = createConfigNode(element, parentFullName);
52
- configs[element.descriptor.name] = configNode;
53
- });
54
- return {
55
- configs,
56
- configCollections,
57
- templates,
58
- hasTranscludedContent,
59
- };
60
- }
61
- function createConfigNode(element, path) {
62
- const fullName = element.descriptor.isCollection
63
- ? path
64
- : mergeNameParts(path, element.descriptor.name);
65
- const separatedValues = separateProps(element.props, element.descriptor.initialValuesProps, element.descriptor.templates);
66
- const childrenData = processChildren(element, fullName);
67
- element.descriptor.templates.forEach((templateMeta) => {
68
- const template = getAnonymousTemplate(element.props, templateMeta, path.length > 0 ? childrenData.hasTranscludedContent : false);
69
- if (template) {
70
- childrenData.templates.push(template);
71
- }
72
- });
73
- return {
74
- fullName,
75
- predefinedOptions: element.descriptor.predefinedValuesProps,
76
- initialOptions: separatedValues.defaults,
77
- options: separatedValues.options,
78
- templates: childrenData.templates,
79
- configCollections: childrenData.configCollections,
80
- configs: childrenData.configs,
81
- };
82
- }
83
- function buildConfigTree(widgetDescriptor, props) {
84
- return createConfigNode({
85
- type: ElementType.Option,
86
- descriptor: {
87
- name: '',
88
- isCollection: false,
89
- ...widgetDescriptor,
90
- },
91
- props,
92
- }, '');
93
- }
94
- export { buildConfigTree, };