fis-component 0.0.67 → 0.0.69
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 +27 -14
- 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 +27 -14
- 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
|
@@ -61552,12 +61552,12 @@ function LevelingIcon(props) {
|
|
|
61552
61552
|
|
|
61553
61553
|
function CaretIcon(props) {
|
|
61554
61554
|
const { width = 16, height = 16, ...rest } = props;
|
|
61555
|
-
return (jsxRuntime.jsxs("svg", { width: width, height: height, viewBox: "0 0 17 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...rest, children: [jsxRuntime.jsx("g", {
|
|
61555
|
+
return (jsxRuntime.jsxs("svg", { width: width, height: height, viewBox: "0 0 17 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...rest, children: [jsxRuntime.jsx("g", { clipPath: "url(#clip0_11094_8532)", children: jsxRuntime.jsx("path", { d: "M4.66699 6L8.66699 10L12.667 6", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_11094_8532", children: jsxRuntime.jsx("rect", { width: "16", height: "16", fill: "white", transform: "translate(0.666992)" }) }) })] }));
|
|
61556
61556
|
}
|
|
61557
61557
|
|
|
61558
61558
|
function ExitIcon(props) {
|
|
61559
61559
|
const { width = 16, height = 16, ...rest } = props;
|
|
61560
|
-
return (jsxRuntime.jsxs("svg", { width: width, height: height, viewBox: "0 0 17 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsx("g", {
|
|
61560
|
+
return (jsxRuntime.jsxs("svg", { width: width, height: height, viewBox: "0 0 17 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsx("g", { clipPath: "url(#clip0_11161_972)", children: jsxRuntime.jsx("path", { d: "M12.6001 4L4.6001 12M4.6001 4L12.6001 12", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_11161_972", children: jsxRuntime.jsx("rect", { width: "16", height: "16", fill: "white", transform: "translate(0.600098)" }) }) })] }));
|
|
61561
61561
|
}
|
|
61562
61562
|
|
|
61563
61563
|
function InfoIcon(props) {
|
|
@@ -61566,7 +61566,7 @@ function InfoIcon(props) {
|
|
|
61566
61566
|
|
|
61567
61567
|
function CheckIcon(props) {
|
|
61568
61568
|
const { width = 20, height = 20, ...rest } = props;
|
|
61569
|
-
return (jsxRuntime.jsx("svg", { width: width, height: height, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...rest, children: jsxRuntime.jsx("path", { d: "M16.6666 5L7.49992 14.1667L3.33325 10", stroke: "currentColor",
|
|
61569
|
+
return (jsxRuntime.jsx("svg", { width: width, height: height, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...rest, children: jsxRuntime.jsx("path", { d: "M16.6666 5L7.49992 14.1667L3.33325 10", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
61570
61570
|
}
|
|
61571
61571
|
|
|
61572
61572
|
function WarningIcon(props) {
|
|
@@ -61586,7 +61586,7 @@ function PositiveIcon(props) {
|
|
|
61586
61586
|
|
|
61587
61587
|
function ArrowDownIcon(props) {
|
|
61588
61588
|
const { width = 16, height = 16, ...rest } = props;
|
|
61589
|
-
return (jsxRuntime.jsxs("svg", { width: width, height: height, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...rest, children: [jsxRuntime.jsx("g", {
|
|
61589
|
+
return (jsxRuntime.jsxs("svg", { width: width, height: height, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...rest, children: [jsxRuntime.jsx("g", { clipPath: "url(#clip0_11182_21084)", children: jsxRuntime.jsx("path", { d: "M4.66666 6L8.66666 10L12.6667 6", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_11182_21084", children: jsxRuntime.jsx("rect", { width: "16", height: "16", fill: "white", transform: "translate(0.666656)" }) }) })] }));
|
|
61590
61590
|
}
|
|
61591
61591
|
|
|
61592
61592
|
function ArrowUpIcon(props) {
|
|
@@ -61596,12 +61596,12 @@ function ArrowUpIcon(props) {
|
|
|
61596
61596
|
|
|
61597
61597
|
function CloseChipIcon(props) {
|
|
61598
61598
|
const { width = 20, height = 20, ...rest } = props;
|
|
61599
|
-
return (jsxRuntime.jsxs("svg", { width: width, height: height, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...rest, children: [jsxRuntime.jsx("g", {
|
|
61599
|
+
return (jsxRuntime.jsxs("svg", { width: width, height: height, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...rest, children: [jsxRuntime.jsx("g", { clipPath: "url(#clip0_10200_41079)", children: jsxRuntime.jsx("path", { d: "M15 5L5 15M5 5L15 15", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round", strokeLinejoin: "round" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_10200_41079", children: jsxRuntime.jsx("rect", { width: "20", height: "20", fill: "white" }) }) })] }));
|
|
61600
61600
|
}
|
|
61601
61601
|
|
|
61602
61602
|
function TimeIcon(props) {
|
|
61603
61603
|
const { width = 16, height = 16, ...rest } = props;
|
|
61604
|
-
return (jsxRuntime.jsxs("svg", { width: width, height: height, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...rest, children: [jsxRuntime.jsx("g", {
|
|
61604
|
+
return (jsxRuntime.jsxs("svg", { width: width, height: height, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...rest, children: [jsxRuntime.jsx("g", { clipPath: "url(#clip0_10132_275)", children: jsxRuntime.jsx("path", { d: "M8.00004 4.00004V8.00004L10.6667 9.33337M14.6667 8.00004C14.6667 11.6819 11.6819 14.6667 8.00004 14.6667C4.31814 14.6667 1.33337 11.6819 1.33337 8.00004C1.33337 4.31814 4.31814 1.33337 8.00004 1.33337C11.6819 1.33337 14.6667 4.31814 14.6667 8.00004Z", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_10132_275", children: jsxRuntime.jsx("rect", { width: width, height: height, fill: "white" }) }) })] }));
|
|
61605
61605
|
}
|
|
61606
61606
|
|
|
61607
61607
|
function DateIcon(props) {
|
|
@@ -70938,24 +70938,30 @@ 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);
|
|
70945
70945
|
const containerRef = React.useRef(null);
|
|
70946
|
+
const timePickerRef = React.useRef(null);
|
|
70946
70947
|
React.useEffect(() => {
|
|
70947
70948
|
const handleClickOutside = (event) => {
|
|
70949
|
+
const target = event.target;
|
|
70948
70950
|
if (containerRef.current &&
|
|
70949
|
-
!containerRef.current.contains(
|
|
70951
|
+
!containerRef.current.contains(target) &&
|
|
70952
|
+
!document.querySelector(".ant-picker-dropdown")?.contains(target)) {
|
|
70950
70953
|
setIsOpen(false);
|
|
70951
70954
|
}
|
|
70952
70955
|
};
|
|
70953
|
-
|
|
70956
|
+
if (isOpen) {
|
|
70957
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
70958
|
+
}
|
|
70954
70959
|
return () => {
|
|
70955
70960
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
70956
70961
|
};
|
|
70957
|
-
}, []);
|
|
70962
|
+
}, [isOpen]);
|
|
70958
70963
|
const handleTimeChange = (time) => {
|
|
70964
|
+
onChange?.(time ? time.toDate() : null);
|
|
70959
70965
|
setTimeValue(time);
|
|
70960
70966
|
setInputValue(time ? time.format(format) : "");
|
|
70961
70967
|
setIsOpen(false);
|
|
@@ -70965,21 +70971,28 @@ const FISInputTime = React.forwardRef((props, ref) => {
|
|
|
70965
70971
|
setInputValue(newValue);
|
|
70966
70972
|
const parsedTime = dayjs(newValue, format, true);
|
|
70967
70973
|
if (parsedTime.isValid()) {
|
|
70974
|
+
onChange?.(parsedTime.toDate());
|
|
70968
70975
|
setTimeValue(parsedTime);
|
|
70969
70976
|
}
|
|
70970
70977
|
else {
|
|
70978
|
+
onChange?.(null);
|
|
70971
70979
|
setTimeValue(null);
|
|
70972
70980
|
}
|
|
70973
70981
|
};
|
|
70974
70982
|
const handleClickInput = () => {
|
|
70975
|
-
|
|
70983
|
+
if (!disabled) {
|
|
70984
|
+
setIsOpen(true);
|
|
70985
|
+
}
|
|
70976
70986
|
};
|
|
70977
70987
|
const handleOpenChange = (open) => {
|
|
70978
|
-
|
|
70979
|
-
|
|
70988
|
+
setIsOpen(open);
|
|
70989
|
+
};
|
|
70990
|
+
const handleKeyDown = (e) => {
|
|
70991
|
+
if (e.key === "Escape") {
|
|
70992
|
+
setIsOpen(false);
|
|
70980
70993
|
}
|
|
70981
70994
|
};
|
|
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:
|
|
70995
|
+
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, disabled: disabled, value: inputValue, onChange: handleInputChange, onFocus: handleClickInput, onClickSuffix: handleClickInput, onKeyDown: handleKeyDown }), jsxRuntime.jsx(HiddenTimePickerSC, { ref: timePickerRef, format: format, value: timeValue, onChange: handleTimeChange, open: isOpen, onOpenChange: handleOpenChange, getPopupContainer: getPopupContainer, showNow: true, inputReadOnly: true })] }), message && (jsxRuntime.jsx(DivHintWrapperSC, { children: jsxRuntime.jsx(SpanHintSC, { className: classNames({
|
|
70983
70996
|
disabled: disabled,
|
|
70984
70997
|
negative: negative,
|
|
70985
70998
|
positive: positive,
|