fis-component 0.0.67 → 0.0.68
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/cjs/index.js +5 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/src/components/Input/InputTime/index.d.ts +3 -1
- package/dist/esm/index.js +5 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/Input/InputTime/index.d.ts +3 -1
- package/dist/index.d.ts +3 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -70938,7 +70938,7 @@ const DivInputTimeSC = styled.div `
|
|
|
70938
70938
|
`;
|
|
70939
70939
|
|
|
70940
70940
|
const FISInputTime = React.forwardRef((props, ref) => {
|
|
70941
|
-
const { className, textLabel = "", iconLabel, required, message, negative, positive, format = "HH:mm:ss", disabled, onClickIconLabel, ...rest } = props;
|
|
70941
|
+
const { className, textLabel = "", iconLabel, required, message, negative, positive, format = "HH:mm:ss", disabled, onChange, onClickIconLabel, getPopupContainer, ...rest } = props;
|
|
70942
70942
|
const [inputValue, setInputValue] = React.useState("");
|
|
70943
70943
|
const [timeValue, setTimeValue] = React.useState(null);
|
|
70944
70944
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
@@ -70956,6 +70956,7 @@ const FISInputTime = React.forwardRef((props, ref) => {
|
|
|
70956
70956
|
};
|
|
70957
70957
|
}, []);
|
|
70958
70958
|
const handleTimeChange = (time) => {
|
|
70959
|
+
onChange?.(time ? time.toDate() : null);
|
|
70959
70960
|
setTimeValue(time);
|
|
70960
70961
|
setInputValue(time ? time.format(format) : "");
|
|
70961
70962
|
setIsOpen(false);
|
|
@@ -70965,9 +70966,11 @@ const FISInputTime = React.forwardRef((props, ref) => {
|
|
|
70965
70966
|
setInputValue(newValue);
|
|
70966
70967
|
const parsedTime = dayjs(newValue, format, true);
|
|
70967
70968
|
if (parsedTime.isValid()) {
|
|
70969
|
+
onChange?.(parsedTime.toDate());
|
|
70968
70970
|
setTimeValue(parsedTime);
|
|
70969
70971
|
}
|
|
70970
70972
|
else {
|
|
70973
|
+
onChange?.(null);
|
|
70971
70974
|
setTimeValue(null);
|
|
70972
70975
|
}
|
|
70973
70976
|
};
|
|
@@ -70979,7 +70982,7 @@ const FISInputTime = React.forwardRef((props, ref) => {
|
|
|
70979
70982
|
setIsOpen(open);
|
|
70980
70983
|
}
|
|
70981
70984
|
};
|
|
70982
|
-
return (jsxRuntime.jsxs(DivContainerSC$2, { className: className, ref: containerRef, children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsxs(DivInputTimeSC, { children: [jsxRuntime.jsx(FISInputField, { ...rest, ref: ref, typeSuffix: "icon", iconSuffix: jsxRuntime.jsx(TimeIcon, {}), negative: negative, value: inputValue, onChange: handleInputChange, onFocus: handleClickInput, onClickSuffix: handleClickInput }), jsxRuntime.jsx(HiddenTimePickerSC, { format: format, value: timeValue, onChange: handleTimeChange, open: isOpen, onOpenChange: handleOpenChange, getPopupContainer:
|
|
70985
|
+
return (jsxRuntime.jsxs(DivContainerSC$2, { className: className, ref: containerRef, children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsxs(DivInputTimeSC, { children: [jsxRuntime.jsx(FISInputField, { ...rest, ref: ref, typeSuffix: "icon", iconSuffix: jsxRuntime.jsx(TimeIcon, {}), negative: negative, value: inputValue, onChange: handleInputChange, onFocus: handleClickInput, onClickSuffix: handleClickInput }), jsxRuntime.jsx(HiddenTimePickerSC, { format: format, value: timeValue, onChange: handleTimeChange, open: isOpen, onOpenChange: handleOpenChange, getPopupContainer: getPopupContainer })] }), message && (jsxRuntime.jsx(DivHintWrapperSC, { children: jsxRuntime.jsx(SpanHintSC, { className: classNames({
|
|
70983
70986
|
disabled: disabled,
|
|
70984
70987
|
negative: negative,
|
|
70985
70988
|
positive: positive,
|