@kumori/aurora-wui-components 0.0.295-dev4335 → 0.0.295-dev4335.1

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.
@@ -9,7 +9,6 @@ export declare class TableChart extends LitElement {
9
9
  height: string;
10
10
  private chartInstance;
11
11
  private _resizeObserver;
12
- private _wasVisible;
13
12
  static styles: import('lit').CSSResult[];
14
13
  private createChart;
15
14
  protected firstUpdated(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"table-chart.d.ts","sourceRoot":"","sources":["../../../src/components/table-chart/table-chart.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAwB,MAAM,KAAK,CAAC;AAIvD,qBACa,UAAW,SAAQ,UAAU;IACZ,SAAS,EAAE,MAAM,iBAAiB,CAAU;IAC5C,OAAO,SAAM;IACd,WAAW,EAAE,MAAM,EAAE,CAAM;IACtB,aAAa,EAAE,YAAY,EAAE,CAAM;IACnC,YAAY,EAAE,YAAY,CAAM;IACpC,MAAM,SAAU;IAE5C,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,eAAe,CAA+B;IACtD,OAAO,CAAC,WAAW,CAAS;IAE5B,MAAM,CAAC,MAAM,4BAQX;IAEF,OAAO,CAAC,WAAW;IA0BnB,SAAS,CAAC,YAAY;IAatB,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IA4BzD,oBAAoB;IAUpB,MAAM;CASP"}
1
+ {"version":3,"file":"table-chart.d.ts","sourceRoot":"","sources":["../../../src/components/table-chart/table-chart.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAwB,MAAM,KAAK,CAAC;AAIvD,qBACa,UAAW,SAAQ,UAAU;IACZ,SAAS,EAAE,MAAM,iBAAiB,CAAU;IAC5C,OAAO,SAAM;IACd,WAAW,EAAE,MAAM,EAAE,CAAM;IACtB,aAAa,EAAE,YAAY,EAAE,CAAM;IACnC,YAAY,EAAE,YAAY,CAAM;IACpC,MAAM,SAAU;IAE5C,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,eAAe,CAA+B;IAEtD,MAAM,CAAC,MAAM,4BAQX;IAEF,OAAO,CAAC,WAAW;IA6BnB,SAAS,CAAC,YAAY;IAUtB,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IA4BzD,oBAAoB;IAUpB,MAAM;CASP"}
package/dist/index.js CHANGED
@@ -8923,7 +8923,6 @@ var TableChart = class TableChart extends LitElement {
8923
8923
  this.height = "4rem";
8924
8924
  this.chartInstance = null;
8925
8925
  this._resizeObserver = null;
8926
- this._wasVisible = false;
8927
8926
  }
8928
8927
  static {
8929
8928
  this.styles = [unsafeCSS(tailwind_default), css`
@@ -8945,6 +8944,7 @@ var TableChart = class TableChart extends LitElement {
8945
8944
  return;
8946
8945
  }
8947
8946
  if (this.chartInstance) return;
8947
+ if (this.offsetWidth === 0 || this.offsetHeight === 0) return;
8948
8948
  this.chartInstance = new Chart(ctx, {
8949
8949
  type: this.chartType,
8950
8950
  data: {
@@ -8956,11 +8956,8 @@ var TableChart = class TableChart extends LitElement {
8956
8956
  }
8957
8957
  firstUpdated() {
8958
8958
  this.createChart();
8959
- this._resizeObserver = new ResizeObserver((entries) => {
8960
- const { width, height } = entries[0].contentRect;
8961
- const isVisible = width > 0 && height > 0;
8962
- if (isVisible && !this._wasVisible) this.chartInstance?.resize();
8963
- this._wasVisible = isVisible;
8959
+ this._resizeObserver = new ResizeObserver(() => {
8960
+ if (!this.chartInstance) this.createChart();
8964
8961
  });
8965
8962
  this._resizeObserver.observe(this);
8966
8963
  }