@data-driven-forms/mui-component-mapper 3.15.2 → 3.16.0-v5-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/checkbox/checkbox.d.ts +1 -1
- package/checkbox/checkbox.js +6 -6
- package/date-picker/date-picker.d.ts +2 -5
- package/date-picker/date-picker.js +16 -21
- package/dual-list-select/dual-list-select.d.ts +1 -1
- package/dual-list-select/dual-list-select.js +189 -185
- package/esm/checkbox/checkbox.js +6 -6
- package/esm/date-picker/date-picker.js +15 -20
- package/esm/dual-list-select/dual-list-select.js +187 -183
- package/esm/field-array/field-array.js +42 -36
- package/esm/form-field-grid/form-field-grid.js +11 -9
- package/esm/form-template/form-template.js +52 -53
- package/esm/multiple-chioce-list/multiple-choice-list.js +10 -8
- package/esm/plain-text/plain-text.js +1 -1
- package/esm/radio/radio.js +30 -29
- package/esm/select/select.js +4 -4
- package/esm/slider/slider.js +6 -6
- package/esm/sub-form/sub-form.js +27 -24
- package/esm/switch/switch.js +6 -6
- package/esm/tabs/tabs.js +59 -41
- package/esm/text-field/text-field.js +1 -1
- package/esm/textarea/textarea.js +1 -1
- package/esm/time-picker/time-picker.js +20 -24
- package/esm/wizard/step-buttons.js +40 -37
- package/esm/wizard/wizard-nav.js +23 -21
- package/esm/wizard/wizard.js +21 -22
- package/field-array/field-array.d.ts +1 -1
- package/field-array/field-array.js +43 -37
- package/form-field-grid/form-field-grid.d.ts +1 -1
- package/form-field-grid/form-field-grid.js +13 -10
- package/form-template/form-template.js +54 -54
- package/multiple-chioce-list/multiple-choice-list.d.ts +1 -1
- package/multiple-chioce-list/multiple-choice-list.js +10 -8
- package/package.json +13 -16
- package/plain-text/plain-text.d.ts +1 -1
- package/plain-text/plain-text.js +1 -1
- package/radio/radio.d.ts +1 -1
- package/radio/radio.js +32 -31
- package/select/select.d.ts +2 -2
- package/select/select.js +4 -4
- package/slider/slider.d.ts +1 -1
- package/slider/slider.js +6 -6
- package/sub-form/sub-form.d.ts +1 -1
- package/sub-form/sub-form.js +29 -25
- package/switch/switch.d.ts +1 -1
- package/switch/switch.js +6 -6
- package/tabs/tabs.d.ts +3 -1
- package/tabs/tabs.js +58 -37
- package/text-field/text-field.d.ts +1 -1
- package/text-field/text-field.js +1 -1
- package/textarea/textarea.d.ts +1 -1
- package/textarea/textarea.js +1 -1
- package/time-picker/time-picker.d.ts +2 -5
- package/time-picker/time-picker.js +21 -25
- package/wizard/step-buttons.js +42 -37
- package/wizard/wizard-nav.js +25 -22
- package/wizard/wizard.d.ts +1 -1
- package/wizard/wizard.js +22 -23
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import
|
|
5
|
-
import MomentUtils from '@date-io/moment';
|
|
4
|
+
import MUIDatePicker from "@mui/lab/DatePicker";
|
|
6
5
|
import FormFieldGrid from '../form-field-grid/form-field-grid';
|
|
7
6
|
import { validationError } from '../validation-error/validation-error';
|
|
8
7
|
import { meta, input } from '@data-driven-forms/common/prop-types-templates';
|
|
9
8
|
import useFieldApi from "@data-driven-forms/react-form-renderer/use-field-api";
|
|
9
|
+
import TextField from "@mui/material/TextField";
|
|
10
10
|
|
|
11
11
|
var DatePicker = function DatePicker(props) {
|
|
12
12
|
var _useFieldApi = useFieldApi(props),
|
|
@@ -20,29 +20,27 @@ var DatePicker = function DatePicker(props) {
|
|
|
20
20
|
description = _useFieldApi.description,
|
|
21
21
|
validateOnMount = _useFieldApi.validateOnMount,
|
|
22
22
|
meta = _useFieldApi.meta,
|
|
23
|
-
_useFieldApi$locale = _useFieldApi.locale,
|
|
24
|
-
locale = _useFieldApi$locale === void 0 ? 'en' : _useFieldApi$locale,
|
|
25
23
|
FormFieldGridProps = _useFieldApi.FormFieldGridProps,
|
|
26
|
-
MuiPickersUtilsProviderProps = _useFieldApi.MuiPickersUtilsProviderProps,
|
|
27
24
|
DatePickerProps = _useFieldApi.DatePickerProps;
|
|
28
25
|
|
|
29
26
|
var invalid = validationError(meta, validateOnMount);
|
|
30
|
-
return /*#__PURE__*/React.createElement(FormFieldGrid, FormFieldGridProps, /*#__PURE__*/React.createElement(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
return /*#__PURE__*/React.createElement(FormFieldGrid, FormFieldGridProps, /*#__PURE__*/React.createElement(MUIDatePicker, _extends({
|
|
28
|
+
renderInput: function renderInput(props) {
|
|
29
|
+
return /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
|
|
30
|
+
fullWidth: true,
|
|
31
|
+
margin: "normal",
|
|
32
|
+
label: label,
|
|
33
|
+
helperText: invalid || (meta.touched || validateOnMount) && meta.warning || helperText || description,
|
|
34
|
+
placeholder: placeholder,
|
|
35
|
+
required: isRequired,
|
|
36
|
+
error: !!invalid
|
|
37
|
+
}));
|
|
38
|
+
},
|
|
38
39
|
disabled: isDisabled || isReadOnly,
|
|
39
|
-
placeholder: placeholder,
|
|
40
|
-
required: isRequired,
|
|
41
|
-
error: !!invalid,
|
|
42
40
|
readOnly: isReadOnly
|
|
43
41
|
}, input, {
|
|
44
42
|
value: input.value || null
|
|
45
|
-
}, DatePickerProps)))
|
|
43
|
+
}, DatePickerProps)));
|
|
46
44
|
};
|
|
47
45
|
|
|
48
46
|
DatePicker.propTypes = {
|
|
@@ -55,15 +53,12 @@ DatePicker.propTypes = {
|
|
|
55
53
|
label: PropTypes.node,
|
|
56
54
|
helperText: PropTypes.node,
|
|
57
55
|
validateOnMount: PropTypes.bool,
|
|
58
|
-
locale: PropTypes.string,
|
|
59
56
|
description: PropTypes.node,
|
|
60
57
|
FormFieldGridProps: PropTypes.object,
|
|
61
|
-
MuiPickersUtilsProviderProps: PropTypes.object,
|
|
62
58
|
DatePickerProps: PropTypes.object
|
|
63
59
|
};
|
|
64
60
|
DatePicker.defaultProps = {
|
|
65
61
|
FormFieldGridProps: {},
|
|
66
|
-
MuiPickersUtilsProviderProps: {},
|
|
67
62
|
DatePickerProps: {}
|
|
68
63
|
};
|
|
69
64
|
export default DatePicker;
|
|
@@ -1,81 +1,85 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
|
|
4
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
5
5
|
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
+
import styled from "@mui/material/styled";
|
|
9
10
|
import PropTypes from 'prop-types';
|
|
10
11
|
import clsx from 'clsx';
|
|
11
|
-
import Grid from "@material
|
|
12
|
-
import List from "@material
|
|
13
|
-
import ListItem from "@material
|
|
14
|
-
import ListItemText from "@material
|
|
15
|
-
import ListItemIcon from "@material
|
|
16
|
-
import Checkbox from "@material
|
|
17
|
-
import ListItemSecondaryAction from "@material
|
|
18
|
-
import IconButton from "@material
|
|
19
|
-
import FormControl from "@material
|
|
20
|
-
import FormLabel from "@material
|
|
21
|
-
import FormHelperText from "@material
|
|
22
|
-
import Toolbar from "@material
|
|
23
|
-
import TextField from "@material
|
|
24
|
-
import Typography from "@material
|
|
25
|
-
import Paper from "@material
|
|
26
|
-
import Button from "@material
|
|
27
|
-
import SortIcon from '@
|
|
28
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
12
|
+
import Grid from "@mui/material/Grid";
|
|
13
|
+
import List from "@mui/material/List";
|
|
14
|
+
import ListItem from "@mui/material/ListItem";
|
|
15
|
+
import ListItemText from "@mui/material/ListItemText";
|
|
16
|
+
import ListItemIcon from "@mui/material/ListItemIcon";
|
|
17
|
+
import Checkbox from "@mui/material/Checkbox";
|
|
18
|
+
import ListItemSecondaryAction from "@mui/material/ListItemSecondaryAction";
|
|
19
|
+
import IconButton from "@mui/material/IconButton";
|
|
20
|
+
import FormControl from "@mui/material/FormControl";
|
|
21
|
+
import FormLabel from "@mui/material/FormLabel";
|
|
22
|
+
import FormHelperText from "@mui/material/FormHelperText";
|
|
23
|
+
import Toolbar from "@mui/material/Toolbar";
|
|
24
|
+
import TextField from "@mui/material/TextField";
|
|
25
|
+
import Typography from "@mui/material/Typography";
|
|
26
|
+
import Paper from "@mui/material/Paper";
|
|
27
|
+
import Button from "@mui/material/Button";
|
|
28
|
+
import SortIcon from '@mui/icons-material/ArrowUpward';
|
|
29
29
|
import DualListSelectCommon from '@data-driven-forms/common/dual-list-select';
|
|
30
30
|
import FormFieldGrid from '../form-field-grid/form-field-grid';
|
|
31
31
|
import { validationError } from '../validation-error/validation-error';
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
32
|
+
var PREFIX = 'DualListSelectWrapper';
|
|
33
|
+
var classes = {
|
|
34
|
+
allToLeftIcon: "".concat(PREFIX, "-allToLeftIcon"),
|
|
35
|
+
upsideDown: "".concat(PREFIX, "-upsideDown"),
|
|
36
|
+
list: "".concat(PREFIX, "-list"),
|
|
37
|
+
button: "".concat(PREFIX, "-button"),
|
|
38
|
+
buttonsGrid: "".concat(PREFIX, "-buttonsGrid"),
|
|
39
|
+
filter: "".concat(PREFIX, "-filter"),
|
|
40
|
+
toolbar: "".concat(PREFIX, "-toolbar")
|
|
41
|
+
};
|
|
42
|
+
var StyledDualListSelect = styled(FormFieldGrid)(function (_ref) {
|
|
43
|
+
var _ref2;
|
|
44
|
+
|
|
45
|
+
var theme = _ref.theme;
|
|
46
|
+
return _ref2 = {}, _defineProperty(_ref2, "& .".concat(classes.allToLeftIcon), {
|
|
47
|
+
transform: 'scaleX(-1)'
|
|
48
|
+
}), _defineProperty(_ref2, "& .".concat(classes.upsideDown), {
|
|
49
|
+
transform: 'scaleY(-1)'
|
|
50
|
+
}), _defineProperty(_ref2, "& .".concat(classes.list), {
|
|
51
|
+
height: 300,
|
|
52
|
+
overflow: 'auto'
|
|
53
|
+
}), _defineProperty(_ref2, "& .".concat(classes.button), {
|
|
54
|
+
display: 'flex',
|
|
55
|
+
justifyContent: 'center',
|
|
56
|
+
margin: theme.spacing(0.5, 0)
|
|
57
|
+
}), _defineProperty(_ref2, "& .".concat(classes.buttonsGrid), {
|
|
58
|
+
height: '100%',
|
|
59
|
+
alignContent: 'center'
|
|
60
|
+
}), _defineProperty(_ref2, "& .".concat(classes.filter), {
|
|
61
|
+
width: '100%'
|
|
62
|
+
}), _defineProperty(_ref2, "& .".concat(classes.toolbar), {
|
|
63
|
+
paddingLeft: 16,
|
|
64
|
+
paddingRight: 16
|
|
65
|
+
}), _ref2;
|
|
61
66
|
});
|
|
62
67
|
|
|
63
|
-
var ListInternal = function ListInternal(
|
|
64
|
-
var value =
|
|
65
|
-
optionClick =
|
|
66
|
-
noOptionsTitle =
|
|
67
|
-
filterValue =
|
|
68
|
-
filterValueText =
|
|
69
|
-
selectedValues =
|
|
70
|
-
ListProps =
|
|
71
|
-
ListItemProps =
|
|
72
|
-
ListItemIconProps =
|
|
73
|
-
ListItemTextProps =
|
|
74
|
-
ListItemSecondaryActionProps =
|
|
75
|
-
checkboxVariant =
|
|
76
|
-
PaperProps =
|
|
77
|
-
LeftPaperProps =
|
|
78
|
-
var classes = useStyles();
|
|
68
|
+
var ListInternal = function ListInternal(_ref3) {
|
|
69
|
+
var value = _ref3.value,
|
|
70
|
+
optionClick = _ref3.optionClick,
|
|
71
|
+
noOptionsTitle = _ref3.noOptionsTitle,
|
|
72
|
+
filterValue = _ref3.filterValue,
|
|
73
|
+
filterValueText = _ref3.filterValueText,
|
|
74
|
+
selectedValues = _ref3.selectedValues,
|
|
75
|
+
ListProps = _ref3.ListProps,
|
|
76
|
+
ListItemProps = _ref3.ListItemProps,
|
|
77
|
+
ListItemIconProps = _ref3.ListItemIconProps,
|
|
78
|
+
ListItemTextProps = _ref3.ListItemTextProps,
|
|
79
|
+
ListItemSecondaryActionProps = _ref3.ListItemSecondaryActionProps,
|
|
80
|
+
checkboxVariant = _ref3.checkboxVariant,
|
|
81
|
+
PaperProps = _ref3.PaperProps,
|
|
82
|
+
LeftPaperProps = _ref3.LeftPaperProps;
|
|
79
83
|
return /*#__PURE__*/React.createElement(Paper, _extends({}, PaperProps, LeftPaperProps, {
|
|
80
84
|
className: clsx(PaperProps && PaperProps.className, LeftPaperProps && LeftPaperProps.className)
|
|
81
85
|
}), /*#__PURE__*/React.createElement(List, _extends({
|
|
@@ -89,16 +93,16 @@ var ListInternal = function ListInternal(_ref) {
|
|
|
89
93
|
disabled: true
|
|
90
94
|
}, ListItemProps), /*#__PURE__*/React.createElement(ListItemText, {
|
|
91
95
|
primary: filterValue ? filterValueText : noOptionsTitle
|
|
92
|
-
})), value.length > 0 && value.map(function (
|
|
93
|
-
var value =
|
|
94
|
-
label =
|
|
95
|
-
icon =
|
|
96
|
-
isCheckbox =
|
|
97
|
-
secondaryActions =
|
|
98
|
-
ListItemPropsItem =
|
|
99
|
-
ListItemIconPropsItem =
|
|
100
|
-
ListItemTextPropsItem =
|
|
101
|
-
ListItemSecondaryActionPropsItem =
|
|
96
|
+
})), value.length > 0 && value.map(function (_ref4) {
|
|
97
|
+
var value = _ref4.value,
|
|
98
|
+
label = _ref4.label,
|
|
99
|
+
icon = _ref4.icon,
|
|
100
|
+
isCheckbox = _ref4.isCheckbox,
|
|
101
|
+
secondaryActions = _ref4.secondaryActions,
|
|
102
|
+
ListItemPropsItem = _ref4.ListItemProps,
|
|
103
|
+
ListItemIconPropsItem = _ref4.ListItemIconProps,
|
|
104
|
+
ListItemTextPropsItem = _ref4.ListItemTextProps,
|
|
105
|
+
ListItemSecondaryActionPropsItem = _ref4.ListItemSecondaryActionProps;
|
|
102
106
|
return /*#__PURE__*/React.createElement(ListItem, _extends({
|
|
103
107
|
button: true,
|
|
104
108
|
key: value,
|
|
@@ -143,21 +147,20 @@ ListInternal.defaultProps = {
|
|
|
143
147
|
ListProps: {}
|
|
144
148
|
};
|
|
145
149
|
|
|
146
|
-
var ToolbarInternal = function ToolbarInternal(
|
|
147
|
-
var ToolbarProps =
|
|
148
|
-
LeftToolbarProps =
|
|
149
|
-
filterOptions =
|
|
150
|
-
filterOptionsTitle =
|
|
151
|
-
FilterFieldProps =
|
|
152
|
-
sortOptions =
|
|
153
|
-
SortIconButtonProps =
|
|
154
|
-
SortIconProps =
|
|
155
|
-
LeftSortIconProps =
|
|
156
|
-
LeftFilterFieldProps =
|
|
157
|
-
LeftSortIconButtonProps =
|
|
158
|
-
filter =
|
|
159
|
-
sortDesc =
|
|
160
|
-
var classes = useStyles();
|
|
150
|
+
var ToolbarInternal = function ToolbarInternal(_ref5) {
|
|
151
|
+
var ToolbarProps = _ref5.ToolbarProps,
|
|
152
|
+
LeftToolbarProps = _ref5.LeftToolbarProps,
|
|
153
|
+
filterOptions = _ref5.filterOptions,
|
|
154
|
+
filterOptionsTitle = _ref5.filterOptionsTitle,
|
|
155
|
+
FilterFieldProps = _ref5.FilterFieldProps,
|
|
156
|
+
sortOptions = _ref5.sortOptions,
|
|
157
|
+
SortIconButtonProps = _ref5.SortIconButtonProps,
|
|
158
|
+
SortIconProps = _ref5.SortIconProps,
|
|
159
|
+
LeftSortIconProps = _ref5.LeftSortIconProps,
|
|
160
|
+
LeftFilterFieldProps = _ref5.LeftFilterFieldProps,
|
|
161
|
+
LeftSortIconButtonProps = _ref5.LeftSortIconButtonProps,
|
|
162
|
+
filter = _ref5.filter,
|
|
163
|
+
sortDesc = _ref5.sortDesc;
|
|
161
164
|
return /*#__PURE__*/React.createElement(Toolbar, _extends({
|
|
162
165
|
variant: "dense"
|
|
163
166
|
}, ToolbarProps, LeftToolbarProps, {
|
|
@@ -166,8 +169,8 @@ var ToolbarInternal = function ToolbarInternal(_ref3) {
|
|
|
166
169
|
edge: "start",
|
|
167
170
|
id: "options-search",
|
|
168
171
|
label: filterOptionsTitle,
|
|
169
|
-
onChange: function onChange(
|
|
170
|
-
var value =
|
|
172
|
+
onChange: function onChange(_ref6) {
|
|
173
|
+
var value = _ref6.target.value;
|
|
171
174
|
return filterOptions(value);
|
|
172
175
|
},
|
|
173
176
|
value: filter,
|
|
@@ -179,7 +182,9 @@ var ToolbarInternal = function ToolbarInternal(_ref3) {
|
|
|
179
182
|
edge: "end",
|
|
180
183
|
onClick: sortOptions,
|
|
181
184
|
color: "inherit"
|
|
182
|
-
}, SortIconButtonProps, LeftSortIconButtonProps
|
|
185
|
+
}, SortIconButtonProps, LeftSortIconButtonProps, {
|
|
186
|
+
size: "large"
|
|
187
|
+
}), /*#__PURE__*/React.createElement(SortIcon, _extends({}, SortIconProps, LeftSortIconProps, {
|
|
183
188
|
className: clsx(!sortDesc && classes.upsideDown, SortIconProps && SortIconProps.className, LeftSortIconProps && LeftSortIconProps.className)
|
|
184
189
|
}))));
|
|
185
190
|
};
|
|
@@ -201,99 +206,98 @@ ToolbarInternal.propTypes = {
|
|
|
201
206
|
sortDesc: PropTypes.bool
|
|
202
207
|
};
|
|
203
208
|
|
|
204
|
-
var DualListSelect = function DualListSelect(
|
|
205
|
-
var handleOptionsClick =
|
|
206
|
-
rightValues =
|
|
207
|
-
noValueTitle =
|
|
208
|
-
filterValueText =
|
|
209
|
-
leftValues =
|
|
210
|
-
noOptionsTitle =
|
|
211
|
-
state =
|
|
212
|
-
filterOptionsText =
|
|
213
|
-
handleValuesClick =
|
|
214
|
-
handleMoveRight =
|
|
215
|
-
moveRightTitle =
|
|
216
|
-
handleClearLeftValues =
|
|
217
|
-
moveAllRightTitle =
|
|
218
|
-
handleClearRightValues =
|
|
219
|
-
moveAllLeftTitle =
|
|
220
|
-
handleMoveLeft =
|
|
221
|
-
moveLeftTitle =
|
|
222
|
-
allToRight =
|
|
223
|
-
allToLeft =
|
|
224
|
-
checkboxVariant =
|
|
225
|
-
isRequired =
|
|
226
|
-
meta =
|
|
227
|
-
validateOnMount =
|
|
228
|
-
label =
|
|
229
|
-
helperText =
|
|
230
|
-
description =
|
|
231
|
-
filterOptionsTitle =
|
|
232
|
-
leftTitle =
|
|
233
|
-
filterOptions =
|
|
234
|
-
sortOptions =
|
|
235
|
-
sortValues =
|
|
236
|
-
filterValueTitle =
|
|
237
|
-
filterValues =
|
|
238
|
-
rightTitle =
|
|
239
|
-
isFilterable =
|
|
240
|
-
FormFieldGridProps =
|
|
241
|
-
InternalGridProps =
|
|
242
|
-
ListGridProps =
|
|
243
|
-
LeftListGridProps =
|
|
244
|
-
ListProps =
|
|
245
|
-
LeftListProps =
|
|
246
|
-
ButtonsGridProps =
|
|
247
|
-
ButtonsInternalGridProps =
|
|
248
|
-
ButtonGridProps =
|
|
249
|
-
ToRightGridProps =
|
|
250
|
-
IconButtonProps =
|
|
251
|
-
ToRightIconButtonProps =
|
|
252
|
-
AllToRightGridProps =
|
|
253
|
-
AllToRightIconButtonProps =
|
|
254
|
-
AllToLeftGridProps =
|
|
255
|
-
AllToLeftIconButtonProps =
|
|
256
|
-
ToLeftGridProps =
|
|
257
|
-
ToLeftIconButtonProps =
|
|
258
|
-
RightListGridProps =
|
|
259
|
-
RightListProps =
|
|
260
|
-
ListItemProps =
|
|
261
|
-
ListItemIconProps =
|
|
262
|
-
ListItemTextProps =
|
|
263
|
-
ListItemSecondaryActionProps =
|
|
264
|
-
LeftListItemProps =
|
|
265
|
-
LeftListItemIconProps =
|
|
266
|
-
LeftItemTextProps =
|
|
267
|
-
LeftItemSecondaryActionProps =
|
|
268
|
-
RightListItemProps =
|
|
269
|
-
RightListItemIconProps =
|
|
270
|
-
RightItemTextProps =
|
|
271
|
-
RightItemSecondaryActionProps =
|
|
272
|
-
FormControlProps =
|
|
273
|
-
FormLabelProps =
|
|
274
|
-
FormHelperTextProps =
|
|
275
|
-
TitleProps =
|
|
276
|
-
ToolbarProps =
|
|
277
|
-
FilterFieldProps =
|
|
278
|
-
SortIconButtonProps =
|
|
279
|
-
SortIconProps =
|
|
280
|
-
LeftToolbarProps =
|
|
281
|
-
LeftFilterFieldProps =
|
|
282
|
-
LeftSortIconButtonProps =
|
|
283
|
-
LeftSortIconProps =
|
|
284
|
-
LeftTitleProps =
|
|
285
|
-
RightToolbarProps =
|
|
286
|
-
RightFilterFieldProps =
|
|
287
|
-
RightSortIconButtonProps =
|
|
288
|
-
RightSortIconProps =
|
|
289
|
-
RightTitleProps =
|
|
290
|
-
PaperProps =
|
|
291
|
-
LeftPaperProps =
|
|
292
|
-
RightPaperProps =
|
|
293
|
-
var classes = useStyles();
|
|
209
|
+
var DualListSelect = function DualListSelect(_ref7) {
|
|
210
|
+
var handleOptionsClick = _ref7.handleOptionsClick,
|
|
211
|
+
rightValues = _ref7.rightValues,
|
|
212
|
+
noValueTitle = _ref7.noValueTitle,
|
|
213
|
+
filterValueText = _ref7.filterValueText,
|
|
214
|
+
leftValues = _ref7.leftValues,
|
|
215
|
+
noOptionsTitle = _ref7.noOptionsTitle,
|
|
216
|
+
state = _ref7.state,
|
|
217
|
+
filterOptionsText = _ref7.filterOptionsText,
|
|
218
|
+
handleValuesClick = _ref7.handleValuesClick,
|
|
219
|
+
handleMoveRight = _ref7.handleMoveRight,
|
|
220
|
+
moveRightTitle = _ref7.moveRightTitle,
|
|
221
|
+
handleClearLeftValues = _ref7.handleClearLeftValues,
|
|
222
|
+
moveAllRightTitle = _ref7.moveAllRightTitle,
|
|
223
|
+
handleClearRightValues = _ref7.handleClearRightValues,
|
|
224
|
+
moveAllLeftTitle = _ref7.moveAllLeftTitle,
|
|
225
|
+
handleMoveLeft = _ref7.handleMoveLeft,
|
|
226
|
+
moveLeftTitle = _ref7.moveLeftTitle,
|
|
227
|
+
allToRight = _ref7.allToRight,
|
|
228
|
+
allToLeft = _ref7.allToLeft,
|
|
229
|
+
checkboxVariant = _ref7.checkboxVariant,
|
|
230
|
+
isRequired = _ref7.isRequired,
|
|
231
|
+
meta = _ref7.meta,
|
|
232
|
+
validateOnMount = _ref7.validateOnMount,
|
|
233
|
+
label = _ref7.label,
|
|
234
|
+
helperText = _ref7.helperText,
|
|
235
|
+
description = _ref7.description,
|
|
236
|
+
filterOptionsTitle = _ref7.filterOptionsTitle,
|
|
237
|
+
leftTitle = _ref7.leftTitle,
|
|
238
|
+
filterOptions = _ref7.filterOptions,
|
|
239
|
+
sortOptions = _ref7.sortOptions,
|
|
240
|
+
sortValues = _ref7.sortValues,
|
|
241
|
+
filterValueTitle = _ref7.filterValueTitle,
|
|
242
|
+
filterValues = _ref7.filterValues,
|
|
243
|
+
rightTitle = _ref7.rightTitle,
|
|
244
|
+
isFilterable = _ref7.isFilterable,
|
|
245
|
+
FormFieldGridProps = _ref7.FormFieldGridProps,
|
|
246
|
+
InternalGridProps = _ref7.InternalGridProps,
|
|
247
|
+
ListGridProps = _ref7.ListGridProps,
|
|
248
|
+
LeftListGridProps = _ref7.LeftListGridProps,
|
|
249
|
+
ListProps = _ref7.ListProps,
|
|
250
|
+
LeftListProps = _ref7.LeftListProps,
|
|
251
|
+
ButtonsGridProps = _ref7.ButtonsGridProps,
|
|
252
|
+
ButtonsInternalGridProps = _ref7.ButtonsInternalGridProps,
|
|
253
|
+
ButtonGridProps = _ref7.ButtonGridProps,
|
|
254
|
+
ToRightGridProps = _ref7.ToRightGridProps,
|
|
255
|
+
IconButtonProps = _ref7.IconButtonProps,
|
|
256
|
+
ToRightIconButtonProps = _ref7.ToRightIconButtonProps,
|
|
257
|
+
AllToRightGridProps = _ref7.AllToRightGridProps,
|
|
258
|
+
AllToRightIconButtonProps = _ref7.AllToRightIconButtonProps,
|
|
259
|
+
AllToLeftGridProps = _ref7.AllToLeftGridProps,
|
|
260
|
+
AllToLeftIconButtonProps = _ref7.AllToLeftIconButtonProps,
|
|
261
|
+
ToLeftGridProps = _ref7.ToLeftGridProps,
|
|
262
|
+
ToLeftIconButtonProps = _ref7.ToLeftIconButtonProps,
|
|
263
|
+
RightListGridProps = _ref7.RightListGridProps,
|
|
264
|
+
RightListProps = _ref7.RightListProps,
|
|
265
|
+
ListItemProps = _ref7.ListItemProps,
|
|
266
|
+
ListItemIconProps = _ref7.ListItemIconProps,
|
|
267
|
+
ListItemTextProps = _ref7.ListItemTextProps,
|
|
268
|
+
ListItemSecondaryActionProps = _ref7.ListItemSecondaryActionProps,
|
|
269
|
+
LeftListItemProps = _ref7.LeftListItemProps,
|
|
270
|
+
LeftListItemIconProps = _ref7.LeftListItemIconProps,
|
|
271
|
+
LeftItemTextProps = _ref7.LeftItemTextProps,
|
|
272
|
+
LeftItemSecondaryActionProps = _ref7.LeftItemSecondaryActionProps,
|
|
273
|
+
RightListItemProps = _ref7.RightListItemProps,
|
|
274
|
+
RightListItemIconProps = _ref7.RightListItemIconProps,
|
|
275
|
+
RightItemTextProps = _ref7.RightItemTextProps,
|
|
276
|
+
RightItemSecondaryActionProps = _ref7.RightItemSecondaryActionProps,
|
|
277
|
+
FormControlProps = _ref7.FormControlProps,
|
|
278
|
+
FormLabelProps = _ref7.FormLabelProps,
|
|
279
|
+
FormHelperTextProps = _ref7.FormHelperTextProps,
|
|
280
|
+
TitleProps = _ref7.TitleProps,
|
|
281
|
+
ToolbarProps = _ref7.ToolbarProps,
|
|
282
|
+
FilterFieldProps = _ref7.FilterFieldProps,
|
|
283
|
+
SortIconButtonProps = _ref7.SortIconButtonProps,
|
|
284
|
+
SortIconProps = _ref7.SortIconProps,
|
|
285
|
+
LeftToolbarProps = _ref7.LeftToolbarProps,
|
|
286
|
+
LeftFilterFieldProps = _ref7.LeftFilterFieldProps,
|
|
287
|
+
LeftSortIconButtonProps = _ref7.LeftSortIconButtonProps,
|
|
288
|
+
LeftSortIconProps = _ref7.LeftSortIconProps,
|
|
289
|
+
LeftTitleProps = _ref7.LeftTitleProps,
|
|
290
|
+
RightToolbarProps = _ref7.RightToolbarProps,
|
|
291
|
+
RightFilterFieldProps = _ref7.RightFilterFieldProps,
|
|
292
|
+
RightSortIconButtonProps = _ref7.RightSortIconButtonProps,
|
|
293
|
+
RightSortIconProps = _ref7.RightSortIconProps,
|
|
294
|
+
RightTitleProps = _ref7.RightTitleProps,
|
|
295
|
+
PaperProps = _ref7.PaperProps,
|
|
296
|
+
LeftPaperProps = _ref7.LeftPaperProps,
|
|
297
|
+
RightPaperProps = _ref7.RightPaperProps;
|
|
294
298
|
var invalid = validationError(meta, validateOnMount);
|
|
295
299
|
var text = invalid || (meta.touched || validateOnMount) && meta.warning || helperText || description;
|
|
296
|
-
return /*#__PURE__*/React.createElement(
|
|
300
|
+
return /*#__PURE__*/React.createElement(StyledDualListSelect, FormFieldGridProps, /*#__PURE__*/React.createElement(FormControl, _extends({
|
|
297
301
|
fullWidth: true,
|
|
298
302
|
required: isRequired,
|
|
299
303
|
error: !!invalid,
|
|
@@ -7,49 +7,53 @@ var _excluded = ["remove"],
|
|
|
7
7
|
_excluded2 = ["remove"],
|
|
8
8
|
_excluded3 = ["arrayValidator", "label", "description", "fields", "defaultItem", "meta", "minItems", "maxItems", "noItemsMessage", "FormFieldGridProps", "FormControlProps", "buttonLabels", "GridContainerProps", "HeaderGridProps", "HeaderProps", "UndoButtonProps", "RedoButtonProps", "AddButtonProps", "DescriptionGridProps", "DescriptionProps", "BodyGridProps", "NoItemsProps", "FormHelperTextGridProps", "FormHelperTextProps", "FieldContainerProps", "FieldGroupGridProps", "RemoveButtonGridProps", "RemoveButtonProps"];
|
|
9
9
|
|
|
10
|
+
var _styled;
|
|
11
|
+
|
|
10
12
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
11
13
|
|
|
12
14
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
13
15
|
|
|
14
16
|
import React, { memo, useReducer } from 'react';
|
|
17
|
+
import { styled } from '@mui/material/styles';
|
|
15
18
|
import PropTypes from 'prop-types';
|
|
16
19
|
import useFormApi from "@data-driven-forms/react-form-renderer/use-form-api";
|
|
17
20
|
import FieldArray from "@data-driven-forms/react-form-renderer/field-array";
|
|
18
21
|
import isEqual from 'lodash/isEqual';
|
|
19
|
-
import Grid from "@material
|
|
20
|
-
import Button from "@material
|
|
21
|
-
import Typography from "@material
|
|
22
|
-
import FormControl from "@material
|
|
23
|
-
import FormHelperText from "@material
|
|
24
|
-
import IconButton from "@material
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import UndoIcon from '@material-ui/icons/Undo';
|
|
22
|
+
import Grid from "@mui/material/Grid";
|
|
23
|
+
import Button from "@mui/material/Button";
|
|
24
|
+
import Typography from "@mui/material/Typography";
|
|
25
|
+
import FormControl from "@mui/material/FormControl";
|
|
26
|
+
import FormHelperText from "@mui/material/FormHelperText";
|
|
27
|
+
import IconButton from "@mui/material/IconButton";
|
|
28
|
+
import RedoIcon from '@mui/icons-material/Redo';
|
|
29
|
+
import UndoIcon from '@mui/icons-material/Undo';
|
|
28
30
|
import useFieldApi from "@data-driven-forms/react-form-renderer/use-field-api";
|
|
29
31
|
import FormFieldGrid from '../form-field-grid/form-field-grid';
|
|
30
32
|
import clsx from 'clsx';
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
})
|
|
33
|
+
var PREFIX = 'DynamicArray';
|
|
34
|
+
var classes = {
|
|
35
|
+
formControl: "".concat(PREFIX, "-formControl"),
|
|
36
|
+
centerText: "".concat(PREFIX, "-centerText"),
|
|
37
|
+
buttonsToEnd: "".concat(PREFIX, "-buttonsToEnd"),
|
|
38
|
+
header: "".concat(PREFIX, "-header"),
|
|
39
|
+
label: "".concat(PREFIX, "-label"),
|
|
40
|
+
fieldArrayGroup: "".concat(PREFIX, "-fieldArrayGroup")
|
|
41
|
+
};
|
|
42
|
+
var StyledFormFieldGrid = styled(FormFieldGrid)((_styled = {}, _defineProperty(_styled, "& .".concat(classes.formControl), {
|
|
43
|
+
width: '100%'
|
|
44
|
+
}), _defineProperty(_styled, "& .".concat(classes.centerText), {
|
|
45
|
+
display: 'flex',
|
|
46
|
+
justifyContent: 'center'
|
|
47
|
+
}), _defineProperty(_styled, "& .".concat(classes.buttonsToEnd), {
|
|
48
|
+
display: 'flex',
|
|
49
|
+
justifyContent: 'flex-end'
|
|
50
|
+
}), _defineProperty(_styled, "& .".concat(classes.header), {
|
|
51
|
+
display: 'flex'
|
|
52
|
+
}), _defineProperty(_styled, "& .".concat(classes.label), {
|
|
53
|
+
flexGrow: 1
|
|
54
|
+
}), _defineProperty(_styled, "&.".concat(classes.fieldArrayGroup), {
|
|
55
|
+
marginBottom: 32
|
|
56
|
+
}), _styled));
|
|
53
57
|
var ArrayItem = /*#__PURE__*/memo(function (_ref) {
|
|
54
58
|
var fields = _ref.fields,
|
|
55
59
|
fieldIndex = _ref.fieldIndex,
|
|
@@ -66,7 +70,6 @@ var ArrayItem = /*#__PURE__*/memo(function (_ref) {
|
|
|
66
70
|
var _useFormApi = useFormApi(),
|
|
67
71
|
renderForm = _useFormApi.renderForm;
|
|
68
72
|
|
|
69
|
-
var classes = useFielArrayStyles();
|
|
70
73
|
var editedFields = fields.map(function (field, index) {
|
|
71
74
|
var computedName = field.name ? "".concat(name, ".").concat(field.name) : name;
|
|
72
75
|
return _objectSpread(_objectSpread({}, field), {}, {
|
|
@@ -202,13 +205,12 @@ var DynamicArray = function DynamicArray(_ref5) {
|
|
|
202
205
|
|
|
203
206
|
var combinedButtonLabels = _objectSpread(_objectSpread({}, defaultButtonLabels), buttonLabels);
|
|
204
207
|
|
|
205
|
-
var classes = useFielArrayStyles();
|
|
206
208
|
var dirty = meta.dirty,
|
|
207
209
|
submitFailed = meta.submitFailed,
|
|
208
210
|
error = meta.error,
|
|
209
211
|
submitError = meta.submitError;
|
|
210
212
|
var isError = (dirty || submitFailed) && error && typeof error === 'string';
|
|
211
|
-
return /*#__PURE__*/React.createElement(
|
|
213
|
+
return /*#__PURE__*/React.createElement(StyledFormFieldGrid, _extends({}, FormFieldGridProps, {
|
|
212
214
|
className: clsx(classes.fieldArrayGroup, FormFieldGridProps.classname)
|
|
213
215
|
}), /*#__PURE__*/React.createElement(FormControl, _extends({
|
|
214
216
|
component: "fieldset",
|
|
@@ -275,13 +277,17 @@ var DynamicArray = function DynamicArray(_ref5) {
|
|
|
275
277
|
component: "span",
|
|
276
278
|
disabled: state.index === 0,
|
|
277
279
|
onClick: undo
|
|
278
|
-
}, UndoButtonProps
|
|
280
|
+
}, UndoButtonProps, {
|
|
281
|
+
size: "large"
|
|
282
|
+
}), /*#__PURE__*/React.createElement(UndoIcon, null)), /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
279
283
|
color: "primary",
|
|
280
284
|
"aria-label": "redo",
|
|
281
285
|
component: "span",
|
|
282
286
|
disabled: state.index === state.history.length,
|
|
283
287
|
onClick: redo
|
|
284
|
-
}, RedoButtonProps
|
|
288
|
+
}, RedoButtonProps, {
|
|
289
|
+
size: "large"
|
|
290
|
+
}), /*#__PURE__*/React.createElement(RedoIcon, null)), /*#__PURE__*/React.createElement(Button, _extends({
|
|
285
291
|
color: "primary",
|
|
286
292
|
onClick: pushWrapper,
|
|
287
293
|
disabled: value.length >= maxItems
|