@carbon/ibm-products 1.32.0 → 1.33.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. package/css/index-full-carbon.css +145 -12
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +5 -1
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +6 -2
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +5 -1
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +141 -12
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +5 -1
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +141 -12
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +5 -1
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +2 -2
  18. package/es/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +6 -5
  19. package/es/components/Datagrid/Datagrid/DatagridContent.js +57 -30
  20. package/es/components/Datagrid/Datagrid/DatagridRow.js +10 -2
  21. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +84 -38
  22. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +2 -2
  23. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +21 -0
  24. package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +1 -1
  25. package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +1 -1
  26. package/es/components/Datagrid/utils/getInlineEditColumns.js +25 -7
  27. package/es/components/Datagrid/utils/makeData.js +34 -5
  28. package/es/components/InlineEdit/InlineEdit.js +7 -7
  29. package/es/components/OptionsTile/OptionsTile.js +4 -2
  30. package/lib/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +2 -2
  31. package/lib/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +6 -5
  32. package/lib/components/Datagrid/Datagrid/DatagridContent.js +56 -28
  33. package/lib/components/Datagrid/Datagrid/DatagridRow.js +19 -2
  34. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +84 -38
  35. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +2 -2
  36. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +22 -0
  37. package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +1 -1
  38. package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +1 -1
  39. package/lib/components/Datagrid/utils/getInlineEditColumns.js +25 -7
  40. package/lib/components/Datagrid/utils/makeData.js +35 -5
  41. package/lib/components/InlineEdit/InlineEdit.js +7 -7
  42. package/lib/components/OptionsTile/OptionsTile.js +4 -2
  43. package/package.json +12 -12
  44. package/scss/components/Datagrid/_storybook-styles.scss +7 -0
  45. package/scss/components/Datagrid/styles/_datagrid.scss +0 -5
  46. package/scss/components/Datagrid/styles/_useInlineEdit.scss +182 -1
  47. package/scss/components/InlineEdit/_inline-edit.scss +4 -2
  48. package/scss/components/OptionsTile/_options-tile.scss +4 -0
@@ -56,7 +56,7 @@ var buttons = ['cancel', 'edit', 'save'];
56
56
  */
57
57
 
