jsl-ui 9.28.3 → 9.28.4

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.
Files changed (170) hide show
  1. package/lib/components/IntervalComponent.d.ts +17 -17
  2. package/lib/components/IntervalComponent.js +65 -65
  3. package/lib/components/auto-suggest/AutoSuggestComponent.d.ts +22 -22
  4. package/lib/components/auto-suggest/AutoSuggestComponent.js +47 -47
  5. package/lib/components/button/ButtonComponent.d.ts +18 -18
  6. package/lib/components/button/ButtonComponent.js +29 -29
  7. package/lib/components/checkbox/CheckBoxComponent.d.ts +28 -28
  8. package/lib/components/checkbox/CheckBoxComponent.js +81 -81
  9. package/lib/components/date/DateComponent.d.ts +32 -32
  10. package/lib/components/date/DateComponent.js +89 -89
  11. package/lib/components/date-range/DateRangeComponent.d.ts +35 -35
  12. package/lib/components/date-range/DateRangeComponent.js +121 -123
  13. package/lib/components/date-time/DateTimeComponent.d.ts +15 -15
  14. package/lib/components/date-time/DateTimeComponent.js +39 -39
  15. package/lib/components/dialog/DialogComponent.d.ts +67 -67
  16. package/lib/components/dialog/DialogComponent.js +192 -198
  17. package/lib/components/drop-down/DropDownComponent.d.ts +27 -27
  18. package/lib/components/drop-down/DropDownComponent.js +60 -60
  19. package/lib/components/expander/ExpanderComponent.d.ts +27 -27
  20. package/lib/components/expander/ExpanderComponent.js +87 -89
  21. package/lib/components/form-field/FormComponent.d.ts +12 -12
  22. package/lib/components/form-field/FormComponent.js +23 -23
  23. package/lib/components/form-field/FormFieldComponent.d.ts +39 -39
  24. package/lib/components/form-field/FormFieldComponent.js +138 -138
  25. package/lib/components/grid/GridComponent.d.ts +26 -26
  26. package/lib/components/grid/GridComponent.js +110 -110
  27. package/lib/components/input/InputComponent.d.ts +33 -33
  28. package/lib/components/input/InputComponent.js +126 -126
  29. package/lib/components/loading/LoadingComponent.d.ts +8 -8
  30. package/lib/components/loading/LoadingComponent.js +20 -20
  31. package/lib/components/navigation/NavigationComponent.d.ts +34 -34
  32. package/lib/components/navigation/NavigationComponent.js +47 -45
  33. package/lib/components/notification/Notification.d.ts +19 -19
  34. package/lib/components/notification/Notification.js +65 -65
  35. package/lib/components/number/NumberComponent.d.ts +26 -26
  36. package/lib/components/number/NumberComponent.js +80 -80
  37. package/lib/components/overlay/OverlayComponent.d.ts +27 -27
  38. package/lib/components/overlay/OverlayComponent.js +134 -137
  39. package/lib/components/progress/ProgressComponent.d.ts +18 -18
  40. package/lib/components/progress/ProgressComponent.js +40 -40
  41. package/lib/components/ribbon-menu/RibbonMenuComponent.d.ts +12 -12
  42. package/lib/components/ribbon-menu/RibbonMenuComponent.js +23 -23
  43. package/lib/components/select/SelectComponent.d.ts +79 -79
  44. package/lib/components/select/SelectComponent.js +352 -356
  45. package/lib/components/select/SelectDDAreaComponent.d.ts +32 -32
  46. package/lib/components/select/SelectDDAreaComponent.js +303 -303
  47. package/lib/components/slider/nouislider.d.ts +44 -44
  48. package/lib/components/slider/nouislider.js +2158 -2158
  49. package/lib/components/stack-panel/SplitterComponent.d.ts +21 -21
  50. package/lib/components/stack-panel/SplitterComponent.js +124 -124
  51. package/lib/components/stack-panel/StackPanelComponent.d.ts +20 -20
  52. package/lib/components/stack-panel/StackPanelComponent.js +50 -50
  53. package/lib/components/tabs/TabsComponent.d.ts +40 -40
  54. package/lib/components/tabs/TabsComponent.js +191 -200
  55. package/lib/components/time/TimeComponent.d.ts +29 -29
  56. package/lib/components/time/TimeComponent.js +102 -104
  57. package/lib/components/tree-view/TreeViewComponent.d.ts +23 -23
  58. package/lib/components/tree-view/TreeViewComponent.js +42 -43
  59. package/lib/components/virtual-render/VirtualRenderComponent.d.ts +30 -30
  60. package/lib/components/virtual-render/VirtualRenderComponent.js +90 -92
  61. package/lib/core/culture.d.ts +5 -5
  62. package/lib/core/culture.js +385 -385
  63. package/lib/core/date.d.ts +14 -14
  64. package/lib/core/date.js +346 -346
  65. package/lib/core/helper.d.ts +13 -13
  66. package/lib/core/helper.js +100 -100
  67. package/lib/core/jq.d.ts +37 -37
  68. package/lib/core/jq.js +362 -362
  69. package/lib/core/lang.d.ts +24 -24
  70. package/lib/core/lang.js +24 -24
  71. package/lib/core/numeric.d.ts +7 -7
  72. package/lib/core/numeric.js +139 -139
  73. package/lib/core/polyfills.js +22 -22
  74. package/lib/core.d.ts +6 -6
  75. package/lib/core.js +6 -6
  76. package/lib/grid/filterDialogs/dateRangeFilter.d.ts +7 -7
  77. package/lib/grid/filterDialogs/dateRangeFilter.js +106 -106
  78. package/lib/grid/filterDialogs/excelFilter.d.ts +9 -9
  79. package/lib/grid/filterDialogs/excelFilter.js +250 -250
  80. package/lib/grid/plugins/ext.overlay.d.ts +2 -2
  81. package/lib/grid/plugins/ext.overlay.js +295 -295
  82. package/lib/grid/plugins/slick.cellrangedecorator.d.ts +12 -12
  83. package/lib/grid/plugins/slick.cellrangedecorator.js +68 -68
  84. package/lib/grid/plugins/slick.cellrangeselector.d.ts +1 -1
  85. package/lib/grid/plugins/slick.cellrangeselector.js +144 -144
  86. package/lib/grid/plugins/slick.cellselectionmodel.d.ts +1 -1
  87. package/lib/grid/plugins/slick.cellselectionmodel.js +194 -194
  88. package/lib/grid/plugins/slick.headerbuttons.d.ts +55 -55
  89. package/lib/grid/plugins/slick.headerbuttons.js +156 -156
  90. package/lib/grid/plugins/slick.headermenu.d.ts +74 -74
  91. package/lib/grid/plugins/slick.headermenu.js +260 -260
  92. package/lib/grid/plugins/slick.rowmovemanager.d.ts +18 -18
  93. package/lib/grid/plugins/slick.rowmovemanager.js +249 -249
  94. package/lib/grid/plugins/slick.rowselectionmodel.d.ts +1 -1
  95. package/lib/grid/plugins/slick.rowselectionmodel.js +167 -167
  96. package/lib/grid/slick.core.d.ts +91 -91
  97. package/lib/grid/slick.core.js +574 -574
  98. package/lib/grid/slick.creator.d.ts +81 -81
  99. package/lib/grid/slick.creator.js +726 -726
  100. package/lib/grid/slick.dataview.d.ts +71 -71
  101. package/lib/grid/slick.dataview.js +1069 -1069
  102. package/lib/grid/slick.editors.core.d.ts +4 -4
  103. package/lib/grid/slick.editors.core.js +235 -235
  104. package/lib/grid/slick.editors.date.d.ts +2 -2
  105. package/lib/grid/slick.editors.date.js +125 -125
  106. package/lib/grid/slick.editors.lookup.d.ts +14 -14
  107. package/lib/grid/slick.editors.lookup.js +352 -352
  108. package/lib/grid/slick.editors.nav.d.ts +6 -6
  109. package/lib/grid/slick.editors.nav.js +22 -22
  110. package/lib/grid/slick.formatters.d.ts +17 -17
  111. package/lib/grid/slick.formatters.js +144 -144
  112. package/lib/grid/slick.grid.d.ts +285 -285
  113. package/lib/grid/slick.grid.js +5409 -5409
  114. package/lib/grid/slick.groupitemmetadataprovider.d.ts +39 -39
  115. package/lib/grid/slick.groupitemmetadataprovider.js +165 -165
  116. package/lib/grid/slick.tree.d.ts +33 -33
  117. package/lib/grid/slick.tree.js +208 -208
  118. package/lib/grid.css +705 -1
  119. package/lib/grid.d.ts +13 -13
  120. package/lib/grid.js +13 -13
  121. package/lib/index.css +2195 -8
  122. package/lib/index.css.map +1 -1
  123. package/lib/index.d.ts +55 -56
  124. package/lib/index.js +61 -61
  125. package/lib/index.js.map +1 -1
  126. package/lib/interaction/dataconverter.d.ts +4 -4
  127. package/lib/interaction/dataconverter.js +1 -0
  128. package/lib/interaction/eventhandler.d.ts +13 -13
  129. package/lib/interaction/eventhandler.js +39 -39
  130. package/lib/interaction/moveable.d.ts +39 -39
  131. package/lib/interaction/moveable.js +160 -160
  132. package/lib/interaction/resizable.d.ts +37 -37
  133. package/lib/interaction/resizable.js +109 -109
  134. package/lib/ui/auto.suggest.d.ts +18 -18
  135. package/lib/ui/auto.suggest.js +244 -244
  136. package/lib/ui/date.picker/date-picker-options.d.ts +11 -11
  137. package/lib/ui/date.picker/date-picker-options.js +76 -76
  138. package/lib/ui/date.picker/lib/date-manip.d.ts +74 -74
  139. package/lib/ui/date.picker/lib/date-manip.js +120 -120
  140. package/lib/ui/date.picker/lib/dom.d.ts +23 -23
  141. package/lib/ui/date.picker/lib/dom.js +28 -28
  142. package/lib/ui/date.picker/lib/emitter.d.ts +13 -13
  143. package/lib/ui/date.picker/lib/emitter.js +49 -49
  144. package/lib/ui/date.picker/lib/fns.d.ts +23 -23
  145. package/lib/ui/date.picker/lib/fns.js +39 -39
  146. package/lib/ui/date.picker/mode/base-mode.d.ts +26 -26
  147. package/lib/ui/date.picker/mode/base-mode.js +248 -248
  148. package/lib/ui/date.picker/mode/dropdown-mode.d.ts +28 -28
  149. package/lib/ui/date.picker/mode/dropdown-mode.js +50 -50
  150. package/lib/ui/date.picker/mode/index.d.ts +28 -28
  151. package/lib/ui/date.picker/mode/index.js +18 -18
  152. package/lib/ui/date.picker/mode/modal-mode.d.ts +25 -25
  153. package/lib/ui/date.picker/mode/modal-mode.js +17 -17
  154. package/lib/ui/date.picker/mode/permanent-mode.d.ts +29 -29
  155. package/lib/ui/date.picker/mode/permanent-mode.js +19 -19
  156. package/lib/ui/date.picker/views/day-picker.d.ts +40 -40
  157. package/lib/ui/date.picker/views/day-picker.js +155 -155
  158. package/lib/ui/date.picker/views/month-picker.d.ts +26 -26
  159. package/lib/ui/date.picker/views/month-picker.js +65 -65
  160. package/lib/ui/date.picker/views/year-picker.d.ts +20 -20
  161. package/lib/ui/date.picker/views/year-picker.js +66 -66
  162. package/lib/ui/date.picker.d.ts +66 -66
  163. package/lib/ui/date.picker.js +32 -32
  164. package/lib/ui/dialog.d.ts +22 -22
  165. package/lib/ui/dialog.js +98 -98
  166. package/lib/ui/drop.down.d.ts +52 -52
  167. package/lib/ui/drop.down.js +2112 -2112
  168. package/lib/ui/number.input.d.ts +13 -13
  169. package/lib/ui/number.input.js +56 -56
  170. package/package.json +1 -1
