@fullcalendar/scrollgrid 7.0.0-beta.3 → 7.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md CHANGED
@@ -13,6 +13,6 @@ one of three licenses to use. Here is a summary of those licenses:
13
13
  (intended for trial and non-commercial use)
14
14
  https://creativecommons.org/licenses/by-nc-nd/4.0/
15
15
 
16
- - GPLv3 License
16
+ - AGPLv3 License
17
17
  (intended for open-source projects)
18
- http://www.gnu.org/licenses/gpl-3.0.en.html
18
+ https://www.gnu.org/licenses/agpl-3.0.en.html
package/index.cjs CHANGED
@@ -13,7 +13,7 @@ var premiumCommonPlugin__default = /*#__PURE__*/_interopDefaultLegacy(premiumCom
13
13
 
14
14
  var index = index_cjs.createPlugin({
15
15
  name: '@fullcalendar/scrollgrid',
16
- premiumReleaseDate: '2024-12-19',
16
+ premiumReleaseDate: '2025-02-21',
17
17
  deps: [premiumCommonPlugin__default["default"]],
18
18
  scrollerSyncerClass: internalCommon.ScrollerSyncer
19
19
  });
package/index.global.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar ScrollGrid Plugin v7.0.0-beta.3
2
+ FullCalendar ScrollGrid Plugin v7.0.0-rc.0
3
3
  Docs & License: https://fullcalendar.io/docs/premium
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -10,10 +10,6 @@ FullCalendar.ScrollGrid = (function (exports, core, premiumCommonPlugin, interna
10
10
 
11
11
  var premiumCommonPlugin__default = /*#__PURE__*/_interopDefault(premiumCommonPlugin);
12
12
 
13
- /*
14
- Fires:
15
- - scrollEnd: (x, y) => void
16
- */
17
13
  class ScrollerSyncer {
18
14
  constructor(isHorizontal = false) {
19
15
  this.isHorizontal = isHorizontal;
@@ -64,9 +60,9 @@ FullCalendar.ScrollGrid = (function (exports, core, premiumCommonPlugin, interna
64
60
  }
65
61
  bindScroller(scroller) {
66
62
  let { isHorizontal } = this;
67
- const onScroll = (isWheel, isTouch) => {
63
+ const onScroll = (isUser) => {
68
64
  if (!this.isPaused) {
69
- if (!this.masterScroller || (this.masterScroller !== scroller && (isWheel || isTouch))) {
65
+ if (!this.masterScroller || (this.masterScroller !== scroller && isUser)) {
70
66
  this.assignMaster(scroller);
71
67
  }
72
68
  if (this.masterScroller === scroller) { // dealing with current
@@ -84,10 +80,26 @@ FullCalendar.ScrollGrid = (function (exports, core, premiumCommonPlugin, interna
84
80
  }
85
81
  }
86
82
  };
87
- const onScrollEnd = () => {
83
+ const onScrollEnd = (isUser) => {
88
84
  if (this.masterScroller === scroller) {
89
85
  this.masterScroller = null;
90
- this.emitter.trigger('scrollEnd', this.x, this.y);
86
+ const { x, y } = this; // new values
87
+ let isMoved = false;
88
+ if (this.isHorizontal) {
89
+ if (x !== this.prevX) {
90
+ this.prevX = x;
91
+ isMoved = true;
92
+ }
93
+ }
94
+ else {
95
+ if (y !== this.prevY) {
96
+ this.prevY = y;
97
+ isMoved = true;
98
+ }
99
+ }
100
+ if (isMoved) {
101
+ this.emitter.trigger('scrollEnd', isUser);
102
+ }
91
103
  }
92
104
  };
93
105
  scroller.listener.emitter.on('scroll', onScroll);
@@ -109,7 +121,7 @@ FullCalendar.ScrollGrid = (function (exports, core, premiumCommonPlugin, interna
109
121
 
110
122
  var plugin = core.createPlugin({
111
123
  name: '@fullcalendar/scrollgrid',
112
- premiumReleaseDate: '2024-12-19',
124
+ premiumReleaseDate: '2025-02-21',
113
125
  deps: [premiumCommonPlugin__default["default"]],
114
126
  scrollerSyncerClass: ScrollerSyncer
115
127
  });
@@ -1,6 +1,6 @@
1
1
  /*!
2
- FullCalendar ScrollGrid Plugin v7.0.0-beta.3
2
+ FullCalendar ScrollGrid Plugin v7.0.0-rc.0
3
3
  Docs & License: https://fullcalendar.io/docs/premium
4
4
  (c) 2024 Adam Shaw
5
5
  */
6
- FullCalendar.ScrollGrid=function(r,s,l,e){"use strict";function t(r){return r&&r.__esModule?r:{default:r}}var o=t(l);class i{constructor(r=!1){this.isHorizontal=r,this.emitter=new e.Emitter,this.scrollers=[],this.destroyFuncs=[],this.isPaused=!1}handleChildren(r){if(!e.isArraysEqual(this.scrollers,r)){this.destroy();for(const s of r)s&&(this.destroyFuncs.push(this.bindScroller(s)),this.scrollers.push(s))}}destroy(){for(let r of this.destroyFuncs)r();this.destroyFuncs=[],this.scrollers=[]}get x(){const{scrollers:r,masterScroller:s}=this;return(s||r[0]).x}get y(){const{scrollers:r,masterScroller:s}=this;return(s||r[0]).y}scrollTo(r){this.isPaused=!0;const{scrollers:s}=this;for(let l of s)l.scrollTo(r);this.isPaused=!1}addScrollEndListener(r){this.emitter.on("scrollEnd",r)}removeScrollEndListener(r){this.emitter.off("scrollEnd",r)}bindScroller(r){let{isHorizontal:s}=this;const l=(l,e)=>{if(!this.isPaused&&((!this.masterScroller||this.masterScroller!==r&&(l||e))&&this.assignMaster(r),this.masterScroller===r))for(let l of this.scrollers)l!==r&&(s?l.scrollTo({x:r.x}):l.scrollTo({y:r.y}))},e=()=>{this.masterScroller===r&&(this.masterScroller=null,this.emitter.trigger("scrollEnd",this.x,this.y))};return r.listener.emitter.on("scroll",l),r.listener.emitter.on("scrollEnd",e),()=>{r.listener.emitter.off("scroll",l),r.listener.emitter.off("scrollEnd",e)}}assignMaster(r){this.masterScroller=r;for(let s of this.scrollers)s!==r&&s.endScroll()}}var n=s.createPlugin({name:"@fullcalendar/scrollgrid",premiumReleaseDate:"2024-12-19",deps:[o.default],scrollerSyncerClass:i}),c={__proto__:null,ScrollerSyncer:i};return s.globalPlugins.push(n),r.Internal=c,r.default=n,Object.defineProperty(r,"__esModule",{value:!0}),r}({},FullCalendar,FullCalendar.PremiumCommon,FullCalendar.Internal);
6
+ FullCalendar.ScrollGrid=function(r,s,e,l){"use strict";function t(r){return r&&r.__esModule?r:{default:r}}var o=t(e);class i{constructor(r=!1){this.isHorizontal=r,this.emitter=new l.Emitter,this.scrollers=[],this.destroyFuncs=[],this.isPaused=!1}handleChildren(r){if(!l.isArraysEqual(this.scrollers,r)){this.destroy();for(const s of r)s&&(this.destroyFuncs.push(this.bindScroller(s)),this.scrollers.push(s))}}destroy(){for(let r of this.destroyFuncs)r();this.destroyFuncs=[],this.scrollers=[]}get x(){const{scrollers:r,masterScroller:s}=this;return(s||r[0]).x}get y(){const{scrollers:r,masterScroller:s}=this;return(s||r[0]).y}scrollTo(r){this.isPaused=!0;const{scrollers:s}=this;for(let e of s)e.scrollTo(r);this.isPaused=!1}addScrollEndListener(r){this.emitter.on("scrollEnd",r)}removeScrollEndListener(r){this.emitter.off("scrollEnd",r)}bindScroller(r){let{isHorizontal:s}=this;const e=e=>{if(!this.isPaused&&((!this.masterScroller||this.masterScroller!==r&&e)&&this.assignMaster(r),this.masterScroller===r))for(let e of this.scrollers)e!==r&&(s?e.scrollTo({x:r.x}):e.scrollTo({y:r.y}))},l=s=>{if(this.masterScroller===r){this.masterScroller=null;const{x:r,y:e}=this;let l=!1;this.isHorizontal?r!==this.prevX&&(this.prevX=r,l=!0):e!==this.prevY&&(this.prevY=e,l=!0),l&&this.emitter.trigger("scrollEnd",s)}};return r.listener.emitter.on("scroll",e),r.listener.emitter.on("scrollEnd",l),()=>{r.listener.emitter.off("scroll",e),r.listener.emitter.off("scrollEnd",l)}}assignMaster(r){this.masterScroller=r;for(let s of this.scrollers)s!==r&&s.endScroll()}}var n=s.createPlugin({name:"@fullcalendar/scrollgrid",premiumReleaseDate:"2025-02-21",deps:[o.default],scrollerSyncerClass:i}),c={__proto__:null,ScrollerSyncer:i};return s.globalPlugins.push(n),r.Internal=c,r.default=n,Object.defineProperty(r,"__esModule",{value:!0}),r}({},FullCalendar,FullCalendar.PremiumCommon,FullCalendar.Internal);
package/index.js CHANGED
@@ -5,7 +5,7 @@ import '@fullcalendar/core/internal.js';
5
5
 
6
6
  var index = createPlugin({
7
7
  name: '@fullcalendar/scrollgrid',
8
- premiumReleaseDate: '2024-12-19',
8
+ premiumReleaseDate: '2025-02-21',
9
9
  deps: [premiumCommonPlugin],
10
10
  scrollerSyncerClass: ScrollerSyncer
11
11
  });
package/internal.cjs CHANGED
@@ -4,10 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var internal_cjs = require('@fullcalendar/core/internal.cjs');
6
6
 
7
- /*
8
- Fires:
9
- - scrollEnd: (x, y) => void
10
- */
11
7
  class ScrollerSyncer {
12
8
  constructor(isHorizontal = false) {
13
9
  this.isHorizontal = isHorizontal;
@@ -58,9 +54,9 @@ class ScrollerSyncer {
58
54
  }
59
55
  bindScroller(scroller) {
60
56
  let { isHorizontal } = this;
61
- const onScroll = (isWheel, isTouch) => {
57
+ const onScroll = (isUser) => {
62
58
  if (!this.isPaused) {
63
- if (!this.masterScroller || (this.masterScroller !== scroller && (isWheel || isTouch))) {
59
+ if (!this.masterScroller || (this.masterScroller !== scroller && isUser)) {
64
60
  this.assignMaster(scroller);
65
61
  }
66
62
  if (this.masterScroller === scroller) { // dealing with current
@@ -78,10 +74,26 @@ class ScrollerSyncer {
78
74
  }
79
75
  }
80
76
  };
81
- const onScrollEnd = () => {
77
+ const onScrollEnd = (isUser) => {
82
78
  if (this.masterScroller === scroller) {
83
79
  this.masterScroller = null;
84
- this.emitter.trigger('scrollEnd', this.x, this.y);
80
+ const { x, y } = this; // new values
81
+ let isMoved = false;
82
+ if (this.isHorizontal) {
83
+ if (x !== this.prevX) {
84
+ this.prevX = x;
85
+ isMoved = true;
86
+ }
87
+ }
88
+ else {
89
+ if (y !== this.prevY) {
90
+ this.prevY = y;
91
+ isMoved = true;
92
+ }
93
+ }
94
+ if (isMoved) {
95
+ this.emitter.trigger('scrollEnd', isUser);
96
+ }
85
97
  }
86
98
  };
87
99
  scroller.listener.emitter.on('scroll', onScroll);
package/internal.d.ts CHANGED
@@ -7,6 +7,8 @@ declare class ScrollerSyncer implements ScrollerSyncerInterface {
7
7
  private destroyFuncs;
8
8
  private masterScroller;
9
9
  private isPaused;
10
+ private prevX;
11
+ private prevY;
10
12
  constructor(isHorizontal?: boolean);
11
13
  handleChildren(scrollers: Scroller[]): void;
12
14
  destroy(): void;
@@ -16,8 +18,8 @@ declare class ScrollerSyncer implements ScrollerSyncerInterface {
16
18
  x?: number;
17
19
  y?: number;
18
20
  }): void;
19
- addScrollEndListener(handler: (x: number, y: number) => void): void;
20
- removeScrollEndListener(handler: (x: number, y: number) => void): void;
21
+ addScrollEndListener(handler: (isUser: boolean) => void): void;
22
+ removeScrollEndListener(handler: (isUser: boolean) => void): void;
21
23
  bindScroller(scroller: Scroller): () => void;
22
24
  assignMaster(masterScroller: Scroller): void;
23
25
  }
package/internal.js CHANGED
@@ -1,9 +1,5 @@
1
1
  import { Emitter, isArraysEqual } from '@fullcalendar/core/internal.js';
2
2
 
3
- /*
4
- Fires:
5
- - scrollEnd: (x, y) => void
6
- */
7
3
  class ScrollerSyncer {
8
4
  constructor(isHorizontal = false) {
9
5
  this.isHorizontal = isHorizontal;
@@ -54,9 +50,9 @@ class ScrollerSyncer {
54
50
  }
55
51
  bindScroller(scroller) {
56
52
  let { isHorizontal } = this;
57
- const onScroll = (isWheel, isTouch) => {
53
+ const onScroll = (isUser) => {
58
54
  if (!this.isPaused) {
59
- if (!this.masterScroller || (this.masterScroller !== scroller && (isWheel || isTouch))) {
55
+ if (!this.masterScroller || (this.masterScroller !== scroller && isUser)) {
60
56
  this.assignMaster(scroller);
61
57
  }
62
58
  if (this.masterScroller === scroller) { // dealing with current
@@ -74,10 +70,26 @@ class ScrollerSyncer {
74
70
  }
75
71
  }
76
72
  };
77
- const onScrollEnd = () => {
73
+ const onScrollEnd = (isUser) => {
78
74
  if (this.masterScroller === scroller) {
79
75
  this.masterScroller = null;
80
- this.emitter.trigger('scrollEnd', this.x, this.y);
76
+ const { x, y } = this; // new values
77
+ let isMoved = false;
78
+ if (this.isHorizontal) {
79
+ if (x !== this.prevX) {
80
+ this.prevX = x;
81
+ isMoved = true;
82
+ }
83
+ }
84
+ else {
85
+ if (y !== this.prevY) {
86
+ this.prevY = y;
87
+ isMoved = true;
88
+ }
89
+ }
90
+ if (isMoved) {
91
+ this.emitter.trigger('scrollEnd', isUser);
92
+ }
81
93
  }
82
94
  };
83
95
  scroller.listener.emitter.on('scroll', onScroll);
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@fullcalendar/scrollgrid",
3
- "version": "7.0.0-beta.3",
3
+ "version": "7.0.0-rc.0",
4
4
  "title": "FullCalendar ScrollGrid Plugin",
5
5
  "description": "Tabular data chunked into scrollable panes",
6
6
  "dependencies": {
7
- "@fullcalendar/premium-common": "7.0.0-beta.3"
7
+ "@fullcalendar/premium-common": "7.0.0-rc.0"
8
8
  },
9
9
  "peerDependencies": {
10
- "@fullcalendar/core": "7.0.0-beta.3"
10
+ "@fullcalendar/core": "7.0.0-rc.0"
11
11
  },
12
12
  "type": "module",
13
13
  "keywords": [