@carbon/ibm-products 2.31.0-alpha.5 → 2.31.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +6 -0
- 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 +6 -0
- 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 +6 -0
- 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 +6 -0
- 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/CreateModal/CreateModal.d.ts +66 -2
- package/es/components/CreateModal/CreateModal.js +1 -1
- package/es/components/Datagrid/Datagrid/DatagridContent.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.d.ts +3 -1
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +4 -1
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +3 -15
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/common.js +0 -7
- package/lib/components/CreateModal/CreateModal.d.ts +66 -2
- package/lib/components/CreateModal/CreateModal.js +1 -1
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.d.ts +3 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +4 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +3 -15
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/common.js +0 -7
- package/package.json +3 -3
- package/scss/components/Datagrid/styles/_draggableElement.scss +5 -1
@@ -1,8 +1,72 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2021, 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
|
+
/// <reference path="../../../src/custom-typings/index.d.ts" />
|
8
|
+
import React, { ReactNode } from 'react';
|
9
|
+
import { ComposedModal } from '@carbon/react';
|
10
|
+
interface CreateModalProps extends React.ComponentProps<typeof ComposedModal> {
|
11
|
+
/**
|
12
|
+
* Specify an optional className to be applied to the modal root node
|
13
|
+
*/
|
14
|
+
className?: string;
|
15
|
+
/**
|
16
|
+
* Specifies an optional handler which is called when the CreateModal
|
17
|
+
* is closed.
|
18
|
+
*/
|
19
|
+
onRequestClose?(): void;
|
20
|
+
/**
|
21
|
+
* Specifies an optional handler which is called when the CreateModal
|
22
|
+
* primary button is pressed.
|
23
|
+
*/
|
24
|
+
onRequestSubmit?(): void;
|
25
|
+
/**
|
26
|
+
* Specifies whether the CreateModal is open or not.
|
27
|
+
*/
|
28
|
+
open?: boolean;
|
29
|
+
/**
|
30
|
+
* The title of the CreateModal is usually the product or service name.
|
31
|
+
*/
|
32
|
+
title: ReactNode;
|
33
|
+
/**
|
34
|
+
* The subtitle of the CreateModal is optional and serves to provide more information about the modal.
|
35
|
+
*/
|
36
|
+
subtitle?: ReactNode;
|
37
|
+
/**
|
38
|
+
* The description of the CreateModal serves to provide more information about the modal.
|
39
|
+
*/
|
40
|
+
description: ReactNode;
|
41
|
+
/**
|
42
|
+
* Specifies the secondary button's text in the modal.
|
43
|
+
*/
|
44
|
+
secondaryButtonText: string;
|
45
|
+
/**
|
46
|
+
* The DOM node the tearsheet should be rendered within. Defaults to document.body.
|
47
|
+
*/
|
48
|
+
portalTarget?: ReactNode;
|
49
|
+
/**
|
50
|
+
* Specifies the primary button's text in the modal.
|
51
|
+
*/
|
52
|
+
primaryButtonText: string;
|
53
|
+
/**
|
54
|
+
* Specifies a boolean for disabling or enabling the primary button. This is important for form validation
|
55
|
+
* Returning `true` prevents the primary button from being clicked until required fields are completed.
|
56
|
+
*/
|
57
|
+
disableSubmit?: boolean;
|
58
|
+
/**
|
59
|
+
* Specifies which DOM element in the form should be focused.
|
60
|
+
*/
|
61
|
+
selectorPrimaryFocus: ReactNode;
|
62
|
+
}
|
1
63
|
/**
|
2
64
|
* The `CreateModal` component provides a way for a user to quickly generate a new
|
3
65
|
resource. It is triggered by a user’s action, appears on top of the main page
|
4
66
|
content, and is persistent until dismissed. The purpose of this modal should be
|
5
67
|
immediately apparent to the user, with a clear and obvious path to completion.
|
6
68
|
*/
|
7
|
-
export let CreateModal: React.ForwardRefExoticComponent<
|
8
|
-
|
69
|
+
export declare let CreateModal: React.ForwardRefExoticComponent<CreateModalProps & {
|
70
|
+
children?: React.ReactNode;
|
71
|
+
} & React.RefAttributes<unknown>>;
|
72
|
+
export {};
|
@@ -28,7 +28,6 @@ var isValidChildren = function isValidChildren() {
|
|
28
28
|
return;
|
29
29
|
};
|
30
30
|
};
|
31
|
-
|
32
31
|
/**
|
33
32
|
* The `CreateModal` component provides a way for a user to quickly generate a new
|
34
33
|
resource. It is triggered by a user’s action, appears on top of the main page
|
@@ -93,6 +92,7 @@ CreateModal.propTypes = {
|
|
93
92
|
/**
|
94
93
|
* Children refers to all form items within a form inside of the modal's body.
|
95
94
|
*/
|
95
|
+
/**@ts-ignore*/
|
96
96
|
children: isValidChildren(),
|
97
97
|
/**
|
98
98
|
* Specify an optional className to be applied to the modal root node
|
@@ -87,7 +87,7 @@ var DatagridContent = function DatagridContent(_ref) {
|
|
87
87
|
var renderTable = function renderTable() {
|
88
88
|
var _getTableProps;
|
89
89
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Table, _extends({}, getTableProps(), {
|
90
|
-
className: cx(withVirtualScroll ? '' : "".concat(blockClass, "__table-simple"), "".concat(blockClass, "__vertical-align-").concat(verticalAlign), _defineProperty({}, "".concat(blockClass, "__variable-row-height"), variableRowHeight), _defineProperty({}, "".concat(blockClass, "__table-with-inline-edit"), withInlineEdit), _defineProperty({}, "".concat(blockClass, "__table-grid-active"), gridActive), _defineProperty({}, "".concat(blockClass, "__table-is-resizing"), typeof columnResizing.isResizingColumn === 'string'), (_getTableProps = getTableProps()) === null || _getTableProps === void 0 ? void 0 : _getTableProps.className),
|
90
|
+
className: cx(withVirtualScroll ? '' : "".concat(blockClass, "__table-simple"), "".concat(blockClass, "__vertical-align-").concat(verticalAlign), _defineProperty({}, "".concat(blockClass, "__variable-row-height"), variableRowHeight), _defineProperty({}, "".concat(blockClass, "__table-with-inline-edit"), withInlineEdit), _defineProperty({}, "".concat(blockClass, "__table-grid-active"), gridActive), _defineProperty({}, "".concat(blockClass, "__table-is-resizing"), typeof (columnResizing === null || columnResizing === void 0 ? void 0 : columnResizing.isResizingColumn) === 'string'), (_getTableProps = getTableProps()) === null || _getTableProps === void 0 ? void 0 : _getTableProps.className),
|
91
91
|
role: withInlineEdit ? 'grid' : undefined,
|
92
92
|
tabIndex: withInlineEdit ? 0 : -1,
|
93
93
|
onKeyDown: /* istanbul ignore next */
|
@@ -1,5 +1,5 @@
|
|
1
1
|
export default Columns;
|
2
|
-
declare function Columns({ getVisibleColumnsCount, filterString, columns, setColumnsObject, onSelectColumn, assistiveTextInstructionsLabel, assistiveTextDisabledInstructionsLabel, selectAllLabel, }: {
|
2
|
+
declare function Columns({ getVisibleColumnsCount, filterString, columns, setColumnsObject, onSelectColumn, assistiveTextInstructionsLabel, assistiveTextDisabledInstructionsLabel, selectAllLabel, customizeTearsheetHeadingLabel }: {
|
3
3
|
getVisibleColumnsCount: any;
|
4
4
|
filterString: any;
|
5
5
|
columns: any;
|
@@ -8,12 +8,14 @@ declare function Columns({ getVisibleColumnsCount, filterString, columns, setCol
|
|
8
8
|
assistiveTextInstructionsLabel: any;
|
9
9
|
assistiveTextDisabledInstructionsLabel: any;
|
10
10
|
selectAllLabel: any;
|
11
|
+
customizeTearsheetHeadingLabel: any;
|
11
12
|
}): import("react/jsx-runtime").JSX.Element;
|
12
13
|
declare namespace Columns {
|
13
14
|
namespace propTypes {
|
14
15
|
let assistiveTextDisabledInstructionsLabel: PropTypes.Requireable<string>;
|
15
16
|
let assistiveTextInstructionsLabel: PropTypes.Requireable<string>;
|
16
17
|
let columns: PropTypes.Validator<any[]>;
|
18
|
+
let customizeTearsheetHeadingLabel: PropTypes.Requireable<string>;
|
17
19
|
let disabledInstructionsLabel: PropTypes.Requireable<string>;
|
18
20
|
let filterString: PropTypes.Validator<string>;
|
19
21
|
let getVisibleColumnsCount: PropTypes.Validator<(...args: any[]) => any>;
|
@@ -24,7 +24,8 @@ var Columns = function Columns(_ref) {
|
|
24
24
|
onSelectColumn = _ref.onSelectColumn,
|
25
25
|
assistiveTextInstructionsLabel = _ref.assistiveTextInstructionsLabel,
|
26
26
|
assistiveTextDisabledInstructionsLabel = _ref.assistiveTextDisabledInstructionsLabel,
|
27
|
-
selectAllLabel = _ref.selectAllLabel
|
27
|
+
selectAllLabel = _ref.selectAllLabel,
|
28
|
+
customizeTearsheetHeadingLabel = _ref.customizeTearsheetHeadingLabel;
|
28
29
|
var listId = useRef(uuidv4()); // keep id between renders
|
29
30
|
var listRef = useRef(null);
|
30
31
|
var _React$useState = React__default.useState(''),
|
@@ -47,6 +48,7 @@ var Columns = function Columns(_ref) {
|
|
47
48
|
}, /*#__PURE__*/React__default.createElement("ol", {
|
48
49
|
className: "".concat(blockClass, "__customize-columns-column-list--focus"),
|
49
50
|
role: "listbox",
|
51
|
+
"aria-label": customizeTearsheetHeadingLabel,
|
50
52
|
"aria-describedby": "".concat(blockClass, "__customize-columns--instructions"),
|
51
53
|
tabIndex: 0
|
52
54
|
}, /*#__PURE__*/React__default.createElement("span", {
|
@@ -81,6 +83,7 @@ Columns.propTypes = {
|
|
81
83
|
assistiveTextDisabledInstructionsLabel: PropTypes.string,
|
82
84
|
assistiveTextInstructionsLabel: PropTypes.string,
|
83
85
|
columns: PropTypes.array.isRequired,
|
86
|
+
customizeTearsheetHeadingLabel: PropTypes.string,
|
84
87
|
disabledInstructionsLabel: PropTypes.string,
|
85
88
|
filterString: PropTypes.string.isRequired,
|
86
89
|
getVisibleColumnsCount: PropTypes.func.isRequired,
|
package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js
CHANGED
@@ -8,7 +8,6 @@
|
|
8
8
|
import { slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2 } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import React__default, { useState, useCallback, useEffect } from 'react';
|
10
10
|
import PropTypes from '../../../../../node_modules/prop-types/index.js';
|
11
|
-
import { isColumnVisible } from './common.js';
|
12
11
|
import Columns from './Columns.js';
|
13
12
|
import Actions from './Actions.js';
|
14
13
|
import { pkg } from '../../../../../settings.js';
|
@@ -51,19 +50,7 @@ var CustomizeColumnsTearsheet = function CustomizeColumnsTearsheet(_ref) {
|
|
51
50
|
_useState6 = _slicedToArray(_useState5, 2),
|
52
51
|
searchText = _useState6[0],
|
53
52
|
setSearchText = _useState6[1];
|
54
|
-
var _useState7 = useState(columnDefinitions
|
55
|
-
// only sort the hidden column to the end when modal reopen
|
56
|
-
.sort(function (defA, defB) {
|
57
|
-
var isVisibleA = isColumnVisible(defA);
|
58
|
-
var isVisibleB = isColumnVisible(defB);
|
59
|
-
if (isVisibleA && !isVisibleB) {
|
60
|
-
return -1;
|
61
|
-
}
|
62
|
-
if (!isVisibleA && isVisibleB) {
|
63
|
-
return 1;
|
64
|
-
}
|
65
|
-
return 0;
|
66
|
-
})),
|
53
|
+
var _useState7 = useState(columnDefinitions),
|
67
54
|
_useState8 = _slicedToArray(_useState7, 2),
|
68
55
|
columnObjects = _useState8[0],
|
69
56
|
setColumnObjects = _useState8[1];
|
@@ -149,7 +136,8 @@ var CustomizeColumnsTearsheet = function CustomizeColumnsTearsheet(_ref) {
|
|
149
136
|
setColumnObjects(cols);
|
150
137
|
setDirty();
|
151
138
|
},
|
152
|
-
selectAllLabel: selectAllLabel
|
139
|
+
selectAllLabel: selectAllLabel,
|
140
|
+
customizeTearsheetHeadingLabel: customizeTearsheetHeadingLabel
|
153
141
|
}));
|
154
142
|
};
|
155
143
|
CustomizeColumnsTearsheet.propTypes = {
|
@@ -7,13 +7,6 @@
|
|
7
7
|
|
8
8
|
import isBoolean from 'lodash/isBoolean';
|
9
9
|
|
10
|
-
/*
|
11
|
-
* Licensed Materials - Property of IBM
|
12
|
-
* 5724-Q36
|
13
|
-
* (c) Copyright IBM Corp. 2021
|
14
|
-
* US Government Users Restricted Rights - Use, duplication or disclosure
|
15
|
-
* restricted by GSA ADP Schedule Contract with IBM Corp.
|
16
|
-
*/
|
17
10
|
var isColumnVisible = function isColumnVisible(colDef) {
|
18
11
|
return isBoolean(colDef.isVisible) ? colDef.isVisible : true;
|
19
12
|
};
|
@@ -1,8 +1,72 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2021, 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
|
+
/// <reference path="../../../src/custom-typings/index.d.ts" />
|
8
|
+
import React, { ReactNode } from 'react';
|
9
|
+
import { ComposedModal } from '@carbon/react';
|
10
|
+
interface CreateModalProps extends React.ComponentProps<typeof ComposedModal> {
|
11
|
+
/**
|
12
|
+
* Specify an optional className to be applied to the modal root node
|
13
|
+
*/
|
14
|
+
className?: string;
|
15
|
+
/**
|
16
|
+
* Specifies an optional handler which is called when the CreateModal
|
17
|
+
* is closed.
|
18
|
+
*/
|
19
|
+
onRequestClose?(): void;
|
20
|
+
/**
|
21
|
+
* Specifies an optional handler which is called when the CreateModal
|
22
|
+
* primary button is pressed.
|
23
|
+
*/
|
24
|
+
onRequestSubmit?(): void;
|
25
|
+
/**
|
26
|
+
* Specifies whether the CreateModal is open or not.
|
27
|
+
*/
|
28
|
+
open?: boolean;
|
29
|
+
/**
|
30
|
+
* The title of the CreateModal is usually the product or service name.
|
31
|
+
*/
|
32
|
+
title: ReactNode;
|
33
|
+
/**
|
34
|
+
* The subtitle of the CreateModal is optional and serves to provide more information about the modal.
|
35
|
+
*/
|
36
|
+
subtitle?: ReactNode;
|
37
|
+
/**
|
38
|
+
* The description of the CreateModal serves to provide more information about the modal.
|
39
|
+
*/
|
40
|
+
description: ReactNode;
|
41
|
+
/**
|
42
|
+
* Specifies the secondary button's text in the modal.
|
43
|
+
*/
|
44
|
+
secondaryButtonText: string;
|
45
|
+
/**
|
46
|
+
* The DOM node the tearsheet should be rendered within. Defaults to document.body.
|
47
|
+
*/
|
48
|
+
portalTarget?: ReactNode;
|
49
|
+
/**
|
50
|
+
* Specifies the primary button's text in the modal.
|
51
|
+
*/
|
52
|
+
primaryButtonText: string;
|
53
|
+
/**
|
54
|
+
* Specifies a boolean for disabling or enabling the primary button. This is important for form validation
|
55
|
+
* Returning `true` prevents the primary button from being clicked until required fields are completed.
|
56
|
+
*/
|
57
|
+
disableSubmit?: boolean;
|
58
|
+
/**
|
59
|
+
* Specifies which DOM element in the form should be focused.
|
60
|
+
*/
|
61
|
+
selectorPrimaryFocus: ReactNode;
|
62
|
+
}
|
1
63
|
/**
|
2
64
|
* The `CreateModal` component provides a way for a user to quickly generate a new
|
3
65
|
resource. It is triggered by a user’s action, appears on top of the main page
|
4
66
|
content, and is persistent until dismissed. The purpose of this modal should be
|
5
67
|
immediately apparent to the user, with a clear and obvious path to completion.
|
6
68
|
*/
|
7
|
-
export let CreateModal: React.ForwardRefExoticComponent<
|
8
|
-
|
69
|
+
export declare let CreateModal: React.ForwardRefExoticComponent<CreateModalProps & {
|
70
|
+
children?: React.ReactNode;
|
71
|
+
} & React.RefAttributes<unknown>>;
|
72
|
+
export {};
|
@@ -37,7 +37,6 @@ var isValidChildren = function isValidChildren() {
|
|
37
37
|
return;
|
38
38
|
};
|
39
39
|
};
|
40
|
-
|
41
40
|
/**
|
42
41
|
* The `CreateModal` component provides a way for a user to quickly generate a new
|
43
42
|
resource. It is triggered by a user’s action, appears on top of the main page
|
@@ -102,6 +101,7 @@ exports.CreateModal.propTypes = {
|
|
102
101
|
/**
|
103
102
|
* Children refers to all form items within a form inside of the modal's body.
|
104
103
|
*/
|
104
|
+
/**@ts-ignore*/
|
105
105
|
children: isValidChildren(),
|
106
106
|
/**
|
107
107
|
* Specify an optional className to be applied to the modal root node
|
@@ -96,7 +96,7 @@ var DatagridContent = function DatagridContent(_ref) {
|
|
96
96
|
var renderTable = function renderTable() {
|
97
97
|
var _getTableProps;
|
98
98
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(react.Table, _rollupPluginBabelHelpers["extends"]({}, getTableProps(), {
|
99
|
-
className: cx__default["default"](withVirtualScroll ? '' : "".concat(blockClass, "__table-simple"), "".concat(blockClass, "__vertical-align-").concat(verticalAlign), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__variable-row-height"), variableRowHeight), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__table-with-inline-edit"), withInlineEdit), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__table-grid-active"), gridActive), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__table-is-resizing"), typeof columnResizing.isResizingColumn === 'string'), (_getTableProps = getTableProps()) === null || _getTableProps === void 0 ? void 0 : _getTableProps.className),
|
99
|
+
className: cx__default["default"](withVirtualScroll ? '' : "".concat(blockClass, "__table-simple"), "".concat(blockClass, "__vertical-align-").concat(verticalAlign), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__variable-row-height"), variableRowHeight), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__table-with-inline-edit"), withInlineEdit), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__table-grid-active"), gridActive), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__table-is-resizing"), typeof (columnResizing === null || columnResizing === void 0 ? void 0 : columnResizing.isResizingColumn) === 'string'), (_getTableProps = getTableProps()) === null || _getTableProps === void 0 ? void 0 : _getTableProps.className),
|
100
100
|
role: withInlineEdit ? 'grid' : undefined,
|
101
101
|
tabIndex: withInlineEdit ? 0 : -1,
|
102
102
|
onKeyDown: /* istanbul ignore next */
|
@@ -1,5 +1,5 @@
|
|
1
1
|
export default Columns;
|
2
|
-
declare function Columns({ getVisibleColumnsCount, filterString, columns, setColumnsObject, onSelectColumn, assistiveTextInstructionsLabel, assistiveTextDisabledInstructionsLabel, selectAllLabel, }: {
|
2
|
+
declare function Columns({ getVisibleColumnsCount, filterString, columns, setColumnsObject, onSelectColumn, assistiveTextInstructionsLabel, assistiveTextDisabledInstructionsLabel, selectAllLabel, customizeTearsheetHeadingLabel }: {
|
3
3
|
getVisibleColumnsCount: any;
|
4
4
|
filterString: any;
|
5
5
|
columns: any;
|
@@ -8,12 +8,14 @@ declare function Columns({ getVisibleColumnsCount, filterString, columns, setCol
|
|
8
8
|
assistiveTextInstructionsLabel: any;
|
9
9
|
assistiveTextDisabledInstructionsLabel: any;
|
10
10
|
selectAllLabel: any;
|
11
|
+
customizeTearsheetHeadingLabel: any;
|
11
12
|
}): import("react/jsx-runtime").JSX.Element;
|
12
13
|
declare namespace Columns {
|
13
14
|
namespace propTypes {
|
14
15
|
let assistiveTextDisabledInstructionsLabel: PropTypes.Requireable<string>;
|
15
16
|
let assistiveTextInstructionsLabel: PropTypes.Requireable<string>;
|
16
17
|
let columns: PropTypes.Validator<any[]>;
|
18
|
+
let customizeTearsheetHeadingLabel: PropTypes.Requireable<string>;
|
17
19
|
let disabledInstructionsLabel: PropTypes.Requireable<string>;
|
18
20
|
let filterString: PropTypes.Validator<string>;
|
19
21
|
let getVisibleColumnsCount: PropTypes.Validator<(...args: any[]) => any>;
|
@@ -34,7 +34,8 @@ var Columns = function Columns(_ref) {
|
|
34
34
|
onSelectColumn = _ref.onSelectColumn,
|
35
35
|
assistiveTextInstructionsLabel = _ref.assistiveTextInstructionsLabel,
|
36
36
|
assistiveTextDisabledInstructionsLabel = _ref.assistiveTextDisabledInstructionsLabel,
|
37
|
-
selectAllLabel = _ref.selectAllLabel
|
37
|
+
selectAllLabel = _ref.selectAllLabel,
|
38
|
+
customizeTearsheetHeadingLabel = _ref.customizeTearsheetHeadingLabel;
|
38
39
|
var listId = React.useRef(uuidv4["default"]()); // keep id between renders
|
39
40
|
var listRef = React.useRef(null);
|
40
41
|
var _React$useState = React__default["default"].useState(''),
|
@@ -57,6 +58,7 @@ var Columns = function Columns(_ref) {
|
|
57
58
|
}, /*#__PURE__*/React__default["default"].createElement("ol", {
|
58
59
|
className: "".concat(blockClass, "__customize-columns-column-list--focus"),
|
59
60
|
role: "listbox",
|
61
|
+
"aria-label": customizeTearsheetHeadingLabel,
|
60
62
|
"aria-describedby": "".concat(blockClass, "__customize-columns--instructions"),
|
61
63
|
tabIndex: 0
|
62
64
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
@@ -91,6 +93,7 @@ Columns.propTypes = {
|
|
91
93
|
assistiveTextDisabledInstructionsLabel: index["default"].string,
|
92
94
|
assistiveTextInstructionsLabel: index["default"].string,
|
93
95
|
columns: index["default"].array.isRequired,
|
96
|
+
customizeTearsheetHeadingLabel: index["default"].string,
|
94
97
|
disabledInstructionsLabel: index["default"].string,
|
95
98
|
filterString: index["default"].string.isRequired,
|
96
99
|
getVisibleColumnsCount: index["default"].func.isRequired,
|
package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js
CHANGED
@@ -12,7 +12,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
12
12
|
var _rollupPluginBabelHelpers = require('../../../../../_virtual/_rollupPluginBabelHelpers.js');
|
13
13
|
var React = require('react');
|
14
14
|
var index = require('../../../../../node_modules/prop-types/index.js');
|
15
|
-
var common = require('./common.js');
|
16
15
|
var Columns = require('./Columns.js');
|
17
16
|
var Actions = require('./Actions.js');
|
18
17
|
var settings = require('../../../../../settings.js');
|
@@ -59,19 +58,7 @@ var CustomizeColumnsTearsheet = function CustomizeColumnsTearsheet(_ref) {
|
|
59
58
|
_useState6 = _rollupPluginBabelHelpers.slicedToArray(_useState5, 2),
|
60
59
|
searchText = _useState6[0],
|
61
60
|
setSearchText = _useState6[1];
|
62
|
-
var _useState7 = React.useState(columnDefinitions
|
63
|
-
// only sort the hidden column to the end when modal reopen
|
64
|
-
.sort(function (defA, defB) {
|
65
|
-
var isVisibleA = common.isColumnVisible(defA);
|
66
|
-
var isVisibleB = common.isColumnVisible(defB);
|
67
|
-
if (isVisibleA && !isVisibleB) {
|
68
|
-
return -1;
|
69
|
-
}
|
70
|
-
if (!isVisibleA && isVisibleB) {
|
71
|
-
return 1;
|
72
|
-
}
|
73
|
-
return 0;
|
74
|
-
})),
|
61
|
+
var _useState7 = React.useState(columnDefinitions),
|
75
62
|
_useState8 = _rollupPluginBabelHelpers.slicedToArray(_useState7, 2),
|
76
63
|
columnObjects = _useState8[0],
|
77
64
|
setColumnObjects = _useState8[1];
|
@@ -157,7 +144,8 @@ var CustomizeColumnsTearsheet = function CustomizeColumnsTearsheet(_ref) {
|
|
157
144
|
setColumnObjects(cols);
|
158
145
|
setDirty();
|
159
146
|
},
|
160
|
-
selectAllLabel: selectAllLabel
|
147
|
+
selectAllLabel: selectAllLabel,
|
148
|
+
customizeTearsheetHeadingLabel: customizeTearsheetHeadingLabel
|
161
149
|
}));
|
162
150
|
};
|
163
151
|
CustomizeColumnsTearsheet.propTypes = {
|
@@ -15,13 +15,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
15
15
|
|
16
16
|
var isBoolean__default = /*#__PURE__*/_interopDefaultLegacy(isBoolean);
|
17
17
|
|
18
|
-
/*
|
19
|
-
* Licensed Materials - Property of IBM
|
20
|
-
* 5724-Q36
|
21
|
-
* (c) Copyright IBM Corp. 2021
|
22
|
-
* US Government Users Restricted Rights - Use, duplication or disclosure
|
23
|
-
* restricted by GSA ADP Schedule Contract with IBM Corp.
|
24
|
-
*/
|
25
18
|
var isColumnVisible = function isColumnVisible(colDef) {
|
26
19
|
return isBoolean__default["default"](colDef.isVisible) ? colDef.isVisible : true;
|
27
20
|
};
|
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.31.0
|
4
|
+
"version": "2.31.0",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -90,7 +90,7 @@
|
|
90
90
|
},
|
91
91
|
"dependencies": {
|
92
92
|
"@babel/runtime": "^7.23.9",
|
93
|
-
"@carbon/ibm-products-styles": "^2.30.0
|
93
|
+
"@carbon/ibm-products-styles": "^2.30.0",
|
94
94
|
"@carbon/telemetry": "^0.1.0",
|
95
95
|
"@dnd-kit/core": "^6.0.8",
|
96
96
|
"@dnd-kit/modifiers": "^7.0.0",
|
@@ -114,5 +114,5 @@
|
|
114
114
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0",
|
115
115
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
|
116
116
|
},
|
117
|
-
"gitHead": "
|
117
|
+
"gitHead": "b87b80ea5e0b054b85e633c9c44ce265ace42e28"
|
118
118
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
//
|
2
|
-
// Copyright IBM Corp. 2022,
|
2
|
+
// Copyright IBM Corp. 2022, 2024
|
3
3
|
//
|
4
4
|
// This source code is licensed under the Apache-2.0 license found in the
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
@@ -90,6 +90,10 @@
|
|
90
90
|
.#{variables.$block-class}__draggable-handleHolder-droppable.#{variables.$block-class}__draggable-handleHolder-droppable--origin {
|
91
91
|
opacity: 0.5;
|
92
92
|
transition: opacity $duration-moderate-01 motion(entrance, productive);
|
93
|
+
/* stylelint-disable-next-line max-nesting-depth */
|
94
|
+
@media (prefers-reduced-motion: reduce) {
|
95
|
+
transition: none;
|
96
|
+
}
|
93
97
|
}
|
94
98
|
|
95
99
|
.#{variables.$block-class}__draggable-handleHolder--sticky {
|