58
58
  var InlineEdit = /*#__PURE__*/_react.default.forwardRef(function (_ref, refIn) {
59
- var _cx, _refInput$current, _refInput$current$inn, _cx3;
59
+ var _cx, _refInput$current, _refInput$current$tex, _cx3;
60
60
 
61
61
  var buttonTooltipAlignment = _ref.buttonTooltipAlignment,
62
62
  buttonTooltipPosition = _ref.buttonTooltipPosition,
@@ -81,7 +81,7 @@ var InlineEdit = /*#__PURE__*/_react.default.forwardRef(function (_ref, refIn) {
81
81
  value = _ref.value,
82
82
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
83
83
  var refInput = (0, _react.useRef)({
84
- innerText: value
84
+ textContent: value
85
85
  });
86
86
  var localRef = (0, _react.useRef)(null);
87
87
  var ref = refIn || localRef;
@@ -163,15 +163,15 @@ var InlineEdit = /*#__PURE__*/_react.default.forwardRef(function (_ref, refIn) {
163
163
  document.getSelection().removeAllRanges();
164
164
 
165
165
  if (onSave) {
166
- onSave(refInput.current.innerText);
166
+ onSave(refInput.current.textContent);
167
167
  }
168
168
  };
169
169
 
170
170
  var handleInput = function handleInput() {
171
- setInternalValue(refInput.current.innerText);
171
+ setInternalValue(refInput.current.textContent);
172
172
 
173
173
  if (onChange) {
174
- onChange(refInput.current.innerText);
174
+ onChange(refInput.current.textContent);
175
175
  }
176
176
  }; // pasting into contentEditable not supported by userEvent
177
177
 
@@ -206,7 +206,7 @@ var InlineEdit = /*#__PURE__*/_react.default.forwardRef(function (_ref, refIn) {
206
206
  };
207
207
 
208
208
  var handleCancel = function handleCancel() {
209
- refInput.current.innerText = value;
209
+ refInput.current.textContent = value;
210
210
  handleInput(value);
211
211
  doSetEditing(false);
212
212
  document.getSelection().removeAllRanges();
@@ -274,7 +274,7 @@ var InlineEdit = /*#__PURE__*/_react.default.forwardRef(function (_ref, refIn) {
274
274
  }, /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, (0, _devtools.getDevtoolsProps)(componentName), {
275
275
  id: id,
276
276
  size: size,
277
- className: (0, _classnames.default)("".concat(blockClass, "__input"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__input--empty"), ((_refInput$current = refInput.current) === null || _refInput$current === void 0 ? void 0 : (_refInput$current$inn = _refInput$current.innerText) === null || _refInput$current$inn === void 0 ? void 0 : _refInput$current$inn.length) === 0)),
277
+ className: (0, _classnames.default)("".concat(blockClass, "__input"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__input--empty"), ((_refInput$current = refInput.current) === null || _refInput$current === void 0 ? void 0 : (_refInput$current$tex = _refInput$current.textContent) === null || _refInput$current$tex === void 0 ? void 0 : _refInput$current$tex.length) === 0)),
278
278
  contentEditable: true,
279
279
  "aria-label": labelText,
280
280
  role: "textbox",
@@ -221,12 +221,14 @@ var OptionsTile = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
221
221
  className: "".concat(blockClass, "__heading")
222
222
  }, /*#__PURE__*/_react.default.createElement("h6", {
223
223
  id: titleId,
224
- className: "".concat(blockClass, "__title")
224
+ className: "".concat(blockClass, "__title"),
225
+ title: title
225
226
  }, title), text && /*#__PURE__*/_react.default.createElement("span", {
226
227
  className: (0, _classnames.default)(summaryClasses),
227
228
  "aria-hidden": summaryHidden
228
229
  }, Icon && /*#__PURE__*/_react.default.createElement(Icon, null), /*#__PURE__*/_react.default.createElement("span", {
229
- className: "".concat(blockClass, "__summary-text")
230
+ className: "".concat(blockClass, "__summary-text"),
231
+ title: text
230
232
  }, text)));
231
233
  }
232
234
 
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.32.0",
4
+ "version": "1.33.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -51,26 +51,26 @@
51
51
  },
52
52
  "devDependencies": {
53
53
  "@babel/cli": "^7.18.10",
54
- "@babel/core": "^7.18.13",
55
- "babel-preset-ibm-cloud-cognitive": "^0.14.19",
54
+ "@babel/core": "^7.19.1",
55
+ "babel-preset-ibm-cloud-cognitive": "^0.14.20",
56
56
  "chalk": "^4.1.2",
57
57
  "change-case": "^4.1.2",
58
58
  "copyfiles": "^2.4.1",
59
59
  "cross-env": "^7.0.3",
60
60
  "fs-extra": "^10.1.0",
61
61
  "glob": "^8.0.3",
62
- "jest": "^29.0.1",
63
- "jest-config-ibm-cloud-cognitive": "^0.24.5",
64
- "jest-environment-jsdom": "^29.0.1",
62
+ "jest": "^29.0.3",
63
+ "jest-config-ibm-cloud-cognitive": "^0.24.6",
64
+ "jest-environment-jsdom": "^29.0.3",
65
65
  "namor": "^1.1.2",
66
- "npm-check-updates": "^16.0.6",
66
+ "npm-check-updates": "^16.1.3",
67
67
  "npm-run-all": "^4.1.5",
68
68
  "rimraf": "^3.0.2",
69
- "sass": "^1.54.8",
69
+ "sass": "^1.54.9",
70
70
  "yargs": "^17.5.1"
71
71
  },
72
72
  "dependencies": {
73
- "@babel/runtime": "^7.18.9",
73
+ "@babel/runtime": "^7.19.0",
74
74
  "@carbon/telemetry": "^0.1.0",
75
75
  "immutability-helper": "^3.1.1",
76
76
  "react-dnd": "^15.1.2",
@@ -87,11 +87,11 @@
87
87
  "@carbon/motion": "^10.29.0",
88
88
  "@carbon/themes": "^10.55.0",
89
89
  "@carbon/type": "^10.45.0",
90
- "carbon-components": "^10.58.0",
91
- "carbon-components-react": "^7.59.0",
90
+ "carbon-components": "^10.58.1",
91
+ "carbon-components-react": "^7.59.1",
92
92
  "carbon-icons": "^7.0.7",
93
93
  "react": "^16.8.6 || ^17.0.1",
94
94
  "react-dom": "^16.8.6 || ^17.0.1"
95
95
  },
96
- "gitHead": "07980288bb0aeea68a7b884846fb675e9bba82bd"
96
+ "gitHead": "1ac4bda25833dab9426808f9d397d0ea4c5534e4"
97
97
  }
@@ -86,3 +86,10 @@ $block-class: #{$pkg-prefix}--datagrid;
86
86
  .#{$pkg-prefix}--side-panel__inner-content {
87
87
  height: 100%;
88
88
  }
89
+
90
+ .#{$block-class}-story__custom-cell-wrapper.#{$carbon-prefix}--link {
91
+ display: block;
92
+ overflow: hidden;
93
+ text-overflow: ellipsis;
94
+ white-space: nowrap;
95
+ }
@@ -523,8 +523,3 @@
523
523
  .#{$block-class} .#{$pkg-prefix}--button-menu {
524
524
  height: $spacing-09;
525
525
  }
526
-
527
- .#{$block-class} .#{$block-class}__table-grid-active {
528
- border: 2px solid $inverse-link;
529
- outline: 0;
530
- }
@@ -38,7 +38,7 @@ $row-heights: (
38
38
  .#{$block-class}
39
39
  .#{$block-class}__inline-edit--outer-cell-button--#{$size}
40
40
  .#{$carbon-prefix}--number__control-btn::after {
41
- height: calc($size-value - 0.25rem);
41
+ height: calc(#{$size-value} - 0.25rem);
42
42
  }
43
43
  .#{$block-class}
44
44
  .#{$block-class}__inline-edit--select.#{$block-class}__inline-edit--select-#{$size}.#{$carbon-prefix}--list-box {
@@ -56,6 +56,10 @@ $row-heights: (
56
56
  }
57
57
  }
58
58
 
59
+ .#{$block-class} {
60
+ --#{$block-class}--grid-header-height: 0;
61
+ }
62
+
59
63
  .#{$block-class}__inline-edit-cell {
60
64
  display: flex;
61
65
  height: 100%;
@@ -75,6 +79,7 @@ $row-heights: (
75
79
  .#{$block-class}__inline-edit--outer-cell-button
76
80
  .#{$block-class}__inline-edit-button {
77
81
  position: relative;
82
+ z-index: 2;
78
83
  display: flex;
79
84
  width: 100%;
80
85
  height: 100%;
@@ -85,10 +90,12 @@ $row-heights: (
85
90
  cursor: pointer;
86
91
  outline: 0; // handled by active class
87
92
  .#{$block-class}__label-icon {
93
+ height: $spacing-05;
88
94
  padding-right: $spacing-05;
89
95
  }
90
96
  &.#{$block-class}__inline-edit-button--non-edit {
91
97
  padding-left: 0;
98
+ cursor: default;
92
99
  }
93
100
  .#{$block-class}__inline-edit-button-icon {
94
101
  height: $spacing-05;
@@ -209,3 +216,177 @@ $row-heights: (
209
216
  text-overflow: ellipsis;
210
217
  white-space: nowrap;
211
218
  }
219
+
220
+ .#{$block-class}
221
+ .#{$carbon-prefix}--data-table
222
+ .#{$block-class}__carbon-row-hover-active
223
+ td {
224
+ border-top-color: $hover-ui;
225
+ background-color: $hover-ui;
226
+ }
227
+
228
+ // Custom border/outline for the focus region, because of the scrolling
229
+ // containers, using default border or outline did not
230
+ .#{$block-class} .#{$block-class}__grid-container-grid-active::before {
231
+ position: absolute;
232
+ z-index: 2;
233
+ bottom: 0;
234
+ left: 0;
235
+ width: 2px;
236
+ height: calc(100% - 50px - var(--#{$block-class}--grid-header-height));
237
+ background-color: $inverse-link;
238
+ content: '';
239
+ }
240
+
241
+ .#{$block-class} .#{$block-class}__grid-container-grid-active::after {
242
+ position: absolute;
243
+ z-index: 2;
244
+ right: 0;
245
+ bottom: 0;
246
+ width: 2px;
247
+ height: calc(100% - 50px - var(--#{$block-class}--grid-header-height));
248
+ background-color: $inverse-link;
249
+ content: '';
250
+ }
251
+
252
+ .#{$block-class}
253
+ .#{$block-class}__grid-container-grid-active
254
+ .#{$carbon-prefix}--data-table-content::before {
255
+ position: absolute;
256
+ z-index: 2;
257
+ top: 0;
258
+ right: 0;
259
+ left: 0;
260
+ width: var(--#{$block-class}--grid-width);
261
+ height: 2px;
262
+ background-color: $inverse-link;
263
+ }
264
+
265
+ .#{$block-class}
266
+ .#{$block-class}__grid-container-grid-active.#{$block-class}__grid-container-grid-active--without-toolbar::before,
267
+ .#{$block-class}
268
+ .#{$block-class}__grid-container-grid-active.#{$block-class}__grid-container-grid-active--without-toolbar::after {
269
+ height: calc(100% - 2px - var(--#{$block-class}--grid-header-height));
270
+ }
271
+
272
+ .#{$block-class}
273
+ .#{$block-class}__grid-container-grid-active
274
+ .#{$block-class}__table-container {
275
+ outline: 2px solid $inverse-link;
276
+ outline-offset: -2px;
277
+ }
278
+
279
+ .#{$block-class}
280
+ .#{$block-class}__grid-container-inline-edit
281
+ .#{$block-class}__table-container {
282
+ padding-top: $spacing-01;
283
+ }
284
+
285
+ .#{$block-class}
286
+ .#{$block-class}__inline-edit--outer-cell-button--invalid
287
+ [data-invalid]
288
+ ~ .#{$carbon-prefix}--form-requirement,
289
+ .#{$block-class}
290
+ .#{$block-class}__inline-edit--outer-cell-button--invalid
291
+ [data-invalid]
292
+ .#{$carbon-prefix}--form-requirement {
293
+ position: absolute;
294
+ z-index: 3;
295
+ top: calc(100% - #{$spacing-01});
296
+ width: 100%;
297
+ padding: $spacing-03 $spacing-06 $spacing-03 $spacing-03;
298
+ margin: 0;
299
+ background-color: $ui-01;
300
+ outline: $spacing-01 solid $danger-02;
301
+ outline-offset: calc(-1 * #{$spacing-01});
302
+ }
303
+
304
+ .#{$block-class}
305
+ .#{$block-class}__inline-edit--outer-cell-button--invalid
306
+ .#{$carbon-prefix}--list-box[data-invalid]:focus-within
307
+ ~ .#{$carbon-prefix}--form-requirement {
308
+ outline: $spacing-01 solid $focus;
309
+ }
310
+
311
+ .#{$block-class}
312
+ .#{$block-class}__inline-edit--outer-cell-button--invalid
313
+ .#{$carbon-prefix}--list-box__invalid-icon,
314
+ .#{$block-class}
315
+ .#{$block-class}__inline-edit--outer-cell-button--invalid
316
+ .#{$carbon-prefix}--text-input__invalid-icon,
317
+ .#{$block-class}
318
+ .#{$block-class}__inline-edit--outer-cell-button--invalid
319
+ .#{$carbon-prefix}--number__invalid {
320
+ z-index: 4;
321
+ top: calc(100% + #{$spacing-04} + #{$spacing-01});
322
+ right: $spacing-03;
323
+ }
324
+
325
+ .#{$block-class}
326
+ .#{$block-class}__inline-edit--outer-cell-button--invalid
327
+ .#{$carbon-prefix}--number__invalid {
328
+ top: calc(100% + #{$spacing-02} + #{$spacing-01});
329
+ }
330
+
331
+ .#{$block-class}
332
+ .#{$block-class}__inline-edit--outer-cell-button--invalid
333
+ .#{$carbon-prefix}--form-requirement::before {
334
+ position: absolute;
335
+ top: 0;
336
+ left: $spacing-01;
337
+ width: calc(100% - (#{$spacing-01} * 2));
338
+ height: $spacing-01;
339
+ background-color: $ui-01;
340
+ content: '';
341
+ }
342
+
343
+ .#{$block-class}__inline-edit--outer-cell-button--invalid
344
+ .#{$carbon-prefix}--form-requirement::after {
345
+ position: absolute;
346
+ top: $spacing-01;
347
+ left: $spacing-03;
348
+ width: calc(100% - (#{$spacing-03} * 2));
349
+ height: 1px;
350
+ background-color: $ui-03;
351
+ content: '';
352
+ }
353
+
354
+ .#{$block-class} tbody tr:hover {
355
+ .#{$block-class}__inline-edit--outer-cell-button--invalid
356
+ .#{$carbon-prefix}--form-requirement::before {
357
+ background-color: $ui-03;
358
+ }
359
+ .#{$block-class}__inline-edit--outer-cell-button--invalid
360
+ .#{$carbon-prefix}--form-requirement::after {
361
+ background-color: transparent;
362
+ }
363
+ }
364
+
365
+ // Keep input focus states using $support-01 when inline edit cell is invalid
366
+ .#{$block-class}
367
+ .#{$block-class}__inline-edit--outer-cell-button--invalid
368
+ .#{$carbon-prefix}--text-input:focus,
369
+ .#{$block-class}
370
+ .#{$block-class}__inline-edit--outer-cell-button--invalid
371
+ .#{$carbon-prefix}--number
372
+ input[type='number']:focus,
373
+ .#{$block-class}
374
+ .#{$block-class}__inline-edit--outer-cell-button--invalid
375
+ .#{$carbon-prefix}--number
376
+ input[type='number']:focus
377
+ ~ .#{$carbon-prefix}--number__controls
378
+ .#{$carbon-prefix}--number__control-btn:hover,
379
+ .#{$block-class}
380
+ .#{$block-class}__inline-edit--outer-cell-button--invalid
381
+ .#{$carbon-prefix}--number__control-btn:focus {
382
+ outline-color: $support-01;
383
+ }
384
+
385
+ .#{$block-class}
386
+ .#{$block-class}__inline-edit--outer-cell-button--invalid
387
+ .#{$carbon-prefix}--number
388
+ input[type='number'][data-invalid]:focus
389
+ ~ .#{$carbon-prefix}--number__controls
390
+ .#{$carbon-prefix}--number__control-btn.up-icon::after {
391
+ background-color: $support-01;
392
+ }
@@ -105,9 +105,11 @@
105
105
  overflow: hidden;
106
106
  // positions text and placeholder including when showing placeholder
107
107
  // NOTE: Using flex does strange things to a caret in content editable
108
- width: calc(100% - var(--#{$block-class}--toolbar-width) - $spacing-05);
108
+ width: calc(
109
+ 100% - var(--#{$block-class}--toolbar-width) - #{$spacing-05}
110
+ );
109
111
  max-width: calc(
110
- 100% - var(--#{$block-class}--toolbar-width) - $spacing-05
112
+ 100% - var(--#{$block-class}--toolbar-width) - #{$spacing-05}
111
113
  );
112
114
  min-height: var(--#{$block-class}--size);
113
115
  /* stylelint-disable-next-line carbon/layout-token-use */
@@ -70,13 +70,17 @@
70
70
  }
71
71
 
72
72
  .#{$block-class}__heading {
73
+ overflow: hidden;
73
74
  grid-column: 2;
74
75
  }
75
76
 
76
77
  .#{$block-class}__title {
77
78
  @include carbon--type-style('productive-heading-01');
78
79
 
80
+ overflow: hidden;
79
81
  color: $text-01;
82
+ text-overflow: ellipsis;
83
+ white-space: nowrap;
80
84
  }
81
85
 
82
86
  .#{$block-class}__summary {