@majoo-ui/react 1.61.16-rc.3 → 1.61.16-rc.5
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.
|
@@ -33,6 +33,7 @@ export interface InputResourceListProps {
|
|
|
33
33
|
renderSelectAll?: JSX.Element;
|
|
34
34
|
customHeader?: JSX.Element;
|
|
35
35
|
expandable?: boolean;
|
|
36
|
+
searchable?: boolean;
|
|
36
37
|
}
|
|
37
|
-
declare function InputResourceList({ data: dataProp, disabled, onChange, searchPlaceholder, counterFooter, counterFooterText, isLoading, disabledItems, emptyDataMessage, value, fetchData, onQueryChange, css, wrapperCss, defaultSort, title, hideSelectAll, customHeader, expandable,
|
|
38
|
+
declare function InputResourceList({ data: dataProp, disabled, onChange, searchPlaceholder, counterFooter, counterFooterText, isLoading, disabledItems, emptyDataMessage, value, fetchData, onQueryChange, css, wrapperCss, defaultSort, title, hideSelectAll, renderSelectAll, customHeader, expandable, searchable, }: InputResourceListProps): JSX.Element;
|
|
38
39
|
export default InputResourceList;
|
package/index.esm.js
CHANGED
|
@@ -15865,9 +15865,10 @@ function InputResourceList({
|
|
|
15865
15865
|
defaultSort,
|
|
15866
15866
|
title,
|
|
15867
15867
|
hideSelectAll,
|
|
15868
|
+
renderSelectAll,
|
|
15868
15869
|
customHeader,
|
|
15869
15870
|
expandable,
|
|
15870
|
-
|
|
15871
|
+
searchable
|
|
15871
15872
|
}) {
|
|
15872
15873
|
const {
|
|
15873
15874
|
t
|
|
@@ -15906,7 +15907,7 @@ function InputResourceList({
|
|
|
15906
15907
|
}, [defaultSort]);
|
|
15907
15908
|
const availableData = useMemo(() => {
|
|
15908
15909
|
if (!data) return [];
|
|
15909
|
-
const filteredData = data.filter(item => item.label.toLowerCase().match((query === null || query === void 0 ? void 0 : query.toLowerCase()) || ''));
|
|
15910
|
+
const filteredData = data.filter(item => !!onQueryChange || item.label.toLowerCase().match((query === null || query === void 0 ? void 0 : query.toLowerCase()) || ''));
|
|
15910
15911
|
const checkedValues = new Set(checkedItems.map(item => item.value));
|
|
15911
15912
|
return [...filteredData].sort((a, b) => {
|
|
15912
15913
|
const aIsChecked = checkedValues.has(a.value);
|
|
@@ -16067,7 +16068,7 @@ function InputResourceList({
|
|
|
16067
16068
|
position: 'relative'
|
|
16068
16069
|
}, css)
|
|
16069
16070
|
}, {
|
|
16070
|
-
children: [customHeader, onQueryChange && jsx(InputSearchbox, Object.assign({
|
|
16071
|
+
children: [customHeader, (searchable || !!onQueryChange) && jsx(InputSearchbox, Object.assign({
|
|
16071
16072
|
size: "lg",
|
|
16072
16073
|
placeholder: searchPlaceholder || t('placeholder.search', 'Cari ...'),
|
|
16073
16074
|
onChange: debounce(query => {
|
|
@@ -16108,7 +16109,7 @@ function InputResourceList({
|
|
|
16108
16109
|
css: Object.assign({
|
|
16109
16110
|
position: 'absolute',
|
|
16110
16111
|
inset: 0,
|
|
16111
|
-
top: onQueryChange ? 48 : 0,
|
|
16112
|
+
top: onQueryChange || searchable ? 48 : 0,
|
|
16112
16113
|
width: '100%',
|
|
16113
16114
|
height: 285,
|
|
16114
16115
|
backgroundColor: '$bgWhite',
|