@jsonforms/material-renderers 3.0.0-alpha.0 → 3.0.0-beta.0
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/README.md +1 -1
- 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 +1014 -483
- package/docs/index.html +77 -68
- 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 +11 -14
- package/docs/interfaces/materialcategorizationstepperlayoutrendererprops.html +7 -10
- package/docs/interfaces/materiallayoutrendererprops.html +0 -3
- package/docs/interfaces/materialtabletoolbarprops.html +10 -13
- 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 -18
- 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 -0
- package/lib/controls/index.d.ts +35 -33
- 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 -52
- 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 -0
- package/lib/util/debounce.d.ts +1 -0
- package/lib/util/focus.d.ts +1 -0
- package/lib/util/index.d.ts +5 -2
- package/lib/util/layout.d.ts +15 -13
- package/lib/util/theme.d.ts +10 -10
- package/package.json +36 -31
- 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 +2 -3
- 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 +4 -4
- 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 +10 -9
- 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 -119
- package/src/controls/MaterialDateTimeControl.tsx +91 -78
- package/src/controls/MaterialEnumControl.tsx +12 -3
- package/src/controls/MaterialInputControl.tsx +65 -72
- package/src/controls/MaterialNativeControl.tsx +55 -60
- package/src/controls/MaterialOneOfEnumControl.tsx +13 -4
- package/src/controls/MaterialOneOfRadioGroupControl.tsx +4 -4
- package/src/controls/MaterialRadioGroup.tsx +73 -74
- package/src/controls/MaterialRadioGroupControl.tsx +1 -1
- package/src/controls/MaterialSliderControl.tsx +93 -89
- package/src/controls/MaterialTimeControl.tsx +133 -0
- package/src/controls/index.ts +7 -0
- package/src/index.ts +3 -0
- package/src/layouts/ArrayToolbar.tsx +11 -7
- package/src/layouts/ExpandPanelRenderer.tsx +44 -42
- package/src/layouts/MaterialArrayLayout.tsx +73 -83
- 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/src/util/datejs.ts +32 -0
- package/{lib/cells/MaterialNumberCell.js → src/util/debounce.ts} +20 -16
- package/{lib/util/index.js → src/util/focus.ts} +9 -6
- package/src/util/index.ts +3 -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 +9 -9
- 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 +46 -2
- package/test/renderers/MaterialDateTimeControl.test.tsx +57 -12
- 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 +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 +380 -0
- 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/interfaces/datecontrol.html +0 -157
- package/docs/interfaces/materialarraylayoutstate.html +0 -157
- package/docs/interfaces/statepropsofdatecontrol.html +0 -468
- 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/bundle.js +0 -191792
- package/lib/bundle.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 -83
- package/lib/controls/MaterialDateControl.js.map +0 -1
- package/lib/controls/MaterialDateTimeControl.js +0 -64
- 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 -54
- 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/index.js +0 -87
- package/lib/controls/index.js.map +0 -1
- package/lib/example/src/App.d.ts +0 -8
- package/lib/example/src/Rating.d.ts +0 -18
- package/lib/example/src/RatingControl.d.ts +0 -16
- package/lib/example/src/index.d.ts +0 -11
- package/lib/example/src/reduxUtil.d.ts +0 -38
- package/lib/example/src/util.d.ts +0 -20
- package/lib/examples/src/1169.d.ts +0 -24
- package/lib/examples/src/1220.d.ts +0 -3
- package/lib/examples/src/1253.d.ts +0 -16
- package/lib/examples/src/1254.d.ts +0 -21
- package/lib/examples/src/allOf.d.ts +0 -56
- package/lib/examples/src/anyOf-oneOf-allOf-resolve.d.ts +0 -44
- package/lib/examples/src/anyOf.d.ts +0 -64
- package/lib/examples/src/arrays-with-custom-element-label.d.ts +0 -43
- package/lib/examples/src/arrays-with-detail-and-rule.d.ts +0 -91
- package/lib/examples/src/arrays-with-detail.d.ts +0 -65
- package/lib/examples/src/arrays.d.ts +0 -38
- package/lib/examples/src/booleanToggle.d.ts +0 -62
- package/lib/examples/src/categorization.d.ts +0 -135
- package/lib/examples/src/config.d.ts +0 -29
- package/lib/examples/src/control-options.d.ts +0 -190
- package/lib/examples/src/dates.d.ts +0 -1
- package/lib/examples/src/day1.d.ts +0 -23
- package/lib/examples/src/day2.d.ts +0 -42
- package/lib/examples/src/day3.d.ts +0 -51
- package/lib/examples/src/day4.d.ts +0 -72
- package/lib/examples/src/day5.d.ts +0 -133
- package/lib/examples/src/day6.d.ts +0 -85
- package/lib/examples/src/default.d.ts +0 -64
- package/lib/examples/src/dynamic.d.ts +0 -1
- package/lib/examples/src/enum.d.ts +0 -49
- package/lib/examples/src/enumInArray.d.ts +0 -27
- package/lib/examples/src/example.d.ts +0 -15
- package/lib/examples/src/generate.d.ts +0 -12
- package/lib/examples/src/generateUI.d.ts +0 -33
- package/lib/examples/src/huge.d.ts +0 -1
- package/lib/examples/src/i18n.d.ts +0 -25
- package/lib/examples/src/if_then_else.d.ts +0 -25
- package/lib/examples/src/index.d.ts +0 -56
- package/lib/examples/src/layout.d.ts +0 -97
- package/lib/examples/src/list-with-detail-registered.d.ts +0 -1
- package/lib/examples/src/list-with-detail.d.ts +0 -1
- package/lib/examples/src/multi-enum.d.ts +0 -34
- package/lib/examples/src/nestedArrays.d.ts +0 -4
- package/lib/examples/src/numbers.d.ts +0 -46
- package/lib/examples/src/object.d.ts +0 -56
- package/lib/examples/src/onChange.d.ts +0 -18
- package/lib/examples/src/oneOf-recursive.d.ts +0 -48
- package/lib/examples/src/oneOf.d.ts +0 -53
- package/lib/examples/src/oneOfArray.d.ts +0 -53
- package/lib/examples/src/person.d.ts +0 -99
- package/lib/examples/src/radioGroup.d.ts +0 -1
- package/lib/examples/src/readonly.d.ts +0 -36
- package/lib/examples/src/register.d.ts +0 -3
- package/lib/examples/src/resolve.d.ts +0 -45
- package/lib/examples/src/rule.d.ts +0 -59
- package/lib/examples/src/ruleInheritance.d.ts +0 -26
- package/lib/examples/src/scope.d.ts +0 -50
- package/lib/examples/src/stepper.d.ts +0 -138
- package/lib/examples/src/steppershownav.d.ts +0 -139
- package/lib/examples/src/stringArray.d.ts +0 -22
- package/lib/examples/src/text.d.ts +0 -37
- 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 -88
- package/lib/index.js.map +0 -1
- package/lib/jsonforms-material.js +0 -358
- 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 -109
- 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/logo.svg +0 -7
- package/lib/material/example/CustomAutocomplete.d.ts +0 -3
- package/lib/material/example/index.d.ts +0 -1
- package/lib/material/src/additional/ListWithDetailMasterItem.d.ts +0 -3
- package/lib/material/src/additional/MaterialLabelRenderer.d.ts +0 -13
- package/lib/material/src/additional/MaterialListWithDetailRenderer.d.ts +0 -6
- package/lib/material/src/additional/index.d.ts +0 -4
- package/lib/material/src/cells/CustomizableCells.d.ts +0 -9
- package/lib/material/src/cells/MaterialBooleanCell.d.ts +0 -6
- package/lib/material/src/cells/MaterialBooleanToggleCell.d.ts +0 -6
- package/lib/material/src/cells/MaterialDateCell.d.ts +0 -6
- package/lib/material/src/cells/MaterialEnumCell.d.ts +0 -10
- package/lib/material/src/cells/MaterialIntegerCell.d.ts +0 -6
- package/lib/material/src/cells/MaterialNumberCell.d.ts +0 -10
- package/lib/material/src/cells/MaterialNumberFormatCell.d.ts +0 -10
- package/lib/material/src/cells/MaterialOneOfEnumCell.d.ts +0 -10
- package/lib/material/src/cells/MaterialTextCell.d.ts +0 -10
- package/lib/material/src/cells/MaterialTimeCell.d.ts +0 -6
- package/lib/material/src/cells/index.d.ts +0 -13
- package/lib/material/src/complex/CombinatorProperties.d.ts +0 -12
- package/lib/material/src/complex/DeleteDialog.d.ts +0 -11
- package/lib/material/src/complex/MaterialAllOfRenderer.d.ts +0 -5
- package/lib/material/src/complex/MaterialAnyOfRenderer.d.ts +0 -5
- package/lib/material/src/complex/MaterialArrayControlRenderer.d.ts +0 -5
- package/lib/material/src/complex/MaterialEnumArrayRenderer.d.ts +0 -6
- package/lib/material/src/complex/MaterialObjectRenderer.d.ts +0 -5
- package/lib/material/src/complex/MaterialOneOfRenderer.d.ts +0 -8
- package/lib/material/src/complex/MaterialTableControl.d.ts +0 -10
- package/lib/material/src/complex/NoBorderTableCell.d.ts +0 -3
- package/lib/material/src/complex/TableToolbar.d.ts +0 -15
- package/lib/material/src/complex/ValidationIcon.d.ts +0 -11
- package/lib/material/src/complex/index.d.ts +0 -19
- package/lib/material/src/controls/MaterialAnyOfStringOrEnumControl.d.ts +0 -9
- package/lib/material/src/controls/MaterialBooleanControl.d.ts +0 -6
- package/lib/material/src/controls/MaterialBooleanToggleControl.d.ts +0 -6
- package/lib/material/src/controls/MaterialDateControl.d.ts +0 -18
- package/lib/material/src/controls/MaterialDateTimeControl.d.ts +0 -9
- package/lib/material/src/controls/MaterialEnumControl.d.ts +0 -6
- package/lib/material/src/controls/MaterialInputControl.d.ts +0 -9
- package/lib/material/src/controls/MaterialIntegerControl.d.ts +0 -6
- package/lib/material/src/controls/MaterialNativeControl.d.ts +0 -9
- package/lib/material/src/controls/MaterialNumberControl.d.ts +0 -6
- package/lib/material/src/controls/MaterialOneOfEnumControl.d.ts +0 -6
- package/lib/material/src/controls/MaterialOneOfRadioGroupControl.d.ts +0 -6
- package/lib/material/src/controls/MaterialRadioGroup.d.ts +0 -6
- package/lib/material/src/controls/MaterialRadioGroupControl.d.ts +0 -6
- package/lib/material/src/controls/MaterialSliderControl.d.ts +0 -9
- package/lib/material/src/controls/MaterialTextControl.d.ts +0 -6
- package/lib/material/src/controls/index.d.ts +0 -33
- package/lib/material/src/extended/MaterialAutocompleteEnumControl.d.ts +0 -7
- package/lib/material/src/extended/MaterialAutocompleteOneOfEnumControl.d.ts +0 -7
- package/lib/material/src/extended/MuiAutocomplete.d.ts +0 -10
- package/lib/material/src/extended/index.d.ts +0 -10
- package/lib/material/src/index.d.ts +0 -9
- package/lib/material/src/layouts/ArrayToolbar.d.ts +0 -9
- package/lib/material/src/layouts/ExpandPanelRenderer.d.ts +0 -52
- package/lib/material/src/layouts/MaterialArrayLayout.d.ts +0 -13
- package/lib/material/src/layouts/MaterialArrayLayoutRenderer.d.ts +0 -6
- package/lib/material/src/layouts/MaterialCategorizationLayout.d.ts +0 -25
- package/lib/material/src/layouts/MaterialCategorizationStepperLayout.d.ts +0 -20
- package/lib/material/src/layouts/MaterialGroupLayout.d.ts +0 -7
- package/lib/material/src/layouts/MaterialHorizontalLayout.d.ts +0 -10
- package/lib/material/src/layouts/MaterialVerticalLayout.d.ts +0 -10
- package/lib/material/src/layouts/index.d.ts +0 -6
- package/lib/material/src/mui-controls/MuiCheckbox.d.ts +0 -3
- package/lib/material/src/mui-controls/MuiInputInteger.d.ts +0 -3
- package/lib/material/src/mui-controls/MuiInputNumber.d.ts +0 -3
- package/lib/material/src/mui-controls/MuiInputNumberFormat.d.ts +0 -3
- package/lib/material/src/mui-controls/MuiInputText.d.ts +0 -9
- package/lib/material/src/mui-controls/MuiInputTime.d.ts +0 -3
- package/lib/material/src/mui-controls/MuiSelect.d.ts +0 -3
- package/lib/material/src/mui-controls/MuiToggle.d.ts +0 -3
- package/lib/material/src/mui-controls/index.d.ts +0 -7
- package/lib/material/src/util/index.d.ts +0 -2
- package/lib/material/src/util/layout.d.ts +0 -13
- package/lib/material/src/util/theme.d.ts +0 -10
- 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/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
|
@@ -22,115 +22,119 @@
|
|
|
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 React from 'react';
|
|
25
|
+
import React, {useCallback} from 'react';
|
|
26
26
|
import {
|
|
27
|
-
computeLabel,
|
|
28
27
|
ControlProps,
|
|
29
|
-
|
|
28
|
+
showAsRequired,
|
|
30
29
|
isDescriptionHidden,
|
|
31
|
-
isPlainLabel,
|
|
32
30
|
isRangeControl,
|
|
33
31
|
RankedTester,
|
|
34
32
|
rankWith
|
|
35
33
|
} from '@jsonforms/core';
|
|
36
|
-
import {
|
|
34
|
+
import { withJsonFormsControlProps } from '@jsonforms/react';
|
|
37
35
|
|
|
38
36
|
import {
|
|
39
37
|
FormControl,
|
|
40
38
|
FormHelperText,
|
|
39
|
+
FormLabel,
|
|
41
40
|
Hidden,
|
|
42
41
|
Slider,
|
|
43
42
|
Typography
|
|
44
|
-
} from '@material
|
|
43
|
+
} from '@mui/material';
|
|
45
44
|
import merge from 'lodash/merge';
|
|
45
|
+
import { useFocus } from '../util';
|
|
46
46
|
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
47
|
+
export const MaterialSliderControl = (props: ControlProps) => {
|
|
48
|
+
const [focused, onFocus, onBlur] = useFocus();
|
|
49
|
+
const {
|
|
50
|
+
id,
|
|
51
|
+
data,
|
|
52
|
+
description,
|
|
53
|
+
enabled,
|
|
54
|
+
errors,
|
|
55
|
+
label,
|
|
56
|
+
schema,
|
|
57
|
+
handleChange,
|
|
58
|
+
visible,
|
|
59
|
+
path,
|
|
60
|
+
required,
|
|
61
|
+
config
|
|
62
|
+
} = props;
|
|
63
|
+
const isValid = errors.length === 0;
|
|
64
|
+
const appliedUiSchemaOptions = merge(
|
|
65
|
+
{},
|
|
66
|
+
config,
|
|
67
|
+
props.uischema.options
|
|
68
|
+
);
|
|
69
|
+
const labelStyle: { [x: string]: any } = {
|
|
70
|
+
whiteSpace: 'nowrap',
|
|
71
|
+
overflow: 'hidden',
|
|
72
|
+
textOverflow: 'ellipsis',
|
|
73
|
+
width: '100%'
|
|
74
|
+
};
|
|
75
|
+
const rangeContainerStyle: { [x: string]: any } = {
|
|
76
|
+
display: 'flex'
|
|
77
|
+
};
|
|
78
|
+
const rangeItemStyle: { [x: string]: any } = {
|
|
79
|
+
flexGrow: '1'
|
|
80
|
+
};
|
|
81
|
+
const sliderStyle: { [x: string]: any } = {
|
|
82
|
+
marginTop: '7px'
|
|
83
|
+
};
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
85
|
+
const showDescription = !isDescriptionHidden(
|
|
86
|
+
visible,
|
|
87
|
+
description,
|
|
88
|
+
focused,
|
|
89
|
+
appliedUiSchemaOptions.showUnfocusedDescription
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
const onChange = useCallback((_ev: any, value: any) => handleChange(path, Number(value)), [path, handleChange]);
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<Hidden xsUp={!visible}>
|
|
96
|
+
<FormControl
|
|
97
|
+
fullWidth={!appliedUiSchemaOptions.trim}
|
|
98
|
+
onFocus={onFocus}
|
|
99
|
+
onBlur={onBlur}
|
|
100
|
+
id={id}
|
|
101
|
+
>
|
|
102
|
+
<FormLabel
|
|
103
|
+
htmlFor={id}
|
|
104
|
+
error={!isValid}
|
|
105
|
+
component={'legend' as 'label'}
|
|
106
|
+
required={showAsRequired(required,
|
|
107
|
+
appliedUiSchemaOptions.hideRequiredAsterisk)}
|
|
98
108
|
>
|
|
99
109
|
<Typography id={id + '-typo'} style={labelStyle} variant='caption'>
|
|
100
|
-
{
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
{label}
|
|
111
|
+
</Typography>
|
|
112
|
+
</FormLabel>
|
|
113
|
+
<div style={rangeContainerStyle}>
|
|
114
|
+
<Typography style={rangeItemStyle} variant='caption' align='left'>
|
|
115
|
+
{schema.minimum}
|
|
116
|
+
</Typography>
|
|
117
|
+
<Typography style={rangeItemStyle} variant='caption' align='right'>
|
|
118
|
+
{schema.maximum}
|
|
105
119
|
</Typography>
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
step={schema.multipleOf || 1}
|
|
125
|
-
/>
|
|
126
|
-
<FormHelperText error={!isValid}>
|
|
127
|
-
{!isValid ? errors : showDescription ? description : null}
|
|
128
|
-
</FormHelperText>
|
|
129
|
-
</FormControl>
|
|
130
|
-
</Hidden>
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
120
|
+
</div>
|
|
121
|
+
<Slider
|
|
122
|
+
style={sliderStyle}
|
|
123
|
+
min={schema.minimum}
|
|
124
|
+
max={schema.maximum}
|
|
125
|
+
value={Number(data || schema.default)}
|
|
126
|
+
onChange={onChange}
|
|
127
|
+
id={id + '-input'}
|
|
128
|
+
disabled={!enabled}
|
|
129
|
+
step={schema.multipleOf || 1}
|
|
130
|
+
/>
|
|
131
|
+
<FormHelperText error={!isValid}>
|
|
132
|
+
{!isValid ? errors : showDescription ? description : null}
|
|
133
|
+
</FormHelperText>
|
|
134
|
+
</FormControl>
|
|
135
|
+
</Hidden>
|
|
136
|
+
);
|
|
137
|
+
};
|
|
134
138
|
export const materialSliderControlTester: RankedTester = rankWith(
|
|
135
139
|
4,
|
|
136
140
|
isRangeControl
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/*
|
|
2
|
+
The MIT License
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2017-2019 EclipseSource Munich
|
|
5
|
+
https://github.com/eclipsesource/jsonforms
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in
|
|
15
|
+
all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
+
THE SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
import React, { useMemo } from 'react';
|
|
26
|
+
import merge from 'lodash/merge';
|
|
27
|
+
import {
|
|
28
|
+
ControlProps,
|
|
29
|
+
isTimeControl,
|
|
30
|
+
isDescriptionHidden,
|
|
31
|
+
RankedTester,
|
|
32
|
+
rankWith
|
|
33
|
+
} from '@jsonforms/core';
|
|
34
|
+
import { withJsonFormsControlProps } from '@jsonforms/react';
|
|
35
|
+
import { FormHelperText, Hidden, TextField } from '@mui/material';
|
|
36
|
+
import {
|
|
37
|
+
TimePicker,
|
|
38
|
+
LocalizationProvider
|
|
39
|
+
} from '@mui/lab';
|
|
40
|
+
import AdapterDayjs from '@mui/lab/AdapterDayjs';
|
|
41
|
+
import { createOnChangeHandler, getData, useFocus } from '../util';
|
|
42
|
+
|
|
43
|
+
export const MaterialTimeControl = (props: ControlProps) => {
|
|
44
|
+
const [focused, onFocus, onBlur] = useFocus();
|
|
45
|
+
const {
|
|
46
|
+
id,
|
|
47
|
+
description,
|
|
48
|
+
errors,
|
|
49
|
+
label,
|
|
50
|
+
uischema,
|
|
51
|
+
visible,
|
|
52
|
+
enabled,
|
|
53
|
+
required,
|
|
54
|
+
path,
|
|
55
|
+
handleChange,
|
|
56
|
+
data,
|
|
57
|
+
config
|
|
58
|
+
} = props;
|
|
59
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
60
|
+
const isValid = errors.length === 0;
|
|
61
|
+
|
|
62
|
+
const showDescription = !isDescriptionHidden(
|
|
63
|
+
visible,
|
|
64
|
+
description,
|
|
65
|
+
focused,
|
|
66
|
+
appliedUiSchemaOptions.showUnfocusedDescription
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
const format = appliedUiSchemaOptions.timeFormat ?? 'HH:mm';
|
|
70
|
+
const saveFormat = appliedUiSchemaOptions.timeSaveFormat ?? 'HH:mm:ss';
|
|
71
|
+
|
|
72
|
+
const firstFormHelperText = showDescription
|
|
73
|
+
? description
|
|
74
|
+
: !isValid
|
|
75
|
+
? errors
|
|
76
|
+
: null;
|
|
77
|
+
const secondFormHelperText = showDescription && !isValid ? errors : null;
|
|
78
|
+
|
|
79
|
+
const onChange = useMemo(() => createOnChangeHandler(
|
|
80
|
+
path,
|
|
81
|
+
handleChange,
|
|
82
|
+
saveFormat
|
|
83
|
+
),[path, handleChange, saveFormat]);
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<Hidden xsUp={!visible}>
|
|
87
|
+
<LocalizationProvider dateAdapter={AdapterDayjs}>
|
|
88
|
+
<TimePicker
|
|
89
|
+
label={label}
|
|
90
|
+
value={getData(data, saveFormat)}
|
|
91
|
+
clearable
|
|
92
|
+
onChange={onChange}
|
|
93
|
+
inputFormat={format}
|
|
94
|
+
disableMaskedInput
|
|
95
|
+
ampm={!!appliedUiSchemaOptions.ampm}
|
|
96
|
+
views={appliedUiSchemaOptions.views}
|
|
97
|
+
disabled={!enabled}
|
|
98
|
+
cancelText={appliedUiSchemaOptions.cancelLabel}
|
|
99
|
+
clearText={appliedUiSchemaOptions.clearLabel}
|
|
100
|
+
okText={appliedUiSchemaOptions.okLabel}
|
|
101
|
+
renderInput={params => (
|
|
102
|
+
<TextField
|
|
103
|
+
{...params}
|
|
104
|
+
id={id + '-input'}
|
|
105
|
+
required={required && !appliedUiSchemaOptions.hideRequiredAsterisk}
|
|
106
|
+
autoFocus={appliedUiSchemaOptions.focus}
|
|
107
|
+
error={!isValid}
|
|
108
|
+
fullWidth={!appliedUiSchemaOptions.trim}
|
|
109
|
+
inputProps={{ ...params.inputProps, type: 'text' }}
|
|
110
|
+
InputLabelProps={data ? { shrink: true } : undefined}
|
|
111
|
+
onFocus={onFocus}
|
|
112
|
+
onBlur={onBlur}
|
|
113
|
+
variant={'standard'}
|
|
114
|
+
/>
|
|
115
|
+
)}
|
|
116
|
+
/>
|
|
117
|
+
<FormHelperText error={!isValid && !showDescription}>
|
|
118
|
+
{firstFormHelperText}
|
|
119
|
+
</FormHelperText>
|
|
120
|
+
<FormHelperText error={!isValid}>
|
|
121
|
+
{secondFormHelperText}
|
|
122
|
+
</FormHelperText>
|
|
123
|
+
</LocalizationProvider>
|
|
124
|
+
</Hidden>
|
|
125
|
+
);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export const materialTimeControlTester: RankedTester = rankWith(
|
|
129
|
+
4,
|
|
130
|
+
isTimeControl
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
export default withJsonFormsControlProps(MaterialTimeControl);
|
package/src/controls/index.ts
CHANGED
|
@@ -46,6 +46,10 @@ import MaterialDateTimeControl, {
|
|
|
46
46
|
materialDateTimeControlTester,
|
|
47
47
|
MaterialDateTimeControl as MaterialDateTimeControlUnwrapped
|
|
48
48
|
} from './MaterialDateTimeControl';
|
|
49
|
+
import MaterialTimeControl, {
|
|
50
|
+
materialTimeControlTester,
|
|
51
|
+
MaterialTimeControl as MaterialTimeControlUnwrapped
|
|
52
|
+
} from './MaterialTimeControl';
|
|
49
53
|
import MaterialSliderControl, {
|
|
50
54
|
materialSliderControlTester,
|
|
51
55
|
MaterialSliderControl as MaterialSliderControlUnwrapped
|
|
@@ -89,6 +93,7 @@ export const Unwrapped = {
|
|
|
89
93
|
MaterialNativeControl: MaterialNativeControlUnwrapped,
|
|
90
94
|
MaterialDateControl: MaterialDateControlUnwrapped,
|
|
91
95
|
MaterialDateTimeControl: MaterialDateTimeControlUnwrapped,
|
|
96
|
+
MaterialTimeControl: MaterialTimeControlUnwrapped,
|
|
92
97
|
MaterialSliderControl: MaterialSliderControlUnwrapped,
|
|
93
98
|
MaterialRadioGroupControl: MaterialRadioGroupControlUnwrapped,
|
|
94
99
|
MaterialIntegerControl: MaterialIntegerControlUnwrapped,
|
|
@@ -112,6 +117,8 @@ export {
|
|
|
112
117
|
materialDateControlTester,
|
|
113
118
|
MaterialDateTimeControl,
|
|
114
119
|
materialDateTimeControlTester,
|
|
120
|
+
MaterialTimeControl,
|
|
121
|
+
materialTimeControlTester,
|
|
115
122
|
MaterialSliderControl,
|
|
116
123
|
materialSliderControlTester,
|
|
117
124
|
MaterialRadioGroupControl,
|
package/src/index.ts
CHANGED
|
@@ -57,6 +57,8 @@ import {
|
|
|
57
57
|
materialDateControlTester,
|
|
58
58
|
MaterialDateTimeControl,
|
|
59
59
|
materialDateTimeControlTester,
|
|
60
|
+
MaterialTimeControl,
|
|
61
|
+
materialTimeControlTester,
|
|
60
62
|
MaterialEnumControl,
|
|
61
63
|
materialEnumControlTester,
|
|
62
64
|
MaterialIntegerControl,
|
|
@@ -136,6 +138,7 @@ export const materialRenderers: JsonFormsRendererRegistryEntry[] = [
|
|
|
136
138
|
{ tester: materialTextControlTester, renderer: MaterialTextControl },
|
|
137
139
|
{ tester: materialDateTimeControlTester, renderer: MaterialDateTimeControl },
|
|
138
140
|
{ tester: materialDateControlTester, renderer: MaterialDateControl },
|
|
141
|
+
{ tester: materialTimeControlTester, renderer: MaterialTimeControl },
|
|
139
142
|
{ tester: materialSliderControlTester, renderer: MaterialSliderControl },
|
|
140
143
|
{ tester: materialObjectControlTester, renderer: MaterialObjectRenderer },
|
|
141
144
|
{ tester: materialAllOfControlTester, renderer: MaterialAllOfRenderer },
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import {
|
|
2
|
+
Grid,
|
|
3
|
+
IconButton,
|
|
4
|
+
Hidden,
|
|
5
|
+
Toolbar,
|
|
6
|
+
Tooltip,
|
|
7
|
+
Typography
|
|
8
|
+
} from '@mui/material';
|
|
9
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
6
10
|
import React from 'react';
|
|
7
11
|
import ValidationIcon from '../complex/ValidationIcon';
|
|
8
12
|
export interface ArrayLayoutToolbarProps {
|
|
@@ -22,7 +26,7 @@ export const ArrayLayoutToolbar = React.memo(
|
|
|
22
26
|
}: ArrayLayoutToolbarProps) => {
|
|
23
27
|
return (
|
|
24
28
|
<Toolbar disableGutters={true}>
|
|
25
|
-
<Grid container alignItems='center'
|
|
29
|
+
<Grid container alignItems='center' justifyContent='space-between'>
|
|
26
30
|
<Grid item>
|
|
27
31
|
<Typography variant={'h6'}>{label}</Typography>
|
|
28
32
|
</Grid>
|
|
@@ -42,7 +46,7 @@ export const ArrayLayoutToolbar = React.memo(
|
|
|
42
46
|
<IconButton
|
|
43
47
|
aria-label={`Add to ${label}`}
|
|
44
48
|
onClick={addItem(path, createDefault())}
|
|
45
|
-
|
|
49
|
+
size='large'>
|
|
46
50
|
<AddIcon />
|
|
47
51
|
</IconButton>
|
|
48
52
|
</Tooltip>
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import merge from 'lodash/merge';
|
|
2
2
|
import get from 'lodash/get';
|
|
3
|
-
import React, { Dispatch, Fragment, ReducerAction, useMemo, useState } from 'react';
|
|
4
|
-
import { ComponentType } from 'enzyme';
|
|
3
|
+
import React, { ComponentType, Dispatch, Fragment, ReducerAction, useMemo, useState, useEffect, useCallback } from 'react';
|
|
5
4
|
import {
|
|
6
|
-
areEqual,
|
|
7
5
|
JsonFormsDispatch,
|
|
8
6
|
JsonFormsStateContext,
|
|
9
7
|
withJsonFormsContext
|
|
@@ -20,19 +18,22 @@ import {
|
|
|
20
18
|
update,
|
|
21
19
|
JsonFormsCellRendererRegistryEntry,
|
|
22
20
|
JsonFormsUISchemaRegistryEntry,
|
|
23
|
-
getFirstPrimitiveProp
|
|
21
|
+
getFirstPrimitiveProp,
|
|
22
|
+
createId,
|
|
23
|
+
removeId
|
|
24
24
|
} from '@jsonforms/core';
|
|
25
|
-
import
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
25
|
+
import {
|
|
26
|
+
Accordion,
|
|
27
|
+
AccordionSummary,
|
|
28
|
+
AccordionDetails,
|
|
29
|
+
Avatar,
|
|
30
|
+
Grid,
|
|
31
|
+
IconButton
|
|
32
|
+
} from '@mui/material';
|
|
33
|
+
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
34
|
+
import DeleteIcon from '@mui/icons-material/Delete';
|
|
35
|
+
import ArrowUpward from '@mui/icons-material/ArrowUpward';
|
|
36
|
+
import ArrowDownward from '@mui/icons-material/ArrowDownward';
|
|
36
37
|
|
|
37
38
|
const iconStyle: any = { float: 'right' };
|
|
38
39
|
|
|
@@ -73,8 +74,14 @@ export interface ExpandPanelProps
|
|
|
73
74
|
extends StatePropsOfExpandPanel,
|
|
74
75
|
DispatchPropsOfExpandPanel {}
|
|
75
76
|
|
|
76
|
-
const
|
|
77
|
-
const [labelHtmlId] = useState(
|
|
77
|
+
const ExpandPanelRendererComponent = (props: ExpandPanelProps) => {
|
|
78
|
+
const [labelHtmlId] = useState<string>(createId('expand-panel'));
|
|
79
|
+
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
return () => {
|
|
82
|
+
removeId(labelHtmlId);
|
|
83
|
+
};
|
|
84
|
+
}, [labelHtmlId]);
|
|
78
85
|
|
|
79
86
|
const {
|
|
80
87
|
childLabel,
|
|
@@ -114,12 +121,12 @@ const ExpandPanelRenderer = (props: ExpandPanelProps) => {
|
|
|
114
121
|
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
115
122
|
|
|
116
123
|
return (
|
|
117
|
-
<
|
|
124
|
+
<Accordion
|
|
118
125
|
aria-labelledby={labelHtmlId}
|
|
119
126
|
expanded={expanded}
|
|
120
127
|
onChange={handleExpansion(childPath)}
|
|
121
128
|
>
|
|
122
|
-
<
|
|
129
|
+
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
|
|
123
130
|
<Grid container alignItems={'center'}>
|
|
124
131
|
<Grid item xs={7} md={9}>
|
|
125
132
|
<Grid container alignItems={'center'}>
|
|
@@ -132,12 +139,12 @@ const ExpandPanelRenderer = (props: ExpandPanelProps) => {
|
|
|
132
139
|
</Grid>
|
|
133
140
|
</Grid>
|
|
134
141
|
<Grid item xs={5} md={3}>
|
|
135
|
-
<Grid container
|
|
142
|
+
<Grid container justifyContent='flex-end'>
|
|
136
143
|
<Grid item>
|
|
137
144
|
<Grid
|
|
138
145
|
container
|
|
139
146
|
direction='row'
|
|
140
|
-
|
|
147
|
+
justifyContent='center'
|
|
141
148
|
alignItems='center'
|
|
142
149
|
>
|
|
143
150
|
{appliedUiSchemaOptions.showSortButtons ? (
|
|
@@ -148,7 +155,7 @@ const ExpandPanelRenderer = (props: ExpandPanelProps) => {
|
|
|
148
155
|
style={iconStyle}
|
|
149
156
|
disabled={!enableMoveUp}
|
|
150
157
|
aria-label={`Move up`}
|
|
151
|
-
|
|
158
|
+
size='large'>
|
|
152
159
|
<ArrowUpward />
|
|
153
160
|
</IconButton>
|
|
154
161
|
</Grid>
|
|
@@ -158,7 +165,7 @@ const ExpandPanelRenderer = (props: ExpandPanelProps) => {
|
|
|
158
165
|
style={iconStyle}
|
|
159
166
|
disabled={!enableMoveDown}
|
|
160
167
|
aria-label={`Move down`}
|
|
161
|
-
|
|
168
|
+
size='large'>
|
|
162
169
|
<ArrowDownward />
|
|
163
170
|
</IconButton>
|
|
164
171
|
</Grid>
|
|
@@ -171,7 +178,7 @@ const ExpandPanelRenderer = (props: ExpandPanelProps) => {
|
|
|
171
178
|
onClick={removeItems(path, [index])}
|
|
172
179
|
style={iconStyle}
|
|
173
180
|
aria-label={`Delete`}
|
|
174
|
-
|
|
181
|
+
size='large'>
|
|
175
182
|
<DeleteIcon />
|
|
176
183
|
</IconButton>
|
|
177
184
|
</Grid>
|
|
@@ -180,8 +187,8 @@ const ExpandPanelRenderer = (props: ExpandPanelProps) => {
|
|
|
180
187
|
</Grid>
|
|
181
188
|
</Grid>
|
|
182
189
|
</Grid>
|
|
183
|
-
</
|
|
184
|
-
<
|
|
190
|
+
</AccordionSummary>
|
|
191
|
+
<AccordionDetails>
|
|
185
192
|
<JsonFormsDispatch
|
|
186
193
|
schema={schema}
|
|
187
194
|
uischema={foundUISchema}
|
|
@@ -190,11 +197,13 @@ const ExpandPanelRenderer = (props: ExpandPanelProps) => {
|
|
|
190
197
|
renderers={renderers}
|
|
191
198
|
cells={cells}
|
|
192
199
|
/>
|
|
193
|
-
</
|
|
194
|
-
</
|
|
200
|
+
</AccordionDetails>
|
|
201
|
+
</Accordion>
|
|
195
202
|
);
|
|
196
203
|
};
|
|
197
204
|
|
|
205
|
+
const ExpandPanelRenderer = React.memo(ExpandPanelRendererComponent);
|
|
206
|
+
|
|
198
207
|
/**
|
|
199
208
|
* Maps state to dispatch properties of an expand pandel control.
|
|
200
209
|
*
|
|
@@ -204,7 +213,7 @@ const ExpandPanelRenderer = (props: ExpandPanelProps) => {
|
|
|
204
213
|
export const ctxDispatchToExpandPanelProps: (
|
|
205
214
|
dispatch: Dispatch<ReducerAction<any>>
|
|
206
215
|
) => DispatchPropsOfExpandPanel = dispatch => ({
|
|
207
|
-
removeItems: (path: string, toDelete: number[]) => (event: any): void => {
|
|
216
|
+
removeItems: useCallback((path: string, toDelete: number[]) => (event: any): void => {
|
|
208
217
|
event.stopPropagation();
|
|
209
218
|
dispatch(
|
|
210
219
|
update(path, array => {
|
|
@@ -215,8 +224,8 @@ export const ctxDispatchToExpandPanelProps: (
|
|
|
215
224
|
return array;
|
|
216
225
|
})
|
|
217
226
|
);
|
|
218
|
-
},
|
|
219
|
-
moveUp: (path: string, toMove: number) => (event: any): void => {
|
|
227
|
+
}, [dispatch]),
|
|
228
|
+
moveUp: useCallback((path: string, toMove: number) => (event: any): void => {
|
|
220
229
|
event.stopPropagation();
|
|
221
230
|
dispatch(
|
|
222
231
|
update(path, array => {
|
|
@@ -224,8 +233,8 @@ export const ctxDispatchToExpandPanelProps: (
|
|
|
224
233
|
return array;
|
|
225
234
|
})
|
|
226
235
|
);
|
|
227
|
-
},
|
|
228
|
-
moveDown: (path: string, toMove: number) => (event: any): void => {
|
|
236
|
+
}, [dispatch]),
|
|
237
|
+
moveDown: useCallback((path: string, toMove: number) => (event: any): void => {
|
|
229
238
|
event.stopPropagation();
|
|
230
239
|
dispatch(
|
|
231
240
|
update(path, array => {
|
|
@@ -233,7 +242,7 @@ export const ctxDispatchToExpandPanelProps: (
|
|
|
233
242
|
return array;
|
|
234
243
|
})
|
|
235
244
|
);
|
|
236
|
-
}
|
|
245
|
+
}, [dispatch])
|
|
237
246
|
});
|
|
238
247
|
|
|
239
248
|
/**
|
|
@@ -271,13 +280,6 @@ export const withJsonFormsExpandPanelProps = (
|
|
|
271
280
|
Component: ComponentType<ExpandPanelProps>
|
|
272
281
|
): ComponentType<OwnPropsOfExpandPanel> =>
|
|
273
282
|
withJsonFormsContext(
|
|
274
|
-
withContextToExpandPanelProps(
|
|
275
|
-
React.memo(
|
|
276
|
-
Component,
|
|
277
|
-
(prevProps: ExpandPanelProps, nextProps: ExpandPanelProps) =>
|
|
278
|
-
areEqual(prevProps, nextProps)
|
|
279
|
-
)
|
|
280
|
-
)
|
|
281
|
-
);
|
|
283
|
+
withContextToExpandPanelProps(Component));
|
|
282
284
|
|
|
283
285
|
export default withJsonFormsExpandPanelProps(ExpandPanelRenderer);
|