@@ -35679,10 +35679,13 @@
3567935679 minHeight: 0,
3568035680 maxWidth: 0,
3568135681 maxHeight: 0,
35682- enableResize: true,
35682+ initWidth: 0,
35683+ initHeight: 0,
3568335684 onResizeStart: Metro2.noop,
3568435685 onResize: Metro2.noop,
3568535686 onResizeStop: Metro2.noop,
35687+ onResizeEnable: Metro2.noop,
35688+ onResizeDisable: Metro2.noop,
3568635689 onResizableContainerCreate: Metro2.noop
3568735690 };
3568835691 Metro2.resizableContainerSetup = (options) => {
@@ -35718,12 +35721,24 @@
3571835721 if (Metro2.utils.getStyleOne(element2[0], "position") === "static") {
3571935722 element2.css("position", "relative");
3572035723 }
35721- const contour = $7(`<div>`).addClass("rc-contour").css({ zIndex: zIndex + 1 }).appendTo(element2);
35724+ if (o2.minWidth) {
35725+ element2.css("minWidth", o2.minWidth);
35726+ }
35727+ if (o2.minHeight) {
35728+ element2.css("minHeight", o2.minHeight);
35729+ }
35730+ if (o2.initWidth) {
35731+ element2.css("width", o2.initWidth);
35732+ }
35733+ if (o2.initHeight) {
35734+ element2.css("height", o2.initHeight);
35735+ }
35736+ const contour = $7(`<div>`).addClass("rc-contour").css({ zIndex: zIndex + 2 }).appendTo(element2);
3572235737 for (const p5 of this.pointers) {
35723- $7(`<div>`).addClass(`rc-point -${p5}`).css({ zIndex: zIndex + 2 }).attr("data-resize-direction", p5).appendTo(contour);
35738+ $7(`<div>`).addClass(`rc-point -${p5}`).css({ zIndex: zIndex + 3 }).attr("data-resize-direction", p5).appendTo(contour);
3572435739 }
35725- if (o2.enableResize === false) {
35726- contour.addClass("disabled" );
35740+ if (o2.canResize === false) {
35741+ this.disable( );
3572735742 }
3572835743 },
3572935744 _createEvents: function() {
@@ -35736,20 +35751,24 @@
3573635751 const maxH = o2.maxHeight || 0;
3573735752 const clamp = Metro2.utils.clamp;
3573835753 element2.on(Metro2.events.startAll, ".rc-point", function(e2) {
35739- if (!o2.canResize) return;
3574035754 e2.preventDefault();
3574135755 e2.stopPropagation();
35742- const pointer = $7(this).attr("data-resize-direction");
35756+ const point = $7(this).attr("data-resize-direction");
3574335757 const startXY = Metro2.utils.pageXY(e2);
3574435758 const { height, width, top, left } = element2[0].getBoundingClientRect();
3574535759 const { top: pTop, left: pLeft } = element2.parent()[0].getBoundingClientRect();
35760+ that._fireEvent("resize-start", {
35761+ size: that.size(),
35762+ element: element2[0],
35763+ point
35764+ });
3574635765 $7(document).on(
3574735766 Metro2.events.moveAll,
3574835767 (e3) => {
3574935768 const moveXY = Metro2.utils.pageXY(e3);
3575035769 const deltaX = moveXY.x - startXY.x;
3575135770 const deltaY = moveXY.y - startXY.y;
35752- if (pointer === "n") {
35771+ if (point === "n") {
3575335772 const rawH = height - deltaY;
3575435773 const newH = clamp(rawH, minH, maxH);
3575535774 const effDy = height - newH;
@@ -35759,21 +35778,21 @@
3575935778 top: `${newTop}px`
3576035779 });
3576135780 }
35762- if (pointer === "s") {
35781+ if (point === "s") {
3576335782 const rawH = height + deltaY;
3576435783 const newH = clamp(rawH, minH, maxH);
3576535784 element2.css({
3576635785 height: `${newH}px`
3576735786 });
3576835787 }
35769- if (pointer === "e") {
35788+ if (point === "e") {
3577035789 const rawW = width + deltaX;
3577135790 const newW = clamp(rawW, minW, maxW);
3577235791 element2.css({
3577335792 width: `${newW}px`
3577435793 });
3577535794 }
35776- if (pointer === "w") {
35795+ if (point === "w") {
3577735796 const rawW = width - deltaX;
3577835797 const newW = clamp(rawW, minW, maxW);
3577935798 const effDx = width - newW;
3578335802 left: `${newLeft}px`
3578435803 });
3578535804 }
35786- if (pointer === "ne") {
35805+ if (point === "ne") {
3578735806 const rawW = width + deltaX;
3578835807 const newW = clamp(rawW, minW, maxW);
3578935808 const rawH = height - deltaY;
3579635815 top: `${newTop}px`
3579735816 });
3579835817 }
35799- if (pointer === "nw") {
35818+ if (point === "nw") {
3580035819 const rawW = width - deltaX;
3580135820 const newW = clamp(rawW, minW, maxW);
3580235821 const effDx = width - newW;
3581235831 top: `${newTop}px`
3581335832 });
3581435833 }
35815- if (pointer === "se") {
35834+ if (point === "se") {
3581635835 const rawW = width + deltaX;
3581735836 const newW = clamp(rawW, minW, maxW);
3581835837 const rawH = height + deltaY;
3582235841 height: `${newH}px`
3582335842 });
3582435843 }
35825- if (pointer === "sw") {
35844+ if (point === "sw") {
3582635845 const rawW = width - deltaX;
3582735846 const newW = clamp(rawW, minW, maxW);
3582835847 const effDx = width - newW;
3583535854 left: `${newLeft}px`
3583635855 });
3583735856 }
35857+ that._fireEvent("resize", {
35858+ size: that.size(),
35859+ element: element2[0],
35860+ point
35861+ });
3583835862 },
3583935863 { ns: that.id }
3584035864 );
@@ -35843,20 +35867,51 @@
3584335867 () => {
3584435868 $7(document).off(Metro2.events.moveAll, { ns: that.id });
3584535869 $7(document).off(Metro2.events.stopAll, { ns: that.id });
35870+ that._fireEvent("resize-stop", {
35871+ size: that.size(),
35872+ element: element2[0],
35873+ point
35874+ });
3584635875 },
3584735876 { ns: that.id }
3584835877 );
3584935878 });
3585035879 },
35880+ size: function(width, height) {
35881+ const element2 = this.element;
35882+ const clamp = Metro2.utils.clamp;
35883+ const o2 = this.options;
35884+ if (width !== void 0) {
35885+ element2.css("width", clamp(width, o2.minWidth, o2.maxWidth));
35886+ }
35887+ if (height !== void 0) {
35888+ element2.css("height", clamp(height, o2.minHeight, o2.maxHeight));
35889+ }
35890+ const rect = element2[0].getBoundingClientRect();
35891+ return {
35892+ width: rect.width,
35893+ height: rect.height,
35894+ top: rect.top,
35895+ left: rect.left
35896+ };
35897+ },
3585135898 enable: function() {
3585235899 this.element.find(".rc-contour").removeClass("disabled");
35900+ this._fireEvent("resize-enable", {
35901+ size: this.size(),
35902+ element: this.element
35903+ });
3585335904 },
3585435905 disable: function() {
3585535906 this.element.find(".rc-contour").addClass("disabled");
35907+ this._fireEvent("resize-disable", {
35908+ size: this.size(),
35909+ element: this.element
35910+ });
3585635911 },
3585735912 changeAttribute: function(attr, val) {
3585835913 switch (attr) {
35859- case "data-enable -resize": {
35914+ case "data-can -resize": {
3586035915 if (val === "true") {
3586135916 this.enable();
3586235917 } else {
0 commit comments