@carbon/ibm-products 1.20.3 → 1.23.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.
Files changed (83) hide show
  1. package/css/components/Datagrid/styles/datagrid.css +4 -0
  2. package/css/components/Datagrid/styles/datagrid.css.map +1 -1
  3. package/css/components/Datagrid/styles/index.css +32 -0
  4. package/css/components/Datagrid/styles/index.css.map +1 -1
  5. package/css/components/Datagrid/styles/useColumnCenterAlign.css +18 -0
  6. package/css/components/Datagrid/styles/useColumnCenterAlign.css.map +1 -0
  7. package/css/components/Datagrid/styles/useExpandedRow.css +12 -0
  8. package/css/components/Datagrid/styles/useExpandedRow.css.map +1 -0
  9. package/css/index-full-carbon.css +67 -147
  10. package/css/index-full-carbon.css.map +1 -1
  11. package/css/index-full-carbon.min.css +3 -3
  12. package/css/index-full-carbon.min.css.map +1 -1
  13. package/css/index-without-carbon-released-only.css +25 -16
  14. package/css/index-without-carbon-released-only.css.map +1 -1
  15. package/css/index-without-carbon-released-only.min.css +2 -2
  16. package/css/index-without-carbon-released-only.min.css.map +1 -1
  17. package/css/index-without-carbon.css +62 -20
  18. package/css/index-without-carbon.css.map +1 -1
  19. package/css/index-without-carbon.min.css +2 -2
  20. package/css/index-without-carbon.min.css.map +1 -1
  21. package/css/index.css +65 -143
  22. package/css/index.css.map +1 -1
  23. package/css/index.min.css +3 -3
  24. package/css/index.min.css.map +1 -1
  25. package/es/components/AddSelect/AddSelect.js +57 -422
  26. package/es/components/AddSelect/AddSelectBody.js +349 -0
  27. package/es/components/AddSelect/AddSelectBreadcrumbs.js +11 -31
  28. package/es/components/AddSelect/AddSelectColumn.js +91 -41
  29. package/es/components/AddSelect/AddSelectFilter.js +1 -2
  30. package/es/components/AddSelect/AddSelectList.js +10 -61
  31. package/es/components/AddSelect/AddSelectMetaPanel.js +1 -1
  32. package/es/components/AddSelect/AddSelectSidebar.js +20 -13
  33. package/es/components/AddSelect/AddSelectSort.js +2 -2
  34. package/es/components/AddSelect/add-select-utils.js +85 -59
  35. package/es/components/AddSelect/hooks/useParentSelect.js +16 -0
  36. package/es/components/AddSelect/hooks/usePath.js +66 -0
  37. package/es/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +1 -5
  38. package/es/components/CreateTearsheet/preview-components/MultiStepWithIntro.js +1 -5
  39. package/es/components/Datagrid/Datagrid/Datagrid.js +1 -1
  40. package/es/components/Datagrid/Datagrid.stories/StickyActionsColumnStory.js +92 -92
  41. package/es/components/Datagrid/index.js +2 -1
  42. package/es/components/Datagrid/useColumnCenterAlign.js +52 -0
  43. package/es/components/Datagrid/useExpandedRow.js +12 -4
  44. package/es/components/Datagrid/utils/makeData.js +155 -0
  45. package/es/components/PageHeader/PageHeaderUtils.js +5 -0
  46. package/es/components/TagSet/TagSet.js +15 -5
  47. package/lib/components/AddSelect/AddSelect.js +54 -430
  48. package/lib/components/AddSelect/AddSelectBody.js +384 -0
  49. package/lib/components/AddSelect/AddSelectBreadcrumbs.js +11 -30
  50. package/lib/components/AddSelect/AddSelectColumn.js +90 -39
  51. package/lib/components/AddSelect/AddSelectFilter.js +1 -2
  52. package/lib/components/AddSelect/AddSelectList.js +11 -60
  53. package/lib/components/AddSelect/AddSelectMetaPanel.js +1 -1
  54. package/lib/components/AddSelect/AddSelectSidebar.js +20 -13
  55. package/lib/components/AddSelect/AddSelectSort.js +2 -2
  56. package/lib/components/AddSelect/add-select-utils.js +88 -64
  57. package/lib/components/AddSelect/hooks/useParentSelect.js +27 -0
  58. package/lib/components/AddSelect/hooks/usePath.js +75 -0
  59. package/lib/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +1 -5
  60. package/lib/components/CreateTearsheet/preview-components/MultiStepWithIntro.js +1 -5
  61. package/lib/components/Datagrid/Datagrid/Datagrid.js +1 -1
  62. package/lib/components/Datagrid/Datagrid.stories/StickyActionsColumnStory.js +93 -112
  63. package/lib/components/Datagrid/index.js +9 -1
  64. package/lib/components/Datagrid/useColumnCenterAlign.js +59 -0
  65. package/lib/components/Datagrid/useExpandedRow.js +20 -4
  66. package/lib/components/Datagrid/utils/makeData.js +167 -0
  67. package/lib/components/PageHeader/PageHeaderUtils.js +5 -0
  68. package/lib/components/TagSet/TagSet.js +15 -5
  69. package/package.json +16 -16
  70. package/scss/components/Cascade/_cascade.scss +2 -1
  71. package/scss/components/CreateInfluencer/_create-influencer.scss +0 -2
  72. package/scss/components/CreateTearsheet/_create-tearsheet.scss +1 -1
  73. package/scss/components/Datagrid/_storybook-styles.scss +4 -0
  74. package/scss/components/Datagrid/styles/datagrid.scss +4 -0
  75. package/scss/components/Datagrid/styles/index.scss +2 -0
  76. package/scss/components/Datagrid/styles/useColumnCenterAlign.scss +19 -0
  77. package/scss/components/Datagrid/styles/useExpandedRow.scss +13 -0
  78. package/scss/components/InlineEdit/_inline-edit.scss +2 -1
  79. package/scss/components/OptionsTile/_options-tile.scss +1 -0
  80. package/scss/components/PageHeader/_page-header.scss +9 -4
  81. package/scss/components/SidePanel/_side-panel.scss +1 -2
  82. package/scss/components/TagSet/_tag-set.scss +4 -0
  83. package/scss/components/WebTerminal/_web-terminal.scss +1 -1
