@knime/kds-components 2.2.0 → 2.3.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/CHANGELOG.md +13 -0
- package/dist/index.css +11 -11
- package/dist/index.js +45 -24
- package/dist/index.js.map +1 -1
- package/dist/src/containers/FileExplorer/KdsFileExplorer.vue.d.ts +2 -2
- package/dist/src/containers/FileExplorer/KdsFileExplorer.vue.d.ts.map +1 -1
- package/dist/src/containers/FileExplorer/types.d.ts +1 -1
- package/dist/src/containers/FileExplorer/types.d.ts.map +1 -1
- package/dist/src/containers/FileExplorer/useItemDragging/index.d.ts +22 -14
- package/dist/src/containers/FileExplorer/useItemDragging/index.d.ts.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @knime/kds-components
|
|
2
2
|
|
|
3
|
+
## 2.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0fd468c: Adjust `KdsFileExplorer` event emission for dragend:
|
|
8
|
+
Now also emits when the drag event is cancelled or when ending outside the `KdsFileExplorer` itself
|
|
9
|
+
|
|
10
|
+
**BREAKING**: The event emission payload has changed and now has a possible `null` value for the `sourceItem` property. This will be the case when the event is cancelled, for example.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- @knime/kds-styles@2.3.0
|
|
15
|
+
|
|
3
16
|
## 2.2.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
package/dist/index.css
CHANGED
|
@@ -2121,7 +2121,7 @@ to {
|
|
|
2121
2121
|
cursor: pointer;
|
|
2122
2122
|
}
|
|
2123
2123
|
|
|
2124
|
-
.file-explorer[data-v-
|
|
2124
|
+
.file-explorer[data-v-21935d10] {
|
|
2125
2125
|
display: flex;
|
|
2126
2126
|
flex: 1 0 0%;
|
|
2127
2127
|
flex-direction: column;
|
|
@@ -2130,10 +2130,10 @@ to {
|
|
|
2130
2130
|
/* needed so that the virtualization container can size the wrapper properly */
|
|
2131
2131
|
min-height: 0;
|
|
2132
2132
|
}
|
|
2133
|
-
.file-explorer-item[data-v-
|
|
2134
|
-
height: var(--
|
|
2133
|
+
.file-explorer-item[data-v-21935d10] {
|
|
2134
|
+
height: var(--v3804660c);
|
|
2135
2135
|
}
|
|
2136
|
-
thead[data-v-
|
|
2136
|
+
thead[data-v-21935d10] {
|
|
2137
2137
|
/* Hide table head for better readability but keeping it for a11y reasons */
|
|
2138
2138
|
position: absolute;
|
|
2139
2139
|
|
|
@@ -2144,7 +2144,7 @@ thead[data-v-0e28cb55] {
|
|
|
2144
2144
|
overflow: hidden;
|
|
2145
2145
|
white-space: nowrap; /* added line */
|
|
2146
2146
|
}
|
|
2147
|
-
table[data-v-
|
|
2147
|
+
table[data-v-21935d10] {
|
|
2148
2148
|
height: 100%;
|
|
2149
2149
|
overflow: hidden auto;
|
|
2150
2150
|
scrollbar-gutter: stable;
|
|
@@ -2155,31 +2155,31 @@ table[data-v-0e28cb55] {
|
|
|
2155
2155
|
}
|
|
2156
2156
|
table,
|
|
2157
2157
|
tbody {
|
|
2158
|
-
&[data-v-
|
|
2158
|
+
&[data-v-21935d10] {
|
|
2159
2159
|
width: 100%;
|
|
2160
2160
|
border-spacing: 0;
|
|
2161
2161
|
}
|
|
2162
|
-
&[data-v-
|
|
2162
|
+
&[data-v-21935d10]:not(:has(.empty)) {
|
|
2163
2163
|
display: block;
|
|
2164
2164
|
}
|
|
2165
2165
|
}
|
|
2166
2166
|
table:focus {
|
|
2167
|
-
&[data-v-
|
|
2167
|
+
&[data-v-21935d10] {
|
|
2168
2168
|
outline: none;
|
|
2169
2169
|
}
|
|
2170
|
-
&.keyboard-focus[data-v-
|
|
2170
|
+
&.keyboard-focus[data-v-21935d10] {
|
|
2171
2171
|
outline: 2px solid var(--kds-color-focus-outline);
|
|
2172
2172
|
border-radius: var(--kds-border-radius-container-0-25x);
|
|
2173
2173
|
}
|
|
2174
2174
|
}
|
|
2175
|
-
.empty[data-v-
|
|
2175
|
+
.empty[data-v-21935d10] {
|
|
2176
2176
|
display: flex;
|
|
2177
2177
|
align-items: center;
|
|
2178
2178
|
justify-content: center;
|
|
2179
2179
|
padding: var(--kds-spacing-container-0-37x);
|
|
2180
2180
|
margin: var(--kds-spacing-container-4x) 0;
|
|
2181
2181
|
}
|
|
2182
|
-
.custom-preview[data-v-
|
|
2182
|
+
.custom-preview[data-v-21935d10] {
|
|
2183
2183
|
position: fixed;
|
|
2184
2184
|
top: 0;
|
|
2185
2185
|
left: 0;
|
package/dist/index.js
CHANGED
|
@@ -15366,10 +15366,12 @@ const useItemDragging = (options) => {
|
|
|
15366
15366
|
event.preventDefault();
|
|
15367
15367
|
}
|
|
15368
15368
|
};
|
|
15369
|
-
const onDrag = (event, item) =>
|
|
15370
|
-
|
|
15371
|
-
|
|
15372
|
-
|
|
15369
|
+
const onDrag = (event, item) => {
|
|
15370
|
+
options.emitter.onDrag({
|
|
15371
|
+
event: updateClientXY(event),
|
|
15372
|
+
item
|
|
15373
|
+
});
|
|
15374
|
+
};
|
|
15373
15375
|
watch(options.draggingAnimationMode, (next, prev) => {
|
|
15374
15376
|
if (next !== prev && prev === "disabled") {
|
|
15375
15377
|
__removeGhosts?.();
|
|
@@ -15406,33 +15408,47 @@ const useItemDragging = (options) => {
|
|
|
15406
15408
|
};
|
|
15407
15409
|
if (!isGoBackItem && !isDirectory(items.value[index])) {
|
|
15408
15410
|
doRemoveGhosts(true);
|
|
15409
|
-
|
|
15411
|
+
options.emitter.onDrop(null);
|
|
15412
|
+
return;
|
|
15410
15413
|
}
|
|
15411
15414
|
const targetItem = isGoBackItem ? ".." : items.value[index].id;
|
|
15412
15415
|
const isTargetSelected = sourceItems.includes(targetItem);
|
|
15413
15416
|
if (isTargetSelected) {
|
|
15414
15417
|
doRemoveGhosts(true);
|
|
15415
|
-
|
|
15418
|
+
options.emitter.onDrop(null);
|
|
15419
|
+
return;
|
|
15416
15420
|
}
|
|
15417
15421
|
if (options.draggingAnimationMode.value === "auto") {
|
|
15418
15422
|
onComplete(true);
|
|
15419
15423
|
}
|
|
15420
|
-
|
|
15424
|
+
options.emitter.onDrop({
|
|
15421
15425
|
sourceItems,
|
|
15422
15426
|
targetItem,
|
|
15423
15427
|
onComplete
|
|
15424
|
-
};
|
|
15428
|
+
});
|
|
15425
15429
|
};
|
|
15426
15430
|
const onDragEnd = (event, item) => {
|
|
15427
15431
|
isDragging.value = false;
|
|
15428
15432
|
stopTrack();
|
|
15429
15433
|
if (event.dataTransfer?.dropEffect === "none") {
|
|
15430
15434
|
doRemoveGhosts(true);
|
|
15431
|
-
|
|
15435
|
+
options.emitter.onDragEnd({
|
|
15436
|
+
event,
|
|
15437
|
+
sourceItem: null,
|
|
15438
|
+
onComplete: () => {
|
|
15439
|
+
}
|
|
15440
|
+
});
|
|
15441
|
+
return;
|
|
15432
15442
|
}
|
|
15433
15443
|
if (hasDroppedInside.value) {
|
|
15434
15444
|
hasDroppedInside.value = false;
|
|
15435
|
-
|
|
15445
|
+
options.emitter.onDragEnd({
|
|
15446
|
+
event,
|
|
15447
|
+
sourceItem: null,
|
|
15448
|
+
onComplete: () => {
|
|
15449
|
+
}
|
|
15450
|
+
});
|
|
15451
|
+
return;
|
|
15436
15452
|
}
|
|
15437
15453
|
const onComplete = (isSuccessfulDrop) => {
|
|
15438
15454
|
if (isSuccessfulDrop) {
|
|
@@ -15443,7 +15459,7 @@ const useItemDragging = (options) => {
|
|
|
15443
15459
|
if (options.draggingAnimationMode.value === "auto") {
|
|
15444
15460
|
onComplete(true);
|
|
15445
15461
|
}
|
|
15446
|
-
|
|
15462
|
+
options.emitter.onDragEnd({ event, sourceItem: item, onComplete });
|
|
15447
15463
|
};
|
|
15448
15464
|
return {
|
|
15449
15465
|
isDragging,
|
|
@@ -15510,7 +15526,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
|
15510
15526
|
emits: /* @__PURE__ */ mergeModels(["update:selectedItemIds", "changeDirectory", "openFile", "moveItems", "dragend", "drag", "renameFile"], ["update:activeRenamedItemId"]),
|
|
15511
15527
|
setup(__props, { emit: __emit }) {
|
|
15512
15528
|
useCssVars((_ctx) => ({
|
|
15513
|
-
"
|
|
15529
|
+
"v3804660c": itemHeight.value + "px"
|
|
15514
15530
|
}));
|
|
15515
15531
|
const props = __props;
|
|
15516
15532
|
const activeRenamedItemId = useModel(__props, "activeRenamedItemId");
|
|
@@ -15631,14 +15647,19 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
|
15631
15647
|
() => !customDragPreviewPlaceholder.value && props.draggingAnimationMode !== "disabled"
|
|
15632
15648
|
),
|
|
15633
15649
|
// we then can obtain the element by using the container
|
|
15634
|
-
getCustomPreviewEl: () => document.querySelector(".custom-preview")
|
|
15635
|
-
|
|
15636
|
-
|
|
15637
|
-
|
|
15638
|
-
|
|
15650
|
+
getCustomPreviewEl: () => document.querySelector(".custom-preview"),
|
|
15651
|
+
emitter: {
|
|
15652
|
+
onDrag: (payload) => emit("drag", payload),
|
|
15653
|
+
onDrop: (payload) => {
|
|
15654
|
+
if (payload) {
|
|
15655
|
+
emit("moveItems", payload);
|
|
15656
|
+
}
|
|
15657
|
+
},
|
|
15658
|
+
onDragEnd: (payload) => {
|
|
15659
|
+
emit("dragend", payload);
|
|
15660
|
+
}
|
|
15639
15661
|
}
|
|
15640
|
-
|
|
15641
|
-
};
|
|
15662
|
+
});
|
|
15642
15663
|
const keyPressedUntilMouseClick = useKeyPressedUntilMouseClick([
|
|
15643
15664
|
"Tab",
|
|
15644
15665
|
" ",
|
|
@@ -15835,7 +15856,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
|
15835
15856
|
onDragenter: _cache[0] || (_cache[0] = ($event) => unref(onDragEnter)($event, -1, true)),
|
|
15836
15857
|
onDragleave: _cache[1] || (_cache[1] = ($event) => unref(onDragLeave)($event, -1, true)),
|
|
15837
15858
|
onDragover: unref(onDragOver),
|
|
15838
|
-
onDrop: _cache[2] || (_cache[2] = withModifiers(($event) =>
|
|
15859
|
+
onDrop: _cache[2] || (_cache[2] = withModifiers(($event) => unref(onDrop)($event, -1, true), ["prevent"])),
|
|
15839
15860
|
onKeydown: _cache[3] || (_cache[3] = withKeys(withModifiers(($event) => changeDirectory(".."), ["stop", "prevent"]), ["enter"])),
|
|
15840
15861
|
onClick: _cache[4] || (_cache[4] = ($event) => changeDirectory(".."))
|
|
15841
15862
|
}, null, 8, ["class", "is-dragging", "onDragover"])) : createCommentVNode("", true)
|
|
@@ -15861,15 +15882,15 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
|
15861
15882
|
onDragenter: ($event) => unref(onDragEnter)($event, index),
|
|
15862
15883
|
onDragover: _cache[8] || (_cache[8] = ($event) => unref(onDragOver)($event)),
|
|
15863
15884
|
onDragleave: ($event) => unref(onDragLeave)($event, index),
|
|
15864
|
-
onDragend: ($event) =>
|
|
15865
|
-
onDrag: ($event) =>
|
|
15885
|
+
onDragend: ($event) => unref(onDragEnd)($event, item),
|
|
15886
|
+
onDrag: ($event) => unref(onDrag)($event, item),
|
|
15866
15887
|
onClick: ($event) => onItemClick(item, $event, index),
|
|
15867
15888
|
onContextmenu: ($event) => openContextMenuByMouse($event, item, index),
|
|
15868
15889
|
onKeydown: [
|
|
15869
15890
|
withKeys(withModifiers(($event) => openContextMenuByKeyboard(item, index), ["shift", "prevent"]), ["f10"]),
|
|
15870
15891
|
withKeys(withModifiers(($event) => handleEnterKey($event, item), ["prevent"]), ["enter"])
|
|
15871
15892
|
],
|
|
15872
|
-
onDrop: ($event) =>
|
|
15893
|
+
onDrop: ($event) => unref(onDrop)($event, index),
|
|
15873
15894
|
onDblclick: ($event) => openFileOrEnterFolder(item),
|
|
15874
15895
|
"onRename:submit": _cache[9] || (_cache[9] = ($event) => emit("renameFile", $event)),
|
|
15875
15896
|
"onRename:clear": _cache[10] || (_cache[10] = ($event) => activeRenamedItemId.value = null)
|
|
@@ -15963,7 +15984,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
|
15963
15984
|
}
|
|
15964
15985
|
});
|
|
15965
15986
|
|
|
15966
|
-
const KdsFileExplorer = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["__scopeId", "data-v-
|
|
15987
|
+
const KdsFileExplorer = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["__scopeId", "data-v-21935d10"]]);
|
|
15967
15988
|
|
|
15968
15989
|
const kdsFileExplorerSize = {
|
|
15969
15990
|
SMALL: "small",
|