@shival99/z-ui 1.9.25 → 1.9.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/shival99-z-ui-components-z-calendar.mjs +42 -3
- package/fesm2022/shival99-z-ui-components-z-calendar.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-modal.mjs +2 -2
- package/fesm2022/shival99-z-ui-components-z-modal.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-table.mjs +246 -4
- package/fesm2022/shival99-z-ui-components-z-table.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-i18n.mjs +4 -0
- package/fesm2022/shival99-z-ui-i18n.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-services.mjs +1 -0
- package/fesm2022/shival99-z-ui-services.mjs.map +1 -1
- package/package.json +1 -1
- package/types/shival99-z-ui-components-z-calendar.d.ts +4 -0
- package/types/shival99-z-ui-components-z-table.d.ts +98 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shival99/z-ui",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.27",
|
|
4
4
|
"description": "Z-UI: Modern Angular UI Component Library - A comprehensive, high-performance design system built with Angular 20+, featuring 40+ customizable components with dark mode, accessibility, and enterprise-ready features.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -2,6 +2,7 @@ import * as _angular_core from '@angular/core';
|
|
|
2
2
|
import { Signal, OnInit, ElementRef } from '@angular/core';
|
|
3
3
|
import { ControlValueAccessor } from '@angular/forms';
|
|
4
4
|
import { ZPopoverControl } from '@shival99/z-ui/components/z-popover';
|
|
5
|
+
import { ZSelectOption } from '@shival99/z-ui/components/z-select';
|
|
5
6
|
import { ZEvent } from '@shival99/z-ui/utils';
|
|
6
7
|
import { ClassValue } from 'clsx';
|
|
7
8
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
@@ -204,6 +205,7 @@ declare class ZCalendarComponent implements OnInit, ControlValueAccessor {
|
|
|
204
205
|
protected readonly period: _angular_core.WritableSignal<"AM" | "PM">;
|
|
205
206
|
protected readonly inputDisplayValue: _angular_core.WritableSignal<string>;
|
|
206
207
|
protected readonly activePresetKey: _angular_core.WritableSignal<string | null>;
|
|
208
|
+
protected readonly quickSelectOptions: _angular_core.Signal<ZSelectOption<string>[]>;
|
|
207
209
|
protected readonly uiState: _angular_core.WritableSignal<{
|
|
208
210
|
hasViewChanged: boolean;
|
|
209
211
|
hasEndViewChanged: boolean;
|
|
@@ -318,6 +320,7 @@ declare class ZCalendarComponent implements OnInit, ControlValueAccessor {
|
|
|
318
320
|
protected onQuarterClick(quarterIndex: number): void;
|
|
319
321
|
protected onMonthSelect(monthIndex: number): void;
|
|
320
322
|
protected onQuickSelect(preset: ZQuickSelectPreset): void;
|
|
323
|
+
protected onQuickSelectKeyChange(key: string | null): void;
|
|
321
324
|
protected onTodayClick(): void;
|
|
322
325
|
protected onClear(event: MouseEvent): void;
|
|
323
326
|
protected onCancelClick(): void;
|
|
@@ -351,6 +354,7 @@ declare class ZCalendarComponent implements OnInit, ControlValueAccessor {
|
|
|
351
354
|
private _handleRangeSelection;
|
|
352
355
|
private _updateTimeToDate;
|
|
353
356
|
private _detectMatchingPreset;
|
|
357
|
+
private _isQuickSelectPresetDisabled;
|
|
354
358
|
private _applyValue;
|
|
355
359
|
private _getEmitValue;
|
|
356
360
|
private _getValidationErrors;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as _tanstack_angular_table from '@tanstack/angular-table';
|
|
2
|
-
import { RowData,
|
|
2
|
+
import { RowData, RowSelectionState, HeaderContext, CellContext, FlexRenderComponent, Row, SortingState, ColumnFiltersState, PaginationState, ExpandedState, ColumnPinningState, RowPinningState, VisibilityState, ColumnOrderState, Column, createAngularTable, Table, ColumnDef } from '@tanstack/angular-table';
|
|
3
3
|
import * as _shival99_angular_virtual from '@shival99/angular-virtual';
|
|
4
4
|
import * as _shival99_z_ui_components_z_input from '@shival99/z-ui/components/z-input';
|
|
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, OnDestroy, OnInit } from '@angular/core';
|
|
8
8
|
import { CdkDragDrop, CdkDragEnd } from '@angular/cdk/drag-drop';
|
|
9
|
+
import { ConnectedPosition } from '@angular/cdk/overlay';
|
|
9
10
|
import { ClassValue } from 'clsx';
|
|
10
11
|
import { NgScrollbar } from 'ngx-scrollbar';
|
|
11
12
|
import { ZAutocompleteType, ZAutocompleteOption } from '@shival99/z-ui/components/z-autocomplete';
|
|
@@ -15,6 +16,7 @@ import * as _shival99_z_ui_components_z_select from '@shival99/z-ui/components/z
|
|
|
15
16
|
import { ZSelectOption } from '@shival99/z-ui/components/z-select';
|
|
16
17
|
import * as _shival99_z_ui_components_z_tooltip from '@shival99/z-ui/components/z-tooltip';
|
|
17
18
|
import { ZTooltipConfig, ZTooltipContent } from '@shival99/z-ui/components/z-tooltip';
|
|
19
|
+
import { ZExcelColumnConfig, ZExcelExportOptions } from '@shival99/z-ui/services';
|
|
18
20
|
import * as _shival99_z_ui_components_z_table from '@shival99/z-ui/components/z-table';
|
|
19
21
|
import { ZDateRange } from '@shival99/z-ui/components/z-calendar';
|
|
20
22
|
import { ZDropdownMenuItem } from '@shival99/z-ui/components/z-dropdown-menu';
|
|
@@ -181,6 +183,7 @@ interface ZTableControl<T> {
|
|
|
181
183
|
toggleSettings: () => void;
|
|
182
184
|
resetFilters: () => void;
|
|
183
185
|
resetSorting: () => void;
|
|
186
|
+
clearSelection: () => void;
|
|
184
187
|
addItem: (item: T) => void;
|
|
185
188
|
updateItem: (id: string | number, updates: Partial<T>, fieldKey?: keyof T) => void;
|
|
186
189
|
deleteItem: (id: string | number, fieldKey?: keyof T) => void;
|
|
@@ -377,6 +380,59 @@ interface ZTableActionClickEvent<T = unknown> {
|
|
|
377
380
|
rowId: string;
|
|
378
381
|
action: ZTableActionItem<T>;
|
|
379
382
|
}
|
|
383
|
+
interface ZTableBulkActionContext<T = unknown> {
|
|
384
|
+
selectedRows: T[];
|
|
385
|
+
selectedRowIds: string[];
|
|
386
|
+
selection: RowSelectionState;
|
|
387
|
+
}
|
|
388
|
+
interface ZTableBulkActionHandlerContext<T = unknown> extends ZTableBulkActionContext<T> {
|
|
389
|
+
exportExcel: (config: ZTableExcelExportConfig<T>) => Promise<void>;
|
|
390
|
+
}
|
|
391
|
+
interface ZTableBulkActionItem<T = unknown> extends Omit<ZTableActionItem<ZTableBulkActionContext<T>>, 'disabled' | 'hidden'> {
|
|
392
|
+
disabled?: boolean | ((context: ZTableBulkActionContext<T>) => boolean);
|
|
393
|
+
hidden?: boolean | ((context: ZTableBulkActionContext<T>) => boolean);
|
|
394
|
+
handler?: (context: ZTableBulkActionHandlerContext<T>) => void | false | Promise<void | false>;
|
|
395
|
+
}
|
|
396
|
+
interface ZTableBulkActionViewItem<T = unknown> {
|
|
397
|
+
action: ZTableBulkActionItem<T>;
|
|
398
|
+
disabled: boolean;
|
|
399
|
+
}
|
|
400
|
+
type ZTableBulkActionList<T = unknown> = ZTableBulkActionItem<T>[] | ((context: ZTableBulkActionContext<T>) => ZTableBulkActionItem<T>[]);
|
|
401
|
+
interface ZTableBulkActionOptions<T = unknown> {
|
|
402
|
+
enabled?: boolean;
|
|
403
|
+
/** Custom actions rendered when rows are selected. */
|
|
404
|
+
actions?: ZTableBulkActionList<T>;
|
|
405
|
+
maxVisible?: number;
|
|
406
|
+
selectedLabel?: string;
|
|
407
|
+
clearLabel?: string;
|
|
408
|
+
}
|
|
409
|
+
type ZTableBulkActionConfig<T = unknown> = ZTableBulkActionOptions<T> | ZTableBulkActionList<T>;
|
|
410
|
+
interface ZTableBulkActionClickEvent<T = unknown> extends ZTableBulkActionContext<T> {
|
|
411
|
+
key: string;
|
|
412
|
+
action: ZTableBulkActionItem<T>;
|
|
413
|
+
}
|
|
414
|
+
type ZTableExcelExportScope = 'selected' | 'filtered' | 'all';
|
|
415
|
+
interface ZTableExcelExportContext<T = unknown> extends ZTableBulkActionContext<T> {
|
|
416
|
+
data: T[];
|
|
417
|
+
columns: ZTableColumnConfig<T>[];
|
|
418
|
+
}
|
|
419
|
+
interface ZTableExcelExportConfig<T = unknown> {
|
|
420
|
+
enabled?: boolean;
|
|
421
|
+
/** Built-in action key. Use the same key in bulkAction to override the button. */
|
|
422
|
+
actionKey?: string;
|
|
423
|
+
actionLabel?: string;
|
|
424
|
+
actionIcon?: ZIcon;
|
|
425
|
+
actionIconSize?: string;
|
|
426
|
+
fileName?: string | ((context: ZTableExcelExportContext<T>) => string);
|
|
427
|
+
sheetName?: string;
|
|
428
|
+
/** Shortcut for `scope: 'all'`. */
|
|
429
|
+
exportAll?: boolean;
|
|
430
|
+
scope?: ZTableExcelExportScope;
|
|
431
|
+
excludeColumns?: string[];
|
|
432
|
+
excelOverrides?: Partial<Record<string, Partial<ZExcelColumnConfig<T>>>>;
|
|
433
|
+
headerResolver?: (col: ZTableColumnConfig<T>) => string;
|
|
434
|
+
options?: ZExcelExportOptions;
|
|
435
|
+
}
|
|
380
436
|
/**
|
|
381
437
|
* @deprecated Use `ZTableBodyColumnConfig.actions` directly with an action array
|
|
382
438
|
* or `(row) => action[]`, and set `actionMaxVisible` on the body config when needed.
|
|
@@ -390,7 +446,7 @@ interface ZTableActionColumnConfig<T = unknown> {
|
|
|
390
446
|
}
|
|
391
447
|
type ZTableActionBodyConfig<T = unknown> = ZTableActionColumnConfig<T> | (ZTableActionList<T> & Partial<ZTableActionColumnConfig<T>>);
|
|
392
448
|
/** All possible change event types — used as discriminant in ZTableChangeEvent */
|
|
393
|
-
type ZTableChangeType = 'page' | 'sort' | 'filter' | 'search' | 'select' | 'expand' | 'rowSelect' | 'rowSelectAll' | 'rowExpand' | 'rowDrag' | 'cellClick' | 'cellEdit' | 'action';
|
|
449
|
+
type ZTableChangeType = 'page' | 'sort' | 'filter' | 'search' | 'select' | 'expand' | 'rowSelect' | 'rowSelectAll' | 'rowExpand' | 'rowDrag' | 'cellClick' | 'cellEdit' | 'action' | 'bulkAction';
|
|
394
450
|
interface ZTableChangeEventBase {
|
|
395
451
|
type: ZTableChangeType;
|
|
396
452
|
}
|
|
@@ -446,6 +502,10 @@ interface ZTableActionChange<T> extends ZTableChangeEventBase {
|
|
|
446
502
|
type: 'action';
|
|
447
503
|
data: ZTableActionClickEvent<T>;
|
|
448
504
|
}
|
|
505
|
+
interface ZTableBulkActionChange<T> extends ZTableChangeEventBase {
|
|
506
|
+
type: 'bulkAction';
|
|
507
|
+
data: ZTableBulkActionClickEvent<T>;
|
|
508
|
+
}
|
|
449
509
|
interface ZTableCellEditChange<T> extends ZTableChangeEventBase {
|
|
450
510
|
type: 'cellEdit';
|
|
451
511
|
data: ZTableCellEditEvent<T>;
|
|
@@ -463,7 +523,7 @@ interface ZTableCellEditChange<T> extends ZTableChangeEventBase {
|
|
|
463
523
|
* }
|
|
464
524
|
* ```
|
|
465
525
|
*/
|
|
466
|
-
type ZTableChangeEvent<T> = ZTablePageChange | ZTableSortChange | ZTableFilterChange | ZTableSearchChange | ZTableSelectChange | ZTableExpandChange | ZTableRowSelectChange<T> | ZTableRowSelectAllChange<T> | ZTableRowExpandChange<T> | ZTableRowDragChange<T> | ZTableCellClickChange<T> | ZTableCellEditChange<T> | ZTableActionChange<T>;
|
|
526
|
+
type ZTableChangeEvent<T> = ZTablePageChange | ZTableSortChange | ZTableFilterChange | ZTableSearchChange | ZTableSelectChange | ZTableExpandChange | ZTableRowSelectChange<T> | ZTableRowSelectAllChange<T> | ZTableRowExpandChange<T> | ZTableRowDragChange<T> | ZTableCellClickChange<T> | ZTableCellEditChange<T> | ZTableActionChange<T> | ZTableBulkActionChange<T>;
|
|
467
527
|
/** Initial table state — applied on first render, before any cached config is loaded */
|
|
468
528
|
interface ZTableInitialState {
|
|
469
529
|
columnPinning?: ColumnPinningState;
|
|
@@ -585,6 +645,8 @@ interface ZTableConfig<T> {
|
|
|
585
645
|
enableMultiSort?: boolean;
|
|
586
646
|
/** true = enable with defaults; object = full search bar config */
|
|
587
647
|
search?: ZTableSearchConfig | boolean;
|
|
648
|
+
/** Floating bulk action bar shown when rows are selected */
|
|
649
|
+
bulkAction?: ZTableBulkActionConfig<T> | boolean;
|
|
588
650
|
enableRowPinning?: boolean;
|
|
589
651
|
enableColumnPinning?: boolean;
|
|
590
652
|
enableColumnOrdering?: boolean;
|
|
@@ -652,6 +714,7 @@ declare class ZTableComponent<T> implements AfterViewInit {
|
|
|
652
714
|
/** Visual variant: 'default' has card shadow, 'borderless' has no container border */
|
|
653
715
|
readonly zVariant: _angular_core.InputSignal<"default" | "borderless">;
|
|
654
716
|
private readonly _destroy$;
|
|
717
|
+
private readonly _zExcel;
|
|
655
718
|
private readonly _zTranslate;
|
|
656
719
|
/** Prevents recursive scroll sync between thead/tbody/tfoot */
|
|
657
720
|
private readonly _isSyncingScroll;
|
|
@@ -663,6 +726,8 @@ declare class ZTableComponent<T> implements AfterViewInit {
|
|
|
663
726
|
private _settingsDebounceTimeout;
|
|
664
727
|
/** Debounces filter change emissions to server */
|
|
665
728
|
private _filterEmitDebounceTimeout;
|
|
729
|
+
/** Keeps the bulk bar mounted long enough for its exit animation */
|
|
730
|
+
private _bulkBarTimer;
|
|
666
731
|
/** Merged loading state from both zLoading input and config.loading */
|
|
667
732
|
protected readonly isLoading: _angular_core.Signal<boolean>;
|
|
668
733
|
/** True during debounced async state transitions (sort/filter processing) */
|
|
@@ -705,12 +770,18 @@ declare class ZTableComponent<T> implements AfterViewInit {
|
|
|
705
770
|
protected readonly showHorizontalBorder: _angular_core.WritableSignal<boolean>;
|
|
706
771
|
protected readonly showVerticalBorder: _angular_core.WritableSignal<boolean>;
|
|
707
772
|
protected readonly showHeaderFooterShadow: _angular_core.WritableSignal<boolean>;
|
|
773
|
+
protected readonly bulkBarMounted: _angular_core.WritableSignal<boolean>;
|
|
774
|
+
protected readonly bulkBarClosing: _angular_core.WritableSignal<boolean>;
|
|
775
|
+
protected readonly bulkBarConfig: _angular_core.WritableSignal<ZTableBulkActionOptions<T> | null>;
|
|
776
|
+
protected readonly bulkBarContext: _angular_core.WritableSignal<ZTableBulkActionContext<T> | null>;
|
|
777
|
+
protected readonly bulkBarItems: _angular_core.WritableSignal<ZTableBulkActionViewItem<T>[]>;
|
|
708
778
|
/** True when table body is scrolled away from left edge (shows left pin shadow) */
|
|
709
779
|
protected readonly hasScrollLeft: _angular_core.WritableSignal<boolean>;
|
|
710
780
|
/** True when table has right-pinned columns and body isn't scrolled to the end */
|
|
711
781
|
protected readonly hasScrollRight: _angular_core.WritableSignal<boolean>;
|
|
712
782
|
/** Maps row IDs to measured DOM heights for pinned row offset calculations */
|
|
713
783
|
protected readonly pinnedRowHeights: _angular_core.WritableSignal<Record<string, number>>;
|
|
784
|
+
protected readonly defaultBulkActions: _angular_core.Signal<ZTableBulkActionItem<T>[]>;
|
|
714
785
|
/** Bumped to force recomputation of pinned column IDs after programmatic pin changes */
|
|
715
786
|
private readonly _columnPinVersion;
|
|
716
787
|
/** Bumped to trigger data refresh (e.g., after addItem/deleteItem via control API) */
|
|
@@ -838,6 +909,17 @@ declare class ZTableComponent<T> implements AfterViewInit {
|
|
|
838
909
|
protected readonly columnSizeVars: _angular_core.Signal<Record<string, number>>;
|
|
839
910
|
protected readonly table: ReturnType<typeof createAngularTable<T>>;
|
|
840
911
|
private readonly _virtualGroupCount;
|
|
912
|
+
protected readonly selectedRowIds: _angular_core.Signal<string[]>;
|
|
913
|
+
protected readonly selectedRows: _angular_core.Signal<T[]>;
|
|
914
|
+
protected readonly bulkActionContext: _angular_core.Signal<ZTableBulkActionContext<T>>;
|
|
915
|
+
protected readonly bulkActionConfig: _angular_core.Signal<ZTableBulkActionOptions<T> | null>;
|
|
916
|
+
protected readonly bulkActionItems: _angular_core.Signal<{
|
|
917
|
+
action: ZTableBulkActionItem<T>;
|
|
918
|
+
disabled: boolean;
|
|
919
|
+
}[]>;
|
|
920
|
+
protected readonly showBulkBar: _angular_core.Signal<boolean>;
|
|
921
|
+
protected readonly bulkBarPositions: ConnectedPosition[];
|
|
922
|
+
private readonly _bulkBarExitDuration;
|
|
841
923
|
/** Virtualizer instance — operates on groups rather than individual rows */
|
|
842
924
|
protected readonly virtualizer: _shival99_angular_virtual.AngularVirtualizer<HTMLDivElement, Element>;
|
|
843
925
|
private readonly _measureVirtualItems;
|
|
@@ -849,6 +931,18 @@ declare class ZTableComponent<T> implements AfterViewInit {
|
|
|
849
931
|
* if no children are selected, the parent is deselected.
|
|
850
932
|
*/
|
|
851
933
|
private _handleRowSelectionWithParents;
|
|
934
|
+
protected clearSelection(): void;
|
|
935
|
+
protected onBulkActionClick(item: ZTableBulkActionItem<T>): Promise<void>;
|
|
936
|
+
private _resolveBulkActionList;
|
|
937
|
+
private _createBulkActionHandlerContext;
|
|
938
|
+
private _exportSelectionToExcel;
|
|
939
|
+
private _createExcelExportContext;
|
|
940
|
+
private _getExcelExportData;
|
|
941
|
+
private _getExcelExportFileName;
|
|
942
|
+
private _toExcelTableColumns;
|
|
943
|
+
private _getExcelColumnHeader;
|
|
944
|
+
private _getExcelColumnHeaderAlign;
|
|
945
|
+
private _clearBulkBarTimer;
|
|
852
946
|
/**
|
|
853
947
|
* Wraps state mutations with a debounced processing indicator.
|
|
854
948
|
* Shows a brief loading state to prevent UI flicker during
|
|
@@ -1119,4 +1213,4 @@ declare const findColumnConfig: <T>(columnId: string, columns: ZTableColumnConfi
|
|
|
1119
1213
|
declare function columnConfigToColumnDef<T>(config: ZTableColumnConfig<T>): ColumnDef<T>;
|
|
1120
1214
|
|
|
1121
1215
|
export { ZTableActionsComponent, ZTableComponent, ZTableEditCellComponent, ZTableFilterComponent, ZTableIconTextComponent, columnConfigToColumnDef, findColumnConfig, getBodyConfig, getFooterConfig, getHeaderConfig, isBodyConfig, isFooterConfig, isHeaderConfig };
|
|
1122
|
-
export type { ZTableActionBodyConfig, ZTableActionClickEvent, ZTableActionColumnConfig, ZTableActionItem, ZTableActionList, ZTableCellEditChange, ZTableCellEditEvent, ZTableChangeEvent, ZTableColumn, ZTableColumnConfig, ZTableConfig, ZTableControl, ZTableEditCellChangeEvent, ZTableEditConfig, ZTableEditSize, ZTableEditType, ZTableFilterChangeEvent, ZTableFilterConfig, ZTableFilterType, ZTablePageChangeEvent, ZTablePaginationConfig, ZTableRowExpandEvent, ZTableRowSelectEvent, ZTableSavedConfig, ZTableSearchChangeEvent, ZTableSearchConfig, ZTableSortChangeEvent, ZTableSortConfig };
|
|
1216
|
+
export type { ZTableActionBodyConfig, ZTableActionClickEvent, ZTableActionColumnConfig, ZTableActionItem, ZTableActionList, ZTableBulkActionClickEvent, ZTableBulkActionConfig, ZTableBulkActionContext, ZTableBulkActionHandlerContext, ZTableBulkActionItem, ZTableBulkActionList, ZTableBulkActionOptions, ZTableBulkActionViewItem, ZTableCellEditChange, ZTableCellEditEvent, ZTableChangeEvent, ZTableColumn, ZTableColumnConfig, ZTableConfig, ZTableControl, ZTableEditCellChangeEvent, ZTableEditConfig, ZTableEditSize, ZTableEditType, ZTableExcelExportConfig, ZTableExcelExportContext, ZTableExcelExportScope, ZTableFilterChangeEvent, ZTableFilterConfig, ZTableFilterType, ZTablePageChangeEvent, ZTablePaginationConfig, ZTableRowExpandEvent, ZTableRowSelectEvent, ZTableSavedConfig, ZTableSearchChangeEvent, ZTableSearchConfig, ZTableSortChangeEvent, ZTableSortConfig };
|