@carbon/react 1.24.0-rc.0 → 1.25.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/CodeSnippet/CodeSnippet.js +13 -115
- package/es/components/ComboBox/ComboBox.d.ts +6 -0
- package/es/components/ComboBox/ComboBox.js +19 -172
- package/es/components/ComboButton/index.js +164 -0
- package/es/components/ComposedModal/ComposedModal.js +1 -2
- package/es/components/DataTable/TableToolbar.d.ts +19 -0
- package/es/components/DataTable/TableToolbar.js +1 -1
- package/es/components/DataTable/TableToolbarAction.d.ts +21 -0
- package/es/components/DataTable/TableToolbarContent.d.ts +21 -0
- package/es/components/DataTable/TableToolbarMenu.d.ts +24 -0
- package/es/components/DataTable/TableToolbarMenu.js +3 -3
- package/es/components/DataTable/tools/sorting.js +2 -1
- package/es/components/DataTableSkeleton/DataTableSkeleton.d.ts +107 -0
- package/es/components/Dropdown/Dropdown.d.ts +6 -0
- package/es/components/Dropdown/Dropdown.js +8 -145
- package/es/components/FileUploader/FileUploader.js +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +30 -18
- package/es/components/FileUploader/FileUploaderItem.js +2 -1
- package/es/components/FileUploader/Filename.js +8 -2
- package/es/components/FluidTextArea/FluidTextArea.js +12 -1
- package/es/components/IconButton/index.js +1 -0
- package/es/components/ListBox/ListBoxMenuItem.d.ts +2 -2
- package/es/components/ListBox/ListBoxSelection.js +4 -23
- package/es/components/ListBox/next/ListBoxSelection.js +2 -23
- package/es/components/Menu/Menu.js +50 -33
- package/es/components/Menu/MenuContext.js +3 -6
- package/es/components/Menu/MenuItem.js +1 -0
- package/es/components/MenuButton/index.js +127 -0
- package/es/components/Modal/Modal.js +4 -3
- package/es/components/MultiSelect/FilterableMultiSelect.js +31 -137
- package/es/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/es/components/MultiSelect/MultiSelect.js +48 -26
- package/es/components/Notification/Notification.js +27 -264
- package/es/components/OverflowMenu/OverflowMenu.js +13 -139
- package/es/components/OverflowMenuItem/OverflowMenuItem.d.ts +58 -0
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +12 -7
- package/es/components/OverflowMenuV2/index.js +15 -51
- package/es/components/Popover/index.d.ts +55 -0
- package/es/components/Popover/index.js +61 -29
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +7 -4
- package/es/components/RadioTile/RadioTile.js +6 -6
- package/es/components/Select/Select.d.ts +89 -0
- package/es/components/SelectItem/SelectItem.d.ts +62 -0
- package/es/components/SelectItem/SelectItem.js +2 -4
- package/es/components/SelectItemGroup/SelectItemGroup.d.ts +52 -0
- package/es/components/SkeletonText/SkeletonText.js +1 -1
- package/es/components/Slider/Slider.Skeleton.d.ts +2 -2
- package/es/components/Slider/Slider.d.ts +355 -0
- package/es/components/Slider/Slider.js +63 -35
- package/es/components/StructuredList/StructuredList.js +10 -38
- package/es/components/Tabs/Tabs.js +3 -1
- package/es/components/TextArea/TextArea.Skeleton.d.ts +33 -0
- package/es/components/TextArea/TextArea.Skeleton.js +5 -5
- package/es/components/TextArea/TextArea.d.ts +9 -2
- package/es/components/TextArea/TextArea.js +31 -8
- package/es/components/TextArea/index.js +1 -0
- package/es/components/TextInput/TextInput.d.ts +106 -0
- package/es/components/TextInput/TextInput.js +3 -2
- package/es/components/Toggle/Toggle.js +8 -19
- package/es/components/Tooltip/DefinitionTooltip.d.ts +52 -0
- package/es/components/Tooltip/DefinitionTooltip.js +2 -2
- package/es/components/Tooltip/Tooltip.d.ts +117 -0
- package/es/components/Tooltip/Tooltip.js +6 -4
- package/es/components/Tooltip/index.d.ts +9 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +5 -3
- package/es/internal/ClickListener.js +1 -2
- package/es/internal/keyboard/match.js +1 -1
- package/es/internal/useAttachedMenu.js +85 -0
- package/es/internal/useDelayedState.d.ts +19 -0
- package/es/internal/useDelayedState.js +7 -3
- package/es/internal/useId.js +1 -1
- package/es/internal/useMergedRefs.d.ts +13 -0
- package/es/internal/useMergedRefs.js +2 -5
- package/es/internal/useNormalizedInputProps.js +1 -0
- package/lib/components/CodeSnippet/CodeSnippet.js +13 -115
- package/lib/components/ComboBox/ComboBox.d.ts +6 -0
- package/lib/components/ComboBox/ComboBox.js +18 -171
- package/lib/components/ComboButton/index.js +174 -0
- package/lib/components/ComposedModal/ComposedModal.js +1 -2
- package/lib/components/DataTable/TableToolbar.d.ts +19 -0
- package/lib/components/DataTable/TableToolbar.js +1 -1
- package/lib/components/DataTable/TableToolbarAction.d.ts +21 -0
- package/lib/components/DataTable/TableToolbarContent.d.ts +21 -0
- package/lib/components/DataTable/TableToolbarMenu.d.ts +24 -0
- package/lib/components/DataTable/TableToolbarMenu.js +3 -3
- package/lib/components/DataTable/tools/sorting.js +2 -1
- package/lib/components/DataTableSkeleton/DataTableSkeleton.d.ts +107 -0
- package/lib/components/Dropdown/Dropdown.d.ts +6 -0
- package/lib/components/Dropdown/Dropdown.js +7 -144
- package/lib/components/FileUploader/FileUploader.js +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +30 -18
- package/lib/components/FileUploader/FileUploaderItem.js +2 -1
- package/lib/components/FileUploader/Filename.js +8 -2
- package/lib/components/FluidTextArea/FluidTextArea.js +12 -1
- package/lib/components/IconButton/index.js +1 -0
- package/lib/components/ListBox/ListBoxMenuItem.d.ts +2 -2
- package/lib/components/ListBox/ListBoxSelection.js +4 -23
- package/lib/components/ListBox/next/ListBoxSelection.js +2 -23
- package/lib/components/Menu/Menu.js +50 -33
- package/lib/components/Menu/MenuContext.js +3 -6
- package/lib/components/Menu/MenuItem.js +1 -0
- package/lib/components/MenuButton/index.js +137 -0
- package/lib/components/Modal/Modal.js +4 -3
- package/lib/components/MultiSelect/FilterableMultiSelect.js +29 -135
- package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/lib/components/MultiSelect/MultiSelect.js +47 -25
- package/lib/components/Notification/Notification.js +27 -264
- package/lib/components/OverflowMenu/OverflowMenu.js +13 -139
- package/lib/components/OverflowMenuItem/OverflowMenuItem.d.ts +58 -0
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +12 -7
- package/lib/components/OverflowMenuV2/index.js +13 -49
- package/lib/components/Popover/index.d.ts +55 -0
- package/lib/components/Popover/index.js +61 -29
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +6 -3
- package/lib/components/RadioTile/RadioTile.js +6 -6
- package/lib/components/Select/Select.d.ts +89 -0
- package/lib/components/SelectItem/SelectItem.d.ts +62 -0
- package/lib/components/SelectItem/SelectItem.js +1 -3
- package/lib/components/SelectItemGroup/SelectItemGroup.d.ts +52 -0
- package/lib/components/SkeletonText/SkeletonText.js +1 -1
- package/lib/components/Slider/Slider.Skeleton.d.ts +2 -2
- package/lib/components/Slider/Slider.d.ts +355 -0
- package/lib/components/Slider/Slider.js +62 -34
- package/lib/components/StructuredList/StructuredList.js +10 -38
- package/lib/components/Tabs/Tabs.js +3 -1
- package/lib/components/TextArea/TextArea.Skeleton.d.ts +33 -0
- package/lib/components/TextArea/TextArea.Skeleton.js +5 -5
- package/lib/components/TextArea/TextArea.d.ts +9 -2
- package/lib/components/TextArea/TextArea.js +30 -7
- package/lib/components/TextArea/index.js +2 -0
- package/lib/components/TextInput/TextInput.d.ts +106 -0
- package/lib/components/TextInput/TextInput.js +3 -2
- package/lib/components/Toggle/Toggle.js +8 -19
- package/lib/components/Tooltip/DefinitionTooltip.d.ts +52 -0
- package/lib/components/Tooltip/DefinitionTooltip.js +2 -2
- package/lib/components/Tooltip/Tooltip.d.ts +117 -0
- package/lib/components/Tooltip/Tooltip.js +6 -4
- package/lib/components/Tooltip/index.d.ts +9 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +50 -46
- package/lib/internal/ClickListener.js +1 -2
- package/lib/internal/keyboard/match.js +1 -1
- package/lib/internal/useAttachedMenu.js +89 -0
- package/lib/internal/useDelayedState.d.ts +19 -0
- package/lib/internal/useDelayedState.js +7 -3
- package/lib/internal/useId.js +1 -1
- package/lib/internal/useMergedRefs.d.ts +13 -0
- package/lib/internal/useMergedRefs.js +2 -5
- package/lib/internal/useNormalizedInputProps.js +1 -0
- package/package.json +10 -10
|
@@ -19,7 +19,9 @@ import copy from 'copy-to-clipboard';
|
|
|
19
19
|
import deprecate from '../../prop-types/deprecate.js';
|
|
20
20
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _CodeSnippet$propType, _CodeSnippet$defaultP;
|
|
23
|
+
|
|
24
|
+
var _excluded = ["className", "type", "children", "disabled", "feedback", "feedbackTimeout", "onClick", "aria-label", "ariaLabel", "copyText", "copyButtonDescription", "light", "showMoreText", "showLessText", "hideCopyButton", "wrapText", "maxCollapsedNumberOfRows", "maxExpandedNumberOfRows", "minCollapsedNumberOfRows", "minExpandedNumberOfRows"];
|
|
23
25
|
var rowHeightInPixels = 16;
|
|
24
26
|
var defaultMaxCollapsedNumberOfRows = 15;
|
|
25
27
|
var defaultMaxExpandedNumberOfRows = 0;
|
|
@@ -36,7 +38,8 @@ function CodeSnippet(_ref) {
|
|
|
36
38
|
feedback = _ref.feedback,
|
|
37
39
|
feedbackTimeout = _ref.feedbackTimeout,
|
|
38
40
|
onClick = _ref.onClick,
|
|
39
|
-
ariaLabel = _ref
|
|
41
|
+
ariaLabel = _ref['aria-label'],
|
|
42
|
+
deprecatedAriaLabel = _ref.ariaLabel,
|
|
40
43
|
copyText = _ref.copyText,
|
|
41
44
|
copyButtonDescription = _ref.copyButtonDescription,
|
|
42
45
|
light = _ref.light,
|
|
@@ -171,7 +174,7 @@ function CodeSnippet(_ref) {
|
|
|
171
174
|
|
|
172
175
|
return /*#__PURE__*/React__default.createElement(Copy, _extends({}, rest, {
|
|
173
176
|
onClick: handleCopyClick,
|
|
174
|
-
"aria-label": ariaLabel,
|
|
177
|
+
"aria-label": deprecatedAriaLabel || ariaLabel,
|
|
175
178
|
"aria-describedby": uid,
|
|
176
179
|
className: codeSnippetClasses,
|
|
177
180
|
feedback: feedback,
|
|
@@ -214,10 +217,12 @@ function CodeSnippet(_ref) {
|
|
|
214
217
|
className: codeSnippetClasses
|
|
215
218
|
}), /*#__PURE__*/React__default.createElement("div", _extends({
|
|
216
219
|
ref: codeContainerRef,
|
|
217
|
-
role: type === 'single' ? 'textbox' : null,
|
|
218
|
-
tabIndex: type === 'single' && !disabled ? 0 : null,
|
|
220
|
+
role: type === 'single' || type === 'multi' ? 'textbox' : null,
|
|
221
|
+
tabIndex: (type === 'single' || type === 'multi') && !disabled ? 0 : null,
|
|
219
222
|
className: "".concat(prefix, "--snippet-container"),
|
|
220
|
-
"aria-label": ariaLabel || 'code-snippet',
|
|
223
|
+
"aria-label": deprecatedAriaLabel || ariaLabel || 'code-snippet',
|
|
224
|
+
"aria-readonly": type === 'single' || type === 'multi' ? true : null,
|
|
225
|
+
"aria-multiline": type === 'multi' ? true : null,
|
|
221
226
|
onScroll: type === 'single' && handleScroll || null
|
|
222
227
|
}, containerStyle), /*#__PURE__*/React__default.createElement("pre", {
|
|
223
228
|
ref: codeContentRef,
|
|
@@ -251,114 +256,7 @@ function CodeSnippet(_ref) {
|
|
|
251
256
|
})));
|
|
252
257
|
}
|
|
253
258
|
|
|
254
|
-
CodeSnippet.propTypes = {
|
|
255
|
-
|
|
256
|
-
* Specify a label to be read by screen readers on the containing <textbox>
|
|
257
|
-
* node
|
|
258
|
-
*/
|
|
259
|
-
ariaLabel: PropTypes.string,
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Provide the content of your CodeSnippet as a node or string
|
|
263
|
-
*/
|
|
264
|
-
children: PropTypes.node,
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* Specify an optional className to be applied to the container node
|
|
268
|
-
*/
|
|
269
|
-
className: PropTypes.string,
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Specify the description for the Copy Button
|
|
273
|
-
*/
|
|
274
|
-
copyButtonDescription: PropTypes.string,
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* Optional text to copy. If not specified, the `children` node's `innerText`
|
|
278
|
-
* will be used as the copy value.
|
|
279
|
-
*/
|
|
280
|
-
copyText: PropTypes.string,
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* Specify whether or not the CodeSnippet should be disabled
|
|
284
|
-
*/
|
|
285
|
-
disabled: PropTypes.bool,
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* Specify the string displayed when the snippet is copied
|
|
289
|
-
*/
|
|
290
|
-
feedback: PropTypes.string,
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Specify the time it takes for the feedback message to timeout
|
|
294
|
-
*/
|
|
295
|
-
feedbackTimeout: PropTypes.number,
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Specify whether or not a copy button should be used/rendered.
|
|
299
|
-
*/
|
|
300
|
-
hideCopyButton: PropTypes.bool,
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* Specify whether you are using the light variant of the Code Snippet,
|
|
304
|
-
* typically used for inline snippet to display an alternate color
|
|
305
|
-
*/
|
|
306
|
-
light: deprecate(PropTypes.bool, 'The `light` prop for `CodeSnippet` has ' + 'been deprecated in favor of the new `Layer` component. It will be removed in the next major release.'),
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* Specify the maximum number of rows to be shown when in collapsed view
|
|
310
|
-
*/
|
|
311
|
-
maxCollapsedNumberOfRows: PropTypes.number,
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* Specify the maximum number of rows to be shown when in expanded view
|
|
315
|
-
*/
|
|
316
|
-
maxExpandedNumberOfRows: PropTypes.number,
|
|
317
|
-
|
|
318
|
-
/**
|
|
319
|
-
* Specify the minimum number of rows to be shown when in collapsed view
|
|
320
|
-
*/
|
|
321
|
-
minCollapsedNumberOfRows: PropTypes.number,
|
|
322
|
-
|
|
323
|
-
/**
|
|
324
|
-
* Specify the minimum number of rows to be shown when in expanded view
|
|
325
|
-
*/
|
|
326
|
-
minExpandedNumberOfRows: PropTypes.number,
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* An optional handler to listen to the `onClick` even fired by the Copy
|
|
330
|
-
* Button
|
|
331
|
-
*/
|
|
332
|
-
onClick: PropTypes.func,
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* Specify a string that is displayed when the Code Snippet has been
|
|
336
|
-
* interacted with to show more lines
|
|
337
|
-
*/
|
|
338
|
-
showLessText: PropTypes.string,
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* Specify a string that is displayed when the Code Snippet text is more
|
|
342
|
-
* than 15 lines
|
|
343
|
-
*/
|
|
344
|
-
showMoreText: PropTypes.string,
|
|
345
|
-
|
|
346
|
-
/**
|
|
347
|
-
* Provide the type of Code Snippet
|
|
348
|
-
*/
|
|
349
|
-
type: PropTypes.oneOf(['single', 'inline', 'multi']),
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* Specify whether or not to wrap the text.
|
|
353
|
-
*/
|
|
354
|
-
wrapText: PropTypes.bool
|
|
355
|
-
};
|
|
356
|
-
CodeSnippet.defaultProps = {
|
|
357
|
-
ariaLabel: 'Copy to clipboard',
|
|
358
|
-
type: 'single',
|
|
359
|
-
showMoreText: 'Show more',
|
|
360
|
-
showLessText: 'Show less',
|
|
361
|
-
wrapText: false
|
|
362
|
-
};
|
|
259
|
+
CodeSnippet.propTypes = (_CodeSnippet$propType = {}, _defineProperty(_CodeSnippet$propType, 'aria-label', PropTypes.string), _defineProperty(_CodeSnippet$propType, "ariaLabel", deprecate(PropTypes.string, 'This prop syntax has been deprecated. Please use the new `aria-label`.')), _defineProperty(_CodeSnippet$propType, "children", PropTypes.node), _defineProperty(_CodeSnippet$propType, "className", PropTypes.string), _defineProperty(_CodeSnippet$propType, "copyButtonDescription", PropTypes.string), _defineProperty(_CodeSnippet$propType, "copyText", PropTypes.string), _defineProperty(_CodeSnippet$propType, "disabled", PropTypes.bool), _defineProperty(_CodeSnippet$propType, "feedback", PropTypes.string), _defineProperty(_CodeSnippet$propType, "feedbackTimeout", PropTypes.number), _defineProperty(_CodeSnippet$propType, "hideCopyButton", PropTypes.bool), _defineProperty(_CodeSnippet$propType, "light", deprecate(PropTypes.bool, 'The `light` prop for `CodeSnippet` has ' + 'been deprecated in favor of the new `Layer` component. It will be removed in the next major release.')), _defineProperty(_CodeSnippet$propType, "maxCollapsedNumberOfRows", PropTypes.number), _defineProperty(_CodeSnippet$propType, "maxExpandedNumberOfRows", PropTypes.number), _defineProperty(_CodeSnippet$propType, "minCollapsedNumberOfRows", PropTypes.number), _defineProperty(_CodeSnippet$propType, "minExpandedNumberOfRows", PropTypes.number), _defineProperty(_CodeSnippet$propType, "onClick", PropTypes.func), _defineProperty(_CodeSnippet$propType, "showLessText", PropTypes.string), _defineProperty(_CodeSnippet$propType, "showMoreText", PropTypes.string), _defineProperty(_CodeSnippet$propType, "type", PropTypes.oneOf(['single', 'inline', 'multi'])), _defineProperty(_CodeSnippet$propType, "wrapText", PropTypes.bool), _CodeSnippet$propType);
|
|
260
|
+
CodeSnippet.defaultProps = (_CodeSnippet$defaultP = {}, _defineProperty(_CodeSnippet$defaultP, 'aria-label', 'Copy to clipboard'), _defineProperty(_CodeSnippet$defaultP, "type", 'single'), _defineProperty(_CodeSnippet$defaultP, "showMoreText", 'Show more'), _defineProperty(_CodeSnippet$defaultP, "showLessText", 'Show less'), _defineProperty(_CodeSnippet$defaultP, "wrapText", false), _CodeSnippet$defaultP);
|
|
363
261
|
|
|
364
262
|
export { CodeSnippet as default };
|
|
@@ -11,6 +11,12 @@ import { ListBoxType, ListBoxSize } from '../ListBox';
|
|
|
11
11
|
type ExcludedAttributes = 'id' | 'onChange' | 'onClick' | 'type' | 'size';
|
|
12
12
|
export interface ComboBoxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, ExcludedAttributes> {
|
|
13
13
|
/**
|
|
14
|
+
* Specify a label to be read by screen readers on the container node
|
|
15
|
+
* 'aria-label' of the ListBox component.
|
|
16
|
+
*/
|
|
17
|
+
['aria-label']?: string;
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated please use `aria-label` instead.
|
|
14
20
|
* 'aria-label' of the ListBox component.
|
|
15
21
|
*/
|
|
16
22
|
ariaLabel?: string;
|
|
@@ -25,9 +25,11 @@ 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 } from '../../internal/keyboard/keys.js';
|
|
28
|
+
import { Space, Enter, Escape } from '../../internal/keyboard/keys.js';
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _ComboBox$propTypes, _ComboBox$defaultProp;
|
|
31
|
+
|
|
32
|
+
var _excluded = ["aria-label", "ariaLabel", "className", "direction", "disabled", "downshiftProps", "helperText", "id", "initialSelectedItem", "invalid", "invalidText", "items", "itemToElement", "itemToString", "light", "onChange", "onInputChange", "onToggleClick", "placeholder", "readOnly", "selectedItem", "shouldFilterItem", "size", "titleText", "translateWithId", "type", "warn", "warnText", "onStateChange"];
|
|
31
33
|
|
|
32
34
|
var defaultItemToString = function defaultItemToString(item) {
|
|
33
35
|
if (typeof item === 'string') {
|
|
@@ -84,7 +86,8 @@ var getInstanceId = setupGetInstanceId();
|
|
|
84
86
|
var ComboBox = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
85
87
|
var _cx, _ref4, _cx4, _Text;
|
|
86
88
|
|
|
87
|
-
var ariaLabel = props
|
|
89
|
+
var ariaLabel = props['aria-label'],
|
|
90
|
+
deprecatedAriaLabel = props.ariaLabel,
|
|
88
91
|
containerClassName = props.className,
|
|
89
92
|
direction = props.direction,
|
|
90
93
|
disabled = props.disabled,
|
|
@@ -304,6 +307,14 @@ var ComboBox = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
304
307
|
if (match(event, Enter) && !inputValue) {
|
|
305
308
|
toggleMenu();
|
|
306
309
|
}
|
|
310
|
+
|
|
311
|
+
if (match(event, Escape) && inputValue) {
|
|
312
|
+
if (event.target === textInput.current && isOpen) {
|
|
313
|
+
toggleMenu();
|
|
314
|
+
event.preventDownshiftDefault = true;
|
|
315
|
+
event.persist();
|
|
316
|
+
}
|
|
317
|
+
}
|
|
307
318
|
}
|
|
308
319
|
});
|
|
309
320
|
|
|
@@ -366,7 +377,7 @@ var ComboBox = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
366
377
|
isOpen: isOpen,
|
|
367
378
|
translateWithId: translateWithId
|
|
368
379
|
}))), /*#__PURE__*/React__default.createElement(ListBox.Menu, getMenuProps({
|
|
369
|
-
'aria-label': ariaLabel
|
|
380
|
+
'aria-label': deprecatedAriaLabel || ariaLabel
|
|
370
381
|
}), isOpen ? filterItems(items, itemToString, inputValue).map(function (item, index) {
|
|
371
382
|
var _getItemProps;
|
|
372
383
|
|
|
@@ -395,178 +406,14 @@ var ComboBox = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
395
406
|
});
|
|
396
407
|
});
|
|
397
408
|
ComboBox.displayName = 'ComboBox';
|
|
398
|
-
ComboBox.propTypes = {
|
|
399
|
-
|
|
400
|
-
* 'aria-label' of the ListBox component.
|
|
401
|
-
*/
|
|
402
|
-
ariaLabel: PropTypes.string,
|
|
403
|
-
|
|
404
|
-
/**
|
|
405
|
-
* An optional className to add to the container node
|
|
406
|
-
*/
|
|
407
|
-
className: PropTypes.string,
|
|
408
|
-
|
|
409
|
-
/**
|
|
410
|
-
* Specify the direction of the combobox dropdown. Can be either top or bottom.
|
|
411
|
-
*/
|
|
412
|
-
direction: PropTypes.oneOf(['top', 'bottom']),
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* Specify if the control should be disabled, or not
|
|
416
|
-
*/
|
|
417
|
-
disabled: PropTypes.bool,
|
|
418
|
-
|
|
419
|
-
/**
|
|
420
|
-
* Additional props passed to Downshift
|
|
421
|
-
*/
|
|
422
|
-
// @ts-ignore
|
|
423
|
-
downshiftProps: PropTypes.shape(Downshift.propTypes),
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* Provide helper text that is used alongside the control label for
|
|
427
|
-
* additional help
|
|
428
|
-
*/
|
|
429
|
-
helperText: PropTypes.string,
|
|
430
|
-
|
|
431
|
-
/**
|
|
432
|
-
* Specify a custom `id` for the input
|
|
433
|
-
*/
|
|
434
|
-
id: PropTypes.string.isRequired,
|
|
435
|
-
|
|
436
|
-
/**
|
|
437
|
-
* Allow users to pass in an arbitrary item or a string (in case their items are an array of strings)
|
|
438
|
-
* from their collection that are pre-selected
|
|
439
|
-
*/
|
|
440
|
-
initialSelectedItem: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.number]),
|
|
441
|
-
|
|
442
|
-
/**
|
|
443
|
-
* Specify if the currently selected value is invalid.
|
|
444
|
-
*/
|
|
445
|
-
invalid: PropTypes.bool,
|
|
446
|
-
|
|
447
|
-
/**
|
|
448
|
-
* Message which is displayed if the value is invalid.
|
|
449
|
-
*/
|
|
450
|
-
invalidText: PropTypes.node,
|
|
451
|
-
|
|
452
|
-
/**
|
|
453
|
-
* Optional function to render items as custom components instead of strings.
|
|
454
|
-
* Defaults to null and is overridden by a getter
|
|
455
|
-
*/
|
|
456
|
-
itemToElement: PropTypes.func,
|
|
457
|
-
|
|
458
|
-
/**
|
|
459
|
-
* Helper function passed to downshift that allows the library to render a
|
|
460
|
-
* given item to a string label. By default, it extracts the `label` field
|
|
461
|
-
* from a given item to serve as the item label in the list
|
|
462
|
-
*/
|
|
463
|
-
itemToString: PropTypes.func,
|
|
464
|
-
|
|
465
|
-
/**
|
|
466
|
-
* We try to stay as generic as possible here to allow individuals to pass
|
|
467
|
-
* in a collection of whatever kind of data structure they prefer
|
|
468
|
-
*/
|
|
469
|
-
items: PropTypes.array.isRequired,
|
|
470
|
-
|
|
471
|
-
/**
|
|
472
|
-
* should use "light theme" (white background)?
|
|
473
|
-
*/
|
|
474
|
-
light: deprecate(PropTypes.bool, 'The `light` prop for `Combobox` has ' + 'been deprecated in favor of the new `Layer` component. It will be removed in the next major release.'),
|
|
475
|
-
|
|
476
|
-
/**
|
|
477
|
-
* `onChange` is a utility for this controlled component to communicate to a
|
|
478
|
-
* consuming component when a specific dropdown item is selected.
|
|
479
|
-
* `({ selectedItem }) => void`
|
|
480
|
-
* @param {{ selectedItem }}
|
|
481
|
-
*/
|
|
482
|
-
onChange: PropTypes.func.isRequired,
|
|
483
|
-
|
|
484
|
-
/**
|
|
485
|
-
* Callback function to notify consumer when the text input changes.
|
|
486
|
-
* This provides support to change available items based on the text.
|
|
487
|
-
* `(inputText) => void`
|
|
488
|
-
* @param {string} inputText
|
|
489
|
-
*/
|
|
490
|
-
onInputChange: PropTypes.func,
|
|
491
|
-
|
|
492
|
-
/**
|
|
493
|
-
* Helper function passed to Downshift that allows the user to observe internal
|
|
494
|
-
* state changes
|
|
495
|
-
* `(changes, stateAndHelpers) => void`
|
|
496
|
-
*/
|
|
497
|
-
onStateChange: PropTypes.func,
|
|
498
|
-
|
|
499
|
-
/**
|
|
500
|
-
* Callback function that fires when the combobox menu toggle is clicked
|
|
501
|
-
* `(evt) => void`
|
|
502
|
-
* @param {MouseEvent} event
|
|
503
|
-
*/
|
|
504
|
-
onToggleClick: PropTypes.func,
|
|
505
|
-
|
|
506
|
-
/**
|
|
507
|
-
* Used to provide a placeholder text node before a user enters any input.
|
|
508
|
-
* This is only present if the control has no items selected
|
|
509
|
-
*/
|
|
510
|
-
placeholder: PropTypes.string,
|
|
511
|
-
|
|
512
|
-
/**
|
|
513
|
-
* Is the ComboBox readonly?
|
|
514
|
-
*/
|
|
515
|
-
readOnly: PropTypes.bool,
|
|
516
|
-
|
|
517
|
-
/**
|
|
518
|
-
* For full control of the selection
|
|
519
|
-
*/
|
|
520
|
-
selectedItem: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.number]),
|
|
521
|
-
|
|
522
|
-
/**
|
|
523
|
-
* Specify your own filtering logic by passing in a `shouldFilterItem`
|
|
524
|
-
* function that takes in the current input and an item and passes back
|
|
525
|
-
* whether or not the item should be filtered.
|
|
526
|
-
*/
|
|
527
|
-
shouldFilterItem: PropTypes.func,
|
|
528
|
-
|
|
529
|
-
/**
|
|
530
|
-
* Specify the size of the ListBox. Currently supports either `sm`, `md` or `lg` as an option.
|
|
531
|
-
*/
|
|
532
|
-
size: ListBoxSize,
|
|
533
|
-
|
|
534
|
-
/**
|
|
535
|
-
* Provide text to be used in a `<label>` element that is tied to the
|
|
536
|
-
* combobox via ARIA attributes.
|
|
537
|
-
*/
|
|
538
|
-
titleText: PropTypes.node,
|
|
539
|
-
|
|
540
|
-
/**
|
|
541
|
-
* Specify a custom translation function that takes in a message identifier
|
|
542
|
-
* and returns the localized string for the message
|
|
543
|
-
*/
|
|
544
|
-
translateWithId: PropTypes.func,
|
|
545
|
-
|
|
546
|
-
/**
|
|
547
|
-
* Currently supports either the default type, or an inline variant
|
|
548
|
-
*/
|
|
549
|
-
type: ListBoxType,
|
|
550
|
-
|
|
551
|
-
/**
|
|
552
|
-
* Specify whether the control is currently in warning state
|
|
553
|
-
*/
|
|
554
|
-
warn: PropTypes.bool,
|
|
555
|
-
|
|
556
|
-
/**
|
|
557
|
-
* Provide the text that is displayed when the control is in warning state
|
|
558
|
-
*/
|
|
559
|
-
warnText: PropTypes.node
|
|
560
|
-
};
|
|
561
|
-
ComboBox.defaultProps = {
|
|
409
|
+
ComboBox.propTypes = (_ComboBox$propTypes = {}, _defineProperty(_ComboBox$propTypes, 'aria-label', PropTypes.string), _defineProperty(_ComboBox$propTypes, "ariaLabel", deprecate(PropTypes.string, 'This prop syntax has been deprecated. Please use the new `aria-label`.')), _defineProperty(_ComboBox$propTypes, "className", PropTypes.string), _defineProperty(_ComboBox$propTypes, "direction", PropTypes.oneOf(['top', 'bottom'])), _defineProperty(_ComboBox$propTypes, "disabled", PropTypes.bool), _defineProperty(_ComboBox$propTypes, "downshiftProps", PropTypes.shape(Downshift.propTypes)), _defineProperty(_ComboBox$propTypes, "helperText", PropTypes.string), _defineProperty(_ComboBox$propTypes, "id", PropTypes.string.isRequired), _defineProperty(_ComboBox$propTypes, "initialSelectedItem", PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.number])), _defineProperty(_ComboBox$propTypes, "invalid", PropTypes.bool), _defineProperty(_ComboBox$propTypes, "invalidText", PropTypes.node), _defineProperty(_ComboBox$propTypes, "itemToElement", PropTypes.func), _defineProperty(_ComboBox$propTypes, "itemToString", PropTypes.func), _defineProperty(_ComboBox$propTypes, "items", PropTypes.array.isRequired), _defineProperty(_ComboBox$propTypes, "light", deprecate(PropTypes.bool, 'The `light` prop for `Combobox` has ' + 'been deprecated in favor of the new `Layer` component. It will be removed in the next major release.')), _defineProperty(_ComboBox$propTypes, "onChange", PropTypes.func.isRequired), _defineProperty(_ComboBox$propTypes, "onInputChange", PropTypes.func), _defineProperty(_ComboBox$propTypes, "onStateChange", PropTypes.func), _defineProperty(_ComboBox$propTypes, "onToggleClick", PropTypes.func), _defineProperty(_ComboBox$propTypes, "placeholder", PropTypes.string), _defineProperty(_ComboBox$propTypes, "readOnly", PropTypes.bool), _defineProperty(_ComboBox$propTypes, "selectedItem", PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.number])), _defineProperty(_ComboBox$propTypes, "shouldFilterItem", PropTypes.func), _defineProperty(_ComboBox$propTypes, "size", ListBoxSize), _defineProperty(_ComboBox$propTypes, "titleText", PropTypes.node), _defineProperty(_ComboBox$propTypes, "translateWithId", PropTypes.func), _defineProperty(_ComboBox$propTypes, "type", ListBoxType), _defineProperty(_ComboBox$propTypes, "warn", PropTypes.bool), _defineProperty(_ComboBox$propTypes, "warnText", PropTypes.node), _ComboBox$propTypes);
|
|
410
|
+
ComboBox.defaultProps = (_ComboBox$defaultProp = {
|
|
562
411
|
disabled: false,
|
|
563
412
|
itemToString: defaultItemToString,
|
|
564
413
|
itemToElement: null,
|
|
565
414
|
shouldFilterItem: defaultShouldFilterItem,
|
|
566
|
-
type: 'default'
|
|
567
|
-
|
|
568
|
-
direction: 'bottom'
|
|
569
|
-
};
|
|
415
|
+
type: 'default'
|
|
416
|
+
}, _defineProperty(_ComboBox$defaultProp, 'aria-label', 'Choose an item'), _defineProperty(_ComboBox$defaultProp, "direction", 'bottom'), _ComboBox$defaultProp);
|
|
570
417
|
var ComboBox$1 = ComboBox;
|
|
571
418
|
|
|
572
419
|
export { ComboBox$1 as default };
|
|
@@ -0,0 +1,164 @@
|
|
|
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, slicedToArray as _slicedToArray, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
+
import React__default, { useRef, useState } from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
import cx from 'classnames';
|
|
12
|
+
import { ChevronDown } from '@carbon/icons-react';
|
|
13
|
+
import Button from '../Button/Button.js';
|
|
14
|
+
import { IconButton } from '../IconButton/index.js';
|
|
15
|
+
import { Menu } from '../Menu/Menu.js';
|
|
16
|
+
import { useAttachedMenu } from '../../internal/useAttachedMenu.js';
|
|
17
|
+
import { useId } from '../../internal/useId.js';
|
|
18
|
+
import { useMergedRefs } from '../../internal/useMergedRefs.js';
|
|
19
|
+
import { usePrefix } from '../../internal/usePrefix.js';
|
|
20
|
+
|
|
21
|
+
var _ChevronDown;
|
|
22
|
+
|
|
23
|
+
var _excluded = ["children", "className", "disabled", "label", "onClick", "size", "tooltipAlign", "translateWithId"];
|
|
24
|
+
var spacing = 4; // top and bottom spacing between the button and the menu. in px
|
|
25
|
+
|
|
26
|
+
var defaultTranslations = {
|
|
27
|
+
'carbon.combo-button.additional-actions': 'Additional actions'
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
function defaultTranslateWithId(messageId) {
|
|
31
|
+
return defaultTranslations[messageId];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
var ComboButton = /*#__PURE__*/React__default.forwardRef(function ComboButton(_ref, forwardRef) {
|
|
35
|
+
var children = _ref.children,
|
|
36
|
+
className = _ref.className,
|
|
37
|
+
disabled = _ref.disabled,
|
|
38
|
+
label = _ref.label,
|
|
39
|
+
onClick = _ref.onClick,
|
|
40
|
+
_ref$size = _ref.size,
|
|
41
|
+
size = _ref$size === void 0 ? 'lg' : _ref$size,
|
|
42
|
+
tooltipAlign = _ref.tooltipAlign,
|
|
43
|
+
_ref$translateWithId = _ref.translateWithId,
|
|
44
|
+
t = _ref$translateWithId === void 0 ? defaultTranslateWithId : _ref$translateWithId,
|
|
45
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
46
|
+
|
|
47
|
+
var id = useId('combobutton');
|
|
48
|
+
var prefix = usePrefix();
|
|
49
|
+
var containerRef = useRef(null);
|
|
50
|
+
var menuRef = useRef(null);
|
|
51
|
+
var ref = useMergedRefs([forwardRef, containerRef]);
|
|
52
|
+
|
|
53
|
+
var _useState = useState(0),
|
|
54
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
55
|
+
width = _useState2[0],
|
|
56
|
+
setWidth = _useState2[1];
|
|
57
|
+
|
|
58
|
+
var _useAttachedMenu = useAttachedMenu(containerRef),
|
|
59
|
+
open = _useAttachedMenu.open,
|
|
60
|
+
x = _useAttachedMenu.x,
|
|
61
|
+
y = _useAttachedMenu.y,
|
|
62
|
+
hookOnClick = _useAttachedMenu.handleClick,
|
|
63
|
+
handleTriggerMousedown = _useAttachedMenu.handleMousedown,
|
|
64
|
+
handleClose = _useAttachedMenu.handleClose;
|
|
65
|
+
|
|
66
|
+
function handleTriggerClick() {
|
|
67
|
+
if (containerRef.current) {
|
|
68
|
+
var _containerRef$current = containerRef.current.getBoundingClientRect(),
|
|
69
|
+
w = _containerRef$current.width;
|
|
70
|
+
|
|
71
|
+
setWidth(w);
|
|
72
|
+
hookOnClick();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function handlePrimaryActionClick(e) {
|
|
77
|
+
if (onClick) {
|
|
78
|
+
onClick(e);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function handleOpen() {
|
|
83
|
+
menuRef.current.style.width = "".concat(width, "px");
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
var containerClasses = cx("".concat(prefix, "--combo-button__container"), "".concat(prefix, "--combo-button__container--").concat(size), _defineProperty({}, "".concat(prefix, "--combo-button__container--open"), open), className);
|
|
87
|
+
var primaryActionClasses = cx("".concat(prefix, "--combo-button__primary-action"));
|
|
88
|
+
var triggerClasses = cx("".concat(prefix, "--combo-button__trigger"));
|
|
89
|
+
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
90
|
+
className: containerClasses,
|
|
91
|
+
ref: ref
|
|
92
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
93
|
+
className: primaryActionClasses
|
|
94
|
+
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
95
|
+
size: size,
|
|
96
|
+
disabled: disabled,
|
|
97
|
+
onClick: handlePrimaryActionClick
|
|
98
|
+
}, label)), /*#__PURE__*/React__default.createElement(IconButton, {
|
|
99
|
+
className: triggerClasses,
|
|
100
|
+
label: t('carbon.combo-button.additional-actions'),
|
|
101
|
+
size: size,
|
|
102
|
+
disabled: disabled,
|
|
103
|
+
align: tooltipAlign,
|
|
104
|
+
"aria-haspopup": true,
|
|
105
|
+
"aria-expanded": open,
|
|
106
|
+
onClick: handleTriggerClick,
|
|
107
|
+
onMouseDown: handleTriggerMousedown,
|
|
108
|
+
"aria-owns": open ? id : null
|
|
109
|
+
}, _ChevronDown || (_ChevronDown = /*#__PURE__*/React__default.createElement(ChevronDown, null))), /*#__PURE__*/React__default.createElement(Menu, {
|
|
110
|
+
ref: menuRef,
|
|
111
|
+
id: id,
|
|
112
|
+
label: t('carbon.combo-button.additional-actions'),
|
|
113
|
+
size: size,
|
|
114
|
+
open: open,
|
|
115
|
+
onClose: handleClose,
|
|
116
|
+
onOpen: handleOpen,
|
|
117
|
+
x: x,
|
|
118
|
+
y: [y[0] - spacing, y[1] + spacing]
|
|
119
|
+
}, children));
|
|
120
|
+
});
|
|
121
|
+
ComboButton.propTypes = {
|
|
122
|
+
/**
|
|
123
|
+
* A collection of MenuItems to be rendered as additional actions for this ComboButton.
|
|
124
|
+
*/
|
|
125
|
+
children: PropTypes.node.isRequired,
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Additional CSS class names.
|
|
129
|
+
*/
|
|
130
|
+
className: PropTypes.string,
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Specify whether the ComboButton should be disabled, or not.
|
|
134
|
+
*/
|
|
135
|
+
disabled: PropTypes.bool,
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Provide the label to be renderd on the primary action button.
|
|
139
|
+
*/
|
|
140
|
+
label: PropTypes.string.isRequired,
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Provide an optional function to be called when the primary action element is clicked.
|
|
144
|
+
*/
|
|
145
|
+
onClick: PropTypes.func,
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Specify the size of the buttons and menu.
|
|
149
|
+
*/
|
|
150
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Specify how the trigger tooltip should be aligned.
|
|
154
|
+
*/
|
|
155
|
+
tooltipAlign: PropTypes.oneOf(['top', 'top-left', 'top-right', 'bottom', 'bottom-left', 'bottom-right', 'left', 'right']),
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Optional method that takes in a message id and returns an
|
|
159
|
+
* internationalized string.
|
|
160
|
+
*/
|
|
161
|
+
translateWithId: PropTypes.func
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export { ComboButton };
|
|
@@ -196,8 +196,7 @@ var ComposedModal = /*#__PURE__*/React__default.forwardRef(function ComposedModa
|
|
|
196
196
|
onBlur: handleBlur,
|
|
197
197
|
onMouseDown: handleMousedown,
|
|
198
198
|
onKeyDown: handleKeyDown,
|
|
199
|
-
className: modalClass
|
|
200
|
-
tabIndex: "-1"
|
|
199
|
+
className: modalClass
|
|
201
200
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
202
201
|
className: containerClass,
|
|
203
202
|
role: "dialog",
|
|
@@ -0,0 +1,19 @@
|
|
|
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 React from 'react';
|
|
8
|
+
export interface TableToolbarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
9
|
+
/**
|
|
10
|
+
* Pass in the children that will be rendered inside the TableToolbar
|
|
11
|
+
*/
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* `lg` Change the row height of table
|
|
15
|
+
*/
|
|
16
|
+
size?: 'sm' | 'lg';
|
|
17
|
+
}
|
|
18
|
+
declare const TableToolbar: React.FC<TableToolbarProps>;
|
|
19
|
+
export default TableToolbar;
|
|
@@ -9,8 +9,8 @@ import { objectWithoutProperties as _objectWithoutProperties, defineProperty as
|
|
|
9
9
|
import cx from 'classnames';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import React__default from 'react';
|
|
12
|
-
import { AriaLabelPropType } from '../../prop-types/AriaPropTypes.js';
|
|
13
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
|
+
import { AriaLabelPropType } from '../../prop-types/AriaPropTypes.js';
|
|
14
14
|
|
|
15
15
|
var _excluded = ["children", "size"];
|
|
16
16
|
|
|
@@ -0,0 +1,21 @@
|
|
|
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 React from 'react';
|
|
8
|
+
import { ForwardRefReturn } from '../../types/common';
|
|
9
|
+
export interface TableToolbarActionProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'> {
|
|
10
|
+
/**
|
|
11
|
+
* Pass in the children that will be rendered inside the TableToolbarAction
|
|
12
|
+
*/
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* onClick handler for the TableToolbarAction
|
|
16
|
+
*/
|
|
17
|
+
onClick: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
18
|
+
}
|
|
19
|
+
export type TableToolbarActionComponent = ForwardRefReturn<HTMLDivElement, TableToolbarActionProps>;
|
|
20
|
+
declare const TableToolbarAction: TableToolbarActionComponent;
|
|
21
|
+
export default TableToolbarAction;
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
declare const TableToolbarContent: {
|
|
8
|
+
({ className: baseClassName, ...other }: {
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
className: any;
|
|
11
|
+
}): import("react").CElement<{
|
|
12
|
+
className: string | undefined;
|
|
13
|
+
}, import("react").Component<{
|
|
14
|
+
className: string | undefined;
|
|
15
|
+
}, any, any>>;
|
|
16
|
+
displayName: any;
|
|
17
|
+
propTypes: {
|
|
18
|
+
className: import("prop-types").Requireable<string>;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default TableToolbarContent;
|