@zeedhi/common 1.45.1 → 1.48.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/zd-common.esm.js +219 -63
- package/dist/zd-common.umd.js +218 -62
- package/package.json +2 -2
- package/types/components/zd-component/component.d.ts +5 -1
- package/types/components/zd-component/interfaces.d.ts +5 -0
- package/types/components/zd-dashboard/dashboard.d.ts +3 -0
- package/types/components/zd-dashboard/interfaces.d.ts +1 -0
- package/types/components/zd-date/date-range.d.ts +12 -0
- package/types/components/zd-date/date.d.ts +12 -0
- package/types/components/zd-date/interfaces.d.ts +2 -0
- package/types/components/zd-file-input/file-input.d.ts +1 -1
- package/types/components/zd-form/form.d.ts +2 -8
- package/types/components/zd-frame/frame.d.ts +2 -0
- package/types/components/zd-frame/interfaces.d.ts +1 -0
- package/types/components/zd-grid/grid-column.d.ts +5 -1
- package/types/components/zd-grid/grid.d.ts +4 -1
- package/types/components/zd-grid/interfaces.d.ts +3 -0
- package/types/components/zd-input/input.d.ts +7 -4
- package/types/components/zd-range-slider/range-slider.d.ts +3 -0
- package/types/components/zd-select/interfaces.d.ts +1 -0
- package/types/components/zd-select/select.d.ts +4 -0
- package/types/components/zd-tabs/interfaces.d.ts +1 -0
- package/types/components/zd-tabs/tab.d.ts +4 -0
- package/types/components/zd-tabs/tabs.d.ts +3 -1
- package/types/components/zd-tree/interfaces.d.ts +1 -1
- package/types/components/zd-tree/tree.d.ts +5 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeedhi/common",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.48.0",
|
|
4
4
|
"description": "Zeedhi Common",
|
|
5
5
|
"author": "Zeedhi <zeedhi@teknisa.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"lodash.times": "^4.3.2",
|
|
38
38
|
"mockdate": "^3.0.2"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "8f588b928efe593c47681477f44ac419b28fbabc"
|
|
41
41
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IKeyMap } from '@zeedhi/core';
|
|
2
|
-
import { IComponent, IComponentEvents } from './interfaces';
|
|
2
|
+
import { IComponent, IComponentDirectives, IComponentEvents } from './interfaces';
|
|
3
3
|
/**
|
|
4
4
|
* Base class for all Zeedhi components.
|
|
5
5
|
*/
|
|
@@ -22,6 +22,10 @@ export declare class Component implements IComponent {
|
|
|
22
22
|
* Set css in line with cssStyle.
|
|
23
23
|
*/
|
|
24
24
|
cssStyle: string | object;
|
|
25
|
+
/**
|
|
26
|
+
* Directives registered to the component.
|
|
27
|
+
*/
|
|
28
|
+
directives: IComponentDirectives;
|
|
25
29
|
/**
|
|
26
30
|
* Events registered to the component.
|
|
27
31
|
*/
|
|
@@ -12,6 +12,7 @@ export interface IComponent {
|
|
|
12
12
|
cssClass?: string;
|
|
13
13
|
cssStyle?: string | object;
|
|
14
14
|
events?: IComponentEvents;
|
|
15
|
+
directives?: IComponentDirectives;
|
|
15
16
|
isVisible?: boolean | string;
|
|
16
17
|
dark?: boolean;
|
|
17
18
|
light?: boolean;
|
|
@@ -34,3 +35,7 @@ export interface IComponentEvents<T = IEventParam<any>> extends IEvents<T> {
|
|
|
34
35
|
onBeforeDestroy?: IEvent<T> | string;
|
|
35
36
|
onDestroyed?: IEvent<T> | string;
|
|
36
37
|
}
|
|
38
|
+
export interface IComponentDirectives {
|
|
39
|
+
touch?: IComponentEvents;
|
|
40
|
+
[key: string]: IComponentEvents | undefined;
|
|
41
|
+
}
|
|
@@ -14,6 +14,7 @@ export declare class Dashboard extends ComponentRender implements IDashboard {
|
|
|
14
14
|
addModal?: Modal;
|
|
15
15
|
editModal?: Modal;
|
|
16
16
|
deleteCardId: string;
|
|
17
|
+
overrideNamedProps: any;
|
|
17
18
|
removePadding: boolean;
|
|
18
19
|
height: string | number;
|
|
19
20
|
heightAdjust: string | number;
|
|
@@ -41,11 +42,13 @@ export declare class Dashboard extends ComponentRender implements IDashboard {
|
|
|
41
42
|
component?: undefined;
|
|
42
43
|
path?: undefined;
|
|
43
44
|
local?: undefined;
|
|
45
|
+
overrideNamedProps?: undefined;
|
|
44
46
|
} | {
|
|
45
47
|
name: string;
|
|
46
48
|
component: string;
|
|
47
49
|
path: string;
|
|
48
50
|
local: boolean;
|
|
51
|
+
overrideNamedProps: any;
|
|
49
52
|
};
|
|
50
53
|
getFooterRightSlot(cardId: string): ({
|
|
51
54
|
name: string;
|
|
@@ -53,6 +53,14 @@ export declare class DateRange extends TextInput implements IDateRange {
|
|
|
53
53
|
* Width of the picker.
|
|
54
54
|
*/
|
|
55
55
|
width: number | string;
|
|
56
|
+
/**
|
|
57
|
+
* Helper options.
|
|
58
|
+
*/
|
|
59
|
+
helperOptions?: string[];
|
|
60
|
+
/**
|
|
61
|
+
* Helper value.
|
|
62
|
+
*/
|
|
63
|
+
helperValue?: string;
|
|
56
64
|
protected isoFormat: string;
|
|
57
65
|
protected dateError: boolean;
|
|
58
66
|
protected formatterFn: Function;
|
|
@@ -117,4 +125,8 @@ export declare class DateRange extends TextInput implements IDateRange {
|
|
|
117
125
|
* @returns true if it is simple, false otherwise
|
|
118
126
|
*/
|
|
119
127
|
protected isSimpleFormat(format: string): boolean;
|
|
128
|
+
private previousHint;
|
|
129
|
+
private previousPersistentHint;
|
|
130
|
+
updateHelperHint(): void;
|
|
131
|
+
change(event?: Event, element?: any): void;
|
|
120
132
|
}
|
|
@@ -56,6 +56,14 @@ export declare class Date extends TextInput implements IDate {
|
|
|
56
56
|
* Determines the type of the picker - date for date picker, month for month picker.
|
|
57
57
|
*/
|
|
58
58
|
pickerType: string;
|
|
59
|
+
/**
|
|
60
|
+
* Helper options.
|
|
61
|
+
*/
|
|
62
|
+
helperOptions?: string[];
|
|
63
|
+
/**
|
|
64
|
+
* Helper value.
|
|
65
|
+
*/
|
|
66
|
+
helperValue?: string;
|
|
59
67
|
/**
|
|
60
68
|
* Width of the picker.
|
|
61
69
|
*/
|
|
@@ -126,4 +134,8 @@ export declare class Date extends TextInput implements IDate {
|
|
|
126
134
|
* @returns true if it is simple, false otherwise
|
|
127
135
|
*/
|
|
128
136
|
protected isSimpleFormat(format: string): boolean;
|
|
137
|
+
private previousHint;
|
|
138
|
+
private previousPersistentHint;
|
|
139
|
+
updateHelperHint(): void;
|
|
140
|
+
change(event?: Event, element?: any): void;
|
|
129
141
|
}
|
|
@@ -66,22 +66,16 @@ export declare class Form extends ComponentRender implements IForm {
|
|
|
66
66
|
get childrenProps(): {
|
|
67
67
|
[key: string]: any;
|
|
68
68
|
children?: import("..").IComponentRender[] | undefined;
|
|
69
|
-
component: string;
|
|
70
|
-
* Applies the justify-content css property.
|
|
71
|
-
* Available options are start, center, end, space-between and space-around.
|
|
72
|
-
*/
|
|
69
|
+
component: string;
|
|
73
70
|
componentId?: number | undefined;
|
|
74
71
|
cssClass?: string | undefined;
|
|
75
72
|
cssStyle?: string | object | undefined;
|
|
76
73
|
events?: import("..").IComponentEvents<import("@zeedhi/core").IEventParam<any>> | undefined;
|
|
74
|
+
directives?: import("..").IComponentDirectives | undefined;
|
|
77
75
|
isVisible?: string | boolean | undefined;
|
|
78
76
|
dark?: boolean | undefined;
|
|
79
77
|
light?: boolean | undefined;
|
|
80
78
|
keyMap?: import("@zeedhi/core").IKeyMap<import("@zeedhi/core").IEventParam<any>> | undefined;
|
|
81
|
-
/**
|
|
82
|
-
* Applies the align-items css property.
|
|
83
|
-
* Available options are start, center, end, space-between, space-around and stretch.
|
|
84
|
-
*/
|
|
85
79
|
name: string;
|
|
86
80
|
parent?: import("..").Component | undefined;
|
|
87
81
|
}[];
|
|
@@ -8,6 +8,7 @@ export declare class Frame extends ComponentRender implements IFrame {
|
|
|
8
8
|
local: boolean;
|
|
9
9
|
metadata: Object;
|
|
10
10
|
override: Object;
|
|
11
|
+
overrideNamedProps: any;
|
|
11
12
|
path: string;
|
|
12
13
|
cache: boolean;
|
|
13
14
|
events: IFrameEvents;
|
|
@@ -23,6 +24,7 @@ export declare class Frame extends ComponentRender implements IFrame {
|
|
|
23
24
|
*/
|
|
24
25
|
constructor(props: IFrame);
|
|
25
26
|
private getMetadata;
|
|
27
|
+
overrideNamedPropsFunc(metadata: object): any;
|
|
26
28
|
reload(): Promise<void>;
|
|
27
29
|
protected notFoundError(): void;
|
|
28
30
|
private requestPage;
|
|
@@ -22,11 +22,15 @@ export declare class GridColumn extends Column implements IGridColumn {
|
|
|
22
22
|
cssClass?: string | undefined;
|
|
23
23
|
cssStyle?: string | object | undefined;
|
|
24
24
|
events?: import("..").IComponentEvents<import("@zeedhi/core").IEventParam<any>> | undefined;
|
|
25
|
+
directives?: import("..").IComponentDirectives | undefined;
|
|
25
26
|
isVisible?: string | boolean | undefined;
|
|
26
27
|
dark?: boolean | undefined;
|
|
27
28
|
light?: boolean | undefined;
|
|
28
29
|
keyMap?: import("@zeedhi/core").IKeyMap<import("@zeedhi/core").IEventParam<any>> | undefined;
|
|
29
|
-
name: string;
|
|
30
|
+
name: string; /**
|
|
31
|
+
* Creates a new Grid Column.
|
|
32
|
+
* @param props Grid column properties
|
|
33
|
+
*/
|
|
30
34
|
parent?: import("..").Component | undefined;
|
|
31
35
|
}[];
|
|
32
36
|
/**
|
|
@@ -11,6 +11,9 @@ export declare class Grid extends Iterable implements IGrid {
|
|
|
11
11
|
* Components that will be rendered on toolbar slot
|
|
12
12
|
*/
|
|
13
13
|
toolbarSlot: IComponentRender[];
|
|
14
|
+
loadingText: string;
|
|
15
|
+
noDataText: string;
|
|
16
|
+
noResultsText: string;
|
|
14
17
|
/**
|
|
15
18
|
* Components that will be rendered in no-data case
|
|
16
19
|
*/
|
|
@@ -163,5 +166,5 @@ export declare class Grid extends Iterable implements IGrid {
|
|
|
163
166
|
protected navigatePageDown(): void;
|
|
164
167
|
deleteRows(): Promise<any[]>;
|
|
165
168
|
getActionComponent(actionComponent: IComponent, column: GridColumn, row: IDictionary, parentPath?: string): IComponent;
|
|
166
|
-
|
|
169
|
+
protected changeDefaultSlotNames(slot: IComponentRender[]): IComponentRender[];
|
|
167
170
|
}
|
|
@@ -37,6 +37,9 @@ export interface IGrid extends IIterable {
|
|
|
37
37
|
toolbarSlot?: IComponentRender[];
|
|
38
38
|
dragColumns?: boolean;
|
|
39
39
|
resizeColumns?: boolean;
|
|
40
|
+
loadingText?: string;
|
|
41
|
+
noDataText?: string;
|
|
42
|
+
noResultsText?: string;
|
|
40
43
|
}
|
|
41
44
|
export interface IGridColumn extends IColumn {
|
|
42
45
|
children?: IChildrenActionColumn[];
|
|
@@ -98,10 +98,6 @@ export declare class Input extends ComponentRender implements IInput {
|
|
|
98
98
|
* Used to watch a value from store.
|
|
99
99
|
*/
|
|
100
100
|
storePath: string;
|
|
101
|
-
/**
|
|
102
|
-
* Internal input value.
|
|
103
|
-
*/
|
|
104
|
-
value: any;
|
|
105
101
|
/**
|
|
106
102
|
* Input validations.
|
|
107
103
|
*/
|
|
@@ -120,6 +116,8 @@ export declare class Input extends ComponentRender implements IInput {
|
|
|
120
116
|
private parsedValidations;
|
|
121
117
|
protected formatterFn: Function;
|
|
122
118
|
protected parserFn: Function;
|
|
119
|
+
protected internalDisplayValue: string;
|
|
120
|
+
protected internalValue: any;
|
|
123
121
|
/**
|
|
124
122
|
* Creates a new Input.
|
|
125
123
|
* @param props Input properties
|
|
@@ -166,6 +164,11 @@ export declare class Input extends ComponentRender implements IInput {
|
|
|
166
164
|
* Updates input rules.
|
|
167
165
|
*/
|
|
168
166
|
private updateRules;
|
|
167
|
+
/**
|
|
168
|
+
* Input value.
|
|
169
|
+
*/
|
|
170
|
+
get value(): any;
|
|
171
|
+
set value(value: any);
|
|
169
172
|
/**
|
|
170
173
|
* Input displayed value.
|
|
171
174
|
*/
|
|
@@ -58,9 +58,12 @@ export declare class RangeSlider extends Input implements IRangeSlider {
|
|
|
58
58
|
* Defines the range-slider ticks
|
|
59
59
|
*/
|
|
60
60
|
ticks: IRangeSliderTicks;
|
|
61
|
+
private rangeSliderValue;
|
|
61
62
|
/**
|
|
62
63
|
* Create a new Range Slider
|
|
63
64
|
* @param props Range Slider properties
|
|
64
65
|
*/
|
|
65
66
|
constructor(props: IRangeSlider);
|
|
67
|
+
get value(): any;
|
|
68
|
+
set value(value: any);
|
|
66
69
|
}
|
|
@@ -42,6 +42,10 @@ export declare class Select extends TextInput implements ISelect {
|
|
|
42
42
|
* Maximum height of select menu
|
|
43
43
|
*/
|
|
44
44
|
menuMaxHeight: string | number;
|
|
45
|
+
/**
|
|
46
|
+
* Maximum width of select menu
|
|
47
|
+
*/
|
|
48
|
+
menuMaxWidth: string | number;
|
|
45
49
|
/**
|
|
46
50
|
* Input select value
|
|
47
51
|
*/
|
|
@@ -13,6 +13,7 @@ export interface ITabsEvents<T = ITabsEventParam | ITabsBeforeChangeEventParam |
|
|
|
13
13
|
export interface ITab extends IComponent {
|
|
14
14
|
tabTitle: string;
|
|
15
15
|
disabled?: boolean;
|
|
16
|
+
flex?: boolean;
|
|
16
17
|
}
|
|
17
18
|
export interface ITabs extends IComponentRender {
|
|
18
19
|
activeTab?: number;
|
|
@@ -6,6 +6,10 @@ import { Component } from '../zd-component/component';
|
|
|
6
6
|
export declare class Tab extends Component implements ITab {
|
|
7
7
|
disabled: boolean;
|
|
8
8
|
tabTitle: string;
|
|
9
|
+
/**
|
|
10
|
+
* Defines if is flex mode.
|
|
11
|
+
*/
|
|
12
|
+
flex?: boolean;
|
|
9
13
|
/**
|
|
10
14
|
* Create a new Tab.
|
|
11
15
|
* @param props Tab properties
|
|
@@ -5,7 +5,7 @@ import { ComponentRender } from '../zd-component/component-render';
|
|
|
5
5
|
* Base class for Tabs component.
|
|
6
6
|
*/
|
|
7
7
|
export declare class Tabs extends ComponentRender implements ITabs {
|
|
8
|
-
|
|
8
|
+
activeTabValue: number;
|
|
9
9
|
events: ITabsEvents;
|
|
10
10
|
tabs: Tab[];
|
|
11
11
|
/**
|
|
@@ -17,6 +17,8 @@ export declare class Tabs extends ComponentRender implements ITabs {
|
|
|
17
17
|
* @param props Tabs properties
|
|
18
18
|
*/
|
|
19
19
|
constructor(props: ITabs);
|
|
20
|
+
get activeTab(): number;
|
|
21
|
+
set activeTab(index: number);
|
|
20
22
|
private getTabs;
|
|
21
23
|
getTab(name: string): Tab;
|
|
22
24
|
/**
|
|
@@ -9,7 +9,6 @@ export interface ITreeNodeModel<T> {
|
|
|
9
9
|
isSelected?: boolean;
|
|
10
10
|
isDraggable?: boolean;
|
|
11
11
|
isSelectable?: boolean;
|
|
12
|
-
isChecked?: boolean;
|
|
13
12
|
data?: T;
|
|
14
13
|
}
|
|
15
14
|
export interface ITreeNode<T> extends ITreeNodeModel<T> {
|
|
@@ -62,6 +61,7 @@ export interface ITree extends IComponentRender {
|
|
|
62
61
|
parentField?: string;
|
|
63
62
|
titleField?: string;
|
|
64
63
|
dataField?: string;
|
|
64
|
+
checkedField?: string;
|
|
65
65
|
openLevelOnLoad?: number | boolean;
|
|
66
66
|
checkbox?: boolean;
|
|
67
67
|
}
|
|
@@ -37,6 +37,8 @@ export declare class Tree extends ComponentRender implements ITree {
|
|
|
37
37
|
titleField: string;
|
|
38
38
|
/** Datasource data field */
|
|
39
39
|
dataField: string;
|
|
40
|
+
/** Datasource checked field */
|
|
41
|
+
checkedField: string;
|
|
40
42
|
/**
|
|
41
43
|
* Defines if the tree will be opened or not (true/false) or if it should open only until a specific level
|
|
42
44
|
*/
|
|
@@ -66,11 +68,11 @@ export declare class Tree extends ComponentRender implements ITree {
|
|
|
66
68
|
/**
|
|
67
69
|
* Initialize all the properties of the declared nodes (reactivity)
|
|
68
70
|
*/
|
|
69
|
-
protected initNodes(nodes: ITreeNodeModel<IDictionary>[]): ITreeNodeModel<IDictionary>[];
|
|
71
|
+
protected initNodes(nodes: ITreeNodeModel<IDictionary>[], override?: IDictionary): ITreeNodeModel<IDictionary>[];
|
|
70
72
|
/** Nodes */
|
|
71
73
|
get nodes(): ITreeNodeModel<IDictionary>[];
|
|
72
74
|
set nodes(value: ITreeNodeModel<IDictionary>[]);
|
|
73
|
-
getCheckedNodes():
|
|
75
|
+
getCheckedNodes(): ITreeNode<IDictionary<any>>[];
|
|
74
76
|
/** Returns the selected nodes */
|
|
75
77
|
get selectedNodes(): ITreeNode<IDictionary>[];
|
|
76
78
|
private createDataStructure;
|
|
@@ -85,7 +87,6 @@ export declare class Tree extends ComponentRender implements ITree {
|
|
|
85
87
|
removeSelected(): void;
|
|
86
88
|
/** Update selected node */
|
|
87
89
|
updateNodeData(node: ITreeNode<IDictionary>, value: IDictionary): void;
|
|
88
|
-
private removeDraggable;
|
|
89
90
|
setTree(tree: any): void;
|
|
90
91
|
/**
|
|
91
92
|
* Return plain conditions object
|
|
@@ -110,6 +111,6 @@ export declare class Tree extends ComponentRender implements ITree {
|
|
|
110
111
|
nodeCheck(node: ITreeNode<IDictionary>, event?: Event, element?: HTMLElement): void;
|
|
111
112
|
clearSelection(nodes?: ITreeNodeModel<IDictionary<any>>[]): void;
|
|
112
113
|
getNode(path: number[]): ITreeNodeModel<IDictionary<any>> | undefined;
|
|
113
|
-
getParentNode(node: ITreeNode<IDictionary>):
|
|
114
|
+
getParentNode(node: ITreeNode<IDictionary>): any;
|
|
114
115
|
private searchPath;
|
|
115
116
|
}
|