publ-echo-test 0.0.262 → 0.0.263
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.
- package/dist/lib/Resizable/Resizable.js +64 -62
- package/package.json +1 -1
@@ -31,7 +31,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
31
31
|
};
|
32
32
|
import { createElement as _createElement } from "react";
|
33
33
|
import { jsx as _jsx } from "react/jsx-runtime";
|
34
|
-
import React, { useEffect,
|
34
|
+
import React, { useEffect, useRef, } from "react";
|
35
35
|
import { cloneElement } from "./utils/cloneElement";
|
36
36
|
import { DraggableCore } from "../Draggable";
|
37
37
|
import classNames from "../../external-lib/classnames";
|
@@ -57,7 +57,7 @@ var Resizable = function (_a) {
|
|
57
57
|
var shouldShrinkRef = useRef(false);
|
58
58
|
var minWidth = useRef(0);
|
59
59
|
var minHeight = useRef(0);
|
60
|
-
|
60
|
+
useEffect(function () {
|
61
61
|
var _a;
|
62
62
|
if (!autoResize) {
|
63
63
|
return;
|
@@ -105,7 +105,6 @@ var Resizable = function (_a) {
|
|
105
105
|
}
|
106
106
|
}, [isResizing, autoResize, children, elementRef]);
|
107
107
|
useEffect(function () {
|
108
|
-
var _a, _b;
|
109
108
|
if (!autoResize) {
|
110
109
|
return;
|
111
110
|
}
|
@@ -118,67 +117,70 @@ var Resizable = function (_a) {
|
|
118
117
|
if (!elementRef.current) {
|
119
118
|
return;
|
120
119
|
}
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
var
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
var
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
120
|
+
setTimeout(function () {
|
121
|
+
var _a, _b;
|
122
|
+
var placeholder = document.querySelector(".placeholder");
|
123
|
+
if (!placeholder) {
|
124
|
+
return;
|
125
|
+
}
|
126
|
+
var target = (_a = placeholder.children[0].children[0].children[0]) !== null && _a !== void 0 ? _a : placeholder.children[0].children[0];
|
127
|
+
var oneComposition = target.querySelector(".composition-container");
|
128
|
+
var isContentsList = target.id === "contentslist-box";
|
129
|
+
if (!isContentsList || !oneComposition) {
|
130
|
+
return;
|
131
|
+
}
|
132
|
+
if (isContentsList && oneComposition) {
|
133
|
+
var minCellWidth = 10;
|
134
|
+
var minColHeight = 11;
|
135
|
+
var numberOfItems = Number(target.getAttribute("data-number-of-items"));
|
136
|
+
var numberOfColumns = Number(target.getAttribute("data-number-of-columns"));
|
137
|
+
var rowGap = Number(target.getAttribute("data-row-gap"));
|
138
|
+
var columnGap = Number(target.getAttribute("data-column-gap"));
|
139
|
+
var insetTop = Number(target.getAttribute("data-inset-top"));
|
140
|
+
var insetBottom = Number(target.getAttribute("data-inset-bottom"));
|
141
|
+
var compositionCols = Number(oneComposition.getAttribute("data-cols"));
|
142
|
+
var compositionRows = Number(oneComposition.getAttribute("data-rows"));
|
143
|
+
var oneCompositionMinWidth = minCellWidth * compositionCols + 20; /* 20px padding */
|
144
|
+
// let oneCompositionMinHeight =
|
145
|
+
// minColHeight * compositionRows + 20; /* 20px padding */
|
146
|
+
var contentsWrapper = placeholder.querySelector(".cb-contentslist-wrapper");
|
147
|
+
if (contentsWrapper) {
|
148
|
+
var wrapperH = contentsWrapper.clientHeight;
|
149
|
+
var tempCompositionH = oneComposition.clientHeight;
|
150
|
+
console.log("tempCompositionH", tempCompositionH);
|
151
|
+
console.log("parentH", (_b = oneComposition.parentElement) === null || _b === void 0 ? void 0 : _b.clientHeight);
|
152
|
+
var CompositionBGwrapperPaddingT = Number(oneComposition.getAttribute("data-wrapper-paddingT"));
|
153
|
+
var CompositionBGwrapperPaddingB = Number(oneComposition.getAttribute("data-wrapper-paddingB"));
|
154
|
+
if (tempCompositionH > wrapperH) {
|
155
|
+
var oneCompositionMinHeight = tempCompositionH +
|
156
|
+
CompositionBGwrapperPaddingT +
|
157
|
+
CompositionBGwrapperPaddingB;
|
158
|
+
var styles = getComputedStyle(target);
|
159
|
+
var paddingL = parseFloat(styles.paddingLeft);
|
160
|
+
var paddingR = parseFloat(styles.paddingRight);
|
161
|
+
var paddingT = parseFloat(styles.paddingTop);
|
162
|
+
var paddingB = parseFloat(styles.paddingBottom);
|
163
|
+
var paddingLR = paddingL + paddingR;
|
164
|
+
var paddingTB = paddingT + paddingB;
|
165
|
+
var listMinWidth = oneCompositionMinWidth * numberOfColumns +
|
166
|
+
(numberOfColumns - 1) * columnGap +
|
167
|
+
paddingLR;
|
168
|
+
var numberOfRows = Math.ceil(numberOfItems / numberOfColumns);
|
169
|
+
var listMinHeight = oneCompositionMinHeight * numberOfRows +
|
170
|
+
(numberOfRows - 1) * rowGap +
|
171
|
+
paddingTB +
|
172
|
+
insetTop +
|
173
|
+
insetBottom;
|
174
|
+
console.log("oneCompositionMinHeight", oneCompositionMinHeight);
|
175
|
+
console.log("listMinHeight", listMinHeight);
|
176
|
+
// minWidth.current = listMinWidth;
|
177
|
+
// minHeight.current = listMinHeight;
|
178
|
+
return;
|
179
|
+
}
|
178
180
|
}
|
181
|
+
return;
|
179
182
|
}
|
180
|
-
|
181
|
-
}
|
183
|
+
}, 0);
|
182
184
|
}, [isResizing, autoResize, children, elementRef]);
|
183
185
|
var resetData = function () {
|
184
186
|
lastHandleRectRef.current = null;
|