Socket
Socket
Sign inDemoInstall

gantt-schedule-timeline-calendar

Package Overview
Dependencies
0
Maintainers
1
Versions
476
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.33.1 to 3.33.2

9

CHANGELOG.md

@@ -0,1 +1,8 @@

## [3.33.2]
- time bookmarks sometimes disappear without a reason bugfix
- fixed `api.time.getGlobalOffsetPxFromDates`
- performance optimization when all of the items are out of the view (on the left side or on the right side)
- `time.leftGlobal` was calculated based on centerDate, which was no longer available due to a change in dates bugfix
## [3.33.1]

@@ -79,3 +86,3 @@

- there was a bug when gstc wanted to save dates to cache but cache was not ready for that ¯\\\_(ツ)\_/¯
- there was a bug when gstc wanted to save dates to cache but cache was not ready for that

@@ -82,0 +89,0 @@ ## [3.26.0]

@@ -80,2 +80,3 @@ /**

setItemDataOutOfView(itemData: ItemData, time?: DataChartTime): ItemData;
areAllItemsOutOfView(items?: Items, time?: DataChartTime): boolean;
calculateItemHorizontalPosition(itemId: string, itemData?: ItemData, rowData?: RowData, time?: DataChartTime, item?: Item): ItemDataPosition;

@@ -82,0 +83,0 @@ calculateItemPosition(itemId: string, itemData?: ItemData, rowData?: RowData, time?: DataChartTime, item?: Item): ItemDataPosition;

@@ -86,2 +86,3 @@ /**

dependant?: string[];
dependsOn?: string[];
visible?: boolean;

@@ -88,0 +89,0 @@ inView?: boolean;

@@ -86,2 +86,3 @@ /**

dependant?: string[];
dependsOn?: string[];
visible?: boolean;

@@ -88,0 +89,0 @@ inView?: boolean;

@@ -86,2 +86,3 @@ /**

dependant?: string[];
dependsOn?: string[];
visible?: boolean;

@@ -88,0 +89,0 @@ inView?: boolean;

@@ -86,2 +86,3 @@ /**

dependant?: string[];
dependsOn?: string[];
visible?: boolean;

@@ -88,0 +89,0 @@ inView?: boolean;

@@ -86,2 +86,3 @@ /**

dependant?: string[];
dependsOn?: string[];
visible?: boolean;

@@ -88,0 +89,0 @@ inView?: boolean;

4

dist/plugins/calendar-scroll.esm.min.js

@@ -9,6 +9,6 @@ /**

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE
*/
const t={enabled:!0,bodyClassName:"gstc-scrolling"};function e(e=t){let i,n,o,s=e.enabled;class r{constructor(t){this.moving=!1,this.initialDataIndex={x:0,y:0},this.pointerDown=this.pointerDown.bind(this),this.pointerUp=this.pointerUp.bind(this),this.destroy=this.destroy.bind(this),this.pointerMove=i.schedule(this.pointerMove.bind(this)),t.addEventListener("pointerdown",this.pointerDown),document.addEventListener("pointermove",this.pointerMove,{passive:!0}),document.addEventListener("pointerup",this.pointerUp),t.style.cursor="grab"}destroy(t){t.removeEventListener("pointerdown",this.pointerDown),document.removeEventListener("pointermove",this.pointerMove),document.removeEventListener("pointerup",this.pointerUp)}resetInitialPoint(t){this.initialPoint={x:t.screenX,y:t.screenY}}pointerDown(t){if(!s)return;document.body.classList.add(e.bodyClassName),this.moving=!0,this.resetInitialPoint(t);const i=o.get("$data.scroll");this.initialDataIndex={x:i.horizontal.dataIndex||0,y:i.vertical.dataIndex||0}}pointerUp(){s&&(document.body.classList.remove(e.bodyClassName),this.moving&&(this.moving=!1))}handleHorizontalMovement(t,e){const i=o.get("$data.chart.time");if(t.x>0){if(0===this.initialDataIndex.x)return this.resetInitialPoint(e);const o=i.allDates[i.level];let s=this.initialDataIndex.x-1,r=0;for(;s>0;s--){if(r+=o[s].width,r>=t.x)break}n.setScrollLeft(s)}else if(t.x<0){let s=this.initialDataIndex.x;const r=o.get("$data.scroll.horizontal"),a=i.allDates[i.level];if(s-1>=a.length-r.lastPageCount)return this.resetInitialPoint(e);let l=0;for(let e=a.length;s<e;s++){if(l+=a[s].width,-l<=t.x)break}if(s-1>=a.length-r.lastPageCount)return;n.setScrollLeft(s)}}pointerMove(t){if(!s||!this.moving)return;const e={x:t.screenX-this.initialPoint.x,y:t.screenY-this.initialPoint.y};this.handleHorizontalMovement(e,t)}}return function(t){i=t,n=i.api,o=i.state;const a="config.plugin.CalendarScroll",l=t.state.get(a);return l&&(e=n.mergeDeep({},e,l)),o.update(a,e),o.subscribe("config.plugin.CalendarScroll.enabled",(t=>s=t)),o.update("config.actions.chart-calendar",(t=>(t.push(r),t))),n.pluginInitialized("CalendarScroll"),function(){o.update("config.actions.chart-calendar",(t=>t.filter((t=>t!==r)))),n.pluginDestroyed("CalendarScroll")}}}export{e as Plugin};

@@ -10,5 +10,5 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).CalendarScroll={})}(this,(function(t){"use strict";

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE
*/const e={enabled:!0,bodyClassName:"gstc-scrolling"};t.Plugin=function(t=e){let i,n,o,s=t.enabled;class r{constructor(t){this.moving=!1,this.initialDataIndex={x:0,y:0},this.pointerDown=this.pointerDown.bind(this),this.pointerUp=this.pointerUp.bind(this),this.destroy=this.destroy.bind(this),this.pointerMove=i.schedule(this.pointerMove.bind(this)),t.addEventListener("pointerdown",this.pointerDown),document.addEventListener("pointermove",this.pointerMove,{passive:!0}),document.addEventListener("pointerup",this.pointerUp),t.style.cursor="grab"}destroy(t){t.removeEventListener("pointerdown",this.pointerDown),document.removeEventListener("pointermove",this.pointerMove),document.removeEventListener("pointerup",this.pointerUp)}resetInitialPoint(t){this.initialPoint={x:t.screenX,y:t.screenY}}pointerDown(e){if(!s)return;document.body.classList.add(t.bodyClassName),this.moving=!0,this.resetInitialPoint(e);const i=o.get("$data.scroll");this.initialDataIndex={x:i.horizontal.dataIndex||0,y:i.vertical.dataIndex||0}}pointerUp(){s&&(document.body.classList.remove(t.bodyClassName),this.moving&&(this.moving=!1))}handleHorizontalMovement(t,e){const i=o.get("$data.chart.time");if(t.x>0){if(0===this.initialDataIndex.x)return this.resetInitialPoint(e);const o=i.allDates[i.level];let s=this.initialDataIndex.x-1,r=0;for(;s>0;s--){if(r+=o[s].width,r>=t.x)break}n.setScrollLeft(s)}else if(t.x<0){let s=this.initialDataIndex.x;const r=o.get("$data.scroll.horizontal"),a=i.allDates[i.level];if(s-1>=a.length-r.lastPageCount)return this.resetInitialPoint(e);let l=0;for(let e=a.length;s<e;s++){if(l+=a[s].width,-l<=t.x)break}if(s-1>=a.length-r.lastPageCount)return;n.setScrollLeft(s)}}pointerMove(t){if(!s||!this.moving)return;const e={x:t.screenX-this.initialPoint.x,y:t.screenY-this.initialPoint.y};this.handleHorizontalMovement(e,t)}}return function(e){i=e,n=i.api,o=i.state;const a="config.plugin.CalendarScroll",l=e.state.get(a);return l&&(t=n.mergeDeep({},t,l)),o.update(a,t),o.subscribe("config.plugin.CalendarScroll.enabled",(t=>s=t)),o.update("config.actions.chart-calendar",(t=>(t.push(r),t))),n.pluginInitialized("CalendarScroll"),function(){o.update("config.actions.chart-calendar",(t=>t.filter((t=>t!==r)))),n.pluginDestroyed("CalendarScroll")}}},Object.defineProperty(t,"__esModule",{value:!0})}));

