@carbon/ibm-products 2.43.2-canary.244 → 2.43.2-canary.246
Sign up to get free protection for your applications and to get access to all the features.
- package/es/components/Datagrid/Datagrid/DatagridToolbar.js +12 -1
- package/es/components/Datagrid/types/index.d.ts +4 -0
- package/es/components/ExportModal/ExportModal.js +3 -0
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +12 -1
- package/lib/components/Datagrid/types/index.d.ts +4 -0
- package/lib/components/ExportModal/ExportModal.js +3 -0
- package/package.json +2 -2
@@ -40,9 +40,20 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
|
|
40
40
|
getRowId = datagridState.getRowId,
|
41
41
|
batchActionMenuButtonLabel = datagridState.batchActionMenuButtonLabel,
|
42
42
|
translateWithIdBatchActions = datagridState.translateWithIdBatchActions;
|
43
|
+
var _useState7 = useState(rows.length),
|
44
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
45
|
+
availableRowsCount = _useState8[0],
|
46
|
+
setAvailableRowsCount = _useState8[1];
|
43
47
|
var batchActionMenuButtonLabelText = batchActionMenuButtonLabel !== null && batchActionMenuButtonLabel !== void 0 ? batchActionMenuButtonLabel : 'More';
|
44
48
|
var selectedKeys = Object.keys(selectedRowIds || {});
|
45
49
|
var totalSelected = selectedKeys.length;
|
50
|
+
useEffect(function () {
|
51
|
+
var _rows$find, _rows$find$getRowProp;
|
52
|
+
var countDisabledRows = ((_rows$find = rows.find(function (row) {
|
53
|
+
return row.getRowProps;
|
54
|
+
})) === null || _rows$find === void 0 || (_rows$find$getRowProp = _rows$find.getRowProps) === null || _rows$find$getRowProp === void 0 || (_rows$find$getRowProp = _rows$find$getRowProp.call(_rows$find)) === null || _rows$find$getRowProp === void 0 || (_rows$find$getRowProp = _rows$find$getRowProp.nonselectablerows) === null || _rows$find$getRowProp === void 0 ? void 0 : _rows$find$getRowProp.length) || 0;
|
55
|
+
rows && setAvailableRowsCount(rows.length - countDisabledRows);
|
56
|
+
}, [rows]);
|
46
57
|
|
47
58
|
// Get initial width of batch actions container,
|
48
59
|
// used to measure when all items are put inside
|
@@ -145,7 +156,7 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
|
|
145
156
|
totalSelected: totalSelected,
|
146
157
|
onCancel: onCancelHandler,
|
147
158
|
onSelectAll: onSelectAllHandler,
|
148
|
-
totalCount:
|
159
|
+
totalCount: availableRowsCount,
|
149
160
|
translateWithId: translateWithIdBatchActions
|
150
161
|
}, !displayAllInMenu && toolbarBatchActions && (toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.map(function (batchAction, index) {
|
151
162
|
if (!toolbarBatchActionsDisplayMin && index < 2 && toolbarBatchActions.length > 3 || index < 3 && toolbarBatchActions.length <= 3 || toolbarBatchActionsDisplayMin !== undefined && index < toolbarBatchActionsDisplayMin) {
|
@@ -11,6 +11,7 @@ import { RadioButtonProps } from '@carbon/react/lib/components/RadioButton/Radio
|
|
11
11
|
import { RadioButtonGroupProps } from '@carbon/react/lib/components/RadioButtonGroup/RadioButtonGroup';
|
12
12
|
import { CheckboxProps } from '@carbon/react/lib/components/Checkbox';
|
13
13
|
import { NumberInputProps } from '@carbon/react/lib/components/NumberInput/NumberInput';
|
14
|
+
import { TableRowProps } from 'react-table';
|
14
15
|
import React, { CSSProperties, ComponentType, FunctionComponent, JSXElementConstructor, MutableRefObject, ReactNode, TouchEventHandler } from 'react';
|
15
16
|
import { Cell, Column, ColumnInstance, FilterValue, Filters, HeaderGroup, Meta, Row, TableCommonProps, TableDispatch, TableInstance, TableState, TableToggleAllRowsSelectedProps, UseExpandedRowProps, UseFiltersInstanceProps, UsePaginationInstanceProps, UseResizeColumnsColumnProps, UseResizeColumnsOptions, UseResizeColumnsState, UseRowSelectInstanceProps, UseRowSelectRowProps, UseRowSelectState, UseSortByColumnProps, UseSortByOptions, UseTableHooks } from 'react-table';
|
16
17
|
import { CarbonIconType } from '@carbon/react/icons';
|
@@ -276,4 +277,7 @@ export interface PropGetterMeta {
|
|
276
277
|
instance?: DataGridTableInstance;
|
277
278
|
row?: Partial<Row<any> & DatagridRow<any>>;
|
278
279
|
}
|
280
|
+
export interface DatagridRowProps extends TableRowProps {
|
281
|
+
nonselectablerows: Array<number>;
|
282
|
+
}
|
279
283
|
export {};
|
@@ -168,8 +168,11 @@ var ExportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
168
168
|
hidePasswordLabel: hidePasswordLabel,
|
169
169
|
tooltipPosition: "left"
|
170
170
|
})))), /*#__PURE__*/React__default.createElement("div", {
|
171
|
+
"aria-live": "polite",
|
171
172
|
className: "".concat(blockClass, "__messaging")
|
172
173
|
}, loading && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, _Loading || (_Loading = /*#__PURE__*/React__default.createElement(Loading, {
|
174
|
+
"aria-live": "off",
|
175
|
+
description: "",
|
173
176
|
small: true,
|
174
177
|
withOverlay: false
|
175
178
|
})), /*#__PURE__*/React__default.createElement("p", null, loadingMessage)), successful && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(CheckmarkFilled, {
|
@@ -49,9 +49,20 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
|
|
49
49
|
getRowId = datagridState.getRowId,
|
50
50
|
batchActionMenuButtonLabel = datagridState.batchActionMenuButtonLabel,
|
51
51
|
translateWithIdBatchActions = datagridState.translateWithIdBatchActions;
|
52
|
+
var _useState7 = React.useState(rows.length),
|
53
|
+
_useState8 = _rollupPluginBabelHelpers.slicedToArray(_useState7, 2),
|
54
|
+
availableRowsCount = _useState8[0],
|
55
|
+
setAvailableRowsCount = _useState8[1];
|
52
56
|
var batchActionMenuButtonLabelText = batchActionMenuButtonLabel !== null && batchActionMenuButtonLabel !== void 0 ? batchActionMenuButtonLabel : 'More';
|
53
57
|
var selectedKeys = Object.keys(selectedRowIds || {});
|
54
58
|
var totalSelected = selectedKeys.length;
|
59
|
+
React.useEffect(function () {
|
60
|
+
var _rows$find, _rows$find$getRowProp;
|
61
|
+
var countDisabledRows = ((_rows$find = rows.find(function (row) {
|
62
|
+
return row.getRowProps;
|
63
|
+
})) === null || _rows$find === void 0 || (_rows$find$getRowProp = _rows$find.getRowProps) === null || _rows$find$getRowProp === void 0 || (_rows$find$getRowProp = _rows$find$getRowProp.call(_rows$find)) === null || _rows$find$getRowProp === void 0 || (_rows$find$getRowProp = _rows$find$getRowProp.nonselectablerows) === null || _rows$find$getRowProp === void 0 ? void 0 : _rows$find$getRowProp.length) || 0;
|
64
|
+
rows && setAvailableRowsCount(rows.length - countDisabledRows);
|
65
|
+
}, [rows]);
|
55
66
|
|
56
67
|
// Get initial width of batch actions container,
|
57
68
|
// used to measure when all items are put inside
|
@@ -154,7 +165,7 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
|
|
154
165
|
totalSelected: totalSelected,
|
155
166
|
onCancel: onCancelHandler,
|
156
167
|
onSelectAll: onSelectAllHandler,
|
157
|
-
totalCount:
|
168
|
+
totalCount: availableRowsCount,
|
158
169
|
translateWithId: translateWithIdBatchActions
|
159
170
|
}, !displayAllInMenu && toolbarBatchActions && (toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.map(function (batchAction, index) {
|
160
171
|
if (!toolbarBatchActionsDisplayMin && index < 2 && toolbarBatchActions.length > 3 || index < 3 && toolbarBatchActions.length <= 3 || toolbarBatchActionsDisplayMin !== undefined && index < toolbarBatchActionsDisplayMin) {
|
@@ -11,6 +11,7 @@ import { RadioButtonProps } from '@carbon/react/lib/components/RadioButton/Radio
|
|
11
11
|
import { RadioButtonGroupProps } from '@carbon/react/lib/components/RadioButtonGroup/RadioButtonGroup';
|
12
12
|
import { CheckboxProps } from '@carbon/react/lib/components/Checkbox';
|
13
13
|
import { NumberInputProps } from '@carbon/react/lib/components/NumberInput/NumberInput';
|
14
|
+
import { TableRowProps } from 'react-table';
|
14
15
|
import React, { CSSProperties, ComponentType, FunctionComponent, JSXElementConstructor, MutableRefObject, ReactNode, TouchEventHandler } from 'react';
|
15
16
|
import { Cell, Column, ColumnInstance, FilterValue, Filters, HeaderGroup, Meta, Row, TableCommonProps, TableDispatch, TableInstance, TableState, TableToggleAllRowsSelectedProps, UseExpandedRowProps, UseFiltersInstanceProps, UsePaginationInstanceProps, UseResizeColumnsColumnProps, UseResizeColumnsOptions, UseResizeColumnsState, UseRowSelectInstanceProps, UseRowSelectRowProps, UseRowSelectState, UseSortByColumnProps, UseSortByOptions, UseTableHooks } from 'react-table';
|
16
17
|
import { CarbonIconType } from '@carbon/react/icons';
|
@@ -276,4 +277,7 @@ export interface PropGetterMeta {
|
|
276
277
|
instance?: DataGridTableInstance;
|
277
278
|
row?: Partial<Row<any> & DatagridRow<any>>;
|
278
279
|
}
|
280
|
+
export interface DatagridRowProps extends TableRowProps {
|
281
|
+
nonselectablerows: Array<number>;
|
282
|
+
}
|
279
283
|
export {};
|
@@ -177,8 +177,11 @@ exports.ExportModal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
177
177
|
hidePasswordLabel: hidePasswordLabel,
|
178
178
|
tooltipPosition: "left"
|
179
179
|
})))), /*#__PURE__*/React__default["default"].createElement("div", {
|
180
|
+
"aria-live": "polite",
|
180
181
|
className: "".concat(blockClass, "__messaging")
|
181
182
|
}, loading && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, _Loading || (_Loading = /*#__PURE__*/React__default["default"].createElement(react.Loading, {
|
183
|
+
"aria-live": "off",
|
184
|
+
description: "",
|
182
185
|
small: true,
|
183
186
|
withOverlay: false
|
184
187
|
})), /*#__PURE__*/React__default["default"].createElement("p", null, loadingMessage)), successful && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(icons.CheckmarkFilled, {
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@carbon/ibm-products",
|
3
3
|
"description": "Carbon for IBM Products",
|
4
|
-
"version": "2.43.2-canary.
|
4
|
+
"version": "2.43.2-canary.246+ec3dead1b",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -120,5 +120,5 @@
|
|
120
120
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0",
|
121
121
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
|
122
122
|
},
|
123
|
-
"gitHead": "
|
123
|
+
"gitHead": "ec3dead1b2dd6c727e09bcd0356d567721d5209f"
|
124
124
|
}
|