carbon-addons-iot-react 2.147.0-next.49 → 2.147.0-next.52
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/CHANGELOG.md +38 -0
- package/es/components/ComboBox/ComboBox.js +3 -5
- package/es/components/List/HierarchyList/HierarchyList.js +2 -0
- package/es/components/Table/TableHead/FilterHeaderRow/FilterHeaderRow.js +36 -0
- package/es/index.js +1 -0
- package/lib/components/ComboBox/ComboBox.js +3 -5
- package/lib/components/List/HierarchyList/HierarchyList.js +2 -0
- package/lib/components/Table/TableHead/FilterHeaderRow/FilterHeaderRow.js +36 -0
- package/lib/index.js +2 -0
- package/lib/scss/components/Card/_card.scss +1 -0
- package/package.json +2 -2
- package/scss/components/Card/_card.scss +1 -0
- package/umd/carbon-addons-iot-react.js +10977 -10940
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,44 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.147.0-next.52](https://github.com/carbon-design-system/carbon-addons-iot-react/compare/v2.147.0-next.51...v2.147.0-next.52) (2021-11-09)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **page-title-bar:** fix compilation error in scss file ([e119bfc](https://github.com/carbon-design-system/carbon-addons-iot-react/commit/e119bfc86349e002af275719042f3e47f4e50d9b))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [2.147.0-next.51](https://github.com/carbon-design-system/carbon-addons-iot-react/compare/v2.147.0-next.50...v2.147.0-next.51) (2021-11-09)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **card-code-editor:** export from package ([80b050e](https://github.com/carbon-design-system/carbon-addons-iot-react/commit/80b050e4416de20dd90bff71030a0710ed255d7b))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# [2.147.0-next.50](https://github.com/carbon-design-system/carbon-addons-iot-react/compare/v2.147.0-next.49...v2.147.0-next.50) (2021-11-09)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* **hierarchy-list:** reset pageination and search when data changes ([6a71e46](https://github.com/carbon-design-system/carbon-addons-iot-react/commit/6a71e46777da03466ee53c8d1007667a6d4c6b33))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Features
|
|
37
|
+
|
|
38
|
+
* **table:** focus on first filterable column when filter row opened ([8251487](https://github.com/carbon-design-system/carbon-addons-iot-react/commit/8251487a9a3eb2e3cf9289eb4d9b63c3be8f0b6f))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
6
44
|
# [2.147.0-next.49](https://github.com/carbon-design-system/carbon-addons-iot-react/compare/v2.147.0-next.48...v2.147.0-next.49) (2021-11-09)
|
|
7
45
|
|
|
8
46
|
|
|
@@ -73,7 +73,7 @@ var defaultProps = _objectSpread(_objectSpread({}, ComboBox$1.defaultProps), {},
|
|
|
73
73
|
horizontalDirection: 'end'
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
var ComboBox = function
|
|
76
|
+
var ComboBox = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
77
77
|
var _classnames;
|
|
78
78
|
|
|
79
79
|
var loading = _ref.loading,
|
|
@@ -99,7 +99,7 @@ var ComboBox = function ComboBox(_ref) {
|
|
|
99
99
|
rest = _objectWithoutProperties(_ref, ["loading", "wrapperClassName", "closeButtonText", "editOptionText", "hasMultiValue", "onChange", "items", "className", "disabled", "id", "itemToString", "size", "onInputChange", "addToList", "helperText", "shouldFilterItem", "onBlur", "testId", "menuFitContent", "horizontalDirection"]);
|
|
100
100
|
|
|
101
101
|
// Ref for the combobox input
|
|
102
|
-
var comboRef = /*#__PURE__*/React__default.createRef(); // Input value that is added to list
|
|
102
|
+
var comboRef = ref || /*#__PURE__*/React__default.createRef(); // Input value that is added to list
|
|
103
103
|
|
|
104
104
|
var _useState = useState(''),
|
|
105
105
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -289,14 +289,12 @@ var ComboBox = function ComboBox(_ref) {
|
|
|
289
289
|
}, itemToString(item)));
|
|
290
290
|
})) : null)
|
|
291
291
|
);
|
|
292
|
-
};
|
|
293
|
-
|
|
292
|
+
});
|
|
294
293
|
ComboBox.propTypes = propTypes;
|
|
295
294
|
ComboBox.defaultProps = defaultProps;
|
|
296
295
|
ComboBox.__docgenInfo = {
|
|
297
296
|
"description": "",
|
|
298
297
|
"methods": [],
|
|
299
|
-
"displayName": "ComboBox",
|
|
300
298
|
"props": {
|
|
301
299
|
"loading": {
|
|
302
300
|
"defaultValue": {
|
|
@@ -331,6 +331,8 @@ var HierarchyList = function HierarchyList(_ref2) {
|
|
|
331
331
|
useEffect(function () {
|
|
332
332
|
if (!isEqual(items, previousItems)) {
|
|
333
333
|
setFilteredItems(items);
|
|
334
|
+
setSearchValue('');
|
|
335
|
+
setCurrentPageNumber(1);
|
|
334
336
|
}
|
|
335
337
|
}, [items, previousItems]);
|
|
336
338
|
var selectedItemRef = useCallback(function (node) {
|
|
@@ -88,6 +88,22 @@ var FilterHeaderRow = /*#__PURE__*/function (_Component) {
|
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
+
_defineProperty(_assertThisInitialized(_this), "setFirstFilterableRef", function (node) {
|
|
92
|
+
if (!_this.firstFilterableRef.current && node) {
|
|
93
|
+
_this.firstFilterableRef.current = node;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
_defineProperty(_assertThisInitialized(_this), "updateFocus", function () {
|
|
98
|
+
if (_this.firstFilterableRef.current) {
|
|
99
|
+
if (typeof _this.firstFilterableRef.current.focus === 'function') {
|
|
100
|
+
_this.firstFilterableRef.current.focus();
|
|
101
|
+
} else if (typeof _this.firstFilterableRef.current.textInput.current.focus === 'function') {
|
|
102
|
+
_this.firstFilterableRef.current.textInput.current.focus();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
|
|
91
107
|
_defineProperty(_assertThisInitialized(_this), "handleApplyFilter", function () {
|
|
92
108
|
var onApplyFilter = _this.props.onApplyFilter;
|
|
93
109
|
var filterValues = _this.state.filterValues;
|
|
@@ -127,6 +143,7 @@ var FilterHeaderRow = /*#__PURE__*/function (_Component) {
|
|
|
127
143
|
});
|
|
128
144
|
|
|
129
145
|
_this.rowRef = /*#__PURE__*/React__default.createRef();
|
|
146
|
+
_this.firstFilterableRef = /*#__PURE__*/React__default.createRef();
|
|
130
147
|
return _this;
|
|
131
148
|
}
|
|
132
149
|
|
|
@@ -134,6 +151,7 @@ var FilterHeaderRow = /*#__PURE__*/function (_Component) {
|
|
|
134
151
|
key: "componentDidMount",
|
|
135
152
|
value: function componentDidMount() {
|
|
136
153
|
this.updateDropdownHeight();
|
|
154
|
+
this.updateFocus();
|
|
137
155
|
}
|
|
138
156
|
}, {
|
|
139
157
|
key: "componentDidUpdate",
|
|
@@ -202,6 +220,7 @@ var FilterHeaderRow = /*#__PURE__*/function (_Component) {
|
|
|
202
220
|
// if unspecified
|
|
203
221
|
|
|
204
222
|
var headerContent = column.isFilterable !== undefined && !column.isFilterable ? /*#__PURE__*/React__default.createElement("div", null) : column.options ? column.isMultiselect ? /*#__PURE__*/React__default.createElement(MultiSelect.Filterable, {
|
|
223
|
+
ref: _this2.setFirstFilterableRef,
|
|
205
224
|
key: columnStateValue,
|
|
206
225
|
className: classnames("".concat(iotPrefix, "--filterheader-multiselect"), "".concat(iotPrefix, "--filterheader-multiselect__menu--fit-content"), _defineProperty({}, "".concat(iotPrefix, "--filterheader-multiselect__menu--flip-horizontal"), isLastColumn)),
|
|
207
226
|
id: "column-".concat(i),
|
|
@@ -234,6 +253,7 @@ var FilterHeaderRow = /*#__PURE__*/function (_Component) {
|
|
|
234
253
|
light: true,
|
|
235
254
|
disabled: isDisabled
|
|
236
255
|
}) : /*#__PURE__*/React__default.createElement(ComboBox, {
|
|
256
|
+
ref: _this2.setFirstFilterableRef,
|
|
237
257
|
menuFitContent: true,
|
|
238
258
|
horizontalDirection: isLastColumn ? 'start' : 'end',
|
|
239
259
|
key: columnStateValue,
|
|
@@ -267,6 +287,7 @@ var FilterHeaderRow = /*#__PURE__*/function (_Component) {
|
|
|
267
287
|
}) : /*#__PURE__*/React__default.createElement(FormItem, {
|
|
268
288
|
className: "".concat(iotPrefix, "--filter-header-row--form-item")
|
|
269
289
|
}, /*#__PURE__*/React__default.createElement(TextInput, {
|
|
290
|
+
ref: _this2.setFirstFilterableRef,
|
|
270
291
|
id: column.id,
|
|
271
292
|
labelText: column.id,
|
|
272
293
|
hideLabel: true,
|
|
@@ -459,6 +480,21 @@ FilterHeaderRow.__docgenInfo = {
|
|
|
459
480
|
"modifiers": [],
|
|
460
481
|
"params": [],
|
|
461
482
|
"returns": null
|
|
483
|
+
}, {
|
|
484
|
+
"name": "setFirstFilterableRef",
|
|
485
|
+
"docblock": null,
|
|
486
|
+
"modifiers": [],
|
|
487
|
+
"params": [{
|
|
488
|
+
"name": "node",
|
|
489
|
+
"type": null
|
|
490
|
+
}],
|
|
491
|
+
"returns": null
|
|
492
|
+
}, {
|
|
493
|
+
"name": "updateFocus",
|
|
494
|
+
"docblock": null,
|
|
495
|
+
"modifiers": [],
|
|
496
|
+
"params": [],
|
|
497
|
+
"returns": null
|
|
462
498
|
}, {
|
|
463
499
|
"name": "handleApplyFilter",
|
|
464
500
|
"docblock": "take the state with the filter values and send to our listener",
|
package/es/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import withSize from 'react-sizeme';
|
|
2
2
|
export { settings } from './constants/Settings.js';
|
|
3
3
|
export { default as Button } from './components/Button/Button.js';
|
|
4
|
+
export { default as CardCodeEditor } from './components/CardCodeEditor/CardCodeEditor.js';
|
|
4
5
|
export { default as EmptyTable } from './components/Table/EmptyTable/EmptyTable.js';
|
|
5
6
|
export { default as TableHead } from './components/Table/TableHead/TableHead.js';
|
|
6
7
|
export { default as TableBody } from './components/Table/TableBody/TableBody.js';
|
|
@@ -87,7 +87,7 @@ var defaultProps = _objectSpread(_objectSpread({}, carbonComponentsReact.ComboBo
|
|
|
87
87
|
horizontalDirection: 'end'
|
|
88
88
|
});
|
|
89
89
|
|
|
90
|
-
var ComboBox = function
|
|
90
|
+
var ComboBox = /*#__PURE__*/React__default['default'].forwardRef(function (_ref, ref) {
|
|
91
91
|
var _classnames;
|
|
92
92
|
|
|
93
93
|
var loading = _ref.loading,
|
|
@@ -113,7 +113,7 @@ var ComboBox = function ComboBox(_ref) {
|
|
|
113
113
|
rest = _objectWithoutProperties__default['default'](_ref, ["loading", "wrapperClassName", "closeButtonText", "editOptionText", "hasMultiValue", "onChange", "items", "className", "disabled", "id", "itemToString", "size", "onInputChange", "addToList", "helperText", "shouldFilterItem", "onBlur", "testId", "menuFitContent", "horizontalDirection"]);
|
|
114
114
|
|
|
115
115
|
// Ref for the combobox input
|
|
116
|
-
var comboRef = /*#__PURE__*/React__default['default'].createRef(); // Input value that is added to list
|
|
116
|
+
var comboRef = ref || /*#__PURE__*/React__default['default'].createRef(); // Input value that is added to list
|
|
117
117
|
|
|
118
118
|
var _useState = React.useState(''),
|
|
119
119
|
_useState2 = _slicedToArray__default['default'](_useState, 2),
|
|
@@ -303,14 +303,12 @@ var ComboBox = function ComboBox(_ref) {
|
|
|
303
303
|
}, itemToString(item)));
|
|
304
304
|
})) : null)
|
|
305
305
|
);
|
|
306
|
-
};
|
|
307
|
-
|
|
306
|
+
});
|
|
308
307
|
ComboBox.propTypes = propTypes;
|
|
309
308
|
ComboBox.defaultProps = defaultProps;
|
|
310
309
|
ComboBox.__docgenInfo = {
|
|
311
310
|
"description": "",
|
|
312
311
|
"methods": [],
|
|
313
|
-
"displayName": "ComboBox",
|
|
314
312
|
"props": {
|
|
315
313
|
"loading": {
|
|
316
314
|
"defaultValue": {
|
|
@@ -347,6 +347,8 @@ var HierarchyList = function HierarchyList(_ref2) {
|
|
|
347
347
|
React.useEffect(function () {
|
|
348
348
|
if (!isEqual__default['default'](items, previousItems)) {
|
|
349
349
|
setFilteredItems(items);
|
|
350
|
+
setSearchValue('');
|
|
351
|
+
setCurrentPageNumber(1);
|
|
350
352
|
}
|
|
351
353
|
}, [items, previousItems]);
|
|
352
354
|
var selectedItemRef = React.useCallback(function (node) {
|
|
@@ -108,6 +108,22 @@ var FilterHeaderRow = /*#__PURE__*/function (_Component) {
|
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
|
|
111
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "setFirstFilterableRef", function (node) {
|
|
112
|
+
if (!_this.firstFilterableRef.current && node) {
|
|
113
|
+
_this.firstFilterableRef.current = node;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "updateFocus", function () {
|
|
118
|
+
if (_this.firstFilterableRef.current) {
|
|
119
|
+
if (typeof _this.firstFilterableRef.current.focus === 'function') {
|
|
120
|
+
_this.firstFilterableRef.current.focus();
|
|
121
|
+
} else if (typeof _this.firstFilterableRef.current.textInput.current.focus === 'function') {
|
|
122
|
+
_this.firstFilterableRef.current.textInput.current.focus();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
111
127
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "handleApplyFilter", function () {
|
|
112
128
|
var onApplyFilter = _this.props.onApplyFilter;
|
|
113
129
|
var filterValues = _this.state.filterValues;
|
|
@@ -147,6 +163,7 @@ var FilterHeaderRow = /*#__PURE__*/function (_Component) {
|
|
|
147
163
|
});
|
|
148
164
|
|
|
149
165
|
_this.rowRef = /*#__PURE__*/React__default['default'].createRef();
|
|
166
|
+
_this.firstFilterableRef = /*#__PURE__*/React__default['default'].createRef();
|
|
150
167
|
return _this;
|
|
151
168
|
}
|
|
152
169
|
|
|
@@ -154,6 +171,7 @@ var FilterHeaderRow = /*#__PURE__*/function (_Component) {
|
|
|
154
171
|
key: "componentDidMount",
|
|
155
172
|
value: function componentDidMount() {
|
|
156
173
|
this.updateDropdownHeight();
|
|
174
|
+
this.updateFocus();
|
|
157
175
|
}
|
|
158
176
|
}, {
|
|
159
177
|
key: "componentDidUpdate",
|
|
@@ -222,6 +240,7 @@ var FilterHeaderRow = /*#__PURE__*/function (_Component) {
|
|
|
222
240
|
// if unspecified
|
|
223
241
|
|
|
224
242
|
var headerContent = column.isFilterable !== undefined && !column.isFilterable ? /*#__PURE__*/React__default['default'].createElement("div", null) : column.options ? column.isMultiselect ? /*#__PURE__*/React__default['default'].createElement(carbonComponentsReact.MultiSelect.Filterable, {
|
|
243
|
+
ref: _this2.setFirstFilterableRef,
|
|
225
244
|
key: columnStateValue,
|
|
226
245
|
className: classnames__default['default']("".concat(iotPrefix, "--filterheader-multiselect"), "".concat(iotPrefix, "--filterheader-multiselect__menu--fit-content"), _defineProperty__default['default']({}, "".concat(iotPrefix, "--filterheader-multiselect__menu--flip-horizontal"), isLastColumn)),
|
|
227
246
|
id: "column-".concat(i),
|
|
@@ -254,6 +273,7 @@ var FilterHeaderRow = /*#__PURE__*/function (_Component) {
|
|
|
254
273
|
light: true,
|
|
255
274
|
disabled: isDisabled
|
|
256
275
|
}) : /*#__PURE__*/React__default['default'].createElement(ComboBox, {
|
|
276
|
+
ref: _this2.setFirstFilterableRef,
|
|
257
277
|
menuFitContent: true,
|
|
258
278
|
horizontalDirection: isLastColumn ? 'start' : 'end',
|
|
259
279
|
key: columnStateValue,
|
|
@@ -287,6 +307,7 @@ var FilterHeaderRow = /*#__PURE__*/function (_Component) {
|
|
|
287
307
|
}) : /*#__PURE__*/React__default['default'].createElement(carbonComponentsReact.FormItem, {
|
|
288
308
|
className: "".concat(iotPrefix, "--filter-header-row--form-item")
|
|
289
309
|
}, /*#__PURE__*/React__default['default'].createElement(carbonComponentsReact.TextInput, {
|
|
310
|
+
ref: _this2.setFirstFilterableRef,
|
|
290
311
|
id: column.id,
|
|
291
312
|
labelText: column.id,
|
|
292
313
|
hideLabel: true,
|
|
@@ -479,6 +500,21 @@ FilterHeaderRow.__docgenInfo = {
|
|
|
479
500
|
"modifiers": [],
|
|
480
501
|
"params": [],
|
|
481
502
|
"returns": null
|
|
503
|
+
}, {
|
|
504
|
+
"name": "setFirstFilterableRef",
|
|
505
|
+
"docblock": null,
|
|
506
|
+
"modifiers": [],
|
|
507
|
+
"params": [{
|
|
508
|
+
"name": "node",
|
|
509
|
+
"type": null
|
|
510
|
+
}],
|
|
511
|
+
"returns": null
|
|
512
|
+
}, {
|
|
513
|
+
"name": "updateFocus",
|
|
514
|
+
"docblock": null,
|
|
515
|
+
"modifiers": [],
|
|
516
|
+
"params": [],
|
|
517
|
+
"returns": null
|
|
482
518
|
}, {
|
|
483
519
|
"name": "handleApplyFilter",
|
|
484
520
|
"docblock": "take the state with the filter values and send to our listener",
|
package/lib/index.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var withSize = require('react-sizeme');
|
|
6
6
|
var Settings = require('./constants/Settings.js');
|
|
7
7
|
var Button = require('./components/Button/Button.js');
|
|
8
|
+
var CardCodeEditor = require('./components/CardCodeEditor/CardCodeEditor.js');
|
|
8
9
|
var EmptyTable = require('./components/Table/EmptyTable/EmptyTable.js');
|
|
9
10
|
var TableHead = require('./components/Table/TableHead/TableHead.js');
|
|
10
11
|
var TableBody = require('./components/Table/TableBody/TableBody.js');
|
|
@@ -146,6 +147,7 @@ withSize__default['default'].noPlaceholders = true; // Settings
|
|
|
146
147
|
|
|
147
148
|
exports.settings = Settings.settings;
|
|
148
149
|
exports.Button = Button;
|
|
150
|
+
exports.CardCodeEditor = CardCodeEditor;
|
|
149
151
|
exports.EmptyTable = EmptyTable;
|
|
150
152
|
exports.TableHead = TableHead;
|
|
151
153
|
exports.TableBody = TableBody;
|
package/package.json
CHANGED
|
@@ -343,10 +343,10 @@
|
|
|
343
343
|
"whatwg-fetch": "^3.0.0"
|
|
344
344
|
},
|
|
345
345
|
"sideEffects": false,
|
|
346
|
-
"version": "2.147.0-next.
|
|
346
|
+
"version": "2.147.0-next.52",
|
|
347
347
|
"resolutions": {
|
|
348
348
|
"chokidar": "3.3.1",
|
|
349
349
|
"react-grid-layout": "1.2.2"
|
|
350
350
|
},
|
|
351
|
-
"gitHead": "
|
|
351
|
+
"gitHead": "224036cdd5a729d89ef97904a9e57fe66b5f3e1d"
|
|
352
352
|
}
|