@enos5/enos-vue-default 1.16.6 → 1.16.8
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/{code-Ck9l0J11.js → code-Uq_sE9rw.js} +2 -2
- package/dist/{code-Ck9l0J11.js.map → code-Uq_sE9rw.js.map} +1 -1
- package/dist/{default-C-ygURG1.js → default-BrvQoVVs.js} +2 -2
- package/dist/{default-C-ygURG1.js.map → default-BrvQoVVs.js.map} +1 -1
- package/dist/{dom-B5C34Hss.js → dom-CyNQy3FR.js} +2 -2
- package/dist/{dom-B5C34Hss.js.map → dom-CyNQy3FR.js.map} +1 -1
- package/dist/{image-om1zgdO9.js → image-BPy4dcSt.js} +2 -2
- package/dist/{image-om1zgdO9.js.map → image-BPy4dcSt.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/index.node.js +1 -1
- package/dist/{link-udJozaqN.js → link-BNLldsh6.js} +2 -2
- package/dist/{link-udJozaqN.js.map → link-BNLldsh6.js.map} +1 -1
- package/dist/{lists-7DI9Tv0m.js → lists-CCw-difh.js} +2 -2
- package/dist/{lists-7DI9Tv0m.js.map → lists-CCw-difh.js.map} +1 -1
- package/dist/{plugin-D0P_jRZq.js → plugin-BXdUiTUI.js} +209 -150
- package/dist/{plugin-D0P_jRZq.js.map → plugin-BXdUiTUI.js.map} +1 -1
- package/dist/{silver-CijRmxnT.js → silver-6SQnxErw.js} +2 -2
- package/dist/{silver-CijRmxnT.js.map → silver-6SQnxErw.js.map} +1 -1
- package/dist/styles.css +57 -6
- package/dist/{table-CePDnvBC.js → table-eUIcL87o.js} +2 -2
- package/dist/{table-CePDnvBC.js.map → table-eUIcL87o.js.map} +1 -1
- package/dist/{tinymce-qDvRw4Ap.js → tinymce-_FcmnBzR.js} +2 -2
- package/dist/{tinymce-qDvRw4Ap.js.map → tinymce-_FcmnBzR.js.map} +1 -1
- package/package.json +36 -36
|
@@ -2840,18 +2840,18 @@ var _sfc_main$18 = {
|
|
|
2840
2840
|
});
|
|
2841
2841
|
};
|
|
2842
2842
|
const loadTinyMce = async () => {
|
|
2843
|
-
const tinymceModule = await import("./tinymce-
|
|
2843
|
+
const tinymceModule = await import("./tinymce-_FcmnBzR.js").then((m) => /* @__PURE__ */ __toESM(m.default));
|
|
2844
2844
|
const tinymce = tinymceModule.default ?? tinymceModule;
|
|
2845
2845
|
if (typeof globalThis !== "undefined" && !globalThis.tinymce) globalThis.tinymce = tinymce;
|
|
2846
2846
|
await Promise.all([
|
|
2847
|
-
import("./dom-
|
|
2848
|
-
import("./default-
|
|
2849
|
-
import("./silver-
|
|
2850
|
-
import("./code-
|
|
2851
|
-
import("./image-
|
|
2852
|
-
import("./link-
|
|
2853
|
-
import("./lists-
|
|
2854
|
-
import("./table-
|
|
2847
|
+
import("./dom-CyNQy3FR.js"),
|
|
2848
|
+
import("./default-BrvQoVVs.js"),
|
|
2849
|
+
import("./silver-6SQnxErw.js"),
|
|
2850
|
+
import("./code-Uq_sE9rw.js"),
|
|
2851
|
+
import("./image-BPy4dcSt.js"),
|
|
2852
|
+
import("./link-BNLldsh6.js"),
|
|
2853
|
+
import("./lists-CCw-difh.js"),
|
|
2854
|
+
import("./table-eUIcL87o.js")
|
|
2855
2855
|
]);
|
|
2856
2856
|
isEditorReady.value = true;
|
|
2857
2857
|
};
|
|
@@ -2989,17 +2989,17 @@ var _hoisted_12$2 = {
|
|
|
2989
2989
|
class: "space-y-2"
|
|
2990
2990
|
};
|
|
2991
2991
|
var _hoisted_13$2 = ["for"];
|
|
2992
|
-
var _hoisted_14$
|
|
2992
|
+
var _hoisted_14$2 = [
|
|
2993
2993
|
"id",
|
|
2994
2994
|
"disabled",
|
|
2995
2995
|
"value"
|
|
2996
2996
|
];
|
|
2997
|
-
var _hoisted_15$
|
|
2997
|
+
var _hoisted_15$2 = {
|
|
2998
2998
|
key: 1,
|
|
2999
2999
|
class: "space-y-2"
|
|
3000
3000
|
};
|
|
3001
|
-
var _hoisted_16$
|
|
3002
|
-
var _hoisted_17 = [
|
|
3001
|
+
var _hoisted_16$2 = ["for"];
|
|
3002
|
+
var _hoisted_17$1 = [
|
|
3003
3003
|
"id",
|
|
3004
3004
|
"disabled",
|
|
3005
3005
|
"value"
|
|
@@ -3560,7 +3560,7 @@ var ColorPicker_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
3560
3560
|
value: hue.value,
|
|
3561
3561
|
style: { "background": "linear-gradient(90deg, #FF0000 0%, #FFFF00 17%, #00FF00 33%, #00FFFF 50%, #0000FF 67%, #FF00FF 83%, #FF0000 100%)" },
|
|
3562
3562
|
onInput: handleHueInput
|
|
3563
|
-
}, null, 42, _hoisted_14$
|
|
3563
|
+
}, null, 42, _hoisted_14$2)])) : createCommentVNode("", true), props.allowAlpha ? (openBlock(), createElementBlock("div", _hoisted_15$2, [createElementVNode("div", { class: normalizeClass(["flex items-center justify-between text-xs font-medium text-neutral-500 dark:text-neutral-400", props.ui.sectionLabel]) }, [createElementVNode("label", { for: fieldId.value ? `${fieldId.value}-alpha` : void 0 }, toDisplayString(unref(t)("Opacity")), 9, _hoisted_16$2), createElementVNode("span", null, toDisplayString(opacityPercent.value) + "%", 1)], 2), createElementVNode("input", {
|
|
3564
3564
|
id: fieldId.value ? `${fieldId.value}-alpha` : void 0,
|
|
3565
3565
|
type: "range",
|
|
3566
3566
|
min: "0",
|
|
@@ -3571,7 +3571,7 @@ var ColorPicker_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
3571
3571
|
value: opacityPercent.value,
|
|
3572
3572
|
style: normalizeStyle({ background: alphaGradient.value }),
|
|
3573
3573
|
onInput: handleAlphaInput
|
|
3574
|
-
}, null, 46, _hoisted_17)])) : createCommentVNode("", true)]),
|
|
3574
|
+
}, null, 46, _hoisted_17$1)])) : createCommentVNode("", true)]),
|
|
3575
3575
|
createElementVNode("div", _hoisted_18, [createElementVNode("label", {
|
|
3576
3576
|
for: fieldId.value ? `${fieldId.value}-hex` : void 0,
|
|
3577
3577
|
class: normalizeClass(["text-xs font-medium uppercase tracking-[0.16em] text-neutral-500 dark:text-neutral-400", props.ui.sectionLabel])
|
|
@@ -6242,35 +6242,38 @@ var _hoisted_2$2 = {
|
|
|
6242
6242
|
key: 0,
|
|
6243
6243
|
class: "w-10 px-2 py-3 text-center text-[11px] font-semibold uppercase tracking-[0.12em] text-neutral-600 dark:text-neutral-200"
|
|
6244
6244
|
};
|
|
6245
|
-
var _hoisted_3$2 =
|
|
6246
|
-
|
|
6247
|
-
"
|
|
6248
|
-
"
|
|
6249
|
-
|
|
6250
|
-
];
|
|
6251
|
-
var
|
|
6245
|
+
var _hoisted_3$2 = {
|
|
6246
|
+
key: 0,
|
|
6247
|
+
"data-table-list-placeholder": "",
|
|
6248
|
+
class: "bg-blue-50/60 dark:bg-blue-950/20"
|
|
6249
|
+
};
|
|
6250
|
+
var _hoisted_4$1 = ["colspan"];
|
|
6251
|
+
var _hoisted_5$1 = ["data-row-index"];
|
|
6252
|
+
var _hoisted_6$1 = {
|
|
6252
6253
|
key: 0,
|
|
6253
6254
|
class: "w-10 whitespace-nowrap px-2 py-4 text-center text-sm text-neutral-500 dark:text-neutral-400"
|
|
6254
6255
|
};
|
|
6255
|
-
var
|
|
6256
|
-
var
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
"onDragstart"
|
|
6260
|
-
];
|
|
6261
|
-
var _hoisted_7$1 = ["title"];
|
|
6262
|
-
var _hoisted_8$1 = {
|
|
6256
|
+
var _hoisted_7$1 = { class: "inline-flex items-center gap-1" };
|
|
6257
|
+
var _hoisted_8$1 = ["aria-label", "onPointerdown"];
|
|
6258
|
+
var _hoisted_9$1 = ["title"];
|
|
6259
|
+
var _hoisted_10$1 = {
|
|
6263
6260
|
key: 0,
|
|
6264
6261
|
class: "ml-2 inline-flex items-center rounded-full bg-red-100 px-2 py-1 text-xs font-medium text-red-700 dark:bg-red-950/60 dark:text-neutral-100"
|
|
6265
6262
|
};
|
|
6266
|
-
var
|
|
6267
|
-
var
|
|
6263
|
+
var _hoisted_11$1 = ["innerHTML"];
|
|
6264
|
+
var _hoisted_12$1 = {
|
|
6265
|
+
key: 0,
|
|
6266
|
+
"data-table-list-placeholder": "",
|
|
6267
|
+
class: "bg-blue-50/60 dark:bg-blue-950/20"
|
|
6268
|
+
};
|
|
6269
|
+
var _hoisted_13$1 = ["colspan"];
|
|
6270
|
+
var _hoisted_14$1 = {
|
|
6268
6271
|
key: 0,
|
|
6269
6272
|
class: "py-12 text-center"
|
|
6270
6273
|
};
|
|
6271
|
-
var
|
|
6272
|
-
var
|
|
6273
|
-
var
|
|
6274
|
+
var _hoisted_15$1 = { class: "mb-4 inline-flex h-16 w-16 items-center justify-center rounded-full bg-neutral-100 dark:bg-neutral-900" };
|
|
6275
|
+
var _hoisted_16$1 = { class: "mb-2 text-lg font-semibold text-neutral-950 dark:text-neutral-50" };
|
|
6276
|
+
var _hoisted_17 = { class: "mb-4 text-neutral-600 dark:text-neutral-200" };
|
|
6274
6277
|
var _sfc_main$1 = {
|
|
6275
6278
|
__name: "TableList",
|
|
6276
6279
|
props: {
|
|
@@ -6417,7 +6420,7 @@ var _sfc_main$1 = {
|
|
|
6417
6420
|
watch(() => props.data, (value) => {
|
|
6418
6421
|
localData.value = value;
|
|
6419
6422
|
});
|
|
6420
|
-
computed(() => !!slots.actions);
|
|
6423
|
+
const hasActionsSlot = computed(() => !!slots.actions);
|
|
6421
6424
|
const internalSearchQuery = ref("");
|
|
6422
6425
|
const searchQuery = computed({
|
|
6423
6426
|
get: () => props.searchValue ?? internalSearchQuery.value,
|
|
@@ -6443,71 +6446,30 @@ var _sfc_main$1 = {
|
|
|
6443
6446
|
return props.searchCount ?? filteredData.value.length;
|
|
6444
6447
|
});
|
|
6445
6448
|
const draggedIndex = ref(null);
|
|
6446
|
-
const
|
|
6449
|
+
const insertionIndex = ref(null);
|
|
6450
|
+
const isDragging = ref(false);
|
|
6447
6451
|
const dragPreview = ref(null);
|
|
6448
6452
|
const dragRowHeight = ref(0);
|
|
6453
|
+
const tableRef = ref(null);
|
|
6454
|
+
const activePointerId = ref(null);
|
|
6455
|
+
const dragStartPosition = ref(null);
|
|
6456
|
+
const dragHandle = ref(null);
|
|
6457
|
+
const previousUserSelect = ref("");
|
|
6449
6458
|
const canReorder = computed(() => {
|
|
6450
6459
|
return props.orderable && !searchQuery.value.trim();
|
|
6451
6460
|
});
|
|
6452
|
-
const
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
dragOverIndex.value = index;
|
|
6459
|
-
const row = event.currentTarget?.closest("tr");
|
|
6460
|
-
if (row) {
|
|
6461
|
-
dragRowHeight.value = row.offsetHeight;
|
|
6462
|
-
const preview = document.createElement("div");
|
|
6463
|
-
const previewTable = document.createElement("table");
|
|
6464
|
-
const previewBody = document.createElement("tbody");
|
|
6465
|
-
const previewRow = row.cloneNode(true);
|
|
6466
|
-
previewTable.className = row.closest("table")?.className ?? "";
|
|
6467
|
-
previewTable.style.width = `${row.getBoundingClientRect().width}px`;
|
|
6468
|
-
previewTable.style.borderCollapse = "collapse";
|
|
6469
|
-
previewTable.style.background = "white";
|
|
6470
|
-
previewRow.classList.remove("opacity-0");
|
|
6471
|
-
previewRow.style.background = "white";
|
|
6472
|
-
previewRow.querySelectorAll("td").forEach((cell) => {
|
|
6473
|
-
cell.style.background = "white";
|
|
6474
|
-
});
|
|
6475
|
-
previewBody.appendChild(previewRow);
|
|
6476
|
-
previewTable.appendChild(previewBody);
|
|
6477
|
-
preview.appendChild(previewTable);
|
|
6478
|
-
dragPreview.value = preview;
|
|
6479
|
-
dragPreview.value.style.position = "fixed";
|
|
6480
|
-
dragPreview.value.style.top = "0";
|
|
6481
|
-
dragPreview.value.style.left = "0";
|
|
6482
|
-
dragPreview.value.style.background = "white";
|
|
6483
|
-
dragPreview.value.style.borderRadius = "0.5rem";
|
|
6484
|
-
dragPreview.value.style.boxShadow = "0 10px 25px rgb(15 23 42 / 0.18)";
|
|
6485
|
-
dragPreview.value.style.opacity = "0.96";
|
|
6486
|
-
dragPreview.value.style.pointerEvents = "none";
|
|
6487
|
-
dragPreview.value.style.zIndex = "1000";
|
|
6488
|
-
document.body.appendChild(dragPreview.value);
|
|
6489
|
-
updateDragPreviewPosition(event);
|
|
6490
|
-
document.addEventListener("dragover", handleDocumentDragOver, true);
|
|
6491
|
-
const transparentDragImage = document.createElement("canvas");
|
|
6492
|
-
transparentDragImage.width = 1;
|
|
6493
|
-
transparentDragImage.height = 1;
|
|
6494
|
-
event.dataTransfer.setDragImage(transparentDragImage, 0, 0);
|
|
6495
|
-
}
|
|
6496
|
-
event.dataTransfer.effectAllowed = "move";
|
|
6497
|
-
event.dataTransfer.setData("text/plain", String(index));
|
|
6498
|
-
};
|
|
6499
|
-
const endDrag = () => {
|
|
6500
|
-
document.removeEventListener("dragover", handleDocumentDragOver, true);
|
|
6501
|
-
dragPreview.value?.remove();
|
|
6502
|
-
dragPreview.value = null;
|
|
6503
|
-
draggedIndex.value = null;
|
|
6504
|
-
dragOverIndex.value = null;
|
|
6505
|
-
dragRowHeight.value = 0;
|
|
6461
|
+
const placeholderColumnCount = computed(() => {
|
|
6462
|
+
return props.columns.length + 1 + (hasActionsSlot.value ? 1 : 0);
|
|
6463
|
+
});
|
|
6464
|
+
const insertionPositionForRow = (index) => {
|
|
6465
|
+
if (draggedIndex.value === null || index < draggedIndex.value) return index;
|
|
6466
|
+
return index - 1;
|
|
6506
6467
|
};
|
|
6507
|
-
const
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6468
|
+
const isPointerWithinTable = (event) => {
|
|
6469
|
+
const table = tableRef.value;
|
|
6470
|
+
if (!table) return false;
|
|
6471
|
+
const rect = table.getBoundingClientRect();
|
|
6472
|
+
return event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom;
|
|
6511
6473
|
};
|
|
6512
6474
|
const updateDragPreviewPosition = (event) => {
|
|
6513
6475
|
if (!dragPreview.value) return;
|
|
@@ -6515,44 +6477,71 @@ var _sfc_main$1 = {
|
|
|
6515
6477
|
const offsetY = dragRowHeight.value / 2;
|
|
6516
6478
|
dragPreview.value.style.transform = `translate3d(${event.clientX - offsetX}px, ${event.clientY - offsetY}px, 0)`;
|
|
6517
6479
|
};
|
|
6518
|
-
const
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6480
|
+
const createDragPreview = (row) => {
|
|
6481
|
+
const preview = document.createElement("div");
|
|
6482
|
+
const previewTable = document.createElement("table");
|
|
6483
|
+
const previewBody = document.createElement("tbody");
|
|
6484
|
+
const previewRow = row.cloneNode(true);
|
|
6485
|
+
previewTable.className = row.closest("table")?.className ?? "";
|
|
6486
|
+
previewTable.style.width = `${row.getBoundingClientRect().width}px`;
|
|
6487
|
+
previewTable.style.borderCollapse = "collapse";
|
|
6488
|
+
previewTable.style.background = "white";
|
|
6489
|
+
previewRow.style.background = "white";
|
|
6490
|
+
previewRow.querySelectorAll("td").forEach((cell) => {
|
|
6491
|
+
cell.style.background = "white";
|
|
6492
|
+
});
|
|
6493
|
+
previewBody.appendChild(previewRow);
|
|
6494
|
+
previewTable.appendChild(previewBody);
|
|
6495
|
+
preview.appendChild(previewTable);
|
|
6496
|
+
preview.style.position = "fixed";
|
|
6497
|
+
preview.style.top = "0";
|
|
6498
|
+
preview.style.left = "0";
|
|
6499
|
+
preview.style.background = "white";
|
|
6500
|
+
preview.style.borderRadius = "0.5rem";
|
|
6501
|
+
preview.style.boxShadow = "0 10px 25px rgb(15 23 42 / 0.18)";
|
|
6502
|
+
preview.style.opacity = "0.96";
|
|
6503
|
+
preview.style.pointerEvents = "none";
|
|
6504
|
+
preview.style.zIndex = "1000";
|
|
6505
|
+
document.body.appendChild(preview);
|
|
6506
|
+
dragPreview.value = preview;
|
|
6507
|
+
};
|
|
6508
|
+
const updateInsertionIndex = (event) => {
|
|
6509
|
+
if (!isDragging.value || !isPointerWithinTable(event)) return;
|
|
6510
|
+
const placeholder = tableRef.value?.querySelector("[data-table-list-placeholder]");
|
|
6511
|
+
if (placeholder) {
|
|
6512
|
+
const placeholderRect = placeholder.getBoundingClientRect();
|
|
6513
|
+
if (event.clientY >= placeholderRect.top && event.clientY <= placeholderRect.bottom) return;
|
|
6522
6514
|
}
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
const targetRow = Array.from(tbody.children).find((candidate) => {
|
|
6528
|
-
const rect = candidate.getBoundingClientRect();
|
|
6529
|
-
return event.clientY >= rect.top && event.clientY <= rect.bottom;
|
|
6515
|
+
const rows = Array.from(tableRef.value?.querySelectorAll("tbody tr[data-row-index]") ?? []);
|
|
6516
|
+
const nextInsertionIndex = rows.findIndex((row) => {
|
|
6517
|
+
const rect = row.getBoundingClientRect();
|
|
6518
|
+
return event.clientY < rect.top + rect.height / 2;
|
|
6530
6519
|
});
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6520
|
+
insertionIndex.value = nextInsertionIndex === -1 ? rows.length : nextInsertionIndex;
|
|
6521
|
+
};
|
|
6522
|
+
const cleanupPointerDrag = () => {
|
|
6523
|
+
document.removeEventListener("pointermove", handlePointerMove);
|
|
6524
|
+
document.removeEventListener("pointerup", handlePointerUp);
|
|
6525
|
+
document.removeEventListener("pointercancel", handlePointerCancel);
|
|
6526
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
6527
|
+
if (dragHandle.value?.hasPointerCapture?.(activePointerId.value)) dragHandle.value.releasePointerCapture(activePointerId.value);
|
|
6528
|
+
document.body.style.userSelect = previousUserSelect.value;
|
|
6529
|
+
dragPreview.value?.remove();
|
|
6530
|
+
dragPreview.value = null;
|
|
6531
|
+
draggedIndex.value = null;
|
|
6532
|
+
insertionIndex.value = null;
|
|
6533
|
+
isDragging.value = false;
|
|
6534
|
+
dragRowHeight.value = 0;
|
|
6535
|
+
activePointerId.value = null;
|
|
6536
|
+
dragStartPosition.value = null;
|
|
6537
|
+
dragHandle.value = null;
|
|
6540
6538
|
};
|
|
6541
|
-
const
|
|
6542
|
-
|
|
6543
|
-
if (!canReorder.value || draggedIndex.value === null) {
|
|
6544
|
-
endDrag();
|
|
6545
|
-
return;
|
|
6546
|
-
}
|
|
6547
|
-
const targetIndex = getDropTargetIndex(event, dragOverIndex.value ?? toIndex);
|
|
6548
|
-
if (draggedIndex.value === targetIndex) {
|
|
6549
|
-
endDrag();
|
|
6550
|
-
return;
|
|
6551
|
-
}
|
|
6539
|
+
const commitReorder = () => {
|
|
6540
|
+
if (draggedIndex.value === null || insertionIndex.value === null || draggedIndex.value === insertionIndex.value) return;
|
|
6552
6541
|
const result = reorderRows({
|
|
6553
6542
|
data: localData.value,
|
|
6554
6543
|
fromIndex: draggedIndex.value,
|
|
6555
|
-
toIndex:
|
|
6544
|
+
toIndex: insertionIndex.value,
|
|
6556
6545
|
orderField: props.orderField,
|
|
6557
6546
|
mutateRows: props.mutateRows
|
|
6558
6547
|
});
|
|
@@ -6562,10 +6551,69 @@ var _sfc_main$1 = {
|
|
|
6562
6551
|
} else localData.value = result.data;
|
|
6563
6552
|
emit("reorder", {
|
|
6564
6553
|
...result,
|
|
6565
|
-
rowKey: getRowKey(result.item,
|
|
6554
|
+
rowKey: getRowKey(result.item, insertionIndex.value, props.rowKey)
|
|
6566
6555
|
});
|
|
6567
|
-
endDrag();
|
|
6568
6556
|
};
|
|
6557
|
+
const startPointerDrag = (index, event) => {
|
|
6558
|
+
if (!canReorder.value || event.pointerType === "mouse" && event.button !== 0) return;
|
|
6559
|
+
const row = event.currentTarget?.closest("tr");
|
|
6560
|
+
if (!row) return;
|
|
6561
|
+
event.preventDefault();
|
|
6562
|
+
event.stopPropagation();
|
|
6563
|
+
draggedIndex.value = index;
|
|
6564
|
+
insertionIndex.value = index;
|
|
6565
|
+
activePointerId.value = event.pointerId;
|
|
6566
|
+
dragStartPosition.value = {
|
|
6567
|
+
x: event.clientX,
|
|
6568
|
+
y: event.clientY
|
|
6569
|
+
};
|
|
6570
|
+
dragHandle.value = event.currentTarget;
|
|
6571
|
+
dragRowHeight.value = row.getBoundingClientRect().height;
|
|
6572
|
+
previousUserSelect.value = document.body.style.userSelect;
|
|
6573
|
+
dragHandle.value.setPointerCapture?.(event.pointerId);
|
|
6574
|
+
document.addEventListener("pointermove", handlePointerMove);
|
|
6575
|
+
document.addEventListener("pointerup", handlePointerUp);
|
|
6576
|
+
document.addEventListener("pointercancel", handlePointerCancel);
|
|
6577
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
6578
|
+
};
|
|
6579
|
+
const handlePointerMove = (event) => {
|
|
6580
|
+
if (event.pointerId !== activePointerId.value) return;
|
|
6581
|
+
if (!isDragging.value) {
|
|
6582
|
+
const distanceX = event.clientX - dragStartPosition.value.x;
|
|
6583
|
+
const distanceY = event.clientY - dragStartPosition.value.y;
|
|
6584
|
+
if (Math.hypot(distanceX, distanceY) < 5) return;
|
|
6585
|
+
const row = dragHandle.value?.closest("tr");
|
|
6586
|
+
if (!row) {
|
|
6587
|
+
cleanupPointerDrag();
|
|
6588
|
+
return;
|
|
6589
|
+
}
|
|
6590
|
+
document.body.style.userSelect = "none";
|
|
6591
|
+
createDragPreview(row);
|
|
6592
|
+
isDragging.value = true;
|
|
6593
|
+
updateDragPreviewPosition(event);
|
|
6594
|
+
event.preventDefault();
|
|
6595
|
+
nextTick(() => updateInsertionIndex(event));
|
|
6596
|
+
return;
|
|
6597
|
+
}
|
|
6598
|
+
event.preventDefault();
|
|
6599
|
+
updateDragPreviewPosition(event);
|
|
6600
|
+
updateInsertionIndex(event);
|
|
6601
|
+
};
|
|
6602
|
+
const handlePointerUp = (event) => {
|
|
6603
|
+
if (event.pointerId !== activePointerId.value) return;
|
|
6604
|
+
if (isDragging.value && isPointerWithinTable(event)) {
|
|
6605
|
+
updateInsertionIndex(event);
|
|
6606
|
+
commitReorder();
|
|
6607
|
+
}
|
|
6608
|
+
cleanupPointerDrag();
|
|
6609
|
+
};
|
|
6610
|
+
const handlePointerCancel = (event) => {
|
|
6611
|
+
if (event.pointerId === activePointerId.value) cleanupPointerDrag();
|
|
6612
|
+
};
|
|
6613
|
+
const handleKeyDown = (event) => {
|
|
6614
|
+
if (event.key === "Escape") cleanupPointerDrag();
|
|
6615
|
+
};
|
|
6616
|
+
onBeforeUnmount(cleanupPointerDrag);
|
|
6569
6617
|
const sortBy = (field) => {
|
|
6570
6618
|
emit("sort", field);
|
|
6571
6619
|
};
|
|
@@ -6647,7 +6695,11 @@ var _sfc_main$1 = {
|
|
|
6647
6695
|
"show-deleted-label",
|
|
6648
6696
|
"search-mode",
|
|
6649
6697
|
"search-fields-layout"
|
|
6650
|
-
])) : createCommentVNode("", true), createElementVNode("div", { class: normalizeClass(["bg-white/90 backdrop-blur-sm dark:bg-neutral-950/90", __props.isCard ? "animate-fadeIn rounded-2xl border border-neutral-200 shadow-sm dark:border-neutral-800 md:mx-0 overflow-hidden" : ""]) }, [createElementVNode("div", { class: normalizeClass(["overflow-x-auto", __props.isCard ? "rounded-t-xl" : ""]) }, [createElementVNode("table", {
|
|
6698
|
+
])) : createCommentVNode("", true), createElementVNode("div", { class: normalizeClass(["bg-white/90 backdrop-blur-sm dark:bg-neutral-950/90", __props.isCard ? "animate-fadeIn rounded-2xl border border-neutral-200 shadow-sm dark:border-neutral-800 md:mx-0 overflow-hidden" : ""]) }, [createElementVNode("div", { class: normalizeClass(["overflow-x-auto", __props.isCard ? "rounded-t-xl" : ""]) }, [createElementVNode("table", {
|
|
6699
|
+
ref_key: "tableRef",
|
|
6700
|
+
ref: tableRef,
|
|
6701
|
+
class: normalizeClass(joinClasses("min-w-full divide-y divide-neutral-200 dark:divide-neutral-800", __props.tableClass))
|
|
6702
|
+
}, [createElementVNode("thead", { class: normalizeClass(joinClasses("bg-neutral-50/80 dark:bg-neutral-900/80", __props.theadClass)) }, [createElementVNode("tr", { class: normalizeClass(__props.headerRowClass) }, [
|
|
6651
6703
|
__props.orderable ? (openBlock(), createElementBlock("th", _hoisted_2$2, "#")) : createCommentVNode("", true),
|
|
6652
6704
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column) => {
|
|
6653
6705
|
return openBlock(), createElementBlock(Fragment, { key: column.key }, [column.sortable ? (openBlock(), createBlock(_sfc_main$3, {
|
|
@@ -6680,22 +6732,23 @@ var _sfc_main$1 = {
|
|
|
6680
6732
|
class: normalizeClass(actionHeaderClass.value)
|
|
6681
6733
|
}, toDisplayString(__props.actionsLabel), 3)) : createCommentVNode("", true)
|
|
6682
6734
|
], 2)], 2), createElementVNode("tbody", { class: normalizeClass(joinClasses("divide-y divide-neutral-200 bg-white dark:divide-neutral-800 dark:bg-neutral-950", __props.tbodyClass)) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(filteredData.value, (item, index) => {
|
|
6683
|
-
return openBlock(), createElementBlock("tr", {
|
|
6684
|
-
|
|
6735
|
+
return openBlock(), createElementBlock(Fragment, { key: unref(getRowKey)(item, index, __props.rowKey) }, [isDragging.value && index !== draggedIndex.value && insertionIndex.value === insertionPositionForRow(index) ? (openBlock(), createElementBlock("tr", _hoisted_3$2, [createElementVNode("td", {
|
|
6736
|
+
colspan: placeholderColumnCount.value,
|
|
6737
|
+
class: "p-0"
|
|
6738
|
+
}, [createElementVNode("div", {
|
|
6739
|
+
class: "mx-2 rounded-md border border-dashed border-blue-400 bg-blue-50/70 dark:border-blue-500 dark:bg-blue-950/30",
|
|
6740
|
+
style: normalizeStyle({ height: `${dragRowHeight.value}px` })
|
|
6741
|
+
}, null, 4)], 8, _hoisted_4$1)])) : createCommentVNode("", true), !isDragging.value || index !== draggedIndex.value ? (openBlock(), createElementBlock("tr", {
|
|
6742
|
+
key: 1,
|
|
6685
6743
|
"data-row-index": index,
|
|
6686
|
-
class: normalizeClass(joinClasses(__props.rowClasses(item, index), "transition-
|
|
6687
|
-
style: normalizeStyle(rowDragStyle(index)),
|
|
6688
|
-
onDragenter: ($event) => updateDragOver(index, $event),
|
|
6689
|
-
onDragover: withModifiers(($event) => updateDragOver(index, $event), ["prevent"]),
|
|
6690
|
-
onDrop: ($event) => dropRow(index, $event)
|
|
6744
|
+
class: normalizeClass(joinClasses(__props.rowClasses(item, index), "transition-transform duration-150 ease-out"))
|
|
6691
6745
|
}, [
|
|
6692
|
-
__props.orderable ? (openBlock(), createElementBlock("td",
|
|
6693
|
-
draggable: canReorder.value,
|
|
6746
|
+
__props.orderable ? (openBlock(), createElementBlock("td", _hoisted_6$1, [createElementVNode("span", _hoisted_7$1, [createElementVNode("span", {
|
|
6694
6747
|
class: "cursor-grab touch-none active:cursor-grabbing",
|
|
6695
6748
|
"aria-label": `Drag row ${index + 1}`,
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
}, [createVNode(unref(GripVertical), { class: "size-4" })], 40,
|
|
6749
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"])),
|
|
6750
|
+
onPointerdown: ($event) => startPointerDrag(index, $event)
|
|
6751
|
+
}, [createVNode(unref(GripVertical), { class: "size-4" })], 40, _hoisted_8$1), createElementVNode("span", null, toDisplayString(index + 1), 1)])])) : createCommentVNode("", true),
|
|
6699
6752
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column) => {
|
|
6700
6753
|
return openBlock(), createElementBlock("td", {
|
|
6701
6754
|
key: column.key,
|
|
@@ -6707,7 +6760,7 @@ var _sfc_main$1 = {
|
|
|
6707
6760
|
}, [createElementVNode("div", {
|
|
6708
6761
|
class: "truncate text-sm font-medium text-neutral-950 dark:text-neutral-50",
|
|
6709
6762
|
title: getCellContent(item, column)
|
|
6710
|
-
}, toDisplayString(getCellContent(item, column)), 9,
|
|
6763
|
+
}, toDisplayString(getCellContent(item, column)), 9, _hoisted_9$1), isDeleted(item) ? (openBlock(), createElementBlock("span", _hoisted_10$1, toDisplayString(__props.deletedLabel), 1)) : createCommentVNode("", true)], 2)) : column.slot ? (openBlock(), createElementBlock("div", {
|
|
6711
6764
|
key: 1,
|
|
6712
6765
|
class: normalizeClass(getContentClass(column))
|
|
6713
6766
|
}, [renderSlot(_ctx.$slots, column.slot, {
|
|
@@ -6718,7 +6771,7 @@ var _sfc_main$1 = {
|
|
|
6718
6771
|
key: 2,
|
|
6719
6772
|
class: normalizeClass(getContentClass(column)),
|
|
6720
6773
|
innerHTML: column.render(item)
|
|
6721
|
-
}, null, 10,
|
|
6774
|
+
}, null, 10, _hoisted_11$1)) : (openBlock(), createElementBlock("div", {
|
|
6722
6775
|
key: 3,
|
|
6723
6776
|
class: normalizeClass(getContentClass(column))
|
|
6724
6777
|
}, toDisplayString(getCellContent(item, column)), 3))], 6);
|
|
@@ -6730,11 +6783,17 @@ var _sfc_main$1 = {
|
|
|
6730
6783
|
item,
|
|
6731
6784
|
index
|
|
6732
6785
|
})], 2)) : createCommentVNode("", true)
|
|
6733
|
-
],
|
|
6734
|
-
}), 128))
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6786
|
+
], 10, _hoisted_5$1)) : createCommentVNode("", true)], 64);
|
|
6787
|
+
}), 128)), isDragging.value && insertionIndex.value === filteredData.value.length - 1 ? (openBlock(), createElementBlock("tr", _hoisted_12$1, [createElementVNode("td", {
|
|
6788
|
+
colspan: placeholderColumnCount.value,
|
|
6789
|
+
class: "p-0"
|
|
6790
|
+
}, [createElementVNode("div", {
|
|
6791
|
+
class: "mx-2 rounded-md border border-dashed border-blue-400 bg-blue-50/70 dark:border-blue-500 dark:bg-blue-950/30",
|
|
6792
|
+
style: normalizeStyle({ height: `${dragRowHeight.value}px` })
|
|
6793
|
+
}, null, 4)], 8, _hoisted_13$1)])) : createCommentVNode("", true)], 2)], 2)], 2), !hasData.value ? (openBlock(), createElementBlock("div", _hoisted_14$1, [
|
|
6794
|
+
createElementVNode("div", _hoisted_15$1, [(openBlock(), createBlock(resolveDynamicComponent(__props.emptyState.icon), { class: "h-8 w-8 text-neutral-400 dark:text-neutral-200" }))]),
|
|
6795
|
+
createElementVNode("h3", _hoisted_16$1, toDisplayString(__props.emptyState.title), 1),
|
|
6796
|
+
createElementVNode("p", _hoisted_17, toDisplayString(__props.emptyState.description), 1),
|
|
6738
6797
|
__props.emptyState.actionText && __props.emptyState.actionUrl ? (openBlock(), createBlock(_sfc_main$6, {
|
|
6739
6798
|
key: 0,
|
|
6740
6799
|
href: __props.emptyState.actionUrl,
|
|
@@ -7563,4 +7622,4 @@ var plugin_default = { install(app) {
|
|
|
7563
7622
|
//#endregion
|
|
7564
7623
|
export { _sfc_main$34 as $, _sfc_main$11 as A, _sfc_main$21 as B, useSidebar as C, _sfc_main$8 as D, _sfc_main$7 as E, _sfc_main$16 as F, _sfc_main$26 as G, _sfc_main$23 as H, ColorPicker_default as I, _sfc_main$29 as J, _sfc_main$27 as K, _sfc_main$18 as L, _sfc_main$13 as M, _sfc_main$14 as N, _sfc_main$9 as O, _sfc_main$15 as P, _sfc_main$33 as Q, _sfc_main$19 as R, Sidebar_default as S, _sfc_main$6 as T, DateRangeInput_default as U, _sfc_main$22 as V, DateInput_default as W, _sfc_main$31 as X, _sfc_main$30 as Y, _sfc_main$32 as Z, SidebarGroupLabel_default as _, _sfc_main$1 as a, _sfc_main$40 as at, SidebarFooter_default as b, _sfc_main$4 as c, SidebarProvider_default as d, SectionTitle_default as et, SidebarMenuItem_default as f, SidebarHeader_default as g, SidebarInset_default as h, _sfc_main as i, _sfc_main$39 as it, _sfc_main$12 as j, _sfc_main$10 as k, SlidePanel_default as l, SidebarMenu_default as m, ToastContainer_default as n, _sfc_main$37 as nt, _sfc_main$2 as o, __commonJSMin as ot, SidebarMenuButton_default as p, _sfc_main$28 as q, Toast_default as r, _sfc_main$38 as rt, _sfc_main$3 as s, plugin_default as t, _sfc_main$36 as tt, SidebarTrigger_default as u, SidebarGroupContent_default as v, _sfc_main$5 as w, SidebarContent_default as x, SidebarGroup_default as y, _sfc_main$20 as z };
|
|
7565
7624
|
|
|
7566
|
-
//# sourceMappingURL=plugin-
|
|
7625
|
+
//# sourceMappingURL=plugin-BXdUiTUI.js.map
|