fis-component 0.0.69 → 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.
@@ -2,6 +2,7 @@ import { InputFieldProps } from "../InputField";
2
2
  import dayjs from "dayjs";
3
3
  import { InputLabelProps } from "../InputLabel";
4
4
  export interface InputDateProps extends Omit<InputFieldProps, "value" | "onChange">, Partial<InputLabelProps> {
5
+ className?: string | undefined;
5
6
  /**Date value*/
6
7
  value?: Date | null;
7
8
  /**Format Date*/
@@ -1,4 +1,6 @@
1
1
  export declare const DivWrapperSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
- export declare const DivInputWrapperSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
+ export declare const DivInputWrapperSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
3
+ $hasValue?: boolean;
4
+ }>> & string;
3
5
  export declare const DivDropdownMenuSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
4
6
  export declare const SelectedTagsWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -1,6 +1,7 @@
1
1
  import { SelectSize } from ".";
2
2
  interface SelectItemProps {
3
3
  $size?: SelectSize;
4
+ $disabled?: boolean;
4
5
  }
5
6
  export declare const InputSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, SelectItemProps>> & string;
6
7
  export declare const DivWrapperSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, SelectItemProps>> & string;
package/dist/esm/index.js CHANGED
@@ -64817,7 +64817,7 @@ const FISInputText = forwardRef((props, ref) => {
64817
64817
  }
64818
64818
  }
64819
64819
  }, [onEnter]);
