@jsonforms/material-renderers 3.0.0-alpha.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.
- package/docs/assets/js/search.json +1 -1
- package/docs/classes/materialanyofstringorenumcontrol.html +1 -1
- package/docs/classes/materialtablecontrol.html +2 -2
- package/docs/globals.html +79 -79
- package/docs/index.html +6 -0
- package/docs/interfaces/arraylayouttoolbarprops.html +5 -5
- package/docs/interfaces/categorizationstate.html +1 -1
- package/docs/interfaces/dispatchpropsofexpandpanel.html +3 -3
- package/docs/interfaces/expandpanelprops.html +19 -19
- package/docs/interfaces/jsonformstheme.html +39 -46
- package/docs/interfaces/materialcategorizationlayoutrendererprops.html +4 -4
- package/docs/interfaces/materialtabletoolbarprops.html +9 -9
- package/docs/interfaces/muitextinputprops.html +2 -2
- package/docs/interfaces/ownpropsofexpandpanel.html +14 -14
- package/docs/interfaces/statepropsofexpandpanel.html +16 -16
- package/docs/interfaces/tablerowsprop.html +9 -9
- package/docs/interfaces/validationprops.html +2 -2
- package/docs/interfaces/withoptionlabel.html +7 -4
- package/example/index.ts +5 -20
- package/lib/additional/ListWithDetailMasterItem.js +8 -8
- package/lib/additional/ListWithDetailMasterItem.js.map +1 -1
- package/lib/additional/MaterialLabelRenderer.js +3 -3
- package/lib/additional/MaterialLabelRenderer.js.map +1 -1
- package/lib/additional/MaterialListWithDetailRenderer.js +6 -6
- package/lib/additional/MaterialListWithDetailRenderer.js.map +1 -1
- package/lib/cells/MaterialDateCell.js +1 -1
- package/lib/cells/MaterialDateCell.js.map +1 -1
- package/lib/complex/DeleteDialog.js +8 -9
- package/lib/complex/DeleteDialog.js.map +1 -1
- package/lib/complex/MaterialAllOfRenderer.js +8 -8
- package/lib/complex/MaterialAllOfRenderer.js.map +1 -1
- package/lib/complex/MaterialAnyOfRenderer.js +3 -3
- package/lib/complex/MaterialAnyOfRenderer.js.map +1 -1
- package/lib/complex/MaterialArrayControlRenderer.js +2 -2
- package/lib/complex/MaterialArrayControlRenderer.js.map +1 -1
- package/lib/complex/MaterialEnumArrayRenderer.js +6 -6
- package/lib/complex/MaterialEnumArrayRenderer.js.map +1 -1
- package/lib/complex/MaterialObjectRenderer.js +2 -2
- package/lib/complex/MaterialObjectRenderer.js.map +1 -1
- package/lib/complex/MaterialOneOfRenderer.js +10 -10
- package/lib/complex/MaterialOneOfRenderer.js.map +1 -1
- package/lib/complex/MaterialTableControl.js +27 -28
- package/lib/complex/MaterialTableControl.js.map +1 -1
- package/lib/complex/NoBorderTableCell.d.ts +2 -2
- package/lib/complex/NoBorderTableCell.js +8 -10
- package/lib/complex/NoBorderTableCell.js.map +1 -1
- package/lib/complex/TableToolbar.js +12 -14
- package/lib/complex/TableToolbar.js.map +1 -1
- package/lib/complex/ValidationIcon.d.ts +2 -8
- package/lib/complex/ValidationIcon.js +9 -13
- package/lib/complex/ValidationIcon.js.map +1 -1
- package/lib/controls/MaterialAnyOfStringOrEnumControl.js +2 -2
- package/lib/controls/MaterialAnyOfStringOrEnumControl.js.map +1 -1
- package/lib/controls/MaterialBooleanControl.js +3 -3
- package/lib/controls/MaterialBooleanControl.js.map +1 -1
- package/lib/controls/MaterialBooleanToggleControl.js +3 -3
- package/lib/controls/MaterialBooleanToggleControl.js.map +1 -1
- package/lib/controls/MaterialDateControl.js +8 -11
- package/lib/controls/MaterialDateControl.js.map +1 -1
- package/lib/controls/MaterialDateTimeControl.js +8 -13
- package/lib/controls/MaterialDateTimeControl.js.map +1 -1
- package/lib/controls/MaterialEnumControl.js.map +1 -1
- package/lib/controls/MaterialInputControl.js +7 -7
- package/lib/controls/MaterialInputControl.js.map +1 -1
- package/lib/controls/MaterialNativeControl.js +3 -4
- package/lib/controls/MaterialNativeControl.js.map +1 -1
- package/lib/controls/MaterialOneOfEnumControl.js.map +1 -1
- package/lib/controls/MaterialOneOfRadioGroupControl.js.map +1 -1
- package/lib/controls/MaterialRadioGroup.js +7 -9
- package/lib/controls/MaterialRadioGroup.js.map +1 -1
- package/lib/controls/MaterialRadioGroupControl.js.map +1 -1
- package/lib/controls/MaterialSliderControl.js +9 -9
- package/lib/controls/MaterialSliderControl.js.map +1 -1
- package/lib/controls/MaterialTimeControl.js +8 -8
- package/lib/controls/MaterialTimeControl.js.map +1 -1
- package/lib/extended/MuiAutocomplete.d.ts +3 -4
- package/lib/extended/MuiAutocomplete.js +3 -4
- package/lib/extended/MuiAutocomplete.js.map +1 -1
- package/lib/extended/index.d.ts +1 -1
- package/lib/extended/index.js +1 -1
- package/lib/jsonforms-material.js +248 -43
- package/lib/jsonforms-material.js.map +1 -1
- package/lib/layouts/ArrayToolbar.js +13 -16
- package/lib/layouts/ArrayToolbar.js.map +1 -1
- package/lib/layouts/ExpandPanelRenderer.js +24 -29
- package/lib/layouts/ExpandPanelRenderer.js.map +1 -1
- package/lib/layouts/MaterialArrayLayoutRenderer.js +2 -2
- package/lib/layouts/MaterialArrayLayoutRenderer.js.map +1 -1
- package/lib/layouts/MaterialCategorizationLayout.js +8 -9
- package/lib/layouts/MaterialCategorizationLayout.js.map +1 -1
- package/lib/layouts/MaterialCategorizationStepperLayout.js +9 -9
- package/lib/layouts/MaterialCategorizationStepperLayout.js.map +1 -1
- package/lib/layouts/MaterialGroupLayout.js +8 -8
- package/lib/layouts/MaterialGroupLayout.js.map +1 -1
- package/lib/mui-controls/MuiCheckbox.js +2 -2
- package/lib/mui-controls/MuiCheckbox.js.map +1 -1
- package/lib/mui-controls/MuiInputInteger.js +2 -2
- package/lib/mui-controls/MuiInputInteger.js.map +1 -1
- package/lib/mui-controls/MuiInputNumber.js +2 -2
- package/lib/mui-controls/MuiInputNumber.js.map +1 -1
- package/lib/mui-controls/MuiInputNumberFormat.js +2 -2
- package/lib/mui-controls/MuiInputNumberFormat.js.map +1 -1
- package/lib/mui-controls/MuiInputText.d.ts +1 -1
- package/lib/mui-controls/MuiInputText.js +9 -9
- package/lib/mui-controls/MuiInputText.js.map +1 -1
- package/lib/mui-controls/MuiInputTime.js +2 -2
- package/lib/mui-controls/MuiInputTime.js.map +1 -1
- package/lib/mui-controls/MuiSelect.js +2 -3
- package/lib/mui-controls/MuiSelect.js.map +1 -1
- package/lib/mui-controls/MuiToggle.js +2 -2
- package/lib/mui-controls/MuiToggle.js.map +1 -1
- package/lib/util/layout.js +4 -4
- package/lib/util/layout.js.map +1 -1
- package/lib/util/theme.d.ts +1 -1
- package/package.json +17 -20
- 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/complex/DeleteDialog.tsx +2 -2
- package/src/complex/MaterialAllOfRenderer.tsx +1 -1
- package/src/complex/MaterialAnyOfRenderer.tsx +1 -1
- package/src/complex/MaterialArrayControlRenderer.tsx +1 -1
- package/src/complex/MaterialEnumArrayRenderer.tsx +1 -1
- package/src/complex/MaterialObjectRenderer.tsx +1 -1
- package/src/complex/MaterialOneOfRenderer.tsx +1 -1
- package/src/complex/MaterialTableControl.tsx +9 -13
- 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 +1 -2
- package/src/controls/MaterialBooleanControl.tsx +1 -1
- package/src/controls/MaterialBooleanToggleControl.tsx +1 -1
- package/src/controls/MaterialDateControl.tsx +28 -29
- package/src/controls/MaterialDateTimeControl.tsx +28 -33
- package/src/controls/MaterialEnumControl.tsx +1 -1
- package/src/controls/MaterialInputControl.tsx +3 -2
- package/src/controls/MaterialNativeControl.tsx +1 -2
- package/src/controls/MaterialOneOfEnumControl.tsx +1 -1
- package/src/controls/MaterialOneOfRadioGroupControl.tsx +4 -4
- package/src/controls/MaterialRadioGroup.tsx +7 -5
- package/src/controls/MaterialRadioGroupControl.tsx +1 -1
- package/src/controls/MaterialSliderControl.tsx +1 -1
- package/src/controls/MaterialTimeControl.tsx +28 -23
- package/src/extended/MuiAutocomplete.tsx +9 -6
- package/src/extended/index.ts +1 -1
- package/src/layouts/ArrayToolbar.tsx +11 -7
- package/src/layouts/ExpandPanelRenderer.tsx +17 -15
- package/src/layouts/MaterialArrayLayoutRenderer.tsx +1 -1
- package/src/layouts/MaterialCategorizationLayout.tsx +2 -3
- package/src/layouts/MaterialCategorizationStepperLayout.tsx +1 -1
- package/src/layouts/MaterialGroupLayout.tsx +1 -1
- package/src/mui-controls/MuiCheckbox.tsx +1 -1
- package/src/mui-controls/MuiInputInteger.tsx +1 -1
- package/src/mui-controls/MuiInputNumber.tsx +1 -1
- package/src/mui-controls/MuiInputNumberFormat.tsx +1 -1
- package/src/mui-controls/MuiInputText.tsx +14 -7
- package/src/mui-controls/MuiInputTime.tsx +1 -1
- package/src/mui-controls/MuiSelect.tsx +2 -2
- package/src/mui-controls/MuiToggle.tsx +1 -1
- package/src/util/layout.tsx +1 -1
- package/src/util/theme.ts +1 -1
- package/test/renderers/MaterialAllOfRenderer.test.tsx +1 -1
- package/test/renderers/MaterialAnyOfRenderer.test.tsx +1 -1
- package/test/renderers/MaterialAnyOfStringOrEnumControl.test.tsx +1 -1
- package/test/renderers/MaterialArrayControl.test.tsx +1 -1
- package/test/renderers/MaterialArrayLayout.test.tsx +2 -2
- 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 +2 -2
- package/test/renderers/MaterialCategorizationStepperLayout.test.tsx +2 -2
- 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 +1 -1
- package/test/renderers/MaterialEnumCell.test.tsx +1 -1
- package/test/renderers/MaterialGroupLayout.test.tsx +1 -1
- package/test/renderers/MaterialInputControl.test.tsx +1 -1
- package/test/renderers/MaterialIntegerCell.test.tsx +1 -1
- 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 +1 -1
- 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 +10 -7
- package/test/renderers/MaterialRadioGroupControl.test.tsx +1 -1
- package/test/renderers/MaterialSliderControl.test.tsx +2 -2
- package/test/renderers/MaterialTextCell.test.tsx +6 -13
- package/test/renderers/MaterialTextControl.test.tsx +8 -4
- package/test/renderers/MaterialTimeCell.test.tsx +1 -1
- package/test/renderers/MaterialTimeControl.test.tsx +5 -3
- package/webpack/webpack.build.js +3 -3
- package/example/CustomAutocomplete.tsx +0 -54
|
@@ -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';
|
|
@@ -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() });
|
|
@@ -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() });
|
|
@@ -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
|
|
43
|
-
import Adapter from 'enzyme-adapter-react-
|
|
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() });
|
|
@@ -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,
|
|
@@ -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,
|
|
@@ -34,7 +34,7 @@ import IntegerCell, {
|
|
|
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
|
|
|
@@ -33,7 +33,7 @@ import MaterialLabelRenderer, {
|
|
|
33
33
|
} from '../../src/additional/MaterialLabelRenderer';
|
|
34
34
|
import { 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 { JsonForms, JsonFormsStateProvider } from '@jsonforms/react';
|
|
38
38
|
import { initCore } from './util';
|
|
39
39
|
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
RuleEffect,
|
|
33
33
|
UISchemaElement
|
|
34
34
|
} from '@jsonforms/core';
|
|
35
|
-
import Adapter from 'enzyme-adapter-react-
|
|
35
|
+
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
|
|
36
36
|
import { JsonForms } from '@jsonforms/react';
|
|
37
37
|
|
|
38
38
|
Enzyme.configure({ adapter: new Adapter() });
|
|
@@ -33,9 +33,9 @@ import MaterialListWithDetailRenderer, {
|
|
|
33
33
|
materialListWithDetailTester
|
|
34
34
|
} from '../../src/additional/MaterialListWithDetailRenderer';
|
|
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 } from '@jsonforms/react';
|
|
38
|
-
import { ListItem } from '@material
|
|
38
|
+
import { ListItem } from '@mui/material'
|
|
39
39
|
import { initCore } from './util';
|
|
40
40
|
|
|
41
41
|
Enzyme.configure({ adapter: new Adapter() });
|
|
@@ -26,8 +26,8 @@ import './MatchMediaMock';
|
|
|
26
26
|
import React from 'react';
|
|
27
27
|
import Enzyme, { mount, ReactWrapper } from 'enzyme';
|
|
28
28
|
import { MaterialNativeControl } from '../../src/controls/MaterialNativeControl';
|
|
29
|
-
import TextField from '@material
|
|
30
|
-
import Adapter from 'enzyme-adapter-react-
|
|
29
|
+
import TextField from '@mui/material/TextField';
|
|
30
|
+
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
|
|
31
31
|
import { ControlElement, ControlProps } from '@jsonforms/core';
|
|
32
32
|
|
|
33
33
|
Enzyme.configure({ adapter: new Adapter() });
|
|
@@ -34,7 +34,7 @@ import NumberCell, {
|
|
|
34
34
|
} from '../../src/cells/MaterialNumberCell';
|
|
35
35
|
import { materialRenderers } from '../../src';
|
|
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
|
|
|
@@ -33,7 +33,7 @@ import MaterialObjectRenderer, {
|
|
|
33
33
|
materialObjectControlTester
|
|
34
34
|
} from '../../src/complex/MaterialObjectRenderer';
|
|
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 } from '@jsonforms/react';
|
|
38
38
|
import { initCore } from './util';
|
|
39
39
|
|
|
@@ -33,7 +33,7 @@ import MaterialOneOfEnumCell, {
|
|
|
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
|
|
|
@@ -33,7 +33,7 @@ import MaterialOneOfRadioGroupControl, {
|
|
|
33
33
|
} from '../../src/controls/MaterialOneOfRadioGroupControl';
|
|
34
34
|
import { 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 {
|
|
38
38
|
JsonFormsStateProvider
|
|
39
39
|
} from '@jsonforms/react';
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import './MatchMediaMock';
|
|
26
26
|
import React from 'react';
|
|
27
|
-
import Dialog from '@material
|
|
27
|
+
import Dialog from '@mui/material/Dialog';
|
|
28
28
|
|
|
29
29
|
import Enzyme, { mount, ReactWrapper } from 'enzyme';
|
|
30
|
-
import Adapter from 'enzyme-adapter-react-
|
|
30
|
+
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
|
|
31
31
|
import {
|
|
32
32
|
ControlElement
|
|
33
33
|
} from '@jsonforms/core';
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
materialRenderers
|
|
37
37
|
} from '../../src';
|
|
38
38
|
import { JsonForms, JsonFormsDispatch, JsonFormsStateProvider } from '@jsonforms/react';
|
|
39
|
-
import { Tab } from '@material
|
|
39
|
+
import { Tab } from '@mui/material';
|
|
40
40
|
import { initCore, TestEmitter } from './util';
|
|
41
41
|
|
|
42
42
|
Enzyme.configure({ adapter: new Adapter() });
|
|
@@ -120,8 +120,9 @@ describe('Material oneOf renderer', () => {
|
|
|
120
120
|
);
|
|
121
121
|
|
|
122
122
|
const firstTab = wrapper.find(Tab).first();
|
|
123
|
-
expect(firstTab.
|
|
123
|
+
expect(firstTab.html()).toContain('Mui-selected');
|
|
124
124
|
});
|
|
125
|
+
|
|
125
126
|
it('should render and select second tab due to datatype', () => {
|
|
126
127
|
const schema = {
|
|
127
128
|
type: 'object',
|
|
@@ -159,8 +160,9 @@ describe('Material oneOf renderer', () => {
|
|
|
159
160
|
expect(wrapper.find(MaterialOneOfRenderer).length).toBeTruthy();
|
|
160
161
|
|
|
161
162
|
const secondTab = wrapper.find(Tab).at(1);
|
|
162
|
-
expect(secondTab.
|
|
163
|
+
expect(secondTab.html()).toContain('Mui-selected');
|
|
163
164
|
});
|
|
165
|
+
|
|
164
166
|
it('should render and select second tab due to schema with additionalProperties', () => {
|
|
165
167
|
const schema = {
|
|
166
168
|
type: 'object',
|
|
@@ -206,8 +208,9 @@ describe('Material oneOf renderer', () => {
|
|
|
206
208
|
expect(wrapper.find(MaterialOneOfRenderer).length).toBeTruthy();
|
|
207
209
|
|
|
208
210
|
const secondTab = wrapper.find(Tab).at(1);
|
|
209
|
-
expect(secondTab.
|
|
211
|
+
expect(secondTab.html()).toContain('Mui-selected');
|
|
210
212
|
});
|
|
213
|
+
|
|
211
214
|
it('should render and select second tab due to schema with required', () => {
|
|
212
215
|
const schema = {
|
|
213
216
|
type: 'object',
|
|
@@ -253,7 +256,7 @@ describe('Material oneOf renderer', () => {
|
|
|
253
256
|
expect(wrapper.find(MaterialOneOfRenderer).length).toBeTruthy();
|
|
254
257
|
|
|
255
258
|
const secondTab = wrapper.find(Tab).at(1);
|
|
256
|
-
expect(secondTab.
|
|
259
|
+
expect(secondTab.html()).toContain('Mui-selected');
|
|
257
260
|
});
|
|
258
261
|
|
|
259
262
|
it('should add an item at correct path', (done) => {
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
import MaterialRadioGroupControl, { materialRadioGroupControlTester } from '../../src/controls/MaterialRadioGroupControl';
|
|
32
32
|
import { materialRenderers } from '../../src';
|
|
33
33
|
import Enzyme, { mount, ReactWrapper } from 'enzyme';
|
|
34
|
-
import Adapter from 'enzyme-adapter-react-
|
|
34
|
+
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
|
|
35
35
|
import { JsonFormsStateProvider } from '@jsonforms/react';
|
|
36
36
|
import { initCore } from './util';
|
|
37
37
|
Enzyme.configure({ adapter: new Adapter() });
|
|
@@ -33,10 +33,10 @@ import SliderControl, {
|
|
|
33
33
|
materialSliderControlTester
|
|
34
34
|
} from '../../src/controls/MaterialSliderControl';
|
|
35
35
|
import { materialRenderers } from '../../src';
|
|
36
|
-
import { Slider } from '@material
|
|
36
|
+
import { Slider } from '@mui/material';
|
|
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 { JsonForms, JsonFormsStateProvider } from '@jsonforms/react';
|
|
41
41
|
import { initCore } from './util';
|
|
42
42
|
|
|
@@ -35,7 +35,7 @@ import TextCell, {
|
|
|
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
|
|
|
@@ -454,9 +454,8 @@ describe('Material text cell', () => {
|
|
|
454
454
|
.first()
|
|
455
455
|
.getDOMNode() as HTMLInputElement;
|
|
456
456
|
expect(input.maxLength).toBe(DEFAULT_MAX_LENGTH);
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
).toBe('100%');
|
|
457
|
+
|
|
458
|
+
expect(input.parentElement.classList.contains('MuiInputBase-fullWidth')).toBeTruthy;
|
|
460
459
|
expect(input.size).toBe(DEFAULT_SIZE);
|
|
461
460
|
});
|
|
462
461
|
|
|
@@ -478,9 +477,7 @@ describe('Material text cell', () => {
|
|
|
478
477
|
.first()
|
|
479
478
|
.getDOMNode() as HTMLInputElement;
|
|
480
479
|
expect(input.maxLength).toBe(DEFAULT_MAX_LENGTH);
|
|
481
|
-
expect(
|
|
482
|
-
getComputedStyle(input.parentElement, null).getPropertyValue('width')
|
|
483
|
-
).toBe('100%');
|
|
480
|
+
expect(input.parentElement.classList.contains('MuiInputBase-fullWidth')).toBeTruthy;
|
|
484
481
|
expect(input.size).toBe(DEFAULT_SIZE);
|
|
485
482
|
});
|
|
486
483
|
|
|
@@ -502,9 +499,7 @@ describe('Material text cell', () => {
|
|
|
502
499
|
.first()
|
|
503
500
|
.getDOMNode() as HTMLInputElement;
|
|
504
501
|
expect(input.maxLength).toBe(DEFAULT_MAX_LENGTH);
|
|
505
|
-
expect(
|
|
506
|
-
getComputedStyle(input.parentElement, null).getPropertyValue('width')
|
|
507
|
-
).toBe('100%');
|
|
502
|
+
expect(input.parentElement.classList.contains('MuiInputBase-fullWidth')).toBeTruthy;
|
|
508
503
|
expect(input.size).toBe(DEFAULT_SIZE);
|
|
509
504
|
});
|
|
510
505
|
|
|
@@ -520,9 +515,7 @@ describe('Material text cell', () => {
|
|
|
520
515
|
.first()
|
|
521
516
|
.getDOMNode() as HTMLInputElement;
|
|
522
517
|
expect(input.maxLength).toBe(DEFAULT_MAX_LENGTH);
|
|
523
|
-
expect(
|
|
524
|
-
getComputedStyle(input.parentElement, null).getPropertyValue('width')
|
|
525
|
-
).toBe('100%');
|
|
518
|
+
expect(input.parentElement.classList.contains('MuiInputBase-fullWidth')).toBeTruthy;
|
|
526
519
|
expect(input.size).toBe(DEFAULT_SIZE);
|
|
527
520
|
});
|
|
528
521
|
|
|
@@ -28,9 +28,9 @@ import Enzyme, { mount, ReactWrapper } from 'enzyme';
|
|
|
28
28
|
import { MaterialTextControl } from '../../src/controls/MaterialTextControl';
|
|
29
29
|
import { MaterialInputControl } from '../../src/controls/MaterialInputControl';
|
|
30
30
|
import { MuiInputText } from '../../src/mui-controls/MuiInputText';
|
|
31
|
-
import Adapter from 'enzyme-adapter-react-
|
|
31
|
+
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
|
|
32
32
|
import { ControlElement, ControlProps } from '@jsonforms/core';
|
|
33
|
-
import { Input, InputAdornment } from '@material
|
|
33
|
+
import { Input, InputAdornment } from '@mui/material';
|
|
34
34
|
|
|
35
35
|
Enzyme.configure({ adapter: new Adapter() });
|
|
36
36
|
|
|
@@ -97,7 +97,9 @@ describe('Material text control', () => {
|
|
|
97
97
|
it('shows clear button when data exists', () => {
|
|
98
98
|
const props = defaultControlProps();
|
|
99
99
|
wrapper = mount(createMaterialTextControl(props));
|
|
100
|
-
|
|
100
|
+
// call onPointerEnter prop manually as the tests seem to ignore 'pointerenter' events, 'mouseover' events work however.
|
|
101
|
+
wrapper.find(Input).props().onPointerEnter.call(this);
|
|
102
|
+
wrapper.update();
|
|
101
103
|
expect(wrapper.find(InputAdornment).props().style).not.toHaveProperty('display', 'none');
|
|
102
104
|
});
|
|
103
105
|
|
|
@@ -105,7 +107,9 @@ describe('Material text control', () => {
|
|
|
105
107
|
const props = defaultControlProps();
|
|
106
108
|
delete props.data;
|
|
107
109
|
wrapper = mount(createMaterialTextControl(props));
|
|
108
|
-
|
|
110
|
+
// call onPointerEnter prop manually as the tests seem to ignore 'pointerenter' events, 'mouseover' events work however.
|
|
111
|
+
wrapper.find(Input).props().onPointerEnter.call(this);
|
|
112
|
+
wrapper.update();
|
|
109
113
|
expect(wrapper.find(InputAdornment).props().style).toHaveProperty('display', 'none');
|
|
110
114
|
});
|
|
111
115
|
});
|
|
@@ -34,7 +34,7 @@ import TimeCell, {
|
|
|
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
|
|
|
@@ -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 time control', () => {
|
|
|
202
202
|
</JsonFormsStateProvider>
|
|
203
203
|
);
|
|
204
204
|
const input = wrapper.find('input').first();
|
|
205
|
-
input.
|
|
205
|
+
(input.getDOMNode() as HTMLInputElement).value = '08:40';
|
|
206
|
+
input.simulate('change', input);
|
|
206
207
|
expect(onChangeData.data.foo).toBe('08:40:00');
|
|
207
208
|
});
|
|
208
209
|
|
|
@@ -372,7 +373,8 @@ describe('Material time control', () => {
|
|
|
372
373
|
const input = wrapper.find('input').first();
|
|
373
374
|
expect(input.props().value).toBe('02-13');
|
|
374
375
|
|
|
375
|
-
input.
|
|
376
|
+
(input.getDOMNode() as HTMLInputElement).value = '12:01';
|
|
377
|
+
input.simulate('change', input);
|
|
376
378
|
expect(onChangeData.data.foo).toBe('1//12 am');
|
|
377
379
|
});
|
|
378
380
|
});
|
package/webpack/webpack.build.js
CHANGED
|
@@ -14,8 +14,8 @@ module.exports = merge(baseConfig, {
|
|
|
14
14
|
"redux": "Redux",
|
|
15
15
|
"react-redux": "ReactRedux"
|
|
16
16
|
},
|
|
17
|
-
/@material
|
|
18
|
-
/@
|
|
19
|
-
/@
|
|
17
|
+
/@mui\/material\/.*/,
|
|
18
|
+
/@mui\/icons-material\/.*/,
|
|
19
|
+
/@mui\/lab\/.*/,
|
|
20
20
|
],
|
|
21
21
|
});
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AnyAction,
|
|
3
|
-
ControlProps,
|
|
4
|
-
Dispatch,
|
|
5
|
-
OwnPropsOfEnum,
|
|
6
|
-
RankedTester,
|
|
7
|
-
withIncreasedRank,
|
|
8
|
-
Actions
|
|
9
|
-
} from '@jsonforms/core';
|
|
10
|
-
import { ExtendedUnwrapped } from '../src/extended';
|
|
11
|
-
import { materialAutocompleteOneOfEnumControlTester } from '../src/extended/MaterialAutocompleteOneOfEnumControl';
|
|
12
|
-
import { withJsonFormsOneOfEnumProps } from '@jsonforms/react';
|
|
13
|
-
import React from 'react';
|
|
14
|
-
import Typography from '@material-ui/core/Typography';
|
|
15
|
-
const MyAutocompleteControl = (props: ControlProps & OwnPropsOfEnum) => {
|
|
16
|
-
return (
|
|
17
|
-
<ExtendedUnwrapped.MaterialAutocompleteOneOfEnumControl
|
|
18
|
-
{...props}
|
|
19
|
-
renderOption={option => (<Typography>{`${option?.value}\t-\t${option?.label}`}</Typography>)}
|
|
20
|
-
filterOptions={(options, state) => options.filter(o => o.label.includes(state.inputValue) || o.value.includes(state.inputValue))}
|
|
21
|
-
/>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const myAutocompleteTester: RankedTester = withIncreasedRank(
|
|
26
|
-
1,
|
|
27
|
-
materialAutocompleteOneOfEnumControlTester
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
const ConnectedControl = withJsonFormsOneOfEnumProps(MyAutocompleteControl);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export const ExampleExtension = (dispatch: Dispatch<AnyAction>) => (
|
|
34
|
-
<div>
|
|
35
|
-
<button
|
|
36
|
-
onClick={() =>
|
|
37
|
-
dispatch(
|
|
38
|
-
Actions.registerRenderer(myAutocompleteTester, ConnectedControl)
|
|
39
|
-
)
|
|
40
|
-
}
|
|
41
|
-
>
|
|
42
|
-
Register Custom OneOf Autocomplete
|
|
43
|
-
</button>
|
|
44
|
-
<button
|
|
45
|
-
onClick={() =>
|
|
46
|
-
dispatch(
|
|
47
|
-
Actions.unregisterRenderer(myAutocompleteTester, ConnectedControl)
|
|
48
|
-
)
|
|
49
|
-
}
|
|
50
|
-
>
|
|
51
|
-
Unregister Custom OneOf Autocomplete
|
|
52
|
-
</button>
|
|
53
|
-
</div>
|
|
54
|
-
);
|