publ-echo-test 0.0.217 → 0.0.218
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.
@@ -135,18 +135,19 @@ var GridItem = function (_a) {
|
|
135
135
|
var callback = function (mutationsList) {
|
136
136
|
for (var _i = 0, mutationsList_2 = mutationsList; _i < mutationsList_2.length; _i++) {
|
137
137
|
var mutation = mutationsList_2[_i];
|
138
|
-
var
|
139
|
-
console.log('mutation', mutation);
|
138
|
+
var isSizeChanged = mutation.attributeName === 'data-min-width' || mutation.attributeName === 'data-min-height';
|
140
139
|
var keepWidth = true;
|
141
140
|
var hasPaddingChanged = false;
|
142
|
-
var
|
141
|
+
var minWidth = Number(mutation.target.dataset.minWidth);
|
142
|
+
var minHeight = Number(mutation.target.dataset.minHeight);
|
143
|
+
var height = isSizeChanged
|
143
144
|
? mutation.target.parentNode.clientHeight
|
144
145
|
: mutation.target.clientHeight;
|
145
146
|
var width = targetNode.clientWidth;
|
146
|
-
if (!
|
147
|
+
if (!isSizeChanged && mutation.target instanceof Element) {
|
147
148
|
var styles = getComputedStyle(mutation.target);
|
148
|
-
var
|
149
|
-
if (
|
149
|
+
var minWidth_1 = parseFloat(styles.minWidth);
|
150
|
+
if (minWidth_1 > width) {
|
150
151
|
keepWidth = false;
|
151
152
|
}
|
152
153
|
// NOTE: POC
|
@@ -165,8 +166,8 @@ var GridItem = function (_a) {
|
|
165
166
|
var prevW = props.w;
|
166
167
|
var prevH = props.h;
|
167
168
|
var _a = calcWH(getPositionParams(), {
|
168
|
-
width:
|
169
|
-
height:
|
169
|
+
width: minWidth,
|
170
|
+
height: minHeight,
|
170
171
|
}, x, y, 'e', props.w, props.h, false), w_2 = _a.w, h_2 = _a.h;
|
171
172
|
if (keepWidth) {
|
172
173
|
w_2 = prevW;
|