@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.es.js
CHANGED
|
@@ -2663,6 +2663,94 @@ function useForm(props = {}) {
|
|
|
2663
2663
|
return _formControl.current;
|
|
2664
2664
|
}
|
|
2665
2665
|
|
|
2666
|
+
function _arrayLikeToArray(r, a) {
|
|
2667
|
+
(null == a || a > r.length) && (a = r.length);
|
|
2668
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
2669
|
+
return n;
|
|
2670
|
+
}
|
|
2671
|
+
function _arrayWithoutHoles(r) {
|
|
2672
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
2673
|
+
}
|
|
2674
|
+
function _defineProperty(e, r, t) {
|
|
2675
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
2676
|
+
value: t,
|
|
2677
|
+
enumerable: !0,
|
|
2678
|
+
configurable: !0,
|
|
2679
|
+
writable: !0
|
|
2680
|
+
}) : e[r] = t, e;
|
|
2681
|
+
}
|
|
2682
|
+
function _iterableToArray(r) {
|
|
2683
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
2684
|
+
}
|
|
2685
|
+
function _nonIterableSpread() {
|
|
2686
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2687
|
+
}
|
|
2688
|
+
function ownKeys(e, r) {
|
|
2689
|
+
var t = Object.keys(e);
|
|
2690
|
+
if (Object.getOwnPropertySymbols) {
|
|
2691
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
2692
|
+
r && (o = o.filter(function (r) {
|
|
2693
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
2694
|
+
})), t.push.apply(t, o);
|
|
2695
|
+
}
|
|
2696
|
+
return t;
|
|
2697
|
+
}
|
|
2698
|
+
function _objectSpread2(e) {
|
|
2699
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
2700
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
2701
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
2702
|
+
_defineProperty(e, r, t[r]);
|
|
2703
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
2704
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
2705
|
+
});
|
|
2706
|
+
}
|
|
2707
|
+
return e;
|
|
2708
|
+
}
|
|
2709
|
+
function _objectWithoutProperties(e, t) {
|
|
2710
|
+
if (null == e) return {};
|
|
2711
|
+
var o,
|
|
2712
|
+
r,
|
|
2713
|
+
i = _objectWithoutPropertiesLoose$1(e, t);
|
|
2714
|
+
if (Object.getOwnPropertySymbols) {
|
|
2715
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
2716
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
2717
|
+
}
|
|
2718
|
+
return i;
|
|
2719
|
+
}
|
|
2720
|
+
function _objectWithoutPropertiesLoose$1(r, e) {
|
|
2721
|
+
if (null == r) return {};
|
|
2722
|
+
var t = {};
|
|
2723
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
2724
|
+
if (e.includes(n)) continue;
|
|
2725
|
+
t[n] = r[n];
|
|
2726
|
+
}
|
|
2727
|
+
return t;
|
|
2728
|
+
}
|
|
2729
|
+
function _toConsumableArray(r) {
|
|
2730
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
2731
|
+
}
|
|
2732
|
+
function _toPrimitive(t, r) {
|
|
2733
|
+
if ("object" != typeof t || !t) return t;
|
|
2734
|
+
var e = t[Symbol.toPrimitive];
|
|
2735
|
+
if (void 0 !== e) {
|
|
2736
|
+
var i = e.call(t, r || "default");
|
|
2737
|
+
if ("object" != typeof i) return i;
|
|
2738
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2739
|
+
}
|
|
2740
|
+
return ("string" === r ? String : Number)(t);
|
|
2741
|
+
}
|
|
2742
|
+
function _toPropertyKey(t) {
|
|
2743
|
+
var i = _toPrimitive(t, "string");
|
|
2744
|
+
return "symbol" == typeof i ? i : i + "";
|
|
2745
|
+
}
|
|
2746
|
+
function _unsupportedIterableToArray(r, a) {
|
|
2747
|
+
if (r) {
|
|
2748
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
2749
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
2750
|
+
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;
|
|
2751
|
+
}
|
|
2752
|
+
}
|
|
2753
|
+
|
|
2666
2754
|
function getDefaultExportFromCjs (x) {
|
|
2667
2755
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
2668
2756
|
}
|
|
@@ -22272,24 +22360,49 @@ process.env.NODE_ENV !== "production" ? TextField.propTypes /* remove-proptypes
|
|
|
22272
22360
|
variant: PropTypes.oneOf(['filled', 'outlined', 'standard'])
|
|
22273
22361
|
} : void 0;
|
|
22274
22362
|
|
|
22275
|
-
|
|
22276
|
-
|
|
22277
|
-
|
|
22278
|
-
|
|
22279
|
-
|
|
22280
|
-
|
|
22281
|
-
|
|
22282
|
-
|
|
22283
|
-
|
|
22284
|
-
|
|
22285
|
-
|
|
22286
|
-
|
|
22287
|
-
|
|
22288
|
-
|
|
22289
|
-
|
|
22290
|
-
|
|
22291
|
-
|
|
22292
|
-
|
|
22363
|
+
var _excluded$5 = ["name", "native", "maxHeight", "helperText", "children", "PaperPropsSx"];
|
|
22364
|
+
function RHFSelect(_ref) {
|
|
22365
|
+
var name = _ref.name,
|
|
22366
|
+
_native = _ref["native"],
|
|
22367
|
+
_ref$maxHeight = _ref.maxHeight,
|
|
22368
|
+
maxHeight = _ref$maxHeight === void 0 ? 220 : _ref$maxHeight,
|
|
22369
|
+
helperText = _ref.helperText,
|
|
22370
|
+
children = _ref.children,
|
|
22371
|
+
PaperPropsSx = _ref.PaperPropsSx,
|
|
22372
|
+
other = _objectWithoutProperties(_ref, _excluded$5);
|
|
22373
|
+
var _useFormContext = useFormContext(),
|
|
22374
|
+
control = _useFormContext.control;
|
|
22375
|
+
return jsxRuntimeExports.jsx(Controller, {
|
|
22376
|
+
name: name,
|
|
22377
|
+
control: control,
|
|
22378
|
+
render: function render(_ref2) {
|
|
22379
|
+
var field = _ref2.field,
|
|
22380
|
+
error = _ref2.fieldState.error;
|
|
22381
|
+
return jsxRuntimeExports.jsx(TextField, _objectSpread2(_objectSpread2(_objectSpread2({}, field), {}, {
|
|
22382
|
+
select: true,
|
|
22383
|
+
fullWidth: true,
|
|
22384
|
+
slotProps: {
|
|
22385
|
+
select: {
|
|
22386
|
+
"native": _native,
|
|
22387
|
+
MenuProps: {
|
|
22388
|
+
PaperProps: {
|
|
22389
|
+
sx: _objectSpread2(_objectSpread2({}, !_native && {
|
|
22390
|
+
maxHeight: typeof maxHeight === "number" ? maxHeight : "unset"
|
|
22391
|
+
}), PaperPropsSx)
|
|
22392
|
+
}
|
|
22393
|
+
},
|
|
22394
|
+
sx: {
|
|
22395
|
+
textTransform: "capitalize"
|
|
22396
|
+
}
|
|
22397
|
+
}
|
|
22398
|
+
},
|
|
22399
|
+
error: !!error,
|
|
22400
|
+
helperText: error ? error === null || error === void 0 ? void 0 : error.message : helperText
|
|
22401
|
+
}, other), {}, {
|
|
22402
|
+
children: children
|
|
22403
|
+
}));
|
|
22404
|
+
}
|
|
22405
|
+
});
|
|
22293
22406
|
}
|
|
22294
22407
|
|
|
22295
22408
|
/**
|
|
@@ -24371,32 +24484,97 @@ process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes /* remove-pro
|
|
|
24371
24484
|
value: PropTypes.any
|
|
24372
24485
|
} : void 0;
|
|
24373
24486
|
|
|
24374
|
-
|
|
24375
|
-
|
|
24376
|
-
|
|
24377
|
-
|
|
24378
|
-
|
|
24379
|
-
|
|
24380
|
-
|
|
24381
|
-
|
|
24382
|
-
|
|
24383
|
-
|
|
24384
|
-
|
|
24385
|
-
|
|
24386
|
-
|
|
24387
|
-
|
|
24388
|
-
|
|
24389
|
-
|
|
24390
|
-
|
|
24391
|
-
|
|
24392
|
-
|
|
24393
|
-
|
|
24394
|
-
|
|
24395
|
-
|
|
24396
|
-
|
|
24397
|
-
|
|
24398
|
-
|
|
24399
|
-
|
|
24487
|
+
var _excluded$4 = ["name", "helperText"],
|
|
24488
|
+
_excluded2 = ["row", "name", "label", "options", "spacing", "helperText", "sx"];
|
|
24489
|
+
function RHFCheckbox(_ref) {
|
|
24490
|
+
var name = _ref.name,
|
|
24491
|
+
helperText = _ref.helperText,
|
|
24492
|
+
other = _objectWithoutProperties(_ref, _excluded$4);
|
|
24493
|
+
var _useFormContext = useFormContext(),
|
|
24494
|
+
control = _useFormContext.control;
|
|
24495
|
+
return jsxRuntimeExports.jsx(Controller, {
|
|
24496
|
+
name: name,
|
|
24497
|
+
control: control,
|
|
24498
|
+
render: function render(_ref2) {
|
|
24499
|
+
var field = _ref2.field,
|
|
24500
|
+
error = _ref2.fieldState.error;
|
|
24501
|
+
return jsxRuntimeExports.jsxs("div", {
|
|
24502
|
+
children: [jsxRuntimeExports.jsx(FormControlLabel, _objectSpread2({
|
|
24503
|
+
control: jsxRuntimeExports.jsx(Checkbox, _objectSpread2(_objectSpread2({}, field), {}, {
|
|
24504
|
+
checked: field.value
|
|
24505
|
+
}))
|
|
24506
|
+
}, other)), (!!error || helperText) && jsxRuntimeExports.jsx(FormHelperText, {
|
|
24507
|
+
error: !!error,
|
|
24508
|
+
children: error ? error === null || error === void 0 ? void 0 : error.message : helperText
|
|
24509
|
+
})]
|
|
24510
|
+
});
|
|
24511
|
+
}
|
|
24512
|
+
});
|
|
24513
|
+
}
|
|
24514
|
+
function RHFMultiCheckbox(_ref3) {
|
|
24515
|
+
var row = _ref3.row,
|
|
24516
|
+
name = _ref3.name,
|
|
24517
|
+
label = _ref3.label,
|
|
24518
|
+
options = _ref3.options,
|
|
24519
|
+
spacing = _ref3.spacing,
|
|
24520
|
+
helperText = _ref3.helperText,
|
|
24521
|
+
sx = _ref3.sx,
|
|
24522
|
+
other = _objectWithoutProperties(_ref3, _excluded2);
|
|
24523
|
+
var _useFormContext2 = useFormContext(),
|
|
24524
|
+
control = _useFormContext2.control;
|
|
24525
|
+
var getSelected = function getSelected(selectedItems, item) {
|
|
24526
|
+
return selectedItems.includes(item) ? selectedItems.filter(function (value) {
|
|
24527
|
+
return value !== item;
|
|
24528
|
+
}) : [].concat(_toConsumableArray(selectedItems), [item]);
|
|
24529
|
+
};
|
|
24530
|
+
return jsxRuntimeExports.jsx(Controller, {
|
|
24531
|
+
name: name,
|
|
24532
|
+
control: control,
|
|
24533
|
+
render: function render(_ref4) {
|
|
24534
|
+
var field = _ref4.field,
|
|
24535
|
+
error = _ref4.fieldState.error;
|
|
24536
|
+
return jsxRuntimeExports.jsxs(FormControl, {
|
|
24537
|
+
component: "fieldset",
|
|
24538
|
+
children: [label && jsxRuntimeExports.jsx(FormLabel, {
|
|
24539
|
+
component: "legend",
|
|
24540
|
+
sx: {
|
|
24541
|
+
typography: "body2"
|
|
24542
|
+
},
|
|
24543
|
+
children: label
|
|
24544
|
+
}), jsxRuntimeExports.jsx(FormGroup, {
|
|
24545
|
+
sx: _objectSpread2(_objectSpread2({}, row && {
|
|
24546
|
+
flexDirection: "row"
|
|
24547
|
+
}), {}, _defineProperty({}, "& .".concat(formControlLabelClasses.root), _objectSpread2({
|
|
24548
|
+
"&:not(:last-of-type)": {
|
|
24549
|
+
mb: spacing || 0
|
|
24550
|
+
}
|
|
24551
|
+
}, row && {
|
|
24552
|
+
mr: 0,
|
|
24553
|
+
"&:not(:last-of-type)": {
|
|
24554
|
+
mr: spacing || 2
|
|
24555
|
+
}
|
|
24556
|
+
})), sx),
|
|
24557
|
+
children: options.map(function (option) {
|
|
24558
|
+
return jsxRuntimeExports.jsx(FormControlLabel, _objectSpread2({
|
|
24559
|
+
control: jsxRuntimeExports.jsx(Checkbox, {
|
|
24560
|
+
checked: field.value.includes(option.value),
|
|
24561
|
+
onChange: function onChange() {
|
|
24562
|
+
return field.onChange(getSelected(field.value, "".concat(option.value)));
|
|
24563
|
+
}
|
|
24564
|
+
}),
|
|
24565
|
+
label: option.label
|
|
24566
|
+
}, other), option.value);
|
|
24567
|
+
})
|
|
24568
|
+
}), (!!error || helperText) && jsxRuntimeExports.jsx(FormHelperText, {
|
|
24569
|
+
error: !!error,
|
|
24570
|
+
sx: {
|
|
24571
|
+
mx: 0
|
|
24572
|
+
},
|
|
24573
|
+
children: error ? error === null || error === void 0 ? void 0 : error.message : helperText
|
|
24574
|
+
})]
|
|
24575
|
+
});
|
|
24576
|
+
}
|
|
24577
|
+
});
|
|
24400
24578
|
}
|
|
24401
24579
|
|
|
24402
24580
|
function getSwitchUtilityClass(slot) {
|
|
@@ -24730,9 +24908,31 @@ process.env.NODE_ENV !== "production" ? Switch.propTypes /* remove-proptypes */
|
|
|
24730
24908
|
value: PropTypes.any
|
|
24731
24909
|
} : void 0;
|
|
24732
24910
|
|
|
24733
|
-
|
|
24734
|
-
|
|
24735
|
-
|
|
24911
|
+
var _excluded$3 = ["name", "helperText"];
|
|
24912
|
+
function RHFSwitch(_ref) {
|
|
24913
|
+
var name = _ref.name,
|
|
24914
|
+
helperText = _ref.helperText,
|
|
24915
|
+
other = _objectWithoutProperties(_ref, _excluded$3);
|
|
24916
|
+
var _useFormContext = useFormContext(),
|
|
24917
|
+
control = _useFormContext.control;
|
|
24918
|
+
return jsxRuntimeExports.jsx(Controller, {
|
|
24919
|
+
name: name,
|
|
24920
|
+
control: control,
|
|
24921
|
+
render: function render(_ref2) {
|
|
24922
|
+
var field = _ref2.field,
|
|
24923
|
+
error = _ref2.fieldState.error;
|
|
24924
|
+
return jsxRuntimeExports.jsxs("div", {
|
|
24925
|
+
children: [jsxRuntimeExports.jsx(FormControlLabel, _objectSpread2({
|
|
24926
|
+
control: jsxRuntimeExports.jsx(Switch, _objectSpread2(_objectSpread2({}, field), {}, {
|
|
24927
|
+
checked: field.value
|
|
24928
|
+
}))
|
|
24929
|
+
}, other)), (!!error || helperText) && jsxRuntimeExports.jsx(FormHelperText, {
|
|
24930
|
+
error: !!error,
|
|
24931
|
+
children: error ? error === null || error === void 0 ? void 0 : error.message : helperText
|
|
24932
|
+
})]
|
|
24933
|
+
});
|
|
24934
|
+
}
|
|
24935
|
+
});
|
|
24736
24936
|
}
|
|
24737
24937
|
|
|
24738
24938
|
function areArraysEqual(array1, array2, itemComparer = (a, b) => a === b) {
|
|
@@ -26509,21 +26709,61 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes /* remove-proptypes */
|
|
|
26509
26709
|
valueLabelFormat: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
|
|
26510
26710
|
} : void 0;
|
|
26511
26711
|
|
|
26512
|
-
|
|
26513
|
-
|
|
26514
|
-
|
|
26712
|
+
var _excluded$2 = ["name", "helperText"];
|
|
26713
|
+
function RHFSlider(_ref) {
|
|
26714
|
+
var name = _ref.name,
|
|
26715
|
+
helperText = _ref.helperText,
|
|
26716
|
+
other = _objectWithoutProperties(_ref, _excluded$2);
|
|
26717
|
+
var _useFormContext = useFormContext(),
|
|
26718
|
+
control = _useFormContext.control;
|
|
26719
|
+
return jsxRuntimeExports.jsx(Controller, {
|
|
26720
|
+
name: name,
|
|
26721
|
+
control: control,
|
|
26722
|
+
render: function render(_ref2) {
|
|
26723
|
+
var field = _ref2.field,
|
|
26724
|
+
error = _ref2.fieldState.error;
|
|
26725
|
+
return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
26726
|
+
children: [jsxRuntimeExports.jsx(Slider, _objectSpread2(_objectSpread2({}, field), {}, {
|
|
26727
|
+
valueLabelDisplay: "auto"
|
|
26728
|
+
}, other)), (!!error || helperText) && jsxRuntimeExports.jsx(FormHelperText, {
|
|
26729
|
+
error: !!error,
|
|
26730
|
+
children: error ? error === null || error === void 0 ? void 0 : error.message : helperText
|
|
26731
|
+
})]
|
|
26732
|
+
});
|
|
26733
|
+
}
|
|
26734
|
+
});
|
|
26515
26735
|
}
|
|
26516
26736
|
|
|
26517
|
-
|
|
26518
|
-
|
|
26519
|
-
|
|
26520
|
-
|
|
26521
|
-
|
|
26522
|
-
|
|
26523
|
-
|
|
26524
|
-
|
|
26525
|
-
|
|
26526
|
-
|
|
26737
|
+
var _excluded$1 = ["name", "helperText", "type"];
|
|
26738
|
+
function RHFTextField(_ref) {
|
|
26739
|
+
var name = _ref.name,
|
|
26740
|
+
helperText = _ref.helperText,
|
|
26741
|
+
type = _ref.type,
|
|
26742
|
+
other = _objectWithoutProperties(_ref, _excluded$1);
|
|
26743
|
+
var _useFormContext = useFormContext(),
|
|
26744
|
+
control = _useFormContext.control;
|
|
26745
|
+
return jsxRuntimeExports.jsx(Controller, {
|
|
26746
|
+
name: name,
|
|
26747
|
+
control: control,
|
|
26748
|
+
render: function render(_ref2) {
|
|
26749
|
+
var field = _ref2.field,
|
|
26750
|
+
error = _ref2.fieldState.error;
|
|
26751
|
+
return jsxRuntimeExports.jsx(TextField, _objectSpread2(_objectSpread2({}, field), {}, {
|
|
26752
|
+
fullWidth: true,
|
|
26753
|
+
type: type,
|
|
26754
|
+
value: type === "number" && field.value === 0 ? "" : field.value,
|
|
26755
|
+
onChange: function onChange(event) {
|
|
26756
|
+
if (type === "number") {
|
|
26757
|
+
field.onChange(Number(event.target.value));
|
|
26758
|
+
} else {
|
|
26759
|
+
field.onChange(event.target.value);
|
|
26760
|
+
}
|
|
26761
|
+
},
|
|
26762
|
+
error: !!error,
|
|
26763
|
+
helperText: error ? error === null || error === void 0 ? void 0 : error.message : helperText
|
|
26764
|
+
}, other));
|
|
26765
|
+
}
|
|
26766
|
+
});
|
|
26527
26767
|
}
|
|
26528
26768
|
|
|
26529
26769
|
var RadioButtonUncheckedIcon = createSvgIcon(/*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
@@ -26977,24 +27217,76 @@ process.env.NODE_ENV !== "production" ? RadioGroup.propTypes /* remove-proptypes
|
|
|
26977
27217
|
value: PropTypes.any
|
|
26978
27218
|
} : void 0;
|
|
26979
27219
|
|
|
26980
|
-
|
|
26981
|
-
|
|
26982
|
-
|
|
26983
|
-
|
|
26984
|
-
|
|
26985
|
-
|
|
26986
|
-
|
|
26987
|
-
|
|
26988
|
-
|
|
26989
|
-
|
|
26990
|
-
|
|
26991
|
-
|
|
26992
|
-
|
|
26993
|
-
|
|
26994
|
-
|
|
26995
|
-
|
|
26996
|
-
|
|
26997
|
-
|
|
27220
|
+
var _excluded = ["row", "name", "label", "options", "spacing", "helperText"];
|
|
27221
|
+
function RHFRadioGroup(_ref) {
|
|
27222
|
+
var row = _ref.row,
|
|
27223
|
+
name = _ref.name,
|
|
27224
|
+
label = _ref.label,
|
|
27225
|
+
options = _ref.options,
|
|
27226
|
+
spacing = _ref.spacing,
|
|
27227
|
+
helperText = _ref.helperText,
|
|
27228
|
+
other = _objectWithoutProperties(_ref, _excluded);
|
|
27229
|
+
var _useFormContext = useFormContext(),
|
|
27230
|
+
control = _useFormContext.control;
|
|
27231
|
+
var labelledby = label ? "".concat(name, "-").concat(label) : "";
|
|
27232
|
+
return jsxRuntimeExports.jsx(Controller, {
|
|
27233
|
+
name: name,
|
|
27234
|
+
control: control,
|
|
27235
|
+
render: function render(_ref2) {
|
|
27236
|
+
var field = _ref2.field,
|
|
27237
|
+
error = _ref2.fieldState.error;
|
|
27238
|
+
return jsxRuntimeExports.jsxs(FormControl, {
|
|
27239
|
+
component: "fieldset",
|
|
27240
|
+
children: [label && jsxRuntimeExports.jsx(FormLabel, {
|
|
27241
|
+
component: "legend",
|
|
27242
|
+
id: labelledby,
|
|
27243
|
+
sx: {
|
|
27244
|
+
typography: "body2"
|
|
27245
|
+
},
|
|
27246
|
+
children: label
|
|
27247
|
+
}), jsxRuntimeExports.jsx(RadioGroup, _objectSpread2(_objectSpread2(_objectSpread2({}, field), {}, {
|
|
27248
|
+
"aria-labelledby": labelledby,
|
|
27249
|
+
row: row
|
|
27250
|
+
}, other), {}, {
|
|
27251
|
+
children: options.map(function (option) {
|
|
27252
|
+
return jsxRuntimeExports.jsx(FormControlLabel, {
|
|
27253
|
+
value: option.value,
|
|
27254
|
+
control: jsxRuntimeExports.jsx(Radio, {}),
|
|
27255
|
+
label: option.label,
|
|
27256
|
+
sx: _objectSpread2({
|
|
27257
|
+
"&:not(:last-of-type)": {
|
|
27258
|
+
mb: spacing || 0
|
|
27259
|
+
}
|
|
27260
|
+
}, row && {
|
|
27261
|
+
mr: 0,
|
|
27262
|
+
"&:not(:last-of-type)": {
|
|
27263
|
+
mr: spacing || 2
|
|
27264
|
+
}
|
|
27265
|
+
})
|
|
27266
|
+
}, option.value);
|
|
27267
|
+
})
|
|
27268
|
+
})), (!!error || helperText) && jsxRuntimeExports.jsx(FormHelperText, {
|
|
27269
|
+
error: !!error,
|
|
27270
|
+
sx: {
|
|
27271
|
+
mx: 0
|
|
27272
|
+
},
|
|
27273
|
+
children: error ? error === null || error === void 0 ? void 0 : error.message : helperText
|
|
27274
|
+
})]
|
|
27275
|
+
});
|
|
27276
|
+
}
|
|
27277
|
+
});
|
|
27278
|
+
}
|
|
27279
|
+
|
|
27280
|
+
function FormProvider(_ref) {
|
|
27281
|
+
var children = _ref.children,
|
|
27282
|
+
onSubmit = _ref.onSubmit,
|
|
27283
|
+
methods = _ref.methods;
|
|
27284
|
+
return jsxRuntimeExports.jsx(FormProvider$1, _objectSpread2(_objectSpread2({}, methods), {}, {
|
|
27285
|
+
children: jsxRuntimeExports.jsx("form", {
|
|
27286
|
+
onSubmit: onSubmit,
|
|
27287
|
+
children: children
|
|
27288
|
+
})
|
|
27289
|
+
}));
|
|
26998
27290
|
}
|
|
26999
27291
|
|
|
27000
27292
|
export { Controller, Form, FormProvider, FormProvider$1 as FormProviderController, RHFCheckbox, RHFMultiCheckbox, RHFRadioGroup, RHFSelect, RHFSlider, RHFSwitch, RHFTextField, appendErrors, get, set, useController, useFieldArray, useForm, useFormContext, useFormState, useWatch };
|