@mescius/wijmo.angular.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 +497 -0
- package/index.js +14 -0
- package/package.json +48 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,497 @@
|
|
|
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.angular.grid}
|
|
15
|
+
* AngularJS directives for wijmo.grid module
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export declare var ___keepComment: any;
|
|
21
|
+
import { WjDirective, WjLink } from '@grapecity/wijmo.angular.base';
|
|
22
|
+
import * as wjcGrid from '@grapecity/wijmo.grid';
|
|
23
|
+
/**
|
|
24
|
+
* Angular module name, which can be used in the <b>angular.module(moduleName)</b>
|
|
25
|
+
* function to obtain a reference to the module .
|
|
26
|
+
*/
|
|
27
|
+
export declare const ngModuleName = "wj.grid";
|
|
28
|
+
/**
|
|
29
|
+
* AngularJS directive for the {@link FlexGrid} control.
|
|
30
|
+
*
|
|
31
|
+
* Use the <b>wj-flex-grid</b> directive to add grids to your AngularJS applications.
|
|
32
|
+
* Note that directive and parameter names must be formatted as lower-case with dashes
|
|
33
|
+
* instead of camel-case. For example:
|
|
34
|
+
*
|
|
35
|
+
* <pre><p>Here is a FlexGrid control:</p>
|
|
36
|
+
* <wj-flex-grid items-source="data">
|
|
37
|
+
* <wj-flex-grid-column
|
|
38
|
+
* header="Country"
|
|
39
|
+
* binding="country">
|
|
40
|
+
* </wj-flex-grid-column>
|
|
41
|
+
* <wj-flex-grid-column
|
|
42
|
+
* header="Sales"
|
|
43
|
+
* binding="sales">
|
|
44
|
+
* </wj-flex-grid-column>
|
|
45
|
+
* <wj-flex-grid-column
|
|
46
|
+
* header="Expenses"
|
|
47
|
+
* binding="expenses">
|
|
48
|
+
* </wj-flex-grid-column>
|
|
49
|
+
* <wj-flex-grid-column
|
|
50
|
+
* header="Downloads"
|
|
51
|
+
* binding="downloads">
|
|
52
|
+
* </wj-flex-grid-column>
|
|
53
|
+
* </wj-flex-grid></pre>
|
|
54
|
+
*
|
|
55
|
+
* The example below creates a FlexGrid control and binds it to a 'data' array
|
|
56
|
+
* exposed by the controller. The grid has three columns, each corresponding to
|
|
57
|
+
* a property of the objects contained in the source array.
|
|
58
|
+
*
|
|
59
|
+
* <a href="https://jsfiddle.net/Wijmo5/QNb9X/" target="_blank">Example</a>
|
|
60
|
+
*
|
|
61
|
+
* The <b>wj-flex-grid</b> directive supports the following attributes:
|
|
62
|
+
*
|
|
63
|
+
* <dl class="dl-horizontal">
|
|
64
|
+
* <dt>allow-add-new</dt> <dd><code>@</code> A value indicating whether to show a new row
|
|
65
|
+
* template so users can add items to the source collection.</dd>
|
|
66
|
+
* <dt>allow-delete</dt> <dd><code>@</code> A value indicating whether the grid deletes the
|
|
67
|
+
* selected rows when the Delete key is pressed.</dd>
|
|
68
|
+
* <dt>allow-dragging</dt> <dd><code>@</code> An {@link AllowDragging} value indicating
|
|
69
|
+
* whether and how the user can drag rows and columns with the mouse.</dd>
|
|
70
|
+
* <dt>allow-merging</dt> <dd><code>@</code> An {@link AllowMerging} value indicating
|
|
71
|
+
* which parts of the grid provide cell merging.</dd>
|
|
72
|
+
* <dt>allow-resizing</dt> <dd><code>@</code> An {@link AllowResizing} value indicating
|
|
73
|
+
* whether users are allowed to resize rows and columns with the mouse.</dd>
|
|
74
|
+
* <dt>allow-sorting</dt> <dd><code>@</code> A boolean value indicating whether users can sort
|
|
75
|
+
* columns by clicking the column headers.</dd>
|
|
76
|
+
* <dt>auto-generate-columns</dt> <dd><code>@</code> A boolean value indicating whether the grid generates
|
|
77
|
+
* columns automatically based on the <b>items-source</b>.</dd>
|
|
78
|
+
* <dt>child-items-path</dt> <dd><code>@</code> The name of the property used to generate
|
|
79
|
+
* child rows in hierarchical grids (or an array of property names if items
|
|
80
|
+
* at different hierarchical levels use different names for their child items).</dd>
|
|
81
|
+
* <dt>control</dt> <dd><code>=</code> A reference to the {@link FlexGrid} control
|
|
82
|
+
* created by this directive.</dd>
|
|
83
|
+
* <dt>defer-resizing</dt> <dd><code>=</code> A boolean value indicating whether row and column
|
|
84
|
+
* resizing should be deferred until the user releases the mouse button.</dd>
|
|
85
|
+
* <dt>frozen-columns</dt> <dd><code>@</code> The number of frozen (non-scrollable) columns in the grid.</dd>
|
|
86
|
+
* <dt>frozen-rows</dt> <dd><code>@</code> The number of frozen (non-scrollable) rows in the grid.</dd>
|
|
87
|
+
* <dt>group-header-format</dt> <dd><code>@</code> The format string used to create the group
|
|
88
|
+
* header content.</dd>
|
|
89
|
+
* <dt>headers-visibility</dt> <dd><code>=</code> A {@link HeadersVisibility} value
|
|
90
|
+
* indicating whether the row and column headers are visible. </dd>
|
|
91
|
+
* <dt>headers-focusibility</dt> <dd><code>=</code> A {@link HeadersFocusability} value
|
|
92
|
+
* indicatinf whether the row and column headers are focusible. </dd>
|
|
93
|
+
* <dt>ime-enabled</dt> <dd><code>@</code> Gets or sets a value that determines whether the grid should
|
|
94
|
+
* support Input Method Editors (IME) while not in edit mode.</dd>
|
|
95
|
+
* <dt>initialized</dt> <dd><code>&</code> This event occurs after the binding has finished
|
|
96
|
+
* initializing the control with attribute values.</dd>
|
|
97
|
+
* <dt>is-initialized</dt> <dd><code>=</code> A value indicating whether the binding has finished
|
|
98
|
+
* initializing the control with attribute values. </dd>
|
|
99
|
+
* <dt>item-formatter</dt> <dd><code>=</code> A function that customizes
|
|
100
|
+
* cells on this grid.</dd>
|
|
101
|
+
* <dt>items-source</dt> <dd><code>=</code> An array or {@link ICollectionView} object that
|
|
102
|
+
* contains the items shown on the grid.</dd>
|
|
103
|
+
* <dt>is-read-only</dt> <dd><code>@</code> A boolean value indicating whether the user is
|
|
104
|
+
* prevented from editing grid cells by typing into them.</dd>
|
|
105
|
+
* <dt>merge-manager</dt> <dd><code>=</code> A {@link MergeManager} object that specifies
|
|
106
|
+
* the merged extent of the specified cell.</dd>
|
|
107
|
+
* <dt>selection-mode</dt> <dd><code>@</code> A {@link SelectionMode} value
|
|
108
|
+
* indicating whether and how the user can select cells.</dd>
|
|
109
|
+
* <dt>show-groups</dt> <dd><code>@</code> A boolean value indicating whether to insert group
|
|
110
|
+
* rows to delimit data groups.</dd>
|
|
111
|
+
* <dt>show-sort</dt> <dd><code>@</code> A boolean value indicating whether to display sort
|
|
112
|
+
* indicators in the column headers.</dd>
|
|
113
|
+
* <dt>sort-row-index</dt> <dd><code>@</code> A number specifying the index of row in the column
|
|
114
|
+
* header panel that shows and changes the current sort.</dd>
|
|
115
|
+
* <dt>tree-indent</dt> <dd><code>@</code> The indentation, in pixels, used to offset row
|
|
116
|
+
* groups of different levels.</dd>
|
|
117
|
+
* <dt>beginning-edit</dt> <dd><code>&</code> Handler for the {@link FlexGrid.beginningEdit} event.</dd>
|
|
118
|
+
* <dt>cell-edit-ended</dt> <dd><code>&</code> Handler for the {@link FlexGrid.cellEditEnded} event.</dd>
|
|
119
|
+
* <dt>cell-edit-ending</dt> <dd><code>&</code> Handler for the {@link FlexGrid.cellEditEnding} event.</dd>
|
|
120
|
+
* <dt>prepare-cell-for-edit</dt> <dd><code>&</code> Handler for the {@link FlexGrid.prepareCellForEdit} event.</dd>
|
|
121
|
+
* <dt>resizing-column</dt> <dd><code>&</code> Handler for the {@link FlexGrid.resizingColumn} event.</dd>
|
|
122
|
+
* <dt>resized-column</dt> <dd><code>&</code> Handler for the {@link FlexGrid.resizedColumn} event.</dd>
|
|
123
|
+
* <dt>dragged-column</dt> <dd><code>&</code> Handler for the {@link FlexGrid.draggedColumn} event.</dd>
|
|
124
|
+
* <dt>dragging-column</dt> <dd><code>&</code> Handler for the {@link FlexGrid.draggingColumn} event.</dd>
|
|
125
|
+
* <dt>sorted-column</dt> <dd><code>&</code> Handler for the {@link FlexGrid.sortedColumn} event.</dd>
|
|
126
|
+
* <dt>sorting-column</dt> <dd><code>&</code> Handler for the {@link FlexGrid.sortingColumn} event.</dd>
|
|
127
|
+
* <dt>deleting-row</dt> <dd><code>&</code> Handler for the {@link FlexGrid.deletingRow} event.</dd>
|
|
128
|
+
* <dt>dragging-row</dt> <dd><code>&</code> Handler for the {@link FlexGrid.draggingRow} event.</dd>
|
|
129
|
+
* <dt>dragged-row</dt> <dd><code>&</code> Handler for the {@link FlexGrid.draggedRow} event.</dd>
|
|
130
|
+
* <dt>resizing-row</dt> <dd><code>&</code> Handler for the {@link FlexGrid.resizingRow} event.</dd>
|
|
131
|
+
* <dt>resized-row</dt> <dd><code>&</code> Handler for the {@link FlexGrid.resizedRow} event.</dd>
|
|
132
|
+
* <dt>row-added</dt> <dd><code>&</code> Handler for the {@link FlexGrid.rowAdded} event.</dd>
|
|
133
|
+
* <dt>row-edit-ended</dt> <dd><code>&</code> Handler for the {@link FlexGrid.rowEditEnded} event.</dd>
|
|
134
|
+
* <dt>row-edit-ending</dt> <dd><code>&</code> Handler for the {@link FlexGrid.rowEditEnding} event.</dd>
|
|
135
|
+
* <dt>loaded-rows</dt> <dd><code>&</code> Handler for the {@link FlexGrid.loadedRows} event.</dd>
|
|
136
|
+
* <dt>loading-rows</dt> <dd><code>&</code> Handler for the {@link FlexGrid.loadingRows} event.</dd>
|
|
137
|
+
* <dt>group-collapsed-changed</dt> <dd><code>&</code> Handler for the {@link FlexGrid.groupCollapsedChanged} event.</dd>
|
|
138
|
+
* <dt>group-collapsed-changing</dt> <dd><code>&</code> Handler for the {@link FlexGrid.groupCollapsedChanging} event.</dd>
|
|
139
|
+
* <dt>items-source-changed</dt> <dd><code>&</code> Handler for the {@link FlexGrid.itemsSourceChanged} event.</dd>
|
|
140
|
+
* <dt>selection-changing</dt> <dd><code>&</code> Handler for the {@link FlexGrid.selectionChanging} event.</dd>
|
|
141
|
+
* <dt>selection-changed</dt> <dd><code>&</code> Handler for the {@link FlexGrid.selectionChanged} event.</dd>
|
|
142
|
+
* <dt>got-focus</dt> <dd><code>&</code> Handler for the {@link FlexGrid.gotFocus} event.</dd>
|
|
143
|
+
* <dt>lost-focus</dt> <dd><code>&</code> Handler for the {@link FlexGrid.lostFocus} event.</dd>
|
|
144
|
+
* <dt>scroll-position-changed</dt> <dd><code>&</code> Handler for the {@link FlexGrid.scrollPositionChanged} event.</dd>
|
|
145
|
+
* </dl>
|
|
146
|
+
*
|
|
147
|
+
* The <b>wj-flex-grid</b> directive may contain {@link wijmo.angular.grid.WjFlexGridColumn}, {@link wijmo.angular.grid.WjFlexGridCellTemplate} and
|
|
148
|
+
* {@link wijmo.angular.grid.detail.WjFlexGridDetail} child directives.
|
|
149
|
+
*/
|
|
150
|
+
export declare class WjFlexGrid extends WjDirective {
|
|
151
|
+
_$compile: any;
|
|
152
|
+
_$interpolate: any;
|
|
153
|
+
constructor($compile: any, $interpolate: any);
|
|
154
|
+
readonly _controlConstructor: typeof wjcGrid.FlexGrid;
|
|
155
|
+
_createLink(): WjLink;
|
|
156
|
+
_initProps(): void;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* AngularJS directive for the {@link Column} object.
|
|
160
|
+
*
|
|
161
|
+
* The <b>wj-flex-grid-column</b> directive must be contained in a {@link wijmo.angular.grid.WjFlexGrid} directive.
|
|
162
|
+
* It supports the following attributes:
|
|
163
|
+
*
|
|
164
|
+
* <dl class="dl-horizontal">
|
|
165
|
+
* <dt>aggregate</dt> <dd><code>@</code> The {@link Aggregate} object to display in
|
|
166
|
+
* the group header rows for this column.</dd>
|
|
167
|
+
* <dt>align</dt> <dd><code>@</code> The string value that sets the horizontal
|
|
168
|
+
* alignment of items in the column to left, right, or center.</dd>
|
|
169
|
+
* <dt>allow-dragging</dt> <dd><code>@</code> The value indicating whether the user can move
|
|
170
|
+
* the column to a new position with the mouse.</dd>
|
|
171
|
+
* <dt>allow-sorting</dt> <dd><code>@</code> The value indicating whether the user can sort
|
|
172
|
+
* the column by clicking its header.</dd>
|
|
173
|
+
* <dt>allow-resizing</dt> <dd><code>@</code> The value indicating whether the user can
|
|
174
|
+
* resize the column with the mouse.</dd>
|
|
175
|
+
* <dt>allow-merging</dt> <dd><code>@</code> The value indicating whether the user can merge
|
|
176
|
+
* cells in the column.</dd>
|
|
177
|
+
* <dt>binding</dt> <dd><code>@</code> The name of the property to which the column is
|
|
178
|
+
* bound.</dd>
|
|
179
|
+
* <dt>css-class</dt> <dd><code>@</code> The name of a CSS class to use when
|
|
180
|
+
* rendering the column.</dd>
|
|
181
|
+
* <dt>data-map</dt> <dd><code>=</code> The {@link DataMap} object to use to convert raw
|
|
182
|
+
* values into display values for the column.</dd>
|
|
183
|
+
* <dt>data-type</dt> <dd><code>@</code> The enumerated {@link DataType} value that indicates
|
|
184
|
+
* the type of value stored in the column.</dd>
|
|
185
|
+
* <dt>format</dt> <dd><code>@</code> The format string to use to convert raw values
|
|
186
|
+
* into display values for the column (see {@link Globalize}).</dd>
|
|
187
|
+
* <dt>header</dt> <dd><code>@</code> The string to display in the column header.</dd>
|
|
188
|
+
* <dt>input-type</dt> <dd><code>@</code> The type attribute to specify the input element
|
|
189
|
+
* used to edit values in the column. The default is "tel" for numeric
|
|
190
|
+
* columns, and "text" for all other non-Boolean columns.</dd>
|
|
191
|
+
* <dt>is-content-html</dt> <dd><code>@</code> The value indicating whether cells in the column
|
|
192
|
+
* contain HTML content rather than plain text.</dd>
|
|
193
|
+
* <dt>is-read-only</dt> <dd><code>@</code> The value indicating whether the user is prevented
|
|
194
|
+
* from editing values in the column.</dd>
|
|
195
|
+
* <dt>is-selected</dt> <dd><code>@</code> The value indicating whether the column is selected.</dd>
|
|
196
|
+
* <dt>mask</dt> <dd><code>@</code> The mask string used to edit values in the
|
|
197
|
+
* column.</dd>
|
|
198
|
+
* <dt>max-width</dt> <dd><code>@</code> The maximum width for the column.</dd>
|
|
199
|
+
* <dt>min-width</dt> <dd><code>@</code> The minimum width for the column.</dd>
|
|
200
|
+
* <dt>name</dt> <dd><code>@</code> The column name. You can use it to retrieve the
|
|
201
|
+
* column.</dd>
|
|
202
|
+
* <dt>is-required</dt> <dd><code>@</code> The value indicating whether the column must contain
|
|
203
|
+
* non-null values.</dd>
|
|
204
|
+
* <dt>show-drop-down</dt> <dd><code>@</code> The value indicating whether to show drop-down buttons
|
|
205
|
+
* for editing based on the column's {@link DataMap}.</dd>
|
|
206
|
+
* <dt>visible</dt> <dd><code>@</code> The value indicating whether the column is visible.</dd>
|
|
207
|
+
* <dt>width</dt> <dd><code>@</code> The width of the column in pixels or as a
|
|
208
|
+
* star value.</dd>
|
|
209
|
+
* <dt>word-wrap</dt> <dd><code>@</code> The value indicating whether cells in the column wrap
|
|
210
|
+
* their content.</dd>
|
|
211
|
+
* </dl>
|
|
212
|
+
*
|
|
213
|
+
* Any html content within the <b>wj-flex-grid-column</b> directive is treated as a template for the cells in that column.
|
|
214
|
+
* The template is applied only to regular cells. If you wish to apply templates to specific cell types such as
|
|
215
|
+
* column or group headers, then please see the {@link wijmo.angular.grid.WjFlexGridCellTemplate} directive.
|
|
216
|
+
*
|
|
217
|
+
* The following example creates two columns with a template and a conditional style:
|
|
218
|
+
*
|
|
219
|
+
* <a href="https://jsfiddle.net/Wijmo5/5L423/" target="_blank">Example</a>
|
|
220
|
+
*
|
|
221
|
+
* The <b>wj-flex-grid-column</b> directive may contain {@link wijmo.angular.grid.WjFlexGridCellTemplate} child directives.
|
|
222
|
+
*/
|
|
223
|
+
export declare class WjFlexGridColumn extends WjDirective {
|
|
224
|
+
static _colTemplateProp: string;
|
|
225
|
+
static _colWjLinkProp: string;
|
|
226
|
+
static _cellCtxProp: string;
|
|
227
|
+
_$compile: any;
|
|
228
|
+
constructor($compile: any);
|
|
229
|
+
readonly _controlConstructor: typeof wjcGrid.Column;
|
|
230
|
+
_initControl(element: any): any;
|
|
231
|
+
_createLink(): WjLink;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Defines the type of cell to which the template applies.
|
|
235
|
+
* This value is specified in the <b>cell-type</b> attribute
|
|
236
|
+
* of the {@link wijmo.angular.grid.WjFlexGridCellTemplate} directive.
|
|
237
|
+
*/
|
|
238
|
+
export declare enum CellTemplateType {
|
|
239
|
+
/** Defines a regular (data) cell. */
|
|
240
|
+
Cell = 0,
|
|
241
|
+
/** Defines a cell in edit mode. */
|
|
242
|
+
CellEdit = 1,
|
|
243
|
+
/** Defines a column header cell. */
|
|
244
|
+
ColumnHeader = 2,
|
|
245
|
+
/** Defines a row header cell. */
|
|
246
|
+
RowHeader = 3,
|
|
247
|
+
/** Defines a row header cell in edit mode. */
|
|
248
|
+
RowHeaderEdit = 4,
|
|
249
|
+
/** Defines a top left cell. */
|
|
250
|
+
TopLeft = 5,
|
|
251
|
+
/** Defines a group header cell in a group row. */
|
|
252
|
+
GroupHeader = 6,
|
|
253
|
+
/** Defines a regular cell in a group row. */
|
|
254
|
+
Group = 7,
|
|
255
|
+
/** Defines a column footer cell. */
|
|
256
|
+
ColumnFooter = 8,
|
|
257
|
+
/** Defines a bottom left cell (at the intersection of the row header and column footer cells). **/
|
|
258
|
+
BottomLeft = 9
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* AngularJS directive for the {@link FlexGrid} cell templates.
|
|
262
|
+
*
|
|
263
|
+
* The <b>wj-flex-grid-cell-template</b> directive defines a template for a certain
|
|
264
|
+
* cell type in {@link FlexGrid}, and must contain a <b>cell-type</b> attribute that
|
|
265
|
+
* specifies the {@link CellTemplateType}. Depending on the template's cell type,
|
|
266
|
+
* the <b>wj-flex-grid-cell-template</b> directive must be a child of either {@link wijmo.angular.grid.WjFlexGrid}
|
|
267
|
+
* or {@link wijmo.angular.grid.WjFlexGridColumn} directives.
|
|
268
|
+
*
|
|
269
|
+
* Column-specific cell templates must be contained in <b>wj-flex-grid-column</b>
|
|
270
|
+
* directives, and cells that are not column-specific (like row header or top left cells)
|
|
271
|
+
* must be contained in the <b>wj-flex-grid directive</b>.
|
|
272
|
+
*
|
|
273
|
+
* In addition to an HTML fragment, <b>wj-flex-grid-cell-template</b> directives may
|
|
274
|
+
* contain an <b>ng-style</b> or <b>ng-class</b> attribute that provides conditional formatting for cells.
|
|
275
|
+
*
|
|
276
|
+
* Both the <b>ng-style/ng-class</b> attributes and the HTML fragment can use the <b>$col</b>,
|
|
277
|
+
* <b>$row</b> and <b>$item</b> template variables that refer to the {@link Column},
|
|
278
|
+
* {@link Row} and <b>Row.dataItem</b> objects pertaining to the cell.
|
|
279
|
+
*
|
|
280
|
+
* For cell types like <b>Group</b> and <b>CellEdit</b>, an additional <b>$value</b>
|
|
281
|
+
* variable containing an unformatted cell value is provided. For example, here is a
|
|
282
|
+
* FlexGrid control with templates for row headers and for the Country column's regular
|
|
283
|
+
* and column header cells:
|
|
284
|
+
*
|
|
285
|
+
* <pre><wj-flex-grid items-source="data">
|
|
286
|
+
* <wj-flex-grid-cell-template cell-type="RowHeader">
|
|
287
|
+
* {​{$row.index}}
|
|
288
|
+
* </wj-flex-grid-cell-template>
|
|
289
|
+
* <wj-flex-grid-cell-template cell-type="RowHeaderEdit">
|
|
290
|
+
* ...
|
|
291
|
+
* </wj-flex-grid-cell-template>
|
|
292
|
+
*
|
|
293
|
+
* <wj-flex-grid-column header="Country" binding="country">
|
|
294
|
+
* <wj-flex-grid-cell-template cell-type="ColumnHeader">
|
|
295
|
+
* <img ng-src="resources/globe.png" />
|
|
296
|
+
* {​{$col.header}}
|
|
297
|
+
* </wj-flex-grid-cell-template>
|
|
298
|
+
* <wj-flex-grid-cell-template cell-type="Cell">
|
|
299
|
+
* <img ng-src="resources/{​{$item.country}}.png" />
|
|
300
|
+
* {​{$item.country}}
|
|
301
|
+
* </wj-flex-grid-cell-template>
|
|
302
|
+
* </wj-flex-grid-column>
|
|
303
|
+
* <wj-flex-grid-column header="Sales" binding="sales"></wj-flex-grid-column>
|
|
304
|
+
* </wj-flex-grid></pre>
|
|
305
|
+
*
|
|
306
|
+
* For more detailed information on specific cell type templates refer to the
|
|
307
|
+
* documentation for the {@link CellTemplateType} enumeration.
|
|
308
|
+
*
|
|
309
|
+
* Note that the <b>wj-flex-grid-column</b> directive may also contain arbitrary content
|
|
310
|
+
* that is treated as a template for a regular data cell (<i>cell-type="Cell"</i>). But if
|
|
311
|
+
* a <b>wj-flex-grid-cell-template</b> directive exists and is set to <i>cell-type="Cell"</i>
|
|
312
|
+
* under the <b>wj-flex-grid-column</b> directive, it takes priority and overrides the
|
|
313
|
+
* arbitrary content.
|
|
314
|
+
*
|
|
315
|
+
* The <b>wj-flex-grid-cell-template</b> directive supports the following attributes:
|
|
316
|
+
*
|
|
317
|
+
* <dl class="dl-horizontal">
|
|
318
|
+
* <dt>cell-type</dt>
|
|
319
|
+
* <dd><code>@</code>
|
|
320
|
+
* The {@link CellTemplateType} value defining the type of cell the template applies to.
|
|
321
|
+
* </dd>
|
|
322
|
+
* <dt>auto-size-rows</dt>
|
|
323
|
+
* <dd><code>@</code>
|
|
324
|
+
* Indicates whether the cell template will increase grid's default row height to accommodate
|
|
325
|
+
* cells content. Defaults to true.
|
|
326
|
+
* </dd>
|
|
327
|
+
* <dt>cell-overflow</dt>
|
|
328
|
+
* <dd><code>@</code>
|
|
329
|
+
* Defines the <b>style.overflow</b> property value for cells.
|
|
330
|
+
* </dd>
|
|
331
|
+
* <dt>force-full-edit</dt>
|
|
332
|
+
* <dd><code>@</code>
|
|
333
|
+
* For cell edit templates, indicates whether cell editing forcibly starts in full edit mode,
|
|
334
|
+
* regardless of how the editing was initiated. In full edit mode pressing cursor keys don't finish editing.
|
|
335
|
+
* Defaults to true.
|
|
336
|
+
* </dd>
|
|
337
|
+
* </dl>
|
|
338
|
+
*
|
|
339
|
+
* The <b>cell-type</b> attribute takes any of the following enumerated values:
|
|
340
|
+
*
|
|
341
|
+
* <b>Cell</b>
|
|
342
|
+
*
|
|
343
|
+
* Defines a regular (data) cell template. Must be a child of the {@link wijmo.angular.grid.WjFlexGridColumn} directive.
|
|
344
|
+
* For example, this cell template shows flags in the Country column's cells:
|
|
345
|
+
*
|
|
346
|
+
* <pre><wj-flex-grid-column header="Country" binding="country">
|
|
347
|
+
* <wj-flex-grid-cell-template cell-type="Cell">
|
|
348
|
+
* <img ng-src="resources/{​{$item.country}}.png" />
|
|
349
|
+
* {​{$item.country}}
|
|
350
|
+
* </wj-flex-grid-cell-template>
|
|
351
|
+
* </wj-flex-grid-column></pre>
|
|
352
|
+
*
|
|
353
|
+
* For a hierarchical {@link FlexGrid} (that is, one with the <b>childItemsPath</b> property
|
|
354
|
+
* specified), if no <b>Group</b> template is provided, non-header cells in group rows in
|
|
355
|
+
* this {@link Column} also use this template.
|
|
356
|
+
*
|
|
357
|
+
* <b>CellEdit</b>
|
|
358
|
+
*
|
|
359
|
+
* Defines a template for a cell in edit mode. Must be a child of the {@link wijmo.angular.grid.WjFlexGridColumn} directive.
|
|
360
|
+
* This cell type has an additional <b>$value</b> property available for binding. It contains the
|
|
361
|
+
* original cell value before editing, and the updated value after editing.
|
|
362
|
+
|
|
363
|
+
* For example, here is a template that uses the Wijmo {@link InputNumber} control as an editor
|
|
364
|
+
* for the "Sales" column:
|
|
365
|
+
*
|
|
366
|
+
* <pre><wj-flex-grid-column header="Sales" binding="sales">
|
|
367
|
+
* <wj-flex-grid-cell-template cell-type="CellEdit">
|
|
368
|
+
* <wj-input-number value="$value" step="1"></wj-input-number>
|
|
369
|
+
* </wj-flex-grid-cell-template>
|
|
370
|
+
* </wj-flex-grid-column></pre>
|
|
371
|
+
*
|
|
372
|
+
* <b>ColumnHeader</b>
|
|
373
|
+
*
|
|
374
|
+
* Defines a template for a column header cell. Must be a child of the {@link wijmo.angular.grid.WjFlexGridColumn} directive.
|
|
375
|
+
* For example, this template adds an image to the header of the "Country" column:
|
|
376
|
+
*
|
|
377
|
+
* <pre><wj-flex-grid-column header="Country" binding="country">
|
|
378
|
+
* <wj-flex-grid-cell-template cell-type="ColumnHeader">
|
|
379
|
+
* <img ng-src="resources/globe.png" />
|
|
380
|
+
* {​{$col.header}}
|
|
381
|
+
* </wj-flex-grid-cell-template>
|
|
382
|
+
* </wj-flex-grid-column></pre>
|
|
383
|
+
*
|
|
384
|
+
* <b>RowHeader</b>
|
|
385
|
+
*
|
|
386
|
+
* Defines a template for a row header cell. Must be a child of the {@link wijmo.angular.grid.WjFlexGrid} directive.
|
|
387
|
+
* For example, this template shows row indices in the row headers:
|
|
388
|
+
*
|
|
389
|
+
* <pre><wj-flex-grid items-source="data">
|
|
390
|
+
* <wj-flex-grid-cell-template cell-type="RowHeader">
|
|
391
|
+
* {​{$row.index}}
|
|
392
|
+
* </wj-flex-grid-cell-template>
|
|
393
|
+
* </wj-flex-grid></pre>
|
|
394
|
+
*
|
|
395
|
+
* Note that this template is applied to a row header cell, even if it is in a row that is
|
|
396
|
+
* in edit mode. In order to provide an edit-mode version of a row header cell with alternate
|
|
397
|
+
* content, define the <b>RowHeaderEdit</b> template.
|
|
398
|
+
*
|
|
399
|
+
* <b>RowHeaderEdit</b>
|
|
400
|
+
*
|
|
401
|
+
* Defines a template for a row header cell in edit mode. Must be a child of the
|
|
402
|
+
* {@link wijmo.angular.grid.WjFlexGrid} directive. For example, this template shows dots in the header
|
|
403
|
+
* of rows being edited:
|
|
404
|
+
*
|
|
405
|
+
* <pre><wj-flex-grid items-source="data">
|
|
406
|
+
* <wj-flex-grid-cell-template cell-type="RowHeaderEdit">
|
|
407
|
+
* ...
|
|
408
|
+
* </wj-flex-grid-cell-template>
|
|
409
|
+
* </wj-flex-grid></pre>
|
|
410
|
+
*
|
|
411
|
+
* To add the standard edit-mode indicator to cells where the <b>RowHeader</b> template
|
|
412
|
+
* applies, use the following <b>RowHeaderEdit</b> template:
|
|
413
|
+
*
|
|
414
|
+
* <pre><wj-flex-grid items-source="data">
|
|
415
|
+
* <wj-flex-grid-cell-template cell-type="RowHeaderEdit">
|
|
416
|
+
* {​{&#x270e;}}
|
|
417
|
+
* </wj-flex-grid-cell-template>
|
|
418
|
+
* </wj-flex-grid></pre>
|
|
419
|
+
*
|
|
420
|
+
* <b>TopLeft</b>
|
|
421
|
+
*
|
|
422
|
+
* Defines a template for the top left cell. Must be a child of the {@link wijmo.angular.grid.WjFlexGrid} directive.
|
|
423
|
+
* For example, this template shows a down/right glyph in the top-left cell of the grid:
|
|
424
|
+
*
|
|
425
|
+
* <pre><wj-flex-grid items-source="data">
|
|
426
|
+
* <wj-flex-grid-cell-template cell-type="TopLeft">
|
|
427
|
+
* <span class="wj-glyph-down-right"></span>
|
|
428
|
+
* </wj-flex-grid-cell-template>
|
|
429
|
+
* </wj-flex-grid></pre>
|
|
430
|
+
*
|
|
431
|
+
* <p><b>GroupHeader</b></p>
|
|
432
|
+
*
|
|
433
|
+
* Defines a template for a group header cell in a {@link GroupRow}, Must be a child of the {@link wijmo.angular.grid.WjFlexGridColumn} directive.
|
|
434
|
+
*
|
|
435
|
+
* The <b>$row</b> variable contains an instance of the <b>GroupRow</b> class. If the grouping comes
|
|
436
|
+
* from the a {@link CollectionView}, the <b>$item</b> variable references the {@link CollectionViewGroup} object.
|
|
437
|
+
*
|
|
438
|
+
* For example, this template uses a checkbox element as an expand/collapse toggle:
|
|
439
|
+
*
|
|
440
|
+
* <pre><wj-flex-grid-column header="Country" binding="country">
|
|
441
|
+
* <wj-flex-grid-cell-template cell-type="GroupHeader">
|
|
442
|
+
* <input type="checkbox" ng-model="$row.isCollapsed"/>
|
|
443
|
+
* {​{$item.name}} ({​{$item.items.length}} items)
|
|
444
|
+
* </wj-flex-grid-cell-template>
|
|
445
|
+
* </wj-flex-grid-column></pre>
|
|
446
|
+
*
|
|
447
|
+
* <b>Group</b>
|
|
448
|
+
*
|
|
449
|
+
* Defines a template for a regular cell (not a group header) in a {@link GroupRow}. Must be a child of the
|
|
450
|
+
* {@link wijmo.angular.grid.WjFlexGridColumn} directive. This cell type has an additional <b>$value</b> varible available for
|
|
451
|
+
* binding. In cases where columns have the <b>aggregate</b> property specified, it contains the unformatted
|
|
452
|
+
* aggregate value.
|
|
453
|
+
*
|
|
454
|
+
* For example, this template shows an aggregate's value and kind for group row cells in the "Sales"
|
|
455
|
+
* column:
|
|
456
|
+
*
|
|
457
|
+
* <pre><wj-flex-grid-column header="Sales" binding="sales" aggregate="Avg">
|
|
458
|
+
* <wj-flex-grid-cell-template cell-type="Group">
|
|
459
|
+
* Average: {​{$value | number:2}}
|
|
460
|
+
* </wj-flex-grid-cell-template>
|
|
461
|
+
* </wj-flex-grid-column></pre>
|
|
462
|
+
*
|
|
463
|
+
* <b>ColumnFooter</b>
|
|
464
|
+
*
|
|
465
|
+
* Defines a template for a regular cell in a <b>columnFooters</b> panel. Must be a child of the
|
|
466
|
+
* {@link wijmo.angular.grid.WjFlexGridColumn} directive. This cell type has an additional <b>$value</b>
|
|
467
|
+
* property available for binding that contains a cell value.
|
|
468
|
+
*
|
|
469
|
+
* For example, this template shows aggregate's value and kind for a footer cell in the "Sales"
|
|
470
|
+
* column:
|
|
471
|
+
*
|
|
472
|
+
* <pre><wj-flex-grid-column header="Sales" binding="sales" aggregate="Avg">
|
|
473
|
+
* <wj-flex-grid-cell-template cell-type="ColumnFooter">
|
|
474
|
+
* Average: {​{$value | number:2}}
|
|
475
|
+
* </wj-flex-grid-cell-template>
|
|
476
|
+
* </wj-flex-grid-column></pre>
|
|
477
|
+
*
|
|
478
|
+
* <b>BottomLeft</b>
|
|
479
|
+
*
|
|
480
|
+
* Defines a template for the bottom left cells (at the intersection of the row header and column footer cells).
|
|
481
|
+
* Must be a child of the {@link wijmo.angular.grid.WjFlexGrid} directive.
|
|
482
|
+
* For example, this template shows a sigma glyph in the bottom-left cell of the grid:
|
|
483
|
+
*
|
|
484
|
+
* <pre><wj-flex-grid items-source="data">
|
|
485
|
+
* <wj-flex-grid-cell-template cell-type="BottomLeft">
|
|
486
|
+
* &#931;
|
|
487
|
+
* </wj-flex-grid-cell-template>
|
|
488
|
+
* </wj-flex-grid></pre>
|
|
489
|
+
*/
|
|
490
|
+
export declare class WjFlexGridCellTemplate extends WjDirective {
|
|
491
|
+
static _tagName: string;
|
|
492
|
+
static _getTemplContextProp(templateType: CellTemplateType): string;
|
|
493
|
+
constructor();
|
|
494
|
+
_initControl(element: any): any;
|
|
495
|
+
_createLink(): WjLink;
|
|
496
|
+
_getMetaDataId(): any;
|
|
497
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
"use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var l in t)t.hasOwnProperty(l)&&(e[l]=t[l])})(e,t)};return function(e,t){extendStatics(e,t);function __(){this.constructor=e}e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}}(),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var l in e)Object.hasOwnProperty.call(e,l)&&(t[l]=e[l]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});var wijmo_angular_base_1=require("@mescius/wijmo.angular.base"),wijmo_1=require("@mescius/wijmo"),mNg=__importStar(require("angular")),wjcGrid=__importStar(require("@mescius/wijmo.grid")),wjNg=mNg,wijmoGridName="wj.grid";exports.ngModuleName=wijmoGridName;var wijmoGrid=wijmo_angular_base_1._registerNgModule(wijmoGridName);if(wijmo_angular_base_1.softRefGrid()&&wijmo_angular_base_1.softRefGrid().FlexGrid){wijmoGrid.directive("wjFlexGrid",["$compile","$interpolate",function(e,t){return new WjFlexGrid(e,t)}]);wijmoGrid.directive("wjFlexGridColumn",["$compile",function(e){return new WjFlexGridColumn(e)}]);wijmoGrid.directive("wjFlexGridCellTemplate",[function(){return new WjFlexGridCellTemplate}])}var WjFlexGrid=function(e){__extends(WjFlexGrid,e);function WjFlexGrid(t,l){var i=e.call(this)||this;i._$compile=t;i._$interpolate=l;i.transclude=!0;i.template="<div ng-transclude />";return i}Object.defineProperty(WjFlexGrid.prototype,"_controlConstructor",{get:function(){return wjcGrid.FlexGrid},enumerable:!0,configurable:!0});WjFlexGrid.prototype._createLink=function(){return new WjFlexGridLink};WjFlexGrid.prototype._initProps=function(){var e=wijmo_angular_base_1.MetaFactory.findProp("childItemsPath",this._props);e.scopeBindingMode="@";e.customHandler=function(e,t,l,i,r){if(l&&(l=l.trim())&&"["===l[0]){var o=e.$parent.$eval(l);t.childItemsPath=o;return!0}return!1}};return WjFlexGrid}(wijmo_angular_base_1.WjDirective);exports.WjFlexGrid=WjFlexGrid;var WjFlexGridLink=function(e){__extends(WjFlexGridLink,e);function WjFlexGridLink(){return null!==e&&e.apply(this,arguments)||this}WjFlexGridLink.prototype._initControl=function(){var t=e.prototype._initControl.call(this);new DirectiveCellFactory(t,this);return t};return WjFlexGridLink}(wijmo_angular_base_1.WjLink),gridModule=wjcGrid&&wjcGrid.CellFactory;if(!gridModule){window.wijmo.grid={};window.wijmo.grid.CellFactory=function(){}}var DirectiveCellFactory=function(e){__extends(DirectiveCellFactory,e);function DirectiveCellFactory(t,l){var i=e.call(this)||this;i._lastApplyTimeStamp=0;i._noApplyLag=!1;i._startingEditing=!1;i._cellStampCounter=0;i._composing=!1;i._grid=t;i._gridLink=l;i._rowHeightUpdates=new _RowHeightUpdateQueue(i);if(!DirectiveCellFactory._templateTypes){DirectiveCellFactory._templateTypes=[];for(var r in CellTemplateType)isNaN(r)&&DirectiveCellFactory._templateTypes.push(r)}var o=i;i._baseCf=t.cellFactory;t.cellFactory=i;i._evtInput=document.createEvent("HTMLEvents");i._evtInput.initEvent("input",!0,!1);i._evtChange=document.createEvent("HTMLEvents");i._evtChange.initEvent("change",!0,!1);i._evtBlur=document.createEvent("HTMLEvents");i._evtBlur.initEvent("blur",!1,!1);t.prepareCellForEdit.addHandler((function(e,t){o._noApplyLag=!0}));t.cellEditEnded.addHandler((function(e,l){(l.range.col<0||!t.columns[l.range.col][WjFlexGridCellTemplate._getTemplContextProp(CellTemplateType.CellEdit)])&&(o._editChar=null);setTimeout((function(){o._noApplyLag=!1}),300)}));t.beginningEdit.addHandler((function(e,t){!t.data||t.data instanceof KeyboardEvent&&!(t.data.charCode<=32)||(o._editChar=null);o._startingEditing=!0}));t.hostElement.addEventListener("keydown",(function(e){o._startingEditing=!1}),!0);t.hostElement.addEventListener("keypress",(function(e){var l=e.charCode>32?String.fromCharCode(e.charCode):null;l&&wijmo_1.closest(e.target,".wj-flexgrid")===t.hostElement&&(!t.activeEditor||o._startingEditing?o._editChar=l:o._editChar&&(o._editChar+=l))}),!0);t.hostElement.addEventListener("compositionstart",(function(e){o._composing=!0}),!0);t.hostElement.addEventListener("compositionend",(function(e){o._composing=!1}),!0);return i}DirectiveCellFactory.prototype.updateCell=function(e,t,l,i,r){var o=this;this._cellStampCounter=(this._cellStampCounter+1)%1e7;var n=i[DirectiveCellFactory._cellStampProp]=this._cellStampCounter;i.style.overflow&&(i.style.overflow="");var a=t,p=l;if(r&&!r.isSingleCell){t=r.row;l=r.col}var c,s=this,d=e.grid,u=d.editRange,m=e.rows[t],_=m.dataItem,C=!1,f=!1,h=!1,v=!1;switch(e.cellType){case wjcGrid.CellType.Cell:if(u&&u.row===t&&u.col===l){c=CellTemplateType.CellEdit;f=h=!0}else if(m instanceof wjcGrid.GroupRow){var y=!((v=_ instanceof wijmo_1.CollectionViewGroup)||m.hasChildren);if(l==e.columns.firstVisibleIndex)c=y?CellTemplateType.Cell:CellTemplateType.GroupHeader;else{c=y?CellTemplateType.Cell:CellTemplateType.Group;f=!0}}else wijmo_angular_base_1.softRefGridDetail()&&wijmo_angular_base_1.softRefGridDetail().DetailRow&&m instanceof wijmo_angular_base_1.softRefGridDetail().DetailRow||(c=CellTemplateType.Cell);break;case wjcGrid.CellType.ColumnHeader:c=CellTemplateType.ColumnHeader;break;case wjcGrid.CellType.RowHeader:c=d.collectionView&&d.collectionView.currentEditItem===_?CellTemplateType.RowHeaderEdit:CellTemplateType.RowHeader;C=!0;break;case wjcGrid.CellType.TopLeft:c=CellTemplateType.TopLeft;C=!0;break;case wjcGrid.CellType.ColumnFooter:c=CellTemplateType.ColumnFooter;f=!0;break;case wjcGrid.CellType.BottomLeft:c=CellTemplateType.BottomLeft;C=!0}var j=!1;if(null!=c){var w=v&&c==CellTemplateType.GroupHeader?d.getColumn(_.groupDescription.propertyName):l>=0&&l<e.columns.length?e.columns[l]:null;if(w){var g=WjFlexGridCellTemplate._getTemplContextProp(c),T=(C?d:w)[g];if(!T)if(c===CellTemplateType.RowHeaderEdit){c=CellTemplateType.RowHeader;g=WjFlexGridCellTemplate._getTemplContextProp(c);T=d[g]}else if((c===CellTemplateType.Group||c===CellTemplateType.GroupHeader)&&!v){c=CellTemplateType.Cell;g=WjFlexGridCellTemplate._getTemplContextProp(c);T=w[g]}if(T){var F,G=s._getCellTemplate(T.cellTemplate),x=T.cellStyle,E=T.cellClass,W=!wijmo_1.isNullOrWhiteSpace(G),L=!wijmo_1.isNullOrWhiteSpace(x),S=!wijmo_1.isNullOrWhiteSpace(E);f&&(F=e.getCellData(t,l,!1));if(W){var H=i.getAttribute(wjcGrid.FlexGrid._WJS_MEASURE),D=H&&"true"===H.toLowerCase();j=!0;h&&this._baseCf.updateCell(e,a,p,i,r,!0);var b=i[g]||{},k=b.column!==w||!b.cellScope||!b.cellScope.$root,$=h&&this._composing&&d.imeEnabled,R=b.cellScope;if(k){this._doDisposeCell(i);b.cellScope=R=T.templLink.scope.$parent.$new();b.column=w;i[g]=b}var P=R.$row!==m||R.$col!==w||R.$item!==_||R.$value!==F;P&&s._initCellScope(R,m,w,_,F);var A=T.cellLink;A||(A=T.cellLink=this._gridLink.directive._$compile('<div style="display:none"'+(L?' ng-style="'+x+'"':"")+(S?' ng-class="'+E+'"':"")+">"+G+"</div>"));var I=b.clonedElement;if(k){var O=R.$watch((function(t){if(I){O();I[0].style.display="";if(e.cellType===wjcGrid.CellType.ColumnHeader||e.cellType===wjcGrid.CellType.TopLeft){var l=I[0].style,i=l.outlineColor,r=l.outlineWidth;l.outlineColor="white";l.outlineWidth="0px";setTimeout((function(){l.outlineColor=i;l.outlineWidth=r}),0)}}}));b.clonedElement=I=A(R,(function(e,t){}))}D&&(I[0].style.display="");var N=!1;if(h){var M=i.firstElementChild;if(M){$||i.focus();M.style.display="none"}}else(N=1==i.childNodes.length)||(i.textContent="");N?I[0]!==i.firstChild&&i.replaceChild(I[0],i.firstChild):i.appendChild(I[0]);T.cellOverflow&&(i.style.overflow=T.cellOverflow);this._closingApplyTimeOut&&clearTimeout(this._closingApplyTimeOut);s._rowHeightUpdates.add({panel:e,cell:i,rng:r,cellStamp:n,templateContext:T});if(D||u||this._noApplyLag||P&&Date.now()-this._lastApplyTimeStamp>40){clearTimeout(this._closingApplyTimeOut);R.$root&&!R.$root.$$phase&&R.$apply();u||D||s._rowHeightUpdates.execute();this._lastApplyTimeStamp=Date.now()}else{clearTimeout(this._closingApplyTimeOut);this._closingApplyTimeOut=setTimeout((function(){clearTimeout(this._closingApplyTimeOut);R.$root&&!R.$root.$$phase&&R.$apply();s._rowHeightUpdates.execute()}),10)}$?h&&setTimeout((function(){$?o._initImeEditInput(b,T):o._initEditInput(b,T,null)}),0):setTimeout((function(){if(s._updateRowHeight(e,i,r,n,T)){if(h){s._rowHeightUpdates.clear();var t=s._isFullEdit();d.refresh();d.startEditing(t);return}}else h&&s._initEditInput(b,T,null)}),0);if(h){s._cellEditorScope=R;var editEndingEH=function(r,o){d.cellEditEnding.removeHandler(editEndingEH);if(!o.stayInEditMode){var n=wijmo_1.getActiveElement();n&&n.dispatchEvent(s._evtBlur);wijmo_1.contains(i,wijmo_1.getActiveElement())&&i.focus()}if(!o.cancel&&!o.stayInEditMode){o.cancel=!0;e.grid.setCellData(t,l,R.$value)}var a=i.querySelectorAll(".wj-dropdown");[].forEach.call(a,(function(e){var t=wijmo_1.Control.getControl(e);t&&wijmo_angular_base_1.softRefInput()&&t instanceof wijmo_angular_base_1.softRefInput().DropDown&&(t.isDroppedDown=!1)}))};d.cellEditEnding.addHandler(editEndingEH);d.cellEditEnded.addHandler((function(){s._cellEditorScope=null}))}else this._baseCf.updateCell(e,a,p,i,r,!1)}}}}if(!j){this._doDisposeCell(i);this._baseCf.updateCell(e,a,p,i,r)}if(!W&&(L||S)){var U=s._initCellScope({},m,w,_,F),q=L?this._gridLink.scope.$parent.$eval(x,U):null,B=S?this._gridLink.scope.$parent.$eval(E,U):null;if(q||B){for(var V=document.createElement("div");i.firstChild;)V.appendChild(i.firstChild);i.appendChild(V);if(q)for(var Q in q)V.style[Q]=q[Q];if(B){for(var z=wijmo_1.isArray(B)?B:[B],J="",K=0;K<z.length;K++){var X=z[K];if(X)if(wijmo_1.isString(X))J+=" "+X;else for(var Y in X)X[Y]&&(J+=" "+Y)}V.className=J}}}};DirectiveCellFactory.prototype.getEditorValue=function(t){return this._cellEditorScope?this._cellEditorScope.$value:e.prototype.getEditorValue.call(this,t)};DirectiveCellFactory.prototype.disposeCell=function(e){this._doDisposeCell(e)};DirectiveCellFactory.prototype._doDisposeCell=function(e){for(var t=DirectiveCellFactory._templateTypes,l=0;l<t.length;l++){var i=WjFlexGridCellTemplate._getTemplContextProp(CellTemplateType[t[l]]),r=e[i];if(r&&r.cellScope&&r.cellScope.$root){r.cellScope.$destroy();if(r.clonedElement){r.clonedElement.remove();r.clonedElement=null}e[i]=null}}};DirectiveCellFactory.prototype._updateRowHeight=function(e,t,l,i,r){if(r.autoSizeRows){var o=t.scrollHeight,n=e.rows,a=l&&l.rowSpan||1;if(i===t[DirectiveCellFactory._cellStampProp]&&n.defaultSize*a<o){n.defaultSize=o/a;return!0}}return!1};DirectiveCellFactory.prototype._initCellScope=function(e,t,l,i,r){e.$row=t;e.$col=l;e.$item=i;e.$value=r;return e};DirectiveCellFactory.prototype._getCellTemplate=function(e){e&&(e=(e=(e=e.replace(/ class\=\"ng\-scope\"( \"ng\-binding\")?/g,"")).replace(/<span>\s*<\/span>/g,"")).trim());return e};DirectiveCellFactory.prototype._isFullEdit=function(){var e=this._grid;return!e.activeEditor||e._edtHdl._fullEdit};DirectiveCellFactory.prototype._setFullEdit=function(e){var t=this._grid;e.forceFullEdit&&t.activeEditor&&(t._edtHdl._fullEdit=!0)};DirectiveCellFactory.prototype._initEditInput=function(e,t,l){var i=this;this._setFullEdit(t);var r=this._findInitialInput(e);if(r){var inpFocusEh_1=function(){r.removeEventListener("focus",inpFocusEh_1);setTimeout((function(){var e=null!=l?l:i._editChar;if(e){r.value=e;i._editChar=null;DirectiveCellFactory._setSelectionRange(r,e.length,e.length);!DirectiveCellFactory.isNgIE||wijmo_1.hasClass(r,"wj-form-control")||r.getAttribute("wj-part")?r.dispatchEvent(i._evtInput):r.dispatchEvent(i._evtChange)}}),DirectiveCellFactory._FOCUS_INTERVAL)};r.addEventListener("focus",inpFocusEh_1);r.focus()}};DirectiveCellFactory.prototype._initImeEditInput=function(e,t){var l=this,i=wijmo_1.getActiveElement();if(i&&i instanceof HTMLInputElement&&wijmo_1.hasClass(i,"wj-grid-ime")){var compEndEh_1=function(r){i.removeEventListener("compositionend",compEndEh_1);wijmo_1.setCss(i,wjcGrid._ImeHandler._cssHidden);l._initEditInput(e,t,i.value)};i.addEventListener("compositionend",compEndEh_1);var r=this._findInitialInput(e);if(r){var o=r.getBoundingClientRect(),n=i.getBoundingClientRect(),a=window.getComputedStyle(i),p=parseFloat(a.left),c=parseFloat(a.top);wijmo_1.setCss(i,{left:p+o.left-n.left+"px",top:c+o.top-n.top+"px",width:o.width+"px",height:o.height+"px"})}}};DirectiveCellFactory.prototype._findInitialInput=function(e){var t=e.clonedElement[0].querySelectorAll("input,textarea");if(t)for(var l=0;l<t.length;l++){var i=t[l],r=window.getComputedStyle(i);if("none"!==r.display&&"visible"===r.visibility)return i}return null};DirectiveCellFactory._setSelectionRange=function(e,t,l){void 0===l&&(l=t);if(wijmo_1.contains(document.body,e)&&!e.disabled&&"none"!=e.style.display)try{e.setSelectionRange(wijmo_1.asNumber(t),wijmo_1.asNumber(l),wijmo_1.isIE()?null:"backward");e.focus()}catch(e){}};DirectiveCellFactory._cellStampProp="__wjCellStamp";DirectiveCellFactory._FOCUS_INTERVAL=wijmo_1.Control._FOCUS_INTERVAL+20;DirectiveCellFactory.isNgIE=!!document.documentMode;return DirectiveCellFactory}(wjcGrid.CellFactory),_RowHeightUpdateQueue=function(){function _RowHeightUpdateQueue(e){this._requests=[];this._timeOuts=[];this._cellFactory=e}_RowHeightUpdateQueue.prototype.add=function(e){this._requests.push(e)};_RowHeightUpdateQueue.prototype.execute=function(){for(var e=this._requests;e.length>0;){var t=this._requests.shift(),l=this,i=function(e){return setTimeout((function(){if(l._cellFactory._updateRowHeight(e.panel,e.cell,e.rng,e.cellStamp,e.templateContext))l.clear();else{var t=l._timeOuts.indexOf(i);t>-1&&l._timeOuts.splice(t,1)}}),0)}(t);this._timeOuts.push(i)}};_RowHeightUpdateQueue.prototype.clear=function(){this._requests.splice(0,this._requests.length);this._clearTimeouts()};_RowHeightUpdateQueue.prototype._clearTimeouts=function(){for(var e=this._timeOuts,t=0;t<e.length;t++)clearTimeout(e[t]);e.splice(0,e.length)};return _RowHeightUpdateQueue}();gridModule||(window.wijmo.grid=null);var WjFlexGridColumn=function(e){__extends(WjFlexGridColumn,e);function WjFlexGridColumn(t){var l=e.call(this)||this;l._$compile=t;l.scope.dataMap+="map";l.scope.dataType+="type";l.require="^wjFlexGrid";l.terminal=!0;if(wijmo_angular_base_1.WjDirective._dynaTemplates){l.transclude=!1;l.priority=100;l.template=function(e,t){t[WjFlexGridColumn._colTemplateProp]=e[0].innerHTML;return'<div class="wjGridColumn"/>'}}else{l.transclude=!0;l.template='<div class="wjGridColumn" ng-transclude/>'}return l}Object.defineProperty(WjFlexGridColumn.prototype,"_controlConstructor",{get:function(){return wjcGrid.Column},enumerable:!0,configurable:!0});WjFlexGridColumn.prototype._initControl=function(e){return new wjcGrid.Column};WjFlexGridColumn.prototype._createLink=function(){return new WjFlexGridColumnLink};WjFlexGridColumn._colTemplateProp="$__wjColTemplate";WjFlexGridColumn._colWjLinkProp="$__wjLink";WjFlexGridColumn._cellCtxProp="$_cellCtxProp";return WjFlexGridColumn}(wijmo_angular_base_1.WjDirective);exports.WjFlexGridColumn=WjFlexGridColumn;var CellTemplateType,WjFlexGridColumnLink=function(e){__extends(WjFlexGridColumnLink,e);function WjFlexGridColumnLink(){return null!==e&&e.apply(this,arguments)||this}WjFlexGridColumnLink.prototype._initParent=function(){var t=this.parent.control;if(t.autoGenerateColumns){t.autoGenerateColumns=!1;this._safeApply(this.scope,"autoGenerateColumns",!1);t.columns.clear()}e.prototype._initParent.call(this);var l=WjFlexGridCellTemplate._getTemplContextProp(CellTemplateType.Cell),i=this.control[l],r=this[WjFlexGridColumn._cellCtxProp];!i&&r&&(this.control[l]=r);this.control[WjFlexGridColumn._colWjLinkProp]=this};WjFlexGridColumnLink.prototype._link=function(){var t=this.tElement[0],l=this.tAttrs[WjFlexGridColumn._colTemplateProp],i=null!=l?l:wijmo_angular_base_1.WjDirective._removeTransclude(t.innerHTML),r={};if(!wijmo_1.isNullOrWhiteSpace(i)){var o=document.createElement("div");o.innerHTML=i;var n,a=[];[].forEach.call(o.children,(function(e){a.push(e)}));for(var p=0;p<a.length;p++){var c=a[p];if(c.tagName.toLocaleLowerCase()===WjFlexGridCellTemplate._tagName){n||(n=this.scope.$parent.$new());o.removeChild(c);t.appendChild(c);this.directive._$compile(c)(n)}}var s=o.innerHTML;wijmo_1.isNullOrWhiteSpace(s)||(r.cellTemplate=s)}var d=this.tAttrs.ngStyle,u=this.tAttrs.ngClass;d&&(r.cellStyle=d);u&&(r.cellClass=u);if(r.cellTemplate||r.cellStyle||r.cellClass){r.templLink=this;this[WjFlexGridColumn._cellCtxProp]=r}e.prototype._link.call(this)};return WjFlexGridColumnLink}(wijmo_angular_base_1.WjLink);!function(e){e[e.Cell=0]="Cell";e[e.CellEdit=1]="CellEdit";e[e.ColumnHeader=2]="ColumnHeader";e[e.RowHeader=3]="RowHeader";e[e.RowHeaderEdit=4]="RowHeaderEdit";e[e.TopLeft=5]="TopLeft";e[e.GroupHeader=6]="GroupHeader";e[e.Group=7]="Group";e[e.ColumnFooter=8]="ColumnFooter";e[e.BottomLeft=9]="BottomLeft"}(CellTemplateType=exports.CellTemplateType||(exports.CellTemplateType={}));var WjFlexGridCellTemplate=function(e){__extends(WjFlexGridCellTemplate,e);function WjFlexGridCellTemplate(){var t=e.call(this)||this;t.require=["?^wjFlexGridColumn","?^wjFlexGrid"];t.terminal=!0;if(wijmo_angular_base_1.WjDirective._dynaTemplates){t.transclude=!1;t.priority=100;t.template=function(e,t){t[WjFlexGridColumn._colTemplateProp]=e[0].innerHTML;return"<div />"}}else{t.transclude=!0;t.template="<div ng-transclude/>"}return t}WjFlexGridCellTemplate._getTemplContextProp=function(e){return"$__cellTempl"+CellTemplateType[e]};WjFlexGridCellTemplate.prototype._initControl=function(e){return{}};WjFlexGridCellTemplate.prototype._createLink=function(){return new WjFlexGridCellTemplateLink};WjFlexGridCellTemplate.prototype._getMetaDataId=function(){return"FlexGridCellTemplate"};WjFlexGridCellTemplate._tagName="wj-flex-grid-cell-template";return WjFlexGridCellTemplate}(wijmo_angular_base_1.WjDirective);exports.WjFlexGridCellTemplate=WjFlexGridCellTemplate;var WjFlexGridCellTemplateLink=function(e){__extends(WjFlexGridCellTemplateLink,e);function WjFlexGridCellTemplateLink(){return null!==e&&e.apply(this,arguments)||this}WjFlexGridCellTemplateLink.prototype._initParent=function(){e.prototype._initParent.call(this);var t,l=this.scope.cellType;if(l){t=CellTemplateType[l];var i=this.tAttrs[WjFlexGridColumn._colTemplateProp],r=null!=i?i:wijmo_angular_base_1.WjDirective._removeTransclude(this.tElement[0].innerHTML),o=this.control;wijmo_1.isNullOrWhiteSpace(r)||(o.cellTemplate=r);var n=this.tAttrs.ngStyle,a=this.tAttrs.ngClass;n&&(o.cellStyle=n);a&&(o.cellClass=a);this.tAttrs.forceFullEdit||(o.forceFullEdit=!0);var p=this.tAttrs.autoSizeRows;o.autoSizeRows=null==p||"true"===p;if(o.cellTemplate||o.cellStyle||o.cellClass){o.templLink=this;var c=this.parent.control;c[WjFlexGridCellTemplate._getTemplContextProp(t)]=o;c instanceof wjcGrid.Column&&c._setFlag(wjcGrid.RowColFlags.HasTemplate,!0)}WjFlexGridCellTemplateLink._invalidateGrid(this.parent.control)}};WjFlexGridCellTemplateLink.prototype._destroy=function(){var t=this.parent&&this.parent.control,l=this.scope.cellType;e.prototype._destroy.call(this);if(l){t[WjFlexGridCellTemplate._getTemplContextProp(CellTemplateType[l])]=void 0;WjFlexGridCellTemplateLink._invalidateGrid(t)}};WjFlexGridCellTemplateLink._invalidateGrid=function(e){var t=e;if(t){t instanceof wjcGrid.Column&&(t=t.grid);t&&t.invalidate()}};return WjFlexGridCellTemplateLink}(wijmo_angular_base_1.WjLink);
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mescius/wijmo.angular.grid",
|
|
3
|
+
"version": "5.20232.939",
|
|
4
|
+
"description": "UI library for pure JS, Angular, React, Vue and more...",
|
|
5
|
+
"author": "MESCIUS inc",
|
|
6
|
+
"license": "Commercial",
|
|
7
|
+
"main": "./index.js",
|
|
8
|
+
"types": "./index.d.ts",
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@mescius/wijmo": "5.20232.939",
|
|
11
|
+
"@mescius/wijmo.grid": "5.20232.939",
|
|
12
|
+
"@mescius/wijmo.input": "5.20232.939",
|
|
13
|
+
"@mescius/wijmo.grid.detail": "5.20232.939",
|
|
14
|
+
"@mescius/wijmo.angular.base": "5.20232.939"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://developer.mescius.com/wijmo",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://developer.mescius.com/forums/wijmo"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"control",
|
|
22
|
+
"component",
|
|
23
|
+
"ui",
|
|
24
|
+
"control library",
|
|
25
|
+
"component library",
|
|
26
|
+
"ui library",
|
|
27
|
+
"control-library",
|
|
28
|
+
"component-library",
|
|
29
|
+
"ui-library",
|
|
30
|
+
"grid",
|
|
31
|
+
"data grid",
|
|
32
|
+
"data-grid",
|
|
33
|
+
"datagrid",
|
|
34
|
+
"angular grid",
|
|
35
|
+
"react grid",
|
|
36
|
+
"vue grid",
|
|
37
|
+
"angular-grid",
|
|
38
|
+
"react-grid",
|
|
39
|
+
"vue-grid"
|
|
40
|
+
],
|
|
41
|
+
"module": "./es5-esm.js",
|
|
42
|
+
"esm5": "./es5-esm.js",
|
|
43
|
+
"wj-esm5": "./es5-esm.js",
|
|
44
|
+
"es2015Cjs": "./es2015-commonjs.js",
|
|
45
|
+
"wj-es2015Cjs": "./es2015-commonjs.js",
|
|
46
|
+
"esm2015": "./es2015-esm.js",
|
|
47
|
+
"wj-esm2015": "./es2015-esm.js"
|
|
48
|
+
}
|