@pdg/react-form 1.0.15 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -106,112 +106,7 @@ function __makeTemplateObject(cooked, raw) {
106
106
  }());
107
107
  } (classnames$1));
108
108
 
109
- var classNames$1 = classnames$1.exports;function useFirstSkipEffect$1(effect, deps) {
110
- var firstRef = React.useRef(true);
111
- React.useEffect(function () {
112
- if (firstRef.current) {
113
- firstRef.current = false;
114
- }
115
- else {
116
- effect();
117
- }
118
- }, deps);
119
- }var isSame$2 = function (v1, v2) {
120
- if (v1 === v2)
121
- return true;
122
- if (typeof v1 !== typeof v2)
123
- return false;
124
- if (v1 == null || v2 == null)
125
- return false;
126
- if (Array.isArray(v1) && Array.isArray(v2)) {
127
- if (v1.length !== v2.length)
128
- return false;
129
- for (var i = 0; i < v1.length; i += 1) {
130
- if (v1[i] !== v2[i])
131
- return false;
132
- }
133
- }
134
- else {
135
- return v1 === v2;
136
- }
137
- return true;
138
- };function useAutoUpdateState$1(p1, p2) {
139
- var state = typeof p1 === 'function' ? undefined : p1;
140
- var finalStateCallback = typeof p1 === 'function' ? p1 : p2;
141
- var _a = React.useState(0), setUpdateKey = _a[1];
142
- var _initState = React.useState(function () {
143
- return finalStateCallback ? finalStateCallback(state) : state;
144
- })[0];
145
- var _state = React.useRef(_initState);
146
- var forceUpdate = React.useCallback(function () {
147
- setUpdateKey(function (updateKey) { return updateKey + 1; });
148
- }, []);
149
- useFirstSkipEffect$1(function () {
150
- var newState = finalStateCallback ? finalStateCallback(state) : state;
151
- if (!isSame$2(newState, _state.current)) {
152
- _state.current = newState;
153
- forceUpdate();
154
- }
155
- }, [state]);
156
- useFirstSkipEffect$1(function () {
157
- var newState = finalStateCallback ? finalStateCallback(_state.current) : _state.current;
158
- if (!isSame$2(newState, _state.current)) {
159
- _state.current = newState;
160
- forceUpdate();
161
- }
162
- }, [finalStateCallback]);
163
- var setState = React.useCallback(function (newState) {
164
- var finalNewState = typeof newState === 'function' ? newState(_state.current) : newState;
165
- if (!isSame$2(_state.current, finalNewState)) {
166
- _state.current = finalNewState;
167
- forceUpdate();
168
- }
169
- }, []);
170
- return [_state.current, setState];
171
- }function useFirstSkipLayoutEffect(effect, deps) {
172
- var firstRef = React.useRef(true);
173
- React.useLayoutEffect(function () {
174
- if (firstRef.current) {
175
- firstRef.current = false;
176
- }
177
- else {
178
- effect();
179
- }
180
- }, deps);
181
- }function useAutoUpdateLayoutState(p1, p2) {
182
- var state = typeof p1 === 'function' ? undefined : p1;
183
- var finalStateCallback = typeof p1 === 'function' ? p1 : p2;
184
- var _a = React.useState(0), setUpdateKey = _a[1];
185
- var _initState = React.useState(function () {
186
- return finalStateCallback ? finalStateCallback(state, 0) : state;
187
- })[0];
188
- var _state = React.useRef(_initState);
189
- var forceUpdate = React.useCallback(function () {
190
- setUpdateKey(function (updateKey) { return updateKey + 1; });
191
- }, []);
192
- useFirstSkipLayoutEffect(function () {
193
- var newState = finalStateCallback ? finalStateCallback(state) : state;
194
- if (!isSame$2(newState, _state.current)) {
195
- _state.current = newState;
196
- forceUpdate();
197
- }
198
- }, [state]);
199
- useFirstSkipLayoutEffect(function () {
200
- var newState = finalStateCallback ? finalStateCallback(_state.current) : _state.current;
201
- if (!isSame$2(newState, _state.current)) {
202
- _state.current = newState;
203
- forceUpdate();
204
- }
205
- }, [finalStateCallback]);
206
- var setState = React.useCallback(function (newState) {
207
- var finalNewState = typeof newState === 'function' ? newState(_state.current) : newState;
208
- if (!isSame$2(_state.current, finalNewState)) {
209
- _state.current = finalNewState;
210
- forceUpdate();
211
- }
212
- }, []);
213
- return [_state.current, setState];
214
- }var empty$1 = function (v) {
109
+ var classNames$1 = classnames$1.exports;var empty$1 = function (v) {
215
110
  var result = false;
216
111
  if (v == null) {
217
112
  result = true;
@@ -232,7 +127,7 @@ var classNames$1 = classnames$1.exports;function useFirstSkipEffect$1(effect, de
232
127
  var notEmpty = function (v) {
233
128
  return !empty$1(v);
234
129
  };
235
- var isSame$1 = function (v1, v2) {
130
+ var isSame$2 = function (v1, v2) {
236
131
  if (v1 === v2)
237
132
  return true;
238
133
  if (typeof v1 !== typeof v2)
@@ -587,15 +482,15 @@ function checkDateAvailable(date, availableDate, type, time) {
587
482
  //----------------------------------------------------------------------------------------------------------------
588
483
  onSubmit = _a.onSubmit, onValueChange = _a.onValueChange, onValueChangeByUser = _a.onValueChangeByUser;
589
484
  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$2(_b, ["id", "variant", "size", "color", "spacing", "formColGap", "focused", "labelShrink", "fullWidth", "onAddValueItem", "onRemoveValueItem", "onValueChange", "onValueChangeByUser"]);
590
- // State - FormState -----------------------------------------------------------------------------------------------
591
- var variant = useAutoUpdateState$1(initVariant || formVariant)[0];
592
- var size = useAutoUpdateState$1(initSize || formSize)[0];
593
- var color = useAutoUpdateState$1(initColor || formColor)[0];
594
- var spacing = useAutoUpdateState$1(initSpacing == null ? formSpacing : initSpacing)[0];
595
- var formColGap = useAutoUpdateState$1(initFormColGap == null ? formFormColGap : initFormColGap)[0];
596
- var focused = useAutoUpdateState$1(initFocused || formFocused)[0];
597
- var labelShrink = useAutoUpdateState$1(initLabelShrink || formLabelShrink)[0];
598
- var fullWidth = useAutoUpdateState$1(initFullWidth == null ? formFullWidth : initFullWidth)[0];
485
+ // Memo - FormState ------------------------------------------------------------------------------------------------
486
+ var variant = React.useMemo(function () { return (initVariant == null ? formVariant : initVariant); }, [initVariant, formVariant]);
487
+ var size = React.useMemo(function () { return (initSize == null ? formSize : initSize); }, [initSize, formSize]);
488
+ var color = React.useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
489
+ var spacing = React.useMemo(function () { return initSpacing || formSpacing; }, [initSpacing, formSpacing]);
490
+ var formColGap = React.useMemo(function () { return (initFormColGap == null ? formFormColGap : initFormColGap); }, [initFormColGap, formFormColGap]);
491
+ var focused = React.useMemo(function () { return (initFocused == null ? formFocused : initFocused); }, [initFocused, formFocused]);
492
+ var labelShrink = React.useMemo(function () { return (initLabelShrink == null ? formLabelShrink : initLabelShrink); }, [initLabelShrink, formLabelShrink]);
493
+ var fullWidth = React.useMemo(function () { return (initFullWidth == null ? formFullWidth : initFullWidth); }, [initFullWidth, formFullWidth]);
599
494
  // Ref -------------------------------------------------------------------------------------------------------------
600
495
  var formRef = React.useRef(null);
601
496
  // State -----------------------------------------------------------------------------------------------------------
@@ -685,7 +580,7 @@ function checkDateAvailable(date, availableDate, type, time) {
685
580
  }
686
581
  });
687
582
  return data;
688
- }, [valueItems, getItemFormValue]);
583
+ }, [valueItems, appendFormValueData]);
689
584
  // Function - submit -----------------------------------------------------------------------------------------------
690
585
  var submit = React.useCallback(function () {
691
586
  var isAllValid = true;
@@ -919,11 +814,9 @@ Form.displayName = 'Form';
919
814
  Form.defaultProps = FormDefaultProps;var FormButtonDefaultProps = {
920
815
  type: 'button',
921
816
  };var FormIconDefaultProps = {};var FormIcon = React__default["default"].forwardRef(function (_a, ref) {
922
- // State - children ------------------------------------------------------------------------------------------------
817
+ // Memo --------------------------------------------------------------------------------------------------------------
923
818
  var className = _a.className, initChildren = _a.children, props = __rest$2(_a, ["className", "children"]);
924
- var children = useAutoUpdateState$1(React.useCallback(function () {
925
- return initChildren.replace(/[A-Z]/g, function (letter, idx) { return "".concat(idx > 0 ? '_' : '').concat(letter.toLowerCase()); });
926
- }, [initChildren]))[0];
819
+ var children = React.useMemo(function () { return initChildren.replace(/[A-Z]/g, function (letter, idx) { return "".concat(idx > 0 ? '_' : '').concat(letter.toLowerCase()); }); }, [initChildren]);
927
820
  // Render ----------------------------------------------------------------------------------------------------------
928
821
  return (React__default["default"].createElement(material.Icon, __assign$4({ ref: ref }, props, { className: classNames$1('FormIcon', className) }), children));
929
822
  });
@@ -932,12 +825,12 @@ FormIcon.defaultProps = FormIconDefaultProps;var FormButton = React__default["de
932
825
  // FormState -------------------------------------------------------------------------------------------------------
933
826
  var initSize = _a.size, initColor = _a.color, initVariant = _a.variant, initFullWidth = _a.fullWidth, children = _a.children, className = _a.className, type = _a.type, icon = _a.icon, startIcon = _a.startIcon, endIcon = _a.endIcon, onClick = _a.onClick, props = __rest$2(_a, ["size", "color", "variant", "fullWidth", "children", "className", "type", "icon", "startIcon", "endIcon", "onClick"]);
934
827
  var _b = useFormState(), formSize = _b.size, formColor = _b.color, formFullWidth = _b.fullWidth;
935
- // State - FormState -----------------------------------------------------------------------------------------------
936
- var size = useAutoUpdateState$1(initSize || formSize)[0];
937
- var color = useAutoUpdateState$1(initColor || formColor)[0];
938
- var fullWidth = useAutoUpdateState$1(initFullWidth == null ? formFullWidth : initFullWidth)[0];
939
- // State - variant -------------------------------------------------------------------------------------------------
940
- var variant = useAutoUpdateState$1(React.useCallback(function () {
828
+ // Memo - FormState ------------------------------------------------------------------------------------------------
829
+ var size = React.useMemo(function () { return (initSize == null ? formSize : initSize); }, [initSize, formSize]);
830
+ var color = React.useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
831
+ var fullWidth = React.useMemo(function () { return (initFullWidth == null ? formFullWidth : initFullWidth); }, [initFullWidth, formFullWidth]);
832
+ // Memo ------------------------------------------------------------------------------------------------------------
833
+ var variant = React.useMemo(function () {
941
834
  if (initVariant) {
942
835
  return initVariant;
943
836
  }
@@ -949,54 +842,72 @@ FormIcon.defaultProps = FormIconDefaultProps;var FormButton = React__default["de
949
842
  return 'outlined';
950
843
  }
951
844
  }
952
- }, [initVariant, type]))[0];
845
+ }, [initVariant, type]);
953
846
  // Render ----------------------------------------------------------------------------------------------------------
954
847
  return (React__default["default"].createElement(material.Button, __assign$4({ ref: ref, className: classNames$1(className, 'FormButton'), type: type, variant: variant, size: size, color: color, fullWidth: fullWidth, onClick: onClick, startIcon: startIcon ? React__default["default"].createElement(FormIcon, { sx: { mr: -0.5 } }, startIcon) : undefined, endIcon: endIcon ? React__default["default"].createElement(FormIcon, { sx: { ml: -0.5 } }, endIcon) : undefined }, props),
955
848
  icon && (React__default["default"].createElement(FormIcon, { fontSize: size, color: 'inherit', sx: { mr: children ? 0.5 : undefined } }, icon)),
956
849
  children));
957
850
  });
958
851
  FormButton.displayName = 'FormButton';
959
- FormButton.defaultProps = FormButtonDefaultProps;var FormLabelDefaultProps = {};var FormLabel = React__default["default"].forwardRef(function (_a, ref) {
852
+ FormButton.defaultProps = FormButtonDefaultProps;var FormLabelDefaultProps = {};var IconFormIcon = material.styled(FormIcon)(templateObject_1$4 || (templateObject_1$4 = __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"])));
853
+ var ChildrenSpan = material.styled('span')(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n vertical-align: middle;\n"], ["\n vertical-align: middle;\n"])));
854
+ var templateObject_1$4, templateObject_2;var FormLabel = React__default["default"].forwardRef(function (_a, ref) {
855
+ // Memo --------------------------------------------------------------------------------------------------------------
960
856
  var children = _a.children, icon = _a.icon, size = _a.size, style = _a.style, props = __rest$2(_a, ["children", "icon", "size", "style"]);
961
- return (React__default["default"].createElement(material.InputLabel, __assign$4({ ref: ref, shrink: true, className: 'FormItemBase-InputLabel', size: size === 'medium' ? 'normal' : size }, props, { style: __assign$4({ height: 20, transform: size === 'small' ? 'translate(0, -1.5px) scale(0.7)' : undefined }, style) }), icon ? (React__default["default"].createElement(React__default["default"].Fragment, null,
962
- React__default["default"].createElement(FormIcon, { style: { verticalAlign: 'middle', marginRight: 3, marginTop: -4, marginBottom: -2 } }, icon),
963
- React__default["default"].createElement("span", { style: { verticalAlign: 'middle' } }, children))) : (children)));
857
+ var finalProps = React.useMemo(function () { return (__assign$4(__assign$4({ shrink: true, className: 'FormItemBase-InputLabel', size: size === 'medium' ? 'normal' : size }, props), { style: __assign$4({ height: 20, transform: size === 'small' ? 'translate(0, -1.5px) scale(0.7)' : undefined }, style) })); }, [props, size, style]);
858
+ // Render ------------------------------------------------------------------------------------------------------------
859
+ return (React__default["default"].createElement(material.InputLabel, __assign$4({ ref: ref }, finalProps), icon ? (React__default["default"].createElement(React__default["default"].Fragment, null,
860
+ React__default["default"].createElement(IconFormIcon, null, icon),
861
+ React__default["default"].createElement(ChildrenSpan, null, children))) : (children)));
964
862
  });
965
863
  FormLabel.displayName = 'FormLabel';
966
864
  FormLabel.defaultProps = FormLabelDefaultProps;var FormBlockDefaultProps = {};var FormDividerDefaultProps = {
967
865
  lineVerticalMargin: 9,
968
- };var DEFAULT_LINE_STYLE = { flex: 1, position: 'relative' };
866
+ };var StyledLineDiv = material.styled('div')(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject(["\n border-bottom: thin solid #dfdfdf;\n position: absolute;\n left: 0;\n top: 50%;\n width: 100%;\n"], ["\n border-bottom: thin solid #dfdfdf;\n position: absolute;\n left: 0;\n top: 50%;\n width: 100%;\n"])));
867
+ var templateObject_1$3;var DEFAULT_LINE_STYLE = { flex: 1, position: 'relative' };
969
868
  var FormDivider = React__default["default"].forwardRef(function (_a, ref) {
970
869
  // FormState -------------------------------------------------------------------------------------------------------
971
870
  var initSize = _a.size,
972
871
  //----------------------------------------------------------------------------------------------------------------
973
- icon = _a.icon, label = _a.label, line = _a.line, lineVerticalMargin = _a.lineVerticalMargin, hidden = _a.hidden,
872
+ icon = _a.icon, label = _a.label, line = _a.line, lineVerticalMargin = _a.lineVerticalMargin, hidden = _a.hidden, collapse = _a.collapse, collapseIn = _a.collapseIn, onCollapseChange = _a.onCollapseChange,
974
873
  //----------------------------------------------------------------------------------------------------------------
975
874
  className = _a.className, initStyle = _a.style, sx = _a.sx;
976
875
  var formSize = useFormState().size;
977
- // State - FormState -----------------------------------------------------------------------------------------------
978
- var size = useAutoUpdateState$1(initSize || formSize)[0];
979
- // State - style ---------------------------------------------------------------------------------------------------
980
- var style = useAutoUpdateState$1(React.useCallback(function () {
876
+ // Memo - FormState ------------------------------------------------------------------------------------------------
877
+ var size = React.useMemo(function () { return (initSize == null ? formSize : initSize); }, [initSize, formSize]);
878
+ // Memo --------------------------------------------------------------------------------------------------------------
879
+ var style = React.useMemo(function () {
981
880
  if (hidden) {
982
881
  return __assign$4(__assign$4({}, initStyle), { display: 'none' });
983
882
  }
984
883
  else {
985
884
  return initStyle;
986
885
  }
987
- }, [initStyle, hidden]))[0];
988
- // State - lineStyle -----------------------------------------------------------------------------------------------
989
- var lineStyle = useAutoUpdateState$1(React.useCallback(function () {
886
+ }, [hidden, initStyle]);
887
+ var lineStyle = React.useMemo(function () {
990
888
  if (lineVerticalMargin) {
991
889
  return __assign$4(__assign$4({}, DEFAULT_LINE_STYLE), { marginTop: lineVerticalMargin, marginBottom: lineVerticalMargin });
992
890
  }
993
891
  else {
994
892
  return DEFAULT_LINE_STYLE;
995
893
  }
996
- }, [lineVerticalMargin]))[0];
894
+ }, [lineVerticalMargin]);
895
+ // Event Handler -----------------------------------------------------------------------------------------------------
896
+ var handleClick = React.useCallback(function () {
897
+ if (collapse) {
898
+ onCollapseChange && onCollapseChange(!collapseIn);
899
+ }
900
+ }, [collapse, collapseIn, onCollapseChange]);
997
901
  // Render ----------------------------------------------------------------------------------------------------------
998
- return (React__default["default"].createElement(material.Grid, { ref: ref, item: true, xs: 12, style: style, className: className, sx: sx },
999
- React__default["default"].createElement(material.Box, { sx: { display: 'flex', py: 1, alignItems: 'center', justifyItems: 'center', padding: 0 } },
902
+ return (React__default["default"].createElement(material.Grid, { ref: ref, item: true, xs: 12, style: style, className: classNames$1(className, 'FormDivider'), sx: sx },
903
+ React__default["default"].createElement(material.Box, { sx: {
904
+ display: 'flex',
905
+ py: 1,
906
+ alignItems: 'center',
907
+ justifyItems: 'center',
908
+ padding: 0,
909
+ cursor: collapse ? 'pointer' : undefined,
910
+ }, onClick: handleClick },
1000
911
  icon && (React__default["default"].createElement(FormIcon, { style: { opacity: 0.54, marginRight: 5 }, fontSize: size }, icon)),
1001
912
  label && (React__default["default"].createElement(material.Box, { sx: {
1002
913
  paddingRight: '10px',
@@ -1004,49 +915,134 @@ var FormDivider = React__default["default"].forwardRef(function (_a, ref) {
1004
915
  fontWeight: 700,
1005
916
  fontSize: size === 'small' ? '11.5px' : '12px',
1006
917
  } }, label)),
1007
- line && (React__default["default"].createElement("div", { style: lineStyle },
1008
- React__default["default"].createElement("div", { style: {
1009
- borderBottom: 'thin solid #dfdfdf',
1010
- position: 'absolute',
1011
- left: 0,
1012
- top: '50%',
1013
- width: '100%',
1014
- } }))))));
918
+ (line || collapse) && (React__default["default"].createElement("div", { style: lineStyle },
919
+ React__default["default"].createElement(StyledLineDiv, null))),
920
+ collapse && (React__default["default"].createElement(FormIcon, { sx: { opacity: 0.6, ml: 1 } }, collapseIn ? 'KeyboardDoubleArrowUp' : 'KeyboardDoubleArrowDown')))));
1015
921
  });
1016
922
  FormDivider.displayName = 'FormDivider.';
1017
- FormDivider.defaultProps = FormDividerDefaultProps;var StyledWrapGrid$1 = material.styled(material.Grid)(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n width: 100%;\n"], ["\n width: 100%;\n"])));
923
+ FormDivider.defaultProps = FormDividerDefaultProps;function useFirstSkipEffect$1(effect, deps) {
924
+ var firstRef = React.useRef(true);
925
+ React.useEffect(function () {
926
+ if (firstRef.current) {
927
+ firstRef.current = false;
928
+ }
929
+ else {
930
+ effect();
931
+ }
932
+ }, deps);
933
+ }var isSame$1 = function (v1, v2) {
934
+ if (v1 === v2)
935
+ return true;
936
+ if (typeof v1 !== typeof v2)
937
+ return false;
938
+ if (v1 == null || v2 == null)
939
+ return false;
940
+ if (Array.isArray(v1) && Array.isArray(v2)) {
941
+ if (v1.length !== v2.length)
942
+ return false;
943
+ for (var i = 0; i < v1.length; i += 1) {
944
+ if (v1[i] !== v2[i])
945
+ return false;
946
+ }
947
+ }
948
+ else {
949
+ return v1 === v2;
950
+ }
951
+ return true;
952
+ };function useFirstSkipLayoutEffect(effect, deps) {
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) {
963
+ var state = typeof p1 === 'function' ? undefined : p1;
964
+ var finalStateCallback = typeof p1 === 'function' ? p1 : p2;
965
+ var _a = React.useState(0), setUpdateKey = _a[1];
966
+ var _initState = React.useState(function () {
967
+ return finalStateCallback ? finalStateCallback(state, 0) : state;
968
+ })[0];
969
+ var _state = React.useRef(_initState);
970
+ var forceUpdate = React.useCallback(function () {
971
+ setUpdateKey(function (updateKey) { return updateKey + 1; });
972
+ }, []);
973
+ useFirstSkipLayoutEffect(function () {
974
+ var newState = finalStateCallback ? finalStateCallback(state) : state;
975
+ if (!isSame$1(newState, _state.current)) {
976
+ _state.current = newState;
977
+ forceUpdate();
978
+ }
979
+ }, [state]);
980
+ useFirstSkipLayoutEffect(function () {
981
+ var newState = finalStateCallback ? finalStateCallback(_state.current) : _state.current;
982
+ if (!isSame$1(newState, _state.current)) {
983
+ _state.current = newState;
984
+ forceUpdate();
985
+ }
986
+ }, [finalStateCallback]);
987
+ var setState = React.useCallback(function (newState) {
988
+ var finalNewState = typeof newState === 'function' ? newState(_state.current) : newState;
989
+ if (!isSame$1(_state.current, finalNewState)) {
990
+ _state.current = finalNewState;
991
+ forceUpdate();
992
+ }
993
+ }, []);
994
+ return [_state.current, setState];
995
+ }var StyledWrapGrid$1 = material.styled(material.Grid)(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n width: 100%;\n"], ["\n width: 100%;\n"])));
1018
996
  var templateObject_1$2;var FormBlock = React__default["default"].forwardRef(function (_a, ref) {
1019
997
  // FormState -------------------------------------------------------------------------------------------------------
1020
998
  var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initSpacing = _a.spacing, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
1021
999
  //----------------------------------------------------------------------------------------------------------------
1022
1000
  icon = _a.icon, label = _a.label, line = _a.line, lineVerticalMargin = _a.lineVerticalMargin,
1023
1001
  //----------------------------------------------------------------------------------------------------------------
1024
- hidden = _a.hidden,
1002
+ hidden = _a.hidden, collapse = _a.collapse, initCollapseIn = _a.collapseIn,
1025
1003
  //----------------------------------------------------------------------------------------------------------------
1026
1004
  children = _a.children, className = _a.className, initStyle = _a.style, sx = _a.sx;
1027
1005
  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$2(_b, ["variant", "size", "color", "spacing", "focused", "labelShrink", "fullWidth"]);
1028
- // State - FormState -----------------------------------------------------------------------------------------------
1029
- var variant = useAutoUpdateState$1(initVariant || formVariant)[0];
1030
- var size = useAutoUpdateState$1(initSize || formSize)[0];
1031
- var color = useAutoUpdateState$1(initColor || formColor)[0];
1032
- var spacing = useAutoUpdateState$1(initSpacing == null ? formSpacing : initSpacing)[0];
1033
- var focused = useAutoUpdateState$1(initFocused || formFocused)[0];
1034
- var labelShrink = useAutoUpdateState$1(initLabelShrink || formLabelShrink)[0];
1035
- var fullWidth = useAutoUpdateState$1(initFullWidth == null ? formFullWidth : initFullWidth)[0];
1036
- // State - style ---------------------------------------------------------------------------------------------------
1037
- var style = useAutoUpdateState$1(React.useCallback(function () {
1006
+ // Memo - FormState ------------------------------------------------------------------------------------------------
1007
+ var variant = React.useMemo(function () { return (initVariant == null ? formVariant : initVariant); }, [initVariant, formVariant]);
1008
+ var size = React.useMemo(function () { return (initSize == null ? formSize : initSize); }, [initSize, formSize]);
1009
+ var color = React.useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
1010
+ var spacing = React.useMemo(function () { return initSpacing || formSpacing; }, [initSpacing, formSpacing]);
1011
+ var focused = React.useMemo(function () { return (initFocused == null ? formFocused : initFocused); }, [initFocused, formFocused]);
1012
+ var labelShrink = React.useMemo(function () { return (initLabelShrink == null ? formLabelShrink : initLabelShrink); }, [initLabelShrink, formLabelShrink]);
1013
+ var fullWidth = React.useMemo(function () { return (initFullWidth == null ? formFullWidth : initFullWidth); }, [initFullWidth, formFullWidth]);
1014
+ // State -------------------------------------------------------------------------------------------------------------
1015
+ var _c = useAutoUpdateLayoutState(initCollapseIn), collapseIn = _c[0], setCollapseIn = _c[1];
1016
+ // Memo --------------------------------------------------------------------------------------------------------------
1017
+ var style = React.useMemo(function () {
1038
1018
  if (hidden) {
1039
1019
  return __assign$4(__assign$4({}, initStyle), { display: 'none' });
1040
1020
  }
1041
1021
  else {
1042
1022
  return initStyle;
1043
1023
  }
1044
- }, [initStyle, hidden]))[0];
1024
+ }, [hidden, initStyle]);
1025
+ // Effect ------------------------------------------------------------------------------------------------------------
1026
+ React.useEffect(function () {
1027
+ setCollapseIn(initCollapseIn);
1028
+ }, [initCollapseIn, setCollapseIn]);
1029
+ // Memo --------------------------------------------------------------------------------------------------------------
1030
+ var Container = React.useMemo(function () {
1031
+ return collapse ? material.Collapse : React__default["default"].Fragment;
1032
+ }, [collapse]);
1033
+ var containerProps = React.useMemo(function () {
1034
+ return collapse ? { in: collapseIn } : undefined;
1035
+ }, [collapse, collapseIn]);
1045
1036
  // Render ----------------------------------------------------------------------------------------------------------
1046
1037
  return (React__default["default"].createElement(FormContext.Provider, { value: __assign$4({ variant: variant, size: size, color: color, spacing: spacing, focused: focused, labelShrink: labelShrink, fullWidth: fullWidth }, otherFormState) },
1047
- (icon || label || line) && (React__default["default"].createElement(FormDivider, { size: size, icon: icon, color: color, label: label, line: line, lineVerticalMargin: lineVerticalMargin, hidden: hidden })),
1048
- React__default["default"].createElement(StyledWrapGrid$1, { ref: ref, item: true, xs: 12, className: classNames$1(className, 'FormBlock'), style: style, sx: sx },
1049
- React__default["default"].createElement(material.Grid, { container: true, spacing: spacing }, children))));
1038
+ React__default["default"].createElement(material.Grid, { item: true, ref: ref, xs: 12, className: classNames$1(className, 'FormBlock'), style: style, sx: sx },
1039
+ React__default["default"].createElement(material.Grid, { container: true, spacing: spacing },
1040
+ (icon || label || line || collapse) && (React__default["default"].createElement(FormDivider, { className: 'FormBlock-header', collapse: collapse, collapseIn: collapseIn, size: size, icon: icon, color: color, label: label, line: line, lineVerticalMargin: lineVerticalMargin, hidden: hidden, onCollapseChange: collapse ? function (newCollapseIn) { return setCollapseIn(newCollapseIn); } : undefined })),
1041
+ React__default["default"].createElement(StyledWrapGrid$1, { item: true, xs: 12 },
1042
+ React__default["default"].createElement(Container, __assign$4({}, containerProps),
1043
+ React__default["default"].createElement(material.Grid, { container: true, spacing: spacing },
1044
+ React__default["default"].createElement(StyledWrapGrid$1, { item: true, xs: 12, className: 'FormBlock-body' },
1045
+ React__default["default"].createElement(material.Grid, { className: 'FormBlock-content', container: true, spacing: spacing }, children)))))))));
1050
1046
  });
1051
1047
  FormBlock.displayName = 'FormBlock';
1052
1048
  FormBlock.defaultProps = FormBlockDefaultProps;var FormRowDefaultProps = {};var StyledWrapGrid = material.styled(material.Grid)(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n width: 100%;\n"], ["\n width: 100%;\n"])));
@@ -1060,25 +1056,25 @@ var templateObject_1$1;var FormRow = React__default["default"].forwardRef(functi
1060
1056
  //----------------------------------------------------------------------------------------------------------------
1061
1057
  children = _a.children, className = _a.className, initStyle = _a.style, sx = _a.sx;
1062
1058
  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$2(_b, ["variant", "size", "color", "spacing", "focused", "labelShrink", "fullWidth"]);
1063
- // State - FormState -----------------------------------------------------------------------------------------------
1064
- var variant = useAutoUpdateState$1(initVariant || formVariant)[0];
1065
- var size = useAutoUpdateState$1(initSize || formSize)[0];
1066
- var color = useAutoUpdateState$1(initColor || formColor)[0];
1067
- var spacing = useAutoUpdateState$1(initSpacing == null ? formSpacing : initSpacing)[0];
1068
- var focused = useAutoUpdateState$1(initFocused || formFocused)[0];
1069
- var labelShrink = useAutoUpdateState$1(initLabelShrink || formLabelShrink)[0];
1070
- var fullWidth = useAutoUpdateState$1(initFullWidth == null ? formFullWidth : initFullWidth)[0];
1059
+ // Memo - FormState ------------------------------------------------------------------------------------------------
1060
+ var variant = React.useMemo(function () { return (initVariant == null ? formVariant : initVariant); }, [initVariant, formVariant]);
1061
+ var size = React.useMemo(function () { return (initSize == null ? formSize : initSize); }, [initSize, formSize]);
1062
+ var color = React.useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
1063
+ var spacing = React.useMemo(function () { return initSpacing || formSpacing; }, [initSpacing, formSpacing]);
1064
+ var focused = React.useMemo(function () { return (initFocused == null ? formFocused : initFocused); }, [initFocused, formFocused]);
1065
+ var labelShrink = React.useMemo(function () { return (initLabelShrink == null ? formLabelShrink : initLabelShrink); }, [initLabelShrink, formLabelShrink]);
1066
+ var fullWidth = React.useMemo(function () { return (initFullWidth == null ? formFullWidth : initFullWidth); }, [initFullWidth, formFullWidth]);
1071
1067
  // State -----------------------------------------------------------------------------------------------------------
1072
1068
  var formCols = React.useState({})[0];
1073
1069
  var _c = React.useState(12), formColAutoXs = _c[0], setFormColAutoXs = _c[1];
1074
- // State - style ---------------------------------------------------------------------------------------------------
1075
- var style = useAutoUpdateState$1(React.useCallback(function () {
1070
+ // Memo --------------------------------------------------------------------------------------------------------------
1071
+ var style = React.useMemo(function () {
1076
1072
  var style = __assign$4({ width: '100%' }, initStyle);
1077
1073
  if (hidden) {
1078
1074
  style.display = 'none';
1079
1075
  }
1080
1076
  return style;
1081
- }, [initStyle, hidden]))[0];
1077
+ }, [hidden, initStyle]);
1082
1078
  // Function - makeFormColXs ----------------------------------------------------------------------------------------
1083
1079
  var makeFormColXs = React.useCallback(function () {
1084
1080
  var formColKeys = Object.keys(formCols);
@@ -1092,22 +1088,24 @@ var templateObject_1$1;var FormRow = React__default["default"].forwardRef(functi
1092
1088
  }
1093
1089
  });
1094
1090
  setFormColAutoXs(autoXsCount === 0 ? autoXs : autoXs / autoXsCount);
1095
- }, []);
1091
+ }, [formCols]);
1096
1092
  // Event Handler ---------------------------------------------------------------------------------------------------
1097
1093
  var handleAddFormCol = React.useCallback(function (id, xs) {
1098
1094
  formCols[id] = xs;
1099
1095
  makeFormColXs();
1100
- }, []);
1096
+ }, [formCols, makeFormColXs]);
1101
1097
  var handleRemoveFormCol = React.useCallback(function (id) {
1102
1098
  delete formCols[id];
1103
1099
  makeFormColXs();
1104
- }, []);
1100
+ }, [formCols, makeFormColXs]);
1105
1101
  //------------------------------------------------------------------------------------------------------------------
