@sme.up/ketchup 10.1.2 → 10.1.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/dist/cjs/ketchup.cjs.js +1 -1
- package/dist/cjs/kup-custom-task-list-header_4.cjs.entry.js +195 -22
- package/dist/cjs/kup-gantt_10.cjs.entry.js +19 -17
- package/dist/cjs/{kup-planner-declarations-7291d01c.js → kup-planner-declarations-959110da.js} +1 -1
- package/dist/cjs/kup-planner-renderer.cjs.entry.js +3 -3
- package/dist/cjs/kup-planner.cjs.entry.js +112 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/index.js +4 -0
- package/dist/collection/assets/planner-example-7.js +370 -0
- package/dist/collection/components/kup-planner/kup-planner-declarations.js +1 -1
- package/dist/collection/components/kup-planner/kup-planner.js +153 -3
- package/dist/collection/components/kup-planner/utils/custom-task-list-table.js +30 -12
- package/dist/collection/components/kup-planner/utils/kup-gantt/kup-gantt.js +31 -7
- package/dist/collection/components/kup-planner/utils/kup-grid-renderer/kup-grid-renderer.js +181 -4
- package/dist/collection/components/kup-planner/utils/kup-planner-renderer.js +2 -2
- package/dist/collection/components/kup-planner/utils/kup-task-gantt/kup-task-gantt.js +4 -4
- package/dist/collection/components/kup-planner/utils/kup-task-list/kup-task-list.css +1 -0
- package/dist/components/kup-custom-task-list-table.js +1 -1
- package/dist/components/kup-gantt.js +1 -1
- package/dist/components/kup-grid-renderer.js +1 -1
- package/dist/components/kup-planner-renderer.js +1 -1
- package/dist/components/kup-planner.js +122 -12
- package/dist/components/kup-task-gantt.js +1 -1
- package/dist/components/kup-task-list-header.js +1 -1
- package/dist/components/kup-task-list-table.js +1 -1
- package/dist/components/kup-task-list.js +1 -1
- package/dist/components/{p-76c4c708.js → p-26d3e5b2.js} +1 -1
- package/dist/components/{p-2fff7268.js → p-45cdd2a4.js} +10 -10
- package/dist/components/{p-a0eeacbd.js → p-4edc1bd0.js} +1 -1
- package/dist/components/{p-9da8cd93.js → p-5cbf86c3.js} +13 -10
- package/dist/components/{p-53e38c4a.js → p-90c212d2.js} +1 -1
- package/dist/components/{p-0e6c0355.js → p-9c8c4e2e.js} +30 -12
- package/dist/components/{p-5517e8e8.js → p-c2b9b4ba.js} +4 -4
- package/dist/components/{p-4efa19a7.js → p-c8302548.js} +3 -3
- package/dist/components/{p-c43d08ab.js → p-d72814f5.js} +161 -5
- package/dist/esm/ketchup.js +1 -1
- package/dist/esm/kup-custom-task-list-header_4.entry.js +191 -18
- package/dist/esm/kup-gantt_10.entry.js +14 -12
- package/dist/esm/{kup-planner-declarations-0704bc6c.js → kup-planner-declarations-5981474b.js} +1 -1
- package/dist/esm/kup-planner-renderer.entry.js +3 -3
- package/dist/esm/kup-planner.entry.js +112 -4
- package/dist/esm/loader.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-088e2f23.entry.js +1 -0
- package/dist/ketchup/p-58bc7c00.entry.js +1 -0
- package/dist/ketchup/{p-54ebe3bd.entry.js → p-6aec24be.entry.js} +1 -1
- package/dist/ketchup/p-78c0ff1b.js +1 -0
- package/dist/ketchup/p-ca9ec047.entry.js +16 -0
- package/dist/types/components/kup-planner/kup-planner-declarations.d.ts +19 -0
- package/dist/types/components/kup-planner/kup-planner.d.ts +12 -1
- package/dist/types/components/kup-planner/utils/kup-gantt/kup-gantt.d.ts +2 -1
- package/dist/types/components/kup-planner/utils/kup-grid-renderer/kup-grid-renderer.d.ts +7 -0
- package/dist/types/components.d.ts +24 -2
- package/package.json +1 -1
- package/dist/ketchup/p-008bdcdc.js +0 -1
- package/dist/ketchup/p-792e9244.entry.js +0 -1
- package/dist/ketchup/p-e8823224.entry.js +0 -1
- package/dist/ketchup/p-f38c2d0e.entry.js +0 -16
- package/dist/cjs/{bar.helpers-c481a535.js → other.helpers-8782a839.js} +46 -46
- package/dist/esm/{bar.helpers-23a51579.js → other.helpers-83e3225b.js} +46 -46
- /package/dist/ketchup/{p-cd3a7d53.js → p-17c9ef50.js} +0 -0
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{r as t,h as i,F as e}from"./p-b0368f88.js";import{a as s,c as o}from"./p-1ee561ba.js";import{d as n,i as a,g as r,h}from"./p-008bdcdc.js";import{d as l,a as p,b as f,c,e as d}from"./p-53af4c87.js";import{d as u}from"./p-cd3a7d53.js";const g=class{constructor(i){t(this,i),this.label="",this.doubleView=!1,this.setDoubleView=void 0,this.fontFamily=void 0,this.fontSize=void 0}render(){return i("div",{key:"f9305faff69be3e2b6a0f2afcd82494eca01ba2a",class:"custom-task-list-wrapper",style:{height:"25px",fontFamily:this.fontFamily,fontSize:this.fontSize}},i("div",{key:"8c383b0b32bb128b2b1b628773d7f4db0439be21",class:"title"},i("span",{key:"a4afad10a4d5258c2b37dbad48932a626f270f1e"},this.label)),void 0!==this.setDoubleView&&i("div",{key:"fcb8fa287da91c970ae0d5cf118299a03677089a",class:"toggler"},i("label",{key:"9f092e5796ab21dcbe995e5522c6a6df4ea57293",htmlFor:"ch2",class:"switch"},i("input",{key:"df0e7bfc59e82ee7bced1e7f0c88e3a393ac2850",class:"input",id:"ch2",type:"checkbox",checked:this.doubleView,onClick:()=>this.setDoubleView(!this.doubleView)}),i("span",{key:"5fba3f7d3f908c1bee8bd71bf036d124d183a94f",class:"slider"})),i("span",{key:"ee0f41729c539934d837b9bc81c58ec84c88ef8f",class:"label"},"Previsioni")))}};g.style='.kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:14px;line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:14px;line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}.custom-task-list-wrapper{display:flex;justify-content:space-around;max-width:330px;place-items:"center";text-align:center;align-items:center}.title{font-weight:bold;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.toggler{max-width:max-content;padding:0 4px;text-align:right}.switch{position:relative;display:inline-block;width:30px;height:17px}.input{opacity:0;width:0;height:0}.input:checked+.slider{background-color:#003b77}.input:checked+.slider:before{-webkit-transform:translateX(13px);-ms-transform:translateX(13px);transform:translateX(13px)}.input:focus+.slider{box-shadow:0 0 1px #003b77}.slider{-webkit-transition:0.4s;cursor:pointer;background-color:#ccc;bottom:0;border-radius:17px;left:0;position:absolute;right:0;top:0;transition:0.4s}.slider:before{-webkit-transition:0.1s;background-color:white;border-radius:50%;bottom:2px;content:"";height:13px;left:2px;position:absolute;transition:0.1s;width:13px}.label{font-size:12px;padding:6px}.filter{font-size:12px}';const v=class{constructor(i){t(this,i),this.ganttId=void 0,this.tasks=[],this.rowHeight=0,this.rowWidth="",this.fontFamily="",this.fontSize="",this.scrollableTaskList=void 0,this.taskListScrollX=void 0,this.setSelectedTask=void 0,this.onclickTaskList=void 0,this.ondblclickTaskList=void 0,this.oncontextmenuTaskList=void 0,this.ontaskListScrollWidth=void 0}componentDidLoad(){var t;this.ontaskListScrollWidth(null===(t=this.projectWrapperRef)||void 0===t?void 0:t.clientWidth)}componentDidUpdate(){var t;this.ontaskListScrollWidth(null===(t=this.projectWrapperRef)||void 0===t?void 0:t.clientWidth)}updateTaskListScroll(){this.projectWrapperRef&&(this.projectWrapperRef.parentElement.scrollLeft=this.taskListScrollX)}render(){const t=new s,o={};this.scrollableTaskList&&(o.width=this.rowWidth);const a=this.tasks.reduce(((t,i)=>t.valuesToShow.length>i.valuesToShow.length?t:i)).valuesToShow.length+1;return i("div",{class:"container "+(this.scrollableTaskList?"scrollable":""),style:o},i("div",{class:"project-wrapper",ref:t=>this.projectWrapperRef=t},this.tasks.map((s=>{var o,r,h,l;return i(e,null,"project"===s.type?i("div",{class:"project",style:{height:`${this.rowHeight}px`,width:this.rowWidth,fontFamily:this.fontFamily,fontSize:this.fontSize,gridTemplateColumns:`repeat(${s.valuesToShow.length}, 1fr)`},onClick:()=>{this.setSelectedTask(s.id),this.onclickTaskList(s.id)},onDblClick:()=>{this.setSelectedTask(s.id),this.ondblclickTaskList(s.id)},onContextMenu:t=>{t.preventDefault(),this.setSelectedTask(s.id),this.oncontextmenuTaskList(t,s.id)}},null===(o=s.valuesToShow)||void 0===o?void 0:o.map(((e,o)=>i("span",{class:0===o?"main":void 0,title:e.length>10?e:void 0,key:`task_${s.id}_valuesToShow_${o}`},"#START#"===e?t.formatToLocaleSimple(s.start):"#END#"===e?t.formatToLocaleSimple(s.end):e))),this.scrollableTaskList&&a>s.valuesToShow.length&&n(a-s.valuesToShow.length).map((t=>i("span",{key:t})))):"task"===s.type?i("div",{class:"subrow",style:{height:`${this.rowHeight}px`,width:this.rowWidth,fontFamily:this.fontFamily,fontSize:this.fontSize,gridTemplateColumns:`repeat(${s.valuesToShow.length+1}, 1fr)`},onClick:()=>{this.setSelectedTask(s.id),this.onclickTaskList(s.id)},onDblClick:()=>{this.setSelectedTask(s.id),this.ondblclickTaskList(s.id)},onContextMenu:t=>{t.preventDefault(),this.setSelectedTask(s.id),this.oncontextmenuTaskList(t,s.id)}},this.scrollableTaskList?i("div",{style:{textAlign:"end"}},i("span",{key:`phase_${s.id}_valuesToShow_color`,style:{height:"16px",width:"16px",display:"inline-block",backgroundColor:null===(r=s.styles)||void 0===r?void 0:r.backgroundColor}})):i("span",{key:`phase_${s.id}_valuesToShow_color`,style:{height:"16px",width:"16px",backgroundColor:null===(h=s.styles)||void 0===h?void 0:h.backgroundColor}}),null===(l=s.valuesToShow)||void 0===l?void 0:l.map(((e,o)=>i("span",{class:0===o?"main":void 0,title:e.length>10?e:void 0,key:`phase_${s.id}_valuesToShow_${o}`},"#START#"===e?t.formatToLocaleSimple(s.start):"#END#"===e?t.formatToLocaleSimple(s.end):e))),this.scrollableTaskList&&a>s.valuesToShow.length&&n(a-s.valuesToShow.length-1).map((t=>i("span",{key:t})))):(()=>{var t;let e="";for(let t=0;t<s.valuesToShow.length;t++)e+="1fr ";return i("div",{class:"timeline",style:{height:`${this.rowHeight}px`,width:this.rowWidth,fontFamily:this.fontFamily,fontSize:this.fontSize,"--grid-fasi-columns":e},onContextMenu:t=>{t.preventDefault(),this.setSelectedTask(s.id),this.oncontextmenuTaskList(t,s.id)}},null===(t=s.valuesToShow)||void 0===t?void 0:t.map(((t,e)=>i("span",{class:0===e?"main":void 0,title:t.length>10?t:void 0,key:`detail_${s.id}_valuesToShow_${e}`},t))))})())}))))}static get watchers(){return{taskListScrollX:["updateTaskListScroll"]}}};v.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:14px;line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:14px;line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}.container{margin-top:var(--kup-space-04)}.scrollable{overflow-x:auto;scrollbar-width:0}.scrollable .project-wrapper{display:table}.scrollable .project{width:100% !important;display:table-row}.scrollable .project>*{overflow:unset;padding-right:10px;display:table-cell;vertical-align:middle;border-bottom:1px solid var(--kup-border-subtle, #acacac);border-top:1px solid var(--kup-border-subtle, #acacac);padding-left:12px}.scrollable .project>*:first-child{border-left:1px solid var(--kup-border-subtle, #acacac);border-bottom-left-radius:4px;border-top-left-radius:4px}.scrollable .project>*:last-child{border-right:1px solid var(--kup-border-subtle, #acacac);border-bottom-right-radius:4px;border-top-right-radius:4px}.scrollable .subrow{width:100% !important;display:table-row}.scrollable .subrow>*{overflow:unset;padding-right:10px;display:table-cell;vertical-align:middle;border-bottom:1px solid #acacac;border-top:1px solid #acacac;padding-left:12px}.scrollable .subrow>*:first-child{border-left:1px solid #acacac}.scrollable .subrow>*:last-child{border-right:1px solid #acacac}.scrollable .timeline{width:100% !important;display:table-row}.scrollable .timeline>*{overflow:unset;padding-right:10px;display:table-cell;vertical-align:middle;border-bottom:1px solid #acacac;border-top:1px solid #acacac;padding-left:12px}.scrollable .timeline>*:first-child{border-left:1px solid #acacac}.scrollable .timeline>*:last-child{border-right:1px solid #acacac}.scrollable .project:has(+.subrow)>*{border-bottom-left-radius:0;border-bottom-right-radius:0}.scrollable::-webkit-scrollbar{width:0;height:0}.project{background:var(--kup-layer-1);border-bottom:1px solid var(--kup-border-subtle);border-radius:var(--kup-radius-00);box-sizing:border-box;color:var(--kup-text-secondary);cursor:pointer;display:grid;font-weight:400;grid-template-columns:var(--grid-project-columns, 1fr 1fr 1fr);place-items:center;padding:var(--kup-space-03)}.project>*{font-size:14px;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.project .main{font-weight:700;width:100%;padding-left:4px;font-family:var(--kup-font-family);font-size:14px;line-height:18px;font-weight:600;letter-spacing:0.16px}.subrow{cursor:pointer;display:grid;border-bottom:1px solid var(--kup-border-subtle);box-sizing:border-box;grid-template-columns:var(--grid-fasi-columns, 1fr 1fr 1fr);place-items:center;background-color:var(--kup-layer-1);color:var(--kup-text-primary);font-weight:400}.subrow>*{font-size:12px;line-height:14px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%;font-family:var(--kup-font-family);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.subrow:last-of-type{border-bottom:1px solid var(--kup-border-subtle)}.subrow:has(+.subrow),.project:has(+.subrow){border-bottom-left-radius:0 !important;border-bottom-right-radius:0 !important}.timeline{padding:var(--kup-space-03);cursor:pointer;display:grid;border-bottom:1px solid var(--kup-border-subtle);border-radius:var(--kup-radius-00);grid-template-columns:var(--grid-fasi-columns, 1fr 1fr 1fr);place-items:center;background-color:var(--kup-layer-1);color:var(--kup-text-primary);font-weight:400;box-sizing:border-box}.timeline>*{font-size:14px;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.timeline .main{font-weight:700;width:100%;padding-left:4px;font-family:var(--kup-font-family);font-size:14px;line-height:18px;font-weight:600;letter-spacing:0.16px}";const x=class{constructor(i){t(this,i),this.dateSetup=void 0,this.locale=void 0,this.rtl=void 0,this.headerHeight=void 0,this.columnWidth=void 0,this.fontFamily=void 0,this.fontSize=void 0,this.dateTimeFormatters=void 0,this.singleLineHeader=!1,this.currentDateIndicator=void 0,this.svgWidth=void 0,this.simplifiedHeader=void 0}componentWillLoad(){this.simplifiedHeader=this.singleLineHeader&&"year"!==this.dateSetup.viewMode}formatYear(t){var i,e;return(null===(i=this.dateTimeFormatters)||void 0===i?void 0:i.year)?null===(e=this.dateTimeFormatters)||void 0===e?void 0:e.year(t,this.locale):l.year(t,this.locale)}formatMonth(t){var i,e;return(null===(i=this.dateTimeFormatters)||void 0===i?void 0:i.month)?null===(e=this.dateTimeFormatters)||void 0===e?void 0:e.month(t,this.locale):l.month(t,this.locale)}formatMonthAndYear(t){var i,e;return(null===(i=this.dateTimeFormatters)||void 0===i?void 0:i.monthAndYear)?null===(e=this.dateTimeFormatters)||void 0===e?void 0:e.monthAndYear(t,this.locale):l.monthAndYear(t,this.locale)}formatWeek(t){var i,e;return(null===(i=this.dateTimeFormatters)||void 0===i?void 0:i.week)?null===(e=this.dateTimeFormatters)||void 0===e?void 0:e.week(t,this.locale):l.week(t,this.locale)}formatDay(t){var i,e;return(null===(i=this.dateTimeFormatters)||void 0===i?void 0:i.day)?null===(e=this.dateTimeFormatters)||void 0===e?void 0:e.day(t,this.locale):l.day(t,this.locale)}getCalendarValuesForYear(){const t=[],e=[],s=.5*this.headerHeight,o=this.dateSetup.dates;for(let n=0;n<o.length;n++){const a=o[n],r=this.formatYear(a);if(e.push(i("text",{key:r,y:.8*this.headerHeight,x:this.columnWidth*n+.5*this.columnWidth,class:"calendarBottomText"},r)),0===n||a.getFullYear()!==o[n-1].getFullYear()){const i=a.getFullYear().toString();let e;e=this.rtl?(6+n+a.getFullYear()+1)*this.columnWidth:(6+n-a.getFullYear())*this.columnWidth,t.push({key:i,value:i,x1Line:this.columnWidth*n,y1Line:0,y2Line:this.headerHeight,xText:e,yText:.9*s})}}return[t,e]}getCalendarValuesForMonth(){const t=[],e=[],s=.5*this.headerHeight,o=this.dateSetup.dates;for(let n=0;n<o.length;n++){const a=o[n],r=this.formatMonth(a);if(e.push(i("text",{key:r+a.getFullYear(),y:.8*this.headerHeight,x:this.columnWidth*n+.5*this.columnWidth,class:"calendarBottomText"},r)),0===n||a.getFullYear()!==o[n-1].getFullYear()){const i=this.formatYear(a);let e;e=this.rtl?(6+n+a.getMonth()+1)*this.columnWidth:(6+n-a.getMonth())*this.columnWidth,t.push({key:i,value:i,x1Line:this.columnWidth*n,y1Line:0,y2Line:s,xText:e,yText:.9*s})}}return[t,e]}getCalendarValuesForWeek(){const t=[],e=[];let s=1;const o=.5*this.headerHeight,n=this.dateSetup.dates;for(let a=n.length-1;a>=0;a--){const r=n[a];let h="";0!==a&&r.getMonth()===n[a-1].getMonth()||(h=this.formatMonthAndYear(r));const l=this.formatWeek(r);e.push(i("text",{key:r.getTime(),y:.8*this.headerHeight,x:this.columnWidth*(a+ +this.rtl),class:"calendarBottomText"},l)),h&&(a!==n.length-1&&t.push({key:h,value:h,x1Line:this.columnWidth*a+s*this.columnWidth,y1Line:0,y2Line:o,xText:this.columnWidth*a+this.columnWidth*s*.5,yText:.9*o}),s=0),s++}return[t,e]}getCalendarValuesForDay(){const t=[],e=[],s=.5*this.headerHeight,o=this.dateSetup.dates;for(let n=0;n<o.length;n++){const a=o[n],r=this.formatDay(a);if(e.push(i("text",{key:a.getTime(),y:.8*this.headerHeight,x:this.columnWidth*n+.5*this.columnWidth,class:"calendarBottomText"},r)),n+1!==o.length&&a.getMonth()!==o[n+1].getMonth()){const i=this.formatMonth(a);t.push({key:i+a.getFullYear(),value:i,x1Line:this.columnWidth*(n+1),y1Line:0,y2Line:s,xText:this.columnWidth*(n+1)-p(a.getMonth(),a.getFullYear())*this.columnWidth*.5,yText:.9*s})}}return[t,e]}getCalendarValuesForHour(){const t=[],e=[],s=.5*this.headerHeight,o=this.dateSetup.dates;for(let n=0;n<o.length;n++){const a=o[n],r=f(this.locale,{hour:"numeric"}).format(a);if(e.push(i("text",{key:a.getTime(),y:.8*this.headerHeight,x:this.columnWidth*(n+ +this.rtl),class:"calendarBottomText"},r)),0!==n&&a.getDate()!==o[n-1].getDate()){const i=o[n-1],e=`${c(i,this.locale,"long")}, ${i.getDate()} ${d(i,this.locale)}`,r=(a.getHours()-24)/2;t.push({key:e+a.getFullYear(),value:e,x1Line:this.columnWidth*n,y1Line:0,y2Line:s,xText:this.columnWidth*(n+r),yText:.9*s})}}return[t,e]}getTopAndBottomValues(){switch(this.dateSetup.viewMode){case"hour":return this.getCalendarValuesForHour();case"day":return this.getCalendarValuesForDay();case"week":return this.getCalendarValuesForWeek();case"month":return this.getCalendarValuesForMonth();case"year":return this.getCalendarValuesForYear()}}render(){this.simplifiedHeader=this.singleLineHeader&&"year"!==this.dateSetup.viewMode;const[t,e]=this.getTopAndBottomValues();return i("svg",{key:"3c4ad0dc0aa5184b89d22b1340af5751d63e2bbf",xmlns:"http://www.w3.org/2000/svg",width:this.svgWidth,height:this.headerHeight},i("g",{key:"0db95816bba2cb796b75f9515244430e39b806f7",class:"calendar","font-size":this.fontSize,"font-family":this.fontFamily},i("rect",{key:"94f45f66476ca31bc063590b9edaace7049ec8ef",x:0,y:0,width:this.columnWidth*this.dateSetup.dates.length,height:this.headerHeight,class:"calendarHeader"}),this.simplifiedHeader?null:e,t.map(this.simplifiedHeader?t=>i("g",{class:"calendarTop"},i("line",{x1:t.x1Line,y1:2*t.y2Line,x2:t.x1Line,y2:t.y2Line,class:"calendarTopTick",key:t.value+"line"}),i("text",{key:t.value+"text",y:t.yText,x:t.xText,class:"calendarTopText"},t.value)):t=>i("g",{class:"calendarTop"},i("line",{x1:t.x1Line,y1:t.y1Line,x2:t.x1Line,y2:t.y2Line,class:"calendarTopTick",key:t.value+"line"}),i("text",{key:t.value+"text",y:t.yText,x:t.xText,class:"calendarTopText"},t.value))),this.currentDateIndicator&&i("circle",{key:"2cd33e167d0e2cf70e6d37bf075dca727f39bb26",fill:this.currentDateIndicator.color,cx:this.currentDateIndicator.x+2.5,cy:this.headerHeight-8,r:"8"})))}};x.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:14px;line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:14px;line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}.calendarBottomText{text-anchor:middle;fill:var(--kup-text-secondary);-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.calendarTopTick{stroke:var(--kup-border-subtle)}.calendarTopText{text-anchor:middle;fill:var(--kup-text-secondary);-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.calendarHeader{fill:var(--kup-layer-1);stroke:var(--kup-border-subtle);stroke-width:1.4;font-family:var(--kup-font-family);font-size:14px;line-height:18px;font-weight:600;letter-spacing:0.16px}";var y,m,k,b,w,z={exports:{}};y=z.exports,m=function(){function t(t,i,e){this.r=0,this.g=0,this.b=0,this.set(t,i,e)}return t.prototype.set=function(t,i,e){this.r=this.clamp(t),this.g=this.clamp(i),this.b=this.clamp(e)},t.prototype.hueRotate=function(t){void 0===t&&(t=0),t=t/180*Math.PI;var i=Math.sin(t),e=Math.cos(t);this.multiply([.213+.787*e-.213*i,.715-.715*e-.715*i,.072-.072*e+.928*i,.213-.213*e+.143*i,.715+.285*e+.14*i,.072-.072*e-.283*i,.213-.213*e-.787*i,.715-.715*e+.715*i,.072+.928*e+.072*i])},t.prototype.grayscale=function(t){void 0===t&&(t=1),this.multiply([.2126+.7874*(1-t),.7152-.7152*(1-t),.0722-.0722*(1-t),.2126-.2126*(1-t),.7152+.2848*(1-t),.0722-.0722*(1-t),.2126-.2126*(1-t),.7152-.7152*(1-t),.0722+.9278*(1-t)])},t.prototype.sepia=function(t){void 0===t&&(t=1),this.multiply([.393+.607*(1-t),.769-.769*(1-t),.189-.189*(1-t),.349-.349*(1-t),.686+.314*(1-t),.168-.168*(1-t),.272-.272*(1-t),.534-.534*(1-t),.131+.869*(1-t)])},t.prototype.saturate=function(t){void 0===t&&(t=1),this.multiply([.213+.787*t,.715-.715*t,.072-.072*t,.213-.213*t,.715+.285*t,.072-.072*t,.213-.213*t,.715-.715*t,.072+.928*t])},t.prototype.multiply=function(t){var i=this.clamp(this.r*t[0]+this.g*t[1]+this.b*t[2]),e=this.clamp(this.r*t[3]+this.g*t[4]+this.b*t[5]),s=this.clamp(this.r*t[6]+this.g*t[7]+this.b*t[8]);this.r=i,this.g=e,this.b=s},t.prototype.brightness=function(t){void 0===t&&(t=1),this.linear(t)},t.prototype.contrast=function(t){void 0===t&&(t=1),this.linear(t,-.5*t+.5)},t.prototype.linear=function(t,i){void 0===t&&(t=1),void 0===i&&(i=0),this.r=this.clamp(this.r*t+255*i),this.g=this.clamp(this.g*t+255*i),this.b=this.clamp(this.b*t+255*i)},t.prototype.invert=function(t){void 0===t&&(t=1),this.r=this.clamp(255*(t+this.r/255*(1-2*t))),this.g=this.clamp(255*(t+this.g/255*(1-2*t))),this.b=this.clamp(255*(t+this.b/255*(1-2*t)))},t.prototype.hsl=function(){var t=this.r/255,i=this.g/255,e=this.b/255,s=Math.max(t,i,e),o=Math.min(t,i,e),n=0,a=(s+o)/2;if(s===o)return{h:0,s:0,l:100*a};var r=s-o;return s===t?n=(i-e)/r+(i<e?6:0):s===i?n=(e-t)/r+2:s===e&&(n=(t-i)/r+4),{h:100*(n/=6),s:100*(a>.5?r/(2-s-o):r/(s+o)),l:100*a}},t.prototype.clamp=function(t){return Math.min(Math.max(t,0),255)},t}(),k=function(){function t(t,i){this.target=t,this.targetHSL=t.hsl(),this.options=Object.assign({},{acceptanceLossPercentage:5,maxChecks:15},i),this.reusedColor=new m(0,0,0)}return t.prototype.solve=function(){var t=this.solveNarrow(this.solveWide());return{values:t.values,called:t.called,loss:t.loss,filter:this.css(t.values)}},t.prototype.solveWide=function(){for(var t=[60,180,18e3,600,1.2,1.2],i={loss:1/0},e=0;i.loss>this.options.acceptanceLossPercentage;){var s=this.spsa({A:5,a:t,c:15,values:[50,20,3750,50,100,100],maxTriesInLoop:1e3});if(s.loss<i.loss&&(i=s),(e+=1)>=this.options.maxChecks)break}return Object.assign({},i,{called:e})},t.prototype.solveNarrow=function(t){var i=t.loss,e=i+1;return this.spsa({A:i,a:[.25*e,.25*e,e,.25*e,.2*e,.2*e],c:2,values:t.values,maxTriesInLoop:500,called:t.called})},t.prototype.fixValueByFilterIDX=function(t,i){var e=100;return 2===i?e=7500:4!==i&&5!==i||(e=200),3===i?t>e?t%=e:t<0&&(t=e+t%e):t<0?t=0:t>e&&(t=e),t},t.prototype.spsa=function(t){for(var i=t.A,e=t.a,s=t.c,o=t.values,n=t.maxTriesInLoop,a=void 0===n?500:n,r=t.called,h=void 0===r?0:r,l=null,p=1/0,f=new Array(6),c=new Array(6),d=new Array(6),u=0;u<a;u++){for(var g=s/Math.pow(u+1,.16666666666666666),v=0;v<6;v++)f[v]=Math.random()>.5?1:-1,c[v]=o[v]+g*f[v],d[v]=o[v]-g*f[v];var x=this.loss(c)-this.loss(d);for(v=0;v<6;v++){var y=x/(2*g)*f[v],m=e[v]/Math.pow(i+u+1,1);o[v]=this.fixValueByFilterIDX(o[v]-m*y,v)}var k=this.loss(o);k<p&&(l=o.slice(0),p=k)}return{values:l,loss:p,called:h}},t.prototype.loss=function(t){var i=this.reusedColor;i.set(0,0,0),i.invert(t[0]/100),i.sepia(t[1]/100),i.saturate(t[2]/100),i.hueRotate(3.6*t[3]),i.brightness(t[4]/100),i.contrast(t[5]/100);var e=i.hsl();return Math.abs(i.r-this.target.r)+Math.abs(i.g-this.target.g)+Math.abs(i.b-this.target.b)+Math.abs(e.h-this.targetHSL.h)+Math.abs(e.s-this.targetHSL.s)+Math.abs(e.l-this.targetHSL.l)},t.prototype.css=function(t){var i=function(i,e){return void 0===e&&(e=1),Math.round(t[i]*e)};return["invert("+i(0)+"%)","sepia("+i(1)+"%)","saturate("+i(2)+"%)","hue-rotate("+i(3,3.6)+"deg)","brightness("+i(4)+"%)","contrast("+i(5)+"%);"].join(" ")},t}(),b=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},w={},y.clearCache=function(t){t?w[t]&&delete w[t]:w={}},y.hexToCSSFilter=function(t,i){var e,s,o,n,a,r;if(void 0===i&&(i={}),w[t]&&!i.forceFilterRecalculation)return Object.assign({},w[t],{cache:!0});try{if(o=(e=
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */
|
|
16
|
-
function(t,i){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var s,o,n=e.call(t),a=[];try{for(;(void 0===i||i-- >0)&&!(s=n.next()).done;)a.push(s.value)}catch(t){o={error:t}}finally{try{s&&!s.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return a}((r=t,4===r.length?[parseInt("0x"+r[1]+r[1]),parseInt("0x"+r[2]+r[2]),parseInt("0x"+r[3]+r[3])]:7===r.length?[parseInt("0x"+r[1]+r[2]),parseInt("0x"+r[3]+r[4]),parseInt("0x"+r[5]+r[6])]:[]),3))[1],n=e[2],!b(s=e[0])||!b(o)||!b(n))throw new Error("hextToRgb returned an invalid value for '"+t+"'");a=new m(Number(s),Number(o),Number(n))}catch(t){throw new Error("Color value should be in HEX format. "+t)}var h=new k(a,Object.assign({},{acceptanceLossPercentage:5,maxChecks:30,forceFilterRecalculation:!1},i));return w[t]=Object.assign({},h.solve(),{hex:t,rgb:[s,o,n],cache:!1})},Object.defineProperty(y,"__esModule",{value:!0});const T=class{constructor(i){t(this,i),this.tasks=void 0,this.dates=void 0,this.ganttEvent=void 0,this.selectedTask=void 0,this.rowHeight=0,this.columnWidth=0,this.timeStep=0,this.taskHeight=0,this.arrowColor="",this.arrowIndent=0,this.fontFamily="",this.fontSize="",this.rtl=!1,this.hideLabel=!1,this.showSecondaryDates=!1,this.currentDateIndicator=void 0,this.projection=void 0,this.readOnly=!1,this.gridProps=void 0,this.dateChange=void 0,this.progressChange=void 0,this.doubleClick=void 0,this.barClick=void 0,this.barDblClick=void 0,this.barContextMenu=void 0,this.delete=void 0,this.setFailedTask=void 0,this.setSelectedTask=void 0,this.eventStart=void 0,this.eMouseDown=void 0,this.phaseDrop=void 0,this.setGanttEvent=void 0,this.phaseDragScroll=void 0,this.xStep=0,this.initEventX1Delta=0,this.initEventXClick=0,this.isMoving=!1,this.point=void 0,this.svg=void 0,this.currentTarget=void 0,this.dragScrollInterval=void 0,this.dropZoneTask=void 0}componentDidLoad(){this.point=this.createSVGPoint(),this.updateXStep()}createSVGPoint(){if(this.svg)return this.svg.createSVGPoint()}updateXStep(){const t=this.dates[1].getTime()-this.dates[0].getTime()-60*this.dates[1].getTimezoneOffset()*1e3+60*this.dates[0].getTimezoneOffset()*1e3;this.xStep=this.timeStep*this.columnWidth/t}updateSvgMove(){const t=async t=>{var i,e;if(!this.ganttEvent.changedTask||!this.point||!this.svg)return;t.preventDefault(),this.point.x=t.clientX,this.point.y=t.clientY;const s=this.point.matrixTransform(null===(e=null===(i=this.svg)||void 0===i?void 0:i.getScreenCTM())||void 0===e?void 0:e.inverse()),{isChanged:o,changedTask:n}=h(s.x,this.ganttEvent.action,this.ganttEvent.changedTask,this.xStep,this.timeStep,this.initEventX1Delta,this.rtl,s.y);this.currentTarget&&(this.addGhostPreview(t),this.handleAutoScrollForPhaseDrag(t),this.addDropzoneVisualization()),o&&this.setGanttEvent(Object.assign(Object.assign({},this.ganttEvent),{action:this.ganttEvent.action,changedTask:n}))},i=async e=>{var s,o,n;clearInterval(this.dragScrollInterval),this.resetDropzoneVisualization();const{action:a,originalSelectedTask:r,changedTask:l}=this.ganttEvent;if(!(l&&this.point&&this.svg&&r))return;e.preventDefault(),this.point.x=e.clientX;const p=this.point.matrixTransform(null===(o=null===(s=this.svg)||void 0===s?void 0:s.getScreenCTM())||void 0===o?void 0:o.inverse());this.currentTarget=null;const{changedTask:f}=h(p.x,a,l,this.xStep,this.timeStep,this.initEventX1Delta,this.rtl,p.y),c=r.start!==f.start||r.end!==f.end||r.progress!==f.progress||r.y!==f.y;this.svg.removeEventListener("mousemove",t),this.svg.removeEventListener("mouseup",i),null===(n=this.svg.querySelector(".ghost-preview"))||void 0===n||n.remove(),this.setGanttEvent({action:""}),this.isMoving=!1;let d,u,g=!0;if("move"===a&&c&&"task"===f.type&&(d=this.tasks.find((t=>this.isPhaseWithinTaskArea(l,t)&&"project"===t.type)),u=this.tasks.find((t=>t.id==r.id.split("_").shift()))),(null==d?void 0:d.id)&&(null==u?void 0:u.id)!==(null==d?void 0:d.id))this.phaseDrop(r,u,f,d);else if(("move"===a||"end"===a||"start"===a)&&this.dateChange&&c)try{const t=await this.dateChange(f,f.barChildren);void 0!==t&&(g=t)}catch(t){g=!1}else if(this.progressChange&&c)try{const t=this.progressChange(f,f.barChildren);void 0!==t&&(g=t)}catch(t){g=!1}g||this.setFailedTask(r)};this.isMoving||"move"!==this.ganttEvent.action&&"end"!==this.ganttEvent.action&&"start"!==this.ganttEvent.action&&"progress"!==this.ganttEvent.action||!this.svg||(this.svg.addEventListener("mousemove",t),this.svg.addEventListener("mouseup",i),this.isMoving=!0)}hasMovedHorizontally(t){return!this.readOnly&&this.initEventXClick!==t.clientX}addGhostPreview(t){var i;null===(i=this.svg.querySelector(".ghost-preview"))||void 0===i||i.remove();const e=Object.assign(Object.assign({},t),{dataTransfer:new DataTransfer}),s=this.currentTarget;s.classList.add("ghost-preview"),this.svg.appendChild(s.cloneNode(!0));const o=s.getBoundingClientRect();e.dataTransfer.setDragImage(s,e.clientX-o.left,e.clientY-o.top)}handleAutoScrollForPhaseDrag(t){var i,e;const s=null===(e=null===(i=this.svg)||void 0===i?void 0:i.parentElement)||void 0===e?void 0:e.parentElement;if(s)if(clearInterval(this.dragScrollInterval),s.clientHeight<s.scrollHeight){const i=s.getBoundingClientRect(),e=t.clientY-i.top,o=5;e-20<o?this.dragScrollInterval=setInterval((()=>{this.phaseDragScroll(s.scrollTop-=o)}),1):e+20>i.height-o&&(this.dragScrollInterval=setInterval((()=>{this.phaseDragScroll(s.scrollTop+=o)}),1))}else{const i=20,e=window.innerHeight,s=t.clientY;s<i?window.scrollBy(0,-i):s>e-i&&window.scrollBy(0,i)}}isPhaseWithinTaskArea(t,i){return t.y+t.height>=i.ySecondary&&t.y<=i.ySecondary+i.height&&t.x2>=i.x1&&t.x1<=i.x2}addDropzoneVisualization(){var t;this.resetDropzoneVisualization();const i=this.tasks.filter((t=>{var i,e,s;return"project"==t.type&&(null===(s=null===(e=null===(i=this.ganttEvent.originalSelectedTask)||void 0===i?void 0:i.id)||void 0===e?void 0:e.split("_"))||void 0===s?void 0:s.shift())!=t.id})),e=this.ganttEvent.changedTask;this.dropZoneTask=i.find((t=>this.isPhaseWithinTaskArea(e,t))),(null===(t=this.dropZoneTask)||void 0===t?void 0:t.ySecondary)&&this.getBarRectsForDropzoneVisualization().forEach((t=>{t.setAttribute("fill",u.barDropZoneColor)}))}resetDropzoneVisualization(){if(!this.dropZoneTask)return;const t=this.getBarRectsForDropzoneVisualization(),i=!!this.selectedTask&&this.dropZoneTask.id===this.selectedTask.id;t.forEach((t=>{t.setAttribute("fill",this.getBarColor(i,this.dropZoneTask.styles))}))}getBarRectsForDropzoneVisualization(){let t;if(this.showSecondaryDates){const i=this.svg.querySelector(`.barWrapper[data-type="${this.dropZoneTask.type}"] rect[y='${this.dropZoneTask.ySecondary}']`),e=[i];let s=i.nextElementSibling;for(;null!==s;)e.push(s),s=s.nextElementSibling;let o=i.previousElementSibling;for(;null!==o;)e.unshift(o),o=o.previousElementSibling;t=e}else t=this.svg.querySelectorAll(`.barWrapper[data-type="${this.dropZoneTask.type}"] rect[y='${this.dropZoneTask.ySecondary}']`);return t}handleBarEventStart(t,i,e){var s;if(e)if(a(e)){if("delete"===t&&this.delete)try{const e=this.delete(i);void 0!==e&&e&&this.setGanttEvent({action:t,changedTask:i})}catch(t){console.error("Error on Delete. "+t)}}else if("mouseenter"===t)this.ganttEvent.action||this.setGanttEvent({action:t,changedTask:i,originalSelectedTask:i});else if("mouseleave"===t)"mouseenter"===this.ganttEvent.action&&this.setGanttEvent({action:""});else if("dblclick"===t)this.doubleClick&&this.doubleClick(i);else if("click"===t)!this.hasMovedHorizontally(e)&&this.barClick&&this.barClick(i);else if("contextmenu"===t)e.preventDefault(),this.barContextMenu&&this.barContextMenu(e,i);else if("move"===t){if(!this.svg||!this.point)return;this.point.x=e.clientX;const o=this.point.matrixTransform(null===(s=this.svg.getScreenCTM())||void 0===s?void 0:s.inverse());this.currentTarget="task"===i.type?e.currentTarget.cloneNode(!0):null,this.initEventX1Delta=o.x-i.x1,this.point.y=e.clientY,this.initEventXClick=e.clientX,this.setGanttEvent({action:t,changedTask:i,originalSelectedTask:i})}else this.setGanttEvent({action:t,changedTask:i,originalSelectedTask:i});else"select"===t&&this.setSelectedTask(i.id)}getTaskIcon(t){const e=z.exports.hexToCSSFilter(t.color);return i("image",{href:t.url,filter:e.filter.replace(";",""),x:t.x,y:t.y,width:t.width,height:t.height})}renderKupBar(t,e,s,o){var n,a,r;return i("g",{class:"barWrapper","tab-index":0,"data-type":t.type},this.renderKupBarDisplay(t.x1,t.y,t.x2-t.x1,t.height,t.progressX,t.progressWidth,t.barCornerRadius,t.styles,e,!this.readOnly&&!!this.dateChange&&!t.isDisabled,t,t.x1secondary,(null!==(n=t.x2secondary)&&void 0!==n?n:0)-(null!==(a=t.x1secondary)&&void 0!==a?a:0),t.ySecondary),i("g",{class:"handleGroup"},s&&i("g",null,this.renderKupBarDateHandle(t.x1+1,t.y+1,t.handleWidth,t.height-2,t.barCornerRadius,t,"start"),this.renderKupBarDateHandle(t.x2-t.handleWidth-1,t.y+1,t.handleWidth,t.height-2,t.barCornerRadius,t,"end")),o&&i("polygon",{class:"barHandle",points:this.calculateProgressPoint(t),onMouseDown:i=>{this.handleBarEventStart("progress",t,i)}})),t.icon&&t.icon.url&&this.getTaskIcon({color:null!==(r=t.icon.color)&&void 0!==r?r:"#000000",url:t.icon.url,width:t.height/2+"px",height:t.height/2+"px",x:t.x1+(t.x2-t.x1)-t.height/2/2,y:t.y-t.height/2/2/2+(this.showSecondaryDates?t.height/2:0)}))}renderKupBarDisplay(t,e,s,o,n,a,r,h,l,p,f,c,d,u){if(this.showSecondaryDates&&void 0!==c){const g=o/2;return i("g",{onMouseDown:t=>p&&this.handleBarEventStart("move",f,t)},i("rect",{key:"top semi-transparent bar",x:c,width:d,y:null!=u?u:e,height:g,ry:r,rx:r,fill:this.getBarColor(l,h),opacity:.5,class:"barBackground"}),i("rect",{key:"main bar",x:t,width:s,y:e+g,height:g,ry:r,rx:r,fill:this.getBarColor(l,h),class:"barBackground"}),i("rect",{key:"progress bar",x:n,width:a,y:e+g,height:g,ry:r,rx:r,fill:this.getProcessColor(l,h)}))}return i("g",{onMouseDown:t=>{p&&this.handleBarEventStart("move",f,t)}},i("rect",{x:t,width:s,y:e,height:o,ry:r,rx:r,fill:this.getBarColor(l,h),class:"barBackground"}),i("rect",{x:n,width:a,y:e,height:o,ry:r,rx:r,fill:this.getProcessColor(l,h)}))}renderKupBarDateHandle(t,e,s,o,n,a,r){return i("rect",{x:t,y:e,width:s,height:o,class:"barHandle",ry:n,rx:n,onMouseDown:t=>this.handleBarEventStart(r,a,t)})}renderKupBarSmall(t,e,s,o){return i("g",{class:"barWrapper","tab-index":0},this.renderKupBarDisplay(t.x1,t.y,t.x2-t.x1,t.height,t.progressX,t.progressWidth,t.barCornerRadius,t.styles,e,s,t),i("g",{class:"handleGroup"},o&&i("polygon",{class:"barHandle",points:this.calculateProgressPoint(t,"small"),onMouseDown:i=>{this.handleBarEventStart("progress",t,i)}})))}renderKupBarTimeLine(t,s){return i("g",{"tab-index":0},i("rect",{fill:s,x:"0",width:"100%",y:t.y,height:t.height,rx:0,ry:0}),t.barChildren.map((t=>{var s;return i(e,null,i("rect",{style:{cursor:"pointer"},key:t.id,fill:t.styles.backgroundColor,x:t.x1,width:t.x2-t.x1,y:t.y,height:t.height,rx:t.barCornerRadius,ry:t.barCornerRadius}),t.icon&&t.icon.url&&this.getTaskIcon({color:null!==(s=t.icon.color)&&void 0!==s?s:"#000000",url:t.icon.url,width:t.height+"px",height:t.height+"px",x:t.x1+(t.x2-t.x1)-t.height/2,y:t.y-t.height/2/2}))})))}renderKupArrow(t,e){const[s,o]=this.rtl?this.drownPathAndTriangleRTL(t,this.tasks[e.index],this.rowHeight,this.taskHeight,this.arrowIndent):this.drownPathAndTriangle(t,this.tasks[e.index],this.rowHeight,this.taskHeight,this.arrowIndent);return i("g",{class:"arrow"},i("path",{"stroke-width":"1.5",d:s,fill:"none"}),i("polygon",{points:o}))}drownPathAndTriangle(t,i,e,s,o){const n=i.y+s/2,a=t.x2+2*o;return[`M ${t.x2} ${t.y+s/2}\n h ${o}\n v ${(t.index>i.index?-1:1)*e/2}\n ${a<i.x1?"":"H "+(i.x1-o)}\n V ${n}\n h ${a>i.x1?o:i.x1-t.x2-o}`,`${i.x1},${n}\n ${i.x1-5},${n-5}\n ${i.x1-5},${n+5}`]}drownPathAndTriangleRTL(t,i,e,s,o){const n=i.y+s/2,a=t.x1-2*o;return[`M ${t.x1} ${t.y+s/2}\n h ${-o}\n v ${(t.index>i.index?-1:1)*e/2}\n ${a>i.x2?"":`H ${i.x2+o}`}\n V ${n}\n h ${a<i.x2?-o:i.x2-t.x1+o}`,`${i.x2},${n}\n ${i.x2+5},${n+5}\n ${i.x2+5},${n-5}`]}getBarColor(t,i){return t?i.backgroundSelectedColor:i.backgroundColor}getProcessColor(t,i){return t?i.progressSelectedColor:i.progressColor}calculateProgressPoint(t,i="bar"){return r("bar"==i?+!this.rtl*t.progressWidth+t.progressX:t.progressWidth+t.x1,t.y,t.height)}render(){let t=0;const e=[],s=[i("line",{key:"RowLineFirst",x1:0,y1:0,x2:this.gridProps.svgWidth,y2:0,class:"gridRowLine"})];for(const o of this.tasks)e.push(i("rect",{key:"Row"+o.id,x:0,y:t,width:this.gridProps.svgWidth,height:this.rowHeight,class:"gridRow"})),s.push(i("line",{key:"RowLine"+o.id,x1:0,y1:t+this.rowHeight,x2:this.gridProps.svgWidth,y2:t+this.rowHeight,class:"gridRowLine"})),t+=this.rowHeight;let o=0;const n=[];for(let e=0;e<this.dates.length;e++)n.push(i("line",{key:this.dates[e].getTime(),x1:o,y1:0,x2:o,y2:t,class:"gridTick"})),o+=this.columnWidth;return i("svg",{key:"55d4eb1097be961c627e667e1024cf47fb8638fa",xmlns:"http://www.w3.org/2000/svg",width:this.gridProps.svgWidth,height:this.rowHeight*this.tasks.length+"px","font-family":this.fontFamily,ref:t=>this.svg=t},i("g",{key:"8e4e7083c1c4ddfd4fda90b35d9efb30ed8f9821",class:"grid"},i("g",{key:"09d4491ce14b43c9851052d902feee615131d9e9",class:"rows"},e),i("g",{key:"cad7d7a7d2aac967c4baf70af49c2ed5e40e6970",class:"rowLines"},s),i("g",{key:"ccc47da84182fce20f54a4abab278388bfc79ab5",class:"ticks"},n)),i("g",{key:"4627b926c7705b2ecf82aac0fb05c1a9f02013ca",class:"content"},this.currentDateIndicator&&i("rect",{key:"975e35e5c3b7aea83c8e7406ed885ae25d819300",fill:this.currentDateIndicator.color,x:this.currentDateIndicator.x+1.5,y:"0",width:"2",height:"100%"}),this.projection&&i("rect",{key:"f971ab7a63ab6e4dd0f7ce50c8335402d08d9162",fill:this.projection.color,x:this.projection.x0,y:"0",width:this.projection.xf-this.projection.x0,height:"100%","fill-opacity":"0.35"}),i("g",{key:"547376a8dc4ee5ff9c9f2d1f908f71ac2d229314",class:"arrows",fill:this.arrowColor,stroke:this.arrowColor},this.tasks.map((t=>t.barChildren.map((i=>{"timeline"!==t.type&&this.renderKupArrow(t,i)}))))),i("g",{key:"2013b02ae78d1e0eacaea4b17b134e8b03efdf11",class:"bar","font-family":this.fontFamily,"font-size":this.fontSize},this.tasks.map((t=>{const e="project"===t.type;return i("g",{onKeyDown:i=>{"Delete"===i.key&&(t.isDisabled||this.handleBarEventStart("delete",t,i)),i.stopPropagation()},onMouseEnter:i=>{this.handleBarEventStart("mouseenter",t,i)},onMouseLeave:i=>{this.handleBarEventStart("mouseleave",t,i)},onDblClick:()=>{this.barDblClick(t)},onClick:i=>{this.handleBarEventStart("click",t,i)},onContextMenu:i=>{this.handleBarEventStart("contextmenu",t,i)},onFocus:()=>{this.handleBarEventStart("select",t)},class:"task-wrapper"},(()=>{const i={task:t,arrowIndent:this.arrowIndent,isDelete:!t.isDisabled,taskHeight:this.taskHeight,isSelected:!!this.selectedTask&&t.id===this.selectedTask.id,rtl:this.rtl,hideLabel:this.hideLabel},s=t.styles,o=i.isSelected?s.backgroundSelectedColor:s.backgroundColor,n=!(this.readOnly||!this.dateChange||t.isDisabled||e),a=!this.readOnly&&!!this.progressChange&&!t.isDisabled,r=!this.readOnly&&!!this.dateChange&&!t.isDisabled;switch(t.typeInternal){case"project":default:return this.renderKupBar(t,i.isSelected,n,a);case"smalltask":return this.renderKupBarSmall(t,i.isSelected,r,a);case"timeline":return this.renderKupBarTimeLine(t,o)}})())})),this.currentTarget&&this.ganttEvent.changedTask&&i("g",{key:"1b89a87d8bae74bae83018b25ca741bf843f29a3",class:"task-wrapper"},this.renderKupBar(this.ganttEvent.changedTask,!1,!1,!1)))))}static get watchers(){return{columnWidth:["updateXStep"],dates:["updateXStep"],timeStep:["updateXStep","updateSvgMove"],ganttEvent:["updateSvgMove"],xStep:["updateSvgMove"],svg:["updateSvgMove"],initEventX1Delta:["updateSvgMove"],point:["updateSvgMove"],rtl:["updateSvgMove"],onProgressChange:["updateSvgMove"],onDateChange:["updateSvgMove"]}}};T.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:14px;line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:14px;line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}.gridRow{fill:var(--kup-layer-1)}.gridRowLine{stroke:transparent}.gridTick{stroke:var(--kup-border-subtle)}.barHandle{fill:#ddd;cursor:ew-resize;opacity:0;visibility:hidden}.barBackground{user-select:none;stroke-width:0}.barWrapper{cursor:pointer;outline:none}.task-wrapper{outline:none !important}.barWrapper:hover .barHandle{visibility:visible;opacity:1}.barLabel{fill:var(--kup-layer-0);text-anchor:middle;font-weight:lighter;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}.barLabelOutside{fill:var(--kup-text-secondary);text-anchor:start;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}.ghost-preview{opacity:0.5}";export{g as kup_custom_task_list_header,v as kup_custom_task_list_table,x as kup_gantt_calendar,T as kup_grid_renderer}
|
|
@@ -1,51 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
function isKeyboardEvent(event) {
|
|
4
|
-
return event.key !== undefined;
|
|
5
|
-
}
|
|
6
|
-
function removeHiddenTasks(tasks) {
|
|
7
|
-
const groupedTasks = tasks.filter((t) => t.hideChildren && t.type === 'project');
|
|
8
|
-
if (groupedTasks.length > 0) {
|
|
9
|
-
for (let i = 0; groupedTasks.length > i; i++) {
|
|
10
|
-
const groupedTask = groupedTasks[i];
|
|
11
|
-
const children = getChildren(tasks, groupedTask);
|
|
12
|
-
tasks = tasks.filter((t) => children.indexOf(t) === -1);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return tasks;
|
|
16
|
-
}
|
|
17
|
-
function getChildren(taskList, task) {
|
|
18
|
-
let tasks = [];
|
|
19
|
-
if (task.type !== 'project') {
|
|
20
|
-
tasks = taskList.filter((t) => t.dependencies && t.dependencies.indexOf(task.id) !== -1);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
tasks = taskList.filter((t) => t.project && t.project === task.id);
|
|
24
|
-
}
|
|
25
|
-
var taskChildren = [];
|
|
26
|
-
tasks.forEach((t) => {
|
|
27
|
-
taskChildren.push(...getChildren(taskList, t));
|
|
28
|
-
});
|
|
29
|
-
tasks = tasks.concat(tasks, taskChildren);
|
|
30
|
-
return tasks;
|
|
31
|
-
}
|
|
32
|
-
const sortTasks = (taskA, taskB) => {
|
|
33
|
-
const orderA = taskA.displayOrder || Number.MAX_VALUE;
|
|
34
|
-
const orderB = taskB.displayOrder || Number.MAX_VALUE;
|
|
35
|
-
if (orderA > orderB) {
|
|
36
|
-
return 1;
|
|
37
|
-
}
|
|
38
|
-
else if (orderA < orderB) {
|
|
39
|
-
return -1;
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
return 0;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
const createArrayFromNum = (number) => {
|
|
46
|
-
return Array.from({ length: number }, (_, index) => index);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
3
|
const convertToBarTasks = (tasks, dates, columnWidth, rowHeight, taskHeight, projectHeight, timelineHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, showSecondaryDates) => {
|
|
50
4
|
let barTasks = tasks.map((t, i) => {
|
|
51
5
|
return convertToBarTask(t, i, dates, columnWidth, rowHeight, taskHeight, projectHeight, timelineHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, showSecondaryDates);
|
|
@@ -393,6 +347,52 @@ function calculateProjection(start, end, dates, columnWidth) {
|
|
|
393
347
|
};
|
|
394
348
|
}
|
|
395
349
|
|
|
350
|
+
function isKeyboardEvent(event) {
|
|
351
|
+
return event.key !== undefined;
|
|
352
|
+
}
|
|
353
|
+
function removeHiddenTasks(tasks) {
|
|
354
|
+
const groupedTasks = tasks.filter((t) => t.hideChildren && t.type === 'project');
|
|
355
|
+
if (groupedTasks.length > 0) {
|
|
356
|
+
for (let i = 0; groupedTasks.length > i; i++) {
|
|
357
|
+
const groupedTask = groupedTasks[i];
|
|
358
|
+
const children = getChildren(tasks, groupedTask);
|
|
359
|
+
tasks = tasks.filter((t) => children.indexOf(t) === -1);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
return tasks;
|
|
363
|
+
}
|
|
364
|
+
function getChildren(taskList, task) {
|
|
365
|
+
let tasks = [];
|
|
366
|
+
if (task.type !== 'project') {
|
|
367
|
+
tasks = taskList.filter((t) => t.dependencies && t.dependencies.indexOf(task.id) !== -1);
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
tasks = taskList.filter((t) => t.project && t.project === task.id);
|
|
371
|
+
}
|
|
372
|
+
var taskChildren = [];
|
|
373
|
+
tasks.forEach((t) => {
|
|
374
|
+
taskChildren.push(...getChildren(taskList, t));
|
|
375
|
+
});
|
|
376
|
+
tasks = tasks.concat(tasks, taskChildren);
|
|
377
|
+
return tasks;
|
|
378
|
+
}
|
|
379
|
+
const sortTasks = (taskA, taskB) => {
|
|
380
|
+
const orderA = taskA.displayOrder || Number.MAX_VALUE;
|
|
381
|
+
const orderB = taskB.displayOrder || Number.MAX_VALUE;
|
|
382
|
+
if (orderA > orderB) {
|
|
383
|
+
return 1;
|
|
384
|
+
}
|
|
385
|
+
else if (orderA < orderB) {
|
|
386
|
+
return -1;
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
return 0;
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
const createArrayFromNum = (number) => {
|
|
393
|
+
return Array.from({ length: number }, (_, index) => index);
|
|
394
|
+
};
|
|
395
|
+
|
|
396
396
|
exports.calculateCurrentDateCalculator = calculateCurrentDateCalculator;
|
|
397
397
|
exports.calculateProjection = calculateProjection;
|
|
398
398
|
exports.convertToBarTasks = convertToBarTasks;
|
|
@@ -1,49 +1,3 @@
|
|
|
1
|
-
function isKeyboardEvent(event) {
|
|
2
|
-
return event.key !== undefined;
|
|
3
|
-
}
|
|
4
|
-
function removeHiddenTasks(tasks) {
|
|
5
|
-
const groupedTasks = tasks.filter((t) => t.hideChildren && t.type === 'project');
|
|
6
|
-
if (groupedTasks.length > 0) {
|
|
7
|
-
for (let i = 0; groupedTasks.length > i; i++) {
|
|
8
|
-
const groupedTask = groupedTasks[i];
|
|
9
|
-
const children = getChildren(tasks, groupedTask);
|
|
10
|
-
tasks = tasks.filter((t) => children.indexOf(t) === -1);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return tasks;
|
|
14
|
-
}
|
|
15
|
-
function getChildren(taskList, task) {
|
|
16
|
-
let tasks = [];
|
|
17
|
-
if (task.type !== 'project') {
|
|
18
|
-
tasks = taskList.filter((t) => t.dependencies && t.dependencies.indexOf(task.id) !== -1);
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
tasks = taskList.filter((t) => t.project && t.project === task.id);
|
|
22
|
-
}
|
|
23
|
-
var taskChildren = [];
|
|
24
|
-
tasks.forEach((t) => {
|
|
25
|
-
taskChildren.push(...getChildren(taskList, t));
|
|
26
|
-
});
|
|
27
|
-
tasks = tasks.concat(tasks, taskChildren);
|
|
28
|
-
return tasks;
|
|
29
|
-
}
|
|
30
|
-
const sortTasks = (taskA, taskB) => {
|
|
31
|
-
const orderA = taskA.displayOrder || Number.MAX_VALUE;
|
|
32
|
-
const orderB = taskB.displayOrder || Number.MAX_VALUE;
|
|
33
|
-
if (orderA > orderB) {
|
|
34
|
-
return 1;
|
|
35
|
-
}
|
|
36
|
-
else if (orderA < orderB) {
|
|
37
|
-
return -1;
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
return 0;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
const createArrayFromNum = (number) => {
|
|
44
|
-
return Array.from({ length: number }, (_, index) => index);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
1
|
const convertToBarTasks = (tasks, dates, columnWidth, rowHeight, taskHeight, projectHeight, timelineHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, showSecondaryDates) => {
|
|
48
2
|
let barTasks = tasks.map((t, i) => {
|
|
49
3
|
return convertToBarTask(t, i, dates, columnWidth, rowHeight, taskHeight, projectHeight, timelineHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, showSecondaryDates);
|
|
@@ -391,4 +345,50 @@ function calculateProjection(start, end, dates, columnWidth) {
|
|
|
391
345
|
};
|
|
392
346
|
}
|
|
393
347
|
|
|
348
|
+
function isKeyboardEvent(event) {
|
|
349
|
+
return event.key !== undefined;
|
|
350
|
+
}
|
|
351
|
+
function removeHiddenTasks(tasks) {
|
|
352
|
+
const groupedTasks = tasks.filter((t) => t.hideChildren && t.type === 'project');
|
|
353
|
+
if (groupedTasks.length > 0) {
|
|
354
|
+
for (let i = 0; groupedTasks.length > i; i++) {
|
|
355
|
+
const groupedTask = groupedTasks[i];
|
|
356
|
+
const children = getChildren(tasks, groupedTask);
|
|
357
|
+
tasks = tasks.filter((t) => children.indexOf(t) === -1);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
return tasks;
|
|
361
|
+
}
|
|
362
|
+
function getChildren(taskList, task) {
|
|
363
|
+
let tasks = [];
|
|
364
|
+
if (task.type !== 'project') {
|
|
365
|
+
tasks = taskList.filter((t) => t.dependencies && t.dependencies.indexOf(task.id) !== -1);
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
tasks = taskList.filter((t) => t.project && t.project === task.id);
|
|
369
|
+
}
|
|
370
|
+
var taskChildren = [];
|
|
371
|
+
tasks.forEach((t) => {
|
|
372
|
+
taskChildren.push(...getChildren(taskList, t));
|
|
373
|
+
});
|
|
374
|
+
tasks = tasks.concat(tasks, taskChildren);
|
|
375
|
+
return tasks;
|
|
376
|
+
}
|
|
377
|
+
const sortTasks = (taskA, taskB) => {
|
|
378
|
+
const orderA = taskA.displayOrder || Number.MAX_VALUE;
|
|
379
|
+
const orderB = taskB.displayOrder || Number.MAX_VALUE;
|
|
380
|
+
if (orderA > orderB) {
|
|
381
|
+
return 1;
|
|
382
|
+
}
|
|
383
|
+
else if (orderA < orderB) {
|
|
384
|
+
return -1;
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
return 0;
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
const createArrayFromNum = (number) => {
|
|
391
|
+
return Array.from({ length: number }, (_, index) => index);
|
|
392
|
+
};
|
|
393
|
+
|
|
394
394
|
export { calculateCurrentDateCalculator as a, calculateProjection as b, convertToBarTasks as c, createArrayFromNum as d, getProgressPoint as g, handleTaskBySVGMouseEvent as h, isKeyboardEvent as i, removeHiddenTasks as r, sortTasks as s };
|
|
File without changes
|