@carbon/ibm-products 1.41.0 → 1.41.1
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/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/useCustomizeColumns.js +13 -15
- 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/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/useCustomizeColumns.js +7 -7
- 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
@@ -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.1",
|
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": "4e127c6006183ae079ce089691fb1ee45d85bf1a"
|
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;
|
@@ -1,10 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
//
|
2
|
+
// Copyright IBM Corp. 2022, 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
8
|
@import './variables';
|
9
9
|
|
10
10
|
.#{$block-class}__draggable-handleStyle {
|
@@ -18,7 +18,7 @@
|
|
18
18
|
pointer-events: none;
|
19
19
|
}
|
20
20
|
|
21
|
-
|
21
|
+
.#{$block-class}__draggable-handleStyle.disabled svg {
|
22
22
|
fill: $disabled-02;
|
23
23
|
}
|
24
24
|
|
@@ -54,6 +54,7 @@ svg.#{$block-class}__draggable-handleStyle.disable {
|
|
54
54
|
.#{$block-class}__draggable-handleHolder-droppable {
|
55
55
|
display: flex;
|
56
56
|
width: 100%;
|
57
|
+
align-items: center;
|
57
58
|
}
|
58
59
|
|
59
60
|
.#{$block-class}__draggable-handleHolder-grabbed {
|
@@ -1,10 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
//
|
2
|
+
// Copyright IBM Corp. 2022, 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
8
|
@import './datagrid';
|
9
9
|
@import './useNestedRows';
|
10
10
|
@import './useNestedTable';
|
@@ -13,7 +13,7 @@
|
|
13
13
|
@import './useColumnCenterAlign';
|
14
14
|
@import './useStickyColumn';
|
15
15
|
@import './useActionsColumn';
|
16
|
-
@import './addons/
|
16
|
+
@import './addons/CustomizeColumnsTearsheet';
|
17
17
|
@import './addons/RowSizeDropdown';
|
18
18
|
@import './addons/FilterFlyout';
|
19
19
|
@import './useSelectAllToggle';
|
@@ -0,0 +1,60 @@
|
|
1
|
+
//
|
2
|
+
// Copyright IBM Corp. 2022, 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
|
+
@import '../variables';
|
9
|
+
|
10
|
+
.#{$block-class}__customize-columns-tearsheet {
|
11
|
+
.#{$pkg-prefix}--tearsheet__content {
|
12
|
+
display: flex;
|
13
|
+
flex-flow: column;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
.#{$block-class}__customize-columns-tearsheet--actions {
|
18
|
+
.#{$carbon-prefix}--search-input {
|
19
|
+
border-bottom: 1px solid $ui-03;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
.#{$block-class}__customize-columns-checkbox-wrapper {
|
24
|
+
display: flex;
|
25
|
+
justify-content: center;
|
26
|
+
padding-left: $spacing-03;
|
27
|
+
margin-bottom: 0;
|
28
|
+
}
|
29
|
+
|
30
|
+
.#{$block-class}__customize-columns-column-list {
|
31
|
+
position: relative; // needed for the react-dnd, otherwise the drag preview will not work correctly
|
32
|
+
overflow: auto;
|
33
|
+
}
|
34
|
+
|
35
|
+
.#{$block-class}__customize-columns-select-all {
|
36
|
+
position: sticky;
|
37
|
+
z-index: 1;
|
38
|
+
top: 0;
|
39
|
+
display: flex;
|
40
|
+
height: $spacing-09;
|
41
|
+
padding-left: $spacing-08;
|
42
|
+
border-bottom: 1px solid $layer-active;
|
43
|
+
background-color: $layer;
|
44
|
+
|
45
|
+
.#{$carbon-prefix}--checkbox-label-text {
|
46
|
+
@include carbon--font-weight($weight: semibold);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
.#{$block-class}__customize-columns-select-all:hover {
|
51
|
+
background-color: $layer-hover;
|
52
|
+
}
|
53
|
+
|
54
|
+
.#{$block-class}__customize-columns-select-all--selected {
|
55
|
+
background-color: $layer-selected;
|
56
|
+
}
|
57
|
+
|
58
|
+
.#{$block-class}__customize-columns-select-all--selected:hover {
|
59
|
+
background-color: $hover-selected-ui;
|
60
|
+
}
|
@@ -1,56 +0,0 @@
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
3
|
-
var _excluded = ["onSaveColumnPrefs", "isModalOpen", "setIsModalOpen", "labels"];
|
4
|
-
// @flow
|
5
|
-
/*
|
6
|
-
* Licensed Materials - Property of IBM
|
7
|
-
* 5724-Q36
|
8
|
-
* (c) Copyright IBM Corp. 2021
|
9
|
-
* US Government Users Restricted Rights - Use, duplication or disclosure
|
10
|
-
* restricted by GSA ADP Schedule Contract with IBM Corp.
|
11
|
-
*/
|
12
|
-
|
13
|
-
import * as React from 'react';
|
14
|
-
import PropTypes from 'prop-types';
|
15
|
-
import CustomizeColumnsModal from './CustomizeColumnsModal';
|
16
|
-
var ModalWrapper = function ModalWrapper(_ref) {
|
17
|
-
var instance = _ref.instance;
|
18
|
-
var _instance$customizeCo = instance.customizeColumnsProps,
|
19
|
-
_onSaveColumnPrefs = _instance$customizeCo.onSaveColumnPrefs,
|
20
|
-
isModalOpen = _instance$customizeCo.isModalOpen,
|
21
|
-
setIsModalOpen = _instance$customizeCo.setIsModalOpen,
|
22
|
-
labels = _instance$customizeCo.labels,
|
23
|
-
rest = _objectWithoutProperties(_instance$customizeCo, _excluded);
|
24
|
-
if (isModalOpen) {
|
25
|
-
return /*#__PURE__*/React.createElement(CustomizeColumnsModal, _extends({}, rest, labels, {
|
26
|
-
isOpen: isModalOpen,
|
27
|
-
setIsModalOpen: setIsModalOpen,
|
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) {
|
39
|
-
return colDef.id;
|
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'");
|
44
|
-
}
|
45
|
-
if (typeof _onSaveColumnPrefs === 'function') {
|
46
|
-
_onSaveColumnPrefs(updatedColDefs);
|
47
|
-
}
|
48
|
-
}
|
49
|
-
}));
|
50
|
-
}
|
51
|
-
return null;
|
52
|
-
};
|
53
|
-
ModalWrapper.propTypes = {
|
54
|
-
instance: PropTypes.object.isRequired
|
55
|
-
};
|
56
|
-
export default ModalWrapper;
|