@shival99/z-ui 2.0.40 → 2.0.41
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.
|
@@ -4685,9 +4685,7 @@ class ZTableComponent {
|
|
|
4685
4685
|
_bulkBarTimer = null;
|
|
4686
4686
|
_activeColumnVisibilityPopover = signal(null, ...(ngDevMode ? [{ debugName: "_activeColumnVisibilityPopover" }] : []));
|
|
4687
4687
|
_hasInitializedColumnPinning = false;
|
|
4688
|
-
_fitColumnScheduleId = 0;
|
|
4689
4688
|
_isFitColumnScheduled = false;
|
|
4690
|
-
_isApplyingFitColumnSizing = false;
|
|
4691
4689
|
// ─── Template-bound State ─────────────────────────────────────────────────
|
|
4692
4690
|
/** Merged loading state from both zLoading input and config.loading */
|
|
4693
4691
|
isLoading = computed(() => this.zConfig().loading ?? this.zLoading(), ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
@@ -4901,29 +4899,28 @@ class ZTableComponent {
|
|
|
4901
4899
|
}
|
|
4902
4900
|
const { config } = actionCol;
|
|
4903
4901
|
const maxVisible = config.maxVisible ?? Z_TABLE_DEFAULT_MAX_VISIBLE_ACTIONS;
|
|
4902
|
+
const data = this._actionColumnRows();
|
|
4904
4903
|
let buttonCount = 0;
|
|
4905
|
-
|
|
4904
|
+
for (const row of data) {
|
|
4905
|
+
const actions = typeof config.actions === 'function' ? config.actions(row) : config.actions;
|
|
4906
|
+
const visibleActions = actions.filter(action => {
|
|
4907
|
+
if (typeof action.hidden === 'function') {
|
|
4908
|
+
return !action.hidden(row);
|
|
4909
|
+
}
|
|
4910
|
+
return !action.hidden;
|
|
4911
|
+
});
|
|
4912
|
+
const rowButtonCount = visibleActions.length > maxVisible ? 1 : visibleActions.length;
|
|
4913
|
+
buttonCount = Math.max(buttonCount, rowButtonCount);
|
|
4914
|
+
if (buttonCount === maxVisible) {
|
|
4915
|
+
break;
|
|
4916
|
+
}
|
|
4917
|
+
}
|
|
4918
|
+
if (data.length === 0 && Array.isArray(config.actions)) {
|
|
4906
4919
|
const possibleVisibleCount = config.actions.filter(action => action.hidden !== true).length;
|
|
4907
4920
|
buttonCount = possibleVisibleCount > maxVisible ? 1 : possibleVisibleCount;
|
|
4908
4921
|
}
|
|
4909
|
-
if (typeof config.actions === 'function') {
|
|
4910
|
-
|
|
4911
|
-
for (const row of data) {
|
|
4912
|
-
const visibleActions = config.actions(row).filter(action => {
|
|
4913
|
-
if (typeof action.hidden === 'function') {
|
|
4914
|
-
return !action.hidden(row);
|
|
4915
|
-
}
|
|
4916
|
-
return !action.hidden;
|
|
4917
|
-
});
|
|
4918
|
-
const rowButtonCount = visibleActions.length > maxVisible ? 1 : visibleActions.length;
|
|
4919
|
-
buttonCount = Math.max(buttonCount, rowButtonCount);
|
|
4920
|
-
if (buttonCount === maxVisible) {
|
|
4921
|
-
break;
|
|
4922
|
-
}
|
|
4923
|
-
}
|
|
4924
|
-
if (data.length === 0) {
|
|
4925
|
-
buttonCount = maxVisible;
|
|
4926
|
-
}
|
|
4922
|
+
if (data.length === 0 && typeof config.actions === 'function') {
|
|
4923
|
+
buttonCount = maxVisible;
|
|
4927
4924
|
}
|
|
4928
4925
|
const buttonWidth = Z_TABLE_DEFAULT_ACTION_BUTTON_WIDTH;
|
|
4929
4926
|
const gap = 4;
|
|
@@ -6061,7 +6058,6 @@ class ZTableComponent {
|
|
|
6061
6058
|
this._resizeObserver.disconnect();
|
|
6062
6059
|
this._resizeObserver = null;
|
|
6063
6060
|
}
|
|
6064
|
-
this._cancelFitColumnSchedule();
|
|
6065
6061
|
});
|
|
6066
6062
|
}
|
|
6067
6063
|
});
|
|
@@ -6570,9 +6566,6 @@ class ZTableComponent {
|
|
|
6570
6566
|
return;
|
|
6571
6567
|
}
|
|
6572
6568
|
this.columnSizingState.set(next);
|
|
6573
|
-
if (this._isApplyingFitColumnSizing) {
|
|
6574
|
-
return;
|
|
6575
|
-
}
|
|
6576
6569
|
this._columnBaseSizing.set(next);
|
|
6577
6570
|
this._scheduleFitColumnWidths();
|
|
6578
6571
|
}
|
|
@@ -6602,19 +6595,11 @@ class ZTableComponent {
|
|
|
6602
6595
|
return;
|
|
6603
6596
|
}
|
|
6604
6597
|
this._isFitColumnScheduled = true;
|
|
6605
|
-
const scheduleId = ++this._fitColumnScheduleId;
|
|
6606
6598
|
queueMicrotask(() => {
|
|
6607
|
-
if (scheduleId !== this._fitColumnScheduleId) {
|
|
6608
|
-
return;
|
|
6609
|
-
}
|
|
6610
6599
|
this._isFitColumnScheduled = false;
|
|
6611
6600
|
this._applyFitColumnWidths();
|
|
6612
6601
|
});
|
|
6613
6602
|
}
|
|
6614
|
-
_cancelFitColumnSchedule() {
|
|
6615
|
-
this._fitColumnScheduleId += 1;
|
|
6616
|
-
this._isFitColumnScheduled = false;
|
|
6617
|
-
}
|
|
6618
6603
|
_applyFitColumnWidths() {
|
|
6619
6604
|
this._syncColumnBaseSizing();
|
|
6620
6605
|
const baseSizing = this._columnBaseSizing();
|
|
@@ -6645,9 +6630,7 @@ class ZTableComponent {
|
|
|
6645
6630
|
if (this._isSameColumnSizing(this.columnSizingState(), nextSizing)) {
|
|
6646
6631
|
return;
|
|
6647
6632
|
}
|
|
6648
|
-
this._isApplyingFitColumnSizing = true;
|
|
6649
6633
|
this.columnSizingState.set(nextSizing);
|
|
6650
|
-
this._isApplyingFitColumnSizing = false;
|
|
6651
6634
|
}
|
|
6652
6635
|
_getColumnBaseSize(column, baseSizing) {
|
|
6653
6636
|
return baseSizing[column.id] ?? column.columnDef.size ?? column.getSize();
|