@@ -1,92 +1,92 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
- import React, { useState, useEffect } from 'react';
4
- import { Datagrid, useActionsColumn, useDatagrid, useStickyColumn } from '..';
5
- import { defaultHeader, makeData, Wrapper } from './common';
6
-
7
- var StickyActionsColumn = function StickyActionsColumn() {
8
- var columns = React.useMemo(function () {
9
- return [].concat(_toConsumableArray(defaultHeader), [{
10
- Header: '',
11
- accessor: 'actions',
12
- sticky: 'right',
13
- width: 60,
14
- isAction: true
15
- }]);
16
- }, []);
17
-
18
- var _useState = useState([]),
19
- _useState2 = _slicedToArray(_useState, 2),
20
- data = _useState2[0],
21
- setData = _useState2[1];
22
-
23
- var _useState3 = useState('click action menu'),
24
- _useState4 = _slicedToArray(_useState3, 2),
25
- msg = _useState4[0],
26
- setMsg = _useState4[1];
27
-
28
- var onActionClick = function onActionClick(actionId, row) {
29
- var original = row.original;
30
- setMsg("Clicked [".concat(actionId, "] on row: <").concat(original.firstName, " ").concat(original.lastName, ">"));
31
- };
32
-
33
- var _useState5 = useState(true),
34
- _useState6 = _slicedToArray(_useState5, 2),
35
- isFetching = _useState6[0],
36
- setIsFetching = _useState6[1];
37
-
38
- useEffect(function () {
39
- var fetchData = function fetchData() {
40
- return new Promise(function (resolve) {
41
- setIsFetching(true);
42
- setTimeout(function () {
43
- setData(data.concat(makeData(30, 5, 2)));
44
- resolve();
45
- }, 1000);
46
- }).then(function () {
47
- return setIsFetching(false);
48
- });
49
- };
50
-
51
- fetchData();
52
- }, [data]);
53
- var datagridState = useDatagrid({
54
- columns: columns,
55
- data: data,
56
- isFetching: isFetching,
57
- rowActions: [{
58
- id: 'edit',
59
- itemText: 'Edit',
60
- onClick: onActionClick
61
- }, {
62
- id: 'vote',
63
- itemText: 'Vote',
64
- onClick: onActionClick,
65
- shouldHideMenuItem: function shouldHideMenuItem(row) {
66
- return row.original.age <= 18;
67
- }
68
- }, {
69
- id: 'retire',
70
- itemText: 'Retire',
71
- onClick: onActionClick,
72
- disabled: false,
73
- shouldDisableMenuItem: function shouldDisableMenuItem(row) {
74
- return row.original.age <= 60;
75
- }
76
- }, {
77
- id: 'delete',
78
- itemText: 'Delete',
79
- hasDivider: true,
80
- isDelete: true,
81
- onClick: onActionClick
82
- }]
83
- }, useStickyColumn, useActionsColumn);
84
- return /*#__PURE__*/React.createElement(Wrapper, null, /*#__PURE__*/React.createElement("h3", null, msg), /*#__PURE__*/React.createElement(Datagrid, datagridState), /*#__PURE__*/React.createElement("p", null, "More details documentation check the Notes section below"));
85
- };
86
-
87
- StickyActionsColumn.story = {
88
- parameters: {
89
- notes: "\n Sticky column and actions column can be used at the same time like the demo above. Following is the doc for each of them.\n\n # Sticky column\n This will make the column mark with `sticky: \"right\"` to be sticky on the right.\n\n ## Incompatible with following plugins:\n - `useInfiniteScroll`\n\n ## Sample usage:\n \n 1. include the `useStickyColumn` hook\n 2. add `sticky=\"right\"` to the column object\n\n ```js\n const columns = [\n ... // other columns\n {\n Header: \"\",\n accessor: \"actions\",\n sticky: \"right\",\n width: 60,\n },\n ]\n const datagridState = useDatagrid(\n {\n columns,\n data,\n },\n useStickyColumn\n );\n ```\n ```html\n <Datagrid {...datagridState} />\n ```\n\n # Actions column\n This will add OverflowMenu component to the cells on the column mark with `isAction: true`. Each action button callback will include the actionId and row object\n\n ## Sample usage:\n 1. include `useActionsColumn` hook\n 2. add `isAction = true` to the column object in which you which to add the overflow menu actions\n 3. add `rowActions = []` array to the props\n - `rowActions[].id` for callback to identify the action is called\n - `rowActions[].onClick(actionId: string, row: Row, event: ClickEvent)` callback on menuitem clicked. [Row properties](https://react-table.tanstack.com/docs/api/useTable#row-properties)\n - `rowActions[].shouldHideMenuItem(row: Row)` callback to hide this menuitem. [Row properties](https://react-table.tanstack.com/docs/api/useTable#row-properties)\n - `rowActions[].shouldDisableMenuItem(row: Row)` callback to disable this menuitem. [Row properties](https://react-table.tanstack.com/docs/api/useTable#row-properties)\n - This will override `rowActions[].disabled` (from Carbon) because `shouldDisableMenuItem` is more specific to the row.\n - each action object can take all the props from `OverflowMenuItem` props, see [carbon docs](https://react.carbondesignsystem.com/?path=/docs/components-overflowmenu--default#overflowmenu)\n\n ```js\n const columns = [\n ... // other columns\n {\n Header: \"\",\n accessor: \"actions\",\n isAction: true,\n },\n ]\n const onActionClick = (actionId, row, event) => {};\n const datagridState = useDatagrid(\n {\n columns,\n data,\n rowActions: [\n {\n id: 'edit',\n itemText: 'Edit',\n onClick: onActionClick\n },\n {\n id: 'hidden',\n itemText: 'Hidden item',\n onClick: onActionClick,\n shouldHideMenuItem: () => true,\n },\n {\n id: 'delete',\n itemText: 'Delete',\n hasDivider: true,\n isDelete: true,\n onClick: onActionClick\n },\n ]\n },\n useActionsColumn,\n );\n ```\n ```html\n <Datagrid {...datagridState} />\n ```\n "
90
- }
91
- };
92
- export default StickyActionsColumn;
1
+ // import React, { useState, useEffect } from 'react';
2
+ // import { Datagrid, useActionsColumn, useDatagrid, useStickyColumn } from '..';
3
+ // import { defaultHeader, makeData, Wrapper } from './common';
4
+ // StickyActionsColumn.story = {
5
+ // parameters: {
6
+ // notes: `
7
+ // Sticky column and actions column can be used at the same time like the demo above. Following is the doc for each of them.
8
+ // # Sticky column
9
+ // This will make the column mark with \`sticky: "right"\` to be sticky on the right.
10
+ // ## Incompatible with following plugins:
11
+ // - \`useInfiniteScroll\`
12
+ // ## Sample usage:
13
+ // 1. include the \`useStickyColumn\` hook
14
+ // 2. add \`sticky="right"\` to the column object
15
+ // \`\`\`js
16
+ // const columns = [
17
+ // ... // other columns
18
+ // {
19
+ // Header: "",
20
+ // accessor: "actions",
21
+ // sticky: "right",
22
+ // width: 60,
23
+ // },
24
+ // ]
25
+ // const datagridState = useDatagrid(
26
+ // {
27
+ // columns,
28
+ // data,
29
+ // },
30
+ // useStickyColumn
31
+ // );
32
+ // \`\`\`
33
+ // \`\`\`html
34
+ // <Datagrid {...datagridState} />
35
+ // \`\`\`
36
+ // # Actions column
37
+ // This will add OverflowMenu component to the cells on the column mark with \`isAction: true\`. Each action button callback will include the actionId and row object
38
+ // ## Sample usage:
39
+ // 1. include \`useActionsColumn\` hook
40
+ // 2. add \`isAction = true\` to the column object in which you which to add the overflow menu actions
41
+ // 3. add \`rowActions = []\` array to the props
42
+ // - \`rowActions[].id\` for callback to identify the action is called
43
+ // - \`rowActions[].onClick(actionId: string, row: Row, event: ClickEvent)\` callback on menuitem clicked. [Row properties](https://react-table.tanstack.com/docs/api/useTable#row-properties)
44
+ // - \`rowActions[].shouldHideMenuItem(row: Row)\` callback to hide this menuitem. [Row properties](https://react-table.tanstack.com/docs/api/useTable#row-properties)
45
+ // - \`rowActions[].shouldDisableMenuItem(row: Row)\` callback to disable this menuitem. [Row properties](https://react-table.tanstack.com/docs/api/useTable#row-properties)
46
+ // - This will override \`rowActions[].disabled\` (from Carbon) because \`shouldDisableMenuItem\` is more specific to the row.
47
+ // - each action object can take all the props from \`OverflowMenuItem\` props, see [carbon docs](https://react.carbondesignsystem.com/?path=/docs/components-overflowmenu--default#overflowmenu)
48
+ // \`\`\`js
49
+ // const columns = [
50
+ // ... // other columns
51
+ // {
52
+ // Header: "",
53
+ // accessor: "actions",
54
+ // isAction: true,
55
+ // },
56
+ // ]
57
+ // const onActionClick = (actionId, row, event) => {};
58
+ // const datagridState = useDatagrid(
59
+ // {
60
+ // columns,
61
+ // data,
62
+ // rowActions: [
63
+ // {
64
+ // id: 'edit',
65
+ // itemText: 'Edit',
66
+ // onClick: onActionClick
67
+ // },
68
+ // {
69
+ // id: 'hidden',
70
+ // itemText: 'Hidden item',
71
+ // onClick: onActionClick,
72
+ // shouldHideMenuItem: () => true,
73
+ // },
74
+ // {
75
+ // id: 'delete',
76
+ // itemText: 'Delete',
77
+ // hasDivider: true,
78
+ // isDelete: true,
79
+ // onClick: onActionClick
80
+ // },
81
+ // ]
82
+ // },
83
+ // useActionsColumn,
84
+ // );
85
+ // \`\`\`
86
+ // \`\`\`html
87
+ // <Datagrid {...datagridState} />
88
+ // \`\`\`
89
+ // `,
90
+ // },
91
+ // };
92
+ // export default StickyActionsColumn;
@@ -19,4 +19,5 @@ export { default as useDisableSelectRows } from './useDisableSelectRows';
19
19
  export { default as useStickyColumn } from './useStickyColumn';