@@ -9,4 +9,4 @@ /**

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE

@@ -23,6 +23,6 @@ */

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE
*/const i="config.plugin.DependencyLines",e="config.slots.chart-timeline-items.outer",n=t("chart-timeline-dependency-lines-lines"),s=t("chart-timeline-dependency-lines-lines-line"),o=t("chart-timeline-dependency-lines-points"),p=t("chart-timeline-dependency-lines-points-point");class a{constructor(t,n){this.onDestroy=[],this.vido=t,this.api=this.vido.api,this.state=this.vido.state;const s=this.vido.html`<div class=${p+"--left"}></div>`,o=this.vido.html`<div class=${p+"--right"}></div>`;this.data=function(t){return Object.assign(Object.assign({},t),{lines:[]})}(function(t,i,e){const n=Object.assign(Object.assign({},function(t,i){return{type:"smooth",onLines:[],onLine:[],leftPoint:{content:t,width:10,height:10},rightPoint:{content:i,width:10,height:10}}}(i,e)),t);return t.leftPoint&&(n.leftPoint=Object.assign(Object.assign({},n.leftPoint),t.leftPoint)),t.rightPoint&&(n.rightPoint=Object.assign(Object.assign({},n.rightPoint),t.rightPoint)),n}(n,s,o)),this.PluginDependencyLinesSlot=this.PluginDependencyLinesSlot.bind(this),this.generateLines=this.generateLines.bind(this),this.destroy=this.destroy.bind(this),this.updateData(),this.onDestroy.push(this.state.subscribe(i,(t=>{this.data=t}))),this.state.update(e,(t=>(t.includes(this.PluginDependencyLinesSlot)||t.push(this.PluginDependencyLinesSlot),t))),this.onDestroy.push(this.state.subscribeAll(["$data.chart.items","$data.list.rowsHeight","$data.scroll","$data.chart.time.leftGlobal","$data.chart.time.rightPx"],this.generateLines,{group:!0}))}destroy(){this.state.update(e,(t=>t.filter((t=>t!==this.PluginDependencyLinesSlot)))),this.onDestroy.forEach((t=>t())),this.api.pluginDestroyed("DependencyLines")}updateData(){this.state.update(i,this.data),this.vido.update()}setStraightPoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:s,fromRowData:o,toRowData:p}=t;if(!this.api.parentsExpanded(o.id)||!this.api.parentsExpanded(p.id))return;const a=this.api.getRowViewTop(o.id),h=this.api.getRowViewTop(p.id);t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"M",content:this.data.leftPoint.content}),t.points.push({x:s.position.left-e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"L",content:this.data.rightPoint.content})}setSquareAltPoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:s,fromRowData:o,toRowData:p}=t;if(!this.api.parentsExpanded(o.id)&&!this.api.parentsExpanded(p.id))return;const a=(s.position.left-n.position.right)/2,h=n.position.right+a,d=(s.position.viewTop-n.position.viewTop)/2,r=n.position.viewTop+d,l=this.api.getRowViewTop(o.id),c=this.api.getRowViewTop(p.id);t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:l,type:"M",content:this.data.leftPoint.content}),s.position.left<n.position.right?(t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:l,type:"L",content:null}),t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(o.id)?r+i:l,type:"L",content:null})):t.points.push({x:h,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:l,type:"L",content:null}),t.points.push({x:h,y:this.api.parentsExpanded(o.id)?r+i:l,type:"L",content:null}),this.api.parentsExpanded(p.id)?(s.position.left<n.position.right?(t.points.push({x:s.position.left-e-10,y:this.api.parentsExpanded(o.id)?r+i:l,type:"L",content:null}),t.points.push({x:s.position.left-e-10,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:l,type:"L",content:null})):t.points.push({x:h,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:l,type:"L",content:null}),t.points.push({x:s.position.left-e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:c,type:"L",content:this.data.rightPoint.content})):t.points.push({x:h,y:c,type:"L",content:this.data.rightPoint.content})}setSquarePoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:s,fromRowData:o,toRowData:p}=t;if(!this.api.parentsExpanded(o.id)&&!this.api.parentsExpanded(p.id))return;const a=this.api.getRowViewTop(o.id),h=this.api.getRowViewTop(p.id);t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"M",content:this.data.leftPoint.content}),n.position.viewTop!==s.position.viewTop?s.position.left<n.position.right?(t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"L",content:null}),s.position.viewTop>n.position.viewTop?(t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(o.id)?a+o.outerHeight:a,type:"L",content:null}),t.points.push({x:s.position.left+e+10,y:this.api.parentsExpanded(o.id)?a+o.outerHeight:a,type:"L",content:null}),t.points.push({x:s.position.left+e+10,y:this.api.parentsExpanded(p.id)?s.position.viewTop:h,type:"L",content:this.data.rightPoint.content})):(t.points.push({x:n.position.right+e+10,y:a,type:"L",content:null}),t.points.push({x:s.position.left+e+10,y:a,type:"L",content:null}),t.points.push({x:s.position.left+e+10,y:this.api.parentsExpanded(p.id)?s.position.viewTop+s.actualHeight:h,type:"L",content:this.data.rightPoint.content}))):(t.points.push({x:s.position.left+10,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"L",content:null}),s.position.viewTop>n.position.viewTop?t.points.push({x:s.position.left+10,y:this.api.parentsExpanded(p.id)?s.position.viewTop:h,type:"L",content:this.data.rightPoint.content}):t.points.push({x:s.position.left+10,y:this.api.parentsExpanded(p.id)?s.position.viewTop+s.actualHeight:h,type:"L",content:this.data.rightPoint.content})):t.points.push({x:s.position.left-e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"L",content:this.data.rightPoint.content})}setSmoothPoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:s,fromRowData:o,toRowData:p}=t;if(!this.api.parentsExpanded(o.id)&&!this.api.parentsExpanded(p.id))return;const a=this.api.getRowViewTop(o.id),h=this.api.getRowViewTop(p.id);if(t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"M",content:this.data.leftPoint.content}),n.position.viewTop===s.position.viewTop)return void t.points.push({x:s.position.left-e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"L",content:this.data.rightPoint.content});const d=(s.position.left-n.position.right)/2,r=n.position.right+d;if(n.position.right<=s.position.left)t.points.push({x:r,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"C",content:null}),t.points.push({x:r,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"",content:null}),t.points.push({x:s.position.left-e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"",content:this.data.rightPoint.content});else{const d=(s.position.viewTop-n.position.viewTop)/2,l=n.position.viewTop+d+i;t.points.push({x:n.position.right+20,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"C",content:null}),t.points.push({x:n.position.right+40,y:l,type:"",content:null}),t.points.push({x:r,y:l,type:"",content:null}),t.points.push({x:s.position.left+e-20,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"S",content:null}),t.points.push({x:s.position.left+e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"",content:this.data.rightPoint.content})}}setPoints(t){const{fromItemData:i,toItemData:e,fromRowData:n,toRowData:s,toItem:o,fromItem:p}=t,a=this.state.get("$data.chart.time");switch(this.api.calculateItemPosition(i.id,i,n,a,p),this.api.calculateItemPosition(e.id,e,s,a,o),t.type){case"straight":this.setStraightPoints(t);break;case"square":this.setSquarePoints(t);break;case"smooth":this.setSmoothPoints(t);break;case"square-alt":this.setSquareAltPoints(t)}}generateLines(){const t=[],i=this.api.getAllItems(),e=this.api.getRowsData(),n=this.api.getItemsData(),o=this.state.get("$data.chart.time"),p=this.state.get("$data.chart.dimensions"),a=Math.round(o.rightPx-o.leftPx),h=this.data.type;for(const d in i){const r=i[d];if(!r.dependant)continue;if(!r.dependant.length)continue;const l=e[r.rowId],c=n[d],u=r;if(c&&l)for(const g of r.dependant){const r=i[g],f=r,y=e[r.rowId],x=n[g];if(!x||!y)continue;if(o.calculatedZoomMode){if(u.time.end<o.leftGlobal&&f.time.start>o.rightGlobal)continue;if(f.time.end<o.leftGlobal&&u.time.start>o.rightGlobal)continue;if(u.time.start>o.rightGlobal&&f.time.start>o.rightGlobal)continue;if(u.time.end<o.leftGlobal&&f.time.end<o.leftGlobal)continue}if(this.api.calculateItemPosition(d,c,l,o),this.api.calculateItemPosition(g,x,y,o),-1===c.width&&-1===x.width)continue;const w=c.actualHeight/2,m=0;let v={x:0,y:0,width:a,height:p.height,topOffset:w,leftOffset:m,points:[],type:h,fromItemData:c,toItemData:x,fromItem:u,toItem:f,fromRowData:l,toRowData:y,className:s};for(const t of this.data.onLine)v=t(v);this.setPoints(v),t.push(v)}}this.data.lines=t;for(const t of this.data.onLines)this.data.lines=t(this.data.lines);this.updateData()}PluginDependencyLinesSlot(t){const{html:i,svg:e,state:s,onDestroy:a,StyleMap:h}=t,d=new h({});a(s.subscribeAll(["$data.chart.time","$data.chart.dimensions"],(()=>{const t=s.get("$data.chart.time");d.style.width=Math.round(t.rightPx-t.leftPx)+"px";const i=s.get("$data.chart.dimensions");d.style.height=i.innerHeight+"px"})));const r=t=>{if(!t.points.length)return"";const i=t.points.slice(),e=i.shift();return[`${e.type} ${e.x} ${e.y}`,[...i.map((t=>`${t.type} ${t.x} ${t.y}`))]].join(" ")},l=(t,e)=>{const n=`left:${t.x-(0===e?this.data.leftPoint.width/2:this.data.rightPoint.width/2)}px;top:${t.y-(0===e?this.data.leftPoint.height/2:this.data.rightPoint.height/2)}px;width:${0===e?this.data.leftPoint.width:this.data.rightPoint.width}px;height:${0===e?this.data.leftPoint.width:this.data.rightPoint.width}px`;return t.content?i`<div class=${p+" "+p+"--"+this.data.type} style=${n}>
*/const i="config.plugin.DependencyLines",e="config.slots.chart-timeline-items.outer",n=t("chart-timeline-dependency-lines-lines"),s=t("chart-timeline-dependency-lines-lines-line"),o=t("chart-timeline-dependency-lines-points"),p=t("chart-timeline-dependency-lines-points-point");class a{constructor(t,n){this.onDestroy=[],this.vido=t,this.api=this.vido.api,this.state=this.vido.state;const s=this.vido.html`<div class=${p+"--left"}></div>`,o=this.vido.html`<div class=${p+"--right"}></div>`;this.data=function(t){return Object.assign(Object.assign({},t),{lines:[]})}(function(t,i,e){const n=Object.assign(Object.assign({},function(t,i){return{type:"smooth",onLines:[],onLine:[],leftPoint:{content:t,width:10,height:10},rightPoint:{content:i,width:10,height:10}}}(i,e)),t);return t.leftPoint&&(n.leftPoint=Object.assign(Object.assign({},n.leftPoint),t.leftPoint)),t.rightPoint&&(n.rightPoint=Object.assign(Object.assign({},n.rightPoint),t.rightPoint)),n}(n,s,o)),this.PluginDependencyLinesSlot=this.PluginDependencyLinesSlot.bind(this),this.generateLines=this.generateLines.bind(this),this.destroy=this.destroy.bind(this),this.updateData(),this.onDestroy.push(this.state.subscribe(i,(t=>{this.data=t}))),this.state.update(e,(t=>(t.includes(this.PluginDependencyLinesSlot)||t.push(this.PluginDependencyLinesSlot),t))),this.onDestroy.push(this.state.subscribeAll(["$data.chart.items","$data.list.rowsHeight","$data.scroll","$data.chart.time.leftGlobal","$data.chart.time.rightPx"],this.generateLines,{group:!0}))}destroy(){this.state.update(e,(t=>t.filter((t=>t!==this.PluginDependencyLinesSlot)))),this.onDestroy.forEach((t=>t())),this.api.pluginDestroyed("DependencyLines")}updateData(){this.state.update(i,this.data),this.vido.update()}setStraightPoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:s,fromRowData:o,toRowData:p}=t;if(!this.api.parentsExpanded(o.id)||!this.api.parentsExpanded(p.id))return;const a=this.api.getRowViewTop(o.id),h=this.api.getRowViewTop(p.id);t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"M",content:this.data.leftPoint.content}),t.points.push({x:s.position.left-e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"L",content:this.data.rightPoint.content})}setSquareAltPoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:s,fromRowData:o,toRowData:p}=t;if(!this.api.parentsExpanded(o.id)&&!this.api.parentsExpanded(p.id))return;const a=(s.position.left-n.position.right)/2,h=n.position.right+a,d=(s.position.viewTop-n.position.viewTop)/2,r=n.position.viewTop+d,l=this.api.getRowViewTop(o.id),c=this.api.getRowViewTop(p.id);t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:l,type:"M",content:this.data.leftPoint.content}),s.position.left<n.position.right?(t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:l,type:"L",content:null}),t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(o.id)?r+i:l,type:"L",content:null})):t.points.push({x:h,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:l,type:"L",content:null}),t.points.push({x:h,y:this.api.parentsExpanded(o.id)?r+i:l,type:"L",content:null}),this.api.parentsExpanded(p.id)?(s.position.left<n.position.right?(t.points.push({x:s.position.left-e-10,y:this.api.parentsExpanded(o.id)?r+i:l,type:"L",content:null}),t.points.push({x:s.position.left-e-10,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:l,type:"L",content:null})):t.points.push({x:h,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:l,type:"L",content:null}),t.points.push({x:s.position.left-e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:c,type:"L",content:this.data.rightPoint.content})):t.points.push({x:h,y:c,type:"L",content:this.data.rightPoint.content})}setSquarePoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:s,fromRowData:o,toRowData:p}=t;if(!this.api.parentsExpanded(o.id)&&!this.api.parentsExpanded(p.id))return;const a=this.api.getRowViewTop(o.id),h=this.api.getRowViewTop(p.id);t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"M",content:this.data.leftPoint.content}),n.position.viewTop!==s.position.viewTop?s.position.left<n.position.right?(t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"L",content:null}),s.position.viewTop>n.position.viewTop?(t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(o.id)?a+o.outerHeight:a,type:"L",content:null}),t.points.push({x:s.position.left+e+10,y:this.api.parentsExpanded(o.id)?a+o.outerHeight:a,type:"L",content:null}),t.points.push({x:s.position.left+e+10,y:this.api.parentsExpanded(p.id)?s.position.viewTop:h,type:"L",content:this.data.rightPoint.content})):(t.points.push({x:n.position.right+e+10,y:a,type:"L",content:null}),t.points.push({x:s.position.left+e+10,y:a,type:"L",content:null}),t.points.push({x:s.position.left+e+10,y:this.api.parentsExpanded(p.id)?s.position.viewTop+s.actualHeight:h,type:"L",content:this.data.rightPoint.content}))):(t.points.push({x:s.position.left+10,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"L",content:null}),s.position.viewTop>n.position.viewTop?t.points.push({x:s.position.left+10,y:this.api.parentsExpanded(p.id)?s.position.viewTop:h,type:"L",content:this.data.rightPoint.content}):t.points.push({x:s.position.left+10,y:this.api.parentsExpanded(p.id)?s.position.viewTop+s.actualHeight:h,type:"L",content:this.data.rightPoint.content})):t.points.push({x:s.position.left-e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"L",content:this.data.rightPoint.content})}setSmoothPoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:s,fromRowData:o,toRowData:p}=t;if(!this.api.parentsExpanded(o.id)&&!this.api.parentsExpanded(p.id))return;const a=this.api.getRowViewTop(o.id),h=this.api.getRowViewTop(p.id);if(t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"M",content:this.data.leftPoint.content}),n.position.viewTop===s.position.viewTop)return void t.points.push({x:s.position.left-e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"L",content:this.data.rightPoint.content});const d=(s.position.left-n.position.right)/2,r=n.position.right+d;if(n.position.right<=s.position.left)t.points.push({x:r,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"C",content:null}),t.points.push({x:r,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"",content:null}),t.points.push({x:s.position.left-e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"",content:this.data.rightPoint.content});else{const d=(s.position.viewTop-n.position.viewTop)/2,l=n.position.viewTop+d+i;t.points.push({x:n.position.right+20,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"C",content:null}),t.points.push({x:n.position.right+40,y:l,type:"",content:null}),t.points.push({x:r,y:l,type:"",content:null}),t.points.push({x:s.position.left+e-20,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"S",content:null}),t.points.push({x:s.position.left+e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"",content:this.data.rightPoint.content})}}setPoints(t){const{fromItemData:i,toItemData:e,fromRowData:n,toRowData:s,toItem:o,fromItem:p}=t,a=this.state.get("$data.chart.time");switch(this.api.areAllItemsOutOfView()||(this.api.calculateItemPosition(i.id,i,n,a,p),this.api.calculateItemPosition(e.id,e,s,a,o)),t.type){case"straight":this.setStraightPoints(t);break;case"square":this.setSquarePoints(t);break;case"smooth":this.setSmoothPoints(t);break;case"square-alt":this.setSquareAltPoints(t)}}generateLines(){const t=[],i=this.api.getAllItems(),e=this.api.getRowsData(),n=this.api.getItemsData(),o=this.state.get("$data.chart.time"),p=this.state.get("$data.chart.dimensions"),a=Math.round(o.rightPx-o.leftPx),h=this.data.type;if(!this.api.areAllItemsOutOfView())for(const d in i){const r=i[d];if(!r.dependant)continue;if(!r.dependant.length)continue;const l=e[r.rowId],c=n[d],u=r;if(c&&l)for(const f of r.dependant){const r=i[f],g=r,y=e[r.rowId],x=n[f];if(!x||!y)continue;if(o.calculatedZoomMode){if(u.time.end<o.leftGlobal&&g.time.start>o.rightGlobal)continue;if(g.time.end<o.leftGlobal&&u.time.start>o.rightGlobal)continue;if(u.time.start>o.rightGlobal&&g.time.start>o.rightGlobal)continue;if(u.time.end<o.leftGlobal&&g.time.end<o.leftGlobal)continue}if(this.api.calculateItemPosition(d,c,l,o),this.api.calculateItemPosition(f,x,y,o),-1===c.width&&-1===x.width)continue;const w=c.actualHeight/2,m=0;let v={x:0,y:0,width:a,height:p.height,topOffset:w,leftOffset:m,points:[],type:h,fromItemData:c,toItemData:x,fromItem:u,toItem:g,fromRowData:l,toRowData:y,className:s};for(const t of this.data.onLine)v=t(v);this.setPoints(v),t.push(v)}}this.data.lines=t;for(const t of this.data.onLines)this.data.lines=t(this.data.lines);this.updateData()}PluginDependencyLinesSlot(t){const{html:i,svg:e,state:s,onDestroy:a,StyleMap:h}=t,d=new h({});a(s.subscribeAll(["$data.chart.time","$data.chart.dimensions"],(()=>{const t=s.get("$data.chart.time");d.style.width=Math.round(t.rightPx-t.leftPx)+"px";const i=s.get("$data.chart.dimensions");d.style.height=i.innerHeight+"px"})));const r=t=>{if(!t.points.length)return"";const i=t.points.slice(),e=i.shift();return[`${e.type} ${e.x} ${e.y}`,[...i.map((t=>`${t.type} ${t.x} ${t.y}`))]].join(" ")},l=(t,e)=>{const n=`left:${t.x-(0===e?this.data.leftPoint.width/2:this.data.rightPoint.width/2)}px;top:${t.y-(0===e?this.data.leftPoint.height/2:this.data.rightPoint.height/2)}px;width:${0===e?this.data.leftPoint.width:this.data.rightPoint.width}px;height:${0===e?this.data.leftPoint.width:this.data.rightPoint.width}px`;return t.content?i`<div class=${p+" "+p+"--"+this.data.type} style=${n}>
${t.content}

@@ -29,0 +29,0 @@ </div>`:null},c=t=>e`<svg width=${t.width} height=${t.height} xmlns="http://www.w3.org/2000/svg">

@@ -10,4 +10,4 @@ !function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i((t="undefined"!=typeof globalThis?globalThis:t||self).DependencyLines={})}(this,(function(t){"use strict";

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE

@@ -23,6 +23,6 @@ */const i="gstc";function e(t,e=""){let n=`gstc__${t}`;return t===i&&(n=i),e?`${n} ${n}--${e.replace(":","-")}`:n}

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE
*/const n="DependencyLines",o="config.plugin.DependencyLines",s="config.slots.chart-timeline-items.outer",p=e("chart-timeline-dependency-lines-lines"),a=e("chart-timeline-dependency-lines-lines-line"),h=e("chart-timeline-dependency-lines-points"),d=e("chart-timeline-dependency-lines-points-point");class r{constructor(t,i){this.onDestroy=[],this.vido=t,this.api=this.vido.api,this.state=this.vido.state;const e=this.vido.html`<div class=${d+"--left"}></div>`,n=this.vido.html`<div class=${d+"--right"}></div>`;this.data=function(t){return Object.assign(Object.assign({},t),{lines:[]})}(function(t,i,e){const n=Object.assign(Object.assign({},function(t,i){return{type:"smooth",onLines:[],onLine:[],leftPoint:{content:t,width:10,height:10},rightPoint:{content:i,width:10,height:10}}}(i,e)),t);return t.leftPoint&&(n.leftPoint=Object.assign(Object.assign({},n.leftPoint),t.leftPoint)),t.rightPoint&&(n.rightPoint=Object.assign(Object.assign({},n.rightPoint),t.rightPoint)),n}(i,e,n)),this.PluginDependencyLinesSlot=this.PluginDependencyLinesSlot.bind(this),this.generateLines=this.generateLines.bind(this),this.destroy=this.destroy.bind(this),this.updateData(),this.onDestroy.push(this.state.subscribe(o,(t=>{this.data=t}))),this.state.update(s,(t=>(t.includes(this.PluginDependencyLinesSlot)||t.push(this.PluginDependencyLinesSlot),t))),this.onDestroy.push(this.state.subscribeAll(["$data.chart.items","$data.list.rowsHeight","$data.scroll","$data.chart.time.leftGlobal","$data.chart.time.rightPx"],this.generateLines,{group:!0}))}destroy(){this.state.update(s,(t=>t.filter((t=>t!==this.PluginDependencyLinesSlot)))),this.onDestroy.forEach((t=>t())),this.api.pluginDestroyed(n)}updateData(){this.state.update(o,this.data),this.vido.update()}setStraightPoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:o,fromRowData:s,toRowData:p}=t;if(!this.api.parentsExpanded(s.id)||!this.api.parentsExpanded(p.id))return;const a=this.api.getRowViewTop(s.id),h=this.api.getRowViewTop(p.id);t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(s.id)?n.position.viewTop+i:a,type:"M",content:this.data.leftPoint.content}),t.points.push({x:o.position.left-e,y:this.api.parentsExpanded(p.id)?o.position.viewTop+i:h,type:"L",content:this.data.rightPoint.content})}setSquareAltPoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:o,fromRowData:s,toRowData:p}=t;if(!this.api.parentsExpanded(s.id)&&!this.api.parentsExpanded(p.id))return;const a=(o.position.left-n.position.right)/2,h=n.position.right+a,d=(o.position.viewTop-n.position.viewTop)/2,r=n.position.viewTop+d,l=this.api.getRowViewTop(s.id),c=this.api.getRowViewTop(p.id);t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(s.id)?n.position.viewTop+i:l,type:"M",content:this.data.leftPoint.content}),o.position.left<n.position.right?(t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(s.id)?n.position.viewTop+i:l,type:"L",content:null}),t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(s.id)?r+i:l,type:"L",content:null})):t.points.push({x:h,y:this.api.parentsExpanded(s.id)?n.position.viewTop+i:l,type:"L",content:null}),t.points.push({x:h,y:this.api.parentsExpanded(s.id)?r+i:l,type:"L",content:null}),this.api.parentsExpanded(p.id)?(o.position.left<n.position.right?(t.points.push({x:o.position.left-e-10,y:this.api.parentsExpanded(s.id)?r+i:l,type:"L",content:null}),t.points.push({x:o.position.left-e-10,y:this.api.parentsExpanded(p.id)?o.position.viewTop+i:l,type:"L",content:null})):t.points.push({x:h,y:this.api.parentsExpanded(p.id)?o.position.viewTop+i:l,type:"L",content:null}),t.points.push({x:o.position.left-e,y:this.api.parentsExpanded(p.id)?o.position.viewTop+i:c,type:"L",content:this.data.rightPoint.content})):t.points.push({x:h,y:c,type:"L",content:this.data.rightPoint.content})}setSquarePoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:o,fromRowData:s,toRowData:p}=t;if(!this.api.parentsExpanded(s.id)&&!this.api.parentsExpanded(p.id))return;const a=this.api.getRowViewTop(s.id),h=this.api.getRowViewTop(p.id);t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(s.id)?n.position.viewTop+i:a,type:"M",content:this.data.leftPoint.content}),n.position.viewTop!==o.position.viewTop?o.position.left<n.position.right?(t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(s.id)?n.position.viewTop+i:a,type:"L",content:null}),o.position.viewTop>n.position.viewTop?(t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(s.id)?a+s.outerHeight:a,type:"L",content:null}),t.points.push({x:o.position.left+e+10,y:this.api.parentsExpanded(s.id)?a+s.outerHeight:a,type:"L",content:null}),t.points.push({x:o.position.left+e+10,y:this.api.parentsExpanded(p.id)?o.position.viewTop:h,type:"L",content:this.data.rightPoint.content})):(t.points.push({x:n.position.right+e+10,y:a,type:"L",content:null}),t.points.push({x:o.position.left+e+10,y:a,type:"L",content:null}),t.points.push({x:o.position.left+e+10,y:this.api.parentsExpanded(p.id)?o.position.viewTop+o.actualHeight:h,type:"L",content:this.data.rightPoint.content}))):(t.points.push({x:o.position.left+10,y:this.api.parentsExpanded(s.id)?n.position.viewTop+i:a,type:"L",content:null}),o.position.viewTop>n.position.viewTop?t.points.push({x:o.position.left+10,y:this.api.parentsExpanded(p.id)?o.position.viewTop:h,type:"L",content:this.data.rightPoint.content}):t.points.push({x:o.position.left+10,y:this.api.parentsExpanded(p.id)?o.position.viewTop+o.actualHeight:h,type:"L",content:this.data.rightPoint.content})):t.points.push({x:o.position.left-e,y:this.api.parentsExpanded(p.id)?o.position.viewTop+i:h,type:"L",content:this.data.rightPoint.content})}setSmoothPoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:o,fromRowData:s,toRowData:p}=t;if(!this.api.parentsExpanded(s.id)&&!this.api.parentsExpanded(p.id))return;const a=this.api.getRowViewTop(s.id),h=this.api.getRowViewTop(p.id);if(t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(s.id)?n.position.viewTop+i:a,type:"M",content:this.data.leftPoint.content}),n.position.viewTop===o.position.viewTop)return void t.points.push({x:o.position.left-e,y:this.api.parentsExpanded(p.id)?o.position.viewTop+i:h,type:"L",content:this.data.rightPoint.content});const d=(o.position.left-n.position.right)/2,r=n.position.right+d;if(n.position.right<=o.position.left)t.points.push({x:r,y:this.api.parentsExpanded(s.id)?n.position.viewTop+i:a,type:"C",content:null}),t.points.push({x:r,y:this.api.parentsExpanded(p.id)?o.position.viewTop+i:h,type:"",content:null}),t.points.push({x:o.position.left-e,y:this.api.parentsExpanded(p.id)?o.position.viewTop+i:h,type:"",content:this.data.rightPoint.content});else{const d=(o.position.viewTop-n.position.viewTop)/2,l=n.position.viewTop+d+i;t.points.push({x:n.position.right+20,y:this.api.parentsExpanded(s.id)?n.position.viewTop+i:a,type:"C",content:null}),t.points.push({x:n.position.right+40,y:l,type:"",content:null}),t.points.push({x:r,y:l,type:"",content:null}),t.points.push({x:o.position.left+e-20,y:this.api.parentsExpanded(p.id)?o.position.viewTop+i:h,type:"S",content:null}),t.points.push({x:o.position.left+e,y:this.api.parentsExpanded(p.id)?o.position.viewTop+i:h,type:"",content:this.data.rightPoint.content})}}setPoints(t){const{fromItemData:i,toItemData:e,fromRowData:n,toRowData:o,toItem:s,fromItem:p}=t,a=this.state.get("$data.chart.time");switch(this.api.calculateItemPosition(i.id,i,n,a,p),this.api.calculateItemPosition(e.id,e,o,a,s),t.type){case"straight":this.setStraightPoints(t);break;case"square":this.setSquarePoints(t);break;case"smooth":this.setSmoothPoints(t);break;case"square-alt":this.setSquareAltPoints(t)}}generateLines(){const t=[],i=this.api.getAllItems(),e=this.api.getRowsData(),n=this.api.getItemsData(),o=this.state.get("$data.chart.time"),s=this.state.get("$data.chart.dimensions"),p=Math.round(o.rightPx-o.leftPx),h=this.data.type;for(const d in i){const r=i[d];if(!r.dependant)continue;if(!r.dependant.length)continue;const l=e[r.rowId],c=n[d],u=r;if(c&&l)for(const f of r.dependant){const r=i[f],g=r,y=e[r.rowId],x=n[f];if(!x||!y)continue;if(o.calculatedZoomMode){if(u.time.end<o.leftGlobal&&g.time.start>o.rightGlobal)continue;if(g.time.end<o.leftGlobal&&u.time.start>o.rightGlobal)continue;if(u.time.start>o.rightGlobal&&g.time.start>o.rightGlobal)continue;if(u.time.end<o.leftGlobal&&g.time.end<o.leftGlobal)continue}if(this.api.calculateItemPosition(d,c,l,o),this.api.calculateItemPosition(f,x,y,o),-1===c.width&&-1===x.width)continue;const w=c.actualHeight/2,m=0;let v={x:0,y:0,width:p,height:s.height,topOffset:w,leftOffset:m,points:[],type:h,fromItemData:c,toItemData:x,fromItem:u,toItem:g,fromRowData:l,toRowData:y,className:a};for(const t of this.data.onLine)v=t(v);this.setPoints(v),t.push(v)}}this.data.lines=t;for(const t of this.data.onLines)this.data.lines=t(this.data.lines);this.updateData()}PluginDependencyLinesSlot(t){const{html:i,svg:e,state:n,onDestroy:o,StyleMap:s}=t,a=new s({});o(n.subscribeAll(["$data.chart.time","$data.chart.dimensions"],(()=>{const t=n.get("$data.chart.time");a.style.width=Math.round(t.rightPx-t.leftPx)+"px";const i=n.get("$data.chart.dimensions");a.style.height=i.innerHeight+"px"})));const r=t=>{if(!t.points.length)return"";const i=t.points.slice(),e=i.shift();return[`${e.type} ${e.x} ${e.y}`,[...i.map((t=>`${t.type} ${t.x} ${t.y}`))]].join(" ")},l=(t,e)=>{const n=`left:${t.x-(0===e?this.data.leftPoint.width/2:this.data.rightPoint.width/2)}px;top:${t.y-(0===e?this.data.leftPoint.height/2:this.data.rightPoint.height/2)}px;width:${0===e?this.data.leftPoint.width:this.data.rightPoint.width}px;height:${0===e?this.data.leftPoint.width:this.data.rightPoint.width}px`;return t.content?i`<div class=${d+" "+d+"--"+this.data.type} style=${n}>
*/const n="DependencyLines",o="config.plugin.DependencyLines",s="config.slots.chart-timeline-items.outer",p=e("chart-timeline-dependency-lines-lines"),a=e("chart-timeline-dependency-lines-lines-line"),h=e("chart-timeline-dependency-lines-points"),d=e("chart-timeline-dependency-lines-points-point");class r{constructor(t,i){this.onDestroy=[],this.vido=t,this.api=this.vido.api,this.state=this.vido.state;const e=this.vido.html`<div class=${d+"--left"}></div>`,n=this.vido.html`<div class=${d+"--right"}></div>`;this.data=function(t){return Object.assign(Object.assign({},t),{lines:[]})}(function(t,i,e){const n=Object.assign(Object.assign({},function(t,i){return{type:"smooth",onLines:[],onLine:[],leftPoint:{content:t,width:10,height:10},rightPoint:{content:i,width:10,height:10}}}(i,e)),t);return t.leftPoint&&(n.leftPoint=Object.assign(Object.assign({},n.leftPoint),t.leftPoint)),t.rightPoint&&(n.rightPoint=Object.assign(Object.assign({},n.rightPoint),t.rightPoint)),n}(i,e,n)),this.PluginDependencyLinesSlot=this.PluginDependencyLinesSlot.bind(this),this.generateLines=this.generateLines.bind(this),this.destroy=this.destroy.bind(this),this.updateData(),this.onDestroy.push(this.state.subscribe(o,(t=>{this.data=t}))),this.state.update(s,(t=>(t.includes(this.PluginDependencyLinesSlot)||t.push(this.PluginDependencyLinesSlot),t))),this.onDestroy.push(this.state.subscribeAll(["$data.chart.items","$data.list.rowsHeight","$data.scroll","$data.chart.time.leftGlobal","$data.chart.time.rightPx"],this.generateLines,{group:!0}))}destroy(){this.state.update(s,(t=>t.filter((t=>t!==this.PluginDependencyLinesSlot)))),this.onDestroy.forEach((t=>t())),this.api.pluginDestroyed(n)}updateData(){this.state.update(o,this.data),this.vido.update()}setStraightPoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:o,fromRowData:s,toRowData:p}=t;if(!this.api.parentsExpanded(s.id)||!this.api.parentsExpanded(p.id))return;const a=this.api.getRowViewTop(s.id),h=this.api.getRowViewTop(p.id);t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(s.id)?n.position.viewTop+i:a,type:"M",content:this.data.leftPoint.content}),t.points.push({x:o.position.left-e,y:this.api.parentsExpanded(p.id)?o.position.viewTop+i:h,type:"L",content:this.data.rightPoint.content})}setSquareAltPoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:o,fromRowData:s,toRowData:p}=t;if(!this.api.parentsExpanded(s.id)&&!this.api.parentsExpanded(p.id))return;const a=(o.position.left-n.position.right)/2,h=n.position.right+a,d=(o.position.viewTop-n.position.viewTop)/2,r=n.position.viewTop+d,l=this.api.getRowViewTop(s.id),c=this.api.getRowViewTop(p.id);t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(s.id)?n.position.viewTop+i:l,type:"M",content:this.data.leftPoint.content}),o.position.left<n.position.right?(t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(s.id)?n.position.viewTop+i:l,type:"L",content:null}),t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(s.id)?r+i:l,type:"L",content:null})):t.points.push({x:h,y:this.api.parentsExpanded(s.id)?n.position.viewTop+i:l,type:"L",content:null}),t.points.push({x:h,y:this.api.parentsExpanded(s.id)?r+i:l,type:"L",content:null}),this.api.parentsExpanded(p.id)?(o.position.left<n.position.right?(t.points.push({x:o.position.left-e-10,y:this.api.parentsExpanded(s.id)?r+i:l,type:"L",content:null}),t.points.push({x:o.position.left-e-10,y:this.api.parentsExpanded(p.id)?o.position.viewTop+i:l,type:"L",content:null})):t.points.push({x:h,y:this.api.parentsExpanded(p.id)?o.position.viewTop+i:l,type:"L",content:null}),t.points.push({x:o.position.left-e,y:this.api.parentsExpanded(p.id)?o.position.viewTop+i:c,type:"L",content:this.data.rightPoint.content})):t.points.push({x:h,y:c,type:"L",content:this.data.rightPoint.content})}setSquarePoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:o,fromRowData:s,toRowData:p}=t;if(!this.api.parentsExpanded(s.id)&&!this.api.parentsExpanded(p.id))return;const a=this.api.getRowViewTop(s.id),h=this.api.getRowViewTop(p.id);t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(s.id)?n.position.viewTop+i:a,type:"M",content:this.data.leftPoint.content}),n.position.viewTop!==o.position.viewTop?o.position.left<n.position.right?(t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(s.id)?n.position.viewTop+i:a,type:"L",content:null}),o.position.viewTop>n.position.viewTop?(t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(s.id)?a+s.outerHeight:a,type:"L",content:null}),t.points.push({x:o.position.left+e+10,y:this.api.parentsExpanded(s.id)?a+s.outerHeight:a,type:"L",content:null}),t.points.push({x:o.position.left+e+10,y:this.api.parentsExpanded(p.id)?o.position.viewTop:h,type:"L",content:this.data.rightPoint.content})):(t.points.push({x:n.position.right+e+10,y:a,type:"L",content:null}),t.points.push({x:o.position.left+e+10,y:a,type:"L",content:null}),t.points.push({x:o.position.left+e+10,y:this.api.parentsExpanded(p.id)?o.position.viewTop+o.actualHeight:h,type:"L",content:this.data.rightPoint.content}))):(t.points.push({x:o.position.left+10,y:this.api.parentsExpanded(s.id)?n.position.viewTop+i:a,type:"L",content:null}),o.position.viewTop>n.position.viewTop?t.points.push({x:o.position.left+10,y:this.api.parentsExpanded(p.id)?o.position.viewTop:h,type:"L",content:this.data.rightPoint.content}):t.points.push({x:o.position.left+10,y:this.api.parentsExpanded(p.id)?o.position.viewTop+o.actualHeight:h,type:"L",content:this.data.rightPoint.content})):t.points.push({x:o.position.left-e,y:this.api.parentsExpanded(p.id)?o.position.viewTop+i:h,type:"L",content:this.data.rightPoint.content})}setSmoothPoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:o,fromRowData:s,toRowData:p}=t;if(!this.api.parentsExpanded(s.id)&&!this.api.parentsExpanded(p.id))return;const a=this.api.getRowViewTop(s.id),h=this.api.getRowViewTop(p.id);if(t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(s.id)?n.position.viewTop+i:a,type:"M",content:this.data.leftPoint.content}),n.position.viewTop===o.position.viewTop)return void t.points.push({x:o.position.left-e,y:this.api.parentsExpanded(p.id)?o.position.viewTop+i:h,type:"L",content:this.data.rightPoint.content});const d=(o.position.left-n.position.right)/2,r=n.position.right+d;if(n.position.right<=o.position.left)t.points.push({x:r,y:this.api.parentsExpanded(s.id)?n.position.viewTop+i:a,type:"C",content:null}),t.points.push({x:r,y:this.api.parentsExpanded(p.id)?o.position.viewTop+i:h,type:"",content:null}),t.points.push({x:o.position.left-e,y:this.api.parentsExpanded(p.id)?o.position.viewTop+i:h,type:"",content:this.data.rightPoint.content});else{const d=(o.position.viewTop-n.position.viewTop)/2,l=n.position.viewTop+d+i;t.points.push({x:n.position.right+20,y:this.api.parentsExpanded(s.id)?n.position.viewTop+i:a,type:"C",content:null}),t.points.push({x:n.position.right+40,y:l,type:"",content:null}),t.points.push({x:r,y:l,type:"",content:null}),t.points.push({x:o.position.left+e-20,y:this.api.parentsExpanded(p.id)?o.position.viewTop+i:h,type:"S",content:null}),t.points.push({x:o.position.left+e,y:this.api.parentsExpanded(p.id)?o.position.viewTop+i:h,type:"",content:this.data.rightPoint.content})}}setPoints(t){const{fromItemData:i,toItemData:e,fromRowData:n,toRowData:o,toItem:s,fromItem:p}=t,a=this.state.get("$data.chart.time");switch(this.api.areAllItemsOutOfView()||(this.api.calculateItemPosition(i.id,i,n,a,p),this.api.calculateItemPosition(e.id,e,o,a,s)),t.type){case"straight":this.setStraightPoints(t);break;case"square":this.setSquarePoints(t);break;case"smooth":this.setSmoothPoints(t);break;case"square-alt":this.setSquareAltPoints(t)}}generateLines(){const t=[],i=this.api.getAllItems(),e=this.api.getRowsData(),n=this.api.getItemsData(),o=this.state.get("$data.chart.time"),s=this.state.get("$data.chart.dimensions"),p=Math.round(o.rightPx-o.leftPx),h=this.data.type;if(!this.api.areAllItemsOutOfView())for(const d in i){const r=i[d];if(!r.dependant)continue;if(!r.dependant.length)continue;const l=e[r.rowId],c=n[d],u=r;if(c&&l)for(const f of r.dependant){const r=i[f],g=r,y=e[r.rowId],x=n[f];if(!x||!y)continue;if(o.calculatedZoomMode){if(u.time.end<o.leftGlobal&&g.time.start>o.rightGlobal)continue;if(g.time.end<o.leftGlobal&&u.time.start>o.rightGlobal)continue;if(u.time.start>o.rightGlobal&&g.time.start>o.rightGlobal)continue;if(u.time.end<o.leftGlobal&&g.time.end<o.leftGlobal)continue}if(this.api.calculateItemPosition(d,c,l,o),this.api.calculateItemPosition(f,x,y,o),-1===c.width&&-1===x.width)continue;const w=c.actualHeight/2,m=0;let v={x:0,y:0,width:p,height:s.height,topOffset:w,leftOffset:m,points:[],type:h,fromItemData:c,toItemData:x,fromItem:u,toItem:g,fromRowData:l,toRowData:y,className:a};for(const t of this.data.onLine)v=t(v);this.setPoints(v),t.push(v)}}this.data.lines=t;for(const t of this.data.onLines)this.data.lines=t(this.data.lines);this.updateData()}PluginDependencyLinesSlot(t){const{html:i,svg:e,state:n,onDestroy:o,StyleMap:s}=t,a=new s({});o(n.subscribeAll(["$data.chart.time","$data.chart.dimensions"],(()=>{const t=n.get("$data.chart.time");a.style.width=Math.round(t.rightPx-t.leftPx)+"px";const i=n.get("$data.chart.dimensions");a.style.height=i.innerHeight+"px"})));const r=t=>{if(!t.points.length)return"";const i=t.points.slice(),e=i.shift();return[`${e.type} ${e.x} ${e.y}`,[...i.map((t=>`${t.type} ${t.x} ${t.y}`))]].join(" ")},l=(t,e)=>{const n=`left:${t.x-(0===e?this.data.leftPoint.width/2:this.data.rightPoint.width/2)}px;top:${t.y-(0===e?this.data.leftPoint.height/2:this.data.rightPoint.height/2)}px;width:${0===e?this.data.leftPoint.width:this.data.rightPoint.width}px;height:${0===e?this.data.leftPoint.width:this.data.rightPoint.width}px`;return t.content?i`<div class=${d+" "+d+"--"+this.data.type} style=${n}>
${t.content}

@@ -29,0 +29,0 @@ </div>`:null},c=t=>e`<svg width=${t.width} height=${t.height} xmlns="http://www.w3.org/2000/svg">

@@ -10,6 +10,6 @@ class t{constructor(){this.isAction=!0}}

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE
*/
function e(e={}){const i=e.weekdays||[6,0];let s,a,n=!0;class c extends t{constructor(t,e){super(),this.highlight(t,e.time.leftGlobalDate)}update(t,e){this.highlight(t,e.time.leftGlobalDate)}highlight(t,e){const a=t.classList.contains(s);if(!n)return void(a&&t.classList.remove(s));const c=i.includes(e.day());!a&&c?t.classList.add(s):a&&!c&&t.classList.remove(s)}}return function(t){const i=t.api.mergeDeep,l=[];a=t.api,s=e.className||a.getClass("chart-timeline-grid-row-cell")+"--weekend";const o=t.state.get("config.plugin.HighlightWeekends");return o&&(e=i({},e,o)),l.push(t.state.subscribe("$data.chart.time.format.period",(t=>n="day"===t))),t.state.update("config.actions.chart-timeline-grid-row-cell",(t=>(t.push(c),t))),a.pluginInitialized("HighlightWeekends"),function(){l.forEach((t=>t())),t.state.update("config.actions.chart-timeline-grid-row-cell",(t=>t.filter((t=>t!==c)))),a.pluginDestroyed("HighlightWeekends")}}}t.prototype.isAction=!0;export{e as Plugin};

@@ -10,6 +10,6 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).HighlightWeekends={})}(this,(function(e){"use strict";class t{constructor(){this.isAction=!0}}t.prototype.isAction=!0,e.Plugin=

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE
*/
function(e={}){const i=e.weekdays||[6,0];let s,n,o=!0;class l extends t{constructor(e,t){super(),this.highlight(e,t.time.leftGlobalDate)}update(e,t){this.highlight(e,t.time.leftGlobalDate)}highlight(e,t){const n=e.classList.contains(s);if(!o)return void(n&&e.classList.remove(s));const l=i.includes(t.day());!n&&l?e.classList.add(s):n&&!l&&e.classList.remove(s)}}return function(t){const i=t.api.mergeDeep,c=[];n=t.api,s=e.className||n.getClass("chart-timeline-grid-row-cell")+"--weekend";const a=t.state.get("config.plugin.HighlightWeekends");return a&&(e=i({},e,a)),c.push(t.state.subscribe("$data.chart.time.format.period",(e=>o="day"===e))),t.state.update("config.actions.chart-timeline-grid-row-cell",(e=>(e.push(l),e))),n.pluginInitialized("HighlightWeekends"),function(){c.forEach((e=>e())),t.state.update("config.actions.chart-timeline-grid-row-cell",(e=>e.filter((e=>e!==l)))),n.pluginDestroyed("HighlightWeekends")}}},Object.defineProperty(e,"__esModule",{value:!0})}));

