office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
101 lines • 7.2 kB
JavaScript
import * as React from 'react';
import { DateRangeType, DayOfWeek } from 'office-ui-fabric-react/lib/Calendar';
import { CalendarButtonExample } from './examples/Calendar.Button.Example';
import { CalendarInlineExample } from './examples/Calendar.Inline.Example';
import { CalendarStatus } from './Calendar.checklist';
import { addMonths, addYears } from '../../utilities/dateMath/DateMath';
var CalendarButtonExampleCode = require('!raw-loader!office-ui-fabric-react/src/components/Calendar/examples/Calendar.Button.Example.tsx');
var CalendarButtonExampleCodepen = require('!raw-loader!office-ui-fabric-react/lib/codepen/components/Calendar/Calendar.Button.Example.Codepen.txt');
var CalendarInlineExampleCode = require('!raw-loader!office-ui-fabric-react/src/components/Calendar/examples/Calendar.Inline.Example.tsx');
var CalendarInlineExampleCodepen = require('!raw-loader!office-ui-fabric-react/lib/codepen/components/Calendar/Calendar.Inline.Example.Codepen.txt');
var today = new Date(Date.now());
export var CalendarPageProps = {
title: 'Calendar',
componentName: 'Calendar',
componentUrl: 'https://github.com/OfficeDev/office-ui-fabric-react/tree/master/packages/office-ui-fabric-react/src/components/Calendar',
componentStatus: CalendarStatus,
examples: [
{
title: 'Inline Calendar',
code: CalendarInlineExampleCode,
view: (React.createElement(CalendarInlineExample, { isMonthPickerVisible: false, dateRangeType: DateRangeType.Day, autoNavigateOnSelection: false, showGoToToday: true })),
codepenJS: CalendarInlineExampleCodepen
},
{
title: 'Inline Calendar with overlayed month picker when header is clicked',
code: CalendarInlineExampleCode,
view: (React.createElement(CalendarInlineExample, { showMonthPickerAsOverlay: true, highlightCurrentMonth: false, highlightSelectedMonth: true, dateRangeType: DateRangeType.Day, autoNavigateOnSelection: false, showGoToToday: false }))
},
{
title: 'Inline Calendar with month picker',
code: CalendarInlineExampleCode,
view: (React.createElement(CalendarInlineExample, { dateRangeType: DateRangeType.Day, autoNavigateOnSelection: false, highlightCurrentMonth: false, highlightSelectedMonth: true, showGoToToday: true }))
},
{
title: 'Inline Calendar with week selection',
code: CalendarInlineExampleCode,
view: (React.createElement(CalendarInlineExample, { dateRangeType: DateRangeType.Week, autoNavigateOnSelection: true, highlightCurrentMonth: false, highlightSelectedMonth: true, showGoToToday: true, showNavigateButtons: true }))
},
{
title: 'Inline Calendar with month selection',
code: CalendarInlineExampleCode,
view: (React.createElement(CalendarInlineExample, { dateRangeType: DateRangeType.Month, autoNavigateOnSelection: true, highlightCurrentMonth: false, highlightSelectedMonth: true, showGoToToday: true, showNavigateButtons: true }))
},
{
title: 'Inline Calendar with week numbers',
code: CalendarInlineExampleCode,
view: (React.createElement(CalendarInlineExample, { isMonthPickerVisible: false, dateRangeType: DateRangeType.Day, autoNavigateOnSelection: false, showGoToToday: true, showWeekNumbers: true }))
},
{
title: 'Inline Calendar with 6 weeks display by default',
code: CalendarInlineExampleCode,
view: (React.createElement(CalendarInlineExample, { isMonthPickerVisible: false, dateRangeType: DateRangeType.Day, autoNavigateOnSelection: false, showGoToToday: true, showSixWeeksByDefault: true }))
},
{
title: 'Inline Calendar with month picker and no day picker',
code: CalendarInlineExampleCode,
view: (React.createElement(CalendarInlineExample, { dateRangeType: DateRangeType.Month, autoNavigateOnSelection: false, showGoToToday: true, highlightCurrentMonth: false, highlightSelectedMonth: true, isDayPickerVisible: false }))
},
{
title: 'Inline Calendar with date boundary (minDate, maxDate)',
code: CalendarInlineExampleCode,
view: (React.createElement(CalendarInlineExample, { dateRangeType: DateRangeType.Day, autoNavigateOnSelection: true, highlightCurrentMonth: false, highlightSelectedMonth: true, showGoToToday: false, minDate: addMonths(today, -1), maxDate: addYears(today, 1) }))
},
{
title: 'Calendar with selectableDays = [Tuesday, Wednesday, Friday, Saturday] provided, first day of week = Monday',
code: CalendarButtonExampleCode,
view: (React.createElement(CalendarInlineExample, { dateRangeType: DateRangeType.WorkWeek, firstDayOfWeek: DayOfWeek.Monday, autoNavigateOnSelection: true, highlightCurrentMonth: false, highlightSelectedMonth: true, showGoToToday: true, workWeekDays: [DayOfWeek.Tuesday, DayOfWeek.Saturday, DayOfWeek.Wednesday, DayOfWeek.Friday] }))
},
{
title: 'Calendar launched from a button',
code: CalendarButtonExampleCode,
view: React.createElement(CalendarButtonExample, { highlightCurrentMonth: true }),
codepenJS: CalendarButtonExampleCodepen
},
{
title: 'Month picker launched from a button',
code: CalendarButtonExampleCode,
view: (React.createElement(CalendarButtonExample, { isDayPickerVisible: false, highlightCurrentMonth: false, highlightSelectedMonth: true, buttonString: 'Click for Month Picker' }))
},
{
title: 'Calendar with overlayed month picker launched from a button',
code: CalendarButtonExampleCode,
view: (React.createElement(CalendarButtonExample, { showMonthPickerAsOverlay: true, highlightCurrentMonth: false, highlightSelectedMonth: true, buttonString: 'Click for Overlayed Day Picker and Month Picker' }))
},
{
title: 'Calendar with overlayed month picker launched from a button without show go to today button',
code: CalendarButtonExampleCode,
view: (React.createElement(CalendarButtonExample, { showMonthPickerAsOverlay: true, showGoToToday: false, highlightCurrentMonth: false, highlightSelectedMonth: true, buttonString: 'Click for Overlayed Day Picker and Month Picker without go to today button' }))
}
],
propertiesTablesSources: [
require('!raw-loader!office-ui-fabric-react/src/components/Calendar/Calendar.types.ts')
],
overview: require('!raw-loader!office-ui-fabric-react/src/components/Calendar/docs/CalendarOverview.md'),
bestPractices: '',
dos: require('!raw-loader!office-ui-fabric-react/src/components/Calendar/docs/CalendarDos.md'),
donts: require('!raw-loader!office-ui-fabric-react/src/components/Calendar/docs/CalendarDonts.md'),
isHeaderVisible: true,
isFeedbackVisible: true
};
//# sourceMappingURL=Calendar.doc.js.map