react-restyle-components 0.2.50 → 0.2.51
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/src/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component.d.ts.map +1 -1
- package/lib/src/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component.js +17 -18
- package/lib/src/tc.module.css +0 -1
- package/package.json +1 -1
|
@@ -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;
|
|
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;AAEhC,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,4CA6JvD,CAAC"}
|
|
@@ -3,8 +3,6 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { useState, useEffect, useRef } from 'react';
|
|
4
4
|
import { Icon } from '../../atoms/icons/icons.component';
|
|
5
5
|
import '../../../tc.module.css';
|
|
6
|
-
import s from '../../../tc.module.css';
|
|
7
|
-
import { cn } from '../../../core-utils';
|
|
8
6
|
export const AutoCompleteFilterSingleSelectMultiFieldsDisplay = ({ disable = false, loader = false, displayValue = '', placeholder = 'Search...', data, hasError = false, className, posstion = 'absolute', keyboard = 'text', onFilter, onSelect, onBlur, }) => {
|
|
9
7
|
const [value, setValue] = useState(displayValue);
|
|
10
8
|
const [options, setOptions] = useState(data.list);
|
|
@@ -57,33 +55,34 @@ export const AutoCompleteFilterSingleSelectMultiFieldsDisplay = ({ disable = fal
|
|
|
57
55
|
}
|
|
58
56
|
}
|
|
59
57
|
};
|
|
60
|
-
return (_jsx(_Fragment, { children: _jsxs("div", { ref: wrapperRef, className:
|
|
58
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { ref: wrapperRef, className: "w-full relative", children: [_jsxs("div", { className: `flex items-center leading-4 p-2 focus:outline-none focus:ring w-full shadow-sm sm:text-base border-2 ${hasError ? 'border-red' : 'border-gray-300'} rounded-md dark:text-black`, children: [_jsx("input", { placeholder: placeholder, type: keyboard, value: value, className: `${className} w-full focus:outline-none bg-none dark:text-black`, onKeyUp: onKeyUp, onChange: onChange, onClick: () => setIsListOpen(true), disabled: disable, onMouseDown: () => setValue(''), onBlur: (e) => onBlur && onBlur(e), onKeyDown: onKeyDown }), isListOpen ? (_jsx(Icon, { nameIcon: "FaChevronUp", propsIcon: {
|
|
61
59
|
color: '#000000',
|
|
62
60
|
size: 22,
|
|
63
61
|
} })) : (_jsx(Icon, { nameIcon: "FaChevronDown", propsIcon: {
|
|
64
62
|
color: '#000000',
|
|
65
63
|
size: 22,
|
|
66
64
|
} }))] }), options && isListOpen
|
|
67
|
-
? options.length > 0 && (_jsx("div", { className:
|
|
65
|
+
? options.length > 0 && (_jsx("div", { className: `mt-1 absolute w-full bg-gray-100 p-2 rounded-sm `, style: {
|
|
68
66
|
zIndex: 500,
|
|
69
|
-
}, children: _jsx("ul", { children: options?.map((item, index) => (
|
|
67
|
+
}, children: _jsx("ul", { children: options?.map((item, index) => (_jsx("li", { className: "text-gray-400 flex items-center", onClick: () => {
|
|
70
68
|
setValue(data.displayKey
|
|
71
69
|
.map((key) => `${item[key]}`)
|
|
72
70
|
.join(' - '));
|
|
73
71
|
setIsListOpen(false);
|
|
74
72
|
onSelect && onSelect(item);
|
|
75
|
-
}, children:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
73
|
+
}, children: _jsx("label", { className: "ml-2 mt-1 text-black", style: {
|
|
74
|
+
textOverflow: 'ellipsis',
|
|
75
|
+
minWidth: 0,
|
|
76
|
+
overflow: 'hidden',
|
|
77
|
+
maxWidth: '334px',
|
|
78
|
+
whiteSpace: 'nowrap',
|
|
79
|
+
}, title: data.displayKey
|
|
80
|
+
.map((key) => item[key])
|
|
81
|
+
.join(' - '), children: data.displayKey
|
|
82
|
+
.map((key) => {
|
|
83
|
+
item[key];
|
|
84
|
+
})
|
|
85
|
+
.filter((value) => value !== null && value !== undefined)
|
|
86
|
+
.join(' - ') }) }, index))) }) }))
|
|
88
87
|
: null] }) }));
|
|
89
88
|
};
|
package/lib/src/tc.module.css
CHANGED