@jsonforms/material-renderers 3.0.0-alpha.3 → 3.0.0-beta.2
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/globals.html +50 -185
- package/docs/index.html +0 -18
- package/docs/interfaces/emptytableprops.html +1 -1
- package/docs/interfaces/nonemptycellcomponentprops.html +9 -9
- package/docs/interfaces/nonemptycellprops.html +9 -9
- package/docs/interfaces/ownoneofprops.html +1 -1
- package/docs/interfaces/ownpropsofnonemptycell.html +6 -6
- package/docs/interfaces/tableheadercellprops.html +1 -1
- package/docs/interfaces/withoptionlabel.html +3 -3
- package/example/index.ts +2 -3
- 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 -6
- package/lib/complex/MaterialAnyOfRenderer.d.ts +6 -6
- package/lib/complex/MaterialArrayControlRenderer.d.ts +5 -5
- package/lib/complex/MaterialEnumArrayRenderer.d.ts +6 -6
- package/lib/complex/MaterialObjectRenderer.d.ts +6 -6
- package/lib/complex/MaterialOneOfRenderer.d.ts +9 -9
- package/lib/complex/MaterialTableControl.d.ts +25 -25
- package/lib/complex/NoBorderTableCell.d.ts +3 -3
- package/lib/complex/TableToolbar.d.ts +15 -15
- package/lib/complex/ValidationIcon.d.ts +7 -7
- 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 -6
- package/lib/controls/MaterialDateTimeControl.d.ts +6 -6
- package/lib/controls/MaterialEnumControl.d.ts +7 -6
- package/lib/controls/MaterialInputControl.d.ts +6 -6
- package/lib/controls/MaterialIntegerControl.d.ts +6 -6
- package/lib/controls/MaterialNativeControl.d.ts +6 -6
- 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 -3
- package/lib/controls/MaterialRadioGroupControl.d.ts +6 -6
- package/lib/controls/MaterialSliderControl.d.ts +6 -6
- package/lib/controls/MaterialTextControl.d.ts +6 -6
- package/lib/controls/MaterialTimeControl.d.ts +6 -6
- package/lib/controls/index.d.ts +35 -35
- package/lib/index.d.ts +9 -9
- package/lib/jsonforms-react-material.cjs.js +1480 -0
- package/lib/jsonforms-react-material.cjs.js.map +1 -0
- package/lib/jsonforms-react-material.esm.js +1212 -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 -3
- package/lib/layouts/MaterialArrayLayoutRenderer.d.ts +6 -6
- package/lib/layouts/MaterialCategorizationLayout.d.ts +17 -17
- package/lib/layouts/MaterialCategorizationStepperLayout.d.ts +13 -13
- 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/{extended → mui-controls}/MuiAutocomplete.d.ts +9 -9
- 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 -1
- package/lib/util/focus.d.ts +1 -1
- package/lib/util/index.d.ts +5 -5
- package/lib/util/layout.d.ts +15 -14
- package/lib/util/theme.d.ts +10 -10
- package/package.json +22 -11
- package/rollup.config.js +51 -0
- package/src/complex/CombinatorProperties.tsx +2 -2
- package/src/complex/MaterialAllOfRenderer.tsx +3 -5
- package/src/complex/MaterialAnyOfRenderer.tsx +3 -5
- package/src/complex/MaterialEnumArrayRenderer.tsx +2 -3
- package/src/complex/MaterialObjectRenderer.tsx +3 -8
- package/src/complex/MaterialOneOfRenderer.tsx +3 -5
- package/src/complex/MaterialTableControl.tsx +5 -5
- package/src/controls/MaterialEnumControl.tsx +12 -3
- package/src/controls/MaterialOneOfEnumControl.tsx +13 -4
- package/src/{extended → mui-controls}/MuiAutocomplete.tsx +0 -0
- package/src/util/debounce.ts +1 -1
- package/src/util/layout.tsx +1 -1
- package/stats.html +3279 -0
- package/test/renderers/MaterialAnyOfStringOrEnumControl.test.tsx +7 -7
- package/test/renderers/MaterialArrayLayout.test.tsx +65 -31
- package/test/renderers/MaterialBooleanCell.test.tsx +10 -7
- package/test/renderers/MaterialBooleanToggleCell.test.tsx +14 -9
- package/test/renderers/MaterialBooleanToggleControl.test.tsx +14 -9
- package/test/renderers/MaterialCategorizationLayout.test.tsx +14 -14
- package/test/renderers/MaterialCategorizationStepperLayout.test.tsx +18 -18
- package/test/renderers/MaterialDateCell.test.tsx +10 -7
- package/test/renderers/MaterialDateControl.test.tsx +12 -8
- package/test/renderers/MaterialDateTimeControl.test.tsx +12 -8
- package/test/renderers/MaterialEnumArrayRenderer.test.tsx +23 -13
- package/test/renderers/MaterialEnumCell.test.tsx +2 -1
- package/test/renderers/MaterialEnumControl.test.tsx +75 -0
- package/test/renderers/MaterialIntegerCell.test.tsx +10 -7
- package/test/renderers/MaterialLabelRenderer.test.tsx +4 -4
- package/test/renderers/MaterialListWithDetailRenderer.test.tsx +5 -5
- package/test/renderers/MaterialNumberCell.test.tsx +10 -7
- package/test/renderers/MaterialObjectControl.test.tsx +10 -7
- package/test/renderers/MaterialOneOfEnumCell.test.tsx +2 -1
- package/test/renderers/MaterialOneOfRadioGroupControl.test.tsx +3 -2
- package/test/renderers/MaterialOneOfRenderer.test.tsx +12 -7
- package/test/renderers/MaterialRadioGroupControl.test.tsx +2 -2
- package/test/renderers/MaterialSliderControl.test.tsx +20 -12
- package/test/renderers/MaterialTextCell.test.tsx +10 -7
- package/test/renderers/MaterialTimeCell.test.tsx +10 -7
- package/test/renderers/MaterialTimeControl.test.tsx +12 -8
- package/tsconfig.json +1 -2
- package/tsconfig.test.json +7 -0
- package/lib/additional/ListWithDetailMasterItem.js +0 -19
- package/lib/additional/ListWithDetailMasterItem.js.map +0 -1
- package/lib/additional/MaterialLabelRenderer.js +0 -49
- package/lib/additional/MaterialLabelRenderer.js.map +0 -1
- package/lib/additional/MaterialListWithDetailRenderer.js +0 -66
- package/lib/additional/MaterialListWithDetailRenderer.js.map +0 -1
- package/lib/additional/index.js +0 -35
- package/lib/additional/index.js.map +0 -1
- package/lib/cells/CustomizableCells.js +0 -46
- package/lib/cells/CustomizableCells.js.map +0 -1
- package/lib/cells/MaterialBooleanCell.js +0 -39
- package/lib/cells/MaterialBooleanCell.js.map +0 -1
- package/lib/cells/MaterialBooleanToggleCell.js +0 -40
- package/lib/cells/MaterialBooleanToggleCell.js.map +0 -1
- package/lib/cells/MaterialDateCell.js +0 -42
- package/lib/cells/MaterialDateCell.js.map +0 -1
- package/lib/cells/MaterialEnumCell.js +0 -41
- package/lib/cells/MaterialEnumCell.js.map +0 -1
- package/lib/cells/MaterialIntegerCell.js +0 -37
- package/lib/cells/MaterialIntegerCell.js.map +0 -1
- package/lib/cells/MaterialNumberCell.js +0 -41
- package/lib/cells/MaterialNumberCell.js.map +0 -1
- package/lib/cells/MaterialNumberFormatCell.js +0 -41
- package/lib/cells/MaterialNumberFormatCell.js.map +0 -1
- package/lib/cells/MaterialOneOfEnumCell.js +0 -41
- package/lib/cells/MaterialOneOfEnumCell.js.map +0 -1
- package/lib/cells/MaterialTextCell.js +0 -41
- package/lib/cells/MaterialTextCell.js.map +0 -1
- package/lib/cells/MaterialTimeCell.js +0 -37
- package/lib/cells/MaterialTimeCell.js.map +0 -1
- package/lib/cells/index.js +0 -61
- package/lib/cells/index.js.map +0 -1
- package/lib/complex/CombinatorProperties.js +0 -59
- 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 -47
- package/lib/complex/MaterialAllOfRenderer.js.map +0 -1
- package/lib/complex/MaterialAnyOfRenderer.js +0 -51
- package/lib/complex/MaterialAnyOfRenderer.js.map +0 -1
- package/lib/complex/MaterialArrayControlRenderer.js +0 -57
- package/lib/complex/MaterialArrayControlRenderer.js.map +0 -1
- package/lib/complex/MaterialEnumArrayRenderer.js +0 -48
- package/lib/complex/MaterialEnumArrayRenderer.js.map +0 -1
- package/lib/complex/MaterialObjectRenderer.js +0 -51
- package/lib/complex/MaterialObjectRenderer.js.map +0 -1
- package/lib/complex/MaterialOneOfRenderer.js +0 -78
- package/lib/complex/MaterialOneOfRenderer.js.map +0 -1
- package/lib/complex/MaterialTableControl.js +0 -197
- package/lib/complex/MaterialTableControl.js.map +0 -1
- package/lib/complex/NoBorderTableCell.js +0 -39
- package/lib/complex/NoBorderTableCell.js.map +0 -1
- package/lib/complex/TableToolbar.js +0 -56
- package/lib/complex/TableToolbar.js.map +0 -1
- package/lib/complex/ValidationIcon.js +0 -44
- package/lib/complex/ValidationIcon.js.map +0 -1
- package/lib/complex/index.js +0 -48
- package/lib/complex/index.js.map +0 -1
- package/lib/controls/MaterialAnyOfStringOrEnumControl.js +0 -85
- package/lib/controls/MaterialAnyOfStringOrEnumControl.js.map +0 -1
- package/lib/controls/MaterialBooleanControl.js +0 -43
- package/lib/controls/MaterialBooleanControl.js.map +0 -1
- package/lib/controls/MaterialBooleanToggleControl.js +0 -43
- package/lib/controls/MaterialBooleanToggleControl.js.map +0 -1
- package/lib/controls/MaterialDateControl.js +0 -62
- package/lib/controls/MaterialDateControl.js.map +0 -1
- package/lib/controls/MaterialDateTimeControl.js +0 -62
- package/lib/controls/MaterialDateTimeControl.js.map +0 -1
- package/lib/controls/MaterialEnumControl.js +0 -38
- package/lib/controls/MaterialEnumControl.js.map +0 -1
- package/lib/controls/MaterialInputControl.js +0 -56
- package/lib/controls/MaterialInputControl.js.map +0 -1
- package/lib/controls/MaterialIntegerControl.js +0 -38
- package/lib/controls/MaterialIntegerControl.js.map +0 -1
- package/lib/controls/MaterialNativeControl.js +0 -50
- package/lib/controls/MaterialNativeControl.js.map +0 -1
- package/lib/controls/MaterialNumberControl.js +0 -38
- package/lib/controls/MaterialNumberControl.js.map +0 -1
- package/lib/controls/MaterialOneOfEnumControl.js +0 -38
- package/lib/controls/MaterialOneOfEnumControl.js.map +0 -1
- package/lib/controls/MaterialOneOfRadioGroupControl.js +0 -39
- package/lib/controls/MaterialOneOfRadioGroupControl.js.map +0 -1
- package/lib/controls/MaterialRadioGroup.js +0 -48
- package/lib/controls/MaterialRadioGroup.js.map +0 -1
- package/lib/controls/MaterialRadioGroupControl.js +0 -39
- package/lib/controls/MaterialRadioGroupControl.js.map +0 -1
- package/lib/controls/MaterialSliderControl.js +0 -70
- package/lib/controls/MaterialSliderControl.js.map +0 -1
- package/lib/controls/MaterialTextControl.js +0 -38
- package/lib/controls/MaterialTextControl.js.map +0 -1
- package/lib/controls/MaterialTimeControl.js +0 -62
- package/lib/controls/MaterialTimeControl.js.map +0 -1
- package/lib/controls/index.js +0 -92
- package/lib/controls/index.js.map +0 -1
- package/lib/extended/MaterialAutocompleteEnumControl.d.ts +0 -7
- package/lib/extended/MaterialAutocompleteEnumControl.js +0 -44
- package/lib/extended/MaterialAutocompleteEnumControl.js.map +0 -1
- package/lib/extended/MaterialAutocompleteOneOfEnumControl.d.ts +0 -7
- package/lib/extended/MaterialAutocompleteOneOfEnumControl.js +0 -44
- package/lib/extended/MaterialAutocompleteOneOfEnumControl.js.map +0 -1
- 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 -49
- package/lib/extended/index.js.map +0 -1
- package/lib/index.js +0 -90
- package/lib/index.js.map +0 -1
- package/lib/jsonforms-material.js +0 -291
- package/lib/jsonforms-material.js.map +0 -1
- package/lib/layouts/ArrayToolbar.js +0 -25
- package/lib/layouts/ArrayToolbar.js.map +0 -1
- package/lib/layouts/ExpandPanelRenderer.js +0 -111
- package/lib/layouts/ExpandPanelRenderer.js.map +0 -1
- package/lib/layouts/MaterialArrayLayout.js +0 -54
- package/lib/layouts/MaterialArrayLayout.js.map +0 -1
- package/lib/layouts/MaterialArrayLayoutRenderer.js +0 -45
- package/lib/layouts/MaterialArrayLayoutRenderer.js.map +0 -1
- package/lib/layouts/MaterialCategorizationLayout.js +0 -71
- package/lib/layouts/MaterialCategorizationLayout.js.map +0 -1
- package/lib/layouts/MaterialCategorizationStepperLayout.js +0 -78
- package/lib/layouts/MaterialCategorizationStepperLayout.js.map +0 -1
- package/lib/layouts/MaterialGroupLayout.js +0 -54
- package/lib/layouts/MaterialGroupLayout.js.map +0 -1
- package/lib/layouts/MaterialHorizontalLayout.js +0 -53
- package/lib/layouts/MaterialHorizontalLayout.js.map +0 -1
- package/lib/layouts/MaterialVerticalLayout.js +0 -53
- package/lib/layouts/MaterialVerticalLayout.js.map +0 -1
- package/lib/layouts/index.js +0 -44
- 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 -44
- package/lib/mui-controls/MuiInputInteger.js.map +0 -1
- package/lib/mui-controls/MuiInputNumber.js +0 -44
- package/lib/mui-controls/MuiInputNumber.js.map +0 -1
- package/lib/mui-controls/MuiInputNumberFormat.js +0 -49
- package/lib/mui-controls/MuiInputNumberFormat.js.map +0 -1
- package/lib/mui-controls/MuiInputText.js +0 -68
- package/lib/mui-controls/MuiInputText.js.map +0 -1
- package/lib/mui-controls/MuiInputTime.js +0 -39
- package/lib/mui-controls/MuiInputTime.js.map +0 -1
- package/lib/mui-controls/MuiSelect.js +0 -37
- 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 -29
- package/lib/util/datejs.js.map +0 -1
- package/lib/util/debounce.js +0 -48
- package/lib/util/debounce.js.map +0 -1
- package/lib/util/focus.js +0 -36
- package/lib/util/focus.js.map +0 -1
- package/lib/util/index.js +0 -33
- package/lib/util/index.js.map +0 -1
- package/lib/util/layout.js +0 -58
- 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
|
@@ -0,0 +1,1212 @@
|
|
|
1
|
+
import { createDefaultValue, Resolve, encode, Paths, formatErrorMessage, errorsAt, rankWith, isObjectControl, findUISchema, Generate, isAllOfControl, findMatchingUISchema, createCombinatorRenderInfos, isAnyOfControl, isOneOfControl, getAjv, and, uiTypeIs, schemaMatches, hasType, schemaSubPathMatches, or, isObjectArrayControl, isPrimitiveArrayControl, isObjectArray, computeLabel, composePaths, isBooleanControl, optionIs, isDescriptionHidden, showAsRequired, isEnumControl, isDateControl, isTimeControl, isDateTimeControl, isRangeControl, isIntegerControl, isNumberControl, isStringControl, isOneOfEnumControl, withIncreasedRank, isVisible, update, moveUp, moveDown, getFirstPrimitiveProp, createId, removeId, isObjectArrayWithNesting, isNumberFormatControl, categorizationHasCategory } from '@jsonforms/core';
|
|
2
|
+
import React, { useMemo, Fragment, useState, useCallback, useEffect } from 'react';
|
|
3
|
+
import { DispatchCell, useJsonForms, withJsonFormsArrayLayoutProps, withJsonFormsDetailProps, JsonFormsDispatch, withJsonFormsAllOfProps, withJsonFormsAnyOfProps, withJsonFormsOneOfProps, withJsonFormsMultiEnumProps, withJsonFormsLayoutProps, withJsonFormsMasterListItemProps, withJsonFormsControlProps, withJsonFormsEnumProps, Control, withJsonFormsOneOfEnumProps, withJsonFormsContext, withJsonFormsCellProps, withJsonFormsEnumCellProps, withJsonFormsOneOfEnumCellProps } from '@jsonforms/react';
|
|
4
|
+
import isEmpty from 'lodash/isEmpty';
|
|
5
|
+
import union from 'lodash/union';
|
|
6
|
+
import startCase from 'lodash/startCase';
|
|
7
|
+
import range from 'lodash/range';
|
|
8
|
+
import { TableCell, styled as styled$1, Badge, Tooltip, TableRow, Grid, Typography, Hidden, IconButton, FormHelperText, Table, TableHead, TableBody, Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions, Button, Tabs, Tab, Checkbox, Select, MenuItem, Input, useTheme, InputAdornment, FormControl, FormGroup, FormControlLabel, Toolbar, ListItem, ListItemAvatar, Avatar, ListItemText, ListItemSecondaryAction, List, Switch, InputLabel, Autocomplete, TextField, FormLabel, Slider, RadioGroup, Radio, Card, CardHeader, CardContent, AppBar, Accordion, AccordionSummary, AccordionDetails, Stepper, Step, StepButton } from '@mui/material';
|
|
9
|
+
import DeleteIcon from '@mui/icons-material/Delete';
|
|
10
|
+
import ArrowDownward from '@mui/icons-material/ArrowDownward';
|
|
11
|
+
import ArrowUpward from '@mui/icons-material/ArrowUpward';
|
|
12
|
+
import { styled } from '@mui/material/styles';
|
|
13
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
14
|
+
import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
|
|
15
|
+
import merge from 'lodash/merge';
|
|
16
|
+
import omit from 'lodash/omit';
|
|
17
|
+
import dayjs from 'dayjs';
|
|
18
|
+
import customParsing from 'dayjs/plugin/customParseFormat';
|
|
19
|
+
import debounce from 'lodash/debounce';
|
|
20
|
+
import Close from '@mui/icons-material/Close';
|
|
21
|
+
import map from 'lodash/map';
|
|
22
|
+
import { LocalizationProvider, DatePicker, DateTimePicker, TimePicker } from '@mui/lab';
|
|
23
|
+
import AdapterDayjs from '@mui/lab/AdapterDayjs';
|
|
24
|
+
import get from 'lodash/get';
|
|
25
|
+
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
26
|
+
import Input$1 from '@mui/material/Input';
|
|
27
|
+
|
|
28
|
+
const StyledTableCell = styled(TableCell)({
|
|
29
|
+
borderBottom: 'none'
|
|
30
|
+
});
|
|
31
|
+
const NoBorderTableCell = ({ children, ...otherProps }) => (React.createElement(StyledTableCell, Object.assign({}, otherProps), children));
|
|
32
|
+
|
|
33
|
+
const StyledBadge = styled$1(Badge)(({ theme }) => ({
|
|
34
|
+
color: theme.palette.error.main
|
|
35
|
+
}));
|
|
36
|
+
const ValidationIcon = ({ errorMessages, id }) => {
|
|
37
|
+
return (React.createElement(Tooltip, { id: id, title: errorMessages },
|
|
38
|
+
React.createElement(StyledBadge, { badgeContent: errorMessages.split('\n').length },
|
|
39
|
+
React.createElement(ErrorOutlineIcon, { color: 'inherit' }))));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const fixedCellSmall = {
|
|
43
|
+
paddingLeft: 0,
|
|
44
|
+
paddingRight: 0,
|
|
45
|
+
};
|
|
46
|
+
const TableToolbar = React.memo(({ numColumns, errors, label, path, addItem, schema, enabled }) => (React.createElement(TableRow, null,
|
|
47
|
+
React.createElement(NoBorderTableCell, { colSpan: numColumns },
|
|
48
|
+
React.createElement(Grid, { container: true, justifyContent: 'flex-start', alignItems: 'center', spacing: 2 },
|
|
49
|
+
React.createElement(Grid, { item: true },
|
|
50
|
+
React.createElement(Typography, { variant: 'h6' }, label)),
|
|
51
|
+
React.createElement(Grid, { item: true },
|
|
52
|
+
React.createElement(Hidden, { smUp: errors.length === 0 },
|
|
53
|
+
React.createElement(Grid, { item: true },
|
|
54
|
+
React.createElement(ValidationIcon, { id: 'tooltip-validation', errorMessages: errors })))))),
|
|
55
|
+
enabled ? (React.createElement(NoBorderTableCell, { align: 'right', style: fixedCellSmall },
|
|
56
|
+
React.createElement(Tooltip, { id: 'tooltip-add', title: `Add to ${label}`, placement: 'bottom' },
|
|
57
|
+
React.createElement(IconButton, { "aria-label": `Add to ${label}`, onClick: addItem(path, createDefaultValue(schema)), size: 'large' },
|
|
58
|
+
React.createElement(AddIcon, null))))) : null)));
|
|
59
|
+
|
|
60
|
+
const styles = {
|
|
61
|
+
fixedCell: {
|
|
62
|
+
width: '150px',
|
|
63
|
+
height: '50px',
|
|
64
|
+
paddingLeft: 0,
|
|
65
|
+
paddingRight: 0,
|
|
66
|
+
textAlign: 'center'
|
|
67
|
+
},
|
|
68
|
+
fixedCellSmall: {
|
|
69
|
+
width: '50px',
|
|
70
|
+
height: '50px',
|
|
71
|
+
paddingLeft: 0,
|
|
72
|
+
paddingRight: 0,
|
|
73
|
+
textAlign: 'center'
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
const generateCells = (Cell, schema, rowPath, enabled, cells) => {
|
|
77
|
+
if (schema.type === 'object') {
|
|
78
|
+
return getValidColumnProps(schema).map(prop => {
|
|
79
|
+
const cellPath = Paths.compose(rowPath, prop);
|
|
80
|
+
const props = {
|
|
81
|
+
propName: prop,
|
|
82
|
+
schema,
|
|
83
|
+
title: schema.properties?.[prop]?.title ?? startCase(prop),
|
|
84
|
+
rowPath,
|
|
85
|
+
cellPath,
|
|
86
|
+
enabled,
|
|
87
|
+
cells
|
|
88
|
+
};
|
|
89
|
+
return React.createElement(Cell, Object.assign({ key: cellPath }, props));
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
const props = {
|
|
94
|
+
schema,
|
|
95
|
+
rowPath,
|
|
96
|
+
cellPath: rowPath,
|
|
97
|
+
enabled
|
|
98
|
+
};
|
|
99
|
+
return React.createElement(Cell, Object.assign({ key: rowPath }, props));
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const getValidColumnProps = (scopedSchema) => {
|
|
103
|
+
if (scopedSchema.type === 'object' && typeof scopedSchema.properties === 'object') {
|
|
104
|
+
return Object.keys(scopedSchema.properties).filter(prop => scopedSchema.properties[prop].type !== 'array');
|
|
105
|
+
}
|
|
106
|
+
return [''];
|
|
107
|
+
};
|
|
108
|
+
const EmptyTable = ({ numColumns }) => (React.createElement(TableRow, null,
|
|
109
|
+
React.createElement(NoBorderTableCell, { colSpan: numColumns },
|
|
110
|
+
React.createElement(Typography, { align: 'center' }, "No data"))));
|
|
111
|
+
const TableHeaderCell = React.memo(({ title }) => (React.createElement(TableCell, null, title)));
|
|
112
|
+
const ctxToNonEmptyCellProps = (ctx, ownProps) => {
|
|
113
|
+
const path = ownProps.rowPath +
|
|
114
|
+
(ownProps.schema.type === 'object' ? '.' + ownProps.propName : '');
|
|
115
|
+
const errors = formatErrorMessage(union(errorsAt(path, ownProps.schema, p => p === path)(ctx.core.errors).map((error) => error.message)));
|
|
116
|
+
return {
|
|
117
|
+
rowPath: ownProps.rowPath,
|
|
118
|
+
propName: ownProps.propName,
|
|
119
|
+
schema: ownProps.schema,
|
|
120
|
+
rootSchema: ctx.core.schema,
|
|
121
|
+
errors,
|
|
122
|
+
path,
|
|
123
|
+
enabled: ownProps.enabled,
|
|
124
|
+
cells: ownProps.cells || ctx.cells,
|
|
125
|
+
renderers: ownProps.renderers || ctx.renderers
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
const controlWithoutLabel = (scope) => ({
|
|
129
|
+
type: 'Control',
|
|
130
|
+
scope: scope,
|
|
131
|
+
label: false
|
|
132
|
+
});
|
|
133
|
+
const NonEmptyCellComponent = React.memo(({ path, propName, schema, rootSchema, errors, enabled, renderers, cells, isValid }) => {
|
|
134
|
+
return (React.createElement(NoBorderTableCell, null,
|
|
135
|
+
schema.properties ? (React.createElement(DispatchCell, { schema: Resolve.schema(schema, `#/properties/${encode(propName)}`, rootSchema), uischema: controlWithoutLabel(`#/properties/${encode(propName)}`), path: path, enabled: enabled, renderers: renderers, cells: cells })) : (React.createElement(DispatchCell, { schema: schema, uischema: controlWithoutLabel('#'), path: path, enabled: enabled, renderers: renderers, cells: cells })),
|
|
136
|
+
React.createElement(FormHelperText, { error: !isValid }, !isValid && errors)));
|
|
137
|
+
});
|
|
138
|
+
const NonEmptyCell = (ownProps) => {
|
|
139
|
+
const ctx = useJsonForms();
|
|
140
|
+
const emptyCellProps = ctxToNonEmptyCellProps(ctx, ownProps);
|
|
141
|
+
const isValid = isEmpty(emptyCellProps.errors);
|
|
142
|
+
return React.createElement(NonEmptyCellComponent, Object.assign({}, emptyCellProps, { isValid: isValid }));
|
|
143
|
+
};
|
|
144
|
+
const NonEmptyRowComponent = ({ childPath, schema, rowIndex, openDeleteDialog, moveUpCreator, moveDownCreator, enableUp, enableDown, showSortButtons, enabled, cells, path }) => {
|
|
145
|
+
const moveUp = useMemo(() => moveUpCreator(path, rowIndex), [moveUpCreator, path, rowIndex]);
|
|
146
|
+
const moveDown = useMemo(() => moveDownCreator(path, rowIndex), [moveDownCreator, path, rowIndex]);
|
|
147
|
+
return (React.createElement(TableRow, { key: childPath, hover: true },
|
|
148
|
+
generateCells(NonEmptyCell, schema, childPath, enabled, cells),
|
|
149
|
+
enabled ? (React.createElement(NoBorderTableCell, { style: showSortButtons ? styles.fixedCell : styles.fixedCellSmall },
|
|
150
|
+
React.createElement(Grid, { container: true, direction: 'row', justifyContent: 'flex-end', alignItems: 'center' },
|
|
151
|
+
showSortButtons ? (React.createElement(Fragment, null,
|
|
152
|
+
React.createElement(Grid, { item: true },
|
|
153
|
+
React.createElement(IconButton, { "aria-label": `Move up`, onClick: moveUp, disabled: !enableUp, size: 'large' },
|
|
154
|
+
React.createElement(ArrowUpward, null))),
|
|
155
|
+
React.createElement(Grid, { item: true },
|
|
156
|
+
React.createElement(IconButton, { "aria-label": `Move down`, onClick: moveDown, disabled: !enableDown, size: 'large' },
|
|
157
|
+
React.createElement(ArrowDownward, null))))) : null,
|
|
158
|
+
React.createElement(Grid, { item: true },
|
|
159
|
+
React.createElement(IconButton, { "aria-label": `Delete`, onClick: () => openDeleteDialog(childPath, rowIndex), size: 'large' },
|
|
160
|
+
React.createElement(DeleteIcon, null)))))) : null));
|
|
161
|
+
};
|
|
162
|
+
const NonEmptyRow = React.memo(NonEmptyRowComponent);
|
|
163
|
+
const TableRows = ({ data, path, schema, openDeleteDialog, moveUp, moveDown, uischema, config, enabled, cells }) => {
|
|
164
|
+
const isEmptyTable = data === 0;
|
|
165
|
+
if (isEmptyTable) {
|
|
166
|
+
return React.createElement(EmptyTable, { numColumns: getValidColumnProps(schema).length + 1 });
|
|
167
|
+
}
|
|
168
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
169
|
+
return (React.createElement(React.Fragment, null, range(data).map((index) => {
|
|
170
|
+
const childPath = Paths.compose(path, `${index}`);
|
|
171
|
+
return (React.createElement(NonEmptyRow, { key: childPath, childPath: childPath, rowIndex: index, schema: schema, openDeleteDialog: openDeleteDialog, moveUpCreator: moveUp, moveDownCreator: moveDown, enableUp: index !== 0, enableDown: index !== data - 1, showSortButtons: appliedUiSchemaOptions.showSortButtons, enabled: enabled, cells: cells, path: path }));
|
|
172
|
+
})));
|
|
173
|
+
};
|
|
174
|
+
class MaterialTableControl extends React.Component {
|
|
175
|
+
constructor() {
|
|
176
|
+
super(...arguments);
|
|
177
|
+
this.addItem = (path, value) => this.props.addItem(path, value);
|
|
178
|
+
}
|
|
179
|
+
render() {
|
|
180
|
+
const { label, path, schema, rootSchema, uischema, errors, openDeleteDialog, visible, enabled, cells } = this.props;
|
|
181
|
+
const controlElement = uischema;
|
|
182
|
+
const isObjectSchema = schema.type === 'object';
|
|
183
|
+
const headerCells = isObjectSchema
|
|
184
|
+
? generateCells(TableHeaderCell, schema, path, enabled, cells)
|
|
185
|
+
: undefined;
|
|
186
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
187
|
+
React.createElement(Table, null,
|
|
188
|
+
React.createElement(TableHead, null,
|
|
189
|
+
React.createElement(TableToolbar, { errors: errors, label: label, addItem: this.addItem, numColumns: isObjectSchema ? headerCells.length : 1, path: path, uischema: controlElement, schema: schema, rootSchema: rootSchema, enabled: enabled }),
|
|
190
|
+
isObjectSchema && (React.createElement(TableRow, null,
|
|
191
|
+
headerCells,
|
|
192
|
+
enabled ? React.createElement(TableCell, null) : null))),
|
|
193
|
+
React.createElement(TableBody, null,
|
|
194
|
+
React.createElement(TableRows, Object.assign({ openDeleteDialog: openDeleteDialog }, this.props))))));
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const DeleteDialog = React.memo(({ open, onClose, onConfirm, onCancel }) => {
|
|
199
|
+
return (React.createElement(Dialog, { open: open, keepMounted: true, onClose: onClose, "aria-labelledby": 'alert-dialog-confirmdelete-title', "aria-describedby": 'alert-dialog-confirmdelete-description' },
|
|
200
|
+
React.createElement(DialogTitle, { id: 'alert-dialog-confirmdelete-title' }, 'Confirm Deletion'),
|
|
201
|
+
React.createElement(DialogContent, null,
|
|
202
|
+
React.createElement(DialogContentText, { id: 'alert-dialog-confirmdelete-description' }, "Are you sure you want to delete the selected entry?")),
|
|
203
|
+
React.createElement(DialogActions, null,
|
|
204
|
+
React.createElement(Button, { onClick: onCancel, color: 'primary' }, "No"),
|
|
205
|
+
React.createElement(Button, { onClick: onConfirm, color: 'primary' }, "Yes"))));
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
const MaterialArrayControlRenderer = (props) => {
|
|
209
|
+
const [open, setOpen] = useState(false);
|
|
210
|
+
const [path, setPath] = useState(undefined);
|
|
211
|
+
const [rowData, setRowData] = useState(undefined);
|
|
212
|
+
const { removeItems, visible } = props;
|
|
213
|
+
const openDeleteDialog = useCallback((p, rowIndex) => {
|
|
214
|
+
setOpen(true);
|
|
215
|
+
setPath(p);
|
|
216
|
+
setRowData(rowIndex);
|
|
217
|
+
}, [setOpen, setPath, setRowData]);
|
|
218
|
+
const deleteCancel = useCallback(() => setOpen(false), [setOpen]);
|
|
219
|
+
const deleteConfirm = useCallback(() => {
|
|
220
|
+
const p = path.substring(0, path.lastIndexOf(('.')));
|
|
221
|
+
removeItems(p, [rowData])();
|
|
222
|
+
setOpen(false);
|
|
223
|
+
}, [setOpen, path, rowData]);
|
|
224
|
+
const deleteClose = useCallback(() => setOpen(false), [setOpen]);
|
|
225
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
226
|
+
React.createElement(MaterialTableControl, Object.assign({}, props, { openDeleteDialog: openDeleteDialog })),
|
|
227
|
+
React.createElement(DeleteDialog, { open: open, onCancel: deleteCancel, onConfirm: deleteConfirm, onClose: deleteClose })));
|
|
228
|
+
};
|
|
229
|
+
var MaterialArrayControlRenderer$1 = withJsonFormsArrayLayoutProps(MaterialArrayControlRenderer);
|
|
230
|
+
|
|
231
|
+
const MaterialObjectRenderer = ({ renderers, cells, uischemas, schema, label, path, visible, enabled, uischema, rootSchema }) => {
|
|
232
|
+
const detailUiSchema = useMemo(() => findUISchema(uischemas, schema, uischema.scope, path, () => isEmpty(path) ? Generate.uiSchema(schema, 'VerticalLayout') : { ...Generate.uiSchema(schema, 'Group'), label }, uischema, rootSchema), [uischemas, schema, uischema.scope, path, label, uischema, rootSchema]);
|
|
233
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
234
|
+
React.createElement(JsonFormsDispatch, { visible: visible, enabled: enabled, schema: schema, uischema: detailUiSchema, path: path, renderers: renderers, cells: cells })));
|
|
235
|
+
};
|
|
236
|
+
const materialObjectControlTester = rankWith(2, isObjectControl);
|
|
237
|
+
var MaterialObjectRenderer$1 = withJsonFormsDetailProps(MaterialObjectRenderer);
|
|
238
|
+
|
|
239
|
+
const MaterialAllOfRenderer = ({ schema, rootSchema, visible, renderers, cells, path, uischemas, uischema }) => {
|
|
240
|
+
const delegateUISchema = findMatchingUISchema(uischemas)(schema, uischema.scope, path);
|
|
241
|
+
if (delegateUISchema) {
|
|
242
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
243
|
+
React.createElement(JsonFormsDispatch, { schema: schema, uischema: delegateUISchema, path: path, renderers: renderers, cells: cells })));
|
|
244
|
+
}
|
|
245
|
+
const allOfRenderInfos = createCombinatorRenderInfos(schema.allOf, rootSchema, 'allOf', uischema, path, uischemas);
|
|
246
|
+
return (React.createElement(Hidden, { xsUp: !visible }, allOfRenderInfos.map((allOfRenderInfo, allOfIndex) => (React.createElement(JsonFormsDispatch, { key: allOfIndex, schema: allOfRenderInfo.schema, uischema: allOfRenderInfo.uischema, path: path, renderers: renderers, cells: cells })))));
|
|
247
|
+
};
|
|
248
|
+
const materialAllOfControlTester = rankWith(3, isAllOfControl);
|
|
249
|
+
var MaterialAllOfRenderer$1 = withJsonFormsAllOfProps(MaterialAllOfRenderer);
|
|
250
|
+
|
|
251
|
+
const isLayout = (uischema) => uischema.hasOwnProperty('elements');
|
|
252
|
+
class CombinatorProperties extends React.Component {
|
|
253
|
+
render() {
|
|
254
|
+
const { schema, combinatorKeyword, path } = this.props;
|
|
255
|
+
const otherProps = omit(schema, combinatorKeyword);
|
|
256
|
+
const foundUISchema = Generate.uiSchema(otherProps, 'VerticalLayout');
|
|
257
|
+
let isLayoutWithElements = false;
|
|
258
|
+
if (foundUISchema !== null && isLayout(foundUISchema)) {
|
|
259
|
+
isLayoutWithElements = foundUISchema.elements.length > 0;
|
|
260
|
+
}
|
|
261
|
+
if (isLayoutWithElements) {
|
|
262
|
+
return (React.createElement(JsonFormsDispatch, { schema: otherProps, path: path, uischema: foundUISchema }));
|
|
263
|
+
}
|
|
264
|
+
return null;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const MaterialAnyOfRenderer = ({ schema, rootSchema, indexOfFittingSchema, visible, path, renderers, cells, uischema, uischemas }) => {
|
|
269
|
+
const [selectedAnyOf, setSelectedAnyOf] = useState(indexOfFittingSchema || 0);
|
|
270
|
+
const handleChange = useCallback((_ev, value) => setSelectedAnyOf(value), [setSelectedAnyOf]);
|
|
271
|
+
const anyOf = 'anyOf';
|
|
272
|
+
const anyOfRenderInfos = createCombinatorRenderInfos(schema.anyOf, rootSchema, anyOf, uischema, path, uischemas);
|
|
273
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
274
|
+
React.createElement(CombinatorProperties, { schema: schema, combinatorKeyword: anyOf, path: path }),
|
|
275
|
+
React.createElement(Tabs, { value: selectedAnyOf, onChange: handleChange }, anyOfRenderInfos.map(anyOfRenderInfo => (React.createElement(Tab, { key: anyOfRenderInfo.label, label: anyOfRenderInfo.label })))),
|
|
276
|
+
anyOfRenderInfos.map((anyOfRenderInfo, anyOfIndex) => selectedAnyOf === anyOfIndex && (React.createElement(JsonFormsDispatch, { key: anyOfIndex, schema: anyOfRenderInfo.schema, uischema: anyOfRenderInfo.uischema, path: path, renderers: renderers, cells: cells })))));
|
|
277
|
+
};
|
|
278
|
+
const materialAnyOfControlTester = rankWith(3, isAnyOfControl);
|
|
279
|
+
var MaterialAnyOfRenderer$1 = withJsonFormsAnyOfProps(MaterialAnyOfRenderer);
|
|
280
|
+
|
|
281
|
+
const MaterialOneOfRenderer = ({ handleChange, schema, path, renderers, cells, rootSchema, id, visible, indexOfFittingSchema, uischema, uischemas, data }) => {
|
|
282
|
+
const [open, setOpen] = useState(false);
|
|
283
|
+
const [selectedIndex, setSelectedIndex] = useState(indexOfFittingSchema || 0);
|
|
284
|
+
const [newSelectedIndex, setNewSelectedIndex] = useState(0);
|
|
285
|
+
const handleClose = useCallback(() => setOpen(false), [setOpen]);
|
|
286
|
+
const cancel = useCallback(() => {
|
|
287
|
+
setOpen(false);
|
|
288
|
+
}, [setOpen]);
|
|
289
|
+
const oneOfRenderInfos = createCombinatorRenderInfos(schema.oneOf, rootSchema, 'oneOf', uischema, path, uischemas);
|
|
290
|
+
const openNewTab = (newIndex) => {
|
|
291
|
+
handleChange(path, createDefaultValue(oneOfRenderInfos[newIndex].schema));
|
|
292
|
+
setSelectedIndex(newIndex);
|
|
293
|
+
};
|
|
294
|
+
const confirm = useCallback(() => {
|
|
295
|
+
openNewTab(newSelectedIndex);
|
|
296
|
+
setOpen(false);
|
|
297
|
+
}, [handleChange, createDefaultValue, newSelectedIndex]);
|
|
298
|
+
const handleTabChange = useCallback((_event, newOneOfIndex) => {
|
|
299
|
+
setNewSelectedIndex(newOneOfIndex);
|
|
300
|
+
if (isEmpty(data)) {
|
|
301
|
+
openNewTab(newOneOfIndex);
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
setOpen(true);
|
|
305
|
+
}
|
|
306
|
+
}, [setOpen, setSelectedIndex, data]);
|
|
307
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
308
|
+
React.createElement(CombinatorProperties, { schema: schema, combinatorKeyword: 'oneOf', path: path }),
|
|
309
|
+
React.createElement(Tabs, { value: selectedIndex, onChange: handleTabChange }, oneOfRenderInfos.map(oneOfRenderInfo => React.createElement(Tab, { key: oneOfRenderInfo.label, label: oneOfRenderInfo.label }))),
|
|
310
|
+
oneOfRenderInfos.map((oneOfRenderInfo, oneOfIndex) => (selectedIndex === oneOfIndex && (React.createElement(JsonFormsDispatch, { key: oneOfIndex, schema: oneOfRenderInfo.schema, uischema: oneOfRenderInfo.uischema, path: path, renderers: renderers, cells: cells })))),
|
|
311
|
+
React.createElement(Dialog, { open: open, onClose: handleClose, "aria-labelledby": 'alert-dialog-title', "aria-describedby": 'alert-dialog-description' },
|
|
312
|
+
React.createElement(DialogTitle, { id: 'alert-dialog-title' }, 'Clear form?'),
|
|
313
|
+
React.createElement(DialogContent, null,
|
|
314
|
+
React.createElement(DialogContentText, { id: 'alert-dialog-description' }, "Your data will be cleared if you navigate away from this tab. Do you want to proceed?")),
|
|
315
|
+
React.createElement(DialogActions, null,
|
|
316
|
+
React.createElement(Button, { onClick: cancel, color: 'primary' }, "No"),
|
|
317
|
+
React.createElement(Button, { onClick: confirm, color: 'primary', autoFocus: true, id: `oneOf-${id}-confirm-yes` }, "Yes")))));
|
|
318
|
+
};
|
|
319
|
+
const materialOneOfControlTester = rankWith(3, isOneOfControl);
|
|
320
|
+
var MaterialOneOfRenderer$1 = withJsonFormsOneOfProps(MaterialOneOfRenderer);
|
|
321
|
+
|
|
322
|
+
const MuiCheckbox = React.memo((props) => {
|
|
323
|
+
const { data, className, id, enabled, uischema, path, handleChange, config } = props;
|
|
324
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
325
|
+
const inputProps = { autoFocus: !!appliedUiSchemaOptions.focus };
|
|
326
|
+
const checked = !!data;
|
|
327
|
+
return (React.createElement(Checkbox, { checked: checked, onChange: (_ev, isChecked) => handleChange(path, isChecked), className: className, id: id, disabled: !enabled, inputProps: inputProps }));
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
const MuiSelect = React.memo((props) => {
|
|
331
|
+
const { data, className, id, enabled, uischema, path, handleChange, options, config } = props;
|
|
332
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
333
|
+
return (React.createElement(Select, { className: className, id: id, disabled: !enabled, autoFocus: appliedUiSchemaOptions.focus, value: data !== undefined ? data : '', onChange: ev => handleChange(path, ev.target.value), fullWidth: true, variant: 'standard' }, [React.createElement(MenuItem, { value: '', key: 'empty' })].concat(options.map(optionValue => (React.createElement(MenuItem, { value: optionValue.value, key: optionValue.value }, optionValue.label))))));
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
dayjs.extend(customParsing);
|
|
337
|
+
const createOnChangeHandler = (path, handleChange, saveFormat) => (time) => {
|
|
338
|
+
if (!time) {
|
|
339
|
+
handleChange(path, undefined);
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
const result = dayjs(time).format(saveFormat);
|
|
343
|
+
handleChange(path, result === 'Invalid Date' ? undefined : result);
|
|
344
|
+
};
|
|
345
|
+
const getData = (data, saveFormat) => {
|
|
346
|
+
if (!data) {
|
|
347
|
+
return null;
|
|
348
|
+
}
|
|
349
|
+
const dayjsData = dayjs(data, saveFormat);
|
|
350
|
+
if (dayjsData.toString() === 'Invalid Date') {
|
|
351
|
+
return null;
|
|
352
|
+
}
|
|
353
|
+
return dayjsData;
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
const renderLayoutElements = (elements, schema, path, enabled, renderers, cells) => {
|
|
357
|
+
return elements.map((child, index) => (React.createElement(Grid, { item: true, key: `${path}-${index}`, xs: true },
|
|
358
|
+
React.createElement(JsonFormsDispatch, { uischema: child, schema: schema, path: path, enabled: enabled, renderers: renderers, cells: cells }))));
|
|
359
|
+
};
|
|
360
|
+
const MaterialLayoutRendererComponent = ({ visible, elements, schema, path, enabled, direction, renderers, cells }) => {
|
|
361
|
+
if (isEmpty(elements)) {
|
|
362
|
+
return null;
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
366
|
+
React.createElement(Grid, { container: true, direction: direction, spacing: direction === 'row' ? 2 : 0 }, renderLayoutElements(elements, schema, path, enabled, renderers, cells))));
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
const MaterialLayoutRenderer = React.memo(MaterialLayoutRendererComponent);
|
|
370
|
+
const withAjvProps = (Component) => (props) => {
|
|
371
|
+
const ctx = useJsonForms();
|
|
372
|
+
const ajv = getAjv({ jsonforms: { ...ctx } });
|
|
373
|
+
return (React.createElement(Component, Object.assign({}, props, { ajv: ajv })));
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
const eventToValue$2 = (ev) => ev.target.value;
|
|
377
|
+
const useDebouncedChange = (handleChange, defaultValue, data, path, eventToValueFunction = eventToValue$2, timeout = 300) => {
|
|
378
|
+
const [input, setInput] = useState(data ?? defaultValue);
|
|
379
|
+
useEffect(() => {
|
|
380
|
+
setInput(data ?? defaultValue);
|
|
381
|
+
}, [data]);
|
|
382
|
+
const debouncedUpdate = useCallback(debounce((newValue) => handleChange(path, newValue), timeout), [handleChange, path, timeout]);
|
|
383
|
+
const onChange = useCallback((ev) => {
|
|
384
|
+
const newValue = eventToValueFunction(ev);
|
|
385
|
+
setInput(newValue ?? defaultValue);
|
|
386
|
+
debouncedUpdate(newValue);
|
|
387
|
+
}, [debouncedUpdate, eventToValueFunction]);
|
|
388
|
+
const onClear = useCallback(() => { setInput(defaultValue); handleChange(path, undefined); }, [defaultValue, handleChange, path]);
|
|
389
|
+
return [input, onChange, onClear];
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
const useFocus = () => {
|
|
393
|
+
const [focused, setFocused] = useState(false);
|
|
394
|
+
const onFocus = useCallback(() => setFocused(true), []);
|
|
395
|
+
const onBlur = useCallback(() => setFocused(false), []);
|
|
396
|
+
return [focused, onFocus, onBlur];
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
const toNumber$1 = (value) => value === '' ? undefined : parseInt(value, 10);
|
|
400
|
+
const eventToValue$1 = (ev) => toNumber$1(ev.target.value);
|
|
401
|
+
const MuiInputInteger = React.memo((props) => {
|
|
402
|
+
const { data, className, id, enabled, uischema, path, handleChange, config } = props;
|
|
403
|
+
const inputProps = { step: '1' };
|
|
404
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
405
|
+
const [inputValue, onChange] = useDebouncedChange(handleChange, '', data, path, eventToValue$1);
|
|
406
|
+
return (React.createElement(Input, { type: 'number', value: inputValue, onChange: onChange, className: className, id: id, disabled: !enabled, autoFocus: appliedUiSchemaOptions.focus, inputProps: inputProps, fullWidth: true }));
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
const toNumber = (value) => value === '' ? undefined : parseFloat(value);
|
|
410
|
+
const eventToValue = (ev) => toNumber(ev.target.value);
|
|
411
|
+
const MuiInputNumber = React.memo((props) => {
|
|
412
|
+
const { data, className, id, enabled, uischema, path, handleChange, config } = props;
|
|
413
|
+
const inputProps = { step: '0.1' };
|
|
414
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
415
|
+
const [inputValue, onChange] = useDebouncedChange(handleChange, '', data, path, eventToValue);
|
|
416
|
+
return (React.createElement(Input, { type: 'number', value: inputValue, onChange: onChange, className: className, id: id, disabled: !enabled, autoFocus: appliedUiSchemaOptions.focus, inputProps: inputProps, fullWidth: true }));
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
const MuiInputNumberFormat = React.memo((props) => {
|
|
420
|
+
const { className, id, enabled, uischema, isValid, path, handleChange, schema, config } = props;
|
|
421
|
+
const maxLength = schema.maxLength;
|
|
422
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
423
|
+
let inputProps;
|
|
424
|
+
if (appliedUiSchemaOptions.restrict) {
|
|
425
|
+
inputProps = { maxLength: maxLength };
|
|
426
|
+
}
|
|
427
|
+
else {
|
|
428
|
+
inputProps = {};
|
|
429
|
+
}
|
|
430
|
+
const formattedNumber = props.toFormatted(props.data);
|
|
431
|
+
const validStringNumber = useCallback((ev) => props.fromFormatted(ev.currentTarget.value), [props.fromFormatted]);
|
|
432
|
+
const [inputValue, onChange] = useDebouncedChange(handleChange, '', formattedNumber, path, validStringNumber);
|
|
433
|
+
return (React.createElement(Input, { type: 'text', value: inputValue, onChange: onChange, className: className, id: id, disabled: !enabled, autoFocus: appliedUiSchemaOptions.focus, multiline: appliedUiSchemaOptions.multi, fullWidth: !appliedUiSchemaOptions.trim || maxLength === undefined, inputProps: inputProps, error: !isValid }));
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
const MuiInputText = React.memo((props) => {
|
|
437
|
+
const [showAdornment, setShowAdornment] = useState(false);
|
|
438
|
+
const { data, config, className, id, enabled, uischema, isValid, path, handleChange, schema, muiInputProps, inputComponent } = props;
|
|
439
|
+
const maxLength = schema.maxLength;
|
|
440
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
441
|
+
let inputProps;
|
|
442
|
+
if (appliedUiSchemaOptions.restrict) {
|
|
443
|
+
inputProps = { maxLength: maxLength };
|
|
444
|
+
}
|
|
445
|
+
else {
|
|
446
|
+
inputProps = {};
|
|
447
|
+
}
|
|
448
|
+
inputProps = merge(inputProps, muiInputProps);
|
|
449
|
+
if (appliedUiSchemaOptions.trim && maxLength !== undefined) {
|
|
450
|
+
inputProps.size = maxLength;
|
|
451
|
+
}
|
|
452
|
+
const [inputText, onChange, onClear] = useDebouncedChange(handleChange, '', data, path);
|
|
453
|
+
const onPointerEnter = () => setShowAdornment(true);
|
|
454
|
+
const onPointerLeave = () => setShowAdornment(false);
|
|
455
|
+
const theme = useTheme();
|
|
456
|
+
const closeStyle = {
|
|
457
|
+
background: theme.jsonforms?.input?.delete?.background || theme.palette.background.default,
|
|
458
|
+
borderRadius: '50%'
|
|
459
|
+
};
|
|
460
|
+
return (React.createElement(Input, { type: appliedUiSchemaOptions.format === 'password' ? 'password' : 'text', value: inputText, onChange: onChange, className: className, id: id, disabled: !enabled, autoFocus: appliedUiSchemaOptions.focus, multiline: appliedUiSchemaOptions.multi, fullWidth: !appliedUiSchemaOptions.trim || maxLength === undefined, inputProps: inputProps, error: !isValid, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, endAdornment: React.createElement(InputAdornment, { position: 'end', style: {
|
|
461
|
+
display: !showAdornment || !enabled || data === undefined ? 'none' : 'flex',
|
|
462
|
+
position: 'absolute',
|
|
463
|
+
right: 0
|
|
464
|
+
} },
|
|
465
|
+
React.createElement(IconButton, { "aria-label": 'Clear input field', onClick: onClear, size: 'large' },
|
|
466
|
+
React.createElement(Close, { style: closeStyle }))), inputComponent: inputComponent }));
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
const MuiInputTime = React.memo((props) => {
|
|
470
|
+
const { data, className, id, enabled, uischema, path, handleChange, config } = props;
|
|
471
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
472
|
+
const [inputValue, onChange] = useDebouncedChange(handleChange, '', data, path);
|
|
473
|
+
return (React.createElement(Input, { type: 'time', value: inputValue, onChange: onChange, className: className, id: id, disabled: !enabled, autoFocus: appliedUiSchemaOptions.focus, fullWidth: true }));
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
const MaterialEnumArrayRenderer = ({ schema, visible, errors, path, options, data, addItem, removeItem, handleChange, ...otherProps }) => {
|
|
477
|
+
return (React.createElement(Hidden, { xlUp: !visible },
|
|
478
|
+
React.createElement(FormControl, { component: 'fieldset' },
|
|
479
|
+
React.createElement(FormGroup, { row: true }, options.map((option, index) => {
|
|
480
|
+
const optionPath = Paths.compose(path, `${index}`);
|
|
481
|
+
const checkboxValue = data?.includes(option.value)
|
|
482
|
+
? option.value
|
|
483
|
+
: undefined;
|
|
484
|
+
return (React.createElement(FormControlLabel, { id: option.value, key: option.value, control: React.createElement(MuiCheckbox, Object.assign({ key: 'checkbox-' + option.value, isValid: isEmpty(errors), path: optionPath, handleChange: (_childPath, newValue) => newValue
|
|
485
|
+
? addItem(path, option.value)
|
|
486
|
+
: removeItem(path, option.value), data: checkboxValue, errors: errors, schema: schema, visible: visible }, otherProps)), label: option.label }));
|
|
487
|
+
})),
|
|
488
|
+
React.createElement(FormHelperText, { error: true }, errors))));
|
|
489
|
+
};
|
|
490
|
+
const hasOneOfItems = (schema) => schema.oneOf !== undefined &&
|
|
491
|
+
schema.oneOf.length > 0 &&
|
|
492
|
+
schema.oneOf.every((entry) => {
|
|
493
|
+
return entry.const !== undefined;
|
|
494
|
+
});
|
|
495
|
+
const hasEnumItems = (schema) => schema.type === 'string' && schema.enum !== undefined;
|
|
496
|
+
const materialEnumArrayRendererTester = rankWith(5, and(uiTypeIs('Control'), and(schemaMatches(schema => hasType(schema, 'array') &&
|
|
497
|
+
!Array.isArray(schema.items) &&
|
|
498
|
+
schema.uniqueItems === true), schemaSubPathMatches('items', schema => {
|
|
499
|
+
return hasOneOfItems(schema) || hasEnumItems(schema);
|
|
500
|
+
}))));
|
|
501
|
+
var MaterialEnumArrayRenderer$1 = withJsonFormsMultiEnumProps(MaterialEnumArrayRenderer);
|
|
502
|
+
|
|
503
|
+
const materialArrayControlTester = rankWith(3, or(isObjectArrayControl, isPrimitiveArrayControl));
|
|
504
|
+
|
|
505
|
+
const materialLabelRendererTester = rankWith(1, uiTypeIs('Label'));
|
|
506
|
+
const MaterialLabelRenderer = ({ uischema, visible }) => {
|
|
507
|
+
const labelElement = uischema;
|
|
508
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
509
|
+
React.createElement(Typography, { variant: 'h6' }, labelElement.text !== undefined && labelElement.text !== null && labelElement.text)));
|
|
510
|
+
};
|
|
511
|
+
var MaterialLabelRenderer$1 = withJsonFormsLayoutProps(MaterialLabelRenderer);
|
|
512
|
+
|
|
513
|
+
const ArrayLayoutToolbar = React.memo(({ label, errors, addItem, path, createDefault }) => {
|
|
514
|
+
return (React.createElement(Toolbar, { disableGutters: true },
|
|
515
|
+
React.createElement(Grid, { container: true, alignItems: 'center', justifyContent: 'space-between' },
|
|
516
|
+
React.createElement(Grid, { item: true },
|
|
517
|
+
React.createElement(Typography, { variant: 'h6' }, label)),
|
|
518
|
+
React.createElement(Hidden, { smUp: errors.length === 0 },
|
|
519
|
+
React.createElement(Grid, { item: true },
|
|
520
|
+
React.createElement(ValidationIcon, { id: 'tooltip-validation', errorMessages: errors }))),
|
|
521
|
+
React.createElement(Grid, { item: true },
|
|
522
|
+
React.createElement(Grid, { container: true },
|
|
523
|
+
React.createElement(Grid, { item: true },
|
|
524
|
+
React.createElement(Tooltip, { id: 'tooltip-add', title: `Add to ${label}`, placement: 'bottom' },
|
|
525
|
+
React.createElement(IconButton, { "aria-label": `Add to ${label}`, onClick: addItem(path, createDefault()), size: 'large' },
|
|
526
|
+
React.createElement(AddIcon, null)))))))));
|
|
527
|
+
});
|
|
528
|
+
|
|
529
|
+
const ListWithDetailMasterItem = ({ index, childLabel, selected, handleSelect, removeItem, path }) => {
|
|
530
|
+
return (React.createElement(ListItem, { button: true, selected: selected, onClick: handleSelect(index) },
|
|
531
|
+
React.createElement(ListItemAvatar, null,
|
|
532
|
+
React.createElement(Avatar, { "aria-label": 'Index' }, index + 1)),
|
|
533
|
+
React.createElement(ListItemText, { primary: childLabel }),
|
|
534
|
+
React.createElement(ListItemSecondaryAction, null,
|
|
535
|
+
React.createElement(IconButton, { "aria-label": 'Delete', onClick: removeItem(path, index), size: 'large' },
|
|
536
|
+
React.createElement(DeleteIcon, null)))));
|
|
537
|
+
};
|
|
538
|
+
var ListWithDetailMasterItem$1 = withJsonFormsMasterListItemProps(ListWithDetailMasterItem);
|
|
539
|
+
|
|
540
|
+
const MaterialListWithDetailRenderer = ({ uischemas, schema, uischema, path, errors, visible, label, required, removeItems, addItem, data, renderers, cells, config }) => {
|
|
541
|
+
const [selectedIndex, setSelectedIndex] = useState(undefined);
|
|
542
|
+
const handleRemoveItem = useCallback((p, value) => () => {
|
|
543
|
+
removeItems(p, [value])();
|
|
544
|
+
if (selectedIndex === value) {
|
|
545
|
+
setSelectedIndex(undefined);
|
|
546
|
+
}
|
|
547
|
+
else if (selectedIndex > value) {
|
|
548
|
+
setSelectedIndex(selectedIndex - 1);
|
|
549
|
+
}
|
|
550
|
+
}, [removeItems, setSelectedIndex]);
|
|
551
|
+
const handleListItemClick = useCallback((index) => () => setSelectedIndex(index), [setSelectedIndex]);
|
|
552
|
+
const handleCreateDefaultValue = useCallback(() => createDefaultValue(schema), [createDefaultValue]);
|
|
553
|
+
const foundUISchema = useMemo(() => findUISchema(uischemas, schema, uischema.scope, path, undefined, uischema), [uischemas, schema, uischema.scope, path, uischema]);
|
|
554
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
555
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
556
|
+
React.createElement(ArrayLayoutToolbar, { label: computeLabel(label, required, appliedUiSchemaOptions.hideRequiredAsterisk), errors: errors, path: path, addItem: addItem, createDefault: handleCreateDefaultValue }),
|
|
557
|
+
React.createElement(Grid, { container: true, direction: 'row', spacing: 2 },
|
|
558
|
+
React.createElement(Grid, { item: true, xs: 3 },
|
|
559
|
+
React.createElement(List, null, data > 0 ? (map(range(data), index => (React.createElement(ListWithDetailMasterItem$1, { index: index, path: path, schema: schema, handleSelect: handleListItemClick, removeItem: handleRemoveItem, selected: selectedIndex === index, key: index })))) : (React.createElement("p", null, "No data")))),
|
|
560
|
+
React.createElement(Grid, { item: true, xs: true }, selectedIndex !== undefined ? (React.createElement(JsonFormsDispatch, { renderers: renderers, cells: cells, visible: visible, schema: schema, uischema: foundUISchema, path: composePaths(path, `${selectedIndex}`) })) : (React.createElement(Typography, { variant: 'h6' }, "No Selection"))))));
|
|
561
|
+
};
|
|
562
|
+
const materialListWithDetailTester = rankWith(4, and(uiTypeIs('ListWithDetail'), isObjectArray));
|
|
563
|
+
var MaterialListWithDetailRenderer$1 = withJsonFormsArrayLayoutProps(MaterialListWithDetailRenderer);
|
|
564
|
+
|
|
565
|
+
const MaterialBooleanControl = ({ data, visible, label, id, enabled, uischema, schema, rootSchema, handleChange, errors, path, config }) => {
|
|
566
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
567
|
+
React.createElement(FormControlLabel, { label: label, id: id, control: React.createElement(MuiCheckbox, { id: `${id}-input`, isValid: isEmpty(errors), data: data, enabled: enabled, visible: visible, path: path, uischema: uischema, schema: schema, rootSchema: rootSchema, handleChange: handleChange, errors: errors, config: config }) })));
|
|
568
|
+
};
|
|
569
|
+
const materialBooleanControlTester = rankWith(2, isBooleanControl);
|
|
570
|
+
var MaterialBooleanControl$1 = withJsonFormsControlProps(MaterialBooleanControl);
|
|
571
|
+
|
|
572
|
+
const MuiToggle = React.memo((props) => {
|
|
573
|
+
const { data, className, id, enabled, uischema, path, handleChange, config } = props;
|
|
574
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
575
|
+
const inputProps = { autoFocus: !!appliedUiSchemaOptions.focus };
|
|
576
|
+
const checked = !!data;
|
|
577
|
+
return (React.createElement(Switch, { checked: checked, onChange: (_ev, isChecked) => handleChange(path, isChecked), className: className, id: id, disabled: !enabled, inputProps: inputProps }));
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
const MaterialBooleanToggleControl = ({ data, visible, label, id, enabled, uischema, schema, rootSchema, handleChange, errors, path, config }) => {
|
|
581
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
582
|
+
React.createElement(FormControlLabel, { label: label, id: id, control: React.createElement(MuiToggle, { id: `${id}-input`, isValid: isEmpty(errors), data: data, enabled: enabled, visible: visible, path: path, uischema: uischema, schema: schema, rootSchema: rootSchema, handleChange: handleChange, errors: errors, config: config }) })));
|
|
583
|
+
};
|
|
584
|
+
const materialBooleanToggleControlTester = rankWith(3, and(isBooleanControl, optionIs('toggle', true)));
|
|
585
|
+
var MaterialBooleanToggleControl$1 = withJsonFormsControlProps(MaterialBooleanToggleControl);
|
|
586
|
+
|
|
587
|
+
const MaterialInputControl = (props) => {
|
|
588
|
+
const [focused, onFocus, onBlur] = useFocus();
|
|
589
|
+
const { id, description, errors, label, uischema, visible, required, config, input } = props;
|
|
590
|
+
const isValid = errors.length === 0;
|
|
591
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
592
|
+
const showDescription = !isDescriptionHidden(visible, description, focused, appliedUiSchemaOptions.showUnfocusedDescription);
|
|
593
|
+
const firstFormHelperText = showDescription
|
|
594
|
+
? description
|
|
595
|
+
: !isValid
|
|
596
|
+
? errors
|
|
597
|
+
: null;
|
|
598
|
+
const secondFormHelperText = showDescription && !isValid ? errors : null;
|
|
599
|
+
const InnerComponent = input;
|
|
600
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
601
|
+
React.createElement(FormControl, { fullWidth: !appliedUiSchemaOptions.trim, onFocus: onFocus, onBlur: onBlur, id: id, variant: 'standard' },
|
|
602
|
+
React.createElement(InputLabel, { htmlFor: id + '-input', error: !isValid, required: showAsRequired(required, appliedUiSchemaOptions.hideRequiredAsterisk) }, label),
|
|
603
|
+
React.createElement(InnerComponent, Object.assign({}, props, { id: id + '-input', isValid: isValid, visible: visible })),
|
|
604
|
+
React.createElement(FormHelperText, { error: !isValid && !showDescription }, firstFormHelperText),
|
|
605
|
+
React.createElement(FormHelperText, { error: !isValid }, secondFormHelperText))));
|
|
606
|
+
};
|
|
607
|
+
|
|
608
|
+
const MuiAutocomplete = (props) => {
|
|
609
|
+
const { data, className, id, enabled, uischema, path, handleChange, options, config, getOptionLabel, renderOption, filterOptions } = props;
|
|
610
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
611
|
+
const [inputValue, setInputValue] = React.useState(data ?? '');
|
|
612
|
+
const findOption = options.find(o => o.value === data) ?? null;
|
|
613
|
+
return (React.createElement(Autocomplete, { className: className, id: id, disabled: !enabled, value: findOption, onChange: (_event, newValue) => {
|
|
614
|
+
handleChange(path, newValue?.value);
|
|
615
|
+
}, inputValue: inputValue, onInputChange: (_event, newInputValue) => {
|
|
616
|
+
setInputValue(newInputValue);
|
|
617
|
+
}, autoHighlight: true, autoSelect: true, autoComplete: true, fullWidth: true, options: options, getOptionLabel: getOptionLabel || (option => option?.label), style: { marginTop: 16 }, renderInput: params => (React.createElement(Input, { style: { width: '100%' }, type: 'text', inputProps: params.inputProps, inputRef: params.InputProps.ref, autoFocus: appliedUiSchemaOptions.focus, disabled: !enabled })), renderOption: renderOption, filterOptions: filterOptions }));
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
const MaterialEnumControl = (props) => {
|
|
621
|
+
const { config, uischema } = props;
|
|
622
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
623
|
+
return (React.createElement(MaterialInputControl, Object.assign({}, props, { input: appliedUiSchemaOptions.autocomplete === false ? MuiSelect : MuiAutocomplete })));
|
|
624
|
+
};
|
|
625
|
+
const materialEnumControlTester = rankWith(2, isEnumControl);
|
|
626
|
+
var MaterialEnumControl$1 = withJsonFormsEnumProps(MaterialEnumControl);
|
|
627
|
+
|
|
628
|
+
const MaterialNativeControl = (props) => {
|
|
629
|
+
const [focused, onFocus, onBlur] = useFocus();
|
|
630
|
+
const { id, errors, label, schema, description, enabled, visible, required, path, handleChange, data, config } = props;
|
|
631
|
+
const isValid = errors.length === 0;
|
|
632
|
+
const appliedUiSchemaOptions = merge({}, config, props.uischema.options);
|
|
633
|
+
const [inputValue, onChange] = useDebouncedChange(handleChange, '', data, path);
|
|
634
|
+
const fieldType = appliedUiSchemaOptions.format ?? schema.format;
|
|
635
|
+
const showDescription = !isDescriptionHidden(visible, description, focused, appliedUiSchemaOptions.showUnfocusedDescription);
|
|
636
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
637
|
+
React.createElement(TextField, { required: showAsRequired(required, appliedUiSchemaOptions.hideRequiredAsterisk), id: id + '-input', label: label, type: fieldType, error: !isValid, disabled: !enabled, fullWidth: !appliedUiSchemaOptions.trim, onFocus: onFocus, onBlur: onBlur, helperText: !isValid ? errors : showDescription ? description : null, InputLabelProps: { shrink: true }, value: inputValue, onChange: onChange })));
|
|
638
|
+
};
|
|
639
|
+
const materialNativeControlTester = rankWith(2, or(isDateControl, isTimeControl));
|
|
640
|
+
var MaterialNativeControl$1 = withJsonFormsControlProps(MaterialNativeControl);
|
|
641
|
+
|
|
642
|
+
const MaterialDateControl = (props) => {
|
|
643
|
+
const [focused, onFocus, onBlur] = useFocus();
|
|
644
|
+
const { description, id, errors, label, uischema, visible, enabled, required, path, handleChange, data, config } = props;
|
|
645
|
+
const isValid = errors.length === 0;
|
|
646
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
647
|
+
const showDescription = !isDescriptionHidden(visible, description, focused, appliedUiSchemaOptions.showUnfocusedDescription);
|
|
648
|
+
const format = appliedUiSchemaOptions.dateFormat ?? 'YYYY-MM-DD';
|
|
649
|
+
const saveFormat = appliedUiSchemaOptions.dateSaveFormat ?? 'YYYY-MM-DD';
|
|
650
|
+
const firstFormHelperText = showDescription
|
|
651
|
+
? description
|
|
652
|
+
: !isValid
|
|
653
|
+
? errors
|
|
654
|
+
: null;
|
|
655
|
+
const secondFormHelperText = showDescription && !isValid ? errors : null;
|
|
656
|
+
const onChange = useMemo(() => createOnChangeHandler(path, handleChange, saveFormat), [path, handleChange, saveFormat]);
|
|
657
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
658
|
+
React.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs },
|
|
659
|
+
React.createElement(DatePicker, { label: label, value: getData(data, saveFormat), clearable: true, onChange: onChange, inputFormat: format, disableMaskedInput: true, views: appliedUiSchemaOptions.views, disabled: !enabled, cancelText: appliedUiSchemaOptions.cancelLabel, clearText: appliedUiSchemaOptions.clearLabel, okText: appliedUiSchemaOptions.okLabel, renderInput: params => (React.createElement(TextField, Object.assign({}, params, { id: id + '-input', required: required && !appliedUiSchemaOptions.hideRequiredAsterisk, autoFocus: appliedUiSchemaOptions.focus, error: !isValid, fullWidth: !appliedUiSchemaOptions.trim, inputProps: { ...params.inputProps, type: 'text' }, InputLabelProps: data ? { shrink: true } : undefined, onFocus: onFocus, onBlur: onBlur, variant: 'standard' }))) }),
|
|
660
|
+
React.createElement(FormHelperText, { error: !isValid && !showDescription }, firstFormHelperText),
|
|
661
|
+
React.createElement(FormHelperText, { error: !isValid }, secondFormHelperText))));
|
|
662
|
+
};
|
|
663
|
+
const materialDateControlTester = rankWith(4, isDateControl);
|
|
664
|
+
var MaterialDateControl$1 = withJsonFormsControlProps(MaterialDateControl);
|
|
665
|
+
|
|
666
|
+
const MaterialDateTimeControl = (props) => {
|
|
667
|
+
const [focused, onFocus, onBlur] = useFocus();
|
|
668
|
+
const { id, description, errors, label, uischema, visible, enabled, required, path, handleChange, data, config } = props;
|
|
669
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
670
|
+
const isValid = errors.length === 0;
|
|
671
|
+
const showDescription = !isDescriptionHidden(visible, description, focused, appliedUiSchemaOptions.showUnfocusedDescription);
|
|
672
|
+
const format = appliedUiSchemaOptions.dateTimeFormat ?? 'YYYY-MM-DD HH:mm';
|
|
673
|
+
const saveFormat = appliedUiSchemaOptions.dateTimeSaveFormat ?? undefined;
|
|
674
|
+
const firstFormHelperText = showDescription
|
|
675
|
+
? description
|
|
676
|
+
: !isValid
|
|
677
|
+
? errors
|
|
678
|
+
: null;
|
|
679
|
+
const secondFormHelperText = showDescription && !isValid ? errors : null;
|
|
680
|
+
const onChange = useMemo(() => createOnChangeHandler(path, handleChange, saveFormat), [path, handleChange, saveFormat]);
|
|
681
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
682
|
+
React.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs },
|
|
683
|
+
React.createElement(DateTimePicker, { label: label, value: getData(data, saveFormat), clearable: true, onChange: onChange, inputFormat: format, disableMaskedInput: true, ampm: !!appliedUiSchemaOptions.ampm, views: appliedUiSchemaOptions.views, disabled: !enabled, cancelText: appliedUiSchemaOptions.cancelLabel, clearText: appliedUiSchemaOptions.clearLabel, okText: appliedUiSchemaOptions.okLabel, renderInput: params => (React.createElement(TextField, Object.assign({}, params, { id: id + '-input', required: required && !appliedUiSchemaOptions.hideRequiredAsterisk, autoFocus: appliedUiSchemaOptions.focus, error: !isValid, fullWidth: !appliedUiSchemaOptions.trim, inputProps: { ...params.inputProps, type: 'text' }, InputLabelProps: data ? { shrink: true } : undefined, onFocus: onFocus, onBlur: onBlur, variant: 'standard' }))) }),
|
|
684
|
+
React.createElement(FormHelperText, { error: !isValid && !showDescription }, firstFormHelperText),
|
|
685
|
+
React.createElement(FormHelperText, { error: !isValid }, secondFormHelperText))));
|
|
686
|
+
};
|
|
687
|
+
const materialDateTimeControlTester = rankWith(2, isDateTimeControl);
|
|
688
|
+
var MaterialDateTimeControl$1 = withJsonFormsControlProps(MaterialDateTimeControl);
|
|
689
|
+
|
|
690
|
+
const MaterialTimeControl = (props) => {
|
|
691
|
+
const [focused, onFocus, onBlur] = useFocus();
|
|
692
|
+
const { id, description, errors, label, uischema, visible, enabled, required, path, handleChange, data, config } = props;
|
|
693
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
694
|
+
const isValid = errors.length === 0;
|
|
695
|
+
const showDescription = !isDescriptionHidden(visible, description, focused, appliedUiSchemaOptions.showUnfocusedDescription);
|
|
696
|
+
const format = appliedUiSchemaOptions.timeFormat ?? 'HH:mm';
|
|
697
|
+
const saveFormat = appliedUiSchemaOptions.timeSaveFormat ?? 'HH:mm:ss';
|
|
698
|
+
const firstFormHelperText = showDescription
|
|
699
|
+
? description
|
|
700
|
+
: !isValid
|
|
701
|
+
? errors
|
|
702
|
+
: null;
|
|
703
|
+
const secondFormHelperText = showDescription && !isValid ? errors : null;
|
|
704
|
+
const onChange = useMemo(() => createOnChangeHandler(path, handleChange, saveFormat), [path, handleChange, saveFormat]);
|
|
705
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
706
|
+
React.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs },
|
|
707
|
+
React.createElement(TimePicker, { label: label, value: getData(data, saveFormat), clearable: true, onChange: onChange, inputFormat: format, disableMaskedInput: true, ampm: !!appliedUiSchemaOptions.ampm, views: appliedUiSchemaOptions.views, disabled: !enabled, cancelText: appliedUiSchemaOptions.cancelLabel, clearText: appliedUiSchemaOptions.clearLabel, okText: appliedUiSchemaOptions.okLabel, renderInput: params => (React.createElement(TextField, Object.assign({}, params, { id: id + '-input', required: required && !appliedUiSchemaOptions.hideRequiredAsterisk, autoFocus: appliedUiSchemaOptions.focus, error: !isValid, fullWidth: !appliedUiSchemaOptions.trim, inputProps: { ...params.inputProps, type: 'text' }, InputLabelProps: data ? { shrink: true } : undefined, onFocus: onFocus, onBlur: onBlur, variant: 'standard' }))) }),
|
|
708
|
+
React.createElement(FormHelperText, { error: !isValid && !showDescription }, firstFormHelperText),
|
|
709
|
+
React.createElement(FormHelperText, { error: !isValid }, secondFormHelperText))));
|
|
710
|
+
};
|
|
711
|
+
const materialTimeControlTester = rankWith(4, isTimeControl);
|
|
712
|
+
var MaterialTimeControl$1 = withJsonFormsControlProps(MaterialTimeControl);
|
|
713
|
+
|
|
714
|
+
const MaterialSliderControl = (props) => {
|
|
715
|
+
const [focused, onFocus, onBlur] = useFocus();
|
|
716
|
+
const { id, data, description, enabled, errors, label, schema, handleChange, visible, path, required, config } = props;
|
|
717
|
+
const isValid = errors.length === 0;
|
|
718
|
+
const appliedUiSchemaOptions = merge({}, config, props.uischema.options);
|
|
719
|
+
const labelStyle = {
|
|
720
|
+
whiteSpace: 'nowrap',
|
|
721
|
+
overflow: 'hidden',
|
|
722
|
+
textOverflow: 'ellipsis',
|
|
723
|
+
width: '100%'
|
|
724
|
+
};
|
|
725
|
+
const rangeContainerStyle = {
|
|
726
|
+
display: 'flex'
|
|
727
|
+
};
|
|
728
|
+
const rangeItemStyle = {
|
|
729
|
+
flexGrow: '1'
|
|
730
|
+
};
|
|
731
|
+
const sliderStyle = {
|
|
732
|
+
marginTop: '7px'
|
|
733
|
+
};
|
|
734
|
+
const showDescription = !isDescriptionHidden(visible, description, focused, appliedUiSchemaOptions.showUnfocusedDescription);
|
|
735
|
+
const onChange = useCallback((_ev, value) => handleChange(path, Number(value)), [path, handleChange]);
|
|
736
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
737
|
+
React.createElement(FormControl, { fullWidth: !appliedUiSchemaOptions.trim, onFocus: onFocus, onBlur: onBlur, id: id },
|
|
738
|
+
React.createElement(FormLabel, { htmlFor: id, error: !isValid, component: 'legend', required: showAsRequired(required, appliedUiSchemaOptions.hideRequiredAsterisk) },
|
|
739
|
+
React.createElement(Typography, { id: id + '-typo', style: labelStyle, variant: 'caption' }, label)),
|
|
740
|
+
React.createElement("div", { style: rangeContainerStyle },
|
|
741
|
+
React.createElement(Typography, { style: rangeItemStyle, variant: 'caption', align: 'left' }, schema.minimum),
|
|
742
|
+
React.createElement(Typography, { style: rangeItemStyle, variant: 'caption', align: 'right' }, schema.maximum)),
|
|
743
|
+
React.createElement(Slider, { style: sliderStyle, min: schema.minimum, max: schema.maximum, value: Number(data || schema.default), onChange: onChange, id: id + '-input', disabled: !enabled, step: schema.multipleOf || 1 }),
|
|
744
|
+
React.createElement(FormHelperText, { error: !isValid }, !isValid ? errors : showDescription ? description : null))));
|
|
745
|
+
};
|
|
746
|
+
const materialSliderControlTester = rankWith(4, isRangeControl);
|
|
747
|
+
var MaterialSliderControl$1 = withJsonFormsControlProps(MaterialSliderControl);
|
|
748
|
+
|
|
749
|
+
const MaterialRadioGroup = (props) => {
|
|
750
|
+
const [focused, onFocus, onBlur] = useFocus();
|
|
751
|
+
const { config, id, label, required, description, errors, data, visible, options, handleChange, path, enabled } = props;
|
|
752
|
+
const isValid = errors.length === 0;
|
|
753
|
+
const appliedUiSchemaOptions = merge({}, config, props.uischema.options);
|
|
754
|
+
const showDescription = !isDescriptionHidden(visible, description, focused, appliedUiSchemaOptions.showUnfocusedDescription);
|
|
755
|
+
const onChange = (_ev, value) => handleChange(path, value);
|
|
756
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
757
|
+
React.createElement(FormControl, { component: 'fieldset', fullWidth: !appliedUiSchemaOptions.trim, onFocus: onFocus, onBlur: onBlur },
|
|
758
|
+
React.createElement(FormLabel, { htmlFor: id, error: !isValid, component: 'legend', required: showAsRequired(required, appliedUiSchemaOptions.hideRequiredAsterisk) }, label),
|
|
759
|
+
React.createElement(RadioGroup, { value: props.data, onChange: onChange, row: true }, options.map(option => (React.createElement(FormControlLabel, { value: option.value, key: option.label, control: React.createElement(Radio, { checked: data === option.value }), label: option.label, disabled: !enabled })))),
|
|
760
|
+
React.createElement(FormHelperText, { error: !isValid }, !isValid ? errors : showDescription ? description : null))));
|
|
761
|
+
};
|
|
762
|
+
|
|
763
|
+
const MaterialRadioGroupControl = (props) => {
|
|
764
|
+
return React.createElement(MaterialRadioGroup, Object.assign({}, props));
|
|
765
|
+
};
|
|
766
|
+
const materialRadioGroupControlTester = rankWith(20, and(isEnumControl, optionIs('format', 'radio')));
|
|
767
|
+
var MaterialRadioGroupControl$1 = withJsonFormsEnumProps(MaterialRadioGroupControl);
|
|
768
|
+
|
|
769
|
+
const MaterialIntegerControl = (props) => (React.createElement(MaterialInputControl, Object.assign({}, props, { input: MuiInputInteger })));
|
|
770
|
+
const materialIntegerControlTester = rankWith(2, isIntegerControl);
|
|
771
|
+
var MaterialIntegerControl$1 = withJsonFormsControlProps(MaterialIntegerControl);
|
|
772
|
+
|
|
773
|
+
const MaterialNumberControl = (props) => (React.createElement(MaterialInputControl, Object.assign({}, props, { input: MuiInputNumber })));
|
|
774
|
+
const materialNumberControlTester = rankWith(2, isNumberControl);
|
|
775
|
+
var MaterialNumberControl$1 = withJsonFormsControlProps(MaterialNumberControl);
|
|
776
|
+
|
|
777
|
+
const MaterialTextControl = (props) => (React.createElement(MaterialInputControl, Object.assign({}, props, { input: MuiInputText })));
|
|
778
|
+
const materialTextControlTester = rankWith(1, isStringControl);
|
|
779
|
+
var MaterialTextControl$1 = withJsonFormsControlProps(MaterialTextControl);
|
|
780
|
+
|
|
781
|
+
const findEnumSchema = (schemas) => schemas.find(s => s.enum !== undefined && (s.type === 'string' || s.type === undefined));
|
|
782
|
+
const findTextSchema = (schemas) => schemas.find(s => s.type === 'string' && s.enum === undefined);
|
|
783
|
+
const MuiAutocompleteInputText = (props) => {
|
|
784
|
+
const { data, config, className, id, enabled, uischema, isValid, path, handleChange, schema } = props;
|
|
785
|
+
const enumSchema = findEnumSchema(schema.anyOf);
|
|
786
|
+
const stringSchema = findTextSchema(schema.anyOf);
|
|
787
|
+
const maxLength = stringSchema.maxLength;
|
|
788
|
+
const appliedUiSchemaOptions = useMemo(() => merge({}, config, uischema.options), [config, uischema.options]);
|
|
789
|
+
const inputProps = useMemo(() => {
|
|
790
|
+
let propMemo = {};
|
|
791
|
+
if (appliedUiSchemaOptions.restrict) {
|
|
792
|
+
propMemo = { maxLength: maxLength };
|
|
793
|
+
}
|
|
794
|
+
if (appliedUiSchemaOptions.trim && maxLength !== undefined) {
|
|
795
|
+
propMemo.size = maxLength;
|
|
796
|
+
}
|
|
797
|
+
propMemo.list = props.id + 'datalist';
|
|
798
|
+
return propMemo;
|
|
799
|
+
}, [appliedUiSchemaOptions, props.id]);
|
|
800
|
+
const [inputText, onChange] = useDebouncedChange(handleChange, '', data, path);
|
|
801
|
+
const dataList = (React.createElement("datalist", { id: props.id + 'datalist' }, enumSchema.enum.map(optionValue => (React.createElement("option", { value: optionValue, key: optionValue })))));
|
|
802
|
+
return (React.createElement(Input, { type: 'text', value: inputText, onChange: onChange, className: className, id: id, disabled: !enabled, autoFocus: appliedUiSchemaOptions.focus, fullWidth: !appliedUiSchemaOptions.trim || maxLength === undefined, inputProps: inputProps, error: !isValid, endAdornment: dataList }));
|
|
803
|
+
};
|
|
804
|
+
class MaterialAnyOfStringOrEnumControl extends Control {
|
|
805
|
+
render() {
|
|
806
|
+
return (React.createElement(MaterialInputControl, Object.assign({}, this.props, { input: MuiAutocompleteInputText })));
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
const hasEnumAndText = (schemas) => {
|
|
810
|
+
const enumSchema = findEnumSchema(schemas);
|
|
811
|
+
const stringSchema = findTextSchema(schemas);
|
|
812
|
+
const remainingSchemas = schemas.filter(s => s !== enumSchema || s !== stringSchema);
|
|
813
|
+
const wrongType = remainingSchemas.find(s => s.type && s.type !== 'string');
|
|
814
|
+
return enumSchema && stringSchema && !wrongType;
|
|
815
|
+
};
|
|
816
|
+
const simpleAnyOf = and(uiTypeIs('Control'), schemaMatches(schema => schema.hasOwnProperty('anyOf') && hasEnumAndText(schema.anyOf)));
|
|
817
|
+
const materialAnyOfStringOrEnumControlTester = rankWith(5, simpleAnyOf);
|
|
818
|
+
var MaterialAnyOfStringOrEnumControl$1 = withJsonFormsControlProps(MaterialAnyOfStringOrEnumControl);
|
|
819
|
+
|
|
820
|
+
const MaterialOneOfEnumControl = (props) => {
|
|
821
|
+
const { config, uischema } = props;
|
|
822
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
823
|
+
return (React.createElement(MaterialInputControl, Object.assign({}, props, { input: appliedUiSchemaOptions.autocomplete === false ? MuiSelect : MuiAutocomplete })));
|
|
824
|
+
};
|
|
825
|
+
const materialOneOfEnumControlTester = rankWith(5, isOneOfEnumControl);
|
|
826
|
+
var MaterialOneOfEnumControl$1 = withJsonFormsOneOfEnumProps(MaterialOneOfEnumControl);
|
|
827
|
+
|
|
828
|
+
const MaterialOneOfRadioGroupControl = (props) => {
|
|
829
|
+
return React.createElement(MaterialRadioGroup, Object.assign({}, props));
|
|
830
|
+
};
|
|
831
|
+
const materialOneOfRadioGroupControlTester = rankWith(20, and(isOneOfEnumControl, optionIs('format', 'radio')));
|
|
832
|
+
var MaterialOneOfRadioGroupControl$1 = withJsonFormsOneOfEnumProps(MaterialOneOfRadioGroupControl);
|
|
833
|
+
|
|
834
|
+
const Unwrapped = {
|
|
835
|
+
MaterialBooleanControl: MaterialBooleanControl,
|
|
836
|
+
MaterialBooleanToggleControl: MaterialBooleanToggleControl,
|
|
837
|
+
MaterialEnumControl: MaterialEnumControl,
|
|
838
|
+
MaterialNativeControl: MaterialNativeControl,
|
|
839
|
+
MaterialDateControl: MaterialDateControl,
|
|
840
|
+
MaterialDateTimeControl: MaterialDateTimeControl,
|
|
841
|
+
MaterialTimeControl: MaterialTimeControl,
|
|
842
|
+
MaterialSliderControl: MaterialSliderControl,
|
|
843
|
+
MaterialRadioGroupControl: MaterialRadioGroupControl,
|
|
844
|
+
MaterialIntegerControl: MaterialIntegerControl,
|
|
845
|
+
MaterialNumberControl: MaterialNumberControl,
|
|
846
|
+
MaterialTextControl: MaterialTextControl,
|
|
847
|
+
MaterialAnyOfStringOrEnumControl: MaterialAnyOfStringOrEnumControl,
|
|
848
|
+
MaterialOneOfEnumControl: MaterialOneOfEnumControl,
|
|
849
|
+
MaterialOneOfRadioGroupControl: MaterialOneOfRadioGroupControl
|
|
850
|
+
};
|
|
851
|
+
|
|
852
|
+
const groupTester = rankWith(1, uiTypeIs('Group'));
|
|
853
|
+
const style = { marginBottom: '10px' };
|
|
854
|
+
const GroupComponent = React.memo(({ visible, enabled, uischema, ...props }) => {
|
|
855
|
+
const groupLayout = uischema;
|
|
856
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
857
|
+
React.createElement(Card, { style: style },
|
|
858
|
+
!isEmpty(groupLayout.label) && (React.createElement(CardHeader, { title: groupLayout.label })),
|
|
859
|
+
React.createElement(CardContent, null,
|
|
860
|
+
React.createElement(MaterialLayoutRenderer, Object.assign({}, props, { visible: visible, enabled: enabled, elements: groupLayout.elements }))))));
|
|
861
|
+
});
|
|
862
|
+
const MaterializedGroupLayoutRenderer = ({ uischema, schema, path, visible, enabled, renderers, cells, direction }) => {
|
|
863
|
+
const groupLayout = uischema;
|
|
864
|
+
return (React.createElement(GroupComponent, { elements: groupLayout.elements, schema: schema, path: path, direction: direction, visible: visible, enabled: enabled, uischema: uischema, renderers: renderers, cells: cells }));
|
|
865
|
+
};
|
|
866
|
+
var MaterialGroupLayout = withJsonFormsLayoutProps(MaterializedGroupLayoutRenderer);
|
|
867
|
+
const materialGroupTester = withIncreasedRank(1, groupTester);
|
|
868
|
+
|
|
869
|
+
const materialHorizontalLayoutTester = rankWith(2, uiTypeIs('HorizontalLayout'));
|
|
870
|
+
const MaterialHorizontalLayoutRenderer = ({ uischema, renderers, cells, schema, path, enabled, visible }) => {
|
|
871
|
+
const layout = uischema;
|
|
872
|
+
const childProps = {
|
|
873
|
+
elements: layout.elements,
|
|
874
|
+
schema,
|
|
875
|
+
path,
|
|
876
|
+
enabled,
|
|
877
|
+
direction: 'row',
|
|
878
|
+
visible
|
|
879
|
+
};
|
|
880
|
+
return React.createElement(MaterialLayoutRenderer, Object.assign({}, childProps, { renderers: renderers, cells: cells }));
|
|
881
|
+
};
|
|
882
|
+
var MaterialHorizontalLayout = withJsonFormsLayoutProps(MaterialHorizontalLayoutRenderer);
|
|
883
|
+
|
|
884
|
+
const materialVerticalLayoutTester = rankWith(1, uiTypeIs('VerticalLayout'));
|
|
885
|
+
const MaterialVerticalLayoutRenderer = ({ uischema, schema, path, enabled, visible, renderers, cells }) => {
|
|
886
|
+
const verticalLayout = uischema;
|
|
887
|
+
const childProps = {
|
|
888
|
+
elements: verticalLayout.elements,
|
|
889
|
+
schema,
|
|
890
|
+
path,
|
|
891
|
+
enabled,
|
|
892
|
+
direction: 'column',
|
|
893
|
+
visible
|
|
894
|
+
};
|
|
895
|
+
return React.createElement(MaterialLayoutRenderer, Object.assign({}, childProps, { renderers: renderers, cells: cells }));
|
|
896
|
+
};
|
|
897
|
+
var MaterialVerticalLayout = withJsonFormsLayoutProps(MaterialVerticalLayoutRenderer);
|
|
898
|
+
|
|
899
|
+
const isSingleLevelCategorization = and(uiTypeIs('Categorization'), (uischema) => {
|
|
900
|
+
const categorization = uischema;
|
|
901
|
+
return (categorization.elements &&
|
|
902
|
+
categorization.elements.reduce((acc, e) => acc && e.type === 'Category', true));
|
|
903
|
+
});
|
|
904
|
+
const materialCategorizationTester = rankWith(1, isSingleLevelCategorization);
|
|
905
|
+
const MaterialCategorizationLayoutRenderer = (props) => {
|
|
906
|
+
const { data, path, renderers, cells, schema, uischema, visible, enabled, selected, onChange, ajv } = props;
|
|
907
|
+
const categorization = uischema;
|
|
908
|
+
const [activeCategory, setActiveCategory] = useState(selected ?? 0);
|
|
909
|
+
const categories = categorization.elements.filter((category) => isVisible(category, data, undefined, ajv));
|
|
910
|
+
const childProps = {
|
|
911
|
+
elements: categories[activeCategory].elements,
|
|
912
|
+
schema,
|
|
913
|
+
path,
|
|
914
|
+
direction: 'column',
|
|
915
|
+
enabled,
|
|
916
|
+
visible,
|
|
917
|
+
renderers,
|
|
918
|
+
cells
|
|
919
|
+
};
|
|
920
|
+
const onTabChange = (_event, value) => {
|
|
921
|
+
if (onChange) {
|
|
922
|
+
onChange(value, activeCategory);
|
|
923
|
+
}
|
|
924
|
+
setActiveCategory(value);
|
|
925
|
+
};
|
|
926
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
927
|
+
React.createElement(AppBar, { position: 'static' },
|
|
928
|
+
React.createElement(Tabs, { value: activeCategory, onChange: onTabChange, textColor: 'inherit', indicatorColor: 'secondary', variant: 'scrollable' }, categories.map((e, idx) => (React.createElement(Tab, { key: idx, label: e.label }))))),
|
|
929
|
+
React.createElement("div", { style: { marginTop: '0.5em' } },
|
|
930
|
+
React.createElement(MaterialLayoutRenderer, Object.assign({}, childProps)))));
|
|
931
|
+
};
|
|
932
|
+
var MaterialCategorizationLayout = withJsonFormsLayoutProps(withAjvProps(MaterialCategorizationLayoutRenderer));
|
|
933
|
+
|
|
934
|
+
const iconStyle = { float: 'right' };
|
|
935
|
+
const ExpandPanelRendererComponent = (props) => {
|
|
936
|
+
const [labelHtmlId] = useState(createId('expand-panel'));
|
|
937
|
+
useEffect(() => {
|
|
938
|
+
return () => {
|
|
939
|
+
removeId(labelHtmlId);
|
|
940
|
+
};
|
|
941
|
+
}, [labelHtmlId]);
|
|
942
|
+
const { childLabel, childPath, index, expanded, moveDown, moveUp, enableMoveDown, enableMoveUp, handleExpansion, removeItems, path, rootSchema, schema, uischema, uischemas, renderers, cells, config } = props;
|
|
943
|
+
const foundUISchema = useMemo(() => findUISchema(uischemas, schema, uischema.scope, path, undefined, uischema, rootSchema), [uischemas, schema, uischema.scope, path, uischema, rootSchema]);
|
|
944
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
945
|
+
return (React.createElement(Accordion, { "aria-labelledby": labelHtmlId, expanded: expanded, onChange: handleExpansion(childPath) },
|
|
946
|
+
React.createElement(AccordionSummary, { expandIcon: React.createElement(ExpandMoreIcon, null) },
|
|
947
|
+
React.createElement(Grid, { container: true, alignItems: 'center' },
|
|
948
|
+
React.createElement(Grid, { item: true, xs: 7, md: 9 },
|
|
949
|
+
React.createElement(Grid, { container: true, alignItems: 'center' },
|
|
950
|
+
React.createElement(Grid, { item: true, xs: 2, md: 1 },
|
|
951
|
+
React.createElement(Avatar, { "aria-label": 'Index' }, index + 1)),
|
|
952
|
+
React.createElement(Grid, { item: true, xs: 10, md: 11 },
|
|
953
|
+
React.createElement("span", { id: labelHtmlId }, childLabel)))),
|
|
954
|
+
React.createElement(Grid, { item: true, xs: 5, md: 3 },
|
|
955
|
+
React.createElement(Grid, { container: true, justifyContent: 'flex-end' },
|
|
956
|
+
React.createElement(Grid, { item: true },
|
|
957
|
+
React.createElement(Grid, { container: true, direction: 'row', justifyContent: 'center', alignItems: 'center' },
|
|
958
|
+
appliedUiSchemaOptions.showSortButtons ? (React.createElement(Fragment, null,
|
|
959
|
+
React.createElement(Grid, { item: true },
|
|
960
|
+
React.createElement(IconButton, { onClick: moveUp(path, index), style: iconStyle, disabled: !enableMoveUp, "aria-label": `Move up`, size: 'large' },
|
|
961
|
+
React.createElement(ArrowUpward, null))),
|
|
962
|
+
React.createElement(Grid, { item: true },
|
|
963
|
+
React.createElement(IconButton, { onClick: moveDown(path, index), style: iconStyle, disabled: !enableMoveDown, "aria-label": `Move down`, size: 'large' },
|
|
964
|
+
React.createElement(ArrowDownward, null))))) : (''),
|
|
965
|
+
React.createElement(Grid, { item: true },
|
|
966
|
+
React.createElement(IconButton, { onClick: removeItems(path, [index]), style: iconStyle, "aria-label": `Delete`, size: 'large' },
|
|
967
|
+
React.createElement(DeleteIcon, null))))))))),
|
|
968
|
+
React.createElement(AccordionDetails, null,
|
|
969
|
+
React.createElement(JsonFormsDispatch, { schema: schema, uischema: foundUISchema, path: childPath, key: childPath, renderers: renderers, cells: cells }))));
|
|
970
|
+
};
|
|
971
|
+
const ExpandPanelRenderer = React.memo(ExpandPanelRendererComponent);
|
|
972
|
+
const ctxDispatchToExpandPanelProps = dispatch => ({
|
|
973
|
+
removeItems: useCallback((path, toDelete) => (event) => {
|
|
974
|
+
event.stopPropagation();
|
|
975
|
+
dispatch(update(path, array => {
|
|
976
|
+
toDelete
|
|
977
|
+
.sort()
|
|
978
|
+
.reverse()
|
|
979
|
+
.forEach(s => array.splice(s, 1));
|
|
980
|
+
return array;
|
|
981
|
+
}));
|
|
982
|
+
}, [dispatch]),
|
|
983
|
+
moveUp: useCallback((path, toMove) => (event) => {
|
|
984
|
+
event.stopPropagation();
|
|
985
|
+
dispatch(update(path, array => {
|
|
986
|
+
moveUp(array, toMove);
|
|
987
|
+
return array;
|
|
988
|
+
}));
|
|
989
|
+
}, [dispatch]),
|
|
990
|
+
moveDown: useCallback((path, toMove) => (event) => {
|
|
991
|
+
event.stopPropagation();
|
|
992
|
+
dispatch(update(path, array => {
|
|
993
|
+
moveDown(array, toMove);
|
|
994
|
+
return array;
|
|
995
|
+
}));
|
|
996
|
+
}, [dispatch])
|
|
997
|
+
});
|
|
998
|
+
const withContextToExpandPanelProps = (Component) => ({ ctx, props }) => {
|
|
999
|
+
const dispatchProps = ctxDispatchToExpandPanelProps(ctx.dispatch);
|
|
1000
|
+
const { childLabelProp, schema, path, index, uischemas } = props;
|
|
1001
|
+
const childPath = composePaths(path, `${index}`);
|
|
1002
|
+
const childData = Resolve.data(ctx.core.data, childPath);
|
|
1003
|
+
const childLabel = childLabelProp
|
|
1004
|
+
? get(childData, childLabelProp, '')
|
|
1005
|
+
: get(childData, getFirstPrimitiveProp(schema), '');
|
|
1006
|
+
return (React.createElement(Component, Object.assign({}, props, dispatchProps, { childLabel: childLabel, childPath: childPath, uischemas: uischemas })));
|
|
1007
|
+
};
|
|
1008
|
+
const withJsonFormsExpandPanelProps = (Component) => withJsonFormsContext(withContextToExpandPanelProps(Component));
|
|
1009
|
+
var ExpandPanelRenderer$1 = withJsonFormsExpandPanelProps(ExpandPanelRenderer);
|
|
1010
|
+
|
|
1011
|
+
const MaterialArrayLayoutComponent = (props) => {
|
|
1012
|
+
const [expanded, setExpanded] = useState(false);
|
|
1013
|
+
const innerCreateDefaultValue = useCallback(() => createDefaultValue(props.schema), [props.schema]);
|
|
1014
|
+
const handleChange = useCallback((panel) => (_event, expandedPanel) => {
|
|
1015
|
+
setExpanded(expandedPanel ? panel : false);
|
|
1016
|
+
}, []);
|
|
1017
|
+
const isExpanded = (index) => expanded === composePaths(props.path, `${index}`);
|
|
1018
|
+
const { data, path, schema, uischema, errors, addItem, renderers, cells, label, required, rootSchema, config, uischemas } = props;
|
|
1019
|
+
const appliedUiSchemaOptions = merge({}, config, props.uischema.options);
|
|
1020
|
+
return (React.createElement("div", null,
|
|
1021
|
+
React.createElement(ArrayLayoutToolbar, { label: computeLabel(label, required, appliedUiSchemaOptions.hideRequiredAsterisk), errors: errors, path: path, addItem: addItem, createDefault: innerCreateDefaultValue }),
|
|
1022
|
+
React.createElement("div", null, data > 0 ? (map(range(data), index => {
|
|
1023
|
+
return (React.createElement(ExpandPanelRenderer$1, { index: index, expanded: isExpanded(index), schema: schema, path: path, handleExpansion: handleChange, uischema: uischema, renderers: renderers, cells: cells, key: index, rootSchema: rootSchema, enableMoveUp: index != 0, enableMoveDown: index < data - 1, config: config, childLabelProp: appliedUiSchemaOptions.elementLabelProp, uischemas: uischemas }));
|
|
1024
|
+
})) : (React.createElement("p", null, "No data")))));
|
|
1025
|
+
};
|
|
1026
|
+
const MaterialArrayLayout$1 = React.memo(MaterialArrayLayoutComponent);
|
|
1027
|
+
|
|
1028
|
+
const MaterialArrayLayoutRenderer = ({ visible, enabled, id, uischema, schema, label, rootSchema, renderers, cells, data, path, errors, uischemas, addItem }) => {
|
|
1029
|
+
const addItemCb = useCallback((p, value) => addItem(p, value), [
|
|
1030
|
+
addItem
|
|
1031
|
+
]);
|
|
1032
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
1033
|
+
React.createElement(MaterialArrayLayout$1, { label: label, uischema: uischema, schema: schema, id: id, rootSchema: rootSchema, errors: errors, enabled: enabled, visible: visible, data: data, path: path, addItem: addItemCb, renderers: renderers, cells: cells, uischemas: uischemas })));
|
|
1034
|
+
};
|
|
1035
|
+
const materialArrayLayoutTester = rankWith(4, isObjectArrayWithNesting);
|
|
1036
|
+
var MaterialArrayLayout = withJsonFormsArrayLayoutProps(MaterialArrayLayoutRenderer);
|
|
1037
|
+
|
|
1038
|
+
const MaterialBooleanCell = (props) => {
|
|
1039
|
+
return React.createElement(MuiCheckbox, Object.assign({}, props));
|
|
1040
|
+
};
|
|
1041
|
+
const materialBooleanCellTester = rankWith(2, isBooleanControl);
|
|
1042
|
+
var MaterialBooleanCell$1 = withJsonFormsCellProps(MaterialBooleanCell);
|
|
1043
|
+
|
|
1044
|
+
const MaterialBooleanToggleCell = (props) => {
|
|
1045
|
+
return React.createElement(MuiToggle, Object.assign({}, props));
|
|
1046
|
+
};
|
|
1047
|
+
const materialBooleanToggleCellTester = rankWith(3, and(isBooleanControl, optionIs('toggle', true)));
|
|
1048
|
+
var MaterialBooleanToggleCell$1 = withJsonFormsCellProps(MaterialBooleanToggleCell);
|
|
1049
|
+
|
|
1050
|
+
const MaterialDateCell = (props) => {
|
|
1051
|
+
const { data, className, id, enabled, uischema, path, handleChange, config } = props;
|
|
1052
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
1053
|
+
return (React.createElement(Input$1, { type: 'date', value: data || '', onChange: ev => handleChange(path, ev.target.value), className: className, id: id, disabled: !enabled, autoFocus: appliedUiSchemaOptions.focus, fullWidth: true }));
|
|
1054
|
+
};
|
|
1055
|
+
const materialDateCellTester = rankWith(2, isDateControl);
|
|
1056
|
+
var MaterialDateCell$1 = withJsonFormsCellProps(MaterialDateCell);
|
|
1057
|
+
|
|
1058
|
+
const MaterialEnumCell = (props) => (React.createElement(MuiSelect, Object.assign({}, props)));
|
|
1059
|
+
const materialEnumCellTester = rankWith(2, isEnumControl);
|
|
1060
|
+
var MaterialEnumCell$1 = withJsonFormsEnumCellProps(MaterialEnumCell);
|
|
1061
|
+
|
|
1062
|
+
const MaterialIntegerCell = (props) => (React.createElement(MuiInputInteger, Object.assign({}, props)));
|
|
1063
|
+
const materialIntegerCellTester = rankWith(2, isIntegerControl);
|
|
1064
|
+
var MaterialIntegerCell$1 = withJsonFormsCellProps(MaterialIntegerCell);
|
|
1065
|
+
|
|
1066
|
+
const MaterialNumberCell = (props) => (React.createElement(MuiInputNumber, Object.assign({}, props)));
|
|
1067
|
+
const materialNumberCellTester = rankWith(2, isNumberControl);
|
|
1068
|
+
var MaterialNumberCell$1 = withJsonFormsCellProps(MaterialNumberCell);
|
|
1069
|
+
|
|
1070
|
+
const MaterialNumberFormatCell = (props) => React.createElement(MuiInputNumberFormat, Object.assign({}, props));
|
|
1071
|
+
const materialNumberFormatCellTester = rankWith(4, isNumberFormatControl);
|
|
1072
|
+
var MaterialNumberFormatCell$1 = withJsonFormsCellProps(MaterialNumberFormatCell);
|
|
1073
|
+
|
|
1074
|
+
const MaterialOneOfEnumCell = (props) => (React.createElement(MuiSelect, Object.assign({}, props)));
|
|
1075
|
+
const materialOneOfEnumCellTester = rankWith(2, isOneOfEnumControl);
|
|
1076
|
+
var MaterialOneOfEnumCell$1 = withJsonFormsOneOfEnumCellProps(MaterialOneOfEnumCell);
|
|
1077
|
+
|
|
1078
|
+
const MaterialTextCell = (props) => (React.createElement(MuiInputText, Object.assign({}, props)));
|
|
1079
|
+
const materialTextCellTester = rankWith(1, isStringControl);
|
|
1080
|
+
var MaterialTextCell$1 = withJsonFormsCellProps(MaterialTextCell);
|
|
1081
|
+
|
|
1082
|
+
const MaterialTimeCell = (props) => (React.createElement(MuiInputTime, Object.assign({}, props)));
|
|
1083
|
+
const materialTimeCellTester = rankWith(2, isTimeControl);
|
|
1084
|
+
var MaterialTimeCell$1 = withJsonFormsCellProps(MaterialTimeCell);
|
|
1085
|
+
|
|
1086
|
+
var CustomizableCells = /*#__PURE__*/Object.freeze({
|
|
1087
|
+
__proto__: null,
|
|
1088
|
+
MaterialBooleanCell: MaterialBooleanCell,
|
|
1089
|
+
MaterialDateCell: MaterialDateCell,
|
|
1090
|
+
MaterialEnumCell: MaterialEnumCell,
|
|
1091
|
+
MaterialIntegerCell: MaterialIntegerCell,
|
|
1092
|
+
MaterialNumberCell: MaterialNumberCell,
|
|
1093
|
+
MaterialNumberFormatCell: MaterialNumberFormatCell,
|
|
1094
|
+
MaterialOneOfEnumCell: MaterialOneOfEnumCell,
|
|
1095
|
+
MaterialTextCell: MaterialTextCell,
|
|
1096
|
+
MaterialTimeCell: MaterialTimeCell
|
|
1097
|
+
});
|
|
1098
|
+
|
|
1099
|
+
const materialCategorizationStepperTester = rankWith(2, and(uiTypeIs('Categorization'), categorizationHasCategory, optionIs('variant', 'stepper')));
|
|
1100
|
+
const MaterialCategorizationStepperLayoutRenderer = (props) => {
|
|
1101
|
+
const [activeCategory, setActiveCategory] = useState(0);
|
|
1102
|
+
const handleStep = (step) => {
|
|
1103
|
+
setActiveCategory(step);
|
|
1104
|
+
};
|
|
1105
|
+
const { data, path, renderers, schema, uischema, visible, cells, config, ajv } = props;
|
|
1106
|
+
const categorization = uischema;
|
|
1107
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
1108
|
+
const buttonWrapperStyle = {
|
|
1109
|
+
textAlign: 'right',
|
|
1110
|
+
width: '100%',
|
|
1111
|
+
margin: '1em auto'
|
|
1112
|
+
};
|
|
1113
|
+
const buttonNextStyle = {
|
|
1114
|
+
float: 'right'
|
|
1115
|
+
};
|
|
1116
|
+
const buttonStyle = {
|
|
1117
|
+
marginRight: '1em'
|
|
1118
|
+
};
|
|
1119
|
+
const categories = categorization.elements.filter((category) => isVisible(category, data, undefined, ajv));
|
|
1120
|
+
const childProps = {
|
|
1121
|
+
elements: categories[activeCategory].elements,
|
|
1122
|
+
schema,
|
|
1123
|
+
path,
|
|
1124
|
+
direction: 'column',
|
|
1125
|
+
visible,
|
|
1126
|
+
renderers,
|
|
1127
|
+
cells
|
|
1128
|
+
};
|
|
1129
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
1130
|
+
React.createElement(Stepper, { activeStep: activeCategory, nonLinear: true }, categories.map((e, idx) => (React.createElement(Step, { key: e.label },
|
|
1131
|
+
React.createElement(StepButton, { onClick: () => handleStep(idx) }, e.label))))),
|
|
1132
|
+
React.createElement("div", null,
|
|
1133
|
+
React.createElement(MaterialLayoutRenderer, Object.assign({}, childProps))),
|
|
1134
|
+
!!appliedUiSchemaOptions.showNavButtons ? (React.createElement("div", { style: buttonWrapperStyle },
|
|
1135
|
+
React.createElement(Button, { style: buttonNextStyle, variant: "contained", color: "primary", disabled: activeCategory >= categories.length - 1, onClick: () => handleStep(activeCategory + 1) }, "Next"),
|
|
1136
|
+
React.createElement(Button, { style: buttonStyle, color: "secondary", variant: "contained", disabled: activeCategory <= 0, onClick: () => handleStep(activeCategory - 1) }, "Previous"))) : (React.createElement(React.Fragment, null))));
|
|
1137
|
+
};
|
|
1138
|
+
var MaterialCategorizationStepperLayout = withJsonFormsLayoutProps(withAjvProps(MaterialCategorizationStepperLayoutRenderer));
|
|
1139
|
+
|
|
1140
|
+
const materialRenderers = [
|
|
1141
|
+
{
|
|
1142
|
+
tester: materialArrayControlTester,
|
|
1143
|
+
renderer: MaterialArrayControlRenderer$1
|
|
1144
|
+
},
|
|
1145
|
+
{ tester: materialBooleanControlTester, renderer: MaterialBooleanControl$1 },
|
|
1146
|
+
{ tester: materialBooleanToggleControlTester, renderer: MaterialBooleanToggleControl$1 },
|
|
1147
|
+
{ tester: materialNativeControlTester, renderer: MaterialNativeControl$1 },
|
|
1148
|
+
{ tester: materialEnumControlTester, renderer: MaterialEnumControl$1 },
|
|
1149
|
+
{ tester: materialIntegerControlTester, renderer: MaterialIntegerControl$1 },
|
|
1150
|
+
{ tester: materialNumberControlTester, renderer: MaterialNumberControl$1 },
|
|
1151
|
+
{ tester: materialTextControlTester, renderer: MaterialTextControl$1 },
|
|
1152
|
+
{ tester: materialDateTimeControlTester, renderer: MaterialDateTimeControl$1 },
|
|
1153
|
+
{ tester: materialDateControlTester, renderer: MaterialDateControl$1 },
|
|
1154
|
+
{ tester: materialTimeControlTester, renderer: MaterialTimeControl$1 },
|
|
1155
|
+
{ tester: materialSliderControlTester, renderer: MaterialSliderControl$1 },
|
|
1156
|
+
{ tester: materialObjectControlTester, renderer: MaterialObjectRenderer$1 },
|
|
1157
|
+
{ tester: materialAllOfControlTester, renderer: MaterialAllOfRenderer$1 },
|
|
1158
|
+
{ tester: materialAnyOfControlTester, renderer: MaterialAnyOfRenderer$1 },
|
|
1159
|
+
{ tester: materialOneOfControlTester, renderer: MaterialOneOfRenderer$1 },
|
|
1160
|
+
{
|
|
1161
|
+
tester: materialRadioGroupControlTester,
|
|
1162
|
+
renderer: MaterialRadioGroupControl$1
|
|
1163
|
+
},
|
|
1164
|
+
{
|
|
1165
|
+
tester: materialOneOfRadioGroupControlTester,
|
|
1166
|
+
renderer: MaterialOneOfRadioGroupControl$1
|
|
1167
|
+
},
|
|
1168
|
+
{ tester: materialOneOfEnumControlTester, renderer: MaterialOneOfEnumControl$1 },
|
|
1169
|
+
{ tester: materialGroupTester, renderer: MaterialGroupLayout },
|
|
1170
|
+
{
|
|
1171
|
+
tester: materialHorizontalLayoutTester,
|
|
1172
|
+
renderer: MaterialHorizontalLayout
|
|
1173
|
+
},
|
|
1174
|
+
{ tester: materialVerticalLayoutTester, renderer: MaterialVerticalLayout },
|
|
1175
|
+
{
|
|
1176
|
+
tester: materialCategorizationTester,
|
|
1177
|
+
renderer: MaterialCategorizationLayout
|
|
1178
|
+
},
|
|
1179
|
+
{
|
|
1180
|
+
tester: materialCategorizationStepperTester,
|
|
1181
|
+
renderer: MaterialCategorizationStepperLayout
|
|
1182
|
+
},
|
|
1183
|
+
{ tester: materialArrayLayoutTester, renderer: MaterialArrayLayout },
|
|
1184
|
+
{ tester: materialLabelRendererTester, renderer: MaterialLabelRenderer$1 },
|
|
1185
|
+
{
|
|
1186
|
+
tester: materialListWithDetailTester,
|
|
1187
|
+
renderer: MaterialListWithDetailRenderer$1
|
|
1188
|
+
},
|
|
1189
|
+
{
|
|
1190
|
+
tester: materialAnyOfStringOrEnumControlTester,
|
|
1191
|
+
renderer: MaterialAnyOfStringOrEnumControl$1
|
|
1192
|
+
},
|
|
1193
|
+
{
|
|
1194
|
+
tester: materialEnumArrayRendererTester,
|
|
1195
|
+
renderer: MaterialEnumArrayRenderer$1
|
|
1196
|
+
}
|
|
1197
|
+
];
|
|
1198
|
+
const materialCells = [
|
|
1199
|
+
{ tester: materialBooleanCellTester, cell: MaterialBooleanCell$1 },
|
|
1200
|
+
{ tester: materialBooleanToggleCellTester, cell: MaterialBooleanToggleCell$1 },
|
|
1201
|
+
{ tester: materialDateCellTester, cell: MaterialDateCell$1 },
|
|
1202
|
+
{ tester: materialEnumCellTester, cell: MaterialEnumCell$1 },
|
|
1203
|
+
{ tester: materialIntegerCellTester, cell: MaterialIntegerCell$1 },
|
|
1204
|
+
{ tester: materialNumberCellTester, cell: MaterialNumberCell$1 },
|
|
1205
|
+
{ tester: materialNumberFormatCellTester, cell: MaterialNumberFormatCell$1 },
|
|
1206
|
+
{ tester: materialOneOfEnumCellTester, cell: MaterialOneOfEnumCell$1 },
|
|
1207
|
+
{ tester: materialTextCellTester, cell: MaterialTextCell$1 },
|
|
1208
|
+
{ tester: materialTimeCellTester, cell: MaterialTimeCell$1 }
|
|
1209
|
+
];
|
|
1210
|
+
|
|
1211
|
+
export { CustomizableCells as Customizable, MaterialAllOfRenderer$1 as MaterialAllOfRenderer, MaterialAnyOfRenderer$1 as MaterialAnyOfRenderer, MaterialAnyOfStringOrEnumControl$1 as MaterialAnyOfStringOrEnumControl, MaterialArrayControlRenderer$1 as MaterialArrayControlRenderer, MaterialArrayLayout, MaterialBooleanCell$1 as MaterialBooleanCell, MaterialBooleanControl$1 as MaterialBooleanControl, MaterialBooleanToggleCell$1 as MaterialBooleanToggleCell, MaterialBooleanToggleControl$1 as MaterialBooleanToggleControl, MaterialCategorizationLayout, MaterialDateCell$1 as MaterialDateCell, MaterialDateControl$1 as MaterialDateControl, MaterialDateTimeControl$1 as MaterialDateTimeControl, MaterialEnumArrayRenderer$1 as MaterialEnumArrayRenderer, MaterialEnumCell$1 as MaterialEnumCell, MaterialEnumControl$1 as MaterialEnumControl, MaterialGroupLayout, MaterialHorizontalLayout, MaterialInputControl, MaterialIntegerCell$1 as MaterialIntegerCell, MaterialIntegerControl$1 as MaterialIntegerControl, MaterialLayoutRenderer, MaterialNativeControl$1 as MaterialNativeControl, MaterialNumberCell$1 as MaterialNumberCell, MaterialNumberControl$1 as MaterialNumberControl, MaterialNumberFormatCell$1 as MaterialNumberFormatCell, MaterialObjectRenderer$1 as MaterialObjectRenderer, MaterialOneOfEnumCell$1 as MaterialOneOfEnumCell, MaterialOneOfEnumControl$1 as MaterialOneOfEnumControl, MaterialOneOfRadioGroupControl$1 as MaterialOneOfRadioGroupControl, MaterialOneOfRenderer$1 as MaterialOneOfRenderer, MaterialRadioGroupControl$1 as MaterialRadioGroupControl, MaterialSliderControl$1 as MaterialSliderControl, MaterialTextCell$1 as MaterialTextCell, MaterialTextControl$1 as MaterialTextControl, MaterialTimeCell$1 as MaterialTimeCell, MaterialTimeControl$1 as MaterialTimeControl, MaterialVerticalLayout, MuiCheckbox, MuiInputInteger, MuiInputNumber, MuiInputNumberFormat, MuiInputText, MuiInputTime, MuiSelect, Unwrapped, createOnChangeHandler, getData, materialAllOfControlTester, materialAnyOfControlTester, materialAnyOfStringOrEnumControlTester, materialArrayControlTester, materialArrayLayoutTester, materialBooleanCellTester, materialBooleanControlTester, materialBooleanToggleCellTester, materialBooleanToggleControlTester, materialCategorizationTester, materialCells, materialDateCellTester, materialDateControlTester, materialDateTimeControlTester, materialEnumArrayRendererTester, materialEnumCellTester, materialEnumControlTester, materialGroupTester, materialHorizontalLayoutTester, materialIntegerCellTester, materialIntegerControlTester, materialNativeControlTester, materialNumberCellTester, materialNumberControlTester, materialNumberFormatCellTester, materialObjectControlTester, materialOneOfControlTester, materialOneOfEnumCellTester, materialOneOfEnumControlTester, materialOneOfRadioGroupControlTester, materialRadioGroupControlTester, materialRenderers, materialSliderControlTester, materialTextCellTester, materialTextControlTester, materialTimeCellTester, materialTimeControlTester, materialVerticalLayoutTester, renderLayoutElements, useDebouncedChange, useFocus, withAjvProps };
|
|
1212
|
+
//# sourceMappingURL=jsonforms-react-material.esm.js.map
|