@carbon/ibm-products 2.43.2-canary.63 → 2.43.2-canary.65
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/EditTearsheet/EditTearsheet.d.ts +2 -1
- package/es/components/EditTearsheet/EditTearsheet.js +44 -9
- package/es/components/SearchBar/SearchBar.d.ts +1 -1
- package/es/components/SearchBar/SearchBar.js +2 -2
- package/lib/components/EditTearsheet/EditTearsheet.d.ts +2 -1
- package/lib/components/EditTearsheet/EditTearsheet.js +43 -8
- package/lib/components/SearchBar/SearchBar.d.ts +1 -1
- package/lib/components/SearchBar/SearchBar.js +2 -2
- package/package.json +3 -3
@@ -51,7 +51,8 @@ interface EditTearsheetProps extends PropsWithChildren {
|
|
51
51
|
*/
|
52
52
|
onFormChange?: (formIndex: number) => number;
|
53
53
|
/**
|
54
|
-
* Specify a handler for submitting the tearsheet.
|
54
|
+
* Specify a handler for submitting the tearsheet. Throughout its execution
|
55
|
+
* the submit button will be disabled and include a loading indicator.
|
55
56
|
*/
|
56
57
|
onRequestSubmit: () => void;
|
57
58
|
/**
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
-
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
8
|
+
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2, asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import React__default, { forwardRef, useState, useRef, createContext } from 'react';
|
10
10
|
import PropTypes from '../../node_modules/prop-types/index.js';
|
11
11
|
import cx from 'classnames';
|
@@ -59,10 +59,45 @@ var EditTearsheet = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
59
59
|
_ref$sideNavAriaLabel = _ref.sideNavAriaLabel,
|
60
60
|
sideNavAriaLabel = _ref$sideNavAriaLabel === void 0 ? defaults.sideNavAriaLabel : _ref$sideNavAriaLabel,
|
61
61
|
rest = _objectWithoutProperties(_ref, _excluded);
|
62
|
+
var _useState = useState(false),
|
63
|
+
_useState2 = _slicedToArray(_useState, 2),
|
64
|
+
isSubmitting = _useState2[0],
|
65
|
+
setIsSubmitting = _useState2[1];
|
66
|
+
var handleOnRequestSubmit = /*#__PURE__*/function () {
|
67
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
68
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
69
|
+
while (1) switch (_context.prev = _context.next) {
|
70
|
+
case 0:
|
71
|
+
setIsSubmitting(true);
|
72
|
+
_context.prev = 1;
|
73
|
+
_context.next = 4;
|
74
|
+
return onRequestSubmit();
|
75
|
+
case 4:
|
76
|
+
_context.next = 9;
|
77
|
+
break;
|
78
|
+
case 6:
|
79
|
+
_context.prev = 6;
|
80
|
+
_context.t0 = _context["catch"](1);
|
81
|
+
console.warn("".concat(componentName, " submit error: ").concat(_context.t0));
|
82
|
+
case 9:
|
83
|
+
setIsSubmitting(false);
|
84
|
+
case 10:
|
85
|
+
case "end":
|
86
|
+
return _context.stop();
|
87
|
+
}
|
88
|
+
}, _callee, null, [[1, 6]]);
|
89
|
+
}));
|
90
|
+
return function handleOnRequestSubmit() {
|
91
|
+
return _ref2.apply(this, arguments);
|
92
|
+
};
|
93
|
+
}();
|
62
94
|
var actions = [{
|
63
95
|
key: 'edit-action-button-submit',
|
64
96
|
label: submitButtonText,
|
65
|
-
onClick:
|
97
|
+
onClick: function onClick() {
|
98
|
+
return handleOnRequestSubmit();
|
99
|
+
},
|
100
|
+
loading: isSubmitting,
|
66
101
|
kind: 'primary'
|
67
102
|
}, {
|
68
103
|
key: 'edit-action-button-cancel',
|
@@ -70,14 +105,14 @@ var EditTearsheet = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
70
105
|
onClick: onClose,
|
71
106
|
kind: 'ghost'
|
72
107
|
}];
|
73
|
-
var
|
74
|
-
_useState2 = _slicedToArray(_useState, 2),
|
75
|
-
currentForm = _useState2[0],
|
76
|
-
setCurrentForm = _useState2[1];
|
77
|
-
var _useState3 = useState([]),
|
108
|
+
var _useState3 = useState(0),
|
78
109
|
_useState4 = _slicedToArray(_useState3, 2),
|
79
|
-
|
80
|
-
|
110
|
+
currentForm = _useState4[0],
|
111
|
+
setCurrentForm = _useState4[1];
|
112
|
+
var _useState5 = useState([]),
|
113
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
114
|
+
formTitles = _useState6[0],
|
115
|
+
setFormTitles = _useState6[1];
|
81
116
|
var contentRef = useRef(null);
|
82
117
|
var handleCurrentForm = function handleCurrentForm(formIndex) {
|
83
118
|
setCurrentForm(formIndex);
|
@@ -17,7 +17,7 @@ interface SearchBarProps extends PropsWithChildren {
|
|
17
17
|
*/
|
18
18
|
hideScopesLabel?: boolean;
|
19
19
|
/** @type {string} The label text for the search text input. */
|
20
|
-
labelText
|
20
|
+
labelText: string;
|
21
21
|
/** @type {Function} Function handler for when the user changes their query search. */
|
22
22
|
onChange?: (event: any) => void;
|
23
23
|
/** @type {Function} Function handler for when the user submits a search. */
|
@@ -135,7 +135,7 @@ var SearchBar = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
135
135
|
})) : null, /*#__PURE__*/React__default.createElement(Search, {
|
136
136
|
className: "".concat(blockClass, "__input"),
|
137
137
|
closeButtonLabelText: clearButtonLabelText,
|
138
|
-
labelText: labelText
|
138
|
+
labelText: labelText,
|
139
139
|
name: "search-input",
|
140
140
|
onChange: handleInputChange,
|
141
141
|
placeholder: placeholderText,
|
@@ -188,7 +188,7 @@ SearchBar.propTypes = _objectSpread2({
|
|
188
188
|
*/
|
189
189
|
hideScopesLabel: PropTypes.bool,
|
190
190
|
/** @type {string} The label text for the search text input. */
|
191
|
-
labelText: PropTypes.string,
|
191
|
+
labelText: PropTypes.string.isRequired,
|
192
192
|
/** @type {Function} Function handler for when the user changes their query search. */
|
193
193
|
onChange: PropTypes.func,
|
194
194
|
/** @type {Function} Function handler for when the user submits a search. */
|
@@ -51,7 +51,8 @@ interface EditTearsheetProps extends PropsWithChildren {
|
|
51
51
|
*/
|
52
52
|
onFormChange?: (formIndex: number) => number;
|
53
53
|
/**
|
54
|
-
* Specify a handler for submitting the tearsheet.
|
54
|
+
* Specify a handler for submitting the tearsheet. Throughout its execution
|
55
|
+
* the submit button will be disabled and include a loading indicator.
|
55
56
|
*/
|
56
57
|
onRequestSubmit: () => void;
|
57
58
|
/**
|
@@ -68,10 +68,45 @@ exports.EditTearsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
68
68
|
_ref$sideNavAriaLabel = _ref.sideNavAriaLabel,
|
69
69
|
sideNavAriaLabel = _ref$sideNavAriaLabel === void 0 ? defaults.sideNavAriaLabel : _ref$sideNavAriaLabel,
|
70
70
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
71
|
+
var _useState = React.useState(false),
|
72
|
+
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
73
|
+
isSubmitting = _useState2[0],
|
74
|
+
setIsSubmitting = _useState2[1];
|
75
|
+
var handleOnRequestSubmit = /*#__PURE__*/function () {
|
76
|
+
var _ref2 = _rollupPluginBabelHelpers.asyncToGenerator( /*#__PURE__*/_rollupPluginBabelHelpers.regeneratorRuntime().mark(function _callee() {
|
77
|
+
return _rollupPluginBabelHelpers.regeneratorRuntime().wrap(function _callee$(_context) {
|
78
|
+
while (1) switch (_context.prev = _context.next) {
|
79
|
+
case 0:
|
80
|
+
setIsSubmitting(true);
|
81
|
+
_context.prev = 1;
|
82
|
+
_context.next = 4;
|
83
|
+
return onRequestSubmit();
|
84
|
+
case 4:
|
85
|
+
_context.next = 9;
|
86
|
+
break;
|
87
|
+
case 6:
|
88
|
+
_context.prev = 6;
|
89
|
+
_context.t0 = _context["catch"](1);
|
90
|
+
console.warn("".concat(componentName, " submit error: ").concat(_context.t0));
|
91
|
+
case 9:
|
92
|
+
setIsSubmitting(false);
|
93
|
+
case 10:
|
94
|
+
case "end":
|
95
|
+
return _context.stop();
|
96
|
+
}
|
97
|
+
}, _callee, null, [[1, 6]]);
|
98
|
+
}));
|
99
|
+
return function handleOnRequestSubmit() {
|
100
|
+
return _ref2.apply(this, arguments);
|
101
|
+
};
|
102
|
+
}();
|
71
103
|
var actions = [{
|
72
104
|
key: 'edit-action-button-submit',
|
73
105
|
label: submitButtonText,
|
74
|
-
onClick:
|
106
|
+
onClick: function onClick() {
|
107
|
+
return handleOnRequestSubmit();
|
108
|
+
},
|
109
|
+
loading: isSubmitting,
|
75
110
|
kind: 'primary'
|
76
111
|
}, {
|
77
112
|
key: 'edit-action-button-cancel',
|
@@ -79,14 +114,14 @@ exports.EditTearsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
79
114
|
onClick: onClose,
|
80
115
|
kind: 'ghost'
|
81
116
|
}];
|
82
|
-
var
|
83
|
-
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
84
|
-
currentForm = _useState2[0],
|
85
|
-
setCurrentForm = _useState2[1];
|
86
|
-
var _useState3 = React.useState([]),
|
117
|
+
var _useState3 = React.useState(0),
|
87
118
|
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
88
|
-
|
89
|
-
|
119
|
+
currentForm = _useState4[0],
|
120
|
+
setCurrentForm = _useState4[1];
|
121
|
+
var _useState5 = React.useState([]),
|
122
|
+
_useState6 = _rollupPluginBabelHelpers.slicedToArray(_useState5, 2),
|
123
|
+
formTitles = _useState6[0],
|
124
|
+
setFormTitles = _useState6[1];
|
90
125
|
var contentRef = React.useRef(null);
|
91
126
|
var handleCurrentForm = function handleCurrentForm(formIndex) {
|
92
127
|
setCurrentForm(formIndex);
|
@@ -17,7 +17,7 @@ interface SearchBarProps extends PropsWithChildren {
|
|
17
17
|
*/
|
18
18
|
hideScopesLabel?: boolean;
|
19
19
|
/** @type {string} The label text for the search text input. */
|
20
|
-
labelText
|
20
|
+
labelText: string;
|
21
21
|
/** @type {Function} Function handler for when the user changes their query search. */
|
22
22
|
onChange?: (event: any) => void;
|
23
23
|
/** @type {Function} Function handler for when the user submits a search. */
|
@@ -144,7 +144,7 @@ exports.SearchBar = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
144
144
|
})) : null, /*#__PURE__*/React__default["default"].createElement(react.Search, {
|
145
145
|
className: "".concat(blockClass, "__input"),
|
146
146
|
closeButtonLabelText: clearButtonLabelText,
|
147
|
-
labelText: labelText
|
147
|
+
labelText: labelText,
|
148
148
|
name: "search-input",
|
149
149
|
onChange: handleInputChange,
|
150
150
|
placeholder: placeholderText,
|
@@ -197,7 +197,7 @@ exports.SearchBar.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
197
197
|
*/
|
198
198
|
hideScopesLabel: index["default"].bool,
|
199
199
|
/** @type {string} The label text for the search text input. */
|
200
|
-
labelText: index["default"].string,
|
200
|
+
labelText: index["default"].string.isRequired,
|
201
201
|
/** @type {Function} Function handler for when the user changes their query search. */
|
202
202
|
onChange: index["default"].func,
|
203
203
|
/** @type {Function} Function handler for when the user submits a search. */
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@carbon/ibm-products",
|
3
3
|
"description": "Carbon for IBM Products",
|
4
|
-
"version": "2.43.2-canary.
|
4
|
+
"version": "2.43.2-canary.65+6850586b7",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -96,7 +96,7 @@
|
|
96
96
|
"dependencies": {
|
97
97
|
"@babel/runtime": "^7.23.9",
|
98
98
|
"@carbon/feature-flags": "^0.20.0",
|
99
|
-
"@carbon/ibm-products-styles": "^2.
|
99
|
+
"@carbon/ibm-products-styles": "^2.40.0-rc.2",
|
100
100
|
"@carbon/telemetry": "^0.1.0",
|
101
101
|
"@dnd-kit/core": "^6.0.8",
|
102
102
|
"@dnd-kit/modifiers": "^7.0.0",
|
@@ -120,5 +120,5 @@
|
|
120
120
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0",
|
121
121
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
|
122
122
|
},
|
123
|
-
"gitHead": "
|
123
|
+
"gitHead": "6850586b76bb36f66bdc2fd82b2256f9d089a337"
|
124
124
|
}
|