ć‚«ćƒ¬ćƒ³ćƒ€ćƒ¼ćƒ˜ćƒƒćƒ€ćƒ¼

ć‚«ćƒ¬ćƒ³ćƒ€ćƒ¼ćƒ˜ćƒƒćƒ€ćƒ¼ćÆć€ćƒŠćƒ“ć‚²ćƒ¼ć‚·ćƒ§ćƒ³ć‚³ćƒ³ćƒˆćƒ­ćƒ¼ćƒ«ć€č”Øē¤ŗåˆ‡ć‚Šę›æćˆć€ę¤œē“¢ę©Ÿčƒ½ć‚’ęä¾›ć—ć¾ć™ć€‚ćć®å‹•ä½œć‚’ć‚«ć‚¹ć‚æćƒžć‚¤ć‚ŗć—ćŸć‚Šć€å®Œå…Øć«ē½®ćę›ćˆćŸć‚Šć™ć‚‹ć“ćØćŒć§ćć¾ć™ć€‚

ćƒ˜ćƒƒćƒ€ćƒ¼ć‚’éžč”Øē¤ŗć«ć™ć‚‹

ē‹¬č‡Ŗć®ćƒŠćƒ“ć‚²ćƒ¼ć‚·ćƒ§ćƒ³ć‚’ę§‹ēÆ‰ć—ćŸć„å “åˆć‚„ć€ćƒ‡ćƒ•ć‚©ćƒ«ćƒˆć®ćƒ˜ćƒƒćƒ€ćƒ¼ćŒäøč¦ćŖå “åˆćÆć€ē„”åŠ¹ć«ć™ć‚‹ć“ćØćŒć§ćć¾ć™ć€‚

const calendar = useCalendarApp({
  views: [createMonthView()],
  useCalendarHeader: false, // ćƒ‡ćƒ•ć‚©ćƒ«ćƒˆć®ćƒ˜ćƒƒćƒ€ćƒ¼ć‚’éžč”Øē¤ŗć«ć™ć‚‹
});

ć‚«ć‚¹ć‚æćƒ ćƒ˜ćƒƒćƒ€ćƒ¼

Breaking change from v3.4.1

useCalendarHeader ćøć®é–¢ę•°ć®ęø”ć—ćÆéžåÆ¾åæœć«ćŖć‚Šć¾ć—ćŸć€‚ä»„äø‹ć®ć‚ˆć†ć«ć€ć‚«ć‚¹ć‚æćƒ ćƒ˜ćƒƒćƒ€ćƒ¼ć‚’ DayFlowCalendar 恮 calendarHeader ć‚¹ćƒ­ćƒƒćƒˆć«ē§»č”Œć—ć¦ćć ć•ć„ć€‚

calendarHeader ć‚³ćƒ³ćƒ†ćƒ³ćƒ„ć‚¹ćƒ­ćƒƒćƒˆć‚’ä½æē”Øć—ć¦ć€ćƒ‡ćƒ•ć‚©ćƒ«ćƒˆć®ćƒ˜ćƒƒćƒ€ćƒ¼ć‚’ē‹¬č‡Ŗć®ć‚³ćƒ³ćƒćƒ¼ćƒćƒ³ćƒˆć«ē½®ćę›ćˆć‚‹ć“ćØćŒć§ćć¾ć™ć€‚ćƒ¬ćƒ³ćƒ€ćƒ©ćƒ¼ćÆć‚«ćƒ¬ćƒ³ćƒ€ćƒ¼ć®ēŠ¶ę…‹ćØćƒ˜ćƒ«ćƒ‘ćƒ¼ćƒ”ć‚½ćƒƒćƒ‰ć‚’å—ć‘å–ć‚‹ćŸć‚ć€ē‹¬č‡Ŗć® UI ć‹ć‚‰ćƒŠćƒ“ć‚²ćƒ¼ć‚·ćƒ§ćƒ³ć‚„ę¤œē“¢ć‚’åˆ¶å¾”ć§ćć¾ć™ć€‚

import { useCalendarApp, DayFlowCalendar, createMonthView } from '@dayflow/react';

function MyCalendar() {
  const calendar = useCalendarApp({
    views: [createMonthView()],
  });

  return (
    <DayFlowCalendar
      calendar={calendar}
      calendarHeader={() => (
        <div className='custom-header'>
          <button onClick={() => calendar.goToPrevious()}>‹</button>
          <button onClick={() => calendar.goToToday()}>今ꗄ</button>
          <button onClick={() => calendar.goToNext()}>›</button>
        </div>
      )}
    />
  );
}
<template>
  <DayFlowCalendar :calendar="calendar">
    <template #calendarHeader="{ calendar }">
      <div class="custom-header">
        <button @click="calendar.goToPrevious()">‹</button>
        <button @click="calendar.goToToday()">今ꗄ</button>
        <button @click="calendar.goToNext()">›</button>
      </div>
    </template>
  </DayFlowCalendar>
