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.7 kB
JavaScript
/// <reference types=".vue-global-types/vue_3.5_false.d.ts" />
import { RangeCalendarRoot, useForwardPropsEmits, } from "radix-vue";
import { computed } from "vue";
import { cn } from "../../utils/cn";
import RangeCalendarCell from "./RangeCalendarCell.vue";
import RangeCalendarCellTrigger from "./RangeCalendarCellTrigger.vue";
import RangeCalendarGrid from "./RangeCalendarGrid.vue";
import RangeCalendarGridBody from "./RangeCalendarGridBody.vue";
import RangeCalendarGridHead from "./RangeCalendarGridHead.vue";
import RangeCalendarGridRow from "./RangeCalendarGridRow.vue";
import RangeCalendarHeadCell from "./RangeCalendarHeadCell.vue";
import RangeCalendarHeader from "./RangeCalendarHeader.vue";
import RangeCalendarHeading from "./RangeCalendarHeading.vue";
import RangeCalendarNextButton from "./RangeCalendarNextButton.vue";
import RangeCalendarPrevButton from "./RangeCalendarPrevButton.vue";
import { useProvideRangeCalender } from "./RangeCalenderStore";
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;
});
useProvideRangeCalender(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.RangeCalendarRoot;
/** @type { [typeof __VLS_components.RangeCalendarRoot, typeof __VLS_components.RangeCalendarRoot, ] } */
// @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
[RangeCalendarHeader, RangeCalendarHeader,];
// @ts-ignore
const __VLS_6 = __VLS_asFunctionalComponent(RangeCalendarHeader, new RangeCalendarHeader({ ...{ 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
[RangeCalendarPrevButton,];
// @ts-ignore
const __VLS_11 = __VLS_asFunctionalComponent(RangeCalendarPrevButton, new RangeCalendarPrevButton({ ...{ 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
[RangeCalendarHeading,];
// @ts-ignore
const __VLS_16 = __VLS_asFunctionalComponent(RangeCalendarHeading, new RangeCalendarHeading({ ...{ 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
[RangeCalendarNextButton,];
// @ts-ignore
const __VLS_21 = __VLS_asFunctionalComponent(RangeCalendarNextButton, new RangeCalendarNextButton({ ...{ 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(RangeCalendarHeader, __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
[RangeCalendarGrid, RangeCalendarGrid,];
// @ts-ignore
const __VLS_26 = __VLS_asFunctionalComponent(RangeCalendarGrid, new RangeCalendarGrid({ 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
[RangeCalendarGridHead, RangeCalendarGridHead,];
// @ts-ignore
const __VLS_31 = __VLS_asFunctionalComponent(RangeCalendarGridHead, new RangeCalendarGridHead({ ...{ 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
[RangeCalendarGridRow, RangeCalendarGridRow,];
// @ts-ignore
const __VLS_36 = __VLS_asFunctionalComponent(RangeCalendarGridRow, new RangeCalendarGridRow({ ...{ 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
[RangeCalendarHeadCell, RangeCalendarHeadCell,];
// @ts-ignore
const __VLS_41 = __VLS_asFunctionalComponent(RangeCalendarHeadCell, new RangeCalendarHeadCell({ 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(RangeCalendarHeadCell, __VLS_42);
}
__VLS_nonNullable(__VLS_40.slots).default;
const __VLS_40 = __VLS_pickFunctionalComponentCtx(RangeCalendarGridRow, __VLS_37);
__VLS_nonNullable(__VLS_35.slots).default;
const __VLS_35 = __VLS_pickFunctionalComponentCtx(RangeCalendarGridHead, __VLS_32);
// @ts-ignore
[RangeCalendarGridBody, RangeCalendarGridBody,];
// @ts-ignore
const __VLS_46 = __VLS_asFunctionalComponent(RangeCalendarGridBody, new RangeCalendarGridBody({ ...{ 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
[RangeCalendarGridRow, RangeCalendarGridRow,];
// @ts-ignore
const __VLS_51 = __VLS_asFunctionalComponent(RangeCalendarGridRow, new RangeCalendarGridRow({ 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
[RangeCalendarCell, RangeCalendarCell,];
// @ts-ignore
const __VLS_56 = __VLS_asFunctionalComponent(RangeCalendarCell, new RangeCalendarCell({ key: ((weekDate.toString())), date: ((weekDate)), ...{ class: ((__VLS_ctx.cn(props.classes?.dateCell))) }, }));
const __VLS_57 = __VLS_56({ key: ((weekDate.toString())), date: ((weekDate)), ...{ class: ((__VLS_ctx.cn(props.classes?.dateCell))) }, }, ...__VLS_functionalComponentArgsRest(__VLS_56));
// @ts-ignore
[RangeCalendarCellTrigger,];
// @ts-ignore
const __VLS_61 = __VLS_asFunctionalComponent(RangeCalendarCellTrigger, new RangeCalendarCellTrigger({ ...{ 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(RangeCalendarCell, __VLS_57);
}
__VLS_nonNullable(__VLS_55.slots).default;
const __VLS_55 = __VLS_pickFunctionalComponentCtx(RangeCalendarGridRow, __VLS_52);
}
__VLS_nonNullable(__VLS_50.slots).default;
const __VLS_50 = __VLS_pickFunctionalComponentCtx(RangeCalendarGridBody, __VLS_47);
__VLS_nonNullable(__VLS_30.slots).default;
const __VLS_30 = __VLS_pickFunctionalComponentCtx(RangeCalendarGrid, __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 {
RangeCalendarRoot: RangeCalendarRoot,
cn: cn,
RangeCalendarCell: RangeCalendarCell,
RangeCalendarCellTrigger: RangeCalendarCellTrigger,
RangeCalendarGrid: RangeCalendarGrid,
RangeCalendarGridBody: RangeCalendarGridBody,
RangeCalendarGridHead: RangeCalendarGridHead,
RangeCalendarGridRow: RangeCalendarGridRow,
RangeCalendarHeadCell: RangeCalendarHeadCell,
RangeCalendarHeader: RangeCalendarHeader,
RangeCalendarHeading: RangeCalendarHeading,
RangeCalendarNextButton: RangeCalendarNextButton,
RangeCalendarPrevButton: RangeCalendarPrevButton,
forwarded: forwarded,
};
},
__typeEmits: {},
__typeProps: {},
props: {},
});
export default (await import('vue')).defineComponent({
setup() {
return {};
},
__typeEmits: {},
__typeProps: {},
props: {},
});
;