@woosmap/ui 3.128.0 → 3.130.1
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/.idea/encodings.xml +6 -0
- package/.idea/inspectionProfiles/Project_Default.xml +18 -0
- package/.idea/inspectionProfiles/profiles_settings.xml +6 -0
- package/.idea/misc.xml +4 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +6 -0
- package/.idea/ui.iml +15 -0
- package/.idea/vcs.xml +6 -0
- package/package.json +1 -1
- package/src/components/Dropdown/Dropdown.js +29 -4
- package/src/components/Dropdown/Dropdown.styl +11 -0
- package/src/styles/console/colors.styl +13 -0
- package/src/styles/console/mixins.styl +3 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<component name="InspectionProjectProfileManager">
|
|
2
|
+
<profile version="1.0">
|
|
3
|
+
<option name="myName" value="Project Default" />
|
|
4
|
+
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
|
5
|
+
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
|
6
|
+
<option name="ignoredPackages">
|
|
7
|
+
<value>
|
|
8
|
+
<list size="4">
|
|
9
|
+
<item index="0" class="java.lang.String" itemvalue="Fabric" />
|
|
10
|
+
<item index="1" class="java.lang.String" itemvalue="PyYAML" />
|
|
11
|
+
<item index="2" class="java.lang.String" itemvalue="Jinja2" />
|
|
12
|
+
<item index="3" class="java.lang.String" itemvalue="github3.py" />
|
|
13
|
+
</list>
|
|
14
|
+
</value>
|
|
15
|
+
</option>
|
|
16
|
+
</inspection_tool>
|
|
17
|
+
</profile>
|
|
18
|
+
</component>
|
package/.idea/misc.xml
ADDED
package/.idea/ui.iml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="PYTHON_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$" />
|
|
5
|
+
<orderEntry type="inheritedJdk" />
|
|
6
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
7
|
+
</component>
|
|
8
|
+
<component name="TemplatesService">
|
|
9
|
+
<option name="TEMPLATE_FOLDERS">
|
|
10
|
+
<list>
|
|
11
|
+
<option value="$MODULE_DIR$/node_modules/@storybook/core/dist/server/templates" />
|
|
12
|
+
</list>
|
|
13
|
+
</option>
|
|
14
|
+
</component>
|
|
15
|
+
</module>
|
package/.idea/vcs.xml
ADDED
package/package.json
CHANGED
|
@@ -42,21 +42,45 @@ class DropdownMenu extends Component {
|
|
|
42
42
|
constructor(props) {
|
|
43
43
|
super(props);
|
|
44
44
|
this.childrenRefs = {};
|
|
45
|
+
this.menuRef = React.createRef();
|
|
46
|
+
this.state = {
|
|
47
|
+
directionInBounds: props.direction,
|
|
48
|
+
};
|
|
45
49
|
}
|
|
46
50
|
|
|
51
|
+
componentDidUpdate(_, prevState) {
|
|
52
|
+
if (this.menuRef.current) {
|
|
53
|
+
const { directionInBounds } = this.state;
|
|
54
|
+
const { directionInBounds: prevDirectionInBounds } = prevState;
|
|
55
|
+
const { top, bottom } = this.menuRef.current.getBoundingClientRect();
|
|
56
|
+
const { innerHeight } = window;
|
|
57
|
+
if (innerHeight > top && !prevDirectionInBounds.includes('s')) {
|
|
58
|
+
this.setDirectionInBounds(directionInBounds.replace('n', 's'));
|
|
59
|
+
}
|
|
60
|
+
if (innerHeight < bottom && !prevDirectionInBounds.includes('n')) {
|
|
61
|
+
this.setDirectionInBounds(directionInBounds.replace('s', 'n'));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
setDirectionInBounds = (direction) => {
|
|
67
|
+
this.setState({ directionInBounds: direction });
|
|
68
|
+
};
|
|
69
|
+
|
|
47
70
|
close = () => {
|
|
48
71
|
closeChildren(this.childrenRefs);
|
|
49
72
|
};
|
|
50
73
|
|
|
51
74
|
render() {
|
|
52
75
|
const { direction, children, closeCb, onMouseEnter, onMouseLeave, testId, isSection, ...rest } = this.props;
|
|
76
|
+
const { directionInBounds } = this.state;
|
|
53
77
|
const childrenWithProps = mapChildrenWithProps(children, this.childrenRefs, { closeCb });
|
|
54
78
|
if (isSection) {
|
|
55
79
|
return (
|
|
56
|
-
<div className="dropdown__container">
|
|
80
|
+
<div className="dropdown__container" ref={this.menuRef}>
|
|
57
81
|
<div
|
|
58
82
|
role="menu"
|
|
59
|
-
className={cl('dropdown__menu',
|
|
83
|
+
className={cl('dropdown__menu', directionInBounds, 'dropdown__menu--section')}
|
|
60
84
|
data-testid={testId}
|
|
61
85
|
tabIndex="-1"
|
|
62
86
|
onMouseEnter={onMouseEnter}
|
|
@@ -71,11 +95,12 @@ class DropdownMenu extends Component {
|
|
|
71
95
|
return (
|
|
72
96
|
<ul
|
|
73
97
|
role="menu"
|
|
74
|
-
className={cl('dropdown__menu',
|
|
98
|
+
className={cl('dropdown__menu', directionInBounds)}
|
|
75
99
|
data-testid={testId}
|
|
76
100
|
{...rest}
|
|
77
101
|
onMouseEnter={onMouseEnter}
|
|
78
102
|
onMouseLeave={onMouseLeave}
|
|
103
|
+
ref={this.menuRef}
|
|
79
104
|
>
|
|
80
105
|
{childrenWithProps}
|
|
81
106
|
</ul>
|
|
@@ -99,7 +124,7 @@ DropdownMenu.propTypes = {
|
|
|
99
124
|
onMouseLeave: PropTypes.func,
|
|
100
125
|
testId: PropTypes.string,
|
|
101
126
|
isSection: PropTypes.bool,
|
|
102
|
-
direction: PropTypes.oneOf(['ne', 'e', 'se', 's', 'sw', 'w']),
|
|
127
|
+
direction: PropTypes.oneOf(['ne', 'e', 'se', 's', 'sw', 'w', 'nw']),
|
|
103
128
|
};
|
|
104
129
|
|
|
105
130
|
class DropdownMenuSection extends Component {
|
|
@@ -41,6 +41,13 @@
|
|
|
41
41
|
left 0
|
|
42
42
|
margin-bottom .3rem
|
|
43
43
|
|
|
44
|
+
&.nw
|
|
45
|
+
top auto
|
|
46
|
+
bottom 100%
|
|
47
|
+
right 0
|
|
48
|
+
left auto
|
|
49
|
+
margin-bottom .3rem
|
|
50
|
+
|
|
44
51
|
&.s
|
|
45
52
|
right 50%
|
|
46
53
|
left auto
|
|
@@ -50,6 +57,10 @@
|
|
|
50
57
|
right 0
|
|
51
58
|
left auto
|
|
52
59
|
|
|
60
|
+
&.se
|
|
61
|
+
right auto
|
|
62
|
+
left 0
|
|
63
|
+
|
|
53
64
|
|
|
54
65
|
&__item
|
|
55
66
|
flexMiddle()
|
|
@@ -10,6 +10,19 @@ $inputDemoBgColor = #f6f7f8
|
|
|
10
10
|
$inputDemoBorderColor = #bcc4d7
|
|
11
11
|
$inputDemoPlaceholderColor = #818ca5
|
|
12
12
|
|
|
13
|
+
// Logo colors
|
|
14
|
+
$logo1 = #4fc3f7
|
|
15
|
+
$logo2 = #5586ff
|
|
16
|
+
$logo3 = #3d5afe
|
|
17
|
+
$logo4 = #3949ab
|
|
18
|
+
$logo5 = #c51162
|
|
19
|
+
$logo6 = #f50057
|
|
20
|
+
$logo7 = #ff5252
|
|
21
|
+
$logo8 = #ffab00
|
|
22
|
+
|
|
23
|
+
$coloredGradient1 = $logo3
|
|
24
|
+
$coloredGradient2 = $logo6
|
|
25
|
+
$coloredGradient3 = $logo8
|
|
13
26
|
|
|
14
27
|
// Main colors
|
|
15
28
|
|