@decisiv/ui-components 2.0.1-alpha.8 → 2.0.1-alpha.82
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/lib/atoms/BaseButton/index.d.ts.map +1 -1
- package/lib/atoms/BaseButton/index.js +1 -1
- package/lib/atoms/BooleanInput/index.d.ts.map +1 -1
- package/lib/atoms/BooleanInput/index.js +19 -2
- package/lib/atoms/BooleanInput/index.test.js +17 -6
- package/lib/atoms/BooleanInput/types.d.ts +2 -0
- package/lib/atoms/BooleanInput/types.d.ts.map +1 -1
- package/lib/atoms/Calendar/hooks/useCalendar/index.d.ts.map +1 -1
- package/lib/atoms/Calendar/hooks/useCalendar/index.js +2 -1
- package/lib/atoms/Calendar/hooks/useCalendar/index.test.js +5 -6
- package/lib/atoms/Calendar/index.d.ts.map +1 -1
- package/lib/atoms/Calendar/index.js +8 -1
- package/lib/atoms/Calendar/index.test.js +70 -40
- package/lib/atoms/InputField/Containers.d.ts +10 -6
- package/lib/atoms/InputField/Containers.d.ts.map +1 -1
- package/lib/atoms/InputField/Containers.js +6 -6
- package/lib/atoms/InputField/InputLabel.d.ts +1 -0
- package/lib/atoms/InputField/InputLabel.d.ts.map +1 -1
- package/lib/atoms/InputField/InputLabel.js +2 -1
- package/lib/atoms/InputField/index.d.ts +4 -0
- package/lib/atoms/InputField/index.d.ts.map +1 -1
- package/lib/atoms/InputField/index.js +18 -7
- package/lib/atoms/InputField/index.test.js +91 -0
- package/lib/atoms/InputField/schema.d.ts.map +1 -1
- package/lib/atoms/InputField/schema.js +1 -0
- package/lib/atoms/OptionsList/Category.d.ts +1 -1
- package/lib/atoms/OptionsList/Category.d.ts.map +1 -1
- package/lib/atoms/OptionsList/Category.js +4 -2
- package/lib/atoms/OptionsList/Footer.d.ts +8 -0
- package/lib/atoms/OptionsList/Footer.d.ts.map +1 -0
- package/lib/atoms/OptionsList/Footer.js +72 -0
- package/lib/atoms/OptionsList/Option.d.ts.map +1 -1
- package/lib/atoms/OptionsList/Option.js +8 -5
- package/lib/atoms/OptionsList/index.d.ts.map +1 -1
- package/lib/atoms/OptionsList/index.js +43 -16
- package/lib/atoms/OptionsList/index.test.js +107 -11
- package/lib/atoms/OptionsList/schema.d.ts.map +1 -1
- package/lib/atoms/OptionsList/schema.js +4 -0
- package/lib/atoms/OptionsList/types.d.ts +14 -0
- package/lib/atoms/OptionsList/types.d.ts.map +1 -1
- package/lib/atoms/RequiredIcon.d.ts +9 -0
- package/lib/atoms/RequiredIcon.d.ts.map +1 -0
- package/lib/atoms/{InputField/RequiredIcon.js → RequiredIcon.js} +7 -3
- package/lib/components/Button/schema.d.ts +6 -1
- package/lib/components/Button/schema.d.ts.map +1 -1
- package/lib/components/Button/schema.js +9 -4
- package/lib/components/Checkbox/index.d.ts.map +1 -1
- package/lib/components/Checkbox/index.js +3 -1
- package/lib/components/Checkbox/schema.d.ts.map +1 -1
- package/lib/components/Checkbox/schema.js +2 -0
- package/lib/components/Combobox/Target.d.ts.map +1 -1
- package/lib/components/Combobox/Target.js +45 -14
- package/lib/components/Combobox/index.d.ts.map +1 -1
- package/lib/components/Combobox/index.js +182 -64
- package/lib/components/Combobox/index.test.js +358 -135
- package/lib/components/Combobox/schema.d.ts.map +1 -1
- package/lib/components/Combobox/schema.js +9 -2
- package/lib/components/Combobox/types.d.ts +12 -3
- package/lib/components/Combobox/types.d.ts.map +1 -1
- package/lib/components/DropdownList/index.d.ts +4 -0
- package/lib/components/DropdownList/index.d.ts.map +1 -1
- package/lib/components/DropdownList/index.js +76 -11
- package/lib/components/DropdownList/propTypes.d.ts +4 -0
- package/lib/components/DropdownList/propTypes.d.ts.map +1 -0
- package/lib/components/DropdownList/propTypes.js +42 -0
- package/lib/components/DropdownList/schema.d.ts.map +1 -1
- package/lib/components/DropdownList/schema.js +5 -0
- package/lib/components/DropdownList/types.d.ts +4 -1
- package/lib/components/DropdownList/types.d.ts.map +1 -1
- package/lib/components/Filter/IconWrapper/index.d.ts +197 -0
- package/lib/components/Filter/IconWrapper/index.d.ts.map +1 -0
- package/lib/components/Filter/IconWrapper/index.js +35 -0
- package/lib/components/Filter/SimplePrimary/index.d.ts +31 -0
- package/lib/components/Filter/SimplePrimary/index.d.ts.map +1 -0
- package/lib/components/Filter/SimplePrimary/index.js +58 -0
- package/lib/components/Filter/SimplePrimary/index.test.js +34 -0
- package/lib/components/Filter/StyledFilter.d.ts +4 -0
- package/lib/components/Filter/StyledFilter.d.ts.map +1 -0
- package/lib/components/Filter/StyledFilter.js +39 -0
- package/lib/components/Filter/StyledLabel/index.d.ts +8 -0
- package/lib/components/Filter/StyledLabel/index.d.ts.map +1 -0
- package/lib/components/Filter/StyledLabel/index.js +30 -0
- package/lib/components/Filter/index.d.ts +27 -0
- package/lib/components/Filter/index.d.ts.map +1 -0
- package/lib/components/Filter/index.js +95 -0
- package/lib/components/Filter/index.test.js +41 -0
- package/lib/components/Filter/kind.d.ts +6 -0
- package/lib/components/Filter/kind.d.ts.map +1 -0
- package/lib/components/Filter/kind.js +45 -0
- package/lib/components/Filter/schema.d.ts +9 -0
- package/lib/components/Filter/schema.d.ts.map +1 -0
- package/lib/components/Filter/schema.js +32 -0
- package/lib/components/Filter/types.d.ts +17 -0
- package/lib/components/Filter/types.d.ts.map +1 -0
- package/lib/components/Filter/types.js +1 -0
- package/lib/components/LeftNav/Item/ClickArea.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/ClickArea.js +2 -2
- package/lib/components/LeftNav/Item/ItemWrapper.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/ItemWrapper.js +3 -3
- package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts +7 -0
- package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts.map +1 -0
- package/lib/components/LeftNav/Item/MenuItemWrapper.js +20 -0
- package/lib/components/LeftNav/Item/NavCollapsedXItem/index.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/NavCollapsedXItem/index.js +7 -5
- package/lib/components/LeftNav/Item/NavExpandedItem/index.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/NavExpandedItem/index.js +24 -13
- package/lib/components/LeftNav/Item/types.d.ts +1 -1
- package/lib/components/LeftNav/Item/types.d.ts.map +1 -1
- package/lib/components/LeftNav/index.test.js +13 -3
- package/lib/components/LeftNav/schema.d.ts.map +1 -1
- package/lib/components/LeftNav/schema.js +2 -0
- package/lib/components/LeftNav/types.d.ts +1 -0
- package/lib/components/LeftNav/types.d.ts.map +1 -1
- package/lib/components/Menu/index.d.ts.map +1 -1
- package/lib/components/Menu/index.js +3 -1
- package/lib/components/Menu/types.d.ts +2 -0
- package/lib/components/Menu/types.d.ts.map +1 -1
- package/lib/components/Modal/components.d.ts +2 -2
- package/lib/components/Modal/index.d.ts.map +1 -1
- package/lib/components/Modal/index.js +5 -5
- package/lib/components/Modal/index.test.js +32 -0
- package/lib/components/Modal/schema.d.ts.map +1 -1
- package/lib/components/Modal/schema.js +2 -2
- package/lib/components/Modal/types.d.ts +2 -2
- package/lib/components/Modal/types.d.ts.map +1 -1
- package/lib/components/Notifications/Notification/components.d.ts +3 -3
- package/lib/components/Notifications/Notification/components.d.ts.map +1 -1
- package/lib/components/Notifications/Notification/components.js +12 -6
- package/lib/components/Notifications/Notification/index.d.ts +3 -6
- package/lib/components/Notifications/Notification/index.d.ts.map +1 -1
- package/lib/components/Notifications/Notification/index.js +19 -12
- package/lib/components/Notifications/Notification/index.test.js +38 -19
- package/lib/components/Notifications/NotificationsPanel/index.d.ts +2 -1
- package/lib/components/Notifications/NotificationsPanel/index.d.ts.map +1 -1
- package/lib/components/Notifications/NotificationsPanel/index.js +44 -21
- package/lib/components/Notifications/NotificationsPanel/schema.js +1 -1
- package/lib/components/Notifications/Notifier.test.js +79 -10
- package/lib/components/Notifications/constants.d.ts +2 -0
- package/lib/components/Notifications/constants.d.ts.map +1 -0
- package/lib/components/Notifications/constants.js +16 -0
- package/lib/components/Notifications/schema.d.ts.map +1 -1
- package/lib/components/Notifications/schema.js +2 -1
- package/lib/components/Notifications/useNotifications.d.ts +1 -0
- package/lib/components/Notifications/useNotifications.d.ts.map +1 -1
- package/lib/components/Notifications/useNotifications.js +3 -3
- package/lib/components/Notifications/useNotifications.test.js +7 -4
- package/lib/components/Pagination/Pagination.d.ts +1 -1
- package/lib/components/Pagination/Pagination.d.ts.map +1 -1
- package/lib/components/Pagination/Pagination.js +1 -0
- package/lib/components/Pagination/Pagination.test.js +9 -0
- package/lib/components/Popover/utils.d.ts +1 -1
- package/lib/components/Select/Target.js +1 -1
- package/lib/components/Select/index.d.ts.map +1 -1
- package/lib/components/Select/index.js +20 -1
- package/lib/components/Select/index.test.js +31 -9
- package/lib/components/Select/schema.d.ts.map +1 -1
- package/lib/components/Select/schema.js +5 -0
- package/lib/components/Select/types.d.ts +2 -1
- package/lib/components/Select/types.d.ts.map +1 -1
- package/lib/components/SelectDate/Target.js +1 -1
- package/lib/components/SelectDate/index.test.js +71 -51
- package/lib/components/SelectDateRange/index.test.js +78 -58
- package/lib/components/SelectMenu/index.d.ts +5 -0
- package/lib/components/SelectMenu/index.d.ts.map +1 -1
- package/lib/components/SelectMenu/index.js +27 -3
- package/lib/components/SelectMenu/schema.d.ts.map +1 -1
- package/lib/components/SelectMenu/schema.js +4 -0
- package/lib/components/Table/Body.d.ts.map +1 -1
- package/lib/components/Table/Body.js +182 -38
- package/lib/components/Table/Container.d.ts.map +1 -1
- package/lib/components/Table/Container.js +2 -2
- package/lib/components/Table/DataRow.d.ts.map +1 -1
- package/lib/components/Table/DataRow.js +43 -16
- package/lib/components/Table/DraggableWrapper.d.ts +5 -0
- package/lib/components/Table/DraggableWrapper.d.ts.map +1 -0
- package/lib/components/Table/DraggableWrapper.js +38 -0
- package/lib/components/Table/Grip.d.ts +4 -0
- package/lib/components/Table/Grip.d.ts.map +1 -0
- package/lib/components/Table/Grip.js +30 -0
- package/lib/components/Table/Head.d.ts +1 -1
- package/lib/components/Table/Head.d.ts.map +1 -1
- package/lib/components/Table/Head.js +11 -5
- package/lib/components/Table/HeaderCell/index.d.ts.map +1 -1
- package/lib/components/Table/HeaderCell/index.js +22 -8
- package/lib/components/Table/HeaderCell/types.d.ts +6 -1
- package/lib/components/Table/HeaderCell/types.d.ts.map +1 -1
- package/lib/components/Table/Provider.d.ts +13 -4
- package/lib/components/Table/Provider.d.ts.map +1 -1
- package/lib/components/Table/Provider.js +45 -5
- package/lib/components/Table/index.d.ts.map +1 -1
- package/lib/components/Table/index.js +112 -18
- package/lib/components/Table/index.test.js +330 -84
- package/lib/components/Table/schema.columns.d.ts.map +1 -1
- package/lib/components/Table/schema.columns.js +6 -4
- package/lib/components/Table/schema.d.ts.map +1 -1
- package/lib/components/Table/schema.js +8 -6
- package/lib/components/Table/types.d.ts +34 -4
- package/lib/components/Table/types.d.ts.map +1 -1
- package/lib/components/Table/utils.d.ts +2 -8
- package/lib/components/Table/utils.d.ts.map +1 -1
- package/lib/components/Table/utils.js +21 -20
- package/lib/components/Tag/types.d.ts +1 -1
- package/lib/components/Tag/types.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.js +1 -1
- package/lib/components/TextArea/index.js +1 -0
- package/lib/components/TextArea/index.test.js +5 -0
- package/lib/components/TextField/Input.js +1 -1
- package/lib/components/TextField/index.test.js +5 -0
- package/lib/components/Toggle/index.d.ts.map +1 -1
- package/lib/components/Toggle/index.js +4 -0
- package/lib/components/Toggle/index.test.js +39 -10
- package/lib/components/TopNav/BrandInfo/index.d.ts +2 -1
- package/lib/components/TopNav/BrandInfo/index.d.ts.map +1 -1
- package/lib/components/TopNav/BrandInfo/index.js +9 -1
- package/lib/components/TopNav/BrandInfo/schema.d.ts.map +1 -1
- package/lib/components/TopNav/BrandInfo/schema.js +4 -1
- package/lib/components/TopNav/index.test.js +28 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +9 -0
- package/lib/providers/ConfigProvider/index.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/index.js +5 -1
- package/lib/providers/ConfigProvider/utils/context.d.ts +1 -1
- package/lib/providers/ConfigProvider/utils/context.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/normalizer.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/normalizer.js +1 -1
- package/lib/providers/ConfigProvider/utils/translations.d.ts +1 -1
- package/lib/providers/ConfigProvider/utils/translations.js +1 -1
- package/lib/providers/NotificationsProvider/index.d.ts +6 -5
- package/lib/providers/NotificationsProvider/index.d.ts.map +1 -1
- package/lib/providers/NotificationsProvider/index.js +47 -28
- package/lib/providers/NotificationsProvider/types.d.ts +4 -1
- package/lib/providers/NotificationsProvider/types.d.ts.map +1 -1
- package/lib/utils/joinClassnames.d.ts +3 -0
- package/lib/utils/joinClassnames.d.ts.map +1 -0
- package/lib/utils/joinClassnames.js +26 -0
- package/package.json +4 -2
- package/lib/atoms/InputField/RequiredIcon.d.ts +0 -4
- package/lib/atoms/InputField/RequiredIcon.d.ts.map +0 -1
|
@@ -88,11 +88,12 @@ function MenuItem(props) {
|
|
|
88
88
|
|
|
89
89
|
if (kind === 'MenuItemTopLink') {
|
|
90
90
|
var _ref2 = item,
|
|
91
|
-
Icon = _ref2.icon
|
|
91
|
+
Icon = _ref2.icon,
|
|
92
|
+
selected = _ref2.active;
|
|
92
93
|
|
|
93
94
|
var _to = (0, _utils.isMenuItemInternalLink)(item) ? item.path : item.url;
|
|
94
95
|
|
|
95
|
-
var _active = !disabled && currentPath === _to;
|
|
96
|
+
var _active = !disabled && (currentPath === _to || selected);
|
|
96
97
|
|
|
97
98
|
return _react.default.createElement(_ItemWrapper.default, {
|
|
98
99
|
active: _active,
|
|
@@ -111,11 +112,12 @@ function MenuItem(props) {
|
|
|
111
112
|
if (kind === 'MenuItemTopLinkWithSubItems') {
|
|
112
113
|
var _ref3 = item,
|
|
113
114
|
_Icon = _ref3.icon,
|
|
114
|
-
items = _ref3.items
|
|
115
|
+
items = _ref3.items,
|
|
116
|
+
_selected = _ref3.active;
|
|
115
117
|
|
|
116
118
|
var _to2 = (0, _utils.isMenuItemInternalLink)(item) ? item.path : item.url;
|
|
117
119
|
|
|
118
|
-
var _active2 = !disabled && currentPath === _to2;
|
|
120
|
+
var _active2 = !disabled && (currentPath === _to2 || _selected);
|
|
119
121
|
|
|
120
122
|
return _react.default.createElement(MenuItemWithSubItems, {
|
|
121
123
|
onBlur: function onBlur() {
|
|
@@ -261,7 +263,7 @@ function MenuItem(props) {
|
|
|
261
263
|
|
|
262
264
|
|
|
263
265
|
var to = (0, _utils.isMenuItemInternalLink)(item) ? item.path : item.url;
|
|
264
|
-
var active = !disabled && currentPath === to;
|
|
266
|
+
var active = !disabled && (currentPath === to || item.active);
|
|
265
267
|
return _react.default.createElement(_ItemWrapper.default, {
|
|
266
268
|
active: active,
|
|
267
269
|
disabled: disabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/LeftNav/Item/NavExpandedItem/index.tsx"],"names":[],"mappings":";AAUA,OAAO,EAEL,aAAa,EAId,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/LeftNav/Item/NavExpandedItem/index.tsx"],"names":[],"mappings":";AAUA,OAAO,EAEL,aAAa,EAId,MAAM,aAAa,CAAC;AAcrB,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CAqMlE"}
|
|
@@ -29,6 +29,8 @@ var _SubItemsWrapper = _interopRequireDefault(require("../SubItemsWrapper"));
|
|
|
29
29
|
|
|
30
30
|
var _ItemWrapper = _interopRequireDefault(require("../ItemWrapper"));
|
|
31
31
|
|
|
32
|
+
var _MenuItemWrapper = _interopRequireDefault(require("../MenuItemWrapper"));
|
|
33
|
+
|
|
32
34
|
var _useMenuItem2 = _interopRequireDefault(require("../hooks/useMenuItem"));
|
|
33
35
|
|
|
34
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -71,11 +73,12 @@ function MenuItem(props) {
|
|
|
71
73
|
|
|
72
74
|
if (kind === 'MenuItemTopLink') {
|
|
73
75
|
var _ref2 = item,
|
|
74
|
-
Icon = _ref2.icon
|
|
76
|
+
Icon = _ref2.icon,
|
|
77
|
+
selected = _ref2.active;
|
|
75
78
|
|
|
76
79
|
var _to = (0, _utils.isMenuItemInternalLink)(item) ? item.path : item.url;
|
|
77
80
|
|
|
78
|
-
var _active = !disabled && currentPath === _to;
|
|
81
|
+
var _active = !disabled && (currentPath === _to || selected);
|
|
79
82
|
|
|
80
83
|
return _react.default.createElement(_ItemWrapper.default, {
|
|
81
84
|
active: _active,
|
|
@@ -94,29 +97,36 @@ function MenuItem(props) {
|
|
|
94
97
|
if (kind === 'MenuItemTopLinkWithSubItems') {
|
|
95
98
|
var _ref3 = item,
|
|
96
99
|
_Icon = _ref3.icon,
|
|
97
|
-
items = _ref3.items
|
|
100
|
+
items = _ref3.items,
|
|
101
|
+
_selected = _ref3.active;
|
|
98
102
|
|
|
99
103
|
var _to2 = (0, _utils.isMenuItemInternalLink)(item) ? item.path : item.url;
|
|
100
104
|
|
|
101
|
-
var _active2 = !disabled && currentPath === _to2;
|
|
105
|
+
var _active2 = !disabled && (currentPath === _to2 || _selected);
|
|
102
106
|
|
|
103
107
|
return _react.default.createElement("li", null, _react.default.createElement(_ItemWrapper.default, {
|
|
104
108
|
as: "div",
|
|
105
109
|
active: _active2,
|
|
106
110
|
disabled: disabled,
|
|
107
|
-
navVariant: navVariant
|
|
108
|
-
|
|
111
|
+
navVariant: navVariant,
|
|
112
|
+
flexDirection: "column"
|
|
113
|
+
}, _react.default.createElement(_Flex.default, {
|
|
114
|
+
flexWrap: "wrap"
|
|
115
|
+
}, _react.default.createElement(_MenuItemWrapper.default, {
|
|
116
|
+
flex: "1 0"
|
|
117
|
+
}, _react.default.createElement(_ClickArea.default, {
|
|
109
118
|
"aria-disabled": disabled,
|
|
110
119
|
as: disabled ? 'div' : MenuItemLink,
|
|
111
120
|
disabled: disabled,
|
|
112
121
|
navVariant: navVariant,
|
|
113
122
|
tabIndex: disabled ? undefined : 0,
|
|
114
123
|
to: disabled ? undefined : _to2
|
|
115
|
-
}, _react.default.createElement(_IconWrapper.default, null, _react.default.createElement(_Icon, null)), _react.default.createElement(_TextWrapper.default, null, text)), _react.default.createElement(
|
|
124
|
+
}, _react.default.createElement(_IconWrapper.default, null, _react.default.createElement(_Icon, null)), _react.default.createElement(_TextWrapper.default, null, text))), _react.default.createElement(_MenuItemWrapper.default, {
|
|
125
|
+
flexDirection: "column"
|
|
126
|
+
}, _react.default.createElement(_ClickArea.default, {
|
|
116
127
|
"aria-disabled": disabled,
|
|
117
128
|
as: "button",
|
|
118
129
|
disabled: disabled,
|
|
119
|
-
flex: 0,
|
|
120
130
|
flexDirection: "column",
|
|
121
131
|
navVariant: navVariant,
|
|
122
132
|
onClick: toggleExpanded,
|
|
@@ -128,7 +138,7 @@ function MenuItem(props) {
|
|
|
128
138
|
size: "small"
|
|
129
139
|
}) : _react.default.createElement(_CaretDown.default, {
|
|
130
140
|
size: "small"
|
|
131
|
-
}))))), expanded && _react.default.createElement(_SubItemsWrapper.default, {
|
|
141
|
+
})))))), expanded && _react.default.createElement(_SubItemsWrapper.default, {
|
|
132
142
|
navVariant: navVariant
|
|
133
143
|
}, items.map(function (subItem) {
|
|
134
144
|
var key = subItem.text;
|
|
@@ -148,8 +158,9 @@ function MenuItem(props) {
|
|
|
148
158
|
return _react.default.createElement("li", null, _react.default.createElement(_ItemWrapper.default, {
|
|
149
159
|
as: "div",
|
|
150
160
|
disabled: disabled,
|
|
151
|
-
navVariant: navVariant
|
|
152
|
-
|
|
161
|
+
navVariant: navVariant,
|
|
162
|
+
flexDirection: "column"
|
|
163
|
+
}, _react.default.createElement(_MenuItemWrapper.default, null, _react.default.createElement(_ClickArea.default, {
|
|
153
164
|
"aria-disabled": disabled,
|
|
154
165
|
as: "button",
|
|
155
166
|
disabled: disabled,
|
|
@@ -162,7 +173,7 @@ function MenuItem(props) {
|
|
|
162
173
|
size: "small"
|
|
163
174
|
}) : _react.default.createElement(_CaretDown.default, {
|
|
164
175
|
size: "small"
|
|
165
|
-
}))), _react.default.createElement(_SubItemsWrapper.default, {
|
|
176
|
+
})))), _react.default.createElement(_SubItemsWrapper.default, {
|
|
166
177
|
expanded: expanded,
|
|
167
178
|
navVariant: navVariant
|
|
168
179
|
}, expanded && _items.map(function (subItem) {
|
|
@@ -178,7 +189,7 @@ function MenuItem(props) {
|
|
|
178
189
|
|
|
179
190
|
|
|
180
191
|
var to = (0, _utils.isMenuItemInternalLink)(item) ? item.path : item.url;
|
|
181
|
-
var active = !disabled && currentPath === to;
|
|
192
|
+
var active = !disabled && (currentPath === to || item.active);
|
|
182
193
|
return _react.default.createElement(_ItemWrapper.default, {
|
|
183
194
|
active: active,
|
|
184
195
|
disabled: disabled,
|
|
@@ -6,9 +6,9 @@ import { MenuItemProps } from '../types';
|
|
|
6
6
|
export interface MenuItemDisplayProps extends FlexComponentProps {
|
|
7
7
|
active?: boolean;
|
|
8
8
|
disabled?: boolean;
|
|
9
|
+
navVariant?: keyof typeof NAV_EXPANDED_STATES;
|
|
9
10
|
to?: string;
|
|
10
11
|
variant?: 'expander' | 'sub';
|
|
11
|
-
navVariant?: keyof typeof NAV_EXPANDED_STATES;
|
|
12
12
|
}
|
|
13
13
|
export declare type RendererProps = MenuItemProps & {
|
|
14
14
|
children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/LeftNav/Item/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC9D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/LeftNav/Item/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC9D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,OAAO,mBAAmB,CAAC;IAC9C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,UAAU,GAAG,KAAK,CAAC;CAC9B;AAED,oBAAY,aAAa,GAAG,aAAa,GAAG;IAC1C,QAAQ,EAAE,SAAS,CAAC;IACpB,GAAG,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;CAC5B,CAAC"}
|
|
@@ -65,12 +65,21 @@ var items = [{
|
|
|
65
65
|
}, {
|
|
66
66
|
text: 'sub item external link',
|
|
67
67
|
url: 'https://www.google.com'
|
|
68
|
+
}, {
|
|
69
|
+
text: 'selected sub level item',
|
|
70
|
+
path: '/#sub/#im-active',
|
|
71
|
+
active: true
|
|
68
72
|
}]
|
|
69
73
|
}, {
|
|
70
74
|
icon: _iconix.default.Angry,
|
|
71
75
|
text: 'disabled top level internal link',
|
|
72
76
|
path: '/#angry',
|
|
73
77
|
disabled: true
|
|
78
|
+
}, {
|
|
79
|
+
icon: _iconix.default.Check,
|
|
80
|
+
text: 'selected top level item',
|
|
81
|
+
path: '/#im-active',
|
|
82
|
+
active: true
|
|
74
83
|
}];
|
|
75
84
|
var defaultProps = {
|
|
76
85
|
currentPath: '/',
|
|
@@ -120,14 +129,15 @@ describe('LeftNav', function () {
|
|
|
120
129
|
test('clicking expander button toggles the sub menu', function () {
|
|
121
130
|
var _render4 = render(_react2.default.createElement(_.default, defaultProps)),
|
|
122
131
|
container = _render4.container,
|
|
123
|
-
queryByText = _render4.queryByText
|
|
132
|
+
queryByText = _render4.queryByText,
|
|
133
|
+
getByRole = _render4.getByRole;
|
|
124
134
|
|
|
125
135
|
var linkWithSubItems = items[3];
|
|
126
136
|
var itemLink = queryByText(linkWithSubItems.text);
|
|
127
|
-
var
|
|
137
|
+
var expanderButtonContainer = itemLink.closest('a').parentElement.nextSibling;
|
|
128
138
|
expect(queryByText(linkWithSubItems.items[0].text)).toBe(null);
|
|
129
139
|
|
|
130
|
-
_react.fireEvent.click(
|
|
140
|
+
_react.fireEvent.click((0, _react.within)(expanderButtonContainer).getByRole('button'));
|
|
131
141
|
|
|
132
142
|
expect(queryByText(linkWithSubItems.items[0].text)).toBeTruthy();
|
|
133
143
|
expect(container).toMatchSnapshot();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/LeftNav/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/LeftNav/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAAuC,CAAC;AA6DpD,eAAe,MAAM,CAAC"}
|
|
@@ -17,12 +17,14 @@ schema.propTypes = {
|
|
|
17
17
|
navExpandedState: _reactDesc.PropTypes.oneOf(['COLLAPSED_XY', 'COLLAPSED_X', 'EXPANDED']).description('A value used to control the expanded state of the nav. If provided, will always override internal values'),
|
|
18
18
|
onChangeNavExpandedState: _reactDesc.PropTypes.func.description('An event handler used to track when a user requests a change to the nav expanded state. Will not be called when the nav expanded state changes based on screen size.'),
|
|
19
19
|
items: _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.shape({
|
|
20
|
+
active: _reactDesc.PropTypes.bool.description('Sets the menu item as active.'),
|
|
20
21
|
disabled: _reactDesc.PropTypes.bool.description('Disables the menu item.'),
|
|
21
22
|
icon: _reactDesc.PropTypes.func.description('Which `iconix` icon to render.').isRequired,
|
|
22
23
|
text: _reactDesc.PropTypes.string.description('The label for the menu item.').isRequired,
|
|
23
24
|
path: _reactDesc.PropTypes.string.description('The path for an internal link. Can not be used with a `url` attribute.'),
|
|
24
25
|
url: _reactDesc.PropTypes.string.description('The path for an external link. Can not be used with a `path` attribute.'),
|
|
25
26
|
items: _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.shape({
|
|
27
|
+
active: _reactDesc.PropTypes.bool.description('Sets the menu item as active.'),
|
|
26
28
|
disabled: _reactDesc.PropTypes.bool.description('Disables the menu subitem.'),
|
|
27
29
|
text: _reactDesc.PropTypes.string.description('The label for the menu subitem.').isRequired,
|
|
28
30
|
path: _reactDesc.PropTypes.string.description('The path for an internal link. Can not be used with a `url` attribute.'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/LeftNav/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,aAAK,aAAa,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC,OAAO,CAAC;AAEvD,UAAU,YAAY;IACpB,QAAQ,CAAC,EAAE,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B,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,OAAO,mBAAmB,CAAC;IAC9C,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB;AAED,UAAU,gBAAgB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,OAAO,mBAAmB,CAAC;IAC9C,OAAO,EAAE,KAAK,CAAC;CAChB;AAED,oBAAY,aAAa,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAEhE,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uBAAuB,CAAC,EAAE,MAAM,OAAO,mBAAmB,CAAC;IAC3D,gBAAgB,CAAC,EAAE,MAAM,OAAO,mBAAmB,CAAC;IACpD,wBAAwB,CAAC,EAAE,CACzB,gBAAgB,EAAE,MAAM,OAAO,mBAAmB,KAC/C,IAAI,CAAC;CACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAON,MAAM,OAAO,CAAC;AAMf,OAAO,EAAqB,KAAK,EAAE,MAAM,SAAS,CAAC;AAOnD,cAAc,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAON,MAAM,OAAO,CAAC;AAMf,OAAO,EAAqB,KAAK,EAAE,MAAM,SAAS,CAAC;AAOnD,cAAc,SAAS,CAAC;AAgHxB,QAAA,MAAM,WAAW,gFAAmB,CAAC;AAsBrC,eAAe,WAAW,CAAC"}
|
|
@@ -64,7 +64,8 @@ var Menu = function Menu(props, _ref) {
|
|
|
64
64
|
var _props$items = props.items,
|
|
65
65
|
items = _props$items === void 0 ? [] : _props$items,
|
|
66
66
|
onSelectItem = props.onSelectItem,
|
|
67
|
-
allowTab = props.allowTab
|
|
67
|
+
allowTab = props.allowTab,
|
|
68
|
+
actions = props.actions;
|
|
68
69
|
|
|
69
70
|
var _useMemo = (0, _react.useMemo)(function () {
|
|
70
71
|
return items.reduce(function (acc, value) {
|
|
@@ -118,6 +119,7 @@ var Menu = function Menu(props, _ref) {
|
|
|
118
119
|
}
|
|
119
120
|
}, [allowTab]);
|
|
120
121
|
return _react.default.createElement(StyledMenu, {
|
|
122
|
+
actions: actions,
|
|
121
123
|
items: optionsListItems,
|
|
122
124
|
selectable: false,
|
|
123
125
|
multiple: false,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IconProps } from '@decisiv/iconix';
|
|
3
|
+
import { FooterActions } from '../../atoms/OptionsList/types';
|
|
3
4
|
export declare type MenuRef = HTMLUListElement;
|
|
4
5
|
export declare type MenuItemRef = HTMLDivElement | HTMLAnchorElement;
|
|
5
6
|
export declare type InputMethod = 'mouse' | 'keyboard' | undefined;
|
|
@@ -8,6 +9,7 @@ export interface Props {
|
|
|
8
9
|
items: MenuItem[];
|
|
9
10
|
onSelectItem?: (item: MenuItem) => void;
|
|
10
11
|
allowTab?: boolean;
|
|
12
|
+
actions?: FooterActions;
|
|
11
13
|
}
|
|
12
14
|
export interface MenuItem {
|
|
13
15
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,oBAAY,OAAO,GAAG,gBAAgB,CAAC;AACvC,oBAAY,WAAW,GAAG,cAAc,GAAG,iBAAiB,CAAC;AAC7D,oBAAY,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;AAE3D,oBAAY,aAAa,GAAG,CAAC,KAAK,EAAE,SAAS,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AAEF,oBAAY,iBAAiB,GAAG,aAAa,GAAG;IAC9C,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC"}
|
|
@@ -46,7 +46,7 @@ export declare const Content: import("styled-components").StyledComponent<"div",
|
|
|
46
46
|
readonly LG: "LG";
|
|
47
47
|
readonly XL: "XL";
|
|
48
48
|
}> | undefined;
|
|
49
|
-
readonly flexDirection?: "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "
|
|
49
|
+
readonly flexDirection?: "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "row" | "column" | "column-reverse" | "row-reverse" | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<import("csstype").FlexDirectionProperty, {
|
|
50
50
|
readonly XS: "XS";
|
|
51
51
|
readonly SM: "SM";
|
|
52
52
|
readonly MD: "MD";
|
|
@@ -241,7 +241,7 @@ export declare const Footer: import("styled-components").StyledComponent<"div",
|
|
|
241
241
|
readonly LG: "LG";
|
|
242
242
|
readonly XL: "XL";
|
|
243
243
|
}> | undefined;
|
|
244
|
-
readonly flexDirection?: "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "
|
|
244
|
+
readonly flexDirection?: "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "row" | "column" | "column-reverse" | "row-reverse" | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<import("csstype").FlexDirectionProperty, {
|
|
245
245
|
readonly XS: "XS";
|
|
246
246
|
readonly SM: "SM";
|
|
247
247
|
readonly MD: "MD";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA0C,MAAM,OAAO,CAAC;AA8B/D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA0C,MAAM,OAAO,CAAC;AA8B/D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAyJrC,iBAAS,OAAO,CAAC,EACf,OAAO,EACP,OAAO,EACP,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,UAAU,GAAG,KAAK,CAAC,WAAW,GAAG,IAAI,CAmCvC;kBAxCQ,OAAO;;;;AAmDhB,eAAe,OAAO,CAAC"}
|
|
@@ -129,7 +129,7 @@ function Modal(_ref) {
|
|
|
129
129
|
var handleOverlayClick = (0, _react.useCallback)(function (event) {
|
|
130
130
|
event.preventDefault();
|
|
131
131
|
event.stopPropagation();
|
|
132
|
-
onClose(event);
|
|
132
|
+
onClose && onClose(event);
|
|
133
133
|
}, [onClose]); // Any click within the body should stay within the body. This prevents the click event from
|
|
134
134
|
// bubbling up and firing the onClose handler via the Overlay's onClick.
|
|
135
135
|
|
|
@@ -157,7 +157,7 @@ function Modal(_ref) {
|
|
|
157
157
|
paddingTop: (_ref2 = {}, _defineProperty(_ref2, _breakpointObserver.sizes.LG, 3), _defineProperty(_ref2, _breakpointObserver.sizes.XS, 2), _ref2),
|
|
158
158
|
paddingX: (_ref3 = {}, _defineProperty(_ref3, _breakpointObserver.sizes.LG, 3), _defineProperty(_ref3, _breakpointObserver.sizes.XS, 2), _ref3),
|
|
159
159
|
size: breakpoint
|
|
160
|
-
}, _react.default.createElement(_components.CloseButtonContainer, null, _react.default.createElement(_Tooltip.default, {
|
|
160
|
+
}, onClose && _react.default.createElement(_components.CloseButtonContainer, null, _react.default.createElement(_Tooltip.default, {
|
|
161
161
|
placement: "top",
|
|
162
162
|
target: // eslint-disable-next-line
|
|
163
163
|
_react.default.createElement(_Button.default, {
|
|
@@ -175,7 +175,7 @@ function Modal(_ref) {
|
|
|
175
175
|
paddingBottom: (_ref4 = {}, _defineProperty(_ref4, _breakpointObserver.sizes.LG, 3), _defineProperty(_ref4, _breakpointObserver.sizes.XS, 2), _ref4),
|
|
176
176
|
paddingX: (_ref5 = {}, _defineProperty(_ref5, _breakpointObserver.sizes.LG, 3), _defineProperty(_ref5, _breakpointObserver.sizes.XS, 2), _ref5),
|
|
177
177
|
size: breakpoint
|
|
178
|
-
}, children)), _react.default.createElement(_components.Footer, {
|
|
178
|
+
}, children)), actions && _react.default.createElement(_components.Footer, {
|
|
179
179
|
hasIcon: !!IconComponent,
|
|
180
180
|
id: modalFooterId,
|
|
181
181
|
paddingX: (_ref6 = {}, _defineProperty(_ref6, _breakpointObserver.sizes.LG, 3), _defineProperty(_ref6, _breakpointObserver.sizes.XS, 2), _ref6),
|
|
@@ -202,7 +202,7 @@ function Manager(_ref7) {
|
|
|
202
202
|
|
|
203
203
|
var onKeyDown = (0, _react.useCallback)(function (event) {
|
|
204
204
|
if (event.key === 'Escape') {
|
|
205
|
-
onClose(event);
|
|
205
|
+
onClose && onClose(event);
|
|
206
206
|
}
|
|
207
207
|
}, [onClose]); // Allow closing the modal by pressing the Escape key
|
|
208
208
|
|
|
@@ -229,7 +229,7 @@ function Manager(_ref7) {
|
|
|
229
229
|
|
|
230
230
|
|
|
231
231
|
Manager.propTypes = _objectSpread({}, _schema.default.propTypes, {
|
|
232
|
-
actions: _proptypeValidators.actionsValidator
|
|
232
|
+
actions: _proptypeValidators.actionsValidator,
|
|
233
233
|
icon: _propTypes.default.elementType
|
|
234
234
|
});
|
|
235
235
|
Manager.displayName = 'Modal';
|
|
@@ -12,6 +12,10 @@ var _ = _interopRequireDefault(require("."));
|
|
|
12
12
|
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
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; }
|
|
16
|
+
|
|
17
|
+
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
|
+
|
|
15
19
|
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
20
|
|
|
17
21
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; }
|
|
@@ -80,6 +84,18 @@ describe('Modal', function () {
|
|
|
80
84
|
|
|
81
85
|
expect(onClose).toHaveBeenCalled();
|
|
82
86
|
});
|
|
87
|
+
it('renders a modal without a close button', function () {
|
|
88
|
+
var onClose = defaultProps.onClose,
|
|
89
|
+
rest = _objectWithoutProperties(defaultProps, ["onClose"]);
|
|
90
|
+
|
|
91
|
+
var _render2 = render(_react.default.createElement(_.default, rest)),
|
|
92
|
+
baseElement = _render2.baseElement;
|
|
93
|
+
|
|
94
|
+
var modalHeader = document.getElementById("modal-header-".concat(defaultProps.id));
|
|
95
|
+
var closeButton = (0, _react2.queryByLabelText)(modalHeader, /close/i);
|
|
96
|
+
expect(closeButton).toBeFalsy();
|
|
97
|
+
expect(baseElement).toMatchSnapshot();
|
|
98
|
+
});
|
|
83
99
|
it('renders the children as the content of the modal', function () {
|
|
84
100
|
var content = 'Test modal content.';
|
|
85
101
|
render(_react.default.createElement(_.default, defaultProps, content));
|
|
@@ -147,6 +163,22 @@ describe('Modal', function () {
|
|
|
147
163
|
|
|
148
164
|
expect(onClose).toHaveBeenCalled();
|
|
149
165
|
});
|
|
166
|
+
it('doest NOT call the onClose when pressing escape and no onClose function is provided', function () {
|
|
167
|
+
var closeFn = defaultProps.onClose,
|
|
168
|
+
rest = _objectWithoutProperties(defaultProps, ["onClose"]);
|
|
169
|
+
|
|
170
|
+
var onClose = jest.fn();
|
|
171
|
+
render(_react.default.createElement(_.default, rest));
|
|
172
|
+
|
|
173
|
+
_react2.fireEvent.keyDown(document.body, {
|
|
174
|
+
key: 'Escape',
|
|
175
|
+
code: 27,
|
|
176
|
+
keyCode: 27,
|
|
177
|
+
charCode: 27
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
expect(onClose).not.toHaveBeenCalled();
|
|
181
|
+
});
|
|
150
182
|
});
|
|
151
183
|
describe('with invalid props', function () {
|
|
152
184
|
beforeEach(function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/schema.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,KAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/schema.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,KAAqC,CAAC;AAuDlD,eAAe,MAAM,CAAC"}
|
|
@@ -17,13 +17,13 @@ schema.propTypes = {
|
|
|
17
17
|
actions: _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.shape({
|
|
18
18
|
onClick: _reactDesc.PropTypes.func.isRequired,
|
|
19
19
|
text: _reactDesc.PropTypes.string.isRequired
|
|
20
|
-
})).description('An array of objects containing a subset of props valid for the Button. Specifically excluded are `kind`, `size`, and `variant`.')
|
|
20
|
+
})).description('An array of objects containing a subset of props valid for the Button. Specifically excluded are `kind`, `size`, and `variant`.'),
|
|
21
21
|
closeHint: _reactDesc.PropTypes.string.description('The text to present in the tooltip when hovering over the close button.'),
|
|
22
22
|
color: _reactDesc.PropTypes.oneOf(_commonUIColors.commonUIColorKeys).description('The icon color; Will override the default color associated with any specified `intent`.').format('string'),
|
|
23
23
|
icon: _reactDesc.PropTypes.element.description('Which `iconix` icon to display; Will override the default icon associated with any specified `intent`.'),
|
|
24
24
|
id: _reactDesc.PropTypes.string.description('A unique identifier for the modal.'),
|
|
25
25
|
intent: _reactDesc.PropTypes.oneOf(['information', 'success', 'warning', 'danger', 'help']).description('Shortcuts to the most common combinations of icon and color.'),
|
|
26
|
-
onClose: _reactDesc.PropTypes.func.description('The event handler called to close the modal.')
|
|
26
|
+
onClose: _reactDesc.PropTypes.func.description('The event handler called to close the modal. If not provided, the modal will not include a close button and closing by clicking outside or pressing the "Esc" key will be disabled.'),
|
|
27
27
|
title: _reactDesc.PropTypes.string.description('The text for rendering in the H2 at the top of the modal').isRequired,
|
|
28
28
|
visible: _reactDesc.PropTypes.bool.description('A boolean value used to control whether the modal is visible or not').defaultValue('false'),
|
|
29
29
|
zIndex: _reactDesc.PropTypes.number.description('Sets the z-index value for the modal & overlay.')
|
|
@@ -5,14 +5,14 @@ import { ButtonProps } from '../Button/types';
|
|
|
5
5
|
import { intents } from './constants';
|
|
6
6
|
declare type ActionProps = Exclude<ButtonProps, 'kind' | 'size' | 'variant'>;
|
|
7
7
|
export interface ModalProps {
|
|
8
|
-
actions
|
|
8
|
+
actions?: [ActionProps] | [ActionProps, ActionProps];
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
closeHint?: string;
|
|
11
11
|
color?: CommonUIColorKeys;
|
|
12
12
|
icon?: (props: IconProps) => JSX.Element;
|
|
13
13
|
id?: string;
|
|
14
14
|
intent?: keyof typeof intents;
|
|
15
|
-
onClose
|
|
15
|
+
onClose?: (event: React.MouseEvent<unknown> | KeyboardEvent) => void;
|
|
16
16
|
title: string;
|
|
17
17
|
visible?: boolean;
|
|
18
18
|
zIndex?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/types.ts"],"names":[],"m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M,OAAO,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,aAAa,KAAK,IAAI,CAAC;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB"}
|
|
@@ -102,9 +102,9 @@ export declare const NotificationCard: import("styled-components").StyledCompone
|
|
|
102
102
|
}> & {
|
|
103
103
|
borderColor: string;
|
|
104
104
|
}, never>;
|
|
105
|
-
export declare const IconColumn: import("styled-components").StyledComponent<"div", any,
|
|
106
|
-
|
|
107
|
-
},
|
|
105
|
+
export declare const IconColumn: import("styled-components").StyledComponent<"div", any, {
|
|
106
|
+
right?: boolean | undefined;
|
|
107
|
+
}, never>;
|
|
108
108
|
export declare const CloseButton: import("styled-components").StyledComponent<import("react").RefForwardingComponent<HTMLButtonElement, ButtonProps>, any, ButtonProps, never>;
|
|
109
109
|
export declare const ActionButtonContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
110
110
|
//# sourceMappingURL=components.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../src/components/Notifications/Notification/components.ts"],"names":[],"mappings":";AAWA,OAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../src/components/Notifications/Notification/components.ts"],"names":[],"mappings":";AAWA,OAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAInD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAa5B,CAAC;AAEF,eAAO,MAAM,UAAU;;SAOtB,CAAC;AAEF,eAAO,MAAM,WAAW,8IAEvB,CAAC;AAEF,eAAO,MAAM,qBAAqB,oEAGjC,CAAC"}
|
|
@@ -15,7 +15,7 @@ var _color = _interopRequireDefault(require("@decisiv/design-tokens/lib/color"))
|
|
|
15
15
|
|
|
16
16
|
var _spacing = _interopRequireDefault(require("@decisiv/design-tokens/lib/spacing"));
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _utils = require("../../../utils");
|
|
19
19
|
|
|
20
20
|
var _skyPlane = _interopRequireDefault(require("../../../utils/skyPlane"));
|
|
21
21
|
|
|
@@ -23,6 +23,8 @@ var _Grid = _interopRequireDefault(require("../../Grid"));
|
|
|
23
23
|
|
|
24
24
|
var _Button = _interopRequireDefault(require("../../Button"));
|
|
25
25
|
|
|
26
|
+
var _constants = require("../constants");
|
|
27
|
+
|
|
26
28
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
|
27
29
|
|
|
28
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -30,17 +32,21 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
30
32
|
var NotificationCard = (0, _styledComponents.default)(_Grid.default.Container).withConfig({
|
|
31
33
|
displayName: "components__NotificationCard",
|
|
32
34
|
componentId: "ds1zkc-0"
|
|
33
|
-
})(["background-color:", ";box-shadow:", ";border-radius:2px;width:", ";", ";"], (0, _toColorString.default)(_color.default.base.snowWhite), (0, _skyPlane.default)(2),
|
|
35
|
+
})(["background-color:", ";box-shadow:", ";border-radius:2px;width:", ";", ";"], (0, _toColorString.default)(_color.default.base.snowWhite), (0, _skyPlane.default)(2), _constants.NOTIFICATION_CARD_WIDTH, (0, _utils.applyDynamicModifiers)('borderColor', function (_ref) {
|
|
34
36
|
var borderColor = _ref.borderColor;
|
|
35
37
|
return (0, _styledComponents.css)(["border-left:2px solid ", ";"], borderColor);
|
|
36
38
|
}));
|
|
37
39
|
exports.NotificationCard = NotificationCard;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}).withConfig({
|
|
40
|
+
|
|
41
|
+
var IconColumn = _styledComponents.default.div.withConfig({
|
|
41
42
|
displayName: "components__IconColumn",
|
|
42
43
|
componentId: "ds1zkc-1"
|
|
43
|
-
})(["
|
|
44
|
+
})(["padding-left:", ";", ""], (0, _rem.default)(_spacing.default.base), function (_ref2) {
|
|
45
|
+
var _ref2$right = _ref2.right,
|
|
46
|
+
right = _ref2$right === void 0 ? false : _ref2$right;
|
|
47
|
+
return right && (0, _styledComponents.css)(["padding-right:", ";"], (0, _rem.default)(_spacing.default.base));
|
|
48
|
+
});
|
|
49
|
+
|
|
44
50
|
exports.IconColumn = IconColumn;
|
|
45
51
|
var CloseButton = (0, _styledComponents.default)(_Button.default).withConfig({
|
|
46
52
|
displayName: "components__CloseButton",
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
import { TNotificationProps } from '../../../providers/NotificationsProvider/types';
|
|
3
4
|
declare function Notification(props: TNotificationProps): JSX.Element;
|
|
4
5
|
declare namespace Notification {
|
|
5
|
-
var propTypes:
|
|
6
|
-
var defaultProps:
|
|
7
|
-
actions: undefined;
|
|
8
|
-
children: null;
|
|
9
|
-
icon: undefined;
|
|
10
|
-
};
|
|
6
|
+
var propTypes: PropTypes.ValidationMap<TNotificationProps>;
|
|
7
|
+
var defaultProps: Partial<TNotificationProps>;
|
|
11
8
|
var displayName: string;
|
|
12
9
|
}
|
|
13
10
|
export default Notification;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Notifications/Notification/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Notifications/Notification/index.tsx"],"names":[],"mappings":";AAGA,OAAO,SAA4B,MAAM,YAAY,CAAC;AAMtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAwBpF,iBAAS,YAAY,CAAC,KAAK,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAuG5D;kBAvGQ,YAAY;;;;;AA8HrB,eAAe,YAAY,CAAC"}
|
|
@@ -72,6 +72,8 @@ function Notification(props) {
|
|
|
72
72
|
_props$intent = props.intent,
|
|
73
73
|
intent = _props$intent === void 0 ? _constants.intentNames.information : _props$intent,
|
|
74
74
|
onClose = props.onClose,
|
|
75
|
+
onFocus = props.onFocus,
|
|
76
|
+
onHover = props.onHover,
|
|
75
77
|
title = props.title;
|
|
76
78
|
var translate = (0, _useTranslations.default)();
|
|
77
79
|
|
|
@@ -91,13 +93,15 @@ function Notification(props) {
|
|
|
91
93
|
id: id,
|
|
92
94
|
borderColor: accentColor,
|
|
93
95
|
margin: 0,
|
|
94
|
-
padding: 1.5
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}, Icon), _react.default.createElement(_Grid.default.Column, null, _react.default.createElement(_Grid.default.Row, null, _react.default.createElement(_Grid.default.Column, null, _react.default.createElement(_Typography.P, {
|
|
96
|
+
padding: 1.5,
|
|
97
|
+
onFocus: onFocus,
|
|
98
|
+
onMouseOver: onHover
|
|
99
|
+
}, _react.default.createElement(_Grid.default.Row, null, _react.default.createElement(_components.IconColumn, null, Icon), _react.default.createElement(_Grid.default.Column, null, _react.default.createElement(_Grid.default.Row, null, _react.default.createElement(_Grid.default.Column, null, _react.default.createElement(_Typography.P, {
|
|
98
100
|
shade: 0,
|
|
99
101
|
weight: "semibold"
|
|
100
|
-
}, title)), _react.default.createElement(_components.IconColumn,
|
|
102
|
+
}, title)), onClose && _react.default.createElement(_components.IconColumn, {
|
|
103
|
+
right: true
|
|
104
|
+
}, _react.default.createElement(_Tooltip.default, {
|
|
101
105
|
target: // eslint-disable-next-line react/jsx-wrap-multilines
|
|
102
106
|
_react.default.createElement(_components.CloseButton, {
|
|
103
107
|
"aria-label": translate(closeHint, 'notification.closeHint'),
|
|
@@ -120,21 +124,24 @@ function Notification(props) {
|
|
|
120
124
|
key: action.text
|
|
121
125
|
}, _react.default.createElement(_Button.default, _extends({}, (0, _omit.default)(action, ['kind', 'size', 'variant']), actionProps[index])));
|
|
122
126
|
}))))));
|
|
123
|
-
}
|
|
127
|
+
}
|
|
124
128
|
|
|
125
|
-
|
|
126
|
-
Notification.propTypes = _objectSpread({}, _schema.default.propTypes, {
|
|
129
|
+
var propTypes = _objectSpread({}, _schema.default.propTypes, {
|
|
127
130
|
actions: _proptypeValidators.actionsValidator,
|
|
128
|
-
children: _propTypes.default.
|
|
131
|
+
children: _propTypes.default.node,
|
|
129
132
|
icon: _propTypes.default.elementType,
|
|
130
133
|
id: _propTypes.default.string.isRequired,
|
|
131
|
-
onClose: _propTypes.default.func
|
|
134
|
+
onClose: _propTypes.default.func
|
|
132
135
|
});
|
|
133
|
-
|
|
136
|
+
|
|
137
|
+
var defaultProps = {
|
|
134
138
|
actions: undefined,
|
|
135
139
|
children: null,
|
|
136
|
-
icon: undefined
|
|
140
|
+
icon: undefined,
|
|
141
|
+
onClose: undefined
|
|
137
142
|
};
|
|
143
|
+
Notification.propTypes = propTypes;
|
|
144
|
+
Notification.defaultProps = defaultProps;
|
|
138
145
|
Notification.displayName = 'Notification';
|
|
139
146
|
var _default = Notification;
|
|
140
147
|
exports.default = _default;
|