feat: add dragMode option to ResizerOptions interface for flexible resizing behavior
This commit is contained in:
13
dist/grapes.mjs
vendored
13
dist/grapes.mjs
vendored
@@ -53696,6 +53696,11 @@ var Resizer = /** @class */ (function () {
|
||||
var parentEl = this.getParentEl();
|
||||
var resizer = this;
|
||||
var config = this.opts || {};
|
||||
if ("editor" in window) {
|
||||
// @ts-ignore
|
||||
config.dragMode = window.editor.getModel().getDragMode();
|
||||
}
|
||||
;
|
||||
var mouseFetch = this.mousePosFetcher;
|
||||
var attrName = 'data-' + config.prefix + 'handler';
|
||||
var rect = this.getElementPos(el, { avoidFrameZoom: true, avoidFrameOffset: true });
|
||||
@@ -53891,11 +53896,15 @@ var Resizer = /** @class */ (function () {
|
||||
var startW = unitWidth === '%' ? (startDim.w / 100) * parentW : startDim.w;
|
||||
var startH = unitHeight === '%' ? (startDim.h / 100) * parentH : startDim.h;
|
||||
var box = {
|
||||
t: startDim.t - parentRect.top,
|
||||
l: startDim.l - parentRect.left,
|
||||
t: startDim.t,
|
||||
l: startDim.l,
|
||||
w: startW,
|
||||
h: startH,
|
||||
};
|
||||
if (!(this.opts.dragMode === 'absolute')) {
|
||||
box.l += parentRect.left;
|
||||
box.t += parentRect.top;
|
||||
}
|
||||
if (!data)
|
||||
return;
|
||||
var attr = data.handlerAttr;
|
||||
|
Reference in New Issue
Block a user