@guiexpert/table 1.1.103 → 1.1.105

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.
@@ -47,6 +47,16 @@ export declare class EleScope {
47
47
  protected hoverColumn: HTMLDivElement;
48
48
  protected draggingColumn: HTMLDivElement;
49
49
  protected scrollTop: number;
50
+ /**
51
+ * Height of the horizontal scroll bar of {@link scrollViewport} in px, measured in {@link adjustContainersAndRows}.
52
+ * 0 without a horizontal scroll bar and with overlay scroll bars (macOS default, mobile) – they take no space.
53
+ */
54
+ protected horizontalScrollBarHeight: number;
55
+ /**
56
+ * Width of the vertical scroll bar of {@link scrollViewport} in px (at the end of the rows: right, in right-to-left
57
+ * on the left), measured in {@link adjustContainersAndRows}. 0 without one and with overlay scroll bars.
58
+ */
59
+ protected verticalScrollBarWidth: number;
50
60
  protected areaBodyWestGeo: GeoData;
51
61
  protected areaBodyCenterGeo: GeoData;
52
62
  protected areaBodyEastGeo: GeoData;
@@ -135,6 +145,29 @@ export declare class EleScope {
135
145
  * @return {void}
136
146
  */
137
147
  adjustContainersAndRows(): void;
148
+ /**
149
+ * The height the table lays out header, body and footer in: the host height minus a horizontal scroll bar that
150
+ * takes space (see {@link horizontalScrollBarHeight}).
151
+ *
152
+ * @returns {number} px
153
+ * @since 1.1.104
154
+ */
155
+ getLayoutHeight(): number;
156
+ /**
157
+ * The width the table lays out header, body and footer in: the host width minus a vertical scroll bar that takes
158
+ * space (see {@link verticalScrollBarWidth}). A logical width – in right-to-left the bar is on the left.
159
+ *
160
+ * @returns {number} px
161
+ * @since 1.1.104
162
+ */
163
+ getLayoutWidth(): number;
164
+ /**
165
+ * Height of the horizontal scroll bar of the scroll viewport: offsetHeight − clientHeight (the viewport has no
166
+ * border, see the constructor).
167
+ */
168
+ protected measureHorizontalScrollBarHeight(): number;
169
+ /** Width of the vertical scroll bar of the scroll viewport: offsetWidth − clientWidth. */
170
+ protected measureVerticalScrollBarWidth(): number;
138
171
  /**
139
172
  * Position and size of the detail layer (master/detail) in the host – overwritten in {@link RenderScope}.
140
173
  *
@@ -312,6 +312,18 @@ export declare class RenderScope extends EleScope {
312
312
  * @return {undefined}
313
313
  */
314
314
  recalcColumnWidths(clientWidth?: number): void;
315
+ /** `TableModelIf.setParentWidth` – remembers the width for {@link adjustRelativeColumnWidthsToScrollBar}. */
316
+ protected setParentWidth(widthInPixel: number): void;
317
+ /** True if a column has a % or weight width (it depends on the width of the host). */
318
+ protected hasRelativeColumnWidths(): boolean;
319
+ adjustContainersAndRows(): void;
320
+ /**
321
+ * % and weight columns share the width next to the vertical scroll bar. The bar appears (or disappears) only after
322
+ * the rows are laid out – the first layout, rows added or removed, a filter: then the columns were computed for the
323
+ * wrong width – too wide by the width of the bar, so a horizontal scroll bar appeared and covered the last row. Here
324
+ * they are computed again (once – the flag stops a second pass) with the width that is available now.
325
+ */
326
+ protected adjustRelativeColumnWidthsToScrollBar(): void;
315
327
  /**
316
328
  * The width that % and weight columns share: host width minus the fixed west columns and a vertical scroll bar.
317
329
  *
@@ -590,6 +602,10 @@ export declare class RenderScope extends EleScope {
590
602
  private rowNumberWidth?;
591
603
  /** true while the containers are adjusted to a new row number width (no second change in that nested pass). */
592
604
  private adjustingRowNumberWidth;
605
+ /** Guards {@link adjustRelativeColumnWidthsToScrollBar} against re-entry. */
606
+ private adjustingRelativeWidths;
607
+ /** The width % and weight columns were last computed for (`TableModelIf.setParentWidth`), -1 = unknown. */
608
+ protected relativeWidthsBase: number;
593
609
  /** the approximate first width is measured again once (see adjustAfterScrolling). */
594
610
  private rowNumberRemeasureScheduled;
595
611
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guiexpert/table",
3
- "version": "1.1.103",
3
+ "version": "1.1.105",
4
4
  "license": "MIT",
5
5
  "author": "Dr. Marc Kronberg <info@gui.expert> (https://gui.expert)",
6
6
  "repository": {
@@ -69,7 +69,8 @@
69
69
  "docs:check": "node scripts/check-doc-examples.mjs",
70
70
  "test": "vitest run",
71
71
  "test:unit": "vitest run --project unit",
72
- "test:browser": "vitest run --project browser",
72
+ "test:browser": "vitest run --project browser --project browser-scrollbars",
73
+ "test:browser:scrollbars": "GE_ALL_SCROLLBARS=1 vitest run --project browser-scrollbars",
73
74
  "test:watch": "vitest --project unit",
74
75
  "test:coverage": "vitest run --coverage",
75
76
  "test:types": "tsc -p tsconfig.spec.json --noEmit",