@me1a/ui 1.1.2 → 1.2.1
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/example/index/example/index.d.ts +1 -0
- package/dist/example/index/example/simple.d.ts +4 -0
- package/dist/example/index/hook-forms/form-provider.d.ts +8 -0
- package/dist/example/index/hook-forms/index.d.ts +9 -0
- package/dist/example/index/hook-forms/rhf-autocomplete.d.ts +11 -0
- package/dist/example/index/hook-forms/rhf-checkbox.d.ts +19 -0
- package/dist/example/index/hook-forms/rhf-radio-group.d.ts +13 -0
- package/dist/example/index/hook-forms/rhf-select.d.ts +11 -0
- package/dist/example/index/hook-forms/rhf-slider.d.ts +7 -0
- package/dist/example/index/hook-forms/rhf-switch.d.ts +7 -0
- package/dist/example/index/hook-forms/rhf-text-field.d.ts +6 -0
- package/dist/example/index/index.cjs.js +1381 -0
- package/dist/example/index/index.cjs.js.map +1 -0
- package/dist/example/index/index.d.ts +2 -0
- package/dist/example/index/index.es.js +1379 -0
- package/dist/example/index/index.es.js.map +1 -0
- package/dist/hook-forms/index/example/index.d.ts +1 -0
- package/dist/hook-forms/index/example/simple.d.ts +4 -0
- package/dist/hook-forms/index/hook-forms/form-provider.d.ts +8 -0
- package/dist/hook-forms/index/hook-forms/index.d.ts +9 -0
- package/dist/hook-forms/index/hook-forms/rhf-autocomplete.d.ts +11 -0
- package/dist/hook-forms/index/hook-forms/rhf-checkbox.d.ts +19 -0
- package/dist/hook-forms/index/hook-forms/rhf-radio-group.d.ts +13 -0
- package/dist/hook-forms/index/hook-forms/rhf-select.d.ts +11 -0
- package/dist/hook-forms/index/hook-forms/rhf-slider.d.ts +7 -0
- package/dist/hook-forms/index/hook-forms/rhf-switch.d.ts +7 -0
- package/dist/hook-forms/index/hook-forms/rhf-text-field.d.ts +6 -0
- package/dist/{index.cjs.js → hook-forms/index/index.cjs.js} +280 -359
- package/dist/hook-forms/index/index.cjs.js.map +1 -0
- package/dist/hook-forms/index/index.d.ts +2 -0
- package/dist/{index.es.js → hook-forms/index/index.es.js} +280 -359
- package/dist/hook-forms/index/index.es.js.map +1 -0
- package/dist/index/example/index.d.ts +1 -0
- package/dist/index/example/simple.d.ts +4 -0
- package/dist/index/hook-forms/form-provider.d.ts +8 -0
- package/dist/index/hook-forms/index.d.ts +9 -0
- package/dist/index/hook-forms/rhf-autocomplete.d.ts +11 -0
- package/dist/index/hook-forms/rhf-checkbox.d.ts +19 -0
- package/dist/index/hook-forms/rhf-radio-group.d.ts +13 -0
- package/dist/index/hook-forms/rhf-select.d.ts +11 -0
- package/dist/index/hook-forms/rhf-slider.d.ts +7 -0
- package/dist/index/hook-forms/rhf-switch.d.ts +7 -0
- package/dist/index/hook-forms/rhf-text-field.d.ts +6 -0
- package/dist/index/index.cjs.js +27272 -0
- package/dist/index/index.cjs.js.map +1 -0
- package/dist/index/index.d.ts +2 -0
- package/dist/index/index.es.js +27232 -0
- package/dist/index/index.es.js.map +1 -0
- package/package.json +3 -3
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.d.ts +0 -74
- package/dist/index.es.js.map +0 -1
|
@@ -1641,7 +1641,7 @@ function createFormControl(props = {}) {
|
|
|
1641
1641
|
timer = setTimeout(callback, wait);
|
|
1642
1642
|
};
|
|
1643
1643
|
const _updateValid = async (shouldUpdateValid) => {
|
|
1644
|
-
if (!
|
|
1644
|
+
if (!_options.disabled && (_proxyFormState.isValid || shouldUpdateValid)) {
|
|
1645
1645
|
const isValid = _options.resolver
|
|
1646
1646
|
? isEmptyObject((await _executeSchema()).errors)
|
|
1647
1647
|
: await executeBuiltInValidation(_fields, true);
|
|
@@ -1653,7 +1653,7 @@ function createFormControl(props = {}) {
|
|
|
1653
1653
|
}
|
|
1654
1654
|
};
|
|
1655
1655
|
const _updateIsValidating = (names, isValidating) => {
|
|
1656
|
-
if (!
|
|
1656
|
+
if (!_options.disabled &&
|
|
1657
1657
|
(_proxyFormState.isValidating || _proxyFormState.validatingFields)) {
|
|
1658
1658
|
(names || Array.from(_names.mount)).forEach((name) => {
|
|
1659
1659
|
if (name) {
|
|
@@ -1669,7 +1669,7 @@ function createFormControl(props = {}) {
|
|
|
1669
1669
|
}
|
|
1670
1670
|
};
|
|
1671
1671
|
const _updateFieldArray = (name, values = [], method, args, shouldSetValues = true, shouldUpdateFieldsAndState = true) => {
|
|
1672
|
-
if (args && method && !
|
|
1672
|
+
if (args && method && !_options.disabled) {
|
|
1673
1673
|
_state.action = true;
|
|
1674
1674
|
if (shouldUpdateFieldsAndState && Array.isArray(get(_fields, name))) {
|
|
1675
1675
|
const fieldValues = method(get(_fields, name), args.argA, args.argB);
|
|
@@ -1733,7 +1733,7 @@ function createFormControl(props = {}) {
|
|
|
1733
1733
|
const output = {
|
|
1734
1734
|
name,
|
|
1735
1735
|
};
|
|
1736
|
-
if (!
|
|
1736
|
+
if (!_options.disabled) {
|
|
1737
1737
|
const disabledField = !!(get(_fields, name) &&
|
|
1738
1738
|
get(_fields, name)._f &&
|
|
1739
1739
|
get(_fields, name)._f.disabled);
|
|
@@ -1869,7 +1869,7 @@ function createFormControl(props = {}) {
|
|
|
1869
1869
|
}
|
|
1870
1870
|
_names.unMount = new Set();
|
|
1871
1871
|
};
|
|
1872
|
-
const _getDirty = (name, data) => !
|
|
1872
|
+
const _getDirty = (name, data) => !_options.disabled &&
|
|
1873
1873
|
(name && data && set(_formValues, name, data),
|
|
1874
1874
|
!deepEqual(getValues(), _defaultValues));
|
|
1875
1875
|
const _getWatch = (names, defaultValue, isGlobal) => generateWatchOutput(names, _names, {
|
|
@@ -2185,7 +2185,7 @@ function createFormControl(props = {}) {
|
|
|
2185
2185
|
};
|
|
2186
2186
|
const register = (name, options = {}) => {
|
|
2187
2187
|
let field = get(_fields, name);
|
|
2188
|
-
const disabledIsDefined = isBoolean(options.disabled) || isBoolean(
|
|
2188
|
+
const disabledIsDefined = isBoolean(options.disabled) || isBoolean(_options.disabled);
|
|
2189
2189
|
set(_fields, name, {
|
|
2190
2190
|
...(field || {}),
|
|
2191
2191
|
_f: {
|
|
@@ -2201,7 +2201,7 @@ function createFormControl(props = {}) {
|
|
|
2201
2201
|
field,
|
|
2202
2202
|
disabled: isBoolean(options.disabled)
|
|
2203
2203
|
? options.disabled
|
|
2204
|
-
:
|
|
2204
|
+
: _options.disabled,
|
|
2205
2205
|
name,
|
|
2206
2206
|
value: options.value,
|
|
2207
2207
|
});
|
|
@@ -2211,7 +2211,7 @@ function createFormControl(props = {}) {
|
|
|
2211
2211
|
}
|
|
2212
2212
|
return {
|
|
2213
2213
|
...(disabledIsDefined
|
|
2214
|
-
? { disabled: options.disabled ||
|
|
2214
|
+
? { disabled: options.disabled || _options.disabled }
|
|
2215
2215
|
: {}),
|
|
2216
2216
|
...(_options.progressive
|
|
2217
2217
|
? {
|
|
@@ -2295,6 +2295,12 @@ function createFormControl(props = {}) {
|
|
|
2295
2295
|
e.preventDefault && e.preventDefault();
|
|
2296
2296
|
e.persist && e.persist();
|
|
2297
2297
|
}
|
|
2298
|
+
if (_options.disabled) {
|
|
2299
|
+
if (onInvalid) {
|
|
2300
|
+
await onInvalid({ ..._formState.errors }, e);
|
|
2301
|
+
}
|
|
2302
|
+
return;
|
|
2303
|
+
}
|
|
2298
2304
|
let fieldValues = cloneObject(_formValues);
|
|
2299
2305
|
_subjects.state.next({
|
|
2300
2306
|
isSubmitting: true,
|
|
@@ -2473,7 +2479,9 @@ function createFormControl(props = {}) {
|
|
|
2473
2479
|
: fieldReference.ref;
|
|
2474
2480
|
if (fieldRef.focus) {
|
|
2475
2481
|
fieldRef.focus();
|
|
2476
|
-
options.shouldSelect &&
|
|
2482
|
+
options.shouldSelect &&
|
|
2483
|
+
isFunction(fieldRef.select) &&
|
|
2484
|
+
fieldRef.select();
|
|
2477
2485
|
}
|
|
2478
2486
|
}
|
|
2479
2487
|
};
|
|
@@ -2674,103 +2682,10 @@ function useForm(props = {}) {
|
|
|
2674
2682
|
values: control._getWatch(),
|
|
2675
2683
|
});
|
|
2676
2684
|
}, [props.shouldUnregister, control]);
|
|
2677
|
-
React.useEffect(() => {
|
|
2678
|
-
if (_formControl.current) {
|
|
2679
|
-
_formControl.current.watch = _formControl.current.watch.bind({});
|
|
2680
|
-
}
|
|
2681
|
-
}, [formState]);
|
|
2682
2685
|
_formControl.current.formState = getProxyFormState(formState, control);
|
|
2683
2686
|
return _formControl.current;
|
|
2684
2687
|
}
|
|
2685
2688
|
|
|
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
|
-
|
|
2774
2689
|
function getDefaultExportFromCjs (x) {
|
|
2775
2690
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
2776
2691
|
}
|
|
@@ -4009,7 +3924,6 @@ function requireReactJsxRuntime_development () {
|
|
|
4009
3924
|
}
|
|
4010
3925
|
}
|
|
4011
3926
|
|
|
4012
|
-
var didWarnAboutKeySpread = {};
|
|
4013
3927
|
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
4014
3928
|
{
|
|
4015
3929
|
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
@@ -4080,24 +3994,6 @@ function requireReactJsxRuntime_development () {
|
|
|
4080
3994
|
}
|
|
4081
3995
|
}
|
|
4082
3996
|
|
|
4083
|
-
{
|
|
4084
|
-
if (hasOwnProperty.call(props, 'key')) {
|
|
4085
|
-
var componentName = getComponentNameFromType(type);
|
|
4086
|
-
var keys = Object.keys(props).filter(function (k) {
|
|
4087
|
-
return k !== 'key';
|
|
4088
|
-
});
|
|
4089
|
-
var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
|
|
4090
|
-
|
|
4091
|
-
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
4092
|
-
var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
|
|
4093
|
-
|
|
4094
|
-
error('A props object containing a "key" prop is being spread into JSX:\n' + ' let props = %s;\n' + ' <%s {...props} />\n' + 'React keys must be passed directly to JSX without using spread:\n' + ' let props = %s;\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
|
|
4095
|
-
|
|
4096
|
-
didWarnAboutKeySpread[componentName + beforeExample] = true;
|
|
4097
|
-
}
|
|
4098
|
-
}
|
|
4099
|
-
}
|
|
4100
|
-
|
|
4101
3997
|
if (type === REACT_FRAGMENT_TYPE) {
|
|
4102
3998
|
validateFragmentProps(element);
|
|
4103
3999
|
} else {
|
|
@@ -22380,48 +22276,53 @@ process.env.NODE_ENV !== "production" ? TextField.propTypes /* remove-proptypes
|
|
|
22380
22276
|
variant: PropTypes.oneOf(['filled', 'outlined', 'standard'])
|
|
22381
22277
|
} : void 0;
|
|
22382
22278
|
|
|
22383
|
-
|
|
22384
|
-
|
|
22385
|
-
|
|
22386
|
-
|
|
22387
|
-
|
|
22388
|
-
|
|
22389
|
-
|
|
22390
|
-
|
|
22391
|
-
|
|
22392
|
-
|
|
22393
|
-
|
|
22394
|
-
|
|
22279
|
+
function RHFSelect({
|
|
22280
|
+
name,
|
|
22281
|
+
native,
|
|
22282
|
+
maxHeight = 220,
|
|
22283
|
+
helperText,
|
|
22284
|
+
children,
|
|
22285
|
+
PaperPropsSx,
|
|
22286
|
+
...other
|
|
22287
|
+
}) {
|
|
22288
|
+
const {
|
|
22289
|
+
control
|
|
22290
|
+
} = useFormContext();
|
|
22395
22291
|
return jsxRuntimeExports.jsx(Controller, {
|
|
22396
22292
|
name: name,
|
|
22397
22293
|
control: control,
|
|
22398
|
-
render:
|
|
22399
|
-
|
|
22400
|
-
|
|
22401
|
-
|
|
22402
|
-
|
|
22403
|
-
|
|
22404
|
-
|
|
22405
|
-
|
|
22406
|
-
|
|
22407
|
-
|
|
22408
|
-
|
|
22409
|
-
|
|
22294
|
+
render: ({
|
|
22295
|
+
field,
|
|
22296
|
+
fieldState: {
|
|
22297
|
+
error
|
|
22298
|
+
}
|
|
22299
|
+
}) => jsxRuntimeExports.jsx(TextField, {
|
|
22300
|
+
...field,
|
|
22301
|
+
select: true,
|
|
22302
|
+
fullWidth: true,
|
|
22303
|
+
slotProps: {
|
|
22304
|
+
select: {
|
|
22305
|
+
native,
|
|
22306
|
+
MenuProps: {
|
|
22307
|
+
PaperProps: {
|
|
22308
|
+
sx: {
|
|
22309
|
+
...(!native && {
|
|
22410
22310
|
maxHeight: typeof maxHeight === "number" ? maxHeight : "unset"
|
|
22411
|
-
}),
|
|
22311
|
+
}),
|
|
22312
|
+
...PaperPropsSx
|
|
22412
22313
|
}
|
|
22413
|
-
},
|
|
22414
|
-
sx: {
|
|
22415
|
-
textTransform: "capitalize"
|
|
22416
22314
|
}
|
|
22315
|
+
},
|
|
22316
|
+
sx: {
|
|
22317
|
+
textTransform: "capitalize"
|
|
22417
22318
|
}
|
|
22418
|
-
}
|
|
22419
|
-
|
|
22420
|
-
|
|
22421
|
-
|
|
22422
|
-
|
|
22423
|
-
|
|
22424
|
-
}
|
|
22319
|
+
}
|
|
22320
|
+
},
|
|
22321
|
+
error: !!error,
|
|
22322
|
+
helperText: error ? error?.message : helperText,
|
|
22323
|
+
...other,
|
|
22324
|
+
children: children
|
|
22325
|
+
})
|
|
22425
22326
|
});
|
|
22426
22327
|
}
|
|
22427
22328
|
|
|
@@ -24504,96 +24405,100 @@ process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes /* remove-pro
|
|
|
24504
24405
|
value: PropTypes.any
|
|
24505
24406
|
} : void 0;
|
|
24506
24407
|
|
|
24507
|
-
|
|
24508
|
-
|
|
24509
|
-
|
|
24510
|
-
|
|
24511
|
-
|
|
24512
|
-
|
|
24513
|
-
|
|
24514
|
-
|
|
24408
|
+
function RHFCheckbox({
|
|
24409
|
+
name,
|
|
24410
|
+
helperText,
|
|
24411
|
+
...other
|
|
24412
|
+
}) {
|
|
24413
|
+
const {
|
|
24414
|
+
control
|
|
24415
|
+
} = useFormContext();
|
|
24515
24416
|
return jsxRuntimeExports.jsx(Controller, {
|
|
24516
24417
|
name: name,
|
|
24517
24418
|
control: control,
|
|
24518
|
-
render:
|
|
24519
|
-
|
|
24520
|
-
|
|
24521
|
-
|
|
24522
|
-
|
|
24523
|
-
|
|
24524
|
-
|
|
24525
|
-
|
|
24526
|
-
|
|
24527
|
-
|
|
24528
|
-
|
|
24529
|
-
|
|
24530
|
-
})
|
|
24531
|
-
|
|
24419
|
+
render: ({
|
|
24420
|
+
field,
|
|
24421
|
+
fieldState: {
|
|
24422
|
+
error
|
|
24423
|
+
}
|
|
24424
|
+
}) => jsxRuntimeExports.jsxs("div", {
|
|
24425
|
+
children: [jsxRuntimeExports.jsx(FormControlLabel, {
|
|
24426
|
+
control: jsxRuntimeExports.jsx(Checkbox, {
|
|
24427
|
+
...field,
|
|
24428
|
+
checked: field.value
|
|
24429
|
+
}),
|
|
24430
|
+
...other
|
|
24431
|
+
}), (!!error || helperText) && jsxRuntimeExports.jsx(FormHelperText, {
|
|
24432
|
+
error: !!error,
|
|
24433
|
+
children: error ? error?.message : helperText
|
|
24434
|
+
})]
|
|
24435
|
+
})
|
|
24532
24436
|
});
|
|
24533
24437
|
}
|
|
24534
|
-
function RHFMultiCheckbox(
|
|
24535
|
-
|
|
24536
|
-
|
|
24537
|
-
|
|
24538
|
-
|
|
24539
|
-
|
|
24540
|
-
|
|
24541
|
-
|
|
24542
|
-
|
|
24543
|
-
|
|
24544
|
-
|
|
24545
|
-
|
|
24546
|
-
|
|
24547
|
-
|
|
24548
|
-
}) : [].concat(_toConsumableArray(selectedItems), [item]);
|
|
24549
|
-
};
|
|
24438
|
+
function RHFMultiCheckbox({
|
|
24439
|
+
row,
|
|
24440
|
+
name,
|
|
24441
|
+
label,
|
|
24442
|
+
options,
|
|
24443
|
+
spacing,
|
|
24444
|
+
helperText,
|
|
24445
|
+
sx,
|
|
24446
|
+
...other
|
|
24447
|
+
}) {
|
|
24448
|
+
const {
|
|
24449
|
+
control
|
|
24450
|
+
} = useFormContext();
|
|
24451
|
+
const getSelected = (selectedItems, item) => selectedItems.includes(item) ? selectedItems.filter(value => value !== item) : [...selectedItems, item];
|
|
24550
24452
|
return jsxRuntimeExports.jsx(Controller, {
|
|
24551
24453
|
name: name,
|
|
24552
24454
|
control: control,
|
|
24553
|
-
render:
|
|
24554
|
-
|
|
24555
|
-
|
|
24556
|
-
|
|
24557
|
-
|
|
24558
|
-
|
|
24559
|
-
|
|
24560
|
-
|
|
24561
|
-
|
|
24562
|
-
|
|
24563
|
-
|
|
24564
|
-
}
|
|
24565
|
-
|
|
24455
|
+
render: ({
|
|
24456
|
+
field,
|
|
24457
|
+
fieldState: {
|
|
24458
|
+
error
|
|
24459
|
+
}
|
|
24460
|
+
}) => jsxRuntimeExports.jsxs(FormControl, {
|
|
24461
|
+
component: "fieldset",
|
|
24462
|
+
children: [label && jsxRuntimeExports.jsx(FormLabel, {
|
|
24463
|
+
component: "legend",
|
|
24464
|
+
sx: {
|
|
24465
|
+
typography: "body2"
|
|
24466
|
+
},
|
|
24467
|
+
children: label
|
|
24468
|
+
}), jsxRuntimeExports.jsx(FormGroup, {
|
|
24469
|
+
sx: {
|
|
24470
|
+
...(row && {
|
|
24566
24471
|
flexDirection: "row"
|
|
24567
|
-
}),
|
|
24472
|
+
}),
|
|
24473
|
+
[`& .${formControlLabelClasses.root}`]: {
|
|
24568
24474
|
"&:not(:last-of-type)": {
|
|
24569
24475
|
mb: spacing || 0
|
|
24570
|
-
}
|
|
24571
|
-
|
|
24572
|
-
|
|
24573
|
-
|
|
24574
|
-
|
|
24575
|
-
|
|
24576
|
-
|
|
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
|
|
24476
|
+
},
|
|
24477
|
+
...(row && {
|
|
24478
|
+
mr: 0,
|
|
24479
|
+
"&:not(:last-of-type)": {
|
|
24480
|
+
mr: spacing || 2
|
|
24481
|
+
}
|
|
24482
|
+
})
|
|
24592
24483
|
},
|
|
24593
|
-
|
|
24594
|
-
}
|
|
24595
|
-
|
|
24596
|
-
|
|
24484
|
+
...sx
|
|
24485
|
+
},
|
|
24486
|
+
children: options.map(option => jsxRuntimeExports.jsx(FormControlLabel, {
|
|
24487
|
+
control: jsxRuntimeExports.jsx(Checkbox, {
|
|
24488
|
+
checked: field.value.includes(option.value),
|
|
24489
|
+
onChange: () => field.onChange(getSelected(field.value, `${option.value}`))
|
|
24490
|
+
}),
|
|
24491
|
+
label: option.label,
|
|
24492
|
+
...other
|
|
24493
|
+
}, option.value))
|
|
24494
|
+
}), (!!error || helperText) && jsxRuntimeExports.jsx(FormHelperText, {
|
|
24495
|
+
error: !!error,
|
|
24496
|
+
sx: {
|
|
24497
|
+
mx: 0
|
|
24498
|
+
},
|
|
24499
|
+
children: error ? error?.message : helperText
|
|
24500
|
+
})]
|
|
24501
|
+
})
|
|
24597
24502
|
});
|
|
24598
24503
|
}
|
|
24599
24504
|
|
|
@@ -24928,30 +24833,34 @@ process.env.NODE_ENV !== "production" ? Switch.propTypes /* remove-proptypes */
|
|
|
24928
24833
|
value: PropTypes.any
|
|
24929
24834
|
} : void 0;
|
|
24930
24835
|
|
|
24931
|
-
|
|
24932
|
-
|
|
24933
|
-
|
|
24934
|
-
|
|
24935
|
-
|
|
24936
|
-
|
|
24937
|
-
control
|
|
24836
|
+
function RHFSwitch({
|
|
24837
|
+
name,
|
|
24838
|
+
helperText,
|
|
24839
|
+
...other
|
|
24840
|
+
}) {
|
|
24841
|
+
const {
|
|
24842
|
+
control
|
|
24843
|
+
} = useFormContext();
|
|
24938
24844
|
return jsxRuntimeExports.jsx(Controller, {
|
|
24939
24845
|
name: name,
|
|
24940
24846
|
control: control,
|
|
24941
|
-
render:
|
|
24942
|
-
|
|
24943
|
-
|
|
24944
|
-
|
|
24945
|
-
|
|
24946
|
-
|
|
24947
|
-
|
|
24948
|
-
|
|
24949
|
-
|
|
24950
|
-
|
|
24951
|
-
|
|
24952
|
-
|
|
24953
|
-
})
|
|
24954
|
-
|
|
24847
|
+
render: ({
|
|
24848
|
+
field,
|
|
24849
|
+
fieldState: {
|
|
24850
|
+
error
|
|
24851
|
+
}
|
|
24852
|
+
}) => jsxRuntimeExports.jsxs("div", {
|
|
24853
|
+
children: [jsxRuntimeExports.jsx(FormControlLabel, {
|
|
24854
|
+
control: jsxRuntimeExports.jsx(Switch, {
|
|
24855
|
+
...field,
|
|
24856
|
+
checked: field.value
|
|
24857
|
+
}),
|
|
24858
|
+
...other
|
|
24859
|
+
}), (!!error || helperText) && jsxRuntimeExports.jsx(FormHelperText, {
|
|
24860
|
+
error: !!error,
|
|
24861
|
+
children: error ? error?.message : helperText
|
|
24862
|
+
})]
|
|
24863
|
+
})
|
|
24955
24864
|
});
|
|
24956
24865
|
}
|
|
24957
24866
|
|
|
@@ -26729,60 +26638,68 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes /* remove-proptypes */
|
|
|
26729
26638
|
valueLabelFormat: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
|
|
26730
26639
|
} : void 0;
|
|
26731
26640
|
|
|
26732
|
-
|
|
26733
|
-
|
|
26734
|
-
|
|
26735
|
-
|
|
26736
|
-
|
|
26737
|
-
|
|
26738
|
-
control
|
|
26641
|
+
function RHFSlider({
|
|
26642
|
+
name,
|
|
26643
|
+
helperText,
|
|
26644
|
+
...other
|
|
26645
|
+
}) {
|
|
26646
|
+
const {
|
|
26647
|
+
control
|
|
26648
|
+
} = useFormContext();
|
|
26739
26649
|
return jsxRuntimeExports.jsx(Controller, {
|
|
26740
26650
|
name: name,
|
|
26741
26651
|
control: control,
|
|
26742
|
-
render:
|
|
26743
|
-
|
|
26744
|
-
|
|
26745
|
-
|
|
26746
|
-
|
|
26747
|
-
|
|
26748
|
-
|
|
26749
|
-
|
|
26750
|
-
|
|
26751
|
-
|
|
26752
|
-
})
|
|
26753
|
-
|
|
26652
|
+
render: ({
|
|
26653
|
+
field,
|
|
26654
|
+
fieldState: {
|
|
26655
|
+
error
|
|
26656
|
+
}
|
|
26657
|
+
}) => jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
26658
|
+
children: [jsxRuntimeExports.jsx(Slider, {
|
|
26659
|
+
...field,
|
|
26660
|
+
valueLabelDisplay: "auto",
|
|
26661
|
+
...other
|
|
26662
|
+
}), (!!error || helperText) && jsxRuntimeExports.jsx(FormHelperText, {
|
|
26663
|
+
error: !!error,
|
|
26664
|
+
children: error ? error?.message : helperText
|
|
26665
|
+
})]
|
|
26666
|
+
})
|
|
26754
26667
|
});
|
|
26755
26668
|
}
|
|
26756
26669
|
|
|
26757
|
-
|
|
26758
|
-
|
|
26759
|
-
|
|
26760
|
-
|
|
26761
|
-
|
|
26762
|
-
|
|
26763
|
-
|
|
26764
|
-
control
|
|
26670
|
+
function RHFTextField({
|
|
26671
|
+
name,
|
|
26672
|
+
helperText,
|
|
26673
|
+
type,
|
|
26674
|
+
...other
|
|
26675
|
+
}) {
|
|
26676
|
+
const {
|
|
26677
|
+
control
|
|
26678
|
+
} = useFormContext();
|
|
26765
26679
|
return jsxRuntimeExports.jsx(Controller, {
|
|
26766
26680
|
name: name,
|
|
26767
26681
|
control: control,
|
|
26768
|
-
render:
|
|
26769
|
-
|
|
26770
|
-
|
|
26771
|
-
|
|
26772
|
-
|
|
26773
|
-
|
|
26774
|
-
|
|
26775
|
-
|
|
26776
|
-
|
|
26777
|
-
|
|
26778
|
-
|
|
26779
|
-
|
|
26780
|
-
|
|
26781
|
-
}
|
|
26782
|
-
|
|
26783
|
-
|
|
26784
|
-
},
|
|
26785
|
-
|
|
26682
|
+
render: ({
|
|
26683
|
+
field,
|
|
26684
|
+
fieldState: {
|
|
26685
|
+
error
|
|
26686
|
+
}
|
|
26687
|
+
}) => jsxRuntimeExports.jsx(TextField, {
|
|
26688
|
+
...field,
|
|
26689
|
+
fullWidth: true,
|
|
26690
|
+
type: type,
|
|
26691
|
+
value: type === "number" && field.value === 0 ? "" : field.value,
|
|
26692
|
+
onChange: event => {
|
|
26693
|
+
if (type === "number") {
|
|
26694
|
+
field.onChange(Number(event.target.value));
|
|
26695
|
+
} else {
|
|
26696
|
+
field.onChange(event.target.value);
|
|
26697
|
+
}
|
|
26698
|
+
},
|
|
26699
|
+
error: !!error,
|
|
26700
|
+
helperText: error ? error?.message : helperText,
|
|
26701
|
+
...other
|
|
26702
|
+
})
|
|
26786
26703
|
});
|
|
26787
26704
|
}
|
|
26788
26705
|
|
|
@@ -27237,76 +27154,80 @@ process.env.NODE_ENV !== "production" ? RadioGroup.propTypes /* remove-proptypes
|
|
|
27237
27154
|
value: PropTypes.any
|
|
27238
27155
|
} : void 0;
|
|
27239
27156
|
|
|
27240
|
-
|
|
27241
|
-
|
|
27242
|
-
|
|
27243
|
-
|
|
27244
|
-
|
|
27245
|
-
|
|
27246
|
-
|
|
27247
|
-
|
|
27248
|
-
|
|
27249
|
-
|
|
27250
|
-
control
|
|
27251
|
-
|
|
27157
|
+
function RHFRadioGroup({
|
|
27158
|
+
row,
|
|
27159
|
+
name,
|
|
27160
|
+
label,
|
|
27161
|
+
options,
|
|
27162
|
+
spacing,
|
|
27163
|
+
helperText,
|
|
27164
|
+
...other
|
|
27165
|
+
}) {
|
|
27166
|
+
const {
|
|
27167
|
+
control
|
|
27168
|
+
} = useFormContext();
|
|
27169
|
+
const labelledby = label ? `${name}-${label}` : "";
|
|
27252
27170
|
return jsxRuntimeExports.jsx(Controller, {
|
|
27253
27171
|
name: name,
|
|
27254
27172
|
control: control,
|
|
27255
|
-
render:
|
|
27256
|
-
|
|
27257
|
-
|
|
27258
|
-
|
|
27259
|
-
|
|
27260
|
-
|
|
27261
|
-
|
|
27262
|
-
|
|
27263
|
-
|
|
27264
|
-
|
|
27265
|
-
|
|
27266
|
-
|
|
27267
|
-
}
|
|
27268
|
-
|
|
27269
|
-
|
|
27270
|
-
|
|
27271
|
-
|
|
27272
|
-
|
|
27273
|
-
|
|
27274
|
-
|
|
27275
|
-
|
|
27276
|
-
|
|
27277
|
-
|
|
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,
|
|
27173
|
+
render: ({
|
|
27174
|
+
field,
|
|
27175
|
+
fieldState: {
|
|
27176
|
+
error
|
|
27177
|
+
}
|
|
27178
|
+
}) => jsxRuntimeExports.jsxs(FormControl, {
|
|
27179
|
+
component: "fieldset",
|
|
27180
|
+
children: [label && jsxRuntimeExports.jsx(FormLabel, {
|
|
27181
|
+
component: "legend",
|
|
27182
|
+
id: labelledby,
|
|
27183
|
+
sx: {
|
|
27184
|
+
typography: "body2"
|
|
27185
|
+
},
|
|
27186
|
+
children: label
|
|
27187
|
+
}), jsxRuntimeExports.jsx(RadioGroup, {
|
|
27188
|
+
...field,
|
|
27189
|
+
"aria-labelledby": labelledby,
|
|
27190
|
+
row: row,
|
|
27191
|
+
...other,
|
|
27192
|
+
children: options.map(option => jsxRuntimeExports.jsx(FormControlLabel, {
|
|
27193
|
+
value: option.value,
|
|
27194
|
+
control: jsxRuntimeExports.jsx(Radio, {}),
|
|
27195
|
+
label: option.label,
|
|
27290
27196
|
sx: {
|
|
27291
|
-
|
|
27292
|
-
|
|
27293
|
-
|
|
27294
|
-
|
|
27295
|
-
|
|
27296
|
-
|
|
27197
|
+
"&:not(:last-of-type)": {
|
|
27198
|
+
mb: spacing || 0
|
|
27199
|
+
},
|
|
27200
|
+
...(row && {
|
|
27201
|
+
mr: 0,
|
|
27202
|
+
"&:not(:last-of-type)": {
|
|
27203
|
+
mr: spacing || 2
|
|
27204
|
+
}
|
|
27205
|
+
})
|
|
27206
|
+
}
|
|
27207
|
+
}, option.value))
|
|
27208
|
+
}), (!!error || helperText) && jsxRuntimeExports.jsx(FormHelperText, {
|
|
27209
|
+
error: !!error,
|
|
27210
|
+
sx: {
|
|
27211
|
+
mx: 0
|
|
27212
|
+
},
|
|
27213
|
+
children: error ? error?.message : helperText
|
|
27214
|
+
})]
|
|
27215
|
+
})
|
|
27297
27216
|
});
|
|
27298
27217
|
}
|
|
27299
27218
|
|
|
27300
|
-
function FormProvider(
|
|
27301
|
-
|
|
27302
|
-
|
|
27303
|
-
|
|
27304
|
-
|
|
27219
|
+
function FormProvider({
|
|
27220
|
+
children,
|
|
27221
|
+
onSubmit,
|
|
27222
|
+
methods
|
|
27223
|
+
}) {
|
|
27224
|
+
return jsxRuntimeExports.jsx(FormProvider$1, {
|
|
27225
|
+
...methods,
|
|
27305
27226
|
children: jsxRuntimeExports.jsx("form", {
|
|
27306
27227
|
onSubmit: onSubmit,
|
|
27307
27228
|
children: children
|
|
27308
27229
|
})
|
|
27309
|
-
})
|
|
27230
|
+
});
|
|
27310
27231
|
}
|
|
27311
27232
|
|
|
27312
27233
|
exports.Controller = Controller;
|