publ-echo-test 0.0.317 → 0.0.319
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 +112 -88
- package/package.json +1 -1
@@ -77,11 +77,11 @@ var Resizable = function (_a) {
|
|
77
77
|
return;
|
78
78
|
}
|
79
79
|
var target = (_a = placeholder.children[0].children[0].children[0]) !== null && _a !== void 0 ? _a : placeholder.children[0].children[0];
|
80
|
-
var
|
81
|
-
if (
|
80
|
+
var isCCBLayoutbox = target.classList.contains("ccb-layout-box");
|
81
|
+
if (isCCBLayoutbox) {
|
82
82
|
return;
|
83
83
|
}
|
84
|
-
if (target.clientHeight && !
|
84
|
+
if (target.clientHeight && !isCCBLayoutbox) {
|
85
85
|
minHeight.current = target.clientHeight;
|
86
86
|
}
|
87
87
|
// target.clientHeight -> 실제 "노드"의 height. (gridItem아닌)
|
@@ -105,91 +105,115 @@ var Resizable = function (_a) {
|
|
105
105
|
minWidth.current = Math.round(minWidthPx);
|
106
106
|
}
|
107
107
|
}, [isResizing, autoResize, children, elementRef]);
|
108
|
-
useEffect(
|
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
|
-
|
108
|
+
// useEffect(() => {
|
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(() => {
|
123
|
+
// const placeholder = document.querySelector(".placeholder");
|
124
|
+
// if (!placeholder) {
|
125
|
+
// return;
|
126
|
+
// }
|
127
|
+
// const target =
|
128
|
+
// placeholder.children[0].children[0].children[0] ??
|
129
|
+
// placeholder.children[0].children[0];
|
130
|
+
// // const oneComposition = target.querySelector(".composition-container");
|
131
|
+
// const isCCBLayoutbox = target.classList.contains("ccb-layout-box");
|
132
|
+
// const layoutBox = target.children[0];
|
133
|
+
// const contentsWrapper = layoutBox.children[0];
|
134
|
+
// const oneComposition = contentsWrapper.querySelector(
|
135
|
+
// ".composition-container"
|
136
|
+
// );
|
137
|
+
// // const oneComposition =
|
138
|
+
// // contentsWrapper.children[0].children[0].children[0].children[2];
|
139
|
+
// if (!isCCBLayoutbox || !oneComposition) {
|
140
|
+
// return;
|
141
|
+
// }
|
142
|
+
// if (isCCBLayoutbox && oneComposition) {
|
143
|
+
// const minCellWidth = 10;
|
144
|
+
// const numberOfItems = Number(
|
145
|
+
// target.getAttribute("data-number-of-items")!
|
146
|
+
// );
|
147
|
+
// const numberOfColumns = Number(
|
148
|
+
// target.getAttribute("data-number-of-columns")!
|
149
|
+
// );
|
150
|
+
// const rowGap = Number(target.getAttribute("data-row-gap")!);
|
151
|
+
// const columnGap = Number(target.getAttribute("data-column-gap")!);
|
152
|
+
// const insetTop = Number(target.getAttribute("data-inset-top")!);
|
153
|
+
// const insetBottom = Number(target.getAttribute("data-inset-bottom")!);
|
154
|
+
// const compositionCols = Number(
|
155
|
+
// oneComposition.getAttribute("data-cols")!
|
156
|
+
// );
|
157
|
+
// // const compositionRows = Number(
|
158
|
+
// // oneComposition.getAttribute("data-rows")!
|
159
|
+
// // );
|
160
|
+
// const oneCompositionMinWidth =
|
161
|
+
// minCellWidth * compositionCols + 20; /* 20px padding */
|
162
|
+
// // let oneCompositionMinHeight =
|
163
|
+
// // minColHeight * compositionRows + 20; /* 20px padding */
|
164
|
+
// // const contentsWrapper = placeholder.querySelector(
|
165
|
+
// // ".cb-contentslist-wrapper"
|
166
|
+
// // );
|
167
|
+
// if (contentsWrapper) {
|
168
|
+
// const gridWrapperInnerH = contentsWrapper.clientHeight;
|
169
|
+
// const oneCompositionH = oneComposition.clientHeight;
|
170
|
+
// const compositionBGwrapperPaddingT = Number(
|
171
|
+
// oneComposition.getAttribute("data-wrapper-paddingt")
|
172
|
+
// );
|
173
|
+
// const compositionBGwrapperPaddingB = Number(
|
174
|
+
// oneComposition.getAttribute("data-wrapper-paddingb")
|
175
|
+
// );
|
176
|
+
// const compositionBGwrapperPaddingL = Number(
|
177
|
+
// oneComposition.getAttribute("data-wrapper-paddingl")
|
178
|
+
// );
|
179
|
+
// const compositionBGwrapperPaddingR = Number(
|
180
|
+
// oneComposition.getAttribute("data-wrapper-paddingr")
|
181
|
+
// );
|
182
|
+
// const oneCompositionMinHeight =
|
183
|
+
// oneCompositionH +
|
184
|
+
// compositionBGwrapperPaddingT +
|
185
|
+
// compositionBGwrapperPaddingB;
|
186
|
+
// const styles = getComputedStyle(target as Element);
|
187
|
+
// const paddingL = parseFloat(styles.paddingLeft);
|
188
|
+
// const paddingR = parseFloat(styles.paddingRight);
|
189
|
+
// const paddingT = parseFloat(styles.paddingTop);
|
190
|
+
// const paddingB = parseFloat(styles.paddingBottom);
|
191
|
+
// const paddingLR = paddingL + paddingR;
|
192
|
+
// const paddingTB = paddingT + paddingB;
|
193
|
+
// const compositionWrapperPaddingLR =
|
194
|
+
// (compositionBGwrapperPaddingL + compositionBGwrapperPaddingR) *
|
195
|
+
// numberOfColumns;
|
196
|
+
// const listMinWidth =
|
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]);
|
193
217
|
var resetData = function () {
|
194
218
|
lastHandleRectRef.current = null;
|
195
219
|
slack.current = null;
|