Adam Shaw 8 лет назад
Родитель
Сommit
ae907ece21

+ 1 - 1
src/Toolbar.ts

@@ -9,7 +9,7 @@ export default class Toolbar {
 
 
   calendar: any
   calendar: any
   toolbarOptions: any
   toolbarOptions: any
-  el: any = null // mirrors local `el`
+  el: JQuery = null // mirrors local `el`
   viewsWithButtons: any = []
   viewsWithButtons: any = []
 
 
 
 

+ 13 - 13
src/agenda/TimeGrid.ts

@@ -47,25 +47,25 @@ export default class TimeGrid extends InteractiveDateComponent {
   labelFormat: any // formatting string for times running along vertical axis
   labelFormat: any // formatting string for times running along vertical axis
   labelInterval: any // duration of how often a label should be displayed for a slot
   labelInterval: any // duration of how often a label should be displayed for a slot
 
 
-  headContainerEl: any // div that hold's the date header
-  colEls: any // cells elements in the day-row background
-  slatContainerEl: any // div that wraps all the slat rows
-  slatEls: any // elements running horizontally across all columns
-  nowIndicatorEls: any
+  headContainerEl: JQuery // div that hold's the date header
+  colEls: JQuery // cells elements in the day-row background
+  slatContainerEl: JQuery // div that wraps all the slat rows
+  slatEls: JQuery // elements running horizontally across all columns
+  nowIndicatorEls: JQuery
 
 
   colCoordCache: any
   colCoordCache: any
   slatCoordCache: any
   slatCoordCache: any
 
 
-  bottomRuleEl: any // hidden by default
-  contentSkeletonEl: any
-  colContainerEls: any // containers for each column
+  bottomRuleEl: JQuery // hidden by default
+  contentSkeletonEl: JQuery
+  colContainerEls: JQuery // containers for each column
 
 
   // inner-containers for each column where different types of segs live
   // inner-containers for each column where different types of segs live
-  fgContainerEls: any
-  bgContainerEls: any
-  helperContainerEls: any
-  highlightContainerEls: any
-  businessContainerEls: any
+  fgContainerEls: JQuery
+  bgContainerEls: JQuery
+  helperContainerEls: JQuery
+  highlightContainerEls: JQuery
+  businessContainerEls: JQuery
 
 
   // arrays of different types of displayed segments
   // arrays of different types of displayed segments
   helperSegs: any
   helperSegs: any

+ 3 - 3
src/basic/DayGrid.ts

@@ -39,9 +39,9 @@ export default class DayGrid extends InteractiveDateComponent {
 
 
   bottomCoordPadding: number = 0 // hack for extending the hit area for the last row of the coordinate grid
   bottomCoordPadding: number = 0 // hack for extending the hit area for the last row of the coordinate grid
 
 
-  headContainerEl: any // div that hold's the date header
-  rowEls: any // set of fake row elements
-  cellEls: any // set of whole-day elements comprising the row's background
+  headContainerEl: JQuery // div that hold's the date header
+  rowEls: JQuery // set of fake row elements
+  cellEls: JQuery // set of whole-day elements comprising the row's background
 
 
   rowCoordCache: any
   rowCoordCache: any
   colCoordCache: any
   colCoordCache: any

+ 2 - 2
src/common/CoordCache.ts

@@ -12,8 +12,8 @@ options:
 */
 */
 export default class CoordCache {
 export default class CoordCache {
 
 
-  els: any // jQuery set (assumed to be siblings)
-  forcedOffsetParentEl: any // options can override the natural offsetParent
+  els: JQuery // jQuery set (assumed to be siblings)
+  forcedOffsetParentEl: JQuery // options can override the natural offsetParent
   origin: any // {left,top} position of offsetParent of els
   origin: any // {left,top} position of offsetParent of els
   boundingRect: any // constrain cordinates to this rectangle. {left,right,top,bottom} or null
   boundingRect: any // constrain cordinates to this rectangle. {left,right,top,bottom} or null
   isHorizontal: boolean = false // whether to query for left/right/width
   isHorizontal: boolean = false // whether to query for left/right/width

+ 3 - 3
src/common/DragListener.ts

@@ -26,9 +26,9 @@ export default class DragListener {
   listenTo: ListenerInterface['listenTo']
   listenTo: ListenerInterface['listenTo']
   stopListeningTo: ListenerInterface['stopListeningTo']
   stopListeningTo: ListenerInterface['stopListeningTo']
 
 
-  $document: any
+  $document: JQuery
   options: any
   options: any
-  subjectEl: any
+  subjectEl: JQuery
 
 
   // coordinates of the initial mousedown
   // coordinates of the initial mousedown
   originX: any
   originX: any
@@ -36,7 +36,7 @@ export default class DragListener {
 
 
   // the wrapping element that scrolls, or MIGHT scroll if there's overflow.
   // the wrapping element that scrolls, or MIGHT scroll if there's overflow.
   // TODO: do this for wrappers that have overflow:hidden as well.
   // TODO: do this for wrappers that have overflow:hidden as well.
-  scrollEl: any
+  scrollEl: JQuery
 
 
   isInteracting: boolean = false
   isInteracting: boolean = false
   isDistanceSurpassed: boolean = false
   isDistanceSurpassed: boolean = false

+ 3 - 3
src/common/MouseFollower.ts

@@ -16,9 +16,9 @@ export default class MouseFollower {
 
 
   options: any
   options: any
 
 
-  sourceEl: any // the element that will be cloned and made to look like it is dragging
-  el: any // the clone of `sourceEl` that will track the mouse
-  parentEl: any // the element that `el` (the clone) will be attached to
+  sourceEl: JQuery // the element that will be cloned and made to look like it is dragging
+  el: JQuery // the clone of `sourceEl` that will track the mouse
+  parentEl: JQuery // the element that `el` (the clone) will be attached to
 
 
   // the initial position of el, relative to the offset parent. made to match the initial offset of sourceEl
   // the initial position of el, relative to the offset parent. made to match the initial offset of sourceEl
   top0: any
   top0: any

+ 1 - 1
src/common/Popover.ts

@@ -25,7 +25,7 @@ export default class Popover {
 
 
   isHidden: boolean = true
   isHidden: boolean = true
   options: any
   options: any
-  el: any // the container element for the popover. generated by this object
+  el: JQuery // the container element for the popover. generated by this object
   margin: number = 10 // the space required between the popover and the edges of the scroll container
   margin: number = 10 // the space required between the popover and the edges of the scroll container
 
 
 
 

+ 2 - 2
src/common/Scroller.ts

@@ -7,8 +7,8 @@ Embodies a div that has potential scrollbars
 */
 */
 export default class Scroller extends Class {
 export default class Scroller extends Class {
 
 
-  el: any // the guaranteed outer element
-  scrollEl: any // the element with the scrollbars
+  el: JQuery // the guaranteed outer element
+  scrollEl: JQuery // the element with the scrollbars
   overflowX: any
   overflowX: any
   overflowY: any
   overflowY: any
 
 

+ 1 - 1
src/component/Component.ts

@@ -2,7 +2,7 @@ import Model from '../common/Model'
 
 
 export default class Component extends Model {
 export default class Component extends Model {
 
 
-  el: any
+  el: JQuery
 
 
 
 
   setElement(el) {
   setElement(el) {

+ 3 - 5
src/component/renderers/HelperRenderer.ts

@@ -3,12 +3,12 @@ import EventFootprint from '../../models/event/EventFootprint'
 import EventSource from '../../models/event-source/EventSource'
 import EventSource from '../../models/event-source/EventSource'
 
 
 
 
-export default class HelperRenderer {
+export default abstract class HelperRenderer {
 
 
   view: any
   view: any
   component: any
   component: any
   eventRenderer: any
   eventRenderer: any
-  helperEls: any
+  helperEls: JQuery
 
 
 
 
   constructor(component, eventRenderer) {
   constructor(component, eventRenderer) {
@@ -69,9 +69,7 @@ export default class HelperRenderer {
   /*
   /*
   Must return all mock event elements
   Must return all mock event elements
   */
   */
-  renderSegs(segs, sourceSeg?) {
-    // Subclasses must implement
-  }
+  abstract renderSegs(segs, sourceSeg?): JQuery
 
 
 
 
   unrender() {
   unrender() {

+ 1 - 1
src/list/ListView.ts

@@ -18,7 +18,7 @@ export default class ListView extends View {
   segSelector: any = '.fc-list-item' // which elements accept event actions
   segSelector: any = '.fc-list-item' // which elements accept event actions
 
 
   scroller: any
   scroller: any
-  contentEl: any
+  contentEl: JQuery
 
 
   dayDates: any // localized ambig-time moment array
   dayDates: any // localized ambig-time moment array
   dayRanges: any // UnzonedRange[], of start-end of each day
   dayRanges: any // UnzonedRange[], of start-end of each day

+ 14 - 14
src/util.ts

@@ -8,7 +8,7 @@ import * as $ from 'jquery'
 
 
 // Given the scrollbar widths of some other container, create borders/margins on rowEls in order to match the left
 // Given the scrollbar widths of some other container, create borders/margins on rowEls in order to match the left
 // and right space that was offset by the scrollbars. A 1-pixel border first, then margin beyond that.
 // and right space that was offset by the scrollbars. A 1-pixel border first, then margin beyond that.
-export function compensateScroll(rowEls, scrollbarWidths) {
+export function compensateScroll(rowEls: JQuery, scrollbarWidths) {
   if (scrollbarWidths.left) {
   if (scrollbarWidths.left) {
     rowEls.css({
     rowEls.css({
       'border-left-width': 1,
       'border-left-width': 1,
@@ -25,7 +25,7 @@ export function compensateScroll(rowEls, scrollbarWidths) {
 
 
 
 
 // Undoes compensateScroll and restores all borders/margins
 // Undoes compensateScroll and restores all borders/margins
-export function uncompensateScroll(rowEls) {
+export function uncompensateScroll(rowEls: JQuery) {
   rowEls.css({
   rowEls.css({
     'margin-left': '',
     'margin-left': '',
     'margin-right': '',
     'margin-right': '',
@@ -51,7 +51,7 @@ export function enableCursor() {
 // By default, all elements that are shorter than the recommended height are expanded uniformly, not considering
 // By default, all elements that are shorter than the recommended height are expanded uniformly, not considering
 // any other els that are already too tall. if `shouldRedistribute` is on, it considers these tall rows and
 // any other els that are already too tall. if `shouldRedistribute` is on, it considers these tall rows and
 // reduces the available height.
 // reduces the available height.
-export function distributeHeight(els, availableHeight, shouldRedistribute) {
+export function distributeHeight(els: JQuery, availableHeight, shouldRedistribute) {
 
 
   // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,
   // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,
   // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.
   // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.
@@ -103,7 +103,7 @@ export function distributeHeight(els, availableHeight, shouldRedistribute) {
 
 
 
 
 // Undoes distrubuteHeight, restoring all els to their natural height
 // Undoes distrubuteHeight, restoring all els to their natural height
-export function undistributeHeight(els) {
+export function undistributeHeight(els: JQuery) {
   els.height('')
   els.height('')
 }
 }
 
 
@@ -111,7 +111,7 @@ export function undistributeHeight(els) {
 // Given `els`, a jQuery set of <td> cells, find the cell with the largest natural width and set the widths of all the
 // Given `els`, a jQuery set of <td> cells, find the cell with the largest natural width and set the widths of all the
 // cells to be that width.
 // cells to be that width.
 // PREREQUISITE: if you want a cell to take up width, it needs to have a single inner element w/ display:inline
 // PREREQUISITE: if you want a cell to take up width, it needs to have a single inner element w/ display:inline
-export function matchCellWidths(els) {
+export function matchCellWidths(els: JQuery) {
   let maxInnerWidth = 0
   let maxInnerWidth = 0
 
 
   els.find('> *').each(function(i, innerEl) {
   els.find('> *').each(function(i, innerEl) {
@@ -131,7 +131,7 @@ export function matchCellWidths(els) {
 
 
 // Given one element that resides inside another,
 // Given one element that resides inside another,
 // Subtracts the height of the inner element from the outer element.
 // Subtracts the height of the inner element from the outer element.
-export function subtractInnerElHeight(outerEl, innerEl) {
+export function subtractInnerElHeight(outerEl: JQuery, innerEl: JQuery) {
   let both = outerEl.add(innerEl)
   let both = outerEl.add(innerEl)
   let diff
   let diff
 
 
@@ -152,7 +152,7 @@ export function subtractInnerElHeight(outerEl, innerEl) {
 
 
 
 
 // borrowed from https://github.com/jquery/jquery-ui/blob/1.11.0/ui/core.js#L51
 // borrowed from https://github.com/jquery/jquery-ui/blob/1.11.0/ui/core.js#L51
-export function getScrollParent(el) {
+export function getScrollParent(el: JQuery) {
   let position = el.css('position')
   let position = el.css('position')
   let scrollParent = el.parents().filter(function() {
   let scrollParent = el.parents().filter(function() {
     let parent = $(this)
     let parent = $(this)
@@ -168,7 +168,7 @@ export function getScrollParent(el) {
 // Queries the outer bounding area of a jQuery element.
 // Queries the outer bounding area of a jQuery element.
 // Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive).
 // Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive).
 // Origin is optional.
 // Origin is optional.
-export function getOuterRect(el, origin?) {
+export function getOuterRect(el: JQuery, origin?) {
   let offset = el.offset()
   let offset = el.offset()
   let left = offset.left - (origin ? origin.left : 0)
   let left = offset.left - (origin ? origin.left : 0)
   let top = offset.top - (origin ? origin.top : 0)
   let top = offset.top - (origin ? origin.top : 0)
@@ -187,7 +187,7 @@ export function getOuterRect(el, origin?) {
 // Origin is optional.
 // Origin is optional.
 // WARNING: given element can't have borders
 // WARNING: given element can't have borders
 // NOTE: should use clientLeft/clientTop, but very unreliable cross-browser.
 // NOTE: should use clientLeft/clientTop, but very unreliable cross-browser.
-export function getClientRect(el, origin?) {
+export function getClientRect(el: JQuery, origin?) {
   let offset = el.offset()
   let offset = el.offset()
   let scrollbarWidths = getScrollbarWidths(el)
   let scrollbarWidths = getScrollbarWidths(el)
   let left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left - (origin ? origin.left : 0)
   let left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left - (origin ? origin.left : 0)
@@ -205,7 +205,7 @@ export function getClientRect(el, origin?) {
 // Queries the area within the margin/border/padding of a jQuery element. Assumed not to have scrollbars.
 // Queries the area within the margin/border/padding of a jQuery element. Assumed not to have scrollbars.
 // Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive).
 // Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive).
 // Origin is optional.
 // Origin is optional.
-export function getContentRect(el, origin) {
+export function getContentRect(el: JQuery, origin) {
   let offset = el.offset() // just outside of border, margin not included
   let offset = el.offset() // just outside of border, margin not included
   let left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left') -
   let left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left') -
     (origin ? origin.left : 0)
     (origin ? origin.left : 0)
@@ -224,7 +224,7 @@ export function getContentRect(el, origin) {
 // Returns the computed left/right/top/bottom scrollbar widths for the given jQuery element.
 // Returns the computed left/right/top/bottom scrollbar widths for the given jQuery element.
 // WARNING: given element can't have borders (which will cause offsetWidth/offsetHeight to be larger).
 // WARNING: given element can't have borders (which will cause offsetWidth/offsetHeight to be larger).
 // NOTE: should use clientLeft/clientTop, but very unreliable cross-browser.
 // NOTE: should use clientLeft/clientTop, but very unreliable cross-browser.
-export function getScrollbarWidths(el) {
+export function getScrollbarWidths(el: JQuery) {
   let leftRightWidth = el[0].offsetWidth - el[0].clientWidth
   let leftRightWidth = el[0].offsetWidth - el[0].clientWidth
   let bottomWidth = el[0].offsetHeight - el[0].clientHeight
   let bottomWidth = el[0].offsetHeight - el[0].clientHeight
   let widths
   let widths
@@ -285,7 +285,7 @@ function computeIsLeftRtlScrollbars() { // creates an offscreen test element, th
 
 
 // Retrieves a jQuery element's computed CSS value as a floating-point number.
 // Retrieves a jQuery element's computed CSS value as a floating-point number.
 // If the queried value is non-numeric (ex: IE can return "medium" for border width), will just return zero.
 // If the queried value is non-numeric (ex: IE can return "medium" for border width), will just return zero.
-function getCssFloat(el, prop) {
+function getCssFloat(el: JQuery, prop) {
   return parseFloat(el.css(prop)) || 0
   return parseFloat(el.css(prop)) || 0
 }
 }
 
 
@@ -331,13 +331,13 @@ export function getEvIsTouch(ev) {
 }
 }
 
 
 
 
-export function preventSelection(el) {
+export function preventSelection(el: JQuery) {
   el.addClass('fc-unselectable')
   el.addClass('fc-unselectable')
     .on('selectstart', preventDefault)
     .on('selectstart', preventDefault)
 }
 }
 
 
 
 
-export function allowSelection(el) {
+export function allowSelection(el: JQuery) {
   el.removeClass('fc-unselectable')
   el.removeClass('fc-unselectable')
     .off('selectstart', preventDefault)
     .off('selectstart', preventDefault)
 }
 }