@carbon/react 1.4.0 → 1.6.0-rc.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/_virtual/_rollupPluginBabelHelpers.js +3 -5
- package/es/components/Button/Button.Skeleton.js +1 -1
- package/es/components/Checkbox/Checkbox.js +5 -5
- package/es/components/ComposedModal/ComposedModal.js +2 -1
- package/es/components/ComposedModal/next/ComposedModal.js +2 -1
- package/es/components/DataTable/TableActionList.js +3 -1
- package/es/components/DataTable/TableToolbarContent.js +3 -1
- package/es/components/DatePicker/DatePicker.js +14 -5
- package/es/components/FileUploader/FileUploader.js +1 -1
- package/es/components/FileUploader/FileUploaderButton.js +1 -1
- package/es/components/FileUploader/Filename.js +1 -1
- package/es/components/Link/Link.js +6 -3
- package/es/components/ListBox/ListBoxPropTypes.js +1 -2
- package/es/components/ListBox/ListBoxSelection.js +3 -4
- package/es/components/OverflowMenu/OverflowMenu.js +1 -1
- package/es/components/ProgressIndicator/ProgressIndicator.js +1 -3
- package/es/components/RadioButton/next/RadioButton.js +2 -1
- package/es/components/Search/next/Search.js +1 -0
- package/es/components/Tabs/next/Tabs.js +42 -4
- package/es/components/Toggle/Toggle.js +147 -109
- package/es/components/TreeView/TreeNode.js +8 -0
- package/es/components/TreeView/TreeView.js +6 -4
- package/es/components/UIShell/HeaderGlobalBar.js +3 -1
- package/es/components/UIShell/SideNav.js +3 -3
- package/es/index.js +3 -2
- package/es/tools/wrapComponent.js +6 -4
- package/lib/_virtual/_rollupPluginBabelHelpers.js +3 -5
- package/lib/components/Button/Button.Skeleton.js +1 -1
- package/lib/components/Checkbox/Checkbox.js +5 -5
- package/lib/components/ComposedModal/ComposedModal.js +2 -1
- package/lib/components/ComposedModal/next/ComposedModal.js +2 -1
- package/lib/components/DataTable/TableActionList.js +3 -1
- package/lib/components/DataTable/TableToolbarContent.js +3 -1
- package/lib/components/DatePicker/DatePicker.js +14 -5
- package/lib/components/FileUploader/FileUploader.js +1 -1
- package/lib/components/FileUploader/FileUploaderButton.js +1 -1
- package/lib/components/FileUploader/Filename.js +1 -1
- package/lib/components/Link/Link.js +6 -3
- package/lib/components/ListBox/ListBoxPropTypes.js +1 -21
- package/lib/components/ListBox/ListBoxSelection.js +3 -4
- package/lib/components/OverflowMenu/OverflowMenu.js +1 -1
- package/lib/components/ProgressIndicator/ProgressIndicator.js +1 -3
- package/lib/components/RadioButton/next/RadioButton.js +2 -1
- package/lib/components/Search/next/Search.js +1 -0
- package/lib/components/Tabs/next/Tabs.js +42 -4
- package/lib/components/Toggle/Toggle.js +146 -107
- package/lib/components/TreeView/TreeNode.js +8 -0
- package/lib/components/TreeView/TreeView.js +6 -4
- package/lib/components/UIShell/HeaderGlobalBar.js +3 -1
- package/lib/components/UIShell/SideNav.js +3 -3
- package/lib/index.js +70 -68
- package/lib/tools/wrapComponent.js +6 -4
- package/package.json +26 -26
- package/es/components/Toggle/index.js +0 -19
- package/es/components/Toggle/next/Toggle.js +0 -158
- package/lib/components/Toggle/index.js +0 -23
- package/lib/components/Toggle/next/Toggle.js +0 -169
|
@@ -64,6 +64,10 @@ function TreeNode(_ref) {
|
|
|
64
64
|
var toggleClasses = cx("".concat(prefix, "--tree-parent-node__toggle-icon"), _defineProperty({}, "".concat(prefix, "--tree-parent-node__toggle-icon--expanded"), expanded));
|
|
65
65
|
|
|
66
66
|
function handleToggleClick(event) {
|
|
67
|
+
if (disabled) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
67
71
|
onToggle === null || onToggle === void 0 ? void 0 : onToggle(event, {
|
|
68
72
|
id: id,
|
|
69
73
|
isExpanded: !expanded,
|
|
@@ -96,6 +100,10 @@ function TreeNode(_ref) {
|
|
|
96
100
|
function handleKeyDown(event) {
|
|
97
101
|
var _rest$onKeyDown;
|
|
98
102
|
|
|
103
|
+
if (disabled) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
99
107
|
if (matches(event, [ArrowLeft, ArrowRight, Enter])) {
|
|
100
108
|
event.stopPropagation();
|
|
101
109
|
}
|
|
@@ -153,7 +153,7 @@ function TreeView(_ref) {
|
|
|
153
153
|
var nodeIds = [];
|
|
154
154
|
|
|
155
155
|
if (matches(event, [Home, End])) {
|
|
156
|
-
if (multiselect && event.shiftKey && event.ctrlKey) {
|
|
156
|
+
if (multiselect && event.shiftKey && event.ctrlKey && !treeWalker.current.currentNode.getAttribute('aria-disabled')) {
|
|
157
157
|
var _treeWalker$current$c;
|
|
158
158
|
|
|
159
159
|
nodeIds.push((_treeWalker$current$c = treeWalker.current.currentNode) === null || _treeWalker$current$c === void 0 ? void 0 : _treeWalker$current$c.id);
|
|
@@ -162,7 +162,7 @@ function TreeView(_ref) {
|
|
|
162
162
|
while (match(event, Home) ? treeWalker.current.previousNode() : treeWalker.current.nextNode()) {
|
|
163
163
|
nextFocusNode = treeWalker.current.currentNode;
|
|
164
164
|
|
|
165
|
-
if (multiselect && event.shiftKey && event.ctrlKey) {
|
|
165
|
+
if (multiselect && event.shiftKey && event.ctrlKey && !nextFocusNode.getAttribute('aria-disabled')) {
|
|
166
166
|
var _nextFocusNode;
|
|
167
167
|
|
|
168
168
|
nodeIds.push((_nextFocusNode = nextFocusNode) === null || _nextFocusNode === void 0 ? void 0 : _nextFocusNode.id);
|
|
@@ -176,9 +176,11 @@ function TreeView(_ref) {
|
|
|
176
176
|
treeWalker.current.currentNode = treeWalker.current.root;
|
|
177
177
|
|
|
178
178
|
while (treeWalker.current.nextNode()) {
|
|
179
|
-
|
|
179
|
+
if (!treeWalker.current.currentNode.getAttribute('aria-disabled')) {
|
|
180
|
+
var _treeWalker$current$c2;
|
|
180
181
|
|
|
181
|
-
|
|
182
|
+
nodeIds.push((_treeWalker$current$c2 = treeWalker.current.currentNode) === null || _treeWalker$current$c2 === void 0 ? void 0 : _treeWalker$current$c2.id);
|
|
183
|
+
}
|
|
182
184
|
}
|
|
183
185
|
}
|
|
184
186
|
|
|
@@ -13,7 +13,9 @@ import wrapComponent from '../../tools/wrapComponent.js';
|
|
|
13
13
|
|
|
14
14
|
var HeaderGlobalBar = wrapComponent({
|
|
15
15
|
name: 'HeaderGlobalBar',
|
|
16
|
-
className:
|
|
16
|
+
className: function className(prefix) {
|
|
17
|
+
return "".concat(prefix, "--header__global");
|
|
18
|
+
},
|
|
17
19
|
type: 'div'
|
|
18
20
|
});
|
|
19
21
|
|
|
@@ -212,15 +212,15 @@ SideNav.propTypes = _objectSpread2(_objectSpread2({}, AriaLabelPropType), {}, {
|
|
|
212
212
|
* @param {object} event
|
|
213
213
|
* @param {boolean} value
|
|
214
214
|
*/
|
|
215
|
-
onToggle: PropTypes.func
|
|
216
|
-
|
|
215
|
+
onToggle: PropTypes.func
|
|
217
216
|
/**
|
|
218
217
|
* Provide a custom function for translating all message ids within this
|
|
219
218
|
* component. This function will take in two arguments: the mesasge Id and the
|
|
220
219
|
* state of the component. From this, you should return a string representing
|
|
221
220
|
* the label you want displayed or read by screen readers.
|
|
222
221
|
*/
|
|
223
|
-
translateById: PropTypes.func
|
|
222
|
+
// translateById: PropTypes.func,
|
|
223
|
+
|
|
224
224
|
});
|
|
225
225
|
var SideNav$1 = SideNav;
|
|
226
226
|
|
package/es/index.js
CHANGED
|
@@ -79,7 +79,8 @@ export { default as RadioTile } from './components/RadioTile/RadioTile.js';
|
|
|
79
79
|
export { default as TileGroup } from './components/TileGroup/index.js';
|
|
80
80
|
export { default as TimePicker } from './components/TimePicker/index.js';
|
|
81
81
|
export { default as TimePickerSelect } from './components/TimePickerSelect/index.js';
|
|
82
|
-
export { default as
|
|
82
|
+
export { default as ToggleSkeleton } from './components/Toggle/Toggle.Skeleton.js';
|
|
83
|
+
export { Toggle } from './components/Toggle/Toggle.js';
|
|
83
84
|
export { Toggletip, ToggletipActions, ToggletipButton, ToggletipContent, ToggletipLabel } from './components/Toggletip/index.js';
|
|
84
85
|
export { default as UnorderedList } from './components/UnorderedList/UnorderedList.js';
|
|
85
86
|
export { default as SkeletonText } from './components/SkeletonText/SkeletonText.js';
|
|
@@ -95,7 +96,6 @@ export { default as SearchSkeleton } from './components/Search/Search.Skeleton.j
|
|
|
95
96
|
export { default as SliderSkeleton } from './components/Slider/Slider.Skeleton.js';
|
|
96
97
|
export { default as TabsSkeleton } from './components/Tabs/Tabs.Skeleton.js';
|
|
97
98
|
export { default as TextInputSkeleton } from './components/TextInput/TextInput.Skeleton.js';
|
|
98
|
-
export { default as ToggleSkeleton } from './components/Toggle/Toggle.Skeleton.js';
|
|
99
99
|
export { default as ToggleSmallSkeleton } from './components/ToggleSmall/ToggleSmall.Skeleton.js';
|
|
100
100
|
export { default as IconSkeleton } from './components/Icon/Icon.Skeleton.js';
|
|
101
101
|
export { HeaderNavigation, SideNavMenu } from './components/UIShell/index.js';
|
|
@@ -110,6 +110,7 @@ export { HStack, VStack } from './components/Stack/index.js';
|
|
|
110
110
|
export { DefinitionTooltip } from './components/Tooltip/next/DefinitionTooltip.js';
|
|
111
111
|
import './components/TreeView/index.js';
|
|
112
112
|
export { GlobalTheme, Theme, useTheme } from './components/Theme/index.js';
|
|
113
|
+
export { usePrefix } from './internal/usePrefix.js';
|
|
113
114
|
export { default as AspectRatio } from './components/AspectRatio/AspectRatio.js';
|
|
114
115
|
export { default as Filename } from './components/FileUploader/Filename.js';
|
|
115
116
|
export { default as FileUploaderButton } from './components/FileUploader/FileUploaderButton.js';
|
|
@@ -9,26 +9,28 @@ import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _
|
|
|
9
9
|
import React__default from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import cx from 'classnames';
|
|
12
|
+
import { usePrefix } from '../internal/usePrefix.js';
|
|
12
13
|
|
|
13
14
|
var _excluded = ["className"];
|
|
14
15
|
|
|
15
16
|
var wrapComponent = function wrapComponent(_ref) {
|
|
16
17
|
var name = _ref.name,
|
|
17
|
-
|
|
18
|
+
getClassName = _ref.className,
|
|
18
19
|
type = _ref.type;
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
function Component(_ref2) {
|
|
21
22
|
var baseClassName = _ref2.className,
|
|
22
23
|
other = _objectWithoutProperties(_ref2, _excluded);
|
|
23
24
|
|
|
24
|
-
var
|
|
25
|
+
var prefix = usePrefix();
|
|
26
|
+
var componentClass = cx(typeof getClassName === 'function' ? getClassName(prefix) : getClassName, baseClassName);
|
|
25
27
|
return /*#__PURE__*/React__default.createElement(type, _objectSpread2(_objectSpread2({}, other), {}, {
|
|
26
28
|
// Prevent Weird quirk where `cx` will evaluate to an empty string, '',
|
|
27
29
|
// and so we have empty `class` attributes in the resulting markup
|
|
28
30
|
// eslint-disable-next-line no-extra-boolean-cast
|
|
29
31
|
className: !!componentClass ? componentClass : undefined
|
|
30
32
|
}));
|
|
31
|
-
}
|
|
33
|
+
}
|
|
32
34
|
|
|
33
35
|
Component.displayName = name;
|
|
34
36
|
Component.propTypes = {
|
|
@@ -86,7 +86,7 @@ function _defineProperty(obj, key, value) {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
function _extends() {
|
|
89
|
-
_extends = Object.assign
|
|
89
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
90
90
|
for (var i = 1; i < arguments.length; i++) {
|
|
91
91
|
var source = arguments[i];
|
|
92
92
|
|
|
@@ -99,7 +99,6 @@ function _extends() {
|
|
|
99
99
|
|
|
100
100
|
return target;
|
|
101
101
|
};
|
|
102
|
-
|
|
103
102
|
return _extends.apply(this, arguments);
|
|
104
103
|
}
|
|
105
104
|
|
|
@@ -122,18 +121,17 @@ function _inherits(subClass, superClass) {
|
|
|
122
121
|
}
|
|
123
122
|
|
|
124
123
|
function _getPrototypeOf(o) {
|
|
125
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
124
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
126
125
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
127
126
|
};
|
|
128
127
|
return _getPrototypeOf(o);
|
|
129
128
|
}
|
|
130
129
|
|
|
131
130
|
function _setPrototypeOf(o, p) {
|
|
132
|
-
_setPrototypeOf = Object.setPrototypeOf
|
|
131
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
133
132
|
o.__proto__ = p;
|
|
134
133
|
return o;
|
|
135
134
|
};
|
|
136
|
-
|
|
137
135
|
return _setPrototypeOf(o, p);
|
|
138
136
|
}
|
|
139
137
|
|
|
@@ -55,7 +55,7 @@ var ButtonSkeleton = function ButtonSkeleton(_ref) {
|
|
|
55
55
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
56
56
|
|
|
57
57
|
var prefix = usePrefix.usePrefix();
|
|
58
|
-
var buttonClasses = cx__default["default"](className, (_cx = {}, _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--skeleton"), true), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn"), true), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn--sm"), small || size === 'sm'), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn--md"), size === 'field' || size === 'md'), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn--xl"), size === 'xl'), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn--2xl"), size === '2xl'), _cx));
|
|
58
|
+
var buttonClasses = cx__default["default"](className, (_cx = {}, _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--skeleton"), true), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn"), true), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn--sm"), small || size === 'sm'), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn--md"), size === 'field' || size === 'md'), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn--lg"), size === 'lg'), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn--xl"), size === 'xl'), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn--2xl"), size === '2xl'), _cx));
|
|
59
59
|
|
|
60
60
|
var commonProps = _rollupPluginBabelHelpers.objectSpread2({
|
|
61
61
|
className: buttonClasses
|
|
@@ -36,9 +36,8 @@ var Checkbox = /*#__PURE__*/React__default["default"].forwardRef(function Checkb
|
|
|
36
36
|
other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
37
37
|
|
|
38
38
|
var prefix = usePrefix.usePrefix();
|
|
39
|
-
var labelClasses = cx__default["default"]("".concat(prefix, "--checkbox-label"), [className]);
|
|
40
|
-
var innerLabelClasses = cx__default["default"]("".concat(prefix, "--checkbox-label-text"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(prefix, "--visually-hidden"), hideLabel));
|
|
41
39
|
var wrapperClasses = cx__default["default"]("".concat(prefix, "--form-item"), "".concat(prefix, "--checkbox-wrapper"), [className]);
|
|
40
|
+
var innerLabelClasses = cx__default["default"]("".concat(prefix, "--checkbox-label-text"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(prefix, "--visually-hidden"), hideLabel));
|
|
42
41
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
43
42
|
className: wrapperClasses
|
|
44
43
|
}, /*#__PURE__*/React__default["default"].createElement("input", _rollupPluginBabelHelpers["extends"]({}, other, {
|
|
@@ -64,7 +63,7 @@ var Checkbox = /*#__PURE__*/React__default["default"].forwardRef(function Checkb
|
|
|
64
63
|
}
|
|
65
64
|
})), /*#__PURE__*/React__default["default"].createElement("label", {
|
|
66
65
|
htmlFor: id,
|
|
67
|
-
className:
|
|
66
|
+
className: "".concat(prefix, "--checkbox-label"),
|
|
68
67
|
title: title || null
|
|
69
68
|
}, /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
70
69
|
className: innerLabelClasses
|
|
@@ -113,8 +112,9 @@ Checkbox.propTypes = {
|
|
|
113
112
|
labelText: PropTypes__default["default"].node.isRequired,
|
|
114
113
|
|
|
115
114
|
/**
|
|
116
|
-
*
|
|
117
|
-
*
|
|
115
|
+
* Provide an optional handler that is called when the internal state of
|
|
116
|
+
* Checkbox changes. This handler is called with event and state info.
|
|
117
|
+
* `(event, { checked, id }) => void`
|
|
118
118
|
*/
|
|
119
119
|
onChange: PropTypes__default["default"].func,
|
|
120
120
|
|
|
@@ -233,7 +233,8 @@ var ComposedModal = /*#__PURE__*/function (_Component) {
|
|
|
233
233
|
onClick: this.handleClick,
|
|
234
234
|
onKeyDown: this.handleKeyDown,
|
|
235
235
|
onTransitionEnd: open ? this.handleTransitionEnd : undefined,
|
|
236
|
-
className: modalClass
|
|
236
|
+
className: modalClass,
|
|
237
|
+
tabIndex: "-1"
|
|
237
238
|
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
238
239
|
ref: this.startSentinel,
|
|
239
240
|
tabIndex: "0",
|
|
@@ -204,7 +204,8 @@ var ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function C
|
|
|
204
204
|
onBlur: handleBlur,
|
|
205
205
|
onClick: handleClick,
|
|
206
206
|
onKeyDown: handleKeyDown,
|
|
207
|
-
className: modalClass
|
|
207
|
+
className: modalClass,
|
|
208
|
+
tabIndex: "-1"
|
|
208
209
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
209
210
|
className: containerClass,
|
|
210
211
|
role: "dialog",
|
|
@@ -14,7 +14,9 @@ var wrapComponent = require('../../tools/wrapComponent.js');
|
|
|
14
14
|
var TableActionList = wrapComponent["default"]({
|
|
15
15
|
name: 'TableActionList',
|
|
16
16
|
type: 'div',
|
|
17
|
-
className:
|
|
17
|
+
className: function className(prefix) {
|
|
18
|
+
return "".concat(prefix, "--action-list");
|
|
19
|
+
}
|
|
18
20
|
});
|
|
19
21
|
var TableActionList$1 = TableActionList;
|
|
20
22
|
|
|
@@ -14,7 +14,9 @@ var wrapComponent = require('../../tools/wrapComponent.js');
|
|
|
14
14
|
var TableToolbarContent = wrapComponent["default"]({
|
|
15
15
|
name: 'TableToolbarContent',
|
|
16
16
|
type: 'div',
|
|
17
|
-
className:
|
|
17
|
+
className: function className(prefix) {
|
|
18
|
+
return "".concat(prefix, "--toolbar-content");
|
|
19
|
+
}
|
|
18
20
|
});
|
|
19
21
|
var TableToolbarContent$1 = TableToolbarContent;
|
|
20
22
|
|
|
@@ -31,7 +31,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
31
31
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
32
32
|
var flatpickr__default = /*#__PURE__*/_interopDefaultLegacy(flatpickr);
|
|
33
33
|
|
|
34
|
-
var _excluded = ["allowInput", "appendTo", "children", "className", "dateFormat", "datePickerType", "disable", "enable", "inline", "light", "locale", "maxDate", "minDate", "onChange", "onClose", "onOpen", "short", "value"];
|
|
34
|
+
var _excluded = ["allowInput", "appendTo", "children", "className", "closeOnSelect", "dateFormat", "datePickerType", "disable", "enable", "inline", "light", "locale", "maxDate", "minDate", "onChange", "onClose", "onOpen", "short", "value"];
|
|
35
35
|
|
|
36
36
|
index["default"].en.weekdays.shorthand.forEach(function (_day, index$1) {
|
|
37
37
|
var currentDay = index["default"].en.weekdays.shorthand;
|
|
@@ -163,6 +163,8 @@ function DatePicker(_ref) {
|
|
|
163
163
|
appendTo = _ref.appendTo,
|
|
164
164
|
children = _ref.children,
|
|
165
165
|
className = _ref.className,
|
|
166
|
+
_ref$closeOnSelect = _ref.closeOnSelect,
|
|
167
|
+
closeOnSelect = _ref$closeOnSelect === void 0 ? true : _ref$closeOnSelect,
|
|
166
168
|
_ref$dateFormat = _ref.dateFormat,
|
|
167
169
|
dateFormat = _ref$dateFormat === void 0 ? 'm/d/Y' : _ref$dateFormat,
|
|
168
170
|
datePickerType = _ref.datePickerType,
|
|
@@ -262,6 +264,7 @@ function DatePicker(_ref) {
|
|
|
262
264
|
inline: inline !== null && inline !== void 0 ? inline : false,
|
|
263
265
|
disableMobile: true,
|
|
264
266
|
defaultDate: value,
|
|
267
|
+
closeOnSelect: closeOnSelect,
|
|
265
268
|
mode: datePickerType,
|
|
266
269
|
allowInput: allowInput !== null && allowInput !== void 0 ? allowInput : true,
|
|
267
270
|
dateFormat: dateFormat,
|
|
@@ -322,7 +325,7 @@ function DatePicker(_ref) {
|
|
|
322
325
|
// error with IBM Equal Access Accessibility Checker so we add an aria
|
|
323
326
|
// role to the container div.
|
|
324
327
|
|
|
325
|
-
calendar.calendarContainer.setAttribute('role', '
|
|
328
|
+
calendar.calendarContainer.setAttribute('role', 'application'); // IBM EAAC requires an aria-label on a role='region'
|
|
326
329
|
|
|
327
330
|
calendar.calendarContainer.setAttribute('aria-label', 'calendar-container');
|
|
328
331
|
}
|
|
@@ -386,9 +389,10 @@ function DatePicker(_ref) {
|
|
|
386
389
|
}, [inline]);
|
|
387
390
|
React.useEffect(function () {
|
|
388
391
|
if (calendarRef.current) {
|
|
389
|
-
|
|
390
|
-
value
|
|
391
|
-
}
|
|
392
|
+
if (value !== undefined) {
|
|
393
|
+
calendarRef.current.setDate(value);
|
|
394
|
+
}
|
|
395
|
+
|
|
392
396
|
updateClassNames(calendarRef.current, prefix); //for simple date picker w/o calendar; initial mount may not have value
|
|
393
397
|
} else if (!calendarRef.current && value) {
|
|
394
398
|
startInputField.current.value = value;
|
|
@@ -423,6 +427,11 @@ DatePicker.propTypes = {
|
|
|
423
427
|
*/
|
|
424
428
|
className: PropTypes__default["default"].string,
|
|
425
429
|
|
|
430
|
+
/**
|
|
431
|
+
* flatpickr prop passthrough. Controls whether the calendar dropdown closes upon selection.
|
|
432
|
+
*/
|
|
433
|
+
closeOnSelect: PropTypes__default["default"].bool,
|
|
434
|
+
|
|
426
435
|
/**
|
|
427
436
|
* The date format.
|
|
428
437
|
*/
|
|
@@ -253,7 +253,7 @@ _rollupPluginBabelHelpers.defineProperty(FileUploader, "propTypes", {
|
|
|
253
253
|
iconDescription: FeatureFlags__namespace.enabled('enable-v11-release') ? PropTypes__default["default"].string.isRequired : PropTypes__default["default"].string,
|
|
254
254
|
|
|
255
255
|
/**
|
|
256
|
-
* Specify the description text of this
|
|
256
|
+
* Specify the description text of this `<FileUploader>`
|
|
257
257
|
*/
|
|
258
258
|
labelDescription: PropTypes__default["default"].string,
|
|
259
259
|
|
|
@@ -175,7 +175,7 @@ FileUploaderButton.propTypes = {
|
|
|
175
175
|
disabled: PropTypes__default["default"].bool,
|
|
176
176
|
|
|
177
177
|
/**
|
|
178
|
-
* Provide a unique id for the underlying
|
|
178
|
+
* Provide a unique id for the underlying `<input>` node
|
|
179
179
|
*/
|
|
180
180
|
id: PropTypes__default["default"].string,
|
|
181
181
|
|
|
@@ -78,7 +78,7 @@ Filename.propTypes = {
|
|
|
78
78
|
status: PropTypes__default["default"].oneOf(['edit', 'complete', 'uploading']),
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
|
-
* Provide a custom tabIndex value for the
|
|
81
|
+
* Provide a custom tabIndex value for the `<Filename>`
|
|
82
82
|
*/
|
|
83
83
|
tabIndex: PropTypes__default["default"].string
|
|
84
84
|
};
|
|
@@ -28,9 +28,12 @@ var Link = /*#__PURE__*/React__default["default"].forwardRef(function Link(_ref,
|
|
|
28
28
|
var children = _ref.children,
|
|
29
29
|
customClassName = _ref.className,
|
|
30
30
|
href = _ref.href,
|
|
31
|
-
disabled = _ref.disabled,
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
_ref$disabled = _ref.disabled,
|
|
32
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
33
|
+
_ref$inline = _ref.inline,
|
|
34
|
+
inline = _ref$inline === void 0 ? false : _ref$inline,
|
|
35
|
+
_ref$visited = _ref.visited,
|
|
36
|
+
visited = _ref$visited === void 0 ? false : _ref$visited,
|
|
34
37
|
Icon = _ref.renderIcon,
|
|
35
38
|
size = _ref.size,
|
|
36
39
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
@@ -10,33 +10,13 @@
|
|
|
10
10
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
11
|
|
|
12
12
|
var PropTypes = require('prop-types');
|
|
13
|
-
var FeatureFlags = require('@carbon/feature-flags');
|
|
14
13
|
|
|
15
14
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
15
|
|
|
17
|
-
function _interopNamespace(e) {
|
|
18
|
-
if (e && e.__esModule) return e;
|
|
19
|
-
var n = Object.create(null);
|
|
20
|
-
if (e) {
|
|
21
|
-
Object.keys(e).forEach(function (k) {
|
|
22
|
-
if (k !== 'default') {
|
|
23
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
24
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () { return e[k]; }
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
n["default"] = e;
|
|
32
|
-
return Object.freeze(n);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
16
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
36
|
-
var FeatureFlags__namespace = /*#__PURE__*/_interopNamespace(FeatureFlags);
|
|
37
17
|
|
|
38
18
|
var ListBoxType = PropTypes__default["default"].oneOf(['default', 'inline']);
|
|
39
|
-
var ListBoxSize =
|
|
19
|
+
var ListBoxSize = PropTypes__default["default"].oneOf(['sm', 'md', 'lg']);
|
|
40
20
|
|
|
41
21
|
exports.ListBoxSize = ListBoxSize;
|
|
42
22
|
exports.ListBoxType = ListBoxType;
|
|
@@ -31,7 +31,7 @@ var _Close, _Close2, _defaultTranslations;
|
|
|
31
31
|
* selection.
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
function ListBoxSelection(_ref) {
|
|
35
35
|
var _cx;
|
|
36
36
|
|
|
37
37
|
var clearSelection = _ref.clearSelection,
|
|
@@ -98,7 +98,7 @@ var ListBoxSelection = function ListBoxSelection(_ref) {
|
|
|
98
98
|
"aria-label": description,
|
|
99
99
|
title: description
|
|
100
100
|
}, selectionCount, _Close2 || (_Close2 = /*#__PURE__*/React__default["default"].createElement(iconsReact.Close, null)));
|
|
101
|
-
}
|
|
101
|
+
}
|
|
102
102
|
|
|
103
103
|
var translationIds = {
|
|
104
104
|
'clear.all': 'clear.all',
|
|
@@ -153,7 +153,6 @@ ListBoxSelection.defaultProps = {
|
|
|
153
153
|
return defaultTranslations[id];
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
|
-
var ListBoxSelection$1 = ListBoxSelection;
|
|
157
156
|
|
|
158
|
-
exports["default"] = ListBoxSelection
|
|
157
|
+
exports["default"] = ListBoxSelection;
|
|
159
158
|
exports.translationIds = translationIds;
|
|
@@ -386,7 +386,7 @@ var OverflowMenu = /*#__PURE__*/function (_Component) {
|
|
|
386
386
|
"aria-label": ariaLabel,
|
|
387
387
|
id: id,
|
|
388
388
|
ref: mergeRefs["default"](this._triggerRef, ref)
|
|
389
|
-
}), /*#__PURE__*/React__default["default"].createElement(IconElement, iconProps
|
|
389
|
+
}), /*#__PURE__*/React__default["default"].createElement(IconElement, iconProps), open && wrappedMenuBody));
|
|
390
390
|
}
|
|
391
391
|
}], [{
|
|
392
392
|
key: "getDerivedStateFromProps",
|
|
@@ -63,8 +63,6 @@ function ProgressStep(_ref) {
|
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
var SVGIcon = function SVGIcon(_ref2) {
|
|
66
|
-
var _title;
|
|
67
|
-
|
|
68
66
|
var complete = _ref2.complete,
|
|
69
67
|
current = _ref2.current,
|
|
70
68
|
description = _ref2.description,
|
|
@@ -74,7 +72,7 @@ function ProgressStep(_ref) {
|
|
|
74
72
|
if (invalid) {
|
|
75
73
|
return /*#__PURE__*/React__default["default"].createElement(iconsReact.Warning, {
|
|
76
74
|
className: "".concat(prefix, "--progress__warning")
|
|
77
|
-
},
|
|
75
|
+
}, /*#__PURE__*/React__default["default"].createElement("title", null, description));
|
|
78
76
|
}
|
|
79
77
|
|
|
80
78
|
if (current) {
|
|
@@ -60,7 +60,8 @@ var RadioButton = /*#__PURE__*/React__default["default"].forwardRef(function Rad
|
|
|
60
60
|
id: uniqueId,
|
|
61
61
|
ref: ref,
|
|
62
62
|
disabled: disabled,
|
|
63
|
-
value: value
|
|
63
|
+
value: value,
|
|
64
|
+
name: name
|
|
64
65
|
})), /*#__PURE__*/React__default["default"].createElement("label", {
|
|
65
66
|
htmlFor: uniqueId,
|
|
66
67
|
className: "".concat(prefix, "--radio-button__label")
|
|
@@ -153,6 +153,7 @@ var Search = /*#__PURE__*/React__default["default"].forwardRef(function Search(_
|
|
|
153
153
|
className: clearClasses,
|
|
154
154
|
disabled: disabled,
|
|
155
155
|
onClick: clearInput,
|
|
156
|
+
title: closeButtonLabelText,
|
|
156
157
|
type: "button"
|
|
157
158
|
}, _Close || (_Close = /*#__PURE__*/React__default["default"].createElement(iconsReact.Close, null))));
|
|
158
159
|
});
|
|
@@ -608,6 +608,11 @@ var TabPanel = /*#__PURE__*/React__default["default"].forwardRef(function TabPan
|
|
|
608
608
|
tabIndex = _useState8[0],
|
|
609
609
|
setTabIndex = _useState8[1];
|
|
610
610
|
|
|
611
|
+
var _useState9 = React.useState(false),
|
|
612
|
+
_useState10 = _rollupPluginBabelHelpers.slicedToArray(_useState9, 2),
|
|
613
|
+
interactiveContent = _useState10[0],
|
|
614
|
+
setInteractiveContent = _useState10[1];
|
|
615
|
+
|
|
611
616
|
var _React$useContext3 = React__default["default"].useContext(TabsContext),
|
|
612
617
|
selectedIndex = _React$useContext3.selectedIndex,
|
|
613
618
|
baseId = _React$useContext3.baseId;
|
|
@@ -615,14 +620,47 @@ var TabPanel = /*#__PURE__*/React__default["default"].forwardRef(function TabPan
|
|
|
615
620
|
var index = React__default["default"].useContext(TabPanelContext);
|
|
616
621
|
var id = "".concat(baseId, "-tabpanel-").concat(index);
|
|
617
622
|
var tabId = "".concat(baseId, "-tab-").concat(index);
|
|
618
|
-
var className = cx__default["default"]("".concat(prefix, "--tab-content"), customClassName
|
|
623
|
+
var className = cx__default["default"]("".concat(prefix, "--tab-content"), customClassName, _rollupPluginBabelHelpers.defineProperty({}, "".concat(prefix, "--tab-content--interactive"), interactiveContent));
|
|
624
|
+
useEffectOnce.useEffectOnce(function () {
|
|
625
|
+
if (!panel.current) {
|
|
626
|
+
return;
|
|
627
|
+
}
|
|
619
628
|
|
|
620
|
-
|
|
621
|
-
var interactiveContent = useNoInteractiveChildren.getInteractiveContent(panel.current);
|
|
629
|
+
var content = useNoInteractiveChildren.getInteractiveContent(panel.current);
|
|
622
630
|
|
|
623
|
-
if (
|
|
631
|
+
if (content) {
|
|
632
|
+
setInteractiveContent(true);
|
|
624
633
|
setTabIndex('-1');
|
|
625
634
|
}
|
|
635
|
+
}); // tabindex should only be 0 if no interactive content in children
|
|
636
|
+
|
|
637
|
+
React.useEffect(function () {
|
|
638
|
+
if (!panel.current) {
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
var node = panel.current;
|
|
643
|
+
|
|
644
|
+
function callback() {
|
|
645
|
+
var content = useNoInteractiveChildren.getInteractiveContent(node);
|
|
646
|
+
|
|
647
|
+
if (content) {
|
|
648
|
+
setInteractiveContent(true);
|
|
649
|
+
setTabIndex('-1');
|
|
650
|
+
} else {
|
|
651
|
+
setInteractiveContent(false);
|
|
652
|
+
setTabIndex('0');
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
var observer = new MutationObserver(callback);
|
|
657
|
+
observer.observe(node, {
|
|
658
|
+
childList: true,
|
|
659
|
+
subtree: true
|
|
660
|
+
});
|
|
661
|
+
return function () {
|
|
662
|
+
observer.disconnect(node);
|
|
663
|
+
};
|
|
626
664
|
}, []);
|
|
627
665
|
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
628
666
|
"aria-labelledby": tabId,
|