@shival99/z-ui 2.0.67 → 2.0.68
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shival99/z-ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.68",
|
|
4
4
|
"description": "Z-UI: Modern Angular UI Component Library - A comprehensive, high-performance design system built with Angular 20+, featuring 40+ customizable components with dark mode, accessibility, and enterprise-ready features.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -364,6 +364,26 @@ interface ZTablePaginationConfig {
|
|
|
364
364
|
disabled?: boolean;
|
|
365
365
|
}
|
|
366
366
|
type ZTableGroupingMode = 'local' | 'server';
|
|
367
|
+
/**
|
|
368
|
+
* EN: Server-provided group descriptor. In server grouping the table does NOT compute groups from
|
|
369
|
+
* the current page rows; instead the parent supplies the ordered group list (label/count) and
|
|
370
|
+
* fills `config.data` with the child rows it has fetched. Rows are matched to a group by `value`
|
|
371
|
+
* (same key the grouping column would produce) — i.e. row.getValue(groupingColumnId) === group.value.
|
|
372
|
+
* VI: Mô tả group do server cung cấp. Ở chế độ server, table KHÔNG tự group từ rows của trang hiện
|
|
373
|
+
* tại; parent cung cấp danh sách group (label/count) theo thứ tự và đổ child rows đã fetch vào
|
|
374
|
+
* `config.data`. Row được gán vào group qua `value` (cùng key mà cột group sinh ra) — tức
|
|
375
|
+
* row.getValue(groupingColumnId) === group.value.
|
|
376
|
+
*/
|
|
377
|
+
interface ZTableServerGroup {
|
|
378
|
+
/** Giá trị nhóm — khớp với row.getValue(groupingColumnId) để gán row vào group. */
|
|
379
|
+
value: unknown;
|
|
380
|
+
/** Nhãn hiển thị; nếu bỏ trống table tự suy ra từ `value`. */
|
|
381
|
+
label?: string;
|
|
382
|
+
/** Tổng số dòng của group (server cung cấp) — hiển thị badge kể cả khi chưa expand/đủ data. */
|
|
383
|
+
count?: number;
|
|
384
|
+
/** Đang fetch rows cho group này (hiển thị loading trong group). */
|
|
385
|
+
loading?: boolean;
|
|
386
|
+
}
|
|
367
387
|
interface ZTableGroupingConfig {
|
|
368
388
|
enabled?: boolean;
|
|
369
389
|
mode?: ZTableGroupingMode;
|
|
@@ -371,6 +391,20 @@ interface ZTableGroupingConfig {
|
|
|
371
391
|
allowHeaderMenu?: boolean;
|
|
372
392
|
defaultExpanded?: boolean;
|
|
373
393
|
showCount?: boolean;
|
|
394
|
+
/**
|
|
395
|
+
* Cột đang group ở chế độ server (bắt buộc cho server grouping vì table không tự suy ra).
|
|
396
|
+
* Nếu bỏ trống, dùng phần tử đầu của `columns`.
|
|
397
|
+
*/
|
|
398
|
+
serverGroupColumnId?: string;
|
|
399
|
+
/** Danh sách group do server cung cấp (chỉ dùng khi mode = 'server'). */
|
|
400
|
+
serverGroups?: ZTableServerGroup[];
|
|
401
|
+
}
|
|
402
|
+
/** Payload emit khi expand/collapse một group ở chế độ server. */
|
|
403
|
+
interface ZTableGroupExpandEvent {
|
|
404
|
+
groupId: string;
|
|
405
|
+
columnId: string;
|
|
406
|
+
value: unknown;
|
|
407
|
+
expanded: boolean;
|
|
374
408
|
}
|
|
375
409
|
/** Distinguishes user-triggered vs programmatic pagination changes */
|
|
376
410
|
type ZTableEmitType = 'user' | 'auto';
|
|
@@ -593,7 +627,7 @@ interface ZTableActionColumnConfig<T = unknown> {
|
|
|
593
627
|
}
|
|
594
628
|
type ZTableActionBodyConfig<T = unknown> = ZTableActionColumnConfig<T> | (ZTableActionList<T> & Partial<ZTableActionColumnConfig<T>>);
|
|
595
629
|
/** All possible change event types — used as discriminant in ZTableChangeEvent */
|
|
596
|
-
type ZTableChangeType = 'page' | 'sort' | 'filter' | 'search' | 'select' | 'expand' | 'rowSelect' | 'rowSelectAll' | 'rowExpand' | 'rowDrag' | 'rowInsert' | 'rowDelete' | 'rowCopy' | 'rowPaste' | 'rowMove' | 'cellClick' | 'cellEdit' | 'action' | 'bulkAction' | 'grouping';
|
|
630
|
+
type ZTableChangeType = 'page' | 'sort' | 'filter' | 'search' | 'select' | 'expand' | 'rowSelect' | 'rowSelectAll' | 'rowExpand' | 'rowDrag' | 'rowInsert' | 'rowDelete' | 'rowCopy' | 'rowPaste' | 'rowMove' | 'cellClick' | 'cellEdit' | 'action' | 'bulkAction' | 'grouping' | 'groupExpand';
|
|
597
631
|
interface ZTableChangeEventBase {
|
|
598
632
|
type: ZTableChangeType;
|
|
599
633
|
}
|
|
@@ -671,6 +705,10 @@ interface ZTableGroupingChange extends ZTableChangeEventBase {
|
|
|
671
705
|
grouping: string[];
|
|
672
706
|
};
|
|
673
707
|
}
|
|
708
|
+
interface ZTableGroupExpandChange extends ZTableChangeEventBase {
|
|
709
|
+
type: 'groupExpand';
|
|
710
|
+
data: ZTableGroupExpandEvent;
|
|
711
|
+
}
|
|
674
712
|
interface ZTableActionChange<T> extends ZTableChangeEventBase {
|
|
675
713
|
type: 'action';
|
|
676
714
|
data: ZTableActionClickEvent<T>;
|
|
@@ -696,7 +734,7 @@ interface ZTableCellEditChange<T> extends ZTableChangeEventBase {
|
|
|
696
734
|
* }
|
|
697
735
|
* ```
|
|
698
736
|
*/
|
|
699
|
-
type ZTableChangeEvent<T> = ZTablePageChange | ZTableSortChange | ZTableFilterChange | ZTableSearchChange | ZTableSelectChange | ZTableExpandChange | ZTableGroupingChange | ZTableRowSelectChange<T> | ZTableRowSelectAllChange<T> | ZTableRowExpandChange<T> | ZTableRowDragChange<T> | ZTableRowInsertChange<T> | ZTableRowDeleteChange<T> | ZTableRowCopyChange<T> | ZTableRowPasteChange<T> | ZTableRowMoveChange<T> | ZTableCellClickChange<T> | ZTableCellEditChange<T> | ZTableActionChange<T> | ZTableBulkActionChange<T>;
|
|
737
|
+
type ZTableChangeEvent<T> = ZTablePageChange | ZTableSortChange | ZTableFilterChange | ZTableSearchChange | ZTableSelectChange | ZTableExpandChange | ZTableGroupingChange | ZTableGroupExpandChange | ZTableRowSelectChange<T> | ZTableRowSelectAllChange<T> | ZTableRowExpandChange<T> | ZTableRowDragChange<T> | ZTableRowInsertChange<T> | ZTableRowDeleteChange<T> | ZTableRowCopyChange<T> | ZTableRowPasteChange<T> | ZTableRowMoveChange<T> | ZTableCellClickChange<T> | ZTableCellEditChange<T> | ZTableActionChange<T> | ZTableBulkActionChange<T>;
|
|
700
738
|
/** Initial table state — applied on first render, before any cached config is loaded */
|
|
701
739
|
interface ZTableInitialState {
|
|
702
740
|
columnPinning?: ColumnPinningState;
|
|
@@ -911,6 +949,8 @@ interface ZTableGroupRowItem {
|
|
|
911
949
|
columnLabel: string;
|
|
912
950
|
count: number;
|
|
913
951
|
expanded: boolean;
|
|
952
|
+
/** Server grouping: group đang fetch child rows. */
|
|
953
|
+
loading?: boolean;
|
|
914
954
|
}
|
|
915
955
|
interface ZTableDataRowItem<T> {
|
|
916
956
|
type: 'row';
|
|
@@ -1128,10 +1168,21 @@ declare class ZTableComponent<T> implements AfterViewInit {
|
|
|
1128
1168
|
protected readonly hasLocalSorting: _angular_core.Signal<boolean>;
|
|
1129
1169
|
protected readonly hasServerFiltering: _angular_core.Signal<boolean>;
|
|
1130
1170
|
protected readonly groupingConfig: _angular_core.Signal<ZTableGroupingConfig>;
|
|
1171
|
+
/** EN/VI: true khi grouping chạy ở chế độ server (group meta do server cung cấp). */
|
|
1172
|
+
protected readonly isServerGrouping: _angular_core.Signal<boolean>;
|
|
1131
1173
|
protected readonly canUseGrouping: _angular_core.Signal<boolean>;
|
|
1174
|
+
/** EN/VI: cột group hiệu lực cho chế độ server (config cung cấp, không suy ra từ data). */
|
|
1175
|
+
protected readonly serverGroupColumnId: _angular_core.Signal<string | null>;
|
|
1132
1176
|
protected readonly activeGroupingColumnId: _angular_core.Signal<string | null>;
|
|
1133
1177
|
protected readonly groupableColumnMap: _angular_core.Signal<Record<string, boolean>>;
|
|
1134
1178
|
protected readonly groupedCenterRowItems: _angular_core.Signal<ZTableGroupedRowItem<T>[]>;
|
|
1179
|
+
/** Local grouping: group được tính tại client từ rows của trang hiện tại. */
|
|
1180
|
+
private _buildLocalGroupedItems;
|
|
1181
|
+
/**
|
|
1182
|
+
* Server grouping: thứ tự & meta group do `config.enableGrouping.serverGroups` quyết định.
|
|
1183
|
+
* Child rows lấy từ `getCenterRows()` (data parent đã fetch) và gán vào group theo value.
|
|
1184
|
+
*/
|
|
1185
|
+
private _buildServerGroupedItems;
|
|
1135
1186
|
/**
|
|
1136
1187
|
* EN: Flat list of body rows in the exact order they are rendered. When grouping is active the
|
|
1137
1188
|
* center rows are re-ordered group-by-group, so the flat `table.getRowModel().rows` no longer
|
|
@@ -1526,7 +1577,7 @@ declare class ZTableActionsComponent<T = unknown> {
|
|
|
1526
1577
|
readonly zConfig: _angular_core.InputSignal<ZTableActionColumnConfig<T>>;
|
|
1527
1578
|
readonly zRow: _angular_core.InputSignal<T>;
|
|
1528
1579
|
readonly zRowId: _angular_core.InputSignal<string>;
|
|
1529
|
-
readonly zDropdownButtonSize: _angular_core.InputSignal<"
|
|
1580
|
+
readonly zDropdownButtonSize: _angular_core.InputSignal<"sm" | "default" | "lg" | "xs" | "xl" | null | undefined>;
|
|
1530
1581
|
readonly zActionClick: _angular_core.OutputEmitterRef<ZTableActionClickEvent<T>>;
|
|
1531
1582
|
protected readonly allActions: _angular_core.Signal<ZTableActionItem<T>[]>;
|
|
1532
1583
|
protected readonly shouldShowAsButtons: _angular_core.Signal<boolean>;
|
|
@@ -1680,4 +1731,4 @@ declare const findColumnConfig: <T>(columnId: string, columns: ZTableColumnConfi
|
|
|
1680
1731
|
declare function columnConfigToColumnDef<T>(config: ZTableColumnConfig<T>): ColumnDef<T>;
|
|
1681
1732
|
|
|
1682
1733
|
export { ZTableActionsComponent, ZTableComponent, ZTableEditCellComponent, ZTableFilterComponent, ZTableIconTextComponent, columnConfigToColumnDef, findColumnConfig, getBodyConfig, getFooterConfig, getHeaderConfig, isBodyConfig, isFooterConfig, isHeaderConfig };
|
|
1683
|
-
export type { ZTableActionBodyConfig, ZTableActionClickEvent, ZTableActionColumnConfig, ZTableActionItem, ZTableActionList, ZTableAdvancedFilterType, ZTableBodyContentType, ZTableBulkActionClickEvent, ZTableBulkActionConfig, ZTableBulkActionContext, ZTableBulkActionHandlerContext, ZTableBulkActionItem, ZTableBulkActionList, ZTableBulkActionOptions, ZTableBulkActionViewItem, ZTableCellEditChange, ZTableCellEditEvent, ZTableChangeEvent, ZTableColumn, ZTableColumnConfig, ZTableConfig, ZTableControl, ZTableEditCellChangeEvent, ZTableEditConfig, ZTableEditContentConfig, ZTableEditContentType, ZTableEditSize, ZTableEditType, ZTableExcelExportConfig, ZTableExcelExportContext, ZTableExcelExportScope, ZTableFilterChangeEvent, ZTableFilterCondition, ZTableFilterConfig, ZTableFilterJoinOperator, ZTableFilterOperator, ZTableFilterOptionSource, ZTableFilterUi, ZTableFilterValueType, ZTablePageChangeEvent, ZTablePaginationConfig, ZTableRowCopyChange, ZTableRowCopyEvent, ZTableRowDeleteChange, ZTableRowDeleteEvent, ZTableRowExpandEvent, ZTableRowInsertChange, ZTableRowInsertEvent, ZTableRowInsertPosition, ZTableRowMoveChange, ZTableRowMoveDirection, ZTableRowMoveEvent, ZTableRowPasteChange, ZTableRowPasteEvent, ZTableRowSelectEvent, ZTableSearchChangeEvent, ZTableSearchConfig, ZTableSortChangeEvent, ZTableSortConfig, ZTableTagColor };
|
|
1734
|
+
export type { ZTableActionBodyConfig, ZTableActionClickEvent, ZTableActionColumnConfig, ZTableActionItem, ZTableActionList, ZTableAdvancedFilterType, ZTableBodyContentType, ZTableBulkActionClickEvent, ZTableBulkActionConfig, ZTableBulkActionContext, ZTableBulkActionHandlerContext, ZTableBulkActionItem, ZTableBulkActionList, ZTableBulkActionOptions, ZTableBulkActionViewItem, ZTableCellEditChange, ZTableCellEditEvent, ZTableChangeEvent, ZTableColumn, ZTableColumnConfig, ZTableConfig, ZTableControl, ZTableEditCellChangeEvent, ZTableEditConfig, ZTableEditContentConfig, ZTableEditContentType, ZTableEditSize, ZTableEditType, ZTableExcelExportConfig, ZTableExcelExportContext, ZTableExcelExportScope, ZTableFilterChangeEvent, ZTableFilterCondition, ZTableFilterConfig, ZTableFilterJoinOperator, ZTableFilterOperator, ZTableFilterOptionSource, ZTableFilterUi, ZTableFilterValueType, ZTableGroupExpandChange, ZTableGroupExpandEvent, ZTableGroupingConfig, ZTableGroupingMode, ZTablePageChangeEvent, ZTablePaginationConfig, ZTableRowCopyChange, ZTableRowCopyEvent, ZTableRowDeleteChange, ZTableRowDeleteEvent, ZTableRowExpandEvent, ZTableRowInsertChange, ZTableRowInsertEvent, ZTableRowInsertPosition, ZTableRowMoveChange, ZTableRowMoveDirection, ZTableRowMoveEvent, ZTableRowPasteChange, ZTableRowPasteEvent, ZTableRowSelectEvent, ZTableSearchChangeEvent, ZTableSearchConfig, ZTableServerGroup, ZTableSortChangeEvent, ZTableSortConfig, ZTableTagColor };
|