@ixfx/components 0.9.6 → 0.9.7

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.
@@ -207,6 +207,14 @@ declare class DataGridElement extends LitElement {
207
207
  dispatch(commandId: CommandId, args?: Record<string, unknown>): void;
208
208
  private _onFocusOut;
209
209
  protected firstUpdated(): void;
210
+ /**
211
+ * Force a fresh re-measure of the viewport and re-render. Normally
212
+ * unnecessary — a `ResizeObserver` tracks the viewport automatically — but
213
+ * gives a consumer an escape hatch to recover if an ancestor's
214
+ * layout/visibility changes without the observer noticing (matches
215
+ * `ixfx-grid-list`'s `refreshLayout()`).
216
+ */
217
+ refreshLayout(): void;
210
218
  protected updated(changed: Map<string, unknown>): void;
211
219
  protected willUpdate(changed: Map<string, unknown>): void;
212
220
  private _getGroupKey;
@@ -292,4 +300,4 @@ interface DataGridElement {
292
300
  }
293
301
  //#endregion
294
302
  export { DataGridGroupBy as A, DataGridColumn as C, DataGridEditorFactory as D, DataGridEditorContext as E, DataGridSortState as F, GlobalFormatter as I, DataGridInteractionMode as M, DataGridSelectionMode as N, DataGridEditorType as O, DataGridSortDirection as P, BuiltInFormatterOptions as S, DataGridEditability as T, DataGridSelectDetail as _, DataGridColumnReorderDetail as a, DataGridSortEvent as b, DataGridColumnResizeEvent as c, DataGridElement as d, DataGridElementEventMap as f, DataGridRowActivateEvent as g, DataGridRowActivateDetail as h, DataGridCellEditEvent as i, DataGridGroupLabel as j, DataGridGetRowKey as k, DataGridColumnVisibilityDetail as l, DataGridGroupChangeEvent as m, DataGridCellClickEvent as n, DataGridColumnReorderEvent as o, DataGridGroupChangeDetail as p, DataGridCellEditDetail as r, DataGridColumnResizeDetail as s, DataGridCellClickDetail as t, DataGridColumnVisibilityEvent as u, DataGridSelectEvent as v, DataGridColumnMenu as w, BuiltInFormatterName as x, DataGridSortDetail as y };
295
- //# sourceMappingURL=data-grid-DIHhfsqS.d.ts.map
303
+ //# sourceMappingURL=data-grid-8N0Kd5-6.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-grid-DIHhfsqS.d.ts","names":[],"sources":["../src/data-grid/types.ts","../src/data-grid/data-grid.ts"],"mappings":";;;;;;KAAY;KACA;KACA;KACA;WAA+B;WAAsB,WAAW;;KAChE;KAEA,sBAAsB;WACvB,KAAK;WACL,QAAQ,eAAe;WACvB;WACA;WACA;EACT,SAAS;EACT;;KAEU,sBAAsB,gBAAgB,KAAK,sBAAsB;KAEjE,eAAe;EACzB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,UAAU,GAAG,GAAG,GAAG;EACnB;EACA;EACA;EACA,YAAY,KAAK,GAAG,KAAK,eAAe,IAAI;EAC5C;EACA;EACA;EACA,SAAS,qBAAqB,sBAAsB;EACpD,gBAAgB;IAAyB;IAAe;;EACxD,aAAa,gBAAgB,KAAK,GAAG,KAAK,eAAe;;KAG/C,mBAAmB,gBAAgB,oBAAoB;KAEvD;KAEA;KACA;EAA4B;;KAE5B,kBAAkB,MAAM,KAAK,GAAG;KAChC,gBAAgB,gBAAgB,KAAK;KACrC,sBAAsB,kBAAkB;;KAGxC;;;KCpBA;WAAgC,MAAM;WAA4B,UAAU;;KAC5E,oBAAoB,YAAY;KAChC;WAAkC,cAAc;WAA8B,UAAU;;KACxF,sBAAsB,YAAY;KAClC;WAAyC;WAAuB;WAAqB,kBAAkB;;KACvG,6BAA6B,YAAY;KACzC;WAAwC;WAAsB;;KAC9D,4BAA4B,YAAY;KACxC;WAA4C;WAAsB;;KAClE,gCAAgC,YAAY;KAC5C;WAAqC;WAAyB;WAAyB;WAA2B;;KAClH,yBAAyB,YAAY;KACrC;WAAoC;WAAyB;WAAyB;WAA4B;;KAClH,wBAAwB,YAAY;KAEpC;WAAuC,SAAS;;KAChD,2BAA2B,YAAY;KACvC;WAAuC;WAAyB;WAAuB;;KACvF,2BAA2B,YAAY;UAClC;EACf,iBAAiB;EACjB,mBAAmB;EACnB,2BAA2B;EAC3B,0BAA0B;EAC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AAiB,OAAO,wBAAwB,aAAa,oBAAoB,sCAAsC,cAAc,UAAU,oCAAoC,oBAAoB;EAC9R,uBAAuB,gBAAgB,yBAAyB,MAAM,GAAG,WAAW,MAAM,iBAAiB,OAAO,wBAAwB,aAAa,oBAAoB,mCAAmC,cAAc,UAAU,oCAAoC,oBAAoB"}
1
+ {"version":3,"file":"data-grid-8N0Kd5-6.d.ts","names":[],"sources":["../src/data-grid/types.ts","../src/data-grid/data-grid.ts"],"mappings":";;;;;;KAAY;KACA;KACA;KACA;WAA+B;WAAsB,WAAW;;KAChE;KAEA,sBAAsB;WACvB,KAAK;WACL,QAAQ,eAAe;WACvB;WACA;WACA;EACT,SAAS;EACT;;KAEU,sBAAsB,gBAAgB,KAAK,sBAAsB;KAEjE,eAAe;EACzB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,UAAU,GAAG,GAAG,GAAG;EACnB;EACA;EACA;EACA,YAAY,KAAK,GAAG,KAAK,eAAe,IAAI;EAC5C;EACA;EACA;EACA,SAAS,qBAAqB,sBAAsB;EACpD,gBAAgB;IAAyB;IAAe;;EACxD,aAAa,gBAAgB,KAAK,GAAG,KAAK,eAAe;;KAG/C,mBAAmB,gBAAgB,oBAAoB;KAEvD;KAEA;KACA;EAA4B;;KAE5B,kBAAkB,MAAM,KAAK,GAAG;KAChC,gBAAgB,gBAAgB,KAAK;KACrC,sBAAsB,kBAAkB;;KAGxC;;;KCpBA;WAAgC,MAAM;WAA4B,UAAU;;KAC5E,oBAAoB,YAAY;KAChC;WAAkC,cAAc;WAA8B,UAAU;;KACxF,sBAAsB,YAAY;KAClC;WAAyC;WAAuB;WAAqB,kBAAkB;;KACvG,6BAA6B,YAAY;KACzC;WAAwC;WAAsB;;KAC9D,4BAA4B,YAAY;KACxC;WAA4C;WAAsB;;KAClE,gCAAgC,YAAY;KAC5C;WAAqC;WAAyB;WAAyB;WAA2B;;KAClH,yBAAyB,YAAY;KACrC;WAAoC;WAAyB;WAAyB;WAA4B;;KAClH,w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A;UA2BA;UAYA;UAkCA;EAoBR;IAAqB;IAAkB;IAAgB;IAAkB;;;EAUzE;UAKQ;UAaA;YAQW,wBAAM;;QA6MnB;YACI;IAAwB,kBAAkB;;;UAErC;EACf,oBAAoB,gBAAgB,yBAAyB,MAAM,GAAG,WAAW,MAAM,iBAAiB,OAAO,wBAAwB,aAAa,oBAAoB,sCAAsC,cAAc,UAAU,oCAAoC,oBAAoB;EAC9R,uBAAuB,gBAAgB,yBAAyB,MAAM,GAAG,WAAW,MAAM,iBAAiB,OAAO,wBAAwB,aAAa,oBAAoB,mCAAmC,cAAc,UAAU,oCAAoC,oBAAoB"}
@@ -1,3 +1,3 @@
1
1
  import { F as ListDragSource, I as ListNativeDragStartDetail, L as ListNativeDragStartEvent, M as ListDragPreview, N as ListDragPreviewContext, P as ListDragPreviewRenderer, j as ListDragEntry } from "./tree-component-BW2iCFq9.js";
2
- import { A as DataGridGroupBy, C as DataGridColumn, D as DataGridEditorFactory, E as DataGridEditorContext, F as DataGridSortState, I as GlobalFormatter, M as DataGridInteractionMode, N as DataGridSelectionMode, O as DataGridEditorType, P as DataGridSortDirection, S as BuiltInFormatterOptions, T as DataGridEditability, _ as DataGridSelectDetail, a as DataGridColumnReorderDetail, b as DataGridSortEvent, c as DataGridColumnResizeEvent, d as DataGridElement, f as DataGridElementEventMap, g as DataGridRowActivateEvent, h as DataGridRowActivateDetail, i as DataGridCellEditEvent, j as DataGridGroupLabel, k as DataGridGetRowKey, l as DataGridColumnVisibilityDetail, m as DataGridGroupChangeEvent, n as DataGridCellClickEvent, o as DataGridColumnReorderEvent, p as DataGridGroupChangeDetail, r as DataGridCellEditDetail, s as DataGridColumnResizeDetail, t as DataGridCellClickDetail, u as DataGridColumnVisibilityEvent, v as DataGridSelectEvent, w as DataGridColumnMenu, x as BuiltInFormatterName, y as DataGridSortDetail } from "./data-grid-DIHhfsqS.js";
2
+ import { A as DataGridGroupBy, C as DataGridColumn, D as DataGridEditorFactory, E as DataGridEditorContext, F as DataGridSortState, I as GlobalFormatter, M as DataGridInteractionMode, N as DataGridSelectionMode, O as DataGridEditorType, P as DataGridSortDirection, S as BuiltInFormatterOptions, T as DataGridEditability, _ as DataGridSelectDetail, a as DataGridColumnReorderDetail, b as DataGridSortEvent, c as DataGridColumnResizeEvent, d as DataGridElement, f as DataGridElementEventMap, g as DataGridRowActivateEvent, h as DataGridRowActivateDetail, i as DataGridCellEditEvent, j as DataGridGroupLabel, k as DataGridGetRowKey, l as DataGridColumnVisibilityDetail, m as DataGridGroupChangeEvent, n as DataGridCellClickEvent, o as DataGridColumnReorderEvent, p as DataGridGroupChangeDetail, r as DataGridCellEditDetail, s as DataGridColumnResizeDetail, t as DataGridCellClickDetail, u as DataGridColumnVisibilityEvent, v as DataGridSelectEvent, w as DataGridColumnMenu, x as BuiltInFormatterName, y as DataGridSortDetail } from "./data-grid-8N0Kd5-6.js";
3
3
  export { type BuiltInFormatterName, type BuiltInFormatterOptions, DataGridCellClickDetail, DataGridCellClickEvent, DataGridCellEditDetail, DataGridCellEditEvent, type DataGridColumn, type DataGridColumnMenu, DataGridColumnReorderDetail, DataGridColumnReorderEvent, DataGridColumnResizeDetail, DataGridColumnResizeEvent, DataGridColumnVisibilityDetail, DataGridColumnVisibilityEvent, type DataGridEditability, type DataGridEditorContext, type DataGridEditorFactory, type DataGridEditorType, DataGridElement, DataGridElementEventMap, type DataGridGetRowKey, type DataGridGroupBy, DataGridGroupChangeDetail, DataGridGroupChangeEvent, type DataGridGroupLabel, type DataGridInteractionMode, DataGridRowActivateDetail, DataGridRowActivateEvent, DataGridSelectDetail, DataGridSelectEvent, type DataGridSelectionMode, DataGridSortDetail, type DataGridSortDirection, DataGridSortEvent, type DataGridSortState, type GlobalFormatter, type ListDragEntry, type ListDragPreview, type ListDragPreviewContext, type ListDragPreviewRenderer, type ListDragSource, type ListNativeDragStartDetail, type ListNativeDragStartEvent };
package/dist/data-grid.js CHANGED
@@ -408,6 +408,7 @@ let DataGridElement = class DataGridElement extends LitElement {
408
408
  `
409
409
  ];
410
410
  }
411
+ #viewportResizeObserver;
411
412
  #nativeDragging;
412
413
  #dragOriginKey;
413
414
  #postDragSuppressTimer;
@@ -525,6 +526,8 @@ let DataGridElement = class DataGridElement extends LitElement {
525
526
  clearTimeout(this.#postDragSuppressTimer);
526
527
  this.#postDragSuppressTimer = 0;
527
528
  }
529
+ this.#viewportResizeObserver?.disconnect();
530
+ this.#viewportResizeObserver = void 0;
528
531
  }
529
532
  /**
530
533
  * Dispatch a command to this grid — routes through the command registry so
@@ -534,14 +537,35 @@ let DataGridElement = class DataGridElement extends LitElement {
534
537
  this.#searchRegistry?.invoke(commandId, args);
535
538
  }
536
539
  firstUpdated() {
537
- new ResizeObserver(() => {
538
- if (!this._viewportEl) return;
539
- this._viewportH = this._viewportEl.clientHeight;
540
- this._viewportW = this._viewportEl.clientWidth;
541
- this.requestUpdate();
542
- }).observe(this._viewportEl);
543
- this._viewportH = this._viewportEl.clientHeight;
544
- this._viewportW = this._viewportEl.clientWidth;
540
+ this.#viewportResizeObserver = new ResizeObserver(() => this.#measureViewport());
541
+ this.#viewportResizeObserver.observe(this._viewportEl);
542
+ this.#measureViewport();
543
+ }
544
+ /**
545
+ * Re-read the viewport's size and update `_viewportH`/`_viewportW` if it
546
+ * changed. A zero-sized read (e.g. while hosted in a hidden/inactive dock
547
+ * tab) is ignored so it never clobbers the last known-good geometry — the
548
+ * observer fires again with the real size once the host becomes visible.
549
+ */
550
+ #measureViewport() {
551
+ if (!this._viewportEl) return;
552
+ const w = this._viewportEl.clientWidth;
553
+ const h = this._viewportEl.clientHeight;
554
+ if (w <= 0 || h <= 0) return;
555
+ if (w === this._viewportW && h === this._viewportH) return;
556
+ this._viewportW = w;
557
+ this._viewportH = h;
558
+ }
559
+ /**
560
+ * Force a fresh re-measure of the viewport and re-render. Normally
561
+ * unnecessary — a `ResizeObserver` tracks the viewport automatically — but
562
+ * gives a consumer an escape hatch to recover if an ancestor's
563
+ * layout/visibility changes without the observer noticing (matches
564
+ * `ixfx-grid-list`'s `refreshLayout()`).
565
+ */
566
+ refreshLayout() {
567
+ this.#measureViewport();
568
+ this.requestUpdate();
545
569
  }
546
570
  updated(changed) {
547
571
  super.updated(changed);
@@ -1299,7 +1323,7 @@ let DataGridElement = class DataGridElement extends LitElement {
1299
1323
  const visibleFlat = this._flat.slice(startRow, endRow);
1300
1324
  const showCheckbox = this.interactionMode === `checked`;
1301
1325
  return html`
1302
- <div class="grid" style="height:400px">
1326
+ <div class="grid">
1303
1327
  <div class="header-bar">
1304
1328
  <div class="header-scroll">
1305
1329
  ${showCheckbox ? html`<div class="header-cell checkbox-col"></div>` : nothing}