@pdg/react-form 1.0.20 → 1.0.22
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/@private/PrivateDatePicker/PrivateDatePicker.types.d.ts +1 -0
- package/dist/FormItemCustom/FormAutocomplete/FormAutocomplete.types.d.ts +1 -0
- package/dist/FormItemCustom/FormCheckbox/FormCheckbox.types.d.ts +1 -0
- package/dist/FormItemCustom/FormDateRangePicker/FormDateRangePicker.types.d.ts +1 -0
- package/dist/FormItemCustom/FormFile/FormFile.types.d.ts +1 -0
- package/dist/FormItemCustom/FormItemBase/FormItemBase.types.d.ts +1 -0
- package/dist/FormItemCustom/FormRadioGroup/FormRadioGroup.types.d.ts +1 -0
- package/dist/FormItemCustom/FormRating/FormRating.types.d.ts +1 -0
- package/dist/FormItemCustom/FormTextEditor/FormTextEditor.types.d.ts +1 -0
- package/dist/FormItemCustom/FormToggleButtonGroup/FormToggleButtonGroup.types.d.ts +1 -0
- package/dist/FormItemTextFieldBase/FormTextField/FormTextField.d.ts +1 -0
- package/dist/FormItemTextFieldBase/FormTextField/FormTextField.types.d.ts +1 -0
- package/dist/index.esm.js +116 -117
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +116 -117
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -949,35 +949,25 @@ FormDivider.defaultProps = FormDividerDefaultProps;function useFirstSkipEffect$1
|
|
|
949
949
|
return v1 === v2;
|
|
950
950
|
}
|
|
951
951
|
return true;
|
|
952
|
-
};function
|
|
953
|
-
var firstRef = React.useRef(true);
|
|
954
|
-
React.useLayoutEffect(function () {
|
|
955
|
-
if (firstRef.current) {
|
|
956
|
-
firstRef.current = false;
|
|
957
|
-
}
|
|
958
|
-
else {
|
|
959
|
-
effect();
|
|
960
|
-
}
|
|
961
|
-
}, deps);
|
|
962
|
-
}function useAutoUpdateLayoutState(p1, p2) {
|
|
952
|
+
};function useAutoUpdateState$1(p1, p2) {
|
|
963
953
|
var state = typeof p1 === 'function' ? undefined : p1;
|
|
964
954
|
var finalStateCallback = typeof p1 === 'function' ? p1 : p2;
|
|
965
955
|
var _a = React.useState(0), setUpdateKey = _a[1];
|
|
966
956
|
var _initState = React.useState(function () {
|
|
967
|
-
return finalStateCallback ? finalStateCallback(state
|
|
957
|
+
return finalStateCallback ? finalStateCallback(state) : state;
|
|
968
958
|
})[0];
|
|
969
959
|
var _state = React.useRef(_initState);
|
|
970
960
|
var forceUpdate = React.useCallback(function () {
|
|
971
961
|
setUpdateKey(function (updateKey) { return updateKey + 1; });
|
|
972
962
|
}, []);
|
|
973
|
-
|
|
963
|
+
useFirstSkipEffect$1(function () {
|
|
974
964
|
var newState = finalStateCallback ? finalStateCallback(state) : state;
|
|
975
965
|
if (!isSame$1(newState, _state.current)) {
|
|
976
966
|
_state.current = newState;
|
|
977
967
|
forceUpdate();
|
|
978
968
|
}
|
|
979
969
|
}, [state]);
|
|
980
|
-
|
|
970
|
+
useFirstSkipEffect$1(function () {
|
|
981
971
|
var newState = finalStateCallback ? finalStateCallback(_state.current) : _state.current;
|
|
982
972
|
if (!isSame$1(newState, _state.current)) {
|
|
983
973
|
_state.current = newState;
|
|
@@ -1012,7 +1002,7 @@ var templateObject_1$2;var FormBlock = React__default["default"].forwardRef(func
|
|
|
1012
1002
|
var labelShrink = React.useMemo(function () { return (initLabelShrink == null ? formLabelShrink : initLabelShrink); }, [initLabelShrink, formLabelShrink]);
|
|
1013
1003
|
var fullWidth = React.useMemo(function () { return (initFullWidth == null ? formFullWidth : initFullWidth); }, [initFullWidth, formFullWidth]);
|
|
1014
1004
|
// State -------------------------------------------------------------------------------------------------------------
|
|
1015
|
-
var _c =
|
|
1005
|
+
var _c = useAutoUpdateState$1(initCollapseIn), collapseIn = _c[0], setCollapseIn = _c[1];
|
|
1016
1006
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
1017
1007
|
var style = React.useMemo(function () {
|
|
1018
1008
|
if (hidden) {
|
|
@@ -1978,7 +1968,7 @@ function useResizeDetector(props) {
|
|
|
1978
1968
|
// ResizeDetector --------------------------------------------------------------------------------------------------
|
|
1979
1969
|
var _c = useResizeDetector(), formColWidth = _c.width, resizeDetectorRef = _c.ref;
|
|
1980
1970
|
// State - style ---------------------------------------------------------------------------------------------------
|
|
1981
|
-
var style =
|
|
1971
|
+
var style = useAutoUpdateState$1(React.useCallback(function () {
|
|
1982
1972
|
if (hidden) {
|
|
1983
1973
|
return __assign$4(__assign$4({}, initStyle), { display: 'none' });
|
|
1984
1974
|
}
|
|
@@ -2052,13 +2042,13 @@ styleInject(css_248z$j);var FormTextField = React__default["default"].forwardRef
|
|
|
2052
2042
|
var _b;
|
|
2053
2043
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
2054
2044
|
//----------------------------------------------------------------------------------------------------------------
|
|
2055
|
-
name = _a.name, required = _a.required, initValue = _a.value, icon = _a.icon, labelIcon = _a.labelIcon, initLabel = _a.label, initError = _a.error, initHelperText = _a.helperText, exceptValue = _a.exceptValue, readOnly = _a.readOnly, initDisabled = _a.disabled, placeholder = _a.placeholder, maxLength = _a.maxLength, clear = _a.clear, width = _a.width, initMuiInputProps = _a.InputProps, initMuiInputLabelProps = _a.InputLabelProps, initInputProps = _a.inputProps, initInputRef = _a.inputRef, select = _a.select, SelectProps = _a.SelectProps, multiline = _a.multiline, validPattern = _a.validPattern, invalidPattern = _a.invalidPattern, startAdornment = _a.startAdornment, endAdornment = _a.endAdornment, noFormValueItem = _a.noFormValueItem,
|
|
2045
|
+
name = _a.name, required = _a.required, initValue = _a.value, icon = _a.icon, labelIcon = _a.labelIcon, initLabel = _a.label, initError = _a.error, initHelperText = _a.helperText, exceptValue = _a.exceptValue, readOnly = _a.readOnly, initDisabled = _a.disabled, placeholder = _a.placeholder, maxLength = _a.maxLength, clear = _a.clear, width = _a.width, initMuiInputProps = _a.InputProps, initMuiInputLabelProps = _a.InputLabelProps, initInputProps = _a.inputProps, initInputRef = _a.inputRef, select = _a.select, SelectProps = _a.SelectProps, multiline = _a.multiline, validPattern = _a.validPattern, invalidPattern = _a.invalidPattern, startAdornment = _a.startAdornment, endAdornment = _a.endAdornment, noFormValueItem = _a.noFormValueItem, hidden = _a.hidden,
|
|
2056
2046
|
//----------------------------------------------------------------------------------------------------------------
|
|
2057
2047
|
onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate, onBlur = _a.onBlur, onKeyDown = _a.onKeyDown,
|
|
2058
2048
|
//----------------------------------------------------------------------------------------------------------------
|
|
2059
2049
|
className = _a.className, initStyle = _a.style,
|
|
2060
2050
|
//----------------------------------------------------------------------------------------------------------------
|
|
2061
|
-
props = __rest$2(_a, ["variant", "size", "color", "focused", "labelShrink", "fullWidth", "name", "required", "value", "icon", "labelIcon", "label", "error", "helperText", "exceptValue", "readOnly", "disabled", "placeholder", "maxLength", "clear", "width", "InputProps", "InputLabelProps", "inputProps", "inputRef", "select", "SelectProps", "multiline", "validPattern", "invalidPattern", "startAdornment", "endAdornment", "noFormValueItem", "onChange", "onValue", "onValidate", "onBlur", "onKeyDown", "className", "style"]);
|
|
2051
|
+
props = __rest$2(_a, ["variant", "size", "color", "focused", "labelShrink", "fullWidth", "name", "required", "value", "icon", "labelIcon", "label", "error", "helperText", "exceptValue", "readOnly", "disabled", "placeholder", "maxLength", "clear", "width", "InputProps", "InputLabelProps", "inputProps", "inputRef", "select", "SelectProps", "multiline", "validPattern", "invalidPattern", "startAdornment", "endAdornment", "noFormValueItem", "hidden", "onChange", "onValue", "onValidate", "onBlur", "onKeyDown", "className", "style"]);
|
|
2062
2052
|
var id = React.useId();
|
|
2063
2053
|
// Ref -------------------------------------------------------------------------------------------------------------
|
|
2064
2054
|
var inputRef = React.useRef(null);
|
|
@@ -2072,10 +2062,10 @@ styleInject(css_248z$j);var FormTextField = React__default["default"].forwardRef
|
|
|
2072
2062
|
var labelShrink = React.useMemo(function () { return (initLabelShrink == null ? formLabelShrink : initLabelShrink); }, [initLabelShrink, formLabelShrink]);
|
|
2073
2063
|
var fullWidth = React.useMemo(function () { return (initFullWidth == null ? formFullWidth : initFullWidth); }, [initFullWidth, formFullWidth]);
|
|
2074
2064
|
// State -----------------------------------------------------------------------------------------------------------
|
|
2075
|
-
var _d =
|
|
2076
|
-
var _e =
|
|
2065
|
+
var _d = useAutoUpdateState$1(initError), error = _d[0], setError = _d[1];
|
|
2066
|
+
var _e = useAutoUpdateState$1(initHelperText), helperText = _e[0], setHelperText = _e[1];
|
|
2077
2067
|
var _f = React.useState(false), showClear = _f[0], setShowClear = _f[1];
|
|
2078
|
-
var _g =
|
|
2068
|
+
var _g = useAutoUpdateState$1(initDisabled), disabled = _g[0], setDisabled = _g[1];
|
|
2079
2069
|
// Memo - muiInputLabelProps ---------------------------------------------------------------------------------------
|
|
2080
2070
|
var muiInputLabelProps = React.useMemo(function () {
|
|
2081
2071
|
if (labelShrink || placeholder) {
|
|
@@ -2100,13 +2090,15 @@ styleInject(css_248z$j);var FormTextField = React__default["default"].forwardRef
|
|
|
2100
2090
|
}, [initInputProps, readOnly, maxLength]);
|
|
2101
2091
|
// Memo - style ----------------------------------------------------------------------------------------------------
|
|
2102
2092
|
var style = React.useMemo(function () {
|
|
2093
|
+
var newStyle = __assign$4({}, initStyle);
|
|
2103
2094
|
if (width != null) {
|
|
2104
|
-
|
|
2095
|
+
newStyle.width = width;
|
|
2105
2096
|
}
|
|
2106
|
-
|
|
2107
|
-
|
|
2097
|
+
if (hidden) {
|
|
2098
|
+
newStyle.display = 'none';
|
|
2108
2099
|
}
|
|
2109
|
-
|
|
2100
|
+
return newStyle;
|
|
2101
|
+
}, [initStyle, width, hidden]);
|
|
2110
2102
|
// Memo - label ----------------------------------------------------------------------------------------------------
|
|
2111
2103
|
var label = React.useMemo(function () {
|
|
2112
2104
|
return labelIcon ? (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
@@ -2118,7 +2110,7 @@ styleInject(css_248z$j);var FormTextField = React__default["default"].forwardRef
|
|
|
2118
2110
|
return onValue ? onValue(value) : value;
|
|
2119
2111
|
}, [onValue]);
|
|
2120
2112
|
// State - value ---------------------------------------------------------------------------------------------------
|
|
2121
|
-
var _h =
|
|
2113
|
+
var _h = useAutoUpdateState$1(initValue, getFinalValue), value = _h[0], setValue = _h[1];
|
|
2122
2114
|
React.useEffect(function () {
|
|
2123
2115
|
setShowClear(clear ? notEmpty(value) : false);
|
|
2124
2116
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -2361,7 +2353,7 @@ styleInject(css_248z$h);var FormTag = React__default["default"].forwardRef(funct
|
|
|
2361
2353
|
var className = _a.className, name = _a.name, initValue = _a.value, exceptValue = _a.exceptValue, required = _a.required, readOnly = _a.readOnly, maxLength = _a.maxLength, disabled = _a.disabled, initFullWidth = _a.fullWidth, initError = _a.error, initHelperText = _a.helperText, formValueSeparator = _a.formValueSeparator, formValueSort = _a.formValueSort, onValidate = _a.onValidate, onKeyDown = _a.onKeyDown, onChange = _a.onChange, onValue = _a.onValue, onBlur = _a.onBlur, props = __rest$2(_a, ["className", "name", "value", "exceptValue", "required", "readOnly", "maxLength", "disabled", "fullWidth", "error", "helperText", "formValueSeparator", "formValueSort", "onValidate", "onKeyDown", "onChange", "onValue", "onBlur"]);
|
|
2362
2354
|
var _b = useFormState(), formFullWidth = _b.fullWidth, onAddValueItem = _b.onAddValueItem, onValueChange = _b.onValueChange, onValueChangeByUser = _b.onValueChangeByUser, onRequestSearchSubmit = _b.onRequestSearchSubmit, otherFormState = __rest$2(_b, ["fullWidth", "onAddValueItem", "onValueChange", "onValueChangeByUser", "onRequestSearchSubmit"]);
|
|
2363
2355
|
// State - FormState -----------------------------------------------------------------------------------------------
|
|
2364
|
-
var fullWidth =
|
|
2356
|
+
var fullWidth = useAutoUpdateState$1(initFullWidth == null ? formFullWidth : initFullWidth)[0];
|
|
2365
2357
|
// Function - getFinalValue ----------------------------------------------------------------------------------------
|
|
2366
2358
|
var getFinalValue = React.useCallback(function (value) {
|
|
2367
2359
|
var finalValue;
|
|
@@ -2379,7 +2371,7 @@ styleInject(css_248z$h);var FormTag = React__default["default"].forwardRef(funct
|
|
|
2379
2371
|
var _c = React.useState(function () {
|
|
2380
2372
|
return new Set(getFinalValue(initValue));
|
|
2381
2373
|
}), valueSet = _c[0], setValueSet = _c[1];
|
|
2382
|
-
var _d =
|
|
2374
|
+
var _d = useAutoUpdateState$1(initValue, getFinalValue), value = _d[0], setValue = _d[1];
|
|
2383
2375
|
useFirstSkipEffect$1(function () {
|
|
2384
2376
|
if (error)
|
|
2385
2377
|
validate(value);
|
|
@@ -2389,8 +2381,8 @@ styleInject(css_248z$h);var FormTag = React__default["default"].forwardRef(funct
|
|
|
2389
2381
|
}, [value]);
|
|
2390
2382
|
//------------------------------------------------------------------------------------------------------------------
|
|
2391
2383
|
var _e = React.useState(''), inputValue = _e[0], setInputValue = _e[1];
|
|
2392
|
-
var _f =
|
|
2393
|
-
var _g =
|
|
2384
|
+
var _f = useAutoUpdateState$1(initError), error = _f[0], setError = _f[1];
|
|
2385
|
+
var _g = useAutoUpdateState$1(initHelperText), helperText = _g[0], setHelperText = _g[1];
|
|
2394
2386
|
// Effect ----------------------------------------------------------------------------------------------------------
|
|
2395
2387
|
React.useEffect(function () {
|
|
2396
2388
|
if (!isSame$2(value, initValue)) {
|
|
@@ -4132,7 +4124,7 @@ styleInject(css_248z$d);var FormSelect = React__default["default"].forwardRef(fu
|
|
|
4132
4124
|
}
|
|
4133
4125
|
}, [initStartAdornment, isOnGetItemLoading, loading]);
|
|
4134
4126
|
// State - items ---------------------------------------------------------------------------------------------------
|
|
4135
|
-
var _g =
|
|
4127
|
+
var _g = useAutoUpdateState$1(initItems), items = _g[0], setItems = _g[1];
|
|
4136
4128
|
React.useEffect(function () {
|
|
4137
4129
|
if (items) {
|
|
4138
4130
|
setItemValueLabels(items.reduce(function (res, item) {
|
|
@@ -4163,7 +4155,7 @@ styleInject(css_248z$d);var FormSelect = React__default["default"].forwardRef(fu
|
|
|
4163
4155
|
}
|
|
4164
4156
|
}, [items]);
|
|
4165
4157
|
// State - inputLabelProps -----------------------------------------------------------------------------------------
|
|
4166
|
-
var inputLabelProps =
|
|
4158
|
+
var inputLabelProps = useAutoUpdateState$1(React.useCallback(function () {
|
|
4167
4159
|
if (hasEmptyValue || (!hasEmptyValue && placeholder)) {
|
|
4168
4160
|
return __assign$4(__assign$4({}, initInputLabelProps), { shrink: true });
|
|
4169
4161
|
}
|
|
@@ -4220,14 +4212,14 @@ styleInject(css_248z$d);var FormSelect = React__default["default"].forwardRef(fu
|
|
|
4220
4212
|
return onValue ? onValue(finalValue) : finalValue;
|
|
4221
4213
|
}, [multiple, formValueSeparator, itemsValues, onValue]);
|
|
4222
4214
|
// State - value ---------------------------------------------------------------------------------------------------
|
|
4223
|
-
var _h =
|
|
4215
|
+
var _h = useAutoUpdateState$1(initValue, getFinalValue), value = _h[0], setValue = _h[1];
|
|
4224
4216
|
useFirstSkipEffect$1(function () {
|
|
4225
4217
|
if (onChange)
|
|
4226
4218
|
onChange(value);
|
|
4227
4219
|
onValueChange(name, value);
|
|
4228
4220
|
}, [value]);
|
|
4229
4221
|
// State - isSelectedPlaceholder -----------------------------------------------------------------------------------
|
|
4230
|
-
var isSelectedPlaceholder =
|
|
4222
|
+
var isSelectedPlaceholder = useAutoUpdateState$1(React.useCallback(function () {
|
|
4231
4223
|
return notEmpty(items) && empty$1(value) && !!placeholder && !hasEmptyValue;
|
|
4232
4224
|
}, [items, value, placeholder, hasEmptyValue]))[0];
|
|
4233
4225
|
// Effect ----------------------------------------------------------------------------------------------------------
|
|
@@ -4361,7 +4353,7 @@ styleInject(css_248z$c);var FormItemBase = React__default["default"].forwardRef(
|
|
|
4361
4353
|
// FormState -------------------------------------------------------------------------------------------------------
|
|
4362
4354
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFullWidth = _a.fullWidth,
|
|
4363
4355
|
//----------------------------------------------------------------------------------------------------------------
|
|
4364
|
-
control = _a.control, controlHeight = _a.controlHeight, controlVerticalCenter = _a.controlVerticalCenter, required = _a.required, labelIcon = _a.labelIcon, label = _a.label, focused = _a.focused, helperText = _a.helperText, helperTextProps = _a.helperTextProps, error = _a.error, hideLabel = _a.hideLabel,
|
|
4356
|
+
control = _a.control, controlHeight = _a.controlHeight, controlVerticalCenter = _a.controlVerticalCenter, required = _a.required, labelIcon = _a.labelIcon, label = _a.label, focused = _a.focused, helperText = _a.helperText, helperTextProps = _a.helperTextProps, error = _a.error, hideLabel = _a.hideLabel, hidden = _a.hidden,
|
|
4365
4357
|
//----------------------------------------------------------------------------------------------------------------
|
|
4366
4358
|
className = _a.className, style = _a.style, sx = _a.sx;
|
|
4367
4359
|
var _b = useFormState(), formVariant = _b.variant, formSize = _b.size, formColor = _b.color, formFullWidth = _b.fullWidth, formColWithLabel = _b.formColWithLabel, formColWithHelperText = _b.formColWithHelperText;
|
|
@@ -4373,14 +4365,14 @@ styleInject(css_248z$c);var FormItemBase = React__default["default"].forwardRef(
|
|
|
4373
4365
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
4374
4366
|
var wrapStyle = React.useMemo(function () {
|
|
4375
4367
|
var wrapStyle = {
|
|
4376
|
-
display: fullWidth ? 'block' : 'inline-flex',
|
|
4368
|
+
display: hidden ? 'none' : fullWidth ? 'block' : 'inline-flex',
|
|
4377
4369
|
width: fullWidth ? '100%' : undefined,
|
|
4378
4370
|
};
|
|
4379
4371
|
if (formColWithLabel) {
|
|
4380
4372
|
wrapStyle.marginTop = -20;
|
|
4381
4373
|
}
|
|
4382
4374
|
return wrapStyle;
|
|
4383
|
-
}, [formColWithLabel, fullWidth]);
|
|
4375
|
+
}, [formColWithLabel, fullWidth, hidden]);
|
|
4384
4376
|
// State - inputHeight ---------------------------------------------------------------------------------------------
|
|
4385
4377
|
var _c = React.useState(0), inputHeight = _c[0], setInputHeight = _c[1];
|
|
4386
4378
|
var inputResizeDetectorRef = useResizeDetector({
|
|
@@ -4466,9 +4458,9 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default["def
|
|
|
4466
4458
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
4467
4459
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initFullWidth = _a.fullWidth,
|
|
4468
4460
|
//----------------------------------------------------------------------------------------------------------------
|
|
4469
|
-
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, initChecked = _a.checked, initInputRef = _a.inputRef, initAction = _a.action, readOnly = _a.readOnly, initDisabled = _a.disabled, text = _a.text, initError = _a.error, initHelperText = _a.helperText, initValue = _a.value, initUncheckedValue = _a.uncheckedValue, exceptValue = _a.exceptValue, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
4461
|
+
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, initChecked = _a.checked, initInputRef = _a.inputRef, initAction = _a.action, readOnly = _a.readOnly, initDisabled = _a.disabled, text = _a.text, initError = _a.error, initHelperText = _a.helperText, initValue = _a.value, initUncheckedValue = _a.uncheckedValue, exceptValue = _a.exceptValue, hidden = _a.hidden, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
4470
4462
|
//----------------------------------------------------------------------------------------------------------------
|
|
4471
|
-
className = _a.className, initStyle = _a.style, sx = _a.sx, props = __rest$2(_a, ["variant", "size", "color", "focused", "fullWidth", "name", "labelIcon", "label", "checked", "inputRef", "action", "readOnly", "disabled", "text", "error", "helperText", "value", "uncheckedValue", "exceptValue", "onChange", "onValidate", "className", "style", "sx"]);
|
|
4463
|
+
className = _a.className, initStyle = _a.style, sx = _a.sx, props = __rest$2(_a, ["variant", "size", "color", "focused", "fullWidth", "name", "labelIcon", "label", "checked", "inputRef", "action", "readOnly", "disabled", "text", "error", "helperText", "value", "uncheckedValue", "exceptValue", "hidden", "onChange", "onValidate", "className", "style", "sx"]);
|
|
4472
4464
|
var id = React.useId();
|
|
4473
4465
|
// FormState -------------------------------------------------------------------------------------------------------
|
|
4474
4466
|
var _b = useFormState(), formVariant = _b.variant, formSize = _b.size, formColor = _b.color, formFocused = _b.focused, formFullWidth = _b.fullWidth, onAddValueItem = _b.onAddValueItem, onRemoveValueItem = _b.onRemoveValueItem, onValueChange = _b.onValueChange, onValueChangeByUser = _b.onValueChangeByUser, onRequestSearchSubmit = _b.onRequestSearchSubmit;
|
|
@@ -4484,13 +4476,13 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default["def
|
|
|
4484
4476
|
// ResizeDetector --------------------------------------------------------------------------------------------------
|
|
4485
4477
|
var _c = useResizeDetector(), width = _c.width, height = _c.height, resizeDetectorRef = _c.ref;
|
|
4486
4478
|
// State -----------------------------------------------------------------------------------------------------------
|
|
4487
|
-
var _d =
|
|
4488
|
-
var _e =
|
|
4489
|
-
var _f =
|
|
4490
|
-
var _g =
|
|
4491
|
-
var _h =
|
|
4479
|
+
var _d = useAutoUpdateState$1(initValue), value = _d[0], setValue = _d[1];
|
|
4480
|
+
var _e = useAutoUpdateState$1(initUncheckedValue), uncheckedValue = _e[0], setUncheckedValue = _e[1];
|
|
4481
|
+
var _f = useAutoUpdateState$1(initError), error = _f[0], setError = _f[1];
|
|
4482
|
+
var _g = useAutoUpdateState$1(initHelperText), helperText = _g[0], setHelperText = _g[1];
|
|
4483
|
+
var _h = useAutoUpdateState$1(initDisabled), disabled = _h[0], setDisabled = _h[1];
|
|
4492
4484
|
// State - checked -------------------------------------------------------------------------------------------------
|
|
4493
|
-
var _j =
|
|
4485
|
+
var _j = useAutoUpdateState$1(initChecked), checked = _j[0], setChecked = _j[1];
|
|
4494
4486
|
useFirstSkipEffect$1(function () {
|
|
4495
4487
|
if (error)
|
|
4496
4488
|
validate(checked);
|
|
@@ -4630,7 +4622,7 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default["def
|
|
|
4630
4622
|
}
|
|
4631
4623
|
}, [readOnly, setChecked, onValueChangeByUser, name, onRequestSearchSubmit]);
|
|
4632
4624
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
4633
|
-
return (React__default["default"].createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames$1(className, 'FormValueItem', 'FormCheckbox'), labelIcon: labelIcon, label: label, error: error, fullWidth: fullWidth, helperText: helperText, helperTextProps: { style: { marginLeft: 2 } }, style: style, sx: sx, controlHeight: height || (size === 'small' ? 35 : 39), controlVerticalCenter: true, control: React__default["default"].createElement(material.FormControlLabel, { ref: resizeDetectorRef, control: React__default["default"].createElement(material.Checkbox, __assign$4({ name: name, color: color, size: size, inputRef: initInputRef ? initInputRef : inputRef, action: initAction ? initAction : actionRef, checked: !!checked, checkedIcon: React__default["default"].createElement(iconsMaterial.CheckBox, { color: error ? 'error' : undefined }), icon: React__default["default"].createElement(iconsMaterial.CheckBoxOutlineBlank, { color: error ? 'error' : undefined }), onChange: handleChange, disabled: disabled || readOnly }, props)), label: React__default["default"].createElement(material.Typography, { color: error ? 'error' : undefined, whiteSpace: 'nowrap' }, text) }) }));
|
|
4625
|
+
return (React__default["default"].createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames$1(className, 'FormValueItem', 'FormCheckbox'), labelIcon: labelIcon, label: label, error: error, fullWidth: fullWidth, helperText: helperText, helperTextProps: { style: { marginLeft: 2 } }, style: style, sx: sx, hidden: hidden, controlHeight: height || (size === 'small' ? 35 : 39), controlVerticalCenter: true, control: React__default["default"].createElement(material.FormControlLabel, { ref: resizeDetectorRef, control: React__default["default"].createElement(material.Checkbox, __assign$4({ name: name, color: color, size: size, inputRef: initInputRef ? initInputRef : inputRef, action: initAction ? initAction : actionRef, checked: !!checked, checkedIcon: React__default["default"].createElement(iconsMaterial.CheckBox, { color: error ? 'error' : undefined }), icon: React__default["default"].createElement(iconsMaterial.CheckBoxOutlineBlank, { color: error ? 'error' : undefined }), onChange: handleChange, disabled: disabled || readOnly }, props)), label: React__default["default"].createElement(material.Typography, { color: error ? 'error' : undefined, whiteSpace: 'nowrap' }, text) }) }));
|
|
4634
4626
|
});
|
|
4635
4627
|
FormCheckbox.displayName = 'FormCheckbox';
|
|
4636
4628
|
FormCheckbox.defaultProps = FormCheckboxDefaultProps;var FormRadioGroupDefaultProps = {
|
|
@@ -4638,13 +4630,13 @@ FormCheckbox.defaultProps = FormCheckboxDefaultProps;var FormRadioGroupDefaultPr
|
|
|
4638
4630
|
};var PADDING_LEFT = 3;
|
|
4639
4631
|
var FormRadioGroup = React__default["default"].forwardRef(function (_a, ref) {
|
|
4640
4632
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
4641
|
-
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initFullWidth = _a.fullWidth,
|
|
4633
|
+
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initFullWidth = _a.fullWidth, hidden = _a.hidden,
|
|
4642
4634
|
//----------------------------------------------------------------------------------------------------------------
|
|
4643
4635
|
name = _a.name, initWidth = _a.width, labelIcon = _a.labelIcon, label = _a.label, inline = _a.inline, initLoading = _a.loading, nowrap = _a.nowrap, initItems = _a.items, initValue = _a.value, initError = _a.error, initHelperText = _a.helperText, initDisabled = _a.disabled, readOnly = _a.readOnly, required = _a.required, exceptValue = _a.exceptValue, onLoadItems = _a.onLoadItems, onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate,
|
|
4644
4636
|
//----------------------------------------------------------------------------------------------------------------
|
|
4645
4637
|
className = _a.className, initStyle = _a.style, sx = _a.sx,
|
|
4646
4638
|
//----------------------------------------------------------------------------------------------------------------
|
|
4647
|
-
props = __rest$2(_a, ["variant", "size", "color", "focused", "fullWidth", "name", "width", "labelIcon", "label", "inline", "loading", "nowrap", "items", "value", "error", "helperText", "disabled", "readOnly", "required", "exceptValue", "onLoadItems", "onChange", "onValue", "onValidate", "className", "style", "sx"]);
|
|
4639
|
+
props = __rest$2(_a, ["variant", "size", "color", "focused", "fullWidth", "hidden", "name", "width", "labelIcon", "label", "inline", "loading", "nowrap", "items", "value", "error", "helperText", "disabled", "readOnly", "required", "exceptValue", "onLoadItems", "onChange", "onValue", "onValidate", "className", "style", "sx"]);
|
|
4648
4640
|
var id = React.useId();
|
|
4649
4641
|
// FormState -------------------------------------------------------------------------------------------------------
|
|
4650
4642
|
var _b = useFormState(), formVariant = _b.variant, formSize = _b.size, formColor = _b.color, formFocused = _b.focused, formFullWidth = _b.fullWidth, onAddValueItem = _b.onAddValueItem, onRemoveValueItem = _b.onRemoveValueItem, onValueChange = _b.onValueChange, onValueChangeByUser = _b.onValueChangeByUser, onRequestSearchSubmit = _b.onRequestSearchSubmit;
|
|
@@ -4654,20 +4646,20 @@ var FormRadioGroup = React__default["default"].forwardRef(function (_a, ref) {
|
|
|
4654
4646
|
var color = React.useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
|
|
4655
4647
|
var focused = React.useMemo(function () { return (initFocused == null ? formFocused : initFocused); }, [initFocused, formFocused]);
|
|
4656
4648
|
// State - FormState -----------------------------------------------------------------------------------------------
|
|
4657
|
-
var _c =
|
|
4649
|
+
var _c = useAutoUpdateState$1(initFullWidth == null ? formFullWidth : initFullWidth), fullWidth = _c[0], setFullWidth = _c[1];
|
|
4658
4650
|
// Theme -----------------------------------------------------------------------------------------------------------
|
|
4659
4651
|
var theme = material.useTheme();
|
|
4660
4652
|
// Ref -------------------------------------------------------------------------------------------------------------
|
|
4661
4653
|
var baseRef = React.useRef(null);
|
|
4662
4654
|
var firstInputRef = React.useRef(null);
|
|
4663
4655
|
// State -----------------------------------------------------------------------------------------------------------
|
|
4664
|
-
var _d =
|
|
4665
|
-
var _e =
|
|
4666
|
-
var _f =
|
|
4667
|
-
var _g =
|
|
4656
|
+
var _d = useAutoUpdateState$1(initItems), items = _d[0], setItems = _d[1];
|
|
4657
|
+
var _e = useAutoUpdateState$1(initError), error = _e[0], setError = _e[1];
|
|
4658
|
+
var _f = useAutoUpdateState$1(initHelperText), helperText = _f[0], setHelperText = _f[1];
|
|
4659
|
+
var _g = useAutoUpdateState$1(initDisabled), disabled = _g[0], setDisabled = _g[1];
|
|
4668
4660
|
var _h = React.useState(false), isOnGetItemLoading = _h[0], setIsOnGetItemLoading = _h[1];
|
|
4669
|
-
var _j =
|
|
4670
|
-
var _k =
|
|
4661
|
+
var _j = useAutoUpdateState$1(initLoading), loading = _j[0], setLoading = _j[1];
|
|
4662
|
+
var _k = useAutoUpdateState$1(initWidth || '100%'), width = _k[0], setWidth = _k[1];
|
|
4671
4663
|
var _l = React.useState(), formColWrapRect = _l[0], setFormColWrapRect = _l[1];
|
|
4672
4664
|
// State - radioGroupNoWrapRect (ResizeDetector) -------------------------------------------------------------------
|
|
4673
4665
|
var _m = React.useState(), radioGroupNoWrapRect = _m[0], setRadioGroupNoWrapRect = _m[1];
|
|
@@ -4686,7 +4678,7 @@ var FormRadioGroup = React__default["default"].forwardRef(function (_a, ref) {
|
|
|
4686
4678
|
return onValue ? onValue(value) : value;
|
|
4687
4679
|
}, [onValue]);
|
|
4688
4680
|
// State - value ---------------------------------------------------------------------------------------------------
|
|
4689
|
-
var _p =
|
|
4681
|
+
var _p = useAutoUpdateState$1(initValue, getFinalValue), value = _p[0], setValue = _p[1];
|
|
4690
4682
|
useFirstSkipEffect$1(function () {
|
|
4691
4683
|
if (error)
|
|
4692
4684
|
validate(value);
|
|
@@ -4909,7 +4901,7 @@ var FormRadioGroup = React__default["default"].forwardRef(function (_a, ref) {
|
|
|
4909
4901
|
}
|
|
4910
4902
|
}, [readOnly, items, getFinalValue, value, setValue, onValueChangeByUser, name, onRequestSearchSubmit]);
|
|
4911
4903
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
4912
|
-
return (React__default["default"].createElement(FormItemBase, { focused: focused, ref: baseRef, className: classNames$1(className, 'FormValueItem', 'FormRadioGroup'), variant: variant, size: size, color: color, labelIcon: labelIcon, label: label, fullWidth: fullWidth, required: required, error: error, helperText: helperText, helperTextProps: { style: { marginLeft: 2 } }, style: style, sx: sx, controlHeight: height || (size === 'small' ? 35 : 39), controlVerticalCenter: true, control: React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
4904
|
+
return (React__default["default"].createElement(FormItemBase, { focused: focused, ref: baseRef, className: classNames$1(className, 'FormValueItem', 'FormRadioGroup'), variant: variant, size: size, color: color, labelIcon: labelIcon, label: label, fullWidth: fullWidth, required: required, error: error, helperText: helperText, helperTextProps: { style: { marginLeft: 2 } }, style: style, sx: sx, hidden: hidden, controlHeight: height || (size === 'small' ? 35 : 39), controlVerticalCenter: true, control: React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
4913
4905
|
!fullWidth && !isOnGetItemLoading && !loading && items && (React__default["default"].createElement("div", { ref: resizeWidthDetectorRef, style: {
|
|
4914
4906
|
display: 'grid',
|
|
4915
4907
|
position: 'absolute',
|
|
@@ -4945,7 +4937,7 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default["default"].fo
|
|
|
4945
4937
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
4946
4938
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initFullWidth = _a.fullWidth,
|
|
4947
4939
|
//----------------------------------------------------------------------------------------------------------------
|
|
4948
|
-
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, type = _a.type, initLoading = _a.loading, initItems = _a.items, initValue = _a.value, initError = _a.error, initHelperText = _a.helperText, initDisabled = _a.disabled, readOnly = _a.readOnly, required = _a.required, notAllowEmptyValue = _a.notAllowEmptyValue, exceptValue = _a.exceptValue, initWidth = _a.width, multiple = _a.multiple, formValueSeparator = _a.formValueSeparator, formValueSort = _a.formValueSort, onLoadItems = _a.onLoadItems,
|
|
4940
|
+
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, type = _a.type, initLoading = _a.loading, initItems = _a.items, initValue = _a.value, initError = _a.error, initHelperText = _a.helperText, initDisabled = _a.disabled, readOnly = _a.readOnly, required = _a.required, notAllowEmptyValue = _a.notAllowEmptyValue, exceptValue = _a.exceptValue, initWidth = _a.width, multiple = _a.multiple, formValueSeparator = _a.formValueSeparator, formValueSort = _a.formValueSort, hidden = _a.hidden, onLoadItems = _a.onLoadItems,
|
|
4949
4941
|
//----------------------------------------------------------------------------------------------------------------
|
|
4950
4942
|
onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate,
|
|
4951
4943
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -4960,7 +4952,7 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default["default"].fo
|
|
|
4960
4952
|
var color = React.useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
|
|
4961
4953
|
var fullWidth = React.useMemo(function () { return (initFullWidth == null ? formFullWidth : initFullWidth); }, [initFullWidth, formFullWidth]);
|
|
4962
4954
|
// State - FormState -----------------------------------------------------------------------------------------------
|
|
4963
|
-
var _c =
|
|
4955
|
+
var _c = useAutoUpdateState$1(initFocused == null ? formFocused : initFocused), focused = _c[0], setFocused = _c[1];
|
|
4964
4956
|
// Theme -----------------------------------------------------------------------------------------------------------
|
|
4965
4957
|
var theme = material.useTheme();
|
|
4966
4958
|
// State - width (ResizeDetector) ----------------------------------------------------------------------------------
|
|
@@ -4981,11 +4973,11 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default["default"].fo
|
|
|
4981
4973
|
}).ref;
|
|
4982
4974
|
// State -----------------------------------------------------------------------------------------------------------
|
|
4983
4975
|
var _f = React.useState(false), isOnGetItemLoading = _f[0], setIsOnGetItemLoading = _f[1];
|
|
4984
|
-
var _g =
|
|
4985
|
-
var _h =
|
|
4986
|
-
var _j =
|
|
4987
|
-
var _k =
|
|
4988
|
-
var _l =
|
|
4976
|
+
var _g = useAutoUpdateState$1(initItems), items = _g[0], setItems = _g[1];
|
|
4977
|
+
var _h = useAutoUpdateState$1(initError), error = _h[0], setError = _h[1];
|
|
4978
|
+
var _j = useAutoUpdateState$1(initHelperText), helperText = _j[0], setHelperText = _j[1];
|
|
4979
|
+
var _k = useAutoUpdateState$1(initLoading), loading = _k[0], setLoading = _k[1];
|
|
4980
|
+
var _l = useAutoUpdateState$1(initDisabled), disabled = _l[0], setDisabled = _l[1];
|
|
4989
4981
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
4990
4982
|
var itemsValues = React.useMemo(function () {
|
|
4991
4983
|
if (items) {
|
|
@@ -5071,7 +5063,7 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default["default"].fo
|
|
|
5071
5063
|
return onValue ? onValue(finalValue) : finalValue;
|
|
5072
5064
|
}, [multiple, formValueSeparator, itemsValues, onValue]);
|
|
5073
5065
|
// State - value ---------------------------------------------------------------------------------------------------
|
|
5074
|
-
var _m =
|
|
5066
|
+
var _m = useAutoUpdateState$1(initValue, getFinalValue), value = _m[0], setValue = _m[1];
|
|
5075
5067
|
// Effect ----------------------------------------------------------------------------------------------------------
|
|
5076
5068
|
React.useEffect(function () {
|
|
5077
5069
|
if (value !== initValue) {
|
|
@@ -5282,7 +5274,7 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default["default"].fo
|
|
|
5282
5274
|
if (focused) {
|
|
5283
5275
|
formControlBaseProps.focused = true;
|
|
5284
5276
|
}
|
|
5285
|
-
return (React__default["default"].createElement(FormItemBase, __assign$4({}, formControlBaseProps, { className: classNames$1(className, 'FormValueItem', 'FormToggleButtonGroup', "variant-".concat(variant), "size-".concat(size), !!label && 'with-label', !!fullWidth && 'full-width', "type-".concat(type)), variant: variant, size: size, color: color, labelIcon: labelIcon, label: label, required: required, fullWidth: fullWidth, error: error, helperText: helperText, helperTextProps: { style: { marginLeft: 2 } }, style: style, sx: sx, controlHeight: height || 0, controlVerticalCenter: isOnGetItemLoading || loading, control: isOnGetItemLoading || loading ? (React__default["default"].createElement("div", { style: { opacity: 0.54 }, ref: resizeHeightDetectorRef },
|
|
5277
|
+
return (React__default["default"].createElement(FormItemBase, __assign$4({}, formControlBaseProps, { className: classNames$1(className, 'FormValueItem', 'FormToggleButtonGroup', "variant-".concat(variant), "size-".concat(size), !!label && 'with-label', !!fullWidth && 'full-width', "type-".concat(type)), variant: variant, size: size, color: color, labelIcon: labelIcon, label: label, required: required, fullWidth: fullWidth, error: error, helperText: helperText, helperTextProps: { style: { marginLeft: 2 } }, style: style, sx: sx, hidden: hidden, controlHeight: height || 0, controlVerticalCenter: isOnGetItemLoading || loading, control: isOnGetItemLoading || loading ? (React__default["default"].createElement("div", { style: { opacity: 0.54 }, ref: resizeHeightDetectorRef },
|
|
5286
5278
|
React__default["default"].createElement(material.CircularProgress, { size: 16, color: 'inherit' }))) : (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
5287
5279
|
!fullWidth && !isOnGetItemLoading && !loading && items && (React__default["default"].createElement("div", { ref: resizeWidthDetectorRef, style: {
|
|
5288
5280
|
display: 'grid',
|
|
@@ -5324,7 +5316,7 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5324
5316
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
5325
5317
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused,
|
|
5326
5318
|
//----------------------------------------------------------------------------------------------------------------
|
|
5327
|
-
precision = _a.precision, highlightSelectedOnly = _a.highlightSelectedOnly, icon = _a.icon, emptyIcon = _a.emptyIcon, max = _a.max,
|
|
5319
|
+
precision = _a.precision, highlightSelectedOnly = _a.highlightSelectedOnly, icon = _a.icon, emptyIcon = _a.emptyIcon, max = _a.max, hidden = _a.hidden,
|
|
5328
5320
|
//----------------------------------------------------------------------------------------------------------------
|
|
5329
5321
|
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, readOnly = _a.readOnly, required = _a.required, initDisabled = _a.disabled, initError = _a.error, initHelperText = _a.helperText, initValue = _a.value, exceptValue = _a.exceptValue, onChange = _a.onChange, onValidate = _a.onValidate, onValue = _a.onValue,
|
|
5330
5322
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -5337,13 +5329,13 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5337
5329
|
var size = React.useMemo(function () { return (initSize == null ? formSize : initSize); }, [initSize, formSize]);
|
|
5338
5330
|
var color = React.useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
|
|
5339
5331
|
// State - FormState -----------------------------------------------------------------------------------------------
|
|
5340
|
-
var _c =
|
|
5332
|
+
var _c = useAutoUpdateState$1(initFocused == null ? formFocused : initFocused), focused = _c[0], setFocused = _c[1];
|
|
5341
5333
|
// Ref -------------------------------------------------------------------------------------------------------------
|
|
5342
5334
|
var inputRef = React.useRef();
|
|
5343
5335
|
// State -----------------------------------------------------------------------------------------------------------
|
|
5344
|
-
var _d =
|
|
5345
|
-
var _e =
|
|
5346
|
-
var _f =
|
|
5336
|
+
var _d = useAutoUpdateState$1(initError), error = _d[0], setError = _d[1];
|
|
5337
|
+
var _e = useAutoUpdateState$1(initHelperText), helperText = _e[0], setHelperText = _e[1];
|
|
5338
|
+
var _f = useAutoUpdateState$1(initDisabled), disabled = _f[0], setDisabled = _f[1];
|
|
5347
5339
|
// State - width, height -------------------------------------------------------------------------------------------
|
|
5348
5340
|
var _g = useResizeDetector(), width = _g.width, height = _g.height, resizeDetectorRef = _g.ref;
|
|
5349
5341
|
// Function - getFinalValue ----------------------------------------------------------------------------------------
|
|
@@ -5351,7 +5343,7 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5351
5343
|
return onValue ? onValue(value) : value;
|
|
5352
5344
|
}, [onValue]);
|
|
5353
5345
|
// State - value ---------------------------------------------------------------------------------------------------
|
|
5354
|
-
var _h =
|
|
5346
|
+
var _h = useAutoUpdateState$1(initValue || 0, getFinalValue), value = _h[0], setValue = _h[1];
|
|
5355
5347
|
useFirstSkipEffect$1(function () {
|
|
5356
5348
|
if (error)
|
|
5357
5349
|
validate(value);
|
|
@@ -5484,7 +5476,7 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5484
5476
|
}
|
|
5485
5477
|
}, [readOnly, getFinalValue, setValue, onValueChangeByUser, name, onRequestSearchSubmit]);
|
|
5486
5478
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
5487
|
-
return (React__default["default"].createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames$1(className, 'FormValueItem', 'FormRating'), labelIcon: labelIcon, label: label, error: error, fullWidth: false, required: required, helperText: helperText, helperTextProps: { style: { marginLeft: 5 } }, style: style, sx: sx, controlHeight: height || (size === 'small' ? 21 : 26), controlVerticalCenter: true, control: React__default["default"].createElement(material.Rating, { ref: resizeDetectorRef, size: size === 'medium' ? 'large' : 'medium', name: name, precision: precision, highlightSelectedOnly: highlightSelectedOnly, value: value, disabled: disabled || readOnly, max: max, icon: React__default["default"].createElement(FormIcon, { color: color, fontSize: 'inherit' }, icon ? icon : 'Star'), emptyIcon: React__default["default"].createElement(FormIcon, { fontSize: 'inherit' }, emptyIcon ? emptyIcon : 'StarBorder'), onChange: handleChange, onFocus: function () { return setFocused(initFocused || true); }, onBlur: function () { return setFocused(initFocused || false); } }) }));
|
|
5479
|
+
return (React__default["default"].createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames$1(className, 'FormValueItem', 'FormRating'), labelIcon: labelIcon, label: label, error: error, fullWidth: false, required: required, helperText: helperText, helperTextProps: { style: { marginLeft: 5 } }, style: style, sx: sx, hidden: hidden, controlHeight: height || (size === 'small' ? 21 : 26), controlVerticalCenter: true, control: React__default["default"].createElement(material.Rating, { ref: resizeDetectorRef, size: size === 'medium' ? 'large' : 'medium', name: name, precision: precision, highlightSelectedOnly: highlightSelectedOnly, value: value, disabled: disabled || readOnly, max: max, icon: React__default["default"].createElement(FormIcon, { color: color, fontSize: 'inherit' }, icon ? icon : 'Star'), emptyIcon: React__default["default"].createElement(FormIcon, { fontSize: 'inherit' }, emptyIcon ? emptyIcon : 'StarBorder'), onChange: handleChange, onFocus: function () { return setFocused(initFocused || true); }, onBlur: function () { return setFocused(initFocused || false); } }) }));
|
|
5488
5480
|
});
|
|
5489
5481
|
FormRating.displayName = 'FormRating';
|
|
5490
5482
|
FormRating.defaultProps = FormRatingDefaultProps;var propTypes = {exports: {}};var reactIs = {exports: {}};var reactIs_production_min = {};/** @license React v16.13.1
|
|
@@ -7217,7 +7209,7 @@ styleInject(css_248z$a);var FormTextEditor = React__default["default"].forwardRe
|
|
|
7217
7209
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
7218
7210
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused,
|
|
7219
7211
|
//----------------------------------------------------------------------------------------------------------------
|
|
7220
|
-
menubar = _a.menubar, height = _a.height, onImageUpload = _a.onImageUpload,
|
|
7212
|
+
menubar = _a.menubar, height = _a.height, hidden = _a.hidden, onImageUpload = _a.onImageUpload,
|
|
7221
7213
|
//----------------------------------------------------------------------------------------------------------------
|
|
7222
7214
|
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, readOnly = _a.readOnly, required = _a.required, initDisabled = _a.disabled, initError = _a.error, initHelperText = _a.helperText, initValue = _a.value, exceptValue = _a.exceptValue, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
7223
7215
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -7230,12 +7222,12 @@ styleInject(css_248z$a);var FormTextEditor = React__default["default"].forwardRe
|
|
|
7230
7222
|
var size = React.useMemo(function () { return (initSize == null ? formSize : initSize); }, [initSize, formSize]);
|
|
7231
7223
|
var color = React.useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
|
|
7232
7224
|
// State - FormState -----------------------------------------------------------------------------------------------
|
|
7233
|
-
var _c =
|
|
7225
|
+
var _c = useAutoUpdateState$1(initFocused == null ? formFocused : initFocused), focused = _c[0], setFocused = _c[1];
|
|
7234
7226
|
// Ref -------------------------------------------------------------------------------------------------------------
|
|
7235
7227
|
var editorRef = React.useRef(null);
|
|
7236
7228
|
var keyDownTime = React.useRef(0);
|
|
7237
7229
|
// State - value ---------------------------------------------------------------------------------------------------
|
|
7238
|
-
var _d =
|
|
7230
|
+
var _d = useAutoUpdateState$1(initValue), value = _d[0], setValue = _d[1];
|
|
7239
7231
|
useFirstSkipEffect$1(function () {
|
|
7240
7232
|
if (error)
|
|
7241
7233
|
validate(value);
|
|
@@ -7244,10 +7236,10 @@ styleInject(css_248z$a);var FormTextEditor = React__default["default"].forwardRe
|
|
|
7244
7236
|
onValueChange(name, value);
|
|
7245
7237
|
}, [value]);
|
|
7246
7238
|
// State -----------------------------------------------------------------------------------------------------------
|
|
7247
|
-
var _e =
|
|
7248
|
-
var _f =
|
|
7239
|
+
var _e = useAutoUpdateState$1(initError), error = _e[0], setError = _e[1];
|
|
7240
|
+
var _f = useAutoUpdateState$1(initHelperText), helperText = _f[0], setHelperText = _f[1];
|
|
7249
7241
|
var _g = React.useState(false), initialized = _g[0], setInitialized = _g[1];
|
|
7250
|
-
var _h =
|
|
7242
|
+
var _h = useAutoUpdateState$1(initDisabled), disabled = _h[0], setDisabled = _h[1];
|
|
7251
7243
|
// Function - focus ------------------------------------------------------------------------------------------------
|
|
7252
7244
|
var focus = React.useCallback(function () {
|
|
7253
7245
|
var _a, _b;
|
|
@@ -7371,7 +7363,7 @@ styleInject(css_248z$a);var FormTextEditor = React__default["default"].forwardRe
|
|
|
7371
7363
|
onImageUpload(blobInfo.blob(), success, failure, progress);
|
|
7372
7364
|
}, [onImageUpload]);
|
|
7373
7365
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
7374
|
-
return (React__default["default"].createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames$1(className, 'FormValueItem', 'FormTextEditor', !initialized && 'initializing'), labelIcon: labelIcon, label: label, error: error, required: required, fullWidth: true, helperText: helperText, helperTextProps: { style: { marginLeft: 5 } }, style: { width: '100%' }, controlHeight: height, control: React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
7366
|
+
return (React__default["default"].createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames$1(className, 'FormValueItem', 'FormTextEditor', !initialized && 'initializing'), labelIcon: labelIcon, label: label, error: error, required: required, fullWidth: true, helperText: helperText, helperTextProps: { style: { marginLeft: 5 } }, style: { width: '100%' }, hidden: hidden, controlHeight: height, control: React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
7375
7367
|
!initialized ? React__default["default"].createElement(material.Skeleton, { variant: 'rectangular', width: '100%', height: height }) : null,
|
|
7376
7368
|
React__default["default"].createElement(Editor, { ref: editorRef, value: value, disabled: readOnly || disabled, init: {
|
|
7377
7369
|
height: height,
|
|
@@ -7404,7 +7396,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
7404
7396
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
7405
7397
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
7406
7398
|
//----------------------------------------------------------------------------------------------------------------
|
|
7407
|
-
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, initLoading = _a.loading, initItems = _a.items, initValue = _a.value, initError = _a.error, initHelperText = _a.helperText, initDisabled = _a.disabled, readOnly = _a.readOnly, required = _a.required, exceptValue = _a.exceptValue, width = _a.width, placeholder = _a.placeholder, multiple = _a.multiple, formValueSeparator = _a.formValueSeparator, formValueSort = _a.formValueSort, disablePortal = _a.disablePortal, noOptionsText = _a.noOptionsText, loadingText = _a.loadingText, limitTags = _a.limitTags, openOnFocus = _a.openOnFocus, disableClearable = _a.disableClearable, async = _a.async, onLoadItems = _a.onLoadItems, onAsyncLoadValueItem = _a.onAsyncLoadValueItem, onRenderItem = _a.onRenderItem, onRenderTag = _a.onRenderTag, onAddItem = _a.onAddItem,
|
|
7399
|
+
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, initLoading = _a.loading, initItems = _a.items, initValue = _a.value, initError = _a.error, initHelperText = _a.helperText, initDisabled = _a.disabled, readOnly = _a.readOnly, required = _a.required, exceptValue = _a.exceptValue, width = _a.width, placeholder = _a.placeholder, multiple = _a.multiple, formValueSeparator = _a.formValueSeparator, formValueSort = _a.formValueSort, disablePortal = _a.disablePortal, noOptionsText = _a.noOptionsText, loadingText = _a.loadingText, limitTags = _a.limitTags, openOnFocus = _a.openOnFocus, disableClearable = _a.disableClearable, async = _a.async, hidden = _a.hidden, onLoadItems = _a.onLoadItems, onAsyncLoadValueItem = _a.onAsyncLoadValueItem, onRenderItem = _a.onRenderItem, onRenderTag = _a.onRenderTag, onAddItem = _a.onAddItem,
|
|
7408
7400
|
//----------------------------------------------------------------------------------------------------------------
|
|
7409
7401
|
onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate,
|
|
7410
7402
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -7425,11 +7417,11 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
7425
7417
|
var fullWidth = React.useMemo(function () { return (initFullWidth == null ? formFullWidth : initFullWidth); }, [initFullWidth, formFullWidth]);
|
|
7426
7418
|
// State -----------------------------------------------------------------------------------------------------------
|
|
7427
7419
|
var _c = React.useState(false), isOnGetItemLoading = _c[0], setIsOnGetItemLoading = _c[1];
|
|
7428
|
-
var _d =
|
|
7429
|
-
var _e =
|
|
7430
|
-
var _f =
|
|
7431
|
-
var _g =
|
|
7432
|
-
var _h =
|
|
7420
|
+
var _d = useAutoUpdateState$1(initItems), items = _d[0], setItems = _d[1];
|
|
7421
|
+
var _e = useAutoUpdateState$1(initError), error = _e[0], setError = _e[1];
|
|
7422
|
+
var _f = useAutoUpdateState$1(initHelperText), helperText = _f[0], setHelperText = _f[1];
|
|
7423
|
+
var _g = useAutoUpdateState$1(initLoading), loading = _g[0], setLoading = _g[1];
|
|
7424
|
+
var _h = useAutoUpdateState$1(initDisabled), disabled = _h[0], setDisabled = _h[1];
|
|
7433
7425
|
var _j = React.useState(undefined), inputValue = _j[0], setInputValue = _j[1];
|
|
7434
7426
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
7435
7427
|
var itemsValues = React.useMemo(function () {
|
|
@@ -7446,11 +7438,14 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
7446
7438
|
}, [items]);
|
|
7447
7439
|
var style = React.useMemo(function () {
|
|
7448
7440
|
var style = __assign$4({ minWidth: 120 }, initStyle);
|
|
7441
|
+
if (hidden) {
|
|
7442
|
+
style.display = 'none';
|
|
7443
|
+
}
|
|
7449
7444
|
if (width != null) {
|
|
7450
7445
|
style.width = width;
|
|
7451
7446
|
}
|
|
7452
7447
|
return style;
|
|
7453
|
-
}, [initStyle, width]);
|
|
7448
|
+
}, [initStyle, width, hidden]);
|
|
7454
7449
|
// Function - getFinalValue ----------------------------------------------------------------------------------------
|
|
7455
7450
|
var getFinalValue = React.useCallback(function (value) {
|
|
7456
7451
|
var finalValue = value;
|
|
@@ -7500,7 +7495,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
7500
7495
|
return onValue ? onValue(finalValue) : finalValue;
|
|
7501
7496
|
}, [multiple, formValueSeparator, itemsValues, onValue]);
|
|
7502
7497
|
// State - value ---------------------------------------------------------------------------------------------------
|
|
7503
|
-
var _k =
|
|
7498
|
+
var _k = useAutoUpdateState$1(initValue, getFinalValue), value = _k[0], setValue = _k[1];
|
|
7504
7499
|
var _l = React.useState(null), valueItem = _l[0], setValueItem = _l[1];
|
|
7505
7500
|
var componentValue = React.useMemo(function () {
|
|
7506
7501
|
var finalValue = value;
|
|
@@ -14643,9 +14638,9 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default["default"].forwar
|
|
|
14643
14638
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
14644
14639
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
14645
14640
|
//--------------------------------------------------------------------------------------------------------------------
|
|
14646
|
-
name = _a.name, type = _a.type, time = _a.time, initValue = _a.value, initLabel = _a.label, labelIcon = _a.labelIcon, initFormat = _a.format, initFormValueFormat = _a.formValueFormat, required = _a.required, readOnly = _a.readOnly, initDisabled = _a.disabled, width = _a.width, initError = _a.error, initHelperText = _a.helperText, minDate = _a.minDate, maxDate = _a.maxDate, disableFuture = _a.disableFuture, disablePast = _a.disablePast, exceptValue = _a.exceptValue, icon = _a.icon, startAdornment = _a.startAdornment, endAdornment = _a.endAdornment, align = _a.align, hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds, minuteInterval = _a.minuteInterval, secondInterval = _a.secondInterval, readOnlyInput = _a.readOnlyInput, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
14641
|
+
name = _a.name, type = _a.type, time = _a.time, initValue = _a.value, initLabel = _a.label, labelIcon = _a.labelIcon, initFormat = _a.format, initFormValueFormat = _a.formValueFormat, required = _a.required, readOnly = _a.readOnly, initDisabled = _a.disabled, width = _a.width, initError = _a.error, initHelperText = _a.helperText, minDate = _a.minDate, maxDate = _a.maxDate, disableFuture = _a.disableFuture, disablePast = _a.disablePast, exceptValue = _a.exceptValue, icon = _a.icon, startAdornment = _a.startAdornment, endAdornment = _a.endAdornment, align = _a.align, hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds, minuteInterval = _a.minuteInterval, secondInterval = _a.secondInterval, readOnlyInput = _a.readOnlyInput, hidden = _a.hidden, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
14647
14642
|
//--------------------------------------------------------------------------------------------------------------------
|
|
14648
|
-
className = _a.className, initStyle = _a.style, sx = _a.sx, otherProps = __rest$2(_a, ["variant", "size", "color", "focused", "labelShrink", "fullWidth", "name", "type", "time", "value", "label", "labelIcon", "format", "formValueFormat", "required", "readOnly", "disabled", "width", "error", "helperText", "minDate", "maxDate", "disableFuture", "disablePast", "exceptValue", "icon", "startAdornment", "endAdornment", "align", "hours", "minutes", "seconds", "minuteInterval", "secondInterval", "readOnlyInput", "onChange", "onValidate", "className", "style", "sx"]);
|
|
14643
|
+
className = _a.className, initStyle = _a.style, sx = _a.sx, otherProps = __rest$2(_a, ["variant", "size", "color", "focused", "labelShrink", "fullWidth", "name", "type", "time", "value", "label", "labelIcon", "format", "formValueFormat", "required", "readOnly", "disabled", "width", "error", "helperText", "minDate", "maxDate", "disableFuture", "disablePast", "exceptValue", "icon", "startAdornment", "endAdornment", "align", "hours", "minutes", "seconds", "minuteInterval", "secondInterval", "readOnlyInput", "hidden", "onChange", "onValidate", "className", "style", "sx"]);
|
|
14649
14644
|
var id = React.useId();
|
|
14650
14645
|
// Ref -------------------------------------------------------------------------------------------------------------
|
|
14651
14646
|
var privateStaticDatePickerRef = React.useRef(null);
|
|
@@ -14666,10 +14661,10 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default["default"].forwar
|
|
|
14666
14661
|
// State - open ----------------------------------------------------------------------------------------------------
|
|
14667
14662
|
var _c = React.useState(false), open = _c[0], setOpen = _c[1];
|
|
14668
14663
|
// State -----------------------------------------------------------------------------------------------------------
|
|
14669
|
-
var _d =
|
|
14664
|
+
var _d = useAutoUpdateState$1(initError), error = _d[0], setError = _d[1];
|
|
14670
14665
|
var _e = React.useState(null), timeError = _e[0], setTimeError = _e[1];
|
|
14671
|
-
var _f =
|
|
14672
|
-
var _g =
|
|
14666
|
+
var _f = useAutoUpdateState$1(initHelperText), helperText = _f[0], setHelperText = _f[1];
|
|
14667
|
+
var _g = useAutoUpdateState$1(initDisabled), disabled = _g[0], setDisabled = _g[1];
|
|
14673
14668
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
14674
14669
|
var label = React.useMemo(function () {
|
|
14675
14670
|
if (labelIcon) {
|
|
@@ -14697,7 +14692,7 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default["default"].forwar
|
|
|
14697
14692
|
}, [initFormValueFormat, time, type]);
|
|
14698
14693
|
var availableDate = React.useMemo(function () { return makeAvailableDate(minDate, maxDate, !!disablePast, !!disableFuture); }, [disableFuture, disablePast, maxDate, minDate]);
|
|
14699
14694
|
// State - style ---------------------------------------------------------------------------------------------------
|
|
14700
|
-
var style =
|
|
14695
|
+
var style = useAutoUpdateState$1(React.useCallback(function () {
|
|
14701
14696
|
if (width != null) {
|
|
14702
14697
|
return __assign$4(__assign$4({}, initStyle), { width: width });
|
|
14703
14698
|
}
|
|
@@ -14710,7 +14705,7 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default["default"].forwar
|
|
|
14710
14705
|
return value;
|
|
14711
14706
|
}, []);
|
|
14712
14707
|
// State - value ---------------------------------------------------------------------------------------------------
|
|
14713
|
-
var _h =
|
|
14708
|
+
var _h = useAutoUpdateState$1(initValue || null, getFinalValue), value = _h[0], setValue = _h[1];
|
|
14714
14709
|
var _j = React.useState(null), inputValue = _j[0], setInputValue = _j[1];
|
|
14715
14710
|
// Effect ----------------------------------------------------------------------------------------------------------
|
|
14716
14711
|
React.useEffect(function () {
|
|
@@ -14772,6 +14767,11 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default["default"].forwar
|
|
|
14772
14767
|
}
|
|
14773
14768
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14774
14769
|
}, [value]);
|
|
14770
|
+
// Memo --------------------------------------------------------------------------------------------------------------
|
|
14771
|
+
var wrapStyle = React.useMemo(function () { return ({
|
|
14772
|
+
display: hidden ? 'none' : fullWidth ? 'block' : 'inline-block',
|
|
14773
|
+
flex: fullWidth ? 1 : undefined,
|
|
14774
|
+
}); }, [hidden, fullWidth]);
|
|
14775
14775
|
// Function - focus ------------------------------------------------------------------------------------------------
|
|
14776
14776
|
var focus = React.useCallback(function () {
|
|
14777
14777
|
var _a;
|
|
@@ -14976,10 +14976,7 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default["default"].forwar
|
|
|
14976
14976
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
14977
14977
|
return (React__default["default"].createElement(xDatePickers.LocalizationProvider, { dateAdapter: AdapterDayjs.AdapterDayjs, adapterLocale: dayjsLocale__default["default"] },
|
|
14978
14978
|
React__default["default"].createElement(material.ClickAwayListener, { mouseEvent: 'onMouseDown', touchEvent: 'onTouchStart', onClickAway: function () { return setOpen(false); } },
|
|
14979
|
-
React__default["default"].createElement("div", { className: classNames$1(className, 'PrivateDatePicker'), style:
|
|
14980
|
-
display: fullWidth ? 'block' : 'inline-block',
|
|
14981
|
-
flex: fullWidth ? 1 : undefined,
|
|
14982
|
-
}, onMouseDown: handleContainerMouseDown, onFocus: handleContainerFocus, onBlur: handleContainerBlur },
|
|
14979
|
+
React__default["default"].createElement("div", { className: classNames$1(className, 'PrivateDatePicker'), style: wrapStyle, onMouseDown: handleContainerMouseDown, onFocus: handleContainerFocus, onBlur: handleContainerBlur },
|
|
14983
14980
|
React__default["default"].createElement(PrivateStyledTooltip, { open: open, PopperProps: {
|
|
14984
14981
|
modifiers: [
|
|
14985
14982
|
{
|
|
@@ -15091,7 +15088,7 @@ FormTimePicker.defaultProps = FormTimePickerDefaultProps;var FormDateRangePicker
|
|
|
15091
15088
|
styleInject(css_248z$4);var CustomDatePicker = React__default["default"].forwardRef(function (_a, ref) {
|
|
15092
15089
|
// State -----------------------------------------------------------------------------------------------------------
|
|
15093
15090
|
var selectType = _a.selectType, initValue = _a.value, focusedDate = _a.focusedDate, month = _a.month, disableFuture = _a.disableFuture, disablePast = _a.disablePast, minDate = _a.minDate, maxDate = _a.maxDate, onValueChange = _a.onValueChange, onMouseEnterPickersDay = _a.onMouseEnterPickersDay, onMonthChange = _a.onMonthChange;
|
|
15094
|
-
var value =
|
|
15091
|
+
var value = useAutoUpdateState$1(React.useCallback(function () {
|
|
15095
15092
|
return initValue ? initValue : [null, null];
|
|
15096
15093
|
}, [initValue]))[0];
|
|
15097
15094
|
var _b = React.useState(null), activeMonthValue = _b[0], setActiveMonthValue = _b[1];
|
|
@@ -15589,7 +15586,7 @@ var FormDateRangePicker = React__default["default"].forwardRef(function (_a, ref
|
|
|
15589
15586
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
15590
15587
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
15591
15588
|
//--------------------------------------------------------------------------------------------------------------------
|
|
15592
|
-
name = _a.name, initValue = _a.value, startLabel = _a.startLabel, startLabelIcon = _a.startLabelIcon, endLabel = _a.endLabel, endLabelIcon = _a.endLabelIcon, initCalendarCount = _a.calendarCount, initFormat = _a.format, formValueFormat = _a.formValueFormat, allowSingleSelect = _a.allowSingleSelect, required = _a.required, requiredStart = _a.requiredStart, requiredEnd = _a.requiredEnd, readOnly = _a.readOnly, readOnlyStart = _a.readOnlyStart, readOnlyEnd = _a.readOnlyEnd, readOnlyInput = _a.readOnlyInput, initDisabled = _a.disabled, inputWidth = _a.inputWidth, exceptValue = _a.exceptValue, initError = _a.error, initHelperText = _a.helperText, formValueStartNameSuffix = _a.formValueStartNameSuffix, formValueEndNameSuffix = _a.formValueEndNameSuffix, icon = _a.icon, startIcon = _a.startIcon, endIcon = _a.endIcon, startAdornment = _a.startAdornment, startStartAdornment = _a.startStartAdornment, endStartAdornment = _a.endStartAdornment, endAdornment = _a.endAdornment, startEndAdornment = _a.startEndAdornment, endEndAdornment = _a.endEndAdornment, disablePast = _a.disablePast, disableFuture = _a.disableFuture, minDate = _a.minDate, maxDate = _a.maxDate, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
15589
|
+
name = _a.name, initValue = _a.value, startLabel = _a.startLabel, startLabelIcon = _a.startLabelIcon, endLabel = _a.endLabel, endLabelIcon = _a.endLabelIcon, initCalendarCount = _a.calendarCount, initFormat = _a.format, formValueFormat = _a.formValueFormat, allowSingleSelect = _a.allowSingleSelect, required = _a.required, requiredStart = _a.requiredStart, requiredEnd = _a.requiredEnd, readOnly = _a.readOnly, readOnlyStart = _a.readOnlyStart, readOnlyEnd = _a.readOnlyEnd, readOnlyInput = _a.readOnlyInput, initDisabled = _a.disabled, inputWidth = _a.inputWidth, exceptValue = _a.exceptValue, initError = _a.error, initHelperText = _a.helperText, formValueStartNameSuffix = _a.formValueStartNameSuffix, formValueEndNameSuffix = _a.formValueEndNameSuffix, icon = _a.icon, startIcon = _a.startIcon, endIcon = _a.endIcon, startAdornment = _a.startAdornment, startStartAdornment = _a.startStartAdornment, endStartAdornment = _a.endStartAdornment, endAdornment = _a.endAdornment, startEndAdornment = _a.startEndAdornment, endEndAdornment = _a.endEndAdornment, disablePast = _a.disablePast, disableFuture = _a.disableFuture, minDate = _a.minDate, maxDate = _a.maxDate, hidden = _a.hidden, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
15593
15590
|
// -------------------------------------------------------------------------------------------------------------------
|
|
15594
15591
|
className = _a.className;
|
|
15595
15592
|
var id = React.useId();
|
|
@@ -15612,11 +15609,11 @@ var FormDateRangePicker = React__default["default"].forwardRef(function (_a, ref
|
|
|
15612
15609
|
var endInputDatePickerErrorRef = React.useRef(null);
|
|
15613
15610
|
var openValueRef = React.useRef();
|
|
15614
15611
|
// State -----------------------------------------------------------------------------------------------------------
|
|
15615
|
-
var _c =
|
|
15612
|
+
var _c = useAutoUpdateState$1(initError), error = _c[0], setError = _c[1];
|
|
15616
15613
|
var _d = React.useState(false), startError = _d[0], setStartError = _d[1];
|
|
15617
15614
|
var _e = React.useState(false), endError = _e[0], setEndError = _e[1];
|
|
15618
|
-
var _f =
|
|
15619
|
-
var _g =
|
|
15615
|
+
var _f = useAutoUpdateState$1(initDisabled), disabled = _f[0], setDisabled = _f[1];
|
|
15616
|
+
var _g = useAutoUpdateState$1(initHelperText), helperText = _g[0], setHelperText = _g[1];
|
|
15620
15617
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
15621
15618
|
var format = React.useMemo(function () { return initFormat || DEFAULT_FORMAT; }, [initFormat]);
|
|
15622
15619
|
// Function - getFinalValue ----------------------------------------------------------------------------------------
|
|
@@ -15732,10 +15729,10 @@ var FormDateRangePicker = React__default["default"].forwardRef(function (_a, ref
|
|
|
15732
15729
|
// State -----------------------------------------------------------------------------------------------------------
|
|
15733
15730
|
var _h = React.useState(false), open = _h[0], setOpen = _h[1];
|
|
15734
15731
|
var _j = React.useState('start'), selectType = _j[0], setSelectType = _j[1];
|
|
15735
|
-
var _k =
|
|
15732
|
+
var _k = useAutoUpdateState$1(React.useCallback(function () {
|
|
15736
15733
|
return initValue || DEFAULT_VALUE;
|
|
15737
15734
|
}, [initValue])), value = _k[0], setValue = _k[1];
|
|
15738
|
-
var calendarCount =
|
|
15735
|
+
var calendarCount = useAutoUpdateState$1(initCalendarCount || 2)[0];
|
|
15739
15736
|
var _l = React.useState(function () {
|
|
15740
15737
|
var now = dayjs__default["default"]();
|
|
15741
15738
|
return [now, now.add(1, 'month'), now.add(2, 'month')];
|
|
@@ -15806,6 +15803,11 @@ var FormDateRangePicker = React__default["default"].forwardRef(function (_a, ref
|
|
|
15806
15803
|
}
|
|
15807
15804
|
}
|
|
15808
15805
|
}, [open]);
|
|
15806
|
+
// Memo --------------------------------------------------------------------------------------------------------------
|
|
15807
|
+
var wrapStyle = React.useMemo(function () { return ({
|
|
15808
|
+
display: hidden ? 'none' : fullWidth ? 'block' : 'inline-block',
|
|
15809
|
+
flex: fullWidth ? 1 : undefined,
|
|
15810
|
+
}); }, [hidden, fullWidth]);
|
|
15809
15811
|
// Event Handler ---------------------------------------------------------------------------------------------------
|
|
15810
15812
|
var handleChange = React.useCallback(function (newValue) {
|
|
15811
15813
|
setValue(newValue);
|
|
@@ -16078,10 +16080,7 @@ var FormDateRangePicker = React__default["default"].forwardRef(function (_a, ref
|
|
|
16078
16080
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
16079
16081
|
return (React__default["default"].createElement(xDatePickers.LocalizationProvider, { dateAdapter: AdapterDayjs.AdapterDayjs, adapterLocale: dayjsLocale__default["default"] },
|
|
16080
16082
|
React__default["default"].createElement(material.ClickAwayListener, { mouseEvent: 'onMouseDown', touchEvent: 'onTouchStart', onClickAway: function () { return setOpen(false); } },
|
|
16081
|
-
React__default["default"].createElement("div", { className: classNames$1(className, 'FormDateRangePicker'), style:
|
|
16082
|
-
display: fullWidth ? 'block' : 'inline-block',
|
|
16083
|
-
flex: fullWidth ? 1 : undefined,
|
|
16084
|
-
}, onMouseDown: handleContainerMouseDown, onFocus: handleContainerFocus, onBlur: handleContainerBlur },
|
|
16083
|
+
React__default["default"].createElement("div", { className: classNames$1(className, 'FormDateRangePicker'), style: wrapStyle, onMouseDown: handleContainerMouseDown, onFocus: handleContainerFocus, onBlur: handleContainerBlur },
|
|
16085
16084
|
React__default["default"].createElement(PrivateStyledTooltip, { open: open, PopperProps: {
|
|
16086
16085
|
modifiers: [
|
|
16087
16086
|
{
|
|
@@ -16157,7 +16156,7 @@ styleInject(css_248z$1);var FormFile = React__default["default"].forwardRef(func
|
|
|
16157
16156
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
16158
16157
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
16159
16158
|
//----------------------------------------------------------------------------------------------------------------
|
|
16160
|
-
accept = _a.accept, hideUrl = _a.hideUrl, hideLink = _a.hideLink, maxFileSize = _a.maxFileSize, preview = _a.preview, onFile = _a.onFile, onLink = _a.onLink,
|
|
16159
|
+
accept = _a.accept, hideUrl = _a.hideUrl, hideLink = _a.hideLink, maxFileSize = _a.maxFileSize, preview = _a.preview, hidden = _a.hidden, onFile = _a.onFile, onLink = _a.onLink,
|
|
16161
16160
|
//----------------------------------------------------------------------------------------------------------------
|
|
16162
16161
|
name = _a.name, labelIcon = _a.labelIcon, initLabel = _a.label, required = _a.required, initDisabled = _a.disabled, initError = _a.error, initHelperText = _a.helperText, initValue = _a.value, exceptValue = _a.exceptValue, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
16163
16162
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -16176,7 +16175,7 @@ styleInject(css_248z$1);var FormFile = React__default["default"].forwardRef(func
|
|
|
16176
16175
|
var textFieldRef = React.useRef(null);
|
|
16177
16176
|
var fileUploadBtnRef = React.useRef(null);
|
|
16178
16177
|
// State - value ---------------------------------------------------------------------------------------------------
|
|
16179
|
-
var _c =
|
|
16178
|
+
var _c = useAutoUpdateState$1(initValue), value = _c[0], setValue = _c[1];
|
|
16180
16179
|
var fileValue = React.useState('')[0];
|
|
16181
16180
|
useFirstSkipEffect$1(function () {
|
|
16182
16181
|
if (error)
|
|
@@ -16186,9 +16185,9 @@ styleInject(css_248z$1);var FormFile = React__default["default"].forwardRef(func
|
|
|
16186
16185
|
onValueChange(name, value);
|
|
16187
16186
|
}, [value]);
|
|
16188
16187
|
// State -----------------------------------------------------------------------------------------------------------
|
|
16189
|
-
var _d =
|
|
16190
|
-
var _e =
|
|
16191
|
-
var _f =
|
|
16188
|
+
var _d = useAutoUpdateState$1(initError), error = _d[0], setError = _d[1];
|
|
16189
|
+
var _e = useAutoUpdateState$1(initHelperText), helperText = _e[0], setHelperText = _e[1];
|
|
16190
|
+
var _f = useAutoUpdateState$1(initDisabled), disabled = _f[0], setDisabled = _f[1];
|
|
16192
16191
|
var _g = React.useState(false), isOpenLinkDialog = _g[0], setIsOpenLinkDialog = _g[1];
|
|
16193
16192
|
var _h = React.useState({ open: false }), alertDialogProps = _h[0], setAlertDialogProps = _h[1];
|
|
16194
16193
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
@@ -16382,7 +16381,7 @@ styleInject(css_248z$1);var FormFile = React__default["default"].forwardRef(func
|
|
|
16382
16381
|
}
|
|
16383
16382
|
}, [name, onLink, onValueChangeByUser, setValue]);
|
|
16384
16383
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
16385
|
-
return (React__default["default"].createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames$1(className, 'FormValueItem', 'FormFile', "variant-".concat(variant), "size-".concat(size), !!initLabel && 'with-label', !!fullWidth && 'full-width', !!hideUrl && 'hide-file-name', !!hideLink && 'hide-link', notEmpty(value) && 'with-value'), labelIcon: hideUrl ? labelIcon : undefined, label: hideUrl ? initLabel : undefined, error: error, required: required, fullWidth: fullWidth, helperText: React__default["default"].createElement("div", null,
|
|
16384
|
+
return (React__default["default"].createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames$1(className, 'FormValueItem', 'FormFile', "variant-".concat(variant), "size-".concat(size), !!initLabel && 'with-label', !!fullWidth && 'full-width', !!hideUrl && 'hide-file-name', !!hideLink && 'hide-link', notEmpty(value) && 'with-value'), labelIcon: hideUrl ? labelIcon : undefined, label: hideUrl ? initLabel : undefined, error: error, required: required, fullWidth: fullWidth, hidden: hidden, helperText: React__default["default"].createElement("div", null,
|
|
16386
16385
|
preview,
|
|
16387
16386
|
React__default["default"].createElement("div", null, helperText)), hideLabel: !hideUrl, helperTextProps: {
|
|
16388
16387
|
style: {
|
|
@@ -16429,7 +16428,7 @@ FormFile.displayName = 'FormFile';
|
|
|
16429
16428
|
FormFile.defaultProps = FormFileDefaultProps;var FormImageFileDefaultProps = __assign$4(__assign$4({}, FormFileDefaultProps), { accept: '.jpg,.jpeg,.png' });var css_248z = ".FormImageFile .preview-img {\n max-width: 100%;\n}\n.FormImageFile:not(.hide-file-name):not(.variant-standard) .preview-img {\n padding-right: 14px;\n}";
|
|
16430
16429
|
styleInject(css_248z);var FormImageFile = React__default["default"].forwardRef(function (_a, ref) {
|
|
16431
16430
|
var className = _a.className, imageSize = _a.imageSize, preview = _a.preview, previewMaxHeight = _a.previewMaxHeight, initValue = _a.value, onChange = _a.onChange, onFile = _a.onFile, onLink = _a.onLink, props = __rest$2(_a, ["className", "imageSize", "preview", "previewMaxHeight", "value", "onChange", "onFile", "onLink"]);
|
|
16432
|
-
var _b =
|
|
16431
|
+
var _b = useAutoUpdateState$1(initValue), value = _b[0], setValue = _b[1];
|
|
16433
16432
|
var _c = React.useState(), previewNode = _c[0], setPreviewNode = _c[1];
|
|
16434
16433
|
var _d = React.useState({
|
|
16435
16434
|
open: false,
|