@guiexpert/table 1.1.102 → 1.1.104

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.
@@ -44,8 +44,6 @@ export declare class ColumnDef implements ColumnDefIf {
44
44
  width: SizeIf;
45
45
  classes: AreaObjectMapType<string[]>;
46
46
  rendererMap: AreaObjectMapType<CellRendererIf>;
47
- minWidth: SizeIf;
48
- maxWidth: SizeIf;
49
47
  sortable?: BooleanFunction | undefined;
50
48
  sortComparator?: ValueRowSortComparator | undefined;
51
49
  sortState?: SortState | undefined;
@@ -73,6 +71,10 @@ export declare class ColumnDef implements ColumnDefIf {
73
71
  emptyValue?: unknown;
74
72
  /** `false`: no cell formulas in this column, see {@link ColumnDefIf.cellFormulas} (since 1.1.99). */
75
73
  cellFormulas?: boolean;
74
+ /** Lower limit for % widths and for resizing with the mouse, see {@link ColumnDefIf.minWidth}. Default `0px`. */
75
+ minWidth: SizeIf;
76
+ /** Upper limit for % widths and for resizing with the mouse, see {@link ColumnDefIf.maxWidth}. Default `100000px`. */
77
+ maxWidth: SizeIf;
76
78
  constructor(property: string, headerLabel: string, width?: SizeIf, classes?: AreaObjectMapType<string[]>, rendererMap?: AreaObjectMapType<CellRendererIf>, minWidth?: SizeIf, maxWidth?: SizeIf, sortable?: BooleanFunction | undefined, sortComparator?: ValueRowSortComparator | undefined, sortState?: SortState | undefined, sortStatesOrder?: SortState[] | undefined, sortIconVisible?: BooleanFunction | undefined, editable?: BooleanFunction | undefined, getEditRenderer?: GetEditRenderer | undefined, editInputPipe?: editInputPipe | undefined, isVisible?: BooleanFunction);
77
79
  static bodyRenderer(bodyRenderer: CellRendererIf): AreaObjectMap<CellRendererIf>;
78
80
  /**
@@ -96,9 +98,9 @@ export declare class ColumnDef implements ColumnDefIf {
96
98
  headerLabel?: string;
97
99
  /** Width, default 100 px. */
98
100
  width?: SizeIf;
99
- /** Lower limit for % widths. */
101
+ /** Lower limit for % widths and for resizing with the mouse (default `0px`). */
100
102
  minWidth?: SizeIf;
101
- /** Upper limit for % widths. */
103
+ /** Upper limit for % widths and for resizing with the mouse (default `100000px`). */
102
104
  maxWidth?: SizeIf;
103
105
  /** Renderer of the header cell. */
104
106
  headerRenderer?: CellRendererIf;
@@ -57,9 +57,15 @@ export interface ColumnDefIf {
57
57
  headerLabel: string;
58
58
  /** Width of the column: `px120`, `new Size(10, "%")` or `new Size(1, "weight")`. See {@link SizeUnitType}. */
59
59
  width: SizeIf;
60
- /** Lower limit for percentage widths (`"%"`). Not applied to pixel widths or to resizing with the mouse. */
60
+ /**
61
+ * Lower limit of the column width: applied to percentage widths (`"%"`) and, since 1.1.103, when the user resizes the
62
+ * column with the mouse. A pixel width itself is not changed. `ColumnDef` default: `0px` (no limit).
63
+ */
61
64
  minWidth: SizeIf;
62
- /** Upper limit for percentage widths (`"%"`). Not applied to pixel widths or to resizing with the mouse. */
65
+ /**
66
+ * Upper limit of the column width: applied to percentage widths (`"%"`) and, since 1.1.103, when the user resizes the
67
+ * column with the mouse. `ColumnDef` default: `100000px` (no limit).
68
+ */
63
69
  maxWidth: SizeIf;
64
70
  /**
65
71
  * Cell renderers per area – `rendererMap.header`, `.body`, `.footer`.
@@ -47,6 +47,8 @@ export declare class TableModel implements TableModelIf {
47
47
  protected columnCount: number;
48
48
  protected parentSize: number;
49
49
  getSelectionModel: GetT<SelectionModelIf>;
50
+ /** Width in px of a column without ColumnDef and without `columnSizes` (like the default of `ColumnDef`). */
51
+ protected static readonly DEFAULT_COLUMN_WIDTH = 100;
50
52
  protected rowCount: number;
51
53
  protected contentHeightInPx: number;
52
54
  protected contentWidthInPx: number;
@@ -39,10 +39,10 @@ export declare class EleScope {
39
39
  protected areaFooterCenter: DivScope;
40
40
  protected areaFooterWest: DivScope;
41
41
  protected areaFooterEast: DivScope;
42
- protected borderHeaderBottom: HTMLDivElement;
43
- protected borderFooterTop: HTMLDivElement;
44
- protected borderFixedWest: HTMLDivElement;
45
- protected borderFixedEast: HTMLDivElement;
42
+ protected borderHeaderBottom?: HTMLDivElement;
43
+ protected borderFooterTop?: HTMLDivElement;
44
+ protected borderFixedWest?: HTMLDivElement;
45
+ protected borderFixedEast?: HTMLDivElement;
46
46
  protected hoverRow: HTMLDivElement;
47
47
  protected hoverColumn: HTMLDivElement;
48
48
  protected draggingColumn: HTMLDivElement;
@@ -990,6 +990,14 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
990
990
  * @param {GeMouseEvent} mouseEvent - The mouse event that triggered the resize.
991
991
  */
992
992
  private resizeColumn;
993
+ /**
994
+ * Limits a column width to `ColumnDefIf.minWidth` / `maxWidth` (since 1.1.103: mouse resizing and
995
+ * {@link autoResizeColumns}). `px` limits are taken as they are, `%` limits relative to the width that % columns share
996
+ * (host minus fixed west columns and scroll bar, like the layout); `weight` limits and `%` limits without a host
997
+ * width are ignored. With `startWidth` (dragging) a width that is already outside the limits does not jump: the
998
+ * limits are widened to include it, so the user can only move towards the allowed range.
999
+ */
1000
+ private clampToColumnWidthLimits;
993
1001
  /**
994
1002
  * Clears the selection model, if available.
995
1003
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guiexpert/table",
3
- "version": "1.1.102",
3
+ "version": "1.1.104",
4
4
  "license": "MIT",
5
5
  "author": "Dr. Marc Kronberg <info@gui.expert> (https://gui.expert)",
6
6
  "repository": {