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,68 +0,0 @@
1
- import { jQueryReplacement } from '../../core/jq';
2
- import { Slick } from '../slick.core';
3
- var $ = jQueryReplacement;
4
- // register namespace
5
- $.deepExtend(Slick, {
6
- "CellRangeDecorator": CellRangeDecorator
7
- });
8
- /***
9
- * Displays an overlay on top of a given cell range.
10
- *
11
- * TODO:
12
- * Currently, it blocks mouse events to DOM nodes behind it.
13
- * Use FF and WebKit-specific "pointer-events" CSS style, or some kind of event forwarding.
14
- * Could also construct the borders separately using 4 individual DIVs.
15
- *
16
- * @param {Grid} grid
17
- * @param {Object} options
18
- */
19
- export function CellRangeDecorator(grid, options) {
20
- var _elem;
21
- var _defaults = {
22
- selectionCssClass: 'slick-range-decorator',
23
- selectionCss: {
24
- "zIndex": "9999",
25
- "border": "2px dashed red"
26
- },
27
- offset: {
28
- top: -1,
29
- left: -1,
30
- height: -2,
31
- width: -2
32
- }
33
- };
34
- options = $.deepExtend({}, _defaults, options);
35
- function show(range) {
36
- if (!_elem) {
37
- _elem = $("<div></div>" /*, {css: options.selectionCss}*/)
38
- .addClass(options.selectionCssClass)
39
- .css("position", "absolute")
40
- .appendTo(grid.getActiveCanvasNode());
41
- if (options.selectionCss) {
42
- for (var key in options.selectionCss) {
43
- _elem.css(key, options.selectionCss[key]);
44
- }
45
- }
46
- }
47
- var from = grid.getCellNodeBox(range.fromRow, range.fromCell);
48
- var to = grid.getCellNodeBox(range.toRow, range.toCell);
49
- _elem.css({
50
- top: from.top + options.offset.top,
51
- left: from.left + options.offset.left,
52
- height: to.bottom - from.top + options.offset.height,
53
- width: to.right - from.left + options.offset.width
54
- });
55
- return _elem;
56
- }
57
- function hide() {
58
- if (_elem) {
59
- _elem.remove();
60
- _elem = null;
61
- }
62
- }
63
- $.shallowExtend(this, {
64
- "pluginName": "CellRangeDecorator",
65
- "show": show,
66
- "hide": hide
67
- });
68
- }
@@ -1 +0,0 @@
1
- export declare function CellRangeSelector(options: any): void;
@@ -1,144 +0,0 @@
1
- import { jQueryReplacement } from '../../core/jq';
2
- import { Slick, Range } from '../slick.core';
3
- import { CellRangeDecorator } from './slick.cellrangedecorator';
4
- var $ = jQueryReplacement;
5
- // register namespace
6
- $.deepExtend(window, {
7
- "Slick": {
8
- "CellRangeSelector": CellRangeSelector
9
- }
10
- });
11
- export function CellRangeSelector(options) {
12
- var _grid;
13
- var _currentlySelectedRange;
14
- var _canvas;
15
- var _gridOptions;
16
- var _$activeCanvas;
17
- var _dragging;
18
- var _decorator;
19
- var _self = this;
20
- var _handler = new Slick.EventHandler();
21
- var _defaults = {
22
- selectionCss: {
23
- "border": "2px dashed blue"
24
- }
25
- };
26
- // Frozen row & column variables
27
- var _rowOffset;
28
- var _columnOffset;
29
- var _isRightCanvas;
30
- var _isBottomCanvas;
31
- // Scrollings
32
- var _scrollTop = 0;
33
- var _scrollLeft = 0;
34
- function init(grid) {
35
- options = $.deepExtend({}, _defaults, options);
36
- _decorator = options.cellDecorator || new CellRangeDecorator(grid, options);
37
- _grid = grid;
38
- _canvas = _grid.getCanvasNode();
39
- _gridOptions = _grid.getOptions();
40
- _handler
41
- .subscribe(_grid.onScroll, handleScroll)
42
- .subscribe(_grid.onDragInit, handleDragInit)
43
- .subscribe(_grid.onDragStart, handleDragStart)
44
- .subscribe(_grid.onDrag, handleDrag)
45
- .subscribe(_grid.onDragEnd, handleDragEnd);
46
- }
47
- function destroy() {
48
- _handler.unsubscribeAll();
49
- }
50
- function getCellDecorator() {
51
- return _decorator;
52
- }
53
- function handleScroll(e, args) {
54
- _scrollTop = args.scrollTop;
55
- _scrollLeft = args.scrollLeft;
56
- }
57
- function handleDragInit(e, dd) {
58
- // Set the active canvas node because the decorator needs to append its
59
- // box to the correct canvas
60
- _$activeCanvas = $(_grid.getActiveCanvasNode(e));
61
- var c = _$activeCanvas.offset();
62
- _rowOffset = 0;
63
- _columnOffset = 0;
64
- _isBottomCanvas = _$activeCanvas.hasClass('grid-canvas-bottom');
65
- if (_gridOptions.frozenRow > -1 && _isBottomCanvas) {
66
- _rowOffset = (_gridOptions.frozenBottom) ? $('.grid-canvas-bottom').height() : $('.grid-canvas-top').height();
67
- }
68
- _isRightCanvas = _$activeCanvas.hasClass('grid-canvas-right');
69
- if (_gridOptions.frozenColumn > -1 && _isRightCanvas) {
70
- _columnOffset = $('.grid-canvas-left').width();
71
- }
72
- // // prevent the grid from cancelling drag'n'drop by default
73
- // e.stopImmediatePropagation();
74
- }
75
- function handleDragStart(e, dd) {
76
- var cell = _grid.getCellFromEvent(e);
77
- if (_self.onBeforeCellRangeSelected.notify(cell) !== false) {
78
- if (_grid.canCellBeSelected(cell.row, cell.cell)) {
79
- _dragging = true;
80
- e.stopImmediatePropagation();
81
- }
82
- }
83
- if (!_dragging) {
84
- return;
85
- }
86
- _grid.focus();
87
- var startX = dd.startX - $(_canvas).offset().left;
88
- if (_gridOptions.frozenColumn >= 0 && _isRightCanvas) {
89
- startX += _scrollLeft;
90
- }
91
- var startY = dd.startY - $(_canvas).offset().top;
92
- if (_gridOptions.frozenRow >= 0 && _isBottomCanvas) {
93
- startY += _scrollTop;
94
- }
95
- var start = _grid.getCellFromPoint(startX, startY);
96
- dd.range = { start: start, end: {} };
97
- _currentlySelectedRange = dd.range;
98
- return _decorator.show(new Range(start.row, start.cell));
99
- }
100
- function handleDrag(e, dd) {
101
- if (!_dragging) {
102
- return;
103
- }
104
- e.stopImmediatePropagation();
105
- var end = _grid.getCellFromPoint(e.pageX - _$activeCanvas.offset().left + _columnOffset, e.pageY - _$activeCanvas.offset().top + _rowOffset);
106
- // ... frozen column(s),
107
- if (_gridOptions.frozenColumn >= 0 && (!_isRightCanvas && (end.cell > _gridOptions.frozenColumn)) || (_isRightCanvas && (end.cell <= _gridOptions.frozenColumn))) {
108
- return;
109
- }
110
- // ... or frozen row(s)
111
- if (_gridOptions.frozenRow >= 0 && (!_isBottomCanvas && (end.row >= _gridOptions.frozenRow)) || (_isBottomCanvas && (end.row < _gridOptions.frozenRow))) {
112
- return;
113
- }
114
- // ... or regular grid (without any frozen options)
115
- if (!_grid.canCellBeSelected(end.row, end.cell)) {
116
- return;
117
- }
118
- dd.range.end = end;
119
- _decorator.show(new Slick.Range(dd.range.start.row, dd.range.start.cell, end.row, end.cell));
120
- }
121
- function handleDragEnd(e, dd) {
122
- if (!_dragging) {
123
- return;
124
- }
125
- _dragging = false;
126
- e.stopImmediatePropagation();
127
- _decorator.hide();
128
- _self.onCellRangeSelected.notify({
129
- range: new Slick.Range(dd.range.start.row, dd.range.start.cell, dd.range.end.row, dd.range.end.cell)
130
- });
131
- }
132
- function getCurrentRange() {
133
- return _currentlySelectedRange;
134
- }
135
- $.shallowExtend(this, {
136
- "init": init,
137
- "destroy": destroy,
138
- "pluginName": "CellRangeSelector",
139
- "getCellDecorator": getCellDecorator,
140
- "getCurrentRange": getCurrentRange,
141
- "onBeforeCellRangeSelected": new Slick.Event(),
142
- "onCellRangeSelected": new Slick.Event()
143
- });
144
- }
@@ -1 +0,0 @@
1
- export declare function CellSelectionModel(options?: any): void;
@@ -1,194 +0,0 @@
1
- import { jQueryReplacement } from '../../core/jq';
2
- import { Slick, Range } from '../slick.core';
3
- import { CellRangeSelector } from './slick.cellrangeselector';
4
- var $ = jQueryReplacement;
5
- // register namespace
6
- $.deepExtend(window, {
7
- "Slick": {
8
- "CellSelectionModel": CellSelectionModel
9
- }
10
- });
11
- export function CellSelectionModel(options) {
12
- var _grid;
13
- var _canvas;
14
- var _ranges = [];
15
- var _self = this;
16
- var _selector;
17
- if (typeof options === "undefined" || typeof options.cellRangeSelector === "undefined") {
18
- _selector = new CellRangeSelector({
19
- "selectionCss": {
20
- "border": "2px solid black"
21
- }
22
- });
23
- }
24
- else {
25
- _selector = options.cellRangeSelector;
26
- }
27
- var _options;
28
- var _defaults = {
29
- selectActiveCell: true
30
- };
31
- function init(grid) {
32
- _options = $.deepExtend({}, _defaults, options);
33
- _grid = grid;
34
- _canvas = _grid.getCanvasNode();
35
- _grid.onActiveCellChanged.subscribe(handleActiveCellChange);
36
- _grid.onKeyDown.subscribe(handleKeyDown);
37
- grid.registerPlugin(_selector);
38
- _selector.onCellRangeSelected.subscribe(handleCellRangeSelected);
39
- _selector.onBeforeCellRangeSelected.subscribe(handleBeforeCellRangeSelected);
40
- }
41
- function destroy() {
42
- _grid.onActiveCellChanged.unsubscribe(handleActiveCellChange);
43
- _grid.onKeyDown.unsubscribe(handleKeyDown);
44
- _selector.onCellRangeSelected.unsubscribe(handleCellRangeSelected);
45
- _selector.onBeforeCellRangeSelected.unsubscribe(handleBeforeCellRangeSelected);
46
- _grid.unregisterPlugin(_selector);
47
- }
48
- function removeInvalidRanges(ranges) {
49
- var result = [];
50
- for (var i = 0; i < ranges.length; i++) {
51
- var r = ranges[i];
52
- if (_grid.canCellBeSelected(r.fromRow, r.fromCell) && _grid.canCellBeSelected(r.toRow, r.toCell)) {
53
- result.push(r);
54
- }
55
- }
56
- return result;
57
- }
58
- function rangesAreEqual(range1, range2) {
59
- var areDifferent = (range1.length !== range2.length);
60
- if (!areDifferent) {
61
- for (var i = 0; i < range1.length; i++) {
62
- if (range1[i].fromCell !== range2[i].fromCell
63
- || range1[i].fromRow !== range2[i].fromRow
64
- || range1[i].toCell !== range2[i].toCell
65
- || range1[i].toRow !== range2[i].toRow) {
66
- areDifferent = true;
67
- break;
68
- }
69
- }
70
- }
71
- return !areDifferent;
72
- }
73
- function setSelectedRanges(ranges) {
74
- // simple check for: empty selection didn't change, prevent firing onSelectedRangesChanged
75
- if ((!_ranges || _ranges.length === 0) && (!ranges || ranges.length === 0)) {
76
- return;
77
- }
78
- // if range has not changed, don't fire onSelectedRangesChanged
79
- var rangeHasChanged = !rangesAreEqual(_ranges, ranges);
80
- _ranges = removeInvalidRanges(ranges);
81
- if (rangeHasChanged) {
82
- _self.onSelectedRangesChanged.notify(_ranges);
83
- }
84
- }
85
- function getSelectedRanges() {
86
- return _ranges;
87
- }
88
- function handleBeforeCellRangeSelected(e, args) {
89
- if (_grid.getEditorLock().isActive()) {
90
- e.stopPropagation();
91
- return false;
92
- }
93
- }
94
- function handleCellRangeSelected(e, args) {
95
- _grid.setActiveCell(args.range.fromRow, args.range.fromCell, false, false, true);
96
- setSelectedRanges([args.range]);
97
- }
98
- var lastActiveCell;
99
- function handleActiveCellChange(e, args) {
100
- if (_options.selectActiveCell && args.row != null && args.cell != null) {
101
- var metaKey = e.ctrlKey || e.metaKey;
102
- if (metaKey) {
103
- var ranges = getSelectedRanges().slice();
104
- ranges.push(new Range(args.row, args.cell));
105
- setSelectedRanges(ranges);
106
- lastActiveCell = { row: args.row, cell: args.cell };
107
- }
108
- else if (e.shiftKey) {
109
- var ranges = getSelectedRanges().slice();
110
- if (ranges.length > 0) {
111
- var currentRange = ranges.pop();
112
- if (lastActiveCell == null) {
113
- lastActiveCell = { row: currentRange.fromRow, cell: currentRange.fromCell };
114
- }
115
- var newRange = new Range(Math.min(lastActiveCell.row, args.row), Math.min(lastActiveCell.cell, args.cell), Math.max(lastActiveCell.row, args.row), Math.max(lastActiveCell.cell, args.cell));
116
- ranges.push(newRange);
117
- }
118
- else {
119
- ranges.push(new Range(args.row, args.cell));
120
- lastActiveCell = { row: args.row, cell: args.cell };
121
- }
122
- setSelectedRanges(ranges);
123
- }
124
- else {
125
- setSelectedRanges([new Range(args.row, args.cell)]);
126
- lastActiveCell = { row: args.row, cell: args.cell };
127
- }
128
- }
129
- else if (!_options.selectActiveCell) {
130
- // clear the previous selection once the cell changes
131
- setSelectedRanges([]);
132
- }
133
- }
134
- function handleKeyDown(e) {
135
- /***
136
- * Кey codes
137
- * 37 left
138
- * 38 up
139
- * 39 right
140
- * 40 down
141
- */
142
- var ranges, last;
143
- var active = _grid.getActiveCell();
144
- var metaKey = e.ctrlKey || e.metaKey;
145
- if (active && e.shiftKey && !metaKey && !e.altKey &&
146
- (e.which == 37 || e.which == 39 || e.which == 38 || e.which == 40)) {
147
- ranges = getSelectedRanges().slice();
148
- if (!ranges.length)
149
- ranges.push(new Range(active.row, active.cell));
150
- // keyboard can work with last range only
151
- last = ranges.pop();
152
- // can't handle selection out of active cell
153
- if (!last.contains(active.row, active.cell))
154
- last = new Range(active.row, active.cell);
155
- var dRow = last.toRow - last.fromRow, dCell = last.toCell - last.fromCell,
156
- // walking direction
157
- dirRow = active.row == last.fromRow ? 1 : -1, dirCell = active.cell == last.fromCell ? 1 : -1;
158
- if (e.which == 37) {
159
- dCell -= dirCell;
160
- }
161
- else if (e.which == 39) {
162
- dCell += dirCell;
163
- }
164
- else if (e.which == 38) {
165
- dRow -= dirRow;
166
- }
167
- else if (e.which == 40) {
168
- dRow += dirRow;
169
- }
170
- // define new selection range
171
- var new_last = new Slick.Range(active.row, active.cell, active.row + dirRow * dRow, active.cell + dirCell * dCell);
172
- if (removeInvalidRanges([new_last]).length) {
173
- ranges.push(new_last);
174
- var viewRow = dirRow > 0 ? new_last.toRow : new_last.fromRow;
175
- var viewCell = dirCell > 0 ? new_last.toCell : new_last.fromCell;
176
- _grid.scrollRowIntoView(viewRow);
177
- _grid.scrollCellIntoView(viewRow, viewCell);
178
- }
179
- else
180
- ranges.push(last);
181
- setSelectedRanges(ranges);
182
- e.preventDefault();
183
- e.stopPropagation();
184
- }
185
- }
186
- $.shallowExtend(this, {
187
- "getSelectedRanges": getSelectedRanges,
188
- "setSelectedRanges": setSelectedRanges,
189
- "init": init,
190
- "destroy": destroy,
191
- "pluginName": "CellSelectionModel",
192
- "onSelectedRangesChanged": new Slick.Event()
193
- });
194
- }
@@ -1,40 +0,0 @@
1
- .slick-column-name,
2
- .slick-sort-indicator {
3
- /**
4
- * This makes all "float:right" elements after it that spill over to the next line
5
- * display way below the lower boundary of the column thus hiding them.
6
- */
7
- display: inline-block;
8
- float: left;
9
- margin-bottom: 100px;
10
- }
11
-
12
- .slick-header-button {
13
- display: inline-block;
14
- float: right;
15
- vertical-align: top;
16
- margin: 1px;
17
- margin-right: 2rem;
18
- /**
19
- * This makes all "float:right" elements after it that spill over to the next line
20
- * display way below the lower boundary of the column thus hiding them.
21
- */
22
- margin-bottom: 100px;
23
- height: 15px;
24
- width: 15px;
25
- background-repeat: no-repeat;
26
- background-position: center center;
27
- cursor: pointer;
28
- }
29
-
30
- .slick-header-button-hidden {
31
- width: 0;
32
-
33
- -webkit-transition: 0.2s width;
34
- -ms-transition: 0.2s width;
35
- transition: 0.2s width;
36
- }
37
-
38
- .slick-header-column:hover > .slick-header-button {
39
- width: 15px;
40
- }
@@ -1,55 +0,0 @@
1
- import "./slick.headerbuttons.css";
2
- /***
3
- * A plugin to add custom buttons to column headers.
4
- *
5
- * USAGE:
6
- *
7
- * Add the plugin .js & .css files and register it with the grid.
8
- *
9
- * To specify a custom button in a column header, extend the column definition like so:
10
- *
11
- * var columns = [
12
- * {
13
- * id: 'myColumn',
14
- * name: 'My column',
15
- *
16
- * // This is the relevant part
17
- * header: {
18
- * buttons: [
19
- * {
20
- * // button options
21
- * },
22
- * {
23
- * // button options
24
- * }
25
- * ]
26
- * }
27
- * }
28
- * ];
29
- *
30
- * Available button options:
31
- * cssClass: CSS class to add to the button.
32
- * image: Relative button image path.
33
- * tooltip: Button tooltip.
34
- * showOnHover: Only show the button on hover.
35
- * handler: Button click handler.
36
- * command: A command identifier to be passed to the onCommand event handlers.
37
- *
38
- * The plugin exposes the following events:
39
- * onCommand: Fired on button click for buttons with 'command' specified.
40
- * Event args:
41
- * grid: Reference to the grid.
42
- * column: Column definition.
43
- * command: Button command identified.
44
- * button: Button options. Note that you can change the button options in your
45
- * event handler, and the column header will be automatically updated to
46
- * reflect them. This is useful if you want to implement something like a
47
- * toggle button.
48
- *
49
- *
50
- * @param options {Object} Options:
51
- * buttonCssClass: a CSS class to use for buttons (default 'slick-header-button')
52
- * @class Slick.Plugins.HeaderButtons
53
- * @constructor
54
- */
55
- export declare function HeaderButtons(options: any): void;
@@ -1,156 +0,0 @@
1
- import "./slick.headerbuttons.css";
2
- import { Slick } from "../slick.core";
3
- import { jQueryReplacement } from "../../core/jq";
4
- var $ = jQueryReplacement;
5
- // register namespace
6
- $.deepExtend(window, {
7
- "Slick": {
8
- "Plugins": {
9
- "HeaderButtons": HeaderButtons
10
- }
11
- }
12
- });
13
- /***
14
- * A plugin to add custom buttons to column headers.
15
- *
16
- * USAGE:
17
- *
18
- * Add the plugin .js & .css files and register it with the grid.
19
- *
20
- * To specify a custom button in a column header, extend the column definition like so:
21
- *
22
- * var columns = [
23
- * {
24
- * id: 'myColumn',
25
- * name: 'My column',
26
- *
27
- * // This is the relevant part
28
- * header: {
29
- * buttons: [
30
- * {
31
- * // button options
32
- * },
33
- * {
34
- * // button options
35
- * }
36
- * ]
37
- * }
38
- * }
39
- * ];
40
- *
41
- * Available button options:
42
- * cssClass: CSS class to add to the button.
43
- * image: Relative button image path.
44
- * tooltip: Button tooltip.
45
- * showOnHover: Only show the button on hover.
46
- * handler: Button click handler.
47
- * command: A command identifier to be passed to the onCommand event handlers.
48
- *
49
- * The plugin exposes the following events:
50
- * onCommand: Fired on button click for buttons with 'command' specified.
51
- * Event args:
52
- * grid: Reference to the grid.
53
- * column: Column definition.
54
- * command: Button command identified.
55
- * button: Button options. Note that you can change the button options in your
56
- * event handler, and the column header will be automatically updated to
57
- * reflect them. This is useful if you want to implement something like a
58
- * toggle button.
59
- *
60
- *
61
- * @param options {Object} Options:
62
- * buttonCssClass: a CSS class to use for buttons (default 'slick-header-button')
63
- * @class Slick.Plugins.HeaderButtons
64
- * @constructor
65
- */
66
- export function HeaderButtons(options) {
67
- var _grid;
68
- var _self = this;
69
- var _handler = new Slick.EventHandler();
70
- var _defaults = {
71
- buttonCssClass: "slick-header-button"
72
- };
73
- function init(grid) {
74
- options = $.deepExtend({}, _defaults, options);
75
- _grid = grid;
76
- _handler
77
- .subscribe(_grid.onHeaderCellRendered, handleHeaderCellRendered)
78
- .subscribe(_grid.onBeforeHeaderCellDestroy, handleBeforeHeaderCellDestroy);
79
- // Force the grid to re-render the header now that the events are hooked up.
80
- _grid.setColumns(_grid.getColumns());
81
- }
82
- function destroy() {
83
- _handler.unsubscribeAll();
84
- }
85
- function handleHeaderCellRendered(e, args) {
86
- var column = args.column;
87
- if (column.header && column.header.buttons) {
88
- // Append buttons in reverse order since they are floated to the right.
89
- var i = column.header.buttons.length;
90
- while (i--) {
91
- var button = column.header.buttons[i];
92
- var btn = $("<div></div>")
93
- .addClass(options.buttonCssClass)
94
- .data("column", column)
95
- .data("button", button);
96
- if (button.showOnHover) {
97
- btn.addClass("slick-header-button-hidden");
98
- }
99
- if (button.image) {
100
- btn.css("backgroundImage", "url(" + button.image + ")");
101
- }
102
- if (button.html) {
103
- btn.html(button.html);
104
- }
105
- if (button.cssClass) {
106
- btn.addClass(button.cssClass);
107
- }
108
- if (button.tooltip) {
109
- btn.attr("title", button.tooltip);
110
- }
111
- if (button.command) {
112
- btn.data("command", button.command);
113
- }
114
- if (button.handler) {
115
- btn.on("click", button.handler);
116
- }
117
- btn
118
- .on("click", handleButtonClick)
119
- .appendTo(args.node);
120
- }
121
- }
122
- }
123
- function handleBeforeHeaderCellDestroy(e, args) {
124
- var column = args.column;
125
- if (column.header && column.header.buttons) {
126
- // Removing buttons via jQuery will also clean up any event handlers and data.
127
- // NOTE: If you attach event handlers directly or using a different framework,
128
- // you must also clean them up here to avoid memory leaks.
129
- $(args.node).find("." + options.buttonCssClass).remove();
130
- }
131
- }
132
- function handleButtonClick(e) {
133
- var command = $(this).data("command");
134
- var columnDef = $(this).data("column");
135
- var button = $(this).data("button");
136
- if (command != null) {
137
- _self.onCommand.notify({
138
- "grid": _grid,
139
- "column": columnDef,
140
- "command": command,
141
- "button": button
142
- }, e, _self);
143
- // Update the header in case the user updated the button definition in the handler.
144
- _grid.updateColumnHeader(columnDef.id);
145
- }
146
- // Stop propagation so that it doesn't register as a header click event.
147
- e.preventDefault();
148
- e.stopPropagation();
149
- }
150
- $.shallowExtend(this, {
151
- "init": init,
152
- "destroy": destroy,
153
- "pluginName": "HeaderButtons",
154
- "onCommand": new Slick.Event()
155
- });
156
- }