ăƒ‰ăƒ©ăƒƒă‚°ïŒ†ăƒ‰ăƒ­ăƒƒăƒ— ăƒ—ăƒ©ă‚°ă‚€ăƒł

ăƒ‰ăƒ©ăƒƒă‚°ïŒ†ăƒ‰ăƒ­ăƒƒăƒ—ăƒ—ăƒ©ă‚°ă‚€ăƒłăŻă€ă‚«ăƒŹăƒłăƒ€ăƒŒă‚°ăƒȘăƒƒăƒ‰äžŠă§ç›ŽæŽ„ă‚€ăƒ™ăƒłăƒˆă‚’ç§»ć‹•ă€ăƒȘゔむă‚șă€äœœæˆă§ăă‚‹ă‚€ăƒłă‚żăƒ©ă‚Żăƒ†ă‚Łăƒ–ăȘă‚€ăƒ™ăƒłăƒˆçźĄç†æ©Ÿèƒœă‚’æäŸ›ă—ăŸă™ă€‚

ă‚€ăƒłă‚čăƒˆăƒŒăƒ«

ăŠć„œăżăźăƒ‘ăƒƒă‚±ăƒŒă‚žăƒžăƒăƒŒă‚žăƒŁăƒŒă‚’äœżç”šă—ăŠăƒ—ăƒ©ă‚°ă‚€ăƒłă‚’ă‚€ăƒłă‚čăƒˆăƒŒăƒ«ă—ăŸă™ïŒš

npm install @dayflow/plugin-drag
pnpm add @dayflow/plugin-drag
yarn add @dayflow/plugin-drag
bun add @dayflow/plugin-drag
import { createDragPlugin } from '@dayflow/plugin-drag';

äœżă„æ–č

import { useCalendarApp, DayFlowCalendar } from '@dayflow/react';
import { createDragPlugin } from '@dayflow/plugin-drag';

function MyCalendar() {
  const dragPlugin = createDragPlugin({
    enableDrag: true,
    enableResize: true,
    enableCreate: true,
    onEventDrop: (updated, original) => {
      console.log('Event moved:', updated);
    },
    onEventResize: (updated, original) => {
      console.log('Event resized:', updated);
    },
  });

  const calendar = useCalendarApp({
    views: [
      /* ăƒ“ăƒ„ăƒŒ */
    ],
    plugins: [dragPlugin],
  });

  return <DayFlowCalendar calendar={calendar} />;
}
<template>
  <DayFlowCalendar :calendar="calendar" />
</template>

<script setup>
import { DayFlowCalendar, useCalendarApp } from '@dayflow/vue';
import { createDragPlugin } from '@dayflow/plugin-drag';

const dragPlugin = createDragPlugin({
  enableDrag: true,
  enableResize: true,
  enableCreate: true,
  onEventDrop: (updated, original) => {
    console.log('Event moved:', updated);
  },
  onEventResize: (updated, original) => {
    console.log('Event resized:', updated);
  },
});

const calendar = useCalendarApp({
  views: [
    /* ăƒ“ăƒ„ăƒŒ */
  ],
  plugins: [dragPlugin],
});
</script>
import { Component } from '@angular/core';
import { DayFlowCalendarModule } from '@dayflow/angular';
import { createDragPlugin } from '@dayflow/plugin-drag';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [DayFlowCalendarModule],
  template: `<dayflow-calendar [calendar]="calendar"></dayflow-calendar>`
})
export class AppComponent {
  calendar = {
    views: [
      /* ăƒ“ăƒ„ăƒŒ */
    ],
    plugins: [
      createDragPlugin({
        enableDrag: true,
        enableResize: true,
        enableCreate: true,
        onEventDrop: (updated, original) => {
          console.log('Event moved:', updated);
        },
        onEventResize: (updated, original) => {
          console.log('Event resized:', updated);
        },
      })
    ]
  };
}
<script>
  import { DayFlowCalendar, useCalendarApp } from '@dayflow/svelte';
  import { createDragPlugin } from '@dayflow/plugin-drag';

  const dragPlugin = createDragPlugin({
    enableDrag: true,
    enableResize: true,
    enableCreate: true,
    onEventDrop: (updated, original) => {
      console.log('Event moved:', updated);
    },
    onEventResize: (updated, original) => {
      console.log('Event resized:', updated);
    },
  });

  const calendar = useCalendarApp({
    views: [
      /* ăƒ“ăƒ„ăƒŒ */
    ],
    plugins: [dragPlugin],
  });
</script>

<DayFlowCalendar {calendar} />

èš­ćźšé …ç›ź

ăƒ—ăƒ­ăƒ‘ăƒ†ă‚Łćž‹ăƒ‡ăƒ•ă‚©ăƒ«ăƒˆć€€èȘŹæ˜Ž
enableDragbooleantrueăƒ‰ăƒ©ăƒƒă‚°ă«ă‚ˆă‚‹ă‚€ăƒ™ăƒłăƒˆăźç§»ć‹•ă‚’èš±ćŻă™ă‚‹ă‹ă©ă†ă‹ă€‚
enableResizebooleantrueăƒ‰ăƒ©ăƒƒă‚°ă«ă‚ˆă‚‹ă‚€ăƒ™ăƒłăƒˆæœŸé–“ăźć€‰æ›Žă‚’èš±ćŻă™ă‚‹ă‹ă©ă†ă‹ă€‚
enableCreatebooleantrueグăƒȘăƒƒăƒ‰ăźăƒ€ăƒ–ăƒ«ă‚ŻăƒȘăƒƒă‚Żă«ă‚ˆă‚‹ă‚€ăƒ™ăƒłăƒˆäœœæˆă‚’èš±ćŻă™ă‚‹ă‹ă©ă†ă‹ă€‚
enableAllDayCreatebooleantrueç”‚æ—„èĄŒă§ăźăƒ‰ăƒ©ăƒƒă‚°ă«ă‚ˆă‚‹ç”‚æ—„ă‚€ăƒ™ăƒłăƒˆăźäœœæˆă‚’èš±ćŻă™ă‚‹ă‹ă©ă†ă‹ă€‚
supportedViewsViewType[][DAY, WEEK, MONTH, YEAR]ăƒ‰ăƒ©ăƒƒă‚°æ©ŸèƒœăŒæœ‰ćŠčにăȘă‚‹ăƒ“ăƒ„ăƒŒăźăƒȘă‚čト。
onEventDropFunction-ă‚€ăƒ™ăƒłăƒˆăŒç§»ć‹•ïŒˆăƒ‰ăƒ©ăƒƒă‚°ïŒ†ăƒ‰ăƒ­ăƒƒăƒ—ïŒ‰ă•ă‚ŒăŸæ™‚ăźă‚łăƒŒăƒ«ăƒăƒƒă‚Żă€‚
onEventResizeFunction-ă‚€ăƒ™ăƒłăƒˆăŒăƒȘゔむă‚șă•ă‚ŒăŸæ™‚ăźă‚łăƒŒăƒ«ăƒăƒƒă‚Żă€‚

ăƒ—ăƒ©ă‚°ă‚€ăƒł API

ăƒ‰ăƒ©ăƒƒă‚°ă‚”ăƒŒăƒ“ă‚čにスクセă‚čă—ăŠă€èš­ćźšă‚’ć‹•çš„ă«æ›Žæ–°ă§ăăŸă™ïŒš

const dragService = calendar.app.getPlugin<DragService>('drag');

// 拕的にăƒȘゔむă‚șæ©Ÿèƒœă‚’ç„ĄćŠčにする
dragService.updateConfig({ enableResize: false });

On this page