@@ -9,4 +9,4 @@ /**

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE

@@ -23,5 +23,5 @@ */

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE
*/class e{constructor(t,e){this.onDestroy=[],this.scrollWaiting=0,this.vido=t,this.state=t.state,this.api=t.api,this.data=function(t={}){const e={onStart:({items:t})=>t.after,onMove:({items:t})=>t.after,onEnd:({items:t})=>t.after},i={start:({startTime:t,time:e,vido:i})=>i.api.time.findOrCreateMainDateAtTime(t.valueOf(),e).leftGlobalDate,end:({endTime:t})=>t},a={speed:{horizontal:1,vertical:1},edgeThreshold:{horizontal:0,vertical:0}},s=Object.assign({enabled:!0,dependant:!0,moveDependantVertically:!1,addedDependantIds:[],selectedIds:[],debug:!1,state:"",bodyClass:"gstc-items-moving",itemClass:"",movement:{x:0,y:0,time:0},threshold:{horizontal:10,vertical:10},initialItems:[],initialItemsData:{},clickedItem:null,clickedItemData:null,initialVerticalScroll:null,initialHorizontalScroll:null,initialPointerTime:null,isMoving:!1,events:Object.assign({},e),snapToTime:Object.assign({},i),autoScroll:Object.assign({},a),ignoreMissingDates:!0,allowItemsToGoOutsideTheArea:!0},t);return t.snapToTime&&(s.snapToTime=Object.assign(Object.assign({},i),t.snapToTime)),t.events&&(s.events=Object.assign(Object.assign({},e),t.events)),t.autoScroll&&(s.autoScroll=Object.assign(Object.assign({},a),t.autoScroll),t.autoScroll.edgeThreshold&&(s.autoScroll.edgeThreshold=Object.assign(Object.assign({},a.edgeThreshold),t.autoScroll.edgeThreshold)),t.autoScroll.speed&&(s.autoScroll.speed=Object.assign(Object.assign({},a.speed),t.autoScroll.speed))),s}(e),this.data.itemClass||(this.data.itemClass=this.api.getClass("timeline-chart-items-row-item")+"--moving"),this.destroy=this.destroy.bind(this),this.itemUpdateAction=this.itemUpdateAction.bind(this),this.onDestroy.push(this.state.subscribe("$data.elements.chart-timeline",(t=>this.timelineElement=t))),this.updateData(),this.onDestroy.push(this.state.subscribe("config.plugin.ItemMovement",(t=>{t.enabled&&t.isMoving?document.body.classList.add(t.bodyClass):document.body.classList.remove(t.bodyClass),this.data=t}))),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onTimelinePointerDown=this.onTimelinePointerDown.bind(this),this.onTimelinePointerMove=this.onTimelinePointerMove.bind(this),this.onTimelinePointerUp=this.onTimelinePointerUp.bind(this),this.api.plugins.TimelinePointer.addPointerListener("move",this.onTimelinePointerMove),this.api.plugins.TimelinePointer.addPointerListener("down",this.onTimelinePointerDown),this.api.plugins.TimelinePointer.addPointerListener("up",this.onTimelinePointerUp)}destroy(){this.onDestroy.forEach((t=>t())),this.api.plugins.TimelinePointer.removePointerListener("move",this.onTimelinePointerMove),this.api.plugins.TimelinePointer.removePointerListener("down",this.onTimelinePointerDown),this.api.plugins.TimelinePointer.removePointerListener("up",this.onTimelinePointerUp),this.api.pluginDestroyed("ItemMovement")}updateData(){this.state.update("config.plugin.ItemMovement",this.data)}getSelectedItems(e=!1){return this.state.get(`config.plugin.Selection.selected.${t}`).map((t=>{let i=this.api.getItem(t);if(e)for(const e of this.data.initialItems)if(e.id===t){i=e;break}return this.api.mergeDeep({},i)}))}getSelectedItemsData(t){const e={};for(const i of t)e[i.id]=this.api.mergeDeep({},this.api.getItemData(i.id));return e}getEventArgument(t,e){const i=this.api.getAllItems(),a=[];for(const e of t)a.push(this.api.mergeDeep({},i[e.id]));return{items:{initial:this.data.initialItems,before:a,after:t,targetData:e.targetData},addedDependantIds:this.data.addedDependantIds,selectedIds:this.data.selectedIds,vido:this.vido,state:this.state,time:this.state.get("$data.chart.time")}}getDependantItems(t,e){const i=[],a=this.api.getItemsData();for(const e of t)for(const t of a[e.id].dependant)i.includes(t)||i.push(t);const s=this.state.get("config.chart.items");let o;return o=e?i.map((t=>this.data.initialItems.find((e=>e.id===t)))):i.map((t=>s[t])),o.map((t=>this.api.mergeDeep({},t)))}dispatchEvent(t,e,i,a=null){"onStart"===t&&(this.api.muteMethod("fixOverlapped"),this.api.muteMethod("fullReload"),this.api.muteMethod("measureRows"),this.api.muteMethod("getLastPageRowsHeight"),this.api.muteMethod("calculateVerticalScrollArea"),this.api.muteMethod("heightChange"),this.api.muteMethod("calculateRowsHeight"),this.api.muteMethod("calculateVisibleRowsHeights"),this.api.muteMethod("updateVisibleItemsListener"),this.api.muteMethod("prepareExpanded"),0===this.data.autoScroll.speed.horizontal&&0===this.data.autoScroll.speed.vertical&&(this.api.muteMethod("generateVisibleRowsAndItems"),this.api.muteMethod("prepareExpanded"))),"onEnd"===t&&(this.api.unmuteMethod("fixOverlapped"),this.api.unmuteMethod("heightChange"),this.api.unmuteMethod("calculateVerticalScrollArea"),this.api.unmuteMethod("getLastPageRowsHeight"),this.api.unmuteMethod("fullReload"),this.api.unmuteMethod("measureRows"),this.api.unmuteMethod("calculateRowsHeight"),this.api.unmuteMethod("calculateVisibleRowsHeights"),this.api.unmuteMethod("updateVisibleItemsListener"),this.api.unmuteMethod("prepareExpanded"),0===this.data.autoScroll.speed.horizontal&&0===this.data.autoScroll.speed.vertical&&(this.api.unmuteMethod("generateVisibleRowsAndItems"),this.api.unmuteMethod("prepareExpanded"))),e=e.map((t=>this.api.mergeDeep({},t)));const s=this.data.events[t](this.getEventArgument(e,i));let o=this.state.multi(!0);const n=this.state.get("config.chart.items");for(let t of s){t=this.api.mergeDeep({},t);const e=n[t.id];let i=!1;t.time.start===e.time.start&&t.time.end===e.time.end||(i=!0,o=o.update(`config.chart.items.${t.id}.time`,Object.assign({},t.time)));let s=!1;e.rowId!==t.rowId&&(s=!0,o=o.update(`config.chart.items.${t.id}.rowId`,t.rowId),this.api.updateItemRowMapForItem(t.id,t.rowId)),a&&(i||s)&&(o=o.update(`$data.chart.items.${t.id}`,this.api.mergeDeep({},a[t.id])))}o.done(),"onEnd"===t&&this.api.main.partialReload(!1)}getItemsForDiff(){const t=this.getSelectedItems()[0],e=this.data.initialItems.find((e=>e.id===t.id));return{modified:t,original:e}}onTimelinePointerDown(e){this.data.enabled&&(e.targetType!==t||this.api.plugins.TimelinePointer.isLocked("down")||this.onPointerDown(e))}onTimelinePointerMove(e){this.data.enabled&&e.targetType===t&&"item-movement"===this.api.plugins.TimelinePointer.isLocked("move")&&this.onPointerMove(e)}onTimelinePointerUp(e){this.data.enabled&&e.targetType===t&&"item-movement"===this.api.plugins.TimelinePointer.isLocked("up")&&this.onPointerUp(e)}onPointerDown(t){if(document.body.classList.add(this.data.bodyClass),this.api.plugins.TimelinePointer.lock("down","item-movement"),this.api.plugins.TimelinePointer.lock("move","item-movement"),this.api.plugins.TimelinePointer.lock("up","item-movement"),this.data.isMoving=!0,this.data.dependant){const t=this.getSelectedItems();this.data.selectedIds=t.map((t=>t.id));const e=this.getDependantItems(t,!1).filter((t=>!this.data.selectedIds.includes(t.id)));this.data.addedDependantIds=e.map((t=>t.id)),this.data.initialItems=[...t,...e]}else this.data.addedDependantIds=[],this.data.initialItems=this.getSelectedItems(),this.data.selectedIds=this.data.initialItems.map((t=>t.id));this.data.initialItemsData=this.getSelectedItemsData(this.data.initialItems),this.data.clickedItem=this.api.mergeDeep({},t.targetData),this.data.clickedItemData=this.api.mergeDeep({},this.api.getItemData(this.data.clickedItem.id)),this.data.initialVerticalScroll=this.api.mergeDeep({},this.state.get("$data.scroll.vertical")),this.data.initialHorizontalScroll=this.api.mergeDeep({},this.state.get("$data.scroll.horizontal")),this.data.initialPointerTime=this.api.time.date(this.api.time.getTimeFromOffsetPx(t.initialPosition.x,!0)),this.scrollWaiting=0,""!==this.data.state&&"end"!==this.data.state||(this.data.state="move"),this.dispatchEvent("onStart",this.data.initialItems,t),this.updateData()}scrollLeft(){if(this.data.autoScroll.speed.horizontal&&!this.state.get("config.chart.time.calculatedZoomMode")){if(this.scrollWaiting++,this.data.autoScroll.speed.horizontal<0){if(this.scrollWaiting-1<Math.abs(this.data.autoScroll.speed.horizontal))return;const t=this.api.getScrollLeft();this.api.setScrollLeft(t.dataIndex-1)}else if(this.data.autoScroll.speed.horizontal>0){const t=this.api.getScrollLeft();this.api.setScrollLeft(t.dataIndex-this.data.autoScroll.speed.horizontal)}this.scrollWaiting=0}}scrollRight(){if(this.data.autoScroll.speed.horizontal&&!this.state.get("config.chart.time.calculatedZoomMode")){if(this.scrollWaiting++,this.data.autoScroll.speed.horizontal<0){if(this.scrollWaiting-1<Math.abs(this.data.autoScroll.speed.horizontal))return;const t=this.api.getScrollLeft();this.api.setScrollLeft(t.dataIndex+1)}else if(this.data.autoScroll.speed.horizontal>0){const t=this.api.getScrollLeft();this.api.setScrollLeft(t.dataIndex+this.data.autoScroll.speed.horizontal)}this.scrollWaiting=0}}scrollTop(){if(this.data.autoScroll.speed.vertical){if(this.scrollWaiting++,this.data.autoScroll.speed.vertical<0){if(this.scrollWaiting-1<Math.abs(this.data.autoScroll.speed.vertical))return;const t=this.api.getScrollTop();this.api.setScrollTop(t.dataIndex-1)}else if(this.data.autoScroll.speed.vertical>0){const t=this.api.getScrollTop();this.api.setScrollTop(t.dataIndex-this.data.autoScroll.speed.vertical)}this.scrollWaiting=0}}scrollBottom(){if(this.data.autoScroll.speed.vertical){if(this.scrollWaiting++,this.data.autoScroll.speed.vertical<0){if(this.scrollWaiting-1<Math.abs(this.data.autoScroll.speed.vertical))return;const t=this.api.getScrollTop();this.api.setScrollTop(t.dataIndex+1)}else if(this.data.autoScroll.speed.vertical>0){const t=this.api.getScrollTop();this.api.setScrollTop(t.dataIndex+this.data.autoScroll.speed.vertical)}this.scrollWaiting=0}}autoScroll(t){if(!this.timelineElement)return;const e=t.currentPosition.x,i=t.currentPosition.y,a=this.state.get("$data.chart.dimensions");e<this.data.autoScroll.edgeThreshold.horizontal?this.scrollLeft():e>a.widthWithoutScrollBar-this.data.autoScroll.edgeThreshold.horizontal?this.scrollRight():i<this.data.autoScroll.edgeThreshold.vertical?this.scrollTop():i>a.innerHeight-this.data.autoScroll.edgeThreshold.vertical&&this.scrollBottom()}moveItemVertically(t,e,i){if(this.data.addedDependantIds.includes(t.id)&&!this.data.moveDependantVertically)return;const a=this.state.get("$data.scroll.vertical").absolutePosPx-this.data.initialVerticalScroll.absolutePosPx,s=i.currentPosition.y-i.initialPosition.y,o=this.data.clickedItemData.position.viewTop-i.initialPosition.y-this.data.clickedItemData.position.rowTop;let n=e.position.top+s+a-o;n<0&&(n=0);const l=this.api.getRowInfoFromTop(n);l.row.id!==t.rowId&&(t.rowId=l.row.id,e.position.viewTop=this.api.getRowViewTop(t.rowId),e.position.rowTop=0)}getItemsToMove(t=!1){let e,i=[];if(this.data.dependant){const a=this.getSelectedItems(t),s=a.map((t=>t.id)),o=this.getDependantItems(a,t).filter((t=>!s.includes(t.id)));i=o.map((t=>t.id)),e=[...a,...o]}else e=this.getSelectedItems(t);return{itemsToMove:e,dependantIds:i}}calculateFinalLeftGlobal({diffPx:t,initialItemData:e,initialItem:i,isDependant:a,movement:s,itemDataToSave:o,time:n}){const l=e.position.left+t;let d=this.api.time.getTimeFromOffsetPx(l,!0,n);if(a){const t=this.data.initialItems.find((t=>{var e;return null===(e=t.dependant)||void 0===e?void 0:e.includes(i.id)})),a=this.data.initialItemsData[t.id],s=o[a.id],l=this.api.time.getDatesDiffMs(a.time.endDate,s.time.endDate,n,!0);let r=-this.api.time.getDSTDiffForLevel(n.level,a.time.endDate.valueOf(),e.time.startDate.valueOf(),n);d=this.api.time.addTimeFromDates(e.time.startDate.valueOf(),l+r,n),r=this.api.time.getDSTDiffForLevel(n.level,s.time.endDate.valueOf(),d,n),d+=r}const r=this.api.time.date(d);let h=r;return a||(h=this.data.snapToTime.start({startTime:r,item:i,time:n,movement:s,vido:this.vido})),h}calculateFinalRightGlobal({finalLeftGlobalDate:t,initialItemData:e,initialItem:i,isDependant:a,movement:s,time:o}){const n=this.api.time.getViewOffsetPxFromDates(t,!1,o);let l=-this.api.time.getDSTDiffForLevel(o.level,i.time.start,i.time.end,o);const d=n+e.timeWidth;let r;const h=i.time.end-i.time.start;r=this.data.ignoreMissingDates?this.api.time.date(this.api.time.getTimeFromOffsetPx(d,!0,o)):this.api.time.date(t.valueOf()+h),l+=this.api.time.getDSTDiffForLevel(o.level,t.valueOf(),r.valueOf(),o),r=r.add(l,"ms");let m=r;return a||(m=this.data.snapToTime.end({endTime:r,item:i,time:o,movement:s,vido:this.vido})),m}onPointerMove(t){if(!this.data.enabled)return;if(!this.data.isMoving)return;const{original:e,modified:i}=this.getItemsForDiff();if(!e)return;const a=this.data.movement=Object.assign(Object.assign({},t.movement),{time:i.time.start-e.time.start});"move"!==this.data.state&&"start"!==this.data.state||(this.data.state="move");const{itemsToMove:s,dependantIds:o}=this.getItemsToMove(!0),n={},l=this.state.get("$data.chart.time"),d=[],r=this.data.snapToTime.start({startTime:this.data.initialPointerTime,item:null,time:l,movement:a,vido:this.vido}),h=this.state.get("$data.scroll.horizontal"),m=this.api.time.getDatesDiffPx(h.data.leftGlobalDate,this.data.initialHorizontalScroll.data.leftGlobalDate,l,!0),c=this.api.time.date(this.api.time.getTimeFromOffsetPx(t.currentPosition.x+m,!0,l)),p=this.api.time.getDatesDiffPx(r,c,l,!0);for(let e=0,i=s.length;e<i;e++){const i=this.api.mergeDeep({},s[e]),r=this.api.mergeDeep({},this.data.initialItemsData[i.id]),h=o.includes(i.id);this.moveItemVertically(i,r,t);const m=this.calculateFinalLeftGlobal({diffPx:p,initialItemData:r,initialItem:i,isDependant:h,movement:a,itemDataToSave:n,time:l}),c=this.calculateFinalRightGlobal({finalLeftGlobalDate:m,initialItemData:r,initialItem:i,isDependant:h,movement:a,time:l});if(!(m.valueOf()<l.from||c.valueOf()>l.to)||"function"!=typeof l.format.periodIncrement&&this.data.allowItemsToGoOutsideTheArea)i.time.start=m.valueOf(),i.time.end=c.valueOf(),r.time.startDate=m,r.time.endDate=c;else{const t=this.api.getItem(i.id);i.time.start=t.time.start,i.time.end=t.time.end,r.time.startDate=this.api.time.date(i.time.start),r.time.endDate=this.api.time.date(i.time.end)}n[i.id]=r,d.push(i)}this.dispatchEvent("onMove",d,t,n),p&&this.autoScroll(t),this.updateData()}onEnd(t){const{itemsToMove:e}=this.getItemsToMove(!1);this.dispatchEvent("onEnd",e,t)}onPointerUp(t){document.body.classList.remove(this.data.bodyClass),this.data.enabled&&this.data.isMoving&&("move"===this.data.state&&(this.data.state="end"),this.data.isMoving=!1,this.onEnd(t),this.updateData(),this.api.plugins.TimelinePointer.unlock("down"),this.api.plugins.TimelinePointer.unlock("move"),this.api.plugins.TimelinePointer.unlock("up"))}itemUpdateAction(t,e){this.data.initialItems.find((t=>t.id===e.item.id))&&this.data.isMoving?t.classList.add(this.data.itemClass):t.classList.remove(this.data.itemClass)}}function i(t={}){return function(i){const a=i.api;if(!a.isPluginInitialized("TimelinePointer"))throw new Error("TimelinePointer plugin must be initialized before ItemMovement plugin.");if(!a.isPluginInitialized("Selection"))throw new Error("Selection plugin must be initialized before ItemMovement plugin.");const s=i.state.get("config.plugin.ItemMovement");s&&(t=i.api.mergeDeep({},t,s));const o=new e(i,t);return a.pluginInitialized("ItemMovement"),o.destroy}}export{i as Plugin};

