jsl-ui 9.14.6 → 9.15.1

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.
@@ -130,6 +130,9 @@ export function Overlays(options) {
130
130
  });
131
131
  selectionOverlay.handle.style.left = (position.left + position.width - 4) + "px";
132
132
  selectionOverlay.handle.style.top = (position.top + position.height - 4) + "px";
133
+ // console.log("row: " + activeCell.row + " - cell: "+ activeCell.cell);
134
+ // console.log("container: " + grid.getCanvasNode(activeCell.row, activeCell.cell).className);
135
+ selectionOverlay.moveToContainer(grid.getCanvasNode(activeCell.cell, activeCell.row));
133
136
  }
134
137
  var dd_range;
135
138
  function handleOverlayDragStart(e) {
@@ -150,7 +153,7 @@ export function Overlays(options) {
150
153
  return;
151
154
  }
152
155
  var end = {
153
- cell: dd_range.start.cell, row: grid.getCellFromPoint(0, e.y).row - 1
156
+ cell: dd_range.start.cell, row: grid.getCellFromPoint(0, e.y /* + grid.getCanvasNode().scrollTop*/).row - 1
154
157
  };
155
158
  if (!grid.canCellBeSelected(end.row, end.cell)) {
156
159
  e.cancelEvent(); // ?
@@ -189,21 +192,36 @@ export function Overlays(options) {
189
192
  this.handle = document.createElement("div");
190
193
  this.handle.classList.add("handle-overlay");
191
194
  target.appendChild(this.handle);
192
- Moveable(target, {
193
- selector: ".handle-overlay",
194
- direction: "y",
195
- gridY: grid.getOptions().rowHeight,
196
- onStart: EventHandler.Create(function (e) {
197
- handleOverlayDragStart(e);
198
- }),
199
- onMove: EventHandler.Create(function (e) {
200
- handleOverlayDrag(e);
201
- }),
202
- onStop: EventHandler.Create(function (e) {
203
- handleOverlayDragEnd(e);
204
- })
205
- });
195
+ var gridContainer = target.closest(".slickgrid");
196
+ var viewports = gridContainer.querySelectorAll(".grid-canvas");
197
+ for (var idx = 0; idx < viewports.length; idx++) {
198
+ console.log(idx);
199
+ Moveable(viewports[idx], {
200
+ selector: ".handle-overlay",
201
+ direction: "y",
202
+ gridY: grid.getOptions().rowHeight,
203
+ containInParent: false,
204
+ onStart: EventHandler.Create(function (e) {
205
+ handleOverlayDragStart(e);
206
+ }),
207
+ onMove: EventHandler.Create(function (e) {
208
+ handleOverlayDrag(e);
209
+ }),
210
+ onStop: EventHandler.Create(function (e) {
211
+ handleOverlayDragEnd(e);
212
+ })
213
+ });
214
+ }
206
215
  }
216
+ this.moveToContainer = function (container) {
217
+ this.$left.appendTo(container);
218
+ this.$right.appendTo(container);
219
+ this.$top.appendTo(container);
220
+ this.$bottom.appendTo(container);
221
+ if (this.handle) {
222
+ $(this.handle).appendTo(container);
223
+ }
224
+ };
207
225
  this.toggle = function (showOrHide) {
208
226
  this.$left.css("display", showOrHide ? "" : "none");
209
227
  this.$right.css("display", showOrHide ? "" : "none");
@@ -220,7 +238,7 @@ export function Overlays(options) {
220
238
  function show(range) {
221
239
  r = range;
222
240
  if (!decorator) {
223
- decorator = new Overlay(grid.getCanvasNode(), false, 'selection-');
241
+ decorator = new Overlay(grid.getCanvasNode(range.fromCell, range.fromRow), false, 'selection-');
224
242
  }
225
243
  var from = targetGrid.getCellNodeBox(range.fromRow, range.fromCell);
226
244
  var to = targetGrid.getCellNodeBox(range.toRow, range.toCell);
@@ -250,7 +250,7 @@ export interface ISlickGrid<T> {
250
250
  cancelCurrentEdit: () => boolean;
251
251
  };
252
252
  "invalidateRow": (row: number) => void;
253
- "getCanvasNode": () => HTMLElement;
253
+ "getCanvasNode": (columnIdOrIdx?: number, rowIndex?: number) => HTMLElement;
254
254
  "focus": () => void;
255
255
  "getActiveCellPosition": () => {
256
256
  top: number;