@zeedhi/common 1.96.0 → 1.96.2
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/zd-common.esm.js +242 -91
- package/dist/zd-common.umd.js +242 -89
- package/package.json +2 -2
- package/types/components/index.d.ts +1 -0
- package/types/components/zd-grid/grid-editable.d.ts +11 -0
- package/types/components/zd-grid/grid.d.ts +10 -5
- package/types/components/zd-input/input-factory.d.ts +6 -0
- package/types/components/zd-input/input.d.ts +3 -3
- package/types/components/zd-modal/interfaces.d.ts +9 -1
- package/types/components/zd-modal/modal.d.ts +5 -1
- package/types/components/zd-text-input/interfaces.d.ts +1 -0
- package/types/components/zd-text-input/text-input.d.ts +4 -0
- package/types/components/zd-tree-grid/tree-grid-editable.d.ts +7 -0
- package/types/components/zd-tree-grid/tree-grid.d.ts +1 -8
- package/types/utils/report/dataset-formatters/grouped-pdf-formatter.d.ts +47 -0
- package/types/utils/report/dataset-formatters/index.d.ts +1 -0
- package/types/utils/report/index.d.ts +1 -0
- package/types/utils/report/report.d.ts +1 -1
|
@@ -11,6 +11,7 @@ export declare class GridEditable extends Grid implements IGridEditable {
|
|
|
11
11
|
* Editable columns
|
|
12
12
|
*/
|
|
13
13
|
columns: GridColumnEditable[];
|
|
14
|
+
currentColumn: GridColumnEditable;
|
|
14
15
|
/**
|
|
15
16
|
* Editing rows
|
|
16
17
|
*/
|
|
@@ -44,6 +45,8 @@ export declare class GridEditable extends Grid implements IGridEditable {
|
|
|
44
45
|
private invalidComponents;
|
|
45
46
|
editingNewRows: boolean;
|
|
46
47
|
protected cancelEditedRowsKeyMapping: IKeyMap;
|
|
48
|
+
protected viewEnterEdit: ((rowKey: string, columnName: string) => void) | null;
|
|
49
|
+
setViewEnterEdit(viewEnterEdit: (rowKey: string, columnName: string) => void): void;
|
|
47
50
|
constructor(props: IGridEditable);
|
|
48
51
|
onMounted(element: any): void;
|
|
49
52
|
onBeforeDestroy(): void;
|
|
@@ -160,6 +163,10 @@ export declare class GridEditable extends Grid implements IGridEditable {
|
|
|
160
163
|
* @param revalidate Defines if the fields should be revalidated
|
|
161
164
|
*/
|
|
162
165
|
isGridValid(revalidate?: boolean): boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Checks whether the grid is valid while not in editing mode
|
|
168
|
+
*/
|
|
169
|
+
private isViewGridValid;
|
|
163
170
|
/**
|
|
164
171
|
* Adds new row to the datasource data and pushes it to the editedRows
|
|
165
172
|
* @param row Row
|
|
@@ -204,4 +211,8 @@ export declare class GridEditable extends Grid implements IGridEditable {
|
|
|
204
211
|
private changeCell;
|
|
205
212
|
callCanEditRow(row: IDictionary<any>): any;
|
|
206
213
|
changeData(data?: IDictionary<any>[]): void;
|
|
214
|
+
/**
|
|
215
|
+
* Makes the cell enter edit mode
|
|
216
|
+
*/
|
|
217
|
+
enterEdit(rowKey: string, columnName: string): void;
|
|
207
218
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IDictionary, IKeyMap } from '@zeedhi/core';
|
|
1
|
+
import { IDictionary, IEventParam, IKeyMap } from '@zeedhi/core';
|
|
2
2
|
import { Component } from '../zd-component/component';
|
|
3
3
|
import { IComponent, IComponentRender } from '../zd-component/interfaces';
|
|
4
4
|
import { Iterable } from '../zd-iterable/iterable';
|
|
@@ -143,8 +143,8 @@ export declare class Grid extends Iterable implements IGrid {
|
|
|
143
143
|
};
|
|
144
144
|
cellSelection: boolean;
|
|
145
145
|
currentColumn: Column | null;
|
|
146
|
-
protected viewNavigate: ((direction: 'up' | 'down' | 'left' | 'right') => void) | null;
|
|
147
|
-
setViewNavigate(viewNavigate: (up: 'up' | 'down' | 'left' | 'right') => void): void;
|
|
146
|
+
protected viewNavigate: ((direction: 'up' | 'down' | 'left' | 'right', event?: Event) => void) | null;
|
|
147
|
+
setViewNavigate(viewNavigate: (up: 'up' | 'down' | 'left' | 'right', event?: Event) => void): void;
|
|
148
148
|
/**
|
|
149
149
|
* Creates a new Grid.
|
|
150
150
|
* @param props Grid properties
|
|
@@ -208,10 +208,15 @@ export declare class Grid extends Iterable implements IGrid {
|
|
|
208
208
|
selectAll(isSelected: boolean): void;
|
|
209
209
|
toggleRow(row: IDictionary): void;
|
|
210
210
|
selectRow(row: IDictionary, select: boolean): void;
|
|
211
|
-
navigateLeft(): void;
|
|
212
|
-
navigateRight(): void;
|
|
211
|
+
navigateLeft({ event }: IEventParam<any>): void;
|
|
212
|
+
navigateRight({ event }: IEventParam<any>): void;
|
|
213
213
|
navigateUp(): void;
|
|
214
214
|
navigateDown(): void;
|
|
215
|
+
navigateDatasource(up: boolean): void;
|
|
216
|
+
navigateCurrentRow(up: boolean, rowIndex: number): void;
|
|
217
|
+
navigateInitial(up: boolean): void;
|
|
218
|
+
navigateFirst(): void;
|
|
219
|
+
navigateLast(): void;
|
|
215
220
|
navigatePageUp(): void;
|
|
216
221
|
navigatePageDown(): void;
|
|
217
222
|
deleteRows(): Promise<any[]>;
|
|
@@ -74,7 +74,7 @@ export declare class Input extends ComponentRender implements IInput {
|
|
|
74
74
|
/**
|
|
75
75
|
* Rules that will validate the input value.
|
|
76
76
|
*/
|
|
77
|
-
rules: ((value
|
|
77
|
+
rules: ((value?: any) => boolean | string)[];
|
|
78
78
|
/**
|
|
79
79
|
* Shows input border.
|
|
80
80
|
*/
|
|
@@ -110,7 +110,7 @@ export declare class Input extends ComponentRender implements IInput {
|
|
|
110
110
|
/**
|
|
111
111
|
* Parsed field rules.
|
|
112
112
|
*/
|
|
113
|
-
protected parsedValidations: IDictionary<((value
|
|
113
|
+
protected parsedValidations: IDictionary<((value?: any) => boolean | string)>;
|
|
114
114
|
protected formatterFn: Function;
|
|
115
115
|
protected parserFn: Function;
|
|
116
116
|
protected internalDisplayValue: string;
|
|
@@ -188,7 +188,7 @@ export declare class Input extends ComponentRender implements IInput {
|
|
|
188
188
|
* Checks the input value are valid to all applied rules.
|
|
189
189
|
* @returns Input is valid
|
|
190
190
|
*/
|
|
191
|
-
isValid(): boolean;
|
|
191
|
+
isValid(value?: any): boolean;
|
|
192
192
|
/**
|
|
193
193
|
* Triggered when the input value changes.
|
|
194
194
|
* @param event DOM event
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IEventParam } from '@zeedhi/core';
|
|
2
|
+
import { IComponent, IComponentEvents, EventDef } from '../zd-component/interfaces';
|
|
2
3
|
import { IButton } from '../zd-button/interfaces';
|
|
4
|
+
import { Modal } from './modal';
|
|
5
|
+
export declare type IModalEvent = IEventParam<Modal>;
|
|
6
|
+
export interface IModalEvents<T = IEventParam<any>> extends IComponentEvents<T> {
|
|
7
|
+
onShow?: EventDef<T>;
|
|
8
|
+
onHide?: EventDef<T>;
|
|
9
|
+
}
|
|
3
10
|
export interface IModalGrid {
|
|
4
11
|
cols?: number | string;
|
|
5
12
|
xs?: number | string;
|
|
@@ -21,6 +28,7 @@ export interface IModal extends IComponent {
|
|
|
21
28
|
draggable?: boolean;
|
|
22
29
|
dragHandle?: string;
|
|
23
30
|
escKeydownStop?: boolean;
|
|
31
|
+
events?: IModalEvents;
|
|
24
32
|
}
|
|
25
33
|
export interface IModalCloseButton extends IButton {
|
|
26
34
|
modalName: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IModal, IModalGrid } from './interfaces';
|
|
1
|
+
import { IModal, IModalEvents, IModalGrid } from './interfaces';
|
|
2
2
|
import { Component } from '../zd-component/component';
|
|
3
3
|
/**
|
|
4
4
|
* Base class for Modal component.
|
|
@@ -29,6 +29,10 @@ export declare class Modal extends Component implements IModal {
|
|
|
29
29
|
* Set if esc keydown event should to stop propagation
|
|
30
30
|
*/
|
|
31
31
|
escKeydownStop?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Defines modal events.
|
|
34
|
+
*/
|
|
35
|
+
events: IModalEvents;
|
|
32
36
|
/**
|
|
33
37
|
* Creates a new modal
|
|
34
38
|
* @param props Modal structure
|
|
@@ -44,6 +44,10 @@ export declare class TextInput extends Input implements ITextInput {
|
|
|
44
44
|
* Defines text input value should concat the suffix text.
|
|
45
45
|
*/
|
|
46
46
|
valueWithSuffix: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Defines clicks on outer icon should focus the component.
|
|
49
|
+
*/
|
|
50
|
+
focusOnOuterIconClick: boolean;
|
|
47
51
|
protected formatterFn: Function;
|
|
48
52
|
protected parserFn: Function;
|
|
49
53
|
/**
|
|
@@ -8,6 +8,7 @@ export declare class TreeGridEditable extends TreeGrid implements ITreeGridEdita
|
|
|
8
8
|
* Editable columns
|
|
9
9
|
*/
|
|
10
10
|
columns: GridColumnEditable[];
|
|
11
|
+
currentColumn: GridColumnEditable;
|
|
11
12
|
/**
|
|
12
13
|
* Editing rows
|
|
13
14
|
*/
|
|
@@ -35,6 +36,8 @@ export declare class TreeGridEditable extends TreeGrid implements ITreeGridEdita
|
|
|
35
36
|
*/
|
|
36
37
|
doubleClickEdit: boolean;
|
|
37
38
|
protected cancelEditedRowsKeyMapping: any;
|
|
39
|
+
protected viewEnterEdit: ((rowKey: string, columnName: string) => void) | null;
|
|
40
|
+
setViewEnterEdit(viewEnterEdit: (rowKey: string, columnName: string) => void): void;
|
|
38
41
|
constructor(props: ITreeGridEditable);
|
|
39
42
|
onMounted(element: any): void;
|
|
40
43
|
onBeforeDestroy(): void;
|
|
@@ -189,4 +192,8 @@ export declare class TreeGridEditable extends TreeGrid implements ITreeGridEdita
|
|
|
189
192
|
private changeCell;
|
|
190
193
|
callCanEditRow(row: IDictionary<any>): boolean;
|
|
191
194
|
changeData(data?: IDictionary<any>[]): void;
|
|
195
|
+
/**
|
|
196
|
+
* Makes the cell enter edit mode
|
|
197
|
+
*/
|
|
198
|
+
enterEdit(rowKey: string, columnName: string): void;
|
|
192
199
|
}
|
|
@@ -84,14 +84,7 @@ export declare class TreeGrid extends Grid implements ITreeGrid {
|
|
|
84
84
|
* @param collapse Should collapse
|
|
85
85
|
*/
|
|
86
86
|
navigateToggle(collapse: boolean): void;
|
|
87
|
-
|
|
88
|
-
* Navigate upwards
|
|
89
|
-
*/
|
|
90
|
-
navigateUp(): void;
|
|
91
|
-
/**
|
|
92
|
-
* Navigate downwards
|
|
93
|
-
*/
|
|
94
|
-
navigateDown(): void;
|
|
87
|
+
navigateDatasource(up: boolean): void;
|
|
95
88
|
private removeDuplicates;
|
|
96
89
|
/**
|
|
97
90
|
* Select/deselect rows
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { IDictionary } from '@zeedhi/core';
|
|
2
|
+
declare type GroupHeader = {
|
|
3
|
+
group: boolean;
|
|
4
|
+
groupRow: IDictionary;
|
|
5
|
+
groupColumnName: string;
|
|
6
|
+
groupHeader: boolean;
|
|
7
|
+
groupIndex: number;
|
|
8
|
+
groupLabel: string;
|
|
9
|
+
groupValue: number | string;
|
|
10
|
+
groupOpened: boolean;
|
|
11
|
+
groupHeaders: GroupHeader[];
|
|
12
|
+
children: IDictionary[];
|
|
13
|
+
};
|
|
14
|
+
declare type GroupFooter = {
|
|
15
|
+
groupFooter: boolean;
|
|
16
|
+
groupIndex: number;
|
|
17
|
+
groupHeaders: GroupHeader[];
|
|
18
|
+
groupLabel: string;
|
|
19
|
+
groupValue: number | string;
|
|
20
|
+
groupSummary?: boolean;
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
};
|
|
23
|
+
declare type DataItem = IDictionary & {
|
|
24
|
+
groupHeaders?: GroupHeader[];
|
|
25
|
+
};
|
|
26
|
+
export declare type InputDataEntry = GroupHeader | DataItem | GroupFooter;
|
|
27
|
+
declare type OutputGroupData = {
|
|
28
|
+
__group: boolean;
|
|
29
|
+
__groupHeader?: boolean;
|
|
30
|
+
__groupFooter?: boolean;
|
|
31
|
+
__groupIndex: number;
|
|
32
|
+
__groupLabel: string;
|
|
33
|
+
__groupValue: string;
|
|
34
|
+
__groupOpened?: boolean;
|
|
35
|
+
__groupSummary?: boolean;
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
};
|
|
38
|
+
export declare type OutputDataEntry = OutputGroupData | IDictionary;
|
|
39
|
+
/**
|
|
40
|
+
* Class used to format grouped data into the ZhReports format
|
|
41
|
+
*/
|
|
42
|
+
export declare class GroupedPDFFormatter {
|
|
43
|
+
format(data: InputDataEntry[]): OutputDataEntry[];
|
|
44
|
+
isGroupHeader(entry: InputDataEntry): entry is GroupHeader;
|
|
45
|
+
isGroupFooter(entry: InputDataEntry): entry is GroupFooter;
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './grouped-pdf-formatter';
|
|
@@ -11,5 +11,5 @@ export declare class Report implements IReport {
|
|
|
11
11
|
private getData;
|
|
12
12
|
private getReportType;
|
|
13
13
|
getReport(type: string, portrait?: boolean, rowObj?: any, beforeReportEvent?: IBeforeReportEvent): Promise<string>;
|
|
14
|
-
private
|
|
14
|
+
private filterColumns;
|
|
15
15
|
}
|