@@ -1,574 +1,574 @@
1
- import { jQueryReplacement } from "../core/jq";
2
- export let Slick = {
3
- "Event": Event,
4
- "EventData": EventData,
5
- "EventHandler": EventHandler,
6
- "Range": Range,
7
- "NonDataRow": NonDataItem,
8
- "Group": Group,
9
- "GroupTotals": GroupTotals,
10
- "EditorLock": EditorLock,
11
- /***
12
- * A global singleton editor lock.
13
- * @class GlobalEditorLock
14
- * @static
15
- * @constructor
16
- */
17
- "GlobalEditorLock": new EditorLock(),
18
- // "TreeColumns": TreeColumns,
19
- "keyCode": {
20
- SPACE: 8,
21
- BACKSPACE: 8,
22
- DELETE: 46,
23
- DOWN: 40,
24
- END: 35,
25
- ENTER: 13,
26
- ESCAPE: 27,
27
- HOME: 36,
28
- INSERT: 45,
29
- LEFT: 37,
30
- PAGE_DOWN: 34,
31
- PAGE_UP: 33,
32
- RIGHT: 39,
33
- TAB: 9,
34
- UP: 38,
35
- A: 65
36
- },
37
- "preClickClassName": "slick-edit-preclick",
38
- $: jQueryReplacement
39
- // formatters:{}
40
- };
41
- /***
42
- * An event object for passing data to event handlers and letting them control propagation.
43
- * <p>This is pretty much identical to how W3C and jQuery implement events.</p>
44
- * @class EventData
45
- * @constructor
46
- */
47
- function EventData() {
48
- var isPropagationStopped = false;
49
- var isImmediatePropagationStopped = false;
50
- /***
51
- * Stops event from propagating up the DOM tree.
52
- * @method stopPropagation
53
- */
54
- this.stopPropagation = function () {
55
- isPropagationStopped = true;
56
- };
57
- /***
58
- * Returns whether stopPropagation was called on this event object.
59
- * @method isPropagationStopped
60
- * @return {Boolean}
61
- */
62
- this.isPropagationStopped = function () {
63
- return isPropagationStopped;
64
- };
65
- /***
66
- * Prevents the rest of the handlers from being executed.
67
- * @method stopImmediatePropagation
68
- */
69
- this.stopImmediatePropagation = function () {
70
- isImmediatePropagationStopped = true;
71
- };
72
- /***
73
- * Returns whether stopImmediatePropagation was called on this event object.\
74
- * @method isImmediatePropagationStopped
75
- * @return {Boolean}
76
- */
77
- this.isImmediatePropagationStopped = function () {
78
- return isImmediatePropagationStopped;
79
- };
80
- }
81
- /***
82
- * A simple publisher-subscriber implementation.
83
- * @class Event
84
- * @constructor
85
- */
86
- function Event() {
87
- var handlers = [];
88
- /***
89
- * Adds an event handler to be called when the event is fired.
90
- * <p>Event handler will receive two arguments - an <code>EventData</code> and the <code>data</code>
91
- * object the event was fired with.<p>
92
- * @method subscribe
93
- * @param fn {Function} Event handler.
94
- */
95
- this.subscribe = function (fn) {
96
- handlers.push(fn);
97
- };
98
- this.countHandlers = function () {
99
- return handlers.length;
100
- };
101
- /***
102
- * Removes an event handler added with <code>subscribe(fn)</code>.
103
- * @method unsubscribe
104
- * @param fn {Function} Event handler to be removed.
105
- */
106
- this.unsubscribe = function (fn) {
107
- for (var i = handlers.length - 1; i >= 0; i--) {
108
- if (handlers[i] === fn) {
109
- handlers.splice(i, 1);
110
- }
111
- }
112
- };
113
- /***
114
- * Fires an event notifying all subscribers.
115
- * @method notify
116
- * @param args {Object} Additional data object to be passed to all handlers.
117
- * @param e {EventData}
118
- * Optional.
119
- * An <code>EventData</code> object to be passed to all handlers.
120
- * For DOM events, an existing W3C/jQuery event object can be passed in.
121
- * @param scope {Object}
122
- * Optional.
123
- * The scope ("this") within which the handler will be executed.
124
- * If not specified, the scope will be set to the <code>Event</code> instance.
125
- */
126
- this.notify = function (args, e, scope) {
127
- e = e || new EventData();
128
- scope = scope || this;
129
- var returnValue;
130
- for (var i = 0; i < handlers.length && !((e.isPropagationStopped && e.isPropagationStopped()) || (e.isImmediatePropagationStopped && e.isImmediatePropagationStopped())); i++) {
131
- returnValue = handlers[i].call(scope, e, args);
132
- }
133
- return returnValue;
134
- };
135
- }
136
- function EventHandler() {
137
- var handlers = [];
138
- this.subscribe = function (event, handler) {
139
- handlers.push({
140
- event: event,
141
- handler: handler
142
- });
143
- event.subscribe(handler);
144
- return this; // allow chaining
145
- };
146
- this.unsubscribe = function (event, handler) {
147
- var i = handlers.length;
148
- while (i--) {
149
- if (handlers[i].event === event &&
150
- handlers[i].handler === handler) {
151
- handlers.splice(i, 1);
152
- event.unsubscribe(handler);
153
- return;
154
- }
155
- }
156
- return this; // allow chaining
157
- };
158
- this.unsubscribeAll = function () {
159
- var i = handlers.length;
160
- while (i--) {
161
- handlers[i].event.unsubscribe(handlers[i].handler);
162
- }
163
- handlers = [];
164
- return this; // allow chaining
165
- };
166
- }
167
- /***
168
- * A structure containing a range of cells.
169
- * @class Range
170
- * @constructor
171
- * @param fromRow {Integer} Starting row.
172
- * @param fromCell {Integer} Starting cell.
173
- * @param toRow {Integer} Optional. Ending row. Defaults to <code>fromRow</code>.
174
- * @param toCell {Integer} Optional. Ending cell. Defaults to <code>fromCell</code>.
175
- */
176
- export function Range(fromRow, fromCell, toRow, toCell) {
177
- if (toRow === undefined && toCell === undefined) {
178
- toRow = fromRow;
179
- toCell = fromCell;
180
- }
181
- /***
182
- * @property fromRow
183
- * @type {Integer}
184
- */
185
- this.fromRow = Math.min(fromRow, toRow);
186
- /***
187
- * @property fromCell
188
- * @type {Integer}
189
- */
190
- this.fromCell = Math.min(fromCell, toCell);
191
- /***
192
- * @property toRow
193
- * @type {Integer}
194
- */
195
- this.toRow = Math.max(fromRow, toRow);
196
- /***
197
- * @property toCell
198
- * @type {Integer}
199
- */
200
- this.toCell = Math.max(fromCell, toCell);
201
- /***
202
- * Returns whether a range represents a single row.
203
- * @method isSingleRow
204
- * @return {Boolean}
205
- */
206
- this.isSingleRow = function () {
207
- return this.fromRow == this.toRow;
208
- };
209
- /***
210
- * Returns whether a range represents a single cell.
211
- * @method isSingleCell
212
- * @return {Boolean}
213
- */
214
- this.isSingleCell = function () {
215
- return this.fromRow == this.toRow && this.fromCell == this.toCell;
216
- };
217
- /***
218
- * Returns whether a range contains a given cell.
219
- * @method contains
220
- * @param row {Integer}
221
- * @param cell {Integer}
222
- * @return {Boolean}
223
- */
224
- this.contains = function (row, cell) {
225
- return row >= this.fromRow && row <= this.toRow &&
226
- cell >= this.fromCell && cell <= this.toCell;
227
- };
228
- /***
229
- * Returns a readable representation of a range.
230
- * @method toString
231
- * @return {String}
232
- */
233
- this.toString = function () {
234
- if (this.isSingleCell()) {
235
- return "(" + this.fromRow + ":" + this.fromCell + ")";
236
- }
237
- else {
238
- return "(" + this.fromRow + ":" + this.fromCell + " - " + this.toRow + ":" + this.toCell + ")";
239
- }
240
- };
241
- }
242
- /***
243
- * A base class that all special / non-data rows (like Group and GroupTotals) derive from.
244
- * @class NonDataItem
245
- * @constructor
246
- */
247
- function NonDataItem() {
248
- this.__nonDataRow = true;
249
- }
250
- /***
251
- * Information about a group of rows.
252
- * @class Group
253
- * @extends Slick.NonDataItem
254
- * @constructor
255
- */
256
- function Group() {
257
- this.__group = true;
258
- /**
259
- * Grouping level, starting with 0.
260
- * @property level
261
- * @type {Number}
262
- */
263
- this.level = 0;
264
- /***
265
- * Number of rows in the group.
266
- * @property count
267
- * @type {Integer}
268
- */
269
- this.count = 0;
270
- /***
271
- * Grouping value.
272
- * @property value
273
- * @type {Object}
274
- */
275
- this.value = null;
276
- /***
277
- * Formatted display value of the group.
278
- * @property title
279
- * @type {String}
280
- */
281
- this.title = null;
282
- /***
283
- * Whether a group is collapsed.
284
- * @property collapsed
285
- * @type {Boolean}
286
- */
287
- this.collapsed = false;
288
- /***
289
- * Whether a group selection checkbox is checked.
290
- * @property selectChecked
291
- * @type {Boolean}
292
- */
293
- this.selectChecked = false;
294
- /***
295
- * GroupTotals, if any.
296
- * @property totals
297
- * @type {GroupTotals}
298
- */
299
- this.totals = null;
300
- /**
301
- * Rows that are part of the group.
302
- * @property rows
303
- * @type {Array}
304
- */
305
- this.rows = [];
306
- /**
307
- * Sub-groups that are part of the group.
308
- * @property groups
309
- * @type {Array}
310
- */
311
- this.groups = null;
312
- /**
313
- * A unique key used to identify the group. This key can be used in calls to DataView
314
- * collapseGroup() or expandGroup().
315
- * @property groupingKey
316
- * @type {Object}
317
- */
318
- this.groupingKey = null;
319
- }
320
- Group.prototype = new NonDataItem();
321
- /***
322
- * Compares two Group instances.
323
- * @method equals
324
- * @return {Boolean}
325
- * @param group {Group} Group instance to compare to.
326
- */
327
- Group.prototype.equals = function (group) {
328
- return this.value === group.value &&
329
- this.count === group.count &&
330
- this.collapsed === group.collapsed &&
331
- this.title === group.title;
332
- };
333
- /***
334
- * Information about group totals.
335
- * An instance of GroupTotals will be created for each totals row and passed to the aggregators
336
- * so that they can store arbitrary data in it. That data can later be accessed by group totals
337
- * formatters during the display.
338
- * @class GroupTotals
339
- * @extends Slick.NonDataItem
340
- * @constructor
341
- */
342
- function GroupTotals() {
343
- this.__groupTotals = true;
344
- /***
345
- * Parent Group.
346
- * @param group
347
- * @type {Group}
348
- */
349
- this.group = null;
350
- /***
351
- * Whether the totals have been fully initialized / calculated.
352
- * Will be set to false for lazy-calculated group totals.
353
- * @param initialized
354
- * @type {Boolean}
355
- */
356
- this.initialized = false;
357
- }
358
- GroupTotals.prototype = new NonDataItem();
359
- /***
360
- * A locking helper to track the active edit controller and ensure that only a single controller
361
- * can be active at a time. This prevents a whole class of state and validation synchronization
362
- * issues. An edit controller (such as SlickGrid) can query if an active edit is in progress
363
- * and attempt a commit or cancel before proceeding.
364
- * @class EditorLock
365
- * @constructor
366
- */
367
- function EditorLock() {
368
- var activeEditController = null;
369
- /***
370
- * Returns true if a specified edit controller is active (has the edit lock).
371
- * If the parameter is not specified, returns true if any edit controller is active.
372
- * @method isActive
373
- * @param editController {EditController}
374
- * @return {Boolean}
375
- */
376
- this.isActive = function (editController) {
377
- return (editController ? activeEditController === editController : activeEditController !== null);
378
- };
379
- /***
380
- * Sets the specified edit controller as the active edit controller (acquire edit lock).
381
- * If another edit controller is already active, and exception will be throw new Error(.
382
- * @method activate
383
- * @param editController {EditController} edit controller acquiring the lock
384
- */
385
- this.activate = function (editController) {
386
- if (editController === activeEditController) { // already activated?
387
- return;
388
- }
389
- if (activeEditController !== null) {
390
- throw new Error("SlickGrid.EditorLock.activate: an editController is still active, can't activate another editController");
391
- }
392
- if (!editController.commitCurrentEdit) {
393
- throw new Error("SlickGrid.EditorLock.activate: editController must implement .commitCurrentEdit()");
394
- }
395
- if (!editController.cancelCurrentEdit) {
396
- throw new Error("SlickGrid.EditorLock.activate: editController must implement .cancelCurrentEdit()");
397
- }
398
- activeEditController = editController;
399
- };
400
- /***
401
- * Unsets the specified edit controller as the active edit controller (release edit lock).
402
- * If the specified edit controller is not the active one, an exception will be throw new Error(.
403
- * @method deactivate
404
- * @param editController {EditController} edit controller releasing the lock
405
- */
406
- this.deactivate = function (editController) {
407
- if (activeEditController !== editController) {
408
- throw new Error("SlickGrid.EditorLock.deactivate: specified editController is not the currently active one");
409
- }
410
- activeEditController = null;
411
- };
412
- /***
413
- * Attempts to commit the current edit by calling "commitCurrentEdit" method on the active edit
414
- * controller and returns whether the commit attempt was successful (commit may fail due to validation
415
- * errors, etc.). Edit controller's "commitCurrentEdit" must return true if the commit has succeeded
416
- * and false otherwise. If no edit controller is active, returns true.
417
- * @method commitCurrentEdit
418
- * @return {Boolean}
419
- */
420
- this.commitCurrentEdit = function () {
421
- return (activeEditController ? activeEditController.commitCurrentEdit() : true);
422
- };
423
- /***
424
- * Attempts to cancel the current edit by calling "cancelCurrentEdit" method on the active edit
425
- * controller and returns whether the edit was successfully cancelled. If no edit controller is
426
- * active, returns true.
427
- * @method cancelCurrentEdit
428
- * @return {Boolean}
429
- */
430
- this.cancelCurrentEdit = function cancelCurrentEdit() {
431
- return (activeEditController ? activeEditController.cancelCurrentEdit() : true);
432
- };
433
- }
434
- // /**
435
- // *
436
- // * @param {Array} treeColumns Array com levels of columns
437
- // * @returns {{hasDepth: 'hasDepth', getTreeColumns: 'getTreeColumns', extractColumns: 'extractColumns', getDepth: 'getDepth', getColumnsInDepth: 'getColumnsInDepth', getColumnsInGroup: 'getColumnsInGroup', visibleColumns: 'visibleColumns', filter: 'filter', reOrder: reOrder}}
438
- // * @constructor
439
- // */
440
- // function TreeColumns(treeColumns) {
441
- // var columnsById = {};
442
- // function init() {
443
- // mapToId(treeColumns);
444
- // }
445
- // function mapToId(columns) {
446
- // columns
447
- // .forEach(function (column) {
448
- // columnsById[column.id] = column;
449
- // if (column.columns) {
450
- // mapToId(column.columns);
451
- // }
452
- // });
453
- // }
454
- // function filter(node, condition) {
455
- // return node.filter(function (column) {
456
- // var valid = condition.call(column);
457
- // if (valid && column.columns) {
458
- // column.columns = filter(column.columns, condition);
459
- // }
460
- // return valid && (!column.columns || column.columns.length);
461
- // });
462
- // }
463
- // function sort(columns, grid) {
464
- // columns
465
- // .sort(function (a, b) {
466
- // var indexA = getOrDefault(grid.getColumnIndex(a.id)),
467
- // indexB = getOrDefault(grid.getColumnIndex(b.id));
468
- // return indexA - indexB;
469
- // })
470
- // .forEach(function (column) {
471
- // if (column.columns) {
472
- // sort(column.columns, grid);
473
- // }
474
- // });
475
- // }
476
- // function getOrDefault(value) {
477
- // return typeof value === "undefined" ? -1 : value;
478
- // }
479
- // function getDepth(node) {
480
- // if (node.length) {
481
- // for (var i in node)
482
- // return getDepth(node[i]);
483
- // }
484
- // else if (node.columns) {
485
- // return 1 + getDepth(node.columns);
486
- // }
487
- // else {
488
- // return 1;
489
- // }
490
- // }
491
- // function getColumnsInDepth(node: any[], depth: number, current?: number) {
492
- // var columns = [];
493
- // current = current || 0;
494
- // if (depth == current) {
495
- // if (node.length) {
496
- // node.forEach(function (n) {
497
- // if (n.columns)
498
- // n.extractColumns = function () {
499
- // return extractColumns(n);
500
- // };
501
- // });
502
- // }
503
- // return node;
504
- // } else {
505
- // for (var i in node) {
506
- // if (node[i].columns) {
507
- // columns = columns.concat(getColumnsInDepth(node[i].columns, depth, current + 1));
508
- // }
509
- // }
510
- // }
511
- // return columns;
512
- // }
513
- // function extractColumns(node) {
514
- // var result = [];
515
- // if (node.hasOwnProperty("length")) {
516
- // for (var i = 0; i < node.length; i++) {
517
- // result = result.concat(extractColumns(node[i]));
518
- // }
519
- // } else {
520
- // if (node.hasOwnProperty("columns")) {
521
- // result = result.concat(extractColumns(node.columns));
522
- // } else {
523
- // return node;
524
- // }
525
- // }
526
- // return result;
527
- // }
528
- // function cloneTreeColumns() {
529
- // return (<any>window).Slick.$.shallowExtend([], treeColumns);
530
- // }
531
- // init();
532
- // this.hasDepth = function () {
533
- // for (var i in treeColumns) {
534
- // if (treeColumns[i].hasOwnProperty('columns'))
535
- // return true;
536
- // }
537
- // return false;
538
- // };
539
- // this.getTreeColumns = function () {
540
- // return treeColumns;
541
- // };
542
- // this.extractColumns = function () {
543
- // return this.hasDepth() ? extractColumns(treeColumns) : treeColumns;
544
- // };
545
- // this.getDepth = function () {
546
- // return getDepth(treeColumns);
547
- // };
548
- // this.getColumnsInDepth = function (depth) {
549
- // return getColumnsInDepth(treeColumns, depth);
550
- // };
551
- // this.getColumnsInGroup = function (groups) {
552
- // return extractColumns(groups);
553
- // };
554
- // this.visibleColumns = function () {
555
- // return filter(cloneTreeColumns(), function () {
556
- // return this.visible;
557
- // });
558
- // };
559
- // this.filter = function (condition) {
560
- // return filter(cloneTreeColumns(), condition);
561
- // };
562
- // this.reOrder = function (grid) {
563
- // return sort(treeColumns, grid);
564
- // };
565
- // this.getById = function (id) {
566
- // return columnsById[id];
567
- // };
568
- // this.getInIds = function (ids) {
569
- // return ids.map(function (id) {
570
- // return columnsById[id];
571
- // });
572
- // };
573
- // }
574
- // (<any>window).Slick = Slick;
1
+ import { jQueryReplacement } from "../core/jq";
2
+ export let Slick = {
3
+ "Event": Event,
4
+ "EventData": EventData,
5
+ "EventHandler": EventHandler,
6
+ "Range": Range,
7
+ "NonDataRow": NonDataItem,
8
+ "Group": Group,
9
+ "GroupTotals": GroupTotals,
10
+ "EditorLock": EditorLock,
11
+ /***
12
+ * A global singleton editor lock.
13
+ * @class GlobalEditorLock
14
+ * @static
15
+ * @constructor
16
+ */
17
+ "GlobalEditorLock": new EditorLock(),
18
+ // "TreeColumns": TreeColumns,
19
+ "keyCode": {
20
+ SPACE: 8,
21
+ BACKSPACE: 8,
22
+ DELETE: 46,
23
+ DOWN: 40,
24
+ END: 35,
25
+ ENTER: 13,
26
+ ESCAPE: 27,
27
+ HOME: 36,
28
+ INSERT: 45,
29
+ LEFT: 37,
30
+ PAGE_DOWN: 34,
31
+ PAGE_UP: 33,
32
+ RIGHT: 39,
33
+ TAB: 9,
34
+ UP: 38,
35
+ A: 65
36
+ },
37
+ "preClickClassName": "slick-edit-preclick",
38
+ $: jQueryReplacement
39
+ // formatters:{}
40
+ };
41
+ /***
42
+ * An event object for passing data to event handlers and letting them control propagation.
43
+ * <p>This is pretty much identical to how W3C and jQuery implement events.</p>
44
+ * @class EventData
45
+ * @constructor
46
+ */
47
+ function EventData() {
48
+ var isPropagationStopped = false;
49
+ var isImmediatePropagationStopped = false;
50
+ /***
51
+ * Stops event from propagating up the DOM tree.
52
+ * @method stopPropagation
53
+ */
54
+ this.stopPropagation = function () {
55
+ isPropagationStopped = true;
56
+ };
57
+ /***
58
+ * Returns whether stopPropagation was called on this event object.
59
+ * @method isPropagationStopped
60
+ * @return {Boolean}
61
+ */
62
+ this.isPropagationStopped = function () {
63
+ return isPropagationStopped;
64
+ };
65
+ /***
66
+ * Prevents the rest of the handlers from being executed.
67
+ * @method stopImmediatePropagation
68
+ */
69
+ this.stopImmediatePropagation = function () {
70
+ isImmediatePropagationStopped = true;
71
+ };
72
+ /***
73
+ * Returns whether stopImmediatePropagation was called on this event object.\
74
+ * @method isImmediatePropagationStopped
75
+ * @return {Boolean}
76
+ */
77
+ this.isImmediatePropagationStopped = function () {
78
+ return isImmediatePropagationStopped;
79
+ };
80
+ }
81
+ /***
82
+ * A simple publisher-subscriber implementation.
83
+ * @class Event
84
+ * @constructor
85
+ */
86
+ function Event() {
87
+ var handlers = [];
88
+ /***
89
+ * Adds an event handler to be called when the event is fired.
90
+ * <p>Event handler will receive two arguments - an <code>EventData</code> and the <code>data</code>
91
+ * object the event was fired with.<p>
92
+ * @method subscribe
93
+ * @param fn {Function} Event handler.
94
+ */
95
+ this.subscribe = function (fn) {
96
+ handlers.push(fn);
97
+ };
98
+ this.countHandlers = function () {
99
+ return handlers.length;
100
+ };
101
+ /***
102
+ * Removes an event handler added with <code>subscribe(fn)</code>.
103
+ * @method unsubscribe
104
+ * @param fn {Function} Event handler to be removed.
105
+ */
106
+ this.unsubscribe = function (fn) {
107
+ for (var i = handlers.length - 1; i >= 0; i--) {
108
+ if (handlers[i] === fn) {
109
+ handlers.splice(i, 1);
110
+ }
111
+ }
112
+ };
113
+ /***
114
+ * Fires an event notifying all subscribers.
115
+ * @method notify
116
+ * @param args {Object} Additional data object to be passed to all handlers.
117
+ * @param e {EventData}
118
+ * Optional.
119
+ * An <code>EventData</code> object to be passed to all handlers.
120
+ * For DOM events, an existing W3C/jQuery event object can be passed in.
121
+ * @param scope {Object}
122
+ * Optional.
123
+ * The scope ("this") within which the handler will be executed.
124
+ * If not specified, the scope will be set to the <code>Event</code> instance.
125
+ */
126
+ this.notify = function (args, e, scope) {
127
+ e = e || new EventData();
128
+ scope = scope || this;
129
+ var returnValue;
130
+ for (var i = 0; i < handlers.length && !((e.isPropagationStopped && e.isPropagationStopped()) || (e.isImmediatePropagationStopped && e.isImmediatePropagationStopped())); i++) {
131
+ returnValue = handlers[i].call(scope, e, args);
132
+ }
133
+ return returnValue;
134
+ };
135
+ }
136
+ function EventHandler() {
137
+ var handlers = [];
138
+ this.subscribe = function (event, handler) {
139
+ handlers.push({
140
+ event: event,
141
+ handler: handler
142
+ });
143
+ event.subscribe(handler);
144
+ return this; // allow chaining
145
+ };
146
+ this.unsubscribe = function (event, handler) {
147
+ var i = handlers.length;
148
+ while (i--) {
149
+ if (handlers[i].event === event &&
150
+ handlers[i].handler === handler) {
151
+ handlers.splice(i, 1);
152
+ event.unsubscribe(handler);
153
+ return;
154
+ }
155
+ }
156
+ return this; // allow chaining
157
+ };
158
+ this.unsubscribeAll = function () {
159
+ var i = handlers.length;
160
+ while (i--) {
161
+ handlers[i].event.unsubscribe(handlers[i].handler);
162
+ }
163
+ handlers = [];
164
+ return this; // allow chaining
165
+ };
166
+ }
167
+ /***
168
+ * A structure containing a range of cells.
169
+ * @class Range
170
+ * @constructor
171
+ * @param fromRow {Integer} Starting row.
172
+ * @param fromCell {Integer} Starting cell.
173
+ * @param toRow {Integer} Optional. Ending row. Defaults to <code>fromRow</code>.
174
+ * @param toCell {Integer} Optional. Ending cell. Defaults to <code>fromCell</code>.
175
+ */
176
+ export function Range(fromRow, fromCell, toRow, toCell) {
177
+ if (toRow === undefined && toCell === undefined) {
178
+ toRow = fromRow;
179
+ toCell = fromCell;
180
+ }
181
+ /***
182
+ * @property fromRow
183
+ * @type {Integer}
184
+ */
185
+ this.fromRow = Math.min(fromRow, toRow);
186
+ /***
187
+ * @property fromCell
188
+ * @type {Integer}
189
+ */
190
+ this.fromCell = Math.min(fromCell, toCell);
191
+ /***
192
+ * @property toRow
193
+ * @type {Integer}
194
+ */
195
+ this.toRow = Math.max(fromRow, toRow);
196
+ /***
197
+ * @property toCell
198
+ * @type {Integer}
199
+ */
200
+ this.toCell = Math.max(fromCell, toCell);
201
+ /***
202
+ * Returns whether a range represents a single row.
203
+ * @method isSingleRow
204
+ * @return {Boolean}
205
+ */
206
+ this.isSingleRow = function () {
207
+ return this.fromRow == this.toRow;
208
+ };
209
+ /***
210
+ * Returns whether a range represents a single cell.
211
+ * @method isSingleCell
212
+ * @return {Boolean}
213
+ */
214
+ this.isSingleCell = function () {
215
+ return this.fromRow == this.toRow && this.fromCell == this.toCell;
216
+ };
217
+ /***
218
+ * Returns whether a range contains a given cell.
219
+ * @method contains
220
+ * @param row {Integer}
221
+ * @param cell {Integer}
222
+ * @return {Boolean}
223
+ */
224
+ this.contains = function (row, cell) {
225
+ return row >= this.fromRow && row <= this.toRow &&
226
+ cell >= this.fromCell && cell <= this.toCell;
227
+ };
228
+ /***
229
+ * Returns a readable representation of a range.
230
+ * @method toString
231
+ * @return {String}
232
+ */
233
+ this.toString = function () {
234
+ if (this.isSingleCell()) {
235
+ return "(" + this.fromRow + ":" + this.fromCell + ")";
236
+ }
237
+ else {
238
+ return "(" + this.fromRow + ":" + this.fromCell + " - " + this.toRow + ":" + this.toCell + ")";
239
+ }
240
+ };
241
+ }
242
+ /***
243
+ * A base class that all special / non-data rows (like Group and GroupTotals) derive from.
244
+ * @class NonDataItem
245
+ * @constructor
246
+ */
247
+ function NonDataItem() {
248
+ this.__nonDataRow = true;
249
+ }
250
+ /***
251
+ * Information about a group of rows.
252
+ * @class Group
253
+ * @extends Slick.NonDataItem
254
+ * @constructor
255
+ */
256
+ function Group() {
257
+ this.__group = true;
258
+ /**
259
+ * Grouping level, starting with 0.
260
+ * @property level
261
+ * @type {Number}
262
+ */
263
+ this.level = 0;
264
+ /***
265
+ * Number of rows in the group.
266
+ * @property count
267
+ * @type {Integer}
268
+ */
269
+ this.count = 0;
270
+ /***
271
+ * Grouping value.
272
+ * @property value
273
+ * @type {Object}
274
+ */
275
+ this.value = null;
276
+ /***
277
+ * Formatted display value of the group.
278
+ * @property title
279
+ * @type {String}
280
+ */
281
+ this.title = null;
282
+ /***
283
+ * Whether a group is collapsed.
284
+ * @property collapsed
285
+ * @type {Boolean}
286
+ */
287
+ this.collapsed = false;
288
+ /***
289
+ * Whether a group selection checkbox is checked.
290
+ * @property selectChecked
291
+ * @type {Boolean}
292
+ */
293
+ this.selectChecked = false;
294
+ /***
295
+ * GroupTotals, if any.
296
+ * @property totals
297
+ * @type {GroupTotals}
298
+ */
299
+ this.totals = null;
300
+ /**
301
+ * Rows that are part of the group.
302
+ * @property rows
303
+ * @type {Array}
304
+ */
305
+ this.rows = [];
306
+ /**
307
+ * Sub-groups that are part of the group.
308
+ * @property groups
309
+ * @type {Array}
310
+ */
311
+ this.groups = null;
312
+ /**
313
+ * A unique key used to identify the group. This key can be used in calls to DataView
314
+ * collapseGroup() or expandGroup().
315
+ * @property groupingKey
316
+ * @type {Object}
317
+ */
318
+ this.groupingKey = null;
319
+ }
320
+ Group.prototype = new NonDataItem();
321
+ /***
322
+ * Compares two Group instances.
323
+ * @method equals
324
+ * @return {Boolean}
325
+ * @param group {Group} Group instance to compare to.
326
+ */
327
+ Group.prototype.equals = function (group) {
328
+ return this.value === group.value &&
329
+ this.count === group.count &&
330
+ this.collapsed === group.collapsed &&
331
+ this.title === group.title;
332
+ };
333
+ /***
334
+ * Information about group totals.
335
+ * An instance of GroupTotals will be created for each totals row and passed to the aggregators
336
+ * so that they can store arbitrary data in it. That data can later be accessed by group totals
337
+ * formatters during the display.
338
+ * @class GroupTotals
339
+ * @extends Slick.NonDataItem
340
+ * @constructor
341
+ */
342
+ function GroupTotals() {
343
+ this.__groupTotals = true;
344
+ /***
345
+ * Parent Group.
346
+ * @param group
347
+ * @type {Group}
348
+ */
349
+ this.group = null;
350
+ /***
351
+ * Whether the totals have been fully initialized / calculated.
352
+ * Will be set to false for lazy-calculated group totals.
353
+ * @param initialized
354
+ * @type {Boolean}
355
+ */
356
+ this.initialized = false;
357
+ }
358
+ GroupTotals.prototype = new NonDataItem();
359
+ /***
360
+ * A locking helper to track the active edit controller and ensure that only a single controller
361
+ * can be active at a time. This prevents a whole class of state and validation synchronization
362
+ * issues. An edit controller (such as SlickGrid) can query if an active edit is in progress
363
+ * and attempt a commit or cancel before proceeding.
364
+ * @class EditorLock
365
+ * @constructor
366
+ */
367
+ function EditorLock() {
368
+ var activeEditController = null;
369
+ /***
370
+ * Returns true if a specified edit controller is active (has the edit lock).
371
+ * If the parameter is not specified, returns true if any edit controller is active.
372
+ * @method isActive
373
+ * @param editController {EditController}
374
+ * @return {Boolean}
375
+ */
376
+ this.isActive = function (editController) {
377
+ return (editController ? activeEditController === editController : activeEditController !== null);
378
+ };
379
+ /***
380
+ * Sets the specified edit controller as the active edit controller (acquire edit lock).
381
+ * If another edit controller is already active, and exception will be throw new Error(.
382
+ * @method activate
383
+ * @param editController {EditController} edit controller acquiring the lock
384
+ */
385
+ this.activate = function (editController) {
386
+ if (editController === activeEditController) { // already activated?
387
+ return;
388
+ }
389
+ if (activeEditController !== null) {
390
+ throw new Error("SlickGrid.EditorLock.activate: an editController is still active, can't activate another editController");
391
+ }
392
+ if (!editController.commitCurrentEdit) {
393
+ throw new Error("SlickGrid.EditorLock.activate: editController must implement .commitCurrentEdit()");
394
+ }
395
+ if (!editController.cancelCurrentEdit) {
396
+ throw new Error("SlickGrid.EditorLock.activate: editController must implement .cancelCurrentEdit()");
397
+ }
398
+ activeEditController = editController;
399
+ };
400
+ /***
401
+ * Unsets the specified edit controller as the active edit controller (release edit lock).
402
+ * If the specified edit controller is not the active one, an exception will be throw new Error(.
403
+ * @method deactivate
404
+ * @param editController {EditController} edit controller releasing the lock
405
+ */
406
+ this.deactivate = function (editController) {
407
+ if (activeEditController !== editController) {
408
+ throw new Error("SlickGrid.EditorLock.deactivate: specified editController is not the currently active one");
409
+ }
410
+ activeEditController = null;
411
+ };
412
+ /***
413
+ * Attempts to commit the current edit by calling "commitCurrentEdit" method on the active edit
414
+ * controller and returns whether the commit attempt was successful (commit may fail due to validation
415
+ * errors, etc.). Edit controller's "commitCurrentEdit" must return true if the commit has succeeded
416
+ * and false otherwise. If no edit controller is active, returns true.
417
+ * @method commitCurrentEdit
418
+ * @return {Boolean}
419
+ */
420
+ this.commitCurrentEdit = function () {
421
+ return (activeEditController ? activeEditController.commitCurrentEdit() : true);
422
+ };
423
+ /***
424
+ * Attempts to cancel the current edit by calling "cancelCurrentEdit" method on the active edit
425
+ * controller and returns whether the edit was successfully cancelled. If no edit controller is
426
+ * active, returns true.
427
+ * @method cancelCurrentEdit
428
+ * @return {Boolean}
429
+ */
430
+ this.cancelCurrentEdit = function cancelCurrentEdit() {
431
+ return (activeEditController ? activeEditController.cancelCurrentEdit() : true);
432
+ };
433
+ }
434
+ // /**
435
+ // *
436
+ // * @param {Array} treeColumns Array com levels of columns
437
+ // * @returns {{hasDepth: 'hasDepth', getTreeColumns: 'getTreeColumns', extractColumns: 'extractColumns', getDepth: 'getDepth', getColumnsInDepth: 'getColumnsInDepth', getColumnsInGroup: 'getColumnsInGroup', visibleColumns: 'visibleColumns', filter: 'filter', reOrder: reOrder}}
438
+ // * @constructor
439
+ // */
440
+ // function TreeColumns(treeColumns) {
441
+ // var columnsById = {};
442
+ // function init() {
443
+ // mapToId(treeColumns);
444
+ // }
445
+ // function mapToId(columns) {
446
+ // columns
447
+ // .forEach(function (column) {
448
+ // columnsById[column.id] = column;
449
+ // if (column.columns) {
450
+ // mapToId(column.columns);
451
+ // }
452
+ // });
453
+ // }
454
+ // function filter(node, condition) {
455
+ // return node.filter(function (column) {
456
+ // var valid = condition.call(column);
457
+ // if (valid && column.columns) {
458
+ // column.columns = filter(column.columns, condition);
459
+ // }
460
+ // return valid && (!column.columns || column.columns.length);
461
+ // });
462
+ // }
463
+ // function sort(columns, grid) {
464
+ // columns
465
+ // .sort(function (a, b) {
466
+ // var indexA = getOrDefault(grid.getColumnIndex(a.id)),
467
+ // indexB = getOrDefault(grid.getColumnIndex(b.id));
468
+ // return indexA - indexB;
469
+ // })
470
+ // .forEach(function (column) {
471
+ // if (column.columns) {
472
+ // sort(column.columns, grid);
473
+ // }
474
+ // });
475
+ // }
476
+ // function getOrDefault(value) {
477
+ // return typeof value === "undefined" ? -1 : value;
478
+ // }
479
+ // function getDepth(node) {
480
+ // if (node.length) {
481
+ // for (var i in node)
482
+ // return getDepth(node[i]);
483
+ // }
484
+ // else if (node.columns) {
485
+ // return 1 + getDepth(node.columns);
486
+ // }
487
+ // else {
488
+ // return 1;
489
+ // }
490
+ // }
491
+ // function getColumnsInDepth(node: any[], depth: number, current?: number) {
492
+ // var columns = [];
493
+ // current = current || 0;
494
+ // if (depth == current) {
495
+ // if (node.length) {
496
+ // node.forEach(function (n) {
497
+ // if (n.columns)
498
+ // n.extractColumns = function () {
499
+ // return extractColumns(n);
500
+ // };
501
+ // });
502
+ // }
503
+ // return node;
504
+ // } else {
505
+ // for (var i in node) {
506
+ // if (node[i].columns) {
507
+ // columns = columns.concat(getColumnsInDepth(node[i].columns, depth, current + 1));
508
+ // }
509
+ // }
510
+ // }
511
+ // return columns;
512
+ // }
513
+ // function extractColumns(node) {
514
+ // var result = [];
515
+ // if (node.hasOwnProperty("length")) {
516
+ // for (var i = 0; i < node.length; i++) {
517
+ // result = result.concat(extractColumns(node[i]));
518
+ // }
519
+ // } else {
520
+ // if (node.hasOwnProperty("columns")) {
521
+ // result = result.concat(extractColumns(node.columns));
522
+ // } else {
523
+ // return node;
524
+ // }
525
+ // }
526
+ // return result;
527
+ // }
528
+ // function cloneTreeColumns() {
529
+ // return (<any>window).Slick.$.shallowExtend([], treeColumns);
530
+ // }
531
+ // init();
532
+ // this.hasDepth = function () {
533
+ // for (var i in treeColumns) {
534
+ // if (treeColumns[i].hasOwnProperty('columns'))
535
+ // return true;
536
+ // }
537
+ // return false;
538
+ // };
539
+ // this.getTreeColumns = function () {
540
+ // return treeColumns;
541
+ // };
542
+ // this.extractColumns = function () {
543
+ // return this.hasDepth() ? extractColumns(treeColumns) : treeColumns;
544
+ // };
545
+ // this.getDepth = function () {
546
+ // return getDepth(treeColumns);
547
+ // };
548
+ // this.getColumnsInDepth = function (depth) {
549
+ // return getColumnsInDepth(treeColumns, depth);
550
+ // };
551
+ // this.getColumnsInGroup = function (groups) {
552
+ // return extractColumns(groups);
553
+ // };
554
+ // this.visibleColumns = function () {
555
+ // return filter(cloneTreeColumns(), function () {
556
+ // return this.visible;
557
+ // });
558
+ // };
559
+ // this.filter = function (condition) {
560
+ // return filter(cloneTreeColumns(), condition);
561
+ // };
562
+ // this.reOrder = function (grid) {
563
+ // return sort(treeColumns, grid);
564
+ // };
565
+ // this.getById = function (id) {
566
+ // return columnsById[id];
567
+ // };
568
+ // this.getInIds = function (ids) {
569
+ // return ids.map(function (id) {
570
+ // return columnsById[id];
571
+ // });
572
+ // };
573
+ // }
574
+ // (<any>window).Slick = Slick;