@scenid/react-formulator 1.2.5 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.css +1 -96
- package/dist/index.cjs.js +187 -196
- package/dist/index.esm.css +1 -96
- package/dist/index.esm.js +175 -158
- package/package.json +28 -23
package/dist/index.esm.js
CHANGED
|
@@ -1,41 +1,15 @@
|
|
|
1
1
|
import React, { useCallback, useState, useEffect, useRef, cloneElement } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import _Box from '@material-ui/core/esm/Box';
|
|
6
|
-
import _Typography from '@material-ui/core/esm/Typography';
|
|
7
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
8
|
-
import _FormGroup from '@material-ui/core/esm/FormGroup';
|
|
9
|
-
import _FormControl from '@material-ui/core/esm/FormControl';
|
|
10
|
-
import _FormHelperText from '@material-ui/core/esm/FormHelperText';
|
|
11
|
-
import _FormControlLabel from '@material-ui/core/esm/FormControlLabel';
|
|
12
|
-
import _InputAdornment from '@material-ui/core/esm/InputAdornment';
|
|
3
|
+
import { Box, Typography, Paper, FormGroup, InputAdornment, FormControl, FormControlLabel, FormHelperText, TextField, CircularProgress, MenuItem, Checkbox, Switch, List, ListItem, ListItemText, ListItemSecondaryAction, IconButton, Button, ClickAwayListener, Alert, Input } from '@mui/material';
|
|
4
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
13
5
|
import cx from 'classnames';
|
|
14
|
-
import { makeStyles as makeStyles$1, useTheme } from '@
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import _CircularProgress from '@material-ui/core/esm/CircularProgress';
|
|
18
|
-
import Autocomplete, { createFilterOptions } from '@material-ui/lab/Autocomplete';
|
|
19
|
-
import _MenuItem from '@material-ui/core/esm/MenuItem';
|
|
20
|
-
import _Switch from '@material-ui/core/esm/Switch';
|
|
21
|
-
import _Checkbox from '@material-ui/core/esm/Checkbox';
|
|
22
|
-
import _ClickAwayListener from '@material-ui/core/esm/ClickAwayListener';
|
|
23
|
-
import _Clear from '@material-ui/icons/esm/Clear';
|
|
24
|
-
import _Save from '@material-ui/icons/esm/Save';
|
|
25
|
-
import _Button from '@material-ui/core/esm/Button';
|
|
26
|
-
import _List from '@material-ui/core/esm/List';
|
|
27
|
-
import _ListItem from '@material-ui/core/esm/ListItem';
|
|
28
|
-
import _ListItemSecondaryAction from '@material-ui/core/esm/ListItemSecondaryAction';
|
|
29
|
-
import _IconButton from '@material-ui/core/esm/IconButton';
|
|
30
|
-
import _Delete from '@material-ui/icons/esm/Delete';
|
|
31
|
-
import _ListItemText from '@material-ui/core/esm/ListItemText';
|
|
6
|
+
import { makeStyles as makeStyles$1, useTheme } from '@mui/styles';
|
|
7
|
+
import { Autorenew, Delete, Save, Clear, Check, Close } from '@mui/icons-material';
|
|
8
|
+
import Autocomplete, { createFilterOptions } from '@mui/material/Autocomplete';
|
|
32
9
|
import path$3 from 'path';
|
|
33
10
|
import proc from 'process';
|
|
34
11
|
import { fileURLToPath } from 'url';
|
|
35
|
-
import {
|
|
36
|
-
import _Close from '@material-ui/icons/esm/Close';
|
|
37
|
-
import _Check from '@material-ui/icons/esm/Check';
|
|
38
|
-
import { alpha as alpha$1 } from '@material-ui/core/styles/colorManipulator';
|
|
12
|
+
import { alpha as alpha$1 } from '@mui/material/styles';
|
|
39
13
|
|
|
40
14
|
function _classCallCheck(instance, Constructor) {
|
|
41
15
|
if (!(instance instanceof Constructor)) {
|
|
@@ -2254,19 +2228,19 @@ var anObject$1E = anObject$1G;
|
|
|
2254
2228
|
var concat$6 = uncurryThis$1k([].concat);
|
|
2255
2229
|
|
|
2256
2230
|
// all object keys, includes non-enumerable and symbols
|
|
2257
|
-
var ownKeys$
|
|
2231
|
+
var ownKeys$8 = getBuiltIn$I('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
2258
2232
|
var keys = getOwnPropertyNamesModule$2.f(anObject$1E(it));
|
|
2259
2233
|
var getOwnPropertySymbols = getOwnPropertySymbolsModule$3.f;
|
|
2260
2234
|
return getOwnPropertySymbols ? concat$6(keys, getOwnPropertySymbols(it)) : keys;
|
|
2261
2235
|
};
|
|
2262
2236
|
|
|
2263
2237
|
var hasOwn$v = hasOwnProperty_1;
|
|
2264
|
-
var ownKeys$
|
|
2238
|
+
var ownKeys$7 = ownKeys$8;
|
|
2265
2239
|
var getOwnPropertyDescriptorModule$6 = objectGetOwnPropertyDescriptor;
|
|
2266
2240
|
var definePropertyModule$a = objectDefineProperty;
|
|
2267
2241
|
|
|
2268
2242
|
var copyConstructorProperties$4 = function (target, source, exceptions) {
|
|
2269
|
-
var keys = ownKeys$
|
|
2243
|
+
var keys = ownKeys$7(source);
|
|
2270
2244
|
var defineProperty = definePropertyModule$a.f;
|
|
2271
2245
|
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule$6.f;
|
|
2272
2246
|
for (var i = 0; i < keys.length; i++) {
|
|
@@ -7973,7 +7947,7 @@ $$3p({ target: 'Object', stat: true, forced: FORCED$9, sham: !DESCRIPTORS$i }, {
|
|
|
7973
7947
|
|
|
7974
7948
|
var $$3o = _export;
|
|
7975
7949
|
var DESCRIPTORS$h = descriptors;
|
|
7976
|
-
var ownKeys$
|
|
7950
|
+
var ownKeys$6 = ownKeys$8;
|
|
7977
7951
|
var toIndexedObject$7 = toIndexedObject$k;
|
|
7978
7952
|
var getOwnPropertyDescriptorModule$4 = objectGetOwnPropertyDescriptor;
|
|
7979
7953
|
var createProperty$1 = createProperty$9;
|
|
@@ -7984,7 +7958,7 @@ $$3o({ target: 'Object', stat: true, sham: !DESCRIPTORS$h }, {
|
|
|
7984
7958
|
getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
|
|
7985
7959
|
var O = toIndexedObject$7(object);
|
|
7986
7960
|
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule$4.f;
|
|
7987
|
-
var keys = ownKeys$
|
|
7961
|
+
var keys = ownKeys$6(O);
|
|
7988
7962
|
var result = {};
|
|
7989
7963
|
var index = 0;
|
|
7990
7964
|
var key, descriptor;
|
|
@@ -9350,12 +9324,12 @@ $$2S({ target: 'Reflect', stat: true }, {
|
|
|
9350
9324
|
});
|
|
9351
9325
|
|
|
9352
9326
|
var $$2R = _export;
|
|
9353
|
-
var ownKeys$
|
|
9327
|
+
var ownKeys$5 = ownKeys$8;
|
|
9354
9328
|
|
|
9355
9329
|
// `Reflect.ownKeys` method
|
|
9356
9330
|
// https://tc39.es/ecma262/#sec-reflect.ownkeys
|
|
9357
9331
|
$$2R({ target: 'Reflect', stat: true }, {
|
|
9358
|
-
ownKeys: ownKeys$
|
|
9332
|
+
ownKeys: ownKeys$5
|
|
9359
9333
|
});
|
|
9360
9334
|
|
|
9361
9335
|
var $$2Q = _export;
|
|
@@ -29393,20 +29367,20 @@ var FormGroupHeader = function FormGroupHeader(_ref) {
|
|
|
29393
29367
|
descVariant = _ref.descVariant,
|
|
29394
29368
|
textAlign = _ref.textAlign;
|
|
29395
29369
|
if (!label && !desc) return false;
|
|
29396
|
-
return /*#__PURE__*/React.createElement(
|
|
29370
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
29397
29371
|
style: {
|
|
29398
29372
|
width: '100%',
|
|
29399
29373
|
display: 'flex',
|
|
29400
29374
|
flexDirection: 'column'
|
|
29401
29375
|
}
|
|
29402
|
-
}, label && /*#__PURE__*/React.createElement(
|
|
29376
|
+
}, label && /*#__PURE__*/React.createElement(Box, {
|
|
29403
29377
|
mb: 2
|
|
29404
|
-
}, /*#__PURE__*/React.createElement(
|
|
29378
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
29405
29379
|
variant: labelVariant,
|
|
29406
29380
|
align: textAlign
|
|
29407
|
-
}, label)), desc && /*#__PURE__*/React.createElement(
|
|
29381
|
+
}, label)), desc && /*#__PURE__*/React.createElement(Box, {
|
|
29408
29382
|
mb: 2
|
|
29409
|
-
}, /*#__PURE__*/React.createElement(
|
|
29383
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
29410
29384
|
variant: descVariant,
|
|
29411
29385
|
align: textAlign
|
|
29412
29386
|
}, desc)));
|
|
@@ -29432,11 +29406,11 @@ var FormSectionCard = function FormSectionCard(_ref) {
|
|
|
29432
29406
|
descVariant = _ref.descVariant,
|
|
29433
29407
|
textAlign = _ref.textAlign,
|
|
29434
29408
|
children = _ref.children;
|
|
29435
|
-
return /*#__PURE__*/React.createElement(
|
|
29409
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
29436
29410
|
mb: 2
|
|
29437
|
-
}, /*#__PURE__*/React.createElement(
|
|
29411
|
+
}, /*#__PURE__*/React.createElement(Paper, {
|
|
29438
29412
|
elevation: 0
|
|
29439
|
-
}, /*#__PURE__*/React.createElement(
|
|
29413
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
29440
29414
|
p: 2
|
|
29441
29415
|
}, /*#__PURE__*/React.createElement(FormGroupHeader, {
|
|
29442
29416
|
label: label,
|
|
@@ -29474,7 +29448,7 @@ var FormSectionBlock = function FormSectionBlock(_ref) {
|
|
|
29474
29448
|
textAlign = _ref.textAlign,
|
|
29475
29449
|
children = _ref.children;
|
|
29476
29450
|
var styles = useStyles$4();
|
|
29477
|
-
return /*#__PURE__*/React.createElement(
|
|
29451
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
29478
29452
|
className: styles.formSectionBlock
|
|
29479
29453
|
}, /*#__PURE__*/React.createElement(FormGroupHeader, {
|
|
29480
29454
|
label: label,
|
|
@@ -29496,9 +29470,9 @@ FormSectionBlock.propTypes = {
|
|
|
29496
29470
|
|
|
29497
29471
|
var _excluded$7 = ["prepend", "append", "componentProps"];
|
|
29498
29472
|
|
|
29499
|
-
function ownKeys$
|
|
29473
|
+
function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
29500
29474
|
|
|
29501
|
-
function _objectSpread$
|
|
29475
|
+
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29502
29476
|
var useStyles$3 = makeStyles$1(function (theme) {
|
|
29503
29477
|
return {
|
|
29504
29478
|
error: {
|
|
@@ -29527,7 +29501,7 @@ var FormControlField$1 = function FormControlField(_ref) {
|
|
|
29527
29501
|
onChange = _ref.onChange;
|
|
29528
29502
|
var styles = useStyles$3();
|
|
29529
29503
|
|
|
29530
|
-
var finalProps = _objectSpread$
|
|
29504
|
+
var finalProps = _objectSpread$4(_objectSpread$4({
|
|
29531
29505
|
formVariant: formVariant,
|
|
29532
29506
|
name: name,
|
|
29533
29507
|
label: label,
|
|
@@ -29543,9 +29517,9 @@ var FormControlField$1 = function FormControlField(_ref) {
|
|
|
29543
29517
|
var isRender = type === '@@render';
|
|
29544
29518
|
|
|
29545
29519
|
if (validating) {
|
|
29546
|
-
finalProps.endAdornment = [/*#__PURE__*/React.createElement(
|
|
29520
|
+
finalProps.endAdornment = [/*#__PURE__*/React.createElement(InputAdornment, {
|
|
29547
29521
|
position: "end"
|
|
29548
|
-
}, /*#__PURE__*/React.createElement(
|
|
29522
|
+
}, /*#__PURE__*/React.createElement(Autorenew, null))];
|
|
29549
29523
|
}
|
|
29550
29524
|
|
|
29551
29525
|
var control;
|
|
@@ -29553,7 +29527,7 @@ var FormControlField$1 = function FormControlField(_ref) {
|
|
|
29553
29527
|
if (isRender) {
|
|
29554
29528
|
try {
|
|
29555
29529
|
var oldProps = component.props || {};
|
|
29556
|
-
control = /*#__PURE__*/React.cloneElement(component, _objectSpread$
|
|
29530
|
+
control = /*#__PURE__*/React.cloneElement(component, _objectSpread$4(_objectSpread$4(_objectSpread$4({
|
|
29557
29531
|
variant: variant
|
|
29558
29532
|
}, finalProps), oldProps), {}, {
|
|
29559
29533
|
label: label,
|
|
@@ -29566,7 +29540,7 @@ var FormControlField$1 = function FormControlField(_ref) {
|
|
|
29566
29540
|
}
|
|
29567
29541
|
} else {
|
|
29568
29542
|
try {
|
|
29569
|
-
control = /*#__PURE__*/React.createElement(component, _objectSpread$
|
|
29543
|
+
control = /*#__PURE__*/React.createElement(component, _objectSpread$4({
|
|
29570
29544
|
variant: variant
|
|
29571
29545
|
}, finalProps));
|
|
29572
29546
|
} catch (e) {
|
|
@@ -29581,19 +29555,19 @@ var FormControlField$1 = function FormControlField(_ref) {
|
|
|
29581
29555
|
return control;
|
|
29582
29556
|
}
|
|
29583
29557
|
|
|
29584
|
-
return /*#__PURE__*/React.createElement(
|
|
29558
|
+
return /*#__PURE__*/React.createElement(FormControl, {
|
|
29585
29559
|
className: "data-card-field",
|
|
29586
29560
|
error: dirty && hasErrors,
|
|
29587
29561
|
variant: variant,
|
|
29588
29562
|
margin: "dense",
|
|
29589
29563
|
fullWidth: true,
|
|
29590
29564
|
required: required
|
|
29591
|
-
}, isSwitch && /*#__PURE__*/React.createElement(
|
|
29565
|
+
}, isSwitch && /*#__PURE__*/React.createElement(FormControlLabel, {
|
|
29592
29566
|
className: cx(_defineProperty({}, styles.error, dirty && hasErrors)),
|
|
29593
29567
|
control: control,
|
|
29594
29568
|
label: label,
|
|
29595
29569
|
labelPlacement: finalProps.labelPlacement || 'end'
|
|
29596
|
-
}), !isSwitch && !isRepeater && !isRender && control, dirty && !disabled && hasErrors && /*#__PURE__*/React.createElement(
|
|
29570
|
+
}), !isSwitch && !isRepeater && !isRender && control, dirty && !disabled && hasErrors && /*#__PURE__*/React.createElement(FormHelperText, null, errors.map(function (e) {
|
|
29597
29571
|
return e.message;
|
|
29598
29572
|
}).join('. ')));
|
|
29599
29573
|
};
|
|
@@ -29627,7 +29601,7 @@ var FormField = function FormField(_ref2) {
|
|
|
29627
29601
|
componentProps = _ref2.componentProps,
|
|
29628
29602
|
fieldProps = _objectWithoutProperties(_ref2, _excluded$7);
|
|
29629
29603
|
|
|
29630
|
-
var finalProps = _objectSpread$
|
|
29604
|
+
var finalProps = _objectSpread$4({
|
|
29631
29605
|
componentProps: componentProps
|
|
29632
29606
|
}, fieldProps);
|
|
29633
29607
|
|
|
@@ -29639,7 +29613,7 @@ var FormField = function FormField(_ref2) {
|
|
|
29639
29613
|
});
|
|
29640
29614
|
}
|
|
29641
29615
|
|
|
29642
|
-
return /*#__PURE__*/React.createElement(
|
|
29616
|
+
return /*#__PURE__*/React.createElement(FormGroup, null, prepend, /*#__PURE__*/React.createElement(FormControlField$1, finalProps), append);
|
|
29643
29617
|
};
|
|
29644
29618
|
|
|
29645
29619
|
FormField.propTypes = {
|
|
@@ -29685,29 +29659,55 @@ function _extends() {
|
|
|
29685
29659
|
return _extends.apply(this, arguments);
|
|
29686
29660
|
}
|
|
29687
29661
|
|
|
29688
|
-
|
|
29689
|
-
|
|
29690
|
-
|
|
29691
|
-
|
|
29692
|
-
|
|
29693
|
-
|
|
29694
|
-
|
|
29695
|
-
|
|
29662
|
+
var FormText = function FormText(_ref) {
|
|
29663
|
+
var type = _ref.type,
|
|
29664
|
+
name = _ref.name,
|
|
29665
|
+
label = _ref.label,
|
|
29666
|
+
variant = _ref.variant,
|
|
29667
|
+
value = _ref.value,
|
|
29668
|
+
defaultValue = _ref.defaultValue,
|
|
29669
|
+
multiline = _ref.multiline,
|
|
29670
|
+
minRows = _ref.minRows,
|
|
29671
|
+
required = _ref.required,
|
|
29672
|
+
loading = _ref.loading,
|
|
29673
|
+
disabled = _ref.disabled,
|
|
29674
|
+
onChange = _ref.onChange;
|
|
29675
|
+
var extraProps = {};
|
|
29696
29676
|
|
|
29697
29677
|
if (type === 'date' || type === 'datetime-local') {
|
|
29698
|
-
|
|
29678
|
+
extraProps.InputLabelProps = {
|
|
29699
29679
|
shrink: true
|
|
29700
29680
|
};
|
|
29701
|
-
}
|
|
29681
|
+
}
|
|
29702
29682
|
|
|
29683
|
+
return /*#__PURE__*/React.createElement(TextField, _extends({
|
|
29684
|
+
type: type,
|
|
29685
|
+
name: name,
|
|
29686
|
+
label: label,
|
|
29687
|
+
variant: variant,
|
|
29688
|
+
value: value || defaultValue || '',
|
|
29689
|
+
multiline: multiline,
|
|
29690
|
+
minRows: minRows,
|
|
29691
|
+
required: required,
|
|
29692
|
+
disabled: disabled || loading,
|
|
29693
|
+
onChange: onChange || function () {} // eslint-disable-next-line react/jsx-props-no-spreading
|
|
29703
29694
|
|
|
29704
|
-
|
|
29705
|
-
type: type
|
|
29706
|
-
}, finalProps));
|
|
29695
|
+
}, extraProps));
|
|
29707
29696
|
};
|
|
29708
29697
|
|
|
29709
29698
|
FormText.propTypes = {
|
|
29710
|
-
type: PropTypes.string
|
|
29699
|
+
type: PropTypes.string,
|
|
29700
|
+
name: PropTypes.string,
|
|
29701
|
+
label: PropTypes.string,
|
|
29702
|
+
variant: PropTypes.string,
|
|
29703
|
+
value: PropTypes.string,
|
|
29704
|
+
defaultValue: PropTypes.string,
|
|
29705
|
+
multiline: PropTypes.bool,
|
|
29706
|
+
minRows: PropTypes.number,
|
|
29707
|
+
required: PropTypes.bool,
|
|
29708
|
+
loading: PropTypes.bool,
|
|
29709
|
+
disabled: PropTypes.bool,
|
|
29710
|
+
onChange: PropTypes.func
|
|
29711
29711
|
};
|
|
29712
29712
|
|
|
29713
29713
|
var castToNumber = function castToNumber(value, step) {
|
|
@@ -29730,7 +29730,7 @@ var FormNumber = function FormNumber(_ref) {
|
|
|
29730
29730
|
_onChange = _ref.onChange,
|
|
29731
29731
|
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
29732
29732
|
|
|
29733
|
-
return /*#__PURE__*/React.createElement(
|
|
29733
|
+
return /*#__PURE__*/React.createElement(TextField, _extends({
|
|
29734
29734
|
name: name,
|
|
29735
29735
|
type: "number",
|
|
29736
29736
|
value: castToNumber(value, step),
|
|
@@ -36774,7 +36774,7 @@ var FormReadOnlyText = function FormReadOnlyText(_ref) {
|
|
|
36774
36774
|
finalValue = DateTime.fromISO(value).toLocaleString(formatter);
|
|
36775
36775
|
}
|
|
36776
36776
|
|
|
36777
|
-
return /*#__PURE__*/React.createElement(
|
|
36777
|
+
return /*#__PURE__*/React.createElement(Typography, {
|
|
36778
36778
|
variant: "body1",
|
|
36779
36779
|
style: {
|
|
36780
36780
|
whiteSpace: multiline ? 'pre-line' : 'inherit'
|
|
@@ -36801,16 +36801,17 @@ var _renderInput = function renderInput(_ref, params) {
|
|
|
36801
36801
|
|
|
36802
36802
|
if (loading) {
|
|
36803
36803
|
InputProps = {
|
|
36804
|
-
endAdornment: /*#__PURE__*/React.createElement(
|
|
36804
|
+
endAdornment: /*#__PURE__*/React.createElement(InputAdornment, {
|
|
36805
36805
|
position: "end"
|
|
36806
|
-
}, /*#__PURE__*/React.createElement(
|
|
36806
|
+
}, /*#__PURE__*/React.createElement(CircularProgress, {
|
|
36807
36807
|
size: 20,
|
|
36808
36808
|
thickness: 4
|
|
36809
36809
|
}))
|
|
36810
36810
|
};
|
|
36811
36811
|
}
|
|
36812
36812
|
|
|
36813
|
-
return /*#__PURE__*/React.createElement(
|
|
36813
|
+
return /*#__PURE__*/React.createElement(TextField // eslint-disable-next-line react/jsx-props-no-spreading
|
|
36814
|
+
, _extends({}, params, {
|
|
36814
36815
|
required: required,
|
|
36815
36816
|
label: label,
|
|
36816
36817
|
variant: variant,
|
|
@@ -36838,7 +36839,7 @@ var SelectOrCreate = function SelectOrCreate(_ref2) {
|
|
|
36838
36839
|
onInputChange = _ref2.onInputChange;
|
|
36839
36840
|
return /*#__PURE__*/React.createElement(Autocomplete, {
|
|
36840
36841
|
id: id,
|
|
36841
|
-
value: value,
|
|
36842
|
+
value: value || '',
|
|
36842
36843
|
fullWidth: true,
|
|
36843
36844
|
disabled: disabled,
|
|
36844
36845
|
onOpen: onOpen,
|
|
@@ -36870,6 +36871,7 @@ var SelectOrCreate = function SelectOrCreate(_ref2) {
|
|
|
36870
36871
|
clearOnBlur: true,
|
|
36871
36872
|
handleHomeEndKeys: true,
|
|
36872
36873
|
options: options,
|
|
36874
|
+
freeSolo: allowCreate,
|
|
36873
36875
|
getOptionLabel: function getOptionLabel(option) {
|
|
36874
36876
|
// Value selected with enter, right from the input
|
|
36875
36877
|
if (typeof option === 'string') {
|
|
@@ -36880,15 +36882,17 @@ var SelectOrCreate = function SelectOrCreate(_ref2) {
|
|
|
36880
36882
|
} // Add "xxx" option created dynamically
|
|
36881
36883
|
|
|
36882
36884
|
|
|
36883
|
-
if (option.inputValue) {
|
|
36884
|
-
return option.inputValue;
|
|
36885
|
+
if (option !== null && option !== void 0 && option.inputValue) {
|
|
36886
|
+
return option === null || option === void 0 ? void 0 : option.inputValue;
|
|
36885
36887
|
} // Regular option
|
|
36886
36888
|
|
|
36887
36889
|
|
|
36888
36890
|
return option[searchKey];
|
|
36889
36891
|
},
|
|
36892
|
+
isOptionEqualToValue: function isOptionEqualToValue(option, testValue) {
|
|
36893
|
+
return option[searchKey] === testValue;
|
|
36894
|
+
},
|
|
36890
36895
|
renderOption: renderOption,
|
|
36891
|
-
freeSolo: true,
|
|
36892
36896
|
renderInput: function renderInput(params) {
|
|
36893
36897
|
return _renderInput({
|
|
36894
36898
|
required: required,
|
|
@@ -36914,11 +36918,11 @@ SelectOrCreate.propTypes = {
|
|
|
36914
36918
|
searchKey: PropTypes.string.isRequired,
|
|
36915
36919
|
renderOption: PropTypes.func.isRequired,
|
|
36916
36920
|
renderNewOption: PropTypes.func.isRequired,
|
|
36917
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.object])
|
|
36921
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
36918
36922
|
onOpen: PropTypes.func,
|
|
36919
36923
|
onClose: PropTypes.func,
|
|
36920
|
-
onChange: PropTypes.func
|
|
36921
|
-
onInputChange: PropTypes.func
|
|
36924
|
+
onChange: PropTypes.func,
|
|
36925
|
+
onInputChange: PropTypes.func
|
|
36922
36926
|
};
|
|
36923
36927
|
|
|
36924
36928
|
var FormAutocomplete = function FormAutocomplete(_ref) {
|
|
@@ -36955,20 +36959,20 @@ var FormAutocomplete = function FormAutocomplete(_ref) {
|
|
|
36955
36959
|
}
|
|
36956
36960
|
|
|
36957
36961
|
if (!options) {
|
|
36958
|
-
return /*#__PURE__*/React.createElement(
|
|
36962
|
+
return /*#__PURE__*/React.createElement(FormControl, {
|
|
36959
36963
|
error: dirty && hasErrors,
|
|
36960
36964
|
margin: "dense",
|
|
36961
36965
|
fullWidth: true,
|
|
36962
36966
|
required: required
|
|
36963
|
-
}, /*#__PURE__*/React.createElement(
|
|
36967
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
36964
36968
|
label: label,
|
|
36965
36969
|
variant: variant,
|
|
36966
36970
|
value: value,
|
|
36967
36971
|
disabled: true,
|
|
36968
36972
|
InputProps: {
|
|
36969
|
-
endAdornment: /*#__PURE__*/React.createElement(
|
|
36973
|
+
endAdornment: /*#__PURE__*/React.createElement(InputAdornment, {
|
|
36970
36974
|
position: "end"
|
|
36971
|
-
}, /*#__PURE__*/React.createElement(
|
|
36975
|
+
}, /*#__PURE__*/React.createElement(CircularProgress, {
|
|
36972
36976
|
size: 20,
|
|
36973
36977
|
thickness: 4
|
|
36974
36978
|
}))
|
|
@@ -36976,7 +36980,7 @@ var FormAutocomplete = function FormAutocomplete(_ref) {
|
|
|
36976
36980
|
}));
|
|
36977
36981
|
}
|
|
36978
36982
|
|
|
36979
|
-
return /*#__PURE__*/React.createElement(
|
|
36983
|
+
return /*#__PURE__*/React.createElement(FormControl, {
|
|
36980
36984
|
error: dirty && hasErrors,
|
|
36981
36985
|
margin: "dense",
|
|
36982
36986
|
fullWidth: true,
|
|
@@ -36990,15 +36994,23 @@ var FormAutocomplete = function FormAutocomplete(_ref) {
|
|
|
36990
36994
|
searchKey: "entry",
|
|
36991
36995
|
required: required,
|
|
36992
36996
|
disabled: disabled,
|
|
36993
|
-
renderOption: function renderOption(option) {
|
|
36994
|
-
return /*#__PURE__*/React.createElement(
|
|
36997
|
+
renderOption: function renderOption(props, option) {
|
|
36998
|
+
return /*#__PURE__*/React.createElement(Box // eslint-disable-next-line react/jsx-props-no-spreading
|
|
36999
|
+
, _extends({}, props, {
|
|
37000
|
+
sx: {
|
|
37001
|
+
display: 'flex',
|
|
37002
|
+
flexDirection: 'column',
|
|
37003
|
+
justifyContent: 'flex-start',
|
|
37004
|
+
alignItems: 'flex-start'
|
|
37005
|
+
}
|
|
37006
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
36995
37007
|
variant: "body1"
|
|
36996
|
-
}, option.entry), option.count !== undefined && option.count !== null && /*#__PURE__*/React.createElement(
|
|
37008
|
+
}, option.entry), option.count !== undefined && option.count !== null && /*#__PURE__*/React.createElement(Typography, {
|
|
36997
37009
|
variant: "caption"
|
|
36998
37010
|
}, "".concat(option.count, " Eintr\xE4ge")));
|
|
36999
37011
|
},
|
|
37000
37012
|
renderNewOption: function renderNewOption(newValue) {
|
|
37001
|
-
return /*#__PURE__*/React.createElement(
|
|
37013
|
+
return /*#__PURE__*/React.createElement(Typography, {
|
|
37002
37014
|
variant: "body1"
|
|
37003
37015
|
}, /*#__PURE__*/React.createElement("strong", null, "\"".concat(newValue, "\" ")), "erstellen");
|
|
37004
37016
|
},
|
|
@@ -37013,7 +37025,7 @@ var FormAutocomplete = function FormAutocomplete(_ref) {
|
|
|
37013
37025
|
if (abort) abort();
|
|
37014
37026
|
},
|
|
37015
37027
|
onChange: changeValue
|
|
37016
|
-
}), dirty && !disabled && hasErrors && /*#__PURE__*/React.createElement(
|
|
37028
|
+
}), dirty && !disabled && hasErrors && /*#__PURE__*/React.createElement(FormHelperText, null, errors.map(function (e) {
|
|
37017
37029
|
return e.message;
|
|
37018
37030
|
}).join('. ')));
|
|
37019
37031
|
};
|
|
@@ -37026,7 +37038,7 @@ FormAutocomplete.propTypes = {
|
|
|
37026
37038
|
options: PropTypes.arrayOf(PropTypes.shape({
|
|
37027
37039
|
entry: PropTypes.string.isRequired,
|
|
37028
37040
|
count: PropTypes.number
|
|
37029
|
-
}))
|
|
37041
|
+
})),
|
|
37030
37042
|
allowCreate: PropTypes.bool,
|
|
37031
37043
|
variant: PropTypes.oneOf(['standard', 'filled', 'outlined']),
|
|
37032
37044
|
required: PropTypes.bool,
|
|
@@ -37040,39 +37052,44 @@ FormAutocomplete.propTypes = {
|
|
|
37040
37052
|
onChange: PropTypes.func
|
|
37041
37053
|
};
|
|
37042
37054
|
|
|
37043
|
-
var _excluded$5 = ["options", "required", "defaultValue", "value", "noSort"];
|
|
37055
|
+
var _excluded$5 = ["name", "options", "required", "defaultValue", "value", "noSort", "onChange"];
|
|
37044
37056
|
|
|
37045
37057
|
var FormSelect = function FormSelect(_ref) {
|
|
37046
|
-
var
|
|
37058
|
+
var name = _ref.name,
|
|
37059
|
+
options = _ref.options,
|
|
37047
37060
|
required = _ref.required,
|
|
37048
37061
|
defaultValue = _ref.defaultValue,
|
|
37049
37062
|
value = _ref.value,
|
|
37050
37063
|
noSort = _ref.noSort,
|
|
37064
|
+
onChange = _ref.onChange,
|
|
37051
37065
|
props = _objectWithoutProperties(_ref, _excluded$5);
|
|
37052
37066
|
|
|
37053
37067
|
var allOptions = noSort ? options : options.sort(function (l, r) {
|
|
37054
37068
|
return l.label.localeCompare(r.label);
|
|
37055
37069
|
});
|
|
37056
37070
|
|
|
37057
|
-
if (!required) {
|
|
37071
|
+
if (!required && !defaultValue) {
|
|
37058
37072
|
allOptions.unshift({
|
|
37059
37073
|
label: 'Auswahl löschen',
|
|
37060
|
-
value:
|
|
37074
|
+
value: ''
|
|
37061
37075
|
});
|
|
37062
37076
|
}
|
|
37063
37077
|
|
|
37064
37078
|
var finalValue = '';
|
|
37065
37079
|
if (value !== undefined) finalValue = value;
|
|
37066
37080
|
if (finalValue === '' && defaultValue !== undefined) finalValue = defaultValue;
|
|
37067
|
-
return /*#__PURE__*/React.createElement(
|
|
37081
|
+
return /*#__PURE__*/React.createElement(TextField, _extends({
|
|
37082
|
+
name: name,
|
|
37068
37083
|
select: true,
|
|
37069
37084
|
required: required,
|
|
37070
37085
|
value: finalValue // eslint-disable-next-line react/jsx-props-no-spreading
|
|
37071
37086
|
|
|
37072
|
-
}, props
|
|
37087
|
+
}, props, {
|
|
37088
|
+
onChange: onChange
|
|
37089
|
+
}), allOptions.map(function (_ref2) {
|
|
37073
37090
|
var itemLabel = _ref2.label,
|
|
37074
37091
|
itemValue = _ref2.value;
|
|
37075
|
-
return /*#__PURE__*/React.createElement(
|
|
37092
|
+
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
37076
37093
|
key: itemLabel,
|
|
37077
37094
|
value: itemValue
|
|
37078
37095
|
}, itemLabel);
|
|
@@ -37080,16 +37097,16 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
37080
37097
|
};
|
|
37081
37098
|
|
|
37082
37099
|
FormSelect.propTypes = {
|
|
37083
|
-
name: PropTypes.string
|
|
37100
|
+
name: PropTypes.string,
|
|
37084
37101
|
defaultValue: PropTypes.string,
|
|
37085
37102
|
value: PropTypes.string,
|
|
37086
37103
|
options: PropTypes.arrayOf(PropTypes.shape({
|
|
37087
37104
|
label: PropTypes.string.isRequired,
|
|
37088
37105
|
value: PropTypes.any
|
|
37089
|
-
}))
|
|
37106
|
+
})),
|
|
37090
37107
|
required: PropTypes.bool,
|
|
37091
37108
|
noSort: PropTypes.bool,
|
|
37092
|
-
onChange: PropTypes.func
|
|
37109
|
+
onChange: PropTypes.func
|
|
37093
37110
|
};
|
|
37094
37111
|
|
|
37095
37112
|
var _excluded$4 = ["type", "options", "autocomplete"];
|
|
@@ -37154,7 +37171,7 @@ var FormBoolean = function FormBoolean(_ref) {
|
|
|
37154
37171
|
};
|
|
37155
37172
|
|
|
37156
37173
|
if (variant === 'checkbox') {
|
|
37157
|
-
return /*#__PURE__*/React.createElement(
|
|
37174
|
+
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
37158
37175
|
color: "primary",
|
|
37159
37176
|
name: name,
|
|
37160
37177
|
checked: isChecked$2(value, defaultValue),
|
|
@@ -37162,7 +37179,7 @@ var FormBoolean = function FormBoolean(_ref) {
|
|
|
37162
37179
|
});
|
|
37163
37180
|
}
|
|
37164
37181
|
|
|
37165
|
-
return /*#__PURE__*/React.createElement(
|
|
37182
|
+
return /*#__PURE__*/React.createElement(Switch, {
|
|
37166
37183
|
color: "primary",
|
|
37167
37184
|
name: name,
|
|
37168
37185
|
checked: isChecked$2(value, defaultValue),
|
|
@@ -37293,72 +37310,72 @@ var FormRepeater = function FormRepeater(_ref) {
|
|
|
37293
37310
|
});
|
|
37294
37311
|
}
|
|
37295
37312
|
|
|
37296
|
-
return /*#__PURE__*/React.createElement(
|
|
37313
|
+
return /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Typography, {
|
|
37297
37314
|
variant: "body1"
|
|
37298
|
-
}, label), (!entries || (entries === null || entries === void 0 ? void 0 : entries.length) === 0) && /*#__PURE__*/React.createElement(
|
|
37315
|
+
}, label), (!entries || (entries === null || entries === void 0 ? void 0 : entries.length) === 0) && /*#__PURE__*/React.createElement(Box, {
|
|
37299
37316
|
mt: 1,
|
|
37300
37317
|
pl: 2
|
|
37301
|
-
}, /*#__PURE__*/React.createElement(
|
|
37318
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
37302
37319
|
variant: "body2",
|
|
37303
37320
|
color: "textSecondary"
|
|
37304
|
-
}, "Keine Eintr\xE4ge vorhanden")), /*#__PURE__*/React.createElement(
|
|
37321
|
+
}, "Keine Eintr\xE4ge vorhanden")), /*#__PURE__*/React.createElement(List, {
|
|
37305
37322
|
dense: true
|
|
37306
37323
|
}, entries.map(function (entry, index) {
|
|
37307
37324
|
return (
|
|
37308
37325
|
/*#__PURE__*/
|
|
37309
37326
|
// eslint-disable-next-line react/no-array-index-key
|
|
37310
|
-
React.createElement(
|
|
37327
|
+
React.createElement(ListItem, {
|
|
37311
37328
|
key: "entry-".concat(index)
|
|
37312
|
-
}, /*#__PURE__*/React.createElement(
|
|
37329
|
+
}, /*#__PURE__*/React.createElement(ListItemText, {
|
|
37313
37330
|
primary: getValue$1(entry, options)
|
|
37314
|
-
}), /*#__PURE__*/React.createElement(
|
|
37331
|
+
}), /*#__PURE__*/React.createElement(ListItemSecondaryAction, null, /*#__PURE__*/React.createElement(IconButton, {
|
|
37315
37332
|
edge: "end",
|
|
37316
37333
|
"aria-label": "delete",
|
|
37317
37334
|
size: "small",
|
|
37318
37335
|
onClick: function onClick() {
|
|
37319
37336
|
return handleEntryDel(index);
|
|
37320
37337
|
}
|
|
37321
|
-
}, /*#__PURE__*/React.createElement(
|
|
37338
|
+
}, /*#__PURE__*/React.createElement(Delete, {
|
|
37322
37339
|
fontSize: "small"
|
|
37323
37340
|
}))))
|
|
37324
37341
|
);
|
|
37325
|
-
})), !inEdit && /*#__PURE__*/React.createElement(
|
|
37342
|
+
})), !inEdit && /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Button, {
|
|
37326
37343
|
color: "primary",
|
|
37327
37344
|
variant: "outlined",
|
|
37328
37345
|
onClick: function onClick() {
|
|
37329
37346
|
return setInEdit(true);
|
|
37330
37347
|
}
|
|
37331
|
-
}, "Eintr\xE4ge hinzuf\xFCgen")), inEdit && !options && /*#__PURE__*/React.createElement(
|
|
37348
|
+
}, "Eintr\xE4ge hinzuf\xFCgen")), inEdit && !options && /*#__PURE__*/React.createElement(Box, {
|
|
37332
37349
|
width: "100%",
|
|
37333
37350
|
display: "flex",
|
|
37334
37351
|
alignItems: "center"
|
|
37335
|
-
}, /*#__PURE__*/React.createElement(
|
|
37352
|
+
}, /*#__PURE__*/React.createElement(ClickAwayListener, {
|
|
37336
37353
|
onClickAway: function onClickAway() {
|
|
37337
37354
|
if (inputValue === '') {
|
|
37338
37355
|
setInEdit(false);
|
|
37339
37356
|
}
|
|
37340
37357
|
}
|
|
37341
|
-
}, /*#__PURE__*/React.createElement(
|
|
37358
|
+
}, /*#__PURE__*/React.createElement(FormControl, {
|
|
37342
37359
|
variant: "filled",
|
|
37343
37360
|
fullWidth: true
|
|
37344
|
-
}, /*#__PURE__*/React.createElement(
|
|
37361
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
37345
37362
|
label: "Neuer Eintrag",
|
|
37346
37363
|
variant: variant,
|
|
37347
37364
|
value: inputValue,
|
|
37348
37365
|
InputProps: {
|
|
37349
|
-
endAdornment: /*#__PURE__*/React.createElement(
|
|
37366
|
+
endAdornment: /*#__PURE__*/React.createElement(InputAdornment, {
|
|
37350
37367
|
position: "end"
|
|
37351
|
-
}, /*#__PURE__*/React.createElement(
|
|
37368
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
37352
37369
|
mr: 1
|
|
37353
|
-
}, /*#__PURE__*/React.createElement(
|
|
37370
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
37354
37371
|
size: "small",
|
|
37355
37372
|
onClick: handleEntryAdd
|
|
37356
|
-
}, /*#__PURE__*/React.createElement(
|
|
37373
|
+
}, /*#__PURE__*/React.createElement(Save, {
|
|
37357
37374
|
fontSize: "small"
|
|
37358
|
-
}))), /*#__PURE__*/React.createElement(
|
|
37375
|
+
}))), /*#__PURE__*/React.createElement(IconButton, {
|
|
37359
37376
|
size: "small",
|
|
37360
37377
|
onClick: handleCancelNewEntry
|
|
37361
|
-
}, /*#__PURE__*/React.createElement(
|
|
37378
|
+
}, /*#__PURE__*/React.createElement(Clear, {
|
|
37362
37379
|
fontSize: "small"
|
|
37363
37380
|
})))
|
|
37364
37381
|
},
|
|
@@ -37369,14 +37386,14 @@ var FormRepeater = function FormRepeater(_ref) {
|
|
|
37369
37386
|
onChange: function onChange(e) {
|
|
37370
37387
|
return setInputValue(e.target.value);
|
|
37371
37388
|
}
|
|
37372
|
-
})))), inEdit && options && /*#__PURE__*/React.createElement(
|
|
37389
|
+
})))), inEdit && options && /*#__PURE__*/React.createElement(Box, {
|
|
37373
37390
|
width: "100%",
|
|
37374
37391
|
display: "flex",
|
|
37375
37392
|
alignItems: "center"
|
|
37376
|
-
}, /*#__PURE__*/React.createElement(
|
|
37393
|
+
}, /*#__PURE__*/React.createElement(FormControl, {
|
|
37377
37394
|
variant: "filled",
|
|
37378
37395
|
fullWidth: true
|
|
37379
|
-
}, /*#__PURE__*/React.createElement(
|
|
37396
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
37380
37397
|
label: "Eintrag ausw\xE4hlen",
|
|
37381
37398
|
select: true,
|
|
37382
37399
|
variant: variant,
|
|
@@ -37389,7 +37406,7 @@ var FormRepeater = function FormRepeater(_ref) {
|
|
|
37389
37406
|
}, Object.entries(options).sort(function (a, b) {
|
|
37390
37407
|
return a[1].localeCompare(b[1]);
|
|
37391
37408
|
}).map(function (e) {
|
|
37392
|
-
return /*#__PURE__*/React.createElement(
|
|
37409
|
+
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
37393
37410
|
key: "option-".concat(e[0]),
|
|
37394
37411
|
value: e[0],
|
|
37395
37412
|
disabled: blockedOptions.includes(e[0])
|
|
@@ -37455,9 +37472,9 @@ var FormControlField = function FormControlField(_ref) {
|
|
|
37455
37472
|
|
|
37456
37473
|
var control;
|
|
37457
37474
|
if (type === '@@render') control = /*#__PURE__*/React.cloneElement(component, finalProps);else control = /*#__PURE__*/React.createElement(component, finalProps);
|
|
37458
|
-
return /*#__PURE__*/React.createElement(
|
|
37475
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
37459
37476
|
className: styles.readOnlyField
|
|
37460
|
-
}, label && !isSwitch && /*#__PURE__*/React.createElement(
|
|
37477
|
+
}, label && !isSwitch && /*#__PURE__*/React.createElement(Typography, {
|
|
37461
37478
|
variant: "caption",
|
|
37462
37479
|
color: "textSecondary"
|
|
37463
37480
|
}, label), control);
|
|
@@ -75784,22 +75801,22 @@ var FormReadOnlyBoolean = function FormReadOnlyBoolean(_ref) {
|
|
|
75784
75801
|
labelPlacement = _ref.labelPlacement;
|
|
75785
75802
|
|
|
75786
75803
|
if (variant === 'checkbox') {
|
|
75787
|
-
return /*#__PURE__*/React.createElement(
|
|
75804
|
+
return /*#__PURE__*/React.createElement(FormControlLabel, {
|
|
75788
75805
|
label: label,
|
|
75789
75806
|
labelPlacement: labelPlacement || 'end',
|
|
75790
75807
|
disabled: true,
|
|
75791
|
-
control: /*#__PURE__*/React.createElement(
|
|
75808
|
+
control: /*#__PURE__*/React.createElement(Checkbox, {
|
|
75792
75809
|
name: name,
|
|
75793
75810
|
checked: isChecked$1(value, defaultValue)
|
|
75794
75811
|
})
|
|
75795
75812
|
});
|
|
75796
75813
|
}
|
|
75797
75814
|
|
|
75798
|
-
return /*#__PURE__*/React.createElement(
|
|
75815
|
+
return /*#__PURE__*/React.createElement(FormControlLabel, {
|
|
75799
75816
|
label: label,
|
|
75800
75817
|
labelPlacement: labelPlacement || 'end',
|
|
75801
75818
|
disabled: true,
|
|
75802
|
-
control: /*#__PURE__*/React.createElement(
|
|
75819
|
+
control: /*#__PURE__*/React.createElement(Switch, {
|
|
75803
75820
|
name: name,
|
|
75804
75821
|
checked: isChecked$1(value, defaultValue)
|
|
75805
75822
|
})
|
|
@@ -75833,16 +75850,16 @@ var FormReadOnlyRepeater = function FormReadOnlyRepeater(_ref) {
|
|
|
75833
75850
|
var value = _ref.value,
|
|
75834
75851
|
options = _ref.options;
|
|
75835
75852
|
var styles = useStyles$1();
|
|
75836
|
-
return /*#__PURE__*/React.createElement(
|
|
75853
|
+
return /*#__PURE__*/React.createElement(List, {
|
|
75837
75854
|
className: styles.formRepeater,
|
|
75838
75855
|
dense: true
|
|
75839
75856
|
}, value && value.map(function (entry, index) {
|
|
75840
75857
|
return (
|
|
75841
75858
|
/*#__PURE__*/
|
|
75842
75859
|
// eslint-disable-next-line react/no-array-index-key
|
|
75843
|
-
React.createElement(
|
|
75860
|
+
React.createElement(ListItem, {
|
|
75844
75861
|
key: "entry-".concat(index)
|
|
75845
|
-
}, /*#__PURE__*/React.createElement(
|
|
75862
|
+
}, /*#__PURE__*/React.createElement(ListItemText, {
|
|
75846
75863
|
primary: getValue(entry, options),
|
|
75847
75864
|
style: {
|
|
75848
75865
|
margin: 0
|
|
@@ -75860,11 +75877,11 @@ FormReadOnlyRepeater.propTypes = {
|
|
|
75860
75877
|
var HiddenData = function HiddenData(_ref) {
|
|
75861
75878
|
var subject = _ref.subject,
|
|
75862
75879
|
label = _ref.label;
|
|
75863
|
-
return /*#__PURE__*/React.createElement(
|
|
75880
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
75864
75881
|
mb: 2
|
|
75865
75882
|
}, /*#__PURE__*/React.createElement(Alert, {
|
|
75866
75883
|
severity: "warning"
|
|
75867
|
-
}, /*#__PURE__*/React.createElement(
|
|
75884
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
75868
75885
|
variant: "body1"
|
|
75869
75886
|
}, subject ? "".concat(subject, " ") : '', /*#__PURE__*/React.createElement("span", {
|
|
75870
75887
|
style: {
|
|
@@ -75906,8 +75923,8 @@ var formComponentMap = {
|
|
|
75906
75923
|
array: FormRepeater
|
|
75907
75924
|
};
|
|
75908
75925
|
var apComponentMap = {
|
|
75909
|
-
"default":
|
|
75910
|
-
string:
|
|
75926
|
+
"default": Input,
|
|
75927
|
+
string: Input,
|
|
75911
75928
|
number: FormNumber,
|
|
75912
75929
|
select: FormCatalogType,
|
|
75913
75930
|
"boolean": FormBoolean
|
|
@@ -77046,20 +77063,20 @@ var FormOptionsLoader = function FormOptionsLoader(_ref) {
|
|
|
77046
77063
|
}, []);
|
|
77047
77064
|
|
|
77048
77065
|
if (!options) {
|
|
77049
|
-
return /*#__PURE__*/React.createElement(
|
|
77066
|
+
return /*#__PURE__*/React.createElement(FormControl, {
|
|
77050
77067
|
error: dirty && hasErrors,
|
|
77051
77068
|
margin: "dense",
|
|
77052
77069
|
fullWidth: true,
|
|
77053
77070
|
required: required
|
|
77054
|
-
}, /*#__PURE__*/React.createElement(
|
|
77071
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
77055
77072
|
label: label,
|
|
77056
77073
|
variant: variant,
|
|
77057
77074
|
value: value,
|
|
77058
77075
|
disabled: true,
|
|
77059
77076
|
InputProps: {
|
|
77060
|
-
endAdornment: /*#__PURE__*/React.createElement(
|
|
77077
|
+
endAdornment: /*#__PURE__*/React.createElement(InputAdornment, {
|
|
77061
77078
|
position: "end"
|
|
77062
|
-
}, /*#__PURE__*/React.createElement(
|
|
77079
|
+
}, /*#__PURE__*/React.createElement(CircularProgress, {
|
|
77063
77080
|
size: 20,
|
|
77064
77081
|
thickness: 4
|
|
77065
77082
|
}))
|
|
@@ -77067,7 +77084,7 @@ var FormOptionsLoader = function FormOptionsLoader(_ref) {
|
|
|
77067
77084
|
}));
|
|
77068
77085
|
}
|
|
77069
77086
|
|
|
77070
|
-
return /*#__PURE__*/React.createElement(
|
|
77087
|
+
return /*#__PURE__*/React.createElement(FormControl, {
|
|
77071
77088
|
error: dirty && hasErrors,
|
|
77072
77089
|
margin: "dense",
|
|
77073
77090
|
fullWidth: true,
|
|
@@ -77195,33 +77212,33 @@ var FormPrimaryToggle = function FormPrimaryToggle(_ref) {
|
|
|
77195
77212
|
};
|
|
77196
77213
|
|
|
77197
77214
|
var checked = isChecked(value, defaultValue);
|
|
77198
|
-
return /*#__PURE__*/React.createElement(
|
|
77215
|
+
return /*#__PURE__*/React.createElement(Paper, {
|
|
77199
77216
|
elevation: 0,
|
|
77200
77217
|
className: cx(styles["default"], (_cx = {
|
|
77201
77218
|
clickable: !readOnly
|
|
77202
77219
|
}, _defineProperty(_cx, styles.spanSolitaryToCard, solitary && formVariant === 'card'), _defineProperty(_cx, styles.spanBannerToCard, !solitary && formVariant === 'card'), _defineProperty(_cx, styles.sharpEdges, !solitary), _defineProperty(_cx, styles.checked, checked), _defineProperty(_cx, styles.unchecked, !checked), _cx)),
|
|
77203
77220
|
onClick: handleToggleChange
|
|
77204
|
-
}, /*#__PURE__*/React.createElement(
|
|
77221
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
77205
77222
|
display: "flex",
|
|
77206
77223
|
flexDirection: "row",
|
|
77207
77224
|
justifyContent: readOnly ? 'flex-start' : 'space-between',
|
|
77208
77225
|
alignItems: "center"
|
|
77209
|
-
}, readOnly && checked && /*#__PURE__*/React.createElement(
|
|
77226
|
+
}, readOnly && checked && /*#__PURE__*/React.createElement(Box, {
|
|
77210
77227
|
mr: 2,
|
|
77211
77228
|
mb: -0.5
|
|
77212
|
-
}, /*#__PURE__*/React.createElement(
|
|
77229
|
+
}, /*#__PURE__*/React.createElement(Check, {
|
|
77213
77230
|
fontSize: solitary ? 'large' : 'medium',
|
|
77214
77231
|
htmlColor: theme.palette.text.secondary
|
|
77215
|
-
})), readOnly && !checked && /*#__PURE__*/React.createElement(
|
|
77232
|
+
})), readOnly && !checked && /*#__PURE__*/React.createElement(Box, {
|
|
77216
77233
|
mr: 2,
|
|
77217
77234
|
mb: -0.5
|
|
77218
|
-
}, /*#__PURE__*/React.createElement(
|
|
77235
|
+
}, /*#__PURE__*/React.createElement(Close, {
|
|
77219
77236
|
fontSize: solitary ? 'large' : 'medium',
|
|
77220
77237
|
htmlColor: theme.palette.text.secondary
|
|
77221
|
-
})), /*#__PURE__*/React.createElement(
|
|
77238
|
+
})), /*#__PURE__*/React.createElement(Typography, {
|
|
77222
77239
|
variant: solitary ? 'h5' : 'body1',
|
|
77223
77240
|
color: checked && !readOnly ? 'primary' : 'textSecondary'
|
|
77224
|
-
}, checked ? checkedLabel : uncheckedLabel), !readOnly && /*#__PURE__*/React.createElement(
|
|
77241
|
+
}, checked ? checkedLabel : uncheckedLabel), !readOnly && /*#__PURE__*/React.createElement(Switch, {
|
|
77225
77242
|
color: "primary",
|
|
77226
77243
|
name: name,
|
|
77227
77244
|
checked: checked,
|