@jsonforms/material-renderers 2.5.2 → 3.0.0-alpha.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 (357) hide show
  1. package/README.md +1 -1
  2. package/docs/assets/js/search.json +1 -1
  3. package/docs/classes/combinatorproperties.html +2 -5
  4. package/docs/classes/materialanyofstringorenumcontrol.html +6 -9
  5. package/docs/classes/materialtablecontrol.html +4 -7
  6. package/docs/globals.html +1040 -328
  7. package/docs/index.html +84 -51
  8. package/docs/interfaces/ajvprops.html +1 -4
  9. package/docs/interfaces/arraylayouttoolbarprops.html +5 -8
  10. package/docs/interfaces/categorizationstate.html +1 -4
  11. package/docs/interfaces/categorizationstepperstate.html +0 -3
  12. package/docs/interfaces/combinatorpropertiesprops.html +0 -3
  13. package/docs/interfaces/deletedialogprops.html +0 -3
  14. package/docs/interfaces/dispatchpropsofexpandpanel.html +3 -6
  15. package/docs/interfaces/emptytableprops.html +0 -3
  16. package/docs/interfaces/expandpanelprops.html +19 -22
  17. package/docs/interfaces/jsonformstheme.html +39 -49
  18. package/docs/interfaces/materialcategorizationlayoutrendererprops.html +11 -14
  19. package/docs/interfaces/materialcategorizationstepperlayoutrendererprops.html +7 -10
  20. package/docs/interfaces/materiallayoutrendererprops.html +0 -3
  21. package/docs/interfaces/materialtabletoolbarprops.html +10 -13
  22. package/docs/interfaces/muitextinputprops.html +2 -5
  23. package/docs/interfaces/nonemptycellcomponentprops.html +266 -0
  24. package/docs/interfaces/nonemptycellprops.html +0 -3
  25. package/docs/interfaces/nonemptyrowprops.html +80 -27
  26. package/docs/interfaces/ownoneofprops.html +0 -3
  27. package/docs/interfaces/ownpropsofexpandpanel.html +14 -17
  28. package/docs/interfaces/ownpropsofnonemptycell.html +0 -3
  29. package/docs/interfaces/statepropsofexpandpanel.html +16 -19
  30. package/docs/interfaces/tableheadercellprops.html +0 -3
  31. package/docs/interfaces/tablerowsprop.html +9 -12
  32. package/docs/interfaces/validationprops.html +2 -5
  33. package/docs/interfaces/withdeletedialogsupport.html +0 -3
  34. package/docs/interfaces/withinput.html +1 -4
  35. package/docs/interfaces/withoptionlabel.html +7 -7
  36. package/example/index.ts +5 -20
  37. package/lib/additional/ListWithDetailMasterItem.d.ts +1 -1
  38. package/lib/additional/ListWithDetailMasterItem.js +8 -8
  39. package/lib/additional/ListWithDetailMasterItem.js.map +1 -1
  40. package/lib/additional/MaterialLabelRenderer.d.ts +1 -1
  41. package/lib/additional/MaterialLabelRenderer.js +6 -4
  42. package/lib/additional/MaterialLabelRenderer.js.map +1 -1
  43. package/lib/additional/MaterialListWithDetailRenderer.d.ts +1 -1
  44. package/lib/additional/MaterialListWithDetailRenderer.js +10 -8
  45. package/lib/additional/MaterialListWithDetailRenderer.js.map +1 -1
  46. package/lib/additional/index.js +3 -2
  47. package/lib/additional/index.js.map +1 -1
  48. package/lib/cells/CustomizableCells.d.ts +1 -0
  49. package/lib/cells/CustomizableCells.js +11 -8
  50. package/lib/cells/CustomizableCells.js.map +1 -1
  51. package/lib/cells/MaterialBooleanCell.d.ts +1 -1
  52. package/lib/cells/MaterialBooleanCell.js +3 -1
  53. package/lib/cells/MaterialBooleanCell.js.map +1 -1
  54. package/lib/cells/MaterialBooleanToggleCell.d.ts +1 -1
  55. package/lib/cells/MaterialBooleanToggleCell.js +3 -1
  56. package/lib/cells/MaterialBooleanToggleCell.js.map +1 -1
  57. package/lib/cells/MaterialDateCell.d.ts +1 -1
  58. package/lib/cells/MaterialDateCell.js +4 -2
  59. package/lib/cells/MaterialDateCell.js.map +1 -1
  60. package/lib/cells/MaterialEnumCell.d.ts +1 -1
  61. package/lib/cells/MaterialEnumCell.js +3 -1
  62. package/lib/cells/MaterialEnumCell.js.map +1 -1
  63. package/lib/cells/MaterialIntegerCell.d.ts +1 -1
  64. package/lib/cells/MaterialIntegerCell.js +3 -1
  65. package/lib/cells/MaterialIntegerCell.js.map +1 -1
  66. package/lib/cells/MaterialNumberCell.d.ts +1 -1
  67. package/lib/cells/MaterialNumberCell.js +3 -1
  68. package/lib/cells/MaterialNumberCell.js.map +1 -1
  69. package/lib/cells/MaterialNumberFormatCell.d.ts +1 -1
  70. package/lib/cells/MaterialNumberFormatCell.js +3 -1
  71. package/lib/cells/MaterialNumberFormatCell.js.map +1 -1
  72. package/lib/cells/MaterialOneOfEnumCell.d.ts +10 -0
  73. package/lib/cells/MaterialOneOfEnumCell.js +41 -0
  74. package/lib/cells/MaterialOneOfEnumCell.js.map +1 -0
  75. package/lib/cells/MaterialTextCell.d.ts +1 -1
  76. package/lib/cells/MaterialTextCell.js +3 -1
  77. package/lib/cells/MaterialTextCell.js.map +1 -1
  78. package/lib/cells/MaterialTimeCell.d.ts +1 -1
  79. package/lib/cells/MaterialTimeCell.js +3 -1
  80. package/lib/cells/MaterialTimeCell.js.map +1 -1
  81. package/lib/cells/index.d.ts +2 -1
  82. package/lib/cells/index.js +13 -9
  83. package/lib/cells/index.js.map +1 -1
  84. package/lib/complex/CombinatorProperties.js +4 -2
  85. package/lib/complex/CombinatorProperties.js.map +1 -1
  86. package/lib/complex/DeleteDialog.js +9 -9
  87. package/lib/complex/DeleteDialog.js.map +1 -1
  88. package/lib/complex/MaterialAllOfRenderer.d.ts +3 -2
  89. package/lib/complex/MaterialAllOfRenderer.js +12 -10
  90. package/lib/complex/MaterialAllOfRenderer.js.map +1 -1
  91. package/lib/complex/MaterialAnyOfRenderer.d.ts +3 -2
  92. package/lib/complex/MaterialAnyOfRenderer.js +7 -5
  93. package/lib/complex/MaterialAnyOfRenderer.js.map +1 -1
  94. package/lib/complex/MaterialArrayControlRenderer.d.ts +1 -1
  95. package/lib/complex/MaterialArrayControlRenderer.js +5 -3
  96. package/lib/complex/MaterialArrayControlRenderer.js.map +1 -1
  97. package/lib/complex/MaterialEnumArrayRenderer.d.ts +2 -2
  98. package/lib/complex/MaterialEnumArrayRenderer.js +12 -9
  99. package/lib/complex/MaterialEnumArrayRenderer.js.map +1 -1
  100. package/lib/complex/MaterialObjectRenderer.d.ts +3 -2
  101. package/lib/complex/MaterialObjectRenderer.js +7 -5
  102. package/lib/complex/MaterialObjectRenderer.js.map +1 -1
  103. package/lib/complex/MaterialOneOfRenderer.d.ts +2 -1
  104. package/lib/complex/MaterialOneOfRenderer.js +16 -15
  105. package/lib/complex/MaterialOneOfRenderer.js.map +1 -1
  106. package/lib/complex/MaterialTableControl.d.ts +16 -1
  107. package/lib/complex/MaterialTableControl.js +42 -35
  108. package/lib/complex/MaterialTableControl.js.map +1 -1
  109. package/lib/complex/NoBorderTableCell.d.ts +2 -2
  110. package/lib/complex/NoBorderTableCell.js +8 -10
  111. package/lib/complex/NoBorderTableCell.js.map +1 -1
  112. package/lib/complex/TableToolbar.d.ts +2 -2
  113. package/lib/complex/TableToolbar.js +12 -14
  114. package/lib/complex/TableToolbar.js.map +1 -1
  115. package/lib/complex/ValidationIcon.d.ts +2 -6
  116. package/lib/complex/ValidationIcon.js +9 -13
  117. package/lib/complex/ValidationIcon.js.map +1 -1
  118. package/lib/complex/index.js +6 -5
  119. package/lib/complex/index.js.map +1 -1
  120. package/lib/controls/MaterialAnyOfStringOrEnumControl.d.ts +1 -1
  121. package/lib/controls/MaterialAnyOfStringOrEnumControl.js +18 -13
  122. package/lib/controls/MaterialAnyOfStringOrEnumControl.js.map +1 -1
  123. package/lib/controls/MaterialBooleanControl.d.ts +1 -1
  124. package/lib/controls/MaterialBooleanControl.js +6 -4
  125. package/lib/controls/MaterialBooleanControl.js.map +1 -1
  126. package/lib/controls/MaterialBooleanToggleControl.d.ts +1 -1
  127. package/lib/controls/MaterialBooleanToggleControl.js +6 -4
  128. package/lib/controls/MaterialBooleanToggleControl.js.map +1 -1
  129. package/lib/controls/MaterialDateControl.d.ts +3 -15
  130. package/lib/controls/MaterialDateControl.js +29 -50
  131. package/lib/controls/MaterialDateControl.js.map +1 -1
  132. package/lib/controls/MaterialDateTimeControl.d.ts +3 -6
  133. package/lib/controls/MaterialDateTimeControl.js +29 -31
  134. package/lib/controls/MaterialDateTimeControl.js.map +1 -1
  135. package/lib/controls/MaterialEnumControl.d.ts +1 -1
  136. package/lib/controls/MaterialEnumControl.js +3 -1
  137. package/lib/controls/MaterialEnumControl.js.map +1 -1
  138. package/lib/controls/MaterialInputControl.d.ts +2 -5
  139. package/lib/controls/MaterialInputControl.js +25 -30
  140. package/lib/controls/MaterialInputControl.js.map +1 -1
  141. package/lib/controls/MaterialIntegerControl.d.ts +1 -1
  142. package/lib/controls/MaterialIntegerControl.js +3 -1
  143. package/lib/controls/MaterialIntegerControl.js.map +1 -1
  144. package/lib/controls/MaterialNativeControl.d.ts +3 -6
  145. package/lib/controls/MaterialNativeControl.js +16 -20
  146. package/lib/controls/MaterialNativeControl.js.map +1 -1
  147. package/lib/controls/MaterialNumberControl.d.ts +1 -1
  148. package/lib/controls/MaterialNumberControl.js +3 -1
  149. package/lib/controls/MaterialNumberControl.js.map +1 -1
  150. package/lib/controls/MaterialOneOfEnumControl.d.ts +1 -1
  151. package/lib/controls/MaterialOneOfEnumControl.js +3 -1
  152. package/lib/controls/MaterialOneOfEnumControl.js.map +1 -1
  153. package/lib/controls/MaterialOneOfRadioGroupControl.d.ts +1 -1
  154. package/lib/controls/MaterialOneOfRadioGroupControl.js +3 -1
  155. package/lib/controls/MaterialOneOfRadioGroupControl.js.map +1 -1
  156. package/lib/controls/MaterialRadioGroup.d.ts +2 -5
  157. package/lib/controls/MaterialRadioGroup.js +16 -23
  158. package/lib/controls/MaterialRadioGroup.js.map +1 -1
  159. package/lib/controls/MaterialRadioGroupControl.d.ts +1 -1
  160. package/lib/controls/MaterialRadioGroupControl.js +3 -1
  161. package/lib/controls/MaterialRadioGroupControl.js.map +1 -1
  162. package/lib/controls/MaterialSliderControl.d.ts +3 -6
  163. package/lib/controls/MaterialSliderControl.js +36 -40
  164. package/lib/controls/MaterialSliderControl.js.map +1 -1
  165. package/lib/controls/MaterialTextControl.d.ts +1 -1
  166. package/lib/controls/MaterialTextControl.js +3 -1
  167. package/lib/controls/MaterialTextControl.js.map +1 -1
  168. package/lib/controls/MaterialTimeControl.d.ts +6 -0
  169. package/lib/controls/MaterialTimeControl.js +62 -0
  170. package/lib/controls/MaterialTimeControl.js.map +1 -0
  171. package/lib/controls/index.d.ts +11 -9
  172. package/lib/controls/index.js +19 -14
  173. package/lib/controls/index.js.map +1 -1
  174. package/lib/extended/MaterialAutocompleteEnumControl.d.ts +1 -1
  175. package/lib/extended/MaterialAutocompleteEnumControl.js +3 -1
  176. package/lib/extended/MaterialAutocompleteEnumControl.js.map +1 -1
  177. package/lib/extended/MaterialAutocompleteOneOfEnumControl.d.ts +1 -1
  178. package/lib/extended/MaterialAutocompleteOneOfEnumControl.js +3 -1
  179. package/lib/extended/MaterialAutocompleteOneOfEnumControl.js.map +1 -1
  180. package/lib/extended/MuiAutocomplete.d.ts +3 -4
  181. package/lib/extended/MuiAutocomplete.js +7 -7
  182. package/lib/extended/MuiAutocomplete.js.map +1 -1
  183. package/lib/extended/index.d.ts +3 -3
  184. package/lib/extended/index.js +3 -2
  185. package/lib/extended/index.js.map +1 -1
  186. package/lib/index.js +3 -0
  187. package/lib/index.js.map +1 -1
  188. package/lib/jsonforms-material.js +248 -315
  189. package/lib/jsonforms-material.js.map +1 -1
  190. package/lib/layouts/ArrayToolbar.js +14 -16
  191. package/lib/layouts/ArrayToolbar.js.map +1 -1
  192. package/lib/layouts/ExpandPanelRenderer.d.ts +2 -3
  193. package/lib/layouts/ExpandPanelRenderer.js +47 -45
  194. package/lib/layouts/ExpandPanelRenderer.js.map +1 -1
  195. package/lib/layouts/MaterialArrayLayout.d.ts +1 -11
  196. package/lib/layouts/MaterialArrayLayout.js +19 -31
  197. package/lib/layouts/MaterialArrayLayout.js.map +1 -1
  198. package/lib/layouts/MaterialArrayLayoutRenderer.d.ts +1 -1
  199. package/lib/layouts/MaterialArrayLayoutRenderer.js +5 -3
  200. package/lib/layouts/MaterialArrayLayoutRenderer.js.map +1 -1
  201. package/lib/layouts/MaterialCategorizationLayout.d.ts +2 -10
  202. package/lib/layouts/MaterialCategorizationLayout.js +35 -52
  203. package/lib/layouts/MaterialCategorizationLayout.js.map +1 -1
  204. package/lib/layouts/MaterialCategorizationStepperLayout.d.ts +2 -9
  205. package/lib/layouts/MaterialCategorizationStepperLayout.js +45 -56
  206. package/lib/layouts/MaterialCategorizationStepperLayout.js.map +1 -1
  207. package/lib/layouts/MaterialGroupLayout.d.ts +1 -1
  208. package/lib/layouts/MaterialGroupLayout.js +11 -9
  209. package/lib/layouts/MaterialGroupLayout.js.map +1 -1
  210. package/lib/layouts/MaterialHorizontalLayout.d.ts +1 -1
  211. package/lib/layouts/MaterialHorizontalLayout.js +3 -1
  212. package/lib/layouts/MaterialHorizontalLayout.js.map +1 -1
  213. package/lib/layouts/MaterialVerticalLayout.d.ts +1 -1
  214. package/lib/layouts/MaterialVerticalLayout.js +3 -1
  215. package/lib/layouts/MaterialVerticalLayout.js.map +1 -1
  216. package/lib/layouts/index.js +6 -5
  217. package/lib/layouts/index.js.map +1 -1
  218. package/lib/mui-controls/MuiCheckbox.js +4 -4
  219. package/lib/mui-controls/MuiCheckbox.js.map +1 -1
  220. package/lib/mui-controls/MuiInputInteger.js +10 -7
  221. package/lib/mui-controls/MuiInputInteger.js.map +1 -1
  222. package/lib/mui-controls/MuiInputNumber.js +10 -7
  223. package/lib/mui-controls/MuiInputNumber.js.map +1 -1
  224. package/lib/mui-controls/MuiInputNumberFormat.js +8 -9
  225. package/lib/mui-controls/MuiInputNumberFormat.js.map +1 -1
  226. package/lib/mui-controls/MuiInputText.d.ts +1 -1
  227. package/lib/mui-controls/MuiInputText.js +17 -13
  228. package/lib/mui-controls/MuiInputText.js.map +1 -1
  229. package/lib/mui-controls/MuiInputTime.js +6 -4
  230. package/lib/mui-controls/MuiInputTime.js.map +1 -1
  231. package/lib/mui-controls/MuiSelect.js +4 -5
  232. package/lib/mui-controls/MuiSelect.js.map +1 -1
  233. package/lib/mui-controls/MuiToggle.js +4 -4
  234. package/lib/mui-controls/MuiToggle.js.map +1 -1
  235. package/lib/util/datejs.d.ts +3 -0
  236. package/lib/util/datejs.js +29 -0
  237. package/lib/util/datejs.js.map +1 -0
  238. package/lib/util/debounce.d.ts +1 -0
  239. package/lib/util/debounce.js +48 -0
  240. package/lib/util/debounce.js.map +1 -0
  241. package/lib/util/focus.d.ts +1 -0
  242. package/lib/util/focus.js +36 -0
  243. package/lib/util/focus.js.map +1 -0
  244. package/lib/util/index.d.ts +3 -0
  245. package/lib/util/index.js +4 -0
  246. package/lib/util/index.js.map +1 -1
  247. package/lib/util/layout.d.ts +2 -1
  248. package/lib/util/layout.js +13 -9
  249. package/lib/util/layout.js.map +1 -1
  250. package/lib/util/theme.d.ts +1 -1
  251. package/package.json +22 -26
  252. package/src/additional/ListWithDetailMasterItem.tsx +3 -6
  253. package/src/additional/MaterialLabelRenderer.tsx +1 -1
  254. package/src/additional/MaterialListWithDetailRenderer.tsx +4 -5
  255. package/src/cells/CustomizableCells.ts +1 -0
  256. package/src/cells/MaterialDateCell.tsx +1 -1
  257. package/src/cells/MaterialOneOfEnumCell.tsx +46 -0
  258. package/src/cells/MaterialTimeCell.tsx +1 -0
  259. package/src/cells/index.ts +5 -0
  260. package/src/complex/CombinatorProperties.tsx +2 -2
  261. package/src/complex/DeleteDialog.tsx +2 -2
  262. package/src/complex/MaterialAllOfRenderer.tsx +6 -5
  263. package/src/complex/MaterialAnyOfRenderer.tsx +5 -4
  264. package/src/complex/MaterialArrayControlRenderer.tsx +1 -1
  265. package/src/complex/MaterialEnumArrayRenderer.tsx +2 -1
  266. package/src/complex/MaterialObjectRenderer.tsx +6 -6
  267. package/src/complex/MaterialOneOfRenderer.tsx +9 -9
  268. package/src/complex/MaterialTableControl.tsx +45 -37
  269. package/src/complex/NoBorderTableCell.tsx +10 -12
  270. package/src/complex/TableToolbar.tsx +10 -9
  271. package/src/complex/ValidationIcon.tsx +12 -19
  272. package/src/controls/MaterialAnyOfStringOrEnumControl.tsx +17 -14
  273. package/src/controls/MaterialBooleanControl.tsx +1 -1
  274. package/src/controls/MaterialBooleanToggleControl.tsx +1 -1
  275. package/src/controls/MaterialDateControl.tsx +87 -119
  276. package/src/controls/MaterialDateTimeControl.tsx +91 -78
  277. package/src/controls/MaterialEnumControl.tsx +1 -1
  278. package/src/controls/MaterialInputControl.tsx +65 -72
  279. package/src/controls/MaterialNativeControl.tsx +55 -60
  280. package/src/controls/MaterialOneOfEnumControl.tsx +1 -1
  281. package/src/controls/MaterialOneOfRadioGroupControl.tsx +4 -4
  282. package/src/controls/MaterialRadioGroup.tsx +73 -74
  283. package/src/controls/MaterialRadioGroupControl.tsx +1 -1
  284. package/src/controls/MaterialSliderControl.tsx +93 -89
  285. package/src/controls/MaterialTimeControl.tsx +133 -0
  286. package/src/controls/index.ts +7 -0
  287. package/src/extended/MuiAutocomplete.tsx +11 -9
  288. package/src/extended/index.ts +1 -1
  289. package/src/index.ts +6 -0
  290. package/src/layouts/ArrayToolbar.tsx +11 -7
  291. package/src/layouts/ExpandPanelRenderer.tsx +46 -44
  292. package/src/layouts/MaterialArrayLayout.tsx +73 -83
  293. package/src/layouts/MaterialArrayLayoutRenderer.tsx +1 -1
  294. package/src/layouts/MaterialCategorizationLayout.tsx +50 -67
  295. package/src/layouts/MaterialCategorizationStepperLayout.tsx +80 -88
  296. package/src/layouts/MaterialGroupLayout.tsx +1 -1
  297. package/src/mui-controls/MuiCheckbox.tsx +2 -3
  298. package/src/mui-controls/MuiInputInteger.tsx +13 -10
  299. package/src/mui-controls/MuiInputNumber.tsx +10 -7
  300. package/src/mui-controls/MuiInputNumberFormat.tsx +9 -12
  301. package/src/mui-controls/MuiInputText.tsx +30 -21
  302. package/src/mui-controls/MuiInputTime.tsx +7 -5
  303. package/src/mui-controls/MuiSelect.tsx +4 -5
  304. package/src/mui-controls/MuiToggle.tsx +2 -3
  305. package/src/util/datejs.ts +32 -0
  306. package/src/util/debounce.ts +43 -0
  307. package/src/util/focus.ts +32 -0
  308. package/src/util/index.ts +3 -0
  309. package/src/util/layout.tsx +7 -8
  310. package/src/util/theme.ts +1 -1
  311. package/test/renderers/MaterialAllOfRenderer.test.tsx +1 -1
  312. package/test/renderers/MaterialAnyOfRenderer.test.tsx +15 -9
  313. package/test/renderers/MaterialAnyOfStringOrEnumControl.test.tsx +1 -1
  314. package/test/renderers/MaterialArrayControl.test.tsx +1 -1
  315. package/test/renderers/MaterialArrayLayout.test.tsx +9 -9
  316. package/test/renderers/MaterialBooleanCell.test.tsx +1 -1
  317. package/test/renderers/MaterialBooleanToggleCell.test.tsx +3 -2
  318. package/test/renderers/MaterialBooleanToggleControl.test.tsx +3 -3
  319. package/test/renderers/MaterialCategorizationLayout.test.tsx +75 -2
  320. package/test/renderers/MaterialCategorizationStepperLayout.test.tsx +75 -2
  321. package/test/renderers/MaterialDateCell.test.tsx +1 -1
  322. package/test/renderers/MaterialDateControl.test.tsx +46 -2
  323. package/test/renderers/MaterialDateTimeControl.test.tsx +57 -12
  324. package/test/renderers/MaterialEnumArrayRenderer.test.tsx +1 -1
  325. package/test/renderers/MaterialEnumCell.test.tsx +1 -1
  326. package/test/renderers/MaterialGroupLayout.test.tsx +1 -1
  327. package/test/renderers/MaterialInputControl.test.tsx +4 -4
  328. package/test/renderers/MaterialIntegerCell.test.tsx +42 -21
  329. package/test/renderers/MaterialLabelRenderer.test.tsx +1 -1
  330. package/test/renderers/MaterialLayouts.test.tsx +1 -1
  331. package/test/renderers/MaterialListWithDetailRenderer.test.tsx +2 -2
  332. package/test/renderers/MaterialNativeControl.test.tsx +2 -2
  333. package/test/renderers/MaterialNumberCell.test.tsx +46 -25
  334. package/test/renderers/MaterialObjectControl.test.tsx +1 -1
  335. package/test/renderers/MaterialOneOfEnumCell.test.tsx +93 -0
  336. package/test/renderers/MaterialOneOfRadioGroupControl.test.tsx +1 -1
  337. package/test/renderers/MaterialOneOfRenderer.test.tsx +20 -14
  338. package/test/renderers/MaterialRadioGroupControl.test.tsx +1 -1
  339. package/test/renderers/MaterialSliderControl.test.tsx +2 -2
  340. package/test/renderers/MaterialTextCell.test.tsx +47 -33
  341. package/test/renderers/MaterialTextControl.test.tsx +8 -4
  342. package/test/renderers/MaterialTimeCell.test.tsx +42 -21
  343. package/test/renderers/MaterialTimeControl.test.tsx +380 -0
  344. package/webpack/webpack.build.js +3 -3
  345. package/docs/classes/materialarraylayout.html +0 -777
  346. package/docs/classes/materialcategorizationlayoutrenderer.html +0 -786
  347. package/docs/classes/materialcategorizationstepperlayoutrenderer.html +0 -762
  348. package/docs/classes/materialdatecontrol.html +0 -825
  349. package/docs/classes/materialdatetimecontrol.html +0 -825
  350. package/docs/classes/materialinputcontrol.html +0 -825
  351. package/docs/classes/materialnativecontrol.html +0 -825
  352. package/docs/classes/materialradiogroup.html +0 -825
  353. package/docs/classes/materialslidercontrol.html +0 -825
  354. package/docs/interfaces/datecontrol.html +0 -157
  355. package/docs/interfaces/materialarraylayoutstate.html +0 -157
  356. package/docs/interfaces/statepropsofdatecontrol.html +0 -468
  357. package/example/CustomAutocomplete.tsx +0 -54
