@zeedhi/teknisa-components-common 1.40.0 → 1.44.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 +851 -749
- package/coverage/coverage-final.json +31 -30
- package/coverage/lcov-report/index.html +39 -25
- package/coverage/lcov.info +1566 -1353
- package/dist/tek-components-common.esm.js +281 -29
- package/dist/tek-components-common.umd.js +280 -27
- package/package.json +2 -2
- package/tests/unit/components/tek-grid/grid.spec.ts +446 -7
- package/tests/unit/components/tek-grid/layout_options.spec.ts +156 -2
- package/tests/unit/components/tek-iterable-component-render/iterable-component-render.spec.ts +9 -0
- package/tests/unit/components/tek-loading/Loading.spec.ts +30 -0
- package/tests/unit/components/tek-product-card/product-card.spec.ts +9 -0
- package/tests/unit/components/tree-grid/tree-grid.spec.ts +159 -2
- package/tests/unit/utils/grid-base/grid-controller.spec.ts +106 -3
- package/types/components/index.d.ts +2 -0
- package/types/components/tek-datasource/memory-datasource.d.ts +4 -2
- package/types/components/tek-grid/grid-column.d.ts +4 -1
- package/types/components/tek-grid/grid.d.ts +10 -0
- package/types/components/tek-grid/interfaces.d.ts +6 -3
- package/types/components/tek-grid/layout-options.d.ts +4 -1
- package/types/components/tek-iterable-component-render/interfaces.d.ts +3 -0
- package/types/components/tek-iterable-component-render/iterable-component-render.d.ts +12 -0
- package/types/components/tek-loading/interfaces.d.ts +6 -0
- package/types/components/tek-loading/loading.d.ts +24 -0
- package/types/components/tek-product-card/interfaces.d.ts +3 -0
- package/types/components/tek-product-card/product-card.d.ts +12 -0
- package/types/components/tek-tree-grid/interfaces.d.ts +3 -1
- package/types/components/tek-tree-grid/tree-grid.d.ts +6 -0
- package/types/utils/grid-base/grid-base.d.ts +42 -34
- package/types/utils/grid-base/grid-controller.d.ts +7 -3
- package/types/utils/index.d.ts +2 -2
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { GridEditable, IComponentRender } from '@zeedhi/common';
|
|
2
2
|
import { Datasource, IDictionary } from '@zeedhi/core';
|
|
3
|
+
import { ITekGridAtoms } from '../../utils';
|
|
3
4
|
import { TekGridColumn } from './grid-column';
|
|
4
5
|
import { ITekGrid, ITekGridColumn, ITekGridEvents, ITekGridExportConfig } from './interfaces';
|
|
6
|
+
import { TekGridLayoutOptions } from './layout-options';
|
|
5
7
|
export declare class TekGrid extends GridEditable implements ITekGrid {
|
|
6
8
|
title: string;
|
|
7
9
|
addButton: boolean;
|
|
8
10
|
deleteButton: 'none' | 'currentRow' | 'selection';
|
|
9
11
|
actions: IComponentRender[];
|
|
10
12
|
filterButton: boolean;
|
|
13
|
+
showSearch: boolean;
|
|
11
14
|
columnFilterButton: boolean;
|
|
12
15
|
columnsButton: boolean;
|
|
13
16
|
columnsButtonIgnore: string[];
|
|
@@ -71,6 +74,11 @@ export declare class TekGrid extends GridEditable implements ITekGrid {
|
|
|
71
74
|
*/
|
|
72
75
|
constructor(props: ITekGrid);
|
|
73
76
|
onCreated(): void;
|
|
77
|
+
protected keyShortcutKeyMapping: any;
|
|
78
|
+
onMounted(element: HTMLElement): void;
|
|
79
|
+
onBeforeDestroy(): void;
|
|
80
|
+
protected focusSearchInput(): void;
|
|
81
|
+
get layoutOptions(): TekGridLayoutOptions | undefined;
|
|
74
82
|
/**
|
|
75
83
|
* Get Grid columns objects
|
|
76
84
|
* @param columns Grid columns parameter
|
|
@@ -133,4 +141,6 @@ export declare class TekGrid extends GridEditable implements ITekGrid {
|
|
|
133
141
|
* @param element DOM Element
|
|
134
142
|
*/
|
|
135
143
|
selectGroupClick(row: IDictionary<any>, isSelected: boolean, event: Event, element: HTMLElement): void;
|
|
144
|
+
getAtomInstance<T>(key: keyof ITekGridAtoms): T;
|
|
145
|
+
getFilterInputs(columnName?: string): import("@zeedhi/common").Input[];
|
|
136
146
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IComponent, IComponentEvents, IComponentRender, IGridColumnEditable, IGridEditable, IIterableColumnsButton } from '@zeedhi/common';
|
|
2
2
|
import { IDictionary, IEvent, IEventParam } from '@zeedhi/core';
|
|
3
|
-
import { IDynamicFilterItem } from '..';
|
|
3
|
+
import { IDynamicFilterItem, TekGridLayoutOptions } from '..';
|
|
4
4
|
export interface ITekGridLayoutEventParams extends IEventParam<ITekGrid> {
|
|
5
5
|
layouts: ITekGridLayoutInfo;
|
|
6
6
|
}
|
|
@@ -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;
|
|
@@ -46,6 +47,7 @@ export interface ITekGrid extends IGridEditable {
|
|
|
46
47
|
exportActions?: IComponentRender[];
|
|
47
48
|
groupsOpened?: boolean;
|
|
48
49
|
showSummaryTotal?: boolean;
|
|
50
|
+
layoutOptions?: TekGridLayoutOptions;
|
|
49
51
|
}
|
|
50
52
|
export interface ITekGridExportConfig {
|
|
51
53
|
type: string;
|
|
@@ -59,8 +61,8 @@ export interface ITekGridLayoutInfo {
|
|
|
59
61
|
}
|
|
60
62
|
export interface ITekGridLayout {
|
|
61
63
|
name: string;
|
|
62
|
-
gridWidth
|
|
63
|
-
columns
|
|
64
|
+
gridWidth?: string;
|
|
65
|
+
columns?: ITekGridLayoutColumn[];
|
|
64
66
|
order?: string[];
|
|
65
67
|
dynamicFilter?: IDictionary<IDynamicFilterItem[]>;
|
|
66
68
|
filter?: IDictionary<any>;
|
|
@@ -95,6 +97,7 @@ export interface IFilterPropsComponent extends IComponent {
|
|
|
95
97
|
export interface ITekGridColumn extends IGridColumnEditable {
|
|
96
98
|
filterProps?: IFilterPropsComponent | IFilterPropsComponent[];
|
|
97
99
|
filterable?: boolean;
|
|
100
|
+
filterIndex?: number;
|
|
98
101
|
fixed?: boolean;
|
|
99
102
|
grouped?: boolean;
|
|
100
103
|
aggregation?: ITekGridColumnAggregation;
|
|
@@ -17,9 +17,12 @@ export declare class TekGridLayoutOptions extends ComponentRender implements ITe
|
|
|
17
17
|
private getParentGrid;
|
|
18
18
|
onMounted(element: HTMLElement): Promise<void>;
|
|
19
19
|
getHelperValue(column: any): string | (string | undefined)[] | undefined;
|
|
20
|
-
newLayout(
|
|
20
|
+
newLayout(layout: ITekGridLayout): void;
|
|
21
|
+
addLayout(layout: ITekGridLayout): void;
|
|
21
22
|
applyLayout(name: string, save?: boolean): void;
|
|
22
23
|
private saveLayouts;
|
|
23
24
|
deleteLayout(name: string): void;
|
|
24
25
|
updateLayout(name: string, layout: ITekGridLayout): void;
|
|
26
|
+
updateDefaultLayout(layout: ITekGridLayout): void;
|
|
27
|
+
private fixColumns;
|
|
25
28
|
}
|
|
@@ -33,6 +33,18 @@ export declare class IterableComponentRender extends Iterable implements IIterab
|
|
|
33
33
|
* Components that will be rendered in no-result case
|
|
34
34
|
*/
|
|
35
35
|
noResultSlot: IComponentRender[];
|
|
36
|
+
/**
|
|
37
|
+
* Sets the height for the component.
|
|
38
|
+
*/
|
|
39
|
+
height: number | string;
|
|
40
|
+
/**
|
|
41
|
+
* Sets the maximum height for the component.
|
|
42
|
+
*/
|
|
43
|
+
maxHeight: number | string;
|
|
44
|
+
/**
|
|
45
|
+
* Sets the minimum height for the component.
|
|
46
|
+
*/
|
|
47
|
+
minHeight: number | string;
|
|
36
48
|
/**
|
|
37
49
|
* Components that will be rendered in error case
|
|
38
50
|
*/
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentRender } from '@zeedhi/common';
|
|
2
|
+
import { ILoading } from './interfaces';
|
|
3
|
+
/**
|
|
4
|
+
* Teknisa component
|
|
5
|
+
*/
|
|
6
|
+
export declare class Loading extends ComponentRender implements ILoading {
|
|
7
|
+
/**
|
|
8
|
+
* text to show in Loader Overlay
|
|
9
|
+
*/
|
|
10
|
+
text: string;
|
|
11
|
+
/**
|
|
12
|
+
* zIndex value.
|
|
13
|
+
*/
|
|
14
|
+
zIndex: number | string;
|
|
15
|
+
/**
|
|
16
|
+
* loading path.
|
|
17
|
+
*/
|
|
18
|
+
image: string;
|
|
19
|
+
/**
|
|
20
|
+
* Creates a new instance of TekLoading
|
|
21
|
+
* @param props Image Link props
|
|
22
|
+
*/
|
|
23
|
+
constructor(props: ILoading);
|
|
24
|
+
}
|
|
@@ -44,6 +44,18 @@ export declare class ProductCard extends ComponentRender implements IProductCard
|
|
|
44
44
|
* Card width
|
|
45
45
|
*/
|
|
46
46
|
width: string;
|
|
47
|
+
/**
|
|
48
|
+
* Sets the height for the component.
|
|
49
|
+
*/
|
|
50
|
+
height: number | string;
|
|
51
|
+
/**
|
|
52
|
+
* Sets the maximum height for the component.
|
|
53
|
+
*/
|
|
54
|
+
maxHeight: number | string;
|
|
55
|
+
/**
|
|
56
|
+
* Sets the minimum height for the component.
|
|
57
|
+
*/
|
|
58
|
+
minHeight: number | string;
|
|
47
59
|
protected currencyFormatterFn: Function;
|
|
48
60
|
/**
|
|
49
61
|
* Creates a new instance of ProductCard
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IComponentRender, ITreeGridEditable } from '@zeedhi/common';
|
|
2
|
-
import { ITekGridColumn, ITekGridEvents, ITekGridExportConfig } from '..';
|
|
2
|
+
import { ITekGridColumn, ITekGridEvents, ITekGridExportConfig, TekGridLayoutOptions } from '..';
|
|
3
3
|
export interface ITekTreeGrid extends ITreeGridEditable {
|
|
4
4
|
actions?: IComponentRender[];
|
|
5
5
|
addButton?: boolean;
|
|
@@ -10,10 +10,12 @@ 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;
|
|
16
17
|
showReload?: boolean;
|
|
17
18
|
exportConfig?: ITekGridExportConfig[];
|
|
18
19
|
exportActions?: IComponentRender[];
|
|
20
|
+
layoutOptions?: TekGridLayoutOptions;
|
|
19
21
|
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { IComponentRender, TreeGridEditable } from '@zeedhi/common';
|
|
2
2
|
import { Datasource, IDictionary } from '@zeedhi/core';
|
|
3
|
+
import { ITekGridAtoms } from '../../utils';
|
|
3
4
|
import { TekGridColumn } from '../tek-grid/grid-column';
|
|
4
5
|
import { ITekGrid, ITekGridColumn, ITekGridEvents, ITekGridExportConfig } from '../tek-grid/interfaces';
|
|
5
6
|
import { ITekTreeGrid } from './interfaces';
|
|
7
|
+
import { TekGridLayoutOptions } from '..';
|
|
6
8
|
export declare class TekTreeGrid extends TreeGridEditable implements ITekTreeGrid {
|
|
7
9
|
title: string;
|
|
8
10
|
addButton: boolean;
|
|
9
11
|
deleteButton: 'none' | 'currentRow' | 'selection';
|
|
10
12
|
actions: IComponentRender[];
|
|
11
13
|
filterButton: boolean;
|
|
14
|
+
showSearch?: boolean;
|
|
12
15
|
columnFilterButton: boolean;
|
|
13
16
|
columnsButton: boolean;
|
|
14
17
|
columnsButtonIgnore: string[];
|
|
@@ -58,6 +61,7 @@ export declare class TekTreeGrid extends TreeGridEditable implements ITekTreeGri
|
|
|
58
61
|
*/
|
|
59
62
|
constructor(props: ITekGrid);
|
|
60
63
|
onCreated(): void;
|
|
64
|
+
get layoutOptions(): TekGridLayoutOptions | undefined;
|
|
61
65
|
/**
|
|
62
66
|
* Get Grid columns objects
|
|
63
67
|
* @param columns Grid columns parameter
|
|
@@ -73,4 +77,6 @@ export declare class TekTreeGrid extends TreeGridEditable implements ITekTreeGri
|
|
|
73
77
|
* @param element DOM Element
|
|
74
78
|
*/
|
|
75
79
|
rowClick(row: IDictionary<any>, event: Event, element: HTMLElement): void;
|
|
80
|
+
getAtomInstance<T>(key: keyof ITekGridAtoms): T;
|
|
81
|
+
getFilterInputs(columnName?: string): import("@zeedhi/common").Input[];
|
|
76
82
|
}
|
|
@@ -1,6 +1,24 @@
|
|
|
1
|
-
import { IButton } from '@zeedhi/common';
|
|
2
|
-
import { IEventParam } from '@zeedhi/core';
|
|
1
|
+
import { IButton, Input } from '@zeedhi/common';
|
|
2
|
+
import { IDictionary, IEventParam } from '@zeedhi/core';
|
|
3
3
|
import { TekGrid, TekTreeGrid } from '../../components';
|
|
4
|
+
export interface ITekGridAtoms {
|
|
5
|
+
TITLE: string;
|
|
6
|
+
ADD_BUTTON: string;
|
|
7
|
+
DELETE_BUTTON: string;
|
|
8
|
+
REFRESH_BUTTON: string;
|
|
9
|
+
COLUMNS_BUTTON: string;
|
|
10
|
+
LAYOUT_BUTTON: string;
|
|
11
|
+
EXPORT_BUTTON: string;
|
|
12
|
+
ACTIONS_BUTTON: string;
|
|
13
|
+
SAVE_BUTTON: string;
|
|
14
|
+
CANCEL_BUTTON: string;
|
|
15
|
+
SEARCH: string;
|
|
16
|
+
FILTER_BUTTON: string;
|
|
17
|
+
FILTER_MODAL: string;
|
|
18
|
+
FILTER_FORM: string;
|
|
19
|
+
EXPORT_DROPDOWN: string;
|
|
20
|
+
ACTIONS_DROPDOWN: string;
|
|
21
|
+
}
|
|
4
22
|
export declare class GridBase {
|
|
5
23
|
private grid;
|
|
6
24
|
private exportConfigButtons;
|
|
@@ -94,26 +112,6 @@ export declare class GridBase {
|
|
|
94
112
|
children?: undefined;
|
|
95
113
|
offsetY?: undefined;
|
|
96
114
|
activator?: undefined;
|
|
97
|
-
} | {
|
|
98
|
-
name: string;
|
|
99
|
-
component: string;
|
|
100
|
-
label: string;
|
|
101
|
-
bottom: boolean;
|
|
102
|
-
children: {
|
|
103
|
-
name: string;
|
|
104
|
-
component: string;
|
|
105
|
-
icon: boolean;
|
|
106
|
-
iconName: string;
|
|
107
|
-
isVisible: boolean;
|
|
108
|
-
events: {
|
|
109
|
-
click: () => void;
|
|
110
|
-
};
|
|
111
|
-
}[];
|
|
112
|
-
cssClass?: undefined;
|
|
113
|
-
vertical?: undefined;
|
|
114
|
-
isVisible?: undefined;
|
|
115
|
-
offsetY?: undefined;
|
|
116
|
-
activator?: undefined;
|
|
117
115
|
} | {
|
|
118
116
|
name: string;
|
|
119
117
|
component: string;
|
|
@@ -160,17 +158,6 @@ export declare class GridBase {
|
|
|
160
158
|
bottom?: undefined;
|
|
161
159
|
vertical?: undefined;
|
|
162
160
|
isVisible?: undefined;
|
|
163
|
-
} | {
|
|
164
|
-
name: string;
|
|
165
|
-
component: string;
|
|
166
|
-
cssClass: string;
|
|
167
|
-
vertical: boolean;
|
|
168
|
-
label?: undefined;
|
|
169
|
-
bottom?: undefined;
|
|
170
|
-
children?: undefined;
|
|
171
|
-
isVisible?: undefined;
|
|
172
|
-
offsetY?: undefined;
|
|
173
|
-
activator?: undefined;
|
|
174
161
|
})[];
|
|
175
162
|
cssClass?: undefined;
|
|
176
163
|
text?: undefined;
|
|
@@ -214,6 +201,21 @@ export declare class GridBase {
|
|
|
214
201
|
cssStyle?: undefined;
|
|
215
202
|
children?: undefined;
|
|
216
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;
|
|
217
219
|
} | {
|
|
218
220
|
name: string;
|
|
219
221
|
component: string;
|
|
@@ -244,10 +246,11 @@ export declare class GridBase {
|
|
|
244
246
|
private reloadGrid;
|
|
245
247
|
private saveChanges;
|
|
246
248
|
private cancelChanges;
|
|
247
|
-
|
|
249
|
+
filterClick({ event }: any): void;
|
|
248
250
|
private filterModal?;
|
|
249
251
|
private createFilterFromColumns;
|
|
250
252
|
hideFilterModal(): void;
|
|
253
|
+
private sortFilterIndex;
|
|
251
254
|
private getFilterModalComponents;
|
|
252
255
|
private getHelperValueComponent;
|
|
253
256
|
private createHelperValueOptions;
|
|
@@ -257,6 +260,7 @@ export declare class GridBase {
|
|
|
257
260
|
private clearFilterHelperValue;
|
|
258
261
|
private loadFilterValues;
|
|
259
262
|
private applyFilter;
|
|
263
|
+
private clearFilter;
|
|
260
264
|
getFilterRelationsDatasource(): any;
|
|
261
265
|
getFilterOperationsDatasource(): any;
|
|
262
266
|
getFilterOptionsData(prop: string): {
|
|
@@ -264,4 +268,8 @@ export declare class GridBase {
|
|
|
264
268
|
value: string;
|
|
265
269
|
}[];
|
|
266
270
|
setSearch(search: string): Promise<any>;
|
|
271
|
+
protected filterFormInputs: IDictionary<string[]>;
|
|
272
|
+
protected atoms: ITekGridAtoms;
|
|
273
|
+
getAtomInstance<T>(key: keyof ITekGridAtoms): T;
|
|
274
|
+
getFilterInputs(columnName?: string): Input[];
|
|
267
275
|
}
|
|
@@ -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;
|
package/types/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ReportFilter } from './report-filter/report-filter';
|
|
2
|
-
import { GridBase } from './grid-base/grid-base';
|
|
2
|
+
import { GridBase, ITekGridAtoms } from './grid-base/grid-base';
|
|
3
3
|
import { GridController } from './grid-base/grid-controller';
|
|
4
|
-
export { ReportFilter, GridBase, GridController };
|
|
4
|
+
export { ReportFilter, GridBase, ITekGridAtoms, GridController, };
|