@orangelogic/design-system 2.183.0 → 2.184.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.
@@ -17350,6 +17350,9 @@ class uu extends Ji {
17350
17350
  }
17351
17351
  const Bt = process.env.NODE_ENV === "development", pu = x`<div class="tabulator-tableholder-wrapper"></div>`;
17352
17352
  class fu extends Me {
17353
+ constructor(e) {
17354
+ super(e), this.headerWidthObserver = null, this.headerWidthSyncFrame = null, this.element = this.createHolderElement(), this.wrapperElement = this.createWrapperElement(), this.wrapperElement.appendChild(this.element), this.tableElement = this.createTableElement(), this.heightFixer = this.createTableElement(), this.placeholder = null, this.placeholderContents = null, this.firstRender = !1, this.renderMode = "virtual", this.rows = [], this.activeRowsPipeline = [], this.activeRows = [], this.activeRowsCount = 0, this.displayRows = [], this.displayRowsCount = 0, this.scrollTop = 0, this.scrollLeft = 0, this.redrawBlock = !1, this.redrawBlockRestoreConfig = !1, this.redrawBlockRenderInPosition = !1, this.dataPipeline = [], this.displayPipeline = [], this.scrollbarWidth = 0, this.renderer = null, this.rowIndexMap = /* @__PURE__ */ new Map();
17355
+ }
17353
17356
  /**
17354
17357
  * True when table has an explicit height (--table-height is set to a non-auto value (e.g. 100%, 500px));
17355
17358
  * false when height is variable (--table-height is "auto" or unset).
@@ -17358,9 +17361,6 @@ class fu extends Me {
17358
17361
  get fixedHeight() {
17359
17362
  return this.detectFixedHeight();
17360
17363
  }
17361
- constructor(e) {
17362
- super(e), this.element = this.createHolderElement(), this.wrapperElement = this.createWrapperElement(), this.wrapperElement.appendChild(this.element), this.tableElement = this.createTableElement(), this.heightFixer = this.createTableElement(), this.placeholder = null, this.placeholderContents = null, this.firstRender = !1, this.renderMode = "virtual", this.rows = [], this.activeRowsPipeline = [], this.activeRows = [], this.activeRowsCount = 0, this.displayRows = [], this.displayRowsCount = 0, this.scrollTop = 0, this.scrollLeft = 0, this.redrawBlock = !1, this.redrawBlockRestoreConfig = !1, this.redrawBlockRenderInPosition = !1, this.dataPipeline = [], this.displayPipeline = [], this.scrollbarWidth = 0, this.renderer = null, this.rowIndexMap = /* @__PURE__ */ new Map();
17363
- }
17364
17364
  // ////////////// Setup Functions /////////////////
17365
17365
  createWrapperElement() {
17366
17366
  return B(pu);
@@ -17403,7 +17403,7 @@ class fu extends Me {
17403
17403
  this.scrollLeft != e && (this.scrollLeft = e, this.dispatch("scroll-horizontal", e, t), this.dispatchExternal("scrollHorizontal", e, t), this._positionPlaceholder()), this.scrollTop != i && (this.scrollTop = i, this.renderer?.scrollRows(i, s), this.dispatch("scroll-vertical", i, s), this.dispatchExternal("scrollVertical", i, s));
17404
17404
  }), this.subscribe("table-initialized", () => {
17405
17405
  this.table.destroyed || this.syncPlaceholderInitializationState();
17406
- }), this.subscribe("column-show", this.checkPlaceholder.bind(this)), this.subscribe("column-hide", this.checkPlaceholder.bind(this)), this.subscribe("columns-loaded", this.checkPlaceholder.bind(this));
17406
+ }), this.subscribe("column-show", this.checkPlaceholder.bind(this)), this.subscribe("column-hide", this.checkPlaceholder.bind(this)), this.subscribe("columns-loaded", this.checkPlaceholder.bind(this)), this.subscribe("table-destroy", this.disconnectHeaderWidthObserver.bind(this));
17407
17407
  }
