@carbon/ibm-products 2.3.2 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/css/index-full-carbon.css +235 -110
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +2 -2
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +24 -24
  6. package/css/index-without-carbon-released-only.min.css +1 -1
  7. package/css/index-without-carbon.css +59 -54
  8. package/css/index-without-carbon.css.map +1 -1
  9. package/css/index-without-carbon.min.css +2 -2
  10. package/css/index-without-carbon.min.css.map +1 -1
  11. package/css/index.css +122 -38
  12. package/css/index.css.map +1 -1
  13. package/css/index.min.css +3 -3
  14. package/css/index.min.css.map +1 -1
  15. package/es/components/Datagrid/Datagrid/Datagrid.js +5 -1
  16. package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +15 -21
  17. package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +6 -20
  18. package/es/components/Datagrid/Datagrid.docs-page.js +123 -0
  19. package/es/components/Datagrid/Extensions/ColumnAlignment/ColumnAlignment.docs-page.js +13 -0
  20. package/es/components/Datagrid/Extensions/ColumnCustomization/ColumnCustomization.docs-page.js +13 -0
  21. package/es/components/Datagrid/Extensions/EditableCell/EditableCell.docs-page.js +47 -0
  22. package/es/components/Datagrid/Extensions/ExpandableRow/ExpandableRow.docs-page.js +13 -0
  23. package/es/components/Datagrid/Extensions/Filtering/Filtering.docs-page.js +57 -0
  24. package/es/components/Datagrid/Extensions/RowActionButtons/RowActionButtons.docs-page.js +13 -0
  25. package/es/components/Datagrid/utils/DatagridActions.js +1 -1
  26. package/es/components/Datagrid/utils/getArgTypes.js +4 -0
  27. package/es/components/FilterSummary/FilterSummary.js +7 -3
  28. package/es/components/OptionsTile/OptionsTile.js +8 -1
  29. package/es/global/js/utils/StoryDocsPage.js +6 -2
  30. package/lib/components/Datagrid/Datagrid/Datagrid.js +5 -1
  31. package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +14 -20
  32. package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +6 -23
  33. package/lib/components/Datagrid/Datagrid.docs-page.js +134 -0
  34. package/lib/components/Datagrid/Extensions/ColumnAlignment/ColumnAlignment.docs-page.js +21 -0
  35. package/lib/components/Datagrid/Extensions/ColumnCustomization/ColumnCustomization.docs-page.js +21 -0
  36. package/lib/components/Datagrid/Extensions/EditableCell/EditableCell.docs-page.js +55 -0
  37. package/lib/components/Datagrid/Extensions/ExpandableRow/ExpandableRow.docs-page.js +21 -0
  38. package/lib/components/Datagrid/Extensions/Filtering/Filtering.docs-page.js +65 -0
  39. package/lib/components/Datagrid/Extensions/RowActionButtons/RowActionButtons.docs-page.js +21 -0
  40. package/lib/components/Datagrid/utils/DatagridActions.js +1 -1
  41. package/lib/components/Datagrid/utils/getArgTypes.js +4 -0
  42. package/lib/components/FilterSummary/FilterSummary.js +7 -3
  43. package/lib/components/OptionsTile/OptionsTile.js +8 -1
  44. package/lib/global/js/utils/StoryDocsPage.js +6 -2
  45. package/package.json +16 -16
  46. package/scss/components/Datagrid/_datagrid.scss +17 -10
  47. package/scss/components/FilterSummary/_storybook-styles.scss +2 -0