1106
1102
  return (React__default["default"].createElement(FormContext.Provider, { value: __assign$4({ variant: variant, size: size, color: color, spacing: spacing, focused: focused, labelShrink: labelShrink, fullWidth: fullWidth, formColAutoXs: formColAutoXs, onAddFormCol: handleAddFormCol, onRemoveFormCol: handleRemoveFormCol }, otherFormState) },
1107
- (icon || label || line) && (React__default["default"].createElement(FormDivider, { size: size, icon: icon, color: color, label: label, line: line, lineVerticalMargin: lineVerticalMargin, hidden: hidden })),
1108
- React__default["default"].createElement(StyledWrapGrid, { ref: ref, item: true, className: classNames$1(className, 'FormRow'), xs: 12, style: style, sx: sx },
1109
- React__default["default"].createElement(material.Grid, { container: true, spacing: spacing, direction: 'row', style: { flexWrap: 'nowrap' } }, children),
1110
- helperText && (React__default["default"].createElement(material.FormHelperText, { component: 'div', error: error }, helperText)))));
1103
+ React__default["default"].createElement(material.Grid, { item: true, ref: ref, xs: 12, className: classNames$1(className, 'FormRow'), style: style, sx: sx },
1104
+ React__default["default"].createElement(material.Grid, { container: true, spacing: spacing },
1105
+ (icon || label || line) && (React__default["default"].createElement(FormDivider, { className: classNames$1(className, 'FormRow-header'), size: size, icon: icon, color: color, label: label, line: line, lineVerticalMargin: lineVerticalMargin, hidden: hidden })),
1106
+ React__default["default"].createElement(StyledWrapGrid, { item: true, xs: 12, className: 'FormRow-body' },
1107
+ React__default["default"].createElement(material.Grid, { className: 'FormRow-content', container: true, spacing: spacing, direction: 'row', style: { flexWrap: 'nowrap' } }, children),
1108
+ helperText && (React__default["default"].createElement(material.FormHelperText, { className: 'FormRow-helper-text', component: 'div', error: error }, helperText)))))));
1111
1109
  });
1112
1110
  FormRow.displayName = 'FormRow';
1113
1111
  FormRow.defaultProps = FormRowDefaultProps;/* global Reflect, Promise */
@@ -1967,20 +1965,20 @@ function useResizeDetector(props) {
1967
1965
  var id = React.useId();
1968
1966
  // FormState -------------------------------------------------------------------------------------------------------
1969
1967
  var _b = useFormState(), formVariant = _b.variant, formSize = _b.size, formColor = _b.color, formSpacing = _b.spacing, formFormColGap = _b.formColGap, formFocused = _b.focused, formLabelShrink = _b.labelShrink, formFullWidth = _b.fullWidth, formColAutoXs = _b.formColAutoXs, onAddFormCol = _b.onAddFormCol, onRemoveFormCol = _b.onRemoveFormCol, otherFormState = __rest$2(_b, ["variant", "size", "color", "spacing", "formColGap", "focused", "labelShrink", "fullWidth", "formColAutoXs", "onAddFormCol", "onRemoveFormCol"]);
1970
- // State - FormState -----------------------------------------------------------------------------------------------
1971
- var variant = useAutoUpdateState$1(initVariant || formVariant)[0];
1972
- var size = useAutoUpdateState$1(initSize || formSize)[0];
1973
- var color = useAutoUpdateState$1(initColor || formColor)[0];
1974
- var spacing = useAutoUpdateState$1(initSpacing == null ? formSpacing : initSpacing)[0];
1975
- var focused = useAutoUpdateState$1(initFocused || formFocused)[0];
1976
- var labelShrink = useAutoUpdateState$1(initLabelShrink || formLabelShrink)[0];
1977
- var fullWidth = useAutoUpdateState$1(initFullWidth == null ? formFullWidth : initFullWidth)[0];
1978
- // State - Gap -----------------------------------------------------------------------------------------------------
1979
- var gap = useAutoUpdateState$1(initGap == null ? formFormColGap : initGap)[0];
1968
+ // Memo - FormState ------------------------------------------------------------------------------------------------
1969
+ var variant = React.useMemo(function () { return (initVariant == null ? formVariant : initVariant); }, [initVariant, formVariant]);
1970
+ var size = React.useMemo(function () { return (initSize == null ? formSize : initSize); }, [initSize, formSize]);
1971
+ var color = React.useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
1972
+ var spacing = React.useMemo(function () { return initSpacing || formSpacing; }, [initSpacing, formSpacing]);
1973
+ var focused = React.useMemo(function () { return (initFocused == null ? formFocused : initFocused); }, [initFocused, formFocused]);
1974
+ var labelShrink = React.useMemo(function () { return (initLabelShrink == null ? formLabelShrink : initLabelShrink); }, [initLabelShrink, formLabelShrink]);
1975
+ var fullWidth = React.useMemo(function () { return (initFullWidth == null ? formFullWidth : initFullWidth); }, [initFullWidth, formFullWidth]);
1976
+ // Memo --------------------------------------------------------------------------------------------------------------
1977
+ var gap = React.useMemo(function () { return (initGap == null ? formFormColGap : initGap); }, [formFormColGap, initGap]);
1980
1978
  // ResizeDetector --------------------------------------------------------------------------------------------------
1981
1979
  var _c = useResizeDetector(), formColWidth = _c.width, resizeDetectorRef = _c.ref;
1982
1980
  // State - style ---------------------------------------------------------------------------------------------------
1983
- var style = useAutoUpdateState$1(React.useCallback(function () {
1981
+ var style = useAutoUpdateLayoutState(React.useCallback(function () {
1984
1982
  if (hidden) {
1985
1983
  return __assign$4(__assign$4({}, initStyle), { display: 'none' });
1986
1984
  }
@@ -1996,6 +1994,7 @@ function useResizeDetector(props) {
1996
1994
  if (onRemoveFormCol)
1997
1995
  onRemoveFormCol(id);
1998
1996
  };
1997
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1999
1998
  }, [xs]);
2000
1999
  // Effect ----------------------------------------------------------------------------------------------------------
2001
2000
  React.useEffect(function () {
@@ -2007,17 +2006,18 @@ function useResizeDetector(props) {
2007
2006
  ref.current = resizeDetectorRef.current;
2008
2007
  }
2009
2008
  }
2009
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2010
2010
  }, []);
2011
2011
  // Render ----------------------------------------------------------------------------------------------------------
2012
2012
  return (React__default["default"].createElement(FormContextProvider, { value: __assign$4({ variant: variant, size: size, color: color, spacing: spacing, focused: focused, labelShrink: labelShrink, fullWidth: fullWidth, formColXs: xs || formColAutoXs || 12, formColWidth: formColWidth, formColWithLabel: !!label, formColWithHelperText: !!helperText }, otherFormState) },
2013
2013
  React__default["default"].createElement(material.Grid, { ref: resizeDetectorRef, item: true, xs: xs || formColAutoXs || 12, className: classNames$1(className, 'FormCol', !!label && 'with-label', !!helperText && 'with-helper-text'), style: style, sx: sx },
2014
2014
  React__default["default"].createElement(material.Grid, { container: true, direction: 'column' },
2015
- label && (React__default["default"].createElement(material.Grid, { item: true },
2015
+ label && (React__default["default"].createElement(material.Grid, { item: true, className: 'FormCol-header' },
2016
2016
  React__default["default"].createElement("div", { style: { position: 'relative', height: 20 } },
2017
2017
  React__default["default"].createElement(FormLabel, { className: 'FormCol-FormLabel', size: size, icon: icon, focused: focused, color: color, error: error, style: { position: 'absolute', left: 5, top: 0 } }, label)))),
2018
- React__default["default"].createElement(material.Grid, { item: true, xs: 2 },
2018
+ React__default["default"].createElement(material.Grid, { item: true, xs: 2, className: 'FormCol-content' },
2019
2019
  React__default["default"].createElement(material.Box, { sx: { display: 'flex', flexWrap: 'wrap', gap: gap } }, children)),
2020
- helperText && (React__default["default"].createElement(material.Grid, { item: true },
2020
+ helperText && (React__default["default"].createElement(material.Grid, { item: true, className: 'FormCol-helper-text' },
2021
2021
  React__default["default"].createElement(material.FormHelperText, { component: 'div', error: error, style: { marginLeft: helperTextShift ? 14 : 5 } }, helperText)))))));
2022
2022
  });
2023
2023
  FormCol.displayName = 'FormCol';
@@ -2064,29 +2064,29 @@ styleInject(css_248z$j);var FormTextField = React__default["default"].forwardRef
2064
2064
  var inputRef = React.useRef(null);
2065
2065
  // FormState -------------------------------------------------------------------------------------------------------
2066
2066
  var _c = useFormState(), formVariant = _c.variant, formSize = _c.size, formColor = _c.color, formFocused = _c.focused, formLabelShrink = _c.labelShrink, formFullWidth = _c.fullWidth, formColWithHelperText = _c.formColWithHelperText, onAddValueItem = _c.onAddValueItem, onRemoveValueItem = _c.onRemoveValueItem, onValueChange = _c.onValueChange, onValueChangeByUser = _c.onValueChangeByUser, onRequestSearchSubmit = _c.onRequestSearchSubmit;
2067
- // State - FormState -----------------------------------------------------------------------------------------------
2068
- var variant = useAutoUpdateState$1(initVariant || formVariant)[0];
2069
- var size = useAutoUpdateState$1(initSize || formSize)[0];
2070
- var color = useAutoUpdateState$1(initColor || formColor)[0];
2071
- var focused = useAutoUpdateState$1(initFocused || formFocused)[0];
2072
- var labelShrink = useAutoUpdateState$1(initLabelShrink || formLabelShrink)[0];
2073
- var fullWidth = useAutoUpdateState$1(initFullWidth == null ? formFullWidth : initFullWidth)[0];
2067
+ // Memo - FormState ------------------------------------------------------------------------------------------------
2068
+ var variant = React.useMemo(function () { return (initVariant == null ? formVariant : initVariant); }, [initVariant, formVariant]);
2069
+ var size = React.useMemo(function () { return (initSize == null ? formSize : initSize); }, [initSize, formSize]);
2070
+ var color = React.useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
2071
+ var focused = React.useMemo(function () { return (initFocused == null ? formFocused : initFocused); }, [initFocused, formFocused]);
2072
+ var labelShrink = React.useMemo(function () { return (initLabelShrink == null ? formLabelShrink : initLabelShrink); }, [initLabelShrink, formLabelShrink]);
2073
+ var fullWidth = React.useMemo(function () { return (initFullWidth == null ? formFullWidth : initFullWidth); }, [initFullWidth, formFullWidth]);
2074
2074
  // State -----------------------------------------------------------------------------------------------------------
2075
- var _d = useAutoUpdateState$1(initError), error = _d[0], setError = _d[1];
2076
- var _e = useAutoUpdateState$1(initHelperText), helperText = _e[0], setHelperText = _e[1];
2075
+ var _d = useAutoUpdateLayoutState(initError), error = _d[0], setError = _d[1];
2076
+ var _e = useAutoUpdateLayoutState(initHelperText), helperText = _e[0], setHelperText = _e[1];
2077
2077
  var _f = React.useState(false), showClear = _f[0], setShowClear = _f[1];
2078
- var _g = useAutoUpdateState$1(initDisabled), disabled = _g[0], setDisabled = _g[1];
2079
- // State - muiInputLabelProps --------------------------------------------------------------------------------------
2080
- var muiInputLabelProps = useAutoUpdateState$1(React.useCallback(function () {
2078
+ var _g = useAutoUpdateLayoutState(initDisabled), disabled = _g[0], setDisabled = _g[1];
2079
+ // Memo - muiInputLabelProps ---------------------------------------------------------------------------------------
2080
+ var muiInputLabelProps = React.useMemo(function () {
2081
2081
  if (labelShrink || placeholder) {
2082
2082
  return __assign$4(__assign$4({}, initMuiInputLabelProps), { shrink: true });
2083
2083
  }
2084
2084
  else {
2085
2085
  return initMuiInputLabelProps;
2086
2086
  }
2087
- }, [initMuiInputLabelProps, labelShrink, placeholder]))[0];
2088
- // State - inputProps ----------------------------------------------------------------------------------------------
2089
- var inputProps = useAutoUpdateState$1(React.useCallback(function () {
2087
+ }, [initMuiInputLabelProps, labelShrink, placeholder]);
2088
+ // Memo - inputProps -----------------------------------------------------------------------------------------------
2089
+ var inputProps = React.useMemo(function () {
2090
2090
  if (readOnly != null || maxLength != null) {
2091
2091
  var finalInputProps = __assign$4(__assign$4({}, initInputProps), { readOnly: readOnly, maxLength: maxLength });
2092
2092
  if (readOnly) {
@@ -2097,30 +2097,31 @@ styleInject(css_248z$j);var FormTextField = React__default["default"].forwardRef
2097
2097
  else {
2098
2098
  return initInputProps;
2099
2099
  }
2100
- }, [initInputProps, readOnly, maxLength]))[0];
2101
- // State - style ---------------------------------------------------------------------------------------------------
2102
- var style = useAutoUpdateState$1(React.useCallback(function () {
2100
+ }, [initInputProps, readOnly, maxLength]);
2101
+ // Memo - style ----------------------------------------------------------------------------------------------------
2102
+ var style = React.useMemo(function () {
2103
2103
  if (width != null) {
2104
2104
  return __assign$4(__assign$4({}, initStyle), { width: width });
2105
2105
  }
2106
2106
  else {
2107
2107
  return initStyle;
2108
2108
  }
2109
- }, [initStyle, width]))[0];
2110
- // State - label ---------------------------------------------------------------------------------------------------
2111
- var label = useAutoUpdateState$1(React.useCallback(function () {
2109
+ }, [initStyle, width]);
2110
+ // Memo - label ----------------------------------------------------------------------------------------------------
2111
+ var label = React.useMemo(function () {
2112
2112
  return labelIcon ? (React__default["default"].createElement(React__default["default"].Fragment, null,
2113
2113
  React__default["default"].createElement(FormIcon, { style: { verticalAlign: 'middle', marginRight: 4 } }, labelIcon),
2114
2114
  React__default["default"].createElement("span", { style: { verticalAlign: 'middle' } }, initLabel))) : (initLabel);
2115
- }, [initLabel, labelIcon]))[0];
2115
+ }, [initLabel, labelIcon]);
2116
2116
  // Function - getFinalValue ----------------------------------------------------------------------------------------
2117
2117
  var getFinalValue = React.useCallback(function (value) {
2118
2118
  return onValue ? onValue(value) : value;
2119
2119
  }, [onValue]);
2120
2120
  // State - value ---------------------------------------------------------------------------------------------------
2121
- var _h = useAutoUpdateState$1(initValue, getFinalValue), value = _h[0], setValue = _h[1];
2121
+ var _h = useAutoUpdateLayoutState(initValue, getFinalValue), value = _h[0], setValue = _h[1];
2122
2122
  React.useEffect(function () {
2123
2123
  setShowClear(clear ? notEmpty(value) : false);
2124
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2124
2125
  }, [value]);
2125
2126
  useFirstSkipEffect$1(function () {
2126
2127
  if (error)
@@ -2141,6 +2142,11 @@ styleInject(css_248z$j);var FormTextField = React__default["default"].forwardRef
2141
2142
  (_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus();
2142
2143
  }
2143
2144
  }, [initInputRef, inputRef]);
2145
+ // Function - setErrorHelperText -----------------------------------------------------------------------------------
2146
+ var setErrorHelperText = React.useCallback(function (error, helperText) {
2147
+ setError(error);
2148
+ setHelperText(helperText);
2149
+ }, [setError, setHelperText]);
2144
2150
  // Function - validate ---------------------------------------------------------------------------------------------
2145
2151
  var validate = React.useCallback(function (value) {
2146
2152
  if (required && empty$1(value)) {
@@ -2168,14 +2174,9 @@ styleInject(css_248z$j);var FormTextField = React__default["default"].forwardRef
2168
2174
  }
2169
2175
  setErrorHelperText(false, initHelperText);
2170
2176
  return true;
2171
- }, [required, validPattern, invalidPattern, onValidate, initHelperText]);
2172
- // Function - setErrorHelperText -----------------------------------------------------------------------------------
2173
- var setErrorHelperText = React.useCallback(function (error, helperText) {
2174
- setError(error);
2175
- setHelperText(helperText);
2176
- }, []);
2177
- // State - muiInputProps -------------------------------------------------------------------------------------------
2178
- var muiInputProps = useAutoUpdateState$1(React.useCallback(function () {
2177
+ }, [required, validPattern, invalidPattern, onValidate, setErrorHelperText, initHelperText]);
2178
+ // Memo - muiInputProps --------------------------------------------------------------------------------------------
2179
+ var muiInputProps = React.useMemo(function () {
2179
2180
  var muiInputProps = __assign$4({}, initMuiInputProps);
2180
2181
  if (startAdornment || icon || muiInputProps.startAdornment) {
2181
2182
  muiInputProps.startAdornment = (React__default["default"].createElement(React__default["default"].Fragment, null,
@@ -2204,21 +2205,22 @@ styleInject(css_248z$j);var FormTextField = React__default["default"].forwardRef
2204
2205
  }
2205
2206
  return muiInputProps;
2206
2207
  }, [
2207
- initMuiInputProps,
2208
- icon,
2209
- getFinalValue,
2210
- startAdornment,
2211
- endAdornment,
2212
2208
  clear,
2213
- readOnly,
2214
2209
  disabled,
2215
- showClear,
2210
+ endAdornment,
2216
2211
  focus,
2212
+ getFinalValue,
2213
+ icon,
2214
+ initMuiInputProps,
2217
2215
  name,
2218
2216
  noFormValueItem,
2219
- onValueChangeByUser,
2220
2217
  onRequestSearchSubmit,
2221
- ]))[0];
2218
+ onValueChangeByUser,
2219
+ readOnly,
2220
+ setValue,
2221
+ showClear,
2222
+ startAdornment,
2223
+ ]);
2222
2224
  // Effect ----------------------------------------------------------------------------------------------------------
2223
2225
  React.useEffect(function () {
2224
2226
  if (value !== initValue) {
@@ -2226,6 +2228,7 @@ styleInject(css_248z$j);var FormTextField = React__default["default"].forwardRef
2226
2228
  onChange(value);
2227
2229
  onValueChange(name, value);
2228
2230
  }
2231
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2229
2232
  }, []);
2230
2233
  // Commands --------------------------------------------------------------------------------------------------------
2231
2234
  React.useLayoutEffect(function () {
@@ -2294,6 +2297,11 @@ styleInject(css_248z$j);var FormTextField = React__default["default"].forwardRef
2294
2297
  noFormValueItem,
2295
2298
  onAddValueItem,
2296
2299
  onRemoveValueItem,
2300
+ id,
2301
+ setValue,
2302
+ setDisabled,
2303
+ setErrorHelperText,
2304
+ initHelperText,
2297
2305
  ]);
2298
2306
  // Event Handler ---------------------------------------------------------------------------------------------------
2299
2307
  var handleChange = React.useCallback(function (e) {
@@ -2307,7 +2315,7 @@ styleInject(css_248z$j);var FormTextField = React__default["default"].forwardRef
2307
2315
  }
2308
2316
  });
2309
2317
  }
2310
- }, [name, getFinalValue, select, noFormValueItem, onValueChangeByUser, onRequestSearchSubmit]);
2318
+ }, [getFinalValue, setValue, noFormValueItem, onValueChangeByUser, name, select, onRequestSearchSubmit]);
2311
2319
  var handleBlur = React.useCallback(function (e) {
2312
2320
  if (error)
2313
2321
  validate(value);
@@ -2322,7 +2330,7 @@ styleInject(css_248z$j);var FormTextField = React__default["default"].forwardRef
2322
2330
  }
2323
2331
  if (onKeyDown)
2324
2332
  onKeyDown(e);
2325
- }, [select, multiline, name, value, noFormValueItem, onRequestSearchSubmit]);
2333
+ }, [select, multiline, noFormValueItem, onKeyDown, onRequestSearchSubmit, name, value]);
2326
2334
  // Render ----------------------------------------------------------------------------------------------------------
