@carbon/react 1.26.0 → 1.27.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/components/Checkbox/Checkbox.d.ts +20 -0
- package/es/components/Checkbox/Checkbox.js +58 -4
- package/es/components/CheckboxGroup/CheckboxGroup.js +119 -0
- package/es/components/ComboBox/ComboBox.js +11 -2
- package/es/components/ContentSwitcher/ContentSwitcher.js +9 -4
- package/es/components/Copy/Copy.js +1 -1
- package/es/components/DataTable/DataTable.js +44 -2
- package/es/components/DataTable/Table.js +1 -2
- package/es/components/DataTable/TableCell.js +1 -2
- package/es/components/DataTable/TableExpandRow.js +1 -2
- package/es/components/DataTable/TableExpandedRow.js +1 -2
- package/es/components/DataTable/TableHead.js +1 -2
- package/es/components/DataTable/TableHeader.js +1 -2
- package/es/components/DataTable/TableRow.js +1 -2
- package/es/components/DataTable/TableSelectAll.js +1 -2
- package/es/components/DataTable/TableSelectRow.js +1 -2
- package/es/components/DataTable/TableToolbar.js +2 -3
- package/es/components/DataTable/TableToolbarAction.js +1 -2
- package/es/components/DataTable/TableToolbarContent.js +1 -2
- package/es/components/DataTable/TableToolbarMenu.js +1 -2
- package/es/components/DataTable/index.d.ts +29 -0
- package/es/components/DataTable/index.js +70 -0
- package/es/components/DatePicker/DatePicker.js +25 -3
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +15 -1
- package/es/components/DatePickerInput/DatePickerInput.js +7 -2
- package/es/components/Dropdown/Dropdown.js +16 -4
- package/es/components/ErrorBoundary/ErrorBoundary.js +1 -1
- package/es/components/FileUploader/FileUploader.js +1 -1
- package/es/components/FluidDatePicker/FluidDatePicker.js +9 -2
- package/es/components/IconButton/index.js +19 -5
- package/es/components/Modal/Modal.js +4 -2
- package/es/components/ModalWrapper/ModalWrapper.js +1 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +9 -1
- package/es/components/MultiSelect/MultiSelect.js +2 -1
- package/es/components/NumberInput/NumberInput.js +10 -2
- package/es/components/ProgressBar/ProgressBar.js +3 -0
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +2 -1
- package/es/components/Select/Select.d.ts +1 -1
- package/es/components/Select/Select.js +10 -1
- package/es/components/StructuredList/StructuredList.js +2 -1
- package/es/components/Switch/IconSwitch.js +174 -0
- package/es/components/TextArea/TextArea.js +16 -1
- package/es/components/TextInput/ControlledPasswordInput.js +11 -2
- package/es/components/TextInput/PasswordInput.js +4 -1
- package/es/components/TextInput/index.js +0 -3
- package/es/components/TextInput/util.js +15 -2
- package/es/components/Tile/Tile.js +6 -4
- package/es/components/Toggle/Toggle.Skeleton.d.ts +58 -0
- package/es/components/Toggle/Toggle.Skeleton.js +1 -1
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +1 -1
- package/es/components/Tooltip/Tooltip.d.ts +1 -1
- package/es/components/UIShell/HeaderMenu.js +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +4 -1
- package/lib/components/Checkbox/Checkbox.d.ts +20 -0
- package/lib/components/Checkbox/Checkbox.js +58 -4
- package/lib/components/CheckboxGroup/CheckboxGroup.js +129 -0
- package/lib/components/ComboBox/ComboBox.js +10 -1
- package/lib/components/ContentSwitcher/ContentSwitcher.js +9 -4
- package/lib/components/Copy/Copy.js +1 -1
- package/lib/components/DataTable/DataTable.js +48 -6
- package/lib/components/DataTable/Table.js +1 -2
- package/lib/components/DataTable/TableCell.js +1 -2
- package/lib/components/DataTable/TableExpandRow.js +1 -2
- package/lib/components/DataTable/TableExpandedRow.js +1 -2
- package/lib/components/DataTable/TableHead.js +1 -2
- package/lib/components/DataTable/TableHeader.js +1 -2
- package/lib/components/DataTable/TableRow.js +1 -2
- package/lib/components/DataTable/TableSelectAll.js +1 -2
- package/lib/components/DataTable/TableSelectRow.js +1 -2
- package/lib/components/DataTable/TableToolbar.js +1 -2
- package/lib/components/DataTable/TableToolbarAction.js +1 -2
- package/lib/components/DataTable/TableToolbarContent.js +1 -2
- package/lib/components/DataTable/TableToolbarMenu.js +1 -2
- package/lib/components/DataTable/index.d.ts +29 -0
- package/lib/components/DataTable/index.js +76 -0
- package/lib/components/DatePicker/DatePicker.js +25 -3
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +15 -1
- package/lib/components/DatePickerInput/DatePickerInput.js +7 -2
- package/lib/components/Dropdown/Dropdown.js +15 -3
- package/lib/components/FluidDatePicker/FluidDatePicker.js +9 -2
- package/lib/components/IconButton/index.js +19 -5
- package/lib/components/Modal/Modal.js +4 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.js +8 -0
- package/lib/components/MultiSelect/MultiSelect.js +2 -1
- package/lib/components/NumberInput/NumberInput.js +10 -2
- package/lib/components/ProgressBar/ProgressBar.js +3 -0
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +2 -1
- package/lib/components/Select/Select.d.ts +1 -1
- package/lib/components/Select/Select.js +9 -0
- package/lib/components/StructuredList/StructuredList.js +2 -1
- package/lib/components/Switch/IconSwitch.js +184 -0
- package/lib/components/TextArea/TextArea.js +16 -1
- package/lib/components/TextInput/ControlledPasswordInput.js +10 -1
- package/lib/components/TextInput/PasswordInput.js +4 -1
- package/lib/components/TextInput/index.js +0 -3
- package/lib/components/TextInput/util.js +15 -2
- package/lib/components/Tile/Tile.js +6 -4
- package/lib/components/Toggle/Toggle.Skeleton.d.ts +58 -0
- package/lib/components/Toggle/Toggle.Skeleton.js +1 -1
- package/lib/components/Tooltip/Tooltip.d.ts +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +6 -1
- package/package.json +12 -12
|
@@ -25,6 +25,10 @@ export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputE
|
|
|
25
25
|
* Specify whether the Checkbox should be disabled
|
|
26
26
|
*/
|
|
27
27
|
disabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Provide text for the form group for additional help
|
|
30
|
+
*/
|
|
31
|
+
helperText?: React.ReactNode;
|
|
28
32
|
/**
|
|
29
33
|
* Specify whether the label should be hidden, or not
|
|
30
34
|
*/
|
|
@@ -33,6 +37,22 @@ export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputE
|
|
|
33
37
|
* Specify whether the Checkbox is in an indeterminate state
|
|
34
38
|
*/
|
|
35
39
|
indeterminate?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Specify whether the Checkbox is currently invalid
|
|
42
|
+
*/
|
|
43
|
+
invalid?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Provide the text that is displayed when the Checkbox is in an invalid state
|
|
46
|
+
*/
|
|
47
|
+
invalidText: React.ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* Specify whether the Checkbox is currently invalid
|
|
50
|
+
*/
|
|
51
|
+
warn?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Provide the text that is displayed when the Checkbox is in an invalid state
|
|
54
|
+
*/
|
|
55
|
+
warnText: React.ReactNode;
|
|
36
56
|
/**
|
|
37
57
|
* Provide an optional handler that is called when the internal state of
|
|
38
58
|
* Checkbox changes. This handler is called with event and state info.
|
|
@@ -11,29 +11,48 @@ import React__default from 'react';
|
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import '../Text/index.js';
|
|
13
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
|
+
import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
|
|
15
|
+
import setupGetInstanceId from '../../tools/setupGetInstanceId.js';
|
|
14
16
|
import { Text } from '../Text/Text.js';
|
|
15
17
|
|
|
16
|
-
var _excluded = ["className", "id", "labelText", "onChange", "onClick", "indeterminate", "hideLabel", "readOnly", "title"];
|
|
18
|
+
var _excluded = ["className", "helperText", "id", "labelText", "onChange", "onClick", "indeterminate", "invalid", "invalidText", "hideLabel", "readOnly", "title", "warn", "warnText"];
|
|
19
|
+
var getInstanceId = setupGetInstanceId();
|
|
17
20
|
var Checkbox = /*#__PURE__*/React__default.forwardRef(function (_ref, _ref2) {
|
|
21
|
+
var _classNames;
|
|
22
|
+
|
|
18
23
|
var className = _ref.className,
|
|
24
|
+
helperText = _ref.helperText,
|
|
19
25
|
id = _ref.id,
|
|
20
26
|
labelText = _ref.labelText,
|
|
21
27
|
_onChange = _ref.onChange,
|
|
22
28
|
_onClick = _ref.onClick,
|
|
23
29
|
indeterminate = _ref.indeterminate,
|
|
30
|
+
invalid = _ref.invalid,
|
|
31
|
+
invalidText = _ref.invalidText,
|
|
24
32
|
hideLabel = _ref.hideLabel,
|
|
25
33
|
readOnly = _ref.readOnly,
|
|
26
34
|
_ref$title = _ref.title,
|
|
27
35
|
title = _ref$title === void 0 ? '' : _ref$title,
|
|
36
|
+
warn = _ref.warn,
|
|
37
|
+
warnText = _ref.warnText,
|
|
28
38
|
other = _objectWithoutProperties(_ref, _excluded);
|
|
29
39
|
|
|
30
40
|
var prefix = usePrefix();
|
|
31
|
-
var
|
|
41
|
+
var showWarning = !readOnly && !invalid && warn;
|
|
42
|
+
var showHelper = !invalid && !warn;
|
|
43
|
+
var checkboxGroupInstanceId = getInstanceId();
|
|
44
|
+
var helperId = !helperText ? undefined : "checkbox-helper-text-".concat(checkboxGroupInstanceId);
|
|
45
|
+
var helper = helperText ? /*#__PURE__*/React__default.createElement("div", {
|
|
46
|
+
id: helperId,
|
|
47
|
+
className: "".concat(prefix, "--form__helper-text")
|
|
48
|
+
}, helperText) : null;
|
|
49
|
+
var wrapperClasses = cx("".concat(prefix, "--form-item"), "".concat(prefix, "--checkbox-wrapper"), className, (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "--checkbox-wrapper--readonly"), readOnly), _defineProperty(_classNames, "".concat(prefix, "--checkbox-wrapper--invalid"), !readOnly && invalid), _defineProperty(_classNames, "".concat(prefix, "--checkbox-wrapper--warning"), showWarning), _classNames));
|
|
32
50
|
var innerLabelClasses = cx("".concat(prefix, "--checkbox-label-text"), _defineProperty({}, "".concat(prefix, "--visually-hidden"), hideLabel));
|
|
33
51
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
34
52
|
className: wrapperClasses
|
|
35
53
|
}, /*#__PURE__*/React__default.createElement("input", _extends({}, other, {
|
|
36
54
|
type: "checkbox",
|
|
55
|
+
"data-invalid": invalid ? true : undefined,
|
|
37
56
|
onChange: function onChange(evt) {
|
|
38
57
|
if (!readOnly && _onChange) {
|
|
39
58
|
_onChange(evt, {
|
|
@@ -75,7 +94,17 @@ var Checkbox = /*#__PURE__*/React__default.forwardRef(function (_ref, _ref2) {
|
|
|
75
94
|
title: title
|
|
76
95
|
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
77
96
|
className: innerLabelClasses
|
|
78
|
-
}, labelText))
|
|
97
|
+
}, labelText)), /*#__PURE__*/React__default.createElement("div", {
|
|
98
|
+
className: "".concat(prefix, "--checkbox__validation-msg")
|
|
99
|
+
}, !readOnly && invalid && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(WarningFilled, {
|
|
100
|
+
className: "".concat(prefix, "--checkbox__invalid-icon")
|
|
101
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
102
|
+
className: "".concat(prefix, "--form-requirement")
|
|
103
|
+
}, invalidText)), showWarning && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(WarningAltFilled, {
|
|
104
|
+
className: "".concat(prefix, "--checkbox__invalid-icon ").concat(prefix, "--checkbox__invalid-icon--warning")
|
|
105
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
106
|
+
className: "".concat(prefix, "--form-requirement")
|
|
107
|
+
}, warnText))), showHelper && helper);
|
|
79
108
|
});
|
|
80
109
|
Checkbox.propTypes = {
|
|
81
110
|
/**
|
|
@@ -98,6 +127,11 @@ Checkbox.propTypes = {
|
|
|
98
127
|
*/
|
|
99
128
|
disabled: PropTypes.bool,
|
|
100
129
|
|
|
130
|
+
/**
|
|
131
|
+
* Provide text for the form group for additional help
|
|
132
|
+
*/
|
|
133
|
+
helperText: PropTypes.node,
|
|
134
|
+
|
|
101
135
|
/**
|
|
102
136
|
* Specify whether the label should be hidden, or not
|
|
103
137
|
*/
|
|
@@ -113,6 +147,16 @@ Checkbox.propTypes = {
|
|
|
113
147
|
*/
|
|
114
148
|
indeterminate: PropTypes.bool,
|
|
115
149
|
|
|
150
|
+
/**
|
|
151
|
+
* Specify whether the Checkbox is currently invalid
|
|
152
|
+
*/
|
|
153
|
+
invalid: PropTypes.bool,
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Provide the text that is displayed when the Checkbox is in an invalid state
|
|
157
|
+
*/
|
|
158
|
+
invalidText: PropTypes.node,
|
|
159
|
+
|
|
116
160
|
/**
|
|
117
161
|
* Provide a label to provide a description of the Checkbox input that you are
|
|
118
162
|
* exposing to the user
|
|
@@ -134,7 +178,17 @@ Checkbox.propTypes = {
|
|
|
134
178
|
/**
|
|
135
179
|
* Specify a title for the <label> node for the Checkbox
|
|
136
180
|
*/
|
|
137
|
-
title: PropTypes.string
|
|
181
|
+
title: PropTypes.string,
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Specify whether the Checkbox is currently in warning state
|
|
185
|
+
*/
|
|
186
|
+
warn: PropTypes.bool,
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Provide the text that is displayed when the Checkbox is in warning state
|
|
190
|
+
*/
|
|
191
|
+
warnText: PropTypes.node
|
|
138
192
|
};
|
|
139
193
|
Checkbox.defaultProps = {
|
|
140
194
|
onChange: function onChange() {},
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import React__default from 'react';
|
|
11
|
+
import cx from 'classnames';
|
|
12
|
+
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
|
+
import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
|
|
14
|
+
import setupGetInstanceId from '../../tools/setupGetInstanceId.js';
|
|
15
|
+
|
|
16
|
+
var _excluded = ["children", "className", "helperText", "invalid", "invalidText", "legendId", "legendText", "readOnly", "warn", "warnText"];
|
|
17
|
+
var getInstanceId = setupGetInstanceId();
|
|
18
|
+
|
|
19
|
+
function CheckboxGroup(_ref) {
|
|
20
|
+
var _cx;
|
|
21
|
+
|
|
22
|
+
var children = _ref.children,
|
|
23
|
+
className = _ref.className,
|
|
24
|
+
helperText = _ref.helperText,
|
|
25
|
+
invalid = _ref.invalid,
|
|
26
|
+
invalidText = _ref.invalidText,
|
|
27
|
+
legendId = _ref.legendId,
|
|
28
|
+
legendText = _ref.legendText,
|
|
29
|
+
readOnly = _ref.readOnly,
|
|
30
|
+
warn = _ref.warn,
|
|
31
|
+
warnText = _ref.warnText,
|
|
32
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
+
|
|
34
|
+
var prefix = usePrefix();
|
|
35
|
+
var showWarning = !readOnly && !invalid && warn;
|
|
36
|
+
var showHelper = !invalid && !warn;
|
|
37
|
+
var checkboxGroupInstanceId = getInstanceId();
|
|
38
|
+
var helperId = !helperText ? undefined : "checkbox-group-helper-text-".concat(checkboxGroupInstanceId);
|
|
39
|
+
var helper = helperText ? /*#__PURE__*/React__default.createElement("div", {
|
|
40
|
+
id: helperId,
|
|
41
|
+
className: "".concat(prefix, "--form__helper-text")
|
|
42
|
+
}, helperText) : null;
|
|
43
|
+
var fieldsetClasses = cx("".concat(prefix, "--checkbox-group"), className, (_cx = {}, _defineProperty(_cx, "".concat(prefix, "--checkbox-group--readonly"), readOnly), _defineProperty(_cx, "".concat(prefix, "--checkbox-group--invalid"), !readOnly && invalid), _defineProperty(_cx, "".concat(prefix, "--checkbox-group--warning"), showWarning), _cx));
|
|
44
|
+
return /*#__PURE__*/React__default.createElement("fieldset", _extends({
|
|
45
|
+
className: fieldsetClasses,
|
|
46
|
+
"data-invalid": invalid ? true : undefined,
|
|
47
|
+
"aria-labelledby": rest['aria-labelledby'] || legendId,
|
|
48
|
+
"aria-readonly": readOnly,
|
|
49
|
+
"aria-describedby": !invalid && !warn && helper ? helperId : undefined
|
|
50
|
+
}, rest), /*#__PURE__*/React__default.createElement("legend", {
|
|
51
|
+
className: "".concat(prefix, "--label"),
|
|
52
|
+
id: legendId || rest['aria-labelledby']
|
|
53
|
+
}, legendText), children, /*#__PURE__*/React__default.createElement("div", {
|
|
54
|
+
className: "".concat(prefix, "--checkbox-group__validation-msg")
|
|
55
|
+
}, !readOnly && invalid && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(WarningFilled, {
|
|
56
|
+
className: "".concat(prefix, "--checkbox__invalid-icon")
|
|
57
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
58
|
+
className: "".concat(prefix, "--form-requirement")
|
|
59
|
+
}, invalidText)), showWarning && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(WarningAltFilled, {
|
|
60
|
+
className: "".concat(prefix, "--checkbox__invalid-icon ").concat(prefix, "--checkbox__invalid-icon--warning")
|
|
61
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
62
|
+
className: "".concat(prefix, "--form-requirement")
|
|
63
|
+
}, warnText))), showHelper && helper);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
CheckboxGroup.propTypes = {
|
|
67
|
+
/**
|
|
68
|
+
* Provide the children form elements to be rendered inside of the <fieldset>
|
|
69
|
+
*/
|
|
70
|
+
children: PropTypes.node,
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Provide a custom className to be applied to the containing <fieldset> node
|
|
74
|
+
*/
|
|
75
|
+
className: PropTypes.string,
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Provide text for the form group for additional help
|
|
79
|
+
*/
|
|
80
|
+
helperText: PropTypes.node,
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Specify whether the form group is currently invalid
|
|
84
|
+
*/
|
|
85
|
+
invalid: PropTypes.bool,
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Provide the text that is displayed when the form group is in an invalid state
|
|
89
|
+
*/
|
|
90
|
+
invalidText: PropTypes.node,
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Provide id for the fieldset <legend> which corresponds to the fieldset
|
|
94
|
+
* `aria-labelledby`
|
|
95
|
+
*/
|
|
96
|
+
legendId: PropTypes.node,
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Provide the text to be rendered inside of the fieldset <legend>
|
|
100
|
+
*/
|
|
101
|
+
legendText: PropTypes.node.isRequired,
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Whether the CheckboxGroup should be read-only
|
|
105
|
+
*/
|
|
106
|
+
readOnly: PropTypes.bool,
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Specify whether the form group is currently in warning state
|
|
110
|
+
*/
|
|
111
|
+
warn: PropTypes.bool,
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Provide the text that is displayed when the form group is in warning state
|
|
115
|
+
*/
|
|
116
|
+
warnText: PropTypes.node
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export { CheckboxGroup as default };
|
|
@@ -25,7 +25,7 @@ import { Text } from '../Text/Text.js';
|
|
|
25
25
|
import ListBoxSelection from '../ListBox/next/ListBoxSelection.js';
|
|
26
26
|
import ListBoxTrigger from '../ListBox/next/ListBoxTrigger.js';
|
|
27
27
|
import { ListBoxSize, ListBoxType } from '../ListBox/ListBoxPropTypes.js';
|
|
28
|
-
import { Space, Enter, Escape } from '../../internal/keyboard/keys.js';
|
|
28
|
+
import { Space, Enter, Escape, Home, End } from '../../internal/keyboard/keys.js';
|
|
29
29
|
|
|
30
30
|
var _ComboBox$propTypes, _ComboBox$defaultProp;
|
|
31
31
|
|
|
@@ -315,6 +315,14 @@ var ComboBox = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
315
315
|
event.persist();
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
+
|
|
319
|
+
if (match(event, Home)) {
|
|
320
|
+
event.target.setSelectionRange(0, 0);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
if (match(event, End)) {
|
|
324
|
+
event.target.setSelectionRange(event.target.value.length, event.target.value.length);
|
|
325
|
+
}
|
|
318
326
|
}
|
|
319
327
|
});
|
|
320
328
|
|
|
@@ -362,7 +370,8 @@ var ComboBox = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
362
370
|
title: textInput === null || textInput === void 0 ? void 0 : (_textInput$current = textInput.current) === null || _textInput$current === void 0 ? void 0 : _textInput$current.value
|
|
363
371
|
}, inputProps, rest, readOnlyEventHandlers, {
|
|
364
372
|
readOnly: readOnly,
|
|
365
|
-
ref: mergeRefs(textInput, ref)
|
|
373
|
+
ref: mergeRefs(textInput, ref),
|
|
374
|
+
"aria-describedby": helperText && !invalid && !warn && !isFluid ? comboBoxHelperId : undefined
|
|
366
375
|
})), invalid && /*#__PURE__*/React__default.createElement(WarningFilled, {
|
|
367
376
|
className: "".concat(prefix, "--list-box__invalid-icon")
|
|
368
377
|
}), showWarning && /*#__PURE__*/React__default.createElement(WarningAltFilled, {
|
|
@@ -106,7 +106,12 @@ var ContentSwitcher = /*#__PURE__*/function (_React$Component) {
|
|
|
106
106
|
var size = _this$props.size,
|
|
107
107
|
other = _objectWithoutProperties(_this$props, _excluded);
|
|
108
108
|
|
|
109
|
-
var
|
|
109
|
+
var isIconOnly = React__default.Children.map(children, function (child) {
|
|
110
|
+
return child.type.displayName === 'IconSwitch';
|
|
111
|
+
}).every(function (val) {
|
|
112
|
+
return val === true;
|
|
113
|
+
});
|
|
114
|
+
var classes = cx("".concat(prefix, "--content-switcher"), className, (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "--content-switcher--light"), light), _defineProperty(_classNames, "".concat(prefix, "--content-switcher--").concat(size), size), _defineProperty(_classNames, "".concat(prefix, "--content-switcher--icon-only"), isIconOnly), _classNames));
|
|
110
115
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, other, {
|
|
111
116
|
className: classes,
|
|
112
117
|
role: "tablist"
|
|
@@ -116,7 +121,8 @@ var ContentSwitcher = /*#__PURE__*/function (_React$Component) {
|
|
|
116
121
|
onClick: composeEventHandlers([_this2.handleChildChange, child.props.onClick]),
|
|
117
122
|
onKeyDown: _this2.handleChildChange,
|
|
118
123
|
selected: index === _this2.state.selectedIndex,
|
|
119
|
-
ref: _this2.handleItemRef(index)
|
|
124
|
+
ref: _this2.handleItemRef(index),
|
|
125
|
+
size: size
|
|
120
126
|
});
|
|
121
127
|
}));
|
|
122
128
|
}
|
|
@@ -169,9 +175,8 @@ _defineProperty(ContentSwitcher, "propTypes", {
|
|
|
169
175
|
|
|
170
176
|
/**
|
|
171
177
|
* Specify the size of the Content Switcher. Currently supports either `sm`, 'md' (default) or 'lg` as an option.
|
|
172
|
-
* TODO V11: remove `xl` (replaced with lg)
|
|
173
178
|
*/
|
|
174
|
-
size: PropTypes.oneOf(['sm', 'md', 'lg'
|
|
179
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg'])
|
|
175
180
|
});
|
|
176
181
|
|
|
177
182
|
_defineProperty(ContentSwitcher, "contextType", PrefixContext);
|
|
@@ -57,13 +57,13 @@ function Copy(_ref) {
|
|
|
57
57
|
|
|
58
58
|
if (FeatureFlags.enabled('enable-v11-release')) {
|
|
59
59
|
return /*#__PURE__*/React__default.createElement(IconButton, _extends({
|
|
60
|
+
closeOnActivation: false,
|
|
60
61
|
align: "bottom",
|
|
61
62
|
className: classNames,
|
|
62
63
|
label: animation ? feedback : other['aria-label'],
|
|
63
64
|
onClick: composeEventHandlers([onClick, handleClick]),
|
|
64
65
|
onAnimationEnd: composeEventHandlers([onAnimationEnd, handleAnimationEnd])
|
|
65
66
|
}, other, {
|
|
66
|
-
"aria-live": "polite",
|
|
67
67
|
"aria-label": !children && (animation ? feedback : other['aria-label']) || null
|
|
68
68
|
}), children);
|
|
69
69
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { defineProperty as _defineProperty, inherits as _inherits, createSuper as _createSuper,
|
|
8
|
+
import { defineProperty as _defineProperty, inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2, assertThisInitialized as _assertThisInitialized, slicedToArray as _slicedToArray, createClass as _createClass } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import isEqual from 'lodash.isequal';
|
|
@@ -17,6 +17,26 @@ import { composeEventHandlers } from '../../tools/events.js';
|
|
|
17
17
|
import { defaultFilterRows } from './tools/filter.js';
|
|
18
18
|
import { defaultSortRow } from './tools/sorting.js';
|
|
19
19
|
import setupGetInstanceId from './tools/instanceId.js';
|
|
20
|
+
import { Table } from './Table.js';
|
|
21
|
+
import TableActionList from './TableActionList.js';
|
|
22
|
+
import TableBatchAction from './TableBatchAction.js';
|
|
23
|
+
import TableBatchActions from './TableBatchActions.js';
|
|
24
|
+
import TableBody from './TableBody.js';
|
|
25
|
+
import TableCell from './TableCell.js';
|
|
26
|
+
import TableContainer from './TableContainer.js';
|
|
27
|
+
import TableExpandHeader from './TableExpandHeader.js';
|
|
28
|
+
import TableExpandRow from './TableExpandRow.js';
|
|
29
|
+
import TableExpandedRow from './TableExpandedRow.js';
|
|
30
|
+
import TableHead from './TableHead.js';
|
|
31
|
+
import TableHeader from './TableHeader.js';
|
|
32
|
+
import TableRow from './TableRow.js';
|
|
33
|
+
import TableSelectAll from './TableSelectAll.js';
|
|
34
|
+
import TableSelectRow from './TableSelectRow.js';
|
|
35
|
+
import TableToolbar from './TableToolbar.js';
|
|
36
|
+
import TableToolbarAction from './TableToolbarAction.js';
|
|
37
|
+
import TableToolbarContent from './TableToolbarContent.js';
|
|
38
|
+
import TableToolbarSearch from './TableToolbarSearch.js';
|
|
39
|
+
import TableToolbarMenu from './TableToolbarMenu.js';
|
|
20
40
|
|
|
21
41
|
var _excluded = ["header", "onClick", "isSortable"],
|
|
22
42
|
_excluded2 = ["onClick", "onExpand"],
|
|
@@ -627,4 +647,26 @@ _defineProperty(DataTable, "defaultProps", {
|
|
|
627
647
|
|
|
628
648
|
_defineProperty(DataTable, "translationKeys", Object.values(translationKeys));
|
|
629
649
|
|
|
630
|
-
|
|
650
|
+
DataTable.Table = Table;
|
|
651
|
+
DataTable.TableActionList = TableActionList;
|
|
652
|
+
DataTable.TableBatchAction = TableBatchAction;
|
|
653
|
+
DataTable.TableBatchActions = TableBatchActions;
|
|
654
|
+
DataTable.TableBody = TableBody;
|
|
655
|
+
DataTable.TableCell = TableCell;
|
|
656
|
+
DataTable.TableContainer = TableContainer;
|
|
657
|
+
DataTable.TableExpandHeader = TableExpandHeader;
|
|
658
|
+
DataTable.TableExpandRow = TableExpandRow;
|
|
659
|
+
DataTable.TableExpandedRow = TableExpandedRow;
|
|
660
|
+
DataTable.TableHead = TableHead;
|
|
661
|
+
DataTable.TableHeader = TableHeader;
|
|
662
|
+
DataTable.TableRow = TableRow;
|
|
663
|
+
DataTable.TableSelectAll = TableSelectAll;
|
|
664
|
+
DataTable.TableSelectRow = TableSelectRow;
|
|
665
|
+
DataTable.TableToolbar = TableToolbar;
|
|
666
|
+
DataTable.TableToolbarAction = TableToolbarAction;
|
|
667
|
+
DataTable.TableToolbarContent = TableToolbarContent;
|
|
668
|
+
DataTable.TableToolbarSearch = TableToolbarSearch;
|
|
669
|
+
DataTable.TableToolbarMenu = TableToolbarMenu;
|
|
670
|
+
var DataTable$1 = DataTable;
|
|
671
|
+
|
|
672
|
+
export { DataTable$1 as default };
|
|
@@ -175,6 +175,5 @@ TableHeader.defaultProps = {
|
|
|
175
175
|
};
|
|
176
176
|
TableHeader.translationKeys = Object.values(translationKeys);
|
|
177
177
|
TableHeader.displayName = 'TableHeader';
|
|
178
|
-
var TableHeader$1 = TableHeader;
|
|
179
178
|
|
|
180
|
-
export { TableHeader
|
|
179
|
+
export { TableHeader as default };
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends
|
|
8
|
+
import { objectSpread2 as _objectSpread2, objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import cx from 'classnames';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import React__default from 'react';
|
|
@@ -42,6 +42,5 @@ TableToolbar.propTypes = _objectSpread2(_objectSpread2({}, AriaLabelPropType), {
|
|
|
42
42
|
TableToolbar.defaultProps = {
|
|
43
43
|
'aria-label': 'data table toolbar'
|
|
44
44
|
};
|
|
45
|
-
var TableToolbar$1 = TableToolbar;
|
|
46
45
|
|
|
47
|
-
export { TableToolbar
|
|
46
|
+
export { TableToolbar as default };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import DataTable from './DataTable';
|
|
8
|
+
import Table from './Table';
|
|
9
|
+
import TableActionList from './TableActionList';
|
|
10
|
+
import TableBatchAction from './TableBatchAction';
|
|
11
|
+
import TableBatchActions from './TableBatchActions';
|
|
12
|
+
import TableBody from './TableBody';
|
|
13
|
+
import TableCell from './TableCell';
|
|
14
|
+
import TableContainer from './TableContainer';
|
|
15
|
+
import TableExpandHeader from './TableExpandHeader';
|
|
16
|
+
import TableExpandRow from './TableExpandRow';
|
|
17
|
+
import TableExpandedRow from './TableExpandedRow';
|
|
18
|
+
import TableHead from './TableHead';
|
|
19
|
+
import TableHeader from './TableHeader';
|
|
20
|
+
import TableRow from './TableRow';
|
|
21
|
+
import TableSelectAll from './TableSelectAll';
|
|
22
|
+
import TableSelectRow from './TableSelectRow';
|
|
23
|
+
import TableToolbar from './TableToolbar';
|
|
24
|
+
import TableToolbarAction from './TableToolbarAction';
|
|
25
|
+
import TableToolbarContent from './TableToolbarContent';
|
|
26
|
+
import TableToolbarSearch from './TableToolbarSearch';
|
|
27
|
+
import TableToolbarMenu from './TableToolbarMenu';
|
|
28
|
+
export { DataTable, Table, TableActionList, TableBatchAction, TableBatchActions, TableBody, TableCell, TableContainer, TableExpandHeader, TableExpandRow, TableExpandedRow, TableHead, TableHeader, TableRow, TableSelectAll, TableSelectRow, TableToolbar, TableToolbarAction, TableToolbarContent, TableToolbarSearch, TableToolbarMenu, };
|
|
29
|
+
export default DataTable;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import DataTable from './DataTable.js';
|
|
9
|
+
export { default as DataTable, default } from './DataTable.js';
|
|
10
|
+
import { Table } from './Table.js';
|
|
11
|
+
export { Table } from './Table.js';
|
|
12
|
+
import TableActionList from './TableActionList.js';
|
|
13
|
+
export { default as TableActionList } from './TableActionList.js';
|
|
14
|
+
import TableBatchAction from './TableBatchAction.js';
|
|
15
|
+
export { default as TableBatchAction } from './TableBatchAction.js';
|
|
16
|
+
import TableBatchActions from './TableBatchActions.js';
|
|
17
|
+
export { default as TableBatchActions } from './TableBatchActions.js';
|
|
18
|
+
import TableBody from './TableBody.js';
|
|
19
|
+
export { default as TableBody } from './TableBody.js';
|
|
20
|
+
import TableCell from './TableCell.js';
|
|
21
|
+
export { default as TableCell } from './TableCell.js';
|
|
22
|
+
import TableContainer from './TableContainer.js';
|
|
23
|
+
export { default as TableContainer } from './TableContainer.js';
|
|
24
|
+
import TableExpandHeader from './TableExpandHeader.js';
|
|
25
|
+
export { default as TableExpandHeader } from './TableExpandHeader.js';
|
|
26
|
+
import TableExpandRow from './TableExpandRow.js';
|
|
27
|
+
export { default as TableExpandRow } from './TableExpandRow.js';
|
|
28
|
+
import TableExpandedRow from './TableExpandedRow.js';
|
|
29
|
+
export { default as TableExpandedRow } from './TableExpandedRow.js';
|
|
30
|
+
import TableHead from './TableHead.js';
|
|
31
|
+
export { default as TableHead } from './TableHead.js';
|
|
32
|
+
import TableHeader from './TableHeader.js';
|
|
33
|
+
export { default as TableHeader } from './TableHeader.js';
|
|
34
|
+
import TableRow from './TableRow.js';
|
|
35
|
+
export { default as TableRow } from './TableRow.js';
|
|
36
|
+
import TableSelectAll from './TableSelectAll.js';
|
|
37
|
+
export { default as TableSelectAll } from './TableSelectAll.js';
|
|
38
|
+
import TableSelectRow from './TableSelectRow.js';
|
|
39
|
+
export { default as TableSelectRow } from './TableSelectRow.js';
|
|
40
|
+
import TableToolbar from './TableToolbar.js';
|
|
41
|
+
export { default as TableToolbar } from './TableToolbar.js';
|
|
42
|
+
import TableToolbarAction from './TableToolbarAction.js';
|
|
43
|
+
export { default as TableToolbarAction } from './TableToolbarAction.js';
|
|
44
|
+
import TableToolbarContent from './TableToolbarContent.js';
|
|
45
|
+
export { default as TableToolbarContent } from './TableToolbarContent.js';
|
|
46
|
+
import TableToolbarSearch from './TableToolbarSearch.js';
|
|
47
|
+
export { default as TableToolbarSearch } from './TableToolbarSearch.js';
|
|
48
|
+
import TableToolbarMenu from './TableToolbarMenu.js';
|
|
49
|
+
export { default as TableToolbarMenu } from './TableToolbarMenu.js';
|
|
50
|
+
|
|
51
|
+
DataTable.Table = Table;
|
|
52
|
+
DataTable.TableActionList = TableActionList;
|
|
53
|
+
DataTable.TableBatchAction = TableBatchAction;
|
|
54
|
+
DataTable.TableBatchActions = TableBatchActions;
|
|
55
|
+
DataTable.TableBody = TableBody;
|
|
56
|
+
DataTable.TableCell = TableCell;
|
|
57
|
+
DataTable.TableContainer = TableContainer;
|
|
58
|
+
DataTable.TableExpandHeader = TableExpandHeader;
|
|
59
|
+
DataTable.TableExpandRow = TableExpandRow;
|
|
60
|
+
DataTable.TableExpandedRow = TableExpandedRow;
|
|
61
|
+
DataTable.TableHead = TableHead;
|
|
62
|
+
DataTable.TableHeader = TableHeader;
|
|
63
|
+
DataTable.TableRow = TableRow;
|
|
64
|
+
DataTable.TableSelectAll = TableSelectAll;
|
|
65
|
+
DataTable.TableSelectRow = TableSelectRow;
|
|
66
|
+
DataTable.TableToolbar = TableToolbar;
|
|
67
|
+
DataTable.TableToolbarAction = TableToolbarAction;
|
|
68
|
+
DataTable.TableToolbarContent = TableToolbarContent;
|
|
69
|
+
DataTable.TableToolbarSearch = TableToolbarSearch;
|
|
70
|
+
DataTable.TableToolbarMenu = TableToolbarMenu;
|