17408
17408
  /**
17409
17409
  * IRow Manipulation
@@ -17834,7 +17834,18 @@ Data: `,
17834
17834
  this.placeholder?.parentNode && this.placeholder.remove(), this.initializePlaceholder(), this.placeholder && (this.placeholder.setAttribute(
17835
17835
  "tabulator-render-mode",
17836
17836
  typeof this.renderMode == "string" ? this.renderMode : ""
17837
- ), this.getElement().appendChild(this.placeholder), this._positionPlaceholder(), this.adjustTableSize(), this.syncPlaceholderInitializationState());
17837
+ ), this.getElement().appendChild(this.placeholder), this._positionPlaceholder(), this.observeHeaderWidth(), this.adjustTableSize(), this.syncPlaceholderInitializationState());
17838
+ }
17839
+ observeHeaderWidth() {
17840
+ const e = this.table.columnManager?.getElement();
17841
+ !e || typeof ResizeObserver > "u" || (this.disconnectHeaderWidthObserver(), this.headerWidthObserver = new ResizeObserver(() => {
17842
+ this.headerWidthSyncFrame === null && (this.headerWidthSyncFrame = requestAnimationFrame(() => {
17843
+ this.headerWidthSyncFrame = null, this._positionPlaceholder();
17844
+ }));
17845
+ }), this.headerWidthObserver.observe(e));
17846
+ }
17847
+ disconnectHeaderWidthObserver() {
17848
+ this.headerWidthObserver?.disconnect(), this.headerWidthObserver = null, this.headerWidthSyncFrame !== null && (cancelAnimationFrame(this.headerWidthSyncFrame), this.headerWidthSyncFrame = null);
17838
17849
  }
17839
17850
  /**
17840
17851
  * While the table is not yet initialized, still show placeholder element so that
@@ -17850,19 +17861,18 @@ Data: `,
17850
17861
  );
17851
17862
  }
17852
17863
  _clearPlaceholder() {
17853
- this.placeholder?.parentNode && this.placeholder.remove(), !!this.table.options.groupBy && this.getDisplayRows().length > 0 && this.getDisplayRows().every((t) => t.type === "group") || (this.tableElement.style.minWidth = ""), this.tableElement.style.display = "";
17864
+ this.disconnectHeaderWidthObserver(), this.placeholder?.parentNode && this.placeholder.remove(), !!this.table.options.groupBy && this.getDisplayRows().length > 0 && this.getDisplayRows().every((t) => t.type === "group") || (this.tableElement.style.minWidth = ""), this.tableElement.style.display = "";
17854
17865
  }
17855
17866
  _positionPlaceholder() {
17856
17867
  if (this.placeholder?.parentNode) {
17857
- const e = Math.max(
17858
- this.table.columnManager?.getWidth() || 0,
17859
- this.getElement().clientWidth || 0,
17860
- this.table.element.clientWidth || 0
17861
- );
17862
- this.placeholder.style.width = e + "px", this.placeholderContents && (this.placeholderContents.style.width = Math.max(
17863
- this.table.rowManager?.getElement().clientWidth || 0,
17864
- this.table.element.clientWidth || 0
17865
- ) + "px", this.placeholderContents.style.marginLeft = this.scrollLeft + "px");
17868
+ const e = this.table.columnManager?.getElement()?.offsetWidth || 0, t = this.table.columnManager?.getWidth() || 0, i = Math.max(e, t), s = i + "px";
17869
+ if (this.placeholder.style.width !== s && (this.placeholder.style.width = s), this.placeholderContents) {
17870
+ const o = Math.max(
17871
+ this.table.rowManager?.getElement().clientWidth || 0,
17872
+ this.table.element.clientWidth || 0
17873
+ );
17874
+ this.placeholderContents.style.width = Math.min(i, o) + "px", this.placeholderContents.style.marginLeft = this.scrollLeft + "px";
17875
+ }
17866
17876
  }
17867
17877
  }
17868
17878
  styleRow(e, t) {
@@ -3,7 +3,7 @@ import "../chunks/typography.IqHbnd3C.js";
3
3
  import "../chunks/lib-cortex-element.CVMmyPMC.js";
4
4
  import "../chunks/color-swatch.D6Gg5bpz.js";
5
5
  import "../chunks/component.styles.CRO4Odto.js";
6
- import { C as v } from "../chunks/color-swatch-group.DqP6pp2u.js";
6
+ import { C as v } from "../chunks/color-swatch-group.CfgmDRCB.js";
7
7
  import "../chunks/transformation.8uLv6uwG.js";
8
8
  import "../chunks/custom-element.L4WJXn1j.js";
9
9
  import "../chunks/debounce.DaHuiSGU.js";
@@ -1,5 +1,5 @@
1
1
  import { C as a } from "../chunks/asset-link-format.H5j0gJtQ.js";
2
- import { C as t } from "../chunks/color-swatch-group.DqP6pp2u.js";
2
+ import { C as t } from "../chunks/color-swatch-group.CfgmDRCB.js";
3
3
  import { default as C } from "./file-on-demand.js";
4
4
  export {
5
5
  a as CxAssetLinkFormat,
@@ -141,8 +141,8 @@ import { g as MF, F as uee } from "../chunks/form.DSsy3Fcy.js";
141
141
  import { c as $Zt, f as FZt, v as zZt, a as jZt } from "../chunks/form.DSsy3Fcy.js";
142
142
  import { d as RS, c as p8, e as pee, i as h8, h as hee, p as gee, t as mee } from "../chunks/date.iWq_pkIk.js";
143
143
  import { b as VZt, f as UZt, g as qZt, a as WZt, n as GZt } from "../chunks/date.iWq_pkIk.js";
144
- import { F as PF, a as fee, b as X4, H as vee, c as i0, d as yee, o as vu } from "../chunks/color-swatch-group.DqP6pp2u.js";
145
- import { C as YZt, e as XZt, f as JZt } from "../chunks/color-swatch-group.DqP6pp2u.js";
144
+ import { F as PF, a as fee, b as X4, H as vee, c as i0, d as yee, o as vu } from "../chunks/color-swatch-group.CfgmDRCB.js";
145
+ import { C as YZt, e as XZt, f as JZt } from "../chunks/color-swatch-group.CfgmDRCB.js";
146
146
  import { F as zd, C as J4, s as YC, a as $S } from "../chunks/folder-select.C4JVju2L.js";
147
147
  import { b as XC, a as mw, c as bee, r as Ue, j as _e, w as wee, R as xee } from "../chunks/jsx-runtime.CTpPVMxj.js";
148
148
  import { j as FS } from "../chunks/index.CrhRU5m8.js";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orangelogic/design-system",
3
3
  "type": "module",
4
- "version": "2.183.0",
4
+ "version": "2.184.0",
5
5
  "license": "UNLICENSED",
6
6
  "types": "library/types.d.ts",
7
7
  "scripts": {
@@ -26,6 +26,8 @@ export default class RowManager extends CoreFeature implements IRowManager {
26
26
  heightFixer: HTMLElement;
27
27
  placeholder: HTMLElement | null;
28
28
  placeholderContents: HTMLElement | null;
29
+ private headerWidthObserver;
30
+ private headerWidthSyncFrame;
29
31
  firstRender: boolean;
30
32
  renderMode?: RenderMode;
31
33
  /**
@@ -136,6 +138,8 @@ export default class RowManager extends CoreFeature implements IRowManager {
136
138
  shouldShowPlaceholder(): boolean;
137
139
  syncColumnVisibilityState(): void;
138
140
  _showPlaceholder(): void;
141
+ private observeHeaderWidth;
142
+ private disconnectHeaderWidthObserver;
139
143
  /**
140
144
  * While the table is not yet initialized, still show placeholder element so that
141
145
  * table's height is not 0 (header-only), but hide the placeholder text
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orangelogic/design-system",
3
3
  "type": "module",
4
- "version": "2.183.0",
4
+ "version": "2.184.0",
5
5
  "license": "UNLICENSED",
6
6
  "types": "library/types.d.ts",
7
7
  "scripts": {