20
20
  export { default as useActionsColumn } from './useActionsColumn';
21
21
  export { default as useCustomizeColumns } from './useCustomizeColumns';
22
- export { default as useSelectAllWithToggle } from './useSelectAllToggle';
22
+ export { default as useSelectAllWithToggle } from './useSelectAllToggle';
23
+ export { default as useColumnCenterAlign } from './useColumnCenterAlign';
@@ -0,0 +1,52 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+
4
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
+
6
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
+
8
+ /*
9
+ * Licensed Materials - Property of IBM
10
+ * 5724-Q36
11
+ * (c) Copyright IBM Corp. 2020
12
+ * US Government Users Restricted Rights - Use, duplication or disclosure
13
+ * restricted by GSA ADP Schedule Contract with IBM Corp.
14
+ */
15
+ import React from 'react';
16
+ import cx from 'classnames';
17
+ import { pkg } from '../../settings';
18
+ var blockClass = "".concat(pkg.prefix, "--datagrid");
19
+
20
+ var useColumnCenterAlign = function useColumnCenterAlign(hooks) {
21
+ var centerAlignRenderer = function centerAlignRenderer(tableProps, column) {
22
+ return /*#__PURE__*/React.createElement("div", {
23
+ className: cx("".concat(blockClass, "__center-align-cell-renderer"), {
24
+ sortDisabled: !tableProps.isTableSortable || tableProps.column.disableSortBy === true
25
+ })
26
+ }, column.Cell(tableProps));
27
+ };
28
+
29
+ var centerAlignHeader = function centerAlignHeader(headerProp, column) {
30
+ return /*#__PURE__*/React.createElement("div", {
31
+ className: "".concat(blockClass, "__center-align-header")
32
+ }, typeof column.Header === 'function' ? column.Header(headerProp) : column.Header);
33
+ };
34
+
35
+ var centerAlignedColumns = function centerAlignedColumns(columns) {
36
+ var columnsWithDefaultCells = columns.map(function (column) {
37
+ return _objectSpread(_objectSpread({}, column), {}, {
38
+ Cell: column.centerAlignedColumn ? function (tableProp) {
39
+ return centerAlignRenderer(tableProp, column);
40
+ } : column.Cell,
41
+ Header: column.centerAlignedColumn ? function (headerProp) {
42
+ return centerAlignHeader(headerProp, column);
43
+ } : column.Header
44
+ });
45
+ });
46
+ return _toConsumableArray(columnsWithDefaultCells);
47
+ };
48
+
49
+ hooks.visibleColumns.push(centerAlignedColumns);
50
+ };
51
+
52
+ export default useColumnCenterAlign;
@@ -12,17 +12,25 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
12
12
  * US Government Users Restricted Rights - Use, duplication or disclosure
