diff --git a/package-lock.json b/package-lock.json index be18568..58309dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,9 @@ "name": "odin-todo-vue", "version": "0.0.0", "dependencies": { + "@kouts/vue-modal": "^5.0.0", + "@vuepic/vue-datepicker": "^8.1.1", + "date-fns": "^3.3.1", "lucide-vue-next": "^0.330.0", "v-dropdown-menu": "^2.0.4", "vue": "^3.4.15", @@ -608,6 +611,14 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@kouts/vue-modal": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@kouts/vue-modal/-/vue-modal-5.0.0.tgz", + "integrity": "sha512-03R4FaSp2q/rvXr51+YA9g/zszEeexObFimnyVDniT+PiK2QXbG8wnjEkmwSJSGxXs+ravyaVKFSa+SbLpDgoQ==", + "dependencies": { + "vue": "^3.3.4" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -974,6 +985,20 @@ "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.19.tgz", "integrity": "sha512-/KliRRHMF6LoiThEy+4c1Z4KB/gbPrGjWwJR+crg2otgrf/egKzRaCPvJ51S5oetgsgXLfc4Rm5ZgrKHZrtMSw==" }, + "node_modules/@vuepic/vue-datepicker": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/@vuepic/vue-datepicker/-/vue-datepicker-8.1.1.tgz", + "integrity": "sha512-/t9+dROb/hYN/DInff8ctIiVm5tVyuJdiWA+nWcjHOLjUhvAQ9vyJwhxAkoWX5o0EB5x5XeCME2cajfTPz86RA==", + "dependencies": { + "date-fns": "^3.3.1" + }, + "engines": { + "node": ">=18.12.0" + }, + "peerDependencies": { + "vue": ">=3.2.0" + } + }, "node_modules/acorn": { "version": "8.11.3", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", @@ -1332,6 +1357,15 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, + "node_modules/date-fns": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.3.1.tgz", + "integrity": "sha512-y8e109LYGgoQDveiEBD3DYXKba1jWf5BA8YU1FL5Tvm0BTdEfy54WLCwnuYWZNnzzvALy/QQ4Hov+Q9RVRv+Zw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/kossnocorp" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", diff --git a/package.json b/package.json index 5544040..2100f12 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,9 @@ "format": "prettier --write src/" }, "dependencies": { + "@kouts/vue-modal": "^5.0.0", + "@vuepic/vue-datepicker": "^8.1.1", + "date-fns": "^3.3.1", "lucide-vue-next": "^0.330.0", "v-dropdown-menu": "^2.0.4", "vue": "^3.4.15", diff --git a/src/instances/Project.vue b/src/instances/Project.vue index 4fe9671..1cd5340 100644 --- a/src/instances/Project.vue +++ b/src/instances/Project.vue @@ -2,30 +2,83 @@ import { X, GripVertical, MoreVertical, Edit3 } from 'lucide-vue-next'; import DropdownMenu from 'v-dropdown-menu'; + +import { Modal } from '@kouts/vue-modal' +import { ref } from 'vue'; // import 'v-dropdown-menu/dist/vue3/v-dropdown-menu.css' const props = defineProps(['item', 'remove', 'currentProject', 'rename']) +const showModalRename = ref(false); +const showModalDelete = ref(false); + +function removeProject(event) { + event.preventDefault(); + // setTimeout(() => showModalDelete.value = false, 1) + // setTimeout(() => props.remove(props.item), 121) + props.remove(props.item); +} + + +function renameProject(event) { + event.preventDefault(); + let form = new FormData(event.srcElement); + props.rename(props.item, form.values().next().value); + setTimeout(() => showModalRename.value = false, 1) +}