@pushwoosh/dumb-components 1.1.72 → 1.1.74
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/DropdownMenu/components/DropdownMenu/DropdownMenu.js +1 -0
- package/DropdownMenu/components/DropdownMenu/styles.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenu/styles.js +8 -2
- package/EditableField/EditableField.js +4 -1
- package/StatisticCard/StatisticCard.js +0 -1
- package/package.json +1 -1
|
@@ -78,6 +78,7 @@ export const DropdownMenu = ({
|
|
|
78
78
|
style: floatingStyles,
|
|
79
79
|
"$color": color,
|
|
80
80
|
"$width": width,
|
|
81
|
+
"$fitContent": windowWidth === null && !fullWidth,
|
|
81
82
|
"$scrollable": isScrollable,
|
|
82
83
|
"$zIndex": menuZIndex
|
|
83
84
|
}, typeof children === 'function' ? children() : children));
|
|
@@ -2,14 +2,20 @@ import styled, { css } from 'styled-components';
|
|
|
2
2
|
import { Color, Shadow, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { Vertical } from '@pushwoosh/kit-helpers';
|
|
4
4
|
const scrollableCss = css(["max-height:248px;overflow-y:auto;"]);
|
|
5
|
+
const getWidth = ($width, $fitContent) => {
|
|
6
|
+
if ($fitContent) return 'max-content';
|
|
7
|
+
if ($width) return `${$width}px`;
|
|
8
|
+
return 'auto';
|
|
9
|
+
};
|
|
5
10
|
export const Place = styled(Vertical).withConfig({
|
|
6
11
|
displayName: "Place",
|
|
7
12
|
componentId: "sc-ij8wqc-0"
|
|
8
13
|
})(["border:1px solid ", ";background:", ";width:", ";min-width:140px;max-width:480px;", " border-radius:", ";box-shadow:", ";z-index:", ";"], Color.FORM, ({
|
|
9
14
|
$color
|
|
10
15
|
}) => $color || Color.FROZEN, ({
|
|
11
|
-
$width
|
|
12
|
-
|
|
16
|
+
$width,
|
|
17
|
+
$fitContent
|
|
18
|
+
}) => getWidth($width, $fitContent), ({
|
|
13
19
|
$scrollable
|
|
14
20
|
}) => $scrollable && scrollableCss, ShapeRadius.CONTROL, Shadow.REGULAR, ({
|
|
15
21
|
$zIndex
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useRef } from 'react';
|
|
2
2
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
|
+
import { Vertical } from '@pushwoosh/kit-helpers';
|
|
3
4
|
import { DropdownIcon, EditIcon } from '@pushwoosh/kit-icons';
|
|
4
5
|
import { Button } from '../Button';
|
|
5
6
|
import { useOnClickOutside } from '../hooks';
|
|
@@ -42,6 +43,8 @@ export function EditableField({
|
|
|
42
43
|
internalWindowRef: rootRef,
|
|
43
44
|
loading: loading,
|
|
44
45
|
zIndex: zIndex
|
|
46
|
+
}, React.createElement(Vertical, {
|
|
47
|
+
"$padding": 16
|
|
45
48
|
}, title && React.createElement(TitleBox, null, title), children, React.createElement(ButtonsGroup, {
|
|
46
49
|
"$isLoading": loading
|
|
47
50
|
}, React.createElement(Button, {
|
|
@@ -56,5 +59,5 @@ export function EditableField({
|
|
|
56
59
|
size: "compact",
|
|
57
60
|
isDisabled: loading,
|
|
58
61
|
onClick: onCancel
|
|
59
|
-
}, "Cancel"))));
|
|
62
|
+
}, "Cancel")))));
|
|
60
63
|
}
|
|
@@ -40,7 +40,6 @@ export function StatisticCard(props) {
|
|
|
40
40
|
return React.createElement(StatValue, null, typeof value === 'number' ? formatNumber(value, 'spaced') : value);
|
|
41
41
|
}, [isLoading, value, valueSubtext]);
|
|
42
42
|
const resolvedRightSlot = rightSlot ?? (actions ? React.createElement(DropdownMenu, {
|
|
43
|
-
windowWidth: 230,
|
|
44
43
|
renderHandler: ({
|
|
45
44
|
onClick,
|
|
46
45
|
ref,
|