@shival99/z-ui 1.2.29 → 1.2.31

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.
@@ -2350,6 +2350,7 @@ class ZTableComponent {
2350
2350
  _dataForceUpdate = signal(0, ...(ngDevMode ? [{ debugName: "_dataForceUpdate" }] : []));
2351
2351
  _columnConfigCache = new Map();
2352
2352
  _lastColumnsRef = null;
2353
+ _configCacheLoaded = false;
2353
2354
  pinnedColumnIds = computed(() => {
2354
2355
  this._columnPinVersion();
2355
2356
  return this.columnOrder().filter(id => {
@@ -3055,10 +3056,45 @@ class ZTableComponent {
3055
3056
  explicitEffect([this._zTranslate.currentLang], () => {
3056
3057
  this._dataForceUpdate.update(v => v + 1);
3057
3058
  });
3058
- explicitEffect([this.zKey], ([key]) => {
3059
- this._loadConfigCache();
3059
+ explicitEffect([this.zKey, this.zConfig], ([key, config]) => {
3060
+ // Only load config cache once when key and valid columns are available
3061
+ if (key && config.columns && config.columns.length > 0 && !this._configCacheLoaded) {
3062
+ this._loadConfigCache();
3063
+ this._configCacheLoaded = true;
3064
+ }
3060
3065
  });
3061
3066
  explicitEffect([this.zConfig], ([cfg]) => {
3067
+ // Skip applying initialState for properties that were loaded from cache
3068
+ // Cache values have priority over initialState
3069
+ if (this._configCacheLoaded) {
3070
+ // Only apply non-column-layout related initial state when cache is loaded
3071
+ const initial = cfg.initialState;
3072
+ if (initial) {
3073
+ // These are not stored in cache, so always apply them
3074
+ if (initial.sorting) {
3075
+ this.sorting.set(initial.sorting);
3076
+ }
3077
+ if (initial.columnFilters) {
3078
+ this.columnFilters.set(initial.columnFilters);
3079
+ }
3080
+ if (initial.globalFilter) {
3081
+ this.globalFilter.set(initial.globalFilter);
3082
+ }
3083
+ if (initial.expanded) {
3084
+ this.expanded.set(initial.expanded);
3085
+ }
3086
+ if (initial.rowSelection) {
3087
+ this.rowSelection.set(initial.rowSelection);
3088
+ }
3089
+ if (initial.rowPinning) {
3090
+ this.rowPinning.set(initial.rowPinning);
3091
+ }
3092
+ if (initial.pagination) {
3093
+ this.pagination.set(initial.pagination);
3094
+ }
3095
+ }
3096
+ return;
3097
+ }
3062
3098
  const initial = cfg.initialState;
3063
3099
  if (initial) {
3064
3100
  if (initial.columnPinning) {