@shival99/z-ui 2.0.28 → 2.0.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.
Files changed (25) hide show
  1. package/fesm2022/shival99-z-ui-components-z-calendar.mjs +84 -27
  2. package/fesm2022/shival99-z-ui-components-z-calendar.mjs.map +1 -1
  3. package/fesm2022/shival99-z-ui-components-z-chat.mjs +1 -1
  4. package/fesm2022/shival99-z-ui-components-z-chat.mjs.map +1 -1
  5. package/fesm2022/shival99-z-ui-components-z-drawer.mjs +7 -3
  6. package/fesm2022/shival99-z-ui-components-z-drawer.mjs.map +1 -1
  7. package/fesm2022/shival99-z-ui-components-z-editor.mjs +4 -4
  8. package/fesm2022/shival99-z-ui-components-z-editor.mjs.map +1 -1
  9. package/fesm2022/shival99-z-ui-components-z-gallery.mjs +2 -2
  10. package/fesm2022/shival99-z-ui-components-z-gallery.mjs.map +1 -1
  11. package/fesm2022/shival99-z-ui-components-z-kanban.mjs +1 -1
  12. package/fesm2022/shival99-z-ui-components-z-kanban.mjs.map +1 -1
  13. package/fesm2022/shival99-z-ui-components-z-modal.mjs +7 -3
  14. package/fesm2022/shival99-z-ui-components-z-modal.mjs.map +1 -1
  15. package/fesm2022/shival99-z-ui-components-z-table.mjs +834 -96
  16. package/fesm2022/shival99-z-ui-components-z-table.mjs.map +1 -1
  17. package/fesm2022/shival99-z-ui-components-z-tags.mjs +24 -14
  18. package/fesm2022/shival99-z-ui-components-z-tags.mjs.map +1 -1
  19. package/package.json +1 -1
  20. package/types/shival99-z-ui-components-z-calendar.d.ts +7 -4
  21. package/types/shival99-z-ui-components-z-drawer.d.ts +6 -2
  22. package/types/shival99-z-ui-components-z-editor.d.ts +2 -2
  23. package/types/shival99-z-ui-components-z-modal.d.ts +7 -3
  24. package/types/shival99-z-ui-components-z-table.d.ts +45 -15
  25. package/types/shival99-z-ui-components-z-tags.d.ts +3 -0
@@ -5,20 +5,23 @@ import * as _shival99_z_ui_components_z_input from '@shival99/z-ui/components/z-
5
5
  import { ZInputSize } from '@shival99/z-ui/components/z-input';
6
6
  import * as _angular_core from '@angular/core';
7
7
  import { TemplateRef, Type, AfterViewInit, ElementRef, OnInit } from '@angular/core';
8
- import { CdkDragDrop, CdkDragEnd } from '@angular/cdk/drag-drop';
8
+ import { CdkDragDrop } from '@angular/cdk/drag-drop';
9
9
  import { ConnectedPosition } from '@angular/cdk/overlay';
10
+ import { ZButtonVariants } from '@shival99/z-ui/components/z-button';
10
11
  import { ZPopoverDirective } from '@shival99/z-ui/components/z-popover';
11
12
  import { ClassValue } from 'clsx';
12
13
  import { NgScrollbar } from 'ngx-scrollbar';
13
14
  import { ZAutocompleteType, ZAutocompleteOption } from '@shival99/z-ui/components/z-autocomplete';
14
- import { ZButtonVariants } from '@shival99/z-ui/components/z-button';
15
15
  import { ZIcon, ZIconVariants } from '@shival99/z-ui/components/z-icon';
16
16
  import { ZSelectOption, ZSelectConfig } from '@shival99/z-ui/components/z-select';
17
+ import * as _shival99_z_ui_components_z_tags from '@shival99/z-ui/components/z-tags';
18
+ import { ZTagColor } from '@shival99/z-ui/components/z-tags';
17
19
  import * as _shival99_z_ui_components_z_tooltip from '@shival99/z-ui/components/z-tooltip';
