options.ts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. import { mergeProps } from './util/object'
  2. export const globalDefaults = {
  3. titleRangeSeparator: ' \u2013 ', // en dash
  4. defaultTimedEventDuration: '02:00:00',
  5. defaultAllDayEventDuration: { day: 1 },
  6. forceEventDuration: false,
  7. nextDayThreshold: '09:00:00', // 9am
  8. // display
  9. columnHeader: true,
  10. defaultView: 'month',
  11. aspectRatio: 1.35,
  12. header: {
  13. left: 'title',
  14. center: '',
  15. right: 'today prev,next'
  16. },
  17. weekends: true,
  18. weekNumbers: false,
  19. weekNumberCalculation: 'local',
  20. // editable: false,
  21. // nowIndicator: false,
  22. scrollTime: '06:00:00',
  23. minTime: '00:00:00',
  24. maxTime: '24:00:00',
  25. showNonCurrentDates: true,
  26. // event ajax
  27. lazyFetching: true,
  28. startParam: 'start',
  29. endParam: 'end',
  30. timezoneParam: 'timezone',
  31. timezone: 'UTC', // TODO: throw error if given falsy value?
  32. // allDayDefault: undefined,
  33. // locale
  34. locale: 'en',
  35. isRTL: false,
  36. // buttonIcons: null,
  37. // allows setting a min-height to the event segment to prevent short events overlapping each other
  38. agendaEventMinHeight: 0,
  39. // jquery-ui theming
  40. theme: false,
  41. // themeButtonIcons: null,
  42. // eventResizableFromStart: false,
  43. dragOpacity: .75,
  44. dragRevertDuration: 500,
  45. dragScroll: true,
  46. // selectable: false,
  47. unselectAuto: true,
  48. // selectMinDistance: 0,
  49. dropAccept: '*',
  50. eventOrder: 'title',
  51. // eventRenderWait: null,
  52. eventLimit: false,
  53. eventLimitClick: 'popover',
  54. dayPopoverFormat: { month: 'long', day: 'numeric', year: 'numeric' },
  55. handleWindowResize: true,
  56. windowResizeDelay: 100, // milliseconds before an updateSize happens
  57. longPressDelay: 1000
  58. }
  59. export const rtlDefaults = { // right-to-left defaults
  60. header: { // TODO: smarter solution (first/center/last ?)
  61. left: 'next,prev today',
  62. center: '',
  63. right: 'title'
  64. },
  65. buttonIcons: {
  66. prev: 'right-single-arrow',
  67. next: 'left-single-arrow',
  68. prevYear: 'right-double-arrow',
  69. nextYear: 'left-double-arrow'
  70. },
  71. themeButtonIcons: {
  72. prev: 'circle-triangle-e',
  73. next: 'circle-triangle-w',
  74. nextYear: 'seek-prev',
  75. prevYear: 'seek-next'
  76. }
  77. }
  78. let complexOptions = [ // names of options that are objects whose properties should be combined
  79. 'header',
  80. 'footer',
  81. 'buttonText',
  82. 'buttonIcons',
  83. 'themeButtonIcons'
  84. ]
  85. // Merges an array of option objects into a single object
  86. export function mergeOptions(optionObjs) {
  87. return mergeProps(optionObjs, complexOptions)
  88. }