@carbon/ibm-products 2.39.0 → 2.40.1-canary.10
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +47 -38
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +7 -1
- 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 +47 -38
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +710 -38
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/AddSelect/AddSelect.d.ts +44 -2
- package/es/components/AddSelect/AddSelect.js +8 -4
- package/es/components/AddSelect/AddSelectBody.d.ts +44 -2
- package/es/components/AddSelect/AddSelectBody.js +10 -12
- package/es/components/AddSelect/AddSelectSort.d.ts +16 -17
- package/es/components/AddSelect/AddSelectSort.js +5 -5
- package/es/components/AddSelect/types/index.d.ts +44 -0
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.d.ts +5 -1
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +12 -6
- package/es/components/Card/Card.js +1 -1
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +3 -3
- package/es/components/ConditionBuilder/ConditionBuilder.js +6 -1
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +3 -3
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +2 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +3 -3
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js +30 -18
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +3 -3
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +7 -7
- package/es/components/ConditionBuilder/ConditionConnector/ConditionConnector.js +6 -6
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +11 -11
- package/es/components/ConditionBuilder/utils/checkForHoldingKey.d.ts +1 -0
- package/es/components/ConditionBuilder/utils/checkForHoldingKey.js +16 -0
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -0
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +125 -0
- package/es/components/ConditionBuilder/utils/util.d.ts +1 -1
- package/es/components/ConditionBuilder/utils/util.js +34 -5
- package/es/components/CreateInfluencer/CreateInfluencer.js +1 -1
- package/es/components/CreateTearsheet/CreateTearsheetStep.d.ts +95 -2
- package/es/components/CreateTearsheet/CreateTearsheetStep.js +7 -5
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +4 -3
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +5 -0
- package/es/components/Datagrid/Datagrid/DatagridContent.js +2 -2
- package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +3 -4
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -1
- package/es/components/ExpressiveCard/ExpressiveCard.d.ts +2 -1
- package/es/components/Guidebanner/Guidebanner.d.ts +62 -2
- package/es/components/Guidebanner/Guidebanner.js +8 -7
- package/es/components/Guidebanner/GuidebannerElement.d.ts +30 -17
- package/es/components/Guidebanner/GuidebannerElement.js +4 -4
- package/es/components/Guidebanner/GuidebannerElementButton.d.ts +29 -15
- package/es/components/Guidebanner/GuidebannerElementButton.js +10 -4
- package/es/components/Guidebanner/GuidebannerElementLink.d.ts +20 -13
- package/es/components/Guidebanner/GuidebannerElementLink.js +3 -3
- package/es/components/InterstitialScreen/InterstitialScreen.js +3 -1
- package/es/components/MultiAddSelect/MultiAddSelect.d.ts +134 -2
- package/es/components/MultiAddSelect/MultiAddSelect.js +2 -1
- package/es/components/NotificationsPanel/NotificationsPanel.js +0 -1
- package/es/components/PageHeader/PageHeader.d.ts +298 -5
- package/es/components/PageHeader/PageHeader.js +99 -47
- package/es/components/PageHeader/PageHeaderUtils.d.ts +1 -1
- package/es/components/PageHeader/PageHeaderUtils.js +4 -1
- package/es/components/SidePanel/SidePanel.d.ts +6 -2
- package/es/components/SidePanel/SidePanel.js +17 -2
- package/es/components/SidePanel/constants.d.ts +1 -0
- package/es/components/SidePanel/constants.js +1 -0
- package/es/components/SingleAddSelect/SingleAddSelect.d.ts +69 -2
- package/es/components/SingleAddSelect/SingleAddSelect.js +2 -1
- package/es/components/TagOverflow/TagOverflow.js +35 -20
- package/es/components/TagOverflow/TagOverflowModal.d.ts +3 -1
- package/es/components/TagOverflow/TagOverflowModal.js +14 -20
- package/es/components/TagOverflow/TagOverflowPopover.js +19 -4
- package/es/components/Tearsheet/Tearsheet.d.ts +132 -6
- package/es/components/Tearsheet/Tearsheet.js +25 -13
- package/es/components/Tearsheet/TearsheetShell.d.ts +5 -1
- package/es/components/Tearsheet/TearsheetShell.js +26 -4
- package/es/components/WebTerminal/WebTerminal.d.ts +4 -0
- package/es/components/WebTerminal/WebTerminal.js +11 -3
- package/es/global/js/hooks/useFocus.d.ts +3 -1
- package/es/global/js/hooks/useFocus.js +6 -3
- package/es/global/js/hooks/useRetrieveStepData.d.ts +1 -1
- package/es/global/js/hooks/useRetrieveStepData.js +1 -1
- package/lib/components/AddSelect/AddSelect.d.ts +44 -2
- package/lib/components/AddSelect/AddSelect.js +7 -3
- package/lib/components/AddSelect/AddSelectBody.d.ts +44 -2
- package/lib/components/AddSelect/AddSelectBody.js +10 -12
- package/lib/components/AddSelect/AddSelectSort.d.ts +16 -17
- package/lib/components/AddSelect/AddSelectSort.js +5 -5
- package/lib/components/AddSelect/types/index.d.ts +44 -0
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.d.ts +5 -1
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +12 -6
- package/lib/components/Card/Card.js +1 -1
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +3 -3
- package/lib/components/ConditionBuilder/ConditionBuilder.js +6 -1
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +3 -3
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +3 -3
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js +29 -17
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +3 -3
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +7 -7
- package/lib/components/ConditionBuilder/ConditionConnector/ConditionConnector.js +6 -6
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +11 -11
- package/lib/components/ConditionBuilder/utils/checkForHoldingKey.d.ts +1 -0
- package/lib/components/ConditionBuilder/utils/checkForHoldingKey.js +20 -0
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -0
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +129 -0
- package/lib/components/ConditionBuilder/utils/util.d.ts +1 -1
- package/lib/components/ConditionBuilder/utils/util.js +36 -4
- package/lib/components/CreateInfluencer/CreateInfluencer.js +1 -1
- package/lib/components/CreateTearsheet/CreateTearsheetStep.d.ts +95 -2
- package/lib/components/CreateTearsheet/CreateTearsheetStep.js +7 -5
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +4 -3
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +5 -0
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +2 -2
- package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +3 -4
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -1
- package/lib/components/ExpressiveCard/ExpressiveCard.d.ts +2 -1
- package/lib/components/Guidebanner/Guidebanner.d.ts +62 -2
- package/lib/components/Guidebanner/Guidebanner.js +8 -7
- package/lib/components/Guidebanner/GuidebannerElement.d.ts +30 -17
- package/lib/components/Guidebanner/GuidebannerElement.js +4 -4
- package/lib/components/Guidebanner/GuidebannerElementButton.d.ts +29 -15
- package/lib/components/Guidebanner/GuidebannerElementButton.js +10 -4
- package/lib/components/Guidebanner/GuidebannerElementLink.d.ts +20 -13
- package/lib/components/Guidebanner/GuidebannerElementLink.js +3 -3
- package/lib/components/InterstitialScreen/InterstitialScreen.js +3 -1
- package/lib/components/MultiAddSelect/MultiAddSelect.d.ts +134 -2
- package/lib/components/MultiAddSelect/MultiAddSelect.js +2 -1
- package/lib/components/NotificationsPanel/NotificationsPanel.js +0 -1
- package/lib/components/PageHeader/PageHeader.d.ts +298 -5
- package/lib/components/PageHeader/PageHeader.js +99 -47
- package/lib/components/PageHeader/PageHeaderUtils.d.ts +1 -1
- package/lib/components/PageHeader/PageHeaderUtils.js +4 -1
- package/lib/components/SidePanel/SidePanel.d.ts +6 -2
- package/lib/components/SidePanel/SidePanel.js +17 -2
- package/lib/components/SidePanel/constants.d.ts +1 -0
- package/lib/components/SidePanel/constants.js +1 -0
- package/lib/components/SingleAddSelect/SingleAddSelect.d.ts +69 -2
- package/lib/components/SingleAddSelect/SingleAddSelect.js +2 -1
- package/lib/components/TagOverflow/TagOverflow.js +34 -19
- package/lib/components/TagOverflow/TagOverflowModal.d.ts +3 -1
- package/lib/components/TagOverflow/TagOverflowModal.js +14 -20
- package/lib/components/TagOverflow/TagOverflowPopover.js +19 -4
- package/lib/components/Tearsheet/Tearsheet.d.ts +132 -6
- package/lib/components/Tearsheet/Tearsheet.js +25 -13
- package/lib/components/Tearsheet/TearsheetShell.d.ts +5 -1
- package/lib/components/Tearsheet/TearsheetShell.js +26 -4
- package/lib/components/WebTerminal/WebTerminal.d.ts +4 -0
- package/lib/components/WebTerminal/WebTerminal.js +11 -3
- package/lib/global/js/hooks/useFocus.d.ts +3 -1
- package/lib/global/js/hooks/useFocus.js +6 -3
- package/lib/global/js/hooks/useRetrieveStepData.d.ts +1 -1
- package/lib/global/js/hooks/useRetrieveStepData.js +1 -1
- package/package.json +3 -3
- package/scss/components/CoachmarkStack/_coachmark-stack.scss +4 -2
- package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +4 -4
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +34 -34
- package/scss/components/Datagrid/styles/_datagrid.scss +2 -1
- package/scss/components/SidePanel/_side-panel-variables.scss +1 -0
- package/scss/components/StringFormatter/_string-formatter.scss +1 -1
- package/scss/components/TagOverflow/_tag-overflow.scss +5 -2
- package/scss/components/_index-with-carbon.scss +1 -0
- package/telemetry.yml +2 -0
@@ -36,6 +36,7 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
36
36
|
|
37
37
|
var _excluded = ["actionBarItems", "actionBarMenuOptionsClass", "actionBarOverflowAriaLabel", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "allTagsModalTitle", "hasBackgroundAlways", "breadcrumbOverflowAriaLabel", "breadcrumbs", "children", "className", "collapseHeader", "collapseHeaderIconDescription", "collapseTitle", "disableBreadcrumbScroll", "enableBreadcrumbScroll", "expandHeaderIconDescription", "fullWidthGrid", "hasCollapseHeaderToggle", "narrowGrid", "navigation", "pageActions", "pageActionsOverflowLabel", "pageActionsMenuOptionsClass", "showAllTagsLabel", "subtitle", "tags", "title", "withoutBackground", "breadcrumbOverflowTooltipAlign"];
|
38
38
|
var componentName = 'PageHeader';
|
39
|
+
settings.pkg.component.ActionBar = true;
|
39
40
|
|
40
41
|
// Default values for props
|
41
42
|
var defaults = {
|
@@ -90,7 +91,7 @@ exports.PageHeader = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
90
91
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
91
92
|
metrics = _useState2[0],
|
92
93
|
setMetrics = _useState2[1];
|
93
|
-
var _useState3 = React.useState(_rollupPluginBabelHelpers.objectSpread2({}, rest.style)),
|
94
|
+
var _useState3 = React.useState(_rollupPluginBabelHelpers.objectSpread2({}, rest === null || rest === void 0 ? void 0 : rest.style)),
|
94
95
|
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
95
96
|
pageHeaderStyles = _useState4[0],
|
96
97
|
setPageHeaderStyles = _useState4[1];
|
@@ -98,16 +99,30 @@ exports.PageHeader = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
98
99
|
// refs
|
99
100
|
var localHeaderRef = React.useRef(null);
|
100
101
|
var headerRef = ref || localHeaderRef;
|
101
|
-
var sizingContainerRef = React.useRef();
|
102
|
+
var sizingContainerRef = React.useRef(null);
|
102
103
|
var offsetTopMeasuringRef = React.useRef(null);
|
103
104
|
|
104
105
|
// state based on props only
|
105
106
|
var hasActionBar = actionBarItems && actionBarItems.length > 0;
|
106
107
|
var hasBreadcrumbRow = !!breadcrumbs || !!actionBarItems;
|
108
|
+
if (tags && (tags === null || tags === void 0 ? void 0 : tags.length) > 10) {
|
109
|
+
if (!allTagsModalSearchLabel) {
|
110
|
+
throw new Error("allTagsModalSearchLabel' is required.");
|
111
|
+
}
|
112
|
+
if (!allTagsModalSearchPlaceholderText) {
|
113
|
+
throw new Error("'allTagsModalSearchPlaceholderText' is required.");
|
114
|
+
}
|
115
|
+
if (!allTagsModalTitle) {
|
116
|
+
throw new Error("'allTagsModalTitle' is required.");
|
117
|
+
}
|
118
|
+
if (!showAllTagsLabel) {
|
119
|
+
throw new Error("'showAllTagsLabel' is required.");
|
120
|
+
}
|
121
|
+
}
|
107
122
|
|
108
123
|
// utility functions
|
109
124
|
var checkUpdateVerticalSpace = function checkUpdateVerticalSpace() {
|
110
|
-
return PageHeaderUtils.utilCheckUpdateVerticalSpace(headerRef, offsetTopMeasuringRef, navigation, enableBreadcrumbScroll, hasActionBar, widthIsNarrow, setMetrics);
|
125
|
+
return PageHeaderUtils.utilCheckUpdateVerticalSpace(headerRef, offsetTopMeasuringRef, navigation, enableBreadcrumbScroll, hasActionBar || false, widthIsNarrow, setMetrics);
|
111
126
|
};
|
112
127
|
|
113
128
|
// NOTE: The buffer is used to add space between the bottom of the header and the last content
|
@@ -198,15 +213,16 @@ exports.PageHeader = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
198
213
|
checkUpdateVerticalSpace();
|
199
214
|
};
|
200
215
|
var handleCollapseToggle = function handleCollapseToggle() {
|
201
|
-
PageHeaderUtils.utilSetCollapsed(!fullyCollapsed, headerRef, metrics.headerOffset, metrics.headerTopValue);
|
216
|
+
PageHeaderUtils.utilSetCollapsed(!fullyCollapsed, headerRef, metrics === null || metrics === void 0 ? void 0 : metrics.headerOffset, metrics === null || metrics === void 0 ? void 0 : metrics.headerTopValue);
|
202
217
|
};
|
203
218
|
|
204
219
|
// use effects
|
205
220
|
React.useEffect(function () {
|
206
221
|
/* istanbul ignore else */
|
207
222
|
if (pageActions !== null && pageActions !== void 0 && pageActions.content) {
|
208
|
-
var
|
209
|
-
|
223
|
+
var _ref5 = pageActions,
|
224
|
+
minWidth = _ref5.minWidth,
|
225
|
+
maxWidth = _ref5.maxWidth;
|
210
226
|
handlePageActionWidthChange({
|
211
227
|
minWidth: minWidth,
|
212
228
|
maxWidth: maxWidth
|
@@ -216,7 +232,9 @@ exports.PageHeader = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
216
232
|
React.useEffect(function () {
|
217
233
|
// Determine the location of the pageAction buttons
|
218
234
|
/* istanbul ignore next */
|
219
|
-
|
235
|
+
if (metrics !== null && metrics !== void 0 && metrics.titleRowSpaceAbove && metrics !== null && metrics !== void 0 && metrics.pageActionsSpaceAbove) {
|
236
|
+
setPageActionsInBreadcrumbRow(collapseTitle || hasActionBar && scrollYValue > (metrics === null || metrics === void 0 ? void 0 : metrics.titleRowSpaceAbove) || widthIsNarrow && scrollYValue > (metrics === null || metrics === void 0 ? void 0 : metrics.pageActionsSpaceAbove));
|
237
|
+
}
|
220
238
|
}, [hasActionBar, metrics.breadcrumbRowSpaceBelow, metrics.titleRowSpaceAbove, metrics.pageActionsSpaceAbove, collapseTitle, scrollYValue, widthIsNarrow]);
|
221
239
|
React.useEffect(function () {
|
222
240
|
// Assesses the size of the action bar and page action area and their required
|
@@ -249,15 +267,15 @@ exports.PageHeader = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
249
267
|
// Updates custom CSS props used to manage scroll behavior
|
250
268
|
/* istanbul ignore next */
|
251
269
|
setPageHeaderStyles(function (prev) {
|
252
|
-
return _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, prev), {}, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "--".concat(PageHeaderUtils.blockClass, "--height-px"), "".concat(metrics.headerHeight, "px")), "--".concat(PageHeaderUtils.blockClass, "--width-px"), "".concat(metrics.headerWidth, "px")), "--".concat(PageHeaderUtils.blockClass, "--header-top"), "".concat(metrics.headerTopValue + metrics.headerOffset, "px")), "--".concat(PageHeaderUtils.blockClass, "--breadcrumb-title-visibility"), scrollYValue > 0 ? 'visible' : 'hidden'), "--".concat(PageHeaderUtils.blockClass, "--scroll"), "".concat(scrollYValue)), "--".concat(PageHeaderUtils.blockClass, "--breadcrumb-title-top"), "".concat(Math.max(0, metrics.breadcrumbTitleHeight + metrics.titleRowSpaceAbove - scrollYValue), "px")), "--".concat(PageHeaderUtils.blockClass, "--breadcrumb-title-opacity"), "".concat(Math.min(1, Math.max(0, (scrollYValue - (metrics.titleRowSpaceAbove || 0)) / (metrics.breadcrumbTitleHeight || 1) // don't want to divide by zero
|
253
|
-
)))), "--".concat(PageHeaderUtils.blockClass, "--breadcrumb-row-width-px"), "".concat(metrics.breadcrumbRowWidth, "px")));
|
270
|
+
return _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, prev), {}, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "--".concat(PageHeaderUtils.blockClass, "--height-px"), "".concat(metrics.headerHeight, "px")), "--".concat(PageHeaderUtils.blockClass, "--width-px"), "".concat(metrics.headerWidth, "px")), "--".concat(PageHeaderUtils.blockClass, "--header-top"), "".concat(((metrics === null || metrics === void 0 ? void 0 : metrics.headerTopValue) || 0) + ((metrics === null || metrics === void 0 ? void 0 : metrics.headerOffset) || 0), "px")), "--".concat(PageHeaderUtils.blockClass, "--breadcrumb-title-visibility"), scrollYValue > 0 ? 'visible' : 'hidden'), "--".concat(PageHeaderUtils.blockClass, "--scroll"), "".concat(scrollYValue)), "--".concat(PageHeaderUtils.blockClass, "--breadcrumb-title-top"), "".concat(metrics.breadcrumbTitleHeight && metrics.titleRowSpaceAbove && Math.max(0, metrics.breadcrumbTitleHeight + metrics.titleRowSpaceAbove - scrollYValue), "px")), "--".concat(PageHeaderUtils.blockClass, "--breadcrumb-title-opacity"), "".concat(Math.min(1, Math.max(0, (scrollYValue - (metrics.titleRowSpaceAbove || 0)) / (metrics.breadcrumbTitleHeight || 1) // don't want to divide by zero
|
271
|
+
)))), "--".concat(PageHeaderUtils.blockClass, "--breadcrumb-row-width-px"), "".concat(metrics === null || metrics === void 0 ? void 0 : metrics.breadcrumbRowWidth, "px")));
|
254
272
|
});
|
255
273
|
}, [headerRef, enableBreadcrumbScroll, metrics, metrics.breadcrumbRowHeight, metrics.breadcrumbRowSpaceBelow, metrics.breadcrumbTitleHeight, metrics.breadcrumbRowWidth, metrics.headerHeight, metrics.headerWidth, metrics.headerOffset, metrics.headerTopValue, metrics.navigationRowHeight, navigation, scrollYValue, tags]);
|
256
274
|
useWindowScroll.useNearestScroll(headerRef,
|
257
275
|
// on scroll or various layout changes check updates if needed
|
258
276
|
// istanbul ignore next
|
259
|
-
function (
|
260
|
-
var current =
|
277
|
+
function (_ref6) {
|
278
|
+
var current = _ref6.current;
|
261
279
|
setPageHeaderStyles(function (prev) {
|
262
280
|
return _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, prev), {}, _rollupPluginBabelHelpers.defineProperty({}, "--".concat(PageHeaderUtils.blockClass, "--breadcrumb-top"), "".concat(metrics.headerOffset, "px")));
|
263
281
|
});
|
@@ -266,15 +284,15 @@ exports.PageHeader = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
266
284
|
|
267
285
|
// set offset for tagset tooltip
|
268
286
|
/* istanbul ignore next */
|
269
|
-
var tagsetTooltipOffset = fullyCollapsed ? metrics.headerHeight + metrics.headerTopValue + metrics.headerOffset : metrics.headerHeight + metrics.headerOffset;
|
287
|
+
var tagsetTooltipOffset = fullyCollapsed && metrics !== null && metrics !== void 0 && metrics.headerHeight && metrics !== null && metrics !== void 0 && metrics.headerTopValue && metrics !== null && metrics !== void 0 && metrics.headerOffset ? metrics.headerHeight + metrics.headerTopValue + metrics.headerOffset : (metrics.headerHeight || 0) + (metrics.headerOffset || 0);
|
270
288
|
|
271
289
|
/* istanbul ignore next */
|
272
290
|
document.documentElement.style.setProperty("--".concat(PageHeaderUtils.blockClass, "--tagset-tooltip-position"), fullyCollapsed ? 'fixed' : 'absolute');
|
273
291
|
document.documentElement.style.setProperty("--".concat(PageHeaderUtils.blockClass, "--tagset-tooltip-offset"), "".concat(tagsetTooltipOffset, "px"));
|
274
292
|
setScrollYValue(current.scrollY);
|
275
293
|
}, [metrics.headerHeight, metrics.headerTopValue, metrics.headerOffset, enableBreadcrumbScroll]);
|
276
|
-
useWindowResize.useWindowResize(function (
|
277
|
-
var current =
|
294
|
+
useWindowResize.useWindowResize(function (_ref7) {
|
295
|
+
var current = _ref7.current;
|
278
296
|
// on window resize and other updates some values may have changed
|
279
297
|
checkUpdateVerticalSpace();
|
280
298
|
setWidthIsNarrow(current.innerWidth / 16 < parseInt(layout.breakpoints.md.width)); // small (below medium) media query
|
@@ -286,14 +304,14 @@ exports.PageHeader = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
286
304
|
React.useEffect(function () {
|
287
305
|
// Determines the appropriate header background opacity based on the header config/height/scroll and the withoutBackground setting
|
288
306
|
var result = withoutBackground ? 0 : 1;
|
289
|
-
if (!result && metrics.headerHeight > 0 && (breadcrumbs || actionBarItems || tags || navigation)) {
|
290
|
-
var startAddingAt = parseFloat(layout.spacing10
|
307
|
+
if (!result && metrics !== null && metrics !== void 0 && metrics.headerHeight && metrics.headerHeight > 0 && (breadcrumbs || actionBarItems || tags || navigation)) {
|
308
|
+
var startAddingAt = parseFloat(layout.spacing10) * parseInt(layout.baseFontSize);
|
291
309
|
var scrollRemaining = metrics.headerHeight - scrollYValue;
|
292
310
|
|
293
311
|
/* don't know how to test resize */
|
294
312
|
/* istanbul ignore if */
|
295
313
|
if (scrollRemaining < startAddingAt) {
|
296
|
-
var distanceAddingOver = startAddingAt - metrics.breadcrumbRowHeight;
|
314
|
+
var distanceAddingOver = startAddingAt - ((metrics === null || metrics === void 0 ? void 0 : metrics.breadcrumbRowHeight) || 0);
|
297
315
|
result = Math.min(1, (startAddingAt - scrollRemaining) / distanceAddingOver);
|
298
316
|
}
|
299
317
|
}
|
@@ -305,15 +323,19 @@ exports.PageHeader = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
305
323
|
// only has toggle if requested and withoutBackground is unset/falsy
|
306
324
|
// NOTE: prop-types isRequired.if for the expand and collapse
|
307
325
|
// icon descriptions depends on the this.
|
308
|
-
setHasCollapseButton(hasCollapseHeaderToggle && !withoutBackground);
|
326
|
+
setHasCollapseButton(hasCollapseHeaderToggle && !withoutBackground || false);
|
309
327
|
}, [withoutBackground, hasCollapseHeaderToggle]);
|
310
328
|
React.useEffect(function () {
|
311
329
|
// Determine if space is needed in the breadcrumb for a collapse button
|
312
|
-
|
330
|
+
if (hasCollapseButton && !(navigation || tags) && metrics !== null && metrics !== void 0 && metrics.headerHeight) {
|
331
|
+
setSpaceForCollapseButton(true);
|
332
|
+
} else {
|
333
|
+
setSpaceForCollapseButton(false);
|
334
|
+
}
|
313
335
|
}, [hasCollapseButton, navigation, tags, metrics.headerHeight]);
|
314
336
|
var nextToTabsCheck = function nextToTabsCheck() {
|
315
337
|
/* istanbul ignore next */
|
316
|
-
return enableBreadcrumbScroll && !actionBarItems && scrollYValue + metrics.headerTopValue >= 0;
|
338
|
+
return enableBreadcrumbScroll && !actionBarItems && metrics.headerTopValue && scrollYValue + metrics.headerTopValue >= 0;
|
317
339
|
};
|
318
340
|
React.useEffect(function () {
|
319
341
|
if (collapseHeader === true) {
|
@@ -325,6 +347,18 @@ exports.PageHeader = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
325
347
|
|
326
348
|
// Determine what form of title to display in the breadcrumb
|
327
349
|
var breadcrumbItemForTitle = PageHeaderUtils.utilGetBreadcrumbItemForTitle(PageHeaderUtils.blockClass, collapseTitle, title);
|
350
|
+
var getBreadcrumbs = function getBreadcrumbs() {
|
351
|
+
if (breadcrumbs && breadcrumbItemForTitle) {
|
352
|
+
return breadcrumbs.concat(breadcrumbItemForTitle);
|
353
|
+
} else {
|
354
|
+
if (breadcrumbItemForTitle) {
|
355
|
+
return [breadcrumbItemForTitle];
|
356
|
+
} else {
|
357
|
+
return breadcrumbs;
|
358
|
+
}
|
359
|
+
}
|
360
|
+
};
|
361
|
+
var displayedBreadcrumbs = getBreadcrumbs();
|
328
362
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
329
363
|
className: "".concat(PageHeaderUtils.blockClass, "--offset-top-measuring-element"),
|
330
364
|
ref: offsetTopMeasuringRef
|
@@ -344,14 +378,14 @@ exports.PageHeader = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
344
378
|
className: "".concat(PageHeaderUtils.blockClass, "__breadcrumb-row--container")
|
345
379
|
}, /*#__PURE__*/React__default["default"].createElement(react.Column, {
|
346
380
|
className: cx__default["default"]("".concat(PageHeaderUtils.blockClass, "__breadcrumb-column"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(PageHeaderUtils.blockClass, "__breadcrumb-column--background"), !!breadcrumbs || hasActionBar || widthIsNarrow))
|
347
|
-
}, breadcrumbs || breadcrumbItemForTitle
|
381
|
+
}, (breadcrumbs || breadcrumbItemForTitle) && /*#__PURE__*/React__default["default"].createElement(BreadcrumbWithOverflow.BreadcrumbWithOverflow, {
|
348
382
|
className: "".concat(PageHeaderUtils.blockClass, "__breadcrumb"),
|
349
383
|
noTrailingSlash: !!title,
|
350
384
|
overflowAriaLabel: breadcrumbOverflowAriaLabel,
|
351
|
-
breadcrumbs:
|
352
|
-
,
|
353
|
-
|
354
|
-
})
|
385
|
+
breadcrumbs: displayedBreadcrumbs,
|
386
|
+
overflowTooltipAlign: breadcrumbOverflowTooltipAlign,
|
387
|
+
maxVisible: undefined
|
388
|
+
})), /*#__PURE__*/React__default["default"].createElement(react.Column, {
|
355
389
|
className: cx__default["default"](["".concat(PageHeaderUtils.blockClass, "__action-bar-column ").concat(PageHeaderUtils.blockClass, "__action-bar-column--background"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(PageHeaderUtils.blockClass, "__action-bar-column--has-page-actions"), pageActions), "".concat(PageHeaderUtils.blockClass, "__action-bar-column--influenced-by-collapse-button"), spaceForCollapseButton)])
|
356
390
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
357
391
|
className: "".concat(PageHeaderUtils.blockClass, "__action-bar-column-content"),
|
@@ -360,11 +394,11 @@ exports.PageHeader = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
360
394
|
/*#__PURE__*/
|
361
395
|
// Investigate the responsive behavior or this and the title also fix the ActionBar Item and PageAction story css
|
362
396
|
React__default["default"].createElement(React__default["default"].Fragment, null, thePageActions(true, pageActionsInBreadcrumbRow), /*#__PURE__*/React__default["default"].createElement(ActionBar.ActionBar, {
|
363
|
-
menuOptionsClass: cx__default["default"](actionBarMenuOptionsClass, "".concat(PageHeaderUtils.blockClass, "__action-bar-menu-options")),
|
364
|
-
overflowAriaLabel: actionBarOverflowAriaLabel,
|
365
397
|
actions: actionBarItems,
|
366
398
|
className: "".concat(PageHeaderUtils.blockClass, "__action-bar"),
|
399
|
+
menuOptionsClass: "".concat(cx__default["default"](actionBarMenuOptionsClass, "".concat(PageHeaderUtils.blockClass, "__action-bar-menu-options"))),
|
367
400
|
onWidthChange: handleActionBarWidthChange,
|
401
|
+
overflowAriaLabel: actionBarOverflowAriaLabel,
|
368
402
|
rightAlign: true
|
369
403
|
})) : widthIsNarrow && thePageActions(true, pageActionsInBreadcrumbRow))))) : null, !collapseTitle && (title || pageActions) ? /*#__PURE__*/React__default["default"].createElement(react.Row, {
|
370
404
|
className: cx__default["default"]("".concat(PageHeaderUtils.blockClass, "__title-row"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(PageHeaderUtils.blockClass, "__title-row--no-breadcrumb-row"), !hasBreadcrumbRow), "".concat(PageHeaderUtils.blockClass, "__title-row--under-action-bar"), hasActionBar || widthIsNarrow), "".concat(PageHeaderUtils.blockClass, "__title-row--has-page-actions"), !!pageActions), "".concat(PageHeaderUtils.blockClass, "__title-row--sticky"), !!pageActions && !actionBarItems && hasBreadcrumbRow))
|
@@ -395,9 +429,9 @@ exports.PageHeader = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
395
429
|
allTagsModalSearchLabel: allTagsModalSearchLabel,
|
396
430
|
allTagsModalSearchPlaceholderText: allTagsModalSearchPlaceholderText,
|
397
431
|
allTagsModalTitle: allTagsModalTitle,
|
398
|
-
showAllTagsLabel: showAllTagsLabel,
|
399
432
|
tags: tags,
|
400
|
-
overflowClassName: "".concat(PageHeaderUtils.blockClass, "__navigation-tags-overflow")
|
433
|
+
overflowClassName: "".concat(PageHeaderUtils.blockClass, "__navigation-tags-overflow"),
|
434
|
+
showAllTagsLabel: showAllTagsLabel || ''
|
401
435
|
}))) : null),
|
402
436
|
// this navigation pushes the breadcrumb off or settles underneath it depending on enableBreadcrumbScroll
|
403
437
|
navigation ? /*#__PURE__*/React__default["default"].createElement(react.Row, {
|
@@ -411,7 +445,7 @@ exports.PageHeader = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
411
445
|
allTagsModalSearchLabel: allTagsModalSearchLabel,
|
412
446
|
allTagsModalSearchPlaceholderText: allTagsModalSearchPlaceholderText,
|
413
447
|
allTagsModalTitle: allTagsModalTitle,
|
414
|
-
showAllTagsLabel: showAllTagsLabel,
|
448
|
+
showAllTagsLabel: showAllTagsLabel || '',
|
415
449
|
tags: tags,
|
416
450
|
overflowClassName: "".concat(PageHeaderUtils.blockClass, "__navigation-tags-overflow")
|
417
451
|
})) : null) : null), hasCollapseButton ? /*#__PURE__*/React__default["default"].createElement("div", {
|
@@ -434,7 +468,7 @@ exports.PageHeader = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
434
468
|
})) : null));
|
435
469
|
function thePageActions(isBreadcrumbRow, inBreadcrumbRow) {
|
436
470
|
if (pageActions) {
|
437
|
-
var
|
471
|
+
var _content;
|
438
472
|
var _Tag = isBreadcrumbRow ? 'div' : react.Column;
|
439
473
|
// Only report size change of version action bar is rendered as part of the breadcrumb row.
|
440
474
|
// and when there is an actionBar
|
@@ -443,8 +477,8 @@ exports.PageHeader = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
443
477
|
className: cx__default["default"]("".concat(PageHeaderUtils.blockClass, "__page-actions"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(PageHeaderUtils.blockClass, "__page-actions--in-breadcrumb"), inBreadcrumbRow))
|
444
478
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
445
479
|
className: cx__default["default"]("".concat(PageHeaderUtils.blockClass, "__page-actions-content"))
|
446
|
-
}, (
|
447
|
-
|
480
|
+
}, (_content = pageActions === null || pageActions === void 0 ? void 0 : pageActions.content) !== null && _content !== void 0 ? _content : /*#__PURE__*/React__default["default"].createElement(ButtonSetWithOverflow.ButtonSetWithOverflow, {
|
481
|
+
className: "".concat(PageHeaderUtils.blockClass, "__button-set-with-overflow"),
|
448
482
|
menuOptionsClass: cx__default["default"](pageActionsMenuOptionsClass, "".concat(PageHeaderUtils.blockClass, "__button-set-menu-options")),
|
449
483
|
onWidthChange: handleWidthChange,
|
450
484
|
buttons: pageActions,
|
@@ -484,6 +518,8 @@ var deprecatedProps = {
|
|
484
518
|
*/
|
485
519
|
hasBackgroundAlways: propsHelper.deprecateProp(index["default"].bool, 'Property replaced by `withoutBackground`')
|
486
520
|
};
|
521
|
+
|
522
|
+
/**@ts-ignore */
|
487
523
|
exports.PageHeader.tagTypes = tagTypes;
|
488
524
|
exports.PageHeader.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
489
525
|
/**
|
@@ -491,6 +527,7 @@ exports.PageHeader.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
491
527
|
* Each item is specified as an object with the properties of a Carbon Button in icon only form.
|
492
528
|
* Button kind, size, tooltipPosition, tooltipAlignment and type are ignored.
|
493
529
|
*/
|
530
|
+
/**@ts-ignore */
|
494
531
|
actionBarItems: index["default"].arrayOf(index["default"].shape(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, propsHelper.prepareProps(react.Button.propTypes, ['kind', 'size', 'tooltipPosition', 'tooltipAlignment'])), {}, {
|
495
532
|
iconDescription: index["default"].string.isRequired,
|
496
533
|
onClick: react.Button.propTypes.onClick,
|
@@ -506,8 +543,9 @@ exports.PageHeader.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
506
543
|
*
|
507
544
|
* NOTE: This prop is required if actionBarItems are supplied
|
508
545
|
*/
|
509
|
-
|
510
|
-
|
546
|
+
/**@ts-ignore */
|
547
|
+
actionBarOverflowAriaLabel: index["default"].string.isRequired.if(function (_ref11) {
|
548
|
+
var actionBarItems = _ref11.actionBarItems;
|
511
549
|
return actionBarItems && actionBarItems.length > 0;
|
512
550
|
}),
|
513
551
|
/**
|
@@ -538,8 +576,9 @@ exports.PageHeader.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
538
576
|
* If the user supplies breadcrumbs then this property is required.
|
539
577
|
* It is used in an overflow menu when there is insufficient space to display all breadcrumbs inline.
|
540
578
|
*/
|
541
|
-
|
542
|
-
|
579
|
+
/**@ts-ignore */
|
580
|
+
breadcrumbOverflowAriaLabel: index["default"].string.isRequired.if(function (_ref12) {
|
581
|
+
var breadcrumbs = _ref12.breadcrumbs;
|
543
582
|
return breadcrumbs && breadcrumbs.length > 0;
|
544
583
|
}),
|
545
584
|
/**
|
@@ -557,6 +596,7 @@ exports.PageHeader.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
557
596
|
* fields in the object will be passed through to the breadcrumb element as
|
558
597
|
* HTML attributes.
|
559
598
|
*/
|
599
|
+
/**@ts-ignore */
|
560
600
|
breadcrumbs: index["default"].arrayOf(index["default"].shape({
|
561
601
|
/**
|
562
602
|
* Optional string representing the link location for the BreadcrumbItem
|
@@ -577,8 +617,9 @@ exports.PageHeader.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
577
617
|
/**
|
578
618
|
* A text version of the `label` for display, required if `label` is not a string.
|
579
619
|
*/
|
580
|
-
|
581
|
-
|
620
|
+
/**@ts-ignore */
|
621
|
+
title: index["default"].string.isRequired.if(function (_ref13) {
|
622
|
+
var label = _ref13.label;
|
582
623
|
return typeof label !== 'string';
|
583
624
|
})
|
584
625
|
})),
|
@@ -604,9 +645,10 @@ exports.PageHeader.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
604
645
|
* If `hasCollapseHeaderToggle` is set and `withoutBackground` is unset/falsy then assistive text is
|
605
646
|
* required for both the expend and collapse states of the button component used.
|
606
647
|
*/
|
607
|
-
|
608
|
-
|
609
|
-
|
648
|
+
/**@ts-ignore */
|
649
|
+
collapseHeaderIconDescription: index["default"].string.isRequired.if(function (_ref14) {
|
650
|
+
var withoutBackground = _ref14.withoutBackground,
|
651
|
+
hasCollapseHeaderToggle = _ref14.hasCollapseHeaderToggle;
|
610
652
|
return !withoutBackground && hasCollapseHeaderToggle;
|
611
653
|
}),
|
612
654
|
/**
|
@@ -623,15 +665,17 @@ exports.PageHeader.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
623
665
|
* If `hasCollapseHeaderToggle` is set and `withoutBackground` is unset/falsy then assistive text is
|
624
666
|
* required for both the expend and collapse states of the button component used.
|
625
667
|
*/
|
626
|
-
|
627
|
-
|
628
|
-
|
668
|
+
/**@ts-ignore */
|
669
|
+
expandHeaderIconDescription: index["default"].string.isRequired.if(function (_ref15) {
|
670
|
+
var withoutBackground = _ref15.withoutBackground,
|
671
|
+
hasCollapseHeaderToggle = _ref15.hasCollapseHeaderToggle;
|
629
672
|
return !withoutBackground && hasCollapseHeaderToggle;
|
630
673
|
}),
|
631
674
|
/**
|
632
675
|
* The PageHeader is hosted in a Carbon grid, this value is passed through to the Carbon grid fullWidth prop.
|
633
676
|
* 'xl' is used to override the grid width setting. Can be used with narrowGrid: true to get the largest size.
|
634
677
|
*/
|
678
|
+
/**@ts-ignore */
|
635
679
|
fullWidthGrid: index["default"].oneOfType([index["default"].bool, index["default"].oneOf(['xl'])]),
|
636
680
|
/**
|
637
681
|
* Adds a button as the last element of the bottom row which collapses and expands the header.
|
@@ -639,6 +683,7 @@ exports.PageHeader.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
639
683
|
* NOTE: The header is collapsed by setting the scroll position to hide part of the header.
|
640
684
|
* Collapsing has no effect if there is insufficient content to scroll.
|
641
685
|
*/
|
686
|
+
/**@ts-ignore */
|
642
687
|
hasCollapseHeaderToggle: index["default"].bool,
|
643
688
|
/**
|
644
689
|
* The PageHeader is hosted in a Carbon grid, this value is passed through to the Carbon grid narrow prop
|
@@ -665,6 +710,7 @@ exports.PageHeader.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
665
710
|
* - maxWidth: maximum number of pixels the content will grow to
|
666
711
|
* Carbon Button API https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
|
667
712
|
*/
|
713
|
+
/**@ts-ignore */
|
668
714
|
pageActions: index["default"].oneOfType([index["default"].arrayOf(index["default"].shape(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, react.Button.propTypes), {}, {
|
669
715
|
key: index["default"].string.isRequired,
|
670
716
|
kind: react.Button.propTypes.kind,
|
@@ -689,8 +735,9 @@ exports.PageHeader.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
689
735
|
*
|
690
736
|
* NOTE: This prop is required if pageActions are supplied
|
691
737
|
*/
|
692
|
-
|
693
|
-
|
738
|
+
/**@ts-ignore */
|
739
|
+
pageActionsOverflowLabel: index["default"].node.isRequired.if(function (_ref16) {
|
740
|
+
var pageActions = _ref16.pageActions;
|
694
741
|
return pageActions && pageActions.length > 0 && !pageActions.content;
|
695
742
|
}),
|
696
743
|
/**
|
@@ -718,6 +765,7 @@ exports.PageHeader.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
718
765
|
*
|
719
766
|
* See https://react.carbondesignsystem.com/?path=/docs/components-tag--default
|
720
767
|
*/
|
768
|
+
/**@ts-ignore */
|
721
769
|
tags: index["default"].arrayOf(index["default"].shape(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, propsHelper.prepareProps(react.Tag.propTypes, 'filter')), {}, {
|
722
770
|
label: index["default"].string.isRequired,
|
723
771
|
// we duplicate this prop to improve the DocGen
|
@@ -730,6 +778,7 @@ exports.PageHeader.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
730
778
|
* - String
|
731
779
|
* - Object containing
|
732
780
|
* - text: title string
|
781
|
+
* - shortTitle: alternative title for exceptionally long titles
|
733
782
|
* - icon: optional icon
|
734
783
|
* - loading: boolean shows loading indicator if true
|
735
784
|
* - onChange: function to process the live value (React change === HTML Input)
|
@@ -742,9 +791,11 @@ exports.PageHeader.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
742
791
|
* - breadcrumbContent: version of content used in the breadcrumb on scroll. If not supplied
|
743
792
|
* - asText: String based representation of the title
|
744
793
|
*/
|
794
|
+
/**@ts-ignore */
|
745
795
|
title: index["default"].oneOfType([index["default"].shape({
|
746
796
|
// Update docgen if changed
|
747
797
|
text: index["default"].string.isRequired,
|
798
|
+
shortTitle: index["default"].string,
|
748
799
|
icon: index["default"].oneOfType([index["default"].func, index["default"].object]),
|
749
800
|
loading: index["default"].bool,
|
750
801
|
// inline edit version properties
|
@@ -770,6 +821,7 @@ exports.PageHeader.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
770
821
|
* Specifies if the PageHeader should appear without a background color, and defaults to the preferred `false` (a background color is shown).
|
771
822
|
* Note that when `true` some parts of the header still gain a background if and when they stick to the top of the PageHeader on scroll.
|
772
823
|
*/
|
824
|
+
/**@ts-ignore */
|
773
825
|
withoutBackground: index["default"].bool
|
774
826
|
}, deprecatedProps);
|
775
827
|
exports.PageHeader.displayName = componentName;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
export const blockClass: string;
|
2
|
-
export function utilCheckUpdateVerticalSpace(headerRef: {}, offsetTopMeasuringRef: {}, navigation:
|
2
|
+
export function utilCheckUpdateVerticalSpace(headerRef: {}, offsetTopMeasuringRef: {}, navigation: object, enableBreadcrumbScroll: boolean, hasActionBar: boolean, widthIsNarrow: boolean, setMetrics: () => any): void;
|
3
3
|
export function utilSetCollapsed(collapse: any, headerRef: any, headerOffset: any, headerTopValue: any): void;
|
4
4
|
export function utilGetBreadcrumbItemForTitle(blockClass: any, collapseTitle: any, title: any): {
|
5
5
|
label: any;
|
@@ -28,7 +28,7 @@ var blockClass = "".concat(settings.pkg.prefix, "--page-header");
|
|
28
28
|
* Assesses the vertical height of various elements and calls setMetrics with update
|
29
29
|
* @param {{}} headerRef
|
30
30
|
* @param {{}} offsetTopMeasuringRef
|
31
|
-
* @param {
|
31
|
+
* @param {object} navigation
|
32
32
|
* @param {boolean} enableBreadcrumbScroll
|
33
33
|
* @param {boolean} hasActionBar
|
34
34
|
* @param {boolean} widthIsNarrow
|
@@ -191,6 +191,9 @@ var utilGetBreadcrumbItemForTitle = function utilGetBreadcrumbItemForTitle(block
|
|
191
191
|
breadcrumbTitle.isCurrentPage = true;
|
192
192
|
breadcrumbTitle.className = cx__default["default"](["".concat(blockClass, "__breadcrumb-title"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__breadcrumb-title--pre-collapsed"), collapseTitle)]);
|
193
193
|
}
|
194
|
+
if (title.shortTitle) {
|
195
|
+
breadcrumbTitle.shortTitle = title.shortTitle;
|
196
|
+
}
|
194
197
|
return breadcrumbTitle;
|
195
198
|
}
|
196
199
|
};
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
/// <reference path="../../../src/custom-typings/index.d.ts" />
|
8
|
-
import React, { ReactNode } from 'react';
|
8
|
+
import React, { ReactNode, RefObject } from 'react';
|
9
9
|
import { ButtonProps } from '@carbon/react';
|
10
10
|
type SidePanelBaseProps = {
|
11
11
|
/**
|
@@ -57,6 +57,10 @@ type SidePanelBaseProps = {
|
|
57
57
|
* Sets the label text which will display above the title text
|
58
58
|
*/
|
59
59
|
labelText?: string;
|
60
|
+
/**
|
61
|
+
* Provide a ref to return focus to once the side panel is closed.
|
62
|
+
*/
|
63
|
+
launcherButtonRef?: RefObject<any>;
|
60
64
|
/**
|
61
65
|
* Sets the icon description for the navigation back icon button
|
62
66
|
*/
|
@@ -100,7 +104,7 @@ type SidePanelBaseProps = {
|
|
100
104
|
/**
|
101
105
|
* Sets the size of the side panel
|
102
106
|
*/
|
103
|
-
size: 'xs' | 'sm' | 'md' | 'lg' | '2xl';
|
107
|
+
size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
104
108
|
/**
|
105
109
|
* Determines if this panel slides in
|
106
110
|
*/
|
@@ -32,7 +32,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
32
32
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
33
33
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
34
34
|
|
35
|
-
var _excluded = ["actionToolbarButtons", "actions", "animateTitle", "children", "className", "closeIconDescription", "condensedActions", "currentStep", "id", "includeOverlay", "labelText", "navigationBackIconDescription", "onNavigationBack", "onRequestClose", "onUnmount", "open", "placement", "preventCloseOnClickOutside", "selectorPageContent", "selectorPrimaryFocus", "size", "slideIn", "slug", "subtitle", "title"],
|
35
|
+
var _excluded = ["actionToolbarButtons", "actions", "animateTitle", "children", "className", "closeIconDescription", "condensedActions", "currentStep", "id", "includeOverlay", "labelText", "navigationBackIconDescription", "onNavigationBack", "onRequestClose", "onUnmount", "open", "placement", "preventCloseOnClickOutside", "selectorPageContent", "selectorPrimaryFocus", "size", "slideIn", "slug", "subtitle", "title", "launcherButtonRef"],
|
36
36
|
_excluded2 = ["label", "kind", "hasIconOnly", "icon", "renderIcon", "tooltipPosition", "tooltipAlignment", "leading", "disabled", "className", "onClick"];
|
37
37
|
var blockClass = "".concat(settings.pkg.prefix, "--side-panel");
|
38
38
|
var componentName = 'SidePanel';
|
@@ -86,6 +86,7 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
86
86
|
slug = _ref.slug,
|
87
87
|
subtitle = _ref.subtitle,
|
88
88
|
title = _ref.title,
|
89
|
+
launcherButtonRef = _ref.launcherButtonRef,
|
89
90
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
90
91
|
var _useState = React.useState(false),
|
91
92
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
@@ -117,6 +118,7 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
117
118
|
firstElement = _useFocus.firstElement,
|
118
119
|
keyDownListener = _useFocus.keyDownListener;
|
119
120
|
var panelRefValue = sidePanelRef.current;
|
121
|
+
var previousOpen = usePreviousValue.usePreviousValue(open);
|
120
122
|
var shouldReduceMotion = framerMotion.useReducedMotion();
|
121
123
|
|
122
124
|
// Title animation on scroll related state
|
@@ -188,6 +190,14 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
188
190
|
console.warn("".concat(componentName, ": The prop `labelText` was provided without a `title`. It is required to have a `title` when using the `labelText` prop."));
|
189
191
|
}
|
190
192
|
}, [labelText, title]);
|
193
|
+
React.useEffect(function () {
|
194
|
+
if (previousOpen && !open && launcherButtonRef) {
|
195
|
+
setTimeout(function () {
|
196
|
+
var _launcherButtonRef$cu;
|
197
|
+
launcherButtonRef === null || launcherButtonRef === void 0 || (_launcherButtonRef$cu = launcherButtonRef.current) === null || _launcherButtonRef$cu === void 0 || _launcherButtonRef$cu.focus();
|
198
|
+
}, 0);
|
199
|
+
}
|
200
|
+
}, [launcherButtonRef, open, previousOpen]);
|
191
201
|
var checkSetDoAnimateTitle = function checkSetDoAnimateTitle() {
|
192
202
|
var canDoAnimateTitle = false;
|
193
203
|
if (panelRefValue && open && animateTitle && animationComplete && titleRef !== null && titleRef !== void 0 && titleRef.current && title && title.length && !reducedMotion.matches) {
|
@@ -541,6 +551,11 @@ exports.SidePanel.propTypes = {
|
|
541
551
|
* Sets the label text which will display above the title text
|
542
552
|
*/
|
543
553
|
labelText: index["default"].string,
|
554
|
+
/**
|
555
|
+
* Provide a ref to return focus to once the modal is closed.
|
556
|
+
*/
|
557
|
+
/**@ts-ignore */
|
558
|
+
launcherButtonRef: index["default"].any,
|
544
559
|
/**
|
545
560
|
* Sets the icon description for the navigation back icon button
|
546
561
|
*/
|
@@ -590,7 +605,7 @@ exports.SidePanel.propTypes = {
|
|
590
605
|
* Sets the size of the side panel
|
591
606
|
*/
|
592
607
|
/**@ts-ignore*/
|
593
|
-
size: index["default"].oneOf(['xs', 'sm', 'md', 'lg', '2xl']),
|
608
|
+
size: index["default"].oneOf(['xs', 'sm', 'md', 'lg', 'xl', '2xl']),
|
594
609
|
/**
|
595
610
|
* Determines if this panel slides in
|
596
611
|
*/
|
@@ -1,5 +1,72 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Entry } from '../AddSelect/types';
|
3
|
+
interface SingleAddSelectProps {
|
4
|
+
/**
|
5
|
+
* optional class name
|
6
|
+
*/
|
7
|
+
className?: string;
|
8
|
+
/**
|
9
|
+
* text description that appears under the title
|
10
|
+
*/
|
11
|
+
description?: string;
|
12
|
+
/**
|
13
|
+
* label for global search input
|
14
|
+
*/
|
15
|
+
globalSearchLabel?: string;
|
16
|
+
/**
|
17
|
+
* placeholder for global search input
|
18
|
+
*/
|
19
|
+
globalSearchPlaceholder?: string;
|
20
|
+
/**
|
21
|
+
* object that contains the item data. for more information reference the
|
22
|
+
* "Structuring items" section in the docs tab
|
23
|
+
*/
|
24
|
+
items?: {
|
25
|
+
entries: Entry[];
|
26
|
+
};
|
27
|
+
/**
|
28
|
+
* label that display above the list of items
|
29
|
+
*/
|
30
|
+
itemsLabel?: string;
|
31
|
+
/**
|
32
|
+
* text to display when no results are found from the global search
|
33
|
+
*/
|
34
|
+
noResultsDescription?: string;
|
35
|
+
/**
|
36
|
+
* title to display when no results are found from the global search
|
37
|
+
*/
|
38
|
+
noResultsTitle?: string;
|
39
|
+
/**
|
40
|
+
* function to call when the close button clicked
|
41
|
+
*/
|
42
|
+
onClose?: () => void;
|
43
|
+
/**
|
44
|
+
* text for close button
|
45
|
+
*/
|
46
|
+
onCloseButtonText?: string;
|
47
|
+
/**
|
48
|
+
* function to call when the submit button is clicked. returns a selection
|
49
|
+
*/
|
50
|
+
onSubmit?: () => void;
|
51
|
+
/**
|
52
|
+
* text for the submit button
|
53
|
+
*/
|
54
|
+
onSubmitButtonText?: string;
|
55
|
+
/**
|
56
|
+
* specifies if the component is open or not
|
57
|
+
*/
|
58
|
+
open?: boolean;
|
59
|
+
/**
|
60
|
+
* text that displays when displaying filtered items
|
61
|
+
*/
|
62
|
+
searchResultsLabel?: string;
|
63
|
+
/**
|
64
|
+
* header text
|
65
|
+
*/
|
66
|
+
title?: string;
|
67
|
+
}
|
1
68
|
/**
|
2
69
|
* Used to add or select one or more items from larger lists or hierarchies.
|
3
70
|
*/
|
4
|
-
export let SingleAddSelect: React.ForwardRefExoticComponent<React.RefAttributes<
|
5
|
-
|
71
|
+
export declare let SingleAddSelect: React.ForwardRefExoticComponent<SingleAddSelectProps & React.RefAttributes<HTMLDivElement>>;
|
72
|
+
export {};
|