@@ -10,4 +10,4 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ItemMovement={})}(this,(function(t){"use strict";

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE

@@ -23,5 +23,5 @@ */const e="chart-timeline-items-row-item";

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE
*/const i="config.plugin.ItemMovement";class a{constructor(t,e){this.onDestroy=[],this.scrollWaiting=0,this.vido=t,this.state=t.state,this.api=t.api,this.data=function(t={}){const e={onStart:({items:t})=>t.after,onMove:({items:t})=>t.after,onEnd:({items:t})=>t.after},i={start:({startTime:t,time:e,vido:i})=>i.api.time.findOrCreateMainDateAtTime(t.valueOf(),e).leftGlobalDate,end:({endTime:t})=>t},a={speed:{horizontal:1,vertical:1},edgeThreshold:{horizontal:0,vertical:0}},s=Object.assign({enabled:!0,dependant:!0,moveDependantVertically:!1,addedDependantIds:[],selectedIds:[],debug:!1,state:"",bodyClass:"gstc-items-moving",itemClass:"",movement:{x:0,y:0,time:0},threshold:{horizontal:10,vertical:10},initialItems:[],initialItemsData:{},clickedItem:null,clickedItemData:null,initialVerticalScroll:null,initialHorizontalScroll:null,initialPointerTime:null,isMoving:!1,events:Object.assign({},e),snapToTime:Object.assign({},i),autoScroll:Object.assign({},a),ignoreMissingDates:!0,allowItemsToGoOutsideTheArea:!0},t);return t.snapToTime&&(s.snapToTime=Object.assign(Object.assign({},i),t.snapToTime)),t.events&&(s.events=Object.assign(Object.assign({},e),t.events)),t.autoScroll&&(s.autoScroll=Object.assign(Object.assign({},a),t.autoScroll),t.autoScroll.edgeThreshold&&(s.autoScroll.edgeThreshold=Object.assign(Object.assign({},a.edgeThreshold),t.autoScroll.edgeThreshold)),t.autoScroll.speed&&(s.autoScroll.speed=Object.assign(Object.assign({},a.speed),t.autoScroll.speed))),s}(e),this.data.itemClass||(this.data.itemClass=this.api.getClass("timeline-chart-items-row-item")+"--moving"),this.destroy=this.destroy.bind(this),this.itemUpdateAction=this.itemUpdateAction.bind(this),this.onDestroy.push(this.state.subscribe("$data.elements.chart-timeline",(t=>this.timelineElement=t))),this.updateData(),this.onDestroy.push(this.state.subscribe("config.plugin.ItemMovement",(t=>{t.enabled&&t.isMoving?document.body.classList.add(t.bodyClass):document.body.classList.remove(t.bodyClass),this.data=t}))),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onTimelinePointerDown=this.onTimelinePointerDown.bind(this),this.onTimelinePointerMove=this.onTimelinePointerMove.bind(this),this.onTimelinePointerUp=this.onTimelinePointerUp.bind(this),this.api.plugins.TimelinePointer.addPointerListener("move",this.onTimelinePointerMove),this.api.plugins.TimelinePointer.addPointerListener("down",this.onTimelinePointerDown),this.api.plugins.TimelinePointer.addPointerListener("up",this.onTimelinePointerUp)}destroy(){this.onDestroy.forEach((t=>t())),this.api.plugins.TimelinePointer.removePointerListener("move",this.onTimelinePointerMove),this.api.plugins.TimelinePointer.removePointerListener("down",this.onTimelinePointerDown),this.api.plugins.TimelinePointer.removePointerListener("up",this.onTimelinePointerUp),this.api.pluginDestroyed("ItemMovement")}updateData(){this.state.update(i,this.data)}getSelectedItems(t=!1){return this.state.get(`config.plugin.Selection.selected.${e}`).map((e=>{let i=this.api.getItem(e);if(t)for(const t of this.data.initialItems)if(t.id===e){i=t;break}return this.api.mergeDeep({},i)}))}getSelectedItemsData(t){const e={};for(const i of t)e[i.id]=this.api.mergeDeep({},this.api.getItemData(i.id));return e}getEventArgument(t,e){const i=this.api.getAllItems(),a=[];for(const e of t)a.push(this.api.mergeDeep({},i[e.id]));return{items:{initial:this.data.initialItems,before:a,after:t,targetData:e.targetData},addedDependantIds:this.data.addedDependantIds,selectedIds:this.data.selectedIds,vido:this.vido,state:this.state,time:this.state.get("$data.chart.time")}}getDependantItems(t,e){const i=[],a=this.api.getItemsData();for(const e of t)for(const t of a[e.id].dependant)i.includes(t)||i.push(t);const s=this.state.get("config.chart.items");let o;return o=e?i.map((t=>this.data.initialItems.find((e=>e.id===t)))):i.map((t=>s[t])),o.map((t=>this.api.mergeDeep({},t)))}dispatchEvent(t,e,i,a=null){"onStart"===t&&(this.api.muteMethod("fixOverlapped"),this.api.muteMethod("fullReload"),this.api.muteMethod("measureRows"),this.api.muteMethod("getLastPageRowsHeight"),this.api.muteMethod("calculateVerticalScrollArea"),this.api.muteMethod("heightChange"),this.api.muteMethod("calculateRowsHeight"),this.api.muteMethod("calculateVisibleRowsHeights"),this.api.muteMethod("updateVisibleItemsListener"),this.api.muteMethod("prepareExpanded"),0===this.data.autoScroll.speed.horizontal&&0===this.data.autoScroll.speed.vertical&&(this.api.muteMethod("generateVisibleRowsAndItems"),this.api.muteMethod("prepareExpanded"))),"onEnd"===t&&(this.api.unmuteMethod("fixOverlapped"),this.api.unmuteMethod("heightChange"),this.api.unmuteMethod("calculateVerticalScrollArea"),this.api.unmuteMethod("getLastPageRowsHeight"),this.api.unmuteMethod("fullReload"),this.api.unmuteMethod("measureRows"),this.api.unmuteMethod("calculateRowsHeight"),this.api.unmuteMethod("calculateVisibleRowsHeights"),this.api.unmuteMethod("updateVisibleItemsListener"),this.api.unmuteMethod("prepareExpanded"),0===this.data.autoScroll.speed.horizontal&&0===this.data.autoScroll.speed.vertical&&(this.api.unmuteMethod("generateVisibleRowsAndItems"),this.api.unmuteMethod("prepareExpanded"))),e=e.map((t=>this.api.mergeDeep({},t)));const s=this.data.events[t](this.getEventArgument(e,i));let o=this.state.multi(!0);const n=this.state.get("config.chart.items");for(let t of s){t=this.api.mergeDeep({},t);const e=n[t.id];let i=!1;t.time.start===e.time.start&&t.time.end===e.time.end||(i=!0,o=o.update(`config.chart.items.${t.id}.time`,Object.assign({},t.time)));let s=!1;e.rowId!==t.rowId&&(s=!0,o=o.update(`config.chart.items.${t.id}.rowId`,t.rowId),this.api.updateItemRowMapForItem(t.id,t.rowId)),a&&(i||s)&&(o=o.update(`$data.chart.items.${t.id}`,this.api.mergeDeep({},a[t.id])))}o.done(),"onEnd"===t&&this.api.main.partialReload(!1)}getItemsForDiff(){const t=this.getSelectedItems()[0],e=this.data.initialItems.find((e=>e.id===t.id));return{modified:t,original:e}}onTimelinePointerDown(t){this.data.enabled&&(t.targetType!==e||this.api.plugins.TimelinePointer.isLocked("down")||this.onPointerDown(t))}onTimelinePointerMove(t){this.data.enabled&&t.targetType===e&&"item-movement"===this.api.plugins.TimelinePointer.isLocked("move")&&this.onPointerMove(t)}onTimelinePointerUp(t){this.data.enabled&&t.targetType===e&&"item-movement"===this.api.plugins.TimelinePointer.isLocked("up")&&this.onPointerUp(t)}onPointerDown(t){if(document.body.classList.add(this.data.bodyClass),this.api.plugins.TimelinePointer.lock("down","item-movement"),this.api.plugins.TimelinePointer.lock("move","item-movement"),this.api.plugins.TimelinePointer.lock("up","item-movement"),this.data.isMoving=!0,this.data.dependant){const t=this.getSelectedItems();this.data.selectedIds=t.map((t=>t.id));const e=this.getDependantItems(t,!1).filter((t=>!this.data.selectedIds.includes(t.id)));this.data.addedDependantIds=e.map((t=>t.id)),this.data.initialItems=[...t,...e]}else this.data.addedDependantIds=[],this.data.initialItems=this.getSelectedItems(),this.data.selectedIds=this.data.initialItems.map((t=>t.id));this.data.initialItemsData=this.getSelectedItemsData(this.data.initialItems),this.data.clickedItem=this.api.mergeDeep({},t.targetData),this.data.clickedItemData=this.api.mergeDeep({},this.api.getItemData(this.data.clickedItem.id)),this.data.initialVerticalScroll=this.api.mergeDeep({},this.state.get("$data.scroll.vertical")),this.data.initialHorizontalScroll=this.api.mergeDeep({},this.state.get("$data.scroll.horizontal")),this.data.initialPointerTime=this.api.time.date(this.api.time.getTimeFromOffsetPx(t.initialPosition.x,!0)),this.scrollWaiting=0,""!==this.data.state&&"end"!==this.data.state||(this.data.state="move"),this.dispatchEvent("onStart",this.data.initialItems,t),this.updateData()}scrollLeft(){if(this.data.autoScroll.speed.horizontal&&!this.state.get("config.chart.time.calculatedZoomMode")){if(this.scrollWaiting++,this.data.autoScroll.speed.horizontal<0){if(this.scrollWaiting-1<Math.abs(this.data.autoScroll.speed.horizontal))return;const t=this.api.getScrollLeft();this.api.setScrollLeft(t.dataIndex-1)}else if(this.data.autoScroll.speed.horizontal>0){const t=this.api.getScrollLeft();this.api.setScrollLeft(t.dataIndex-this.data.autoScroll.speed.horizontal)}this.scrollWaiting=0}}scrollRight(){if(this.data.autoScroll.speed.horizontal&&!this.state.get("config.chart.time.calculatedZoomMode")){if(this.scrollWaiting++,this.data.autoScroll.speed.horizontal<0){if(this.scrollWaiting-1<Math.abs(this.data.autoScroll.speed.horizontal))return;const t=this.api.getScrollLeft();this.api.setScrollLeft(t.dataIndex+1)}else if(this.data.autoScroll.speed.horizontal>0){const t=this.api.getScrollLeft();this.api.setScrollLeft(t.dataIndex+this.data.autoScroll.speed.horizontal)}this.scrollWaiting=0}}scrollTop(){if(this.data.autoScroll.speed.vertical){if(this.scrollWaiting++,this.data.autoScroll.speed.vertical<0){if(this.scrollWaiting-1<Math.abs(this.data.autoScroll.speed.vertical))return;const t=this.api.getScrollTop();this.api.setScrollTop(t.dataIndex-1)}else if(this.data.autoScroll.speed.vertical>0){const t=this.api.getScrollTop();this.api.setScrollTop(t.dataIndex-this.data.autoScroll.speed.vertical)}this.scrollWaiting=0}}scrollBottom(){if(this.data.autoScroll.speed.vertical){if(this.scrollWaiting++,this.data.autoScroll.speed.vertical<0){if(this.scrollWaiting-1<Math.abs(this.data.autoScroll.speed.vertical))return;const t=this.api.getScrollTop();this.api.setScrollTop(t.dataIndex+1)}else if(this.data.autoScroll.speed.vertical>0){const t=this.api.getScrollTop();this.api.setScrollTop(t.dataIndex+this.data.autoScroll.speed.vertical)}this.scrollWaiting=0}}autoScroll(t){if(!this.timelineElement)return;const e=t.currentPosition.x,i=t.currentPosition.y,a=this.state.get("$data.chart.dimensions");e<this.data.autoScroll.edgeThreshold.horizontal?this.scrollLeft():e>a.widthWithoutScrollBar-this.data.autoScroll.edgeThreshold.horizontal?this.scrollRight():i<this.data.autoScroll.edgeThreshold.vertical?this.scrollTop():i>a.innerHeight-this.data.autoScroll.edgeThreshold.vertical&&this.scrollBottom()}moveItemVertically(t,e,i){if(this.data.addedDependantIds.includes(t.id)&&!this.data.moveDependantVertically)return;const a=this.state.get("$data.scroll.vertical").absolutePosPx-this.data.initialVerticalScroll.absolutePosPx,s=i.currentPosition.y-i.initialPosition.y,o=this.data.clickedItemData.position.viewTop-i.initialPosition.y-this.data.clickedItemData.position.rowTop;let n=e.position.top+s+a-o;n<0&&(n=0);const l=this.api.getRowInfoFromTop(n);l.row.id!==t.rowId&&(t.rowId=l.row.id,e.position.viewTop=this.api.getRowViewTop(t.rowId),e.position.rowTop=0)}getItemsToMove(t=!1){let e,i=[];if(this.data.dependant){const a=this.getSelectedItems(t),s=a.map((t=>t.id)),o=this.getDependantItems(a,t).filter((t=>!s.includes(t.id)));i=o.map((t=>t.id)),e=[...a,...o]}else e=this.getSelectedItems(t);return{itemsToMove:e,dependantIds:i}}calculateFinalLeftGlobal({diffPx:t,initialItemData:e,initialItem:i,isDependant:a,movement:s,itemDataToSave:o,time:n}){const l=e.position.left+t;let d=this.api.time.getTimeFromOffsetPx(l,!0,n);if(a){const t=this.data.initialItems.find((t=>{var e;return null===(e=t.dependant)||void 0===e?void 0:e.includes(i.id)})),a=this.data.initialItemsData[t.id],s=o[a.id],l=this.api.time.getDatesDiffMs(a.time.endDate,s.time.endDate,n,!0);let r=-this.api.time.getDSTDiffForLevel(n.level,a.time.endDate.valueOf(),e.time.startDate.valueOf(),n);d=this.api.time.addTimeFromDates(e.time.startDate.valueOf(),l+r,n),r=this.api.time.getDSTDiffForLevel(n.level,s.time.endDate.valueOf(),d,n),d+=r}const r=this.api.time.date(d);let h=r;return a||(h=this.data.snapToTime.start({startTime:r,item:i,time:n,movement:s,vido:this.vido})),h}calculateFinalRightGlobal({finalLeftGlobalDate:t,initialItemData:e,initialItem:i,isDependant:a,movement:s,time:o}){const n=this.api.time.getViewOffsetPxFromDates(t,!1,o);let l=-this.api.time.getDSTDiffForLevel(o.level,i.time.start,i.time.end,o);const d=n+e.timeWidth;let r;const h=i.time.end-i.time.start;r=this.data.ignoreMissingDates?this.api.time.date(this.api.time.getTimeFromOffsetPx(d,!0,o)):this.api.time.date(t.valueOf()+h),l+=this.api.time.getDSTDiffForLevel(o.level,t.valueOf(),r.valueOf(),o),r=r.add(l,"ms");let m=r;return a||(m=this.data.snapToTime.end({endTime:r,item:i,time:o,movement:s,vido:this.vido})),m}onPointerMove(t){if(!this.data.enabled)return;if(!this.data.isMoving)return;const{original:e,modified:i}=this.getItemsForDiff();if(!e)return;const a=this.data.movement=Object.assign(Object.assign({},t.movement),{time:i.time.start-e.time.start});"move"!==this.data.state&&"start"!==this.data.state||(this.data.state="move");const{itemsToMove:s,dependantIds:o}=this.getItemsToMove(!0),n={},l=this.state.get("$data.chart.time"),d=[],r=this.data.snapToTime.start({startTime:this.data.initialPointerTime,item:null,time:l,movement:a,vido:this.vido}),h=this.state.get("$data.scroll.horizontal"),m=this.api.time.getDatesDiffPx(h.data.leftGlobalDate,this.data.initialHorizontalScroll.data.leftGlobalDate,l,!0),c=this.api.time.date(this.api.time.getTimeFromOffsetPx(t.currentPosition.x+m,!0,l)),p=this.api.time.getDatesDiffPx(r,c,l,!0);for(let e=0,i=s.length;e<i;e++){const i=this.api.mergeDeep({},s[e]),r=this.api.mergeDeep({},this.data.initialItemsData[i.id]),h=o.includes(i.id);this.moveItemVertically(i,r,t);const m=this.calculateFinalLeftGlobal({diffPx:p,initialItemData:r,initialItem:i,isDependant:h,movement:a,itemDataToSave:n,time:l}),c=this.calculateFinalRightGlobal({finalLeftGlobalDate:m,initialItemData:r,initialItem:i,isDependant:h,movement:a,time:l});if(!(m.valueOf()<l.from||c.valueOf()>l.to)||"function"!=typeof l.format.periodIncrement&&this.data.allowItemsToGoOutsideTheArea)i.time.start=m.valueOf(),i.time.end=c.valueOf(),r.time.startDate=m,r.time.endDate=c;else{const t=this.api.getItem(i.id);i.time.start=t.time.start,i.time.end=t.time.end,r.time.startDate=this.api.time.date(i.time.start),r.time.endDate=this.api.time.date(i.time.end)}n[i.id]=r,d.push(i)}this.dispatchEvent("onMove",d,t,n),p&&this.autoScroll(t),this.updateData()}onEnd(t){const{itemsToMove:e}=this.getItemsToMove(!1);this.dispatchEvent("onEnd",e,t)}onPointerUp(t){document.body.classList.remove(this.data.bodyClass),this.data.enabled&&this.data.isMoving&&("move"===this.data.state&&(this.data.state="end"),this.data.isMoving=!1,this.onEnd(t),this.updateData(),this.api.plugins.TimelinePointer.unlock("down"),this.api.plugins.TimelinePointer.unlock("move"),this.api.plugins.TimelinePointer.unlock("up"))}itemUpdateAction(t,e){this.data.initialItems.find((t=>t.id===e.item.id))&&this.data.isMoving?t.classList.add(this.data.itemClass):t.classList.remove(this.data.itemClass)}}t.Plugin=function(t={}){return function(e){const s=e.api;if(!s.isPluginInitialized("TimelinePointer"))throw new Error("TimelinePointer plugin must be initialized before ItemMovement plugin.");if(!s.isPluginInitialized("Selection"))throw new Error("Selection plugin must be initialized before ItemMovement plugin.");const o=e.state.get(i);o&&(t=e.api.mergeDeep({},t,o));const n=new a(e,t);return s.pluginInitialized("ItemMovement"),n.destroy}},Object.defineProperty(t,"__esModule",{value:!0})}));

@@ -9,4 +9,4 @@ /**

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE

@@ -23,4 +23,4 @@ */

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE

