Sfoglia il codice sorgente

rename sticky setting names

Adam Shaw 5 anni fa
parent
commit
d92ca50214

+ 2 - 2
examples/timeline-sticky-header.html

@@ -11,8 +11,8 @@
 
     var calendar = new FullCalendar.Calendar(calendarEl, {
       height: 'auto', // enough to active sticky headers
-      // stickyHeader: false,
-      // stickyFooter: false,
+      // stickyHeaderDates: false,
+      // stickyFooterScrollbar: false,
 
       now: '2020-02-07',
       scrollTime: '00:00', // undo default 6am scrollTime

+ 1 - 1
packages-premium

@@ -1 +1 @@
-Subproject commit 4ac058072826eeaa999e752c0d98d0d0e2879dd9
+Subproject commit c49d94e2934ef52817c9baf54c0f25680b22d504

+ 2 - 2
packages/core/src/main.ts

@@ -180,8 +180,8 @@ export {
   ChunkConfigRowContent, ChunkConfigContent,
   isColPropsEqual,
   renderScrollShim,
-  getStickyFooter,
-  getStickyHeader
+  getStickyFooterScrollbar,
+  getStickyHeaderDates
 } from './scrollgrid/util'
 export { default as Scroller, ScrollerProps, OverflowValue } from './scrollgrid/Scroller'
 export { getScrollbarWidths } from './util/scrollbar-width'

+ 10 - 10
packages/core/src/scrollgrid/util.tsx

@@ -200,23 +200,23 @@ export function renderScrollShim(arg: ChunkContentCallbackArgs) {
 }
 
 
-export function getStickyHeader(options) {
-  let { stickyHeader } = options
+export function getStickyHeaderDates(options) {
+  let { stickyHeaderDates } = options
 
-  if (stickyHeader == null || stickyHeader === 'auto') {
-    stickyHeader = options.height === 'auto' || options.viewHeight === 'auto'
+  if (stickyHeaderDates == null || stickyHeaderDates === 'auto') {
+    stickyHeaderDates = options.height === 'auto' || options.viewHeight === 'auto'
   }
 
-  return stickyHeader
+  return stickyHeaderDates
 }
 
 
-export function getStickyFooter(options) {
-  let { stickyFooter } = options
+export function getStickyFooterScrollbar(options) {
+  let { stickyFooterScrollbar } = options
 
-  if (stickyFooter == null || stickyFooter === 'auto') {
-    stickyFooter = options.height === 'auto' || options.viewHeight === 'auto'
+  if (stickyFooterScrollbar == null || stickyFooterScrollbar === 'auto') {
+    stickyFooterScrollbar = options.height === 'auto' || options.viewHeight === 'auto'
   }
 
-  return stickyFooter
+  return stickyFooterScrollbar
 }

+ 8 - 8
packages/daygrid/src/TableView.tsx

@@ -10,8 +10,8 @@ import {
   ViewProps,
   RefObject,
   renderScrollShim,
-  getStickyHeader,
-  getStickyFooter
+  getStickyHeaderDates,
+  getStickyFooterScrollbar
 } from '@fullcalendar/core'
 
 
@@ -32,12 +32,12 @@ export default abstract class TableView<State={}> extends DateComponent<ViewProp
   ) {
     let { props, context } = this
     let sections: SimpleScrollGridSection[] = []
-    let stickyHeader = getStickyHeader(context.options)
+    let stickyHeaderDates = getStickyHeaderDates(context.options)
 
     if (headerRowContent) {
       sections.push({
         type: 'head',
-        isSticky: stickyHeader,
+        isSticky: stickyHeaderDates,
         chunk: {
           elRef: this.headerElRef,
           tableClassName: 'fc-col-header',
@@ -82,14 +82,14 @@ export default abstract class TableView<State={}> extends DateComponent<ViewProp
     }
 
     let { props, context } = this
-    let stickyHeader = getStickyHeader(context.options)
-    let stickyFooter = getStickyFooter(context.options)
+    let stickyHeaderDates = getStickyHeaderDates(context.options)
+    let stickyFooterScrollbar = getStickyFooterScrollbar(context.options)
     let sections: ScrollGridSectionConfig[] = []
 
     if (headerRowContent) {
       sections.push({
         type: 'head',
-        isSticky: stickyHeader,
+        isSticky: stickyHeaderDates,
         chunks: [{
           elRef: this.headerElRef,
           tableClassName: 'fc-col-header',
@@ -106,7 +106,7 @@ export default abstract class TableView<State={}> extends DateComponent<ViewProp
       }]
     })
 
-    if (stickyFooter) {
+    if (stickyFooterScrollbar) {
       sections.push({
         type: 'foot',
         isSticky: true,

+ 1 - 1
packages/list/src/ListView.tsx

@@ -40,7 +40,7 @@ export default class ListView extends DateComponent<ViewProps> {
     let extraClassNames = [
       'fc-list',
       context.theme.getClass('bordered'),
-      context.options.stickyHeader !== false ? 'fc-list-sticky' : ''
+      context.options.stickyHeaderDates !== false ? 'fc-list-sticky' : ''
     ]
 
     let { dayDates, dayRanges } = this.computeDateVars(props.dateProfile)

+ 8 - 8
packages/timegrid/src/TimeColsView.tsx

@@ -15,8 +15,8 @@ import {
   ViewProps,
   RefObject,
   renderScrollShim,
-  getStickyHeader,
-  getStickyFooter
+  getStickyHeaderDates,
+  getStickyFooterScrollbar
 } from '@fullcalendar/core'
 import AllDaySplitter from './AllDaySplitter'
 import { TimeSlatMeta, TimeColsAxisCell } from './TimeColsSlats'
@@ -51,12 +51,12 @@ export default abstract class TimeColsView extends DateComponent<ViewProps> {
   ) {
     let { context, props } = this
     let sections: SimpleScrollGridSection[] = []
-    let stickyHeader = getStickyHeader(context.options)
+    let stickyHeaderDates = getStickyHeaderDates(context.options)
 
     if (headerRowContent) {
       sections.push({
         type: 'head',
-        isSticky: stickyHeader,
+        isSticky: stickyHeaderDates,
         chunk: {
           elRef: this.headerElRef,
           tableClassName: 'fc-col-header',
@@ -125,14 +125,14 @@ export default abstract class TimeColsView extends DateComponent<ViewProps> {
     }
 
     let { context, props } = this
-    let stickyHeader = getStickyHeader(context.options)
-    let stickyFooter = getStickyFooter(context.options)
+    let stickyHeaderDates = getStickyHeaderDates(context.options)
+    let stickyFooterScrollbar = getStickyFooterScrollbar(context.options)
     let sections: ScrollGridSectionConfig[] = []
 
     if (headerRowContent) {
       sections.push({
         type: 'head',
-        isSticky: stickyHeader,
+        isSticky: stickyHeaderDates,
         chunks: [
           {
             rowContent: <tr>{this.renderHeadAxis()}</tr>
@@ -190,7 +190,7 @@ export default abstract class TimeColsView extends DateComponent<ViewProps> {
       ]
     })
 
-    if (stickyFooter) {
+    if (stickyFooterScrollbar) {
       sections.push({
         key: 'scroll',
         type: 'foot',