@stemy/ngx-utils 19.0.10 → 19.0.12
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/fesm2022/stemy-ngx-utils.mjs +29 -13
- package/fesm2022/stemy-ngx-utils.mjs.map +1 -1
- package/ngx-utils/common-types.d.ts +1 -1
- package/ngx-utils/components/dynamic-table/dynamic-table.component.d.ts +4 -3
- package/ngx-utils/ngx-utils.imports.d.ts +2 -2
- package/ngx-utils/plugins/drag-drop-handler.d.ts +1 -1
- package/package.json +1 -1
|
@@ -5594,28 +5594,25 @@ class DynamicTableComponent {
|
|
|
5594
5594
|
elem.classList.add("drop-allowed");
|
|
5595
5595
|
}
|
|
5596
5596
|
onDragLeave(ev, elem) {
|
|
5597
|
-
|
|
5598
|
-
|
|
5597
|
+
ev.dataTransfer.effectAllowed = "none";
|
|
5598
|
+
ev.dataTransfer.dropEffect = "none";
|
|
5599
5599
|
elem.classList.remove("drop-allowed");
|
|
5600
5600
|
}
|
|
5601
5601
|
onDrop(ev, elem, item) {
|
|
5602
|
-
if (!ev)
|
|
5603
|
-
return;
|
|
5604
5602
|
ev.preventDefault();
|
|
5605
5603
|
ev.stopPropagation();
|
|
5606
5604
|
if (!elem || !item || !ObjectUtils.isFunction(this.dropFn)) {
|
|
5607
|
-
return false;
|
|
5608
|
-
}
|
|
5609
|
-
elem.classList.remove("drop-allowed");
|
|
5610
|
-
const source = JSON.parse(ev.dataTransfer.getData("itemData"));
|
|
5611
|
-
if (!this.dropFn({ ev, elem, item, source })) {
|
|
5612
5605
|
return;
|
|
5613
5606
|
}
|
|
5614
|
-
|
|
5615
|
-
elem.
|
|
5607
|
+
const source = JSON.parse(ev.dataTransfer.getData("itemData"));
|
|
5608
|
+
elem.classList.remove("drop-allowed");
|
|
5609
|
+
this.checkTransitions(elem, () => {
|
|
5610
|
+
this.checkTransitions(elem, () => {
|
|
5611
|
+
this.dropFn({ ev, elem, item, source });
|
|
5612
|
+
});
|
|
5616
5613
|
elem.classList.remove("dropped");
|
|
5617
|
-
};
|
|
5618
|
-
|
|
5614
|
+
});
|
|
5615
|
+
elem.classList.add("dropped");
|
|
5619
5616
|
}
|
|
5620
5617
|
refresh(time) {
|
|
5621
5618
|
if (!this.pagination)
|
|
@@ -5646,6 +5643,25 @@ class DynamicTableComponent {
|
|
|
5646
5643
|
}
|
|
5647
5644
|
this.refresh(this.filterTime ?? 300);
|
|
5648
5645
|
}
|
|
5646
|
+
checkTransitions(el, cb) {
|
|
5647
|
+
let hasTransitions = false;
|
|
5648
|
+
let called = false;
|
|
5649
|
+
const end = () => {
|
|
5650
|
+
if (called)
|
|
5651
|
+
return;
|
|
5652
|
+
called = true;
|
|
5653
|
+
cb();
|
|
5654
|
+
};
|
|
5655
|
+
el.onanimationstart = () => hasTransitions = true;
|
|
5656
|
+
el.ontransitionstart = () => hasTransitions = true;
|
|
5657
|
+
el.onanimationend = end;
|
|
5658
|
+
el.ontransitionend = end;
|
|
5659
|
+
setTimeout(() => {
|
|
5660
|
+
if (hasTransitions)
|
|
5661
|
+
return;
|
|
5662
|
+
end();
|
|
5663
|
+
}, 100);
|
|
5664
|
+
}
|
|
5649
5665
|
loadLocalData(page, rowsPerPage, orderBy, orderDescending, filter) {
|
|
5650
5666
|
if (!this.data) {
|
|
5651
5667
|
return Promise.resolve({
|