2327
2335
  return (React__default["default"].createElement(material.TextField, __assign$4({}, props, { variant: variant, size: size, color: color, focused: focused || undefined, name: name, label: label, placeholder: placeholder, className: classNames$1(className, 'FormValueItem', 'FormTextField', "variant-".concat(variant)), inputRef: initInputRef ? initInputRef : inputRef, value: value, required: required, fullWidth: !width && fullWidth, error: error, helperText: formColWithHelperText ? undefined : helperText, FormHelperTextProps: { component: 'div' }, disabled: disabled, InputProps: muiInputProps, InputLabelProps: muiInputLabelProps, inputProps: ((_b = initInputProps === null || initInputProps === void 0 ? void 0 : initInputProps.className) === null || _b === void 0 ? void 0 : _b.includes('FormTag-Input')) ? initInputProps : inputProps, style: style, select: select, SelectProps: SelectProps, multiline: multiline, onChange: handleChange, onBlur: handleBlur, onKeyDown: handleKeyDown })));
2328
2336
  });
@@ -2353,7 +2361,7 @@ styleInject(css_248z$h);var FormTag = React__default["default"].forwardRef(funct
2353
2361
  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"]);
2354
2362
  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"]);
2355
2363
  // State - FormState -----------------------------------------------------------------------------------------------
2356
- var fullWidth = useAutoUpdateState$1(initFullWidth == null ? formFullWidth : initFullWidth)[0];
2364
+ var fullWidth = useAutoUpdateLayoutState(initFullWidth == null ? formFullWidth : initFullWidth)[0];
2357
2365
  // Function - getFinalValue ----------------------------------------------------------------------------------------
2358
2366
  var getFinalValue = React.useCallback(function (value) {
2359
2367
  var finalValue;
@@ -2371,7 +2379,7 @@ styleInject(css_248z$h);var FormTag = React__default["default"].forwardRef(funct
2371
2379
  var _c = React.useState(function () {
2372
2380
  return new Set(getFinalValue(initValue));
2373
2381
  }), valueSet = _c[0], setValueSet = _c[1];
2374
- var _d = useAutoUpdateState$1(initValue, getFinalValue), value = _d[0], setValue = _d[1];
2382
+ var _d = useAutoUpdateLayoutState(initValue, getFinalValue), value = _d[0], setValue = _d[1];
2375
2383
  useFirstSkipEffect$1(function () {
2376
2384
  if (error)
2377
2385
  validate(value);
@@ -2381,16 +2389,22 @@ styleInject(css_248z$h);var FormTag = React__default["default"].forwardRef(funct
2381
2389
  }, [value]);
2382
2390
  //------------------------------------------------------------------------------------------------------------------
2383
2391
  var _e = React.useState(''), inputValue = _e[0], setInputValue = _e[1];
2384
- var _f = useAutoUpdateState$1(initError), error = _f[0], setError = _f[1];
2385
- var _g = useAutoUpdateState$1(initHelperText), helperText = _g[0], setHelperText = _g[1];
2392
+ var _f = useAutoUpdateLayoutState(initError), error = _f[0], setError = _f[1];
2393
+ var _g = useAutoUpdateLayoutState(initHelperText), helperText = _g[0], setHelperText = _g[1];
2386
2394
  // Effect ----------------------------------------------------------------------------------------------------------
2387
2395
  React.useEffect(function () {
2388
- if (!isSame$1(value, initValue)) {
2396
+ if (!isSame$2(value, initValue)) {
2389
2397
  if (onChange)
2390
2398
  onChange(value);
2391
2399
  onValueChange(name, value);
2392
2400
  }
2401
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2393
2402
  }, []);
2403
+ // Function - setErrorHelperText -----------------------------------------------------------------------------------
2404
+ var setErrorHelperText = React.useCallback(function (error, helperText) {
2405
+ setError(error);
2406
+ setHelperText(helperText);
2407
+ }, [setError, setHelperText]);
2394
2408
  // Function - validate ---------------------------------------------------------------------------------------------
2395
2409
  var validate = React.useCallback(function (value) {
2396
2410
  if (required && empty$1(value)) {
@@ -2406,12 +2420,7 @@ styleInject(css_248z$h);var FormTag = React__default["default"].forwardRef(funct
2406
2420
  }
2407
2421
  setErrorHelperText(false, initHelperText);
2408
2422
  return true;
2409
- }, [required, onValidate, initHelperText]);
2410
- // Function - setErrorHelperText -----------------------------------------------------------------------------------
2411
- var setErrorHelperText = React.useCallback(function (error, helperText) {
2412
- setError(error);
2413
- setHelperText(helperText);
2414
- }, []);
2423
+ }, [required, onValidate, setErrorHelperText, initHelperText]);
2415
2424
  // Function - getExtraCommands -------------------------------------------------------------------------------------
2416
2425
  var getExtraCommands = React.useCallback(function () {
2417
2426
  return {
@@ -2427,13 +2436,13 @@ styleInject(css_248z$h);var FormTag = React__default["default"].forwardRef(funct
2427
2436
  setValue(lastValue);
2428
2437
  }, getValue: function () { return lastValue; }, setValue: function (newValue) {
2429
2438
  var finalValue = getFinalValue(newValue);
2430
- if (!isSame$1(lastValue, finalValue)) {
2439
+ if (!isSame$2(lastValue, finalValue)) {
2431
2440
  lastValue = finalValue;
2432
2441
  setValueSet(new Set(lastValue));
2433
2442
  setValue(lastValue);
2434
2443
  }
2435
2444
  }, validate: function () { return validate(value); } }), getExtraCommands());
2436
- }, [initValue, value, getFinalValue, validate, getExtraCommands]);
2445
+ }, [value, getExtraCommands, getFinalValue, initValue, setValue, validate]);
2437
2446
  // Function - appendTag, removeTag ---------------------------------------------------------------------------------
2438
2447
  var appendTag = React.useCallback(function (tag) {
2439
2448
  if (valueSet.has(tag)) {
@@ -2450,7 +2459,7 @@ styleInject(css_248z$h);var FormTag = React__default["default"].forwardRef(funct
2450
2459
  onRequestSearchSubmit(name, finalValue_1);
2451
2460
  });
2452
2461
  }
2453
- }, [valueSet, name, getFinalValue, onValueChangeByUser, onRequestSearchSubmit]);
2462
+ }, [valueSet, getFinalValue, setValue, onValueChangeByUser, name, onRequestSearchSubmit]);
2454
2463
  var removeTag = React.useCallback(function (tag) {
2455
2464
  if (valueSet.has(tag)) {
2456
2465
  valueSet.delete(tag);
@@ -2461,7 +2470,7 @@ styleInject(css_248z$h);var FormTag = React__default["default"].forwardRef(funct
2461
2470
  onRequestSearchSubmit(name, finalValue_2);
2462
2471
  });
2463
2472
  }
2464
- }, [valueSet, name, getFinalValue, onValueChangeByUser, onRequestSearchSubmit]);
2473
+ }, [valueSet, getFinalValue, setValue, onValueChangeByUser, name, onRequestSearchSubmit]);
2465
2474
  // Event Handler ---------------------------------------------------------------------------------------------------
2466
2475
  var handleAddValueItem = React.useCallback(function (id, commands) {
2467
2476
  onAddValueItem(id, getCommands(commands));
@@ -2499,7 +2508,7 @@ styleInject(css_248z$h);var FormTag = React__default["default"].forwardRef(funct
2499
2508
  }
2500
2509
  if (onBlur)
2501
2510
  onBlur(e);
2502
- }, [inputValue, onBlur]);
2511
+ }, [appendTag, inputValue, onBlur]);
2503
2512
  var handleRenderTags = React.useCallback(function (tags) {
2504
2513
  return tags.map(function (tag) { return (React__default["default"].createElement(material.Chip, { className: 'MuiAutocomplete-tag', key: tag, label: tag, size: 'small', disabled: disabled, onDelete: readOnly || disabled ? undefined : function () { return removeTag(tag); } })); });
2505
2514
  }, [disabled, readOnly, removeTag]);
