-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
458 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<script lang="ts" setup> | ||
import { nanoid } from 'nanoid/non-secure'; | ||
const isOpen = useModalModel('add-project'); | ||
const { state, closeDialog: _closeDialog } = useDialogState(); | ||
const props = computed(() => state.value['add-project']); | ||
const name = ref(''); | ||
const url = ref(''); | ||
const closeDialog = () => _closeDialog('add-project'); | ||
const submit = () => { | ||
if (props.value == null) return; | ||
props.value.onAdd({ | ||
id: nanoid(), | ||
name: name.value, | ||
source: { type: 'onshape', url: url.value }, | ||
}); | ||
closeDialog(); | ||
}; | ||
const dismiss = () => { | ||
if (props.value == null) return; | ||
props.value.onCancel(); | ||
closeDialog(); | ||
}; | ||
</script> | ||
|
||
<template> | ||
<UModal v-model="isOpen"> | ||
<form v-if="props" @submit.prevent.stop="submit"> | ||
<UCard> | ||
<template #header>{{ props.title }}</template> | ||
|
||
<div class="flex flex-col gap-4"> | ||
<UFormGroup label="Name" required> | ||
<UInput type="text" placeholder="Enter a name..." v-model="name" /> | ||
</UFormGroup> | ||
|
||
<UFormGroup label="Onshape Assembly URL" required> | ||
<UInput | ||
type="text" | ||
placeholder="Enter a url..." | ||
v-model="url" | ||
icon="i-heroicons-globe-alt" | ||
/> | ||
</UFormGroup> | ||
</div> | ||
|
||
<template #footer> | ||
<div class="flex flex-row-reverse gap-4"> | ||
<UButton type="submit">Save</UButton> | ||
<UButton color="gray" @click="dismiss">Cancel</UButton> | ||
</div> | ||
</template> | ||
</UCard> | ||
</form> | ||
</UModal> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<script lang="ts" setup> | ||
defineProps<{ | ||
project: Project; | ||
}>(); | ||
const emit = defineEmits<{ | ||
open: [id: string]; | ||
delete: [id: string]; | ||
}>(); | ||
</script> | ||
|
||
<template> | ||
<li class="flex"> | ||
<UButton | ||
class="flex-1 flex gap-4 !rounded-r-none" | ||
color="gray" | ||
@click="emit('open', project.id)" | ||
> | ||
<UIcon class="w-6 h-6 opacity-50" name="i-heroicons-cube" /> | ||
<div class="flex-1 text-left"> | ||
<p class="text-lg">{{ project.name }}</p> | ||
<p class="opacity-50 font-normal">Onshape</p> | ||
</div> | ||
</UButton> | ||
<UButton | ||
class="aspect-1 justify-center items-center !rounded-l-none" | ||
color="gray" | ||
icon="i-heroicons-trash" | ||
@click="emit('delete', project.id)" | ||
/> | ||
</li> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<template> | ||
<ul class="flex overflow-x-auto bg-gray-100 dark:bg-gray-900 print:hidden"> | ||
<slot /> | ||
</ul> | ||
</template> | ||
|
||
<style scoped> | ||
ul { | ||
scrollbar-width: none; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<script lang="ts" setup> | ||
defineProps<{ | ||
to: string; | ||
name?: string; | ||
hideClose?: boolean; | ||
}>(); | ||
const emit = defineEmits<{ | ||
close: []; | ||
}>(); | ||
const route = useRoute(); | ||
</script> | ||
|
||
<template> | ||
<li | ||
class="bg-gray-100 dark:bg-gray-900 border-r border-gray-300 dark:border-gray-800" | ||
> | ||
<ULink | ||
class="px-3 flex shrink-0 h-12 justify-between items-center gap-3" | ||
active-class="bg-gray-300 dark:bg-gray-800" | ||
:to="to" | ||
:active="route.path === to" | ||
:title="name" | ||
> | ||
<slot /> | ||
<span | ||
v-if="name" | ||
class="min-w-[6rem] max-w-[12rem] truncate text-sm font-medium" | ||
>{{ name }}</span | ||
> | ||
<UButton | ||
v-if="!hideClose" | ||
size="2xs" | ||
icon="i-heroicons-x-mark" | ||
color="white" | ||
variant="soft" | ||
square | ||
:ui="{ rounded: 'rounded-full' }" | ||
title="Close" | ||
@click.stop.prevent="emit('close')" | ||
/> | ||
</ULink> | ||
</li> | ||
</template> |
Oops, something went wrong.