@@ -36,5 +36,5 @@ */function e(t,e=""){let i=`gstc__${t}`;return"gstc"===t&&(i="gstc"),e?`${i} ${i}--${e.replace(":","-")}`:i}

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE
*/const i=e("chart-timeline-items-row-item-resizing-handle-content-line");const s="config.plugin.ItemResizing",a="chart-timeline-items-row-item-resizing-handle",n=e(a);class o{constructor(t,e){this.onDestroy=[],this.scrollWaiting=0,this.vido=t,this.state=t.state,this.api=t.api,this.data=function(t={}){const e={onStart:({items:t})=>t.after,onResize:({items:t})=>t.after,onEnd:({items:t})=>t.after},i={start:({startTime:t,time:e,vido:i})=>i.api.time.findOrCreateMainDateAtTime(t.valueOf(),e).leftGlobalDate,end:({endTime:t,time:e,vido:i})=>i.api.time.findOrCreateMainDateAtTime(t.valueOf(),e).rightGlobalDate},s={width:18,horizontalMargin:0,verticalMargin:0,outside:!1,outsideWidth:14,outsideHorizontalMargin:6,onlyWhenSelected:!0},a=Object.assign({enabled:!0,dependant:!0,addedDependantIds:[],selectedIds:[],debug:!1,state:"",content:null,bodyClass:"gstc-items-resizing",bodyClassLeft:"gstc-items-resizing-left",bodyClassRight:"gstc-items-resizing-right",outsideWidthThreshold:100,movement:{px:0,time:0},initialItems:[],initialItemsData:{},initialHorizontalScroll:null,leftIsMoving:!1,rightIsMoving:!1,handle:Object.assign({},s),events:Object.assign({},e),snapToTime:Object.assign({},i),autoScroll:{speed:1,edgeThreshold:0},ignoreMissingDates:!0,allowItemsToGoOutsideTheArea:!0},t);return t.snapToTime&&(a.snapToTime=Object.assign(Object.assign({},i),t.snapToTime)),t.events&&(a.events=Object.assign(Object.assign({},e),t.events)),t.handle&&(a.handle=Object.assign(Object.assign({},s),t.handle)),t.autoScroll&&(a.autoScroll=Object.assign(Object.assign({},a.autoScroll),t.autoScroll)),a}(e),this.html=t.html,this.data.content||(this.data.content={left:this.html`<div class=${i}></div><div class=${i}></div>`,right:this.html`<div class=${i}></div><div class=${i}></div>`}),this.PluginItemResizingInnerSlot=this.PluginItemResizingInnerSlot.bind(this),this.PluginItemResizingOuterSlot=this.PluginItemResizingOuterSlot.bind(this),this.onRightPointerDown=this.onRightPointerDown.bind(this),this.onRightPointerMove=this.onRightPointerMove.bind(this),this.onRightPointerUp=this.onRightPointerUp.bind(this),this.onLeftPointerDown=this.onLeftPointerDown.bind(this),this.onLeftPointerMove=this.onLeftPointerMove.bind(this),this.onLeftPointerUp=this.onLeftPointerUp.bind(this),this.destroy=this.destroy.bind(this),this.updateData(),this.onDestroy.push(this.state.subscribe("$data.elements.chart-timeline",(t=>this.timelineElement=t))),this.onDestroy.push(this.state.subscribe(s,(t=>{t.enabled?document.body.classList.add(t.bodyClass):document.body.classList.remove(t.bodyClass),this.data=t}))),this.onTimelinePointerDown=this.onTimelinePointerDown.bind(this),this.onTimelinePointerMove=this.onTimelinePointerMove.bind(this),this.onTimelinePointerUp=this.onTimelinePointerUp.bind(this),this.api.plugins.TimelinePointer.addPointerListener("move",this.onTimelinePointerMove),this.api.plugins.TimelinePointer.addPointerListener("down",this.onTimelinePointerDown),this.api.plugins.TimelinePointer.addPointerListener("up",this.onTimelinePointerUp),this.state.update("config.slots.chart-timeline-items-row-item.inner",(t=>(t.includes(this.PluginItemResizingInnerSlot)||t.push(this.PluginItemResizingInnerSlot),t))),this.state.update("config.slots.chart-timeline-items-row-item.outer",(t=>(t.includes(this.PluginItemResizingOuterSlot)||t.push(this.PluginItemResizingOuterSlot),t)))}destroy(){this.onDestroy.forEach((t=>t())),this.api.plugins.TimelinePointer.removePointerListener("move",this.onTimelinePointerMove),this.api.plugins.TimelinePointer.removePointerListener("down",this.onTimelinePointerDown),this.api.plugins.TimelinePointer.removePointerListener("up",this.onTimelinePointerUp),this.state.update("config.slots.chart-timeline-items-row-item.inner",(t=>t.filter((t=>t!==this.PluginItemResizingInnerSlot)))),this.state.update("config.slots.chart-timeline-items-row-item.outer",(t=>t.filter((t=>t!==this.PluginItemResizingOuterSlot)))),this.api.pluginDestroyed("ItemResizing")}updateData(){this.state.update(s,this.data)}setUpClasses(t=!1){this.leftClassName=this.api.getClass(a),this.leftClassName+=" "+this.leftClassName+"--left",this.rightClassName=this.api.getClass(a),this.rightClassName+=" "+this.rightClassName+"--right",t&&(this.leftClassName+=` ${this.api.getClass(a)}--left-outside`,this.rightClassName+=` ${this.api.getClass(a)}--right-outside`)}getSelectedItems(){return this.state.get(`config.plugin.Selection.selected.${t}`).map((t=>this.api.mergeDeep({},this.api.getItem(t))))}getSelectedItemsData(t){const e={};for(const i of t)e[i.id]=this.api.mergeDeep({},this.api.getItemData(i.id));return e}updateRightStyleMap(t,e){const i=this.api.getItemData(t.id);return e.style.top="0px",this.data.handle.outside||i.actualWidth<this.data.outsideWidthThreshold?(e.style.position="absolute",e.style.left=i.position.actualRight+this.data.handle.outsideHorizontalMargin+"px",e.style.width=this.data.handle.outsideWidth+"px",e.style.top=i.position.actualRowTop+"px",this.setUpClasses(!0)):(e.style.position="static",e.style.width=this.data.handle.width+"px",this.setUpClasses(!1)),e.style.height=i.actualHeight-2*this.data.handle.verticalMargin+"px",i.outOfView.right?e.style.display="none":e.style.display="flex",e}updateLeftStyleMap(t,e){const i=this.api.getItemData(t.id);return e.style.top="0px",this.data.handle.outside||i.actualWidth<this.data.outsideWidthThreshold?(e.style.position="absolute",e.style.left=i.position.actualLeft-(this.data.handle.outsideWidth+this.data.handle.outsideHorizontalMargin)+"px",e.style.width=this.data.handle.outsideWidth+"px",e.style.top=i.position.actualRowTop+"px",this.setUpClasses(!0)):(e.style.position="static",e.style.left=this.data.handle.horizontalMargin+"px",e.style.width=this.data.handle.width+"px",this.setUpClasses(!1)),e.style.height=i.actualHeight-2*this.data.handle.verticalMargin+"px",i.outOfView.left?e.style.display="none":e.style.display="flex",e}getEventArgument(t){const e=this.api.getAllItems(),i=[];for(const s of t)i.push(this.api.mergeDeep({},e[s.id]));return{items:{initial:this.data.initialItems,before:i,after:t},addedDependantIds:this.data.addedDependantIds,selectedIds:this.data.selectedIds,vido:this.vido,state:this.state,time:this.state.get("$data.chart.time")}}getDependantItems(t){const e=[],i=this.api.getItemsData();for(const s of t)for(const t of i[s.id].dependant)e.includes(t)||e.push(t);const s=this.state.get("config.chart.items");return e.map((t=>s[t])).map((t=>this.api.mergeDeep({},t)))}dispatchEvent(t,e,i=null){"onStart"===t&&(this.api.muteMethod("fixOverlapped"),this.api.muteMethod("fullReload"),this.api.muteMethod("recalculateRowPercents"),this.api.muteMethod("getLastPageRowsHeight"),this.api.muteMethod("calculateVerticalScrollArea"),this.api.muteMethod("heightChange"),this.api.muteMethod("calculateRowsHeight"),this.api.muteMethod("updateVisibleItemsListener"),this.api.muteMethod("prepareExpanded"),0===this.data.autoScroll.speed&&0===this.data.autoScroll.speed&&(this.api.muteMethod("generateVisibleRowsAndItems"),this.api.muteMethod("calculateVisibleRowsHeights"),this.api.muteMethod("prepareExpanded"))),"onEnd"===t&&(this.api.unmuteMethod("fixOverlapped"),this.api.unmuteMethod("heightChange"),this.api.unmuteMethod("calculateVerticalScrollArea"),this.api.unmuteMethod("getLastPageRowsHeight"),this.api.unmuteMethod("recalculateRowPercents"),this.api.unmuteMethod("fullReload"),this.api.unmuteMethod("calculateRowsHeight"),this.api.unmuteMethod("updateVisibleItemsListener"),this.api.unmuteMethod("prepareExpanded"),0===this.data.autoScroll.speed&&0===this.data.autoScroll.speed&&(this.api.unmuteMethod("generateVisibleRowsAndItems"),this.api.unmuteMethod("calculateVisibleRowsHeights"),this.api.unmuteMethod("prepareExpanded"))),e=e.map((t=>this.api.mergeDeep({},t)));const s=this.data.events[t](this.getEventArgument(e));let a=this.state.multi(!0);const n=this.state.get("config.chart.items");for(const t of s){let e=!1;const s=n[t.id];t.time.start===s.time.start&&t.time.end===s.time.end||(e=!0,a=a.update(`config.chart.items.${t.id}.time`,t.time)),i&&e&&(a=a.update(`$data.chart.items.${t.id}`,this.api.mergeDeep({},i[t.id])))}a.done(),"onEnd"===t&&this.api.main.partialReload(!1)}getItemsForDiff(){const t=this.getSelectedItems()[0],e=this.data.initialItems.find((e=>e.id===t.id));return{modified:t,original:e}}onTimelinePointerDown(e){this.data.enabled&&(e.targetType!==t||this.api.plugins.TimelinePointer.isLocked("down")||this.onPointerDown(e))}onTimelinePointerMove(e){this.data.enabled&&e.targetType===t&&"item-resizing"===this.api.plugins.TimelinePointer.isLocked("move")&&this.onPointerMove(e)}onTimelinePointerUp(e){this.data.enabled&&e.targetType===t&&"item-resizing"===this.api.plugins.TimelinePointer.isLocked("up")&&this.onPointerUp(e)}onPointerDown(t){const e=t.originalEvent.target.closest("."+n);if(e&&!this.api.plugins.TimelinePointer.isLocked("down")){if(this.api.plugins.TimelinePointer.lock("down","item-resizing"),this.api.plugins.TimelinePointer.lock("move","item-resizing"),this.api.plugins.TimelinePointer.lock("up","item-resizing"),t.originalEvent.preventDefault(),t.originalEvent.stopPropagation(),this.data.dependant){const t=this.getSelectedItems();this.data.selectedIds=t.map((t=>t.id));const e=this.getDependantItems(t).filter((t=>!this.data.selectedIds.includes(t.id)));this.data.addedDependantIds=e.map((t=>t.id)),this.data.initialItems=[...t,...e]}else this.data.initialItems=this.getSelectedItems(),this.data.addedDependantIds=[],this.data.selectedIds=this.data.initialItems.map((t=>t.id));this.data.initialItemsData=this.getSelectedItemsData(this.data.initialItems),this.data.initialHorizontalScroll=this.api.mergeDeep({},this.state.get("$data.scroll.horizontal")),""!==this.data.state&&"end"!==this.data.state||(this.data.state="resize"),e.classList.contains(n+"--left")&&this.onLeftPointerDown(),e.classList.contains(n+"--right")&&this.onRightPointerDown(),this.dispatchEvent("onStart",this.data.initialItems)}}onLeftPointerDown(){this.data.enabled&&(document.body.classList.add(this.data.bodyClassLeft),this.data.leftIsMoving=!0,this.updateData())}onRightPointerDown(){this.data.enabled&&(document.body.classList.add(this.data.bodyClassRight),this.data.rightIsMoving=!0,this.updateData())}scrollLeft(){if(this.data.autoScroll.speed&&!this.state.get("config.chart.time.calculatedZoomMode")){if(this.scrollWaiting++,this.data.autoScroll.speed<0){if(this.scrollWaiting-1<Math.abs(this.data.autoScroll.speed))return;const t=this.api.getScrollLeft();this.api.setScrollLeft(t.dataIndex-1)}else if(this.data.autoScroll.speed>0){const t=this.api.getScrollLeft();this.api.setScrollLeft(t.dataIndex-this.data.autoScroll.speed)}this.scrollWaiting=0}}scrollRight(){if(this.data.autoScroll.speed&&!this.state.get("config.chart.time.calculatedZoomMode")){if(this.scrollWaiting++,this.data.autoScroll.speed<0){if(this.scrollWaiting-1<Math.abs(this.data.autoScroll.speed))return;const t=this.api.getScrollLeft();this.api.setScrollLeft(t.dataIndex+1)}else if(this.data.autoScroll.speed>0){const t=this.api.getScrollLeft();this.api.setScrollLeft(t.dataIndex+this.data.autoScroll.speed)}this.scrollWaiting=0}}autoScroll(t){if(!this.timelineElement)return;const e=t.currentPosition.x,i=this.timelineElement.getBoundingClientRect();e<this.data.autoScroll.edgeThreshold?this.scrollLeft():e>i.width-this.data.autoScroll.edgeThreshold&&this.scrollRight()}onPointerMove(t){if(!this.data.enabled)return;const{original:e,modified:i}=this.getItemsForDiff();e&&(this.data.movement={px:t.movement.x,time:i.time.start-e.time.start},"resize"!==this.data.state&&"start"!==this.data.state||(this.data.state="resize"),t.movement.x&&this.autoScroll(t),this.data.leftIsMoving&&this.onLeftPointerMove(t),this.data.rightIsMoving&&this.onRightPointerMove(t))}onLeftPointerMove(t){if(!this.data.enabled||!this.data.leftIsMoving)return;const e=this.getSelectedItems(),i={},s=this.state.get("$data.chart.time"),{original:a,modified:n}=this.getItemsForDiff(),o=this.data.movement={px:t.movement.x,time:n.time.start-a.time.start},d=this.api.time.date(this.api.time.getTimeFromOffsetPx(t.initialPosition.x,!0,s)),h=this.data.snapToTime.start({startTime:d,item:e[0],time:s,movement:o,vido:this.vido}),l=this.api.time.date(this.api.time.getTimeFromOffsetPx(t.currentPosition.x,!0,s)),r=this.api.time.getDatesDiffPx(h,l,s,!0);for(let t=0,a=e.length;t<a;t++){const a=e[t],n=this.api.mergeDeep({},this.api.getItemData(a.id));let d=this.api.mergeDeep({},this.data.initialItemsData[a.id]).position.left+r;d>n.position.right-a.minWidth&&(d=n.position.right-a.minWidth);const h=this.api.time.getTimeFromOffsetPx(d,!0,s),l=this.data.snapToTime.start({startTime:this.api.time.date(h),item:a,time:s,movement:o,vido:this.vido});a.time.start=l.valueOf(),n.time.startDate=l;if((a.time.start<s.from||a.time.end>s.to)&&("function"==typeof s.format.periodIncrement||!this.data.allowItemsToGoOutsideTheArea)){const t=this.api.getItem(a.id);a.time.start=t.time.start,a.time.end=t.time.end,n.time.startDate=this.api.time.date(a.time.start),n.time.endDate=this.api.time.date(a.time.end)}i[a.id]=n}this.dispatchEvent("onResize",e,i),this.updateData()}getItemsToMove(){let t,e,i=[];if(this.data.dependant){const s=this.getSelectedItems();e=s.map((t=>t.id));const a=this.getDependantItems(s).filter((t=>!e.includes(t.id)));i=a.map((t=>t.id)),t=[...s,...a]}else t=this.getSelectedItems();return{itemsToMove:t,dependantIds:i}}onRightPointerMove(t){if(!this.data.enabled||!this.data.rightIsMoving)return;const{itemsToMove:e,dependantIds:i}=this.getItemsToMove(),s={},a=this.state.get("$data.chart.time"),{original:n,modified:o}=this.getItemsForDiff(),d=this.data.movement={px:t.movement.x,time:o.time.start-n.time.start},h=this.api.time.date(this.api.time.getTimeFromOffsetPx(t.initialPosition.x,!0,a)),l=this.data.snapToTime.end({endTime:h,item:null,time:a,movement:d,vido:this.vido}),r=this.api.time.date(this.api.time.getTimeFromOffsetPx(t.currentPosition.x,!0,a)),m=this.api.time.getDatesDiffPx(l,r,a,!0);for(let t=0,n=e.length;t<n;t++){const n=e[t],o=this.api.mergeDeep({},this.api.getItemData(n.id)),h=this.api.mergeDeep({},this.data.initialItemsData[n.id]),l=i.includes(n.id);let r=h.position.left+h.timeWidth+m;!l&&r<o.position.left+n.minWidth&&(r=o.position.left+n.minWidth);const p=this.api.time.getTimeFromOffsetPx(r,!0,a);let c=this.api.time.date(p);if(l||(c=this.data.snapToTime.end({endTime:this.api.time.date(p),item:n,time:a,movement:d,vido:this.vido})),l){const t=this.data.initialItems.find((t=>t.dependant.includes(h.id))),e=this.data.initialItemsData[t.id],i=s[e.id],d=this.api.time.getDatesDiffMs(e.time.endDate,i.time.endDate,a,!0);let l=-this.api.time.getDSTDiffForLevel(a.level,e.time.endDate.valueOf(),h.time.startDate.valueOf(),a),r=this.api.time.addTimeFromDates(h.time.startDate.valueOf(),d+l,a);l=this.api.time.getDSTDiffForLevel(a.level,i.time.endDate.valueOf(),r,a),r+=l;const m=this.api.time.date(r),p=m.valueOf(),g=this.api.time.getViewOffsetPxFromDates(m,!1,a);let u=-this.api.time.getDSTDiffForLevel(a.level,h.time.startDate.valueOf(),h.time.endDate.valueOf(),a);const f=g+h.timeWidth;let v;const I=h.time.endDate.valueOf()-h.time.startDate.valueOf();v=this.data.ignoreMissingDates?this.api.time.date(this.api.time.getTimeFromOffsetPx(f,!0,a)):this.api.time.date(m.valueOf()+I),u+=this.api.time.getDSTDiffForLevel(a.level,p,v.valueOf(),a),v=v.add(u,"ms"),c=v,n.time.start=m.valueOf(),o.time.startDate=m}n.time.end=c.valueOf(),o.time.endDate=c;if((n.time.start<a.from||n.time.end>a.to)&&("function"==typeof a.format.periodIncrement||!this.data.allowItemsToGoOutsideTheArea)){const t=this.api.getItem(n.id);n.time.start=t.time.start,n.time.end=t.time.end,o.time.startDate=this.api.time.date(n.time.start),o.time.endDate=this.api.time.date(n.time.end)}s[n.id]=o}this.dispatchEvent("onResize",e,s),this.updateData()}onEnd(){const{itemsToMove:t}=this.getItemsToMove();this.dispatchEvent("onEnd",t)}onPointerUp(t){"resize"===this.data.state&&(this.data.state="end"),this.onLeftPointerUp(),this.onRightPointerUp(),this.onEnd(),this.updateData(),this.api.plugins.TimelinePointer.unlock("down"),this.api.plugins.TimelinePointer.unlock("move"),this.api.plugins.TimelinePointer.unlock("up")}onLeftPointerUp(){document.body.classList.remove(this.data.bodyClassLeft),this.data.enabled&&this.data.leftIsMoving&&(this.data.leftIsMoving=!1,this.updateData())}onRightPointerUp(){document.body.classList.remove(this.data.bodyClassRight),this.data.enabled&&this.data.rightIsMoving&&(this.data.rightIsMoving=!1)}PluginItemResizingInnerSlot(t,e){let i,s,a;const n=new t.StyleMap({}),o=new t.StyleMap({});return t.onChange((d=>{if(!(e=d)||!e.item)return;const h=e.item;if(!h)return;const l=this.api.getItemData(h.id);if(!l)return;let r;i=!l.detached,this.data.handle.onlyWhenSelected&&(i=i&&l.selected),i=i&&!(this.data.handle.outside||l.actualWidth<this.data.outsideWidthThreshold),this.updateRightStyleMap(h,o),this.updateLeftStyleMap(h,n),r="function"==typeof this.data.content?this.data.content({item:h,vido:t}):"object"!=typeof this.data.content||"left"in this.data.content?this.data.content:{left:this.data.content,right:this.data.content},s=this.html`<div class=${this.leftClassName} data-gstcid=${e.item.id} style=${n.directive()}>${r.left}</div>`,a=this.html`<div class=${this.rightClassName} data-gstcid=${e.item.id} style=${o.directive()}>${r.right}</div>`,t.update()})),t=>this.html`${i?s:null}${t}${i?a:null}`}PluginItemResizingOuterSlot(e,i){let s,a,n;const o=new e.StyleMap({}),d=new e.StyleMap({});return e.onChange((h=>{if(!(i=h)||!i.item)return;const l=i.item;if(!l)return;const r=this.api.getItemData(l.id);if(!r)return;let m;s=!r.detached,this.data.handle.onlyWhenSelected&&(s=s&&r.selected),s=s&&(this.data.handle.outside||r.actualWidth<this.data.outsideWidthThreshold),this.updateRightStyleMap(l,d),this.updateLeftStyleMap(l,o),m="function"==typeof this.data.content?this.data.content({item:l,vido:e}):"object"!=typeof this.data.content||"left"in this.data.content?this.data.content:{left:this.data.content,right:this.data.content},a=this.html`<div class=${this.leftClassName} data-type=${t} data-gstcid=${i.item.id} style=${o.directive()}>${m.left}</div>`,n=this.html`<div class=${this.rightClassName} data-type=${t} data-gstcid=${i.item.id} style=${d.directive()}>${m.right}</div>`,e.update()})),t=>this.html`${s?a:null}${t}${s?n:null}`}}function d(t={}){return function(e){const i=e.api;if(!i.isPluginInitialized("TimelinePointer"))throw new Error("TimelinePointer plugin must be initialized before ItemResizing plugin.");if(!i.isPluginInitialized("Selection"))throw new Error("Selection plugin must be initialized before ItemResizing plugin.");if(i.isPluginInitialized("ItemMovement"))throw new Error("ItemResizing plugin must be initialized before ItemMovement plugin.");const a=e.state.get(s);a&&(t=e.api.mergeDeep({},t,a));const n=new o(e,t);return i.pluginInitialized("ItemResizing"),n.destroy}}export{d as Plugin};

