publ-echo-test 0.0.319 → 0.0.320
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 +89 -109
- package/package.json +1 -1
@@ -105,115 +105,95 @@ var Resizable = function (_a) {
|
|
105
105
|
minWidth.current = Math.round(minWidthPx);
|
106
106
|
}
|
107
107
|
}, [isResizing, autoResize, children, elementRef]);
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
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
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
// oneCompositionMinWidth * numberOfColumns +
|
198
|
-
// (numberOfColumns - 1) * columnGap +
|
199
|
-
// paddingLR +
|
200
|
-
// compositionWrapperPaddingLR;
|
201
|
-
// const numberOfRows = Math.ceil(numberOfItems / numberOfColumns);
|
202
|
-
// const gridWrapperTotalH = gridWrapperInnerH + insetTop + insetBottom;
|
203
|
-
// const listMinHeight =
|
204
|
-
// oneCompositionMinHeight * numberOfRows +
|
205
|
-
// (numberOfRows - 1) * rowGap +
|
206
|
-
// paddingTB +
|
207
|
-
// insetTop +
|
208
|
-
// insetBottom;
|
209
|
-
// if (listMinHeight > gridWrapperTotalH) {
|
210
|
-
// minHeight.current = listMinHeight;
|
211
|
-
// }
|
212
|
-
// minWidth.current = listMinWidth;
|
213
|
-
// }
|
214
|
-
// }
|
215
|
-
// }, 0);
|
216
|
-
// }, [isResizing, autoResize, children, elementRef]);
|
108
|
+
useEffect(function () {
|
109
|
+
if (!autoResize) {
|
110
|
+
return;
|
111
|
+
}
|
112
|
+
if (!isResizing) {
|
113
|
+
extendedHeightRef.current = null;
|
114
|
+
minWidth.current = 0;
|
115
|
+
shouldShrinkRef.current = false;
|
116
|
+
minHeight.current = 0;
|
117
|
+
return;
|
118
|
+
}
|
119
|
+
if (!elementRef.current) {
|
120
|
+
return;
|
121
|
+
}
|
122
|
+
setTimeout(function () {
|
123
|
+
var _a;
|
124
|
+
var placeholder = document.querySelector(".placeholder");
|
125
|
+
if (!placeholder) {
|
126
|
+
return;
|
127
|
+
}
|
128
|
+
var target = (_a = placeholder.children[0].children[0].children[0]) !== null && _a !== void 0 ? _a : placeholder.children[0].children[0];
|
129
|
+
// const oneComposition = target.querySelector(".composition-container");
|
130
|
+
var isCCBLayoutbox = target.classList.contains("ccb-layout-box");
|
131
|
+
var layoutBox = target.children[0];
|
132
|
+
var contentsWrapper = layoutBox.children[0];
|
133
|
+
var oneComposition = contentsWrapper.querySelector(".composition-container");
|
134
|
+
// const oneComposition =
|
135
|
+
// contentsWrapper.children[0].children[0].children[0].children[2];
|
136
|
+
if (!isCCBLayoutbox || !oneComposition) {
|
137
|
+
return;
|
138
|
+
}
|
139
|
+
if (isCCBLayoutbox && oneComposition) {
|
140
|
+
var minCellWidth = 10;
|
141
|
+
var numberOfItems = Number(target.getAttribute("data-number-of-items"));
|
142
|
+
var numberOfColumns = Number(target.getAttribute("data-number-of-columns"));
|
143
|
+
var rowGap = Number(target.getAttribute("data-row-gap"));
|
144
|
+
var columnGap = Number(target.getAttribute("data-column-gap"));
|
145
|
+
var insetTop = Number(target.getAttribute("data-inset-top"));
|
146
|
+
var insetBottom = Number(target.getAttribute("data-inset-bottom"));
|
147
|
+
var compositionCols = Number(oneComposition.getAttribute("data-cols"));
|
148
|
+
// const compositionRows = Number(
|
149
|
+
// oneComposition.getAttribute("data-rows")!
|
150
|
+
// );
|
151
|
+
var oneCompositionMinWidth = minCellWidth * compositionCols + 20; /* 20px padding */
|
152
|
+
// let oneCompositionMinHeight =
|
153
|
+
// minColHeight * compositionRows + 20; /* 20px padding */
|
154
|
+
// const contentsWrapper = placeholder.querySelector(
|
155
|
+
// ".cb-contentslist-wrapper"
|
156
|
+
// );
|
157
|
+
if (contentsWrapper) {
|
158
|
+
var gridWrapperInnerH = contentsWrapper.clientHeight;
|
159
|
+
var oneCompositionH = oneComposition.clientHeight;
|
160
|
+
var compositionBGwrapperPaddingT = Number(oneComposition.getAttribute("data-wrapper-paddingt"));
|
161
|
+
var compositionBGwrapperPaddingB = Number(oneComposition.getAttribute("data-wrapper-paddingb"));
|
162
|
+
var compositionBGwrapperPaddingL = Number(oneComposition.getAttribute("data-wrapper-paddingl"));
|
163
|
+
var compositionBGwrapperPaddingR = Number(oneComposition.getAttribute("data-wrapper-paddingr"));
|
164
|
+
console.log("oneComposition", oneComposition);
|
165
|
+
console.log("onecompositionminheight", oneCompositionH);
|
166
|
+
var oneCompositionMinHeight = oneCompositionH +
|
167
|
+
compositionBGwrapperPaddingT +
|
168
|
+
compositionBGwrapperPaddingB;
|
169
|
+
var styles = getComputedStyle(target);
|
170
|
+
var paddingL = parseFloat(styles.paddingLeft);
|
171
|
+
var paddingR = parseFloat(styles.paddingRight);
|
172
|
+
var paddingT = parseFloat(styles.paddingTop);
|
173
|
+
var paddingB = parseFloat(styles.paddingBottom);
|
174
|
+
var paddingLR = paddingL + paddingR;
|
175
|
+
var paddingTB = paddingT + paddingB;
|
176
|
+
var compositionWrapperPaddingLR = (compositionBGwrapperPaddingL + compositionBGwrapperPaddingR) *
|
177
|
+
numberOfColumns;
|
178
|
+
var listMinWidth = oneCompositionMinWidth * numberOfColumns +
|
179
|
+
(numberOfColumns - 1) * columnGap +
|
180
|
+
paddingLR +
|
181
|
+
compositionWrapperPaddingLR;
|
182
|
+
var numberOfRows = Math.ceil(numberOfItems / numberOfColumns);
|
183
|
+
var gridWrapperTotalH = gridWrapperInnerH + insetTop + insetBottom;
|
184
|
+
var listMinHeight = oneCompositionMinHeight * numberOfRows +
|
185
|
+
(numberOfRows - 1) * rowGap +
|
186
|
+
paddingTB +
|
187
|
+
insetTop +
|
188
|
+
insetBottom;
|
189
|
+
if (listMinHeight > gridWrapperTotalH) {
|
190
|
+
minHeight.current = listMinHeight;
|
191
|
+
}
|
192
|
+
minWidth.current = listMinWidth;
|
193
|
+
}
|
194
|
+
}
|
195
|
+
}, 0);
|
196
|
+
}, [isResizing, autoResize, children, elementRef]);
|
217
197
|
var resetData = function () {
|
218
198
|
lastHandleRectRef.current = null;
|
219
199
|
slack.current = null;
|