gantt-source_management 3.37.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +9 -0
- package/.eslintrc.json +39 -0
- package/.prettierrc.cjs +5 -0
- package/README.md +129 -0
- package/cypress/e2e/add-rows-items.test.ts +26 -0
- package/cypress/e2e/basic.test.ts +173 -0
- package/cypress/e2e/calculated-zoom-mode.test.ts +163 -0
- package/cypress/e2e/calendar-dates.test.ts +285 -0
- package/cypress/e2e/dst.test.ts +691 -0
- package/cypress/e2e/grid-cells.test.ts +72 -0
- package/cypress/e2e/items-vertical.test.ts +305 -0
- package/cypress/e2e/items.test.ts +501 -0
- package/cypress/e2e/list-columns-toggle.test.ts +124 -0
- package/cypress/e2e/list-header-resize.test.ts +30 -0
- package/cypress/e2e/locale.test.ts +102 -0
- package/cypress/e2e/move-items-outside.test.ts +437 -0
- package/cypress/e2e/rows.test.ts +50 -0
- package/cypress/e2e/scroll-bar.test.ts +357 -0
- package/cypress/e2e/time-bookmarks.test.ts +92 -0
- package/cypress/e2e/utc-mode.test.ts +51 -0
- package/cypress/fixtures/example.json +5 -0
- package/cypress/helpers.ts +12 -0
- package/cypress/plugins/index.js +22 -0
- package/cypress/support/commands.ts +175 -0
- package/cypress/support/e2e.ts +31 -0
- package/cypress.config.js +24 -0
- package/dist/api/api.d.ts +182 -0
- package/dist/api/helpers.d.ts +9 -0
- package/dist/api/id.d.ts +14 -0
- package/dist/api/locale.d.ts +3 -0
- package/dist/api/main.d.ts +47 -0
- package/dist/api/public.d.ts +32 -0
- package/dist/api/slots.d.ts +22 -0
- package/dist/api/time.d.ts +104 -0
- package/dist/assets/2f1f893a.wasm +0 -0
- package/dist/gstc.d.ts +708 -0
- package/dist/gstc.esm.min.d.ts +708 -0
- package/dist/gstc.esm.min.js +574 -0
- package/dist/gstc.umd.min.d.ts +708 -0
- package/dist/gstc.umd.min.js +701 -0
- package/dist/gstc.wasm.esm.min.d.ts +708 -0
- package/dist/gstc.wasm.esm.min.js +574 -0
- package/dist/gstc.wasm.umd.min.d.ts +708 -0
- package/dist/gstc.wasm.umd.min.js +701 -0
- package/dist/plugins/calendar-scroll.d.ts +15 -0
- package/dist/plugins/calendar-scroll.esm.min.d.ts +15 -0
- package/dist/plugins/calendar-scroll.esm.min.js +13 -0
- package/dist/plugins/calendar-scroll.umd.min.d.ts +15 -0
- package/dist/plugins/calendar-scroll.umd.min.js +13 -0
- package/dist/plugins/dependency-lines.d.ts +47 -0
- package/dist/plugins/dependency-lines.esm.min.d.ts +47 -0
- package/dist/plugins/dependency-lines.esm.min.js +38 -0
- package/dist/plugins/dependency-lines.umd.min.d.ts +47 -0
- package/dist/plugins/dependency-lines.umd.min.js +38 -0
- package/dist/plugins/export-image.d.ts +12 -0
- package/dist/plugins/export-image.esm.min.d.ts +12 -0
- package/dist/plugins/export-image.esm.min.js +28 -0
- package/dist/plugins/export-image.umd.min.d.ts +12 -0
- package/dist/plugins/export-image.umd.min.js +34 -0
- package/dist/plugins/export-pdf.d.ts +12 -0
- package/dist/plugins/export-pdf.esm.min.d.ts +12 -0
- package/dist/plugins/export-pdf.esm.min.js +389 -0
- package/dist/plugins/export-pdf.umd.min.d.ts +12 -0
- package/dist/plugins/export-pdf.umd.min.js +511 -0
- package/dist/plugins/grab-scroll.d.ts +14 -0
- package/dist/plugins/grab-scroll.esm.min.d.ts +14 -0
- package/dist/plugins/grab-scroll.umd.min.d.ts +14 -0
- package/dist/plugins/highlight-weekends.d.ts +12 -0
- package/dist/plugins/highlight-weekends.esm.min.d.ts +12 -0
- package/dist/plugins/highlight-weekends.esm.min.js +14 -0
- package/dist/plugins/highlight-weekends.umd.min.d.ts +12 -0
- package/dist/plugins/highlight-weekends.umd.min.js +14 -0
- package/dist/plugins/item-movement.d.ts +97 -0
- package/dist/plugins/item-movement.esm.min.d.ts +97 -0
- package/dist/plugins/item-movement.esm.min.js +25 -0
- package/dist/plugins/item-movement.umd.min.d.ts +97 -0
- package/dist/plugins/item-movement.umd.min.js +25 -0
- package/dist/plugins/item-resizing.d.ts +102 -0
- package/dist/plugins/item-resizing.esm.min.d.ts +102 -0
- package/dist/plugins/item-resizing.esm.min.js +37 -0
- package/dist/plugins/item-resizing.umd.min.d.ts +102 -0
- package/dist/plugins/item-resizing.umd.min.js +37 -0
- package/dist/plugins/item-types.d.ts +13 -0
- package/dist/plugins/item-types.esm.min.d.ts +13 -0
- package/dist/plugins/item-types.esm.min.js +127 -0
- package/dist/plugins/item-types.umd.min.d.ts +13 -0
- package/dist/plugins/item-types.umd.min.js +127 -0
- package/dist/plugins/progress-bar.d.ts +13 -0
- package/dist/plugins/progress-bar.esm.min.d.ts +13 -0
- package/dist/plugins/progress-bar.esm.min.js +27 -0
- package/dist/plugins/progress-bar.umd.min.d.ts +13 -0
- package/dist/plugins/progress-bar.umd.min.js +27 -0
- package/dist/plugins/selection.d.ts +94 -0
- package/dist/plugins/selection.esm.min.d.ts +94 -0
- package/dist/plugins/selection.esm.min.js +26 -0
- package/dist/plugins/selection.umd.min.d.ts +94 -0
- package/dist/plugins/selection.umd.min.js +26 -0
- package/dist/plugins/time-bookmarks.d.ts +38 -0
- package/dist/plugins/time-bookmarks.esm.min.d.ts +38 -0
- package/dist/plugins/time-bookmarks.esm.min.js +50 -0
- package/dist/plugins/time-bookmarks.umd.min.d.ts +38 -0
- package/dist/plugins/time-bookmarks.umd.min.js +50 -0
- package/dist/plugins/timeline-pointer.d.ts +83 -0
- package/dist/plugins/timeline-pointer.esm.min.d.ts +83 -0
- package/dist/plugins/timeline-pointer.esm.min.js +13 -0
- package/dist/plugins/timeline-pointer.umd.min.d.ts +83 -0
- package/dist/plugins/timeline-pointer.umd.min.js +13 -0
- package/dist/style.css +811 -0
- package/dist/vendor.esm.min.js +128 -0
- package/examples/complex-1/faces/face-1.jpg +0 -0
- package/examples/complex-1/faces/face-10.jpg +0 -0
- package/examples/complex-1/faces/face-11.jpg +0 -0
- package/examples/complex-1/faces/face-12.jpg +0 -0
- package/examples/complex-1/faces/face-13.jpg +0 -0
- package/examples/complex-1/faces/face-14.jpg +0 -0
- package/examples/complex-1/faces/face-15.jpg +0 -0
- package/examples/complex-1/faces/face-16.jpg +0 -0
- package/examples/complex-1/faces/face-17.jpg +0 -0
- package/examples/complex-1/faces/face-18.jpg +0 -0
- package/examples/complex-1/faces/face-19.jpg +0 -0
- package/examples/complex-1/faces/face-2.jpg +0 -0
- package/examples/complex-1/faces/face-20.jpg +0 -0
- package/examples/complex-1/faces/face-21.jpg +0 -0
- package/examples/complex-1/faces/face-22.jpg +0 -0
- package/examples/complex-1/faces/face-23.jpg +0 -0
- package/examples/complex-1/faces/face-24.jpg +0 -0
- package/examples/complex-1/faces/face-25.jpg +0 -0
- package/examples/complex-1/faces/face-26.jpg +0 -0
- package/examples/complex-1/faces/face-27.jpg +0 -0
- package/examples/complex-1/faces/face-28.jpg +0 -0
- package/examples/complex-1/faces/face-29.jpg +0 -0
- package/examples/complex-1/faces/face-3.jpg +0 -0
- package/examples/complex-1/faces/face-30.jpg +0 -0
- package/examples/complex-1/faces/face-31.jpg +0 -0
- package/examples/complex-1/faces/face-32.jpg +0 -0
- package/examples/complex-1/faces/face-33.jpg +0 -0
- package/examples/complex-1/faces/face-34.jpg +0 -0
- package/examples/complex-1/faces/face-35.jpg +0 -0
- package/examples/complex-1/faces/face-36.jpg +0 -0
- package/examples/complex-1/faces/face-37.jpg +0 -0
- package/examples/complex-1/faces/face-38.jpg +0 -0
- package/examples/complex-1/faces/face-39.jpg +0 -0
- package/examples/complex-1/faces/face-4.jpg +0 -0
- package/examples/complex-1/faces/face-40.jpg +0 -0
- package/examples/complex-1/faces/face-41.jpg +0 -0
- package/examples/complex-1/faces/face-42.jpg +0 -0
- package/examples/complex-1/faces/face-43.jpg +0 -0
- package/examples/complex-1/faces/face-44.jpg +0 -0
- package/examples/complex-1/faces/face-45.jpg +0 -0
- package/examples/complex-1/faces/face-46.jpg +0 -0
- package/examples/complex-1/faces/face-47.jpg +0 -0
- package/examples/complex-1/faces/face-48.jpg +0 -0
- package/examples/complex-1/faces/face-49.jpg +0 -0
- package/examples/complex-1/faces/face-5.jpg +0 -0
- package/examples/complex-1/faces/face-50.jpg +0 -0
- package/examples/complex-1/faces/face-6.jpg +0 -0
- package/examples/complex-1/faces/face-7.jpg +0 -0
- package/examples/complex-1/faces/face-8.jpg +0 -0
- package/examples/complex-1/faces/face-9.jpg +0 -0
- package/examples/complex-1/index.html +61 -0
- package/examples/complex-1/index.js +923 -0
- package/examples/index.html +22 -0
- package/examples/reset.css +455 -0
- package/examples/server.js +18 -0
- package/package.json +150 -0
- package/tsconfig.json +17 -0
|
@@ -0,0 +1,574 @@
|
|
|
1
|
+
import{d as t,u as e,a as o,S as a,A as i,h as s,l as n,v as l,D as r,_ as c,m as d,b as h,c as u,p as m,P as g,e as f,f as p,J as w,V as b}from"./vendor.esm.min.js";
|
|
2
|
+
/**
|
|
3
|
+
* Gantt-Schedule-Timeline-Calendar Time api
|
|
4
|
+
*
|
|
5
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
6
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
7
|
+
* @module gantt-schedule-timeline-calendar
|
|
8
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
9
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
10
|
+
* @version 3.37.5
|
|
11
|
+
* @released 2024-07-19
|
|
12
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
13
|
+
*/class v{constructor(a,i){this.utcMode=!1,this.unsubs=[],this.currentDateLastCheck=0,this.state=a,this.api=i,this.dayjs=t,this.dayjs.extend(e),this.dayjs.extend(o),this.unsubs.push(a.subscribe("config.utcMode",(t=>{this.utcMode=t}))),this.unsubs.push(a.subscribe("config.locale",(t=>{if(!t.name)throw new Error("Locale must have a name property.");this.locale=t,this.dayjs.locale(this.locale,null,!0)})))}destroy(){for(const t of this.unsubs)t()}date(e=void 0){return this.utcMode?t.utc(e).locale(this.locale.name):e?t(e).locale(this.locale.name):t().locale(this.locale.name)}recalculateTime(){this.api.main.recalculateTimes([{name:"all"}])}recalculateFromTo(t,e=!1){const o=t.period;if((t=Object.assign({},t)).from=+t.from,t.to=+t.to,t.fromDate=this.date(t.from).startOf(o),t.from=t.fromDate.valueOf(),t.toDate=this.date(t.to).endOf(o),t.to=t.toDate.valueOf(),!t.autoExpandTimeFromItems||t.calculatedZoomMode)return t;let a=Number.MAX_SAFE_INTEGER,i=0;const s=this.state.get("config.chart.items");if(Object.keys(s).length>0&&(0===t.from||0===t.to||e)){for(const t in s){const e=s[t];e.time.start<a&&e.time.start&&(a=e.time.start),e.time.end>i&&(i=e.time.end)}a<t.from&&(t.fromDate=this.date(a).startOf(o),t.from=t.fromDate.valueOf()),i>t.to&&(t.toDate=this.date(i).endOf(o),t.to=t.toDate.valueOf())}return t}getCenter(t){return t.leftGlobal+Math.round((t.rightGlobal-t.leftGlobal)/2)}isInCurrentView(t,e=this.state.get("$data.chart.time")){const o=t.valueOf();return!(o<e.leftGlobal||o>e.rightGlobal)}recalculateDatesWidths(t,e=this.state.get("$data.chart.time")){if(!e.timePerPixel)throw new Error("[gantt-schedule-timeline-calendar] No timePerPixel");for(const o of t){if(!o.leftGlobal||!o.rightGlobal)throw new Error("[gantt-schedule-timeline-calendar] No date leftGlobal or rightGlobal.");o.width=(o.rightGlobal+1-o.leftGlobal)/e.timePerPixel}return t}recalculateDatesPositions(t,e=this.state.get("$data.chart.time"),o=!0,a=!1){let i=0;if(o)for(const o of t){if(o.leftGlobal>=e.leftGlobal)break;if(isNaN(o.width))throw new Error("[gantt-schedule-timeline-calendar] NaN date width.");i-=o.width}for(let o of t){if(a&&(o=this.api.mergeDeep({},o)),o.leftPx=i,o.rightPx=i+o.width,isNaN(o.leftPx)||isNaN(o.rightPx))throw new Error("[gantt-schedule-timeline-calendar] Date leftPx or rightPx is a NaN.");o.currentView&&(o.currentView.leftPx=o.leftPx-e.leftPx,o.currentView.rightPx=o.rightPx-e.leftPx,o.currentView.width=o.currentView.rightPx-o.currentView.leftPx),i+=o.width}return t}setDatesCacheLevel(t,e,o=this.state.get("$data.chart.time")){if(!e.length)return;o.datesCache||(o.datesCache={timePerPixel:0,levels:[]}),o.datesCache.timePerPixel=o.timePerPixel,o.datesCache.levels[t]||(o.datesCache.levels[t]={leftTime:0,rightTime:0,dates:[]});const a=o.datesCache.levels[t];a.leftTime=e[0].leftGlobal,a.rightTime=e[e.length-1].rightGlobal,a.dates=[...e]}addDatesToCacheLevel(t,e,o=this.state.get("$data.chart.time")){if(!e.length)return;if(!o.datesCache)return;if(o.datesCache.timePerPixel!==o.timePerPixel)return e;const a=e[0],i=e[e.length-1],s=o.datesCache.levels[t];if(!s)return e;if(s.leftTime<=a.leftGlobal&&s.rightTime>=i.rightGlobal)return s.dates;if(s.dates.length>=1e6)throw new Error("[gantt-schedule-timeline-calendar] To many dates.");const n=[];if(a.leftGlobal<s.leftTime){for(const t of e){if(!(t.leftGlobal<s.leftTime))break;n.push(t)}s.leftTime=n[0].leftGlobal}for(const t of s.dates)n.push(t);if(i.rightGlobal>s.rightTime){for(const t of e)t.rightGlobal>s.rightTime&&n.push(t);s.rightTime=n[n.length-1].rightGlobal}return s.dates=n,s.dates}isLevelDateInCache(t,e,o=this.state.get("$data.chart.time")){if(!o.datesCache)return!1;if(o.datesCache.timePerPixel!==o.timePerPixel)return!1;const a=o.datesCache.levels[t];return!(!a||!a.dates.length)&&(e>=a.leftTime&&e<=a.rightTime)}getLevelDatesFromCache(t,e,o,a=this.state.get("$data.chart.time")){if(a.datesCache.timePerPixel!==a.timePerPixel)return[];const i=a.datesCache.levels[t];if(!i)return[];if(!(e>=i.leftTime&&o<=i.rightTime))return[];let s=0,n=0,l=!1;const r=i.dates.length;for(;n<r;n++){const t=i.dates[n];if(t.rightGlobal>=e&&(l=!0),t.rightGlobal>=o)break;l||s++}return{[Symbol.iterator](){let t=s;return{next:()=>t<=n?{value:i.dates[t++],done:!1}:(t=s,{done:!0})}},length:n-s+1}}getLevelDateFromCache(t,e,o=this.state.get("$data.chart.time")){if(!this.isLevelDateInCache(t,e,o))return null;for(const a of o.datesCache.levels[t].dates)if(a.rightGlobal>=e)return a;return null}getAllLevelDatesFromCache(t,e=this.state.get("$data.chart.time")){return e.datesCache.levels[t].dates}findOrCreateMainDateAtTime(t,e=this.state.get("$data.chart.time")){if(this.isLevelDateInCache(e.level,t,e))return this.getLevelDateFromCache(e.level,t,e);let o=[];e.datesCache.levels[e.level]&&(o=e.datesCache.levels[e.level].dates),o=this.addMissingDates(o,this.date(t),e);for(const e of o)if(e.rightGlobal>=t)return e;return null}addMissingDates(t,e,o=this.state.get("$data.chart.time"),a=!0){if(!t.length)return[];const i=t[0],s=t[t.length-1];if(!(e.valueOf()<i.leftGlobal||e.valueOf()>s.rightGlobal))return t;if(this.isLevelDateInCache(o.level,e.valueOf(),o))return this.getAllLevelDatesFromCache(o.level,o);const n=t.length;let l=t;if(a){l=new Array(n);for(let e=0;e<n;e++)l[e]=this.api.mergeDeep({},t[e])}const r=this.state.get(`config.chart.calendarLevels.${o.level}`),c=this.getCurrentFormatForLevel(r,o);let d=1;if("number"==typeof c.periodIncrement&&(d=c.periodIncrement),e.valueOf()<i.leftGlobal){if("function"==typeof c.periodIncrement)return t;const s=i.leftGlobalDate.subtract(1,"ms");let n=i.leftGlobalDate.subtract(d,o.period).startOf(o.period);for(;e.valueOf()<n.valueOf();)n=n.subtract(d,o.period).startOf(o.period);let r=[];do{r=this.generatePeriodDates({leftDate:n,rightDate:s,period:o.period,level:this.state.get(`config.chart.calendarLevels.${o.level}`),levelIndex:o.level,callOnDate:!0,callOnLevelDates:!0,time:o}),n=n.subtract(1,o.period)}while(!r.length||r[0].leftGlobal>e.valueOf());return r=r.filter((t=>!l.find((e=>e.leftGlobal===t.leftGlobal)))),t=[...r,...l],t=this.recalculateDatesWidths(t,o),t=this.recalculateDatesPositions(t,o,!0,a),this.addDatesToCacheLevel(o.level,t,o)}if(e.valueOf()>s.rightGlobal){let i=s.rightGlobalDate.add(d,o.period).endOf(o.period);for(;e.valueOf()>i.valueOf();)i=i.add(d,o.period).endOf(o.period);let n=this.generatePeriodDates({leftDate:s.rightGlobalDate.add(1,"ms"),rightDate:i,period:o.period,level:this.state.get(`config.chart.calendarLevels.${o.level}`),levelIndex:o.level,callOnDate:!0,callOnLevelDates:!0,time:o});return n=n.filter((t=>!l.find((e=>e.leftGlobal===t.leftGlobal)))),t=[...l,...n],t=this.recalculateDatesWidths(t,o),t=this.recalculateDatesPositions(t,o,!0,a),this.addDatesToCacheLevel(o.level,t,o)}return l}getGlobalOffsetPxFromDates(t,e=!0,o=this.state.get("$data.chart.time"),a=void 0){const i=t.valueOf();if(!o.allDates||0===o.allDates.length)return-100;if(void 0===a&&(a=o.allDates[o.level]),e&&(a=this.addMissingDates(a,t,o)),!a||0===a.length)return-1;let s;for(let t=0,e=a.length;t<e;t++){const e=a[t];if(i<=e.rightGlobal+1){s=e;break}}return s?i<s.leftGlobal?s.leftPx:s.rightPx-(s.rightGlobal-i)/o.timePerPixel:i<=o.leftGlobal?0:i>=o.rightGlobal?o.totalViewDurationPx+(i-o.rightGlobal+1)/o.timePerPixel:-1}getViewOffsetPxFromDates(t,e=!0,o=this.state.get("$data.chart.time"),a=void 0,i=!0){a||(a=o.allDates[o.level]),i&&(a=this.addMissingDates(a,t,o));const s=this.getDatesDiffPx(o.leftGlobalDate,t,o,!0,a);return e?this.limitOffsetPxToView(s):s}limitOffsetPxToView(t,e=this.state.get("$data.chart.time")){if(t<0)return 0;if(!e.levels.length)return e.width;const o=e.levels[e.level];if(!o.length)return e.width;const a=o[o.length-1];return t>a.currentView.rightPx?a.currentView.rightPx:t}findDateAtViewOffsetPx(t,e){return e.find((e=>e.currentView.rightPx>=t))}findDateIndex(t,e){let o=0;for(const a of e){if(a.rightGlobal>=t)return o;o++}return-1}findDateAtTime(t,e=void 0){if(!e){const t=this.state.get("$data.chart.time");e=t.allDates[t.level]}return e.find((e=>e.rightGlobal>=t))}getMainDateFromRelativePosition(t,e){const o=t.leftPx+e,a=this.state.get("$data.chart.time"),i=a.allDates[a.level];for(const t of i)if(t.rightPx>o)return t}getTimeFromOffsetPx(t,e=!0,o=this.state.get("$data.chart.time"),a=void 0){let i=t;e&&(i+=o.leftPx),a||(a=o.allDates[o.level]);const s=this.state.get(`config.chart.calendarLevels.${o.level}`),n=this.getCurrentFormatForLevel(s,o);let l=1;if("number"==typeof n.periodIncrement&&(l=n.periodIncrement),i<0){if("function"==typeof n.periodIncrement)return o.from;let t,e=o.fromDate.subtract(l,o.period).startOf(o.period),a=0;for(let s=0;s<1e3;s++){const s=this.generatePeriodDates({leftDate:e,rightDate:e.add(l,o.period).subtract(1,"ms"),period:o.period,time:o,level:this.state.get(`config.chart.calendarLevels.${o.level}`),levelIndex:o.level,callOnDate:!0,callOnLevelDates:!0,expandIfMissing:!1});if(s.length&&(t=s[0],a-=t.width,a<=i))return t.leftGlobal+(i-a)*o.timePerPixel;e=e.subtract(l,o.period).startOf(o.period)}}else if(i>o.totalViewDurationPx){let t,e=o.toDate.add(1,o.period).startOf(o.period),a=o.totalViewDurationPx;for(let s=0;s<1e3;s++){const s=this.generatePeriodDates({leftDate:e,rightDate:e.add(l,o.period).subtract(1,"ms"),period:o.period,time:o,level:this.state.get(`config.chart.calendarLevels.${o.level}`),levelIndex:o.level,callOnDate:!0,callOnLevelDates:!0,expandIfMissing:!1});if(s.length&&(t=s[0],a+=t.width,a>i))return t.rightGlobal+1-(a-i)*o.timePerPixel;e=e.add(l,o.period).startOf(o.period)}}for(let t=0,e=a.length;t<e;t++){const e=a[t];if(e.rightPx>i){const t=(e.rightPx-i)*o.timePerPixel;return e.rightGlobal+1-t}}const r=a[a.length-1];return r.rightGlobal+1-(r.rightPx-i)*o.timePerPixel}getCurrentFormatForLevel(t,e){return t.find((t=>+e.zoom<=+t.zoomTo))}alignLevelToMain(t,e,o=this.state.get("$data.chart.time")){if(t===o.level)return e;if(!this.state.get("config.chart.time.alignLevelsToMain"))return e;const a=o.allDates[o.level];if(!a||!a.length)return e;if(!e||!e.length)return e;const i=e.length;for(let t=0;t<i;t++){const i=e[t];let s,n=!1,l=0;for(const t of a){if(t.rightGlobal>=i.leftGlobal){if(!n)if(t.leftGlobal>=i.leftGlobal)i.leftGlobal=t.leftGlobal,i.leftGlobalDate=this.date(i.leftGlobal),i.leftPx=t.leftPx;else{const e=(t.rightGlobal-i.leftGlobal)/o.timePerPixel;l=-(t.width-e)}n=!0}if(t.leftGlobal>i.rightGlobal)break;n&&(l+=t.width,s=t)}if(s)if(s.rightGlobal<=i.rightGlobal)i.rightGlobal=s.rightGlobal,i.rightGlobalDate=this.date(i.rightGlobal),i.width=l,i.rightPx=i.leftPx+i.width;else{const t=(s.rightGlobal-i.rightGlobal)/o.timePerPixel;i.width=l-t,i.rightPx=i.leftPx+i.width}}return e}stopCheckingCurrentDates(){this.checkCurrentDateTimeoutId&&clearTimeout(this.checkCurrentDateTimeoutId)}checkCurrentDates(t=!1,e=this.state.get("$data.chart.time")){const o=this.date().valueOf(),a=e.checkCurrentDateInterval;if(this.stopCheckingCurrentDates(),t&&(this.checkCurrentDateTimeoutId=setTimeout((()=>{this.checkCurrentDates(t,e)}),a)),o-this.currentDateLastCheck<a)return;const i=e.allDates;let s=!1;for(const t of i){const e=t.length;for(let a=0;a<e;a++){const i=t[a],n=i.current;i.current=!1,i.previous=!1,i.next=!1,i.leftGlobal<=o&&i.rightGlobal>=o&&(!0!==n&&(s=!0),i.current=!0,a>0&&(t[a-1].previous=!0),a+1<e&&(t[a+1].next=!0))}}this.currentDateLastCheck=o,s&&this.state.update("$data.chart.time.levels",(t=>t),{data:"current-time"}),this.api.render()}getDSTDiffForLevel(t,e,o,a=this.state.get("$data.chart.time")){const i=this.api.time.getLevelDatesFromCache(t,e,o,a);let s=0;for(const t of i)t.DST.diffMs&&e<=t.DST.afterTime&&o>t.DST.afterTime&&(s+=t.DST.diffMs);return s}setDatesDST(t){for(const e of t){const t=e.rightGlobal-e.leftGlobal,o=e.rightGlobalDate.utc(!0).valueOf()-e.leftGlobalDate.utc(!0).valueOf();if(t!==o){e.DST={diffMs:t-o,afterTime:0,afterDate:null};for(let t=0;t<9216;t++)if(e.leftGlobalDate.add(t,"hour").hour()!==e.leftGlobalDate.utc(!0).add(t,"hour").hour()){e.DST.afterDate=e.leftGlobalDate.add(t,"hour").subtract(1,"ms"),e.DST.afterTime=e.DST.afterDate.valueOf();break}}}return t}_generatePeriodDates(t){const e=[];t=Object.assign({},t);const{datesCount:o,rightDate:a,period:i,level:s,levelIndex:n,time:l,originalLeftDate:r,format:c}=t;let d=t.leftDate;const h=this.date().valueOf();for(let t=0;t<o;t++){let t=c.periodIncrement||1;"function"==typeof t&&(t=t({currentDates:e,date:d,leftDate:r,rightDate:a,period:i,level:s,levelIndex:n,time:l,vido:this.api.vido,api:this.api}));const o=d.add(t-1,i).endOf(i),u=d.valueOf()<=h&&o.valueOf()>=h,m={id:`gstcid-${d.valueOf()}`,leftGlobal:d.valueOf(),leftGlobalDate:d,rightGlobalDate:o,rightGlobal:o.valueOf(),width:0,leftPx:0,rightPx:0,period:i,formatted:null,current:u,previous:!1,next:!1,periodIncrementedBy:t,DST:{diffMs:0,afterTime:0,afterDate:null}};u&&e.length&&(e[e.length-1].previous=!0),e.length&&e[e.length-1].current&&(m.next=!0);const g=m.rightGlobal+1-m.leftGlobal;m.width=g/l.timePerPixel,e.push(m),d=d.add(t||1,i)}return this.setDatesDST(e)}generatePeriodDates({leftDate:t,rightDate:e,period:o,level:a,levelIndex:i,time:s,callOnDate:n,callOnLevelDates:l,expandIfMissing:r=!0}){if(!s.timePerPixel)return[];const c=this.getCurrentFormatForLevel(a,s);t=t.startOf(o),e=e.endOf(o);const d=Math.ceil(e.diff(t,o,!0)),h=t.clone();let u=this._generatePeriodDates({datesCount:d,leftDate:t,rightDate:e,period:o,level:a,levelIndex:i,time:s,originalLeftDate:h,format:c});if(n){const t=[];for(let e=0;e<u.length;e++){let o=u[e];if(o){for(let t=0,e=s.onDate.length;t<e;t++)o=s.onDate[t]({date:o,format:c,time:s,level:a,levelIndex:i});o&&t.push(o)}}u=t}if(l)for(let t=0,e=s.onLevelDates.length;t<e;t++)u=s.onLevelDates[t]({dates:u,format:c,time:s,level:a,levelIndex:i});if((!u.length||u[u.length-1].rightGlobal<e.valueOf())&&r){let r=this._generatePeriodDates({datesCount:d+100,leftDate:t,rightDate:e,period:o,level:a,levelIndex:i,time:s,originalLeftDate:h,format:c});if(n){const t=[];for(let e=0;e<r.length;e++){let o=r[e];if(o){for(let t=0,e=s.onDate.length;t<e;t++)o=s.onDate[t]({date:o,format:c,time:s,level:a,levelIndex:i});o&&t.push(o)}}r=t}if(l)for(let t=0,e=s.onLevelDates.length;t<e;t++)r=s.onLevelDates[t]({dates:r,format:c,time:s,level:a,levelIndex:i});const u=[];for(const t of r)if(u.push(t),t.rightGlobal>=e.valueOf())return u}this.addDatesToCacheLevel(i,u,s);const m=[];for(const t of u)if(m.push(t),t.rightGlobal>=e.valueOf())return m;return m}getDatesDiffPx(t,e,o,a=!0,i=void 0){if(t.valueOf()===e.valueOf())return 0;let s,n,l=0,r=!1;if(e.valueOf()<t.valueOf()){const o=t;t=e,e=o,r=!0}if(void 0===i){if(!o.allDates||!o.allDates.length||!o.allDates[o.level])return 0;i=o.allDates[o.level]}if(0===i.length)return 0;if(this.isLevelDateInCache(o.level,t.valueOf(),o)?i=this.getAllLevelDatesFromCache(o.level,o):t.valueOf()<i[0].leftGlobal&&(i=this.addMissingDates(i,t,o)),this.isLevelDateInCache(o.level,e.valueOf(),o))i=this.getAllLevelDatesFromCache(o.level,o);else{const t=i[i.length-1].rightGlobalDate.clone();e.valueOf()>t.valueOf()&&(i=this.addMissingDates(i,e,o))}this.addDatesToCacheLevel(o.level,i,o);let c=!1,d=0;for(const o of i)if(o.rightGlobal+1>=t.valueOf()&&!c&&(c=!0,n=o),c&&(l+=o.width),o.rightGlobal+1>=e.valueOf()){s=o,d=o.width;break}if(a){let a=t.valueOf()-n.leftGlobal;t.valueOf()<n.leftGlobal&&(a=0);let i=s.rightGlobal+1-e.valueOf();s.leftGlobal>e.valueOf()&&(i=s.rightGlobal+1-s.leftGlobal);const c=(i+a)/o.timePerPixel;return r?-(l-c):l-c}return l-=d,r?-l:l}getDatesDiffMs(t,e,o,a=!0,i=void 0){if(t.valueOf()===e.valueOf())return 0;let s,n,l=0,r=!1;if(e.valueOf()<t.valueOf()){const o=t;t=e,e=o,r=!0}if(void 0===i){if(!o.allDates||!o.allDates.length||!o.allDates[o.level])return 0;i=o.allDates[o.level]}if(0===i.length)return 0;if(this.isLevelDateInCache(o.level,t.valueOf(),o)?i=this.getAllLevelDatesFromCache(o.level,o):t.valueOf()<i[0].leftGlobal&&(i=this.addMissingDates(i,t,o)),this.isLevelDateInCache(o.level,e.valueOf(),o))i=this.getAllLevelDatesFromCache(o.level,o);else{const t=i[i.length-1].rightGlobalDate.clone();e.valueOf()>t.valueOf()&&(i=this.addMissingDates(i,e,o))}this.addDatesToCacheLevel(o.level,i,o);let c=!1,d=0;for(const o of i)if(o.rightGlobal+1>=t.valueOf()&&!c&&(c=!0,n=o),c&&(l+=o.rightGlobal+1-o.leftGlobal),o.rightGlobal+1>=e.valueOf()){s=o,d=o.rightGlobal+1-o.leftGlobal;break}if(a){let o=t.valueOf()-n.leftGlobal;t.valueOf()<n.leftGlobal&&(o=0);let a=s.rightGlobal+1-e.valueOf();s.leftGlobal>e.valueOf()&&(a=s.rightGlobal+1-s.leftGlobal);const i=a+o;return r?-(l-i):l-i}return l-=d,r?-l:l}addTimeFromDates(t,e,o=this.state.get("$data.chart.time")){if(!o.allDates||!o.allDates.length||!o.allDates[o.level])return t+e;if(!e)return t;let a=this.getAllLevelDatesFromCache(o.level,o);const i=this.date(t);a=this.addMissingDates(a,i,o,!0);let s=this.findDateIndex(t,a),n=t-a[s].leftGlobal;n<0&&(n=0);let l=0;if(e>0){for(;l<e;){const t=a[s];if(l+=t.rightGlobal+1-t.leftGlobal,n&&(l-=n,n=0),l>=e)break;s++,a[s]||(a=this.addMissingDates(a,t.leftGlobalDate.add(1,o.period),o,!0))}return a[s].rightGlobal+1-(l-e)}for(;l>e;){let t=a[s];if(l-=n,n&&(n=0),l<=e)break;if(s--,s<0&&(a=this.addMissingDates(a,t.leftGlobalDate.subtract(1,o.period),o,!0),s=0),t=a[s],l-=t.rightGlobal+1-t.leftGlobal,l<=e)break}return a[s].leftGlobal+(-l+e)}getLeftViewDate(t=this.state.get("$data.chart.time")){if(!t.levels||!t.levels.length)return null;const e=t.levels[t.level];return e.length?e[0]:null}getRightViewDate(t=this.state.get("$data.chart.time")){if(!t.levels||!t.levels.length||!t.levels[t.level])return null;const e=t.levels[t.level];return e.length?e[e.length-1]:null}getLowerPeriod(t){switch(t){case"year":return"month";case"month":case"week":return"day";case"day":return"hour";case"hour":return"minute";case"minute":return"second";case"second":return"millisecond";default:return t}}getHigherPeriod(t){switch(t){case"month":return"year";case"week":case"day":return"month";case"hour":return"day";case"minute":return"hour";case"second":return"minute";case"millisecond":return"second";default:return t}}}
|
|
14
|
+
/**
|
|
15
|
+
* Gantt-Schedule-Timeline-Calendar IDApi
|
|
16
|
+
*
|
|
17
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
18
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
19
|
+
* @module gantt-schedule-timeline-calendar
|
|
20
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
21
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
22
|
+
* @version 3.37.5
|
|
23
|
+
* @released 2024-07-19
|
|
24
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
25
|
+
*/var D=new class{constructor(){this.GSTCID=this.GSTCID.bind(this),this.isGSTCID=this.isGSTCID.bind(this),this.sourceID=this.sourceID.bind(this)}GSTCID(t){return this.isGSTCID(t)?t:`gstcid-${t}`}isGSTCID(t){return String(t).startsWith("gstcid-")}sourceID(t){return this.isGSTCID(t)?t.substring(7):t}};
|
|
26
|
+
/**
|
|
27
|
+
* Gantt-Schedule-Timeline-Calendar Slots
|
|
28
|
+
*
|
|
29
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
30
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
31
|
+
* @module gantt-schedule-timeline-calendar
|
|
32
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
33
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
34
|
+
* @version 3.37.5
|
|
35
|
+
* @released 2024-07-19
|
|
36
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
37
|
+
*/class y extends a{constructor(t,e,o){super(e,o),this.subs=[],this.name=t,this.subs.push(e.state.subscribe(`config.slots.${t}`,this.setComponents,{queue:!0}))}destroy(){this.subs.forEach((t=>t())),super.destroy()}getName(){return this.name}}function P(t,e,o){return new y(t,e,o)}
|
|
38
|
+
/**
|
|
39
|
+
* Gantt-Schedule-Timeline-Calendar helpers
|
|
40
|
+
*
|
|
41
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
42
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
43
|
+
* @module gantt-schedule-timeline-calendar
|
|
44
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
45
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
46
|
+
* @version 3.37.5
|
|
47
|
+
* @released 2024-07-19
|
|
48
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
49
|
+
*/const x="gstc";function W(t,e=""){let o=`${x}__${t}`;return t===x&&(o=x),e?`${o} ${o}--${e.replace(":","-")}`:o}function C(t,e){let o=`${x}__${t}`;return t===x&&(o=x),`${o}--${e}`}
|
|
50
|
+
/**
|
|
51
|
+
* Api functions
|
|
52
|
+
*
|
|
53
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
54
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
55
|
+
* @module gantt-schedule-timeline-calendar
|
|
56
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
57
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
58
|
+
* @version 3.37.5
|
|
59
|
+
* @released 2024-07-19
|
|
60
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
61
|
+
*/let $=0;const I=new Map;function S(t){return I.get(t.apiId)}class M{constructor(t){this.apiId=0,this.name=x,this.debug=!1,this.plugins={},this.iconsCache={},this.unsubscribes=[],this.mutedMethods=new Set,this.mergeDeep=null,this.generateSlots=P,this.getClass=W,this.getId=C,this.GSTCID=D.GSTCID,this.isGSTCID=D.isGSTCID,this.sourceID=D.sourceID,this.allActions=[],this.keysToKeep=["id","parents","children","allChildren","parentId"],this.apiId=++$,I.set(this.apiId,{rowsDataWithParentsExpanded:[],rowsIdsWithParentsExpanded:[],rowsWithParentsExpanded:[],rowsWithParentsExpandedAsMap:new Map,rowsPositionsMap:{id:"",dataIndex:0,keys:[]},allRowsIds:[],allRowsAsArray:[],rowsWithParentsExpandedDataIndexMap:new Map,itemsAsArray:[],itemsDataAsArray:[]}),this.state=t,this.time=new v(this.state,this),this.unsubscribes.push(this.state.subscribe("config.debug",(t=>this.debug=t))),this.debug&&(window.state=t)}render(){return this.vido.update()}getListenerPosition(t){for(const e of this.state.getListeners().values())for(const o of e.listeners)if(o[1].fn===t)return o[0]}setVido(t){this.vido=t}clone(t){return this.mergeDeep({},t)}setMergeDeep(t){this.mergeDeep=t}log(...t){this.debug&&console.log.call(console,...t)}getInitializedPlugins(){return this.state.get("$data.initializedPlugins")}pluginInitialized(t){this.getInitializedPlugins().add(t)}pluginDestroyed(t){this.getInitializedPlugins().delete(t)}clearPluginsPositions(){this.getInitializedPlugins().clear()}isPluginInitialized(t){return this.getInitializedPlugins().has(t)}getPluginPosition(t){return[...this.getInitializedPlugins()].indexOf(t)}getPluginsPositions(){const t={};let e=0;for(const o of this.getInitializedPlugins())t[o]=e++;return t}isPluginInitializedBefore(t,e){return this.getPluginPosition(t)<this.getPluginPosition(e)}getActions(t){this.allActions.includes(t)||this.allActions.push(t);let e=this.state.get("config.actions."+t);return void 0===e&&(e=[]),e.slice()}isItemInViewport(t,e=void 0,o=void 0){if(!e||!o){const t=this.state.get("config.chart.time");e=t.leftGlobal,o=t.rightGlobal}return t.time.start<=o&&t.time.end>=e}getChildrenLinkedItemsIds(t,e,o=[]){const a=e[t];if(a.linkedWith&&a.linkedWith.length){o.includes(t)||o.push(t);for(const t of a.linkedWith){if(o.includes(t))continue;o.push(t);const a=e[t];a.linkedWith&&a.linkedWith.length&&this.getChildrenLinkedItemsIds(t,e,o)}}return o}collectAllLinkedItems(t,e){const o=Object.keys(t),a=Object.keys(e),i=o.filter((t=>!a.includes(t)));if(i.length)throw new Error(`Items with id [${i.join(", ")}] does not exists in "$data.chart.items". TIP: For performance reasons, state is mutable, so try not to modify items from the "state.get" method before you copy them (with "gstc.api.clone(items)" for example).`);for(const o in t){const a=t[o];e[a.id].linkedWith=a.linkedWith||[]}const s=new Map;for(const t in e){if(s.has(t))continue;const o=this.getChildrenLinkedItemsIds(t,e);e[t].linkedWith.splice(e[t].linkedWith.length,0,...o);const a=Array.from(new Set(e[t].linkedWith));e[t].linkedWith=a.filter((e=>e!==t)),s.set(t,!0);for(const t of a)e[t].linkedWith=a.filter((e=>e!==t)),s.set(t,!0)}}getChildrenDependantItemsIds(t,e,o=[]){if(t.dependant&&t.dependant.length)for(const a of t.dependant){if(o.includes(a))continue;o.push(a);const i=e[a];if(!i)throw new Error(`Dependant item not found [id:'${a}'] found in item [id:'${t.id}']`);i.dependant&&i.dependant.length&&this.getChildrenDependantItemsIds(i,e,o)}return o}calculateItemVerticalPosition(t,e=null,o=null,a=null){if(a||(a=this.getItem(t)),e||(e=this.getItemData(t)),o||(o=this.getRowData(a.rowId)),a.gap&&e||(this.prepareItem(a),e=this.getItemData(t)),!o)return e.position;const i=o.position.top+a.gap.top,s=e.position.rowTop+a.gap.top,n=this.getRowViewTop(o.id);let l=n+e.position.actualRowTop;return n===1/0?l=1/0:-1===n&&(l=-1),e.position.top=i,e.position.actualRowTop=s,e.position.viewTop=l,e.position}setItemDataOutOfView(t,e=this.state.get("$data.chart.time")){t.outOfView||(t.outOfView={left:!1,right:!1,whole:!1});const o=t.time.startDate.valueOf(),a=t.time.endDate.valueOf();return t.outOfView.left=o<e.leftGlobal||o>=e.rightGlobal,t.outOfView.right=a>e.rightGlobal||a<=e.leftGlobal,t.outOfView.whole=a<=e.leftGlobal||o>=e.rightGlobal,t}calculateItemHorizontalPosition(t,e=null,o=null,a=this.state.get("$data.chart.time"),i=null){if(i||(i=this.getItem(t)),e||(e=this.getItemData(t)),o||(o=this.getRowData(i.rowId)),!o)return e.position;if(this.state.get("$data.chart.allItemsOnTheLeftOrRight"))return;const s=e.time.startDate.valueOf()===i.time.start?e.time.startDate:this.time.date(i.time.start),n=e.time.endDate.valueOf()===i.time.end?e.time.endDate:this.time.date(i.time.end),l=this.time.getViewOffsetPxFromDates(s,!1,a),r=this.time.getViewOffsetPxFromDates(n.add(1,"ms"),!1,a);e.position.left=l,e.position.actualLeft=this.time.limitOffsetPxToView(l,a),e.position.right=r,e.position.actualRight=this.time.limitOffsetPxToView(r,a),e.width=r-l;let c=this.time.getViewOffsetPxFromDates(n,!1,a);c===r&&(c-=1/a.timePerPixel),e.timeWidth=c-l,e.actualWidth=e.position.actualRight-e.position.actualLeft;const d=this.state.get("config.chart.item.minWidth");return"number"==typeof d&&e.actualWidth<d&&(e.actualWidth=d),this.setItemDataOutOfView(e,a),e.position}calculateItemPosition(t,e=null,o=null,a=this.state.get("$data.chart.time"),i=null){return e||(e=this.state.get(`$data.chart.items.${t}`)),i||(i=this.state.get(`config.chart.items.${t}`)),o||(o=this.state.get(`$data.list.rows.${i.rowId}`)),this.calculateItemHorizontalPosition(t,e,o,a,i),this.calculateItemVerticalPosition(t,e,o,i),e.position}getItemPosition(t,e=null,o=null,a=this.state.get("$data.chart.time"),i=null){return i||(i=this.getItem(t)),e||(e=this.getItemData(t)),0===e.position.left&&0===e.position.right&&this.calculateItemPosition(t,e,o,a,i),e.position}getRow(t){return this.state.get(`config.list.rows.${t}`)}getRows(t){if(!t.length)return[];const e=this.getAllRows(),o=[];for(const a of t)e[a]&&o.push(e[a]);return o}getAllRows(){return this.state.get("config.list.rows")}getVisibleRowsId(){return this.state.get("$data.list.visibleRows")}getRowsData(){return this.state.get("$data.list.rows")}setRowsData(t){this.state.update("$data.list.rows",t)}getRowData(t){return this.state.get(`$data.list.rows.${t}`)}setRowData(t,e){this.state.update(`$data.list.rows.${t}`,e)}getItem(t){return this.state.get(`config.chart.items.${t}`)}getItems(t=[]){const e=[],o=this.getAllItems();for(const a of t)o[a]&&e.push(o[a]);return e}getAllItemsAsArray(){return S(this).itemsAsArray}getAllItemsDataAsArray(){return S(this).itemsDataAsArray}getAllItems(){return this.state.get("config.chart.items")}getItemData(t){return this.state.get(`$data.chart.items.${t}`)}getItemsData(){return this.state.get("$data.chart.items")}setItemData(t,e){this.state.update(`$data.chart.items.${t}`,(t=>{for(const o in e)t[o]=e[o];return t}))}setItemsData(t){this.state.update("$data.chart.items",t)}prepareDependantItems(t,e){return this.getChildrenDependantItemsIds(t,e).filter((e=>e!==t.id))}prepareItem(t,e=this.state.get("config.chart.item.height"),o=this.getItemsData(),a=this.getAllItems(),i=this.getAllRows()){let s=t.id;if(s=String(s),t.id=s,o[t.id]||(o[t.id]={id:t.id,actualHeight:0,outerHeight:0,time:null,position:{left:0,actualLeft:0,right:0,actualRight:0,rowTop:t.rowTop||0,actualRowTop:t.actualRowTop||0,top:0,viewTop:0},outOfView:{left:!1,right:!1,whole:!1},width:-1,actualWidth:-1,timeWidth:-1,detached:!1,linkedWith:[],dependant:this.getChildrenDependantItemsIds(t,a)}),t.time||console.error("There is something wrong with this item.",t),"number"!=typeof t.time.start||"number"!=typeof t.time.end)throw new Error('[gantt-schedule-timeline-calendar] Item "time.start" and "time.end" values should be a number (unix epoch milliseconds).');const n=t.rowId;if("string"!=typeof n)throw new Error('[gantt-schedule-timeline-calendar] Item "rowId" should be a string.');if(!n.startsWith("gstcid-"))throw new Error('[gantt-schedule-timeline-calendar] Item "rowId" should start with "gstcid-".');if(!i[n])throw new Error(`[gantt-schedule-timeline-calendar] Row for item "${t.id}" does not exists ("${n}"). TIP: Try updating the rows first to make sure the rows for the items exist.`);t.time.start=+t.time.start,t.time.end=+t.time.end,t.id=String(t.id);const l=this.state.get("config.chart.item");"number"!=typeof t.height&&(t.height=e),o[t.id].time={startDate:this.time.date(t.time.start),endDate:this.time.date(t.time.end)},o[t.id].actualHeight=t.height,void 0===t.overlap&&(t.overlap=l.overlap),"number"!=typeof t.top&&(t.top=0),t.gap||(t.gap={}),"number"!=typeof t.gap.top&&(t.gap.top=l.gap.top),"number"!=typeof t.gap.bottom&&(t.gap.bottom=l.gap.bottom),"number"!=typeof t.minWidth&&(t.minWidth=l.minWidth),o[t.id].outerHeight=o[t.id].actualHeight+t.gap.top+t.gap.bottom,o[t.id].position.actualRowTop=o[t.id].position.rowTop+t.gap.top}prepareItems(t){const e=this.state.get("config.chart.item.height"),o=this.getItemsData(),a=S(this);a.itemsAsArray.length=0,a.itemsDataAsArray.length=0;for(const i in t){const s=t[i];this.prepareItem(s,e,o,t),a.itemsAsArray.push(t[i]),a.itemsDataAsArray.push(o[i])}return this.collectAllLinkedItems(t,o),t}sortRowsByChildren(t,e={},o=this.state.get("config.list.rows"),a=this.state.get("$data.list.rows")){for(const i of t){const t=o[i],s=a[i],n=t.parentId&&e[t.parentId]||!t.parentId;!e[i]&&n&&(e[i]=t),s.children.length&&this.sortRowsByChildren(s.children,e,o,a)}return e}getSortableValue(t,e){return"string"==typeof t?e[t]:"function"==typeof t?t({row:e,vido:this.vido}):""}sortRowsByColumn(t,e=!0){const o=this.state.get("config.list.sort.compare");let a=this.getAllRows();const i=S(this);if(0===i.allRowsIds.length)return a;const s=i.allRowsAsArray;o?s.sort(o(t)):s.sort(((o,a)=>{const i=this.getSortableValue(t.sortable,o),s=this.getSortableValue(t.sortable,a);return"number"==typeof i?e?i-s:s-i:"string"==typeof i?e?i.localeCompare(s):s.localeCompare(i):void 0}));const n=s.map((t=>t.id)),l=this.getRowsData();for(const t of n){const e=l[t];e.children&&e.children.length&&e.children.sort(((t,e)=>n.indexOf(t)-n.indexOf(e)))}a=this.sortRowsByChildren(n),this.state.update("config.list.rows",a,{data:"sortRowsByColumn"});const r=this.getScrollTop();return this.state.get("config.scroll.vertical.byPixels")?this.setScrollTop(r.absolutePosPx):this.setScrollTop(r.dataIndex,r.preciseOffset),a}fillEmptyRowValues(t){const e=this.state.get("config.list.row.height"),o=this.getRowsData();let a=0;for(let i in t){const s=t[i];let n=o[i];if(i=String(i),s.id=i,"string"!=typeof i)throw new Error('[gantt-schedule-timeline-calendar] Row "id" must be a string.');if(!i.startsWith("gstcid-"))throw new Error(`[gantt-schedule-timeline-calendar] Row "id" should start with "gstcid-" (your row id: "${i}").`);if(i.startsWith("gstcid-gstcid-"))throw new Error(`[gantt-schedule-timeline-calendar] Your row "id" is wrapped more than once. It should look like this "gstcid-something" and it looks like this: "${i}".`);o[i]||(n={id:s.id,parentId:s.parentId,parents:[],children:[],allChildren:[],position:{top:0,bottom:0},items:[],itemsOrder:[],actualHeight:0,outerHeight:0,parentsExpanded:!0,inView:!0}),"number"!=typeof s.height&&(s.height=e),n.actualHeight=s.height,"boolean"!=typeof s.expanded&&(s.expanded=!1),n.position.top=a,"object"!=typeof s.gap&&(s.gap={}),"number"!=typeof s.gap.top&&(s.gap.top=0),"number"!=typeof s.gap.bottom&&(s.gap.bottom=0),void 0===s.visible&&(s.visible=!0),n.outerHeight=n.actualHeight+s.gap.top+s.gap.bottom,o[i]=n,a+=n.outerHeight}return t}itemsOnTheSameLevel(t,e){const o=this.getItemData(t.id),a=this.getItemData(e.id),i=o.position.rowTop+o.outerHeight,s=a.position.rowTop+a.outerHeight;return a.position.rowTop<=o.position.rowTop&&s>o.position.rowTop||(a.position.rowTop>=o.position.rowTop&&a.position.rowTop<i||a.position.rowTop>=o.position.rowTop&&s<i)}itemsTimeOverlaps(t,e){return e.time.start>=t.time.start&&e.time.start<=t.time.end||(e.time.end>=t.time.start&&e.time.end<=t.time.end||(e.time.start>=t.time.start&&e.time.end<=t.time.end||e.time.start<=t.time.start&&e.time.end>=t.time.end))}itemOverlapsWithOthers(t,e){for(let o=0,a=e.length;o<a;o++){const a=e[o],i=a.time.start&&t.time.start&&a.time.end&&t.time.end;if(t.id!==a.id&&this.itemsOnTheSameLevel(t,a)&&this.itemsTimeOverlaps(t,a)&&i)return a}return null}fixOverlappedItems(t){if(this.isMutedMethod("fixOverlapped"))return;if(0===t.length)return;const e=this.getItemsData();for(const o of t){if(o.overlap)continue;const t=e[o.id];t&&(t.position.rowTop=o.top)}for(let o=0;o<t.length;o++){const a=t[o];if(a.overlap)continue;const i=e[a.id];if(!i)continue;i.position.actualRowTop=i.position.rowTop+a.gap.top;let s=this.itemOverlapsWithOthers(a,t);if(s)for(;s=this.itemOverlapsWithOthers(a,t);){const e=this.getItemData(s.id),n=t.findIndex((t=>t.id===s.id));n<o?(i.position.rowTop+=e.outerHeight,i.position.actualRowTop=i.position.rowTop+a.gap.top):(e.position.rowTop+=i.outerHeight,e.position.actualRowTop=e.position.rowTop+s.gap.top)}}}makeChildren(t,e={parents:[]}){if("object"!=typeof t)return[];t.children||(t.children=[]),t.allChildren||(t.allChildren=[]),t.parents||(t.parents=[...e.parents]),t.parentId&&"undefined"!==t.parentId&&t.parents.push(t.parentId);for(const e in t)if("id"!==e&&"parentId"!==e&&"children"!==e&&"allChildren"!==e&&"parents"!==e){"undefined"!==e&&(t.children.push(e),t.allChildren.push(e));const o=t[e];if("object"!=typeof o)continue;const a=this.makeChildren(o,t);t.allChildren.splice(t.allChildren.length,0,...a)}return t.allChildren}clearNested(t){for(const e in t)"object"!=typeof t[e]||Array.isArray(t[e])||this.clearNested(t[e]),this.keysToKeep.includes(e)||delete t[e],"parentId"===e&&"undefined"===t[e]&&(t[e]=void 0);return t}fastTree(t,e=null){var o,a;if(!e){e={undefined:{},id:"undefined"};for(const a in t){const i=t[a];e[i.id]||(e[i.id]={parentId:null!==(o=i.parentId)&&void 0!==o?o:"undefined",id:i.id})}}for(const t in e){const o=e[t];e[null!==(a=o.parentId)&&void 0!==a?a:"undefined"][o.id]=o}this.makeChildren(e[void 0]),delete e[void 0],delete e.id,delete e.parents,delete e.children,delete e.allChildren;for(const t in e)e[t]=this.clearNested(e[t]);return e}updateItemRowMapForItem(t,e,o=this.state.get("$data.itemRowMap"),a=this.state.get("$data.list.rows")){if(!a[e])return;a[e].items||(a[e].items=[]);const i=o[t];i&&a[i]&&(a[i].items=a[i].items.filter((e=>e!==t)).sort(((t,e)=>this.getItem(t).time.start-this.getItem(e).time.start))),o[t]=e,a[e].items.includes(t)||a[e].items.push(t)}sortRowItemsInAddOrder(t,e){e.itemsOrder=e.items.slice(),e.itemsOrder.sort(((e,o)=>t.indexOf(e)-t.indexOf(o)))}sortRowItemsByTime(t){t.items=t.items.sort(((t,e)=>this.getItem(t).time.start-this.getItem(e).time.start))}makeTreeMap(t,e,o=!1){let a=this.state.get("$data.treeMap");if(!o||!a){a=this.fastTree(t);for(const e in t){const o=t[e],i=a[e];for(const t in i)o[t]=i[t]}}const i=this.state.get("$data.reloading")?{}:this.state.get("$data.itemRowMap");for(const t in e){const o=e[t];this.updateItemRowMapForItem(t,o.rowId,i)}const s=Object.keys(this.state.get("config.chart.items"));for(const e in t){const o=t[e];this.sortRowItemsByTime(o),this.sortRowItemsInAddOrder(s,o)}return this.state.update("$data.itemRowMap",i),o||this.state.update("$data.treeMap",a),t}_updateRowsWithParentsExpandedCache(t){const e=S(this);e.rowsIdsWithParentsExpanded.length=0,e.rowsIdsWithParentsExpanded.splice(0,0,...t),e.rowsWithParentsExpanded.length=0,e.rowsDataWithParentsExpanded.length=0,e.rowsWithParentsExpandedDataIndexMap.clear();const o=this.state.get("config.list.rows"),a=this.state.get("$data.list.rows");e.rowsWithParentsExpandedAsMap.clear();let i=0;for(const t of e.rowsIdsWithParentsExpanded){const s=o[t];s&&(e.rowsWithParentsExpanded.push(s),e.rowsWithParentsExpandedAsMap.set(t,s),e.rowsDataWithParentsExpanded.push(a[t]),e.rowsWithParentsExpandedDataIndexMap.set(t,i),i++)}}generateRowsWithParentsExpanded(t){const e=[],o=this.getRowsData();t:for(const a in t){if(!o[a]||!o[a].parents)return[];if(this.isRowVisible(a)){for(const e of o[a].parents){const o=t[e];if(!o||!o.expanded)continue t}e.push(a)}}return this._updateRowsWithParentsExpandedCache(e),e}getRowInfoFromTop(t){const e=this.state.get("config.list.rows"),o=this.state.get("$data.list.rows"),a=this.getRowPositionMapNode(t);return{dataIndex:a.dataIndex,row:e[a.id],rowData:o[a.id]}}getRowViewTop(t,e=this.state.get("$data.list.rows"),o=this.state.get("$data.scroll.vertical")){return e[t].position.top-o.absolutePosPx-o.preciseOffset}parentsExpanded(t){return S(this).rowsWithParentsExpandedAsMap.has(t)}setAllRowsIdsCache(t){const e=S(this);e.allRowsIds=t;const o=this.state.get("config.list.rows");e.allRowsAsArray.length=0;for(const a of t)e.allRowsAsArray.push(o[a])}recalculateRowHeight(t,e){if(!e||!t||!t.gap)return 0;let o=0;const a=this.getItemsData();if(!a)return 0;if(!1===t.visible)return e.actualHeight=0,e.outerHeight=0,0;const i=this.getItems(e.itemsOrder);this.fixOverlappedItems(i);for(const t of i){const e=a[t.id];o=Math.max(o,e.position.rowTop+e.outerHeight)}return o<t.height&&(o=t.height),e.actualHeight=o,e.outerHeight=e.actualHeight+t.gap.top+t.gap.bottom,e.outerHeight}calculateVisibleRowsHeights(){if(this.isMutedMethod("calculateVisibleRowsHeights"))return;const t=this.state.get("$data.list.visibleRows");let e=0;const o=this.getAllRows(),a=this.getRowsData();for(const i of t)e+=this.recalculateRowHeight(o[i],a[i]);this.state.update("$data.list.visibleRowsHeight",e)}getRealChartHeight(t=!0){const e=this.state.get("$data.scroll.vertical.preciseOffset")||0,o=t?this.state.get("config.innerHeight"):this.state.get("$data.chart.dimensions.heightWithoutScrollBar"),a=this.state.get("config.additionalSpace");return o-a.top-a.bottom+-1*e}getLastRowId(t=S(this).rowsIdsWithParentsExpanded,e=this.state.get("$data.scroll.vertical")){return t[this.getLastRowIndex(t,e)]}getLastRowIndex(t=S(this).rowsIdsWithParentsExpanded,e=this.state.get("$data.scroll.vertical")){return t.length-e.lastPageCount}generateRowsPositionsMap(t,e=0,o={id:"",dataIndex:0,keys:[]}){if(0===t.length)return o;if(1===t.length)return o[t[0].position.top]={id:t[0].id,dataIndex:e,keys:[]},o.keys=[t[0].position.top],o;const a=Math.floor(t.length/2),i=e,s=e+a,n=t.slice(1,a),l=t.slice(a+1);o.keys.push(t[0].position.top),o.keys.push(t[a].position.top);const r=o[t[0].position.top]={id:t[0].id,dataIndex:i,keys:[]},c=o[t[a].position.top]={id:t[a].id,dataIndex:s,keys:[]};return this.generateRowsPositionsMap(n,i+1,r),this.generateRowsPositionsMap(l,s+1,c),o}getRowPositionMapNode(t,e=S(this).rowsPositionsMap){return t>=e.keys[1]?this.getRowPositionMapNode(t,e[e.keys[1]]):t>=e.keys[0]?this.getRowPositionMapNode(t,e[e.keys[0]]):e}measureRows(){if(this.isMutedMethod("measureRows"))return;const t=this.state.get("$data.scroll.vertical"),e=this.state.get("config.list.rows"),o=this.getRealChartHeight(),a=this.getRowsData(),i=S(this);if(void 0===t.dataIndex)return[];const s=this.state.get("$data.list.rowsIds");let n=0;if(t.data&&(n=i.rowsWithParentsExpandedDataIndexMap.get(t.data.id),-1===n)){const e=this.getLastRowId(i.rowsIdsWithParentsExpanded,t);n=i.rowsWithParentsExpandedDataIndexMap.get(e)}let l=0,r=0,c=0;for(let d=s.length;c<d;c++){const d=s[c],h=i.rowsWithParentsExpandedAsMap.has(d),u=this.getRowViewTop(d,a,t),m=c>=n&&u<=o,g=a[d];if(!g)return[];this.recalculateRowHeight(e[d],g),g.inView=m,g.parentsExpanded=h,g.position.top=l,r=l+g.outerHeight,g.position.bottom=r,h&&(l+=g.outerHeight)}return i.rowsPositionsMap=this.generateRowsPositionsMap(i.rowsDataWithParentsExpanded),this.state.update("$data.list.rows",a),this.state.update("$data.list.rowsHeight",r),this.state.update("$data.scroll.vertical.absoluteSize",r),r}isRowVisible(t,e=this.getAllRows(),o=this.getRowsData()){if(!e[t])return!1;if(!1===e[t].visible)return!1;if(!o[t])return!1;const a=o[t].parents;for(const t of a)if(!e[t]||!1===e[t].visible)return!1;return!0}getVisibleRows(){const t=this.state.get("$data.scroll.vertical"),e=S(this),o=e.rowsIdsWithParentsExpanded,a=this.getRowsData();if(!t.data)return[];const i=this.getRealChartHeight();if(!i)return[];let s=e.rowsWithParentsExpandedDataIndexMap.get(t.data.id);-1!==s&&void 0!==s||(s=t.dataIndex>e.rowsDataWithParentsExpanded.length-1?o.length-t.lastPageCount:t.dataIndex);const n=[];let l,r;for(let e=s,c=o.length;e<c;e++){const s=o[e];if(a[s]&&(r=a[s],l=this.getRowViewTop(s,a,t),l>=0&&l<=i?(n.push(s),r.parentsExpanded=!0):r.parentsExpanded=!1,l>i))break}return n}normalizeMouseWheelEvent(t){let e=t.deltaX||0,o=t.deltaY||0,a=t.deltaZ||0;const i=t.deltaMode,s=this.state.get("config.list.rowHeight");let n=1;switch(i){case 1:s&&(n=s);break;case 2:n=window.height}return e*=n,o*=n,a*=n,{x:e,y:o,z:a,event:t}}resetHorizontalScroll(t=this.state.get("$data.scroll.horizontal")){t.data=null,t.dataId="",t.dataIndex=0,t.handlePosPx=0,t.absolutePosPx=0,t.preciseOffset=0;const e=this.state.get("$data.chart.time");if(!e.allDates||!e.allDates.length)return;const o=e.allDates[e.level];if(!o||!o.length)return;const a=o[0];return t.data=Object.assign({},a),t.dataId=a.id,t}resetVerticalScroll(t=this.state.get("$data.scroll.vertical")){return t.data=null,t.dataId="",t.dataIndex=0,t.handlePosPx=0,t.absolutePosPx=0,t.preciseOffset=0,t.data=null,t.dataId=null,t}limitHorizontalScrollToView(t=this.state.get("$data.chart.time")){const e=this.state.get("$data.scroll.horizontal");if(!t.allDates||!t.allDates.length)return;const o=t.allDates[t.level].length-e.lastPageCount;e.dataIndex>o&&this.setScrollLeft(o,0,t)}calculateHorizontalScrollPosPxFromDates(t,e=0,o=this.state.get("$data.scroll.horizontal"),a=this.state.get("$data.chart.time")){if(a.calculatedZoomMode)return 0;if(void 0===t&&(t=0),!a.allDates||!a.allDates.length)return;const i=a.allDates[a.level];if(!i||!i.length)return;let s,n=0,l=0;if("number"==typeof t||""===t){""===t&&(t=0),l=t,s=i[l],s||(l=0,s=i[l]);const e=a.allDates[a.level].length-o.lastPageCount;l>e&&e>=0&&(l=e,s=i[l])}else if("string"==typeof t)for(let e=0;e<i.length;e++){const o=i[e];if(o.id===t){s=o,l=e;break}}if(!s&&o.data)for(let t=0;t<i.length;t++){const e=i[t];if(e.leftGlobal>=o.data.leftGlobal){s=e,l=t;break}}if(s||(l>0?(l=i.length-1,s=i[l]):(s=i[0],l=0)),l>i.length-o.lastPageCount&&(l=i.length-o.lastPageCount,s=i[l]),o.data=Object.assign({},s),n=s.leftPx-e,o.dataIndex=l,o.dataId=s.id,n){const t=n/o.absoluteSizeWithoutLastPage*o.maxHandlePosPx;o.handlePosPx=Math.max(t,0)}else o.handlePosPx=0;return o.handlePosPx>o.maxHandlePosPx&&(o.handlePosPx=Math.max(o.maxHandlePosPx,0)),o.preciseOffset=e,o.maxHandlePosPx>0?o.percent=o.handlePosPx/o.maxHandlePosPx*100:o.percent=0,o.absolutePosPx=Math.max(n,0),o}setScrollLeftByPixels(t){const e=this.state.get("$data.chart.time"),o=e.allDates[e.level];return o&&o.length?(t<0&&(t=0),this.state.update("$data.scroll.horizontal",(a=>{t>a.absoluteSizeWithoutLastPage&&(t=a.absoluteSizeWithoutLastPage);let i=0;const s=Math.round(t);let n;for(n of o){if(Math.round(n.rightPx)>s)break;i++}return a.dataIndex=i,a.dataId=n.id,a.preciseOffset=n.leftPx-t,this.calculateHorizontalScrollSizeAndPosFromDates(e.totalViewDurationPx,e,a,!1),t=a.absolutePosPx,a}),{data:"set-scroll-left"}),t):0}setScrollLeft(t,e=0,o=this.state.get("$data.chart.time")){if(o.calculatedZoomMode)return 0;if(this.state.get("config.scroll.horizontal.byPixels")){if("number"!=typeof t)throw new Error("When 'config.scroll.horizontal.byPixels' is true, 'dataIndexOrDateId' must be a number.");return t<0&&(t=0),this.setScrollLeftByPixels(t)}let a=0;const i=o.allDates[o.level];return i&&i.length?(this.state.update("$data.scroll.horizontal",(s=>{let n,l;if("number"==typeof t||""===t)n=t,l=i[n];else if("string"==typeof t)for(let e=0;e<i.length;e++)if(i[e].id===t){l=i[e],n=e;break}return l||(n>0?(n=i.length-1,l=i[n]):(n=0,l=i[0])),s.dataIndex=n,s.dataId=l.id,s.preciseOffset=e,this.calculateHorizontalScrollSizeAndPosFromDates(o.totalViewDurationPx,o,s,!1),a=s.absolutePosPx,s}),{data:"set-scroll-left"}),a):0}scrollToTime(t,e=!0){const o=this.state.get("$data.chart.time");if(o.calculatedZoomMode)return 0;if(!o.allDates)return 0;const a=this.time.findDateAtTime(t,o.allDates[o.level]);if(!a)return console.warn(`[gstc.api.scrollToTime] Time out of bounds (${t} -> ${this.time.date(t).format("YYYY-MM-DD HH:mm:ss")}).`),0;let i,s=0,n=0;if(e){const e=this.getChartWidth(!0)/2;n=(t-a.leftGlobal)/o.timePerPixel,a.rightPx<e&&(n=0);const l=-(e-n);if(i=this.time.getMainDateFromRelativePosition(a,l),!i)return console.warn(`[gstc.api.scrollToTime] Time out of bounds (${t} -> ${this.time.date(t).format("YYYY-MM-DD HH:mm:ss")}).`),0;s=o.allDates[o.level].indexOf(i)}else s=o.allDates[o.level].indexOf(a),n=(t-a.leftGlobal)/o.timePerPixel,i=a;if(-1===s)return 0;return this.state.get("config.scroll.horizontal").byPixels?this.setScrollLeft(i.leftPx+(e?i.width/2:0)):this.setScrollLeft(s,-n)}getScrollLeft(){return this.state.get("$data.scroll.horizontal")}getScrollSize(t){const e=this.state.get("$data.scroll.vertical.visible")?this.state.get("$data.chart.dimensions.widthWithoutScrollBar"):this.state.get("$data.chart.dimensions.width"),o=this.state.get("$data.scroll.horizontal.visible")?this.state.get("$data.chart.dimensions.heightWithoutScrollBar"):this.state.get("$data.chart.dimensions.innerHeight"),a=this.state.get("config.additionalSpace");return"horizontal"===t?e:o-a.top-a.bottom}getLastPageDatesWidth(t,e){let o=0,a=0;if(0===e.length)return{lastPageSize:o,lastPageCount:a};const i=this.state.get("config.scroll.horizontal"),s=i.byPixels||i.precise;for(let i=e.length-1;i>=0;i--){const s=e[i];if(o+=s.width,o>=t){o-=s.width;break}a++}return 0===o&&(o=t),s&&(o=t),{lastPageSize:o,lastPageCount:a}}calculateInitialChartWidth(t=!1){const e=this.state.get("config.initialWidth"),o=this.state.get("config.list.columns.data");let a=0;for(const t in o){a+=o[t].width}let i=e-a;return t&&(i-=this.state.get("config.scroll.horizontal.width")||0),i}getChartWidth(t=!1){let e=t?this.state.get("$data.chart.dimensions.widthWithoutScrollBar"):this.state.get("$data.chart.dimensions.width");return e||(e=this.calculateInitialChartWidth(t)),e}isHorizontalScrollVisible(t){const e=this.state.get("$data.scroll.horizontal");if(null!==e.data)return e.visible;const o=this.state.get("config.scroll.horizontal"),a=this.state.get("$data.chart.time"),i=a.totalViewDurationPx,s=this.getChartWidth(t),n=a.allDates[a.level];if(!n||!n.length)return!1;const{lastPageSize:l,lastPageCount:r}=this.getLastPageDatesWidth(s,n),c=this.getScrollSize("horizontal");let d=l/i*c;d<o.minInnerSize&&(d=o.minInnerSize);return!(r===n.length||c===d)}calculateHorizontalScrollSizeAndPosFromDates(t,e=this.state.get("$data.chart.time"),o=this.state.get("$data.scroll.horizontal"),a=!0){if(!e.allDates.length)return;const i=e.allDates[e.level],s=this.state.get("$data.scroll.vertical.visible"),n=this.getChartWidth(s),l=t,{lastPageSize:r,lastPageCount:c}=this.getLastPageDatesWidth(n,i),d=l-r,h=this.state.get("config.scroll.horizontal"),u=this.getScrollSize("horizontal");let m=r/l*u;m<h.minInnerSize&&(m=h.minInnerSize);const g=o.visible,f=!(c===i.length||u===m),p=Math.max(u?u-m:0,0);return o.absoluteSize=l,o.absoluteSizeWithoutLastPage=Math.max(d,0),o.innerHandleSize=m,o.maxHandlePosPx=p,o.scrollSize=f?u:0,o.lastPageCount=c,o.lastPageSize=r,o.visible=f,this.calculateHorizontalScrollPosPxFromDates(o.dataId,o.preciseOffset,o,e),a&&this.state.update("$data.scroll.horizontal",o),g!==f&&this.calculateVerticalScrollSize(),o}getLastPageRowsHeight(t,e){let o=0,a=0;const i=this.state.get("config.additionalSpace"),s=t-i.top-i.bottom;if(0===e.length)return{lastPageSize:o,lastPageCount:a};const n=this.getRowsData();for(let t=e.length-1;t>=0;t--){const i=n[e[t]];if(o+=i.outerHeight,o>=s){o-=i.outerHeight;break}a++}0===o&&(o=t);const l=this.state.get("config.scroll.vertical");return(l.byPixels||l.precise)&&(o=t),{lastPageSize:o,lastPageCount:a}}calculateVerticalScrollSize(){const t=this.state.get("$data.list.rowsWithParentsExpanded"),e=this.state.get("$data.list.rowsHeight"),o=this.isHorizontalScrollVisible(!0)?this.state.get("$data.chart.dimensions.heightWithoutScrollBar"):this.state.get("$data.chart.dimensions.innerHeight"),{lastPageSize:a,lastPageCount:i}=this.getLastPageRowsHeight(o,t),s=this.state.get("config.scroll.vertical"),n=o;let l=a/e*n;l<s.minInnerSize&&(l=s.minInnerSize);const r=!(i===t.length||n===l),c=n-l;this.state.update("$data.scroll.vertical",(o=>{if(o.absoluteSize=e,o.absoluteSizeWithoutLastPage=e-a,o.innerHandleSize=l,o.maxHandlePosPx=c,o.scrollSize=r?n:0,o.lastPageCount=i,o.lastPageSize=a,o.handlePosPx>c&&(o.handlePosPx=c),o.dataIndex>t.length-i){const e=this.getAllRows(),a=this.getRowsData();o.dataIndex=t.length-i;const s=t[o.dataIndex];e&&s?(o.data=e[s],o.dataId=o.data.id,o.absolutePosPx=a[s].position.top):(o.dataIndex=0,o.dataId="",o.data=null,o.handlePosPx=0,o.absolutePosPx=0),o.preciseOffset=0}else{const e=this.getRowsData(),a=t[o.dataIndex];e[a]&&(o.data=e[a],o.dataId=a,o.absolutePosPx=o.data.position.top-o.preciseOffset)}return o.visible=r,o}))}setScrollTopByPixels(t){const e=S(this),o=this.state.get("$data.scroll.vertical.absoluteSizeWithoutLastPage");t>o&&(t=o);let{dataIndex:a,row:i,rowData:s}=this.getRowInfoFromTop(t);if(!s)return;const n=s.position.top-t;return this.state.update("$data.scroll.vertical",(o=>{const l=e.rowsWithParentsExpanded.length-o.lastPageCount;if(a>l){if(a=l,i=e.rowsWithParentsExpanded[a],!i&&(a=0,i=e.rowsWithParentsExpanded[a],!i))return t=0,this.resetVerticalScroll(o);s=this.getRowData(i.id)}return o.data=e.rowsWithParentsExpanded[a],o.dataId=o.data.id,o.preciseOffset=n,o.handlePosPx=t?Math.round(t/o.absoluteSizeWithoutLastPage*o.maxHandlePosPx):0,o.handlePosPx>o.maxHandlePosPx&&(o.handlePosPx=o.maxHandlePosPx),o.percent=o.handlePosPx/o.maxHandlePosPx*100,o.dataIndex=a,o.absolutePosPx=t,o}),{data:"set-scroll-top"}),t}setScrollTop(t=0,e=0){if(this.state.get("config.scroll.vertical.byPixels")){if("number"!=typeof t)throw new Error("When 'config.scroll.vertical.byPixels' is true, 'dataIndexOrRowId' must be a number.");return t<0&&(t=0),this.setScrollTopByPixels(t)}const o=S(this),a=o.rowsIdsWithParentsExpanded;let i,s,n=0;if("string"==typeof t){const e=t;if(i=this.getRow(e),s=this.getRowData(i.id),this.parentsExpanded(e))n=a.indexOf(e);else for(const t of s.parents)this.parentsExpanded(t)&&(n=a.indexOf(t));if(!i)throw new Error(`Row with id: '${e}' not found. Maybe use GSTC.api.GSTCID(id) or check if row exists.`)}else{if("number"!=typeof t)throw new Error("[gstc.api.setScrollTop] Wrong dataIndex value. Must be `string` (for `rowId`) or `number` (for array index) only.");if(n=t,o.rowsWithParentsExpanded[n]||0===n||(n=0),!o.rowsWithParentsExpanded[n])return;i=o.rowsWithParentsExpanded[n],s=this.getRowData(i.id)}let l=0;return this.state.update("$data.scroll.vertical",(t=>{const a=o.rowsWithParentsExpanded.length-t.lastPageCount;if(n>a){if(n=a,i=o.rowsWithParentsExpanded[n],!i&&(n=0,i=o.rowsWithParentsExpanded[n],!i))return l=0,this.resetVerticalScroll(t);s=this.getRowData(i.id)}return l=s.position.top-e,t.data=o.rowsWithParentsExpanded[n],t.dataId=t.data.id,t.preciseOffset=e,t.handlePosPx=l?Math.round(l/t.absoluteSizeWithoutLastPage*t.maxHandlePosPx):0,t.handlePosPx>t.maxHandlePosPx&&(t.handlePosPx=t.maxHandlePosPx),t.percent=t.handlePosPx/t.maxHandlePosPx*100,t.dataIndex=n,t.absolutePosPx=l,t}),{data:"set-scroll-top"}),l}getScrollTop(){return this.state.get("$data.scroll.vertical")}getCurrentCalendarLevels(){return this.state.get("$data.chart.time.levels")}getGridCells(t=void 0){const e=this.state.get("$data.chart.grid.cells");if(!e)return[];if(void 0!==t){const o=t.length,a=new Array(o);for(let i=0;i<o;i++)a[i]=e[t[i]];return a}return Object.values(e)}getAllGridCells(){return this.state.get("$data.chart.grid.cells")}getGridRows(t=void 0){const e=this.state.get("$data.chart.grid.rows");return void 0!==t?e?Object.values(e).filter((e=>t.includes(e.row.id))):[]:e?Object.values(e):[]}getAllGridRows(){return this.state.get("$data.chart.grid.rows")}getGridCell(t){return this.state.get(`$data.chart.grid.cells.${t}`)}getGridRow(t){return this.state.get(`$data.chart.grid.rows.${t}`)}muteMethod(t){this.mutedMethods.add(t)}unmuteMethod(t){this.mutedMethods.delete(t)}isMutedMethod(t){return this.mutedMethods.has(t)}getSVGIconSrc(t){return"string"==typeof this.iconsCache[t]||(this.iconsCache[t]="data:image/svg+xml;base64,"+btoa(t)),this.iconsCache[t]}destroy(){for(const t of this.unsubscribes)t();this.unsubscribes=[],this.debug&&delete window.state}}
|
|
62
|
+
/**
|
|
63
|
+
* ScrollBar component
|
|
64
|
+
*
|
|
65
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
66
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
67
|
+
* @module gantt-schedule-timeline-calendar
|
|
68
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
69
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
70
|
+
* @version 3.37.5
|
|
71
|
+
* @released 2024-07-19
|
|
72
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
73
|
+
*/function k(t,e){const{onDestroy:o,state:a,cache:s,api:n,html:l,StyleMap:r,Actions:c,update:d}=t,h="scroll-bar";let u,m,g="",f="";o(a.subscribe("config.classNames",(()=>{u=n.getClass(h),m=n.getClass(h+"-inner")})));const p="horizontal"===e.type?"height":"width",w="height"===p?"width":"height",b="horizontal"===e.type?"left":"top",v=new r({}),D=new r({}),y={maxPosPx:0,innerHandleSize:0,scrollSize:0,dataId:""};o(a.subscribeAll("horizontal"===e.type?[`config.scroll.${e.type}`,`$data.scroll.${e.type}`]:[`config.scroll.${e.type}`,`$data.scroll.${e.type}`,"$data.chart.dimensions.heightWithoutScrollBar","$data.list.rowsWithParentsExpanded","$data.list.rowsHeight","config.additionalSpace"],(function(t,o){const i=a.get(`config.scroll.${e.type}`),s=a.get(`$data.scroll.${e.type}`),l=n.getScrollSize(e.type),r=s.innerHandleSize,c=s.maxHandlePosPx,h=s.dataId,u=a.get("config.additionalSpace"),m=a.get("$data.chart.time");if(!m.allDates||!m.allDates.length||!m.allDates[m.level])return;if(s.visible?v.style.display="flex":v.style.display="none",v.style[p]=i.width+"px",v.style[w]=l+"px","vertical"===e.type&&(v.style.top=a.get("config.headerHeight")+u.top+"px"),!s.lastPageSize||!s.absoluteSize||!l)return;D.style[p]="100%",D.style[w]=r+"px";!("set-scroll-top"===o.options.data||"set-scroll-left"===o.options.data)&&function(t,e,o,a){const i=y.maxPosPx!==t||y.innerHandleSize!==e||y.scrollSize!==o||y.dataId!==a;return i&&(y.maxPosPx=t,y.innerHandleSize=e,y.scrollSize=o,y.dataId=a),i}(c,r,l,h)&&("horizontal"===e.type?i.byPixels?n.setScrollLeft(s.absolutePosPx):n.setScrollLeft(s.dataIndex,s.preciseOffset):i.byPixels?n.setScrollTop(s.absolutePosPx):n.setScrollTop(s.dataIndex,s.preciseOffset)),d()}),{group:!0,bulkValue:!1}));const P=n.getActions(h);P.push(class extends i{constructor(t){super();const o=`$data.elements.scroll-bar--${e.type}`;a.get(o)||a.update(o,t,{only:null})}update(){}destroy(){}});const x={api:n,state:a,props:e,componentName:h},W=c.create(P,x),C=[class extends i{constructor(t){super(),this.moving=!1,this.initialPointerPos=0,this.initialHandlePos=0,this.currentPos=0,this.currentPointerPos=0,this.lastDataIndex=0,this.lastOffset=0,this.dataIndex=0,this.previousRowId="",a.update(`$data.elements.scroll-bar-inner--${e.type}`,t,{only:null}),this.bodyClassName=a.get("config.scroll.bodyClassName"),this.pointerDown=this.pointerDown.bind(this),this.pointerUp=this.pointerUp.bind(this);const o=this.pointerMove.bind(this);this.pointerMove=o,this.unsubscribe=a.subscribe(`$data.scroll.${e.type}`,this.dataChanged.bind(this)),this.destroy=this.destroy.bind(this),t.addEventListener("pointerdown",this.pointerDown),document.addEventListener("pointermove",this.pointerMove),document.addEventListener("pointerup",this.pointerUp)}destroy(t){this.unsubscribe(),t.removeEventListener("pointerdown",this.pointerDown),document.removeEventListener("pointermove",this.pointerMove),document.removeEventListener("pointerup",this.pointerUp)}dataChanged(){const t=a.get(`$data.scroll.${e.type}`),o=a.get("$data.chart.time");if(!o.allDates.length)return;const i=o.allDates[o.level],s=t.dataIndex;if(this.lastDataIndex=s,"horizontal"===e.type&&i&&i.length)this.currentPos=t.handlePosPx,D.style[b]=this.currentPos+"px",d();else if("vertical"===e.type){if(!a.get("$data.list.rowsWithParentsExpanded").length)return;this.currentPos=t.handlePosPx,D.style[b]=this.currentPos+"px",d()}}limitPosition(t){return Math.max(Math.min(t,a.get(`$data.scroll.${e.type}.maxHandlePosPx`)),0)}pointerDown(t){t.stopPropagation(),t.preventDefault(),n.muteMethod("calculateRowsHeight"),document.body.classList.add(this.bodyClassName),requestAnimationFrame((()=>{this.moving=!0,this.initialPointerPos="horizontal"===e.type?t.screenX:t.screenY,this.initialHandlePos=a.get(`$data.scroll.${e.type}.handlePosPx`),f=" "+n.getClass(h)+"-inner--active",g=" "+n.getClass(h)+"--active",d()}))}pointerUp(t){this.moving&&(n.unmuteMethod("calculateRowsHeight"),t.preventDefault(),t.stopPropagation(),document.body.classList.remove(this.bodyClassName)),this.moving=!1,f="",g="",d()}pointerMoveRead(t){this.currentPointerPos="horizontal"===e.type?t.screenX:t.screenY}pointerMoveWrite(){const t=a.get(`config.scroll.${e.type}`),o=a.get(`$data.scroll.${e.type}`),i=this.currentPointerPos-this.initialPointerPos;this.currentPos=this.limitPosition(this.initialHandlePos+i);const s=a.get("$data.chart.time");if(!s.allDates.length)return;const l=s.allDates[s.level],r=this.currentPos/o.maxHandlePosPx*o.absoluteSizeWithoutLastPage,c=Math.round(r);if("horizontal"===e.type){let e,o=0,a=0,i=0;for(let t=l.length;o<t&&(e=l[o],i=Math.round(e.rightPx),!(i>c));o++);t.precise&&i!==c&&(a=e.leftPx-r),o||(o=0),e||(e=l[0]),this.dataIndex=o,this.lastDate=l[o],t.byPixels?n.setScrollLeft(r):n.setScrollLeft(e.id,a),this.lastDataIndex=o,this.lastOffset=a}else{const{dataIndex:e,row:o,rowData:a}=n.getRowInfoFromTop(r);let i=0;t.precise&&a.position.top!==r&&(i=a.position.top-r),this.dataIndex=e,this.previousRowId=o.id,t.byPixels?n.setScrollTop(r):n.setScrollTop(e,i),this.lastDataIndex=e,this.lastOffset=i}}pointerMove(t){this.moving&&(t.stopPropagation(),t.preventDefault(),requestAnimationFrame((()=>{this.pointerMoveRead(t)})),requestAnimationFrame((()=>{this.pointerMoveWrite()})))}}],$=c.create(C,x),I=n.generateSlots(h,t,e);function S({classNameOuter:t,classNameOuterActive:e,classNameInner:o,classNameInnerActive:a,styleMapInner:i,styleMapOuter:s,innerActions:n,outerActions:l,slots:r,cache:c,html:d,vido:h,props:u}){return c(!u||!u.type?null:r.html("outer",d`
|
|
74
|
+
<div
|
|
75
|
+
data-actions=${l()}
|
|
76
|
+
class=${t+" "+t+"--"+u.type+e}
|
|
77
|
+
style=${s.directive()}
|
|
78
|
+
>
|
|
79
|
+
${r.html("inner",d`
|
|
80
|
+
<div
|
|
81
|
+
data-actions=${n()}
|
|
82
|
+
class=${o+" "+o+"--"+u.type+a}
|
|
83
|
+
style=${i.directive()}
|
|
84
|
+
>
|
|
85
|
+
${r.html("content")}
|
|
86
|
+
</div>
|
|
87
|
+
`)}
|
|
88
|
+
</div>
|
|
89
|
+
`))}let M=S;return o(a.subscribe(`config.templates.${h}`,(t=>{M=null!=t?t:S,d()}))),()=>M({innerActions:$,outerActions:W,classNameOuter:u,classNameOuterActive:g,classNameInner:m,classNameInnerActive:f,cache:s,styleMapInner:D,styleMapOuter:v,slots:I,html:l,vido:t,props:e})}
|
|
90
|
+
/**
|
|
91
|
+
* List component
|
|
92
|
+
*
|
|
93
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
94
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
95
|
+
* @module gantt-schedule-timeline-calendar
|
|
96
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
97
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
98
|
+
* @version 3.37.5
|
|
99
|
+
* @released 2024-07-19
|
|
100
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
101
|
+
*/function G(t,e={}){const{api:o,state:a,onDestroy:i,Actions:s,update:n,reuseComponents:l,html:r,StyleMap:c,cache:d}=t,h="list",u=o.getActions(h);let m,g;const f=Object.assign(Object.assign({},e),{list:m,percent:g,api:o,state:a,componentName:h});let p;const w=a.subscribe("config.components.ListColumn",(t=>p=t));!function(){const t=a.get("config.list.expander.icons"),e={};for(const a in t){const i=t[a];e[a]=o.getSVGIconSrc(i)}a.update("$data.list.expander.icons",e)}(),function(){const t={open:"",close:""},e=a.get("config.list.toggle.icons");for(const a in e){const i=e[a];t[a]=o.getSVGIconSrc(i)}a.update("$data.list.toggle.icons",t)}();const b=o.getClass(h),v=o.generateSlots(h,t,e);i(a.subscribe("config.list",(function(){m=a.get("config.list"),g=m.columns.percent,f.list=m,f.percent=g,n()})));const D=[];i(a.subscribe("config.list.columns.data",(function(t){const e=Object.values(t).filter((t=>!t.hidden)).sort(((t,e)=>"number"==typeof t.position&&"number"==typeof e.position?t.position-e.position:0));l(D,e,(t=>({column:t})),p,!0),n()})));const y=new c({height:"","--expander-padding-width":"","--expander-size":""});let P;function x(t){P||(P=t.offsetWidth,0===g&&(P=0),a.update("$data.list.width",P))}i(a.subscribeAll(["$data.height","config.list.expander"],(()=>{const t=a.get("config.list.expander");y.style.height=a.get("$data.height")+"px",y.style["--expander-padding-width"]=t.padding+"px",y.style["--expander-size"]=t.size+"px",n()}),{group:!0})),i((()=>{D.forEach((t=>t.destroy())),w()}));u.push(class{constructor(t,e){e.state.update("$data.elements.list",t),x(t)}update(t){return x(t)}});const W=s.create(u,f);function C({className:t,styleMap:e,list:o,listColumns:a,actions:i,slots:s,html:n,cache:l,vido:r,props:c}){return s.html("outer",l(o.columns.percent>0?n`
|
|
102
|
+
<div class=${t} data-actions=${i()} style=${e.directive()}>
|
|
103
|
+
${s.html("content",a.map((t=>t.html())))}
|
|
104
|
+
</div>
|
|
105
|
+
`:""))}let $=C;return i(a.subscribe(`config.templates.${h}`,(t=>{$=null!=t?t:C,n()}))),()=>$({list:m,className:b,actions:W,styleMap:y,listColumns:D,slots:v,cache:d,html:r,vido:t,props:e})}
|
|
106
|
+
/**
|
|
107
|
+
* ListColumn component
|
|
108
|
+
*
|
|
109
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
110
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
111
|
+
* @module gantt-schedule-timeline-calendar
|
|
112
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
113
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
114
|
+
* @version 3.37.5
|
|
115
|
+
* @released 2024-07-19
|
|
116
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
117
|
+
*/class L{constructor(t,e){let o=!1,a=e.state.get("$data.elements.list-columns");void 0===a&&(a=[],o=!0),a.includes(t)||(a.push(t),o=!0),o&&e.state.update("$data.elements.list-columns",a,{only:null})}destroy(t,e){e.state.update("$data.elements.list-columns",(e=>e.filter((e=>e!==t))),{only:null})}}function z(t,e){const{api:o,state:a,onDestroy:i,onChange:s,cache:n,Actions:l,update:r,createComponent:c,reuseComponents:d,html:h,StyleMap:u}=t,m=[];let g,f;m.push(a.subscribe("config.components.ListColumnRow",(t=>g=t))),m.push(a.subscribe("config.components.ListColumnHeader",(t=>f=t)));const p=Object.assign(Object.assign({},e),{api:o,state:a,componentName:"list-column"}),w={column:e.column,state:a,api:o,componentName:"list-column-headers"},b={api:o,state:a,componentName:"list-column-rows"},v="list-column",D=v+"-rows",y=v+"-rows-offset",P=o.getActions(v),x=o.getActions(D),W=o.getClass(v,e.column.id),C=o.getClass(y,e.column.id),$=o.getClass(D,e.column.id);let I,S=o.getId(v,e&&e.column?e.column.id:"");const M=new u({width:"","--width":""}),k=new u({height:""}),G=new u({"margin-top":"0px"});let z=a.get("config.additionalSpace");const O=o.generateSlots(v,t,e);let R;function T(){if(!e||!e.column)return;const t=a.get("config.list");if(!t.columns.data[e.column.id])return;I=t.columns.data[e.column.id].width*t.columns.percent*.01,R=I;const i=Math.round(o.getRealChartHeight());M.style.width=R+"px",M.style["--width"]=R+"px",G.style.height=i+"px",k.style.top=a.get("config.headerHeight")+z.top+"px"}i(a.subscribeAll(["config.list.columns.percent","config.list.columns.resizer.width","$data.chart.dimensions.width","$data.chart.dimensions.heightWithoutScrollBar","$data.list.width","$data.list.visibleRowsHeight","config.additionalSpace.top"],T,{group:!0}));const A=c(f,e);i(A.destroy);const _=[],N={};function H(){var t;if(!e||!e.column)return;a.mute(H);const i=a.get("$data.list.visibleRows")||[],s=o.getRows(i),n=o.getRowsData();for(const o of s){const a=N[o.id]=null!==(t=N[o.id])&&void 0!==t?t:{};a.column=e.column,a.row=o,a.rowData=n[o.id],a.width=R}for(const t in N)i.includes(t)||delete N[t];d(_,s,(t=>t&&N[t.id]),g,!0),O.change(e),a.unmute(H)}s((t=>{if((e=t)&&e.column&&e.column.id){S=o.getId(v,e&&e.column?e.column.id:"");for(const t in e)p[t]=e[t];T(),A.change(e),H()}})),i(a.subscribeAll(["$data.list.visibleRows","$data.list.visibleRowsHeight","$data.list.rows","config.list.rows","config.chart.items.*.height","config.chart.items.*.rowId","config.chart.items.*.time"],H,{group:!0,bulkValue:!1})),i(a.subscribe("$data.scroll.vertical.preciseOffset",(t=>{G.style.transform=`translateY(${Math.round(t)||0}px)`,r()}))),i(a.subscribe("config.additionalSpace",(t=>{z=t}))),i((()=>{_.forEach((t=>t.destroy())),m.forEach((t=>t()))})),P.push(L);const V=l.create(P,w),E=l.create(x,b);function B({className:t,classNameOffset:e,classNameContainer:o,containerStyleMap:a,offsetStyleMap:i,widthStyleMap:s,visibleRows:n,rowActions:l,elId:r,headerActions:c,ListColumnHeader:d,html:h,cache:u,vido:m,props:g}){return u(g&&g.column?O.html("outer",h`
|
|
118
|
+
<div
|
|
119
|
+
class=${t}
|
|
120
|
+
data-gstcid=${g.column.id}
|
|
121
|
+
data-actions=${c()}
|
|
122
|
+
style=${s.directive()}
|
|
123
|
+
>
|
|
124
|
+
${O.html("inner",h` ${d.html()}${O.html("container-outer",h`
|
|
125
|
+
<div
|
|
126
|
+
class=${o}
|
|
127
|
+
data-gstcid=${g.column.id}
|
|
128
|
+
data-actions=${l()}
|
|
129
|
+
style=${a.directive()}
|
|
130
|
+
>
|
|
131
|
+
${O.html("container-inner",h`
|
|
132
|
+
<div class=${e} data-gstcid=${g.column.id} style=${i.directive()}>
|
|
133
|
+
${O.html("content",n.map((t=>t.html())))}
|
|
134
|
+
</div>
|
|
135
|
+
`)}
|
|
136
|
+
</div>
|
|
137
|
+
`)} `)}
|
|
138
|
+
</div>
|
|
139
|
+
`):null)}let j=B;return i(a.subscribe(`config.templates.${v}`,(t=>{j=null!=t?t:B,r()}))),()=>j({classNameOffset:C,offsetStyleMap:G,visibleRows:_,classNameContainer:$,containerStyleMap:k,rowActions:E,className:W,elId:S,headerActions:V,widthStyleMap:M,ListColumnHeader:A,html:h,cache:n,vido:t,props:e})}
|
|
140
|
+
/**
|
|
141
|
+
* ListColumnHeader component
|
|
142
|
+
*
|
|
143
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
144
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
145
|
+
* @module gantt-schedule-timeline-calendar
|
|
146
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
147
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
148
|
+
* @version 3.37.5
|
|
149
|
+
* @released 2024-07-19
|
|
150
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
151
|
+
*/function O(t,e){const{api:o,state:a,onDestroy:i,cache:s,onChange:n,Actions:l,update:r,createComponent:c,html:d,StyleMap:h}=t,u="list-column-header",m=Object.assign(Object.assign({},e),{api:o,state:a,componentName:u}),g=o.getActions(u),f=[];let p;f.push(a.subscribe("config.components.ListColumnHeaderResizer",(t=>p=t)));const w=c(p,e);let b;f.push(a.subscribe("config.components.ListColumnRowExpander",(t=>b=t)));const v=c(b,e);i((()=>{w.destroy(),v.destroy(),f.forEach((t=>t()))}));const D=o.generateSlots(u,t,e),y=o.getClass(u),P=o.getClass(u+"-content");let x=o.getId(u,e.column.id);n((t=>{e=t;for(const t in e)m[t]=e[t];x=o.getId(u,e.column.id),w.change(e),v.change(e),D.change(t)}));const W=new h({height:"","--height":"","--paddings-count":""});i(a.subscribe("config.headerHeight",(()=>{const t=a.get("config");W.style.height=t.headerHeight+"px",W.style["--height"]=t.headerHeight+"px",W.style["--paddings-count"]="1",r()})));const C=l.create(g,m);function $({className:t,contentClass:e,styleMap:o,elId:a,cache:i,ListColumnRowExpander:s,ListColumnHeaderResizer:n,actions:l,slots:r,html:c,vido:d,props:h}){return i(!h||!h.column?null:r.html("outer",c`
|
|
152
|
+
<div
|
|
153
|
+
class=${t}
|
|
154
|
+
data-gstcid=${h.column.id}
|
|
155
|
+
style=${o.directive()}
|
|
156
|
+
data-actions=${l()}
|
|
157
|
+
>
|
|
158
|
+
${r.html("content",h.column.expander?c`
|
|
159
|
+
<div class=${e}>
|
|
160
|
+
${s.html(h.column)}${n.html(h.column)}
|
|
161
|
+
</div>
|
|
162
|
+
`:c` <div class=${e}>${n.html(h.column)}</div> `)}
|
|
163
|
+
</div>
|
|
164
|
+
`))}let I=$;return i(a.subscribe(`config.templates.${u}`,(t=>{I=null!=t?t:$,r()}))),()=>I({className:y,contentClass:P,cache:s,styleMap:W,elId:x,ListColumnRowExpander:v,ListColumnHeaderResizer:w,actions:C,slots:D,html:d,vido:t,props:e})}
|
|
165
|
+
/**
|
|
166
|
+
* ListColumnHeaderResizer component
|
|
167
|
+
*
|
|
168
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
169
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
170
|
+
* @module gantt-schedule-timeline-calendar
|
|
171
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
172
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
173
|
+
* @version 3.37.5
|
|
174
|
+
* @released 2024-07-19
|
|
175
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
176
|
+
*/function R(t,e){const{api:o,state:a,onDestroy:i,cache:s,update:n,html:l,Actions:r,onChange:c,PointerAction:d,StyleMap:h,unsafeHTML:u}=t,m="list-column-header-resizer",g=o.getActions(m),f=o.getActions(m+"-dots"),p={up:"",down:""};let w,b,v,D;i(a.subscribe("config.list.sort.icons",(t=>{p.up=o.getSVGIconSrc(t.up),p.down=o.getSVGIconSrc(t.down)}))),w=o.getClass(m),b=o.getClass(m+"-container"),v=o.getClass(m+"-dots"),D=o.getClass(m+"-dots-dot");const y=o.getClass(m+"-sort-icon");let P;const x=new h({});let W=!1;const C=o.generateSlots(m,t,e);let $=!0,I=0;const S={componentName:m,column:e.column,api:o,state:a,pointerOptions:{axis:"x",onMove:function({movementX:t,event:o}){if(!$)return;t&&(o.preventDefault(),o.stopPropagation());let i=a.get("config.list.columns.minWidth");"number"==typeof e.column.minWidth&&(i=e.column.minWidth),I+=t,I<i&&(I=i),W&&a.update(`config.list.columns.data.${e.column.id}.width`,I)}}};function M(){if(!e||!e.column||!e.column.id)return;S.column=e.column,w=o.getClass(m,e.column.id),b=o.getClass(m+"-container",e.column.id),v=o.getClass(m+"-dots",e.column.id),D=o.getClass(m+"-dots-dot",e.column.id),$=!("resizer"in e.column)||e.column.resizer;const t=a.get("config.list");P=I=e.column.width*t.columns.percent*.01,x.style["--width"]=t.columns.resizer.width+"px",W=t.columns.resizer.inRealTime,a.update("$data.list.width",P),C.change(e),n()}c((t=>{e=t,M()})),i(a.subscribeAll(["config.list.columns.percent","config.list.columns.resizer.width","config.list.columns.resizer.inRealTime"],M,{group:!0}));let k=[1,2,3,4,5,6,7,8];i(a.subscribe("config.list.columns.resizer.dots",(t=>{k=[];for(let e=0;e<t;e++)k.push(e);n()})));let G=!0;function L(){e.column.sortable&&(G=!G,a.update("config.list.sort",(t=>(t.activeColumnId=e.column.id,t.asc=G,t))))}let z=!1;i(a.subscribe("config.list.sort",(t=>{if(t.activeColumnId===e.column.id)return G=t.asc,void(z=!0);z=!1}))),f.push(d);const O=r.create(g,S),R=r.create(f,S);function T({className:t,containerClass:e,iconClass:o,dotsClass:a,dotClass:i,dotsStyleMap:s,dots:n,onLabelClick:l,dotsActions:r,resizer:c,icons:d,sortActive:h,cache:u,asc:m,actions:g,slots:f,html:p,unsafeHTML:w,vido:b,props:v}){const D=!v||!v.column;function y(){return v.column.sortable&&h?m?p` <img src="${d.down}" class=${o} /> `:p` <img src="${d.up}" class=${o} /> `:null}function P(){return D?null:"function"==typeof v.column.header.content?v.column.header.content({column:v.column,vido:b}):v.column.header.content}return u(D?null:f.html("outer",p`
|
|
177
|
+
<div class=${t} data-gstcid=${v.column.id} data-actions=${g()}>
|
|
178
|
+
${f.html("container-outer",c?D?null:p`
|
|
179
|
+
<div class=${e} @click=${l}>
|
|
180
|
+
${f.html("content",v.column.header.html?w(v.column.header.html):P())}
|
|
181
|
+
${y()}
|
|
182
|
+
</div>
|
|
183
|
+
<div class=${a} style=${s.directive()} data-actions=${r()}>
|
|
184
|
+
${n.map((()=>p` <div class=${i} /> `))}
|
|
185
|
+
</div>
|
|
186
|
+
`:D?null:p`
|
|
187
|
+
<div class=${e} @click=${l}>
|
|
188
|
+
${f.html("content",v.column.header.html?w(v.column.header.html):P())}
|
|
189
|
+
${y()}
|
|
190
|
+
</div>
|
|
191
|
+
`)}
|
|
192
|
+
</div>
|
|
193
|
+
`))}let A=T;return i(a.subscribe(`config.templates.${m}`,(t=>{A=null!=t?t:T,n()}))),()=>A({className:w,containerClass:b,onLabelClick:L,iconClass:y,cache:s,dotsClass:v,dotsStyleMap:x,dotsActions:R,dots:k,dotClass:D,resizer:$,icons:p,sortActive:z,asc:G,actions:O,slots:C,html:l,unsafeHTML:u,vido:t,props:e})}
|
|
194
|
+
/**
|
|
195
|
+
* ListColumnRow component
|
|
196
|
+
*
|
|
197
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
198
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
199
|
+
* @module gantt-schedule-timeline-calendar
|
|
200
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
201
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
202
|
+
* @version 3.37.5
|
|
203
|
+
* @released 2024-07-19
|
|
204
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
205
|
+
*/class T{constructor(t,e){let o=e.state.get("$data.elements.list-column-rows"),a=!1;void 0===o&&(a=!0,o=[]),o.includes(t)||(o.push(t),a=!0),a&&e.state.update("$data.elements.list-column-rows",o,{only:null})}destroy(t,e){e.state.update("$data.elements.list-column-rows",(e=>e.filter((e=>e!==t))),{only:null})}}function A(t,e){const{api:o,state:a,onDestroy:i,cache:s,Actions:n,update:l,html:r,createComponent:c,onChange:d,StyleMap:h,unsafeHTML:u}=t,m="list-column-row",g=Object.assign(Object.assign({},e),{api:o,state:a,componentName:m});let f,p=!1;i(a.subscribe("config.components.ListColumnRowExpander",(t=>f=t)));const w=new h(e.column.expander?{height:"",top:"","--height":"","--expander-padding-width":"","--expander-size":""}:{height:"",top:"","--height":""}),b=c(f,{row:e.row}),v=o.getClass(m),D=o.getClass(m+"-content");let y=o.getClass(m);const P=o.generateSlots(m,t,e);let x;d((function(i,s){var n;if(s.leave||!i||void 0===i.row||void 0===i.column)return p=!0,P.change(i,s),void l();p=!1,e=i;for(const t in e)g[t]=e[t];if(!e.column||!e.row||!e.rowData)return p=!0,P.change(i,s),void l();if(void 0===e.column||void 0===e.row)return;x=e.column.isHTML?void 0===e.row?null:"function"==typeof e.column.data?u(e.column.data({row:e.row,vido:t})):"function"==typeof e.row[e.column.data]?u(e.row[e.column.data]({row:e.row,vido:t})):"string"==typeof e.row[e.column.data]?u(e.row[e.column.data]):null:void 0===e.row?null:"function"==typeof e.column.data?e.column.data({row:e.row,vido:t}):"function"==typeof e.row[e.column.data]?e.row[e.column.data]({row:e.row,vido:t}):e.row[e.column.data];const r=a.get("config.list.expander");for(const t in w.style)delete w.style[t];w.style.height=e.rowData.outerHeight+"px",w.style["--height"]=e.rowData.outerHeight+"px",e.column.expander&&(w.style["--expander-padding-width"]=r.padding*(e.rowData.parents.length+1)+"px");const c=a.get("config.list.rows");for(const t of e.rowData.parents){const e=c[t];if("object"==typeof e.style&&"Object"===e.style.constructor.name&&"object"==typeof e.style.children){const t=e.style.children;for(const e in t)w.style[e]=t[e]}}if(null===(n=null==e?void 0:e.row)||void 0===n?void 0:n.style)for(const t in e.row.style)w.style[t]=e.row.style[t];if(e.row.classNames){if(Array.isArray(e.row.classNames)&&e.row.classNames.length)y=o.getClass(m)+" "+e.row.classNames.join(" ");else if("function"==typeof e.row.classNames){const a=e.row.classNames({row:e.row,vido:t});Array.isArray(a)&&a.length&&(y=o.getClass(m)+" "+a.join(" "))}}else y=v;b&&b.change(e),P.change(e,s),l()})),i((()=>{b&&b.destroy()}));const W=o.getActions(m);W.includes(T)||W.push(T);const C=n.create(W,g);function $({classNameCurrent:t,classNameContent:e,styleMap:o,cache:a,shouldDetach:i,content:s,ListColumnRowExpander:n,slots:l,actions:r,html:c,vido:d,props:h}){return a(i||!h||!h.column||!h.row?null:l.html("outer",c`
|
|
206
|
+
<div
|
|
207
|
+
class=${t}
|
|
208
|
+
data-gstcid=${h.row.id}
|
|
209
|
+
style=${o.directive()}
|
|
210
|
+
data-actions=${r()}
|
|
211
|
+
>
|
|
212
|
+
${l.html("inner",c`
|
|
213
|
+
${h.column.expander?n.html():null}
|
|
214
|
+
<div class=${e}>${l.html("content",s)}</div>
|
|
215
|
+
`)}
|
|
216
|
+
</div>
|
|
217
|
+
`))}let I=$;return i(a.subscribe(`config.templates.${m}`,(t=>{I=null!=t?t:$,l()}))),()=>I({classNameCurrent:y,cache:s,shouldDetach:p,styleMap:w,ListColumnRowExpander:b,classNameContent:D,slots:P,actions:C,content:x,html:r,vido:t,props:e})}
|
|
218
|
+
/**
|
|
219
|
+
* ListColumnRowExpander component
|
|
220
|
+
*
|
|
221
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
222
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
223
|
+
* @module gantt-schedule-timeline-calendar
|
|
224
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
225
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
226
|
+
* @version 3.37.5
|
|
227
|
+
* @released 2024-07-19
|
|
228
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
229
|
+
*/function _(t,e){const{api:o,state:a,onDestroy:i,Actions:s,html:n,cache:l,createComponent:r,onChange:c,update:d}=t,h="list-column-row-expander",u=o.getActions(h),m=Object.assign(Object.assign({},e),{api:o,state:a,componentName:h}),g=o.getClass(h);let f;const p=a.subscribe("config.components.ListColumnRowExpanderToggle",(t=>f=t)),w=r(f,e);i((()=>{w.destroy(),p()}));const b=o.generateSlots(h,t,e);e.row&&c((function(t){if((e=t)&&e.row&&e.rowData){for(const t in e)m[t]=e[t];w.change(e),b.change(t),d()}}));const v=s.create(u,m);function D({className:t,ListColumnRowExpanderToggle:e,slots:o,actions:a,html:i,cache:s,vido:n,props:l}){return s(!l?null:o.html("outer",i`
|
|
230
|
+
<div class=${t} data-gstcid=${l.row?l.row.id:""} data-action=${a()}>
|
|
231
|
+
${o.html("content",e.html())}
|
|
232
|
+
</div>
|
|
233
|
+
`))}let y=D;return i(a.subscribe(`config.templates.${h}`,(t=>{y=null!=t?t:D,d()}))),()=>y({className:g,ListColumnRowExpanderToggle:w,slots:b,actions:v,html:n,cache:l,vido:t,props:e})}
|
|
234
|
+
/**
|
|
235
|
+
* ListColumnRowExpanderToggle component
|
|
236
|
+
*
|
|
237
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
238
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
239
|
+
* @module gantt-schedule-timeline-calendar
|
|
240
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
241
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
242
|
+
* @version 3.37.5
|
|
243
|
+
* @released 2024-07-19
|
|
244
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
245
|
+
*/function N(t,e){const{api:o,state:a,cache:i,onDestroy:s,Actions:n,update:l,html:r,onChange:c}=t,d="list-column-row-expander-toggle",h=Object.assign(Object.assign({},e),{api:o,state:a,componentName:d}),u=o.getActions(d),m=o.getClass(d),g=o.getClass(d+"-child"),f=o.getClass(d+"-open"),p=o.getClass(d+"-closed");let w,b,v,D=!1;s(a.subscribe("$data.list.expander.icons",(t=>{t&&(w=t.child,b=t.open,v=t.closed),l()})));const y=o.generateSlots(d,t,e);e.row?(c((function(t){if(e&&e.row){e=t;for(const t in e)h[t]=e[t];D=e.row.expanded,y.change(t),l()}})),s((function(){}))):s(a.subscribe("config.list.rows.*.expanded",(function(t){for(const e of t)if(e.value){D=!0;break}l()}),{bulk:!0}));const P=n.create(u,h);function x(){D=!D,e.row?a.update(`config.list.rows.${e.row.id}.expanded`,D,{data:{name:"expanded",rowId:e.row.id,expanded:D}}):a.update("config.list.rows",(t=>{for(const e in t)t[e].expanded=D;return t}),{only:["*.expanded"],data:{name:"expanded"}})}function W({className:t,classNameChild:e,classNameOpen:o,classNameClosed:a,expanded:i,iconChild:s,iconOpen:n,iconClosed:l,toggle:r,cache:c,slots:d,actions:h,html:u,vido:m,props:g}){return c(!g?null:d.html("outer",u`
|
|
246
|
+
<div
|
|
247
|
+
class=${t}
|
|
248
|
+
data-gstcid=${g.row?g.row.id:""}
|
|
249
|
+
data-action=${h()}
|
|
250
|
+
@click=${r}
|
|
251
|
+
>
|
|
252
|
+
${d.html("content",s?0===(null===(p=null===(f=g.rowData)||void 0===f?void 0:f.children)||void 0===p?void 0:p.length)?u` <img width="16" height="16" class=${e} src=${s} /> `:i?u` <img width="16" height="16" class=${o} src=${n} /> `:u` <img width="16" height="16" class=${a} src=${l} /> `:"")}
|
|
253
|
+
</div>
|
|
254
|
+
`));var f,p}let C=W;return s(a.subscribe(`config.templates.${d}`,(t=>{C=null!=t?t:W,l()}))),()=>C({className:m,classNameChild:g,iconChild:w,expanded:D,cache:i,classNameOpen:f,classNameClosed:p,iconOpen:b,iconClosed:v,toggle:x,slots:y,actions:P,html:r,vido:t,props:e})}
|
|
255
|
+
/**
|
|
256
|
+
* ListToggle component
|
|
257
|
+
*
|
|
258
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
259
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
260
|
+
* @module gantt-schedule-timeline-calendar
|
|
261
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
262
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
263
|
+
* @version 3.37.5
|
|
264
|
+
* @released 2024-07-19
|
|
265
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
266
|
+
*/function H(t,e={}){const{html:o,onDestroy:a,api:i,state:s,update:n,StyleMap:l,Actions:r,onChange:c}=t,d="list-toggle",h=i.getClass(d),u=Object.assign(Object.assign({},e),{api:i,state:s,componentName:d});let m={open:"",close:""};a(s.subscribe("$data.list.toggle.icons",(t=>{t&&(m=t,n())})));const g=new l({top:"0px"});a(s.subscribe("$data.scroll.vertical.preciseOffset",(t=>{g.style.top=(-1*Math.round(t)||0)+"px"})));let f=!0;a(s.subscribe("config.list.columns.percent",(t=>f=0!==t)));let p=!1;function w(){p=!0}function b(){p&&(p=!1,s.update("config.list.columns.percent",(t=>0===t?100:0)))}c((t=>{e=t;for(const o in t)u[o]=e[o]}));const v=i.getActions(d),D=r.create(v,u),y=i.generateSlots(d,t,e);function P({className:t,styleMap:e,pointerDown:o,pointerUp:a,open:i,toggleIconsSrc:s,actions:n,slots:l,html:r,vido:c,props:d}){return l.html("outer",r`
|
|
267
|
+
<div
|
|
268
|
+
class=${t}
|
|
269
|
+
style=${e.directive()}
|
|
270
|
+
@pointerdown=${o}
|
|
271
|
+
@pointerup=${a}
|
|
272
|
+
actions=${n()}
|
|
273
|
+
>
|
|
274
|
+
${l.html("content",r` <img src=${i?s.close:s.open} /> `)}
|
|
275
|
+
</div>
|
|
276
|
+
`)}let x=P;return a(s.subscribe(`config.templates.${d}`,(t=>{x=null!=t?t:P,n()}))),()=>x({className:h,styleMap:g,pointerDown:w,pointerUp:b,open:f,toggleIconsSrc:m,actions:D,slots:y,html:o,vido:t,props:e})}
|
|
277
|
+
/**
|
|
278
|
+
* Chart component
|
|
279
|
+
*
|
|
280
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
281
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
282
|
+
* @module gantt-schedule-timeline-calendar
|
|
283
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
284
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
285
|
+
* @version 3.37.5
|
|
286
|
+
* @released 2024-07-19
|
|
287
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
288
|
+
*/function V(t,e={}){const{api:o,state:a,onDestroy:i,Actions:s,html:n,createComponent:l,update:r}=t,c="chart",d=[];let h,u,m;d.push(a.subscribe("config.components.ChartCalendar",(t=>h=t))),d.push(a.subscribe("config.components.ChartTimeline",(t=>u=t))),d.push(a.subscribe("config.components.ScrollBar",(t=>m=t)));const g=l(h);i(g.destroy);const f=l(u);i(f.destroy);const p=l(m,{type:"horizontal"});i(p.destroy);const w=l(m,{type:"vertical"});i(w.destroy),i((()=>{d.forEach((t=>t()))}));const b=o.getClass(c),v=o.getActions(c);let D=!1;i(a.subscribe("config.chart.time.calculatedZoomMode",(t=>{D=t,r()})));const y={handleEvent:function(t){t.type},passive:!1,capture:!1};let P,x=0;v.push((function(t){P||(P=new ResizeObserver((()=>{const e=t.offsetWidth,o=t.offsetHeight,i=e-a.get("config.scroll.horizontal.width"),s=a.get("config.headerHeight");x!==e&&(x=e,a.update("$data.chart.dimensions",(t=>(t.width=e,t.widthWithoutScrollBar=i,t.height=o,t.innerHeight=o-s,t))))})),P.observe(t),a.update("$data.elements.chart",t))})),i((()=>{P.disconnect()}));const W={api:o,state:a,componentName:c},C=s.create(v,W),$=o.generateSlots(c,t,e);function I({className:t,onWheel:e,ChartCalendar:o,ChartTimeline:a,ScrollBarVertical:i,calculatedZoomMode:s,ScrollBarHorizontal:n,actions:l,slots:r,html:c,vido:d,props:h}){return r.html("outer",c`
|
|
289
|
+
<div class=${t} data-actions=${l()} @wheel=${e}>
|
|
290
|
+
${r.html("content",c`
|
|
291
|
+
${o.html()}${a.html()}${i.html()}
|
|
292
|
+
${s?null:n.html()}
|
|
293
|
+
`)}
|
|
294
|
+
</div>
|
|
295
|
+
`)}let S=I;return i(a.subscribe(`config.templates.${c}`,(t=>{S=null!=t?t:I,r()}))),()=>S({className:b,onWheel:y,ChartCalendar:g,ChartTimeline:f,ScrollBarVertical:w,calculatedZoomMode:D,ScrollBarHorizontal:p,actions:C,slots:$,html:n,vido:t,props:e})}
|
|
296
|
+
/**
|
|
297
|
+
* ChartCalendar component
|
|
298
|
+
*
|
|
299
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
300
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
301
|
+
* @module gantt-schedule-timeline-calendar
|
|
302
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
303
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
304
|
+
* @version 3.37.5
|
|
305
|
+
* @released 2024-07-19
|
|
306
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
307
|
+
*/function E(t,e){const{api:o,state:a,onDestroy:i,Actions:s,update:n,reuseComponents:l,html:r,StyleMap:c}=t,d="chart-calendar",h=o.getActions(d),u=Object.assign(Object.assign({},e),{api:o,state:a,componentName:d}),m=a.get("config.components.ChartCalendarDate"),g=o.getClass(d);let f;const p=new c({height:"","--headerHeight":"","margin-left":""});i(a.subscribe("config.headerHeight",(t=>{f=t,p.style.height=f+"px",p.style["--calendar-height"]=f+"px",n()})));let w=[],b=0;i(a.subscribe("$data.chart.time.levels",((t,e)=>{const i=a.get("$data.chart.time.levels");let s=0;if(i.length!==b){b=i.length,w.forEach((t=>t.forEach((t=>t.destroy())))),w=[];for(let t=0;t<b;t++)w.push([])}for(const t of i){if(!t.length)continue;let e="YYYY-MM-DD HH";switch(t[0].period){case"day":e="YYYY-MM-DD";break;case"week":e="YYYY-MM-ww";break;case"month":e="YYYY-MM";break;case"year":e="YYYY"}const a=o.time.date().format(e);l(w[s],t,(t=>t&&{level:s,date:t,currentDate:a,currentDateFormat:e}),m,!0),s++}n()}))),i((()=>{w.forEach((t=>t.forEach((t=>t.destroy()))))})),h.push((t=>{a.update("$data.elements.chart-calendar",t)}));const v=s.create(h,u),D=o.generateSlots(d,t,e);function y({className:t,styleMap:e,components:o,actions:a,slots:i,html:s,vido:n,props:l}){return i.html("outer",s`
|
|
308
|
+
<div class=${t} data-actions=${a()} style=${e.directive()}>
|
|
309
|
+
${i.html("inner",o.length?o.map(((e,o)=>e&&e.length?s`
|
|
310
|
+
<div class=${t+"-dates "+t+`-dates--level-${o}`}>
|
|
311
|
+
${i.html("content",e.map((t=>t.html())))}
|
|
312
|
+
</div>
|
|
313
|
+
`:null)):null)}
|
|
314
|
+
</div>
|
|
315
|
+
`)}let P=y;return i(a.subscribe(`config.templates.${d}`,(t=>{P=null!=t?t:y,n()}))),()=>P({className:g,styleMap:p,components:w,actions:v,slots:D,html:r,vido:t,props:e})}
|
|
316
|
+
/**
|
|
317
|
+
* ChartCalendarDate component
|
|
318
|
+
*
|
|
319
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
320
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
321
|
+
* @module gantt-schedule-timeline-calendar
|
|
322
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
323
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
324
|
+
* @version 3.37.5
|
|
325
|
+
* @released 2024-07-19
|
|
326
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
327
|
+
*/class B extends i{constructor(t,e){super(),e.state.update("$data.elements.chart-calendar-dates",(e=>(void 0===e&&(e=[]),e.includes(t)||e.push(t),e)))}}function j(t,e){const{api:o,state:a,onDestroy:i,Actions:s,update:n,onChange:l,html:r,StyleMap:c,cache:d}=t,h="chart-calendar-date",u=o.getActions(h),m=o.getClass(h);let g,f="",p="";i(a.subscribe("config.chart.time",(t=>g=t)));const w=new c({width:"0px"},{schedule:!1});let b="";function v(){if(!e||!e.date)return;const t=a.get(`config.chart.calendarLevels.${e.level}`);w.style.width=e.date.currentView.width+"px",w.style.left=e.date.currentView.leftPx+"px";const o=t.find((t=>+g.zoom<=+t.zoomTo));f=e.date.current?" gstc-current":e.date.next?" gstc-next":e.date.previous?" gstc-previous":"",p=m+"-content "+m+`-content--${e.date.period}`+f,o.classNames&&Array.isArray(o.classNames)?(p+=" "+o.classNames.join(" "),b=" "+o.classNames.join(" ")):b="",n()}let D=!1;const y=o.generateSlots(h,t,e);let P,x,W;const C={date:e.date,period:e.period,api:o,state:a,componentName:h};l(((t,o)=>{if(o.leave)return D=!0,y.change(t,o),n();D=!1,x=e.level===g.level,W=x?m+"--main-date ":m+"--non-main-date ",e=t,C.date=e.date,C.period=e.period,P&&P(),P=a.subscribeAll(["$data.chart.time","config.chart.calendarLevels"],v,{bulk:!0}),y.change(t,o)})),i((()=>{P()})),u.includes(B)||u.push(B);const $=s.create(u,C);function I({className:t,mainClass:e,additionalClass:o,formatClassName:a,finalClassName:i,styleMap:s,cache:n,shouldDetach:l,actions:r,slots:c,html:d,vido:h,props:u}){return n(l||!u||!u.date?null:c.html("outer",d`
|
|
328
|
+
<div
|
|
329
|
+
class=${t+" "+t+`--${u.date.period} `+e+t+`--level-${u.level}`+o+a}
|
|
330
|
+
data-gstcid=${u.date.id}
|
|
331
|
+
style=${s.directive()}
|
|
332
|
+
data-actions=${r()}
|
|
333
|
+
>
|
|
334
|
+
${c.html("content",d`<div class=${i.trim()}>${u.date.formatted}</div>`)}
|
|
335
|
+
</div>
|
|
336
|
+
`))}let S=I;return i(a.subscribe(`config.templates.${h}`,(t=>{S=null!=t?t:I,n()}))),()=>S({className:m,mainClass:W,additionalClass:f,formatClassName:b,styleMap:w,finalClassName:p,cache:d,shouldDetach:D,actions:$,slots:y,html:r,vido:t,props:e})}
|
|
337
|
+
/**
|
|
338
|
+
* ChartTimeline component
|
|
339
|
+
*
|
|
340
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
341
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
342
|
+
* @module gantt-schedule-timeline-calendar
|
|
343
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
344
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
345
|
+
* @version 3.37.5
|
|
346
|
+
* @released 2024-07-19
|
|
347
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
348
|
+
*/function F(t,e){const{api:o,state:a,onDestroy:i,Action:s,Actions:n,update:l,html:r,createComponent:c,StyleMap:d}=t,h="chart-timeline",u=Object.assign(Object.assign({},e),{api:o,state:a,componentName:h});let m,g,f;i(a.subscribe("config.components.ChartTimelineGrid",(t=>{m&&m.destroy(),m=c(t)}))),i((()=>{m&&m.destroy()})),i(a.subscribe("config.components.ChartTimelineItems",(t=>{g&&g.destroy(),g=c(t)}))),i((()=>{g&&g.destroy()})),i(a.subscribe("config.components.ListToggle",(t=>{f&&f.destroy(),f=c(t)}))),i((()=>{f&&f.destroy()}));const p=o.generateSlots(h,t,e),w=o.getClass(h),b=o.getClass(h+"-inner");let v;i(a.subscribe("config.list.toggle.display",(t=>v=t)));const D=new d({}),y=new d({});let P,x;i(a.subscribe("config.additionalSpace",(t=>{P=t,l()}))),i(a.subscribe("config.headerHeight",(t=>{x=t,l()}))),i(a.subscribeAll(["$data.chart.dimensions.heightWithoutScrollBar","$data.scroll.vertical.offset","$data.chart.dimensions.width","$data.list.visibleRowsHeight","$data.chart.time.dates.day","config.headerHeight","config.additionalSpace"],(function(){const t=a.get("$data.chart.dimensions.width"),e=Math.round(o.getRealChartHeight(!0));D.style.height=a.get("config.innerHeight")+"px",D.style["--height"]=D.style.height,D.style.top=P.top+x+"px",t?(D.style.width=t+"px",D.style["--width"]=t+"px"):(D.style.width="0px",D.style["--width"]="0px"),y.style.height=e+"px",y.style.width=t?t+"px":"0px";const i=a.get("$data.scroll.vertical.preciseOffset")||0;y.style.transform=`translateY(${Math.round(i)}px)`,l()}),{group:!0,bulkValue:!1}));let W=[];i(a.subscribe("config.actions.chart-timeline",(t=>{W=t}))),W.push(class extends s{constructor(t){super();a.get("$data.elements.chart-timeline")!==t&&a.update("$data.elements.chart-timeline",t)}});const C=n.create(W,u);function $({className:t,classNameInner:e,styleMap:o,innerStyleMap:a,Grid:i,Items:s,showToggle:n,ListToggle:l,actions:r,slots:c,html:d,vido:h,props:u}){return c.html("outer",d`
|
|
349
|
+
<div class=${t} style=${o.directive()} data-actions=${r()}>
|
|
350
|
+
${c.html("inner",d`
|
|
351
|
+
<div class=${e} style=${a.directive()}>
|
|
352
|
+
${c.html("content",d` ${i.html()}${s.html()}${n?l.html():""} `)}
|
|
353
|
+
</div>
|
|
354
|
+
`)}
|
|
355
|
+
</div>
|
|
356
|
+
`)}let I=$;return i(a.subscribe(`config.templates.${h}`,(t=>{I=null!=t?t:$,l()}))),()=>I({className:w,styleMap:D,classNameInner:b,Grid:m,innerStyleMap:y,Items:g,showToggle:v,ListToggle:f,actions:C,slots:p,html:r,vido:t,props:e})}
|
|
357
|
+
/**
|
|
358
|
+
* ChartTimelineGrid component
|
|
359
|
+
*
|
|
360
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
361
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
362
|
+
* @module gantt-schedule-timeline-calendar
|
|
363
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
364
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
365
|
+
* @version 3.37.5
|
|
366
|
+
* @released 2024-07-19
|
|
367
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
368
|
+
*/class Y{constructor(t,e){e.state.get("$data.elements.chart-timeline-grid")!==t&&e.state.update("$data.elements.chart-timeline-grid",t,{only:null})}destroy(t,e){e.state.update("$data.elements",(t=>(delete t["chart-timeline-grid"],t)),{only:null})}}function q(t,e){const{api:o,state:a,onDestroy:i,Actions:s,update:n,html:l,reuseComponents:r,StyleMap:c}=t,d="chart-timeline-grid",h=o.getActions(d),u={api:o,state:a,componentName:d},m=a.get("config.components.ChartTimelineGridRow"),g=o.getClass(d);let f;i(a.subscribe("config.chart.grid.cell.onCreate",(t=>f=t)));const p=[],w={},b=new Map,v=new c({});function D(t){let e=t.month()+1;e<10&&(e="0"+e);let o=t.date();o<10&&(o="0"+o);let a=t.hour();a<10&&(a="0"+a);let i=t.minute();i<10&&(i="0"+i);let s=t.second();return s<10&&(s="0"+s),`${t.year()}-${e}-${o}T${a}-${i}-${s}`}i(a.subscribeAll(["$data.scroll.vertical.preciseOffset","$data.chart.dimensions.width","$data.chart.dimensions.heightWithoutScrollBar"],(function(){const t=a.get("$data.chart.dimensions.width"),e=o.getRealChartHeight();v.style.height=Math.round(e)+"px",v.style.width=t+"px"}),{group:!0}));let y="",P=0,x=0,W="",C=0,$="",I=0,S=0;function M(){const t=o.getGridRows();r(p,t||[],(t=>t),m,!0),n()}i(a.subscribeAll(["$data.list.rowsHeight","$data.list.visibleRows","$data.list.visibleRowsHeight","$data.chart.time.levels","$data.scroll","config.list.rows;","config.list.rows.*;"],(function(e,i){const s=a.get("$data.chart.time"),n=a.get(`$data.chart.time.levels.${s.level}`),l=s.levels[s.level];if(!l||!l.length)return;const r=s.levels[s.level].map((t=>t.currentView.width)).join(",");if(!n||0===n.length)return void a.update("$data.chart.grid",{rows:{},cells:{}});const c=o.getRowsData(),d=a.get("$data.list.visibleRows"),h=d.map((t=>c[t].outerHeight)).join("|"),u=d.join("|"),m=a.get("$data.scroll");if(u===y&&P===s.leftGlobal&&x===s.rightGlobal&&h===W&&C===n.length&&$===r&&m.horizontal.handlePosPx===I&&m.vertical.handlePosPx===S)return"$data.chart.time.levels"===i.path.listener?M():void 0;I=m.horizontal.handlePosPx,S=m.vertical.handlePosPx,P=s.leftGlobal,x=s.rightGlobal,$=r,W=h;let g=0;if(u!==y)for(const t in w)delete w[t];else if(C!==n.length)for(const t in w)w[t].cells.length=0;C=n.length;const p=o.getAllRows(),v=a.get("$data.chart.grid.cells");for(const t in v)delete v[t];for(const e of d){const o=p[e],a=c[e];if(!o||!a)continue;let i,s;u!==y?i=[]:(i=w[e].cells,i.length=0);for(const e of n){let s;b.has(e.leftGlobal)?s=b.get(e.leftGlobal):(s=D(e.leftGlobalDate),b.set(e.leftGlobal,s));const n=o.id+"-"+s;let l;if(v[n])l=v[n],l.id=n,l.time=e,l.row=o,l.rowData=a,l.top=g,l.vido=t,l.content=null;else{const i=Object.create(null);i.id=n,i.time=e,i.row=o,i.rowData=a,i.top=g,i.vido=t,i.content=null,l=i}for(const t of f)l.content=t(l);v[l.id]=l,i.push(l.id)}w[e]?(s=w[e],s.row=o,s.rowData=a,s.cells=i,s.top=g):s={row:o,rowData:a,cells:i,top:g},w[e]=s,g+=a.outerHeight}y=u,a.update("$data.chart.grid",{rows:w,cells:v})}),{group:!0,bulkValue:!1})),i(a.subscribe("$data.chart.grid",M,{group:!0})),i((()=>{p.forEach((t=>t.destroy()))})),h.push(Y);const k=s.create(h,u),G=o.generateSlots(d,t,e);function L({className:t,styleMap:e,rowsComponents:o,actions:a,slots:i,html:s,vido:n,props:l}){return i.html("outer",s`
|
|
369
|
+
<div class=${t} data-actions=${a()} style=${e.directive()}>
|
|
370
|
+
${i.html("content",o.map((t=>t.html())))}
|
|
371
|
+
</div>
|
|
372
|
+
`)}let z=L;return i(a.subscribe(`config.templates.${d}`,(t=>{z=null!=t?t:L,n()}))),()=>z({className:g,styleMap:v,rowsComponents:p,actions:k,slots:G,html:l,vido:t,props:e})}
|
|
373
|
+
/**
|
|
374
|
+
* ChartTimelineGridRow component
|
|
375
|
+
*
|
|
376
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
377
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
378
|
+
* @module gantt-schedule-timeline-calendar
|
|
379
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
380
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
381
|
+
* @version 3.37.5
|
|
382
|
+
* @released 2024-07-19
|
|
383
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
384
|
+
*/class J{constructor(t,e){let o=!1,a=e.state.get("$data.elements.chart-timeline-grid-rows");void 0===a&&(a=[],o=!0),a.includes(t)||(a.push(t),o=!0),o&&e.state.update("$data.elements.chart-timeline-grid-rows",a,{only:null})}destroy(t,e){e.state.update("$data.elements.chart-timeline-grid-rows",(e=>e.filter((e=>e!==t))),{only:null})}}function Z(t,e){const{api:o,state:a,onDestroy:i,cache:s,Actions:n,update:l,html:r,reuseComponents:c,onChange:d,StyleMap:h}=t,u="chart-timeline-grid-row",m=Object.assign(Object.assign({},e),{api:o,state:a,componentName:u});let g;i(a.subscribe("config.components.ChartTimelineGridRowCell",(t=>g=t)));const f=o.getActions(u),p=o.getClass(u),w=new h({height:e.row.height+"px"});let b=!1;const v=o.generateSlots(u,t,e),D=[];d((function(t,a){if(!t||a.leave||void 0===t.row)return b=!0,c(D,[],(t=>t),g,!0),v.change(t,a),void l();b=!1,e=t;const i=o.getGridCells(e.cells);if(c(D,i,(t=>t),g,!0),w.setStyle({}),w.style.height=e.rowData.outerHeight+"px",e.row.style)for(const t in e.row.style)w.style[t]=e.row.style[t];for(const t in e)m[t]=e[t];v.change(t,a)})),i((function(){D.forEach((t=>t.destroy()))})),-1===f.indexOf(J)&&f.push(J);const y=n.create(f,m);function P({className:t,styleMap:e,rowsCellsComponents:o,cache:a,shouldDetach:i,actions:s,slots:n,html:l,vido:r,props:c}){return a(i||!c||!c.row?null:n.html("outer",l`
|
|
385
|
+
<div
|
|
386
|
+
class=${t}
|
|
387
|
+
data-gstcid=${c.row.id}
|
|
388
|
+
data-actions=${s()}
|
|
389
|
+
style=${e.directive()}
|
|
390
|
+
>
|
|
391
|
+
${n.html("content",o.map((t=>t.html())))}
|
|
392
|
+
</div>
|
|
393
|
+
`))}let x=P;return i(a.subscribe(`config.templates.${u}`,(t=>{x=null!=t?t:P,l()}))),()=>x({className:p,styleMap:w,rowsCellsComponents:D,cache:s,shouldDetach:b,actions:y,slots:v,html:r,vido:t,props:e})}
|
|
394
|
+
/**
|
|
395
|
+
* ChartTimelineGridRowCell component
|
|
396
|
+
*
|
|
397
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
398
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
399
|
+
* @module gantt-schedule-timeline-calendar
|
|
400
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
401
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
402
|
+
* @version 3.37.5
|
|
403
|
+
* @released 2024-07-19
|
|
404
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
405
|
+
*/class K{constructor(t,e){let o=!1,a=e.state.get("$data.elements.chart-timeline-grid-row-cells");void 0===a&&(a=[],o=!0),a.includes(t)||(a.push(t),o=!0),o&&e.state.update("$data.elements.chart-timeline-grid-row-cells",a,{only:null})}destroy(t,e){e.state.update("$data.elements.chart-timeline-grid-row-cells",(e=>e.filter((e=>e!==t))),{only:[""]})}}function Q(t,e){const{api:o,state:a,cache:i,Actions:s,html:n,onChange:l,onDestroy:r,StyleMap:c,update:d}=t,h="chart-timeline-grid-row-cell",u=Object.assign(Object.assign({},e),{api:o,state:a,componentName:h});let m=!1;const g=o.getActions(h),f=o.generateSlots(h,t,e);let p;function w(t){p=o.getClass(h),t&&t.time&&t.time.current&&(p+=" current")}w(e);const b=new c({width:"",height:""});l((function(t,o){var a,i;if(!t||o.leave||void 0===t.row)return m=!0,f.change(t,o),void d();m=!1,e=t;for(const t in e)u[t]=e[t];if(w(e),b.setStyle({}),e&&e.row){if(b.style.width=((null===(i=null===(a=null==e?void 0:e.time)||void 0===a?void 0:a.currentView)||void 0===i?void 0:i.width)||0)+"px",e.row.style)for(const t in e.row.style)b.style[t]=e.row.style[t];f.change(e,o),d()}})),g.push(K);const v=s.create(g,u);function D({className:t,styleMap:e,cache:o,shouldDetach:a,actions:i,slots:s,html:n,vido:l,props:r}){var c;return o(a||!r||!r.id?null:s.html("outer",n`
|
|
406
|
+
<div class=${t} data-gstcid=${r.id} data-actions=${i()} style=${e.directive()}>
|
|
407
|
+
${s.html("content",null!==(c=r&&r.content)&&void 0!==c?c:null)}
|
|
408
|
+
</div>
|
|
409
|
+
`))}let y=D;return r(a.subscribe(`config.templates.${h}`,(t=>{y=null!=t?t:D,d()}))),()=>y({className:p,styleMap:b,cache:i,shouldDetach:m,actions:v,slots:f,html:n,vido:t,props:e})}
|
|
410
|
+
/**
|
|
411
|
+
* ChartTimelineItems component
|
|
412
|
+
*
|
|
413
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
414
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
415
|
+
* @module gantt-schedule-timeline-calendar
|
|
416
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
417
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
418
|
+
* @version 3.37.5
|
|
419
|
+
* @released 2024-07-19
|
|
420
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
421
|
+
*/function U(t,e={}){const{api:o,state:a,onDestroy:i,Actions:s,update:n,html:l,reuseComponents:r,StyleMap:c}=t,d="chart-timeline-items";let h,u;i(a.subscribe(`config.actions.${d}`,(t=>h=t))),i(a.subscribe("config.components.ChartTimelineItemsRow",(t=>u=t)));const m=o.getClass(d),g=new c({});let f;i(a.subscribeAll(["$data.chart.dimensions.heightWithoutScrollBar","$data.chart.dimensions.width","$data.scroll.vertical.preciseOffset"],(function(){const t=a.get("$data.chart.dimensions.width"),e=o.getRealChartHeight();g.style.width=t+"px",g.style.height=e+"px"}),{group:!0})),i(a.subscribe("config.debug",(t=>f=t)));const p=[],w={};i(a.subscribeAll(["$data.list.visibleRows","config.list.rows","config.components.ChartTimelineItemsRow","config.chart.items","$data.chart.items"],(function t(){a.mute(t),f&&console.log("[items.ts] Updating item & rows components.");const e=a.get("$data.list.visibleRows")||[],i=o.getRows(e),s=o.getRowsData();for(const t of i)w[t.id]||(w[t.id]={}),w[t.id].row=t,w[t.id].rowData=s[t.id];for(const t in w)e.includes(t)||delete w[t];r(p,i,(t=>t?w[t.id]:null),u,!0),n(),a.unmute(t)}),{group:!0,bulkValue:!1})),i((()=>{p.forEach((t=>t.destroy()))}));const b={api:o,state:a,componentName:d},v=s.create(h,b),D=o.generateSlots(d,t,e);function y({className:t,styleMap:e,rowsComponents:o,actions:a,slots:i,html:s,vido:n,props:l}){return i.html("outer",s`
|
|
422
|
+
<div class=${t} style=${e.directive()} data-actions=${a()}>
|
|
423
|
+
${i.html("content",o.map((t=>t.html())))}
|
|
424
|
+
</div>
|
|
425
|
+
`)}let P=y;return i(a.subscribe(`config.templates.${d}`,(t=>{P=null!=t?t:y,n()}))),()=>P({className:m,styleMap:g,rowsComponents:p,actions:v,slots:D,html:l,vido:t,props:e})}
|
|
426
|
+
/**
|
|
427
|
+
* ChartTimelineItemsRow component
|
|
428
|
+
*
|
|
429
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
430
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
431
|
+
* @module gantt-schedule-timeline-calendar
|
|
432
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
433
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
434
|
+
* @version 3.37.5
|
|
435
|
+
* @released 2024-07-19
|
|
436
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
437
|
+
*/class X{constructor(t,e){let o=!1,a=e.state.get("$data.elements.chart-timeline-items-rows");void 0===a&&(a=[],o=!0),a.includes(t)||(a.push(t),o=!0),o&&e.state.update("$data.elements.chart-timeline-items-rows",a,{only:null})}destroy(t,e){e.state.update("$data.elements.chart-timeline-items-rows",(e=>e.filter((e=>e!==t))),{only:null})}}function tt(t,e){const{api:o,state:a,onDestroy:i,cache:s,Actions:n,update:l,html:r,onChange:c,reuseComponents:d,StyleMap:h}=t,u="chart-timeline-items-row",m=Object.assign(Object.assign({},e),{api:o,state:a,componentName:u});let g;i(a.subscribe("config.components.ChartTimelineItemsRowItem",(t=>g=t)));let f="";const p=[],w=new h({width:"",height:""});let b=!1;function v(t=e.rowData,o=null){const i=a.get("$data.chart");b=!1,w.style.width=i.dimensions.width+"px",e?(w.style.height=t.outerHeight+"px",w.style["--row-height"]=t.outerHeight+"px",l()):b=!0}function D(t,e){if(!t||!e)return b=!0,d(p,[],(()=>null),g,!0),l();const a=e.items;if(void 0===a)return b=!0,d(p,[],(()=>null),g,!0),v(),l();const i=o.getItems(a);i.sort(((t,e)=>t.time.start-e.time.start)),d(p,i,(e=>({row:t,item:e,itemData:e?o.getItemData(e.id):null})),g,!0),v(),l()}const y=o.getClass(u),P=o.generateSlots(u,t,e);c((function(o,a){if(a.leave||!o||void 0===o.row)return b=!0,d(p,[],(()=>null),g,!0),P.change(o,a),l();e=o;for(const t in e)m[t]=e[t];if(e.row.classNames){if(Array.isArray(e.row.classNames)&&e.row.classNames.length)f=y+" "+e.row.classNames.join(" ");else if("function"==typeof e.row.classNames){const o=e.row.classNames({row:e.row,vido:t});Array.isArray(o)&&o.length&&(f=y+" "+o.join(" "))}}else f=y;D(e.row,e.rowData),P.change(o,a),l()})),i(a.subscribe("$data.chart.dimensions.width",(()=>D(e.row,e.rowData)))),i((()=>{p.forEach((t=>t.destroy()))}));const x=o.getActions(u);x.push(X);const W=n.create(x,m);function C({classNameCurrent:t,styleMap:e,shouldDetach:o,itemComponents:a,actions:i,slots:s,cache:n,html:l,vido:r,props:c}){return n(o||!c||!c.row?null:s.html("outer",l`
|
|
438
|
+
<div
|
|
439
|
+
class=${t}
|
|
440
|
+
data-gstcid=${c.row.id}
|
|
441
|
+
data-actions=${i()}
|
|
442
|
+
style=${e.directive()}
|
|
443
|
+
>
|
|
444
|
+
${s.html("content",a.map((t=>t.html())))}
|
|
445
|
+
</div>
|
|
446
|
+
`))}let $=C;return i(a.subscribe(`config.templates.${u}`,(t=>{$=null!=t?t:C,l()}))),()=>$({cache:s,shouldDetach:b,classNameCurrent:f,styleMap:w,itemComponents:p,actions:W,slots:P,html:r,vido:t,props:e})}
|
|
447
|
+
/**
|
|
448
|
+
* ChartTimelineItemsRowItem component
|
|
449
|
+
*
|
|
450
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
451
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
452
|
+
* @module gantt-schedule-timeline-calendar
|
|
453
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
454
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
455
|
+
* @version 3.37.5
|
|
456
|
+
* @released 2024-07-19
|
|
457
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
458
|
+
*/class et{constructor(t,e){let o=!1,a=e.state.get("$data.elements.chart-timeline-items-row-items");void 0===a&&(a=[],o=!0),a.includes(t)||(a.push(t),o=!0),o&&e.state.update("$data.elements.chart-timeline-items-row-items",a,{only:null})}destroy(t,e){e.state.update("$data.elements.chart-timeline-items-row-items",(e=>e.filter((e=>e!==t))),{only:null})}}function ot(t,e){const{api:o,state:a,cache:i,onDestroy:s,Actions:n,update:l,html:r,onChange:c,unsafeHTML:d,StyleMap:h}=t;let u,m,g=0,f=0;s(a.subscribe("config.chart.spacing",(t=>{"number"==typeof t?(f=t,g=0):("number"==typeof t.left&&(g=t.left),"number"==typeof t.right&&(f=t.right)),l()})));const p="chart-timeline-items-row-item";let w=0,b=0,v=!1,D="";const y=new h({width:"",height:"",left:"",top:""}),P=new h({}),x=new h({}),W={item:e.item,itemData:e.itemData,row:e.row,left:w,width:b,api:o,state:a,componentName:p},C=o.getClass(p),$=o.getClass(p+"-label"),I=o.generateSlots(p,t,e);let S,M=!1;function k(){var i;const s=a.get("$data.chart.time");if(I.change(e,{leave:!1}),v||0===s.levels.length||!s.levels[s.level]||0===s.levels[s.level].length)return M=!0,l();if(!e.item||!e.itemData)return M=!0,l();if(!a.get("$data.chart.visibleItems").includes(e.item.id))return M=!0,l();const n=e.itemData;if(w=n.position.actualLeft+g,b=n.actualWidth-f-g,e.item.time.end<s.leftGlobal||e.item.time.start>s.rightGlobal||b<=0)return M=!0,n.detached=M,l();if(D=C,e.item.time.start<s.leftGlobal?(P.style.display="flex",D+=" "+o.getClass(p+"--left-cut")):P.style.display="none",e.item.time.end>s.rightGlobal?(x.style.display="flex",D+=" "+o.getClass(p+"--right-cut")):x.style.display="none",e.item.classNames)if(Array.isArray(e.item.classNames)&&e.item.classNames.length)D+=" "+e.item.classNames.join(" ");else if("function"==typeof e.item.classNames){const o=e.item.classNames({item:e.item,vido:t});Array.isArray(o)&&(D+=" "+o.join(" "))}const r=y.style.width,c=y.style.left,d=y.style.top,h=y.style.height;y.setStyle({});const u=o.isItemInViewport(e.item,s.leftGlobal,s.rightGlobal);if(M=!u,n.detached=M,u?(y.style.width=b+"px",y.style.left=w+"px",y.style.top=n.position.actualRowTop+"px",y.style.height=n.actualHeight+"px"):(y.style.width=r,y.style.left=c,y.style.top=d,y.style.height=h),null===(i=null==e?void 0:e.item)||void 0===i?void 0:i.style)for(const t in e.item.style)y.style[t]=e.item.style[t];W.left=w,W.width=b,l()}s(a.subscribe("config.chart.item.cutIcons",(t=>{S={left:o.getSVGIconSrc(t.left),right:o.getSVGIconSrc(t.right)}})));const G=o.getClass(`${p}-cut`)+" "+o.getClass(`${p}--left-cut-icon`),L=o.getClass(`${p}-cut-image`),z=()=>r`
|
|
459
|
+
<div class=${G} style=${P.directive()}>
|
|
460
|
+
<img src="${S.left}" width="18" height="18" class=${L} />
|
|
461
|
+
</div>
|
|
462
|
+
`,O=o.getClass(`${p}-cut`)+" "+o.getClass(`${p}--right-cut-icon`),R=o.getClass(`${p}-cut-image`),T=()=>r`
|
|
463
|
+
<div class=${O} style=${x.directive()}>
|
|
464
|
+
<img src="${S.right}" width="18" height="18" class=${R} />
|
|
465
|
+
</div>
|
|
466
|
+
`;c((function(t,o){if(o.leave||void 0===t.row||void 0===t.item)return v=!0,M=!0,I.change(t,o),l();M=!1,v=!1,(e=t).item.id===u&&e.row.id===m||(u=e.item.id,m=e.row.id),W.item=e.item,W.itemData=e.itemData,W.row=e.row,k(),I.change(t,o),l()}));const A=o.getActions(p);s(a.subscribeAll(["$data.chart.time","$data.chart.visibleItems"],k)),A.push(et);const _=n.create(A,W);function N(){return e.item?e.item.isHTML?e.item&&e.item.label?"function"==typeof e.item.label?d(e.item.label({item:e.item,vido:t})):"string"==typeof e.item.label?d(e.item.label):null:null:e.item&&e.item.label?"function"==typeof e.item.label?e.item.label({item:e.item,vido:t}):e.item.label:null:null}function H({className:t,labelClassName:e,styleMap:o,cache:a,shouldDetach:i,cutterLeft:s,cutterRight:n,getContent:l,actions:r,slots:c,html:d,vido:h,props:u}){return a(i||!u||!u.item?null:c.html("outer",d`
|
|
467
|
+
<div
|
|
468
|
+
class=${t}
|
|
469
|
+
data-gstcid=${u.item.id}
|
|
470
|
+
data-actions=${r()}
|
|
471
|
+
style=${o.directive()}
|
|
472
|
+
>
|
|
473
|
+
${c.html("inner",d`
|
|
474
|
+
${s()}
|
|
475
|
+
<div class=${e}>${c.html("content",l())}</div>
|
|
476
|
+
${n()}
|
|
477
|
+
`)}
|
|
478
|
+
</div>
|
|
479
|
+
`))}let V=H;return s(a.subscribe(`config.templates.${p}`,(t=>{V=null!=t?t:H,l()}))),()=>V({className:D,labelClassName:$,cache:i,shouldDetach:M,styleMap:y,cutterLeft:z,cutterRight:T,getContent:N,actions:_,slots:I,html:r,vido:t,props:e})}
|
|
480
|
+
/**
|
|
481
|
+
* Gantt-Schedule-Timeline-Calendar default configuration
|
|
482
|
+
*
|
|
483
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
484
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
485
|
+
* @module gantt-schedule-timeline-calendar
|
|
486
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
487
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
488
|
+
* @version 3.37.5
|
|
489
|
+
* @released 2024-07-19
|
|
490
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
491
|
+
*/const at=["main","scroll-bar","list","list-column","list-column-header","list-column-header-resizer","list-column-row","list-column-row-expander","list-column-row-expander-toggle","list-toggle","chart","chart-calendar","chart-calendar-date","chart-timeline","chart-timeline-grid","chart-timeline-grid-row","chart-timeline-grid-row-cell","chart-timeline-items","chart-timeline-items-row","chart-timeline-items-row-item"];function it(){const t={};return at.forEach((e=>t[e]=[])),t}function st(){const t={};return at.forEach((e=>t[e]=null)),t}function nt(){const t={};return at.forEach((e=>{t[e]={outer:[],inner:[],"container-outer":[],"container-inner":[],content:[]}})),t}function lt(){const t=[{zoomTo:17,period:"day",periodIncrement:1,classNames:["gstc-date-medium gstc-date-left"],format:({timeStart:t})=>t.format("DD MMMM YYYY (dddd)")},{zoomTo:23,period:"month",periodIncrement:1,format:({timeStart:t})=>t.format("MMMM YYYY")},{zoomTo:24,period:"month",periodIncrement:1,format:({timeStart:t})=>t.format("MMMM 'YY")},{zoomTo:25,period:"month",periodIncrement:1,format:({timeStart:t})=>t.format("MMM YYYY")},{zoomTo:27,period:"year",periodIncrement:1,format:({timeStart:t})=>t.format("YYYY")},{zoomTo:100,period:"year",periodIncrement:1,format:()=>null}],e=[{zoomTo:9,period:"minute",classNames:["gstc-date-medium"],main:!0,periodIncrement:1,format:({timeStart:t})=>t.format("HH:mm")},{zoomTo:11,period:"minute",classNames:["gstc-date-medium"],main:!0,periodIncrement:5,format:({timeStart:t})=>t.format("HH:mm")},{zoomTo:12,period:"minute",classNames:["gstc-date-medium"],main:!0,periodIncrement:15,format:({timeStart:t})=>t.format("HH:mm")},{zoomTo:13,period:"minute",classNames:["gstc-date-medium"],main:!0,periodIncrement:30,format:({timeStart:t})=>t.format("HH:mm")},{zoomTo:16,period:"hour",classNames:["gstc-date-medium"],main:!0,periodIncrement:1,format:({timeStart:t})=>t.format("HH:mm")},{zoomTo:17,period:"hour",main:!0,periodIncrement:1,format:({timeStart:t})=>t.format("HH")},{zoomTo:19,period:"day",main:!0,periodIncrement:1,classNames:["gstc-date-medium"],format:({timeStart:t,className:e,vido:o})=>o.html`<span class="${e}-content gstc-date-bold">${t.format("DD")}</span> <span class="${e}-content gstc-date-thin">${t.format("dddd")}</span>`},{zoomTo:20,period:"day",main:!0,periodIncrement:1,format:({timeStart:t,vido:e,className:o})=>e.html`<div class="${o}-content gstc-date-top">${t.format("DD")}</div><div class="${o}-content gstc-date-small">${t.format("dddd")}</div>`},{zoomTo:21,period:"day",main:!0,periodIncrement:1,format:({timeStart:t,vido:e,className:o})=>e.html`<div class="${o}-content gstc-date-top">${t.format("DD")}</div><div class="${o}-content gstc-date-small">${t.format("ddd")}</div>`},{zoomTo:22,period:"day",main:!0,periodIncrement:1,classNames:["gstc-date-vertical"],format:({timeStart:t,className:e,vido:o})=>o.html`<div class="${e}-content gstc-date-top">${t.format("DD")}</div><div class="${e}-content gstc-date-extra-small">${t.format("ddd")}</div>`},{zoomTo:23,period:"week",main:!0,periodIncrement:1,format:({timeStart:t,timeEnd:e,className:o,vido:a})=>a.html`<div class="${o}-content gstc-date-top">${t.format("DD")} - ${e.format("DD")}</div><div class="${o}-content gstc-date-small gstc-date-thin">${t.format("ddd")} - ${e.format("dd")}</div>`},{zoomTo:25,period:"week",main:!0,periodIncrement:1,classNames:["gstc-date-vertical"],format:({timeStart:t,timeEnd:e,className:o,vido:a})=>a.html`<div class="${o}-content gstc-date-top gstc-date-small gstc-date-normal">${t.format("DD")}</div><div class="gstc-dash gstc-date-small">-</div><div class="${o}-content gstc-date-small gstc-date-normal">${e.format("DD")}</div>`},{zoomTo:26,period:"month",main:!0,periodIncrement:1,classNames:["gstc-date-month-level-1"],format:({timeStart:t,vido:e,className:o})=>e.html`<div class="${o}-content gstc-date-top">${t.format("MMM")}</div><div class="${o}-content gstc-date-small gstc-date-bottom">${t.format("MM")}</div>`},{zoomTo:27,period:"month",main:!0,periodIncrement:1,classNames:["gstc-date-vertical"],format:({timeStart:t,className:e,vido:o})=>o.html`<div class="${e}-content gstc-date-top">${t.format("MM")}</div><div class="${e}-content gstc-date-extra-small">${t.format("MMM")}</div>`},{zoomTo:28,period:"year",main:!0,periodIncrement:1,classNames:["gstc-date-big"],format:({timeStart:t})=>t.format("YYYY")},{zoomTo:29,period:"year",main:!0,periodIncrement:1,classNames:["gstc-date-medium"],format:({timeStart:t})=>t.format("YYYY")},{zoomTo:30,period:"year",main:!0,periodIncrement:1,classNames:["gstc-date-medium"],format:({timeStart:t})=>t.format("YY")},{zoomTo:100,period:"year",main:!0,periodIncrement:1,format:()=>null}];return{licenseKey:"",debug:!1,plugins:[],plugin:{},innerHeight:428,initialWidth:1024,additionalSpace:{top:0,bottom:0},headerHeight:72,autoInnerHeight:!1,components:{ScrollBar:k,List:G,ListColumn:z,ListColumnHeader:O,ListColumnHeaderResizer:R,ListColumnRow:A,ListColumnRowExpander:_,ListColumnRowExpanderToggle:N,ListToggle:H,Chart:V,ChartCalendar:E,ChartCalendarDate:j,ChartTimeline:F,ChartTimelineGrid:q,ChartTimelineGridRow:Z,ChartTimelineGridRowCell:Q,ChartTimelineItems:U,ChartTimelineItemsRow:tt,ChartTimelineItemsRowItem:ot},slots:nt(),list:{rows:{},row:{height:40,gap:{top:0,bottom:0}},columns:{percent:100,resizer:{width:10,inRealTime:!0,dots:6},minWidth:50,data:{}},expander:{padding:18,size:20,icon:{width:16,height:16},icons:{child:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><ellipse ry="4" rx="4" id="svg_1" cy="12" cx="12" fill="#000000B0"/></svg>',open:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/><path fill="none" d="M0 0h24v24H0V0z"/></svg>',closed:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"/><path fill="none" d="M0 0h24v24H0V0z"/></svg>'}},toggle:{display:!0,icons:{open:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path stroke="null" d="m16.406954,16.012672l4.00393,-4.012673l-4.00393,-4.012673l1.232651,-1.232651l5.245324,5.245324l-5.245324,5.245324l-1.232651,-1.232651z"/><path stroke="null" d="m-0.343497,12.97734zm1.620144,0l11.341011,0l0,-1.954681l-11.341011,0l0,1.954681zm0,3.909362l11.341011,0l0,-1.954681l-11.341011,0l0,1.954681zm0,-9.773404l0,1.95468l11.341011,0l0,-1.95468l-11.341011,0z"/></svg>',close:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path transform="rotate(-180 4.392796516418457,12) " stroke="null" d="m1.153809,16.012672l4.00393,-4.012673l-4.00393,-4.012673l1.232651,-1.232651l5.245324,5.245324l-5.245324,5.245324l-1.232651,-1.232651z"/><path stroke="null" d="m9.773297,12.97734zm1.620144,0l11.341011,0l0,-1.954681l-11.341011,0l0,1.954681zm0,3.909362l11.341011,0l0,-1.954681l-11.341011,0l0,1.954681zm0,-9.773404l0,1.95468l11.341011,0l0,-1.95468l-11.341011,0z"/></svg>'}},sort:{compare:null,asc:!0,activeColumnId:null,icons:{up:'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-up"><line x1="12" y1="19" x2="12" y2="5"></line><polyline points="5 12 12 5 19 12"></polyline></svg>',down:'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-down"><line x1="12" y1="5" x2="12" y2="19"></line><polyline points="19 12 12 19 5 12"></polyline></svg>'}}},scroll:{bodyClassName:"gstc-scrolling",horizontal:{width:20,minInnerSize:40,multiplier:1,precise:!0,byPixels:!0},vertical:{width:20,minInnerSize:40,multiplier:1,precise:!0,byPixels:!0}},chart:{time:{period:"day",from:0,to:0,zoom:20,leftGlobal:0,centerGlobal:0,rightGlobal:0,calculatedZoomMode:!1,onLevelDates:[],onCurrentViewLevelDates:[],onDate:[],allDates:[],autoExpandTimeFromItems:!1,alignLevelsToMain:!0,timePerPixel:0,checkCurrentDateInterval:3e5,datesCache:{timePerPixel:0,levels:[]}},calendarLevels:[t,e],grid:{cell:{onCreate:[]}},item:{gap:{top:4,bottom:4},rowTop:0,height:32,minWidth:10,overlap:!1,cutIcons:{left:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" width="1em" height="1em" style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path d="M20 9v6h-8v4.84L4.16 12L12 4.16V9h8z" fill="#ffffff"/><rect x="0" y="0" width="24" height="24" fill="rgba(0, 0, 0, 0)" /></svg>',right:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" width="1em" height="1em" style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path d="M4 15V9h8V4.16L19.84 12L12 19.84V15H4z" fill="#ffffff"/><rect x="0" y="0" width="24" height="24" fill="rgba(0, 0, 0, 0)" /></svg>'}},items:{},spacing:4},actions:it(),templates:st(),locale:{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekStart:0,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:t=>{const e=["th","st","nd","rd"],o=t%100;return`[${t}${e[(o-20)%10]||e[o]||e[0]}]`}},utcMode:!1,merge:(t,e)=>s.mergeDeep({},t,e),useLast:!0,Promise:Promise,mute:[],version:"3.37.5"}}const rt=s.mergeDeep;function ct(t){const e=lt();let o=function(t,e){return s.mergeDeep(t,e)};"function"==typeof t.merge&&(o=t.merge);const a=function(t,e,o){const a=o({},e.actions),i=o({},t.actions||{});let s=[...Object.keys(a),...Object.keys(i)];s=s.filter((t=>s.includes(t)));const n={};for(const t of s)n[t]=[],void 0!==a[t]&&Array.isArray(a[t])&&(n[t]=[...a[t]]),void 0!==i[t]&&Array.isArray(i[t])&&(n[t]=[...n[t],...i[t]]);return delete t.actions,delete e.actions,n}(t,e,o),i={config:o(e,t)};return i.config.actions=a,i}t.extend(e),t.extend(o);const dt=!0;const ht=lt().locale,ut={name:"gstc",GSTCID:D.GSTCID,isGSTCID:D.isGSTCID,sourceID:D.sourceID,fromArray(t){const e=this.GSTCID,o={};for(const a of t)a.id=e(a.id),"rowId"in a&&(a.rowId=e(a.rowId)),"parentId"in a&&(a.parentId=e(a.parentId)),"dependant"in a&&(a.dependant=a.dependant.map((t=>e(t)))),"linkedWith"in a&&(a.linkedWith=a.linkedWith.map((t=>e(t)))),o[a.id]=a;return o},stateFromConfig:function(t){return this.state=new r(ct(t),{delimiter:".",useMute:dt,maxSimultaneousJobs:1e3,Promise:t.Promise,debug:!!t.debug,useCache:!1,useSplitCache:!0,useIndicesCache:!1,defaultBulkValue:!1})},wasmStateFromConfig:function(t,e="./wildcard_matcher_bg.wasm"){return c(this,void 0,void 0,(function*(){return this.state=new r(ct(t),{delimiter:".",useMute:dt,maxSimultaneousJobs:1e3}),yield this.state.loadWasmMatcher(e),this.state}))},merge:rt,mergeDeep:rt,clone:function(t){return rt({},t)},lithtml:n,html:n,vido:l,date:(e,o=!1,a=rt({},ht))=>(t.locale(a,null,!0),o?e?t.utc(e).locale(a.name):t.utc().locale(a.name):e?t(e).locale(a.name):t().locale(a.name)),setPeriod(t){return this.state.update("config.chart.time.period",t),this.state.get("config.chart.time.zoom")},dayjs:t};
|
|
492
|
+
/**
|
|
493
|
+
* Main api
|
|
494
|
+
*
|
|
495
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
496
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
497
|
+
* @module gantt-schedule-timeline-calendar
|
|
498
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
499
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
500
|
+
* @version 3.37.5
|
|
501
|
+
* @released 2024-07-19
|
|
502
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
503
|
+
*/
|
|
504
|
+
function mt(t,e){const{api:o,onDestroy:a,state:i,update:s,StyleMap:n}=t,l=o.name,r=new Map;let c;a(i.subscribe("config.debug",(t=>c=t)));let d=!1;function h(t,e){"fullReload"!==e.options.data&&f.fullReload(e)}function u(t,e){var o;["config","config.chart.items"].includes(e.path.update)||"config.list.rows"===e.path.update&&"expanded"!==(null===(o=e.options.data)||void 0===o?void 0:o.name)||(["config.list.rows.*.parentId"].includes(e.path.listener)?function(t,e){"subscribe"!==e.type&&"sortRowsByColumn"!==e.options.data&&"fullReload"!==e.options.data&&f.partialReload(!0,e)}(0,e):function(t,e){"subscribe"!==e.type&&"fullReload"!==e.options.data&&f.partialReload(!1,e)}(0,e))}function m(t=null,e){e&&"subscribe"===e.type||e&&e.options.data&&"update-visible-items"===e.options.data||f.minimalReload(e)}function g(){r.forEach((t=>t())),r.clear(),c&&console.log("Plugins destroyed.")}var f={className:W(l),styleMap:new n({}),initializePlugins(){a(i.subscribe("config.plugins",(e=>{if(void 0!==e&&Array.isArray(e)){r.forEach(((t,o)=>{e.includes(o)||(t(),r.delete(o))}));for(const o of e){if(r.has(o))continue;let e=o(t);"function"!=typeof e&&Object.prototype.hasOwnProperty.call(e,"destroy")?e=e.destroy.bind(e):"function"!=typeof e&&(e=()=>{}),r.set(o,e)}}c&&console.log("Plugins initialized.")}))),a(g)},heightChange(){if(o.isMutedMethod("heightChange"))return;const t=i.get("config"),e=i.get("config.scroll.horizontal.width"),a=t.innerHeight-e;i.multi(!0).update("$data.chart.dimensions.heightWithoutScrollBar",a).update("$data.chart.dimensions.innerHeight",t.innerHeight).update("$data.chart.dimensions.height",t.innerHeight+t.headerHeight).update("$data.height",t.innerHeight+t.headerHeight).done(),f.styleMap.style["--height"]=a+"px",f.styleMap.style.height=t.innerHeight+t.headerHeight+"px",o.calculateVerticalScrollSize(),s()},resizerActiveChange(t){d=t,f.className=W(o.name),d&&(f.className+=` ${o.name}__list-column-header-resizer--active`),s()},generateTreeFromVisibleRows(){if(o.isMutedMethod("generateTreeFromVisibleRows"))return;const t=o.getVisibleRowsId(),e=o.getAllRows(),a=o.getRowsData(),n={},l=i.get("config.chart.items"),r={};for(const o of t){e[o];const t=a[o];n[o]=t;for(const e of t.items)r[e]=l[e]}o.makeTreeMap(n,r,!0),s()},generateTree(t=!0){let e=i.get("$data.list.rowsIds");if(!e)return;e=e.slice();const a=i.get("config.list.rows");if(!t)return f.generateTreeFromVisibleRows();o.fillEmptyRowValues(a);let s=o.getAllRows();const n=o.getRowsData(),l=i.get("config.chart.items");o.makeTreeMap(n,l),s=o.sortRowsByChildren(Object.values(s).map((t=>t.id)));i.get("config").list.rows=s,o.prepareItems(l);const r=Object.keys(s);i.update("$data.list.rowsIds",r),o.setAllRowsIdsCache(r)},prepareExpanded(){if(o.isMutedMethod("prepareExpanded"))return;const t=o.getAllRows();if(!t)return;const e=o.generateRowsWithParentsExpanded(t);i.update("$data.list.rowsWithParentsExpanded",e)},generateVisibleRowsAndItems(){if(o.isMutedMethod("generateVisibleRowsAndItems"))return;const t=o.getVisibleRows(),e=i.get("$data.list.visibleRows")||[];let a=!0;t.length!==e.length?a=!0:t.length&&(a=t.join("|")!==e.join("|"));let n=i.multi(!0);a&&(n=n.update("$data.list.visibleRows",t));const l=[],r=o.getRowsData();for(const e of t){const t=r[e];for(const e of t.items)l.push(e)}const c=i.get("$data.chart.visibleItems")||[];l.join("|")!==c.join("|")&&(n=n.update("$data.chart.visibleItems",l)),n.done(),s()},updateItemsVerticalPositions(){const t=o.getAllItems(),e=o.getItemsData(),a=o.getRowsData(),i=o.getVisibleRows(),s=[];for(const t of i){const e=a[t];if(e)for(const t of e.items)s.includes(t)||s.push(t)}for(const i of s){const s=t[i];s&&o.calculateItemVerticalPosition(i,e[i],a[s.rowId])}},getMutedListeners(){const t=[];return i.isMutedListener(h)&&t.push(h),i.isMutedListener(u)&&t.push(u),i.isMutedListener(m)&&t.push(m),t},triggerLoadedEvent(){Promise.resolve().then((()=>{const t=i.get("$data.elements.main");if(!t)return;const e=t.parentNode;if(!e)return;const o=new Event("gstc-loaded");t.dispatchEvent(o),e.dispatchEvent(o)}))},getLastPageDatesWidth(t,e){if(0===e.length)return 0;let o=0,a=0;if(e.length){if(Math.ceil(e[e.length-1].rightPx)>t)for(let i=e.length-1;i>=0;i--){const s=e[i];if(o+=s.width,o>=t){o-=s.width;break}a++}}return i.update("$data.scroll.horizontal",(t=>(t.lastPageSize=o,t.lastPageCount=a,t))),o},formatDate(e,o,a){const i=W("chart-calendar-date");return e.format({timeStart:o.leftGlobalDate.locale(a),timeEnd:o.rightGlobalDate.locale(a),vido:t,className:i,props:{date:o}})},generatePeriodDates(t,e,a,s){const n=t.period,l=e.fromDate,r=e.toDate,c=i.get("config.locale.name");let d=o.time.generatePeriodDates({leftDate:l,rightDate:r,level:a,levelIndex:s,period:n,time:e,callOnDate:!1,callOnLevelDates:!0});d=o.time.recalculateDatesWidths(d,e),s!==e.level&&(d=o.time.alignLevelToMain(s,d,e)),d=o.time.recalculateDatesPositions(d,e,!1,!1);for(const e of d)e.formatted=f.formatDate(t,e,c);return d},limitGlobal:t=>(t.leftGlobal<t.from&&(t.leftGlobal=t.from,t.leftGlobalDate=o.time.date(t.leftGlobal),t.leftGlobal=t.leftGlobalDate.valueOf()),t.rightGlobal>t.to&&(t.rightGlobal=t.to,t.rightGlobalDate=o.time.date(t.rightGlobal),t.rightGlobal=t.rightGlobalDate.valueOf()),t),setCenter(t){let e=Math.floor(t.rightGlobalDate.diff(t.leftGlobalDate,"millisecond",!0)/2);const a=o.time.getRightViewDate(t);a&&(a.width!==a.currentView.width&&(e-=(a.width-a.currentView.width)*t.timePerPixel),t.centerGlobalDate=t.leftGlobalDate.add(e,"millisecond"),t.centerGlobal=t.centerGlobalDate.valueOf())},guessPeriod(t,e){if(!t.zoom)return t;for(const o of e){const e=o.find((e=>+t.zoom<=+e.zoomTo));e&&e.main&&(t.period=e.period)}return t},getFormatAndLevelIndexForZoom(t,e=i.get("config.chart.calendarLevels")){let o=0,a=0;for(const i of e){for(const e of i)if(e.main&&t<=e.zoomTo)return a=o,{levelIndex:a,format:e};o++}if(!a)throw new Error(`There is no main date format for zoom ${t}.`)},generateAllDates(t,e){if(!t.zoom)return[];t.allDates=new Array(e.length),o.time.stopCheckingCurrentDates();const{format:a,levelIndex:i}=f.getFormatAndLevelIndexForZoom(t.zoom,e);t.level=i,t.allDates[t.level]=f.generatePeriodDates(a,t,e[i],t.level);let s=0;for(const a of e){const e=a.find((e=>+t.zoom<=+e.zoomTo));s!==t.level&&(t.allDates[s]=f.generatePeriodDates(e,t,a,s)),o.time.setDatesCacheLevel(s,t.allDates[s],t),s++}return o.time.checkCurrentDates(!0,t),t.allDates},getPeriodDatesAndCalculateViewOffsetFromAllDates(t,e){if(!t.length)return[];const a=t.filter((t=>t.leftGlobal<e.rightGlobal&&t.rightGlobal>=e.rightGlobal||t.leftGlobal<=e.leftGlobal&&t.rightGlobal>e.leftGlobal||t.leftGlobal>=e.leftGlobal&&t.rightGlobal<=e.rightGlobal));if(!a.length)return[];let i=0;e.leftGlobal>a[0].leftGlobal&&(i=o.time.getDatesDiffPx(e.leftGlobalDate,a[0].leftGlobalDate,e,!0));let s=i;const n=a.length-1;return a.map(((t,a)=>{if(t.currentView={leftPx:s,rightPx:s+t.width,width:t.width+i,leftGlobalDate:o.time.date(t.leftGlobal-i*e.timePerPixel),rightGlobalDate:o.time.date(t.rightGlobal),durationMs:0},t.currentView.durationMs=t.currentView.rightGlobalDate.valueOf()-t.currentView.leftGlobalDate.valueOf(),i=0,s+=t.width,a===n&&t.rightGlobal>e.rightGlobal){let a=0;t.currentView.leftPx<0&&(a=t.currentView.leftPx,t.currentView.leftPx=0),t.currentView.width=(e.rightGlobal+1-t.leftGlobal)/e.timePerPixel+a,t.currentView.rightPx=t.currentView.leftPx+t.currentView.width,t.currentView.rightGlobalDate=o.time.date(t.leftGlobal+t.currentView.width*e.timePerPixel)}return t}))},updateLevels(t,e){t.levels=[],t.currentZoomLevelFormatting=[];let o=0;for(const a of e){const e=a.find((e=>+t.zoom<=+e.zoomTo));if(t.currentZoomLevelFormatting[o]=e,e.main&&(t.format=e,t.level=o),e){let i=f.getPeriodDatesAndCalculateViewOffsetFromAllDates(t.allDates[o],t);t.onCurrentViewLevelDates.forEach((s=>{i=s({dates:i,format:e,time:t,level:a,levelIndex:o})})),t.levels.push(i)}o++}},updateLocale(){const t=i.get("$data.chart.time"),e=i.get("config.locale.name");let o=0;for(const a of t.allDates){const i=t.currentZoomLevelFormatting[o];for(const t of a)t.formatted=f.formatDate(i,t,e);o++}o=0;for(const a of t.levels){const i=t.currentZoomLevelFormatting[o];for(const t of a)t.formatted=f.formatDate(i,t,e);o++}s()},calculateTotalViewDurationFromDates(t){let e=0,o=0;for(const a of t.allDates[t.level])e+=a.width,o+=a.rightGlobal+1-a.leftGlobal;t.totalViewDurationPx=e,t.totalViewDurationMs=o},calculateRightGlobal(t,e,a,s,n){const l=i.get("$data.chart.time"),r=t.endOf(l.period).valueOf(),c=o.time.findDateAtTime(r,a);if(!c)return t.valueOf();let d=a.indexOf(c),h=c.leftGlobal,u=0;for(let t=a.length;d<t;d++){const t=a[d];if(h=t.rightGlobal,u+=t.width,u+s>=e)break}return h+n},allItemsOnTheLeftOrRight(t=o.getAllItems(),e=i.get("$data.chart.time")){let a=!0,s=!0;for(const o in t){const i=t[o];i.time.end<e.leftGlobal||(a=!1),i.time.start>e.rightGlobal||(s=!1)}return i.update("$data.chart.allItemsOnTheLeftOrRight",a||s),a||s},updateVisibleItems(t=i.get("$data.chart.time"),e=i.multi(!0)){const a=i.get("$data.chart.visibleItems"),s=o.getItems(a);if(!s)return e;const n=o.getAllRows(),l=o.getRowsData(),r=o.getItemsData();if(!n)return e;if(!t.levels||!t.levels[t.level])return e;let c=!1;const d=i.get("$data.chart.allItemsOnTheLeftOrRight");for(const a of s){if(!a)return e;const i=n[a.rowId],s=l[a.rowId];if(!i||!s)continue;const h=o.mergeDeep({},r[a.id]),u=h.position;let m;m=d?u:o.calculateItemPosition(a.id,r[a.id],s,t,a);for(const t in u)if(m[t]!==u[t]){c=!0;break}if(!c)for(const t in h)if(r[a.id][t]!==h[t]){c=!0;break}}return c&&(e=e.update("$data.chart.items",(t=>t),{data:"update-visible-items"})),e},calculateLeftAndRightGlobalNormally(t,e){const a=t.allDates[t.level],i=e.preciseOffset*t.timePerPixel;let s=a[e.dataIndex];if(!s&&a.length)s=a[a.length-1];else if(!a.length)return;t.leftGlobal=s.leftGlobal-i,t.leftGlobalDate=o.time.date(t.leftGlobal);let n=e.preciseOffset;const l=o.getChartWidth(!1);let r;for(let o=e.dataIndex;o<a.length;o++){const e=a[o];if(n+=e.width,n>=l){const o=(n-l)*t.timePerPixel;r=e.rightGlobal-o;break}}if(!r){r=a[a.length-1].rightGlobal}t.rightGlobal=r,t.rightGlobalDate=o.time.date(t.rightGlobal)},calculateLeftAndRightGlobalFromCenter(t,e,a){const i=o.getChartWidth(!1),s=t.allDates[t.level];if(s.length||(t.leftGlobal=t.from,t.leftGlobalDate=o.time.date(t.leftGlobal),t.rightGlobal=null,t.rightGlobalDate=null),0===a.handlePosPx){t.leftGlobal=t.fromDate.valueOf(),t.leftGlobalDate=o.time.date(t.leftGlobal),t.rightGlobal=o.time.getTimeFromOffsetPx(i,!1,t),t.rightGlobalDate=o.time.date(t.rightGlobal);const e=s[0];return a.dataId=e.id,a.dataIndex=0,a.preciseOffset=0,t}if(a.handlePosPx===a.maxHandlePosPx){t.rightGlobal=t.toDate.valueOf(),t.rightGlobalDate=o.time.date(t.rightGlobal);let e=s[s.length-1];let n=0,l=s.length-1;for(;l>=0;l--){const t=s[l];if(n+=t.width,n>=i){e=t;break}}const r=(n-i)/t.timePerPixel;t.leftGlobal=e.leftGlobal+r,t.leftGlobalDate=o.time.date(t.leftGlobal);const c=s[s.length-1];return a.dataId=c.id,a.dataIndex=s.length-1,a.preciseOffset=0,t}const n=Math.round(i/2);let l=0;for(const e of s){if(e.rightGlobal>t.centerGlobal)break;l++}if(l>=s.length||t.centerGlobal<s[0].leftGlobal||t.centerGlobal>s[s.length-1].rightGlobal)return f.calculateLeftAndRightGlobalNormally(t,a);const r=e.centerGlobal-s[l].leftGlobal;let c,d=-Math.round(r/t.timePerPixel),h=0;for(let t=l;t>=0;t--){const e=s[t];if(d+=e.width,d>=n){c=e,h=t;break}}c||(c=s[0],d=n);const u=d-n,m=Math.round(u*t.timePerPixel);t.leftGlobal=c.leftGlobal+m,t.leftGlobalDate=o.time.date(t.leftGlobal);let g,p=-u;const w=s.length;for(let t=0;t<w;t++){const e=s[t];if(p+=e.width,p>=i){g=e;break}}g||(g=s[s.length-1],p=i);const b=p-i,v=Math.round(b*t.timePerPixel);return t.rightGlobal=g.rightGlobal-v,t.rightGlobalDate=o.time.date(t.rightGlobal),a.dataId=c.id,a.dataIndex=h,a.preciseOffset=-u,t},updateFromToBasedOnDates(t){const e=t.allDates[t.level];e.length&&(t.from=e[0].leftGlobal,t.fromDate=o.time.date(t.from),t.to=e[e.length-1].rightGlobal,t.toDate=o.time.date(t.to))},recalculateTimes(t){if(o.isMutedMethod("recalculateTimes"))return;const a=i.get("config.chart.time"),n=e({},a),l=i.get("$data.chart.time");n.allDates=l.allDates||new Array(n.levels.length),n.datesCache=l.datesCache||{timePerPixel:0,levels:[]};const r=i.get("config.chart.items");if(!(n.from&&n.to||Object.keys(r).length))return;if("number"!=typeof n.from&&void 0!==n.from||"number"!=typeof n.to&&void 0!==n.to)throw new Error("[gantt-schedule-timeline-calendar] 'config.chart.time.from' and 'config.chart.time.to' must be a number (unix epoch milliseconds).");if(!n.from){let t=1/0;for(const e in r){const o=r[e];t>o.time.start&&(t=o.time.start)}n.from=t}if(!n.to){let t=0;for(const e in r){const o=r[e];t<o.time.end&&(t=o.time.end)}n.to=t}n.fromDate||(n.fromDate=o.time.date(n.from)),n.toDate||(n.toDate=o.time.date(n.to));const c=i.get("$data.scroll.vertical.visible"),d=o.getChartWidth(c),h=i.get("config.chart.calendarLevels"),u=i.get("$data.scroll.horizontal");n.calculatedZoomMode||o.time.recalculateFromTo(n),n.leftGlobal||(n.leftGlobal=n.from);const m=t.filter((t=>"items-out-of-view"===t.name));let g=1/0,p=0;if(m.length)for(const t of m)g>t.from&&(g=t.from),p<t.to&&(p=t.to);let w=!1;if((t.find((t=>"reload"===t.name))||t.find((t=>"all"===t.name))||t.find((t=>"from"===t.name))||t.find((t=>"to"===t.name))||t.find((t=>"zoom"===t.name))||t.find((t=>"calculated-zoom-mode"===t.name))||t.find((t=>"align-levels"===t.name))||t.find((t=>"auto-expand-time"===t.name))||t.find((t=>"locale"===t.name)))&&(w=!0),n.calculatedZoomMode&&d){n.totalViewDurationMs=o.time.date(n.to).add(1,n.period).startOf(n.period).diff(n.from,"millisecond"),n.timePerPixel=n.totalViewDurationMs/d,n.totalViewDurationPx=n.totalViewDurationMs/n.timePerPixel,n.zoom=Math.log(n.timePerPixel)/Math.log(2),o.resetHorizontalScroll(),w&&f.generateAllDates(n,h),f.calculateTotalViewDurationFromDates(n),n.timePerPixel=n.totalViewDurationMs/d,n.zoom=Math.log(n.timePerPixel)/Math.log(2);for(let t=0;t<n.allDates.length;t++)o.time.recalculateDatesWidths(n.allDates[t],n),o.time.recalculateDatesPositions(n.allDates[t],n),o.time.setDatesCacheLevel(t,n.allDates[t],n);f.calculateTotalViewDurationFromDates(n),n.leftGlobal=n.from,n.leftGlobalDate=o.time.date(n.leftGlobal),n.rightGlobal=n.to,n.rightGlobalDate=o.time.date(n.rightGlobal)}else{n.timePerPixel=Math.pow(2,n.zoom),m.length&&n.autoExpandTimeFromItems&&(n.from=g,n.to=p),n.fromDate=o.time.date(n.from).startOf(n.period),n.from=n.fromDate.valueOf(),n.toDate=o.time.date(n.to).endOf(n.period),n.to=n.toDate.valueOf(),w&&f.generateAllDates(n,h),m.length&&n.autoExpandTimeFromItems||f.updateFromToBasedOnDates(n),f.calculateTotalViewDurationFromDates(n);const e=i.get("$data.chart.time");t.find((t=>"zoom"===t.name))&&!t.find((t=>"all"===t.name))&&e.centerGlobalDate?(f.calculateLeftAndRightGlobalFromCenter(n,e,u),o.calculateHorizontalScrollSizeAndPosFromDates(n.totalViewDurationPx,n,u,!1)):(o.calculateHorizontalScrollSizeAndPosFromDates(n.totalViewDurationPx,n,u,!1),f.calculateLeftAndRightGlobalNormally(n,u))}f.updateLevels(n,h),f.limitGlobal(n),n.leftPx=0,n.rightPx=d,n.width=d;const b=n.levels[n.level];if(b&&b.length){const t=b[b.length-1];n.leftPx=b[0].leftPx-u.preciseOffset,n.rightPx=t.rightPx,n.width=n.rightPx}f.setCenter(n);let v=i.multi(!0);v=v.update("config.chart.time",(t=>((t=Object.assign({},t)).zoom=n.zoom,t.level=n.level,t.period=n.format.period,t.leftGlobal=n.leftGlobal,t.leftGlobalDate=n.leftGlobalDate.clone(),t.centerGlobal=n.centerGlobal,t.rightGlobal=n.rightGlobal,t.rightGlobalDate=n.rightGlobalDate.clone(),t.from=n.from,t.to=n.to,t.autoExpandTimeFromItems=n.autoExpandTimeFromItems,t.timePerPixel=n.timePerPixel,t))),f.allItemsOnTheLeftOrRight(o.getAllItems(),n),v=v.update("$data.chart.time",n),v=f.updateVisibleItems(n,v),v=v.update("$data.chart.time.recalculateTimesLastReason",t);const D=t.find((t=>"set-scroll-left"===t.name));v=v.update("$data.scroll.horizontal",u,{data:D?"set-scroll-left":void 0}),v.done(),s();const y=t.find((t=>"chart-width"===t.name));y&&0===y.oldValue&&0!==y.newValue&&setTimeout(f.triggerLoadedEvent,0)},minimalReload(t){if(o.isMutedMethod("minimalReload"))return;o.muteMethod("minimalReload");const e=f.getMutedListeners();i.mute(h),i.mute(u),i.mute(m),i.collect(),o.calculateVisibleRowsHeights(),f.generateVisibleRowsAndItems(),f.updateVisibleItems().done(),i.executeCollected(),e.includes(h)||i.unmute(h),e.includes(u)||i.unmute(u),e.includes(m)||i.unmute(m),o.unmuteMethod("minimalReload"),s()},partialReload(t=!0,e){if(o.isMutedMethod("partialReload"))return;o.muteMethod("partialReload");const a=f.getMutedListeners();if(i.mute(h),i.mute(u),i.mute(m),t){const t=i.get("$data");t.list.rows={},t.chart.items={}}i.collect(),f.generateTree(t),f.prepareExpanded(),o.measureRows(),o.calculateVerticalScrollSize(),f.minimalReload(e),i.executeCollected(),a.includes(h)||i.unmute(h),a.includes(u)||i.unmute(u),a.includes(m)||i.unmute(m),o.unmuteMethod("partialReload"),s()},fullReload(t){if(o.isMutedMethod("fullReload"))return;i.update("$data.reloading",!0),o.muteMethod("fullReload");const e=f.getMutedListeners();i.mute(h),i.mute(u),i.mute(m),i.collect(),f.partialReload(!0,t),f.recalculateTimes([{name:"reload"}]),i.executeCollected(),e.includes(h)||i.unmute(h),e.includes(u)||i.unmute(u),e.includes(m)||i.unmute(m),o.unmuteMethod("fullReload"),i.update("$data.reloading",!1),s()}};a(i.subscribeAll(["config.innerHeight","config.headerHeight","config.scroll.vertical.width"],f.heightChange,{group:!0,bulkValue:!1})),a(i.subscribe("$data.list.columns.resizer.active",f.resizerActiveChange)),a(i.subscribeAll(["config;","config.chart.items;","config.list.rows;","config.list.rows.*;","config.chart.items.*;"],h,{group:!0,bulkValue:!1})),a(i.subscribeAll(["config.list.rows.*.parentId","config.chart.items.*.rowId","config.list.rows.*.expanded"],u,{group:!0,bulkValue:!1})),a(i.subscribeAll(["config.chart.items.*.time","config.chart.items.*.height","config.chart.items.*.top","$data.chart.dimensions.heightWithoutScrollBar","$data.list.rowsHeight","config.chart.item"],m,{group:!0,bulkValue:!1})),a(i.subscribeAll(["$data.scroll.vertical.dataIndex","$data.scroll.vertical.preciseOffset"],(function(){i.collect(),f.generateVisibleRowsAndItems(),o.calculateVisibleRowsHeights(),f.updateItemsVerticalPositions(),f.updateVisibleItems().done(),i.executeCollected()}),{group:!0,bulkValue:!1})),a(i.subscribe("config.list.sort",(t=>{const e=i.get(`config.list.columns.data.${t.activeColumnId}`);e&&o.sortRowsByColumn(e,t.asc)}))),a(i.subscribeAll(["config.chart.items.*.time","config.chart.items.*;","config.chart.items.*.rowId"],(function(t,e){e.options.data&&"updateVisibleItems"===e.options.data||f.updateVisibleItems().done()}),{group:!0,bulkValue:!1}));let p=i.get("config.locale.weekStart");a(i.subscribe("config.locale",((t,e)=>{"subscribe"!==e.type&&(t.weekStart===p?f.updateLocale():(p=t.weekStart,f.recalculateTimes([{name:"locale"}])))})));const w={utcMode:!1,initialized:!1,zoom:0,period:"",scrollAbsolutePosPx:0,scrollTime:0,chartWidth:0,from:0,to:0,dataFrom:0,dataTo:0,calculatedZoomMode:!1,alignLevels:!0,autoExpandTime:!0};return a(i.subscribeAll(["config.utcMode","config.chart.time","$data.chart.time","config.chart.calendarLevels","$data.scroll.horizontal","$data.chart.dimensions.width","config.chart.items.*.time"],((t,e)=>{const o=function(t){const e=i.get("config.utcMode"),o=i.get("config.chart.time"),a=i.get("$data.chart.time"),s=i.get("$data.scroll.horizontal"),n=i.get("$data.chart.dimensions.width"),l=i.get("config.chart.time.calculatedZoomMode"),r=Object.assign({},w);w.utcMode=e,w.zoom=o.zoom,w.period=o.period,w.from=o.from,w.to=o.to,w.dataFrom=a.from,w.dataTo=a.to,w.scrollAbsolutePosPx=s.absolutePosPx,s.data&&(w.scrollTime=s.data.leftGlobal),w.chartWidth=n,w.calculatedZoomMode=l,w.alignLevels=o.alignLevelsToMain,w.autoExpandTime=o.autoExpandTimeFromItems;const c=[];return w.initialized||(w.initialized=!0,c.push({name:"all"})),e!==r.utcMode&&c.push({name:"utc-mode",oldValue:r.utcMode,newValue:e}),l!==r.calculatedZoomMode&&c.push({name:"calculated-zoom-mode",oldValue:r.calculatedZoomMode,newValue:l}),o.zoom!==r.zoom&&c.push({name:"zoom",oldValue:r.zoom,newValue:o.zoom}),o.period!==r.period&&c.push({name:"period",oldValue:r.period,newValue:o.period}),o.from!==r.from&&c.push({name:"from",oldValue:r.from,newValue:o.from}),o.to!==r.to&&c.push({name:"to",oldValue:r.to,newValue:o.to}),a.from!==r.dataFrom&&c.push({name:"from",oldValue:r.dataFrom,newValue:a.from}),a.to!==r.dataTo&&c.push({name:"to",oldValue:r.dataTo,newValue:a.to}),"set-scroll-left"===t.options.data&&c.push({name:"set-scroll-left"}),s.absolutePosPx!==r.scrollAbsolutePosPx&&c.push({name:"scroll-pos",oldValue:r.scrollAbsolutePosPx,newValue:s.absolutePosPx}),w.scrollTime!==r.scrollTime&&c.push({name:"scroll-time",oldValue:r.scrollTime,newValue:w.scrollTime}),n!==r.chartWidth&&c.push({name:"chart-width",oldValue:r.chartWidth,newValue:n}),w.alignLevels!==r.alignLevels&&c.push({name:"align-levels",oldValue:r.alignLevels,newValue:w.alignLevels}),w.autoExpandTime!==r.autoExpandTime&&c.push({name:"auto-expand-time",oldValue:r.autoExpandTime,newValue:w.autoExpandTime}),c}(e);o.length&&f.recalculateTimes(o)}),{group:!0,bulkValue:!1})),a(i.subscribe("config.chart.items.:itemId.time",(t=>{f.allItemsOnTheLeftOrRight();const e=i.get("$data.chart.time"),a=o.getAllItems();let s=1/0,n=0;for(const o of t){const t=a[o.params.itemId];if(!t)return;if(t.time.start<e.from||t.time.end>e.to){let o=e.from,a=e.to;return t.time.start<e.from&&(o=t.time.start),t.time.end>e.to&&(a=t.time.end),f.recalculateTimes([{name:"items-out-of-view",from:o,to:a}])}t.time.start<s&&(s=t.time.start),t.time.end>n&&(n=t.time.end)}if(0===e.leftGlobal&&0===e.rightGlobal)return f.recalculateTimes([{name:"items",from:s,to:n}])}),{bulk:!0,bulkValue:!1})),a(i.subscribe("config.chart.time.checkCurrentDateInterval",(t=>{i.get("$data.chart.time").checkCurrentDateInterval!==t&&(i.update("$data.chart.time.checkCurrentDateInterval",t),o.time.stopCheckingCurrentDates(),o.time.checkCurrentDates(!0))}))),t.api.main=f,f}
|
|
505
|
+
/**
|
|
506
|
+
* Main component
|
|
507
|
+
*
|
|
508
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
509
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
510
|
+
* @module gantt-schedule-timeline-calendar
|
|
511
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
512
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
513
|
+
* @version 3.37.5
|
|
514
|
+
* @released 2024-07-19
|
|
515
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
516
|
+
*/function gt(t,e){const o=ft();return gt=function(e,a){let i=o[e-=477];if(void 0===gt.qGpBcD){const e=function(t,e){let o,a,i=[],s=0,n="";for(t=function(t){let e="",o="";for(let o,a,i=0,s=0;a=t.charAt(s++);~a&&(o=i%4?64*o+a:a,i++%4)?e+=String.fromCharCode(255&o>>(-2*i&6)):0)a="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(a);for(let t=0,a=e.length;t<a;t++)o+="%"+("00"+e.charCodeAt(t).toString(16)).slice(-2);return decodeURIComponent(o)}(t),a=0;a<256;a++)i[a]=a;for(a=0;a<256;a++)s=(s+i[a]+e.charCodeAt(a%e.length))%256,o=i[a],i[a]=i[s],i[s]=o;a=0,s=0;for(let e=0;e<t.length;e++)a=(a+1)%256,s=(s+i[a])%256,o=i[a],i[a]=i[s],i[s]=o,n+=String.fromCharCode(t.charCodeAt(e)^i[(i[a]+i[s])%256]);return n};gt.bpfXOb=e,t=arguments,gt.qGpBcD=!0}const s=e+o[0],n=t[s];return n?i=n:(void 0===gt.aNwiTa&&(gt.aNwiTa=!0),i=gt.bpfXOb(i,a),t[s]=i),i},gt(t,e)}function ft(){const t=["DmkseamPzsjs","jCkCmM/cGaK","WOpdGqJdL8kM","jgrHDgeUzgLTzw5ZAw9UC1bHCMvUDa","DKHTj8oUW4NdLHbF","WQ8bk2ddHIOnWQ5qWPC","WPJdJqldHmk6WOu","cMRcTmotW5a","C3rHCNrZv2L0Aa","zg9JDw1LBNq","WOSHeSoN","W7X8eSksWR0RWQxcRIJcJmoOW7NdPd0tWQZcRY9lW6Ll","p2BdOSkgtW","zgvJCNLWDa","Dg9W","kmkJWOlcUSkRjCoJ","WPHxyr88","WODQmKDaCCkLySkAWQH6e8kN","WRKbWP1UEmkJnq","lSk0WRZdRghcU3eZmxdcJSkiFCozWQ7dNmo4W6GYs8oKmLbU","CSoAo1fXaqiPdmo+W58eiZZdR8kshCkyW7FdPaqweSkxW6ddPqFdVCo+mCkcgW","WPxdRgmSW6y","W4fEqWldRCkt","W6BcJmoGWRG","WOSEEmobWQ/cNCo9WRW","W6FdT1tdQmk3WRpdUW","WOW9hCoXW4hdSMtcRem","omk1WP/cVG","vcSO","WOddVhS","CNvSzxm","WRLpBdS1sSo9wa","cGXNx8kuW6zXetfJxq","C3vWCg9YDa","DxnLCL9Hz2vUDa","W4C4fConW7FdMfu","DhLWzq","W4WdAKBdNMVcOZGYWOnKESkKkCknW7unW5/cIhOgvmo7b2BdRmkJcCosW7VcJ1y","WOhdMaJdGSk6WOG","W49VW53dLZfxW7JdI1e","nmoKata","mti2ody1CMLeDhfZ","WO4lBCoeWQ7cHCoYWRJdSrW","W4NcOCowW5i","zdbDoW","AgvPz2H0","kSk+WOdcTSkhjCoKzmo9nCoh","WQOhWPr7Eq","tgLJzw5ZzsbRzxKGy2HLy2SGBwvJAgfUAxnTig5VDcbSB2fKzwqGkhrYEsbNyw50Dc1Zy2HLzhvSzs10Aw1LBgLUzs1JywXLBMrHCI9KAxn0l2DZDgmUD2fZBs5LC20UBwLUlMPZks4","WO3cMSkhW6xdRa","y29UzMLNlMnVBxbVBMvUDhmUq2HHCNq","o8oAygnKxbyOxSoNW44PpW","WPVcJSkFW6u","Aub5pCogW5pdHWDccZm","pgjYic8+","DxbKyxrLCW","AI1biG3cThFdK8k4vmkZ","DKbRoG","WQhdLmo9W7Xg","W5nDuWdcTmktBmkVWPKr","sJL6cG7cKmku","zMLSztO","WQ3cL8oKWPXFWR/cL8osxCoGwsldR8obWRpdOmo1WPqMoJBcKmkwW4hdT8oJEvZcL8kvW5ldGuVdINRdU8oIW6BdM8knW4VdHrKlWOyhW78ZWQddHmkGWRX1W5ymW7xdTSk8W47dH2PZW4ZdKxTsBYRdKCo5m8oiWQRdRdbhW6NdM2ddLKLPWRmzWRddUg3dOmkAnafpW6uaWRRcGqVdPSoPW7NdJ8oWW4FcUtfxWOXQWPPqoZ0vWQlcVGhdRwhcLCouka","WQTTeCkvWR93WQNcOcG","W6OCwCk6WPuBnmkfoSkuW5ZdRmkIoSk0W5tdQmoaasZcTM9Uh08WusanWR7cIG","pwJdPCkwrcmp","Dg9ju09tDhjPBMC","AdzDlcFcTg3dHmkYrq","mJC3mLjusNfSCG","B3jPz2LUCW","WOlcKmkzpmkWW6qd","Ce95kmoPW5JcJGDmjtK","fSoIWRqHWPO+b0FcSSkP","WQSpWPX6Da","W4H4W4VdGJDDW6u","omkjcCkgWOddKx0","WPVcMCkqWPNdLSk5WOyI","W6WeAfdcKfdcVZ08WP9MpSksomoi","cmonFvfR","CgfYC2vFBgLJzw5Zzv9RzxK","zgvZDhjVEq","y05MjCoGW4O","D1rMlmo8","Dg9tDhjPBMC","W7JdLCoiW6lcRq","sw52ywXPzcbSAwnLBNnLigTLEsbBC2LNBMf0DxjLig1PC3nPBMDDlG","WPhcG8khjSkN","vc16","CgfYC2u","d8kzWRRcRMHSW50FW5m","cWTNxSkrWPOXjdPkvSk+W6u","nmolyea9avy","WRmMmmk7","BwvZC2fNzq","nmonCvy","W7JdQ0FdVCk2WRldQG","Ag9YAxPVBNrHBa","fceQumo0W6pdQ3S","cWBcICoiW4WtWOzFiCkN","WQmWlCk/D0zL","WPdcKmkbla","WQBdKmo6W6TCWP7cRW","C3vIC2nYAwjL","lCk+WR3dSMhcSh0","yw5Jzxn0B3jpCMLNAw5Z","r1nuqW","y2f0y2G","AhrTBa","imkChSkuWPxdKW","WO7cMCkc","DMvYDgLJywW","WOVcISkyW7q","pw0yD37dR3hdImkvrCkXWPO","WORcLeuOqN3cGgaqbItcJ8oU","cSkwmNZcKq86ldhdLIBcLd3cU14rW7ddLCk5t8kwpSkX","ggOGDmkv","AtfApshcV3a","q1nq","rs8WW4fgW7KmWOnKDW","WPFcNCkuoSkMW6ueWRSP","W7HLAH3cUmkGWOqshhNdVIJdTW","ntGXndG4mNHiCeLzwa","kgBdP8kfsaThW6VdJH1wWO0yumksWQhcT1f/Dqe","DMfSDwu","WQa6na","wZOOW5HrWPznW5HQAmoGm3ZdPSkeWPFdPMa5W7hdUmo5pmkeW6VdVeZdIIVcUsHCWQxdUCozWOm","W6NdJ8okW7pcU8kkWQy","DMvY","WRNcS8kLWQG","D2LKDgG","WPxdMbZdJ8kNWO5Xamk/BmocnCoDwMyZWQ5jEmooW4tcSxlcOwldTbpdVmkKaCkNWR/dQG","zw5JCNLWDa","Aw5PDgLHBgL6zvbSDwDPBNm","BSkmhWyO","zg9TywLU","WPVcN8oGWPPz","cIxdShZcHmkrmCoZh8kAzJhcLSkEEuHAW5elvq","WOOpCCobWQVcS8o5","rZjHpmolkSkNxgqFkJ46wGZdR8kdWR1IqfRdHmkAvwfOtCkZWRxdMgpcTMPLW6pdG25aiwqyE8oKW5LQW5iLDCo9bCk4W7SDW57cQLqHWRj9W5GPWOZdKmk1WO93nZ8qWQddMMhcJCoSW7zlleHDwSojwmo5WRBdI2JdPSoDW6iutsxcVCoFhCo+kg52WR4iEI9wxCkgbWjhpSkGfKi+Ar8Bica0u0RdGSoZW5lcM3iHWOqWW6H3qCoSWPNdU15vW6ldTCkDbmo1WRVcSstcRCoJlmoplCkqWPBdN3ddIrxcJ8oWcraFmc8IW7/cMCkqW7BdISoKgwPAuCoIW7pdL8kXW6ddIdNcHSkKcCoeCa7dJCoLW7bwWOb5W5tcKCklW5xdP14ntuSaW6NdJ8kFW79Tu2tdGh5fumkVWOu6fmoGWRPDWO4npt3cNmofsW53rCo1AbhdILGoW6BcICkWpSk8nmkUEXfFuSk6WP7cMCkaWPTcWOpdRW81mXJdLI4HBSoLld7dTXpdQG","y3jLyxrL","qrFcLGZdRqLPWQzl","BgfZDeLUzgv4t2y","WR99bW","DgHLBG","C2HPzNrlzxK","y29UzMLNlMLUBMvYsgvPz2H0","p8oqELzUsvC3uCozW4qJj0hcQSkLomkuWRddRW5psSoiWOVcSaFdPSkUbCkaxCoS","DMfSAwrvBNrPBa","dNy/CSkjbSkmFK4L","gCk0WRVdSYdcU3eQmvpcKSkylSoxWPZdJCk9W6qTlSo8oeO6W4f7kG7cOrJcKCkTumk/nKz+lJ3dUqOzrrO4F8oQFcadc20UaCkUWPZcVSkWWOBdGCkAs8oHrrTAWQnjrSo+WQnwW5fFW5GEFCkso8khWPVdHshdSuJcItq","icKU","zgLYzwn0AxzL","WRFdGmkTma","pwZdU8kkrXu","WOOMemoGW5hdPx/cUem","WOldJr7dKmkNWOj+","CgfYzw50","W5vDvaRdVSky","y29UzMLNlMnVBxbVBMvUDhmUtgLZDa","tuO6dCoqW4L1","ft0SwG","rJS1yYzJw1G0i2u2ps08EG","tLSYgCob","yxbWBgLJyxrPB24VEc13D3CTzM9YBs11CMXLBMnVzgvK","ASkvfXS0","C3vIC3rY","cY4LvCoLW5ldOhWrcG","WO5qCqm6rmo+d8k5","y29UzMLNlNnJCM9SBc52zxj0AwnHBc5IEvbPEgvSCW","mtKXmJG5n0juBwHlEq","WOFdJrJdSmkTWP9/gmk6v8odAG","bLpdHeZdVJPgWRLtDG","WRCbWPLH","WONcKf8S","cbFcGCoaW5WJ","s18Qp8ohW55PlW50Dmkx","DwX0Aw1HDguTB25LlxLLyxi","WPPwzXnJu8oLe8kXW6S","C0bMpmoQ","WOZcKSkcWO7dJCkUWPa","emowD1vPxrXKwSokW5HVlHFcSSkJomkyWQ7cRG","z2v0u2nYB2XSvg9W","gZjMW5zs","y29UzMLNlMrLyNvN","WPWVmSkXBLTlEGvbWPtcMSkSWQyBl8oJWPZcGWj8EL/cPJ7cT8klWPZdGaVcVKGzW7pdItzfDg3cTSo+tCoJFCk9hrhdMSo7z10uWOL0WOSoWQLpWR/dQ8oMWO1NW6K1CJhdRmkQANRcHalcJmk4s0NdMmktW6BdKaHTq8o1r2pcVW3dICoeemoTe19idq7cPH/dSmodEHmOW7/cKCoMrmoYWO4o","Ag9ZDa","WRehWPnQF8k+iW","p2yxF3VdOKJdRSkyE8kQWQG","h3RcRa","WQ0CWP9RzmkUmG","C2v0u2nYB2XSvg9W","ACkufGe","zK5Kl8oMW5RcJrfznJRdOqJcUSkcW6ZcLaNcLCoLpZxcSCknxu/dUcJdJg0GW4RcPa","CMvMzxjYzxi","b2ddQSkgtX8mWQFdGqfqWOmovSkdWO/cT0P9CWhdNmkFW7OcW5ZdJK1ho2xcPmo/W5FcUmo5qNxdImkouCkTAhr6wgvd","C3rHDhvZ","y29UzMLNlMHLywrLCKHLAwDODa","W78oDW","WORcN8kpW6hdQ8oc","DxbKyxrL","D2fZBuLUAxrPywXPEMvK","fCoJWQy7","W64wq8kiWPurFW","ChvZAa","WQTgBa","WRmhi3xdMZC","WQGaWP9TySkOnmotFW","W4e3DYmnk8o7C8kXWPnwmW","W6uAvmk5WPipFW","B2zMC2v0v2LKDgG","Dg9Rzw5FD2fZ","nZi0odK3nLzZr0PPvW","sw52ywXPzcbSAwnLBNnLigTLEs4","BwfW","kmo4cti","W6pcQmotWPFcJgSv","WR8AjhtdMZ50WQTnWPXuymoKzmkbW6ddNW","jSkFoNVcKruzAaBdHY0","WPldQwSOW6eS","jY7dTx7cMSkrjCkNgSkCAW","BwfPBG","W7ZcLSo/WQL6","WQvnEZ4Tt8oStG","W7WoCehcJgdcTq","vgHPCYbKB21HAw4GAxmGBM90ihjLz2LZDgvYzwqGjW","lCkUWQldTwNcP3qGmu8","y29UzMLNlNzLCNnPB24","C3vIC3rYAw5N","lI7dTw7cICkFma","kIxdPxhcNCkCmmkG","W6rIBsVcQCkKWO4","DgLTzq","zw50CMLLCW","zMv0y2G","sw52ywXPzcb0B2TLBI4","WPrlCbW7uSoYeG","mZK5mdm4s09jsMPb","W6usrmkOWRusFSktiCkPW5u","eadcKGRdJubPWQrAACkKWODqW7lcQM7cRKfO","WPVcGmkgW6hdTSojW4u","drlcLSoj","F2Kkl8kEWP88","zM9YrwfJAa","DMfSDwvFBNvT","WObkAYy9tW","W7RcVCozWPhcJgy","W4WCiKj2d8kGi8kkW7roW6al","B2jZzxj2zq","yxnZAwDU","WQ1RfSkuWOnKWQFcPYpcLq","ywjZB2X1DgvqB3nqEa","C3rYAw5N","W6ldLmoqW7FcRCoEW713","W4pdJSosW6BcSSknWRz4WQTiWQlcIsqAlSoBlCo7WPVdTu1dW5/dQmkmkKhcH8oPW6zEqrFcRCkczhG","zw5KC1DPDgG","cIxdShZcHmkrmCoZh8kAzJhcLSkEEuHAW5elw8okW4RcH8k+bhCBWPrXhCkluW7dNSkCW5fOcW","BxvSDgLWBgLLCG","WOhcMCkFWPVdJmk/","WOhcImkcWOZdL8oXW4X/W6yRlcFcV8kfx8oVEYPLDX5orbOvWQZcRsvHWRrBnmoxW6VcSmoKcb4OnmoelG","omkJWP/cL8kNpCo1ESoqp8ozsmk0WQy+","WOZcN0GOq2JcM3CmgclcNmo0lsu","AYXAlgxcV3hdK8k+qW","WP7cMeWJuwJcGxCM","CMvWBgfJzufSBa","l8olzLLPsraIsW","W50NDXyk","W6BdP0pdSCkRWRxdQSkxkxnRW5NdQ2xdS8oPpG","W6b0W5VdKYTbW7NcQK7cSSoUb0m5qSoHWPCZde8jq8oOf8kDybTxWQVcJ8kUemoFWOadWOe","tgLJzw5ZzsbRzxKGy2HLy2SGBwvJAgfUAxnTig5VDcbSB2fKzwqUifrOzsbdB250zw50lvnLy3vYAxr5lvbVBgLJEsbOzwfKzxiGzg9LCYbUB3qGywXSB3CGDgHLihDHC20GzMLSzsb0BYbIzsbJB21WAwXLzc4Gvhj5ihrVigfKzcaND2fZBs11BNnHzMuTzxzHBcCGAgvHzgvYCYb0BYb5B3vYienVBNrLBNqTu2vJDxjPDhKTug9SAwn5ihj1BgvZlG","Dg9Rzw4","sIL+kqlcKmkpgGZdGMem","wIr1W41blGFcJtXqW4u6W5JdRrP+","WOVcGmkaW6xdSq","ohbQt1vywa","BgvUz3rO","zNvUy3rPB24","y3vZDg9Tzxi","tgLJzw5ZzsbRzxKGy2HLy2SGzxjYB3i","zg9TywLUCW","zNjVBuvUDhjPzxm","qSkMFCk8W6GmW6BdTSkBtvW","nHaZE8k6WOVcLavIlHJdLbu","WOpcKmkgjmkCW4umWQiLWRxcNIXCpr8","rXhcKq3dJXXLWQPA","W6OoC1NcN2ZcQq","tgLZDgvK","fc99W5C","hNRcRmovW4S","W59OW5RdHszaW7xdQedcLSo7sW","mZNdQxNcNCkBiq","cmkcWRtcOwu","AM9PBG","W7ZdHCow","mMzqCwfAyG","oLaFrq","W6mCxSkY","zM9SBg93","W6hdSKddUCkSWQq","CgfYzw50rwXLBwvUDa","C2HPzNq","y29UzMLNlMf1Dg9jBM5LCKHLAwDODa","y29UzMLNlMXPC3qUCM93sgvPz2H0","uceYW45lW4TmWPzUB8o9pZZdU8opWO/dTwy5","DLrOoSoSW4/dIGbF","AhjLzG","B2zMC2v0sgvPz2H0","y29UzMLNlNnJCM9SBa","dfRdNCkGgW","htvNW41pBqBcLG","wK5IsSoYW4WPEGWulCosW7XeWPvn","Aw5JBhvKzxm","hmo5j8oQWRy1W7q","WRa+m8kZv0z/lIbjWPVcLSk4WRaA","DxnLCKfNzw50","C2v0u2nYB2XStgvMDa","WP7cGuCKra","B1jLjW","WRubWOn7","uahcGb3dNGD8WRXwA8kV","hhdcTCoxW4PAdq","dmkYWQ3dPg7cPh1PpfZcKSoDA8oeWONdNCoVW6G6ia","tgLJzw5ZzsbRzxKGBM90igzVDw5KifTJB25MAwCUBgLJzw5ZzuTLEv0","C3bSAxq","zgf0yuLUzgv4","mCo1hY92W7Hz","WPRcMCkcWQ/dH8k5WOW8W60upsldPq","W71HCIFcV8knWP4qbfZdTW","dcvIW5XsCWy","WQddG8k7iSoJfHvN","z2v0","WQG5jSkTE1XEpYbpWP/cIW","CMvWBgfJzq","uMvNAxn0zxjLzcbKB21HAw5ZoIbBia","jSkyg8khWPxdHu8OzmoK","mY4ZnY41","Dg9Wtgv2zwXeB21HAw5Z"];return(ft=function(){return t})()}function pt(t,e){const o=ft();return pt=function(e,a){let i=o[e-=477];if(void 0===pt.NboDuq){pt.LUMqce=function(t){let e="",o="";for(let o,a,i=0,s=0;a=t.charAt(s++);~a&&(o=i%4?64*o+a:a,i++%4)?e+=String.fromCharCode(255&o>>(-2*i&6)):0)a="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(a);for(let t=0,a=e.length;t<a;t++)o+="%"+("00"+e.charCodeAt(t).toString(16)).slice(-2);return decodeURIComponent(o)},t=arguments,pt.NboDuq=!0}const s=e+o[0],n=t[s];return n?i=n:(i=pt.LUMqce(i),t[s]=i),i},pt(t,e)}function wt(t,e){const{api:o,state:a,onDestroy:i,Actions:s,createComponent:n,html:l,onChange:r,update:b}=t;let v;const D=mt(t,d);D[X(1113,1145)]();const y=S(1074,1182);let P;i(a[O("Ze%N",122)](O("lFqm",361),(t=>P=t)));const x=l`
|
|
517
|
+
<br />
|
|
518
|
+
If you are using trial version, please generate key
|
|
519
|
+
<a href="https://gstc.neuronet.io/free-key" target="_blank">here</a>. Otherwise, please contact with your developer
|
|
520
|
+
or send mail to us at <a href="mailto:neuronet.io@gmail.com">neuronet.io@gmail.com</a>
|
|
521
|
+
`,W=l`
|
|
522
|
+
<div class="gstc-error">
|
|
523
|
+
<div style="font-weight: bold;margin-bottom:10px;">[ Connection error ]</div>
|
|
524
|
+
An error occurred while trying to connect with license services for
|
|
525
|
+
<a href="https://github.com/neuronetio/gantt-schedule-timeline-calendar" target="_blank"
|
|
526
|
+
>gantt-schedule-timeline-calendar</a
|
|
527
|
+
>
|
|
528
|
+
component.<br /><br />
|
|
529
|
+
If you are using <span class="gstc-code">Content-Security-Policy</span> header make sure you have added
|
|
530
|
+
<span class="gstc-code">https://gstc.neuronet.io</span> address after space.<br />
|
|
531
|
+
Example: <span class="gstc-code">Content-Security-Policy: connect-src self https://gstc.neuronet.io</span><br />
|
|
532
|
+
More info
|
|
533
|
+
<a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy" target="_blank"
|
|
534
|
+
>here</a
|
|
535
|
+
>
|
|
536
|
+
and <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP" target="_blank">here</a><br /><br />
|
|
537
|
+
If that doesn't help please contact your developer, search for similar
|
|
538
|
+
<a href="https://github.com/neuronetio/gantt-schedule-timeline-calendar/issues">issues here</a> or create one. You
|
|
539
|
+
can also contact us at <a href="mailto:neuronet.io@gmail.com">neuronet.io@gmail.com</a>
|
|
540
|
+
</div>
|
|
541
|
+
`;function C(t,e){return pt(t- -718,e)}const $=l`
|
|
542
|
+
<div class="gstc-error">
|
|
543
|
+
<div style="font-weight:bold; margin-bottom: 10px;">
|
|
544
|
+
The gantt-schedule-timeline-calendar component will not work with local files (protocol file: ///)
|
|
545
|
+
</div>
|
|
546
|
+
<br /><br />
|
|
547
|
+
Files needs to be served from http server like
|
|
548
|
+
<a href="https://www.npmjs.com/package/http-server" target="_blank" rel="nofollow">http-server</a> or
|
|
549
|
+
<a href="https://www.npmjs.com/package/sirv-cli" target="_blank" rel="nofollow">sirv-cli</a>
|
|
550
|
+
</div>
|
|
551
|
+
`,I=[];function S(t,e){return pt(t-430,e)}let M,k;function G(t,e){return pt(e-543,t)}I[F(-34,18)](a[G(1016,1069)](S(1012,864),(t=>M=t))),I[F(12,18)](a[R("#Kej",749)](G(1301,1353),(t=>k=t)));const L=n(M);i((()=>{var t,e;L&&L[(t=-338,e=-397,C(e- -183,t))]()}));const z=n(k);function O(t,e){return gt(e- -365,t)}function R(t,e){return gt(e- -37,t)}i((()=>{var t,e;z&&z[(t=978,e="[[$i",it(e,t-648))]()})),i((()=>{var t,e;I[(t=1006,e=1092,G(e,t- -203))]((t=>t()))}));const{onDestroy:T,state:A,update:_,html:N,unsafeHTML:H}=t;var V=!0;const E=N`<strong>[gantt-schedule-timeline-calendar component]</strong><br /><br />`;function B(t,e=""){const o=it("^]Gn",779-373);var a,i;return N` <div class="${o}">${E}${t}${e?N`<br />${typeof e===(a=-106,i=-12,X(a,i- -1276))?H(e):e}`:null}</div> `}function j(t){return c(this,void 0,void 0,(function*(){function i(t,e){return gt(e- -681,t)}function s(t,e){return pt(t-570,e)}function n(t,e){return pt(t- -615,e)}function l(t){function e(t,e){return gt(t-207,e)}return(t=String(t))[(i="!4]#",s=1462,gt(s-754,i))](e(722,"56oJ"),"")[(o=887,a=821,pt(o-132,a))](e(883,"Kc!t"),"");var o,a,i,s}function r(t){const e=(t=l(t))[(o="TqAl",a=222,gt(a- -439,o))](":");var o,a,i,s;e>-1&&(t=t[(i=505,s="^]Gn",gt(i- -86,s))](0,e));const n=m(t);var r,c,d,h,u,f,p,w;function b(t,e){return pt(t- -6,e)}return n[b(790,664)]===g[b(703,556)]&&n[b(552,688)]&&n[(p=647,w=770,pt(w-11,p))]&&(t=n[(u=1253,f=1276,pt(u-695,f))]+"."+n[(d=416,h=495,pt(h- -264,d))][(r="TqAl",c=1246,gt(c-527,r))](".")),t}function c(t,e){return pt(e-871,t)}let d=location[k(1033,"@jDm")];const b=function(){function t(t,e){return gt(t- -872,e)}function e(t,e){return gt(t- -753,e)}if(void 0!==location[t(-188,"Xjdm")])return[...location[l(529,559)]];const o=[];let a=window;function i(t,e){return pt(t-295,e)}for(;a!==window[i(1069,1028)];){if(a[l(770,866)][(s=-82,n=-72,pt(n- -689,s))])try{const i=new URL(a[t(-120,"73DZ")][e(-253,"aRL[")]);o[l(628,657)](i[e(-124,")8]4")])}catch(t){}a=a[i(875,1012)]}var s,n;function l(t,e){return pt(t-1,e)}return o}();function D(t,e){return gt(t-227,e)}function y(t,e){return gt(t- -820,e)}function P(t,e){return pt(e-708,t)}if(a[k(890,"uBq0")](s(1063,1160),[d,...b]),b[D(988,"A&#u")]&&(d=String(b[b[P(1431,1406)]-1])),d[k(1049,"&Mq0")](s(1055,1091)))return V=!1,void(v=$);if(d=l(d),t[y(-55,")8]4")](y(-155,"zwjv"))){let l,h;const u=a[D(775,"rBuJ")](s(1177,1157));if(e&&e[D(963,"rBuJ")]&&typeof e[c(1456,1495)]===P(1244,1407))h=yield e[k(998,"Q0oL")]()[P(1274,1238)]((t=>{function e(t,e){return D(t- -985,e)}function o(t,e){return k(t- -1246,e)}V=!1,u&&console[o(-444,"Q0oL")](e(-272,"LYHv"),t);let a=r(220,273);function r(t,e){return n(t-27,e)}var d,h,m,g;function f(t,e){return k(t- -1145,e)}function p(t,e){return G(e-185,t)}function w(t,e){return s(e- -613,t)}typeof t[e(-106,"3QuM")]===w(793,632)&&(t[o(-455,"&Mq0")][(m=1435,g="eZit",i(g,m-1356))](f(-358,"C4^k"))||t[r(-71,69)][(d=939,h=899,c(d,h- -706))](w(375,498))||t[p(395,349)][o(-308,"G$L*")](f(-315,"A&#u")))&&(a=p(596,524)),l=B(a)}));else{V=!1,u&&console[y(-44,"^]Gn")](i("rBuJ",-73),e);const t=s(1378,1497);l=B(t)}if(l)return V=!1,void(v=l);let m;try{const e=i("56oJ",99);m=h[c(1442,1374)](t,e)}catch(t){V=!1;const e=i("3QuM",-121);return void(v=B(e,t[P(1206,1225)]))}if(!m.ok){V=!1;const t=P(1479,1344);return void(v=B(t,m[i("tgIv",-154)]))}const g=m[k(889,"Xjdm")];if(g&&g[s(1360,1204)]&&g[y(-281,"na7A")]instanceof Map&&(g[P(1464,1498)]=Object[c(1636,1574)](g[i("C4^k",-175)][y(-217,"aRL[")]()),g[y(-39,"5K1Y")][M("NQc8",1575)]instanceof Map&&(g[G(437,589)][c(1503,1664)]=Object[y(-14,"o$j$")](g[s(1360,1237)][k(776,"zuID")][n(41,79)]())),g[k(1101,"&Ywm")][c(1230,1350)]instanceof Map&&(g[n(175,278)][n(-136,11)]=Object[y(-340,"p1aj")](g[n(175,263)][D(810,"zwjv")][M("p1aj",1330)]()))),a[P(1167,1331)](M("@jDm",1400),g),g[k(905,"@jDm")][i("73DZ",-105)]!==G(176,69)){V=!1;const t=D(845,"R2qD");return void(v=B(t))}const f=o[G(302,342)][M("&Ywm",1602)]()[D(716,"R2qD")]();if(g[D(977,"dn9m")][s(1237,1280)]<f){V=!1;const t=y(-216,"56oJ");return void(v=B(t))}let p=d;if(g[D(994,"(Co6")][M("C4^k",1271)]){p=r(d);const t=b[k(803,"zuID")]((t=>r(t)));if(t[c(1695,1569)])for(const e of g[M("R0)e",1435)][i("@jDm",97)]){const o=e[y(-263,"eZit")](">")[D(978,"(ARK")]()[s(1207,1370)]((t=>r(t))),a=o[c(1559,1594)](),i=r(location[k(1096,"p1aj")]);if(!o[k(961,"k17%")]||!t[c(1634,1569)]||o[M("hqk@",1556)]!==t[s(1268,1293)]||i!==a)continue;let n=0,l=0;for(const e of o){e===t[l]&&n++,l++}if(n===b[P(1509,1406)])return}}if(!g[P(1512,1498)][k(1067,"o$j$")][k(951,"^]Gn")](d)&&!g[M("Kc!t",1298)][n(87,248)][y(-167,"3QuM")](p)){let t=!1;for(const e of g[G(437,473)][y(-157,"&Ywm")]){if(e[c(1576,1549)](".*")){const o=e[n(36,28)](0,e[G(212,158)](".*")+1);if(d[G(415,285)](o)){t=!0;break}}if(e[n(119,128)]("*")){const o=e[n(72,180)](".","\\.")[G(334,442)]("*",".*");if(new RegExp(o)[y(-285,"&Ywm")](d)){t=!0;break}}}if(!t){V=!1;const t=s(1218,1379)+d+"'.";return void(v=B(t,s(1326,1412)+g[n(175,212)][M("(Co6",1533)][D(823,"@jDm")](", ")+k(1095,"aRL[")))}}if(!g[c(1668,1661)][M("k17%",1429)][D(786,"LYHv")]){if(a[G(400,356)](c(1569,1521))[P(1619,1454)](".")[0]!==g[M("3QuM",1503)][D(806,"hqk@")][y(-81,"Xjdm")](".")[0]){V=!1;const t=D(800,"tgIv");return void(v=B(t))}}return}const C=D(960,"zwjv"),I=k(854,"na7A"),S=w;function M(t,e){return gt(e-790,t)}function k(t,e){return gt(t-292,e)}function G(t,e){return pt(t- -353,e)}if(t){if(t[i("EqLC",-185)](M("R2qD",1521)))return function(){let e=null;try{const i=t[P(769,765)](5),n=h[W(1070,1090)](i,C)[W(961,824)](f);e=JSON[b(146,199)](n),e&&a[s("hqk@",1132)](s("NQc8",853),{for:e[o("(ARK",14)],domains:[...e[y("rBuJ",-291)]],type:Object[y("krwC",-233)]({},e[D(1035,"rBuJ")]),validUntil:Object[P(852,977)]({},e[P(751,670)])})}catch(t){}if(!e||!e[w(1086,954)]||!e[s("A!&T",924)][D(1016,"@jDm")]){V=!1;const t=y("Kc!t",-137);return void(v=B(t,x))}function o(t,e){return k(e- -1010,t)}function s(t,e){return k(e-42,t)}if(!e[s("Xjdm",1020)]){V=!1;const t=w(1024,1174);return void(v=B(t,x))}const n=function(t){function e(t,e){return i(t,e-126)}const o=Object[(a=1006,s=1033,G(s-714,a))]({},t);var a,s,n,l;return delete o[e("qfw$",-42)],delete o[(n="2WL1",l=920,i(n,l-802))],JSON[e("56oJ",133)](o)}(e);function l(t,e){return c(t,e- -35)}if(!function(t,e){if(!t||!e)return!1;const o=new S({});function a(t,e){return k(t-138,e)}return o[a(1061,"ar!&")](I),o[a(1007,"R2qD")](e,t,p)}(e[u("C4^k",140)],n)){V=!1;const t=y("3QuM",-135);return void(v=B(t,x))}const r=(new Date)[s("TqAl",960)]();function u(t,e){return i(t,e-57)}if(e[u("lFqm",-82)][l(1247,1383)]<r){V=!1;const t=u("tgIv",120);v=B(t,x)}else{if(e[l(1476,1632)][u("C4^k",-22)]===y("G$L*",-23)||e[b(566,483)][s("zwjv",920)]===W(984,917)){const t=d[y("C4^k",-337)](":");t>-1&&(d=d[w(1104,1034)](0,t));const e=m(d);e[W(1254,1113)]===g[o("G$L*",-50)]&&e[w(1073,1061)]&&e[l(1686,1595)]&&(d=e[W(852,875)]+"."+e[y("o$j$",-131)][l(1682,1551)]("."))}if(e[P(882,985)][P(914,958)](d));else{V=!1;const t=y("!4]#",-17)+d+b(127,261);v=B(t,x)}}function w(t,e){return G(t-868,e)}function b(t,e){return c(t,e- -1184)}function D(t,e){return k(t-227,e)}function y(t,e){return i(t,e- -133)}function P(t,e){return c(e,t- -691)}function W(t,e){return G(e-670,t)}}();const e=G(405,455),l=encodeURIComponent,r=(new Date)[c(1418,1361)](),w=h[s(1125,1153)](r,C),b=s(1155,990),$=u(r+d,b,{keySize:16})[G(154,273)](),L=[l(k(924,"TqAl"))+"="+l(t),l(P(1408,1317))+"="+l(d),l(y(-302,"56oJ"))+"="+l(location[c(1712,1599)]),l(y(-124,"&Ywm"))+"="+l(w),l(y(-104,"Kc!t"))+"="+l(e),l(M("Ze%N",1463))+"="+l(navigator[c(1558,1608)])][n(100,-67)]("&"),z=i("lFqm",-132);window[i("(Co6",30)](z,{method:M("na7A",1508),redirect:i("C4^k",-176),headers:{"Content-Type":c(1578,1458)},body:L})[c(1335,1438)]((t=>{return 200!==t[(a=-341,i=-206,G(i- -472,a))]&&(V=!1,v=W),t[(e="C4^k",o=260,M(e,o- -1270))]();var e,o,a,i}))[M("eZit",1405)]((r=>{function h(t,e){return D(e-224,t)}function u(t,e){return D(t- -600,e)}if(r&&r.ok)if(r[h("R2qD",1223)]&&r[f(1091,947)]===$)V=!0,a[f(823,877)](h("YjaJ",1186),(()=>{function t(t,e){return h(e,t- -1450)}var e,a;var i,s,n,l,c,d,u,m;function g(t,e){return h(e,t- -190)}return{registeredDomains:r[g(951,"NQc8")],validUntil:{text:r[g(1063,"Z#hj")],value:o[g(1031,"#Kej")][t(-475,"Q0oL")](r[g(783,"uBq0")])[(u="Q0oL",m=1439,h(u,m-494))]()},type:null!==(e=r[(c="o$j$",d=297,h(c,d- -941))])&&void 0!==e?e:{text:t(-497,"56oJ"),value:(n=1331,l="qfw$",w(l,n-221))},for:null!==(a=r[(i=1659,s=1826,f(s,i-705))])&&void 0!==a?a:""}}));else{V=!1;const o=f(1022,912);v=B(o,x);const a=w("aRL[",1078),i=[l(I(237,"TqAl"))+"="+l(t),l(I(388,"R0)e"))+"="+l(d),l(u(145,"56oJ"))+"="+l(location[h("A!&T",1035)]),l(f(738,805))+"="+l(e),l(y(564,590))+"="+l(String(r[p(1205,1188)])),l(u(128,"!4]#"))+"="+l($),l(p(1275,1289))+"="+l(navigator[b(305,"[@Qm")])][u(337,"(ARK")]("&");window[(m=734,g=734,P(g,m- -631))](a,{method:b(293,"aRL["),redirect:C(1088,1107),headers:{"Content-Type":u(181,"hqk@")},body:i})}else if(r){V=!1;const t=H(r[u(375,"w(SA")][C(1123,994)](/\n/gi,p(990,973)));let e=null;r[h("3QuM",1094)]&&(e=H(r[u(369,"[@Qm")][I(166,"Z#hj")](/\n/gi,y(408,392))));const o=b(224,"krwC");v=N` <div class="${o}"><strong>${E} ${t}</strong><br />${e}<br />${x}</div> `}else V=!1,v=W;var m,g;function f(t,e){return c(t,e- -617)}function p(t,e){return n(e-1110,t)}function w(t,e){return k(e-104,t)}function b(t,e){return i(e,t-422)}function y(t,e){return s(t- -640,e)}function C(t,e){return s(t- -202,e)}function I(t,e){return M(e,t- -1185)}_()}))[P(1313,1238)]((()=>{V=!1,v=W,_()}))}else{V=!1;const t=P(1431,1453),e=y(-135,"p1aj");v=N` <div class="${e}">${E} ${t}${x}</div> `}}))}function F(t,e){return pt(e- -609,t)}T(A[it("[@Qm",512)](it(")8]4",445),(t=>{function e(t,e){return R(e,t-114)}var o,i;j(t)[e(715,"w(SA")]((()=>{_()}))[(o=1122,i="[[$i",at(i,o- -243))]((t=>{function o(t,o){return e(t- -717,o)}V=!1;const i=o(51,"2WL1");var s,n;function l(t,e){return pt(t-808,e)}v=B(i),a[o(149,"5K1Y")](l(1415,1333))&&console[(s=233,n="(ARK",e(s- -450,n))](l(1509,1361),t),_()})),_()})));const Y={width:0,height:0},q={width:0,height:0};let J,Z,K,Q;function U(t){const e=t[i(152,285)];const o=t[i(248,249)];function i(t,e){return C(t-237,e)}var s,n,l,r,c,d;(Y[(c="@jDm",d=54,R(c,d- -716))]!==e||Y[i(324,415)]!==o)&&(Y[i(72,170)]=e,Y[(l=105,r="aRL[",at(r,l- -1459))]=o,a[(s=0,n=167,S(n- -886,s))](R("(ARK",1448-790),Y))}function X(t,e){return pt(e-589,t)}class tt{constructor(t){var e,o,i,s;!J&&(J=new ResizeObserver((()=>{U(t)})),J[(i=-319,s=-288,C(i- -272,s))](t),a[(e="krwC",o=74,R(e,o- -671))](O("[@Qm",1296-999),t),U(t))}[R("&Ywm",585)](){}[X(1028,1093)](t){var e,o;J[(e="#Kej",o=526,O(e,o-313))](t)}}function et(t){const e=t[(o="A&#u",i=1554,R(o,i-950))];var o,i;const s=t[n(913,"rBuJ")];function n(t,e){return at(e,t- -724)}function l(t,e){return S(e- -973,t)}var r,c,d,h,u,m;(q[(u=1713,m="hqk@",at(m,u-68))]!==e||q[(d=6,h=-121,G(d,h- -1469))]!==s)&&(q[n(747,"eZit")]=e,q[(r=114,c=27,X(r,c- -1367))]=s,a[l(90,80)](l(225,220),q))}!P[it("A!&T",326)](tt)&&P[st("uBq0",1270)](tt);class ot{constructor(t){var e,o;function i(t,e){return at(t,e- -163)}t=t[(e=-159,o=-247,G(o,e- -1424))],!Z&&(Z=new ResizeObserver((()=>{et(t)})),Z[i("dn9m",1374)](t),a[i("NQc8",1441)](R("Ze%N",62- -672),t),et(t))}[st("&Mq0",1138)](){}[at("2WL1",1381)](t){var e,o,a,i;Z[(a=421,i="@jDm",O(i,a-156))](t[(e=1565,o=1609,C(o-1605,e))])}}function at(t,e){return gt(e-883,t)}function it(t,e){return gt(e- -195,t)}function st(t,e){return gt(e-606,t)}!P[F(95,125)](ot)&&P[O("EqLC",260)](ot),i((()=>{var t,e,o,a;Z[(o="p1aj",a=800,it(o,a-504))](),J[(t="na7A",e=746,R(t,e-211))]()})),i(a[R("2WL1",675)]([G(1279,1306),G(1301,1267)],(()=>{function t(t,e){return R(e,t- -609)}function e(t,e){return C(t-1011,e)}function o(t,e){return X(e,t- -1097)}if(a[t(-113,"aRL[")](o(216,293))){const n=a[e(1046,975)](o(255,354));if(!n)return;a[(i=429,s="5K1Y",at(s,i- -1096))](o(61,-11),(()=>{var o,i,s,l,r,c;return n[(s=1513,l=1513,r=l,c=s- -124,F(r,c-1441))]-a[(o=-216,i="(Co6",t(o- -182,i))](e(933-20,826))}))}var i,s}),{group:!0})),i(a[at("C4^k",1610)](X(1385,1319),(t=>{function e(t,e){return C(t-281,e)}var o,a,i,s;K=t[e(83,8)][(i=-45,s=-34,X(i,s- -1303))],Q=t[e(97,0)][(o="tgIv",a=2,O(o,a- -282))]})));const nt={handleEvent(t){function e(t,e){return R(e,t-142)}function i(t,e){return C(e-879,t)}const s=o[g("tgIv",-15)](t);function n(t,e){return it(e,t- -241)}function l(t,e){return O(t,e-1026)}function r(t,e){return X(t,e- -218)}function c(t,e){return S(e- -778,t)}function d(t,e){return at(t,e- -1831)}function h(t,e){return G(e,t- -580)}if(t[r(824,939)]||s.x){const t=s.x?s.x:s.y,d=o[g("56oJ",17)]();return void(t>0?a[l("!4]#",1282)](e(721,"C4^k"))?o[g("aRL[",-45)](d[r(1079,1045)]+t*K):o[l("dn9m",1205)](d[h(710,785)]+K):a[e(893,"lFqm")](n(134,"56oJ"))?o[i(974,899)](d[c(209,326)]+t*K):o[h(701,654)](d[c(415,399)]-K))}function u(t,e){return G(e,t-372)}const m=o[i(688,766)]();function g(t,e){return R(t,e- -757)}if(s.y>0)if(a[d("G$L*",-320)](i(821,753))){const t=a[e(671,"Ze%N")](g("R2qD",-248));let i=0;i=t?s.y/t*Q:s.y*Q,o[d("zuID",-254)](m[c(223,326)]+i)}else o[r(1130,985)](m[i(805,908)]+Q);else if(a[u(1668,1807)](n(52,"TqAl"))){const t=a[n(130,"Ze%N")](u(1640,1595));let e=0;e=t?s.y/t*Q:s.y*Q,o[d("hqk@",-354)](m[u(1589,1632)]+e)}else o[l("zwjv",1260)](m[c(543,399)]-Q)},passive:!0},lt=Object[S(1102,1172)](Object[C(-46,-43)]({},e),{api:o,state:a,componentName:y});r((t=>{for(const e in t)lt[e]=t[e]}));const rt=s[C(-155,-91)](P,lt),ct=o[O("Xjdm",172)](C(-74,-33),t,e);return i(ct[it("!4]#",452)]),()=>V?ct[C(-187,-241)](R("ar!&",652),l`
|
|
552
|
+
<div
|
|
553
|
+
data-info-url="https://github.com/neuronetio/gantt-schedule-timeline-calendar"
|
|
554
|
+
class=${D[O("Q0oL",178)]}
|
|
555
|
+
style=${D[O("Z#hj",419)][S(1005,865)]()}
|
|
556
|
+
data-actions=${rt()}
|
|
557
|
+
@wheel=${nt}
|
|
558
|
+
>
|
|
559
|
+
${ct[F(-166,-78)](O("Kc!t",185),l` ${L[at("w(SA",1683)]()}${z[S(961,998)]()} `)}
|
|
560
|
+
</div>
|
|
561
|
+
`):v}let bt;!function(){function t(t,e){return pt(e-681,t)}function e(t,e){return gt(e-334,t)}function o(t,e){return pt(t- -694,e)}const a=ft();function i(t,e){return gt(t- -343,e)}for(;;)try{if(919333===parseInt(pt(-83- -743,-32))/1+-parseInt(o(23,-21))/2*(-parseInt((s=393,n="zwjv",gt(s- -121,n)))/3)+parseInt(o(3,-34))/4*(-parseInt(t(1549,1482))/5)+parseInt(i(434,"ar!&"))/6+parseInt(e("^]Gn",1004))/7+-parseInt(t(1309,1316))/8+-parseInt(e("[@Qm",929))/9*(parseInt(i(449,"zwjv"))/10))break;a.push(a.shift())}catch(t){a.push(a.shift())}var s,n}();const vt=new Array(128).fill(void 0);function Dt(t){return vt[t]}vt.push(void 0,null,!0,!1);let yt=vt.length;function Pt(t){const e=Dt(t);return function(t){t<132||(vt[t]=yt,yt=t)}(t),e}const xt="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&xt.decode();let Wt=null;function Ct(){return null!==Wt&&0!==Wt.byteLength||(Wt=new Uint8Array(bt.memory.buffer)),Wt}function $t(t,e){return t>>>=0,xt.decode(Ct().subarray(t,t+e))}function It(t){yt===vt.length&&vt.push(vt.length+1);const e=yt;return yt=vt[e],vt[e]=t,e}let St=0;const Mt="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},kt="function"==typeof Mt.encodeInto?function(t,e){return Mt.encodeInto(t,e)}:function(t,e){const o=Mt.encode(t);return e.set(o),{read:t.length,written:o.length}};function Gt(t,e,o){if(void 0===o){const o=Mt.encode(t),a=e(o.length,1)>>>0;return Ct().subarray(a,a+o.length).set(o),St=o.length,a}let a=t.length,i=e(a,1)>>>0;const s=Ct();let n=0;for(;n<a;n++){const e=t.charCodeAt(n);if(e>127)break;s[i+n]=e}if(n!==a){0!==n&&(t=t.slice(n)),i=o(i,a,a=n+3*t.length,1)>>>0;const e=Ct().subarray(i+n,i+a);n+=kt(t,e).written}return St=n,i}let Lt=null;function zt(){return null!==Lt&&0!==Lt.byteLength||(Lt=new Int32Array(bt.memory.buffer)),Lt}function Ot(){const t={wbg:{}};return t.wbg.__wbindgen_object_drop_ref=function(t){Pt(t)},t.wbg.__wbindgen_string_new=function(t,e){return It($t(t,e))},t.wbg.__wbindgen_bigint_from_i64=function(t){return It(t)},t.wbg.__wbindgen_bigint_from_u64=function(t){return It(BigInt.asUintN(64,t))},t.wbg.__wbindgen_error_new=function(t,e){return It(new Error($t(t,e)))},t.wbg.__wbindgen_object_clone_ref=function(t){return It(Dt(t))},t.wbg.__wbg_String_b9412f8799faab3e=function(t,e){const o=Gt(String(Dt(e)),bt.__wbindgen_malloc,bt.__wbindgen_realloc),a=St;zt()[t/4+1]=a,zt()[t/4+0]=o},t.wbg.__wbindgen_number_new=function(t){return It(t)},t.wbg.__wbg_set_f975102236d3c502=function(t,e,o){Dt(t)[Pt(e)]=Pt(o)},t.wbg.__wbg_new_abda76e883ba8a5f=function(){return It(new Error)},t.wbg.__wbg_stack_658279fe44541cf6=function(t,e){const o=Gt(Dt(e).stack,bt.__wbindgen_malloc,bt.__wbindgen_realloc),a=St;zt()[t/4+1]=a,zt()[t/4+0]=o},t.wbg.__wbg_error_f851667af71bcfc6=function(t,e){let o,a;try{o=t,a=e,console.error($t(t,e))}finally{bt.__wbindgen_free(o,a,1)}},t.wbg.__wbg_new_898a68150f225f2e=function(){return It(new Array)},t.wbg.__wbg_new_56693dbed0c32988=function(){return It(new Map)},t.wbg.__wbg_new_b51585de1b234aff=function(){return It(new Object)},t.wbg.__wbg_set_502d29070ea18557=function(t,e,o){Dt(t)[e>>>0]=Pt(o)},t.wbg.__wbg_set_bedc3d02d0f05eb0=function(t,e,o){return It(Dt(t).set(Dt(e),Dt(o)))},t.wbg.__wbindgen_is_string=function(t){return"string"==typeof Dt(t)},t.wbg.__wbindgen_throw=function(t,e){throw new Error($t(t,e))},t}function Rt(t,e){return bt=t.exports,Tt.__wbindgen_wasm_module=e,Lt=null,Wt=null,bt}async function Tt(t){if(void 0!==bt)return bt;const e=Ot();("string"==typeof t||"function"==typeof Request&&t instanceof Request||"function"==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:o,module:a}=await async function(t,e){if("function"==typeof Response&&t instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,e)}catch(e){if("application/wasm"==t.headers.get("Content-Type"))throw e;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",e)}const o=await t.arrayBuffer();return await WebAssembly.instantiate(o,e)}{const o=await WebAssembly.instantiate(t,e);return o instanceof WebAssembly.Instance?{instance:o,module:t}:o}}(await t,e);return Rt(o,a)}var At=Object.freeze({__proto__:null,parse_license_key:function(t,e){const o=Gt(t,bt.__wbindgen_malloc,bt.__wbindgen_realloc),a=St,i=Gt(e,bt.__wbindgen_malloc,bt.__wbindgen_realloc),s=St;return Pt(bt.parse_license_key(o,a,i,s))},License:class{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();bt.__wbg_license_free(t)}},LicenseDate:class{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();bt.__wbg_licensedate_free(t)}},LicenseKeyResult:class{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();bt.__wbg_licensekeyresult_free(t)}},LicenseResult:class{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();bt.__wbg_licenseresult_free(t)}},LicenseType:class{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();bt.__wbg_licensetype_free(t)}},ProductInfo:class{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();bt.__wbg_productinfo_free(t)}},SignedLicense:class{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();bt.__wbg_signedlicense_free(t)}},initSync:function(t){if(void 0!==bt)return bt;const e=Ot();return t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t)),Rt(new WebAssembly.Instance(t,e),t)},default:Tt});
|
|
562
|
+
/**
|
|
563
|
+
* Gantt-Schedule-Timeline-Calendar component
|
|
564
|
+
*
|
|
565
|
+
* @copyright NEURONET - Rafal Pospiech
|
|
566
|
+
* @author Rafal Pospiech <neuronet.io@gmail.com>
|
|
567
|
+
* @module gantt-schedule-timeline-calendar
|
|
568
|
+
* @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
|
|
569
|
+
* @link https://gantt-schedule-timeline-calendar.neuronet.io
|
|
570
|
+
* @version 3.37.5
|
|
571
|
+
* @released 2024-07-19
|
|
572
|
+
* @license SEE LICENSE IN LICENSE FILE
|
|
573
|
+
*/
|
|
574
|
+
const _t=async function(t={}){let{importHook:e,serverPath:o}=t,a=new URL("assets/2f1f893a.wasm",import.meta.url).href;return null!=o&&(a=o+/[^\/\\]*$/.exec(a)[0]),null!=e&&(a=e(a)),await Tt(a),At};function Nt(t){const e=t.state,o=new M(e),a={treeMap:{},itemRowMap:{},list:{visibleRows:[],rowsIds:[],rows:{},visibleRowsHeight:0,rowsWithParentsExpanded:[],rowsHeight:0,width:0},dimensions:{width:0,height:0},chart:{items:{},grid:{cells:{},rows:{}},dimensions:{width:0,widthWithoutScrollBar:0,height:0,innerHeight:0,heightWithoutScrollBar:0},visibleItems:[],time:{zoom:0,format:{period:"day",periodIncrement:1,zoomTo:0,format:()=>""},level:0,levels:[],currentZoomLevelFormatting:[],allDates:[],timePerPixel:0,totalViewDurationMs:0,totalViewDurationPx:0,leftGlobal:0,rightGlobal:0,leftPx:0,rightPx:0,period:"day",leftGlobalDate:void 0,rightGlobalDate:void 0,centerGlobal:0,centerGlobalDate:void 0,from:0,to:0,fromDate:void 0,toDate:void 0,autoExpandTimeFromItems:!1,datesCache:{timePerPixel:0,levels:[]}},allItemsOnTheLeftOrRight:!1},scroll:{horizontal:{lastPageSize:0,lastPageCount:0,absoluteSize:0,absoluteSizeWithoutLastPage:0,handlePosPx:0,innerHandleSize:0,absolutePosPx:0,maxHandlePosPx:0,scrollSize:0,dataIndex:0,dataId:"",data:null,preciseOffset:0,visible:!1,percent:0},vertical:{lastPageSize:0,lastPageCount:0,absoluteSize:0,absoluteSizeWithoutLastPage:0,handlePosPx:0,innerHandleSize:0,absolutePosPx:0,maxHandlePosPx:0,scrollSize:0,dataIndex:0,dataId:"",data:null,preciseOffset:0,visible:!1,percent:0}},elements:{},initializedPlugins:new Set};"boolean"==typeof t.debug&&t.debug&&(globalThis.state=e),e.update("",(t=>({config:t.config,$data:a})));const i=b(e,o),s=i.lithtml;o.setVido(i),o.setMergeDeep(d);const n=i.createApp({component:wt,props:{wasmInitialized:_t},element:t.element}),l=n.vidoInstance.api;const r={state:e,api:l,component:n,destroy:function(){n.destroy(),e.destroy()},reload:function(){r.component.destroy(),r.component=i.createApp({component:wt,props:{wasmInitialized:_t},element:t.element}),r.api=n.vidoInstance.api,r.component.update()},lithtml:s,Vido:b};return r}const Ht=document.createTextNode("");document.createTextNode=function(t){const e=Ht.cloneNode(!0);return e.textContent=t,e}.bind(document);const Vt=document.createElement("div"),Et=document.createElement.bind(document);document.createElement=function(t,...e){if("div"!==t)return Et(t,...e);return Vt.cloneNode(!0)}.bind(document),Nt.api=ut,Nt.lithtml=n,Nt.Vido=b;export{Nt as default};
|