@carbon/ibm-products 2.42.1-canary.27 → 2.42.1-canary.4
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +9 -302
- 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.css +9 -302
- 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 +9 -302
- 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/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +0 -6
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +33 -74
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +1 -15
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +12 -95
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +2 -11
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +9 -27
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +0 -5
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +14 -95
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +0 -1
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +0 -1
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +0 -7
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +1 -8
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +1 -1
- package/es/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.js +33 -38
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +67 -197
- package/es/components/ConditionBuilder/utils/util.d.ts +0 -1
- package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.d.ts +1 -1
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +4 -7
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -7
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts +0 -1
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +3 -13
- package/es/components/Datagrid/types/index.d.ts +0 -2
- package/es/components/Datagrid/useColumnOrder.d.ts +1 -7
- package/es/components/Datagrid/useFiltering.d.ts +1 -8
- package/es/components/Datagrid/useFiltering.js +7 -8
- package/es/components/Datagrid/useFlexResize.d.ts +1 -1
- package/es/components/Datagrid/useFlexResize.js +11 -11
- package/es/components/Datagrid/useNestedRows.js +2 -24
- package/es/components/Datagrid/useOnRowClick.d.ts +1 -8
- package/es/components/Datagrid/useOnRowClick.js +1 -2
- package/es/components/Datagrid/useRowIsMouseOver.d.ts +1 -2
- package/es/components/Datagrid/useRowIsMouseOver.js +1 -1
- package/es/components/Datagrid/useSelectRows.d.ts +1 -8
- package/es/components/Datagrid/useSelectRows.js +2 -3
- package/es/components/Datagrid/useSortableColumns.d.ts +3 -10
- package/es/components/Datagrid/useSortableColumns.js +2 -3
- package/es/components/Datagrid/utils/getAutoSizedColumnWidth.d.ts +1 -8
- package/es/components/Datagrid/utils/getAutoSizedColumnWidth.js +7 -0
- package/es/components/SidePanel/SidePanel.d.ts +2 -2
- package/es/components/SidePanel/SidePanel.js +5 -9
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +0 -6
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +32 -73
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +1 -15
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +9 -92
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +2 -11
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +8 -26
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +0 -5
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +11 -92
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +0 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +0 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +0 -7
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +1 -8
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +1 -1
- package/lib/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.js +31 -36
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +64 -195
- package/lib/components/ConditionBuilder/utils/util.d.ts +0 -1
- package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.d.ts +1 -1
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +4 -7
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -7
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts +0 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +3 -13
- package/lib/components/Datagrid/types/index.d.ts +0 -2
- package/lib/components/Datagrid/useColumnOrder.d.ts +1 -7
- package/lib/components/Datagrid/useFiltering.d.ts +1 -8
- package/lib/components/Datagrid/useFiltering.js +7 -8
- package/lib/components/Datagrid/useFlexResize.d.ts +1 -1
- package/lib/components/Datagrid/useFlexResize.js +11 -11
- package/lib/components/Datagrid/useNestedRows.js +2 -24
- package/lib/components/Datagrid/useOnRowClick.d.ts +1 -8
- package/lib/components/Datagrid/useOnRowClick.js +1 -2
- package/lib/components/Datagrid/useRowIsMouseOver.d.ts +1 -2
- package/lib/components/Datagrid/useRowIsMouseOver.js +1 -1
- package/lib/components/Datagrid/useSelectRows.d.ts +1 -8
- package/lib/components/Datagrid/useSelectRows.js +2 -3
- package/lib/components/Datagrid/useSortableColumns.d.ts +3 -10
- package/lib/components/Datagrid/useSortableColumns.js +2 -3
- package/lib/components/Datagrid/utils/getAutoSizedColumnWidth.d.ts +1 -8
- package/lib/components/Datagrid/utils/getAutoSizedColumnWidth.js +7 -0
- package/lib/components/SidePanel/SidePanel.d.ts +2 -2
- package/lib/components/SidePanel/SidePanel.js +5 -9
- package/package.json +3 -3
- package/scss/components/ConditionBuilder/_condition-builder.scss +1 -21
- package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +3 -22
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +21 -58
- package/telemetry.yml +0 -23
- package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.d.ts +0 -2
- package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +0 -44
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +0 -10
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +0 -69
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.d.ts +0 -2
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +0 -52
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +0 -10
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +0 -77
- /package/es/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.d.ts +0 -0
- /package/lib/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.d.ts +0 -0
@@ -1,8 +1,2 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright IBM Corp. 2022, 2022
|
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 { useColumnOrder } from 'react-table';
|
8
1
|
export default useColumnOrder;
|
2
|
+
import { useColumnOrder } from 'react-table';
|
@@ -1,9 +1,2 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright IBM Corp. 2022, 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 { Hooks } from 'react-table';
|
8
|
-
declare const useFiltering: (hooks: Hooks) => void;
|
9
1
|
export default useFiltering;
|
2
|
+
declare function useFiltering(hooks: any): void;
|
@@ -63,13 +63,12 @@ var useFiltering = function useFiltering(hooks) {
|
|
63
63
|
});
|
64
64
|
}, []);
|
65
65
|
hooks.useInstance.push(function (instance) {
|
66
|
-
var
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
state = _ref4.state;
|
66
|
+
var filterProps = instance.filterProps,
|
67
|
+
setAllFilters = instance.setAllFilters,
|
68
|
+
setFilter = instance.setFilter,
|
69
|
+
headers = instance.headers,
|
70
|
+
data = instance.data,
|
71
|
+
state = instance.state;
|
73
72
|
var defaultProps = {
|
74
73
|
variation: 'flyout',
|
75
74
|
updateMethod: BATCH,
|
@@ -85,7 +84,7 @@ var useFiltering = function useFiltering(hooks) {
|
|
85
84
|
});
|
86
85
|
};
|
87
86
|
Object.assign(instance, {
|
88
|
-
filterProps: _objectSpread2(_objectSpread2({}, defaultProps), instance
|
87
|
+
filterProps: _objectSpread2(_objectSpread2({}, defaultProps), instance.filterProps),
|
89
88
|
filterTypes: filterTypes,
|
90
89
|
getFilterFlyoutProps: getFilterFlyoutProps,
|
91
90
|
FilterFlyout: FilterFlyout
|
@@ -7,31 +7,31 @@
|
|
7
7
|
|
8
8
|
import { toConsumableArray as _toConsumableArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
|
10
|
-
/* eslint-disable no-unreachable */
|
11
10
|
/**
|
12
|
-
* Copyright IBM Corp. 2020,
|
11
|
+
* Copyright IBM Corp. 2020, 2023
|
13
12
|
*
|
14
13
|
* This source code is licensed under the Apache-2.0 license found in the
|
15
14
|
* LICENSE file in the root directory of this source tree.
|
16
15
|
*/
|
17
16
|
|
18
17
|
var useFlexResize = function useFlexResize(hooks) {
|
18
|
+
var spacer = {
|
19
|
+
id: 'spacer',
|
20
|
+
width: 0,
|
21
|
+
disableSortBy: true,
|
22
|
+
disableResizing: true
|
23
|
+
};
|
19
24
|
hooks.visibleColumns.push(function (columns) {
|
20
|
-
// always move actions to the end
|
25
|
+
// always move actions and spacer to the end
|
21
26
|
var actionsIdx = columns.findIndex(function (col) {
|
22
27
|
return col.isAction;
|
23
28
|
});
|
24
29
|
if (actionsIdx === -1) {
|
25
|
-
|
26
|
-
_lastCol.isFlexCol = true;
|
27
|
-
return _toConsumableArray(columns);
|
30
|
+
return [].concat(_toConsumableArray(columns), [spacer]);
|
28
31
|
}
|
29
32
|
var cols = _toConsumableArray(columns);
|
30
33
|
var actions = cols.splice(actionsIdx, 1)[0];
|
31
|
-
cols.splice(columns.length, 0, actions);
|
32
|
-
// the last non-action action column should flex remaining space
|
33
|
-
var lastCol = columns.at(-2);
|
34
|
-
lastCol.isFlexCol = true;
|
34
|
+
cols.splice(columns.length, 0, spacer, actions);
|
35
35
|
return cols;
|
36
36
|
});
|
37
37
|
var changeProps = function changeProps(props, data) {
|
@@ -39,7 +39,7 @@ var useFlexResize = function useFlexResize(hooks) {
|
|
39
39
|
if (!column && data.cell) {
|
40
40
|
column = data.cell.column;
|
41
41
|
}
|
42
|
-
if (column.
|
42
|
+
if (column.id === spacer.id) {
|
43
43
|
return [props, {
|
44
44
|
style: {
|
45
45
|
flex: '1 1 0'
|
@@ -15,23 +15,6 @@ var blockClass = "".concat(pkg.prefix, "--datagrid");
|
|
15
15
|
var useNestedRows = function useNestedRows(hooks) {
|
16
16
|
useNestedRowExpander(hooks);
|
17
17
|
var useInstance = function useInstance(instance) {
|
18
|
-
useEffect(function () {
|
19
|
-
var rows = instance.rows;
|
20
|
-
var defaultExpandedRows = rows.filter(function (row) {
|
21
|
-
var _row$original;
|
22
|
-
return row === null || row === void 0 || (_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.defaultExpanded;
|
23
|
-
});
|
24
|
-
if (defaultExpandedRows !== null && defaultExpandedRows !== void 0 && defaultExpandedRows.length) {
|
25
|
-
defaultExpandedRows.map(function (defaultExpandedRow) {
|
26
|
-
if (!defaultExpandedRow.isExpanded && !defaultExpandedRow.hasExpanded) {
|
27
|
-
var _defaultExpandedRow$t;
|
28
|
-
defaultExpandedRow === null || defaultExpandedRow === void 0 || (_defaultExpandedRow$t = defaultExpandedRow.toggleRowExpanded) === null || _defaultExpandedRow$t === void 0 || _defaultExpandedRow$t.call(defaultExpandedRow);
|
29
|
-
defaultExpandedRow.hasExpanded = true;
|
30
|
-
return;
|
31
|
-
}
|
32
|
-
});
|
33
|
-
}
|
34
|
-
}, [instance, instance.rows]);
|
35
18
|
// This useEffect will expand rows if they exist in the initialState obj
|
36
19
|
useEffect(function () {
|
37
20
|
var rows = instance.rows,
|
@@ -63,21 +46,16 @@ var useNestedRows = function useNestedRows(hooks) {
|
|
63
46
|
}
|
64
47
|
}];
|
65
48
|
};
|
66
|
-
var getIndentation = function getIndentation(depth) {
|
67
|
-
return 32 * depth + 16;
|
68
|
-
}; // row indentation padding
|
69
49
|
var getCellProps = function getCellProps(props, _ref3) {
|
70
50
|
var cell = _ref3.cell,
|
71
51
|
instance = _ref3.instance;
|
72
|
-
//
|
52
|
+
// reduce the "first cell"s width to compensate added (left) margin
|
73
53
|
var isFirstCell = instance.columns.findIndex(function (c) {
|
74
54
|
return c.id === cell.column.id;
|
75
55
|
}) === 0;
|
76
56
|
return [props, {
|
77
57
|
style: {
|
78
|
-
marginRight: isFirstCell && cell.row.depth > 0
|
79
|
-
? "".concat(parseInt(props.style.width, 10) - (getIndentation(cell.row.depth) + 50), "px") : '',
|
80
|
-
width: isFirstCell && cell.row.depth > 0 ? parseInt(props.style.width, 10) - getIndentation(cell.row.depth) : props.style.width
|
58
|
+
marginRight: "".concat(isFirstCell && cell.row.depth > 0 ? "".concat(-32 * cell.row.depth - 18, "px") : '')
|
81
59
|
}
|
82
60
|
}];
|
83
61
|
};
|
@@ -1,9 +1,2 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright IBM Corp. 2020, 2023
|
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 { Hooks } from 'react-table';
|
8
|
-
declare const useOnRowClick: (hooks: Hooks) => void;
|
9
1
|
export default useOnRowClick;
|
2
|
+
declare function useOnRowClick(hooks: any): void;
|
@@ -9,8 +9,7 @@ import { pkg, carbon } from '../../settings.js';
|
|
9
9
|
|
10
10
|
var useOnRowClick = function useOnRowClick(hooks) {
|
11
11
|
var useInstance = function useInstance(rowInstance) {
|
12
|
-
var
|
13
|
-
onRowClick = _ref.onRowClick;
|
12
|
+
var onRowClick = rowInstance.onRowClick;
|
14
13
|
var getRowProps = function getRowProps(props, datagridState) {
|
15
14
|
var isFetching = datagridState.isFetching,
|
16
15
|
row = datagridState.row,
|
@@ -17,7 +17,7 @@ var useRowIsMouseOver = function useRowIsMouseOver(hooks) {
|
|
17
17
|
setMouseOverRowIndex = _useState2[1];
|
18
18
|
var onMouseChange = useDebounce(function (datagridState) {
|
19
19
|
var row = datagridState.row;
|
20
|
-
setMouseOverRowIndex(row
|
20
|
+
setMouseOverRowIndex(row.index);
|
21
21
|
}, 100);
|
22
22
|
var getRowProps = function getRowProps(props, datagridState) {
|
23
23
|
var onMouseOver = function onMouseOver() {
|
@@ -1,9 +1,2 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright IBM Corp. 2020, 2023
|
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 { Hooks } from 'react-table';
|
8
|
-
declare const useSelectRows: (hooks: Hooks) => void;
|
9
1
|
export default useSelectRows;
|
2
|
+
declare function useSelectRows(hooks: any): void;
|
@@ -108,8 +108,7 @@ var SelectRow = function SelectRow(datagridState) {
|
|
108
108
|
dispatch: dispatch,
|
109
109
|
rowData: row,
|
110
110
|
isChecked: event.target.checked,
|
111
|
-
getRowId: getRowId
|
112
|
-
selectAll: null
|
111
|
+
getRowId: getRowId
|
113
112
|
});
|
114
113
|
};
|
115
114
|
var selectDisabled = isFetching || row.getRowProps().disabled;
|
@@ -129,7 +128,7 @@ var SelectRow = function SelectRow(datagridState) {
|
|
129
128
|
onSelect: onSelectHandler,
|
130
129
|
id: rowId,
|
131
130
|
name: "".concat(rowId, "-name"),
|
132
|
-
className: cx([checkboxClass, cellProps.className, _defineProperty({}, "".concat(checkboxClass, "-sticky-left"), isFirstColumnStickyLeft &&
|
131
|
+
className: cx([checkboxClass, cellProps.className, _defineProperty({}, "".concat(checkboxClass, "-sticky-left"), isFirstColumnStickyLeft && windowSize > 671)]),
|
133
132
|
ariaLabel: title,
|
134
133
|
disabled: selectDisabled
|
135
134
|
}));
|
@@ -1,13 +1,6 @@
|
|
1
|
-
|
2
|
-
|
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 { Hooks } from 'react-table';
|
8
|
-
export declare const getNewSortOrder: (sortOrder?: boolean | string) => {
|
9
|
-
newSortDesc: boolean;
|
1
|
+
export function getNewSortOrder(sortOrder: any): {
|
2
|
+
newSortDesc: undefined;
|
10
3
|
newOrder: string;
|
11
4
|
};
|
12
|
-
declare const useSortableColumns: (hooks: Hooks) => void;
|
13
5
|
export default useSortableColumns;
|
6
|
+
declare function useSortableColumns(hooks: any): void;
|
@@ -22,7 +22,7 @@ var ordering = {
|
|
22
22
|
};
|
23
23
|
var getNewSortOrder = function getNewSortOrder(sortOrder) {
|
24
24
|
var order = {
|
25
|
-
newSortDesc:
|
25
|
+
newSortDesc: undefined,
|
26
26
|
newOrder: ordering.NONE
|
27
27
|
};
|
28
28
|
if (sortOrder === false || sortOrder === ordering.DESC) {
|
@@ -137,8 +137,7 @@ var useSortableColumns = function useSortableColumns(hooks) {
|
|
137
137
|
return (_instance$customizeCo = instance.customizeColumnsProps) !== null && _instance$customizeCo !== void 0 && _instance$customizeCo.isTearsheetOpen ? visibleColumns : _toConsumableArray(sortableColumns);
|
138
138
|
};
|
139
139
|
var sortInstanceProps = function sortInstanceProps(instance) {
|
140
|
-
var
|
141
|
-
onSort = _ref3.onSort;
|
140
|
+
var onSort = instance.onSort;
|
142
141
|
Object.assign(instance, {
|
143
142
|
manualSortBy: !!onSort,
|
144
143
|
isTableSortable: true
|
@@ -1,8 +1 @@
|
|
1
|
-
|
2
|
-
* Copyright IBM Corp. 2023, 2023
|
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 { Row } from 'react-table';
|
8
|
-
export declare const getAutoSizedColumnWidth: (rows: Array<Row<object>>, accessor: string, headerText: string) => number;
|
1
|
+
export function getAutoSizedColumnWidth(rows: Array<object>, accessor: string, headerText: string): number;
|
@@ -14,6 +14,13 @@ import { toConsumableArray as _toConsumableArray } from '../../../_virtual/_roll
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
15
15
|
*/
|
16
16
|
|
17
|
+
/**
|
18
|
+
* Calculates the auto sized width of a column
|
19
|
+
* @param {Array<object>} rows - The datagrid rows
|
20
|
+
* @param {string} accessor - The accessor for the column
|
21
|
+
* @param {string} headerText - The header text for the column
|
22
|
+
*/
|
23
|
+
|
17
24
|
var getAutoSizedColumnWidth = function getAutoSizedColumnWidth(rows, accessor, headerText) {
|
18
25
|
var maxWidth = 400;
|
19
26
|
var minWidth = 58;
|
@@ -11,7 +11,7 @@ type SidePanelBaseProps = {
|
|
11
11
|
/**
|
12
12
|
* Sets the action toolbar buttons
|
13
13
|
*/
|
14
|
-
actionToolbarButtons?: ButtonProps
|
14
|
+
actionToolbarButtons?: ButtonProps[];
|
15
15
|
/**
|
16
16
|
* The primary actions to be shown in the side panel. Each action is
|
17
17
|
* specified as an object that will render expressive Buttons. Any Button
|
@@ -20,7 +20,7 @@ type SidePanelBaseProps = {
|
|
20
20
|
*
|
21
21
|
* See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
|
22
22
|
*/
|
23
|
-
actions?: ButtonProps
|
23
|
+
actions?: ButtonProps[];
|
24
24
|
/**
|
25
25
|
* Determines if the title will animate on scroll
|
26
26
|
*/
|
@@ -95,8 +95,7 @@ var SidePanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
95
95
|
var subtitleRef = useRef(null);
|
96
96
|
var previousState = usePreviousValue({
|
97
97
|
size: size,
|
98
|
-
open: open
|
99
|
-
currentStep: currentStep
|
98
|
+
open: open
|
100
99
|
});
|
101
100
|
var _useState3 = useState(-1),
|
102
101
|
_useState4 = _slicedToArray(_useState3, 2),
|
@@ -163,10 +162,9 @@ var SidePanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
163
162
|
if (sidePanelRef && panelRefValue) {
|
164
163
|
var _animatedScrollRef$cu;
|
165
164
|
var scrollableSection = (_animatedScrollRef$cu = animatedScrollRef.current) !== null && _animatedScrollRef$cu !== void 0 ? _animatedScrollRef$cu : innerContentRef.current;
|
166
|
-
if (
|
165
|
+
if (scrollableSection) {
|
167
166
|
scrollableSection.scrollTop = 0;
|
168
167
|
}
|
169
|
-
|
170
168
|
// The size of the panel has changed while it is still opened
|
171
169
|
// so we need to scroll it to the top and reset the header
|
172
170
|
// height css custom property
|
@@ -325,12 +323,12 @@ var SidePanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
325
323
|
if (primeFocusEl) {
|
326
324
|
primeFocusEl === null || primeFocusEl === void 0 || primeFocusEl.focus();
|
327
325
|
}
|
328
|
-
} else
|
326
|
+
} else {
|
329
327
|
firstElement === null || firstElement === void 0 || firstElement.focus();
|
330
328
|
}
|
331
329
|
}, 0);
|
332
330
|
}
|
333
|
-
}, [animationComplete, firstElement, open, selectorPrimaryFocus
|
331
|
+
}, [animationComplete, firstElement, open, selectorPrimaryFocus]);
|
334
332
|
var primaryActionContainerClassNames = cx(["".concat(blockClass, "__actions-container"), _defineProperty({}, "".concat(blockClass, "__actions-container--condensed"), condensedActions)]);
|
335
333
|
var mainPanelClassNames = cx([blockClass, className, "".concat(blockClass), "".concat(blockClass, "--").concat(size), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(blockClass, "--right-placement"), placement === 'right'), "".concat(blockClass, "--left-placement"), placement === 'left'), "".concat(blockClass, "--slide-in"), slideIn), "".concat(blockClass, "--has-slug"), slug), "".concat(blockClass, "--condensed-actions"), condensedActions), "".concat(blockClass, "--has-overlay"), includeOverlay)]);
|
336
334
|
var renderTitle = function renderTitle() {
|
@@ -450,7 +448,7 @@ var SidePanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
450
448
|
placement: placement,
|
451
449
|
shouldReduceMotion: shouldReduceMotion
|
452
450
|
},
|
453
|
-
onKeyDown:
|
451
|
+
onKeyDown: keyDownListener
|
454
452
|
}), /*#__PURE__*/React__default.createElement(React__default.Fragment, null, renderHeader(), renderMain()), /*#__PURE__*/React__default.createElement(MotionActionSet, {
|
455
453
|
actions: actions !== null && actions !== void 0 ? actions : [],
|
456
454
|
className: primaryActionContainerClassNames,
|
@@ -473,7 +471,6 @@ SidePanel.propTypes = {
|
|
473
471
|
/**
|
474
472
|
* Sets the action toolbar buttons
|
475
473
|
*/
|
476
|
-
/**@ts-ignore */
|
477
474
|
actionToolbarButtons: PropTypes.arrayOf(PropTypes.shape({
|
478
475
|
label: PropTypes.string,
|
479
476
|
leading: PropTypes.bool,
|
@@ -507,7 +504,6 @@ SidePanel.propTypes = {
|
|
507
504
|
label: PropTypes.string,
|
508
505
|
loading: PropTypes.bool,
|
509
506
|
// we duplicate this Button prop to improve the DocGen here
|
510
|
-
/**@ts-ignore */
|
511
507
|
onClick: Button.propTypes.onClick
|
512
508
|
})))]),
|
513
509
|
/**
|
@@ -6,23 +6,17 @@ declare function ConditionBlock(props: any): import("react/jsx-runtime").JSX.Ele
|
|
6
6
|
declare namespace ConditionBlock {
|
7
7
|
namespace propTypes {
|
8
8
|
let addConditionHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
9
|
-
let addConditionSubGroupHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
10
9
|
let aria: PropTypes.Requireable<object>;
|
11
10
|
let condition: PropTypes.Requireable<object>;
|
12
11
|
let conditionIndex: PropTypes.Requireable<number>;
|
13
12
|
let conjunction: PropTypes.Requireable<string>;
|
14
13
|
let group: PropTypes.Requireable<object>;
|
15
|
-
let hideConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
16
|
-
let hideConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
17
14
|
let isLastCondition: PropTypes.Requireable<(...args: any[]) => any>;
|
18
15
|
let isStatement: PropTypes.Requireable<boolean>;
|
19
16
|
let onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
20
17
|
let onConnectorOperatorChange: PropTypes.Requireable<(...args: any[]) => any>;
|
21
18
|
let onRemove: PropTypes.Requireable<(...args: any[]) => any>;
|
22
19
|
let onStatementChange: PropTypes.Requireable<(...args: any[]) => any>;
|
23
|
-
let showConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
24
|
-
let showConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
25
|
-
let state: PropTypes.Requireable<object>;
|
26
20
|
}
|
27
21
|
}
|
28
22
|
import PropTypes from 'prop-types';
|
@@ -17,7 +17,7 @@ var index = require('../../../node_modules/prop-types/index.js');
|
|
17
17
|
var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
|
18
18
|
var ConditionBuilderItemOption = require('../ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js');
|
19
19
|
var cx = require('classnames');
|
20
|
-
var ConditionConnector = require('../
|
20
|
+
var ConditionConnector = require('../ConditionConnector/ConditionConnector.js');
|
21
21
|
var ConditionBuilderItemNumber = require('../ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js');
|
22
22
|
var ConditionBuilderItemText = require('../ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js');
|
23
23
|
var ConditionBuilderItemDate = require('../ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js');
|
@@ -32,7 +32,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
32
32
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
33
33
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
34
34
|
|
35
|
-
var _div;
|
36
35
|
/**
|
37
36
|
* This component build each block of condition consisting of property, operator value and close button.
|
38
37
|
*/
|
@@ -50,19 +49,11 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
50
49
|
isStatement = props.isStatement,
|
51
50
|
group = props.group,
|
52
51
|
onStatementChange = props.onStatementChange,
|
53
|
-
conditionIndex = props.conditionIndex,
|
54
52
|
addConditionHandler = props.addConditionHandler,
|
55
|
-
|
56
|
-
aria = props.aria,
|
57
|
-
hideConditionSubGroupPreviewHandler = props.hideConditionSubGroupPreviewHandler,
|
58
|
-
showConditionSubGroupPreviewHandler = props.showConditionSubGroupPreviewHandler,
|
59
|
-
hideConditionPreviewHandler = props.hideConditionPreviewHandler,
|
60
|
-
showConditionPreviewHandler = props.showConditionPreviewHandler,
|
53
|
+
conditionIndex = props.conditionIndex,
|
61
54
|
isLastCondition = props.isLastCondition;
|
62
55
|
var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
|
63
|
-
inputConfig = _useContext.inputConfig
|
64
|
-
variant = _useContext.variant;
|
65
|
-
//Below possible input types expected for value field.
|
56
|
+
inputConfig = _useContext.inputConfig;
|
66
57
|
var itemComponents = {
|
67
58
|
option: ConditionBuilderItemOption.ConditionBuilderItemOption,
|
68
59
|
text: ConditionBuilderItemText.ConditionBuilderItemText,
|
@@ -87,17 +78,14 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
87
78
|
type = _getCurrentConfig.type,
|
88
79
|
config = _getCurrentConfig.config,
|
89
80
|
label = _getCurrentConfig.label;
|
90
|
-
var ItemComponent;
|
91
|
-
// if (type == 'custom') {
|
92
|
-
// ItemComponent = config.component;
|
93
|
-
// } else {
|
94
|
-
ItemComponent = property ? itemComponents[type] : null;
|
95
|
-
//}
|
96
|
-
|
81
|
+
var ItemComponent = property ? itemComponents[type] : null;
|
97
82
|
var onStatementChangeHandler = function onStatementChangeHandler(v, evt) {
|
98
83
|
util.focusThisField(evt);
|
99
84
|
onStatementChange(v);
|
100
85
|
};
|
86
|
+
var onConnectorOperatorChangeHandler = function onConnectorOperatorChangeHandler(op) {
|
87
|
+
onConnectorOperatorChange(op);
|
88
|
+
};
|
101
89
|
var onPropertyChangeHandler = function onPropertyChangeHandler(newProperty) {
|
102
90
|
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, condition), {}, {
|
103
91
|
property: newProperty,
|
@@ -130,32 +118,21 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
130
118
|
return operator.type.indexOf(type) != -1 || operator.type == 'all';
|
131
119
|
});
|
132
120
|
};
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
'aria-posinset': aria.posinset,
|
137
|
-
'aria-setsize': aria.setsize
|
138
|
-
} : {};
|
139
|
-
};
|
140
|
-
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
141
|
-
className: cx__default["default"]("".concat(DataConfigs.blockClass, "__condition-block"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__condition__deletion-preview"), showDeletionPreview), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__gap-bottom"), variant == 'tree' && !(conditionIndex + 1 >= group.conditions.length)), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-bottom"), variant == 'sentence')),
|
121
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
122
|
+
className: cx__default["default"]("".concat(DataConfigs.blockClass, "__condition-block conditionBlockWrapper ").concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-bottom"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__condition__deletion-preview"), showDeletionPreview)),
|
123
|
+
key: conditionIndex,
|
142
124
|
role: "row",
|
143
125
|
"aria-label": DataConfigs.translateWithId('condition_row'),
|
144
126
|
tabIndex: -1
|
145
|
-
},
|
146
|
-
|
147
|
-
|
148
|
-
onChange: function onChange(op) {
|
149
|
-
return onConnectorOperatorChange(op);
|
150
|
-
}
|
151
|
-
}) : _div || (_div = /*#__PURE__*/React__default["default"].createElement("div", {
|
152
|
-
role: "gridcell"
|
153
|
-
})), isStatement && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
127
|
+
}, isStatement && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem
|
128
|
+
// open={false}
|
129
|
+
, {
|
154
130
|
label: group.statement,
|
155
131
|
title: DataConfigs.translateWithId('condition'),
|
156
132
|
"data-name": "connectorField",
|
157
133
|
popOverClassName: "".concat(DataConfigs.blockClass, "__gap"),
|
158
|
-
className: "".concat(DataConfigs.blockClass, "__statement-button")
|
134
|
+
className: "".concat(DataConfigs.blockClass, "__statement-button"),
|
135
|
+
tabIndex: 0
|
159
136
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItemOption.ConditionBuilderItemOption, {
|
160
137
|
conditionState: {
|
161
138
|
value: group.statement,
|
@@ -165,7 +142,11 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
165
142
|
config: {
|
166
143
|
options: DataConfigs.statementConfig
|
167
144
|
}
|
168
|
-
})), /*#__PURE__*/React__default["default"].createElement(
|
145
|
+
})), conjunction && /*#__PURE__*/React__default["default"].createElement(ConditionConnector["default"], {
|
146
|
+
className: "".concat(DataConfigs.blockClass, "__gap"),
|
147
|
+
operator: conjunction,
|
148
|
+
onChange: onConnectorOperatorChangeHandler
|
149
|
+
}), /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
169
150
|
label: label,
|
170
151
|
title: DataConfigs.translateWithId('property'),
|
171
152
|
renderIcon: icon !== null && icon !== void 0 ? icon : null,
|
@@ -212,8 +193,7 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
212
193
|
value: value
|
213
194
|
},
|
214
195
|
onChange: onValueChangeHandler,
|
215
|
-
config: config
|
216
|
-
"data-name": "valueField"
|
196
|
+
config: config
|
217
197
|
})), /*#__PURE__*/React__default["default"].createElement("span", {
|
218
198
|
role: "gridcell",
|
219
199
|
"aria-label": DataConfigs.translateWithId('remove_condition')
|
@@ -231,15 +211,9 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
231
211
|
})), isLastCondition(conditionIndex, group.conditions) && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderAdd["default"], {
|
232
212
|
onClick: function onClick() {
|
233
213
|
addConditionHandler(conditionIndex);
|
234
|
-
}
|
235
|
-
addConditionSubGroupHandler
|
236
|
-
|
237
|
-
},
|
238
|
-
showConditionSubGroupPreviewHandler: showConditionSubGroupPreviewHandler,
|
239
|
-
hideConditionSubGroupPreviewHandler: hideConditionSubGroupPreviewHandler,
|
240
|
-
enableSubGroup: variant == 'tree',
|
241
|
-
showConditionPreviewHandler: showConditionPreviewHandler,
|
242
|
-
hideConditionPreviewHandler: hideConditionPreviewHandler,
|
214
|
+
}
|
215
|
+
//addConditionSubGroupHandler={()=>{addConditionSubGroupHandler(conditionIndex)}}
|
216
|
+
,
|
243
217
|
className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-left")
|
244
218
|
}));
|
245
219
|
};
|
@@ -249,15 +223,17 @@ ConditionBlock.propTypes = {
|
|
249
223
|
* callback to add a new condition
|
250
224
|
*/
|
251
225
|
addConditionHandler: index["default"].func,
|
252
|
-
/**
|
253
|
-
* callback to add a new condition subgroup
|
254
|
-
*/
|
255
|
-
addConditionSubGroupHandler: index["default"].func,
|
256
226
|
/**
|
257
227
|
* object hold aria attributes
|
258
228
|
*/
|
259
229
|
aria: index["default"].object,
|
230
|
+
/**
|
231
|
+
* object that hold the current condition
|
232
|
+
*/
|
260
233
|
condition: index["default"].object,
|
234
|
+
/**
|
235
|
+
* index of the current condition
|
236
|
+
*/
|
261
237
|
conditionIndex: index["default"].number,
|
262
238
|
/**
|
263
239
|
* string that decides to show the condition connector
|
@@ -268,13 +244,8 @@ ConditionBlock.propTypes = {
|
|
268
244
|
*/
|
269
245
|
group: index["default"].object,
|
270
246
|
/**
|
271
|
-
*
|
272
|
-
*/
|
273
|
-
hideConditionPreviewHandler: index["default"].func,
|
274
|
-
/**
|
275
|
-
* handler for hiding sub group preview
|
247
|
+
* callback to add a new condition
|
276
248
|
*/
|
277
|
-
hideConditionSubGroupPreviewHandler: index["default"].func,
|
278
249
|
isLastCondition: index["default"].func,
|
279
250
|
/**
|
280
251
|
* boolean that decides to show the statement(if/ excl.if)
|
@@ -295,19 +266,7 @@ ConditionBlock.propTypes = {
|
|
295
266
|
/**
|
296
267
|
* callback to handle the statement(if/ excl.if) change
|
297
268
|
*/
|
298
|
-
onStatementChange: index["default"].func
|
299
|
-
/**
|
300
|
-
* handler for showing add condition preview
|
301
|
-
*/
|
302
|
-
showConditionPreviewHandler: index["default"].func,
|
303
|
-
/**
|
304
|
-
* handler for showing sub group preview
|
305
|
-
*/
|
306
|
-
showConditionSubGroupPreviewHandler: index["default"].func,
|
307
|
-
/**
|
308
|
-
* object that hold the current condition
|
309
|
-
*/
|
310
|
-
state: index["default"].object
|
269
|
+
onStatementChange: index["default"].func
|
311
270
|
};
|
312
271
|
|
313
272
|
exports["default"] = ConditionBlock$1;
|
@@ -1,26 +1,12 @@
|
|
1
1
|
export default ConditionBuilderAdd;
|
2
|
-
declare function ConditionBuilderAdd({ className, onClick
|
2
|
+
declare function ConditionBuilderAdd({ className, onClick }: {
|
3
3
|
className: any;
|
4
4
|
onClick: any;
|
5
|
-
addConditionSubGroupHandler: any;
|
6
|
-
showConditionSubGroupPreviewHandler: any;
|
7
|
-
hideConditionSubGroupPreviewHandler: any;
|
8
|
-
showConditionPreviewHandler: any;
|
9
|
-
hideConditionPreviewHandler: any;
|
10
|
-
enableSubGroup: any;
|
11
|
-
buttonLabel: any;
|
12
5
|
}): import("react/jsx-runtime").JSX.Element;
|
13
6
|
declare namespace ConditionBuilderAdd {
|
14
7
|
namespace propTypes {
|
15
|
-
let addConditionSubGroupHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
16
|
-
let buttonLabel: PropTypes.Requireable<string>;
|
17
8
|
let className: PropTypes.Requireable<string>;
|
18
|
-
let enableSubGroup: PropTypes.Requireable<boolean>;
|
19
|
-
let hideConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
20
|
-
let hideConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
21
9
|
let onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
22
|
-
let showConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
23
|
-
let showConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
24
10
|
}
|
25
11
|
}
|
26
12
|
import PropTypes from 'prop-types';
|