@carbon/ibm-products 1.6.1 → 1.9.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/css/index-full-carbon.css +224 -143
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +3 -3
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +1 -2
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +178 -142
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +3 -3
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +178 -142
- package/css/index.css.map +1 -1
- package/css/index.min.css +3 -3
- package/css/index.min.css.map +1 -1
- package/es/components/APIKeyModal/APIKeyModal.js +10 -13
- package/es/components/ActionBar/ActionBar.js +0 -3
- package/es/components/ActionBar/ActionBarItem.js +2 -6
- package/es/components/ActionSet/ActionSet.js +11 -13
- package/es/components/AddSelect/AddSelect.js +121 -25
- package/es/components/AddSelect/AddSelectBreadcrumbs.js +5 -5
- package/es/components/AddSelect/AddSelectColumn.js +21 -0
- package/es/components/AddSelect/AddSelectList.js +68 -9
- package/es/components/AddSelect/AddSelectSidebar.js +43 -5
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +0 -3
- package/es/components/ButtonMenu/ButtonMenu.js +6 -4
- package/es/components/ButtonMenu/ButtonMenuItem.js +1 -2
- package/es/components/Card/Card.js +31 -21
- package/es/components/Card/CardFooter.js +14 -10
- package/es/components/Card/CardHeader.js +8 -6
- package/es/components/Cascade/Cascade.js +5 -4
- package/es/components/ComboButton/ComboButton.js +0 -4
- package/es/components/ComboButton/ComboButtonItem/index.js +0 -5
- package/es/components/CreateFullPage/CreateFullPageStep.js +15 -8
- package/es/components/CreateModal/CreateModal.js +1 -4
- package/es/components/CreateTearsheet/CreateTearsheet.js +10 -11
- package/es/components/CreateTearsheet/CreateTearsheetStep.js +18 -14
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +454 -0
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +322 -0
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +64 -0
- package/es/components/DataSpreadsheet/createActiveCellFn.js +45 -0
- package/es/components/DataSpreadsheet/createCellSelectionArea.js +45 -0
- package/es/components/DataSpreadsheet/generateData.js +47 -0
- package/es/components/DataSpreadsheet/getCellSize.js +30 -0
- package/es/components/{CancelableTextEdit → DataSpreadsheet}/index.js +2 -2
- package/es/components/EditSidePanel/EditSidePanel.js +9 -10
- package/es/components/EmptyStates/EmptyState.js +7 -6
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +4 -8
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +4 -8
- package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +4 -8
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +4 -8
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +4 -8
- package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +4 -8
- package/es/components/ExampleComponent/ExampleComponent.js +12 -13
- package/es/components/ExportModal/ExportModal.js +13 -9
- package/es/components/ExpressiveCard/ExpressiveCard.js +0 -8
- package/es/components/ImportModal/ImportModal.js +7 -5
- package/es/components/InlineEdit/InlineEdit.js +51 -46
- package/es/components/LoadingBar/LoadingBar.js +13 -17
- package/es/components/ModifiedTabs/ModifiedTabLabelNew.js +0 -4
- package/es/components/ModifiedTabs/ModifiedTabLabelWithClose.js +0 -5
- package/es/components/ModifiedTabs/ModifiedTabs.js +24 -18
- package/es/components/NotificationsPanel/NotificationsPanel.js +109 -86
- package/es/components/OptionsTile/OptionsTile.js +6 -9
- package/es/components/PageHeader/PageHeader.js +10 -7
- package/es/components/ProductiveCard/ProductiveCard.js +23 -12
- package/es/components/RemoveModal/RemoveModal.js +0 -3
- package/es/components/SidePanel/SidePanel.js +22 -17
- package/es/components/TagSet/TagSet.js +13 -9
- package/es/components/TagSet/TagSetModal.js +16 -12
- package/es/components/TagSet/TagSetOverflow.js +21 -13
- package/es/components/Tearsheet/Tearsheet.js +27 -18
- package/es/components/Tearsheet/TearsheetNarrow.js +18 -15
- package/es/components/Tearsheet/TearsheetShell.js +3 -4
- package/es/components/Toolbar/ToolbarButton.js +0 -3
- package/es/components/WebTerminal/WebTerminal.js +17 -18
- package/es/components/index.js +2 -2
- package/es/global/js/hooks/index.js +1 -0
- package/es/global/js/hooks/useActiveElement.js +27 -0
- package/es/global/js/package-settings.js +2 -1
- package/es/global/js/utils/DisplayBox.js +31 -0
- package/es/global/js/utils/Wrap.js +7 -5
- package/es/global/js/utils/deepCloneObject.js +26 -0
- package/es/global/js/utils/getScrollbarWidth.js +14 -0
- package/lib/components/APIKeyModal/APIKeyModal.js +10 -13
- package/lib/components/ActionBar/ActionBar.js +0 -3
- package/lib/components/ActionBar/ActionBarItem.js +2 -6
- package/lib/components/ActionSet/ActionSet.js +11 -13
- package/lib/components/AddSelect/AddSelect.js +119 -24
- package/lib/components/AddSelect/AddSelectBreadcrumbs.js +3 -4
- package/lib/components/AddSelect/AddSelectColumn.js +37 -0
- package/lib/components/AddSelect/AddSelectList.js +66 -9
- package/lib/components/AddSelect/AddSelectSidebar.js +43 -4
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +0 -3
- package/lib/components/ButtonMenu/ButtonMenu.js +6 -4
- package/lib/components/ButtonMenu/ButtonMenuItem.js +1 -2
- package/lib/components/Card/Card.js +31 -21
- package/lib/components/Card/CardFooter.js +14 -10
- package/lib/components/Card/CardHeader.js +8 -6
- package/lib/components/Cascade/Cascade.js +5 -4
- package/lib/components/ComboButton/ComboButton.js +0 -4
- package/lib/components/ComboButton/ComboButtonItem/index.js +0 -5
- package/lib/components/CreateFullPage/CreateFullPageStep.js +17 -14
- package/lib/components/CreateModal/CreateModal.js +1 -4
- package/lib/components/CreateTearsheet/CreateTearsheet.js +10 -11
- package/lib/components/CreateTearsheet/CreateTearsheetStep.js +20 -20
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +478 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +349 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +80 -0
- package/lib/components/DataSpreadsheet/createActiveCellFn.js +56 -0
- package/lib/components/DataSpreadsheet/createCellSelectionArea.js +56 -0
- package/lib/components/DataSpreadsheet/generateData.js +58 -0
- package/lib/components/DataSpreadsheet/getCellSize.js +39 -0
- package/lib/components/DataSpreadsheet/index.js +13 -0
- package/lib/components/EditSidePanel/EditSidePanel.js +9 -10
- package/lib/components/EmptyStates/EmptyState.js +9 -8
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +3 -7
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +3 -7
- package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +3 -7
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +3 -7
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +3 -7
- package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +3 -7
- package/lib/components/ExampleComponent/ExampleComponent.js +12 -13
- package/lib/components/ExportModal/ExportModal.js +13 -9
- package/lib/components/ExpressiveCard/ExpressiveCard.js +0 -8
- package/lib/components/ImportModal/ImportModal.js +7 -5
- package/lib/components/InlineEdit/InlineEdit.js +51 -46
- package/lib/components/LoadingBar/LoadingBar.js +13 -17
- package/lib/components/ModifiedTabs/ModifiedTabLabelNew.js +0 -4
- package/lib/components/ModifiedTabs/ModifiedTabLabelWithClose.js +0 -5
- package/lib/components/ModifiedTabs/ModifiedTabs.js +24 -18
- package/lib/components/NotificationsPanel/NotificationsPanel.js +109 -86
- package/lib/components/OptionsTile/OptionsTile.js +6 -9
- package/lib/components/PageHeader/PageHeader.js +9 -6
- package/lib/components/ProductiveCard/ProductiveCard.js +24 -18
- package/lib/components/RemoveModal/RemoveModal.js +0 -3
- package/lib/components/SidePanel/SidePanel.js +22 -17
- package/lib/components/TagSet/TagSet.js +13 -9
- package/lib/components/TagSet/TagSetModal.js +17 -13
- package/lib/components/TagSet/TagSetOverflow.js +24 -19
- package/lib/components/Tearsheet/Tearsheet.js +26 -17
- package/lib/components/Tearsheet/TearsheetNarrow.js +18 -15
- package/lib/components/Tearsheet/TearsheetShell.js +2 -3
- package/lib/components/Toolbar/ToolbarButton.js +0 -3
- package/lib/components/WebTerminal/WebTerminal.js +17 -18
- package/lib/components/index.js +8 -8
- package/lib/global/js/hooks/index.js +8 -0
- package/lib/global/js/hooks/useActiveElement.js +39 -0
- package/lib/global/js/package-settings.js +2 -1
- package/lib/global/js/utils/DisplayBox.js +46 -0
- package/lib/global/js/utils/Wrap.js +7 -5
- package/lib/global/js/utils/deepCloneObject.js +37 -0
- package/lib/global/js/utils/getScrollbarWidth.js +23 -0
- package/package.json +18 -16
- package/scss/components/{CancelableTextEdit → ActionBar}/_storybook-styles.scss +2 -2
- package/scss/components/ActionSet/_storybook-styles.scss +1 -3
- package/scss/components/AddSelect/_add-select.scss +77 -1
- package/scss/components/BreadcrumbWithOverflow/_storybook-styles.scss +8 -0
- package/scss/components/ButtonSetWithOverflow/_storybook-styles.scss +8 -0
- package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +120 -0
- package/scss/components/{CancelableTextEdit → DataSpreadsheet}/_index.scss +2 -2
- package/scss/components/DataSpreadsheet/_storybook-styles.scss +6 -0
- package/scss/components/InlineEdit/_inline-edit.scss +22 -8
- package/scss/components/InlineEdit/_storybook-styles.scss +1 -0
- package/scss/components/TagSet/_storybook-styles.scss +8 -0
- package/scss/components/Tearsheet/_tearsheet.scss +1 -2
- package/scss/components/_index.scss +1 -1
- package/scss/global/styles/_display-box.scss +62 -0
- package/es/components/CancelableTextEdit/CancelableTextEdit.js +0 -245
- package/lib/components/CancelableTextEdit/CancelableTextEdit.js +0 -265
- package/lib/components/CancelableTextEdit/index.js +0 -13
- package/scss/components/CancelableTextEdit/_cancelable-text-edit.scss +0 -212
|
@@ -41,7 +41,12 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
41
41
|
var blockClass = "".concat(_settings.pkg.prefix, "--edit-side-panel");
|
|
42
42
|
var sidePanelBlockClass = "".concat(_settings.pkg.prefix, "--side-panel");
|
|
43
43
|
var componentName = 'EditSidePanel'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
|
|
44
|
+
// Default values for props
|
|
44
45
|
|
|
46
|
+
var defaults = {
|
|
47
|
+
placement: 'right',
|
|
48
|
+
size: 'md'
|
|
49
|
+
};
|
|
45
50
|
/**
|
|
46
51
|
* TODO: A description of the component.
|
|
47
52
|
*/
|
|
@@ -55,12 +60,14 @@ var EditSidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref)
|
|
|
55
60
|
onRequestClose = _ref.onRequestClose,
|
|
56
61
|
onRequestSubmit = _ref.onRequestSubmit,
|
|
57
62
|
open = _ref.open,
|
|
58
|
-
placement = _ref.placement,
|
|
63
|
+
_ref$placement = _ref.placement,
|
|
64
|
+
placement = _ref$placement === void 0 ? defaults.placement : _ref$placement,
|
|
59
65
|
primaryButtonText = _ref.primaryButtonText,
|
|
60
66
|
secondaryButtonText = _ref.secondaryButtonText,
|
|
61
67
|
selectorPrimaryFocus = _ref.selectorPrimaryFocus,
|
|
62
68
|
selectorPageContent = _ref.selectorPageContent,
|
|
63
|
-
size = _ref.size,
|
|
69
|
+
_ref$size = _ref.size,
|
|
70
|
+
size = _ref$size === void 0 ? defaults.size : _ref$size,
|
|
64
71
|
slideIn = _ref.slideIn,
|
|
65
72
|
subtitle = _ref.subtitle,
|
|
66
73
|
title = _ref.title,
|
|
@@ -209,12 +216,4 @@ EditSidePanel.propTypes = {
|
|
|
209
216
|
* The title of the CreateSidePanel is usually the product or service name.
|
|
210
217
|
*/
|
|
211
218
|
title: _propTypes.default.node.isRequired
|
|
212
|
-
}; // Default values for component props. Default values are not required for
|
|
213
|
-
// props that are required, nor for props where the component can apply
|
|
214
|
-
// 'undefined' values reasonably. Default values should be provided when the
|
|
215
|
-
// component needs to make a choice or assumption when a prop is not supplied.
|
|
216
|
-
|
|
217
|
-
EditSidePanel.defaultProps = {
|
|
218
|
-
placement: 'right',
|
|
219
|
-
size: 'md'
|
|
220
219
|
};
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.defaults = exports.EmptyState = void 0;
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
@@ -37,7 +37,12 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
37
37
|
|
|
38
38
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
|
39
39
|
var blockClass = "".concat(_settings.pkg.prefix, "--empty-state");
|
|
40
|
-
var componentName = 'EmptyState';
|
|
40
|
+
var componentName = 'EmptyState'; // Default values for props
|
|
41
|
+
|
|
42
|
+
var defaults = {
|
|
43
|
+
size: 'lg'
|
|
44
|
+
};
|
|
45
|
+
exports.defaults = defaults;
|
|
41
46
|
|
|
42
47
|
var EmptyState = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
43
48
|
var action = _ref.action,
|
|
@@ -45,7 +50,8 @@ var EmptyState = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
45
50
|
illustration = _ref.illustration,
|
|
46
51
|
illustrationDescription = _ref.illustrationDescription,
|
|
47
52
|
link = _ref.link,
|
|
48
|
-
size = _ref.size,
|
|
53
|
+
_ref$size = _ref.size,
|
|
54
|
+
size = _ref$size === void 0 ? defaults.size : _ref$size,
|
|
49
55
|
subtitle = _ref.subtitle,
|
|
50
56
|
title = _ref.title,
|
|
51
57
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -73,10 +79,6 @@ var EmptyState = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
73
79
|
|
|
74
80
|
exports.EmptyState = EmptyState;
|
|
75
81
|
exports.EmptyState = EmptyState = _settings.pkg.checkComponentEnabled(EmptyState, componentName);
|
|
76
|
-
var EmptyStateDefaultProps = {
|
|
77
|
-
size: 'lg'
|
|
78
|
-
};
|
|
79
|
-
exports.EmptyStateDefaultProps = EmptyStateDefaultProps;
|
|
80
82
|
EmptyState.propTypes = {
|
|
81
83
|
/**
|
|
82
84
|
* Empty state action button
|
|
@@ -130,5 +132,4 @@ EmptyState.propTypes = {
|
|
|
130
132
|
*/
|
|
131
133
|
title: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]).isRequired
|
|
132
134
|
};
|
|
133
|
-
EmptyState.defaultProps = EmptyStateDefaultProps;
|
|
134
135
|
EmptyState.displayName = componentName;
|
|
@@ -46,7 +46,8 @@ var ErrorEmptyState = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
|
46
46
|
className = _ref.className,
|
|
47
47
|
illustrationTheme = _ref.illustrationTheme,
|
|
48
48
|
link = _ref.link,
|
|
49
|
-
size = _ref.size,
|
|
49
|
+
_ref$size = _ref.size,
|
|
50
|
+
size = _ref$size === void 0 ? _EmptyState.defaults.size : _ref$size,
|
|
50
51
|
subtitle = _ref.subtitle,
|
|
51
52
|
title = _ref.title,
|
|
52
53
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -120,9 +121,4 @@ ErrorEmptyState.propTypes = {
|
|
|
120
121
|
* Empty state title
|
|
121
122
|
*/
|
|
122
123
|
title: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]).isRequired
|
|
123
|
-
};
|
|
124
|
-
// props that are required, nor for props where the component can apply
|
|
125
|
-
// 'undefined' values reasonably. Default values should be provided when the
|
|
126
|
-
// component needs to make a choice or assumption when a prop is not supplied.
|
|
127
|
-
|
|
128
|
-
ErrorEmptyState.defaultProps = _EmptyState.EmptyStateDefaultProps;
|
|
124
|
+
};
|
|
@@ -46,7 +46,8 @@ var NoDataEmptyState = /*#__PURE__*/_react.default.forwardRef(function (_ref, re
|
|
|
46
46
|
className = _ref.className,
|
|
47
47
|
illustrationTheme = _ref.illustrationTheme,
|
|
48
48
|
link = _ref.link,
|
|
49
|
-
size = _ref.size,
|
|
49
|
+
_ref$size = _ref.size,
|
|
50
|
+
size = _ref$size === void 0 ? _EmptyState.defaults.size : _ref$size,
|
|
50
51
|
subtitle = _ref.subtitle,
|
|
51
52
|
title = _ref.title,
|
|
52
53
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -120,9 +121,4 @@ NoDataEmptyState.propTypes = {
|
|
|
120
121
|
* Empty state title
|
|
121
122
|
*/
|
|
122
123
|
title: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]).isRequired
|
|
123
|
-
};
|
|
124
|
-
// props that are required, nor for props where the component can apply
|
|
125
|
-
// 'undefined' values reasonably. Default values should be provided when the
|
|
126
|
-
// component needs to make a choice or assumption when a prop is not supplied.
|
|
127
|
-
|
|
128
|
-
NoDataEmptyState.defaultProps = _EmptyState.EmptyStateDefaultProps;
|
|
124
|
+
};
|
|
@@ -46,7 +46,8 @@ var NoTagsEmptyState = /*#__PURE__*/_react.default.forwardRef(function (_ref, re
|
|
|
46
46
|
className = _ref.className,
|
|
47
47
|
illustrationTheme = _ref.illustrationTheme,
|
|
48
48
|
link = _ref.link,
|
|
49
|
-
size = _ref.size,
|
|
49
|
+
_ref$size = _ref.size,
|
|
50
|
+
size = _ref$size === void 0 ? _EmptyState.defaults.size : _ref$size,
|
|
50
51
|
subtitle = _ref.subtitle,
|
|
51
52
|
title = _ref.title,
|
|
52
53
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -120,9 +121,4 @@ NoTagsEmptyState.propTypes = {
|
|
|
120
121
|
* Empty state title
|
|
121
122
|
*/
|
|
122
123
|
title: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]).isRequired
|
|
123
|
-
};
|
|
124
|
-
// props that are required, nor for props where the component can apply
|
|
125
|
-
// 'undefined' values reasonably. Default values should be provided when the
|
|
126
|
-
// component needs to make a choice or assumption when a prop is not supplied.
|
|
127
|
-
|
|
128
|
-
NoTagsEmptyState.defaultProps = _EmptyState.EmptyStateDefaultProps;
|
|
124
|
+
};
|
|
@@ -46,7 +46,8 @@ var NotFoundEmptyState = /*#__PURE__*/_react.default.forwardRef(function (_ref,
|
|
|
46
46
|
className = _ref.className,
|
|
47
47
|
illustrationTheme = _ref.illustrationTheme,
|
|
48
48
|
link = _ref.link,
|
|
49
|
-
size = _ref.size,
|
|
49
|
+
_ref$size = _ref.size,
|
|
50
|
+
size = _ref$size === void 0 ? _EmptyState.defaults.size : _ref$size,
|
|
50
51
|
subtitle = _ref.subtitle,
|
|
51
52
|
title = _ref.title,
|
|
52
53
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -120,9 +121,4 @@ NotFoundEmptyState.propTypes = {
|
|
|
120
121
|
* Empty state title
|
|
121
122
|
*/
|
|
122
123
|
title: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]).isRequired
|
|
123
|
-
};
|
|
124
|
-
// props that are required, nor for props where the component can apply
|
|
125
|
-
// 'undefined' values reasonably. Default values should be provided when the
|
|
126
|
-
// component needs to make a choice or assumption when a prop is not supplied.
|
|
127
|
-
|
|
128
|
-
NotFoundEmptyState.defaultProps = _EmptyState.EmptyStateDefaultProps;
|
|
124
|
+
};
|
|
@@ -46,7 +46,8 @@ var NotificationsEmptyState = /*#__PURE__*/_react.default.forwardRef(function (_
|
|
|
46
46
|
className = _ref.className,
|
|
47
47
|
illustrationTheme = _ref.illustrationTheme,
|
|
48
48
|
link = _ref.link,
|
|
49
|
-
size = _ref.size,
|
|
49
|
+
_ref$size = _ref.size,
|
|
50
|
+
size = _ref$size === void 0 ? _EmptyState.defaults.size : _ref$size,
|
|
50
51
|
subtitle = _ref.subtitle,
|
|
51
52
|
title = _ref.title,
|
|
52
53
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -120,9 +121,4 @@ NotificationsEmptyState.propTypes = {
|
|
|
120
121
|
* Empty state title
|
|
121
122
|
*/
|
|
122
123
|
title: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]).isRequired
|
|
123
|
-
};
|
|
124
|
-
// props that are required, nor for props where the component can apply
|
|
125
|
-
// 'undefined' values reasonably. Default values should be provided when the
|
|
126
|
-
// component needs to make a choice or assumption when a prop is not supplied.
|
|
127
|
-
|
|
128
|
-
NotificationsEmptyState.defaultProps = _EmptyState.EmptyStateDefaultProps;
|
|
124
|
+
};
|
|
@@ -46,7 +46,8 @@ var UnauthorizedEmptyState = /*#__PURE__*/_react.default.forwardRef(function (_r
|
|
|
46
46
|
className = _ref.className,
|
|
47
47
|
illustrationTheme = _ref.illustrationTheme,
|
|
48
48
|
link = _ref.link,
|
|
49
|
-
size = _ref.size,
|
|
49
|
+
_ref$size = _ref.size,
|
|
50
|
+
size = _ref$size === void 0 ? _EmptyState.defaults.size : _ref$size,
|
|
50
51
|
subtitle = _ref.subtitle,
|
|
51
52
|
title = _ref.title,
|
|
52
53
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -120,9 +121,4 @@ UnauthorizedEmptyState.propTypes = {
|
|
|
120
121
|
* Empty state title
|
|
121
122
|
*/
|
|
122
123
|
title: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]).isRequired
|
|
123
|
-
};
|
|
124
|
-
// props that are required, nor for props where the component can apply
|
|
125
|
-
// 'undefined' values reasonably. Default values should be provided when the
|
|
126
|
-
// component needs to make a choice or assumption when a prop is not supplied.
|
|
127
|
-
|
|
128
|
-
UnauthorizedEmptyState.defaultProps = _EmptyState.EmptyStateDefaultProps;
|
|
124
|
+
};
|
|
@@ -32,7 +32,13 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
32
32
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
|
33
33
|
var blockClass = "".concat(_settings.pkg.prefix, "--example-component");
|
|
34
34
|
var componentName = 'ExampleComponent'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
|
|
35
|
+
// Default values for props
|
|
35
36
|
|
|
37
|
+
var defaults = {
|
|
38
|
+
primaryKind: 'primary',
|
|
39
|
+
secondaryKind: 'secondary',
|
|
40
|
+
size: 'default'
|
|
41
|
+
};
|
|
36
42
|
/**
|
|
37
43
|
* This is an example component to show relevant conventions and usage.
|
|
38
44
|
*/
|
|
@@ -45,10 +51,13 @@ var ExampleComponent = /*#__PURE__*/_react.default.forwardRef(function (_ref, re
|
|
|
45
51
|
onPrimaryClick = _ref.onPrimaryClick,
|
|
46
52
|
onSecondaryClick = _ref.onSecondaryClick,
|
|
47
53
|
primaryButtonLabel = _ref.primaryButtonLabel,
|
|
48
|
-
primaryKind = _ref.primaryKind,
|
|
54
|
+
_ref$primaryKind = _ref.primaryKind,
|
|
55
|
+
primaryKind = _ref$primaryKind === void 0 ? defaults.primaryKind : _ref$primaryKind,
|
|
49
56
|
secondaryButtonLabel = _ref.secondaryButtonLabel,
|
|
50
|
-
secondaryKind = _ref.secondaryKind,
|
|
51
|
-
|
|
57
|
+
_ref$secondaryKind = _ref.secondaryKind,
|
|
58
|
+
secondaryKind = _ref$secondaryKind === void 0 ? defaults.secondaryKind : _ref$secondaryKind,
|
|
59
|
+
_ref$size = _ref.size,
|
|
60
|
+
size = _ref$size === void 0 ? defaults.size : _ref$size,
|
|
52
61
|
style = _ref.style,
|
|
53
62
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
54
63
|
var modeClass = boxedBorder ? "".concat(blockClass, "--boxed-set") : "".concat(blockClass, "--shadow-set");
|
|
@@ -156,14 +165,4 @@ ExampleComponent.propTypes = {
|
|
|
156
165
|
* Optional style settings for the containing node.
|
|
157
166
|
*/
|
|
158
167
|
style: _propTypes.default.object
|
|
159
|
-
}; // Default values for component props. Default values are not required for
|
|
160
|
-
// props that are required, nor for props where the component can apply
|
|
161
|
-
// 'undefined' values reasonably. Default values should be provided when the
|
|
162
|
-
// component needs to make a choice or assumption when a prop is not supplied.
|
|
163
|
-
|
|
164
|
-
ExampleComponent.defaultProps = {
|
|
165
|
-
boxedBorder: false,
|
|
166
|
-
primaryKind: 'primary',
|
|
167
|
-
secondaryKind: 'secondary',
|
|
168
|
-
size: 'default'
|
|
169
168
|
};
|
|
@@ -43,7 +43,13 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
43
43
|
|
|
44
44
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
45
45
|
|
|
46
|
-
var componentName = 'ExportModal';
|
|
46
|
+
var componentName = 'ExportModal'; // Default values for props
|
|
47
|
+
|
|
48
|
+
var defaults = {
|
|
49
|
+
inputType: 'text',
|
|
50
|
+
preformattedExtensions: Object.freeze([]),
|
|
51
|
+
validExtensions: Object.freeze([])
|
|
52
|
+
};
|
|
47
53
|
var ExportModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
48
54
|
var _preformattedExtensio;
|
|
49
55
|
|
|
@@ -54,14 +60,16 @@ var ExportModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
54
60
|
filename = _ref.filename,
|
|
55
61
|
hidePasswordLabel = _ref.hidePasswordLabel,
|
|
56
62
|
inputLabel = _ref.inputLabel,
|
|
57
|
-
inputType = _ref.inputType,
|
|
63
|
+
_ref$inputType = _ref.inputType,
|
|
64
|
+
inputType = _ref$inputType === void 0 ? defaults.inputType : _ref$inputType,
|
|
58
65
|
invalidInputText = _ref.invalidInputText,
|
|
59
66
|
loading = _ref.loading,
|
|
60
67
|
loadingMessage = _ref.loadingMessage,
|
|
61
68
|
onClose = _ref.onClose,
|
|
62
69
|
onRequestSubmit = _ref.onRequestSubmit,
|
|
63
70
|
open = _ref.open,
|
|
64
|
-
|
|
71
|
+
_ref$preformattedExte = _ref.preformattedExtensions,
|
|
72
|
+
preformattedExtensions = _ref$preformattedExte === void 0 ? defaults.preformattedExtensions : _ref$preformattedExte,
|
|
65
73
|
preformattedExtensionsLabel = _ref.preformattedExtensionsLabel,
|
|
66
74
|
primaryButtonText = _ref.primaryButtonText,
|
|
67
75
|
secondaryButtonText = _ref.secondaryButtonText,
|
|
@@ -69,7 +77,8 @@ var ExportModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
69
77
|
successMessage = _ref.successMessage,
|
|
70
78
|
successful = _ref.successful,
|
|
71
79
|
title = _ref.title,
|
|
72
|
-
validExtensions = _ref.validExtensions,
|
|
80
|
+
_ref$validExtensions = _ref.validExtensions,
|
|
81
|
+
validExtensions = _ref$validExtensions === void 0 ? defaults.validExtensions : _ref$validExtensions,
|
|
73
82
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
74
83
|
|
|
75
84
|
var _useState = (0, _react.useState)(filename),
|
|
@@ -317,9 +326,4 @@ ExportModal.propTypes = {
|
|
|
317
326
|
*/
|
|
318
327
|
validExtensions: _propTypes.default.array
|
|
319
328
|
};
|
|
320
|
-
ExportModal.defaultProps = {
|
|
321
|
-
inputType: 'text',
|
|
322
|
-
preformattedExtensions: [],
|
|
323
|
-
validExtensions: []
|
|
324
|
-
};
|
|
325
329
|
ExportModal.displayName = componentName;
|
|
@@ -151,12 +151,4 @@ ExpressiveCard.propTypes = {
|
|
|
151
151
|
*/
|
|
152
152
|
title: _propTypes.default.string
|
|
153
153
|
};
|
|
154
|
-
ExpressiveCard.defaultProps = {
|
|
155
|
-
actionIcons: [],
|
|
156
|
-
actionIconsPosition: 'bottom',
|
|
157
|
-
mediaPosition: 'top',
|
|
158
|
-
overflowActions: [],
|
|
159
|
-
primaryButtonKind: 'primary',
|
|
160
|
-
secondaryButtonKind: 'secondary'
|
|
161
|
-
};
|
|
162
154
|
ExpressiveCard.displayName = componentName;
|
|
@@ -47,9 +47,14 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
47
47
|
|
|
48
48
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
49
49
|
|
|
50
|
-
var componentName = 'ImportModal';
|
|
50
|
+
var componentName = 'ImportModal'; // Default values for props
|
|
51
|
+
|
|
52
|
+
var defaults = {
|
|
53
|
+
accept: Object.freeze([])
|
|
54
|
+
};
|
|
51
55
|
var ImportModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
52
|
-
var accept = _ref.accept,
|
|
56
|
+
var _ref$accept = _ref.accept,
|
|
57
|
+
accept = _ref$accept === void 0 ? defaults.accept : _ref$accept,
|
|
53
58
|
className = _ref.className,
|
|
54
59
|
defaultErrorBody = _ref.defaultErrorBody,
|
|
55
60
|
defaultErrorHeader = _ref.defaultErrorHeader,
|
|
@@ -438,7 +443,4 @@ ImportModal.propTypes = {
|
|
|
438
443
|
*/
|
|
439
444
|
title: _propTypes.default.string.isRequired
|
|
440
445
|
};
|
|
441
|
-
ImportModal.defaultProps = {
|
|
442
|
-
accept: []
|
|
443
|
-
};
|
|
444
446
|
ImportModal.displayName = componentName;
|
|
@@ -31,7 +31,7 @@ var _carbonComponentsReact = require("carbon-components-react");
|
|
|
31
31
|
|
|
32
32
|
var _iconsReact = require("@carbon/icons-react");
|
|
33
33
|
|
|
34
|
-
var _excluded = ["cancelDescription", "className", "disabled", "
|
|
34
|
+
var _excluded = ["cancelDescription", "className", "disabled", "editAlwaysVisible", "editDescription", "id", "invalid", "invalidText", "labelText", "light", "onCancel", "onSave", "onChange", "placeholder", "saveDescription", "size", "value", "warn", "warnText"];
|
|
35
35
|
|
|
36
36
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
37
|
|
|
@@ -41,30 +41,36 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
41
41
|
var blockClass = "".concat(_settings.pkg.prefix, "--inline-edit");
|
|
42
42
|
var componentName = 'InlineEdit'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
|
|
43
43
|
|
|
44
|
+
var defaults = {
|
|
45
|
+
light: true,
|
|
46
|
+
// defaults to true to reflect design
|
|
47
|
+
size: 'md'
|
|
48
|
+
};
|
|
44
49
|
/**
|
|
45
50
|
* TODO: A description of the component.
|
|
46
51
|
*/
|
|
47
52
|
|
|
48
53
|
var InlineEdit = /*#__PURE__*/_react.default.forwardRef(function (_ref, refIn) {
|
|
49
|
-
var _cx, _cx3;
|
|
54
|
+
var _cx, _refInput$current, _refInput$current$inn, _cx3;
|
|
50
55
|
|
|
51
56
|
var cancelDescription = _ref.cancelDescription,
|
|
52
57
|
className = _ref.className,
|
|
53
58
|
disabled = _ref.disabled,
|
|
59
|
+
editAlwaysVisible = _ref.editAlwaysVisible,
|
|
54
60
|
editDescription = _ref.editDescription,
|
|
55
|
-
editVisibleOnHoverOnly = _ref.editVisibleOnHoverOnly,
|
|
56
61
|
id = _ref.id,
|
|
57
62
|
invalid = _ref.invalid,
|
|
58
63
|
invalidText = _ref.invalidText,
|
|
59
64
|
labelText = _ref.labelText,
|
|
60
|
-
light = _ref.light,
|
|
65
|
+
_ref$light = _ref.light,
|
|
66
|
+
light = _ref$light === void 0 ? defaults.light : _ref$light,
|
|
61
67
|
onCancel = _ref.onCancel,
|
|
62
68
|
onSave = _ref.onSave,
|
|
63
69
|
onChange = _ref.onChange,
|
|
64
70
|
placeholder = _ref.placeholder,
|
|
65
71
|
saveDescription = _ref.saveDescription,
|
|
66
|
-
|
|
67
|
-
size = _ref.size,
|
|
72
|
+
_ref$size = _ref.size,
|
|
73
|
+
size = _ref$size === void 0 ? defaults.size : _ref$size,
|
|
68
74
|
value = _ref.value,
|
|
69
75
|
warn = _ref.warn,
|
|
70
76
|
warnText = _ref.warnText,
|
|
@@ -83,9 +89,9 @@ var InlineEdit = /*#__PURE__*/_react.default.forwardRef(function (_ref, refIn) {
|
|
|
83
89
|
internalValue = _useState4[0],
|
|
84
90
|
setInternalValue = _useState4[1];
|
|
85
91
|
|
|
86
|
-
var
|
|
92
|
+
var showValidation = invalid || warn;
|
|
87
93
|
var validationText = invalidText || warnText;
|
|
88
|
-
var validationIcon =
|
|
94
|
+
var validationIcon = showValidation ? invalid ? /*#__PURE__*/_react.default.createElement(_iconsReact.WarningFilled16, null) : /*#__PURE__*/_react.default.createElement(_iconsReact.WarningAltFilled16, null) : null;
|
|
89
95
|
|
|
90
96
|
var doSetEditing = function doSetEditing(value) {
|
|
91
97
|
if (value === false) {
|
|
@@ -97,6 +103,7 @@ var InlineEdit = /*#__PURE__*/_react.default.forwardRef(function (_ref, refIn) {
|
|
|
97
103
|
};
|
|
98
104
|
|
|
99
105
|
var handleEdit = function handleEdit(ev) {
|
|
106
|
+
/* istanbul ignore else */
|
|
100
107
|
if (!disabled) {
|
|
101
108
|
var rightOfInput = ev.currentTarget.classList.contains("".concat(blockClass, "__edit")) || ev.target.classList.contains("".concat(blockClass, "__after-input-elements"));
|
|
102
109
|
var leftOfInput = ev.currentTarget = ev.target.classList.contains("".concat(blockClass)); // clicking on the content editable element should not set either of these to true
|
|
@@ -137,7 +144,18 @@ var InlineEdit = /*#__PURE__*/_react.default.forwardRef(function (_ref, refIn) {
|
|
|
137
144
|
}
|
|
138
145
|
};
|
|
139
146
|
|
|
140
|
-
var
|
|
147
|
+
var handleInput = function handleInput() {
|
|
148
|
+
setInternalValue(refInput.current.innerText);
|
|
149
|
+
|
|
150
|
+
if (onChange) {
|
|
151
|
+
onChange(refInput.current.innerText);
|
|
152
|
+
}
|
|
153
|
+
}; // pasting into contentEditable not supported by userEvent
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
var handlePaste =
|
|
157
|
+
/* istanbul ignore next */
|
|
158
|
+
function handlePaste(ev) {
|
|
141
159
|
ev.preventDefault(); // Get clipboard as plain text
|
|
142
160
|
|
|
143
161
|
var text = (ev.clipboardData || window.clipboardData).getData('text/plain'); // remove \n
|
|
@@ -164,14 +182,6 @@ var InlineEdit = /*#__PURE__*/_react.default.forwardRef(function (_ref, refIn) {
|
|
|
164
182
|
}
|
|
165
183
|
};
|
|
166
184
|
|
|
167
|
-
var handleInput = function handleInput() {
|
|
168
|
-
setInternalValue(refInput.current.innerText);
|
|
169
|
-
|
|
170
|
-
if (onChange) {
|
|
171
|
-
onChange(refInput.current.innerText);
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
|
|
175
185
|
var handleCancel = function handleCancel() {
|
|
176
186
|
refInput.current.innerText = value;
|
|
177
187
|
handleInput(value);
|
|
@@ -185,15 +195,21 @@ var InlineEdit = /*#__PURE__*/_react.default.forwardRef(function (_ref, refIn) {
|
|
|
185
195
|
|
|
186
196
|
var handleBlur = function handleBlur(ev) {
|
|
187
197
|
if (!ref.current.contains(ev.relatedTarget)) {
|
|
188
|
-
doSetEditing(false);
|
|
189
198
|
handleSave();
|
|
190
199
|
}
|
|
191
200
|
};
|
|
192
201
|
|
|
193
202
|
var handleKeyDown = function handleKeyDown(ev) {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
203
|
+
switch (ev.key) {
|
|
204
|
+
case 'Enter':
|
|
205
|
+
ev.preventDefault();
|
|
206
|
+
refInput.current.blur(); // will cause save
|
|
207
|
+
|
|
208
|
+
break;
|
|
209
|
+
|
|
210
|
+
case 'Escape':
|
|
211
|
+
handleCancel();
|
|
212
|
+
break;
|
|
197
213
|
}
|
|
198
214
|
};
|
|
199
215
|
/*
|
|
@@ -235,7 +251,7 @@ var InlineEdit = /*#__PURE__*/_react.default.forwardRef(function (_ref, refIn) {
|
|
|
235
251
|
}, /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, (0, _devtools.getDevtoolsProps)(componentName), {
|
|
236
252
|
id: id,
|
|
237
253
|
size: size,
|
|
238
|
-
className: (0, _classnames.default)("".concat(blockClass, "__input"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__input--empty"),
|
|
254
|
+
className: (0, _classnames.default)("".concat(blockClass, "__input"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__input--empty"), ((_refInput$current = refInput.current) === null || _refInput$current === void 0 ? void 0 : (_refInput$current$inn = _refInput$current.innerText) === null || _refInput$current$inn === void 0 ? void 0 : _refInput$current$inn.length) === 0)),
|
|
239
255
|
contentEditable: true,
|
|
240
256
|
"aria-label": labelText,
|
|
241
257
|
role: "textbox",
|
|
@@ -256,7 +272,7 @@ var InlineEdit = /*#__PURE__*/_react.default.forwardRef(function (_ref, refIn) {
|
|
|
256
272
|
"aria-hidden": !editing
|
|
257
273
|
}, "\u2026"), /*#__PURE__*/_react.default.createElement("div", {
|
|
258
274
|
className: (0, _classnames.default)("".concat(blockClass, "__toolbar"), (_cx3 = {}, (0, _defineProperty2.default)(_cx3, "".concat(blockClass, "__toolbar--animation"), toolbarAnimation), (0, _defineProperty2.default)(_cx3, "".concat(blockClass, "__toolbar--saveable"), refInput.current && value !== internalValue), _cx3))
|
|
259
|
-
},
|
|
275
|
+
}, showValidation && /*#__PURE__*/_react.default.createElement("div", {
|
|
260
276
|
className: "".concat(blockClass, "__validation-icon")
|
|
261
277
|
}, validationIcon), editing ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, {
|
|
262
278
|
className: "".concat(blockClass, "__cancel"),
|
|
@@ -272,10 +288,10 @@ var InlineEdit = /*#__PURE__*/_react.default.forwardRef(function (_ref, refIn) {
|
|
|
272
288
|
iconDescription: saveDescription,
|
|
273
289
|
onClick: handleSave,
|
|
274
290
|
renderIcon: _iconsReact.Checkmark16,
|
|
275
|
-
disabled:
|
|
291
|
+
disabled: value === internalValue
|
|
276
292
|
})) : /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, {
|
|
277
293
|
"aria-hidden": "true",
|
|
278
|
-
className: (0, _classnames.default)("".concat(blockClass, "__edit"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__edit--
|
|
294
|
+
className: (0, _classnames.default)("".concat(blockClass, "__edit"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__edit--always-visible"), editAlwaysVisible)),
|
|
279
295
|
kind: "ghost",
|
|
280
296
|
hasIconOnly: true,
|
|
281
297
|
iconDescription: editDescription,
|
|
@@ -285,7 +301,7 @@ var InlineEdit = /*#__PURE__*/_react.default.forwardRef(function (_ref, refIn) {
|
|
|
285
301
|
tabIndex: -1
|
|
286
302
|
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
287
303
|
className: (0, _classnames.default)("".concat(blockClass, "__disabled-cover"))
|
|
288
|
-
}),
|
|
304
|
+
}), showValidation && validationText && validationText.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
289
305
|
className: "".concat(blockClass, "__validation-text ").concat(_settings.carbon.prefix, "--form-requirement")
|
|
290
306
|
}, validationText))
|
|
291
307
|
);
|
|
@@ -317,15 +333,14 @@ InlineEdit.propTypes = {
|
|
|
317
333
|
disabled: _propTypes.default.bool,
|
|
318
334
|
|
|
319
335
|
/**
|
|
320
|
-
*
|
|
336
|
+
* By default the edit icon is shown on hover only.
|
|
321
337
|
*/
|
|
322
|
-
|
|
338
|
+
editAlwaysVisible: _propTypes.default.bool,
|
|
323
339
|
|
|
324
340
|
/**
|
|
325
|
-
*
|
|
326
|
-
* the edit icon is redundant. E.g. a spreadsheet a property panel.
|
|
341
|
+
* Label for the edit button
|
|
327
342
|
*/
|
|
328
|
-
|
|
343
|
+
editDescription: _propTypes.default.string.isRequired,
|
|
329
344
|
|
|
330
345
|
/**
|
|
331
346
|
* ID for inline edit
|
|
@@ -358,12 +373,16 @@ InlineEdit.propTypes = {
|
|
|
358
373
|
onCancel: _propTypes.default.func,
|
|
359
374
|
|
|
360
375
|
/**
|
|
361
|
-
* method called on input event (it's a React thing onChange behaves like on input)
|
|
376
|
+
* method called on input event (it's a React thing onChange behaves like on input).
|
|
377
|
+
*
|
|
378
|
+
* NOTE: caller to handle invalid/warn states and associated text
|
|
362
379
|
*/
|
|
363
380
|
onChange: _propTypes.default.func,
|
|
364
381
|
|
|
365
382
|
/**
|
|
366
383
|
* method called on change event
|
|
384
|
+
*
|
|
385
|
+
* NOTE: caller to handle invalid/warn states and associated text
|
|
367
386
|
*/
|
|
368
387
|
onSave: _propTypes.default.func,
|
|
369
388
|
|
|
@@ -377,11 +396,6 @@ InlineEdit.propTypes = {
|
|
|
377
396
|
*/
|
|
378
397
|
saveDescription: _propTypes.default.string.isRequired,
|
|
379
398
|
|
|
380
|
-
/**
|
|
381
|
-
* disabled state of the save button
|
|
382
|
-
*/
|
|
383
|
-
saveDisabled: _propTypes.default.bool,
|
|
384
|
-
|
|
385
399
|
/**
|
|
386
400
|
* vertical size of control
|
|
387
401
|
*/
|
|
@@ -401,13 +415,4 @@ InlineEdit.propTypes = {
|
|
|
401
415
|
* text shown when warn true
|
|
402
416
|
*/
|
|
403
417
|
warnText: _propTypes.default.string
|
|
404
|
-
}; // Default values for component props. Default values are not required for
|
|
405
|
-
// props that are required, nor for props where the component can apply
|
|
406
|
-
// 'undefined' values reasonably. Default values should be provided when the
|
|
407
|
-
// component needs to make a choice or assumption when a prop is not supplied.
|
|
408
|
-
|
|
409
|
-
InlineEdit.defaultProps = {
|
|
410
|
-
light: true,
|
|
411
|
-
// defaults to true to reflect design
|
|
412
|
-
size: 'md'
|
|
413
418
|
};
|
|
@@ -35,7 +35,13 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
35
35
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
|
36
36
|
var blockClass = "".concat(_settings.pkg.prefix, "--loading-bar");
|
|
37
37
|
var componentName = 'LoadingBar'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
|
|
38
|
+
// Default values for props
|
|
38
39
|
|
|
40
|
+
var defaults = {
|
|
41
|
+
active: true,
|
|
42
|
+
percentage: undefined,
|
|
43
|
+
ariaLabel: 'Active loading indicator'
|
|
44
|
+
};
|
|
39
45
|
/**
|
|
40
46
|
* The LoadingBar component provides a way to communicate the loading state to users.
|
|
41
47
|
* It is intended to fill the space of where it's used, and should persist until the
|
|
@@ -52,11 +58,14 @@ var componentName = 'LoadingBar'; // NOTE: the component SCSS is not imported he
|
|
|
52
58
|
var LoadingBar = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
53
59
|
var _cx2, _cx3;
|
|
54
60
|
|
|
55
|
-
var active = _ref.active,
|
|
56
|
-
|
|
61
|
+
var _ref$active = _ref.active,
|
|
62
|
+
active = _ref$active === void 0 ? defaults.active : _ref$active,
|
|
63
|
+
_ref$ariaLabel = _ref.ariaLabel,
|
|
64
|
+
ariaLabel = _ref$ariaLabel === void 0 ? defaults.ariaLabel : _ref$ariaLabel,
|
|
57
65
|
className = _ref.className,
|
|
58
66
|
id = _ref.id,
|
|
59
|
-
percentage = _ref.percentage,
|
|
67
|
+
_ref$percentage = _ref.percentage,
|
|
68
|
+
percentage = _ref$percentage === void 0 ? defaults.percentage : _ref$percentage,
|
|
60
69
|
percentageIndicatorText = _ref.percentageIndicatorText,
|
|
61
70
|
showPercentageIndicator = _ref.showPercentageIndicator,
|
|
62
71
|
small = _ref.small,
|
|
@@ -122,7 +131,7 @@ LoadingBar.propTypes = {
|
|
|
122
131
|
/**
|
|
123
132
|
* Specify whether you want the loading bar indicator to be active or not
|
|
124
133
|
*/
|
|
125
|
-
active: _propTypes.default.bool
|
|
134
|
+
active: _propTypes.default.bool,
|
|
126
135
|
|
|
127
136
|
/**
|
|
128
137
|
* Specify a ariaLabel that would be used to best describe the active loading state
|
|
@@ -158,17 +167,4 @@ LoadingBar.propTypes = {
|
|
|
158
167
|
* Specify whether you would like the small variant of this component
|
|
159
168
|
*/
|
|
160
169
|
small: _propTypes.default.bool
|
|
161
|
-
}; // Default values for component props. Default values are not required for
|
|
162
|
-
// props that are required, nor for props where the component can apply
|
|
163
|
-
// 'undefined' values reasonably. Default values should be provided when the
|
|
164
|
-
// component needs to make a choice or assumption when a prop is not supplied.
|
|
165
|
-
|
|
166
|
-
LoadingBar.defaultProps = {
|
|
167
|
-
/* add defaults for relevant props. */
|
|
168
|
-
active: true,
|
|
169
|
-
small: false,
|
|
170
|
-
percentage: undefined,
|
|
171
|
-
showPercentageIndicator: false,
|
|
172
|
-
percentageIndicatorText: undefined,
|
|
173
|
-
ariaLabel: 'Active loading indicator'
|
|
174
170
|
};
|