jsl-ui 9.18.2 → 9.18.3

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 (214) hide show
  1. package/lib/grid.css +0 -8
  2. package/lib/index.css.map +1 -1
  3. package/lib/index.js +10198 -61
  4. package/lib/index.js.map +1 -1
  5. package/package.json +1 -1
  6. package/lib/components/IntervalComponent.d.ts +0 -17
  7. package/lib/components/IntervalComponent.js +0 -68
  8. package/lib/components/auto-suggest/AutoSuggestComponent.d.ts +0 -22
  9. package/lib/components/auto-suggest/AutoSuggestComponent.js +0 -49
  10. package/lib/components/button/ButtonComponent.d.ts +0 -18
  11. package/lib/components/button/ButtonComponent.js +0 -46
  12. package/lib/components/checkbox/CheckBoxComponent.d.ts +0 -28
  13. package/lib/components/checkbox/CheckBoxComponent.js +0 -94
  14. package/lib/components/checkbox/CheckBoxStyle.scss +0 -86
  15. package/lib/components/date/DateComponent.d.ts +0 -32
  16. package/lib/components/date/DateComponent.js +0 -106
  17. package/lib/components/date-range/DateRangeComponent.d.ts +0 -35
  18. package/lib/components/date-range/DateRangeComponent.js +0 -136
  19. package/lib/components/date-range/DateRangeStyle.scss +0 -12
  20. package/lib/components/date-time/DateTimeComponent.d.ts +0 -15
  21. package/lib/components/date-time/DateTimeComponent.js +0 -53
  22. package/lib/components/date-time/DateTimeStyle.scss +0 -7
  23. package/lib/components/dialog/DialogComponent.d.ts +0 -67
  24. package/lib/components/dialog/DialogComponent.js +0 -242
  25. package/lib/components/drop-down/DropDownComponent.d.ts +0 -27
  26. package/lib/components/drop-down/DropDownComponent.js +0 -74
  27. package/lib/components/expander/ExpanderComponent.d.ts +0 -27
  28. package/lib/components/expander/ExpanderComponent.js +0 -90
  29. package/lib/components/expander/ExpanderStyle.scss +0 -47
  30. package/lib/components/expander/OldExpanderStyle.scss +0 -37
  31. package/lib/components/form-field/FormComponent.d.ts +0 -12
  32. package/lib/components/form-field/FormComponent.js +0 -26
  33. package/lib/components/form-field/FormFieldComponent.d.ts +0 -38
  34. package/lib/components/form-field/FormFieldComponent.js +0 -139
  35. package/lib/components/form-field/FormFieldStyle.scss +0 -87
  36. package/lib/components/grid/GridComponent.d.ts +0 -26
  37. package/lib/components/grid/GridComponent.js +0 -116
  38. package/lib/components/input/InputComponent.d.ts +0 -33
  39. package/lib/components/input/InputComponent.js +0 -144
  40. package/lib/components/loading/LoadingComponent.d.ts +0 -8
  41. package/lib/components/loading/LoadingComponent.js +0 -22
  42. package/lib/components/loading/LoadingStyle.css +0 -29
  43. package/lib/components/navigation/NavigationComponent.d.ts +0 -34
  44. package/lib/components/navigation/NavigationComponent.js +0 -70
  45. package/lib/components/navigation/NavigationStyle.scss +0 -226
  46. package/lib/components/notification/Notification.d.ts +0 -17
  47. package/lib/components/notification/Notification.js +0 -56
  48. package/lib/components/notification/Notification.scss +0 -19
  49. package/lib/components/number/NumberComponent.d.ts +0 -25
  50. package/lib/components/number/NumberComponent.js +0 -87
  51. package/lib/components/overlay/OverlayComponent.d.ts +0 -27
  52. package/lib/components/overlay/OverlayComponent.js +0 -149
  53. package/lib/components/overlay/overlay.css +0 -57
  54. package/lib/components/progress/ProgressComponent.d.ts +0 -18
  55. package/lib/components/progress/ProgressComponent.js +0 -42
  56. package/lib/components/progress/ProgressStyle.scss +0 -15
  57. package/lib/components/ribbon-menu/RibbonMenuComponent.d.ts +0 -12
  58. package/lib/components/ribbon-menu/RibbonMenuComponent.js +0 -34
  59. package/lib/components/ribbon-menu/RibbonMenuStyle.scss +0 -76
  60. package/lib/components/select/SelectComponent.d.ts +0 -79
  61. package/lib/components/select/SelectComponent.js +0 -362
  62. package/lib/components/select/SelectDDAreaComponent.d.ts +0 -32
  63. package/lib/components/select/SelectDDAreaComponent.js +0 -317
  64. package/lib/components/select/SelectStyle.scss +0 -187
  65. package/lib/components/slider/nouislider.css +0 -310
  66. package/lib/components/slider/nouislider.d.ts +0 -44
  67. package/lib/components/slider/nouislider.js +0 -2158
  68. package/lib/components/stack-panel/SplitterComponent.d.ts +0 -21
  69. package/lib/components/stack-panel/SplitterComponent.js +0 -126
  70. package/lib/components/stack-panel/SplitterStyle.scss +0 -45
  71. package/lib/components/stack-panel/StackPanelComponent.d.ts +0 -20
  72. package/lib/components/stack-panel/StackPanelComponent.js +0 -64
  73. package/lib/components/stack-panel/StackPanelStyle.scss +0 -53
  74. package/lib/components/tabs/TabsComponent.d.ts +0 -39
  75. package/lib/components/tabs/TabsComponent.js +0 -177
  76. package/lib/components/tabs/TabsStyle.scss +0 -76
  77. package/lib/components/time/TimeComponent.d.ts +0 -29
  78. package/lib/components/time/TimeComponent.js +0 -113
  79. package/lib/components/time/TimeComponent.scss +0 -4
  80. package/lib/components/tree-view/TreeViewComponent.d.ts +0 -23
  81. package/lib/components/tree-view/TreeViewComponent.js +0 -45
  82. package/lib/components/tree-view/TreeViewStyle.scss +0 -96
  83. package/lib/components/virtual-render/VirtualRenderComponent.d.ts +0 -30
  84. package/lib/components/virtual-render/VirtualRenderComponent.js +0 -104
  85. package/lib/components/virtual-render/VirtualRenderStyle.scss +0 -9
  86. package/lib/core/culture.d.ts +0 -5
  87. package/lib/core/culture.js +0 -385
  88. package/lib/core/date.d.ts +0 -14
  89. package/lib/core/date.js +0 -350
  90. package/lib/core/helper.d.ts +0 -12
  91. package/lib/core/helper.js +0 -101
  92. package/lib/core/jq.d.ts +0 -37
  93. package/lib/core/jq.js +0 -371
  94. package/lib/core/lang.d.ts +0 -24
  95. package/lib/core/lang.js +0 -28
  96. package/lib/core/numeric.d.ts +0 -7
  97. package/lib/core/numeric.js +0 -143
  98. package/lib/core/polyfills.d.ts +0 -0
  99. package/lib/core/polyfills.js +0 -22
  100. package/lib/core.d.ts +0 -6
  101. package/lib/core.js +0 -6
  102. package/lib/grid/controls/slick.columnpicker.css +0 -46
  103. package/lib/grid/controls/slick.draggablegrouping.css +0 -52
  104. package/lib/grid/controls/slick.gridmenu.css +0 -127
  105. package/lib/grid/controls/slick.pager.css +0 -41
  106. package/lib/grid/examples/examples.css +0 -203
  107. package/lib/grid/filterDialogs/dateRangeFilter.d.ts +0 -7
  108. package/lib/grid/filterDialogs/dateRangeFilter.js +0 -156
  109. package/lib/grid/filterDialogs/excelFilter.d.ts +0 -9
  110. package/lib/grid/filterDialogs/excelFilter.js +0 -313
  111. package/lib/grid/plugins/ext.overlay.css +0 -28
  112. package/lib/grid/plugins/ext.overlay.d.ts +0 -2
  113. package/lib/grid/plugins/ext.overlay.js +0 -291
  114. package/lib/grid/plugins/slick.cellrangedecorator.d.ts +0 -12
  115. package/lib/grid/plugins/slick.cellrangedecorator.js +0 -68
  116. package/lib/grid/plugins/slick.cellrangeselector.d.ts +0 -1
  117. package/lib/grid/plugins/slick.cellrangeselector.js +0 -144
  118. package/lib/grid/plugins/slick.cellselectionmodel.d.ts +0 -1
  119. package/lib/grid/plugins/slick.cellselectionmodel.js +0 -194
  120. package/lib/grid/plugins/slick.headerbuttons.css +0 -40
  121. package/lib/grid/plugins/slick.headerbuttons.d.ts +0 -55
  122. package/lib/grid/plugins/slick.headerbuttons.js +0 -156
  123. package/lib/grid/plugins/slick.headermenu.css +0 -101
  124. package/lib/grid/plugins/slick.headermenu.d.ts +0 -74
  125. package/lib/grid/plugins/slick.headermenu.js +0 -260
  126. package/lib/grid/plugins/slick.rowdetailview.css +0 -37
  127. package/lib/grid/plugins/slick.rowmovemanager.css +0 -8
  128. package/lib/grid/plugins/slick.rowmovemanager.d.ts +0 -18
  129. package/lib/grid/plugins/slick.rowmovemanager.js +0 -249
  130. package/lib/grid/plugins/slick.rowselectionmodel.d.ts +0 -1
  131. package/lib/grid/plugins/slick.rowselectionmodel.js +0 -167
  132. package/lib/grid/slick-default-theme.css +0 -154
  133. package/lib/grid/slick.core.d.ts +0 -90
  134. package/lib/grid/slick.core.js +0 -574
  135. package/lib/grid/slick.creator.d.ts +0 -80
  136. package/lib/grid/slick.creator.js +0 -723
  137. package/lib/grid/slick.dataview.d.ts +0 -71
  138. package/lib/grid/slick.dataview.js +0 -1080
  139. package/lib/grid/slick.editors.core.d.ts +0 -4
  140. package/lib/grid/slick.editors.core.js +0 -232
  141. package/lib/grid/slick.editors.date.d.ts +0 -2
  142. package/lib/grid/slick.editors.date.js +0 -125
  143. package/lib/grid/slick.editors.lookup.d.ts +0 -14
  144. package/lib/grid/slick.editors.lookup.js +0 -353
  145. package/lib/grid/slick.editors.nav.d.ts +0 -6
  146. package/lib/grid/slick.editors.nav.js +0 -22
  147. package/lib/grid/slick.formatters.d.ts +0 -17
  148. package/lib/grid/slick.formatters.js +0 -137
  149. package/lib/grid/slick.grid.css +0 -325
  150. package/lib/grid/slick.grid.d.ts +0 -284
  151. package/lib/grid/slick.grid.js +0 -5395
  152. package/lib/grid/slick.groupitemmetadataprovider.d.ts +0 -39
  153. package/lib/grid/slick.groupitemmetadataprovider.js +0 -165
  154. package/lib/grid/slick.tree.css +0 -20
  155. package/lib/grid/slick.tree.d.ts +0 -33
  156. package/lib/grid/slick.tree.js +0 -220
  157. package/lib/grid.d.ts +0 -13
  158. package/lib/grid.js +0 -13
  159. package/lib/index.css +0 -2584
  160. package/lib/index.d.ts +0 -56
  161. package/lib/interaction/dataconverter.d.ts +0 -4
  162. package/lib/interaction/dataconverter.js +0 -1
  163. package/lib/interaction/eventhandler.d.ts +0 -13
  164. package/lib/interaction/eventhandler.js +0 -42
  165. package/lib/interaction/moveable.css +0 -0
  166. package/lib/interaction/moveable.d.ts +0 -39
  167. package/lib/interaction/moveable.js +0 -172
  168. package/lib/interaction/resizable.css +0 -33
  169. package/lib/interaction/resizable.d.ts +0 -37
  170. package/lib/interaction/resizable.js +0 -123
  171. package/lib/ui/auto.suggest.css +0 -14
  172. package/lib/ui/auto.suggest.d.ts +0 -17
  173. package/lib/ui/auto.suggest.js +0 -255
  174. package/lib/ui/base.css +0 -150
  175. package/lib/ui/date.picker/css/date-range-picker.css +0 -87
  176. package/lib/ui/date.picker/css/tiny-date-picker.css +0 -326
  177. package/lib/ui/date.picker/date-picker-options.d.ts +0 -11
  178. package/lib/ui/date.picker/date-picker-options.js +0 -76
  179. package/lib/ui/date.picker/lib/date-manip.d.ts +0 -74
  180. package/lib/ui/date.picker/lib/date-manip.js +0 -120
  181. package/lib/ui/date.picker/lib/dom.d.ts +0 -23
  182. package/lib/ui/date.picker/lib/dom.js +0 -28
  183. package/lib/ui/date.picker/lib/emitter.d.ts +0 -13
  184. package/lib/ui/date.picker/lib/emitter.js +0 -49
  185. package/lib/ui/date.picker/lib/fns.d.ts +0 -23
  186. package/lib/ui/date.picker/lib/fns.js +0 -43
  187. package/lib/ui/date.picker/mode/base-mode.d.ts +0 -26
  188. package/lib/ui/date.picker/mode/base-mode.js +0 -248
  189. package/lib/ui/date.picker/mode/dropdown-mode.d.ts +0 -28
  190. package/lib/ui/date.picker/mode/dropdown-mode.js +0 -50
  191. package/lib/ui/date.picker/mode/index.d.ts +0 -28
  192. package/lib/ui/date.picker/mode/index.js +0 -18
  193. package/lib/ui/date.picker/mode/modal-mode.d.ts +0 -25
  194. package/lib/ui/date.picker/mode/modal-mode.js +0 -17
  195. package/lib/ui/date.picker/mode/permanent-mode.d.ts +0 -29
  196. package/lib/ui/date.picker/mode/permanent-mode.js +0 -19
  197. package/lib/ui/date.picker/views/day-picker.d.ts +0 -40
  198. package/lib/ui/date.picker/views/day-picker.js +0 -155
  199. package/lib/ui/date.picker/views/month-picker.d.ts +0 -26
  200. package/lib/ui/date.picker/views/month-picker.js +0 -65
  201. package/lib/ui/date.picker/views/year-picker.d.ts +0 -20
  202. package/lib/ui/date.picker/views/year-picker.js +0 -66
  203. package/lib/ui/date.picker.d.ts +0 -66
  204. package/lib/ui/date.picker.js +0 -32
  205. package/lib/ui/dialog.css +0 -109
  206. package/lib/ui/dialog.d.ts +0 -22
  207. package/lib/ui/dialog.js +0 -113
  208. package/lib/ui/drop.down.css +0 -472
  209. package/lib/ui/drop.down.d.ts +0 -52
  210. package/lib/ui/drop.down.js +0 -2112
  211. package/lib/ui/number.input.css +0 -3
  212. package/lib/ui/number.input.d.ts +0 -12
  213. package/lib/ui/number.input.js +0 -64
  214. package/lib/ui/tabs.css +0 -53
