WIP - keep progress with frontend views

This commit is contained in:
Francisco Gaona
2025-12-22 01:37:33 +01:00
parent fbfaf7bb9f
commit b6cb5652b7
12 changed files with 122 additions and 14 deletions

View File

@@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { PopoverRootEmits, PopoverRootProps } from "reka-ui" import type { PopoverRootEmits, PopoverRootProps } from "radix-vue"
import { PopoverRoot, useForwardPropsEmits } from "reka-ui" import { PopoverRoot, useForwardPropsEmits } from "radix-vue"
const props = defineProps<PopoverRootProps>() const props = defineProps<PopoverRootProps>()
const emits = defineEmits<PopoverRootEmits>() const emits = defineEmits<PopoverRootEmits>()

View File

@@ -1,12 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
import type { PopoverContentEmits, PopoverContentProps } from "reka-ui" import type { PopoverContentEmits, PopoverContentProps } from "radix-vue"
import type { HTMLAttributes } from "vue" import type { HTMLAttributes } from "vue"
import { reactiveOmit } from "@vueuse/core" import { reactiveOmit } from "@vueuse/core"
import { import {
PopoverContent, PopoverContent,
PopoverPortal, PopoverPortal,
useForwardPropsEmits, useForwardPropsEmits,
} from "reka-ui" } from "radix-vue"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils"
defineOptions({ defineOptions({
@@ -28,7 +28,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
</script> </script>
<template> <template>
<PopoverPortal> <PopoverPortal to="body">
<PopoverContent <PopoverContent
v-bind="{ ...forwarded, ...$attrs }" v-bind="{ ...forwarded, ...$attrs }"
:class=" :class="

View File

@@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { PopoverTriggerProps } from "reka-ui" import type { PopoverTriggerProps } from "radix-vue"
import { PopoverTrigger } from "reka-ui" import { PopoverTrigger } from "radix-vue"
const props = defineProps<PopoverTriggerProps>() const props = defineProps<PopoverTriggerProps>()
</script> </script>

View File

@@ -0,0 +1,18 @@
<script setup lang="ts">
import { TabsRoot, type TabsRootProps } from 'radix-vue'
import { computed, type HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<TabsRootProps & { class?: HTMLAttributes['class'] }>()
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props
return delegated
})
</script>
<template>
<TabsRoot v-bind="delegatedProps" :class="cn('', props.class)">
<slot />
</TabsRoot>
</template>

View File

@@ -0,0 +1,26 @@
<script setup lang="ts">
import { TabsContent, type TabsContentProps } from 'radix-vue'
import { computed, type HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<TabsContentProps & { class?: HTMLAttributes['class'] }>()
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props
return delegated
})
</script>
<template>
<TabsContent
v-bind="delegatedProps"
:class="
cn(
'mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
props.class
)
"
>
<slot />
</TabsContent>
</template>

View File

@@ -0,0 +1,26 @@
<script setup lang="ts">
import { TabsList, type TabsListProps } from 'radix-vue'
import { computed, type HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<TabsListProps & { class?: HTMLAttributes['class'] }>()
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props
return delegated
})
</script>
<template>
<TabsList
v-bind="delegatedProps"
:class="
cn(
'inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground',
props.class
)
"
>
<slot />
</TabsList>
</template>

View File

@@ -0,0 +1,26 @@
<script setup lang="ts">
import { TabsTrigger, type TabsTriggerProps } from 'radix-vue'
import { computed, type HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<TabsTriggerProps & { class?: HTMLAttributes['class'] }>()
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props
return delegated
})
</script>
<template>
<TabsTrigger
v-bind="delegatedProps"
:class="
cn(
'inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow',
props.class
)
"
>
<slot />
</TabsTrigger>
</template>

View File

@@ -0,0 +1,4 @@
export { default as Tabs } from './Tabs.vue'
export { default as TabsContent } from './TabsContent.vue'
export { default as TabsList } from './TabsList.vue'
export { default as TabsTrigger } from './TabsTrigger.vue'

View File

@@ -139,7 +139,7 @@ const getFieldsBySection = (section: FieldSection) => {
<div class="grid gap-6 md:grid-cols-2"> <div class="grid gap-6 md:grid-cols-2">
<FieldRenderer <FieldRenderer
v-for="field in getFieldsBySection(section)" v-for="field in getFieldsBySection(section)"
:key="field.id" :key="field?.id"
:field="field" :field="field"
:model-value="data[field.apiName]" :model-value="data[field.apiName]"
:mode="ViewMode.DETAIL" :mode="ViewMode.DETAIL"

View File

@@ -41,6 +41,11 @@ export default defineNuxtConfig({
typescript: { typescript: {
strict: true, strict: true,
tsConfig: {
compilerOptions: {
verbatimModuleSyntax: false,
},
},
}, },
features: { features: {
@@ -52,7 +57,7 @@ export default defineNuxtConfig({
hmr: { hmr: {
clientPort: 3001, clientPort: 3001,
}, },
allowedHosts: ['jupiter.routebox.co', 'localhost', '127.0.0.1'], allowedHosts: ['.routebox.co', 'localhost', '127.0.0.1'],
}, },
}, },

View File

@@ -7,11 +7,13 @@ import EditView from '@/components/views/EditView.vue'
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
import { import {
FieldType, FieldType,
ViewMode, ViewMode
type ListViewConfig, } from '@/types/field-types'
type DetailViewConfig, import type {
type EditViewConfig, ListViewConfig,
type FieldConfig DetailViewConfig,
EditViewConfig,
FieldConfig
} from '@/types/field-types' } from '@/types/field-types'
// Example: Contact Object // Example: Contact Object

1
frontend/types/index.ts Normal file
View File

@@ -0,0 +1 @@
export * from './field-types'