@schukai/monster 4.136.14 → 4.136.16
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/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"author":"Volker Schukai","dependencies":{"@floating-ui/dom":"^1.7.6"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"4.136.
|
|
1
|
+
{"author":"Volker Schukai","dependencies":{"@floating-ui/dom":"^1.7.6"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"4.136.16"}
|
|
@@ -310,6 +310,18 @@ class MessageStateButton extends Popper {
|
|
|
310
310
|
return resolveContentOverflowMode.call(this);
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
+
/**
|
|
314
|
+
* Recalculates the open message popper after dynamic content changes.
|
|
315
|
+
*
|
|
316
|
+
* @return {MessageStateButton}
|
|
317
|
+
*/
|
|
318
|
+
recalcMessage() {
|
|
319
|
+
applyResolvedMessagePresentation.call(this);
|
|
320
|
+
applyMeasuredMessageWidth.call(this);
|
|
321
|
+
super.recalcPopper();
|
|
322
|
+
return this;
|
|
323
|
+
}
|
|
324
|
+
|
|
313
325
|
/**
|
|
314
326
|
*
|
|
315
327
|
* @return {MessageStateButton}
|
|
@@ -266,7 +266,6 @@ class Popper extends CustomElement {
|
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
unregisterFromHost.call(this);
|
|
269
|
-
|
|
270
269
|
disconnectResizeObserver.call(this);
|
|
271
270
|
}
|
|
272
271
|
|
|
@@ -279,6 +278,17 @@ class Popper extends CustomElement {
|
|
|
279
278
|
return this;
|
|
280
279
|
}
|
|
281
280
|
|
|
281
|
+
/**
|
|
282
|
+
* Recalculates the size and position of an already open popper.
|
|
283
|
+
*
|
|
284
|
+
* @return {Popper}
|
|
285
|
+
*/
|
|
286
|
+
recalcPopper() {
|
|
287
|
+
applyContentOverflowMode.call(this);
|
|
288
|
+
updatePopper.call(this);
|
|
289
|
+
return this;
|
|
290
|
+
}
|
|
291
|
+
|
|
282
292
|
/**
|
|
283
293
|
* Resolves the effective popper options for the current render pass.
|
|
284
294
|
* Subclasses can override this to adapt positioning without mutating
|
|
@@ -263,6 +263,62 @@ describe("MessageStateButton", function () {
|
|
|
263
263
|
}, 0);
|
|
264
264
|
});
|
|
265
265
|
|
|
266
|
+
it("should recalculate the open popper after checkbox-driven form growth", function (done) {
|
|
267
|
+
let mocks = document.getElementById("mocks");
|
|
268
|
+
const button = document.createElement("monster-message-state-button");
|
|
269
|
+
button.innerHTML = "Save";
|
|
270
|
+
mocks.appendChild(button);
|
|
271
|
+
|
|
272
|
+
const form = document.createElement("form");
|
|
273
|
+
const label = document.createElement("label");
|
|
274
|
+
const checkbox = document.createElement("input");
|
|
275
|
+
checkbox.type = "checkbox";
|
|
276
|
+
label.appendChild(checkbox);
|
|
277
|
+
label.append(" show more");
|
|
278
|
+
form.appendChild(label);
|
|
279
|
+
|
|
280
|
+
setTimeout(() => {
|
|
281
|
+
try {
|
|
282
|
+
button.setMessage(form);
|
|
283
|
+
button.showMessage();
|
|
284
|
+
|
|
285
|
+
setTimeout(() => {
|
|
286
|
+
try {
|
|
287
|
+
const popper = button.shadowRoot.querySelector(
|
|
288
|
+
'[data-monster-role="popper"]',
|
|
289
|
+
);
|
|
290
|
+
expect(popper).to.exist;
|
|
291
|
+
|
|
292
|
+
const originalHook = popper.monsterBeforeFloatingUpdate;
|
|
293
|
+
let updateCount = 0;
|
|
294
|
+
popper.monsterBeforeFloatingUpdate = () => {
|
|
295
|
+
updateCount += 1;
|
|
296
|
+
if (typeof originalHook === "function") {
|
|
297
|
+
originalHook();
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
checkbox.checked = true;
|
|
302
|
+
button.recalcMessage();
|
|
303
|
+
|
|
304
|
+
setTimeout(() => {
|
|
305
|
+
try {
|
|
306
|
+
expect(updateCount).to.be.at.least(1);
|
|
307
|
+
done();
|
|
308
|
+
} catch (e) {
|
|
309
|
+
done(e);
|
|
310
|
+
}
|
|
311
|
+
}, 20);
|
|
312
|
+
} catch (e) {
|
|
313
|
+
done(e);
|
|
314
|
+
}
|
|
315
|
+
}, 0);
|
|
316
|
+
} catch (e) {
|
|
317
|
+
done(e);
|
|
318
|
+
}
|
|
319
|
+
}, 0);
|
|
320
|
+
});
|
|
321
|
+
|
|
266
322
|
it("should resolve nested select message content to horizontal clipping only", async function () {
|
|
267
323
|
let mocks = document.getElementById("mocks");
|
|
268
324
|
const button = document.createElement("monster-message-state-button");
|