@zeedhi/common 1.98.0 → 1.98.1
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 +34 -1
- package/dist/zd-common.umd.js +34 -1
- package/package.json +2 -2
- package/types/components/zd-grid/grid-editable.d.ts +1 -0
- package/types/components/zd-grid/grid.d.ts +1 -0
- package/types/components/zd-svg-map/interfaces.d.ts +7 -1
- package/types/components/zd-svg-map/svg-map.d.ts +14 -1
- package/types/components/zd-tree-grid/tree-grid-editable.d.ts +1 -0
- package/types/services/zd-json-cache/json-cache-service.d.ts +12 -0
package/dist/zd-common.esm.js
CHANGED
|
@@ -6487,6 +6487,9 @@ class Grid extends Iterable {
|
|
|
6487
6487
|
}
|
|
6488
6488
|
return undefined;
|
|
6489
6489
|
}
|
|
6490
|
+
getColumn(name) {
|
|
6491
|
+
return super.getColumn(name);
|
|
6492
|
+
}
|
|
6490
6493
|
}
|
|
6491
6494
|
|
|
6492
6495
|
/**
|
|
@@ -7114,6 +7117,9 @@ class GridEditable extends Grid {
|
|
|
7114
7117
|
}
|
|
7115
7118
|
this.viewEnterEdit(rowKey, columnName);
|
|
7116
7119
|
}
|
|
7120
|
+
getColumn(name) {
|
|
7121
|
+
return super.getColumn(name);
|
|
7122
|
+
}
|
|
7117
7123
|
}
|
|
7118
7124
|
|
|
7119
7125
|
/**
|
|
@@ -11822,7 +11828,9 @@ class SelectMultiple extends Select {
|
|
|
11822
11828
|
return this.checkboxAllValue;
|
|
11823
11829
|
}
|
|
11824
11830
|
set checkboxAll(value) {
|
|
11825
|
-
this.
|
|
11831
|
+
if (this.showCheckboxAll) {
|
|
11832
|
+
this.disabled = value;
|
|
11833
|
+
}
|
|
11826
11834
|
this.checkboxAllValue = value;
|
|
11827
11835
|
}
|
|
11828
11836
|
/**
|
|
@@ -12903,6 +12911,8 @@ class SvgMap extends ComponentRender {
|
|
|
12903
12911
|
* SVG file content
|
|
12904
12912
|
*/
|
|
12905
12913
|
this.svgContent = '';
|
|
12914
|
+
this.loading = false;
|
|
12915
|
+
this.keyColumn = 'id';
|
|
12906
12916
|
/**
|
|
12907
12917
|
* Map areas
|
|
12908
12918
|
* @private
|
|
@@ -12918,6 +12928,8 @@ class SvgMap extends ComponentRender {
|
|
|
12918
12928
|
this.src = this.getInitValue('src', props.src, this.src);
|
|
12919
12929
|
this.height = this.getInitValue('height', props.height, this.height);
|
|
12920
12930
|
this.width = this.getInitValue('width', props.width, this.width);
|
|
12931
|
+
this.tooltipData = this.getInitValue('tooltipData', props.tooltipData, this.tooltipData);
|
|
12932
|
+
this.keyColumn = this.getInitValue('keyColumn', props.keyColumn, this.keyColumn);
|
|
12921
12933
|
this.createAccessors();
|
|
12922
12934
|
}
|
|
12923
12935
|
/**
|
|
@@ -12957,22 +12969,40 @@ class SvgMap extends ComponentRender {
|
|
|
12957
12969
|
*/
|
|
12958
12970
|
getSVG() {
|
|
12959
12971
|
if (this.srcValue) {
|
|
12972
|
+
this.loading = true;
|
|
12960
12973
|
Http.get(this.srcValue, { baseURL: '' }).then((response) => {
|
|
12961
12974
|
this.svgContent = response.data;
|
|
12962
12975
|
this.updateSVGContainer();
|
|
12976
|
+
this.loading = false;
|
|
12963
12977
|
});
|
|
12964
12978
|
}
|
|
12965
12979
|
}
|
|
12980
|
+
/**
|
|
12981
|
+
* setViewBeforeUpdate
|
|
12982
|
+
*/
|
|
12983
|
+
setViewBeforeUpdate(beforeUpdate) {
|
|
12984
|
+
this.viewBeforeUpdate = beforeUpdate;
|
|
12985
|
+
}
|
|
12986
|
+
/**
|
|
12987
|
+
* setViewUpdate
|
|
12988
|
+
*/
|
|
12989
|
+
setViewUpdate(update) {
|
|
12990
|
+
this.viewUpdate = update;
|
|
12991
|
+
}
|
|
12966
12992
|
/**
|
|
12967
12993
|
* Update the SVG container
|
|
12968
12994
|
*/
|
|
12969
12995
|
updateSVGContainer() {
|
|
12970
12996
|
if (this.svgContainer && this.svgContent) {
|
|
12971
12997
|
if (this.svgContent.indexOf('<svg') >= 0 && this.svgContent.indexOf('</svg>') >= 0) {
|
|
12998
|
+
if (this.viewBeforeUpdate)
|
|
12999
|
+
this.viewBeforeUpdate();
|
|
12972
13000
|
this.svgContainer.innerHTML = this.svgContent;
|
|
12973
13001
|
const svgTag = this.svgContainer.getElementsByTagName('svg')[0];
|
|
12974
13002
|
this.mapAreas = Array.from(svgTag.children);
|
|
12975
13003
|
this.updateSelectedArea();
|
|
13004
|
+
if (this.viewUpdate)
|
|
13005
|
+
this.viewUpdate();
|
|
12976
13006
|
}
|
|
12977
13007
|
else {
|
|
12978
13008
|
throw new Error('Must be a valid svg file');
|
|
@@ -15022,6 +15052,9 @@ class TreeGridEditable extends TreeGrid {
|
|
|
15022
15052
|
}
|
|
15023
15053
|
this.viewEnterEdit(rowKey, columnName);
|
|
15024
15054
|
}
|
|
15055
|
+
getColumn(name) {
|
|
15056
|
+
return super.getColumn(name);
|
|
15057
|
+
}
|
|
15025
15058
|
}
|
|
15026
15059
|
|
|
15027
15060
|
const AutoNumeric = require('@zeedhi/autonumeric/dist/autoNumeric');
|
package/dist/zd-common.umd.js
CHANGED
|
@@ -6494,6 +6494,9 @@
|
|
|
6494
6494
|
}
|
|
6495
6495
|
return undefined;
|
|
6496
6496
|
}
|
|
6497
|
+
getColumn(name) {
|
|
6498
|
+
return super.getColumn(name);
|
|
6499
|
+
}
|
|
6497
6500
|
}
|
|
6498
6501
|
|
|
6499
6502
|
/**
|
|
@@ -7121,6 +7124,9 @@
|
|
|
7121
7124
|
}
|
|
7122
7125
|
this.viewEnterEdit(rowKey, columnName);
|
|
7123
7126
|
}
|
|
7127
|
+
getColumn(name) {
|
|
7128
|
+
return super.getColumn(name);
|
|
7129
|
+
}
|
|
7124
7130
|
}
|
|
7125
7131
|
|
|
7126
7132
|
/**
|
|
@@ -11829,7 +11835,9 @@
|
|
|
11829
11835
|
return this.checkboxAllValue;
|
|
11830
11836
|
}
|
|
11831
11837
|
set checkboxAll(value) {
|
|
11832
|
-
this.
|
|
11838
|
+
if (this.showCheckboxAll) {
|
|
11839
|
+
this.disabled = value;
|
|
11840
|
+
}
|
|
11833
11841
|
this.checkboxAllValue = value;
|
|
11834
11842
|
}
|
|
11835
11843
|
/**
|
|
@@ -12910,6 +12918,8 @@
|
|
|
12910
12918
|
* SVG file content
|
|
12911
12919
|
*/
|
|
12912
12920
|
this.svgContent = '';
|
|
12921
|
+
this.loading = false;
|
|
12922
|
+
this.keyColumn = 'id';
|
|
12913
12923
|
/**
|
|
12914
12924
|
* Map areas
|
|
12915
12925
|
* @private
|
|
@@ -12925,6 +12935,8 @@
|
|
|
12925
12935
|
this.src = this.getInitValue('src', props.src, this.src);
|
|
12926
12936
|
this.height = this.getInitValue('height', props.height, this.height);
|
|
12927
12937
|
this.width = this.getInitValue('width', props.width, this.width);
|
|
12938
|
+
this.tooltipData = this.getInitValue('tooltipData', props.tooltipData, this.tooltipData);
|
|
12939
|
+
this.keyColumn = this.getInitValue('keyColumn', props.keyColumn, this.keyColumn);
|
|
12928
12940
|
this.createAccessors();
|
|
12929
12941
|
}
|
|
12930
12942
|
/**
|
|
@@ -12964,22 +12976,40 @@
|
|
|
12964
12976
|
*/
|
|
12965
12977
|
getSVG() {
|
|
12966
12978
|
if (this.srcValue) {
|
|
12979
|
+
this.loading = true;
|
|
12967
12980
|
core.Http.get(this.srcValue, { baseURL: '' }).then((response) => {
|
|
12968
12981
|
this.svgContent = response.data;
|
|
12969
12982
|
this.updateSVGContainer();
|
|
12983
|
+
this.loading = false;
|
|
12970
12984
|
});
|
|
12971
12985
|
}
|
|
12972
12986
|
}
|
|
12987
|
+
/**
|
|
12988
|
+
* setViewBeforeUpdate
|
|
12989
|
+
*/
|
|
12990
|
+
setViewBeforeUpdate(beforeUpdate) {
|
|
12991
|
+
this.viewBeforeUpdate = beforeUpdate;
|
|
12992
|
+
}
|
|
12993
|
+
/**
|
|
12994
|
+
* setViewUpdate
|
|
12995
|
+
*/
|
|
12996
|
+
setViewUpdate(update) {
|
|
12997
|
+
this.viewUpdate = update;
|
|
12998
|
+
}
|
|
12973
12999
|
/**
|
|
12974
13000
|
* Update the SVG container
|
|
12975
13001
|
*/
|
|
12976
13002
|
updateSVGContainer() {
|
|
12977
13003
|
if (this.svgContainer && this.svgContent) {
|
|
12978
13004
|
if (this.svgContent.indexOf('<svg') >= 0 && this.svgContent.indexOf('</svg>') >= 0) {
|
|
13005
|
+
if (this.viewBeforeUpdate)
|
|
13006
|
+
this.viewBeforeUpdate();
|
|
12979
13007
|
this.svgContainer.innerHTML = this.svgContent;
|
|
12980
13008
|
const svgTag = this.svgContainer.getElementsByTagName('svg')[0];
|
|
12981
13009
|
this.mapAreas = Array.from(svgTag.children);
|
|
12982
13010
|
this.updateSelectedArea();
|
|
13011
|
+
if (this.viewUpdate)
|
|
13012
|
+
this.viewUpdate();
|
|
12983
13013
|
}
|
|
12984
13014
|
else {
|
|
12985
13015
|
throw new Error('Must be a valid svg file');
|
|
@@ -15029,6 +15059,9 @@
|
|
|
15029
15059
|
}
|
|
15030
15060
|
this.viewEnterEdit(rowKey, columnName);
|
|
15031
15061
|
}
|
|
15062
|
+
getColumn(name) {
|
|
15063
|
+
return super.getColumn(name);
|
|
15064
|
+
}
|
|
15032
15065
|
}
|
|
15033
15066
|
|
|
15034
15067
|
const AutoNumeric = require('@zeedhi/autonumeric/dist/autoNumeric');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeedhi/common",
|
|
3
|
-
"version": "1.98.
|
|
3
|
+
"version": "1.98.1",
|
|
4
4
|
"description": "Zeedhi Common",
|
|
5
5
|
"author": "Zeedhi <zeedhi@teknisa.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"lodash.times": "4.3.*",
|
|
44
44
|
"mockdate": "3.0.*"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "97cae293ce620f40b3320f15af1384bf4b6fa4d3"
|
|
47
47
|
}
|
|
@@ -230,4 +230,5 @@ export declare class Grid extends Iterable implements IGrid {
|
|
|
230
230
|
callDisableSelection(row: IDictionary<any>): boolean;
|
|
231
231
|
getRowStyleConditions(row: IDictionary<any>): IDictionary<any>;
|
|
232
232
|
private setGridRowsInEvents;
|
|
233
|
+
getColumn(name: string): GridColumn;
|
|
233
234
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IEventParam } from '@zeedhi/core';
|
|
1
|
+
import { IDictionary, IEventParam } from '@zeedhi/core';
|
|
2
2
|
import { IComponentRender, IComponentEvents, EventDef } from '../zd-component/interfaces';
|
|
3
3
|
import { SvgMap } from './svg-map';
|
|
4
4
|
export interface ISvgMapEventParam extends IEventParam<SvgMap> {
|
|
@@ -7,6 +7,10 @@ export interface ISvgMapEventParam extends IEventParam<SvgMap> {
|
|
|
7
7
|
export interface ISvgMapEvents<T = ISvgMapEventParam | IEventParam<any>> extends IComponentEvents<T> {
|
|
8
8
|
areaClick?: EventDef<T>;
|
|
9
9
|
}
|
|
10
|
+
export declare type TooltipData = {
|
|
11
|
+
labels: IDictionary;
|
|
12
|
+
data: IDictionary[];
|
|
13
|
+
};
|
|
10
14
|
export interface ISvgMap extends IComponentRender {
|
|
11
15
|
areaColor?: string;
|
|
12
16
|
areaHoverColor?: string;
|
|
@@ -17,4 +21,6 @@ export interface ISvgMap extends IComponentRender {
|
|
|
17
21
|
selectedArea?: string | string[];
|
|
18
22
|
src?: string;
|
|
19
23
|
width?: string | number;
|
|
24
|
+
tooltipData?: TooltipData;
|
|
25
|
+
keyColumn?: string;
|
|
20
26
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISvgMap, ISvgMapEvents } from './interfaces';
|
|
1
|
+
import { ISvgMap, ISvgMapEvents, TooltipData } from './interfaces';
|
|
2
2
|
import { ComponentRender } from '../zd-component/component-render';
|
|
3
3
|
/**
|
|
4
4
|
* Base class for SvgMap component.
|
|
@@ -42,6 +42,9 @@ export declare class SvgMap extends ComponentRender implements ISvgMap {
|
|
|
42
42
|
* SVG container
|
|
43
43
|
*/
|
|
44
44
|
svgContainer: any;
|
|
45
|
+
tooltipData?: TooltipData | undefined;
|
|
46
|
+
loading?: boolean;
|
|
47
|
+
keyColumn: string;
|
|
45
48
|
/**
|
|
46
49
|
* Map areas
|
|
47
50
|
* @private
|
|
@@ -49,6 +52,8 @@ export declare class SvgMap extends ComponentRender implements ISvgMap {
|
|
|
49
52
|
private mapAreas;
|
|
50
53
|
private srcValue;
|
|
51
54
|
private selectedAreaValue;
|
|
55
|
+
protected viewBeforeUpdate?: Function;
|
|
56
|
+
protected viewUpdate?: Function;
|
|
52
57
|
/**
|
|
53
58
|
* Create a new SVG.
|
|
54
59
|
* @param props SVG properties
|
|
@@ -70,6 +75,14 @@ export declare class SvgMap extends ComponentRender implements ISvgMap {
|
|
|
70
75
|
* @private
|
|
71
76
|
*/
|
|
72
77
|
private getSVG;
|
|
78
|
+
/**
|
|
79
|
+
* setViewBeforeUpdate
|
|
80
|
+
*/
|
|
81
|
+
setViewBeforeUpdate(beforeUpdate: Function): void;
|
|
82
|
+
/**
|
|
83
|
+
* setViewUpdate
|
|
84
|
+
*/
|
|
85
|
+
setViewUpdate(update: Function): void;
|
|
73
86
|
/**
|
|
74
87
|
* Update the SVG container
|
|
75
88
|
*/
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface IJSONObject {
|
|
2
|
+
path: string;
|
|
3
|
+
}
|
|
4
|
+
export declare class JsonCacheService {
|
|
5
|
+
/**
|
|
6
|
+
* jsons collection
|
|
7
|
+
*/
|
|
8
|
+
static jsonCollection: IJSONObject[];
|
|
9
|
+
static saveJSONCache(jsonCollection: IJSONObject[]): Promise<void>;
|
|
10
|
+
static getJSONCache(path: string): any;
|
|
11
|
+
static clearJSONCache(jsonCollection: IJSONObject[]): void;
|
|
12
|
+
}
|