Skip to content

Commit

Permalink
feat(BaseTreeSelectItem): update app.config.ts and BaseTreeSelectItem…
Browse files Browse the repository at this point in the history
….vue
  • Loading branch information
driss-chelouati committed Dec 18, 2023
1 parent 5bd8f5a commit 9dfdc99
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 14 deletions.
3 changes: 3 additions & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ export default defineAppConfig({
size: 'md',
contrast: 'default',
},
BaseTreeSelectItem: {
rounded: 'sm',
},
defaultShapes: {
accordion: 'rounded',
autocompleteItem: 'rounded',
Expand Down
28 changes: 14 additions & 14 deletions components/form/BaseTreeSelectItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@ const props = withDefaults(
toggle?: () => void
/**
* The shape of the component.
* The radius of the component.
*
* @since 2.0.0
* @default 'sm'
*/
shape?: 'straight' | 'rounded' | 'curved' | 'full'
rounded?: 'none' | 'sm' | 'md' | 'lg' | 'full'
}>(),
{
level: 1,
shape: undefined,
value: () => ({}),
level: 1,
toggle: undefined,
rounded: undefined,
},
)
const appConfig = useAppConfig()
const shape = computed(
() => props.shape ?? appConfig.nui?.defaultShapes?.autocompleteItem,
)
const rounded = useNuiDefaultProperty(props, 'BaseTreeSelectItem', 'rounded')
const wrapperTag = computed(() => {
if (!props.toggle) {
Expand All @@ -73,17 +73,17 @@ const wrapperProps = computed(() => {
class: 'nui-focus',
}
})
// shape
</script>

<template>
<div
class="flex items-center p-2 ps-0"
:class="[
shape === 'rounded' && 'rounded-md',
shape === 'curved' && 'rounded-lg',
shape === 'full' && 'rounded-xl',
rounded === 'none' && 'rounded-none',
rounded === 'sm' && 'rounded',
rounded === 'md' && 'rounded-md',
rounded === 'lg' && 'rounded-lg',
rounded === 'full' && 'rounded-xl',
]"
>
<slot></slot>
Expand All @@ -106,7 +106,7 @@ const wrapperProps = computed(() => {
</BaseIconBox>
<div class="flex flex-col items-start">
<div
class="text-muted-800 font-heading text-sm font-medium leading-none dark:text-white"
class="text-muted-800 font-sans text-sm font-medium leading-none dark:text-white"
>
{{ props.value.name }}
</div>
Expand Down
8 changes: 8 additions & 0 deletions nuxt.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,14 @@ export default defineNuxtSchema({
*/
contrast: 'default',
},
BaseTreeSelectItem: {
/**
* The radius of the tree select item.
*
* @type {'none' | 'sm' | 'md' | 'lg'}
*/
rounded: 'sm',
},
defaultShapes: {
/**
* Default shape for the BaseAccordion component
Expand Down

0 comments on commit 9dfdc99

Please sign in to comment.