@apify/ui-library 1.162.1 → 1.163.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/dist/components/floating/menu_components.d.ts +3 -3
- package/dist/components/floating/menu_components.d.ts.map +1 -1
- package/dist/components/floating/menu_components.js +7 -6
- package/dist/files_hash_at_build.txt +1 -1
- package/dist/src/components/floating/menu_components.d.ts +3 -3
- package/dist/src/components/floating/menu_components.d.ts.map +1 -1
- package/dist/src/components/floating/menu_components.js +6 -5
- package/dist/src/components/floating/menu_components.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/components/floating/menu_components.tsx +7 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apify/ui-library",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.163.0",
|
|
4
4
|
"description": "React UI library used by apify.com",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -95,5 +95,5 @@
|
|
|
95
95
|
"src",
|
|
96
96
|
"style"
|
|
97
97
|
],
|
|
98
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "ed77920d4063cbbf7f04c953ab2c0dd69d7b8781"
|
|
99
99
|
}
|
|
@@ -113,13 +113,14 @@ type DropdownMenuBaseComponentWithCountProps = {
|
|
|
113
113
|
} & BoxProps;
|
|
114
114
|
|
|
115
115
|
/**
|
|
116
|
-
* Menu base component WITH dropdown icon
|
|
117
|
-
*
|
|
118
|
-
*
|
|
116
|
+
* Menu base component WITH dropdown icon, an optional selected-count badge and an optional clear button.
|
|
117
|
+
* Pass `selectedCount` for multi-select menus to show how many items are selected; single-select menus
|
|
118
|
+
* can omit it and still get the clear button by passing `onClear`.
|
|
119
119
|
*/
|
|
120
120
|
export const DropdownMenuBaseComponentWithCount = forwardRef<HTMLElement, DropdownMenuBaseComponentWithCountProps>(
|
|
121
121
|
({ children, onClear, selectedCount, ...props }, ref) => {
|
|
122
|
-
const showCount =
|
|
122
|
+
const showCount = selectedCount !== undefined && selectedCount > 0;
|
|
123
|
+
const showClear = !!onClear && (selectedCount === undefined || selectedCount > 0);
|
|
123
124
|
|
|
124
125
|
return (
|
|
125
126
|
<PlainMenuBaseComponent {...props} ref={ref}>
|
|
@@ -129,8 +130,8 @@ export const DropdownMenuBaseComponentWithCount = forwardRef<HTMLElement, Dropdo
|
|
|
129
130
|
{selectedCount}
|
|
130
131
|
</Badge>
|
|
131
132
|
)}
|
|
132
|
-
{
|
|
133
|
-
{
|
|
133
|
+
{showClear && <VerticalDivider />}
|
|
134
|
+
{showClear ? (
|
|
134
135
|
<CrossIcon
|
|
135
136
|
size="16"
|
|
136
137
|
color={theme.color.neutral.icon}
|