@knime/kds-components 13.3.0 → 13.4.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 +12 -0
- package/dist/index.css +32 -53
- package/dist/index.js +255 -199
- package/dist/index.js.map +1 -1
- package/dist/src/components/forms/inputs/PasswordInput/KdsPasswordInput.vue.d.ts +13 -0
- package/dist/src/components/forms/inputs/PasswordInput/KdsPasswordInput.vue.d.ts.map +1 -1
- package/dist/src/components/forms/inputs/PasswordInput/types.d.ts +2 -1
- package/dist/src/components/forms/inputs/PasswordInput/types.d.ts.map +1 -1
- package/dist/src/layouts/explorer/FileExplorer/FileExplorerItem.vue.d.ts +0 -13
- package/dist/src/layouts/explorer/FileExplorer/FileExplorerItem.vue.d.ts.map +1 -1
- package/dist/src/layouts/explorer/FileExplorer/FileExplorerItemBase.vue.d.ts.map +1 -1
- package/dist/src/layouts/explorer/FileExplorer/FileExplorerRenameModal.vue.d.ts +11 -0
- package/dist/src/layouts/explorer/FileExplorer/FileExplorerRenameModal.vue.d.ts.map +1 -0
- package/dist/src/layouts/explorer/FileExplorer/KdsFileExplorer.vue.d.ts +2 -8
- package/dist/src/layouts/explorer/FileExplorer/KdsFileExplorer.vue.d.ts.map +1 -1
- package/dist/src/layouts/explorer/FileExplorer/index.d.ts +1 -1
- package/dist/src/layouts/explorer/FileExplorer/index.d.ts.map +1 -1
- package/dist/src/layouts/explorer/FileExplorer/types.d.ts +19 -4
- package/dist/src/layouts/explorer/FileExplorer/types.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -4023,7 +4023,7 @@ var _hoisted_3$38 = {
|
|
|
4023
4023
|
};
|
|
4024
4024
|
var _hoisted_4$32 = { class: "label" };
|
|
4025
4025
|
var _hoisted_5$18 = ["id"];
|
|
4026
|
-
var _hoisted_6$
|
|
4026
|
+
var _hoisted_6$11 = {
|
|
4027
4027
|
key: 0,
|
|
4028
4028
|
class: "subtext-wrapper"
|
|
4029
4029
|
};
|
|
@@ -4102,7 +4102,7 @@ var BaseCheckbox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
|
|
|
4102
4102
|
key: 0,
|
|
4103
4103
|
id: unref(helperId),
|
|
4104
4104
|
class: "helper-text"
|
|
4105
|
-
}, toDisplayString(props.helperText), 9, _hoisted_5$18)) : createCommentVNode("", true)])) : createCommentVNode("", true)], 10, _hoisted_1$82)), [[unref(vKdsTooltip), props.tooltip]]), props.subText || props.preserveSubTextSpace ? (openBlock(), createElementBlock("div", _hoisted_6$
|
|
4105
|
+
}, toDisplayString(props.helperText), 9, _hoisted_5$18)) : createCommentVNode("", true)])) : createCommentVNode("", true)], 10, _hoisted_1$82)), [[unref(vKdsTooltip), props.tooltip]]), props.subText || props.preserveSubTextSpace ? (openBlock(), createElementBlock("div", _hoisted_6$11, [createVNode(KdsSubText_default, {
|
|
4106
4106
|
id: unref(descriptionId),
|
|
4107
4107
|
"sub-text": props.subText,
|
|
4108
4108
|
"preserve-sub-text-space": props.preserveSubTextSpace,
|
|
@@ -10929,7 +10929,7 @@ var _hoisted_2$49 = ["data-text"];
|
|
|
10929
10929
|
var _hoisted_3$35 = { class: "text" };
|
|
10930
10930
|
var _hoisted_4$31 = ["data-text"];
|
|
10931
10931
|
var _hoisted_5$17 = { class: "text" };
|
|
10932
|
-
var _hoisted_6$
|
|
10932
|
+
var _hoisted_6$10 = {
|
|
10933
10933
|
key: 1,
|
|
10934
10934
|
class: "error-description"
|
|
10935
10935
|
};
|
|
@@ -11013,7 +11013,7 @@ var KdsChip_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
11013
11013
|
"disabled",
|
|
11014
11014
|
"class"
|
|
11015
11015
|
])), [[unref(vKdsTooltip), errorTooltip.value]]),
|
|
11016
|
-
errorTooltip.value ? (openBlock(), createElementBlock("span", _hoisted_6$
|
|
11016
|
+
errorTooltip.value ? (openBlock(), createElementBlock("span", _hoisted_6$10, toDisplayString(errorTooltip.value), 1)) : createCommentVNode("", true),
|
|
11017
11017
|
__props.removable ? withDirectives((openBlock(), createElementBlock("button", {
|
|
11018
11018
|
key: 2,
|
|
11019
11019
|
type: "button",
|
|
@@ -11624,7 +11624,7 @@ var _hoisted_5$16 = {
|
|
|
11624
11624
|
key: 0,
|
|
11625
11625
|
class: "prefix"
|
|
11626
11626
|
};
|
|
11627
|
-
var _hoisted_6$
|
|
11627
|
+
var _hoisted_6$9 = {
|
|
11628
11628
|
key: 0,
|
|
11629
11629
|
class: "subtext"
|
|
11630
11630
|
};
|
|
@@ -11740,7 +11740,7 @@ var KdsListItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
11740
11740
|
unref(vKdsTooltip),
|
|
11741
11741
|
props.text,
|
|
11742
11742
|
"truncated"
|
|
11743
|
-
]]), props.subText ? withDirectives((openBlock(), createElementBlock("span", _hoisted_6$
|
|
11743
|
+
]]), props.subText ? withDirectives((openBlock(), createElementBlock("span", _hoisted_6$9, [createTextVNode(toDisplayString(props.subText), 1)])), [[
|
|
11744
11744
|
unref(vKdsTooltip),
|
|
11745
11745
|
props.subText,
|
|
11746
11746
|
"truncated"
|
|
@@ -13471,7 +13471,7 @@ var _hoisted_5$15 = {
|
|
|
13471
13471
|
key: 4,
|
|
13472
13472
|
class: "trailing-slot"
|
|
13473
13473
|
};
|
|
13474
|
-
var _hoisted_6$
|
|
13474
|
+
var _hoisted_6$8 = {
|
|
13475
13475
|
key: 5,
|
|
13476
13476
|
class: "icon-wrapper trailing"
|
|
13477
13477
|
};
|
|
@@ -13700,7 +13700,7 @@ focus: focusInput });
|
|
|
13700
13700
|
onClick: withModifiers(clearAndFocusInput, ["stop"])
|
|
13701
13701
|
})) : createCommentVNode("", true),
|
|
13702
13702
|
_ctx.$slots.trailing ? (openBlock(), createElementBlock("div", _hoisted_5$15, [renderSlot(_ctx.$slots, "trailing", {}, void 0, true)])) : createCommentVNode("", true),
|
|
13703
|
-
props.trailingIcon ? (openBlock(), createElementBlock("div", _hoisted_6$
|
|
13703
|
+
props.trailingIcon ? (openBlock(), createElementBlock("div", _hoisted_6$8, [createVNode(KdsIcon_default, { name: props.trailingIcon }, null, 8, ["name"])])) : createCommentVNode("", true)
|
|
13704
13704
|
], 2);
|
|
13705
13705
|
};
|
|
13706
13706
|
}
|
|
@@ -15651,7 +15651,7 @@ var _hoisted_3$22 = {
|
|
|
15651
15651
|
};
|
|
15652
15652
|
var _hoisted_4$20 = { class: "content" };
|
|
15653
15653
|
var _hoisted_5$12 = { class: "label" };
|
|
15654
|
-
var _hoisted_6$
|
|
15654
|
+
var _hoisted_6$7 = ["id"];
|
|
15655
15655
|
//#endregion
|
|
15656
15656
|
//#region src/components/forms/RadioButton/KdsRadioButton.vue
|
|
15657
15657
|
var KdsRadioButton_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
@@ -15707,7 +15707,7 @@ var KdsRadioButton_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
15707
15707
|
key: 0,
|
|
15708
15708
|
id: `${unref(id)}-helper`,
|
|
15709
15709
|
class: "helper-text"
|
|
15710
|
-
}, toDisplayString(props.helperText), 9, _hoisted_6$
|
|
15710
|
+
}, toDisplayString(props.helperText), 9, _hoisted_6$7)) : createCommentVNode("", true)])], 10, _hoisted_1$50);
|
|
15711
15711
|
};
|
|
15712
15712
|
}
|
|
15713
15713
|
}), [["__scopeId", "data-v-fdb5a895"]]);
|
|
@@ -17397,6 +17397,9 @@ var KdsColorInput_default = /* @__PURE__ */ defineComponent({
|
|
|
17397
17397
|
}
|
|
17398
17398
|
});
|
|
17399
17399
|
//#endregion
|
|
17400
|
+
//#region src/components/forms/inputs/PasswordInput/KdsPasswordInput.vue?vue&type=script&setup=true&lang.ts
|
|
17401
|
+
var STORED_VALUE_PLACEHOLDER = "••••••••••";
|
|
17402
|
+
//#endregion
|
|
17400
17403
|
//#region src/components/forms/inputs/PasswordInput/KdsPasswordInput.vue
|
|
17401
17404
|
var KdsPasswordInput_default = /* @__PURE__ */ defineComponent({
|
|
17402
17405
|
__name: "KdsPasswordInput",
|
|
@@ -17433,9 +17436,14 @@ var KdsPasswordInput_default = /* @__PURE__ */ defineComponent({
|
|
|
17433
17436
|
autocomplete: {}
|
|
17434
17437
|
}, {
|
|
17435
17438
|
"modelValue": { default: "" },
|
|
17436
|
-
"modelModifiers": {}
|
|
17439
|
+
"modelModifiers": {},
|
|
17440
|
+
"hasStoredValue": {
|
|
17441
|
+
type: Boolean,
|
|
17442
|
+
default: false
|
|
17443
|
+
},
|
|
17444
|
+
"hasStoredValueModifiers": {}
|
|
17437
17445
|
}),
|
|
17438
|
-
emits: ["update:modelValue"],
|
|
17446
|
+
emits: ["update:modelValue", "update:hasStoredValue"],
|
|
17439
17447
|
setup(__props, { expose: __expose }) {
|
|
17440
17448
|
const props = createPropsRestProxy(__props, [
|
|
17441
17449
|
"disabled",
|
|
@@ -17447,12 +17455,44 @@ var KdsPasswordInput_default = /* @__PURE__ */ defineComponent({
|
|
|
17447
17455
|
]);
|
|
17448
17456
|
/** The current password value. */
|
|
17449
17457
|
const modelValue = useModel(__props, "modelValue");
|
|
17458
|
+
/**
|
|
17459
|
+
* Whether a previously stored value exists that is not transmitted to the
|
|
17460
|
+
* frontend. It's automatically set to `false` once the user starts typing a
|
|
17461
|
+
* new value and back to `true` when they reset to the stored one.
|
|
17462
|
+
*
|
|
17463
|
+
* The reset button stays available until this is `true` again. To discard a
|
|
17464
|
+
* replaced stored value without offering the reset (e.g. when switching to a
|
|
17465
|
+
* different entity), set it to `true` before setting it to `false`, or
|
|
17466
|
+
* re-mount the component.
|
|
17467
|
+
*/
|
|
17468
|
+
const hasStoredValue = useModel(__props, "hasStoredValue");
|
|
17450
17469
|
const showValue = ref(false);
|
|
17451
|
-
const
|
|
17470
|
+
const isPressingTrailingButton = ref(false);
|
|
17471
|
+
const hasReplacedStoredValue = ref(false);
|
|
17452
17472
|
const input = useTemplateRef("input");
|
|
17453
17473
|
const effectiveToggleLabel = computed(() => props.toggleLabel ?? (__props.variant === "key" ? "Key" : "Password"));
|
|
17474
|
+
const showsStoredValue = computed(() => hasStoredValue.value && modelValue.value === "");
|
|
17475
|
+
const effectivePlaceholder = computed(() => showsStoredValue.value ? STORED_VALUE_PLACEHOLDER : props.placeholder);
|
|
17476
|
+
const canRestoreStoredValue = computed(() => hasReplacedStoredValue.value && !hasStoredValue.value);
|
|
17477
|
+
watch(hasStoredValue, (stored) => {
|
|
17478
|
+
if (stored) showValue.value = false;
|
|
17479
|
+
});
|
|
17480
|
+
const onUpdateModelValue = (value) => {
|
|
17481
|
+
if (hasStoredValue.value && value !== "") {
|
|
17482
|
+
hasStoredValue.value = false;
|
|
17483
|
+
hasReplacedStoredValue.value = true;
|
|
17484
|
+
}
|
|
17485
|
+
modelValue.value = value;
|
|
17486
|
+
};
|
|
17487
|
+
const restoreStoredValue = () => {
|
|
17488
|
+
isPressingTrailingButton.value = false;
|
|
17489
|
+
modelValue.value = "";
|
|
17490
|
+
hasStoredValue.value = true;
|
|
17491
|
+
hasReplacedStoredValue.value = false;
|
|
17492
|
+
input.value?.focus();
|
|
17493
|
+
};
|
|
17454
17494
|
const handleBlur = () => {
|
|
17455
|
-
if (
|
|
17495
|
+
if (isPressingTrailingButton.value) input.value?.focus();
|
|
17456
17496
|
};
|
|
17457
17497
|
__expose({ focus: (options) => input.value?.focus(options) });
|
|
17458
17498
|
return (_ctx, _cache) => {
|
|
@@ -17465,31 +17505,44 @@ var KdsPasswordInput_default = /* @__PURE__ */ defineComponent({
|
|
|
17465
17505
|
ref_key: "input",
|
|
17466
17506
|
ref: input
|
|
17467
17507
|
}, slotProps, {
|
|
17468
|
-
|
|
17469
|
-
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => modelValue.value = $event),
|
|
17508
|
+
"model-value": modelValue.value,
|
|
17470
17509
|
type: showValue.value && __props.showVisibilityToggle ? "text" : "password",
|
|
17471
17510
|
"leading-icon": __props.variant === "key" ? "key" : "lock",
|
|
17472
|
-
placeholder:
|
|
17511
|
+
placeholder: effectivePlaceholder.value,
|
|
17473
17512
|
disabled: __props.disabled,
|
|
17474
17513
|
error: __props.error,
|
|
17475
17514
|
autocomplete: props.autocomplete,
|
|
17476
17515
|
maxlength: props.maxlength,
|
|
17516
|
+
"onUpdate:modelValue": onUpdateModelValue,
|
|
17477
17517
|
onBlur: handleBlur
|
|
17478
17518
|
}), {
|
|
17479
|
-
trailing: withCtx(() => [__props.
|
|
17519
|
+
trailing: withCtx(() => [canRestoreStoredValue.value && !__props.disabled ? (openBlock(), createBlock(KdsButton_default, {
|
|
17480
17520
|
key: 0,
|
|
17521
|
+
variant: "outlined",
|
|
17522
|
+
size: "xsmall",
|
|
17523
|
+
"leading-icon": "undo",
|
|
17524
|
+
ariaLabel: `Reset ${effectiveToggleLabel.value}`,
|
|
17525
|
+
tooltip: `Reset ${effectiveToggleLabel.value}`,
|
|
17526
|
+
onPointerdown: _cache[0] || (_cache[0] = ($event) => isPressingTrailingButton.value = true),
|
|
17527
|
+
onPointerup: _cache[1] || (_cache[1] = ($event) => isPressingTrailingButton.value = false),
|
|
17528
|
+
onPointerleave: _cache[2] || (_cache[2] = ($event) => isPressingTrailingButton.value = false),
|
|
17529
|
+
onPointercancel: _cache[3] || (_cache[3] = ($event) => isPressingTrailingButton.value = false),
|
|
17530
|
+
onClick: withModifiers(restoreStoredValue, ["stop"])
|
|
17531
|
+
}, null, 8, ["ariaLabel", "tooltip"])) : createCommentVNode("", true), __props.showVisibilityToggle && !showsStoredValue.value ? (openBlock(), createBlock(KdsToggleButton_default, {
|
|
17532
|
+
key: 1,
|
|
17481
17533
|
modelValue: showValue.value,
|
|
17482
|
-
"onUpdate:modelValue": _cache[
|
|
17534
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => showValue.value = $event),
|
|
17483
17535
|
variant: "outlined",
|
|
17484
17536
|
size: "xsmall",
|
|
17485
17537
|
"leading-icon": "eye",
|
|
17486
17538
|
ariaLabel: showValue.value ? `Hide ${effectiveToggleLabel.value}` : `Show ${effectiveToggleLabel.value}`,
|
|
17487
17539
|
tooltip: showValue.value ? `Hide ${effectiveToggleLabel.value}` : `Show ${effectiveToggleLabel.value}`,
|
|
17488
17540
|
disabled: __props.disabled,
|
|
17489
|
-
onPointerdown: _cache[
|
|
17490
|
-
onPointerup: _cache[
|
|
17491
|
-
|
|
17492
|
-
|
|
17541
|
+
onPointerdown: _cache[5] || (_cache[5] = ($event) => isPressingTrailingButton.value = true),
|
|
17542
|
+
onPointerup: _cache[6] || (_cache[6] = ($event) => isPressingTrailingButton.value = false),
|
|
17543
|
+
onPointerleave: _cache[7] || (_cache[7] = ($event) => isPressingTrailingButton.value = false),
|
|
17544
|
+
onPointercancel: _cache[8] || (_cache[8] = ($event) => isPressingTrailingButton.value = false),
|
|
17545
|
+
onClick: _cache[9] || (_cache[9] = ($event) => isPressingTrailingButton.value = false)
|
|
17493
17546
|
}, null, 8, [
|
|
17494
17547
|
"modelValue",
|
|
17495
17548
|
"ariaLabel",
|
|
@@ -17498,7 +17551,7 @@ var KdsPasswordInput_default = /* @__PURE__ */ defineComponent({
|
|
|
17498
17551
|
])) : createCommentVNode("", true)]),
|
|
17499
17552
|
_: 1
|
|
17500
17553
|
}, 16, [
|
|
17501
|
-
"
|
|
17554
|
+
"model-value",
|
|
17502
17555
|
"type",
|
|
17503
17556
|
"leading-icon",
|
|
17504
17557
|
"placeholder",
|
|
@@ -21804,7 +21857,7 @@ var _hoisted_4$18 = {
|
|
|
21804
21857
|
"aria-live": "polite"
|
|
21805
21858
|
};
|
|
21806
21859
|
var _hoisted_5$11 = { class: "kds-date-picker-nav-block" };
|
|
21807
|
-
var _hoisted_6$
|
|
21860
|
+
var _hoisted_6$6 = { class: "kds-date-picker-body" };
|
|
21808
21861
|
var MONTHS_PER_YEAR = 12;
|
|
21809
21862
|
var YEAR_PAGE_SIZE = 15;
|
|
21810
21863
|
var REFERENCE_YEAR = 2024;
|
|
@@ -21999,7 +22052,7 @@ var KdsDatePicker_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @
|
|
|
21999
22052
|
disabled: nextYearDisabled.value,
|
|
22000
22053
|
onClick: onNextYear
|
|
22001
22054
|
}, null, 8, ["disabled"])) : createCommentVNode("", true)])
|
|
22002
|
-
]), createElementVNode("div", _hoisted_6$
|
|
22055
|
+
]), createElementVNode("div", _hoisted_6$6, [view.value === "day" ? (openBlock(), createBlock(DatePickerDayGrid_default, {
|
|
22003
22056
|
key: 0,
|
|
22004
22057
|
ref_key: "dayGridRef",
|
|
22005
22058
|
ref: dayGridRef,
|
|
@@ -23112,7 +23165,7 @@ var _hoisted_5$10 = {
|
|
|
23112
23165
|
key: 1,
|
|
23113
23166
|
class: "kds-time-picker-actions"
|
|
23114
23167
|
};
|
|
23115
|
-
var _hoisted_6$
|
|
23168
|
+
var _hoisted_6$5 = {
|
|
23116
23169
|
key: 2,
|
|
23117
23170
|
class: "kds-time-picker-actions"
|
|
23118
23171
|
};
|
|
@@ -23252,7 +23305,7 @@ var TimePicker_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
23252
23305
|
"leading-icon": "plus",
|
|
23253
23306
|
label: "Add milliseconds",
|
|
23254
23307
|
onClick: addMilliseconds
|
|
23255
|
-
})])) : createCommentVNode("", true)], 64)) : __props.maxGranularity !== "minute" ? (openBlock(), createElementBlock("div", _hoisted_6$
|
|
23308
|
+
})])) : createCommentVNode("", true)], 64)) : __props.maxGranularity !== "minute" ? (openBlock(), createElementBlock("div", _hoisted_6$5, [createVNode(KdsButton_default, {
|
|
23256
23309
|
variant: "outlined",
|
|
23257
23310
|
size: "small",
|
|
23258
23311
|
"leading-icon": "plus",
|
|
@@ -26056,7 +26109,7 @@ var _hoisted_4$12 = {
|
|
|
26056
26109
|
class: "kds-list-count"
|
|
26057
26110
|
};
|
|
26058
26111
|
var _hoisted_5$8 = { class: "kds-button-column" };
|
|
26059
|
-
var _hoisted_6$
|
|
26112
|
+
var _hoisted_6$4 = { class: "kds-list-column" };
|
|
26060
26113
|
var _hoisted_7$2 = { class: "kds-list-header" };
|
|
26061
26114
|
var _hoisted_8$2 = { class: "kds-list-label" };
|
|
26062
26115
|
var _hoisted_9$1 = {
|
|
@@ -26255,7 +26308,7 @@ var TwinListBody_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
|
|
|
26255
26308
|
onClick: _cache[5] || (_cache[5] = ($event) => moveLeft([...modelValue.value.includedValues, ...showUnknownValues.value && modelValue.value.includeUnknownValues ? [UNKNOWN_VALUE_ID] : []]))
|
|
26256
26309
|
}, null, 8, ["disabled"])
|
|
26257
26310
|
]),
|
|
26258
|
-
createElementVNode("div", _hoisted_6$
|
|
26311
|
+
createElementVNode("div", _hoisted_6$4, [createElementVNode("div", _hoisted_7$2, [createElementVNode("span", _hoisted_8$2, toDisplayString(__props.includeLabel), 1), !__props.loading && __props.searchTerm ? (openBlock(), createElementBlock("span", _hoisted_9$1, toDisplayString(rightOptions.value.length) + " of " + toDisplayString(includedItems.value.length), 1)) : createCommentVNode("", true)]), createVNode(unref(KdsMultiSelectListBox_default), {
|
|
26259
26312
|
modelValue: rightSelected.value,
|
|
26260
26313
|
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => rightSelected.value = $event),
|
|
26261
26314
|
class: "kds-list-box",
|
|
@@ -27401,7 +27454,7 @@ var _hoisted_5$7 = [
|
|
|
27401
27454
|
"stroke-dashoffset",
|
|
27402
27455
|
"transform"
|
|
27403
27456
|
];
|
|
27404
|
-
var _hoisted_6$
|
|
27457
|
+
var _hoisted_6$3 = {
|
|
27405
27458
|
key: 0,
|
|
27406
27459
|
class: "donut-text"
|
|
27407
27460
|
};
|
|
@@ -27501,7 +27554,7 @@ var KdsDonutChart_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @
|
|
|
27501
27554
|
fill: "transparent",
|
|
27502
27555
|
transform: transformWedge.value
|
|
27503
27556
|
}, null, 10, _hoisted_5$7)) : createCommentVNode("", true)
|
|
27504
|
-
], 8, _hoisted_2$15)), __props.label ? (openBlock(), createElementBlock("div", _hoisted_6$
|
|
27557
|
+
], 8, _hoisted_2$15)), __props.label ? (openBlock(), createElementBlock("div", _hoisted_6$3, [createElementVNode("div", _hoisted_7$1, toDisplayString(__props.label), 1), __props.subText ? (openBlock(), createElementBlock("div", _hoisted_8$1, toDisplayString(__props.subText), 1)) : createCommentVNode("", true)])) : createCommentVNode("", true)]);
|
|
27505
27558
|
};
|
|
27506
27559
|
}
|
|
27507
27560
|
}), [["__scopeId", "data-v-9fb87f23"]]);
|
|
@@ -28212,57 +28265,6 @@ var useFocusableMultiSelection = (options) => {
|
|
|
28212
28265
|
};
|
|
28213
28266
|
};
|
|
28214
28267
|
//#endregion
|
|
28215
|
-
//#region src/util/useKdsNameValidator.ts
|
|
28216
|
-
var INVALID_NAME_CHARACTERS = /[*?#:";<>%~|/\\]/;
|
|
28217
|
-
var NAME_CHAR_LIMIT = 255;
|
|
28218
|
-
var UNAVAILABLE_NAME_DEFAULT_MSG = "Name is already in use";
|
|
28219
|
-
/**
|
|
28220
|
-
* Validates a name for use as a file or folder name.
|
|
28221
|
-
*
|
|
28222
|
-
* A name is valid when it obeys all of these rules:
|
|
28223
|
-
* - It does not start with a dot (`.`).
|
|
28224
|
-
* - It does not end with a dot (`.`).
|
|
28225
|
-
* - It contains none of the characters `*?#:";<>%~|/\`.
|
|
28226
|
-
* - It is 255 characters long or shorter.
|
|
28227
|
-
* - It is not one of `blacklistedNames`.
|
|
28228
|
-
*
|
|
28229
|
-
* No rule requires a non-empty name. An empty name is valid. A name of only
|
|
28230
|
-
* whitespace is valid too, and gives an empty `cleanedName`. Reject these in
|
|
28231
|
-
* the caller when your use case needs a name.
|
|
28232
|
-
*
|
|
28233
|
-
* Every rule applies to the name after the leading and trailing spaces are
|
|
28234
|
-
* removed. Use `cleanedName` as the value to store.
|
|
28235
|
-
*
|
|
28236
|
-
* The messages are in English and cannot be translated. Use
|
|
28237
|
-
* `unavailableNameMessage` to replace the message for a name that is already
|
|
28238
|
-
* taken.
|
|
28239
|
-
*
|
|
28240
|
-
* @param options - The name to validate and the names that are already taken.
|
|
28241
|
-
* @returns The validity, the message for the first broken rule, and the name
|
|
28242
|
-
* without the leading and trailing spaces.
|
|
28243
|
-
*/
|
|
28244
|
-
var useKdsNameValidator = (options) => {
|
|
28245
|
-
const cleanName = (value) => value.trim();
|
|
28246
|
-
const cleanedName = computed(() => cleanName(options.name.value));
|
|
28247
|
-
const startsWithDot = computed(() => cleanedName.value.startsWith("."));
|
|
28248
|
-
const endsWithDot = computed(() => cleanedName.value.endsWith("."));
|
|
28249
|
-
const isValidName = computed(() => {
|
|
28250
|
-
return !startsWithDot.value && !endsWithDot.value && !INVALID_NAME_CHARACTERS.test(cleanedName.value) && cleanedName.value.length <= NAME_CHAR_LIMIT;
|
|
28251
|
-
});
|
|
28252
|
-
const isNameAvailable = computed(() => !options.blacklistedNames.value.includes(cleanedName.value));
|
|
28253
|
-
return {
|
|
28254
|
-
isValid: computed(() => isValidName.value && isNameAvailable.value),
|
|
28255
|
-
errorMessage: computed(() => {
|
|
28256
|
-
if (startsWithDot.value) return "Name cannot start with a dot (.)";
|
|
28257
|
-
if (endsWithDot.value) return "Name cannot end with a dot (.)";
|
|
28258
|
-
if (!isValidName.value) return "Name contains invalid characters *?#:\";<>%~|/\\ or exceeds 255 characters";
|
|
28259
|
-
if (!isNameAvailable.value) return options.unavailableNameMessage || UNAVAILABLE_NAME_DEFAULT_MSG;
|
|
28260
|
-
return "";
|
|
28261
|
-
}),
|
|
28262
|
-
cleanedName
|
|
28263
|
-
};
|
|
28264
|
-
};
|
|
28265
|
-
//#endregion
|
|
28266
28268
|
//#region src/layouts/explorer/FileExplorer/FileExplorerItemBase.vue?vue&type=script&lang.ts
|
|
28267
28269
|
var FileExplorerItemBase_vue_vue_type_script_lang_default = defineComponent({
|
|
28268
28270
|
name: "FileExplorerItemBase",
|
|
@@ -28296,7 +28298,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
28296
28298
|
"aria-disabled": _ctx.disabled ? "true" : void 0
|
|
28297
28299
|
}, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_1$17);
|
|
28298
28300
|
}
|
|
28299
|
-
var FileExplorerItemBase_default = /*#__PURE__*/ _plugin_vue_export_helper_default(FileExplorerItemBase_vue_vue_type_script_lang_default, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
28301
|
+
var FileExplorerItemBase_default = /*#__PURE__*/ _plugin_vue_export_helper_default(FileExplorerItemBase_vue_vue_type_script_lang_default, [["render", _sfc_render], ["__scopeId", "data-v-25b14279"]]);
|
|
28300
28302
|
//#endregion
|
|
28301
28303
|
//#region src/layouts/explorer/FileExplorer/FileExplorerItem.vue?vue&type=script&setup=true&lang.ts
|
|
28302
28304
|
var _hoisted_1$16 = { class: "item-icon" };
|
|
@@ -28305,16 +28307,11 @@ var _hoisted_2$13 = {
|
|
|
28305
28307
|
class: "open-indicator"
|
|
28306
28308
|
};
|
|
28307
28309
|
var _hoisted_3$9 = {
|
|
28308
|
-
key: 0,
|
|
28309
28310
|
class: "inner",
|
|
28310
28311
|
"data-drag-ghost-label": ""
|
|
28311
28312
|
};
|
|
28312
|
-
var _hoisted_4$8 = {
|
|
28313
|
-
|
|
28314
|
-
class: "item-error"
|
|
28315
|
-
};
|
|
28316
|
-
var _hoisted_5$6 = { class: "inner" };
|
|
28317
|
-
var _hoisted_6$3 = {
|
|
28313
|
+
var _hoisted_4$8 = { class: "inner" };
|
|
28314
|
+
var _hoisted_5$6 = {
|
|
28318
28315
|
key: 0,
|
|
28319
28316
|
class: /*@__PURE__*/ normalizeClass(["column"])
|
|
28320
28317
|
};
|
|
@@ -28323,11 +28320,9 @@ var _hoisted_6$3 = {
|
|
|
28323
28320
|
var FileExplorerItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
28324
28321
|
__name: "FileExplorerItem",
|
|
28325
28322
|
props: {
|
|
28326
|
-
blacklistedNames: {},
|
|
28327
28323
|
item: {},
|
|
28328
28324
|
isSelected: { type: Boolean },
|
|
28329
28325
|
isDragging: { type: Boolean },
|
|
28330
|
-
isRenameActive: { type: Boolean },
|
|
28331
28326
|
disabled: { type: Boolean },
|
|
28332
28327
|
isDraggingEnabled: {
|
|
28333
28328
|
type: Boolean,
|
|
@@ -28345,88 +28340,33 @@ var FileExplorerItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/
|
|
|
28345
28340
|
"dragleave",
|
|
28346
28341
|
"dragend",
|
|
28347
28342
|
"drop",
|
|
28348
|
-
"contextmenu"
|
|
28349
|
-
"rename:submit",
|
|
28350
|
-
"rename:clear"
|
|
28343
|
+
"contextmenu"
|
|
28351
28344
|
],
|
|
28352
28345
|
setup(__props, { emit: __emit }) {
|
|
28353
28346
|
const props = __props;
|
|
28354
|
-
const { isRenameActive, blacklistedNames } = toRefs(props);
|
|
28355
28347
|
const emit = __emit;
|
|
28356
|
-
const renameInput = useTemplateRef("renameInput");
|
|
28357
|
-
const renameValue = ref("");
|
|
28358
|
-
const { isValid, errorMessage, cleanedName } = useKdsNameValidator({
|
|
28359
|
-
blacklistedNames,
|
|
28360
|
-
name: renameValue
|
|
28361
|
-
});
|
|
28362
|
-
const setupRenameInput = async () => {
|
|
28363
|
-
renameValue.value = props.item.name;
|
|
28364
|
-
await nextTick();
|
|
28365
|
-
const inputElement = renameInput.value?.$el.querySelector("input");
|
|
28366
|
-
if (inputElement) {
|
|
28367
|
-
inputElement?.setSelectionRange(0, renameValue.value.length);
|
|
28368
|
-
inputElement?.focus();
|
|
28369
|
-
}
|
|
28370
|
-
};
|
|
28371
|
-
watch(isRenameActive, async (isActive) => {
|
|
28372
|
-
if (isActive) await setupRenameInput();
|
|
28373
|
-
});
|
|
28374
|
-
const baseItem = ref();
|
|
28375
|
-
const focusItem = async () => {
|
|
28376
|
-
await nextTick();
|
|
28377
|
-
baseItem.value?.$el.focus();
|
|
28378
|
-
};
|
|
28379
|
-
const doRename = () => {
|
|
28380
|
-
if (!isValid.value) return;
|
|
28381
|
-
const newName = cleanedName.value;
|
|
28382
|
-
const isSameName = newName === props.item.name;
|
|
28383
|
-
if (newName === "" || isSameName) {
|
|
28384
|
-
emit("rename:clear");
|
|
28385
|
-
focusItem();
|
|
28386
|
-
return;
|
|
28387
|
-
}
|
|
28388
|
-
emit("rename:submit", {
|
|
28389
|
-
itemId: props.item.id,
|
|
28390
|
-
newName
|
|
28391
|
-
});
|
|
28392
|
-
emit("rename:clear");
|
|
28393
|
-
focusItem();
|
|
28394
|
-
};
|
|
28395
|
-
const onRenameSubmit = (keydownEvent) => {
|
|
28396
|
-
if (keydownEvent.key === "Escape") {
|
|
28397
|
-
emit("rename:clear");
|
|
28398
|
-
focusItem();
|
|
28399
|
-
}
|
|
28400
|
-
if (keydownEvent.key === "Enter") doRename();
|
|
28401
|
-
};
|
|
28402
|
-
const renameInputContainer = useTemplateRef("renameInputContainer");
|
|
28403
|
-
onClickOutside(renameInputContainer, () => {
|
|
28404
|
-
doRename();
|
|
28405
|
-
});
|
|
28406
28348
|
const slots = useSlots();
|
|
28407
28349
|
const dynamicColumnSlotNames = computed(() => Object.keys(slots).filter((key) => key.startsWith("dynamicColumn")));
|
|
28408
28350
|
return (_ctx, _cache) => {
|
|
28409
28351
|
return openBlock(), createBlock(FileExplorerItemBase_default, {
|
|
28410
|
-
ref_key: "baseItem",
|
|
28411
|
-
ref: baseItem,
|
|
28412
28352
|
class: normalizeClass(["file-explorer-item", {
|
|
28413
28353
|
disabled: __props.disabled,
|
|
28414
28354
|
"has-options-menu": props.hasOptionsMenu
|
|
28415
28355
|
}]),
|
|
28416
28356
|
"is-dragging": __props.isDragging,
|
|
28417
28357
|
"is-selected": __props.isSelected,
|
|
28418
|
-
draggable: __props.isDraggingEnabled
|
|
28358
|
+
draggable: __props.isDraggingEnabled,
|
|
28419
28359
|
disabled: __props.disabled,
|
|
28420
|
-
onDragstart: _cache[
|
|
28421
|
-
onDragenter: _cache[
|
|
28422
|
-
onDragover: _cache[
|
|
28423
|
-
onDragleave: _cache[
|
|
28424
|
-
onDragend: _cache[
|
|
28425
|
-
onDrag: _cache[
|
|
28426
|
-
onClick: _cache[
|
|
28427
|
-
onContextmenu: _cache[
|
|
28428
|
-
onDrop: _cache[
|
|
28429
|
-
onDblclick: _cache[
|
|
28360
|
+
onDragstart: _cache[0] || (_cache[0] = ($event) => emit("dragstart", $event)),
|
|
28361
|
+
onDragenter: _cache[1] || (_cache[1] = ($event) => emit("dragenter", $event)),
|
|
28362
|
+
onDragover: _cache[2] || (_cache[2] = ($event) => emit("dragover", $event)),
|
|
28363
|
+
onDragleave: _cache[3] || (_cache[3] = ($event) => emit("dragleave", $event)),
|
|
28364
|
+
onDragend: _cache[4] || (_cache[4] = ($event) => emit("dragend", $event)),
|
|
28365
|
+
onDrag: _cache[5] || (_cache[5] = ($event) => emit("drag", $event)),
|
|
28366
|
+
onClick: _cache[6] || (_cache[6] = ($event) => emit("click", $event)),
|
|
28367
|
+
onContextmenu: _cache[7] || (_cache[7] = withModifiers(($event) => emit("contextmenu", $event), ["prevent"])),
|
|
28368
|
+
onDrop: _cache[8] || (_cache[8] = withModifiers(($event) => emit("drop", $event), ["prevent"])),
|
|
28369
|
+
onDblclick: _cache[9] || (_cache[9] = ($event) => emit("dblclick", $event))
|
|
28430
28370
|
}, {
|
|
28431
28371
|
default: withCtx(() => [
|
|
28432
28372
|
createElementVNode("td", _hoisted_1$16, [__props.item.isOpen ? (openBlock(), createElementBlock("span", _hoisted_2$13)) : createCommentVNode("", true), createVNode(KdsIcon_default, {
|
|
@@ -28435,41 +28375,20 @@ var FileExplorerItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/
|
|
|
28435
28375
|
"data-drag-ghost-icon": ""
|
|
28436
28376
|
}, null, 8, ["name"])]),
|
|
28437
28377
|
createElementVNode("td", {
|
|
28438
|
-
class: normalizeClass(["column", {
|
|
28439
|
-
light: !__props.item.isDirectory,
|
|
28440
|
-
"rename-active": unref(isRenameActive)
|
|
28441
|
-
}]),
|
|
28378
|
+
class: normalizeClass(["column", { light: !__props.item.isDirectory }]),
|
|
28442
28379
|
"data-test-id": "item-name"
|
|
28443
|
-
}, [
|
|
28380
|
+
}, [withDirectives((openBlock(), createElementBlock("div", _hoisted_3$9, [createTextVNode(toDisplayString(__props.item.name), 1)])), [[
|
|
28444
28381
|
unref(vKdsTooltip),
|
|
28445
28382
|
__props.item.name,
|
|
28446
28383
|
"truncated"
|
|
28447
|
-
]])
|
|
28448
|
-
key: 1,
|
|
28449
|
-
ref_key: "renameInputContainer",
|
|
28450
|
-
ref: renameInputContainer,
|
|
28451
|
-
class: "rename-input-container"
|
|
28452
|
-
}, [createVNode(KdsTextInput_default, {
|
|
28453
|
-
ref_key: "renameInput",
|
|
28454
|
-
ref: renameInput,
|
|
28455
|
-
modelValue: renameValue.value,
|
|
28456
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => renameValue.value = $event),
|
|
28457
|
-
class: "rename-input",
|
|
28458
|
-
type: "text",
|
|
28459
|
-
ariaLabel: "rename input",
|
|
28460
|
-
error: !unref(isValid),
|
|
28461
|
-
onKeydown: _cache[1] || (_cache[1] = withModifiers(($event) => onRenameSubmit($event), ["stop"]))
|
|
28462
|
-
}, null, 8, ["modelValue", "error"]), !unref(isValid) ? (openBlock(), createElementBlock("div", _hoisted_4$8, [createElementVNode("span", null, toDisplayString(unref(errorMessage)), 1)])) : createCommentVNode("", true)], 512))], 2),
|
|
28384
|
+
]])], 2),
|
|
28463
28385
|
(openBlock(true), createElementBlock(Fragment, null, renderList(dynamicColumnSlotNames.value, (name) => {
|
|
28464
28386
|
return openBlock(), createElementBlock("td", {
|
|
28465
28387
|
key: `dynamicColumn-${name}`,
|
|
28466
28388
|
class: normalizeClass(["column", "dynamic-column"])
|
|
28467
|
-
}, [createElementVNode("div",
|
|
28468
|
-
isRenameActive: unref(isRenameActive),
|
|
28469
|
-
isSelected: __props.isSelected
|
|
28470
|
-
}, void 0, true)])]);
|
|
28389
|
+
}, [createElementVNode("div", _hoisted_4$8, [renderSlot(_ctx.$slots, name, { isSelected: __props.isSelected }, void 0, true)])]);
|
|
28471
28390
|
}), 128)),
|
|
28472
|
-
_ctx.$slots.optionsMenu ? (openBlock(), createElementBlock("td",
|
|
28391
|
+
_ctx.$slots.optionsMenu ? (openBlock(), createElementBlock("td", _hoisted_5$6, [renderSlot(_ctx.$slots, "optionsMenu", {}, void 0, true)])) : createCommentVNode("", true)
|
|
28473
28392
|
]),
|
|
28474
28393
|
_: 3
|
|
28475
28394
|
}, 8, [
|
|
@@ -28481,7 +28400,7 @@ var FileExplorerItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/
|
|
|
28481
28400
|
]);
|
|
28482
28401
|
};
|
|
28483
28402
|
}
|
|
28484
|
-
}), [["__scopeId", "data-v-
|
|
28403
|
+
}), [["__scopeId", "data-v-b0610241"]]);
|
|
28485
28404
|
//#endregion
|
|
28486
28405
|
//#region src/layouts/explorer/FileExplorer/FileExplorerItemBack.vue
|
|
28487
28406
|
var FileExplorerItemBack_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
@@ -28504,6 +28423,132 @@ var FileExplorerItemBack_default = /*#__PURE__*/ _plugin_vue_export_helper_defau
|
|
|
28504
28423
|
}
|
|
28505
28424
|
}), [["__scopeId", "data-v-17bcd573"]]);
|
|
28506
28425
|
//#endregion
|
|
28426
|
+
//#region src/util/useKdsNameValidator.ts
|
|
28427
|
+
var INVALID_NAME_CHARACTERS = /[*?#:";<>%~|/\\]/;
|
|
28428
|
+
var NAME_CHAR_LIMIT = 255;
|
|
28429
|
+
var UNAVAILABLE_NAME_DEFAULT_MSG = "Name is already in use";
|
|
28430
|
+
/**
|
|
28431
|
+
* Validates a name for use as a file or folder name.
|
|
28432
|
+
*
|
|
28433
|
+
* A name is valid when it obeys all of these rules:
|
|
28434
|
+
* - It does not start with a dot (`.`).
|
|
28435
|
+
* - It does not end with a dot (`.`).
|
|
28436
|
+
* - It contains none of the characters `*?#:";<>%~|/\`.
|
|
28437
|
+
* - It is 255 characters long or shorter.
|
|
28438
|
+
* - It is not one of `blacklistedNames`.
|
|
28439
|
+
*
|
|
28440
|
+
* No rule requires a non-empty name. An empty name is valid. A name of only
|
|
28441
|
+
* whitespace is valid too, and gives an empty `cleanedName`. Reject these in
|
|
28442
|
+
* the caller when your use case needs a name.
|
|
28443
|
+
*
|
|
28444
|
+
* Every rule applies to the name after the leading and trailing spaces are
|
|
28445
|
+
* removed. Use `cleanedName` as the value to store.
|
|
28446
|
+
*
|
|
28447
|
+
* The messages are in English and cannot be translated. Use
|
|
28448
|
+
* `unavailableNameMessage` to replace the message for a name that is already
|
|
28449
|
+
* taken.
|
|
28450
|
+
*
|
|
28451
|
+
* @param options - The name to validate and the names that are already taken.
|
|
28452
|
+
* @returns The validity, the message for the first broken rule, and the name
|
|
28453
|
+
* without the leading and trailing spaces.
|
|
28454
|
+
*/
|
|
28455
|
+
var useKdsNameValidator = (options) => {
|
|
28456
|
+
const cleanName = (value) => value.trim();
|
|
28457
|
+
const cleanedName = computed(() => cleanName(options.name.value));
|
|
28458
|
+
const startsWithDot = computed(() => cleanedName.value.startsWith("."));
|
|
28459
|
+
const endsWithDot = computed(() => cleanedName.value.endsWith("."));
|
|
28460
|
+
const isValidName = computed(() => {
|
|
28461
|
+
return !startsWithDot.value && !endsWithDot.value && !INVALID_NAME_CHARACTERS.test(cleanedName.value) && cleanedName.value.length <= NAME_CHAR_LIMIT;
|
|
28462
|
+
});
|
|
28463
|
+
const isNameAvailable = computed(() => !options.blacklistedNames.value.includes(cleanedName.value));
|
|
28464
|
+
return {
|
|
28465
|
+
isValid: computed(() => isValidName.value && isNameAvailable.value),
|
|
28466
|
+
errorMessage: computed(() => {
|
|
28467
|
+
if (startsWithDot.value) return "Name cannot start with a dot (.)";
|
|
28468
|
+
if (endsWithDot.value) return "Name cannot end with a dot (.)";
|
|
28469
|
+
if (!isValidName.value) return "Name contains invalid characters *?#:\";<>%~|/\\ or exceeds 255 characters";
|
|
28470
|
+
if (!isNameAvailable.value) return options.unavailableNameMessage || UNAVAILABLE_NAME_DEFAULT_MSG;
|
|
28471
|
+
return "";
|
|
28472
|
+
}),
|
|
28473
|
+
cleanedName
|
|
28474
|
+
};
|
|
28475
|
+
};
|
|
28476
|
+
//#endregion
|
|
28477
|
+
//#region src/layouts/explorer/FileExplorer/FileExplorerRenameModal.vue
|
|
28478
|
+
var FileExplorerRenameModal_default = /* @__PURE__ */ defineComponent({
|
|
28479
|
+
__name: "FileExplorerRenameModal",
|
|
28480
|
+
props: {
|
|
28481
|
+
item: {},
|
|
28482
|
+
blacklistedNames: {}
|
|
28483
|
+
},
|
|
28484
|
+
emits: ["submit", "close"],
|
|
28485
|
+
setup(__props, { emit: __emit }) {
|
|
28486
|
+
const emit = __emit;
|
|
28487
|
+
const renamedItem = ref(null);
|
|
28488
|
+
const renameValue = ref("");
|
|
28489
|
+
const { isValid, errorMessage, cleanedName } = useKdsNameValidator({
|
|
28490
|
+
blacklistedNames: toRef(() => __props.blacklistedNames),
|
|
28491
|
+
name: renameValue,
|
|
28492
|
+
unavailableNameMessage: "Filename already exists. Choose a different name."
|
|
28493
|
+
});
|
|
28494
|
+
const hasError = computed(() => Boolean(__props.item) && !isValid.value);
|
|
28495
|
+
const headline = computed(() => `Rename ${renamedItem.value?.isDirectory ? "folder" : "file"}`);
|
|
28496
|
+
watch(() => __props.item?.id, (newId) => {
|
|
28497
|
+
if (newId && __props.item) {
|
|
28498
|
+
renamedItem.value = __props.item;
|
|
28499
|
+
renameValue.value = __props.item.name;
|
|
28500
|
+
}
|
|
28501
|
+
}, { immediate: true });
|
|
28502
|
+
const doRename = () => {
|
|
28503
|
+
if (!isValid.value || !renamedItem.value) return;
|
|
28504
|
+
const newName = cleanedName.value;
|
|
28505
|
+
if (newName !== "" && newName !== renamedItem.value.name) emit("submit", {
|
|
28506
|
+
itemId: renamedItem.value.id,
|
|
28507
|
+
newName
|
|
28508
|
+
});
|
|
28509
|
+
emit("close");
|
|
28510
|
+
};
|
|
28511
|
+
const selectName = (event) => {
|
|
28512
|
+
if (event.target instanceof HTMLInputElement) event.target.select();
|
|
28513
|
+
};
|
|
28514
|
+
return (_ctx, _cache) => {
|
|
28515
|
+
return openBlock(), createBlock(KdsModal_default, {
|
|
28516
|
+
active: Boolean(__props.item),
|
|
28517
|
+
headline: headline.value,
|
|
28518
|
+
width: "small",
|
|
28519
|
+
closedby: "any",
|
|
28520
|
+
onClose: _cache[2] || (_cache[2] = ($event) => emit("close"))
|
|
28521
|
+
}, {
|
|
28522
|
+
body: withCtx(() => [createElementVNode("form", {
|
|
28523
|
+
onSubmit: withModifiers(doRename, ["prevent"]),
|
|
28524
|
+
onFocusin: selectName
|
|
28525
|
+
}, [createVNode(KdsTextInput_default, {
|
|
28526
|
+
modelValue: renameValue.value,
|
|
28527
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => renameValue.value = $event),
|
|
28528
|
+
label: "New name",
|
|
28529
|
+
autofocus: "",
|
|
28530
|
+
error: hasError.value,
|
|
28531
|
+
"sub-text": hasError.value ? unref(errorMessage) : void 0
|
|
28532
|
+
}, null, 8, [
|
|
28533
|
+
"modelValue",
|
|
28534
|
+
"error",
|
|
28535
|
+
"sub-text"
|
|
28536
|
+
])], 32)]),
|
|
28537
|
+
footer: withCtx(() => [createVNode(KdsButton_default, {
|
|
28538
|
+
label: "Cancel",
|
|
28539
|
+
variant: "transparent",
|
|
28540
|
+
onClick: _cache[1] || (_cache[1] = ($event) => emit("close"))
|
|
28541
|
+
}), createVNode(KdsButton_default, {
|
|
28542
|
+
label: "Rename",
|
|
28543
|
+
disabled: hasError.value,
|
|
28544
|
+
onClick: doRename
|
|
28545
|
+
}, null, 8, ["disabled"])]),
|
|
28546
|
+
_: 1
|
|
28547
|
+
}, 8, ["active", "headline"]);
|
|
28548
|
+
};
|
|
28549
|
+
}
|
|
28550
|
+
});
|
|
28551
|
+
//#endregion
|
|
28507
28552
|
//#region ../../node_modules/.pnpm/motion-utils@12.39.0/node_modules/motion-utils/dist/es/array.mjs
|
|
28508
28553
|
function addUniqueItem(arr, item) {
|
|
28509
28554
|
if (arr.indexOf(item) === -1) arr.push(item);
|
|
@@ -34239,7 +34284,7 @@ var KdsFileExplorer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
34239
34284
|
"renameFile"
|
|
34240
34285
|
], ["update:activeRenamedItemId"]),
|
|
34241
34286
|
setup(__props, { emit: __emit }) {
|
|
34242
|
-
useCssVars((_ctx) => ({ "
|
|
34287
|
+
useCssVars((_ctx) => ({ "v8a863fbe": itemHeight.value + "px" }));
|
|
34243
34288
|
const props = __props;
|
|
34244
34289
|
/** The id of the item currently being renamed. */
|
|
34245
34290
|
const activeRenamedItemId = useModel(__props, "activeRenamedItemId");
|
|
@@ -34306,6 +34351,11 @@ var KdsFileExplorer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
34306
34351
|
/** MULTISELECTION */
|
|
34307
34352
|
/** RENAME */
|
|
34308
34353
|
const blacklistedNames = computed(() => props.items.filter((item) => item.id !== activeRenamedItemId.value).map(({ name }) => name));
|
|
34354
|
+
const renamedItem = computed(() => props.items.find((item) => item.id === activeRenamedItemId.value) ?? null);
|
|
34355
|
+
watch(renamedItem, (item) => {
|
|
34356
|
+
if (!item) activeRenamedItemId.value = null;
|
|
34357
|
+
});
|
|
34358
|
+
const renameModal = useTemplateRef("renameModal");
|
|
34309
34359
|
/** RENAME */
|
|
34310
34360
|
/** DRAGGING */
|
|
34311
34361
|
const customPreviewContainer = useTemplateRef("customPreviewContainer");
|
|
@@ -34440,7 +34490,7 @@ var KdsFileExplorer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
34440
34490
|
});
|
|
34441
34491
|
const onItemClick = (item, event, index) => {
|
|
34442
34492
|
if (item.disabled) return;
|
|
34443
|
-
|
|
34493
|
+
handleSelectionClick(index, event);
|
|
34444
34494
|
closeContextMenu(false);
|
|
34445
34495
|
};
|
|
34446
34496
|
const openFileOrEnterFolder = (item) => {
|
|
@@ -34461,7 +34511,11 @@ var KdsFileExplorer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
34461
34511
|
};
|
|
34462
34512
|
onClickOutside(containerProps.ref, () => {
|
|
34463
34513
|
if (focusedIndex.value >= 0) resetSelection(focusedIndex.value);
|
|
34464
|
-
}, { ignore: () => [
|
|
34514
|
+
}, { ignore: () => [
|
|
34515
|
+
...resolveClickOutsideExceptions(),
|
|
34516
|
+
popover,
|
|
34517
|
+
renameModal.value?.$el
|
|
34518
|
+
] });
|
|
34465
34519
|
const hasOptionsMenu = computed(() => {
|
|
34466
34520
|
return Boolean(props.contextMenuBuilder);
|
|
34467
34521
|
});
|
|
@@ -34481,7 +34535,7 @@ var KdsFileExplorer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
34481
34535
|
"aria-label": "list of files in the current folder"
|
|
34482
34536
|
}, unref(containerProps), {
|
|
34483
34537
|
onFocus: handleFocusOnTable,
|
|
34484
|
-
onKeydown: _cache[
|
|
34538
|
+
onKeydown: _cache[9] || (_cache[9] = (...args) => unref(handleKeyboardNavigation) && unref(handleKeyboardNavigation)(...args))
|
|
34485
34539
|
}), [createElementVNode("tbody", null, [!__props.isRootFolder ? (openBlock(), createBlock(FileExplorerItemBack_default, {
|
|
34486
34540
|
key: 0,
|
|
34487
34541
|
ref_key: "itemBack",
|
|
@@ -34511,8 +34565,6 @@ var KdsFileExplorer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
34511
34565
|
item,
|
|
34512
34566
|
"is-dragging": unref(isDragging),
|
|
34513
34567
|
"is-selected": unref(isSelected)(index),
|
|
34514
|
-
"is-rename-active": item.id === activeRenamedItemId.value,
|
|
34515
|
-
"blacklisted-names": blacklistedNames.value,
|
|
34516
34568
|
"is-dragging-enabled": !__props.disableDragging,
|
|
34517
34569
|
"has-options-menu": hasOptionsMenu.value,
|
|
34518
34570
|
onDragstart: ($event) => unref(onDragStart)($event, index),
|
|
@@ -34525,9 +34577,7 @@ var KdsFileExplorer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
34525
34577
|
onContextmenu: ($event) => openContextMenuByMouse($event, item, index),
|
|
34526
34578
|
onKeydown: [withKeys(withModifiers(($event) => openContextMenuByKeyboard(item, index), ["shift", "prevent"]), ["f10"]), withKeys(withModifiers(($event) => handleEnterKey($event, item), ["prevent"]), ["enter"])],
|
|
34527
34579
|
onDrop: ($event) => unref(onDrop)($event, index),
|
|
34528
|
-
onDblclick: ($event) => openFileOrEnterFolder(item)
|
|
34529
|
-
"onRename:submit": _cache[9] || (_cache[9] = ($event) => emit("renameFile", $event)),
|
|
34530
|
-
"onRename:clear": _cache[10] || (_cache[10] = ($event) => activeRenamedItemId.value = null)
|
|
34580
|
+
onDblclick: ($event) => openFileOrEnterFolder(item)
|
|
34531
34581
|
}, createSlots({ _: 2 }, [renderList(dynamicColumnSlotNames.value, (name) => {
|
|
34532
34582
|
return {
|
|
34533
34583
|
name,
|
|
@@ -34562,8 +34612,6 @@ var KdsFileExplorer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
34562
34612
|
"item",
|
|
34563
34613
|
"is-dragging",
|
|
34564
34614
|
"is-selected",
|
|
34565
|
-
"is-rename-active",
|
|
34566
|
-
"blacklisted-names",
|
|
34567
34615
|
"is-dragging-enabled",
|
|
34568
34616
|
"has-options-menu",
|
|
34569
34617
|
"onDragstart",
|
|
@@ -34587,6 +34635,14 @@ var KdsFileExplorer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
34587
34635
|
ref_key: "customDragPreviewPlaceholder",
|
|
34588
34636
|
ref: customDragPreviewPlaceholder
|
|
34589
34637
|
}, null, 512)], true)], 512)) : createCommentVNode("", true),
|
|
34638
|
+
createVNode(FileExplorerRenameModal_default, {
|
|
34639
|
+
ref_key: "renameModal",
|
|
34640
|
+
ref: renameModal,
|
|
34641
|
+
item: renamedItem.value,
|
|
34642
|
+
"blacklisted-names": blacklistedNames.value,
|
|
34643
|
+
onSubmit: _cache[10] || (_cache[10] = ($event) => emit("renameFile", $event)),
|
|
34644
|
+
onClose: _cache[11] || (_cache[11] = ($event) => activeRenamedItemId.value = null)
|
|
34645
|
+
}, null, 8, ["item", "blacklisted-names"]),
|
|
34590
34646
|
createVNode(KdsPopover_default, {
|
|
34591
34647
|
ref_key: "popover",
|
|
34592
34648
|
ref: popover,
|
|
@@ -34613,7 +34669,7 @@ var KdsFileExplorer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
34613
34669
|
]);
|
|
34614
34670
|
};
|
|
34615
34671
|
}
|
|
34616
|
-
}), [["__scopeId", "data-v-
|
|
34672
|
+
}), [["__scopeId", "data-v-1dd4e671"]]);
|
|
34617
34673
|
//#endregion
|
|
34618
34674
|
//#region src/layouts/explorer/FileExplorer/enums.ts
|
|
34619
34675
|
var kdsFileExplorerSize = {
|