@bitrise/bitkit 13.199.0 → 13.201.0
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/package.json
CHANGED
|
@@ -35,6 +35,7 @@ const FilterForm = (props: FilterFormProps) => {
|
|
|
35
35
|
iconsMap,
|
|
36
36
|
hasNotFilteredOption = true,
|
|
37
37
|
preserveOptionOrder,
|
|
38
|
+
isInitialLoading,
|
|
38
39
|
isMultiple,
|
|
39
40
|
onAsyncSearch,
|
|
40
41
|
options,
|
|
@@ -47,7 +48,7 @@ const FilterForm = (props: FilterFormProps) => {
|
|
|
47
48
|
const [searchValue, setSearchValue] = useState<string>('');
|
|
48
49
|
const debouncedSearchValue = useDebounce<string>(searchValue, 1000);
|
|
49
50
|
|
|
50
|
-
const [isLoading, setLoading] = useState(
|
|
51
|
+
const [isLoading, setLoading] = useState(Boolean(isInitialLoading));
|
|
51
52
|
const [foundOptions, setFoundOptions] = useState<FilterOptions>([]);
|
|
52
53
|
|
|
53
54
|
const isAsync = !!onAsyncSearch;
|
|
@@ -63,7 +64,7 @@ const FilterForm = (props: FilterFormProps) => {
|
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
66
|
return [];
|
|
66
|
-
}, [searchValue]);
|
|
67
|
+
}, [searchValue, options]);
|
|
67
68
|
|
|
68
69
|
const onSearchChange = (q: string) => {
|
|
69
70
|
setSearchValue(q);
|
|
@@ -107,11 +108,15 @@ const FilterForm = (props: FilterFormProps) => {
|
|
|
107
108
|
}
|
|
108
109
|
};
|
|
109
110
|
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
setLoading(Boolean(isInitialLoading));
|
|
113
|
+
}, [isInitialLoading]);
|
|
114
|
+
|
|
110
115
|
useEffect(() => {
|
|
111
116
|
if (debouncedSearchValue.length > 0) {
|
|
112
117
|
getAsyncList();
|
|
113
118
|
} else {
|
|
114
|
-
setLoading(
|
|
119
|
+
setLoading(Boolean(isInitialLoading));
|
|
115
120
|
}
|
|
116
121
|
}, [debouncedSearchValue]);
|
|
117
122
|
|
|
@@ -137,6 +142,7 @@ const FilterForm = (props: FilterFormProps) => {
|
|
|
137
142
|
</Box>
|
|
138
143
|
{(withSearch || isAsync) && (
|
|
139
144
|
<SearchInput
|
|
145
|
+
isDisabled={isInitialLoading}
|
|
140
146
|
onChange={onSearchChange}
|
|
141
147
|
placeholder={isAsync ? 'Start typing to search options' : 'Start typing to find options'}
|
|
142
148
|
sx={filterStyle.formSearch}
|
|
@@ -7,12 +7,14 @@ import MenuList, { MenuListProps } from '../Menu/MenuList';
|
|
|
7
7
|
|
|
8
8
|
export interface OverflowMenuProps extends MenuProps {
|
|
9
9
|
children: MenuListProps['children'];
|
|
10
|
+
buttonProps?: ControlButtonProps;
|
|
10
11
|
buttonSize?: ControlButtonProps['size'];
|
|
11
12
|
triggerLabel?: string;
|
|
12
13
|
withPortal?: boolean;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
const OverflowMenu = ({
|
|
17
|
+
buttonProps,
|
|
16
18
|
buttonSize = 'sm',
|
|
17
19
|
children,
|
|
18
20
|
triggerLabel = 'Open menu',
|
|
@@ -29,6 +31,7 @@ const OverflowMenu = ({
|
|
|
29
31
|
iconName="MoreVertical"
|
|
30
32
|
isTooltipDisabled
|
|
31
33
|
size={buttonSize}
|
|
34
|
+
{...buttonProps}
|
|
32
35
|
/>
|
|
33
36
|
<Wrapper>
|
|
34
37
|
<MenuList>{children}</MenuList>
|