@knime/kds-components 0.30.1 → 0.30.2
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/CHANGELOG.md
CHANGED
package/dist/index.css
CHANGED
|
@@ -1782,7 +1782,7 @@ html.kds-legacy {
|
|
|
1782
1782
|
cursor: pointer;
|
|
1783
1783
|
}
|
|
1784
1784
|
|
|
1785
|
-
.file-explorer[data-v-
|
|
1785
|
+
.file-explorer[data-v-da0e6dab] {
|
|
1786
1786
|
display: flex;
|
|
1787
1787
|
flex: 1 0 0%;
|
|
1788
1788
|
flex-direction: column;
|
|
@@ -1791,10 +1791,10 @@ html.kds-legacy {
|
|
|
1791
1791
|
/* needed so that the virtualization container can size the wrapper properly */
|
|
1792
1792
|
min-height: 0;
|
|
1793
1793
|
}
|
|
1794
|
-
.file-explorer-item[data-v-
|
|
1795
|
-
height: var(--
|
|
1794
|
+
.file-explorer-item[data-v-da0e6dab] {
|
|
1795
|
+
height: var(--v44ee6cb4);
|
|
1796
1796
|
}
|
|
1797
|
-
thead[data-v-
|
|
1797
|
+
thead[data-v-da0e6dab] {
|
|
1798
1798
|
/* Hide table head for better readability but keeping it for a11y reasons */
|
|
1799
1799
|
position: absolute;
|
|
1800
1800
|
|
|
@@ -1805,7 +1805,7 @@ thead[data-v-921486c1] {
|
|
|
1805
1805
|
overflow: hidden;
|
|
1806
1806
|
white-space: nowrap; /* added line */
|
|
1807
1807
|
}
|
|
1808
|
-
table[data-v-
|
|
1808
|
+
table[data-v-da0e6dab] {
|
|
1809
1809
|
height: 100%;
|
|
1810
1810
|
overflow: hidden auto;
|
|
1811
1811
|
scrollbar-gutter: stable;
|
|
@@ -1816,31 +1816,31 @@ table[data-v-921486c1] {
|
|
|
1816
1816
|
}
|
|
1817
1817
|
table,
|
|
1818
1818
|
tbody {
|
|
1819
|
-
&[data-v-
|
|
1819
|
+
&[data-v-da0e6dab] {
|
|
1820
1820
|
width: 100%;
|
|
1821
1821
|
border-spacing: 0;
|
|
1822
1822
|
}
|
|
1823
|
-
&[data-v-
|
|
1823
|
+
&[data-v-da0e6dab]:not(:has(.empty)) {
|
|
1824
1824
|
display: block;
|
|
1825
1825
|
}
|
|
1826
1826
|
}
|
|
1827
1827
|
table:focus {
|
|
1828
|
-
&[data-v-
|
|
1828
|
+
&[data-v-da0e6dab] {
|
|
1829
1829
|
outline: none;
|
|
1830
1830
|
}
|
|
1831
|
-
&.keyboard-focus[data-v-
|
|
1831
|
+
&.keyboard-focus[data-v-da0e6dab] {
|
|
1832
1832
|
outline: 2px solid var(--kds-color-focus-outline);
|
|
1833
1833
|
border-radius: var(--kds-border-radius-container-0-25x);
|
|
1834
1834
|
}
|
|
1835
1835
|
}
|
|
1836
|
-
.empty[data-v-
|
|
1836
|
+
.empty[data-v-da0e6dab] {
|
|
1837
1837
|
display: flex;
|
|
1838
1838
|
align-items: center;
|
|
1839
1839
|
justify-content: center;
|
|
1840
1840
|
padding: var(--kds-spacing-container-0-37x);
|
|
1841
1841
|
margin: var(--kds-spacing-container-4x) 0;
|
|
1842
1842
|
}
|
|
1843
|
-
.custom-preview[data-v-
|
|
1843
|
+
.custom-preview[data-v-da0e6dab] {
|
|
1844
1844
|
position: fixed;
|
|
1845
1845
|
top: 0;
|
|
1846
1846
|
left: 0;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, createPropsRestProxy, ref, watch, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, Fragment, renderList, createBlock, normalizeStyle, createCommentVNode, shallowRef, markRaw, readonly, toRef, unref, resolveDynamicComponent, mergeProps, useTemplateRef, createVNode, withCtx, renderSlot, h as h$1, useSlots, getCurrentInstance, useModel, mergeModels, onMounted, onUnmounted, nextTick, useId, withModifiers, inject, provide, resolveComponent, withKeys, watchEffect, useAttrs,
|
|
2
|
-
import { useLocalStorage, useDark, usePreferredDark, useResizeObserver, useMutationObserver, onClickOutside, useElementSize, useMousePressed,
|
|
1
|
+
import { defineComponent, createPropsRestProxy, ref, watch, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, Fragment, renderList, createBlock, normalizeStyle, createCommentVNode, shallowRef, markRaw, readonly, toRef, unref, resolveDynamicComponent, mergeProps, useTemplateRef, createVNode, withCtx, renderSlot, h as h$1, useSlots, getCurrentInstance, useModel, mergeModels, onMounted, onUnmounted, nextTick, useId, withModifiers, inject, provide, resolveComponent, withKeys, watchEffect, useAttrs, defineAsyncComponent, toRefs, useCssVars, normalizeProps, guardReactiveProps, createSlots, withDirectives, vShow, onBeforeUpdate, onBeforeUnmount, isRef, vModelText, createTextVNode } from 'vue';
|
|
2
|
+
import { useLocalStorage, useDark, usePreferredDark, useResizeObserver, useMutationObserver, onClickOutside, useVirtualList, useElementSize, useMousePressed, useTemplateRefsList } from '@vueuse/core';
|
|
3
3
|
|
|
4
4
|
import './index.css';const kdsAvatarSize = {
|
|
5
5
|
SMALL: "small",
|
|
@@ -3363,67 +3363,6 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
|
3363
3363
|
}
|
|
3364
3364
|
});
|
|
3365
3365
|
|
|
3366
|
-
function debounce(func, debounceMs, { signal, edges } = {}) {
|
|
3367
|
-
let pendingThis = undefined;
|
|
3368
|
-
let pendingArgs = null;
|
|
3369
|
-
const leading = edges != null && edges.includes('leading');
|
|
3370
|
-
const trailing = edges == null || edges.includes('trailing');
|
|
3371
|
-
const invoke = () => {
|
|
3372
|
-
if (pendingArgs !== null) {
|
|
3373
|
-
func.apply(pendingThis, pendingArgs);
|
|
3374
|
-
pendingThis = undefined;
|
|
3375
|
-
pendingArgs = null;
|
|
3376
|
-
}
|
|
3377
|
-
};
|
|
3378
|
-
const onTimerEnd = () => {
|
|
3379
|
-
if (trailing) {
|
|
3380
|
-
invoke();
|
|
3381
|
-
}
|
|
3382
|
-
cancel();
|
|
3383
|
-
};
|
|
3384
|
-
let timeoutId = null;
|
|
3385
|
-
const schedule = () => {
|
|
3386
|
-
if (timeoutId != null) {
|
|
3387
|
-
clearTimeout(timeoutId);
|
|
3388
|
-
}
|
|
3389
|
-
timeoutId = setTimeout(() => {
|
|
3390
|
-
timeoutId = null;
|
|
3391
|
-
onTimerEnd();
|
|
3392
|
-
}, debounceMs);
|
|
3393
|
-
};
|
|
3394
|
-
const cancelTimer = () => {
|
|
3395
|
-
if (timeoutId !== null) {
|
|
3396
|
-
clearTimeout(timeoutId);
|
|
3397
|
-
timeoutId = null;
|
|
3398
|
-
}
|
|
3399
|
-
};
|
|
3400
|
-
const cancel = () => {
|
|
3401
|
-
cancelTimer();
|
|
3402
|
-
pendingThis = undefined;
|
|
3403
|
-
pendingArgs = null;
|
|
3404
|
-
};
|
|
3405
|
-
const flush = () => {
|
|
3406
|
-
invoke();
|
|
3407
|
-
};
|
|
3408
|
-
const debounced = function (...args) {
|
|
3409
|
-
if (signal?.aborted) {
|
|
3410
|
-
return;
|
|
3411
|
-
}
|
|
3412
|
-
pendingThis = this;
|
|
3413
|
-
pendingArgs = args;
|
|
3414
|
-
const isFirstCall = timeoutId == null;
|
|
3415
|
-
schedule();
|
|
3416
|
-
if (leading && isFirstCall) {
|
|
3417
|
-
invoke();
|
|
3418
|
-
}
|
|
3419
|
-
};
|
|
3420
|
-
debounced.schedule = schedule;
|
|
3421
|
-
debounced.cancel = cancel;
|
|
3422
|
-
debounced.flush = flush;
|
|
3423
|
-
signal?.addEventListener('abort', cancel, { once: true });
|
|
3424
|
-
return debounced;
|
|
3425
|
-
}
|
|
3426
|
-
|
|
3427
3366
|
const isMac = () => navigator?.userAgent?.toLowerCase()?.includes("mac");
|
|
3428
3367
|
|
|
3429
3368
|
const createUnwrappedPromise = () => {
|
|
@@ -3446,139 +3385,6 @@ const getMetaOrCtrlKey = () => {
|
|
|
3446
3385
|
return isMac() ? "metaKey" : "ctrlKey";
|
|
3447
3386
|
};
|
|
3448
3387
|
|
|
3449
|
-
var B$1 = Object.defineProperty;
|
|
3450
|
-
var b$1 = (t, e, r) => e in t ? B$1(t, e, { enumerable: true, configurable: true, writable: true, value: r }) : t[e] = r;
|
|
3451
|
-
var u$1 = (t, e, r) => b$1(t, typeof e != "symbol" ? e + "" : e, r);
|
|
3452
|
-
function N$1(t) {
|
|
3453
|
-
return getCurrentScope() ? (onScopeDispose(t), true) : false;
|
|
3454
|
-
}
|
|
3455
|
-
function P$1(t) {
|
|
3456
|
-
return typeof t == "function" ? t() : unref(t);
|
|
3457
|
-
}
|
|
3458
|
-
const R$1 = typeof window < "u" && typeof document < "u";
|
|
3459
|
-
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
3460
|
-
function O$1(t) {
|
|
3461
|
-
var e;
|
|
3462
|
-
const r = P$1(t);
|
|
3463
|
-
return (e = r == null ? void 0 : r.$el) != null ? e : r;
|
|
3464
|
-
}
|
|
3465
|
-
const $$1 = R$1 ? window : void 0;
|
|
3466
|
-
function C$1() {
|
|
3467
|
-
const t = ref(false);
|
|
3468
|
-
return getCurrentInstance() && onMounted(() => {
|
|
3469
|
-
t.value = true;
|
|
3470
|
-
}), t;
|
|
3471
|
-
}
|
|
3472
|
-
function V$1(t) {
|
|
3473
|
-
const e = C$1();
|
|
3474
|
-
return computed(() => (e.value, !!t()));
|
|
3475
|
-
}
|
|
3476
|
-
function x$1(t, e, r = {}) {
|
|
3477
|
-
const { window: n = $$1, ...a } = r;
|
|
3478
|
-
let o;
|
|
3479
|
-
const l = V$1(() => n && "ResizeObserver" in n), i = () => {
|
|
3480
|
-
o && (o.disconnect(), o = void 0);
|
|
3481
|
-
}, f = computed(() => Array.isArray(t) ? t.map((p) => O$1(p)) : [O$1(t)]), c = watch(
|
|
3482
|
-
f,
|
|
3483
|
-
(p) => {
|
|
3484
|
-
if (i(), l.value && n) {
|
|
3485
|
-
o = new ResizeObserver(e);
|
|
3486
|
-
for (const d of p)
|
|
3487
|
-
d && o.observe(d, a);
|
|
3488
|
-
}
|
|
3489
|
-
},
|
|
3490
|
-
{ immediate: true, flush: "post", deep: true }
|
|
3491
|
-
), m = () => {
|
|
3492
|
-
i(), c();
|
|
3493
|
-
};
|
|
3494
|
-
return N$1(m), {
|
|
3495
|
-
isSupported: l,
|
|
3496
|
-
stop: m
|
|
3497
|
-
};
|
|
3498
|
-
}
|
|
3499
|
-
function F$1(t) {
|
|
3500
|
-
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
3501
|
-
}
|
|
3502
|
-
var G$1 = function(e) {
|
|
3503
|
-
var r = null, n, a = function(i) {
|
|
3504
|
-
return function() {
|
|
3505
|
-
r = null, e.apply(i, n);
|
|
3506
|
-
};
|
|
3507
|
-
}, o = function() {
|
|
3508
|
-
for (var i = arguments.length, f = new Array(i), c = 0; c < i; c++)
|
|
3509
|
-
f[c] = arguments[c];
|
|
3510
|
-
n = f, r === null && (r = requestAnimationFrame(a(this)));
|
|
3511
|
-
};
|
|
3512
|
-
return o.cancel = function() {
|
|
3513
|
-
cancelAnimationFrame(r), r = null;
|
|
3514
|
-
}, o;
|
|
3515
|
-
}, j$1 = G$1;
|
|
3516
|
-
const q$1 = /* @__PURE__ */ F$1(j$1), _$1 = 500, w$1 = ({
|
|
3517
|
-
sizeManager: t,
|
|
3518
|
-
buffer: e = _$1
|
|
3519
|
-
}, r = "vertical", n = null) => {
|
|
3520
|
-
const o = ref({ scrollStart: 0, scrollEnd: 0 }), l = r === "vertical", i = n ?? ref(null), f = q$1(() => {
|
|
3521
|
-
if (!i.value)
|
|
3522
|
-
return;
|
|
3523
|
-
const { scrollTop: d, scrollLeft: S, offsetHeight: y, offsetWidth: A } = i.value, g = l ? d : S, L = l ? y : A;
|
|
3524
|
-
o.value = { scrollStart: g, scrollEnd: g + L };
|
|
3525
|
-
});
|
|
3526
|
-
t.onUpdate(f), n || x$1(i, f);
|
|
3527
|
-
const c = computed(() => {
|
|
3528
|
-
const d = t.toIndex(o.value.scrollStart - e), S = Math.min(
|
|
3529
|
-
t.toIndex(o.value.scrollEnd + e) + 1,
|
|
3530
|
-
t.getNumItems()
|
|
3531
|
-
);
|
|
3532
|
-
return { startIndex: d, endIndex: S, toArray: () => Array.from({ length: S - d }, (A, g) => d + g) };
|
|
3533
|
-
}), m = computed(() => t.toOffset(c.value.startIndex)), p = computed(() => ({
|
|
3534
|
-
[`padding${l ? "Top" : "Left"}`]: `${m.value}px`,
|
|
3535
|
-
[l ? "height" : "width"]: `${t.getTotalSize()}px`,
|
|
3536
|
-
/**
|
|
3537
|
-
* Since the height of the element should not be influenced by its padding.
|
|
3538
|
-
* An alternative without box-sizing: "border-box" would be to use margins instead
|
|
3539
|
-
* paddings, but then it is no longer easily possible to absolutely position
|
|
3540
|
-
* other elements (e.g. a cell selection overlay) inside this element.
|
|
3541
|
-
*/
|
|
3542
|
-
boxSizing: "border-box"
|
|
3543
|
-
}));
|
|
3544
|
-
return {
|
|
3545
|
-
containerProps: {
|
|
3546
|
-
ref: i,
|
|
3547
|
-
onScroll: f
|
|
3548
|
-
},
|
|
3549
|
-
indices: c,
|
|
3550
|
-
scrolledAreaStyles: p
|
|
3551
|
-
};
|
|
3552
|
-
}, v$1 = (t, e) => isRef(t) && watch(() => t.value, e), H$1 = (t, e) => Math.floor(t / e);
|
|
3553
|
-
let Y$1 = class Y {
|
|
3554
|
-
constructor(e, r) {
|
|
3555
|
-
u$1(this, "numItems");
|
|
3556
|
-
u$1(this, "size");
|
|
3557
|
-
this.numItems = e, this.size = r;
|
|
3558
|
-
}
|
|
3559
|
-
getNumItems() {
|
|
3560
|
-
return unref(this.numItems);
|
|
3561
|
-
}
|
|
3562
|
-
onUpdate(e) {
|
|
3563
|
-
v$1(this.numItems, e), v$1(this.size, e);
|
|
3564
|
-
}
|
|
3565
|
-
toOffset(e) {
|
|
3566
|
-
return e * unref(this.size);
|
|
3567
|
-
}
|
|
3568
|
-
getTotalSize() {
|
|
3569
|
-
return unref(this.numItems) * unref(this.size);
|
|
3570
|
-
}
|
|
3571
|
-
toIndex(e) {
|
|
3572
|
-
return Math.max(
|
|
3573
|
-
Math.min(
|
|
3574
|
-
H$1(e, unref(this.size)),
|
|
3575
|
-
unref(this.numItems) - 1
|
|
3576
|
-
),
|
|
3577
|
-
0
|
|
3578
|
-
);
|
|
3579
|
-
}
|
|
3580
|
-
};
|
|
3581
|
-
|
|
3582
3388
|
const kdsDimensionComponentHeight12p5x = 200;
|
|
3583
3389
|
const kdsDimensionComponentHeight1p5x = 24;
|
|
3584
3390
|
const kdsDimensionComponentHeight20x = 320;
|
|
@@ -12020,7 +11826,6 @@ const _hoisted_2$q = {
|
|
|
12020
11826
|
key: 0,
|
|
12021
11827
|
class: "empty"
|
|
12022
11828
|
};
|
|
12023
|
-
const VIRTUAL_ITEM_BUFFER = 16;
|
|
12024
11829
|
const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
12025
11830
|
__name: "KdsFileExplorer",
|
|
12026
11831
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -12046,7 +11851,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
12046
11851
|
emits: /* @__PURE__ */ mergeModels(["update:selectedItemIds", "changeDirectory", "openFile", "moveItems", "dragend", "drag", "renameFile"], ["update:activeRenamedItemId"]),
|
|
12047
11852
|
setup(__props, { emit: __emit }) {
|
|
12048
11853
|
useCssVars((_ctx) => ({
|
|
12049
|
-
"
|
|
11854
|
+
"v44ee6cb4": itemHeight.value + "px"
|
|
12050
11855
|
}));
|
|
12051
11856
|
const props = __props;
|
|
12052
11857
|
const activeRenamedItemId = useModel(__props, "activeRenamedItemId");
|
|
@@ -12060,39 +11865,35 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
12060
11865
|
};
|
|
12061
11866
|
const virtualItemRefs = ref([]);
|
|
12062
11867
|
const itemBack = ref(null);
|
|
12063
|
-
const
|
|
12064
|
-
|
|
12065
|
-
computed(() => props.items.length),
|
|
12066
|
-
itemHeight.value
|
|
12067
|
-
);
|
|
12068
|
-
const {
|
|
12069
|
-
indices: virtualIndices,
|
|
12070
|
-
containerProps,
|
|
12071
|
-
scrolledAreaStyles
|
|
12072
|
-
} = w$1(
|
|
11868
|
+
const { containerProps, wrapperProps, list } = useVirtualList(
|
|
11869
|
+
computed(() => props.items),
|
|
12073
11870
|
{
|
|
12074
|
-
|
|
12075
|
-
|
|
12076
|
-
},
|
|
12077
|
-
"vertical",
|
|
12078
|
-
table
|
|
12079
|
-
);
|
|
12080
|
-
const renderedIndices = computed(() => virtualIndices.value.toArray());
|
|
12081
|
-
const renderedItems = computed(
|
|
12082
|
-
() => renderedIndices.value.map((i) => props.items[i])
|
|
11871
|
+
itemHeight: itemHeight.value
|
|
11872
|
+
}
|
|
12083
11873
|
);
|
|
12084
11874
|
const scrollIntoView = (index, behavior = "smooth") => {
|
|
12085
|
-
|
|
11875
|
+
const container = containerProps.ref.value;
|
|
11876
|
+
if (index === -1 || !container) {
|
|
12086
11877
|
return;
|
|
12087
11878
|
}
|
|
12088
|
-
const
|
|
12089
|
-
const
|
|
12090
|
-
|
|
12091
|
-
|
|
11879
|
+
const rowHeight = itemHeight.value;
|
|
11880
|
+
const peek = 0;
|
|
11881
|
+
const rowTop = index * rowHeight;
|
|
11882
|
+
const rowBottom = rowTop + rowHeight;
|
|
11883
|
+
const viewTop = container.scrollTop;
|
|
11884
|
+
const viewBottom = viewTop + container.clientHeight;
|
|
11885
|
+
const backButton = props.isRootFolder ? 0 : itemHeight.value;
|
|
11886
|
+
if (rowTop < viewTop) {
|
|
11887
|
+
container.scrollTo({
|
|
11888
|
+
top: Math.max(rowTop - peek, 0) + backButton,
|
|
12092
11889
|
behavior
|
|
12093
11890
|
});
|
|
12094
|
-
}
|
|
12095
|
-
|
|
11891
|
+
} else if (rowBottom + itemHeight.value > viewBottom) {
|
|
11892
|
+
container.scrollTo({
|
|
11893
|
+
top: rowBottom + peek - container.clientHeight + backButton,
|
|
11894
|
+
behavior
|
|
11895
|
+
});
|
|
11896
|
+
}
|
|
12096
11897
|
};
|
|
12097
11898
|
const multiSelection = useFocusableMultiSelection({
|
|
12098
11899
|
singleSelectionOnly: toRef(props, "disableMultiSelect"),
|
|
@@ -12200,6 +12001,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
12200
12001
|
}
|
|
12201
12002
|
const item = getItemElement(index);
|
|
12202
12003
|
if (item) {
|
|
12004
|
+
scrollIntoView(index, "instant");
|
|
12203
12005
|
item.focus();
|
|
12204
12006
|
} else {
|
|
12205
12007
|
scrollIntoView(index, "instant");
|
|
@@ -12212,7 +12014,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
12212
12014
|
}
|
|
12213
12015
|
};
|
|
12214
12016
|
const handleFocusOnTable = (event) => {
|
|
12215
|
-
if (
|
|
12017
|
+
if (containerProps.ref.value?.contains(event.relatedTarget)) {
|
|
12216
12018
|
return;
|
|
12217
12019
|
}
|
|
12218
12020
|
focusIndex(focusedIndex.value, false);
|
|
@@ -12223,6 +12025,9 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
12223
12025
|
});
|
|
12224
12026
|
const contextMenuAnchor = ref(null);
|
|
12225
12027
|
const closeContextMenu = (focusLastItem = true) => {
|
|
12028
|
+
if (!contextMenuAnchor.value) {
|
|
12029
|
+
return;
|
|
12030
|
+
}
|
|
12226
12031
|
contextMenuAnchor.value = null;
|
|
12227
12032
|
if (focusLastItem) {
|
|
12228
12033
|
focusIndex(focusedIndex.value, false);
|
|
@@ -12297,11 +12102,10 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
12297
12102
|
if (!anchor || !props.contextMenuBuilder) {
|
|
12298
12103
|
return [];
|
|
12299
12104
|
}
|
|
12300
|
-
|
|
12105
|
+
return props.contextMenuBuilder({
|
|
12301
12106
|
selectedItems: selectedItems.value,
|
|
12302
12107
|
anchor
|
|
12303
12108
|
});
|
|
12304
|
-
return builtItems;
|
|
12305
12109
|
});
|
|
12306
12110
|
const onItemClick = (item, event, index) => {
|
|
12307
12111
|
if (item.disabled) {
|
|
@@ -12327,7 +12131,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
12327
12131
|
openFileOrEnterFolder(item);
|
|
12328
12132
|
};
|
|
12329
12133
|
onClickOutside(
|
|
12330
|
-
|
|
12134
|
+
containerProps.ref,
|
|
12331
12135
|
() => {
|
|
12332
12136
|
if (focusedIndex.value >= 0) {
|
|
12333
12137
|
resetSelection(focusedIndex.value);
|
|
@@ -12337,7 +12141,6 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
12337
12141
|
ignore: [...props.clickOutsideExceptions, "#file-explorer-options-menu"]
|
|
12338
12142
|
}
|
|
12339
12143
|
);
|
|
12340
|
-
useResizeObserver(containerProps.ref, containerProps.onScroll);
|
|
12341
12144
|
const hasOptionsMenu = computed(() => {
|
|
12342
12145
|
return Boolean(props.contextMenuBuilder);
|
|
12343
12146
|
});
|
|
@@ -12368,9 +12171,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
12368
12171
|
ref_key: "itemBack",
|
|
12369
12172
|
ref: itemBack,
|
|
12370
12173
|
tabindex: "-1",
|
|
12371
|
-
class: normalizeClass(["file-explorer-item", {
|
|
12372
|
-
"keyboard-focus": unref(keyPressedUntilMouseClick)
|
|
12373
|
-
}]),
|
|
12174
|
+
class: normalizeClass(["file-explorer-item", { "keyboard-focus": unref(keyPressedUntilMouseClick) }]),
|
|
12374
12175
|
"is-dragging": unref(isDragging),
|
|
12375
12176
|
onDragenter: _cache[0] || (_cache[0] = ($event) => unref(onDragEnter)($event, -1, true)),
|
|
12376
12177
|
onDragleave: _cache[1] || (_cache[1] = ($event) => unref(onDragLeave)($event, -1, true)),
|
|
@@ -12380,10 +12181,8 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
12380
12181
|
onClick: _cache[4] || (_cache[4] = ($event) => changeDirectory(".."))
|
|
12381
12182
|
}, null, 8, ["class", "is-dragging", "onDragover"])) : createCommentVNode("", true)
|
|
12382
12183
|
]),
|
|
12383
|
-
createElementVNode("tbody",
|
|
12384
|
-
|
|
12385
|
-
}, [
|
|
12386
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(renderedItems.value, (item, vIndex) => {
|
|
12184
|
+
createElementVNode("tbody", normalizeProps(guardReactiveProps(unref(wrapperProps))), [
|
|
12185
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(list), ({ data: item, index }) => {
|
|
12387
12186
|
return openBlock(), createBlock(FileExplorerItem, {
|
|
12388
12187
|
key: item.id,
|
|
12389
12188
|
ref_for: true,
|
|
@@ -12394,35 +12193,28 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
12394
12193
|
disabled: item.disabled ?? false,
|
|
12395
12194
|
item,
|
|
12396
12195
|
"is-dragging": unref(isDragging),
|
|
12397
|
-
"is-selected": unref(isSelected)(
|
|
12196
|
+
"is-selected": unref(isSelected)(index),
|
|
12398
12197
|
"is-rename-active": item.id === activeRenamedItemId.value,
|
|
12399
12198
|
"blacklisted-names": blacklistedNames.value,
|
|
12400
12199
|
"is-dragging-enabled": !__props.disableDragging,
|
|
12401
12200
|
"has-options-menu": hasOptionsMenu.value,
|
|
12402
|
-
onDragstart: ($event) => unref(onDragStart)($event,
|
|
12403
|
-
onDragenter: ($event) => unref(onDragEnter)($event,
|
|
12201
|
+
onDragstart: ($event) => unref(onDragStart)($event, index),
|
|
12202
|
+
onDragenter: ($event) => unref(onDragEnter)($event, index),
|
|
12404
12203
|
onDragover: _cache[8] || (_cache[8] = ($event) => unref(onDragOver)($event)),
|
|
12405
|
-
onDragleave: ($event) => unref(onDragLeave)($event,
|
|
12204
|
+
onDragleave: ($event) => unref(onDragLeave)($event, index),
|
|
12406
12205
|
onDragend: ($event) => forwardEmit("dragend", unref(onDragEnd)($event, item)),
|
|
12407
12206
|
onDrag: ($event) => forwardEmit("drag", unref(onDrag)($event, item)),
|
|
12408
|
-
onClick: ($event) => onItemClick(item, $event,
|
|
12409
|
-
onContextmenu: ($event) => openContextMenuByMouse($event, item,
|
|
12207
|
+
onClick: ($event) => onItemClick(item, $event, index),
|
|
12208
|
+
onContextmenu: ($event) => openContextMenuByMouse($event, item, index),
|
|
12410
12209
|
onKeydown: [
|
|
12411
|
-
withKeys(withModifiers(($event) => openContextMenuByKeyboard(item,
|
|
12210
|
+
withKeys(withModifiers(($event) => openContextMenuByKeyboard(item, index), ["shift", "prevent"]), ["f10"]),
|
|
12412
12211
|
withKeys(withModifiers(($event) => handleEnterKey($event, item), ["prevent"]), ["enter"])
|
|
12413
12212
|
],
|
|
12414
|
-
onDrop: ($event) => forwardEmit("moveItems", unref(onDrop)($event,
|
|
12213
|
+
onDrop: ($event) => forwardEmit("moveItems", unref(onDrop)($event, index)),
|
|
12415
12214
|
onDblclick: ($event) => openFileOrEnterFolder(item),
|
|
12416
12215
|
"onRename:submit": _cache[9] || (_cache[9] = ($event) => emit("renameFile", $event)),
|
|
12417
12216
|
"onRename:clear": _cache[10] || (_cache[10] = ($event) => activeRenamedItemId.value = null)
|
|
12418
12217
|
}, createSlots({ _: 2 }, [
|
|
12419
|
-
_ctx.$slots.itemIcon ? {
|
|
12420
|
-
name: "icon",
|
|
12421
|
-
fn: withCtx(() => [
|
|
12422
|
-
renderSlot(_ctx.$slots, "itemIcon", { item }, void 0, true)
|
|
12423
|
-
]),
|
|
12424
|
-
key: "0"
|
|
12425
|
-
} : void 0,
|
|
12426
12218
|
renderList(dynamicColumnSlotNames.value, (name) => {
|
|
12427
12219
|
return {
|
|
12428
12220
|
name,
|
|
@@ -12453,10 +12245,10 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
12453
12245
|
}, ["stop"])),
|
|
12454
12246
|
onDblclick: _cache[7] || (_cache[7] = withModifiers(() => {
|
|
12455
12247
|
}, ["stop"])),
|
|
12456
|
-
"onUpdate:modelValue": ($event) => openByOptionsMenu($event, item,
|
|
12248
|
+
"onUpdate:modelValue": ($event) => openByOptionsMenu($event, item, index)
|
|
12457
12249
|
}, null, 8, ["model-value", "size", "aria-expanded", "style", "onUpdate:modelValue"])
|
|
12458
12250
|
]),
|
|
12459
|
-
key: "
|
|
12251
|
+
key: "0"
|
|
12460
12252
|
} : void 0
|
|
12461
12253
|
]), 1032, ["class", "disabled", "item", "is-dragging", "is-selected", "is-rename-active", "blacklisted-names", "is-dragging-enabled", "has-options-menu", "onDragstart", "onDragenter", "onDragleave", "onDragend", "onDrag", "onClick", "onContextmenu", "onKeydown", "onDrop", "onDblclick"]);
|
|
12462
12254
|
}), 128)),
|
|
@@ -12467,7 +12259,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
12467
12259
|
}, __props.emptyState), null, 16, ["headline"])
|
|
12468
12260
|
])
|
|
12469
12261
|
])) : createCommentVNode("", true)
|
|
12470
|
-
],
|
|
12262
|
+
], 16),
|
|
12471
12263
|
__props.draggingAnimationMode !== "disabled" ? (openBlock(), createElementBlock("div", {
|
|
12472
12264
|
key: 0,
|
|
12473
12265
|
ref_key: "customPreviewContainer",
|
|
@@ -12512,7 +12304,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
12512
12304
|
}
|
|
12513
12305
|
});
|
|
12514
12306
|
|
|
12515
|
-
const KdsFileExplorer = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["__scopeId", "data-v-
|
|
12307
|
+
const KdsFileExplorer = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["__scopeId", "data-v-da0e6dab"]]);
|
|
12516
12308
|
|
|
12517
12309
|
const kdsFileExplorerSize = {
|
|
12518
12310
|
SMALL: "small",
|