@refinitiv-ui/efx-grid 6.0.45 → 6.0.46
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/grid/index.js +1 -1
- package/lib/tr-grid-printer/es6/CellWriter.d.ts +49 -0
- package/lib/tr-grid-printer/es6/CellWriter.js +226 -0
- package/lib/tr-grid-printer/es6/ColumnWriter.d.ts +12 -0
- package/lib/tr-grid-printer/es6/ColumnWriter.js +21 -0
- package/lib/tr-grid-printer/es6/GridPrinter.d.ts +32 -0
- package/lib/tr-grid-printer/es6/GridPrinter.js +774 -0
- package/lib/tr-grid-printer/es6/PrintTrait.d.ts +38 -0
- package/lib/tr-grid-printer/es6/PrintTrait.js +481 -0
- package/lib/tr-grid-printer/es6/SectionWriter.d.ts +54 -0
- package/lib/tr-grid-printer/es6/SectionWriter.js +213 -0
- package/lib/tr-grid-printer/es6/index.d.ts +1 -0
- package/lib/tr-grid-printer/es6/index.js +1 -0
- package/lib/types/es6/RowFiltering.d.ts +5 -0
- package/package.json +1 -1
package/lib/grid/index.js
CHANGED
@@ -0,0 +1,49 @@
|
|
1
|
+
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
2
|
+
import { ElementWrapper } from "../../tr-grid-util/es6/ElementWrapper.js"; // ElementWrapper doesnot have setStyle and etc.
|
3
|
+
import { Dom } from "../../tr-grid-util/es6/Dom.js";
|
4
|
+
|
5
|
+
declare class CellWriter extends ElementWrapper {
|
6
|
+
|
7
|
+
constructor();
|
8
|
+
|
9
|
+
public getContent(): Node|null|null;
|
10
|
+
|
11
|
+
public setContent(content: any, opt_tooltip?: boolean): Element|null;
|
12
|
+
|
13
|
+
public setTooltip(str: string): void;
|
14
|
+
|
15
|
+
public setTextContent(str: string): void;
|
16
|
+
|
17
|
+
public addContent(n: any): Element|null;
|
18
|
+
|
19
|
+
public setStyle(str: string, val: any): void;
|
20
|
+
|
21
|
+
public removeIcon(n: any): void;
|
22
|
+
|
23
|
+
public updateIcon(elem: Element): void;
|
24
|
+
|
25
|
+
public unlisten(): void;
|
26
|
+
|
27
|
+
public listen(): void;
|
28
|
+
|
29
|
+
public setTooltip(): void;
|
30
|
+
|
31
|
+
public addClass(str: string): void;
|
32
|
+
|
33
|
+
public hasClass(str: string): void;
|
34
|
+
|
35
|
+
public removeClass(str: string): void;
|
36
|
+
|
37
|
+
public enableClass(str: string, bool: boolean): void;
|
38
|
+
|
39
|
+
public insertFloatingIcon(elem: Element, order: number): void;
|
40
|
+
|
41
|
+
public removeFloatingIcon(elemRef: string|Element, order: number): void;
|
42
|
+
|
43
|
+
public getSection(): null;
|
44
|
+
|
45
|
+
public cloak(elem: Element): void;
|
46
|
+
|
47
|
+
}
|
48
|
+
|
49
|
+
export { CellWriter };
|
@@ -0,0 +1,226 @@
|
|
1
|
+
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
2
|
+
import { ElementWrapper } from "../../tr-grid-util/es6/ElementWrapper.js"; // ElementWrapper doesnot have setStyle and etc.
|
3
|
+
import { Dom } from "../../tr-grid-util/es6/Dom.js";
|
4
|
+
|
5
|
+
/**
|
6
|
+
* @constructor
|
7
|
+
* @extends {ElementWrapper}
|
8
|
+
*/
|
9
|
+
var CellWriter = function () {
|
10
|
+
};
|
11
|
+
Ext.inherits(CellWriter, ElementWrapper);
|
12
|
+
|
13
|
+
/** @type
|
14
|
+
* @private
|
15
|
+
*/
|
16
|
+
CellWriter.prototype._flexRow = null;
|
17
|
+
/** @type
|
18
|
+
* @private
|
19
|
+
*/
|
20
|
+
CellWriter.prototype._floatingPanel = null;
|
21
|
+
/** @type
|
22
|
+
* @private
|
23
|
+
*/
|
24
|
+
CellWriter.prototype._frontPanel = null;
|
25
|
+
|
26
|
+
|
27
|
+
/** @public
|
28
|
+
* @return {Node|null} content
|
29
|
+
*/
|
30
|
+
CellWriter.prototype.getContent = function () {
|
31
|
+
return this._elem.children[0] || null;
|
32
|
+
};
|
33
|
+
/** @public
|
34
|
+
* @param {*} content
|
35
|
+
* @param {boolean=} opt_tooltip
|
36
|
+
* @return {Element}
|
37
|
+
*/
|
38
|
+
CellWriter.prototype.setContent = function (content, opt_tooltip) {
|
39
|
+
if(content == null) {
|
40
|
+
return null;
|
41
|
+
}
|
42
|
+
if(content["getElement"]) {
|
43
|
+
content = /** @type{Element} */(content["getElement"]());
|
44
|
+
} else if(content.nodeType !== 1) {
|
45
|
+
content = this._createTextContent(content);
|
46
|
+
}
|
47
|
+
Dom.removeChildren(this._elem);
|
48
|
+
this._elem.appendChild(/** @type{Node} */(content));
|
49
|
+
return /** @type{Element} */(content);
|
50
|
+
};
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Set value to title. If value is absent then a title will be removed
|
54
|
+
* @public
|
55
|
+
* @param {string} str
|
56
|
+
*/
|
57
|
+
CellWriter.prototype.setTooltip = function (str) {
|
58
|
+
if(str) {
|
59
|
+
this._elem.setAttribute("title", str);
|
60
|
+
} else {
|
61
|
+
this._elem.removeAttribute("title");
|
62
|
+
}
|
63
|
+
};
|
64
|
+
|
65
|
+
/** @public
|
66
|
+
* @param {string} str
|
67
|
+
*/
|
68
|
+
CellWriter.prototype.setTextContent = function (str) {
|
69
|
+
Dom.removeChildren(this._elem);
|
70
|
+
this._elem.appendChild(this._createTextContent(str));
|
71
|
+
};
|
72
|
+
/** @public
|
73
|
+
* @param {*} n
|
74
|
+
* @return {Element}
|
75
|
+
*/
|
76
|
+
CellWriter.prototype.addContent = function (n) {
|
77
|
+
this._elem.appendChild(/** @type{Node} */(n));
|
78
|
+
return /** @type{Element} */(n);
|
79
|
+
};
|
80
|
+
/** @private
|
81
|
+
* @param {string} str
|
82
|
+
* @return {Element}
|
83
|
+
*/
|
84
|
+
CellWriter.prototype._createTextContent = function (str) {
|
85
|
+
var div = Dom.div("text");
|
86
|
+
if(str != null) {
|
87
|
+
div.textContent = str;
|
88
|
+
this["percentText"] = str; // HACK
|
89
|
+
}
|
90
|
+
return div;
|
91
|
+
};
|
92
|
+
|
93
|
+
/** @public
|
94
|
+
* @param {string} str
|
95
|
+
* @param {*} val
|
96
|
+
*/
|
97
|
+
CellWriter.prototype.setStyle = function (str, val) {
|
98
|
+
this._elem.style[str] = val;
|
99
|
+
};
|
100
|
+
/** @public
|
101
|
+
* @param {*} n
|
102
|
+
*/
|
103
|
+
CellWriter.prototype.removeIcon = function (n) {};
|
104
|
+
/** @public
|
105
|
+
* @param {Element} elem
|
106
|
+
*/
|
107
|
+
CellWriter.prototype.updateIcon = function (elem) {
|
108
|
+
if(elem && elem.nodeType === 1) {
|
109
|
+
var fp = this._frontPanel;
|
110
|
+
if(!fp) {
|
111
|
+
this._flexRow = document.createElement("div");
|
112
|
+
this._flexRow.className = "tr-printing-flex-row";
|
113
|
+
|
114
|
+
fp = this._floatingPanel = document.createElement("div");
|
115
|
+
fp.className = "tr-printing-float-right";
|
116
|
+
this._flexRow.appendChild(fp);
|
117
|
+
var chdr = this._elem.children;
|
118
|
+
var childCount = chdr.length;
|
119
|
+
if(childCount) {
|
120
|
+
var ary = new Array(childCount);
|
121
|
+
for(var i = 0; i < childCount; ++i) {
|
122
|
+
ary[i] = chdr[i];
|
123
|
+
}
|
124
|
+
Dom.appendChild(this._flexRow, ary);
|
125
|
+
}
|
126
|
+
this._elem.appendChild(this._flexRow);
|
127
|
+
}
|
128
|
+
fp.appendChild(elem.cloneNode(true));
|
129
|
+
}
|
130
|
+
};
|
131
|
+
/** @public
|
132
|
+
*/
|
133
|
+
CellWriter.prototype.unlisten = function () {};
|
134
|
+
/** @public
|
135
|
+
*/
|
136
|
+
CellWriter.prototype.listen = function () {};
|
137
|
+
|
138
|
+
/** @public
|
139
|
+
*/
|
140
|
+
CellWriter.prototype.setTooltip = function () {};
|
141
|
+
|
142
|
+
/** @public
|
143
|
+
* @param {string} str
|
144
|
+
*/
|
145
|
+
CellWriter.prototype.addClass = function (str) {
|
146
|
+
this._elem.classList.add(str);
|
147
|
+
};
|
148
|
+
/** @public
|
149
|
+
* @param {string} str
|
150
|
+
*/
|
151
|
+
CellWriter.prototype.hasClass = function (str) {
|
152
|
+
this._elem.classList.contains(str);
|
153
|
+
};
|
154
|
+
/** @public
|
155
|
+
* @param {string} str
|
156
|
+
*/
|
157
|
+
CellWriter.prototype.removeClass = function (str) {
|
158
|
+
this._elem.classList.remove(str);
|
159
|
+
};
|
160
|
+
/** @public
|
161
|
+
* @param {string} str
|
162
|
+
* @param {boolean} bool
|
163
|
+
*/
|
164
|
+
CellWriter.prototype.enableClass = function (str, bool) {
|
165
|
+
if(bool || bool == null) {
|
166
|
+
this.addClass(str);
|
167
|
+
} else {
|
168
|
+
this.removeClass(str);
|
169
|
+
}
|
170
|
+
};
|
171
|
+
|
172
|
+
/** @public
|
173
|
+
* @param {Element} elem
|
174
|
+
* @param {number} order
|
175
|
+
*/
|
176
|
+
CellWriter.prototype.insertFloatingIcon = function (elem, order) {
|
177
|
+
if(elem && elem.nodeType === 1) {
|
178
|
+
var fp = this._floatingPanel;
|
179
|
+
if(!fp) {
|
180
|
+
this._flexRow = document.createElement("div");
|
181
|
+
this._flexRow.className = "tr-printing-flex-row";
|
182
|
+
|
183
|
+
var chdr = this._elem.children;
|
184
|
+
var childCount = chdr.length;
|
185
|
+
if(childCount) {
|
186
|
+
var ary = new Array(childCount);
|
187
|
+
for(var i = 0; i < childCount; ++i) {
|
188
|
+
ary[i] = chdr[i];
|
189
|
+
}
|
190
|
+
Dom.appendChild(this._flexRow, ary);
|
191
|
+
}
|
192
|
+
fp = this._floatingPanel = document.createElement("div");
|
193
|
+
fp.className = "tr-printing-float-right";
|
194
|
+
this._flexRow.appendChild(fp);
|
195
|
+
this._elem.appendChild(this._flexRow);
|
196
|
+
}
|
197
|
+
fp.appendChild(elem.cloneNode(true));
|
198
|
+
}
|
199
|
+
};
|
200
|
+
/** @public
|
201
|
+
* @param {string|Element} elemRef
|
202
|
+
* @param {number} order
|
203
|
+
*/
|
204
|
+
CellWriter.prototype.removeFloatingIcon = function (elemRef, order) {};
|
205
|
+
/** @public
|
206
|
+
* @return {null}
|
207
|
+
*/
|
208
|
+
CellWriter.prototype.getSection = function () {
|
209
|
+
return null;
|
210
|
+
};
|
211
|
+
|
212
|
+
/**
|
213
|
+
* @public
|
214
|
+
* @param {Element} elem
|
215
|
+
*/
|
216
|
+
CellWriter.prototype.cloak = function (elem) {
|
217
|
+
delete this.percentText;
|
218
|
+
delete this._flexRow;
|
219
|
+
delete this._floatingPanel;
|
220
|
+
delete this._frontPanel;
|
221
|
+
elem.className = "cell";
|
222
|
+
this._elem = elem;
|
223
|
+
};
|
224
|
+
|
225
|
+
|
226
|
+
export { CellWriter };
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
2
|
+
import { ElementWrapper } from "../../tr-grid-util/es6/ElementWrapper.js";
|
3
|
+
|
4
|
+
declare class ColumnWriter extends ElementWrapper {
|
5
|
+
|
6
|
+
constructor();
|
7
|
+
|
8
|
+
public isActive(): number;
|
9
|
+
|
10
|
+
}
|
11
|
+
|
12
|
+
export { ColumnWriter };
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
2
|
+
import { ElementWrapper } from "../../tr-grid-util/es6/ElementWrapper.js";
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @constructor
|
6
|
+
* @extends {ElementWrapper}
|
7
|
+
*/
|
8
|
+
var ColumnWriter = function () {
|
9
|
+
};
|
10
|
+
Ext.inherits(ColumnWriter, ElementWrapper);
|
11
|
+
|
12
|
+
|
13
|
+
/** @public
|
14
|
+
* @return {number}
|
15
|
+
*/
|
16
|
+
ColumnWriter.prototype.isActive = function () {
|
17
|
+
return true;
|
18
|
+
};
|
19
|
+
|
20
|
+
|
21
|
+
export { ColumnWriter };
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { Dom } from "../../tr-grid-util/es6/Dom.js";
|
2
|
+
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
3
|
+
import { Table } from "../../tr-grid-util/es6/Table.js";
|
4
|
+
|
5
|
+
import { PrintTrait } from "./PrintTrait.js";
|
6
|
+
import { SectionWriter } from "./SectionWriter.js";
|
7
|
+
|
8
|
+
declare namespace GridPrinter {
|
9
|
+
|
10
|
+
function setPrintOptions(options: GridPrinter.Options): void;
|
11
|
+
|
12
|
+
function observe(iFrameElement?: HTMLIFrameElement): void;
|
13
|
+
|
14
|
+
function unobserve(): void;
|
15
|
+
|
16
|
+
function enableDebugMode(bool?: boolean): void;
|
17
|
+
|
18
|
+
function getPreFlightInfo(grid: any, options?: any): any;
|
19
|
+
|
20
|
+
function createPrintElement(grid: any, options?: any): Element|null;
|
21
|
+
|
22
|
+
function print(grid: any): void;
|
23
|
+
|
24
|
+
type Options = {
|
25
|
+
pageWidth?: number,
|
26
|
+
pageHeight?: number,
|
27
|
+
primaryColumn?: number
|
28
|
+
};
|
29
|
+
|
30
|
+
}
|
31
|
+
|
32
|
+
export { GridPrinter };
|