@carbon/ibm-products 1.41.0 → 1.41.2
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +21 -65
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +2 -2
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +1 -0
- 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 +21 -65
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +2 -2
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +21 -65
- package/css/index.css.map +1 -1
- package/css/index.min.css +2 -2
- package/css/index.min.css.map +1 -1
- package/es/components/APIKeyModal/APIKeyDownloader.js +21 -23
- package/es/components/APIKeyModal/APIKeyModal.js +43 -45
- package/es/components/AddSelect/AddSelectBody.js +1 -1
- package/es/components/AddSelect/hooks/usePath.js +7 -1
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +1 -1
- package/es/components/ButtonMenu/ButtonMenu.js +4 -2
- package/es/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +1 -1
- package/es/components/CreateFullPage/CreateFullPage.js +8 -2
- package/es/components/CreateTearsheet/CreateTearsheet.js +8 -2
- package/es/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +4 -2
- package/es/components/Datagrid/Datagrid/DatagridContent.js +10 -3
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +7 -9
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +11 -13
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +26 -24
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/{CustomizeColumnsModal.js → CustomizeColumnsTearsheet.js} +32 -32
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/TearsheetWrapper.js +51 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/index.js +6 -7
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +6 -4
- package/es/components/Datagrid/useCustomizeColumns.js +13 -15
- package/es/components/Datagrid/utils/getInlineEditColumns.js +1 -0
- package/es/components/Datagrid/utils/makeData.js +1 -1
- package/es/components/ImportModal/ImportModal.js +42 -44
- package/es/components/index.js +1 -1
- package/es/global/js/hooks/useCreateComponentFocus.js +31 -10
- package/es/global/js/hooks/useCreateComponentStepChange.js +73 -79
- package/es/global/js/utils/test-helper.js +12 -14
- package/es/global/js/utils/unwrap-if-fragment.js +1 -1
- package/lib/components/APIKeyModal/APIKeyDownloader.js +21 -23
- package/lib/components/APIKeyModal/APIKeyModal.js +43 -45
- package/lib/components/AddSelect/AddSelectBody.js +1 -1
- package/lib/components/AddSelect/hooks/usePath.js +6 -0
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +1 -1
- package/lib/components/ButtonMenu/ButtonMenu.js +4 -2
- package/lib/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +1 -1
- package/lib/components/CreateFullPage/CreateFullPage.js +8 -2
- package/lib/components/CreateTearsheet/CreateTearsheet.js +8 -2
- package/lib/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +4 -2
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +10 -3
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +7 -9
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +6 -6
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +26 -24
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/{CustomizeColumnsModal.js → CustomizeColumnsTearsheet.js} +26 -25
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/{ModalWrapper.js → TearsheetWrapper.js} +30 -33
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/index.js +3 -3
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +6 -4
- package/lib/components/Datagrid/useCustomizeColumns.js +7 -7
- package/lib/components/Datagrid/utils/getInlineEditColumns.js +1 -0
- package/lib/components/Datagrid/utils/makeData.js +1 -1
- package/lib/components/ImportModal/ImportModal.js +42 -44
- package/lib/components/index.js +6 -0
- package/lib/global/js/hooks/useCreateComponentFocus.js +32 -10
- package/lib/global/js/hooks/useCreateComponentStepChange.js +73 -79
- package/lib/global/js/utils/test-helper.js +12 -14
- package/lib/global/js/utils/unwrap-if-fragment.js +1 -1
- package/package.json +10 -10
- package/scss/components/Datagrid/styles/_datagrid.scss +5 -0
- package/scss/components/Datagrid/styles/_draggableElement.scss +9 -8
- package/scss/components/Datagrid/styles/_index.scss +8 -8
- package/scss/components/Datagrid/styles/addons/_CustomizeColumnsTearsheet.scss +60 -0
- package/scss/components/Tearsheet/_tearsheet.scss +2 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +0 -56
- package/scss/components/Datagrid/styles/addons/_CustomizeColumnsModal.scss +0 -86
@@ -10,49 +10,46 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
13
|
-
var
|
14
|
-
var _excluded = ["onSaveColumnPrefs", "
|
13
|
+
var _CustomizeColumnsTearsheet = _interopRequireDefault(require("./CustomizeColumnsTearsheet"));
|
14
|
+
var _excluded = ["onSaveColumnPrefs", "isTearsheetOpen", "setIsTearsheetOpen", "labels"];
|
15
15
|
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); }
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
17
|
-
var
|
17
|
+
var TearsheetWrapper = function TearsheetWrapper(_ref) {
|
18
18
|
var instance = _ref.instance;
|
19
19
|
var _instance$customizeCo = instance.customizeColumnsProps,
|
20
20
|
_onSaveColumnPrefs = _instance$customizeCo.onSaveColumnPrefs,
|
21
|
-
|
22
|
-
|
21
|
+
isTearsheetOpen = _instance$customizeCo.isTearsheetOpen,
|
22
|
+
setIsTearsheetOpen = _instance$customizeCo.setIsTearsheetOpen,
|
23
23
|
labels = _instance$customizeCo.labels,
|
24
24
|
rest = (0, _objectWithoutProperties2.default)(_instance$customizeCo, _excluded);
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
25
|
+
return /*#__PURE__*/React.createElement(_CustomizeColumnsTearsheet.default, (0, _extends2.default)({}, rest, labels, {
|
26
|
+
isOpen: isTearsheetOpen,
|
27
|
+
setIsTearsheetOpen: setIsTearsheetOpen,
|
28
|
+
columnDefinitions: instance.allColumns,
|
29
|
+
originalColumnDefinitions: instance.columns,
|
30
|
+
onSaveColumnPrefs: function onSaveColumnPrefs(updatedColDefs) {
|
31
|
+
var hiddenIds = updatedColDefs.filter(function (colDef) {
|
32
|
+
return !colDef.isVisible;
|
33
|
+
}).map(function (colDef) {
|
34
|
+
return colDef.id;
|
35
|
+
});
|
36
|
+
instance.setHiddenColumns(hiddenIds);
|
37
|
+
if (typeof instance.setColumnOrder === 'function') {
|
38
|
+
instance.setColumnOrder(updatedColDefs.map(function (colDef) {
|
35
39
|
return colDef.id;
|
36
|
-
});
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
return colDef.id;
|
41
|
-
}));
|
42
|
-
} else {
|
43
|
-
// eslint-disable-next-line no-console
|
44
|
-
console.warn("Column order can not be updated. Did you forget to add 'useColumnOrder' in 'useDatagrid'");
|
45
|
-
}
|
46
|
-
if (typeof _onSaveColumnPrefs === 'function') {
|
47
|
-
_onSaveColumnPrefs(updatedColDefs);
|
48
|
-
}
|
40
|
+
}));
|
41
|
+
} else {
|
42
|
+
// eslint-disable-next-line no-console
|
43
|
+
console.warn("Column order can not be updated. Did you forget to add 'useColumnOrder' in 'useDatagrid'");
|
49
44
|
}
|
50
|
-
|
51
|
-
|
52
|
-
|
45
|
+
if (typeof _onSaveColumnPrefs === 'function') {
|
46
|
+
_onSaveColumnPrefs(updatedColDefs);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}));
|
53
50
|
};
|
54
|
-
|
51
|
+
TearsheetWrapper.propTypes = {
|
55
52
|
instance: _propTypes.default.object.isRequired
|
56
53
|
};
|
57
|
-
var _default =
|
54
|
+
var _default = TearsheetWrapper;
|
58
55
|
exports.default = _default;
|
@@ -4,10 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
5
5
|
value: true
|
6
6
|
});
|
7
|
-
Object.defineProperty(exports, "
|
7
|
+
Object.defineProperty(exports, "CustomizeColumnsTearsheetWrapper", {
|
8
8
|
enumerable: true,
|
9
9
|
get: function get() {
|
10
|
-
return
|
10
|
+
return _TearsheetWrapper.default;
|
11
11
|
}
|
12
12
|
});
|
13
13
|
Object.defineProperty(exports, "ToggleButtonWrapper", {
|
@@ -16,5 +16,5 @@ Object.defineProperty(exports, "ToggleButtonWrapper", {
|
|
16
16
|
return _ButtonWrapper.default;
|
17
17
|
}
|
18
18
|
});
|
19
|
-
var
|
19
|
+
var _TearsheetWrapper = _interopRequireDefault(require("./TearsheetWrapper"));
|
20
20
|
var _ButtonWrapper = _interopRequireDefault(require("./ButtonWrapper"));
|
@@ -363,18 +363,20 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
363
363
|
return num.toString().padStart(2, '0');
|
364
364
|
};
|
365
365
|
var buildDate = function buildDate(value) {
|
366
|
+
var _config$inputProps2;
|
367
|
+
var dateFormat = config === null || config === void 0 ? void 0 : (_config$inputProps2 = config.inputProps) === null || _config$inputProps2 === void 0 ? void 0 : _config$inputProps2.dateFormat;
|
366
368
|
if (value instanceof Date) {
|
367
|
-
var _config$dateFormat = config.dateFormat,
|
368
|
-
dateFormat = _config$dateFormat === void 0 ? 'm/d/Y' : _config$dateFormat;
|
369
369
|
var maskedFullYear = value.getFullYear();
|
370
370
|
var maskedMonth = padTo2Digits(value.getMonth() + 1);
|
371
371
|
var maskedDay = padTo2Digits(value.getDate());
|
372
|
-
if (dateFormat === 'm/d/Y' ||
|
372
|
+
if (dateFormat === 'm/d/Y' || value === 'm/d/y') {
|
373
373
|
return [maskedMonth, maskedDay, maskedFullYear].join('/');
|
374
374
|
}
|
375
|
-
if (dateFormat === 'd/m/Y' || dateFormat === 'd/m/y') {
|
375
|
+
if (dateFormat === 'd/m/Y' || dateFormat === 'd/m/y' || dateFormat === undefined) {
|
376
376
|
return [maskedDay, maskedMonth, maskedFullYear].join('/');
|
377
377
|
}
|
378
|
+
} else {
|
379
|
+
return value;
|
378
380
|
}
|
379
381
|
return null;
|
380
382
|
};
|
@@ -18,25 +18,25 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
18
18
|
var useCustomizeColumns = function useCustomizeColumns(hooks) {
|
19
19
|
var _React$useState = React.useState(false),
|
20
20
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
21
|
-
|
22
|
-
|
21
|
+
isTearsheetOpen = _React$useState2[0],
|
22
|
+
setIsTearsheetOpen = _React$useState2[1];
|
23
23
|
hooks.useInstance.push(function (instance) {
|
24
24
|
var customizeColumnsProps = instance.customizeColumnsProps;
|
25
25
|
var _ref = customizeColumnsProps || {},
|
26
26
|
labels = _ref.labels;
|
27
27
|
Object.assign(instance, {
|
28
28
|
customizeColumnsProps: _objectSpread(_objectSpread({}, customizeColumnsProps), {}, {
|
29
|
-
|
30
|
-
|
29
|
+
isTearsheetOpen: isTearsheetOpen,
|
30
|
+
setIsTearsheetOpen: setIsTearsheetOpen
|
31
31
|
}),
|
32
32
|
CustomizeColumnsButton: function CustomizeColumnsButton(props) {
|
33
33
|
return /*#__PURE__*/React.createElement(_CustomizeColumns.ToggleButtonWrapper, (0, _extends2.default)({
|
34
34
|
iconTooltipLabel: labels === null || labels === void 0 ? void 0 : labels.iconTooltipLabel,
|
35
|
-
|
36
|
-
|
35
|
+
isTearsheetOpen: isTearsheetOpen,
|
36
|
+
setIsTearsheetOpen: setIsTearsheetOpen
|
37
37
|
}, props));
|
38
38
|
},
|
39
|
-
|
39
|
+
CustomizeColumnsTearsheet: _CustomizeColumns.CustomizeColumnsTearsheetWrapper
|
40
40
|
});
|
41
41
|
});
|
42
42
|
};
|
@@ -100,6 +100,7 @@ var getInlineEditColumns = function getInlineEditColumns() {
|
|
100
100
|
console.log(newDateObj, cell);
|
101
101
|
},
|
102
102
|
labelText: 'Change active since date',
|
103
|
+
dateFormat: 'd/m/Y',
|
103
104
|
// optionally pass props here to be passed through to Carbon's DatePickerInput component
|
104
105
|
datePickerInputProps: {
|
105
106
|
labelText: 'Change active since date'
|
@@ -168,7 +168,7 @@ var newPerson = function newPerson() {
|
|
168
168
|
numbers: 0
|
169
169
|
}),
|
170
170
|
chartType: initialChartTypeIndex === 0 ? _getInlineEditColumns.inlineEditSelectItems[0] : initialChartTypeIndex === 1 ? _getInlineEditColumns.inlineEditSelectItems[1] : _getInlineEditColumns.inlineEditSelectItems[2],
|
171
|
-
activeSince: activeChance > 0.66 ? activeSinceDate : activeChance > 0.33 ? yesterdayDate :
|
171
|
+
activeSince: activeChance > 0.66 ? activeSinceDate : activeChance > 0.33 ? yesterdayDate : '23/05/2020',
|
172
172
|
bonus: "$\r".concat(getRandomInteger(100, 500, 2)),
|
173
173
|
passwordStrength: getPasswordStrength(),
|
174
174
|
doc_link: renderDocLink()
|
@@ -114,51 +114,49 @@ var ImportModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
114
114
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(evt) {
|
115
115
|
var fileName, pendingFile, response, blob, fetchedFile, failedFile;
|
116
116
|
return _regenerator.default.wrap(function _callee$(_context) {
|
117
|
-
while (1) {
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
_context.next = 10;
|
135
|
-
break;
|
136
|
-
}
|
137
|
-
throw new Error(response.status);
|
138
|
-
case 10:
|
139
|
-
_context.next = 12;
|
140
|
-
return response.blob();
|
141
|
-
case 12:
|
142
|
-
blob = _context.sent;
|
143
|
-
fetchedFile = new File([blob], fileName, {
|
144
|
-
type: blob.type
|
145
|
-
});
|
146
|
-
fetchedFile.invalidFileType = isInvalidFileType(fetchedFile);
|
147
|
-
fetchedFile.uuid = pendingFile.uuid;
|
148
|
-
updateFiles([fetchedFile]);
|
149
|
-
_context.next = 23;
|
117
|
+
while (1) switch (_context.prev = _context.next) {
|
118
|
+
case 0:
|
119
|
+
evt.preventDefault();
|
120
|
+
fileName = importUrl.substring(importUrl.lastIndexOf('/') + 1).split('?')[0];
|
121
|
+
pendingFile = {
|
122
|
+
name: fileName,
|
123
|
+
status: 'uploading',
|
124
|
+
uuid: (0, _uuidv.default)()
|
125
|
+
};
|
126
|
+
setFiles([pendingFile]);
|
127
|
+
_context.prev = 4;
|
128
|
+
_context.next = 7;
|
129
|
+
return fetch(importUrl);
|
130
|
+
case 7:
|
131
|
+
response = _context.sent;
|
132
|
+
if (!(!response.ok || response.status !== 200)) {
|
133
|
+
_context.next = 10;
|
150
134
|
break;
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
135
|
+
}
|
136
|
+
throw new Error(response.status);
|
137
|
+
case 10:
|
138
|
+
_context.next = 12;
|
139
|
+
return response.blob();
|
140
|
+
case 12:
|
141
|
+
blob = _context.sent;
|
142
|
+
fetchedFile = new File([blob], fileName, {
|
143
|
+
type: blob.type
|
144
|
+
});
|
145
|
+
fetchedFile.invalidFileType = isInvalidFileType(fetchedFile);
|
146
|
+
fetchedFile.uuid = pendingFile.uuid;
|
147
|
+
updateFiles([fetchedFile]);
|
148
|
+
_context.next = 23;
|
149
|
+
break;
|
150
|
+
case 19:
|
151
|
+
_context.prev = 19;
|
152
|
+
_context.t0 = _context["catch"](4);
|
153
|
+
failedFile = _objectSpread(_objectSpread({}, pendingFile), {}, {
|
154
|
+
fetchError: true
|
155
|
+
});
|
156
|
+
updateFiles([failedFile]);
|
157
|
+
case 23:
|
158
|
+
case "end":
|
159
|
+
return _context.stop();
|
162
160
|
}
|
163
161
|
}, _callee, null, [[4, 19]]);
|
164
162
|
}));
|
package/lib/components/index.js
CHANGED
@@ -375,6 +375,12 @@ Object.defineProperty(exports, "useExpandedRow", {
|
|
375
375
|
return _Datagrid.useExpandedRow;
|
376
376
|
}
|
377
377
|
});
|
378
|
+
Object.defineProperty(exports, "useFiltering", {
|
379
|
+
enumerable: true,
|
380
|
+
get: function get() {
|
381
|
+
return _Datagrid.useFiltering;
|
382
|
+
}
|
383
|
+
});
|
378
384
|
Object.defineProperty(exports, "useInfiniteScroll", {
|
379
385
|
enumerable: true,
|
380
386
|
get: function get() {
|
@@ -1,11 +1,14 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
4
5
|
value: true
|
5
6
|
});
|
6
7
|
exports.useCreateComponentFocus = void 0;
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
9
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
7
10
|
var _react = require("react");
|
8
|
-
var
|
11
|
+
var _wait = _interopRequireDefault(require("../utils/wait"));
|
9
12
|
/**
|
10
13
|
* Copyright IBM Corp. 2021, 2021
|
11
14
|
*
|
@@ -18,23 +21,42 @@ var useCreateComponentFocus = function useCreateComponentFocus(_ref) {
|
|
18
21
|
var previousState = _ref.previousState,
|
19
22
|
currentStep = _ref.currentStep,
|
20
23
|
blockClass = _ref.blockClass,
|
21
|
-
onMount = _ref.onMount
|
24
|
+
onMount = _ref.onMount,
|
25
|
+
firstFocusElement = _ref.firstFocusElement;
|
22
26
|
(0, _react.useEffect)(function () {
|
23
27
|
if (typeof onMount === 'function') {
|
24
28
|
onMount();
|
25
29
|
}
|
26
30
|
}, [onMount]);
|
27
31
|
(0, _react.useEffect)(function () {
|
32
|
+
// because of how handleStackChange.claimFocus in TearsheetShell works a timeout is required to focus on specific elements
|
33
|
+
var awaitFocus = /*#__PURE__*/function () {
|
34
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(elm) {
|
35
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
36
|
+
while (1) switch (_context.prev = _context.next) {
|
37
|
+
case 0:
|
38
|
+
_context.next = 2;
|
39
|
+
return (0, _wait.default)(10);
|
40
|
+
case 2:
|
41
|
+
elm.focus();
|
42
|
+
case 3:
|
43
|
+
case "end":
|
44
|
+
return _context.stop();
|
45
|
+
}
|
46
|
+
}, _callee);
|
47
|
+
}));
|
48
|
+
return function awaitFocus(_x) {
|
49
|
+
return _ref2.apply(this, arguments);
|
50
|
+
};
|
51
|
+
}();
|
28
52
|
if ((previousState === null || previousState === void 0 ? void 0 : previousState.currentStep) !== currentStep && currentStep > 0) {
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
var nextButton = document.querySelector(".".concat(blockClass, "__create-button"));
|
35
|
-
nextButton === null || nextButton === void 0 ? void 0 : nextButton.focus();
|
53
|
+
if (firstFocusElement) {
|
54
|
+
var elm = document.querySelector(firstFocusElement);
|
55
|
+
if (elm) {
|
56
|
+
awaitFocus(elm);
|
57
|
+
}
|
36
58
|
}
|
37
59
|
}
|
38
|
-
}, [currentStep, previousState, blockClass, onMount]);
|
60
|
+
}, [currentStep, previousState, blockClass, onMount, firstFocusElement]);
|
39
61
|
};
|
40
62
|
exports.useCreateComponentFocus = useCreateComponentFocus;
|
@@ -50,25 +50,23 @@ var useCreateComponentStepChange = function useCreateComponentStepChange(_ref) {
|
|
50
50
|
var handleOnRequestSubmit = /*#__PURE__*/function () {
|
51
51
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
52
52
|
return _regenerator.default.wrap(function _callee$(_context) {
|
53
|
-
while (1) {
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
return _context.stop();
|
71
|
-
}
|
53
|
+
while (1) switch (_context.prev = _context.next) {
|
54
|
+
case 0:
|
55
|
+
_context.prev = 0;
|
56
|
+
_context.next = 3;
|
57
|
+
return onRequestSubmit();
|
58
|
+
case 3:
|
59
|
+
onUnmount();
|
60
|
+
_context.next = 10;
|
61
|
+
break;
|
62
|
+
case 6:
|
63
|
+
_context.prev = 6;
|
64
|
+
_context.t0 = _context["catch"](0);
|
65
|
+
setIsSubmitting(false);
|
66
|
+
console.warn("".concat(componentName, " submit error: ").concat(_context.t0));
|
67
|
+
case 10:
|
68
|
+
case "end":
|
69
|
+
return _context.stop();
|
72
70
|
}
|
73
71
|
}, _callee, null, [[0, 6]]);
|
74
72
|
}));
|
@@ -79,35 +77,33 @@ var useCreateComponentStepChange = function useCreateComponentStepChange(_ref) {
|
|
79
77
|
var handleNext = /*#__PURE__*/function () {
|
80
78
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
81
79
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
82
|
-
while (1) {
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
_context2.next = 14;
|
88
|
-
break;
|
89
|
-
}
|
90
|
-
_context2.prev = 2;
|
91
|
-
_context2.next = 5;
|
92
|
-
return onNext();
|
93
|
-
case 5:
|
94
|
-
continueToNextStep();
|
95
|
-
_context2.next = 12;
|
96
|
-
break;
|
97
|
-
case 8:
|
98
|
-
_context2.prev = 8;
|
99
|
-
_context2.t0 = _context2["catch"](2);
|
100
|
-
setIsSubmitting(false);
|
101
|
-
console.warn("".concat(componentName, " onNext error: ").concat(_context2.t0));
|
102
|
-
case 12:
|
103
|
-
_context2.next = 15;
|
80
|
+
while (1) switch (_context2.prev = _context2.next) {
|
81
|
+
case 0:
|
82
|
+
setIsSubmitting(true);
|
83
|
+
if (!(typeof onNext === 'function')) {
|
84
|
+
_context2.next = 14;
|
104
85
|
break;
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
86
|
+
}
|
87
|
+
_context2.prev = 2;
|
88
|
+
_context2.next = 5;
|
89
|
+
return onNext();
|
90
|
+
case 5:
|
91
|
+
continueToNextStep();
|
92
|
+
_context2.next = 12;
|
93
|
+
break;
|
94
|
+
case 8:
|
95
|
+
_context2.prev = 8;
|
96
|
+
_context2.t0 = _context2["catch"](2);
|
97
|
+
setIsSubmitting(false);
|
98
|
+
console.warn("".concat(componentName, " onNext error: ").concat(_context2.t0));
|
99
|
+
case 12:
|
100
|
+
_context2.next = 15;
|
101
|
+
break;
|
102
|
+
case 14:
|
103
|
+
continueToNextStep();
|
104
|
+
case 15:
|
105
|
+
case "end":
|
106
|
+
return _context2.stop();
|
111
107
|
}
|
112
108
|
}, _callee2, null, [[2, 8]]);
|
113
109
|
}));
|
@@ -118,39 +114,37 @@ var useCreateComponentStepChange = function useCreateComponentStepChange(_ref) {
|
|
118
114
|
var handleSubmit = /*#__PURE__*/function () {
|
119
115
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
120
116
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
121
|
-
while (1) {
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
_context3.next = 15;
|
128
|
-
break;
|
129
|
-
}
|
130
|
-
_context3.prev = 2;
|
131
|
-
_context3.next = 5;
|
132
|
-
return onNext();
|
133
|
-
case 5:
|
134
|
-
_context3.next = 7;
|
135
|
-
return handleOnRequestSubmit();
|
136
|
-
case 7:
|
137
|
-
_context3.next = 13;
|
138
|
-
break;
|
139
|
-
case 9:
|
140
|
-
_context3.prev = 9;
|
141
|
-
_context3.t0 = _context3["catch"](2);
|
142
|
-
setIsSubmitting(false);
|
143
|
-
console.warn("".concat(componentName, " onNext error: ").concat(_context3.t0));
|
144
|
-
case 13:
|
145
|
-
_context3.next = 17;
|
117
|
+
while (1) switch (_context3.prev = _context3.next) {
|
118
|
+
case 0:
|
119
|
+
setIsSubmitting(true);
|
120
|
+
// last step should have onNext as well
|
121
|
+
if (!(typeof onNext === 'function')) {
|
122
|
+
_context3.next = 15;
|
146
123
|
break;
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
124
|
+
}
|
125
|
+
_context3.prev = 2;
|
126
|
+
_context3.next = 5;
|
127
|
+
return onNext();
|
128
|
+
case 5:
|
129
|
+
_context3.next = 7;
|
130
|
+
return handleOnRequestSubmit();
|
131
|
+
case 7:
|
132
|
+
_context3.next = 13;
|
133
|
+
break;
|
134
|
+
case 9:
|
135
|
+
_context3.prev = 9;
|
136
|
+
_context3.t0 = _context3["catch"](2);
|
137
|
+
setIsSubmitting(false);
|
138
|
+
console.warn("".concat(componentName, " onNext error: ").concat(_context3.t0));
|
139
|
+
case 13:
|
140
|
+
_context3.next = 17;
|
141
|
+
break;
|
142
|
+
case 15:
|
143
|
+
_context3.next = 17;
|
144
|
+
return handleOnRequestSubmit();
|
145
|
+
case 17:
|
146
|
+
case "end":
|
147
|
+
return _context3.stop();
|
154
148
|
}
|
155
149
|
}, _callee3, null, [[2, 9]]);
|
156
150
|
}));
|
@@ -148,20 +148,18 @@ var expectWarnAsync = /*#__PURE__*/function () {
|
|
148
148
|
var _expect2;
|
149
149
|
var warn;
|
150
150
|
return _regenerator.default.wrap(function _callee$(_context) {
|
151
|
-
while (1) {
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
return _context.stop();
|
164
|
-
}
|
151
|
+
while (1) switch (_context.prev = _context.next) {
|
152
|
+
case 0:
|
153
|
+
warn = jest.spyOn(console, 'warn').mockImplementation(jest.fn());
|
154
|
+
_context.next = 3;
|
155
|
+
return test();
|
156
|
+
case 3:
|
157
|
+
expect(warn).toBeCalledTimes(1);
|
158
|
+
(_expect2 = expect(warn)).toHaveBeenCalledWith.apply(_expect2, (0, _toConsumableArray2.default)(makeMatcherArray(message)));
|
159
|
+
warn.mockRestore();
|
160
|
+
case 6:
|
161
|
+
case "end":
|
162
|
+
return _context.stop();
|
165
163
|
}
|
166
164
|
}, _callee);
|
167
165
|
}));
|
@@ -8,7 +8,7 @@ exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
9
9
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
10
10
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
11
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
12
12
|
/**
|
13
13
|
* unwrapIfFragment - walks the passed children unwrapping fragments
|
14
14
|
* to create a flat array of all children
|
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": "1.41.
|
4
|
+
"version": "1.41.2",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -51,27 +51,27 @@
|
|
51
51
|
"upgrade-dependencies": "npm-check-updates -u --dep dev,peer,prod --color --reject '/(carbon|^react$|^react-dom$|^chalk$|^react-dnd|^namor)/'"
|
52
52
|
},
|
53
53
|
"devDependencies": {
|
54
|
-
"@babel/cli": "^7.
|
55
|
-
"@babel/core": "^7.20.
|
56
|
-
"babel-preset-ibm-cloud-cognitive": "^0.14.
|
54
|
+
"@babel/cli": "^7.20.7",
|
55
|
+
"@babel/core": "^7.20.7",
|
56
|
+
"babel-preset-ibm-cloud-cognitive": "^0.14.25",
|
57
57
|
"chalk": "^4.1.2",
|
58
58
|
"change-case": "^4.1.2",
|
59
59
|
"copyfiles": "^2.4.1",
|
60
60
|
"cross-env": "^7.0.3",
|
61
|
-
"fs-extra": "^
|
61
|
+
"fs-extra": "^11.1.0",
|
62
62
|
"glob": "^8.0.3",
|
63
63
|
"jest": "^29.3.1",
|
64
|
-
"jest-config-ibm-cloud-cognitive": "^0.24.
|
64
|
+
"jest-config-ibm-cloud-cognitive": "^0.24.11",
|
65
65
|
"jest-environment-jsdom": "^29.3.1",
|
66
66
|
"namor": "^1.1.2",
|
67
|
-
"npm-check-updates": "^16.
|
67
|
+
"npm-check-updates": "^16.6.2",
|
68
68
|
"npm-run-all": "^4.1.5",
|
69
69
|
"rimraf": "^3.0.2",
|
70
|
-
"sass": "^1.
|
70
|
+
"sass": "^1.57.1",
|
71
71
|
"yargs": "^17.6.2"
|
72
72
|
},
|
73
73
|
"dependencies": {
|
74
|
-
"@babel/runtime": "^7.20.
|
74
|
+
"@babel/runtime": "^7.20.7",
|
75
75
|
"@carbon/telemetry": "^0.1.0",
|
76
76
|
"framer-motion": "^6.5.1",
|
77
77
|
"immutability-helper": "^3.1.1",
|
@@ -95,5 +95,5 @@
|
|
95
95
|
"react": "^16.8.6 || ^17.0.1",
|
96
96
|
"react-dom": "^16.8.6 || ^17.0.1"
|
97
97
|
},
|
98
|
-
"gitHead": "
|
98
|
+
"gitHead": "9617ce2463ce095784a946dc594610a2c9642295"
|
99
99
|
}
|
@@ -536,6 +536,11 @@
|
|
536
536
|
height: $spacing-09;
|
537
537
|
}
|
538
538
|
|
539
|
+
.#{$block-class}__customize-columns-checkbox-wrapper.#{$carbon-prefix}--form-item {
|
540
|
+
flex: 0 0 auto;
|
541
|
+
margin-right: $spacing-03;
|
542
|
+
}
|
543
|
+
|
539
544
|
.#{$block-class}__virtual-scrollbar::-webkit-scrollbar {
|
540
545
|
width: 10px;
|
541
546
|
height: 7px;
|