fis-component 0.0.70 → 0.0.71
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 +26 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/src/components/Input/InputDate/index.d.ts +1 -0
- package/dist/cjs/types/src/components/Select/styles.d.ts +3 -1
- package/dist/cjs/types/src/components/SelectItem/styles.d.ts +1 -0
- package/dist/esm/index.js +26 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/Input/InputDate/index.d.ts +1 -0
- package/dist/esm/types/src/components/Select/styles.d.ts +3 -1
- package/dist/esm/types/src/components/SelectItem/styles.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -71043,7 +71043,7 @@ function mergeRefs(...refs) {
|
|
|
71043
71043
|
}
|
|
71044
71044
|
|
|
71045
71045
|
const FISInputDate = React.forwardRef((props, ref) => {
|
|
71046
|
-
const { value, textLabel = "", iconLabel, required, message = "", disabled, negative, positive, format = "DD/MM/YYYY", onClickIconLabel, onChange, getPopupContainer, minDate, maxDate, ...restProps } = props;
|
|
71046
|
+
const { className, value, textLabel = "", iconLabel, required, message = "", disabled, negative, positive, format = "DD/MM/YYYY", onClickIconLabel, onChange, getPopupContainer, minDate, maxDate, ...restProps } = props;
|
|
71047
71047
|
const [open, setOpen] = React.useState(false);
|
|
71048
71048
|
const [inputValue, setInputValue] = React.useState(value ? dayjs(value).format(format) : "");
|
|
71049
71049
|
const [dateValue, setDateValue] = React.useState(value ? dayjs(value) : null);
|
|
@@ -71086,7 +71086,7 @@ const FISInputDate = React.forwardRef((props, ref) => {
|
|
|
71086
71086
|
onChange?.(null);
|
|
71087
71087
|
}
|
|
71088
71088
|
};
|
|
71089
|
-
return (jsxRuntime.jsxs(DivWrapperSC$2, { children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsxs(DivInputWrapperSC$1, { children: [jsxRuntime.jsx(FISInputField, { ...restProps, ref: mergeRef, typeSuffix: "icon", iconSuffix: jsxRuntime.jsx(DateIcon, {}), value: inputValue, negative: negative, disabled: disabled, onFocus: () => setOpen(true), onChange: handleInputChange, onClickSuffix: () => setOpen(true) }), jsxRuntime.jsx(HiddenDatePickerSC, { open: open, value: dateValue, onChange: (value) => handleChange(value), onOpenChange: handleOpenChange, format: format, getPopupContainer: getPopupContainer, minDate: minDate, maxDate: maxDate })] }), message && (jsxRuntime.jsx(DivHintWrapperSC$1, { children: jsxRuntime.jsx(SpanHintSC$3, { className: classNames({
|
|
71089
|
+
return (jsxRuntime.jsxs(DivWrapperSC$2, { className: className, children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsxs(DivInputWrapperSC$1, { children: [jsxRuntime.jsx(FISInputField, { ...restProps, ref: mergeRef, typeSuffix: "icon", iconSuffix: jsxRuntime.jsx(DateIcon, {}), value: inputValue, negative: negative, disabled: disabled, onFocus: () => setOpen(true), onChange: handleInputChange, onClickSuffix: () => setOpen(true) }), jsxRuntime.jsx(HiddenDatePickerSC, { open: open, value: dateValue, onChange: (value) => handleChange(value), onOpenChange: handleOpenChange, format: format, getPopupContainer: getPopupContainer, minDate: minDate, maxDate: maxDate })] }), message && (jsxRuntime.jsx(DivHintWrapperSC$1, { children: jsxRuntime.jsx(SpanHintSC$3, { className: classNames({
|
|
71090
71090
|
disabled,
|
|
71091
71091
|
negative,
|
|
71092
71092
|
positive,
|
|
@@ -73086,10 +73086,27 @@ const DivWrapperSC$1 = styled.div `
|
|
|
73086
73086
|
flex-direction: column;
|
|
73087
73087
|
gap: ${getTheme("com/input/vertical-gap")};
|
|
73088
73088
|
`;
|
|
73089
|
+
const preventSelection = styled.css `
|
|
73090
|
+
user-select: none !important;
|
|
73091
|
+
-webkit-user-select: none !important;
|
|
73092
|
+
-moz-user-select: none !important;
|
|
73093
|
+
-ms-user-select: none !important;
|
|
73094
|
+
cursor: pointer !important;
|
|
73095
|
+
`;
|
|
73089
73096
|
const DivInputWrapperSC = styled.div `
|
|
73090
73097
|
position: relative;
|
|
73091
73098
|
display: inline-block;
|
|
73092
73099
|
width: 100%;
|
|
73100
|
+
|
|
73101
|
+
${(props) => props.$hasValue &&
|
|
73102
|
+
styled.css `
|
|
73103
|
+
${preventSelection}
|
|
73104
|
+
|
|
73105
|
+
input {
|
|
73106
|
+
${preventSelection}
|
|
73107
|
+
pointer-events: none;
|
|
73108
|
+
}
|
|
73109
|
+
`}
|
|
73093
73110
|
`;
|
|
73094
73111
|
const DivDropdownMenuSC = styled.div `
|
|
73095
73112
|
/* margin-top: ${getTheme("com/select/vertical-gap")}; */
|
|
@@ -73219,7 +73236,7 @@ const DivIconSuffixSC = styled.div `
|
|
|
73219
73236
|
flex-shrink: 0;
|
|
73220
73237
|
align-items: center;
|
|
73221
73238
|
justify-content: center;
|
|
73222
|
-
cursor: pointer;
|
|
73239
|
+
cursor: ${(props) => (props.$disabled ? "not-allowed" : "pointer")};
|
|
73223
73240
|
color: ${getTheme("com/select/field/right-icon/color-icon")};
|
|
73224
73241
|
|
|
73225
73242
|
${(props) => {
|
|
@@ -73362,7 +73379,7 @@ const FISSelectItem = React.forwardRef((props, ref) => {
|
|
|
73362
73379
|
return (jsxRuntime.jsx(DivContainerSC, { className: classNames({
|
|
73363
73380
|
iconPrefix: iconPrefix,
|
|
73364
73381
|
negative: negative,
|
|
73365
|
-
}), "$size": size, children: jsxRuntime.jsxs(DivWrapperSC, { children: [iconPrefix && (jsxRuntime.jsx(DivIconPrefixSC, { "$size": size, children: iconPrefix })), jsxRuntime.jsx(InputSC, { ...rest, ref: ref, disabled: disabled, "$size": size }), iconSuffix && (jsxRuntime.jsx(DivIconSuffixSC, { "$size": size, children: iconSuffix }))] }) }));
|
|
73382
|
+
}), "$size": size, children: jsxRuntime.jsxs(DivWrapperSC, { children: [iconPrefix && (jsxRuntime.jsx(DivIconPrefixSC, { "$size": size, children: iconPrefix })), jsxRuntime.jsx(InputSC, { ...rest, ref: ref, disabled: disabled, "$size": size }), iconSuffix && (jsxRuntime.jsx(DivIconSuffixSC, { "$size": size, "$disabled": disabled, children: iconSuffix }))] }) }));
|
|
73366
73383
|
});
|
|
73367
73384
|
FISSelectItem.displayName = "FISSelectItem";
|
|
73368
73385
|
|
|
@@ -73455,8 +73472,10 @@ const FISSelect = React.forwardRef(({ className, style, size = "md", options, va
|
|
|
73455
73472
|
onChange(values);
|
|
73456
73473
|
}
|
|
73457
73474
|
else {
|
|
73458
|
-
|
|
73459
|
-
|
|
73475
|
+
if (values.length > 0) {
|
|
73476
|
+
onChange(values[0]);
|
|
73477
|
+
setIsOpen(false);
|
|
73478
|
+
}
|
|
73460
73479
|
}
|
|
73461
73480
|
}, [multi, onChange]);
|
|
73462
73481
|
const handleMenuClick = React.useCallback(() => {
|
|
@@ -73505,7 +73524,7 @@ const FISSelect = React.forwardRef(({ className, style, size = "md", options, va
|
|
|
73505
73524
|
document.addEventListener("mousedown", handleClickOutside);
|
|
73506
73525
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
73507
73526
|
}, [referenceElement, popperElement]);
|
|
73508
|
-
return (jsxRuntime.jsxs(DivWrapperSC$1, { className: className, style: style, children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsx(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, children: jsxRuntime.jsx(FISSelectItem, { ...restProps, ref: ref, size: size, iconSuffix: isOpen ? jsxRuntime.jsx(ArrowUpIcon, {}) : jsxRuntime.jsx(ArrowDownIcon, {}), value: computedDisplayValue(), disabled: disabled, activeDropdown: isOpen, negative: negative }) }), message && (jsxRuntime.jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsxRuntime.jsx(SelectedTagsWrapper, { children: jsxRuntime.jsx(MultipleValue, { options: selectedItems, onRemove: handleOptionRemove }) })), isOpen && (jsxRuntime.jsx(Portal, { portal: portal, children: jsxRuntime.jsx(DivDropdownMenuSC, { ref: setPopperElement, style: {
|
|
73527
|
+
return (jsxRuntime.jsxs(DivWrapperSC$1, { className: className, style: style, children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsx(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, "$hasValue": !!value, children: jsxRuntime.jsx(FISSelectItem, { ...restProps, ref: ref, size: size, iconSuffix: isOpen ? jsxRuntime.jsx(ArrowUpIcon, {}) : jsxRuntime.jsx(ArrowDownIcon, {}), value: computedDisplayValue(), disabled: disabled, activeDropdown: isOpen, negative: negative }) }), message && (jsxRuntime.jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsxRuntime.jsx(SelectedTagsWrapper, { children: jsxRuntime.jsx(MultipleValue, { options: selectedItems, onRemove: handleOptionRemove }) })), isOpen && (jsxRuntime.jsx(Portal, { portal: portal, children: jsxRuntime.jsx(DivDropdownMenuSC, { ref: setPopperElement, style: {
|
|
73509
73528
|
...styles.popper,
|
|
73510
73529
|
width: referenceElement?.offsetWidth,
|
|
73511
73530
|
zIndex: 9999,
|