@@ -2544,8 +2553,8 @@ var FormPassword = React__default["default"].forwardRef(function (_a, ref) {
2544
2553
  var className = _a.className, initMuiInputProps = _a.InputProps, eye = _a.eye, onChange = _a.onChange, props = __rest$2(_a, ["className", "InputProps", "eye", "onChange"]);
2545
2554
  var _b = React.useState('password'), type = _b[0], setType = _b[1];
2546
2555
  var _c = React.useState(notEmpty(props.value)), showEye = _c[0], setShowEye = _c[1];
2547
- // State - muiInputProps -------------------------------------------------------------------------------------------
2548
- var muiInputProps = useAutoUpdateState$1(React.useCallback(function () {
2556
+ // Memo --------------------------------------------------------------------------------------------------------------
2557
+ var muiInputProps = React.useMemo(function () {
2549
2558
  if (eye) {
2550
2559
  var newProps = __assign$4({}, initMuiInputProps);
2551
2560
  newProps.endAdornment = (React__default["default"].createElement(React__default["default"].Fragment, null,
@@ -2560,7 +2569,7 @@ var FormPassword = React__default["default"].forwardRef(function (_a, ref) {
2560
2569
  else {
2561
2570
  return initMuiInputProps;
2562
2571
  }
2563
- }, [initMuiInputProps, type, eye, showEye]))[0];
2572
+ }, [eye, initMuiInputProps, showEye, type]);
2564
2573
  // Event Handler ---------------------------------------------------------------------------------------------------
2565
2574
  var handleChange = React.useCallback(function (value) {
2566
2575
  setShowEye(notEmpty(value));
@@ -4046,9 +4055,9 @@ NumberFormat.defaultProps = defaultProps;var NumberFormatCustom = React__default
4046
4055
  } })));
4047
4056
  });
4048
4057
  NumberFormatCustom.displayName = 'NumberFormatCustom';var FormNumberDefaultProps = __assign$4({}, FormTextDefaultProps);var FormNumber = React__default["default"].forwardRef(function (_a, ref) {
4049
- // State - muiInputProps -------------------------------------------------------------------------------------------
4058
+ // Memo --------------------------------------------------------------------------------------------------------------
4050
4059
  var className = _a.className, allowLeadingZeros = _a.allowLeadingZeros, allowNegative = _a.allowNegative, thousandSeparator = _a.thousandSeparator, allowDecimal = _a.allowDecimal, decimalScale = _a.decimalScale, prefix = _a.prefix, suffix = _a.suffix, readOnly = _a.readOnly, initMuiInputProps = _a.InputProps, props = __rest$2(_a, ["className", "allowLeadingZeros", "allowNegative", "thousandSeparator", "allowDecimal", "decimalScale", "prefix", "suffix", "readOnly", "InputProps"]);
4051
- var muiInputProps = useAutoUpdateState$1(React.useCallback(function () {
4060
+ var muiInputProps = React.useMemo(function () {
4052
4061
  var inputProps = {
4053
4062
  allowLeadingZeros: allowLeadingZeros,
4054
4063
  allowNegative: allowNegative,
@@ -4066,7 +4075,17 @@ NumberFormatCustom.displayName = 'NumberFormatCustom';var FormNumberDefaultProps
4066
4075
  inputProps.decimalScale = 0;
4067
4076
  }
4068
4077
  return __assign$4(__assign$4({}, initMuiInputProps), { inputComponent: NumberFormatCustom, inputProps: inputProps });
4069
- }, [initMuiInputProps, allowLeadingZeros, allowNegative, thousandSeparator, allowDecimal, decimalScale]))[0];
4078
+ }, [
4079
+ allowDecimal,
4080
+ allowLeadingZeros,
4081
+ allowNegative,
4082
+ decimalScale,
4083
+ initMuiInputProps,
4084
+ prefix,
4085
+ readOnly,
4086
+ suffix,
4087
+ thousandSeparator,
4088
+ ]);
4070
4089
  // Render ----------------------------------------------------------------------------------------------------------
4071
4090
  return React__default["default"].createElement(FormText, __assign$4({ ref: ref, className: classNames$1(className, 'FormNumber'), InputProps: muiInputProps }, props));
4072
4091
  });
@@ -4093,16 +4112,16 @@ styleInject(css_248z$d);var FormSelect = React__default["default"].forwardRef(fu
4093
4112
  // FormState -------------------------------------------------------------------------------------------------------
4094
4113
  var className = _a.className, name = _a.name, initItems = _a.items, initFullWidth = _a.fullWidth, onLoadItems = _a.onLoadItems, readOnly = _a.readOnly, multiple = _a.multiple, checkbox = _a.checkbox, placeholder = _a.placeholder, initStartAdornment = _a.startAdornment, initValue = _a.value, initInputLabelProps = _a.InputLabelProps, initSelectProps = _a.SelectProps, formValueSeparator = _a.formValueSeparator, formValueSort = _a.formValueSort, width = _a.width, minWidth = _a.minWidth, initLoading = _a.loading, onChange = _a.onChange, onValue = _a.onValue, props = __rest$2(_a, ["className", "name", "items", "fullWidth", "onLoadItems", "readOnly", "multiple", "checkbox", "placeholder", "startAdornment", "value", "InputLabelProps", "SelectProps", "formValueSeparator", "formValueSort", "width", "minWidth", "loading", "onChange", "onValue"]);
4095
4114
  var _b = useFormState(), formFullWidth = _b.fullWidth, onAddValueItem = _b.onAddValueItem, onValueChange = _b.onValueChange, otherFormState = __rest$2(_b, ["fullWidth", "onAddValueItem", "onValueChange"]);
4096
- // State - FormState -----------------------------------------------------------------------------------------------
4097
- var fullWidth = useAutoUpdateState$1(initFullWidth == null ? formFullWidth : initFullWidth)[0];
4115
+ // Memo - FormState ------------------------------------------------------------------------------------------------
4116
+ var fullWidth = React.useMemo(function () { return (initFullWidth == null ? formFullWidth : initFullWidth); }, [initFullWidth, formFullWidth]);
4098
4117
  // State -----------------------------------------------------------------------------------------------------------
4099
4118
  var emptyValue = React.useState([])[0];
4100
4119
  var _c = React.useState({}), itemValueLabels = _c[0], setItemValueLabels = _c[1];
4101
4120
  var _d = React.useState(false), hasEmptyValue = _d[0], setHasEmptyValue = _d[1];
4102
4121
  var _e = React.useState(false), isOnGetItemLoading = _e[0], setIsOnGetItemLoading = _e[1];
4103
4122
  var _f = React.useState(initLoading), loading = _f[0], setLoading = _f[1];
4104
- // State - startAdornment ------------------------------------------------------------------------------------------
4105
- var startAdornment = useAutoUpdateState$1(React.useCallback(function () {
4123
+ // Memo --------------------------------------------------------------------------------------------------------------
4124
+ var startAdornment = React.useMemo(function () {
4106
4125
  if (isOnGetItemLoading || loading) {
4107
4126
  return (React__default["default"].createElement(React__default["default"].Fragment, null,
4108
4127
  initStartAdornment,
@@ -4111,9 +4130,9 @@ styleInject(css_248z$d);var FormSelect = React__default["default"].forwardRef(fu
4111
4130
  else {
4112
4131
  return initStartAdornment;
4113
4132
  }
4114
- }, [initStartAdornment, isOnGetItemLoading, loading]))[0];
4133
+ }, [initStartAdornment, isOnGetItemLoading, loading]);
4115
4134
  // State - items ---------------------------------------------------------------------------------------------------
4116
- var _g = useAutoUpdateState$1(initItems), items = _g[0], setItems = _g[1];
4135
+ var _g = useAutoUpdateLayoutState(initItems), items = _g[0], setItems = _g[1];
4117
4136
  React.useEffect(function () {
4118
4137
  if (items) {
4119
4138
  setItemValueLabels(items.reduce(function (res, item) {
@@ -4130,8 +4149,8 @@ styleInject(css_248z$d);var FormSelect = React__default["default"].forwardRef(fu
4130
4149
  setHasEmptyValue(false);
4131
4150
  }
4132
4151
  }, [items]);
4133
- // State - itemsValues ---------------------------------------------------------------------------------------------
4134
- var itemsValues = useAutoUpdateState$1(React.useCallback(function () {
4152
+ // Memo --------------------------------------------------------------------------------------------------------------
4153
+ var itemsValues = React.useMemo(function () {
4135
4154
  if (items) {
4136
4155
  return items.reduce(function (res, _a) {
4137
4156
  var value = _a.value;
@@ -4142,9 +4161,9 @@ styleInject(css_248z$d);var FormSelect = React__default["default"].forwardRef(fu
4142
4161
  else {
4143
4162
  return {};
4144
4163
  }
4145
- }, [items]))[0];
4164
+ }, [items]);
4146
4165
  // State - inputLabelProps -----------------------------------------------------------------------------------------
4147
- var inputLabelProps = useAutoUpdateState$1(React.useCallback(function () {
4166
+ var inputLabelProps = useAutoUpdateLayoutState(React.useCallback(function () {
4148
4167
  if (hasEmptyValue || (!hasEmptyValue && placeholder)) {
4149
4168
  return __assign$4(__assign$4({}, initInputLabelProps), { shrink: true });
4150
4169
  }
@@ -4201,19 +4220,19 @@ styleInject(css_248z$d);var FormSelect = React__default["default"].forwardRef(fu
4201
4220
  return onValue ? onValue(finalValue) : finalValue;
4202
4221
  }, [multiple, formValueSeparator, itemsValues, onValue]);
4203
4222
  // State - value ---------------------------------------------------------------------------------------------------
4204
- var _h = useAutoUpdateState$1(initValue, getFinalValue), value = _h[0], setValue = _h[1];
4223
+ var _h = useAutoUpdateLayoutState(initValue, getFinalValue), value = _h[0], setValue = _h[1];
4205
4224
  useFirstSkipEffect$1(function () {
4206
4225
  if (onChange)
4207
4226
  onChange(value);
4208
4227
  onValueChange(name, value);
4209
4228
  }, [value]);
4210
4229
  // State - isSelectedPlaceholder -----------------------------------------------------------------------------------
4211
- var isSelectedPlaceholder = useAutoUpdateState$1(React.useCallback(function () {
4230
+ var isSelectedPlaceholder = useAutoUpdateLayoutState(React.useCallback(function () {
4212
4231
  return notEmpty(items) && empty$1(value) && !!placeholder && !hasEmptyValue;
4213
4232
  }, [items, value, placeholder, hasEmptyValue]))[0];
4214
4233
  // Effect ----------------------------------------------------------------------------------------------------------
4215
4234
  React.useEffect(function () {
4216
- if (!isSame$1(value, initValue)) {
4235
+ if (!isSame$2(value, initValue)) {
4217
4236
  if (onChange)
4218
4237
  onChange(value);
4219
4238
  onValueChange(name, value);
@@ -4225,9 +4244,10 @@ styleInject(css_248z$d);var FormSelect = React__default["default"].forwardRef(fu
4225
4244
  setIsOnGetItemLoading(false);
4226
4245
  });
4227
4246
  }
4247
+ // eslint-disable-next-line react-hooks/exhaustive-deps
4228
4248
  }, []);
4229
- // State - selectProps ---------------------------------------------------------------------------------------------
4230
- var selectProps = useAutoUpdateState$1(React.useCallback(function () {
4249
+ // Memo --------------------------------------------------------------------------------------------------------------
4250
+ var selectProps = React.useMemo(function () {
4231
4251
  var _a;
4232
4252
  var finalSelectProps = __assign$4(__assign$4({}, initSelectProps), { displayEmpty: true, multiple: !!multiple });
4233
4253
  if (multiple) {
@@ -4253,16 +4273,7 @@ styleInject(css_248z$d);var FormSelect = React__default["default"].forwardRef(fu
4253
4273
  }
4254
4274
  finalSelectProps.MenuProps = __assign$4(__assign$4({}, finalSelectProps.MenuProps), { className: classNames$1((_a = finalSelectProps.MenuProps) === null || _a === void 0 ? void 0 : _a.className, 'FormSelect-Menu-Popover') });
4255
4275
  return finalSelectProps;
4256
- }, [
4257
- initSelectProps,
4258
- multiple,
4259
- itemValueLabels,
4260
- minWidth,
4261
- width,
4262
- hasEmptyValue,
4263
- placeholder,
4264
- isSelectedPlaceholder,
4265
- ]))[0];
4276
+ }, [initSelectProps, isSelectedPlaceholder, itemValueLabels, minWidth, multiple, placeholder, width]);
4266
4277
  // Function - getExtraCommands -------------------------------------------------------------------------------------
4267
4278
  var getBaseCommands = React.useCallback(function () {
4268
4279
  var lastValue = value;
@@ -4278,7 +4289,7 @@ styleInject(css_248z$d);var FormSelect = React__default["default"].forwardRef(fu
4278
4289
  setValue(lastValue);
4279
4290
  },
4280
4291
  };
4281
- }, [value, initValue, getFinalValue]);
4292
+ }, [value, getFinalValue, initValue, setValue]);
4282
4293
  var getExtraCommands = React.useCallback(function () {
4283
4294
  var lastItems = items;
4284
4295
  var lastLoading = loading;
@@ -4297,7 +4308,7 @@ styleInject(css_248z$d);var FormSelect = React__default["default"].forwardRef(fu
4297
4308
  setLoading(lastLoading);
4298
4309
  },
4299
4310
  };
4300
- }, [items, loading, formValueSeparator, formValueSort, multiple]);
4311
+ }, [items, loading, formValueSeparator, formValueSort, setItems, multiple]);
4301
4312
  // Event Handler ---------------------------------------------------------------------------------------------------
4302
4313
  var handleRef = React.useCallback(function (commands) {
4303
4314
  if (ref) {
@@ -4354,13 +4365,13 @@ styleInject(css_248z$c);var FormItemBase = React__default["default"].forwardRef(
4354
4365
  //----------------------------------------------------------------------------------------------------------------
4355
4366
  className = _a.className, style = _a.style, sx = _a.sx;
4356
4367
  var _b = useFormState(), formVariant = _b.variant, formSize = _b.size, formColor = _b.color, formFullWidth = _b.fullWidth, formColWithLabel = _b.formColWithLabel, formColWithHelperText = _b.formColWithHelperText;
4357
- // State - FormState -----------------------------------------------------------------------------------------------
4358
- var variant = useAutoUpdateState$1(initVariant || formVariant)[0];
4359
- var size = useAutoUpdateState$1(initSize || formSize)[0];
4360
- var color = useAutoUpdateState$1(initColor || formColor)[0];
4361
- var fullWidth = useAutoUpdateState$1(initFullWidth == null ? formFullWidth : initFullWidth)[0];
4362
- // State - wrapStyle -----------------------------------------------------------------------------------------------
4363
- var wrapStyle = useAutoUpdateState$1(React.useCallback(function () {
4368
+ // Memo - FormState ------------------------------------------------------------------------------------------------
4369
+ var variant = React.useMemo(function () { return (initVariant == null ? formVariant : initVariant); }, [initVariant, formVariant]);
4370
+ var size = React.useMemo(function () { return (initSize == null ? formSize : initSize); }, [initSize, formSize]);
4371
+ var color = React.useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
4372
+ var fullWidth = React.useMemo(function () { return (initFullWidth == null ? formFullWidth : initFullWidth); }, [initFullWidth, formFullWidth]);
4373
+ // Memo --------------------------------------------------------------------------------------------------------------
4374
+ var wrapStyle = React.useMemo(function () {
4364
4375
  var wrapStyle = {
4365
4376
  display: fullWidth ? 'block' : 'inline-flex',
4366
4377
  width: fullWidth ? '100%' : undefined,
@@ -4369,7 +4380,7 @@ styleInject(css_248z$c);var FormItemBase = React__default["default"].forwardRef(
4369
4380
  wrapStyle.marginTop = -20;
4370
4381
  }
4371
4382
  return wrapStyle;
4372
- }, [formColWithLabel]))[0];
4383
+ }, [formColWithLabel, fullWidth]);
4373
4384
  // State - inputHeight ---------------------------------------------------------------------------------------------
4374
4385
  var _c = React.useState(0), inputHeight = _c[0], setInputHeight = _c[1];
4375
4386
  var inputResizeDetectorRef = useResizeDetector({
@@ -4388,8 +4399,8 @@ styleInject(css_248z$c);var FormItemBase = React__default["default"].forwardRef(
4388
4399
  setRealControlHeight(realControlResizeDetectorRef.current.getBoundingClientRect().height);
4389
4400
  },
4390
4401
  }).ref;
4391
- // State - bottomMargin --------------------------------------------------------------------------------------------
4392
- var bottomMargin = useAutoUpdateState$1(React.useCallback(function () {
4402
+ // Memo ------------------------------------------------------------------------------------------------------------
4403
+ var bottomMargin = React.useMemo(function () {
4393
4404
  var realHeight = realControlHeight || 0;
4394
4405
  var height = controlHeight || 0;
4395
4406
  var checkInputHeight = variant === 'standard' ? inputHeight + 16 : inputHeight;
@@ -4403,9 +4414,8 @@ styleInject(css_248z$c);var FormItemBase = React__default["default"].forwardRef(
4403
4414
  }
4404
4415
  }
4405
4416
  return bottomMargin;
4406
- }, [variant, realControlHeight, controlHeight, inputHeight, label, formColWithLabel]))[0];
4407
- // State - controlMarginTop ----------------------------------------------------------------------------------------
4408
- var controlMarginTop = useAutoUpdateState$1(React.useCallback(function () {
4417
+ }, [variant, realControlHeight, controlHeight, inputHeight]);
4418
+ var controlMarginTop = React.useMemo(function () {
4409
4419
  var topMargin = 0;
4410
4420
  if (inputHeight && controlHeight && controlVerticalCenter) {
4411
4421
  topMargin = inputHeight / 2 - controlHeight / 2;
@@ -4433,7 +4443,7 @@ styleInject(css_248z$c);var FormItemBase = React__default["default"].forwardRef(
4433
4443
  break;
4434
4444
  }
4435
4445
  return controlMarginTop;
4436
- }, [inputHeight, controlHeight, controlVerticalCenter, size, label, formColWithLabel]))[0];
4446
+ }, [controlHeight, controlVerticalCenter, formColWithLabel, inputHeight, label, size, variant]);
4437
4447
  // Render ----------------------------------------------------------------------------------------------------------
4438
4448
  return (React__default["default"].createElement("div", { style: wrapStyle },
4439
4449
  React__default["default"].createElement(material.FormControl, { ref: ref, variant: 'standard', className: classNames$1(className, 'FormItemBase', !!label && 'with-label', "variant-".concat(variant), controlVerticalCenter && 'control-vertical-center', !!error && 'error'), style: style, color: color, error: error, focused: focused, sx: sx },
@@ -4462,25 +4472,25 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default["def
4462
4472
  var id = React.useId();
4463
4473
  // FormState -------------------------------------------------------------------------------------------------------
4464
4474
  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;
4465
- // State - FormState ------------------------------------------------------------------------------------------------------------------
4466
- var variant = useAutoUpdateState$1(initVariant || formVariant)[0];
4467
- var size = useAutoUpdateState$1(initSize || formSize)[0];
4468
- var color = useAutoUpdateState$1(initColor || formColor)[0];
4469
- var focused = useAutoUpdateState$1(initFocused || formFocused)[0];
4470
- var fullWidth = useAutoUpdateState$1(initFullWidth == null ? formFullWidth : initFullWidth)[0];
4475
+ // Memo - FormState ------------------------------------------------------------------------------------------------
4476
+ var variant = React.useMemo(function () { return (initVariant == null ? formVariant : initVariant); }, [initVariant, formVariant]);
4477
+ var size = React.useMemo(function () { return (initSize == null ? formSize : initSize); }, [initSize, formSize]);
4478
+ var color = React.useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
4479
+ var focused = React.useMemo(function () { return (initFocused == null ? formFocused : initFocused); }, [initFocused, formFocused]);
4480
+ var fullWidth = React.useMemo(function () { return (initFullWidth == null ? formFullWidth : initFullWidth); }, [initFullWidth, formFullWidth]);
4471
4481
  // Ref -------------------------------------------------------------------------------------------------------------
4472
4482
  var inputRef = React.useRef(null);
4473
4483
  var actionRef = React.useRef(null);
4474
4484
  // ResizeDetector --------------------------------------------------------------------------------------------------
4475
4485
  var _c = useResizeDetector(), width = _c.width, height = _c.height, resizeDetectorRef = _c.ref;
4476
4486
  // State -----------------------------------------------------------------------------------------------------------
4477
- var _d = useAutoUpdateState$1(initValue), value = _d[0], setValue = _d[1];
4478
- var _e = useAutoUpdateState$1(initUncheckedValue), uncheckedValue = _e[0], setUncheckedValue = _e[1];
4479
- var _f = useAutoUpdateState$1(initError), error = _f[0], setError = _f[1];
4480
- var _g = useAutoUpdateState$1(initHelperText), helperText = _g[0], setHelperText = _g[1];
4481
- var _h = useAutoUpdateState$1(initDisabled), disabled = _h[0], setDisabled = _h[1];
4487
+ var _d = useAutoUpdateLayoutState(initValue), value = _d[0], setValue = _d[1];
4488
+ var _e = useAutoUpdateLayoutState(initUncheckedValue), uncheckedValue = _e[0], setUncheckedValue = _e[1];
4489
+ var _f = useAutoUpdateLayoutState(initError), error = _f[0], setError = _f[1];
4490
+ var _g = useAutoUpdateLayoutState(initHelperText), helperText = _g[0], setHelperText = _g[1];
4491
+ var _h = useAutoUpdateLayoutState(initDisabled), disabled = _h[0], setDisabled = _h[1];
4482
4492
  // State - checked -------------------------------------------------------------------------------------------------
4483
- var _j = useAutoUpdateState$1(initChecked), checked = _j[0], setChecked = _j[1];
4493
+ var _j = useAutoUpdateLayoutState(initChecked), checked = _j[0], setChecked = _j[1];
4484
4494
  useFirstSkipEffect$1(function () {
4485
4495
  if (error)
4486
4496
  validate(checked);
@@ -4488,10 +4498,8 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default["def
4488
4498
  onChange(!!checked);
4489
4499
  onValueChange(name, !!checked);
4490
4500
  }, [checked]);
4491
- // State - style ---------------------------------------------------------------------------------------------------
4492
- var style = useAutoUpdateState$1(React.useCallback(function () {
4493
- return __assign$4({ width: fullWidth ? '100%' : width || 100, paddingLeft: 3 }, initStyle);
4494
- }, [initStyle, fullWidth, width]))[0];
4501
+ // Memo --------------------------------------------------------------------------------------------------------------
4502
+ var style = React.useMemo(function () { return (__assign$4({ width: fullWidth ? '100%' : width || 100, paddingLeft: 3 }, initStyle)); }, [initStyle, fullWidth, width]);
4495
4503
  // Function - focus ------------------------------------------------------------------------------------------------
4496
4504
  var focus = React.useCallback(function () {
4497
4505
  var _a, _b, _c, _d;
@@ -4508,6 +4516,11 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default["def
4508
4516
  (_d = actionRef.current) === null || _d === void 0 ? void 0 : _d.focusVisible();
4509
4517
  }
4510
4518
  }, [initInputRef, inputRef, initAction, actionRef]);
4519
+ // Function - setErrorHelperText -----------------------------------------------------------------------------------
4520
+ var setErrorHelperText = React.useCallback(function (error, helperText) {
4521
+ setError(error);
4522
+ setHelperText(helperText);
4523
+ }, [setError, setHelperText]);
4511
4524
  // Function - validate ---------------------------------------------------------------------------------------------
4512
4525
  var validate = React.useCallback(function (checked) {
4513
4526
  if (onValidate) {
@@ -4519,12 +4532,7 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default["def
4519
4532
  }
4520
4533
  setErrorHelperText(false, initHelperText);
4521
4534
  return true;
4522
- }, [onValidate, initHelperText]);
4523
- // Function - setErrorHelperText -----------------------------------------------------------------------------------
4524
- var setErrorHelperText = React.useCallback(function (error, helperText) {
4525
- setError(error);
4526
- setHelperText(helperText);
4527
- }, []);
4535
+ }, [onValidate, setErrorHelperText, initHelperText]);
4528
4536
  // Commands --------------------------------------------------------------------------------------------------------
4529
4537
  React.useLayoutEffect(function () {
4530
4538
  var lastChecked = checked;
@@ -4601,6 +4609,12 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default["def
4601
4609
  disabled,
4602
4610
  validate,
4603
4611
  initHelperText,
4612
+ id,
4613
+ setChecked,
4614
+ setValue,
4615
+ setUncheckedValue,
4616
+ setDisabled,
4617
+ setErrorHelperText,
4604
4618
  ]);
4605
4619
  // Event Handler ---------------------------------------------------------------------------------------------------
4606
4620
  var handleChange = React.useCallback(function (e, checked) {
@@ -4614,7 +4628,7 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default["def
4614
4628
  onRequestSearchSubmit(name, checked);
4615
4629
  });
4616
4630
  }
4617
- }, [readOnly, name, onValueChangeByUser, onRequestSearchSubmit]);
4631
+ }, [readOnly, setChecked, onValueChangeByUser, name, onRequestSearchSubmit]);
4618
4632
  // Render ----------------------------------------------------------------------------------------------------------
4619
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) }) }));
4620
4634
  });
@@ -4634,25 +4648,26 @@ var FormRadioGroup = React__default["default"].forwardRef(function (_a, ref) {
4634
4648
  var id = React.useId();
4635
4649
  // FormState -------------------------------------------------------------------------------------------------------
4636
4650
  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;
4651
+ // Memo - FormState ------------------------------------------------------------------------------------------------
4652
+ var variant = React.useMemo(function () { return (initVariant == null ? formVariant : initVariant); }, [initVariant, formVariant]);
4653
+ var size = React.useMemo(function () { return (initSize == null ? formSize : initSize); }, [initSize, formSize]);
4654
+ var color = React.useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
4655
+ var focused = React.useMemo(function () { return (initFocused == null ? formFocused : initFocused); }, [initFocused, formFocused]);
4637
4656
  // State - FormState -----------------------------------------------------------------------------------------------
4638
- var variant = useAutoUpdateState$1(initVariant || formVariant)[0];
4639
- var size = useAutoUpdateState$1(initSize || formSize)[0];
4640
- var color = useAutoUpdateState$1(initColor || formColor)[0];
4641
- var focused = useAutoUpdateState$1(initFocused || formFocused)[0];
4642
- var _c = useAutoUpdateState$1(initFullWidth == null ? formFullWidth : initFullWidth), fullWidth = _c[0], setFullWidth = _c[1];
4657
+ var _c = useAutoUpdateLayoutState(initFullWidth == null ? formFullWidth : initFullWidth), fullWidth = _c[0], setFullWidth = _c[1];
4643
4658
  // Theme -----------------------------------------------------------------------------------------------------------
4644
4659
  var theme = material.useTheme();
4645
4660
  // Ref -------------------------------------------------------------------------------------------------------------
4646
4661
  var baseRef = React.useRef(null);
4647
4662
  var firstInputRef = React.useRef(null);
4648
4663
  // State -----------------------------------------------------------------------------------------------------------
4649
- var _d = useAutoUpdateState$1(initItems), items = _d[0], setItems = _d[1];
4650
- var _e = useAutoUpdateState$1(initError), error = _e[0], setError = _e[1];
4651
- var _f = useAutoUpdateState$1(initHelperText), helperText = _f[0], setHelperText = _f[1];
4652
- var _g = useAutoUpdateState$1(initDisabled), disabled = _g[0], setDisabled = _g[1];
4664
+ var _d = useAutoUpdateLayoutState(initItems), items = _d[0], setItems = _d[1];
4665
+ var _e = useAutoUpdateLayoutState(initError), error = _e[0], setError = _e[1];
4666
+ var _f = useAutoUpdateLayoutState(initHelperText), helperText = _f[0], setHelperText = _f[1];
4667
+ var _g = useAutoUpdateLayoutState(initDisabled), disabled = _g[0], setDisabled = _g[1];
4653
4668
  var _h = React.useState(false), isOnGetItemLoading = _h[0], setIsOnGetItemLoading = _h[1];
4654
- var _j = useAutoUpdateState$1(initLoading), loading = _j[0], setLoading = _j[1];
4655
- var _k = useAutoUpdateState$1(initWidth || '100%'), width = _k[0], setWidth = _k[1];
4669
+ var _j = useAutoUpdateLayoutState(initLoading), loading = _j[0], setLoading = _j[1];
4670
+ var _k = useAutoUpdateLayoutState(initWidth || '100%'), width = _k[0], setWidth = _k[1];
4656
4671
  var _l = React.useState(), formColWrapRect = _l[0], setFormColWrapRect = _l[1];
4657
4672
  // State - radioGroupNoWrapRect (ResizeDetector) -------------------------------------------------------------------
4658
4673
  var _m = React.useState(), radioGroupNoWrapRect = _m[0], setRadioGroupNoWrapRect = _m[1];
@@ -4671,7 +4686,7 @@ var FormRadioGroup = React__default["default"].forwardRef(function (_a, ref) {
4671
4686
  return onValue ? onValue(value) : value;
4672
4687
  }, [onValue]);
4673
4688
  // State - value ---------------------------------------------------------------------------------------------------
4674
- var _p = useAutoUpdateState$1(initValue, getFinalValue), value = _p[0], setValue = _p[1];
4689
+ var _p = useAutoUpdateLayoutState(initValue, getFinalValue), value = _p[0], setValue = _p[1];
4675
4690
  useFirstSkipEffect$1(function () {
4676
4691
  if (error)
4677
4692
  validate(value);
@@ -4680,10 +4695,8 @@ var FormRadioGroup = React__default["default"].forwardRef(function (_a, ref) {
4680
4695
  if (onValueChange)
4681
4696
  onValueChange(name, value);
4682
4697
  }, [value]);
4683
- // State - style ---------------------------------------------------------------------------------------------------
4684
- var style = useAutoUpdateState$1(React.useCallback(function () {
4685
- return __assign$4({ width: width, paddingLeft: PADDING_LEFT }, initStyle);
4686
- }, [initStyle, width]))[0];
4698
+ // Memo --------------------------------------------------------------------------------------------------------------
4699
+ var style = React.useMemo(function () { return (__assign$4({ width: width, paddingLeft: PADDING_LEFT }, initStyle)); }, [initStyle, width]);
4687
4700
  // Effect ----------------------------------------------------------------------------------------------------------
4688
4701
  React.useEffect(function () {
4689
4702
  if (value !== initValue) {
@@ -4692,6 +4705,7 @@ var FormRadioGroup = React__default["default"].forwardRef(function (_a, ref) {
4692
4705
  if (onValueChange)
4693
4706
  onValueChange(name, value);
4694
4707
  }
4708
+ // eslint-disable-next-line react-hooks/exhaustive-deps
4695
4709
  }, []);
4696
4710
  React.useEffect(function () {
4697
4711
  if (!fullWidth || initWidth) {
@@ -4721,6 +4735,7 @@ var FormRadioGroup = React__default["default"].forwardRef(function (_a, ref) {
4721
4735
  };
4722
4736
  }
4723
4737
  }
4738
+ // eslint-disable-next-line react-hooks/exhaustive-deps
4724
4739
  }, [fullWidth, initWidth]);
4725
4740
  React.useEffect(function () {
4726
4741
  var width;
@@ -4745,12 +4760,18 @@ var FormRadioGroup = React__default["default"].forwardRef(function (_a, ref) {
4745
4760
  }
4746
4761
  setWidth(width);
4747
4762
  setFullWidth(fullWidth);
4763
+ // eslint-disable-next-line react-hooks/exhaustive-deps
4748
4764
  }, [initWidth, formFullWidth, initFullWidth, formColWrapRect, radioGroupNoWrapRect]);
4749
4765
  // Function - focus ------------------------------------------------------------------------------------------------
4750
4766
  var focus = React.useCallback(function () {
4751
4767
  var _a;
4752
4768
  (_a = firstInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
4753
4769
  }, []);
4770
+ // Function - setErrorHelperText -----------------------------------------------------------------------------------
4771
+ var setErrorHelperText = React.useCallback(function (error, helperText) {
4772
+ setError(error);
4773
+ setHelperText(helperText);
4774
+ }, [setError, setHelperText]);
4754
4775
  // Function - validate ---------------------------------------------------------------------------------------------
4755
4776
  var validate = React.useCallback(function (value) {
4756
4777
  if (required && empty$1(value)) {
@@ -4766,12 +4787,7 @@ var FormRadioGroup = React__default["default"].forwardRef(function (_a, ref) {
4766
4787
  }
4767
4788
  setErrorHelperText(false, initHelperText);
4768
4789
  return true;
4769
- }, [required, onValidate, initHelperText]);
4770
- // Function - setErrorHelperText -----------------------------------------------------------------------------------
4771
- var setErrorHelperText = React.useCallback(function (error, helperText) {
4772
- setError(error);
4773
- setHelperText(helperText);
4774
- }, []);
4790
+ }, [required, onValidate, setErrorHelperText, initHelperText]);
4775
4791
  // Commands --------------------------------------------------------------------------------------------------------
4776
4792
  React.useLayoutEffect(function () {
4777
4793
  var lastValue = value;
@@ -4848,6 +4864,13 @@ var FormRadioGroup = React__default["default"].forwardRef(function (_a, ref) {
4848
4864
  ref,
4849
4865
  onAddValueItem,
4850
4866
  onRemoveValueItem,
4867
+ id,
4868
+ setValue,
4869
+ setDisabled,
4870
+ setErrorHelperText,
4871
+ initHelperText,
4872
+ setItems,
4873
+ setLoading,
4851
4874
  ]);
4852
4875
  React.useEffect(function () {
4853
4876
  if (onLoadItems) {
@@ -4857,6 +4880,7 @@ var FormRadioGroup = React__default["default"].forwardRef(function (_a, ref) {
4857
4880
  setIsOnGetItemLoading(false);
4858
4881
  });
4859
4882
  }
4883
+ // eslint-disable-next-line react-hooks/exhaustive-deps
4860
4884
  }, []);
4861
4885
  // Event Handler ---------------------------------------------------------------------------------------------------
4862
4886
  var handleChange = React.useCallback(function (e) {
@@ -4883,7 +4907,7 @@ var FormRadioGroup = React__default["default"].forwardRef(function (_a, ref) {
4883
4907
  });
4884
4908
  }
4885
4909
  }
4886
- }, [readOnly, value, items, name, getFinalValue, onValueChangeByUser, onRequestSearchSubmit]);
4910
+ }, [readOnly, items, getFinalValue, value, setValue, onValueChangeByUser, name, onRequestSearchSubmit]);
4887
4911
  // Render ----------------------------------------------------------------------------------------------------------
4888
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,
4889
4913
  !fullWidth && !isOnGetItemLoading && !loading && items && (React__default["default"].createElement("div", { ref: resizeWidthDetectorRef, style: {
@@ -4930,12 +4954,13 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default["default"].fo
4930
4954
  var labelId = React.useId();
4931
4955
  // FormState -------------------------------------------------------------------------------------------------------
4932
4956
  var _b = useFormState(), formVariant = _b.variant, formSize = _b.size, formColor = _b.color, formFocused = _b.focused, formFullWidth = _b.fullWidth, formColWidth = _b.formColWidth, onAddValueItem = _b.onAddValueItem, onRemoveValueItem = _b.onRemoveValueItem, onValueChange = _b.onValueChange, onValueChangeByUser = _b.onValueChangeByUser, onRequestSearchSubmit = _b.onRequestSearchSubmit;
4957
+ // Memo - FormState ------------------------------------------------------------------------------------------------
4958
+ var variant = React.useMemo(function () { return (initVariant == null ? formVariant : initVariant); }, [initVariant, formVariant]);
4959
+ var size = React.useMemo(function () { return (initSize == null ? formSize : initSize); }, [initSize, formSize]);
4960
+ var color = React.useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
4961
+ var fullWidth = React.useMemo(function () { return (initFullWidth == null ? formFullWidth : initFullWidth); }, [initFullWidth, formFullWidth]);
4933
4962
  // State - FormState -----------------------------------------------------------------------------------------------
4934
- var variant = useAutoUpdateState$1(initVariant || formVariant)[0];
4935
- var size = useAutoUpdateState$1(initSize || formSize)[0];
4936
- var color = useAutoUpdateState$1(initColor || formColor)[0];
4937
- var _c = useAutoUpdateState$1(initFocused || formFocused), focused = _c[0], setFocused = _c[1];
4938
- var fullWidth = useAutoUpdateState$1(initFullWidth == null ? formFullWidth : initFullWidth)[0];
4963
+ var _c = useAutoUpdateLayoutState(initFocused == null ? formFocused : initFocused), focused = _c[0], setFocused = _c[1];
4939
4964
  // Theme -----------------------------------------------------------------------------------------------------------
4940
4965
  var theme = material.useTheme();
4941
4966
  // State - width (ResizeDetector) ----------------------------------------------------------------------------------
@@ -4956,13 +4981,13 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default["default"].fo
4956
4981
  }).ref;
4957
4982
  // State -----------------------------------------------------------------------------------------------------------
4958
4983
  var _f = React.useState(false), isOnGetItemLoading = _f[0], setIsOnGetItemLoading = _f[1];
4959
- var _g = useAutoUpdateState$1(initItems), items = _g[0], setItems = _g[1];
4960
- var _h = useAutoUpdateState$1(initError), error = _h[0], setError = _h[1];
4961
- var _j = useAutoUpdateState$1(initHelperText), helperText = _j[0], setHelperText = _j[1];
4962
- var _k = useAutoUpdateState$1(initLoading), loading = _k[0], setLoading = _k[1];
4963
- var _l = useAutoUpdateState$1(initDisabled), disabled = _l[0], setDisabled = _l[1];
4964
- // State - itemsValues-----------------------------------------------------------------------------------------------------------
4965
- var itemsValues = useAutoUpdateState$1(React.useCallback(function () {
4984
+ var _g = useAutoUpdateLayoutState(initItems), items = _g[0], setItems = _g[1];
4985
+ var _h = useAutoUpdateLayoutState(initError), error = _h[0], setError = _h[1];
4986
+ var _j = useAutoUpdateLayoutState(initHelperText), helperText = _j[0], setHelperText = _j[1];
4987
+ var _k = useAutoUpdateLayoutState(initLoading), loading = _k[0], setLoading = _k[1];
4988
+ var _l = useAutoUpdateLayoutState(initDisabled), disabled = _l[0], setDisabled = _l[1];
4989
+ // Memo --------------------------------------------------------------------------------------------------------------
4990
+ var itemsValues = React.useMemo(function () {
4966
4991
  if (items) {
4967
4992
  return items.reduce(function (res, _a) {
4968
4993
  var value = _a.value;
@@ -4973,9 +4998,8 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default["default"].fo
4973
4998
  else {
4974
4999
  return {};
4975
5000
  }
4976
- }, [items]))[0];
4977
- // State - style ---------------------------------------------------------------------------------------------------
4978
- var style = useAutoUpdateState$1(React.useCallback(function () {
5001
+ }, [items]);
5002
+ var style = React.useMemo(function () {
4979
5003
  var finalWidth;
4980
5004
  if (initWidth) {
4981
5005
  finalWidth = initWidth;
@@ -4997,7 +5021,7 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default["default"].fo
4997
5021
  }
4998
5022
  }
4999
5023
  return __assign$4({ width: finalWidth }, initStyle);
5000
- }, [initStyle, initWidth, fullWidth, isOnGetItemLoading, width, formColWidth]))[0];
5024
+ }, [formColWidth, fullWidth, initStyle, initWidth, isOnGetItemLoading, width]);
5001
5025
  // Function - getFinalValue ----------------------------------------------------------------------------------------
5002
5026
  var getFinalValue = React.useCallback(function (value) {
5003
5027
  var finalValue = value;
@@ -5047,7 +5071,7 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default["default"].fo
5047
5071
  return onValue ? onValue(finalValue) : finalValue;
5048
5072
  }, [multiple, formValueSeparator, itemsValues, onValue]);
5049
5073
  // State - value ---------------------------------------------------------------------------------------------------
5050
- var _m = useAutoUpdateState$1(initValue, getFinalValue), value = _m[0], setValue = _m[1];
5074
+ var _m = useAutoUpdateLayoutState(initValue, getFinalValue), value = _m[0], setValue = _m[1];
5051
5075
  // Effect ----------------------------------------------------------------------------------------------------------
5052
5076
  React.useEffect(function () {
5053
5077
  if (value !== initValue) {
@@ -5062,6 +5086,7 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default["default"].fo
5062
5086
  setIsOnGetItemLoading(false);
5063
5087
  });
5064
5088
  }
5089
+ // eslint-disable-next-line react-hooks/exhaustive-deps
5065
5090
  }, []);
5066
5091
  useFirstSkipEffect$1(function () {
5067
5092
  if (error)
@@ -5089,12 +5114,18 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default["default"].fo
5089
5114
  }
5090
5115
  }
5091
5116
  }
5117
+ // eslint-disable-next-line react-hooks/exhaustive-deps
5092
5118
  }, [items, value, multiple, notAllowEmptyValue]);
5093
5119
  // Function - focus ------------------------------------------------------------------------------------------------
5094
5120
  var focus = React.useCallback(function () {
5095
5121
  if (resizeHeightDetectorRef.current)
5096
5122
  resizeHeightDetectorRef.current.focus();
5097
5123
  }, [resizeHeightDetectorRef]);
5124
+ // Function - setErrorHelperText -----------------------------------------------------------------------------------
5125
+ var setErrorHelperText = React.useCallback(function (error, helperText) {
5126
+ setError(error);
5127
+ setHelperText(helperText);
5128
+ }, [setError, setHelperText]);
5098
5129
  // Function - validate ---------------------------------------------------------------------------------------------
5099
5130
  var validate = React.useCallback(function (value) {
5100
5131
  if (required && empty$1(value)) {
@@ -5110,12 +5141,7 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default["default"].fo
5110
5141
  }
5111
5142
  setErrorHelperText(false, initHelperText);
5112
5143
  return true;
5113
- }, [required, onValidate, initHelperText]);
5114
- // Function - setErrorHelperText -----------------------------------------------------------------------------------
5115
- var setErrorHelperText = React.useCallback(function (error, helperText) {
5116
- setError(error);
5117
- setHelperText(helperText);
5118
- }, []);
5144
+ }, [required, onValidate, setErrorHelperText, initHelperText]);
5119
5145
  // Commands --------------------------------------------------------------------------------------------------------
5120
5146
  React.useLayoutEffect(function () {
5121
5147
  if (ref || onAddValueItem) {
@@ -5201,6 +5227,14 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default["default"].fo
5201
5227
  ref,
5202
5228
  onAddValueItem,
5203
5229
  onRemoveValueItem,
5230
+ loading,
5231
+ id,
5232
+ setValue,
5233
+ setDisabled,
5234
+ setErrorHelperText,
5235
+ initHelperText,
5236
+ setItems,
5237
+ setLoading,
5204
5238
  ]);
5205
5239
  // Event Handler ---------------------------------------------------------------------------------------------------
5206
5240
  var handleChange = React.useCallback(function (e, newValue) {
@@ -5224,7 +5258,7 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default["default"].fo
5224
5258
  }
5225
5259
  }
5226
5260
  finalValue_1 = getFinalValue(finalValue_1);
5227
- if (!isSame$1(value, finalValue_1)) {
5261
+ if (!isSame$2(value, finalValue_1)) {
5228
5262
  setValue(finalValue_1);
5229
5263
  nextTick(function () {
5230
5264
  onValueChangeByUser(name, finalValue_1);
@@ -5233,14 +5267,14 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default["default"].fo
5233
5267
  }
5234
5268
  }
5235
5269
  }, [
5236
- value,
5237
- multiple,
5238
5270
  readOnly,
5239
5271
  notAllowEmptyValue,
5240
- multiple,
5241
5272
  getFinalValue,
5242
- name,
5273
+ value,
5274
+ multiple,
5275
+ setValue,
5243
5276
  onValueChangeByUser,
5277
+ name,
5244
5278
  onRequestSearchSubmit,
5245
5279
  ]);
5246
5280
  // Render ----------------------------------------------------------------------------------------------------------
@@ -5298,17 +5332,18 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
5298
5332
  var id = React.useId();
5299
5333
  // FormState -------------------------------------------------------------------------------------------------------
5300
5334
  var _b = useFormState(), formVariant = _b.variant, formSize = _b.size, formColor = _b.color, formFocused = _b.focused, onAddValueItem = _b.onAddValueItem, onRemoveValueItem = _b.onRemoveValueItem, onValueChange = _b.onValueChange, onValueChangeByUser = _b.onValueChangeByUser, onRequestSearchSubmit = _b.onRequestSearchSubmit;
5335
+ // Memo - FormState ------------------------------------------------------------------------------------------------
5336
+ var variant = React.useMemo(function () { return (initVariant == null ? formVariant : initVariant); }, [initVariant, formVariant]);
5337
+ var size = React.useMemo(function () { return (initSize == null ? formSize : initSize); }, [initSize, formSize]);
5338
+ var color = React.useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
5301
5339
  // State - FormState -----------------------------------------------------------------------------------------------
5302
- var variant = useAutoUpdateState$1(initVariant || formVariant)[0];
5303
- var size = useAutoUpdateState$1(initSize || formSize)[0];
5304
- var color = useAutoUpdateState$1(initColor || formColor)[0];
5305
- var _c = useAutoUpdateState$1(initFocused || formFocused), focused = _c[0], setFocused = _c[1];
5340
+ var _c = useAutoUpdateLayoutState(initFocused == null ? formFocused : initFocused), focused = _c[0], setFocused = _c[1];
5306
5341
  // Ref -------------------------------------------------------------------------------------------------------------
5307
5342
  var inputRef = React.useRef();
5308
5343
  // State -----------------------------------------------------------------------------------------------------------
5309
- var _d = useAutoUpdateState$1(initError), error = _d[0], setError = _d[1];
5310
- var _e = useAutoUpdateState$1(initHelperText), helperText = _e[0], setHelperText = _e[1];
5311
- var _f = useAutoUpdateState$1(initDisabled), disabled = _f[0], setDisabled = _f[1];
5344
+ var _d = useAutoUpdateLayoutState(initError), error = _d[0], setError = _d[1];
5345
+ var _e = useAutoUpdateLayoutState(initHelperText), helperText = _e[0], setHelperText = _e[1];
5346
+ var _f = useAutoUpdateLayoutState(initDisabled), disabled = _f[0], setDisabled = _f[1];
5312
5347
  // State - width, height -------------------------------------------------------------------------------------------
5313
5348
  var _g = useResizeDetector(), width = _g.width, height = _g.height, resizeDetectorRef = _g.ref;
5314
5349
  // Function - getFinalValue ----------------------------------------------------------------------------------------
@@ -5316,7 +5351,7 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
5316
5351
  return onValue ? onValue(value) : value;
5317
5352
  }, [onValue]);
5318
5353
  // State - value ---------------------------------------------------------------------------------------------------
5319
- var _h = useAutoUpdateState$1(initValue || 0, getFinalValue), value = _h[0], setValue = _h[1];
5354
+ var _h = useAutoUpdateLayoutState(initValue || 0, getFinalValue), value = _h[0], setValue = _h[1];
5320
5355
  useFirstSkipEffect$1(function () {
5321
5356
  if (error)
5322
5357
  validate(value);
@@ -5324,10 +5359,8 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
5324
5359
  onChange(value);
5325
5360
  onValueChange(name, value);
5326
5361
  }, [value]);
5327
- // State - style ---------------------------------------------------------------------------------------------------
5328
- var style = useAutoUpdateState$1(React.useCallback(function () {
5329
- return __assign$4({ width: width || 100 }, initStyle);
5330
- }, [initStyle, width]))[0];
5362
+ // Memo --------------------------------------------------------------------------------------------------------------
5363
+ var style = React.useMemo(function () { return (__assign$4({ width: width || 100 }, initStyle)); }, [initStyle, width]);
5331
5364
  // Effect ----------------------------------------------------------------------------------------------------------
5332
5365
  React.useEffect(function () {
5333
5366
  if (value !== initValue) {
@@ -5338,6 +5371,7 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
5338
5371
  if (resizeDetectorRef.current) {
5339
5372
  inputRef.current = resizeDetectorRef.current.querySelector('input');
5340
5373
  }
5374
+ // eslint-disable-next-line react-hooks/exhaustive-deps
5341
5375
  }, []);
5342
5376
  // Function --------------------------------------------------------------------------------------------------------
5343
5377
  var focus = React.useCallback(function () {
@@ -5348,6 +5382,10 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
5348
5382
  (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
5349
5383
  });
5350
5384
  }, []);
5385
+ var setErrorHelperText = React.useCallback(function (error, helperText) {
5386
+ setError(error);
5387
+ setHelperText(helperText);
5388
+ }, [setError, setHelperText]);
5351
5389
  var validate = React.useCallback(function (value) {
5352
5390
  if (required && (empty$1(value) || value === 0)) {
5353
5391
  setErrorHelperText(true, '필수 선택 항목입니다.');
@@ -5362,11 +5400,7 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
5362
5400
  }
5363
5401
  setErrorHelperText(false, initHelperText);
5364
5402
  return true;
5365
- }, [required, onValidate, initHelperText]);
5366
- var setErrorHelperText = React.useCallback(function (error, helperText) {
5367
- setError(error);
5368
- setHelperText(helperText);
5369
- }, []);
5403
+ }, [required, onValidate, setErrorHelperText, initHelperText]);
5370
5404
  // Commands --------------------------------------------------------------------------------------------------------
5371
5405
  React.useLayoutEffect(function () {
5372
5406
  var lastValue = value;
@@ -5430,6 +5464,10 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
5430
5464
  ref,
5431
5465
  onAddValueItem,
5432
5466
  onRemoveValueItem,
5467
+ id,
5468
+ setValue,
5469
+ setDisabled,
5470
+ setErrorHelperText,
5433
5471
  ]);
5434
5472
  // Event Handler ---------------------------------------------------------------------------------------------------
5435
5473
  var handleChange = React.useCallback(function (e, value) {
@@ -5444,7 +5482,7 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
5444
5482
  onRequestSearchSubmit(name, finalValue_1);
5445
5483
  });
5446
5484
  }
5447
- }, [readOnly, name, getFinalValue, onValueChangeByUser, onRequestSearchSubmit]);
5485
+ }, [readOnly, getFinalValue, setValue, onValueChangeByUser, name, onRequestSearchSubmit]);
5448
5486
  // Render ----------------------------------------------------------------------------------------------------------
5449
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); } }) }));
5450
5488
  });
@@ -7187,16 +7225,17 @@ styleInject(css_248z$a);var FormTextEditor = React__default["default"].forwardRe
7187
7225
  var id = React.useId();
7188
7226
  // FormState -------------------------------------------------------------------------------------------------------
7189
7227
  var _b = useFormState(), formVariant = _b.variant, formSize = _b.size, formColor = _b.color, formFocused = _b.focused, onAddValueItem = _b.onAddValueItem, onValueChange = _b.onValueChange, onRemoveValueItem = _b.onRemoveValueItem, onValueChangeByUser = _b.onValueChangeByUser;
7228
+ // Memo - FormState ------------------------------------------------------------------------------------------------
7229
+ var variant = React.useMemo(function () { return (initVariant == null ? formVariant : initVariant); }, [initVariant, formVariant]);
7230
+ var size = React.useMemo(function () { return (initSize == null ? formSize : initSize); }, [initSize, formSize]);
7231
+ var color = React.useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
7190
7232
  // State - FormState -----------------------------------------------------------------------------------------------
7191
- var variant = useAutoUpdateState$1(initVariant || formVariant)[0];
7192
- var size = useAutoUpdateState$1(initSize || formSize)[0];
7193
- var color = useAutoUpdateState$1(initColor || formColor)[0];
7194
- var _c = useAutoUpdateState$1(initFocused || formFocused), focused = _c[0], setFocused = _c[1];
7233
+ var _c = useAutoUpdateLayoutState(initFocused == null ? formFocused : initFocused), focused = _c[0], setFocused = _c[1];
7195
7234
  // Ref -------------------------------------------------------------------------------------------------------------
7196
7235
  var editorRef = React.useRef(null);
7197
7236
  var keyDownTime = React.useRef(0);
7198
7237
  // State - value ---------------------------------------------------------------------------------------------------
7199
- var _d = useAutoUpdateState$1(initValue), value = _d[0], setValue = _d[1];
7238
+ var _d = useAutoUpdateLayoutState(initValue), value = _d[0], setValue = _d[1];
7200
7239
  useFirstSkipEffect$1(function () {
7201
7240
  if (error)
7202
7241
  validate(value);
@@ -7205,10 +7244,10 @@ styleInject(css_248z$a);var FormTextEditor = React__default["default"].forwardRe
7205
7244
  onValueChange(name, value);
7206
7245
  }, [value]);
7207
7246
  // State -----------------------------------------------------------------------------------------------------------
7208
- var _e = useAutoUpdateState$1(initError), error = _e[0], setError = _e[1];
7209
- var _f = useAutoUpdateState$1(initHelperText), helperText = _f[0], setHelperText = _f[1];
7247
+ var _e = useAutoUpdateLayoutState(initError), error = _e[0], setError = _e[1];
7248
+ var _f = useAutoUpdateLayoutState(initHelperText), helperText = _f[0], setHelperText = _f[1];
7210
7249
  var _g = React.useState(false), initialized = _g[0], setInitialized = _g[1];
7211
- var _h = useAutoUpdateState$1(initDisabled), disabled = _h[0], setDisabled = _h[1];
7250
+ var _h = useAutoUpdateLayoutState(initDisabled), disabled = _h[0], setDisabled = _h[1];
7212
7251
  // Function - focus ------------------------------------------------------------------------------------------------
7213
7252
  var focus = React.useCallback(function () {
7214
7253
  var _a, _b;
@@ -7219,6 +7258,11 @@ styleInject(css_248z$a);var FormTextEditor = React__default["default"].forwardRe
7219
7258
  textarea.style.display = 'none';
7220
7259
  }
7221
7260
  }, [editorRef]);
7261
+ // Function - setErrorHelperText -----------------------------------------------------------------------------------
7262
+ var setErrorHelperText = React.useCallback(function (error, helperText) {
7263
+ setError(error);
7264
+ setHelperText(helperText);
7265
+ }, [setError, setHelperText]);
7222
7266
  // Function - validate ---------------------------------------------------------------------------------------------
7223
7267
  var validate = React.useCallback(function (value) {
7224
7268
  var isEmptyValue = false;
@@ -7241,12 +7285,7 @@ styleInject(css_248z$a);var FormTextEditor = React__default["default"].forwardRe
7241
7285
  }
7242
7286
  setErrorHelperText(false, initHelperText);
7243
7287
  return true;
7244
- }, [onValidate, initHelperText]);
7245
- // Function - setErrorHelperText -----------------------------------------------------------------------------------
7246
- var setErrorHelperText = React.useCallback(function (error, helperText) {
7247
- setError(error);
7248
- setHelperText(helperText);
7249
- }, []);
7288
+ }, [required, onValidate, setErrorHelperText, initHelperText]);
7250
7289
  // Commands --------------------------------------------------------------------------------------------------------