@@ -1,574 +0,0 @@
1
- import { jQueryReplacement } from "../core/jq";
2
- export var 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,80 +0,0 @@
1
- import { ISlickColumn, ISlickEvent } from "./slick.core";
2
- import { ISlickGridOptions, ISlickGrid } from "./slick.grid";
3
- import { ISlickDataView } from "./slick.dataview";
4
- import { RowMoveManager } from "./plugins/slick.rowmovemanager";
5
- export interface ISlickCreatorOptions extends ISlickGridOptions {
6
- primaryKey: string;
7
- showHeaderMenu?: boolean;
8
- provideDefaultValues?: (item: any) => boolean | void;
9
- groupItemOptions?: any;
10
- showColumnGroups?: boolean;
11
- mode?: "client" | "server";
12
- dataView?: any;
13
- saveColumnsKey?: string;
14
- groupItemMetadataProvider?: any;
15
- getFilterValues?: (column: ISlickColumn) => Promise<{
16
- [key: string]: any[];
17
- } | any[]>;
18
- showFilterDialog?: (column: ISlickColumn, grid: IJSLGrid<any>) => void;
19
- allowRowMove?: boolean;
20
- enableFillDown?: boolean;
21
- setDataItemValueForColumn?: (item: any, columnDef: ISlickColumn, value: any) => void;
22
- }
23
- export interface IJSLGrid<T> extends ISlickGrid<T> {
24
- dataView: ISlickDataView<T>;
25
- setHeight: (height: number) => void;
26
- getHeight: () => number;
27
- sort: (column: ISlickColumn, sortAsc?: boolean) => void;
28
- refreshData: () => void;
29
- setData: (newData: T[]) => void;
30
- getData: () => T[];
31
- refresh: () => void;
32
- addFormula: (field: string, fnc: (row: T, grid: IJSLGrid<T>, field: string) => any, usedColumns: string[]) => void;
33
- getFormattedValue: (column: ISlickColumn, value: any, item?: T) => string;
34
- getContentWidth: (column: ISlickColumn, row: number) => number;
35
- fitToContent: (column: ISlickColumn) => void;
36
- triggerAllFormulas: () => void;
37
- columnHasFilter: (columnId: string) => boolean;
38
- refreshDataItem: (item: T) => void;
39
- addFilter: (filter: {
40
- field: string;
41
- columnId?: string;
42
- match: (item: T, field: string) => boolean;
43
- combine?: "or" | "and";
44
- }, dontrefresh?: boolean) => void;
45
- setFilters: (filters: Array<{
46
- field: string;
47
- columnId?: string;
48
- match: (item: T, field: string) => boolean;
49
- combine?: "or" | "and";
50
- }>, dontrefresh?: boolean) => void;
51
- getFilters: () => Array<{
52
- field: string;
53
- columnId?: string;
54
- match: (item: T, field: string) => boolean;
55
- combine?: "or" | "and";
56
- }>;
57
- clearFilter: (field?: string, dontrefresh?: boolean) => void;
58
- refreshFilters: (refreshFilters?: boolean) => void;
59
- getSelectedItems: () => T[];
60
- onAfterEdit: ISlickEvent<{
61
- grid: IJSLGrid<T>;
62
- oldValue: any;
63
- newValue: any;
64
- column: ISlickColumn;
65
- item: T;
66
- }>;
67
- onAfterFillDown: ISlickEvent<{
68
- grid: IJSLGrid<T>;
69
- items: T[];
70
- direction: "up" | "down";
71
- range: any;
72
- column: ISlickColumn;
73
- value: any;
74
- }>;
75
- onFiltersChanged: ISlickEvent<void>;
76
- getHeaderMenu: () => any;
77
- getFilterDialog: () => any;
78
- getRowMoveManager: () => typeof RowMoveManager;
79
- }
80
- export declare function createJSLGrid<T>(selector: string | HTMLDivElement, data: T[], columns: ISlickColumn[], option: ISlickCreatorOptions): IJSLGrid<T>;