@carbon/ibm-products 2.2.0 → 2.3.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 +965 -434
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +4 -4
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +354 -155
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +2 -2
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +600 -236
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +4 -4
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +516 -293
- package/css/index.css.map +1 -1
- package/css/index.min.css +4 -4
- package/css/index.min.css.map +1 -1
- package/es/components/APIKeyModal/APIKeyModal.docs-page.js +26 -0
- package/es/components/AboutModal/AboutModal.docs-page.js +21 -0
- package/es/components/AboutModal/AboutModal.js +2 -4
- package/es/components/ActionBar/ActionBar.js +2 -6
- package/es/components/AddSelect/AddSelectFormControl.js +6 -6
- package/es/components/AddSelect/AddSelectRow.js +15 -5
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +5 -6
- package/es/components/ButtonMenu/ButtonMenu.js +4 -4
- package/es/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +3 -9
- package/es/components/Cascade/Cascade.docs-page.js +22 -0
- package/es/components/Cascade/Cascade.js +11 -1
- package/es/components/CreateFullPage/CreateFullPage.docs-page.js +39 -0
- package/es/components/CreateFullPage/CreateFullPage.js +13 -0
- package/es/components/CreateModal/CreateModal.docs-page.js +24 -0
- package/es/components/CreateModal/CreateModal.js +7 -0
- package/es/components/CreateSidePanel/CreateSidePanel.docs-page.js +18 -0
- package/es/components/CreateSidePanel/CreateSidePanel.js +1 -1
- package/es/components/CreateTearsheet/CreateTearsheet.docs-page.js +29 -0
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +3 -3
- package/es/components/Datagrid/Datagrid/DatagridContent.js +1 -1
- package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -3
- package/es/components/Datagrid/Datagrid/DatagridToolbar.js +25 -10
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +1 -3
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/TearsheetWrapper.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +39 -47
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +20 -24
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/index.js +2 -2
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js +13 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +44 -15
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +16 -30
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +2 -2
- package/es/components/Datagrid/index.js +2 -1
- package/es/components/Datagrid/useActionsColumn.js +10 -7
- package/es/components/Datagrid/useCustomizeColumns.js +9 -7
- package/es/components/Datagrid/useExpandedRow.js +11 -7
- package/es/components/Datagrid/useFiltering.js +12 -8
- package/es/components/Datagrid/useInlineEdit.js +3 -0
- package/es/components/Datagrid/useNestedRows.js +10 -6
- package/es/components/Datagrid/useStickyColumn.js +10 -3
- package/es/components/Datagrid/utils/DatagridActions.js +12 -20
- package/es/components/EditFullPage/EditFullPage.docs-page.js +39 -0
- package/es/components/EditFullPage/EditFullPage.js +2 -1
- package/es/components/EditSidePanel/EditSidePanel.js +1 -1
- package/es/components/EditTearsheet/EditTearsheet.docs-page.js +25 -0
- package/es/components/EditTearsheet/EditTearsheet.js +4 -0
- package/es/components/EditTearsheetNarrow/EditTearsheetNarrow.js +1 -1
- package/es/components/EditUpdateCards/EditUpdateCards.js +3 -2
- package/es/components/EmptyStates/EmptyState.js +4 -0
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +4 -0
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +4 -0
- package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +4 -0
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +4 -0
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +4 -0
- package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +4 -0
- package/es/components/ExampleComponent/ExampleComponent.docs-page.js +22 -0
- package/es/components/ExportModal/ExportModal.js +4 -0
- package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
- package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
- package/es/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
- package/es/components/ImportModal/ImportModal.docs-page.js +18 -0
- package/es/components/ImportModal/ImportModal.js +13 -6
- package/es/components/MultiAddSelect/MultiAddSelect.docs-page.js +17 -0
- package/es/components/MultiAddSelect/MultiAddSelect.js +4 -0
- package/es/components/NotificationsPanel/preview-components/UnreadNotificationBell.js +2 -17
- package/es/components/PageHeader/PageHeader.js +2 -6
- package/es/components/PageHeader/PageHeaderUtils.js +2 -2
- package/es/components/RemoveModal/RemoveModal.docs-page.js +18 -0
- package/es/components/RemoveModal/RemoveModal.js +6 -0
- package/es/components/SidePanel/SidePanel.js +1 -3
- package/es/components/SingleAddSelect/SingleAddSelect.docs-page.js +15 -0
- package/es/components/SingleAddSelect/SingleAddSelect.js +4 -0
- package/es/components/StatusIcon/StatusIcon.docs-page.js +17 -0
- package/es/components/StatusIcon/StatusIcon.js +10 -0
- package/es/components/TagSet/TagSet.js +4 -7
- package/es/components/Tearsheet/TearsheetShell.js +11 -6
- package/es/components/Toolbar/Toolbar.docs-page.js +14 -0
- package/es/components/UserProfileImage/UserProfileImage.docs-page.js +17 -0
- package/es/components/UserProfileImage/UserProfileImage.js +14 -3
- package/es/components/WebTerminal/WebTerminal.docs-page.js +52 -0
- package/es/components/WebTerminal/WebTerminal.js +4 -0
- package/es/components/index.js +1 -1
- package/es/global/js/hooks/useCreateComponentStepChange.js +16 -15
- package/es/global/js/hooks/useResizeObserver.js +14 -28
- package/es/global/js/package-settings.js +14 -1
- package/es/global/js/utils/StoryDocsPage.js +218 -0
- package/es/global/js/utils/story-helper.js +108 -6
- package/lib/components/APIKeyModal/APIKeyModal.docs-page.js +37 -0
- package/lib/components/AboutModal/AboutModal.docs-page.js +32 -0
- package/lib/components/AboutModal/AboutModal.js +2 -4
- package/lib/components/ActionBar/ActionBar.js +2 -6
- package/lib/components/AddSelect/AddSelectFormControl.js +6 -6
- package/lib/components/AddSelect/AddSelectRow.js +15 -5
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +5 -6
- package/lib/components/ButtonMenu/ButtonMenu.js +4 -4
- package/lib/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +3 -9
- package/lib/components/Cascade/Cascade.docs-page.js +33 -0
- package/lib/components/Cascade/Cascade.js +11 -1
- package/lib/components/CreateFullPage/CreateFullPage.docs-page.js +50 -0
- package/lib/components/CreateFullPage/CreateFullPage.js +13 -0
- package/lib/components/CreateModal/CreateModal.docs-page.js +35 -0
- package/lib/components/CreateModal/CreateModal.js +7 -0
- package/lib/components/CreateSidePanel/CreateSidePanel.docs-page.js +29 -0
- package/lib/components/CreateSidePanel/CreateSidePanel.js +1 -1
- package/lib/components/CreateTearsheet/CreateTearsheet.docs-page.js +40 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +3 -3
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +1 -1
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -3
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +25 -10
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +1 -3
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/TearsheetWrapper.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +37 -45
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +20 -24
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/index.js +6 -6
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js +20 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +42 -13
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +16 -30
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +2 -2
- package/lib/components/Datagrid/index.js +8 -1
- package/lib/components/Datagrid/useActionsColumn.js +12 -7
- package/lib/components/Datagrid/useCustomizeColumns.js +10 -8
- package/lib/components/Datagrid/useExpandedRow.js +9 -6
- package/lib/components/Datagrid/useFiltering.js +10 -7
- package/lib/components/Datagrid/useInlineEdit.js +3 -0
- package/lib/components/Datagrid/useNestedRows.js +9 -6
- package/lib/components/Datagrid/useStickyColumn.js +10 -3
- package/lib/components/Datagrid/utils/DatagridActions.js +49 -57
- package/lib/components/EditFullPage/EditFullPage.docs-page.js +50 -0
- package/lib/components/EditFullPage/EditFullPage.js +2 -1
- package/lib/components/EditSidePanel/EditSidePanel.js +1 -1
- package/lib/components/EditTearsheet/EditTearsheet.docs-page.js +36 -0
- package/lib/components/EditTearsheet/EditTearsheet.js +4 -0
- package/lib/components/EditTearsheetNarrow/EditTearsheetNarrow.js +1 -1
- package/lib/components/EditUpdateCards/EditUpdateCards.js +3 -2
- package/lib/components/EmptyStates/EmptyState.js +4 -0
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +4 -0
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +4 -0
- package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +4 -0
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +4 -0
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +4 -0
- package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +4 -0
- package/lib/components/ExampleComponent/ExampleComponent.docs-page.js +33 -0
- package/lib/components/ExportModal/ExportModal.js +4 -0
- package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
- package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
- package/lib/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
- package/lib/components/ImportModal/ImportModal.docs-page.js +26 -0
- package/lib/components/ImportModal/ImportModal.js +13 -6
- package/lib/components/MultiAddSelect/MultiAddSelect.docs-page.js +25 -0
- package/lib/components/MultiAddSelect/MultiAddSelect.js +4 -0
- package/lib/components/NotificationsPanel/preview-components/UnreadNotificationBell.js +2 -17
- package/lib/components/PageHeader/PageHeader.js +2 -6
- package/lib/components/PageHeader/PageHeaderUtils.js +2 -2
- package/lib/components/RemoveModal/RemoveModal.docs-page.js +26 -0
- package/lib/components/RemoveModal/RemoveModal.js +6 -0
- package/lib/components/SidePanel/SidePanel.js +1 -3
- package/lib/components/SingleAddSelect/SingleAddSelect.docs-page.js +23 -0
- package/lib/components/SingleAddSelect/SingleAddSelect.js +4 -0
- package/lib/components/StatusIcon/StatusIcon.docs-page.js +28 -0
- package/lib/components/StatusIcon/StatusIcon.js +10 -0
- package/lib/components/TagSet/TagSet.js +4 -7
- package/lib/components/Tearsheet/TearsheetShell.js +11 -6
- package/lib/components/Toolbar/Toolbar.docs-page.js +25 -0
- package/lib/components/UserProfileImage/UserProfileImage.docs-page.js +28 -0
- package/lib/components/UserProfileImage/UserProfileImage.js +14 -3
- package/lib/components/WebTerminal/WebTerminal.docs-page.js +63 -0
- package/lib/components/WebTerminal/WebTerminal.js +4 -0
- package/lib/components/index.js +6 -0
- package/lib/global/js/hooks/useCreateComponentStepChange.js +16 -15
- package/lib/global/js/hooks/useResizeObserver.js +13 -27
- package/lib/global/js/package-settings.js +14 -1
- package/lib/global/js/utils/StoryDocsPage.js +225 -0
- package/lib/global/js/utils/story-helper.js +115 -7
- package/package.json +4 -4
- package/scss/components/AddSelect/_add-select.scss +10 -6
- package/scss/components/BreadcrumbWithOverflow/_breadcrumb-with-overflow.scss +0 -1
- package/scss/components/ButtonMenu/_button-menu.scss +32 -1
- package/scss/components/Cascade/_storybook-styles.scss +3 -2
- package/scss/components/CreateFullPage/_create-full-page.scss +3 -3
- package/scss/components/CreateModal/_create-modal.scss +3 -3
- package/scss/components/CreateSidePanel/_create-side-panel.scss +4 -4
- package/scss/components/CreateTearsheet/_create-tearsheet.scss +2 -2
- package/scss/components/CreateTearsheet/_storybook-styles.scss +1 -1
- package/scss/components/CreateTearsheetNarrow/_create-tearsheet-narrow.scss +2 -2
- package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +5 -5
- package/scss/components/DataSpreadsheet/_storybook-styles.scss +6 -0
- package/scss/components/Datagrid/_datagrid.scss +4 -2
- package/scss/components/Datagrid/_storybook-styles.scss +18 -4
- package/scss/components/Datagrid/styles/_datagrid.scss +26 -13
- package/scss/components/Datagrid/styles/addons/_FilterFlyout.scss +7 -0
- package/scss/components/Datagrid/styles/addons/_FilterPanel.scss +4 -0
- package/scss/components/EditSidePanel/_edit-side-panel.scss +2 -2
- package/scss/components/EditTearsheet/_edit-tearsheet.scss +2 -2
- package/scss/components/EditTearsheet/_storybook-styles.scss +1 -1
- package/scss/components/ImportModal/_import-modal.scss +1 -1
- package/scss/components/NotificationsPanel/_notifications-panel.scss +3 -3
- package/scss/components/NotificationsPanel/_storybook-styles.scss +10 -2
- package/scss/components/OptionsTile/_storybook-styles.scss +1 -1
- package/scss/components/PageHeader/_page-header.scss +4 -5
- package/scss/components/PageHeader/_storybook-styles.scss +24 -14
- package/scss/components/Saving/_saving.scss +1 -1
- package/scss/components/SidePanel/_side-panel.scss +3 -5
- package/scss/components/TagSet/_tag-set.scss +1 -1
- package/scss/components/Tearsheet/_tearsheet.scss +9 -8
- package/scss/components/UserProfileImage/_user-profile-image.scss +2 -2
- package/scss/components/WebTerminal/_storybook-styles.scss +11 -1
- package/scss/global/styles/_display-box.scss +1 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +0 -21
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +0 -30
- package/scss/components/HTTPErrors/_storybook-styles.scss +0 -6
|
@@ -7,14 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.DatagridActions = void 0;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _react2 = require("@carbon/react");
|
|
13
10
|
var _icons = require("@carbon/react/icons");
|
|
11
|
+
var _react = require("@carbon/react");
|
|
12
|
+
var _ButtonMenu = require("../../ButtonMenu");
|
|
13
|
+
var _react2 = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _addonActions = require("@storybook/addon-actions");
|
|
15
15
|
var _settings = require("../../../settings");
|
|
16
|
-
var
|
|
17
|
-
var _Filtering = require("../Datagrid/addons/Filtering");
|
|
16
|
+
var _hooks = require("../Datagrid/addons/Filtering/hooks");
|
|
18
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
19
|
/**
|
|
@@ -26,8 +25,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
26
25
|
|
|
27
26
|
var blockClass = "".concat(_settings.pkg.prefix, "--datagrid");
|
|
28
27
|
var DatagridActions = function DatagridActions(datagridState) {
|
|
29
|
-
var
|
|
30
|
-
setPanelOpen =
|
|
28
|
+
var _useFilterContext = (0, _hooks.useFilterContext)(),
|
|
29
|
+
setPanelOpen = _useFilterContext.setPanelOpen;
|
|
31
30
|
var selectedFlatRows = datagridState.selectedFlatRows,
|
|
32
31
|
setGlobalFilter = datagridState.setGlobalFilter,
|
|
33
32
|
CustomizeColumnsButton = datagridState.CustomizeColumnsButton,
|
|
@@ -52,38 +51,31 @@ var DatagridActions = function DatagridActions(datagridState) {
|
|
|
52
51
|
}
|
|
53
52
|
};
|
|
54
53
|
var renderFilterFlyout = function renderFilterFlyout() {
|
|
55
|
-
return (filterProps === null || filterProps === void 0 ? void 0 : filterProps.variation) === 'flyout' && /*#__PURE__*/
|
|
54
|
+
return (filterProps === null || filterProps === void 0 ? void 0 : filterProps.variation) === 'flyout' && /*#__PURE__*/_react2.default.createElement(FilterFlyout, getFilterFlyoutProps());
|
|
56
55
|
};
|
|
57
56
|
var renderFilterPanelButton = function renderFilterPanelButton() {
|
|
58
|
-
return (filterProps === null || filterProps === void 0 ? void 0 : filterProps.variation) === 'panel' && /*#__PURE__*/
|
|
57
|
+
return (filterProps === null || filterProps === void 0 ? void 0 : filterProps.variation) === 'panel' && /*#__PURE__*/_react2.default.createElement(_react.IconButton, {
|
|
59
58
|
kind: "ghost",
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
renderIcon: function renderIcon(props) {
|
|
63
|
-
return /*#__PURE__*/_react.default.createElement(_icons.Filter, (0, _extends2.default)({
|
|
64
|
-
size: 16
|
|
65
|
-
}, props));
|
|
66
|
-
},
|
|
67
|
-
iconDescription: filterProps.panelIconDescription,
|
|
59
|
+
align: "bottom",
|
|
60
|
+
label: filterProps.panelIconDescription,
|
|
68
61
|
className: "".concat(blockClass, "-filter-panel-open-button"),
|
|
69
62
|
onClick: function onClick() {
|
|
70
63
|
return setPanelOpen(function (open) {
|
|
71
64
|
return !open;
|
|
72
65
|
});
|
|
73
66
|
},
|
|
74
|
-
disabled: data.length === 0
|
|
75
|
-
|
|
76
|
-
});
|
|
67
|
+
disabled: data.length === 0
|
|
68
|
+
}, /*#__PURE__*/_react2.default.createElement(_icons.Filter, null));
|
|
77
69
|
};
|
|
78
|
-
var _useState = (0,
|
|
70
|
+
var _useState = (0, _react2.useState)(false),
|
|
79
71
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
80
72
|
modalOpen = _useState2[0],
|
|
81
73
|
setModalOpen = _useState2[1];
|
|
82
|
-
var _useState3 = (0,
|
|
74
|
+
var _useState3 = (0, _react2.useState)(window.innerWidth),
|
|
83
75
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
84
76
|
size = _useState4[0],
|
|
85
77
|
setSize = _useState4[1];
|
|
86
|
-
(0,
|
|
78
|
+
(0, _react2.useLayoutEffect)(function () {
|
|
87
79
|
function updateSize() {
|
|
88
80
|
setSize(window.innerWidth);
|
|
89
81
|
}
|
|
@@ -94,54 +86,54 @@ var DatagridActions = function DatagridActions(datagridState) {
|
|
|
94
86
|
}, []);
|
|
95
87
|
var mobileToolbar = size < 672 ? true : false;
|
|
96
88
|
var items = ['Option 1', 'Option 2', 'Option 3'];
|
|
97
|
-
return isNothingSelected && (useDenseHeader && useDenseHeader ? /*#__PURE__*/
|
|
89
|
+
return isNothingSelected && (useDenseHeader && useDenseHeader ? /*#__PURE__*/_react2.default.createElement(_react.TableToolbarContent, {
|
|
98
90
|
size: "sm"
|
|
99
|
-
}, !mobileToolbar ? /*#__PURE__*/
|
|
91
|
+
}, !mobileToolbar ? /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, renderFilterPanelButton(), /*#__PURE__*/_react2.default.createElement("div", {
|
|
100
92
|
style: style
|
|
101
|
-
}, /*#__PURE__*/
|
|
93
|
+
}, /*#__PURE__*/_react2.default.createElement(_react.Button, {
|
|
102
94
|
kind: "ghost",
|
|
103
95
|
hasIconOnly: true,
|
|
104
96
|
tooltipPosition: "bottom",
|
|
105
97
|
renderIcon: _icons.Download,
|
|
106
98
|
iconDescription: 'Download CSV',
|
|
107
99
|
onClick: downloadCsv
|
|
108
|
-
})), renderFilterFlyout(), CustomizeColumnsButton && /*#__PURE__*/
|
|
100
|
+
})), renderFilterFlyout(), CustomizeColumnsButton && /*#__PURE__*/_react2.default.createElement("div", {
|
|
109
101
|
style: style
|
|
110
|
-
}, /*#__PURE__*/
|
|
102
|
+
}, /*#__PURE__*/_react2.default.createElement(CustomizeColumnsButton, null)), /*#__PURE__*/_react2.default.createElement(RowSizeDropdown, rowSizeDropdownProps), /*#__PURE__*/_react2.default.createElement("div", {
|
|
111
103
|
style: style,
|
|
112
104
|
className: "".concat(blockClass, "__toolbar-divider")
|
|
113
|
-
}, /*#__PURE__*/
|
|
105
|
+
}, /*#__PURE__*/_react2.default.createElement(_react.Button, {
|
|
114
106
|
kind: "ghost",
|
|
115
107
|
renderIcon: _icons.Add,
|
|
116
108
|
iconDescription: 'Action'
|
|
117
|
-
}, "Ghost button"))) : /*#__PURE__*/
|
|
109
|
+
}, "Ghost button"))) : /*#__PURE__*/_react2.default.createElement(_react.OverflowMenu, {
|
|
118
110
|
"aria-label": "Tools",
|
|
119
111
|
size: "md",
|
|
120
112
|
flipped: true
|
|
121
|
-
}, /*#__PURE__*/
|
|
113
|
+
}, /*#__PURE__*/_react2.default.createElement(_react.OverflowMenuItem, {
|
|
122
114
|
itemText: "Filter",
|
|
123
115
|
hasDivider: true,
|
|
124
116
|
requireTitle: true,
|
|
125
117
|
onClick: function onClick() {
|
|
126
118
|
return setModalOpen(true);
|
|
127
119
|
}
|
|
128
|
-
}), /*#__PURE__*/
|
|
120
|
+
}), /*#__PURE__*/_react2.default.createElement(_react.OverflowMenuItem, {
|
|
129
121
|
itemText: "Export",
|
|
130
122
|
hasDivider: true,
|
|
131
123
|
requireTitle: true
|
|
132
|
-
}), /*#__PURE__*/
|
|
124
|
+
}), /*#__PURE__*/_react2.default.createElement(_react.OverflowMenuItem, {
|
|
133
125
|
itemText: "Settings",
|
|
134
126
|
hasDivider: true,
|
|
135
127
|
requireTitle: true
|
|
136
|
-
}), /*#__PURE__*/
|
|
128
|
+
}), /*#__PURE__*/_react2.default.createElement(_react.OverflowMenuItem, {
|
|
137
129
|
itemText: "Import items",
|
|
138
130
|
hasDivider: true,
|
|
139
131
|
requireTitle: true
|
|
140
|
-
}), /*#__PURE__*/
|
|
132
|
+
}), /*#__PURE__*/_react2.default.createElement(_react.OverflowMenuItem, {
|
|
141
133
|
itemText: "Create",
|
|
142
134
|
hasDivider: true,
|
|
143
135
|
requireTitle: true
|
|
144
|
-
}))) : !mobileToolbar ? /*#__PURE__*/
|
|
136
|
+
}))) : !mobileToolbar ? /*#__PURE__*/_react2.default.createElement(_react.TableToolbarContent, null, renderFilterPanelButton(), /*#__PURE__*/_react2.default.createElement(_react.TableToolbarSearch, {
|
|
145
137
|
size: "xl",
|
|
146
138
|
id: "columnSearch",
|
|
147
139
|
persistent: true,
|
|
@@ -149,40 +141,40 @@ var DatagridActions = function DatagridActions(datagridState) {
|
|
|
149
141
|
onChange: function onChange(e) {
|
|
150
142
|
return setGlobalFilter(e.target.value);
|
|
151
143
|
}
|
|
152
|
-
}), renderFilterFlyout(), /*#__PURE__*/
|
|
144
|
+
}), renderFilterFlyout(), /*#__PURE__*/_react2.default.createElement("div", {
|
|
153
145
|
style: style
|
|
154
|
-
}, /*#__PURE__*/
|
|
146
|
+
}, /*#__PURE__*/_react2.default.createElement(_react.Button, {
|
|
155
147
|
kind: "ghost",
|
|
156
148
|
hasIconOnly: true,
|
|
157
149
|
tooltipPosition: "bottom",
|
|
158
150
|
renderIcon: _icons.Restart,
|
|
159
151
|
iconDescription: 'Refresh',
|
|
160
152
|
onClick: refreshColumns
|
|
161
|
-
})), /*#__PURE__*/
|
|
153
|
+
})), /*#__PURE__*/_react2.default.createElement("div", {
|
|
162
154
|
style: style
|
|
163
|
-
}, /*#__PURE__*/
|
|
155
|
+
}, /*#__PURE__*/_react2.default.createElement(_react.Button, {
|
|
164
156
|
kind: "ghost",
|
|
165
157
|
hasIconOnly: true,
|
|
166
158
|
tooltipPosition: "bottom",
|
|
167
159
|
renderIcon: _icons.Download,
|
|
168
160
|
iconDescription: 'Download CSV',
|
|
169
161
|
onClick: downloadCsv
|
|
170
|
-
})), CustomizeColumnsButton && /*#__PURE__*/
|
|
162
|
+
})), CustomizeColumnsButton && /*#__PURE__*/_react2.default.createElement("div", {
|
|
171
163
|
style: style
|
|
172
|
-
}, /*#__PURE__*/
|
|
164
|
+
}, /*#__PURE__*/_react2.default.createElement(CustomizeColumnsButton, null)), /*#__PURE__*/_react2.default.createElement(RowSizeDropdown, rowSizeDropdownProps), /*#__PURE__*/_react2.default.createElement(_ButtonMenu.ButtonMenu, {
|
|
173
165
|
label: "Primary button",
|
|
174
166
|
renderIcon: _icons.ChevronDown,
|
|
175
167
|
menuOptionsClass: "".concat(blockClass, "__toolbar-options")
|
|
176
|
-
}, /*#__PURE__*/
|
|
168
|
+
}, /*#__PURE__*/_react2.default.createElement(_ButtonMenu.ButtonMenuItem, {
|
|
177
169
|
itemText: "Option 1",
|
|
178
170
|
onClick: (0, _addonActions.action)("Click on ButtonMenu Option 1")
|
|
179
|
-
}), /*#__PURE__*/
|
|
171
|
+
}), /*#__PURE__*/_react2.default.createElement(_ButtonMenu.ButtonMenuItem, {
|
|
180
172
|
itemText: "Option 2",
|
|
181
173
|
onClick: (0, _addonActions.action)("Click on ButtonMenu Option 2")
|
|
182
|
-
}), /*#__PURE__*/
|
|
174
|
+
}), /*#__PURE__*/_react2.default.createElement(_ButtonMenu.ButtonMenuItem, {
|
|
183
175
|
itemText: "Option 3",
|
|
184
176
|
onClick: (0, _addonActions.action)("Click on ButtonMenu Option 3")
|
|
185
|
-
}))) : /*#__PURE__*/
|
|
177
|
+
}))) : /*#__PURE__*/_react2.default.createElement(_react.TableToolbarContent, null, renderFilterPanelButton(), /*#__PURE__*/_react2.default.createElement(_react.TableToolbarSearch, {
|
|
186
178
|
size: "xl",
|
|
187
179
|
id: "columnSearch",
|
|
188
180
|
persistent: true,
|
|
@@ -190,59 +182,59 @@ var DatagridActions = function DatagridActions(datagridState) {
|
|
|
190
182
|
onChange: function onChange(e) {
|
|
191
183
|
return setGlobalFilter(e.target.value);
|
|
192
184
|
}
|
|
193
|
-
}), renderFilterFlyout(), /*#__PURE__*/
|
|
185
|
+
}), renderFilterFlyout(), /*#__PURE__*/_react2.default.createElement(_react.OverflowMenu, {
|
|
194
186
|
"aria-label": "Tools",
|
|
195
187
|
size: "lg",
|
|
196
188
|
flipped: true,
|
|
197
189
|
renderIcon: _icons.ChevronDown,
|
|
198
190
|
className: "".concat(blockClass, "__toolbar-menu__trigger"),
|
|
199
191
|
menuOptionsClass: "".concat(blockClass, "__toolbar-options")
|
|
200
|
-
}, /*#__PURE__*/
|
|
192
|
+
}, /*#__PURE__*/_react2.default.createElement(_react.OverflowMenuItem, {
|
|
201
193
|
itemText: "Filter",
|
|
202
194
|
hasDivider: true,
|
|
203
195
|
requireTitle: true,
|
|
204
196
|
onClick: function onClick() {
|
|
205
197
|
return setModalOpen(true);
|
|
206
198
|
}
|
|
207
|
-
}), /*#__PURE__*/
|
|
199
|
+
}), /*#__PURE__*/_react2.default.createElement(_react.OverflowMenuItem, {
|
|
208
200
|
itemText: "Export",
|
|
209
201
|
hasDivider: true,
|
|
210
202
|
requireTitle: true
|
|
211
|
-
}), /*#__PURE__*/
|
|
203
|
+
}), /*#__PURE__*/_react2.default.createElement(_react.OverflowMenuItem, {
|
|
212
204
|
itemText: "Settings",
|
|
213
205
|
hasDivider: true,
|
|
214
206
|
requireTitle: true
|
|
215
|
-
}), /*#__PURE__*/
|
|
207
|
+
}), /*#__PURE__*/_react2.default.createElement(_react.OverflowMenuItem, {
|
|
216
208
|
itemText: "Import items",
|
|
217
209
|
hasDivider: true,
|
|
218
210
|
requireTitle: true
|
|
219
|
-
}), /*#__PURE__*/
|
|
211
|
+
}), /*#__PURE__*/_react2.default.createElement(_react.OverflowMenuItem, {
|
|
220
212
|
itemText: "Create",
|
|
221
213
|
hasDivider: true,
|
|
222
214
|
requireTitle: true
|
|
223
|
-
})), modalOpen && /*#__PURE__*/
|
|
215
|
+
})), modalOpen && /*#__PURE__*/_react2.default.createElement(_react.ComposedModal, {
|
|
224
216
|
size: "lg",
|
|
225
217
|
open: modalOpen && modalOpen,
|
|
226
218
|
onClose: function onClose() {
|
|
227
219
|
return setModalOpen(false);
|
|
228
220
|
},
|
|
229
221
|
className: "".concat(blockClass, "__mobile-toolbar-modal")
|
|
230
|
-
}, /*#__PURE__*/
|
|
222
|
+
}, /*#__PURE__*/_react2.default.createElement(_react.ModalHeader, null, /*#__PURE__*/_react2.default.createElement("h4", null, "Filters")), /*#__PURE__*/_react2.default.createElement(_react.ModalBody, null, /*#__PURE__*/_react2.default.createElement(_react.Dropdown, {
|
|
231
223
|
initialSelectedItem: items[2],
|
|
232
224
|
items: items,
|
|
233
225
|
titleText: "Label",
|
|
234
226
|
id: "filter1"
|
|
235
|
-
}), /*#__PURE__*/
|
|
227
|
+
}), /*#__PURE__*/_react2.default.createElement(_react.Dropdown, {
|
|
236
228
|
initialSelectedItem: items[2],
|
|
237
229
|
items: items,
|
|
238
230
|
titleText: "Label",
|
|
239
231
|
id: "filter2"
|
|
240
|
-
}), /*#__PURE__*/
|
|
232
|
+
}), /*#__PURE__*/_react2.default.createElement(_react.Dropdown, {
|
|
241
233
|
initialSelectedItem: items[2],
|
|
242
234
|
items: items,
|
|
243
235
|
titleText: "Label",
|
|
244
236
|
id: "filter3"
|
|
245
|
-
})), /*#__PURE__*/
|
|
237
|
+
})), /*#__PURE__*/_react2.default.createElement(_react.ModalFooter, {
|
|
246
238
|
primaryButtonText: "Apply",
|
|
247
239
|
secondaryButtonText: "Cancel"
|
|
248
240
|
}))));
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _StoryDocsPage = require("../../global/js/utils/StoryDocsPage");
|
|
11
|
+
var stories = _interopRequireWildcard(require("./EditFullPage.stories"));
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
+
var DocsPage = function DocsPage() {
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_StoryDocsPage.StoryDocsPage, {
|
|
16
|
+
altGuidelinesHref: "https://pages.github.ibm.com/cdai-design/pal/patterns/edit/usage#full-page-edit",
|
|
17
|
+
blocks: [{
|
|
18
|
+
description: "There are **2** components that make up a Create Full Page component, which can\nbe used in unison to create the desired look, or flow. Please note, to utilize\nthe Create Full Page component, you'll need to have a minimum of two steps. If\nyou are looking for a one step creation flow, consider Create Tearsheet, Create\nSide Panel, or Create Modal."
|
|
19
|
+
}, {
|
|
20
|
+
story: stories.editFullPage,
|
|
21
|
+
description: "This is used when you have one section per step. This can be created by passing\nin the overall `<CreateFullPage />` component and the `<CreateFullPageStep />`\ncomponent with form items as children:",
|
|
22
|
+
source: {
|
|
23
|
+
code: "<CreateFullPage {...props}>\n <CreateFullPageStep\n title=\"Required title\"\n subtitle=\"Optional subtitle\"\n description=\"Optional description\"\n onNext={() => {'Optional function'}}\n >\n <Row>\n <Column xlg={5} lg={5} md={4} sm={4}>\n <TextInput\n id=\"test-1\"\n invalidText=\"A valid value is required\"\n labelText=\"Topic name\"\n placeholder=\"Enter topic name\"\n />\n </Column>\n </Row>\n </CreateFullPageStep>\n </CreateFullPage>"
|
|
24
|
+
}
|
|
25
|
+
}, {
|
|
26
|
+
story: stories.editFullPageWithSections,
|
|
27
|
+
description: "This is used when you have several sections per step. This can be created by\npassing in the overall `<CreateFullPage />` component and the\n`<CreateFullPageStep />` component for the first `section`. All additional\n`sections` must be passed in as children, as shown below:",
|
|
28
|
+
source: {
|
|
29
|
+
code: "<CreateFullPageStep\n title=\"Required title\"\n subtitle=\"Optional subtitle\"\n description=\"Optional description\"\n onNext={() => {'Optional function'}}\n >\n <Row>\n <Column xlg={5} lg={5} md={4} sm={4}>\n <fieldset className={`#{$pkg-prefix}--create-full-page__step-fieldset`}>\n <TextInput\n id=\"test-1\"\n invalidText=\"A valid value is required\"\n labelText=\"Topic name\"\n placeholder=\"Enter topic name\"\n />\n </fieldset>\n </Column>\n </Row>\n <span className={`#{$pkg-prefix}--create-full-page__section-divider`} />\n <h5 className={`#{$pkg-prefix}--create-full-page__step-title`}>Required title</h5>\n <h6 className={`#{$pkg-prefix}--create-full-page__step-subtitle`}>\n Optional subtitle\n </h6>\n <p className={`#{$pkg-prefix}--create-full-page__step-description`}>\n Optional description\n </p>\n <Row>\n <Column xlg={5} lg={5} md={4} sm={4}>\n <fieldset className={`#{$pkg-prefix}--create-full-page__step-fieldset`}>\n <TextInput\n id=\"test-2\"\n invalidText=\"A valid value is required\"\n labelText=\"Topic name\"\n placeholder=\"Enter topic name\"\n />\n </fieldset>\n </Column>\n </Row>\n</CreateFullPageStep>"
|
|
30
|
+
}
|
|
31
|
+
}, {
|
|
32
|
+
title: 'Using custom components',
|
|
33
|
+
description: "It is possible to use custom components that return `CreateFullPageStep`s in\norder to help reduce the amount of logic in the component that contains the main\n`CreateFullPage`. _It is required that each child of the `CreateFullPage` either\nbe a custom step or a `CreateFullPageStep`_. An example of this could look like\nthe following:",
|
|
34
|
+
source: {
|
|
35
|
+
code: "const CreateStepCustom = ({ subtitle, ...rest }) => {\n return (\n <CreateFullPageStep\n {...rest}\n subtitle={subtitle}\n title=\"Step 1\"\n onNext={() => console.log('optional validation check')}\n onMount={() => console.log('optional onMount fn')}\n disableSubmit={false}\n >\n step content here\n </CreateFullPageStep>\n );\n};\n\nconst CreateComponent = () => {\n return (\n <CreateFullPage {...createFullPageProps}>\n <CreateStepCustom subtitle=\"Custom step subtitle\" />\n <CreateFullPageStep\n title=\"Topic name\"\n fieldsetLegendText=\"Topic information\"\n disableSubmit={!value}\n subtitle=\"This is the unique name used to recognize your topic\"\n description=\"It will also be used by your producers and consumers as part of the\n connection information, so make it something easy to recognize.\"\n >\n Content for second step\n </CreateFullPageStep>\n </CreateFullPage>\n );\n};"
|
|
36
|
+
}
|
|
37
|
+
}, {
|
|
38
|
+
title: 'Using dynamic steps',
|
|
39
|
+
description: "The use of dynamic steps can be utilized in a scenario when the user makes a\ncertain selection on one step that effects which steps will follow it, this is\ncontrolled via the `includeStep` prop. See abbreviated example below:",
|
|
40
|
+
source: {
|
|
41
|
+
code: "import { useState } from 'react';\n\nconst CreateFlow = () => {\n const [shouldIncludeAdditionalStep, setShouldIncludeAdditionalStep] =\n useState(false);\n return (\n <CreateFullPage {...createFullPageProps}>\n <CreateFullPageStep {...step1Props}>\n Step 1 content\n <Checkbox\n labelText={`Include additional step`}\n id=\"include-additional-step-checkbox\"\n onChange={(value) => setShouldIncludeAdditionalStep(value)}\n checked={shouldIncludeAdditionalStep}\n />\n </CreateFullPageStep>\n <CreateFullPageStep\n {...step2Props}\n includeStep={shouldIncludeAdditionalStep}\n >\n Dynamic step content\n </CreateFullPageStep>\n <CreateFullPageStep {...step3Props}>\n Final step content\n </CreateFullPageStep>\n </CreateFullPage>\n );\n};"
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
title: 'Class names',
|
|
45
|
+
description: "Additionally, to get the preferred styling when including your own children as\nsections, you can utilize the below included class names.\n\n| Class name | Element | Features |\n| ---------------------------------------------------- | ----------- | ---------------------------------------------------------- |\n| `#{$pkg-prefix}--create-full-page__step-title` | title | `productive-heading-04` & `margin-bottom` of `$spacing-05` |\n| `#{$pkg-prefix}--create-full-page__step-subtitle` | subtitle | `productive-heading-01` & `margin-bottom` of `$spacing-03` |\n| `#{$pkg-prefix}--create-full-page__step-description` | description | `body-long-01` & `margin-bottom` of `$spacing-06` |\n| `#{$pkg-prefix}--create-full-page__step-fieldset` | fieldset | `margin-bottom` of `$spacing-05` to all children elements |\n| `#{$pkg-prefix}--create-full-page__section-divider` | divider | Includes a `1px` divider line inside the `main` content |\n"
|
|
46
|
+
}]
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
var _default = DocsPage;
|
|
50
|
+
exports.default = _default;
|
|
@@ -43,7 +43,8 @@ var componentName = 'EditFullPage';
|
|
|
43
43
|
// };
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* Use when settings on a page need to always be shown in edit mode, or when the context of the page is needed to make several changes.
|
|
47
|
+
* See usage guidance for further details.
|
|
47
48
|
*/
|
|
48
49
|
var EditFullPage = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
49
50
|
var children = _ref.children,
|
|
@@ -41,7 +41,7 @@ var defaults = {
|
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Use with medium complexity edits if the user needs page context.
|
|
45
45
|
*/
|
|
46
46
|
var EditSidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
47
47
|
var children = _ref.children,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _StoryDocsPage = require("../../global/js/utils/StoryDocsPage");
|
|
11
|
+
var stories = _interopRequireWildcard(require("./EditTearsheet.stories"));
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
+
var DocsPage = function DocsPage() {
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_StoryDocsPage.StoryDocsPage, {
|
|
16
|
+
altGuidelinesHref: "https://pages.github.ibm.com/cdai-design/pal/patterns/edit/usage#tearsheet-edit",
|
|
17
|
+
blocks: [{
|
|
18
|
+
story: stories.multiFormEditTearsheet,
|
|
19
|
+
description: "This is used when you have one section per step. This can be created by passing\nin the overall `<EditTearsheet />` component and the `<EditTearsheetForm />`\ncomponent with form items as children:",
|
|
20
|
+
source: {
|
|
21
|
+
code: "<EditTearsheet {...props}>\n <EditTearsheetForm\n title=\"Required title\"\n subtitle=\"Optional subtitle\"\n description=\"Optional description\"\n onNext={() => {\n 'Optional function';\n }}\n >\n <TextInput\n id=\"test-1\"\n invalidText=\"A valid value is required\"\n labelText=\"Topic name\"\n placeholder=\"Enter topic name\"\n />\n </EditTearsheetForm>\n</EditTearsheet>"
|
|
22
|
+
}
|
|
23
|
+
}, {
|
|
24
|
+
title: 'Using custom components',
|
|
25
|
+
description: "It is possible to use custom components that return `EditTearsheetForms` in\norder to help reduce the amount of logic in the component that contains the main\n`EditTearsheet`. _It is required that each child of the `EditTearsheet` either\nbe a custom step or a `EditTearsheetForm`_. An example of this could look like\nthe following:",
|
|
26
|
+
source: {
|
|
27
|
+
code: "const CreateFormCustom = ({ subtitle, ...rest }) => {\n return (\n <EditTearsheetForm {...rest} subtitle={subtitle} title=\"Form 1\">\n form content here\n </EditTearsheetForm>\n );\n};\n\nconst CreateComponent = () => {\n return (\n <EditTearsheet {...EditTearsheetProps}>\n <CreateFormCustom subtitle=\"Custom form subtitle\" />\n <EditTearsheetForm\n title=\"Topic name\"\n fieldsetLegendText=\"Topic information\"\n subtitle=\"This is the unique name used to recognize your topic\"\n description=\"It will also be used by your producers and consumers as part of the\n connection information, so make it something easy to recognize.\"\n >\n Content for second form\n </EditTearsheetForm>\n </EditTearsheet>\n );\n};"
|
|
28
|
+
}
|
|
29
|
+
}, {
|
|
30
|
+
title: "Class names",
|
|
31
|
+
description: "Additionally, to get the preferred styling when including your own children as\nsections, you can utilize the below included class names.\n\n| Class name | Element | Features |\n| ----------------------------------------------------- | ----------- | ---------------------------------------------------------- |\n| `#{$pkg-prefix}--create-tearsheet__form--title` | title | `productive-heading-04` & `margin-bottom` of `$spacing-05` |\n| `#{$pkg-prefix}--create-tearsheet__form--subtitle` | subtitle | `productive-heading-01` & `margin-bottom` of `$spacing-03` |\n| `#{$pkg-prefix}--create-tearsheet__form--description` | description | `body-long-01` & `margin-bottom` of `$spacing-06` |\n| `#{$pkg-prefix}--create-tearsheet__form--fieldset` | fieldset | `margin-bottom` of `$spacing-05` to all children elements |\n"
|
|
32
|
+
}]
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
var _default = DocsPage;
|
|
36
|
+
exports.default = _default;
|
|
@@ -44,6 +44,10 @@ var defaults = {
|
|
|
44
44
|
verticalPosition: 'normal',
|
|
45
45
|
influencerWidth: 'narrow'
|
|
46
46
|
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Use Tearsheet with medium to complex edits. See usage guidance for further information.
|
|
50
|
+
*/
|
|
47
51
|
var EditTearsheet = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
48
52
|
var cancelButtonText = _ref.cancelButtonText,
|
|
49
53
|
children = _ref.children,
|
|
@@ -43,7 +43,7 @@ var componentName = 'EditTearsheetNarrow';
|
|
|
43
43
|
// };
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* Use a narrow tearsheet as an alternative to a modal when there is scrolling. See usage guidance for further information.
|
|
47
47
|
*/
|
|
48
48
|
var EditTearsheetNarrow = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
49
49
|
var children = _ref.children,
|
|
@@ -47,9 +47,10 @@ var componentName = 'EditUpdateCards';
|
|
|
47
47
|
// };
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
|
-
|
|
50
|
+
Editable cards allow a user to view, modify, and save the content contained within the card.
|
|
51
|
+
These cards are generally used in instances where a user needs to make changes to a resource instances
|
|
52
|
+
(ex. configuration details), account plan, etc. Editable cards allow a user to edit something within context.
|
|
51
53
|
*/
|
|
52
|
-
|
|
53
54
|
var EditUpdateCards = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
54
55
|
var actionIcons = _ref.actionIcons,
|
|
55
56
|
actionsPlacement = _ref.actionsPlacement,
|
|
@@ -36,6 +36,10 @@ var defaults = {
|
|
|
36
36
|
position: 'top',
|
|
37
37
|
size: 'lg'
|
|
38
38
|
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
|
|
42
|
+
*/
|
|
39
43
|
exports.defaults = defaults;
|
|
40
44
|
var EmptyState = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
41
45
|
var action = _ref.action,
|
|
@@ -31,6 +31,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
31
31
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
|
32
32
|
var blockClass = "".concat(_settings.pkg.prefix, "--empty-state");
|
|
33
33
|
var componentName = 'ErrorEmptyState';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
|
|
37
|
+
*/
|
|
34
38
|
var ErrorEmptyState = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
35
39
|
var action = _ref.action,
|
|
36
40
|
className = _ref.className,
|
|
@@ -31,6 +31,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
31
31
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
|
32
32
|
var blockClass = "".concat(_settings.pkg.prefix, "--empty-state");
|
|
33
33
|
var componentName = 'NoDataEmptyState';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
|
|
37
|
+
*/
|
|
34
38
|
var NoDataEmptyState = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
35
39
|
var action = _ref.action,
|
|
36
40
|
className = _ref.className,
|
|
@@ -31,6 +31,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
31
31
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
|
32
32
|
var blockClass = "".concat(_settings.pkg.prefix, "--empty-state");
|
|
33
33
|
var componentName = 'NoTagsEmptyState';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
|
|
37
|
+
*/
|
|
34
38
|
var NoTagsEmptyState = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
35
39
|
var action = _ref.action,
|
|
36
40
|
className = _ref.className,
|
|
@@ -31,6 +31,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
31
31
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
|
32
32
|
var blockClass = "".concat(_settings.pkg.prefix, "--empty-state");
|
|
33
33
|
var componentName = 'NotFoundEmptyState';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
|
|
37
|
+
*/
|
|
34
38
|
var NotFoundEmptyState = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
35
39
|
var action = _ref.action,
|
|
36
40
|
className = _ref.className,
|
|
@@ -31,6 +31,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
31
31
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
|
32
32
|
var blockClass = "".concat(_settings.pkg.prefix, "--empty-state");
|
|
33
33
|
var componentName = 'NotificationsEmptyState';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
|
|
37
|
+
*/
|
|
34
38
|
var NotificationsEmptyState = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
35
39
|
var action = _ref.action,
|
|
36
40
|
className = _ref.className,
|
|
@@ -31,6 +31,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
31
31
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
|
32
32
|
var blockClass = "".concat(_settings.pkg.prefix, "--empty-state");
|
|
33
33
|
var componentName = 'UnauthorizedEmptyState';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
|
|
37
|
+
*/
|
|
34
38
|
var UnauthorizedEmptyState = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
35
39
|
var action = _ref.action,
|
|
36
40
|
className = _ref.className,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _StoryDocsPage = require("../../global/js/utils/StoryDocsPage");
|
|
11
|
+
var stories = _interopRequireWildcard(require("./ExampleComponent.stories"));
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
+
/**
|
|
15
|
+
* Copyright IBM Corp. 2023, 2023
|
|
16
|
+
*
|
|
17
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
18
|
+
* LICENSE file in the root directory of this source tree.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* OPTIONAL: required only to customize default docs page
|
|
23
|
+
*/
|
|
24
|
+
var DocsPage = function DocsPage() {
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_StoryDocsPage.StoryDocsPage, {
|
|
26
|
+
blocks: [{
|
|
27
|
+
description: 'Here it is in use.',
|
|
28
|
+
story: stories.exampleComponent
|
|
29
|
+
}]
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
var _default = DocsPage;
|
|
33
|
+
exports.default = _default;
|
|
@@ -36,6 +36,10 @@ var defaults = {
|
|
|
36
36
|
preformattedExtensions: Object.freeze([]),
|
|
37
37
|
validExtensions: Object.freeze([])
|
|
38
38
|
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Modal dialog version of the export pattern
|
|
42
|
+
*/
|
|
39
43
|
var ExportModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
40
44
|
var body = _ref.body,
|
|
41
45
|
className = _ref.className,
|
|
@@ -26,6 +26,12 @@ var _excluded = ["className", "description", "errorCodeLabel", "links", "title"]
|
|
|
26
26
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
|
27
27
|
var blockClass = "".concat(_settings.pkg.prefix, "--http-errors");
|
|
28
28
|
var componentName = 'HTTPError403';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* HTTP errors are used in an attempt to access something that isn’t available or
|
|
32
|
+
the user doesn’t have permission for. This HTTPError component is generic so you
|
|
33
|
+
can use it when you receive an error code that isn't provided.
|
|
34
|
+
*/
|
|
29
35
|
var HTTPError403 = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
30
36
|
var className = _ref.className,
|
|
31
37
|
description = _ref.description,
|
|
@@ -26,6 +26,12 @@ var _excluded = ["className", "description", "errorCodeLabel", "links", "title"]
|
|
|
26
26
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
|
27
27
|
var blockClass = "".concat(_settings.pkg.prefix, "--http-errors");
|
|
28
28
|
var componentName = 'HTTPError404';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* HTTP errors are used in an attempt to access something that isn’t available or
|
|
32
|
+
the user doesn’t have permission for. This HTTPError component is generic so you
|
|
33
|
+
can use it when you receive an error code that isn't provided.
|
|
34
|
+
*/
|
|
29
35
|
var HTTPError404 = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
30
36
|
var className = _ref.className,
|
|
31
37
|
description = _ref.description,
|
|
@@ -26,6 +26,12 @@ var _excluded = ["className", "description", "errorCodeLabel", "links", "title"]
|
|
|
26
26
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
|
27
27
|
var blockClass = "".concat(_settings.pkg.prefix, "--http-errors");
|
|
28
28
|
var componentName = 'HTTPErrorOther';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* HTTP errors are used in an attempt to access something that isn’t available or
|
|
32
|
+
the user doesn’t have permission for. This HTTPError component is generic so you
|
|
33
|
+
can use it when you receive an error code that isn't provided.
|
|
34
|
+
*/
|
|
29
35
|
var HTTPErrorOther = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
30
36
|
var className = _ref.className,
|
|
31
37
|
description = _ref.description,
|