13
13
  * restricted by GSA ADP Schedule Contract with IBM Corp.
14
14
  */
15
- import { useState } from 'react';
15
+ import React, { useState } from 'react';
16
16
  import DatagridExpandedRow from './Datagrid/DatagridExpandedRow';
17
17
  import useRowExpander from './useRowExpander';
18
+ import { pkg } from '../../settings';
19
+ var blockClass = "".concat(pkg.prefix, "--datagrid");
20
+
21
+ var expansionRenderer = function expansionRenderer(_ref) {
22
+ var row = _ref.row;
23
+ return /*#__PURE__*/React.createElement("div", {
24
+ className: "".concat(blockClass, "__expanded-row-content")
25
+ }, "Content for ", row.id);
26
+ };
18
27
 
19
28
  var useExpandedRow = function useExpandedRow(hooks) {
20
29
  useRowExpander(hooks);
21
30
 
22
31
  var useInstance = function useInstance(instance) {
23
32
  var rows = instance.rows,
24
- expandedContentHeight = instance.expandedContentHeight,
25
- ExpandedRowContentComponent = instance.ExpandedRowContentComponent;
33
+ expandedContentHeight = instance.expandedContentHeight;
26
34
 
27
35
  var _useState = useState({}),
28
36
  _useState2 = _slicedToArray(_useState, 2),
@@ -37,7 +45,7 @@ var useExpandedRow = function useExpandedRow(hooks) {
37
45
  return _objectSpread(_objectSpread({}, row), {}, {
38
46
  canExpand: row.original && !row.original.notExpandable,
39
47
  expandedContentHeight: expandedRowsHeight[row.index] || expandedContentHeight,
40
- RowRenderer: DatagridExpandedRow(row.RowRenderer, ExpandedRowContentComponent)
48
+ RowRenderer: DatagridExpandedRow(row.RowRenderer, expansionRenderer)
41
49
  });
42
50
  });
43
51
  Object.assign(instance, {
@@ -0,0 +1,155 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
+
5
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
+
7
+ /**
8
+ * Copyright IBM Corp. 2022, 2022
9
+ *
10
+ * This source code is licensed under the Apache-2.0 license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */
13
+ import React from 'react';
14
+ import namor from 'namor';
15
+ export var makeData = function makeData() {
16
+ for (var _len = arguments.length, lens = new Array(_len), _key = 0; _key < _len; _key++) {
17
+ lens[_key] = arguments[_key];
18
+ }
19
+
20
+ var makeDataLevel = function makeDataLevel() {
21
+ var depth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
22
+ var len = lens[depth];
23
+ return range(len).map(function () {
24
+ return _objectSpread(_objectSpread({}, newPerson()), {}, {
25
+ subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined
26
+ });
27
+ });
28
+ };
29
+
30
+ return makeDataLevel();
31
+ };
32
+ export var range = function range(len) {
33
+ var arr = [];
34
+
35
+ for (var i = 0; i < len; i++) {
36
+ arr.push(i);
37
+ }
38
+
39
+ return arr;
40
+ };
41
+
42
+ var newPerson = function newPerson() {
43
+ var statusChance = Math.random();
44
+ return {
45
+ firstName: namor.generate({
46
+ words: 1,
47
+ numbers: 0
48
+ }),
49
+ lastName: namor.generate({
50
+ words: 1,
51
+ numbers: 0
52
+ }),
53
+ age: Math.floor(Math.random() * 30),
54
+ visits: Math.floor(Math.random() * 100),
55
+ progress: Math.floor(Math.random() * 100),
56
+ someone1: namor.generate({
57
+ words: 1,
58
+ numbers: 0
59
+ }),
60
+ someone2: namor.generate({
61
+ words: 1,
62
+ numbers: 0
63
+ }),
64
+ someone3: namor.generate({
65
+ words: 1,
66
+ numbers: 0
67
+ }),
68
+ someone4: namor.generate({
69
+ words: 1,
70
+ numbers: 0
71
+ }),
72
+ someone5: namor.generate({
73
+ words: 1,
74
+ numbers: 0
75
+ }),
76
+ someone6: namor.generate({
77
+ words: 1,
78
+ numbers: 0
79
+ }),
80
+ someone7: namor.generate({
81
+ words: 1,
82
+ numbers: 0
83
+ }),
84
+ someone8: namor.generate({
85
+ words: 1,
86
+ numbers: 0
87
+ }),
88
+ someone9: namor.generate({
89
+ words: 1,
90
+ numbers: 0
91
+ }),
92
+ someone10: namor.generate({
93
+ words: 1,
94
+ numbers: 0
95
+ }),
96
+ someone11: namor.generate({
97
+ words: 1,
98
+ numbers: 0
99
+ }),
100
+ someone12: namor.generate({
101
+ words: 1,
102
+ numbers: 0
103
+ }),
104
+ someone13: namor.generate({
105
+ words: 1,
106
+ numbers: 0
107
+ }),
108
+ someone14: namor.generate({
109
+ words: 1,
110
+ numbers: 0
111
+ }),
112
+ someone15: namor.generate({
113
+ words: 1,
114
+ numbers: 0
115
+ }),
116
+ someone16: namor.generate({
117
+ words: 1,
118
+ numbers: 0
119
+ }),
120
+ someone17: namor.generate({
121
+ words: 1,
122
+ numbers: 0
123
+ }),
124
+ someone18: namor.generate({
125
+ words: 1,
126
+ numbers: 0
127
+ }),
128
+ someone19: namor.generate({
129
+ words: 1,
130
+ numbers: 0
131
+ }),
132
+ someone20: namor.generate({
133
+ words: 1,
134
+ numbers: 0
135
+ }),
136
+ status: statusChance > 0.66 ? 'relationship' : statusChance > 0.33 ? 'complicated' : 'single'
137
+ };
138
+ };
139
+
140
+ export var newPersonWithTwoLines = function newPersonWithTwoLines() {
141
+ return {
142
+ firstName: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, namor.generate({
143
+ words: 1,
144
+ numbers: 0
145
+ })), /*#__PURE__*/React.createElement("div", null, namor.generate({
146
+ words: 1,
147
+ numbers: 0
148
+ }))),
149
+ lastName: namor.generate({
150
+ words: 1,
151
+ numbers: 0
152
+ }),
153
+ age: Math.floor(Math.random() * 30)
154
+ };
155
+ };
@@ -118,6 +118,11 @@ export var utilCheckUpdateVerticalSpace = function utilCheckUpdateVerticalSpace(
118
118
  if (!enableBreadcrumbScroll || !navigation) {
119
119
  // adjust sticky top if no navigation or breadcrumb is to stay on screen
120
120
  update.headerTopValue += update.breadcrumbRowHeight;
121
+ }
122
+
123
+ if (enableBreadcrumbScroll) {
124
+ // adjust header top value when scroll enabled for breadcrumb
125
+ update.headerTopValue -= navigation ? hasActionBar ? 0 : 10 : update.headerHeight;
121
126
  } // if (window) {
122
127
 
123
128
 
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
- var _excluded = ["align", "allTagsModalTarget", "className", "maxVisible", "overflowAlign", "overflowClassName", "overflowDirection", "allTagsModalTitle", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "showAllTagsLabel", "tags"],
5
+ var _excluded = ["align", "allTagsModalTarget", "className", "maxVisible", "multiline", "overflowAlign", "overflowClassName", "overflowDirection", "allTagsModalTitle", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "showAllTagsLabel", "tags"],
6
6
  _excluded2 = ["label", "id"],
7
7
  _excluded3 = ["label"];
8
8
 
@@ -43,6 +43,7 @@ export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
43
43
  allTagsModalTargetIn = _ref.allTagsModalTarget,
44
44
  className = _ref.className,
45
45
  maxVisible = _ref.maxVisible,
46
+ multiline = _ref.multiline,
46
47
  _ref$overflowAlign = _ref.overflowAlign,
47
48
  overflowAlign = _ref$overflowAlign === void 0 ? defaults.overflowAlign : _ref$overflowAlign,
48
49
  overflowClassName = _ref.overflowClassName,
@@ -161,7 +162,11 @@ export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
161
162
  setDisplayedTags(newDisplayedTags);
162
163
  }, [displayCount, overflowAlign, overflowClassName, overflowDirection, showAllTagsLabel, tags]);
