{"version":3,"file":"calendar2.mjs","sources":["../../../../../../packages/components/calendar/src/calendar.ts"],"sourcesContent":["import { buildProps, definePropType, isArray, isDate } from '@bigin/utils'\nimport { INPUT_EVENT, UPDATE_MODEL_EVENT } from '@bigin/constants'\nimport type { ExtractPropTypes } from 'vue'\nimport type Calendar from './calendar.vue'\n\nexport type CalendarDateType =\n  | 'prev-month'\n  | 'next-month'\n  | 'prev-year'\n  | 'next-year'\n  | 'today'\n\nconst isValidRange = (range: unknown): range is [Date, Date] =>\n  isArray(range) && range.length === 2 && range.every((item) => isDate(item))\n\nexport const calendarProps = buildProps({\n  modelValue: {\n    type: Date,\n  },\n  range: {\n    type: definePropType<[Date, Date]>(Array),\n    validator: isValidRange,\n  },\n} as const)\nexport type CalendarProps = ExtractPropTypes<typeof calendarProps>\n\nexport const calendarEmits = {\n  [UPDATE_MODEL_EVENT]: (value: Date) => isDate(value),\n  [INPUT_EVENT]: (value: Date) => isDate(value),\n}\nexport type CalendarEmits = typeof calendarEmits\n\nexport type CalendarInstance = InstanceType<typeof Calendar>\n"],"names":[],"mappings":";;;;;;AAYA,MAAM,YAAe,GAAA,CAAC,KACpB,KAAA,OAAA,CAAQ,KAAK,CAAK,IAAA,KAAA,CAAM,MAAW,KAAA,CAAA,IAAK,MAAM,KAAM,CAAA,CAAC,IAAS,KAAA,MAAA,CAAO,IAAI,CAAC,CAAA,CAAA;AAErE,MAAM,gBAAgB,UAAW,CAAA;AAAA,EACtC,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,IAAA;AAAA,GACR;AAAA,EACA,KAAO,EAAA;AAAA,IACL,IAAA,EAAM,eAA6B,KAAK,CAAA;AAAA,IACxC,SAAW,EAAA,YAAA;AAAA,GACb;AACF,CAAU,EAAA;AAGH,MAAM,aAAgB,GAAA;AAAA,EAC3B,CAAC,kBAAA,GAAqB,CAAC,KAAA,KAAgB,OAAO,KAAK,CAAA;AAAA,EACnD,CAAC,WAAA,GAAc,CAAC,KAAA,KAAgB,OAAO,KAAK,CAAA;AAC9C;;;;"}