first init
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<script lang="ts" setup>
|
||||
import { Slot } from "@/components/ui/slot";
|
||||
import { cn } from "@mykopkb/core/utils/cn";
|
||||
import { datePickerViewControl } from "@mykopkb/core/styles/datepicker.styles";
|
||||
import type { Api, ViewProps } from "@zag-js/date-picker";
|
||||
import { inject } from "vue";
|
||||
|
||||
const {
|
||||
class: className,
|
||||
asChild = false,
|
||||
...props
|
||||
} = defineProps<
|
||||
ViewProps & {
|
||||
class?: string;
|
||||
asChild?: boolean;
|
||||
}
|
||||
>();
|
||||
|
||||
const api = inject<Api>("datepickerApi");
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Slot :class="cn(datePickerViewControl, className)"
|
||||
v-bind="{ ...props, ...$attrs, ...api?.getViewControlProps(props) }">
|
||||
<slot v-if="asChild" />
|
||||
<div v-else>
|
||||
<slot />
|
||||
</div>
|
||||
</Slot>
|
||||
</template>
|
||||
Reference in New Issue
Block a user