@pdg/react-form 1.0.36 → 1.0.38
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/@types/types.d.ts +4 -0
- package/dist/Form/Form.types.d.ts +6 -0
- package/dist/FormCommon/FormLabel/FormLabel.d.ts +1 -1
- package/dist/FormCommon/FormLabel/FormLabel.types.d.ts +1 -0
- package/dist/FormItemCustom/FormCheckbox/FormCheckbox.d.ts +1 -1
- package/dist/FormLayout/FormBlock/FormBlock.types.d.ts +1 -0
- package/dist/FormLayout/FormCol/FormCol.types.d.ts +1 -1
- package/dist/FormLayout/FormDivider/FormDivider.style.d.ts +8 -0
- package/dist/FormLayout/FormDivider/FormDivider.types.d.ts +1 -0
- package/dist/FormLayout/FormRow/FormRow.types.d.ts +1 -1
- package/dist/index.esm.js +162 -51
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +161 -50
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as React from'react';import React__default,{createContext,useContext,useMemo,useRef,useState,useCallback,useLayoutEffect,useEffect,cloneElement,isValidElement,createRef,PureComponent,useId}from'react';import {Box,Icon as Icon$1,Button,styled,InputLabel,Grid,Collapse,FormHelperText,InputAdornment,IconButton,TextField,Chip,Autocomplete,CircularProgress,MenuItem,Checkbox,FormControl,Input,OutlinedInput,FilledInput,FormControlLabel,Typography,
|
|
1
|
+
import*as React from'react';import React__default,{createContext,useContext,useMemo,useRef,useState,useCallback,useLayoutEffect,useEffect,cloneElement,isValidElement,createRef,PureComponent,useId}from'react';import {Box,Icon as Icon$1,Button,styled,useTheme,InputLabel,Grid,Collapse,FormHelperText,InputAdornment,IconButton,TextField,Chip,Autocomplete,CircularProgress,MenuItem,Checkbox,FormControl,Input,OutlinedInput,FilledInput,FormControlLabel,Typography,RadioGroup,Radio,ToggleButton,ToggleButtonGroup,Rating,Skeleton,darken,Tooltip,tooltipClasses,ClickAwayListener,Dialog,DialogTitle,DialogContent,DialogActions,Paper}from'@mui/material';import dayjs from'dayjs';import {findDOMNode}from'react-dom';import {CheckBox,CheckBoxOutlineBlank,RadioButtonUnchecked,RadioButtonChecked}from'@mui/icons-material';import CircularProgress$1 from'@mui/material/CircularProgress';import {AdapterDayjs}from'@mui/x-date-pickers/AdapterDayjs';import {PickersDay,StaticDatePicker,LocalizationProvider,DesktopDatePicker}from'@mui/x-date-pickers';import dayjsLocale from'dayjs/locale/ko';import dayjsIsSameOrAfter from'dayjs/plugin/isSameOrAfter';import dayjsIsSameOrBefore from'dayjs/plugin/isSameOrBefore';import dayjsIsBetween from'dayjs/plugin/isBetween';/******************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -481,7 +481,7 @@ function checkDateAvailable(date, availableDate, type, time) {
|
|
|
481
481
|
//--------------------------------------------------------------------------------------------------------------------
|
|
482
482
|
initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initSpacing = _a.spacing, initFormColGap = _a.formColGap, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth, fullHeight = _a.fullHeight,
|
|
483
483
|
//----------------------------------------------------------------------------------------------------------------
|
|
484
|
-
onSubmit = _a.onSubmit, onValueChange = _a.onValueChange, onValueChangeByUser = _a.onValueChangeByUser;
|
|
484
|
+
onSubmit = _a.onSubmit, onInvalid = _a.onInvalid, onValueChange = _a.onValueChange, onValueChangeByUser = _a.onValueChangeByUser;
|
|
485
485
|
var _b = useFormState(), formId = _b.id, formVariant = _b.variant, formSize = _b.size, formColor = _b.color, formSpacing = _b.spacing, formFormColGap = _b.formColGap, formFocused = _b.focused, formLabelShrink = _b.labelShrink, formFullWidth = _b.fullWidth, formAddValueItem = _b.onAddValueItem, formRemoveValueItem = _b.onRemoveValueItem, formValueChange = _b.onValueChange, formValueChangeByUser = _b.onValueChangeByUser, otherFormState = __rest$3(_b, ["id", "variant", "size", "color", "spacing", "formColGap", "focused", "labelShrink", "fullWidth", "onAddValueItem", "onRemoveValueItem", "onValueChange", "onValueChangeByUser"]);
|
|
486
486
|
// Memo - FormState ------------------------------------------------------------------------------------------------
|
|
487
487
|
var variant = useMemo(function () { return (initVariant == null ? formVariant : initVariant); }, [initVariant, formVariant]);
|
|
@@ -587,6 +587,7 @@ function checkDateAvailable(date, availableDate, type, time) {
|
|
|
587
587
|
var isAllValid = true;
|
|
588
588
|
var firstInvalidItemId;
|
|
589
589
|
var data = {};
|
|
590
|
+
var invalidItems = [];
|
|
590
591
|
Object.keys(valueItems).forEach(function (id) {
|
|
591
592
|
var itemCommands = valueItems[id];
|
|
592
593
|
if (itemCommands) {
|
|
@@ -597,6 +598,7 @@ function checkDateAvailable(date, availableDate, type, time) {
|
|
|
597
598
|
}
|
|
598
599
|
}
|
|
599
600
|
else {
|
|
601
|
+
invalidItems.push({ name: itemCommands.getName(), commands: itemCommands });
|
|
600
602
|
if (isAllValid) {
|
|
601
603
|
isAllValid = false;
|
|
602
604
|
firstInvalidItemId = id;
|
|
@@ -606,16 +608,16 @@ function checkDateAvailable(date, availableDate, type, time) {
|
|
|
606
608
|
}
|
|
607
609
|
});
|
|
608
610
|
if (isAllValid) {
|
|
609
|
-
|
|
610
|
-
onSubmit(data);
|
|
611
|
+
onSubmit && onSubmit(data);
|
|
611
612
|
}
|
|
612
613
|
else {
|
|
614
|
+
onInvalid && onInvalid(invalidItems);
|
|
613
615
|
nextTick(function () {
|
|
614
616
|
var _a;
|
|
615
617
|
(_a = valueItems[firstInvalidItemId]) === null || _a === void 0 ? void 0 : _a.focusValidate();
|
|
616
618
|
});
|
|
617
619
|
}
|
|
618
|
-
}, [valueItems, appendFormValueData, onSubmit]);
|
|
620
|
+
}, [valueItems, appendFormValueData, onSubmit, onInvalid]);
|
|
619
621
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
620
622
|
useLayoutEffect(function () {
|
|
621
623
|
if (ref) {
|
|
@@ -861,9 +863,17 @@ FormButton.displayName = 'FormButton';
|
|
|
861
863
|
FormButton.defaultProps = FormButtonDefaultProps;var FormLabelDefaultProps = {};var IconFormIcon = styled(FormIcon)(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n vertical-align: middle;\n margin-right: 3px;\n margin-top: -4px;\n margin-bottom: -2px;\n"], ["\n vertical-align: middle;\n margin-right: 3px;\n margin-top: -4px;\n margin-bottom: -2px;\n"])));
|
|
862
864
|
var ChildrenSpan = styled('span')(templateObject_2$1 || (templateObject_2$1 = __makeTemplateObject(["\n vertical-align: middle;\n"], ["\n vertical-align: middle;\n"])));
|
|
863
865
|
var templateObject_1$5, templateObject_2$1;var FormLabel = React__default.forwardRef(function (_a, ref) {
|
|
866
|
+
// Use ---------------------------------------------------------------------------------------------------------------
|
|
867
|
+
var children = _a.children, icon = _a.icon, size = _a.size, style = _a.style, error = _a.error, warning = _a.warning, props = __rest$3(_a, ["children", "icon", "size", "style", "error", "warning"]);
|
|
868
|
+
var theme = useTheme();
|
|
864
869
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
865
|
-
var
|
|
866
|
-
|
|
870
|
+
var finalProps = useMemo(function () {
|
|
871
|
+
var newStyle = __assign$6({ height: 20, transform: size === 'small' ? 'translate(0, -1.5px) scale(0.7)' : undefined }, style);
|
|
872
|
+
if (!error) {
|
|
873
|
+
newStyle.color = warning ? theme.palette.warning.main : style === null || style === void 0 ? void 0 : style.color;
|
|
874
|
+
}
|
|
875
|
+
return __assign$6({ shrink: true, className: 'FormItemBase-InputLabel', size: size === 'medium' ? 'normal' : size, error: error, style: newStyle }, props);
|
|
876
|
+
}, [size, style, warning, error, props, theme.palette.warning.main]);
|
|
867
877
|
// Render ------------------------------------------------------------------------------------------------------------
|
|
868
878
|
return (React__default.createElement(InputLabel, __assign$6({ ref: ref }, finalProps), icon ? (React__default.createElement(React__default.Fragment, null,
|
|
869
879
|
React__default.createElement(IconFormIcon, null, icon),
|
|
@@ -884,12 +894,23 @@ var StyledErrorLineBox = styled(Box)(function (_a) {
|
|
|
884
894
|
opacity: 0.4,
|
|
885
895
|
});
|
|
886
896
|
});
|
|
897
|
+
var StyledWarningLineBox = styled(Box)(function (_a) {
|
|
898
|
+
var theme = _a.theme;
|
|
899
|
+
return ({
|
|
900
|
+
borderBottom: "thin solid ".concat(theme.palette.warning.main),
|
|
901
|
+
position: 'absolute',
|
|
902
|
+
left: 0,
|
|
903
|
+
top: '50%',
|
|
904
|
+
width: '100%',
|
|
905
|
+
opacity: 0.4,
|
|
906
|
+
});
|
|
907
|
+
});
|
|
887
908
|
var templateObject_1$4;var DEFAULT_LINE_STYLE = { flex: 1, position: 'relative' };
|
|
888
909
|
var FormDivider = React__default.forwardRef(function (_a, ref) {
|
|
889
910
|
// FormState -------------------------------------------------------------------------------------------------------
|
|
890
911
|
var initSize = _a.size,
|
|
891
912
|
//----------------------------------------------------------------------------------------------------------------
|
|
892
|
-
icon = _a.icon, label = _a.label, line = _a.line, lineVerticalMargin = _a.lineVerticalMargin, hidden = _a.hidden, collapse = _a.collapse, collapseIn = _a.collapseIn, error = _a.error, onCollapseChange = _a.onCollapseChange,
|
|
913
|
+
icon = _a.icon, label = _a.label, line = _a.line, lineVerticalMargin = _a.lineVerticalMargin, hidden = _a.hidden, collapse = _a.collapse, collapseIn = _a.collapseIn, error = _a.error, warning = _a.warning, onCollapseChange = _a.onCollapseChange,
|
|
893
914
|
//----------------------------------------------------------------------------------------------------------------
|
|
894
915
|
className = _a.className, initStyle = _a.style, sx = _a.sx;
|
|
895
916
|
var formSize = useFormState().size;
|
|
@@ -928,15 +949,15 @@ var FormDivider = React__default.forwardRef(function (_a, ref) {
|
|
|
928
949
|
padding: 0,
|
|
929
950
|
cursor: collapse ? 'pointer' : undefined,
|
|
930
951
|
}, onClick: handleClick },
|
|
931
|
-
icon && (React__default.createElement(FormIcon, { style: { opacity: 0.54, marginRight: 5 }, color: error ? 'error' : undefined, fontSize: size }, icon)),
|
|
952
|
+
icon && (React__default.createElement(FormIcon, { style: { opacity: 0.54, marginRight: 5 }, color: error ? 'error' : warning ? 'warning' : undefined, fontSize: size }, icon)),
|
|
932
953
|
label && (React__default.createElement(Box, { sx: {
|
|
933
954
|
paddingRight: '10px',
|
|
934
|
-
color: error ? 'error.main' : 'text.secondary',
|
|
955
|
+
color: error ? 'error.main' : warning ? 'warning.main' : 'text.secondary',
|
|
935
956
|
fontWeight: 700,
|
|
936
957
|
fontSize: size === 'small' ? '11.5px' : '12px',
|
|
937
958
|
} }, label)),
|
|
938
|
-
(line || collapse) && React__default.createElement("div", { style: lineStyle }, error ? React__default.createElement(StyledErrorLineBox, null) : React__default.createElement(StyledLineBox, null)),
|
|
939
|
-
collapse && (React__default.createElement(FormIcon, { sx: { opacity: 0.6, ml: 1 }, color: error ? 'error' : undefined }, collapseIn ? 'KeyboardDoubleArrowUp' : 'KeyboardDoubleArrowDown')))));
|
|
959
|
+
(line || collapse) && (React__default.createElement("div", { style: lineStyle }, error ? React__default.createElement(StyledErrorLineBox, null) : warning ? React__default.createElement(StyledWarningLineBox, null) : React__default.createElement(StyledLineBox, null))),
|
|
960
|
+
collapse && (React__default.createElement(FormIcon, { sx: { opacity: 0.6, ml: 1 }, color: error ? 'error' : warning ? 'warning' : undefined }, collapseIn ? 'KeyboardDoubleArrowUp' : 'KeyboardDoubleArrowDown')))));
|
|
940
961
|
});
|
|
941
962
|
FormDivider.displayName = 'FormDivider.';
|
|
942
963
|
FormDivider.defaultProps = FormDividerDefaultProps;function useFirstSkipEffect$1(effect, deps) {
|
|
@@ -1006,7 +1027,7 @@ var templateObject_1$3;var FormBlock = React__default.forwardRef(function (_a, r
|
|
|
1006
1027
|
// FormState -------------------------------------------------------------------------------------------------------
|
|
1007
1028
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initSpacing = _a.spacing, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
1008
1029
|
//----------------------------------------------------------------------------------------------------------------
|
|
1009
|
-
icon = _a.icon, label = _a.label, line = _a.line, lineVerticalMargin = _a.lineVerticalMargin, error = _a.error,
|
|
1030
|
+
icon = _a.icon, label = _a.label, line = _a.line, lineVerticalMargin = _a.lineVerticalMargin, error = _a.error, warning = _a.warning,
|
|
1010
1031
|
//----------------------------------------------------------------------------------------------------------------
|
|
1011
1032
|
hidden = _a.hidden, collapse = _a.collapse, initCollapseIn = _a.collapseIn,
|
|
1012
1033
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -1046,7 +1067,7 @@ var templateObject_1$3;var FormBlock = React__default.forwardRef(function (_a, r
|
|
|
1046
1067
|
return (React__default.createElement(FormContext.Provider, { value: __assign$6({ variant: variant, size: size, color: color, spacing: spacing, focused: focused, labelShrink: labelShrink, fullWidth: fullWidth }, otherFormState) },
|
|
1047
1068
|
React__default.createElement(Grid, { item: true, ref: ref, xs: 12, className: classNames$1(className, 'FormBlock'), style: style, sx: sx },
|
|
1048
1069
|
React__default.createElement(Grid, { container: true, spacing: spacing },
|
|
1049
|
-
(icon || label || line || collapse) && (React__default.createElement(FormDivider, { className: 'FormBlock-header', collapse: collapse, collapseIn: collapseIn, size: size, icon: icon, color: color, label: label, line: line, error: error, lineVerticalMargin: lineVerticalMargin, hidden: hidden, onCollapseChange: collapse ? function (newCollapseIn) { return setCollapseIn(newCollapseIn); } : undefined })),
|
|
1070
|
+
(icon || label || line || collapse) && (React__default.createElement(FormDivider, { className: 'FormBlock-header', collapse: collapse, collapseIn: collapseIn, size: size, icon: icon, color: color, label: label, line: line, error: error, warning: warning, lineVerticalMargin: lineVerticalMargin, hidden: hidden, onCollapseChange: collapse ? function (newCollapseIn) { return setCollapseIn(newCollapseIn); } : undefined })),
|
|
1050
1071
|
React__default.createElement(StyledWrapGrid$1, { item: true, xs: 12 },
|
|
1051
1072
|
React__default.createElement(Container, __assign$6({}, containerProps),
|
|
1052
1073
|
React__default.createElement(Grid, { container: true, spacing: spacing },
|
|
@@ -1061,7 +1082,7 @@ var templateObject_1$2;var FormRow = React__default.forwardRef(function (_a, ref
|
|
|
1061
1082
|
//----------------------------------------------------------------------------------------------------------------
|
|
1062
1083
|
icon = _a.icon, label = _a.label, line = _a.line, lineVerticalMargin = _a.lineVerticalMargin,
|
|
1063
1084
|
//----------------------------------------------------------------------------------------------------------------
|
|
1064
|
-
hidden = _a.hidden, error = _a.error, helperText = _a.helperText,
|
|
1085
|
+
hidden = _a.hidden, error = _a.error, warning = _a.warning, helperText = _a.helperText,
|
|
1065
1086
|
//----------------------------------------------------------------------------------------------------------------
|
|
1066
1087
|
children = _a.children, className = _a.className, initStyle = _a.style, sx = _a.sx;
|
|
1067
1088
|
var _b = useFormState(), formVariant = _b.variant, formSize = _b.size, formColor = _b.color, formSpacing = _b.spacing, formFocused = _b.focused, formLabelShrink = _b.labelShrink, formFullWidth = _b.fullWidth, otherFormState = __rest$3(_b, ["variant", "size", "color", "spacing", "focused", "labelShrink", "fullWidth"]);
|
|
@@ -1111,7 +1132,7 @@ var templateObject_1$2;var FormRow = React__default.forwardRef(function (_a, ref
|
|
|
1111
1132
|
return (React__default.createElement(FormContext.Provider, { value: __assign$6({ variant: variant, size: size, color: color, spacing: spacing, focused: focused, labelShrink: labelShrink, fullWidth: fullWidth, formColAutoXs: formColAutoXs, onAddFormCol: handleAddFormCol, onRemoveFormCol: handleRemoveFormCol }, otherFormState) },
|
|
1112
1133
|
React__default.createElement(Grid, { item: true, ref: ref, xs: 12, className: classNames$1(className, 'FormRow'), style: style, sx: sx },
|
|
1113
1134
|
React__default.createElement(Grid, { container: true, spacing: spacing },
|
|
1114
|
-
(icon || label || line) && (React__default.createElement(FormDivider, { className: classNames$1(className, 'FormRow-header'), size: size, icon: icon, color: color, label: label, line: line, error: error, lineVerticalMargin: lineVerticalMargin, hidden: hidden })),
|
|
1135
|
+
(icon || label || line) && (React__default.createElement(FormDivider, { className: classNames$1(className, 'FormRow-header'), size: size, icon: icon, color: color, label: label, line: line, error: error, warning: warning, lineVerticalMargin: lineVerticalMargin, hidden: hidden })),
|
|
1115
1136
|
React__default.createElement(StyledWrapGrid, { item: true, xs: 12, className: 'FormRow-body' },
|
|
1116
1137
|
React__default.createElement(Grid, { className: 'FormRow-content', container: true, spacing: spacing, direction: 'row', style: { flexWrap: 'nowrap' } }, children),
|
|
1117
1138
|
helperText && (React__default.createElement(FormHelperText, { className: 'FormRow-helper-text', component: 'div', error: error }, helperText)))))));
|
|
@@ -1968,7 +1989,7 @@ function useResizeDetector(props) {
|
|
|
1968
1989
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
1969
1990
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initSpacing = _a.spacing, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
1970
1991
|
//----------------------------------------------------------------------------------------------------------------
|
|
1971
|
-
initGap = _a.gap, icon = _a.icon, label = _a.label, hidden = _a.hidden, error = _a.error, helperText = _a.helperText, helperTextShift = _a.helperTextShift,
|
|
1992
|
+
initGap = _a.gap, icon = _a.icon, label = _a.label, hidden = _a.hidden, error = _a.error, warning = _a.warning, helperText = _a.helperText, helperTextShift = _a.helperTextShift,
|
|
1972
1993
|
//----------------------------------------------------------------------------------------------------------------
|
|
1973
1994
|
xs = _a.xs, className = _a.className, children = _a.children, initStyle = _a.style, sx = _a.sx;
|
|
1974
1995
|
var id = useId();
|
|
@@ -2023,7 +2044,7 @@ function useResizeDetector(props) {
|
|
|
2023
2044
|
React__default.createElement(Grid, { container: true, direction: 'column' },
|
|
2024
2045
|
label && (React__default.createElement(Grid, { item: true, className: 'FormCol-header' },
|
|
2025
2046
|
React__default.createElement("div", { style: { position: 'relative', height: 20 } },
|
|
2026
|
-
React__default.createElement(FormLabel, { className: 'FormCol-FormLabel', size: size, icon: icon, focused: focused, color: color, error: error, style: { position: 'absolute', left: 5, top: 0 } }, label)))),
|
|
2047
|
+
React__default.createElement(FormLabel, { className: 'FormCol-FormLabel', size: size, icon: icon, focused: focused, color: color, error: error, warning: warning, style: { position: 'absolute', left: 5, top: 0 } }, label)))),
|
|
2027
2048
|
React__default.createElement(Grid, { item: true, xs: 2, className: 'FormCol-content' },
|
|
2028
2049
|
React__default.createElement(Box, { sx: { display: 'flex', flexWrap: 'wrap', gap: gap } }, children)),
|
|
2029
2050
|
helperText && (React__default.createElement(Grid, { item: true, className: 'FormCol-helper-text' },
|
|
@@ -2104,13 +2125,13 @@ styleInject(css_248z$j);var FormTextField = React__default.forwardRef(function (
|
|
|
2104
2125
|
var _b;
|
|
2105
2126
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
2106
2127
|
//----------------------------------------------------------------------------------------------------------------
|
|
2107
|
-
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, tabIndex = _a.tabIndex, 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,
|
|
2128
|
+
name = _a.name, required = _a.required, initValue = _a.value, initData = _a.data, icon = _a.icon, labelIcon = _a.labelIcon, initLabel = _a.label, initError = _a.error, initHelperText = _a.helperText, exceptValue = _a.exceptValue, readOnly = _a.readOnly, tabIndex = _a.tabIndex, 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,
|
|
2108
2129
|
//----------------------------------------------------------------------------------------------------------------
|
|
2109
2130
|
onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate, onBlur = _a.onBlur, onKeyDown = _a.onKeyDown,
|
|
2110
2131
|
//----------------------------------------------------------------------------------------------------------------
|
|
2111
2132
|
className = _a.className, initStyle = _a.style,
|
|
2112
2133
|
//----------------------------------------------------------------------------------------------------------------
|
|
2113
|
-
props = __rest$3(_a, ["variant", "size", "color", "focused", "labelShrink", "fullWidth", "name", "required", "value", "icon", "labelIcon", "label", "error", "helperText", "exceptValue", "readOnly", "tabIndex", "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"]);
|
|
2134
|
+
props = __rest$3(_a, ["variant", "size", "color", "focused", "labelShrink", "fullWidth", "name", "required", "value", "data", "icon", "labelIcon", "label", "error", "helperText", "exceptValue", "readOnly", "tabIndex", "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"]);
|
|
2114
2135
|
var id = useId();
|
|
2115
2136
|
// Ref -------------------------------------------------------------------------------------------------------------
|
|
2116
2137
|
var inputRef = useRef(null);
|
|
@@ -2128,6 +2149,7 @@ styleInject(css_248z$j);var FormTextField = React__default.forwardRef(function (
|
|
|
2128
2149
|
var _e = useAutoUpdateState$1(initHelperText), helperText = _e[0], setHelperText = _e[1];
|
|
2129
2150
|
var _f = useState(false), showClear = _f[0], setShowClear = _f[1];
|
|
2130
2151
|
var _g = useAutoUpdateState$1(initDisabled), disabled = _g[0], setDisabled = _g[1];
|
|
2152
|
+
var _h = useAutoUpdateState$1(initData), data = _h[0], setData = _h[1];
|
|
2131
2153
|
// Memo - muiInputLabelProps ---------------------------------------------------------------------------------------
|
|
2132
2154
|
var muiInputLabelProps = useMemo(function () {
|
|
2133
2155
|
if (labelShrink || placeholder) {
|
|
@@ -2176,7 +2198,7 @@ styleInject(css_248z$j);var FormTextField = React__default.forwardRef(function (
|
|
|
2176
2198
|
return onValue ? onValue(value) : value;
|
|
2177
2199
|
}, [onValue]);
|
|
2178
2200
|
// State - value ---------------------------------------------------------------------------------------------------
|
|
2179
|
-
var
|
|
2201
|
+
var _j = useAutoUpdateState$1(initValue, getFinalValue), value = _j[0], setValue = _j[1];
|
|
2180
2202
|
useEffect(function () {
|
|
2181
2203
|
setShowClear(clear ? notEmpty(value) : false);
|
|
2182
2204
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -2292,6 +2314,7 @@ styleInject(css_248z$j);var FormTextField = React__default.forwardRef(function (
|
|
|
2292
2314
|
useLayoutEffect(function () {
|
|
2293
2315
|
if (ref || (!noFormValueItem && onAddValueItem)) {
|
|
2294
2316
|
var lastValue_1 = value;
|
|
2317
|
+
var lastData_1 = data;
|
|
2295
2318
|
var lastDisabled_1 = !!disabled;
|
|
2296
2319
|
var commands = {
|
|
2297
2320
|
getType: function () { return 'default'; },
|
|
@@ -2306,6 +2329,11 @@ styleInject(css_248z$j);var FormTextField = React__default.forwardRef(function (
|
|
|
2306
2329
|
lastValue_1 = getFinalValue(value);
|
|
2307
2330
|
setValue(lastValue_1);
|
|
2308
2331
|
},
|
|
2332
|
+
getData: function () { return lastData_1; },
|
|
2333
|
+
setData: function (data) {
|
|
2334
|
+
lastData_1 = data;
|
|
2335
|
+
setData(data);
|
|
2336
|
+
},
|
|
2309
2337
|
isExceptValue: function () { return !!exceptValue; },
|
|
2310
2338
|
isDisabled: function () { return lastDisabled_1; },
|
|
2311
2339
|
setDisabled: function (disabled) {
|
|
@@ -2346,6 +2374,7 @@ styleInject(css_248z$j);var FormTextField = React__default.forwardRef(function (
|
|
|
2346
2374
|
name,
|
|
2347
2375
|
initValue,
|
|
2348
2376
|
value,
|
|
2377
|
+
data,
|
|
2349
2378
|
getFinalValue,
|
|
2350
2379
|
exceptValue,
|
|
2351
2380
|
disabled,
|
|
@@ -2360,6 +2389,7 @@ styleInject(css_248z$j);var FormTextField = React__default.forwardRef(function (
|
|
|
2360
2389
|
setDisabled,
|
|
2361
2390
|
setErrorHelperText,
|
|
2362
2391
|
initHelperText,
|
|
2392
|
+
setData,
|
|
2363
2393
|
]);
|
|
2364
2394
|
// Event Handler ---------------------------------------------------------------------------------------------------
|
|
2365
2395
|
var handleChange = useCallback(function (e) {
|
|
@@ -4530,9 +4560,9 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default.forw
|
|
|
4530
4560
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
4531
4561
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initFullWidth = _a.fullWidth,
|
|
4532
4562
|
//----------------------------------------------------------------------------------------------------------------
|
|
4533
|
-
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,
|
|
4563
|
+
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, initData = _a.data, initUncheckedValue = _a.uncheckedValue, exceptValue = _a.exceptValue, hidden = _a.hidden, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
4534
4564
|
//----------------------------------------------------------------------------------------------------------------
|
|
4535
|
-
className = _a.className, initStyle = _a.style, sx = _a.sx, props = __rest$3(_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"]);
|
|
4565
|
+
className = _a.className, initStyle = _a.style, sx = _a.sx, props = __rest$3(_a, ["variant", "size", "color", "focused", "fullWidth", "name", "labelIcon", "label", "checked", "inputRef", "action", "readOnly", "disabled", "text", "error", "helperText", "value", "data", "uncheckedValue", "exceptValue", "hidden", "onChange", "onValidate", "className", "style", "sx"]);
|
|
4536
4566
|
var id = useId();
|
|
4537
4567
|
// FormState -------------------------------------------------------------------------------------------------------
|
|
4538
4568
|
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;
|
|
@@ -4553,8 +4583,9 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default.forw
|
|
|
4553
4583
|
var _f = useAutoUpdateState$1(initError), error = _f[0], setError = _f[1];
|
|
4554
4584
|
var _g = useAutoUpdateState$1(initHelperText), helperText = _g[0], setHelperText = _g[1];
|
|
4555
4585
|
var _h = useAutoUpdateState$1(initDisabled), disabled = _h[0], setDisabled = _h[1];
|
|
4586
|
+
var _j = useAutoUpdateState$1(initData), data = _j[0], setData = _j[1];
|
|
4556
4587
|
// State - checked -------------------------------------------------------------------------------------------------
|
|
4557
|
-
var
|
|
4588
|
+
var _k = useAutoUpdateState$1(initChecked), checked = _k[0], setChecked = _k[1];
|
|
4558
4589
|
useFirstSkipEffect$1(function () {
|
|
4559
4590
|
if (error)
|
|
4560
4591
|
validate(checked);
|
|
@@ -4601,6 +4632,7 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default.forw
|
|
|
4601
4632
|
useLayoutEffect(function () {
|
|
4602
4633
|
var lastChecked = checked;
|
|
4603
4634
|
var lastValue = value;
|
|
4635
|
+
var lastData = data;
|
|
4604
4636
|
var lastUncheckedValue = uncheckedValue;
|
|
4605
4637
|
var lastDisabled = !!disabled;
|
|
4606
4638
|
var commands = {
|
|
@@ -4616,6 +4648,11 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default.forw
|
|
|
4616
4648
|
lastValue = value;
|
|
4617
4649
|
setValue(value);
|
|
4618
4650
|
},
|
|
4651
|
+
getData: function () { return lastData; },
|
|
4652
|
+
setData: function (data) {
|
|
4653
|
+
lastData = data;
|
|
4654
|
+
setData(data);
|
|
4655
|
+
},
|
|
4619
4656
|
getUncheckedValue: function () { return lastUncheckedValue; },
|
|
4620
4657
|
setUncheckedValue: function (uncheckedValue) {
|
|
4621
4658
|
lastUncheckedValue = uncheckedValue;
|
|
@@ -4679,6 +4716,8 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default.forw
|
|
|
4679
4716
|
setUncheckedValue,
|
|
4680
4717
|
setDisabled,
|
|
4681
4718
|
setErrorHelperText,
|
|
4719
|
+
data,
|
|
4720
|
+
setData,
|
|
4682
4721
|
]);
|
|
4683
4722
|
// Event Handler ---------------------------------------------------------------------------------------------------
|
|
4684
4723
|
var handleChange = useCallback(function (e, checked) {
|
|
@@ -4704,11 +4743,11 @@ var FormRadioGroup = React__default.forwardRef(function (_a, ref) {
|
|
|
4704
4743
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
4705
4744
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initFullWidth = _a.fullWidth, hidden = _a.hidden,
|
|
4706
4745
|
//----------------------------------------------------------------------------------------------------------------
|
|
4707
|
-
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,
|
|
4746
|
+
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, initData = _a.data, 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,
|
|
4708
4747
|
//----------------------------------------------------------------------------------------------------------------
|
|
4709
4748
|
className = _a.className, initStyle = _a.style, sx = _a.sx,
|
|
4710
4749
|
//----------------------------------------------------------------------------------------------------------------
|
|
4711
|
-
props = __rest$3(_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"]);
|
|
4750
|
+
props = __rest$3(_a, ["variant", "size", "color", "focused", "fullWidth", "hidden", "name", "width", "labelIcon", "label", "inline", "loading", "nowrap", "items", "value", "data", "error", "helperText", "disabled", "readOnly", "required", "exceptValue", "onLoadItems", "onChange", "onValue", "onValidate", "className", "style", "sx"]);
|
|
4712
4751
|
var id = useId();
|
|
4713
4752
|
// FormState -------------------------------------------------------------------------------------------------------
|
|
4714
4753
|
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;
|
|
@@ -4733,8 +4772,9 @@ var FormRadioGroup = React__default.forwardRef(function (_a, ref) {
|
|
|
4733
4772
|
var _j = useAutoUpdateState$1(initLoading), loading = _j[0], setLoading = _j[1];
|
|
4734
4773
|
var _k = useAutoUpdateState$1(initWidth || '100%'), width = _k[0], setWidth = _k[1];
|
|
4735
4774
|
var _l = useState(), formColWrapRect = _l[0], setFormColWrapRect = _l[1];
|
|
4775
|
+
var _m = useAutoUpdateState$1(initData), data = _m[0], setData = _m[1];
|
|
4736
4776
|
// State - radioGroupNoWrapRect (ResizeDetector) -------------------------------------------------------------------
|
|
4737
|
-
var
|
|
4777
|
+
var _o = useState(), radioGroupNoWrapRect = _o[0], setRadioGroupNoWrapRect = _o[1];
|
|
4738
4778
|
var resizeWidthDetectorRef = useResizeDetector({
|
|
4739
4779
|
handleWidth: true,
|
|
4740
4780
|
handleHeight: false,
|
|
@@ -4744,13 +4784,13 @@ var FormRadioGroup = React__default.forwardRef(function (_a, ref) {
|
|
|
4744
4784
|
},
|
|
4745
4785
|
}).ref;
|
|
4746
4786
|
// State - height (ResizeDetector) ---------------------------------------------------------------------------------
|
|
4747
|
-
var
|
|
4787
|
+
var _p = useResizeDetector(), height = _p.height, resizeHeightDetectorRef = _p.ref;
|
|
4748
4788
|
// Function - getFinalValue ----------------------------------------------------------------------------------------
|
|
4749
4789
|
var getFinalValue = useCallback(function (value) {
|
|
4750
4790
|
return onValue ? onValue(value) : value;
|
|
4751
4791
|
}, [onValue]);
|
|
4752
4792
|
// State - value ---------------------------------------------------------------------------------------------------
|
|
4753
|
-
var
|
|
4793
|
+
var _q = useAutoUpdateState$1(initValue, getFinalValue), value = _q[0], setValue = _q[1];
|
|
4754
4794
|
useFirstSkipEffect$1(function () {
|
|
4755
4795
|
if (error)
|
|
4756
4796
|
validate(value);
|
|
@@ -4855,6 +4895,7 @@ var FormRadioGroup = React__default.forwardRef(function (_a, ref) {
|
|
|
4855
4895
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
4856
4896
|
useLayoutEffect(function () {
|
|
4857
4897
|
var lastValue = value;
|
|
4898
|
+
var lastData = data;
|
|
4858
4899
|
var lastItems = items;
|
|
4859
4900
|
var lastLoading = loading;
|
|
4860
4901
|
var lastDisabled = !!disabled;
|
|
@@ -4871,6 +4912,11 @@ var FormRadioGroup = React__default.forwardRef(function (_a, ref) {
|
|
|
4871
4912
|
lastValue = getFinalValue(value);
|
|
4872
4913
|
setValue(lastValue);
|
|
4873
4914
|
},
|
|
4915
|
+
getData: function () { return lastData; },
|
|
4916
|
+
setData: function (data) {
|
|
4917
|
+
lastData = data;
|
|
4918
|
+
setData(data);
|
|
4919
|
+
},
|
|
4874
4920
|
isExceptValue: function () { return !!exceptValue; },
|
|
4875
4921
|
isDisabled: function () { return lastDisabled; },
|
|
4876
4922
|
setDisabled: function (disabled) {
|
|
@@ -4935,6 +4981,8 @@ var FormRadioGroup = React__default.forwardRef(function (_a, ref) {
|
|
|
4935
4981
|
initHelperText,
|
|
4936
4982
|
setItems,
|
|
4937
4983
|
setLoading,
|
|
4984
|
+
data,
|
|
4985
|
+
setData,
|
|
4938
4986
|
]);
|
|
4939
4987
|
useEffect(function () {
|
|
4940
4988
|
if (onLoadItems) {
|
|
@@ -5009,7 +5057,7 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default.forwardRef(fu
|
|
|
5009
5057
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
5010
5058
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initFullWidth = _a.fullWidth,
|
|
5011
5059
|
//----------------------------------------------------------------------------------------------------------------
|
|
5012
|
-
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, itemWidth = _a.itemWidth, onLoadItems = _a.onLoadItems,
|
|
5060
|
+
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, type = _a.type, initLoading = _a.loading, initItems = _a.items, initValue = _a.value, initData = _a.data, 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, itemWidth = _a.itemWidth, onLoadItems = _a.onLoadItems,
|
|
5013
5061
|
//----------------------------------------------------------------------------------------------------------------
|
|
5014
5062
|
onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate,
|
|
5015
5063
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -5050,6 +5098,7 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default.forwardRef(fu
|
|
|
5050
5098
|
var _j = useAutoUpdateState$1(initHelperText), helperText = _j[0], setHelperText = _j[1];
|
|
5051
5099
|
var _k = useAutoUpdateState$1(initLoading), loading = _k[0], setLoading = _k[1];
|
|
5052
5100
|
var _l = useAutoUpdateState$1(initDisabled), disabled = _l[0], setDisabled = _l[1];
|
|
5101
|
+
var _m = useAutoUpdateState$1(initData), data = _m[0], setData = _m[1];
|
|
5053
5102
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
5054
5103
|
var itemsValues = useMemo(function () {
|
|
5055
5104
|
if (items) {
|
|
@@ -5135,7 +5184,7 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default.forwardRef(fu
|
|
|
5135
5184
|
return onValue ? onValue(finalValue) : finalValue;
|
|
5136
5185
|
}, [multiple, formValueSeparator, itemsValues, onValue]);
|
|
5137
5186
|
// State - value ---------------------------------------------------------------------------------------------------
|
|
5138
|
-
var
|
|
5187
|
+
var _o = useAutoUpdateState$1(initValue, getFinalValue), value = _o[0], setValue = _o[1];
|
|
5139
5188
|
// Effect ----------------------------------------------------------------------------------------------------------
|
|
5140
5189
|
useEffect(function () {
|
|
5141
5190
|
if (value !== initValue) {
|
|
@@ -5210,6 +5259,7 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default.forwardRef(fu
|
|
|
5210
5259
|
useLayoutEffect(function () {
|
|
5211
5260
|
if (ref || onAddValueItem) {
|
|
5212
5261
|
var lastValue_1 = value;
|
|
5262
|
+
var lastData_1 = data;
|
|
5213
5263
|
var lastItems_1 = items;
|
|
5214
5264
|
var lastLoading_1 = loading;
|
|
5215
5265
|
var lastDisabled_1 = !!disabled;
|
|
@@ -5226,6 +5276,11 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default.forwardRef(fu
|
|
|
5226
5276
|
lastValue_1 = getFinalValue(value);
|
|
5227
5277
|
setValue(lastValue_1);
|
|
5228
5278
|
},
|
|
5279
|
+
getData: function () { return lastData_1; },
|
|
5280
|
+
setData: function (data) {
|
|
5281
|
+
lastData_1 = data;
|
|
5282
|
+
setData(data);
|
|
5283
|
+
},
|
|
5229
5284
|
isExceptValue: function () { return !!exceptValue; },
|
|
5230
5285
|
isDisabled: function () { return lastDisabled_1; },
|
|
5231
5286
|
setDisabled: function (disabled) {
|
|
@@ -5299,6 +5354,8 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default.forwardRef(fu
|
|
|
5299
5354
|
initHelperText,
|
|
5300
5355
|
setItems,
|
|
5301
5356
|
setLoading,
|
|
5357
|
+
data,
|
|
5358
|
+
setData,
|
|
5302
5359
|
]);
|
|
5303
5360
|
// Event Handler ---------------------------------------------------------------------------------------------------
|
|
5304
5361
|
var handleChange = useCallback(function (e, newValue) {
|
|
@@ -5413,7 +5470,7 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5413
5470
|
//----------------------------------------------------------------------------------------------------------------
|
|
5414
5471
|
precision = _a.precision, highlightSelectedOnly = _a.highlightSelectedOnly, icon = _a.icon, emptyIcon = _a.emptyIcon, max = _a.max, hidden = _a.hidden,
|
|
5415
5472
|
//----------------------------------------------------------------------------------------------------------------
|
|
5416
|
-
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,
|
|
5473
|
+
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, initData = _a.data, exceptValue = _a.exceptValue, onChange = _a.onChange, onValidate = _a.onValidate, onValue = _a.onValue,
|
|
5417
5474
|
//----------------------------------------------------------------------------------------------------------------
|
|
5418
5475
|
className = _a.className, initStyle = _a.style, sx = _a.sx;
|
|
5419
5476
|
var id = useId();
|
|
@@ -5431,14 +5488,15 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5431
5488
|
var _d = useAutoUpdateState$1(initError), error = _d[0], setError = _d[1];
|
|
5432
5489
|
var _e = useAutoUpdateState$1(initHelperText), helperText = _e[0], setHelperText = _e[1];
|
|
5433
5490
|
var _f = useAutoUpdateState$1(initDisabled), disabled = _f[0], setDisabled = _f[1];
|
|
5491
|
+
var _g = useAutoUpdateState$1(initData), data = _g[0], setData = _g[1];
|
|
5434
5492
|
// State - width, height -------------------------------------------------------------------------------------------
|
|
5435
|
-
var
|
|
5493
|
+
var _h = useResizeDetector(), width = _h.width, height = _h.height, resizeDetectorRef = _h.ref;
|
|
5436
5494
|
// Function - getFinalValue ----------------------------------------------------------------------------------------
|
|
5437
5495
|
var getFinalValue = useCallback(function (value) {
|
|
5438
5496
|
return onValue ? onValue(value) : value;
|
|
5439
5497
|
}, [onValue]);
|
|
5440
5498
|
// State - value ---------------------------------------------------------------------------------------------------
|
|
5441
|
-
var
|
|
5499
|
+
var _j = useAutoUpdateState$1(initValue || 0, getFinalValue), value = _j[0], setValue = _j[1];
|
|
5442
5500
|
useFirstSkipEffect$1(function () {
|
|
5443
5501
|
if (error)
|
|
5444
5502
|
validate(value);
|
|
@@ -5491,6 +5549,7 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5491
5549
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
5492
5550
|
useLayoutEffect(function () {
|
|
5493
5551
|
var lastValue = value;
|
|
5552
|
+
var lastData = data;
|
|
5494
5553
|
var lastDisabled = !!disabled;
|
|
5495
5554
|
var commands = {
|
|
5496
5555
|
getType: function () { return 'FormRating'; },
|
|
@@ -5505,6 +5564,11 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5505
5564
|
lastValue = getFinalValue(value);
|
|
5506
5565
|
setValue(lastValue);
|
|
5507
5566
|
},
|
|
5567
|
+
getData: function () { return lastData; },
|
|
5568
|
+
setData: function (data) {
|
|
5569
|
+
lastData = data;
|
|
5570
|
+
setData(data);
|
|
5571
|
+
},
|
|
5508
5572
|
isExceptValue: function () { return !!exceptValue; },
|
|
5509
5573
|
isDisabled: function () { return lastDisabled; },
|
|
5510
5574
|
setDisabled: function (disabled) {
|
|
@@ -5555,6 +5619,8 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5555
5619
|
setValue,
|
|
5556
5620
|
setDisabled,
|
|
5557
5621
|
setErrorHelperText,
|
|
5622
|
+
data,
|
|
5623
|
+
setData,
|
|
5558
5624
|
]);
|
|
5559
5625
|
// Event Handler ---------------------------------------------------------------------------------------------------
|
|
5560
5626
|
var handleChange = useCallback(function (e, value) {
|
|
@@ -7306,7 +7372,7 @@ styleInject(css_248z$a);var FormTextEditor = React__default.forwardRef(function
|
|
|
7306
7372
|
//----------------------------------------------------------------------------------------------------------------
|
|
7307
7373
|
menubar = _a.menubar, height = _a.height, hidden = _a.hidden, onImageUpload = _a.onImageUpload,
|
|
7308
7374
|
//----------------------------------------------------------------------------------------------------------------
|
|
7309
|
-
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,
|
|
7375
|
+
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, initData = _a.data, exceptValue = _a.exceptValue, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
7310
7376
|
//----------------------------------------------------------------------------------------------------------------
|
|
7311
7377
|
className = _a.className;
|
|
7312
7378
|
var id = useId();
|
|
@@ -7335,6 +7401,7 @@ styleInject(css_248z$a);var FormTextEditor = React__default.forwardRef(function
|
|
|
7335
7401
|
var _f = useAutoUpdateState$1(initHelperText), helperText = _f[0], setHelperText = _f[1];
|
|
7336
7402
|
var _g = useState(false), initialized = _g[0], setInitialized = _g[1];
|
|
7337
7403
|
var _h = useAutoUpdateState$1(initDisabled), disabled = _h[0], setDisabled = _h[1];
|
|
7404
|
+
var _j = useAutoUpdateState$1(initData), data = _j[0], setData = _j[1];
|
|
7338
7405
|
// Function - focus ------------------------------------------------------------------------------------------------
|
|
7339
7406
|
var focus = useCallback(function () {
|
|
7340
7407
|
var _a, _b;
|
|
@@ -7376,6 +7443,7 @@ styleInject(css_248z$a);var FormTextEditor = React__default.forwardRef(function
|
|
|
7376
7443
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
7377
7444
|
useLayoutEffect(function () {
|
|
7378
7445
|
var lastValue = value;
|
|
7446
|
+
var lastData = data;
|
|
7379
7447
|
var lastDisabled = !!disabled;
|
|
7380
7448
|
var commands = {
|
|
7381
7449
|
getType: function () { return 'FormTextEditor'; },
|
|
@@ -7390,6 +7458,11 @@ styleInject(css_248z$a);var FormTextEditor = React__default.forwardRef(function
|
|
|
7390
7458
|
lastValue = value;
|
|
7391
7459
|
setValue(lastValue);
|
|
7392
7460
|
},
|
|
7461
|
+
getData: function () { return lastData; },
|
|
7462
|
+
setData: function (data) {
|
|
7463
|
+
lastData = data;
|
|
7464
|
+
setData(data);
|
|
7465
|
+
},
|
|
7393
7466
|
isExceptValue: function () { return !!exceptValue; },
|
|
7394
7467
|
isDisabled: function () { return lastDisabled; },
|
|
7395
7468
|
setDisabled: function (disabled) {
|
|
@@ -7439,6 +7512,8 @@ styleInject(css_248z$a);var FormTextEditor = React__default.forwardRef(function
|
|
|
7439
7512
|
setValue,
|
|
7440
7513
|
setDisabled,
|
|
7441
7514
|
setErrorHelperText,
|
|
7515
|
+
data,
|
|
7516
|
+
setData,
|
|
7442
7517
|
]);
|
|
7443
7518
|
// Event Handler ---------------------------------------------------------------------------------------------------
|
|
7444
7519
|
var handleEditorChange = useCallback(function (value) {
|
|
@@ -7491,7 +7566,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
7491
7566
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
7492
7567
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
7493
7568
|
//----------------------------------------------------------------------------------------------------------------
|
|
7494
|
-
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,
|
|
7569
|
+
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, initLoading = _a.loading, initItems = _a.items, initValue = _a.value, initData = _a.data, 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,
|
|
7495
7570
|
//----------------------------------------------------------------------------------------------------------------
|
|
7496
7571
|
onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate,
|
|
7497
7572
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -7518,6 +7593,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
7518
7593
|
var _g = useAutoUpdateState$1(initLoading), loading = _g[0], setLoading = _g[1];
|
|
7519
7594
|
var _h = useAutoUpdateState$1(initDisabled), disabled = _h[0], setDisabled = _h[1];
|
|
7520
7595
|
var _j = useState(undefined), inputValue = _j[0], setInputValue = _j[1];
|
|
7596
|
+
var _k = useAutoUpdateState$1(initData), data = _k[0], setData = _k[1];
|
|
7521
7597
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
7522
7598
|
var itemsValues = useMemo(function () {
|
|
7523
7599
|
if (items) {
|
|
@@ -7590,8 +7666,8 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
7590
7666
|
return onValue ? onValue(finalValue) : finalValue;
|
|
7591
7667
|
}, [multiple, formValueSeparator, itemsValues, onValue]);
|
|
7592
7668
|
// State - value ---------------------------------------------------------------------------------------------------
|
|
7593
|
-
var
|
|
7594
|
-
var
|
|
7669
|
+
var _l = useAutoUpdateState$1(initValue, getFinalValue), value = _l[0], setValue = _l[1];
|
|
7670
|
+
var _m = useState(null), valueItem = _m[0], setValueItem = _m[1];
|
|
7595
7671
|
var componentValue = useMemo(function () {
|
|
7596
7672
|
var finalValue = value;
|
|
7597
7673
|
if (finalValue != null) {
|
|
@@ -7777,6 +7853,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
7777
7853
|
useLayoutEffect(function () {
|
|
7778
7854
|
if (ref || onAddValueItem) {
|
|
7779
7855
|
var lastValue_1 = value;
|
|
7856
|
+
var lastData_1 = data;
|
|
7780
7857
|
var lastItems_1 = items;
|
|
7781
7858
|
var lastLoading_1 = loading;
|
|
7782
7859
|
var lastDisabled_1 = !!disabled;
|
|
@@ -7793,6 +7870,11 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
7793
7870
|
lastValue_1 = getFinalValue(value);
|
|
7794
7871
|
setValue(lastValue_1);
|
|
7795
7872
|
},
|
|
7873
|
+
getData: function () { return lastData_1; },
|
|
7874
|
+
setData: function (data) {
|
|
7875
|
+
lastData_1 = data;
|
|
7876
|
+
setData(data);
|
|
7877
|
+
},
|
|
7796
7878
|
isExceptValue: function () { return !!exceptValue; },
|
|
7797
7879
|
isDisabled: function () { return lastDisabled_1; },
|
|
7798
7880
|
setDisabled: function (disabled) {
|
|
@@ -7866,6 +7948,8 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
7866
7948
|
initHelperText,
|
|
7867
7949
|
setItems,
|
|
7868
7950
|
setLoading,
|
|
7951
|
+
data,
|
|
7952
|
+
setData,
|
|
7869
7953
|
]);
|
|
7870
7954
|
// Event Handler ---------------------------------------------------------------------------------------------------
|
|
7871
7955
|
var handleChange = useCallback(function (componentValue, reason, details) {
|
|
@@ -10155,9 +10239,9 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default.forwardRef(functi
|
|
|
10155
10239
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
10156
10240
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
10157
10241
|
//--------------------------------------------------------------------------------------------------------------------
|
|
10158
|
-
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,
|
|
10242
|
+
name = _a.name, type = _a.type, time = _a.time, initValue = _a.value, initData = _a.data, 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,
|
|
10159
10243
|
//--------------------------------------------------------------------------------------------------------------------
|
|
10160
|
-
className = _a.className, initStyle = _a.style, sx = _a.sx, otherProps = __rest$3(_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"]);
|
|
10244
|
+
className = _a.className, initStyle = _a.style, sx = _a.sx, otherProps = __rest$3(_a, ["variant", "size", "color", "focused", "labelShrink", "fullWidth", "name", "type", "time", "value", "data", "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"]);
|
|
10161
10245
|
var id = useId();
|
|
10162
10246
|
// Ref -------------------------------------------------------------------------------------------------------------
|
|
10163
10247
|
var privateStaticDatePickerRef = useRef(null);
|
|
@@ -10182,6 +10266,7 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default.forwardRef(functi
|
|
|
10182
10266
|
var _e = useState(null), timeError = _e[0], setTimeError = _e[1];
|
|
10183
10267
|
var _f = useAutoUpdateState$1(initHelperText), helperText = _f[0], setHelperText = _f[1];
|
|
10184
10268
|
var _g = useAutoUpdateState$1(initDisabled), disabled = _g[0], setDisabled = _g[1];
|
|
10269
|
+
var _h = useAutoUpdateState$1(initData), data = _h[0], setData = _h[1];
|
|
10185
10270
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
10186
10271
|
var label = useMemo(function () {
|
|
10187
10272
|
if (labelIcon) {
|
|
@@ -10222,8 +10307,8 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default.forwardRef(functi
|
|
|
10222
10307
|
return value;
|
|
10223
10308
|
}, []);
|
|
10224
10309
|
// State - value ---------------------------------------------------------------------------------------------------
|
|
10225
|
-
var
|
|
10226
|
-
var
|
|
10310
|
+
var _j = useAutoUpdateState$1(initValue || null, getFinalValue), value = _j[0], setValue = _j[1];
|
|
10311
|
+
var _k = useState(null), inputValue = _k[0], setInputValue = _k[1];
|
|
10227
10312
|
// Effect ----------------------------------------------------------------------------------------------------------
|
|
10228
10313
|
useEffect(function () {
|
|
10229
10314
|
if (value !== initValue) {
|
|
@@ -10331,6 +10416,7 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default.forwardRef(functi
|
|
|
10331
10416
|
useLayoutEffect(function () {
|
|
10332
10417
|
if (ref || onAddValueItem) {
|
|
10333
10418
|
var lastValue_1 = value;
|
|
10419
|
+
var lastData_1 = data;
|
|
10334
10420
|
var lastDisabled_1 = !!disabled;
|
|
10335
10421
|
var commands = {
|
|
10336
10422
|
getType: function () { return 'default'; },
|
|
@@ -10345,6 +10431,11 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default.forwardRef(functi
|
|
|
10345
10431
|
lastValue_1 = getFinalValue(value);
|
|
10346
10432
|
setValue(lastValue_1);
|
|
10347
10433
|
},
|
|
10434
|
+
getData: function () { return lastData_1; },
|
|
10435
|
+
setData: function (data) {
|
|
10436
|
+
lastData_1 = data;
|
|
10437
|
+
setData(data);
|
|
10438
|
+
},
|
|
10348
10439
|
isExceptValue: function () { return !!exceptValue; },
|
|
10349
10440
|
isDisabled: function () { return lastDisabled_1; },
|
|
10350
10441
|
setDisabled: function (disabled) {
|
|
@@ -10400,6 +10491,8 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default.forwardRef(functi
|
|
|
10400
10491
|
setDisabled,
|
|
10401
10492
|
setErrorHelperText,
|
|
10402
10493
|
initHelperText,
|
|
10494
|
+
data,
|
|
10495
|
+
setData,
|
|
10403
10496
|
]);
|
|
10404
10497
|
// Event Handler ---------------------------------------------------------------------------------------------------
|
|
10405
10498
|
var handleChange = useCallback(function (unit, newValue, keyboardInputValue) {
|
|
@@ -11113,7 +11206,7 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
11113
11206
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
11114
11207
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
11115
11208
|
//--------------------------------------------------------------------------------------------------------------------
|
|
11116
|
-
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,
|
|
11209
|
+
name = _a.name, initValue = _a.value, initData = _a.data, 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,
|
|
11117
11210
|
// -------------------------------------------------------------------------------------------------------------------
|
|
11118
11211
|
className = _a.className;
|
|
11119
11212
|
var id = useId();
|
|
@@ -11141,6 +11234,7 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
11141
11234
|
var _e = useState(false), endError = _e[0], setEndError = _e[1];
|
|
11142
11235
|
var _f = useAutoUpdateState$1(initDisabled), disabled = _f[0], setDisabled = _f[1];
|
|
11143
11236
|
var _g = useAutoUpdateState$1(initHelperText), helperText = _g[0], setHelperText = _g[1];
|
|
11237
|
+
var _h = useAutoUpdateState$1(initData), data = _h[0], setData = _h[1];
|
|
11144
11238
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
11145
11239
|
var format = useMemo(function () { return initFormat || DEFAULT_FORMAT; }, [initFormat]);
|
|
11146
11240
|
// Function - getFinalValue ----------------------------------------------------------------------------------------
|
|
@@ -11254,16 +11348,16 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
11254
11348
|
(_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.activeMonth(month);
|
|
11255
11349
|
}, [containerRef]);
|
|
11256
11350
|
// State -----------------------------------------------------------------------------------------------------------
|
|
11257
|
-
var
|
|
11258
|
-
var
|
|
11259
|
-
var
|
|
11351
|
+
var _j = useState(false), open = _j[0], setOpen = _j[1];
|
|
11352
|
+
var _k = useState('start'), selectType = _k[0], setSelectType = _k[1];
|
|
11353
|
+
var _l = useAutoUpdateState$1(useCallback(function () {
|
|
11260
11354
|
return initValue || DEFAULT_VALUE;
|
|
11261
|
-
}, [initValue])), value =
|
|
11355
|
+
}, [initValue])), value = _l[0], setValue = _l[1];
|
|
11262
11356
|
var calendarCount = useAutoUpdateState$1(initCalendarCount || 2)[0];
|
|
11263
|
-
var
|
|
11357
|
+
var _m = useState(function () {
|
|
11264
11358
|
var now = dayjs();
|
|
11265
11359
|
return [now, now.add(1, 'month'), now.add(2, 'month')];
|
|
11266
|
-
}), months =
|
|
11360
|
+
}), months = _m[0], setMonths = _m[1];
|
|
11267
11361
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
11268
11362
|
var inputDatePickerProps = useMemo(function () { return ({
|
|
11269
11363
|
variant: variant,
|
|
@@ -11509,6 +11603,7 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
11509
11603
|
useLayoutEffect(function () {
|
|
11510
11604
|
if (ref || onAddValueItem) {
|
|
11511
11605
|
var lastValue_1 = value;
|
|
11606
|
+
var lastData_1 = data;
|
|
11512
11607
|
var lastDisabled_1 = !!disabled;
|
|
11513
11608
|
var commands = {
|
|
11514
11609
|
getType: function () { return 'FormDateRangePicker'; },
|
|
@@ -11523,6 +11618,11 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
11523
11618
|
lastValue_1 = getFinalValue(value);
|
|
11524
11619
|
setValue(lastValue_1);
|
|
11525
11620
|
},
|
|
11621
|
+
getData: function () { return lastData_1; },
|
|
11622
|
+
setData: function (data) {
|
|
11623
|
+
lastData_1 = data;
|
|
11624
|
+
setData(data);
|
|
11625
|
+
},
|
|
11526
11626
|
getStartValue: function () { return lastValue_1[0]; },
|
|
11527
11627
|
setStartValue: function (value) {
|
|
11528
11628
|
lastValue_1 = [value, lastValue_1[1]];
|
|
@@ -11603,6 +11703,8 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
11603
11703
|
setDisabled,
|
|
11604
11704
|
setErrorHelperText,
|
|
11605
11705
|
initHelperText,
|
|
11706
|
+
data,
|
|
11707
|
+
setData,
|
|
11606
11708
|
]);
|
|
11607
11709
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
11608
11710
|
return (React__default.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: dayjsLocale },
|
|
@@ -11685,7 +11787,7 @@ styleInject(css_248z$1);var FormFile = React__default.forwardRef(function (_a, r
|
|
|
11685
11787
|
//----------------------------------------------------------------------------------------------------------------
|
|
11686
11788
|
accept = _a.accept, hideUrl = _a.hideUrl, hideLink = _a.hideLink, maxFileSize = _a.maxFileSize, preview = _a.preview, hidden = _a.hidden, onFile = _a.onFile, onLink = _a.onLink,
|
|
11687
11789
|
//----------------------------------------------------------------------------------------------------------------
|
|
11688
|
-
name = _a.name, labelIcon = _a.labelIcon, initLabel = _a.label, required = _a.required, readOnly = _a.readOnly, initDisabled = _a.disabled, initError = _a.error, initHelperText = _a.helperText, initValue = _a.value, exceptValue = _a.exceptValue, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
11790
|
+
name = _a.name, labelIcon = _a.labelIcon, initLabel = _a.label, required = _a.required, readOnly = _a.readOnly, initDisabled = _a.disabled, initError = _a.error, initHelperText = _a.helperText, initValue = _a.value, initData = _a.data, exceptValue = _a.exceptValue, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
11689
11791
|
//----------------------------------------------------------------------------------------------------------------
|
|
11690
11792
|
className = _a.className;
|
|
11691
11793
|
var id = useId();
|
|
@@ -11716,7 +11818,8 @@ styleInject(css_248z$1);var FormFile = React__default.forwardRef(function (_a, r
|
|
|
11716
11818
|
var _e = useAutoUpdateState$1(initHelperText), helperText = _e[0], setHelperText = _e[1];
|
|
11717
11819
|
var _f = useAutoUpdateState$1(initDisabled), disabled = _f[0], setDisabled = _f[1];
|
|
11718
11820
|
var _g = useState(false), isOpenLinkDialog = _g[0], setIsOpenLinkDialog = _g[1];
|
|
11719
|
-
var _h =
|
|
11821
|
+
var _h = useAutoUpdateState$1(initData), data = _h[0], setData = _h[1];
|
|
11822
|
+
var _j = useState({ open: false }), alertDialogProps = _j[0], setAlertDialogProps = _j[1];
|
|
11720
11823
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
11721
11824
|
var label = useMemo(function () {
|
|
11722
11825
|
return labelIcon ? (React__default.createElement(React__default.Fragment, null,
|
|
@@ -11764,6 +11867,7 @@ styleInject(css_248z$1);var FormFile = React__default.forwardRef(function (_a, r
|
|
|
11764
11867
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
11765
11868
|
useLayoutEffect(function () {
|
|
11766
11869
|
var lastValue = value;
|
|
11870
|
+
var lastData = data;
|
|
11767
11871
|
var lastDisabled = !!disabled;
|
|
11768
11872
|
var commands = {
|
|
11769
11873
|
getType: function () { return 'FormFile'; },
|
|
@@ -11778,6 +11882,11 @@ styleInject(css_248z$1);var FormFile = React__default.forwardRef(function (_a, r
|
|
|
11778
11882
|
lastValue = value;
|
|
11779
11883
|
setValue(lastValue);
|
|
11780
11884
|
},
|
|
11885
|
+
getData: function () { return lastData; },
|
|
11886
|
+
setData: function (data) {
|
|
11887
|
+
lastData = data;
|
|
11888
|
+
setData(data);
|
|
11889
|
+
},
|
|
11781
11890
|
isExceptValue: function () { return !!exceptValue; },
|
|
11782
11891
|
isDisabled: function () { return lastDisabled; },
|
|
11783
11892
|
setDisabled: function (disabled) {
|
|
@@ -11827,6 +11936,8 @@ styleInject(css_248z$1);var FormFile = React__default.forwardRef(function (_a, r
|
|
|
11827
11936
|
setValue,
|
|
11828
11937
|
setDisabled,
|
|
11829
11938
|
setErrorHelperText,
|
|
11939
|
+
data,
|
|
11940
|
+
setData,
|
|
11830
11941
|
]);
|
|
11831
11942
|
// Function --------------------------------------------------------------------------------------------------------
|
|
11832
11943
|
var fileSizeCheck = useCallback(function (file) {
|