@bitrise/bitkit 13.195.0 → 13.197.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>
|
|
@@ -16,6 +16,7 @@ export type LabeledDataProps = BoxProps & {
|
|
|
16
16
|
secondaryLabel?: ReactNode;
|
|
17
17
|
size?: 'sm' | 'md' | 'lg';
|
|
18
18
|
skeleton?: ReactNode;
|
|
19
|
+
shouldShowTrendSign?: boolean;
|
|
19
20
|
tooltip?: Omit<TooltipProps, 'children'>;
|
|
20
21
|
trend?: 'positive' | 'negative' | 'neutral';
|
|
21
22
|
trendColorScheme?: 'red' | 'green' | 'grey';
|
|
@@ -32,6 +33,7 @@ const LabeledData = ({
|
|
|
32
33
|
secondaryLabel,
|
|
33
34
|
size = 'sm',
|
|
34
35
|
skeleton,
|
|
36
|
+
shouldShowTrendSign = true,
|
|
35
37
|
tooltip,
|
|
36
38
|
trend,
|
|
37
39
|
trendValue,
|
|
@@ -39,8 +41,11 @@ const LabeledData = ({
|
|
|
39
41
|
...rest
|
|
40
42
|
}: LabeledDataProps): JSX.Element => {
|
|
41
43
|
const trendIconSize = size === 'sm' ? '16' : '24';
|
|
42
|
-
const trendSign = trend === 'negative' ? '-' : '+';
|
|
43
44
|
const labelColor = size === 'sm' ? 'text/primary' : 'text/secondary';
|
|
45
|
+
let trendSign;
|
|
46
|
+
if (shouldShowTrendSign) {
|
|
47
|
+
trendSign = trend === 'negative' ? '-' : '+';
|
|
48
|
+
}
|
|
44
49
|
|
|
45
50
|
let dataSkeletonHeight;
|
|
46
51
|
let dataSkeletonPaddingY;
|
|
@@ -122,9 +127,9 @@ const LabeledData = ({
|
|
|
122
127
|
{placeholder}
|
|
123
128
|
</Box>
|
|
124
129
|
)}
|
|
125
|
-
{(
|
|
130
|
+
{(trendValue || !!secondaryLabel) && (
|
|
126
131
|
<Box as="dd" display="flex" gap="4" color={trendColor} textStyle="body/md/regular">
|
|
127
|
-
{
|
|
132
|
+
{trendValue && (
|
|
128
133
|
<>
|
|
129
134
|
{trendSign}
|
|
130
135
|
{trendValue}
|