@dayflow/vue 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,16 @@
1
+ import { PropType } from 'vue';
2
+ import { ICalendarApp, UseCalendarAppReturn } from '@dayflow/core';
3
+ export declare const DayFlowCalendar: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ calendar: {
5
+ type: PropType<ICalendarApp | UseCalendarAppReturn>;
6
+ required: true;
7
+ };
8
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
9
+ [key: string]: any;
10
+ }>[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
11
+ calendar: {
12
+ type: PropType<ICalendarApp | UseCalendarAppReturn>;
13
+ required: true;
14
+ };
15
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
16
+ export default DayFlowCalendar;
@@ -0,0 +1,2 @@
1
+ import { CalendarAppConfig, UseCalendarAppReturn } from '@dayflow/core';
2
+ export declare function useCalendarApp(config: CalendarAppConfig): UseCalendarAppReturn;
@@ -0,0 +1,6 @@
1
+ import DayFlowCalendar from './DayFlowCalendar';
2
+ export { DayFlowCalendar };
3
+ export { useCalendarApp } from './composables/useCalendarApp';
4
+ export default DayFlowCalendar;
5
+ export { CalendarApp, CalendarRegistry, createDragPlugin, createEventsPlugin, createDayView, createWeekView, createMonthView, createYearView, ViewType, } from '@dayflow/core';
6
+ export * from '@dayflow/core';
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as t,shallowRef as n,computed as r,onMounted as a,onUnmounted as i,h as l,Teleport as s,reactive as d}from"vue";import{CalendarRenderer as o,CalendarApp as u}from"@dayflow/core";export*from"@dayflow/core";export{CalendarApp,CalendarRegistry,ViewType,createDayView,createDragPlugin,createEventsPlugin,createMonthView,createWeekView,createYearView}from"@dayflow/core";const g=e({name:"DayFlowCalendar",props:{calendar:{type:Object,required:!0}},setup(e,{slots:d}){const u=t(null),g=n(null),c=t([]),b=r(()=>e.calendar.app||e.calendar);return a(()=>{if(!u.value)return;const e=new o(b.value);g.value=e,e.mount(u.value);const t=e.getCustomRenderingStore().subscribe(e=>{c.value=Array.from(e.values())});e.getCustomRenderingStore().setOverrides(Object.keys(d)),i(()=>{t(),e.unmount(),g.value=null})}),()=>[l("div",{ref:u,class:"df-calendar-wrapper"}),...c.value.map(e=>l(s,{to:e.containerEl},{default:()=>d[e.generatorName]?.(e.generatorArgs)}))]}});function c(e){const t=new u(e),n=d({currentView:t.state.currentView,currentDate:t.state.currentDate,events:t.getEvents()}),r=t.subscribe(e=>{n.currentView=e.state.currentView,n.currentDate=e.state.currentDate,n.events=e.getEvents()});return i(()=>{r()}),{app:t,get currentView(){return n.currentView},get currentDate(){return n.currentDate},get events(){return n.events},applyEventsChanges:t.applyEventsChanges.bind(t),changeView:t.changeView.bind(t),setCurrentDate:t.setCurrentDate.bind(t),addEvent:t.addEvent.bind(t),updateEvent:t.updateEvent.bind(t),deleteEvent:t.deleteEvent.bind(t),undo:t.undo.bind(t),goToToday:t.goToToday.bind(t),goToPrevious:t.goToPrevious.bind(t),goToNext:t.goToNext.bind(t),selectDate:t.selectDate.bind(t),getCalendars:t.getCalendars.bind(t),createCalendar:t.createCalendar.bind(t),mergeCalendars:t.mergeCalendars.bind(t),setCalendarVisibility:t.setCalendarVisibility.bind(t),setAllCalendarsVisibility:t.setAllCalendarsVisibility.bind(t),getAllEvents:t.getAllEvents.bind(t),highlightEvent:t.highlightEvent.bind(t),setVisibleMonth:t.setVisibleMonth.bind(t),getVisibleMonth:t.getVisibleMonth.bind(t),get sidebarConfig(){return t.getSidebarConfig()},get readOnlyConfig(){return t.getReadOnlyConfig()}}}export{g as DayFlowCalendar,g as default,c as useCalendarApp};
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("@dayflow/core");const r=e.defineComponent({name:"DayFlowCalendar",props:{calendar:{type:Object,required:!0}},setup(r,{slots:n}){const a=e.ref(null),i=e.shallowRef(null),o=e.ref([]),u=e.computed(()=>r.calendar.app||r.calendar);return e.onMounted(()=>{if(!a.value)return;const r=new t.CalendarRenderer(u.value);i.value=r,r.mount(a.value);const l=r.getCustomRenderingStore().subscribe(e=>{o.value=Array.from(e.values())});r.getCustomRenderingStore().setOverrides(Object.keys(n)),e.onUnmounted(()=>{l(),r.unmount(),i.value=null})}),()=>[e.h("div",{ref:a,class:"df-calendar-wrapper"}),...o.value.map(t=>e.h(e.Teleport,{to:t.containerEl},{default:()=>n[t.generatorName]?.(t.generatorArgs)}))]}});Object.defineProperty(exports,"CalendarApp",{enumerable:!0,get:function(){return t.CalendarApp}}),Object.defineProperty(exports,"CalendarRegistry",{enumerable:!0,get:function(){return t.CalendarRegistry}}),Object.defineProperty(exports,"ViewType",{enumerable:!0,get:function(){return t.ViewType}}),Object.defineProperty(exports,"createDayView",{enumerable:!0,get:function(){return t.createDayView}}),Object.defineProperty(exports,"createDragPlugin",{enumerable:!0,get:function(){return t.createDragPlugin}}),Object.defineProperty(exports,"createEventsPlugin",{enumerable:!0,get:function(){return t.createEventsPlugin}}),Object.defineProperty(exports,"createMonthView",{enumerable:!0,get:function(){return t.createMonthView}}),Object.defineProperty(exports,"createWeekView",{enumerable:!0,get:function(){return t.createWeekView}}),Object.defineProperty(exports,"createYearView",{enumerable:!0,get:function(){return t.createYearView}}),exports.DayFlowCalendar=r,exports.default=r,exports.useCalendarApp=function(r){const n=new t.CalendarApp(r),a=e.reactive({currentView:n.state.currentView,currentDate:n.state.currentDate,events:n.getEvents()}),i=n.subscribe(e=>{a.currentView=e.state.currentView,a.currentDate=e.state.currentDate,a.events=e.getEvents()});return e.onUnmounted(()=>{i()}),{app:n,get currentView(){return a.currentView},get currentDate(){return a.currentDate},get events(){return a.events},applyEventsChanges:n.applyEventsChanges.bind(n),changeView:n.changeView.bind(n),setCurrentDate:n.setCurrentDate.bind(n),addEvent:n.addEvent.bind(n),updateEvent:n.updateEvent.bind(n),deleteEvent:n.deleteEvent.bind(n),undo:n.undo.bind(n),goToToday:n.goToToday.bind(n),goToPrevious:n.goToPrevious.bind(n),goToNext:n.goToNext.bind(n),selectDate:n.selectDate.bind(n),getCalendars:n.getCalendars.bind(n),createCalendar:n.createCalendar.bind(n),mergeCalendars:n.mergeCalendars.bind(n),setCalendarVisibility:n.setCalendarVisibility.bind(n),setAllCalendarsVisibility:n.setAllCalendarsVisibility.bind(n),getAllEvents:n.getAllEvents.bind(n),highlightEvent:n.highlightEvent.bind(n),setVisibleMonth:n.setVisibleMonth.bind(n),getVisibleMonth:n.getVisibleMonth.bind(n),get sidebarConfig(){return n.getSidebarConfig()},get readOnlyConfig(){return n.getReadOnlyConfig()}}},Object.keys(t).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})});
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@dayflow/vue",
3
+ "version": "3.0.0",
4
+ "type": "module",
5
+ "description": "Vue adapter for DayFlow calendar",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.esm.js",
8
+ "types": "dist/index.d.ts",
9
+ "files": [
10
+ "dist",
11
+ "README.md"
12
+ ],
13
+ "scripts": {
14
+ "typecheck": "vue-tsc --noEmit",
15
+ "build": "rollup -c"
16
+ },
17
+ "peerDependencies": {
18
+ "@dayflow/core": "workspace:*",
19
+ "vue": ">=3.0.0"
20
+ },
21
+ "devDependencies": {
22
+ "@dayflow/core": "workspace:*",
23
+ "@rollup/plugin-commonjs": "^28.0.2",
24
+ "@rollup/plugin-node-resolve": "^16.0.0",
25
+ "@rollup/plugin-terser": "^0.4.4",
26
+ "@rollup/plugin-typescript": "^12.1.2",
27
+ "rollup": "^4.29.1",
28
+ "rollup-plugin-peer-deps-external": "^2.2.4",
29
+ "rollup-plugin-vue": "^6.0.0",
30
+ "typescript": "^5.7.2",
31
+ "vue": "^3.5.13",
32
+ "vue-tsc": "^2.2.0"
33
+ }
34
+ }