fis-component 0.0.58 → 0.0.59
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 +3 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/src/components/Input/InputDate/index.d.ts +10 -0
- package/dist/esm/index.js +3 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/Input/InputDate/index.d.ts +10 -0
- package/dist/index.d.ts +11 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InputFieldProps } from "../InputField";
|
|
2
|
+
import dayjs from "dayjs";
|
|
2
3
|
import { InputLabelProps } from "../InputLabel";
|
|
3
4
|
export interface InputDateProps extends Omit<InputFieldProps, "value" | "onChange">, Partial<InputLabelProps> {
|
|
4
5
|
/**Date value*/
|
|
@@ -11,6 +12,15 @@ export interface InputDateProps extends Omit<InputFieldProps, "value" | "onChang
|
|
|
11
12
|
positive?: boolean;
|
|
12
13
|
/** Handle on change action */
|
|
13
14
|
onChange?: (date: Date | null) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Function that returns the HTML element to render the popup container into.
|
|
17
|
+
* Useful for controlling where the date picker dropdown is attached in the DOM.
|
|
18
|
+
*/
|
|
19
|
+
getPopupContainer?: () => HTMLElement;
|
|
20
|
+
/**The minimum selectable date. Dates before this value will be disabled.*/
|
|
21
|
+
minDate?: dayjs.Dayjs | undefined;
|
|
22
|
+
/**The maximum selectable date. Dates after this value will be disabled.*/
|
|
23
|
+
maxDate?: dayjs.Dayjs | undefined;
|
|
14
24
|
}
|
|
15
25
|
declare const FISInputDate: import("react").ForwardRefExoticComponent<InputDateProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
16
26
|
export default FISInputDate;
|
package/dist/esm/index.js
CHANGED
|
@@ -62950,6 +62950,7 @@ const FISTab = ({ children, active: propActive, defaultActive, size = "md", clas
|
|
|
62950
62950
|
return (jsxs(DivTabItemSC, { ref: (el) => (tabRefs.current[value] = el), "$isActive": activeKey === value, "$disabled": disabled, "$size": size, className: itemClassName, "$fullWidth": fullWidth, onClick: () => handleTabClick(value, disabled), children: [startIcon, title && jsx(SpanContentSC$1, { children: title }), endIcon] }, value));
|
|
62951
62951
|
}), jsx(DivActiveIndicatorSC, { style: indicatorStyle })] }), activeContent && jsx("div", { className: contentClassName, children: activeContent })] }));
|
|
62952
62952
|
};
|
|
62953
|
+
FISTab.displayName = "FISTab";
|
|
62953
62954
|
|
|
62954
62955
|
const DivSegmentedContainerSC = styled.div `
|
|
62955
62956
|
width: 100%;
|
|
@@ -71000,7 +71001,7 @@ function mergeRefs(...refs) {
|
|
|
71000
71001
|
}
|
|
71001
71002
|
|
|
71002
71003
|
const FISInputDate = forwardRef((props, ref) => {
|
|
71003
|
-
const { value, textLabel = "", iconLabel, required, message = "", disabled, negative, positive, format = "DD/MM/YYYY", onClickIconLabel, onChange, ...restProps } = props;
|
|
71004
|
+
const { value, textLabel = "", iconLabel, required, message = "", disabled, negative, positive, format = "DD/MM/YYYY", onClickIconLabel, onChange, getPopupContainer, minDate, maxDate, ...restProps } = props;
|
|
71004
71005
|
const [open, setOpen] = useState(false);
|
|
71005
71006
|
const [inputValue, setInputValue] = useState(value ? dayjs(value).format(format) : "");
|
|
71006
71007
|
const [dateValue, setDateValue] = useState(value ? dayjs(value) : null);
|
|
@@ -71043,7 +71044,7 @@ const FISInputDate = forwardRef((props, ref) => {
|
|
|
71043
71044
|
onChange?.(null);
|
|
71044
71045
|
}
|
|
71045
71046
|
};
|
|
71046
|
-
return (jsxs(DivWrapperSC$2, { children: [(textLabel || iconLabel) && (jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxs(DivInputWrapperSC$1, { children: [jsx(FISInputField, { ...restProps, ref: mergeRef, typeSuffix: "icon", iconSuffix: jsx(DateIcon, {}), value: inputValue, negative: negative, disabled: disabled, onFocus: () => setOpen(true), onChange: handleInputChange, onClickSuffix: () => setOpen(true) }), jsx(HiddenDatePickerSC, { open: open, value: dateValue, onChange: (value) => handleChange(value), onOpenChange: handleOpenChange, format: format })] }), message && (jsx(DivHintWrapperSC$1, { children: jsx(SpanHintSC$3, { className: classNames({
|
|
71047
|
+
return (jsxs(DivWrapperSC$2, { children: [(textLabel || iconLabel) && (jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxs(DivInputWrapperSC$1, { children: [jsx(FISInputField, { ...restProps, ref: mergeRef, typeSuffix: "icon", iconSuffix: jsx(DateIcon, {}), value: inputValue, negative: negative, disabled: disabled, onFocus: () => setOpen(true), onChange: handleInputChange, onClickSuffix: () => setOpen(true) }), jsx(HiddenDatePickerSC, { open: open, value: dateValue, onChange: (value) => handleChange(value), onOpenChange: handleOpenChange, format: format, getPopupContainer: getPopupContainer, minDate: minDate, maxDate: maxDate })] }), message && (jsx(DivHintWrapperSC$1, { children: jsx(SpanHintSC$3, { className: classNames({
|
|
71047
71048
|
disabled,
|
|
71048
71049
|
negative,
|
|
71049
71050
|
positive,
|