@@ -10,4 +10,4 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ItemResizing={})}(this,(function(t){"use strict";

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE

@@ -23,4 +23,4 @@ */const e="chart-timeline-items-row-item",i="gstc";

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE

@@ -36,5 +36,5 @@ */function s(t,e=""){let s=`gstc__${t}`;return t===i&&(s=i),e?`${s} ${s}--${e.replace(":","-")}`:s}

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE
*/const a=s("chart-timeline-items-row-item-resizing-handle-content-line");const n="ItemResizing",o="config.plugin.ItemResizing",d="chart-timeline-items-row-item-resizing-handle",l=s(d),h="--left",r="--right";class m{constructor(t,e){this.onDestroy=[],this.scrollWaiting=0,this.vido=t,this.state=t.state,this.api=t.api,this.data=function(t={}){const e={onStart:({items:t})=>t.after,onResize:({items:t})=>t.after,onEnd:({items:t})=>t.after},i={start:({startTime:t,time:e,vido:i})=>i.api.time.findOrCreateMainDateAtTime(t.valueOf(),e).leftGlobalDate,end:({endTime:t,time:e,vido:i})=>i.api.time.findOrCreateMainDateAtTime(t.valueOf(),e).rightGlobalDate},s={width:18,horizontalMargin:0,verticalMargin:0,outside:!1,outsideWidth:14,outsideHorizontalMargin:6,onlyWhenSelected:!0},a=Object.assign({enabled:!0,dependant:!0,addedDependantIds:[],selectedIds:[],debug:!1,state:"",content:null,bodyClass:"gstc-items-resizing",bodyClassLeft:"gstc-items-resizing-left",bodyClassRight:"gstc-items-resizing-right",outsideWidthThreshold:100,movement:{px:0,time:0},initialItems:[],initialItemsData:{},initialHorizontalScroll:null,leftIsMoving:!1,rightIsMoving:!1,handle:Object.assign({},s),events:Object.assign({},e),snapToTime:Object.assign({},i),autoScroll:{speed:1,edgeThreshold:0},ignoreMissingDates:!0,allowItemsToGoOutsideTheArea:!0},t);return t.snapToTime&&(a.snapToTime=Object.assign(Object.assign({},i),t.snapToTime)),t.events&&(a.events=Object.assign(Object.assign({},e),t.events)),t.handle&&(a.handle=Object.assign(Object.assign({},s),t.handle)),t.autoScroll&&(a.autoScroll=Object.assign(Object.assign({},a.autoScroll),t.autoScroll)),a}(e),this.html=t.html,this.data.content||(this.data.content={left:this.html`<div class=${a}></div><div class=${a}></div>`,right:this.html`<div class=${a}></div><div class=${a}></div>`}),this.PluginItemResizingInnerSlot=this.PluginItemResizingInnerSlot.bind(this),this.PluginItemResizingOuterSlot=this.PluginItemResizingOuterSlot.bind(this),this.onRightPointerDown=this.onRightPointerDown.bind(this),this.onRightPointerMove=this.onRightPointerMove.bind(this),this.onRightPointerUp=this.onRightPointerUp.bind(this),this.onLeftPointerDown=this.onLeftPointerDown.bind(this),this.onLeftPointerMove=this.onLeftPointerMove.bind(this),this.onLeftPointerUp=this.onLeftPointerUp.bind(this),this.destroy=this.destroy.bind(this),this.updateData(),this.onDestroy.push(this.state.subscribe("$data.elements.chart-timeline",(t=>this.timelineElement=t))),this.onDestroy.push(this.state.subscribe(o,(t=>{t.enabled?document.body.classList.add(t.bodyClass):document.body.classList.remove(t.bodyClass),this.data=t}))),this.onTimelinePointerDown=this.onTimelinePointerDown.bind(this),this.onTimelinePointerMove=this.onTimelinePointerMove.bind(this),this.onTimelinePointerUp=this.onTimelinePointerUp.bind(this),this.api.plugins.TimelinePointer.addPointerListener("move",this.onTimelinePointerMove),this.api.plugins.TimelinePointer.addPointerListener("down",this.onTimelinePointerDown),this.api.plugins.TimelinePointer.addPointerListener("up",this.onTimelinePointerUp),this.state.update("config.slots.chart-timeline-items-row-item.inner",(t=>(t.includes(this.PluginItemResizingInnerSlot)||t.push(this.PluginItemResizingInnerSlot),t))),this.state.update("config.slots.chart-timeline-items-row-item.outer",(t=>(t.includes(this.PluginItemResizingOuterSlot)||t.push(this.PluginItemResizingOuterSlot),t)))}destroy(){this.onDestroy.forEach((t=>t())),this.api.plugins.TimelinePointer.removePointerListener("move",this.onTimelinePointerMove),this.api.plugins.TimelinePointer.removePointerListener("down",this.onTimelinePointerDown),this.api.plugins.TimelinePointer.removePointerListener("up",this.onTimelinePointerUp),this.state.update("config.slots.chart-timeline-items-row-item.inner",(t=>t.filter((t=>t!==this.PluginItemResizingInnerSlot)))),this.state.update("config.slots.chart-timeline-items-row-item.outer",(t=>t.filter((t=>t!==this.PluginItemResizingOuterSlot)))),this.api.pluginDestroyed(n)}updateData(){this.state.update(o,this.data)}setUpClasses(t=!1){this.leftClassName=this.api.getClass(d),this.leftClassName+=" "+this.leftClassName+h,this.rightClassName=this.api.getClass(d),this.rightClassName+=" "+this.rightClassName+r,t&&(this.leftClassName+=` ${this.api.getClass(d)}--left-outside`,this.rightClassName+=` ${this.api.getClass(d)}--right-outside`)}getSelectedItems(){return this.state.get(`config.plugin.Selection.selected.${e}`).map((t=>this.api.mergeDeep({},this.api.getItem(t))))}getSelectedItemsData(t){const e={};for(const i of t)e[i.id]=this.api.mergeDeep({},this.api.getItemData(i.id));return e}updateRightStyleMap(t,e){const i=this.api.getItemData(t.id);return e.style.top="0px",this.data.handle.outside||i.actualWidth<this.data.outsideWidthThreshold?(e.style.position="absolute",e.style.left=i.position.actualRight+this.data.handle.outsideHorizontalMargin+"px",e.style.width=this.data.handle.outsideWidth+"px",e.style.top=i.position.actualRowTop+"px",this.setUpClasses(!0)):(e.style.position="static",e.style.width=this.data.handle.width+"px",this.setUpClasses(!1)),e.style.height=i.actualHeight-2*this.data.handle.verticalMargin+"px",i.outOfView.right?e.style.display="none":e.style.display="flex",e}updateLeftStyleMap(t,e){const i=this.api.getItemData(t.id);return e.style.top="0px",this.data.handle.outside||i.actualWidth<this.data.outsideWidthThreshold?(e.style.position="absolute",e.style.left=i.position.actualLeft-(this.data.handle.outsideWidth+this.data.handle.outsideHorizontalMargin)+"px",e.style.width=this.data.handle.outsideWidth+"px",e.style.top=i.position.actualRowTop+"px",this.setUpClasses(!0)):(e.style.position="static",e.style.left=this.data.handle.horizontalMargin+"px",e.style.width=this.data.handle.width+"px",this.setUpClasses(!1)),e.style.height=i.actualHeight-2*this.data.handle.verticalMargin+"px",i.outOfView.left?e.style.display="none":e.style.display="flex",e}getEventArgument(t){const e=this.api.getAllItems(),i=[];for(const s of t)i.push(this.api.mergeDeep({},e[s.id]));return{items:{initial:this.data.initialItems,before:i,after:t},addedDependantIds:this.data.addedDependantIds,selectedIds:this.data.selectedIds,vido:this.vido,state:this.state,time:this.state.get("$data.chart.time")}}getDependantItems(t){const e=[],i=this.api.getItemsData();for(const s of t)for(const t of i[s.id].dependant)e.includes(t)||e.push(t);const s=this.state.get("config.chart.items");return e.map((t=>s[t])).map((t=>this.api.mergeDeep({},t)))}dispatchEvent(t,e,i=null){"onStart"===t&&(this.api.muteMethod("fixOverlapped"),this.api.muteMethod("fullReload"),this.api.muteMethod("recalculateRowPercents"),this.api.muteMethod("getLastPageRowsHeight"),this.api.muteMethod("calculateVerticalScrollArea"),this.api.muteMethod("heightChange"),this.api.muteMethod("calculateRowsHeight"),this.api.muteMethod("updateVisibleItemsListener"),this.api.muteMethod("prepareExpanded"),0===this.data.autoScroll.speed&&0===this.data.autoScroll.speed&&(this.api.muteMethod("generateVisibleRowsAndItems"),this.api.muteMethod("calculateVisibleRowsHeights"),this.api.muteMethod("prepareExpanded"))),"onEnd"===t&&(this.api.unmuteMethod("fixOverlapped"),this.api.unmuteMethod("heightChange"),this.api.unmuteMethod("calculateVerticalScrollArea"),this.api.unmuteMethod("getLastPageRowsHeight"),this.api.unmuteMethod("recalculateRowPercents"),this.api.unmuteMethod("fullReload"),this.api.unmuteMethod("calculateRowsHeight"),this.api.unmuteMethod("updateVisibleItemsListener"),this.api.unmuteMethod("prepareExpanded"),0===this.data.autoScroll.speed&&0===this.data.autoScroll.speed&&(this.api.unmuteMethod("generateVisibleRowsAndItems"),this.api.unmuteMethod("calculateVisibleRowsHeights"),this.api.unmuteMethod("prepareExpanded"))),e=e.map((t=>this.api.mergeDeep({},t)));const s=this.data.events[t](this.getEventArgument(e));let a=this.state.multi(!0);const n=this.state.get("config.chart.items");for(const t of s){let e=!1;const s=n[t.id];t.time.start===s.time.start&&t.time.end===s.time.end||(e=!0,a=a.update(`config.chart.items.${t.id}.time`,t.time)),i&&e&&(a=a.update(`$data.chart.items.${t.id}`,this.api.mergeDeep({},i[t.id])))}a.done(),"onEnd"===t&&this.api.main.partialReload(!1)}getItemsForDiff(){const t=this.getSelectedItems()[0],e=this.data.initialItems.find((e=>e.id===t.id));return{modified:t,original:e}}onTimelinePointerDown(t){this.data.enabled&&(t.targetType!==e||this.api.plugins.TimelinePointer.isLocked("down")||this.onPointerDown(t))}onTimelinePointerMove(t){this.data.enabled&&t.targetType===e&&"item-resizing"===this.api.plugins.TimelinePointer.isLocked("move")&&this.onPointerMove(t)}onTimelinePointerUp(t){this.data.enabled&&t.targetType===e&&"item-resizing"===this.api.plugins.TimelinePointer.isLocked("up")&&this.onPointerUp(t)}onPointerDown(t){const e=t.originalEvent.target.closest("."+l);if(e&&!this.api.plugins.TimelinePointer.isLocked("down")){if(this.api.plugins.TimelinePointer.lock("down","item-resizing"),this.api.plugins.TimelinePointer.lock("move","item-resizing"),this.api.plugins.TimelinePointer.lock("up","item-resizing"),t.originalEvent.preventDefault(),t.originalEvent.stopPropagation(),this.data.dependant){const t=this.getSelectedItems();this.data.selectedIds=t.map((t=>t.id));const e=this.getDependantItems(t).filter((t=>!this.data.selectedIds.includes(t.id)));this.data.addedDependantIds=e.map((t=>t.id)),this.data.initialItems=[...t,...e]}else this.data.initialItems=this.getSelectedItems(),this.data.addedDependantIds=[],this.data.selectedIds=this.data.initialItems.map((t=>t.id));this.data.initialItemsData=this.getSelectedItemsData(this.data.initialItems),this.data.initialHorizontalScroll=this.api.mergeDeep({},this.state.get("$data.scroll.horizontal")),""!==this.data.state&&"end"!==this.data.state||(this.data.state="resize"),e.classList.contains(l+h)&&this.onLeftPointerDown(),e.classList.contains(l+r)&&this.onRightPointerDown(),this.dispatchEvent("onStart",this.data.initialItems)}}onLeftPointerDown(){this.data.enabled&&(document.body.classList.add(this.data.bodyClassLeft),this.data.leftIsMoving=!0,this.updateData())}onRightPointerDown(){this.data.enabled&&(document.body.classList.add(this.data.bodyClassRight),this.data.rightIsMoving=!0,this.updateData())}scrollLeft(){if(this.data.autoScroll.speed&&!this.state.get("config.chart.time.calculatedZoomMode")){if(this.scrollWaiting++,this.data.autoScroll.speed<0){if(this.scrollWaiting-1<Math.abs(this.data.autoScroll.speed))return;const t=this.api.getScrollLeft();this.api.setScrollLeft(t.dataIndex-1)}else if(this.data.autoScroll.speed>0){const t=this.api.getScrollLeft();this.api.setScrollLeft(t.dataIndex-this.data.autoScroll.speed)}this.scrollWaiting=0}}scrollRight(){if(this.data.autoScroll.speed&&!this.state.get("config.chart.time.calculatedZoomMode")){if(this.scrollWaiting++,this.data.autoScroll.speed<0){if(this.scrollWaiting-1<Math.abs(this.data.autoScroll.speed))return;const t=this.api.getScrollLeft();this.api.setScrollLeft(t.dataIndex+1)}else if(this.data.autoScroll.speed>0){const t=this.api.getScrollLeft();this.api.setScrollLeft(t.dataIndex+this.data.autoScroll.speed)}this.scrollWaiting=0}}autoScroll(t){if(!this.timelineElement)return;const e=t.currentPosition.x,i=this.timelineElement.getBoundingClientRect();e<this.data.autoScroll.edgeThreshold?this.scrollLeft():e>i.width-this.data.autoScroll.edgeThreshold&&this.scrollRight()}onPointerMove(t){if(!this.data.enabled)return;const{original:e,modified:i}=this.getItemsForDiff();e&&(this.data.movement={px:t.movement.x,time:i.time.start-e.time.start},"resize"!==this.data.state&&"start"!==this.data.state||(this.data.state="resize"),t.movement.x&&this.autoScroll(t),this.data.leftIsMoving&&this.onLeftPointerMove(t),this.data.rightIsMoving&&this.onRightPointerMove(t))}onLeftPointerMove(t){if(!this.data.enabled||!this.data.leftIsMoving)return;const e=this.getSelectedItems(),i={},s=this.state.get("$data.chart.time"),{original:a,modified:n}=this.getItemsForDiff(),o=this.data.movement={px:t.movement.x,time:n.time.start-a.time.start},d=this.api.time.date(this.api.time.getTimeFromOffsetPx(t.initialPosition.x,!0,s)),l=this.data.snapToTime.start({startTime:d,item:e[0],time:s,movement:o,vido:this.vido}),h=this.api.time.date(this.api.time.getTimeFromOffsetPx(t.currentPosition.x,!0,s)),r=this.api.time.getDatesDiffPx(l,h,s,!0);for(let t=0,a=e.length;t<a;t++){const a=e[t],n=this.api.mergeDeep({},this.api.getItemData(a.id));let d=this.api.mergeDeep({},this.data.initialItemsData[a.id]).position.left+r;d>n.position.right-a.minWidth&&(d=n.position.right-a.minWidth);const l=this.api.time.getTimeFromOffsetPx(d,!0,s),h=this.data.snapToTime.start({startTime:this.api.time.date(l),item:a,time:s,movement:o,vido:this.vido});a.time.start=h.valueOf(),n.time.startDate=h;if((a.time.start<s.from||a.time.end>s.to)&&("function"==typeof s.format.periodIncrement||!this.data.allowItemsToGoOutsideTheArea)){const t=this.api.getItem(a.id);a.time.start=t.time.start,a.time.end=t.time.end,n.time.startDate=this.api.time.date(a.time.start),n.time.endDate=this.api.time.date(a.time.end)}i[a.id]=n}this.dispatchEvent("onResize",e,i),this.updateData()}getItemsToMove(){let t,e,i=[];if(this.data.dependant){const s=this.getSelectedItems();e=s.map((t=>t.id));const a=this.getDependantItems(s).filter((t=>!e.includes(t.id)));i=a.map((t=>t.id)),t=[...s,...a]}else t=this.getSelectedItems();return{itemsToMove:t,dependantIds:i}}onRightPointerMove(t){if(!this.data.enabled||!this.data.rightIsMoving)return;const{itemsToMove:e,dependantIds:i}=this.getItemsToMove(),s={},a=this.state.get("$data.chart.time"),{original:n,modified:o}=this.getItemsForDiff(),d=this.data.movement={px:t.movement.x,time:o.time.start-n.time.start},l=this.api.time.date(this.api.time.getTimeFromOffsetPx(t.initialPosition.x,!0,a)),h=this.data.snapToTime.end({endTime:l,item:null,time:a,movement:d,vido:this.vido}),r=this.api.time.date(this.api.time.getTimeFromOffsetPx(t.currentPosition.x,!0,a)),m=this.api.time.getDatesDiffPx(h,r,a,!0);for(let t=0,n=e.length;t<n;t++){const n=e[t],o=this.api.mergeDeep({},this.api.getItemData(n.id)),l=this.api.mergeDeep({},this.data.initialItemsData[n.id]),h=i.includes(n.id);let r=l.position.left+l.timeWidth+m;!h&&r<o.position.left+n.minWidth&&(r=o.position.left+n.minWidth);const p=this.api.time.getTimeFromOffsetPx(r,!0,a);let c=this.api.time.date(p);if(h||(c=this.data.snapToTime.end({endTime:this.api.time.date(p),item:n,time:a,movement:d,vido:this.vido})),h){const t=this.data.initialItems.find((t=>t.dependant.includes(l.id))),e=this.data.initialItemsData[t.id],i=s[e.id],d=this.api.time.getDatesDiffMs(e.time.endDate,i.time.endDate,a,!0);let h=-this.api.time.getDSTDiffForLevel(a.level,e.time.endDate.valueOf(),l.time.startDate.valueOf(),a),r=this.api.time.addTimeFromDates(l.time.startDate.valueOf(),d+h,a);h=this.api.time.getDSTDiffForLevel(a.level,i.time.endDate.valueOf(),r,a),r+=h;const m=this.api.time.date(r),p=m.valueOf(),g=this.api.time.getViewOffsetPxFromDates(m,!1,a);let u=-this.api.time.getDSTDiffForLevel(a.level,l.time.startDate.valueOf(),l.time.endDate.valueOf(),a);const f=g+l.timeWidth;let v;const I=l.time.endDate.valueOf()-l.time.startDate.valueOf();v=this.data.ignoreMissingDates?this.api.time.date(this.api.time.getTimeFromOffsetPx(f,!0,a)):this.api.time.date(m.valueOf()+I),u+=this.api.time.getDSTDiffForLevel(a.level,p,v.valueOf(),a),v=v.add(u,"ms"),c=v,n.time.start=m.valueOf(),o.time.startDate=m}n.time.end=c.valueOf(),o.time.endDate=c;if((n.time.start<a.from||n.time.end>a.to)&&("function"==typeof a.format.periodIncrement||!this.data.allowItemsToGoOutsideTheArea)){const t=this.api.getItem(n.id);n.time.start=t.time.start,n.time.end=t.time.end,o.time.startDate=this.api.time.date(n.time.start),o.time.endDate=this.api.time.date(n.time.end)}s[n.id]=o}this.dispatchEvent("onResize",e,s),this.updateData()}onEnd(){const{itemsToMove:t}=this.getItemsToMove();this.dispatchEvent("onEnd",t)}onPointerUp(t){"resize"===this.data.state&&(this.data.state="end"),this.onLeftPointerUp(),this.onRightPointerUp(),this.onEnd(),this.updateData(),this.api.plugins.TimelinePointer.unlock("down"),this.api.plugins.TimelinePointer.unlock("move"),this.api.plugins.TimelinePointer.unlock("up")}onLeftPointerUp(){document.body.classList.remove(this.data.bodyClassLeft),this.data.enabled&&this.data.leftIsMoving&&(this.data.leftIsMoving=!1,this.updateData())}onRightPointerUp(){document.body.classList.remove(this.data.bodyClassRight),this.data.enabled&&this.data.rightIsMoving&&(this.data.rightIsMoving=!1)}PluginItemResizingInnerSlot(t,e){let i,s,a;const n=new t.StyleMap({}),o=new t.StyleMap({});return t.onChange((d=>{if(!(e=d)||!e.item)return;const l=e.item;if(!l)return;const h=this.api.getItemData(l.id);if(!h)return;let r;i=!h.detached,this.data.handle.onlyWhenSelected&&(i=i&&h.selected),i=i&&!(this.data.handle.outside||h.actualWidth<this.data.outsideWidthThreshold),this.updateRightStyleMap(l,o),this.updateLeftStyleMap(l,n),r="function"==typeof this.data.content?this.data.content({item:l,vido:t}):"object"!=typeof this.data.content||"left"in this.data.content?this.data.content:{left:this.data.content,right:this.data.content},s=this.html`<div class=${this.leftClassName} data-gstcid=${e.item.id} style=${n.directive()}>${r.left}</div>`,a=this.html`<div class=${this.rightClassName} data-gstcid=${e.item.id} style=${o.directive()}>${r.right}</div>`,t.update()})),t=>this.html`${i?s:null}${t}${i?a:null}`}PluginItemResizingOuterSlot(t,i){let s,a,n;const o=new t.StyleMap({}),d=new t.StyleMap({});return t.onChange((l=>{if(!(i=l)||!i.item)return;const h=i.item;if(!h)return;const r=this.api.getItemData(h.id);if(!r)return;let m;s=!r.detached,this.data.handle.onlyWhenSelected&&(s=s&&r.selected),s=s&&(this.data.handle.outside||r.actualWidth<this.data.outsideWidthThreshold),this.updateRightStyleMap(h,d),this.updateLeftStyleMap(h,o),m="function"==typeof this.data.content?this.data.content({item:h,vido:t}):"object"!=typeof this.data.content||"left"in this.data.content?this.data.content:{left:this.data.content,right:this.data.content},a=this.html`<div class=${this.leftClassName} data-type=${e} data-gstcid=${i.item.id} style=${o.directive()}>${m.left}</div>`,n=this.html`<div class=${this.rightClassName} data-type=${e} data-gstcid=${i.item.id} style=${d.directive()}>${m.right}</div>`,t.update()})),t=>this.html`${s?a:null}${t}${s?n:null}`}}t.Plugin=function(t={}){return function(e){const i=e.api;if(!i.isPluginInitialized("TimelinePointer"))throw new Error("TimelinePointer plugin must be initialized before ItemResizing plugin.");if(!i.isPluginInitialized("Selection"))throw new Error("Selection plugin must be initialized before ItemResizing plugin.");if(i.isPluginInitialized("ItemMovement"))throw new Error("ItemResizing plugin must be initialized before ItemMovement plugin.");const s=e.state.get(o);s&&(t=e.api.mergeDeep({},t,s));const a=new m(e,t);return i.pluginInitialized(n),a.destroy}},Object.defineProperty(t,"__esModule",{value:!0})}));

@@ -9,4 +9,4 @@ /**

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE

@@ -13,0 +13,0 @@ */

