@shival99/z-ui 1.2.35 → 1.2.37
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,7 +2350,6 @@ class ZTableComponent {
|
|
|
2350
2350
|
_dataForceUpdate = signal(0, ...(ngDevMode ? [{ debugName: "_dataForceUpdate" }] : []));
|
|
2351
2351
|
_columnConfigCache = new Map();
|
|
2352
2352
|
_lastColumnsRef = null;
|
|
2353
|
-
_configCacheLoaded = false;
|
|
2354
2353
|
pinnedColumnIds = computed(() => {
|
|
2355
2354
|
this._columnPinVersion();
|
|
2356
2355
|
return this.columnOrder().filter(id => {
|
|
@@ -3056,20 +3055,20 @@ class ZTableComponent {
|
|
|
3056
3055
|
explicitEffect([this._zTranslate.currentLang], () => {
|
|
3057
3056
|
this._dataForceUpdate.update(v => v + 1);
|
|
3058
3057
|
});
|
|
3059
|
-
explicitEffect([this.zKey, this.zConfig], ([key,
|
|
3060
|
-
if (
|
|
3061
|
-
|
|
3058
|
+
explicitEffect([this.zKey, this.zConfig], ([key, cfg]) => {
|
|
3059
|
+
if (!cfg.columns || cfg.columns.length === 0) {
|
|
3060
|
+
return;
|
|
3062
3061
|
}
|
|
3063
|
-
|
|
3064
|
-
explicitEffect([this.zConfig], ([cfg]) => {
|
|
3062
|
+
const cacheLoaded = key ? this._loadConfigCache(key) : false;
|
|
3065
3063
|
const initial = cfg.initialState;
|
|
3066
|
-
console.log('🚀 ~ initial:', initial);
|
|
3067
3064
|
if (initial) {
|
|
3068
|
-
if (
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3065
|
+
if (!cacheLoaded) {
|
|
3066
|
+
if (initial.columnPinning) {
|
|
3067
|
+
this.columnPinning.set(initial.columnPinning);
|
|
3068
|
+
}
|
|
3069
|
+
if (initial.columnVisibility) {
|
|
3070
|
+
this.columnVisibility.set(initial.columnVisibility);
|
|
3071
|
+
}
|
|
3073
3072
|
}
|
|
3074
3073
|
if (initial.sorting) {
|
|
3075
3074
|
this.sorting.set(initial.sorting);
|
|
@@ -3093,7 +3092,9 @@ class ZTableComponent {
|
|
|
3093
3092
|
this.pagination.set(initial.pagination);
|
|
3094
3093
|
}
|
|
3095
3094
|
}
|
|
3096
|
-
|
|
3095
|
+
if (!cacheLoaded) {
|
|
3096
|
+
this.showHeaderFooterShadow.set(cfg.showHeaderShadow ?? cfg.showFooterShadow ?? true);
|
|
3097
|
+
}
|
|
3097
3098
|
const cols = cfg.columns ?? [];
|
|
3098
3099
|
const leftPinned = [...(initial?.columnPinning?.left ?? [])];
|
|
3099
3100
|
const rightPinned = [...(initial?.columnPinning?.right ?? [])];
|
|
@@ -3111,11 +3112,10 @@ class ZTableComponent {
|
|
|
3111
3112
|
}
|
|
3112
3113
|
};
|
|
3113
3114
|
collectPinnedColumns(cols);
|
|
3114
|
-
if (leftPinned.length > 0 || rightPinned.length > 0) {
|
|
3115
|
+
if (!cacheLoaded && (leftPinned.length > 0 || rightPinned.length > 0)) {
|
|
3115
3116
|
this.columnPinning.set({ left: leftPinned, right: rightPinned });
|
|
3116
3117
|
}
|
|
3117
|
-
|
|
3118
|
-
});
|
|
3118
|
+
}, { defer: true });
|
|
3119
3119
|
explicitEffect([this.zConfig], ([cfg]) => {
|
|
3120
3120
|
if (cfg.enableRowPinning && !this.hasBodyRowSpan()) {
|
|
3121
3121
|
const cols = cfg.columns ?? [];
|
|
@@ -3646,21 +3646,18 @@ class ZTableComponent {
|
|
|
3646
3646
|
collect(columns);
|
|
3647
3647
|
return result;
|
|
3648
3648
|
}
|
|
3649
|
-
_loadConfigCache() {
|
|
3650
|
-
const key = this.zKey();
|
|
3649
|
+
_loadConfigCache(key) {
|
|
3651
3650
|
if (!key) {
|
|
3652
|
-
return;
|
|
3651
|
+
return false;
|
|
3653
3652
|
}
|
|
3654
3653
|
try {
|
|
3655
3654
|
const config = ZCacheService.get(`table-config-${key}`);
|
|
3656
|
-
console.log('🚀 ~ config:', config);
|
|
3657
3655
|
if (!config) {
|
|
3658
|
-
return;
|
|
3656
|
+
return false;
|
|
3659
3657
|
}
|
|
3660
3658
|
if (!this._isColumnConfigValid(config.columnInfo)) {
|
|
3661
|
-
console.warn('Saved table config is invalid or outdated. Ignoring saved config.');
|
|
3662
3659
|
ZCacheService.delete(`table-config-${key}`);
|
|
3663
|
-
return;
|
|
3660
|
+
return false;
|
|
3664
3661
|
}
|
|
3665
3662
|
if (config.columnOrder && config.columnOrder.length > 0) {
|
|
3666
3663
|
this.columnOrder.set(config.columnOrder);
|
|
@@ -3683,10 +3680,11 @@ class ZTableComponent {
|
|
|
3683
3680
|
if (config.columnSizing) {
|
|
3684
3681
|
this.table.setColumnSizing(config.columnSizing);
|
|
3685
3682
|
}
|
|
3686
|
-
|
|
3683
|
+
return true;
|
|
3687
3684
|
}
|
|
3688
3685
|
catch (error) {
|
|
3689
3686
|
console.error('Failed to load table config:', error);
|
|
3687
|
+
return false;
|
|
3690
3688
|
}
|
|
3691
3689
|
}
|
|
3692
3690
|
_isColumnConfigValid(cachedColumnInfo) {
|