@carbon/ibm-products 2.43.1-canary.6 → 2.43.1-canary.8

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.
@@ -134,9 +134,14 @@ var InlineEditCell = function InlineEditCell(_ref) {
134
134
  // in edit mode, otherwise `initialValue` becomes stale
135
135
  useEffect(function () {
136
136
  if ((previousState === null || previousState === void 0 ? void 0 : previousState.editId) === cellId && (previousState === null || previousState === void 0 ? void 0 : previousState.activeCellId) === cellId && activeCellId !== cellId) {
137
- setInitialValue(cellValue);
137
+ var _ref4 = config || {},
138
+ validator = _ref4.validator;
139
+ var isInvalid = validator === null || validator === void 0 ? void 0 : validator(cellValue);
140
+ if (!isInvalid) {
141
+ setInitialValue(cellValue);
142
+ }
138
143
  }
139
- }, [previousState, cellId, cellValue, activeCellId]);
144
+ }, [previousState, cellId, cellValue, activeCellId, config]);
140
145
  var handleInlineCellClick = function handleInlineCellClick() {
141
146
  if (!inEditMode) {
142
147
  dispatch({
@@ -212,8 +217,8 @@ var InlineEditCell = function InlineEditCell(_ref) {
212
217
  if (type === 'selection' || type === 'date') {
213
218
  return;
214
219
  }
215
- var _ref4 = config || {},
216
- validator = _ref4.validator;
220
+ var _ref5 = config || {},
221
+ validator = _ref5.validator;
217
222
  var isInvalid = validator === null || validator === void 0 ? void 0 : validator(cellValue);
218
223
  // If an invalid state is detected, Tab/Enter should not do anything
219
224
  // until the input has a valid state once again
@@ -268,8 +273,8 @@ var InlineEditCell = function InlineEditCell(_ref) {
268
273
  } : null;
269
274
  };
270
275
  var renderSelectCell = function renderSelectCell() {
271
- var _ref5 = config || {},
272
- inputProps = _ref5.inputProps;
276
+ var _ref6 = config || {},
277
+ inputProps = _ref6.inputProps;
273
278
  return /*#__PURE__*/React__default.createElement(Dropdown, _extends({
274
279
  id: cellId,
275
280
  label: cellLabel || 'Dropdown menu options',
@@ -299,8 +304,8 @@ var InlineEditCell = function InlineEditCell(_ref) {
299
304
  },
300
305
  downshiftProps: {
301
306
  onStateChange: function onStateChange(downshiftState) {
302
- var _ref6 = downshiftState || {},
303
- isOpen = _ref6.isOpen;
307
+ var _ref7 = downshiftState || {},
308
+ isOpen = _ref7.isOpen;
304
309
  // !isOpen does not work in this case because a state change occurs on hover of the
305
310
  // menu items and isOpen is changed to undefined which causes dispatch to be called unexpectedly
306
311
  if (isOpen === false) {
@@ -399,8 +404,8 @@ var InlineEditCell = function InlineEditCell(_ref) {
399
404
  return null;
400
405
  };
401
406
  var renderNumberInput = function renderNumberInput() {
402
- var _ref7 = config || {},
403
- validator = _ref7.validator;
407
+ var _ref8 = config || {},
408
+ validator = _ref8.validator;
404
409
  return /*#__PURE__*/React__default.createElement(NumberInput, _extends({
405
410
  placeholder: placeholder,
406
411
  label: cellLabel
@@ -410,8 +415,8 @@ var InlineEditCell = function InlineEditCell(_ref) {
410
415
  defaultValue: cellValue,
411
416
  invalid: validator === null || validator === void 0 ? void 0 : validator(cellValue),
412
417
  invalidText: (inputProps === null || inputProps === void 0 ? void 0 : inputProps.invalidText) || 'Provide missing invalidText',
413
- onChange: function onChange(event, _ref8) {
414
- var value = _ref8.value;
418
+ onChange: function onChange(event, _ref9) {
419
+ var value = _ref9.value;
415
420
  setCellValue(value);
416
421
  if (inputProps.onChange) {
417
422
  inputProps.onChange(value);
@@ -421,8 +426,8 @@ var InlineEditCell = function InlineEditCell(_ref) {
421
426
  }));
422
427
  };
423
428
  var renderTextInput = function renderTextInput() {
424
- var _ref9 = config || {},
425
- validator = _ref9.validator;
429
+ var _ref10 = config || {},
430
+ validator = _ref10.validator;
426
431
  var isInvalid = validator === null || validator === void 0 ? void 0 : validator(cellValue);
427
432
  return /*#__PURE__*/React__default.createElement(TextInput, _extends({
428
433
  labelText: cellLabel,
@@ -143,9 +143,14 @@ var InlineEditCell = function InlineEditCell(_ref) {
143
143
  // in edit mode, otherwise `initialValue` becomes stale
144
144
  React.useEffect(function () {
145
145
  if ((previousState === null || previousState === void 0 ? void 0 : previousState.editId) === cellId && (previousState === null || previousState === void 0 ? void 0 : previousState.activeCellId) === cellId && activeCellId !== cellId) {
146
- setInitialValue(cellValue);
146
+ var _ref4 = config || {},
147
+ validator = _ref4.validator;
148
+ var isInvalid = validator === null || validator === void 0 ? void 0 : validator(cellValue);
149
+ if (!isInvalid) {
150
+ setInitialValue(cellValue);
151
+ }
147
152
  }
148
- }, [previousState, cellId, cellValue, activeCellId]);
153
+ }, [previousState, cellId, cellValue, activeCellId, config]);
149
154
  var handleInlineCellClick = function handleInlineCellClick() {
150
155
  if (!inEditMode) {
151
156
  dispatch({
@@ -221,8 +226,8 @@ var InlineEditCell = function InlineEditCell(_ref) {
221
226
  if (type === 'selection' || type === 'date') {
222
227
  return;
223
228
  }
224
- var _ref4 = config || {},
225
- validator = _ref4.validator;
229
+ var _ref5 = config || {},
230
+ validator = _ref5.validator;
226
231
  var isInvalid = validator === null || validator === void 0 ? void 0 : validator(cellValue);
227
232
  // If an invalid state is detected, Tab/Enter should not do anything
228
233
  // until the input has a valid state once again
@@ -277,8 +282,8 @@ var InlineEditCell = function InlineEditCell(_ref) {
277
282
  } : null;
278
283
  };
279
284
  var renderSelectCell = function renderSelectCell() {
280
- var _ref5 = config || {},
281
- inputProps = _ref5.inputProps;
285
+ var _ref6 = config || {},
286
+ inputProps = _ref6.inputProps;
282
287
  return /*#__PURE__*/React__default["default"].createElement(react.Dropdown, _rollupPluginBabelHelpers["extends"]({
283
288
  id: cellId,
284
289
  label: cellLabel || 'Dropdown menu options',
@@ -308,8 +313,8 @@ var InlineEditCell = function InlineEditCell(_ref) {
308
313
  },
309
314
  downshiftProps: {
310
315
  onStateChange: function onStateChange(downshiftState) {
311
- var _ref6 = downshiftState || {},
312
- isOpen = _ref6.isOpen;
316
+ var _ref7 = downshiftState || {},
317
+ isOpen = _ref7.isOpen;
313
318
  // !isOpen does not work in this case because a state change occurs on hover of the
314
319
  // menu items and isOpen is changed to undefined which causes dispatch to be called unexpectedly
315
320
  if (isOpen === false) {
@@ -408,8 +413,8 @@ var InlineEditCell = function InlineEditCell(_ref) {
408
413
  return null;
409
414
  };
410
415
  var renderNumberInput = function renderNumberInput() {
411
- var _ref7 = config || {},
412
- validator = _ref7.validator;
416
+ var _ref8 = config || {},
417
+ validator = _ref8.validator;
413
418
  return /*#__PURE__*/React__default["default"].createElement(react.NumberInput, _rollupPluginBabelHelpers["extends"]({
414
419
  placeholder: placeholder,
415
420
  label: cellLabel
@@ -419,8 +424,8 @@ var InlineEditCell = function InlineEditCell(_ref) {
419
424
  defaultValue: cellValue,
420
425
  invalid: validator === null || validator === void 0 ? void 0 : validator(cellValue),
421
426
  invalidText: (inputProps === null || inputProps === void 0 ? void 0 : inputProps.invalidText) || 'Provide missing invalidText',
422
- onChange: function onChange(event, _ref8) {
423
- var value = _ref8.value;
427
+ onChange: function onChange(event, _ref9) {
428
+ var value = _ref9.value;
424
429
  setCellValue(value);
425
430
  if (inputProps.onChange) {
426
431
  inputProps.onChange(value);
@@ -430,8 +435,8 @@ var InlineEditCell = function InlineEditCell(_ref) {
430
435
  }));
431
436
  };
432
437
  var renderTextInput = function renderTextInput() {
433
- var _ref9 = config || {},
434
- validator = _ref9.validator;
438
+ var _ref10 = config || {},
439
+ validator = _ref10.validator;
435
440
  var isInvalid = validator === null || validator === void 0 ? void 0 : validator(cellValue);
436
441
  return /*#__PURE__*/React__default["default"].createElement(react.TextInput, _rollupPluginBabelHelpers["extends"]({
437
442
  labelText: cellLabel,
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.1-canary.6+578f1cfbc",
4
+ "version": "2.43.1-canary.8+aeae85013",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -119,5 +119,5 @@
119
119
  "react": "^16.8.6 || ^17.0.1 || ^18.2.0",
120
120
  "react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
121
121
  },
122
- "gitHead": "578f1cfbc3b7815edb102dc1fd1f2740b32ce0d6"
122
+ "gitHead": "aeae85013da0cda71273ccdf66a7fd125708f18c"
123
123
  }
package/telemetry.yml CHANGED
@@ -85,6 +85,9 @@ collect:
85
85
  - errorCodeLabel
86
86
  - errorMessage
87
87
  - expandButtonLabel
88
+ - expandedContentHeight
89
+ - ExpandedRowContentComponent
90
+ - expandedRowIds
88
91
  - fetchMoreData
89
92
  - fieldsetLegendText
90
93
  - filterByLabel
@@ -217,6 +220,7 @@ collect:
217
220
  - onRequestClose
218
221
  - onRequestSubmit
219
222
  - onRowClick
223
+ - onRowExpand
220
224
  - onScroll
221
225
  - onSecondaryButtonClick
222
226
  - onSelectAllRows