@@ -25,7 +25,7 @@
25
25
  import isEmpty from 'lodash/isEmpty';
26
26
  import React from 'react';
27
27
  import { ComponentType } from 'react';
28
- import { Ajv } from 'ajv';
28
+ import Ajv from 'ajv';
29
29
  import {
30
30
  getAjv,
31
31
  JsonFormsCellRendererRegistryEntry,
@@ -34,8 +34,8 @@ import {
34
34
  OwnPropsOfRenderer,
35
35
  UISchemaElement
36
36
  } from '@jsonforms/core';
37
- import { areEqual, ResolvedJsonFormsDispatch, useJsonForms } from '@jsonforms/react';
38
- import { Grid, Hidden } from '@material-ui/core';
37
+ import { JsonFormsDispatch, useJsonForms } from '@jsonforms/react';
38
+ import { Grid, Hidden } from '@mui/material';
39
39
 
40
40
  export const renderLayoutElements = (
41
41
  elements: UISchemaElement[],
@@ -47,7 +47,7 @@ export const renderLayoutElements = (
47
47
  ) => {
48
48
  return elements.map((child, index) => (
49
49
  <Grid item key={`${path}-${index}`} xs>
50
- <ResolvedJsonFormsDispatch
50
+ <JsonFormsDispatch
51
51
  uischema={child}
52
52
  schema={schema}
53
53
  path={path}
@@ -63,7 +63,7 @@ export interface MaterialLayoutRendererProps extends OwnPropsOfRenderer {
63
63
  elements: UISchemaElement[];
64
64
  direction: 'row' | 'column';
65
65
  }
66
- export const MaterialLayoutRenderer = React.memo(
66
+ const MaterialLayoutRendererComponent =
67
67
  ({
68
68
  visible,
69
69
  elements,
@@ -96,9 +96,8 @@ export const MaterialLayoutRenderer = React.memo(
96
96
  </Hidden>
97
97
  );
98
98
  }
99
- },
100
- areEqual
101
- );
99
+ };
100
+ export const MaterialLayoutRenderer = React.memo(MaterialLayoutRendererComponent);
102
101
 
103
102
  export interface AjvProps {
104
103
  ajv: Ajv;
package/src/util/theme.ts CHANGED
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { Theme } from '@material-ui/core/styles';
25
+ import { Theme } from '@mui/material';
26
26
 
27
27
  export interface JsonFormsTheme extends Theme {
28
28
  jsonforms?: {
@@ -26,7 +26,7 @@ import './MatchMediaMock';
26
26
  import React from 'react';
27
27
 
28
28
  import Enzyme, { mount, ReactWrapper } from 'enzyme';
29
- import Adapter from 'enzyme-adapter-react-16';
29
+ import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
30
30
  import { ControlElement } from '@jsonforms/core';
31
31
  import { MaterialAllOfRenderer, materialRenderers } from '../../src';
32
32
  import { JsonForms, JsonFormsStateProvider } from '@jsonforms/react';
@@ -26,7 +26,7 @@ import './MatchMediaMock';
26
26
  import React from 'react';
27
27
 
28
28
  import Enzyme, { mount, ReactWrapper } from 'enzyme';
29
- import Adapter from 'enzyme-adapter-react-16';
29
+ import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
30
30
  import {
31
31
  ControlElement
32
32
  } from '@jsonforms/core';
@@ -62,7 +62,7 @@ describe('Material anyOf renderer', () => {
62
62
 
63
63
  afterEach(() => wrapper.unmount());
64
64
 
65
- it('should add an item at correct path', () => {
65
+ it('should add an item at correct path', (done) => {
66
66
  const schema = {
67
67
  type: 'object',
68
68
  properties: {
@@ -103,9 +103,12 @@ describe('Material anyOf renderer', () => {
103
103
  const input = wrapper.find('input').first();
104
104
  input.simulate('change', { target: { value: 'test' } });
105
105
  wrapper.update();
106
- expect(onChangeData.data).toEqual({
107
- value: 'test'
108
- });
106
+ setTimeout(() => {
107
+ expect(onChangeData.data).toEqual({
108
+ value: 'test'
109
+ });
110
+ done();
111
+ }, 1000);
109
112
  });
110
113
 
111
114
  it('should add a "mything"', async () => {
@@ -179,7 +182,7 @@ describe('Material anyOf renderer', () => {
179
182
  expect(nrOfRowsAfterAdd.length).toBe(4);
180
183
  });
181
184
 
182
- it('should switch to "yourThing" edit, then switch back, then edit', async () => {
185
+ it('should switch to "yourThing" edit, then switch back, then edit', async (done) => {
183
186
  const schema = {
184
187
  type: 'object',
185
188
  properties: {
@@ -260,9 +263,12 @@ describe('Material anyOf renderer', () => {
260
263
  input.simulate('change', { target: { value: 'test' } });
261
264
  wrapper.update();
262
265
 
263
- expect(onChangeData.data).toEqual({
264
- myThingsAndOrYourThings: [{ age: 5, name: 'test' }]
265
- });
266
+ setTimeout(() => {
267
+ expect(onChangeData.data).toEqual({
268
+ myThingsAndOrYourThings: [{ age: 5, name: 'test' }]
269
+ });
270
+ done();
271
+ }, 1000);
266
272
  });
267
273
 
268
274
  it('should be hideable', () => {
@@ -26,7 +26,7 @@ import './MatchMediaMock';
26
26
  import React from 'react';
27
27
 
28
28
  import Enzyme, { mount, ReactWrapper } from 'enzyme';
29
- import Adapter from 'enzyme-adapter-react-16';
29
+ import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
30
30
  import {
31
31
  ControlElement,
32
32
  JsonSchema
@@ -33,7 +33,7 @@ import * as React from 'react';
33
33
  import MaterialArrayControlRenderer from '../../src/complex/MaterialArrayControlRenderer';
34
34
  import { materialCells, materialRenderers } from '../../src';
35
35
  import Enzyme, { mount, ReactWrapper } from 'enzyme';
36
- import Adapter from 'enzyme-adapter-react-16';
36
+ import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
37
37
  import { JsonFormsStateProvider, StatelessRenderer } from '@jsonforms/react';
38
38
  import { initCore, TestEmitter } from './util';
39
39
 
@@ -34,9 +34,9 @@ import {
34
34
  materialArrayLayoutTester
35
35
  } from '../../src/layouts';
36
36
  import Enzyme, { mount, ReactWrapper } from 'enzyme';
37
- import Adapter from 'enzyme-adapter-react-16';
37
+ import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
38
38
  import { JsonForms, JsonFormsStateProvider } from '@jsonforms/react';
39
- import { ExpansionPanel } from '@material-ui/core';
39
+ import { Accordion } from '@mui/material';
40
40
  import { initCore } from './util';
41
41
 
42
42
  Enzyme.configure({ adapter: new Adapter() });
@@ -292,7 +292,7 @@ describe('Material array layout', () => {
292
292
  // up button
293
293
  expect(
294
294
  wrapper
295
- .find('ExpandPanelRenderer')
295
+ .find('Memo(ExpandPanelRendererComponent)')
296
296
  .at(0)
297
297
  .find('button')
298
298
  .find({ 'aria-label': 'Move up' }).length
@@ -300,7 +300,7 @@ describe('Material array layout', () => {
300
300
  // down button
301
301
  expect(
302
302
  wrapper
303
- .find('ExpandPanelRenderer')
303
+ .find('Memo(ExpandPanelRendererComponent)')
304
304
  .at(0)
305
305
  .find('button')
306
306
  .find({ 'aria-label': 'Move down' }).length
@@ -326,7 +326,7 @@ describe('Material array layout', () => {
326
326
 
327
327
  // getting up button of second item in expension panel;
328
328
  const upButton = wrapper
329
- .find('ExpandPanelRenderer')
329
+ .find('Memo(ExpandPanelRendererComponent)')
330
330
  .at(1)
331
331
  .find('button')
332
332
  .find({ 'aria-label': 'Move up' });
@@ -363,7 +363,7 @@ describe('Material array layout', () => {
363
363
 
364
364
  // getting up button of second item in expension panel;
365
365
  const upButton = wrapper
366
- .find('ExpandPanelRenderer')
366
+ .find('Memo(ExpandPanelRendererComponent)')
367
367
  .at(0)
368
368
  .find('button')
369
369
  .find({ 'aria-label': 'Move down' });
@@ -394,7 +394,7 @@ describe('Material array layout', () => {
394
394
 
395
395
  // getting up button of second item in expension panel;
396
396
  const upButton = wrapper
397
- .find('ExpandPanelRenderer')
397
+ .find('Memo(ExpandPanelRendererComponent)')
398
398
  .at(0)
399
399
  .find('button')
400
400
  .find({ 'aria-label': 'Move up' });
@@ -414,7 +414,7 @@ describe('Material array layout', () => {
414
414
 
415
415
  // getting up button of second item in expension panel;
416
416
  const downButton = wrapper
417
- .find('ExpandPanelRenderer')
417
+ .find('Memo(ExpandPanelRendererComponent)')
418
418
  .at(1)
419
419
  .find('button')
420
420
  .find({ 'aria-label': 'Move down' });
@@ -426,7 +426,7 @@ describe('Material array layout', () => {
426
426
  .find(
427
427
  `#${
428
428
  wrapper
429
- .find(ExpansionPanel)
429
+ .find(Accordion)
430
430
  .at(index)
431
431
  .props()['aria-labelledby']
432
432
  }`
@@ -35,7 +35,7 @@ import * as ReactDOM from 'react-dom';
35
35
  import { materialRenderers } from '../../src';
36
36
 
37
37
  import Enzyme, { mount, ReactWrapper } from 'enzyme';
38
- import Adapter from 'enzyme-adapter-react-16';
38
+ import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
39
39
  import { JsonFormsStateProvider } from '@jsonforms/react';
40
40
  import { initCore, TestEmitter } from './util';
41
41
 
@@ -36,9 +36,10 @@ import * as ReactDOM from 'react-dom';
36
36
  import { materialRenderers } from '../../src';
37
37
 
38
38
  import Enzyme, { mount, ReactWrapper } from 'enzyme';
39
- import Adapter from 'enzyme-adapter-react-16';
39
+ import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
40
40
  import { JsonFormsStateProvider } from '@jsonforms/react';
41
41
  import { initCore, TestEmitter } from './util';
42
+ import { Switch } from '@mui/material';
42
43
 
43
44
  Enzyme.configure({ adapter: new Adapter() });
44
45
 
@@ -236,7 +237,7 @@ describe('Material boolean toggle cell', () => {
236
237
  );
237
238
 
238
239
  // Make sure a toggle is rendered by checking for the thumb element
239
- expect(wrapper.find('.MuiSwitch-thumb')).toHaveLength(1);
240
+ expect(wrapper.find(Switch)).toHaveLength(1);
240
241
 
241
242
  const input = wrapper.find('input').first();
242
243
  expect(input.props().type).toBe('checkbox');
@@ -36,9 +36,10 @@ import * as ReactDOM from 'react-dom';
36
36
  import { materialRenderers } from '../../src';
37
37
 
38
38
  import Enzyme, { mount, ReactWrapper } from 'enzyme';
39
- import Adapter from 'enzyme-adapter-react-16';
39
+ import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
40
40
  import { JsonFormsStateProvider } from '@jsonforms/react';
41
41
  import { initCore, TestEmitter } from './util';
42
+ import { Switch } from '@mui/material';
42
43
 
43
44
  Enzyme.configure({ adapter: new Adapter() });
44
45
 
@@ -241,10 +242,9 @@ describe('Material boolean toggle control', () => {
241
242
  );
242
243
 
243
244
  // Make sure a toggle is rendered by checking for the thumb element
244
- expect(wrapper.find('.MuiSwitch-thumb')).toHaveLength(1);
245
+ expect(wrapper.find(Switch)).toHaveLength(1);
245
246
 
246
247
  const input = wrapper.find('input').first();
247
- console.log('should render props', input.props());
248
248
  expect(input.props().type).toBe('checkbox');
249
249
  expect(input.props().checked).toBeTruthy();
250
250
  });
@@ -39,8 +39,8 @@ import MaterialCategorizationLayoutRenderer, {
39
39
  materialCategorizationTester
40
40
  } from '../../src/layouts/MaterialCategorizationLayout';
41
41
  import { MaterialLayoutRenderer, materialRenderers } from '../../src';
42
- import { Tab, Tabs } from '@material-ui/core';
43
- import Adapter from 'enzyme-adapter-react-16';
42
+ import { Tab, Tabs } from '@mui/material';
43
+ import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
44
44
  import { initCore } from './util';
45
45
 
46
46
  Enzyme.configure({ adapter: new Adapter() });
@@ -372,4 +372,77 @@ describe('Material categorization layout', () => {
372
372
  const materialArrayLayout = wrapper.find(MaterialLayoutRenderer);
373
373
  expect(materialArrayLayout.props().renderers).toHaveLength(0);
374
374
  });
375
+
376
+ it('display correct content when hiding a tab', () => {
377
+ const data = { name : 'fo' };
378
+ const condition: SchemaBasedCondition = {
379
+ scope: '#/properties/name',
380
+ schema: { maxLength: 3 }
381
+ };
382
+ const nameControl: ControlElement = {
383
+ type: 'Control',
384
+ scope: '#/properties/name'
385
+ };
386
+ const uischema: Categorization = {
387
+ type: 'Categorization',
388
+ label: '',
389
+ options: {
390
+ showNavButtons: true
391
+ },
392
+ elements: [
393
+ {
394
+ type: 'Category',
395
+ label: 'A',
396
+ elements: undefined
397
+ },
398
+ {
399
+ type: 'Category',
400
+ label: 'B',
401
+ elements: undefined,
402
+ rule: {
403
+ effect: RuleEffect.SHOW,
404
+ condition: condition
405
+ }
406
+ },
407
+ {
408
+ type: 'Category',
409
+ label: 'C',
410
+ elements: [nameControl],
411
+ rule: {
412
+ effect: RuleEffect.HIDE,
413
+ condition: condition
414
+ }
415
+ }
416
+ ]
417
+ };
418
+
419
+ const core = initCore(fixture.schema, uischema, data);
420
+
421
+ const wrapper = mount(
422
+ <JsonFormsStateProvider initState={{ renderers: materialRenderers, core }}>
423
+ <MaterialCategorizationLayoutRenderer
424
+ {...layoutDefaultProps}
425
+ schema={fixture.schema}
426
+ uischema={uischema}
427
+ />
428
+ </JsonFormsStateProvider>
429
+ );
430
+
431
+ wrapper
432
+ .find(Tab)
433
+ .at(1)
434
+ .simulate('click');
435
+
436
+ let isCategoryCshown = wrapper.find('input[type="text"]').length > 0;
437
+ expect(isCategoryCshown).toBe(false);
438
+
439
+ core.data = { ...core.data, name: 'Barr' };
440
+ wrapper.setProps({ initState: { renderers: materialRenderers, core }} );
441
+ wrapper.update();
442
+
443
+ isCategoryCshown = wrapper.find('input[type="text"]').length > 0;
444
+ expect(isCategoryCshown).toBe(true);
445
+
446
+ wrapper.unmount();
447
+ });
375
448
  });
@@ -39,8 +39,8 @@ import MaterialCategorizationStepperLayoutRenderer, {
39
39
  materialCategorizationStepperTester
40
40
  } from '../../src/layouts/MaterialCategorizationStepperLayout';
41
41
  import { MaterialLayoutRenderer, materialRenderers } from '../../src';
42
- import { Button, Step, StepButton, Stepper } from '@material-ui/core';
43
- import Adapter from 'enzyme-adapter-react-16';
42
+ import { Button, Step, StepButton, Stepper } from '@mui/material';
43
+ import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
44
44
  import { initCore } from './util';
45
45
 
46
46
  Enzyme.configure({ adapter: new Adapter() });
@@ -561,4 +561,77 @@ describe('Material categorization stepper layout', () => {
561
561
 
562
562
  wrapper.unmount();
563
563
  });
564
+
565
+ it('display correct content when hiding a step', () => {
566
+ const data = { name : 'fo' };
567
+ const condition: SchemaBasedCondition = {
568
+ scope: '#/properties/name',
569
+ schema: { maxLength: 3 }
570
+ };
571
+ const nameControl: ControlElement = {
572
+ type: 'Control',
573
+ scope: '#/properties/name'
574
+ };
575
+ const uischema: Categorization = {
576
+ type: 'Categorization',
577
+ label: '',
578
+ options: {
579
+ showNavButtons: true
580
+ },
581
+ elements: [
582
+ {
583
+ type: 'Category',
584
+ label: 'A',
585
+ elements: undefined
586
+ },
587
+ {
588
+ type: 'Category',
589
+ label: 'B',
590
+ elements: undefined,
591
+ rule: {
592
+ effect: RuleEffect.SHOW,
593
+ condition: condition
594
+ }
595
+ },
596
+ {
597
+ type: 'Category',
598
+ label: 'C',
599
+ elements: [nameControl],
600
+ rule: {
601
+ effect: RuleEffect.HIDE,
602
+ condition: condition
603
+ }
604
+ }
605
+ ]
606
+ };
607
+
608
+ const core = initCore(fixture.schema, uischema, data);
609
+
610
+ const wrapper = mount(
611
+ <JsonFormsStateProvider initState={{ renderers: materialRenderers, core }}>
612
+ <MaterialCategorizationStepperLayoutRenderer
613
+ {...layoutDefaultProps}
614
+ schema={fixture.schema}
615
+ uischema={uischema}
616
+ />
617
+ </JsonFormsStateProvider>
618
+ );
619
+
620
+ wrapper
621
+ .find(StepButton)
622
+ .at(1)
623
+ .simulate('click');
624
+
625
+ let isCategoryCshown = wrapper.find('input[type="text"]').length > 0;
626
+ expect(isCategoryCshown).toBe(false);
627
+
628
+ core.data = { ...core.data, name: 'Barr' };
629
+ wrapper.setProps({ initState: { renderers: materialRenderers, core }} );
630
+ wrapper.update();
631
+
632
+ isCategoryCshown = wrapper.find('input[type="text"]').length > 0;
633
+ expect(isCategoryCshown).toBe(true);
634
+
635
+ wrapper.unmount();
636
+ });
564
637
  });
@@ -35,7 +35,7 @@ import MaterialDateCell, {
35
35
  import { materialRenderers } from '../../src';
36
36
 
37
37
  import Enzyme, { mount, ReactWrapper } from 'enzyme';
38
- import Adapter from 'enzyme-adapter-react-16';
38
+ import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
39
39
  import { initCore, TestEmitter } from './util';
40
40
 
41
41
  Enzyme.configure({ adapter: new Adapter() });
@@ -34,7 +34,7 @@ import * as React from 'react';
34
34
  import { materialRenderers } from '../../src';
35
35
 
36
36
  import Enzyme, { mount, ReactWrapper } from 'enzyme';
37
- import Adapter from 'enzyme-adapter-react-16';
37
+ import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
38
38
  import { JsonFormsStateProvider } from '@jsonforms/react';
39
39
  import { initCore, TestEmitter } from './util';
40
40
 
@@ -101,6 +101,19 @@ describe('Material date control tester', () => {
101
101
  }
102
102
  })
103
103
  ).toBe(4);
104
+ expect(
105
+ materialDateControlTester(
106
+ { ...uischema, options: { format: 'date' } },
107
+ {
108
+ type: 'object',
109
+ properties: {
110
+ foo: {
111
+ type: 'string'
112
+ }
113
+ }
114
+ }
115
+ )
116
+ ).toBe(4);
104
117
  });
105
118
  });
106
119
 
@@ -189,7 +202,8 @@ describe('Material date control', () => {
189
202
  </JsonFormsStateProvider>
190
203
  );
191
204
  const input = wrapper.find('input').first();
192
- input.simulate('change', { target: { value: '1961-04-12' } });
205
+ (input.getDOMNode() as HTMLInputElement).value = '1961-04-12';
206
+ input.simulate('change', input);
193
207
  expect(onChangeData.data.foo).toBe('1961-04-12');
194
208
  });
195
209
 
@@ -333,4 +347,34 @@ describe('Material date control', () => {
333
347
  const inputs = wrapper.find('input');
334
348
  expect(inputs.length).toBe(0);
335
349
  });
350
+
351
+ it('should support format customizations', () => {
352
+ const core = initCore(schema, uischema, {foo: '06---1980'});
353
+ const onChangeData: any = {
354
+ data: undefined
355
+ };
356
+ wrapper = mount(
357
+ <JsonFormsStateProvider initState={{ renderers: materialRenderers, core }}>
358
+ <TestEmitter
359
+ onChange={({ data }) => {
360
+ onChangeData.data = data;
361
+ }}
362
+ />
363
+ <MaterialDateControl
364
+ schema={schema}
365
+ uischema={{...uischema, options: {
366
+ dateFormat: 'YYYY/MM',
367
+ dateSaveFormat: 'MM---YYYY'
368
+ }}}
369
+ />
370
+ </JsonFormsStateProvider>
371
+ );
372
+
373
+ const input = wrapper.find('input').first();
374
+ expect(input.props().value).toBe('1980/06');
375
+
376
+ (input.getDOMNode() as HTMLInputElement).value = '1961/04';
377
+ input.simulate('change', input);
378
+ expect(onChangeData.data.foo).toBe('04---1961');
379
+ });
336
380
  });