@knime/kds-components 9.0.0 → 9.1.1
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 +20 -0
- package/dist/index.css +31 -31
- package/dist/index.js +73 -44
- package/dist/index.js.map +1 -1
- package/dist/src/components/buttons/ResponsiveButtonGroup/KdsResponsiveButtonGroup.vue.d.ts.map +1 -1
- package/dist/src/components/buttons/ResponsiveButtonGroup/types.d.ts +11 -0
- package/dist/src/components/buttons/ResponsiveButtonGroup/types.d.ts.map +1 -1
- package/dist/src/layouts/explorer/FileExplorer/FileExplorerItem.vue.d.ts.map +1 -1
- package/dist/src/layouts/explorer/FileExplorer/FileExplorerItemBack.vue.d.ts.map +1 -1
- package/dist/src/layouts/explorer/FileExplorer/FileExplorerItemBase.vue.d.ts.map +1 -1
- package/dist/src/util/index.d.ts +2 -0
- package/dist/src/util/index.d.ts.map +1 -1
- package/dist/src/util/useKdsNameValidator.d.ts +41 -0
- package/dist/src/util/useKdsNameValidator.d.ts.map +1 -0
- package/package.json +4 -4
- package/dist/src/layouts/explorer/FileExplorer/useNameValidator/index.d.ts +0 -2
- package/dist/src/layouts/explorer/FileExplorer/useNameValidator/index.d.ts.map +0 -1
- package/dist/src/layouts/explorer/FileExplorer/useNameValidator/useNameValidator.d.ts +0 -13
- package/dist/src/layouts/explorer/FileExplorer/useNameValidator/useNameValidator.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @knime/kds-components
|
|
2
2
|
|
|
3
|
+
## 9.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c39035d: `KdsFileExplorer`: fix item layout that depended on the CSS build order.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @knime/kds-styles@9.1.1
|
|
10
|
+
|
|
11
|
+
## 9.1.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- 038d592: - `useKdsNameValidator`: add the composable that validates a name for use as a file or folder name. It rejects a leading or trailing dot, the characters `*?#:";<>%~|/\`, more than 255 characters, and a name that is already taken. It returns `isValid`, `errorMessage` for the first broken rule, and `cleanedName` without the leading and trailing spaces. Set the `unavailableNameMessage` option to replace the message for a name that is already taken. The messages are in English and cannot be translated. The `KdsNameValidatorOptions` and `KdsNameValidatorReturn` types are public too.
|
|
16
|
+
- 5f799e9: `KdsResponsiveButtonGroup`: added `menuActions` prop — `KdsMenuItem`s that live in the overflow menu from the start, regardless of available space. Buttons that overflow out of the row are prepended to `menuActions`, separated by a divider once both groups are non-empty.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
- @knime/kds-styles@9.1.0
|
|
22
|
+
|
|
3
23
|
## 9.0.0
|
|
4
24
|
|
|
5
25
|
### Major Changes
|
package/dist/index.css
CHANGED
|
@@ -1761,7 +1761,7 @@ body:has(dialog.modal[open]) {
|
|
|
1761
1761
|
}
|
|
1762
1762
|
}
|
|
1763
1763
|
|
|
1764
|
-
.kds-button-group-measure[data-v-
|
|
1764
|
+
.kds-button-group-measure[data-v-c2e80860] {
|
|
1765
1765
|
position: absolute;
|
|
1766
1766
|
display: flex;
|
|
1767
1767
|
visibility: hidden;
|
|
@@ -1769,20 +1769,20 @@ body:has(dialog.modal[open]) {
|
|
|
1769
1769
|
white-space: nowrap;
|
|
1770
1770
|
}
|
|
1771
1771
|
.kds-button-group {
|
|
1772
|
-
&[data-v-
|
|
1772
|
+
&[data-v-c2e80860] {
|
|
1773
1773
|
display: flex;
|
|
1774
1774
|
gap: var(--kds-spacing-container-0-5x);
|
|
1775
1775
|
align-items: center;
|
|
1776
1776
|
justify-content: flex-end;
|
|
1777
1777
|
width: 100%;
|
|
1778
1778
|
}
|
|
1779
|
-
&.left[data-v-
|
|
1779
|
+
&.left[data-v-c2e80860] {
|
|
1780
1780
|
justify-content: flex-start;
|
|
1781
1781
|
}
|
|
1782
|
-
&.right[data-v-
|
|
1782
|
+
&.right[data-v-c2e80860] {
|
|
1783
1783
|
justify-content: flex-end;
|
|
1784
1784
|
}
|
|
1785
|
-
&.middle[data-v-
|
|
1785
|
+
&.middle[data-v-c2e80860] {
|
|
1786
1786
|
justify-content: center;
|
|
1787
1787
|
}
|
|
1788
1788
|
}
|
|
@@ -4296,12 +4296,9 @@ td {
|
|
|
4296
4296
|
}
|
|
4297
4297
|
|
|
4298
4298
|
.file-explorer-item-base {
|
|
4299
|
-
&[data-v-
|
|
4299
|
+
&[data-v-861198b4] {
|
|
4300
4300
|
/* required for positioning of renaming (.item-error) */
|
|
4301
4301
|
position: relative;
|
|
4302
|
-
display: flex;
|
|
4303
|
-
flex-flow: row nowrap;
|
|
4304
|
-
align-items: center;
|
|
4305
4302
|
width: 100%;
|
|
4306
4303
|
padding: var(--kds-spacing-container-0-12x) var(--kds-spacing-container-0-5x)
|
|
4307
4304
|
var(--kds-spacing-container-0-10x);
|
|
@@ -4312,25 +4309,25 @@ td {
|
|
|
4312
4309
|
border-bottom: var(--kds-border-base-subtle);
|
|
4313
4310
|
}
|
|
4314
4311
|
&:focus {
|
|
4315
|
-
&[data-v-
|
|
4312
|
+
&[data-v-861198b4] {
|
|
4316
4313
|
outline: none;
|
|
4317
4314
|
}
|
|
4318
|
-
&.keyboard-focus[data-v-
|
|
4315
|
+
&.keyboard-focus[data-v-861198b4] {
|
|
4319
4316
|
padding: 0 var(--kds-spacing-container-0-37x);
|
|
4320
4317
|
border: var(--kds-border-action-focused);
|
|
4321
4318
|
border-radius: var(--kds-border-radius-container-0-25x);
|
|
4322
4319
|
}
|
|
4323
4320
|
}
|
|
4324
|
-
&[data-v-
|
|
4321
|
+
&[data-v-861198b4]:hover:not(.disabled) {
|
|
4325
4322
|
background: var(--kds-color-background-neutral-hover);
|
|
4326
4323
|
}
|
|
4327
4324
|
&.selected,
|
|
4328
4325
|
&.dragging {
|
|
4329
|
-
&[data-v-
|
|
4326
|
+
&[data-v-861198b4] {
|
|
4330
4327
|
color: var(--kds-color-text-and-icon-selected);
|
|
4331
4328
|
background: var(--kds-color-background-selected-initial);
|
|
4332
4329
|
}
|
|
4333
|
-
&[data-v-
|
|
4330
|
+
&[data-v-861198b4]::before {
|
|
4334
4331
|
position: absolute;
|
|
4335
4332
|
top: 50%;
|
|
4336
4333
|
left: 0;
|
|
@@ -4344,10 +4341,10 @@ td {
|
|
|
4344
4341
|
transform: translateY(-50%);
|
|
4345
4342
|
}
|
|
4346
4343
|
}
|
|
4347
|
-
&.selected[data-v-
|
|
4344
|
+
&.selected[data-v-861198b4]:hover {
|
|
4348
4345
|
background: var(--kds-color-background-selected-hover);
|
|
4349
4346
|
}
|
|
4350
|
-
&.dragging-over[data-v-
|
|
4347
|
+
&.dragging-over[data-v-861198b4] {
|
|
4351
4348
|
padding: var(--kds-spacing-container-0-10x)
|
|
4352
4349
|
calc(
|
|
4353
4350
|
var(--kds-spacing-container-0-37x) + var(--kds-spacing-container-0-10x)
|
|
@@ -4357,20 +4354,20 @@ td {
|
|
|
4357
4354
|
border-radius: var(--kds-border-radius-container-0-25x);
|
|
4358
4355
|
}
|
|
4359
4356
|
&.anything-is-dragged {
|
|
4360
|
-
& td[data-v-
|
|
4361
|
-
& td[data-v-
|
|
4357
|
+
& td[data-v-861198b4],
|
|
4358
|
+
& td[data-v-861198b4-s] {
|
|
4362
4359
|
/* Prevent children from interfering with drag events */
|
|
4363
4360
|
pointer-events: none;
|
|
4364
4361
|
}
|
|
4365
4362
|
}
|
|
4366
|
-
&.disabled[data-v-
|
|
4363
|
+
&.disabled[data-v-861198b4] {
|
|
4367
4364
|
color: var(--kds-color-text-and-icon-disabled);
|
|
4368
4365
|
pointer-events: none;
|
|
4369
4366
|
}
|
|
4370
4367
|
}
|
|
4371
4368
|
|
|
4372
4369
|
.file-explorer-item {
|
|
4373
|
-
&[data-v-
|
|
4370
|
+
&[data-v-113f6800] {
|
|
4374
4371
|
display: grid;
|
|
4375
4372
|
|
|
4376
4373
|
/* first two cols - icon + name */
|
|
@@ -4382,27 +4379,27 @@ td {
|
|
|
4382
4379
|
|
|
4383
4380
|
/* style the last column if the options menu is visible */
|
|
4384
4381
|
}
|
|
4385
|
-
&.has-options-menu > td[data-v-
|
|
4382
|
+
&.has-options-menu > td[data-v-113f6800]:last-child {
|
|
4386
4383
|
width: min-content;
|
|
4387
4384
|
}
|
|
4388
4385
|
& .column {
|
|
4389
|
-
&[data-v-
|
|
4386
|
+
&[data-v-113f6800] {
|
|
4390
4387
|
display: flex;
|
|
4391
4388
|
align-items: center;
|
|
4392
4389
|
height: 100%;
|
|
4393
4390
|
overflow: hidden;
|
|
4394
4391
|
white-space: nowrap;
|
|
4395
4392
|
}
|
|
4396
|
-
& .inner[data-v-
|
|
4393
|
+
& .inner[data-v-113f6800] {
|
|
4397
4394
|
width: 100%;
|
|
4398
4395
|
overflow: hidden;
|
|
4399
4396
|
text-overflow: ellipsis;
|
|
4400
4397
|
}
|
|
4401
|
-
&.dynamic-column[data-v-
|
|
4398
|
+
&.dynamic-column[data-v-113f6800]:empty {
|
|
4402
4399
|
display: none;
|
|
4403
4400
|
}
|
|
4404
4401
|
}
|
|
4405
|
-
& .item-error[data-v-
|
|
4402
|
+
& .item-error[data-v-113f6800] {
|
|
4406
4403
|
position: absolute;
|
|
4407
4404
|
bottom: 0;
|
|
4408
4405
|
z-index: 10;
|
|
@@ -4415,18 +4412,18 @@ td {
|
|
|
4415
4412
|
transform: translateY(100%);
|
|
4416
4413
|
}
|
|
4417
4414
|
& td.rename-active {
|
|
4418
|
-
&[data-v-
|
|
4415
|
+
&[data-v-113f6800] {
|
|
4419
4416
|
padding: 0 var(--kds-spacing-container-0-25x);
|
|
4420
4417
|
}
|
|
4421
|
-
& .rename-input-container[data-v-
|
|
4418
|
+
& .rename-input-container[data-v-113f6800] {
|
|
4422
4419
|
flex: 1;
|
|
4423
4420
|
}
|
|
4424
4421
|
}
|
|
4425
4422
|
& .item-icon {
|
|
4426
|
-
&[data-v-
|
|
4423
|
+
&[data-v-113f6800] {
|
|
4427
4424
|
position: relative;
|
|
4428
4425
|
}
|
|
4429
|
-
& .open-indicator[data-v-
|
|
4426
|
+
& .open-indicator[data-v-113f6800] {
|
|
4430
4427
|
position: absolute;
|
|
4431
4428
|
right: 0;
|
|
4432
4429
|
bottom: 0;
|
|
@@ -4438,10 +4435,13 @@ td {
|
|
|
4438
4435
|
}
|
|
4439
4436
|
}
|
|
4440
4437
|
|
|
4441
|
-
.hidden[data-v-
|
|
4438
|
+
.hidden[data-v-17bcd573] {
|
|
4442
4439
|
display: none;
|
|
4443
4440
|
}
|
|
4444
|
-
.file-explorer-item-back[data-v-
|
|
4441
|
+
.file-explorer-item-back[data-v-17bcd573] {
|
|
4442
|
+
display: flex;
|
|
4443
|
+
flex-flow: row nowrap;
|
|
4444
|
+
align-items: center;
|
|
4445
4445
|
cursor: pointer;
|
|
4446
4446
|
}
|
|
4447
4447
|
|
package/dist/index.js
CHANGED
|
@@ -13851,7 +13851,8 @@ var KdsResponsiveButtonGroup_default = /*#__PURE__*/ _plugin_vue_export_helper_d
|
|
|
13851
13851
|
__name: "KdsResponsiveButtonGroup",
|
|
13852
13852
|
props: {
|
|
13853
13853
|
buttons: {},
|
|
13854
|
-
alignment: { default: "left" }
|
|
13854
|
+
alignment: { default: "left" },
|
|
13855
|
+
menuActions: { default: () => [] }
|
|
13855
13856
|
},
|
|
13856
13857
|
setup(__props) {
|
|
13857
13858
|
const measureContainerEl = useTemplateRef("measureContainer");
|
|
@@ -13887,13 +13888,14 @@ var KdsResponsiveButtonGroup_default = /*#__PURE__*/ _plugin_vue_export_helper_d
|
|
|
13887
13888
|
inMenu: /* @__PURE__ */ new Set()
|
|
13888
13889
|
};
|
|
13889
13890
|
const gapTotal = (count) => gap.value * Math.max(0, count - 1);
|
|
13890
|
-
const
|
|
13891
|
+
const menuReserve = __props.menuActions.length > 0 ? menuButtonWidth.value + gap.value : 0;
|
|
13892
|
+
const sumFull = fullWidths.value.reduce((acc, w) => acc + (w ?? 0), 0) + gapTotal(n) + menuReserve;
|
|
13891
13893
|
if (!available || sumFull <= available) return {
|
|
13892
13894
|
mode: "full",
|
|
13893
13895
|
inMenu: /* @__PURE__ */ new Set()
|
|
13894
13896
|
};
|
|
13895
13897
|
const effectiveWidths = __props.buttons.map((entry, i) => isIconCapable(entry) ? iconOnlyWidths.value[i] ?? fullWidths.value[i] ?? 0 : fullWidths.value[i] ?? 0);
|
|
13896
|
-
if (effectiveWidths.reduce((acc, w) => acc + w, 0) + gapTotal(n) <= available) return {
|
|
13898
|
+
if (effectiveWidths.reduce((acc, w) => acc + w, 0) + gapTotal(n) + menuReserve <= available) return {
|
|
13897
13899
|
mode: "icon-only",
|
|
13898
13900
|
inMenu: /* @__PURE__ */ new Set()
|
|
13899
13901
|
};
|
|
@@ -13901,14 +13903,8 @@ var KdsResponsiveButtonGroup_default = /*#__PURE__*/ _plugin_vue_export_helper_d
|
|
|
13901
13903
|
for (let i = n - 1; i >= 0; i--) {
|
|
13902
13904
|
if (__props.buttons[i].canMoveToMenu === false) continue;
|
|
13903
13905
|
inMenu.add(i);
|
|
13904
|
-
|
|
13905
|
-
|
|
13906
|
-
for (let j = 0; j < n; j++) {
|
|
13907
|
-
if (inMenu.has(j)) continue;
|
|
13908
|
-
visibleSum += effectiveWidths[j];
|
|
13909
|
-
visibleCount++;
|
|
13910
|
-
}
|
|
13911
|
-
if (visibleSum + gapTotal(visibleCount) + menuButtonWidth.value + (visibleCount > 0 ? gap.value : 0) <= available) return {
|
|
13906
|
+
const visible = effectiveWidths.filter((_, j) => !inMenu.has(j));
|
|
13907
|
+
if (visible.reduce((acc, w) => acc + w, 0) + gapTotal(visible.length) + menuButtonWidth.value + (visible.length > 0 ? gap.value : 0) <= available) return {
|
|
13912
13908
|
mode: "partial",
|
|
13913
13909
|
inMenu
|
|
13914
13910
|
};
|
|
@@ -13936,7 +13932,15 @@ var KdsResponsiveButtonGroup_default = /*#__PURE__*/ _plugin_vue_export_helper_d
|
|
|
13936
13932
|
return result;
|
|
13937
13933
|
});
|
|
13938
13934
|
const overflowMenuItems = computed(() => {
|
|
13939
|
-
|
|
13935
|
+
const overflowed = Array.from(layout.value.inMenu).sort((a, b) => a - b).map((i) => toMenuItem(__props.buttons[i]));
|
|
13936
|
+
if (overflowed.length > 0 && __props.menuActions.length > 0) {
|
|
13937
|
+
const lastIndex = overflowed.length - 1;
|
|
13938
|
+
overflowed[lastIndex] = {
|
|
13939
|
+
...overflowed[lastIndex],
|
|
13940
|
+
separator: true
|
|
13941
|
+
};
|
|
13942
|
+
}
|
|
13943
|
+
return [...overflowed, ...__props.menuActions];
|
|
13940
13944
|
});
|
|
13941
13945
|
const refOffsetWidth = (instance) => {
|
|
13942
13946
|
if (!instance) return 0;
|
|
@@ -14012,7 +14016,7 @@ var KdsResponsiveButtonGroup_default = /*#__PURE__*/ _plugin_vue_export_helper_d
|
|
|
14012
14016
|
}, null, 8, ["items"])) : createCommentVNode("", true)], 16)], 64);
|
|
14013
14017
|
};
|
|
14014
14018
|
}
|
|
14015
|
-
}), [["__scopeId", "data-v-
|
|
14019
|
+
}), [["__scopeId", "data-v-c2e80860"]]);
|
|
14016
14020
|
//#endregion
|
|
14017
14021
|
//#region src/components/buttons/ResponsiveButtonGroup/enums.ts
|
|
14018
14022
|
var kdsResponsiveButtonGroupAlignment = {
|
|
@@ -27532,6 +27536,57 @@ var useKeyPressedUntilMouseClick = (keys = defaultKeys) => {
|
|
|
27532
27536
|
return hasUsedKeyboard;
|
|
27533
27537
|
};
|
|
27534
27538
|
//#endregion
|
|
27539
|
+
//#region src/util/useKdsNameValidator.ts
|
|
27540
|
+
var INVALID_NAME_CHARACTERS = /[*?#:";<>%~|/\\]/;
|
|
27541
|
+
var NAME_CHAR_LIMIT = 255;
|
|
27542
|
+
var UNAVAILABLE_NAME_DEFAULT_MSG = "Name is already in use";
|
|
27543
|
+
/**
|
|
27544
|
+
* Validates a name for use as a file or folder name.
|
|
27545
|
+
*
|
|
27546
|
+
* A name is valid when it obeys all of these rules:
|
|
27547
|
+
* - It does not start with a dot (`.`).
|
|
27548
|
+
* - It does not end with a dot (`.`).
|
|
27549
|
+
* - It contains none of the characters `*?#:";<>%~|/\`.
|
|
27550
|
+
* - It is 255 characters long or shorter.
|
|
27551
|
+
* - It is not one of `blacklistedNames`.
|
|
27552
|
+
*
|
|
27553
|
+
* No rule requires a non-empty name. An empty name is valid. A name of only
|
|
27554
|
+
* whitespace is valid too, and gives an empty `cleanedName`. Reject these in
|
|
27555
|
+
* the caller when your use case needs a name.
|
|
27556
|
+
*
|
|
27557
|
+
* Every rule applies to the name after the leading and trailing spaces are
|
|
27558
|
+
* removed. Use `cleanedName` as the value to store.
|
|
27559
|
+
*
|
|
27560
|
+
* The messages are in English and cannot be translated. Use
|
|
27561
|
+
* `unavailableNameMessage` to replace the message for a name that is already
|
|
27562
|
+
* taken.
|
|
27563
|
+
*
|
|
27564
|
+
* @param options - The name to validate and the names that are already taken.
|
|
27565
|
+
* @returns The validity, the message for the first broken rule, and the name
|
|
27566
|
+
* without the leading and trailing spaces.
|
|
27567
|
+
*/
|
|
27568
|
+
var useKdsNameValidator = (options) => {
|
|
27569
|
+
const cleanName = (value) => value.trim();
|
|
27570
|
+
const cleanedName = computed(() => cleanName(options.name.value));
|
|
27571
|
+
const startsWithDot = computed(() => cleanedName.value.startsWith("."));
|
|
27572
|
+
const endsWithDot = computed(() => cleanedName.value.endsWith("."));
|
|
27573
|
+
const isValidName = computed(() => {
|
|
27574
|
+
return !startsWithDot.value && !endsWithDot.value && !INVALID_NAME_CHARACTERS.test(cleanedName.value) && cleanedName.value.length <= NAME_CHAR_LIMIT;
|
|
27575
|
+
});
|
|
27576
|
+
const isNameAvailable = computed(() => !options.blacklistedNames.value.includes(cleanedName.value));
|
|
27577
|
+
return {
|
|
27578
|
+
isValid: computed(() => isValidName.value && isNameAvailable.value),
|
|
27579
|
+
errorMessage: computed(() => {
|
|
27580
|
+
if (startsWithDot.value) return "Name cannot start with a dot (.)";
|
|
27581
|
+
if (endsWithDot.value) return "Name cannot end with a dot (.)";
|
|
27582
|
+
if (!isValidName.value) return "Name contains invalid characters *?#:\";<>%~|/\\ or exceeds 255 characters";
|
|
27583
|
+
if (!isNameAvailable.value) return options.unavailableNameMessage || UNAVAILABLE_NAME_DEFAULT_MSG;
|
|
27584
|
+
return "";
|
|
27585
|
+
}),
|
|
27586
|
+
cleanedName
|
|
27587
|
+
};
|
|
27588
|
+
};
|
|
27589
|
+
//#endregion
|
|
27535
27590
|
//#region src/layouts/explorer/FileExplorer/FileExplorerItemBase.vue?vue&type=script&lang.ts
|
|
27536
27591
|
var FileExplorerItemBase_vue_vue_type_script_lang_default = defineComponent({
|
|
27537
27592
|
name: "FileExplorerItemBase",
|
|
@@ -27565,33 +27620,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
27565
27620
|
"aria-disabled": _ctx.disabled ? "true" : void 0
|
|
27566
27621
|
}, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_1$17);
|
|
27567
27622
|
}
|
|
27568
|
-
var FileExplorerItemBase_default = /*#__PURE__*/ _plugin_vue_export_helper_default(FileExplorerItemBase_vue_vue_type_script_lang_default, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
27569
|
-
//#endregion
|
|
27570
|
-
//#region src/layouts/explorer/FileExplorer/useNameValidator/useNameValidator.ts
|
|
27571
|
-
var INVALID_NAME_CHARACTERS = /[*?#:";<>%~|/\\]/;
|
|
27572
|
-
var NAME_CHAR_LIMIT = 255;
|
|
27573
|
-
var UNAVAILABLE_NAME_DEFAULT_MSG = "Name is already in use";
|
|
27574
|
-
var useNameValidator = (options) => {
|
|
27575
|
-
const cleanName = (value) => value.trim();
|
|
27576
|
-
const cleanedName = computed(() => cleanName(options.name.value));
|
|
27577
|
-
const startsWithDot = computed(() => cleanedName.value.startsWith("."));
|
|
27578
|
-
const endsWithDot = computed(() => cleanedName.value.endsWith("."));
|
|
27579
|
-
const isValidName = computed(() => {
|
|
27580
|
-
return !startsWithDot.value && !endsWithDot.value && !INVALID_NAME_CHARACTERS.test(cleanedName.value) && cleanedName.value.length <= NAME_CHAR_LIMIT;
|
|
27581
|
-
});
|
|
27582
|
-
const isNameAvailable = computed(() => !options.blacklistedNames.value.includes(cleanedName.value));
|
|
27583
|
-
return {
|
|
27584
|
-
isValid: computed(() => isValidName.value && isNameAvailable.value),
|
|
27585
|
-
errorMessage: computed(() => {
|
|
27586
|
-
if (startsWithDot.value) return "Name cannot start with a dot (.)";
|
|
27587
|
-
if (endsWithDot.value) return "Name cannot end with a dot (.)";
|
|
27588
|
-
if (!isValidName.value) return "Name contains invalid characters *?#:\";<>%~|/\\ or exceeds 255 characters";
|
|
27589
|
-
if (!isNameAvailable.value) return options.unavailableNameMessage || UNAVAILABLE_NAME_DEFAULT_MSG;
|
|
27590
|
-
return "";
|
|
27591
|
-
}),
|
|
27592
|
-
cleanedName
|
|
27593
|
-
};
|
|
27594
|
-
};
|
|
27623
|
+
var FileExplorerItemBase_default = /*#__PURE__*/ _plugin_vue_export_helper_default(FileExplorerItemBase_vue_vue_type_script_lang_default, [["render", _sfc_render], ["__scopeId", "data-v-861198b4"]]);
|
|
27595
27624
|
//#endregion
|
|
27596
27625
|
//#region src/layouts/explorer/FileExplorer/FileExplorerItem.vue?vue&type=script&setup=true&lang.ts
|
|
27597
27626
|
var _hoisted_1$16 = { class: "item-icon" };
|
|
@@ -27649,7 +27678,7 @@ var FileExplorerItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/
|
|
|
27649
27678
|
const emit = __emit;
|
|
27650
27679
|
const renameInput = useTemplateRef("renameInput");
|
|
27651
27680
|
const renameValue = ref("");
|
|
27652
|
-
const { isValid, errorMessage, cleanedName } =
|
|
27681
|
+
const { isValid, errorMessage, cleanedName } = useKdsNameValidator({
|
|
27653
27682
|
blacklistedNames,
|
|
27654
27683
|
name: renameValue
|
|
27655
27684
|
});
|
|
@@ -27774,7 +27803,7 @@ var FileExplorerItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/
|
|
|
27774
27803
|
]);
|
|
27775
27804
|
};
|
|
27776
27805
|
}
|
|
27777
|
-
}), [["__scopeId", "data-v-
|
|
27806
|
+
}), [["__scopeId", "data-v-113f6800"]]);
|
|
27778
27807
|
//#endregion
|
|
27779
27808
|
//#region src/layouts/explorer/FileExplorer/FileExplorerItemBack.vue
|
|
27780
27809
|
var FileExplorerItemBack_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
@@ -27795,7 +27824,7 @@ var FileExplorerItemBack_default = /*#__PURE__*/ _plugin_vue_export_helper_defau
|
|
|
27795
27824
|
}, 8, ["is-dragging"])), [[unref(vKdsTooltip), "Go back"]]);
|
|
27796
27825
|
};
|
|
27797
27826
|
}
|
|
27798
|
-
}), [["__scopeId", "data-v-
|
|
27827
|
+
}), [["__scopeId", "data-v-17bcd573"]]);
|
|
27799
27828
|
//#endregion
|
|
27800
27829
|
//#region ../../node_modules/.pnpm/motion-utils@12.39.0/node_modules/motion-utils/dist/es/array.mjs
|
|
27801
27830
|
function addUniqueItem(arr, item) {
|
|
@@ -36316,6 +36345,6 @@ var useKdsDarkMode = () => {
|
|
|
36316
36345
|
return shared;
|
|
36317
36346
|
};
|
|
36318
36347
|
//#endregion
|
|
36319
|
-
export { KdsAccordion_default as KdsAccordion, KdsAvatar_default as KdsAvatar, KdsAvatarCounter_default as KdsAvatarCounter, KdsBadge_default as KdsBadge, KdsBanner_default as KdsBanner, KdsBreadcrumb_default as KdsBreadcrumb, KdsButton_default as KdsButton, KdsCard_default as KdsCard, KdsCheckbox_default as KdsCheckbox, KdsCheckboxGroup_default as KdsCheckboxGroup, KdsClickableCard_default as KdsClickableCard, KdsColorInput_default as KdsColorInput, KdsColorSwatch_default as KdsColorSwatch, KdsContextMenu_default as KdsContextMenu, KdsDataType_default as KdsDataType, KdsDateInput_default as KdsDateInput, KdsDateTimeFormatInput_default as KdsDateTimeFormatInput, KdsDateTimeInput_default as KdsDateTimeInput, KdsDescription_default as KdsDescription, KdsDivider_default as KdsDivider, KdsDonutChart_default as KdsDonutChart, KdsDropdown_default as KdsDropdown, KdsDynamicModalProvider_default as KdsDynamicModalProvider, KdsEmptyState_default as KdsEmptyState, KdsFileExplorer_default as KdsFileExplorer, KdsFileSelector_default as KdsFileSelector, KdsIcon_default as KdsIcon, KdsInfoToggleButton_default as KdsInfoToggleButton, KdsInlineMessage_default as KdsInlineMessage, KdsIntervalInput_default as KdsIntervalInput, KdsKeyboardShortcut_default as KdsKeyboardShortcut, KdsLabel_default as KdsLabel, KdsLimitBar_default as KdsLimitBar, KdsLink_default as KdsLink, KdsLinkButton_default as KdsLinkButton, KdsLinkCard_default as KdsLinkCard, KdsListContainer_default as KdsListContainer, KdsLiveStatus_default as KdsLiveStatus, KdsLoadingSkeleton_default as KdsLoadingSkeleton, KdsLoadingSpinner_default as KdsLoadingSpinner, KdsMenu_default as KdsMenu, KdsMenuButton_default as KdsMenuButton, KdsMissingValueIcon_default as KdsMissingValueIcon, KdsModal_default as KdsModal, KdsModalLayout_default as KdsModalLayout, KdsMultiSelectButton_default as KdsMultiSelectButton, KdsMultiSelectDropdown_default as KdsMultiSelectDropdown, KdsNavItem_default as KdsNavItem, KdsNavigation_default as KdsNavigation, KdsNumberInput_default as KdsNumberInput, KdsPagination_default as KdsPagination, KdsPanel_default as KdsPanel, KdsPasswordInput_default as KdsPasswordInput, KdsPatternInput_default as KdsPatternInput, KdsPopover_default as KdsPopover, KdsPortIcon_default as KdsPortIcon, KdsPreviewList_default as KdsPreviewList, KdsProgressBar_default as KdsProgressBar, KdsProgressButton_default as KdsProgressButton, KdsRadioButton_default as KdsRadioButton, KdsRadioButtonGroup_default as KdsRadioButtonGroup, KdsResponsiveButtonGroup_default as KdsResponsiveButtonGroup, KdsSearchInput_default as KdsSearchInput, KdsSelectButton_default as KdsSelectButton, KdsSelectableCard_default as KdsSelectableCard, KdsSideDrawer_default as KdsSideDrawer, KdsSortableListBox_default as KdsSortableListBox, KdsSplitButton_default as KdsSplitButton, KdsSplitPanel_default as KdsSplitPanel, KdsSubText_default as KdsSubText, KdsTabBar_default as KdsTabBar, KdsTabPanel_default as KdsTabPanel, KdsTextHighlight_default as KdsTextHighlight, KdsTextInput_default as KdsTextInput, KdsTextarea_default as KdsTextarea, KdsTimeInput_default as KdsTimeInput, KdsToggleButton_default as KdsToggleButton, KdsToggleSwitch_default as KdsToggleSwitch, KdsTree_default as KdsTree, KdsTwinList_default as KdsTwinList, KdsUsernameInput_default as KdsUsernameInput, KdsValueSwitch_default as KdsValueSwitch, KdsVariableToggleButton_default as KdsVariableToggleButton, KdsZonedDateTimeInput_default as KdsZonedDateTimeInput, PORT_SIZE, kdsAccessorySize, kdsAccessorySizes, kdsAccessoryType, kdsAccessoryTypes, kdsActionButtonType, kdsActionButtonTypes, kdsAvatarSize, kdsAvatarSizes, kdsBadgeSize, kdsBadgeSizes, kdsBadgeVariant, kdsBadgeVariants, kdsFeedbackVariant as kdsBannerVariant, kdsFeedbackVariant as kdsInlineMessageVariant, kdsFeedbackVariants as kdsBannerVariants, kdsFeedbackVariants as kdsInlineMessageVariants, kdsButtonSize, kdsButtonSizes, kdsButtonVariant, kdsButtonVariants, kdsCardBodyVariant, kdsCardBodyVariants, kdsCardVariant, kdsCardVariants, kdsCheckboxGroupAlignment, kdsCheckboxGroupAlignments, kdsCheckboxValue, kdsCheckboxValues, kdsColorSwatchSize, kdsColorSwatchSizes, kdsColorSwatchType, kdsColorSwatchTypes, kdsDarkModeType, kdsDarkModeTypes, kdsDataTypeSize, kdsDataTypeSizes, kdsDateFormatCategories, kdsDateFormatCategory, kdsFileExplorerDraggingAnimationMode, kdsFileExplorerDraggingAnimationModes, kdsFileExplorerSize, kdsFileExplorerSizes, kdsIconName, iconNames as kdsIconNames, kdsIconSize, kdsIconSizes, kdsIntervalDirectionalities, kdsIntervalDirectionality, kdsIntervalInputFormat, kdsIntervalInputFormats, kdsKeyboardShortcutSize, kdsKeyboardShortcutSizes, kdsLimitBarThresholdVariant, kdsLimitBarThresholdVariants, kdsLinkSize, kdsLinkSizes, kdsLiveStatusSize, kdsLiveStatusSizes, kdsLiveStatusStatus, kdsLiveStatusStatuses, kdsLoadingSkeletonVariant, kdsLoadingSkeletonVariants, kdsLoadingSpinnerVariant, kdsLoadingSpinnerVariants, kdsModalClosedBy, kdsModalClosedByOptions, kdsModalHeight, kdsModalHeightSizes, kdsModalVariant, kdsModalVariants, kdsModalWidth, kdsModalWidthSizes, kdsPanelBodyOverflow, kdsPanelBodyOverflows, kdsPanelBodyVariant, kdsPanelBodyVariants, kdsPasswordInputAutocomplete, kdsPasswordInputAutocompletes, kdsPasswordInputVariant, kdsPasswordInputVariants, kdsPopoverPlacement, kdsPopoverPlacements, kdsPopoverRole, kdsPopoverRoles, kdsPopoverType, kdsPopoverTypes, kdsPortType, kdsPortTypes, kdsProgressBarSize, kdsProgressBarSizes, kdsProgressButtonState, kdsProgressButtonStates, kdsRadioButtonGroupAlignment, kdsRadioButtonGroupAlignments, kdsResponsiveButtonGroupAlignment, kdsResponsiveButtonGroupAlignments, kdsSplitPanelDirection, kdsSplitPanelDirections, kdsTabBarSize, kdsTabBarSizes, kdsTemporalType, kdsTemporalTypes, kdsTimeInputGranularities, kdsTimeInputGranularity, kdsToggleButtonVariant, kdsToggleButtonVariants, kdsToggleSwitchLabelPosition, kdsToggleSwitchLabelPositions, kdsToggleSwitchSize, kdsToggleSwitchSizes, kdsTwinListSearchMode, kdsTwinListSearchModes, kdsTypeIconName, typeIconNames as kdsTypeIconNames, kdsUsernameInputAutocomplete, kdsUsernameInputAutocompletes, kdsValueSwitchSize, kdsValueSwitchSizes, kdsValueSwitchVariant, kdsValueSwitchVariants, useKdsDarkMode, useKdsDynamicModal, useKdsIsTruncated, useKdsMultiSelection, vKdsTooltip };
|
|
36348
|
+
export { KdsAccordion_default as KdsAccordion, KdsAvatar_default as KdsAvatar, KdsAvatarCounter_default as KdsAvatarCounter, KdsBadge_default as KdsBadge, KdsBanner_default as KdsBanner, KdsBreadcrumb_default as KdsBreadcrumb, KdsButton_default as KdsButton, KdsCard_default as KdsCard, KdsCheckbox_default as KdsCheckbox, KdsCheckboxGroup_default as KdsCheckboxGroup, KdsClickableCard_default as KdsClickableCard, KdsColorInput_default as KdsColorInput, KdsColorSwatch_default as KdsColorSwatch, KdsContextMenu_default as KdsContextMenu, KdsDataType_default as KdsDataType, KdsDateInput_default as KdsDateInput, KdsDateTimeFormatInput_default as KdsDateTimeFormatInput, KdsDateTimeInput_default as KdsDateTimeInput, KdsDescription_default as KdsDescription, KdsDivider_default as KdsDivider, KdsDonutChart_default as KdsDonutChart, KdsDropdown_default as KdsDropdown, KdsDynamicModalProvider_default as KdsDynamicModalProvider, KdsEmptyState_default as KdsEmptyState, KdsFileExplorer_default as KdsFileExplorer, KdsFileSelector_default as KdsFileSelector, KdsIcon_default as KdsIcon, KdsInfoToggleButton_default as KdsInfoToggleButton, KdsInlineMessage_default as KdsInlineMessage, KdsIntervalInput_default as KdsIntervalInput, KdsKeyboardShortcut_default as KdsKeyboardShortcut, KdsLabel_default as KdsLabel, KdsLimitBar_default as KdsLimitBar, KdsLink_default as KdsLink, KdsLinkButton_default as KdsLinkButton, KdsLinkCard_default as KdsLinkCard, KdsListContainer_default as KdsListContainer, KdsLiveStatus_default as KdsLiveStatus, KdsLoadingSkeleton_default as KdsLoadingSkeleton, KdsLoadingSpinner_default as KdsLoadingSpinner, KdsMenu_default as KdsMenu, KdsMenuButton_default as KdsMenuButton, KdsMissingValueIcon_default as KdsMissingValueIcon, KdsModal_default as KdsModal, KdsModalLayout_default as KdsModalLayout, KdsMultiSelectButton_default as KdsMultiSelectButton, KdsMultiSelectDropdown_default as KdsMultiSelectDropdown, KdsNavItem_default as KdsNavItem, KdsNavigation_default as KdsNavigation, KdsNumberInput_default as KdsNumberInput, KdsPagination_default as KdsPagination, KdsPanel_default as KdsPanel, KdsPasswordInput_default as KdsPasswordInput, KdsPatternInput_default as KdsPatternInput, KdsPopover_default as KdsPopover, KdsPortIcon_default as KdsPortIcon, KdsPreviewList_default as KdsPreviewList, KdsProgressBar_default as KdsProgressBar, KdsProgressButton_default as KdsProgressButton, KdsRadioButton_default as KdsRadioButton, KdsRadioButtonGroup_default as KdsRadioButtonGroup, KdsResponsiveButtonGroup_default as KdsResponsiveButtonGroup, KdsSearchInput_default as KdsSearchInput, KdsSelectButton_default as KdsSelectButton, KdsSelectableCard_default as KdsSelectableCard, KdsSideDrawer_default as KdsSideDrawer, KdsSortableListBox_default as KdsSortableListBox, KdsSplitButton_default as KdsSplitButton, KdsSplitPanel_default as KdsSplitPanel, KdsSubText_default as KdsSubText, KdsTabBar_default as KdsTabBar, KdsTabPanel_default as KdsTabPanel, KdsTextHighlight_default as KdsTextHighlight, KdsTextInput_default as KdsTextInput, KdsTextarea_default as KdsTextarea, KdsTimeInput_default as KdsTimeInput, KdsToggleButton_default as KdsToggleButton, KdsToggleSwitch_default as KdsToggleSwitch, KdsTree_default as KdsTree, KdsTwinList_default as KdsTwinList, KdsUsernameInput_default as KdsUsernameInput, KdsValueSwitch_default as KdsValueSwitch, KdsVariableToggleButton_default as KdsVariableToggleButton, KdsZonedDateTimeInput_default as KdsZonedDateTimeInput, PORT_SIZE, kdsAccessorySize, kdsAccessorySizes, kdsAccessoryType, kdsAccessoryTypes, kdsActionButtonType, kdsActionButtonTypes, kdsAvatarSize, kdsAvatarSizes, kdsBadgeSize, kdsBadgeSizes, kdsBadgeVariant, kdsBadgeVariants, kdsFeedbackVariant as kdsBannerVariant, kdsFeedbackVariant as kdsInlineMessageVariant, kdsFeedbackVariants as kdsBannerVariants, kdsFeedbackVariants as kdsInlineMessageVariants, kdsButtonSize, kdsButtonSizes, kdsButtonVariant, kdsButtonVariants, kdsCardBodyVariant, kdsCardBodyVariants, kdsCardVariant, kdsCardVariants, kdsCheckboxGroupAlignment, kdsCheckboxGroupAlignments, kdsCheckboxValue, kdsCheckboxValues, kdsColorSwatchSize, kdsColorSwatchSizes, kdsColorSwatchType, kdsColorSwatchTypes, kdsDarkModeType, kdsDarkModeTypes, kdsDataTypeSize, kdsDataTypeSizes, kdsDateFormatCategories, kdsDateFormatCategory, kdsFileExplorerDraggingAnimationMode, kdsFileExplorerDraggingAnimationModes, kdsFileExplorerSize, kdsFileExplorerSizes, kdsIconName, iconNames as kdsIconNames, kdsIconSize, kdsIconSizes, kdsIntervalDirectionalities, kdsIntervalDirectionality, kdsIntervalInputFormat, kdsIntervalInputFormats, kdsKeyboardShortcutSize, kdsKeyboardShortcutSizes, kdsLimitBarThresholdVariant, kdsLimitBarThresholdVariants, kdsLinkSize, kdsLinkSizes, kdsLiveStatusSize, kdsLiveStatusSizes, kdsLiveStatusStatus, kdsLiveStatusStatuses, kdsLoadingSkeletonVariant, kdsLoadingSkeletonVariants, kdsLoadingSpinnerVariant, kdsLoadingSpinnerVariants, kdsModalClosedBy, kdsModalClosedByOptions, kdsModalHeight, kdsModalHeightSizes, kdsModalVariant, kdsModalVariants, kdsModalWidth, kdsModalWidthSizes, kdsPanelBodyOverflow, kdsPanelBodyOverflows, kdsPanelBodyVariant, kdsPanelBodyVariants, kdsPasswordInputAutocomplete, kdsPasswordInputAutocompletes, kdsPasswordInputVariant, kdsPasswordInputVariants, kdsPopoverPlacement, kdsPopoverPlacements, kdsPopoverRole, kdsPopoverRoles, kdsPopoverType, kdsPopoverTypes, kdsPortType, kdsPortTypes, kdsProgressBarSize, kdsProgressBarSizes, kdsProgressButtonState, kdsProgressButtonStates, kdsRadioButtonGroupAlignment, kdsRadioButtonGroupAlignments, kdsResponsiveButtonGroupAlignment, kdsResponsiveButtonGroupAlignments, kdsSplitPanelDirection, kdsSplitPanelDirections, kdsTabBarSize, kdsTabBarSizes, kdsTemporalType, kdsTemporalTypes, kdsTimeInputGranularities, kdsTimeInputGranularity, kdsToggleButtonVariant, kdsToggleButtonVariants, kdsToggleSwitchLabelPosition, kdsToggleSwitchLabelPositions, kdsToggleSwitchSize, kdsToggleSwitchSizes, kdsTwinListSearchMode, kdsTwinListSearchModes, kdsTypeIconName, typeIconNames as kdsTypeIconNames, kdsUsernameInputAutocomplete, kdsUsernameInputAutocompletes, kdsValueSwitchSize, kdsValueSwitchSizes, kdsValueSwitchVariant, kdsValueSwitchVariants, useKdsDarkMode, useKdsDynamicModal, useKdsIsTruncated, useKdsMultiSelection, useKdsNameValidator, vKdsTooltip };
|
|
36320
36349
|
|
|
36321
36350
|
//# sourceMappingURL=index.js.map
|