jsl-ui 9.14.6 → 9.15.0

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) {
@@ -189,7 +192,8 @@ 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, {
195
+ var moveContainer = target.closest(".slickgrid");
196
+ Moveable(moveContainer, {
193
197
  selector: ".handle-overlay",
194
198
  direction: "y",
195
199
  gridY: grid.getOptions().rowHeight,
@@ -204,6 +208,15 @@ export function Overlays(options) {
204
208
  })
205
209
  });
206
210
  }
211
+ this.moveToContainer = function (container) {
212
+ this.$left.appendTo(container);
213
+ this.$right.appendTo(container);
214
+ this.$top.appendTo(container);
215
+ this.$bottom.appendTo(container);
216
+ if (this.handle) {
217
+ $(this.handle).appendTo(container);
218
+ }
219
+ };
207
220
  this.toggle = function (showOrHide) {
208
221
  this.$left.css("display", showOrHide ? "" : "none");
209
222
  this.$right.css("display", showOrHide ? "" : "none");
@@ -220,7 +233,8 @@ export function Overlays(options) {
220
233
  function show(range) {
221
234
  r = range;
222
235
  if (!decorator) {
223
- decorator = new Overlay(grid.getCanvasNode(), false, 'selection-');
236
+ console.log(grid.getContainerNode().className);
237
+ decorator = new Overlay(grid.getCanvasNode(range.fromCell, range.fromRow), false, 'selection-');
224
238
  }
225
239
  var from = targetGrid.getCellNodeBox(range.fromRow, range.fromCell);
226
240
  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;
package/lib/grid.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import "./ui/base.css";
1
2
  export * from "./grid/slick.core";
2
3
  export * from "./grid/slick.creator";
3
4
  export * from "./grid/slick.dataview";
package/lib/grid.js CHANGED
@@ -1,3 +1,4 @@
1
+ import "./ui/base.css";
1
2
  export * from "./grid/slick.core";
2
3
  export * from "./grid/slick.creator";
3
4
  export * from "./grid/slick.dataview";