@shival99/z-ui 1.2.29 → 1.2.30

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.
@@ -20,6 +20,7 @@ import { ZSafeHtmlPipe } from '@shival99/z-ui/pipes';
20
20
  import { ZTranslateService, ZCacheService } from '@shival99/z-ui/services';
21
21
  import { createAngularTable, getFacetedMinMaxValues, getFacetedUniqueValues, getFacetedRowModel, getPaginationRowModel, getSortedRowModel, getFilteredRowModel, getExpandedRowModel, getCoreRowModel, FlexRenderDirective } from '@tanstack/angular-table';
22
22
  import { NgScrollbar } from 'ngx-scrollbar';
23
+ import { effectOnceIf } from 'ngxtension/effect-once-if';
23
24
  import { explicitEffect } from 'ngxtension/explicit-effect';
24
25
  import { injectDestroy } from 'ngxtension/inject-destroy';
25
26
  import { ZDropdownMenuComponent } from '@shival99/z-ui/components/z-dropdown-menu';
@@ -2350,6 +2351,7 @@ class ZTableComponent {
2350
2351
  _dataForceUpdate = signal(0, ...(ngDevMode ? [{ debugName: "_dataForceUpdate" }] : []));
2351
2352
  _columnConfigCache = new Map();
2352
2353
  _lastColumnsRef = null;
2354
+ _configCacheLoaded = false;
2353
2355
  pinnedColumnIds = computed(() => {
2354
2356
  this._columnPinVersion();
2355
2357
  return this.columnOrder().filter(id => {
@@ -3055,8 +3057,13 @@ class ZTableComponent {
3055
3057
  explicitEffect([this._zTranslate.currentLang], () => {
3056
3058
  this._dataForceUpdate.update(v => v + 1);
3057
3059
  });
3058
- explicitEffect([this.zKey], ([key]) => {
3060
+ effectOnceIf(computed(() => {
3061
+ const key = this.zKey();
3062
+ const config = this.zConfig();
3063
+ return !!key && !!config.columns && config.columns.length > 0 && !this._configCacheLoaded;
3064
+ }), () => {
3059
3065
  this._loadConfigCache();
3066
+ this._configCacheLoaded = true;
3060
3067
  });
3061
3068
  explicitEffect([this.zConfig], ([cfg]) => {
3062
3069
  const initial = cfg.initialState;