@me1a/ui 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +370 -78
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +370 -78
- package/dist/index.es.js.map +1 -1
- package/package.json +7 -2
package/dist/index.cjs.js
CHANGED
|
@@ -2683,6 +2683,94 @@ function useForm(props = {}) {
|
|
|
2683
2683
|
return _formControl.current;
|
|
2684
2684
|
}
|
|
2685
2685
|
|
|
2686
|
+
function _arrayLikeToArray(r, a) {
|
|
2687
|
+
(null == a || a > r.length) && (a = r.length);
|
|
2688
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
2689
|
+
return n;
|
|
2690
|
+
}
|
|
2691
|
+
function _arrayWithoutHoles(r) {
|
|
2692
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
2693
|
+
}
|
|
2694
|
+
function _defineProperty(e, r, t) {
|
|
2695
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
2696
|
+
value: t,
|
|
2697
|
+
enumerable: !0,
|
|
2698
|
+
configurable: !0,
|
|
2699
|
+
writable: !0
|
|
2700
|
+
}) : e[r] = t, e;
|
|
2701
|
+
}
|
|
2702
|
+
function _iterableToArray(r) {
|
|
2703
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
2704
|
+
}
|
|
2705
|
+
function _nonIterableSpread() {
|
|
2706
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2707
|
+
}
|
|
2708
|
+
function ownKeys(e, r) {
|
|
2709
|
+
var t = Object.keys(e);
|
|
2710
|
+
if (Object.getOwnPropertySymbols) {
|
|
2711
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
2712
|
+
r && (o = o.filter(function (r) {
|
|
2713
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
2714
|
+
})), t.push.apply(t, o);
|
|
2715
|
+
}
|
|
2716
|
+
return t;
|
|
2717
|
+
}
|
|
2718
|
+
function _objectSpread2(e) {
|
|
2719
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
2720
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
2721
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
2722
|
+
_defineProperty(e, r, t[r]);
|
|
2723
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
2724
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
2725
|
+
});
|
|
2726
|
+
}
|
|
2727
|
+
return e;
|
|
2728
|
+
}
|
|
2729
|
+
function _objectWithoutProperties(e, t) {
|
|
2730
|
+
if (null == e) return {};
|
|
2731
|
+
var o,
|
|
2732
|
+
r,
|
|
2733
|
+
i = _objectWithoutPropertiesLoose$1(e, t);
|
|
2734
|
+
if (Object.getOwnPropertySymbols) {
|
|
2735
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
2736
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
2737
|
+
}
|
|
2738
|
+
return i;
|
|
2739
|
+
}
|
|
2740
|
+
function _objectWithoutPropertiesLoose$1(r, e) {
|
|
2741
|
+
if (null == r) return {};
|
|
2742
|
+
var t = {};
|
|
2743
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
2744
|
+
if (e.includes(n)) continue;
|
|
2745
|
+
t[n] = r[n];
|
|
2746
|
+
}
|
|
2747
|
+
return t;
|
|
2748
|
+
}
|
|
2749
|
+
function _toConsumableArray(r) {
|
|
2750
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
2751
|
+
}
|
|
2752
|
+
function _toPrimitive(t, r) {
|
|
2753
|
+
if ("object" != typeof t || !t) return t;
|
|
2754
|
+
var e = t[Symbol.toPrimitive];
|
|
2755
|
+
if (void 0 !== e) {
|
|
2756
|
+
var i = e.call(t, r || "default");
|
|
2757
|
+
if ("object" != typeof i) return i;
|
|
2758
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2759
|
+
}
|
|
2760
|
+
return ("string" === r ? String : Number)(t);
|
|
2761
|
+
}
|
|
2762
|
+
function _toPropertyKey(t) {
|
|
2763
|
+
var i = _toPrimitive(t, "string");
|
|
2764
|
+
return "symbol" == typeof i ? i : i + "";
|
|
2765
|
+
}
|
|
2766
|
+
function _unsupportedIterableToArray(r, a) {
|
|
2767
|
+
if (r) {
|
|
2768
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
2769
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
2770
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
2771
|
+
}
|
|
2772
|
+
}
|
|
2773
|
+
|
|
2686
2774
|
function getDefaultExportFromCjs (x) {
|
|
2687
2775
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
2688
2776
|
}
|
|
@@ -22292,24 +22380,49 @@ process.env.NODE_ENV !== "production" ? TextField.propTypes /* remove-proptypes
|
|
|
22292
22380
|
variant: PropTypes.oneOf(['filled', 'outlined', 'standard'])
|
|
22293
22381
|
} : void 0;
|
|
22294
22382
|
|
|
22295
|
-
|
|
22296
|
-
|
|
22297
|
-
|
|
22298
|
-
|
|
22299
|
-
|
|
22300
|
-
|
|
22301
|
-
|
|
22302
|
-
|
|
22303
|
-
|
|
22304
|
-
|
|
22305
|
-
|
|
22306
|
-
|
|
22307
|
-
|
|
22308
|
-
|
|
22309
|
-
|
|
22310
|
-
|
|
22311
|
-
|
|
22312
|
-
|
|
22383
|
+
var _excluded$5 = ["name", "native", "maxHeight", "helperText", "children", "PaperPropsSx"];
|
|
22384
|
+
function RHFSelect(_ref) {
|
|
22385
|
+
var name = _ref.name,
|
|
22386
|
+
_native = _ref["native"],
|
|
22387
|
+
_ref$maxHeight = _ref.maxHeight,
|
|
22388
|
+
maxHeight = _ref$maxHeight === void 0 ? 220 : _ref$maxHeight,
|
|
22389
|
+
helperText = _ref.helperText,
|
|
22390
|
+
children = _ref.children,
|
|
22391
|
+
PaperPropsSx = _ref.PaperPropsSx,
|
|
22392
|
+
other = _objectWithoutProperties(_ref, _excluded$5);
|
|
22393
|
+
var _useFormContext = useFormContext(),
|
|
22394
|
+
control = _useFormContext.control;
|
|
22395
|
+
return jsxRuntimeExports.jsx(Controller, {
|
|
22396
|
+
name: name,
|
|
22397
|
+
control: control,
|
|
22398
|
+
render: function render(_ref2) {
|
|
22399
|
+
var field = _ref2.field,
|
|
22400
|
+
error = _ref2.fieldState.error;
|
|
22401
|
+
return jsxRuntimeExports.jsx(TextField, _objectSpread2(_objectSpread2(_objectSpread2({}, field), {}, {
|
|
22402
|
+
select: true,
|
|
22403
|
+
fullWidth: true,
|
|
22404
|
+
slotProps: {
|
|
22405
|
+
select: {
|
|
22406
|
+
"native": _native,
|
|
22407
|
+
MenuProps: {
|
|
22408
|
+
PaperProps: {
|
|
22409
|
+
sx: _objectSpread2(_objectSpread2({}, !_native && {
|
|
22410
|
+
maxHeight: typeof maxHeight === "number" ? maxHeight : "unset"
|
|
22411
|
+
}), PaperPropsSx)
|
|
22412
|
+
}
|
|
22413
|
+
},
|
|
22414
|
+
sx: {
|
|
22415
|
+
textTransform: "capitalize"
|
|
22416
|
+
}
|
|
22417
|
+
}
|
|
22418
|
+
},
|
|
22419
|
+
error: !!error,
|
|
22420
|
+
helperText: error ? error === null || error === void 0 ? void 0 : error.message : helperText
|
|
22421
|
+
}, other), {}, {
|
|
22422
|
+
children: children
|
|
22423
|
+
}));
|
|
22424
|
+
}
|
|
22425
|
+
});
|
|
22313
22426
|
}
|
|
22314
22427
|
|
|
22315
22428
|
/**
|
|
@@ -24391,32 +24504,97 @@ process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes /* remove-pro
|
|
|
24391
24504
|
value: PropTypes.any
|
|
24392
24505
|
} : void 0;
|
|
24393
24506
|
|
|
24394
|
-
|
|
24395
|
-
|
|
24396
|
-
|
|
24397
|
-
|
|
24398
|
-
|
|
24399
|
-
|
|
24400
|
-
|
|
24401
|
-
|
|
24402
|
-
|
|
24403
|
-
|
|
24404
|
-
|
|
24405
|
-
|
|
24406
|
-
|
|
24407
|
-
|
|
24408
|
-
|
|
24409
|
-
|
|
24410
|
-
|
|
24411
|
-
|
|
24412
|
-
|
|
24413
|
-
|
|
24414
|
-
|
|
24415
|
-
|
|
24416
|
-
|
|
24417
|
-
|
|
24418
|
-
|
|
24419
|
-
|
|
24507
|
+
var _excluded$4 = ["name", "helperText"],
|
|
24508
|
+
_excluded2 = ["row", "name", "label", "options", "spacing", "helperText", "sx"];
|
|
24509
|
+
function RHFCheckbox(_ref) {
|
|
24510
|
+
var name = _ref.name,
|
|
24511
|
+
helperText = _ref.helperText,
|
|
24512
|
+
other = _objectWithoutProperties(_ref, _excluded$4);
|
|
24513
|
+
var _useFormContext = useFormContext(),
|
|
24514
|
+
control = _useFormContext.control;
|
|
24515
|
+
return jsxRuntimeExports.jsx(Controller, {
|
|
24516
|
+
name: name,
|
|
24517
|
+
control: control,
|
|
24518
|
+
render: function render(_ref2) {
|
|
24519
|
+
var field = _ref2.field,
|
|
24520
|
+
error = _ref2.fieldState.error;
|
|
24521
|
+
return jsxRuntimeExports.jsxs("div", {
|
|
24522
|
+
children: [jsxRuntimeExports.jsx(FormControlLabel, _objectSpread2({
|
|
24523
|
+
control: jsxRuntimeExports.jsx(Checkbox, _objectSpread2(_objectSpread2({}, field), {}, {
|
|
24524
|
+
checked: field.value
|
|
24525
|
+
}))
|
|
24526
|
+
}, other)), (!!error || helperText) && jsxRuntimeExports.jsx(FormHelperText, {
|
|
24527
|
+
error: !!error,
|
|
24528
|
+
children: error ? error === null || error === void 0 ? void 0 : error.message : helperText
|
|
24529
|
+
})]
|
|
24530
|
+
});
|
|
24531
|
+
}
|
|
24532
|
+
});
|
|
24533
|
+
}
|
|
24534
|
+
function RHFMultiCheckbox(_ref3) {
|
|
24535
|
+
var row = _ref3.row,
|
|
24536
|
+
name = _ref3.name,
|
|
24537
|
+
label = _ref3.label,
|
|
24538
|
+
options = _ref3.options,
|
|
24539
|
+
spacing = _ref3.spacing,
|
|
24540
|
+
helperText = _ref3.helperText,
|
|
24541
|
+
sx = _ref3.sx,
|
|
24542
|
+
other = _objectWithoutProperties(_ref3, _excluded2);
|
|
24543
|
+
var _useFormContext2 = useFormContext(),
|
|
24544
|
+
control = _useFormContext2.control;
|
|
24545
|
+
var getSelected = function getSelected(selectedItems, item) {
|
|
24546
|
+
return selectedItems.includes(item) ? selectedItems.filter(function (value) {
|
|
24547
|
+
return value !== item;
|
|
24548
|
+
}) : [].concat(_toConsumableArray(selectedItems), [item]);
|
|
24549
|
+
};
|
|
24550
|
+
return jsxRuntimeExports.jsx(Controller, {
|
|
24551
|
+
name: name,
|
|
24552
|
+
control: control,
|
|
24553
|
+
render: function render(_ref4) {
|
|
24554
|
+
var field = _ref4.field,
|
|
24555
|
+
error = _ref4.fieldState.error;
|
|
24556
|
+
return jsxRuntimeExports.jsxs(FormControl, {
|
|
24557
|
+
component: "fieldset",
|
|
24558
|
+
children: [label && jsxRuntimeExports.jsx(FormLabel, {
|
|
24559
|
+
component: "legend",
|
|
24560
|
+
sx: {
|
|
24561
|
+
typography: "body2"
|
|
24562
|
+
},
|
|
24563
|
+
children: label
|
|
24564
|
+
}), jsxRuntimeExports.jsx(FormGroup, {
|
|
24565
|
+
sx: _objectSpread2(_objectSpread2({}, row && {
|
|
24566
|
+
flexDirection: "row"
|
|
24567
|
+
}), {}, _defineProperty({}, "& .".concat(formControlLabelClasses.root), _objectSpread2({
|
|
24568
|
+
"&:not(:last-of-type)": {
|
|
24569
|
+
mb: spacing || 0
|
|
24570
|
+
}
|
|
24571
|
+
}, row && {
|
|
24572
|
+
mr: 0,
|
|
24573
|
+
"&:not(:last-of-type)": {
|
|
24574
|
+
mr: spacing || 2
|
|
24575
|
+
}
|
|
24576
|
+
})), sx),
|
|
24577
|
+
children: options.map(function (option) {
|
|
24578
|
+
return jsxRuntimeExports.jsx(FormControlLabel, _objectSpread2({
|
|
24579
|
+
control: jsxRuntimeExports.jsx(Checkbox, {
|
|
24580
|
+
checked: field.value.includes(option.value),
|
|
24581
|
+
onChange: function onChange() {
|
|
24582
|
+
return field.onChange(getSelected(field.value, "".concat(option.value)));
|
|
24583
|
+
}
|
|
24584
|
+
}),
|
|
24585
|
+
label: option.label
|
|
24586
|
+
}, other), option.value);
|
|
24587
|
+
})
|
|
24588
|
+
}), (!!error || helperText) && jsxRuntimeExports.jsx(FormHelperText, {
|
|
24589
|
+
error: !!error,
|
|
24590
|
+
sx: {
|
|
24591
|
+
mx: 0
|
|
24592
|
+
},
|
|
24593
|
+
children: error ? error === null || error === void 0 ? void 0 : error.message : helperText
|
|
24594
|
+
})]
|
|
24595
|
+
});
|
|
24596
|
+
}
|
|
24597
|
+
});
|
|
24420
24598
|
}
|
|
24421
24599
|
|
|
24422
24600
|
function getSwitchUtilityClass(slot) {
|
|
@@ -24750,9 +24928,31 @@ process.env.NODE_ENV !== "production" ? Switch.propTypes /* remove-proptypes */
|
|
|
24750
24928
|
value: PropTypes.any
|
|
24751
24929
|
} : void 0;
|
|
24752
24930
|
|
|
24753
|
-
|
|
24754
|
-
|
|
24755
|
-
|
|
24931
|
+
var _excluded$3 = ["name", "helperText"];
|
|
24932
|
+
function RHFSwitch(_ref) {
|
|
24933
|
+
var name = _ref.name,
|
|
24934
|
+
helperText = _ref.helperText,
|
|
24935
|
+
other = _objectWithoutProperties(_ref, _excluded$3);
|
|
24936
|
+
var _useFormContext = useFormContext(),
|
|
24937
|
+
control = _useFormContext.control;
|
|
24938
|
+
return jsxRuntimeExports.jsx(Controller, {
|
|
24939
|
+
name: name,
|
|
24940
|
+
control: control,
|
|
24941
|
+
render: function render(_ref2) {
|
|
24942
|
+
var field = _ref2.field,
|
|
24943
|
+
error = _ref2.fieldState.error;
|
|
24944
|
+
return jsxRuntimeExports.jsxs("div", {
|
|
24945
|
+
children: [jsxRuntimeExports.jsx(FormControlLabel, _objectSpread2({
|
|
24946
|
+
control: jsxRuntimeExports.jsx(Switch, _objectSpread2(_objectSpread2({}, field), {}, {
|
|
24947
|
+
checked: field.value
|
|
24948
|
+
}))
|
|
24949
|
+
}, other)), (!!error || helperText) && jsxRuntimeExports.jsx(FormHelperText, {
|
|
24950
|
+
error: !!error,
|
|
24951
|
+
children: error ? error === null || error === void 0 ? void 0 : error.message : helperText
|
|
24952
|
+
})]
|
|
24953
|
+
});
|
|
24954
|
+
}
|
|
24955
|
+
});
|
|
24756
24956
|
}
|
|
24757
24957
|
|
|
24758
24958
|
function areArraysEqual(array1, array2, itemComparer = (a, b) => a === b) {
|
|
@@ -26529,21 +26729,61 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes /* remove-proptypes */
|
|
|
26529
26729
|
valueLabelFormat: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
|
|
26530
26730
|
} : void 0;
|
|
26531
26731
|
|
|
26532
|
-
|
|
26533
|
-
|
|
26534
|
-
|
|
26732
|
+
var _excluded$2 = ["name", "helperText"];
|
|
26733
|
+
function RHFSlider(_ref) {
|
|
26734
|
+
var name = _ref.name,
|
|
26735
|
+
helperText = _ref.helperText,
|
|
26736
|
+
other = _objectWithoutProperties(_ref, _excluded$2);
|
|
26737
|
+
var _useFormContext = useFormContext(),
|
|
26738
|
+
control = _useFormContext.control;
|
|
26739
|
+
return jsxRuntimeExports.jsx(Controller, {
|
|
26740
|
+
name: name,
|
|
26741
|
+
control: control,
|
|
26742
|
+
render: function render(_ref2) {
|
|
26743
|
+
var field = _ref2.field,
|
|
26744
|
+
error = _ref2.fieldState.error;
|
|
26745
|
+
return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
26746
|
+
children: [jsxRuntimeExports.jsx(Slider, _objectSpread2(_objectSpread2({}, field), {}, {
|
|
26747
|
+
valueLabelDisplay: "auto"
|
|
26748
|
+
}, other)), (!!error || helperText) && jsxRuntimeExports.jsx(FormHelperText, {
|
|
26749
|
+
error: !!error,
|
|
26750
|
+
children: error ? error === null || error === void 0 ? void 0 : error.message : helperText
|
|
26751
|
+
})]
|
|
26752
|
+
});
|
|
26753
|
+
}
|
|
26754
|
+
});
|
|
26535
26755
|
}
|
|
26536
26756
|
|
|
26537
|
-
|
|
26538
|
-
|
|
26539
|
-
|
|
26540
|
-
|
|
26541
|
-
|
|
26542
|
-
|
|
26543
|
-
|
|
26544
|
-
|
|
26545
|
-
|
|
26546
|
-
|
|
26757
|
+
var _excluded$1 = ["name", "helperText", "type"];
|
|
26758
|
+
function RHFTextField(_ref) {
|
|
26759
|
+
var name = _ref.name,
|
|
26760
|
+
helperText = _ref.helperText,
|
|
26761
|
+
type = _ref.type,
|
|
26762
|
+
other = _objectWithoutProperties(_ref, _excluded$1);
|
|
26763
|
+
var _useFormContext = useFormContext(),
|
|
26764
|
+
control = _useFormContext.control;
|
|
26765
|
+
return jsxRuntimeExports.jsx(Controller, {
|
|
26766
|
+
name: name,
|
|
26767
|
+
control: control,
|
|
26768
|
+
render: function render(_ref2) {
|
|
26769
|
+
var field = _ref2.field,
|
|
26770
|
+
error = _ref2.fieldState.error;
|
|
26771
|
+
return jsxRuntimeExports.jsx(TextField, _objectSpread2(_objectSpread2({}, field), {}, {
|
|
26772
|
+
fullWidth: true,
|
|
26773
|
+
type: type,
|
|
26774
|
+
value: type === "number" && field.value === 0 ? "" : field.value,
|
|
26775
|
+
onChange: function onChange(event) {
|
|
26776
|
+
if (type === "number") {
|
|
26777
|
+
field.onChange(Number(event.target.value));
|
|
26778
|
+
} else {
|
|
26779
|
+
field.onChange(event.target.value);
|
|
26780
|
+
}
|
|
26781
|
+
},
|
|
26782
|
+
error: !!error,
|
|
26783
|
+
helperText: error ? error === null || error === void 0 ? void 0 : error.message : helperText
|
|
26784
|
+
}, other));
|
|
26785
|
+
}
|
|
26786
|
+
});
|
|
26547
26787
|
}
|
|
26548
26788
|
|
|
26549
26789
|
var RadioButtonUncheckedIcon = createSvgIcon(/*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
@@ -26997,24 +27237,76 @@ process.env.NODE_ENV !== "production" ? RadioGroup.propTypes /* remove-proptypes
|
|
|
26997
27237
|
value: PropTypes.any
|
|
26998
27238
|
} : void 0;
|
|
26999
27239
|
|
|
27000
|
-
|
|
27001
|
-
|
|
27002
|
-
|
|
27003
|
-
|
|
27004
|
-
|
|
27005
|
-
|
|
27006
|
-
|
|
27007
|
-
|
|
27008
|
-
|
|
27009
|
-
|
|
27010
|
-
|
|
27011
|
-
|
|
27012
|
-
|
|
27013
|
-
|
|
27014
|
-
|
|
27015
|
-
|
|
27016
|
-
|
|
27017
|
-
|
|
27240
|
+
var _excluded = ["row", "name", "label", "options", "spacing", "helperText"];
|
|
27241
|
+
function RHFRadioGroup(_ref) {
|
|
27242
|
+
var row = _ref.row,
|
|
27243
|
+
name = _ref.name,
|
|
27244
|
+
label = _ref.label,
|
|
27245
|
+
options = _ref.options,
|
|
27246
|
+
spacing = _ref.spacing,
|
|
27247
|
+
helperText = _ref.helperText,
|
|
27248
|
+
other = _objectWithoutProperties(_ref, _excluded);
|
|
27249
|
+
var _useFormContext = useFormContext(),
|
|
27250
|
+
control = _useFormContext.control;
|
|
27251
|
+
var labelledby = label ? "".concat(name, "-").concat(label) : "";
|
|
27252
|
+
return jsxRuntimeExports.jsx(Controller, {
|
|
27253
|
+
name: name,
|
|
27254
|
+
control: control,
|
|
27255
|
+
render: function render(_ref2) {
|
|
27256
|
+
var field = _ref2.field,
|
|
27257
|
+
error = _ref2.fieldState.error;
|
|
27258
|
+
return jsxRuntimeExports.jsxs(FormControl, {
|
|
27259
|
+
component: "fieldset",
|
|
27260
|
+
children: [label && jsxRuntimeExports.jsx(FormLabel, {
|
|
27261
|
+
component: "legend",
|
|
27262
|
+
id: labelledby,
|
|
27263
|
+
sx: {
|
|
27264
|
+
typography: "body2"
|
|
27265
|
+
},
|
|
27266
|
+
children: label
|
|
27267
|
+
}), jsxRuntimeExports.jsx(RadioGroup, _objectSpread2(_objectSpread2(_objectSpread2({}, field), {}, {
|
|
27268
|
+
"aria-labelledby": labelledby,
|
|
27269
|
+
row: row
|
|
27270
|
+
}, other), {}, {
|
|
27271
|
+
children: options.map(function (option) {
|
|
27272
|
+
return jsxRuntimeExports.jsx(FormControlLabel, {
|
|
27273
|
+
value: option.value,
|
|
27274
|
+
control: jsxRuntimeExports.jsx(Radio, {}),
|
|
27275
|
+
label: option.label,
|
|
27276
|
+
sx: _objectSpread2({
|
|
27277
|
+
"&:not(:last-of-type)": {
|
|
27278
|
+
mb: spacing || 0
|
|
27279
|
+
}
|
|
27280
|
+
}, row && {
|
|
27281
|
+
mr: 0,
|
|
27282
|
+
"&:not(:last-of-type)": {
|
|
27283
|
+
mr: spacing || 2
|
|
27284
|
+
}
|
|
27285
|
+
})
|
|
27286
|
+
}, option.value);
|
|
27287
|
+
})
|
|
27288
|
+
})), (!!error || helperText) && jsxRuntimeExports.jsx(FormHelperText, {
|
|
27289
|
+
error: !!error,
|
|
27290
|
+
sx: {
|
|
27291
|
+
mx: 0
|
|
27292
|
+
},
|
|
27293
|
+
children: error ? error === null || error === void 0 ? void 0 : error.message : helperText
|
|
27294
|
+
})]
|
|
27295
|
+
});
|
|
27296
|
+
}
|
|
27297
|
+
});
|
|
27298
|
+
}
|
|
27299
|
+
|
|
27300
|
+
function FormProvider(_ref) {
|
|
27301
|
+
var children = _ref.children,
|
|
27302
|
+
onSubmit = _ref.onSubmit,
|
|
27303
|
+
methods = _ref.methods;
|
|
27304
|
+
return jsxRuntimeExports.jsx(FormProvider$1, _objectSpread2(_objectSpread2({}, methods), {}, {
|
|
27305
|
+
children: jsxRuntimeExports.jsx("form", {
|
|
27306
|
+
onSubmit: onSubmit,
|
|
27307
|
+
children: children
|
|
27308
|
+
})
|
|
27309
|
+
}));
|
|
27018
27310
|
}
|
|
27019
27311
|
|
|
27020
27312
|
exports.Controller = Controller;
|