</template>

<script setup>
import { DayFlowCalendar, useCalendarApp } from '@dayflow/vue';
import { createMonthView } from '@dayflow/core';

const calendar = useCalendarApp({
  views: [createMonthView()],
});
</script>
import { Component } from '@angular/core';
import { DayFlowCalendarModule } from '@dayflow/angular';
import { createMonthView } from '@dayflow/core';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [DayFlowCalendarModule],
  template: `
    <dayflow-calendar
      [calendar]="calendar"
      [calendarHeader]="customHeader"
    >
    </dayflow-calendar>

    <ng-template #customHeader let-args>
      <div class="custom-header">
        <button (click)="args.calendar.goToPrevious()">‹</button>
        <button (click)="args.calendar.goToToday()">今ꗄ</button>
        <button (click)="args.calendar.goToNext()">›</button>
      </div>
    </ng-template>
  `
})
export class AppComponent {
  calendar = {
    views: [createMonthView()],
  };
}
<!-- App.svelte -->
<script lang="ts">
  import { DayFlowCalendar, useCalendarApp } from '@dayflow/svelte';
  import { createMonthView } from '@dayflow/core';
  import CustomHeader from './CustomHeader.svelte';

  const calendar = useCalendarApp({
    views: [createMonthView()],
  });
</script>

<DayFlowCalendar {calendar} calendarHeader={CustomHeader} />

<!-- CustomHeader.svelte -->
<script lang="ts">
  import type { CalendarHeaderProps } from '@dayflow/core';
  let { calendar } = $props<CalendarHeaderProps>();
</script>

<div class="custom-header">
  <button onclick={() => calendar.goToPrevious()}>‹</button>
  <button onclick={() => calendar.goToToday()}>今ꗄ</button>
  <button onclick={() => calendar.goToNext()}>›</button>
</div>

ć‚¹ćƒ­ćƒƒćƒˆå¼•ę•°

ć‚¹ćƒ­ćƒƒćƒˆćƒ¬ćƒ³ćƒ€ćƒ©ćƒ¼ćÆä»„äø‹ć®å¼•ę•°ć‚’å—ć‘å–ć‚Šć¾ć™ļ¼š

å¼•ę•°čŖ¬ę˜Ž
calendarCalendarApp ć‚¤ćƒ³ć‚¹ć‚æćƒ³ć‚¹ć€‚
switcherModeē¾åœØć®č”Øē¤ŗåˆ‡ć‚Šę›æćˆćƒ¢ćƒ¼ćƒ‰ļ¼ˆbuttons または select)。
onAddCalendarę–°ć—ć„ć‚«ćƒ¬ćƒ³ćƒ€ćƒ¼ć‚’čæ½åŠ ć™ć‚‹ćŸć‚ć®ćƒćƒ³ćƒ‰ćƒ©ćƒ¼ć€‚
onSearchChangeę¤œē“¢ć‚Æć‚ØćƒŖć‚’ę›“ę–°ć™ć‚‹ćŸć‚ć®ćƒćƒ³ćƒ‰ćƒ©ćƒ¼ć€‚
onSearchClickę¤œē“¢ć‚¢ć‚¤ć‚³ćƒ³ćŒć‚ÆćƒŖćƒƒć‚Æć•ć‚ŒćŸę™‚ć®ćƒćƒ³ćƒ‰ćƒ©ćƒ¼ć€‚
searchValueē¾åœØć®ę¤œē“¢ę–‡å­—åˆ—ć€‚
isSearchOpen検瓢 UI ćŒē¾åœØé–‹ć„ć¦ć„ć‚‹ć‹ć©ć†ć‹ć€‚
isEditableć‚«ćƒ¬ćƒ³ćƒ€ćƒ¼ćŒē¾åœØē·Øé›†åÆčƒ½ćŖēŠ¶ę…‹ć‹ć©ć†ć‹ć€‚
safeAreaLeftmacOS ćƒ¢ćƒ¼ćƒ‰ć§ćƒˆćƒ©ćƒ•ć‚£ćƒƒć‚Æćƒ©ć‚¤ćƒˆćƒœć‚æćƒ³ćØé‡ćŖć‚‰ćŖć„ćŸć‚ć®å·¦ä½™ē™½ļ¼ˆpx)。