All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.lib.labs.VCalendar.VCalendarIntervalEvent.mjs.map Maven / Gradle / Ivy

{"version":3,"file":"VCalendarIntervalEvent.mjs","names":["VSheet","useDate","convertToUnit","genericComponent","propsFactory","useRender","makeVCalendarIntervalEventProps","allDay","Boolean","interval","Object","intervalDivisions","type","Number","required","intervalDuration","intervalHeight","event","VCalendarIntervalEvent","name","props","setup","adapter","calcHeight","first","last","isEqual","start","height","margin","Array","from","length","x","reduce","total","div","index","isBefore","addMinutes","_createVNode","color","undefined","default","title"],"sources":["../../../src/labs/VCalendar/VCalendarIntervalEvent.tsx"],"sourcesContent":["// Styles\nimport './VCalendarIntervalEvent.sass'\n\n// Components\nimport { VSheet } from '@/components/VSheet'\n\n// Composables\nimport { useDate } from '@/composables/date'\n\n// Utilities\nimport { convertToUnit, genericComponent, propsFactory, useRender } from '@/util'\n\nexport const makeVCalendarIntervalEventProps = propsFactory({\n  allDay: Boolean,\n  interval: Object,\n  intervalDivisions: {\n    type: Number,\n    required: true,\n  },\n  intervalDuration: {\n    type: Number,\n    required: true,\n  },\n  intervalHeight: {\n    type: Number,\n    required: true,\n  },\n  event: Object,\n}, 'VCalendarIntervalEvent')\n\nexport const VCalendarIntervalEvent = genericComponent()({\n  name: 'VCalendarIntervalEvent',\n\n  props: makeVCalendarIntervalEventProps(),\n\n  setup (props) {\n    const adapter = useDate()\n    const calcHeight = () => {\n      if ((!props.event?.first && !props.event?.last) || adapter.isEqual(props.event?.start, props.interval?.start)) {\n        return { height: '100%', margin: convertToUnit(0) }\n      } else {\n        const { height, margin } = Array.from({ length: props.intervalDivisions },\n          (x: number) => x * (props.intervalDuration / props.intervalDivisions)).reduce((total, div, index) => {\n          if (adapter.isBefore(adapter.addMinutes(props.interval?.start, div), props.event?.start)) {\n            return {\n              height: convertToUnit((props.intervalHeight / props.intervalDivisions) * index),\n              margin: convertToUnit((props.intervalHeight / props.intervalDivisions) * index),\n            }\n          }\n          return { height: total.height, margin: total.margin }\n        }, { height: '', margin: '' })\n        return { height, margin }\n      }\n    }\n\n    useRender(() => {\n      return (\n        \n          { props.event?.first ? props.event?.title : '' }\n        \n      )\n    })\n\n    return {}\n  },\n\n})\n\nexport type VCalendarIntervalEvent = InstanceType\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,MAAM,6CAEf;AAAA,SACSC,OAAO,4CAEhB;AAAA,SACSC,aAAa,EAAEC,gBAAgB,EAAEC,YAAY,EAAEC,SAAS;AAEjE,OAAO,MAAMC,+BAA+B,GAAGF,YAAY,CAAC;EAC1DG,MAAM,EAAEC,OAAO;EACfC,QAAQ,EAAEC,MAAM;EAChBC,iBAAiB,EAAE;IACjBC,IAAI,EAAEC,MAAM;IACZC,QAAQ,EAAE;EACZ,CAAC;EACDC,gBAAgB,EAAE;IAChBH,IAAI,EAAEC,MAAM;IACZC,QAAQ,EAAE;EACZ,CAAC;EACDE,cAAc,EAAE;IACdJ,IAAI,EAAEC,MAAM;IACZC,QAAQ,EAAE;EACZ,CAAC;EACDG,KAAK,EAAEP;AACT,CAAC,EAAE,wBAAwB,CAAC;AAE5B,OAAO,MAAMQ,sBAAsB,GAAGf,gBAAgB,CAAC,CAAC,CAAC;EACvDgB,IAAI,EAAE,wBAAwB;EAE9BC,KAAK,EAAEd,+BAA+B,CAAC,CAAC;EAExCe,KAAKA,CAAED,KAAK,EAAE;IACZ,MAAME,OAAO,GAAGrB,OAAO,CAAC,CAAC;IACzB,MAAMsB,UAAU,GAAGA,CAAA,KAAM;MACvB,IAAK,CAACH,KAAK,CAACH,KAAK,EAAEO,KAAK,IAAI,CAACJ,KAAK,CAACH,KAAK,EAAEQ,IAAI,IAAKH,OAAO,CAACI,OAAO,CAACN,KAAK,CAACH,KAAK,EAAEU,KAAK,EAAEP,KAAK,CAACX,QAAQ,EAAEkB,KAAK,CAAC,EAAE;QAC7G,OAAO;UAAEC,MAAM,EAAE,MAAM;UAAEC,MAAM,EAAE3B,aAAa,CAAC,CAAC;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