@mmlogic/components 0.5.10 → 0.5.12

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.
@@ -15,8 +15,14 @@ export declare class MrdTable {
15
15
  private keydownHandler;
16
16
  private createPickerClickHandler;
17
17
  private viewPopoverClickHandler;
18
+ /** Watches the host for gaining a box (e.g. its tab pane being shown) — see componentDidLoad. */
19
+ private resizeObserver;
18
20
  /** Guards against scheduling more than one column-width measurement per freeze. */
19
21
  private colWidthMeasureScheduled;
22
+ /** True once the header/totals widths have been checked against the current totals row. */
23
+ private fixedContentMeasured;
24
+ /** Guards against scheduling more than one grow pass. */
25
+ private growScheduled;
20
26
  /** Drag origin of the running column resize (null = no drag in progress). */
21
27
  private resizeOrigin;
22
28
  /** True once the user has dragged (or auto-fitted) a column — see colWidthsUserSet usages. */
@@ -160,12 +166,31 @@ export declare class MrdTable {
160
166
  setAggregations(data: AggregationResult): Promise<void>;
161
167
  disconnectedCallback(): void;
162
168
  componentDidRender(): void;
169
+ /** Freeze the column widths once the first data page has rendered.
170
+ *
171
+ * The measurement reads layout and writes the colWidths @State, which would trigger a
172
+ * re-render *during* the render cycle if done synchronously from componentDidRender. It is
173
+ * deferred to a writeTask so the state mutation happens outside the render pass (avoids the
174
+ * Stencil "state/prop changed during rendering" warning and potential loops).
175
+ *
176
+ * NB: the freeze must not depend on the totalElements prop — hosts may omit it and rely on
177
+ * minKnownTotal, in which case the widths would never be locked and every incoming page
178
+ * would re-flow all columns. */
179
+ private freezeColWidths;
163
180
  /** Current rendered header widths, or null when they can't be trusted (header not laid out yet). */
164
181
  private measureColWidths;
165
182
  /** Width one cell needs to show its content in full, borders included.
166
183
  * Read from scrollWidth rather than the laid-out box: cells clip with `overflow: hidden`,
167
184
  * so a squeezed cell reports the width it *was given*, not the width it needs. */
168
185
  private neededWidth;
186
+ /** Width a header cell needs, measured from its children instead of the cell's own
187
+ * scrollWidth. A header is not just text: it holds the label plus a sort icon (and a filter
188
+ * icon once the column is filtered), with the drag handle absolutely positioned on top of
189
+ * the right padding. Summing the in-flow children makes the icons part of the width by
190
+ * construction — and a child's own rect is never clipped by the header's `overflow: hidden`,
191
+ * so it stays correct even when the header is already truncated on screen.
192
+ * Returns 0 when nothing can be measured, so callers fall back to neededWidth(). */
193
+ private neededHeaderWidth;
169
194
  /** Width each column needs for its header and its rendered page-0 cells — what the columns
170
195
  * are locked to, so they never end up narrower than their content.
171
196
  *
@@ -175,6 +200,20 @@ export declare class MrdTable {
175
200
  * exceed the container again, and `.mrd-table__scroll` scrolls. Capped per column at
176
201
  * MAX_AUTOFIT_WIDTH so one outlier value can't blow up the layout — same cap as auto-fit. */
177
202
  private measureContentWidths;
203
+ /** Data and totals cells of one column. The totals row is included everywhere the data
204
+ * cells are: it is fixed, always-visible content, so it must never be clipped. */
205
+ private columnCellSelector;
206
+ /** Width the header and totals cells of each column need. Null when nothing has a box. */
207
+ private measureFixedContentWidths;
208
+ /** Widen columns whose header or totals cell does not fit. Data cells may be ellipsised —
209
+ * that is what the lock is for — but the header and the totals row are fixed content that
210
+ * is always on screen, so clipping them just hides information with no way to reveal it.
211
+ *
212
+ * It runs as a second pass because the totals only arrive with setAggregations(), long
213
+ * after the widths were frozen on page 0. Grow-only and once per totals change, so it can
214
+ * never turn into the per-page re-proportioning the lock exists to prevent. Hand-set
215
+ * widths are left alone. */
216
+ private growToFixedContent;
178
217
  /** Re-reads the rendered header widths into colWidths so a drag starts from what is
179
218
  * actually on screen — and locks the columns if they weren't locked yet.
180
219
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmlogic/components",
3
- "version": "0.5.10",
3
+ "version": "0.5.12",
4
4
  "description": "Stencil.js web component library for dynamic forms and virtual-scroll data tables",
5
5
  "license": "MIT",
6
6
  "author": "Mosterd",