64820
- return (jsxs(DivContainerSC$6, { className: className, children: [(textLabel || iconLabel) && (jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsx(FISInputField, { ...rest, ref: ref, typeSuffix: typeSuffix, sizeInput: sizeInput, iconPrefix: iconPrefix, onKeyPress: handleKeyPress, onChange: handleChange, disabled: disabled, negative: negative, onClickSuffix: onClickSuffix }), (message || showCount) && (jsxs(DivHintWrapperSC$1, { children: [jsx(SpanHintSC$3, { className: classNames({
64820
+ return (jsxs(DivContainerSC$6, { className: className, children: [(textLabel || iconLabel) && (jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsx(FISInputField, { ...rest, ref: ref, typeSuffix: typeSuffix, sizeInput: sizeInput, iconPrefix: iconPrefix, onKeyPress: handleKeyPress, onChange: handleChange, disabled: disabled, negative: negative, maxLength: maxLength, onClickSuffix: onClickSuffix }), (message || showCount) && (jsxs(DivHintWrapperSC$1, { children: [jsx(SpanHintSC$3, { className: classNames({
64821
64821
  disabled: disabled,
64822
64822
  negative: negative,
64823
64823
  positive: positive,
@@ -71023,7 +71023,7 @@ function mergeRefs(...refs) {
71023
71023
  }
71024
71024
 
71025
71025
  const FISInputDate = forwardRef((props, ref) => {
71026
- const { value, textLabel = "", iconLabel, required, message = "", disabled, negative, positive, format = "DD/MM/YYYY", onClickIconLabel, onChange, getPopupContainer, minDate, maxDate, ...restProps } = props;
71026
+ const { className, value, textLabel = "", iconLabel, required, message = "", disabled, negative, positive, format = "DD/MM/YYYY", onClickIconLabel, onChange, getPopupContainer, minDate, maxDate, ...restProps } = props;
71027
71027
  const [open, setOpen] = useState(false);
71028
71028
  const [inputValue, setInputValue] = useState(value ? dayjs(value).format(format) : "");
71029
71029
  const [dateValue, setDateValue] = useState(value ? dayjs(value) : null);
@@ -71066,7 +71066,7 @@ const FISInputDate = forwardRef((props, ref) => {
71066
71066
  onChange?.(null);
71067
71067
  }
71068
71068
  };
71069
- 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({
71069
+ return (jsxs(DivWrapperSC$2, { className: className, 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({
71070
71070
  disabled,
71071
71071
  negative,
71072
71072
  positive,
@@ -73066,10 +73066,27 @@ const DivWrapperSC$1 = styled.div `
73066
73066
  flex-direction: column;
73067
73067
  gap: ${getTheme("com/input/vertical-gap")};
73068
73068
  `;
73069
+ const preventSelection = css `
73070
+ user-select: none !important;
73071
+ -webkit-user-select: none !important;
73072
+ -moz-user-select: none !important;
73073
+ -ms-user-select: none !important;
73074
+ cursor: pointer !important;
73075
+ `;
73069
73076
  const DivInputWrapperSC = styled.div `
73070
73077
  position: relative;
73071
73078
  display: inline-block;
73072
73079
  width: 100%;
73080
+
73081
+ ${(props) => props.$hasValue &&
73082
+ css `
73083
+ ${preventSelection}
73084
+
73085
+ input {
73086
+ ${preventSelection}
73087
+ pointer-events: none;
73088
+ }
73089
+ `}
73073
73090
  `;
73074
73091
  const DivDropdownMenuSC = styled.div `
73075
73092
  /* margin-top: ${getTheme("com/select/vertical-gap")}; */
@@ -73199,7 +73216,7 @@ const DivIconSuffixSC = styled.div `
73199
73216
  flex-shrink: 0;
73200
73217
  align-items: center;
73201
73218
  justify-content: center;
73202
- cursor: pointer;
73219
+ cursor: ${(props) => (props.$disabled ? "not-allowed" : "pointer")};
73203
73220
  color: ${getTheme("com/select/field/right-icon/color-icon")};
73204
73221
 
73205
73222
  ${(props) => {
@@ -73342,7 +73359,7 @@ const FISSelectItem = forwardRef((props, ref) => {
73342
73359
  return (jsx(DivContainerSC, { className: classNames({
73343
73360
  iconPrefix: iconPrefix,
73344
73361
  negative: negative,
73345
- }), "$size": size, children: jsxs(DivWrapperSC, { children: [iconPrefix && (jsx(DivIconPrefixSC, { "$size": size, children: iconPrefix })), jsx(InputSC, { ...rest, ref: ref, disabled: disabled, "$size": size }), iconSuffix && (jsx(DivIconSuffixSC, { "$size": size, children: iconSuffix }))] }) }));
73362
+ }), "$size": size, children: jsxs(DivWrapperSC, { children: [iconPrefix && (jsx(DivIconPrefixSC, { "$size": size, children: iconPrefix })), jsx(InputSC, { ...rest, ref: ref, disabled: disabled, "$size": size }), iconSuffix && (jsx(DivIconSuffixSC, { "$size": size, "$disabled": disabled, children: iconSuffix }))] }) }));
73346
73363
  });
73347
73364
  FISSelectItem.displayName = "FISSelectItem";
73348
73365
 
@@ -73435,8 +73452,10 @@ const FISSelect = forwardRef(({ className, style, size = "md", options, value, d
73435
73452
  onChange(values);
73436
73453
  }
73437
73454
  else {
73438
- onChange(values[0]);
73439
- setIsOpen(false);
73455
+ if (values.length > 0) {
73456
+ onChange(values[0]);
73457
+ setIsOpen(false);
73458
+ }
73440
73459
  }
73441
73460
  }, [multi, onChange]);
73442
73461
  const handleMenuClick = useCallback(() => {
@@ -73485,7 +73504,7 @@ const FISSelect = forwardRef(({ className, style, size = "md", options, value, d
73485
73504
  document.addEventListener("mousedown", handleClickOutside);
73486
73505
  return () => document.removeEventListener("mousedown", handleClickOutside);
73487
73506
  }, [referenceElement, popperElement]);
73488
- return (jsxs(DivWrapperSC$1, { className: className, style: style, children: [(textLabel || iconLabel) && (jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsx(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, children: jsx(FISSelectItem, { ...restProps, ref: ref, size: size, iconSuffix: isOpen ? jsx(ArrowUpIcon, {}) : jsx(ArrowDownIcon, {}), value: computedDisplayValue(), disabled: disabled, activeDropdown: isOpen, negative: negative }) }), message && (jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsx(SelectedTagsWrapper, { children: jsx(MultipleValue, { options: selectedItems, onRemove: handleOptionRemove }) })), isOpen && (jsx(Portal, { portal: portal, children: jsx(DivDropdownMenuSC, { ref: setPopperElement, style: {
73507
+ return (jsxs(DivWrapperSC$1, { className: className, style: style, children: [(textLabel || iconLabel) && (jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsx(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, "$hasValue": !!value, children: jsx(FISSelectItem, { ...restProps, ref: ref, size: size, iconSuffix: isOpen ? jsx(ArrowUpIcon, {}) : jsx(ArrowDownIcon, {}), value: computedDisplayValue(), disabled: disabled, activeDropdown: isOpen, negative: negative }) }), message && (jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsx(SelectedTagsWrapper, { children: jsx(MultipleValue, { options: selectedItems, onRemove: handleOptionRemove }) })), isOpen && (jsx(Portal, { portal: portal, children: jsx(DivDropdownMenuSC, { ref: setPopperElement, style: {
73489
73508
  ...styles.popper,
73490
73509
  width: referenceElement?.offsetWidth,
73491
73510
  zIndex: 9999,