@carbon/react 1.7.0-rc.0 → 1.8.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/es/components/ComposedModal/ComposedModal.js +1 -1
- package/es/components/ComposedModal/index.js +4 -4
- package/es/components/DataTable/DataTable.js +1 -1
- package/es/components/DataTable/Table.js +10 -2
- package/es/components/DataTable/TableContainer.js +20 -5
- package/es/components/DataTable/TableContext.js +15 -0
- package/es/components/DataTable/TableSelectRow.js +1 -1
- package/es/components/FileUploader/FileUploader.js +8 -1
- package/es/components/FileUploader/FileUploaderButton.js +3 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +3 -1
- package/es/components/FileUploader/FileUploaderItem.js +3 -1
- package/es/components/InlineLoading/InlineLoading.js +9 -5
- package/es/components/Loading/Loading.js +7 -18
- package/es/components/Modal/Modal.js +204 -273
- package/es/components/Modal/index.js +2 -8
- package/es/components/ModalWrapper/ModalWrapper.js +1 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +345 -386
- package/es/components/MultiSelect/index.js +4 -8
- package/es/components/Notification/Notification.js +322 -189
- package/es/components/ProgressBar/ProgressBar.js +6 -3
- package/es/components/RadioButton/RadioButton.js +58 -99
- package/es/components/RadioButton/index.js +2 -8
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +72 -121
- package/es/components/RadioButtonGroup/index.js +2 -8
- package/es/components/Slider/Slider.js +2 -1
- package/es/components/Switch/Switch.js +0 -1
- package/es/components/TreeView/TreeView.js +19 -11
- package/es/components/UIShell/HeaderMenu.js +1 -1
- package/es/components/UIShell/HeaderMenuButton.js +4 -0
- package/es/components/UIShell/SideNavDetails.js +8 -3
- package/es/components/UIShell/SideNavLink.js +6 -9
- package/es/index.js +8 -7
- package/es/internal/createClassWrapper.js +2 -5
- package/lib/components/ComposedModal/index.js +7 -7
- package/lib/components/DataTable/DataTable.js +5 -5
- package/lib/components/DataTable/Table.js +9 -1
- package/lib/components/DataTable/TableContainer.js +19 -4
- package/lib/components/DataTable/TableContext.js +19 -0
- package/lib/components/DataTable/TableSelectRow.js +2 -2
- package/lib/components/FileUploader/FileUploader.js +8 -1
- package/lib/components/FileUploader/FileUploaderButton.js +3 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +3 -1
- package/lib/components/FileUploader/FileUploaderItem.js +3 -1
- package/lib/components/InlineLoading/InlineLoading.js +9 -5
- package/lib/components/Loading/Loading.js +6 -17
- package/lib/components/Modal/Modal.js +201 -270
- package/lib/components/Modal/index.js +2 -25
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.js +341 -382
- package/lib/components/MultiSelect/index.js +5 -28
- package/lib/components/Notification/Notification.js +321 -188
- package/lib/components/ProgressBar/ProgressBar.js +6 -3
- package/lib/components/RadioButton/RadioButton.js +57 -99
- package/lib/components/RadioButton/index.js +2 -25
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +68 -117
- package/lib/components/RadioButtonGroup/index.js +2 -25
- package/lib/components/Slider/Slider.js +2 -1
- package/lib/components/Switch/Switch.js +0 -1
- package/lib/components/TreeView/TreeView.js +18 -10
- package/lib/components/UIShell/HeaderMenu.js +1 -0
- package/lib/components/UIShell/HeaderMenuButton.js +4 -0
- package/lib/components/UIShell/SideNavDetails.js +8 -3
- package/lib/components/UIShell/SideNavLink.js +6 -9
- package/lib/index.js +91 -91
- package/lib/internal/createClassWrapper.js +2 -5
- package/package.json +8 -8
- package/es/components/Modal/next/Modal.js +0 -274
- package/es/components/MultiSelect/next/FilterableMultiSelect.js +0 -542
- package/es/components/Notification/index.js +0 -42
- package/es/components/Notification/next/Notification.js +0 -663
- package/es/components/RadioButton/next/RadioButton.js +0 -130
- package/es/components/RadioButtonGroup/next/RadioButtonGroup.js +0 -141
- package/lib/components/Modal/next/Modal.js +0 -284
- package/lib/components/MultiSelect/next/FilterableMultiSelect.js +0 -554
- package/lib/components/Notification/index.js +0 -51
- package/lib/components/Notification/next/Notification.js +0 -677
- package/lib/components/RadioButton/next/RadioButton.js +0 -140
- package/lib/components/RadioButtonGroup/next/RadioButtonGroup.js +0 -151
package/es/index.js
CHANGED
|
@@ -18,7 +18,7 @@ export { ClassPrefix } from './components/ClassPrefix/index.js';
|
|
|
18
18
|
export { default as CodeSnippetSkeleton } from './components/CodeSnippet/CodeSnippet.Skeleton.js';
|
|
19
19
|
export { default as CodeSnippet } from './components/CodeSnippet/CodeSnippet.js';
|
|
20
20
|
export { default as ComboBox } from './components/ComboBox/ComboBox.js';
|
|
21
|
-
export { ModalFooter, ModalHeader } from './components/ComposedModal/index.js';
|
|
21
|
+
export { ComposedModal, ModalFooter, ModalHeader } from './components/ComposedModal/index.js';
|
|
22
22
|
export { default as ContentSwitcher } from './components/ContentSwitcher/index.js';
|
|
23
23
|
export { default as Copy } from './components/Copy/Copy.js';
|
|
24
24
|
export { default as CopyButton } from './components/CopyButton/CopyButton.js';
|
|
@@ -39,10 +39,9 @@ export { default as InlineLoading } from './components/InlineLoading/InlineLoadi
|
|
|
39
39
|
export { default as Link } from './components/Link/Link.js';
|
|
40
40
|
export { default as ListItem } from './components/ListItem/ListItem.js';
|
|
41
41
|
export { default as Loading } from './components/Loading/Loading.js';
|
|
42
|
-
export { default as Modal } from './components/Modal/
|
|
42
|
+
export { default as Modal } from './components/Modal/Modal.js';
|
|
43
43
|
export { default as ModalWrapper } from './components/ModalWrapper/ModalWrapper.js';
|
|
44
|
-
|
|
45
|
-
export { ActionableNotification, InlineNotification, NotificationActionButton, NotificationButton, NotificationTextDetails, ToastNotification } from './components/Notification/index.js';
|
|
44
|
+
import './components/MultiSelect/index.js';
|
|
46
45
|
export { default as NumberInputSkeleton } from './components/NumberInput/NumberInput.Skeleton.js';
|
|
47
46
|
export { default as NumberInput } from './components/NumberInput/NumberInput.js';
|
|
48
47
|
export { default as OrderedList } from './components/OrderedList/OrderedList.js';
|
|
@@ -52,8 +51,8 @@ export { default as Pagination } from './components/Pagination/index.js';
|
|
|
52
51
|
export { default as PaginationNav } from './components/PaginationNav/PaginationNav.js';
|
|
53
52
|
export { default as PrimaryButton } from './components/PrimaryButton/PrimaryButton.js';
|
|
54
53
|
export { ProgressIndicator } from './components/ProgressIndicator/index.js';
|
|
55
|
-
export { default as RadioButton } from './components/RadioButton/
|
|
56
|
-
export { default as RadioButtonGroup } from './components/RadioButtonGroup/
|
|
54
|
+
export { default as RadioButton } from './components/RadioButton/RadioButton.js';
|
|
55
|
+
export { default as RadioButtonGroup } from './components/RadioButtonGroup/RadioButtonGroup.js';
|
|
57
56
|
export { default as Search } from './components/Search/index.js';
|
|
58
57
|
export { default as SearchFilterButton } from './components/SearchFilterButton/SearchFilterButton.js';
|
|
59
58
|
export { default as SearchLayoutButton } from './components/SearchLayoutButton/SearchLayoutButton.js';
|
|
@@ -135,13 +134,13 @@ export { default as unstable_PageSelector } from './components/Pagination/experi
|
|
|
135
134
|
export { default as unstable_Pagination } from './components/Pagination/experimental/Pagination.js';
|
|
136
135
|
export { default as ProgressBar } from './components/ProgressBar/ProgressBar.js';
|
|
137
136
|
export { default as unstable_TreeNode } from './components/TreeView/TreeNode.js';
|
|
138
|
-
export { default as ComposedModal, ModalBody } from './components/ComposedModal/ComposedModal.js';
|
|
139
137
|
export { default as MultiSelect } from './components/MultiSelect/MultiSelect.js';
|
|
140
138
|
export { default as TextInput } from './components/TextInput/TextInput.js';
|
|
141
139
|
export { default as unstable_Menu } from './components/Menu/Menu.js';
|
|
142
140
|
export { default as unstable_TreeView } from './components/TreeView/TreeView.js';
|
|
143
141
|
export { default as Breadcrumb } from './components/Breadcrumb/Breadcrumb.js';
|
|
144
142
|
export { default as BreadcrumbItem } from './components/Breadcrumb/BreadcrumbItem.js';
|
|
143
|
+
export { ModalBody } from './components/ComposedModal/ComposedModal.js';
|
|
145
144
|
export { default as Table } from './components/DataTable/Table.js';
|
|
146
145
|
export { default as TableActionList } from './components/DataTable/TableActionList.js';
|
|
147
146
|
export { default as TableBatchAction } from './components/DataTable/TableBatchAction.js';
|
|
@@ -164,9 +163,11 @@ export { default as TableToolbarSearch } from './components/DataTable/TableToolb
|
|
|
164
163
|
export { default as TableToolbarMenu } from './components/DataTable/TableToolbarMenu.js';
|
|
165
164
|
export { default as ErrorBoundary } from './components/ErrorBoundary/ErrorBoundary.js';
|
|
166
165
|
export { ErrorBoundaryContext } from './components/ErrorBoundary/ErrorBoundaryContext.js';
|
|
166
|
+
export { default as FilterableMultiSelect } from './components/MultiSelect/FilterableMultiSelect.js';
|
|
167
167
|
export { Grid } from './components/Grid/Grid.js';
|
|
168
168
|
export { ColumnHang } from './components/Grid/ColumnHang.js';
|
|
169
169
|
export { FlexGrid } from './components/Grid/FlexGrid.js';
|
|
170
|
+
export { ActionableNotification, InlineNotification, NotificationActionButton, NotificationButton, ToastNotification } from './components/Notification/Notification.js';
|
|
170
171
|
export { default as ControlledPasswordInput } from './components/TextInput/ControlledPasswordInput.js';
|
|
171
172
|
export { default as PasswordInput } from './components/TextInput/PasswordInput.js';
|
|
172
173
|
export { ProgressStep } from './components/ProgressIndicator/ProgressIndicator.js';
|
|
@@ -20,11 +20,8 @@ function createClassWrapper(Component) {
|
|
|
20
20
|
return /*#__PURE__*/React__default.createElement(Component, props);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
ClassWrapper.displayName = "ClassWrapper(".concat(name, ")");
|
|
26
|
-
}
|
|
27
|
-
|
|
23
|
+
var name = Component.displayName || Component.name;
|
|
24
|
+
ClassWrapper.displayName = "ClassWrapper(".concat(name, ")");
|
|
28
25
|
return ClassWrapper;
|
|
29
26
|
}
|
|
30
27
|
|
|
@@ -12,8 +12,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
12
12
|
var FeatureFlags = require('@carbon/feature-flags');
|
|
13
13
|
var ModalHeader$1 = require('./next/ModalHeader.js');
|
|
14
14
|
var ModalFooter$1 = require('./next/ModalFooter.js');
|
|
15
|
-
var ComposedModal$
|
|
16
|
-
var ComposedModal = require('./ComposedModal.js');
|
|
15
|
+
var ComposedModal$2 = require('./next/ComposedModal.js');
|
|
16
|
+
var ComposedModal$1 = require('./ComposedModal.js');
|
|
17
17
|
|
|
18
18
|
function _interopNamespace(e) {
|
|
19
19
|
if (e && e.__esModule) return e;
|
|
@@ -35,11 +35,11 @@ function _interopNamespace(e) {
|
|
|
35
35
|
|
|
36
36
|
var FeatureFlags__namespace = /*#__PURE__*/_interopNamespace(FeatureFlags);
|
|
37
37
|
|
|
38
|
-
var ModalHeader = FeatureFlags__namespace.enabled('enable-v11-release') ? ModalHeader$1.ModalHeader : ComposedModal.ModalHeader;
|
|
39
|
-
var ModalFooter = FeatureFlags__namespace.enabled('enable-v11-release') ? ModalFooter$1.ModalFooter : ComposedModal.ModalFooter;
|
|
40
|
-
FeatureFlags__namespace.enabled('enable-v11-release') ? ComposedModal$
|
|
38
|
+
var ModalHeader = FeatureFlags__namespace.enabled('enable-v11-release') ? ModalHeader$1.ModalHeader : ComposedModal$1.ModalHeader;
|
|
39
|
+
var ModalFooter = FeatureFlags__namespace.enabled('enable-v11-release') ? ModalFooter$1.ModalFooter : ComposedModal$1.ModalFooter;
|
|
40
|
+
var ComposedModal = FeatureFlags__namespace.enabled('enable-v11-release') ? ComposedModal$2["default"] : ComposedModal$1["default"];
|
|
41
41
|
|
|
42
|
-
exports.ModalBody = ComposedModal.ModalBody;
|
|
43
|
-
exports
|
|
42
|
+
exports.ModalBody = ComposedModal$1.ModalBody;
|
|
43
|
+
exports.ComposedModal = ComposedModal;
|
|
44
44
|
exports.ModalFooter = ModalFooter;
|
|
45
45
|
exports.ModalHeader = ModalHeader;
|
|
@@ -14,12 +14,12 @@ var PropTypes = require('prop-types');
|
|
|
14
14
|
var React = require('react');
|
|
15
15
|
var isEqual = require('lodash.isequal');
|
|
16
16
|
var getDerivedStateFromProps = require('./state/getDerivedStateFromProps.js');
|
|
17
|
-
var sorting = require('./state/sorting.js');
|
|
17
|
+
var sorting$1 = require('./state/sorting.js');
|
|
18
18
|
var cells = require('./tools/cells.js');
|
|
19
19
|
var denormalize = require('./tools/denormalize.js');
|
|
20
20
|
var events = require('../../tools/events.js');
|
|
21
21
|
var filter = require('./tools/filter.js');
|
|
22
|
-
var sorting
|
|
22
|
+
var sorting = require('./tools/sorting.js');
|
|
23
23
|
var instanceId = require('./tools/instanceId.js');
|
|
24
24
|
|
|
25
25
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -90,7 +90,7 @@ var DataTable = /*#__PURE__*/function (_React$Component) {
|
|
|
90
90
|
isSortable: isSortable,
|
|
91
91
|
isSortHeader: sortHeaderKey === header.key,
|
|
92
92
|
onClick: function onClick(event) {
|
|
93
|
-
var nextSortState = sorting.getNextSortState(_this.props, _this.state, {
|
|
93
|
+
var nextSortState = sorting$1.getNextSortState(_this.props, _this.state, {
|
|
94
94
|
key: header.key
|
|
95
95
|
});
|
|
96
96
|
|
|
@@ -387,7 +387,7 @@ var DataTable = /*#__PURE__*/function (_React$Component) {
|
|
|
387
387
|
_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.assertThisInitialized(_this), "handleSortBy", function (headerKey) {
|
|
388
388
|
return function () {
|
|
389
389
|
_this.setState(function (state) {
|
|
390
|
-
return sorting.getNextSortState(_this.props, state, {
|
|
390
|
+
return sorting$1.getNextSortState(_this.props, state, {
|
|
391
391
|
key: headerKey
|
|
392
392
|
});
|
|
393
393
|
});
|
|
@@ -626,7 +626,7 @@ _rollupPluginBabelHelpers.defineProperty(DataTable, "propTypes", {
|
|
|
626
626
|
});
|
|
627
627
|
|
|
628
628
|
_rollupPluginBabelHelpers.defineProperty(DataTable, "defaultProps", {
|
|
629
|
-
sortRow: sorting
|
|
629
|
+
sortRow: sorting.defaultSortRow,
|
|
630
630
|
filterRows: filter.defaultFilterRows,
|
|
631
631
|
locale: 'en',
|
|
632
632
|
size: 'lg',
|
|
@@ -14,6 +14,7 @@ var React = require('react');
|
|
|
14
14
|
var PropTypes = require('prop-types');
|
|
15
15
|
var cx = require('classnames');
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
|
+
var TableContext = require('./TableContext.js');
|
|
17
18
|
|
|
18
19
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
20
|
|
|
@@ -35,11 +36,18 @@ var Table = function Table(_ref) {
|
|
|
35
36
|
overflowMenuOnHover = _ref.overflowMenuOnHover,
|
|
36
37
|
other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
37
38
|
|
|
39
|
+
var _useContext = React.useContext(TableContext.TableContext),
|
|
40
|
+
titleId = _useContext.titleId,
|
|
41
|
+
descriptionId = _useContext.descriptionId;
|
|
42
|
+
|
|
38
43
|
var prefix = usePrefix.usePrefix();
|
|
39
44
|
var componentClass = cx__default["default"]("".concat(prefix, "--data-table"), className, (_cx = {}, _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--data-table--").concat(size), size), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--data-table--sort"), isSortable), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--data-table--zebra"), useZebraStyles), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--data-table--static"), useStaticWidth), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--data-table--sticky-header"), stickyHeader), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--data-table--visible-overflow-menu"), !overflowMenuOnHover), _cx));
|
|
40
45
|
var table = /*#__PURE__*/React__default["default"].createElement("div", {
|
|
41
46
|
className: "".concat(prefix, "--data-table-content")
|
|
42
|
-
}, /*#__PURE__*/React__default["default"].createElement("table", _rollupPluginBabelHelpers["extends"]({
|
|
47
|
+
}, /*#__PURE__*/React__default["default"].createElement("table", _rollupPluginBabelHelpers["extends"]({
|
|
48
|
+
"aria-labelledby": titleId,
|
|
49
|
+
"aria-describedby": descriptionId
|
|
50
|
+
}, other, {
|
|
43
51
|
className: componentClass
|
|
44
52
|
}), children));
|
|
45
53
|
return stickyHeader ? /*#__PURE__*/React__default["default"].createElement("section", {
|
|
@@ -14,6 +14,8 @@ var cx = require('classnames');
|
|
|
14
14
|
var PropTypes = require('prop-types');
|
|
15
15
|
var React = require('react');
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
|
+
var useId = require('../../internal/useId.js');
|
|
18
|
+
var TableContext = require('./TableContext.js');
|
|
17
19
|
|
|
18
20
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
21
|
|
|
@@ -34,17 +36,30 @@ var TableContainer = function TableContainer(_ref) {
|
|
|
34
36
|
useStaticWidth = _ref.useStaticWidth,
|
|
35
37
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
36
38
|
|
|
39
|
+
var baseId = useId.useId('tc');
|
|
40
|
+
var titleId = "".concat(baseId, "-title");
|
|
41
|
+
var descriptionId = "".concat(baseId, "-description");
|
|
37
42
|
var prefix = usePrefix.usePrefix();
|
|
38
43
|
var tableContainerClasses = cx__default["default"](className, "".concat(prefix, "--data-table-container"), (_cx = {}, _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--data-table--max-width"), stickyHeader), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--data-table-container--static"), useStaticWidth), _cx));
|
|
39
|
-
|
|
44
|
+
var value = React.useMemo(function () {
|
|
45
|
+
return {
|
|
46
|
+
titleId: title ? titleId : null,
|
|
47
|
+
descriptionId: description ? descriptionId : null
|
|
48
|
+
};
|
|
49
|
+
}, [title, description, titleId, descriptionId]);
|
|
50
|
+
return /*#__PURE__*/React__default["default"].createElement(TableContext.TableContext.Provider, {
|
|
51
|
+
value: value
|
|
52
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
40
53
|
className: tableContainerClasses
|
|
41
54
|
}), title && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
42
55
|
className: "".concat(prefix, "--data-table-header")
|
|
43
56
|
}, /*#__PURE__*/React__default["default"].createElement("h4", {
|
|
44
|
-
className: "".concat(prefix, "--data-table-header__title")
|
|
57
|
+
className: "".concat(prefix, "--data-table-header__title"),
|
|
58
|
+
id: titleId
|
|
45
59
|
}, title), /*#__PURE__*/React__default["default"].createElement("p", {
|
|
46
|
-
className: "".concat(prefix, "--data-table-header__description")
|
|
47
|
-
|
|
60
|
+
className: "".concat(prefix, "--data-table-header__description"),
|
|
61
|
+
id: descriptionId
|
|
62
|
+
}, description)), children));
|
|
48
63
|
};
|
|
49
64
|
|
|
50
65
|
TableContainer.propTypes = {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 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
|
+
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
+
|
|
12
|
+
var React = require('react');
|
|
13
|
+
|
|
14
|
+
var TableContext = /*#__PURE__*/React.createContext({
|
|
15
|
+
titleId: null,
|
|
16
|
+
descriptionId: null
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
exports.TableContext = TableContext;
|
|
@@ -14,7 +14,7 @@ var PropTypes = require('prop-types');
|
|
|
14
14
|
var React = require('react');
|
|
15
15
|
var cx = require('classnames');
|
|
16
16
|
var InlineCheckbox = require('../InlineCheckbox/InlineCheckbox.js');
|
|
17
|
-
var
|
|
17
|
+
var RadioButton = require('../RadioButton/RadioButton.js');
|
|
18
18
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
19
19
|
|
|
20
20
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -44,7 +44,7 @@ var TableSelectRow = function TableSelectRow(_ref) {
|
|
|
44
44
|
checked: checked,
|
|
45
45
|
disabled: disabled
|
|
46
46
|
};
|
|
47
|
-
var InlineInputComponent = radio ?
|
|
47
|
+
var InlineInputComponent = radio ? RadioButton["default"] : InlineCheckbox["default"];
|
|
48
48
|
var tableSelectRowClasses = cx__default["default"]("".concat(prefix, "--table-column-checkbox"), (_classNames = {}, _rollupPluginBabelHelpers.defineProperty(_classNames, className, className), _rollupPluginBabelHelpers.defineProperty(_classNames, "".concat(prefix, "--table-column-radio"), radio), _classNames));
|
|
49
49
|
return /*#__PURE__*/React__default["default"].createElement("td", {
|
|
50
50
|
className: tableSelectRowClasses
|
|
@@ -70,6 +70,8 @@ var FileUploader = /*#__PURE__*/function (_React$Component) {
|
|
|
70
70
|
|
|
71
71
|
_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.assertThisInitialized(_this), "nodes", []);
|
|
72
72
|
|
|
73
|
+
_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.assertThisInitialized(_this), "uploaderButton", /*#__PURE__*/React__default["default"].createRef());
|
|
74
|
+
|
|
73
75
|
_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.assertThisInitialized(_this), "handleChange", function (evt) {
|
|
74
76
|
evt.stopPropagation();
|
|
75
77
|
var filenames = Array.prototype.map.call(evt.target.files, function (file) {
|
|
@@ -102,6 +104,8 @@ var FileUploader = /*#__PURE__*/function (_React$Component) {
|
|
|
102
104
|
|
|
103
105
|
if (_this.props.onDelete) {
|
|
104
106
|
_this.props.onDelete(evt);
|
|
107
|
+
|
|
108
|
+
_this.uploaderButton.current.focus();
|
|
105
109
|
}
|
|
106
110
|
|
|
107
111
|
_this.props.onClick(evt);
|
|
@@ -157,6 +161,7 @@ var FileUploader = /*#__PURE__*/function (_React$Component) {
|
|
|
157
161
|
}, labelTitle), /*#__PURE__*/React__default["default"].createElement("p", {
|
|
158
162
|
className: getHelperLabelClasses("".concat(prefix, "--label-description"))
|
|
159
163
|
}, labelDescription), /*#__PURE__*/React__default["default"].createElement(FileUploaderButton["default"], {
|
|
164
|
+
innerRef: this.uploaderButton,
|
|
160
165
|
disabled: disabled,
|
|
161
166
|
labelText: buttonLabel,
|
|
162
167
|
multiple: multiple,
|
|
@@ -177,11 +182,13 @@ var FileUploader = /*#__PURE__*/function (_React$Component) {
|
|
|
177
182
|
} // eslint-disable-line
|
|
178
183
|
|
|
179
184
|
}, other), /*#__PURE__*/React__default["default"].createElement("p", {
|
|
180
|
-
className: "".concat(prefix, "--file-filename")
|
|
185
|
+
className: "".concat(prefix, "--file-filename"),
|
|
186
|
+
id: name
|
|
181
187
|
}, name), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
182
188
|
className: "".concat(prefix, "--file__state-container")
|
|
183
189
|
}, /*#__PURE__*/React__default["default"].createElement(Filename["default"], {
|
|
184
190
|
iconDescription: iconDescription,
|
|
191
|
+
"aria-describedby": name,
|
|
185
192
|
status: filenameStatus,
|
|
186
193
|
onKeyDown: function onKeyDown(evt) {
|
|
187
194
|
if (match.matches(evt, [keys.Enter, keys.Space])) {
|
|
@@ -45,7 +45,7 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
45
45
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
46
46
|
var FeatureFlags__namespace = /*#__PURE__*/_interopNamespace(FeatureFlags);
|
|
47
47
|
|
|
48
|
-
var _excluded = ["accept", "buttonKind", "className", "disabled", "disableLabelChanges", "id", "labelText", "multiple", "onChange", "role", "name", "size", "tabIndex"];
|
|
48
|
+
var _excluded = ["accept", "buttonKind", "className", "disabled", "disableLabelChanges", "id", "labelText", "multiple", "onChange", "role", "name", "size", "tabIndex", "innerRef"];
|
|
49
49
|
|
|
50
50
|
function noop() {}
|
|
51
51
|
|
|
@@ -74,6 +74,7 @@ function FileUploaderButton(_ref) {
|
|
|
74
74
|
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
75
75
|
_ref$tabIndex = _ref.tabIndex,
|
|
76
76
|
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex,
|
|
77
|
+
innerRef = _ref.innerRef,
|
|
77
78
|
other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
78
79
|
|
|
79
80
|
var prefix = usePrefix.usePrefix();
|
|
@@ -125,6 +126,7 @@ function FileUploaderButton(_ref) {
|
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("label", _rollupPluginBabelHelpers["extends"]({
|
|
129
|
+
ref: innerRef,
|
|
128
130
|
tabIndex: disabled ? -1 : tabIndex || 0,
|
|
129
131
|
className: classes,
|
|
130
132
|
onKeyDown: onKeyDown,
|
|
@@ -24,7 +24,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
24
24
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
25
25
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
26
26
|
|
|
27
|
-
var _excluded = ["accept", "className", "id", "disabled", "labelText", "multiple", "name", "onAddFiles", "pattern", "role", "tabIndex"];
|
|
27
|
+
var _excluded = ["accept", "className", "id", "disabled", "labelText", "multiple", "name", "onAddFiles", "pattern", "role", "tabIndex", "innerRef"];
|
|
28
28
|
|
|
29
29
|
function FileUploaderDropContainer(_ref) {
|
|
30
30
|
var _classNames2;
|
|
@@ -40,6 +40,7 @@ function FileUploaderDropContainer(_ref) {
|
|
|
40
40
|
pattern = _ref.pattern,
|
|
41
41
|
role = _ref.role,
|
|
42
42
|
tabIndex = _ref.tabIndex,
|
|
43
|
+
innerRef = _ref.innerRef,
|
|
43
44
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
44
45
|
|
|
45
46
|
var prefix = usePrefix.usePrefix();
|
|
@@ -135,6 +136,7 @@ function FileUploaderDropContainer(_ref) {
|
|
|
135
136
|
handleChange(evt);
|
|
136
137
|
}
|
|
137
138
|
}, /*#__PURE__*/React__default["default"].createElement("label", _rollupPluginBabelHelpers["extends"]({
|
|
139
|
+
ref: innerRef,
|
|
138
140
|
className: labelClasses,
|
|
139
141
|
htmlFor: uid,
|
|
140
142
|
tabIndex: tabIndex || 0,
|
|
@@ -71,11 +71,13 @@ function FileUploaderItem(_ref) {
|
|
|
71
71
|
className: classes
|
|
72
72
|
}, other), /*#__PURE__*/React__default["default"].createElement("p", {
|
|
73
73
|
className: "".concat(prefix, "--file-filename"),
|
|
74
|
-
title: name
|
|
74
|
+
title: name,
|
|
75
|
+
id: name
|
|
75
76
|
}, name), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
76
77
|
className: "".concat(prefix, "--file__state-container")
|
|
77
78
|
}, /*#__PURE__*/React__default["default"].createElement(Filename["default"], {
|
|
78
79
|
iconDescription: iconDescription,
|
|
80
|
+
"aria-describedby": name,
|
|
79
81
|
status: status,
|
|
80
82
|
invalid: invalid,
|
|
81
83
|
onKeyDown: function onKeyDown(evt) {
|
|
@@ -25,8 +25,6 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
25
25
|
|
|
26
26
|
var _excluded = ["className", "status", "iconDescription", "description", "onSuccess", "successDelay"];
|
|
27
27
|
function InlineLoading(_ref) {
|
|
28
|
-
var _title, _title2;
|
|
29
|
-
|
|
30
28
|
var className = _ref.className,
|
|
31
29
|
_ref$status = _ref.status,
|
|
32
30
|
status = _ref$status === void 0 ? 'active' : _ref$status,
|
|
@@ -40,10 +38,12 @@ function InlineLoading(_ref) {
|
|
|
40
38
|
var loadingClasses = cx__default["default"]("".concat(prefix, "--inline-loading"), className);
|
|
41
39
|
|
|
42
40
|
var getLoading = function getLoading() {
|
|
41
|
+
var iconLabel = iconDescription ? iconDescription : status;
|
|
42
|
+
|
|
43
43
|
if (status === 'error') {
|
|
44
44
|
return /*#__PURE__*/React__default["default"].createElement(iconsReact.ErrorFilled, {
|
|
45
45
|
className: "".concat(prefix, "--inline-loading--error")
|
|
46
|
-
},
|
|
46
|
+
}, /*#__PURE__*/React__default["default"].createElement("title", null, iconLabel));
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
if (status === 'finished') {
|
|
@@ -54,13 +54,17 @@ function InlineLoading(_ref) {
|
|
|
54
54
|
}, successDelay);
|
|
55
55
|
return /*#__PURE__*/React__default["default"].createElement(iconsReact.CheckmarkFilled, {
|
|
56
56
|
className: "".concat(prefix, "--inline-loading__checkmark-container")
|
|
57
|
-
},
|
|
57
|
+
}, /*#__PURE__*/React__default["default"].createElement("title", null, iconLabel));
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
if (status === 'inactive' || status === 'active') {
|
|
61
|
+
if (!iconDescription) {
|
|
62
|
+
iconLabel = status === 'active' ? 'loading' : 'not loading';
|
|
63
|
+
}
|
|
64
|
+
|
|
61
65
|
return /*#__PURE__*/React__default["default"].createElement(Loading["default"], {
|
|
62
66
|
small: true,
|
|
63
|
-
description:
|
|
67
|
+
description: iconLabel,
|
|
64
68
|
withOverlay: false,
|
|
65
69
|
active: status === 'active'
|
|
66
70
|
});
|
|
@@ -13,8 +13,8 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
|
|
|
13
13
|
var cx = require('classnames');
|
|
14
14
|
var PropTypes = require('prop-types');
|
|
15
15
|
var React = require('react');
|
|
16
|
-
var setupGetInstanceId = require('../../tools/setupGetInstanceId.js');
|
|
17
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
|
+
var deprecate = require('../../prop-types/deprecate.js');
|
|
18
18
|
|
|
19
19
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
20
|
|
|
@@ -22,14 +22,12 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
22
22
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
23
23
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
24
|
|
|
25
|
-
var _excluded = ["
|
|
26
|
-
var getInstanceId = setupGetInstanceId["default"]();
|
|
25
|
+
var _excluded = ["active", "className", "withOverlay", "small", "description"];
|
|
27
26
|
|
|
28
27
|
function Loading(_ref) {
|
|
29
28
|
var _cx, _cx2;
|
|
30
29
|
|
|
31
|
-
var
|
|
32
|
-
active = _ref.active,
|
|
30
|
+
var active = _ref.active,
|
|
33
31
|
customClassName = _ref.className,
|
|
34
32
|
withOverlay = _ref.withOverlay,
|
|
35
33
|
small = _ref.small,
|
|
@@ -37,22 +35,13 @@ function Loading(_ref) {
|
|
|
37
35
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
38
36
|
|
|
39
37
|
var prefix = usePrefix.usePrefix();
|
|
40
|
-
|
|
41
|
-
var _useRef = React.useRef(getInstanceId()),
|
|
42
|
-
instanceId = _useRef.current;
|
|
43
|
-
|
|
44
38
|
var loadingClassName = cx__default["default"](customClassName, (_cx = {}, _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--loading"), true), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--loading--small"), small), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--loading--stop"), !active), _cx));
|
|
45
39
|
var overlayClassName = cx__default["default"]((_cx2 = {}, _rollupPluginBabelHelpers.defineProperty(_cx2, "".concat(prefix, "--loading-overlay"), true), _rollupPluginBabelHelpers.defineProperty(_cx2, "".concat(prefix, "--loading-overlay--stop"), !active), _cx2));
|
|
46
|
-
var loadingId = id || "loading-id-".concat(instanceId);
|
|
47
40
|
var loading = /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
48
41
|
"aria-atomic": "true",
|
|
49
|
-
"aria-labelledby": loadingId,
|
|
50
42
|
"aria-live": active ? 'assertive' : 'off',
|
|
51
43
|
className: loadingClassName
|
|
52
|
-
}), /*#__PURE__*/React__default["default"].createElement("
|
|
53
|
-
id: loadingId,
|
|
54
|
-
className: "".concat(prefix, "--visually-hidden")
|
|
55
|
-
}, description), /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
44
|
+
}), /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
56
45
|
className: "".concat(prefix, "--loading__svg"),
|
|
57
46
|
viewBox: "0 0 100 100"
|
|
58
47
|
}, /*#__PURE__*/React__default["default"].createElement("title", null, description), small ? /*#__PURE__*/React__default["default"].createElement("circle", {
|
|
@@ -90,7 +79,7 @@ Loading.propTypes = {
|
|
|
90
79
|
/**
|
|
91
80
|
* Provide an `id` to uniquely identify the label
|
|
92
81
|
*/
|
|
93
|
-
id: PropTypes__default["default"].string,
|
|
82
|
+
id: deprecate["default"](PropTypes__default["default"].string, "\nThe prop `id` is no longer needed."),
|
|
94
83
|
|
|
95
84
|
/**
|
|
96
85
|
* Specify whether you would like the small variant of <Loading>
|
|
@@ -106,7 +95,7 @@ Loading.defaultProps = {
|
|
|
106
95
|
active: true,
|
|
107
96
|
withOverlay: true,
|
|
108
97
|
small: false,
|
|
109
|
-
description: '
|
|
98
|
+
description: 'loading'
|
|
110
99
|
};
|
|
111
100
|
|
|
112
101
|
exports["default"] = Loading;
|