@schukai/monster 4.136.12 → 4.136.13
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.13"}
|
|
@@ -828,6 +828,16 @@ function initEventHandler() {
|
|
|
828
828
|
let suppressClickUntil = 0;
|
|
829
829
|
|
|
830
830
|
const isInteractiveDragTarget = (event) => {
|
|
831
|
+
if (
|
|
832
|
+
findTargetElementFromEvent(
|
|
833
|
+
event,
|
|
834
|
+
"data-monster-role",
|
|
835
|
+
"datatable-headers",
|
|
836
|
+
)
|
|
837
|
+
) {
|
|
838
|
+
return true;
|
|
839
|
+
}
|
|
840
|
+
|
|
831
841
|
if (
|
|
832
842
|
findTargetElementFromEvent(event, "data-monster-role", "resize-handle")
|
|
833
843
|
) {
|
|
@@ -188,6 +188,55 @@ describe("Datatable drag scroll", function () {
|
|
|
188
188
|
expect(clickCount).to.equal(1);
|
|
189
189
|
});
|
|
190
190
|
|
|
191
|
+
it("does not start drag scroll from header interactions", async function () {
|
|
192
|
+
const mocks = document.getElementById("mocks");
|
|
193
|
+
const datatable = document.createElement("monster-datatable");
|
|
194
|
+
datatable.id = "drag-scroll-header-table";
|
|
195
|
+
datatable.innerHTML = `
|
|
196
|
+
<template id="drag-scroll-header-table-row">
|
|
197
|
+
<div data-monster-head="Name">Alpha</div>
|
|
198
|
+
<div data-monster-head="Value">Beta</div>
|
|
199
|
+
</template>
|
|
200
|
+
`;
|
|
201
|
+
datatable.setOption("data", [{}]);
|
|
202
|
+
mocks.appendChild(datatable);
|
|
203
|
+
|
|
204
|
+
await new Promise((resolve) => setTimeout(resolve, 30));
|
|
205
|
+
|
|
206
|
+
const scroll = datatable.shadowRoot.querySelector(
|
|
207
|
+
"[data-monster-role=table-scroll]",
|
|
208
|
+
);
|
|
209
|
+
const headerCell = datatable.shadowRoot.querySelector(
|
|
210
|
+
"[data-monster-role=datatable-headers] > div",
|
|
211
|
+
);
|
|
212
|
+
|
|
213
|
+
expect(scroll).to.exist;
|
|
214
|
+
expect(headerCell).to.exist;
|
|
215
|
+
|
|
216
|
+
mockScrollableElement(scroll, {
|
|
217
|
+
clientWidth: 200,
|
|
218
|
+
scrollWidth: 600,
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
scroll.scrollLeft = 120;
|
|
222
|
+
|
|
223
|
+
dispatchPointerEvent(headerCell, "pointerdown", {
|
|
224
|
+
clientX: 100,
|
|
225
|
+
clientY: 20,
|
|
226
|
+
});
|
|
227
|
+
dispatchPointerEvent(window, "pointermove", {
|
|
228
|
+
clientX: 40,
|
|
229
|
+
clientY: 24,
|
|
230
|
+
});
|
|
231
|
+
dispatchPointerEvent(window, "pointerup", {
|
|
232
|
+
clientX: 40,
|
|
233
|
+
clientY: 24,
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
expect(scroll.scrollLeft).to.equal(120);
|
|
237
|
+
expect(scroll.classList.contains("is-dragging")).to.equal(false);
|
|
238
|
+
});
|
|
239
|
+
|
|
191
240
|
it("keeps double click copy for a single cell", async function () {
|
|
192
241
|
const mocks = document.getElementById("mocks");
|
|
193
242
|
const datatable = document.createElement("monster-datatable");
|