@jsonforms/material-renderers 3.0.0-alpha.1 → 3.0.0-beta.1
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.
- package/docs/assets/js/search.json +1 -1
- package/docs/classes/combinatorproperties.html +2 -5
- package/docs/classes/materialanyofstringorenumcontrol.html +6 -9
- package/docs/classes/materialtablecontrol.html +4 -7
- package/docs/globals.html +878 -423
- package/docs/index.html +68 -59
- package/docs/interfaces/ajvprops.html +1 -4
- package/docs/interfaces/arraylayouttoolbarprops.html +5 -8
- package/docs/interfaces/categorizationstate.html +1 -4
- package/docs/interfaces/categorizationstepperstate.html +0 -3
- package/docs/interfaces/combinatorpropertiesprops.html +0 -3
- package/docs/interfaces/deletedialogprops.html +0 -3
- package/docs/interfaces/dispatchpropsofexpandpanel.html +3 -6
- package/docs/interfaces/emptytableprops.html +0 -3
- package/docs/interfaces/expandpanelprops.html +19 -22
- package/docs/interfaces/jsonformstheme.html +39 -49
- package/docs/interfaces/materialcategorizationlayoutrendererprops.html +5 -8
- package/docs/interfaces/materialcategorizationstepperlayoutrendererprops.html +1 -4
- package/docs/interfaces/materiallayoutrendererprops.html +0 -3
- package/docs/interfaces/materialtabletoolbarprops.html +9 -12
- package/docs/interfaces/muitextinputprops.html +2 -5
- package/docs/interfaces/nonemptycellcomponentprops.html +266 -0
- package/docs/interfaces/nonemptycellprops.html +0 -3
- package/docs/interfaces/nonemptyrowprops.html +80 -27
- package/docs/interfaces/ownoneofprops.html +0 -3
- package/docs/interfaces/ownpropsofexpandpanel.html +14 -17
- package/docs/interfaces/ownpropsofnonemptycell.html +0 -3
- package/docs/interfaces/statepropsofexpandpanel.html +16 -19
- package/docs/interfaces/tableheadercellprops.html +0 -3
- package/docs/interfaces/tablerowsprop.html +9 -12
- package/docs/interfaces/validationprops.html +2 -5
- package/docs/interfaces/withdeletedialogsupport.html +0 -3
- package/docs/interfaces/withinput.html +1 -4
- package/docs/interfaces/withoptionlabel.html +7 -7
- package/example/index.ts +7 -23
- package/lib/additional/ListWithDetailMasterItem.d.ts +3 -3
- package/lib/additional/MaterialLabelRenderer.d.ts +13 -13
- package/lib/additional/MaterialListWithDetailRenderer.d.ts +6 -6
- package/lib/additional/index.d.ts +4 -4
- package/lib/cells/CustomizableCells.d.ts +9 -9
- package/lib/cells/MaterialBooleanCell.d.ts +6 -6
- package/lib/cells/MaterialBooleanToggleCell.d.ts +6 -6
- package/lib/cells/MaterialDateCell.d.ts +6 -6
- package/lib/cells/MaterialEnumCell.d.ts +10 -10
- package/lib/cells/MaterialIntegerCell.d.ts +6 -6
- package/lib/cells/MaterialNumberCell.d.ts +10 -10
- package/lib/cells/MaterialNumberFormatCell.d.ts +10 -10
- package/lib/cells/MaterialOneOfEnumCell.d.ts +10 -10
- package/lib/cells/MaterialTextCell.d.ts +10 -10
- package/lib/cells/MaterialTimeCell.d.ts +6 -6
- package/lib/cells/index.d.ts +13 -13
- package/lib/complex/CombinatorProperties.d.ts +12 -12
- package/lib/complex/DeleteDialog.d.ts +11 -11
- package/lib/complex/MaterialAllOfRenderer.d.ts +6 -5
- package/lib/complex/MaterialAnyOfRenderer.d.ts +6 -5
- package/lib/complex/MaterialArrayControlRenderer.d.ts +5 -5
- package/lib/complex/MaterialEnumArrayRenderer.d.ts +6 -6
- package/lib/complex/MaterialObjectRenderer.d.ts +6 -5
- package/lib/complex/MaterialOneOfRenderer.d.ts +9 -8
- package/lib/complex/MaterialTableControl.d.ts +25 -10
- package/lib/complex/NoBorderTableCell.d.ts +3 -3
- package/lib/complex/TableToolbar.d.ts +15 -15
- package/lib/complex/ValidationIcon.d.ts +7 -11
- package/lib/complex/index.d.ts +19 -19
- package/lib/controls/MaterialAnyOfStringOrEnumControl.d.ts +9 -9
- package/lib/controls/MaterialBooleanControl.d.ts +6 -6
- package/lib/controls/MaterialBooleanToggleControl.d.ts +6 -6
- package/lib/controls/MaterialDateControl.d.ts +6 -9
- package/lib/controls/MaterialDateTimeControl.d.ts +6 -9
- package/lib/controls/MaterialEnumControl.d.ts +7 -6
- package/lib/controls/MaterialInputControl.d.ts +6 -9
- package/lib/controls/MaterialIntegerControl.d.ts +6 -6
- package/lib/controls/MaterialNativeControl.d.ts +6 -9
- package/lib/controls/MaterialNumberControl.d.ts +6 -6
- package/lib/controls/MaterialOneOfEnumControl.d.ts +7 -6
- package/lib/controls/MaterialOneOfRadioGroupControl.d.ts +6 -6
- package/lib/controls/MaterialRadioGroup.d.ts +3 -6
- package/lib/controls/MaterialRadioGroupControl.d.ts +6 -6
- package/lib/controls/MaterialSliderControl.d.ts +6 -9
- package/lib/controls/MaterialTextControl.d.ts +6 -6
- package/lib/controls/MaterialTimeControl.d.ts +6 -9
- package/lib/controls/index.d.ts +35 -35
- package/lib/index.d.ts +9 -9
- package/lib/jsonforms-react-material.cjs.js +1489 -0
- package/lib/jsonforms-react-material.cjs.js.map +1 -0
- package/lib/jsonforms-react-material.esm.js +1221 -0
- package/lib/jsonforms-react-material.esm.js.map +1 -0
- package/lib/layouts/ArrayToolbar.d.ts +9 -9
- package/lib/layouts/ExpandPanelRenderer.d.ts +51 -51
- package/lib/layouts/MaterialArrayLayout.d.ts +3 -13
- package/lib/layouts/MaterialArrayLayoutRenderer.d.ts +6 -6
- package/lib/layouts/MaterialCategorizationLayout.d.ts +17 -25
- package/lib/layouts/MaterialCategorizationStepperLayout.d.ts +13 -20
- package/lib/layouts/MaterialGroupLayout.d.ts +7 -7
- package/lib/layouts/MaterialHorizontalLayout.d.ts +10 -10
- package/lib/layouts/MaterialVerticalLayout.d.ts +10 -10
- package/lib/layouts/index.d.ts +6 -6
- package/lib/mui-controls/MuiAutocomplete.d.ts +9 -0
- package/lib/mui-controls/MuiCheckbox.d.ts +3 -3
- package/lib/mui-controls/MuiInputInteger.d.ts +3 -3
- package/lib/mui-controls/MuiInputNumber.d.ts +3 -3
- package/lib/mui-controls/MuiInputNumberFormat.d.ts +3 -3
- package/lib/mui-controls/MuiInputText.d.ts +9 -9
- package/lib/mui-controls/MuiInputTime.d.ts +3 -3
- package/lib/mui-controls/MuiSelect.d.ts +3 -3
- package/lib/mui-controls/MuiToggle.d.ts +3 -3
- package/lib/mui-controls/index.d.ts +7 -7
- package/lib/util/datejs.d.ts +3 -3
- package/lib/util/debounce.d.ts +1 -0
- package/lib/util/focus.d.ts +1 -0
- package/lib/util/index.d.ts +5 -3
- package/lib/util/layout.d.ts +15 -13
- package/lib/util/theme.d.ts +10 -10
- package/package.json +34 -28
- package/rollup.config.js +51 -0
- package/src/additional/ListWithDetailMasterItem.tsx +3 -6
- package/src/additional/MaterialLabelRenderer.tsx +1 -1
- package/src/additional/MaterialListWithDetailRenderer.tsx +1 -1
- package/src/cells/MaterialDateCell.tsx +1 -1
- package/src/cells/MaterialTimeCell.tsx +1 -0
- package/src/complex/CombinatorProperties.tsx +2 -2
- package/src/complex/DeleteDialog.tsx +2 -2
- package/src/complex/MaterialAllOfRenderer.tsx +3 -2
- package/src/complex/MaterialAnyOfRenderer.tsx +3 -2
- package/src/complex/MaterialArrayControlRenderer.tsx +1 -1
- package/src/complex/MaterialEnumArrayRenderer.tsx +4 -3
- package/src/complex/MaterialObjectRenderer.tsx +3 -2
- package/src/complex/MaterialOneOfRenderer.tsx +7 -7
- package/src/complex/MaterialTableControl.tsx +45 -37
- package/src/complex/NoBorderTableCell.tsx +10 -12
- package/src/complex/TableToolbar.tsx +9 -7
- package/src/complex/ValidationIcon.tsx +12 -19
- package/src/controls/MaterialAnyOfStringOrEnumControl.tsx +17 -14
- package/src/controls/MaterialBooleanControl.tsx +1 -1
- package/src/controls/MaterialBooleanToggleControl.tsx +1 -1
- package/src/controls/MaterialDateControl.tsx +87 -93
- package/src/controls/MaterialDateTimeControl.tsx +88 -96
- package/src/controls/MaterialEnumControl.tsx +12 -3
- package/src/controls/MaterialInputControl.tsx +65 -71
- package/src/controls/MaterialNativeControl.tsx +55 -59
- package/src/controls/MaterialOneOfEnumControl.tsx +13 -4
- package/src/controls/MaterialOneOfRadioGroupControl.tsx +4 -4
- package/src/controls/MaterialRadioGroup.tsx +73 -73
- package/src/controls/MaterialRadioGroupControl.tsx +1 -1
- package/src/controls/MaterialSliderControl.tsx +93 -88
- package/src/controls/MaterialTimeControl.tsx +87 -85
- package/src/layouts/ArrayToolbar.tsx +11 -7
- package/src/layouts/ExpandPanelRenderer.tsx +28 -32
- package/src/layouts/MaterialArrayLayout.tsx +73 -82
- package/src/layouts/MaterialArrayLayoutRenderer.tsx +1 -1
- package/src/layouts/MaterialCategorizationLayout.tsx +50 -67
- package/src/layouts/MaterialCategorizationStepperLayout.tsx +80 -88
- package/src/layouts/MaterialGroupLayout.tsx +1 -1
- package/src/{extended → mui-controls}/MuiAutocomplete.tsx +11 -9
- package/src/mui-controls/MuiCheckbox.tsx +2 -3
- package/src/mui-controls/MuiInputInteger.tsx +13 -10
- package/src/mui-controls/MuiInputNumber.tsx +10 -7
- package/src/mui-controls/MuiInputNumberFormat.tsx +9 -12
- package/src/mui-controls/MuiInputText.tsx +30 -21
- package/src/mui-controls/MuiInputTime.tsx +7 -5
- package/src/mui-controls/MuiSelect.tsx +4 -5
- package/src/mui-controls/MuiToggle.tsx +2 -3
- package/{lib/cells/MaterialNumberCell.js → src/util/debounce.ts} +20 -16
- package/{lib/util/index.js → src/util/focus.ts} +9 -7
- package/src/util/index.ts +2 -0
- package/src/util/layout.tsx +7 -8
- package/src/util/theme.ts +1 -1
- package/stats.html +3279 -0
- package/test/renderers/MaterialAllOfRenderer.test.tsx +1 -1
- package/test/renderers/MaterialAnyOfRenderer.test.tsx +15 -9
- package/test/renderers/MaterialAnyOfStringOrEnumControl.test.tsx +1 -1
- package/test/renderers/MaterialArrayControl.test.tsx +1 -1
- package/test/renderers/MaterialArrayLayout.test.tsx +39 -32
- package/test/renderers/MaterialBooleanCell.test.tsx +1 -1
- package/test/renderers/MaterialBooleanToggleCell.test.tsx +3 -2
- package/test/renderers/MaterialBooleanToggleControl.test.tsx +3 -2
- package/test/renderers/MaterialCategorizationLayout.test.tsx +76 -3
- package/test/renderers/MaterialCategorizationStepperLayout.test.tsx +79 -6
- package/test/renderers/MaterialDateCell.test.tsx +1 -1
- package/test/renderers/MaterialDateControl.test.tsx +5 -3
- package/test/renderers/MaterialDateTimeControl.test.tsx +5 -3
- package/test/renderers/MaterialEnumArrayRenderer.test.tsx +15 -7
- package/test/renderers/MaterialEnumCell.test.tsx +1 -1
- package/test/renderers/MaterialGroupLayout.test.tsx +1 -1
- package/test/renderers/MaterialInputControl.test.tsx +4 -4
- package/test/renderers/MaterialIntegerCell.test.tsx +42 -21
- package/test/renderers/MaterialLabelRenderer.test.tsx +1 -1
- package/test/renderers/MaterialLayouts.test.tsx +1 -1
- package/test/renderers/MaterialListWithDetailRenderer.test.tsx +2 -2
- package/test/renderers/MaterialNativeControl.test.tsx +2 -2
- package/test/renderers/MaterialNumberCell.test.tsx +46 -25
- package/test/renderers/MaterialObjectControl.test.tsx +1 -1
- package/test/renderers/MaterialOneOfEnumCell.test.tsx +1 -1
- package/test/renderers/MaterialOneOfRadioGroupControl.test.tsx +1 -1
- package/test/renderers/MaterialOneOfRenderer.test.tsx +17 -11
- package/test/renderers/MaterialRadioGroupControl.test.tsx +1 -1
- package/test/renderers/MaterialSliderControl.test.tsx +2 -2
- package/test/renderers/MaterialTextCell.test.tsx +47 -33
- package/test/renderers/MaterialTextControl.test.tsx +8 -4
- package/test/renderers/MaterialTimeCell.test.tsx +42 -21
- package/test/renderers/MaterialTimeControl.test.tsx +8 -6
- package/tsconfig.json +1 -2
- package/tsconfig.test.json +7 -0
- package/docs/classes/materialarraylayout.html +0 -777
- package/docs/classes/materialcategorizationlayoutrenderer.html +0 -786
- package/docs/classes/materialcategorizationstepperlayoutrenderer.html +0 -762
- package/docs/classes/materialdatecontrol.html +0 -825
- package/docs/classes/materialdatetimecontrol.html +0 -825
- package/docs/classes/materialinputcontrol.html +0 -825
- package/docs/classes/materialnativecontrol.html +0 -825
- package/docs/classes/materialradiogroup.html +0 -825
- package/docs/classes/materialslidercontrol.html +0 -825
- package/docs/classes/materialtimecontrol.html +0 -825
- package/docs/interfaces/materialarraylayoutstate.html +0 -157
- package/example/CustomAutocomplete.tsx +0 -54
- package/lib/additional/ListWithDetailMasterItem.js +0 -19
- package/lib/additional/ListWithDetailMasterItem.js.map +0 -1
- package/lib/additional/MaterialLabelRenderer.js +0 -47
- package/lib/additional/MaterialLabelRenderer.js.map +0 -1
- package/lib/additional/MaterialListWithDetailRenderer.js +0 -64
- package/lib/additional/MaterialListWithDetailRenderer.js.map +0 -1
- package/lib/additional/index.js +0 -34
- package/lib/additional/index.js.map +0 -1
- package/lib/cells/CustomizableCells.js +0 -45
- package/lib/cells/CustomizableCells.js.map +0 -1
- package/lib/cells/MaterialBooleanCell.js +0 -37
- package/lib/cells/MaterialBooleanCell.js.map +0 -1
- package/lib/cells/MaterialBooleanToggleCell.js +0 -38
- package/lib/cells/MaterialBooleanToggleCell.js.map +0 -1
- package/lib/cells/MaterialDateCell.js +0 -40
- package/lib/cells/MaterialDateCell.js.map +0 -1
- package/lib/cells/MaterialEnumCell.js +0 -39
- package/lib/cells/MaterialEnumCell.js.map +0 -1
- package/lib/cells/MaterialIntegerCell.js +0 -35
- package/lib/cells/MaterialIntegerCell.js.map +0 -1
- package/lib/cells/MaterialNumberCell.js.map +0 -1
- package/lib/cells/MaterialNumberFormatCell.js +0 -39
- package/lib/cells/MaterialNumberFormatCell.js.map +0 -1
- package/lib/cells/MaterialOneOfEnumCell.js +0 -39
- package/lib/cells/MaterialOneOfEnumCell.js.map +0 -1
- package/lib/cells/MaterialTextCell.js +0 -39
- package/lib/cells/MaterialTextCell.js.map +0 -1
- package/lib/cells/MaterialTimeCell.js +0 -35
- package/lib/cells/MaterialTimeCell.js.map +0 -1
- package/lib/cells/index.js +0 -60
- package/lib/cells/index.js.map +0 -1
- package/lib/complex/CombinatorProperties.js +0 -57
- package/lib/complex/CombinatorProperties.js.map +0 -1
- package/lib/complex/DeleteDialog.js +0 -41
- package/lib/complex/DeleteDialog.js.map +0 -1
- package/lib/complex/MaterialAllOfRenderer.js +0 -45
- package/lib/complex/MaterialAllOfRenderer.js.map +0 -1
- package/lib/complex/MaterialAnyOfRenderer.js +0 -49
- package/lib/complex/MaterialAnyOfRenderer.js.map +0 -1
- package/lib/complex/MaterialArrayControlRenderer.js +0 -55
- package/lib/complex/MaterialArrayControlRenderer.js.map +0 -1
- package/lib/complex/MaterialEnumArrayRenderer.js +0 -45
- package/lib/complex/MaterialEnumArrayRenderer.js.map +0 -1
- package/lib/complex/MaterialObjectRenderer.js +0 -49
- package/lib/complex/MaterialObjectRenderer.js.map +0 -1
- package/lib/complex/MaterialOneOfRenderer.js +0 -77
- package/lib/complex/MaterialOneOfRenderer.js.map +0 -1
- package/lib/complex/MaterialTableControl.js +0 -190
- package/lib/complex/MaterialTableControl.js.map +0 -1
- package/lib/complex/NoBorderTableCell.js +0 -41
- package/lib/complex/NoBorderTableCell.js.map +0 -1
- package/lib/complex/TableToolbar.js +0 -58
- package/lib/complex/TableToolbar.js.map +0 -1
- package/lib/complex/ValidationIcon.js +0 -48
- package/lib/complex/ValidationIcon.js.map +0 -1
- package/lib/complex/index.js +0 -47
- package/lib/complex/index.js.map +0 -1
- package/lib/controls/MaterialAnyOfStringOrEnumControl.js +0 -80
- package/lib/controls/MaterialAnyOfStringOrEnumControl.js.map +0 -1
- package/lib/controls/MaterialBooleanControl.js +0 -41
- package/lib/controls/MaterialBooleanControl.js.map +0 -1
- package/lib/controls/MaterialBooleanToggleControl.js +0 -41
- package/lib/controls/MaterialBooleanToggleControl.js.map +0 -1
- package/lib/controls/MaterialDateControl.js +0 -69
- package/lib/controls/MaterialDateControl.js.map +0 -1
- package/lib/controls/MaterialDateTimeControl.js +0 -71
- package/lib/controls/MaterialDateTimeControl.js.map +0 -1
- package/lib/controls/MaterialEnumControl.js +0 -36
- package/lib/controls/MaterialEnumControl.js.map +0 -1
- package/lib/controls/MaterialInputControl.js +0 -61
- package/lib/controls/MaterialInputControl.js.map +0 -1
- package/lib/controls/MaterialIntegerControl.js +0 -36
- package/lib/controls/MaterialIntegerControl.js.map +0 -1
- package/lib/controls/MaterialNativeControl.js +0 -55
- package/lib/controls/MaterialNativeControl.js.map +0 -1
- package/lib/controls/MaterialNumberControl.js +0 -36
- package/lib/controls/MaterialNumberControl.js.map +0 -1
- package/lib/controls/MaterialOneOfEnumControl.js +0 -36
- package/lib/controls/MaterialOneOfEnumControl.js.map +0 -1
- package/lib/controls/MaterialOneOfRadioGroupControl.js +0 -37
- package/lib/controls/MaterialOneOfRadioGroupControl.js.map +0 -1
- package/lib/controls/MaterialRadioGroup.js +0 -55
- package/lib/controls/MaterialRadioGroup.js.map +0 -1
- package/lib/controls/MaterialRadioGroupControl.js +0 -37
- package/lib/controls/MaterialRadioGroupControl.js.map +0 -1
- package/lib/controls/MaterialSliderControl.js +0 -74
- package/lib/controls/MaterialSliderControl.js.map +0 -1
- package/lib/controls/MaterialTextControl.js +0 -36
- package/lib/controls/MaterialTextControl.js.map +0 -1
- package/lib/controls/MaterialTimeControl.js +0 -66
- package/lib/controls/MaterialTimeControl.js.map +0 -1
- package/lib/controls/index.js +0 -91
- package/lib/controls/index.js.map +0 -1
- package/lib/extended/MaterialAutocompleteEnumControl.d.ts +0 -7
- package/lib/extended/MaterialAutocompleteEnumControl.js +0 -42
- package/lib/extended/MaterialAutocompleteEnumControl.js.map +0 -1
- package/lib/extended/MaterialAutocompleteOneOfEnumControl.d.ts +0 -7
- package/lib/extended/MaterialAutocompleteOneOfEnumControl.js +0 -42
- package/lib/extended/MaterialAutocompleteOneOfEnumControl.js.map +0 -1
- package/lib/extended/MuiAutocomplete.d.ts +0 -10
- package/lib/extended/MuiAutocomplete.js +0 -45
- package/lib/extended/MuiAutocomplete.js.map +0 -1
- package/lib/extended/index.d.ts +0 -10
- package/lib/extended/index.js +0 -48
- package/lib/extended/index.js.map +0 -1
- package/lib/index.js +0 -89
- package/lib/index.js.map +0 -1
- package/lib/jsonforms-material.js +0 -86
- package/lib/jsonforms-material.js.map +0 -1
- package/lib/layouts/ArrayToolbar.js +0 -27
- package/lib/layouts/ArrayToolbar.js.map +0 -1
- package/lib/layouts/ExpandPanelRenderer.js +0 -113
- package/lib/layouts/ExpandPanelRenderer.js.map +0 -1
- package/lib/layouts/MaterialArrayLayout.js +0 -66
- package/lib/layouts/MaterialArrayLayout.js.map +0 -1
- package/lib/layouts/MaterialArrayLayoutRenderer.js +0 -43
- package/lib/layouts/MaterialArrayLayoutRenderer.js.map +0 -1
- package/lib/layouts/MaterialCategorizationLayout.js +0 -88
- package/lib/layouts/MaterialCategorizationLayout.js.map +0 -1
- package/lib/layouts/MaterialCategorizationStepperLayout.js +0 -89
- package/lib/layouts/MaterialCategorizationStepperLayout.js.map +0 -1
- package/lib/layouts/MaterialGroupLayout.js +0 -52
- package/lib/layouts/MaterialGroupLayout.js.map +0 -1
- package/lib/layouts/MaterialHorizontalLayout.js +0 -51
- package/lib/layouts/MaterialHorizontalLayout.js.map +0 -1
- package/lib/layouts/MaterialVerticalLayout.js +0 -51
- package/lib/layouts/MaterialVerticalLayout.js.map +0 -1
- package/lib/layouts/index.js +0 -43
- package/lib/layouts/index.js.map +0 -1
- package/lib/mui-controls/MuiCheckbox.js +0 -40
- package/lib/mui-controls/MuiCheckbox.js.map +0 -1
- package/lib/mui-controls/MuiInputInteger.js +0 -41
- package/lib/mui-controls/MuiInputInteger.js.map +0 -1
- package/lib/mui-controls/MuiInputNumber.js +0 -41
- package/lib/mui-controls/MuiInputNumber.js.map +0 -1
- package/lib/mui-controls/MuiInputNumberFormat.js +0 -50
- package/lib/mui-controls/MuiInputNumberFormat.js.map +0 -1
- package/lib/mui-controls/MuiInputText.js +0 -64
- package/lib/mui-controls/MuiInputText.js.map +0 -1
- package/lib/mui-controls/MuiInputTime.js +0 -37
- package/lib/mui-controls/MuiInputTime.js.map +0 -1
- package/lib/mui-controls/MuiSelect.js +0 -38
- package/lib/mui-controls/MuiSelect.js.map +0 -1
- package/lib/mui-controls/MuiToggle.js +0 -39
- package/lib/mui-controls/MuiToggle.js.map +0 -1
- package/lib/mui-controls/index.js +0 -35
- package/lib/mui-controls/index.js.map +0 -1
- package/lib/util/datejs.js +0 -26
- package/lib/util/datejs.js.map +0 -1
- package/lib/util/index.js.map +0 -1
- package/lib/util/layout.js +0 -54
- package/lib/util/layout.js.map +0 -1
- package/lib/util/theme.js +0 -3
- package/lib/util/theme.js.map +0 -1
- package/src/extended/MaterialAutocompleteEnumControl.tsx +0 -55
- package/src/extended/MaterialAutocompleteOneOfEnumControl.tsx +0 -55
- package/src/extended/index.ts +0 -56
- package/webpack/webpack.build.js +0 -21
|
@@ -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-
|
|
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-
|
|
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
|
-
|
|
107
|
-
|
|
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
|
-
|
|
264
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
37
|
+
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
|
|
38
38
|
import { JsonForms, JsonFormsStateProvider } from '@jsonforms/react';
|
|
39
|
-
import { Accordion } from '@material
|
|
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('
|
|
295
|
+
.find('Memo(ExpandPanelRendererComponent)')
|
|
296
296
|
.at(0)
|
|
297
297
|
.find('button')
|
|
298
298
|
.find({ 'aria-label': 'Move up' }).length
|
|
@@ -300,13 +300,13 @@ describe('Material array layout', () => {
|
|
|
300
300
|
// down button
|
|
301
301
|
expect(
|
|
302
302
|
wrapper
|
|
303
|
-
.find('
|
|
303
|
+
.find('Memo(ExpandPanelRendererComponent)')
|
|
304
304
|
.at(0)
|
|
305
305
|
.find('button')
|
|
306
306
|
.find({ 'aria-label': 'Move down' }).length
|
|
307
307
|
).toBe(1);
|
|
308
308
|
});
|
|
309
|
-
it('should move item up if up button is presses', () => {
|
|
309
|
+
it('should move item up if up button is presses', (done) => {
|
|
310
310
|
const onChangeData: any = {
|
|
311
311
|
data: undefined
|
|
312
312
|
};
|
|
@@ -326,24 +326,28 @@ describe('Material array layout', () => {
|
|
|
326
326
|
|
|
327
327
|
// getting up button of second item in expension panel;
|
|
328
328
|
const upButton = wrapper
|
|
329
|
-
.find('
|
|
329
|
+
.find('Memo(ExpandPanelRendererComponent)')
|
|
330
330
|
.at(1)
|
|
331
331
|
.find('button')
|
|
332
332
|
.find({ 'aria-label': 'Move up' });
|
|
333
333
|
upButton.simulate('click');
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
334
|
+
// events are debounced for some time, so let's wait
|
|
335
|
+
setTimeout(() => {
|
|
336
|
+
expect(onChangeData.data).toEqual([
|
|
337
|
+
{
|
|
338
|
+
message: 'Yolo',
|
|
339
|
+
message2: 'Yolo 2'
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
message: 'El Barto was here',
|
|
343
|
+
message2: 'El Barto was here 2',
|
|
344
|
+
done: true
|
|
345
|
+
}
|
|
346
|
+
]);
|
|
347
|
+
done();
|
|
348
|
+
}, 50);
|
|
345
349
|
});
|
|
346
|
-
it('
|
|
350
|
+
it('should move item down if down button is pressed', (done) => {
|
|
347
351
|
const onChangeData: any = {
|
|
348
352
|
data: undefined
|
|
349
353
|
};
|
|
@@ -363,22 +367,25 @@ describe('Material array layout', () => {
|
|
|
363
367
|
|
|
364
368
|
// getting up button of second item in expension panel;
|
|
365
369
|
const upButton = wrapper
|
|
366
|
-
.find('
|
|
370
|
+
.find('Memo(ExpandPanelRendererComponent)')
|
|
367
371
|
.at(0)
|
|
368
372
|
.find('button')
|
|
369
373
|
.find({ 'aria-label': 'Move down' });
|
|
370
374
|
upButton.simulate('click');
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
375
|
+
// events are debounced for some time, so let's wait
|
|
376
|
+
setTimeout(() => {
|
|
377
|
+
expect(onChangeData.data).toEqual([
|
|
378
|
+
{
|
|
379
|
+
message: 'Yolo',
|
|
380
|
+
message2: 'Yolo 2'
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
message: 'El Barto was here',
|
|
384
|
+
message2: 'El Barto was here 2',
|
|
385
|
+
done: true
|
|
386
|
+
}
|
|
387
|
+
]); done();
|
|
388
|
+
}, 50);
|
|
382
389
|
});
|
|
383
390
|
it('should have up button disabled for first element', () => {
|
|
384
391
|
wrapper = mount(
|
|
@@ -394,7 +401,7 @@ describe('Material array layout', () => {
|
|
|
394
401
|
|
|
395
402
|
// getting up button of second item in expension panel;
|
|
396
403
|
const upButton = wrapper
|
|
397
|
-
.find('
|
|
404
|
+
.find('Memo(ExpandPanelRendererComponent)')
|
|
398
405
|
.at(0)
|
|
399
406
|
.find('button')
|
|
400
407
|
.find({ 'aria-label': 'Move up' });
|
|
@@ -414,7 +421,7 @@ describe('Material array layout', () => {
|
|
|
414
421
|
|
|
415
422
|
// getting up button of second item in expension panel;
|
|
416
423
|
const downButton = wrapper
|
|
417
|
-
.find('
|
|
424
|
+
.find('Memo(ExpandPanelRendererComponent)')
|
|
418
425
|
.at(1)
|
|
419
426
|
.find('button')
|
|
420
427
|
.find({ 'aria-label': 'Move down' });
|
|
@@ -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-
|
|
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-
|
|
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(
|
|
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-
|
|
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,7 +242,7 @@ 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(
|
|
245
|
+
expect(wrapper.find(Switch)).toHaveLength(1);
|
|
245
246
|
|
|
246
247
|
const input = wrapper.find('input').first();
|
|
247
248
|
expect(input.props().type).toBe('checkbox');
|
|
@@ -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
|
|
43
|
-
import Adapter from 'enzyme-adapter-react-
|
|
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() });
|
|
@@ -270,7 +270,7 @@ describe('Material categorization layout', () => {
|
|
|
270
270
|
|
|
271
271
|
const beforeClick = wrapper.find(Tabs).props().value;
|
|
272
272
|
wrapper
|
|
273
|
-
.find(
|
|
273
|
+
.find('button[role="tab"]')
|
|
274
274
|
.at(1)
|
|
275
275
|
.simulate('click');
|
|
276
276
|
const afterClick = wrapper.find(Tabs).props().value;
|
|
@@ -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('button[role="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,
|
|
43
|
-
import Adapter from 'enzyme-adapter-react-
|
|
42
|
+
import { Button, Step, 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() });
|
|
@@ -281,7 +281,7 @@ describe('Material categorization stepper layout', () => {
|
|
|
281
281
|
);
|
|
282
282
|
const beforeClick = wrapper.find(Stepper).props().activeStep;
|
|
283
283
|
wrapper
|
|
284
|
-
.find(
|
|
284
|
+
.find('button')
|
|
285
285
|
.at(1)
|
|
286
286
|
.simulate('click');
|
|
287
287
|
const afterClick = wrapper.find(Stepper).props().activeStep;
|
|
@@ -422,7 +422,7 @@ describe('Material categorization stepper layout', () => {
|
|
|
422
422
|
const isPrevButtonEnabledBeforeClick = !wrapper.find(Button).at(1).props().disabled;
|
|
423
423
|
const isNextButtonEnabledBeforeClick = !wrapper.find(Button).at(0).props().disabled;
|
|
424
424
|
wrapper
|
|
425
|
-
.find(
|
|
425
|
+
.find('button')
|
|
426
426
|
.at(1)
|
|
427
427
|
.simulate('click');
|
|
428
428
|
const isPrevButtonEnabledAfterClick = !wrapper.find(Button).at(1).props().disabled;
|
|
@@ -489,8 +489,8 @@ describe('Material categorization stepper layout', () => {
|
|
|
489
489
|
);
|
|
490
490
|
const activeStepBeforeClick = wrapper.find(Stepper).props().activeStep;
|
|
491
491
|
wrapper
|
|
492
|
-
.find(
|
|
493
|
-
.at(
|
|
492
|
+
.find('button')
|
|
493
|
+
.at(4)
|
|
494
494
|
.simulate('click');
|
|
495
495
|
const activeStepAfterClick = wrapper.find(Stepper).props().activeStep;
|
|
496
496
|
|
|
@@ -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('button')
|
|
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-
|
|
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-
|
|
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
|
|
|
@@ -202,7 +202,8 @@ describe('Material date control', () => {
|
|
|
202
202
|
</JsonFormsStateProvider>
|
|
203
203
|
);
|
|
204
204
|
const input = wrapper.find('input').first();
|
|
205
|
-
input.
|
|
205
|
+
(input.getDOMNode() as HTMLInputElement).value = '1961-04-12';
|
|
206
|
+
input.simulate('change', input);
|
|
206
207
|
expect(onChangeData.data.foo).toBe('1961-04-12');
|
|
207
208
|
});
|
|
208
209
|
|
|
@@ -372,7 +373,8 @@ describe('Material date control', () => {
|
|
|
372
373
|
const input = wrapper.find('input').first();
|
|
373
374
|
expect(input.props().value).toBe('1980/06');
|
|
374
375
|
|
|
375
|
-
input.
|
|
376
|
+
(input.getDOMNode() as HTMLInputElement).value = '1961/04';
|
|
377
|
+
input.simulate('change', input);
|
|
376
378
|
expect(onChangeData.data.foo).toBe('04---1961');
|
|
377
379
|
});
|
|
378
380
|
});
|
|
@@ -35,7 +35,7 @@ import dayjs from 'dayjs';
|
|
|
35
35
|
import { materialRenderers } from '../../src';
|
|
36
36
|
|
|
37
37
|
import Enzyme, { mount, ReactWrapper } from 'enzyme';
|
|
38
|
-
import Adapter from 'enzyme-adapter-react-
|
|
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
|
|
|
@@ -205,7 +205,8 @@ describe('Material date time control', () => {
|
|
|
205
205
|
</JsonFormsStateProvider>
|
|
206
206
|
);
|
|
207
207
|
const input = wrapper.find('input').first();
|
|
208
|
-
input.
|
|
208
|
+
(input.getDOMNode() as HTMLInputElement).value ='1961-12-94 20:15';
|
|
209
|
+
input.simulate('change', input);
|
|
209
210
|
expect(onChangeData.data.foo).toBe(
|
|
210
211
|
dayjs('1961-12-94 20:15').format()
|
|
211
212
|
);
|
|
@@ -378,7 +379,8 @@ describe('Material date time control', () => {
|
|
|
378
379
|
const input = wrapper.find('input').first();
|
|
379
380
|
expect(input.props().value).toBe('23-04-80 01:37:pm');
|
|
380
381
|
|
|
381
|
-
input.
|
|
382
|
+
(input.getDOMNode() as HTMLInputElement).value = '10-12-05 11:22:am';
|
|
383
|
+
input.simulate('change', input);
|
|
382
384
|
expect(onChangeData.data.foo).toBe('2005/12/10 11:22 am');
|
|
383
385
|
});
|
|
384
386
|
});
|
|
@@ -2,7 +2,7 @@ import './MatchMediaMock';
|
|
|
2
2
|
import { ControlElement, NOT_APPLICABLE } from '@jsonforms/core';
|
|
3
3
|
import { JsonForms } from '@jsonforms/react';
|
|
4
4
|
import Enzyme, { mount, ReactWrapper } from 'enzyme';
|
|
5
|
-
import Adapter from 'enzyme-adapter-react-
|
|
5
|
+
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import {
|
|
8
8
|
materialEnumArrayRendererTester,
|
|
@@ -116,8 +116,8 @@ describe('EnumArrayControl', () => {
|
|
|
116
116
|
expect(labels.last().text()).toBe('Bar');
|
|
117
117
|
});
|
|
118
118
|
|
|
119
|
-
test('oneOf items - updates data', () => {
|
|
120
|
-
let myData = undefined;
|
|
119
|
+
test('oneOf items - updates data', (done) => {
|
|
120
|
+
let myData: any = undefined;
|
|
121
121
|
wrapper = mount(
|
|
122
122
|
<JsonForms
|
|
123
123
|
schema={oneOfSchema}
|
|
@@ -131,7 +131,11 @@ describe('EnumArrayControl', () => {
|
|
|
131
131
|
);
|
|
132
132
|
const input = wrapper.find('input').first();
|
|
133
133
|
input.simulate('change', { target: { checked: true } });
|
|
134
|
-
|
|
134
|
+
// events are debounced for some time, so let's wait
|
|
135
|
+
setTimeout(() => {
|
|
136
|
+
expect(myData).toStrictEqual(['foo']);
|
|
137
|
+
done();
|
|
138
|
+
}, 50);
|
|
135
139
|
});
|
|
136
140
|
|
|
137
141
|
test('enum items - renders', () => {
|
|
@@ -177,8 +181,8 @@ describe('EnumArrayControl', () => {
|
|
|
177
181
|
expect(labels.at(2).text()).toBe('C');
|
|
178
182
|
});
|
|
179
183
|
|
|
180
|
-
test('enum items - updates data', () => {
|
|
181
|
-
let myData = undefined;
|
|
184
|
+
test('enum items - updates data', (done) => {
|
|
185
|
+
let myData: any = undefined;
|
|
182
186
|
wrapper = mount(
|
|
183
187
|
<JsonForms
|
|
184
188
|
schema={enumSchema}
|
|
@@ -192,6 +196,10 @@ describe('EnumArrayControl', () => {
|
|
|
192
196
|
);
|
|
193
197
|
const input = wrapper.find('input').first();
|
|
194
198
|
input.simulate('change', { target: { checked: true } });
|
|
195
|
-
|
|
199
|
+
// events are debounced for some time, so let's wait
|
|
200
|
+
setTimeout(() => {
|
|
201
|
+
expect(myData).toStrictEqual(['a']);
|
|
202
|
+
done();
|
|
203
|
+
}, 50);
|
|
196
204
|
});
|
|
197
205
|
});
|
|
@@ -33,7 +33,7 @@ import MaterialEnumCell, {
|
|
|
33
33
|
import { materialRenderers } from '../../src';
|
|
34
34
|
|
|
35
35
|
import Enzyme, { mount } from 'enzyme';
|
|
36
|
-
import Adapter from 'enzyme-adapter-react-
|
|
36
|
+
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
|
|
37
37
|
import { JsonFormsStateProvider } from '@jsonforms/react';
|
|
38
38
|
import { initCore } from './util';
|
|
39
39
|
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
import './MatchMediaMock';
|
|
26
26
|
import * as React from 'react';
|
|
27
27
|
import Enzyme, { mount } from 'enzyme';
|
|
28
|
-
import Adapter from 'enzyme-adapter-react-
|
|
28
|
+
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
|
|
29
29
|
import MaterialGroupLayout from '../../src/layouts/MaterialGroupLayout';
|
|
30
30
|
import { MaterialLayoutRenderer } from '../../src/util/layout';
|
|
31
31
|
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
import './MatchMediaMock';
|
|
26
26
|
import Enzyme, { mount, ReactWrapper } from 'enzyme';
|
|
27
27
|
import { materialRenderers } from '../../src';
|
|
28
|
-
import Adapter from 'enzyme-adapter-react-
|
|
28
|
+
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
|
|
29
29
|
import * as React from 'react';
|
|
30
30
|
import {
|
|
31
31
|
ControlElement,
|
|
@@ -159,7 +159,7 @@ describe('Material input control', () => {
|
|
|
159
159
|
wrapper.setProps({ initState: { renderers: materialRenderers, core }} );
|
|
160
160
|
wrapper.update();
|
|
161
161
|
const validation = wrapper.find('p').first();
|
|
162
|
-
expect(validation.text()).toBe('
|
|
162
|
+
expect(validation.text()).toBe('must be string');
|
|
163
163
|
});
|
|
164
164
|
|
|
165
165
|
it('should display multiple errors', () => {
|
|
@@ -173,7 +173,7 @@ describe('Material input control', () => {
|
|
|
173
173
|
wrapper.setProps({ initState: { renderers: materialRenderers, core }} );
|
|
174
174
|
wrapper.update();
|
|
175
175
|
const validation = wrapper.find('p').first();
|
|
176
|
-
expect(validation.text()).toBe('
|
|
176
|
+
expect(validation.text()).toBe('must be string');
|
|
177
177
|
});
|
|
178
178
|
|
|
179
179
|
it('should not show any errors', () => {
|
|
@@ -283,7 +283,7 @@ describe('Material input control', () => {
|
|
|
283
283
|
</JsonFormsStateProvider>
|
|
284
284
|
);
|
|
285
285
|
const label = wrapper.find('label').first();
|
|
286
|
-
expect(label.text()).toBe('Date Cell*');
|
|
286
|
+
expect(label.text()).toBe('Date Cell *');
|
|
287
287
|
});
|
|
288
288
|
|
|
289
289
|
it('should not display a marker for a non-required prop', () => {
|