@bitrise/bitkit 13.194.0 → 13.196.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
|
@@ -12,29 +12,30 @@ export const FILTER_STORY_DATA: FilterData = {
|
|
|
12
12
|
categoryName: 'App',
|
|
13
13
|
iconsMap: {
|
|
14
14
|
'0a248b278e135ea7': 'Other',
|
|
15
|
-
'29d62a794c77ad99': 'AppleFill',
|
|
16
15
|
'32b14416be4b7b24': 'Android',
|
|
17
16
|
'46b6b9a78a418ee8': 'AppleFill',
|
|
18
|
-
'
|
|
17
|
+
'29d62a794c77ad99': 'AppleFill',
|
|
19
18
|
fcb0a0f49138e0a0: 'Other',
|
|
19
|
+
'792fda8fed0308a6': 'Android',
|
|
20
20
|
},
|
|
21
21
|
options: [
|
|
22
22
|
'0a248b278e135ea7',
|
|
23
23
|
'32b14416be4b7b24',
|
|
24
|
-
'
|
|
24
|
+
'46b6b9a78a418ee8',
|
|
25
25
|
'29d62a794c77ad99',
|
|
26
26
|
'fcb0a0f49138e0a0',
|
|
27
27
|
'792fda8fed0308a6',
|
|
28
28
|
],
|
|
29
29
|
optionsMap: {
|
|
30
30
|
'0a248b278e135ea7': 'pipeline-service',
|
|
31
|
-
'29d62a794c77ad99': 'build-log-service',
|
|
32
31
|
'32b14416be4b7b24': 'bitkit',
|
|
33
32
|
'46b6b9a78a418ee8': 'bitrise-website',
|
|
34
|
-
'
|
|
33
|
+
'29d62a794c77ad99': 'build-log-service',
|
|
35
34
|
fcb0a0f49138e0a0: 'bitrise-insights-cf',
|
|
35
|
+
'792fda8fed0308a6': 'website-docker-base-env #docker',
|
|
36
36
|
},
|
|
37
37
|
hasNotFilteredOption: false,
|
|
38
|
+
preserveOptionOrder: true,
|
|
38
39
|
type: 'select',
|
|
39
40
|
},
|
|
40
41
|
branch: {
|
|
@@ -21,6 +21,7 @@ export type FilterCategoryProps = {
|
|
|
21
21
|
dependsOn?: Record<string, string>;
|
|
22
22
|
iconsMap?: FilterIconsMap;
|
|
23
23
|
hasNotFilteredOption?: boolean;
|
|
24
|
+
preserveOptionOrder?: boolean;
|
|
24
25
|
isMultiple?: boolean;
|
|
25
26
|
onAsyncSearch?: FilterSearchCallback;
|
|
26
27
|
options?: FilterOptions;
|
|
@@ -31,7 +31,15 @@ const FilterForm = (props: FilterFormProps) => {
|
|
|
31
31
|
const filterStyle = useMultiStyleConfig('Filter') as FilterStyle;
|
|
32
32
|
|
|
33
33
|
const { data, state } = useFilterContext();
|
|
34
|
-
const {
|
|
34
|
+
const {
|
|
35
|
+
iconsMap,
|
|
36
|
+
hasNotFilteredOption = true,
|
|
37
|
+
preserveOptionOrder,
|
|
38
|
+
isMultiple,
|
|
39
|
+
onAsyncSearch,
|
|
40
|
+
options,
|
|
41
|
+
optionsMap,
|
|
42
|
+
} = data[category];
|
|
35
43
|
const value = state[category] || [];
|
|
36
44
|
|
|
37
45
|
const [selected, setSelected] = useState<FilterValue>(value);
|
|
@@ -111,8 +119,8 @@ const FilterForm = (props: FilterFormProps) => {
|
|
|
111
119
|
|
|
112
120
|
const items =
|
|
113
121
|
isAsync && !!searchValue
|
|
114
|
-
? Array.from(new Set([...value, ...foundOptions]))
|
|
115
|
-
: Array.from(new Set([...value, ...filteredOptions]));
|
|
122
|
+
? Array.from(new Set(preserveOptionOrder ? [...foundOptions] : [...value, ...foundOptions]))
|
|
123
|
+
: Array.from(new Set(preserveOptionOrder ? [...filteredOptions] : [...value, ...filteredOptions]));
|
|
116
124
|
|
|
117
125
|
return (
|
|
118
126
|
<FocusLock>
|
|
@@ -178,7 +186,7 @@ const FilterForm = (props: FilterFormProps) => {
|
|
|
178
186
|
</RadioGroup>
|
|
179
187
|
)}
|
|
180
188
|
<ButtonGroup spacing="12" sx={filterStyle.formButtonGroup}>
|
|
181
|
-
{isEditMode && (
|
|
189
|
+
{isEditMode && hasNotFilteredOption && (
|
|
182
190
|
<Button marginInlineEnd="auto" onClick={onClearClick} size="sm" variant="tertiary">
|
|
183
191
|
Clear
|
|
184
192
|
</Button>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BoxProps } from '@chakra-ui/react';
|
|
2
|
+
import Divider from '../../Components/Divider/Divider';
|
|
3
|
+
import Box from '../../Components/Box/Box';
|
|
4
|
+
import Text from '../../Components/Text/Text';
|
|
5
|
+
|
|
6
|
+
export type GroupHeaderProps = {
|
|
7
|
+
label: string;
|
|
8
|
+
} & BoxProps;
|
|
9
|
+
|
|
10
|
+
const GroupHeader = ({ label, ...rest }: GroupHeaderProps) => {
|
|
11
|
+
return (
|
|
12
|
+
<Box alignItems="center" display="flex" gap="16" paddingTop="8" paddingRight="8" paddingBottom="4" {...rest}>
|
|
13
|
+
<Text as="h6" textStyle="heading/h6" textColor="text/tertiary">
|
|
14
|
+
{label}
|
|
15
|
+
</Text>
|
|
16
|
+
<Divider flexGrow="1" w="auto" />
|
|
17
|
+
</Box>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default GroupHeader;
|
package/src/index.ts
CHANGED
|
@@ -220,6 +220,9 @@ export { default as DatePicker, DateRange, useDateRange } from './Components/Dat
|
|
|
220
220
|
export type { FadeProps } from './Components/Fade/Fade';
|
|
221
221
|
export { default as Fade } from './Components/Fade/Fade';
|
|
222
222
|
|
|
223
|
+
export type { GroupHeaderProps } from './Patterns/GroupHeader/GroupHeader';
|
|
224
|
+
export { default as GroupHeader } from './Patterns/GroupHeader/GroupHeader';
|
|
225
|
+
|
|
223
226
|
export type { InputProps } from './Components/Form/Input/Input';
|
|
224
227
|
export { default as Input } from './Components/Form/Input/Input';
|
|
225
228
|
|