import * as _tanstack_angular_table from '@tanstack/angular-table'; import { RowData, RowSelectionState, HeaderContext, CellContext, FlexRenderComponent, Row, SortingState, ColumnFiltersState, PaginationState, ExpandedState, ColumnPinningState, RowPinningState, VisibilityState, ColumnOrderState, ColumnSizingState, Column, createAngularTable, Table, ColumnDef } from '@tanstack/angular-table'; import * as _shival99_angular_virtual from '@shival99/angular-virtual'; import * as _shival99_z_ui_components_z_input from '@shival99/z-ui/components/z-input'; import { ZInputAlign, ZInputSize } from '@shival99/z-ui/components/z-input'; import * as _angular_core from '@angular/core'; import { TemplateRef, Type, AfterViewInit, ElementRef, OnInit } from '@angular/core'; import { CdkDragDrop } from '@angular/cdk/drag-drop'; import { ConnectedPosition } from '@angular/cdk/overlay'; import { ZPopoverPosition, ZPopoverTrigger, ZPopoverControl, ZPopoverDirective } from '@shival99/z-ui/components/z-popover'; import { ClassValue } from 'clsx'; import { NgScrollbar } from 'ngx-scrollbar'; import { ZAutocompleteType, ZAutocompleteOption } from '@shival99/z-ui/components/z-autocomplete'; import { ZButtonVariants } from '@shival99/z-ui/components/z-button'; import { ZIcon, ZIconVariants } from '@shival99/z-ui/components/z-icon'; import { ZSelectOption, ZSelectConfig, ZSelectMode } from '@shival99/z-ui/components/z-select'; import * as _shival99_z_ui_components_z_tags from '@shival99/z-ui/components/z-tags'; import { ZTagColor } from '@shival99/z-ui/components/z-tags'; import * as _shival99_z_ui_components_z_tooltip from '@shival99/z-ui/components/z-tooltip'; import { ZTooltipConfig, ZTooltipContent, ZTooltipTrigger } from '@shival99/z-ui/components/z-tooltip'; import { ZExcelColumnConfig, ZExcelExportOptions } from '@shival99/z-ui/services'; import { ZDateRange } from '@shival99/z-ui/components/z-calendar'; import { ZDropdownMenuItem } from '@shival99/z-ui/components/z-dropdown-menu'; import * as _shival99_z_ui_components_z_table from '@shival99/z-ui/components/z-table'; /** * Z-Table Type Definitions * * Central type file for the z-table component. Contains: * - Default constants (row heights, sizing, debounce timers) * - Column configuration types (header, body, footer) * - Sort/filter/edit configuration interfaces * - Event contracts for parent-component communication * - Unified change event discriminated union * - Virtual scrolling configuration * - Settings persistence types * - TanStack Table module augmentation for custom table meta */ /** * A virtual group represents one or more consecutive rows that must be * rendered together (e.g. rows sharing a rowSpan). The virtualizer operates * on groups rather than individual rows to keep merged cells intact. */ interface ZVirtualGroup { startIndex: number; endIndex: number; rowCount: number; /** null when dynamicSize is enabled — height is measured after render */ height: number | null; } /** Parsed segment from the `[icon:name|size:16|class:text-red]` inline icon syntax */ interface ZTableIconPart { type: 'text' | 'icon'; value: string; size?: number; class?: string; strokeWidth?: number; } type ZTableAlign = 'left' | 'center' | 'right'; type ZTableBodyContentType = 'default' | 'tag'; type ZTableColumnType = 'data' | 'select' | 'expand' | 'rowDrag' | 'rowPin' | 'actions'; type ZTableTagColor = ZTagColor; /** * Body cell content — supports static values, Angular templates/components, * or a function that receives the cell context and returns dynamic content. */ type ZTableCellContent = string | number | TemplateRef<{ $implicit: CellContext; }> | Type | FlexRenderComponent | ((info: CellContext) => string | number | TemplateRef | FlexRenderComponent); /** Header/footer cell content — similar to body but uses HeaderContext */ type ZTableHeaderContent = string | TemplateRef | Type | (() => string) | ((info: HeaderContext) => string); /** Alias for ZTableColumnConfig — kept for backward compatibility */ type ZTableColumn = ZTableColumnConfig; interface ZTableGroupLabelContext { value: unknown; columnId: string; rows: Row[]; } type ZTableGroupLabelFormatter = (context: ZTableGroupLabelContext) => string; type ZTablePopoverContent = string | TemplateRef; interface ZTablePopoverConfig { content?: ZTablePopoverContent; position?: ZPopoverPosition; trigger?: ZPopoverTrigger; class?: string; showDelay?: number; hideDelay?: number; disabled?: boolean; offset?: number; width?: 'auto' | 'trigger' | number; manualClose?: boolean; outsideClickClose?: boolean; scrollClose?: boolean; sticky?: boolean; showArrow?: boolean; keyboardSafe?: boolean; } type ZTableBodyPopoverConfig = string | ZTablePopoverConfig | TemplateRef | ((info: CellContext) => string | ZTablePopoverConfig | TemplateRef); interface ZTableGroupTotalContext { columnId: string; rows: Row[]; value: unknown; depth: number; } type ZTableGroupTotalContent = 'sum' | ((context: ZTableGroupTotalContext) => unknown); interface ZTableGroupTotalConfig { columnId: string; content?: ZTableGroupTotalContent; class?: string; tooltip?: string | TemplateRef | ZTableTooltipConfig; popover?: ZTablePopoverContent | ZTablePopoverConfig; } interface ZTableTooltipConfig extends ZTooltipConfig { trigger?: ZTooltipTrigger; } type ZTableBodyTooltipConfig = string | ZTableTooltipConfig | TemplateRef | ((info: CellContext) => string | ZTableTooltipConfig | TemplateRef); /** Available column filter value input hints */ type ZTableFilterValueType = 'text' | 'number'; type ZTableFilterUi = 'basic' | 'advanced' | 'custom'; type ZTableAdvancedFilterType = 'text' | 'number' | 'range' | 'date' | 'date-range' | 'time' | 'select' | 'multi-select' | 'tags'; type ZTableFilterOptionSource = 'faceted' | 'table'; /** Available column filter operators */ type ZTableFilterOperator = 'contains' | 'notContains' | 'startsWith' | 'endsWith' | 'equals' | 'notEquals' | 'greaterThan' | 'greaterThanOrEqual' | 'lessThan' | 'lessThanOrEqual' | 'empty' | 'notEmpty'; type ZTableFilterJoinOperator = 'and' | 'or'; interface ZTableFilterCondition { joinWithPrev?: ZTableFilterJoinOperator; operator: ZTableFilterOperator; value?: unknown; } interface ZTableDraftFilterCondition { readonly id: string; readonly joinWithPrev?: ZTableFilterJoinOperator; operator: ZTableFilterOperator | null; value?: unknown; } interface ZTableFilterConditionView extends ZTableDraftFilterCondition { readonly inputType: 'text' | 'number'; readonly isJoinGroupStart: boolean; readonly isValueLess: boolean; readonly joinLabelKey: string; readonly joinTone: 'and' | 'or'; readonly operatorOptions: ZSelectOption[]; } type ZTableLegacyAdvancedFilterType = Exclude; /** Available inline cell edit input types */ type ZTableEditType = 'text' | 'number' | 'select' | 'date' | 'checkbox' | 'textarea' | 'toggle' | 'autocomplete'; /** * Table operation mode: * - 'local': data is fully client-side (sort/filter/paginate handled by TanStack) * - 'server': parent handles data fetching; table emits change events for server calls */ type ZTableMode = 'local' | 'server'; /** Per-column sort configuration; mode controls local vs server-side sorting */ interface ZTableSortConfig { enabled?: boolean; /** 'local' = TanStack sorts in-memory; 'server' = emits event for API call */ mode?: ZTableMode; /** Custom key sent with server-side sort events (defaults to column id) */ sortKey?: string; /** Custom comparator for local sorting */ sortFn?: (rowA: Row, rowB: Row, columnId: string) => number; } type ZTableBuiltInFilterFn = 'equalsString' | 'includesString' | 'includesStringSensitive' | 'arrIncludes' | 'arrIncludesAll' | 'arrIncludesSome' | 'equals' | 'weakEquals' | 'inNumberRange'; type ZTableCustomFilterFn = (row: Row, columnId: string, filterValue: unknown, addMeta: (meta: unknown) => void) => boolean; interface ZTableFilterConfig { enabled?: boolean; mode?: ZTableMode; valueType?: ZTableFilterValueType; ui?: ZTableFilterUi; advancedType?: ZTableAdvancedFilterType; options?: ZSelectOption[]; selectConfig?: Partial>; optionSource?: ZTableFilterOptionSource; allowClear?: boolean; label?: string; placeholder?: string; filterFn?: ZTableBuiltInFilterFn | ZTableCustomFilterFn; /** * @deprecated Dùng `advancedType` thay thế. */ type?: ZTableAdvancedFilterType; /** * @deprecated Dùng `advancedType` thay thế. */ filterType?: ZTableAdvancedFilterType; /** * @deprecated Dùng `options` thay thế. */ filterOptions?: ZSelectOption[]; } type ZTableEditSize = 'sm' | 'default' | 'lg'; type ZTableEditContentType = 'text' | 'number' | 'select' | 'date'; interface ZTableEditContentConfig { type?: ZTableEditContentType; options?: unknown[] | ((row: T) => unknown[]); placeholder?: string | ((row: T) => string); class?: string | ((row: T) => string); style?: Record | ((row: T) => Record); size?: ZTableEditSize; disabled?: boolean | ((row: T) => boolean); readonly?: boolean | ((row: T) => boolean); loading?: boolean | ((row: T) => boolean); align?: ZInputAlign; prefix?: string; suffix?: string; min?: number; max?: number; step?: number; mask?: string; decimalPlaces?: number; allowNegative?: boolean; thousandSeparator?: string; decimalMarker?: '.' | ',' | ['.', ',']; optionLabelKey?: string; optionValueKey?: string; selectConfig?: Partial>; selectMode?: ZSelectMode; mode?: ZSelectMode; selectShowSearch?: boolean; selectWrap?: boolean; maxTagCount?: number; dateFormat?: string; dateValueType?: 'date' | 'iso' | 'string'; minDate?: Date | null; maxDate?: Date | null; allowClear?: boolean; } interface ZTableEditConfig { enabled?: boolean; /** Edit type - can be static or dynamic per row */ type?: ZTableEditType | ((row: T) => ZTableEditType); /** Select options - can be static or dynamic per row */ options?: ZSelectOption[] | ((row: T) => ZSelectOption[]); /** Placeholder - can be static or dynamic per row */ placeholder?: string | ((row: T) => string); /** Allow clear for select input. Default: false */ allowClear?: boolean; /** * Custom option label key when using raw objects as options. * Use this when your options don't have 'label' property. * Example: optionLabelKey: 'tagName' for { tagName: 'Value', tagId: 1 } */ optionLabelKey?: string; /** * Custom option value key when using raw objects as options. * Use this when your options don't have 'value' property. * Example: optionValueKey: 'tagName' for { tagName: 'Value', tagId: 1 } */ optionValueKey?: string; /** * CSS class to apply to the edit cell input/select/etc component */ class?: string | ((row: T) => string); style?: Record | ((row: T) => Record); min?: number; max?: number; step?: number; mask?: string; decimalPlaces?: number; allowNegative?: boolean; rows?: number; thousandSeparator?: string; decimalMarker?: '.' | ',' | ['.', ',']; disabled?: boolean | ((row: T) => boolean); /** Readonly mode - input is visible but not editable */ readonly?: boolean | ((row: T) => boolean); /** Loading mode - shows control loading indicator when supported. */ loading?: boolean | ((row: T) => boolean); debounceTime?: number; /** Only emit change on blur (when user leaves the input). Default: false */ blurEdit?: boolean; /** Size of the edit input. Default: 'sm' */ size?: ZTableEditSize; /** Autocomplete type - default or addressbar */ autocompleteType?: ZAutocompleteType; /** Autocomplete options - for autocomplete type */ autocompleteOptions?: ZAutocompleteOption[] | ((row: T) => ZAutocompleteOption[]); /** Reset input after selecting an option in autocomplete. Default: false */ autocompleteResetOnSelect?: boolean; /** Height of autocomplete dropdown in pixels. Default: 280 */ autocompleteHeight?: number; /** Allow typing custom values when no options match. Default: false */ autocompleteAllowCustomValue?: boolean; } /** * Imperative control handle emitted via `zControl` output. * Allows parent components to programmatically manipulate table state * (add/update/delete items, reset filters, toggle settings, etc.). */ interface ZTableControl { updateConfig: (config: Partial>) => void; toggleSettings: () => void; resetFilters: () => void; resetSorting: () => void; clearSelection: () => void; addItem: (item: T) => void; updateItem: (id: string | number, updates: Partial, fieldKey?: keyof T) => void; deleteItem: (id: string | number, fieldKey?: keyof T) => void; getItems: () => T[]; setColumnVisibility: (columnIds: string | string[], visible: boolean) => void; } /** Header cell configuration — applied to the in the table header row */ interface ZTableHeaderColumnConfig { content?: ZTableHeaderContent; class?: string; style?: Record; align?: ZTableAlign; rowSpan?: number; colSpan?: number; /** Class applied to the inner content wrapper, not the itself */ contentClass?: string | ((info: HeaderContext) => string); contentStyle?: Record | ((info: HeaderContext) => Record); tooltip?: string | ZTooltipConfig; } /** * Body cell configuration — most properties accept a static value or * a function receiving CellContext for per-row dynamic behavior. */ interface ZTableBodyColumnConfig { content?: ZTableCellContent; /** Built-in visual treatment for the rendered body content. */ type?: ZTableBodyContentType; /** Semantic color used when type is "tag". */ tagColor?: ZTableTagColor | ((info: CellContext) => ZTableTagColor); class?: string | ((info: CellContext) => string); style?: Record | ((info: CellContext) => Record); align?: ZTableAlign; /** Static rowSpan or function returning 0 to hide the cell (merged into neighbor) */ rowSpan?: number | ((info: CellContext) => number); colSpan?: number | ((info: CellContext) => number); contentClass?: string | ((info: CellContext) => string); contentStyle?: Record | ((info: CellContext) => Record); tooltip?: ZTableBodyTooltipConfig; popover?: ZTableBodyPopoverConfig; /** * Action buttons rendered inside this cell. * * Preferred: pass an action array or `(row) => action[]` directly. * Deprecated compatibility: `{ actions, maxVisible }` is still supported. */ actions?: ZTableActionBodyConfig; /** Maximum visible action buttons before rendering the overflow menu. */ actionMaxVisible?: number; /** When true, clicking the cell emits a cellClick event */ enabledClick?: boolean; /** Enable inline editing — true uses defaults, or pass full config */ edit?: ZTableEditConfig | boolean; /** Cho phép sửa trực tiếp trong cell theo kiểu Excel, không render editor component. */ editContent?: ZTableEditContentConfig | boolean; /** Control cell content visibility. When false, the cell is rendered but content is hidden. */ visible?: boolean | ((info: CellContext) => boolean); } interface ZTableFooterColumnConfig { content?: ZTableHeaderContent; class?: string; style?: Record; align?: ZTableAlign; rowSpan?: number; colSpan?: number; contentClass?: string | ((info: HeaderContext) => string); contentStyle?: Record | ((info: HeaderContext) => Record); tooltip?: string | ZTooltipConfig; } type ZTableFooterConfig = ZTableFooterColumnConfig | ZTableHeaderContent; /** * Primary column definition — the consumer-facing API. * Converted to TanStack ColumnDef internally via `columnConfigToColumnDef()`. * * Shorthand: header/body/footer accept either a full config object or * just the content directly (string/template/function). * * Nested columns: use `columns` for multi-level header groups. */ interface ZTableColumnConfig { /** Unique column identifier — must be stable across re-renders */ id: string; /** Semantic column role. Falls back to legacy id/body detection when omitted. */ type?: ZTableColumnType; /** Pre-filter visibility — unlike columnVisibility, this removes the column entirely */ visible?: boolean | (() => boolean); /** Object property key for simple accessor — mutually exclusive with accessorFn */ accessorKey?: keyof T & string; /** Custom accessor function for derived/computed cell values */ accessorFn?: (row: T) => unknown; header?: ZTableHeaderColumnConfig | ZTableHeaderContent; body?: ZTableBodyColumnConfig | ZTableCellContent; /** Một cấu hình footer hoặc một cấu hình cho mỗi hàng footer. */ footer?: ZTableFooterConfig | ZTableFooterConfig[]; size?: number; minSize?: number; maxSize?: number; width?: string; /** true = local sort with defaults; object = full config */ sort?: ZTableSortConfig | boolean; /** true = local filter with defaults; object = full config */ filter?: ZTableFilterConfig | boolean; enableResizing?: boolean; enablePinning?: boolean; enableHiding?: boolean; enableOrdering?: boolean; /** Whether this column can be used from the header "Group by" menu */ enableGrouping?: boolean; /** Field hoặc accessor dùng làm khóa nhóm thay cho giá trị của chính cột. */ groupKey?: keyof T | ((row: T) => unknown); /** Format the displayed group header value for this column */ groupLabel?: ZTableGroupLabelFormatter; enableHeaderMenu?: boolean; /** Initial pin position — applied on first render */ pinned?: 'left' | 'right' | false; /** Child columns for multi-level header grouping */ columns?: ZTableColumnConfig[]; } interface ZTablePaginationConfig { enabled?: boolean; pageSize?: number; pageIndex?: number; pageSizeOptions?: number[]; showSizeChanger?: boolean; showQuickJumper?: boolean; showTotal?: boolean; totalLabel?: string; disabled?: boolean; } type ZTableGroupingMode = 'local' | 'server'; /** * EN: Server-provided group descriptor. In server grouping the table does NOT compute groups from * the current page rows; instead the parent supplies the ordered group list (label/count) and * fills `config.data` with the child rows it has fetched. Rows are matched to a group by `value` * (same key the grouping column would produce, including `groupKey` when configured). * VI: Mô tả group do server cung cấp. Ở chế độ server, table KHÔNG tự group từ rows của trang hiện * tại; parent cung cấp danh sách group (label/count) theo thứ tự và đổ child rows đã fetch vào * `config.data`. Row được gán vào group qua `value`, cùng khóa mà cột group sinh ra, bao gồm * `groupKey` nếu cột có cấu hình. */ interface ZTableServerGroup { /** Giá trị nhóm — khớp với khóa group của row để gán row vào group. */ value: unknown; /** Nhãn hiển thị; nếu bỏ trống table tự suy ra từ `value`. */ label?: string; /** Tổng số dòng của group (server cung cấp) — hiển thị badge kể cả khi chưa expand/đủ data. */ count?: number; /** Đang fetch rows cho group này (hiển thị loading trong group). */ loading?: boolean; /** Tổng theo cột do server cung cấp, key là columnId. */ totals?: Record; } interface ZTableGroupingConfig { enabled?: boolean; mode?: ZTableGroupingMode; /** Các cột được phép group từ header menu. */ columns?: string[]; /** Danh sách cột group ban đầu theo thứ tự từ ngoài vào trong. */ initialColumns?: string[]; allowHeaderMenu?: boolean; defaultExpanded?: boolean; showCount?: boolean; /** Cấu hình các cột cần hiển thị tổng trên group row. */ totals?: ZTableGroupTotalConfig[]; /** * Cột đang group ở chế độ server (bắt buộc cho server grouping vì table không tự suy ra). * Nếu bỏ trống, dùng phần tử đầu của `columns`. */ serverGroupColumnId?: string; /** Danh sách group do server cung cấp (chỉ dùng khi mode = 'server'). */ serverGroups?: ZTableServerGroup[]; } /** Payload emit khi expand/collapse một group ở chế độ server. */ interface ZTableGroupExpandEvent { groupId: string; columnId: string; value: unknown; expanded: boolean; } /** Distinguishes user-triggered vs programmatic pagination changes */ type ZTableEmitType = 'user' | 'auto'; interface ZTablePageChangeEvent { pageIndex: number; pageSize: number; emitType: ZTableEmitType; } interface ZTableRowSelectEvent { row: T; rowId: string; selected: boolean; selectedRows: T[]; selectedRowIds: string[]; } interface ZTableRowSelectAllEvent { selected: boolean; selectedRows: T[]; selectedRowIds: string[]; } interface ZTableRowExpandEvent { row: T; rowId: string; expanded: boolean; } interface ZTableCellClickEvent { row: T; rowId: string; columnId: string; value: unknown; } interface ZTableCellEditEvent { row: T; rowId: string; rowIndex: number; columnId: string; oldValue: unknown; newValue: unknown; } interface ZTableRowDragEvent { row: T; rowId: string; previousIndex: number; currentIndex: number; data: T[]; } type ZTableRowInsertPosition = 'above' | 'below'; interface ZTableRowInsertEvent { row: T; rowId: string; /** Index trong row model đang hiển thị. */ rowIndex: number; /** Index trong mảng data gốc. */ sourceIndex: number; position: ZTableRowInsertPosition; } interface ZTableRowDeleteEvent { rows: T[]; rowIds: string[]; /** Index trong row model đang hiển thị. */ rowIndexes: number[]; /** Index trong mảng data gốc. */ sourceIndexes: number[]; } interface ZTableRowCopyEvent { rows: T[]; rowIds: string[]; /** Index trong row model đang hiển thị. */ rowIndexes: number[]; /** Index trong mảng data gốc. */ sourceIndexes: number[]; } interface ZTableRowPasteEvent { rows: T[]; targetRow: T; targetRowId: string; /** Index trong row model đang hiển thị. */ targetRowIndex: number; /** Index trong mảng data gốc. */ targetSourceIndex: number; position: ZTableRowInsertPosition; } type ZTableRowMoveDirection = 'up' | 'down'; interface ZTableRowMoveEvent { row: T; rowId: string; direction: ZTableRowMoveDirection; /** Index trong row model đang hiển thị. */ previousIndex: number; currentIndex: number; /** Index trong mảng data gốc. */ previousSourceIndex: number; currentSourceIndex: number; } interface ZTableSortChangeEvent { sorting: SortingState; } interface ZTableFilterChangeEvent { filters: ColumnFiltersState; search: string; } interface ZTableSearchChangeEvent { search: string; filters: ColumnFiltersState; sorting: SortingState; pagination: PaginationState; } interface ZActionTooltipState { content: ZTooltipContent; alwaysShow: boolean; position?: string; arrow?: boolean; offset?: number; maxWidth?: string; } interface ZTableActionItem { key: string; label?: string; icon?: ZIcon; iconSize?: ZIconVariants['zSize']; tooltip?: string | ZTooltipConfig; type?: ZButtonVariants['zType']; size?: ZButtonVariants['zSize']; class?: string; loading?: boolean | ((row: T) => boolean); disabled?: boolean | ((row: T) => boolean); hidden?: boolean | ((row: T) => boolean); divide?: 'before' | 'after'; } type ZTableActionList = ZTableActionItem[] | ((row: T) => ZTableActionItem[]); interface ZTableActionClickEvent { key: string; row: T; rowId: string; action: ZTableActionItem; } interface ZTableBulkActionContext { selectedRows: T[]; selectedRowIds: string[]; selection: RowSelectionState; } interface ZTableBulkActionHandlerContext extends ZTableBulkActionContext { exportExcel: (config: ZTableExcelExportConfig) => Promise; } interface ZTableBulkActionItem extends Omit>, 'disabled' | 'hidden'> { disabled?: boolean | ((context: ZTableBulkActionContext) => boolean); hidden?: boolean | ((context: ZTableBulkActionContext) => boolean); handler?: (context: ZTableBulkActionHandlerContext) => void | false | Promise; } interface ZTableBulkActionViewItem { action: ZTableBulkActionItem; disabled: boolean; } type ZTableBulkActionRenderItem = ZTableBulkActionViewItem & { buttonType: ZButtonVariants['zType']; }; type ZTableBulkActionList = ZTableBulkActionItem[] | ((context: ZTableBulkActionContext) => ZTableBulkActionItem[]); interface ZTableBulkActionOptions { enabled?: boolean; /** Custom actions rendered when rows are selected. */ actions?: ZTableBulkActionList; maxVisible?: number; selectedLabel?: string; clearLabel?: string; } type ZTableBulkActionConfig = ZTableBulkActionOptions | ZTableBulkActionList; interface ZTableBulkActionClickEvent extends ZTableBulkActionContext { key: string; action: ZTableBulkActionItem; } interface ZTableCellSelectionPredicateContext { row: T; rowId: string; rowIndex: number; columnId: string; column: ZTableColumnConfig | undefined; } interface ZTableCellSelectionOptions { enabled?: boolean; range?: boolean; contextMenu?: boolean; copyWithHeaders?: boolean; /** Column ids that cannot be selected, used as range boundaries, or copied from a range. */ disabledColumnIds?: string[]; /** Disable selection for a specific custom cell. */ isCellDisabled?: (context: ZTableCellSelectionPredicateContext) => boolean; } type ZTableCellSelectionConfig = boolean | ZTableCellSelectionOptions; type ZTableExcelExportScope = 'selected' | 'filtered' | 'all'; interface ZTableExcelExportContext extends ZTableBulkActionContext { data: T[]; columns: ZTableColumnConfig[]; } interface ZTableExcelExportConfig { enabled?: boolean; /** Built-in action key. Use the same key in bulkAction to override the button. */ actionKey?: string; actionLabel?: string; actionIcon?: ZIcon; actionIconSize?: string; fileName?: string | ((context: ZTableExcelExportContext) => string); sheetName?: string; /** Shortcut for `scope: 'all'`. */ exportAll?: boolean; scope?: ZTableExcelExportScope; excludeColumns?: string[]; excelOverrides?: Partial>>>; headerResolver?: (col: ZTableColumnConfig) => string; options?: ZExcelExportOptions; } /** * @deprecated Use `ZTableBodyColumnConfig.actions` directly with an action array * or `(row) => action[]`, and set `actionMaxVisible` on the body config when needed. */ interface ZTableActionColumnConfig { /** * @deprecated Put the action array/function directly in `body.actions` instead. */ actions: ZTableActionList; maxVisible?: number; } type ZTableActionBodyConfig = ZTableActionColumnConfig | (ZTableActionList & Partial>); /** All possible change event types — used as discriminant in ZTableChangeEvent */ type ZTableChangeType = 'page' | 'sort' | 'filter' | 'search' | 'select' | 'expand' | 'rowSelect' | 'rowSelectAll' | 'rowExpand' | 'rowDrag' | 'rowInsert' | 'rowDelete' | 'rowCopy' | 'rowPaste' | 'rowMove' | 'cellClick' | 'cellEdit' | 'action' | 'bulkAction' | 'grouping' | 'groupExpand'; interface ZTableChangeEventBase { type: ZTableChangeType; } interface ZTablePageChange extends ZTableChangeEventBase { type: 'page'; data: ZTablePageChangeEvent; } interface ZTableSortChange extends ZTableChangeEventBase { type: 'sort'; data: ZTableSortChangeEvent; } interface ZTableFilterChange extends ZTableChangeEventBase { type: 'filter'; data: ZTableFilterChangeEvent; } interface ZTableRowSelectChange extends ZTableChangeEventBase { type: 'rowSelect'; data: ZTableRowSelectEvent; } interface ZTableRowSelectAllChange extends ZTableChangeEventBase { type: 'rowSelectAll'; data: ZTableRowSelectAllEvent; } interface ZTableRowExpandChange extends ZTableChangeEventBase { type: 'rowExpand'; data: ZTableRowExpandEvent; } interface ZTableRowDragChange extends ZTableChangeEventBase { type: 'rowDrag'; data: ZTableRowDragEvent; } interface ZTableRowInsertChange extends ZTableChangeEventBase { type: 'rowInsert'; data: ZTableRowInsertEvent; } interface ZTableRowDeleteChange extends ZTableChangeEventBase { type: 'rowDelete'; data: ZTableRowDeleteEvent; } interface ZTableRowCopyChange extends ZTableChangeEventBase { type: 'rowCopy'; data: ZTableRowCopyEvent; } interface ZTableRowPasteChange extends ZTableChangeEventBase { type: 'rowPaste'; data: ZTableRowPasteEvent; } interface ZTableRowMoveChange extends ZTableChangeEventBase { type: 'rowMove'; data: ZTableRowMoveEvent; } interface ZTableCellClickChange extends ZTableChangeEventBase { type: 'cellClick'; data: ZTableCellClickEvent; } interface ZTableSearchChange extends ZTableChangeEventBase { type: 'search'; data: ZTableSearchChangeEvent; } interface ZTableSelectChange extends ZTableChangeEventBase { type: 'select'; data: { selection: RowSelectionState; }; } interface ZTableExpandChange extends ZTableChangeEventBase { type: 'expand'; data: { expanded: ExpandedState; }; } interface ZTableGroupingChange extends ZTableChangeEventBase { type: 'grouping'; data: { grouping: string[]; }; } interface ZTableGroupExpandChange extends ZTableChangeEventBase { type: 'groupExpand'; data: ZTableGroupExpandEvent; } interface ZTableActionChange extends ZTableChangeEventBase { type: 'action'; data: ZTableActionClickEvent; } interface ZTableBulkActionChange extends ZTableChangeEventBase { type: 'bulkAction'; data: ZTableBulkActionClickEvent; } interface ZTableCellEditChange extends ZTableChangeEventBase { type: 'cellEdit'; data: ZTableCellEditEvent; } /** * Unified change event emitted via `zChange` output. * Parent components can use `event.type` to narrow the discriminated union. * * Example: * ```ts * onTableChange(event: ZTableChangeEvent) { * if (event.type === 'page') { * // event.data is ZTablePageChangeEvent * } * } * ``` */ type ZTableChangeEvent = ZTablePageChange | ZTableSortChange | ZTableFilterChange | ZTableSearchChange | ZTableSelectChange | ZTableExpandChange | ZTableGroupingChange | ZTableGroupExpandChange | ZTableRowSelectChange | ZTableRowSelectAllChange | ZTableRowExpandChange | ZTableRowDragChange | ZTableRowInsertChange | ZTableRowDeleteChange | ZTableRowCopyChange | ZTableRowPasteChange | ZTableRowMoveChange | ZTableCellClickChange | ZTableCellEditChange | ZTableActionChange | ZTableBulkActionChange; /** Initial table state — applied on first render, before any cached config is loaded */ interface ZTableInitialState { columnPinning?: ColumnPinningState; rowPinning?: RowPinningState; sorting?: SortingState; columnFilters?: ColumnFiltersState; globalFilter?: string; expanded?: ExpandedState; rowSelection?: RowSelectionState; columnVisibility?: VisibilityState; pagination?: PaginationState; } interface ZTableVirtualConfig { /** Enable virtual scrolling */ enabled: boolean; /** Row height in pixels (default: 40). Used as estimate for dynamic sizing. */ size?: number; /** Number of items to render outside visible area (default: 5) */ overscan?: number; /** Number of rows per virtual group (default: 1) */ groupSize?: number; /** * Enable dynamic row height measurement. * When true, each row's height is measured dynamically after render. * The virtualizer uses `height: auto` for all rows, allowing content * to determine the actual height, which is then captured via measureElement(). * The `size` property is used as an initial estimate before measurement. */ dynamicSize?: boolean; /** * Initial scroll offset in pixels. * Useful for restoring scroll position or starting at a specific offset. * @default 0 */ initialOffset?: number | (() => number); /** * The margin (in pixels) to apply to the start of the virtualizer. * Useful when the virtualizer is not at the top of the scroll container. * @default 0 */ scrollMargin?: number; /** * Gap between items in pixels. * Use this instead of CSS gap for proper virtual scroll calculations. * @default 0 */ gap?: number; /** * Delay in milliseconds before resetting isScrolling state. * @default 150 */ isScrollingResetDelay?: number; /** * Use native scrollend event instead of debounced scroll detection. * Better performance on browsers that support it. * @default true (if browser supports it) */ useScrollendEvent?: boolean; /** * Custom function to generate unique keys for each item. * Useful for stable item identity across data updates. */ getItemKey?: (index: number) => string | number; /** * Custom range extractor function. * Use to customize which items are rendered (e.g., for sticky headers). */ rangeExtractor?: (range: { startIndex: number; endIndex: number; }) => number[]; } interface ZTableSearchConfig { enabled?: boolean; placeholder?: string; debounceTime?: number; width?: string; size?: ZInputSize; } interface ZTableVirtualColumnConfig { /** Enable horizontal column virtualization for center columns only */ enabled: boolean; /** Number of columns to render outside the visible range */ overscan?: number; } /** * Top-level configuration passed via `[zConfig]` input. * This is the primary API surface for consumers of z-table. */ interface ZTableConfig { /** 'local' = client-side operations; 'server' = parent handles data fetching */ mode?: ZTableMode; /** Row data array — for server mode, this is the current page's data */ data: T[]; /** Enables drag-and-drop row reordering for compatible local-table states */ enableRowDragging?: boolean; /** Total row count for server-side pagination (aliased as totalRows) */ totalCount?: number; /** Column definitions */ columns: ZTableColumnConfig[]; /** Custom row ID generator — critical for selection/expansion state stability */ getRowId?: (row: T, index: number, parent: T | undefined, data: T[]) => string; /** Sub-row accessor for tree/hierarchical data */ getSubRows?: (row: T, index: number, parent: T | undefined, data: T[]) => T[] | undefined; /** Class applied to the row and its cells. Cell body classes take precedence on conflicts. */ rowClass?: string | ((row: Row) => string); /** * Style applied to the row and its cells. Cell body styles take precedence on conflicts. * Fixed-size virtual rows keep the height configured by virtual.size. */ rowStyle?: Record | ((row: Row) => Record); /** @deprecated Use totalCount instead */ totalRows?: number; /** true = enable with defaults; object = full virtual scroll config */ virtual?: ZTableVirtualConfig | boolean; /** true = enable with defaults; object = full horizontal column virtualization config */ virtualColumns?: ZTableVirtualColumnConfig | boolean; showHorizontalBorder?: boolean; showVerticalBorder?: boolean; showHeaderShadow?: boolean; showFooterShadow?: boolean; /** Show the settings drawer toggle button */ enableSettings?: boolean; /** Show active search/column filters above the table with quick clear actions */ enableFilterHeader?: boolean; enableColumnResizing?: boolean; /** Giữ kích thước cột ban đầu và chỉ kéo giãn cột dữ liệu cuối để lấp đầy bảng. */ fitContentWidth?: boolean; /** Multi-column sorting is enabled by default; set false for single-column sorting */ enableMultiSort?: boolean; /** true = enable with defaults; object = full search bar config */ search?: ZTableSearchConfig | boolean; /** Floating bulk action bar shown when rows are selected */ bulkAction?: ZTableBulkActionConfig | boolean; /** Bật chọn cell/range và copy giống spreadsheet. Mặc định tắt. */ enableCellSelection?: ZTableCellSelectionConfig; /** Bật menu chuột phải để chèn dòng khi bảng có cell editContent. */ enableContentRowInsert?: boolean; enableRowPinning?: boolean; /** Bật/tắt ghim cột toàn bảng. Mặc định `true`. Từng cột có thể override qua `enablePinning`. */ enableColumnPinning?: boolean; enableColumnOrdering?: boolean; enableColumnSorting?: boolean; enableGrouping?: ZTableGroupingConfig | boolean; pagination?: ZTablePaginationConfig; initialState?: ZTableInitialState; loading?: boolean; /** Template rendered when a row is expanded */ expandedRowTemplate?: TemplateRef<{ $implicit: Row; }>; /** Render z-table con độc lập khi dòng mở rộng không dùng custom template. */ subTableConfig?: ZTableConfig | ((row: Row) => ZTableConfig | undefined); /** Template rendered when no data matches */ emptyTemplate?: TemplateRef; /** Template rendered during loading state */ loadingTemplate?: TemplateRef; getRowCanExpand?: (row: Row) => boolean; /** Fixed table width. Defaults to the available width of the parent container. */ width?: string; /** Fixed table height. Keeps the horizontal scrollbar at the bottom when the table has few rows. */ height?: string; maxHeight?: string; minHeight?: string; /** Debounce time (ms) for async state updates; defaults to Z_DEFAULT_DEBOUNCE_TIME */ debounceTime?: number; /** Use skeleton rows instead of loading spinner */ useSkeleton?: boolean; } interface ZTableEditCellChangeEvent { row: T; rowId: string; rowIndex: number; columnId: string; oldValue: unknown; newValue: unknown; } interface ZResolvedEditConfig { type: ZTableEditType; size: ZTableEditSize; placeholder: string; allowClear: boolean; class: string; style: Record; disabled: boolean; readonly: boolean; loading: boolean; } type ZTableDragEntity = 'row' | 'settings-column'; type ZTableDropEdge = 'top' | 'bottom'; interface ZTableDragData { tableId: string; entity: ZTableDragEntity; itemId: string; } interface ZTableDragDropData { source: ZTableDragData; target: ZTableDragData; edge: ZTableDropEdge; } /** * Extends TanStack's TableMeta to add a custom `updateData` callback. * This is used by inline edit cells to notify the table of value changes. */ declare module '@tanstack/angular-table' { interface TableMeta { updateData?: (rowIndex: number, columnId: string, value: unknown) => void; } } interface ZTableAppliedFilterChip { type: 'filter' | 'sort'; id: string; columnId: string; label: string; value: string; } interface ZTableGroupRowItem { type: 'group'; id: string; columnId: string; depth: number; value: unknown; label: string; columnLabel: string; count: number; expanded: boolean; /** Server grouping: group đang fetch child rows. */ loading?: boolean; totals?: Record; } interface ZTableDataRowItem { type: 'row'; row: Row; isGroupChild?: boolean; groupDepth?: number; } type ZTableGroupedRowItem = ZTableGroupRowItem | ZTableDataRowItem; interface ZVirtualFlatGroupHeader { type: 'group-header'; groupItem: ZTableGroupRowItem; } interface ZVirtualFlatData { type: 'data'; rows: Row[]; isGroupChild: boolean; groupDepth: number; } type ZVirtualFlatItem = ZVirtualFlatGroupHeader | ZVirtualFlatData; type ZTableResolvedCellSelectionOptions = Required, 'enabled' | 'range' | 'contextMenu' | 'copyWithHeaders'>> & Pick, 'disabledColumnIds' | 'isCellDisabled'>; declare class ZTableComponent implements AfterViewInit { private static _dragInstanceCount; /** Unified change event — parent listens to this for all table interactions */ readonly zChange: _angular_core.OutputEmitterRef>; /** Emits an imperative control handle for programmatic table manipulation */ readonly zControl: _angular_core.OutputEmitterRef>; /** Extra CSS classes merged onto the table container */ readonly zClass: _angular_core.InputSignal; /** Main configuration — data, columns, mode, features */ readonly zConfig: _angular_core.InputSignal>; /** External loading state (complementary to config.loading) */ readonly zLoading: _angular_core.InputSignal; /** Cache key for persisting column settings; no persistence when empty */ readonly zKey: _angular_core.InputSignal; /** Visual variant: 'default' has card shadow, 'borderless' has no container border */ readonly zVariant: _angular_core.InputSignal<"default" | "borderless">; private readonly _destroy$; private readonly _dragService; private readonly _host; private readonly _document; private readonly _zExcel; private readonly _zTranslate; /** Prevents recursive scroll sync between thead/tbody/tfoot */ private readonly _isSyncingScroll; /** Preserves horizontal scroll position across loading states */ private readonly _savedScrollLeft; /** Observes tbody container height changes for skeleton row count calculation */ private _resizeObserver; /** Debounces rapid settings changes (visibility/pin toggles) */ private _settingsDebounceTimeout; private _visibilityDebounceTimeout; /** Debounces filter change emissions to server */ private _filterEmitDebounceTimeout; /** Keeps the bulk bar mounted long enough for its exit animation */ private _bulkBarTimer; private _contentRowMenuOutsideTimer; private _contentRowMenuOutsideCleanup; private _cellInteractionOutsideCleanup; private _pinnedRowHeightsFrame; private _virtualSpacerWidthFrame; private readonly _activeColumnVisibilityPopover; private _hasInitializedColumnPinning; private _initializedGroupingSchemaKey; private _initializedPaginationSchemaKey; private _isFitColumnScheduled; private _skipNextConfigSave; /** Merged loading state from both zLoading input and config.loading */ protected readonly isLoading: _angular_core.Signal; /** True during debounced async state transitions (sort/filter processing) */ protected readonly isProcessing: _angular_core.WritableSignal; protected readonly dragInstanceId: string; protected readonly theadWrapper: _angular_core.Signal | undefined>; protected readonly tableContainer: _angular_core.Signal | undefined>; protected readonly tbodyContainer: _angular_core.Signal | undefined>; protected readonly tbodyWrapper: _angular_core.Signal | undefined>; protected readonly tbodyScrollbar: _angular_core.Signal; protected readonly tfootWrapper: _angular_core.Signal | undefined>; protected readonly expandedRowTemplate: _angular_core.Signal | undefined>; protected readonly virtualRowElements: _angular_core.Signal[]>; protected readonly columnPinning: _angular_core.WritableSignal; protected readonly columnVisibility: _angular_core.WritableSignal; protected readonly columnOrder: _angular_core.WritableSignal; protected readonly expanded: _angular_core.WritableSignal; protected readonly groupingColumnIds: _angular_core.WritableSignal; protected readonly collapsedGroupIds: _angular_core.WritableSignal>; protected readonly rowSelection: _angular_core.WritableSignal; protected readonly rowPinning: _angular_core.WritableSignal; protected readonly columnFilters: _angular_core.WritableSignal; protected readonly globalFilter: _angular_core.WritableSignal; protected readonly filterResetVersion: _angular_core.WritableSignal; protected readonly isFilterHeaderExpanded: _angular_core.WritableSignal; protected readonly activeContentEditCell: _angular_core.WritableSignal<{ rowId: string; columnId: string; } | null>; protected readonly contentRowMenu: _angular_core.WritableSignal<{ row: Row; columnId?: string; left: number; top: number; } | null>; protected readonly activeCell: _angular_core.WritableSignal<{ rowId: string; columnId: string; } | null>; protected readonly cellSelectionAnchor: _angular_core.WritableSignal<{ rowId: string; columnId: string; } | null>; protected readonly cellSelectionFocus: _angular_core.WritableSignal<{ rowId: string; columnId: string; } | null>; private _cellDragArmed; private _isCellDragging; private _cellDragStart; private _cellDragCleanup; /** Pointer must move at least this many px before an armed press becomes a range drag. */ private static readonly _cellDragThreshold; protected readonly cellMenu: _angular_core.WritableSignal<{ rowId: string; columnId: string; left: number; top: number; } | null>; protected readonly contentRowMenuControl: _angular_core.WritableSignal; protected readonly cellMenuControl: _angular_core.WritableSignal; protected readonly contentRowClipboard: _angular_core.WritableSignal; protected readonly columnSizingState: _angular_core.WritableSignal; private readonly _columnBaseSizing; protected readonly appliedFilterChips: _angular_core.Signal; protected readonly visibleAppliedFilterChips: _angular_core.Signal; protected readonly overflowAppliedFilterChips: _angular_core.Signal; protected readonly hiddenAppliedFilterChipCount: _angular_core.Signal; /** Note: pageIndex is 1-based here; converted to 0-based for TanStack via _tanstackPagination */ protected readonly pagination: _angular_core.WritableSignal; protected readonly sorting: _angular_core.WritableSignal; /** * Caches the last server-provided total to avoid flickering to 0 * during loading transitions in server-side pagination mode. */ private readonly _serverPaginationTotal; /** Container CSS classes combining variant + user-provided classes */ protected readonly classTable: _angular_core.Signal; /** Convert 1-based pagination to TanStack's 0-based pageIndex */ private readonly _tanstackPagination; private readonly _configPagination; protected readonly paginationTotal: _angular_core.Signal; protected readonly hasVerticalScroll: _angular_core.WritableSignal; protected readonly hasHorizontalScroll: _angular_core.WritableSignal; /** True when the last row touches or extends past the container bottom (no gap) */ protected readonly lastRowTouchesBottom: _angular_core.WritableSignal; protected readonly showSettingsDrawer: _angular_core.WritableSignal; protected readonly showHorizontalBorder: _angular_core.WritableSignal; protected readonly showVerticalBorder: _angular_core.WritableSignal; protected readonly showHeaderFooterShadow: _angular_core.WritableSignal; protected readonly bulkBarMounted: _angular_core.WritableSignal; protected readonly bulkBarClosing: _angular_core.WritableSignal; protected readonly bulkBarConfig: _angular_core.WritableSignal | null>; protected readonly bulkBarContext: _angular_core.WritableSignal | null>; protected readonly bulkBarItems: _angular_core.WritableSignal[]>; /** True when table body is scrolled away from left edge (shows left pin shadow) */ protected readonly hasScrollLeft: _angular_core.WritableSignal; /** True when table has right-pinned columns and body isn't scrolled to the end */ protected readonly hasScrollRight: _angular_core.WritableSignal; /** True khi top-pinned rows đang đè lên nội dung body đã scroll qua đầu */ protected readonly hasScrollTop: _angular_core.WritableSignal; /** True khi bottom-pinned rows đang đè lên nội dung body còn scroll xuống được */ protected readonly hasScrollBottom: _angular_core.WritableSignal; /** Maps row IDs to measured DOM heights for pinned row offset calculations */ protected readonly pinnedRowHeights: _angular_core.WritableSignal>; protected readonly virtualMeasuredLeftSpacerWidth: _angular_core.WritableSignal; protected readonly virtualMeasuredRightSpacerWidth: _angular_core.WritableSignal; private readonly _virtualMeasuredLeftSpacerSourceWidth; private readonly _virtualMeasuredRightSpacerSourceWidth; protected readonly defaultBulkActions: _angular_core.Signal[]>; /** Bumped to force recomputation of pinned column IDs after programmatic pin changes */ private readonly _columnPinVersion; /** Bumped to trigger data refresh (e.g., after addItem/deleteItem via control API) */ private readonly _dataForceUpdate; /** Stores a temporary locally reordered dataset until parent pushes a new data reference */ private readonly _rowDragDataOverride; /** Tracks the latest external data array reference to detect parent-driven refreshes */ private _lastExternalDataRef; /** Set when a single row is updated via control API (for targeted re-render) */ protected readonly _rowUpdate: _angular_core.WritableSignal<{ rowId: string; updates: Record; } | null>; /** * Column config lookup cache — cleared when column reference changes. * Avoids repeated recursive searches during render cycles. */ private _columnConfigCache; private _lastColumnsRef; protected readonly pinnedColumnIds: _angular_core.Signal; protected readonly pinAvailabilityMap: _angular_core.Signal>; protected readonly isPinnedLayoutWithinContainer: _angular_core.Signal; protected readonly pendingVisibleColumns: _angular_core.WritableSignal; protected readonly pendingColumnOrder: _angular_core.WritableSignal; protected readonly pendingShowHeaderFooterShadow: _angular_core.WritableSignal; /** True if ANY body column uses rowSpan — affects virtual grouping and expand column behavior */ protected readonly hasBodyRowSpan: _angular_core.Signal; protected readonly hasSelectColumn: _angular_core.Signal; protected readonly hasExpandColumn: _angular_core.Signal; protected readonly hasRowDragColumn: _angular_core.Signal; protected readonly hasContentEditableColumns: _angular_core.Signal; protected readonly canUseContentRowInsert: _angular_core.Signal; protected readonly canUseRowSelection: _angular_core.Signal; protected readonly cellSelectionOptions: _angular_core.Signal>; protected readonly canUseCellSelection: _angular_core.Signal; protected readonly selectedCellIds: _angular_core.Signal>; protected readonly visualSelectedCellIds: _angular_core.Signal>; protected readonly hasMultipleSelectedCells: _angular_core.Signal; protected readonly canCopyCellMenuSelection: _angular_core.Signal; protected readonly selectedCellRangeInsets: _angular_core.Signal>; protected readonly selectedCellEdgeIds: _angular_core.Signal<{ top: Set; right: Set; bottom: Set; left: Set; }>; protected readonly contentRowDeleteCount: _angular_core.Signal; protected readonly canMoveContentRowUp: _angular_core.Signal; protected readonly canMoveContentRowDown: _angular_core.Signal; protected readonly canUseRowDrag: _angular_core.Signal; protected readonly isVirtualRowDragEnabled: _angular_core.Signal; protected readonly isRowDragEnabled: _angular_core.Signal; protected readonly actionColumnInfo: _angular_core.Signal<{ columnId: string; config: ZTableActionColumnConfig; width: number; } | null>; private readonly _fixedColumnPinning; protected readonly hasFiltering: _angular_core.Signal; protected readonly hasLocalFiltering: _angular_core.Signal; protected readonly hasSorting: _angular_core.Signal; protected readonly hasLocalSorting: _angular_core.Signal; protected readonly hasServerFiltering: _angular_core.Signal; protected readonly groupingConfig: _angular_core.Signal>; /** EN/VI: true khi grouping chạy ở chế độ server (group meta do server cung cấp). */ protected readonly isServerGrouping: _angular_core.Signal; protected readonly canUseGrouping: _angular_core.Signal; /** EN/VI: cột group hiệu lực cho chế độ server (config cung cấp, không suy ra từ data). */ protected readonly serverGroupColumnId: _angular_core.Signal; protected readonly activeGroupingColumnIds: _angular_core.Signal; protected readonly activeGroupingColumnId: _angular_core.Signal; protected readonly groupingColumnMap: _angular_core.Signal>; protected readonly groupTotalColumnMap: _angular_core.Signal>; protected readonly groupTotalConfigMap: _angular_core.Signal>>; protected readonly groupableColumnMap: _angular_core.Signal>; protected readonly groupingHeaderMenuMap: _angular_core.Signal>; protected readonly groupedCenterRowItems: _angular_core.Signal[]>; /** Local grouping: group được tính tại client từ rows của trang hiện tại. */ private _buildLocalGroupedItems; private _appendLocalGroupedItems; /** * Server grouping: thứ tự & meta group do `config.enableGrouping.serverGroups` quyết định. * Child rows lấy từ `getCenterRows()` (data parent đã fetch) và gán vào group theo value. */ private _buildServerGroupedItems; private _getGroupTotals; private _sumGroupColumn; /** * EN: Flat list of body rows in the exact order they are rendered. When grouping is active the * center rows are re-ordered group-by-group, so the flat `table.getRowModel().rows` no longer * matches the visual order. The `z-at-bottom` border logic must use this visual order, otherwise * `border-bottom: none` is applied to whichever row happens to be last in the flat model — which * after grouping lands somewhere in the middle of the table. * VI: Danh sách phẳng các row body theo đúng thứ tự render. Khi đang group, center rows bị sắp xếp * lại theo từng group nên `table.getRowModel().rows` không còn khớp thứ tự hiển thị. Logic * border `z-at-bottom` phải dùng thứ tự hiển thị này, nếu không `border-bottom: none` sẽ bị gán * nhầm cho row đang nằm ở giữa bảng. */ protected readonly renderedBodyRows: _angular_core.Signal[]>; protected readonly bodyRowSpanRows: _angular_core.Signal[]>; protected readonly virtualGroupedFlatItems: _angular_core.Signal[]>; protected _getVirtualGroupHeader(item: ZVirtualFlatItem | undefined): ZTableGroupRowItem | null; protected _isVirtualGroupChild(item: ZVirtualFlatItem | undefined): boolean; protected _getVirtualGroupDepth(item: ZVirtualFlatItem | undefined): number; protected readonly searchConfig: _angular_core.Signal<{ enabled: boolean; placeholder: string; debounceTime: number; width: string; size: _shival99_z_ui_components_z_input.ZInputSize; } | null>; protected readonly isSearchEnabled: _angular_core.Signal; /** Data signal with force-update support for control API mutations */ private readonly _data; /** * Converts ZTableColumnConfig[] into TanStack ColumnDef[]. * Handles special columns (select, expand, actionRowPin), action column sizing, * and rowSpan/expand compatibility (expand column is removed when rowSpan is used). */ private readonly _columns; protected readonly isVirtual: _angular_core.Signal; /** Normalized virtual config with defaults applied */ private readonly _virtualConfig; protected readonly virtualRowHeight: _angular_core.Signal; protected readonly dynamicSize: _angular_core.Signal; private readonly _virtualColumnsConfig; protected readonly groupSize: _angular_core.Signal; protected readonly groupHeight: _angular_core.Signal; private readonly _dynamicGroupsVersion; /** * Groups rows for virtual scrolling. When rowSpan is used, rows that share * a merged cell are grouped together so the virtualizer treats them as * a single unit, preserving the visual merge across scroll boundaries. */ protected readonly dynamicGroups: _angular_core.Signal; protected readonly hasFooter: _angular_core.Signal; protected readonly isEmpty: _angular_core.Signal; protected readonly isNoSearchResults: _angular_core.Signal; protected readonly leftLeafColumns: _angular_core.Signal[]>; protected readonly centerLeafColumns: _angular_core.Signal[]>; protected readonly rightLeafColumns: _angular_core.Signal[]>; protected readonly hasComplexColumnLayout: _angular_core.Signal; protected readonly canUseVirtualColumns: _angular_core.Signal; protected readonly columnVirtualizer: _shival99_angular_virtual.AngularVirtualizer; protected readonly virtualCenterColumnItems: _angular_core.Signal<_shival99_angular_virtual.VirtualItem[]>; protected readonly virtualCenterColumns: _angular_core.Signal[]>; protected readonly virtualCenterColumnVisibilityMap: _angular_core.Signal>; protected readonly firstVirtualCenterColumnId: _angular_core.Signal; protected readonly lastVirtualCenterColumnId: _angular_core.Signal; protected readonly virtualLeftSpacerWidth: _angular_core.Signal; protected readonly virtualRenderedLeftSpacerWidth: _angular_core.Signal; protected readonly virtualCenterTotalWidth: _angular_core.Signal; protected readonly virtualRightSpacerWidth: _angular_core.Signal; protected readonly virtualRenderedRightSpacerWidth: _angular_core.Signal; protected readonly renderedColumnCount: _angular_core.Signal; protected readonly renderedNativeColumnWidth: _angular_core.Signal; protected readonly renderedTableWidth: _angular_core.Signal; protected readonly nativeRenderedColumnSizeMap: _angular_core.Signal>; protected readonly orderedLeafColumns: _angular_core.Signal[]>; protected readonly fitColumnIds: _angular_core.Signal; protected readonly hideableColumns: _angular_core.Signal[]>; protected readonly pendingColumnVisibilityDisabledMap: _angular_core.Signal>; protected readonly orderedHeaderGroups: _angular_core.Signal<{ id: string; headers: _tanstack_angular_table.Header[]; }[]>; protected readonly orderedFooterGroups: _angular_core.Signal<{ id: string; depth: number; headers: _tanstack_angular_table.Header[]; }[]>; private _maxFooterArrayRows; protected readonly bottomRowsReversed: _angular_core.Signal[]>; protected readonly leftHeaderRow: _angular_core.Signal<_tanstack_angular_table.Header[]>; protected readonly centerHeaderRow: _angular_core.Signal<_tanstack_angular_table.Header[]>; protected readonly rightHeaderRow: _angular_core.Signal<_tanstack_angular_table.Header[]>; protected readonly virtualCenterHeaderRow: _angular_core.Signal<_tanstack_angular_table.Header[]>; protected readonly shouldHeaderShowShadow: _angular_core.Signal; protected readonly shouldFooterShowShadow: _angular_core.Signal; protected readonly tbodyContainerWidth: _angular_core.WritableSignal; protected readonly tbodyContainerHeight: _angular_core.WritableSignal; protected readonly colDomWidthMap: _angular_core.WritableSignal>; private readonly _colDomWidthUpdater; protected readonly skeletonRowHeight: _angular_core.WritableSignal; protected readonly skeletonRowCount: _angular_core.Signal; protected readonly skeletonRows: _angular_core.Signal; protected readonly dynamicGroupRows: _angular_core.Signal[][]>; /** Pinned top rows rendered separately from the virtualizer loop in virtual scroll mode. */ protected readonly virtualPinnedTopRows: _angular_core.Signal[]>; protected readonly virtualPinnedTopHeight: _angular_core.Signal; /** Pinned bottom rows rendered separately from the virtualizer loop in virtual scroll mode. */ protected readonly virtualPinnedBottomRows: _angular_core.Signal[]>; protected readonly virtualPinnedBottomHeight: _angular_core.Signal; protected readonly dynamicGroupHeights: _angular_core.Signal; protected readonly columnSizing: _angular_core.Signal; protected readonly columnSizingInfo: _angular_core.Signal<_tanstack_angular_table.ColumnSizingInfoState>; protected readonly columnSizeVars: _angular_core.Signal>; protected readonly table: ReturnType>; private readonly _virtualGroupCount; protected readonly selectedRowIds: _angular_core.Signal; protected readonly selectedRows: _angular_core.Signal; protected readonly bulkActionContext: _angular_core.Signal>; protected readonly bulkActionConfig: _angular_core.Signal | null>; protected readonly bulkActionItems: _angular_core.Signal[]>; protected readonly showBulkBar: _angular_core.Signal; protected readonly bulkBarPositions: ConnectedPosition[]; private readonly _bulkBarExitDuration; /** Stable identity key per virtual index (row/group id, not array index) — prevents height jitter on fast scroll. */ private readonly _virtualItemKeys; /** Estimate height learned from rendered rows (dynamicSize); falls back to `virtual.size`. Reduces layout shift. */ private _dynamicEstimateHeight; protected readonly effectiveDynamicRowSizing: _angular_core.Signal; /** Virtualizer instance — operates on groups rather than individual rows */ protected readonly virtualizer: _shival99_angular_virtual.AngularVirtualizer; private readonly _measureVirtualItems; /** Learn estimate height from measured rows (reads the measurement cache, no reflow). Locks once. */ private _learnDynamicEstimate; private readonly _rowDragAutoScroll; private readonly _rowDragCellSelectionCleanup; constructor(); ngAfterViewInit(): void; /** * Syncs parent row selection state based on children. * If all children are selected, the parent is auto-selected; * if no children are selected, the parent is deselected. */ private _handleRowSelectionWithParents; protected clearSelection(): void; protected onBulkActionClick(item: ZTableBulkActionItem): Promise; private _resolveBulkActionList; private _createBulkActionHandlerContext; private _exportSelectionToExcel; private _createExcelExportContext; private _getExcelExportData; private _getExcelExportFileName; private _toExcelTableColumns; private _getExcelColumnHeader; private _getExcelColumnHeaderAlign; private _clearBulkBarTimer; private _clearContentRowMenuOutsideListener; /** * Wraps state mutations with a debounced processing indicator. * Shows a brief loading state to prevent UI flicker during * filter/sort recomputation on large datasets. */ private _runAsyncStateUpdate; private _emitFilterChangeDebounced; private _checkScrollState; private _refreshPinnedRowHeights; private _schedulePinnedRowHeightsRefresh; private _cancelPinnedRowHeightsRefresh; private _refreshVirtualSpacerWidths; private _setVirtualMeasuredSpacerWidths; private _scheduleVirtualSpacerWidthRefresh; private _cancelVirtualSpacerWidthRefresh; private _checkVerticalScroll; private _checkLastRowTouchesBottom; private _getTbodyViewportElement; private _handleColumnSizingChange; private _clampColumnSizing; private _syncColumnBaseSizing; private _scheduleFitColumnWidths; private _applyFitColumnWidths; private _setColumnSizingFromFit; private _getColumnBaseSize; private _isSameColumnSizing; private _reconcileColumnSizing; private _checkHorizontalScroll; private _updateScrollShadowState; private _updateVerticalScrollShadowState; hasRightPinnedColumns(): boolean; onTbodyScroll(event: Event): void; private _syncScrollLeft; /** * @deprecated Header sort now lives in the column filter popover. * Giữ tạm để các consumer/template cũ còn compile trong giai đoạn chuyển đổi. */ handleSort(event: Event, handler?: (event: unknown) => void): void; protected _handleDragDrop(event: ZTableDragDropData): void; private _handleRowDrop; onToggleAllColumns(): void; onPageChange(event: { pageIndex: number; pageSize: number; }, emitType?: 'user' | 'auto'): void; onSearchChange(value: string | number | null): void; clearAppliedFilterChip(chip: ZTableAppliedFilterChip): void; clearAppliedFilters(): void; toggleFilterHeaderExpanded(): void; toggleHeaderFooterShadow(): void; onActionClick(event: ZTableActionClickEvent): void; protected setContentRowMenuControl(control: ZPopoverControl): void; protected setCellMenuControl(control: ZPopoverControl): void; protected clearCellMenu(): void; protected clearContentRowMenu(): void; protected onCellPointerDown(event: PointerEvent, row: Row, columnId: string): void; /** Arms a range-drag on cell pointerdown and starts document-level move/up tracking to confirm it. */ private _armCellDrag; protected onCellPointerEnter(event: PointerEvent, row: Row, columnId: string): void; protected openCellMenu(event: MouseEvent, row: Row, columnId: string): void; protected openContentRowMenu(event: MouseEvent, row: Row, columnId?: string): void; protected insertContentRow(position: ZTableRowInsertPosition): void; protected deleteContentRows(): void; private _removeDeletedRowsFromSelection; protected onContentTableKeydown(event: KeyboardEvent): void; protected copySelectedCells(includeHeaders: boolean): void; protected copyContentCell(): void; protected copyContentRows(rowId?: string): void; protected pasteContentRows(position: ZTableRowInsertPosition, rowId?: string): void; protected moveContentRow(direction: ZTableRowMoveDirection): void; private _getContentRowsToDelete; private _getRowSourceIndex; private _getRowVisibleIndex; private _getContentRowsForRowAction; private _getContentRowActionTarget; private _isEditableKeyboardTarget; private _isContentEditorTarget; private _getContentEditClipboardText; private _getSelectedTextFromEditor; protected isCellInSelectedRange(rowId: string, columnId: string): boolean; private _listenCellInteractionOutside; private _hasCellInteractionState; private _isInsideCellInteractionBoundary; private _clearCellInteractionState; private _getCellSelectionId; private _getSelectedCellRange; private _getSelectedCellVisualRects; private _getRenderedCellVisualRect; private _hasOutsideVisualNeighbor; private _getCellVisualSlotId; private _buildSelectedCellsText; private _getSelectableColumnIds; private _isSelectableCellColumn; private _isSelectableCell; private _isIgnoredCellSelectionTarget; private _isCellSelectionDragTarget; private _formatCellClipboardValue; private _getRenderedCellClipboardValue; private _getRenderedBodyCell; private _getColumnCopyHeader; private _getColumnDisplayHeader; private _formatFilterChipValue; private _formatFilterConditionChip; private _formatFilterJoinLabel; private _formatFilterOptionValue; private _formatRangeChipValue; private _formatDateRangeChipValue; private _formatDateChipValue; private _formatRawFilterChipValue; private _isFilterChipCondition; private _emitSearchChange; private _collapseFilterHeaderWhenNeeded; private _bumpFilterResetVersion; private _writeClipboardText; private _getContentEditTriggerTarget; private _clearContentEditCell; private _listenContentRowMenuOutside; onCellClick(row: Row, columnId: string, value: unknown): void; onCellEdit(event: ZTableEditCellChangeEvent): void; onContentEditStart(event: MouseEvent, rowId: string, columnId: string): void; onContentEditKeydown(event: KeyboardEvent, rowId: string, columnId: string): void; onContentEditCommit(newValue: unknown, row: Row, columnId: string, oldValue: unknown): void; onContentEditCancel(): void; private _getContentEditDirection; private _findContentEditTarget; private _findHorizontalContentEditTarget; private _restoreContentEditFocus; openSettingsDrawer(): void; onPendingColumnDrop(event: CdkDragDrop): void; onVisibleColumnsChange(values: (string | number)[]): void; onToggleColumnVisibility(columnId: string): void; onToggleColumnPin(columnId: string, position: 'left' | 'right'): void; handleColumnPin(columnId: string, position: 'left' | 'right' | false): void; private _canPinWithinViewport; private _getPinnedWidth; toggleColumnVisibility(columnId: string): void; refreshColumnPopoverPositions(...popovers: ZPopoverDirective[]): void; setActiveColumnVisibilityPopover(popover: ZPopoverDirective): void; clearActiveColumnVisibilityPopover(popover: ZPopoverDirective): void; hideActiveColumnVisibilityPopover(): void; hideColumnPopoversOnOutsideClick(optionsPopover: ZPopoverDirective): void; openSettingsDrawerFromColumnMenu(...popovers: ZPopoverDirective[]): void; canGroupColumn(columnId: string): boolean; isGroupingColumn(columnId: string): boolean; groupByColumn(columnId: string): void; clearGrouping(): void; removeGroupingColumn(columnId: string): void; toggleGroupRow(groupId: string): void; autosizeColumn(columnId: string): void; autosizeAllColumns(): void; resetColumns(): void; private _getDefaultColumnOrder; private _getInitialGroupingColumnIds; private _isColumnHiddenFromVisibilityMenu; private _setMeasuredColumnWidth; private _measureColumnContentWidth; private _defaultColumnPinning; private _setColumnPinning; private _sortColumnPinningByOrder; private _moveGroupingColumnsToLeadingDataPosition; private _areColumnIdListsEqual; moveColumnLeft(columnId: string): void; moveColumnRight(columnId: string): void; isFirstMovableColumn(columnId: string): boolean; isLastMovableColumn(columnId: string): boolean; private _isFixedLeadingColumnId; private _isRowPinColumnId; private _isSpecialColumnId; /** Saves current column layout, sizing, pinning, and visibility to ZCacheService */ private _saveConfig; private _collectColumnInfo; /** Loads cached config from ZCacheService; validates schema compatibility first */ private _loadConfigCache; private _getConfigCacheKey; /** * Validates cached column info against current config. * Returns false if columns have been added/removed/renamed since cache was saved, * which triggers cache invalidation. */ private _isColumnConfigValid; private _getChangedFilterColumnIds; private _getChangedSortColumnIds; private _isColumnFilterModeLocal; private _isColumnSortModeLocal; private _filterServerModeColumnFilters; private _filterServerModeSorting; private _getGroupId; private _getRowGroupValue; private _getColumnGroupLabel; private _getGroupDate; private _getGroupLabel; private _getActionColumnConfig; /** * Recursively finds a column config by ID with caching. * Cache is invalidated when the column array reference changes. */ private _findColumnConfig; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵcmp: _angular_core.ɵɵComponentDeclaration, "z-table", ["zTable"], { "zClass": { "alias": "zClass"; "required": false; "isSignal": true; }; "zConfig": { "alias": "zConfig"; "required": false; "isSignal": true; }; "zLoading": { "alias": "zLoading"; "required": false; "isSignal": true; }; "zKey": { "alias": "zKey"; "required": false; "isSignal": true; }; "zVariant": { "alias": "zVariant"; "required": false; "isSignal": true; }; }, { "zChange": "zChange"; "zControl": "zControl"; }, never, never, true, never>; } declare class ZTableFilterComponent { readonly zColumn: _angular_core.InputSignal>; readonly zTable: _angular_core.InputSignal>; readonly zResetVersion: _angular_core.InputSignal; readonly zSortingState: _angular_core.InputSignal; readonly zEnableMultiSort: _angular_core.InputSignal; private readonly _columnDef; private readonly _appliedFilterConditions; private readonly _appliedLegacyFilterValue; private readonly _appliedSortState; protected readonly sortOptions: _angular_core.Signal[]>; protected readonly draftFilters: _angular_core.WritableSignal; protected readonly draftLegacyFilterValue: _angular_core.WritableSignal; protected readonly draftSortState: _angular_core.WritableSignal; protected readonly columnFilterValue: _angular_core.Signal; protected readonly effectiveFilterValue: _angular_core.Signal; protected readonly sortState: _angular_core.Signal; protected readonly effectiveSortState: _angular_core.Signal; protected readonly canSort: _angular_core.Signal; protected readonly canFilter: _angular_core.Signal; protected readonly filterUi: _angular_core.Signal; protected readonly advancedType: _angular_core.Signal; protected readonly isAdvancedUi: _angular_core.Signal; protected readonly isBuilderMode: _angular_core.Signal; protected readonly legacyAdvancedType: _angular_core.Signal; protected readonly popoverContentClass: _angular_core.Signal; protected readonly popoverWidth: _angular_core.Signal; protected readonly sortLabelKey: _angular_core.Signal; protected readonly legacyFilterLabelKey: _angular_core.Signal; protected readonly filterConditions: _angular_core.Signal; protected readonly filterConditionViews: _angular_core.Signal; protected readonly canAddFilterCondition: _angular_core.Signal; protected readonly filterBadgeCount: _angular_core.Signal; protected readonly hasFilterValue: _angular_core.Signal; protected readonly isActive: _angular_core.Signal; protected readonly draftSortValue: _angular_core.Signal<"none" | "desc" | "asc">; protected readonly rangeMinValue: _angular_core.Signal; protected readonly rangeMaxValue: _angular_core.Signal; protected readonly dateValue: _angular_core.Signal; protected readonly timeValue: _angular_core.Signal; protected readonly dateRangeValue: _angular_core.Signal; protected readonly selectValue: _angular_core.Signal<{} | null>; protected readonly multiSelectValue: _angular_core.Signal; protected readonly selectOptions: _angular_core.Signal<{ label: string; value: any; }[]>; protected readonly selectConfig: _angular_core.Signal>>; private readonly _syncExternalAppliedState; syncDraft(): void; toggleBasicSort(): void; addDraftFilter(joinWithPrev: ZTableFilterJoinOperator): void; removeDraftFilter(id: string): void; updateFilterOperator(id: string, operator: ZTableFilterOperator | null): void; updateFilterValue(id: string, value: unknown): void; updateDraftSort(value: string | null): void; resetFilters(): void; applyFilters(): void; onMinChangeDebounced(value: string | number | null): void; onMaxChangeDebounced(value: string | number | null): void; onDateChange(value: Date | null): void; onTimeChange(value: Date | null): void; onDateRangeChange(value: ZDateRange | null): void; onSelectChange(value: unknown): void; onMultiSelectChange(value: unknown[]): void; private _normalizeFilterUi; private _normalizeAdvancedType; private _defaultLegacyFilterLabelKey; private _normalizeFilterConditions; private _isFilterCondition; private _operatorDefinitions; private _operatorOptions; private _operatorOptionsForDraft; private _conditionJoinTone; private _withDraftId; private _createDraftId; private _isApplicableCondition; private _isValueLessOperator; private _applySortState; private _setColumnSorting; private _shouldPreserveOtherSorts; private _getColumnSortState; private _normalizeSortState; private _hasLegacyFilterValue; private _normalizeLegacyFilterValue; private _syncAppliedStateFromColumn; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵcmp: _angular_core.ɵɵComponentDeclaration, "z-table-filter", never, { "zColumn": { "alias": "zColumn"; "required": true; "isSignal": true; }; "zTable": { "alias": "zTable"; "required": true; "isSignal": true; }; "zResetVersion": { "alias": "zResetVersion"; "required": false; "isSignal": true; }; "zSortingState": { "alias": "zSortingState"; "required": false; "isSignal": true; }; "zEnableMultiSort": { "alias": "zEnableMultiSort"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>; } declare class ZTableIconTextComponent { readonly zText: _angular_core.InputSignal; readonly zTooltip: _angular_core.InputSignal; readonly zTriggerElement: _angular_core.InputSignal; private readonly _hostEl; private readonly _zTranslate; protected readonly triggerEl: _angular_core.Signal; protected readonly translatedParts: _angular_core.Signal; protected readonly tooltipContent: _angular_core.Signal; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class ZTableActionsComponent { readonly zConfig: _angular_core.InputSignal>; readonly zRow: _angular_core.InputSignal; readonly zRowId: _angular_core.InputSignal; readonly zDropdownButtonSize: _angular_core.InputSignal<"sm" | "default" | "lg" | "xs" | "xl" | null | undefined>; readonly zActionClick: _angular_core.OutputEmitterRef>; protected readonly allActions: _angular_core.Signal[]>; protected readonly shouldShowAsButtons: _angular_core.Signal; protected readonly actionStates: _angular_core.Signal>; protected readonly dropdownItems: _angular_core.Signal; private _getTooltipState; protected _onActionClick(action: ZTableActionItem, event: Event): void; protected _onDropdownItemClick(item: ZDropdownMenuItem): void; private _emitActionClick; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵcmp: _angular_core.ɵɵComponentDeclaration, "z-table-actions", never, { "zConfig": { "alias": "zConfig"; "required": true; "isSignal": true; }; "zRow": { "alias": "zRow"; "required": true; "isSignal": true; }; "zRowId": { "alias": "zRowId"; "required": true; "isSignal": true; }; "zDropdownButtonSize": { "alias": "zDropdownButtonSize"; "required": false; "isSignal": true; }; }, { "zActionClick": "zActionClick"; }, never, never, true, never>; } declare class ZTableEditCellComponent implements OnInit { private readonly _destroyRef; readonly zRow: _angular_core.InputSignal; readonly zRowId: _angular_core.InputSignal; readonly zRowIndex: _angular_core.InputSignal; readonly zColumnId: _angular_core.InputSignal; readonly zValue: _angular_core.InputSignal; readonly zEditConfig: _angular_core.InputSignal | undefined>; readonly zRowUpdate: _angular_core.InputSignal<{ rowId: string; updates: Record; } | null>; readonly zChange: _angular_core.OutputEmitterRef>; private readonly _currentValue; private readonly _valueChange$; private _pendingBlurValue; private _hasPendingBlur; constructor(); protected readonly editConfig: _angular_core.Signal>; protected readonly cfg: _angular_core.Signal; protected readonly selectOptions: _angular_core.Signal[]>; protected readonly autocompleteOptions: _angular_core.Signal[]>; protected readonly value: _angular_core.Signal; protected readonly stringValue: _angular_core.Signal; protected readonly numericValue: _angular_core.Signal; protected readonly booleanValue: _angular_core.Signal; protected readonly dateValue: _angular_core.Signal; protected onValueChange(newValue: unknown): void; protected onInputBlur(): void; protected onImmediateChange(newValue: unknown): void; protected onSelectChange(newValue: unknown): void; protected onAutocompleteCommit(event: { value: string; source: 'enter' | 'blur'; }): void; protected onAutocompleteSelect(option: ZAutocompleteOption): void; private _emitChange; ngOnInit(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵcmp: _angular_core.ɵɵComponentDeclaration, "z-table-edit-cell", never, { "zRow": { "alias": "zRow"; "required": true; "isSignal": true; }; "zRowId": { "alias": "zRowId"; "required": true; "isSignal": true; }; "zRowIndex": { "alias": "zRowIndex"; "required": true; "isSignal": true; }; "zColumnId": { "alias": "zColumnId"; "required": true; "isSignal": true; }; "zValue": { "alias": "zValue"; "required": false; "isSignal": true; }; "zEditConfig": { "alias": "zEditConfig"; "required": false; "isSignal": true; }; "zRowUpdate": { "alias": "zRowUpdate"; "required": false; "isSignal": true; }; }, { "zChange": "zChange"; }, never, never, true, never>; } /** Type guard: is this a full header config object (not just content shorthand)? */ declare const isHeaderConfig: (config: ZTableHeaderColumnConfig | ZTableHeaderContent | undefined) => config is ZTableHeaderColumnConfig; /** Type guard: is this a full body config object (not just content shorthand)? */ declare const isBodyConfig: (config: ZTableBodyColumnConfig | ZTableCellContent | undefined) => config is ZTableBodyColumnConfig; /** Type guard: is this a full footer config object (not just content shorthand)? */ declare const isFooterConfig: (config: ZTableFooterConfig | undefined) => config is ZTableFooterColumnConfig; /** Extract and normalize header config from a column definition */ declare const getHeaderConfig: (col: ZTableColumnConfig | undefined) => { content: ZTableHeaderContent | undefined; class: string | undefined; style: Record | undefined; align: string | undefined; tooltip: string | object | undefined; rowSpan: number | undefined; colSpan: number | undefined; contentClass: string | ((info: unknown) => string) | undefined; contentStyle: Record | ((info: unknown) => Record) | undefined; } | { content: ZTableHeaderContent | undefined; class: string | undefined; style: Record | undefined; align: ZTableAlign | undefined; tooltip: string | _shival99_z_ui_components_z_tooltip.ZTooltipConfig | undefined; rowSpan: number | undefined; colSpan: number | undefined; contentClass: string | ((info: _tanstack_angular_table.HeaderContext) => string) | ((info: _tanstack_angular_table.HeaderContext) => string) | undefined; contentStyle: Record | ((info: _tanstack_angular_table.HeaderContext) => Record) | ((info: _tanstack_angular_table.HeaderContext) => Record) | undefined; }; /** * Extract and normalize body config from a column definition. * Resolves dynamic properties (class, style, rowSpan, etc.) when CellContext is provided. */ declare const getBodyConfig: (col: ZTableColumnConfig | undefined, ctx?: CellContext) => { content: ZTableCellContent | undefined; type: "default"; tagColor: "primary"; class: string | undefined; style: Record | undefined; align: string | undefined; rowSpan: number | undefined; colSpan: number | undefined; contentClass: string | undefined; contentStyle: Record | undefined; tooltip: string | object | undefined; popover: string | object | undefined; } | { content: ZTableCellContent | undefined; type: _shival99_z_ui_components_z_table.ZTableBodyContentType; tagColor: _shival99_z_ui_components_z_tags.ZTagColor | ((info: CellContext) => _shival99_z_ui_components_z_table.ZTableTagColor); class: string | ((info: CellContext) => string) | undefined; style: Record | undefined; align: ZTableAlign | undefined; rowSpan: number | undefined; colSpan: number | undefined; contentClass: string | ((info: CellContext) => string) | undefined; contentStyle: Record | undefined; tooltip: ZTableBodyTooltipConfig | undefined; popover: ZTableBodyPopoverConfig | undefined; }; declare const getFooterConfig: (col: ZTableColumnConfig | undefined, footerRowIndex?: number) => { content: ZTableHeaderContent | undefined; class: string | undefined; style: Record | undefined; align: string | undefined; tooltip: string | object | undefined; rowSpan: number | undefined; colSpan: number | undefined; contentClass: string | ((info: unknown) => string) | undefined; contentStyle: Record | ((info: unknown) => Record) | undefined; } | { content: ZTableHeaderContent | undefined; class: string | undefined; style: Record | undefined; align: ZTableAlign | undefined; tooltip: string | _shival99_z_ui_components_z_tooltip.ZTooltipConfig | undefined; rowSpan: number | undefined; colSpan: number | undefined; contentClass: string | ((info: _tanstack_angular_table.HeaderContext) => string) | ((info: _tanstack_angular_table.HeaderContext) => string) | undefined; contentStyle: Record | ((info: _tanstack_angular_table.HeaderContext) => Record) | ((info: _tanstack_angular_table.HeaderContext) => Record) | undefined; }; /** Recursively search for a column config by ID within a (possibly nested) column array */ declare const findColumnConfig: (columnId: string, columns: ZTableColumnConfig[]) => ZTableColumnConfig | undefined; /** * Converts the consumer-facing ZTableColumnConfig into a TanStack ColumnDef. * This is the bridge between the z-table API and TanStack Table internals. * * Handles: * - Accessor mapping (accessorKey / accessorFn) * - Header/body/footer content resolution * - Sort and filter function wiring (local vs server mode) * - Built-in filter functions for each filter type * - Recursive nested column conversion */ declare function columnConfigToColumnDef(config: ZTableColumnConfig): ColumnDef; export { ZTableActionsComponent, ZTableComponent, ZTableEditCellComponent, ZTableFilterComponent, ZTableIconTextComponent, columnConfigToColumnDef, findColumnConfig, getBodyConfig, getFooterConfig, getHeaderConfig, isBodyConfig, isFooterConfig, isHeaderConfig }; 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 };