@mescius/wijmo.react.grid 5.20232.939
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/COMMERCIAL-LICENSE.html +485 -0
- package/README.md +363 -0
- package/es2015-commonjs.js +14 -0
- package/es2015-esm.js +14 -0
- package/es5-esm.js +14 -0
- package/index.d.ts +695 -0
- package/index.js +14 -0
- package/package.json +49 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,695 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
*
|
|
3
|
+
* Wijmo Library 5.20232.939
|
|
4
|
+
* https://developer.mescius.com/wijmo
|
|
5
|
+
*
|
|
6
|
+
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
|
|
9
|
+
* us.sales@mescius.com
|
|
10
|
+
* https://developer.mescius.com/wijmo/licensing
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* {@module wijmo.react.grid}
|
|
15
|
+
* Contains React components for the <b>wijmo.grid</b> module.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export declare var ___keepComment: any;
|
|
21
|
+
import { ComponentBase } from '@grapecity/wijmo.react.base';
|
|
22
|
+
import * as React from 'react';
|
|
23
|
+
import * as wjcCore from '@grapecity/wijmo';
|
|
24
|
+
import * as wjcGrid from '@grapecity/wijmo.grid';
|
|
25
|
+
import * as wjcInteropGrid from '@grapecity/wijmo.interop.grid';
|
|
26
|
+
/**
|
|
27
|
+
* Represents a cell template types enumeration.
|
|
28
|
+
*/
|
|
29
|
+
export import CellTemplateType = wjcInteropGrid.GridCellTemplateType;
|
|
30
|
+
/**
|
|
31
|
+
* React component for the {@link wijmo.grid.FlexGrid} control.
|
|
32
|
+
*
|
|
33
|
+
* The <b>flex-grid</b> component may contain
|
|
34
|
+
* the following child components:
|
|
35
|
+
* {@link wijmo.react.grid.detail.FlexGridDetail}
|
|
36
|
+
* , {@link wijmo.react.grid.filter.FlexGridFilter}
|
|
37
|
+
* , {@link wijmo.react.grid.immutable.ImmutabilityProvider}
|
|
38
|
+
* , {@link wijmo.react.grid.FlexGridColumn}
|
|
39
|
+
* , {@link wijmo.react.grid.FlexGridColumnGroup}
|
|
40
|
+
* and {@link wijmo.react.grid.FlexGridCellTemplate}.
|
|
41
|
+
*
|
|
42
|
+
* The component supports all properties and events of the pure JavaScript {@link wijmo.grid.FlexGrid} control it represents.
|
|
43
|
+
*
|
|
44
|
+
* The component includes an <b>initialized</b> event that is raised when the control is initialized after it is added to the page.
|
|
45
|
+
* You can use this event to perform further initialization in addition to setting properties in JSX.
|
|
46
|
+
* The signature of the handler function is the same as any other Wijmo event handlers.
|
|
47
|
+
*
|
|
48
|
+
* The example below shows how to instantiate and initialize a
|
|
49
|
+
* {@link wijmo.grid.FlexGrid} control in JSX:
|
|
50
|
+
*
|
|
51
|
+
* <pre><Wj.FlexGrid
|
|
52
|
+
* autoGenerateColumns={ false }
|
|
53
|
+
* columns={[
|
|
54
|
+
* { binding: 'name', header: 'Name' },
|
|
55
|
+
* { binding: 'sales', header: 'Sales', format: 'c0' },
|
|
56
|
+
* { binding: 'expenses', header: 'Expenses', format: 'c0' },
|
|
57
|
+
* { binding: 'active', header: 'Active' },
|
|
58
|
+
* { binding: 'date', header: 'Date' }
|
|
59
|
+
* ]}
|
|
60
|
+
* itemsSource={ this.state.data } /></pre>
|
|
61
|
+
*
|
|
62
|
+
* The code sets the <b>autoGenerateColumns</b> property to false, then
|
|
63
|
+
* sets the <b>columns</b> property, and finally sets the <b>itemsSource</b>
|
|
64
|
+
* property. This order is important, it prevents the grid from automatically
|
|
65
|
+
* generating the columns.
|
|
66
|
+
*/
|
|
67
|
+
export declare class FlexGrid extends ComponentBase {
|
|
68
|
+
props: {
|
|
69
|
+
template?: any;
|
|
70
|
+
children?: any;
|
|
71
|
+
isDisabled?: any;
|
|
72
|
+
tabOrder?: any;
|
|
73
|
+
newRowAtTop?: any;
|
|
74
|
+
allowAddNew?: any;
|
|
75
|
+
allowDelete?: any;
|
|
76
|
+
allowDragging?: any;
|
|
77
|
+
allowMerging?: any;
|
|
78
|
+
allowResizing?: any;
|
|
79
|
+
allowSorting?: any;
|
|
80
|
+
allowPinning?: any;
|
|
81
|
+
autoScroll?: any;
|
|
82
|
+
autoRowHeights?: any;
|
|
83
|
+
autoSizeMode?: any;
|
|
84
|
+
autoGenerateColumns?: any;
|
|
85
|
+
autoSearch?: any;
|
|
86
|
+
caseSensitiveSearch?: any;
|
|
87
|
+
quickAutoSize?: any;
|
|
88
|
+
bigCheckboxes?: any;
|
|
89
|
+
childItemsPath?: any;
|
|
90
|
+
groupHeaderFormat?: any;
|
|
91
|
+
headersVisibility?: any;
|
|
92
|
+
showSelectedHeaders?: any;
|
|
93
|
+
showMarquee?: any;
|
|
94
|
+
showPlaceholders?: any;
|
|
95
|
+
itemFormatter?: any;
|
|
96
|
+
isReadOnly?: any;
|
|
97
|
+
imeEnabled?: any;
|
|
98
|
+
mergeManager?: any;
|
|
99
|
+
selectionMode?: any;
|
|
100
|
+
showGroups?: any;
|
|
101
|
+
showSort?: any;
|
|
102
|
+
showDropDown?: any;
|
|
103
|
+
showAlternatingRows?: any;
|
|
104
|
+
showErrors?: any;
|
|
105
|
+
alternatingRowStep?: any;
|
|
106
|
+
itemValidator?: any;
|
|
107
|
+
validateEdits?: any;
|
|
108
|
+
treeIndent?: any;
|
|
109
|
+
itemsSource?: any;
|
|
110
|
+
autoClipboard?: any;
|
|
111
|
+
expandSelectionOnCopyPaste?: any;
|
|
112
|
+
frozenRows?: any;
|
|
113
|
+
frozenColumns?: any;
|
|
114
|
+
cloneFrozenCells?: any;
|
|
115
|
+
deferResizing?: any;
|
|
116
|
+
sortRowIndex?: any;
|
|
117
|
+
editColumnIndex?: any;
|
|
118
|
+
stickyHeaders?: any;
|
|
119
|
+
preserveSelectedState?: any;
|
|
120
|
+
preserveOutlineState?: any;
|
|
121
|
+
preserveWhiteSpace?: any;
|
|
122
|
+
keyActionTab?: any;
|
|
123
|
+
keyActionEnter?: any;
|
|
124
|
+
rowHeaderPath?: any;
|
|
125
|
+
virtualizationThreshold?: any;
|
|
126
|
+
anchorCursor?: any;
|
|
127
|
+
lazyRender?: any;
|
|
128
|
+
refreshOnEdit?: any;
|
|
129
|
+
copyHeaders?: any;
|
|
130
|
+
columnGroups?: any;
|
|
131
|
+
initialized?: any;
|
|
132
|
+
gotFocus?: any;
|
|
133
|
+
lostFocus?: any;
|
|
134
|
+
refreshing?: any;
|
|
135
|
+
refreshed?: any;
|
|
136
|
+
invalidInput?: any;
|
|
137
|
+
beginningEdit?: any;
|
|
138
|
+
cellEditEnded?: any;
|
|
139
|
+
cellEditEnding?: any;
|
|
140
|
+
prepareCellForEdit?: any;
|
|
141
|
+
formatItem?: any;
|
|
142
|
+
resizingColumn?: any;
|
|
143
|
+
resizedColumn?: any;
|
|
144
|
+
autoSizingColumn?: any;
|
|
145
|
+
autoSizedColumn?: any;
|
|
146
|
+
draggingColumn?: any;
|
|
147
|
+
draggingColumnOver?: any;
|
|
148
|
+
draggedColumn?: any;
|
|
149
|
+
sortingColumn?: any;
|
|
150
|
+
sortedColumn?: any;
|
|
151
|
+
pinningColumn?: any;
|
|
152
|
+
pinnedColumn?: any;
|
|
153
|
+
resizingRow?: any;
|
|
154
|
+
resizedRow?: any;
|
|
155
|
+
autoSizingRow?: any;
|
|
156
|
+
autoSizedRow?: any;
|
|
157
|
+
draggingRow?: any;
|
|
158
|
+
draggingRowOver?: any;
|
|
159
|
+
draggedRow?: any;
|
|
160
|
+
deletingRow?: any;
|
|
161
|
+
deletedRow?: any;
|
|
162
|
+
loadingRows?: any;
|
|
163
|
+
loadedRows?: any;
|
|
164
|
+
rowEditStarting?: any;
|
|
165
|
+
rowEditStarted?: any;
|
|
166
|
+
rowEditEnding?: any;
|
|
167
|
+
rowEditEnded?: any;
|
|
168
|
+
rowAdded?: any;
|
|
169
|
+
groupCollapsedChanging?: any;
|
|
170
|
+
groupCollapsedChanged?: any;
|
|
171
|
+
columnGroupCollapsedChanging?: any;
|
|
172
|
+
columnGroupCollapsedChanged?: any;
|
|
173
|
+
itemsSourceChanging?: any;
|
|
174
|
+
itemsSourceChanged?: any;
|
|
175
|
+
selectionChanging?: any;
|
|
176
|
+
selectionChanged?: any;
|
|
177
|
+
scrollPositionChanged?: any;
|
|
178
|
+
updatingView?: any;
|
|
179
|
+
updatedView?: any;
|
|
180
|
+
updatingLayout?: any;
|
|
181
|
+
updatedLayout?: any;
|
|
182
|
+
pasting?: any;
|
|
183
|
+
pasted?: any;
|
|
184
|
+
pastingCell?: any;
|
|
185
|
+
pastedCell?: any;
|
|
186
|
+
copying?: any;
|
|
187
|
+
copied?: any;
|
|
188
|
+
commitEmptyEdits?: any;
|
|
189
|
+
[key: string]: any;
|
|
190
|
+
headersFocusability?: any;
|
|
191
|
+
ariaLabel?: any;
|
|
192
|
+
};
|
|
193
|
+
constructor(props: any);
|
|
194
|
+
protected _createControl(): any;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* React component for the {@link wijmo.grid.Column} class.
|
|
198
|
+
*
|
|
199
|
+
* The <b>flex-grid-column</b> component should be contained in
|
|
200
|
+
* a {@link wijmo.react.grid.FlexGrid} component.
|
|
201
|
+
*
|
|
202
|
+
* The <b>flex-grid-column</b> component may contain
|
|
203
|
+
* a {@link wijmo.react.grid.FlexGridCellTemplate} child component.
|
|
204
|
+
*
|
|
205
|
+
* The component supports all properties and events of the pure JavaScript {@link wijmo.grid.Column} class it represents.
|
|
206
|
+
*
|
|
207
|
+
* The component includes an <b>initialized</b> event that is raised when the control is initialized after it is added to the page.
|
|
208
|
+
* You can use this event to perform further initialization in addition to setting properties in JSX.
|
|
209
|
+
* The signature of the handler function is the same as any other Wijmo event handlers.
|
|
210
|
+
*/
|
|
211
|
+
export declare class FlexGridColumn extends ComponentBase {
|
|
212
|
+
props: {
|
|
213
|
+
template?: any;
|
|
214
|
+
children?: any;
|
|
215
|
+
name?: any;
|
|
216
|
+
dataMap?: any;
|
|
217
|
+
dataType?: any;
|
|
218
|
+
binding?: any;
|
|
219
|
+
sortMemberPath?: any;
|
|
220
|
+
format?: any;
|
|
221
|
+
cellTemplate?: any;
|
|
222
|
+
header?: any;
|
|
223
|
+
width?: any;
|
|
224
|
+
maxLength?: any;
|
|
225
|
+
minWidth?: any;
|
|
226
|
+
maxWidth?: any;
|
|
227
|
+
align?: any;
|
|
228
|
+
allowDragging?: any;
|
|
229
|
+
allowSorting?: any;
|
|
230
|
+
allowResizing?: any;
|
|
231
|
+
allowMerging?: any;
|
|
232
|
+
aggregate?: any;
|
|
233
|
+
isReadOnly?: any;
|
|
234
|
+
cssClass?: any;
|
|
235
|
+
cssClassAll?: any;
|
|
236
|
+
isContentHtml?: any;
|
|
237
|
+
isSelected?: any;
|
|
238
|
+
visible?: any;
|
|
239
|
+
wordWrap?: any;
|
|
240
|
+
multiLine?: any;
|
|
241
|
+
mask?: any;
|
|
242
|
+
inputType?: any;
|
|
243
|
+
isRequired?: any;
|
|
244
|
+
showDropDown?: any;
|
|
245
|
+
dataMapEditor?: any;
|
|
246
|
+
dropDownCssClass?: any;
|
|
247
|
+
quickAutoSize?: any;
|
|
248
|
+
editor?: any;
|
|
249
|
+
initialized?: any;
|
|
250
|
+
[key: string]: any;
|
|
251
|
+
};
|
|
252
|
+
_parentProp: string;
|
|
253
|
+
constructor(props: any);
|
|
254
|
+
protected _initParent(): void;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* React component for the {@link wijmo.grid.ColumnGroup} class.
|
|
258
|
+
*
|
|
259
|
+
* The <b>flex-grid-column-group</b> component should be contained in
|
|
260
|
+
* one of the following components:
|
|
261
|
+
* {@link wijmo.react.grid.FlexGrid}
|
|
262
|
+
* or {@link wijmo.react.grid.FlexGridColumnGroup}.
|
|
263
|
+
*
|
|
264
|
+
* The <b>flex-grid-column-group</b> component may contain
|
|
265
|
+
* the following child components:
|
|
266
|
+
* {@link wijmo.react.grid.FlexGridColumnGroup}
|
|
267
|
+
* and {@link wijmo.react.grid.FlexGridCellTemplate}.
|
|
268
|
+
*
|
|
269
|
+
* The component supports all properties and events of the pure JavaScript {@link wijmo.grid.ColumnGroup} class it represents.
|
|
270
|
+
*
|
|
271
|
+
* The component includes an <b>initialized</b> event that is raised when the control is initialized after it is added to the page.
|
|
272
|
+
* You can use this event to perform further initialization in addition to setting properties in JSX.
|
|
273
|
+
* The signature of the handler function is the same as any other Wijmo event handlers.
|
|
274
|
+
*/
|
|
275
|
+
export declare class FlexGridColumnGroup extends ComponentBase {
|
|
276
|
+
props: {
|
|
277
|
+
template?: any;
|
|
278
|
+
children?: any;
|
|
279
|
+
name?: any;
|
|
280
|
+
dataMap?: any;
|
|
281
|
+
dataType?: any;
|
|
282
|
+
binding?: any;
|
|
283
|
+
sortMemberPath?: any;
|
|
284
|
+
format?: any;
|
|
285
|
+
cellTemplate?: any;
|
|
286
|
+
header?: any;
|
|
287
|
+
width?: any;
|
|
288
|
+
maxLength?: any;
|
|
289
|
+
minWidth?: any;
|
|
290
|
+
maxWidth?: any;
|
|
291
|
+
align?: any;
|
|
292
|
+
allowDragging?: any;
|
|
293
|
+
allowSorting?: any;
|
|
294
|
+
allowResizing?: any;
|
|
295
|
+
allowMerging?: any;
|
|
296
|
+
aggregate?: any;
|
|
297
|
+
isReadOnly?: any;
|
|
298
|
+
cssClass?: any;
|
|
299
|
+
cssClassAll?: any;
|
|
300
|
+
isContentHtml?: any;
|
|
301
|
+
isSelected?: any;
|
|
302
|
+
visible?: any;
|
|
303
|
+
wordWrap?: any;
|
|
304
|
+
multiLine?: any;
|
|
305
|
+
mask?: any;
|
|
306
|
+
inputType?: any;
|
|
307
|
+
isRequired?: any;
|
|
308
|
+
showDropDown?: any;
|
|
309
|
+
dataMapEditor?: any;
|
|
310
|
+
dropDownCssClass?: any;
|
|
311
|
+
quickAutoSize?: any;
|
|
312
|
+
editor?: any;
|
|
313
|
+
collapseTo?: any;
|
|
314
|
+
isCollapsed?: any;
|
|
315
|
+
initialized?: any;
|
|
316
|
+
height?: any;
|
|
317
|
+
[key: string]: any;
|
|
318
|
+
};
|
|
319
|
+
_parentProp: string;
|
|
320
|
+
constructor(props: any);
|
|
321
|
+
}
|
|
322
|
+
interface ICellTemplateInfoReact extends wjcInteropGrid.ICellTemplateInfo {
|
|
323
|
+
template: CellTemplateRender;
|
|
324
|
+
}
|
|
325
|
+
interface ICellRenderingInfoReact extends wjcInteropGrid.ICellRenderingInfo {
|
|
326
|
+
templateContext: ICellTemplateInfoReact;
|
|
327
|
+
}
|
|
328
|
+
export declare class DirectiveCellFactory extends wjcInteropGrid.DirectiveCellFactoryBase {
|
|
329
|
+
private readonly _renderedCells;
|
|
330
|
+
private _isViewUpdated;
|
|
331
|
+
constructor(gridComponent: ComponentBase, grid: wjcGrid.FlexGrid);
|
|
332
|
+
protected shouldInstantiate(cellInfo: wjcInteropGrid.ICellRenderingInfo): boolean;
|
|
333
|
+
protected renderTemplate(cellInfo: ICellRenderingInfoReact, initNew: boolean): void;
|
|
334
|
+
protected disposeTemplate(cell: HTMLElement, templateCache: wjcInteropGrid.ICellTemplateCache, templateContext: ICellTemplateInfoReact): void;
|
|
335
|
+
protected clearCell(cell: HTMLElement): void;
|
|
336
|
+
protected applyImmediately(cellInfo: ICellRenderingInfoReact): void;
|
|
337
|
+
protected flushPendingEvents(control: wjcCore.Control): void;
|
|
338
|
+
protected getEditorFocusFlag(): boolean;
|
|
339
|
+
protected setEditorFocusFlag(value: boolean): void;
|
|
340
|
+
private _renderCell;
|
|
341
|
+
private _addRenderedCell;
|
|
342
|
+
private _removeRenderedCell;
|
|
343
|
+
private _reRenderCells;
|
|
344
|
+
private _gridCmpBeforeDidUpdate;
|
|
345
|
+
private _gridCmpAfterDidUpdate;
|
|
346
|
+
private _gridCmpRendered;
|
|
347
|
+
private _gridViewUpdated;
|
|
348
|
+
protected checkHeight(cellInfo: wjcInteropGrid.ICellRenderingInfo): void;
|
|
349
|
+
}
|
|
350
|
+
export interface ICellTemplateContext {
|
|
351
|
+
row: wjcGrid.Row;
|
|
352
|
+
col: wjcGrid.Column;
|
|
353
|
+
item: any;
|
|
354
|
+
value: any;
|
|
355
|
+
values: any;
|
|
356
|
+
}
|
|
357
|
+
export declare type CellTemplateRender = (context: ICellTemplateContext) => any;
|
|
358
|
+
/**
|
|
359
|
+
* React component for the {@link FlexGrid} cell templates.
|
|
360
|
+
*
|
|
361
|
+
* The <b>FlexGridCellTemplate</b> component defines a template for a certain
|
|
362
|
+
* cell type in {@link FlexGrid}. The template element must contain a <b>cellType</b> property that
|
|
363
|
+
* specifies the {@link wijmo.react.grid.CellTemplateType}. Depending on the template's cell type,
|
|
364
|
+
* the <b>FlexGridCellTemplate</b> element must be a child
|
|
365
|
+
* of either {@link wijmo.react.grid.FlexGrid}
|
|
366
|
+
* or {@link wijmo.react.grid.FlexGridColumn} components.
|
|
367
|
+
*
|
|
368
|
+
* Column-specific cell templates must be contained in <b>FlexGridColumn</b>
|
|
369
|
+
* components, and cells that are not column-specific (like row header or top left cells)
|
|
370
|
+
* must be contained in the <b>FlexGrid</b> component.
|
|
371
|
+
*
|
|
372
|
+
* The content of cells is defined using the <b>template</b> <i>render prop</i>, which receives
|
|
373
|
+
* a render function that should return a virtual element tree representing the cell content.
|
|
374
|
+
* The function has the <b>context</b> parameter where the data context of each certain cell is
|
|
375
|
+
* passed. This is an object with the <b>col</b>, <b>row</b>, and <b>item</b> properties,
|
|
376
|
+
* which refer to the {@link Column}, {@link Row}, and <b>Row.dataItem</b> objects pertaining to the cell.
|
|
377
|
+
*
|
|
378
|
+
* For cell types like <b>Group</b> and <b>CellEdit</b>, an additional <b>value</b>
|
|
379
|
+
* context property containing an unformatted cell value is provided.
|
|
380
|
+
*
|
|
381
|
+
* For example, here is a
|
|
382
|
+
* {@link FlexGrid} control with templates for row header cells and, regular
|
|
383
|
+
* and column header cells of the Country column:
|
|
384
|
+
*
|
|
385
|
+
* ```html
|
|
386
|
+
* <!-- component.html -->
|
|
387
|
+
* <wjGrid.FlexGrid itemsSource={this.state.data}>
|
|
388
|
+
* <wjGrid.FlexGridCellTemplate
|
|
389
|
+
* cellType="RowHeader"
|
|
390
|
+
* template={ (context) => context.row.index + 1 } />
|
|
391
|
+
* <wjGrid.FlexGridCellTemplate
|
|
392
|
+
* cellType="RowHeaderEdit"
|
|
393
|
+
* template={ (context) => '...' } />
|
|
394
|
+
*
|
|
395
|
+
* <wjGrid.FlexGridColumn header="Country" binding="country">
|
|
396
|
+
* <wjGrid.FlexGridCellTemplate
|
|
397
|
+
* cellType="ColumnHeader"
|
|
398
|
+
* template={ (context) => {
|
|
399
|
+
* return <React.Fragment>
|
|
400
|
+
* <img src="resources/globe.png" />
|
|
401
|
+
* {context.col.header}
|
|
402
|
+
* </React.Fragment>
|
|
403
|
+
* }
|
|
404
|
+
* }
|
|
405
|
+
* />
|
|
406
|
+
* <wjGrid.FlexGridCellTemplate
|
|
407
|
+
* cellType="Cell"
|
|
408
|
+
* template={ (context) => {
|
|
409
|
+
* return <React.Fragment>
|
|
410
|
+
* <img src={`resources/${context.item.country}.png`} />
|
|
411
|
+
* {context.item.country}
|
|
412
|
+
* </React.Fragment>
|
|
413
|
+
* } }
|
|
414
|
+
* />
|
|
415
|
+
* </wjGrid.FlexGridColumn>
|
|
416
|
+
* <wjGrid.FlexGridColumn header="Sales" binding="sales"></wjGrid.FlexGridColumn>
|
|
417
|
+
* </wjGrid.FlexGrid>
|
|
418
|
+
* ```
|
|
419
|
+
*
|
|
420
|
+
* The <b>FlexGridCellTemplate</b> directive supports the following properties:
|
|
421
|
+
*
|
|
422
|
+
* <dl class="dl-horizontal">
|
|
423
|
+
* <dt>cellType</dt>
|
|
424
|
+
* <dd>
|
|
425
|
+
* The <b>CellTemplateType</b> value defining the type of cell to which the template is applied.
|
|
426
|
+
* </dd>
|
|
427
|
+
* <dt>autoSizeRows</dt>
|
|
428
|
+
* <dd>
|
|
429
|
+
* Indicates whether the cell template will increase grid's default row height
|
|
430
|
+
* to accomodate cells content. Defaults to true.
|
|
431
|
+
* </dd>
|
|
432
|
+
* <dt>cellOverflow</dt>
|
|
433
|
+
* <dd>
|
|
434
|
+
* Defines the <b>style.overflow</b> property value for cells.
|
|
435
|
+
* </dd>
|
|
436
|
+
* <dt>forceFullEdit</dt>
|
|
437
|
+
* <dd>
|
|
438
|
+
* For cell edit templates, indicates whether cell editing forcibly starts in full edit mode,
|
|
439
|
+
* regardless of how the editing was initiated. In full edit mode pressing cursor keys don't finish editing.
|
|
440
|
+
* Defaults to true.
|
|
441
|
+
* </dd>
|
|
442
|
+
* </dl>
|
|
443
|
+
*
|
|
444
|
+
* The <b>cellType</b> attribute takes any of the following enumerated values:
|
|
445
|
+
*
|
|
446
|
+
* <b>Cell</b>
|
|
447
|
+
*
|
|
448
|
+
* Defines a regular (data) cell template. Must be a child of the {@link wijmo.react.grid.FlexGridColumn} component.
|
|
449
|
+
* For example, this cell template shows flags in the cells of Country column:
|
|
450
|
+
*
|
|
451
|
+
* ```html
|
|
452
|
+
* <wjGrid.FlexGridColumn header="Country" binding="country">
|
|
453
|
+
* <wjGrid.FlexGridCellTemplate
|
|
454
|
+
* cellType="Cell"
|
|
455
|
+
* template={ (context) => {
|
|
456
|
+
* return <React.Fragment>
|
|
457
|
+
* <img src={`resources/${context.item.country}.png`} />
|
|
458
|
+
* {context.item.country}
|
|
459
|
+
* </React.Fragment>
|
|
460
|
+
* }
|
|
461
|
+
* }
|
|
462
|
+
* />
|
|
463
|
+
* </wjGrid.FlexGridColumn>
|
|
464
|
+
* ```
|
|
465
|
+
*
|
|
466
|
+
* If <b>Group</b> template is not provided for a hierarchical {@link FlexGrid} (that is, one with the <b>childItemsPath</b> property
|
|
467
|
+
* specified), non-header cells in group rows of
|
|
468
|
+
* this {@link Column} also use this template.
|
|
469
|
+
*
|
|
470
|
+
* <b>CellEdit</b>
|
|
471
|
+
*
|
|
472
|
+
* Defines a template for a cell in edit mode. Must be a child of the {@link wijmo.react.grid.FlexGridColumn} component.
|
|
473
|
+
* This cell type has an additional <b>context.value</b> property. It contains the
|
|
474
|
+
* original cell value before editing, and the updated value after editing.
|
|
475
|
+
*
|
|
476
|
+
* For example, here is a template that uses the Wijmo {@link InputNumber} control as an editor
|
|
477
|
+
* for the "Sales" column:
|
|
478
|
+
* ```html
|
|
479
|
+
* <wjGrid.FlexGridColumn header="Sales" binding="sales">
|
|
480
|
+
* <wjGrid.FlexGridCellTemplate
|
|
481
|
+
* cellType="CellEdit"
|
|
482
|
+
* template={ (context) => {
|
|
483
|
+
* return <wjInput.InputNumber
|
|
484
|
+
* step={1}
|
|
485
|
+
* value={context.value}
|
|
486
|
+
* valueChanged={(inpNum: wjcInput.InputNumber) =>
|
|
487
|
+
* context.value = inpNum.value
|
|
488
|
+
* } />
|
|
489
|
+
* }
|
|
490
|
+
* }
|
|
491
|
+
* />
|
|
492
|
+
* </wjGrid.FlexGridColumn>
|
|
493
|
+
* ```
|
|
494
|
+
*
|
|
495
|
+
* <b>ColumnHeader</b>
|
|
496
|
+
*
|
|
497
|
+
* Defines a template for a column header cell. Must be a child of the {@link wijmo.react.grid.FlexGridColumn} component.
|
|
498
|
+
* For example, this template adds an image to the header of the "Country" column:
|
|
499
|
+
*
|
|
500
|
+
* ```html
|
|
501
|
+
* <wjGrid.FlexGridColumn header="Country" binding="country">
|
|
502
|
+
* <wjGrid.FlexGridCellTemplate
|
|
503
|
+
* cellType="ColumnHeader"
|
|
504
|
+
* template={ (context) => {
|
|
505
|
+
* return <React.Fragment>
|
|
506
|
+
* <img src="resources/globe.png" />
|
|
507
|
+
* {context.col.header}
|
|
508
|
+
* </React.Fragment>
|
|
509
|
+
* }
|
|
510
|
+
* }
|
|
511
|
+
* />
|
|
512
|
+
* </wjGrid.FlexGridColumn>
|
|
513
|
+
* ```
|
|
514
|
+
*
|
|
515
|
+
* <b>RowHeader</b>
|
|
516
|
+
*
|
|
517
|
+
* Defines a template for a row header cell. Must be a child of the {@link wijmo.react.grid.FlexGrid} component.
|
|
518
|
+
* For example, this template shows row indices in the row headers:
|
|
519
|
+
*
|
|
520
|
+
* ```html
|
|
521
|
+
* <wjGrid.FlexGrid itemsSource={this.state.data}>
|
|
522
|
+
* <wjGrid.FlexGridCellTemplate
|
|
523
|
+
* cellType="RowHeader"
|
|
524
|
+
* template={ (context) => context.row.index + 1 } />
|
|
525
|
+
* </wjGrid.FlexGrid>
|
|
526
|
+
* ```
|
|
527
|
+
*
|
|
528
|
+
* Note that this template is applied to a row header cell, even if it is in a row that is
|
|
529
|
+
* in edit mode. In order to provide an edit-mode version of a row header cell with alternate
|
|
530
|
+
* content, define the <b>RowHeaderEdit</b> template.
|
|
531
|
+
*
|
|
532
|
+
* <b>RowHeaderEdit</b>
|
|
533
|
+
*
|
|
534
|
+
* Defines a template for a row header cell in edit mode. Must be a child of the
|
|
535
|
+
* {@link wijmo.react.grid.FlexGrid} component. For example, this template shows dots in the header
|
|
536
|
+
* of rows being edited:
|
|
537
|
+
*
|
|
538
|
+
* ```html
|
|
539
|
+
* <wjGrid.FlexGrid itemsSource={this.state.data}>
|
|
540
|
+
* <wjGrid.FlexGridCellTemplate
|
|
541
|
+
* cellType="RowHeaderEdit"
|
|
542
|
+
* template={ (context) => '...' } />
|
|
543
|
+
* </wjGrid.FlexGrid>
|
|
544
|
+
* ```
|
|
545
|
+
*
|
|
546
|
+
* Use the following <b>RowHeaderEdit</b> template to add the standard edit-mode indicator to cells where
|
|
547
|
+
* the <b>RowHeader</b> template applies:
|
|
548
|
+
*
|
|
549
|
+
* ```html
|
|
550
|
+
* <wjGrid.FlexGrid itemsSource={this.state.data}>
|
|
551
|
+
* <wjGrid.FlexGridCellTemplate
|
|
552
|
+
* cellType="RowHeaderEdit"
|
|
553
|
+
* template={ (context) => '\u270e\ufe0e' } />
|
|
554
|
+
* </wjGrid.FlexGrid>
|
|
555
|
+
* ```
|
|
556
|
+
*
|
|
557
|
+
* <b>TopLeft</b>
|
|
558
|
+
*
|
|
559
|
+
* Defines a template for the top left cell. Must be a child of the {@link wijmo.react.grid.FlexGrid} component.
|
|
560
|
+
* For example, this template shows a down/right glyph in the top-left cell of the grid:
|
|
561
|
+
*
|
|
562
|
+
* ```html
|
|
563
|
+
* <wjGrid.FlexGrid itemsSource={this.state.data}>
|
|
564
|
+
* <wjGrid.FlexGridCellTemplate
|
|
565
|
+
* cellType="TopLeft"
|
|
566
|
+
* template={ (context) => {
|
|
567
|
+
* return <span class="wj-glyph-down-right"></span>
|
|
568
|
+
* } }
|
|
569
|
+
* />
|
|
570
|
+
* </wjGrid.FlexGrid>
|
|
571
|
+
* ```
|
|
572
|
+
*
|
|
573
|
+
* <b>GroupHeader</b>
|
|
574
|
+
*
|
|
575
|
+
* Defines a template for a group header cell in a {@link GroupRow}. Must be a child of
|
|
576
|
+
* the {@link wijmo.react.grid.FlexGridColumn} component.
|
|
577
|
+
*
|
|
578
|
+
* The <b>context.row</b> property contains an instance of the <b>GroupRow</b> class. If the grouping comes
|
|
579
|
+
* from {@link CollectionView}, the <b>context.item</b> property references the {@link CollectionViewGroup} object.
|
|
580
|
+
*
|
|
581
|
+
* For example, this template uses a checkbox element as an expand/collapse toggle:
|
|
582
|
+
*
|
|
583
|
+
* ```html
|
|
584
|
+
* <wjGrid.FlexGridColumn header="Country" binding="country">
|
|
585
|
+
* <wjGrid.FlexGridCellTemplate
|
|
586
|
+
* cellType="GroupHeader"
|
|
587
|
+
* template={ (context) => {
|
|
588
|
+
* return <React.Fragment>
|
|
589
|
+
* <input type="checkbox"
|
|
590
|
+
* checked={context.row.isCollapsed}
|
|
591
|
+
* onChange={e =>
|
|
592
|
+
* context.row.isCollapsed = e.target.checked as boolean
|
|
593
|
+
* } />
|
|
594
|
+
* {context.item.name} ({context.item.items.length} items)
|
|
595
|
+
* </React.Fragment>
|
|
596
|
+
* }
|
|
597
|
+
* }
|
|
598
|
+
* />
|
|
599
|
+
* </wjGrid.FlexGridColumn>
|
|
600
|
+
* ```
|
|
601
|
+
*
|
|
602
|
+
* <b>Group</b>
|
|
603
|
+
*
|
|
604
|
+
* Defines a template for a regular cell (not a group header) in a {@link GroupRow}. Must be a child of the
|
|
605
|
+
* {@link wijmo.react.grid.FlexGridColumn} component. This cell type has an additional <b>context.value</b>
|
|
606
|
+
* property. In cases where columns have the <b>aggregate</b> property specified, it contains the unformatted
|
|
607
|
+
* aggregate value.
|
|
608
|
+
*
|
|
609
|
+
* For example, this template shows aggregate's value and kind for group row cells in the "Sales"
|
|
610
|
+
* column:
|
|
611
|
+
*
|
|
612
|
+
* ```html
|
|
613
|
+
* <wjGrid.FlexGridColumn header="Sales" binding="sales" aggregate="Avg">
|
|
614
|
+
* <wjGrid.FlexGridCellTemplate
|
|
615
|
+
* cellType="Group"
|
|
616
|
+
* template={ (context) => {
|
|
617
|
+
* return <React.Fragment>
|
|
618
|
+
* Average: {wjcCore.Globalize.formatNumber(context.value, 'N0')}
|
|
619
|
+
* </React.Fragment>
|
|
620
|
+
* }
|
|
621
|
+
* }
|
|
622
|
+
* />
|
|
623
|
+
* </wjGrid.FlexGridColumn>
|
|
624
|
+
* ```
|
|
625
|
+
*
|
|
626
|
+
* <b>ColumnFooter</b>
|
|
627
|
+
*
|
|
628
|
+
* Defines a template for a regular cell in a <b>columnFooters</b> panel. Must be a child of the
|
|
629
|
+
* {@link wijmo.react.grid.FlexGridColumn} component. This cell type provides an additional <b>context.value</b>
|
|
630
|
+
* property available for binding that contains an aggregated cell value.
|
|
631
|
+
*
|
|
632
|
+
* For example, this template shows aggregate's value and kind for a footer cell in the "Sales"
|
|
633
|
+
* column:
|
|
634
|
+
*
|
|
635
|
+
* ```html
|
|
636
|
+
* <wjGrid.FlexGridColumn header="Sales" binding="sales" aggregate="Avg">
|
|
637
|
+
* <wjGrid.FlexGridCellTemplate
|
|
638
|
+
* cellType="ColumnFooter"
|
|
639
|
+
* template={ (context) => {
|
|
640
|
+
* return <React.Fragment>
|
|
641
|
+
* Average: {wjcCore.Globalize.formatNumber(context.value, 'N0')}
|
|
642
|
+
* </React.Fragment>
|
|
643
|
+
* }
|
|
644
|
+
* }
|
|
645
|
+
* />
|
|
646
|
+
* </wjGrid.FlexGridColumn>
|
|
647
|
+
* ```
|
|
648
|
+
*
|
|
649
|
+
* <b>BottomLeft</b>
|
|
650
|
+
*
|
|
651
|
+
* Defines a template for the bottom left cells (at the intersection of the row header and column footer cells).
|
|
652
|
+
* Must be a child of the {@link wijmo.react.grid.FlexGrid} component.
|
|
653
|
+
* For example, this template shows a sigma glyph in the bottom-left cell of the grid:
|
|
654
|
+
*
|
|
655
|
+
* ```html
|
|
656
|
+
* <wjGrid.FlexGrid itemsSource={this.state.data}>
|
|
657
|
+
* <wjGrid.FlexGridCellTemplate
|
|
658
|
+
* cellType="BottomLeft"
|
|
659
|
+
* template={(context) => <span>Σ</span>} />
|
|
660
|
+
* </wjGrid.FlexGrid>
|
|
661
|
+
* ```
|
|
662
|
+
*
|
|
663
|
+
* <b>NewCellTemplate</b>
|
|
664
|
+
*
|
|
665
|
+
* Defines a cell in a new row template. Must be a child of the {@link wijmo.react.grid.FlexGridColumn} component.
|
|
666
|
+
* Note that the <b>context.item</b> property is undefined for this type of a cell.
|
|
667
|
+
* For example, this cell template shows a placeholder in the Date column's cell in the "new row" item:
|
|
668
|
+
*
|
|
669
|
+
* ```html
|
|
670
|
+
* <wjGrid.FlexGridColumn header="Date" binding="date">
|
|
671
|
+
* <wjGrid.FlexGridCellTemplate
|
|
672
|
+
* cellType="NewCellTemplate"
|
|
673
|
+
* template={ (context) => 'Enter a date here' } />
|
|
674
|
+
* </wjGrid.FlexGridColumn>
|
|
675
|
+
* ```
|
|
676
|
+
*/
|
|
677
|
+
export declare class FlexGridCellTemplate extends React.Component<any, any> {
|
|
678
|
+
static readonly _CellRenderFuncProp = "template";
|
|
679
|
+
grid: wjcGrid.FlexGrid;
|
|
680
|
+
column: wjcGrid.Column;
|
|
681
|
+
ownerControl: wjcGrid.FlexGrid | wjcGrid.Column;
|
|
682
|
+
cellType: CellTemplateType;
|
|
683
|
+
readonly cellOverflow: string;
|
|
684
|
+
readonly autoSizeRows: boolean;
|
|
685
|
+
readonly forceFullEdit: boolean;
|
|
686
|
+
readonly valuePaths: Object;
|
|
687
|
+
readonly template: CellTemplateRender;
|
|
688
|
+
componentDidMount(): void;
|
|
689
|
+
componentWillUnmount(): void;
|
|
690
|
+
componentDidUpdate(prevProps: any): void;
|
|
691
|
+
render(): any;
|
|
692
|
+
private _attachToControl;
|
|
693
|
+
private _detachFromControl;
|
|
694
|
+
}
|
|
695
|
+
export {};
|