@@ -10,4 +10,4 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ItemTypes={})}(this,(function(t){"use strict";

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE

@@ -14,0 +14,0 @@ */const e="config.plugin.ItemTypes",i="config.templates.chart-timeline-items-row-item",s={task({className:t,labelClassName:e,cache:i,shouldDetach:s,actions:a,styleMap:l,slots:n,cutterLeft:o,cutterRight:c,getContent:p,vido:$,props:h}){const r=s||!h.item,{itemData:d,item:g}=h,u=d.position.left!==d.position.actualLeft,m=d.position.right!==d.position.actualRight,f=d.actualWidth,y=d.actualHeight,L=Math.min(8,y/2);let _=[`M ${L} ${y}`,`Q 0 ${y} 0 ${y-L}`,`L 0 ${L}`,`Q 0 0 ${L} 0`,`L ${f-L} 0`,`Q ${f} 0 ${f} ${L}`,`L ${f} ${y-L}`,`Q ${f} ${y} ${f-L} ${y}`,`L ${L} ${y}`].join(" ");u&&!m?_=["M 0 0",`L ${f-L} 0`,`Q ${f} 0 ${f} ${L}`,`L ${f} ${y-L}`,`Q ${f} ${y} ${f-L} ${y}`,`L 0 ${y}`].join(" "):u&&m?_=["M 0 0",`L ${f} 0`,`L ${f} ${y}`,`L 0 ${y}`].join(" "):!u&&m&&(_=[`M ${L} ${y}`,`Q 0 ${y} 0 ${y-L}`,`L 0 ${L}`,`Q 0 0 ${L} 0`,`L ${f} 0`,`L ${f} ${y}`,`L ${L} ${y}`].join(" "));const w=`gstc__clip-path-${g.id}`,v=`gstc__pattern-${g.id}`,j=void 0===g.progress?100:g.progress,b=d.width-d.width/100*j;let x=d.width-b;u&&(x+=d.position.left),x<0&&(x=0);const M=[`M ${x} 0`,`L ${f} 0`,`L ${f} ${y}`,`L ${x} ${y}`].join(" "),H=g.fill?g.fill:"#e74c3c",T=`gstc__item-type gstc__item-type--${g.type} `;return i(r?null:n.html("outer",$.html`

@@ -9,4 +9,4 @@ /**

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE

@@ -23,4 +23,4 @@ */

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE

@@ -27,0 +27,0 @@ */const i="config.plugin.ProgressBar";class s{constructor(i,s){this.options=function(i){return Object.assign({enabled:!0,className:t("chart-timeline-items-row-item-progress-bar")},i)}(i),this.vido=s,this.state=s.state,this.className=this.options.className,this.PluginProgressBarSlot=this.PluginProgressBarSlot.bind(this),this.destroy=this.destroy.bind(this),this.state.update("config.slots.chart-timeline-items-row-item.inner",(t=>(t.includes(this.PluginProgressBarSlot)||t.push(this.PluginProgressBarSlot),t)))}destroy(){this.state.update("config.slots.chart-timeline-items-row-item.inner",(t=>t.filter((t=>t!==this.PluginProgressBarSlot)))),this.vido.api.pluginDestroyed("ProgressBar")}PluginProgressBarSlot(t,i){let s;const e=new t.StyleMap({width:"0px"});return t.onChange((r=>{if(!(i=r)||!i.item)return void(e.style.width="0px");const o=t.api.getItemData(i.item.id);if(!o||void 0===i.item.progress)return void(e.style.width="0px");if(!i.item)return;const n=i.item,a=void 0===n.progress?100:n.progress;s=o.width-o.width/100*a,s-=o.position.right-o.position.actualRight,s<0&&(s=0),e.style.width=s+"px"})),t=>i&&i.item&&void 0!==i.item.progress?this.vido.html`

@@ -10,4 +10,4 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ProgressBar={})}(this,(function(t){"use strict";

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE

@@ -23,4 +23,4 @@ */const e="gstc";function i(t,i=""){let s=`gstc__${t}`;return t===e&&(s=e),i?`${s} ${s}--${i.replace(":","-")}`:s}

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE

@@ -27,0 +27,0 @@ */const s="config.plugin.ProgressBar";class r{constructor(t,e){this.options=function(t){return Object.assign({enabled:!0,className:i("chart-timeline-items-row-item-progress-bar")},t)}(t),this.vido=e,this.state=e.state,this.className=this.options.className,this.PluginProgressBarSlot=this.PluginProgressBarSlot.bind(this),this.destroy=this.destroy.bind(this),this.state.update("config.slots.chart-timeline-items-row-item.inner",(t=>(t.includes(this.PluginProgressBarSlot)||t.push(this.PluginProgressBarSlot),t)))}destroy(){this.state.update("config.slots.chart-timeline-items-row-item.inner",(t=>t.filter((t=>t!==this.PluginProgressBarSlot)))),this.vido.api.pluginDestroyed("ProgressBar")}PluginProgressBarSlot(t,e){let i;const s=new t.StyleMap({width:"0px"});return t.onChange((r=>{if(!(e=r)||!e.item)return void(s.style.width="0px");const o=t.api.getItemData(e.item.id);if(!o||void 0===e.item.progress)return void(s.style.width="0px");if(!e.item)return;const n=e.item,l=void 0===n.progress?100:n.progress;i=o.width-o.width/100*l,i-=o.position.right-o.position.actualRight,i<0&&(i=0),s.style.width=i+"px"})),t=>e&&e.item&&void 0!==e.item.progress?this.vido.html`

@@ -9,4 +9,4 @@ /**

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE

@@ -23,6 +23,6 @@ */

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE
*/
function(t){t.events||(t.events={}),t.onStart&&(t.events.onStart=t.onStart),t.onSelecting&&(t.events.onSelecting=t.onSelecting),t.onSelected&&(t.events.onEnd=t.onSelected)}(t);const e={enabled:!0,cells:!0,items:!0,showOverlay:!0,rectangularSelection:!0,multipleSelection:!0,selectedClassName:"gstc__selected",selectingClassName:"gstc__selecting",bodySelectedClassName:"gstc__is-selected",bodySelectingClassName:"gstc__is-selecting",events:{onStart(){},onSelecting:t=>t,onEnd:t=>t}};return t.events=Object.assign(Object.assign({},e.events),t.events),Object.assign(Object.assign({},e),t)}(t),function(e){const s=e.api.mergeDeep,l=e.api;if(!l.isPluginInitialized("TimelinePointer"))throw new Error("TimelinePointer plugin must be initialized before Selection plugin.");const n=e.state.get(i);n&&(t=s({},t,n));const c=new a(e,t);return l.pluginInitialized("Selection"),c.destroy}}export{l as Plugin};

@@ -10,4 +10,4 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Selection={})}(this,(function(t){"use strict";

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE

@@ -23,6 +23,6 @@ */const e="chart-timeline-grid-row-cell",i="chart-timeline-items-row-item";const s="config.plugin.Selection";function a(t){return Object.assign({enabled:!0,showOverlay:!0,isSelecting:!1,pointerState:"up",selectKey:"",multiKey:"shift",multipleSelection:!0,targetType:"",targetData:null,initialPosition:{x:0,y:0},currentPosition:{x:0,y:0},selectionAreaLocal:{x:0,y:0,width:0,height:0},selectionAreaGlobal:{x:0,y:0,width:0,height:0},selecting:{[i]:[],[e]:[]},selected:{[i]:[],[e]:[]},lastSelected:{[i]:[],[e]:[]},lastSelecting:{[i]:[],[e]:[]},automaticallySelected:{[i]:[],[e]:[]},events:{onStart(){},onSelecting:t=>t,onEnd:t=>t},pointerEvents:{down:null,move:null,up:null}},t)}class l{constructor(t,l){this.onDestroy=[],this.started=!1,this.lastAllEvents={down:null,move:null,up:null},this.vido=t,this.state=t.state,this.api=t.api,this.merge=this.state.get("config.merge"),this.state.update(s,a(l)),this.data=a(l),this.slotClassName=this.api.getClass("chart-selection"),this.slotStyleMap=new t.StyleMap({display:"none"}),this.html=t.html,this.slot=this.slot.bind(this),this.destroy=this.destroy.bind(this),this.setSlot(),this.onCellCreate=this.onCellCreate.bind(this),this.apiGetSelection=this.apiGetSelection.bind(this),this.apiGetSelecting=this.apiGetSelecting.bind(this),this.apiGetSelected=this.apiGetSelected.bind(this),this.apiSetSelection=this.apiSetSelection.bind(this),this.apiSelectCells=this.apiSelectCells.bind(this),this.apiSelectItems=this.apiSelectItems.bind(this),this.api.plugins.Selection={ITEM:i,CELL:e,getSelection:this.apiGetSelection,getSelected:this.apiGetSelected,getSelecting:this.apiGetSelecting,setSelection:this.apiSetSelection,selectCells:this.apiSelectCells,selectItems:this.apiSelectItems},this.state.update("config.chart.grid.cell.onCreate",(t=>(t.includes(this.onCellCreate)||t.push(this.onCellCreate),t))),this.updateData(),this.onDestroy.push(this.state.subscribe(s,(t=>{this.data=t}))),this.updateSelectionClassName=this.updateSelectionClassName.bind(this),this.selectedAction=this.selectedAction.bind(this),this.state.update("config.actions.chart-timeline-grid-row-cell",(t=>(t.includes(this.selectedAction)||t.push(this.selectedAction),t))),this.state.update("config.actions.chart-timeline-items-row-item",(t=>(t.includes(this.selectedAction)||t.push(this.selectedAction),t))),this.onDestroy.push(this.state.subscribe("config.chart.items.*;",(()=>{const t=this.api.getAllItems();this.data.selected[i]=this.data.selected[i].filter((e=>!!t[e])),this.data.selecting[i]=this.data.selecting[i].filter((e=>!!t[e]));const e=this.api.getItemsData();for(const t in e){const s=e[t];s.selected=this.data.selected[i].includes(t),s.selecting=this.data.selecting[i].includes(t)}}),{bulk:!0,bulkValue:!1})),this.onTimelinePointerDown=this.onTimelinePointerDown.bind(this),this.onTimelinePointerMove=this.onTimelinePointerMove.bind(this),this.onTimelinePointerUp=this.onTimelinePointerUp.bind(this),this.api.plugins.TimelinePointer.addPointerListener("move",this.onTimelinePointerMove),this.api.plugins.TimelinePointer.addPointerListener("down",this.onTimelinePointerDown),this.api.plugins.TimelinePointer.addPointerListener("up",this.onTimelinePointerUp)}setSlot(){this.state.update("config.slots.chart-timeline-items.outer",(t=>(t.includes(this.slot)||t.push(this.slot),t)))}destroy(){this.api.plugins.TimelinePointer.removePointerListener("move",this.onTimelinePointerMove),this.api.plugins.TimelinePointer.removePointerListener("down",this.onTimelinePointerDown),this.api.plugins.TimelinePointer.removePointerListener("up",this.onTimelinePointerUp),this.state.update("config.slots.chart-timeline-items.outer",(t=>t.filter((t=>t!==this.slot)))),this.state.update("config.actions.chart-timeline-grid-row-cell",(t=>t.filter((t=>t!==this.selectedAction)))),this.state.update("config.actions.chart-timeline-items-row-item",(t=>t.filter((t=>t!==this.selectedAction)))),this.state.update("config.chart.grid.cell.onCreate",(t=>t.filter((t=>t!==this.onCellCreate)))),this.onDestroy.forEach((t=>t()))}updateData(){this.state.update(s,Object.assign({},this.data)),this.vido.update()}apiSetSelection(t){this.data.selected=this.api.mergeDeep({},t);let e=this.state.multi(!0);e=this.updateCells(e),e=this.updateItems(e),e.done(),this.updateData()}apiSelectCells(t){this.data.selected[e]=[...t];let i=this.state.multi(!0);i=this.updateCells(i),i.done(),this.updateData()}apiSelectItems(t){this.data.selected[i]=[...t];let e=this.state.multi(!0);e=this.updateItems(e),e.done(),this.updateData()}apiGetSelection(){return{selecting:this.getSelectionWithData(this.data.selecting),selected:this.getSelectionWithData(this.data.selected)}}apiGetSelecting(){return this.getSelectionWithData(this.data.selecting)}apiGetSelected(){return this.getSelectionWithData(this.data.selected)}modKeyPressed(t,e){switch(t){case"shift":return e.shiftKey;case"alt":return e.altKey;case"ctrl":return e.ctrlKey}}canSelect(){let t=this.data.enabled;const e=this.lastAllEvents.down;return e&&this.data.selectKey&&(t=t&&this.modKeyPressed(this.data.selectKey,e)),t&&(this.data.cells||this.data.items)}getSelectionAreaLocal(t){const e={x:0,y:0,width:0,height:0},i=Object.assign({},t.initialPosition),s=Object.assign({},t.currentPosition),a=s.x-i.x,l=s.y-i.y;return a>=0?(e.x=i.x,e.width=a):(e.x=s.x,e.width=Math.abs(a)),l>=0?(e.y=i.y,e.height=l):(e.y=s.y,e.height=Math.abs(l)),e}translateAreaLocalToGlobal(t){const e=this.state.get("$data.chart.time.leftPx"),i=this.state.get("$data.scroll.vertical.absolutePosPx");return Object.assign(Object.assign({},t),{x:t.x+e,y:t.y+i})}collectLinkedItems(t,e=this.api.getItemsData()){return[t,...e[t].linkedWith]}getSelectedItem(t){let e,s=this.data.automaticallySelected[i].slice();const a=this.collectLinkedItems(t.id);if(this.data.selected[i].find((e=>e===t.id)))if(e=this.data.selected[i],s.find((e=>e===t.id))){const i=s,a=e.find((e=>t.linkedWith.includes(e)&&!i.includes(e)));s=s.filter((e=>e!==t.id)),s.push(a)}else s=this.data.automaticallySelected[i];else e=this.isMulti()?Array.from(new Set([...this.data.selected[i],...a])):a,s=a.filter((e=>e!==t.id));return e=e.map((e=>(t=this.api.getItem(e),e))),{selected:e,automaticallySelected:s}}isItemVerticallyInsideArea(t,e){if(!e.width||!e.height)return!1;const i=e.y+e.height,s=t.position.viewTop,a=s+t.actualHeight;return s>=e.y&&s<=i||a>=e.y&&a<=i||s>=e.y&&a<=i||s<=e.y&&a>=i}isItemHorizontallyInsideArea(t,e){if(!e.width||!e.height)return!1;const i=e.x+e.width;return t.position.actualLeft>=e.x&&t.position.actualLeft<=i||t.position.actualRight>=e.x&&t.position.actualRight<=i||t.position.actualLeft<=e.x&&t.position.actualRight>=i||t.position.actualLeft>=e.x&&t.position.actualRight<=i}isMulti(){const t=this.lastAllEvents.move;return t&&this.data.multiKey&&this.modKeyPressed(this.data.multiKey,t)}getItemsUnderSelectionArea(t){const e=this.state.get("$data.chart.visibleItems"),i=this.api.getItems(e),s=[],a=[];for(let e of i){e=this.merge({},e);const i=this.api.getItemData(e.id);if(this.isItemVerticallyInsideArea(i,t)&&this.isItemHorizontallyInsideArea(i,t)){s.find((t=>t===e.id))||s.push(e.id);const t=this.collectLinkedItems(e.id);for(const e of t){const t=this.api.getItem(e);s.find((e=>e===t.id))||(s.push(t.id),a.push(t.id))}}}return{selectedItems:s,automaticallySelectedItems:a}}isCellVerticallyInsideArea(t,e){if(!e.width||!e.height)return!1;const i=e.y+e.height,s=t.top,a=s+t.rowData.actualHeight;return s>=e.y&&s<=i||a>=e.y&&a<=i||s>=e.y&&a<=i||s<=e.y&&a>=i}isCellHorizontallyInsideArea(t,e){if(!e.width||!e.height)return!1;const i=e.x+e.width,s=t.time.currentView.leftPx,a=t.time.currentView.rightPx;return s>=e.x&&s<=i||a>=e.x&&a<=i||s<=e.x&&a>=i||s>=e.x&&a<=i}getCellsUnderSelectionArea(t){const e=this.state.get("$data.chart.grid.cells"),i=[];for(const s in e){const a=e[s];this.isCellVerticallyInsideArea(a,t)&&this.isCellHorizontallyInsideArea(a,t)&&(i.find((t=>t===a.id))||i.push(a.id))}return{selectedCells:i}}updateItems(t){if(!this.data.items)return t;const e=this.api.getAllItems(),s=Array.from(new Set([...this.data.selecting[i],...this.data.selected[i]]));return t=t.update("$data.chart.items",(t=>{for(const a in t)if(a in e)if(s.includes(a)){const e=this.data.selecting[i].includes(a),s=this.data.selected[i].includes(a);t[a].selected=s,t[a].selecting=e}else t[a].selected=!1,t[a].selecting=!1;return t}),{data:"selection"})}updateCurrentItems(t){if(!this.data.items)return t;const e=this.state.get("$data.chart.items"),s=Array.from(new Set([...this.data.lastSelecting[i],...this.data.selecting[i],...this.data.selected[i]]));for(const t of s)e[t].selecting=this.data.selecting[i].includes(t),e[t].selected=this.data.selected[i].includes(t);return t}updateCells(t){if(!this.data.cells)return t;const i=this.api.getAllGridCells();return t.update("$data.chart.grid.cells",(t=>{for(const s in t){if(!(s in i))continue;const a=t[s];a.selected=this.data.selected[e].includes(a.id),a.selecting=this.data.selecting[e].includes(a.id)}return t})),t}updateCurrentCells(t){if(!this.data.items)return t;const i=Array.from(new Set([...this.data.lastSelecting[e],...this.data.selecting[e],...this.data.selected[e]]));for(const s of i)t=t.update(`$data.chart.grid.cells.${s}`,(t=>(t.selected=this.data.selected[e].includes(s),t.selecting=this.data.selecting[e].includes(s),t)));return t}deselectItems(){if(!this.data.items)return;this.data.selected[i].length=0,this.data.selecting[i].length=0;let t=this.state.multi(!0);t=this.updateItems(t),t.done()}deselectCells(){if(!this.data.cells)return;this.data.selecting[e].length=0,this.data.selected[e].length=0;let t=this.state.multi(!0);t=this.updateCells(t),t.done()}getSelectionWithData(t){const s=this.state.get("config.chart.items"),a=this.state.get("$data.chart.grid.cells");return{[e]:t[e].map((t=>a[t]?a[t]:t)),[i]:t[i].map((t=>s[t]?s[t]:t))}}onSelecting(t,s){const a=this.getSelectionWithData(t),l=this.getSelectionWithData(s);this.started||(this.data.events.onStart(l),this.started=!0,this.api.muteMethod("fullReload"),this.api.muteMethod("prepareExpanded"),this.api.muteMethod("calculateRowsHeight"),this.api.muteMethod("recalculateRowPercents"),this.api.muteMethod("getLastPageRowsHeight"),this.api.muteMethod("calculateVerticalScrollArea"),this.api.muteMethod("calculateVisibleRowsHeights"),this.api.muteMethod("generateVisibleRowsAndItems"),this.api.muteMethod("recalculateTimes"),this.api.muteMethod("heightChange"));const n=this.data.events.onSelecting(a,l);return{[e]:n[e].map((t=>"string"!=typeof t?t.id:t)),[i]:n[i].map((t=>"string"!=typeof t?t.id:t))}}onSelected(t,s){const a=this.getSelectionWithData(t),l=this.getSelectionWithData(s),n=this.data.events.onEnd(a,l);return this.started=!1,this.api.unmuteMethod("heightChange"),this.api.unmuteMethod("recalculateTimes"),this.api.unmuteMethod("generateVisibleRowsAndItems"),this.api.unmuteMethod("calculateVisibleRowsHeights"),this.api.unmuteMethod("calculateVerticalScrollArea"),this.api.unmuteMethod("getLastPageRowsHeight"),this.api.unmuteMethod("recalculateRowPercents"),this.api.unmuteMethod("calculateRowsHeight"),this.api.unmuteMethod("prepareExpanded"),this.api.unmuteMethod("fullReload"),{[e]:n[e].map((t=>"string"!=typeof t?t.id:t)),[i]:n[i].map((t=>"string"!=typeof t?t.id:t))}}updateBodyClass(){this.data.isSelecting?document.body.classList.add(this.data.bodySelectingClassName):document.body.classList.remove(this.data.bodySelectingClassName),this.data.selected[e].length||this.data.selected[i].length?document.body.classList.add(this.data.bodySelectedClassName):document.body.classList.remove(this.data.bodySelectedClassName)}selectMultipleCellsAndItems(t){if(!this.canSelect())return;if(!this.data.multipleSelection)return this.deselectItems(),this.deselectCells(),void this.updateData();this.data.isSelecting=!0,this.data.selectionAreaLocal=this.getSelectionAreaLocal(t),this.data.selectionAreaGlobal=this.translateAreaLocalToGlobal(this.data.selectionAreaLocal);const s={[e]:[],[i]:[]},a=this.isMulti();if(this.data.cells){const{selectedCells:t}=this.getCellsUnderSelectionArea(this.data.selectionAreaLocal);0===t.length?(s[e].length=0,a||(this.data.selected[e].length=0)):s[e]=t}if(this.data.items){const{selectedItems:t,automaticallySelectedItems:e}=this.getItemsUnderSelectionArea(this.data.selectionAreaLocal);this.data.automaticallySelected[i]=e,0===t.length?(s[i].length=0,a||(this.data.selected[i].length=0)):s[i]=t}if(this.data.cells||this.data.items){this.data.lastSelecting={[i]:[...this.data.selecting[i]],[e]:[...this.data.selecting[e]]},this.data.selecting=this.onSelecting(s,this.api.mergeDeep({},this.data.lastSelected));let t=this.state.multi(!0);this.data.cells&&(t=this.updateCurrentCells(t)),this.data.items&&(t=this.updateCurrentItems(t)),t.done()}}selectItemsIndividually(t){if(this.data.isSelecting=!1,this.data.selectionAreaLocal=this.getSelectionAreaLocal(t),this.data.currentPosition=t.currentPosition,this.data.initialPosition=t.initialPosition,!this.data.items)return;if(!this.canSelect())return;const s=this.merge({},t.targetData),a=this.api.getItemData(s.id);if(this.data.selected[i].includes(s.id))return;let{selected:l,automaticallySelected:n}=this.getSelectedItem(s);l.length>1&&!this.data.multipleSelection&&(l=[s.id],n=[]),this.isMulti()?a.selected?this.data.selected[i]=l.filter((t=>t!==s.id&&!n.includes(t))):this.data.selected[i]=l:(this.data.selected[i]=l,this.data.selected[e].length=0),this.data.automaticallySelected[i]=n,this.data.lastSelecting={[i]:[...this.data.selected[i]],[e]:[...this.data.selected[e]]},this.data.selected=this.onSelected(this.api.mergeDeep({},this.data.selected),this.api.mergeDeep({},this.data.lastSelected));let c=this.state.multi(!0);c=this.updateCells(c),c=this.updateItems(c),c.done()}removeMultiUnselected(t){const e=this.data.selected[t].filter((e=>this.data.selecting[t].includes(e))),i=[...this.data.selected[t],...this.data.selecting[t]];return Array.from(new Set(i.filter((t=>!e.includes(t)))))}finishSelection(){if(!this.canSelect())return;let t;t=this.isMulti()?{[e]:this.data.cells?this.removeMultiUnselected(e):[],[i]:this.data.items?this.removeMultiUnselected(i):[]}:{[e]:this.data.cells?[...this.data.selecting[e]]:[],[i]:this.data.items?[...this.data.selecting[i]]:[]},this.data.selected=this.onSelected(t,this.api.mergeDeep({},this.data.lastSelected)),this.data.lastSelected=this.api.mergeDeep({},this.data.selected),this.data.cells&&(this.data.selecting[e].length=0),this.data.items&&(this.data.selecting[i].length=0);let s=this.state.multi(!0);s=this.updateItems(s),s=this.updateCells(s),s.done()}onPointerData(t){if(this.lastAllEvents=t.allEvents,t.isMoving&&t.targetType===e&&this.data.rectangularSelection?this.selectMultipleCellsAndItems(t):t.isMoving&&t.targetType===e&&!this.data.rectangularSelection?this.deselectItems():t.targetType===i?this.selectItemsIndividually(t):t.isMoving||(this.data.isSelecting&&this.finishSelection(),this.data.isSelecting=!1),t.isMoving&&t.targetType!==e&&t.targetType!==i&&this.deselectItems(),this.data.pointerState=t.type,this.data.targetType=t.targetType,this.data.targetData=t.targetData,"down"===this.data.pointerState){let t=this.state.multi(!0);t=this.updateItems(t),t=this.updateCells(t),t.done()}this.updateData(),this.updateBodyClass()}onTimelinePointerDown(t){this.data.enabled&&this.onPointerData(t)}onTimelinePointerMove(t){this.data.enabled&&this.onPointerData(t)}onTimelinePointerUp(t){this.data.enabled&&this.onPointerData(t)}slot(){let t,e=!0;return i=>(e=!0,this.canSelect()&&this.data.isSelecting&&this.data.showOverlay&&this.data.multipleSelection&&this.data.rectangularSelection&&(this.slotStyleMap.style.display="block",this.slotStyleMap.style.left=this.data.selectionAreaLocal.x+"px",this.slotStyleMap.style.top=this.data.selectionAreaLocal.y+"px",this.slotStyleMap.style.width=this.data.selectionAreaLocal.width+"px",this.slotStyleMap.style.height=this.data.selectionAreaLocal.height+"px",e=!1),t=this.html`<div class=${this.slotClassName} style=${this.slotStyleMap.directive()}></div>`,this.html`${i}${e?null:t}`)}updateSelectionClassName(t,e){if(!e&&!e.itemData)return;const i="boolean"==typeof e.selected?e.selected:e.itemData.selected,s="boolean"==typeof e.selecting?e.selecting:e.itemData.selecting;i?(t.classList.contains(this.data.selectedClassName)||t.classList.add(this.data.selectedClassName),t.classList.contains(this.data.selectingClassName)&&t.classList.remove(this.data.selectingClassName)):t.classList.contains(this.data.selectedClassName)&&t.classList.remove(this.data.selectedClassName),s?(t.classList.contains(this.data.selectingClassName)||t.classList.add(this.data.selectingClassName),t.classList.contains(this.data.selectedClassName)&&t.classList.remove(this.data.selectedClassName)):t.classList.contains(this.data.selectingClassName)&&t.classList.remove(this.data.selectingClassName)}selectedAction(t,e){this.updateSelectionClassName(t,e);const i=this;return{update(t,e){i.updateSelectionClassName(t,e)},destroy(t,e){i.updateSelectionClassName(t,e)}}}onCellCreate(t){return t.selected=!!this.data.selected[e].find((e=>e===t.id)),t.selecting=!!this.data.selecting[e].find((e=>e===t.id)),t.content}}t.Plugin=function(t={}){return t=function(t){!

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE
*/
function(t){t.events||(t.events={}),t.onStart&&(t.events.onStart=t.onStart),t.onSelecting&&(t.events.onSelecting=t.onSelecting),t.onSelected&&(t.events.onEnd=t.onSelected)}(t);const e={enabled:!0,cells:!0,items:!0,showOverlay:!0,rectangularSelection:!0,multipleSelection:!0,selectedClassName:"gstc__selected",selectingClassName:"gstc__selecting",bodySelectedClassName:"gstc__is-selected",bodySelectingClassName:"gstc__is-selecting",events:{onStart(){},onSelecting:t=>t,onEnd:t=>t}};return t.events=Object.assign(Object.assign({},e.events),t.events),Object.assign(Object.assign({},e),t)}(t),function(e){const i=e.api.mergeDeep,a=e.api;if(!a.isPluginInitialized("TimelinePointer"))throw new Error("TimelinePointer plugin must be initialized before Selection plugin.");const n=e.state.get(s);n&&(t=i({},t,n));const c=new l(e,t);return a.pluginInitialized("Selection"),c.destroy}},Object.defineProperty(t,"__esModule",{value:!0})}));

@@ -9,4 +9,4 @@ /**

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE

@@ -22,7 +22,7 @@ */

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE
*/
const t="config.plugin.TimeBookmarks",s="config.slots.chart-timeline-items.outer";class e{constructor(e,i){this.unsub=[],this.options=function(t){return Object.assign({enabled:!0,className:""},t)}(e),this.vido=i,this.state=i.state,this.className=function(t,s=""){let e=`gstc__${t}`;return"gstc"===t&&(e="gstc"),s?`${e} ${e}--${s.replace(":","-")}`:e}("chart-time-bookmark")+(this.options.className?` ${this.options.className}`:""),this.PluginTimeBookmarksSlot=this.PluginTimeBookmarksSlot.bind(this),this.destroy=this.destroy.bind(this),this.state.update(t,this.options),this.state.update(s,(t=>(t.includes(this.PluginTimeBookmarksSlot)||t.push(this.PluginTimeBookmarksSlot),t))),this.unsub.push(this.state.subscribe(t,(t=>this.options=t)))}destroy(){this.unsub.forEach((t=>t())),this.state.update(s,(t=>t.filter((t=>t!==this.PluginTimeBookmarksSlot)))),this.vido.api.pluginDestroyed("TimeBookmarks")}PluginTimeBookmarksSlot(s){const{html:e,onDestroy:i,state:a,update:l,api:o,StyleMap:n}=s,c=[];i(a.subscribeAll([t,"$data.chart.time","$data.scroll.horizontal.dataIndex"],(()=>{var s;const e=a.get("$data.chart.time"),i=a.get(t);c.length=0;for(const t in i.bookmarks){const a=o.time.date(i.bookmarks[t].time);if(!o.time.isInCurrentView(a,e))continue;const l=Object.assign(Object.assign({},i.bookmarks[t]),{id:t,leftViewPx:0,absoluteLeftPx:0,visible:!1,date:null,styleMap:new n(Object.assign(null!==(s=i.bookmarks[t].style)&&void 0!==s?s:{},{left:"",height:""}))});l.styleMap.style.background=l.styleMap.style.background||l.color||"#3498DB",l.id=t,l.date=a,l.leftViewPx=o.time.getViewOffsetPxFromDates(a,!1,e),l.absoluteLeftPx=o.time.getGlobalOffsetPxFromDates(l.date,!0,e),l.visible=l.absoluteLeftPx>=e.leftPx&&l.absoluteLeftPx<=e.rightPx,c.push(l)}l()}),{group:!0}));let r=0,h=0;i(a.subscribe("$data.scroll.vertical",(t=>{r=Math.round(o.getRealChartHeight()),h=Math.round(-t.preciseOffset),l()})));const m=t=>e`<div
const t="config.plugin.TimeBookmarks",s="config.slots.chart-timeline-items.outer";class e{constructor(e,i){this.unsub=[],this.options=function(t){return Object.assign({enabled:!0,className:""},t)}(e),this.vido=i,this.state=i.state,this.className=function(t,s=""){let e=`gstc__${t}`;return"gstc"===t&&(e="gstc"),s?`${e} ${e}--${s.replace(":","-")}`:e}("chart-time-bookmark")+(this.options.className?` ${this.options.className}`:""),this.PluginTimeBookmarksSlot=this.PluginTimeBookmarksSlot.bind(this),this.destroy=this.destroy.bind(this),this.state.update(t,this.options),this.state.update(s,(t=>(t.includes(this.PluginTimeBookmarksSlot)||t.push(this.PluginTimeBookmarksSlot),t))),this.unsub.push(this.state.subscribe(t,(t=>this.options=t)))}destroy(){this.unsub.forEach((t=>t())),this.state.update(s,(t=>t.filter((t=>t!==this.PluginTimeBookmarksSlot)))),this.vido.api.pluginDestroyed("TimeBookmarks")}PluginTimeBookmarksSlot(s){const{html:e,onDestroy:i,state:a,update:l,api:o,StyleMap:n}=s,c=[];i(a.subscribeAll([t,"$data.chart.time","$data.scroll.horizontal.dataIndex"],(()=>{var s;const e=a.get("$data.chart.time"),i=a.get(t);c.length=0;for(const t in i.bookmarks){const a=o.time.date(i.bookmarks[t].time);if(!o.time.isInCurrentView(a,e))continue;const l=Object.assign(Object.assign({},i.bookmarks[t]),{id:t,leftViewPx:0,absoluteLeftPx:0,visible:!1,date:null,styleMap:new n(Object.assign(null!==(s=i.bookmarks[t].style)&&void 0!==s?s:{},{left:"",height:""}))});l.styleMap.style.background=l.styleMap.style.background||l.color||"#3498DB",l.id=t,l.date=a,l.leftViewPx=o.time.getViewOffsetPxFromDates(a,!1,e),l.absoluteLeftPx=o.time.getGlobalOffsetPxFromDates(l.date,!1,e),l.visible=l.absoluteLeftPx>=e.leftPx&&l.absoluteLeftPx<=e.rightPx,c.push(l)}l()}),{group:!0}));let r=0,h=0;i(a.subscribe("$data.scroll.vertical",(t=>{r=Math.round(o.getRealChartHeight()),h=Math.round(-t.preciseOffset),l()})));const m=t=>e`<div
class="${this.className}-line ${this.className}-line--${t.id}${t.className?` ${t.className}`:""}"

@@ -29,0 +29,0 @@ style="left:${t.leftViewPx}px;top: ${h}px;"

@@ -10,4 +10,4 @@ !function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports):"function"==typeof define&&define.amd?define(["exports"],s):s((t="undefined"!=typeof globalThis?globalThis:t||self).TimeBookmarks={})}(this,(function(t){"use strict";

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE

@@ -23,7 +23,7 @@ */const s="gstc";

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE
*/
const e="config.plugin.TimeBookmarks",i="config.slots.chart-timeline-items.outer";class a{constructor(t,a){this.unsub=[],this.options=function(t){return Object.assign({enabled:!0,className:""},t)}(t),this.vido=a,this.state=a.state,this.className=function(t,e=""){let i=`gstc__${t}`;return t===s&&(i=s),e?`${i} ${i}--${e.replace(":","-")}`:i}("chart-time-bookmark")+(this.options.className?` ${this.options.className}`:""),this.PluginTimeBookmarksSlot=this.PluginTimeBookmarksSlot.bind(this),this.destroy=this.destroy.bind(this),this.state.update(e,this.options),this.state.update(i,(t=>(t.includes(this.PluginTimeBookmarksSlot)||t.push(this.PluginTimeBookmarksSlot),t))),this.unsub.push(this.state.subscribe(e,(t=>this.options=t)))}destroy(){this.unsub.forEach((t=>t())),this.state.update(i,(t=>t.filter((t=>t!==this.PluginTimeBookmarksSlot)))),this.vido.api.pluginDestroyed("TimeBookmarks")}PluginTimeBookmarksSlot(t){const{html:s,onDestroy:i,state:a,update:l,api:o,StyleMap:n}=t,c=[];i(a.subscribeAll([e,"$data.chart.time","$data.scroll.horizontal.dataIndex"],(()=>{var t;const s=a.get("$data.chart.time"),i=a.get(e);c.length=0;for(const e in i.bookmarks){const a=o.time.date(i.bookmarks[e].time);if(!o.time.isInCurrentView(a,s))continue;const l=Object.assign(Object.assign({},i.bookmarks[e]),{id:e,leftViewPx:0,absoluteLeftPx:0,visible:!1,date:null,styleMap:new n(Object.assign(null!==(t=i.bookmarks[e].style)&&void 0!==t?t:{},{left:"",height:""}))});l.styleMap.style.background=l.styleMap.style.background||l.color||"#3498DB",l.id=e,l.date=a,l.leftViewPx=o.time.getViewOffsetPxFromDates(a,!1,s),l.absoluteLeftPx=o.time.getGlobalOffsetPxFromDates(l.date,!0,s),l.visible=l.absoluteLeftPx>=s.leftPx&&l.absoluteLeftPx<=s.rightPx,c.push(l)}l()}),{group:!0}));let r=0,d=0;i(a.subscribe("$data.scroll.vertical",(t=>{r=Math.round(o.getRealChartHeight()),d=Math.round(-t.preciseOffset),l()})));const h=t=>s`<div
const e="config.plugin.TimeBookmarks",i="config.slots.chart-timeline-items.outer";class a{constructor(t,a){this.unsub=[],this.options=function(t){return Object.assign({enabled:!0,className:""},t)}(t),this.vido=a,this.state=a.state,this.className=function(t,e=""){let i=`gstc__${t}`;return t===s&&(i=s),e?`${i} ${i}--${e.replace(":","-")}`:i}("chart-time-bookmark")+(this.options.className?` ${this.options.className}`:""),this.PluginTimeBookmarksSlot=this.PluginTimeBookmarksSlot.bind(this),this.destroy=this.destroy.bind(this),this.state.update(e,this.options),this.state.update(i,(t=>(t.includes(this.PluginTimeBookmarksSlot)||t.push(this.PluginTimeBookmarksSlot),t))),this.unsub.push(this.state.subscribe(e,(t=>this.options=t)))}destroy(){this.unsub.forEach((t=>t())),this.state.update(i,(t=>t.filter((t=>t!==this.PluginTimeBookmarksSlot)))),this.vido.api.pluginDestroyed("TimeBookmarks")}PluginTimeBookmarksSlot(t){const{html:s,onDestroy:i,state:a,update:l,api:o,StyleMap:n}=t,c=[];i(a.subscribeAll([e,"$data.chart.time","$data.scroll.horizontal.dataIndex"],(()=>{var t;const s=a.get("$data.chart.time"),i=a.get(e);c.length=0;for(const e in i.bookmarks){const a=o.time.date(i.bookmarks[e].time);if(!o.time.isInCurrentView(a,s))continue;const l=Object.assign(Object.assign({},i.bookmarks[e]),{id:e,leftViewPx:0,absoluteLeftPx:0,visible:!1,date:null,styleMap:new n(Object.assign(null!==(t=i.bookmarks[e].style)&&void 0!==t?t:{},{left:"",height:""}))});l.styleMap.style.background=l.styleMap.style.background||l.color||"#3498DB",l.id=e,l.date=a,l.leftViewPx=o.time.getViewOffsetPxFromDates(a,!1,s),l.absoluteLeftPx=o.time.getGlobalOffsetPxFromDates(l.date,!1,s),l.visible=l.absoluteLeftPx>=s.leftPx&&l.absoluteLeftPx<=s.rightPx,c.push(l)}l()}),{group:!0}));let r=0,d=0;i(a.subscribe("$data.scroll.vertical",(t=>{r=Math.round(o.getRealChartHeight()),d=Math.round(-t.preciseOffset),l()})));const h=t=>s`<div
class="${this.className}-line ${this.className}-line--${t.id}${t.className?` ${t.className}`:""}"

@@ -30,0 +30,0 @@ style="left:${t.leftViewPx}px;top: ${d}px;"

@@ -9,6 +9,6 @@ /**

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE
*/
const t="chart-timeline-grid-row-cell",i="chart-timeline-items-row-item";function e(t={}){const i={enabled:!0,isMoving:!1,pointerState:"up",currentTarget:null,realTarget:null,targetType:"",targetData:null,captureEvents:{down:!1,up:!1,move:!1},initialPosition:{x:0,y:0},currentPosition:{x:0,y:0},movement:{x:0,y:0},events:{down:null,move:null,up:null}};return t.captureEvents&&(i.captureEvents=Object.assign(Object.assign({},i.captureEvents),t.captureEvents)),i}const a="config.plugin.TimelinePointer";class s{constructor(s,n){this.locked={up:!1,move:!1,down:!1},this.initialScrollPosPx={horizontal:0,vertical:0},this.onDestroy=[],this.classNames={cell:"",item:""},this.api=n.api,this.state=n.state,this.apiPointerListeners={down:new Set,move:new Set,up:new Set},this.pointerDown=this.pointerDown.bind(this),this.pointerMove=this.pointerMove.bind(this),this.pointerMove=n.schedule(this.pointerMove),this.pointerUp=this.pointerUp.bind(this),this.onDestroy.push(this.state.subscribe("$data.elements.chart-timeline",(t=>{t&&(this.element=t,this.element.removeEventListener("pointerdown",this.pointerDown),this.element.addEventListener("pointerdown",this.pointerDown),document.removeEventListener("pointerup",this.pointerUp),document.addEventListener("pointerup",this.pointerUp),document.removeEventListener("pointermove",this.pointerMove),document.addEventListener("pointermove",this.pointerMove))}))),this.apiLock=this.apiLock.bind(this),this.apiUnlock=this.apiUnlock.bind(this),this.apiIsLocked=this.apiIsLocked.bind(this),this.apiAddPointerListener=this.apiAddPointerListener.bind(this),this.apiRemovePointerListener=this.apiRemovePointerListener.bind(this),this.getRealPosition=this.getRealPosition.bind(this),this.data=e(s),this.classNames.cell=this.api.getClass(t),this.classNames.item=this.api.getClass(i),this.destroy=this.destroy.bind(this),this.api.plugins.TimelinePointer={lock:this.apiLock,unlock:this.apiUnlock,isLocked:this.apiIsLocked,addPointerListener:this.apiAddPointerListener,removePointerListener:this.apiRemovePointerListener},this.onDestroy.push(this.state.subscribe(a,(t=>this.data=t)))}destroy(){this.onDestroy.forEach((t=>t())),this.element.removeEventListener("pointerdown",this.pointerDown),document.removeEventListener("pointerup",this.pointerUp),document.removeEventListener("pointermove",this.pointerMove),this.api.pluginDestroyed("TimelinePointer")}updateData(){this.state.update(a,(()=>Object.assign({},this.data)))}apiLock(t,i=!0){this.locked[t]=i}apiUnlock(t){this.locked[t]=!1}apiIsLocked(t){return this.locked[t]}apiAddPointerListener(t,i){this.apiPointerListeners[t].add(i)}apiRemovePointerListener(t,i){this.apiPointerListeners[t].delete(i)}apiTriggerPointerListener(t,i){this.apiPointerListeners[t].forEach((t=>t(i)))}getRealTarget(e){let a=e.target.closest("."+this.classNames.item);return a||(a=e.target.closest("."+this.classNames.cell),a||(a=e.target.closest(`[data-type="${i}"]`),a||(a=e.target.closest(`[data-type="${t}"]`),a||null)))}getRealPosition(t){const i={x:0,y:0};if(this.element){const e=this.element.getBoundingClientRect();i.x=t.clientX-e.x,i.y=t.clientY-e.y;const a=this.state.get("$data.scroll.vertical.preciseOffset")||0;i.y-=a}return i}pointerDown(e){if(!this.data.enabled)return;this.initialScrollPosPx.horizontal=this.state.get("$data.scroll.horizontal.handlePosPx"),this.initialScrollPosPx.vertical=this.state.get("$data.scroll.vertical.handlePosPx"),this.data.pointerState="down",this.data.currentTarget=e.target;const a=this.getRealTarget(e);if(this.data.realTarget=a,this.data.targetType="",this.data.targetData=null,this.data.realTarget)if(this.data.realTarget.classList.contains(this.classNames.item))this.data.targetType=i,this.data.targetData=this.data.realTarget.vido.item;else if(this.data.realTarget.classList.contains(this.classNames.cell))this.data.targetType=t,this.data.targetData=this.data.realTarget.vido;else if(this.data.realTarget.dataset.type===i){this.data.targetType=i;const t=this.data.realTarget.dataset.gstcid;this.data.targetData=this.api.getItem(t)}else if(this.data.realTarget.dataset.type===t){this.data.targetType=t;const i=this.data.realTarget.dataset.gstcid;this.data.targetData=this.state.get(`$data.chart.grid.cells.${i}`)}this.data.isMoving=!!this.data.targetType,this.data.events.down=e,this.data.events.move=e;const s=this.getRealPosition(e);this.data.initialPosition=s,this.data.currentPosition=s;const n={type:this.data.pointerState,originalEvent:e,targetElement:a,targetData:this.data.targetData,targetType:this.data.targetType,initialPosition:this.data.initialPosition,currentPosition:this.data.currentPosition,movement:{x:0,y:0},initialScrollPosPx:this.initialScrollPosPx,isMoving:this.data.isMoving,allEvents:this.data.events};this.apiTriggerPointerListener("down",n),this.updateData()}pointerUp(t){if(!this.data.enabled)return;this.data.pointerState="up",this.data.isMoving=!1,this.data.events.up=t,this.data.currentPosition=this.getRealPosition(t);const i={type:this.data.pointerState,originalEvent:t,targetElement:this.data.realTarget,targetData:this.data.targetData,targetType:this.data.targetType,initialPosition:this.data.initialPosition,currentPosition:this.data.currentPosition,movement:this.data.movement,initialScrollPosPx:this.initialScrollPosPx,isMoving:this.data.isMoving,allEvents:this.data.events};this.apiTriggerPointerListener("up",i),this.updateData()}pointerMove(t){if(!this.data.enabled||!this.data.isMoving)return;const i=this.state.get("$data.scroll.horizontal.handlePosPx");this.data.pointerState="move",this.data.events.move=t,this.data.currentPosition=this.getRealPosition(t),this.data.movement.x=this.data.currentPosition.x-this.data.initialPosition.x,this.data.movement.y=this.data.currentPosition.y-this.data.initialPosition.y,this.data.movement.x+=i-this.initialScrollPosPx.horizontal;const e={type:this.data.pointerState,originalEvent:t,targetElement:this.data.realTarget,targetData:this.data.targetData,targetType:this.data.targetType,initialPosition:this.data.initialPosition,currentPosition:this.data.currentPosition,movement:this.data.movement,initialScrollPosPx:this.initialScrollPosPx,isMoving:this.data.isMoving,allEvents:this.data.events};this.apiTriggerPointerListener("move",e),this.updateData()}}function n(t={}){return function(i){const n=i.api,o=i.api.mergeDeep,r=i.state.get(a);r&&(t=o(o({},t),r));const h=e(t);i.state.update(a,h);const l=new s(t,i);return n.pluginInitialized("TimelinePointer"),l.destroy}}export{t as CELL,i as ITEM,n as Plugin};

@@ -10,5 +10,5 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).TimelinePointer={})}(this,(function(t){"use strict";

* @link https://gantt-schedule-timeline-calendar.neuronet.io
* @version 3.33.1
* @released 2022-07-21
* @version 3.33.2
* @released 2022-07-22
* @license SEE LICENSE IN LICENSE FILE
*/const e="chart-timeline-grid-row-cell",i="chart-timeline-items-row-item";function a(t={}){const e={enabled:!0,isMoving:!1,pointerState:"up",currentTarget:null,realTarget:null,targetType:"",targetData:null,captureEvents:{down:!1,up:!1,move:!1},initialPosition:{x:0,y:0},currentPosition:{x:0,y:0},movement:{x:0,y:0},events:{down:null,move:null,up:null}};return t.captureEvents&&(e.captureEvents=Object.assign(Object.assign({},e.captureEvents),t.captureEvents)),e}const s="TimelinePointer",n=`config.plugin.${s}`;class o{constructor(t,s){this.locked={up:!1,move:!1,down:!1},this.initialScrollPosPx={horizontal:0,vertical:0},this.onDestroy=[],this.classNames={cell:"",item:""},this.api=s.api,this.state=s.state,this.apiPointerListeners={down:new Set,move:new Set,up:new Set},this.pointerDown=this.pointerDown.bind(this),this.pointerMove=this.pointerMove.bind(this),this.pointerMove=s.schedule(this.pointerMove),this.pointerUp=this.pointerUp.bind(this),this.onDestroy.push(this.state.subscribe("$data.elements.chart-timeline",(t=>{t&&(this.element=t,this.element.removeEventListener("pointerdown",this.pointerDown),this.element.addEventListener("pointerdown",this.pointerDown),document.removeEventListener("pointerup",this.pointerUp),document.addEventListener("pointerup",this.pointerUp),document.removeEventListener("pointermove",this.pointerMove),document.addEventListener("pointermove",this.pointerMove))}))),this.apiLock=this.apiLock.bind(this),this.apiUnlock=this.apiUnlock.bind(this),this.apiIsLocked=this.apiIsLocked.bind(this),this.apiAddPointerListener=this.apiAddPointerListener.bind(this),this.apiRemovePointerListener=this.apiRemovePointerListener.bind(this),this.getRealPosition=this.getRealPosition.bind(this),this.data=a(t),this.classNames.cell=this.api.getClass(e),this.classNames.item=this.api.getClass(i),this.destroy=this.destroy.bind(this),this.api.plugins.TimelinePointer={lock:this.apiLock,unlock:this.apiUnlock,isLocked:this.apiIsLocked,addPointerListener:this.apiAddPointerListener,removePointerListener:this.apiRemovePointerListener},this.onDestroy.push(this.state.subscribe(n,(t=>this.data=t)))}destroy(){this.onDestroy.forEach((t=>t())),this.element.removeEventListener("pointerdown",this.pointerDown),document.removeEventListener("pointerup",this.pointerUp),document.removeEventListener("pointermove",this.pointerMove),this.api.pluginDestroyed(s)}updateData(){this.state.update(n,(()=>Object.assign({},this.data)))}apiLock(t,e=!0){this.locked[t]=e}apiUnlock(t){this.locked[t]=!1}apiIsLocked(t){return this.locked[t]}apiAddPointerListener(t,e){this.apiPointerListeners[t].add(e)}apiRemovePointerListener(t,e){this.apiPointerListeners[t].delete(e)}apiTriggerPointerListener(t,e){this.apiPointerListeners[t].forEach((t=>t(e)))}getRealTarget(t){let a=t.target.closest("."+this.classNames.item);return a||(a=t.target.closest("."+this.classNames.cell),a||(a=t.target.closest(`[data-type="${i}"]`),a||(a=t.target.closest(`[data-type="${e}"]`),a||null)))}getRealPosition(t){const e={x:0,y:0};if(this.element){const i=this.element.getBoundingClientRect();e.x=t.clientX-i.x,e.y=t.clientY-i.y;const a=this.state.get("$data.scroll.vertical.preciseOffset")||0;e.y-=a}return e}pointerDown(t){if(!this.data.enabled)return;this.initialScrollPosPx.horizontal=this.state.get("$data.scroll.horizontal.handlePosPx"),this.initialScrollPosPx.vertical=this.state.get("$data.scroll.vertical.handlePosPx"),this.data.pointerState="down",this.data.currentTarget=t.target;const a=this.getRealTarget(t);if(this.data.realTarget=a,this.data.targetType="",this.data.targetData=null,this.data.realTarget)if(this.data.realTarget.classList.contains(this.classNames.item))this.data.targetType=i,this.data.targetData=this.data.realTarget.vido.item;else if(this.data.realTarget.classList.contains(this.classNames.cell))this.data.targetType=e,this.data.targetData=this.data.realTarget.vido;else if(this.data.realTarget.dataset.type===i){this.data.targetType=i;const t=this.data.realTarget.dataset.gstcid;this.data.targetData=this.api.getItem(t)}else if(this.data.realTarget.dataset.type===e){this.data.targetType=e;const t=this.data.realTarget.dataset.gstcid;this.data.targetData=this.state.get(`$data.chart.grid.cells.${t}`)}this.data.isMoving=!!this.data.targetType,this.data.events.down=t,this.data.events.move=t;const s=this.getRealPosition(t);this.data.initialPosition=s,this.data.currentPosition=s;const n={type:this.data.pointerState,originalEvent:t,targetElement:a,targetData:this.data.targetData,targetType:this.data.targetType,initialPosition:this.data.initialPosition,currentPosition:this.data.currentPosition,movement:{x:0,y:0},initialScrollPosPx:this.initialScrollPosPx,isMoving:this.data.isMoving,allEvents:this.data.events};this.apiTriggerPointerListener("down",n),this.updateData()}pointerUp(t){if(!this.data.enabled)return;this.data.pointerState="up",this.data.isMoving=!1,this.data.events.up=t,this.data.currentPosition=this.getRealPosition(t);const e={type:this.data.pointerState,originalEvent:t,targetElement:this.data.realTarget,targetData:this.data.targetData,targetType:this.data.targetType,initialPosition:this.data.initialPosition,currentPosition:this.data.currentPosition,movement:this.data.movement,initialScrollPosPx:this.initialScrollPosPx,isMoving:this.data.isMoving,allEvents:this.data.events};this.apiTriggerPointerListener("up",e),this.updateData()}pointerMove(t){if(!this.data.enabled||!this.data.isMoving)return;const e=this.state.get("$data.scroll.horizontal.handlePosPx");this.data.pointerState="move",this.data.events.move=t,this.data.currentPosition=this.getRealPosition(t),this.data.movement.x=this.data.currentPosition.x-this.data.initialPosition.x,this.data.movement.y=this.data.currentPosition.y-this.data.initialPosition.y,this.data.movement.x+=e-this.initialScrollPosPx.horizontal;const i={type:this.data.pointerState,originalEvent:t,targetElement:this.data.realTarget,targetData:this.data.targetData,targetType:this.data.targetType,initialPosition:this.data.initialPosition,currentPosition:this.data.currentPosition,movement:this.data.movement,initialScrollPosPx:this.initialScrollPosPx,isMoving:this.data.isMoving,allEvents:this.data.events};this.apiTriggerPointerListener("move",i),this.updateData()}}t.CELL=e,t.ITEM=i,t.Plugin=function(t={}){return function(e){const i=e.api,s=e.api.mergeDeep,r=e.state.get(n);r&&(t=s(s({},t),r));const h=a(t);e.state.update(n,h);const l=new o(t,e);return i.pluginInitialized("TimelinePointer"),l.destroy}},Object.defineProperty(t,"__esModule",{value:!0})}));
{
"name": "gantt-schedule-timeline-calendar",
"version": "3.33.1",
"version": "3.33.2",
"description": "Gantt, Schedule, Timeline, Calendar components all in one. [gantt, timeline, schedule, scheduler, calendar, booking, gantt chart, reservation, javascript gantt, javascript timeline, javascript schedule, javascript scheduler, javascript calendar, javascript booking, javascript gantt chart, javascript reservation, js gantt, js timeline, js schedule, js scheduler, js calendar, js booking, js gantt chart, js reservation, typescript gantt, typescript timeline, typescript schedule, typescript scheduler, typescript calendar, typescript booking, typescript gantt chart, typescript reservation, vue gantt, vue timeline, vue schedule, vue scheduler, vue calendar, vue booking, vue gantt chart, vue reservation, react gantt, react timeline, react schedule, react scheduler, react calendar, react booking, react gantt chart, react reservation, angular gantt, angular timeline, angular schedule, angular scheduler, angular calendar, angular booking, angular gantt chart, angular reservation, svelte gantt, svelte timeline, svelte schedule, svelte scheduler, svelte calendar, svelte booking, svelte gantt chart, svelte reservation, jQuery gantt, jQuery timeline, jQuery schedule, jQuery scheduler, jQuery calendar, jQuery booking, jQuery gantt chart, jQuery reservation, component gantt, component timeline, component schedule, component scheduler, component calendar, component booking, component gantt chart, component reservation, javascript horizontal timeline, javascript multimedia editor, javascript timeline editor, js horizontal timeline, js multimedia editor, js timeline editor, typescript horizontal timeline, typescript multimedia editor, typescript timeline editor, vue horizontal timeline, vue multimedia editor, vue timeline editor, react horizontal timeline, react multimedia editor, react timeline editor, angular horizontal timeline, angular multimedia editor, angular timeline editor, svelte horizontal timeline, svelte multimedia editor, svelte timeline editor, jQuery horizontal timeline, jQuery multimedia editor, jQuery timeline editor, component horizontal timeline, component multimedia editor, component timeline editor]",

@@ -5,0 +5,0 @@ "main": "dist/gstc.wasm.esm.min.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc