@zeedhi/teknisa-components-common 3.1.0 → 3.2.0
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/dist/teknisa-components-common.es.js +3536 -0
- package/dist/types/components/tek-breadcrumb-header/breadcrumb-header.d.ts +2 -2
- package/dist/types/components/tek-breadcrumb-header/interfaces.d.ts +1 -1
- package/dist/types/components/tek-datasource/tek-memory-datasource.d.ts +1 -21
- package/dist/types/components/tek-datasource/tek-rest-datasource.d.ts +6 -28
- package/dist/types/components/tek-grid/filter-helper.d.ts +2 -2
- package/dist/types/components/tek-grid/grid-filter-button.d.ts +1 -0
- package/dist/types/components/tek-grid/grouped-data-manager.d.ts +8 -1
- package/dist/types/components/tek-grid/interfaces.d.ts +8 -1
- package/dist/types/components/tek-grid/tek-grid-controller.d.ts +19 -17
- package/dist/types/components/tek-grid/tek-grid-data-editor.d.ts +11 -0
- package/dist/types/components/tek-grid/tek-grid-toolbar-provider/export-options/multi-option.d.ts +1 -1
- package/dist/types/components/tek-grid/tek-grid-toolbar-provider/tek-grid-toolbar-provider.d.ts +8 -1
- package/dist/types/components/tek-grid/tek-grid.d.ts +22 -5
- package/dist/types/components/tek-loading/interfaces.d.ts +1 -1
- package/dist/types/components/tek-loading/loading.d.ts +1 -1
- package/dist/types/components/tek-user-info/TekUserInfoController.d.ts +4 -4
- package/dist/types/utils/extract-properties/extract-properties.d.ts +1 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/report-filter/report-filter.d.ts +12 -0
- package/package.json +30 -12
- package/coverage/clover.xml +0 -6
- package/coverage/coverage-final.json +0 -1
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -101
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov-report/tests/__helpers__/component-event-helper.ts.html +0 -100
- package/coverage/lcov-report/tests/__helpers__/create-component.ts.html +0 -109
- package/coverage/lcov-report/tests/__helpers__/find-component.ts.html +0 -139
- package/coverage/lcov-report/tests/__helpers__/flush-promises-helper.ts.html +0 -94
- package/coverage/lcov-report/tests/__helpers__/get-child-helper.ts.html +0 -166
- package/coverage/lcov-report/tests/__helpers__/index.html +0 -221
- package/coverage/lcov-report/tests/__helpers__/index.ts.html +0 -106
- package/coverage/lcov-report/tests/__helpers__/mock-created-helper.ts.html +0 -121
- package/coverage/lcov-report/tests/__helpers__/spy-on-all-methods.ts.html +0 -223
- package/coverage/lcov.info +0 -0
- package/dist/teknisa-components-common.js +0 -3808
- package/dist/teknisa-components-common.min.js +0 -3808
- package/dist/types/components/tek-grid/grouped-view-navigator.d.ts +0 -14
- package/environments.json +0 -26
- package/jest.config.cjs +0 -23
- package/src/components/index.ts +0 -101
- package/src/components/tek-breadcrumb-header/breadcrumb-header.ts +0 -29
- package/src/components/tek-breadcrumb-header/interfaces.ts +0 -7
- package/src/components/tek-datasource/index.ts +0 -3
- package/src/components/tek-datasource/interfaces.ts +0 -36
- package/src/components/tek-datasource/tek-memory-datasource.ts +0 -314
- package/src/components/tek-datasource/tek-rest-datasource.ts +0 -224
- package/src/components/tek-grid/columns-searcher.ts +0 -22
- package/src/components/tek-grid/dynamic-filter-datasource-factory.ts +0 -20
- package/src/components/tek-grid/filter-helper.ts +0 -20
- package/src/components/tek-grid/grid-filter-button.ts +0 -421
- package/src/components/tek-grid/grouped-data-manager.ts +0 -448
- package/src/components/tek-grid/grouped-data-navigator.ts +0 -66
- package/src/components/tek-grid/grouped-data-selector.ts +0 -40
- package/src/components/tek-grid/index.ts +0 -18
- package/src/components/tek-grid/interfaces.ts +0 -329
- package/src/components/tek-grid/keymap-grouped.ts +0 -20
- package/src/components/tek-grid/layout-options.ts +0 -248
- package/src/components/tek-grid/tek-grid-column.ts +0 -193
- package/src/components/tek-grid/tek-grid-columns-button/tek-grid-columns-button-controller.ts +0 -28
- package/src/components/tek-grid/tek-grid-columns-button/tek-grid-columns-button.ts +0 -38
- package/src/components/tek-grid/tek-grid-controller.ts +0 -140
- package/src/components/tek-grid/tek-grid-events.ts +0 -105
- package/src/components/tek-grid/tek-grid-toolbar-provider/export-options/button-option.ts +0 -26
- package/src/components/tek-grid/tek-grid-toolbar-provider/export-options/index.ts +0 -3
- package/src/components/tek-grid/tek-grid-toolbar-provider/export-options/interfaces.ts +0 -6
- package/src/components/tek-grid/tek-grid-toolbar-provider/export-options/multi-option.ts +0 -85
- package/src/components/tek-grid/tek-grid-toolbar-provider/index.ts +0 -2
- package/src/components/tek-grid/tek-grid-toolbar-provider/tek-grid-toolbar-provider.ts +0 -365
- package/src/components/tek-grid/tek-grid.ts +0 -1122
- package/src/components/tek-loading/interfaces.ts +0 -7
- package/src/components/tek-loading/loading.ts +0 -27
- package/src/components/tek-user-info/TekUserInfoController.ts +0 -87
- package/src/components/tek-user-info/interfaces.ts +0 -21
- package/src/components/tek-user-info/tek-user-info-list.ts +0 -64
- package/src/components/tek-user-info/tek-user-info.ts +0 -337
- package/src/error/tek-grid-delete-rows-error.ts +0 -15
- package/src/error/teknisa-common-error.ts +0 -8
- package/src/utils/config/config.ts +0 -8
- package/src/utils/index.ts +0 -3
- package/src/utils/is-filled-object/is-filled-object.ts +0 -5
- package/src/utils/is-nil.ts +0 -3
- package/tests/__helpers__/component-event-helper.ts +0 -5
- package/tests/__helpers__/create-component.ts +0 -8
- package/tests/__helpers__/find-component.ts +0 -18
- package/tests/__helpers__/flush-promises-helper.ts +0 -3
- package/tests/__helpers__/get-child-helper.ts +0 -27
- package/tests/__helpers__/index.ts +0 -7
- package/tests/__helpers__/mock-created-helper.ts +0 -12
- package/tests/__helpers__/spy-on-all-methods.ts +0 -46
- package/tests/__mocks__/@zeedhi/core/i18n.js +0 -75
- package/tests/__mocks__/@zeedhi/core.js +0 -5
- package/tests/unit/components/tek-breadcrumb-header/tek-breadcrumb-header.spec.ts +0 -43
- package/tests/unit/components/tek-datasource/memory-datasource.spec.ts +0 -463
- package/tests/unit/components/tek-datasource/rest-datasource.spec.ts +0 -362
- package/tests/unit/components/tek-grid/button-option.spec.ts +0 -49
- package/tests/unit/components/tek-grid/columns-searcher.spec.ts +0 -112
- package/tests/unit/components/tek-grid/dynamic-filter-datasource-factory.spec.ts +0 -90
- package/tests/unit/components/tek-grid/filter-helper.spec.ts +0 -56
- package/tests/unit/components/tek-grid/grid-filter-button.spec.ts +0 -842
- package/tests/unit/components/tek-grid/grouped-data-manager.spec.ts +0 -593
- package/tests/unit/components/tek-grid/grouped-data-navigator.spec.ts +0 -143
- package/tests/unit/components/tek-grid/grouped-data-selector.spec.ts +0 -136
- package/tests/unit/components/tek-grid/keymap-grouped.spec.ts +0 -20
- package/tests/unit/components/tek-grid/layout-options.spec.ts +0 -1020
- package/tests/unit/components/tek-grid/tek-grid-column.spec.ts +0 -318
- package/tests/unit/components/tek-grid/tek-grid-columns-button.spec.ts +0 -229
- package/tests/unit/components/tek-grid/tek-grid-controller.spec.ts +0 -253
- package/tests/unit/components/tek-grid/tek-grid-events.spec.ts +0 -186
- package/tests/unit/components/tek-grid/tek-grid-toolbar-provider.spec.ts +0 -34
- package/tests/unit/components/tek-grid/tek-grid.spec.ts +0 -897
- package/tests/unit/components/tek-grid/tek-memory-datasource.spec.ts +0 -482
- package/tests/unit/components/tek-grid/tek-rest-datasource.spec.ts +0 -422
- package/tests/unit/components/tek-loading/loading.spec.ts +0 -29
- package/tests/unit/components/tek-user-info/TekUserInfoContoller.spec.ts +0 -220
- package/tests/unit/components/tek-user-info/tek-user-info-list.spec.ts +0 -96
- package/tests/unit/components/tek-user-info/tek-user-info.spec.ts +0 -442
- package/tests/unit/utils/mock-console.ts +0 -18
- package/tests/unit/utils/setup.ts +0 -5
- package/tsconfig.build.json +0 -7
- package/tsconfig.eslint.json +0 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { IBreadcrumbs, ComponentRender, IComponentRender } from '@zeedhi/common';
|
|
2
|
+
import { IBreadcrumbHeader } from './interfaces';
|
|
3
3
|
/**
|
|
4
4
|
* BreadcrumbHeader join breadcrumb and title
|
|
5
5
|
*/
|
|
@@ -62,27 +62,7 @@ export declare class TekMemoryDatasource extends MemoryDatasource implements ITe
|
|
|
62
62
|
* @returns Is valid filter value
|
|
63
63
|
*/
|
|
64
64
|
protected isValidDynamicFilterValue(column: string, value?: IDictionary<any>[]): boolean | undefined;
|
|
65
|
-
clone():
|
|
66
|
-
dynamicFilter: IDictionary<IDynamicFilterItem[]>;
|
|
67
|
-
searchJoin: IDictionary<(string | number)[]>;
|
|
68
|
-
type: string;
|
|
69
|
-
translate?: boolean | string[];
|
|
70
|
-
sortFunction?: (value1: any, value2: any, columnName: string) => boolean;
|
|
71
|
-
sortParams?: IDictionary<any>;
|
|
72
|
-
currentRow?: IDictionary<any>;
|
|
73
|
-
data?: IDictionary<any>[];
|
|
74
|
-
filter?: IDictionary<any>;
|
|
75
|
-
limit?: number | string;
|
|
76
|
-
loadAll?: boolean;
|
|
77
|
-
loading?: boolean;
|
|
78
|
-
order?: string[];
|
|
79
|
-
page?: number | string;
|
|
80
|
-
search?: string;
|
|
81
|
-
searchIn?: string[];
|
|
82
|
-
uniqueKey?: string;
|
|
83
|
-
watchUrl?: boolean;
|
|
84
|
-
events?: import("@zeedhi/core").IDatasourceEvents;
|
|
85
|
-
};
|
|
65
|
+
clone(): any;
|
|
86
66
|
/**
|
|
87
67
|
* Updates filtered data
|
|
88
68
|
*/
|
|
@@ -33,29 +33,29 @@ export declare class TekRestDatasource extends RestDatasource implements ITekRes
|
|
|
33
33
|
* @param value Dynamic Filter value
|
|
34
34
|
* @returns Promise with data collection
|
|
35
35
|
*/
|
|
36
|
-
addDynamicFilter(column: string, value: any): Promise<
|
|
36
|
+
addDynamicFilter(column: string, value: any): Promise<any>;
|
|
37
37
|
/**
|
|
38
38
|
* Removes a dynamic filter position
|
|
39
39
|
* @param column Dynamic Filter column name
|
|
40
40
|
* @returns Promise with data collection
|
|
41
41
|
*/
|
|
42
|
-
removeDynamicFilter(column: string): Promise<
|
|
42
|
+
removeDynamicFilter(column: string): Promise<any>;
|
|
43
43
|
/**
|
|
44
44
|
* Sets new dynamic filter value
|
|
45
45
|
* @param filter Dynamic Filter value
|
|
46
46
|
* @returns Promise with data collection
|
|
47
47
|
*/
|
|
48
|
-
setDynamicFilter(filter: IDictionary<any>): Promise<
|
|
48
|
+
setDynamicFilter(filter: IDictionary<any>): Promise<any>;
|
|
49
49
|
/**
|
|
50
50
|
* Clears Dynamic filter value
|
|
51
51
|
* @returns Promise with data collection
|
|
52
52
|
*/
|
|
53
|
-
clearDynamicFilter(): Promise<
|
|
53
|
+
clearDynamicFilter(): Promise<any>;
|
|
54
54
|
/**
|
|
55
55
|
* Resets page and selected rows and tries to update the url
|
|
56
56
|
* @returns Promise with data collection
|
|
57
57
|
*/
|
|
58
|
-
updateDynamicFilter(): Promise<
|
|
58
|
+
updateDynamicFilter(): Promise<any>;
|
|
59
59
|
/**
|
|
60
60
|
* Checks if a filter value is valid
|
|
61
61
|
* @param value Filter value
|
|
@@ -67,27 +67,5 @@ export declare class TekRestDatasource extends RestDatasource implements ITekRes
|
|
|
67
67
|
*/
|
|
68
68
|
protected getRequestParams(): any;
|
|
69
69
|
hasFilter(columnName: string): boolean;
|
|
70
|
-
clone():
|
|
71
|
-
dynamicFilter: IDictionary<IDynamicFilterItem[]>;
|
|
72
|
-
searchJoin: IDictionary<(string | number)[]>;
|
|
73
|
-
type: string;
|
|
74
|
-
route?: string;
|
|
75
|
-
lazyLoad?: boolean;
|
|
76
|
-
arrayFormat?: import("@zeedhi/core").ArrayFormatType;
|
|
77
|
-
find?: IDictionary;
|
|
78
|
-
localSearch?: boolean;
|
|
79
|
-
currentRow?: IDictionary<any>;
|
|
80
|
-
data?: IDictionary<any>[];
|
|
81
|
-
filter?: IDictionary<any>;
|
|
82
|
-
limit?: number | string;
|
|
83
|
-
loadAll?: boolean;
|
|
84
|
-
loading?: boolean;
|
|
85
|
-
order?: string[];
|
|
86
|
-
page?: number | string;
|
|
87
|
-
search?: string;
|
|
88
|
-
searchIn?: string[];
|
|
89
|
-
uniqueKey?: string;
|
|
90
|
-
watchUrl?: boolean;
|
|
91
|
-
events?: import("@zeedhi/core").IDatasourceEvents;
|
|
92
|
-
};
|
|
70
|
+
clone(): any;
|
|
93
71
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TekGridColumn } from './tek-grid-column';
|
|
2
2
|
export declare class TekFilterHelper {
|
|
3
|
-
static getLabel(name: string):
|
|
4
|
-
static getValue(name: string, column: TekGridColumn):
|
|
3
|
+
static getLabel(name: string): any;
|
|
4
|
+
static getValue(name: string, column: TekGridColumn): any;
|
|
5
5
|
static register(name: string, label: string, fn: () => Date | [Date, Date]): void;
|
|
6
6
|
static unregister(name: string): void;
|
|
7
7
|
}
|
|
@@ -24,6 +24,7 @@ export declare class TekGridFilterButton extends Button implements ITekGridFilte
|
|
|
24
24
|
private setFilter;
|
|
25
25
|
private clearFilter;
|
|
26
26
|
private sortFilterIndex;
|
|
27
|
+
getFilterInputs(columnName?: string): any;
|
|
27
28
|
private getFilterModalComponents;
|
|
28
29
|
private changeHelperEvent;
|
|
29
30
|
}
|
|
@@ -58,7 +58,7 @@ export declare class GroupedDataManager implements IGroupedDataManager {
|
|
|
58
58
|
/**
|
|
59
59
|
* Returns the summary data for the group
|
|
60
60
|
*/
|
|
61
|
-
getSummaryData(group: IDictionary<ITekGridSummary>): IDictionary
|
|
61
|
+
getSummaryData(group: IDictionary<ITekGridSummary>): IDictionary;
|
|
62
62
|
/**
|
|
63
63
|
* Adds group footers to the grouped data
|
|
64
64
|
*/
|
|
@@ -73,6 +73,13 @@ export declare class GroupedDataManager implements IGroupedDataManager {
|
|
|
73
73
|
* the grid.
|
|
74
74
|
*/
|
|
75
75
|
buildGroupedData(): void;
|
|
76
|
+
private updateGroupFooterSummary;
|
|
77
|
+
private updateSummaryTotal;
|
|
78
|
+
/**
|
|
79
|
+
* Recalculates all group footers and the summary total in place, without rebuilding
|
|
80
|
+
* the grouped data structure. Used to reflect in-progress cell edits.
|
|
81
|
+
*/
|
|
82
|
+
updateSummary(): void;
|
|
76
83
|
openGroup(group: IDictionary<any>): void;
|
|
77
84
|
isItemVisible(row: IDictionary<any>): any;
|
|
78
85
|
isGrouped(): boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Datasource, IDictionary, IEvent, IEventParam } from '@zeedhi/core';
|
|
2
|
-
import { EventDef, GridEventsProp, IButton, IComponent, IComponentEvents, IComponentRender, IGridColumnEditable, IGridEditable, IGridEditableEvents, IGridEditableProps, IGridEvent, IIterableColumnsButton, IModal, Iterable } from '@zeedhi/common';
|
|
2
|
+
import { EventDef, GridEventsProp, IBeforeReportEvent, IButton, IComponent, IComponentEvents, IComponentRender, IGridColumnEditable, IGridEditable, IGridEditableEvents, IGridEditableProps, IGridEvent, IIterableColumnsButton, IModal, Input, Iterable, LabelFormatter } from '@zeedhi/common';
|
|
3
3
|
import { IDynamicFilterItem } from '../tek-datasource/interfaces';
|
|
4
4
|
import { TekGridColumn } from './tek-grid-column';
|
|
5
5
|
export interface IModalFilterProps extends IModal {
|
|
@@ -81,10 +81,13 @@ export interface ISupportsToolbar {
|
|
|
81
81
|
showCheckboxAllFilter: boolean;
|
|
82
82
|
defaultFilter: IDictionary;
|
|
83
83
|
editNewRowsOnly: boolean;
|
|
84
|
+
toolbarConfig: (IComponentRender | string)[];
|
|
85
|
+
showHideButton: boolean;
|
|
84
86
|
}
|
|
85
87
|
export interface IExportable {
|
|
86
88
|
reportTitle: string;
|
|
87
89
|
xlsDefaultType?: string;
|
|
90
|
+
reportLabelFormatter?: LabelFormatter;
|
|
88
91
|
getReport(type: string, portrait?: boolean, rowObj?: any): Promise<Window | null>;
|
|
89
92
|
}
|
|
90
93
|
export type IAsyncEvent<T> = (event: T) => Promise<any>;
|
|
@@ -96,6 +99,7 @@ export interface TekGridEventsProp<T = IGridEvent | IEventParam<any> | ITekGridL
|
|
|
96
99
|
beforeApplyFilter?: EventDef<T>;
|
|
97
100
|
beforeCancel?: EventDef<T>;
|
|
98
101
|
beforeDelete?: EventDef<T>;
|
|
102
|
+
beforeOpenReport?: EventDef<T, IBeforeReportEvent>;
|
|
99
103
|
beforeSave?: EventDef<T>;
|
|
100
104
|
calcSummary?: EventDef<T>;
|
|
101
105
|
filterClick?: EventDef<T>;
|
|
@@ -105,6 +109,7 @@ export interface TekGridEventsProp<T = IGridEvent | IEventParam<any> | ITekGridL
|
|
|
105
109
|
groupSelect?: EventDef<T>;
|
|
106
110
|
groupUnselect?: EventDef<T>;
|
|
107
111
|
beforeReload?: EventDef<T>;
|
|
112
|
+
[key: string]: any;
|
|
108
113
|
}
|
|
109
114
|
export type MultiOptionParams = {
|
|
110
115
|
iconName: string;
|
|
@@ -157,6 +162,7 @@ export interface IGroupedDataManager {
|
|
|
157
162
|
updateGrouping: (lazyLoad?: boolean) => void;
|
|
158
163
|
updateGroupedData(lazyLoad: boolean): Promise<void>;
|
|
159
164
|
buildGroupedData(): void;
|
|
165
|
+
updateSummary(): void;
|
|
160
166
|
openGroup(group: IDictionary<any>): void;
|
|
161
167
|
isItemVisible(row: IDictionary<any>): any;
|
|
162
168
|
isGrouped(): boolean;
|
|
@@ -236,6 +242,7 @@ export interface ITekGridToolbarProvider {
|
|
|
236
242
|
getProperties(): IComponentRender[];
|
|
237
243
|
getAtomInstance<T>(key: keyof ITekGridAtoms): T;
|
|
238
244
|
getAtomName(key: keyof ITekGridAtoms): string;
|
|
245
|
+
getFilterInputs(columnName?: string): Input[];
|
|
239
246
|
}
|
|
240
247
|
export interface IDynamicFilterDatasourceFactory {
|
|
241
248
|
factory(options: IDictionary<boolean>): Datasource;
|
|
@@ -4,28 +4,30 @@ export declare class TekGridController {
|
|
|
4
4
|
private grid;
|
|
5
5
|
openToolbar: boolean;
|
|
6
6
|
constructor(grid: IGridEditable & ISupportsToolbar);
|
|
7
|
-
get gridTitle():
|
|
8
|
-
get showAddButton():
|
|
7
|
+
get gridTitle(): any;
|
|
8
|
+
get showAddButton(): any;
|
|
9
9
|
get showDeleteButton(): boolean;
|
|
10
|
-
get showFilterButton():
|
|
11
|
-
get showModalFilterProps():
|
|
12
|
-
get showSearchInput():
|
|
10
|
+
get showFilterButton(): any;
|
|
11
|
+
get showModalFilterProps(): any;
|
|
12
|
+
get showSearchInput(): any;
|
|
13
13
|
get showToolbar(): boolean;
|
|
14
|
+
get showHideButton(): any;
|
|
15
|
+
get toolbarCollapseClass(): string;
|
|
14
16
|
set showToolbar(value: boolean);
|
|
15
17
|
get toolbarClass(): string;
|
|
16
18
|
get tooltipName(): "TEKGRID_SHOW" | "TEKGRID_HIDE";
|
|
17
|
-
get showReloadButton():
|
|
18
|
-
get showDivider2():
|
|
19
|
-
get showColumnsButton():
|
|
20
|
-
get columnsButtonIgnore():
|
|
21
|
-
get showLayoutOptionsButton():
|
|
22
|
-
get showDivider1():
|
|
19
|
+
get showReloadButton(): any;
|
|
20
|
+
get showDivider2(): any;
|
|
21
|
+
get showColumnsButton(): any;
|
|
22
|
+
get columnsButtonIgnore(): any;
|
|
23
|
+
get showLayoutOptionsButton(): any;
|
|
24
|
+
get showDivider1(): any;
|
|
23
25
|
get showActionsButton(): boolean;
|
|
24
|
-
get showExportButton():
|
|
25
|
-
get showActionAndExportButton():
|
|
26
|
-
get showDivider3():
|
|
27
|
-
get isEditing():
|
|
28
|
-
get showEditButtons():
|
|
26
|
+
get showExportButton(): any;
|
|
27
|
+
get showActionAndExportButton(): any;
|
|
28
|
+
get showDivider3(): any;
|
|
29
|
+
get isEditing(): any;
|
|
30
|
+
get showEditButtons(): any;
|
|
29
31
|
get isNotEditing(): boolean;
|
|
30
|
-
get disableDeleteButton():
|
|
32
|
+
get disableDeleteButton(): any;
|
|
31
33
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IDictionary } from '@zeedhi/core';
|
|
2
|
+
import { DataEditorWithAdd, IGridColumnEditable, Input } from '@zeedhi/common';
|
|
3
|
+
import { ITekGrid } from './interfaces';
|
|
4
|
+
/**
|
|
5
|
+
* Extends DataEditorWithAdd to refresh the grouped data summary/footers after an inline cell edit,
|
|
6
|
+
* since TekGrid composes its data editor instead of inheriting from it.
|
|
7
|
+
*/
|
|
8
|
+
export declare class TekGridDataEditor extends DataEditorWithAdd {
|
|
9
|
+
protected grid: ITekGrid;
|
|
10
|
+
changeEditableComponent(column: IGridColumnEditable, row: IDictionary<any>, value: any, component?: Input): void;
|
|
11
|
+
}
|
package/dist/types/components/tek-grid/tek-grid-toolbar-provider/export-options/multi-option.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IComponent
|
|
1
|
+
import { IComponent } from '@zeedhi/common';
|
|
2
2
|
import { IExportable, ITekGridExportConfig } from '../../interfaces';
|
|
3
3
|
import { IExportOption } from './interfaces';
|
|
4
4
|
export declare class MultiOption implements IExportOption {
|
package/dist/types/components/tek-grid/tek-grid-toolbar-provider/tek-grid-toolbar-provider.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IEventParam } from '@zeedhi/core';
|
|
2
|
-
import { IComponentRender, IGridEditable } from '@zeedhi/common';
|
|
2
|
+
import { IComponentRender, IGridEditable, Input } from '@zeedhi/common';
|
|
3
3
|
import { IExportable, ISupportsToolbar, ITekGridAtoms, ITekGridToolbarProvider } from '../interfaces';
|
|
4
|
+
import { TekGridFilterButton } from '../grid-filter-button';
|
|
4
5
|
type GridEditableWithToolbar = IGridEditable & ISupportsToolbar & IExportable;
|
|
5
6
|
export declare class TekGridToolbarProvider implements ITekGridToolbarProvider {
|
|
6
7
|
private grid;
|
|
@@ -9,6 +10,9 @@ export declare class TekGridToolbarProvider implements ITekGridToolbarProvider {
|
|
|
9
10
|
protected atoms: ITekGridAtoms;
|
|
10
11
|
getAtomName(key: keyof ITekGridAtoms): string;
|
|
11
12
|
getAtomInstance<T>(key: keyof ITekGridAtoms): T;
|
|
13
|
+
filterButton?: TekGridFilterButton;
|
|
14
|
+
private loadFilterButton;
|
|
15
|
+
getFilterInputs(columnName?: string): Input[];
|
|
12
16
|
private getOption;
|
|
13
17
|
private getExportConfigButtons;
|
|
14
18
|
private hideButtonClick;
|
|
@@ -17,6 +21,9 @@ export declare class TekGridToolbarProvider implements ITekGridToolbarProvider {
|
|
|
17
21
|
private addButtonClick;
|
|
18
22
|
private deleteButtonClick;
|
|
19
23
|
reloadGrid({ event }: IEventParam<any>): void;
|
|
24
|
+
private getDefaultToolbarItems;
|
|
25
|
+
private processUserToolbarItems;
|
|
26
|
+
private getHeaderItems;
|
|
20
27
|
getProperties(): IComponentRender[];
|
|
21
28
|
}
|
|
22
29
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Datasource, IDictionary, IEventParam } from '@zeedhi/core';
|
|
2
|
-
import { Direction, IGrid, VerticalDirection, IComponent, IComponentRender, IGridColumnEditable, IGridEditable, Iterable, IIterableProps } from '@zeedhi/common';
|
|
3
|
-
import { IModalFilterProps, ITekGrid, ITekGridAtoms, ITekGridColumn, ITekGridExportConfig, ITekGridProps, ITekGridSummary } from './interfaces';
|
|
2
|
+
import { Direction, IGrid, LabelFormatter, VerticalDirection, IComponent, IComponentRender, IGridColumnEditable, IGridEditable, Iterable, IIterableProps } from '@zeedhi/common';
|
|
3
|
+
import { IModalFilterProps, ITekGrid, ITekGridAtoms, ITekGridColumn, ITekGridExportConfig, ITekGridProps, ITekGridSummary, TekGridEventsProp } from './interfaces';
|
|
4
4
|
import { TekGridColumn } from './tek-grid-column';
|
|
5
5
|
export declare class TekGrid extends Iterable<TekGridColumn> implements ITekGrid {
|
|
6
6
|
private tableActionBuilder;
|
|
@@ -14,6 +14,7 @@ export declare class TekGrid extends Iterable<TekGridColumn> implements ITekGrid
|
|
|
14
14
|
private columnsSearcher;
|
|
15
15
|
private groupedDataManager;
|
|
16
16
|
private tekGridToolbarProvider;
|
|
17
|
+
events: TekGridEventsProp;
|
|
17
18
|
title: string;
|
|
18
19
|
addButton: boolean;
|
|
19
20
|
deleteButton: 'none' | 'currentRow' | 'selection';
|
|
@@ -25,6 +26,11 @@ export declare class TekGrid extends Iterable<TekGridColumn> implements ITekGrid
|
|
|
25
26
|
columnsButton: boolean;
|
|
26
27
|
mainGrid: boolean;
|
|
27
28
|
columnsButtonIgnore: string[];
|
|
29
|
+
/**
|
|
30
|
+
* Components that will be rendered on toolbar slot
|
|
31
|
+
*/
|
|
32
|
+
toolbarConfig: (IComponentRender | string)[];
|
|
33
|
+
showHideButton: boolean;
|
|
28
34
|
/**
|
|
29
35
|
* Enables column dragging
|
|
30
36
|
* @public
|
|
@@ -72,6 +78,7 @@ export declare class TekGrid extends Iterable<TekGridColumn> implements ITekGrid
|
|
|
72
78
|
defaultFilter: IDictionary;
|
|
73
79
|
toolbarOpened: boolean;
|
|
74
80
|
reportTitle: string;
|
|
81
|
+
reportLabelFormatter?: LabelFormatter;
|
|
75
82
|
editing: boolean;
|
|
76
83
|
currentColumn: TekGridColumn | null;
|
|
77
84
|
selectedRows: IDictionary<any>[];
|
|
@@ -132,9 +139,10 @@ export declare class TekGrid extends Iterable<TekGridColumn> implements ITekGrid
|
|
|
132
139
|
calcSummary(column: TekGridColumn, columnNamesummary: ITekGridSummary, row: IDictionary): void;
|
|
133
140
|
private getDefaultLazy;
|
|
134
141
|
initializeGrouping(lazyLoad: boolean): void;
|
|
135
|
-
updateGrouping(): void;
|
|
142
|
+
updateGrouping(lazyLoad?: boolean): void;
|
|
136
143
|
updateGroupedData(lazyLoad: boolean): Promise<void>;
|
|
137
144
|
buildGroupedData(): void;
|
|
145
|
+
updateSummary(): void;
|
|
138
146
|
openGroup(group: IDictionary<any>): void;
|
|
139
147
|
isItemVisible(row: IDictionary<any>): any;
|
|
140
148
|
isGrouped(): boolean;
|
|
@@ -142,7 +150,9 @@ export declare class TekGrid extends Iterable<TekGridColumn> implements ITekGrid
|
|
|
142
150
|
getGroupedData(): IDictionary<any>[];
|
|
143
151
|
directionalLeft(param: IEventParam<any>): void;
|
|
144
152
|
directionalRight(param: IEventParam<any>): void;
|
|
145
|
-
|
|
153
|
+
private buildReportGroups;
|
|
154
|
+
private buildReportAggregations;
|
|
155
|
+
getReport(type: string, portrait?: boolean, rowObj?: any): Promise<Window | null>;
|
|
146
156
|
setViewUpdateFixedColumns(fn: () => void): void;
|
|
147
157
|
setViewUpdateScrollData(fn: () => void): void;
|
|
148
158
|
onCreated(): void;
|
|
@@ -185,7 +195,13 @@ export declare class TekGrid extends Iterable<TekGridColumn> implements ITekGrid
|
|
|
185
195
|
cancelAddedRows(): Promise<void>;
|
|
186
196
|
getAddedRows(): IDictionary<any>[];
|
|
187
197
|
addNewRow(row: IDictionary, position?: 'end' | 'start'): Promise<void>;
|
|
198
|
+
/**
|
|
199
|
+
* Adds a new row taking the group column values from the currently selected row (or group header),
|
|
200
|
+
* so callers don't need to manually specify them when adding a row within a selected group.
|
|
201
|
+
*/
|
|
202
|
+
addToSelection(row: IDictionary, position?: 'end' | 'start'): Promise<void>;
|
|
188
203
|
getVisibleValue(row: IDictionary, column: ITekGridColumn): any;
|
|
204
|
+
getVisibleRow(row: IDictionary): any;
|
|
189
205
|
getEditableComponent(column: ITekGridColumn, row: IDictionary<any>): IComponentRender;
|
|
190
206
|
isEdited(column: ITekGridColumn, row: IDictionary): boolean;
|
|
191
207
|
isValid(column: ITekGridColumn, row: IDictionary, revalidate?: boolean): Promise<boolean>;
|
|
@@ -198,7 +214,7 @@ export declare class TekGrid extends Iterable<TekGridColumn> implements ITekGrid
|
|
|
198
214
|
enterEdit(rowKey: string, columnName: string): void;
|
|
199
215
|
cancelEditedRows(): Promise<void>;
|
|
200
216
|
saveEditedRows(revalidate?: boolean): Promise<void[]>;
|
|
201
|
-
reapplyCanEditRow(row: IDictionary<any>):
|
|
217
|
+
reapplyCanEditRow(row: IDictionary<any>): any;
|
|
202
218
|
getCanEditRow(row: IDictionary<any>): boolean | undefined;
|
|
203
219
|
getEditedRows(revalidate?: boolean, silent?: boolean): IDictionary<any>[];
|
|
204
220
|
getEditedRow(row: IDictionary): IDictionary | undefined;
|
|
@@ -214,4 +230,5 @@ export declare class TekGrid extends Iterable<TekGridColumn> implements ITekGrid
|
|
|
214
230
|
setSearch(search: string): Promise<any>;
|
|
215
231
|
getAtomInstance<T>(key: keyof ITekGridAtoms): T;
|
|
216
232
|
getAtomName(key: keyof ITekGridAtoms): string;
|
|
233
|
+
getFilterInputs(columnName?: string): Input[];
|
|
217
234
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TekUserInfo } from './tek-user-info';
|
|
2
2
|
declare class TekUserInfoController {
|
|
3
3
|
component: TekUserInfo;
|
|
4
|
-
get versionInfo(): import(
|
|
4
|
+
get versionInfo(): import('./interfaces').IVersionInfo | null;
|
|
5
5
|
constructor(component: TekUserInfo);
|
|
6
6
|
get name(): string;
|
|
7
7
|
set name(value: string);
|
|
@@ -15,8 +15,8 @@ declare class TekUserInfoController {
|
|
|
15
15
|
get frontendItems(): string | never[];
|
|
16
16
|
get backendItems(): string | never[];
|
|
17
17
|
get modulesItems(): string | never[];
|
|
18
|
-
get showReportError():
|
|
19
|
-
get showVersionInfo():
|
|
20
|
-
get showAbout():
|
|
18
|
+
get showReportError(): any;
|
|
19
|
+
get showVersionInfo(): any;
|
|
20
|
+
get showAbout(): any;
|
|
21
21
|
}
|
|
22
22
|
export { TekUserInfoController };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const extractProperties: (obj: any, props: string[]) => any;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MetadataFilter } from '@zeedhi/common';
|
|
2
|
+
import { IDictionary } from '@zeedhi/core';
|
|
3
|
+
import { IDynamicFilterItem } from '../../components/tek-datasource/interfaces';
|
|
4
|
+
/**
|
|
5
|
+
* Class to translate a TekRestDatasource dynamicFilter to the ZhReports format
|
|
6
|
+
*/
|
|
7
|
+
export declare class ReportFilter {
|
|
8
|
+
filter: IDictionary<IDynamicFilterItem[]>;
|
|
9
|
+
private messages;
|
|
10
|
+
constructor(filter: IDictionary);
|
|
11
|
+
build(): MetadataFilter;
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,46 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeedhi/teknisa-components-common",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Teknisa Components Common",
|
|
5
5
|
"author": "Zeedhi <zeedhi@teknisa.com>",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"main": "src/index.ts",
|
|
8
8
|
"types": "dist/types/index.d.ts",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"module": "dist/teknisa-components-common.js",
|
|
10
|
+
"module": "dist/teknisa-components-common.es.js",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": "./dist/teknisa-components-common.es.js",
|
|
17
|
+
"types": "./dist/types/index.d.ts"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
11
20
|
"packageManager": "npm@8.19.2",
|
|
12
21
|
"publishConfig": {
|
|
13
22
|
"access": "public"
|
|
14
23
|
},
|
|
15
24
|
"scripts": {
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"test": "
|
|
19
|
-
"watch": "
|
|
25
|
+
"dev": "vite",
|
|
26
|
+
"build": "tsc && vite build",
|
|
27
|
+
"test": "vitest run --coverage",
|
|
28
|
+
"test:watch": "vitest"
|
|
20
29
|
},
|
|
21
30
|
"dependencies": {
|
|
31
|
+
"lodash.clonedeep": "4.5.*",
|
|
22
32
|
"lodash.debounce": "^4.0.8",
|
|
23
33
|
"lodash.get": "^4.4.2",
|
|
24
34
|
"lodash.merge": "^4.6.2"
|
|
25
35
|
},
|
|
26
36
|
"devDependencies": {
|
|
27
|
-
"@
|
|
28
|
-
"@rollup/plugin-json": "^6.0.0",
|
|
29
|
-
"@rollup/plugin-typescript": "^11.1.1",
|
|
37
|
+
"@types/lodash.clonedeep": "4.5.*",
|
|
30
38
|
"@types/lodash.debounce": "^4.0.7",
|
|
31
39
|
"@types/lodash.get": "^4.4.7",
|
|
32
40
|
"@types/lodash.merge": "^4.6.7",
|
|
41
|
+
"@types/node": "^22.10.2",
|
|
42
|
+
"@vitest/coverage-v8": "^2.1.8",
|
|
33
43
|
"@zeedhi/common": "^3.0.0",
|
|
34
44
|
"@zeedhi/core": "^3.0.0",
|
|
35
45
|
"@zeedhi/zd-user-info-common": "^3.0.0",
|
|
36
|
-
"@zeedhi/zd-user-info-vue": "^3.0.0"
|
|
46
|
+
"@zeedhi/zd-user-info-vue": "^3.0.0",
|
|
47
|
+
"jsdom": "^27.1.0",
|
|
48
|
+
"lodash.debounce": "^4.0.8",
|
|
49
|
+
"typescript": "~5.6.2",
|
|
50
|
+
"vite": "^6.0.1",
|
|
51
|
+
"vite-plugin-dts": "^4.3.0",
|
|
52
|
+
"vitest": "^2.1.8"
|
|
37
53
|
},
|
|
38
54
|
"peerDependencies": {
|
|
39
55
|
"@zeedhi/common": "^3.0.0",
|
|
40
|
-
"@zeedhi/core": "^3.0.0"
|
|
56
|
+
"@zeedhi/core": "^3.0.0",
|
|
57
|
+
"@zeedhi/zd-user-info-common": "^3.0.0",
|
|
58
|
+
"@zeedhi/zd-user-info-vue": "^3.0.0"
|
|
41
59
|
},
|
|
42
60
|
"env": {
|
|
43
61
|
"NODE_ENV": "production"
|
|
44
62
|
},
|
|
45
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "43ffebef28c3efaf5e4f1a6947c37487c439f9a3"
|
|
46
64
|
}
|
package/coverage/clover.xml
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="1783093380014" clover="3.2.0">
|
|
3
|
-
<project timestamp="1783093380014" name="All files">
|
|
4
|
-
<metrics statements="0" coveredstatements="0" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0" elements="0" coveredelements="0" complexity="0" loc="0" ncloc="0" packages="0" files="0" classes="0"/>
|
|
5
|
-
</project>
|
|
6
|
-
</coverage>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|