18
20
  import { ZTooltipConfig, ZTooltipContent } from '@shival99/z-ui/components/z-tooltip';
19
21
  import { ZExcelColumnConfig, ZExcelExportOptions } from '@shival99/z-ui/services';
20
22
  import { ZDateRange } from '@shival99/z-ui/components/z-calendar';
21
23
  import { ZDropdownMenuItem } from '@shival99/z-ui/components/z-dropdown-menu';
24
+ import * as _shival99_z_ui_components_z_table from '@shival99/z-ui/components/z-table';
22
25
 
23
26
  /**
24
27
  * Z-Table Type Definitions
@@ -55,6 +58,8 @@ interface ZTableIconPart {
55
58
  strokeWidth?: number;
56
59
  }
57
60
  type ZTableAlign = 'left' | 'center' | 'right';
61
+ type ZTableBodyContentType = 'default' | 'tag';
62
+ type ZTableTagColor = ZTagColor;
58
63
  /**
59
64
  * Body cell content — supports static values, Angular templates/components,
60
65
  * or a function that receives the cell context and returns dynamic content.
@@ -228,6 +233,10 @@ interface ZTableHeaderColumnConfig<T> {
228
233
  */
229
234
  interface ZTableBodyColumnConfig<T> {
230
235
  content?: ZTableCellContent<T>;
236
+ /** Built-in visual treatment for the rendered body content. */
237
+ type?: ZTableBodyContentType;
238
+ /** Semantic color used when type is "tag". */
239
+ tagColor?: ZTableTagColor | ((info: CellContext<T, unknown>) => ZTableTagColor);
231
240
  class?: string | ((info: CellContext<T, unknown>) => string);
232
241
  style?: Record<string, string> | ((info: CellContext<T, unknown>) => Record<string, string>);
233
242
  align?: ZTableAlign;
@@ -711,6 +720,18 @@ interface ZResolvedEditConfig {
711
720
  disabled: boolean;
712
721
  readonly: boolean;
713
722
  }
723
+ type ZTableDragEntity = 'row' | 'settings-column';
724
+ type ZTableDropEdge = 'top' | 'bottom';
725
+ interface ZTableDragData {
726
+ tableId: string;
727
+ entity: ZTableDragEntity;
728
+ itemId: string;
729
+ }
730
+ interface ZTableDragDropData {
731
+ source: ZTableDragData;
732
+ target: ZTableDragData;
733
+ edge: ZTableDropEdge;
734
+ }
714
735
  /**
715
736
  * Extends TanStack's TableMeta to add a custom `updateData` callback.
716
737
  * This is used by inline edit cells to notify the table of value changes.
@@ -721,6 +742,9 @@ declare module '@tanstack/angular-table' {
721
742
  }
722
743
  }
723
744
 
745
+ type ZTableBulkActionRenderItem<T> = ZTableBulkActionViewItem<T> & {
746
+ buttonType: ZButtonVariants['zType'];
747
+ };
724
748
  declare class ZTableComponent<T> implements AfterViewInit {
725
749
  /** Unified change event — parent listens to this for all table interactions */
726
750
  readonly zChange: _angular_core.OutputEmitterRef<ZTableChangeEvent<T>>;
@@ -737,6 +761,7 @@ declare class ZTableComponent<T> implements AfterViewInit {
737
761
  /** Visual variant: 'default' has card shadow, 'borderless' has no container border */
738
762
  readonly zVariant: _angular_core.InputSignal<"default" | "borderless">;
739
763
  private readonly _destroy$;
764
+ private readonly _dragService;
740
765
  private readonly _zExcel;
741
766
  private readonly _zTranslate;
742
767
  /** Prevents recursive scroll sync between thead/tbody/tfoot */
@@ -747,16 +772,18 @@ declare class ZTableComponent<T> implements AfterViewInit {
747
772
  private _resizeObserver;
748
773
  /** Debounces rapid settings changes (visibility/pin toggles) */
749
774
  private _settingsDebounceTimeout;
775
+ private _visibilityDebounceTimeout;
750
776
  /** Debounces filter change emissions to server */
751
777
  private _filterEmitDebounceTimeout;
752
778
  /** Keeps the bulk bar mounted long enough for its exit animation */
753
779
  private _bulkBarTimer;
754
780
  private readonly _activeColumnVisibilityPopover;
781
+ private _hasInitializedColumnPinning;
755
782
  /** Merged loading state from both zLoading input and config.loading */
756
783
  protected readonly isLoading: _angular_core.Signal<boolean>;
757
784
  /** True during debounced async state transitions (sort/filter processing) */
758
785
  protected readonly isProcessing: _angular_core.WritableSignal<boolean>;
759
- protected readonly isDraggingRow: _angular_core.WritableSignal<boolean>;
786
+ protected readonly dragInstanceId: string;
760
787
  protected readonly theadWrapper: _angular_core.Signal<ElementRef<HTMLDivElement> | undefined>;
761
788
  protected readonly tbodyContainer: _angular_core.Signal<ElementRef<HTMLDivElement> | undefined>;
762
789
  protected readonly tbodyWrapper: _angular_core.Signal<ElementRef<HTMLDivElement> | undefined>;
@@ -798,7 +825,7 @@ declare class ZTableComponent<T> implements AfterViewInit {
798
825
  protected readonly bulkBarClosing: _angular_core.WritableSignal<boolean>;
799
826
  protected readonly bulkBarConfig: _angular_core.WritableSignal<ZTableBulkActionOptions<T> | null>;
800
827
  protected readonly bulkBarContext: _angular_core.WritableSignal<ZTableBulkActionContext<T> | null>;
801
- protected readonly bulkBarItems: _angular_core.WritableSignal<ZTableBulkActionViewItem<T>[]>;
828
+ protected readonly bulkBarItems: _angular_core.WritableSignal<ZTableBulkActionRenderItem<T>[]>;
802
829
  /** True when table body is scrolled away from left edge (shows left pin shadow) */
803
830
  protected readonly hasScrollLeft: _angular_core.WritableSignal<boolean>;
804
831
  /** True when table has right-pinned columns and body isn't scrolled to the end */
@@ -843,6 +870,7 @@ declare class ZTableComponent<T> implements AfterViewInit {
843
870
  width: number;
844
871
  } | null>;
845
872
  protected readonly hasActionColumn: _angular_core.Signal<boolean>;
873
+ private readonly _fixedColumnPinning;
846
874
  protected readonly hasFiltering: _angular_core.Signal<boolean>;
847
875
  protected readonly hasLocalFiltering: _angular_core.Signal<boolean>;
848
876
  protected readonly hasSorting: _angular_core.Signal<boolean>;
@@ -900,6 +928,7 @@ declare class ZTableComponent<T> implements AfterViewInit {
900
928
  protected readonly virtualRightSpacerWidth: _angular_core.Signal<number>;
901
929
  protected readonly renderedColumnCount: _angular_core.Signal<number>;
902
930
  protected readonly orderedLeafColumns: _angular_core.Signal<Column<T, unknown>[]>;
931
+ protected readonly fillColumnId: _angular_core.Signal<string | null>;
903
932
  protected readonly hideableColumns: _angular_core.Signal<Column<T, unknown>[]>;
904
933
  protected readonly orderedHeaderGroups: _angular_core.Signal<{
905
934
  id: string;
@@ -938,16 +967,14 @@ declare class ZTableComponent<T> implements AfterViewInit {
938
967
  protected readonly selectedRows: _angular_core.Signal<T[]>;
939
968
  protected readonly bulkActionContext: _angular_core.Signal<ZTableBulkActionContext<T>>;
940
969
  protected readonly bulkActionConfig: _angular_core.Signal<ZTableBulkActionOptions<T> | null>;
941
- protected readonly bulkActionItems: _angular_core.Signal<{
942
- action: ZTableBulkActionItem<T>;
943
- disabled: boolean;
944
- }[]>;
970
+ protected readonly bulkActionItems: _angular_core.Signal<ZTableBulkActionRenderItem<T>[]>;
945
971
  protected readonly showBulkBar: _angular_core.Signal<boolean>;
946
972
  protected readonly bulkBarPositions: ConnectedPosition[];
947
973
  private readonly _bulkBarExitDuration;
948
974
  /** Virtualizer instance — operates on groups rather than individual rows */
949
975
  protected readonly virtualizer: _shival99_angular_virtual.AngularVirtualizer<HTMLDivElement, Element>;
950
976
  private readonly _measureVirtualItems;
977
+ private readonly _rowDragAutoScroll;
951
978
  constructor();
952
979
  ngAfterViewInit(): void;
953
980
  /**
@@ -989,11 +1016,8 @@ declare class ZTableComponent<T> implements AfterViewInit {
989
1016
  * Giữ tạm để các consumer/template cũ còn compile trong giai đoạn chuyển đổi.
990
1017
  */
991
1018
  handleSort(event: Event, handler?: (event: unknown) => void): void;
992
- onColumnDrop(event: CdkDragDrop<string[]>): void;
993
- onRowDragStarted(): void;
994
- onRowDragEnded(_event: CdkDragEnd<Row<T>>): void;
995
- onRowDrop(event: CdkDragDrop<Row<T>[]>): void;
996
- private _resolveRowDragDropIndex;
1019
+ protected _handleDragDrop(event: ZTableDragDropData): void;
1020
+ private _handleRowDrop;
997
1021
  onToggleAllColumns(): void;
998
1022
  onPageChange(event: {
999
1023
  pageIndex: number;
@@ -1018,6 +1042,8 @@ declare class ZTableComponent<T> implements AfterViewInit {
1018
1042
  hideColumnPopoversOnOutsideClick(optionsPopover: ZPopoverDirective): void;
1019
1043
  openSettingsDrawerFromColumnMenu(...popovers: ZPopoverDirective[]): void;
1020
1044
  private _isColumnHiddenFromVisibilityMenu;
1045
+ private _setColumnPinning;
1046
+ private _areColumnIdListsEqual;
1021
1047
  moveColumnLeft(columnId: string): void;
1022
1048
  moveColumnRight(columnId: string): void;
1023
1049
  isFirstMovableColumn(columnId: string): boolean;
@@ -1149,7 +1175,7 @@ declare class ZTableActionsComponent<T = unknown> {
1149
1175
  readonly zConfig: _angular_core.InputSignal<ZTableActionColumnConfig<T>>;
1150
1176
  readonly zRow: _angular_core.InputSignal<T>;
1151
1177
  readonly zRowId: _angular_core.InputSignal<string>;
1152
- readonly zDropdownButtonSize: _angular_core.InputSignal<"sm" | "default" | "lg" | "xs" | "xl" | null | undefined>;
1178
+ readonly zDropdownButtonSize: _angular_core.InputSignal<"default" | "sm" | "lg" | "xs" | "xl" | null | undefined>;
1153
1179
  readonly zActionClick: _angular_core.OutputEmitterRef<ZTableActionClickEvent<T>>;
1154
1180
  protected readonly allActions: _angular_core.Signal<ZTableActionItem<T>[]>;
1155
1181
  protected readonly shouldShowAsButtons: _angular_core.Signal<boolean>;
@@ -1243,6 +1269,8 @@ declare const getHeaderConfig: <T>(col: ZTableColumnConfig<T> | undefined) => {
1243
1269
  */
1244
1270
  declare const getBodyConfig: <T>(col: ZTableColumnConfig<T> | undefined, ctx?: CellContext<T, unknown>) => {
1245
1271
  content: ZTableCellContent<T> | undefined;
1272
+ type: "default";
1273
+ tagColor: "primary";
1246
1274
  class: string | undefined;
1247
1275
  style: Record<string, string> | undefined;
1248
1276
  align: string | undefined;
@@ -1253,6 +1281,8 @@ declare const getBodyConfig: <T>(col: ZTableColumnConfig<T> | undefined, ctx?: C
1253
1281
  tooltip: string | object | undefined;
1254
1282
  } | {
1255
1283
  content: ZTableCellContent<T> | undefined;
1284
+ type: _shival99_z_ui_components_z_table.ZTableBodyContentType;
1285
+ tagColor: _shival99_z_ui_components_z_tags.ZTagColor | ((info: CellContext<T, unknown>) => _shival99_z_ui_components_z_table.ZTableTagColor);
1256
1286
  class: string | ((info: CellContext<T, unknown>) => string) | undefined;
1257
1287
  style: Record<string, string> | undefined;
1258
1288
  align: ZTableAlign | undefined;
@@ -1299,4 +1329,4 @@ declare const findColumnConfig: <T>(columnId: string, columns: ZTableColumnConfi
1299
1329
  declare function columnConfigToColumnDef<T>(config: ZTableColumnConfig<T>): ColumnDef<T>;
1300
1330
 
1301
1331
  export { ZTableActionsComponent, ZTableComponent, ZTableEditCellComponent, ZTableFilterComponent, ZTableIconTextComponent, columnConfigToColumnDef, findColumnConfig, getBodyConfig, getFooterConfig, getHeaderConfig, isBodyConfig, isFooterConfig, isHeaderConfig };
1302
- export type { ZTableActionBodyConfig, ZTableActionClickEvent, ZTableActionColumnConfig, ZTableActionItem, ZTableActionList, ZTableAdvancedFilterType, ZTableBulkActionClickEvent, ZTableBulkActionConfig, ZTableBulkActionContext, ZTableBulkActionHandlerContext, ZTableBulkActionItem, ZTableBulkActionList, ZTableBulkActionOptions, ZTableBulkActionViewItem, ZTableCellEditChange, ZTableCellEditEvent, ZTableChangeEvent, ZTableColumn, ZTableColumnConfig, ZTableConfig, ZTableControl, ZTableEditCellChangeEvent, ZTableEditConfig, ZTableEditSize, ZTableEditType, ZTableExcelExportConfig, ZTableExcelExportContext, ZTableExcelExportScope, ZTableFilterChangeEvent, ZTableFilterCondition, ZTableFilterConfig, ZTableFilterJoinOperator, ZTableFilterOperator, ZTableFilterOptionSource, ZTableFilterUi, ZTableFilterValueType, ZTablePageChangeEvent, ZTablePaginationConfig, ZTableRowExpandEvent, ZTableRowSelectEvent, ZTableSearchChangeEvent, ZTableSearchConfig, ZTableSortChangeEvent, ZTableSortConfig };
1332
+ 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, ZTableEditSize, ZTableEditType, ZTableExcelExportConfig, ZTableExcelExportContext, ZTableExcelExportScope, ZTableFilterChangeEvent, ZTableFilterCondition, ZTableFilterConfig, ZTableFilterJoinOperator, ZTableFilterOperator, ZTableFilterOptionSource, ZTableFilterUi, ZTableFilterValueType, ZTablePageChangeEvent, ZTablePaginationConfig, ZTableRowExpandEvent, ZTableRowSelectEvent, ZTableSearchChangeEvent, ZTableSearchConfig, ZTableSortChangeEvent, ZTableSortConfig, ZTableTagColor };
@@ -18,6 +18,9 @@ interface ZTagRandomColorCache {
18
18
  text: string;
19
19
  border: string;
20
20
  hoverBg: string;
21
+ darkBg?: string;
22
+ darkText?: string;
23
+ darkHoverBg?: string;
21
24
  }
22
25
  interface ZTagConfig {
23
26
  size: ZTagSize;