@zeedhi/teknisa-components-common 1.43.0 → 1.46.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/coverage/clover.xml +536 -517
- package/coverage/coverage-final.json +9 -9
- package/coverage/lcov-report/index.html +15 -15
- package/coverage/lcov.info +1051 -990
- package/dist/tek-components-common.esm.js +55 -11
- package/dist/tek-components-common.umd.js +54 -10
- package/package.json +2 -2
- package/tests/unit/components/tek-grid/grid-columns-button.spec.ts +25 -0
- package/tests/unit/components/tek-grid/grid.spec.ts +96 -1
- package/tests/unit/utils/grid-base/grid-controller.spec.ts +106 -3
- package/types/components/tek-grid/grid-column.d.ts +4 -1
- package/types/components/tek-grid/grid-columns-button-controller.d.ts +1 -0
- package/types/components/tek-grid/grid.d.ts +1 -0
- package/types/components/tek-grid/interfaces.d.ts +2 -0
- package/types/components/tek-loading/interfaces.d.ts +2 -2
- package/types/components/tek-loading/loading.d.ts +2 -2
- package/types/components/tek-tree-grid/interfaces.d.ts +1 -0
- package/types/components/tek-tree-grid/tree-grid.d.ts +1 -0
- package/types/utils/grid-base/grid-base.d.ts +16 -31
- package/types/utils/grid-base/grid-controller.d.ts +7 -3
|
@@ -15,7 +15,8 @@ describe('GridController', () => {
|
|
|
15
15
|
filterButton: true,
|
|
16
16
|
columnsButton: true,
|
|
17
17
|
showExport: true,
|
|
18
|
-
|
|
18
|
+
showLayoutOptionsButton: true,
|
|
19
|
+
showReloadButton: true,
|
|
19
20
|
actions: [{ name: 'button', component: 'ZdButton' }],
|
|
20
21
|
});
|
|
21
22
|
const instance = new GridController(grid);
|
|
@@ -27,10 +28,14 @@ describe('GridController', () => {
|
|
|
27
28
|
expect(instance.showActionsButton).toBeTruthy();
|
|
28
29
|
expect(instance.showExportButton).toBeTruthy();
|
|
29
30
|
expect(instance.showActionAndExportButton).toBeTruthy();
|
|
31
|
+
expect(instance.showSearchInput).toBeTruthy();
|
|
32
|
+
expect(instance.showDivider2).toBeTruthy();
|
|
33
|
+
expect(instance.showDivider3).toBeTruthy();
|
|
30
34
|
expect(instance.showColumnsButton).toBeTruthy();
|
|
31
35
|
expect(instance.columnsButtonIgnore).toEqual([]);
|
|
32
|
-
expect(instance.
|
|
33
|
-
expect(instance.
|
|
36
|
+
expect(instance.showLayoutOptionsButton).toBeTruthy();
|
|
37
|
+
expect(instance.showReloadButton).toBeTruthy();
|
|
38
|
+
expect(instance.showDivider1).toBeTruthy();
|
|
34
39
|
expect(instance.isEditing).toBeFalsy();
|
|
35
40
|
expect(instance.isNotEditing).toBeTruthy();
|
|
36
41
|
expect(instance.disableDeleteButton).toBeTruthy();
|
|
@@ -38,12 +43,110 @@ describe('GridController', () => {
|
|
|
38
43
|
grid.datasource.currentRow = { id: '1' };
|
|
39
44
|
expect(instance.disableDeleteButton).toBeFalsy();
|
|
40
45
|
grid.showExport = false;
|
|
46
|
+
grid.showLayoutOptions = false;
|
|
47
|
+
grid.showReload = false;
|
|
48
|
+
grid.columnsButton = false;
|
|
41
49
|
grid.actions = [];
|
|
42
50
|
grid.deleteButton = 'selection';
|
|
43
51
|
grid.selectedRows = [{ id: '1' }];
|
|
44
52
|
expect(instance.disableDeleteButton).toBeFalsy();
|
|
45
53
|
expect(instance.showExportButton).toBeFalsy();
|
|
46
54
|
expect(instance.showActionAndExportButton).toBeFalsy();
|
|
55
|
+
expect(instance.showLayoutOptionsButton).toBeFalsy();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('should verify if showDivider3 is visibility', () => {
|
|
59
|
+
const grid = new TekGrid({
|
|
60
|
+
name: 'Grid',
|
|
61
|
+
component: 'TekGrid',
|
|
62
|
+
addButton: false,
|
|
63
|
+
deleteButton: 'none',
|
|
64
|
+
filterButton: false,
|
|
65
|
+
columnsButton: false,
|
|
66
|
+
showReload: false,
|
|
67
|
+
showLayoutOptions: false,
|
|
68
|
+
showReloadButton: true,
|
|
69
|
+
showSearch: false,
|
|
70
|
+
showExport: false,
|
|
71
|
+
actions: [],
|
|
72
|
+
});
|
|
73
|
+
const instance = new GridController(grid);
|
|
74
|
+
|
|
75
|
+
expect(instance.showDivider3).toBeFalsy();
|
|
76
|
+
expect(instance.showActionsButton).toBeFalsy();
|
|
77
|
+
expect(instance.showExportButton).toBeFalsy();
|
|
78
|
+
expect(instance.showSearchInput).toBeFalsy();
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('should verify if showActionAndExportButton is visibility', () => {
|
|
82
|
+
const grid = new TekGrid({
|
|
83
|
+
name: 'Grid',
|
|
84
|
+
component: 'TekGrid',
|
|
85
|
+
addButton: false,
|
|
86
|
+
deleteButton: 'none',
|
|
87
|
+
filterButton: false,
|
|
88
|
+
columnsButton: true,
|
|
89
|
+
showReload: false,
|
|
90
|
+
showLayoutOptions: true,
|
|
91
|
+
showReloadButton: true,
|
|
92
|
+
showSearch: false,
|
|
93
|
+
showExport: false,
|
|
94
|
+
actions: [],
|
|
95
|
+
});
|
|
96
|
+
const instance = new GridController(grid);
|
|
97
|
+
|
|
98
|
+
expect(instance.showActionAndExportButton).toBeFalsy();
|
|
99
|
+
expect(instance.showActionsButton).toBeFalsy();
|
|
100
|
+
expect(instance.showSearchInput).toBeFalsy();
|
|
101
|
+
expect(instance.showExportButton).toBeFalsy();
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('should verify if showDivider2 is visibility', () => {
|
|
105
|
+
const grid = new TekGrid({
|
|
106
|
+
name: 'Grid',
|
|
107
|
+
component: 'TekGrid',
|
|
108
|
+
addButton: false,
|
|
109
|
+
deleteButton: 'none',
|
|
110
|
+
filterButton: false,
|
|
111
|
+
columnsButton: false,
|
|
112
|
+
showReload: true,
|
|
113
|
+
showLayoutOptions: false,
|
|
114
|
+
showSearch: false,
|
|
115
|
+
showExport: false,
|
|
116
|
+
actions: [],
|
|
117
|
+
});
|
|
118
|
+
const instance = new GridController(grid);
|
|
119
|
+
|
|
120
|
+
expect(instance.showDivider2).toBeFalsy();
|
|
121
|
+
expect(instance.showActionsButton).toBeFalsy();
|
|
122
|
+
expect(instance.showSearchInput).toBeFalsy();
|
|
123
|
+
expect(instance.showColumnsButton).toBeFalsy();
|
|
124
|
+
expect(instance.showExportButton).toBeFalsy();
|
|
125
|
+
expect(instance.showReloadButton).toBeTruthy();
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('should verify if showDivider1 is visibility', () => {
|
|
129
|
+
const grid = new TekGrid({
|
|
130
|
+
name: 'Grid',
|
|
131
|
+
component: 'TekGrid',
|
|
132
|
+
addButton: true,
|
|
133
|
+
deleteButton: 'selection',
|
|
134
|
+
filterButton: false,
|
|
135
|
+
columnsButton: false,
|
|
136
|
+
showReload: false,
|
|
137
|
+
showLayoutOptions: false,
|
|
138
|
+
showSearch: false,
|
|
139
|
+
showExport: false,
|
|
140
|
+
actions: [],
|
|
141
|
+
});
|
|
142
|
+
const instance = new GridController(grid);
|
|
143
|
+
|
|
144
|
+
expect(instance.showDivider1).toBeFalsy();
|
|
145
|
+
expect(instance.showActionsButton).toBeFalsy();
|
|
146
|
+
expect(instance.showSearchInput).toBeFalsy();
|
|
147
|
+
expect(instance.showColumnsButton).toBeFalsy();
|
|
148
|
+
expect(instance.showExportButton).toBeFalsy();
|
|
149
|
+
expect(instance.showReloadButton).toBeFalsy();
|
|
47
150
|
});
|
|
48
151
|
});
|
|
49
152
|
});
|
|
@@ -7,9 +7,10 @@ import { IFilterPropsComponent, ITekGridColumn, ITekGridColumnAggregation } from
|
|
|
7
7
|
export declare class TekGridColumn extends GridColumnEditable implements ITekGridColumn {
|
|
8
8
|
filterProps: IFilterPropsComponent | IFilterPropsComponent[];
|
|
9
9
|
filterable: boolean;
|
|
10
|
+
filterIndex?: number;
|
|
10
11
|
fixed: boolean;
|
|
11
12
|
private groupedValue;
|
|
12
|
-
|
|
13
|
+
private groupOpenedValue?;
|
|
13
14
|
groupLabelForEmptyValue: string;
|
|
14
15
|
private aggregationValue?;
|
|
15
16
|
private isVisibleValue;
|
|
@@ -33,6 +34,8 @@ export declare class TekGridColumn extends GridColumnEditable implements ITekGri
|
|
|
33
34
|
set grouped(value: boolean);
|
|
34
35
|
get aggregation(): ITekGridColumnAggregation;
|
|
35
36
|
set aggregation(value: ITekGridColumnAggregation);
|
|
37
|
+
get groupOpened(): boolean | undefined;
|
|
38
|
+
set groupOpened(value: boolean | undefined);
|
|
36
39
|
get isVisible(): boolean;
|
|
37
40
|
set isVisible(value: boolean);
|
|
38
41
|
private changeGrouping;
|
|
@@ -4,4 +4,5 @@ import { TekGridColumn } from './grid-column';
|
|
|
4
4
|
export declare class TekGridColumnsButtonController extends IterableColumnsButtonController {
|
|
5
5
|
changeGroupedColumn(column: TekGridColumn, { component, event, element }: IEventParam<Checkbox>): void;
|
|
6
6
|
changeAggregationColumn(column: TekGridColumn, { component, event, element }: IEventParam<Checkbox>): void;
|
|
7
|
+
showHideTekColumn(column: TekGridColumn, { component, event, element }: IEventParam<Checkbox>): void;
|
|
7
8
|
}
|
|
@@ -10,6 +10,7 @@ export declare class TekGrid extends GridEditable implements ITekGrid {
|
|
|
10
10
|
deleteButton: 'none' | 'currentRow' | 'selection';
|
|
11
11
|
actions: IComponentRender[];
|
|
12
12
|
filterButton: boolean;
|
|
13
|
+
showSearch: boolean;
|
|
13
14
|
columnFilterButton: boolean;
|
|
14
15
|
columnsButton: boolean;
|
|
15
16
|
columnsButtonIgnore: string[];
|
|
@@ -38,6 +38,7 @@ export interface ITekGrid extends IGridEditable {
|
|
|
38
38
|
deleteButton?: 'none' | 'currentRow' | 'selection';
|
|
39
39
|
events?: ITekGridEvents;
|
|
40
40
|
filterButton?: boolean;
|
|
41
|
+
showSearch?: boolean;
|
|
41
42
|
showLayoutOptions?: boolean;
|
|
42
43
|
title?: string;
|
|
43
44
|
showExport?: boolean;
|
|
@@ -96,6 +97,7 @@ export interface IFilterPropsComponent extends IComponent {
|
|
|
96
97
|
export interface ITekGridColumn extends IGridColumnEditable {
|
|
97
98
|
filterProps?: IFilterPropsComponent | IFilterPropsComponent[];
|
|
98
99
|
filterable?: boolean;
|
|
100
|
+
filterIndex?: number;
|
|
99
101
|
fixed?: boolean;
|
|
100
102
|
grouped?: boolean;
|
|
101
103
|
aggregation?: ITekGridColumnAggregation;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface ILoading extends
|
|
1
|
+
import { ILoading as IZdLoading } from '@zeedhi/common';
|
|
2
|
+
export interface ILoading extends IZdLoading {
|
|
3
3
|
text?: string;
|
|
4
4
|
zIndex?: number | string;
|
|
5
5
|
image?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Loading as ZdLoading } from '@zeedhi/common';
|
|
2
2
|
import { ILoading } from './interfaces';
|
|
3
3
|
/**
|
|
4
4
|
* Teknisa component
|
|
5
5
|
*/
|
|
6
|
-
export declare class Loading extends
|
|
6
|
+
export declare class Loading extends ZdLoading implements ILoading {
|
|
7
7
|
/**
|
|
8
8
|
* text to show in Loader Overlay
|
|
9
9
|
*/
|
|
@@ -10,6 +10,7 @@ export interface ITekTreeGrid extends ITreeGridEditable {
|
|
|
10
10
|
deleteButton?: 'none' | 'currentRow' | 'selection';
|
|
11
11
|
events?: ITekGridEvents;
|
|
12
12
|
filterButton?: boolean;
|
|
13
|
+
showSearch?: boolean;
|
|
13
14
|
showLayoutOptions?: boolean;
|
|
14
15
|
title?: string;
|
|
15
16
|
showExport?: boolean;
|
|
@@ -11,6 +11,7 @@ export declare class TekTreeGrid extends TreeGridEditable implements ITekTreeGri
|
|
|
11
11
|
deleteButton: 'none' | 'currentRow' | 'selection';
|
|
12
12
|
actions: IComponentRender[];
|
|
13
13
|
filterButton: boolean;
|
|
14
|
+
showSearch?: boolean;
|
|
14
15
|
columnFilterButton: boolean;
|
|
15
16
|
columnsButton: boolean;
|
|
16
17
|
columnsButtonIgnore: string[];
|
|
@@ -112,26 +112,6 @@ export declare class GridBase {
|
|
|
112
112
|
children?: undefined;
|
|
113
113
|
offsetY?: undefined;
|
|
114
114
|
activator?: undefined;
|
|
115
|
-
} | {
|
|
116
|
-
name: string;
|
|
117
|
-
component: string;
|
|
118
|
-
label: string;
|
|
119
|
-
bottom: boolean;
|
|
120
|
-
children: {
|
|
121
|
-
name: string;
|
|
122
|
-
component: string;
|
|
123
|
-
icon: boolean;
|
|
124
|
-
iconName: string;
|
|
125
|
-
isVisible: boolean;
|
|
126
|
-
events: {
|
|
127
|
-
click: () => void;
|
|
128
|
-
};
|
|
129
|
-
}[];
|
|
130
|
-
cssClass?: undefined;
|
|
131
|
-
vertical?: undefined;
|
|
132
|
-
isVisible?: undefined;
|
|
133
|
-
offsetY?: undefined;
|
|
134
|
-
activator?: undefined;
|
|
135
115
|
} | {
|
|
136
116
|
name: string;
|
|
137
117
|
component: string;
|
|
@@ -178,17 +158,6 @@ export declare class GridBase {
|
|
|
178
158
|
bottom?: undefined;
|
|
179
159
|
vertical?: undefined;
|
|
180
160
|
isVisible?: undefined;
|
|
181
|
-
} | {
|
|
182
|
-
name: string;
|
|
183
|
-
component: string;
|
|
184
|
-
cssClass: string;
|
|
185
|
-
vertical: boolean;
|
|
186
|
-
label?: undefined;
|
|
187
|
-
bottom?: undefined;
|
|
188
|
-
children?: undefined;
|
|
189
|
-
isVisible?: undefined;
|
|
190
|
-
offsetY?: undefined;
|
|
191
|
-
activator?: undefined;
|
|
192
161
|
})[];
|
|
193
162
|
cssClass?: undefined;
|
|
194
163
|
text?: undefined;
|
|
@@ -232,6 +201,21 @@ export declare class GridBase {
|
|
|
232
201
|
cssStyle?: undefined;
|
|
233
202
|
children?: undefined;
|
|
234
203
|
bottom?: undefined;
|
|
204
|
+
} | {
|
|
205
|
+
name: string;
|
|
206
|
+
component: string;
|
|
207
|
+
isVisible: string;
|
|
208
|
+
cssClass?: undefined;
|
|
209
|
+
tag?: undefined;
|
|
210
|
+
text?: undefined;
|
|
211
|
+
title?: undefined;
|
|
212
|
+
cssStyle?: undefined;
|
|
213
|
+
children?: undefined;
|
|
214
|
+
label?: undefined;
|
|
215
|
+
small?: undefined;
|
|
216
|
+
events?: undefined;
|
|
217
|
+
outline?: undefined;
|
|
218
|
+
bottom?: undefined;
|
|
235
219
|
} | {
|
|
236
220
|
name: string;
|
|
237
221
|
component: string;
|
|
@@ -266,6 +250,7 @@ export declare class GridBase {
|
|
|
266
250
|
private filterModal?;
|
|
267
251
|
private createFilterFromColumns;
|
|
268
252
|
hideFilterModal(): void;
|
|
253
|
+
private sortFilterIndex;
|
|
269
254
|
private getFilterModalComponents;
|
|
270
255
|
private getHelperValueComponent;
|
|
271
256
|
private createHelperValueOptions;
|
|
@@ -7,13 +7,17 @@ export declare class GridController {
|
|
|
7
7
|
get showAddButton(): boolean;
|
|
8
8
|
get showDeleteButton(): boolean;
|
|
9
9
|
get showFilterButton(): boolean;
|
|
10
|
+
get showSearchInput(): boolean | undefined;
|
|
11
|
+
get showReloadButton(): boolean;
|
|
12
|
+
get showDivider2(): boolean | undefined;
|
|
10
13
|
get showColumnsButton(): boolean;
|
|
11
14
|
get columnsButtonIgnore(): string[];
|
|
12
|
-
get
|
|
13
|
-
get
|
|
15
|
+
get showLayoutOptionsButton(): boolean;
|
|
16
|
+
get showDivider1(): boolean | undefined;
|
|
14
17
|
get showActionsButton(): boolean;
|
|
15
18
|
get showExportButton(): boolean;
|
|
16
|
-
get showActionAndExportButton(): boolean;
|
|
19
|
+
get showActionAndExportButton(): boolean | undefined;
|
|
20
|
+
get showDivider3(): boolean | undefined;
|
|
17
21
|
get isEditing(): boolean;
|
|
18
22
|
get isNotEditing(): boolean;
|
|
19
23
|
get disableDeleteButton(): boolean;
|