7251
7290
  React.useLayoutEffect(function () {
7252
7291
  var lastValue = value;
@@ -7309,6 +7348,10 @@ styleInject(css_248z$a);var FormTextEditor = React__default["default"].forwardRe
7309
7348
  ref,
7310
7349
  onAddValueItem,
7311
7350
  onRemoveValueItem,
7351
+ id,
7352
+ setValue,
7353
+ setDisabled,
7354
+ setErrorHelperText,
7312
7355
  ]);
7313
7356
  // Event Handler ---------------------------------------------------------------------------------------------------
7314
7357
  var handleEditorChange = React.useCallback(function (value) {
@@ -7319,7 +7362,7 @@ styleInject(css_248z$a);var FormTextEditor = React__default["default"].forwardRe
7319
7362
  onValueChangeByUser(name, value);
7320
7363
  });
7321
7364
  }
7322
- }, [name, onValueChangeByUser]);
7365
+ }, [name, onValueChangeByUser, setValue]);
7323
7366
  var handleKeyDown = React.useCallback(function () {
7324
7367
  keyDownTime.current = new Date().getTime();
7325
7368
  }, []);
@@ -7361,7 +7404,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
7361
7404
  // ID --------------------------------------------------------------------------------------------------------------
7362
7405
  var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
7363
7406
  //----------------------------------------------------------------------------------------------------------------
7364
- 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, initMultiple = _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, onLoadItems = _a.onLoadItems, onRenderItem = _a.onRenderItem, onRenderTag = _a.onRenderTag, onAddItem = _a.onAddItem,
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, onLoadItems = _a.onLoadItems, onRenderItem = _a.onRenderItem, onRenderTag = _a.onRenderTag, onAddItem = _a.onAddItem,
7365
7408
  //----------------------------------------------------------------------------------------------------------------
7366
7409
  onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate,
7367
7410
  //----------------------------------------------------------------------------------------------------------------
@@ -7371,25 +7414,22 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
7371
7414
  var textFieldRef = React.useRef(null);
7372
7415
  // FormState -------------------------------------------------------------------------------------------------------
7373
7416
  var _b = useFormState(), formVariant = _b.variant, formSize = _b.size, formColor = _b.color, formFocused = _b.focused, formLabelShrink = _b.labelShrink, formFullWidth = _b.fullWidth, onAddValueItem = _b.onAddValueItem, onRemoveValueItem = _b.onRemoveValueItem, onValueChange = _b.onValueChange, onValueChangeByUser = _b.onValueChangeByUser, onRequestSearchSubmit = _b.onRequestSearchSubmit;
7374
- // State - FormState -----------------------------------------------------------------------------------------------
7375
- var variant = useAutoUpdateState$1(initVariant || formVariant)[0];
7376
- var size = useAutoUpdateState$1(initSize || formSize)[0];
7377
- var color = useAutoUpdateState$1(initColor || formColor)[0];
7378
- var focused = useAutoUpdateState$1(initFocused || formFocused)[0];
7379
- var labelShrink = useAutoUpdateState$1(initLabelShrink || formLabelShrink)[0];
7380
- var fullWidth = useAutoUpdateState$1(initFullWidth == null ? formFullWidth : initFullWidth)[0];
7417
+ // Memo - FormState ------------------------------------------------------------------------------------------------
7418
+ var variant = React.useMemo(function () { return (initVariant == null ? formVariant : initVariant); }, [initVariant, formVariant]);
7419
+ var size = React.useMemo(function () { return (initSize == null ? formSize : initSize); }, [initSize, formSize]);
7420
+ var color = React.useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
7421
+ var focused = React.useMemo(function () { return (initFocused == null ? formFocused : initFocused); }, [initFocused, formFocused]);
7422
+ var labelShrink = React.useMemo(function () { return (initLabelShrink == null ? formLabelShrink : initLabelShrink); }, [initLabelShrink, formLabelShrink]);
7423
+ var fullWidth = React.useMemo(function () { return (initFullWidth == null ? formFullWidth : initFullWidth); }, [initFullWidth, formFullWidth]);
7381
7424
  // State -----------------------------------------------------------------------------------------------------------
7382
7425
  var _c = React.useState(false), isOnGetItemLoading = _c[0], setIsOnGetItemLoading = _c[1];
