@carbon/ibm-products 2.46.0 → 2.47.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/config-dev.css +6 -1
- package/css/config-dev.css.map +1 -1
- package/css/config.css +6 -1
- package/css/config.css.map +1 -1
- package/css/index-full-carbon.css +1323 -264
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +49 -60
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +1323 -264
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +1323 -264
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/APIKeyModal/APIKeyModal.types.d.ts +6 -0
- package/es/components/ActionBar/ActionBar.d.ts +58 -2
- package/es/components/ActionBar/ActionBar.js +14 -9
- package/es/components/ActionBar/ActionBarItem.d.ts +36 -2
- package/es/components/ActionBar/ActionBarItem.js +7 -4
- package/es/components/ActionBar/ActionBarOverflowItems.d.ts +55 -16
- package/es/components/ActionBar/ActionBarOverflowItems.js +8 -4
- package/es/components/AddSelect/types/index.d.ts +6 -0
- package/es/components/Card/Card.d.ts +68 -2
- package/es/components/Card/Card.js +28 -35
- package/es/components/Card/CardFooter.d.ts +51 -48
- package/es/components/Card/CardFooter.js +4 -2
- package/es/components/Card/CardHeader.d.ts +67 -49
- package/es/components/Card/CardHeader.js +4 -2
- package/es/components/Coachmark/utils/enums.d.ts +6 -0
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +1 -0
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +17 -4
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +2 -2
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +6 -4
- package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +4 -1
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +8 -2
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +3 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +5 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +20 -4
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +15 -7
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +9 -3
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +19 -6
- package/es/components/DataSpreadsheet/types/index.d.ts +6 -0
- package/es/components/Datagrid/Datagrid/DatagridBody.d.ts +6 -0
- package/es/components/Datagrid/Datagrid/DatagridContent.js +3 -2
- package/es/components/Datagrid/Datagrid/DatagridRefBody.d.ts +6 -0
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +4 -5
- package/es/components/Datagrid/Datagrid/DatagridSimpleBody.d.ts +6 -0
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -1
- package/es/components/Datagrid/Datagrid/DraggableElement.d.ts +6 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -2
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +13 -8
- package/es/components/Datagrid/Datagrid/addons/Filtering/handleCheckboxChange.js +7 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +1 -1
- package/es/components/Datagrid/common-column-ids.d.ts +6 -0
- package/es/components/Datagrid/types/index.d.ts +6 -0
- package/es/components/Datagrid/useDatagrid.d.ts +6 -0
- package/es/components/Datagrid/useDisableSelectRows.d.ts +6 -0
- package/es/components/Datagrid/useInitialColumnSort.js +4 -0
- package/es/components/Datagrid/useRowIsMouseOver.d.ts +6 -0
- package/es/components/Datagrid/useSortableColumns.d.ts +5 -4
- package/es/components/Datagrid/useSortableColumns.js +18 -13
- package/es/components/EmptyStates/EmptyState.d.ts +72 -5
- package/es/components/EmptyStates/EmptyState.js +8 -5
- package/es/components/EmptyStates/EmptyStateV2.d.ts +63 -2
- package/es/components/EmptyStates/EmptyStateV2.js +3 -2
- package/es/components/FullPageError/FullPageError.d.ts +36 -2
- package/es/components/FullPageError/FullPageError.js +0 -3
- package/es/components/GetStartedCard/GetStartedCard.d.ts +60 -2
- package/es/components/GetStartedCard/GetStartedCard.js +11 -10
- package/es/components/PageHeader/PageHeaderUtils.js +1 -1
- package/es/components/StringFormatter/utils/enums.js +7 -0
- package/es/components/TagOverflow/TagOverflow.d.ts +35 -4
- package/es/components/TagOverflow/TagOverflow.js +47 -64
- package/es/components/TagOverflow/TagOverflowModal.js +4 -6
- package/es/components/TagOverflow/TagOverflowPopover.d.ts +13 -1
- package/es/components/TagOverflow/TagOverflowPopover.js +38 -41
- package/es/components/Tearsheet/TearsheetShell.js +4 -1
- package/es/components/UserAvatar/UserAvatar.d.ts +59 -1
- package/es/components/UserAvatar/UserAvatar.js +7 -23
- package/es/global/js/utils/scrollableAncestor.js +7 -0
- package/es/global/js/utils/uuidv4.d.ts +6 -0
- package/es/global/js/utils/uuidv4.js +2 -0
- package/es/global/js/utils/wait.d.ts +6 -0
- package/es/global/js/utils/wait.js +2 -0
- package/flags.js +7 -0
- package/lib/components/APIKeyModal/APIKeyModal.types.d.ts +6 -0
- package/lib/components/ActionBar/ActionBar.d.ts +58 -2
- package/lib/components/ActionBar/ActionBar.js +14 -9
- package/lib/components/ActionBar/ActionBarItem.d.ts +36 -2
- package/lib/components/ActionBar/ActionBarItem.js +6 -3
- package/lib/components/ActionBar/ActionBarOverflowItems.d.ts +55 -16
- package/lib/components/ActionBar/ActionBarOverflowItems.js +8 -4
- package/lib/components/AddSelect/types/index.d.ts +6 -0
- package/lib/components/Card/Card.d.ts +68 -2
- package/lib/components/Card/Card.js +28 -35
- package/lib/components/Card/CardFooter.d.ts +51 -48
- package/lib/components/Card/CardFooter.js +4 -2
- package/lib/components/Card/CardHeader.d.ts +67 -49
- package/lib/components/Card/CardHeader.js +4 -2
- package/lib/components/Coachmark/utils/enums.d.ts +6 -0
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +1 -0
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +16 -3
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +5 -3
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +4 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +8 -2
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +3 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +5 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +20 -4
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +15 -7
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +9 -3
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +19 -6
- package/lib/components/DataSpreadsheet/types/index.d.ts +6 -0
- package/lib/components/Datagrid/Datagrid/DatagridBody.d.ts +6 -0
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +3 -2
- package/lib/components/Datagrid/Datagrid/DatagridRefBody.d.ts +6 -0
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +4 -5
- package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.d.ts +6 -0
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -1
- package/lib/components/Datagrid/Datagrid/DraggableElement.d.ts +6 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -2
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +13 -8
- package/lib/components/Datagrid/Datagrid/addons/Filtering/handleCheckboxChange.js +7 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +1 -1
- package/lib/components/Datagrid/common-column-ids.d.ts +6 -0
- package/lib/components/Datagrid/types/index.d.ts +6 -0
- package/lib/components/Datagrid/useDatagrid.d.ts +6 -0
- package/lib/components/Datagrid/useDisableSelectRows.d.ts +6 -0
- package/lib/components/Datagrid/useInitialColumnSort.js +4 -0
- package/lib/components/Datagrid/useRowIsMouseOver.d.ts +6 -0
- package/lib/components/Datagrid/useSortableColumns.d.ts +5 -4
- package/lib/components/Datagrid/useSortableColumns.js +18 -13
- package/lib/components/EmptyStates/EmptyState.d.ts +72 -5
- package/lib/components/EmptyStates/EmptyState.js +8 -5
- package/lib/components/EmptyStates/EmptyStateV2.d.ts +63 -2
- package/lib/components/EmptyStates/EmptyStateV2.js +3 -2
- package/lib/components/FullPageError/FullPageError.d.ts +36 -2
- package/lib/components/FullPageError/FullPageError.js +0 -3
- package/lib/components/GetStartedCard/GetStartedCard.d.ts +60 -2
- package/lib/components/GetStartedCard/GetStartedCard.js +10 -9
- package/lib/components/PageHeader/PageHeaderUtils.js +1 -1
- package/lib/components/StringFormatter/utils/enums.js +7 -0
- package/lib/components/TagOverflow/TagOverflow.d.ts +35 -4
- package/lib/components/TagOverflow/TagOverflow.js +46 -63
- package/lib/components/TagOverflow/TagOverflowModal.js +4 -6
- package/lib/components/TagOverflow/TagOverflowPopover.d.ts +13 -1
- package/lib/components/TagOverflow/TagOverflowPopover.js +37 -40
- package/lib/components/Tearsheet/TearsheetShell.js +4 -1
- package/lib/components/UserAvatar/UserAvatar.d.ts +59 -1
- package/lib/components/UserAvatar/UserAvatar.js +7 -23
- package/lib/global/js/utils/scrollableAncestor.js +7 -0
- package/lib/global/js/utils/uuidv4.d.ts +6 -0
- package/lib/global/js/utils/uuidv4.js +2 -0
- package/lib/global/js/utils/wait.d.ts +6 -0
- package/lib/global/js/utils/wait.js +2 -0
- package/package.json +4 -4
- package/scss/components/ConditionBuilder/_condition-builder.scss +3 -0
- package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +18 -2
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +48 -31
- package/scss/components/ConditionBuilder/styles/_index.scss +7 -0
- package/scss/components/CreateModal/_create-modal.scss +0 -4
- package/scss/components/Datagrid/styles/_datagrid.scss +1 -0
- package/scss/components/Datagrid/styles/_useActionsColumn.scss +6 -7
- package/scss/components/Datagrid/styles/_useColumnRightAlign.scss +6 -7
- package/scss/components/Datagrid/styles/_useExpandedRow.scss +6 -7
- package/scss/components/Datagrid/styles/_useInlineEdit.scss +6 -7
- package/scss/components/Datagrid/styles/_useNestedRows.scss +6 -7
- package/scss/components/Datagrid/styles/_useNestedTable.scss +6 -7
- package/scss/components/Datagrid/styles/_useStickyColumn.scss +6 -7
- package/scss/components/Datagrid/styles/addons/_RowSizeDropdown.scss +6 -7
- package/scss/config-dev.scss +7 -0
- package/scss/config.scss +7 -0
- package/telemetry.yml +2 -0
@@ -55,9 +55,13 @@ var updateFilterState = function updateFilterState(state, type, value) {
|
|
55
55
|
});
|
56
56
|
return removeFilterItem(state, filterTagIndex);
|
57
57
|
};
|
58
|
-
var clearSingleFilter = function clearSingleFilter(_ref, setAllFilters, state) {
|
58
|
+
var clearSingleFilter = function clearSingleFilter(_ref, setAllFilters, state, contextTableId) {
|
59
59
|
var key = _ref.key,
|
60
|
-
value = _ref.value
|
60
|
+
value = _ref.value,
|
61
|
+
tableId = _ref.tableId;
|
62
|
+
if (tableId !== contextTableId) {
|
63
|
+
return;
|
64
|
+
}
|
61
65
|
var tempState = _rollupPluginBabelHelpers.toConsumableArray(state.filters);
|
62
66
|
tempState.forEach(function (f, filterIndex) {
|
63
67
|
if (f.id === key) {
|
@@ -93,10 +97,11 @@ var clearSingleFilter = function clearSingleFilter(_ref, setAllFilters, state) {
|
|
93
97
|
});
|
94
98
|
setAllFilters(tempState);
|
95
99
|
};
|
96
|
-
var handleSingleFilterRemoval = function handleSingleFilterRemoval(key, value) {
|
100
|
+
var handleSingleFilterRemoval = function handleSingleFilterRemoval(key, value, tableId) {
|
97
101
|
EventEmitter.dispatch(constants.CLEAR_SINGLE_FILTER, {
|
98
102
|
key: key,
|
99
|
-
value: value
|
103
|
+
value: value,
|
104
|
+
tableId: tableId
|
100
105
|
});
|
101
106
|
};
|
102
107
|
var formatDateRange = function formatDateRange(startDate, endDate) {
|
@@ -104,7 +109,7 @@ var formatDateRange = function formatDateRange(startDate, endDate) {
|
|
104
109
|
var endDateObj = new Date(endDate);
|
105
110
|
return "".concat(startDateObj.toLocaleDateString(), " - ").concat(endDateObj.toLocaleDateString());
|
106
111
|
};
|
107
|
-
var prepareFiltersForTags = function prepareFiltersForTags(filters, renderDateLabel) {
|
112
|
+
var prepareFiltersForTags = function prepareFiltersForTags(filters, renderDateLabel, tableId) {
|
108
113
|
var tags = [];
|
109
114
|
filters.forEach(function (_ref2) {
|
110
115
|
var id = _ref2.id,
|
@@ -113,7 +118,7 @@ var prepareFiltersForTags = function prepareFiltersForTags(filters, renderDateLa
|
|
113
118
|
var sharedFilterProps = {
|
114
119
|
filter: true,
|
115
120
|
onClose: function onClose() {
|
116
|
-
return handleSingleFilterRemoval(id, value);
|
121
|
+
return handleSingleFilterRemoval(id, value, tableId);
|
117
122
|
}
|
118
123
|
};
|
119
124
|
if (type === constants.DROPDOWN || type === constants.RADIO || type === constants.NUMBER) {
|
@@ -138,7 +143,7 @@ var prepareFiltersForTags = function prepareFiltersForTags(filters, renderDateLa
|
|
138
143
|
value: option.value
|
139
144
|
}, sharedFilterProps), {}, {
|
140
145
|
onClose: function onClose() {
|
141
|
-
return handleSingleFilterRemoval(id, option.value);
|
146
|
+
return handleSingleFilterRemoval(id, option.value, tableId);
|
142
147
|
}
|
143
148
|
}));
|
144
149
|
}
|
@@ -168,7 +173,7 @@ var FilterProvider = function FilterProvider(_ref4) {
|
|
168
173
|
tableId = _ref4.tableId;
|
169
174
|
var _ref5 = filterProps || {},
|
170
175
|
renderDateLabel = _ref5.renderDateLabel;
|
171
|
-
var filterTags = prepareFiltersForTags(filters, renderDateLabel);
|
176
|
+
var filterTags = prepareFiltersForTags(filters, renderDateLabel, tableId);
|
172
177
|
var _useState = React.useState(false),
|
173
178
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
174
179
|
panelOpen = _useState2[0],
|
@@ -11,6 +11,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
11
|
|
12
12
|
var _rollupPluginBabelHelpers = require('../../../../../_virtual/_rollupPluginBabelHelpers.js');
|
13
13
|
|
14
|
+
/**
|
15
|
+
* Copyright IBM Corp. 2024
|
16
|
+
*
|
17
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
18
|
+
* LICENSE file in the root directory of this source tree.
|
19
|
+
*/
|
20
|
+
|
14
21
|
var handleCheckboxChange = function handleCheckboxChange(_ref) {
|
15
22
|
var _option$onChange;
|
16
23
|
var checked = _ref.checked,
|
@@ -212,7 +212,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
212
212
|
};
|
213
213
|
var getNewCellId = function getNewCellId(key) {
|
214
214
|
var totalRows = instance.rows.length;
|
215
|
-
var newCellId = key === 'Enter' ? "column-".concat(columnIndex, "-row-").concat(cell.row.index < totalRows - 1 ? cell.row.index + 1 : cell.row.index) : "column-".concat(columnIndex < instance.columns.length - 1 ? columnIndex + 1 : columnIndex, "-row-").concat(cell.row.index);
|
215
|
+
var newCellId = key === 'Enter' ? "column-".concat(columnIndex, "-row-").concat(cell.row.index < totalRows - 1 && type === 'checkbox' ? cell.row.index + 1 : cell.row.index) : "column-".concat(columnIndex < instance.columns.length - 1 ? columnIndex + 1 : columnIndex, "-row-").concat(cell.row.index);
|
216
216
|
return newCellId;
|
217
217
|
};
|
218
218
|
var handleKeyDown = function handleKeyDown(event) {
|
@@ -1,3 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2024
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
1
7
|
/// <reference path="../../../../src/custom-typings/index.d.ts" />
|
2
8
|
import { MultiSelectProps } from '@carbon/react/lib/components/MultiSelect/MultiSelect';
|
3
9
|
import { FormGroupProps } from '@carbon/react/lib/components/FormGroup/FormGroup';
|
@@ -1,3 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2024
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
1
7
|
import { TableInstance } from 'react-table';
|
2
8
|
declare const useDatagrid: (params: any, ...plugins: any[]) => TableInstance;
|
3
9
|
export default useDatagrid;
|
@@ -1,3 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 2024
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
1
7
|
import { Hooks } from 'react-table';
|
2
8
|
declare const useDisableSelectRows: (hooks: Hooks) => void;
|
3
9
|
export default useDisableSelectRows;
|
@@ -33,6 +33,10 @@ var useInitialColumnSort = function useInitialColumnSort(instance) {
|
|
33
33
|
if (sortableColumn) {
|
34
34
|
var columnId = sortableColumn.id,
|
35
35
|
order = sortableColumn.order;
|
36
|
+
// prevents edge case where initial sort state of none actually starts out as ascending
|
37
|
+
if (order !== 'ASC' && order !== 'DESC') {
|
38
|
+
return;
|
39
|
+
}
|
36
40
|
var _getNewSortOrder = useSortableColumns.getNewSortOrder(order),
|
37
41
|
newSortDesc = _getNewSortOrder.newSortDesc,
|
38
42
|
newOrder = _getNewSortOrder.newOrder;
|
@@ -1,3 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2024
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
1
7
|
import { Hooks } from 'react-table';
|
2
8
|
declare const useRowIsMouseOver: (hooks: Hooks) => void;
|
3
9
|
export default useRowIsMouseOver;
|
@@ -5,9 +5,10 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
import { Hooks } from 'react-table';
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
}
|
8
|
+
interface Order {
|
9
|
+
newOrder: 'ASC' | 'DESC' | 'NONE';
|
10
|
+
newSortDesc: undefined | boolean;
|
11
|
+
}
|
12
|
+
export declare const getNewSortOrder: (currentOrder?: boolean | string) => Order;
|
12
13
|
declare const useSortableColumns: (hooks: Hooks) => void;
|
13
14
|
export default useSortableColumns;
|
@@ -24,23 +24,28 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
24
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
25
25
|
|
26
26
|
var blockClass = "".concat(settings.pkg.prefix, "--datagrid");
|
27
|
-
var
|
28
|
-
ASC: 'ASC',
|
29
|
-
DESC: 'DESC',
|
30
|
-
NONE: 'NONE'
|
31
|
-
};
|
32
|
-
var getNewSortOrder = function getNewSortOrder(sortOrder) {
|
27
|
+
var getNewSortOrder = function getNewSortOrder(currentOrder) {
|
33
28
|
var order = {
|
34
|
-
|
35
|
-
|
29
|
+
newOrder: 'NONE',
|
30
|
+
newSortDesc: undefined
|
36
31
|
};
|
37
|
-
|
38
|
-
|
32
|
+
|
33
|
+
// NONE => ASC
|
34
|
+
if (currentOrder === undefined) {
|
35
|
+
order.newOrder = 'ASC';
|
36
|
+
order.newSortDesc = false;
|
37
|
+
}
|
38
|
+
|
39
|
+
// ACS => DESC
|
40
|
+
if (currentOrder === false || currentOrder === 'DESC') {
|
41
|
+
order.newOrder = 'DESC';
|
39
42
|
order.newSortDesc = true;
|
40
43
|
}
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
+
|
45
|
+
// DESC => NONE
|
46
|
+
if (currentOrder === true || currentOrder === 'ASC') {
|
47
|
+
order.newOrder = 'NONE';
|
48
|
+
order.newSortDesc = undefined;
|
44
49
|
}
|
45
50
|
return order;
|
46
51
|
};
|
@@ -1,9 +1,76 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 2021
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
/// <reference path="../../../src/custom-typings/index.d.ts" />
|
8
|
+
import React, { ReactNode } from 'react';
|
9
|
+
import '../../global/js/utils/props-helper';
|
10
|
+
import { ButtonProps } from '@carbon/react';
|
11
|
+
import { CarbonIconType } from '@carbon/icons-react/lib/CarbonIcon';
|
12
|
+
declare enum sizes {
|
13
|
+
lg = "lg",
|
14
|
+
sm = "sm"
|
15
|
+
}
|
16
|
+
export declare const defaults: {
|
17
|
+
position: string;
|
18
|
+
size: sizes;
|
19
|
+
};
|
20
|
+
interface EmptyStateProps {
|
21
|
+
/**
|
22
|
+
* Empty state action button
|
23
|
+
*/
|
24
|
+
action?: {
|
25
|
+
kind?: 'primary' | 'secondary' | 'tertiary';
|
26
|
+
renderIcon?: CarbonIconType;
|
27
|
+
onClick?: ButtonProps['onClick'];
|
28
|
+
text?: string;
|
29
|
+
};
|
30
|
+
/**
|
31
|
+
* Provide an optional class to be applied to the containing node.
|
32
|
+
*/
|
33
|
+
className?: string;
|
34
|
+
/**
|
35
|
+
* Empty state illustration, specify the `src` for a provided illustration to be displayed. In the case of requiring a light and dark illustration of your own, simply pass the corresponding illustration based on the current theme of your application.
|
36
|
+
* For example: `illustration={appTheme === 'dark' ? darkIllustration : lightIllustration}`
|
37
|
+
*/
|
38
|
+
illustration?: string;
|
39
|
+
/**
|
40
|
+
* The alt text for empty state svg images. If not provided , title will be used.
|
41
|
+
*/
|
42
|
+
illustrationDescription?: string;
|
43
|
+
/**
|
44
|
+
* Designates the position of the illustration relative to the content
|
45
|
+
*/
|
46
|
+
illustrationPosition?: 'top' | 'right' | 'bottom' | 'left';
|
47
|
+
/**
|
48
|
+
* Empty state link object
|
49
|
+
*/
|
50
|
+
link?: {
|
51
|
+
text?: string | ReactNode;
|
52
|
+
href?: string;
|
53
|
+
};
|
54
|
+
/**
|
55
|
+
* Empty state size
|
56
|
+
*/
|
57
|
+
size?: 'lg' | 'sm';
|
58
|
+
/**
|
59
|
+
* Empty state subtitle
|
60
|
+
*/
|
61
|
+
subtitle?: string | ReactNode;
|
62
|
+
/**
|
63
|
+
* Empty state title
|
64
|
+
*/
|
65
|
+
title: string | ReactNode;
|
66
|
+
/**
|
67
|
+
* Designates which version of the EmptyState component is being used.
|
68
|
+
* Refer to V2 documentation separately.
|
69
|
+
*/
|
70
|
+
v2?: boolean;
|
4
71
|
}
|
5
72
|
/**
|
6
73
|
* The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
|
7
74
|
*/
|
8
|
-
export let EmptyState: React.ForwardRefExoticComponent<React.RefAttributes<
|
9
|
-
|
75
|
+
export declare let EmptyState: React.ForwardRefExoticComponent<EmptyStateProps & React.RefAttributes<HTMLDivElement>>;
|
76
|
+
export {};
|
@@ -31,13 +31,15 @@ var _excluded = ["v2"],
|
|
31
31
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
32
32
|
var blockClass = "".concat(settings.pkg.prefix, "--empty-state");
|
33
33
|
var componentName = 'EmptyState';
|
34
|
-
|
35
|
-
|
34
|
+
var sizes = /*#__PURE__*/function (sizes) {
|
35
|
+
sizes["lg"] = "lg";
|
36
|
+
sizes["sm"] = "sm";
|
37
|
+
return sizes;
|
38
|
+
}(sizes || {}); // Default values for props
|
36
39
|
var defaults = {
|
37
40
|
position: 'top',
|
38
|
-
size:
|
41
|
+
size: sizes.lg
|
39
42
|
};
|
40
|
-
|
41
43
|
/**
|
42
44
|
* The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
|
43
45
|
*/
|
@@ -73,7 +75,7 @@ exports.EmptyState = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
73
75
|
link: link,
|
74
76
|
size: size,
|
75
77
|
subtitle: subtitle,
|
76
|
-
title: title
|
78
|
+
title: title !== null && title !== void 0 ? title : ''
|
77
79
|
}));
|
78
80
|
});
|
79
81
|
|
@@ -101,6 +103,7 @@ exports.EmptyState.propTypes = {
|
|
101
103
|
/**
|
102
104
|
* The alt text for custom provided illustrations
|
103
105
|
*/
|
106
|
+
/**@ts-ignore*/
|
104
107
|
illustrationDescription: index["default"].string.isRequired.if(function (_ref2) {
|
105
108
|
var illustration = _ref2.illustration;
|
106
109
|
return illustration;
|
@@ -1,6 +1,67 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2023, 2024
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
import React, { ReactNode } from 'react';
|
8
|
+
import '../../global/js/utils/props-helper';
|
9
|
+
interface EmptyStateV2Props {
|
10
|
+
/**
|
11
|
+
* Props for the action button. Refer to the Carbon Components button documentation for full list of props.
|
12
|
+
*/
|
13
|
+
action?: {
|
14
|
+
text?: string;
|
15
|
+
};
|
16
|
+
/**
|
17
|
+
* Provide an optional class to be applied to the containing node.
|
18
|
+
*/
|
19
|
+
className?: string;
|
20
|
+
/**
|
21
|
+
* Source for the illustration image if you choose to use your own custom image. Passing an illustration prop will supersede the kind option.
|
22
|
+
*/
|
23
|
+
illustration?: string;
|
24
|
+
/**
|
25
|
+
* The alt text for the illustration
|
26
|
+
*/
|
27
|
+
illustrationDescription?: string;
|
28
|
+
/**
|
29
|
+
* Designates the position of the illustration relative to the content
|
30
|
+
*/
|
31
|
+
illustrationPosition?: 'top' | 'right' | 'bottom' | 'left';
|
32
|
+
/**
|
33
|
+
* Empty state illustration theme variations.
|
34
|
+
* To ensure you use the correct themed illustrations, you can conditionally specify light or dark
|
35
|
+
* based on your app's current theme value. Example:
|
36
|
+
* `illustrationTheme={appTheme === ('carbon--g100' || 'carbon--g90') ? 'dark' : 'light'}`
|
37
|
+
*/
|
38
|
+
illustrationTheme?: 'light' | 'dark';
|
39
|
+
/**
|
40
|
+
* Determines which predefined illustration will be displayed
|
41
|
+
*/
|
42
|
+
kind?: 'error' | 'noData' | 'noTags' | 'notFound' | 'notifications' | 'unauthorized';
|
43
|
+
/**
|
44
|
+
* Props for the link. Refer to the Carbon Components link documentation for full list of props.
|
45
|
+
*/
|
46
|
+
link?: {
|
47
|
+
text?: string | ReactNode;
|
48
|
+
};
|
49
|
+
/**
|
50
|
+
* Empty state size
|
51
|
+
*/
|
52
|
+
size?: 'sm' | 'lg';
|
53
|
+
/**
|
54
|
+
* Empty state subtext
|
55
|
+
*/
|
56
|
+
subtitle?: string | ReactNode;
|
57
|
+
/**
|
58
|
+
* Empty state heading
|
59
|
+
*/
|
60
|
+
title: string | ReactNode;
|
61
|
+
}
|
1
62
|
/**
|
2
63
|
* This is the V2 version of the `EmptyState` component. To use you must pass the `v2` prop to the V1 version of the component `EmptyState` and use the props below.
|
3
64
|
* In order to avoid breaking changes in the future `EmptyStateV2` is not actually directly importable.
|
4
65
|
*/
|
5
|
-
export let EmptyStateV2: React.ForwardRefExoticComponent<React.RefAttributes<
|
6
|
-
|
66
|
+
export declare let EmptyStateV2: React.ForwardRefExoticComponent<EmptyStateV2Props & React.RefAttributes<HTMLDivElement>>;
|
67
|
+
export {};
|
@@ -27,7 +27,6 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
27
27
|
var _excluded = ["action", "className", "illustration", "illustrationDescription", "illustrationPosition", "illustrationTheme", "kind", "link", "size", "subtitle", "title"];
|
28
28
|
var blockClass = "".concat(settings.pkg.prefix, "--empty-state");
|
29
29
|
var componentName = 'EmptyStateV2';
|
30
|
-
|
31
30
|
/**
|
32
31
|
* This is the V2 version of the `EmptyState` component. To use you must pass the `v2` prop to the V1 version of the component `EmptyState` and use the props below.
|
33
32
|
* In order to avoid breaking changes in the future `EmptyStateV2` is not actually directly importable.
|
@@ -81,6 +80,7 @@ exports.EmptyStateV2.propTypes = {
|
|
81
80
|
/**
|
82
81
|
* Props for the action button. Refer to the Carbon Components button documentation for full list of props.
|
83
82
|
*/
|
83
|
+
/**@ts-ignore*/
|
84
84
|
action: index["default"].PropTypes.shape({
|
85
85
|
text: index["default"].string
|
86
86
|
}),
|
@@ -114,8 +114,9 @@ exports.EmptyStateV2.propTypes = {
|
|
114
114
|
/**
|
115
115
|
* Props for the link. Refer to the Carbon Components link documentation for full list of props.
|
116
116
|
*/
|
117
|
+
/**@ts-ignore*/
|
117
118
|
link: index["default"].shape({
|
118
|
-
text: index["default"].string
|
119
|
+
text: index["default"].oneOfType([index["default"].string, index["default"].node])
|
119
120
|
}),
|
120
121
|
/**
|
121
122
|
* Empty state size
|
@@ -1,6 +1,40 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2024, 2024
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
import React, { ReactNode } from 'react';
|
8
|
+
interface FullPageErrorProps {
|
9
|
+
/**
|
10
|
+
* Provide the contents of the FullPageError.
|
11
|
+
*/
|
12
|
+
children?: ReactNode;
|
13
|
+
/**
|
14
|
+
* Provide an optional class to be applied to the containing node.
|
15
|
+
*/
|
16
|
+
className?: string;
|
17
|
+
/**
|
18
|
+
* String that will provide the description for the error code. <br/>
|
19
|
+
* This is optional for 403 and 404 kinds, and passing this would override their default descriptions.
|
20
|
+
*/
|
21
|
+
description: string;
|
22
|
+
/**
|
23
|
+
* The kind of error page to be displayed, default is custom
|
24
|
+
*/
|
25
|
+
kind?: 'custom' | '403' | '404';
|
26
|
+
/**
|
27
|
+
* String that will describe the error that occurred
|
28
|
+
*/
|
29
|
+
label: string;
|
30
|
+
/**
|
31
|
+
* This will be for the main title of the FullPageError component
|
32
|
+
*/
|
33
|
+
title: string;
|
34
|
+
}
|
1
35
|
/**
|
2
36
|
* Display a full-page error when the requested page is unavailable to the user.
|
3
37
|
* This is typically caused by issues with the requested URL or access permissions.
|
4
38
|
*/
|
5
|
-
export let FullPageError: React.ForwardRefExoticComponent<React.RefAttributes<
|
6
|
-
|
39
|
+
export declare let FullPageError: React.ForwardRefExoticComponent<FullPageErrorProps & React.RefAttributes<HTMLDivElement>>;
|
40
|
+
export {};
|
@@ -30,9 +30,6 @@ var _excluded = ["children", "className", "description", "label", "kind", "title
|
|
30
30
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
31
31
|
var blockClass = "".concat(settings.pkg.prefix, "--full-page-error");
|
32
32
|
var componentName = 'FullPageError';
|
33
|
-
|
34
|
-
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
35
|
-
|
36
33
|
// Default values for props
|
37
34
|
var defaults = {
|
38
35
|
kind: 'custom'
|
@@ -1,5 +1,63 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2024, 2024
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
import React, { PropsWithChildren, ReactNode } from 'react';
|
8
|
+
type MetaData = {
|
9
|
+
id?: string;
|
10
|
+
icon?: () => ReactNode;
|
11
|
+
iconDescription?: string;
|
12
|
+
};
|
13
|
+
interface GetStartedCardProps extends PropsWithChildren {
|
14
|
+
/**
|
15
|
+
* Provide an optional class to be applied to the containing node.
|
16
|
+
*/
|
17
|
+
className?: string;
|
18
|
+
/**
|
19
|
+
* Optional if the card should be disabled
|
20
|
+
*/
|
21
|
+
disabled?: boolean;
|
22
|
+
/**
|
23
|
+
* Provides the action icon that's displayed at the footer of the card
|
24
|
+
*/
|
25
|
+
footerActionIcon: React.ElementType;
|
26
|
+
/**
|
27
|
+
* Optional label for the top of the card
|
28
|
+
*/
|
29
|
+
label?: ReactNode;
|
30
|
+
/**
|
31
|
+
* Optional media content like an image to be placed in the card
|
32
|
+
*/
|
33
|
+
media?: ReactNode;
|
34
|
+
/**
|
35
|
+
* Icons that are displayed on the card showing the time and skill needed
|
36
|
+
*/
|
37
|
+
metadata: readonly MetaData[];
|
38
|
+
/**
|
39
|
+
* Provides the callback for a clickable card
|
40
|
+
*/
|
41
|
+
onClick?: () => void;
|
42
|
+
/**
|
43
|
+
* Provides the icon that's displayed at the top of the card
|
44
|
+
*/
|
45
|
+
pictogram?: () => ReactNode;
|
46
|
+
/**
|
47
|
+
* Provides number for card for tasks in a sequential order
|
48
|
+
*/
|
49
|
+
sequence?: number;
|
50
|
+
/**
|
51
|
+
* Provides the status that's displayed at the top of the card
|
52
|
+
*/
|
53
|
+
status?: 'complete' | 'incomplete';
|
54
|
+
/**
|
55
|
+
* Title that's displayed at the top of the card
|
56
|
+
*/
|
57
|
+
title?: ReactNode;
|
58
|
+
}
|
1
59
|
/**
|
2
60
|
* GetStartedCard a card with icon, number, and media variants
|
3
61
|
*/
|
4
|
-
export let GetStartedCard: React.ForwardRefExoticComponent<React.RefAttributes<
|
5
|
-
|
62
|
+
export declare let GetStartedCard: React.ForwardRefExoticComponent<GetStartedCardProps & React.RefAttributes<HTMLDivElement>>;
|
63
|
+
export {};
|
@@ -21,16 +21,14 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
21
21
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
22
22
|
|
23
23
|
var componentName = 'GetStartedCard';
|
24
|
-
|
25
24
|
/**
|
26
25
|
* GetStartedCard a card with icon, number, and media variants
|
27
26
|
*/
|
28
|
-
exports.GetStartedCard = /*#__PURE__*/React__default["default"].forwardRef(function (
|
29
|
-
|
30
|
-
|
31
|
-
getStarted: true
|
32
|
-
|
33
|
-
}, rest, devtools.getDevtoolsProps(componentName)));
|
27
|
+
exports.GetStartedCard = /*#__PURE__*/React__default["default"].forwardRef(function (props, ref) {
|
28
|
+
return /*#__PURE__*/React__default["default"].createElement(Card.Card, _rollupPluginBabelHelpers["extends"]({}, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, props), {}, {
|
29
|
+
ref: ref,
|
30
|
+
getStarted: true
|
31
|
+
}), devtools.getDevtoolsProps(componentName)));
|
34
32
|
});
|
35
33
|
|
36
34
|
// Return a placeholder if not released and not enabled by feature flag
|
@@ -48,11 +46,12 @@ exports.GetStartedCard.propTypes = {
|
|
48
46
|
/**
|
49
47
|
* Provides the action icon that's displayed at the footer of the card
|
50
48
|
*/
|
49
|
+
/**@ts-ignore */
|
51
50
|
footerActionIcon: index["default"].oneOfType([index["default"].func, index["default"].object]),
|
52
51
|
/**
|
53
52
|
* Optional label for the top of the card
|
54
53
|
*/
|
55
|
-
label: index["default"].oneOfType([index["default"].string, index["default"].
|
54
|
+
label: index["default"].oneOfType([index["default"].string, index["default"].node]),
|
56
55
|
/**
|
57
56
|
* Optional media content like an image to be placed in the card
|
58
57
|
*/
|
@@ -60,6 +59,7 @@ exports.GetStartedCard.propTypes = {
|
|
60
59
|
/**
|
61
60
|
* Icons that are displayed on the card showing the time and skill needed
|
62
61
|
*/
|
62
|
+
/**@ts-ignore */
|
63
63
|
metadata: index["default"].arrayOf(index["default"].shape({
|
64
64
|
id: index["default"].string,
|
65
65
|
icon: index["default"].oneOfType([index["default"].func, index["default"].object]),
|
@@ -72,6 +72,7 @@ exports.GetStartedCard.propTypes = {
|
|
72
72
|
/**
|
73
73
|
* Provides the icon that's displayed at the top of the card
|
74
74
|
*/
|
75
|
+
/**@ts-ignore */
|
75
76
|
pictogram: index["default"].oneOfType([index["default"].func, index["default"].object]),
|
76
77
|
/**
|
77
78
|
* Provides number for card for tasks in a sequential order
|
@@ -84,5 +85,5 @@ exports.GetStartedCard.propTypes = {
|
|
84
85
|
/**
|
85
86
|
* Title that's displayed at the top of the card
|
86
87
|
*/
|
87
|
-
title: index["default"].oneOfType([index["default"].string, index["default"].
|
88
|
+
title: index["default"].oneOfType([index["default"].string, index["default"].node])
|
88
89
|
};
|
@@ -81,7 +81,7 @@ var utilCheckUpdateVerticalSpace = function utilCheckUpdateVerticalSpace(headerR
|
|
81
81
|
|
82
82
|
// The header offset calculation is either going to work out at 0 if we have no gap between scrolling container
|
83
83
|
// top and the measuring ref top, or the difference between.
|
84
|
-
update.headerOffset = offsetMeasuringTop
|
84
|
+
update.headerOffset = offsetMeasuringTop !== 0 ? offsetMeasuringTop - scrollableContainerTop : 0;
|
85
85
|
|
86
86
|
/* istanbul ignore next */
|
87
87
|
update.breadcrumbRowHeight = breadcrumbRowEl ? breadcrumbRowEl.clientHeight : 0;
|
@@ -11,6 +11,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
11
|
|
12
12
|
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
13
13
|
|
14
|
+
/**
|
15
|
+
* Copyright IBM Corp. 2024
|
16
|
+
*
|
17
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
18
|
+
* LICENSE file in the root directory of this source tree.
|
19
|
+
*/
|
20
|
+
|
14
21
|
var deprecated_StringFormatterAlignment = {
|
15
22
|
TOP: 'top',
|
16
23
|
TOP_LEFT: 'top-left',
|