enh: create subfolder
Co-Authored-By: Colin Chen <1207878+silenceroom@users.noreply.github.com>
This commit is contained in:
1 parent
80b5896b70
commit
8913f37c3d
8 files changed
+76
-12
No files matched your search
@@ -11,11 +11,13 @@
|
||||
import Pencil from '$lib/components/icons/Pencil.svelte';
|
||||
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
||||
import Download from '$lib/components/icons/Download.svelte';
|
||||
import Folder from '$lib/components/icons/Folder.svelte';
|
||||
|
||||
export let align: 'start' | 'end' = 'start';
|
||||
export let onEdit = () => {};
|
||||
export let onExport = () => {};
|
||||
export let onDelete = () => {};
|
||||
export let onCreateSub = () => {};
|
||||
|
||||
let show = false;
|
||||
</script>
|
||||
@@ -47,6 +49,18 @@
|
||||
{align}
|
||||
transition={flyAndScale}
|
||||
>
|
||||
<DropdownMenu.Item
|
||||
class="flex gap-2 items-center px-3 py-1.5 text-sm select-none cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl"
|
||||
on:click={() => {
|
||||
onCreateSub();
|
||||
}}
|
||||
>
|
||||
<Folder />
|
||||
<div class="flex items-center">{$i18n.t('Create Folder')}</div>
|
||||
</DropdownMenu.Item>
|
||||
|
||||
<hr class="border-gray-50/30 dark:border-gray-800/30 my-1" />
|
||||
|
||||
<DropdownMenu.Item
|
||||
class="flex gap-2 items-center px-3 py-1.5 text-sm select-none cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl"
|
||||
on:click={() => {
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
export let onSubmit: Function = (e) => {};
|
||||
|
||||
export let folderId = null;
|
||||
export let parentId = null;
|
||||
export let edit = false;
|
||||
|
||||
let folder = null;
|
||||
@@ -55,7 +56,8 @@
|
||||
await onSubmit({
|
||||
name,
|
||||
meta,
|
||||
data
|
||||
data,
|
||||
parent_id: edit ? undefined : parentId
|
||||
});
|
||||
show = false;
|
||||
loading = false;
|
||||
|
||||
Reference in new issue
Block a user