@carbon/ibm-products 1.13.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/components/Datagrid/styles/addons/CustomizeColumnsModal.css +47 -0
- package/css/components/Datagrid/styles/addons/CustomizeColumnsModal.css.map +1 -0
- package/css/components/Datagrid/styles/addons/RowSizeDropdown.css +20 -0
- package/css/components/Datagrid/styles/addons/RowSizeDropdown.css.map +1 -0
- package/css/components/Datagrid/styles/datagrid.css +268 -0
- package/css/components/Datagrid/styles/datagrid.css.map +1 -0
- package/css/components/Datagrid/styles/index.css +513 -0
- package/css/components/Datagrid/styles/index.css.map +1 -0
- package/css/components/Datagrid/styles/useActionsColumn.css +23 -0
- package/css/components/Datagrid/styles/useActionsColumn.css.map +1 -0
- package/css/components/Datagrid/styles/useColumnRightAlign.css +28 -0
- package/css/components/Datagrid/styles/useColumnRightAlign.css.map +1 -0
- package/css/components/Datagrid/styles/useNestedRows.css +15 -0
- package/css/components/Datagrid/styles/useNestedRows.css.map +1 -0
- package/css/components/Datagrid/styles/useNestedTable.css +25 -0
- package/css/components/Datagrid/styles/useNestedTable.css.map +1 -0
- package/css/components/Datagrid/styles/useSelectAllToggle.css +28 -0
- package/css/components/Datagrid/styles/useSelectAllToggle.css.map +1 -0
- package/css/components/Datagrid/styles/useSortableColumns.css +50 -0
- package/css/components/Datagrid/styles/useSortableColumns.css.map +1 -0
- package/css/components/Datagrid/styles/useStickyColumn.css +35 -0
- package/css/components/Datagrid/styles/useStickyColumn.css.map +1 -0
- package/css/index-full-carbon.css +611 -10
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +3 -3
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +7 -4
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +2 -2
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +611 -10
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +3 -3
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +611 -10
- package/css/index.css.map +1 -1
- package/css/index.min.css +3 -3
- package/css/index.min.css.map +1 -1
- package/es/components/AddSelect/AddSelect.js +106 -43
- package/es/components/AddSelect/AddSelectFilter.js +172 -0
- package/es/components/AddSelect/add-select-utils.js +30 -0
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +255 -175
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +78 -17
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +65 -20
- package/es/components/DataSpreadsheet/hooks/index.js +11 -0
- package/es/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +139 -0
- package/es/components/DataSpreadsheet/hooks/useResetSpreadsheetFocus.js +2 -4
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetEdit.js +68 -0
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetOutsideClick.js +1 -3
- package/es/components/DataSpreadsheet/utils/createCellSelectionArea.js +20 -8
- package/es/components/DataSpreadsheet/utils/generateData.js +17 -9
- package/es/components/DataSpreadsheet/utils/getSelectionAreaPoints.js +18 -0
- package/es/components/DataSpreadsheet/utils/getSpreadsheetWidth.js +30 -0
- package/es/components/DataSpreadsheet/utils/handleActiveCellInSelectionEnter.js +121 -0
- package/es/components/DataSpreadsheet/utils/handleActiveCellInSelectionTab.js +108 -0
- package/es/components/DataSpreadsheet/utils/handleEditSubmit.js +87 -0
- package/es/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +42 -8
- package/es/components/DataSpreadsheet/utils/handleMultipleKeys.js +225 -13
- package/es/components/DataSpreadsheet/utils/selectAllCells.js +53 -0
- package/es/components/Datagrid/Datagrid/Datagrid.js +70 -0
- package/es/components/Datagrid/Datagrid/DatagridBody.js +36 -0
- package/es/components/Datagrid/Datagrid/DatagridEmptyBody.js +19 -0
- package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +26 -0
- package/es/components/Datagrid/Datagrid/DatagridHead.js +31 -0
- package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +57 -0
- package/es/components/Datagrid/Datagrid/DatagridRefBody.js +37 -0
- package/es/components/Datagrid/Datagrid/DatagridRow.js +60 -0
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +50 -0
- package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +122 -0
- package/es/components/Datagrid/Datagrid/DatagridSimpleBody.js +36 -0
- package/es/components/Datagrid/Datagrid/DatagridToolbar.js +22 -0
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +87 -0
- package/es/components/Datagrid/Datagrid/DraggableElement.js +188 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +78 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +51 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +140 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +157 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +62 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/common.js +13 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/index.js +9 -0
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +62 -0
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +139 -0
- package/es/components/Datagrid/Datagrid/addons/RowSize/index.js +8 -0
- package/es/components/Datagrid/Datagrid/index.js +8 -0
- package/es/components/Datagrid/Datagrid.stories/CustomizeColumnStory.js +6 -0
- package/es/components/Datagrid/Datagrid.stories/LeftPanelStory.js +6 -0
- package/es/components/Datagrid/Datagrid.stories/RowSizeDropdownStory.js +6 -0
- package/es/components/Datagrid/Datagrid.stories/SelectAllWithToggleStory.js +6 -0
- package/es/components/Datagrid/Datagrid.stories/StickyActionsColumnStory.js +92 -0
- package/es/components/Datagrid/Datagrid.stories/common.js +199 -0
- package/es/components/Datagrid/Datagrid.stories/index.js +5 -0
- package/es/components/Datagrid/common-column-ids.js +8 -0
- package/es/components/Datagrid/index.js +22 -0
- package/es/components/Datagrid/useActionsColumn.js +86 -0
- package/es/components/Datagrid/useColumnRightAlign.js +52 -0
- package/es/components/Datagrid/useCustomizeColumns.js +45 -0
- package/es/components/Datagrid/useDatagrid.js +44 -0
- package/es/components/Datagrid/useDefaultStringRenderer.js +48 -0
- package/es/components/Datagrid/useDisableSelectRows.js +84 -0
- package/es/components/Datagrid/useExpandedRow.js +52 -0
- package/es/components/Datagrid/useFlexResize.js +51 -0
- package/es/components/Datagrid/useFloatingScroll.js +88 -0
- package/es/components/Datagrid/useInfiniteScroll.js +54 -0
- package/es/components/Datagrid/useNestedRows.js +53 -0
- package/es/components/Datagrid/useOnRowClick.js +37 -0
- package/es/components/Datagrid/useParentDimensions.js +65 -0
- package/es/components/Datagrid/useResizeTable.js +40 -0
- package/es/components/Datagrid/useRowExpander.js +34 -0
- package/es/components/Datagrid/useRowIsMouseOver.js +61 -0
- package/es/components/Datagrid/useRowRenderer.js +30 -0
- package/es/components/Datagrid/useRowSize.js +56 -0
- package/es/components/Datagrid/useSelectAllToggle.js +74 -0
- package/es/components/Datagrid/useSelectRows.js +107 -0
- package/es/components/Datagrid/useSkeletonRows.js +32 -0
- package/es/components/Datagrid/useSortableColumns.js +110 -0
- package/es/components/Datagrid/useStickyColumn.js +183 -0
- package/es/components/MultiAddSelect/MultiAddSelect.js +150 -3
- package/es/components/PageHeader/PageHeader.js +3 -1
- package/es/components/SingleAddSelect/SingleAddSelect.js +90 -4
- package/es/components/TagSet/TagSet.js +13 -6
- package/es/components/Tearsheet/TearsheetShell.js +34 -10
- package/es/components/index.js +2 -1
- package/es/global/js/package-settings.js +4 -2
- package/lib/components/AddSelect/AddSelect.js +105 -41
- package/lib/components/AddSelect/AddSelectFilter.js +190 -0
- package/lib/components/AddSelect/add-select-utils.js +35 -2
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +261 -177
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +79 -23
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +67 -21
- package/lib/components/DataSpreadsheet/hooks/index.js +45 -0
- package/lib/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +151 -0
- package/lib/components/DataSpreadsheet/hooks/useResetSpreadsheetFocus.js +2 -4
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetEdit.js +79 -0
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetOutsideClick.js +1 -3
- package/lib/components/DataSpreadsheet/utils/createCellSelectionArea.js +21 -8
- package/lib/components/DataSpreadsheet/utils/generateData.js +17 -9
- package/lib/components/DataSpreadsheet/utils/getSelectionAreaPoints.js +27 -0
- package/lib/components/DataSpreadsheet/utils/getSpreadsheetWidth.js +40 -0
- package/lib/components/DataSpreadsheet/utils/handleActiveCellInSelectionEnter.js +127 -0
- package/lib/components/DataSpreadsheet/utils/handleActiveCellInSelectionTab.js +118 -0
- package/lib/components/DataSpreadsheet/utils/handleEditSubmit.js +94 -0
- package/lib/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +44 -8
- package/lib/components/DataSpreadsheet/utils/handleMultipleKeys.js +235 -20
- package/lib/components/DataSpreadsheet/utils/selectAllCells.js +60 -0
- package/lib/components/Datagrid/Datagrid/Datagrid.js +86 -0
- package/lib/components/Datagrid/Datagrid/DatagridBody.js +50 -0
- package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.js +31 -0
- package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +38 -0
- package/lib/components/Datagrid/Datagrid/DatagridHead.js +43 -0
- package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +73 -0
- package/lib/components/Datagrid/Datagrid/DatagridRefBody.js +44 -0
- package/lib/components/Datagrid/Datagrid/DatagridRow.js +68 -0
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +55 -0
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +139 -0
- package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.js +44 -0
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +35 -0
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +101 -0
- package/lib/components/Datagrid/Datagrid/DraggableElement.js +210 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +92 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +65 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +166 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +173 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +73 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/common.js +25 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/index.js +23 -0
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +80 -0
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +160 -0
- package/lib/components/Datagrid/Datagrid/addons/RowSize/index.js +15 -0
- package/lib/components/Datagrid/Datagrid/index.js +15 -0
- package/lib/components/Datagrid/Datagrid.stories/CustomizeColumnStory.js +13 -0
- package/lib/components/Datagrid/Datagrid.stories/LeftPanelStory.js +13 -0
- package/lib/components/Datagrid/Datagrid.stories/RowSizeDropdownStory.js +13 -0
- package/lib/components/Datagrid/Datagrid.stories/SelectAllWithToggleStory.js +13 -0
- package/lib/components/Datagrid/Datagrid.stories/StickyActionsColumnStory.js +112 -0
- package/lib/components/Datagrid/Datagrid.stories/common.js +215 -0
- package/lib/components/Datagrid/Datagrid.stories/index.js +47 -0
- package/lib/components/Datagrid/common-column-ids.js +16 -0
- package/lib/components/Datagrid/index.js +127 -0
- package/lib/components/Datagrid/useActionsColumn.js +94 -0
- package/lib/components/Datagrid/useColumnRightAlign.js +59 -0
- package/lib/components/Datagrid/useCustomizeColumns.js +55 -0
- package/lib/components/Datagrid/useDatagrid.js +58 -0
- package/lib/components/Datagrid/useDefaultStringRenderer.js +54 -0
- package/lib/components/Datagrid/useDisableSelectRows.js +92 -0
- package/lib/components/Datagrid/useExpandedRow.js +58 -0
- package/lib/components/Datagrid/useFlexResize.js +61 -0
- package/lib/components/Datagrid/useFloatingScroll.js +101 -0
- package/lib/components/Datagrid/useInfiniteScroll.js +67 -0
- package/lib/components/Datagrid/useNestedRows.js +65 -0
- package/lib/components/Datagrid/useOnRowClick.js +45 -0
- package/lib/components/Datagrid/useParentDimensions.js +75 -0
- package/lib/components/Datagrid/useResizeTable.js +48 -0
- package/lib/components/Datagrid/useRowExpander.js +45 -0
- package/lib/components/Datagrid/useRowIsMouseOver.js +66 -0
- package/lib/components/Datagrid/useRowRenderer.js +40 -0
- package/lib/components/Datagrid/useRowSize.js +67 -0
- package/lib/components/Datagrid/useSelectAllToggle.js +88 -0
- package/lib/components/Datagrid/useSelectRows.js +119 -0
- package/lib/components/Datagrid/useSkeletonRows.js +42 -0
- package/lib/components/Datagrid/useSortableColumns.js +117 -0
- package/lib/components/Datagrid/useStickyColumn.js +190 -0
- package/lib/components/MultiAddSelect/MultiAddSelect.js +150 -2
- package/lib/components/PageHeader/PageHeader.js +3 -1
- package/lib/components/SingleAddSelect/SingleAddSelect.js +91 -3
- package/lib/components/TagSet/TagSet.js +13 -6
- package/lib/components/Tearsheet/TearsheetShell.js +36 -10
- package/lib/components/index.js +9 -1
- package/lib/global/js/package-settings.js +4 -2
- package/package.json +16 -12
- package/scss/components/AboutModal/_about-modal.scss +4 -0
- package/scss/components/AddSelect/_add-select.scss +46 -2
- package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +41 -4
- package/scss/components/Datagrid/_datagrid.scss +66 -0
- package/scss/components/Datagrid/_index.scss +8 -0
- package/scss/components/Datagrid/_storybook-styles.scss +26 -0
- package/scss/components/Datagrid/styles/_variables.scss +9 -0
- package/scss/components/Datagrid/styles/addons/CustomizeColumnsModal.scss +48 -0
- package/scss/components/Datagrid/styles/addons/RowSizeDropdown.scss +23 -0
- package/scss/components/Datagrid/styles/datagrid.scss +326 -0
- package/scss/components/Datagrid/styles/index.scss +17 -0
- package/scss/components/Datagrid/styles/useActionsColumn.scss +24 -0
- package/scss/components/Datagrid/styles/useColumnRightAlign.scss +29 -0
- package/scss/components/Datagrid/styles/useNestedRows.scss +17 -0
- package/scss/components/Datagrid/styles/useNestedTable.scss +28 -0
- package/scss/components/Datagrid/styles/useSelectAllToggle.scss +28 -0
- package/scss/components/Datagrid/styles/useSortableColumns.scss +55 -0
- package/scss/components/Datagrid/styles/useStickyColumn.scss +38 -0
- package/scss/components/ExportModal/_export-modal.scss +0 -4
- package/scss/components/Tearsheet/_tearsheet.scss +4 -0
- package/scss/components/_index.scss +1 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { forwardRef } from 'react';
|
|
3
|
-
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
4
|
import { AddSelect } from '../AddSelect';
|
|
5
5
|
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
|
6
6
|
import { pkg } from '../../settings';
|
|
@@ -12,5 +12,152 @@ export var MultiAddSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
12
12
|
}, getDevtoolsProps(componentName)));
|
|
13
13
|
});
|
|
14
14
|
MultiAddSelect = pkg.checkComponentEnabled(MultiAddSelect, componentName);
|
|
15
|
-
MultiAddSelect.propTypes = {
|
|
15
|
+
MultiAddSelect.propTypes = {
|
|
16
|
+
/**
|
|
17
|
+
* optional class name
|
|
18
|
+
*/
|
|
19
|
+
className: PropTypes.string,
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* placeholder for column input filter
|
|
23
|
+
*/
|
|
24
|
+
columnInputPlaceholder: PropTypes.string,
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* text description that appears under the title
|
|
28
|
+
*/
|
|
29
|
+
description: PropTypes.string,
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* options to display in the global filter box. values are generated
|
|
33
|
+
* from the id which should correlate with a specific property in an
|
|
34
|
+
* item entry
|
|
35
|
+
*/
|
|
36
|
+
globalFilters: PropTypes.arrayOf(PropTypes.shape({
|
|
37
|
+
id: PropTypes.string,
|
|
38
|
+
label: PropTypes.string
|
|
39
|
+
})),
|
|
40
|
+
globalFiltersIconDescription: PropTypes.string,
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* placeholder text for the global filter dropdown
|
|
44
|
+
*/
|
|
45
|
+
globalFiltersPlaceholderText: PropTypes.string,
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* text for the global filter primary button
|
|
49
|
+
*/
|
|
50
|
+
globalFiltersPrimaryButtonText: PropTypes.string,
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* text for the global filter secondary button
|
|
54
|
+
*/
|
|
55
|
+
globalFiltersSecondaryButtonText: PropTypes.string,
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* label for global search input
|
|
59
|
+
*/
|
|
60
|
+
globalSearchLabel: PropTypes.string,
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* placeholder for global search input
|
|
64
|
+
*/
|
|
65
|
+
globalSearchPlaceholder: PropTypes.string,
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* title that displays in the sidebar / influencer
|
|
69
|
+
*/
|
|
70
|
+
influencerTitle: PropTypes.string,
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* object that contains the item data. for more information reference the
|
|
74
|
+
* "Structuring items" section in the docs tab
|
|
75
|
+
*/
|
|
76
|
+
items: PropTypes.shape({
|
|
77
|
+
modifiers: PropTypes.shape({
|
|
78
|
+
label: PropTypes.string,
|
|
79
|
+
options: PropTypes.array
|
|
80
|
+
}),
|
|
81
|
+
sortBy: PropTypes.array,
|
|
82
|
+
filterBy: PropTypes.array,
|
|
83
|
+
entries: PropTypes.arrayOf(PropTypes.shape({
|
|
84
|
+
avatar: PropTypes.shape({
|
|
85
|
+
alt: PropTypes.string,
|
|
86
|
+
icon: PropTypes.object,
|
|
87
|
+
src: PropTypes.string
|
|
88
|
+
}),
|
|
89
|
+
children: PropTypes.object,
|
|
90
|
+
icon: PropTypes.object,
|
|
91
|
+
id: PropTypes.string.isRequired,
|
|
92
|
+
subtitle: PropTypes.string,
|
|
93
|
+
title: PropTypes.string.isRequired,
|
|
94
|
+
value: PropTypes.string.isRequired
|
|
95
|
+
}))
|
|
96
|
+
}),
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* label that display above the list of items
|
|
100
|
+
*/
|
|
101
|
+
itemsLabel: PropTypes.string,
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* text to display when no results are found from the global search
|
|
105
|
+
*/
|
|
106
|
+
noResultsDescription: PropTypes.string,
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* title to display when no results are found from the global search
|
|
110
|
+
*/
|
|
111
|
+
noResultsTitle: PropTypes.string,
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* text body that displays in the sidebar when nothing is selected
|
|
115
|
+
*/
|
|
116
|
+
noSelectionDescription: PropTypes.string,
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* title that displays in the sidebar when nothing is selected
|
|
120
|
+
*/
|
|
121
|
+
noSelectionTitle: PropTypes.string,
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* function to call when the close button clicked
|
|
125
|
+
*/
|
|
126
|
+
onClose: PropTypes.func,
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* text for close button
|
|
130
|
+
*/
|
|
131
|
+
onCloseButtonText: PropTypes.string,
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* function to call when the submit button is clicked. returns a selection
|
|
135
|
+
*/
|
|
136
|
+
onSubmit: PropTypes.func,
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* text for the submit button
|
|
140
|
+
*/
|
|
141
|
+
onSubmitButtonText: PropTypes.string,
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* specifies if the component is open or not
|
|
145
|
+
*/
|
|
146
|
+
open: PropTypes.bool,
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* description for the remove item icon
|
|
150
|
+
*/
|
|
151
|
+
removeIconDescription: PropTypes.string,
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* text that displays when displaying filtered items
|
|
155
|
+
*/
|
|
156
|
+
searchResultsLabel: PropTypes.string,
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* header text
|
|
160
|
+
*/
|
|
161
|
+
title: PropTypes.string
|
|
162
|
+
};
|
|
16
163
|
MultiAddSelect.displayName = componentName;
|
|
@@ -499,7 +499,8 @@ var TYPES = {
|
|
|
499
499
|
gray: 'Gray',
|
|
500
500
|
'cool-gray': 'Cool-Gray',
|
|
501
501
|
'warm-gray': 'Warm-Gray',
|
|
502
|
-
'high-contrast': 'High-Contrast'
|
|
502
|
+
'high-contrast': 'High-Contrast',
|
|
503
|
+
outline: 'Outline'
|
|
503
504
|
};
|
|
504
505
|
var tagTypes = Object.keys(TYPES);
|
|
505
506
|
export var deprecatedProps = {
|
|
@@ -513,6 +514,7 @@ export var deprecatedProps = {
|
|
|
513
514
|
*/
|
|
514
515
|
hasBackgroundAlways: deprecateProp(PropTypes.bool, 'Property replaced by `withoutBackground`')
|
|
515
516
|
};
|
|
517
|
+
PageHeader.tagTypes = tagTypes;
|
|
516
518
|
PageHeader.propTypes = _objectSpread({
|
|
517
519
|
/**
|
|
518
520
|
* Specifies the action bar items which are the final items in the row top of the PageHeader.
|
|
@@ -1,15 +1,101 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { forwardRef } from 'react';
|
|
3
|
-
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
4
|
import { AddSelect } from '../AddSelect';
|
|
5
5
|
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
|
6
6
|
import { pkg } from '../../settings';
|
|
7
|
+
import { prepareProps } from '../../global/js/utils/props-helper';
|
|
7
8
|
var componentName = 'SingleAddSelect';
|
|
8
9
|
export var SingleAddSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
9
|
-
|
|
10
|
+
// remove multi add select specific props
|
|
11
|
+
var validProps = prepareProps(props, ['columnInputPlaceholder', 'globalFilters', 'globalFiltersIconDescription', 'globalFiltersPlaceholderText', 'globalFiltersPrimaryButtonText', 'globalFiltersSecondaryButtonText', 'influencerTitle', 'multi', 'noSelectionDescription', 'noSelectionTitle', 'removeIconDescription']);
|
|
12
|
+
return /*#__PURE__*/React.createElement(AddSelect, _extends({}, validProps, {
|
|
10
13
|
ref: ref
|
|
11
14
|
}, getDevtoolsProps(componentName)));
|
|
12
15
|
});
|
|
13
16
|
SingleAddSelect = pkg.checkComponentEnabled(SingleAddSelect, componentName);
|
|
14
|
-
SingleAddSelect.propTypes = {
|
|
17
|
+
SingleAddSelect.propTypes = {
|
|
18
|
+
/**
|
|
19
|
+
* optional class name
|
|
20
|
+
*/
|
|
21
|
+
className: PropTypes.string,
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* text description that appears under the title
|
|
25
|
+
*/
|
|
26
|
+
description: PropTypes.string,
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* label for global search input
|
|
30
|
+
*/
|
|
31
|
+
globalSearchLabel: PropTypes.string,
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* placeholder for global search input
|
|
35
|
+
*/
|
|
36
|
+
globalSearchPlaceholder: PropTypes.string,
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* object that contains the item data. for more information reference the
|
|
40
|
+
* "Structuring items" section in the docs tab
|
|
41
|
+
*/
|
|
42
|
+
items: PropTypes.shape({
|
|
43
|
+
entries: PropTypes.arrayOf(PropTypes.shape({
|
|
44
|
+
children: PropTypes.object,
|
|
45
|
+
id: PropTypes.string.isRequired,
|
|
46
|
+
title: PropTypes.string.isRequired,
|
|
47
|
+
value: PropTypes.string.isRequired
|
|
48
|
+
}))
|
|
49
|
+
}),
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* label that display above the list of items
|
|
53
|
+
*/
|
|
54
|
+
itemsLabel: PropTypes.string,
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* text to display when no results are found from the global search
|
|
58
|
+
*/
|
|
59
|
+
noResultsDescription: PropTypes.string,
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* title to display when no results are found from the global search
|
|
63
|
+
*/
|
|
64
|
+
noResultsTitle: PropTypes.string,
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* function to call when the close button clicked
|
|
68
|
+
*/
|
|
69
|
+
onClose: PropTypes.func,
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* text for close button
|
|
73
|
+
*/
|
|
74
|
+
onCloseButtonText: PropTypes.string,
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* function to call when the submit button is clicked. returns a selection
|
|
78
|
+
*/
|
|
79
|
+
onSubmit: PropTypes.func,
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* text for the submit button
|
|
83
|
+
*/
|
|
84
|
+
onSubmitButtonText: PropTypes.string,
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* specifies if the component is open or not
|
|
88
|
+
*/
|
|
89
|
+
open: PropTypes.bool,
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* text that displays when displaying filtered items
|
|
93
|
+
*/
|
|
94
|
+
searchResultsLabel: PropTypes.string,
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* header text
|
|
98
|
+
*/
|
|
99
|
+
title: PropTypes.string
|
|
100
|
+
};
|
|
15
101
|
SingleAddSelect.displayName = componentName;
|
|
@@ -97,9 +97,13 @@ export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
97
97
|
};
|
|
98
98
|
|
|
99
99
|
useEffect(function () {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
if (allTagsModalTargetIn) {
|
|
101
|
+
setAllTagsModalTarget(allTagsModalTargetIn);
|
|
102
|
+
} else {
|
|
103
|
+
if (pkg.isFeatureEnabled('default-portal-target-body')) {
|
|
104
|
+
setAllTagsModalTarget(document.body);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
103
107
|
}, [allTagsModalTargetIn]);
|
|
104
108
|
useEffect(function () {
|
|
105
109
|
var newSizingTags = []; // create sizing tags
|
|
@@ -237,14 +241,16 @@ export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
237
241
|
}, hiddenSizingTags), /*#__PURE__*/React.createElement("div", {
|
|
238
242
|
className: "".concat(blockClass, "__tag-container"),
|
|
239
243
|
ref: displayedArea
|
|
240
|
-
}, displayedTags)), allTagsModalTarget
|
|
244
|
+
}, displayedTags)), (allTagsModalTarget ? createPortal : function (children) {
|
|
245
|
+
return children;
|
|
246
|
+
})( /*#__PURE__*/React.createElement(TagSetModal, {
|
|
241
247
|
allTags: tags,
|
|
242
248
|
open: showAllModalOpen,
|
|
243
249
|
title: allTagsModalTitle,
|
|
244
250
|
onClose: handleModalClose,
|
|
245
251
|
searchLabel: allTagsModalSearchLabel,
|
|
246
252
|
searchPlaceholder: allTagsModalSearchPlaceholderText
|
|
247
|
-
}), allTagsModalTarget)
|
|
253
|
+
}), allTagsModalTarget));
|
|
248
254
|
}); // Return a placeholder if not released and not enabled by feature flag
|
|
249
255
|
|
|
250
256
|
TagSet = pkg.checkComponentEnabled(TagSet, componentName);
|
|
@@ -269,7 +275,8 @@ var TYPES = {
|
|
|
269
275
|
gray: 'Gray',
|
|
270
276
|
'cool-gray': 'Cool-Gray',
|
|
271
277
|
'warm-gray': 'Warm-Gray',
|
|
272
|
-
'high-contrast': 'High-Contrast'
|
|
278
|
+
'high-contrast': 'High-Contrast',
|
|
279
|
+
outline: 'Outline'
|
|
273
280
|
};
|
|
274
281
|
var tagTypes = Object.keys(TYPES);
|
|
275
282
|
TagSet.types = tagTypes;
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["actions", "children", "className", "closeIconDescription", "description", "hasCloseIcon", "headerActions", "influencer", "influencerPosition", "influencerWidth", "label", "navigation", "onClose", "open", "selectorPrimaryFocus", "size", "title", "verticalPosition"];
|
|
5
|
+
var _excluded = ["actions", "children", "className", "closeIconDescription", "description", "hasCloseIcon", "headerActions", "influencer", "influencerPosition", "influencerWidth", "label", "navigation", "onClose", "open", "selectorPrimaryFocus", "size", "portalTarget", "title", "verticalPosition"];
|
|
6
6
|
|
|
7
7
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8
8
|
|
|
@@ -16,6 +16,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
16
16
|
*/
|
|
17
17
|
// Import portions of React that are needed.
|
|
18
18
|
import React, { useEffect, useState, useRef } from 'react';
|
|
19
|
+
import { createPortal } from 'react-dom';
|
|
19
20
|
import { useResizeDetector } from 'react-resize-detector'; // Other standard imports.
|
|
20
21
|
|
|
21
22
|
import PropTypes from 'prop-types';
|
|
@@ -68,10 +69,26 @@ export var TearsheetShell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
68
69
|
open = _ref.open,
|
|
69
70
|
selectorPrimaryFocus = _ref.selectorPrimaryFocus,
|
|
70
71
|
size = _ref.size,
|
|
72
|
+
portalTargetIn = _ref.portalTarget,
|
|
71
73
|
title = _ref.title,
|
|
72
74
|
verticalPosition = _ref.verticalPosition,
|
|
73
75
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
74
76
|
|
|
77
|
+
// node the modal tearsheet is hosted in
|
|
78
|
+
var _useState = useState(null),
|
|
79
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
80
|
+
portalTarget = _useState2[0],
|
|
81
|
+
setPortalTarget = _useState2[1];
|
|
82
|
+
|
|
83
|
+
useEffect(function () {
|
|
84
|
+
if (portalTargetIn) {
|
|
85
|
+
setPortalTarget(portalTargetIn);
|
|
86
|
+
} else {
|
|
87
|
+
if (pkg.isFeatureEnabled('default-portal-target-body')) {
|
|
88
|
+
setPortalTarget(document.body);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}, [portalTargetIn]);
|
|
75
92
|
var localRef = useRef();
|
|
76
93
|
var modalRef = ref || localRef;
|
|
77
94
|
|
|
@@ -82,15 +99,15 @@ export var TearsheetShell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
82
99
|
resizer = _useResizeDetector.ref; // Keep track of the stack depth and our position in it (1-based, 0=closed)
|
|
83
100
|
|
|
84
101
|
|
|
85
|
-
var _useState = useState(0),
|
|
86
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
87
|
-
depth = _useState2[0],
|
|
88
|
-
setDepth = _useState2[1];
|
|
89
|
-
|
|
90
102
|
var _useState3 = useState(0),
|
|
91
103
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
92
|
-
|
|
93
|
-
|
|
104
|
+
depth = _useState4[0],
|
|
105
|
+
setDepth = _useState4[1];
|
|
106
|
+
|
|
107
|
+
var _useState5 = useState(0),
|
|
108
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
109
|
+
position = _useState6[0],
|
|
110
|
+
setPosition = _useState6[1]; // Keep a record of the previous value of depth.
|
|
94
111
|
|
|
95
112
|
|
|
96
113
|
var prevDepth = useRef();
|
|
@@ -176,7 +193,9 @@ export var TearsheetShell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
176
193
|
var includeHeader = label || title || description || headerActions || navigation || effectiveHasCloseIcon; // Include an ActionSet if and only if one or more actions is given.
|
|
177
194
|
|
|
178
195
|
var includeActions = actions && (actions === null || actions === void 0 ? void 0 : actions.length) > 0;
|
|
179
|
-
return
|
|
196
|
+
return (portalTarget ? createPortal : function (children) {
|
|
197
|
+
return children;
|
|
198
|
+
})( /*#__PURE__*/React.createElement(ComposedModal, _extends({}, rest, {
|
|
180
199
|
"aria-label": title,
|
|
181
200
|
className: cx(bc, className, (_cx = {}, _defineProperty(_cx, "".concat(bc, "--stacked-").concat(position, "-of-").concat(depth), // Don't apply this on the initial open of a single tearsheet.
|
|
182
201
|
depth > 1 || depth === 1 && prevDepth.current > 1), _defineProperty(_cx, "".concat(bc, "--wide"), size === 'wide'), _defineProperty(_cx, "".concat(bc, "--narrow"), size !== 'wide'), _cx)),
|
|
@@ -237,7 +256,7 @@ export var TearsheetShell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
237
256
|
})))), /*#__PURE__*/React.createElement("div", {
|
|
238
257
|
className: "".concat(bc, "__resize-detector"),
|
|
239
258
|
ref: resizer
|
|
240
|
-
}));
|
|
259
|
+
})), portalTarget);
|
|
241
260
|
} else {
|
|
242
261
|
pconsole.warn('Tearsheet not rendered: maximum stacking depth exceeded.');
|
|
243
262
|
return null;
|
|
@@ -377,6 +396,11 @@ TearsheetShell.propTypes = _objectSpread({
|
|
|
377
396
|
*/
|
|
378
397
|
open: PropTypes.bool,
|
|
379
398
|
|
|
399
|
+
/**
|
|
400
|
+
* portal target for the all tags modal
|
|
401
|
+
*/
|
|
402
|
+
portalTarget: PropTypes.node,
|
|
403
|
+
|
|
380
404
|
/**
|
|
381
405
|
* Specifies the width of the tearsheet, 'narrow' or 'wide'.
|
|
382
406
|
*/
|
package/es/components/index.js
CHANGED
|
@@ -36,4 +36,5 @@ export { WebTerminal } from './WebTerminal';
|
|
|
36
36
|
export { EditSidePanel } from './EditSidePanel';
|
|
37
37
|
export { OptionsTile } from './OptionsTile';
|
|
38
38
|
export { InlineEdit } from './InlineEdit';
|
|
39
|
-
export { DataSpreadsheet } from './DataSpreadsheet';
|
|
39
|
+
export { DataSpreadsheet } from './DataSpreadsheet';
|
|
40
|
+
export { Datagrid } from './Datagrid';
|
|
@@ -63,13 +63,15 @@ var defaults = {
|
|
|
63
63
|
EditSidePanel: false,
|
|
64
64
|
CancelableTextEdit: false,
|
|
65
65
|
InlineEdit: false,
|
|
66
|
-
DataSpreadsheet: false
|
|
66
|
+
DataSpreadsheet: false,
|
|
67
|
+
Datagrid: false
|
|
67
68
|
/* new component flags here - comment used by generate CLI */
|
|
68
69
|
|
|
69
70
|
},
|
|
70
71
|
// feature level flags
|
|
71
72
|
feature: {
|
|
72
|
-
'a-new-feature': false
|
|
73
|
+
'a-new-feature': false,
|
|
74
|
+
'default-portal-target-body': true
|
|
73
75
|
}
|
|
74
76
|
};
|
|
75
77
|
|