163
164
  var checkFullyVisibleTags = useCallback(function () {
164
- // how many will fit?
165
+ if (multiline) {
166
+ return setDisplayCount(maxVisible);
167
+ } // how many will fit?
168
+
169
+
165
170
  var willFit = 0;
166
171
 
167
172
  if (sizingTags.length > 0) {
@@ -193,10 +198,10 @@ export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
193
198
  } else {
194
199
  setDisplayCount(maxVisible ? Math.min(willFit, maxVisible) : willFit);
195
200
  }
196
- }, [maxVisible, sizingTags, tagSetRef]);
201
+ }, [maxVisible, multiline, sizingTags, tagSetRef]);
197
202
  useEffect(function () {
198
203
  checkFullyVisibleTags();
199
- }, [checkFullyVisibleTags, maxVisible, sizingTags]);
204
+ }, [checkFullyVisibleTags, maxVisible, multiline, sizingTags]);
200
205
  /* don't know how to test resize */
201
206
 
202
207
  /* istanbul ignore next */
@@ -239,7 +244,7 @@ export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
239
244
  "aria-hidden": true,
240
245
  ref: sizingContainerRef
241
246
  }, hiddenSizingTags), /*#__PURE__*/React.createElement("div", {
242
- className: "".concat(blockClass, "__tag-container"),
247
+ className: cx(["".concat(blockClass, "__tag-container"), multiline && "".concat(blockClass, "__tag-container--multiline")]),
243
248
  ref: displayedArea
244
249
  }, displayedTags)), (allTagsModalTarget ? createPortal : function (children) {
245
250
  return children;
@@ -316,6 +321,11 @@ TagSet.propTypes = {
316
321
  */
317
322
  maxVisible: PropTypes.number,
318
323
 
324
+ /**
325
+ * display tags in multiple lines
326
+ */
327
+ multiline: PropTypes.bool,
328
+
319
329
  /**
320
330
  * overflowAlign from the standard tooltip. Default center.
321
331
  */