@carbon/ibm-products 1.6.1 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/index-full-carbon.css +224 -143
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +3 -3
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +1 -2
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +178 -142
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +3 -3
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +178 -142
- package/css/index.css.map +1 -1
- package/css/index.min.css +3 -3
- package/css/index.min.css.map +1 -1
- package/es/components/APIKeyModal/APIKeyModal.js +10 -13
- package/es/components/ActionBar/ActionBar.js +0 -3
- package/es/components/ActionBar/ActionBarItem.js +2 -6
- package/es/components/ActionSet/ActionSet.js +11 -13
- package/es/components/AddSelect/AddSelect.js +121 -25
- package/es/components/AddSelect/AddSelectBreadcrumbs.js +5 -5
- package/es/components/AddSelect/AddSelectColumn.js +21 -0
- package/es/components/AddSelect/AddSelectList.js +68 -9
- package/es/components/AddSelect/AddSelectSidebar.js +43 -5
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +0 -3
- package/es/components/ButtonMenu/ButtonMenu.js +6 -4
- package/es/components/ButtonMenu/ButtonMenuItem.js +1 -2
- package/es/components/Card/Card.js +31 -21
- package/es/components/Card/CardFooter.js +14 -10
- package/es/components/Card/CardHeader.js +8 -6
- package/es/components/Cascade/Cascade.js +5 -4
- package/es/components/ComboButton/ComboButton.js +0 -4
- package/es/components/ComboButton/ComboButtonItem/index.js +0 -5
- package/es/components/CreateFullPage/CreateFullPageStep.js +15 -8
- package/es/components/CreateModal/CreateModal.js +1 -4
- package/es/components/CreateTearsheet/CreateTearsheet.js +10 -11
- package/es/components/CreateTearsheet/CreateTearsheetStep.js +18 -14
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +454 -0
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +322 -0
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +64 -0
- package/es/components/DataSpreadsheet/createActiveCellFn.js +45 -0
- package/es/components/DataSpreadsheet/createCellSelectionArea.js +45 -0
- package/es/components/DataSpreadsheet/generateData.js +47 -0
- package/es/components/DataSpreadsheet/getCellSize.js +30 -0
- package/es/components/{CancelableTextEdit → DataSpreadsheet}/index.js +2 -2
- package/es/components/EditSidePanel/EditSidePanel.js +9 -10
- package/es/components/EmptyStates/EmptyState.js +7 -6
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +4 -8
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +4 -8
- package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +4 -8
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +4 -8
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +4 -8
- package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +4 -8
- package/es/components/ExampleComponent/ExampleComponent.js +12 -13
- package/es/components/ExportModal/ExportModal.js +13 -9
- package/es/components/ExpressiveCard/ExpressiveCard.js +0 -8
- package/es/components/ImportModal/ImportModal.js +7 -5
- package/es/components/InlineEdit/InlineEdit.js +51 -46
- package/es/components/LoadingBar/LoadingBar.js +13 -17
- package/es/components/ModifiedTabs/ModifiedTabLabelNew.js +0 -4
- package/es/components/ModifiedTabs/ModifiedTabLabelWithClose.js +0 -5
- package/es/components/ModifiedTabs/ModifiedTabs.js +24 -18
- package/es/components/NotificationsPanel/NotificationsPanel.js +109 -86
- package/es/components/OptionsTile/OptionsTile.js +6 -9
- package/es/components/PageHeader/PageHeader.js +10 -7
- package/es/components/ProductiveCard/ProductiveCard.js +23 -12
- package/es/components/RemoveModal/RemoveModal.js +0 -3
- package/es/components/SidePanel/SidePanel.js +22 -17
- package/es/components/TagSet/TagSet.js +13 -9
- package/es/components/TagSet/TagSetModal.js +16 -12
- package/es/components/TagSet/TagSetOverflow.js +21 -13
- package/es/components/Tearsheet/Tearsheet.js +27 -18
- package/es/components/Tearsheet/TearsheetNarrow.js +18 -15
- package/es/components/Tearsheet/TearsheetShell.js +3 -4
- package/es/components/Toolbar/ToolbarButton.js +0 -3
- package/es/components/WebTerminal/WebTerminal.js +17 -18
- package/es/components/index.js +2 -2
- package/es/global/js/hooks/index.js +1 -0
- package/es/global/js/hooks/useActiveElement.js +27 -0
- package/es/global/js/package-settings.js +2 -1
- package/es/global/js/utils/DisplayBox.js +31 -0
- package/es/global/js/utils/Wrap.js +7 -5
- package/es/global/js/utils/deepCloneObject.js +26 -0
- package/es/global/js/utils/getScrollbarWidth.js +14 -0
- package/lib/components/APIKeyModal/APIKeyModal.js +10 -13
- package/lib/components/ActionBar/ActionBar.js +0 -3
- package/lib/components/ActionBar/ActionBarItem.js +2 -6
- package/lib/components/ActionSet/ActionSet.js +11 -13
- package/lib/components/AddSelect/AddSelect.js +119 -24
- package/lib/components/AddSelect/AddSelectBreadcrumbs.js +3 -4
- package/lib/components/AddSelect/AddSelectColumn.js +37 -0
- package/lib/components/AddSelect/AddSelectList.js +66 -9
- package/lib/components/AddSelect/AddSelectSidebar.js +43 -4
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +0 -3
- package/lib/components/ButtonMenu/ButtonMenu.js +6 -4
- package/lib/components/ButtonMenu/ButtonMenuItem.js +1 -2
- package/lib/components/Card/Card.js +31 -21
- package/lib/components/Card/CardFooter.js +14 -10
- package/lib/components/Card/CardHeader.js +8 -6
- package/lib/components/Cascade/Cascade.js +5 -4
- package/lib/components/ComboButton/ComboButton.js +0 -4
- package/lib/components/ComboButton/ComboButtonItem/index.js +0 -5
- package/lib/components/CreateFullPage/CreateFullPageStep.js +17 -14
- package/lib/components/CreateModal/CreateModal.js +1 -4
- package/lib/components/CreateTearsheet/CreateTearsheet.js +10 -11
- package/lib/components/CreateTearsheet/CreateTearsheetStep.js +20 -20
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +478 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +349 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +80 -0
- package/lib/components/DataSpreadsheet/createActiveCellFn.js +56 -0
- package/lib/components/DataSpreadsheet/createCellSelectionArea.js +56 -0
- package/lib/components/DataSpreadsheet/generateData.js +58 -0
- package/lib/components/DataSpreadsheet/getCellSize.js +39 -0
- package/lib/components/DataSpreadsheet/index.js +13 -0
- package/lib/components/EditSidePanel/EditSidePanel.js +9 -10
- package/lib/components/EmptyStates/EmptyState.js +9 -8
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +3 -7
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +3 -7
- package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +3 -7
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +3 -7
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +3 -7
- package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +3 -7
- package/lib/components/ExampleComponent/ExampleComponent.js +12 -13
- package/lib/components/ExportModal/ExportModal.js +13 -9
- package/lib/components/ExpressiveCard/ExpressiveCard.js +0 -8
- package/lib/components/ImportModal/ImportModal.js +7 -5
- package/lib/components/InlineEdit/InlineEdit.js +51 -46
- package/lib/components/LoadingBar/LoadingBar.js +13 -17
- package/lib/components/ModifiedTabs/ModifiedTabLabelNew.js +0 -4
- package/lib/components/ModifiedTabs/ModifiedTabLabelWithClose.js +0 -5
- package/lib/components/ModifiedTabs/ModifiedTabs.js +24 -18
- package/lib/components/NotificationsPanel/NotificationsPanel.js +109 -86
- package/lib/components/OptionsTile/OptionsTile.js +6 -9
- package/lib/components/PageHeader/PageHeader.js +9 -6
- package/lib/components/ProductiveCard/ProductiveCard.js +24 -18
- package/lib/components/RemoveModal/RemoveModal.js +0 -3
- package/lib/components/SidePanel/SidePanel.js +22 -17
- package/lib/components/TagSet/TagSet.js +13 -9
- package/lib/components/TagSet/TagSetModal.js +17 -13
- package/lib/components/TagSet/TagSetOverflow.js +24 -19
- package/lib/components/Tearsheet/Tearsheet.js +26 -17
- package/lib/components/Tearsheet/TearsheetNarrow.js +18 -15
- package/lib/components/Tearsheet/TearsheetShell.js +2 -3
- package/lib/components/Toolbar/ToolbarButton.js +0 -3
- package/lib/components/WebTerminal/WebTerminal.js +17 -18
- package/lib/components/index.js +8 -8
- package/lib/global/js/hooks/index.js +8 -0
- package/lib/global/js/hooks/useActiveElement.js +39 -0
- package/lib/global/js/package-settings.js +2 -1
- package/lib/global/js/utils/DisplayBox.js +46 -0
- package/lib/global/js/utils/Wrap.js +7 -5
- package/lib/global/js/utils/deepCloneObject.js +37 -0
- package/lib/global/js/utils/getScrollbarWidth.js +23 -0
- package/package.json +18 -16
- package/scss/components/{CancelableTextEdit → ActionBar}/_storybook-styles.scss +2 -2
- package/scss/components/ActionSet/_storybook-styles.scss +1 -3
- package/scss/components/AddSelect/_add-select.scss +77 -1
- package/scss/components/BreadcrumbWithOverflow/_storybook-styles.scss +8 -0
- package/scss/components/ButtonSetWithOverflow/_storybook-styles.scss +8 -0
- package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +120 -0
- package/scss/components/{CancelableTextEdit → DataSpreadsheet}/_index.scss +2 -2
- package/scss/components/DataSpreadsheet/_storybook-styles.scss +6 -0
- package/scss/components/InlineEdit/_inline-edit.scss +22 -8
- package/scss/components/InlineEdit/_storybook-styles.scss +1 -0
- package/scss/components/TagSet/_storybook-styles.scss +8 -0
- package/scss/components/Tearsheet/_tearsheet.scss +1 -2
- package/scss/components/_index.scss +1 -1
- package/scss/global/styles/_display-box.scss +62 -0
- package/es/components/CancelableTextEdit/CancelableTextEdit.js +0 -245
- package/lib/components/CancelableTextEdit/CancelableTextEdit.js +0 -265
- package/lib/components/CancelableTextEdit/index.js +0 -13
- package/scss/components/CancelableTextEdit/_cancelable-text-edit.scss +0 -212
|
@@ -10,13 +10,31 @@ import { Tabs, Tab } from 'carbon-components-react';
|
|
|
10
10
|
import { ModifiedTabLabelWithClose } from './ModifiedTabLabelWithClose';
|
|
11
11
|
import { ModifiedTabLabelNew } from './ModifiedTabLabelNew';
|
|
12
12
|
import { pkg } from '../../settings';
|
|
13
|
-
var componentName = 'ModifiedTabs';
|
|
13
|
+
var componentName = 'ModifiedTabs'; // Default values for props
|
|
14
|
+
|
|
15
|
+
var defaults = {
|
|
16
|
+
tabs: [{
|
|
17
|
+
id: 'tab-1',
|
|
18
|
+
label: 'Tab 1',
|
|
19
|
+
content: /*#__PURE__*/React.createElement("div", null, "Iam am the content of tab 1."),
|
|
20
|
+
unsavedContent: false
|
|
21
|
+
}],
|
|
22
|
+
newTabLabel: 'New tab',
|
|
23
|
+
newTabContent: 'Your new tab will be here soon',
|
|
24
|
+
onNewTab: undefined,
|
|
25
|
+
onCloseTab: undefined
|
|
26
|
+
};
|
|
14
27
|
export var ModifiedTabs = function ModifiedTabs(_ref) {
|
|
15
|
-
var tabs = _ref.tabs,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
28
|
+
var _ref$tabs = _ref.tabs,
|
|
29
|
+
tabs = _ref$tabs === void 0 ? defaults.tabs : _ref$tabs,
|
|
30
|
+
_ref$newTabLabel = _ref.newTabLabel,
|
|
31
|
+
newTabLabel = _ref$newTabLabel === void 0 ? defaults.newTabLabel : _ref$newTabLabel,
|
|
32
|
+
_ref$newTabContent = _ref.newTabContent,
|
|
33
|
+
newTabContent = _ref$newTabContent === void 0 ? defaults.newTabContent : _ref$newTabContent,
|
|
34
|
+
_ref$onNewTab = _ref.onNewTab,
|
|
35
|
+
onNewTab = _ref$onNewTab === void 0 ? defaults.onNewTab : _ref$onNewTab,
|
|
36
|
+
_ref$onCloseTab = _ref.onCloseTab,
|
|
37
|
+
onCloseTab = _ref$onCloseTab === void 0 ? defaults.onCloseTab : _ref$onCloseTab;
|
|
20
38
|
|
|
21
39
|
var handleNewTab = function handleNewTab() {
|
|
22
40
|
if (onNewTab) {
|
|
@@ -98,16 +116,4 @@ ModifiedTabs.propTypes = {
|
|
|
98
116
|
*/
|
|
99
117
|
tabs: PropTypes.array
|
|
100
118
|
};
|
|
101
|
-
ModifiedTabs.defaultProps = {
|
|
102
|
-
tabs: [{
|
|
103
|
-
id: 'tab-1',
|
|
104
|
-
label: 'Tab 1',
|
|
105
|
-
content: /*#__PURE__*/React.createElement("div", null, "Iam am the content of tab 1."),
|
|
106
|
-
unsavedContent: false
|
|
107
|
-
}],
|
|
108
|
-
newTabLabel: 'New tab',
|
|
109
|
-
newTabContent: 'Your new tab will be here soon',
|
|
110
|
-
onNewTab: undefined,
|
|
111
|
-
onCloseTab: undefined
|
|
112
|
-
};
|
|
113
119
|
ModifiedTabs.displayName = componentName;
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["className", "data", "daysAgoText", "dismissAllLabel", "dismissSingleNotificationIconDescription", "doNotDisturbDefaultToggled", "doNotDisturbLabel", "emptyStateLabel", "
|
|
5
|
+
var _excluded = ["className", "data", "daysAgoText", "dismissAllLabel", "dismissSingleNotificationIconDescription", "doNotDisturbDefaultToggled", "doNotDisturbLabel", "emptyStateLabel", "hourAgoText", "hoursAgoText", "minuteAgoText", "minutesAgoText", "monthAgoText", "monthsAgoText", "nowText", "onClickOutside", "onDismissAllNotifications", "onDismissSingleNotification", "onDoNotDisturbChange", "onSettingsClick", "onViewAllClick", "open", "previousLabel", "readLessLabel", "readMoreLabel", "secondsAgoText", "settingsIconDescription", "title", "todayLabel", "viewAllLabel", "yearAgoText", "yearsAgoText", "yesterdayAtText", "yesterdayLabel"];
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Copyright IBM Corp. 2020, 2022
|
|
@@ -26,42 +26,121 @@ import { ErrorFilled16, WarningAltFilled16, CheckmarkFilled16, InformationSquare
|
|
|
26
26
|
import { usePreviousValue } from '../../global/js/hooks'; // The block part of our conventional BEM class names (blockClass__E--M).
|
|
27
27
|
|
|
28
28
|
var componentName = 'NotificationsPanel';
|
|
29
|
-
var blockClass = "".concat(pkg.prefix, "--notifications-panel");
|
|
29
|
+
var blockClass = "".concat(pkg.prefix, "--notifications-panel"); // Default values for props
|
|
30
|
+
|
|
31
|
+
var defaults = {
|
|
32
|
+
daysAgoText: function daysAgoText(value) {
|
|
33
|
+
return "".concat(value, " days ago");
|
|
34
|
+
},
|
|
35
|
+
dismissAllLabel: 'Dismiss all',
|
|
36
|
+
dismissSingleNotificationIconDescription: 'Dismiss',
|
|
37
|
+
doNotDisturbLabel: 'Do not disturb',
|
|
38
|
+
emptyStateLabel: 'You do not have any notifications',
|
|
39
|
+
hourAgoText: function hourAgoText(value) {
|
|
40
|
+
return "".concat(value, " hour ago");
|
|
41
|
+
},
|
|
42
|
+
hoursAgoText: function hoursAgoText(value) {
|
|
43
|
+
return "".concat(value, " hours ago");
|
|
44
|
+
},
|
|
45
|
+
minuteAgoText: function minuteAgoText(value) {
|
|
46
|
+
return "".concat(value, " minute ago");
|
|
47
|
+
},
|
|
48
|
+
minutesAgoText: function minutesAgoText(value) {
|
|
49
|
+
return "".concat(value, " minutes ago");
|
|
50
|
+
},
|
|
51
|
+
monthAgoText: function monthAgoText(value) {
|
|
52
|
+
return "".concat(value, " month ago");
|
|
53
|
+
},
|
|
54
|
+
monthsAgoText: function monthsAgoText(value) {
|
|
55
|
+
return "".concat(value, " months ago");
|
|
56
|
+
},
|
|
57
|
+
nowText: 'Now',
|
|
58
|
+
onDismissAllNotifications: function onDismissAllNotifications() {},
|
|
59
|
+
onDismissSingleNotification: function onDismissSingleNotification() {},
|
|
60
|
+
previousLabel: 'Previous',
|
|
61
|
+
readLessLabel: 'Read less',
|
|
62
|
+
readMoreLabel: 'Read more',
|
|
63
|
+
secondsAgoText: function secondsAgoText(value) {
|
|
64
|
+
return "".concat(value, " seconds ago");
|
|
65
|
+
},
|
|
66
|
+
settingsIconDescription: 'Settings',
|
|
67
|
+
title: 'Notifications',
|
|
68
|
+
todayLabel: 'Today',
|
|
69
|
+
viewAllLabel: function viewAllLabel(value) {
|
|
70
|
+
return "View all (".concat(value, ")");
|
|
71
|
+
},
|
|
72
|
+
yearAgoText: function yearAgoText(value) {
|
|
73
|
+
return "".concat(value, " year ago");
|
|
74
|
+
},
|
|
75
|
+
yearsAgoText: function yearsAgoText(value) {
|
|
76
|
+
return "".concat(value, " years ago");
|
|
77
|
+
},
|
|
78
|
+
yesterdayAtText: function yesterdayAtText(value) {
|
|
79
|
+
return "Yesterday at ".concat(value);
|
|
80
|
+
},
|
|
81
|
+
yesterdayLabel: 'Yesterday'
|
|
82
|
+
};
|
|
30
83
|
export var NotificationsPanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
31
84
|
var className = _ref.className,
|
|
32
85
|
data = _ref.data,
|
|
33
|
-
daysAgoText = _ref.daysAgoText,
|
|
34
|
-
|
|
35
|
-
|
|
86
|
+
_ref$daysAgoText = _ref.daysAgoText,
|
|
87
|
+
daysAgoText = _ref$daysAgoText === void 0 ? defaults.daysAgoText : _ref$daysAgoText,
|
|
88
|
+
_ref$dismissAllLabel = _ref.dismissAllLabel,
|
|
89
|
+
dismissAllLabel = _ref$dismissAllLabel === void 0 ? defaults.dismissAllLabel : _ref$dismissAllLabel,
|
|
90
|
+
_ref$dismissSingleNot = _ref.dismissSingleNotificationIconDescription,
|
|
91
|
+
dismissSingleNotificationIconDescription = _ref$dismissSingleNot === void 0 ? defaults.dismissSingleNotificationIconDescription : _ref$dismissSingleNot,
|
|
36
92
|
doNotDisturbDefaultToggled = _ref.doNotDisturbDefaultToggled,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
93
|
+
_ref$doNotDisturbLabe = _ref.doNotDisturbLabel,
|
|
94
|
+
doNotDisturbLabel = _ref$doNotDisturbLabe === void 0 ? defaults.doNotDisturbLabel : _ref$doNotDisturbLabe,
|
|
95
|
+
_ref$emptyStateLabel = _ref.emptyStateLabel,
|
|
96
|
+
emptyStateLabel = _ref$emptyStateLabel === void 0 ? defaults.emptyStateLabel : _ref$emptyStateLabel,
|
|
97
|
+
_ref$hourAgoText = _ref.hourAgoText,
|
|
98
|
+
hourAgoText = _ref$hourAgoText === void 0 ? defaults.hourAgoText : _ref$hourAgoText,
|
|
99
|
+
_ref$hoursAgoText = _ref.hoursAgoText,
|
|
100
|
+
hoursAgoText = _ref$hoursAgoText === void 0 ? defaults.hoursAgoText : _ref$hoursAgoText,
|
|
101
|
+
_ref$minuteAgoText = _ref.minuteAgoText,
|
|
102
|
+
minuteAgoText = _ref$minuteAgoText === void 0 ? defaults.minuteAgoText : _ref$minuteAgoText,
|
|
103
|
+
_ref$minutesAgoText = _ref.minutesAgoText,
|
|
104
|
+
minutesAgoText = _ref$minutesAgoText === void 0 ? defaults.minutesAgoText : _ref$minutesAgoText,
|
|
105
|
+
_ref$monthAgoText = _ref.monthAgoText,
|
|
106
|
+
monthAgoText = _ref$monthAgoText === void 0 ? defaults.monthAgoText : _ref$monthAgoText,
|
|
107
|
+
_ref$monthsAgoText = _ref.monthsAgoText,
|
|
108
|
+
monthsAgoText = _ref$monthsAgoText === void 0 ? defaults.monthsAgoText : _ref$monthsAgoText,
|
|
109
|
+
_ref$nowText = _ref.nowText,
|
|
110
|
+
nowText = _ref$nowText === void 0 ? defaults.nowText : _ref$nowText,
|
|
46
111
|
onClickOutside = _ref.onClickOutside,
|
|
47
|
-
|
|
48
|
-
|
|
112
|
+
_ref$onDismissAllNoti = _ref.onDismissAllNotifications,
|
|
113
|
+
onDismissAllNotifications = _ref$onDismissAllNoti === void 0 ? defaults.onDismissAllNotifications : _ref$onDismissAllNoti,
|
|
114
|
+
_ref$onDismissSingleN = _ref.onDismissSingleNotification,
|
|
115
|
+
onDismissSingleNotification = _ref$onDismissSingleN === void 0 ? defaults.onDismissSingleNotification : _ref$onDismissSingleN,
|
|
49
116
|
onDoNotDisturbChange = _ref.onDoNotDisturbChange,
|
|
50
117
|
onSettingsClick = _ref.onSettingsClick,
|
|
51
118
|
onViewAllClick = _ref.onViewAllClick,
|
|
52
119
|
open = _ref.open,
|
|
53
|
-
previousLabel = _ref.previousLabel,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
120
|
+
_ref$previousLabel = _ref.previousLabel,
|
|
121
|
+
previousLabel = _ref$previousLabel === void 0 ? defaults.previousLabel : _ref$previousLabel,
|
|
122
|
+
_ref$readLessLabel = _ref.readLessLabel,
|
|
123
|
+
readLessLabel = _ref$readLessLabel === void 0 ? defaults.readLessLabel : _ref$readLessLabel,
|
|
124
|
+
_ref$readMoreLabel = _ref.readMoreLabel,
|
|
125
|
+
readMoreLabel = _ref$readMoreLabel === void 0 ? defaults.readMoreLabel : _ref$readMoreLabel,
|
|
126
|
+
_ref$secondsAgoText = _ref.secondsAgoText,
|
|
127
|
+
secondsAgoText = _ref$secondsAgoText === void 0 ? defaults.secondsAgoText : _ref$secondsAgoText,
|
|
128
|
+
_ref$settingsIconDesc = _ref.settingsIconDescription,
|
|
129
|
+
settingsIconDescription = _ref$settingsIconDesc === void 0 ? defaults.settingsIconDescription : _ref$settingsIconDesc,
|
|
130
|
+
_ref$title = _ref.title,
|
|
131
|
+
title = _ref$title === void 0 ? defaults.title : _ref$title,
|
|
132
|
+
_ref$todayLabel = _ref.todayLabel,
|
|
133
|
+
todayLabel = _ref$todayLabel === void 0 ? defaults.todayLabel : _ref$todayLabel,
|
|
134
|
+
_ref$viewAllLabel = _ref.viewAllLabel,
|
|
135
|
+
viewAllLabel = _ref$viewAllLabel === void 0 ? defaults.viewAllLabel : _ref$viewAllLabel,
|
|
136
|
+
_ref$yearAgoText = _ref.yearAgoText,
|
|
137
|
+
yearAgoText = _ref$yearAgoText === void 0 ? defaults.yearAgoText : _ref$yearAgoText,
|
|
138
|
+
_ref$yearsAgoText = _ref.yearsAgoText,
|
|
139
|
+
yearsAgoText = _ref$yearsAgoText === void 0 ? defaults.yearsAgoText : _ref$yearsAgoText,
|
|
140
|
+
_ref$yesterdayAtText = _ref.yesterdayAtText,
|
|
141
|
+
yesterdayAtText = _ref$yesterdayAtText === void 0 ? defaults.yesterdayAtText : _ref$yesterdayAtText,
|
|
142
|
+
_ref$yesterdayLabel = _ref.yesterdayLabel,
|
|
143
|
+
yesterdayLabel = _ref$yesterdayLabel === void 0 ? defaults.yesterdayLabel : _ref$yesterdayLabel,
|
|
65
144
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
66
145
|
|
|
67
146
|
var notificationPanelRef = useRef();
|
|
@@ -415,12 +494,12 @@ NotificationsPanel.propTypes = {
|
|
|
415
494
|
/**
|
|
416
495
|
* Function that will dismiss all notifications
|
|
417
496
|
*/
|
|
418
|
-
onDismissAllNotifications: PropTypes.func
|
|
497
|
+
onDismissAllNotifications: PropTypes.func,
|
|
419
498
|
|
|
420
499
|
/**
|
|
421
500
|
* Function that will dismiss a single notification
|
|
422
501
|
*/
|
|
423
|
-
onDismissSingleNotification: PropTypes.func
|
|
502
|
+
onDismissSingleNotification: PropTypes.func,
|
|
424
503
|
|
|
425
504
|
/**
|
|
426
505
|
* Function that returns the current selected value of the disable notification toggle
|
|
@@ -501,60 +580,4 @@ NotificationsPanel.propTypes = {
|
|
|
501
580
|
* Sets the yesterday label text
|
|
502
581
|
*/
|
|
503
582
|
yesterdayLabel: PropTypes.string
|
|
504
|
-
}; // Default values for component props. Default values are not required for
|
|
505
|
-
// props that are required, nor for props where the component can apply
|
|
506
|
-
// 'undefined' values reasonably. Default values should be provided when the
|
|
507
|
-
// component needs to make a choice or assumption when a prop is not supplied.
|
|
508
|
-
|
|
509
|
-
NotificationsPanel.defaultProps = {
|
|
510
|
-
daysAgoText: function daysAgoText(value) {
|
|
511
|
-
return "".concat(value, " days ago");
|
|
512
|
-
},
|
|
513
|
-
dismissAllLabel: 'Dismiss all',
|
|
514
|
-
dismissSingleNotificationIconDescription: 'Dismiss',
|
|
515
|
-
doNotDisturbLabel: 'Do not disturb',
|
|
516
|
-
emptyStateLabel: 'You do not have any notifications',
|
|
517
|
-
hourAgoText: function hourAgoText(value) {
|
|
518
|
-
return "".concat(value, " hour ago");
|
|
519
|
-
},
|
|
520
|
-
hoursAgoText: function hoursAgoText(value) {
|
|
521
|
-
return "".concat(value, " hours ago");
|
|
522
|
-
},
|
|
523
|
-
minuteAgoText: function minuteAgoText(value) {
|
|
524
|
-
return "".concat(value, " minute ago");
|
|
525
|
-
},
|
|
526
|
-
minutesAgoText: function minutesAgoText(value) {
|
|
527
|
-
return "".concat(value, " minutes ago");
|
|
528
|
-
},
|
|
529
|
-
monthAgoText: function monthAgoText(value) {
|
|
530
|
-
return "".concat(value, " month ago");
|
|
531
|
-
},
|
|
532
|
-
monthsAgoText: function monthsAgoText(value) {
|
|
533
|
-
return "".concat(value, " months ago");
|
|
534
|
-
},
|
|
535
|
-
nowText: 'Now',
|
|
536
|
-
onDismissAllNotifications: function onDismissAllNotifications() {},
|
|
537
|
-
onDismissSingleNotification: function onDismissSingleNotification() {},
|
|
538
|
-
previousLabel: 'Previous',
|
|
539
|
-
readLessLabel: 'Read less',
|
|
540
|
-
readMoreLabel: 'Read more',
|
|
541
|
-
secondsAgoText: function secondsAgoText(value) {
|
|
542
|
-
return "".concat(value, " seconds ago");
|
|
543
|
-
},
|
|
544
|
-
settingsIconDescription: 'Settings',
|
|
545
|
-
title: 'Notifications',
|
|
546
|
-
todayLabel: 'Today',
|
|
547
|
-
viewAllLabel: function viewAllLabel(value) {
|
|
548
|
-
return "View all (".concat(value, ")");
|
|
549
|
-
},
|
|
550
|
-
yearsAgoText: function yearsAgoText(value) {
|
|
551
|
-
return "".concat(value, " years ago");
|
|
552
|
-
},
|
|
553
|
-
yearAgoText: function yearAgoText(value) {
|
|
554
|
-
return "".concat(value, " year ago");
|
|
555
|
-
},
|
|
556
|
-
yesterdayLabel: 'Yesterday',
|
|
557
|
-
yesterdayAtText: function yesterdayAtText(value) {
|
|
558
|
-
return "Yesterday at ".concat(value);
|
|
559
|
-
}
|
|
560
583
|
};
|
|
@@ -25,7 +25,11 @@ import * as carbonMotion from '@carbon/motion'; // The block part of our convent
|
|
|
25
25
|
|
|
26
26
|
var blockClass = "".concat(pkg.prefix, "--options-tile");
|
|
27
27
|
var componentName = 'OptionsTile'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
|
|
28
|
+
// Default values for props
|
|
28
29
|
|
|
30
|
+
var defaults = {
|
|
31
|
+
size: 'xl'
|
|
32
|
+
};
|
|
29
33
|
/**
|
|
30
34
|
* TODO: A description of the component.
|
|
31
35
|
*/
|
|
@@ -42,7 +46,8 @@ export var OptionsTile = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
42
46
|
lockedText = _ref.lockedText,
|
|
43
47
|
onToggle = _ref.onToggle,
|
|
44
48
|
open = _ref.open,
|
|
45
|
-
size = _ref.size,
|
|
49
|
+
_ref$size = _ref.size,
|
|
50
|
+
size = _ref$size === void 0 ? defaults.size : _ref$size,
|
|
46
51
|
summary = _ref.summary,
|
|
47
52
|
warn = _ref.warn,
|
|
48
53
|
warnText = _ref.warnText,
|
|
@@ -316,12 +321,4 @@ OptionsTile.propTypes = {
|
|
|
316
321
|
* Provide a text explaining why the OptionsTile is in warning state.
|
|
317
322
|
*/
|
|
318
323
|
warnText: PropTypes.string
|
|
319
|
-
}; // Default values for component props. Default values are not required for
|
|
320
|
-
// props that are required, nor for props where the component can apply
|
|
321
|
-
// 'undefined' values reasonably. Default values should be provided when the
|
|
322
|
-
// component needs to make a choice or assumption when a prop is not supplied.
|
|
323
|
-
|
|
324
|
-
OptionsTile.defaultProps = {
|
|
325
|
-
open: false,
|
|
326
|
-
size: 'xl'
|
|
327
324
|
};
|
|
@@ -31,7 +31,12 @@ import { ButtonSetWithOverflow } from '../ButtonSetWithOverflow';
|
|
|
31
31
|
import { ChevronUp16 } from '@carbon/icons-react';
|
|
32
32
|
var componentName = 'PageHeader';
|
|
33
33
|
import { blockClass, utilCheckUpdateVerticalSpace, utilGetBreadcrumbItemForTitle, utilSetCollapsed } from './PageHeaderUtils';
|
|
34
|
-
import { PageHeaderTitle } from './PageHeaderTitle';
|
|
34
|
+
import { PageHeaderTitle } from './PageHeaderTitle'; // Default values for props
|
|
35
|
+
|
|
36
|
+
var defaults = {
|
|
37
|
+
fullWidthGrid: false,
|
|
38
|
+
narrowGrid: false
|
|
39
|
+
};
|
|
35
40
|
export var PageHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
36
41
|
var _withoutBackground, _ref6, _cx2, _ref7, _cx4, _cx7;
|
|
37
42
|
|
|
@@ -51,9 +56,11 @@ export var PageHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
51
56
|
collapseTitle = _ref.collapseTitle,
|
|
52
57
|
disableBreadcrumbScroll = _ref.disableBreadcrumbScroll,
|
|
53
58
|
expandHeaderIconDescription = _ref.expandHeaderIconDescription,
|
|
54
|
-
fullWidthGrid = _ref.fullWidthGrid,
|
|
59
|
+
_ref$fullWidthGrid = _ref.fullWidthGrid,
|
|
60
|
+
fullWidthGrid = _ref$fullWidthGrid === void 0 ? defaults.fullWidthGrid : _ref$fullWidthGrid,
|
|
55
61
|
hasCollapseHeaderToggle = _ref.hasCollapseHeaderToggle,
|
|
56
|
-
narrowGrid = _ref.narrowGrid,
|
|
62
|
+
_ref$narrowGrid = _ref.narrowGrid,
|
|
63
|
+
narrowGrid = _ref$narrowGrid === void 0 ? defaults.narrowGrid : _ref$narrowGrid,
|
|
57
64
|
navigation = _ref.navigation,
|
|
58
65
|
pageActions = _ref.pageActions,
|
|
59
66
|
pageActionsOverflowLabel = _ref.pageActionsOverflowLabel,
|
|
@@ -806,8 +813,4 @@ PageHeader.propTypes = _objectSpread({
|
|
|
806
813
|
*/
|
|
807
814
|
withoutBackground: PropTypes.bool
|
|
808
815
|
}, deprecatedProps);
|
|
809
|
-
PageHeader.defaultProps = {
|
|
810
|
-
fullWidthGrid: false,
|
|
811
|
-
narrowGrid: false
|
|
812
|
-
};
|
|
813
816
|
PageHeader.displayName = componentName;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["actionsPlacement"];
|
|
5
|
+
|
|
6
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7
|
+
|
|
8
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9
|
+
|
|
2
10
|
//
|
|
3
11
|
// Copyright IBM Corp. 2020, 2021
|
|
4
12
|
//
|
|
@@ -11,11 +19,21 @@ import { Card } from '../Card';
|
|
|
11
19
|
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
|
12
20
|
import { prepareProps } from '../../global/js/utils/props-helper';
|
|
13
21
|
import { pkg } from '../../settings';
|
|
14
|
-
var componentName = 'ProductiveCard';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
var componentName = 'ProductiveCard'; // Default values for props
|
|
23
|
+
|
|
24
|
+
var defaults = {
|
|
25
|
+
actionsPlacement: 'top'
|
|
26
|
+
};
|
|
27
|
+
export var ProductiveCard = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
28
|
+
var _ref$actionsPlacement = _ref.actionsPlacement,
|
|
29
|
+
actionsPlacement = _ref$actionsPlacement === void 0 ? defaults.actionsPlacement : _ref$actionsPlacement,
|
|
30
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
+
|
|
32
|
+
var validProps = prepareProps(rest, ['media', 'mediaPosition', 'onSecondaryButtonClick', 'pictogram', 'primaryButtonClick', 'productive', 'secondaryButtonKind', 'secondaryButtonText']);
|
|
33
|
+
return /*#__PURE__*/React.createElement(Card, _extends({}, _objectSpread(_objectSpread({}, validProps), {}, {
|
|
34
|
+
actionsPlacement: actionsPlacement,
|
|
35
|
+
ref: ref
|
|
36
|
+
}), {
|
|
19
37
|
productive: true
|
|
20
38
|
}, getDevtoolsProps(componentName)));
|
|
21
39
|
}); // Return a placeholder if not released and not enabled by feature flag
|
|
@@ -109,11 +127,4 @@ ProductiveCard.propTypes = {
|
|
|
109
127
|
*/
|
|
110
128
|
titleSize: PropTypes.oneOf(['default', 'large'])
|
|
111
129
|
};
|
|
112
|
-
ProductiveCard.defaultProps = {
|
|
113
|
-
actionIcons: [],
|
|
114
|
-
actionsPlacement: 'top',
|
|
115
|
-
clickZone: 'one',
|
|
116
|
-
overflowActions: [],
|
|
117
|
-
titleSize: 'default'
|
|
118
|
-
};
|
|
119
130
|
ProductiveCard.displayName = componentName;
|
|
@@ -34,7 +34,16 @@ import { Close20, ArrowLeft20 } from '@carbon/icons-react';
|
|
|
34
34
|
import { ActionSet } from '../ActionSet';
|
|
35
35
|
var blockClass = "".concat(pkg.prefix, "--side-panel");
|
|
36
36
|
var componentName = 'SidePanel'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
|
|
37
|
+
// Default values for props
|
|
37
38
|
|
|
39
|
+
var defaults = {
|
|
40
|
+
animateTitle: true,
|
|
41
|
+
closeIconDescription: 'Close',
|
|
42
|
+
currentStep: 0,
|
|
43
|
+
navigationBackIconDescription: 'Back',
|
|
44
|
+
placement: 'right',
|
|
45
|
+
size: 'md'
|
|
46
|
+
};
|
|
38
47
|
/**
|
|
39
48
|
* Side panels keep users in-context of a page while performing tasks like navigating, editing, viewing details, or configuring something new.
|
|
40
49
|
*/
|
|
@@ -44,24 +53,30 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
44
53
|
|
|
45
54
|
var actionToolbarButtons = _ref.actionToolbarButtons,
|
|
46
55
|
actions = _ref.actions,
|
|
47
|
-
animateTitle = _ref.animateTitle,
|
|
56
|
+
_ref$animateTitle = _ref.animateTitle,
|
|
57
|
+
animateTitle = _ref$animateTitle === void 0 ? defaults.animateTitle : _ref$animateTitle,
|
|
48
58
|
children = _ref.children,
|
|
49
59
|
className = _ref.className,
|
|
50
|
-
|
|
60
|
+
_ref$closeIconDescrip = _ref.closeIconDescription,
|
|
61
|
+
closeIconDescription = _ref$closeIconDescrip === void 0 ? defaults.closeIconDescription : _ref$closeIconDescrip,
|
|
51
62
|
condensedActions = _ref.condensedActions,
|
|
52
|
-
currentStep = _ref.currentStep,
|
|
63
|
+
_ref$currentStep = _ref.currentStep,
|
|
64
|
+
currentStep = _ref$currentStep === void 0 ? defaults.currentStep : _ref$currentStep,
|
|
53
65
|
includeOverlay = _ref.includeOverlay,
|
|
54
66
|
labelText = _ref.labelText,
|
|
55
|
-
|
|
67
|
+
_ref$navigationBackIc = _ref.navigationBackIconDescription,
|
|
68
|
+
navigationBackIconDescription = _ref$navigationBackIc === void 0 ? defaults.navigationBackIconDescription : _ref$navigationBackIc,
|
|
56
69
|
onNavigationBack = _ref.onNavigationBack,
|
|
57
70
|
onRequestClose = _ref.onRequestClose,
|
|
58
71
|
onUnmount = _ref.onUnmount,
|
|
59
72
|
open = _ref.open,
|
|
60
|
-
placement = _ref.placement,
|
|
73
|
+
_ref$placement = _ref.placement,
|
|
74
|
+
placement = _ref$placement === void 0 ? defaults.placement : _ref$placement,
|
|
61
75
|
preventCloseOnClickOutside = _ref.preventCloseOnClickOutside,
|
|
62
76
|
selectorPageContent = _ref.selectorPageContent,
|
|
63
77
|
selectorPrimaryFocus = _ref.selectorPrimaryFocus,
|
|
64
|
-
size = _ref.size,
|
|
78
|
+
_ref$size = _ref.size,
|
|
79
|
+
size = _ref$size === void 0 ? defaults.size : _ref$size,
|
|
65
80
|
slideIn = _ref.slideIn,
|
|
66
81
|
subtitle = _ref.subtitle,
|
|
67
82
|
title = _ref.title,
|
|
@@ -550,7 +565,7 @@ SidePanel.propTypes = {
|
|
|
550
565
|
/**
|
|
551
566
|
* Sets the close button icon description
|
|
552
567
|
*/
|
|
553
|
-
closeIconDescription: PropTypes.string
|
|
568
|
+
closeIconDescription: PropTypes.string,
|
|
554
569
|
|
|
555
570
|
/**
|
|
556
571
|
* Determines whether the side panel should render the condensed version (affects action buttons primarily)
|
|
@@ -647,14 +662,4 @@ SidePanel.propTypes = {
|
|
|
647
662
|
return labelText;
|
|
648
663
|
})
|
|
649
664
|
};
|
|
650
|
-
SidePanel.defaultProps = {
|
|
651
|
-
animateTitle: true,
|
|
652
|
-
placement: 'right',
|
|
653
|
-
size: 'md',
|
|
654
|
-
slideIn: false,
|
|
655
|
-
currentStep: 0,
|
|
656
|
-
navigationBackIconDescription: 'Back',
|
|
657
|
-
closeIconDescription: 'Close',
|
|
658
|
-
preventCloseOnClickOutside: false
|
|
659
|
-
};
|
|
660
665
|
SidePanel.displayName = componentName;
|
|
@@ -28,14 +28,23 @@ import { prepareProps, isRequiredIf } from '../../global/js/utils/props-helper';
|
|
|
28
28
|
import { pkg } from '../../settings';
|
|
29
29
|
var componentName = 'TagSet';
|
|
30
30
|
var blockClass = "".concat(pkg.prefix, "--tag-set");
|
|
31
|
-
var allTagsModalSearchThreshold = 10;
|
|
31
|
+
var allTagsModalSearchThreshold = 10; // Default values for props
|
|
32
|
+
|
|
33
|
+
var defaults = {
|
|
34
|
+
align: 'start',
|
|
35
|
+
overflowAlign: 'center',
|
|
36
|
+
overflowDirection: 'bottom'
|
|
37
|
+
};
|
|
32
38
|
export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
33
|
-
var align = _ref.align,
|
|
39
|
+
var _ref$align = _ref.align,
|
|
40
|
+
align = _ref$align === void 0 ? defaults.align : _ref$align,
|
|
34
41
|
className = _ref.className,
|
|
35
42
|
maxVisible = _ref.maxVisible,
|
|
36
|
-
overflowAlign = _ref.overflowAlign,
|
|
43
|
+
_ref$overflowAlign = _ref.overflowAlign,
|
|
44
|
+
overflowAlign = _ref$overflowAlign === void 0 ? defaults.overflowAlign : _ref$overflowAlign,
|
|
37
45
|
overflowClassName = _ref.overflowClassName,
|
|
38
|
-
|
|
46
|
+
_ref$overflowDirectio = _ref.overflowDirection,
|
|
47
|
+
overflowDirection = _ref$overflowDirectio === void 0 ? defaults.overflowDirection : _ref$overflowDirectio,
|
|
39
48
|
allTagsModalTitle = _ref.allTagsModalTitle,
|
|
40
49
|
allTagsModalSearchLabel = _ref.allTagsModalSearchLabel,
|
|
41
50
|
allTagsModalSearchPlaceholderText = _ref.allTagsModalSearchPlaceholderText,
|
|
@@ -320,10 +329,5 @@ TagSet.propTypes = {
|
|
|
320
329
|
type: PropTypes.oneOf(tagTypes)
|
|
321
330
|
})))
|
|
322
331
|
};
|
|
323
|
-
TagSet.defaultProps = {
|
|
324
|
-
align: 'start',
|
|
325
|
-
overflowAlign: 'center',
|
|
326
|
-
overflowDirection: 'bottom'
|
|
327
|
-
};
|
|
328
332
|
TagSet.displayName = componentName;
|
|
329
333
|
export default TagSet;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
|
-
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
+
var _excluded = ["allTags", "className", "title", "onClose", "open", "searchLabel", "searchPlaceholder"],
|
|
6
|
+
_excluded2 = ["label"];
|
|
6
7
|
|
|
7
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8
9
|
|
|
@@ -21,15 +22,22 @@ import { ComposedModal, ModalHeader, ModalBody, Search, Tag } from 'carbon-compo
|
|
|
21
22
|
import { pkg } from '../../settings';
|
|
22
23
|
import { prepareProps } from '../../global/js/utils/props-helper';
|
|
23
24
|
var componentName = 'TagSetModal';
|
|
24
|
-
var blockClass = "".concat(pkg.prefix, "--tag-set-modal");
|
|
25
|
+
var blockClass = "".concat(pkg.prefix, "--tag-set-modal"); // Default values for props
|
|
26
|
+
|
|
27
|
+
var defaults = {
|
|
28
|
+
// marked as required by TagSet if needed, default used to satisfy <Search /> component
|
|
29
|
+
searchLabel: ''
|
|
30
|
+
};
|
|
25
31
|
export var TagSetModal = function TagSetModal(_ref) {
|
|
26
32
|
var allTags = _ref.allTags,
|
|
27
33
|
className = _ref.className,
|
|
28
34
|
title = _ref.title,
|
|
29
35
|
onClose = _ref.onClose,
|
|
30
36
|
open = _ref.open,
|
|
31
|
-
searchLabel = _ref.searchLabel,
|
|
32
|
-
|
|
37
|
+
_ref$searchLabel = _ref.searchLabel,
|
|
38
|
+
searchLabel = _ref$searchLabel === void 0 ? defaults.searchLabel : _ref$searchLabel,
|
|
39
|
+
searchPlaceholder = _ref.searchPlaceholder,
|
|
40
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
33
41
|
|
|
34
42
|
var _useState = useState([]),
|
|
35
43
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -69,13 +77,13 @@ export var TagSetModal = function TagSetModal(_ref) {
|
|
|
69
77
|
setSearch(ev.target.value || '');
|
|
70
78
|
};
|
|
71
79
|
|
|
72
|
-
return /*#__PURE__*/React.createElement(ComposedModal, {
|
|
80
|
+
return /*#__PURE__*/React.createElement(ComposedModal, _extends({}, rest, {
|
|
73
81
|
containerClassName: "".concat(blockClass, "__container"),
|
|
74
82
|
className: cx(className, "".concat(blockClass)),
|
|
75
83
|
size: "sm",
|
|
76
84
|
open: open,
|
|
77
85
|
onClose: onClose
|
|
78
|
-
}, /*#__PURE__*/React.createElement(ModalHeader, {
|
|
86
|
+
}), /*#__PURE__*/React.createElement(ModalHeader, {
|
|
79
87
|
title: title,
|
|
80
88
|
className: "".concat(blockClass, "__header")
|
|
81
89
|
}, /*#__PURE__*/React.createElement(Search, {
|
|
@@ -90,7 +98,7 @@ export var TagSetModal = function TagSetModal(_ref) {
|
|
|
90
98
|
hasForm: true
|
|
91
99
|
}, filteredModalTags.map(function (_ref2, index) {
|
|
92
100
|
var label = _ref2.label,
|
|
93
|
-
other = _objectWithoutProperties(_ref2,
|
|
101
|
+
other = _objectWithoutProperties(_ref2, _excluded2);
|
|
94
102
|
|
|
95
103
|
return /*#__PURE__*/React.createElement(Tag, _extends({}, other, {
|
|
96
104
|
filter: false,
|
|
@@ -111,8 +119,4 @@ TagSetModal.propTypes = {
|
|
|
111
119
|
searchPlaceholder: PropTypes.string,
|
|
112
120
|
title: PropTypes.string
|
|
113
121
|
};
|
|
114
|
-
TagSetModal.defaultProps = {
|
|
115
|
-
// marked as required by TagSet if needed, default used to satisfy <Search /> component
|
|
116
|
-
searchLabel: ''
|
|
117
|
-
};
|
|
118
122
|
TagSetModal.displayName = componentName;
|