7383
- var _d = useAutoUpdateState$1(initItems), items = _d[0], setItems = _d[1];
7384
- var _e = useAutoUpdateState$1(initError), error = _e[0], setError = _e[1];
7385
- var _f = useAutoUpdateState$1(initHelperText), helperText = _f[0], setHelperText = _f[1];
7386
- var _g = useAutoUpdateState$1(initLoading), loading = _g[0], setLoading = _g[1];
7387
- var _h = useAutoUpdateState$1(initDisabled), disabled = _h[0], setDisabled = _h[1];
7388
- var multiple = useAutoUpdateLayoutState(React.useCallback(function () {
7389
- return initMultiple;
7390
- }, [initMultiple]))[0];
7391
- // State - itemsValues-----------------------------------------------------------------------------------------------------------
7392
- var itemsValues = useAutoUpdateState$1(React.useCallback(function () {
7426
+ var _d = useAutoUpdateLayoutState(initItems), items = _d[0], setItems = _d[1];
7427
+ var _e = useAutoUpdateLayoutState(initError), error = _e[0], setError = _e[1];
7428
+ var _f = useAutoUpdateLayoutState(initHelperText), helperText = _f[0], setHelperText = _f[1];
7429
+ var _g = useAutoUpdateLayoutState(initLoading), loading = _g[0], setLoading = _g[1];
7430
+ var _h = useAutoUpdateLayoutState(initDisabled), disabled = _h[0], setDisabled = _h[1];
7431
+ // Memo --------------------------------------------------------------------------------------------------------------
7432
+ var itemsValues = React.useMemo(function () {
7393
7433
  if (items) {
7394
7434
  return items.reduce(function (res, _a) {
7395
7435
  var value = _a.value;
@@ -7400,19 +7440,18 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
7400
7440
  else {
7401
7441
  return {};
7402
7442
  }
7403
- }, [items]))[0];
7404
- // State - style ---------------------------------------------------------------------------------------------------
7405
- var style = useAutoUpdateState$1(React.useCallback(function () {
7443
+ }, [items]);
7444
+ var style = React.useMemo(function () {
7406
7445
  var style = __assign$4({ minWidth: 120 }, initStyle);
7407
7446
  if (width != null) {
7408
7447
  style.width = width;
7409
7448
  }
7410
7449
  return style;
7411
- }, [initStyle, width]))[0];
7450
+ }, [initStyle, width]);
7412
7451
  // Function - getFinalValue ----------------------------------------------------------------------------------------
7413
7452
  var getFinalValue = React.useCallback(function (value) {
7414
7453
  var finalValue = value;
7415
- if (initMultiple) {
7454
+ if (multiple) {
7416
7455
  if (!Array.isArray(finalValue)) {
7417
7456
  if (finalValue != null && notEmpty(finalValue)) {
7418
7457
  if (typeof finalValue === 'string') {
@@ -7439,7 +7478,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
7439
7478
  }
7440
7479
  if (notEmpty(itemsValues)) {
7441
7480
  if (finalValue != null && notEmpty(finalValue)) {
7442
- if (initMultiple) {
7481
+ if (multiple) {
7443
7482
  if (Array.isArray(finalValue)) {
7444
7483
  finalValue = finalValue.map(function (v) {
7445
7484
  var realValue = itemsValues[v.toString()];
@@ -7456,13 +7495,13 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
7456
7495
  }
7457
7496
  }
7458
7497
  return onValue ? onValue(finalValue) : finalValue;
7459
- }, [initMultiple, formValueSeparator, itemsValues, onValue]);
7498
+ }, [multiple, formValueSeparator, itemsValues, onValue]);
7460
7499
  // State - value ---------------------------------------------------------------------------------------------------
7461
7500
  var _j = useAutoUpdateLayoutState(initValue, getFinalValue), value = _j[0], setValue = _j[1];
7462
- var componentValue = useAutoUpdateLayoutState(React.useCallback(function () {
7501
+ var componentValue = React.useMemo(function () {
7463
7502
  var finalValue = value;
7464
7503
  if (finalValue != null) {
7465
- if (initMultiple) {
7504
+ if (multiple) {
7466
7505
  if (!Array.isArray(finalValue)) {
7467
7506
  finalValue = [finalValue];
7468
7507
  }
@@ -7474,20 +7513,20 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
7474
7513
  }
7475
7514
  }
7476
7515
  else {
7477
- finalValue = initMultiple ? [] : undefined;
7516
+ finalValue = multiple ? [] : undefined;
7478
7517
  }
7479
7518
  if (notEmpty(finalValue) && items) {
7480
7519
  if (Array.isArray(finalValue)) {
7481
7520
  return items.filter(function (info) { return Array.isArray(finalValue) && finalValue.includes(info.value); });
7482
7521
  }
7483
7522
  else {
7484
- return items.find(function (info) { return info.value === value; }) || (initMultiple ? [] : null);
7523
+ return items.find(function (info) { return info.value === value; }) || (multiple ? [] : null);
7485
7524
  }
7486
7525
  }
7487
7526
  else {
7488
- return initMultiple ? [] : null;
7527
+ return multiple ? [] : null;
7489
7528
  }
7490
- }, [value, initMultiple, items]))[0];
7529
+ }, [value, multiple, items]);
7491
7530
  // Effect ----------------------------------------------------------------------------------------------------------
7492
7531
  React.useEffect(function () {
7493
7532
  if (value !== initValue) {
@@ -7502,6 +7541,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
7502
7541
  setIsOnGetItemLoading(false);
7503
7542
  });
7504
7543
  }
7544
+ // eslint-disable-next-line react-hooks/exhaustive-deps
7505
7545
  }, []);
7506
7546
  useFirstSkipEffect$1(function () {
7507
7547
  if (error)
@@ -7515,6 +7555,11 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
7515
7555
  var _a;
7516
7556
  (_a = textFieldRef.current) === null || _a === void 0 ? void 0 : _a.focus();
7517
7557
  }, [textFieldRef]);
7558
+ // Function - setErrorHelperText -----------------------------------------------------------------------------------
7559
+ var setErrorHelperText = React.useCallback(function (error, helperText) {
7560
+ setError(error);
7561
+ setHelperText(helperText);
7562
+ }, [setError, setHelperText]);
7518
7563
  // Function - validate ---------------------------------------------------------------------------------------------
7519
7564
  var validate = React.useCallback(function (value) {
7520
7565
  if (required && empty$1(value)) {
@@ -7530,12 +7575,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
7530
7575
  }
7531
7576
  setErrorHelperText(false, initHelperText);
7532
7577
  return true;
7533
- }, [required, onValidate, initHelperText]);
7534
- // Function - setErrorHelperText -----------------------------------------------------------------------------------
7535
- var setErrorHelperText = React.useCallback(function (error, helperText) {
7536
- setError(error);
7537
- setHelperText(helperText);
7538
- }, []);
7578
+ }, [required, onValidate, setErrorHelperText, initHelperText]);
7539
7579
  // Commands --------------------------------------------------------------------------------------------------------
7540
7580
  React.useLayoutEffect(function () {
7541
7581
  if (ref || onAddValueItem) {
@@ -7621,6 +7661,14 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
7621
7661
  ref,
7622
7662
  onAddValueItem,
7623
7663
  onRemoveValueItem,
7664
+ loading,
7665
+ id,
7666
+ setValue,
7667
+ setDisabled,
7668
+ setErrorHelperText,
7669
+ initHelperText,
7670
+ setItems,
7671
+ setLoading,
7624
7672
  ]);
7625
7673
  // Event Handler ---------------------------------------------------------------------------------------------------
7626
7674
  var handleChange = React.useCallback(function (componentValue, reason, details) {
@@ -7637,7 +7685,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
7637
7685
  }
7638
7686
  }
7639
7687
  var finalValue = getFinalValue(newValue);
7640
- if (!isSame$1(value, finalValue)) {
7688
+ if (!isSame$2(value, finalValue)) {
7641
7689
  setValue(finalValue);
7642
7690
  nextTick(function () {
7643
7691
  onValueChangeByUser(name, finalValue);
@@ -7665,9 +7713,9 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
7665
7713
  else {
7666
7714
  go();
7667
7715
  }
7668
- }, [value, multiple, readOnly, getFinalValue, name, onValueChangeByUser, onRequestSearchSubmit, onAddItem]);
7716
+ }, [multiple, getFinalValue, value, setValue, onValueChangeByUser, name, onRequestSearchSubmit, onAddItem]);
7669
7717
  // Render ----------------------------------------------------------------------------------------------------------
7670
- return (React__default["default"].createElement(material.Autocomplete, { options: items || [], className: classNames$1(className, 'FormAutocomplete'), sx: sx, multiple: multiple, fullWidth: !width && fullWidth, openOnFocus: openOnFocus, disableClearable: disableClearable, disablePortal: disablePortal, noOptionsText: noOptionsText, value: componentValue, style: style, isOptionEqualToValue: function (option, value) { return option.value === value.value; }, disabled: disabled, readOnly: readOnly, loading: loading || isOnGetItemLoading, loadingText: loadingText, limitTags: limitTags, onChange: function (e, value, reason, details) { return handleChange(value, reason, details); }, renderOption: function (props, option) { return (React__default["default"].createElement("li", __assign$4({}, props, { key: option.value }), onRenderItem ? onRenderItem(option) : option.label)); }, renderTags: function (value, getTagProps) {
7718
+ return (React__default["default"].createElement(material.Autocomplete, { options: items || [], className: classNames$1(className, 'FormValueItem', 'FormAutocomplete'), sx: sx, multiple: multiple, fullWidth: !width && fullWidth, openOnFocus: openOnFocus, disableClearable: disableClearable, disablePortal: disablePortal, noOptionsText: noOptionsText, value: componentValue, style: style, isOptionEqualToValue: function (option, value) { return option.value === value.value; }, disabled: disabled, readOnly: readOnly, loading: loading || isOnGetItemLoading, loadingText: loadingText, limitTags: limitTags, onChange: function (e, value, reason, details) { return handleChange(value, reason, details); }, renderOption: function (props, option) { return (React__default["default"].createElement("li", __assign$4({}, props, { key: option.value }), onRenderItem ? onRenderItem(option) : option.label)); }, renderTags: function (value, getTagProps) {
7671
7719
  return value.map(function (option, index) { return (React__default["default"].createElement(material.Chip, __assign$4({ size: 'small', label: onRenderTag ? onRenderTag(option) : option.label }, getTagProps({ index: index })))); });
7672
7720
  }, renderInput: function (params) { return (React__default["default"].createElement(FormTextField, __assign$4({}, params, { ref: textFieldRef, name: name, variant: variant, size: size, color: color, labelIcon: labelIcon, label: label, labelShrink: labelShrink, required: required, focused: focused, error: error, helperText: helperText, placeholder: placeholder, noFormValueItem: true, InputProps: __assign$4(__assign$4({}, params.InputProps), { endAdornment: (React__default["default"].createElement(React__default["default"].Fragment, null,
7673
7721
  loading || isOnGetItemLoading ? React__default["default"].createElement(CircularProgress__default["default"], { color: 'inherit', size: 20 }) : null,
@@ -7848,10 +7896,8 @@ IconText.defaultProps = IconTextDefaultProps;var PrivateDatePickerDefaultProps =
7848
7896
  styleInject(css_248z$9);var PrivateToggleButtonDefaultProps = {};var PrivateToggleButton = React__default["default"].forwardRef(function (_a, ref) {
7849
7897
  var children = _a.children, initClassName = _a.className, selected = _a.selected, activated = _a.activated, outlined = _a.outlined, props = __rest$2(_a, ["children", "className", "selected", "activated", "outlined"]);
7850
7898
  var theme = material.useTheme();
7851
- var className = useAutoUpdateState$1(React.useCallback(function () {
7852
- return classNames$1(initClassName, selected && 'selected', activated && 'activated', outlined && 'outlined');
7853
- }, [initClassName, selected, activated, outlined]))[0];
7854
- var sx = useAutoUpdateState$1(React.useCallback(function () {
7899
+ var className = React.useMemo(function () { return classNames$1(initClassName, selected && 'selected', activated && 'activated', outlined && 'outlined'); }, [activated, initClassName, outlined, selected]);
7900
+ var sx = React.useMemo(function () {
7855
7901
  var newSx = {
7856
7902
  color: 'inherit',
7857
7903
  ':hover': {
@@ -7872,7 +7918,7 @@ styleInject(css_248z$9);var PrivateToggleButtonDefaultProps = {};var PrivateTogg
7872
7918
  }
7873
7919
  }
7874
7920
  return newSx;
7875
- }, [selected, activated, outlined]))[0];
7921
+ }, [activated, outlined, selected, theme]);
7876
7922
  return (React__default["default"].createElement(material.Button, __assign$4({}, props, { ref: ref, sx: sx, variant: 'text', className: classNames$1(className, selected && 'selected') }), children));
7877
7923
  });
7878
7924
  PrivateToggleButton.displayName = 'PrivateToggleButton';
@@ -14032,6 +14078,7 @@ var PrivateYearSelect = function (_a) {
14032
14078
  });
14033
14079
  }
14034
14080
  }
14081
+ // eslint-disable-next-line react-hooks/exhaustive-deps
14035
14082
  }, []);
14036
14083
  // Render ----------------------------------------------------------------------------------------------------------
14037
14084
  var today = dayjs__default["default"]().startOf('date');
@@ -14138,6 +14185,7 @@ var PrivateTimeSelect = React__default["default"].forwardRef(function (_a, ref)
14138
14185
  if (value != null) {
14139
14186
  scrollToValue(value);
14140
14187
  }
14188
+ // eslint-disable-next-line react-hooks/exhaustive-deps
14141
14189
  }, []);
14142
14190
  // LayoutEffect ----------------------------------------------------------------------------------------------------
14143
14191
  React.useLayoutEffect(function () {
@@ -14208,24 +14256,14 @@ var PrivateStaticDatePicker = React__default["default"].forwardRef(function (_a,
14208
14256
  var _c = React.useState(null), activeMonthValue = _c[0], setActiveMonthValue = _c[1];
14209
14257
  var _d = React.useState(false), yearSelectOpen = _d[0], setYearSelectOpen = _d[1];
14210
14258
  var _e = React.useState(false), monthSelectOpen = _e[0], setMonthSelectOpen = _e[1];
14211
- var hours = useAutoUpdateState$1(React.useCallback(function () {
14212
- return initHours || DEFAULT_HOURS;
14213
- }, [initHours]))[0];
14214
- var minutes = useAutoUpdateState$1(React.useCallback(function () {
14215
- return initMinutes || DEFAULT_MINUTES;
14216
- }, [initMinutes]))[0];
14217
- var seconds = useAutoUpdateState$1(React.useCallback(function () {
14218
- return initSeconds || DEFAULT_SECONDS;
14219
- }, [initSeconds]))[0];
14220
- var availableDate = useAutoUpdateState$1(React.useCallback(function () {
14221
- if (initAvailableDate) {
14222
- return initAvailableDate;
14223
- }
14224
- else {
14225
- return makeAvailableDate(minDate, maxDate, !!disablePast, !!disableFuture);
14226
- }
14227
- }, [initAvailableDate, minDate, maxDate, disablePast, disableFuture]))[0];
14228
- var disableHours = useAutoUpdateState$1(React.useCallback(function () {
14259
+ // Memo --------------------------------------------------------------------------------------------------------------
14260
+ var hours = React.useMemo(function () { return initHours || DEFAULT_HOURS; }, [initHours]);
14261
+ var minutes = React.useMemo(function () { return initMinutes || DEFAULT_MINUTES; }, [initMinutes]);
14262
+ var seconds = React.useMemo(function () { return initSeconds || DEFAULT_SECONDS; }, [initSeconds]);
14263
+ var availableDate = React.useMemo(function () {
14264
+ return initAvailableDate ? initAvailableDate : makeAvailableDate(minDate, maxDate, !!disablePast, !!disableFuture);
14265
+ }, [initAvailableDate, minDate, maxDate, disablePast, disableFuture]);
14266
+ var disableHours = React.useMemo(function () {
14229
14267
  var newDisableHours = [];
14230
14268
  if (time && value && (availableDate[0] || availableDate[1])) {
14231
14269
  hours.forEach(function (h) {
@@ -14235,8 +14273,8 @@ var PrivateStaticDatePicker = React__default["default"].forwardRef(function (_a,
14235
14273
  });
14236
14274
  }
14237
14275
  return newDisableHours;
14238
- }, [time, value, availableDate, hours]))[0];
14239
- var disableMinutes = useAutoUpdateState$1(React.useCallback(function () {
14276
+ }, [time, value, availableDate, hours]);
14277
+ var disableMinutes = React.useMemo(function () {
14240
14278
  var newDisableMinutes = [];
14241
14279
  if (time === 'minute' || time === 'second') {
14242
14280
  if (value && (availableDate[0] || availableDate[1])) {
@@ -14248,8 +14286,8 @@ var PrivateStaticDatePicker = React__default["default"].forwardRef(function (_a,
14248
14286
  }
14249
14287
  }
14250
14288
  return newDisableMinutes;
14251
- }, [time, value, availableDate, minutes]))[0];
14252
- var disableSeconds = useAutoUpdateState$1(React.useCallback(function () {
14289
+ }, [time, value, availableDate, minutes]);
14290
+ var disableSeconds = React.useMemo(function () {
14253
14291
  var newDisableSeconds = [];
14254
14292
  if (time === 'second') {
14255
14293
  if (value && (availableDate[0] || availableDate[1])) {
@@ -14261,7 +14299,7 @@ var PrivateStaticDatePicker = React__default["default"].forwardRef(function (_a,
14261
14299
  }
14262
14300
  }
14263
14301
  return newDisableSeconds;
14264
- }, [time, value, availableDate, seconds]))[0];
14302
+ }, [time, value, availableDate, seconds]);
14265
14303
  // Effect ----------------------------------------------------------------------------------------------------------
14266
14304
  React.useEffect(function () {
14267
14305
  if (!yearSelectOpen) {
@@ -14285,12 +14323,10 @@ var PrivateStaticDatePicker = React__default["default"].forwardRef(function (_a,
14285
14323
  };
14286
14324
  return ArrowButton;
14287
14325
  })[0];
14288
- var components = useAutoUpdateState$1(React.useCallback(function () {
14289
- return {
14290
- LeftArrowButton: LeftArrowButton,
14291
- RightArrowButton: RightArrowButton,
14292
- };
14293
- }, [LeftArrowButton, RightArrowButton]))[0];
14326
+ var components = React.useMemo(function () { return ({
14327
+ LeftArrowButton: LeftArrowButton,
14328
+ RightArrowButton: RightArrowButton,
14329
+ }); }, [LeftArrowButton, RightArrowButton]);
14294
14330
  // Function --------------------------------------------------------------------------------------------------------
14295
14331
  var previousMonth = React.useCallback(function () {
14296
14332
  if (leftArrowOnClickRef.current) {
@@ -14367,7 +14403,7 @@ var PrivateStaticDatePicker = React__default["default"].forwardRef(function (_a,
14367
14403
  }
14368
14404
  onChange('action_date', finalDate, finalDate.format(inputFormat));
14369
14405
  } }, label));
14370
- }, [type, time, onChange, inputFormat, availableDate, timeSelectScrollToDate]);
14406
+ }, [type, time, onChange, inputFormat, availableDate]);
14371
14407
  // Render ----------------------------------------------------------------------------------------------------------
14372
14408
  return (React__default["default"].createElement(material.Grid, { container: true, className: classNames$1('PrivateStaticDatePicker', type) },
14373
14409
  type !== 'time' && (React__default["default"].createElement(material.Grid, { item: true },
@@ -14494,7 +14530,7 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default["default"].forwar
14494
14530
  //--------------------------------------------------------------------------------------------------------------------
14495
14531
  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,
14496
14532
  //--------------------------------------------------------------------------------------------------------------------
14497
- 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", "style", "sx"]);
14533
+ 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"]);
14498
14534
  var id = React.useId();
14499
14535
  // Ref -------------------------------------------------------------------------------------------------------------
14500
14536
  var privateStaticDatePickerRef = React.useRef(null);
@@ -14505,49 +14541,48 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default["default"].forwar
14505
14541
  var openValueRef = React.useRef(null);
14506
14542
  // FormState -------------------------------------------------------------------------------------------------------
14507
14543
  var _b = useFormState(), formVariant = _b.variant, formSize = _b.size, formColor = _b.color, formFocused = _b.focused, formLabelShrink = _b.labelShrink, formFullWidth = _b.fullWidth, formColWithHelperText = _b.formColWithHelperText, onAddValueItem = _b.onAddValueItem, onRemoveValueItem = _b.onRemoveValueItem, onValueChange = _b.onValueChange, onValueChangeByUser = _b.onValueChangeByUser, onRequestSearchSubmit = _b.onRequestSearchSubmit;
14508
- // State - FormState -----------------------------------------------------------------------------------------------
14509
- var variant = useAutoUpdateState$1(initVariant || formVariant)[0];
14510
- var size = useAutoUpdateState$1(initSize || formSize)[0];
14511
- var color = useAutoUpdateState$1(initColor || formColor)[0];
14512
- var focused = useAutoUpdateState$1(initFocused || formFocused)[0];
14513
- var labelShrink = useAutoUpdateState$1(initLabelShrink || formLabelShrink)[0];
14514
- var fullWidth = useAutoUpdateState$1(initFullWidth == null ? formFullWidth : initFullWidth)[0];
14544
+ // Memo - FormState ------------------------------------------------------------------------------------------------
14545
+ var variant = React.useMemo(function () { return (initVariant == null ? formVariant : initVariant); }, [initVariant, formVariant]);
14546
+ var size = React.useMemo(function () { return (initSize == null ? formSize : initSize); }, [initSize, formSize]);
14547
+ var color = React.useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
14548
+ var focused = React.useMemo(function () { return (initFocused == null ? formFocused : initFocused); }, [initFocused, formFocused]);
14549
+ var labelShrink = React.useMemo(function () { return (initLabelShrink == null ? formLabelShrink : initLabelShrink); }, [initLabelShrink, formLabelShrink]);
14550
+ var fullWidth = React.useMemo(function () { return (initFullWidth == null ? formFullWidth : initFullWidth); }, [initFullWidth, formFullWidth]);
14515
14551
  // State - open ----------------------------------------------------------------------------------------------------
14516
14552
  var _c = React.useState(false), open = _c[0], setOpen = _c[1];
14517
14553
  // State -----------------------------------------------------------------------------------------------------------
14518
- var _d = useAutoUpdateState$1(initError), error = _d[0], setError = _d[1];
14554
+ var _d = useAutoUpdateLayoutState(initError), error = _d[0], setError = _d[1];
14519
14555
  var _e = React.useState(null), timeError = _e[0], setTimeError = _e[1];
14520
- var _f = useAutoUpdateState$1(initHelperText), helperText = _f[0], setHelperText = _f[1];
14521
- var _g = useAutoUpdateState$1(initDisabled), disabled = _g[0], setDisabled = _g[1];
14522
- var label = useAutoUpdateState$1(React.useCallback(function () {
14556
+ var _f = useAutoUpdateLayoutState(initHelperText), helperText = _f[0], setHelperText = _f[1];
14557
+ var _g = useAutoUpdateLayoutState(initDisabled), disabled = _g[0], setDisabled = _g[1];
14558
+ // Memo --------------------------------------------------------------------------------------------------------------
14559
+ var label = React.useMemo(function () {
14523
14560
  if (labelIcon) {
14524
14561
  return React__default["default"].createElement(IconText, { icon: labelIcon }, initLabel);
14525
14562
  }
14526
14563
  else {
14527
14564
  return initLabel;
14528
14565
  }
14529
- }, [initLabel, labelIcon]))[0];
14530
- var format = useAutoUpdateState$1(React.useCallback(function () {
14566
+ }, [initLabel, labelIcon]);
14567
+ var format = React.useMemo(function () {
14531
14568
  if (initFormat) {
14532
14569
  return initFormat;
14533
14570
  }
14534
14571
  else {
14535
14572
  return getDateTimeFormat(type, time);
14536
14573
  }
14537
- }, [type, time, initFormat]))[0];
14538
- var formValueFormat = useAutoUpdateState$1(React.useCallback(function () {
14574
+ }, [initFormat, time, type]);
14575
+ var formValueFormat = React.useMemo(function () {
14539
14576
  if (initFormValueFormat) {
14540
14577
  return initFormValueFormat;
14541
14578
  }
14542
14579
  else {
14543
14580
  return getDateTimeFormValueFormat(type, time);
14544
14581
  }
14545
- }, [time, initFormValueFormat]))[0];
14546
- var availableDate = useAutoUpdateState$1(React.useCallback(function () {
14547
- return makeAvailableDate(minDate, maxDate, !!disablePast, !!disableFuture);
14548
- }, [minDate, maxDate, disablePast, disableFuture]))[0];
14582
+ }, [initFormValueFormat, time, type]);
14583
+ var availableDate = React.useMemo(function () { return makeAvailableDate(minDate, maxDate, !!disablePast, !!disableFuture); }, [disableFuture, disablePast, maxDate, minDate]);
14549
14584
  // State - style ---------------------------------------------------------------------------------------------------
14550
- var style = useAutoUpdateState$1(React.useCallback(function () {
14585
+ var style = useAutoUpdateLayoutState(React.useCallback(function () {
14551
14586
  if (width != null) {
14552
14587
  return __assign$4(__assign$4({}, initStyle), { width: width });
14553
14588
  }
@@ -14569,6 +14604,7 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default["default"].forwar
14569
14604
  onChange(value);
14570
14605
  onValueChange(name, value);
14571
14606
  }
14607
+ // eslint-disable-next-line react-hooks/exhaustive-deps
14572
14608
  }, []);
14573
14609
  useFirstSkipEffect$1(function () {
14574
14610
  if (error)
@@ -14604,7 +14640,7 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default["default"].forwar
14604
14640
  }
14605
14641
  }, [open]);
14606
14642
  React.useEffect(function () {
14607
- if (time && value && (availableDate[0] || availableDate[1])) {
14643
+ if (type !== 'time' && time && value && (availableDate[0] || availableDate[1])) {
14608
14644
  var availableDateVal = getAvailableDateVal(availableDate, type, time);
14609
14645
  var valueVal = getDateValForAvailableDate(value, type, time);
14610
14646
  var timeError_1 = null;
@@ -14619,12 +14655,18 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default["default"].forwar
14619
14655
  else {
14620
14656
  setTimeError(null);
14621
14657
  }
14658
+ // eslint-disable-next-line react-hooks/exhaustive-deps
14622
14659
  }, [value]);
14623
14660
  // Function - focus ------------------------------------------------------------------------------------------------
14624
14661
  var focus = React.useCallback(function () {
14625
14662
  var _a;
14626
14663
  (_a = textFieldInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
14627
14664
  }, [textFieldInputRef]);
14665
+ // Function - setErrorHelperText -----------------------------------------------------------------------------------
14666
+ var setErrorHelperText = React.useCallback(function (error, helperText) {
14667
+ setError(error);
14668
+ setHelperText(helperText);
14669
+ }, [setError, setHelperText]);
14628
14670
  // Function - validate ---------------------------------------------------------------------------------------------
14629
14671
  var validate = React.useCallback(function (value) {
14630
14672
  if (required && empty$1(value)) {
@@ -14652,12 +14694,7 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default["default"].forwar
14652
14694
  }
14653
14695
  setErrorHelperText(false, initHelperText);
14654
14696
  return true;
14655
- }, [required, onValidate, initHelperText, datePickerErrorRef, timeError]);
14656
- // Function - setErrorHelperText -----------------------------------------------------------------------------------
14657
- var setErrorHelperText = React.useCallback(function (error, helperText) {
14658
- setError(error);
14659
- setHelperText(helperText);
14660
- }, []);
14697
+ }, [required, timeError, onValidate, setErrorHelperText, initHelperText]);
14661
14698
  // Commands --------------------------------------------------------------------------------------------------------
14662
14699
  React.useLayoutEffect(function () {
14663
14700
  if (ref || onAddValueItem) {
@@ -14726,6 +14763,11 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default["default"].forwar
14726
14763
  ref,
14727
14764
  onAddValueItem,
14728
14765
  onRemoveValueItem,
14766
+ id,
14767
+ setValue,
14768
+ setDisabled,
14769
+ setErrorHelperText,
14770
+ initHelperText,
14729
14771
  ]);
14730
14772
  // Event Handler ---------------------------------------------------------------------------------------------------
14731
14773
  var handleChange = React.useCallback(function (unit, newValue, keyboardInputValue) {
@@ -14740,7 +14782,7 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default["default"].forwar
14740
14782
  }
14741
14783
  var finalValue = newValue;
14742
14784
  if (updateValue) {
14743
- if (finalValue != null && keyboardInputValue == null) {
14785
+ if (type !== 'time' && finalValue != null && keyboardInputValue == null) {
14744
14786
  var checkResult = checkDateAvailable(finalValue, availableDate, type, time);
14745
14787
  if (checkResult !== 'available') {
14746
14788
  var availableDateDate = getAvailableDate(availableDate, type, time);
@@ -14790,7 +14832,7 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default["default"].forwar
14790
14832
  }
14791
14833
  }
14792
14834
  setInputValue(finalValue);
14793
- }, [name, type, time, availableDate, open, value]);
14835
+ }, [type, time, setValue, availableDate, open, onValueChangeByUser, name, onRequestSearchSubmit]);
14794
14836
  var handleContainerFocus = React.useCallback(function () {
14795
14837
  if (closeTimeoutRef.current) {
14796
14838
  clearTimeout(closeTimeoutRef.current);
@@ -14819,7 +14861,7 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default["default"].forwar
14819
14861
  // Render ----------------------------------------------------------------------------------------------------------
14820
14862
  return (React__default["default"].createElement(xDatePickers.LocalizationProvider, { dateAdapter: AdapterDayjs.AdapterDayjs, adapterLocale: dayjsLocale__default["default"] },
14821
14863
  React__default["default"].createElement(material.ClickAwayListener, { mouseEvent: 'onMouseDown', touchEvent: 'onTouchStart', onClickAway: function () { return setOpen(false); } },
14822
- React__default["default"].createElement("div", { className: 'PrivateDatePicker', style: {
14864
+ React__default["default"].createElement("div", { className: classNames$1(className, 'PrivateDatePicker'), style: {
14823
14865
  display: fullWidth ? 'block' : 'inline-block',
14824
14866
  flex: fullWidth ? 1 : undefined,
14825
14867
  }, onMouseDown: handleContainerMouseDown, onFocus: handleContainerFocus, onBlur: handleContainerBlur },
@@ -14879,9 +14921,10 @@ PrivateDatePicker.defaultProps = PrivateDatePickerDefaultProps;var PrivateAlertD
14879
14921
  React__default["default"].createElement(material.Button, { variant: 'text', onClick: handleClose, autoFocus: true }, "\uD655\uC778"))));
14880
14922
  };
14881
14923
  PrivateAlertDialog.displayName = 'PrivateAlertDialog';
14882
- PrivateAlertDialog.defaultProps = PrivateAlertDialogDefaultProps;var FormDatePicker = React__default["default"].forwardRef(function (props, ref) {
14924
+ PrivateAlertDialog.defaultProps = PrivateAlertDialogDefaultProps;var FormDatePicker = React__default["default"].forwardRef(function (_a, ref) {
14883
14925
  // FormState -------------------------------------------------------------------------------------------------------
14884
- var _a = useFormState(), onAddValueItem = _a.onAddValueItem, otherFormState = __rest$2(_a, ["onAddValueItem"]);
14926
+ var className = _a.className, props = __rest$2(_a, ["className"]);
14927
+ var _b = useFormState(), onAddValueItem = _b.onAddValueItem, otherFormState = __rest$2(_b, ["onAddValueItem"]);
14885
14928
  // Event Handler ---------------------------------------------------------------------------------------------------
14886
14929
  var handleAddValueItem = React.useCallback(function (id, commands) {
14887
14930
  commands.getType = function () { return 'FormDatePicker'; };
@@ -14889,12 +14932,13 @@ PrivateAlertDialog.defaultProps = PrivateAlertDialogDefaultProps;var FormDatePic
14889
14932
  }, [onAddValueItem]);
14890
14933
  // Render ----------------------------------------------------------------------------------------------------------
14891
14934
  return (React__default["default"].createElement(FormContextProvider, { value: __assign$4({ onAddValueItem: handleAddValueItem }, otherFormState) },
14892
- React__default["default"].createElement(PrivateDatePicker, __assign$4({}, props, { ref: ref, type: 'date' }))));
14935
+ React__default["default"].createElement(PrivateDatePicker, __assign$4({ className: classNames$1(className, 'FormDatePicker') }, props, { ref: ref, type: 'date' }))));
14893
14936
  });
14894
14937
  FormDatePicker.displayName = 'FormDatePicker';
14895
- FormDatePicker.defaultProps = FormDatePickerDefaultProps;var FormDateTimePickerDefaultProps = {};var FormDateTimePicker = React__default["default"].forwardRef(function (props, ref) {
14938
+ FormDatePicker.defaultProps = FormDatePickerDefaultProps;var FormDateTimePickerDefaultProps = {};var FormDateTimePicker = React__default["default"].forwardRef(function (_a, ref) {
14896
14939
  // FormState -------------------------------------------------------------------------------------------------------
14897
- var _a = useFormState(), onAddValueItem = _a.onAddValueItem, otherFormState = __rest$2(_a, ["onAddValueItem"]);
14940
+ var className = _a.className, props = __rest$2(_a, ["className"]);
14941
+ var _b = useFormState(), onAddValueItem = _b.onAddValueItem, otherFormState = __rest$2(_b, ["onAddValueItem"]);
14898
14942
  // Event Handler ---------------------------------------------------------------------------------------------------
14899
14943
  var handleAddValueItem = React.useCallback(function (id, commands) {
14900
14944
  commands.getType = function () { return 'FormDateTimePicker'; };
@@ -14902,12 +14946,13 @@ FormDatePicker.defaultProps = FormDatePickerDefaultProps;var FormDateTimePickerD
14902
14946
  }, [onAddValueItem]);
14903
14947
  // Render ----------------------------------------------------------------------------------------------------------
14904
14948
  return (React__default["default"].createElement(FormContextProvider, { value: __assign$4({ onAddValueItem: handleAddValueItem }, otherFormState) },
14905
- React__default["default"].createElement(PrivateDatePicker, __assign$4({}, props, { ref: ref, type: 'date_time' }))));
14949
+ React__default["default"].createElement(PrivateDatePicker, __assign$4({ className: classNames$1(className, 'FormDateTimePicker') }, props, { ref: ref, type: 'date_time' }))));
14906
14950
  });
14907
14951
  FormDateTimePicker.displayName = 'FormDateTimePicker';
14908
- FormDateTimePicker.defaultProps = FormDateTimePickerDefaultProps;var FormTimePickerDefaultProps = {};var FormTimePicker = React__default["default"].forwardRef(function (props, ref) {
14952
+ FormDateTimePicker.defaultProps = FormDateTimePickerDefaultProps;var FormTimePickerDefaultProps = {};var FormTimePicker = React__default["default"].forwardRef(function (_a, ref) {
14909
14953
  // FormState -------------------------------------------------------------------------------------------------------
14910
- var _a = useFormState(), onAddValueItem = _a.onAddValueItem, otherFormState = __rest$2(_a, ["onAddValueItem"]);
14954
+ var className = _a.className, props = __rest$2(_a, ["className"]);
14955
+ var _b = useFormState(), onAddValueItem = _b.onAddValueItem, otherFormState = __rest$2(_b, ["onAddValueItem"]);
14911
14956
  // Event Handler ---------------------------------------------------------------------------------------------------
14912
14957
  var handleAddValueItem = React.useCallback(function (id, commands) {
14913
14958
  commands.getType = function () { return 'FormTimePicker'; };
@@ -14915,7 +14960,7 @@ FormDateTimePicker.defaultProps = FormDateTimePickerDefaultProps;var FormTimePic
14915
14960
  }, [onAddValueItem]);
14916
14961
  // Render ----------------------------------------------------------------------------------------------------------
14917
14962
  return (React__default["default"].createElement(FormContextProvider, { value: __assign$4({ onAddValueItem: handleAddValueItem }, otherFormState) },
14918
- React__default["default"].createElement(PrivateDatePicker, __assign$4({}, props, { ref: ref, type: 'time' }))));
14963
+ React__default["default"].createElement(PrivateDatePicker, __assign$4({ className: classNames$1(className, 'FormTimePicker') }, props, { ref: ref, type: 'time' }))));
14919
14964
  });
14920
14965
  FormTimePicker.displayName = 'FormTimePicker';
14921
14966
  FormTimePicker.defaultProps = FormTimePickerDefaultProps;var FormDateRangePickerDefaultProps = {
@@ -14931,7 +14976,7 @@ FormTimePicker.defaultProps = FormTimePickerDefaultProps;var FormDateRangePicker
14931
14976
  styleInject(css_248z$4);var CustomDatePicker = React__default["default"].forwardRef(function (_a, ref) {
14932
14977
  // State -----------------------------------------------------------------------------------------------------------
14933
14978
  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;
14934
- var value = useAutoUpdateState$1(React.useCallback(function () {
14979
+ var value = useAutoUpdateLayoutState(React.useCallback(function () {
14935
14980
  return initValue ? initValue : [null, null];
14936
14981
  }, [initValue]))[0];
14937
14982
  var _b = React.useState(null), activeMonthValue = _b[0], setActiveMonthValue = _b[1];
@@ -14952,18 +14997,16 @@ styleInject(css_248z$4);var CustomDatePicker = React__default["default"].forward
14952
14997
  };
14953
14998
  return ArrowButton;
14954
14999
  })[0];
14955
- var components = useAutoUpdateState$1(React.useCallback(function () {
14956
- return {
14957
- LeftArrowButton: LeftArrowButton,
14958
- RightArrowButton: RightArrowButton,
14959
- };
14960
- }, [LeftArrowButton, RightArrowButton]))[0];
15000
+ var components = React.useMemo(function () { return ({
15001
+ LeftArrowButton: LeftArrowButton,
15002
+ RightArrowButton: RightArrowButton,
15003
+ }); }, [LeftArrowButton, RightArrowButton]);
14961
15004
  //--------------------------------------------------------------------------------------------------------------------
14962
15005
  var getDateVal = React.useCallback(function (date) {
14963
15006
  return Number(date.format('YYYYMMDD'));
14964
15007
  }, []);
14965
15008
  //--------------------------------------------------------------------------------------------------------------------
14966
- var baseClassNames = useAutoUpdateState$1(React.useCallback(function () {
15009
+ var baseClassNames = React.useMemo(function () {
14967
15010
  var newValue = {};
14968
15011
  var lastDayOfMonth = month.endOf('month').date();
14969
15012
  var now = dayjs__default["default"](month);
@@ -14979,8 +15022,8 @@ styleInject(css_248z$4);var CustomDatePicker = React__default["default"].forward
14979
15022
  newValue[nowVal] = className;
14980
15023
  }
14981
15024
  return newValue;
14982
- }, [month]))[0];
14983
- var selectedClassNames = useAutoUpdateState$1(React.useCallback(function () {
15025
+ }, [getDateVal, month]);
15026
+ var selectedClassNames = React.useMemo(function () {
14984
15027
  var newValue = {};
14985
15028
  var startDateVal = value[0] ? getDateVal(value[0]) : null;
14986
15029
  var endDateVal = value[1] ? getDateVal(value[1]) : null;
@@ -15004,8 +15047,8 @@ styleInject(css_248z$4);var CustomDatePicker = React__default["default"].forward
15004
15047
  newValue[nowVal] = className;
15005
15048
  }
15006
15049
  return newValue;
15007
- }, [month, value]))[0];
15008
- var focusedClassNames = useAutoUpdateState$1(React.useCallback(function () {
15050
+ }, [getDateVal, month, value]);
15051
+ var focusedClassNames = React.useMemo(function () {
15009
15052
  var newValue = {};
15010
15053
  var startDateVal = value[0] ? getDateVal(value[0]) : null;
15011
15054
  var endDateVal = value[1] ? getDateVal(value[1]) : null;
@@ -15049,7 +15092,7 @@ styleInject(css_248z$4);var CustomDatePicker = React__default["default"].forward
15049
15092
  }
15050
15093
  }
15051
15094
  return newValue;
15052
- }, [selectType, month, value, focusedDate]))[0];
15095
+ }, [value, getDateVal, focusedDate, month, selectType]);
15053
15096
  //--------------------------------------------------------------------------------------------------------------------
15054
15097
  var previousMonth = React.useCallback(function () {
15055
15098
  if (leftArrowOnClickRef.current) {
@@ -15099,7 +15142,7 @@ styleInject(css_248z$4);var CustomDatePicker = React__default["default"].forward
15099
15142
  React__default["default"].createElement("div", { className: classNames$1('focused-bg', baseClassName, focusedClassName) }),
15100
15143
  React__default["default"].createElement("div", { className: classNames$1('selected-bg', baseClassName, selectedClassName) }),
15101
15144
  React__default["default"].createElement(xDatePickers.PickersDay, __assign$4({}, pickersDayProps, { disableMargin: true, selected: date.isSame(startDate, 'date') || date.isSame(endDate, 'date'), onMouseEnter: value[0] || value[1] ? function () { return onMouseEnterPickersDay && onMouseEnterPickersDay(date); } : undefined }))));
15102
- }, [value, baseClassNames, selectedClassNames, focusedClassNames]);
15145
+ }, [value, getDateVal, baseClassNames, selectedClassNames, focusedClassNames, onMouseEnterPickersDay]);
15103
15146
  return (React__default["default"].createElement(xDatePickers.StaticDatePicker, { className: 'CustomDatePicker', displayStaticWrapperAs: 'desktop', components: components, value: activeMonthValue, defaultCalendarMonth: month, disableFuture: disableFuture, disablePast: disablePast, minDate: minDate, maxDate: maxDate, onChange: function (newValue) { return onValueChange && onValueChange(selectType, newValue); }, renderDay: handleRenderDay, renderInput: function (params) { return React__default["default"].createElement(material.TextField, __assign$4({}, params)); }, inputFormat: 'YYYY-MM-DD HH:mm:ss', onMonthChange: function (month) {
15104
15147
  if (onMonthChange)
15105
15148
  onMonthChange(month);
@@ -15125,17 +15168,13 @@ var CustomDatePickerContainer = React__default["default"].forwardRef(function (_
15125
15168
  var datePicker3Ref = React.useRef(null);
15126
15169
  var yearSelectRef = React.useRef(null);
15127
15170
  var activeYearBtnRef = React.useRef(null);
15128
- // State -----------------------------------------------------------------------------------------------------------
15171
+ // Memo --------------------------------------------------------------------------------------------------------------
15129
15172
  var _b = React.useState(), focusedDate = _b[0], setFocusedDate = _b[1];
15130
15173
  var _c = React.useState(0), yearMonthSelectIndex = _c[0], setYearMonthSelectIndex = _c[1];
15131
15174
  var _d = React.useState(false), yearSelectOpen = _d[0], setYearSelectOpen = _d[1];
15132
15175
  var _e = React.useState(false), monthSelectOpen = _e[0], setMonthSelectOpen = _e[1];
15133
- var customDatePickerProps = useAutoUpdateState$1(React.useCallback(function () {
15134
- return { selectType: selectType, value: value, minDate: minDate, maxDate: maxDate, disableFuture: disableFuture, disablePast: disablePast, onValueChange: onValueChange };
15135
- }, [selectType, value, minDate, maxDate, disableFuture, disablePast, onValueChange]))[0];
15136
- var availableDate = useAutoUpdateState$1(React.useCallback(function () {
15137
- return makeAvailableDate(minDate, maxDate, !!disablePast, !!disableFuture);
15138
- }, [minDate, maxDate, disablePast, disableFuture]))[0];
15176
+ var customDatePickerProps = React.useMemo(function () { return ({ selectType: selectType, value: value, minDate: minDate, maxDate: maxDate, disableFuture: disableFuture, disablePast: disablePast, onValueChange: onValueChange }); }, [selectType, value, minDate, maxDate, disableFuture, disablePast, onValueChange]);
15177
+ var availableDate = React.useMemo(function () { return makeAvailableDate(minDate, maxDate, !!disablePast, !!disableFuture); }, [minDate, maxDate, disablePast, disableFuture]);
15139
15178
  // Effect ----------------------------------------------------------------------------------------------------------
15140
15179
  React.useEffect(function () {
15141
15180
  if (yearSelectOpen) {
@@ -15176,7 +15215,7 @@ var CustomDatePickerContainer = React__default["default"].forwardRef(function (_
15176
15215
  if (onMonthsChange) {
15177
15216
  onMonthsChange([date, date.add(1, 'month'), date.add(2, 'month')]);
15178
15217
  }
15179
- }, []);
15218
+ }, [onMonthsChange]);
15180
15219
  var handleYearSelectClick = React.useCallback(function (index) {
15181
15220
  if (yearSelectOpen) {
15182
15221
  setYearSelectOpen(false);
@@ -15213,11 +15252,11 @@ var CustomDatePickerContainer = React__default["default"].forwardRef(function (_
15213
15252
  activeMonth(months[yearMonthSelectIndex].set('year', year).subtract(yearMonthSelectIndex, 'month'));
15214
15253
  setYearSelectOpen(false);
15215
15254
  setMonthSelectOpen(true);
15216
- }, [months, yearMonthSelectIndex]);
15255
+ }, [activeMonth, months, yearMonthSelectIndex]);
15217
15256
  var handleMonthSelect = React.useCallback(function (m) {
15218
15257
  activeMonth(months[yearMonthSelectIndex].set('month', m).subtract(yearMonthSelectIndex, 'month'));
15219
15258
  setMonthSelectOpen(false);
15220
- }, [months, yearMonthSelectIndex]);
15259
+ }, [activeMonth, months, yearMonthSelectIndex]);
15221
15260
  // Commands --------------------------------------------------------------------------------------------------------
15222
15261
  React.useLayoutEffect(function () {
15223
15262
  if (ref) {
@@ -15251,7 +15290,7 @@ var CustomDatePickerContainer = React__default["default"].forwardRef(function (_
15251
15290
  React__default["default"].createElement(material.Button, { variant: 'text', className: monthSelectOpen && yearMonthSelectIndex === index ? 'active' : undefined, onClick: function () { return handleMonthSelectClick(index); } },
15252
15291
  months[index].format('M월'),
15253
15292
  React__default["default"].createElement(material.Icon, null, monthSelectOpen && yearMonthSelectIndex === index ? 'arrow_drop_up' : 'arrow_drop_down'))));
15254
- }, [months, yearSelectOpen, monthSelectOpen, yearMonthSelectIndex]);
15293
+ }, [yearSelectOpen, yearMonthSelectIndex, months, monthSelectOpen, handleYearSelectClick, handleMonthSelectClick]);
15255
15294
  // Render - Function -----------------------------------------------------------------------------------------------
15256
15295
  var getActionButton = React.useCallback(function (startDate, endDate, label) {
15257
15296
  var availableDateDate = getAvailableDate(availableDate, 'date');
@@ -15277,7 +15316,8 @@ var CustomDatePickerContainer = React__default["default"].forwardRef(function (_
15277
15316
  onChange([finalStartDate, finalEndDate]);
15278
15317
  } }, label));
15279
15318
  }, [onChange, availableDate]);
15280
- var actionButtons = useAutoUpdateState$1(React.useCallback(function () {
15319
+ // Render ----------------------------------------------------------------------------------------------------------
15320
+ var actionButtons = React.useMemo(function () {
15281
15321
  var now = dayjs__default["default"]().startOf('d');
15282
15322
  var lastWeek = now.subtract(1, 'week');
15283
15323
  var dayOfWeek = now.day();
@@ -15300,8 +15340,7 @@ var CustomDatePickerContainer = React__default["default"].forwardRef(function (_
15300
15340
  getActionButton(thisWeekDate[0], thisWeekDate[1], '이번주'),
15301
15341
  getActionButton(now.subtract(1, 'd'), now.subtract(1, 'd'), '어제'),
15302
15342
  getActionButton(now, now, '오늘')));
15303
- }, [getActionButton]))[0];
15304
- // Render ----------------------------------------------------------------------------------------------------------
15343
+ }, [getActionButton]);
15305
15344
  return (React__default["default"].createElement("div", { className: 'CustomDatePickerContainer' },
15306
15345
  React__default["default"].createElement(material.Grid, { container: true, direction: 'column' },
15307
15346
  !yearSelectOpen && !monthSelectOpen && (React__default["default"].createElement(material.Grid, { item: true },
@@ -15379,19 +15418,19 @@ styleInject(css_248z$2);var InputDatePicker = function (_a) {
15379
15418
  //--------------------------------------------------------------------------------------------------------------------
15380
15419
  className = _a.className, style = _a.style, value = _a.value, initLabel = _a.label, labelIcon = _a.labelIcon, inputRef = _a.inputRef, format = _a.format, error = _a.error, icon = _a.icon, startAdornment = _a.startAdornment, endAdornment = _a.endAdornment, align = _a.align, readOnlyInput = _a.readOnlyInput, onFocus = _a.onFocus, onBlur = _a.onBlur, props = __rest$2(_a, ["variant", "size", "color", "focused", "fullWidth", "disabled", "readOnly", "required", "labelShrink", "className", "style", "value", "label", "labelIcon", "inputRef", "format", "error", "icon", "startAdornment", "endAdornment", "align", "readOnlyInput", "onFocus", "onBlur"]);
15381
15420
  var id = React.useId();
15382
- // State -----------------------------------------------------------------------------------------------------------
15383
- var label = useAutoUpdateState$1(React.useCallback(function () {
15421
+ // Memo --------------------------------------------------------------------------------------------------------------
15422
+ var label = React.useMemo(function () {
15384
15423
  return labelIcon ? (React__default["default"].createElement(React__default["default"].Fragment, null,
15385
15424
  React__default["default"].createElement(FormIcon, { style: { verticalAlign: 'middle', marginRight: 4 } }, labelIcon),
15386
15425
  React__default["default"].createElement("span", { style: { verticalAlign: 'middle' } }, initLabel))) : (initLabel);
15387
- }, [initLabel, labelIcon]))[0];
15388
- var inputLabelProps = useAutoUpdateState$1(React.useCallback(function () {
15426
+ }, [initLabel, labelIcon]);
15427
+ var inputLabelProps = React.useMemo(function () {
15389
15428
  if (labelShrink) {
15390
15429
  return {
15391
15430
  shrink: true,
15392
15431
  };
15393
15432
  }
15394
- }, [labelShrink]))[0];
15433
+ }, [labelShrink]);
15395
15434
  // Render ----------------------------------------------------------------------------------------------------------
15396
15435
  return (React__default["default"].createElement(xDatePickers.DesktopDatePicker, __assign$4({}, props, { className: classNames$1(className, 'InputDatePicker', "align-".concat(align)), open: false, value: value, inputFormat: format, disabled: disabled, readOnly: readOnly || readOnlyInput, renderInput: function (_a) {
15397
15436
  var inputStyle = _a.style, inputInputRef = _a.inputRef, inputInputProps = _a.InputProps, inputError = _a.error, inputOnFocus = _a.onFocus, inputOnBlur = _a.onBlur, params = __rest$2(_a, ["style", "inputRef", "InputProps", "error", "onFocus", "onBlur"]);
@@ -15435,17 +15474,19 @@ var FormDateRangePicker = React__default["default"].forwardRef(function (_a, ref
15435
15474
  // ID --------------------------------------------------------------------------------------------------------------
15436
15475
  var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
15437
15476
  //--------------------------------------------------------------------------------------------------------------------
15438
- 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;
15477
+ 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,
15478
+ // -------------------------------------------------------------------------------------------------------------------
15479
+ className = _a.className;
15439
15480
  var id = React.useId();
15440
15481
  // FormState -------------------------------------------------------------------------------------------------------
15441
15482
  var _b = useFormState(), formVariant = _b.variant, formSize = _b.size, formColor = _b.color, formFocused = _b.focused, formLabelShrink = _b.labelShrink, formFullWidth = _b.fullWidth, formColWithHelperText = _b.formColWithHelperText, onAddValueItem = _b.onAddValueItem, onRemoveValueItem = _b.onRemoveValueItem, onValueChange = _b.onValueChange, onValueChangeByUser = _b.onValueChangeByUser, onRequestSearchSubmit = _b.onRequestSearchSubmit;
15442
- // State - FormState -----------------------------------------------------------------------------------------------
15443
- var variant = useAutoUpdateState$1(initVariant || formVariant)[0];
15444
- var size = useAutoUpdateState$1(initSize || formSize)[0];
15445
- var color = useAutoUpdateState$1(initColor || formColor)[0];
15446
- var focused = useAutoUpdateState$1(initFocused || formFocused)[0];
15447
- var labelShrink = useAutoUpdateState$1(initLabelShrink || formLabelShrink)[0];
15448
- var fullWidth = useAutoUpdateState$1(initFullWidth == null ? formFullWidth : initFullWidth)[0];
15483
+ // Memo - FormState ------------------------------------------------------------------------------------------------
15484
+ var variant = React.useMemo(function () { return (initVariant == null ? formVariant : initVariant); }, [initVariant, formVariant]);
15485
+ var size = React.useMemo(function () { return (initSize == null ? formSize : initSize); }, [initSize, formSize]);
15486
+ var color = React.useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
15487
+ var focused = React.useMemo(function () { return (initFocused == null ? formFocused : initFocused); }, [initFocused, formFocused]);
15488
+ var labelShrink = React.useMemo(function () { return (initLabelShrink == null ? formLabelShrink : initLabelShrink); }, [initLabelShrink, formLabelShrink]);
15489
+ var fullWidth = React.useMemo(function () { return (initFullWidth == null ? formFullWidth : initFullWidth); }, [initFullWidth, formFullWidth]);
15449
15490
  // Ref -------------------------------------------------------------------------------------------------------------
15450
15491
  var containerRef = React.useRef(null);
15451
15492
  var startDateTextFieldRef = React.useRef();
@@ -15456,10 +15497,13 @@ var FormDateRangePicker = React__default["default"].forwardRef(function (_a, ref
15456
15497
  var endInputDatePickerErrorRef = React.useRef(null);
15457
15498
  var openValueRef = React.useRef();
15458
15499
  // State -----------------------------------------------------------------------------------------------------------
15459
- var _c = useAutoUpdateState$1(initError), error = _c[0], setError = _c[1];
15500
+ var _c = useAutoUpdateLayoutState(initError), error = _c[0], setError = _c[1];
15460
15501
  var _d = React.useState(false), startError = _d[0], setStartError = _d[1];
15461
15502
  var _e = React.useState(false), endError = _e[0], setEndError = _e[1];
15462
- var _f = useAutoUpdateState$1(initDisabled), disabled = _f[0], setDisabled = _f[1];
15503
+ var _f = useAutoUpdateLayoutState(initDisabled), disabled = _f[0], setDisabled = _f[1];
15504
+ var _g = useAutoUpdateLayoutState(initHelperText), helperText = _g[0], setHelperText = _g[1];
15505
+ // Memo --------------------------------------------------------------------------------------------------------------
15506
+ var format = React.useMemo(function () { return initFormat || DEFAULT_FORMAT; }, [initFormat]);
15463
15507
  // Function - getFinalValue ----------------------------------------------------------------------------------------
15464
15508
  var getFinalValue = React.useCallback(function (value) {
15465
15509
  return value || DEFAULT_VALUE;
@@ -15477,7 +15521,20 @@ var FormDateRangePicker = React__default["default"].forwardRef(function (_a, ref
15477
15521
  else {
15478
15522
  (_b = startDateTextFieldRef.current) === null || _b === void 0 ? void 0 : _b.focus();
15479
15523
  }
15480
- }, [error, startError, endError, startDateTextFieldRef, endDateTextFieldRef]);
15524
+ }, [endError, startDateTextFieldRef, endDateTextFieldRef]);
15525
+ // Function - setErrorHelperText -----------------------------------------------------------------------------------
15526
+ var setErrorHelperText = React.useCallback(function (error, helperText) {
15527
+ setError(error);
15528
+ setHelperText(helperText);
15529
+ }, [setError, setHelperText]);
15530
+ var setStartErrorHelperText = React.useCallback(function (error, helperText) {
15531
+ setStartError(error);
15532
+ setHelperText(helperText);
15533
+ }, [setHelperText]);
15534
+ var setEndErrorHelperText = React.useCallback(function (error, helperText) {
15535
+ setEndError(error);
15536
+ setHelperText(helperText);
15537
+ }, [setHelperText]);
15481
15538
  // Function - validate ---------------------------------------------------------------------------------------------
15482
15539
  var validate = React.useCallback(function (value) {
15483
15540
  var _a, _b;
@@ -15539,20 +15596,18 @@ var FormDateRangePicker = React__default["default"].forwardRef(function (_a, ref
15539
15596
  setStartError(false);
15540
15597
  setEndError(false);
15541
15598
  return true;
15542
- }, [required, requiredStart, requiredEnd, startError, endError, allowSingleSelect, onValidate, initHelperText]);
15543
- // Function - setErrorHelperText -----------------------------------------------------------------------------------
15544
- var setErrorHelperText = React.useCallback(function (error, helperText) {
15545
- setError(error);
15546
- setHelperText(helperText);
15547
- }, []);
15548
- var setStartErrorHelperText = React.useCallback(function (error, helperText) {
15549
- setStartError(error);
15550
- setHelperText(helperText);
15551
- }, []);
15552
- var setEndErrorHelperText = React.useCallback(function (error, helperText) {
15553
- setEndError(error);
15554
- setHelperText(helperText);
15555
- }, []);
15599
+ }, [
15600
+ required,
15601
+ requiredStart,
15602
+ requiredEnd,
15603
+ allowSingleSelect,
15604
+ format,
15605
+ onValidate,
15606
+ setErrorHelperText,
15607
+ initHelperText,
15608
+ setStartErrorHelperText,
15609
+ setEndErrorHelperText,
15610
+ ]);
15556
15611
  // Function activeMonth --------------------------------------------------------------------------------------------
15557
15612
  var activeMonth = React.useCallback(function (month) {
15558
15613
  var _a;
@@ -15560,44 +15615,31 @@ var FormDateRangePicker = React__default["default"].forwardRef(function (_a, ref
15560
15615
  (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.activeMonth(month);
15561
15616
  }, [containerRef]);
15562
15617
  // State -----------------------------------------------------------------------------------------------------------
15563
- var _g = React.useState(false), open = _g[0], setOpen = _g[1];
15564
- var _h = React.useState('start'), selectType = _h[0], setSelectType = _h[1];
15565
- var _j = useAutoUpdateState$1(React.useCallback(function () {
15618
+ var _h = React.useState(false), open = _h[0], setOpen = _h[1];
15619
+ var _j = React.useState('start'), selectType = _j[0], setSelectType = _j[1];
15620
+ var _k = useAutoUpdateLayoutState(React.useCallback(function () {
15566
15621
  return initValue || DEFAULT_VALUE;
15567
- }, [initValue])), value = _j[0], setValue = _j[1];
15568
- var format = useAutoUpdateState$1(React.useCallback(function () {
15569
- return initFormat || DEFAULT_FORMAT;
15570
- }, [initFormat]))[0];
15571
- var calendarCount = useAutoUpdateState$1(initCalendarCount || 2)[0];
15572
- var _k = useAutoUpdateState$1(initHelperText), helperText = _k[0], setHelperText = _k[1];
15622
+ }, [initValue])), value = _k[0], setValue = _k[1];
15623
+ var calendarCount = useAutoUpdateLayoutState(initCalendarCount || 2)[0];
15573
15624
  var _l = React.useState(function () {
15574
15625
  var now = dayjs__default["default"]();
15575
15626
  return [now, now.add(1, 'month'), now.add(2, 'month')];
15576
15627
  }), months = _l[0], setMonths = _l[1];
15577
- var inputDatePickerProps = useAutoUpdateState$1(React.useCallback(function () {
15578
- return {
15579
- variant: variant,
15580
- size: size,
15581
- color: color,
15582
- labelShrink: labelShrink,
15583
- fullWidth: fullWidth,
15584
- disabled: disabled,
15585
- format: format,
15586
- disablePast: disablePast,
15587
- disableFuture: disableFuture,
15588
- minDate: minDate,
15589
- maxDate: maxDate,
15590
- };
15591
- }, [variant, size, color, labelShrink, fullWidth, disabled, format, disablePast, disableFuture, minDate, maxDate]))[0];
15592
- // State - inputStyle ----------------------------------------------------------------------------------------------
15593
- var inputStyle = useAutoUpdateState$1(React.useCallback(function () {
15594
- if (inputWidth != null) {
15595
- return { width: inputWidth };
15596
- }
15597
- else {
15598
- return { width: fullWidth ? undefined : 150 };
15599
- }
15600
- }, [inputWidth, fullWidth]))[0];
15628
+ // Memo --------------------------------------------------------------------------------------------------------------
15629
+ var inputDatePickerProps = React.useMemo(function () { return ({
15630
+ variant: variant,
15631
+ size: size,
15632
+ color: color,
15633
+ labelShrink: labelShrink,
15634
+ fullWidth: fullWidth,
15635
+ disabled: disabled,
15636
+ format: format,
15637
+ disablePast: disablePast,
15638
+ disableFuture: disableFuture,
15639
+ minDate: minDate,
15640
+ maxDate: maxDate,
15641
+ }); }, [variant, size, color, labelShrink, fullWidth, disabled, format, disablePast, disableFuture, minDate, maxDate]);
15642
+ var inputStyle = React.useMemo(function () { return (inputWidth != null ? { width: inputWidth } : { width: fullWidth ? undefined : 150 }); }, [inputWidth, fullWidth]);
15601
15643
  // Effect ----------------------------------------------------------------------------------------------------------
15602
15644
  React.useEffect(function () {
15603
15645
  if (value !== initValue) {
@@ -15605,6 +15647,7 @@ var FormDateRangePicker = React__default["default"].forwardRef(function (_a, ref
15605
15647
  onChange(value);
15606
15648
  onValueChange(name, value);
15607
15649
  }
15650
+ // eslint-disable-next-line react-hooks/exhaustive-deps
15608
15651
  }, []);
15609
15652
  useFirstSkipEffect$1(function () {
15610
15653
  if (error || startError || endError)
@@ -15654,7 +15697,7 @@ var FormDateRangePicker = React__default["default"].forwardRef(function (_a, ref
15654
15697
  setOpen(false);
15655
15698
  setStartErrorHelperText(false, initHelperText);
15656
15699
  setEndErrorHelperText(false, initHelperText);
15657
- }, []);
15700
+ }, [initHelperText, setEndErrorHelperText, setStartErrorHelperText, setValue]);
15658
15701
  var handleValueChange = React.useCallback(function (selectType, newValue, fromInput) {
15659
15702
  var _a;
15660
15703
  var finalValue;
@@ -15724,14 +15767,17 @@ var FormDateRangePicker = React__default["default"].forwardRef(function (_a, ref
15724
15767
  onValueChangeByUser(name, finalValue);
15725
15768
  });
15726
15769
  }, [
15727
- name,
15770
+ setValue,
15728
15771
  value,
15729
- activeMonth,
15730
15772
  setStartErrorHelperText,
15731
- setEndErrorHelperText,
15732
15773
  initHelperText,
15733
- allowSingleSelect,
15774
+ activeMonth,
15775
+ calendarCount,
15776
+ setEndErrorHelperText,
15734
15777
  open,
15778
+ onRequestSearchSubmit,
15779
+ name,
15780
+ onValueChangeByUser,
15735
15781
  ]);
15736
15782
  var handleInputDatePickerChange = React.useCallback(function (selectType, newValue) {
15737
15783
  var error = false;
@@ -15908,11 +15954,16 @@ var FormDateRangePicker = React__default["default"].forwardRef(function (_a, ref
15908
15954
  ref,
15909
15955
  onAddValueItem,
15910
15956
  onRemoveValueItem,
15957
+ id,
15958
+ setValue,
15959
+ setDisabled,
15960
+ setErrorHelperText,
15961
+ initHelperText,
15911
15962
  ]);
15912
15963
  // Render ----------------------------------------------------------------------------------------------------------
15913
15964
  return (React__default["default"].createElement(xDatePickers.LocalizationProvider, { dateAdapter: AdapterDayjs.AdapterDayjs, adapterLocale: dayjsLocale__default["default"] },
15914
15965
  React__default["default"].createElement(material.ClickAwayListener, { mouseEvent: 'onMouseDown', touchEvent: 'onTouchStart', onClickAway: function () { return setOpen(false); } },
15915
- React__default["default"].createElement("div", { style: {
15966
+ React__default["default"].createElement("div", { className: classNames$1(className, 'FormDateRangePicker'), style: {
15916
15967
  display: fullWidth ? 'block' : 'inline-block',
15917
15968
  flex: fullWidth ? 1 : undefined,
15918
15969
  }, onMouseDown: handleContainerMouseDown, onFocus: handleContainerFocus, onBlur: handleContainerBlur },
@@ -15999,18 +16050,18 @@ styleInject(css_248z$1);var FormFile = React__default["default"].forwardRef(func
15999
16050
  var id = React.useId();
16000
16051
  // FormState -------------------------------------------------------------------------------------------------------
16001
16052
  var _b = useFormState(), formVariant = _b.variant, formSize = _b.size, formColor = _b.color, formFocused = _b.focused, formLabelShrink = _b.labelShrink, formFullWidth = _b.fullWidth, onAddValueItem = _b.onAddValueItem, onValueChange = _b.onValueChange, onRemoveValueItem = _b.onRemoveValueItem, onValueChangeByUser = _b.onValueChangeByUser;
16002
- // State - FormState -----------------------------------------------------------------------------------------------
16003
- var variant = useAutoUpdateState$1(initVariant || formVariant)[0];
16004
- var size = useAutoUpdateState$1(initSize || formSize)[0];
16005
- var color = useAutoUpdateState$1(initColor || formColor)[0];
16006
- var focused = useAutoUpdateState$1(initFocused || formFocused)[0];
16007
- var labelShrink = useAutoUpdateState$1(initLabelShrink || formLabelShrink)[0];
16008
- var fullWidth = useAutoUpdateState$1(initFullWidth == null ? formFullWidth : initFullWidth)[0];
16053
+ // Memo - FormState ------------------------------------------------------------------------------------------------
16054
+ var variant = React.useMemo(function () { return (initVariant == null ? formVariant : initVariant); }, [initVariant, formVariant]);
16055
+ var size = React.useMemo(function () { return (initSize == null ? formSize : initSize); }, [initSize, formSize]);
16056
+ var color = React.useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
16057
+ var focused = React.useMemo(function () { return (initFocused == null ? formFocused : initFocused); }, [initFocused, formFocused]);
16058
+ var labelShrink = React.useMemo(function () { return (initLabelShrink == null ? formLabelShrink : initLabelShrink); }, [initLabelShrink, formLabelShrink]);
16059
+ var fullWidth = React.useMemo(function () { return (initFullWidth == null ? formFullWidth : initFullWidth); }, [initFullWidth, formFullWidth]);
16009
16060
  // Ref -------------------------------------------------------------------------------------------------------------
16010
16061
  var textFieldRef = React.useRef(null);
16011
16062
  var fileUploadBtnRef = React.useRef(null);
16012
16063
  // State - value ---------------------------------------------------------------------------------------------------
16013
- var _c = useAutoUpdateState$1(initValue), value = _c[0], setValue = _c[1];
16064
+ var _c = useAutoUpdateLayoutState(initValue), value = _c[0], setValue = _c[1];
16014
16065
  var fileValue = React.useState('')[0];
16015
16066
  useFirstSkipEffect$1(function () {
16016
16067
  if (error)
@@ -16020,16 +16071,17 @@ styleInject(css_248z$1);var FormFile = React__default["default"].forwardRef(func
16020
16071
  onValueChange(name, value);
16021
16072
  }, [value]);
16022
16073
  // State -----------------------------------------------------------------------------------------------------------
16023
- var _d = useAutoUpdateState$1(initError), error = _d[0], setError = _d[1];
16024
- var _e = useAutoUpdateState$1(initHelperText), helperText = _e[0], setHelperText = _e[1];
16025
- var _f = useAutoUpdateState$1(initDisabled), disabled = _f[0], setDisabled = _f[1];
16074
+ var _d = useAutoUpdateLayoutState(initError), error = _d[0], setError = _d[1];
16075
+ var _e = useAutoUpdateLayoutState(initHelperText), helperText = _e[0], setHelperText = _e[1];
16076
+ var _f = useAutoUpdateLayoutState(initDisabled), disabled = _f[0], setDisabled = _f[1];
16026
16077
  var _g = React.useState(false), isOpenLinkDialog = _g[0], setIsOpenLinkDialog = _g[1];
16027
16078
  var _h = React.useState({ open: false }), alertDialogProps = _h[0], setAlertDialogProps = _h[1];
16028
- var label = useAutoUpdateState$1(React.useCallback(function () {
16079
+ // Memo --------------------------------------------------------------------------------------------------------------
16080
+ var label = React.useMemo(function () {
16029
16081
  return labelIcon ? (React__default["default"].createElement(React__default["default"].Fragment, null,
16030
16082
  React__default["default"].createElement(FormIcon, { style: { verticalAlign: 'middle', marginRight: 4 } }, labelIcon),
16031
16083
  React__default["default"].createElement("span", { style: { verticalAlign: 'middle' } }, initLabel))) : (initLabel);
16032
- }, [initLabel, labelIcon]))[0];
16084
+ }, [initLabel, labelIcon]);
16033
16085
  // Function - focus ------------------------------------------------------------------------------------------------
16034
16086
  var focus = React.useCallback(function () {
16035
16087
  var _a, _b;
@@ -16040,6 +16092,11 @@ styleInject(css_248z$1);var FormFile = React__default["default"].forwardRef(func
16040
16092
  (_b = textFieldRef.current) === null || _b === void 0 ? void 0 : _b.focus();
16041
16093
  }
16042
16094
  }, [hideUrl]);
16095
+ // Function - setErrorHelperText -----------------------------------------------------------------------------------
16096
+ var setErrorHelperText = React.useCallback(function (error, helperText) {
16097
+ setError(error);
16098
+ setHelperText(helperText);
16099
+ }, [setError, setHelperText]);
16043
16100
  // Function - validate ---------------------------------------------------------------------------------------------
16044
16101
  var validate = React.useCallback(function (value) {
16045
16102
  var isEmptyValue = false;
@@ -16062,12 +16119,7 @@ styleInject(css_248z$1);var FormFile = React__default["default"].forwardRef(func
16062
16119
  }
16063
16120
  setErrorHelperText(false, initHelperText);
16064
16121
  return true;
16065
- }, [onValidate, initHelperText]);
16066
- // Function - setErrorHelperText -----------------------------------------------------------------------------------
16067
- var setErrorHelperText = React.useCallback(function (error, helperText) {
16068
- setError(error);
16069
- setHelperText(helperText);
16070
- }, []);
16122
+ }, [required, onValidate, setErrorHelperText, initHelperText]);
16071
16123
  // Commands --------------------------------------------------------------------------------------------------------
16072
16124
  React.useLayoutEffect(function () {
16073
16125
  var lastValue = value;
@@ -16130,6 +16182,10 @@ styleInject(css_248z$1);var FormFile = React__default["default"].forwardRef(func
16130
16182
  ref,
16131
16183
  onAddValueItem,
16132
16184
  onRemoveValueItem,
16185
+ id,
16186
+ setValue,
16187
+ setDisabled,
16188
+ setErrorHelperText,
16133
16189
  ]);
16134
16190
  // Function --------------------------------------------------------------------------------------------------------
16135
16191
  var fileSizeCheck = React.useCallback(function (file) {
@@ -16181,7 +16237,7 @@ styleInject(css_248z$1);var FormFile = React__default["default"].forwardRef(func
16181
16237
  });
16182
16238
  });
16183
16239
  }
16184
- }, [onFile, onValueChangeByUser]);
16240
+ }, [fileSizeCheck, name, onFile, onValueChangeByUser, setValue]);
16185
16241
  var handleLinkClick = React.useCallback(function () {
16186
16242
  setIsOpenLinkDialog(true);
16187
16243
  }, []);
@@ -16191,7 +16247,7 @@ styleInject(css_248z$1);var FormFile = React__default["default"].forwardRef(func
16191
16247
  if (onValueChangeByUser)
16192
16248
  onValueChangeByUser(name, '');
16193
16249
  });
16194
- }, [onValueChangeByUser]);
16250
+ }, [name, onValueChangeByUser, setValue]);
16195
16251
  var handleLinkDialogConfirm = React.useCallback(function (url) {
16196
16252
  if (onLink) {
16197
16253
  onLink(url).then(function (finalUrl) {
@@ -16209,7 +16265,7 @@ styleInject(css_248z$1);var FormFile = React__default["default"].forwardRef(func
16209
16265
  onValueChangeByUser(name, url);
16210
16266
  });
16211
16267
  }
16212
- }, [onLink, onValueChangeByUser]);
16268
+ }, [name, onLink, onValueChangeByUser, setValue]);
16213
16269
  // Render ----------------------------------------------------------------------------------------------------------
16214
16270
  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,
16215
16271
  preview,
@@ -16258,7 +16314,7 @@ FormFile.displayName = 'FormFile';
16258
16314
  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}";
16259
16315
  styleInject(css_248z);var FormImageFile = React__default["default"].forwardRef(function (_a, ref) {
16260
16316
  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"]);
16261
- var _b = useAutoUpdateState$1(initValue), value = _b[0], setValue = _b[1];
16317
+ var _b = useAutoUpdateLayoutState(initValue), value = _b[0], setValue = _b[1];
16262
16318
  var _c = React.useState(), previewNode = _c[0], setPreviewNode = _c[1];
16263
16319
  var _d = React.useState({
16264
16320
  open: false,
@@ -16337,7 +16393,7 @@ styleInject(css_248z);var FormImageFile = React__default["default"].forwardRef(f
16337
16393
  var handleChange = React.useCallback(function (value) {
16338
16394
  setValue(value);
16339
16395
  onChange && onChange(value);
16340
- }, []);
16396
+ }, [onChange, setValue]);
16341
16397
  var handleFile = React.useCallback(function (file) {
16342
16398
  return new Promise(function (resolve, reject) {
16343
16399
  imageSizeCheck(file)
@@ -16403,6 +16459,7 @@ SearchGroupRow.defaultProps = SearchGroupRowDefaultProps;var Search = React__def
16403
16459
  if (autoSubmit) {
16404
16460
  (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.submit();
16405
16461
  }
16462
+ // eslint-disable-next-line react-hooks/exhaustive-deps
16406
16463
  }, []);
16407
16464
  // Memo --------------------------------------------------------------------------------------------------------------
16408
16465
  var renderChildren = React.useMemo(function () {
@@ -16505,7 +16562,7 @@ var SearchGroup = function (_a) {
16505
16562
  var children = _a.children, className = _a.className, style = _a.style, sx = _a.sx,
16506
16563
  //--------------------------------------------------------------------------------------------------------------------
16507
16564
  max = _a.max, align = _a.align, hidden = _a.hidden, spacing = _a.spacing;
16508
- var justifyContent = useAutoUpdateState$1(React.useCallback(function () {
16565
+ var justifyContent = React.useMemo(function () {
16509
16566
  switch (align) {
16510
16567
  case undefined:
16511
16568
  case 'left':
@@ -16515,7 +16572,7 @@ var SearchGroup = function (_a) {
16515
16572
  case 'right':
16516
16573
  return 'end';
16517
16574
  }
16518
- }, [align]))[0];
16575
+ }, [align]);
16519
16576
  // Render ----------------------------------------------------------------------------------------------------------
16520
16577
  return (React__default["default"].createElement(material.Grid, { item: true, className: classNames$1(className, 'SearchGroup'), style: { flex: max ? 1 : undefined, display: hidden ? 'none' : undefined } },
16521
16578
  React__default["default"].createElement(material.Grid, { container: true, wrap: 'wrap', spacing: spacing, justifyContent: justifyContent, alignItems: 'start', style: style, sx: sx }, React__default["default"].Children.map(children, function (child) {
@@ -16528,11 +16585,9 @@ var SearchGroup = function (_a) {
16528
16585
  }))));
16529
16586
  };
16530
16587
  SearchGroup.defaultProps = SearchGroupDefaultProps;var SearchButtonDefaultProps = {};var SearchButton = function (_a) {
16531
- // State -----------------------------------------------------------------------------------------------------------
16588
+ // Memo --------------------------------------------------------------------------------------------------------------
16532
16589
  var children = _a.children, className = _a.className, initSx = _a.sx, startIcon = _a.startIcon, endIcon = _a.endIcon, icon = _a.icon, props = __rest$2(_a, ["children", "className", "sx", "startIcon", "endIcon", "icon"]);
16533
- var sx = useAutoUpdateState$1(React.useCallback(function () {
16534
- return __assign$4({ minWidth: 0, px: !startIcon && !endIcon && !icon ? 1.2 : 1.7 }, initSx);
16535
- }, [initSx, startIcon, endIcon, icon]))[0];
16590
+ var sx = React.useMemo(function () { return (__assign$4({ minWidth: 0, px: !startIcon && !endIcon && !icon ? 1.2 : 1.7 }, initSx)); }, [endIcon, icon, initSx, startIcon]);
16536
16591
  // Render ----------------------------------------------------------------------------------------------------------
16537
16592
  return (React__default["default"].createElement(FormButton, __assign$4({ className: classNames$1(className, 'SearchButton'), size: 'medium', sx: sx, fullWidth: false, startIcon: startIcon, endIcon: endIcon, icon: icon }, props), children));
16538
16593
  };