@pdg/react-form 1.0.56 → 1.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@private/PrivateDatePicker/PrivateDatePicker.types.d.ts +3 -6
- package/dist/@private/PrivateDateTimePicker/PrivateDateTimePicker.d.ts +5 -0
- package/dist/@private/PrivateDateTimePicker/PrivateDateTimePicker.types.d.ts +27 -0
- package/dist/@private/PrivateDateTimePicker/index.d.ts +4 -0
- package/dist/@private/PrivateStaticDatePicker/PrivateStaticDatePicker.types.d.ts +0 -2
- package/dist/@private/PrivateStaticDateTimePicker/PrivateStaticDateTimePicker.d.ts +5 -0
- package/dist/@private/PrivateStaticDateTimePicker/PrivateStaticDateTimePicker.types.d.ts +22 -0
- package/dist/@private/PrivateStaticDateTimePicker/index.d.ts +4 -0
- package/dist/@private/index.d.ts +2 -0
- package/dist/@types/types.d.ts +18 -18
- package/dist/@util/date_time.d.ts +2 -2
- package/dist/Form/Form.types.d.ts +8 -8
- package/dist/FormContext/FormContext.d.ts +1 -1
- package/dist/FormContext/FormContext.types.d.ts +6 -6
- package/dist/FormContext/useFormState.d.ts +1 -1
- package/dist/FormItemCustom/FormAutocomplete/FormAutocomplete.d.ts +6 -2
- package/dist/FormItemCustom/FormAutocomplete/FormAutocomplete.types.d.ts +18 -18
- package/dist/FormItemCustom/FormCheckbox/FormCheckbox.types.d.ts +8 -7
- package/dist/FormItemCustom/FormDateRangePicker/FormDateRangePicker.types.d.ts +3 -3
- package/dist/FormItemCustom/FormDateRangePicker/InputDatePicker/InputDatePicker.types.d.ts +1 -1
- package/dist/FormItemCustom/FormDateTimePicker/FormDateTimePicker.types.d.ts +4 -4
- package/dist/FormItemCustom/FormFile/FormFile.types.d.ts +4 -3
- package/dist/FormItemCustom/FormRadioGroup/FormRadioGroup.d.ts +5 -2
- package/dist/FormItemCustom/FormRadioGroup/FormRadioGroup.types.d.ts +11 -11
- package/dist/FormItemCustom/FormRating/FormRating.types.d.ts +3 -5
- package/dist/FormItemCustom/FormTextEditor/FormTextEditor.types.d.ts +4 -3
- package/dist/FormItemCustom/FormTimePicker/FormTimePicker.types.d.ts +4 -4
- package/dist/FormItemCustom/FormToggleButtonGroup/FormToggleButtonGroup.d.ts +6 -2
- package/dist/FormItemCustom/FormToggleButtonGroup/FormToggleButtonGroup.types.d.ts +13 -13
- package/dist/FormItemTextFieldBase/FormCompanyNo/FormCompanyNo.d.ts +2 -4
- package/dist/FormItemTextFieldBase/FormCompanyNo/FormCompanyNo.types.d.ts +5 -5
- package/dist/FormItemTextFieldBase/FormEmail/FormEmail.d.ts +1 -2
- package/dist/FormItemTextFieldBase/FormEmail/FormEmail.types.d.ts +3 -1
- package/dist/FormItemTextFieldBase/FormHidden/FormHidden.types.d.ts +4 -5
- package/dist/FormItemTextFieldBase/FormMobile/FormMobile.d.ts +1 -4
- package/dist/FormItemTextFieldBase/FormMobile/FormMobile.types.d.ts +3 -1
- package/dist/FormItemTextFieldBase/FormNumber/FormNumber.d.ts +3 -3
- package/dist/FormItemTextFieldBase/FormNumber/FormNumber.types.d.ts +5 -6
- package/dist/FormItemTextFieldBase/FormNumber/NumberFormatCustom.d.ts +1 -2
- package/dist/FormItemTextFieldBase/FormPassword/FormPassword.d.ts +1 -2
- package/dist/FormItemTextFieldBase/FormPassword/FormPassword.types.d.ts +5 -3
- package/dist/FormItemTextFieldBase/FormPersonalNo/FormPersonalNo.d.ts +2 -3
- package/dist/FormItemTextFieldBase/FormPersonalNo/FormPersonalNo.types.d.ts +4 -2
- package/dist/FormItemTextFieldBase/FormSearch/FormSearch.d.ts +1 -2
- package/dist/FormItemTextFieldBase/FormSearch/FormSearch.types.d.ts +4 -2
- package/dist/FormItemTextFieldBase/FormSelect/FormSelect.d.ts +6 -13
- package/dist/FormItemTextFieldBase/FormSelect/FormSelect.types.d.ts +14 -15
- package/dist/FormItemTextFieldBase/FormTag/FormTag.d.ts +2 -3
- package/dist/FormItemTextFieldBase/FormTag/FormTag.types.d.ts +6 -8
- package/dist/FormItemTextFieldBase/FormTel/FormTel.d.ts +2 -4
- package/dist/FormItemTextFieldBase/FormTel/FormTel.types.d.ts +5 -5
- package/dist/FormItemTextFieldBase/FormText/FormText.d.ts +2 -3
- package/dist/FormItemTextFieldBase/FormText/FormText.types.d.ts +4 -2
- package/dist/FormItemTextFieldBase/FormTextField/FormTextField.d.ts +5 -15
- package/dist/FormItemTextFieldBase/FormTextField/FormTextField.types.d.ts +5 -4
- package/dist/FormItemTextFieldBase/FormTextarea/FormTextarea.d.ts +2 -3
- package/dist/FormItemTextFieldBase/FormTextarea/FormTextarea.types.d.ts +4 -2
- package/dist/FormItemTextFieldBase/FormUrl/FormUrl.d.ts +1 -2
- package/dist/FormItemTextFieldBase/FormUrl/FormUrl.types.d.ts +3 -1
- package/dist/index.esm.js +838 -157
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +837 -156
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as React from'react';import React__default,{createContext,useContext,useMemo,useRef,useState,useCallback,useLayoutEffect,useEffect,cloneElement,isValidElement,createRef,PureComponent,useId}from'react';import {Box,Icon as Icon$1,Button,styled,useTheme,InputLabel,Grid,Collapse,FormHelperText,InputAdornment,IconButton,TextField,Chip,Autocomplete,CircularProgress,MenuItem,Checkbox,FormControl,Input,OutlinedInput,FilledInput,FormControlLabel,Typography,RadioGroup,Radio,ToggleButton,ToggleButtonGroup,Rating,Skeleton,darken,Tooltip,tooltipClasses,ClickAwayListener,Dialog,DialogTitle,DialogContent,DialogActions,Paper,Menu}from'@mui/material';import dayjs from'dayjs';import {findDOMNode}from'react-dom';import {CheckBox,CheckBoxOutlineBlank,RadioButtonUnchecked,RadioButtonChecked}from'@mui/icons-material';import CircularProgress$1 from'@mui/material/CircularProgress';import {AdapterDayjs}from'@mui/x-date-pickers/AdapterDayjs';import {PickersDay,StaticDatePicker,LocalizationProvider,DesktopDatePicker}from'@mui/x-date-pickers';/******************************************************************************
|
|
1
|
+
import*as React from'react';import React__default,{createContext,useContext,useMemo,useRef,useState,useCallback,useLayoutEffect,useEffect,cloneElement,isValidElement,createRef,PureComponent,useId}from'react';import {Box,Icon as Icon$1,Button,styled,useTheme,InputLabel,Grid,Collapse,FormHelperText,InputAdornment,IconButton,TextField,Chip,Autocomplete,CircularProgress,MenuItem,Checkbox,FormControl,Input,OutlinedInput,FilledInput,FormControlLabel,Typography,RadioGroup,Radio,ToggleButton,ToggleButtonGroup,Rating,Skeleton,darken,Tooltip,tooltipClasses,ClickAwayListener,Dialog,DialogTitle,DialogContent,DialogActions,Paper,Menu}from'@mui/material';import dayjs from'dayjs';import {findDOMNode}from'react-dom';import {CheckBox,CheckBoxOutlineBlank,RadioButtonUnchecked,RadioButtonChecked}from'@mui/icons-material';import CircularProgress$1 from'@mui/material/CircularProgress';import {AdapterDayjs}from'@mui/x-date-pickers/AdapterDayjs';import {PickersDay,StaticDatePicker,LocalizationProvider,DesktopDatePicker,StaticDateTimePicker,DesktopDateTimePicker}from'@mui/x-date-pickers';/******************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -2193,8 +2193,8 @@ FormFooter.defaultProps = FormFooterDefaultProps;var FormTextFieldDefaultProps =
|
|
|
2193
2193
|
} else {
|
|
2194
2194
|
style.appendChild(document.createTextNode(css));
|
|
2195
2195
|
}
|
|
2196
|
-
}var css_248z$
|
|
2197
|
-
styleInject(css_248z$
|
|
2196
|
+
}var css_248z$l = ".FormTextField {\n min-width: 200px;\n}\n.FormTextField .clear-icon-button-wrap {\n visibility: hidden;\n}\n.FormTextField.variant-filled .clear-icon-button-wrap {\n margin-top: 9px;\n margin-bottom: -9px;\n}\n.FormTextField:hover .clear-icon-button-wrap.show,\n.FormTextField .MuiInputBase-root.Mui-focused .clear-icon-button-wrap.show {\n visibility: visible;\n}";
|
|
2197
|
+
styleInject(css_248z$l);var FormTextField = React__default.forwardRef(function (_a, ref) {
|
|
2198
2198
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
2199
2199
|
var _b;
|
|
2200
2200
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
@@ -2500,28 +2500,19 @@ styleInject(css_248z$j);var FormTextField = React__default.forwardRef(function (
|
|
|
2500
2500
|
return (React__default.createElement(TextField, __assign$7({}, 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 })));
|
|
2501
2501
|
});
|
|
2502
2502
|
FormTextField.displayName = 'FormText';
|
|
2503
|
-
FormTextField.defaultProps = FormTextFieldDefaultProps;var
|
|
2504
|
-
|
|
2505
|
-
var className = _a.className, onValue = _a.onValue, props = __rest$4(_a, ["className", "onValue"]);
|
|
2506
|
-
var handleValue = useCallback(function (value) {
|
|
2507
|
-
var finalValue = value == null ? '' : value;
|
|
2508
|
-
if (onValue) {
|
|
2509
|
-
finalValue = onValue(finalValue);
|
|
2510
|
-
}
|
|
2511
|
-
return finalValue;
|
|
2512
|
-
}, [onValue]);
|
|
2513
|
-
// Render ----------------------------------------------------------------------------------------------------------
|
|
2514
|
-
return (React__default.createElement(FormTextField, __assign$7({ ref: ref, className: classNames$1(className, 'FormText'), disableReturnKey: true, onValue: handleValue }, props)));
|
|
2515
|
-
});
|
|
2516
|
-
FormText.displayName = 'FormText';
|
|
2517
|
-
FormText.defaultProps = FormTextDefaultProps;var FormHiddenDefaultProps = {};var css_248z$i = ".FormHidden {\n display: none !important;\n}";
|
|
2518
|
-
styleInject(css_248z$i);var FormHidden = React__default.forwardRef(function (_a, ref) {
|
|
2503
|
+
FormTextField.defaultProps = FormTextFieldDefaultProps;var FormHiddenDefaultProps = __assign$7({}, FormTextFieldDefaultProps);var css_248z$k = ".FormHidden {\n display: none !important;\n}";
|
|
2504
|
+
styleInject(css_248z$k);var FormHidden = React__default.forwardRef(function (_a, ref) {
|
|
2519
2505
|
var className = _a.className, props = __rest$4(_a, ["className"]);
|
|
2520
|
-
return (React__default.createElement(
|
|
2506
|
+
return (React__default.createElement(FormTextField, __assign$7({ ref: ref, className: classNames$1(className, 'FormHidden'), type: 'hidden', variant: 'standard' }, props)));
|
|
2521
2507
|
});
|
|
2522
2508
|
FormHidden.displayName = 'FormHidden';
|
|
2523
|
-
FormHidden.defaultProps = FormHiddenDefaultProps;var FormTagDefaultProps = __assign$7(__assign$7({},
|
|
2524
|
-
|
|
2509
|
+
FormHidden.defaultProps = FormHiddenDefaultProps;var FormTagDefaultProps = __assign$7(__assign$7({}, FormTextFieldDefaultProps), { value: [], clear: true, formValueSeparator: ',' });var FormTextDefaultProps = __assign$7(__assign$7({}, FormTextFieldDefaultProps), { clear: true, value: '' });var FormText = React__default.forwardRef(function (_a, ref) {
|
|
2510
|
+
var className = _a.className, props = __rest$4(_a, ["className"]);
|
|
2511
|
+
return (React__default.createElement(FormTextField, __assign$7({ ref: ref, className: classNames$1(className, 'FormText'), disableReturnKey: true }, props)));
|
|
2512
|
+
});
|
|
2513
|
+
FormText.displayName = 'FormText';
|
|
2514
|
+
FormText.defaultProps = FormTextDefaultProps;var css_248z$j = ".FormTag.FormTextField {\n min-width: 200px;\n}";
|
|
2515
|
+
styleInject(css_248z$j);var FormTag = React__default.forwardRef(function (_a, ref) {
|
|
2525
2516
|
// FormState -------------------------------------------------------------------------------------------------------
|
|
2526
2517
|
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$4(_a, ["className", "name", "value", "exceptValue", "required", "readOnly", "maxLength", "disabled", "fullWidth", "error", "helperText", "formValueSeparator", "formValueSort", "onValidate", "onKeyDown", "onChange", "onValue", "onBlur"]);
|
|
2527
2518
|
var _b = useFormState(), formFullWidth = _b.fullWidth, onAddValueItem = _b.onAddValueItem, onValueChange = _b.onValueChange, onValueChangeByUser = _b.onValueChangeByUser, onRequestSearchSubmit = _b.onRequestSearchSubmit, otherFormState = __rest$4(_b, ["fullWidth", "onAddValueItem", "onValueChange", "onValueChangeByUser", "onRequestSearchSubmit"]);
|
|
@@ -2542,9 +2533,9 @@ styleInject(css_248z$h);var FormTag = React__default.forwardRef(function (_a, re
|
|
|
2542
2533
|
}, [onValue]);
|
|
2543
2534
|
// State - value ---------------------------------------------------------------------------------------------------
|
|
2544
2535
|
var _c = useState(function () {
|
|
2545
|
-
return new Set(getFinalValue(initValue));
|
|
2536
|
+
return new Set(getFinalValue(initValue || []));
|
|
2546
2537
|
}), valueSet = _c[0], setValueSet = _c[1];
|
|
2547
|
-
var _d = useAutoUpdateState$1(initValue, getFinalValue), value = _d[0], setValue = _d[1];
|
|
2538
|
+
var _d = useAutoUpdateState$1(initValue || [], getFinalValue), value = _d[0], setValue = _d[1];
|
|
2548
2539
|
useFirstSkipEffect$1(function () {
|
|
2549
2540
|
if (error)
|
|
2550
2541
|
validate(value);
|
|
@@ -2596,8 +2587,8 @@ styleInject(css_248z$h);var FormTag = React__default.forwardRef(function (_a, re
|
|
|
2596
2587
|
// Function - getCommands ------------------------------------------------------------------------------------------
|
|
2597
2588
|
var getCommands = useCallback(function (baseCommands) {
|
|
2598
2589
|
var lastValue = value;
|
|
2599
|
-
return __assign$7(__assign$7(__assign$7({}, baseCommands), { getReset: function () { return getFinalValue(initValue); }, reset: function () {
|
|
2600
|
-
lastValue = getFinalValue(initValue);
|
|
2590
|
+
return __assign$7(__assign$7(__assign$7({}, baseCommands), { getReset: function () { return getFinalValue(initValue || []); }, reset: function () {
|
|
2591
|
+
lastValue = getFinalValue(initValue || []);
|
|
2601
2592
|
setValue(lastValue);
|
|
2602
2593
|
}, getValue: function () { return lastValue; }, setValue: function (newValue) {
|
|
2603
2594
|
var finalValue = getFinalValue(newValue);
|
|
@@ -2710,12 +2701,17 @@ styleInject(css_248z$h);var FormTag = React__default.forwardRef(function (_a, re
|
|
|
2710
2701
|
});
|
|
2711
2702
|
FormTag.displayName = 'FormTag';
|
|
2712
2703
|
FormTag.defaultProps = FormTagDefaultProps;var FormEmailDefaultProps = __assign$7(__assign$7({}, FormTextDefaultProps), { validPattern: /^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@(([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{2,})$/g });var FormEmail = React__default.forwardRef(function (_a, ref) {
|
|
2713
|
-
var className = _a.className, props = __rest$4(_a, ["className"]);
|
|
2714
|
-
|
|
2704
|
+
var className = _a.className, onValue = _a.onValue, props = __rest$4(_a, ["className", "onValue"]);
|
|
2705
|
+
var handleValue = useCallback(function (value) {
|
|
2706
|
+
var newValue = value.replace(/ /gi, '');
|
|
2707
|
+
return onValue ? onValue(newValue) : newValue;
|
|
2708
|
+
}, [onValue]);
|
|
2709
|
+
// Render ------------------------------------------------------------------------------------------------------------
|
|
2710
|
+
return (React__default.createElement(FormText, __assign$7({ ref: ref, className: classNames$1(className, 'FormEmail'), type: 'email', onValue: handleValue }, props)));
|
|
2715
2711
|
});
|
|
2716
2712
|
FormEmail.displayName = 'FormEmail';
|
|
2717
|
-
FormEmail.defaultProps = FormEmailDefaultProps;var FormPasswordDefaultProps = __assign$7(__assign$7({}, FormTextFieldDefaultProps), { clear: false, eye: true });var css_248z$
|
|
2718
|
-
styleInject(css_248z$
|
|
2713
|
+
FormEmail.defaultProps = FormEmailDefaultProps;var FormPasswordDefaultProps = __assign$7(__assign$7({}, FormTextFieldDefaultProps), { clear: false, eye: true });var css_248z$i = ".FormPassword .eye-icon-button-wrap {\n visibility: hidden;\n}\n.FormPassword.variant-filled .eye-icon-button-wrap {\n margin-top: 9px;\n margin-bottom: -9px;\n}\n.FormPassword:hover .eye-icon-button-wrap.show,\n.FormPassword .MuiInputBase-root.Mui-focused .eye-icon-button-wrap.show {\n visibility: visible;\n}";
|
|
2714
|
+
styleInject(css_248z$i);var StyledEyeInputAdornment = styled(InputAdornment)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n visibility: hidden;\n"], ["\n visibility: hidden;\n"])));
|
|
2719
2715
|
var FormPassword = React__default.forwardRef(function (_a, ref) {
|
|
2720
2716
|
// State -----------------------------------------------------------------------------------------------------------
|
|
2721
2717
|
var className = _a.className, initMuiInputProps = _a.InputProps, eye = _a.eye, onChange = _a.onChange, props = __rest$4(_a, ["className", "InputProps", "eye", "onChange"]);
|
|
@@ -2741,8 +2737,7 @@ var FormPassword = React__default.forwardRef(function (_a, ref) {
|
|
|
2741
2737
|
// Event Handler ---------------------------------------------------------------------------------------------------
|
|
2742
2738
|
var handleChange = useCallback(function (value) {
|
|
2743
2739
|
setShowEye(notEmpty(value));
|
|
2744
|
-
|
|
2745
|
-
onChange(value);
|
|
2740
|
+
onChange && onChange(value);
|
|
2746
2741
|
}, [onChange]);
|
|
2747
2742
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
2748
2743
|
return (React__default.createElement(FormText, __assign$7({ ref: ref, className: classNames$1(className, 'FormPassword'), onChange: handleChange, type: type, InputProps: muiInputProps }, props)));
|
|
@@ -2752,22 +2747,16 @@ FormPassword.defaultProps = FormPasswordDefaultProps;
|
|
|
2752
2747
|
var templateObject_1;var FormTelDefaultProps = __assign$7(__assign$7({}, FormTextDefaultProps), { validPattern: /(^([0-9]{2,3})([0-9]{3,4})([0-9]{4})$)|(^([0-9]{2,3})-([0-9]{3,4})-([0-9]{4})$)|(^([0-9]{4})-([0-9]{4})$)|(^\+(?:[-]?[0-9]){8,}$)/ });var FormTel = React__default.forwardRef(function (_a, ref) {
|
|
2753
2748
|
// Event Handler ---------------------------------------------------------------------------------------------------
|
|
2754
2749
|
var className = _a.className, onValue = _a.onValue, props = __rest$4(_a, ["className", "onValue"]);
|
|
2755
|
-
var
|
|
2756
|
-
var newValue = value;
|
|
2757
|
-
if (newValue && notEmpty(newValue)) {
|
|
2758
|
-
newValue = newValue.replace(/[^0-9]/gi, '');
|
|
2759
|
-
}
|
|
2760
|
-
newValue = autoDash$2(newValue);
|
|
2750
|
+
var handleValue = useCallback(function (value) {
|
|
2751
|
+
var newValue = autoDash$2(value.replace(/[^0-9]/gi, ''));
|
|
2761
2752
|
return onValue ? onValue(newValue) : newValue;
|
|
2762
2753
|
}, [onValue]);
|
|
2763
2754
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
2764
|
-
return (React__default.createElement(FormText, __assign$7({ ref: ref, className: classNames$1(className, 'FormTel'), onValue:
|
|
2755
|
+
return (React__default.createElement(FormText, __assign$7({ ref: ref, className: classNames$1(className, 'FormTel'), onValue: handleValue, maxLength: 13 }, props)));
|
|
2765
2756
|
});
|
|
2766
2757
|
FormTel.displayName = 'FormTel';
|
|
2767
2758
|
FormTel.defaultProps = FormTelDefaultProps;
|
|
2768
2759
|
function autoDash$2(tel) {
|
|
2769
|
-
if (tel == null)
|
|
2770
|
-
return undefined;
|
|
2771
2760
|
var str = tel.replace(/[^0-9*]/g, '');
|
|
2772
2761
|
var isLastDash = tel.substring(tel.length - 1, tel.length) === '-';
|
|
2773
2762
|
if (str.substring(0, 1) !== '0' && !['15', '16', '18'].includes(str.substring(0, 2))) {
|
|
@@ -4013,7 +4002,7 @@ function NumericFormat(props) {
|
|
|
4013
4002
|
onChange({ target: { value: values.value } });
|
|
4014
4003
|
} })));
|
|
4015
4004
|
});
|
|
4016
|
-
NumberFormatCustom.displayName = 'NumberFormatCustom';var FormNumberDefaultProps = __assign$7({},
|
|
4005
|
+
NumberFormatCustom.displayName = 'NumberFormatCustom';var FormNumberDefaultProps = __assign$7(__assign$7({}, FormTextFieldDefaultProps), { clear: true, value: '' });var FormNumber = React__default.forwardRef(function (_a, ref) {
|
|
4017
4006
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
4018
4007
|
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, tabIndex = _a.tabIndex, initMuiInputProps = _a.InputProps, props = __rest$4(_a, ["className", "allowLeadingZeros", "allowNegative", "thousandSeparator", "allowDecimal", "decimalScale", "prefix", "suffix", "readOnly", "tabIndex", "InputProps"]);
|
|
4019
4008
|
var muiInputProps = useMemo(function () {
|
|
@@ -4049,28 +4038,34 @@ NumberFormatCustom.displayName = 'NumberFormatCustom';var FormNumberDefaultProps
|
|
|
4049
4038
|
thousandSeparator,
|
|
4050
4039
|
]);
|
|
4051
4040
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
4052
|
-
return (React__default.createElement(
|
|
4041
|
+
return (React__default.createElement(FormTextField, __assign$7({ ref: ref, className: classNames$1(className, 'FormNumber'), disableReturnKey: true, InputProps: muiInputProps, readOnly: readOnly }, props)));
|
|
4053
4042
|
});
|
|
4054
4043
|
FormNumber.displayName = 'FormNumber';
|
|
4055
|
-
FormNumber.defaultProps = FormNumberDefaultProps;var FormSearchDefaultProps = __assign$7({}, FormTextDefaultProps);var css_248z$
|
|
4056
|
-
styleInject(css_248z$
|
|
4044
|
+
FormNumber.defaultProps = FormNumberDefaultProps;var FormSearchDefaultProps = __assign$7({}, FormTextDefaultProps);var css_248z$h = ".FormSearch input[type=search]::-webkit-search-decoration,\n.FormSearch input[type=search]::-webkit-search-cancel-button,\n.FormSearch input[type=search]::-webkit-search-results-button,\n.FormSearch input[type=search]::-webkit-search-results-decoration {\n -webkit-appearance: none;\n}";
|
|
4045
|
+
styleInject(css_248z$h);var FormSearch = React__default.forwardRef(function (_a, ref) {
|
|
4057
4046
|
var className = _a.className, props = __rest$4(_a, ["className"]);
|
|
4058
4047
|
return React__default.createElement(FormText, __assign$7({ className: classNames$1(className, 'FormSearch'), ref: ref, type: 'search' }, props));
|
|
4059
4048
|
});
|
|
4060
4049
|
FormSearch.displayName = 'FormSearch';
|
|
4061
|
-
FormSearch.defaultProps = FormSearchDefaultProps;var FormTextareaDefaultProps = __assign$7(__assign$7({}, FormTextFieldDefaultProps), { clear: false, rows: 3, value: '' });var css_248z$
|
|
4062
|
-
styleInject(css_248z$
|
|
4050
|
+
FormSearch.defaultProps = FormSearchDefaultProps;var FormTextareaDefaultProps = __assign$7(__assign$7({}, FormTextFieldDefaultProps), { clear: false, rows: 3, value: '' });var css_248z$g = ".FormTextarea .MuiInputBase-root .MuiInputBase-input {\n overflow-y: scroll;\n}\n.FormTextarea .MuiInputBase-root .MuiInputBase-input::-webkit-scrollbar {\n width: 8px;\n}\n.FormTextarea .MuiInputBase-root .MuiInputBase-input::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.1882352941);\n background-clip: padding-box;\n border-left: 4px transparent solid;\n}";
|
|
4051
|
+
styleInject(css_248z$g);var FormTextarea = React__default.forwardRef(function (_a, ref) {
|
|
4063
4052
|
var className = _a.className, props = __rest$4(_a, ["className"]);
|
|
4064
|
-
return React__default.createElement(FormTextField, __assign$7({ ref: ref, className: classNames$1(className, 'FormTextarea') }, props, { multiline: true }));
|
|
4053
|
+
return (React__default.createElement(FormTextField, __assign$7({ ref: ref, className: classNames$1(className, 'FormTextarea') }, props, { multiline: true })));
|
|
4065
4054
|
});
|
|
4066
4055
|
FormTextarea.displayName = 'FormTextarea';
|
|
4067
4056
|
FormTextarea.defaultProps = FormTextareaDefaultProps;var FormUrlDefaultProps = __assign$7(__assign$7({}, FormTextDefaultProps), { validPattern: /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'%()*+,;=.]+$/gim });var FormUrl = React__default.forwardRef(function (_a, ref) {
|
|
4068
|
-
|
|
4069
|
-
|
|
4057
|
+
// Event Handler -----------------------------------------------------------------------------------------------------
|
|
4058
|
+
var className = _a.className, onValue = _a.onValue, props = __rest$4(_a, ["className", "onValue"]);
|
|
4059
|
+
var handleValue = useCallback(function (value) {
|
|
4060
|
+
var newValue = value.replace(/ /gi, '');
|
|
4061
|
+
return onValue ? onValue(newValue) : newValue;
|
|
4062
|
+
}, [onValue]);
|
|
4063
|
+
// Render ------------------------------------------------------------------------------------------------------------
|
|
4064
|
+
return (React__default.createElement(FormText, __assign$7({ ref: ref, className: classNames$1(className, 'FormUrl'), type: 'url', onValue: handleValue }, props)));
|
|
4070
4065
|
});
|
|
4071
4066
|
FormUrl.displayName = 'FormUrl';
|
|
4072
|
-
FormUrl.defaultProps = FormUrlDefaultProps;var FormSelectDefaultProps = __assign$7(__assign$7({},
|
|
4073
|
-
styleInject(css_248z$
|
|
4067
|
+
FormUrl.defaultProps = FormUrlDefaultProps;var FormSelectDefaultProps = __assign$7(__assign$7({}, FormTextFieldDefaultProps), { formValueSeparator: ',', minWidth: 120 });var css_248z$f = ".FormSelect.is-selected-placeholder .MuiSelect-select {\n opacity: 0.38;\n}\n.FormSelect .MuiInputBase-root.MuiInputBase-adornedEnd {\n padding-right: 25px;\n}\n.FormSelect .MuiSelect-select.MuiSelect-multiple .selected-list:not(:empty) {\n margin-top: -3px;\n margin-bottom: -3px;\n}\n.FormSelect-Menu-Popover > .MuiPaper-root::-webkit-scrollbar {\n width: 12px;\n}\n.FormSelect-Menu-Popover > .MuiPaper-root::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.1882352941);\n background-clip: padding-box;\n border-left: 4px transparent solid;\n border-right: 4px transparent solid;\n}\n.FormSelect-Menu-Popover > .MuiPaper-root::-webkit-scrollbar-button:start:decrement, .FormSelect-Menu-Popover > .MuiPaper-root::-webkit-scrollbar-button:end:increment {\n display: block;\n height: 4px;\n background-color: transparent;\n}";
|
|
4068
|
+
styleInject(css_248z$f);var FormSelect = React__default.forwardRef(function (_a, ref) {
|
|
4074
4069
|
// FormState -------------------------------------------------------------------------------------------------------
|
|
4075
4070
|
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$4(_a, ["className", "name", "items", "fullWidth", "onLoadItems", "readOnly", "multiple", "checkbox", "placeholder", "startAdornment", "value", "InputLabelProps", "SelectProps", "formValueSeparator", "formValueSort", "width", "minWidth", "loading", "onChange", "onValue"]);
|
|
4076
4071
|
var _b = useFormState(), formFullWidth = _b.fullWidth, onAddValueItem = _b.onAddValueItem, onValueChange = _b.onValueChange, otherFormState = __rest$4(_b, ["fullWidth", "onAddValueItem", "onValueChange"]);
|
|
@@ -4304,7 +4299,7 @@ styleInject(css_248z$d);var FormSelect = React__default.forwardRef(function (_a,
|
|
|
4304
4299
|
return (React__default.createElement(FormContextProvider, { value: __assign$7({ fullWidth: formFullWidth, onAddValueItem: handleAddValueItem,
|
|
4305
4300
|
// eslint-disable-next-line
|
|
4306
4301
|
onValueChange: function () { } }, otherFormState) },
|
|
4307
|
-
React__default.createElement(
|
|
4302
|
+
React__default.createElement(FormTextField, __assign$7({ select: true, ref: handleRef, name: name, className: classNames$1(className, 'FormSelect', isSelectedPlaceholder && 'is-selected-placeholder'), fullWidth: fullWidth }, props, { startAdornment: startAdornment, value: finalValue, clear: false, readOnly: readOnly || empty(items), InputLabelProps: inputLabelProps, SelectProps: selectProps, onChange: handleChange, onValue: handleValue }),
|
|
4308
4303
|
isSelectedPlaceholder && (React__default.createElement(MenuItem, { key: '$$$EmptyValuePlaceholder$$$', value: '', disabled: true, sx: { display: 'none' } }, placeholder)),
|
|
4309
4304
|
items && notEmpty(items) ? (items.map(function (_a) {
|
|
4310
4305
|
var itemLabel = _a.label, itemValue = _a.value, disabled = _a.disabled;
|
|
@@ -4317,22 +4312,16 @@ FormSelect.displayName = 'FormSelect';
|
|
|
4317
4312
|
FormSelect.defaultProps = FormSelectDefaultProps;var FormCompanyNoDefaultProps = __assign$7(__assign$7({}, FormTextDefaultProps), { validPattern: /(([0-9]{3})([0-9]{2})([0-9]{5}))|(([0-9]{3})-([0-9]{2})-([0-9]{5}))/ });var FormCompanyNo = React__default.forwardRef(function (_a, ref) {
|
|
4318
4313
|
// Event Handler ---------------------------------------------------------------------------------------------------
|
|
4319
4314
|
var className = _a.className, onValue = _a.onValue, props = __rest$4(_a, ["className", "onValue"]);
|
|
4320
|
-
var
|
|
4321
|
-
var newValue = value;
|
|
4322
|
-
if (newValue && notEmpty(newValue)) {
|
|
4323
|
-
newValue = newValue.replace(/[^0-9]/gi, '');
|
|
4324
|
-
}
|
|
4325
|
-
newValue = autoDash$1(newValue);
|
|
4315
|
+
var handleValue = useCallback(function (value) {
|
|
4316
|
+
var newValue = autoDash$1(value.replace(/[^0-9]/gi, ''));
|
|
4326
4317
|
return onValue ? onValue(newValue) : newValue;
|
|
4327
4318
|
}, [onValue]);
|
|
4328
4319
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
4329
|
-
return (React__default.createElement(FormText, __assign$7({ ref: ref, className: classNames$1(className, 'FormCompanyNo'),
|
|
4320
|
+
return (React__default.createElement(FormText, __assign$7({ ref: ref, className: classNames$1(className, 'FormCompanyNo'), maxLength: 12, onValue: handleValue }, props)));
|
|
4330
4321
|
});
|
|
4331
4322
|
FormCompanyNo.displayName = 'FormCompanyNo';
|
|
4332
4323
|
FormCompanyNo.defaultProps = FormCompanyNoDefaultProps;
|
|
4333
4324
|
function autoDash$1(companyNo) {
|
|
4334
|
-
if (companyNo == null)
|
|
4335
|
-
return undefined;
|
|
4336
4325
|
var str = companyNo.replace(/[^0-9]/g, '');
|
|
4337
4326
|
var tmp = '';
|
|
4338
4327
|
for (var i = 0; i < str.length; i += 1) {
|
|
@@ -4345,12 +4334,8 @@ function autoDash$1(companyNo) {
|
|
|
4345
4334
|
}var FormPersonalNoDefaultProps = __assign$7(__assign$7({}, FormTextDefaultProps), { validPattern: /(([0-9]{6})([0-9]{7}))|(([0-9]{6})-([0-9]{7}))/ });var FormPersonalNo = React__default.forwardRef(function (_a, ref) {
|
|
4346
4335
|
// Event Handler ---------------------------------------------------------------------------------------------------
|
|
4347
4336
|
var className = _a.className, onValue = _a.onValue, onValidate = _a.onValidate, props = __rest$4(_a, ["className", "onValue", "onValidate"]);
|
|
4348
|
-
var
|
|
4349
|
-
var newValue = value;
|
|
4350
|
-
if (newValue && notEmpty(newValue)) {
|
|
4351
|
-
newValue = newValue.replace(/[^0-9]/gi, '');
|
|
4352
|
-
}
|
|
4353
|
-
newValue = autoDash(newValue);
|
|
4337
|
+
var handleValue = useCallback(function (value) {
|
|
4338
|
+
var newValue = autoDash(value.replace(/[^0-9]/gi, ''));
|
|
4354
4339
|
return onValue ? onValue(newValue) : newValue;
|
|
4355
4340
|
}, [onValue]);
|
|
4356
4341
|
var handleValidate = useCallback(function (value) {
|
|
@@ -4383,13 +4368,11 @@ function autoDash$1(companyNo) {
|
|
|
4383
4368
|
}
|
|
4384
4369
|
}, [onValidate]);
|
|
4385
4370
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
4386
|
-
return (React__default.createElement(FormText, __assign$7({ ref: ref, className: classNames$1(className, 'FormPersonalNo'),
|
|
4371
|
+
return (React__default.createElement(FormText, __assign$7({ ref: ref, className: classNames$1(className, 'FormPersonalNo'), maxLength: 14, onValue: handleValue, onValidate: handleValidate }, props)));
|
|
4387
4372
|
});
|
|
4388
4373
|
FormPersonalNo.displayName = 'FormPersonalNo';
|
|
4389
4374
|
FormPersonalNo.defaultProps = FormPersonalNoDefaultProps;
|
|
4390
4375
|
function autoDash(personalNo) {
|
|
4391
|
-
if (personalNo == null)
|
|
4392
|
-
return undefined;
|
|
4393
4376
|
var str = personalNo.replace(/[^0-9]/g, '');
|
|
4394
4377
|
var tmp = '';
|
|
4395
4378
|
for (var i = 0; i < str.length; i += 1) {
|
|
@@ -4403,8 +4386,8 @@ function autoDash(personalNo) {
|
|
|
4403
4386
|
checked: false,
|
|
4404
4387
|
value: 1,
|
|
4405
4388
|
uncheckedValue: 0,
|
|
4406
|
-
};var css_248z$
|
|
4407
|
-
styleInject(css_248z$
|
|
4389
|
+
};var css_248z$e = ".FormItemBase .FormItemBase-InputLabel {\n overflow: visible;\n padding-left: 5px;\n}\n.FormItemBase .FormItemBase-InputLabel.MuiInputLabel-sizeSmall {\n transform: translate(0, -1.5px) scale(0.7);\n}\n.FormItemBase .FormItemBase-Control-wrap {\n position: relative;\n}\n.FormItemBase .FormItemBase-Control {\n position: absolute;\n left: 0;\n top: 0;\n}\n.FormItemBase.variant-standard .FormItemBase-Control-wrap {\n margin-top: 16px;\n}";
|
|
4390
|
+
styleInject(css_248z$e);var FormItemBase = React__default.forwardRef(function (_a, ref) {
|
|
4408
4391
|
// Ref ---------------------------------------------------------------------------------------------------------------
|
|
4409
4392
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFullWidth = _a.fullWidth,
|
|
4410
4393
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -4556,13 +4539,13 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default.forw
|
|
|
4556
4539
|
var _h = useAutoUpdateState$1(initDisabled), disabled = _h[0], setDisabled = _h[1];
|
|
4557
4540
|
var _j = useAutoUpdateState$1(initData), data = _j[0], setData = _j[1];
|
|
4558
4541
|
// State - checked -------------------------------------------------------------------------------------------------
|
|
4559
|
-
var _k = useAutoUpdateState$1(initChecked), checked = _k[0], setChecked = _k[1];
|
|
4542
|
+
var _k = useAutoUpdateState$1(!!initChecked), checked = _k[0], setChecked = _k[1];
|
|
4560
4543
|
useFirstSkipEffect$1(function () {
|
|
4561
4544
|
if (error)
|
|
4562
4545
|
validate(checked);
|
|
4563
4546
|
if (onChange)
|
|
4564
|
-
onChange(
|
|
4565
|
-
onValueChange(name,
|
|
4547
|
+
onChange(checked);
|
|
4548
|
+
onValueChange(name, checked);
|
|
4566
4549
|
}, [checked]);
|
|
4567
4550
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
4568
4551
|
var style = useMemo(function () { return (__assign$7({ width: fullWidth ? '100%' : width || 100, paddingLeft: 3 }, initStyle)); }, [initStyle, fullWidth, width]);
|
|
@@ -4602,16 +4585,16 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default.forw
|
|
|
4602
4585
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
4603
4586
|
useLayoutEffect(function () {
|
|
4604
4587
|
var lastChecked = checked;
|
|
4605
|
-
var lastValue = value;
|
|
4588
|
+
var lastValue = value == null ? 1 : value;
|
|
4606
4589
|
var lastData = data;
|
|
4607
|
-
var lastUncheckedValue = uncheckedValue;
|
|
4590
|
+
var lastUncheckedValue = uncheckedValue == null ? 0 : uncheckedValue;
|
|
4608
4591
|
var lastDisabled = !!disabled;
|
|
4609
4592
|
var commands = {
|
|
4610
4593
|
getType: function () { return 'FormCheckbox'; },
|
|
4611
4594
|
getName: function () { return name; },
|
|
4612
|
-
getReset: function () { return initChecked; },
|
|
4595
|
+
getReset: function () { return !!initChecked; },
|
|
4613
4596
|
reset: function () {
|
|
4614
|
-
lastChecked = initChecked;
|
|
4597
|
+
lastChecked = !!initChecked;
|
|
4615
4598
|
setChecked(lastChecked);
|
|
4616
4599
|
},
|
|
4617
4600
|
getValue: function () { return lastValue; },
|
|
@@ -4629,7 +4612,7 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default.forw
|
|
|
4629
4612
|
lastUncheckedValue = uncheckedValue;
|
|
4630
4613
|
setUncheckedValue(lastUncheckedValue);
|
|
4631
4614
|
},
|
|
4632
|
-
getChecked: function () { return
|
|
4615
|
+
getChecked: function () { return lastChecked; },
|
|
4633
4616
|
setChecked: function (checked) {
|
|
4634
4617
|
lastChecked = checked;
|
|
4635
4618
|
setChecked(lastChecked);
|
|
@@ -4704,7 +4687,7 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default.forw
|
|
|
4704
4687
|
}
|
|
4705
4688
|
}, [readOnly, setChecked, onValueChangeByUser, name, onRequestSearchSubmit]);
|
|
4706
4689
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
4707
|
-
return (React__default.createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames$1(className, 'FormValueItem', 'FormCheckbox'), labelIcon: labelIcon, label: label, error: error, fullWidth: fullWidth, helperText: helperText, helperTextProps: { style: { marginLeft: 2 } }, style: style, sx: sx, hidden: hidden, autoSize: true, controlHeight: height || (size === 'small' ? 35 : 39), controlVerticalCenter: true, control: React__default.createElement(FormControlLabel, { ref: labelRef, control: React__default.createElement(Checkbox, __assign$7({ name: name, color: color, size: size, inputRef: initInputRef ? initInputRef : inputRef, action: initAction ? initAction : actionRef, checked:
|
|
4690
|
+
return (React__default.createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames$1(className, 'FormValueItem', 'FormCheckbox'), labelIcon: labelIcon, label: label, error: error, fullWidth: fullWidth, helperText: helperText, helperTextProps: { style: { marginLeft: 2 } }, style: style, sx: sx, hidden: hidden, autoSize: true, controlHeight: height || (size === 'small' ? 35 : 39), controlVerticalCenter: true, control: React__default.createElement(FormControlLabel, { ref: labelRef, control: React__default.createElement(Checkbox, __assign$7({ name: name, color: color, size: size, inputRef: initInputRef ? initInputRef : inputRef, action: initAction ? initAction : actionRef, checked: checked, checkedIcon: React__default.createElement(CheckBox, { color: error ? 'error' : undefined }), icon: React__default.createElement(CheckBoxOutlineBlank, { color: error ? 'error' : undefined }), onChange: handleChange, disabled: disabled || readOnly }, props)), label: React__default.createElement(Typography, { color: error ? 'error' : readOnly || disabled ? theme.palette.text.disabled : undefined, whiteSpace: 'nowrap' }, text) }) }));
|
|
4708
4691
|
});
|
|
4709
4692
|
FormCheckbox.displayName = 'FormCheckbox';
|
|
4710
4693
|
FormCheckbox.defaultProps = FormCheckboxDefaultProps;var FormRadioGroupDefaultProps = {
|
|
@@ -5023,8 +5006,8 @@ FormRadioGroup.displayName = 'FormRadioGroup';
|
|
|
5023
5006
|
FormRadioGroup.defaultProps = FormRadioGroupDefaultProps;var FormToggleButtonGroupDefaultProps = {
|
|
5024
5007
|
type: 'button',
|
|
5025
5008
|
formValueSeparator: ',',
|
|
5026
|
-
};var css_248z$
|
|
5027
|
-
styleInject(css_248z$
|
|
5009
|
+
};var css_248z$d = ".FormToggleButtonGroup .ToggleButton {\n display: inline-block;\n padding: 0 10px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.FormToggleButtonGroup.type-checkbox .ToggleButton, .FormToggleButtonGroup.type-radio .ToggleButton {\n padding-left: 3px;\n padding-right: 5px;\n border: 0 !important;\n margin-left: 0 !important;\n justify-content: flex-start;\n display: flex;\n background-color: transparent !important;\n}\n.FormToggleButtonGroup.type-checkbox .ToggleButton:not(:last-child), .FormToggleButtonGroup.type-radio .ToggleButton:not(:last-child) {\n margin-right: 5px;\n}\n.FormToggleButtonGroup.type-checkbox .ToggleButton .__checkbox-checked__,\n.FormToggleButtonGroup.type-checkbox .ToggleButton .__checkbox-unchecked__, .FormToggleButtonGroup.type-radio .ToggleButton .__checkbox-checked__,\n.FormToggleButtonGroup.type-radio .ToggleButton .__checkbox-unchecked__ {\n margin-right: 3px;\n}\n.FormToggleButtonGroup.type-checkbox .ToggleButton .__checkbox-checked__, .FormToggleButtonGroup.type-radio .ToggleButton .__checkbox-checked__ {\n display: none;\n}\n.FormToggleButtonGroup.type-checkbox .ToggleButton.Mui-selected .__checkbox-checked__, .FormToggleButtonGroup.type-radio .ToggleButton.Mui-selected .__checkbox-checked__ {\n display: block;\n}\n.FormToggleButtonGroup.type-checkbox .ToggleButton.Mui-selected .__checkbox-unchecked__, .FormToggleButtonGroup.type-radio .ToggleButton.Mui-selected .__checkbox-unchecked__ {\n display: none;\n}\n.FormToggleButtonGroup:not(.with-label).variant-outlined .FormItemBase-Control-wrap {\n margin-top: 15px;\n margin-bottom: -15px;\n}\n.FormToggleButtonGroup:not(.with-label).variant-outlined .FormItemBase-Control-wrap .ToggleButton {\n height: 37px;\n}\n.FormToggleButtonGroup:not(.with-label).variant-filled .FormItemBase-Control-wrap {\n margin-top: 15px;\n margin-bottom: -15px;\n}\n.FormToggleButtonGroup:not(.with-label).variant-filled .FormItemBase-Control-wrap .ToggleButton {\n height: 37px;\n}\n.FormToggleButtonGroup:not(.with-label).variant-standard .FormItemBase-Control-wrap {\n margin-top: 0px;\n margin-bottom: 0px;\n}\n.FormToggleButtonGroup:not(.with-label).variant-standard .FormItemBase-Control-wrap .ToggleButton {\n height: 28px;\n}\n.FormToggleButtonGroup:not(.with-label).size-small.variant-outlined .FormItemBase-Control-wrap {\n margin-top: 13px;\n margin-bottom: -13px;\n}\n.FormToggleButtonGroup:not(.with-label).size-small.variant-outlined .FormItemBase-Control-wrap .ToggleButton {\n height: 24px;\n}\n.FormToggleButtonGroup:not(.with-label).size-small.variant-filled .FormItemBase-Control-wrap {\n margin-top: 13px;\n margin-bottom: -13px;\n}\n.FormToggleButtonGroup:not(.with-label).size-small.variant-filled .FormItemBase-Control-wrap .ToggleButton {\n height: 31px;\n}\n.FormToggleButtonGroup:not(.with-label).size-small.variant-standard .FormItemBase-Control-wrap {\n margin-top: 0px;\n margin-bottom: 0px;\n}\n.FormToggleButtonGroup:not(.with-label).size-small.variant-standard .FormItemBase-Control-wrap .ToggleButton {\n height: 26px;\n}\n.FormToggleButtonGroup.with-label.variant-outlined .FormItemBase-Control-wrap {\n margin-top: 0;\n margin-bottom: 0;\n}\n.FormToggleButtonGroup.with-label.variant-outlined .FormItemBase-Control-wrap .ToggleButton {\n height: 37px;\n}\n.FormToggleButtonGroup.with-label.variant-filled .FormItemBase-Control-wrap {\n margin-top: 0;\n margin-bottom: 0;\n}\n.FormToggleButtonGroup.with-label.variant-filled .FormItemBase-Control-wrap .ToggleButton {\n height: 37px;\n}\n.FormToggleButtonGroup.with-label.variant-standard .FormItemBase-Control-wrap {\n margin-top: 0;\n margin-bottom: 0;\n}\n.FormToggleButtonGroup.with-label.variant-standard .FormItemBase-Control-wrap .ToggleButton {\n height: 28px;\n}\n.FormToggleButtonGroup.with-label.size-small.variant-outlined .FormItemBase-Control-wrap {\n margin-top: 0;\n margin-bottom: 0;\n}\n.FormToggleButtonGroup.with-label.size-small.variant-outlined .FormItemBase-Control-wrap .ToggleButton {\n height: 24px;\n}\n.FormToggleButtonGroup.with-label.size-small.variant-filled .FormItemBase-Control-wrap {\n margin-top: 0;\n margin-bottom: 0;\n}\n.FormToggleButtonGroup.with-label.size-small.variant-filled .FormItemBase-Control-wrap .ToggleButton {\n height: 31px;\n}\n.FormToggleButtonGroup.with-label.size-small.variant-standard .FormItemBase-Control-wrap {\n margin-top: 0;\n margin-bottom: 0;\n}\n.FormToggleButtonGroup.with-label.size-small.variant-standard .FormItemBase-Control-wrap .ToggleButton {\n height: 26px;\n}\n\n.Form .FormCol.with-label .FormToggleButtonGroup.variant-outlined .FormItemBase-Control-wrap {\n margin-top: 0;\n margin-bottom: 0;\n}\n.Form .FormCol.with-label .FormToggleButtonGroup.variant-outlined .FormItemBase-Control-wrap .ToggleButton {\n height: 37px;\n}\n.Form .FormCol.with-label .FormToggleButtonGroup.variant-filled .FormItemBase-Control-wrap {\n margin-top: 0;\n margin-bottom: 0;\n}\n.Form .FormCol.with-label .FormToggleButtonGroup.variant-filled .FormItemBase-Control-wrap .ToggleButton {\n height: 37px;\n}\n.Form .FormCol.with-label .FormToggleButtonGroup.variant-standard .FormItemBase-Control-wrap {\n margin-top: 0;\n margin-bottom: 0;\n}\n.Form .FormCol.with-label .FormToggleButtonGroup.variant-standard .FormItemBase-Control-wrap .ToggleButton {\n height: 28px;\n}\n.Form .FormCol.with-label .FormToggleButtonGroup.size-small.variant-outlined .FormItemBase-Control-wrap {\n margin-top: 0;\n margin-bottom: 0;\n}\n.Form .FormCol.with-label .FormToggleButtonGroup.size-small.variant-outlined .FormItemBase-Control-wrap .ToggleButton {\n height: 24px;\n}\n.Form .FormCol.with-label .FormToggleButtonGroup.size-small.variant-filled .FormItemBase-Control-wrap {\n margin-top: 0;\n margin-bottom: 0;\n}\n.Form .FormCol.with-label .FormToggleButtonGroup.size-small.variant-filled .FormItemBase-Control-wrap .ToggleButton {\n height: 31px;\n}\n.Form .FormCol.with-label .FormToggleButtonGroup.size-small.variant-standard .FormItemBase-Control-wrap {\n margin-top: 0;\n margin-bottom: 0;\n}\n.Form .FormCol.with-label .FormToggleButtonGroup.size-small.variant-standard .FormItemBase-Control-wrap .ToggleButton {\n height: 26px;\n}";
|
|
5010
|
+
styleInject(css_248z$d);var FormToggleButtonGroup = React__default.forwardRef(function (_a, ref) {
|
|
5028
5011
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
5029
5012
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initFullWidth = _a.fullWidth,
|
|
5030
5013
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -5406,7 +5389,7 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default.forwardRef(fu
|
|
|
5406
5389
|
return (items &&
|
|
5407
5390
|
items.map(function (_a, idx) {
|
|
5408
5391
|
var value = _a.value, label = _a.label, itemDisabled = _a.disabled, itemColor = _a.color;
|
|
5409
|
-
|
|
5392
|
+
return (React__default.createElement(ToggleButton, { ref: idx === 0 ? refForButtonResizeHeightDetect : undefined, key: idx, size: size, className: 'ToggleButton', value: value, color: itemColor || color, disabled: disabled || readOnly || itemDisabled, style: buttonStyle, onFocus: function () { return setFocused(initFocused || true); }, onBlur: function () { return setFocused(initFocused || false); } },
|
|
5410
5393
|
type === 'checkbox' ? (React__default.createElement(React__default.Fragment, null,
|
|
5411
5394
|
React__default.createElement(Icon$1, { className: '__checkbox-unchecked__' }, "check_box_outline_blank"),
|
|
5412
5395
|
React__default.createElement(Icon$1, { className: '__checkbox-checked__' }, "check_box"))) : (type === 'radio' && (React__default.createElement(React__default.Fragment, null,
|
|
@@ -5414,7 +5397,6 @@ styleInject(css_248z$b);var FormToggleButtonGroup = React__default.forwardRef(fu
|
|
|
5414
5397
|
React__default.createElement(Icon$1, { className: '__checkbox-unchecked__' }, "radio_button_unchecked"),
|
|
5415
5398
|
React__default.createElement(Icon$1, { className: '__checkbox-checked__' }, "radio_button_checked"))))),
|
|
5416
5399
|
label));
|
|
5417
|
-
return button;
|
|
5418
5400
|
}));
|
|
5419
5401
|
}, [
|
|
5420
5402
|
color,
|
|
@@ -7466,8 +7448,9 @@ var Editor = /** @class */ (function (_super) {
|
|
|
7466
7448
|
}(React.Component));var FormTextEditorDefaultProps = {
|
|
7467
7449
|
menubar: true,
|
|
7468
7450
|
height: 500,
|
|
7469
|
-
|
|
7470
|
-
|
|
7451
|
+
value: '',
|
|
7452
|
+
};var css_248z$c = ".FormTextEditor.initializing textarea {\n display: none;\n}\n.FormTextEditor.error .tox-tinymce {\n border-color: #d32f2f;\n}\n\n.tox-menu.tox-collection.tox-collection--list .tox-collection__group .tox-menu-nav__js.tox-collection__item {\n padding-right: 20px !important;\n}\n\n.tox-notifications-container {\n display: none;\n}";
|
|
7453
|
+
styleInject(css_248z$c);var FormTextEditor = React__default.forwardRef(function (_a, ref) {
|
|
7471
7454
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
7472
7455
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused,
|
|
7473
7456
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -7489,7 +7472,7 @@ styleInject(css_248z$a);var FormTextEditor = React__default.forwardRef(function
|
|
|
7489
7472
|
var editorRef = useRef(null);
|
|
7490
7473
|
var keyDownTime = useRef(0);
|
|
7491
7474
|
// State - value ---------------------------------------------------------------------------------------------------
|
|
7492
|
-
var _d = useAutoUpdateState$1(initValue), value = _d[0], setValue = _d[1];
|
|
7475
|
+
var _d = useAutoUpdateState$1(initValue || ''), value = _d[0], setValue = _d[1];
|
|
7493
7476
|
useFirstSkipEffect$1(function () {
|
|
7494
7477
|
if (error)
|
|
7495
7478
|
validate(value);
|
|
@@ -7549,9 +7532,9 @@ styleInject(css_248z$a);var FormTextEditor = React__default.forwardRef(function
|
|
|
7549
7532
|
var commands = {
|
|
7550
7533
|
getType: function () { return 'FormTextEditor'; },
|
|
7551
7534
|
getName: function () { return name; },
|
|
7552
|
-
getReset: function () { return initValue; },
|
|
7535
|
+
getReset: function () { return initValue || ''; },
|
|
7553
7536
|
reset: function () {
|
|
7554
|
-
lastValue = initValue;
|
|
7537
|
+
lastValue = initValue || '';
|
|
7555
7538
|
setValue(lastValue);
|
|
7556
7539
|
},
|
|
7557
7540
|
getValue: function () { return lastValue; },
|
|
@@ -7817,7 +7800,9 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
7817
7800
|
}
|
|
7818
7801
|
}
|
|
7819
7802
|
}
|
|
7820
|
-
if (
|
|
7803
|
+
if (oldComponentValueRef.current &&
|
|
7804
|
+
newComponentValue &&
|
|
7805
|
+
isSame$2(oldComponentValueRef.current, newComponentValue)) {
|
|
7821
7806
|
return oldComponentValueRef.current;
|
|
7822
7807
|
}
|
|
7823
7808
|
else {
|
|
@@ -8309,8 +8294,9 @@ Icon.defaultProps = IconDefaultProps;var IconTextDefaultProps = {
|
|
|
8309
8294
|
IconText.defaultProps = IconTextDefaultProps;var PrivateDatePickerDefaultProps = {
|
|
8310
8295
|
showDaysOutsideCurrentMonth: true,
|
|
8311
8296
|
align: 'center',
|
|
8312
|
-
|
|
8313
|
-
|
|
8297
|
+
value: null,
|
|
8298
|
+
};var PrivateStaticDatePickerDefaultProps = {};var PrivateYearSelectDefaultProps = {};var css_248z$b = ".PrivateYearSelect {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background-color: white;\n}\n.PrivateYearSelect button {\n font-size: 14px;\n font-weight: 400;\n border-radius: 18px;\n}";
|
|
8299
|
+
styleInject(css_248z$b);var PrivateToggleButtonDefaultProps = {};var PrivateToggleButton = React__default.forwardRef(function (_a, ref) {
|
|
8314
8300
|
var children = _a.children, initClassName = _a.className, selected = _a.selected, activated = _a.activated, outlined = _a.outlined, props = __rest$4(_a, ["children", "className", "selected", "activated", "outlined"]);
|
|
8315
8301
|
var theme = useTheme();
|
|
8316
8302
|
var className = useMemo(function () { return classNames$1(initClassName, selected && 'selected', activated && 'activated', outlined && 'outlined'); }, [activated, initClassName, outlined, selected]);
|
|
@@ -9896,8 +9882,8 @@ var SimpleBar = React.forwardRef(function (_a, ref) {
|
|
|
9896
9882
|
React.createElement("div", { className: classNames.scrollbar }))));
|
|
9897
9883
|
});
|
|
9898
9884
|
SimpleBar.displayName = 'SimpleBar';var YEARS$1 = new Array(200).fill(0);
|
|
9899
|
-
for (var i$
|
|
9900
|
-
YEARS$1[i$
|
|
9885
|
+
for (var i$5 = 0; i$5 < 200; i$5 += 1) {
|
|
9886
|
+
YEARS$1[i$5] = 1900 + i$5;
|
|
9901
9887
|
}
|
|
9902
9888
|
var PrivateYearSelect = function (_a) {
|
|
9903
9889
|
// Ref -------------------------------------------------------------------------------------------------------------
|
|
@@ -9937,10 +9923,10 @@ var PrivateYearSelect = function (_a) {
|
|
|
9937
9923
|
})))));
|
|
9938
9924
|
};
|
|
9939
9925
|
PrivateYearSelect.displayName = 'PrivateYearSelect';
|
|
9940
|
-
PrivateYearSelect.defaultProps = PrivateYearSelectDefaultProps;var PrivateMonthSelectDefaultProps = {};var css_248z$
|
|
9941
|
-
styleInject(css_248z$
|
|
9942
|
-
for (var i$
|
|
9943
|
-
MONTHS$1[i$
|
|
9926
|
+
PrivateYearSelect.defaultProps = PrivateYearSelectDefaultProps;var PrivateMonthSelectDefaultProps = {};var css_248z$a = ".PrivateMonthSelect {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background-color: white;\n}\n.PrivateMonthSelect button {\n font-size: 15px;\n font-weight: 400;\n border-radius: 18px;\n}";
|
|
9927
|
+
styleInject(css_248z$a);var MONTHS$1 = new Array(12).fill(0);
|
|
9928
|
+
for (var i$4 = 0; i$4 < 12; i$4 += 1) {
|
|
9929
|
+
MONTHS$1[i$4] = i$4;
|
|
9944
9930
|
}
|
|
9945
9931
|
var PrivateMonthSelect = function (_a) {
|
|
9946
9932
|
var year = _a.year, selectYear = _a.selectYear, selectMonth = _a.selectMonth, activeMonth = _a.activeMonth, availableDate = _a.availableDate, onSelect = _a.onSelect;
|
|
@@ -9961,10 +9947,10 @@ var PrivateMonthSelect = function (_a) {
|
|
|
9961
9947
|
PrivateMonthSelect.displayName = 'PrivateMonthSelect';
|
|
9962
9948
|
PrivateMonthSelect.defaultProps = PrivateMonthSelectDefaultProps;var PrivateTimeSelectDefaultProps = {
|
|
9963
9949
|
cols: 1,
|
|
9964
|
-
};var css_248z$
|
|
9965
|
-
styleInject(css_248z$
|
|
9966
|
-
for (var i$
|
|
9967
|
-
DEFAULT_MINUTES$
|
|
9950
|
+
};var css_248z$9 = ".PrivateTimeSelect {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n}\n.PrivateTimeSelect button {\n border-radius: 0;\n}";
|
|
9951
|
+
styleInject(css_248z$9);var DEFAULT_MINUTES$2 = new Array(60).fill(0);
|
|
9952
|
+
for (var i$3 = 0; i$3 < DEFAULT_MINUTES$2.length; i$3 += 1) {
|
|
9953
|
+
DEFAULT_MINUTES$2[i$3] = i$3;
|
|
9968
9954
|
}
|
|
9969
9955
|
var PrivateTimeSelect = React__default.forwardRef(function (_a, ref) {
|
|
9970
9956
|
// Ref -------------------------------------------------------------------------------------------------------------
|
|
@@ -10068,18 +10054,18 @@ var PrivateTimeSelect = React__default.forwardRef(function (_a, ref) {
|
|
|
10068
10054
|
}))))));
|
|
10069
10055
|
});
|
|
10070
10056
|
PrivateTimeSelect.displayName = 'PrivateTimeSelect';
|
|
10071
|
-
PrivateTimeSelect.defaultProps = PrivateTimeSelectDefaultProps;var css_248z$
|
|
10072
|
-
styleInject(css_248z$
|
|
10073
|
-
for (var i$
|
|
10074
|
-
DEFAULT_HOURS[i$
|
|
10057
|
+
PrivateTimeSelect.defaultProps = PrivateTimeSelectDefaultProps;var css_248z$8 = ".PrivateStaticDatePicker.time {\n height: 400px;\n}\n.PrivateStaticDatePicker .MuiPickersCalendarHeader-root {\n display: none;\n}\n.PrivateStaticDatePicker .month-title-container {\n display: flex;\n align-items: center;\n margin-left: 5px;\n}\n.PrivateStaticDatePicker .month-title-container .month-title-wrap {\n display: flex;\n align-items: center;\n cursor: pointer;\n}\n.PrivateStaticDatePicker .month-title-container .month-title-wrap .month-title button {\n font-size: 15px;\n padding-left: 8px;\n padding-right: 0;\n min-width: 0;\n}\n.PrivateStaticDatePicker .month-title-container .month-title-wrap .month-title button:not(.active) {\n color: unset;\n}\n.PrivateStaticDatePicker .action-buttons {\n border-top: 1px solid #efefef;\n padding: 10px;\n text-align: right;\n}\n.PrivateStaticDatePicker .action-buttons button {\n min-width: 0;\n color: inherit;\n}\n.PrivateStaticDatePicker .action-buttons button:not(:first-child) {\n margin-left: 5px;\n}\n.PrivateStaticDatePicker .action-buttons button.disabled {\n color: rgba(0, 0, 0, 0.5);\n}\n.PrivateStaticDatePicker .time {\n border-left: 2px solid #bfbfbf;\n}\n.PrivateStaticDatePicker .time .time-container {\n height: 100%;\n}\n.PrivateStaticDatePicker .time .time-container .time-title {\n text-align: center;\n padding: 22px 0;\n font-size: 15px;\n}\n.PrivateStaticDatePicker .time .time-container .time-select-wrap {\n flex: 1;\n border-top: 1px solid #efefef;\n}\n.PrivateStaticDatePicker.time .time .time-container .time-select-wrap > div > div:not(:first-child) {\n border-left: 1px solid #efefef;\n}";
|
|
10058
|
+
styleInject(css_248z$8);var DEFAULT_HOURS$1 = new Array(24).fill(0);
|
|
10059
|
+
for (var i$2 = 0; i$2 < DEFAULT_HOURS$1.length; i$2 += 1) {
|
|
10060
|
+
DEFAULT_HOURS$1[i$2] = i$2;
|
|
10075
10061
|
}
|
|
10076
|
-
var DEFAULT_MINUTES = new Array(60).fill(0);
|
|
10077
|
-
for (var i$
|
|
10078
|
-
DEFAULT_MINUTES[i$
|
|
10062
|
+
var DEFAULT_MINUTES$1 = new Array(60).fill(0);
|
|
10063
|
+
for (var i$2 = 0; i$2 < DEFAULT_MINUTES$1.length; i$2 += 1) {
|
|
10064
|
+
DEFAULT_MINUTES$1[i$2] = i$2;
|
|
10079
10065
|
}
|
|
10080
|
-
var DEFAULT_SECONDS = new Array(60).fill(0);
|
|
10081
|
-
for (var i$
|
|
10082
|
-
DEFAULT_SECONDS[i$
|
|
10066
|
+
var DEFAULT_SECONDS$1 = new Array(60).fill(0);
|
|
10067
|
+
for (var i$2 = 0; i$2 < DEFAULT_SECONDS$1.length; i$2 += 1) {
|
|
10068
|
+
DEFAULT_SECONDS$1[i$2] = i$2;
|
|
10083
10069
|
}
|
|
10084
10070
|
var PrivateStaticDatePicker = React__default.forwardRef(function (_a, ref) {
|
|
10085
10071
|
// Ref -------------------------------------------------------------------------------------------------------------
|
|
@@ -10100,9 +10086,9 @@ var PrivateStaticDatePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
10100
10086
|
var _d = useState(false), yearSelectOpen = _d[0], setYearSelectOpen = _d[1];
|
|
10101
10087
|
var _e = useState(false), monthSelectOpen = _e[0], setMonthSelectOpen = _e[1];
|
|
10102
10088
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
10103
|
-
var hours = useMemo(function () { return initHours || DEFAULT_HOURS; }, [initHours]);
|
|
10104
|
-
var minutes = useMemo(function () { return initMinutes || DEFAULT_MINUTES; }, [initMinutes]);
|
|
10105
|
-
var seconds = useMemo(function () { return initSeconds || DEFAULT_SECONDS; }, [initSeconds]);
|
|
10089
|
+
var hours = useMemo(function () { return initHours || DEFAULT_HOURS$1; }, [initHours]);
|
|
10090
|
+
var minutes = useMemo(function () { return initMinutes || DEFAULT_MINUTES$1; }, [initMinutes]);
|
|
10091
|
+
var seconds = useMemo(function () { return initSeconds || DEFAULT_SECONDS$1; }, [initSeconds]);
|
|
10106
10092
|
var availableDate = useMemo(function () {
|
|
10107
10093
|
return initAvailableDate ? initAvailableDate : makeAvailableDate(minDate, maxDate, !!disablePast, !!disableFuture);
|
|
10108
10094
|
}, [initAvailableDate, minDate, maxDate, disablePast, disableFuture]);
|
|
@@ -10177,15 +10163,6 @@ var PrivateStaticDatePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
10177
10163
|
rightArrowOnClickRef.current({});
|
|
10178
10164
|
}
|
|
10179
10165
|
}, []);
|
|
10180
|
-
var timeSelectScrollToDate = useCallback(function (date, times) {
|
|
10181
|
-
var _a, _b, _c;
|
|
10182
|
-
if (!times || (times === null || times === void 0 ? void 0 : times.includes('hour')))
|
|
10183
|
-
(_a = hourSelectRef.current) === null || _a === void 0 ? void 0 : _a.scrollToValue(date.hour());
|
|
10184
|
-
if (!times || (times === null || times === void 0 ? void 0 : times.includes('minute')))
|
|
10185
|
-
(_b = minuteSelectRef.current) === null || _b === void 0 ? void 0 : _b.scrollToValue(date.minute());
|
|
10186
|
-
if (!times || (times === null || times === void 0 ? void 0 : times.includes('second')))
|
|
10187
|
-
(_c = secondSelectRef.current) === null || _c === void 0 ? void 0 : _c.scrollToValue(date.second());
|
|
10188
|
-
}, []);
|
|
10189
10166
|
// Event Handler ---------------------------------------------------------------------------------------------------
|
|
10190
10167
|
var handleYearSelect = useCallback(function (year) {
|
|
10191
10168
|
setMonth(month.set('year', year));
|
|
@@ -10204,9 +10181,7 @@ var PrivateStaticDatePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
10204
10181
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
10205
10182
|
useLayoutEffect(function () {
|
|
10206
10183
|
if (ref) {
|
|
10207
|
-
var commands = {
|
|
10208
|
-
timeSelectScrollToDate: timeSelectScrollToDate,
|
|
10209
|
-
};
|
|
10184
|
+
var commands = {};
|
|
10210
10185
|
if (typeof ref === 'function') {
|
|
10211
10186
|
ref(commands);
|
|
10212
10187
|
}
|
|
@@ -10222,7 +10197,7 @@ var PrivateStaticDatePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
10222
10197
|
}
|
|
10223
10198
|
};
|
|
10224
10199
|
}
|
|
10225
|
-
}, [ref
|
|
10200
|
+
}, [ref]);
|
|
10226
10201
|
// Render - Function -----------------------------------------------------------------------------------------------
|
|
10227
10202
|
var getActionButton = useCallback(function (date, label) {
|
|
10228
10203
|
var disabled = !isDateAvailable(date, availableDate, 'day');
|
|
@@ -10366,8 +10341,8 @@ PrivateStaticDatePicker.defaultProps = PrivateStaticDatePickerDefaultProps;var P
|
|
|
10366
10341
|
boxShadow: theme.shadows[8],
|
|
10367
10342
|
},
|
|
10368
10343
|
_b);
|
|
10369
|
-
});var css_248z$
|
|
10370
|
-
styleInject(css_248z$
|
|
10344
|
+
});var css_248z$7 = ".PrivateDatePicker .input-text-field.align-left .MuiInputBase-input {\n text-align: left;\n}\n.PrivateDatePicker .input-text-field.align-center .MuiInputBase-input {\n text-align: center;\n}\n.PrivateDatePicker .input-text-field.align-right .MuiInputBase-input {\n text-align: right;\n}";
|
|
10345
|
+
styleInject(css_248z$7);var PrivateDatePicker = React__default.forwardRef(function (_a, ref) {
|
|
10371
10346
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
10372
10347
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
10373
10348
|
//--------------------------------------------------------------------------------------------------------------------
|
|
@@ -10628,7 +10603,6 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default.forwardRef(functi
|
|
|
10628
10603
|
]);
|
|
10629
10604
|
// Event Handler ---------------------------------------------------------------------------------------------------
|
|
10630
10605
|
var handleChange = useCallback(function (unit, newValue, keyboardInputValue) {
|
|
10631
|
-
var _a, _b, _c;
|
|
10632
10606
|
var updateValue = true;
|
|
10633
10607
|
if (notEmpty(keyboardInputValue)) {
|
|
10634
10608
|
if (newValue) {
|
|
@@ -10671,22 +10645,6 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default.forwardRef(functi
|
|
|
10671
10645
|
onRequestSearchSubmit(name, finalValue);
|
|
10672
10646
|
}
|
|
10673
10647
|
});
|
|
10674
|
-
if (time) {
|
|
10675
|
-
if (finalValue) {
|
|
10676
|
-
switch (unit) {
|
|
10677
|
-
case 'date':
|
|
10678
|
-
case 'action_date':
|
|
10679
|
-
(_a = privateStaticDatePickerRef.current) === null || _a === void 0 ? void 0 : _a.timeSelectScrollToDate(finalValue);
|
|
10680
|
-
break;
|
|
10681
|
-
case 'hour':
|
|
10682
|
-
(_b = privateStaticDatePickerRef.current) === null || _b === void 0 ? void 0 : _b.timeSelectScrollToDate(finalValue, ['minute', 'second']);
|
|
10683
|
-
break;
|
|
10684
|
-
case 'minute':
|
|
10685
|
-
(_c = privateStaticDatePickerRef.current) === null || _c === void 0 ? void 0 : _c.timeSelectScrollToDate(finalValue, ['second']);
|
|
10686
|
-
break;
|
|
10687
|
-
}
|
|
10688
|
-
}
|
|
10689
|
-
}
|
|
10690
10648
|
}
|
|
10691
10649
|
setInputValue(finalValue);
|
|
10692
10650
|
}, [type, time, setValue, availableDate, open, onValueChangeByUser, name, onRequestSearchSubmit]);
|
|
@@ -10804,7 +10762,728 @@ styleInject(css_248z$5);var PrivateDatePicker = React__default.forwardRef(functi
|
|
|
10804
10762
|
!formColWithHelperText && helperText && (React__default.createElement(FormHelperText, { error: error, style: { marginLeft: variant === 'standard' ? 0 : 14 } }, helperText))))));
|
|
10805
10763
|
});
|
|
10806
10764
|
PrivateDatePicker.displayName = 'PrivateDatePicker';
|
|
10807
|
-
PrivateDatePicker.defaultProps = PrivateDatePickerDefaultProps;var
|
|
10765
|
+
PrivateDatePicker.defaultProps = PrivateDatePickerDefaultProps;var PrivateDateTimePickerDefaultProps = {
|
|
10766
|
+
showDaysOutsideCurrentMonth: true,
|
|
10767
|
+
align: 'center',
|
|
10768
|
+
value: null,
|
|
10769
|
+
};var css_248z$6 = ".PrivateDateTimePicker .input-text-field.align-left .MuiInputBase-input {\n text-align: left;\n}\n.PrivateDateTimePicker .input-text-field.align-center .MuiInputBase-input {\n text-align: center;\n}\n.PrivateDateTimePicker .input-text-field.align-right .MuiInputBase-input {\n text-align: right;\n}";
|
|
10770
|
+
styleInject(css_248z$6);var PrivateStaticDateTimePickerDefaultProps = {};var css_248z$5 = ".PrivateStaticDateTimePicker.time {\n height: 400px;\n}\n.PrivateStaticDateTimePicker .MuiPickersCalendarHeader-root {\n display: none;\n}\n.PrivateStaticDateTimePicker .month-title-container {\n display: flex;\n align-items: center;\n margin-left: 5px;\n}\n.PrivateStaticDateTimePicker .month-title-container .month-title-wrap {\n display: flex;\n align-items: center;\n cursor: pointer;\n}\n.PrivateStaticDateTimePicker .month-title-container .month-title-wrap .month-title button {\n font-size: 15px;\n padding-left: 8px;\n padding-right: 0;\n min-width: 0;\n}\n.PrivateStaticDateTimePicker .month-title-container .month-title-wrap .month-title button:not(.active) {\n color: unset;\n}\n.PrivateStaticDateTimePicker .action-buttons {\n border-top: 1px solid #efefef;\n padding: 10px;\n text-align: right;\n}\n.PrivateStaticDateTimePicker .action-buttons button {\n min-width: 0;\n color: inherit;\n}\n.PrivateStaticDateTimePicker .action-buttons button:not(:first-child) {\n margin-left: 5px;\n}\n.PrivateStaticDateTimePicker .action-buttons button.disabled {\n color: rgba(0, 0, 0, 0.5);\n}\n.PrivateStaticDateTimePicker .time {\n border-left: 2px solid #bfbfbf;\n}\n.PrivateStaticDateTimePicker .time .time-container {\n height: 100%;\n}\n.PrivateStaticDateTimePicker .time .time-container .time-title {\n text-align: center;\n padding: 22px 0;\n font-size: 15px;\n}\n.PrivateStaticDateTimePicker .time .time-container .time-select-wrap {\n flex: 1;\n border-top: 1px solid #efefef;\n}\n.PrivateStaticDateTimePicker.time .time .time-container .time-select-wrap > div > div:not(:first-child) {\n border-left: 1px solid #efefef;\n}";
|
|
10771
|
+
styleInject(css_248z$5);var DEFAULT_HOURS = new Array(24).fill(0);
|
|
10772
|
+
for (var i$1 = 0; i$1 < DEFAULT_HOURS.length; i$1 += 1) {
|
|
10773
|
+
DEFAULT_HOURS[i$1] = i$1;
|
|
10774
|
+
}
|
|
10775
|
+
var DEFAULT_MINUTES = new Array(60).fill(0);
|
|
10776
|
+
for (var i$1 = 0; i$1 < DEFAULT_MINUTES.length; i$1 += 1) {
|
|
10777
|
+
DEFAULT_MINUTES[i$1] = i$1;
|
|
10778
|
+
}
|
|
10779
|
+
var DEFAULT_SECONDS = new Array(60).fill(0);
|
|
10780
|
+
for (var i$1 = 0; i$1 < DEFAULT_SECONDS.length; i$1 += 1) {
|
|
10781
|
+
DEFAULT_SECONDS[i$1] = i$1;
|
|
10782
|
+
}
|
|
10783
|
+
var PrivateStaticDateTimePicker = React__default.forwardRef(function (_a, ref) {
|
|
10784
|
+
// Ref -------------------------------------------------------------------------------------------------------------
|
|
10785
|
+
var value = _a.value, initAvailableDate = _a.availableDate, defaultCalendarMonth = _a.defaultCalendarMonth, type = _a.type, time = _a.time, initHours = _a.hours, initMinutes = _a.minutes, initSeconds = _a.seconds, minuteInterval = _a.minuteInterval, secondInterval = _a.secondInterval, minDate = _a.minDate, maxDate = _a.maxDate, disablePast = _a.disablePast, disableFuture = _a.disableFuture, onChange = _a.onChange, onMonthChange = _a.onMonthChange, onClose = _a.onClose, props = __rest$4(_a, ["value", "availableDate", "defaultCalendarMonth", "type", "time", "hours", "minutes", "seconds", "minuteInterval", "secondInterval", "minDate", "maxDate", "disablePast", "disableFuture", "onChange", "onMonthChange", "onClose"]);
|
|
10786
|
+
var hourSelectRef = useRef(null);
|
|
10787
|
+
var minuteSelectRef = useRef(null);
|
|
10788
|
+
var secondSelectRef = useRef(null);
|
|
10789
|
+
// State -----------------------------------------------------------------------------------------------------------
|
|
10790
|
+
var _b = useState(function () {
|
|
10791
|
+
if (value)
|
|
10792
|
+
return value;
|
|
10793
|
+
else if (defaultCalendarMonth)
|
|
10794
|
+
return defaultCalendarMonth;
|
|
10795
|
+
else
|
|
10796
|
+
return dayjs();
|
|
10797
|
+
}), month = _b[0], setMonth = _b[1];
|
|
10798
|
+
var _c = useState(null), activeMonthValue = _c[0], setActiveMonthValue = _c[1];
|
|
10799
|
+
var _d = useState(false), yearSelectOpen = _d[0], setYearSelectOpen = _d[1];
|
|
10800
|
+
var _e = useState(false), monthSelectOpen = _e[0], setMonthSelectOpen = _e[1];
|
|
10801
|
+
// Memo --------------------------------------------------------------------------------------------------------------
|
|
10802
|
+
var hours = useMemo(function () { return initHours || DEFAULT_HOURS; }, [initHours]);
|
|
10803
|
+
var minutes = useMemo(function () { return initMinutes || DEFAULT_MINUTES; }, [initMinutes]);
|
|
10804
|
+
var seconds = useMemo(function () { return initSeconds || DEFAULT_SECONDS; }, [initSeconds]);
|
|
10805
|
+
var availableDate = useMemo(function () {
|
|
10806
|
+
return initAvailableDate ? initAvailableDate : makeAvailableDate(minDate, maxDate, !!disablePast, !!disableFuture);
|
|
10807
|
+
}, [initAvailableDate, minDate, maxDate, disablePast, disableFuture]);
|
|
10808
|
+
var disableHours = useMemo(function () {
|
|
10809
|
+
var newDisableHours = [];
|
|
10810
|
+
if (time && value && (availableDate[0] || availableDate[1])) {
|
|
10811
|
+
hours.forEach(function (h) {
|
|
10812
|
+
if (!isDateAvailable(value.set('hour', h), availableDate, 'hour')) {
|
|
10813
|
+
newDisableHours.push(h);
|
|
10814
|
+
}
|
|
10815
|
+
});
|
|
10816
|
+
}
|
|
10817
|
+
return newDisableHours;
|
|
10818
|
+
}, [time, value, availableDate, hours]);
|
|
10819
|
+
var disableMinutes = useMemo(function () {
|
|
10820
|
+
var newDisableMinutes = [];
|
|
10821
|
+
if (time === 'minute' || time === 'second') {
|
|
10822
|
+
if (value && (availableDate[0] || availableDate[1])) {
|
|
10823
|
+
minutes.forEach(function (m) {
|
|
10824
|
+
if (!isDateAvailable(value.set('minute', m), availableDate, 'minute')) {
|
|
10825
|
+
newDisableMinutes.push(m);
|
|
10826
|
+
}
|
|
10827
|
+
});
|
|
10828
|
+
}
|
|
10829
|
+
}
|
|
10830
|
+
return newDisableMinutes;
|
|
10831
|
+
}, [time, value, availableDate, minutes]);
|
|
10832
|
+
var disableSeconds = useMemo(function () {
|
|
10833
|
+
var newDisableSeconds = [];
|
|
10834
|
+
if (time === 'second') {
|
|
10835
|
+
if (value && (availableDate[0] || availableDate[1])) {
|
|
10836
|
+
seconds.forEach(function (s) {
|
|
10837
|
+
if (!isDateAvailable(value.set('second', s), availableDate, 'second')) {
|
|
10838
|
+
newDisableSeconds.push(s);
|
|
10839
|
+
}
|
|
10840
|
+
});
|
|
10841
|
+
}
|
|
10842
|
+
}
|
|
10843
|
+
return newDisableSeconds;
|
|
10844
|
+
}, [time, value, availableDate, seconds]);
|
|
10845
|
+
// Effect ----------------------------------------------------------------------------------------------------------
|
|
10846
|
+
useEffect(function () {
|
|
10847
|
+
if (!yearSelectOpen) {
|
|
10848
|
+
setActiveMonthValue(null);
|
|
10849
|
+
}
|
|
10850
|
+
}, [yearSelectOpen]);
|
|
10851
|
+
//--------------------------------------------------------------------------------------------------------------------
|
|
10852
|
+
var leftArrowOnClickRef = useRef();
|
|
10853
|
+
var rightArrowOnClickRef = useRef();
|
|
10854
|
+
var LeftArrowButton = useState(function () {
|
|
10855
|
+
var ArrowButton = function (props) {
|
|
10856
|
+
leftArrowOnClickRef.current = props.onClick;
|
|
10857
|
+
return React__default.createElement(IconButton, __assign$7({}, props));
|
|
10858
|
+
};
|
|
10859
|
+
return ArrowButton;
|
|
10860
|
+
})[0];
|
|
10861
|
+
var RightArrowButton = useState(function () {
|
|
10862
|
+
var ArrowButton = function (props) {
|
|
10863
|
+
rightArrowOnClickRef.current = props.onClick;
|
|
10864
|
+
return React__default.createElement(IconButton, __assign$7({}, props));
|
|
10865
|
+
};
|
|
10866
|
+
return ArrowButton;
|
|
10867
|
+
})[0];
|
|
10868
|
+
// Function --------------------------------------------------------------------------------------------------------
|
|
10869
|
+
var previousMonth = useCallback(function () {
|
|
10870
|
+
if (leftArrowOnClickRef.current) {
|
|
10871
|
+
leftArrowOnClickRef.current({});
|
|
10872
|
+
}
|
|
10873
|
+
}, []);
|
|
10874
|
+
var nextMonth = useCallback(function () {
|
|
10875
|
+
if (rightArrowOnClickRef.current) {
|
|
10876
|
+
rightArrowOnClickRef.current({});
|
|
10877
|
+
}
|
|
10878
|
+
}, []);
|
|
10879
|
+
var timeSelectScrollToDate = useCallback(function (date, times) {
|
|
10880
|
+
var _a, _b, _c;
|
|
10881
|
+
if (!times || (times === null || times === void 0 ? void 0 : times.includes('hour')))
|
|
10882
|
+
(_a = hourSelectRef.current) === null || _a === void 0 ? void 0 : _a.scrollToValue(date.hour());
|
|
10883
|
+
if (!times || (times === null || times === void 0 ? void 0 : times.includes('minute')))
|
|
10884
|
+
(_b = minuteSelectRef.current) === null || _b === void 0 ? void 0 : _b.scrollToValue(date.minute());
|
|
10885
|
+
if (!times || (times === null || times === void 0 ? void 0 : times.includes('second')))
|
|
10886
|
+
(_c = secondSelectRef.current) === null || _c === void 0 ? void 0 : _c.scrollToValue(date.second());
|
|
10887
|
+
}, []);
|
|
10888
|
+
// Event Handler ---------------------------------------------------------------------------------------------------
|
|
10889
|
+
var handleYearSelect = useCallback(function (year) {
|
|
10890
|
+
setMonth(month.set('year', year));
|
|
10891
|
+
setActiveMonthValue(month.set('year', year));
|
|
10892
|
+
setYearSelectOpen(false);
|
|
10893
|
+
setMonthSelectOpen(true);
|
|
10894
|
+
}, [month]);
|
|
10895
|
+
var handleMonthSelect = useCallback(function (m) {
|
|
10896
|
+
setMonth(month.set('month', m));
|
|
10897
|
+
setActiveMonthValue(month.set('month', m));
|
|
10898
|
+
setMonthSelectOpen(false);
|
|
10899
|
+
}, [month]);
|
|
10900
|
+
var handleRenderDay = useCallback(function (props) {
|
|
10901
|
+
return React__default.createElement(PickersDay, __assign$7({}, props, { selected: props.day.isSame(value, 'date') }));
|
|
10902
|
+
}, [value]);
|
|
10903
|
+
// Commands --------------------------------------------------------------------------------------------------------
|
|
10904
|
+
useLayoutEffect(function () {
|
|
10905
|
+
if (ref) {
|
|
10906
|
+
var commands = {
|
|
10907
|
+
timeSelectScrollToDate: timeSelectScrollToDate,
|
|
10908
|
+
};
|
|
10909
|
+
if (typeof ref === 'function') {
|
|
10910
|
+
ref(commands);
|
|
10911
|
+
}
|
|
10912
|
+
else {
|
|
10913
|
+
ref.current = commands;
|
|
10914
|
+
}
|
|
10915
|
+
return function () {
|
|
10916
|
+
if (typeof ref === 'function') {
|
|
10917
|
+
ref(null);
|
|
10918
|
+
}
|
|
10919
|
+
else {
|
|
10920
|
+
ref.current = null;
|
|
10921
|
+
}
|
|
10922
|
+
};
|
|
10923
|
+
}
|
|
10924
|
+
}, [ref, timeSelectScrollToDate]);
|
|
10925
|
+
// Render - Function -----------------------------------------------------------------------------------------------
|
|
10926
|
+
var getActionButton = useCallback(function (date, label) {
|
|
10927
|
+
var disabled = !isDateAvailable(date, availableDate, 'day');
|
|
10928
|
+
return (React__default.createElement(Button, { variant: 'text', className: disabled ? 'disabled' : undefined, disabled: disabled, onClick: function () {
|
|
10929
|
+
var finalDate = date;
|
|
10930
|
+
var checkResult = checkDateAvailable(finalDate, availableDate, type, time);
|
|
10931
|
+
if (checkResult !== 'available') {
|
|
10932
|
+
var availableDateDate = getAvailableDate(availableDate, type, time);
|
|
10933
|
+
if (checkResult === 'min') {
|
|
10934
|
+
if (availableDateDate[0])
|
|
10935
|
+
finalDate = availableDateDate[0];
|
|
10936
|
+
}
|
|
10937
|
+
else if (checkResult === 'max') {
|
|
10938
|
+
if (availableDateDate[1])
|
|
10939
|
+
finalDate = availableDateDate[1];
|
|
10940
|
+
}
|
|
10941
|
+
}
|
|
10942
|
+
onChange('action_date', finalDate);
|
|
10943
|
+
} }, label));
|
|
10944
|
+
}, [type, time, onChange, availableDate]);
|
|
10945
|
+
// Render ----------------------------------------------------------------------------------------------------------
|
|
10946
|
+
return (React__default.createElement(Grid, { container: true, className: classNames$1('PrivateStaticDateTimePicker', type) },
|
|
10947
|
+
type !== 'time' && (React__default.createElement(Grid, { item: true },
|
|
10948
|
+
React__default.createElement(Grid, { container: true, direction: 'column' },
|
|
10949
|
+
React__default.createElement(Grid, { item: true, sx: { p: 2, width: '100%' } },
|
|
10950
|
+
React__default.createElement(Grid, { container: true, className: 'month-change-arrow-wrap' },
|
|
10951
|
+
React__default.createElement(Grid, { item: true, flex: 1, className: 'month-title-container' },
|
|
10952
|
+
React__default.createElement("div", { className: 'month-title-wrap' },
|
|
10953
|
+
React__default.createElement("div", { className: 'month-title' },
|
|
10954
|
+
React__default.createElement(Button, { variant: 'text', className: yearSelectOpen ? 'active' : undefined, onClick: function () {
|
|
10955
|
+
if (yearSelectOpen) {
|
|
10956
|
+
setYearSelectOpen(false);
|
|
10957
|
+
}
|
|
10958
|
+
else {
|
|
10959
|
+
setYearSelectOpen(true);
|
|
10960
|
+
setMonthSelectOpen(false);
|
|
10961
|
+
}
|
|
10962
|
+
} },
|
|
10963
|
+
month.format('YYYY년'),
|
|
10964
|
+
React__default.createElement(Icon$1, null, yearSelectOpen ? 'arrow_drop_up' : 'arrow_drop_down'))),
|
|
10965
|
+
React__default.createElement("div", { className: 'month-title' },
|
|
10966
|
+
React__default.createElement(Button, { variant: 'text', className: monthSelectOpen ? 'active' : undefined, onClick: function () {
|
|
10967
|
+
if (monthSelectOpen) {
|
|
10968
|
+
setMonthSelectOpen(false);
|
|
10969
|
+
}
|
|
10970
|
+
else {
|
|
10971
|
+
setMonthSelectOpen(true);
|
|
10972
|
+
setYearSelectOpen(false);
|
|
10973
|
+
}
|
|
10974
|
+
} },
|
|
10975
|
+
month.format('M월'),
|
|
10976
|
+
React__default.createElement(Icon$1, null, monthSelectOpen ? 'arrow_drop_up' : 'arrow_drop_down'))))),
|
|
10977
|
+
!yearSelectOpen && !monthSelectOpen && (React__default.createElement(Grid, { item: true, style: { textAlign: 'right' } },
|
|
10978
|
+
React__default.createElement(IconButton, { onClick: previousMonth, sx: { mr: 1 } },
|
|
10979
|
+
React__default.createElement(Icon$1, null, "keyboard_arrow_left")),
|
|
10980
|
+
React__default.createElement(IconButton, { onClick: nextMonth },
|
|
10981
|
+
React__default.createElement(Icon$1, null, "keyboard_arrow_right")))))),
|
|
10982
|
+
React__default.createElement(Grid, { item: true, style: { position: 'relative' } },
|
|
10983
|
+
React__default.createElement(StaticDateTimePicker, __assign$7({}, props, { value: activeMonthValue, defaultCalendarMonth: month, slots: {
|
|
10984
|
+
previousIconButton: LeftArrowButton,
|
|
10985
|
+
nextIconButton: RightArrowButton,
|
|
10986
|
+
day: handleRenderDay,
|
|
10987
|
+
}, viewRenderers: { hours: null, minutes: null, seconds: null }, minDate: minDate, maxDate: maxDate, disablePast: disablePast, disableFuture: disableFuture, displayStaticWrapperAs: 'desktop', onChange: function (newValue) {
|
|
10988
|
+
var finalValue = newValue
|
|
10989
|
+
? value
|
|
10990
|
+
? newValue.set('hour', value.hour()).set('minute', value.minute()).set('second', value.second())
|
|
10991
|
+
: newValue
|
|
10992
|
+
: newValue;
|
|
10993
|
+
onChange('date', finalValue);
|
|
10994
|
+
}, onMonthChange: function (month) {
|
|
10995
|
+
setMonth(month);
|
|
10996
|
+
if (onMonthChange)
|
|
10997
|
+
onMonthChange(month);
|
|
10998
|
+
} })),
|
|
10999
|
+
yearSelectOpen && (React__default.createElement(PrivateYearSelect, { selectYear: value == null ? null : value.year(), activeYear: month.year(), availableDate: availableDate, onSelect: handleYearSelect })),
|
|
11000
|
+
monthSelectOpen && (React__default.createElement(PrivateMonthSelect, { year: month.year(), selectYear: value == null ? null : value.year(), selectMonth: value == null ? null : value.month(), activeMonth: month.month(), availableDate: availableDate, onSelect: handleMonthSelect }))),
|
|
11001
|
+
React__default.createElement(Grid, { item: true, className: 'action-buttons' },
|
|
11002
|
+
getActionButton(dayjs()
|
|
11003
|
+
.startOf('d')
|
|
11004
|
+
.subtract(1, 'month')
|
|
11005
|
+
.set('hour', value ? value.hour() : 0)
|
|
11006
|
+
.set('minute', value ? value.minute() : 0)
|
|
11007
|
+
.set('second', value ? value.second() : 0), '지난달'),
|
|
11008
|
+
getActionButton(dayjs()
|
|
11009
|
+
.startOf('d')
|
|
11010
|
+
.subtract(7, 'd')
|
|
11011
|
+
.set('hour', value ? value.hour() : 0)
|
|
11012
|
+
.set('minute', value ? value.minute() : 0)
|
|
11013
|
+
.set('second', value ? value.second() : 0), '지난주'),
|
|
11014
|
+
getActionButton(dayjs()
|
|
11015
|
+
.startOf('d')
|
|
11016
|
+
.subtract(1, 'd')
|
|
11017
|
+
.set('hour', value ? value.hour() : 0)
|
|
11018
|
+
.set('minute', value ? value.minute() : 0)
|
|
11019
|
+
.set('second', value ? value.second() : 0), '어제'),
|
|
11020
|
+
getActionButton(dayjs()
|
|
11021
|
+
.startOf('d')
|
|
11022
|
+
.set('hour', value ? value.hour() : 0)
|
|
11023
|
+
.set('minute', value ? value.minute() : 0)
|
|
11024
|
+
.set('second', value ? value.second() : 0), '오늘'))))),
|
|
11025
|
+
time && (React__default.createElement(Grid, { item: true, className: 'time' },
|
|
11026
|
+
React__default.createElement(Grid, { container: true, direction: 'column', className: 'time-container' },
|
|
11027
|
+
React__default.createElement(Grid, { item: true, className: 'time-title' },
|
|
11028
|
+
time === 'hour' && (value ? value.format('HH시') : '00시'),
|
|
11029
|
+
time === 'minute' && (value ? value.format('HH시 mm분') : '00시 00분'),
|
|
11030
|
+
time === 'second' && (value ? value.format('HH시 mm분 ss초') : '00시 00분 00초')),
|
|
11031
|
+
React__default.createElement(Grid, { item: true, className: 'time-select-wrap' },
|
|
11032
|
+
React__default.createElement(Grid, { container: true, style: { height: '100%' } },
|
|
11033
|
+
React__default.createElement(Grid, { item: true, style: { position: 'relative', width: type === 'time' ? 240 : 80 } },
|
|
11034
|
+
React__default.createElement(PrivateTimeSelect, { ref: hourSelectRef, value: value && value.hour(), unit: '\uC2DC', list: hours, disableList: disableHours, cols: type === 'time' ? 3 : 1, onSelect: function (newValue) {
|
|
11035
|
+
onChange('hour', value ? value.set('hour', newValue) : dayjs().startOf('date').set('hour', newValue));
|
|
11036
|
+
} })),
|
|
11037
|
+
(time === 'minute' || time === 'second') && (React__default.createElement(Grid, { item: true, style: { position: 'relative', width: type === 'time' ? 240 : 80 } },
|
|
11038
|
+
React__default.createElement(PrivateTimeSelect, { ref: minuteSelectRef, value: value && value.minute(), unit: '\uBD84', list: minutes, disableList: disableMinutes, cols: type === 'time' ? 3 : 1, listInterval: minuteInterval, onSelect: function (newValue) {
|
|
11039
|
+
onChange('minute', value ? value.set('minute', newValue) : dayjs().startOf('date').set('minute', newValue));
|
|
11040
|
+
} }))),
|
|
11041
|
+
time === 'second' && (React__default.createElement(Grid, { item: true, style: { position: 'relative', width: type === 'time' ? 240 : 80 } },
|
|
11042
|
+
React__default.createElement(PrivateTimeSelect, { ref: secondSelectRef, value: value && value.second(), unit: '\uCD08', list: seconds, disableList: disableSeconds, cols: type === 'time' ? 3 : 1, listInterval: secondInterval, onSelect: function (newValue) {
|
|
11043
|
+
onChange('second', value ? value.set('second', newValue) : dayjs().startOf('date').set('second', newValue));
|
|
11044
|
+
} }))))),
|
|
11045
|
+
onClose && (React__default.createElement(Grid, { item: true, className: 'action-buttons' },
|
|
11046
|
+
React__default.createElement(Button, { variant: 'text', onClick: onClose }, "\uB2EB\uAE30"))))))));
|
|
11047
|
+
});
|
|
11048
|
+
PrivateStaticDateTimePicker.displayName = 'PrivateStaticDateTimePicker';
|
|
11049
|
+
PrivateStaticDateTimePicker.defaultProps = PrivateStaticDateTimePickerDefaultProps;var PrivateDateTimePicker = React__default.forwardRef(function (_a, ref) {
|
|
11050
|
+
// ID --------------------------------------------------------------------------------------------------------------
|
|
11051
|
+
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
11052
|
+
//--------------------------------------------------------------------------------------------------------------------
|
|
11053
|
+
name = _a.name, type = _a.type, time = _a.time, initValue = _a.value, initData = _a.data, initLabel = _a.label, labelIcon = _a.labelIcon, initFormat = _a.format, initFormValueFormat = _a.formValueFormat, required = _a.required, readOnly = _a.readOnly, initDisabled = _a.disabled, width = _a.width, initError = _a.error, initHelperText = _a.helperText, minDate = _a.minDate, maxDate = _a.maxDate, disableFuture = _a.disableFuture, disablePast = _a.disablePast, exceptValue = _a.exceptValue, icon = _a.icon, startAdornment = _a.startAdornment, endAdornment = _a.endAdornment, align = _a.align, hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds, minuteInterval = _a.minuteInterval, secondInterval = _a.secondInterval, readOnlyInput = _a.readOnlyInput, hidden = _a.hidden, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
11054
|
+
//--------------------------------------------------------------------------------------------------------------------
|
|
11055
|
+
className = _a.className, initStyle = _a.style, sx = _a.sx, otherProps = __rest$4(_a, ["variant", "size", "color", "focused", "labelShrink", "fullWidth", "name", "type", "time", "value", "data", "label", "labelIcon", "format", "formValueFormat", "required", "readOnly", "disabled", "width", "error", "helperText", "minDate", "maxDate", "disableFuture", "disablePast", "exceptValue", "icon", "startAdornment", "endAdornment", "align", "hours", "minutes", "seconds", "minuteInterval", "secondInterval", "readOnlyInput", "hidden", "onChange", "onValidate", "className", "style", "sx"]);
|
|
11056
|
+
var id = useId();
|
|
11057
|
+
// Ref -------------------------------------------------------------------------------------------------------------
|
|
11058
|
+
var privateStaticDateTimePickerRef = useRef(null);
|
|
11059
|
+
var textFieldInputRef = useRef();
|
|
11060
|
+
var closeTimeoutRef = useRef();
|
|
11061
|
+
var mouseDownTimeRef = useRef();
|
|
11062
|
+
var datePickerErrorRef = useRef(null);
|
|
11063
|
+
var openValueRef = useRef(null);
|
|
11064
|
+
// FormState -------------------------------------------------------------------------------------------------------
|
|
11065
|
+
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;
|
|
11066
|
+
// Memo - FormState ------------------------------------------------------------------------------------------------
|
|
11067
|
+
var variant = useMemo(function () { return (initVariant == null ? formVariant : initVariant); }, [initVariant, formVariant]);
|
|
11068
|
+
var size = useMemo(function () { return (initSize == null ? formSize : initSize); }, [initSize, formSize]);
|
|
11069
|
+
var color = useMemo(function () { return (initColor == null ? formColor : initColor); }, [initColor, formColor]);
|
|
11070
|
+
var focused = useMemo(function () { return (initFocused == null ? formFocused : initFocused); }, [initFocused, formFocused]);
|
|
11071
|
+
var labelShrink = useMemo(function () { return (initLabelShrink == null ? formLabelShrink : initLabelShrink); }, [initLabelShrink, formLabelShrink]);
|
|
11072
|
+
var fullWidth = useMemo(function () { return (initFullWidth == null ? formFullWidth : initFullWidth); }, [initFullWidth, formFullWidth]);
|
|
11073
|
+
// State - open ----------------------------------------------------------------------------------------------------
|
|
11074
|
+
var _c = useState(false), open = _c[0], setOpen = _c[1];
|
|
11075
|
+
// State -----------------------------------------------------------------------------------------------------------
|
|
11076
|
+
var _d = useAutoUpdateState$1(initError), error = _d[0], setError = _d[1];
|
|
11077
|
+
var _e = useState(null), timeError = _e[0], setTimeError = _e[1];
|
|
11078
|
+
var _f = useAutoUpdateState$1(initHelperText), helperText = _f[0], setHelperText = _f[1];
|
|
11079
|
+
var _g = useAutoUpdateState$1(initDisabled), disabled = _g[0], setDisabled = _g[1];
|
|
11080
|
+
var _h = useAutoUpdateState$1(initData), data = _h[0], setData = _h[1];
|
|
11081
|
+
// Memo --------------------------------------------------------------------------------------------------------------
|
|
11082
|
+
var label = useMemo(function () {
|
|
11083
|
+
if (labelIcon) {
|
|
11084
|
+
return React__default.createElement(IconText, { icon: labelIcon }, initLabel);
|
|
11085
|
+
}
|
|
11086
|
+
else {
|
|
11087
|
+
return initLabel;
|
|
11088
|
+
}
|
|
11089
|
+
}, [initLabel, labelIcon]);
|
|
11090
|
+
var format = useMemo(function () {
|
|
11091
|
+
if (initFormat) {
|
|
11092
|
+
return initFormat;
|
|
11093
|
+
}
|
|
11094
|
+
else {
|
|
11095
|
+
return getDateTimeFormat(type, time);
|
|
11096
|
+
}
|
|
11097
|
+
}, [initFormat, time, type]);
|
|
11098
|
+
var formValueFormat = useMemo(function () {
|
|
11099
|
+
if (initFormValueFormat) {
|
|
11100
|
+
return initFormValueFormat;
|
|
11101
|
+
}
|
|
11102
|
+
else {
|
|
11103
|
+
return getDateTimeFormValueFormat(type, time);
|
|
11104
|
+
}
|
|
11105
|
+
}, [initFormValueFormat, time, type]);
|
|
11106
|
+
var availableDate = useMemo(function () { return makeAvailableDate(minDate, maxDate, !!disablePast, !!disableFuture); }, [disableFuture, disablePast, maxDate, minDate]);
|
|
11107
|
+
// State - style ---------------------------------------------------------------------------------------------------
|
|
11108
|
+
var style = useAutoUpdateState$1(useCallback(function () {
|
|
11109
|
+
if (width != null) {
|
|
11110
|
+
return __assign$7(__assign$7({}, initStyle), { width: width });
|
|
11111
|
+
}
|
|
11112
|
+
else {
|
|
11113
|
+
return initStyle;
|
|
11114
|
+
}
|
|
11115
|
+
}, [initStyle, width]))[0];
|
|
11116
|
+
// Function - getFinalValue ----------------------------------------------------------------------------------------
|
|
11117
|
+
var getFinalValue = useCallback(function (value) {
|
|
11118
|
+
return value;
|
|
11119
|
+
}, []);
|
|
11120
|
+
// State - value ---------------------------------------------------------------------------------------------------
|
|
11121
|
+
var _j = useAutoUpdateState$1(initValue || null, getFinalValue), value = _j[0], setValue = _j[1];
|
|
11122
|
+
var _k = useState(null), inputValue = _k[0], setInputValue = _k[1];
|
|
11123
|
+
// Effect ----------------------------------------------------------------------------------------------------------
|
|
11124
|
+
useEffect(function () {
|
|
11125
|
+
if (value !== initValue) {
|
|
11126
|
+
if (onChange)
|
|
11127
|
+
onChange(value);
|
|
11128
|
+
onValueChange(name, value);
|
|
11129
|
+
}
|
|
11130
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
11131
|
+
}, []);
|
|
11132
|
+
useFirstSkipEffect$1(function () {
|
|
11133
|
+
if (error)
|
|
11134
|
+
validate(value);
|
|
11135
|
+
if (onChange)
|
|
11136
|
+
onChange(value);
|
|
11137
|
+
onValueChange(name, value);
|
|
11138
|
+
}, [value]);
|
|
11139
|
+
useEffect(function () {
|
|
11140
|
+
setInputValue(value);
|
|
11141
|
+
}, [value]);
|
|
11142
|
+
useFirstSkipEffect$1(function () {
|
|
11143
|
+
if (error && !timeError)
|
|
11144
|
+
validate(value);
|
|
11145
|
+
}, [timeError]);
|
|
11146
|
+
useFirstSkipEffect$1(function () {
|
|
11147
|
+
if (open) {
|
|
11148
|
+
openValueRef.current = value;
|
|
11149
|
+
}
|
|
11150
|
+
else {
|
|
11151
|
+
if (openValueRef.current !== value) {
|
|
11152
|
+
var runOnRequestSearchSubmit = void 0;
|
|
11153
|
+
if (openValueRef.current && value) {
|
|
11154
|
+
runOnRequestSearchSubmit = !openValueRef.current.isSame(value, 'second');
|
|
11155
|
+
}
|
|
11156
|
+
else {
|
|
11157
|
+
runOnRequestSearchSubmit = true;
|
|
11158
|
+
}
|
|
11159
|
+
if (runOnRequestSearchSubmit) {
|
|
11160
|
+
onRequestSearchSubmit(name, value);
|
|
11161
|
+
}
|
|
11162
|
+
}
|
|
11163
|
+
}
|
|
11164
|
+
}, [open]);
|
|
11165
|
+
useEffect(function () {
|
|
11166
|
+
if (type !== 'time' && time && value && (availableDate[0] || availableDate[1])) {
|
|
11167
|
+
var availableDateVal = getAvailableDateVal(availableDate, type, time);
|
|
11168
|
+
var valueVal = getDateValForAvailableDate(value, type, time);
|
|
11169
|
+
var timeError_1 = null;
|
|
11170
|
+
if (availableDateVal[0] && valueVal < availableDateVal[0]) {
|
|
11171
|
+
timeError_1 = 'minDate';
|
|
11172
|
+
}
|
|
11173
|
+
if (timeError_1 == null && availableDateVal[1] && valueVal > availableDateVal[1]) {
|
|
11174
|
+
timeError_1 = 'maxDate';
|
|
11175
|
+
}
|
|
11176
|
+
setTimeError(timeError_1);
|
|
11177
|
+
}
|
|
11178
|
+
else {
|
|
11179
|
+
setTimeError(null);
|
|
11180
|
+
}
|
|
11181
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
11182
|
+
}, [value]);
|
|
11183
|
+
// Memo --------------------------------------------------------------------------------------------------------------
|
|
11184
|
+
var wrapStyle = useMemo(function () { return ({
|
|
11185
|
+
display: hidden ? 'none' : fullWidth ? 'block' : 'inline-block',
|
|
11186
|
+
flex: fullWidth ? 1 : undefined,
|
|
11187
|
+
}); }, [hidden, fullWidth]);
|
|
11188
|
+
// Function - focus ------------------------------------------------------------------------------------------------
|
|
11189
|
+
var focus = useCallback(function () {
|
|
11190
|
+
var _a;
|
|
11191
|
+
(_a = textFieldInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
11192
|
+
}, [textFieldInputRef]);
|
|
11193
|
+
// Function - setErrorHelperText -----------------------------------------------------------------------------------
|
|
11194
|
+
var setErrorHelperText = useCallback(function (error, helperText) {
|
|
11195
|
+
setError(error);
|
|
11196
|
+
setHelperText(helperText);
|
|
11197
|
+
}, [setError, setHelperText]);
|
|
11198
|
+
// Function - validate ---------------------------------------------------------------------------------------------
|
|
11199
|
+
var validate = useCallback(function (value) {
|
|
11200
|
+
if (required && empty(value)) {
|
|
11201
|
+
setErrorHelperText(true, '필수 입력 항목입니다.');
|
|
11202
|
+
return false;
|
|
11203
|
+
}
|
|
11204
|
+
if (value && !value.isValid()) {
|
|
11205
|
+
setErrorHelperText(true, '형식이 일치하지 않습니다.');
|
|
11206
|
+
return false;
|
|
11207
|
+
}
|
|
11208
|
+
if (datePickerErrorRef.current) {
|
|
11209
|
+
setErrorHelperText(true, getDateValidationErrorText(datePickerErrorRef.current));
|
|
11210
|
+
return false;
|
|
11211
|
+
}
|
|
11212
|
+
if (timeError) {
|
|
11213
|
+
setErrorHelperText(true, getDateValidationErrorText(timeError));
|
|
11214
|
+
return false;
|
|
11215
|
+
}
|
|
11216
|
+
if (onValidate) {
|
|
11217
|
+
var onValidateResult = onValidate(value);
|
|
11218
|
+
if (onValidateResult != null && onValidateResult !== true) {
|
|
11219
|
+
setErrorHelperText(true, onValidateResult);
|
|
11220
|
+
return false;
|
|
11221
|
+
}
|
|
11222
|
+
}
|
|
11223
|
+
setErrorHelperText(false, initHelperText);
|
|
11224
|
+
return true;
|
|
11225
|
+
}, [required, timeError, onValidate, setErrorHelperText, initHelperText]);
|
|
11226
|
+
// Commands --------------------------------------------------------------------------------------------------------
|
|
11227
|
+
useLayoutEffect(function () {
|
|
11228
|
+
if (ref || onAddValueItem) {
|
|
11229
|
+
var lastValue_1 = value;
|
|
11230
|
+
var lastData_1 = data;
|
|
11231
|
+
var lastDisabled_1 = !!disabled;
|
|
11232
|
+
var commands = {
|
|
11233
|
+
getType: function () { return 'default'; },
|
|
11234
|
+
getName: function () { return name; },
|
|
11235
|
+
getReset: function () { return getFinalValue(initValue || null); },
|
|
11236
|
+
reset: function () {
|
|
11237
|
+
lastValue_1 = getFinalValue(initValue || null);
|
|
11238
|
+
setValue(lastValue_1);
|
|
11239
|
+
},
|
|
11240
|
+
getValue: function () { return lastValue_1; },
|
|
11241
|
+
setValue: function (value) {
|
|
11242
|
+
lastValue_1 = getFinalValue(value);
|
|
11243
|
+
setValue(lastValue_1);
|
|
11244
|
+
},
|
|
11245
|
+
getData: function () { return lastData_1; },
|
|
11246
|
+
setData: function (data) {
|
|
11247
|
+
lastData_1 = data;
|
|
11248
|
+
setData(data);
|
|
11249
|
+
},
|
|
11250
|
+
isExceptValue: function () { return !!exceptValue; },
|
|
11251
|
+
isDisabled: function () { return lastDisabled_1; },
|
|
11252
|
+
setDisabled: function (disabled) {
|
|
11253
|
+
lastDisabled_1 = disabled;
|
|
11254
|
+
setDisabled(disabled);
|
|
11255
|
+
},
|
|
11256
|
+
focus: focus,
|
|
11257
|
+
focusValidate: focus,
|
|
11258
|
+
validate: function () { return validate(value); },
|
|
11259
|
+
setError: function (error, errorText) {
|
|
11260
|
+
return setErrorHelperText(error, error ? errorText : initHelperText);
|
|
11261
|
+
},
|
|
11262
|
+
getFormValueFormat: function () { return formValueFormat; },
|
|
11263
|
+
};
|
|
11264
|
+
if (ref) {
|
|
11265
|
+
if (typeof ref === 'function') {
|
|
11266
|
+
ref(commands);
|
|
11267
|
+
}
|
|
11268
|
+
else {
|
|
11269
|
+
ref.current = commands;
|
|
11270
|
+
}
|
|
11271
|
+
}
|
|
11272
|
+
if (onAddValueItem)
|
|
11273
|
+
onAddValueItem(id, commands);
|
|
11274
|
+
return function () {
|
|
11275
|
+
if (ref) {
|
|
11276
|
+
if (typeof ref === 'function') {
|
|
11277
|
+
ref(null);
|
|
11278
|
+
}
|
|
11279
|
+
else {
|
|
11280
|
+
ref.current = null;
|
|
11281
|
+
}
|
|
11282
|
+
}
|
|
11283
|
+
if (onRemoveValueItem)
|
|
11284
|
+
onRemoveValueItem(id);
|
|
11285
|
+
};
|
|
11286
|
+
}
|
|
11287
|
+
}, [
|
|
11288
|
+
name,
|
|
11289
|
+
initValue,
|
|
11290
|
+
value,
|
|
11291
|
+
getFinalValue,
|
|
11292
|
+
exceptValue,
|
|
11293
|
+
disabled,
|
|
11294
|
+
focus,
|
|
11295
|
+
validate,
|
|
11296
|
+
formValueFormat,
|
|
11297
|
+
ref,
|
|
11298
|
+
onAddValueItem,
|
|
11299
|
+
onRemoveValueItem,
|
|
11300
|
+
id,
|
|
11301
|
+
setValue,
|
|
11302
|
+
setDisabled,
|
|
11303
|
+
setErrorHelperText,
|
|
11304
|
+
initHelperText,
|
|
11305
|
+
data,
|
|
11306
|
+
setData,
|
|
11307
|
+
]);
|
|
11308
|
+
// Event Handler ---------------------------------------------------------------------------------------------------
|
|
11309
|
+
var handleChange = useCallback(function (unit, newValue, keyboardInputValue) {
|
|
11310
|
+
var _a, _b, _c;
|
|
11311
|
+
var updateValue = true;
|
|
11312
|
+
if (notEmpty(keyboardInputValue)) {
|
|
11313
|
+
if (newValue) {
|
|
11314
|
+
if (!newValue.isValid()) {
|
|
11315
|
+
updateValue = false;
|
|
11316
|
+
}
|
|
11317
|
+
}
|
|
11318
|
+
}
|
|
11319
|
+
var finalValue = newValue;
|
|
11320
|
+
if (updateValue) {
|
|
11321
|
+
if (type !== 'time' && finalValue != null && keyboardInputValue == null) {
|
|
11322
|
+
var checkResult = checkDateAvailable(finalValue, availableDate, type, time);
|
|
11323
|
+
if (checkResult !== 'available') {
|
|
11324
|
+
var availableDateDate = getAvailableDate(availableDate, type, time);
|
|
11325
|
+
if (checkResult === 'min') {
|
|
11326
|
+
if (availableDateDate[0])
|
|
11327
|
+
finalValue = availableDateDate[0];
|
|
11328
|
+
}
|
|
11329
|
+
else if (checkResult === 'max') {
|
|
11330
|
+
if (availableDateDate[1])
|
|
11331
|
+
finalValue = availableDateDate[1];
|
|
11332
|
+
}
|
|
11333
|
+
}
|
|
11334
|
+
}
|
|
11335
|
+
var runOnRequestSearchSubmit_1 = false;
|
|
11336
|
+
if (notEmpty(keyboardInputValue)) {
|
|
11337
|
+
if (!time || unit !== 'action_date') {
|
|
11338
|
+
runOnRequestSearchSubmit_1 = !open; // 팝업창 열리지 않은 상태에서 날짜 키보드로 변경
|
|
11339
|
+
setOpen(false);
|
|
11340
|
+
}
|
|
11341
|
+
}
|
|
11342
|
+
else if (time) {
|
|
11343
|
+
if (time === unit)
|
|
11344
|
+
setOpen(false);
|
|
11345
|
+
}
|
|
11346
|
+
setValue(finalValue);
|
|
11347
|
+
nextTick(function () {
|
|
11348
|
+
onValueChangeByUser(name, finalValue);
|
|
11349
|
+
if (runOnRequestSearchSubmit_1) {
|
|
11350
|
+
onRequestSearchSubmit(name, finalValue);
|
|
11351
|
+
}
|
|
11352
|
+
});
|
|
11353
|
+
if (time) {
|
|
11354
|
+
if (finalValue) {
|
|
11355
|
+
switch (unit) {
|
|
11356
|
+
case 'date':
|
|
11357
|
+
case 'action_date':
|
|
11358
|
+
(_a = privateStaticDateTimePickerRef.current) === null || _a === void 0 ? void 0 : _a.timeSelectScrollToDate(finalValue);
|
|
11359
|
+
break;
|
|
11360
|
+
case 'hour':
|
|
11361
|
+
(_b = privateStaticDateTimePickerRef.current) === null || _b === void 0 ? void 0 : _b.timeSelectScrollToDate(finalValue, ['minute', 'second']);
|
|
11362
|
+
break;
|
|
11363
|
+
case 'minute':
|
|
11364
|
+
(_c = privateStaticDateTimePickerRef.current) === null || _c === void 0 ? void 0 : _c.timeSelectScrollToDate(finalValue, ['second']);
|
|
11365
|
+
break;
|
|
11366
|
+
}
|
|
11367
|
+
}
|
|
11368
|
+
}
|
|
11369
|
+
}
|
|
11370
|
+
setInputValue(finalValue);
|
|
11371
|
+
}, [type, time, setValue, availableDate, open, onValueChangeByUser, name, onRequestSearchSubmit]);
|
|
11372
|
+
var handleContainerFocus = useCallback(function () {
|
|
11373
|
+
if (closeTimeoutRef.current) {
|
|
11374
|
+
clearTimeout(closeTimeoutRef.current);
|
|
11375
|
+
closeTimeoutRef.current = undefined;
|
|
11376
|
+
}
|
|
11377
|
+
}, []);
|
|
11378
|
+
var handleContainerBlur = useCallback(function () {
|
|
11379
|
+
if (closeTimeoutRef.current) {
|
|
11380
|
+
clearTimeout(closeTimeoutRef.current);
|
|
11381
|
+
closeTimeoutRef.current = undefined;
|
|
11382
|
+
}
|
|
11383
|
+
if (!mouseDownTimeRef.current || new Date().getTime() - mouseDownTimeRef.current > 100) {
|
|
11384
|
+
closeTimeoutRef.current = setTimeout(function () {
|
|
11385
|
+
closeTimeoutRef.current = undefined;
|
|
11386
|
+
setOpen(false);
|
|
11387
|
+
}, 10);
|
|
11388
|
+
}
|
|
11389
|
+
}, []);
|
|
11390
|
+
var handleContainerMouseDown = useCallback(function () {
|
|
11391
|
+
if (closeTimeoutRef.current) {
|
|
11392
|
+
clearTimeout(closeTimeoutRef.current);
|
|
11393
|
+
closeTimeoutRef.current = undefined;
|
|
11394
|
+
}
|
|
11395
|
+
mouseDownTimeRef.current = new Date().getTime();
|
|
11396
|
+
}, []);
|
|
11397
|
+
// Memo --------------------------------------------------------------------------------------------------------------
|
|
11398
|
+
var slotProps = useMemo(function () {
|
|
11399
|
+
var textFieldInputLabelProps = {};
|
|
11400
|
+
if (labelShrink) {
|
|
11401
|
+
textFieldInputLabelProps.shrink = labelShrink;
|
|
11402
|
+
}
|
|
11403
|
+
var readOnly = readOnlyInput;
|
|
11404
|
+
var inputProps = {
|
|
11405
|
+
readOnly: readOnly,
|
|
11406
|
+
};
|
|
11407
|
+
if (readOnly) {
|
|
11408
|
+
inputProps.tabIndex = -1;
|
|
11409
|
+
inputProps.className = classNames$1(inputProps.className, 'Mui-disabled');
|
|
11410
|
+
}
|
|
11411
|
+
var muiInputProps = { endAdornment: undefined };
|
|
11412
|
+
if (startAdornment || icon || muiInputProps.startAdornment) {
|
|
11413
|
+
muiInputProps.startAdornment = (React__default.createElement(React__default.Fragment, null,
|
|
11414
|
+
icon && (React__default.createElement(InputAdornment, { position: 'start' },
|
|
11415
|
+
React__default.createElement(FormIcon, { fontSize: 'small' }, icon))),
|
|
11416
|
+
startAdornment && React__default.createElement(InputAdornment, { position: 'start' }, startAdornment),
|
|
11417
|
+
muiInputProps.startAdornment));
|
|
11418
|
+
}
|
|
11419
|
+
if (endAdornment) {
|
|
11420
|
+
muiInputProps.endAdornment = (React__default.createElement(React__default.Fragment, null, endAdornment && React__default.createElement(InputAdornment, { position: 'end' }, endAdornment)));
|
|
11421
|
+
}
|
|
11422
|
+
return {
|
|
11423
|
+
textField: {
|
|
11424
|
+
className: classNames$1('input-text-field', "align-".concat(align)),
|
|
11425
|
+
inputRef: function (ref) {
|
|
11426
|
+
textFieldInputRef.current = ref;
|
|
11427
|
+
},
|
|
11428
|
+
variant: variant,
|
|
11429
|
+
size: size,
|
|
11430
|
+
color: color,
|
|
11431
|
+
focused: focused,
|
|
11432
|
+
InputLabelProps: textFieldInputLabelProps,
|
|
11433
|
+
InputProps: muiInputProps,
|
|
11434
|
+
inputProps: inputProps,
|
|
11435
|
+
required: required,
|
|
11436
|
+
fullWidth: fullWidth,
|
|
11437
|
+
helperText: undefined,
|
|
11438
|
+
error: !!error || !!timeError,
|
|
11439
|
+
style: style,
|
|
11440
|
+
sx: sx,
|
|
11441
|
+
onFocus: function () {
|
|
11442
|
+
setOpen(true);
|
|
11443
|
+
},
|
|
11444
|
+
onClick: function () {
|
|
11445
|
+
setOpen(true);
|
|
11446
|
+
},
|
|
11447
|
+
},
|
|
11448
|
+
};
|
|
11449
|
+
}, [
|
|
11450
|
+
align,
|
|
11451
|
+
color,
|
|
11452
|
+
endAdornment,
|
|
11453
|
+
error,
|
|
11454
|
+
focused,
|
|
11455
|
+
fullWidth,
|
|
11456
|
+
icon,
|
|
11457
|
+
labelShrink,
|
|
11458
|
+
readOnlyInput,
|
|
11459
|
+
required,
|
|
11460
|
+
size,
|
|
11461
|
+
startAdornment,
|
|
11462
|
+
style,
|
|
11463
|
+
sx,
|
|
11464
|
+
timeError,
|
|
11465
|
+
variant,
|
|
11466
|
+
]);
|
|
11467
|
+
// Render ----------------------------------------------------------------------------------------------------------
|
|
11468
|
+
return (React__default.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs },
|
|
11469
|
+
React__default.createElement(ClickAwayListener, { mouseEvent: 'onMouseDown', touchEvent: 'onTouchStart', onClickAway: function () { return setOpen(false); } },
|
|
11470
|
+
React__default.createElement("div", { className: classNames$1(className, 'PrivateDateTimePicker'), style: wrapStyle, onMouseDown: handleContainerMouseDown, onFocus: handleContainerFocus, onBlur: handleContainerBlur },
|
|
11471
|
+
React__default.createElement(PrivateStyledTooltip, { open: disabled || readOnly ? false : open, PopperProps: {
|
|
11472
|
+
modifiers: [
|
|
11473
|
+
{
|
|
11474
|
+
name: 'offset',
|
|
11475
|
+
options: {
|
|
11476
|
+
offset: [0, error && helperText ? 8 : -14],
|
|
11477
|
+
},
|
|
11478
|
+
},
|
|
11479
|
+
],
|
|
11480
|
+
}, title: React__default.createElement(PrivateStaticDateTimePicker, __assign$7({}, otherProps, { ref: privateStaticDateTimePickerRef, type: type, time: time, value: value, availableDate: availableDate, minDate: minDate, maxDate: maxDate, disablePast: disablePast, disableFuture: disableFuture, hours: hours, minutes: minutes, seconds: seconds, minuteInterval: minuteInterval, secondInterval: secondInterval, onChange: handleChange, onAccept: function () { return !time && setOpen(false); }, onClose: function () { return setOpen(false); } })) },
|
|
11481
|
+
React__default.createElement("div", { style: { display: fullWidth ? 'block' : 'inline-block' } },
|
|
11482
|
+
React__default.createElement(DesktopDateTimePicker, __assign$7({ value: inputValue, label: label, open: false, format: format, disabled: disabled, readOnly: readOnly, minDate: minDate, maxDate: maxDate, disablePast: disablePast, disableFuture: disableFuture, onClose: function () { return setOpen(false); }, onError: function (reason) { return (datePickerErrorRef.current = reason); }, onChange: function (newValue) { return handleChange('date', newValue); }, slotProps: slotProps }, otherProps)))),
|
|
11483
|
+
!formColWithHelperText && helperText && (React__default.createElement(FormHelperText, { error: error, style: { marginLeft: variant === 'standard' ? 0 : 14 } }, helperText))))));
|
|
11484
|
+
});
|
|
11485
|
+
PrivateDateTimePicker.displayName = 'PrivateDateTimePicker';
|
|
11486
|
+
PrivateDateTimePicker.defaultProps = PrivateDateTimePickerDefaultProps;var PrivateAlertDialogDefaultProps = {
|
|
10808
11487
|
color: 'primary',
|
|
10809
11488
|
};var PrivateAlertDialog = function (_a) {
|
|
10810
11489
|
var color = _a.color, open = _a.open, title = _a.title, content = _a.content, onClose = _a.onClose;
|
|
@@ -10843,7 +11522,7 @@ FormDatePicker.defaultProps = FormDatePickerDefaultProps;var FormDateTimePickerD
|
|
|
10843
11522
|
}, [onAddValueItem]);
|
|
10844
11523
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
10845
11524
|
return (React__default.createElement(FormContextProvider, { value: __assign$7({ onAddValueItem: handleAddValueItem }, otherFormState) },
|
|
10846
|
-
React__default.createElement(
|
|
11525
|
+
React__default.createElement(PrivateDateTimePicker, __assign$7({ className: classNames$1(className, 'FormDateTimePicker') }, props, { ref: ref, type: 'date_time' }))));
|
|
10847
11526
|
});
|
|
10848
11527
|
FormDateTimePicker.displayName = 'FormDateTimePicker';
|
|
10849
11528
|
FormDateTimePicker.defaultProps = FormDateTimePickerDefaultProps;var FormTimePickerDefaultProps = {};var FormTimePicker = React__default.forwardRef(function (_a, ref) {
|
|
@@ -10857,7 +11536,7 @@ FormDateTimePicker.defaultProps = FormDateTimePickerDefaultProps;var FormTimePic
|
|
|
10857
11536
|
}, [onAddValueItem]);
|
|
10858
11537
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
10859
11538
|
return (React__default.createElement(FormContextProvider, { value: __assign$7({ onAddValueItem: handleAddValueItem }, otherFormState) },
|
|
10860
|
-
React__default.createElement(
|
|
11539
|
+
React__default.createElement(PrivateDateTimePicker, __assign$7({ className: classNames$1(className, 'FormTimePicker') }, props, { ref: ref, type: 'time' }))));
|
|
10861
11540
|
});
|
|
10862
11541
|
FormTimePicker.displayName = 'FormTimePicker';
|
|
10863
11542
|
FormTimePicker.defaultProps = FormTimePickerDefaultProps;var FormDateRangePickerDefaultProps = {
|
|
@@ -11954,7 +12633,9 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
11954
12633
|
!formColWithHelperText && helperText && (React__default.createElement(FormHelperText, { error: error || startError || endError, style: { marginLeft: variant === 'standard' ? 0 : 14 } }, helperText))))));
|
|
11955
12634
|
});
|
|
11956
12635
|
FormDateRangePicker.displayName = 'FormDateRangePicker';
|
|
11957
|
-
FormDateRangePicker.defaultProps = FormDateRangePickerDefaultProps;var FormFileDefaultProps = {
|
|
12636
|
+
FormDateRangePicker.defaultProps = FormDateRangePickerDefaultProps;var FormFileDefaultProps = {
|
|
12637
|
+
value: '',
|
|
12638
|
+
};var LinkDialogDefaultProps = {};var LinkDialog = function (_a) {
|
|
11958
12639
|
// Ref -------------------------------------------------------------------------------------------------------------
|
|
11959
12640
|
var open = _a.open, onConfirm = _a.onConfirm, onCancel = _a.onCancel, onClose = _a.onClose;
|
|
11960
12641
|
var inputRef = useRef();
|
|
@@ -12029,7 +12710,7 @@ styleInject(css_248z$1);var FormFile = React__default.forwardRef(function (_a, r
|
|
|
12029
12710
|
var fileUploadBtnRef = useRef(null);
|
|
12030
12711
|
var linkBtnRef = useRef(null);
|
|
12031
12712
|
// State - value ---------------------------------------------------------------------------------------------------
|
|
12032
|
-
var _c = useAutoUpdateState$1(initValue), value = _c[0], setValue = _c[1];
|
|
12713
|
+
var _c = useAutoUpdateState$1(initValue || ''), value = _c[0], setValue = _c[1];
|
|
12033
12714
|
var fileValue = useState('')[0];
|
|
12034
12715
|
useFirstSkipEffect$1(function () {
|
|
12035
12716
|
if (error)
|
|
@@ -12102,9 +12783,9 @@ styleInject(css_248z$1);var FormFile = React__default.forwardRef(function (_a, r
|
|
|
12102
12783
|
var commands = {
|
|
12103
12784
|
getType: function () { return 'FormFile'; },
|
|
12104
12785
|
getName: function () { return name; },
|
|
12105
|
-
getReset: function () { return initValue; },
|
|
12786
|
+
getReset: function () { return initValue || ''; },
|
|
12106
12787
|
reset: function () {
|
|
12107
|
-
lastValue = initValue;
|
|
12788
|
+
lastValue = initValue || '';
|
|
12108
12789
|
setValue(lastValue);
|
|
12109
12790
|
},
|
|
12110
12791
|
getValue: function () { return lastValue; },
|
|
@@ -12418,7 +13099,7 @@ styleInject(css_248z);var FormImageFile = React__default.forwardRef(function (_a
|
|
|
12418
13099
|
if (preview && value) {
|
|
12419
13100
|
return (React__default.createElement("a", { href: value, target: '_blank' },
|
|
12420
13101
|
React__default.createElement(Tooltip, { title: React__default.createElement("div", { style: { paddingTop: 3, paddingBottom: 3 } },
|
|
12421
|
-
React__default.createElement("img", { src: value, style: { maxWidth: '100%', verticalAlign: 'middle' } })) },
|
|
13102
|
+
React__default.createElement("img", { src: value, style: { maxWidth: '100%', verticalAlign: 'middle' }, alt: '' })) },
|
|
12422
13103
|
React__default.createElement("img", { className: 'preview-img', src: value, style: { maxHeight: previewMaxHeight || undefined }, alt: '' }))));
|
|
12423
13104
|
}
|
|
12424
13105
|
}, [preview, previewMaxHeight, value]);
|