@refinitiv-ui/efx-grid 6.0.45 → 6.0.47
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/core/dist/core.js +129 -2
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/DataTable.d.ts +2 -0
- package/lib/core/es6/data/DataTable.js +97 -1
- package/lib/core/es6/data/DataView.d.ts +2 -0
- package/lib/core/es6/data/DataView.js +9 -0
- package/lib/core/es6/grid/Core.js +1 -1
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +2 -0
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +22 -0
- 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/Core/data/DataTable.d.ts +2 -0
- package/lib/types/es6/Core/data/DataView.d.ts +2 -0
- package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +2 -0
- package/lib/types/es6/RowFiltering.d.ts +5 -0
- package/package.json +1 -1
@@ -0,0 +1,213 @@
|
|
1
|
+
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
2
|
+
import { ElementWrapper } from "../../tr-grid-util/es6/ElementWrapper.js";
|
3
|
+
import { Table } from "../../tr-grid-util/es6/Table.js";
|
4
|
+
import { CellWriter } from "./CellWriter.js";
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @constructor
|
8
|
+
* @extends {ElementWrapper}
|
9
|
+
*/
|
10
|
+
var SectionWriter = function () {
|
11
|
+
this._cellWriter = new CellWriter();
|
12
|
+
this._table = new Table();
|
13
|
+
this._columns = [];
|
14
|
+
this._elem = this._table.getElement();
|
15
|
+
};
|
16
|
+
Ext.inherits(SectionWriter, ElementWrapper);
|
17
|
+
/** @type {!CellWriter}
|
18
|
+
* @private
|
19
|
+
*/
|
20
|
+
SectionWriter.prototype._cellWriter;
|
21
|
+
/** @type {!Table}
|
22
|
+
* @private
|
23
|
+
*/
|
24
|
+
SectionWriter.prototype._table;
|
25
|
+
|
26
|
+
/** @public
|
27
|
+
* @return {number}
|
28
|
+
*/
|
29
|
+
SectionWriter.prototype.getFirstIndexInView = function () {
|
30
|
+
return 0;
|
31
|
+
};
|
32
|
+
|
33
|
+
/** @public
|
34
|
+
* @return {number}
|
35
|
+
*/
|
36
|
+
SectionWriter.prototype.getLastIndexInView = function () {
|
37
|
+
return this._table.getRowCount();
|
38
|
+
};
|
39
|
+
|
40
|
+
/** @public
|
41
|
+
* @return {number}
|
42
|
+
*/
|
43
|
+
SectionWriter.prototype.getColumnCount = function () {
|
44
|
+
return this._table.getColumnCount();
|
45
|
+
};
|
46
|
+
/** @public
|
47
|
+
* @param {number} colIndex
|
48
|
+
* @return {*}
|
49
|
+
*/
|
50
|
+
SectionWriter.prototype.getColumn = function (colIndex) {
|
51
|
+
var col = this._columns[colIndex];
|
52
|
+
if (!col) {
|
53
|
+
col = this._columns[colIndex] = {};
|
54
|
+
}
|
55
|
+
return col;
|
56
|
+
};
|
57
|
+
/** @public
|
58
|
+
* @param {number} val
|
59
|
+
*/
|
60
|
+
SectionWriter.prototype.setColumnCount = function (val) {
|
61
|
+
this._table.setColumnCount(val);
|
62
|
+
};
|
63
|
+
/** @public
|
64
|
+
* @return {number}
|
65
|
+
*/
|
66
|
+
SectionWriter.prototype.getRowCount = function () {
|
67
|
+
return this._table.getRowCount();
|
68
|
+
};
|
69
|
+
/** @public
|
70
|
+
* @param {number} val
|
71
|
+
*/
|
72
|
+
SectionWriter.prototype.setRowCount = function (val) {
|
73
|
+
this._table.setRowCount(val);
|
74
|
+
};
|
75
|
+
|
76
|
+
|
77
|
+
/**
|
78
|
+
* @public
|
79
|
+
* @param {number} colIndex
|
80
|
+
* @param {number} rowIndex
|
81
|
+
* @return {CellWriter}
|
82
|
+
*/
|
83
|
+
SectionWriter.prototype.getCell = function (colIndex, rowIndex) {
|
84
|
+
var cell = this._table.getCell(colIndex, rowIndex);
|
85
|
+
if(cell) {
|
86
|
+
this._cellWriter.cloak(cell);
|
87
|
+
return this._cellWriter;
|
88
|
+
}
|
89
|
+
return null;
|
90
|
+
};
|
91
|
+
/** @public
|
92
|
+
* @param {number} colIndex
|
93
|
+
* @param {number} rowIndex
|
94
|
+
* @return {Element|Node|NodeList}
|
95
|
+
*/
|
96
|
+
SectionWriter.prototype.getCellContent = function (colIndex, rowIndex) {
|
97
|
+
var cell = this.getCell(colIndex, rowIndex);
|
98
|
+
return cell ? cell.getContent() : null;
|
99
|
+
};
|
100
|
+
/** Set data to the specified cell
|
101
|
+
* @public
|
102
|
+
* @param {number} colIndex
|
103
|
+
* @param {number} rowIndex
|
104
|
+
* @param {string|Element|tr.IElementControl|*} data this can be HTML element, string, number, date, image
|
105
|
+
*/
|
106
|
+
SectionWriter.prototype.setCellContent = function (colIndex, rowIndex, data) {
|
107
|
+
var cell = this.getCell(colIndex, rowIndex);
|
108
|
+
if(cell) {
|
109
|
+
cell.setContent(data);
|
110
|
+
}
|
111
|
+
};
|
112
|
+
/** Apply CSS class to each cell in the row
|
113
|
+
* @public
|
114
|
+
* @param {number} rowIndex
|
115
|
+
* @param {string} className
|
116
|
+
* @param {boolean} enabled
|
117
|
+
* @see {@link tr.ILayoutGrid.#setRowStyle}
|
118
|
+
*/
|
119
|
+
SectionWriter.prototype.enableRowClass = function (rowIndex, className, enabled) { };
|
120
|
+
|
121
|
+
/** This will make the specified cell horizontally span to fit entire row regardless of position of the cell -- cell will shift to the left most of the section.<br>
|
122
|
+
* If opt_noLeftStretching is true, the cell will not extend to the left most position<br>
|
123
|
+
* This is different from cell colSpan, which the cell remain in the same position. tr-stretched class will also be added to the cell
|
124
|
+
* @public
|
125
|
+
* @param {number} colIndex
|
126
|
+
* @param {number} rowIndex
|
127
|
+
* @param {boolean=} opt_stretching Default is true
|
128
|
+
* @param {boolean=} opt_noLeftStretching Default is false (expand cell to the left).
|
129
|
+
*/
|
130
|
+
SectionWriter.prototype.stretchCell = function (colIndex, rowIndex, opt_stretching, opt_noLeftStretching) {
|
131
|
+
var cell = this._table.getCell(colIndex, rowIndex);
|
132
|
+
cell.setAttribute("colspan", this._table.getColumnCount());
|
133
|
+
};
|
134
|
+
/** {@link SectionWriter#stretchCell}
|
135
|
+
* @public
|
136
|
+
* @ignore
|
137
|
+
* @param {number} colIndex
|
138
|
+
* @param {number} rowIndex
|
139
|
+
*/
|
140
|
+
SectionWriter.prototype.unstretchCell = function (colIndex, rowIndex) {};
|
141
|
+
|
142
|
+
/** @public
|
143
|
+
* @return {boolean}
|
144
|
+
*/
|
145
|
+
SectionWriter.prototype.hasCellSpan = function () { return false; };
|
146
|
+
/** @description Returns zero or negative value, if the cell is spanned over (i.e. occupied by the spanning cell). <br>
|
147
|
+
* Negative value is distance from the spanning cell (i.e. -1 means one cell from the spanning cell and -2 means two cells from the spanning cell) <br>
|
148
|
+
* Return one, if the cell has no span (normal cell). <br>
|
149
|
+
* Return value greater than one, if the cell is spanning (getting expanded)
|
150
|
+
* @public
|
151
|
+
* @param {number} colIndex
|
152
|
+
* @param {number} rowIndex
|
153
|
+
* @return {number}
|
154
|
+
*/
|
155
|
+
SectionWriter.prototype.getCellRowSpan = function (colIndex, rowIndex) { return 1; };
|
156
|
+
/** @public
|
157
|
+
* @param {number} colIndex
|
158
|
+
* @param {number} rowIndex
|
159
|
+
* @param {number} rowSpan
|
160
|
+
*/
|
161
|
+
SectionWriter.prototype.setCellRowSpan = function (colIndex, rowIndex, rowSpan) { };
|
162
|
+
/** @description Returns zero or negative value, if the cell is spanned over (i.e. occupied by the spanning cell). <br>
|
163
|
+
* Negative value is distance from the spanning cell (i.e. -1 means one cell from the spanning cell and -2 means two cells from the spanning cell) <br>
|
164
|
+
* Return one, if the cell has no span (normal cell). <br>
|
165
|
+
* Return value greater than one, if the cell is spanning (getting expanded)
|
166
|
+
* @public
|
167
|
+
* @param {number} colIndex
|
168
|
+
* @param {number} rowIndex
|
169
|
+
* @return {number}
|
170
|
+
*/
|
171
|
+
SectionWriter.prototype.getCellColSpan = function (colIndex, rowIndex) { return 1; };
|
172
|
+
/** @public
|
173
|
+
* @param {number} colIndex
|
174
|
+
* @param {number} rowIndex
|
175
|
+
* @param {number} colSpan
|
176
|
+
*/
|
177
|
+
SectionWriter.prototype.setCellColSpan = function (colIndex, rowIndex, colSpan) { };
|
178
|
+
/** @public
|
179
|
+
*/
|
180
|
+
SectionWriter.prototype.clearCellSpans = function () { };
|
181
|
+
/** @public
|
182
|
+
* @param {number} colIndex
|
183
|
+
*/
|
184
|
+
SectionWriter.prototype.clearColumnSpans = function (colIndex) { };
|
185
|
+
|
186
|
+
/** @public
|
187
|
+
* @param {number} colIndex
|
188
|
+
* @return {boolean}
|
189
|
+
*/
|
190
|
+
SectionWriter.prototype.isColumnActive = function (colIndex) {
|
191
|
+
return true;
|
192
|
+
};
|
193
|
+
|
194
|
+
/**
|
195
|
+
* @public
|
196
|
+
* @param {number} colIndex
|
197
|
+
* @param {number} rowIndex
|
198
|
+
* @return {Element}
|
199
|
+
*/
|
200
|
+
SectionWriter.prototype.getCellElement = function (colIndex, rowIndex) {
|
201
|
+
return this._table.getCell(colIndex, rowIndex);
|
202
|
+
};
|
203
|
+
|
204
|
+
/** @public
|
205
|
+
* @ignore
|
206
|
+
* @param {boolean} enabled
|
207
|
+
*/
|
208
|
+
SectionWriter.prototype._startBindingSession = function (enabled) {
|
209
|
+
// Prevent error when calling _startBindingSession in LayoutGrid
|
210
|
+
};
|
211
|
+
|
212
|
+
|
213
|
+
export { SectionWriter };
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./GridPrinter";
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./GridPrinter";
|
@@ -112,6 +112,8 @@ declare class DataTable extends DataCache {
|
|
112
112
|
|
113
113
|
public getSegmentChildIds(segmentId: string): (string)[]|null;
|
114
114
|
|
115
|
+
public sortSeparators(sortLogics: ((...params: any[]) => any)|(((...params: any[]) => any))[]|null, sortOrders: (number)[]|null, cids: (string)[]|null): boolean;
|
116
|
+
|
115
117
|
public sortSegments(compare: ((...params: any[]) => any)|null): boolean;
|
116
118
|
|
117
119
|
public setClassificationSource(dc: DataCache|null): void;
|
@@ -272,6 +272,8 @@ declare class DataView extends EventDispatcher {
|
|
272
272
|
|
273
273
|
public getSegmentChildIds(segmentRef: string|number|null): (string)[]|null;
|
274
274
|
|
275
|
+
public sortSeparators(sortLogics: (((...params: any[]) => any))[]|null, sortOrders: (number)[]|null, cids: (string)[]|null): void;
|
276
|
+
|
275
277
|
public sortSegments(compare: ((...params: any[]) => any)|null): void;
|
276
278
|
|
277
279
|
public enableEmptySegmentFiltering(enabled?: boolean|null): void;
|
@@ -135,6 +135,8 @@ declare class SortableTitlePlugin extends EventDispatcher {
|
|
135
135
|
|
136
136
|
public clearAllColumnSortingSequences(): void;
|
137
137
|
|
138
|
+
public sortSeparators(comparer: ((...params: any[]) => any)|null): void;
|
139
|
+
|
138
140
|
}
|
139
141
|
|
140
142
|
declare function len(disabled?: boolean|null): void;
|
@@ -33,6 +33,7 @@ declare namespace RowFilteringPlugin {
|
|
33
33
|
};
|
34
34
|
|
35
35
|
type Options = {
|
36
|
+
emptySegmentFiltering?: boolean|null,
|
36
37
|
disabledUI?: boolean|null,
|
37
38
|
iconActivation?: string|null,
|
38
39
|
dialogOptions?: RowFilteringPlugin.FilterDialogOptions|null,
|
@@ -114,9 +115,13 @@ declare class RowFilteringPlugin extends GridPlugin {
|
|
114
115
|
|
115
116
|
public openDialog(colIndex: number, runtimeDialogOptions?: RowFilteringPlugin.FilterDialogOptions|null): void;
|
116
117
|
|
118
|
+
public enableEmptySegmentFiltering(enabled?: boolean|null): void;
|
119
|
+
|
117
120
|
}
|
118
121
|
|
119
122
|
declare function field(colIndex: number, exp: RowFilteringPlugin.Expression|null, ctx?: (any|string)|null): boolean;
|
120
123
|
|
124
|
+
declare function crf(enabled?: boolean|null): void;
|
125
|
+
|
121
126
|
export default RowFilteringPlugin;
|
122
127
|
export { RowFilteringPlugin, RowFilteringPlugin as RowFiltering, RowFilteringPlugin as RowFilteringExtension };
|
package/package.json
CHANGED