@enos5/enos-vue-default 1.14.1 → 1.16.0
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-D7sKxmch.js → code-C7FBvq-x.js} +2 -2
- package/dist/{code-D7sKxmch.js.map → code-C7FBvq-x.js.map} +1 -1
- package/dist/components/TableList.vue.d.ts +38 -0
- package/dist/components/TableListForm.vue.d.ts +22 -2
- package/dist/components/tableListOrdering.d.ts +15 -0
- package/dist/{default-CDuPC5at.js → default-CFmoR_-0.js} +2 -2
- package/dist/{default-CDuPC5at.js.map → default-CFmoR_-0.js.map} +1 -1
- package/dist/{dom-Cm9iZd1-.js → dom-QHFCieCT.js} +2 -2
- package/dist/{dom-Cm9iZd1-.js.map → dom-QHFCieCT.js.map} +1 -1
- package/dist/{image-zvPUqCGQ.js → image-CaVnhKac.js} +2 -2
- package/dist/{image-zvPUqCGQ.js.map → image-CaVnhKac.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/index.node.js +1 -1
- package/dist/{link-BI0xx2_E.js → link-EYFpGwkF.js} +2 -2
- package/dist/{link-BI0xx2_E.js.map → link-EYFpGwkF.js.map} +1 -1
- package/dist/{lists-Bhhx_pvU.js → lists-BzvUqNb9.js} +2 -2
- package/dist/{lists-Bhhx_pvU.js.map → lists-BzvUqNb9.js.map} +1 -1
- package/dist/{plugin-BGAJPBIG.js → plugin-D12jGTum.js} +542 -247
- package/dist/plugin-D12jGTum.js.map +1 -0
- package/dist/{silver-CwEouPmL.js → silver-ChQqMCzI.js} +2 -2
- package/dist/{silver-CwEouPmL.js.map → silver-ChQqMCzI.js.map} +1 -1
- package/dist/styles.css +34 -0
- package/dist/{table-B0r76n48.js → table-CHv7WhD-.js} +2 -2
- package/dist/{table-B0r76n48.js.map → table-CHv7WhD-.js.map} +1 -1
- package/dist/{tinymce-Bqvl27oQ.js → tinymce-C6SvoJ11.js} +2 -2
- package/dist/{tinymce-Bqvl27oQ.js.map → tinymce-C6SvoJ11.js.map} +1 -1
- package/package.json +1 -1
- package/dist/plugin-BGAJPBIG.js.map +0 -1
|
@@ -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-C6SvoJ11.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-QHFCieCT.js"),
|
|
2848
|
+
import("./default-CFmoR_-0.js"),
|
|
2849
|
+
import("./silver-ChQqMCzI.js"),
|
|
2850
|
+
import("./code-C7FBvq-x.js"),
|
|
2851
|
+
import("./image-CaVnhKac.js"),
|
|
2852
|
+
import("./link-EYFpGwkF.js"),
|
|
2853
|
+
import("./lists-BzvUqNb9.js"),
|
|
2854
|
+
import("./table-CHv7WhD-.js")
|
|
2855
2855
|
]);
|
|
2856
2856
|
isEditorReady.value = true;
|
|
2857
2857
|
};
|
|
@@ -2975,30 +2975,30 @@ var _hoisted_5$5 = { class: "min-w-0 flex-1" };
|
|
|
2975
2975
|
var _hoisted_6$5 = ["disabled", "aria-label"];
|
|
2976
2976
|
var _hoisted_7$4 = { class: "mt-4 space-y-4" };
|
|
2977
2977
|
var _hoisted_8$2 = ["aria-label", "aria-valuenow"];
|
|
2978
|
-
var _hoisted_9$
|
|
2978
|
+
var _hoisted_9$2 = {
|
|
2979
2979
|
key: 0,
|
|
2980
2980
|
class: "absolute inset-0 bg-[linear-gradient(to_right,#fff,transparent)]"
|
|
2981
2981
|
};
|
|
2982
|
-
var _hoisted_10$
|
|
2982
|
+
var _hoisted_10$2 = {
|
|
2983
2983
|
key: 2,
|
|
2984
2984
|
class: "absolute inset-0 bg-[linear-gradient(to_top,#000,transparent)]"
|
|
2985
2985
|
};
|
|
2986
|
-
var _hoisted_11$
|
|
2987
|
-
var _hoisted_12 = {
|
|
2986
|
+
var _hoisted_11$2 = { class: "space-y-3" };
|
|
2987
|
+
var _hoisted_12$2 = {
|
|
2988
2988
|
key: 0,
|
|
2989
2989
|
class: "space-y-2"
|
|
2990
2990
|
};
|
|
2991
|
-
var _hoisted_13 = ["for"];
|
|
2992
|
-
var _hoisted_14 = [
|
|
2991
|
+
var _hoisted_13$2 = ["for"];
|
|
2992
|
+
var _hoisted_14$1 = [
|
|
2993
2993
|
"id",
|
|
2994
2994
|
"disabled",
|
|
2995
2995
|
"value"
|
|
2996
2996
|
];
|
|
2997
|
-
var _hoisted_15 = {
|
|
2997
|
+
var _hoisted_15$1 = {
|
|
2998
2998
|
key: 1,
|
|
2999
2999
|
class: "space-y-2"
|
|
3000
3000
|
};
|
|
3001
|
-
var _hoisted_16 = ["for"];
|
|
3001
|
+
var _hoisted_16$1 = ["for"];
|
|
3002
3002
|
var _hoisted_17 = [
|
|
3003
3003
|
"id",
|
|
3004
3004
|
"disabled",
|
|
@@ -3542,14 +3542,14 @@ var ColorPicker_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
3542
3542
|
onPointerdown: _cache[0] || (_cache[0] = ($event) => beginDrag($event, updateFromSaturationPointer)),
|
|
3543
3543
|
onKeydown: updateFromSaturationKey
|
|
3544
3544
|
}, [
|
|
3545
|
-
!isRainbowVariant.value ? (openBlock(), createElementBlock("div", _hoisted_9$
|
|
3546
|
-
isRainbowVariant.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [_cache[1] || (_cache[1] = createElementVNode("div", { class: "absolute inset-x-0 top-0 h-1/2 bg-[linear-gradient(to_bottom,#fff,transparent)]" }, null, -1)), _cache[2] || (_cache[2] = createElementVNode("div", { class: "absolute inset-x-0 bottom-0 h-1/2 bg-[linear-gradient(to_bottom,transparent,#000)]" }, null, -1))], 64)) : (openBlock(), createElementBlock("div", _hoisted_10$
|
|
3545
|
+
!isRainbowVariant.value ? (openBlock(), createElementBlock("div", _hoisted_9$2)) : createCommentVNode("", true),
|
|
3546
|
+
isRainbowVariant.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [_cache[1] || (_cache[1] = createElementVNode("div", { class: "absolute inset-x-0 top-0 h-1/2 bg-[linear-gradient(to_bottom,#fff,transparent)]" }, null, -1)), _cache[2] || (_cache[2] = createElementVNode("div", { class: "absolute inset-x-0 bottom-0 h-1/2 bg-[linear-gradient(to_bottom,transparent,#000)]" }, null, -1))], 64)) : (openBlock(), createElementBlock("div", _hoisted_10$2)),
|
|
3547
3547
|
createElementVNode("span", {
|
|
3548
3548
|
class: normalizeClass(["pointer-events-none absolute size-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,0.3)]", props.ui.saturationHandle]),
|
|
3549
3549
|
style: normalizeStyle(saturationHandleStyle.value)
|
|
3550
3550
|
}, null, 6)
|
|
3551
3551
|
], 46, _hoisted_8$2),
|
|
3552
|
-
createElementVNode("div", _hoisted_11$
|
|
3552
|
+
createElementVNode("div", _hoisted_11$2, [!isRainbowVariant.value ? (openBlock(), createElementBlock("div", _hoisted_12$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}-hue` : void 0 }, toDisplayString(unref(t)("Hue")), 9, _hoisted_13$2), createElementVNode("span", null, toDisplayString(Math.round(hue.value)) + "°", 1)], 2), createElementVNode("input", {
|
|
3553
3553
|
id: fieldId.value ? `${fieldId.value}-hue` : void 0,
|
|
3554
3554
|
type: "range",
|
|
3555
3555
|
min: "0",
|
|
@@ -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)])) : createCommentVNode("", true), props.allowAlpha ? (openBlock(), createElementBlock("div", _hoisted_15, [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), createElementVNode("span", null, toDisplayString(opacityPercent.value) + "%", 1)], 2), createElementVNode("input", {
|
|
3563
|
+
}, null, 42, _hoisted_14$1)])) : createCommentVNode("", true), props.allowAlpha ? (openBlock(), createElementBlock("div", _hoisted_15$1, [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$1), 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",
|
|
@@ -5474,6 +5474,50 @@ var createLucideIcon = (iconName, iconNode) => (props, { slots, attrs }) => h(Ic
|
|
|
5474
5474
|
* This source code is licensed under the ISC license.
|
|
5475
5475
|
* See the LICENSE file in the root directory of this source tree.
|
|
5476
5476
|
*/
|
|
5477
|
+
var GripVertical = createLucideIcon("grip-vertical", [
|
|
5478
|
+
["circle", {
|
|
5479
|
+
cx: "9",
|
|
5480
|
+
cy: "12",
|
|
5481
|
+
r: "1",
|
|
5482
|
+
key: "1vctgf"
|
|
5483
|
+
}],
|
|
5484
|
+
["circle", {
|
|
5485
|
+
cx: "9",
|
|
5486
|
+
cy: "5",
|
|
5487
|
+
r: "1",
|
|
5488
|
+
key: "hp0tcf"
|
|
5489
|
+
}],
|
|
5490
|
+
["circle", {
|
|
5491
|
+
cx: "9",
|
|
5492
|
+
cy: "19",
|
|
5493
|
+
r: "1",
|
|
5494
|
+
key: "fkjjf6"
|
|
5495
|
+
}],
|
|
5496
|
+
["circle", {
|
|
5497
|
+
cx: "15",
|
|
5498
|
+
cy: "12",
|
|
5499
|
+
r: "1",
|
|
5500
|
+
key: "1tmaij"
|
|
5501
|
+
}],
|
|
5502
|
+
["circle", {
|
|
5503
|
+
cx: "15",
|
|
5504
|
+
cy: "5",
|
|
5505
|
+
r: "1",
|
|
5506
|
+
key: "19l28e"
|
|
5507
|
+
}],
|
|
5508
|
+
["circle", {
|
|
5509
|
+
cx: "15",
|
|
5510
|
+
cy: "19",
|
|
5511
|
+
r: "1",
|
|
5512
|
+
key: "f4zoj3"
|
|
5513
|
+
}]
|
|
5514
|
+
]);
|
|
5515
|
+
/**
|
|
5516
|
+
* @license @lucide/vue v1.7.0 - ISC
|
|
5517
|
+
*
|
|
5518
|
+
* This source code is licensed under the ISC license.
|
|
5519
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
5520
|
+
*/
|
|
5477
5521
|
var PanelLeftClose = createLucideIcon("panel-left-close", [
|
|
5478
5522
|
["rect", {
|
|
5479
5523
|
width: "18",
|
|
@@ -6154,21 +6198,74 @@ var _sfc_main$2 = {
|
|
|
6154
6198
|
}
|
|
6155
6199
|
};
|
|
6156
6200
|
//#endregion
|
|
6201
|
+
//#region src/components/tableListOrdering.js
|
|
6202
|
+
var getNestedValue = (object, path) => {
|
|
6203
|
+
if (!path || typeof path !== "string") return object;
|
|
6204
|
+
return path.split(".").reduce((current, key) => current?.[key], object);
|
|
6205
|
+
};
|
|
6206
|
+
var setNestedValue = (object, path, value) => {
|
|
6207
|
+
if (!path || typeof path !== "string" || object == null) return;
|
|
6208
|
+
const keys = path.split(".");
|
|
6209
|
+
const lastKey = keys.pop();
|
|
6210
|
+
let current = object;
|
|
6211
|
+
for (const key of keys) {
|
|
6212
|
+
if (current[key] === void 0 || current[key] === null || typeof current[key] !== "object") current[key] = {};
|
|
6213
|
+
current = current[key];
|
|
6214
|
+
}
|
|
6215
|
+
if (lastKey !== void 0) current[lastKey] = value;
|
|
6216
|
+
};
|
|
6217
|
+
var getRowKey = (item, index, rowKey) => {
|
|
6218
|
+
if (typeof rowKey === "function") return rowKey(item, index) ?? `row-${index}`;
|
|
6219
|
+
return getNestedValue(item, rowKey) ?? `row-${index}`;
|
|
6220
|
+
};
|
|
6221
|
+
var cloneValue = (value) => {
|
|
6222
|
+
if (Array.isArray(value)) return value.map((entry) => cloneValue(entry));
|
|
6223
|
+
if (value && typeof value === "object") return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, cloneValue(entry)]));
|
|
6224
|
+
return value;
|
|
6225
|
+
};
|
|
6226
|
+
var reorderRows = ({ data, fromIndex, toIndex, orderField, mutateRows }) => {
|
|
6227
|
+
const reorderedData = mutateRows ? [...data] : data.map((item) => cloneValue(item));
|
|
6228
|
+
const [movedItem] = reorderedData.splice(fromIndex, 1);
|
|
6229
|
+
reorderedData.splice(toIndex, 0, movedItem);
|
|
6230
|
+
if (mutateRows) reorderedData.forEach((item, index) => setNestedValue(item, orderField, index + 1));
|
|
6231
|
+
return {
|
|
6232
|
+
data: reorderedData,
|
|
6233
|
+
item: movedItem,
|
|
6234
|
+
fromIndex,
|
|
6235
|
+
toIndex
|
|
6236
|
+
};
|
|
6237
|
+
};
|
|
6238
|
+
//#endregion
|
|
6157
6239
|
//#region src/components/TableList.vue
|
|
6158
6240
|
var _hoisted_1$3 = { class: "space-y-6" };
|
|
6159
|
-
var _hoisted_2$2 =
|
|
6160
|
-
|
|
6241
|
+
var _hoisted_2$2 = {
|
|
6242
|
+
key: 0,
|
|
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
|
+
};
|
|
6245
|
+
var _hoisted_3$2 = ["onDragover", "onDrop"];
|
|
6246
|
+
var _hoisted_4$1 = {
|
|
6247
|
+
key: 0,
|
|
6248
|
+
class: "w-10 whitespace-nowrap px-2 py-4 text-center text-sm text-neutral-500 dark:text-neutral-400"
|
|
6249
|
+
};
|
|
6250
|
+
var _hoisted_5$1 = { class: "inline-flex items-center gap-1" };
|
|
6251
|
+
var _hoisted_6$1 = [
|
|
6252
|
+
"draggable",
|
|
6253
|
+
"aria-label",
|
|
6254
|
+
"onDragstart"
|
|
6255
|
+
];
|
|
6256
|
+
var _hoisted_7$1 = ["title"];
|
|
6257
|
+
var _hoisted_8$1 = {
|
|
6161
6258
|
key: 0,
|
|
6162
6259
|
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"
|
|
6163
6260
|
};
|
|
6164
|
-
var
|
|
6165
|
-
var
|
|
6261
|
+
var _hoisted_9$1 = ["innerHTML"];
|
|
6262
|
+
var _hoisted_10$1 = {
|
|
6166
6263
|
key: 0,
|
|
6167
6264
|
class: "py-12 text-center"
|
|
6168
6265
|
};
|
|
6169
|
-
var
|
|
6170
|
-
var
|
|
6171
|
-
var
|
|
6266
|
+
var _hoisted_11$1 = { class: "mb-4 inline-flex h-16 w-16 items-center justify-center rounded-full bg-neutral-100 dark:bg-neutral-900" };
|
|
6267
|
+
var _hoisted_12$1 = { class: "mb-2 text-lg font-semibold text-neutral-950 dark:text-neutral-50" };
|
|
6268
|
+
var _hoisted_13$1 = { class: "mb-4 text-neutral-600 dark:text-neutral-200" };
|
|
6172
6269
|
var _sfc_main$1 = {
|
|
6173
6270
|
__name: "TableList",
|
|
6174
6271
|
props: {
|
|
@@ -6180,6 +6277,22 @@ var _sfc_main$1 = {
|
|
|
6180
6277
|
type: Array,
|
|
6181
6278
|
required: true
|
|
6182
6279
|
},
|
|
6280
|
+
rowKey: {
|
|
6281
|
+
type: [String, Function],
|
|
6282
|
+
default: "id"
|
|
6283
|
+
},
|
|
6284
|
+
orderable: {
|
|
6285
|
+
type: Boolean,
|
|
6286
|
+
default: false
|
|
6287
|
+
},
|
|
6288
|
+
orderField: {
|
|
6289
|
+
type: String,
|
|
6290
|
+
default: "order"
|
|
6291
|
+
},
|
|
6292
|
+
mutateRows: {
|
|
6293
|
+
type: Boolean,
|
|
6294
|
+
default: true
|
|
6295
|
+
},
|
|
6183
6296
|
sortField: {
|
|
6184
6297
|
type: String,
|
|
6185
6298
|
default: ""
|
|
@@ -6287,6 +6400,7 @@ var _sfc_main$1 = {
|
|
|
6287
6400
|
},
|
|
6288
6401
|
emits: [
|
|
6289
6402
|
"sort",
|
|
6403
|
+
"reorder",
|
|
6290
6404
|
"update:searchShowDeleted",
|
|
6291
6405
|
"update:searchValue"
|
|
6292
6406
|
],
|
|
@@ -6294,6 +6408,10 @@ var _sfc_main$1 = {
|
|
|
6294
6408
|
const slots = useSlots();
|
|
6295
6409
|
const props = __props;
|
|
6296
6410
|
const emit = __emit;
|
|
6411
|
+
const localData = ref(props.data);
|
|
6412
|
+
watch(() => props.data, (value) => {
|
|
6413
|
+
localData.value = value;
|
|
6414
|
+
});
|
|
6297
6415
|
computed(() => !!slots.actions);
|
|
6298
6416
|
const internalSearchQuery = ref("");
|
|
6299
6417
|
const searchQuery = computed({
|
|
@@ -6304,9 +6422,9 @@ var _sfc_main$1 = {
|
|
|
6304
6422
|
}
|
|
6305
6423
|
});
|
|
6306
6424
|
const filteredData = computed(() => {
|
|
6307
|
-
if (props.searchMode !== "client" || !props.search || !searchQuery.value.trim()) return
|
|
6425
|
+
if (props.searchMode !== "client" || !props.search || !searchQuery.value.trim()) return localData.value;
|
|
6308
6426
|
const query = searchQuery.value.toLowerCase().trim();
|
|
6309
|
-
return
|
|
6427
|
+
return localData.value.filter((item) => {
|
|
6310
6428
|
return props.columns.some((column) => {
|
|
6311
6429
|
if (column.searchable === false || column.slot) return false;
|
|
6312
6430
|
const value = column.key.split(".").reduce((obj, key) => obj?.[key], item);
|
|
@@ -6319,6 +6437,87 @@ var _sfc_main$1 = {
|
|
|
6319
6437
|
const resolvedSearchCount = computed(() => {
|
|
6320
6438
|
return props.searchCount ?? filteredData.value.length;
|
|
6321
6439
|
});
|
|
6440
|
+
const draggedIndex = ref(null);
|
|
6441
|
+
const dragOverIndex = ref(null);
|
|
6442
|
+
const dragPreview = ref(null);
|
|
6443
|
+
const dragRowHeight = ref(0);
|
|
6444
|
+
const canReorder = computed(() => {
|
|
6445
|
+
return props.orderable && !searchQuery.value.trim();
|
|
6446
|
+
});
|
|
6447
|
+
const startDrag = (index, event) => {
|
|
6448
|
+
if (!canReorder.value) {
|
|
6449
|
+
event.preventDefault();
|
|
6450
|
+
return;
|
|
6451
|
+
}
|
|
6452
|
+
draggedIndex.value = index;
|
|
6453
|
+
dragOverIndex.value = index;
|
|
6454
|
+
const row = event.currentTarget?.closest("tr");
|
|
6455
|
+
if (row) {
|
|
6456
|
+
dragRowHeight.value = row.offsetHeight;
|
|
6457
|
+
const preview = document.createElement("div");
|
|
6458
|
+
const previewTable = document.createElement("table");
|
|
6459
|
+
const previewBody = document.createElement("tbody");
|
|
6460
|
+
previewTable.className = row.closest("table")?.className ?? "";
|
|
6461
|
+
previewTable.style.width = `${row.getBoundingClientRect().width}px`;
|
|
6462
|
+
previewTable.style.borderCollapse = "collapse";
|
|
6463
|
+
previewBody.appendChild(row.cloneNode(true));
|
|
6464
|
+
previewTable.appendChild(previewBody);
|
|
6465
|
+
preview.appendChild(previewTable);
|
|
6466
|
+
dragPreview.value = preview;
|
|
6467
|
+
dragPreview.value.style.position = "fixed";
|
|
6468
|
+
dragPreview.value.style.top = "-10000px";
|
|
6469
|
+
dragPreview.value.style.left = "0";
|
|
6470
|
+
dragPreview.value.style.background = "white";
|
|
6471
|
+
dragPreview.value.style.borderRadius = "0.5rem";
|
|
6472
|
+
dragPreview.value.style.boxShadow = "0 10px 25px rgb(15 23 42 / 0.18)";
|
|
6473
|
+
dragPreview.value.style.opacity = "0.96";
|
|
6474
|
+
dragPreview.value.style.pointerEvents = "none";
|
|
6475
|
+
document.body.appendChild(dragPreview.value);
|
|
6476
|
+
event.dataTransfer.setDragImage(dragPreview.value, 24, dragRowHeight.value / 2);
|
|
6477
|
+
}
|
|
6478
|
+
event.dataTransfer.effectAllowed = "move";
|
|
6479
|
+
event.dataTransfer.setData("text/plain", String(index));
|
|
6480
|
+
};
|
|
6481
|
+
const endDrag = () => {
|
|
6482
|
+
dragPreview.value?.remove();
|
|
6483
|
+
dragPreview.value = null;
|
|
6484
|
+
draggedIndex.value = null;
|
|
6485
|
+
dragOverIndex.value = null;
|
|
6486
|
+
dragRowHeight.value = 0;
|
|
6487
|
+
};
|
|
6488
|
+
const updateDragOver = (index) => {
|
|
6489
|
+
if (canReorder.value) dragOverIndex.value = index;
|
|
6490
|
+
};
|
|
6491
|
+
const rowDragStyle = (index) => {
|
|
6492
|
+
if (draggedIndex.value === null || dragOverIndex.value === null || draggedIndex.value === dragOverIndex.value || index === draggedIndex.value) return {};
|
|
6493
|
+
if (draggedIndex.value < dragOverIndex.value) {
|
|
6494
|
+
if (index > draggedIndex.value && index <= dragOverIndex.value) return { transform: `translateY(-${dragRowHeight.value}px)` };
|
|
6495
|
+
} else if (index >= dragOverIndex.value && index < draggedIndex.value) return { transform: `translateY(${dragRowHeight.value}px)` };
|
|
6496
|
+
return {};
|
|
6497
|
+
};
|
|
6498
|
+
const dropRow = (toIndex, event) => {
|
|
6499
|
+
event.preventDefault();
|
|
6500
|
+
if (!canReorder.value || draggedIndex.value === null || draggedIndex.value === toIndex) {
|
|
6501
|
+
endDrag();
|
|
6502
|
+
return;
|
|
6503
|
+
}
|
|
6504
|
+
const result = reorderRows({
|
|
6505
|
+
data: localData.value,
|
|
6506
|
+
fromIndex: draggedIndex.value,
|
|
6507
|
+
toIndex,
|
|
6508
|
+
orderField: props.orderField,
|
|
6509
|
+
mutateRows: props.mutateRows
|
|
6510
|
+
});
|
|
6511
|
+
if (props.mutateRows) {
|
|
6512
|
+
props.data.splice(0, props.data.length, ...result.data);
|
|
6513
|
+
localData.value = props.data;
|
|
6514
|
+
} else localData.value = result.data;
|
|
6515
|
+
emit("reorder", {
|
|
6516
|
+
...result,
|
|
6517
|
+
rowKey: getRowKey(result.item, toIndex, props.rowKey)
|
|
6518
|
+
});
|
|
6519
|
+
endDrag();
|
|
6520
|
+
};
|
|
6322
6521
|
const sortBy = (field) => {
|
|
6323
6522
|
emit("sort", field);
|
|
6324
6523
|
};
|
|
@@ -6400,75 +6599,92 @@ var _sfc_main$1 = {
|
|
|
6400
6599
|
"show-deleted-label",
|
|
6401
6600
|
"search-mode",
|
|
6402
6601
|
"search-fields-layout"
|
|
6403
|
-
])) : 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", { class: normalizeClass(joinClasses("min-w-full divide-y divide-neutral-200 dark:divide-neutral-800", __props.tableClass)) }, [createElementVNode("thead", { class: normalizeClass(joinClasses("bg-neutral-50/80 dark:bg-neutral-900/80", __props.theadClass)) }, [createElementVNode("tr", { class: normalizeClass(__props.headerRowClass) }, [
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6602
|
+
])) : 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", { class: normalizeClass(joinClasses("min-w-full divide-y divide-neutral-200 dark:divide-neutral-800", __props.tableClass)) }, [createElementVNode("thead", { class: normalizeClass(joinClasses("bg-neutral-50/80 dark:bg-neutral-900/80", __props.theadClass)) }, [createElementVNode("tr", { class: normalizeClass(__props.headerRowClass) }, [
|
|
6603
|
+
__props.orderable ? (openBlock(), createElementBlock("th", _hoisted_2$2, "#")) : createCommentVNode("", true),
|
|
6604
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column) => {
|
|
6605
|
+
return openBlock(), createElementBlock(Fragment, { key: column.key }, [column.sortable ? (openBlock(), createBlock(_sfc_main$3, {
|
|
6606
|
+
key: 0,
|
|
6607
|
+
field: column.key,
|
|
6608
|
+
"current-sort-field": __props.sortField,
|
|
6609
|
+
"current-direction": __props.sortDirection,
|
|
6610
|
+
"header-class": getHeaderClass(column),
|
|
6611
|
+
"header-style": getColumnWidthStyle(column),
|
|
6612
|
+
"content-class": getContentClass(column),
|
|
6613
|
+
onSort: sortBy
|
|
6614
|
+
}, {
|
|
6615
|
+
default: withCtx(() => [createTextVNode(toDisplayString(column.label), 1)]),
|
|
6616
|
+
_: 2
|
|
6617
|
+
}, 1032, [
|
|
6618
|
+
"field",
|
|
6619
|
+
"current-sort-field",
|
|
6620
|
+
"current-direction",
|
|
6621
|
+
"header-class",
|
|
6622
|
+
"header-style",
|
|
6623
|
+
"content-class"
|
|
6624
|
+
])) : (openBlock(), createElementBlock("th", {
|
|
6625
|
+
key: 1,
|
|
6626
|
+
class: normalizeClass(getHeaderClass(column)),
|
|
6627
|
+
style: normalizeStyle(getColumnWidthStyle(column))
|
|
6628
|
+
}, [createElementVNode("div", { class: normalizeClass(getContentClass(column)) }, toDisplayString(column.label), 3)], 6))], 64);
|
|
6629
|
+
}), 128)),
|
|
6630
|
+
_ctx.$slots.actions ? (openBlock(), createElementBlock("th", {
|
|
6424
6631
|
key: 1,
|
|
6425
|
-
class: normalizeClass(
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
}), 128)), _ctx.$slots.actions ? (openBlock(), createElementBlock("th", {
|
|
6429
|
-
key: 0,
|
|
6430
|
-
class: normalizeClass(actionHeaderClass.value)
|
|
6431
|
-
}, toDisplayString(__props.actionsLabel), 3)) : createCommentVNode("", true)], 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) => {
|
|
6632
|
+
class: normalizeClass(actionHeaderClass.value)
|
|
6633
|
+
}, toDisplayString(__props.actionsLabel), 3)) : createCommentVNode("", true)
|
|
6634
|
+
], 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) => {
|
|
6432
6635
|
return openBlock(), createElementBlock("tr", {
|
|
6433
|
-
key: item.
|
|
6434
|
-
class: normalizeClass(__props.rowClasses(item, index))
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6636
|
+
key: unref(getRowKey)(item, index, __props.rowKey),
|
|
6637
|
+
class: normalizeClass(joinClasses(__props.rowClasses(item, index), "transition-[transform,opacity,box-shadow] duration-200 ease-out", draggedIndex.value === index ? "opacity-0" : "", dragOverIndex.value === index ? "ring-2 ring-inset ring-neutral-400 dark:ring-neutral-500" : "")),
|
|
6638
|
+
style: normalizeStyle(rowDragStyle(index)),
|
|
6639
|
+
onDragover: withModifiers(($event) => updateDragOver(index), ["prevent"]),
|
|
6640
|
+
onDrop: ($event) => dropRow(index, $event)
|
|
6641
|
+
}, [
|
|
6642
|
+
__props.orderable ? (openBlock(), createElementBlock("td", _hoisted_4$1, [createElementVNode("span", _hoisted_5$1, [createElementVNode("span", {
|
|
6643
|
+
draggable: canReorder.value,
|
|
6644
|
+
class: "cursor-grab touch-none active:cursor-grabbing",
|
|
6645
|
+
"aria-label": `Drag row ${index + 1}`,
|
|
6646
|
+
onDragstart: ($event) => startDrag(index, $event),
|
|
6647
|
+
onDragend: endDrag
|
|
6648
|
+
}, [createVNode(unref(GripVertical), { class: "size-4" })], 40, _hoisted_6$1), createElementVNode("span", null, toDisplayString(index + 1), 1)])])) : createCommentVNode("", true),
|
|
6649
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column) => {
|
|
6650
|
+
return openBlock(), createElementBlock("td", {
|
|
6651
|
+
key: column.key,
|
|
6652
|
+
class: normalizeClass(getColumnClass(column)),
|
|
6653
|
+
style: normalizeStyle(getColumnWidthStyle(column))
|
|
6654
|
+
}, [column.key === "name" && !column.slot ? (openBlock(), createElementBlock("div", {
|
|
6655
|
+
key: 0,
|
|
6656
|
+
class: normalizeClass(joinClasses("flex items-center", getContentClass(column)))
|
|
6657
|
+
}, [createElementVNode("div", {
|
|
6658
|
+
class: "truncate text-sm font-medium text-neutral-950 dark:text-neutral-50",
|
|
6659
|
+
title: getCellContent(item, column)
|
|
6660
|
+
}, toDisplayString(getCellContent(item, column)), 9, _hoisted_7$1), isDeleted(item) ? (openBlock(), createElementBlock("span", _hoisted_8$1, toDisplayString(__props.deletedLabel), 1)) : createCommentVNode("", true)], 2)) : column.slot ? (openBlock(), createElementBlock("div", {
|
|
6661
|
+
key: 1,
|
|
6662
|
+
class: normalizeClass(getContentClass(column))
|
|
6663
|
+
}, [renderSlot(_ctx.$slots, column.slot, {
|
|
6664
|
+
item,
|
|
6665
|
+
column,
|
|
6666
|
+
index
|
|
6667
|
+
})], 2)) : column.render ? (openBlock(), createElementBlock("div", {
|
|
6668
|
+
key: 2,
|
|
6669
|
+
class: normalizeClass(getContentClass(column)),
|
|
6670
|
+
innerHTML: column.render(item)
|
|
6671
|
+
}, null, 10, _hoisted_9$1)) : (openBlock(), createElementBlock("div", {
|
|
6672
|
+
key: 3,
|
|
6673
|
+
class: normalizeClass(getContentClass(column))
|
|
6674
|
+
}, toDisplayString(getCellContent(item, column)), 3))], 6);
|
|
6675
|
+
}), 128)),
|
|
6676
|
+
_ctx.$slots.actions ? (openBlock(), createElementBlock("td", {
|
|
6447
6677
|
key: 1,
|
|
6448
|
-
class: normalizeClass(
|
|
6449
|
-
}, [renderSlot(_ctx.$slots,
|
|
6678
|
+
class: normalizeClass(actionCellClass.value)
|
|
6679
|
+
}, [renderSlot(_ctx.$slots, "actions", {
|
|
6450
6680
|
item,
|
|
6451
|
-
column,
|
|
6452
6681
|
index
|
|
6453
|
-
})], 2)) :
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
class: normalizeClass(getContentClass(column))
|
|
6460
|
-
}, toDisplayString(getCellContent(item, column)), 3))], 6);
|
|
6461
|
-
}), 128)), _ctx.$slots.actions ? (openBlock(), createElementBlock("td", {
|
|
6462
|
-
key: 0,
|
|
6463
|
-
class: normalizeClass(actionCellClass.value)
|
|
6464
|
-
}, [renderSlot(_ctx.$slots, "actions", {
|
|
6465
|
-
item,
|
|
6466
|
-
index
|
|
6467
|
-
})], 2)) : createCommentVNode("", true)], 2);
|
|
6468
|
-
}), 128))], 2)], 2)], 2), !hasData.value ? (openBlock(), createElementBlock("div", _hoisted_5$1, [
|
|
6469
|
-
createElementVNode("div", _hoisted_6$1, [(openBlock(), createBlock(resolveDynamicComponent(__props.emptyState.icon), { class: "h-8 w-8 text-neutral-400 dark:text-neutral-200" }))]),
|
|
6470
|
-
createElementVNode("h3", _hoisted_7$1, toDisplayString(__props.emptyState.title), 1),
|
|
6471
|
-
createElementVNode("p", _hoisted_8$1, toDisplayString(__props.emptyState.description), 1),
|
|
6682
|
+
})], 2)) : createCommentVNode("", true)
|
|
6683
|
+
], 46, _hoisted_3$2);
|
|
6684
|
+
}), 128))], 2)], 2)], 2), !hasData.value ? (openBlock(), createElementBlock("div", _hoisted_10$1, [
|
|
6685
|
+
createElementVNode("div", _hoisted_11$1, [(openBlock(), createBlock(resolveDynamicComponent(__props.emptyState.icon), { class: "h-8 w-8 text-neutral-400 dark:text-neutral-200" }))]),
|
|
6686
|
+
createElementVNode("h3", _hoisted_12$1, toDisplayString(__props.emptyState.title), 1),
|
|
6687
|
+
createElementVNode("p", _hoisted_13$1, toDisplayString(__props.emptyState.description), 1),
|
|
6472
6688
|
__props.emptyState.actionText && __props.emptyState.actionUrl ? (openBlock(), createBlock(_sfc_main$6, {
|
|
6473
6689
|
key: 0,
|
|
6474
6690
|
href: __props.emptyState.actionUrl,
|
|
@@ -6484,25 +6700,40 @@ var _sfc_main$1 = {
|
|
|
6484
6700
|
//#endregion
|
|
6485
6701
|
//#region src/components/TableListForm.vue
|
|
6486
6702
|
var _hoisted_1$2 = {
|
|
6703
|
+
key: 0,
|
|
6704
|
+
class: "w-10 px-2 py-3 text-center text-xs font-medium uppercase tracking-wider text-neutral-500 dark:text-neutral-200"
|
|
6705
|
+
};
|
|
6706
|
+
var _hoisted_2$1 = ["onDragover", "onDrop"];
|
|
6707
|
+
var _hoisted_3$1 = {
|
|
6708
|
+
key: 0,
|
|
6709
|
+
class: "w-10 whitespace-nowrap px-2 py-4 text-center text-sm text-neutral-500 dark:text-neutral-400"
|
|
6710
|
+
};
|
|
6711
|
+
var _hoisted_4 = { class: "inline-flex items-center gap-1" };
|
|
6712
|
+
var _hoisted_5 = [
|
|
6713
|
+
"draggable",
|
|
6714
|
+
"aria-label",
|
|
6715
|
+
"onDragstart"
|
|
6716
|
+
];
|
|
6717
|
+
var _hoisted_6 = {
|
|
6487
6718
|
key: 2,
|
|
6488
6719
|
class: "flex items-center"
|
|
6489
6720
|
};
|
|
6490
|
-
var
|
|
6491
|
-
var
|
|
6721
|
+
var _hoisted_7 = ["title"];
|
|
6722
|
+
var _hoisted_8 = {
|
|
6492
6723
|
key: 0,
|
|
6493
6724
|
class: "ml-2 inline-flex items-center rounded-full bg-red-100 px-2 py-1 text-xs font-medium text-red-800 dark:bg-red-950/60 dark:text-neutral-100"
|
|
6494
6725
|
};
|
|
6495
|
-
var
|
|
6496
|
-
var
|
|
6497
|
-
var
|
|
6498
|
-
var
|
|
6499
|
-
var
|
|
6726
|
+
var _hoisted_9 = ["innerHTML"];
|
|
6727
|
+
var _hoisted_10 = { key: 5 };
|
|
6728
|
+
var _hoisted_11 = { class: "flex items-center justify-end gap-2" };
|
|
6729
|
+
var _hoisted_12 = ["colspan"];
|
|
6730
|
+
var _hoisted_13 = {
|
|
6500
6731
|
key: 2,
|
|
6501
6732
|
class: "py-12 text-center"
|
|
6502
6733
|
};
|
|
6503
|
-
var
|
|
6504
|
-
var
|
|
6505
|
-
var
|
|
6734
|
+
var _hoisted_14 = { class: "mb-4 inline-flex h-16 w-16 items-center justify-center rounded-full bg-neutral-100 dark:bg-neutral-900" };
|
|
6735
|
+
var _hoisted_15 = { class: "mb-2 text-lg font-medium text-neutral-950 dark:text-neutral-50" };
|
|
6736
|
+
var _hoisted_16 = { class: "mb-4 text-neutral-500 dark:text-neutral-200" };
|
|
6506
6737
|
var _sfc_main = {
|
|
6507
6738
|
__name: "TableListForm",
|
|
6508
6739
|
props: {
|
|
@@ -6644,11 +6875,20 @@ var _sfc_main = {
|
|
|
6644
6875
|
expandedCellClass: {
|
|
6645
6876
|
type: String,
|
|
6646
6877
|
default: "p-0"
|
|
6878
|
+
},
|
|
6879
|
+
orderable: {
|
|
6880
|
+
type: Boolean,
|
|
6881
|
+
default: false
|
|
6882
|
+
},
|
|
6883
|
+
orderField: {
|
|
6884
|
+
type: String,
|
|
6885
|
+
default: "order"
|
|
6647
6886
|
}
|
|
6648
6887
|
},
|
|
6649
6888
|
emits: [
|
|
6650
6889
|
"sort",
|
|
6651
6890
|
"update",
|
|
6891
|
+
"reorder",
|
|
6652
6892
|
"update:editingRowKey",
|
|
6653
6893
|
"edit-start",
|
|
6654
6894
|
"edit-cancel",
|
|
@@ -6660,6 +6900,7 @@ var _sfc_main = {
|
|
|
6660
6900
|
const emit = __emit;
|
|
6661
6901
|
const localSortField = ref(props.sortField);
|
|
6662
6902
|
const localSortDirection = ref(props.sortDirection);
|
|
6903
|
+
const localData = ref(props.data);
|
|
6663
6904
|
const internalSearchQuery = ref("");
|
|
6664
6905
|
const searchQuery = computed({
|
|
6665
6906
|
get: () => props.searchValue ?? internalSearchQuery.value,
|
|
@@ -6673,6 +6914,50 @@ var _sfc_main = {
|
|
|
6673
6914
|
const resolvedEditingRowKey = computed(() => {
|
|
6674
6915
|
return props.editingRowKey !== void 0 ? props.editingRowKey : internalEditingRowKey.value;
|
|
6675
6916
|
});
|
|
6917
|
+
watch(() => props.data, (value) => {
|
|
6918
|
+
localData.value = value;
|
|
6919
|
+
});
|
|
6920
|
+
const draggedIndex = ref(null);
|
|
6921
|
+
const dragOverIndex = ref(null);
|
|
6922
|
+
const canReorder = computed(() => {
|
|
6923
|
+
return props.orderable && !searchQuery.value.trim() && !localSortField.value;
|
|
6924
|
+
});
|
|
6925
|
+
const startDrag = (index, event) => {
|
|
6926
|
+
if (!canReorder.value) {
|
|
6927
|
+
event.preventDefault();
|
|
6928
|
+
return;
|
|
6929
|
+
}
|
|
6930
|
+
draggedIndex.value = index;
|
|
6931
|
+
event.dataTransfer.effectAllowed = "move";
|
|
6932
|
+
event.dataTransfer.setData("text/plain", String(index));
|
|
6933
|
+
};
|
|
6934
|
+
const endDrag = () => {
|
|
6935
|
+
draggedIndex.value = null;
|
|
6936
|
+
dragOverIndex.value = null;
|
|
6937
|
+
};
|
|
6938
|
+
const dropRow = (toIndex, event) => {
|
|
6939
|
+
event.preventDefault();
|
|
6940
|
+
if (!canReorder.value || draggedIndex.value === null || draggedIndex.value === toIndex) {
|
|
6941
|
+
endDrag();
|
|
6942
|
+
return;
|
|
6943
|
+
}
|
|
6944
|
+
const result = reorderRows({
|
|
6945
|
+
data: localData.value,
|
|
6946
|
+
fromIndex: draggedIndex.value,
|
|
6947
|
+
toIndex,
|
|
6948
|
+
orderField: props.orderField,
|
|
6949
|
+
mutateRows: props.mutateRows
|
|
6950
|
+
});
|
|
6951
|
+
if (props.mutateRows) {
|
|
6952
|
+
props.data.splice(0, props.data.length, ...result.data);
|
|
6953
|
+
localData.value = props.data;
|
|
6954
|
+
} else localData.value = result.data;
|
|
6955
|
+
emit("reorder", {
|
|
6956
|
+
...result,
|
|
6957
|
+
rowKey: getRowKey(result.item, toIndex, props.rowKey)
|
|
6958
|
+
});
|
|
6959
|
+
endDrag();
|
|
6960
|
+
};
|
|
6676
6961
|
watch(() => props.sortField, (value) => {
|
|
6677
6962
|
localSortField.value = value;
|
|
6678
6963
|
});
|
|
@@ -6688,21 +6973,21 @@ var _sfc_main = {
|
|
|
6688
6973
|
editingDraft.value = {};
|
|
6689
6974
|
return;
|
|
6690
6975
|
}
|
|
6691
|
-
const activeItem = props.data.find((item, index) => getRowKey(item, index) === nextKey);
|
|
6976
|
+
const activeItem = props.data.find((item, index) => getRowKey$1(item, index) === nextKey);
|
|
6692
6977
|
editingDraft.value = activeItem ? cloneValue(activeItem) : {};
|
|
6693
6978
|
});
|
|
6694
6979
|
watch(() => props.data, () => {
|
|
6695
6980
|
if (resolvedEditingRowKey.value === null || resolvedEditingRowKey.value === void 0) return;
|
|
6696
|
-
if (!props.data.find((item, index) => getRowKey(item, index) === resolvedEditingRowKey.value)) resetEditState();
|
|
6981
|
+
if (!props.data.find((item, index) => getRowKey$1(item, index) === resolvedEditingRowKey.value)) resetEditState();
|
|
6697
6982
|
}, { deep: true });
|
|
6698
6983
|
const sortedData = computed(() => {
|
|
6699
|
-
let filteredData =
|
|
6984
|
+
let filteredData = localData.value;
|
|
6700
6985
|
if (props.searchMode === "client" && props.search && searchQuery.value.trim()) {
|
|
6701
6986
|
const query = searchQuery.value.toLowerCase().trim();
|
|
6702
|
-
filteredData =
|
|
6987
|
+
filteredData = localData.value.filter((item) => {
|
|
6703
6988
|
return props.columns.some((column) => {
|
|
6704
6989
|
if (!column.searchable) return false;
|
|
6705
|
-
const value = getNestedValue(item, column.key);
|
|
6990
|
+
const value = getNestedValue$1(item, column.key);
|
|
6706
6991
|
if (value === null || value === void 0 || value === "") return false;
|
|
6707
6992
|
return String(value).toLowerCase().includes(query);
|
|
6708
6993
|
});
|
|
@@ -6710,8 +6995,8 @@ var _sfc_main = {
|
|
|
6710
6995
|
}
|
|
6711
6996
|
if (!localSortField.value) return filteredData;
|
|
6712
6997
|
return [...filteredData].sort((a, b) => {
|
|
6713
|
-
const aValue = getNestedValue(a, localSortField.value);
|
|
6714
|
-
const bValue = getNestedValue(b, localSortField.value);
|
|
6998
|
+
const aValue = getNestedValue$1(a, localSortField.value);
|
|
6999
|
+
const bValue = getNestedValue$1(b, localSortField.value);
|
|
6715
7000
|
if (aValue === null || aValue === void 0 || aValue === "") return 1;
|
|
6716
7001
|
if (bValue === null || bValue === void 0 || bValue === "") return -1;
|
|
6717
7002
|
let comparison = 0;
|
|
@@ -6753,28 +7038,20 @@ var _sfc_main = {
|
|
|
6753
7038
|
if (!Number.isFinite(maxLength) || maxLength <= 0 || stringValue.length <= maxLength) return stringValue;
|
|
6754
7039
|
return `${stringValue.slice(0, maxLength)}...`;
|
|
6755
7040
|
};
|
|
6756
|
-
const getNestedValue = (obj, path) => {
|
|
7041
|
+
const getNestedValue$1 = (obj, path) => {
|
|
6757
7042
|
if (!path || typeof path !== "string") return obj;
|
|
6758
|
-
return
|
|
7043
|
+
return getNestedValue(obj, path);
|
|
6759
7044
|
};
|
|
6760
|
-
const setNestedValue = (obj, path, value) => {
|
|
7045
|
+
const setNestedValue$1 = (obj, path, value) => {
|
|
6761
7046
|
if (!path || typeof path !== "string" || obj == null) return;
|
|
6762
|
-
|
|
6763
|
-
const lastKey = keys.pop();
|
|
6764
|
-
let current = obj;
|
|
6765
|
-
for (const key of keys) {
|
|
6766
|
-
if (current[key] === void 0 || current[key] === null || typeof current[key] !== "object") current[key] = {};
|
|
6767
|
-
current = current[key];
|
|
6768
|
-
}
|
|
6769
|
-
if (lastKey !== void 0) current[lastKey] = value;
|
|
7047
|
+
setNestedValue(obj, path, value);
|
|
6770
7048
|
};
|
|
6771
7049
|
const getDataIndex = (item) => {
|
|
6772
|
-
if (item?.id) return
|
|
6773
|
-
return
|
|
7050
|
+
if (item?.id) return localData.value.findIndex((row) => row?.id === item.id);
|
|
7051
|
+
return localData.value.findIndex((row) => row === item);
|
|
6774
7052
|
};
|
|
6775
|
-
const getRowKey = (item, index) => {
|
|
6776
|
-
|
|
6777
|
-
return getNestedValue(item, props.rowKey) ?? `row-${index}`;
|
|
7053
|
+
const getRowKey$1 = (item, index) => {
|
|
7054
|
+
return getRowKey(item, index, props.rowKey);
|
|
6778
7055
|
};
|
|
6779
7056
|
const getEditSlotName = (column) => `${column.slot}-edit`;
|
|
6780
7057
|
const isDeleted = (item) => props.isDeletedFn(item);
|
|
@@ -6783,7 +7060,7 @@ var _sfc_main = {
|
|
|
6783
7060
|
emit("update:editingRowKey", value);
|
|
6784
7061
|
};
|
|
6785
7062
|
const isEditingRow = (item, index) => {
|
|
6786
|
-
return props.rowEditing && resolvedEditingRowKey.value !== null && resolvedEditingRowKey.value === getRowKey(item, index);
|
|
7063
|
+
return props.rowEditing && resolvedEditingRowKey.value !== null && resolvedEditingRowKey.value === getRowKey$1(item, index);
|
|
6787
7064
|
};
|
|
6788
7065
|
const isRowEditDisabled = (item, index) => {
|
|
6789
7066
|
if (!props.rowEditing) return true;
|
|
@@ -6795,7 +7072,7 @@ var _sfc_main = {
|
|
|
6795
7072
|
};
|
|
6796
7073
|
const startEdit = (item, index) => {
|
|
6797
7074
|
if (isRowEditDisabled(item, index)) return;
|
|
6798
|
-
const rowKey = getRowKey(item, index);
|
|
7075
|
+
const rowKey = getRowKey$1(item, index);
|
|
6799
7076
|
setEditingRowKey(rowKey);
|
|
6800
7077
|
emit("edit-start", {
|
|
6801
7078
|
item,
|
|
@@ -6807,13 +7084,13 @@ var _sfc_main = {
|
|
|
6807
7084
|
emit("edit-cancel", {
|
|
6808
7085
|
item,
|
|
6809
7086
|
index: getDataIndex(item),
|
|
6810
|
-
rowKey: getRowKey(item, index)
|
|
7087
|
+
rowKey: getRowKey$1(item, index)
|
|
6811
7088
|
});
|
|
6812
7089
|
resetEditState();
|
|
6813
7090
|
};
|
|
6814
7091
|
const updateDraft = (field, value, item, eventName = void 0) => {
|
|
6815
|
-
setNestedValue(editingDraft.value, field, value);
|
|
6816
|
-
if (props.mutateRows) setNestedValue(item, field, cloneValue(value));
|
|
7092
|
+
setNestedValue$1(editingDraft.value, field, value);
|
|
7093
|
+
if (props.mutateRows) setNestedValue$1(item, field, cloneValue(value));
|
|
6817
7094
|
emit("update", {
|
|
6818
7095
|
item,
|
|
6819
7096
|
draft: editingDraft.value,
|
|
@@ -6827,7 +7104,7 @@ var _sfc_main = {
|
|
|
6827
7104
|
const getCellContent = (item, column) => {
|
|
6828
7105
|
if (column.slot) return null;
|
|
6829
7106
|
if (column.render) return column.render(item);
|
|
6830
|
-
const value = getNestedValue(item, column.key);
|
|
7107
|
+
const value = getNestedValue$1(item, column.key);
|
|
6831
7108
|
if (value === null || value === void 0 || value === "") return "-";
|
|
6832
7109
|
return truncateText(value);
|
|
6833
7110
|
};
|
|
@@ -6852,8 +7129,8 @@ var _sfc_main = {
|
|
|
6852
7129
|
};
|
|
6853
7130
|
const getInputPlaceholder = (column) => column.placeholder || column.label || "";
|
|
6854
7131
|
const getInputValue = (item, column, index) => {
|
|
6855
|
-
if (isEditingRow(item, index)) return getNestedValue(editingDraft.value, column.key) ?? "";
|
|
6856
|
-
return getNestedValue(item, column.key) ?? "";
|
|
7132
|
+
if (isEditingRow(item, index)) return getNestedValue$1(editingDraft.value, column.key) ?? "";
|
|
7133
|
+
return getNestedValue$1(item, column.key) ?? "";
|
|
6857
7134
|
};
|
|
6858
7135
|
const getColumnError = (item, column) => {
|
|
6859
7136
|
const arrayIndex = getDataIndex(item);
|
|
@@ -6866,7 +7143,7 @@ var _sfc_main = {
|
|
|
6866
7143
|
index,
|
|
6867
7144
|
isEditing: isEditingRow(item, index),
|
|
6868
7145
|
draft: editingDraft.value,
|
|
6869
|
-
rowKey: getRowKey(item, index),
|
|
7146
|
+
rowKey: getRowKey$1(item, index),
|
|
6870
7147
|
updateDraft: (field, value) => updateDraft(field, value, item),
|
|
6871
7148
|
startEdit: () => startEdit(item, index),
|
|
6872
7149
|
cancelEdit: () => cancelEdit(item, index)
|
|
@@ -6897,128 +7174,146 @@ var _sfc_main = {
|
|
|
6897
7174
|
}, 8, ["model-value", "placeholder"])], 2)) : createCommentVNode("", true), hasData.value ? (openBlock(), createElementBlock("div", {
|
|
6898
7175
|
key: 1,
|
|
6899
7176
|
class: normalizeClass(["overflow-x-auto", __props.isCard ? __props.search ? "" : "rounded-t-xl" : ""])
|
|
6900
|
-
}, [createElementVNode("table", { class: normalizeClass(joinClasses("min-w-full divide-y divide-neutral-200 dark:divide-neutral-800", __props.tableClass)) }, [createElementVNode("thead", { class: normalizeClass(joinClasses("bg-neutral-50 dark:bg-neutral-900", __props.theadClass)) }, [createElementVNode("tr", { class: normalizeClass(__props.headerRowClass) }, [
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6915
|
-
|
|
6916
|
-
|
|
6917
|
-
|
|
6918
|
-
|
|
6919
|
-
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
}), 128)), hasActionsColumn.value ? (openBlock(), createElementBlock("th", {
|
|
6926
|
-
key: 0,
|
|
6927
|
-
class: normalizeClass(actionHeaderClass.value)
|
|
6928
|
-
}, toDisplayString(__props.actionsLabel), 3)) : createCommentVNode("", true)], 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(sortedData.value, (item, index) => {
|
|
6929
|
-
return openBlock(), createElementBlock(Fragment, { key: getRowKey(item, index) }, [createElementVNode("tr", { class: normalizeClass(__props.rowClasses(item, index)) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column) => {
|
|
6930
|
-
return openBlock(), createElementBlock("td", {
|
|
6931
|
-
key: column.key,
|
|
6932
|
-
class: normalizeClass(getColumnClass(column, item, index)),
|
|
7177
|
+
}, [createElementVNode("table", { class: normalizeClass(joinClasses("min-w-full divide-y divide-neutral-200 dark:divide-neutral-800", __props.tableClass)) }, [createElementVNode("thead", { class: normalizeClass(joinClasses("bg-neutral-50 dark:bg-neutral-900", __props.theadClass)) }, [createElementVNode("tr", { class: normalizeClass(__props.headerRowClass) }, [
|
|
7178
|
+
__props.orderable ? (openBlock(), createElementBlock("th", _hoisted_1$2, "#")) : createCommentVNode("", true),
|
|
7179
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column) => {
|
|
7180
|
+
return openBlock(), createElementBlock(Fragment, { key: column.key }, [column.sortable ? (openBlock(), createBlock(_sfc_main$3, {
|
|
7181
|
+
key: 0,
|
|
7182
|
+
field: column.key,
|
|
7183
|
+
"current-sort-field": localSortField.value,
|
|
7184
|
+
"current-direction": localSortDirection.value,
|
|
7185
|
+
"header-class": getHeaderClass(column),
|
|
7186
|
+
"header-style": getColumnWidthStyle(column),
|
|
7187
|
+
"content-class": getContentClass(column),
|
|
7188
|
+
onSort: sortBy
|
|
7189
|
+
}, {
|
|
7190
|
+
default: withCtx(() => [createTextVNode(toDisplayString(column.label), 1)]),
|
|
7191
|
+
_: 2
|
|
7192
|
+
}, 1032, [
|
|
7193
|
+
"field",
|
|
7194
|
+
"current-sort-field",
|
|
7195
|
+
"current-direction",
|
|
7196
|
+
"header-class",
|
|
7197
|
+
"header-style",
|
|
7198
|
+
"content-class"
|
|
7199
|
+
])) : (openBlock(), createElementBlock("th", {
|
|
7200
|
+
key: 1,
|
|
7201
|
+
class: normalizeClass(getHeaderClass(column)),
|
|
6933
7202
|
style: normalizeStyle(getColumnWidthStyle(column))
|
|
6934
|
-
}, [createElementVNode("div", { class: normalizeClass(getContentClass(column)) },
|
|
7203
|
+
}, [createElementVNode("div", { class: normalizeClass(getContentClass(column)) }, toDisplayString(column.label), 3)], 6))], 64);
|
|
7204
|
+
}), 128)),
|
|
7205
|
+
hasActionsColumn.value ? (openBlock(), createElementBlock("th", {
|
|
7206
|
+
key: 1,
|
|
7207
|
+
class: normalizeClass(actionHeaderClass.value)
|
|
7208
|
+
}, toDisplayString(__props.actionsLabel), 3)) : createCommentVNode("", true)
|
|
7209
|
+
], 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(sortedData.value, (item, index) => {
|
|
7210
|
+
return openBlock(), createElementBlock(Fragment, { key: getRowKey$1(item, index) }, [createElementVNode("tr", {
|
|
7211
|
+
class: normalizeClass(joinClasses(__props.rowClasses(item, index), dragOverIndex.value === index ? "ring-2 ring-inset ring-neutral-400 dark:ring-neutral-500" : "")),
|
|
7212
|
+
onDragover: withModifiers(($event) => canReorder.value && (dragOverIndex.value = index), ["prevent"]),
|
|
7213
|
+
onDrop: ($event) => dropRow(index, $event)
|
|
7214
|
+
}, [
|
|
7215
|
+
__props.orderable ? (openBlock(), createElementBlock("td", _hoisted_3$1, [createElementVNode("span", _hoisted_4, [createElementVNode("span", {
|
|
7216
|
+
draggable: canReorder.value,
|
|
7217
|
+
class: "cursor-grab touch-none active:cursor-grabbing",
|
|
7218
|
+
"aria-label": `Drag row ${index + 1}`,
|
|
7219
|
+
onDragstart: ($event) => startDrag(index, $event),
|
|
7220
|
+
onDragend: endDrag
|
|
7221
|
+
}, [createVNode(unref(GripVertical), { class: "size-4" })], 40, _hoisted_5), createElementVNode("span", null, toDisplayString(index + 1), 1)])])) : createCommentVNode("", true),
|
|
7222
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column) => {
|
|
7223
|
+
return openBlock(), createElementBlock("td", {
|
|
7224
|
+
key: column.key,
|
|
7225
|
+
class: normalizeClass(getColumnClass(column, item, index)),
|
|
7226
|
+
style: normalizeStyle(getColumnWidthStyle(column))
|
|
7227
|
+
}, [createElementVNode("div", { class: normalizeClass(getContentClass(column)) }, [isEditingRow(item, index) && column.slot && unref(slots)[getEditSlotName(column)] ? renderSlot(_ctx.$slots, getEditSlotName(column), mergeProps({
|
|
7228
|
+
key: 0,
|
|
7229
|
+
ref_for: true
|
|
7230
|
+
}, getSlotBindings(item, column, index))) : isEditingRow(item, index) && column.input ? (openBlock(), createBlock(_sfc_main$16, {
|
|
7231
|
+
key: 1,
|
|
7232
|
+
type: getInputType(column),
|
|
7233
|
+
class: normalizeClass(getInputClass(column)),
|
|
7234
|
+
placeholder: getInputPlaceholder(column),
|
|
7235
|
+
"model-value": getInputValue(item, column, index),
|
|
7236
|
+
disabled: resolveColumnDisabled(column, item, index),
|
|
7237
|
+
maxlength: column.maxlength,
|
|
7238
|
+
"error-message": getColumnError(item, column),
|
|
7239
|
+
"helper-text": "",
|
|
7240
|
+
"onUpdate:modelValue": (value) => updateDraft(column.key, value, item),
|
|
7241
|
+
onBlur: (event) => updateDraft(column.key, event?.target?.value ?? getInputValue(item, column, index), item, "blur")
|
|
7242
|
+
}, null, 8, [
|
|
7243
|
+
"type",
|
|
7244
|
+
"class",
|
|
7245
|
+
"placeholder",
|
|
7246
|
+
"model-value",
|
|
7247
|
+
"disabled",
|
|
7248
|
+
"maxlength",
|
|
7249
|
+
"error-message",
|
|
7250
|
+
"onUpdate:modelValue",
|
|
7251
|
+
"onBlur"
|
|
7252
|
+
])) : column.key === "name" && !column.slot ? (openBlock(), createElementBlock("div", _hoisted_6, [createElementVNode("div", {
|
|
7253
|
+
class: "text-sm font-medium truncate",
|
|
7254
|
+
title: getCellContent(item, column)
|
|
7255
|
+
}, toDisplayString(getCellContent(item, column)), 9, _hoisted_7), isDeleted(item) ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(__props.deletedLabel), 1)) : createCommentVNode("", true)])) : column.slot ? renderSlot(_ctx.$slots, column.slot, mergeProps({
|
|
7256
|
+
key: 3,
|
|
7257
|
+
ref_for: true
|
|
7258
|
+
}, getSlotBindings(item, column, index))) : column.render ? (openBlock(), createElementBlock("div", {
|
|
7259
|
+
key: 4,
|
|
7260
|
+
innerHTML: column.render(item)
|
|
7261
|
+
}, null, 8, _hoisted_9)) : (openBlock(), createElementBlock("div", _hoisted_10, toDisplayString(getCellContent(item, column)), 1))], 2)], 6);
|
|
7262
|
+
}), 128)),
|
|
7263
|
+
hasActionsColumn.value ? (openBlock(), createElementBlock("td", {
|
|
7264
|
+
key: 1,
|
|
7265
|
+
class: normalizeClass(actionCellClass.value)
|
|
7266
|
+
}, [createElementVNode("div", _hoisted_11, [hasActionsSlot.value ? renderSlot(_ctx.$slots, "actions", mergeProps({
|
|
6935
7267
|
key: 0,
|
|
6936
7268
|
ref_for: true
|
|
6937
|
-
}, getSlotBindings(item,
|
|
7269
|
+
}, getSlotBindings(item, null, index))) : createCommentVNode("", true), __props.rowEditing && isEditingRow(item, index) ? (openBlock(), createBlock(_sfc_main$32, {
|
|
6938
7270
|
key: 1,
|
|
6939
|
-
type:
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
"
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
"
|
|
6951
|
-
"
|
|
6952
|
-
|
|
6953
|
-
|
|
7271
|
+
type: "button",
|
|
7272
|
+
variant: "outline",
|
|
7273
|
+
size: "icon",
|
|
7274
|
+
title: __props.cancelLabel,
|
|
7275
|
+
"aria-label": __props.cancelLabel,
|
|
7276
|
+
onClick: ($event) => cancelEdit(item, index)
|
|
7277
|
+
}, {
|
|
7278
|
+
default: withCtx(() => [createVNode(unref(CheckIcon), { class: "size-4" })]),
|
|
7279
|
+
_: 1
|
|
7280
|
+
}, 8, [
|
|
7281
|
+
"title",
|
|
7282
|
+
"aria-label",
|
|
7283
|
+
"onClick"
|
|
7284
|
+
])) : __props.rowEditing ? (openBlock(), createBlock(_sfc_main$32, {
|
|
7285
|
+
key: 2,
|
|
7286
|
+
type: "button",
|
|
7287
|
+
variant: "secondary",
|
|
7288
|
+
size: "icon",
|
|
7289
|
+
disabled: isRowEditDisabled(item, index),
|
|
7290
|
+
title: __props.editLabel,
|
|
7291
|
+
"aria-label": __props.editLabel,
|
|
7292
|
+
onClick: ($event) => startEdit(item, index)
|
|
7293
|
+
}, {
|
|
7294
|
+
default: withCtx(() => [createVNode(unref(PencilSquareIcon), { class: "size-4" })]),
|
|
7295
|
+
_: 1
|
|
7296
|
+
}, 8, [
|
|
6954
7297
|
"disabled",
|
|
6955
|
-
"
|
|
6956
|
-
"
|
|
6957
|
-
"
|
|
6958
|
-
|
|
6959
|
-
|
|
6960
|
-
class: "text-sm font-medium truncate",
|
|
6961
|
-
title: getCellContent(item, column)
|
|
6962
|
-
}, toDisplayString(getCellContent(item, column)), 9, _hoisted_2$1), isDeleted(item) ? (openBlock(), createElementBlock("span", _hoisted_3$1, toDisplayString(__props.deletedLabel), 1)) : createCommentVNode("", true)])) : column.slot ? renderSlot(_ctx.$slots, column.slot, mergeProps({
|
|
6963
|
-
key: 3,
|
|
6964
|
-
ref_for: true
|
|
6965
|
-
}, getSlotBindings(item, column, index))) : column.render ? (openBlock(), createElementBlock("div", {
|
|
6966
|
-
key: 4,
|
|
6967
|
-
innerHTML: column.render(item)
|
|
6968
|
-
}, null, 8, _hoisted_4)) : (openBlock(), createElementBlock("div", _hoisted_5, toDisplayString(getCellContent(item, column)), 1))], 2)], 6);
|
|
6969
|
-
}), 128)), hasActionsColumn.value ? (openBlock(), createElementBlock("td", {
|
|
6970
|
-
key: 0,
|
|
6971
|
-
class: normalizeClass(actionCellClass.value)
|
|
6972
|
-
}, [createElementVNode("div", _hoisted_6, [hasActionsSlot.value ? renderSlot(_ctx.$slots, "actions", mergeProps({
|
|
6973
|
-
key: 0,
|
|
6974
|
-
ref_for: true
|
|
6975
|
-
}, getSlotBindings(item, null, index))) : createCommentVNode("", true), __props.rowEditing && isEditingRow(item, index) ? (openBlock(), createBlock(_sfc_main$32, {
|
|
6976
|
-
key: 1,
|
|
6977
|
-
type: "button",
|
|
6978
|
-
variant: "outline",
|
|
6979
|
-
size: "icon",
|
|
6980
|
-
title: __props.cancelLabel,
|
|
6981
|
-
"aria-label": __props.cancelLabel,
|
|
6982
|
-
onClick: ($event) => cancelEdit(item, index)
|
|
6983
|
-
}, {
|
|
6984
|
-
default: withCtx(() => [createVNode(unref(CheckIcon), { class: "size-4" })]),
|
|
6985
|
-
_: 1
|
|
6986
|
-
}, 8, [
|
|
6987
|
-
"title",
|
|
6988
|
-
"aria-label",
|
|
6989
|
-
"onClick"
|
|
6990
|
-
])) : __props.rowEditing ? (openBlock(), createBlock(_sfc_main$32, {
|
|
6991
|
-
key: 2,
|
|
6992
|
-
type: "button",
|
|
6993
|
-
variant: "secondary",
|
|
6994
|
-
size: "icon",
|
|
6995
|
-
disabled: isRowEditDisabled(item, index),
|
|
6996
|
-
title: __props.editLabel,
|
|
6997
|
-
"aria-label": __props.editLabel,
|
|
6998
|
-
onClick: ($event) => startEdit(item, index)
|
|
6999
|
-
}, {
|
|
7000
|
-
default: withCtx(() => [createVNode(unref(PencilSquareIcon), { class: "size-4" })]),
|
|
7001
|
-
_: 1
|
|
7002
|
-
}, 8, [
|
|
7003
|
-
"disabled",
|
|
7004
|
-
"title",
|
|
7005
|
-
"aria-label",
|
|
7006
|
-
"onClick"
|
|
7007
|
-
])) : createCommentVNode("", true)])], 2)) : createCommentVNode("", true)], 2), hasExpandedRow.value && __props.expandedRowKey === getRowKey(item, index) ? (openBlock(), createElementBlock("tr", {
|
|
7298
|
+
"title",
|
|
7299
|
+
"aria-label",
|
|
7300
|
+
"onClick"
|
|
7301
|
+
])) : createCommentVNode("", true)])], 2)) : createCommentVNode("", true)
|
|
7302
|
+
], 42, _hoisted_2$1), hasExpandedRow.value && __props.expandedRowKey === getRowKey$1(item, index) ? (openBlock(), createElementBlock("tr", {
|
|
7008
7303
|
key: 0,
|
|
7009
7304
|
class: normalizeClass(__props.expandedRowClass)
|
|
7010
7305
|
}, [createElementVNode("td", {
|
|
7011
|
-
colspan: __props.columns.length + (hasActionsColumn.value ? 1 : 0),
|
|
7306
|
+
colspan: __props.columns.length + (hasActionsColumn.value ? 1 : 0) + (__props.orderable ? 1 : 0),
|
|
7012
7307
|
class: normalizeClass(__props.expandedCellClass)
|
|
7013
7308
|
}, [renderSlot(_ctx.$slots, "expanded-row", {
|
|
7014
7309
|
item,
|
|
7015
7310
|
index,
|
|
7016
|
-
rowKey: getRowKey(item, index)
|
|
7017
|
-
})], 10,
|
|
7018
|
-
}), 128))], 2)], 2)], 2)) : (openBlock(), createElementBlock("div",
|
|
7019
|
-
createElementVNode("div",
|
|
7020
|
-
createElementVNode("h3",
|
|
7021
|
-
createElementVNode("p",
|
|
7311
|
+
rowKey: getRowKey$1(item, index)
|
|
7312
|
+
})], 10, _hoisted_12)], 2)) : createCommentVNode("", true)], 64);
|
|
7313
|
+
}), 128))], 2)], 2)], 2)) : (openBlock(), createElementBlock("div", _hoisted_13, [
|
|
7314
|
+
createElementVNode("div", _hoisted_14, [(openBlock(), createBlock(resolveDynamicComponent(__props.emptyState.icon), { class: "h-8 w-8 text-neutral-400 dark:text-neutral-200" }))]),
|
|
7315
|
+
createElementVNode("h3", _hoisted_15, toDisplayString(__props.emptyState.title), 1),
|
|
7316
|
+
createElementVNode("p", _hoisted_16, toDisplayString(__props.emptyState.description), 1),
|
|
7022
7317
|
__props.emptyState.actionText && __props.emptyState.actionUrl ? (openBlock(), createBlock(_sfc_main$6, {
|
|
7023
7318
|
key: 0,
|
|
7024
7319
|
href: __props.emptyState.actionUrl,
|
|
@@ -7218,4 +7513,4 @@ var plugin_default = { install(app) {
|
|
|
7218
7513
|
//#endregion
|
|
7219
7514
|
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 };
|
|
7220
7515
|
|
|
7221
|
-
//# sourceMappingURL=plugin-
|
|
7516
|
+
//# sourceMappingURL=plugin-D12jGTum.js.map
|