@carbon/react 1.16.0-rc.0 → 1.17.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.Skeleton.d.ts +18 -0
- package/es/components/Checkbox/Checkbox.Skeleton.js +1 -2
- package/es/components/Checkbox/Checkbox.d.ts +47 -0
- package/es/components/Checkbox/Checkbox.js +6 -7
- package/es/components/Checkbox/index.d.ts +10 -0
- package/es/components/Checkbox/index.js +10 -0
- package/es/components/CodeSnippet/CodeSnippet.js +0 -1
- package/es/components/DataTable/TableToolbarSearch.js +1 -1
- package/es/components/ExpandableSearch/ExpandableSearch.js +1 -1
- package/es/components/Grid/Grid.js +0 -5
- package/es/components/NumberInput/NumberInput.js +45 -1
- package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +10 -4
- package/es/components/Search/Search.js +160 -184
- package/es/components/Search/index.js +2 -8
- package/es/components/Tab/index.js +1 -1
- package/es/components/Tabs/Tabs.Skeleton.js +6 -6
- package/es/components/Tabs/Tabs.js +582 -508
- package/es/components/Tabs/index.js +2 -12
- package/es/components/Tabs/{next/usePressable.js → usePressable.js} +1 -1
- package/es/components/Text/Text.d.ts +33 -0
- package/es/components/Text/Text.js +8 -5
- package/es/components/Text/TextDirection.d.ts +35 -0
- package/es/components/Text/TextDirectionContext.js +2 -0
- package/es/components/Text/createTextComponent.d.ts +18 -0
- package/es/components/Text/index.d.ts +18 -0
- package/es/components/Text/index.js +2 -0
- package/es/components/TextInput/TextInput.js +1 -1
- package/es/components/Tile/Tile.js +339 -502
- package/es/index.js +6 -6
- package/es/internal/useNormalizedInputProps.js +13 -17
- package/es/internal/usePrefix.d.ts +9 -0
- package/lib/components/Checkbox/Checkbox.Skeleton.d.ts +18 -0
- package/lib/components/Checkbox/Checkbox.Skeleton.js +1 -2
- package/lib/components/Checkbox/Checkbox.d.ts +47 -0
- package/lib/components/Checkbox/Checkbox.js +6 -7
- package/lib/components/Checkbox/index.d.ts +10 -0
- package/lib/components/Checkbox/index.js +18 -0
- package/lib/components/CodeSnippet/CodeSnippet.js +0 -1
- package/lib/components/DataTable/TableToolbarSearch.js +2 -2
- package/lib/components/ExpandableSearch/ExpandableSearch.js +3 -3
- package/lib/components/Grid/Grid.js +0 -5
- package/lib/components/NumberInput/NumberInput.js +45 -1
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +9 -3
- package/lib/components/Search/Search.js +159 -183
- package/lib/components/Search/index.js +2 -25
- package/lib/components/Tab/index.js +1 -1
- package/lib/components/Tabs/Tabs.Skeleton.js +6 -6
- package/lib/components/Tabs/Tabs.js +586 -507
- package/lib/components/Tabs/index.js +7 -33
- package/lib/components/Tabs/{next/usePressable.js → usePressable.js} +1 -1
- package/lib/components/Text/Text.d.ts +33 -0
- package/lib/components/Text/Text.js +8 -5
- package/lib/components/Text/TextDirection.d.ts +35 -0
- package/lib/components/Text/TextDirectionContext.js +2 -0
- package/lib/components/Text/createTextComponent.d.ts +18 -0
- package/lib/components/Text/index.d.ts +18 -0
- package/lib/components/Text/index.js +4 -0
- package/lib/components/TextInput/TextInput.js +1 -1
- package/lib/components/Tile/Tile.js +336 -499
- package/lib/index.js +71 -71
- package/lib/internal/useNormalizedInputProps.js +12 -16
- package/lib/internal/usePrefix.d.ts +9 -0
- package/package.json +8 -4
- package/es/components/Search/next/Search.js +0 -265
- package/es/components/Tabs/next/Tabs.Skeleton.js +0 -53
- package/es/components/Tabs/next/Tabs.js +0 -692
- package/es/components/Tile/index.js +0 -19
- package/es/components/Tile/next/Tile.js +0 -604
- package/lib/components/Search/next/Search.js +0 -275
- package/lib/components/Tabs/next/Tabs.Skeleton.js +0 -63
- package/lib/components/Tabs/next/Tabs.js +0 -708
- package/lib/components/Tile/index.js +0 -48
- package/lib/components/Tile/next/Tile.js +0 -619
package/es/index.js
CHANGED
|
@@ -55,7 +55,8 @@ export { default as PaginationNav } from './components/PaginationNav/PaginationN
|
|
|
55
55
|
export { default as PrimaryButton } from './components/PrimaryButton/PrimaryButton.js';
|
|
56
56
|
export { default as RadioButton } from './components/RadioButton/RadioButton.js';
|
|
57
57
|
export { default as RadioButtonGroup } from './components/RadioButtonGroup/RadioButtonGroup.js';
|
|
58
|
-
export { default as Search } from './components/Search/
|
|
58
|
+
export { default as Search } from './components/Search/Search.js';
|
|
59
|
+
export { default as SearchSkeleton } from './components/Search/Search.Skeleton.js';
|
|
59
60
|
export { default as ExpandableSearch } from './components/ExpandableSearch/ExpandableSearch.js';
|
|
60
61
|
export { default as SecondaryButton } from './components/SecondaryButton/SecondaryButton.js';
|
|
61
62
|
export { default as SelectSkeleton } from './components/Select/Select.Skeleton.js';
|
|
@@ -67,13 +68,13 @@ export { default as Slider } from './components/Slider/index.js';
|
|
|
67
68
|
export { StructuredListBody, StructuredListCell, StructuredListHead, StructuredListInput, StructuredListRow, StructuredListWrapper } from './components/StructuredList/index.js';
|
|
68
69
|
export { default as Tab } from './components/Tab/index.js';
|
|
69
70
|
export { default as TabContent } from './components/TabContent/TabContent.js';
|
|
70
|
-
export {
|
|
71
|
+
export { IconTab, TabList, TabPanel, TabPanels, Tabs } from './components/Tabs/Tabs.js';
|
|
72
|
+
export { default as TabsSkeleton } from './components/Tabs/Tabs.Skeleton.js';
|
|
71
73
|
export { default as TagSkeleton } from './components/Tag/Tag.Skeleton.js';
|
|
72
74
|
export { default as Tag } from './components/Tag/Tag.js';
|
|
73
75
|
export { default as TextAreaSkeleton } from './components/TextArea/TextArea.Skeleton.js';
|
|
74
76
|
export { default as TextArea } from './components/TextArea/TextArea.js';
|
|
75
77
|
import './components/TextInput/index.js';
|
|
76
|
-
export { ClickableTile, ExpandableTile, SelectableTile, Tile, TileAboveTheFoldContent, TileBelowTheFoldContent } from './components/Tile/index.js';
|
|
77
78
|
export { default as RadioTile } from './components/RadioTile/RadioTile.js';
|
|
78
79
|
export { default as TileGroup } from './components/TileGroup/index.js';
|
|
79
80
|
export { default as TimePicker } from './components/TimePicker/index.js';
|
|
@@ -90,9 +91,7 @@ export { default as DataTableSkeleton } from './components/DataTableSkeleton/Dat
|
|
|
90
91
|
export { default as BreadcrumbSkeleton } from './components/Breadcrumb/Breadcrumb.Skeleton.js';
|
|
91
92
|
export { default as ProgressIndicatorSkeleton } from './components/ProgressIndicator/ProgressIndicator.Skeleton.js';
|
|
92
93
|
export { default as RadioButtonSkeleton } from './components/RadioButton/RadioButton.Skeleton.js';
|
|
93
|
-
export { default as SearchSkeleton } from './components/Search/Search.Skeleton.js';
|
|
94
94
|
export { default as SliderSkeleton } from './components/Slider/Slider.Skeleton.js';
|
|
95
|
-
export { default as TabsSkeleton } from './components/Tabs/Tabs.Skeleton.js';
|
|
96
95
|
export { default as TextInputSkeleton } from './components/TextInput/TextInput.Skeleton.js';
|
|
97
96
|
export { default as ToggleSmallSkeleton } from './components/ToggleSmall/ToggleSmall.Skeleton.js';
|
|
98
97
|
export { default as IconSkeleton } from './components/Icon/Icon.Skeleton.js';
|
|
@@ -105,6 +104,7 @@ import './components/Menu/index.js';
|
|
|
105
104
|
export { OverflowMenuV2 as unstable_OverflowMenuV2 } from './components/OverflowMenuV2/index.js';
|
|
106
105
|
export { Popover, PopoverContent } from './components/Popover/index.js';
|
|
107
106
|
export { HStack, VStack } from './components/Stack/index.js';
|
|
107
|
+
import './components/Text/index.js';
|
|
108
108
|
export { DefinitionTooltip } from './components/Tooltip/next/DefinitionTooltip.js';
|
|
109
109
|
export { GlobalTheme, Theme, useTheme } from './components/Theme/index.js';
|
|
110
110
|
export { usePrefix } from './internal/usePrefix.js';
|
|
@@ -177,7 +177,7 @@ export { default as ControlledPasswordInput } from './components/TextInput/Contr
|
|
|
177
177
|
export { default as PasswordInput } from './components/TextInput/PasswordInput.js';
|
|
178
178
|
export { ProgressIndicator, ProgressStep } from './components/ProgressIndicator/ProgressIndicator.js';
|
|
179
179
|
export { default as StructuredListSkeleton } from './components/StructuredList/StructuredList.Skeleton.js';
|
|
180
|
-
export {
|
|
180
|
+
export { ClickableTile, ExpandableTile, SelectableTile, Tile, TileAboveTheFoldContent, TileBelowTheFoldContent } from './components/Tile/Tile.js';
|
|
181
181
|
export { default as Content } from './components/UIShell/Content.js';
|
|
182
182
|
export { default as Header } from './components/UIShell/Header.js';
|
|
183
183
|
export { default as HeaderContainer } from './components/UIShell/HeaderContainer.js';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React__default from 'react';
|
|
9
|
-
import {
|
|
9
|
+
import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
|
|
10
10
|
import { usePrefix } from './usePrefix.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -65,22 +65,18 @@ function useNormalizedInputProps(_ref) {
|
|
|
65
65
|
helperId: "".concat(id, "-helper-text")
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
if (
|
|
69
|
-
normalizedProps.icon =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
normalizedProps.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
normalizedProps.
|
|
79
|
-
|
|
80
|
-
className: "".concat(prefix, "--form-requirement"),
|
|
81
|
-
id: normalizedProps.warnId
|
|
82
|
-
}, warnText);
|
|
83
|
-
}
|
|
68
|
+
if (normalizedProps.invalid) {
|
|
69
|
+
normalizedProps.icon = WarningFilled;
|
|
70
|
+
normalizedProps.validation = /*#__PURE__*/React__default.createElement("div", {
|
|
71
|
+
className: "".concat(prefix, "--form-requirement"),
|
|
72
|
+
id: normalizedProps.invalidId
|
|
73
|
+
}, invalidText);
|
|
74
|
+
} else if (normalizedProps.warn) {
|
|
75
|
+
normalizedProps.icon = WarningAltFilled;
|
|
76
|
+
normalizedProps.validation = /*#__PURE__*/React__default.createElement("div", {
|
|
77
|
+
className: "".concat(prefix, "--form-requirement"),
|
|
78
|
+
id: normalizedProps.warnId
|
|
79
|
+
}, warnText);
|
|
84
80
|
}
|
|
85
81
|
|
|
86
82
|
return normalizedProps;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2018
|
|
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 declare const PrefixContext: React.Context<string>;
|
|
9
|
+
export declare function usePrefix(): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2018
|
|
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 PropTypes from 'prop-types';
|
|
8
|
+
import { HTMLAttributes } from 'react';
|
|
9
|
+
declare const CheckboxSkeleton: {
|
|
10
|
+
({ className, ...rest }: HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
11
|
+
propTypes: {
|
|
12
|
+
/**
|
|
13
|
+
* Specify an optional className to add.
|
|
14
|
+
*/
|
|
15
|
+
className: PropTypes.Requireable<string>;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default CheckboxSkeleton;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2018
|
|
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 { ReactNodeLike } from 'prop-types';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
declare type ExcludedAttributes = 'id' | 'onChange' | 'onClick' | 'type';
|
|
10
|
+
export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, ExcludedAttributes> {
|
|
11
|
+
/**
|
|
12
|
+
* Provide an `id` to uniquely identify the Checkbox input
|
|
13
|
+
*/
|
|
14
|
+
id: string;
|
|
15
|
+
/**
|
|
16
|
+
* Provide a label to provide a description of the Checkbox input that you are
|
|
17
|
+
* exposing to the user
|
|
18
|
+
*/
|
|
19
|
+
labelText: NonNullable<ReactNodeLike>;
|
|
20
|
+
/**
|
|
21
|
+
* Specify whether the underlying input should be checked by default
|
|
22
|
+
*/
|
|
23
|
+
defaultChecked?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Specify whether the Checkbox should be disabled
|
|
26
|
+
*/
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Specify whether the label should be hidden, or not
|
|
30
|
+
*/
|
|
31
|
+
hideLabel?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Specify whether the Checkbox is in an indeterminate state
|
|
34
|
+
*/
|
|
35
|
+
indeterminate?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Provide an optional handler that is called when the internal state of
|
|
38
|
+
* Checkbox changes. This handler is called with event and state info.
|
|
39
|
+
* `(event, { checked, id }) => void`
|
|
40
|
+
*/
|
|
41
|
+
onChange?: (evt: React.ChangeEvent<HTMLInputElement>, data: {
|
|
42
|
+
checked: boolean;
|
|
43
|
+
id: string;
|
|
44
|
+
}) => void;
|
|
45
|
+
}
|
|
46
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<unknown>>;
|
|
47
|
+
export default Checkbox;
|
|
@@ -24,7 +24,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
24
24
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
25
25
|
|
|
26
26
|
var _excluded = ["className", "id", "labelText", "onChange", "indeterminate", "hideLabel", "title"];
|
|
27
|
-
var Checkbox = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
27
|
+
var Checkbox = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, _ref2) {
|
|
28
28
|
var className = _ref.className,
|
|
29
29
|
id = _ref.id,
|
|
30
30
|
labelText = _ref.labelText,
|
|
@@ -43,7 +43,7 @@ var Checkbox = /*#__PURE__*/React__default["default"].forwardRef(function Checkb
|
|
|
43
43
|
}, /*#__PURE__*/React__default["default"].createElement("input", _rollupPluginBabelHelpers["extends"]({}, other, {
|
|
44
44
|
type: "checkbox",
|
|
45
45
|
onChange: function onChange(evt) {
|
|
46
|
-
_onChange(evt, {
|
|
46
|
+
_onChange && _onChange(evt, {
|
|
47
47
|
checked: evt.target.checked,
|
|
48
48
|
id: id
|
|
49
49
|
});
|
|
@@ -51,20 +51,20 @@ var Checkbox = /*#__PURE__*/React__default["default"].forwardRef(function Checkb
|
|
|
51
51
|
className: "".concat(prefix, "--checkbox"),
|
|
52
52
|
id: id,
|
|
53
53
|
ref: function ref(el) {
|
|
54
|
-
if (el) {
|
|
54
|
+
if (el && indeterminate) {
|
|
55
55
|
el.indeterminate = indeterminate;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
if (typeof _ref2 === 'function') {
|
|
59
59
|
_ref2(el);
|
|
60
|
-
} else if (Object(_ref2) === _ref2) {
|
|
60
|
+
} else if (_ref2 && Object(_ref2) === _ref2) {
|
|
61
61
|
_ref2.current = el;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
})), /*#__PURE__*/React__default["default"].createElement("label", {
|
|
65
65
|
htmlFor: id,
|
|
66
66
|
className: "".concat(prefix, "--checkbox-label"),
|
|
67
|
-
title: title
|
|
67
|
+
title: title
|
|
68
68
|
}, /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
69
69
|
className: innerLabelClasses
|
|
70
70
|
}, labelText)));
|
|
@@ -128,6 +128,5 @@ Checkbox.defaultProps = {
|
|
|
128
128
|
indeterminate: false
|
|
129
129
|
};
|
|
130
130
|
Checkbox.displayName = 'Checkbox';
|
|
131
|
-
var Checkbox$1 = Checkbox;
|
|
132
131
|
|
|
133
|
-
exports["default"] = Checkbox
|
|
132
|
+
exports["default"] = Checkbox;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2018
|
|
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
|
+
export { default as CheckboxSkeleton } from './Checkbox.Skeleton';
|
|
8
|
+
import Checkbox, { CheckboxProps } from './Checkbox';
|
|
9
|
+
export type { CheckboxProps };
|
|
10
|
+
export default Checkbox;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2022
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
+
|
|
12
|
+
var Checkbox_Skeleton = require('./Checkbox.Skeleton.js');
|
|
13
|
+
var Checkbox = require('./Checkbox.js');
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
exports.CheckboxSkeleton = Checkbox_Skeleton["default"];
|
|
18
|
+
exports["default"] = Checkbox["default"];
|
|
@@ -256,7 +256,6 @@ function CodeSnippet(_ref) {
|
|
|
256
256
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
257
257
|
className: "".concat(prefix, "--snippet-btn--text")
|
|
258
258
|
}, expandCodeBtnText), /*#__PURE__*/React__default["default"].createElement(iconsReact.ChevronDown, {
|
|
259
|
-
"aria-label": expandCodeBtnText,
|
|
260
259
|
className: "".concat(prefix, "--icon-chevron--down ").concat(prefix, "--snippet__icon"),
|
|
261
260
|
name: "chevron--down",
|
|
262
261
|
role: "img"
|
|
@@ -13,7 +13,7 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
|
|
|
13
13
|
var cx = require('classnames');
|
|
14
14
|
var PropTypes = require('prop-types');
|
|
15
15
|
var React = require('react');
|
|
16
|
-
var
|
|
16
|
+
var Search = require('../Search/Search.js');
|
|
17
17
|
var instanceId = require('./tools/instanceId.js');
|
|
18
18
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
19
19
|
|
|
@@ -124,7 +124,7 @@ var TableToolbarSearch = function TableToolbarSearch(_ref) {
|
|
|
124
124
|
return !value && handleExpand(event, false);
|
|
125
125
|
};
|
|
126
126
|
|
|
127
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
127
|
+
return /*#__PURE__*/React__default["default"].createElement(Search["default"], _rollupPluginBabelHelpers["extends"]({
|
|
128
128
|
disabled: disabled,
|
|
129
129
|
className: searchClasses,
|
|
130
130
|
value: value,
|
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
12
12
|
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
13
13
|
var React = require('react');
|
|
14
14
|
var cx = require('classnames');
|
|
15
|
-
var
|
|
15
|
+
var Search = require('../Search/Search.js');
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
17
|
var events = require('../../tools/events.js');
|
|
18
18
|
|
|
@@ -68,7 +68,7 @@ function ExpandableSearch(_ref) {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
var classes = cx__default["default"]("".concat(prefix, "--search--expandable"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(prefix, "--search--expanded"), expanded), props.className);
|
|
71
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
71
|
+
return /*#__PURE__*/React__default["default"].createElement(Search["default"], _rollupPluginBabelHelpers["extends"]({}, props, {
|
|
72
72
|
ref: searchRef,
|
|
73
73
|
className: classes,
|
|
74
74
|
onFocus: events.composeEventHandlers([onFocus, handleFocus]),
|
|
@@ -78,6 +78,6 @@ function ExpandableSearch(_ref) {
|
|
|
78
78
|
}));
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
ExpandableSearch.propTypes =
|
|
81
|
+
ExpandableSearch.propTypes = Search["default"].propTypes;
|
|
82
82
|
|
|
83
83
|
exports["default"] = ExpandableSearch;
|
|
@@ -46,11 +46,6 @@ Grid.propTypes = {
|
|
|
46
46
|
*/
|
|
47
47
|
className: PropTypes__default["default"].string,
|
|
48
48
|
|
|
49
|
-
/**
|
|
50
|
-
* Specify how many columns wide the Grid should span
|
|
51
|
-
*/
|
|
52
|
-
columns: PropTypes__default["default"].number,
|
|
53
|
-
|
|
54
49
|
/**
|
|
55
50
|
* Collapse the gutter to 1px. Useful for fluid layouts.
|
|
56
51
|
* Rows have 1px of margin between them to match gutter.
|
|
@@ -26,7 +26,7 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
26
26
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
27
27
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
28
28
|
|
|
29
|
-
var _excluded = ["allowEmpty", "className", "disabled", "defaultValue", "helperText", "hideLabel", "hideSteppers", "iconDescription", "id", "label", "invalid", "invalidText", "light", "max", "min", "onChange", "onClick", "onKeyUp", "readOnly", "size", "step", "translateWithId", "warn", "warnText", "value"];
|
|
29
|
+
var _excluded = ["allowEmpty", "className", "disabled", "disableWheel", "defaultValue", "helperText", "hideLabel", "hideSteppers", "iconDescription", "id", "label", "invalid", "invalidText", "light", "max", "min", "onChange", "onClick", "onKeyUp", "readOnly", "size", "step", "translateWithId", "warn", "warnText", "value"];
|
|
30
30
|
|
|
31
31
|
var _defaultTranslations, _Subtract, _Add;
|
|
32
32
|
var translationIds = {
|
|
@@ -44,6 +44,8 @@ var NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function Num
|
|
|
44
44
|
customClassName = props.className,
|
|
45
45
|
_props$disabled = props.disabled,
|
|
46
46
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
47
|
+
_props$disableWheel = props.disableWheel,
|
|
48
|
+
disableWheelProp = _props$disableWheel === void 0 ? false : _props$disableWheel,
|
|
47
49
|
defaultValue = props.defaultValue,
|
|
48
50
|
_props$helperText = props.helperText,
|
|
49
51
|
helperText = _props$helperText === void 0 ? '' : _props$helperText,
|
|
@@ -182,6 +184,24 @@ var NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function Num
|
|
|
182
184
|
onClick: _onClick,
|
|
183
185
|
onChange: handleOnChange,
|
|
184
186
|
onKeyUp: onKeyUp,
|
|
187
|
+
onFocus: function onFocus(e) {
|
|
188
|
+
if (disableWheelProp) {
|
|
189
|
+
e.target.addEventListener('wheel', disableWheel);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (rest.onFocus) {
|
|
193
|
+
rest.onFocus(e);
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
onBlur: function onBlur(e) {
|
|
197
|
+
if (disableWheelProp) {
|
|
198
|
+
e.target.removeEventListener('wheel', disableWheel);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (rest.onBlur) {
|
|
202
|
+
rest.onBlur(e);
|
|
203
|
+
}
|
|
204
|
+
},
|
|
185
205
|
pattern: "[0-9]*",
|
|
186
206
|
readOnly: readOnly,
|
|
187
207
|
step: step,
|
|
@@ -264,6 +284,11 @@ NumberInput.propTypes = {
|
|
|
264
284
|
*/
|
|
265
285
|
defaultValue: PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string]),
|
|
266
286
|
|
|
287
|
+
/**
|
|
288
|
+
* Specify if the wheel functionality for the input should be disabled, or not
|
|
289
|
+
*/
|
|
290
|
+
disableWheel: PropTypes__default["default"].bool,
|
|
291
|
+
|
|
267
292
|
/**
|
|
268
293
|
* Specify if the control should be disabled, or not
|
|
269
294
|
*/
|
|
@@ -459,6 +484,25 @@ function getInputValidity(_ref4) {
|
|
|
459
484
|
|
|
460
485
|
return true;
|
|
461
486
|
}
|
|
487
|
+
/**
|
|
488
|
+
* It prevents any wheel event from emitting.
|
|
489
|
+
*
|
|
490
|
+
* We want to prevent this input field from changing by the user accidentally
|
|
491
|
+
* when the user scrolling up or down in a long form. So we prevent the default
|
|
492
|
+
* behavior of wheel events when it is focused.
|
|
493
|
+
*
|
|
494
|
+
* Because React uses passive event handler by default, we can't just call
|
|
495
|
+
* `preventDefault` in the `onWheel` event handler. So we have to get the input
|
|
496
|
+
* ref and add our event handler manually.
|
|
497
|
+
*
|
|
498
|
+
* @see https://github.com/facebook/react/pull/19654
|
|
499
|
+
* @param {WheelEvent} e A wheel event.
|
|
500
|
+
*/
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
function disableWheel(e) {
|
|
504
|
+
e.preventDefault();
|
|
505
|
+
}
|
|
462
506
|
/**
|
|
463
507
|
* Clamp the given value between the upper bound `max` and the lower bound `min`
|
|
464
508
|
* @param {number} max
|
|
@@ -22,7 +22,7 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
22
22
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
23
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
24
24
|
|
|
25
|
-
var _excluded = ["className"];
|
|
25
|
+
var _excluded = ["className", "vertical"];
|
|
26
26
|
|
|
27
27
|
var _CircleDash, _Step, _Step2, _Step3, _Step4;
|
|
28
28
|
|
|
@@ -41,11 +41,12 @@ function Step() {
|
|
|
41
41
|
|
|
42
42
|
function ProgressIndicatorSkeleton(_ref) {
|
|
43
43
|
var className = _ref.className,
|
|
44
|
+
vertical = _ref.vertical,
|
|
44
45
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
45
46
|
|
|
46
47
|
var prefix = usePrefix.usePrefix();
|
|
47
48
|
return /*#__PURE__*/React__default["default"].createElement("ul", _rollupPluginBabelHelpers["extends"]({
|
|
48
|
-
className: cx__default["default"]("".concat(prefix, "--progress"), "".concat(prefix, "--skeleton"), className)
|
|
49
|
+
className: cx__default["default"]("".concat(prefix, "--progress"), "".concat(prefix, "--skeleton"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(prefix, "--progress--vertical"), vertical), className)
|
|
49
50
|
}, rest), _Step || (_Step = /*#__PURE__*/React__default["default"].createElement(Step, null)), _Step2 || (_Step2 = /*#__PURE__*/React__default["default"].createElement(Step, null)), _Step3 || (_Step3 = /*#__PURE__*/React__default["default"].createElement(Step, null)), _Step4 || (_Step4 = /*#__PURE__*/React__default["default"].createElement(Step, null)));
|
|
50
51
|
}
|
|
51
52
|
|
|
@@ -53,7 +54,12 @@ ProgressIndicatorSkeleton.propTypes = {
|
|
|
53
54
|
/**
|
|
54
55
|
* Specify an optional className to add.
|
|
55
56
|
*/
|
|
56
|
-
className: PropTypes__default["default"].string
|
|
57
|
+
className: PropTypes__default["default"].string,
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Determines whether or not the ProgressIndicator should be rendered vertically.
|
|
61
|
+
*/
|
|
62
|
+
vertical: PropTypes__default["default"].bool
|
|
57
63
|
};
|
|
58
64
|
|
|
59
65
|
exports["default"] = ProgressIndicatorSkeleton;
|