react-restyle-components 0.2.56 → 0.2.57

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/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-restyle-components",
3
- "version": "0.2.55",
3
+ "version": "0.2.56",
4
4
  "private": false,
5
5
  "description": "Easy use restyle components",
6
6
  "author": {
@@ -1 +1 @@
1
- {"version":3,"file":"auto-complete-filter-single-select-multiple-fields-display.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component.tsx"],"names":[],"mappings":"AAIA,OAAO,wBAAwB,CAAC;AAIhC,UAAU,qDAAqD;IAC7D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,GAAG,CAAC;IACV,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;IAC9B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;CAC7B;AAED,eAAO,MAAM,gDAAgD,+HAa1D,qDAAqD,4CA+LvD,CAAC"}
1
+ {"version":3,"file":"auto-complete-filter-single-select-multiple-fields-display.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component.tsx"],"names":[],"mappings":"AAIA,OAAO,wBAAwB,CAAC;AAIhC,UAAU,qDAAqD;IAC7D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,GAAG,CAAC;IACV,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;IAC9B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;CAC7B;AAED,eAAO,MAAM,gDAAgD,+HAa1D,qDAAqD,4CAyMvD,CAAC"}
@@ -24,6 +24,7 @@ export const AutoCompleteFilterSingleSelectMultiFieldsDisplay = ({ disable = fal
24
24
  };
25
25
  }, [ref, isListOpen]);
26
26
  };
27
+ const inputRef = useRef(null);
27
28
  const wrapperRef = useRef(null);
28
29
  useOutsideAlerter(wrapperRef);
29
30
  useEffect(() => {
@@ -59,20 +60,29 @@ export const AutoCompleteFilterSingleSelectMultiFieldsDisplay = ({ disable = fal
59
60
  }
60
61
  }
61
62
  };
63
+ const calculateMaxHeight = () => {
64
+ if (inputRef.current) {
65
+ const inputRect = inputRef.current.getBoundingClientRect();
66
+ const availableHeight = window.innerHeight - inputRect.bottom - 10; // 10px padding
67
+ return availableHeight;
68
+ }
69
+ return 'calc(100vh - 100px)';
70
+ };
62
71
  return (_jsx(_Fragment, { children: _jsxs("div", { ref: wrapperRef, className: "w-full relative", children: [_jsxs("div", { className: cn(s['flex'], s['p-2'], s['leading-4'], s['focus:outline-none'], s['focus:ring'], s['w-full'], s['shadow-sm'], s['sm:text-base'], s['border'], {
63
72
  [s['border-red']]: hasError,
64
73
  [s['border-gray-300']]: !hasError,
65
74
  [s['dark:text-black']]: true,
66
- }), children: [_jsx("input", { placeholder: placeholder, type: keyboard, value: value, className: cn(s['w-full'], s['focus:outline-none'], s['bg-none'], s['dark:text-black'], className), onKeyUp: onKeyUp, onChange: onChange, onClick: () => setIsListOpen(true), disabled: disable, onMouseDown: () => setValue(''), onBlur: (e) => onBlur && onBlur(e), onKeyDown: onKeyDown }), isListOpen ? (_jsx(Icon, { nameIcon: "FaChevronUp", propsIcon: {
75
+ }), children: [_jsx("input", { ref: inputRef, placeholder: placeholder, type: keyboard, value: value, className: cn(s['w-full'], s['focus:outline-none'], s['bg-none'], s['dark:text-black'], className), onKeyUp: onKeyUp, onChange: onChange, onClick: () => setIsListOpen(true), disabled: disable, onMouseDown: () => setValue(''), onBlur: (e) => onBlur && onBlur(e), onKeyDown: onKeyDown }), isListOpen ? (_jsx(Icon, { nameIcon: "FaChevronUp", propsIcon: {
67
76
  color: '#000000',
68
77
  size: 22,
69
78
  } })) : (_jsx(Icon, { nameIcon: "FaChevronDown", propsIcon: {
70
79
  color: '#000000',
71
80
  size: 22,
72
81
  } }))] }), options && isListOpen
73
- ? options.length > 0 && (_jsx("div", { className: cn(s['mt-1'], s['absolute'], s['w-full'], s['bg-gray-100'], s['p-2'], s['rounded-sm']), style: {
82
+ ? options.length > 0 && (_jsx("div", { className: cn(s['absolute'], s['w-full'], s['bg-gray-100'], s['p-2'], s['rounded-sm'], s['overflow-y-auto']), style: {
74
83
  zIndex: 500,
75
- }, children: _jsx("ul", { children: options?.map((item, index) => (_jsx("li", { className: cn(s['text-gray-400'], s['flex'], s['items-center']), onClick: () => {
84
+ maxHeight: `${calculateMaxHeight()}px`,
85
+ }, children: _jsx("ul", { className: "flex", children: options?.map((item, index) => (_jsx("li", { className: cn(s['text-gray-400'], s['flex'], s['items-center']), onClick: () => {
76
86
  setValue(data.displayKey
77
87
  .map((key) => `${item[key]}`)
78
88
  .join(' - '));
@@ -82,7 +92,6 @@ export const AutoCompleteFilterSingleSelectMultiFieldsDisplay = ({ disable = fal
82
92
  textOverflow: 'ellipsis',
83
93
  minWidth: 0,
84
94
  overflow: 'hidden',
85
- maxWidth: '334px',
86
95
  whiteSpace: 'nowrap',
87
96
  }, title: data.displayKey
88
97
  .map((key) => item[key])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-restyle-components",
3
- "version": "0.2.56",
3
+ "version": "0.2.57",
4
4
  "private": false,
5
5
  "description": "Easy use restyle components",
6
6
  "author": {