@knime/kds-table 7.2.3 → 8.1.0

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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # @knime/kds-table
2
2
 
3
+ ## 8.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 813b76b: `TableUI` / `TableUIWithAutoSizeCalculation`: added `renderedOnBackgroundColor` prop (`"page-default" | "surface-default" | "surface-muted" | "surface-subtle"`, default `"page-default"`) to set the header's background color, so it can be matched to the surface the table is rendered on.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @knime/kds-components@8.1.0
13
+ - @knime/kds-styles@8.1.0
14
+
15
+ ## 8.0.0
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [336b1b4]
20
+ - @knime/kds-components@8.0.0
21
+ - @knime/kds-styles@8.0.0
22
+
3
23
  ## 7.2.3
4
24
 
5
25
  ### Patch Changes
package/README.md CHANGED
@@ -18,10 +18,6 @@ From the root of the monorepo:
18
18
  pnpm dev # Starts Storybook with all design system components
19
19
  ```
20
20
 
21
- ### Git hooks
22
-
23
- Git hooks are configured at the monorepo root. See [root README](../README.md) for details.
24
-
25
21
  ### Testing
26
22
 
27
23
  #### Running unit tests
package/dist/index.css CHANGED
@@ -416,12 +416,12 @@ tr {
416
416
  }
417
417
 
418
418
  thead {
419
- &[data-v-885a5768] {
420
- background-color: var(--kds-color-page-default);
419
+ &[data-v-8f9b1e4b] {
420
+ background-color: var(--v24252679);
421
421
  border-bottom: var(--kds-border-base-subtle);
422
422
  }
423
423
  & tr {
424
- &[data-v-885a5768] {
424
+ &[data-v-8f9b1e4b] {
425
425
  display: flex;
426
426
  height: 100%;
427
427
  transition:
@@ -429,51 +429,51 @@ thead {
429
429
  box-shadow 0.15s;
430
430
  }
431
431
  & th {
432
- &[data-v-885a5768] {
432
+ &[data-v-8f9b1e4b] {
433
433
  min-height: var(--kds-dimension-component-height-2-5x);
434
434
  max-height: var(--kds-dimension-component-height-5x);
435
435
  text-align: left;
436
436
  white-space: nowrap;
437
437
  }
438
- &.deletion-cell-spacer[data-v-885a5768] {
438
+ &.deletion-cell-spacer[data-v-8f9b1e4b] {
439
439
  width: var(--kds-dimension-component-width-2x);
440
440
  }
441
441
  &.select-cell {
442
- &[data-v-885a5768] {
442
+ &[data-v-8f9b1e4b] {
443
443
  display: flex;
444
444
  justify-content: center;
445
445
  width: var(--kds-dimension-component-width-2x);
446
446
  padding: var(--kds-spacing-container-0-75x);
447
447
  }
448
- & .select-checkbox[data-v-885a5768] {
448
+ & .select-checkbox[data-v-8f9b1e4b] {
449
449
  /* With this added padding the checkbox appears centered initially */
450
450
  padding: var(--kds-spacing-container-0-10x);
451
451
  }
452
452
  }
453
- &.new-column-head[data-v-885a5768] {
453
+ &.new-column-head[data-v-8f9b1e4b] {
454
454
  display: flex;
455
455
  flex-direction: column;
456
456
  justify-content: center;
457
457
  padding: var(--kds-spacing-container-0-5x);
458
458
  }
459
459
  }
460
- &[data-v-885a5768]:hover {
460
+ &[data-v-8f9b1e4b]:hover {
461
461
  outline: none;
462
462
  }
463
463
  }
464
- &.sub-menu-active tr[data-v-885a5768] {
464
+ &.sub-menu-active tr[data-v-8f9b1e4b] {
465
465
  padding-right: var(--kds-dimension-component-width-2x);
466
466
  }
467
467
  }
468
468
  .header-selection-overlay {
469
- &[data-v-885a5768] {
469
+ &[data-v-8f9b1e4b] {
470
470
  position: absolute;
471
471
  top: 0;
472
472
  height: 100%;
473
473
  pointer-events: none;
474
474
  border: var(--kds-border-action-selected-accent);
475
475
  }
476
- &.header-focused[data-v-885a5768] {
476
+ &.header-focused[data-v-8f9b1e4b] {
477
477
  border: var(--kds-border-action-focused);
478
478
  }
479
479
  }
@@ -655,7 +655,7 @@ tr.row {
655
655
  }
656
656
  }
657
657
 
658
- .wrapper[data-v-bc9c37d0] {
658
+ .wrapper[data-v-8198a271] {
659
659
  display: flex;
660
660
  flex-direction: column;
661
661
  width: 100%;
@@ -665,7 +665,7 @@ tr.row {
665
665
  }
666
666
  }
667
667
  table {
668
- &[data-v-bc9c37d0] {
668
+ &[data-v-8198a271] {
669
669
  position: relative;
670
670
  display: flex;
671
671
  flex-grow: 1;
@@ -673,20 +673,20 @@ table {
673
673
  width: 100%;
674
674
  min-height: 0;
675
675
  }
676
- &[data-v-bc9c37d0]:focus {
676
+ &[data-v-8198a271]:focus {
677
677
  outline: none;
678
678
  }
679
- & .new-row-footer[data-v-bc9c37d0] {
679
+ & .new-row-footer[data-v-8198a271] {
680
680
  width: 100%;
681
681
  }
682
682
  }
683
683
 
684
684
  /* The empty state is placed into the rows' area by TableCoreVirtual. */
685
- .empty-state[data-v-bc9c37d0] {
685
+ .empty-state[data-v-8198a271] {
686
686
  max-width: 100%;
687
687
  }
688
688
 
689
- .table-column-size-calculation[data-v-f0e4039f] {
689
+ .table-column-size-calculation[data-v-8ae322ef] {
690
690
  position: absolute;
691
691
  top: -9999px;
692
692
  left: -9999px;
package/dist/index.js CHANGED
@@ -1343,6 +1343,28 @@ var constants_default = {
1343
1343
  CELL_PADDING_HORIZONTAL
1344
1344
  };
1345
1345
  //#endregion
1346
+ //#region src/types/BackgroundColor.ts
1347
+ /**
1348
+ * Background-color tokens the table can be rendered on top of. Used to match
1349
+ * the table header's background to the surface surrounding the table.
1350
+ */
1351
+ var BACKGROUND_COLORS = [
1352
+ "page-default",
1353
+ "surface-default",
1354
+ "surface-muted",
1355
+ "surface-subtle"
1356
+ ];
1357
+ /**
1358
+ * Shared Vue prop options for `renderedOnBackgroundColor`, used by every
1359
+ * component that exposes it. The `validator` guards the runtime value for
1360
+ * plain-JS callers that bypass the `BackgroundColor` type at compile time.
1361
+ */
1362
+ var renderedOnBackgroundColorProp = {
1363
+ type: String,
1364
+ default: "page-default",
1365
+ validator: (value) => BACKGROUND_COLORS.includes(value)
1366
+ };
1367
+ //#endregion
1346
1368
  //#region src/utils/index.ts
1347
1369
  var isNonEmptyObject = (val) => val !== null && typeof val === "object" && Object.getOwnPropertyNames(val).length > 0;
1348
1370
  var isObjectRepresentation = (val) => {
@@ -5850,7 +5872,7 @@ var columnMenuButtonRef = "columnMenuButton";
5850
5872
  * @emits headerSelect event when the checkbox is selected for table-wide toggling of selection.
5851
5873
  * @emits subMenuItemSelection event when the selection of a submenu item is changed
5852
5874
  */
5853
- var Header_vue_vue_type_script_lang_default = {
5875
+ var __default__ = {
5854
5876
  components: {
5855
5877
  KdsCheckbox,
5856
5878
  KdsButton,
@@ -6170,7 +6192,9 @@ var Header_vue_vue_type_script_lang_default = {
6170
6192
  selectedHeaderIndex: {
6171
6193
  type: Number,
6172
6194
  default: null
6173
- }
6195
+ },
6196
+ /** Background-color token matching the surface the table is rendered on; sets the header's background. */
6197
+ renderedOnBackgroundColor: renderedOnBackgroundColorProp
6174
6198
  },
6175
6199
  emits: {
6176
6200
  headerSelect: (selected) => true,
@@ -6221,6 +6245,9 @@ var Header_vue_vue_type_script_lang_default = {
6221
6245
  };
6222
6246
  },
6223
6247
  computed: {
6248
+ headerBackgroundColor() {
6249
+ return `var(--kds-color-${this.renderedOnBackgroundColor}, var(--kds-color-page-default))`;
6250
+ },
6224
6251
  /**
6225
6252
  * The smallest size that can be given to all columns at once, i.e. the
6226
6253
  * largest of their individual minimums (see {@link minSizeOfColumn}).
@@ -6338,6 +6365,14 @@ var Header_vue_vue_type_script_lang_default = {
6338
6365
  }
6339
6366
  }
6340
6367
  };
6368
+ var __injectCSSVars__ = () => {
6369
+ useCssVars((_ctx) => ({ "v24252679": _ctx.headerBackgroundColor }));
6370
+ };
6371
+ var __setup__ = __default__.setup;
6372
+ __default__.setup = __setup__ ? (props, ctx) => {
6373
+ __injectCSSVars__();
6374
+ return __setup__(props, ctx);
6375
+ } : __injectCSSVars__;
6341
6376
  //#endregion
6342
6377
  //#region src/components/layout/Header.vue
6343
6378
  var _hoisted_1$3 = {
@@ -6449,7 +6484,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
6449
6484
  style: normalizeStyle($options.headerSelectionOverlayStyle)
6450
6485
  }, null, 6)) : createCommentVNode("", true)]);
6451
6486
  }
6452
- var Header_default = /*#__PURE__*/ _plugin_vue_export_helper_default(Header_vue_vue_type_script_lang_default, [["render", _sfc_render$2], ["__scopeId", "data-v-885a5768"]]);
6487
+ var Header_default = /*#__PURE__*/ _plugin_vue_export_helper_default(__default__, [["render", _sfc_render$2], ["__scopeId", "data-v-8f9b1e4b"]]);
6453
6488
  //#endregion
6454
6489
  //#region src/components/layout/NewRowButton.vue?vue&type=script&setup=true&lang.ts
6455
6490
  var _hoisted_1$2 = { class: "sticky-container" };
@@ -7347,6 +7382,8 @@ var TableUI_vue_vue_type_script_lang_default = {
7347
7382
  type: Object,
7348
7383
  default: () => ({})
7349
7384
  },
7385
+ /** Background-color token matching the surface the table is rendered on; sets the header's background. */
7386
+ renderedOnBackgroundColor: renderedOnBackgroundColorProp,
7350
7387
  disableRowHeightTransition: {
7351
7388
  type: Boolean,
7352
7389
  default: false
@@ -8245,6 +8282,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
8245
8282
  class: normalizeClass(["table-header", { "sub-menu-active": $props.subMenuConfig.subMenuItems?.length }]),
8246
8283
  "show-new-column-button": $setup.showNewColumnAndRowButton,
8247
8284
  "selected-header-index": $options.selectedHeaderIndex,
8285
+ "rendered-on-background-color": $props.renderedOnBackgroundColor,
8248
8286
  onHeaderSelect: $options.onSelectAll,
8249
8287
  onColumnSort: $options.onColumnSort,
8250
8288
  onDeleteColumn: $options.onDeleteColumn,
@@ -8275,6 +8313,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
8275
8313
  "class",
8276
8314
  "show-new-column-button",
8277
8315
  "selected-header-index",
8316
+ "rendered-on-background-color",
8278
8317
  "onHeaderSelect",
8279
8318
  "onColumnSort",
8280
8319
  "onDeleteColumn",
@@ -8349,7 +8388,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
8349
8388
  "onPageSizeUpdate"
8350
8389
  ])) : createCommentVNode("", true)], 544)], 4);
8351
8390
  }
8352
- var TableUI_default = /*#__PURE__*/ _plugin_vue_export_helper_default(TableUI_vue_vue_type_script_lang_default, [["render", _sfc_render$1], ["__scopeId", "data-v-bc9c37d0"]]);
8391
+ var TableUI_default = /*#__PURE__*/ _plugin_vue_export_helper_default(TableUI_vue_vue_type_script_lang_default, [["render", _sfc_render$1], ["__scopeId", "data-v-8198a271"]]);
8353
8392
  //#endregion
8354
8393
  //#region src/components/composables/useTableReady.ts
8355
8394
  var useTableReady = ({ onReady }) => {
@@ -8404,6 +8443,8 @@ var TableUIWithAutoSizeCalculation_vue_vue_type_script_lang_default = {
8404
8443
  type: Object,
8405
8444
  default: () => ({})
8406
8445
  },
8446
+ /** Background-color token matching the surface the table is rendered on (forwarded to TableUI). */
8447
+ renderedOnBackgroundColor: renderedOnBackgroundColorProp,
8407
8448
  tableConfig: {
8408
8449
  type: Object,
8409
8450
  default: () => ({})
@@ -8759,6 +8800,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
8759
8800
  "num-rows-below": $props.numRowsBelow,
8760
8801
  "bottom-data": $props.bottomData,
8761
8802
  "row-config": $props.rowConfig,
8803
+ "rendered-on-background-color": $props.renderedOnBackgroundColor,
8762
8804
  "table-config": $props.tableConfig,
8763
8805
  "table-state": $props.tableState,
8764
8806
  "page-config": $props.pageConfig,
@@ -8785,6 +8827,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
8785
8827
  "num-rows-below",
8786
8828
  "bottom-data",
8787
8829
  "row-config",
8830
+ "rendered-on-background-color",
8788
8831
  "table-config",
8789
8832
  "table-state",
8790
8833
  "page-config",
@@ -8818,7 +8861,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
8818
8861
  "onVnodeMounted"
8819
8862
  ])) : createCommentVNode("", true)], 64);
8820
8863
  }
8821
- var TableUIWithAutoSizeCalculation_default = /*#__PURE__*/ _plugin_vue_export_helper_default(TableUIWithAutoSizeCalculation_vue_vue_type_script_lang_default, [["render", _sfc_render], ["__scopeId", "data-v-f0e4039f"]]);
8864
+ var TableUIWithAutoSizeCalculation_default = /*#__PURE__*/ _plugin_vue_export_helper_default(TableUIWithAutoSizeCalculation_vue_vue_type_script_lang_default, [["render", _sfc_render], ["__scopeId", "data-v-8ae322ef"]]);
8822
8865
  //#endregion
8823
8866
  export { PopoverContainer_default as PopoverContainer, TableActionBar_default as TableActionBar, TableUI_default as TableUI, TableUIWithAutoSizeCalculation_default as TableUIWithAutoSizeCalculation, columnSortText, columnTypes, constants_default as constants, defaultPageSize, getMissingValueMessage, isMissingValue, unpackObjectRepresentation, useButtonPopoverInteraction, useColumnSizes };
8824
8867