@@ -0,0 +1,134 @@
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.DocsPage = void 0;
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _StoryDocsPage = require("../../global/js/utils/StoryDocsPage");
11
+ var stories = _interopRequireWildcard(require("./Datagrid.stories"));
12
+ var _datagridActionsExample = _interopRequireDefault(require("./storybook-assets/datagrid-actions-example.png"));
13
+ 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); }
14
+ 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; }
15
+ var DocsPage = function DocsPage() {
16
+ return /*#__PURE__*/_react.default.createElement(_StoryDocsPage.StoryDocsPage, {
17
+ blocks: [{
18
+ title: 'Getting started',
19
+ description: "You can use the `Datagrid` component to create various kinds of Carbon data tables. Simply import the `Datagrid` along with any accompanying hooks (listed below) depending on what extensions you'd like to be included.",
20
+ source: {
21
+ code: "import {\n Datagrid,\n useDatagrid,\n useInfiniteScroll,\n useNestedRows,\n useSelectRows,\n useExpandedRow,\n useOnRowClick,\n useSortableColumns,\n useRowIsMouseOver,\n useColumnRightAlign,\n useDisableSelectRows,\n useStickyColumn,\n useActionsColumn,\n useCustomizeColumns,\n useSelectAllWithToggle,\n useColumnCenterAlign,\n useColumnOrder,\n useEditableCell,\n useFiltering,\n useFilterContext\n} from '@carbon/ibm-products';"
22
+ }
23
+ }, {
24
+ title: 'Basic',
25
+ description: "Here is a basic usage example. The following component will render the datagrid seen below, with pagination and some toolbar actions. One of the key pieces to building the `Datagrid` is the `useDatagrid` hook, this will give you all of the state/props required to render a `Datagrid`."
26
+ }, {
27
+ subTitle: 'Multi line wrap',
28
+ description: 'This setting enables the table cell text wrap to two lines. This can be turned on for only one column in the datagrid or for every column.',
29
+ source: {
30
+ language: 'jsx',
31
+ code: "\n import { Datagrid, useDatagrid } from '@carbon/ibm-products';\n\nconst App = () => {\n const columns = React.useMemo(() => defaultHeader, []); // These are the columns that will be used by the datagrid\n const [data] = useState(makeData(10)); // This is the data that will be rendered by the datagrid\n\n const columns = React.useMemo(\n () => [\n ...defaultHeader,\n {\n Header: 'Someone 11',\n accessor: 'someone11',\n multiLineWrap: true, //If `multiLineWrap` is required only for specific columns\n },\n ],\n []\n );\n\n const datagridState = useDatagrid({\n columns,\n data,\n multiLineWrapAll: true, // If `multiLineWrap` is required for all columns in data grid\n });\n\n return <Datagrid datagridState={datagridState} />;\n};\n "
32
+ }
33
+ }, {
34
+ story: stories.BasicUsage
35
+ }, {
36
+ title: 'Column structure',
37
+ description: "The columns that are passed to the `useDatagrid` hook will have the following structure:",
38
+ source: {
39
+ language: 'jsx',
40
+ code: "\n const columns = [\n {\n Header: 'First Name',\n accessor: 'firstName',\n },\n {\n Header: 'Last Name',\n accessor: 'lastName',\n },\n];"
41
+ }
42
+ }, {
43
+ description: "To change the default/initial width of a column, add a `width` property to the column.",
44
+ source: {
45
+ language: 'jsx',
46
+ code: "\n const columns = [\n {\n Header: 'First Name',\n accessor: 'firstName',\n width: 120,\n },\n {\n Header: 'Last Name',\n accessor: 'lastName',\n width: 180,\n },\n];\n "
47
+ }
48
+ }, {
49
+ description: 'If needed, it is also possible to wrap each cell in a containing element. See below:',
50
+ source: {
51
+ language: 'jsx',
52
+ code: "\n const columns = [\n {\n Header: 'First Name',\n accessor: 'firstName',\n },\n {\n Header: 'Last Name',\n accessor: 'lastName',\n Cell: ({ cell: { value } }) => (\n <span className=\"custom-cell-wrapper\">{value}</span>\n ),\n },\n];\n "
53
+ }
54
+ }, {
55
+ title: 'Rendering the table toolbar',
56
+ image: /*#__PURE__*/_react.default.createElement("img", {
57
+ src: _datagridActionsExample.default,
58
+ alt: "Datagrid highlighting toolbar area"
59
+ }),
60
+ description: "In some of the examples you will see a component named `DatagridActions` passed to the `useDatagrid` hook. This component will render the table toolbar and is something that you will need to create on your own and then provide it to the `useDatagrid` hook. You can reference the `DatagridActions` that we have [created for our stories](https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products/src/components/Datagrid/utils/DatagridActions.js) when building your own."
61
+ }, {
62
+ title: 'Empty',
63
+ story: stories.EmptyState,
64
+ description: "The `Datagrid` supports empty states, when the data prop passed to the `useDatagrid` hook is an empty array.\n ",
65
+ source: {
66
+ language: 'jsx',
67
+ code: "\nimport { Datagrid, useDatagrid } from '@carbon/ibm-products';\n\nconst App = () => {\n const columns = React.useMemo(() => defaultHeader, []); // These are the columns that will be used by the datagrid\n const [data] = useState([]); // This is the data that will be rendered by the datagrid\n\n const datagridState = useDatagrid({\n columns,\n data,\n emptyStateTitle: 'Empty state title',\n emptyStateDescription: 'Description explaining why table is empty',\n emptyStateSize: 'lg', // See empty state size options from the EmptyState component\n });\n\n return <Datagrid datagridState={datagridState} />;\n};\n "
68
+ }
69
+ }, {
70
+ title: 'Auto size column to fit content',
71
+ description: "The `getAutoSizedColumnWidth` utility function can be used to auto size columns based on it's content. The width will be set to that of the largest cell in the column or the column header, whichever is greater. If this is not used, the width will be set to the default column width (150px) or the value passed to the `width` property in the column definition. See example below:",
72
+ source: {
73
+ code: "\nimport { Datagrid, useDatagrid, getAutoSizedColumnWidth } from '@carbon/ibm-products';\n\n...\n\nconst myColumns = [\n {\n Header: 'Column 1',\n accessor: 'column_1',\n width: getAutoSizedColumnWidth(rows, 'column_1', 'Column 1'),\n }\n]\n\n...\n "
74
+ }
75
+ }, {
76
+ title: 'Disabling select rows',
77
+ description: "\n Disabling select rows allows you to choose which rows will be disabled in the table.\n\n- Include the `useDisableSelectRows` hook in the `endPlugins` property of `useDatagrid`.\n- Add the `shouldDisableSelectRow` to the `useDatagrid` hook, this will be a function that returns the row indexes that will be disabled.\n ",
78
+ source: {
79
+ code: "\nconst [data] = useState(makeData(10));\nconst columns = React.useMemo(() => getColumns(data), []);\nconst datagridState = useDatagrid(\n {\n columns,\n data,\n DatagridActions,\n DatagridBatchActions,\n endPlugins: [useDisableSelectRows],\n shouldDisableSelectRow: (row) => row.id % 2 === 0,\n disableSelectAll: true,\n },\n useSelectRows\n);\n\nreturn <Datagrid datagridState={datagridState} />;\n "
80
+ }
81
+ }, {
82
+ title: 'Infinite scroll',
83
+ description: "Infinite scroll is supported via the `useInfiniteScroll` hook. This hook will allow you to fetch more data to display to the user after a certain scroll threshold. The `useInfiniteScroll` hook can also be used to support virtualized data, this is required when working with large amounts of data, only rendering the rows that need to be visible in the component at a point in time."
84
+ }, {
85
+ description: "Infinite scroll:\n- Include `useInfiniteScroll` hook\n- Add `fetchMoreData` property to `useDatagrid`, this will be a function that is called when the scroll threshold is met. Optionally change the height of the grid with the `virtualHeight` property.",
86
+ source: {
87
+ code: "\nconst datagridState = useDatagrid(\n {\n columns,\n data,\n isFetching,\n fetchMoreData: fetchData,\n virtualHeight: 540,\n emptyStateTitle: 'Empty state title',\n emptyStateDescription: 'Description explaining why the table is empty',\n },\n useInfiniteScroll\n);"
88
+ }
89
+ }, {
90
+ description: "Virtualized data:\n- Include `useInfiniteScroll` hook\n- The Datagrid will know to use virtualized data just by providing the `useInfiniteScroll` hook\n ",
91
+ source: {
92
+ code: "\nconst [data] = useState(makeData(10000));\nconst columns = React.useMemo(() => getColumns(data), []);\nconst datagridState = useDatagrid(\n {\n columns,\n data,\n },\n useInfiniteScroll\n);\n "
93
+ }
94
+ }, {
95
+ title: 'Detect row hover',
96
+ description: "There may be cases when you want to detect if a user is hovering on a particular row. In this case, use the `useRowIsMouseOver` hook.\n- Include the `useRowIsMouseOver` hook\n- When hover is detected on a row, a property called `isMouseOver` is changed from `false` to `true` within that row.\n "
97
+ }, {
98
+ title: 'Select items across all pages',
99
+ description: "By default, selecting all items with paginated rows will result in just the current page rows being selected. Incorporating the `useSelectAllWithToggle` hook will provide the option to select all rows across all pages.\n- Include `useSelectAllWithToggle` and `useSelectRows` hook\n- Add the `selectAllToggle` property to the `useDatagrid` hook\n- Optionally pass in labels to ensure proper translation\n- Optionally pass in `onSelectAllRoss`, function that will be called via the select all rows checkbox `onChange`\n ",
100
+ source: {
101
+ code: "\nconst [data] = useState(makeData(100));\nconst columns = React.useMemo(() => getColumns(data), []);\nconst [areAllSelected, setAreAllSelected] = useState(false);\nconst datagridState = useDatagrid(\n {\n columns,\n data,\n initialState: {\n pageSize: 10,\n pageSizes: [5, 10, 25, 50],\n },\n selectAllToggle: {\n labels: {\n allRows: 'Select all',\n allPageRows: 'Select all on page',\n },\n onSelectAllRows: setAreAllSelected,\n },\n DatagridPagination,\n DatagridActions,\n DatagridBatchActions,\n },\n useSelectRows,\n useSelectAllWithToggle\n);\n\nreturn (\n <Datagrid datagridState={datagridState} />\n);\n "
102
+ }
103
+ }, {
104
+ title: 'Selecting rows',
105
+ description: "When building a Datagrid that requires selectable rows, use the `useSelectRows` hook.\n- Include `useSelectRows` hook\n- Add `onRowSelect` to the `useDatagrid` hook, this is a callback function called when on a row's selection checkbox onChange, and sends back the row object and the event\n ",
106
+ source: {
107
+ code: "\nconst [data] = useState(makeData(10));\nconst columns = React.useMemo(() => getColumns(data), []);\nconst datagridState = useDatagrid(\n {\n columns,\n data,\n onRowSelect: (row, event) => console.log(row, event),\n },\n useSelectRows\n);\n\nreturn <Datagrid datagridState={datagridState} />;\n "
108
+ }
109
+ }, {
110
+ description: "The select all checkbox can be optionally hidden by settings the `hideSelectAll` property to `true` in the `useDatagrid` hook.",
111
+ source: {
112
+ code: "\nconst datagridState = useDatagrid(\n {\n columns,\n data,\n onRowSelect: (row, event) => console.log(row, event),\n hideSelectAll: true,\n },\n useSelectRows\n);\n "
113
+ }
114
+ }, {
115
+ description: "Datagrid also provides the option to use radio selection in cases where only one row should be selected at a time. Additionally, you can have preselected row/rows, see example below.",
116
+ source: {
117
+ code: "\nconst [data] = useState(makeData(10));\nconst columns = React.useMemo(() => getColumns(data), []);\nconst datagridState = useDatagrid(\n {\n columns,\n data,\n radio: true,\n onRadioSelect: (row) => console.log(`Row clicked`),\n initialState: {\n selectedRowIds: {\n 3: true,\n },\n },\n },\n useSelectRows\n);\n\nreturn <Datagrid datagridState={datagridState} />;\n "
118
+ }
119
+ }, {
120
+ title: 'Sortable columns',
121
+ description: "To add sortable columns to your Datagrid, simply add the `useSortableColumns` hook. This will allow each column header to be clickable and sort each column in either ascending or descending order.\n- Include `useSortableColumns` hook\n ",
122
+ source: {
123
+ code: "\nconst [data] = useState(makeData(10));\nconst columns = React.useMemo(() => getColumns(data), []);\nconst datagridState = useDatagrid(\n {\n columns,\n data,\n },\n useSortableColumns\n);\n\nreturn <Datagrid datagridState={datagridState} />;\n "
124
+ }
125
+ }, {
126
+ title: 'Sticky column',
127
+ description: "Sticky columns can be useful when you have many columns that create a horizontal scroll and you have important data in the first or last column that you always want to be visible.\n- Include the `useStickyColumn` hook\n- Sticky columns can _only_ be applied to the first and the last columns in the Datagrid. To have the first column stick, add `sticky: 'left'` to the first column definition. To have the last column stick, add `sticky: 'right'` to the last column definition.\n ",
128
+ source: {
129
+ code: "\nconst columns = [\n {\n Header: 'First column',\n accessor: 'first_column',\n sticky: 'left',\n },\n {\n ...\n },\n {\n ...\n }\n];\nconst datagridState = useDatagrid(\n {\n columns,\n data,\n },\n useStickyColumn\n);\n\nreturn <Datagrid datagridState={datagridState} />;\n "
130
+ }
131
+ }]
132
+ });
133
+ };
134
+ exports.DocsPage = DocsPage;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.DocsPage = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _StoryDocsPage = require("../../../../global/js/utils/StoryDocsPage");
10
+ var DocsPage = function DocsPage() {
11
+ return /*#__PURE__*/_react.default.createElement(_StoryDocsPage.StoryDocsPage, {
12
+ blocks: [{
13
+ description: "The default column alignment in the `Datagrid` is left, however there is support for center and right aligned as well. See [design guidance](https://pages.github.ibm.com/cdai-design/pal/components/data-table/column-alignment/usage) for details around when to change default column alignment.\n\nTo utilize center or right aligned columns refer to the steps below:\n\n - Include `useColumnCenterAlign` or `useColumnRightAlign` hook/s.\n - Add `rightAlignedColumn` or `centerAlignedColumn` to the column object in which you which to change the default column alignment.\n ",
14
+ source: {
15
+ language: 'jsx',
16
+ code: "\nimport {\n Datagrid,\n useDatagrid,\n useColumnCenterAlign,\n useColumnRightAlign,\n} from '@carbon/ibm-products';\n\nconst defaultColumns = [\n ...defaultCols,\n {\n Header: 'Bonus',\n accessor: 'bonus',\n width: 120,\n rightAlignedColumn: true,\n },\n {\n Header: 'Status',\n accessor: 'status_icon',\n width: 100,\n centerAlignedColumn: true,\n },\n];\n\nconst App = () => {\n const columns = React.useMemo(() => [...defaultHeader], []);\n const [data] = useState(makeData(10));\n\n const datagridState = useDatagrid(\n {\n columns,\n data,\n initialState: {\n pageSize: 10,\n pageSizes: [5, 10, 25, 50],\n },\n DatagridActions,\n DatagridPagination,\n },\n useColumnCenterAlign,\n useColumnRightAlign\n );\n\n return <Datagrid datagridState={datagridState} />;\n};\n "
17
+ }
18
+ }]
19
+ });
20
+ };
21
+ exports.DocsPage = DocsPage;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.DocsPage = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _StoryDocsPage = require("../../../../global/js/utils/StoryDocsPage");
10
+ var DocsPage = function DocsPage() {
11
+ return /*#__PURE__*/_react.default.createElement(_StoryDocsPage.StoryDocsPage, {
12
+ blocks: [{
13
+ title: 'Customizing columns',
14
+ description: "Customizing columns allows user to reorder and hide certain columns of the datagrid. Consuming component can use the provided callback to save/update according to their persistent strategy.\n- Include `useCustomizeColumns` and `useColumnOrder` hooks (required)\n - `useColumnOrder` comes from `react-table` but is exported by `@carbon/ibm-products` to be used alongside `useCustomizeColumns`.\n- Implement `options.DatagridActions` component\n - this component will have props: `datagridState`\n - render `datagridState.CustomizeColumnsButton` component wherever makes sense.\n- Options available to set:\n - `options.initialState.hiddenColumns: Array<ColumnId: String>`\n - Array of column ids that will be hidden after initial render\n - [react-table doc](https://react-table.tanstack.com/docs/api/useTable#table-options)\n - `options.initialState.columnOrder: Array<ColumnId: String>`\n - Order of the columns. Any column ids not in this array will be ordered by their position in the `options.columns`\n - [react-table doc](https://react-table.tanstack.com/docs/api/useColumnOrder#table-options)\n - `options.customizeColumnsProps.onSaveColumnPrefs`\n - type: `Function(Columns: Array<{ColumnId: String, isVisible: Boolean}>) => void`\n - Callback function when 'Save' button clicked on the narrow tearsheet. It allows consumer to preserve the updated column preference. This output can also be used to compute the `hiddenColumns` and `columnOrder`\n - Reset to default (optional)\n - There is a reset to default button on the modal. It will use the `options.columns` as the default. If there are columns should be hidden by default, denote them with property: `isVisible: false` (undefined will be treated as `true`).\n ",
15
+ source: {
16
+ code: "\nconst columns = React.useMemo(() => defaultHeader, []);\nconst [data] = useState(makeData(10));\nconst DatagridActions = (datagridState) => (\n <TableToolbarContent>\n <TableToolbarSearch ... />\n <Button ... />\n <datagridState.CustomizeColumnsButton />\n </TableToolbarContent>\n)\nconst datagridState = useDatagrid(\n {\n columns,\n data,\n initialState: {\n hiddenColumns: ['age'],\n columnOrder: [],\n },\n customizeColumnsProps: {\n onSaveColumnPrefs: (newColDefs) => {\n console.log(newColDefs);\n },\n },\n DatagridActions,\n },\n useCustomizeColumns,\n useColumnOrder,\n);\n\nreturn (\n <Datagrid datagridState={datagridState} />\n);\n "
17
+ }
18
+ }]
19
+ });
20
+ };
21
+ exports.DocsPage = DocsPage;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.DocsPage = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _StoryDocsPage = require("../../../../global/js/utils/StoryDocsPage");
10
+ var _EditableCell = require("./EditableCell.stories");
11
+ var DocsPage = function DocsPage() {
12
+ return /*#__PURE__*/_react.default.createElement(_StoryDocsPage.StoryDocsPage, {
13
+ blocks: [{
14
+ description: "The `Datagrid` supports inline editing when used with the `useEditableCell` hook (previously named `useInlineEdit` in v1) and columns are provided the required configuration. The four data types supported are strings, numbers, dates, and\n selection (dropdown)."
15
+ }, {
16
+ description: "Below are example column configurations for the supported inline edit data types:\n \nDefault/string:\n ",
17
+ source: {
18
+ language: 'json',
19
+ code: "\n {\n Header: 'First Name',\n accessor: 'firstName',\n inlineEdit: {\n type: 'text',\n // required for including validation, this is used to set the invalid prop internally\n validator: (n) => n.length >= 40,\n // These props are passed to the Carbon component used for inline editing, in this case the TextInput\n inputProps: {\n invalidText: 'Invalid text, character count must be less than 40',\n },\n },\n }\n "
20
+ }
21
+ }, {
22
+ description: 'Number',
23
+ source: {
24
+ language: 'json',
25
+ code: "\n{\n Header: 'Age',\n accessor: 'age',\n width: 120,\n inlineEdit: {\n // required for including validation, this is used to set the invalid prop internally\n validator: (n) => n && n < 18,\n type: 'number',\n // These props are passed to the Carbon component used for inline editing, in this case NumberInput\n inputProps: {\n invalidText: 'Invalid number, must be 18 or greater',\n },\n },\n},\n "
26
+ }
27
+ }, {
28
+ description: 'Date',
29
+ source: {
30
+ language: 'json',
31
+ code: "\n{\n Header: 'Active since',\n accessor: 'activeSince',\n inlineEdit: {\n type: 'date',\n inputProps: {\n // optionally pass props here to be passed through to Carbon's DatePicker component\n onChange: (newDateObj, cell) => {\n console.log(newDateObj, cell);\n },\n labelText: 'Change active since date',\n // optionally pass props here to be passed through to Carbon's DatePickerInput component\n datePickerInputProps: {\n labelText: 'Change active since date',\n },\n },\n },\n},\n "
32
+ }
33
+ }, {
34
+ description: 'Selection',
35
+ source: {
36
+ language: 'json',
37
+ code: "\n{\n Header: 'Chart type',\n accessor: 'chartType',\n inlineEdit: {\n type: 'selection',\n inputProps: {\n // These props are passed to the Carbon component used for inline editing\n items: [\n {\n id: 'option-0',\n icon: ChartColumnFloating16,\n text: 'Column Chart',\n },\n {\n id: 'option-1',\n icon: ChartBubble16,\n text: 'Bubble Chart',\n },\n {\n id: 'option-2',\n icon: ChartVennDiagram16,\n text: 'Venn Diagram',\n },\n ],\n onChange: (item) => {\n console.log(item);\n },\n },\n },\n},\n "
38
+ }
39
+ }, {
40
+ description: "Using the column structure outlined above, along with the use of the `useEditableCell` hook (previously named `useInlineEdit` in v1), the `Datagrid` will support inline editing. See example below:",
41
+ source: {
42
+ code: "\nimport { Datagrid, useDatagrid, useEditableCell } from '@carbon/ibm-products';\nconst App = () => {\n const [data, setData] = useState(makeData(10));\n const columns = React.useMemo(() => getInlineEditColumns(), []); // These columns follow the inline edit column configuration detailed above\n const datagridState = useDatagrid(\n {\n columns,\n data,\n onDataUpdate: setData,\n },\n useEditableCell\n );\n return <Datagrid datagridState={datagridState} />;\n};\n "
43
+ },
44
+ story: _EditableCell.EditableCellUsageStory
45
+ }, {
46
+ title: 'Using deprecated useInlineEdit hook',
47
+ description: "At this time, it is possible to still use the deprecated `useInlineEdit` hook but requires setting a feature flag. See example below:",
48
+ source: {
49
+ code: "\nimport {\n Datagrid,\n useDatagrid,\n useInlineEdit,\n pkg,\n} from '@carbon/ibm-products';\n\nconst MyInlineEditDatagrid = () => {\n pkg.feature['Datagrid.useInlineEdit'] = true;\n const [data, setData] = useState(gridData);\n const datagridState = useDatagrid(\n {\n columns,\n data,\n onDataUpdate: setData,\n },\n useInlineEdit\n );\n return <Datagrid datagridState={datagridState} />;\n};\n "
50
+ },
51
+ story: _EditableCell.InlineEditUsageStory
52
+ }]
53
+ });
54
+ };
55
+ exports.DocsPage = DocsPage;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.DocsPage = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _StoryDocsPage = require("../../../../global/js/utils/StoryDocsPage");
10
+ var DocsPage = function DocsPage() {
11
+ return /*#__PURE__*/_react.default.createElement(_StoryDocsPage.StoryDocsPage, {
12
+ blocks: [{
13
+ description: "The `Datagrid` supports expandable rows with the use of the `useExpandedRow` hook.",
14
+ source: {
15
+ language: 'jsx',
16
+ code: "\nimport { Datagrid, useDatagrid, useExpandedRow } from '@carbon/ibm-products';\n\nconst App = () => {\n const columns = React.useMemo(() => defaultHeader, []); // These are the columns that will be used by the datagrid\n const [data] = useState(makeData(10)); // This is the data that will be rendered by the datagrid\n\n const expansionRenderer = ({ row }) => {\n return <div>Content for row index: {row.id}</div>;\n };\n\n const datagridState = useDatagrid(\n {\n columns,\n data,\n ExpandedRowContentComponent: expansionRenderer,\n },\n useExpandedRow\n );\n\n return <Datagrid datagridState={datagridState} />;\n};\n "
17
+ }
18
+ }]
19
+ });
20
+ };
21
+ exports.DocsPage = DocsPage;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.DocsPage = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _StoryDocsPage = require("../../../../global/js/utils/StoryDocsPage");
10
+ var DocsPage = function DocsPage() {
11
+ return /*#__PURE__*/_react.default.createElement(_StoryDocsPage.StoryDocsPage, {
12
+ blocks: [{
13
+ title: 'Filtering',
14
+ description: "Table filtering allows a user to add or remove data items from a data table by selecting or clearing predefined attributes. Filters can help a user find something they're looking for, view available options within a certain set of criteria, and decide between many options. These guidelines are an extension of [Carbon's filter documentation](https://carbondesignsystem.com/patterns/filtering/).\n "
15
+ }, {
16
+ description: "Filtering results in a table is a different type of action from searching. While both actions can help the user narrow results down, searching is meant to help the user find a specific result, whereas filtering allows users to trim results according to its attributes."
17
+ }, {
18
+ description: "Applied filters can affect both the data that is visible in the table and also data that might not be displayed in the columns available in the table. Filter options can be displayed in many form components, including dropdowns, text inputs, checkboxes, radio buttons, and date range pickers."
19
+ }, {
20
+ description: "[Check out the Guidance here.](https://pages.github.ibm.com/cdai-design/pal/components/data-table/filters/)"
21
+ }, {
22
+ subTitle: 'Preparing your column headers'
23
+ }, {
24
+ description: 'To utilize filtering, you have to add some extra properties into your headers that are going to be filtered.'
25
+ }, {
26
+ description: "Two things you need to do is:\n- Specify a `filter` to use (unless it's text match which is default)\n- (Optional) Render the component with the `Cell` property to display the right information. Use this if the data you send into the table isn't how you want to display it, for example like Dates. See the example for `passwordStrength` below.\n "
27
+ }, {
28
+ description: "For example; here we are specifying that the `joined` header column should be filtered using a `filter: 'date'`, and render the cell using it's value and converting it to string. (Since the value of joined is a date object, react isn't going to allow you to render it as jsx so we have to convert it to string)",
29
+ source: {
30
+ code: "\n{\n Header: 'Joined',\n accessor: 'joined',\n filter: 'date',\n Cell: ({ cell: { value } }) => <span>{value.toLocaleDateString()}</span>,\n},\n "
31
+ }
32
+ }, {
33
+ description: "The different types of filters are:\n- text (default)\n- date\n- number\n- checkbox\n- radio\n- dropdown\n ",
34
+ source: {
35
+ code: "\nconst columns = [\n {\n Header: 'Row Index',\n accessor: (row, i) => i,\n sticky: 'left',\n id: 'rowIndex', // id is required when accessor is a function.\n },\n {\n Header: 'First Name',\n accessor: 'firstName',\n },\n {\n Header: 'Last Name',\n accessor: 'lastName',\n },\n {\n Header: 'Age',\n accessor: 'age',\n width: 50,\n },\n {\n Header: 'Visits',\n accessor: 'visits',\n filter: 'number',\n width: 60,\n },\n {\n Header: 'Status',\n accessor: 'status',\n filter: 'dropdown',\n },\n // Shows the date filter example\n {\n Header: 'Joined',\n accessor: 'joined',\n filter: 'date',\n Cell: ({ cell: { value } }) => <span>{value.toLocaleDateString()}</span>,\n },\n // Shows the checkbox filter example\n {\n Header: 'Password strength',\n accessor: 'passwordStrength',\n filter: 'checkbox',\n Cell: ({ cell: { value } }) => {\n const iconProps = {\n size: 'sm',\n theme: 'light',\n kind: value,\n iconDescription: value,\n };\n\n return (\n <span\n style={{\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n >\n <StatusIcon {...iconProps} />\n {iconProps.iconDescription}\n </span>\n );\n },\n },\n // Shows the checkbox filter example\n {\n Header: 'Role',\n accessor: 'role',\n filter: 'radio',\n },\n];\n "
36
+ }
37
+ }, {
38
+ subTitle: 'Store you data into state, this can also come from an API',
39
+ source: {
40
+ code: "\nconst [data] = useState([\n {\n activeSince: new Date('09/26/81'),\n age: 41,\n firstName: 'Joel',\n lastName: 'Miller',\n passwordStrength: 'normal',\n role: 'developer',\n visits: '81',\n },\n {\n activeSince: new Date('08/30/97'),\n age: 19,\n firstName: 'Ellie',\n lastName: 'N/A',\n passwordStrength: 'critical',\n role: 'designer',\n visits: '7',\n },\n {\n activeSince: new Date('01/26/03'),\n age: 39,\n firstName: 'Tommy',\n lastName: 'Miller',\n passwordStrength: 'minor-warning',\n role: 'researcher',\n visits: '25',\n },\n]);\n "
41
+ }
42
+ }, {
43
+ subTitle: 'Create your filters for flyout variant',
44
+ description: "To add filters to the flyout, you have to pass in an array of filters. These filters will be converted to it's respective component. Each filters has 3 important props, `type`, `column`, `props`.\n- `type`: the type of filter (this should be the same `filter` property in the headers)\n- `column`: the column that it should be filtered on\n- `props`: the props for the components needed to render the filter.\n\nPlease refer to all the available filters that you can use below.\n ",
45
+ source: {
46
+ code: "\nconst filters = [\n {\n type: 'date',\n column: 'joined',\n props: {\n DatePicker: {\n datePickerType: 'range',\n // Add any other Carbon DatePicker props here\n },\n DatePickerInput: {\n start: {\n id: 'date-picker-input-id-start',\n placeholder: 'mm/dd/yyyy',\n labelText: 'Joined start date',\n // Add any other Carbon DatePickerInput props here\n },\n end: {\n id: 'date-picker-input-id-end',\n placeholder: 'mm/dd/yyyy',\n labelText: 'Joined end date',\n // Add any other Carbon DatePickerInput props here\n },\n },\n },\n },\n {\n type: 'number',\n column: 'visits',\n props: {\n NumberInput: {\n min: 0,\n id: 'visits-number-input',\n invalidText: 'A valid value is required',\n label: 'Visits',\n placeholder: 'Type a number amount of visits',\n // Add any other Carbon NumberInput props here\n },\n },\n },\n {\n type: 'checkbox',\n column: 'passwordStrength',\n props: {\n FormGroup: {\n legendText: 'Password strength',\n // Add any other Carbon FormGroup props here\n },\n Checkbox: [\n {\n id: 'normal',\n labelText: 'Normal',\n value: 'normal',\n // Add any other Carbon Checkbox props here\n },\n {\n id: 'minor-warning',\n labelText: 'Minor warning',\n value: 'minor-warning',\n // Add any other Carbon Checkbox props here\n },\n {\n id: 'critical',\n labelText: 'Critical',\n value: 'critical',\n // Add any other Carbon Checkbox props here\n },\n ],\n },\n },\n {\n type: 'radio',\n column: 'role',\n props: {\n FormGroup: {\n legendText: 'Role',\n // Add any other Carbon FormGroup props here\n },\n RadioButtonGroup: {\n orientation: 'vertical',\n legend: 'Role legend',\n name: 'role-radio-button-group',\n // Add any other Carbon RadioButtonGroup props here\n },\n RadioButton: [\n {\n id: 'developer',\n labelText: 'Developer',\n value: 'developer',\n // Add any other Carbon RadioButton props here\n },\n {\n id: 'designer',\n labelText: 'Designer',\n value: 'designer',\n // Add any other Carbon RadioButton props here\n },\n {\n id: 'researcher',\n labelText: 'Researcher',\n value: 'researcher',\n // Add any other Carbon RadioButton props here\n },\n ],\n },\n },\n {\n type: 'dropdown',\n column: 'status',\n props: {\n Dropdown: {\n id: 'marital-status-dropdown',\n ariaLabel: 'Marital status dropdown',\n items: ['relationship', 'complicated', 'single'],\n label: 'Marital status',\n titleText: 'Marital status',\n // Add any other Carbon Dropdown props here\n },\n },\n },\n];\n "
47
+ }
48
+ }, {
49
+ subTitle: 'Create your filters for panel variant',
50
+ description: 'Filter panel coming soon.'
51
+ }, {
52
+ subTitle: 'Putting it all together',
53
+ source: {
54
+ code: "\nimport { Datagrid, useDatagrid, useFiltering } from '@carbon/ibm-products';\n\nconst App = () => {\n const columns = [...];\n const [data] = useState([...]);\n const filters = [...];\n\n\n const datagridState = useDatagrid(\n {\n columns,\n data,\n filterProps: {\n variation: 'flyout', // default\n updateMethod: 'batch', // default\n primaryActionLabel: 'Apply', // default\n secondaryActionLabel: 'Cancel', // default\n flyoutIconDescription: 'Open filters', // default\n shouldClickOutsideToClose: false, // default\n filters,\n },\n DatagridActions,\n batchActions: true,\n toolbarBatchActions: getBatchActions(),\n },\n useFiltering\n );\n\n return <Datagrid datagridState={datagridState} />;\n};\n "
55
+ }
56
+ }, {
57
+ subTitle: "`filterProps` types",
58
+ source: {
59
+ language: 'json',
60
+ code: "\nfilterProps: {\n /** The variation of filtering */\n variation: 'flyout'|'panel',\n /** The update method in which to filter, instant automatically\n applies the filters, batch the user has to click apply */\n updateMethod: 'batch'|'instant',\n /** Text for primary action button, default is 'Apply' */\n primaryActionLabel: string,\n /** Text for secondary action button, default is 'Cancel' */\n secondaryActionLabel: string,\n /** Text for flyout icon description */\n flyoutIconDescription: string,\n /** Array of objects to render filters in flyout */\n filters: object[]\n}\n "
61
+ }
62
+ }]
63
+ });
64
+ };
65
+ exports.DocsPage = DocsPage;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.DocsPage = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _StoryDocsPage = require("../../../../global/js/utils/StoryDocsPage");
10
+ var DocsPage = function DocsPage() {
11
+ return /*#__PURE__*/_react.default.createElement(_StoryDocsPage.StoryDocsPage, {
12
+ blocks: [{
13
+ title: 'Actions column',
14
+ description: "This will add row actions (if more than two actions are provided an OverflowMenu component will be used) to the cells on the column marked with `isAction: true`. Each action button callback will include the actionId and the row object.\n- Include useActionsColumn hook\n- Add `isAction = true` to the column object in which you which to add the overflow menu actions\n- 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 ",
15
+ source: {
16
+ code: "\nconst columns = [\n // other columns\n {\n Header: '',\n accessor: 'actions',\n isAction: true,\n },\n];\nconst onActionClick = (actionId, row, event) => {};\nconst 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\nreturn <Datagrid datagridState={datagridState} />;"
17
+ }
18
+ }]
19
+ });
20
+ };
21
+ exports.DocsPage = DocsPage;
@@ -134,7 +134,7 @@ var DatagridActions = function DatagridActions(datagridState) {
134
134
  hasDivider: true,
135
135
  requireTitle: true
136
136
  }))) : !mobileToolbar ? /*#__PURE__*/_react2.default.createElement(_react.TableToolbarContent, null, renderFilterPanelButton(), /*#__PURE__*/_react2.default.createElement(_react.TableToolbarSearch, {
137
- size: "xl",
137
+ size: "lg",
138
138
  id: "columnSearch",
139
139
  persistent: true,
140
140
  placeHolderText: searchForAColumn,
@@ -52,6 +52,10 @@ var ARG_TYPES = {
52
52
  control: 'select',
53
53
  options: ['sm', 'lg']
54
54
  },
55
+ isFetching: {
56
+ control: 'radio',
57
+ options: [true, false]
58
+ },
55
59
  useDenseHeader: {
56
60
  control: {
57
61
  type: 'radio'
@@ -27,13 +27,16 @@ var FilterSummary = /*#__PURE__*/_react2.default.forwardRef(function (_ref, ref)
27
27
  _ref$clearFilters = _ref.clearFilters,
28
28
  clearFilters = _ref$clearFilters === void 0 ? function () {} : _ref$clearFilters,
29
29
  _ref$filters = _ref.filters,
30
- filters = _ref$filters === void 0 ? [] : _ref$filters;
30
+ filters = _ref$filters === void 0 ? [] : _ref$filters,
31
+ _ref$renderLabel = _ref.renderLabel,
32
+ renderLabel = _ref$renderLabel === void 0 ? null : _ref$renderLabel;
31
33
  var tagFilters = filters.map(function (_ref2) {
34
+ var _renderLabel;
32
35
  var key = _ref2.key,
33
36
  value = _ref2.value;
34
37
  return {
35
38
  type: 'gray',
36
- label: "".concat(key, ": ").concat(value)
39
+ label: (_renderLabel = renderLabel === null || renderLabel === void 0 ? void 0 : renderLabel(key, value)) !== null && _renderLabel !== void 0 ? _renderLabel : "".concat(key, ": ").concat(value)
37
40
  };
38
41
  });
39
42
  return /*#__PURE__*/_react2.default.createElement("div", {
@@ -57,7 +60,8 @@ FilterSummary.propTypes = {
57
60
  className: _propTypes.default.string,
58
61
  clearFilters: _propTypes.default.func.isRequired,
59
62
  clearFiltersText: _propTypes.default.string,
60
- filters: _propTypes.default.arrayOf(_propTypes.default.object).isRequired
63
+ filters: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
64
+ renderLabel: _propTypes.default.func
61
65
  };
62
66
  var _default = FilterSummary;
63
67
  exports.default = _default;
@@ -233,7 +233,14 @@ var OptionsTile = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
233
233
  })), isExpandable ? /*#__PURE__*/_react.default.createElement("details", {
234
234
  open: isOpen,
235
235
  ref: detailsRef
236
- }, /*#__PURE__*/_react.default.createElement("summary", {
236
+ },
237
+ /*#__PURE__*/
238
+ /* summary should not be considered non-interactive
239
+ * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/656
240
+ * https://github.com/A11yance/axobject-query/issues/319
241
+ */
242
+ /* eslint-disable jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */
243
+ _react.default.createElement("summary", {
237
244
  className: "".concat(blockClass, "__header"),
238
245
  onClick: toggle
239
246
  }, /*#__PURE__*/_react.default.createElement(_icons.ChevronDown, {
@@ -30,7 +30,7 @@ var CustomBlocks = function CustomBlocks(_ref) {
30
30
  key: "block-index--".concat(index)
31
31
  }, block.title && /*#__PURE__*/_react.default.createElement("h3", {
32
32
  id: (0, _changeCase.paramCase)(block.title)
33
- }, block.title), block.subTitle && /*#__PURE__*/_react.default.createElement("h4", null, block.subTitle), block.description && typeof block.description === 'string' ? /*#__PURE__*/_react.default.createElement(_blocks.Description, null, block.description) : block.description, block.story && /*#__PURE__*/_react.default.createElement(_blocks.Canvas, {
33
+ }, block.title), block.subTitle && /*#__PURE__*/_react.default.createElement("h4", null, block.subTitle), block.image, block.description && typeof block.description === 'string' ? /*#__PURE__*/_react.default.createElement(_blocks.Description, null, block.description) : block.description, block.story && /*#__PURE__*/_react.default.createElement(_blocks.Canvas, {
34
34
  of: block.story
35
35
  }), block.source && /*#__PURE__*/_react.default.createElement(_blocks.Source, source));
36
36
  });
@@ -201,6 +201,10 @@ StoryDocsPage.propTypes = {
201
201
  * Optional description, strings treated as markdown.
202
202
  */
203
203
  description: _propTypes.default.node,
204
+ /**
205
+ * Optional block image
206
+ */
207
+ image: _propTypes.default.node,
204
208
  /**
205
209
  * Story imported from story file
206
210
  */
@@ -210,7 +214,7 @@ StoryDocsPage.propTypes = {
210
214
  * default language `jsx`
211
215
  */
212
216
  source: _propTypes.default.shape({
213
- language: _propTypes.default.oneOf('javascript', 'css', 'jsx'),
217
+ language: _propTypes.default.oneOf('javascript', 'css', 'jsx', 'json'),
214
218
  code: _propTypes.default.string
215
219
  })
216
220
  })),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/ibm-products",
3
3
  "description": "Carbon for IBM Products",
4
- "version": "2.3.2",
4
+ "version": "2.4.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -54,27 +54,27 @@
54
54
  "upgrade-dependencies": "npm-check-updates -u --dep dev,peer,prod --color --reject '/(carbon|^react$|^react-dom$|^chalk$|^react-dnd|^namor)/'"
55
55
  },
56
56
  "devDependencies": {
57
- "@babel/cli": "^7.21.5",
58
- "@babel/core": "^7.22.1",
59
- "babel-preset-ibm-cloud-cognitive": "^0.14.36",
57
+ "@babel/cli": "^7.22.5",
58
+ "@babel/core": "^7.22.5",
59
+ "babel-preset-ibm-cloud-cognitive": "^0.14.37",
60
60
  "chalk": "^4.1.2",
61
61
  "change-case": "^4.1.2",
62
62
  "copyfiles": "^2.4.1",
63
63
  "cross-env": "^7.0.3",
64
64
  "fs-extra": "^11.1.1",
65
- "glob": "^10.2.6",
65
+ "glob": "^10.3.1",
66
66
  "jest": "^29.5.0",
67
- "jest-config-ibm-cloud-cognitive": "^0.24.23",
67
+ "jest-config-ibm-cloud-cognitive": "^0.24.24",
68
68
  "jest-environment-jsdom": "^29.5.0",
69
69
  "namor": "^1.1.2",
70
- "npm-check-updates": "^16.10.12",
70
+ "npm-check-updates": "^16.10.13",
71
71
  "npm-run-all": "^4.1.5",
72
72
  "rimraf": "^5.0.1",
73
- "sass": "^1.62.1",
73
+ "sass": "^1.63.6",
74
74
  "yargs": "^17.7.2"
75
75
  },
76
76
  "dependencies": {
77
- "@babel/runtime": "^7.22.3",
77
+ "@babel/runtime": "^7.22.5",
78
78
  "@carbon/telemetry": "^0.1.0",
79
79
  "framer-motion": "^6.5.1 < 7",
80
80
  "immutability-helper": "^3.1.1",
@@ -85,14 +85,14 @@
85
85
  "react-window": "^1.8.9"
86
86
  },
87
87
  "peerDependencies": {
88
- "@carbon/grid": "^11.15.0",
89
- "@carbon/layout": "^11.15.0",
90
- "@carbon/motion": "^11.12.0",
91
- "@carbon/react": "^1.31.3",
92
- "@carbon/themes": "^11.20.0",
93
- "@carbon/type": "^11.19.0",
88
+ "@carbon/grid": "^11.16.1",
89
+ "@carbon/layout": "^11.16.1",
90
+ "@carbon/motion": "^11.13.1",
91
+ "@carbon/react": "^1.33.2",
92
+ "@carbon/themes": "^11.21.1",
93
+ "@carbon/type": "^11.20.1",
94
94
  "react": "^16.8.6 || ^17.0.1",
95
95
  "react-dom": "^16.8.6 || ^17.0.1"
96
96
  },
97
- "gitHead": "d10acc630bdeb946d794ea2430d5df1ebf650c14"
97
+ "gitHead": "ce43460f28f908aeb8ec4bfb2c501dd457d11a58"
98
98
  }
@@ -7,6 +7,7 @@
7
7
 
8
8
  // Standard imports.
9
9
  @use '@carbon/styles/scss/spacing' as *;
10
+ @use '@carbon/styles/scss/theme' as *;
10
11
  @use '../../global/styles/project-settings' as c4p-settings;
11
12
  @use '../../global/styles/mixins';
12
13
 
@@ -33,19 +34,25 @@ $block-class: #{c4p-settings.$pkg-prefix}--datagrid;
33
34
  :global(.#{c4p-settings.$carbon-prefix}--checkbox) {
34
35
  display: none;
35
36
  }
37
+ }
36
38
 
37
- .#{c4p-settings.$carbon-prefix}--overflow-menu-options
38
- > .#{c4p-settings.$pkg-prefix}--datagrid__row-size-dropdown {
39
- left: $spacing-01;
40
- width: 112px;
41
- }
39
+ .#{$block-class}
40
+ .#{c4p-settings.$pkg-prefix}--datagrid__row-size-options-container
41
+ .#{c4p-settings.$carbon-prefix}--popover-container
42
+ .#{c4p-settings.$carbon-prefix}--btn--icon-only {
43
+ display: flex;
44
+ width: $spacing-09;
45
+ height: $spacing-09;
46
+ align-items: center;
47
+ justify-content: center;
48
+ padding-top: 0;
42
49
  }
43
50
 
44
- .#{$block-class}__datagridWrap
45
- .#{c4p-settings.$carbon-prefix}--overflow-menu-options
46
- > .#{c4p-settings.$pkg-prefix}--datagrid__row-size-dropdown {
47
- left: $spacing-01;
48
- width: 112px;
51
+ .#{$block-class}
52
+ .#{c4p-settings.$pkg-prefix}--datagrid__row-size-options-container
53
+ .#{c4p-settings.$pkg-prefix}--datagrid__row-size-dropdown {
54
+ padding: $spacing-05;
55
+ background-color: $layer;
49
56
  }
50
57
 
51
58
  .#{$block-class}__datagridWrap-simple {
@@ -4,6 +4,8 @@
4
4
  // This source code is licensed under the Apache-2.0 license found in the
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
+ @use '../../global/styles/display-box' as *;
8
+
7
9
  #root {
8
10
  width: 100%;
9
11
  }