@aquera/ngx-smart-table 0.0.2-alpha
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/README.md +152 -0
- package/aquera-ngx-smart-table.d.ts +5 -0
- package/esm2020/aquera-ngx-smart-table.mjs +5 -0
- package/esm2020/lib/builder/components/builder-preview/builder-preview.component.mjs +63 -0
- package/esm2020/lib/builder/components/builder-toolbar/builder-toolbar.component.mjs +115 -0
- package/esm2020/lib/builder/components/column-editor/column-editor.component.mjs +206 -0
- package/esm2020/lib/builder/components/column-list/column-list.component.mjs +125 -0
- package/esm2020/lib/builder/components/definition-builder/definition-builder.component.mjs +105 -0
- package/esm2020/lib/builder/components/table-config-editor/table-config-editor.component.mjs +132 -0
- package/esm2020/lib/builder/definition-builder.module.mjs +70 -0
- package/esm2020/lib/builder/models/builder-state.interface.mjs +5 -0
- package/esm2020/lib/builder/services/definition-builder.service.mjs +251 -0
- package/esm2020/lib/builder/services/definition-export.service.mjs +167 -0
- package/esm2020/lib/builder/services/definition-import.service.mjs +193 -0
- package/esm2020/lib/builder/services/sample-data-generator.service.mjs +126 -0
- package/esm2020/lib/builder/utils/config-validator.util.mjs +165 -0
- package/esm2020/lib/builder/utils/typescript-generator.util.mjs +206 -0
- package/esm2020/lib/editors/index.mjs +9 -0
- package/esm2020/lib/editors/nile-autocomplete-editor.mjs +228 -0
- package/esm2020/lib/editors/nile-calendar-editor.mjs +214 -0
- package/esm2020/lib/editors/nile-date-picker-editor.mjs +227 -0
- package/esm2020/lib/editors/nile-input-editor.mjs +235 -0
- package/esm2020/lib/editors/nile-select-editor.mjs +317 -0
- package/esm2020/lib/factories/column-config.factory.mjs +231 -0
- package/esm2020/lib/models/autosave-config.interface.mjs +8 -0
- package/esm2020/lib/models/base-column-config.class.mjs +253 -0
- package/esm2020/lib/models/cell-strategies.interface.mjs +6 -0
- package/esm2020/lib/models/cell-types.mjs +147 -0
- package/esm2020/lib/models/column-action.interface.mjs +6 -0
- package/esm2020/lib/models/column-config.interface.mjs +43 -0
- package/esm2020/lib/models/column-config.utils.mjs +101 -0
- package/esm2020/lib/models/row-action.interface.mjs +5 -0
- package/esm2020/lib/models/row-validator.interface.mjs +2 -0
- package/esm2020/lib/models/schema-validation.interface.mjs +2 -0
- package/esm2020/lib/models/sheet-action.interface.mjs +5 -0
- package/esm2020/lib/models/sheet-config.interface.mjs +5 -0
- package/esm2020/lib/models/table-config.interface.mjs +106 -0
- package/esm2020/lib/models/table-validator.interface.mjs +2 -0
- package/esm2020/lib/models/workbook-action.interface.mjs +5 -0
- package/esm2020/lib/models/workbook-config.interface.mjs +5 -0
- package/esm2020/lib/renderer/components/st-add-column-button/st-add-column-button.component.mjs +24 -0
- package/esm2020/lib/renderer/components/st-cell/st-cell.component.mjs +391 -0
- package/esm2020/lib/renderer/components/st-column-editor-modal/st-column-editor-modal.component.mjs +103 -0
- package/esm2020/lib/renderer/components/st-column-filter/st-column-filter.component.mjs +383 -0
- package/esm2020/lib/renderer/components/st-column-menu/st-column-menu.component.mjs +232 -0
- package/esm2020/lib/renderer/components/st-column-visibility/st-column-visibility.component.mjs +97 -0
- package/esm2020/lib/renderer/components/st-header/st-header.component.mjs +157 -0
- package/esm2020/lib/renderer/components/st-pagination/st-pagination.component.mjs +87 -0
- package/esm2020/lib/renderer/components/st-row-actions-dropdown/st-row-actions-dropdown.component.mjs +167 -0
- package/esm2020/lib/renderer/components/st-sheet/st-sheet.component.mjs +165 -0
- package/esm2020/lib/renderer/components/st-sheet-actions/st-sheet-actions.component.mjs +112 -0
- package/esm2020/lib/renderer/components/st-table/st-table.component.mjs +1246 -0
- package/esm2020/lib/renderer/components/st-table-actions/st-table-actions.component.mjs +171 -0
- package/esm2020/lib/renderer/components/st-workbook/st-workbook.component.mjs +489 -0
- package/esm2020/lib/renderer/directives/click-outside.directive.mjs +28 -0
- package/esm2020/lib/renderer/directives/st-column-resize.directive.mjs +108 -0
- package/esm2020/lib/renderer/directives/st-keyboard-navigation.directive.mjs +73 -0
- package/esm2020/lib/renderer/models/cell-state.interface.mjs +66 -0
- package/esm2020/lib/renderer/models/cell.class.mjs +389 -0
- package/esm2020/lib/renderer/models/row-validation-state.interface.mjs +7 -0
- package/esm2020/lib/renderer/models/sheet-state.class.mjs +90 -0
- package/esm2020/lib/renderer/models/sheet-state.interface.mjs +5 -0
- package/esm2020/lib/renderer/models/table-state.class.mjs +841 -0
- package/esm2020/lib/renderer/models/table-state.interface.mjs +5 -0
- package/esm2020/lib/renderer/models/table-types.mjs +29 -0
- package/esm2020/lib/renderer/models/table-validation-state.interface.mjs +7 -0
- package/esm2020/lib/renderer/models/workbook-state.class.mjs +174 -0
- package/esm2020/lib/renderer/models/workbook-state.interface.mjs +5 -0
- package/esm2020/lib/renderer/models/z-index.enum.mjs +55 -0
- package/esm2020/lib/schemas/table-config.schema.mjs +472 -0
- package/esm2020/lib/services/autosave.service.mjs +92 -0
- package/esm2020/lib/services/custom-validation-rules.util.mjs +124 -0
- package/esm2020/lib/services/json-schema-validator.service.mjs +216 -0
- package/esm2020/lib/services/row-validation.service.mjs +42 -0
- package/esm2020/lib/services/validation-logger.service.mjs +177 -0
- package/esm2020/lib/services/virtual-scroll.service.mjs +52 -0
- package/esm2020/lib/shared/shared-table-components.module.mjs +35 -0
- package/esm2020/lib/smart-table.module.mjs +124 -0
- package/esm2020/lib/strategies/default-editors.mjs +433 -0
- package/esm2020/lib/strategies/default-formatters.mjs +238 -0
- package/esm2020/lib/strategies/default-validators.mjs +327 -0
- package/esm2020/public-api.mjs +146 -0
- package/fesm2015/aquera-ngx-smart-table.mjs +11860 -0
- package/fesm2015/aquera-ngx-smart-table.mjs.map +1 -0
- package/fesm2020/aquera-ngx-smart-table.mjs +11897 -0
- package/fesm2020/aquera-ngx-smart-table.mjs.map +1 -0
- package/lib/builder/components/builder-preview/builder-preview.component.d.ts +31 -0
- package/lib/builder/components/builder-toolbar/builder-toolbar.component.d.ts +53 -0
- package/lib/builder/components/column-editor/column-editor.component.d.ts +69 -0
- package/lib/builder/components/column-list/column-list.component.d.ts +65 -0
- package/lib/builder/components/definition-builder/definition-builder.component.d.ts +58 -0
- package/lib/builder/components/table-config-editor/table-config-editor.component.d.ts +32 -0
- package/lib/builder/definition-builder.module.d.ts +15 -0
- package/lib/builder/models/builder-state.interface.d.ts +93 -0
- package/lib/builder/services/definition-builder.service.d.ts +80 -0
- package/lib/builder/services/definition-export.service.d.ts +59 -0
- package/lib/builder/services/definition-import.service.d.ts +31 -0
- package/lib/builder/services/sample-data-generator.service.d.ts +41 -0
- package/lib/builder/utils/config-validator.util.d.ts +32 -0
- package/lib/builder/utils/typescript-generator.util.d.ts +29 -0
- package/lib/editors/index.d.ts +8 -0
- package/lib/editors/nile-autocomplete-editor.d.ts +102 -0
- package/lib/editors/nile-calendar-editor.d.ts +89 -0
- package/lib/editors/nile-date-picker-editor.d.ts +95 -0
- package/lib/editors/nile-input-editor.d.ts +67 -0
- package/lib/editors/nile-select-editor.d.ts +109 -0
- package/lib/factories/column-config.factory.d.ts +73 -0
- package/lib/models/autosave-config.interface.d.ts +23 -0
- package/lib/models/base-column-config.class.d.ts +115 -0
- package/lib/models/cell-strategies.interface.d.ts +181 -0
- package/lib/models/cell-types.d.ts +337 -0
- package/lib/models/column-action.interface.d.ts +86 -0
- package/lib/models/column-config.interface.d.ts +272 -0
- package/lib/models/column-config.utils.d.ts +37 -0
- package/lib/models/row-action.interface.d.ts +86 -0
- package/lib/models/row-validator.interface.d.ts +37 -0
- package/lib/models/schema-validation.interface.d.ts +42 -0
- package/lib/models/sheet-action.interface.d.ts +59 -0
- package/lib/models/sheet-config.interface.d.ts +41 -0
- package/lib/models/table-config.interface.d.ts +245 -0
- package/lib/models/table-validator.interface.d.ts +40 -0
- package/lib/models/workbook-action.interface.d.ts +90 -0
- package/lib/models/workbook-config.interface.d.ts +107 -0
- package/lib/renderer/components/st-add-column-button/st-add-column-button.component.d.ts +9 -0
- package/lib/renderer/components/st-cell/st-cell.component.d.ts +69 -0
- package/lib/renderer/components/st-column-editor-modal/st-column-editor-modal.component.d.ts +39 -0
- package/lib/renderer/components/st-column-filter/st-column-filter.component.d.ts +139 -0
- package/lib/renderer/components/st-column-menu/st-column-menu.component.d.ts +81 -0
- package/lib/renderer/components/st-column-visibility/st-column-visibility.component.d.ts +44 -0
- package/lib/renderer/components/st-header/st-header.component.d.ts +93 -0
- package/lib/renderer/components/st-pagination/st-pagination.component.d.ts +42 -0
- package/lib/renderer/components/st-row-actions-dropdown/st-row-actions-dropdown.component.d.ts +67 -0
- package/lib/renderer/components/st-sheet/st-sheet.component.d.ts +98 -0
- package/lib/renderer/components/st-sheet-actions/st-sheet-actions.component.d.ts +58 -0
- package/lib/renderer/components/st-table/st-table.component.d.ts +349 -0
- package/lib/renderer/components/st-table-actions/st-table-actions.component.d.ts +77 -0
- package/lib/renderer/components/st-workbook/st-workbook.component.d.ts +235 -0
- package/lib/renderer/directives/click-outside.directive.d.ts +10 -0
- package/lib/renderer/directives/st-column-resize.directive.d.ts +44 -0
- package/lib/renderer/directives/st-keyboard-navigation.directive.d.ts +15 -0
- package/lib/renderer/models/cell-state.interface.d.ts +118 -0
- package/lib/renderer/models/cell.class.d.ts +174 -0
- package/lib/renderer/models/row-validation-state.interface.d.ts +27 -0
- package/lib/renderer/models/sheet-state.class.d.ts +67 -0
- package/lib/renderer/models/sheet-state.interface.d.ts +55 -0
- package/lib/renderer/models/table-state.class.d.ts +313 -0
- package/lib/renderer/models/table-state.interface.d.ts +18 -0
- package/lib/renderer/models/table-types.d.ts +228 -0
- package/lib/renderer/models/table-validation-state.interface.d.ts +34 -0
- package/lib/renderer/models/workbook-state.class.d.ts +117 -0
- package/lib/renderer/models/workbook-state.interface.d.ts +71 -0
- package/lib/renderer/models/z-index.enum.d.ts +44 -0
- package/lib/schemas/table-config.schema.d.ts +455 -0
- package/lib/services/autosave.service.d.ts +73 -0
- package/lib/services/custom-validation-rules.util.d.ts +12 -0
- package/lib/services/json-schema-validator.service.d.ts +49 -0
- package/lib/services/row-validation.service.d.ts +17 -0
- package/lib/services/validation-logger.service.d.ts +87 -0
- package/lib/services/virtual-scroll.service.d.ts +44 -0
- package/lib/shared/shared-table-components.module.d.ts +9 -0
- package/lib/smart-table.module.d.ts +26 -0
- package/lib/strategies/default-editors.d.ts +109 -0
- package/lib/strategies/default-formatters.d.ts +116 -0
- package/lib/strategies/default-validators.d.ts +113 -0
- package/package.json +42 -0
- package/public-api.d.ts +70 -0
- package/src/lib/builder/README.md +30 -0
- package/src/lib/editors/README.md +303 -0
- package/src/lib/renderer/components/st-column-filter/README.md +286 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { EventEmitter, OnInit, ElementRef, AfterViewInit, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { ColumnConfig } from '../../../models/column-config.interface';
|
|
3
|
+
import { TableState } from '../../models/table-state.class';
|
|
4
|
+
import { FilterOperator } from '../../models/table-types';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Filter context for the popover component
|
|
8
|
+
*/
|
|
9
|
+
export interface FilterContext {
|
|
10
|
+
column: ColumnConfig<any>;
|
|
11
|
+
tableState?: TableState;
|
|
12
|
+
columnIndex: number;
|
|
13
|
+
isFirstColumn: boolean;
|
|
14
|
+
isLastColumn: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Filter popup component for per-column filtering
|
|
18
|
+
* Uses Nile components for consistent UI
|
|
19
|
+
* Designed as a shared component with context input
|
|
20
|
+
*/
|
|
21
|
+
export declare class StColumnFilterComponent implements OnInit, AfterViewInit, OnChanges {
|
|
22
|
+
filterAnchor?: ElementRef<HTMLElement>;
|
|
23
|
+
column: ColumnConfig<any>;
|
|
24
|
+
tableState?: TableState;
|
|
25
|
+
columnIndex: number;
|
|
26
|
+
isFirstColumn: boolean;
|
|
27
|
+
isLastColumn: boolean;
|
|
28
|
+
set isOpen(value: boolean);
|
|
29
|
+
get isOpen(): boolean;
|
|
30
|
+
private _isOpen;
|
|
31
|
+
closed: EventEmitter<void>;
|
|
32
|
+
filterApplied: EventEmitter<{
|
|
33
|
+
operator: FilterOperator;
|
|
34
|
+
value: any;
|
|
35
|
+
}>;
|
|
36
|
+
filterCleared: EventEmitter<void>;
|
|
37
|
+
selectedOperator: FilterOperator;
|
|
38
|
+
filterValue: any;
|
|
39
|
+
selectedValues: any[];
|
|
40
|
+
availableOperators: {
|
|
41
|
+
value: FilterOperator;
|
|
42
|
+
label: string;
|
|
43
|
+
}[];
|
|
44
|
+
inputType: 'text' | 'number' | 'date' | 'checkbox' | 'select' | 'multiselect';
|
|
45
|
+
dropdownOptions: {
|
|
46
|
+
label: string;
|
|
47
|
+
value: any;
|
|
48
|
+
}[];
|
|
49
|
+
/**
|
|
50
|
+
* Get filter context for external use
|
|
51
|
+
*/
|
|
52
|
+
get context(): FilterContext;
|
|
53
|
+
/**
|
|
54
|
+
* Set filter context (allows using component as context-driven)
|
|
55
|
+
*/
|
|
56
|
+
set filterContext(context: FilterContext | null);
|
|
57
|
+
ngOnInit(): void;
|
|
58
|
+
ngAfterViewInit(): void;
|
|
59
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
60
|
+
/**
|
|
61
|
+
* Initialize filter state from column config
|
|
62
|
+
*/
|
|
63
|
+
private initializeFilterState;
|
|
64
|
+
/**
|
|
65
|
+
* Determine which input type to render based on priority
|
|
66
|
+
*/
|
|
67
|
+
private determineInputType;
|
|
68
|
+
/**
|
|
69
|
+
* Check if column has valid filter options configuration
|
|
70
|
+
*/
|
|
71
|
+
private hasValidFilterOptions;
|
|
72
|
+
/**
|
|
73
|
+
* Process dropdown options using the handler
|
|
74
|
+
*/
|
|
75
|
+
private processDropdownOptions;
|
|
76
|
+
/**
|
|
77
|
+
* Set available operators based on input type
|
|
78
|
+
*/
|
|
79
|
+
private setAvailableOperators;
|
|
80
|
+
/**
|
|
81
|
+
* Open the filter popup
|
|
82
|
+
*/
|
|
83
|
+
open(): void;
|
|
84
|
+
/**
|
|
85
|
+
* Close the filter popup
|
|
86
|
+
*/
|
|
87
|
+
close(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Handle popover hide event from nile-popover
|
|
90
|
+
*/
|
|
91
|
+
onPopoverHide(): void;
|
|
92
|
+
/**
|
|
93
|
+
* Handle operator change from nile-select
|
|
94
|
+
*/
|
|
95
|
+
onOperatorChange(event: Event): void;
|
|
96
|
+
/**
|
|
97
|
+
* Handle value input from nile-input
|
|
98
|
+
*/
|
|
99
|
+
onValueInput(event: Event): void;
|
|
100
|
+
/**
|
|
101
|
+
* Handle checkbox change from nile-checkbox
|
|
102
|
+
*/
|
|
103
|
+
onCheckboxChange(event: Event): void;
|
|
104
|
+
/**
|
|
105
|
+
* Handle select change from nile-select
|
|
106
|
+
*/
|
|
107
|
+
onSelectChange(event: Event): void;
|
|
108
|
+
/**
|
|
109
|
+
* Handle multiselect checkbox change
|
|
110
|
+
*/
|
|
111
|
+
onMultiselectCheckboxChange(event: Event, value: any): void;
|
|
112
|
+
/**
|
|
113
|
+
* Apply the filter
|
|
114
|
+
*/
|
|
115
|
+
onApply(): void;
|
|
116
|
+
/**
|
|
117
|
+
* Clear the filter
|
|
118
|
+
*/
|
|
119
|
+
onClear(): void;
|
|
120
|
+
/**
|
|
121
|
+
* Handle multiselect change (kept for backward compatibility)
|
|
122
|
+
* @deprecated Use onMultiselectCheckboxChange instead
|
|
123
|
+
*/
|
|
124
|
+
onMultiselectChange(value: any, event: Event): void;
|
|
125
|
+
/**
|
|
126
|
+
* Check if a value is selected in multiselect
|
|
127
|
+
*/
|
|
128
|
+
isValueSelected(value: any): boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Get column display name
|
|
131
|
+
*/
|
|
132
|
+
getColumnName(): string;
|
|
133
|
+
/**
|
|
134
|
+
* Determine if filter should align to the left (for first few columns)
|
|
135
|
+
*/
|
|
136
|
+
shouldAlignLeft(): boolean;
|
|
137
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StColumnFilterComponent, never>;
|
|
138
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StColumnFilterComponent, "st-column-filter", never, { "column": "column"; "tableState": "tableState"; "columnIndex": "columnIndex"; "isFirstColumn": "isFirstColumn"; "isLastColumn": "isLastColumn"; "isOpen": "isOpen"; "filterContext": "filterContext"; }, { "closed": "closed"; "filterApplied": "filterApplied"; "filterCleared": "filterCleared"; }, never, never>;
|
|
139
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { ColumnAction, ColumnActionContext, ColumnActionEvent } from '../../../models/column-action.interface';
|
|
3
|
+
import { StColumnFilterComponent } from '../st-column-filter/st-column-filter.component';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class StColumnMenuDropdownComponent implements OnChanges {
|
|
6
|
+
/**
|
|
7
|
+
* Whether the dropdown is open
|
|
8
|
+
*/
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Position of the dropdown (x, y coordinates)
|
|
12
|
+
*/
|
|
13
|
+
position: {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Context containing column data, index, and actions
|
|
19
|
+
*/
|
|
20
|
+
context: ColumnActionContext | null;
|
|
21
|
+
/**
|
|
22
|
+
* Emitted when an action is clicked
|
|
23
|
+
*/
|
|
24
|
+
actionClicked: EventEmitter<ColumnActionEvent>;
|
|
25
|
+
/**
|
|
26
|
+
* Emitted when the dropdown should close
|
|
27
|
+
*/
|
|
28
|
+
closed: EventEmitter<void>;
|
|
29
|
+
filterPopup?: StColumnFilterComponent;
|
|
30
|
+
/**
|
|
31
|
+
* Visible actions (filtered by hidden property)
|
|
32
|
+
*/
|
|
33
|
+
visibleActions: ColumnAction[];
|
|
34
|
+
/**
|
|
35
|
+
* Dropdown positioning style
|
|
36
|
+
*/
|
|
37
|
+
dropdownStyle: any;
|
|
38
|
+
isFilterOpen: boolean;
|
|
39
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
40
|
+
/**
|
|
41
|
+
* Update visible actions based on hidden property
|
|
42
|
+
*/
|
|
43
|
+
private updateVisibleActions;
|
|
44
|
+
/**
|
|
45
|
+
* Check if an action is currently active (for checkmarks)
|
|
46
|
+
*/
|
|
47
|
+
isActionActive(action: ColumnAction): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Determine if divider should be shown after an action
|
|
50
|
+
* Groups built-in actions: [sort group] | [filter] | [pin group] | [move group] | [custom]
|
|
51
|
+
*/
|
|
52
|
+
shouldShowDividerAfter(action: ColumnAction, index: number, isLast: boolean): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Update dropdown position based on available viewport space
|
|
55
|
+
*/
|
|
56
|
+
private updateDropdownPosition;
|
|
57
|
+
/**
|
|
58
|
+
* Check if an action is disabled
|
|
59
|
+
*/
|
|
60
|
+
isActionDisabled(action: ColumnAction): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Handle action click
|
|
63
|
+
*/
|
|
64
|
+
onActionClick(action: ColumnAction): void;
|
|
65
|
+
/**
|
|
66
|
+
* Close dropdown when clicking backdrop
|
|
67
|
+
*/
|
|
68
|
+
onBackdropClick(event: MouseEvent): void;
|
|
69
|
+
onFilterClosed(): void;
|
|
70
|
+
onFilterApplied(event: {
|
|
71
|
+
operator: any;
|
|
72
|
+
value: any;
|
|
73
|
+
}): void;
|
|
74
|
+
onFilterCleared(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Determine if menu should align to the left (for first few columns)
|
|
77
|
+
*/
|
|
78
|
+
shouldAlignLeft(): boolean;
|
|
79
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StColumnMenuDropdownComponent, never>;
|
|
80
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StColumnMenuDropdownComponent, "st-column-menu-dropdown", never, { "isOpen": "isOpen"; "position": "position"; "context": "context"; }, { "actionClicked": "actionClicked"; "closed": "closed"; }, never, never>;
|
|
81
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { OnInit, OnChanges, SimpleChanges, OnDestroy } from '@angular/core';
|
|
2
|
+
import { TableState } from '../../models/table-state.class';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class StColumnVisibilityComponent implements OnInit, OnChanges, OnDestroy {
|
|
5
|
+
tableState: TableState;
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
columnsVisibility: {
|
|
8
|
+
key: string;
|
|
9
|
+
header: string;
|
|
10
|
+
visible: boolean;
|
|
11
|
+
hideable: boolean;
|
|
12
|
+
}[];
|
|
13
|
+
private stateSubscription?;
|
|
14
|
+
constructor();
|
|
15
|
+
ngOnInit(): void;
|
|
16
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
17
|
+
/**
|
|
18
|
+
* Update columns visibility list from current table state
|
|
19
|
+
*/
|
|
20
|
+
private updateColumnsVisibility;
|
|
21
|
+
/**
|
|
22
|
+
* Subscribe to table state changes
|
|
23
|
+
*/
|
|
24
|
+
private subscribeToStateChanges;
|
|
25
|
+
ngOnDestroy(): void;
|
|
26
|
+
toggleMenu(event: Event): void;
|
|
27
|
+
closeMenu(): void;
|
|
28
|
+
getColumnsVisibility(): {
|
|
29
|
+
key: string;
|
|
30
|
+
header: string;
|
|
31
|
+
visible: boolean;
|
|
32
|
+
hideable: boolean;
|
|
33
|
+
}[];
|
|
34
|
+
isColumnHideable(column: {
|
|
35
|
+
key: string;
|
|
36
|
+
header: string;
|
|
37
|
+
visible: boolean;
|
|
38
|
+
hideable: boolean;
|
|
39
|
+
}): boolean;
|
|
40
|
+
onToggleColumn(columnKey: string, event: Event): void;
|
|
41
|
+
isColumnVisible(columnKey: string): boolean;
|
|
42
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StColumnVisibilityComponent, never>;
|
|
43
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StColumnVisibilityComponent, "st-column-visibility", never, { "tableState": "tableState"; }, {}, never, never>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* st-header Component
|
|
3
|
+
* Encapsulates column-specific logic including sorting and filtering
|
|
4
|
+
*/
|
|
5
|
+
import { EventEmitter, OnDestroy } from '@angular/core';
|
|
6
|
+
import { ColumnConfig } from '../../../models/column-config.interface';
|
|
7
|
+
import { TableState } from '../../models/table-state.class';
|
|
8
|
+
import { SortDirection, ColumnSortEvent, ColumnFilterEvent, ColumnMoveEvent } from '../../models/table-types';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
export declare class StHeaderComponent implements OnDestroy {
|
|
11
|
+
/**
|
|
12
|
+
* Column configuration - contains all column metadata and state
|
|
13
|
+
*/
|
|
14
|
+
column: ColumnConfig<any>;
|
|
15
|
+
/**
|
|
16
|
+
* Column index in the visible columns array
|
|
17
|
+
*/
|
|
18
|
+
columnIndex: number;
|
|
19
|
+
/**
|
|
20
|
+
* Whether this is the first column
|
|
21
|
+
*/
|
|
22
|
+
isFirstColumn: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether this is the last column
|
|
25
|
+
*/
|
|
26
|
+
isLastColumn: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Optional TableState reference for integrated sorting/filtering
|
|
29
|
+
*/
|
|
30
|
+
tableState?: TableState;
|
|
31
|
+
/**
|
|
32
|
+
* Whether sorting is enabled globally
|
|
33
|
+
*/
|
|
34
|
+
enableSorting: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Whether filtering is enabled globally
|
|
37
|
+
*/
|
|
38
|
+
enableFiltering: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Emits column sort event when sort is toggled
|
|
41
|
+
*/
|
|
42
|
+
sortToggle: EventEmitter<ColumnSortEvent>;
|
|
43
|
+
/**
|
|
44
|
+
* Emits filter changes (future feature)
|
|
45
|
+
*/
|
|
46
|
+
filterChange: EventEmitter<ColumnFilterEvent>;
|
|
47
|
+
/**
|
|
48
|
+
* Emits when column is moved left or right
|
|
49
|
+
*/
|
|
50
|
+
columnMoved: EventEmitter<ColumnMoveEvent>;
|
|
51
|
+
/**
|
|
52
|
+
* Emits when column menu button is clicked
|
|
53
|
+
*/
|
|
54
|
+
menuClick: EventEmitter<MouseEvent>;
|
|
55
|
+
/**
|
|
56
|
+
* Cleanup on destroy
|
|
57
|
+
*/
|
|
58
|
+
ngOnDestroy(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Handle column menu button click
|
|
61
|
+
*/
|
|
62
|
+
onMenuClick(event: MouseEvent): void;
|
|
63
|
+
/**
|
|
64
|
+
* Check if column menu should be shown
|
|
65
|
+
*/
|
|
66
|
+
isMenuEnabled(): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Check if column is sortable
|
|
69
|
+
*/
|
|
70
|
+
isSortable(): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Get current sort direction
|
|
73
|
+
*/
|
|
74
|
+
getSortDirection(): SortDirection;
|
|
75
|
+
/**
|
|
76
|
+
* Check if column is currently sorted
|
|
77
|
+
*/
|
|
78
|
+
isSorted(): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Get ARIA sort attribute for accessibility
|
|
81
|
+
*/
|
|
82
|
+
getAriaSort(): string | null;
|
|
83
|
+
/**
|
|
84
|
+
* Handle move left action
|
|
85
|
+
*/
|
|
86
|
+
onMoveLeft(): void;
|
|
87
|
+
/**
|
|
88
|
+
* Handle move right action
|
|
89
|
+
*/
|
|
90
|
+
onMoveRight(): void;
|
|
91
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StHeaderComponent, never>;
|
|
92
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StHeaderComponent, "st-header", never, { "column": "column"; "columnIndex": "columnIndex"; "isFirstColumn": "isFirstColumn"; "isLastColumn": "isLastColumn"; "tableState": "tableState"; "enableSorting": "enableSorting"; "enableFiltering": "enableFiltering"; }, { "sortToggle": "sortToggle"; "filterChange": "filterChange"; "columnMoved": "columnMoved"; "menuClick": "menuClick"; }, never, never>;
|
|
93
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { OnInit, OnDestroy } from '@angular/core';
|
|
2
|
+
import { TableState } from '../../models/table-state.class';
|
|
3
|
+
import { TableConfig } from '../../../models/table-config.interface';
|
|
4
|
+
import { PaginationState } from '../../models/table-types';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Pagination component that wraps nile-pagination web component
|
|
8
|
+
* Handles conversion between internal 0-indexed pages and nile-pagination's 1-indexed pages
|
|
9
|
+
*/
|
|
10
|
+
export declare class StPaginationComponent implements OnInit, OnDestroy {
|
|
11
|
+
tableState: TableState;
|
|
12
|
+
tableConfig: TableConfig;
|
|
13
|
+
position: 'top' | 'bottom';
|
|
14
|
+
paginationState: PaginationState;
|
|
15
|
+
private paginationSubscription?;
|
|
16
|
+
ngOnInit(): void;
|
|
17
|
+
ngOnDestroy(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Get current page display (1-indexed for nile-pagination)
|
|
20
|
+
*/
|
|
21
|
+
getCurrentPageDisplay(): number;
|
|
22
|
+
/**
|
|
23
|
+
* Get variant from config
|
|
24
|
+
*/
|
|
25
|
+
getVariant(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Get page size options array for nile-pagination
|
|
28
|
+
*/
|
|
29
|
+
getPageSizeOptions(): number[];
|
|
30
|
+
/**
|
|
31
|
+
* Handle page change from nile-pagination
|
|
32
|
+
* @param event Custom event from nile-pagination with 1-indexed page number
|
|
33
|
+
*/
|
|
34
|
+
onPageChange(event: any): void;
|
|
35
|
+
/**
|
|
36
|
+
* Handle page size change from nile-pagination
|
|
37
|
+
* @param event Custom event from nile-pagination with new page size
|
|
38
|
+
*/
|
|
39
|
+
onPageSizeChange(event: any): void;
|
|
40
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StPaginationComponent, never>;
|
|
41
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StPaginationComponent, "st-pagination", never, { "tableState": "tableState"; "tableConfig": "tableConfig"; "position": "position"; }, {}, never, never>;
|
|
42
|
+
}
|
package/lib/renderer/components/st-row-actions-dropdown/st-row-actions-dropdown.component.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { RowAction, RowActionContext, RowActionEvent } from '../../../models/row-action.interface';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class StRowActionsDropdownComponent implements OnChanges {
|
|
5
|
+
/**
|
|
6
|
+
* Whether the dropdown is open
|
|
7
|
+
*/
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Position of the dropdown (x, y coordinates)
|
|
11
|
+
*/
|
|
12
|
+
position: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Context containing row data, index, and actions
|
|
18
|
+
*/
|
|
19
|
+
context: RowActionContext | null;
|
|
20
|
+
/**
|
|
21
|
+
* Emitted when an action is clicked
|
|
22
|
+
*/
|
|
23
|
+
actionClicked: EventEmitter<RowActionEvent>;
|
|
24
|
+
/**
|
|
25
|
+
* Emitted when the dropdown should close
|
|
26
|
+
*/
|
|
27
|
+
closed: EventEmitter<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Visible actions (filtered by hidden property)
|
|
30
|
+
*/
|
|
31
|
+
visibleActions: RowAction[];
|
|
32
|
+
/**
|
|
33
|
+
* Dropdown positioning style
|
|
34
|
+
*/
|
|
35
|
+
dropdownStyle: any;
|
|
36
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
37
|
+
/**
|
|
38
|
+
* Update visible actions based on hidden property
|
|
39
|
+
*/
|
|
40
|
+
private updateVisibleActions;
|
|
41
|
+
/**
|
|
42
|
+
* Update dropdown position based on available viewport space
|
|
43
|
+
*/
|
|
44
|
+
private updateDropdownPosition;
|
|
45
|
+
/**
|
|
46
|
+
* Handle action click
|
|
47
|
+
*/
|
|
48
|
+
onActionClick(action: RowAction): void;
|
|
49
|
+
/**
|
|
50
|
+
* Check if an action is disabled
|
|
51
|
+
*/
|
|
52
|
+
isActionDisabled(action: RowAction): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Handle overlay click (close dropdown)
|
|
55
|
+
*/
|
|
56
|
+
onOverlayClick(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Handle ESC key press
|
|
59
|
+
*/
|
|
60
|
+
onEscapeKey(event: Event): void;
|
|
61
|
+
/**
|
|
62
|
+
* Prevent dropdown click from closing
|
|
63
|
+
*/
|
|
64
|
+
onDropdownClick(event: Event): void;
|
|
65
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StRowActionsDropdownComponent, never>;
|
|
66
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StRowActionsDropdownComponent, "st-row-actions-dropdown", never, { "isOpen": "isOpen"; "position": "position"; "context": "context"; }, { "actionClicked": "actionClicked"; "closed": "closed"; }, never, never>;
|
|
67
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { EventEmitter, OnInit, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { Observable, BehaviorSubject } from 'rxjs';
|
|
3
|
+
import { SheetConfig } from '../../../models/sheet-config.interface';
|
|
4
|
+
import { SheetAction, SheetActionEvent } from '../../../models/sheet-action.interface';
|
|
5
|
+
import { SheetState } from '../../models/sheet-state.class';
|
|
6
|
+
import { SheetStateSnapshot } from '../../models/sheet-state.interface';
|
|
7
|
+
import { CellChangeEvent } from '../../../models/cell-types';
|
|
8
|
+
import { TableStateChangeEvent, DataChangeEvent } from '../../models/table-types';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
export declare class StSheetComponent implements OnInit, OnChanges {
|
|
11
|
+
/**
|
|
12
|
+
* Sheet configuration
|
|
13
|
+
*/
|
|
14
|
+
config: SheetConfig;
|
|
15
|
+
/**
|
|
16
|
+
* Table data (sync)
|
|
17
|
+
*/
|
|
18
|
+
data: any[];
|
|
19
|
+
/**
|
|
20
|
+
* Table data (async) - Observable or BehaviorSubject
|
|
21
|
+
*/
|
|
22
|
+
data$?: Observable<any[]> | BehaviorSubject<any[]>;
|
|
23
|
+
/**
|
|
24
|
+
* Optional external state management
|
|
25
|
+
* If not provided, component will create its own state
|
|
26
|
+
*/
|
|
27
|
+
state?: SheetState;
|
|
28
|
+
/**
|
|
29
|
+
* Emitted when sheet action is clicked
|
|
30
|
+
*/
|
|
31
|
+
sheetActionClicked: EventEmitter<SheetActionEvent>;
|
|
32
|
+
/**
|
|
33
|
+
* Emitted when sheet state changes
|
|
34
|
+
*/
|
|
35
|
+
stateChange: EventEmitter<SheetStateSnapshot>;
|
|
36
|
+
/**
|
|
37
|
+
* Emitted when a cell value changes
|
|
38
|
+
*/
|
|
39
|
+
cellChange: EventEmitter<CellChangeEvent<any>>;
|
|
40
|
+
/**
|
|
41
|
+
* Emitted when table state changes (pagination, sorting, filtering)
|
|
42
|
+
*/
|
|
43
|
+
tableStateChange: EventEmitter<TableStateChangeEvent>;
|
|
44
|
+
/**
|
|
45
|
+
* Emitted when data changes (via Observable)
|
|
46
|
+
*/
|
|
47
|
+
dataChange: EventEmitter<DataChangeEvent>;
|
|
48
|
+
/**
|
|
49
|
+
* Internal state instance
|
|
50
|
+
*/
|
|
51
|
+
internalState?: SheetState;
|
|
52
|
+
/**
|
|
53
|
+
* Visible actions (filtered by hidden property)
|
|
54
|
+
*/
|
|
55
|
+
visibleActions: SheetAction[];
|
|
56
|
+
activeTab: string;
|
|
57
|
+
constructor();
|
|
58
|
+
ngOnInit(): void;
|
|
59
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
60
|
+
/**
|
|
61
|
+
* Initialize sheet state
|
|
62
|
+
*/
|
|
63
|
+
private initializeState;
|
|
64
|
+
/**
|
|
65
|
+
* Get active state (external or internal)
|
|
66
|
+
*/
|
|
67
|
+
get activeState(): SheetState | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Handle sheet action click
|
|
70
|
+
*/
|
|
71
|
+
onActionClick(event: SheetActionEvent): void;
|
|
72
|
+
/**
|
|
73
|
+
* Handle cell value change from table
|
|
74
|
+
*/
|
|
75
|
+
onCellChange(event: CellChangeEvent): void;
|
|
76
|
+
/**
|
|
77
|
+
* Handle table state change (pagination, sorting, filtering)
|
|
78
|
+
*/
|
|
79
|
+
onTableStateChange(event: TableStateChangeEvent): void;
|
|
80
|
+
/**
|
|
81
|
+
* Handle data change from table (via Observable)
|
|
82
|
+
*/
|
|
83
|
+
onDataChange(event: DataChangeEvent): void;
|
|
84
|
+
/**
|
|
85
|
+
* Update visible actions based on hidden property
|
|
86
|
+
*/
|
|
87
|
+
private updateVisibleActions;
|
|
88
|
+
/**
|
|
89
|
+
* Check if header should be shown
|
|
90
|
+
*/
|
|
91
|
+
get showHeader(): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Get header variant class
|
|
94
|
+
*/
|
|
95
|
+
get headerVariant(): string;
|
|
96
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StSheetComponent, never>;
|
|
97
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StSheetComponent, "st-sheet", never, { "config": "config"; "data": "data"; "data$": "data$"; "state": "state"; }, { "sheetActionClicked": "sheetActionClicked"; "stateChange": "stateChange"; "cellChange": "cellChange"; "tableStateChange": "tableStateChange"; "dataChange": "dataChange"; }, never, never>;
|
|
98
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { SheetAction, SheetActionEvent } from '../../../models/sheet-action.interface';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class StSheetActionsComponent {
|
|
5
|
+
/**
|
|
6
|
+
* Array of sheet actions
|
|
7
|
+
*/
|
|
8
|
+
actions: SheetAction[];
|
|
9
|
+
/**
|
|
10
|
+
* Sheet ID for context
|
|
11
|
+
*/
|
|
12
|
+
sheetId: string;
|
|
13
|
+
/**
|
|
14
|
+
* Emitted when an action is clicked
|
|
15
|
+
*/
|
|
16
|
+
actionClicked: EventEmitter<SheetActionEvent>;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the dropdown is open
|
|
19
|
+
*/
|
|
20
|
+
isOpen: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Visible actions (filtered by hidden property)
|
|
23
|
+
*/
|
|
24
|
+
visibleActions: SheetAction[];
|
|
25
|
+
/**
|
|
26
|
+
* Dropdown positioning style
|
|
27
|
+
*/
|
|
28
|
+
dropdownStyle: any;
|
|
29
|
+
constructor();
|
|
30
|
+
ngOnInit(): void;
|
|
31
|
+
ngOnChanges(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Toggle dropdown menu
|
|
34
|
+
*/
|
|
35
|
+
toggleMenu(event: MouseEvent): void;
|
|
36
|
+
/**
|
|
37
|
+
* Close dropdown menu
|
|
38
|
+
*/
|
|
39
|
+
closeMenu(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Handle action click
|
|
42
|
+
*/
|
|
43
|
+
onActionClick(action: SheetAction, event: Event): void;
|
|
44
|
+
/**
|
|
45
|
+
* Check if action is disabled
|
|
46
|
+
*/
|
|
47
|
+
isActionDisabled(action: SheetAction): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Update visible actions based on hidden property
|
|
50
|
+
*/
|
|
51
|
+
private updateVisibleActions;
|
|
52
|
+
/**
|
|
53
|
+
* Update dropdown position based on trigger button
|
|
54
|
+
*/
|
|
55
|
+
private updateDropdownPosition;
|
|
56
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StSheetActionsComponent, never>;
|
|
57
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StSheetActionsComponent, "st-sheet-actions", never, { "actions": "actions"; "sheetId": "sheetId"; }, { "actionClicked": "actionClicked"; }, never, never>;
|
|
58
|
+
}
|