keep-vue
Version:
Keep Vue is an open-source component library built on top of Vue3 and Tailwind CSS. It offers a collection of pre-designed UI components and styles that you can easily integrate into your web applications.
195 lines (194 loc) • 11.2 kB
JavaScript
/// <reference types=".vue-global-types/vue_3.5_false.d.ts" />
import { CalendarRoot, useForwardPropsEmits, } from "radix-vue";
import { computed } from "vue";
import { cn } from "../../utils/cn";
import CalendarCell from "./CalendarCell.vue";
import CalendarCellTrigger from "./CalendarCellTrigger.vue";
import CalendarGrid from "./CalendarGrid.vue";
import CalendarGridBody from "./CalendarGridBody.vue";
import CalendarGridHead from "./CalendarGridHead.vue";
import CalendarGridRow from "./CalendarGridRow.vue";
import CalendarHeadCell from "./CalendarHeadCell.vue";
import CalendarHeader from "./CalendarHeader.vue";
import CalendarHeading from "./CalendarHeading.vue";
import CalendarNextButton from "./CalendarNextButton.vue";
import CalendarPrevButton from "./CalendarPrevButton.vue";
import { useProvideCalender } from "./useCalenderStore";
const { defineProps, defineSlots, defineEmits, defineExpose, defineModel, defineOptions, withDefaults, } = await import('vue');
let __VLS_typeProps;
const props = withDefaults(defineProps(), {
dayShape: "rounded",
});
const emits = defineEmits();
const restProps = computed(() => {
const { class: _, classes, dayShape, ...rest } = props;
return rest;
});
const forwarded = useForwardPropsEmits(restProps, emits);
const changedDayShaped = computed(() => {
return props.dayShape;
});
useProvideCalender(changedDayShaped);
const __VLS_withDefaultsArg = (function (t) { return t; })({
dayShape: "rounded",
});
const __VLS_fnComponent = (await import('vue')).defineComponent({
__typeEmits: {},
});
;
let __VLS_functionalComponentProps;
function __VLS_template() {
const __VLS_ctx = {};
const __VLS_localComponents = {
...{},
...{},
...__VLS_ctx,
};
let __VLS_components;
const __VLS_localDirectives = {
...{},
...__VLS_ctx,
};
let __VLS_directives;
let __VLS_styleScopedClasses;
let __VLS_resolvedLocalAndGlobalComponents;
const __VLS_0 = __VLS_resolvedLocalAndGlobalComponents.CalendarRoot;
/** @type { [typeof __VLS_components.CalendarRoot, typeof __VLS_components.CalendarRoot, ] } */
// @ts-ignore
const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({ ...{ class: ((__VLS_ctx.cn('max-w-min rounded-xl border border-metal-50 bg-white p-5 dark:border-metal-800 dark:bg-metal-900', props.class))) }, ...(__VLS_ctx.forwarded), }));
const __VLS_2 = __VLS_1({ ...{ class: ((__VLS_ctx.cn('max-w-min rounded-xl border border-metal-50 bg-white p-5 dark:border-metal-800 dark:bg-metal-900', props.class))) }, ...(__VLS_ctx.forwarded), }, ...__VLS_functionalComponentArgsRest(__VLS_1));
{
const { default: __VLS_thisSlot } = __VLS_nonNullable(__VLS_5.slots);
const [{ grid, weekDays }] = __VLS_getSlotParams(__VLS_thisSlot);
// @ts-ignore
[CalendarHeader, CalendarHeader,];
// @ts-ignore
const __VLS_6 = __VLS_asFunctionalComponent(CalendarHeader, new CalendarHeader({ ...{ class: ((__VLS_ctx.cn(props.classes?.datePickerHeader))) }, }));
const __VLS_7 = __VLS_6({ ...{ class: ((__VLS_ctx.cn(props.classes?.datePickerHeader))) }, }, ...__VLS_functionalComponentArgsRest(__VLS_6));
// @ts-ignore
[CalendarPrevButton,];
// @ts-ignore
const __VLS_11 = __VLS_asFunctionalComponent(CalendarPrevButton, new CalendarPrevButton({ ...{ class: ((__VLS_ctx.cn(props.classes?.prevBtn))) }, }));
const __VLS_12 = __VLS_11({ ...{ class: ((__VLS_ctx.cn(props.classes?.prevBtn))) }, }, ...__VLS_functionalComponentArgsRest(__VLS_11));
// @ts-ignore
[CalendarHeading,];
// @ts-ignore
const __VLS_16 = __VLS_asFunctionalComponent(CalendarHeading, new CalendarHeading({ ...{ class: ((__VLS_ctx.cn(props.classes?.datePickerHeading))) }, }));
const __VLS_17 = __VLS_16({ ...{ class: ((__VLS_ctx.cn(props.classes?.datePickerHeading))) }, }, ...__VLS_functionalComponentArgsRest(__VLS_16));
// @ts-ignore
[CalendarNextButton,];
// @ts-ignore
const __VLS_21 = __VLS_asFunctionalComponent(CalendarNextButton, new CalendarNextButton({ ...{ class: ((__VLS_ctx.cn(props.classes?.prevBtn))) }, }));
const __VLS_22 = __VLS_21({ ...{ class: ((__VLS_ctx.cn(props.classes?.prevBtn))) }, }, ...__VLS_functionalComponentArgsRest(__VLS_21));
__VLS_nonNullable(__VLS_10.slots).default;
const __VLS_10 = __VLS_pickFunctionalComponentCtx(CalendarHeader, __VLS_7);
__VLS_elementAsFunction(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({ ...{ class: ((__VLS_ctx.cn('mt-4 flex flex-col gap-y-4 sm:flex-row sm:gap-x-4 sm:gap-y-0', props.classes?.datePickerBody))) }, });
for (const [month] of __VLS_getVForSourceType((grid))) {
// @ts-ignore
[CalendarGrid, CalendarGrid,];
// @ts-ignore
const __VLS_26 = __VLS_asFunctionalComponent(CalendarGrid, new CalendarGrid({ key: ((month.value.toString())), ...{ class: ((__VLS_ctx.cn(props.classes?.MonthContainer))) }, }));
const __VLS_27 = __VLS_26({ key: ((month.value.toString())), ...{ class: ((__VLS_ctx.cn(props.classes?.MonthContainer))) }, }, ...__VLS_functionalComponentArgsRest(__VLS_26));
// @ts-ignore
[CalendarGridHead, CalendarGridHead,];
// @ts-ignore
const __VLS_31 = __VLS_asFunctionalComponent(CalendarGridHead, new CalendarGridHead({ ...{ class: ((__VLS_ctx.cn('flex', props.classes?.weekContainer))) }, }));
const __VLS_32 = __VLS_31({ ...{ class: ((__VLS_ctx.cn('flex', props.classes?.weekContainer))) }, }, ...__VLS_functionalComponentArgsRest(__VLS_31));
// @ts-ignore
[CalendarGridRow, CalendarGridRow,];
// @ts-ignore
const __VLS_36 = __VLS_asFunctionalComponent(CalendarGridRow, new CalendarGridRow({ ...{ class: ((__VLS_ctx.cn(props.classes?.weekHeader))) }, }));
const __VLS_37 = __VLS_36({ ...{ class: ((__VLS_ctx.cn(props.classes?.weekHeader))) }, }, ...__VLS_functionalComponentArgsRest(__VLS_36));
for (const [day] of __VLS_getVForSourceType((weekDays))) {
// @ts-ignore
[CalendarHeadCell, CalendarHeadCell,];
// @ts-ignore
const __VLS_41 = __VLS_asFunctionalComponent(CalendarHeadCell, new CalendarHeadCell({ key: ((day)), ...{ class: ((__VLS_ctx.cn(props.classes?.weekLabel))) }, }));
const __VLS_42 = __VLS_41({ key: ((day)), ...{ class: ((__VLS_ctx.cn(props.classes?.weekLabel))) }, }, ...__VLS_functionalComponentArgsRest(__VLS_41));
(day);
__VLS_nonNullable(__VLS_45.slots).default;
const __VLS_45 = __VLS_pickFunctionalComponentCtx(CalendarHeadCell, __VLS_42);
}
__VLS_nonNullable(__VLS_40.slots).default;
const __VLS_40 = __VLS_pickFunctionalComponentCtx(CalendarGridRow, __VLS_37);
__VLS_nonNullable(__VLS_35.slots).default;
const __VLS_35 = __VLS_pickFunctionalComponentCtx(CalendarGridHead, __VLS_32);
// @ts-ignore
[CalendarGridBody, CalendarGridBody,];
// @ts-ignore
const __VLS_46 = __VLS_asFunctionalComponent(CalendarGridBody, new CalendarGridBody({ ...{ class: ((__VLS_ctx.cn(props.classes?.dateContainer))) }, }));
const __VLS_47 = __VLS_46({ ...{ class: ((__VLS_ctx.cn(props.classes?.dateContainer))) }, }, ...__VLS_functionalComponentArgsRest(__VLS_46));
for (const [weekDates, index] of __VLS_getVForSourceType((month.rows))) {
// @ts-ignore
[CalendarGridRow, CalendarGridRow,];
// @ts-ignore
const __VLS_51 = __VLS_asFunctionalComponent(CalendarGridRow, new CalendarGridRow({ key: ((`weekDate-${index}`)), ...{ class: ((__VLS_ctx.cn('mt-2 w-full', props.classes?.dateRow))) }, }));
const __VLS_52 = __VLS_51({ key: ((`weekDate-${index}`)), ...{ class: ((__VLS_ctx.cn('mt-2 w-full', props.classes?.dateRow))) }, }, ...__VLS_functionalComponentArgsRest(__VLS_51));
for (const [weekDate] of __VLS_getVForSourceType((weekDates))) {
// @ts-ignore
[CalendarCell, CalendarCell,];
// @ts-ignore
const __VLS_56 = __VLS_asFunctionalComponent(CalendarCell, new CalendarCell({ key: ((weekDate.toString())), ...{ class: ((__VLS_ctx.cn(props.classes?.dateCell))) }, date: ((weekDate)), }));
const __VLS_57 = __VLS_56({ key: ((weekDate.toString())), ...{ class: ((__VLS_ctx.cn(props.classes?.dateCell))) }, date: ((weekDate)), }, ...__VLS_functionalComponentArgsRest(__VLS_56));
// @ts-ignore
[CalendarCellTrigger,];
// @ts-ignore
const __VLS_61 = __VLS_asFunctionalComponent(CalendarCellTrigger, new CalendarCellTrigger({ ...{ class: ((__VLS_ctx.cn(props.classes?.dateTrigger))) }, day: ((weekDate)), month: ((month.value)), }));
const __VLS_62 = __VLS_61({ ...{ class: ((__VLS_ctx.cn(props.classes?.dateTrigger))) }, day: ((weekDate)), month: ((month.value)), }, ...__VLS_functionalComponentArgsRest(__VLS_61));
__VLS_nonNullable(__VLS_60.slots).default;
const __VLS_60 = __VLS_pickFunctionalComponentCtx(CalendarCell, __VLS_57);
}
__VLS_nonNullable(__VLS_55.slots).default;
const __VLS_55 = __VLS_pickFunctionalComponentCtx(CalendarGridRow, __VLS_52);
}
__VLS_nonNullable(__VLS_50.slots).default;
const __VLS_50 = __VLS_pickFunctionalComponentCtx(CalendarGridBody, __VLS_47);
__VLS_nonNullable(__VLS_30.slots).default;
const __VLS_30 = __VLS_pickFunctionalComponentCtx(CalendarGrid, __VLS_27);
}
__VLS_nonNullable(__VLS_5.slots)['' /* empty slot name completion */];
}
const __VLS_5 = __VLS_pickFunctionalComponentCtx(__VLS_0, __VLS_2);
var __VLS_slots;
var __VLS_inheritedAttrs;
const __VLS_refs = {};
var $refs;
return {
slots: __VLS_slots,
refs: $refs,
attrs: {},
};
}
;
const __VLS_self = (await import('vue')).defineComponent({
setup() {
return {
CalendarRoot: CalendarRoot,
cn: cn,
CalendarCell: CalendarCell,
CalendarCellTrigger: CalendarCellTrigger,
CalendarGrid: CalendarGrid,
CalendarGridBody: CalendarGridBody,
CalendarGridHead: CalendarGridHead,
CalendarGridRow: CalendarGridRow,
CalendarHeadCell: CalendarHeadCell,
CalendarHeader: CalendarHeader,
CalendarHeading: CalendarHeading,
CalendarNextButton: CalendarNextButton,
CalendarPrevButton: CalendarPrevButton,
forwarded: forwarded,
};
},
__typeEmits: {},
__typeProps: {},
props: {},
});
export default (await import('vue')).defineComponent({
setup() {
return {};
},
__typeEmits: {},
__typeProps: {},
props: {},
});
;