WIP - keep progress with frontend views
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { PopoverRootEmits, PopoverRootProps } from "reka-ui"
|
||||
import { PopoverRoot, useForwardPropsEmits } from "reka-ui"
|
||||
import type { PopoverRootEmits, PopoverRootProps } from "radix-vue"
|
||||
import { PopoverRoot, useForwardPropsEmits } from "radix-vue"
|
||||
|
||||
const props = defineProps<PopoverRootProps>()
|
||||
const emits = defineEmits<PopoverRootEmits>()
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import type { PopoverContentEmits, PopoverContentProps } from "reka-ui"
|
||||
import type { PopoverContentEmits, PopoverContentProps } from "radix-vue"
|
||||
import type { HTMLAttributes } from "vue"
|
||||
import { reactiveOmit } from "@vueuse/core"
|
||||
import {
|
||||
PopoverContent,
|
||||
PopoverPortal,
|
||||
useForwardPropsEmits,
|
||||
} from "reka-ui"
|
||||
} from "radix-vue"
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
defineOptions({
|
||||
@@ -28,7 +28,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PopoverPortal>
|
||||
<PopoverPortal to="body">
|
||||
<PopoverContent
|
||||
v-bind="{ ...forwarded, ...$attrs }"
|
||||
:class="
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { PopoverTriggerProps } from "reka-ui"
|
||||
import { PopoverTrigger } from "reka-ui"
|
||||
import type { PopoverTriggerProps } from "radix-vue"
|
||||
import { PopoverTrigger } from "radix-vue"
|
||||
|
||||
const props = defineProps<PopoverTriggerProps>()
|
||||
</script>
|
||||
|
||||
18
frontend/components/ui/tabs/Tabs.vue
Normal file
18
frontend/components/ui/tabs/Tabs.vue
Normal 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>
|
||||
26
frontend/components/ui/tabs/TabsContent.vue
Normal file
26
frontend/components/ui/tabs/TabsContent.vue
Normal 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>
|
||||
26
frontend/components/ui/tabs/TabsList.vue
Normal file
26
frontend/components/ui/tabs/TabsList.vue
Normal 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>
|
||||
26
frontend/components/ui/tabs/TabsTrigger.vue
Normal file
26
frontend/components/ui/tabs/TabsTrigger.vue
Normal 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>
|
||||
4
frontend/components/ui/tabs/index.ts
Normal file
4
frontend/components/ui/tabs/index.ts
Normal 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'
|
||||
@@ -139,7 +139,7 @@ const getFieldsBySection = (section: FieldSection) => {
|
||||
<div class="grid gap-6 md:grid-cols-2">
|
||||
<FieldRenderer
|
||||
v-for="field in getFieldsBySection(section)"
|
||||
:key="field.id"
|
||||
:key="field?.id"
|
||||
:field="field"
|
||||
:model-value="data[field.apiName]"
|
||||
:mode="ViewMode.DETAIL"
|
||||
|
||||
@@ -41,6 +41,11 @@ export default defineNuxtConfig({
|
||||
|
||||
typescript: {
|
||||
strict: true,
|
||||
tsConfig: {
|
||||
compilerOptions: {
|
||||
verbatimModuleSyntax: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
features: {
|
||||
@@ -52,7 +57,7 @@ export default defineNuxtConfig({
|
||||
hmr: {
|
||||
clientPort: 3001,
|
||||
},
|
||||
allowedHosts: ['jupiter.routebox.co', 'localhost', '127.0.0.1'],
|
||||
allowedHosts: ['.routebox.co', 'localhost', '127.0.0.1'],
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
@@ -7,11 +7,13 @@ import EditView from '@/components/views/EditView.vue'
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
|
||||
import {
|
||||
FieldType,
|
||||
ViewMode,
|
||||
type ListViewConfig,
|
||||
type DetailViewConfig,
|
||||
type EditViewConfig,
|
||||
type FieldConfig
|
||||
ViewMode
|
||||
} from '@/types/field-types'
|
||||
import type {
|
||||
ListViewConfig,
|
||||
DetailViewConfig,
|
||||
EditViewConfig,
|
||||
FieldConfig
|
||||
} from '@/types/field-types'
|
||||
|
||||
// Example: Contact Object
|
||||
|
||||
1
frontend/types/index.ts
Normal file
1
frontend/types/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './field-types'
|
||||
Reference in New Issue
Block a user