@knime/kds-table 6.8.1 → 6.10.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 +35 -0
- package/dist/index.css +51 -29
- package/dist/index.js +168 -104
- package/dist/index.js.map +1 -1
- package/dist/src/components/TableUI.vue.d.ts +6 -1
- package/dist/src/components/TableUI.vue.d.ts.map +1 -1
- package/dist/src/components/TableUIWithAutoSizeCalculation.vue.d.ts +13 -3
- package/dist/src/components/TableUIWithAutoSizeCalculation.vue.d.ts.map +1 -1
- package/dist/src/components/layout/Header.vue.d.ts +5 -0
- package/dist/src/components/layout/Header.vue.d.ts.map +1 -1
- package/dist/src/components/layout/HeaderCell.vue.d.ts.map +1 -1
- package/dist/src/constants.d.ts +13 -0
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/utils/columnHeaderActionButtons.d.ts +21 -0
- package/dist/src/utils/columnHeaderActionButtons.d.ts.map +1 -0
- package/package.json +4 -4
- package/dist/src/components/composables/useHeaderMenuItems.d.ts +0 -12
- package/dist/src/components/composables/useHeaderMenuItems.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1301,6 +1301,29 @@ var spacing = {
|
|
|
1301
1301
|
}
|
|
1302
1302
|
} }
|
|
1303
1303
|
};
|
|
1304
|
+
//#endregion
|
|
1305
|
+
//#region src/constants.ts
|
|
1306
|
+
var HEADER_HORIZONTAL_PADDING = spacing.container["0.5x"].value + spacing.container["0.37x"].value;
|
|
1307
|
+
var HEADER_ACTION_BUTTON_GAP = spacing.container["0.12x"].value;
|
|
1308
|
+
var HEADER_ACTION_BUTTON_WIDTH = dimension.component.width["1.5x"].value;
|
|
1309
|
+
var DELETE_COLUMN_BUTTON_WIDTH = dimension.component.width["2x"].value;
|
|
1310
|
+
/**
|
|
1311
|
+
* The min-width of a column whose header shows the given action buttons, i.e.
|
|
1312
|
+
* the width at which its name has truncated away entirely but the buttons
|
|
1313
|
+
* still fit. Never below {@link MIN_COLUMN_SIZE}. Enforced on the column size
|
|
1314
|
+
* shared with the row cells rather than as a header-only CSS min-width, which
|
|
1315
|
+
* would desync the header cell's width from its column's and shift later
|
|
1316
|
+
* columns out of alignment.
|
|
1317
|
+
*/
|
|
1318
|
+
var minColumnSize = ({ menuButton = false, sortButton = false, deleteButton = false }) => {
|
|
1319
|
+
const buttonWidths = [
|
|
1320
|
+
...menuButton ? [HEADER_ACTION_BUTTON_WIDTH] : [],
|
|
1321
|
+
...sortButton ? [HEADER_ACTION_BUTTON_WIDTH] : [],
|
|
1322
|
+
...deleteButton ? [DELETE_COLUMN_BUTTON_WIDTH] : []
|
|
1323
|
+
];
|
|
1324
|
+
const gaps = Math.max(buttonWidths.length - 1, 0) * HEADER_ACTION_BUTTON_GAP;
|
|
1325
|
+
return Math.max(50, HEADER_HORIZONTAL_PADDING + buttonWidths.reduce((total, width) => total + width, 0) + gaps);
|
|
1326
|
+
};
|
|
1304
1327
|
var SPECIAL_COLUMNS_SIZE = dimension.component.width["2x"].value;
|
|
1305
1328
|
var ROW_BORDER_BOTTOM_WIDTH = border.base.subtle.width.value;
|
|
1306
1329
|
var DEFAULT_ROW_HEIGHT = dimension.component.height["2.5x"].value + ROW_BORDER_BOTTOM_WIDTH;
|
|
@@ -5519,46 +5542,20 @@ var TableActionBar_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
5519
5542
|
}
|
|
5520
5543
|
}), [["__scopeId", "data-v-206732ac"]]);
|
|
5521
5544
|
//#endregion
|
|
5522
|
-
//#region src/
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
handler: (_item, _event) => {
|
|
5537
|
-
onColumnSort(1);
|
|
5538
|
-
},
|
|
5539
|
-
trailingIcon: sortDirection === 1 ? "checkmark" : void 0
|
|
5540
|
-
},
|
|
5541
|
-
{
|
|
5542
|
-
id: "sort-desc",
|
|
5543
|
-
text: sortTexts.descending,
|
|
5544
|
-
handler: (_item, _event) => {
|
|
5545
|
-
onColumnSort(-1);
|
|
5546
|
-
},
|
|
5547
|
-
trailingIcon: sortDirection === -1 ? "checkmark" : void 0
|
|
5548
|
-
},
|
|
5549
|
-
{
|
|
5550
|
-
id: "sort-none",
|
|
5551
|
-
text: "No sorting",
|
|
5552
|
-
handler: (_item, _event) => {
|
|
5553
|
-
onColumnSort(0);
|
|
5554
|
-
},
|
|
5555
|
-
trailingIcon: sortDirection === 0 ? "checkmark" : void 0
|
|
5556
|
-
}
|
|
5557
|
-
]
|
|
5558
|
-
});
|
|
5559
|
-
const menuItems = [...staticItems, ...additionalMenuItems ?? []];
|
|
5560
|
-
return menuItems.length ? menuItems : void 0;
|
|
5561
|
-
};
|
|
5545
|
+
//#region src/utils/columnHeaderActionButtons.ts
|
|
5546
|
+
/**
|
|
5547
|
+
* Which action buttons the header of the given column shows. Mirrors the
|
|
5548
|
+
* conditions HeaderCell.vue renders them under, for the places that need to
|
|
5549
|
+
* know a column's buttons without rendering its header — namely the minimum
|
|
5550
|
+
* width the column needs (see {@link minColumnSize}).
|
|
5551
|
+
*/
|
|
5552
|
+
var columnHeaderActionButtons = ({ column, actionConfig, additionalMenuItems }) => ({
|
|
5553
|
+
menuButton: Boolean(additionalMenuItems?.length),
|
|
5554
|
+
sortButton: Boolean(actionConfig?.enableSorting) && !column.isNotSortable,
|
|
5555
|
+
deleteButton: Boolean(column.deletable)
|
|
5556
|
+
});
|
|
5557
|
+
/** The minimum width the given column needs for its header action buttons. */
|
|
5558
|
+
var minSizeOfColumn = (params) => minColumnSize(columnHeaderActionButtons(params));
|
|
5562
5559
|
//#endregion
|
|
5563
5560
|
//#region ../../node_modules/.pnpm/@vueuse+shared@14.3.0_vue@3.5.40_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.js
|
|
5564
5561
|
/**
|
|
@@ -5700,8 +5697,8 @@ var _hoisted_3 = {
|
|
|
5700
5697
|
class: "sub-header-text-container"
|
|
5701
5698
|
};
|
|
5702
5699
|
var _hoisted_4 = {
|
|
5703
|
-
key:
|
|
5704
|
-
class: "delete-column-button"
|
|
5700
|
+
key: 2,
|
|
5701
|
+
class: "header-action-button delete-column-button"
|
|
5705
5702
|
};
|
|
5706
5703
|
var columnMenuButtonRef = "columnMenuButton";
|
|
5707
5704
|
//#endregion
|
|
@@ -5767,13 +5764,27 @@ var Header_vue_vue_type_script_lang_default = {
|
|
|
5767
5764
|
const mainHeader = useTemplateRef("mainHeader");
|
|
5768
5765
|
const headerText = useTemplateRef("headerText");
|
|
5769
5766
|
const columnDeleteButton = useTemplateRef("columnDeleteButton");
|
|
5767
|
+
const sortButton = useTemplateRef("sortButton");
|
|
5770
5768
|
const columnMenuButton = useTemplateRef(columnMenuButtonRef);
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5769
|
+
/**
|
|
5770
|
+
* Every sortable column of a table with sorting enabled offers the sort button;
|
|
5771
|
+
* there is no separate opt-in for it.
|
|
5772
|
+
*/
|
|
5773
|
+
const showSortButton = computed(() => Boolean(props.actionConfig.enableSorting) && !props.column.isNotSortable);
|
|
5774
|
+
const isSorted = computed(() => props.sortDirection !== 0);
|
|
5775
|
+
const SORT_NEXT_DIRECTION = {
|
|
5776
|
+
0: 1,
|
|
5777
|
+
1: -1,
|
|
5778
|
+
[-1]: 0
|
|
5779
|
+
};
|
|
5780
|
+
/** Cycles unsorted -> ascending -> descending -> unsorted on each click. */
|
|
5781
|
+
const sortNextDirection = computed(() => SORT_NEXT_DIRECTION[props.sortDirection]);
|
|
5782
|
+
const onSortToggle = () => emit("onColumnSort", sortNextDirection.value);
|
|
5783
|
+
/** The width below which this header's action buttons would not fit. */
|
|
5784
|
+
const minSize = computed(() => minColumnSize({
|
|
5785
|
+
menuButton: Boolean(props.additionalMenuItems?.length),
|
|
5786
|
+
sortButton: showSortButton.value,
|
|
5787
|
+
deleteButton: Boolean(props.column.deletable)
|
|
5777
5788
|
}));
|
|
5778
5789
|
const resizeHandleHovered = ref(false);
|
|
5779
5790
|
const headerHovered = ref(false);
|
|
@@ -5800,7 +5811,7 @@ var Header_vue_vue_type_script_lang_default = {
|
|
|
5800
5811
|
const emitColumnResize = () => {
|
|
5801
5812
|
if (!dragging.value) return;
|
|
5802
5813
|
const newColumnSize = columnSizeOnDragStart + (currentPageX - pageXOnDragStart) + autoScrollOffset.value;
|
|
5803
|
-
emit("columnResize", Math.max(newColumnSize,
|
|
5814
|
+
emit("columnResize", Math.max(newColumnSize, minSize.value));
|
|
5804
5815
|
};
|
|
5805
5816
|
const { onPointerDown: startAutoScroll, onPointerMove: updateAutoScroll, onPointerUp: stopAutoScroll } = useAutoScrollOnRightEdge({
|
|
5806
5817
|
scrollContainer,
|
|
@@ -5816,7 +5827,7 @@ var Header_vue_vue_type_script_lang_default = {
|
|
|
5816
5827
|
event.target.setPointerCapture(event.pointerId);
|
|
5817
5828
|
dragging.value = true;
|
|
5818
5829
|
currentDragHandlerHeight = props.getDragHandleHeight();
|
|
5819
|
-
columnSizeOnDragStart = colSizes.value[props.index] ??
|
|
5830
|
+
columnSizeOnDragStart = colSizes.value[props.index] ?? minSize.value;
|
|
5820
5831
|
pageXOnDragStart = event.pageX;
|
|
5821
5832
|
currentPageX = event.pageX;
|
|
5822
5833
|
emit("columnResizeStart");
|
|
@@ -5826,7 +5837,7 @@ var Header_vue_vue_type_script_lang_default = {
|
|
|
5826
5837
|
emit("columnResizeEnd");
|
|
5827
5838
|
if (event.shiftKey) {
|
|
5828
5839
|
const newColumnSize = columnSizeOnDragStart + event.pageX - pageXOnDragStart + autoScrollOffset.value;
|
|
5829
|
-
emit("allColumnsResize",
|
|
5840
|
+
emit("allColumnsResize", newColumnSize);
|
|
5830
5841
|
}
|
|
5831
5842
|
stopAutoScroll();
|
|
5832
5843
|
};
|
|
@@ -5855,15 +5866,18 @@ var Header_vue_vue_type_script_lang_default = {
|
|
|
5855
5866
|
};
|
|
5856
5867
|
const focus = () => {
|
|
5857
5868
|
if (props.tableConfig.enableHeaderCellSelection || props.column.editable) content.value?.focus();
|
|
5858
|
-
else if (
|
|
5869
|
+
else if (props.additionalMenuItems?.length) {
|
|
5859
5870
|
nativeFocusInsideHeader.value = true;
|
|
5860
5871
|
columnMenuButton.value?.menuButtonEl?.$el?.focus();
|
|
5861
5872
|
} else if (props.column.deletable) columnDeleteButton.value?.$el?.focus();
|
|
5873
|
+
else if (showSortButton.value) sortButton.value?.$el?.focus();
|
|
5862
5874
|
};
|
|
5863
|
-
const isFocusable = () => Boolean(props.tableConfig.enableHeaderCellSelection || props.column.editable ||
|
|
5875
|
+
const isFocusable = () => Boolean(props.tableConfig.enableHeaderCellSelection || props.column.editable || props.additionalMenuItems?.length || props.column.deletable || showSortButton.value);
|
|
5864
5876
|
const showMenuButton = computed(() => {
|
|
5865
|
-
return
|
|
5877
|
+
return props.additionalMenuItems?.length && (headerHovered.value || menuOpen.value || nativeFocusInsideHeader.value) && !dragging.value;
|
|
5866
5878
|
});
|
|
5879
|
+
/** Visible on hover/focus like the menu button, and while the column is sorted. */
|
|
5880
|
+
const sortButtonVisible = computed(() => (headerHovered.value || nativeFocusInsideHeader.value || isSorted.value) && !dragging.value);
|
|
5867
5881
|
__expose({
|
|
5868
5882
|
getHeaderCellWidth,
|
|
5869
5883
|
focus,
|
|
@@ -5882,15 +5896,15 @@ var Header_vue_vue_type_script_lang_default = {
|
|
|
5882
5896
|
"colored-header": __props.column.headerColor,
|
|
5883
5897
|
"header-focused": __props.focused || __props.selected
|
|
5884
5898
|
}]),
|
|
5885
|
-
onPointerenter: _cache[
|
|
5886
|
-
onPointerleave: _cache[
|
|
5899
|
+
onPointerenter: _cache[20] || (_cache[20] = ($event) => headerHovered.value = true),
|
|
5900
|
+
onPointerleave: _cache[21] || (_cache[21] = ($event) => headerHovered.value = false),
|
|
5887
5901
|
onFocusin: onThFocusIn,
|
|
5888
5902
|
onFocusout: onThFocusOut
|
|
5889
5903
|
}, [
|
|
5890
5904
|
createElementVNode("div", {
|
|
5891
5905
|
ref_key: "content",
|
|
5892
5906
|
ref: content,
|
|
5893
|
-
class: normalizeClass(["column-header-content",
|
|
5907
|
+
class: normalizeClass(["column-header-content", { "with-button-in-header": showMenuButton.value || __props.column.deletable || sortButtonVisible.value }]),
|
|
5894
5908
|
tabindex: __props.tableConfig.enableHeaderCellSelection || __props.column.editable ? 0 : -1,
|
|
5895
5909
|
onFocus: _cache[0] || (_cache[0] = ($event) => emit("onHeaderCellFocus")),
|
|
5896
5910
|
onBlur: _cache[1] || (_cache[1] = ($event) => emit("onHeaderCellBlur")),
|
|
@@ -5915,48 +5929,71 @@ var Header_vue_vue_type_script_lang_default = {
|
|
|
5915
5929
|
__props.column.header,
|
|
5916
5930
|
"truncated"
|
|
5917
5931
|
]])], 512), __props.column.subHeader ? (openBlock(), createElementBlock("div", _hoisted_3, [renderSlot(_ctx.$slots, "subHeader", { subHeader: __props.column.subHeader }, () => [createTextVNode(toDisplayString(__props.column.subHeader), 1)], true)])) : createCommentVNode("", true)], 42, _hoisted_1$5),
|
|
5918
|
-
__props.
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
onClick: _cache[9] || (_cache[9] = withModifiers(($event) => emit("onDeleteColumn"), ["stop"])),
|
|
5926
|
-
onKeydown: _cache[10] || (_cache[10] = withKeys(withModifiers(($event) => emit("onKeydownDown"), ["prevent", "stop"]), ["down"]))
|
|
5927
|
-
}, null, 512)])) : createCommentVNode("", true),
|
|
5928
|
-
subMenuItems.value?.length ? (openBlock(), createElementBlock("div", {
|
|
5929
|
-
key: 1,
|
|
5930
|
-
class: normalizeClass({ "menu-button-hidden": !showMenuButton.value })
|
|
5932
|
+
__props.additionalMenuItems?.length ? (openBlock(), createElementBlock("div", {
|
|
5933
|
+
key: 0,
|
|
5934
|
+
class: normalizeClass([
|
|
5935
|
+
"header-action-button",
|
|
5936
|
+
"menu-button",
|
|
5937
|
+
{ "action-button-hidden": !showMenuButton.value }
|
|
5938
|
+
])
|
|
5931
5939
|
}, [createVNode(unref(KdsMenuButton), {
|
|
5932
5940
|
ref: columnMenuButtonRef,
|
|
5933
5941
|
modelValue: menuOpen.value,
|
|
5934
|
-
"onUpdate:modelValue": _cache[
|
|
5942
|
+
"onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => menuOpen.value = $event),
|
|
5935
5943
|
ariaLabel: "Table column options",
|
|
5936
|
-
items:
|
|
5944
|
+
items: __props.additionalMenuItems,
|
|
5937
5945
|
size: "small",
|
|
5938
5946
|
variant: "transparent",
|
|
5939
5947
|
"leading-icon": "more-actions",
|
|
5940
|
-
onKeydown: _cache[
|
|
5948
|
+
onKeydown: _cache[10] || (_cache[10] = withKeys(withModifiers(($event) => emit("onKeydownDown"), ["prevent", "stop"]), ["down"]))
|
|
5941
5949
|
}, null, 8, ["modelValue", "items"])], 2)) : createCommentVNode("", true),
|
|
5950
|
+
showSortButton.value ? (openBlock(), createElementBlock("div", {
|
|
5951
|
+
key: 1,
|
|
5952
|
+
class: normalizeClass([
|
|
5953
|
+
"header-action-button",
|
|
5954
|
+
"sort-button",
|
|
5955
|
+
{ "action-button-hidden": !sortButtonVisible.value }
|
|
5956
|
+
])
|
|
5957
|
+
}, [createVNode(unref(KdsToggleButton), {
|
|
5958
|
+
ref_key: "sortButton",
|
|
5959
|
+
ref: sortButton,
|
|
5960
|
+
"model-value": isSorted.value,
|
|
5961
|
+
variant: "transparent",
|
|
5962
|
+
size: "small",
|
|
5963
|
+
"leading-icon": __props.sortDirection === -1 ? "sort-descending" : "sort-ascending",
|
|
5964
|
+
ariaLabel: "Sort",
|
|
5965
|
+
tooltip: "Sort",
|
|
5966
|
+
onKeydown: _cache[11] || (_cache[11] = withKeys(withModifiers(($event) => emit("onKeydownDown"), ["prevent", "stop"]), ["down"])),
|
|
5967
|
+
"onUpdate:modelValue": onSortToggle
|
|
5968
|
+
}, null, 8, ["model-value", "leading-icon"])], 2)) : createCommentVNode("", true),
|
|
5969
|
+
__props.column.deletable ? (openBlock(), createElementBlock("div", _hoisted_4, [createVNode(unref(KdsButton), {
|
|
5970
|
+
ref_key: "columnDeleteButton",
|
|
5971
|
+
ref: columnDeleteButton,
|
|
5972
|
+
variant: "transparent",
|
|
5973
|
+
"leading-icon": "trash",
|
|
5974
|
+
size: "small",
|
|
5975
|
+
ariaLabel: "Delete column",
|
|
5976
|
+
onClick: _cache[12] || (_cache[12] = withModifiers(($event) => emit("onDeleteColumn"), ["stop"])),
|
|
5977
|
+
onKeydown: _cache[13] || (_cache[13] = withKeys(withModifiers(($event) => emit("onKeydownDown"), ["prevent", "stop"]), ["down"]))
|
|
5978
|
+
}, null, 512)])) : createCommentVNode("", true),
|
|
5942
5979
|
__props.tableConfig.enableColumnResizing ? (openBlock(), createElementBlock("div", {
|
|
5943
|
-
key:
|
|
5980
|
+
key: 3,
|
|
5944
5981
|
class: normalizeClass(["resize-handle-area", {
|
|
5945
5982
|
hover: resizeHandleHovered.value && !__props.otherColumnResizing,
|
|
5946
5983
|
drag: dragging.value
|
|
5947
5984
|
}]),
|
|
5948
5985
|
style: normalizeStyle({ height: `${dragHandleHeight(dragging.value)}px` }),
|
|
5949
|
-
onPointerover: _cache[
|
|
5950
|
-
onPointerleave: _cache[
|
|
5951
|
-
onPointerdownPassive: _cache[
|
|
5952
|
-
onPointerupPassive: _cache[
|
|
5953
|
-
onPointermove: _cache[
|
|
5954
|
-
onLostpointercapture: _cache[
|
|
5955
|
-
}, [..._cache[
|
|
5986
|
+
onPointerover: _cache[14] || (_cache[14] = ($event) => resizeHandleHovered.value = true),
|
|
5987
|
+
onPointerleave: _cache[15] || (_cache[15] = ($event) => resizeHandleHovered.value = false),
|
|
5988
|
+
onPointerdownPassive: _cache[16] || (_cache[16] = ($event) => onPointerDown($event)),
|
|
5989
|
+
onPointerupPassive: _cache[17] || (_cache[17] = ($event) => onPointerUp($event)),
|
|
5990
|
+
onPointermove: _cache[18] || (_cache[18] = (...args) => unref(onPointerMove) && unref(onPointerMove)(...args)),
|
|
5991
|
+
onLostpointercapture: _cache[19] || (_cache[19] = (...args) => unref(onLostPointerCapture) && unref(onLostPointerCapture)(...args))
|
|
5992
|
+
}, [..._cache[22] || (_cache[22] = [createElementVNode("span", { class: "resize-handle" }, null, -1)])], 38)) : createCommentVNode("", true)
|
|
5956
5993
|
], 38);
|
|
5957
5994
|
};
|
|
5958
5995
|
}
|
|
5959
|
-
}), [["__scopeId", "data-v-
|
|
5996
|
+
}), [["__scopeId", "data-v-0f9137cc"]])
|
|
5960
5997
|
},
|
|
5961
5998
|
props: {
|
|
5962
5999
|
tableConfig: {
|
|
@@ -6044,19 +6081,32 @@ var Header_vue_vue_type_script_lang_default = {
|
|
|
6044
6081
|
focusedHeaderIndex: null
|
|
6045
6082
|
};
|
|
6046
6083
|
},
|
|
6047
|
-
computed: {
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
}
|
|
6059
|
-
|
|
6084
|
+
computed: {
|
|
6085
|
+
/**
|
|
6086
|
+
* The smallest size that can be given to all columns at once, i.e. the
|
|
6087
|
+
* largest of their individual minimums (see {@link minSizeOfColumn}).
|
|
6088
|
+
*/
|
|
6089
|
+
minSizeForAllColumns() {
|
|
6090
|
+
return this.columns.reduce((max, column, index) => Math.max(max, minSizeOfColumn({
|
|
6091
|
+
column,
|
|
6092
|
+
actionConfig: this.actionConfig,
|
|
6093
|
+
additionalMenuItems: this.additionalHeaderMenuItems[index]
|
|
6094
|
+
})), 50);
|
|
6095
|
+
},
|
|
6096
|
+
headerSelectionOverlayStyle() {
|
|
6097
|
+
const columnIndex = this.selectedHeaderIndex;
|
|
6098
|
+
if (columnIndex === null || !this.tableConfig.enableHeaderCellSelection) return null;
|
|
6099
|
+
let left = 0;
|
|
6100
|
+
if (this.tableConfig.showSelection) left += SPECIAL_COLUMNS_SIZE;
|
|
6101
|
+
if (this.tableConfig.enableRowDeletion) left += SPECIAL_COLUMNS_SIZE;
|
|
6102
|
+
for (let i = 0; i < columnIndex; i++) left += this.columnSize(i);
|
|
6103
|
+
const width = this.columnSize(columnIndex);
|
|
6104
|
+
return {
|
|
6105
|
+
left: `${left}px`,
|
|
6106
|
+
width: `${width}px`
|
|
6107
|
+
};
|
|
6108
|
+
}
|
|
6109
|
+
},
|
|
6060
6110
|
methods: {
|
|
6061
6111
|
columnSize(columnIndex) {
|
|
6062
6112
|
return this.colSizesFrozenWhenResizing[columnIndex] ?? this.minimumColumnWidth;
|
|
@@ -6097,7 +6147,7 @@ var Header_vue_vue_type_script_lang_default = {
|
|
|
6097
6147
|
this.$emit("columnResize", columnIndex, newSize);
|
|
6098
6148
|
},
|
|
6099
6149
|
onAllColumnsResize(newSize) {
|
|
6100
|
-
this.$emit("allColumnsResize", newSize);
|
|
6150
|
+
this.$emit("allColumnsResize", Math.max(newSize, this.minSizeForAllColumns));
|
|
6101
6151
|
},
|
|
6102
6152
|
onColumnSort(columnIndex, direction) {
|
|
6103
6153
|
this.$emit("columnSort", columnIndex, direction);
|
|
@@ -6260,7 +6310,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6260
6310
|
style: normalizeStyle($options.headerSelectionOverlayStyle)
|
|
6261
6311
|
}, null, 6)) : createCommentVNode("", true)]);
|
|
6262
6312
|
}
|
|
6263
|
-
var Header_default = /*#__PURE__*/ _plugin_vue_export_helper_default(Header_vue_vue_type_script_lang_default, [["render", _sfc_render$2], ["__scopeId", "data-v-
|
|
6313
|
+
var Header_default = /*#__PURE__*/ _plugin_vue_export_helper_default(Header_vue_vue_type_script_lang_default, [["render", _sfc_render$2], ["__scopeId", "data-v-885a5768"]]);
|
|
6264
6314
|
//#endregion
|
|
6265
6315
|
//#region src/components/layout/NewRowButton.vue?vue&type=script&setup=true&lang.ts
|
|
6266
6316
|
var _hoisted_1$3 = { class: "sticky-container" };
|
|
@@ -8314,6 +8364,20 @@ var TableUIWithAutoSizeCalculation_vue_vue_type_script_lang_default = {
|
|
|
8314
8364
|
columnIds() {
|
|
8315
8365
|
return getPropertiesFromColumns(this.columns, "id");
|
|
8316
8366
|
},
|
|
8367
|
+
/**
|
|
8368
|
+
* The width each column needs at the very least, i.e. the one at which the
|
|
8369
|
+
* action buttons of its header still fit (see {@link minSizeOfColumn}).
|
|
8370
|
+
*/
|
|
8371
|
+
minColumnSizes() {
|
|
8372
|
+
return this.columns.reduce((minSizes, column, index) => {
|
|
8373
|
+
minSizes[column.id] = minSizeOfColumn({
|
|
8374
|
+
column,
|
|
8375
|
+
actionConfig: this.actionConfig,
|
|
8376
|
+
additionalMenuItems: this.additionalHeaderMenuItems[index]
|
|
8377
|
+
});
|
|
8378
|
+
return minSizes;
|
|
8379
|
+
}, {});
|
|
8380
|
+
},
|
|
8317
8381
|
currentColumnsWithAutoSize() {
|
|
8318
8382
|
return /* @__PURE__ */ new Set([...Reflect.ownKeys(this.currentColumnSizes), ...Reflect.ownKeys(this.currentHeightsByColumn)]);
|
|
8319
8383
|
},
|
|
@@ -8429,7 +8493,7 @@ var TableUIWithAutoSizeCalculation_vue_vue_type_script_lang_default = {
|
|
|
8429
8493
|
sizesToUpdate: this.currentColumnSizes,
|
|
8430
8494
|
autoSizesByRow: autoColumnSizes,
|
|
8431
8495
|
fixedSizes: this.autoColumnSizesOptions.fixedSizes,
|
|
8432
|
-
minSize: 50,
|
|
8496
|
+
minSize: (columnId) => this.minColumnSizes[columnId] ?? 50,
|
|
8433
8497
|
paddings: this.columnPaddingsHorizontal
|
|
8434
8498
|
});
|
|
8435
8499
|
},
|
|
@@ -8438,7 +8502,7 @@ var TableUIWithAutoSizeCalculation_vue_vue_type_script_lang_default = {
|
|
|
8438
8502
|
sizesToUpdate: this.currentHeightsByColumn,
|
|
8439
8503
|
autoSizesByRow: autoRowHeights,
|
|
8440
8504
|
fixedSizes: this.autoRowHeightOptions.fixedHeights,
|
|
8441
|
-
minSize: MIN_ROW_HEIGHT
|
|
8505
|
+
minSize: () => MIN_ROW_HEIGHT
|
|
8442
8506
|
});
|
|
8443
8507
|
},
|
|
8444
8508
|
async calculateAutoSizes() {
|
|
@@ -8447,8 +8511,8 @@ var TableUIWithAutoSizeCalculation_vue_vue_type_script_lang_default = {
|
|
|
8447
8511
|
const headerComputesColumns = this.autoColumnSizeCalculationRequired && this.autoColumnSizesOptions.calculateForHeader;
|
|
8448
8512
|
const bodyComputesRows = this.autoRowHeightSizingActive;
|
|
8449
8513
|
const computeColumns = this.autoColumnSizeCalculationRequired;
|
|
8450
|
-
if (computeColumns) this.currentColumnSizes = this.initializeSizesWithMinSize(50);
|
|
8451
|
-
if (bodyComputesRows) this.currentHeightsByColumn = this.initializeSizesWithMinSize(MIN_ROW_HEIGHT);
|
|
8514
|
+
if (computeColumns) this.currentColumnSizes = this.initializeSizesWithMinSize((columnId) => this.minColumnSizes[columnId] ?? 50);
|
|
8515
|
+
if (bodyComputesRows) this.currentHeightsByColumn = this.initializeSizesWithMinSize(() => MIN_ROW_HEIGHT);
|
|
8452
8516
|
if (bodyComputesColumns || bodyComputesRows) {
|
|
8453
8517
|
const { autoColumnSizes, autoRowHeights } = this.calculateAutoSizesBody();
|
|
8454
8518
|
if (bodyComputesRows) this.setAutoRowHeights(autoRowHeights);
|
|
@@ -8463,12 +8527,12 @@ var TableUIWithAutoSizeCalculation_vue_vue_type_script_lang_default = {
|
|
|
8463
8527
|
initializeSizesWithMinSize(minSize) {
|
|
8464
8528
|
return this.columnIds.reduce((sizes, columnId) => ({
|
|
8465
8529
|
...sizes,
|
|
8466
|
-
[columnId]: minSize
|
|
8530
|
+
[columnId]: minSize(columnId)
|
|
8467
8531
|
}), {});
|
|
8468
8532
|
},
|
|
8469
8533
|
addFixedAndAutoSizes({ sizesToUpdate, autoSizesByRow, fixedSizes, minSize, paddings = null }) {
|
|
8470
8534
|
Reflect.ownKeys(fixedSizes).forEach((columnId) => {
|
|
8471
|
-
if (sizesToUpdate.hasOwnProperty(columnId)) sizesToUpdate[columnId] = Math.max(minSize, fixedSizes[columnId] + (paddings?.[columnId] || 0));
|
|
8535
|
+
if (sizesToUpdate.hasOwnProperty(columnId)) sizesToUpdate[columnId] = Math.max(minSize(columnId), fixedSizes[columnId] + (paddings?.[columnId] || 0));
|
|
8472
8536
|
});
|
|
8473
8537
|
autoSizesByRow.forEach((autoSizes) => {
|
|
8474
8538
|
Reflect.ownKeys(autoSizes).forEach((columnId) => {
|
|
@@ -8605,7 +8669,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
8605
8669
|
"onVnodeMounted"
|
|
8606
8670
|
])) : createCommentVNode("", true)], 64);
|
|
8607
8671
|
}
|
|
8608
|
-
var TableUIWithAutoSizeCalculation_default = /*#__PURE__*/ _plugin_vue_export_helper_default(TableUIWithAutoSizeCalculation_vue_vue_type_script_lang_default, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
8672
|
+
var TableUIWithAutoSizeCalculation_default = /*#__PURE__*/ _plugin_vue_export_helper_default(TableUIWithAutoSizeCalculation_vue_vue_type_script_lang_default, [["render", _sfc_render], ["__scopeId", "data-v-f3ef2f4b"]]);
|
|
8609
8673
|
//#endregion
|
|
8610
8674
|
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 };
|
|
8611
8675
|
|