@synerise/ds-menu 0.10.45 → 0.11.3
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/CHANGELOG.md +35 -0
- package/dist/Elements/Breadcrumb/Breadcrumb.js +20 -42
- package/dist/Elements/Breadcrumb/Breadcrumb.styles.js +9 -7
- package/dist/Elements/Breadcrumb/Breadcrumb.types.js +1 -0
- package/dist/Elements/Header/Header.js +4 -5
- package/dist/Elements/Header/Header.types.js +1 -0
- package/dist/Elements/Item/Danger/Danger.js +3 -3
- package/dist/Elements/Item/Danger/Danger.styles.js +11 -9
- package/dist/Elements/Item/MenuItem.js +8 -8
- package/dist/Elements/Item/Select/Select.js +4 -4
- package/dist/Elements/Item/Select/Select.styles.js +6 -4
- package/dist/Elements/Item/SubmenuText/SubmenuText.js +5 -5
- package/dist/Elements/Item/SubmenuText/SubmenuText.styles.js +6 -4
- package/dist/Elements/Item/Text/Text.js +23 -36
- package/dist/Elements/Item/Text/Text.styles.js +8 -8
- package/dist/Elements/Item/Text/Text.types.js +1 -0
- package/dist/Elements/SubMenu/SubMenu.js +72 -97
- package/dist/Elements/SubMenu/SubMenu.types.js +1 -0
- package/dist/Menu.js +80 -97
- package/dist/Menu.styles.js +5 -5
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,41 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.11.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-menu@0.11.2...@synerise/ds-menu@0.11.3) (2021-12-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **table:** fixes returned data by on change selection function ([151e195](https://github.com/Synerise/synerise-design/commit/151e195b8bb6d37f9fdede12aaa569b56ba97e82))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.11.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-menu@0.11.1...@synerise/ds-menu@0.11.2) (2021-11-22)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @synerise/ds-menu
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [0.11.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-menu@0.10.45...@synerise/ds-menu@0.11.1) (2021-11-09)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @synerise/ds-menu
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# [0.11.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-menu@0.10.45...@synerise/ds-menu@0.11.0) (2021-11-09)
|
|
34
|
+
|
|
35
|
+
**Note:** Version bump only for package @synerise/ds-menu
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
6
41
|
## [0.10.45](https://github.com/Synerise/synerise-design/compare/@synerise/ds-menu@0.10.44...@synerise/ds-menu@0.10.45) (2021-11-05)
|
|
7
42
|
|
|
8
43
|
**Note:** Version bump only for package @synerise/ds-menu
|
|
@@ -1,32 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
|
|
5
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
|
|
7
|
-
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
8
|
-
|
|
9
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
10
|
-
|
|
11
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
12
|
-
|
|
13
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
1
|
+
var _excluded = ["path", "disabled", "highlight", "description", "onPathClick", "compact", "startWithArrow", "gradientOverlap", "highlightActivePath"];
|
|
14
2
|
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
18
|
-
|
|
19
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
20
|
-
|
|
21
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
22
|
-
|
|
23
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
3
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
24
4
|
|
|
25
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
26
6
|
|
|
27
7
|
import * as React from 'react';
|
|
28
|
-
import Icon from '@synerise/ds-icon';
|
|
29
|
-
import AngleRightS from '@synerise/ds-icon/dist/icons/AngleRightS';
|
|
8
|
+
import Icon, { AngleRightS } from '@synerise/ds-icon';
|
|
30
9
|
import theme from '@synerise/ds-core/dist/js/DSProvider/ThemeProvider/theme';
|
|
31
10
|
import { escapeRegEx } from '@synerise/ds-utils';
|
|
32
11
|
import * as S from './Breadcrumb.styles';
|
|
@@ -41,19 +20,16 @@ var Breadcrumb = function Breadcrumb(_ref) {
|
|
|
41
20
|
startWithArrow = _ref.startWithArrow,
|
|
42
21
|
gradientOverlap = _ref.gradientOverlap,
|
|
43
22
|
highlightActivePath = _ref.highlightActivePath,
|
|
44
|
-
rest =
|
|
23
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
45
24
|
|
|
46
25
|
var prefixel = rest.prefixel;
|
|
47
|
-
|
|
48
|
-
var breadcrumbsArray = _toConsumableArray(path);
|
|
49
|
-
|
|
26
|
+
var breadcrumbsArray = [].concat(path);
|
|
50
27
|
var pathToDisplay = compact ? breadcrumbsArray.reverse() : breadcrumbsArray;
|
|
51
28
|
var contentRef = React.useRef(null);
|
|
52
29
|
|
|
53
30
|
var _React$useState = React.useState(false),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
setGradient = _React$useState2[1];
|
|
31
|
+
gradient = _React$useState[0],
|
|
32
|
+
setGradient = _React$useState[1];
|
|
57
33
|
|
|
58
34
|
var renderWithHighlighting = React.useCallback(function (name) {
|
|
59
35
|
if (highlight && typeof name === 'string') {
|
|
@@ -66,7 +42,7 @@ var Breadcrumb = function Breadcrumb(_ref) {
|
|
|
66
42
|
var escapedHighlight = escapeRegEx(highlight);
|
|
67
43
|
var startOfQuery = name.toLowerCase().search(escapedHighlight.toLowerCase());
|
|
68
44
|
var endOfQuery = startOfQuery + highlight.length;
|
|
69
|
-
var resultArray = [name.substring(0, startOfQuery), React.createElement("span", {
|
|
45
|
+
var resultArray = [name.substring(0, startOfQuery), /*#__PURE__*/React.createElement("span", {
|
|
70
46
|
key: name,
|
|
71
47
|
className: "search-highlight"
|
|
72
48
|
}, name.substring(startOfQuery, endOfQuery)), name.substring(endOfQuery, name.length)];
|
|
@@ -118,32 +94,34 @@ var Breadcrumb = function Breadcrumb(_ref) {
|
|
|
118
94
|
var shouldRenderGradientOverlap = gradientOverlap && isOverflown(contentRef);
|
|
119
95
|
setGradient(!!shouldRenderGradientOverlap);
|
|
120
96
|
}, [path, contentRef, gradientOverlap]);
|
|
121
|
-
return React.createElement(S.Breadcrumb, _extends({
|
|
97
|
+
return /*#__PURE__*/React.createElement(S.Breadcrumb, _extends({
|
|
122
98
|
className: "ds-breadcrumb",
|
|
123
99
|
disabled: disabled,
|
|
124
100
|
compact: compact,
|
|
125
101
|
onPathClick: onPathClick
|
|
126
|
-
}, rest), !!description && React.createElement(S.Description, null, renderWithHighlighting(description)), React.createElement(S.ContentWrapper, {
|
|
102
|
+
}, rest), !!description && /*#__PURE__*/React.createElement(S.Description, null, renderWithHighlighting(description)), /*#__PURE__*/React.createElement(S.ContentWrapper, {
|
|
127
103
|
gradientOverlap: gradient
|
|
128
|
-
}, React.createElement(S.BreadcrumbContent, {
|
|
104
|
+
}, /*#__PURE__*/React.createElement(S.BreadcrumbContent, {
|
|
129
105
|
className: "breadcrumb-content",
|
|
130
106
|
prefixel: !!prefixel,
|
|
131
107
|
ref: contentRef
|
|
132
108
|
}, pathToDisplay.map(function (item, index) {
|
|
133
|
-
return (
|
|
109
|
+
return (
|
|
110
|
+
/*#__PURE__*/
|
|
111
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
134
112
|
React.createElement(S.BreadcrumbRoute, {
|
|
135
113
|
className: "route",
|
|
136
|
-
key:
|
|
137
|
-
}, React.createElement(S.BreadcrumbName, {
|
|
138
|
-
className: "ds-breadcrumb-name "
|
|
114
|
+
key: item + "-" + index
|
|
115
|
+
}, /*#__PURE__*/React.createElement(S.BreadcrumbName, {
|
|
116
|
+
className: "ds-breadcrumb-name " + attachActiveClassName(index),
|
|
139
117
|
onClick: function onClick() {
|
|
140
118
|
onPathClick && onPathClick(item);
|
|
141
119
|
}
|
|
142
|
-
}, renderWithHighlighting(item)), shouldHaveArrowPlaceholder(index) && React.createElement(S.ArrowRight, {
|
|
120
|
+
}, renderWithHighlighting(item)), shouldHaveArrowPlaceholder(index) && /*#__PURE__*/React.createElement(S.ArrowRight, {
|
|
143
121
|
className: "ds-arrow",
|
|
144
122
|
visible: shouldRenderArrow(path, index)
|
|
145
|
-
}, React.createElement(Icon, {
|
|
146
|
-
component: React.createElement(AngleRightS, null),
|
|
123
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
124
|
+
component: /*#__PURE__*/React.createElement(AngleRightS, null),
|
|
147
125
|
color: theme.palette['grey-600']
|
|
148
126
|
})))
|
|
149
127
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["children", "disabled", "onPathClick", "compact"];
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
6
|
|
|
@@ -33,11 +33,11 @@ export var ContentWrapper = styled.div.withConfig({
|
|
|
33
33
|
})(["position:relative;&::before{pointer-events:none;content:", ";position:absolute;display:block;width:50px;height:18px;transition:opacity 0.3s ease-in-out;background-image:", ";}&::after{pointer-events:none;content:", ";position:absolute;left:0;top:0;display:block;width:50px;height:18px;transition:opacity 0.3s ease-in-out;background-image:", ";}"], function (props) {
|
|
34
34
|
return props.gradientOverlap ? "''" : 'none';
|
|
35
35
|
}, function (props) {
|
|
36
|
-
return "-webkit-linear-gradient( left,\n "
|
|
36
|
+
return "-webkit-linear-gradient( left,\n " + props.theme.palette['grey-050'] + " 0%,\n rgba(255,255,255,0) 100%\n )";
|
|
37
37
|
}, function (props) {
|
|
38
38
|
return props.gradientOverlap ? "''" : 'none';
|
|
39
39
|
}, function (props) {
|
|
40
|
-
return "-webkit-linear-gradient( left,\n "
|
|
40
|
+
return "-webkit-linear-gradient( left,\n " + props.theme.palette.white + " 0%,\n rgba(255,255,255,0) 100%\n )";
|
|
41
41
|
});
|
|
42
42
|
export var BreadcrumbName = styled.div.withConfig({
|
|
43
43
|
displayName: "Breadcrumbstyles__BreadcrumbName",
|
|
@@ -53,9 +53,11 @@ export var Breadcrumb = styled(function (_ref) {
|
|
|
53
53
|
disabled = _ref.disabled,
|
|
54
54
|
onPathClick = _ref.onPathClick,
|
|
55
55
|
compact = _ref.compact,
|
|
56
|
-
rest =
|
|
56
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
57
57
|
|
|
58
|
-
return (
|
|
58
|
+
return (
|
|
59
|
+
/*#__PURE__*/
|
|
60
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
59
61
|
React.createElement(Text, _extends({
|
|
60
62
|
disabled: disabled,
|
|
61
63
|
onItemHover: NOOP,
|
|
@@ -74,7 +76,7 @@ export var Breadcrumb = styled(function (_ref) {
|
|
|
74
76
|
}, BreadcrumbName, Description, function (props) {
|
|
75
77
|
return props.disabled ? props.theme.palette['grey-600'] : props.theme.palette['blue-600'];
|
|
76
78
|
}, ContentWrapper, ContentWrapper, ContentWrapper, function (props) {
|
|
77
|
-
return "-webkit-linear-gradient( left,\n "
|
|
79
|
+
return "-webkit-linear-gradient( left,\n " + props.theme.palette['grey-100'] + " 0%,\n rgba(255,255,255,0) 100%\n )";
|
|
78
80
|
}, function (props) {
|
|
79
81
|
return !!props.onPathClick && disableDefaultClickingStyles(props);
|
|
80
82
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import Tooltip from '@synerise/ds-tooltip/dist/Tooltip';
|
|
3
|
-
import Icon from '@synerise/ds-icon
|
|
4
|
-
import { InfoFillS } from '@synerise/ds-icon/dist/icons';
|
|
3
|
+
import Icon, { InfoFillS } from '@synerise/ds-icon';
|
|
5
4
|
import * as S from './Header.styles';
|
|
6
5
|
|
|
7
6
|
var MenuHeader = function MenuHeader(_ref) {
|
|
8
7
|
var headerText = _ref.headerText,
|
|
9
8
|
tooltip = _ref.tooltip;
|
|
10
|
-
return React.createElement(S.MenuHeader, null, headerText, tooltip && React.createElement(Tooltip, {
|
|
9
|
+
return /*#__PURE__*/React.createElement(S.MenuHeader, null, headerText, tooltip && /*#__PURE__*/React.createElement(Tooltip, {
|
|
11
10
|
type: "default",
|
|
12
11
|
trigger: "hover",
|
|
13
12
|
title: tooltip || headerText
|
|
14
|
-
}, React.createElement(S.HeaderIconWrapper, null, React.createElement(Icon, {
|
|
15
|
-
component: React.createElement(InfoFillS, null)
|
|
13
|
+
}, /*#__PURE__*/React.createElement(S.HeaderIconWrapper, null, /*#__PURE__*/React.createElement(Icon, {
|
|
14
|
+
component: /*#__PURE__*/React.createElement(InfoFillS, null)
|
|
16
15
|
}))));
|
|
17
16
|
};
|
|
18
17
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["children"];
|
|
2
2
|
|
|
3
3
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
4
|
|
|
@@ -8,9 +8,9 @@ import * as S from './Danger.styles';
|
|
|
8
8
|
|
|
9
9
|
var Danger = function Danger(props) {
|
|
10
10
|
var children = props.children,
|
|
11
|
-
rest =
|
|
11
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
|
12
12
|
|
|
13
|
-
return React.createElement(S.DangerItem, rest, children);
|
|
13
|
+
return /*#__PURE__*/React.createElement(S.DangerItem, rest, children);
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export default Danger;
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["children", "disabled"];
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
6
|
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import * as React from 'react';
|
|
9
|
-
import { IconContainer } from '@synerise/ds-icon
|
|
9
|
+
import { IconContainer } from '@synerise/ds-icon';
|
|
10
10
|
import Text from '../Text/Text';
|
|
11
11
|
import { ContentWrapper, PrefixelWrapper } from '../Text/Text.styles'; // eslint-disable-next-line import/prefer-default-export
|
|
12
12
|
|
|
13
13
|
export var DangerItem = styled(function (_ref) {
|
|
14
14
|
var children = _ref.children,
|
|
15
15
|
disabled = _ref.disabled,
|
|
16
|
-
rest =
|
|
16
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
17
17
|
|
|
18
|
-
return (
|
|
18
|
+
return (
|
|
19
|
+
/*#__PURE__*/
|
|
20
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
19
21
|
React.createElement(Text, _extends({
|
|
20
22
|
disabled: disabled
|
|
21
23
|
}, rest), children)
|
|
@@ -32,11 +34,11 @@ export var DangerItem = styled(function (_ref) {
|
|
|
32
34
|
}, ContentWrapper, function (props) {
|
|
33
35
|
return props.theme.palette['red-600'];
|
|
34
36
|
}, PrefixelWrapper, function (props) {
|
|
35
|
-
return "\n fill: "
|
|
37
|
+
return "\n fill: " + props.theme.palette['red-600'] + ";\n ";
|
|
36
38
|
}, function (props) {
|
|
37
|
-
return !props.disabled && "\n "
|
|
39
|
+
return !props.disabled && "\n " + PrefixelWrapper + " > " + IconContainer + " > svg {\n fill: " + props.theme.palette['red-600'] + " !important;\n }\n background: " + props.theme.palette['red-050'] + ";\n ";
|
|
38
40
|
}, function (props) {
|
|
39
|
-
return !props.disabled && "\n "
|
|
41
|
+
return !props.disabled && "\n " + PrefixelWrapper + " > " + IconContainer + " > svg {\n fill: " + props.theme.palette['red-600'] + " !important;\n }\n background: " + props.theme.palette['red-050'] + " !important;\n ";
|
|
40
42
|
}, function (props) {
|
|
41
|
-
return !props.disabled && "\n background: "
|
|
43
|
+
return !props.disabled && "\n background: " + props.theme.palette['red-100'] + " !important;\n ";
|
|
42
44
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["prefixel", "suffixel", "ordered", "disabled", "danger", "text", "description", "subMenu", "children", "type", "indentLevel", "timeToHideTooltip", "onItemHover", "onClick", "menuItemKey", "onTitleClick"];
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
6
|
|
|
@@ -32,10 +32,10 @@ var MenuItem = function MenuItem(props) {
|
|
|
32
32
|
onClick = props.onClick,
|
|
33
33
|
menuItemKey = props.menuItemKey,
|
|
34
34
|
onTitleClick = props.onTitleClick,
|
|
35
|
-
rest =
|
|
35
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
|
36
36
|
|
|
37
37
|
if (subMenu) {
|
|
38
|
-
return React.createElement(SubMenuItem, _extends({
|
|
38
|
+
return /*#__PURE__*/React.createElement(SubMenuItem, _extends({
|
|
39
39
|
prefixel: prefixel,
|
|
40
40
|
suffixel: suffixel,
|
|
41
41
|
ordered: ordered,
|
|
@@ -54,7 +54,7 @@ var MenuItem = function MenuItem(props) {
|
|
|
54
54
|
|
|
55
55
|
switch (type) {
|
|
56
56
|
case ItemType.SELECT:
|
|
57
|
-
return React.createElement(Select, _extends({
|
|
57
|
+
return /*#__PURE__*/React.createElement(Select, _extends({
|
|
58
58
|
ordered: ordered,
|
|
59
59
|
prefixel: prefixel,
|
|
60
60
|
suffixel: suffixel,
|
|
@@ -66,7 +66,7 @@ var MenuItem = function MenuItem(props) {
|
|
|
66
66
|
}, rest), text || children);
|
|
67
67
|
|
|
68
68
|
case ItemType.DANGER:
|
|
69
|
-
return React.createElement(Danger, _extends({
|
|
69
|
+
return /*#__PURE__*/React.createElement(Danger, _extends({
|
|
70
70
|
ordered: ordered,
|
|
71
71
|
prefixel: prefixel,
|
|
72
72
|
suffixel: suffixel,
|
|
@@ -78,12 +78,12 @@ var MenuItem = function MenuItem(props) {
|
|
|
78
78
|
}, rest), text || children);
|
|
79
79
|
|
|
80
80
|
case ItemType.DIVIDER:
|
|
81
|
-
return React.createElement(MenuDivider, {
|
|
81
|
+
return /*#__PURE__*/React.createElement(MenuDivider, {
|
|
82
82
|
level: rest.level
|
|
83
83
|
});
|
|
84
84
|
|
|
85
85
|
default:
|
|
86
|
-
return React.createElement(Text, _extends({
|
|
86
|
+
return /*#__PURE__*/React.createElement(Text, _extends({
|
|
87
87
|
ordered: ordered,
|
|
88
88
|
prefixel: prefixel,
|
|
89
89
|
suffixel: suffixel,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["disabled", "children"];
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
6
|
|
|
@@ -12,9 +12,9 @@ import * as S from './Select.styles';
|
|
|
12
12
|
var Select = function Select(props) {
|
|
13
13
|
var disabled = props.disabled,
|
|
14
14
|
children = props.children,
|
|
15
|
-
rest =
|
|
15
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
|
16
16
|
|
|
17
|
-
return React.createElement(S.SelectItem, _extends({
|
|
17
|
+
return /*#__PURE__*/React.createElement(S.SelectItem, _extends({
|
|
18
18
|
key: uuid(),
|
|
19
19
|
disabled: disabled
|
|
20
20
|
}, rest), children);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["children", "disabled"];
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
6
|
|
|
@@ -12,9 +12,11 @@ import Text from '../Text/Text'; // eslint-disable-next-line import/prefer-defau
|
|
|
12
12
|
export var SelectItem = styled(function (_ref) {
|
|
13
13
|
var children = _ref.children,
|
|
14
14
|
disabled = _ref.disabled,
|
|
15
|
-
rest =
|
|
15
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
16
16
|
|
|
17
|
-
return (
|
|
17
|
+
return (
|
|
18
|
+
/*#__PURE__*/
|
|
19
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
18
20
|
React.createElement(Text, _extends({
|
|
19
21
|
disabled: disabled
|
|
20
22
|
}, rest), children)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["disabled", "children", "prefixel", "suffixel", "key"];
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
6
|
|
|
@@ -15,11 +15,11 @@ var SubmenuText = function SubmenuText(props) {
|
|
|
15
15
|
prefixel = props.prefixel,
|
|
16
16
|
suffixel = props.suffixel,
|
|
17
17
|
key = props.key,
|
|
18
|
-
rest =
|
|
18
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
|
19
19
|
|
|
20
|
-
return React.createElement(S.SubtitleItemWrapper, {
|
|
20
|
+
return /*#__PURE__*/React.createElement(S.SubtitleItemWrapper, {
|
|
21
21
|
className: "ds-submenu-title-wrapper"
|
|
22
|
-
}, React.createElement(S.SubmenuText, _extends({
|
|
22
|
+
}, /*#__PURE__*/React.createElement(S.SubmenuText, _extends({
|
|
23
23
|
key: key || uuid(),
|
|
24
24
|
disabled: disabled,
|
|
25
25
|
prefixel: prefixel,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["children", "disabled", "childrenCollapsed"];
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
6
|
|
|
@@ -20,9 +20,11 @@ export var SubmenuText = styled(function (_ref) {
|
|
|
20
20
|
var children = _ref.children,
|
|
21
21
|
disabled = _ref.disabled,
|
|
22
22
|
childrenCollapsed = _ref.childrenCollapsed,
|
|
23
|
-
rest =
|
|
23
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
24
24
|
|
|
25
|
-
return (
|
|
25
|
+
return (
|
|
26
|
+
/*#__PURE__*/
|
|
27
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
26
28
|
React.createElement(Text, _extends({}, rest, {
|
|
27
29
|
disabled: disabled,
|
|
28
30
|
onItemHover: NOOP,
|
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
|
|
5
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
|
|
7
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
1
|
+
var _excluded = ["parent", "disabled", "prefixel", "suffixel", "danger", "children", "description", "copyable", "copyHint", "copyValue", "copyTooltip", "timeToHideTooltip", "highlight", "style", "prefixVisibilityTrigger", "suffixVisibilityTrigger", "indentLevel", "ordered", "checked", "size"];
|
|
8
2
|
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
12
|
-
|
|
13
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
|
|
15
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
3
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
4
|
|
|
17
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
18
6
|
|
|
@@ -21,9 +9,8 @@ import classNames from 'classnames';
|
|
|
21
9
|
import theme from '@synerise/ds-core/dist/js/DSProvider/ThemeProvider/theme';
|
|
22
10
|
import * as copy from 'copy-to-clipboard';
|
|
23
11
|
import { escapeRegEx } from '@synerise/ds-utils';
|
|
24
|
-
import Icon from '@synerise/ds-icon';
|
|
12
|
+
import Icon, { CheckS, AngleRightS } from '@synerise/ds-icon';
|
|
25
13
|
import Tooltip from '@synerise/ds-tooltip';
|
|
26
|
-
import { CheckS, AngleRightS } from '@synerise/ds-icon/dist/icons';
|
|
27
14
|
import * as S from './Text.styles';
|
|
28
15
|
import { VisibilityTrigger } from '../../../Menu.types';
|
|
29
16
|
|
|
@@ -57,17 +44,15 @@ var Text = function Text(_ref) {
|
|
|
57
44
|
checked = _ref.checked,
|
|
58
45
|
_ref$size = _ref.size,
|
|
59
46
|
size = _ref$size === void 0 ? 'default' : _ref$size,
|
|
60
|
-
rest =
|
|
47
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
61
48
|
|
|
62
49
|
var _React$useState = React.useState(false),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
setHovered = _React$useState2[1];
|
|
50
|
+
hovered = _React$useState[0],
|
|
51
|
+
setHovered = _React$useState[1];
|
|
66
52
|
|
|
67
|
-
var _React$
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
setClicked = _React$useState4[1];
|
|
53
|
+
var _React$useState2 = React.useState(false),
|
|
54
|
+
clicked = _React$useState2[0],
|
|
55
|
+
setClicked = _React$useState2[1];
|
|
71
56
|
|
|
72
57
|
var canCopyToClipboard = copyable && copyHint && copyValue && !disabled;
|
|
73
58
|
var showSuffixOnHover = suffixVisibilityTrigger === VisibilityTrigger.HOVER;
|
|
@@ -90,7 +75,7 @@ var Text = function Text(_ref) {
|
|
|
90
75
|
var escapedHighlight = escapeRegEx(highlight);
|
|
91
76
|
var startOfQuery = children.toLowerCase().search(escapedHighlight.toLowerCase());
|
|
92
77
|
var endOfQuery = startOfQuery + highlight.length;
|
|
93
|
-
var resultArray = [children.substring(0, startOfQuery), React.createElement("span", {
|
|
78
|
+
var resultArray = [children.substring(0, startOfQuery), /*#__PURE__*/React.createElement("span", {
|
|
94
79
|
key: children,
|
|
95
80
|
className: "search-highlight"
|
|
96
81
|
}, children.substring(startOfQuery, endOfQuery)), children.substring(endOfQuery, children.length)];
|
|
@@ -122,7 +107,9 @@ var Text = function Text(_ref) {
|
|
|
122
107
|
var className = React.useMemo(function () {
|
|
123
108
|
return classNames('ds-menu-item', rest.className, size);
|
|
124
109
|
}, [rest.className, size]);
|
|
125
|
-
return (
|
|
110
|
+
return (
|
|
111
|
+
/*#__PURE__*/
|
|
112
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
126
113
|
// @ts-ignore
|
|
127
114
|
// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
|
|
128
115
|
React.createElement(S.Wrapper, _extends({
|
|
@@ -145,30 +132,30 @@ var Text = function Text(_ref) {
|
|
|
145
132
|
size: size
|
|
146
133
|
}, rest, {
|
|
147
134
|
className: className
|
|
148
|
-
}), React.createElement(Tooltip, {
|
|
135
|
+
}), /*#__PURE__*/React.createElement(Tooltip, {
|
|
149
136
|
type: "default",
|
|
150
137
|
trigger: "click",
|
|
151
138
|
title: copyTooltip,
|
|
152
139
|
timeToHideAfterClick: timeToHideTooltip
|
|
153
|
-
}, React.createElement(S.Inner, null, React.createElement(S.ContentWrapper, {
|
|
140
|
+
}, /*#__PURE__*/React.createElement(S.Inner, null, /*#__PURE__*/React.createElement(S.ContentWrapper, {
|
|
154
141
|
className: "ds-menu-content-wrapper"
|
|
155
|
-
}, shouldRenderPrefix && React.createElement(S.PrefixelWrapper, {
|
|
142
|
+
}, shouldRenderPrefix && /*#__PURE__*/React.createElement(S.PrefixelWrapper, {
|
|
156
143
|
className: "ds-menu-prefix",
|
|
157
144
|
visible: shouldRenderPrefix,
|
|
158
145
|
disabled: disabled
|
|
159
|
-
}, renderPrefixElement(hovered)), React.createElement(S.Content, {
|
|
146
|
+
}, renderPrefixElement(hovered)), /*#__PURE__*/React.createElement(S.Content, {
|
|
160
147
|
className: "ds-menu-content",
|
|
161
148
|
highlight: !!highlight
|
|
162
|
-
}, canCopyToClipboard && hovered ? copyHint : renderChildren(), !!description && React.createElement(S.Description, null, description)), parent && React.createElement(S.ArrowRight, {
|
|
149
|
+
}, canCopyToClipboard && hovered ? copyHint : renderChildren(), !!description && /*#__PURE__*/React.createElement(S.Description, null, description)), parent && /*#__PURE__*/React.createElement(S.ArrowRight, {
|
|
163
150
|
disabled: disabled
|
|
164
|
-
}, React.createElement(Icon, {
|
|
165
|
-
component: React.createElement(AngleRightS, null),
|
|
151
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
152
|
+
component: /*#__PURE__*/React.createElement(AngleRightS, null),
|
|
166
153
|
color: theme.palette['grey-600']
|
|
167
|
-
})), React.createElement(S.ContentDivider, null), (!!suffixElement || !!checked) && React.createElement(S.SuffixWraper, {
|
|
154
|
+
})), /*#__PURE__*/React.createElement(S.ContentDivider, null), (!!suffixElement || !!checked) && /*#__PURE__*/React.createElement(S.SuffixWraper, {
|
|
168
155
|
visible: shouldRenderSuffix,
|
|
169
156
|
disabled: disabled
|
|
170
|
-
}, !!checked && React.createElement(Icon, {
|
|
171
|
-
component: React.createElement(CheckS, null),
|
|
157
|
+
}, !!checked && /*#__PURE__*/React.createElement(Icon, {
|
|
158
|
+
component: /*#__PURE__*/React.createElement(CheckS, null),
|
|
172
159
|
color: theme.palette["green-600"]
|
|
173
160
|
}), suffixElement)))))
|
|
174
161
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import MenuItem from 'antd/lib/menu/MenuItem';
|
|
3
|
-
import { IconContainer } from '@synerise/ds-icon
|
|
3
|
+
import { IconContainer } from '@synerise/ds-icon';
|
|
4
4
|
var ItemSize;
|
|
5
5
|
|
|
6
6
|
(function (ItemSize) {
|
|
@@ -40,7 +40,7 @@ export var PrefixelWrapper = styled.div.withConfig({
|
|
|
40
40
|
})(["display:flex;", ";transition:opacity ", ";margin-top:-7px;margin-bottom:-7px;margin-left:-4px;margin-right:12px;align-items:center;", ""], function (props) {
|
|
41
41
|
return props.visible ? visibleElementStyle() : hiddenElementStyle();
|
|
42
42
|
}, TRANSITION_FN, function (props) {
|
|
43
|
-
return !!props.disabled && "svg {fill: "
|
|
43
|
+
return !!props.disabled && "svg {fill: " + props.theme.palette['grey-600'] + "};";
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
var disableOrdering = function disableOrdering() {
|
|
@@ -77,7 +77,7 @@ export var Wrapper = styled(MenuItem).withConfig({
|
|
|
77
77
|
}, TRANSITION_FN, function (props) {
|
|
78
78
|
return props.prefixel ? '8' : '12';
|
|
79
79
|
}, Inner, function (props) {
|
|
80
|
-
return
|
|
80
|
+
return calculateIndent(props.indentLevel) + "px ";
|
|
81
81
|
}, function (props) {
|
|
82
82
|
return props.disabled ? "\n & > * {\n pointer-events: none\n }" : '';
|
|
83
83
|
}, function (props) {
|
|
@@ -99,7 +99,7 @@ export var Wrapper = styled(MenuItem).withConfig({
|
|
|
99
99
|
}, function (props) {
|
|
100
100
|
return props.theme.palette['grey-800'];
|
|
101
101
|
}, function (props) {
|
|
102
|
-
return !props.disabled && "inset 0 0 0 2px "
|
|
102
|
+
return !props.disabled && "inset 0 0 0 2px " + props.theme.palette['blue-600'] + " ";
|
|
103
103
|
}, function (props) {
|
|
104
104
|
return props.theme.palette['grey-700'];
|
|
105
105
|
}, function (props) {
|
|
@@ -111,15 +111,15 @@ export var Wrapper = styled(MenuItem).withConfig({
|
|
|
111
111
|
}, function (props) {
|
|
112
112
|
return props.theme.palette['blue-050'];
|
|
113
113
|
}, PrefixelWrapper, function (props) {
|
|
114
|
-
return !props.disabled && "\n fill: "
|
|
114
|
+
return !props.disabled && "\n fill: " + props.theme.palette['grey-600'] + ";\n ";
|
|
115
115
|
}, function (props) {
|
|
116
|
-
return props.description ?
|
|
116
|
+
return props.description ? props.theme.palette['blue-600'] + " !important" : 'inherit';
|
|
117
117
|
}, ArrowRight, function (props) {
|
|
118
118
|
return props.disabled ? props.theme.palette['grey-700'] : props.theme.palette['blue-600'];
|
|
119
119
|
}, ArrowRight, function (props) {
|
|
120
120
|
return props.disabled ? props.theme.palette['grey-600'] : props.theme.palette['blue-600'];
|
|
121
121
|
}, function (props) {
|
|
122
|
-
return !props.disabled && "\n .ds-menu-prefix { "
|
|
122
|
+
return !props.disabled && "\n .ds-menu-prefix { " + IconContainer + " > svg {\n fill: " + props.theme.palette['blue-600'] + " !important;\n }}\n color: " + props.theme.palette['blue-600'] + " !important;\n background: " + props.theme.palette['grey-050'] + ";\n ";
|
|
123
123
|
});
|
|
124
124
|
export var Content = styled.div.withConfig({
|
|
125
125
|
displayName: "Textstyles__Content",
|
|
@@ -139,7 +139,7 @@ export var SuffixWraper = styled.div.withConfig({
|
|
|
139
139
|
})(["justify-content:flex-end;display:flex;transition:opacity ", ";", ";", ";svg{margin-right:-4px;}"], TRANSITION_FN, function (props) {
|
|
140
140
|
return props.visible ? visibleElementStyle() : hiddenElementStyle();
|
|
141
141
|
}, function (props) {
|
|
142
|
-
return !!props.disabled && "svg {\n fill:"
|
|
142
|
+
return !!props.disabled && "svg {\n fill:" + props.theme.palette['grey-600'] + "\n }\n ";
|
|
143
143
|
});
|
|
144
144
|
export var ContentWrapper = styled.div.withConfig({
|
|
145
145
|
displayName: "Textstyles__ContentWrapper",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,30 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["text", "prefixel", "suffixel", "subMenu", "disabled", "danger", "ordered", "onTitleClick", "menuItemKey", "selectedKeys", "suffixVisibilityTrigger", "prefixVisibilityTrigger", "size", "description"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
-
|
|
7
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
6
|
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
12
|
-
|
|
13
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
14
|
-
|
|
15
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
16
|
-
|
|
17
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
18
|
-
|
|
19
|
-
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
20
|
-
|
|
21
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
22
|
-
|
|
23
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
24
|
-
|
|
25
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
26
|
-
|
|
27
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
7
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
28
8
|
|
|
29
9
|
import * as React from 'react';
|
|
30
10
|
import { v4 as uuid } from 'uuid';
|
|
@@ -35,16 +15,12 @@ import MenuItem from '../Item/MenuItem';
|
|
|
35
15
|
import SubmenuText from '../Item/SubmenuText/SubmenuText';
|
|
36
16
|
|
|
37
17
|
var SubMenuItem = /*#__PURE__*/function (_React$PureComponent) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var _super = _createSuper(SubMenuItem);
|
|
18
|
+
_inheritsLoose(SubMenuItem, _React$PureComponent);
|
|
41
19
|
|
|
42
20
|
function SubMenuItem(props) {
|
|
43
21
|
var _this;
|
|
44
22
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
_this = _super.call(this, props); // eslint-disable-next-line react/state-in-constructor
|
|
23
|
+
_this = _React$PureComponent.call(this, props) || this; // eslint-disable-next-line react/state-in-constructor
|
|
48
24
|
|
|
49
25
|
_this.state = {
|
|
50
26
|
uuidKey: uuid()
|
|
@@ -52,76 +28,75 @@ var SubMenuItem = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
52
28
|
return _this;
|
|
53
29
|
}
|
|
54
30
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
disabled: disabled,
|
|
83
|
-
suffixVisibilityTrigger: suffixVisibilityTrigger,
|
|
84
|
-
prefixVisibilityTrigger: prefixVisibilityTrigger,
|
|
85
|
-
size: size,
|
|
86
|
-
description: description
|
|
87
|
-
}, text),
|
|
88
|
-
key: menuItemKey || uuidKey,
|
|
89
|
-
onTitleClick: onTitleClick,
|
|
90
|
-
danger: danger,
|
|
91
|
-
ordered: ordered,
|
|
31
|
+
var _proto = SubMenuItem.prototype;
|
|
32
|
+
|
|
33
|
+
_proto.render = function render() {
|
|
34
|
+
var _this$props = this.props,
|
|
35
|
+
text = _this$props.text,
|
|
36
|
+
prefixel = _this$props.prefixel,
|
|
37
|
+
suffixel = _this$props.suffixel,
|
|
38
|
+
subMenu = _this$props.subMenu,
|
|
39
|
+
disabled = _this$props.disabled,
|
|
40
|
+
danger = _this$props.danger,
|
|
41
|
+
ordered = _this$props.ordered,
|
|
42
|
+
onTitleClick = _this$props.onTitleClick,
|
|
43
|
+
menuItemKey = _this$props.menuItemKey,
|
|
44
|
+
selectedKeys = _this$props.selectedKeys,
|
|
45
|
+
suffixVisibilityTrigger = _this$props.suffixVisibilityTrigger,
|
|
46
|
+
prefixVisibilityTrigger = _this$props.prefixVisibilityTrigger,
|
|
47
|
+
size = _this$props.size,
|
|
48
|
+
description = _this$props.description,
|
|
49
|
+
rest = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
50
|
+
|
|
51
|
+
var uuidKey = this.state.uuidKey;
|
|
52
|
+
return /*#__PURE__*/React.createElement(S.SubMenuItem, _extends({
|
|
53
|
+
title: /*#__PURE__*/React.createElement(SubmenuText, {
|
|
54
|
+
key: (menuItemKey || uuidKey) + "-title",
|
|
55
|
+
prefixel: prefixel,
|
|
56
|
+
suffixel: suffixel,
|
|
57
|
+
onClick: onTitleClick,
|
|
92
58
|
disabled: disabled,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
59
|
+
suffixVisibilityTrigger: suffixVisibilityTrigger,
|
|
60
|
+
prefixVisibilityTrigger: prefixVisibilityTrigger,
|
|
61
|
+
size: size,
|
|
62
|
+
description: description
|
|
63
|
+
}, text),
|
|
64
|
+
key: menuItemKey || uuidKey,
|
|
65
|
+
onTitleClick: onTitleClick,
|
|
66
|
+
danger: danger,
|
|
67
|
+
ordered: ordered,
|
|
68
|
+
disabled: disabled,
|
|
69
|
+
tabIndex: !disabled ? 0 : -1
|
|
70
|
+
}, rest, {
|
|
71
|
+
className: classNames('ds-menu-item', {
|
|
72
|
+
'ant-menu-item-selected': !!menuItemKey && !!selectedKeys && selectedKeys.includes(menuItemKey)
|
|
73
|
+
})
|
|
74
|
+
}), Boolean(subMenu) && // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
75
|
+
// @ts-ignore */
|
|
76
|
+
subMenu.map(function (subItem, index) {
|
|
77
|
+
return /*#__PURE__*/React.createElement(MenuItem, _extends({
|
|
78
|
+
parent: subItem.parent,
|
|
79
|
+
prefixel: subItem.prefixel,
|
|
80
|
+
suffixel: subItem.suffixel,
|
|
81
|
+
disabled: subItem.disabled,
|
|
82
|
+
text: subItem.text,
|
|
83
|
+
danger: subItem.danger,
|
|
84
|
+
subMenu: subItem.subMenu,
|
|
85
|
+
ordered: subItem.ordered === undefined ? ordered : subItem.ordered,
|
|
86
|
+
description: subItem.description,
|
|
87
|
+
suffixVisibilityTrigger: subItem.suffixVisibilityTrigger,
|
|
88
|
+
prefixVisibilityTrigger: subItem.prefixVisibilityTrigger // eslint-disable-next-line react/jsx-handler-names
|
|
89
|
+
,
|
|
90
|
+
onClick: function onClick() {
|
|
91
|
+
subItem.onClick && subItem.onClick(subItem);
|
|
92
|
+
},
|
|
93
|
+
key: subItem.key || uuidKey + "-" + index // eslint-disable-line react/no-array-index-key
|
|
94
|
+
,
|
|
95
|
+
menuItemKey: subItem.key || uuidKey + "-" + index,
|
|
96
|
+
selectedKeys: selectedKeys
|
|
97
|
+
}, subItem));
|
|
98
|
+
}));
|
|
99
|
+
};
|
|
125
100
|
|
|
126
101
|
return SubMenuItem;
|
|
127
102
|
}(React.PureComponent);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/Menu.js
CHANGED
|
@@ -1,30 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["dataSource", "ordered", "selectable", "children", "showTextTooltip"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
-
|
|
7
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
6
|
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
12
|
-
|
|
13
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
14
|
-
|
|
15
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
16
|
-
|
|
17
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
18
|
-
|
|
19
|
-
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
20
|
-
|
|
21
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
22
|
-
|
|
23
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
24
|
-
|
|
25
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
7
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
26
8
|
|
|
27
|
-
function
|
|
9
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
28
10
|
|
|
29
11
|
import * as React from 'react';
|
|
30
12
|
import '@synerise/ds-core/dist/js/style';
|
|
@@ -37,88 +19,89 @@ import Breadcrumb from './Elements/Breadcrumb/Breadcrumb';
|
|
|
37
19
|
import Header from './Elements/Header/Header';
|
|
38
20
|
|
|
39
21
|
var Menu = /*#__PURE__*/function (_React$Component) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var _super = _createSuper(Menu);
|
|
22
|
+
_inheritsLoose(Menu, _React$Component);
|
|
43
23
|
|
|
44
24
|
function Menu() {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return _super.apply(this, arguments);
|
|
25
|
+
return _React$Component.apply(this, arguments) || this;
|
|
48
26
|
}
|
|
49
27
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}]);
|
|
28
|
+
var _proto = Menu.prototype;
|
|
29
|
+
|
|
30
|
+
_proto.render = function render() {
|
|
31
|
+
var _this$props = this.props,
|
|
32
|
+
dataSource = _this$props.dataSource,
|
|
33
|
+
ordered = _this$props.ordered,
|
|
34
|
+
selectable = _this$props.selectable,
|
|
35
|
+
children = _this$props.children,
|
|
36
|
+
showTextTooltip = _this$props.showTextTooltip,
|
|
37
|
+
rest = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
38
|
+
|
|
39
|
+
return /*#__PURE__*/React.createElement(S.AntdMenu, _extends({
|
|
40
|
+
ordered: ordered,
|
|
41
|
+
mode: "inline",
|
|
42
|
+
inlineIndent: ordered ? 20 : 18
|
|
43
|
+
}, rest, {
|
|
44
|
+
selectable: selectable === undefined ? false : selectable
|
|
45
|
+
}), children || (dataSource == null ? void 0 : dataSource.map(function (item, index) {
|
|
46
|
+
return item.subMenu ? /*#__PURE__*/React.createElement(SubMenuItem, _extends({
|
|
47
|
+
parent: item.parent,
|
|
48
|
+
prefixel: item.prefixel,
|
|
49
|
+
suffixel: item.suffixel,
|
|
50
|
+
disabled: item.disabled,
|
|
51
|
+
text: showTextTooltip ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
52
|
+
title: item.text
|
|
53
|
+
}, item.text) : item.text,
|
|
54
|
+
description: item.description,
|
|
55
|
+
subMenu: item.subMenu,
|
|
56
|
+
ordered: item.ordered === undefined ? ordered : item.ordered,
|
|
57
|
+
copyable: item.copyable,
|
|
58
|
+
copyHint: item.copyHint,
|
|
59
|
+
copyValue: item.copyValue,
|
|
60
|
+
suffixVisibilityTrigger: item.suffixVisibilityTrigger,
|
|
61
|
+
prefixVisibilityTrigger: item.prefixVisibilityTrigger,
|
|
62
|
+
key: item.key || "" + item.text + index // eslint-disable-line react/no-array-index-key
|
|
63
|
+
,
|
|
64
|
+
menuItemKey: item.key || "" + item.text + index
|
|
65
|
+
}, rest, item)) : /*#__PURE__*/React.createElement(MenuItem, _extends({
|
|
66
|
+
className: "ds-menu-item",
|
|
67
|
+
parent: item.parent,
|
|
68
|
+
prefixel: item.prefixel,
|
|
69
|
+
suffixel: item.suffixel,
|
|
70
|
+
disabled: item.disabled,
|
|
71
|
+
text: showTextTooltip ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
72
|
+
title: item.text
|
|
73
|
+
}, item.text) : item.text,
|
|
74
|
+
description: item.description,
|
|
75
|
+
subMenu: item.subMenu,
|
|
76
|
+
ordered: item.ordered === undefined ? ordered : item.ordered,
|
|
77
|
+
copyable: item.copyable,
|
|
78
|
+
copyHint: item.copyHint,
|
|
79
|
+
copyValue: item.copyValue,
|
|
80
|
+
highlight: item.highlight,
|
|
81
|
+
suffixVisibilityTrigger: item.suffixVisibilityTrigger,
|
|
82
|
+
prefixVisibilityTrigger: item.prefixVisibilityTrigger,
|
|
83
|
+
indentLevel: item.indentLevel || 0,
|
|
84
|
+
type: item.type,
|
|
85
|
+
key: item.key || "" + item.text + index // eslint-disable-line react/no-array-index-key
|
|
86
|
+
,
|
|
87
|
+
menuItemKey: item.key || "" + item.text + index
|
|
88
|
+
}, rest, item));
|
|
89
|
+
})));
|
|
90
|
+
};
|
|
114
91
|
|
|
115
92
|
return Menu;
|
|
116
93
|
}(React.Component);
|
|
117
94
|
|
|
118
|
-
Menu
|
|
119
|
-
|
|
120
|
-
Menu
|
|
121
|
-
|
|
122
|
-
Menu
|
|
123
|
-
|
|
95
|
+
_defineProperty(Menu, "Item", MenuItem);
|
|
96
|
+
|
|
97
|
+
_defineProperty(Menu, "Breadcrumb", Breadcrumb);
|
|
98
|
+
|
|
99
|
+
_defineProperty(Menu, "Header", Header);
|
|
100
|
+
|
|
101
|
+
_defineProperty(Menu, "ItemGroup", S.AntdMenu.ItemGroup);
|
|
102
|
+
|
|
103
|
+
_defineProperty(Menu, "SubMenu", S.AntdMenu.SubMenu);
|
|
104
|
+
|
|
105
|
+
_defineProperty(Menu, "Divider", S.MenuDivider);
|
|
106
|
+
|
|
124
107
|
export default Menu;
|
package/dist/Menu.styles.js
CHANGED
|
@@ -4,7 +4,7 @@ var overflowStyles = css(["text-overflow:ellipsis;overflow:hidden;white-space:no
|
|
|
4
4
|
|
|
5
5
|
var arrowDownSvgWithCustomColor = function arrowDownSvgWithCustomColor(color) {
|
|
6
6
|
var colorValueForSvg = color.replace(/#/, '%23');
|
|
7
|
-
var iconWithColor = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' >/><path fill='none' d='M0 0h24v24H0z' /><path style='fill: "
|
|
7
|
+
var iconWithColor = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' >/><path fill='none' d='M0 0h24v24H0z' /><path style='fill: " + colorValueForSvg + ";' d='M14.71973,9.84473,12,12.56445,9.28027,9.84473a.74992.74992,0,0,0-1.06054,1.06054l3.25,3.25a.74971.74971,0,0,0,1.06054,0l3.25-3.25a.74992.74992,0,0,0-1.06054-1.06054Z'/></svg>";
|
|
8
8
|
return iconWithColor;
|
|
9
9
|
};
|
|
10
10
|
|
|
@@ -12,11 +12,11 @@ export var MenuDivider = styled.div.withConfig({
|
|
|
12
12
|
displayName: "Menustyles__MenuDivider",
|
|
13
13
|
componentId: "sc-10eu0qe-0"
|
|
14
14
|
})(["height:1px;width:", ";margin:", " ", ";border-top:1px dashed ", ";"], function (props) {
|
|
15
|
-
return
|
|
15
|
+
return props != null && props.level && (props == null ? void 0 : props.level) > 1 ? '75%' : '100%';
|
|
16
16
|
}, function (props) {
|
|
17
17
|
return props.higher ? '16px' : '8px';
|
|
18
18
|
}, function (props) {
|
|
19
|
-
return
|
|
19
|
+
return props != null && props.level && (props == null ? void 0 : props.level) > 1 ? '35px' : '0px';
|
|
20
20
|
}, function (props) {
|
|
21
21
|
return props.theme.palette['grey-300'];
|
|
22
22
|
});
|
|
@@ -52,7 +52,7 @@ export var SubMenuItem = styled(Menu.SubMenu).withConfig({
|
|
|
52
52
|
}, function (props) {
|
|
53
53
|
return props.theme.palette['blue-600'];
|
|
54
54
|
}, function (props) {
|
|
55
|
-
return !props.disabled && "\n &:focus {\n > .ant-menu-submenu-title{\n box-shadow: inset 0 0 0 2px "
|
|
55
|
+
return !props.disabled && "\n &:focus {\n > .ant-menu-submenu-title{\n box-shadow: inset 0 0 0 2px " + props.theme.palette['blue-600'] + ";\n }\n }\n ";
|
|
56
56
|
}, function (props) {
|
|
57
57
|
return props.theme.palette['blue-600'];
|
|
58
58
|
}, function (props) {
|
|
@@ -82,5 +82,5 @@ export var SubMenuItem = styled(Menu.SubMenu).withConfig({
|
|
|
82
82
|
}, function (props) {
|
|
83
83
|
return props.disabled ? "\n > * {\n pointer-events:none;\n }" : "";
|
|
84
84
|
}, function (props) {
|
|
85
|
-
return !props.disabled && "\n color: "
|
|
85
|
+
return !props.disabled && "\n color: " + (props.danger ? props.theme.palette['red-600'] : props.theme.palette['blue-600']) + ";\n background: " + (props.danger ? props.theme.palette['red-050'] : props.theme.palette['grey-050']) + ";\n ";
|
|
86
86
|
});
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-menu",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"description": "Menu UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
],
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@synerise/ds-icon": "^0.
|
|
36
|
-
"@synerise/ds-tooltip": "^0.
|
|
37
|
-
"@synerise/ds-typography": "^0.
|
|
35
|
+
"@synerise/ds-icon": "^0.46.2",
|
|
36
|
+
"@synerise/ds-tooltip": "^0.11.2",
|
|
37
|
+
"@synerise/ds-typography": "^0.12.2",
|
|
38
38
|
"classnames": "^2.2.6"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@synerise/ds-core": "*",
|
|
42
42
|
"react": ">=16.9.0 < 17.0.0"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "dd78d8abea639d2d77cf841f8b41a1382cf8d827"
|
|
45
45
|
}
|