@wulperstudio/cms
Version:
Wulper Studio Library Components CMS
69 lines • 2.73 kB
JavaScript
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["component", "variant"],
_excluded2 = ["component", "sx"],
_excluded3 = ["id", "switchProps"],
_excluded4 = ["sx"];
import React from 'react';
import FormLabel from '@mui/material/FormLabel';
import FormGroup from '@mui/material/FormGroup';
import FormControl from '@mui/material/FormControl';
import { InputTrueFalse } from '../../components';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
export var SwitchesFormGroup = function SwitchesFormGroup(_ref) {
var inputs = _ref.inputs,
formControlProps = _ref.formControlProps,
formLabelProps = _ref.formLabelProps,
formGroupProps = _ref.formGroupProps;
var _ref2 = formControlProps || {},
_ref2$component = _ref2.component,
component = _ref2$component === void 0 ? 'fieldset' : _ref2$component,
_ref2$variant = _ref2.variant,
variant = _ref2$variant === void 0 ? 'standard' : _ref2$variant,
restFormControl = _objectWithoutProperties(_ref2, _excluded);
var _ref3 = formLabelProps || {},
_ref3$component = _ref3.component,
componentFormLabel = _ref3$component === void 0 ? 'legend' : _ref3$component,
sxFormLabel = _ref3.sx,
restFormLabel = _objectWithoutProperties(_ref3, _excluded2);
return /*#__PURE__*/_jsxs(FormControl, Object.assign({
component: component,
variant: variant
}, restFormControl, {
children: [/*#__PURE__*/_jsx(FormLabel, Object.assign({
component: componentFormLabel,
sx: Object.assign({
paddingLeft: 0,
fontSize: '14px',
lineHeight: '18px',
fontWeight: 400,
display: 'block',
mb: '.5rem'
}, sxFormLabel)
}, restFormLabel, {
children: "Assign responsibility"
})), /*#__PURE__*/_jsx(FormGroup, Object.assign({}, formGroupProps, {
children: inputs.map(function (_ref4, idx) {
var id = _ref4.id,
switchProps = _ref4.switchProps,
rest = _objectWithoutProperties(_ref4, _excluded3);
var _ref5 = switchProps || {},
sxswitchProps = _ref5.sx,
restswitchProps = _objectWithoutProperties(_ref5, _excluded4);
return /*#__PURE__*/_jsx(InputTrueFalse
// eslint-disable-next-line react/no-array-index-key
, Object.assign({
switchProps: Object.assign({
sx: Object.assign({
height: 24,
'& .MuiSwitch-thumb': {
boxSizing: 'border-box',
width: 20,
height: 20
}
}, sxswitchProps)
}, restswitchProps)
}, rest), "".concat(id, " - ").concat(idx));
})
}))]
}));
};