@data-driven-forms/mui-component-mapper 4.1.13 → 4.1.14
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/.eslintrc.json +27 -0
- package/CHANGELOG.md +11 -3
- package/checkbox/checkbox.d.ts +29 -16
- package/checkbox/checkbox.js +44 -77
- package/checkbox/checkbox.js.map +1 -0
- package/checkbox/index.js +22 -24
- package/checkbox/index.js.map +1 -0
- package/component-mapper/component-mapper.d.ts +35 -40
- package/component-mapper/component-mapper.js +55 -40
- package/component-mapper/component-mapper.js.map +1 -0
- package/component-mapper/index.js +22 -24
- package/component-mapper/index.js.map +1 -0
- package/date-picker/date-picker.d.ts +10 -10
- package/date-picker/date-picker.js +52 -63
- package/date-picker/date-picker.js.map +1 -0
- package/date-picker/index.js +22 -24
- package/date-picker/index.js.map +1 -0
- package/dual-list-select/dual-list-select.d.ts +3 -111
- package/dual-list-select/dual-list-select.js +93 -412
- package/dual-list-select/dual-list-select.js.map +1 -0
- package/dual-list-select/index.js +22 -24
- package/dual-list-select/index.js.map +1 -0
- package/esm/checkbox/checkbox.d.ts +31 -0
- package/esm/checkbox/checkbox.js +25 -69
- package/esm/checkbox/checkbox.js.map +1 -0
- package/esm/checkbox/index.d.ts +2 -0
- package/esm/checkbox/index.js +2 -1
- package/esm/checkbox/index.js.map +1 -0
- package/esm/component-mapper/component-mapper.d.ts +36 -0
- package/esm/component-mapper/component-mapper.js +34 -19
- package/esm/component-mapper/component-mapper.js.map +1 -0
- package/esm/component-mapper/index.d.ts +2 -0
- package/esm/component-mapper/index.js +2 -1
- package/esm/component-mapper/index.js.map +1 -0
- package/esm/date-picker/date-picker.d.ts +12 -0
- package/esm/date-picker/date-picker.js +35 -55
- package/esm/date-picker/date-picker.js.map +1 -0
- package/esm/date-picker/index.d.ts +2 -0
- package/esm/date-picker/index.js +2 -1
- package/esm/date-picker/index.js.map +1 -0
- package/esm/dual-list-select/dual-list-select.d.ts +3 -0
- package/esm/dual-list-select/dual-list-select.js +59 -404
- package/esm/dual-list-select/dual-list-select.js.map +1 -0
- package/esm/dual-list-select/index.d.ts +2 -0
- package/esm/dual-list-select/index.js +2 -1
- package/esm/dual-list-select/index.js.map +1 -0
- package/esm/field-array/field-array.d.ts +56 -0
- package/esm/field-array/field-array.js +107 -296
- package/esm/field-array/field-array.js.map +1 -0
- package/esm/field-array/index.d.ts +2 -0
- package/esm/field-array/index.js +2 -1
- package/esm/field-array/index.js.map +1 -0
- package/esm/form-field-grid/form-field-grid.d.ts +8 -0
- package/esm/form-field-grid/form-field-grid.js +26 -22
- package/esm/form-field-grid/form-field-grid.js.map +1 -0
- package/esm/form-field-grid/index.d.ts +2 -0
- package/esm/form-field-grid/index.js +3 -1
- package/esm/form-field-grid/index.js.map +1 -0
- package/esm/form-template/form-template.d.ts +17 -0
- package/esm/form-template/form-template.js +57 -126
- package/esm/form-template/form-template.js.map +1 -0
- package/esm/form-template/index.d.ts +2 -0
- package/esm/form-template/index.js +2 -1
- package/esm/form-template/index.js.map +1 -0
- package/esm/index.d.ts +21 -0
- package/esm/index.js +3 -2
- package/esm/index.js.map +1 -0
- package/esm/multiple-choice-list/index.d.ts +2 -0
- package/esm/multiple-choice-list/index.js +2 -1
- package/esm/multiple-choice-list/index.js.map +1 -0
- package/esm/multiple-choice-list/multiple-choice-list.d.ts +14 -0
- package/esm/multiple-choice-list/multiple-choice-list.js +39 -93
- package/esm/multiple-choice-list/multiple-choice-list.js.map +1 -0
- package/esm/plain-text/index.d.ts +2 -0
- package/esm/plain-text/index.js +2 -1
- package/esm/plain-text/index.js.map +1 -0
- package/esm/plain-text/plain-text.d.ts +12 -0
- package/esm/plain-text/plain-text.js +18 -27
- package/esm/plain-text/plain-text.js.map +1 -0
- package/esm/radio/index.d.ts +2 -0
- package/esm/radio/index.js +2 -1
- package/esm/radio/index.js.map +1 -0
- package/esm/radio/radio.d.ts +19 -0
- package/esm/radio/radio.js +38 -110
- package/esm/radio/radio.js.map +1 -0
- package/esm/select/index.d.ts +2 -0
- package/esm/select/index.js +2 -1
- package/esm/select/index.js.map +1 -0
- package/esm/select/select.d.ts +44 -0
- package/esm/select/select.js +55 -162
- package/esm/select/select.js.map +1 -0
- package/esm/slider/index.d.ts +2 -0
- package/esm/slider/index.js +2 -1
- package/esm/slider/index.js.map +1 -0
- package/esm/slider/slider.d.ts +24 -0
- package/esm/slider/slider.js +22 -63
- package/esm/slider/slider.js.map +1 -0
- package/esm/sub-form/index.d.ts +2 -0
- package/esm/sub-form/index.js +2 -1
- package/esm/sub-form/index.js.map +1 -0
- package/esm/sub-form/sub-form.d.ts +16 -0
- package/esm/sub-form/sub-form.js +29 -52
- package/esm/sub-form/sub-form.js.map +1 -0
- package/esm/switch/index.d.ts +2 -0
- package/esm/switch/index.js +2 -1
- package/esm/switch/index.js.map +1 -0
- package/esm/switch/switch.d.ts +18 -0
- package/esm/switch/switch.js +21 -62
- package/esm/switch/switch.js.map +1 -0
- package/esm/tabs/index.d.ts +2 -0
- package/esm/tabs/index.js +2 -1
- package/esm/tabs/index.js.map +1 -0
- package/esm/tabs/tabs.d.ts +19 -0
- package/esm/tabs/tabs.js +9 -73
- package/esm/tabs/tabs.js.map +1 -0
- package/esm/text-field/index.d.ts +2 -0
- package/esm/text-field/index.js +2 -1
- package/esm/text-field/index.js.map +1 -0
- package/esm/text-field/text-field.d.ts +10 -0
- package/esm/text-field/text-field.js +20 -38
- package/esm/text-field/text-field.js.map +1 -0
- package/esm/textarea/index.d.ts +2 -0
- package/esm/textarea/index.js +2 -1
- package/esm/textarea/index.js.map +1 -0
- package/esm/textarea/textarea.d.ts +13 -0
- package/esm/textarea/textarea.js +20 -42
- package/esm/textarea/textarea.js.map +1 -0
- package/esm/time-picker/index.d.ts +2 -0
- package/esm/time-picker/index.js +2 -1
- package/esm/time-picker/index.js.map +1 -0
- package/esm/time-picker/time-picker.d.ts +13 -0
- package/esm/time-picker/time-picker.js +35 -57
- package/esm/time-picker/time-picker.js.map +1 -0
- package/esm/validation-error/index.d.ts +2 -0
- package/esm/validation-error/index.js +2 -1
- package/esm/validation-error/index.js.map +1 -0
- package/esm/validation-error/validation-error.d.ts +6 -0
- package/esm/validation-error/validation-error.js +7 -6
- package/esm/validation-error/validation-error.js.map +1 -0
- package/esm/wizard/index.d.ts +2 -0
- package/esm/wizard/index.js +2 -1
- package/esm/wizard/index.js.map +1 -0
- package/esm/wizard/step-buttons.d.ts +33 -0
- package/esm/wizard/step-buttons.js +49 -104
- package/esm/wizard/step-buttons.js.map +1 -0
- package/esm/wizard/wizard-nav.d.ts +15 -0
- package/esm/wizard/wizard-nav.js +15 -33
- package/esm/wizard/wizard-nav.js.map +1 -0
- package/esm/wizard/wizard.d.ts +4 -0
- package/esm/wizard/wizard.js +21 -70
- package/esm/wizard/wizard.js.map +1 -0
- package/field-array/field-array.d.ts +54 -38
- package/field-array/field-array.js +138 -306
- package/field-array/field-array.js.map +1 -0
- package/field-array/index.js +22 -24
- package/field-array/index.js.map +1 -0
- package/form-field-grid/form-field-grid.d.ts +7 -5
- package/form-field-grid/form-field-grid.js +42 -28
- package/form-field-grid/form-field-grid.js.map +1 -0
- package/form-field-grid/index.js +23 -12
- package/form-field-grid/index.js.map +1 -0
- package/form-template/form-template.d.ts +17 -5
- package/form-template/form-template.js +78 -132
- package/form-template/form-template.js.map +1 -0
- package/form-template/index.js +22 -24
- package/form-template/index.js.map +1 -0
- package/index.d.ts +10 -29
- package/index.js +45 -146
- package/index.js.map +1 -0
- package/multiple-choice-list/index.js +22 -24
- package/multiple-choice-list/index.js.map +1 -0
- package/multiple-choice-list/multiple-choice-list.d.ts +12 -24
- package/multiple-choice-list/multiple-choice-list.js +53 -101
- package/multiple-choice-list/multiple-choice-list.js.map +1 -0
- package/package.json +8 -10
- package/plain-text/index.js +22 -24
- package/plain-text/index.js.map +1 -0
- package/plain-text/plain-text.d.ts +10 -10
- package/plain-text/plain-text.js +30 -33
- package/plain-text/plain-text.js.map +1 -0
- package/radio/index.js +22 -24
- package/radio/index.js.map +1 -0
- package/radio/radio.d.ts +17 -25
- package/radio/radio.js +56 -116
- package/radio/radio.js.map +1 -0
- package/select/index.js +22 -24
- package/select/index.js.map +1 -0
- package/select/select.d.ts +42 -27
- package/select/select.js +78 -172
- package/select/select.js.map +1 -0
- package/slider/index.js +22 -24
- package/slider/index.js.map +1 -0
- package/slider/slider.d.ts +22 -28
- package/slider/slider.js +39 -71
- package/slider/slider.js.map +1 -0
- package/sub-form/index.js +22 -24
- package/sub-form/index.js.map +1 -0
- package/sub-form/sub-form.d.ts +14 -16
- package/sub-form/sub-form.js +42 -56
- package/sub-form/sub-form.js.map +1 -0
- package/switch/index.js +22 -24
- package/switch/index.js.map +1 -0
- package/switch/switch.d.ts +16 -26
- package/switch/switch.js +43 -70
- package/switch/switch.js.map +1 -0
- package/tabs/index.js +22 -24
- package/tabs/index.js.map +1 -0
- package/tabs/tabs.d.ts +18 -14
- package/tabs/tabs.js +33 -82
- package/tabs/tabs.js.map +1 -0
- package/text-field/index.js +22 -24
- package/text-field/index.js.map +1 -0
- package/text-field/text-field.d.ts +8 -16
- package/text-field/text-field.js +37 -46
- package/text-field/text-field.js.map +1 -0
- package/textarea/index.js +22 -24
- package/textarea/index.js.map +1 -0
- package/textarea/textarea.d.ts +11 -17
- package/textarea/textarea.js +37 -50
- package/textarea/textarea.js.map +1 -0
- package/time-picker/index.js +22 -24
- package/time-picker/index.js.map +1 -0
- package/time-picker/time-picker.d.ts +11 -16
- package/time-picker/time-picker.js +52 -65
- package/time-picker/time-picker.js.map +1 -0
- package/tsconfig.cjs.json +8 -0
- package/tsconfig.demo.json +31 -0
- package/tsconfig.esm.json +8 -0
- package/tsconfig.json +17 -9
- package/validation-error/index.js +22 -24
- package/validation-error/index.js.map +1 -0
- package/validation-error/validation-error.d.ts +5 -4
- package/validation-error/validation-error.js +10 -11
- package/validation-error/validation-error.js.map +1 -0
- package/wizard/index.js +22 -24
- package/wizard/index.js.map +1 -0
- package/wizard/step-buttons.d.ts +33 -0
- package/wizard/step-buttons.js +68 -110
- package/wizard/step-buttons.js.map +1 -0
- package/wizard/wizard-nav.d.ts +15 -0
- package/wizard/wizard-nav.js +37 -37
- package/wizard/wizard-nav.js.map +1 -0
- package/wizard/wizard.d.ts +4 -28
- package/wizard/wizard.js +41 -79
- package/wizard/wizard.js.map +1 -0
|
@@ -1,413 +1,68 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
import React from 'react';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
2
|
import { styled } from '@mui/material/styles';
|
|
7
3
|
import clsx from 'clsx';
|
|
8
|
-
import Grid from
|
|
9
|
-
import List from "@mui/material/List";
|
|
10
|
-
import ListItem from "@mui/material/ListItem";
|
|
11
|
-
import ListItemText from "@mui/material/ListItemText";
|
|
12
|
-
import ListItemIcon from "@mui/material/ListItemIcon";
|
|
13
|
-
import Checkbox from "@mui/material/Checkbox";
|
|
14
|
-
import ListItemSecondaryAction from "@mui/material/ListItemSecondaryAction";
|
|
15
|
-
import IconButton from "@mui/material/IconButton";
|
|
16
|
-
import FormControl from "@mui/material/FormControl";
|
|
17
|
-
import FormLabel from "@mui/material/FormLabel";
|
|
18
|
-
import FormHelperText from "@mui/material/FormHelperText";
|
|
19
|
-
import Toolbar from "@mui/material/Toolbar";
|
|
20
|
-
import TextField from "@mui/material/TextField";
|
|
21
|
-
import Typography from "@mui/material/Typography";
|
|
22
|
-
import Paper from "@mui/material/Paper";
|
|
23
|
-
import Button from "@mui/material/Button";
|
|
4
|
+
import { Grid, List, ListItem, ListItemText, ListItemIcon, Checkbox, ListItemSecondaryAction, IconButton, FormControl, FormLabel, FormHelperText, Toolbar, TextField, Typography, Paper, Button, } from '@mui/material';
|
|
24
5
|
import SortIcon from '@mui/icons-material/ArrowUpward';
|
|
25
6
|
import DualListSelectCommon from '@data-driven-forms/common/dual-list-select';
|
|
26
7
|
import FormFieldGrid from '../form-field-grid/form-field-grid';
|
|
27
8
|
import { validationError } from '../validation-error/validation-error';
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
9
|
+
const PREFIX = 'DualListSelectWrapper';
|
|
10
|
+
const classes = {
|
|
11
|
+
allToLeftIcon: `${PREFIX}-allToLeftIcon`,
|
|
12
|
+
upsideDown: `${PREFIX}-upsideDown`,
|
|
13
|
+
list: `${PREFIX}-list`,
|
|
14
|
+
button: `${PREFIX}-button`,
|
|
15
|
+
buttonsGrid: `${PREFIX}-buttonsGrid`,
|
|
16
|
+
filter: `${PREFIX}-filter`,
|
|
17
|
+
toolbar: `${PREFIX}-toolbar`,
|
|
37
18
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
transform: 'scaleX(-1)'
|
|
42
|
-
}), "& .".concat(classes.upsideDown), {
|
|
43
|
-
transform: 'scaleY(-1)'
|
|
44
|
-
}), "& .".concat(classes.list), {
|
|
45
|
-
height: 300,
|
|
46
|
-
overflow: 'auto'
|
|
47
|
-
}), "& .".concat(classes.button), {
|
|
48
|
-
display: 'flex',
|
|
49
|
-
justifyContent: 'center',
|
|
50
|
-
margin: theme.spacing(0.5, 0)
|
|
51
|
-
}), "& .".concat(classes.buttonsGrid), {
|
|
52
|
-
height: '100%',
|
|
53
|
-
alignContent: 'center'
|
|
54
|
-
}), "& .".concat(classes.filter), {
|
|
55
|
-
width: '100%'
|
|
56
|
-
}), "& .".concat(classes.toolbar), {
|
|
57
|
-
paddingLeft: 16,
|
|
58
|
-
paddingRight: 16
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
var ListInternal = function ListInternal(_ref3) {
|
|
62
|
-
var _ref3$value = _ref3.value,
|
|
63
|
-
value = _ref3$value === void 0 ? [] : _ref3$value,
|
|
64
|
-
optionClick = _ref3.optionClick,
|
|
65
|
-
noOptionsTitle = _ref3.noOptionsTitle,
|
|
66
|
-
filterValue = _ref3.filterValue,
|
|
67
|
-
filterValueText = _ref3.filterValueText,
|
|
68
|
-
selectedValues = _ref3.selectedValues,
|
|
69
|
-
_ref3$ListProps = _ref3.ListProps,
|
|
70
|
-
ListProps = _ref3$ListProps === void 0 ? {} : _ref3$ListProps,
|
|
71
|
-
ListItemProps = _ref3.ListItemProps,
|
|
72
|
-
ListItemIconProps = _ref3.ListItemIconProps,
|
|
73
|
-
ListItemTextProps = _ref3.ListItemTextProps,
|
|
74
|
-
ListItemSecondaryActionProps = _ref3.ListItemSecondaryActionProps,
|
|
75
|
-
checkboxVariant = _ref3.checkboxVariant,
|
|
76
|
-
PaperProps = _ref3.PaperProps,
|
|
77
|
-
LeftPaperProps = _ref3.LeftPaperProps;
|
|
78
|
-
return /*#__PURE__*/React.createElement(Paper, _extends({}, PaperProps, LeftPaperProps, {
|
|
79
|
-
className: clsx(PaperProps && PaperProps.className, LeftPaperProps && LeftPaperProps.className)
|
|
80
|
-
}), /*#__PURE__*/React.createElement(List, _extends({
|
|
81
|
-
component: "div",
|
|
82
|
-
role: "list",
|
|
83
|
-
dense: true
|
|
84
|
-
}, ListProps, {
|
|
85
|
-
className: clsx(classes.list, ListProps.className)
|
|
86
|
-
}), value.length < 1 && /*#__PURE__*/React.createElement(ListItem, _extends({
|
|
87
|
-
button: true,
|
|
88
|
-
disabled: true
|
|
89
|
-
}, ListItemProps), /*#__PURE__*/React.createElement(ListItemText, {
|
|
90
|
-
primary: filterValue ? filterValueText : noOptionsTitle
|
|
91
|
-
})), value.length > 0 && value.map(function (_ref4) {
|
|
92
|
-
var value = _ref4.value,
|
|
93
|
-
label = _ref4.label,
|
|
94
|
-
icon = _ref4.icon,
|
|
95
|
-
isCheckbox = _ref4.isCheckbox,
|
|
96
|
-
secondaryActions = _ref4.secondaryActions,
|
|
97
|
-
ListItemPropsItem = _ref4.ListItemProps,
|
|
98
|
-
ListItemIconPropsItem = _ref4.ListItemIconProps,
|
|
99
|
-
ListItemTextPropsItem = _ref4.ListItemTextProps,
|
|
100
|
-
ListItemSecondaryActionPropsItem = _ref4.ListItemSecondaryActionProps;
|
|
101
|
-
return /*#__PURE__*/React.createElement(ListItem, _extends({
|
|
102
|
-
button: true,
|
|
103
|
-
key: value,
|
|
104
|
-
selected: selectedValues.includes(value),
|
|
105
|
-
onClick: function onClick(e) {
|
|
106
|
-
return optionClick(isCheckbox || checkboxVariant ? _objectSpread(_objectSpread({}, e), {}, {
|
|
107
|
-
ctrlKey: true
|
|
108
|
-
}) : e, value);
|
|
109
|
-
}
|
|
110
|
-
}, ListItemProps, ListItemPropsItem), (icon || isCheckbox || checkboxVariant) && /*#__PURE__*/React.createElement(ListItemIcon, _extends({}, ListItemIconProps, ListItemIconPropsItem), isCheckbox || checkboxVariant ? /*#__PURE__*/React.createElement(Checkbox, {
|
|
111
|
-
edge: "start",
|
|
112
|
-
checked: selectedValues.includes(value),
|
|
113
|
-
tabIndex: -1,
|
|
114
|
-
disableRipple: true
|
|
115
|
-
}) : icon), /*#__PURE__*/React.createElement(ListItemText, _extends({
|
|
116
|
-
primary: label
|
|
117
|
-
}, ListItemTextProps, ListItemTextPropsItem)), secondaryActions && /*#__PURE__*/React.createElement(ListItemSecondaryAction, _extends({}, ListItemSecondaryActionProps, ListItemSecondaryActionPropsItem), secondaryActions));
|
|
118
|
-
})));
|
|
119
|
-
};
|
|
120
|
-
var ToolbarInternal = function ToolbarInternal(_ref5) {
|
|
121
|
-
var ToolbarProps = _ref5.ToolbarProps,
|
|
122
|
-
LeftToolbarProps = _ref5.LeftToolbarProps,
|
|
123
|
-
filterOptions = _ref5.filterOptions,
|
|
124
|
-
filterOptionsTitle = _ref5.filterOptionsTitle,
|
|
125
|
-
FilterFieldProps = _ref5.FilterFieldProps,
|
|
126
|
-
sortOptions = _ref5.sortOptions,
|
|
127
|
-
SortIconButtonProps = _ref5.SortIconButtonProps,
|
|
128
|
-
SortIconProps = _ref5.SortIconProps,
|
|
129
|
-
LeftSortIconProps = _ref5.LeftSortIconProps,
|
|
130
|
-
LeftFilterFieldProps = _ref5.LeftFilterFieldProps,
|
|
131
|
-
LeftSortIconButtonProps = _ref5.LeftSortIconButtonProps,
|
|
132
|
-
filter = _ref5.filter,
|
|
133
|
-
sortDesc = _ref5.sortDesc,
|
|
134
|
-
isValue = _ref5.isValue;
|
|
135
|
-
return /*#__PURE__*/React.createElement(Toolbar, _extends({
|
|
136
|
-
variant: "dense"
|
|
137
|
-
}, ToolbarProps, LeftToolbarProps, {
|
|
138
|
-
className: clsx(classes.toolbar, ToolbarProps && ToolbarProps.className, LeftToolbarProps && LeftToolbarProps.className)
|
|
139
|
-
}), /*#__PURE__*/React.createElement(TextField, _extends({
|
|
140
|
-
edge: "start",
|
|
141
|
-
"aria-label": isValue ? 'value-search' : 'options-search',
|
|
142
|
-
label: filterOptionsTitle,
|
|
143
|
-
onChange: function onChange(_ref6) {
|
|
144
|
-
var value = _ref6.target.value;
|
|
145
|
-
return filterOptions(value);
|
|
19
|
+
const StyledDualListSelect = styled(FormFieldGrid)(({ theme }) => ({
|
|
20
|
+
[`& .${classes.allToLeftIcon}`]: {
|
|
21
|
+
transform: 'scaleX(-1)',
|
|
146
22
|
},
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
allToRight = _ref7$allToRight === void 0 ? true : _ref7$allToRight,
|
|
190
|
-
_ref7$allToLeft = _ref7.allToLeft,
|
|
191
|
-
allToLeft = _ref7$allToLeft === void 0 ? true : _ref7$allToLeft,
|
|
192
|
-
checkboxVariant = _ref7.checkboxVariant,
|
|
193
|
-
isRequired = _ref7.isRequired,
|
|
194
|
-
meta = _ref7.meta,
|
|
195
|
-
validateOnMount = _ref7.validateOnMount,
|
|
196
|
-
label = _ref7.label,
|
|
197
|
-
helperText = _ref7.helperText,
|
|
198
|
-
description = _ref7.description,
|
|
199
|
-
_ref7$filterOptionsTi = _ref7.filterOptionsTitle,
|
|
200
|
-
filterOptionsTitle = _ref7$filterOptionsTi === void 0 ? 'Filter options' : _ref7$filterOptionsTi,
|
|
201
|
-
_ref7$leftTitle = _ref7.leftTitle,
|
|
202
|
-
leftTitle = _ref7$leftTitle === void 0 ? 'Options' : _ref7$leftTitle,
|
|
203
|
-
filterOptions = _ref7.filterOptions,
|
|
204
|
-
sortOptions = _ref7.sortOptions,
|
|
205
|
-
sortValues = _ref7.sortValues,
|
|
206
|
-
_ref7$filterValueTitl = _ref7.filterValueTitle,
|
|
207
|
-
filterValueTitle = _ref7$filterValueTitl === void 0 ? 'Filter selected value' : _ref7$filterValueTitl,
|
|
208
|
-
filterValues = _ref7.filterValues,
|
|
209
|
-
_ref7$rightTitle = _ref7.rightTitle,
|
|
210
|
-
rightTitle = _ref7$rightTitle === void 0 ? 'Selected' : _ref7$rightTitle,
|
|
211
|
-
_ref7$isFilterable = _ref7.isFilterable,
|
|
212
|
-
isFilterable = _ref7$isFilterable === void 0 ? true : _ref7$isFilterable,
|
|
213
|
-
FormFieldGridProps = _ref7.FormFieldGridProps,
|
|
214
|
-
InternalGridProps = _ref7.InternalGridProps,
|
|
215
|
-
ListGridProps = _ref7.ListGridProps,
|
|
216
|
-
LeftListGridProps = _ref7.LeftListGridProps,
|
|
217
|
-
ListProps = _ref7.ListProps,
|
|
218
|
-
LeftListProps = _ref7.LeftListProps,
|
|
219
|
-
ButtonsGridProps = _ref7.ButtonsGridProps,
|
|
220
|
-
ButtonsInternalGridProps = _ref7.ButtonsInternalGridProps,
|
|
221
|
-
ButtonGridProps = _ref7.ButtonGridProps,
|
|
222
|
-
ToRightGridProps = _ref7.ToRightGridProps,
|
|
223
|
-
IconButtonProps = _ref7.IconButtonProps,
|
|
224
|
-
ToRightIconButtonProps = _ref7.ToRightIconButtonProps,
|
|
225
|
-
AllToRightGridProps = _ref7.AllToRightGridProps,
|
|
226
|
-
AllToRightIconButtonProps = _ref7.AllToRightIconButtonProps,
|
|
227
|
-
AllToLeftGridProps = _ref7.AllToLeftGridProps,
|
|
228
|
-
AllToLeftIconButtonProps = _ref7.AllToLeftIconButtonProps,
|
|
229
|
-
ToLeftGridProps = _ref7.ToLeftGridProps,
|
|
230
|
-
ToLeftIconButtonProps = _ref7.ToLeftIconButtonProps,
|
|
231
|
-
RightListGridProps = _ref7.RightListGridProps,
|
|
232
|
-
RightListProps = _ref7.RightListProps,
|
|
233
|
-
ListItemProps = _ref7.ListItemProps,
|
|
234
|
-
ListItemIconProps = _ref7.ListItemIconProps,
|
|
235
|
-
ListItemTextProps = _ref7.ListItemTextProps,
|
|
236
|
-
ListItemSecondaryActionProps = _ref7.ListItemSecondaryActionProps,
|
|
237
|
-
LeftListItemProps = _ref7.LeftListItemProps,
|
|
238
|
-
LeftListItemIconProps = _ref7.LeftListItemIconProps,
|
|
239
|
-
LeftItemTextProps = _ref7.LeftItemTextProps,
|
|
240
|
-
LeftItemSecondaryActionProps = _ref7.LeftItemSecondaryActionProps,
|
|
241
|
-
RightListItemProps = _ref7.RightListItemProps,
|
|
242
|
-
RightListItemIconProps = _ref7.RightListItemIconProps,
|
|
243
|
-
RightItemTextProps = _ref7.RightItemTextProps,
|
|
244
|
-
RightItemSecondaryActionProps = _ref7.RightItemSecondaryActionProps,
|
|
245
|
-
FormControlProps = _ref7.FormControlProps,
|
|
246
|
-
FormLabelProps = _ref7.FormLabelProps,
|
|
247
|
-
FormHelperTextProps = _ref7.FormHelperTextProps,
|
|
248
|
-
TitleProps = _ref7.TitleProps,
|
|
249
|
-
ToolbarProps = _ref7.ToolbarProps,
|
|
250
|
-
FilterFieldProps = _ref7.FilterFieldProps,
|
|
251
|
-
SortIconButtonProps = _ref7.SortIconButtonProps,
|
|
252
|
-
SortIconProps = _ref7.SortIconProps,
|
|
253
|
-
LeftToolbarProps = _ref7.LeftToolbarProps,
|
|
254
|
-
LeftFilterFieldProps = _ref7.LeftFilterFieldProps,
|
|
255
|
-
LeftSortIconButtonProps = _ref7.LeftSortIconButtonProps,
|
|
256
|
-
LeftSortIconProps = _ref7.LeftSortIconProps,
|
|
257
|
-
LeftTitleProps = _ref7.LeftTitleProps,
|
|
258
|
-
RightToolbarProps = _ref7.RightToolbarProps,
|
|
259
|
-
RightFilterFieldProps = _ref7.RightFilterFieldProps,
|
|
260
|
-
RightSortIconButtonProps = _ref7.RightSortIconButtonProps,
|
|
261
|
-
RightSortIconProps = _ref7.RightSortIconProps,
|
|
262
|
-
RightTitleProps = _ref7.RightTitleProps,
|
|
263
|
-
PaperProps = _ref7.PaperProps,
|
|
264
|
-
LeftPaperProps = _ref7.LeftPaperProps,
|
|
265
|
-
RightPaperProps = _ref7.RightPaperProps;
|
|
266
|
-
var invalid = validationError(meta, validateOnMount);
|
|
267
|
-
var text = invalid || (meta.touched || validateOnMount) && meta.warning || helperText || description;
|
|
268
|
-
return /*#__PURE__*/React.createElement(StyledDualListSelect, FormFieldGridProps, /*#__PURE__*/React.createElement(FormControl, _extends({
|
|
269
|
-
fullWidth: true,
|
|
270
|
-
required: isRequired,
|
|
271
|
-
error: !!invalid,
|
|
272
|
-
component: "fieldset"
|
|
273
|
-
}, FormControlProps), /*#__PURE__*/React.createElement(FormLabel, _extends({
|
|
274
|
-
component: "legend"
|
|
275
|
-
}, FormLabelProps), label), /*#__PURE__*/React.createElement(Grid, _extends({
|
|
276
|
-
container: true
|
|
277
|
-
}, InternalGridProps), /*#__PURE__*/React.createElement(Grid, _extends({
|
|
278
|
-
item: true,
|
|
279
|
-
xs: 12,
|
|
280
|
-
md: 5
|
|
281
|
-
}, ListGridProps, LeftListGridProps), leftTitle && /*#__PURE__*/React.createElement(Typography, _extends({
|
|
282
|
-
variant: "h6",
|
|
283
|
-
gutterBottom: true
|
|
284
|
-
}, TitleProps, LeftTitleProps), leftTitle), isFilterable && /*#__PURE__*/React.createElement(ToolbarInternal, {
|
|
285
|
-
ToolbarProps: ToolbarProps,
|
|
286
|
-
LeftToolbarProps: LeftToolbarProps,
|
|
287
|
-
filterOptions: filterOptions,
|
|
288
|
-
filterOptionsTitle: filterOptionsTitle,
|
|
289
|
-
FilterFieldProps: FilterFieldProps,
|
|
290
|
-
sortOptions: sortOptions,
|
|
291
|
-
SortIconButtonProps: SortIconButtonProps,
|
|
292
|
-
SortIconProps: SortIconProps,
|
|
293
|
-
LeftSortIconProps: LeftSortIconProps,
|
|
294
|
-
LeftFilterFieldProps: LeftFilterFieldProps,
|
|
295
|
-
LeftSortIconButtonProps: LeftSortIconButtonProps,
|
|
296
|
-
filter: state.filterOptions,
|
|
297
|
-
sortDesc: state.sortLeftDesc
|
|
298
|
-
}), /*#__PURE__*/React.createElement(ListInternal, {
|
|
299
|
-
optionClick: handleOptionsClick,
|
|
300
|
-
value: leftValues,
|
|
301
|
-
noOptionsTitle: noOptionsTitle,
|
|
302
|
-
filterValue: state.filterOptions,
|
|
303
|
-
filterValueText: filterOptionsText,
|
|
304
|
-
selectedValues: state.selectedLeftValues,
|
|
305
|
-
checkboxVariant: checkboxVariant,
|
|
306
|
-
ListProps: _objectSpread(_objectSpread({}, ListProps), LeftListProps),
|
|
307
|
-
ListItemProps: _objectSpread(_objectSpread({}, ListItemProps), LeftListItemProps),
|
|
308
|
-
ListItemIconProps: _objectSpread(_objectSpread({}, ListItemIconProps), LeftListItemIconProps),
|
|
309
|
-
ListItemTextProps: _objectSpread(_objectSpread({}, ListItemTextProps), LeftItemTextProps),
|
|
310
|
-
ListItemSecondaryActionProps: _objectSpread(_objectSpread({}, ListItemSecondaryActionProps), LeftItemSecondaryActionProps),
|
|
311
|
-
PaperProps: PaperProps,
|
|
312
|
-
LeftPaperProps: LeftPaperProps
|
|
313
|
-
})), /*#__PURE__*/React.createElement(Grid, _extends({
|
|
314
|
-
item: true,
|
|
315
|
-
xs: 12,
|
|
316
|
-
md: 2
|
|
317
|
-
}, ButtonsGridProps), /*#__PURE__*/React.createElement(Grid, _extends({
|
|
318
|
-
container: true
|
|
319
|
-
}, ButtonsInternalGridProps, {
|
|
320
|
-
className: clsx(classes.buttonsGrid, ButtonsInternalGridProps && ButtonsInternalGridProps.className)
|
|
321
|
-
}), allToRight && /*#__PURE__*/React.createElement(Grid, _extends({
|
|
322
|
-
item: true,
|
|
323
|
-
md: 12,
|
|
324
|
-
sm: 3
|
|
325
|
-
}, ButtonGridProps, AllToRightGridProps, {
|
|
326
|
-
className: clsx(classes.button, ButtonGridProps && ButtonGridProps.className, AllToRightGridProps && AllToRightGridProps.className)
|
|
327
|
-
}), /*#__PURE__*/React.createElement(Button, _extends({
|
|
328
|
-
variant: "outlined",
|
|
329
|
-
size: "small",
|
|
330
|
-
disabled: leftValues.length === 0,
|
|
331
|
-
onClick: handleClearLeftValues,
|
|
332
|
-
"aria-label": moveAllRightTitle
|
|
333
|
-
}, IconButtonProps, AllToRightIconButtonProps), "\u226B")), /*#__PURE__*/React.createElement(Grid, _extends({
|
|
334
|
-
item: true,
|
|
335
|
-
md: 12,
|
|
336
|
-
sm: 3
|
|
337
|
-
}, ButtonGridProps, ToRightGridProps, {
|
|
338
|
-
className: clsx(classes.button, ButtonGridProps && ButtonGridProps.className, ToRightGridProps && ToRightGridProps.className)
|
|
339
|
-
}), /*#__PURE__*/React.createElement(Button, _extends({
|
|
340
|
-
variant: "outlined",
|
|
341
|
-
size: "small",
|
|
342
|
-
disabled: leftValues.length === 0,
|
|
343
|
-
onClick: handleMoveRight,
|
|
344
|
-
"aria-label": moveRightTitle
|
|
345
|
-
}, IconButtonProps, ToRightIconButtonProps), ">")), /*#__PURE__*/React.createElement(Grid, _extends({
|
|
346
|
-
item: true,
|
|
347
|
-
md: 12,
|
|
348
|
-
sm: 3
|
|
349
|
-
}, ButtonGridProps, ToLeftGridProps, {
|
|
350
|
-
className: clsx(classes.button, ButtonGridProps && ButtonGridProps.className, ToLeftGridProps && ToLeftGridProps.className)
|
|
351
|
-
}), /*#__PURE__*/React.createElement(Button, _extends({
|
|
352
|
-
variant: "outlined",
|
|
353
|
-
size: "small",
|
|
354
|
-
disabled: rightValues.length === 0,
|
|
355
|
-
onClick: handleMoveLeft,
|
|
356
|
-
"aria-label": moveLeftTitle
|
|
357
|
-
}, IconButtonProps, ToLeftIconButtonProps), "<")), allToLeft && /*#__PURE__*/React.createElement(Grid, _extends({
|
|
358
|
-
item: true,
|
|
359
|
-
md: 12,
|
|
360
|
-
sm: 3
|
|
361
|
-
}, ButtonGridProps, AllToLeftGridProps, {
|
|
362
|
-
className: clsx(classes.button, ButtonGridProps && ButtonGridProps.className, AllToLeftGridProps && AllToLeftGridProps.className)
|
|
363
|
-
}), /*#__PURE__*/React.createElement(Button, _extends({
|
|
364
|
-
variant: "outlined",
|
|
365
|
-
size: "small",
|
|
366
|
-
disabled: rightValues.length === 0,
|
|
367
|
-
onClick: handleClearRightValues,
|
|
368
|
-
"aria-label": moveAllLeftTitle
|
|
369
|
-
}, IconButtonProps, AllToLeftIconButtonProps), "\u226A")))), /*#__PURE__*/React.createElement(Grid, _extends({
|
|
370
|
-
item: true,
|
|
371
|
-
xs: 12,
|
|
372
|
-
md: 5
|
|
373
|
-
}, ListGridProps, RightListGridProps), rightTitle && /*#__PURE__*/React.createElement(Typography, _extends({
|
|
374
|
-
variant: "h6",
|
|
375
|
-
gutterBottom: true
|
|
376
|
-
}, TitleProps, RightTitleProps), rightTitle), isFilterable && /*#__PURE__*/React.createElement(ToolbarInternal, {
|
|
377
|
-
ToolbarProps: ToolbarProps,
|
|
378
|
-
LeftToolbarProps: RightToolbarProps,
|
|
379
|
-
filterOptions: filterValues,
|
|
380
|
-
filterOptionsTitle: filterValueTitle,
|
|
381
|
-
FilterFieldProps: FilterFieldProps,
|
|
382
|
-
sortOptions: sortValues,
|
|
383
|
-
SortIconButtonProps: SortIconButtonProps,
|
|
384
|
-
SortIconProps: SortIconProps,
|
|
385
|
-
LeftSortIconProps: RightSortIconProps,
|
|
386
|
-
LeftFilterFieldProps: RightFilterFieldProps,
|
|
387
|
-
LeftSortIconButtonProps: RightSortIconButtonProps,
|
|
388
|
-
filter: state.filterValue,
|
|
389
|
-
sortDesc: state.sortRightDesc,
|
|
390
|
-
isValue: true
|
|
391
|
-
}), /*#__PURE__*/React.createElement(ListInternal, {
|
|
392
|
-
checkboxVariant: checkboxVariant,
|
|
393
|
-
optionClick: handleValuesClick,
|
|
394
|
-
value: rightValues,
|
|
395
|
-
noOptionsTitle: noValueTitle,
|
|
396
|
-
filterValue: state.filterValue,
|
|
397
|
-
filterValueText: filterValueText,
|
|
398
|
-
selectedValues: state.selectedRightValues,
|
|
399
|
-
ListProps: _objectSpread(_objectSpread({}, ListProps), RightListProps),
|
|
400
|
-
ListItemProps: _objectSpread(_objectSpread({}, ListItemProps), RightListItemProps),
|
|
401
|
-
ListItemIconProps: _objectSpread(_objectSpread({}, ListItemIconProps), RightListItemIconProps),
|
|
402
|
-
ListItemTextProps: _objectSpread(_objectSpread({}, ListItemTextProps), RightItemTextProps),
|
|
403
|
-
ListItemSecondaryActionProps: _objectSpread(_objectSpread({}, ListItemSecondaryActionProps), RightItemSecondaryActionProps),
|
|
404
|
-
PaperProps: PaperProps,
|
|
405
|
-
LeftPaperProps: RightPaperProps
|
|
406
|
-
}))), text && /*#__PURE__*/React.createElement(FormHelperText, FormHelperTextProps, text)));
|
|
407
|
-
};
|
|
408
|
-
var DualListSelectWrapper = function DualListSelectWrapper(props) {
|
|
409
|
-
return /*#__PURE__*/React.createElement(DualListSelectCommon, _extends({}, props, {
|
|
410
|
-
DualListSelect: DualListSelect
|
|
411
|
-
}));
|
|
23
|
+
[`& .${classes.upsideDown}`]: {
|
|
24
|
+
transform: 'scaleY(-1)',
|
|
25
|
+
},
|
|
26
|
+
[`& .${classes.list}`]: {
|
|
27
|
+
height: 300,
|
|
28
|
+
overflow: 'auto',
|
|
29
|
+
},
|
|
30
|
+
[`& .${classes.button}`]: {
|
|
31
|
+
display: 'flex',
|
|
32
|
+
justifyContent: 'center',
|
|
33
|
+
margin: theme.spacing(0.5, 0),
|
|
34
|
+
},
|
|
35
|
+
[`& .${classes.buttonsGrid}`]: {
|
|
36
|
+
height: '100%',
|
|
37
|
+
alignContent: 'center',
|
|
38
|
+
},
|
|
39
|
+
[`& .${classes.filter}`]: {
|
|
40
|
+
width: '100%',
|
|
41
|
+
},
|
|
42
|
+
[`& .${classes.toolbar}`]: {
|
|
43
|
+
paddingLeft: 16,
|
|
44
|
+
paddingRight: 16,
|
|
45
|
+
},
|
|
46
|
+
}));
|
|
47
|
+
const ListInternal = ({ value = [], optionClick, noOptionsTitle, filterValue, filterValueText, selectedValues, ListProps = {}, ListItemProps, ListItemIconProps, ListItemTextProps, ListItemSecondaryActionProps, checkboxVariant, PaperProps, LeftPaperProps, }) => (_jsx(Paper, Object.assign({}, PaperProps, LeftPaperProps, { className: clsx(PaperProps && PaperProps.className, LeftPaperProps && LeftPaperProps.className), children: _jsxs(List, Object.assign({ component: "div", role: "list", dense: true }, ListProps, { className: clsx(classes.list, ListProps.className), children: [value.length < 1 && (
|
|
48
|
+
// Need to be migrated to ListItemButton
|
|
49
|
+
// @ts-ignore
|
|
50
|
+
_jsx(ListItem, Object.assign({ button: true, disabled: true }, ListItemProps, { children: _jsx(ListItemText, { primary: filterValue ? filterValueText : noOptionsTitle }) }))), value.length > 0 &&
|
|
51
|
+
value.map(({ value, label, icon, isCheckbox, secondaryActions, ListItemProps: ListItemPropsItem, ListItemIconProps: ListItemIconPropsItem, ListItemTextProps: ListItemTextPropsItem, ListItemSecondaryActionProps: ListItemSecondaryActionPropsItem, }) => (_jsxs(ListItem
|
|
52
|
+
// Need to be migrated to ListItemButton
|
|
53
|
+
// @ts-ignore
|
|
54
|
+
, Object.assign({
|
|
55
|
+
// Need to be migrated to ListItemButton
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
button: true, selected: selectedValues.includes(value), onClick: (e) => optionClick(isCheckbox || checkboxVariant ? Object.assign(Object.assign({}, e), { ctrlKey: true }) : e, value), sx: { cursor: 'pointer' } }, ListItemProps, ListItemPropsItem, { children: [(icon || isCheckbox || checkboxVariant) && (_jsx(ListItemIcon, Object.assign({}, ListItemIconProps, ListItemIconPropsItem, { children: isCheckbox || checkboxVariant ? (_jsx(Checkbox, { edge: "start", checked: selectedValues.includes(value), tabIndex: -1, disableRipple: true })) : (icon) }))), _jsx(ListItemText, Object.assign({ primary: label }, ListItemTextProps, ListItemTextPropsItem)), secondaryActions && (_jsx(ListItemSecondaryAction, Object.assign({}, ListItemSecondaryActionProps, ListItemSecondaryActionPropsItem, { children: secondaryActions })))] }), value)))] })) })));
|
|
58
|
+
const ToolbarInternal = ({ ToolbarProps, LeftToolbarProps, filterOptions, filterOptionsTitle, FilterFieldProps, sortOptions, SortIconButtonProps, SortIconProps, LeftSortIconProps, LeftFilterFieldProps, LeftSortIconButtonProps, filter, sortDesc, isValue = false, }) => (_jsxs(Toolbar, Object.assign({ variant: "dense" }, ToolbarProps, LeftToolbarProps, { className: clsx(classes.toolbar, ToolbarProps && ToolbarProps.className, LeftToolbarProps && LeftToolbarProps.className), children: [_jsx(TextField, Object.assign({ "aria-label": isValue ? 'value-search' : 'options-search', label: filterOptionsTitle, onChange: ({ target: { value } }) => filterOptions(value), value: filter, type: "search" }, FilterFieldProps, LeftFilterFieldProps, { className: clsx(classes.filter, FilterFieldProps && FilterFieldProps.className, LeftFilterFieldProps && LeftFilterFieldProps.className) })), _jsx(IconButton, Object.assign({ "aria-label": isValue ? 'sort value' : 'sort options', edge: "end", onClick: sortOptions, color: "inherit" }, SortIconButtonProps, LeftSortIconButtonProps, { size: "large", children: _jsx(SortIcon, Object.assign({}, SortIconProps, LeftSortIconProps, { className: clsx(!sortDesc && classes.upsideDown, SortIconProps && SortIconProps.className, LeftSortIconProps && LeftSortIconProps.className) })) }))] })));
|
|
59
|
+
const DualListSelect = ({ handleOptionsClick, rightValues, noValueTitle = 'No selected', filterValueText = 'Remove your filter to see all selected', leftValues, noOptionsTitle = 'No available options', state, filterOptionsText = 'Remove your filter to see all options', handleValuesClick, handleMoveRight, moveRightTitle = 'Move selected to right', handleClearLeftValues, moveAllRightTitle = 'Move all to right', handleClearRightValues, moveAllLeftTitle = 'Move all to left', handleMoveLeft, moveLeftTitle = 'Move selected to left', allToRight = true, allToLeft = true, checkboxVariant, isRequired, meta, validateOnMount, label, helperText, description, filterOptionsTitle = 'Filter options', leftTitle = 'Options', filterOptions, sortOptions, sortValues, filterValueTitle = 'Filter selected value', filterValues, rightTitle = 'Selected', isFilterable = true,
|
|
60
|
+
// Props
|
|
61
|
+
FormFieldGridProps, InternalGridProps, ListGridProps, LeftListGridProps, ListProps, LeftListProps, ButtonsGridProps, ButtonsInternalGridProps, ButtonGridProps, ToRightGridProps, IconButtonProps, ToRightIconButtonProps, AllToRightGridProps, AllToRightIconButtonProps, AllToLeftGridProps, AllToLeftIconButtonProps, ToLeftGridProps, ToLeftIconButtonProps, RightListGridProps, RightListProps, ListItemProps, ListItemIconProps, ListItemTextProps, ListItemSecondaryActionProps, LeftListItemProps, LeftListItemIconProps, LeftItemTextProps, LeftItemSecondaryActionProps, RightListItemProps, RightListItemIconProps, RightItemTextProps, RightItemSecondaryActionProps, FormControlProps, FormLabelProps, FormHelperTextProps, TitleProps, ToolbarProps, FilterFieldProps, SortIconButtonProps, SortIconProps, LeftToolbarProps, LeftFilterFieldProps, LeftSortIconButtonProps, LeftSortIconProps, LeftTitleProps, RightToolbarProps, RightFilterFieldProps, RightSortIconButtonProps, RightSortIconProps, RightTitleProps, PaperProps, LeftPaperProps, RightPaperProps, }) => {
|
|
62
|
+
const invalid = validationError(meta, validateOnMount);
|
|
63
|
+
const text = invalid || ((meta.touched || validateOnMount) && meta.warning) || helperText || description;
|
|
64
|
+
return (_jsx(StyledDualListSelect, Object.assign({}, FormFieldGridProps, { children: _jsxs(FormControl, Object.assign({ fullWidth: true, required: isRequired, error: !!invalid, component: "fieldset" }, FormControlProps, { children: [_jsx(FormLabel, Object.assign({ component: "legend" }, FormLabelProps, { children: label })), _jsxs(Grid, Object.assign({ container: true }, InternalGridProps, { children: [_jsxs(Grid, Object.assign({ item: true, xs: 12, md: 5 }, ListGridProps, LeftListGridProps, { children: [leftTitle && (_jsx(Typography, Object.assign({ variant: "h6", gutterBottom: true }, TitleProps, LeftTitleProps, { children: leftTitle }))), isFilterable && (_jsx(ToolbarInternal, { ToolbarProps: ToolbarProps, LeftToolbarProps: LeftToolbarProps, filterOptions: filterOptions, filterOptionsTitle: filterOptionsTitle, FilterFieldProps: FilterFieldProps, sortOptions: sortOptions, SortIconButtonProps: SortIconButtonProps, SortIconProps: SortIconProps, LeftSortIconProps: LeftSortIconProps, LeftFilterFieldProps: LeftFilterFieldProps, LeftSortIconButtonProps: LeftSortIconButtonProps, filter: state.filterOptions, sortDesc: state.sortLeftDesc })), _jsx(ListInternal, { optionClick: handleOptionsClick, value: leftValues, noOptionsTitle: noOptionsTitle, filterValue: state.filterOptions, filterValueText: filterOptionsText, selectedValues: state.selectedLeftValues, checkboxVariant: checkboxVariant, ListProps: Object.assign(Object.assign({}, ListProps), LeftListProps), ListItemProps: Object.assign(Object.assign({}, ListItemProps), LeftListItemProps), ListItemIconProps: Object.assign(Object.assign({}, ListItemIconProps), LeftListItemIconProps), ListItemTextProps: Object.assign(Object.assign({}, ListItemTextProps), LeftItemTextProps), ListItemSecondaryActionProps: Object.assign(Object.assign({}, ListItemSecondaryActionProps), LeftItemSecondaryActionProps), PaperProps: PaperProps, LeftPaperProps: LeftPaperProps })] })), _jsx(Grid, Object.assign({ item: true, xs: 12, md: 2 }, ButtonsGridProps, { children: _jsxs(Grid, Object.assign({ container: true }, ButtonsInternalGridProps, { className: clsx(classes.buttonsGrid, ButtonsInternalGridProps && ButtonsInternalGridProps.className), children: [allToRight && (_jsx(Grid, Object.assign({ item: true, md: 12, sm: 3 }, ButtonGridProps, AllToRightGridProps, { className: clsx(classes.button, ButtonGridProps && ButtonGridProps.className, AllToRightGridProps && AllToRightGridProps.className), children: _jsx(Button, Object.assign({ variant: "outlined", size: "small", disabled: leftValues.length === 0, onClick: handleClearLeftValues, "aria-label": moveAllRightTitle }, IconButtonProps, AllToRightIconButtonProps, { children: "\u226B" })) }))), _jsx(Grid, Object.assign({ item: true, md: 12, sm: 3 }, ButtonGridProps, ToRightGridProps, { className: clsx(classes.button, ButtonGridProps && ButtonGridProps.className, ToRightGridProps && ToRightGridProps.className), children: _jsx(Button, Object.assign({ variant: "outlined", size: "small", disabled: leftValues.length === 0, onClick: handleMoveRight, "aria-label": moveRightTitle }, IconButtonProps, ToRightIconButtonProps, { children: ">" })) })), _jsx(Grid, Object.assign({ item: true, md: 12, sm: 3 }, ButtonGridProps, ToLeftGridProps, { className: clsx(classes.button, ButtonGridProps && ButtonGridProps.className, ToLeftGridProps && ToLeftGridProps.className), children: _jsx(Button, Object.assign({ variant: "outlined", size: "small", disabled: rightValues.length === 0, onClick: handleMoveLeft, "aria-label": moveLeftTitle }, IconButtonProps, ToLeftIconButtonProps, { children: "<" })) })), allToLeft && (_jsx(Grid, Object.assign({ item: true, md: 12, sm: 3 }, ButtonGridProps, AllToLeftGridProps, { className: clsx(classes.button, ButtonGridProps && ButtonGridProps.className, AllToLeftGridProps && AllToLeftGridProps.className), children: _jsx(Button, Object.assign({ variant: "outlined", size: "small", disabled: rightValues.length === 0, onClick: handleClearRightValues, "aria-label": moveAllLeftTitle }, IconButtonProps, AllToLeftIconButtonProps, { children: "\u226A" })) })))] })) })), _jsxs(Grid, Object.assign({ item: true, xs: 12, md: 5 }, ListGridProps, RightListGridProps, { children: [rightTitle && (_jsx(Typography, Object.assign({ variant: "h6", gutterBottom: true }, TitleProps, RightTitleProps, { children: rightTitle }))), isFilterable && (_jsx(ToolbarInternal, { ToolbarProps: ToolbarProps, LeftToolbarProps: RightToolbarProps, filterOptions: filterValues, filterOptionsTitle: filterValueTitle, FilterFieldProps: FilterFieldProps, sortOptions: sortValues, SortIconButtonProps: SortIconButtonProps, SortIconProps: SortIconProps, LeftSortIconProps: RightSortIconProps, LeftFilterFieldProps: RightFilterFieldProps, LeftSortIconButtonProps: RightSortIconButtonProps, filter: state.filterValue, sortDesc: state.sortRightDesc, isValue: true })), _jsx(ListInternal, { checkboxVariant: checkboxVariant, optionClick: handleValuesClick, value: rightValues, noOptionsTitle: noValueTitle, filterValue: state.filterValue, filterValueText: filterValueText, selectedValues: state.selectedRightValues, ListProps: Object.assign(Object.assign({}, ListProps), RightListProps), ListItemProps: Object.assign(Object.assign({}, ListItemProps), RightListItemProps), ListItemIconProps: Object.assign(Object.assign({}, ListItemIconProps), RightListItemIconProps), ListItemTextProps: Object.assign(Object.assign({}, ListItemTextProps), RightItemTextProps), ListItemSecondaryActionProps: Object.assign(Object.assign({}, ListItemSecondaryActionProps), RightItemSecondaryActionProps), PaperProps: PaperProps, LeftPaperProps: RightPaperProps })] }))] })), text && _jsx(FormHelperText, Object.assign({}, FormHelperTextProps, { children: text }))] })) })));
|
|
412
65
|
};
|
|
413
|
-
|
|
66
|
+
const DualListSelectWrapper = (props) => _jsx(DualListSelectCommon, Object.assign({}, props, { DualListSelect: DualListSelect }));
|
|
67
|
+
export default DualListSelectWrapper;
|
|
68
|
+
//# sourceMappingURL=dual-list-select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dual-list-select.js","sourceRoot":"","sources":["../../src/dual-list-select/dual-list-select.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,uBAAuB,EACvB,UAAU,EACV,WAAW,EACX,SAAS,EACT,cAAc,EACd,OAAO,EACP,SAAS,EACT,UAAU,EACV,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AAmBvB,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AAEvD,OAAO,oBAAoB,MAAM,4CAA4C,CAAC;AAE9E,OAAO,aAAa,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAEvE,MAAM,MAAM,GAAG,uBAAuB,CAAC;AAEvC,MAAM,OAAO,GAAG;IACd,aAAa,EAAE,GAAG,MAAM,gBAAgB;IACxC,UAAU,EAAE,GAAG,MAAM,aAAa;IAClC,IAAI,EAAE,GAAG,MAAM,OAAO;IACtB,MAAM,EAAE,GAAG,MAAM,SAAS;IAC1B,WAAW,EAAE,GAAG,MAAM,cAAc;IACpC,MAAM,EAAE,GAAG,MAAM,SAAS;IAC1B,OAAO,EAAE,GAAG,MAAM,UAAU;CAC7B,CAAC;AAEF,MAAM,oBA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AC,aAAa,EAC7B,OAAO,SACP,CACH,EACD,KAAC,YAAY,IACX,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,iBAAiB,EAC9B,KAAK,EAAE,WAAW,EAClB,cAAc,EAAE,YAAY,EAC5B,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,KAAK,CAAC,mBAAmB,EACzC,SAAS,kCAAO,SAAS,GAAK,cAAc,GAC5C,aAAa,kCAAO,aAAa,GAAK,kBAAkB,GACxD,iBAAiB,kCAAO,iBAAiB,GAAK,sBAAsB,GACpE,iBAAiB,kCAAO,iBAAiB,GAAK,kBAAkB,GAChE,4BAA4B,kCAAO,4BAA4B,GAAK,6BAA6B,GACjG,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,eAAe,GAC/B,KACG,KACF,EACN,IAAI,IAAI,KAAC,cAAc,oBAAK,mBAAmB,cAAG,IAAI,IAAkB,KAC7D,IACO,CACxB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,qBAAqB,GAAkB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAC,oBAAoB,oBAAK,KAAK,IAAE,cAAc,EAAE,cAAc,IAAI,CAAC;AAE5H,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dual-list-select/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BaseFieldProps, AnyObject } from '@data-driven-forms/react-form-renderer';
|
|
3
|
+
import type { GridProps, ButtonProps, TypographyProps, FormControlProps, FormHelperTextProps, IconButtonProps } from '@mui/material';
|
|
4
|
+
import type { FormFieldGridProps } from '../form-field-grid/form-field-grid';
|
|
5
|
+
interface ButtonLabels {
|
|
6
|
+
add?: string;
|
|
7
|
+
remove?: string;
|
|
8
|
+
}
|
|
9
|
+
interface HistoryAction {
|
|
10
|
+
action: 'remove';
|
|
11
|
+
value: any;
|
|
12
|
+
}
|
|
13
|
+
interface HistoryState {
|
|
14
|
+
index: number;
|
|
15
|
+
history: HistoryAction[];
|
|
16
|
+
}
|
|
17
|
+
type ReducerAction = {
|
|
18
|
+
type: 'redo';
|
|
19
|
+
} | {
|
|
20
|
+
type: 'undo';
|
|
21
|
+
} | {
|
|
22
|
+
type: 'action';
|
|
23
|
+
action: HistoryAction;
|
|
24
|
+
} | {
|
|
25
|
+
type: 'resetHistory';
|
|
26
|
+
};
|
|
27
|
+
export declare const reducer: (state: HistoryState, actionObj: ReducerAction) => HistoryState;
|
|
28
|
+
export interface DynamicArrayProps extends BaseFieldProps {
|
|
29
|
+
arrayValidator?: (value: any[]) => string | undefined;
|
|
30
|
+
fields: AnyObject[];
|
|
31
|
+
defaultItem?: any;
|
|
32
|
+
minItems?: number;
|
|
33
|
+
maxItems?: number;
|
|
34
|
+
noItemsMessage?: string;
|
|
35
|
+
buttonLabels?: ButtonLabels;
|
|
36
|
+
FormFieldGridProps?: FormFieldGridProps;
|
|
37
|
+
FormControlProps?: FormControlProps;
|
|
38
|
+
GridContainerProps?: GridProps;
|
|
39
|
+
HeaderGridProps?: GridProps;
|
|
40
|
+
HeaderProps?: TypographyProps;
|
|
41
|
+
UndoButtonProps?: IconButtonProps;
|
|
42
|
+
RedoButtonProps?: IconButtonProps;
|
|
43
|
+
AddButtonProps?: ButtonProps;
|
|
44
|
+
DescriptionGridProps?: GridProps;
|
|
45
|
+
DescriptionProps?: TypographyProps;
|
|
46
|
+
BodyGridProps?: GridProps;
|
|
47
|
+
NoItemsProps?: TypographyProps;
|
|
48
|
+
FormHelperTextGridProps?: GridProps;
|
|
49
|
+
FormHelperTextProps?: FormHelperTextProps;
|
|
50
|
+
FieldContainerProps?: GridProps;
|
|
51
|
+
FieldGroupGridProps?: GridProps;
|
|
52
|
+
RemoveButtonGridProps?: GridProps;
|
|
53
|
+
RemoveButtonProps?: ButtonProps;
|
|
54
|
+
}
|
|
55
|
+
declare const DynamicArray: React.FC<DynamicArrayProps>;
|
|
56
|
+
export default DynamicArray;
|