@sme.up/ketchup 9.6.3 → 9.6.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/{bar.helpers-f46a5a83.js → bar.helpers-c481a535.js} +45 -13
- package/dist/cjs/{f-button-9a0eba42.js → f-button-23ec3db5.js} +1 -1
- package/dist/cjs/{f-cell-1ad41071.js → f-cell-bcc51c0f.js} +9 -29
- package/dist/cjs/{f-chip-48851b4f.js → f-chip-63363ecf.js} +2 -2
- package/dist/cjs/{f-image-541e5f4d.js → f-image-f3944c01.js} +2 -5
- package/dist/cjs/{f-paginator-utils-8ff2a9b4.js → f-paginator-utils-60e05759.js} +3 -3
- package/dist/cjs/{f-text-field-ac5d6497.js → f-text-field-354b6c78.js} +1 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/ketchup.cjs.js +1 -1
- package/dist/cjs/kup-accordion.cjs.entry.js +3 -3
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +48 -48
- package/dist/cjs/kup-box.cjs.entry.js +8 -8
- package/dist/cjs/kup-calendar.cjs.entry.js +5 -5
- package/dist/cjs/kup-card-list.cjs.entry.js +2 -2
- package/dist/cjs/kup-cell.cjs.entry.js +7 -7
- package/dist/cjs/kup-custom-task-list-header_4.cjs.entry.js +256 -40
- package/dist/cjs/kup-dashboard.cjs.entry.js +5 -5
- package/dist/cjs/{kup-dates-b7d53b4d.js → kup-dates-e22ee32c.js} +21 -0
- package/dist/cjs/kup-drawer.cjs.entry.js +2 -2
- package/dist/cjs/kup-echart.cjs.entry.js +2 -2
- package/dist/cjs/kup-editor.cjs.entry.js +2 -2
- package/dist/cjs/kup-family-tree.cjs.entry.js +4 -4
- package/dist/cjs/kup-gantt_10.cjs.entry.js +105 -39
- package/dist/cjs/kup-grid.cjs.entry.js +2 -2
- package/dist/cjs/kup-iframe.cjs.entry.js +2 -2
- package/dist/cjs/kup-image-list.cjs.entry.js +21 -14
- package/dist/cjs/kup-input-panel.cjs.entry.js +444 -0
- package/dist/cjs/kup-lazy.cjs.entry.js +13 -13
- package/dist/cjs/kup-magic-box.cjs.entry.js +6 -6
- package/dist/cjs/{kup-manager-26a9154b.js → kup-manager-e1bfd4f8.js} +656 -121
- package/dist/cjs/kup-nav-bar.cjs.entry.js +3 -3
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +4 -4
- package/dist/cjs/kup-pdf.cjs.entry.js +76600 -0
- package/dist/cjs/kup-photo-frame.cjs.entry.js +4 -4
- package/dist/cjs/{kup-planner-declarations-d3dec885.js → kup-planner-declarations-cb33663d.js} +3 -0
- package/dist/cjs/{kup-planner-renderer-helper-680bbd5a.js → kup-planner-renderer-helper-f001fad7.js} +56 -8
- package/dist/cjs/kup-planner-renderer.cjs.entry.js +44 -11
- package/dist/cjs/{kup-planner-time-formatter-a74e70f0.js → kup-planner-time-formatter-b7dca3ea.js} +3 -0
- package/dist/cjs/kup-planner.cjs.entry.js +81 -9
- package/dist/cjs/kup-probe.cjs.entry.js +3 -3
- package/dist/cjs/kup-qlik.cjs.entry.js +3 -3
- package/dist/cjs/kup-snackbar.cjs.entry.js +5 -5
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/image-list.js +332 -2
- package/dist/collection/assets/index.js +8 -0
- package/dist/collection/assets/input-panel.js +480 -0
- package/dist/collection/assets/pdf.js +15 -0
- package/dist/collection/assets/planner-example-5.js +19 -7
- package/dist/collection/assets/planner-example-6.js +3 -0
- package/dist/collection/assets/planner.js +4 -3
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/kup-badge/kup-badge.css +4 -4
- package/dist/collection/components/kup-image-list/kup-image-list.css +37 -4
- package/dist/collection/components/kup-image-list/kup-image-list.js +15 -8
- package/dist/collection/components/kup-input-panel/kup-input-panel-declarations.js +8 -0
- package/dist/collection/components/kup-input-panel/kup-input-panel.css +169 -0
- package/dist/collection/components/kup-input-panel/kup-input-panel.e2e.js +346 -0
- package/dist/collection/components/kup-input-panel/kup-input-panel.js +669 -0
- package/dist/collection/components/kup-lazy/kup-lazy.js +11 -11
- package/dist/collection/components/kup-list/kup-list.js +1 -1
- package/dist/collection/components/kup-magic-box/kup-magic-box.js +3 -3
- package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +1 -1
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.js +1 -1
- package/dist/collection/components/kup-pdf/kup-pdf-declarations.js +8 -0
- package/dist/collection/components/kup-pdf/kup-pdf.css +169 -0
- package/dist/collection/components/kup-pdf/kup-pdf.js +262 -0
- package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +2 -2
- package/dist/collection/components/kup-planner/kup-planner-declarations.js +3 -0
- package/dist/collection/components/kup-planner/kup-planner-helper.js +42 -1
- package/dist/collection/components/kup-planner/kup-planner.js +191 -5
- package/dist/collection/components/kup-planner/utils/custom-task-list-header.js +2 -2
- package/dist/collection/components/kup-planner/utils/custom-task-list-table.js +103 -11
- package/dist/collection/components/kup-planner/utils/gantt-table.module.css +80 -2
- package/dist/collection/components/kup-planner/utils/helpers/bar.helpers.js +41 -13
- package/dist/collection/components/kup-planner/utils/helpers/other.helpers.js +3 -0
- package/dist/collection/components/kup-planner/utils/kup-gantt/kup-gantt.css +10 -0
- package/dist/collection/components/kup-planner/utils/kup-gantt/kup-gantt.js +61 -6
- package/dist/collection/components/kup-planner/utils/kup-gantt-calendar/kup-gantt-calendar.js +32 -2
- package/dist/collection/components/kup-planner/utils/kup-grid-renderer/kup-grid-renderer.css +4 -0
- package/dist/collection/components/kup-planner/utils/kup-grid-renderer/kup-grid-renderer.js +208 -24
- package/dist/collection/components/kup-planner/utils/kup-horizontal-scroll/kup-horizontal-scroll.css +4 -0
- package/dist/collection/components/kup-planner/utils/kup-horizontal-scroll/kup-horizontal-scroll.js +131 -7
- package/dist/collection/components/kup-planner/utils/kup-planner-renderer-helper.js +55 -6
- package/dist/collection/components/kup-planner/utils/kup-planner-renderer.js +40 -7
- package/dist/collection/components/kup-planner/utils/kup-switcher/kup-switcher.css +22 -15
- package/dist/collection/components/kup-planner/utils/kup-switcher/kup-switcher.js +21 -5
- package/dist/collection/components/kup-planner/utils/kup-task-gantt/kup-task-gantt.js +19 -3
- package/dist/collection/components/kup-planner/utils/kup-task-list/kup-task-list-header.js +7 -7
- package/dist/collection/components/kup-planner/utils/kup-task-list/kup-task-list-table.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-task-list/kup-task-list.js +76 -2
- package/dist/collection/components/kup-planner/utils/kup-tooltip/kup-standard-tooltip.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-tooltip/kup-tooltip.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-vertical-scroll/kup-vertical-scroll.js +2 -2
- package/dist/collection/components/kup-probe/kup-probe.js +1 -1
- package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +1 -1
- package/dist/collection/components/kup-qlik/kup-qlik.js +1 -1
- package/dist/collection/components/kup-rating/kup-rating.js +1 -1
- package/dist/collection/components/kup-snackbar/kup-snackbar.js +1 -1
- package/dist/collection/components/kup-spinner/kup-spinner.js +34 -34
- package/dist/collection/components/kup-switch/kup-switch.js +1 -1
- package/dist/collection/components/kup-time-picker/kup-time-picker.js +1 -1
- package/dist/collection/f-components/f-cell/f-cell.js +5 -24
- package/dist/collection/f-components/f-image/f-image.js +2 -5
- package/dist/collection/managers/kup-theme/kup-theme-declarations.js +7 -0
- package/dist/collection/types/GenericTypes.js +1 -0
- package/dist/components/_commonjsHelpers.js +26 -0
- package/dist/components/custom-task-list-header.js +2 -2
- package/dist/components/custom-task-list-table.js +58 -13
- package/dist/components/kup-autocomplete2.js +48 -70
- package/dist/components/kup-box2.js +1 -1
- package/dist/components/kup-calendar.js +2 -2
- package/dist/components/kup-cell.js +1 -1
- package/dist/components/kup-dashboard.js +1 -1
- package/dist/components/kup-dates.js +2 -6
- package/dist/components/kup-echart2.js +1 -1
- package/dist/components/kup-editor.js +1 -1
- package/dist/components/kup-gantt-calendar2.js +31 -1
- package/dist/components/kup-gantt2.js +26 -7
- package/dist/components/kup-grid-renderer2.js +219 -81
- package/dist/components/kup-grid2.js +1 -1
- package/dist/components/kup-horizontal-scroll2.js +48 -10
- package/dist/components/kup-iframe.js +1 -1
- package/dist/components/kup-image-list.js +15 -8
- package/dist/components/kup-input-panel.d.ts +11 -0
- package/dist/components/kup-input-panel.js +595 -0
- package/dist/components/kup-lazy.js +11 -11
- package/dist/components/kup-magic-box.js +4 -4
- package/dist/components/kup-manager.js +658 -122
- package/dist/components/kup-nav-bar.js +1 -1
- package/dist/components/kup-numeric-picker.js +2 -2
- package/dist/components/kup-pdf.d.ts +11 -0
- package/dist/components/kup-pdf.js +76756 -0
- package/dist/components/kup-photo-frame.js +2 -2
- package/dist/components/kup-planner-declarations.js +91 -0
- package/dist/components/kup-planner-renderer2.js +42 -9
- package/dist/components/kup-planner.js +86 -6
- package/dist/components/kup-probe.js +1 -1
- package/dist/components/kup-qlik.js +1 -1
- package/dist/components/kup-snackbar.js +1 -1
- package/dist/components/kup-standard-tooltip2.js +1 -1
- package/dist/components/kup-switcher2.js +19 -7
- package/dist/components/kup-task-gantt2.js +6 -4
- package/dist/components/kup-task-list-header2.js +7 -7
- package/dist/components/kup-task-list-table2.js +1 -1
- package/dist/components/kup-task-list2.js +434 -84
- package/dist/components/kup-tooltip2.js +1 -1
- package/dist/components/kup-vertical-scroll2.js +2 -2
- package/dist/components/other.helpers.js +47 -0
- package/dist/esm/{bar.helpers-0898efb9.js → bar.helpers-23a51579.js} +45 -14
- package/dist/esm/{f-button-45d690a5.js → f-button-d6dbcfd6.js} +1 -1
- package/dist/esm/{f-cell-63db06db.js → f-cell-7b41415c.js} +9 -29
- package/dist/esm/{f-chip-f1ab6c5e.js → f-chip-68d27d7a.js} +2 -2
- package/dist/esm/{f-image-8b382cc5.js → f-image-a67229e5.js} +2 -5
- package/dist/esm/{f-paginator-utils-ae563cd5.js → f-paginator-utils-8773e358.js} +3 -3
- package/dist/esm/{f-text-field-b5fcb598.js → f-text-field-d364ffd2.js} +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/ketchup.js +1 -1
- package/dist/esm/kup-accordion.entry.js +3 -3
- package/dist/esm/kup-autocomplete_27.entry.js +48 -48
- package/dist/esm/kup-box.entry.js +8 -8
- package/dist/esm/kup-calendar.entry.js +5 -5
- package/dist/esm/kup-card-list.entry.js +2 -2
- package/dist/esm/kup-cell.entry.js +7 -7
- package/dist/esm/kup-custom-task-list-header_4.entry.js +256 -40
- package/dist/esm/kup-dashboard.entry.js +5 -5
- package/dist/esm/{kup-dates-4ad48be7.js → kup-dates-26a56bf7.js} +20 -1
- package/dist/esm/kup-drawer.entry.js +2 -2
- package/dist/esm/kup-echart.entry.js +2 -2
- package/dist/esm/kup-editor.entry.js +2 -2
- package/dist/esm/kup-family-tree.entry.js +4 -4
- package/dist/esm/kup-gantt_10.entry.js +106 -40
- package/dist/esm/kup-grid.entry.js +2 -2
- package/dist/esm/kup-iframe.entry.js +2 -2
- package/dist/esm/kup-image-list.entry.js +21 -14
- package/dist/esm/kup-input-panel.entry.js +440 -0
- package/dist/esm/kup-lazy.entry.js +13 -13
- package/dist/esm/kup-magic-box.entry.js +6 -6
- package/dist/esm/{kup-manager-cdb4f21a.js → kup-manager-a316a70e.js} +656 -121
- package/dist/esm/kup-nav-bar.entry.js +3 -3
- package/dist/esm/kup-numeric-picker.entry.js +4 -4
- package/dist/esm/kup-pdf.entry.js +76596 -0
- package/dist/esm/kup-photo-frame.entry.js +4 -4
- package/dist/esm/{kup-planner-declarations-b9345758.js → kup-planner-declarations-398babf9.js} +3 -0
- package/dist/esm/{kup-planner-renderer-helper-da0518be.js → kup-planner-renderer-helper-a2ec9a1c.js} +57 -8
- package/dist/esm/kup-planner-renderer.entry.js +44 -11
- package/dist/esm/{kup-planner-time-formatter-a68e05ba.js → kup-planner-time-formatter-ddf84f9b.js} +1 -1
- package/dist/esm/kup-planner.entry.js +81 -9
- package/dist/esm/kup-probe.entry.js +3 -3
- package/dist/esm/kup-qlik.entry.js +3 -3
- package/dist/esm/kup-snackbar.entry.js +5 -5
- package/dist/esm/loader.js +1 -1
- package/dist/ketchup/index.esm.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-008bdcdc.js +1 -0
- package/dist/ketchup/p-042e874a.entry.js +1 -0
- package/dist/ketchup/{p-837bd0a6.entry.js → p-074ccd53.entry.js} +1 -1
- package/dist/ketchup/{p-41e8402e.entry.js → p-1088ab22.entry.js} +1 -1
- package/dist/ketchup/{p-d9284d98.entry.js → p-1bcac01f.entry.js} +1 -1
- package/dist/ketchup/{p-e0a1fbe7.entry.js → p-1e028d95.entry.js} +1 -1
- package/dist/ketchup/p-25058baa.js +1 -0
- package/dist/ketchup/{p-cbe42afd.entry.js → p-2932e7e8.entry.js} +1 -1
- package/dist/ketchup/{p-1cd48eea.entry.js → p-2b84db7b.entry.js} +1 -1
- package/dist/ketchup/{p-d608f866.entry.js → p-2ef90f60.entry.js} +1 -1
- package/dist/ketchup/{p-bedabdb5.js → p-339bbeae.js} +1 -1
- package/dist/ketchup/{p-157f0e89.entry.js → p-48e45ac0.entry.js} +1 -1
- package/dist/ketchup/p-53af4c87.js +1 -0
- package/dist/ketchup/{p-4dfc5927.entry.js → p-556f7ddc.entry.js} +1 -1
- package/dist/ketchup/{p-cc7352a8.entry.js → p-5f7d8c21.entry.js} +1 -1
- package/dist/ketchup/{p-e0c10de2.entry.js → p-6362738c.entry.js} +1 -1
- package/dist/ketchup/{p-ad6a3c2a.entry.js → p-65e363c6.entry.js} +1 -1
- package/dist/ketchup/p-6921bc81.entry.js +16 -0
- package/dist/ketchup/p-6961e0ce.entry.js +1 -0
- package/dist/ketchup/p-7123d2a4.entry.js +1 -0
- package/dist/ketchup/{p-a5074ce4.js → p-801776bc.js} +1 -1
- package/dist/ketchup/{p-ca8a1f53.entry.js → p-81645576.entry.js} +1 -1
- package/dist/ketchup/p-838dea62.js +1 -0
- package/dist/ketchup/{p-924b841b.js → p-84b511e1.js} +1 -1
- package/dist/ketchup/{p-9a856951.js → p-8d4050ec.js} +4 -4
- package/dist/ketchup/{p-1474852d.entry.js → p-9e2533e1.entry.js} +1 -1
- package/dist/ketchup/{p-c6b34763.entry.js → p-a06974a3.entry.js} +1 -1
- package/dist/ketchup/p-a6beb822.js +1 -0
- package/dist/ketchup/p-abe181d0.entry.js +1 -0
- package/dist/ketchup/{p-ba0f28b7.js → p-b3540f83.js} +1 -1
- package/dist/ketchup/{p-b6a21b6a.entry.js → p-c702eb45.entry.js} +1 -1
- package/dist/ketchup/{p-090e5097.entry.js → p-ccb6dbb0.entry.js} +1 -1
- package/dist/ketchup/{p-d839ce21.entry.js → p-cf44485a.entry.js} +2 -2
- package/dist/ketchup/p-d2001dec.entry.js +44 -0
- package/dist/ketchup/{p-e508b2fd.entry.js → p-dbb6cd8d.entry.js} +1 -1
- package/dist/ketchup/p-eb8ea3a6.js +1 -0
- package/dist/ketchup/{p-590c34bc.js → p-f6c8f006.js} +1 -1
- package/dist/ketchup/{p-4c100286.entry.js → p-f79ffe77.entry.js} +1 -1
- package/dist/ketchup/{p-31c0cfc0.entry.js → p-fdcfaedd.entry.js} +1 -1
- package/dist/ketchup/p-fe75ede2.entry.js +1 -0
- package/dist/types/components/kup-image-list/kup-image-list.d.ts +1 -1
- package/dist/types/components/kup-input-panel/kup-input-panel-declarations.d.ts +81 -0
- package/dist/types/components/kup-input-panel/kup-input-panel.d.ts +67 -0
- package/dist/types/components/kup-pdf/kup-pdf-declarations.d.ts +7 -0
- package/dist/types/components/kup-pdf/kup-pdf.d.ts +42 -0
- package/dist/types/components/kup-planner/kup-planner-declarations.d.ts +29 -2
- package/dist/types/components/kup-planner/kup-planner-helper.d.ts +2 -1
- package/dist/types/components/kup-planner/kup-planner.d.ts +38 -0
- package/dist/types/components/kup-planner/utils/custom-task-list-table.d.ts +7 -0
- package/dist/types/components/kup-planner/utils/helpers/bar.helpers.d.ts +1 -1
- package/dist/types/components/kup-planner/utils/helpers/other.helpers.d.ts +1 -0
- package/dist/types/components/kup-planner/utils/kup-gantt/kup-gantt.d.ts +6 -0
- package/dist/types/components/kup-planner/utils/kup-gantt-calendar/kup-gantt-calendar.d.ts +1 -0
- package/dist/types/components/kup-planner/utils/kup-grid-renderer/kup-grid-renderer.d.ts +13 -1
- package/dist/types/components/kup-planner/utils/kup-horizontal-scroll/kup-horizontal-scroll.d.ts +7 -0
- package/dist/types/components/kup-planner/utils/kup-planner-renderer-helper.d.ts +6 -2
- package/dist/types/components/kup-planner/utils/kup-planner-renderer.d.ts +1 -0
- package/dist/types/components/kup-planner/utils/kup-switcher/kup-switcher.d.ts +3 -1
- package/dist/types/components/kup-planner/utils/kup-task-gantt/kup-task-gantt.d.ts +1 -0
- package/dist/types/components/kup-planner/utils/kup-task-list/kup-task-list.d.ts +4 -0
- package/dist/types/components.d.ts +266 -2
- package/dist/types/types/GenericTypes.d.ts +1 -0
- package/package.json +2 -1
- package/dist/components/kup-planner-renderer-helper.js +0 -379
- package/dist/ketchup/p-21351b19.entry.js +0 -1
- package/dist/ketchup/p-2b40d9b9.entry.js +0 -1
- package/dist/ketchup/p-5c79cb74.js +0 -1
- package/dist/ketchup/p-670354ef.entry.js +0 -1
- package/dist/ketchup/p-8e3b6de8.js +0 -1
- package/dist/ketchup/p-935f58fc.js +0 -1
- package/dist/ketchup/p-9852b1e9.js +0 -1
- package/dist/ketchup/p-ca42a421.entry.js +0 -16
- package/dist/ketchup/p-d50515f7.js +0 -1
- package/dist/ketchup/p-e841c2ae.js +0 -1
- package/dist/ketchup/p-ec4050e1.entry.js +0 -1
|
@@ -1,94 +1,433 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { K as KUP_PLANNER_MAIN_GANTT_ID } from './kup-planner-declarations.js';
|
|
3
|
+
import { b as KupDates } from './kup-dates.js';
|
|
3
4
|
import { d as defineCustomElement$2 } from './custom-task-list-header.js';
|
|
4
5
|
import { d as defineCustomElement$1 } from './custom-task-list-table.js';
|
|
5
6
|
|
|
7
|
+
const columnWidthForTimeUnit = (timeUnit) => {
|
|
8
|
+
switch (timeUnit) {
|
|
9
|
+
case 'year':
|
|
10
|
+
return 60 * 2;
|
|
11
|
+
default:
|
|
12
|
+
return 60;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const getProjectById = (id, items) => {
|
|
16
|
+
for (let i = 0; i < items.length; i++) {
|
|
17
|
+
if (items[i].id === id) {
|
|
18
|
+
return items[i];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
};
|
|
23
|
+
const getPhaseById = (id, items) => {
|
|
24
|
+
for (let i = 0; i < items.length; i++) {
|
|
25
|
+
if (isDetail(items[i])) {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
const item = items[i];
|
|
29
|
+
if (!item.phases) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
for (let j = 0; j < item.phases.length; j++)
|
|
33
|
+
if (item.phases[j].id === id) {
|
|
34
|
+
return item.phases[j];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return undefined;
|
|
38
|
+
};
|
|
39
|
+
const isDetail = (row) => {
|
|
40
|
+
return (row &&
|
|
41
|
+
row.schedule &&
|
|
42
|
+
row.schedule.length !== 0);
|
|
43
|
+
};
|
|
44
|
+
const mergeTaskIntoProjects = (projects, { id, start, end, startHour, endHour }) => projects.map((project) => project.id === id ? withNewDates(project, start, end, startHour, endHour) : project);
|
|
45
|
+
const mergeTaskIntoPhases = (phases, { id, start, end, startHour, endHour }) => {
|
|
46
|
+
if (phases) {
|
|
47
|
+
return phases.map((phase) => phase.id === id ? withNewDates(phase, start, end, startHour, endHour) : phase);
|
|
48
|
+
}
|
|
49
|
+
return undefined;
|
|
50
|
+
};
|
|
51
|
+
const convertProjectToTasks = (item, mainGanttStartDate, mainGanttEndDate) => {
|
|
52
|
+
var _a;
|
|
53
|
+
if (!isDetail(item)) {
|
|
54
|
+
const kupDates = new KupDates();
|
|
55
|
+
const row = item;
|
|
56
|
+
const { start, end } = kupDates.validDates(row.startDate, row.endDate, row.name);
|
|
57
|
+
const { start: start2, end: end2 } = kupDates.validDates(row.secondaryStartDate, row.secondaryEndDate, row.name);
|
|
58
|
+
const mainTask = {
|
|
59
|
+
/**
|
|
60
|
+
* La libreria lo intende come le ore 00:00, che non è coerente
|
|
61
|
+
* con come vorremmo ragionare noi. Es.: se un task finisce il 9 luglio,
|
|
62
|
+
* la libreria colora le celle fino all'8 luglio compreso, ma non il 9;
|
|
63
|
+
* noi invece vorremmo colorare anche il 9.
|
|
64
|
+
* Possibili workaround: gestirsi ovunque il giorno di differenza (😱);
|
|
65
|
+
* impostare le conversioni dell'intervallo di fine come orario 23:59.
|
|
66
|
+
* In ogni caso va a cozzare con il calcolo delle durate
|
|
67
|
+
* (es.: dall'1 al 5 luglio => risulta 4 giorni ma dovrebbe
|
|
68
|
+
* essere 5 perché includiamo gli estremi; se sommiamo 23:59 ore
|
|
69
|
+
* risulta ancora 4 per la libreria, e 4.99.. se calcolato a mano, e
|
|
70
|
+
* ci vuole un Math.round come minimo)
|
|
71
|
+
*/
|
|
72
|
+
start: start,
|
|
73
|
+
end: end,
|
|
74
|
+
id: row.id,
|
|
75
|
+
name: row.name,
|
|
76
|
+
type: row.type,
|
|
77
|
+
valuesToShow: row.valuesToShow,
|
|
78
|
+
secondaryStart: start2,
|
|
79
|
+
secondaryEnd: end2,
|
|
80
|
+
progress: 100,
|
|
81
|
+
/** Non disabilita clic nè select, ma solo il resize/move */
|
|
82
|
+
isDisabled: false,
|
|
83
|
+
hideChildren: false,
|
|
84
|
+
icon: row.icon,
|
|
85
|
+
startHour: item.startHour,
|
|
86
|
+
endHour: item.endHour,
|
|
87
|
+
secondaryStartHour: item.secondaryStartHour,
|
|
88
|
+
secondaryEndHour: item.secondaryEndHour
|
|
89
|
+
};
|
|
90
|
+
const children1 = ((_a = row.phases) !== null && _a !== void 0 ? _a : []).map(convertPhaseToTask);
|
|
91
|
+
return [mainTask, ...children1];
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
const row = item;
|
|
95
|
+
return [
|
|
96
|
+
Object.assign({}, convertDetailToTimeline(row, mainGanttStartDate, mainGanttEndDate)),
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const convertPhaseToTask = (item) => {
|
|
101
|
+
const mapPhase = ({ startDate: phaseStart, endDate: phaseEnd, secondaryStartDate, secondaryEndDate, name: phaseName, id: phaseId, color, selectedColor, dependencies, icon, startHour, endHour, secondaryStartHour, secondaryEndHour, }) => {
|
|
102
|
+
const kupDates = new KupDates();
|
|
103
|
+
const { start, end } = kupDates.validDates(phaseStart, phaseEnd, phaseName);
|
|
104
|
+
const { start: phaseStart2, end: phaseEnd2 } = kupDates.validDates(secondaryStartDate, secondaryEndDate, phaseName);
|
|
105
|
+
return {
|
|
106
|
+
start,
|
|
107
|
+
end,
|
|
108
|
+
secondaryStart: phaseStart2,
|
|
109
|
+
secondaryEnd: phaseEnd2,
|
|
110
|
+
name: phaseName,
|
|
111
|
+
valuesToShow: item.valuesToShow,
|
|
112
|
+
id: phaseId,
|
|
113
|
+
type: 'task',
|
|
114
|
+
progress: 100,
|
|
115
|
+
dependencies,
|
|
116
|
+
/**
|
|
117
|
+
* Colori custom per specifico task - ci serve per distinguere le fasi
|
|
118
|
+
*/
|
|
119
|
+
styles: color
|
|
120
|
+
? {
|
|
121
|
+
backgroundColor: color,
|
|
122
|
+
progressColor: color,
|
|
123
|
+
backgroundSelectedColor: selectedColor,
|
|
124
|
+
progressSelectedColor: selectedColor,
|
|
125
|
+
}
|
|
126
|
+
: {},
|
|
127
|
+
icon,
|
|
128
|
+
startHour,
|
|
129
|
+
endHour,
|
|
130
|
+
secondaryStartHour,
|
|
131
|
+
secondaryEndHour,
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
return mapPhase(item);
|
|
135
|
+
};
|
|
136
|
+
const convertDetailToTimeline = (item, mainGanttStartDate, mainGanttEndDate) => {
|
|
137
|
+
const kupDates = new KupDates();
|
|
138
|
+
const { id, name, schedule } = item;
|
|
139
|
+
const getDatesForTask = (item) => {
|
|
140
|
+
let start = mainGanttStartDate !== null && mainGanttStartDate !== void 0 ? mainGanttStartDate : '';
|
|
141
|
+
let end = mainGanttEndDate !== null && mainGanttEndDate !== void 0 ? mainGanttEndDate : '';
|
|
142
|
+
for (let i = 0; i < item.schedule.length; i++) {
|
|
143
|
+
const lstart = item.schedule[i].startDate;
|
|
144
|
+
const lend = item.schedule[i].endDate;
|
|
145
|
+
if (!start || lstart.localeCompare(start) < 0) {
|
|
146
|
+
start = lstart;
|
|
147
|
+
}
|
|
148
|
+
if (!end || lend.localeCompare(end) > 0) {
|
|
149
|
+
end = lend;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return kupDates.validDates(start, end, 'detail item');
|
|
153
|
+
};
|
|
154
|
+
const { start, end } = getDatesForTask(item);
|
|
155
|
+
const convertToFrame = (x) => {
|
|
156
|
+
const { startDate, endDate, color, selectedColor, icon } = x;
|
|
157
|
+
const { start, end } = kupDates.validDates(startDate, endDate, 'time frame');
|
|
158
|
+
return {
|
|
159
|
+
start,
|
|
160
|
+
end,
|
|
161
|
+
backgroundColor: color !== null && color !== void 0 ? color : '0xffffff',
|
|
162
|
+
backgroundSelectedColor: selectedColor !== null && selectedColor !== void 0 ? selectedColor : color,
|
|
163
|
+
icon,
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
const defaultColor = '#595959';
|
|
167
|
+
return {
|
|
168
|
+
id,
|
|
169
|
+
type: 'timeline',
|
|
170
|
+
timeline: schedule.map(convertToFrame),
|
|
171
|
+
name,
|
|
172
|
+
valuesToShow: item.valuesToShow,
|
|
173
|
+
start: start,
|
|
174
|
+
end: end,
|
|
175
|
+
progress: 100,
|
|
176
|
+
styles: {
|
|
177
|
+
backgroundColor: defaultColor,
|
|
178
|
+
progressColor: defaultColor,
|
|
179
|
+
backgroundSelectedColor: defaultColor,
|
|
180
|
+
progressSelectedColor: defaultColor,
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
/** Return a shallow copy, with the dates updated */
|
|
185
|
+
const withNewDates = (p, start, end, startHour, endHour) => {
|
|
186
|
+
const kupDates = new KupDates();
|
|
187
|
+
const startDate = kupDates.formatToIsoDate(start);
|
|
188
|
+
const endDate = kupDates.formatToIsoDate(end);
|
|
189
|
+
const extra = { startDate, endDate, startHour, endHour };
|
|
190
|
+
return Object.assign(Object.assign({}, p), extra);
|
|
191
|
+
};
|
|
6
192
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
193
|
+
* Calculate date range valid for each Gantt
|
|
194
|
+
* @param mainGanttItems
|
|
195
|
+
* @param timeUnit
|
|
196
|
+
* @param mainGanttDoubleView
|
|
197
|
+
* @param secondaryGanttItems
|
|
198
|
+
* @param preStepsCount
|
|
199
|
+
* @returns
|
|
9
200
|
*/
|
|
10
|
-
|
|
11
|
-
(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
KupPlannerProps["detailIdCol"] = "Column containing unique detail identifier";
|
|
21
|
-
KupPlannerProps["detailNameCol"] = "Column containing detail name displayed";
|
|
22
|
-
KupPlannerProps["detailPrevDates"] = "Columns containing forecast detail duration, from (firstDate) to (secondDate)";
|
|
23
|
-
KupPlannerProps["detailInitialScrollX"] = "Sets the initial scroll X for the detail.";
|
|
24
|
-
KupPlannerProps["detailInitialScrollY"] = "Sets the initial scroll Y for the detail.";
|
|
25
|
-
KupPlannerProps["listCellWidth"] = "Total size of the cells inside to the left box, near the gantt";
|
|
26
|
-
KupPlannerProps["maxWidth"] = "Max width for component";
|
|
27
|
-
KupPlannerProps["phaseColorCol"] = "Column containing the phase color in hex format";
|
|
28
|
-
KupPlannerProps["phaseColumns"] = "Columns containing informations displayed in the left box ,near the gantt of phases";
|
|
29
|
-
KupPlannerProps["phaseColParDep"] = "Column containing the name of the parent phases";
|
|
30
|
-
KupPlannerProps["phaseDates"] = "Columns containing phase duration, from (firstDate) to (secondDate)";
|
|
31
|
-
KupPlannerProps["phaseIdCol"] = "Column containing unique phase identifier";
|
|
32
|
-
KupPlannerProps["phaseNameCol"] = "Column containing phase name displayed";
|
|
33
|
-
KupPlannerProps["phasePrevDates"] = "Columns containing forecast phase duration, from (firstDate) to (secondDate)";
|
|
34
|
-
KupPlannerProps["readOnly"] = "When true, the two gantts are not interactable.";
|
|
35
|
-
KupPlannerProps["showSecondaryDates"] = "Enable/disable display of secondary dates";
|
|
36
|
-
KupPlannerProps["taskColumns"] = "Columns containing informations displayed in the left box, near the gantt";
|
|
37
|
-
KupPlannerProps["taskDates"] = "Columns containing task duration, from (firstDate) to (secondDate)";
|
|
38
|
-
KupPlannerProps["taskFilter"] = "Sets the task's filter.";
|
|
39
|
-
KupPlannerProps["taskHeight"] = "Height for main gantt";
|
|
40
|
-
KupPlannerProps["taskIdCol"] = "Column containing unique task identifier";
|
|
41
|
-
KupPlannerProps["taskNameCol"] = "Column containing task name displayed";
|
|
42
|
-
KupPlannerProps["taskPrevDates"] = "Columns containing forecast task duration, from (firstDate) to (secondDate)";
|
|
43
|
-
KupPlannerProps["taskInitialScrollX"] = "Sets the initial scroll X for the task.";
|
|
44
|
-
KupPlannerProps["taskInitialScrollY"] = "Sets the initial scroll Y for the task.";
|
|
45
|
-
KupPlannerProps["titleMess"] = "Message displayed on top";
|
|
46
|
-
})(KupPlannerProps || (KupPlannerProps = {}));
|
|
47
|
-
var KupPlannerTaskAction;
|
|
48
|
-
(function (KupPlannerTaskAction) {
|
|
49
|
-
KupPlannerTaskAction["onTaskOpening"] = "onTaskOpening";
|
|
50
|
-
KupPlannerTaskAction["onTaskClosing"] = "onTaskClosing";
|
|
51
|
-
KupPlannerTaskAction["onClick"] = "onClick";
|
|
52
|
-
KupPlannerTaskAction["onDblClick"] = "onDblClick";
|
|
53
|
-
KupPlannerTaskAction["onResize"] = "onResize";
|
|
54
|
-
KupPlannerTaskAction["onRightClick"] = "onRightClick";
|
|
55
|
-
})(KupPlannerTaskAction || (KupPlannerTaskAction = {}));
|
|
56
|
-
var KupPlannerGanttRowType;
|
|
57
|
-
(function (KupPlannerGanttRowType) {
|
|
58
|
-
KupPlannerGanttRowType["TASK"] = "task";
|
|
59
|
-
KupPlannerGanttRowType["PHASE"] = "phase";
|
|
60
|
-
KupPlannerGanttRowType["DETAIL"] = "detail";
|
|
61
|
-
})(KupPlannerGanttRowType || (KupPlannerGanttRowType = {}));
|
|
62
|
-
class KupPlannerLastOnChangeReceived {
|
|
63
|
-
constructor(event, threshold = 100) {
|
|
64
|
-
this.dateTime = new Date();
|
|
65
|
-
this.event = event;
|
|
66
|
-
this.threshold = threshold;
|
|
201
|
+
const calculateDisplayedDateRange = (mainGanttItems, timeUnit, mainGanttDoubleView, secondaryGanttItems, preStepsCount) => {
|
|
202
|
+
const dates = ganttDateRangeFromGanttTask(mainGanttItems, timeUnit, preStepsCount !== null && preStepsCount !== void 0 ? preStepsCount : 1, mainGanttDoubleView);
|
|
203
|
+
if (secondaryGanttItems) {
|
|
204
|
+
const dates2 = ganttDateRangeFromDetail(secondaryGanttItems, timeUnit, preStepsCount !== null && preStepsCount !== void 0 ? preStepsCount : 1, mainGanttDoubleView);
|
|
205
|
+
if (dates2[0] < dates[0]) {
|
|
206
|
+
dates[0] = dates2[0];
|
|
207
|
+
}
|
|
208
|
+
if (dates2[1] > dates[1]) {
|
|
209
|
+
dates[1] = dates2[1];
|
|
210
|
+
}
|
|
67
211
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
212
|
+
return {
|
|
213
|
+
displayedStartDate: dates[0],
|
|
214
|
+
displayedEndDate: dates[1],
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
const ganttDateRangeFromGanttTask = (tasks, viewMode, preStepsCount, showSecondaryDates) => {
|
|
218
|
+
const dates = [];
|
|
219
|
+
const kupDates = new KupDates();
|
|
220
|
+
tasks.forEach((item) => {
|
|
221
|
+
var _a;
|
|
222
|
+
dates.push({
|
|
223
|
+
start: kupDates.parseToDayStart(item.startDate),
|
|
224
|
+
end: kupDates.parseToDayEnd(item.endDate),
|
|
225
|
+
secondaryStart: kupDates.parseToDayStart(item.secondaryStartDate),
|
|
226
|
+
secondaryEnd: kupDates.parseToDayEnd(item.secondaryEndDate),
|
|
227
|
+
startHour: item.startHour,
|
|
228
|
+
endHour: item.endHour,
|
|
229
|
+
secondaryStartHour: item.secondaryStartHour,
|
|
230
|
+
secondaryEndHour: item.secondaryEndHour
|
|
231
|
+
});
|
|
232
|
+
(_a = item.phases) === null || _a === void 0 ? void 0 : _a.forEach((phase) => {
|
|
233
|
+
dates.push({
|
|
234
|
+
start: kupDates.parseToDayStart(phase.startDate),
|
|
235
|
+
end: kupDates.parseToDayEnd(phase.endDate),
|
|
236
|
+
secondaryStart: kupDates.parseToDayStart(phase.secondaryStartDate),
|
|
237
|
+
secondaryEnd: kupDates.parseToDayEnd(phase.secondaryEndDate),
|
|
238
|
+
startHour: item.startHour,
|
|
239
|
+
endHour: item.endHour,
|
|
240
|
+
secondaryStartHour: item.secondaryStartHour,
|
|
241
|
+
secondaryEndHour: item.secondaryEndHour
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
return ganttDateRangeGeneric(dates, viewMode, preStepsCount, showSecondaryDates, true);
|
|
246
|
+
};
|
|
247
|
+
const ganttDateRangeGeneric = (dates, viewMode, preStepsCount, showSecondaryDates, realDates) => {
|
|
248
|
+
let newStartDate = dates.length > 0 ? dates[0].start : new Date();
|
|
249
|
+
let newEndDate = dates.length > 0 ? dates[0].end : new Date();
|
|
250
|
+
for (const d of dates) {
|
|
251
|
+
if (d.start < newStartDate) {
|
|
252
|
+
newStartDate = d.start;
|
|
253
|
+
}
|
|
254
|
+
if (d.end > newEndDate) {
|
|
255
|
+
newEndDate = d.end;
|
|
256
|
+
}
|
|
257
|
+
if (showSecondaryDates) {
|
|
258
|
+
if (d.secondaryStart && d.secondaryStart < newStartDate) {
|
|
259
|
+
newStartDate = d.secondaryStart;
|
|
260
|
+
}
|
|
261
|
+
if (d.secondaryEnd && d.secondaryEnd > newEndDate) {
|
|
262
|
+
newEndDate = d.secondaryEnd;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
72
265
|
}
|
|
73
|
-
|
|
74
|
-
|
|
266
|
+
if (realDates) {
|
|
267
|
+
return [newStartDate, newEndDate];
|
|
75
268
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
269
|
+
switch (viewMode) {
|
|
270
|
+
case 'year':
|
|
271
|
+
newStartDate = addToDate(newStartDate, -1, 'year');
|
|
272
|
+
newStartDate = startOfDate(newStartDate, 'year');
|
|
273
|
+
newEndDate = addToDate(newEndDate, 1, 'year');
|
|
274
|
+
newEndDate = startOfDate(newEndDate, 'year');
|
|
275
|
+
break;
|
|
276
|
+
case 'month':
|
|
277
|
+
newStartDate = addToDate(newStartDate, -1 * preStepsCount, 'month');
|
|
278
|
+
newStartDate = startOfDate(newStartDate, 'month');
|
|
279
|
+
newEndDate = addToDate(newEndDate, 1, 'month');
|
|
280
|
+
newEndDate = startOfDate(newEndDate, 'month');
|
|
281
|
+
break;
|
|
282
|
+
case 'week':
|
|
283
|
+
newStartDate = startOfDate(newStartDate, 'day');
|
|
284
|
+
newStartDate = addToDate(getMonday(newStartDate), -7 * preStepsCount, 'day');
|
|
285
|
+
newEndDate = startOfDate(newEndDate, 'day');
|
|
286
|
+
newEndDate = addToDate(newEndDate, 1.5, 'month');
|
|
287
|
+
break;
|
|
288
|
+
case 'day':
|
|
289
|
+
newStartDate = startOfDate(newStartDate, 'day');
|
|
290
|
+
newStartDate = addToDate(newStartDate, -1 * preStepsCount, 'day');
|
|
291
|
+
newEndDate = startOfDate(newEndDate, 'day');
|
|
292
|
+
newEndDate = addToDate(newEndDate, 19, 'day');
|
|
293
|
+
break;
|
|
294
|
+
case 'hour':
|
|
295
|
+
newStartDate = startOfDate(newStartDate, "hour");
|
|
296
|
+
newStartDate = addToDate(newStartDate, -1 * preStepsCount, "hour");
|
|
297
|
+
newEndDate = startOfDate(newEndDate, "day");
|
|
298
|
+
newEndDate = addToDate(newEndDate, 1, "day");
|
|
299
|
+
break;
|
|
300
|
+
/*
|
|
301
|
+
case ViewMode.QuarterDay:
|
|
302
|
+
newStartDate = startOfDate(newStartDate, "day");
|
|
303
|
+
newStartDate = addToDate(newStartDate, -1 * preStepsCount, "day");
|
|
304
|
+
newEndDate = startOfDate(newEndDate, "day");
|
|
305
|
+
newEndDate = addToDate(newEndDate, 66, "hour"); // 24(1 day)*3 - 6
|
|
306
|
+
break;
|
|
307
|
+
case ViewMode.HalfDay:
|
|
308
|
+
newStartDate = startOfDate(newStartDate, "day");
|
|
309
|
+
newStartDate = addToDate(newStartDate, -1 * preStepsCount, "day");
|
|
310
|
+
newEndDate = startOfDate(newEndDate, "day");
|
|
311
|
+
newEndDate = addToDate(newEndDate, 108, "hour"); // 24(1 day)*5 - 12
|
|
312
|
+
break;
|
|
313
|
+
case ViewMode.Hour:
|
|
314
|
+
newStartDate = startOfDate(newStartDate, "hour");
|
|
315
|
+
newStartDate = addToDate(newStartDate, -1 * preStepsCount, "hour");
|
|
316
|
+
newEndDate = startOfDate(newEndDate, "day");
|
|
317
|
+
newEndDate = addToDate(newEndDate, 1, "day");
|
|
318
|
+
break;
|
|
319
|
+
*/
|
|
320
|
+
}
|
|
321
|
+
return [newStartDate, newEndDate];
|
|
322
|
+
};
|
|
323
|
+
const ganttDateRangeFromDetail = (details, viewMode, preStepsCount, showSecondaryDates) => {
|
|
324
|
+
const dates = [];
|
|
325
|
+
const kupDates = new KupDates();
|
|
326
|
+
details.forEach((item) => {
|
|
327
|
+
const scheduleItems = item.schedule;
|
|
328
|
+
if (scheduleItems) {
|
|
329
|
+
scheduleItems.forEach((item) => {
|
|
330
|
+
dates.push({
|
|
331
|
+
start: kupDates.parseToDayStart(item.startDate),
|
|
332
|
+
end: kupDates.parseToDayEnd(item.endDate),
|
|
333
|
+
secondaryStart: undefined,
|
|
334
|
+
secondaryEnd: undefined,
|
|
335
|
+
});
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
return ganttDateRangeGeneric(dates, viewMode, preStepsCount, showSecondaryDates, true);
|
|
340
|
+
};
|
|
341
|
+
const addToDate = (date, quantity, scale) => {
|
|
342
|
+
const newDate = new Date(date.getFullYear() + (scale === 'year' ? quantity : 0), date.getMonth() + (scale === 'month' ? quantity : 0), date.getDate() + (scale === 'day' ? quantity : 0), date.getHours() + (scale === 'hour' ? quantity : 0), date.getMinutes() + (scale === 'minute' ? quantity : 0), date.getSeconds() + (scale === 'second' ? quantity : 0), date.getMilliseconds() + (scale === 'millisecond' ? quantity : 0));
|
|
343
|
+
return newDate;
|
|
344
|
+
};
|
|
345
|
+
const startOfDate = (date, scale) => {
|
|
346
|
+
const scores = [
|
|
347
|
+
'millisecond',
|
|
348
|
+
'second',
|
|
349
|
+
'minute',
|
|
350
|
+
'hour',
|
|
351
|
+
'day',
|
|
352
|
+
'month',
|
|
353
|
+
'year',
|
|
354
|
+
];
|
|
355
|
+
const shouldReset = (_scale) => {
|
|
356
|
+
const maxScore = scores.indexOf(scale);
|
|
357
|
+
return scores.indexOf(_scale) <= maxScore;
|
|
358
|
+
};
|
|
359
|
+
const newDate = new Date(date.getFullYear(), shouldReset('year') ? 0 : date.getMonth(), shouldReset('month') ? 1 : date.getDate(), shouldReset('day') ? 0 : date.getHours(), shouldReset('hour') ? 0 : date.getMinutes(), shouldReset('minute') ? 0 : date.getSeconds(), shouldReset('second') ? 0 : date.getMilliseconds());
|
|
360
|
+
return newDate;
|
|
361
|
+
};
|
|
362
|
+
/**
|
|
363
|
+
* Returns monday of current week
|
|
364
|
+
* @param date date for modify
|
|
365
|
+
*/
|
|
366
|
+
const getMonday = (date) => {
|
|
367
|
+
const day = date.getDay();
|
|
368
|
+
const diff = date.getDate() - day + (day === 0 ? -6 : 1); // adjust when day is sunday
|
|
369
|
+
return new Date(date.setDate(diff));
|
|
370
|
+
};
|
|
371
|
+
const ganttDateRangeFromTask = (tasks, viewMode, preStepsCount, showSecondaryDates, mainGanttStartDate, mainGanttEndDate) => {
|
|
372
|
+
const dates = [];
|
|
373
|
+
tasks.forEach((item) => {
|
|
374
|
+
dates.push({
|
|
375
|
+
start: item.start,
|
|
376
|
+
end: item.end,
|
|
377
|
+
secondaryStart: item.secondaryStart,
|
|
378
|
+
secondaryEnd: item.secondaryEnd,
|
|
379
|
+
startHour: item.startHour,
|
|
380
|
+
endHour: item.endHour,
|
|
381
|
+
secondaryStartHour: item.secondaryStartHour,
|
|
382
|
+
secondaryEndHour: item.secondaryEndHour
|
|
383
|
+
});
|
|
384
|
+
});
|
|
385
|
+
if (mainGanttStartDate && mainGanttEndDate) {
|
|
386
|
+
dates.push({
|
|
387
|
+
start: mainGanttStartDate,
|
|
388
|
+
end: mainGanttEndDate,
|
|
389
|
+
secondaryStart: undefined,
|
|
390
|
+
secondaryEnd: undefined,
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
return ganttDateRangeGeneric(dates, viewMode, preStepsCount, showSecondaryDates);
|
|
394
|
+
};
|
|
395
|
+
const seedDates = (startDate, endDate, viewMode) => {
|
|
396
|
+
let currentDate = new Date(startDate);
|
|
397
|
+
const dates = [currentDate];
|
|
398
|
+
while (currentDate < endDate) {
|
|
399
|
+
switch (viewMode) {
|
|
400
|
+
case 'year':
|
|
401
|
+
currentDate = addToDate(currentDate, 1, 'year');
|
|
402
|
+
break;
|
|
403
|
+
case 'month':
|
|
404
|
+
currentDate = addToDate(currentDate, 1, 'month');
|
|
405
|
+
break;
|
|
406
|
+
case 'week':
|
|
407
|
+
currentDate = addToDate(currentDate, 7, 'day');
|
|
408
|
+
break;
|
|
409
|
+
case 'day':
|
|
410
|
+
currentDate = addToDate(currentDate, 1, 'day');
|
|
411
|
+
break;
|
|
412
|
+
case 'hour':
|
|
413
|
+
currentDate = addToDate(currentDate, 1, "hour");
|
|
414
|
+
break;
|
|
415
|
+
/*
|
|
416
|
+
case ViewMode.HalfDay:
|
|
417
|
+
currentDate = addToDate(currentDate, 12, "hour");
|
|
418
|
+
break;
|
|
419
|
+
case ViewMode.QuarterDay:
|
|
420
|
+
currentDate = addToDate(currentDate, 6, "hour");
|
|
421
|
+
break;
|
|
422
|
+
case ViewMode.Hour:
|
|
423
|
+
currentDate = addToDate(currentDate, 1, "hour");
|
|
424
|
+
break;
|
|
425
|
+
*/
|
|
426
|
+
}
|
|
427
|
+
dates.push(currentDate);
|
|
428
|
+
}
|
|
429
|
+
return dates;
|
|
89
430
|
};
|
|
90
|
-
const KUP_PLANNER_MAIN_GANTT_ID = 'main';
|
|
91
|
-
const KUP_PLANNER_SECONDARY_GANTT_ID = 'secondary';
|
|
92
431
|
|
|
93
432
|
const kupTaskListCss = ".kup-body-compact-01{font-family:var(--kup-font-family);font-size:14px;line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);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}.tasks{border-radius:8px;background:#efefef;margin:12px;padding:12px}.taskListWrapper{display:table;border-bottom:#e6e4e4 1px solid;border-left:#e6e4e4 1px solid}.taskListTableRow{display:table-row;text-overflow:ellipsis}.taskListCell{display:table-cell;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.taskListNameWrapper{display:flex}.taskListExpander{color:rgb(86, 86, 86);font-size:0.6rem;padding:0.15rem 0.2rem 0 0.2rem;user-select:none;cursor:pointer}.taskListEmptyExpander{font-size:0.6rem;padding-left:1rem;user-select:none}.ganttTable{display:table;border-bottom:#e6e4e4 1px solid;border-top:#e6e4e4 1px solid;border-left:#e6e4e4 1px solid}.ganttTable_Header{display:table-row;list-style:none}.ganttTable_HeaderSeparator{border-right:1px solid rgb(196, 196, 196);opacity:1;margin-left:-2px}.ganttTable_HeaderItem{display:table-cell;vertical-align:-webkit-baseline-middle;vertical-align:middle}";
|
|
94
433
|
const KupTaskListStyle0 = kupTaskListCss;
|
|
@@ -114,6 +453,9 @@ const TaskList = /*@__PURE__*/ proxyCustomElement(class TaskList extends HTMLEle
|
|
|
114
453
|
this.currentTasks = undefined;
|
|
115
454
|
this.label = undefined;
|
|
116
455
|
this.doubleView = undefined;
|
|
456
|
+
this.scrollableTaskList = undefined;
|
|
457
|
+
this.updateTaskListScrollX = false;
|
|
458
|
+
this.taskListScrollX = undefined;
|
|
117
459
|
this.setDoubleView = undefined;
|
|
118
460
|
this.handleClick = undefined;
|
|
119
461
|
this.handleDblClick = undefined;
|
|
@@ -123,6 +465,7 @@ const TaskList = /*@__PURE__*/ proxyCustomElement(class TaskList extends HTMLEle
|
|
|
123
465
|
this.ganttonOnContextMenu = undefined;
|
|
124
466
|
this.setSelectedTask = undefined;
|
|
125
467
|
this.expanderClick = undefined;
|
|
468
|
+
this.ontaskListScrollWidth = undefined;
|
|
126
469
|
this.selectedTaskId = '';
|
|
127
470
|
}
|
|
128
471
|
componentDidLoad() {
|
|
@@ -164,6 +507,7 @@ const TaskList = /*@__PURE__*/ proxyCustomElement(class TaskList extends HTMLEle
|
|
|
164
507
|
tasks: this.tasks,
|
|
165
508
|
locale: this.locale,
|
|
166
509
|
selectedTaskId: this.selectedTaskId,
|
|
510
|
+
scrollableTaskList: this.scrollableTaskList,
|
|
167
511
|
setSelectedTask: this.setSelectedTask.bind(this),
|
|
168
512
|
onExpanderClick: this.expanderClick,
|
|
169
513
|
};
|
|
@@ -175,7 +519,7 @@ const TaskList = /*@__PURE__*/ proxyCustomElement(class TaskList extends HTMLEle
|
|
|
175
519
|
if (TaskListTable && TaskListTable['$attrs$']) {
|
|
176
520
|
Object.assign(TaskListTable['$attrs$'], Object.assign({}, tableProps));
|
|
177
521
|
}
|
|
178
|
-
return (h("div", { key: '
|
|
522
|
+
return (h("div", { key: 'cfd1d8efa3a55550e105f5ad084f011dc64e8870', ref: (el) => (this.taskListRef = el) }, TaskListHeader && TaskListHeader['$attrs$'] ? (TaskListHeader) : (h("kup-custom-task-list-header", Object.assign({ label: this.label, doubleView: (_a = this.doubleView) !== null && _a !== void 0 ? _a : false, setDoubleView: this.setDoubleView }, headerProps))), h("div", { key: '1279ffece78a182c6ff1facb46bd493a8c74f363', class: `${this.horizontalContainerClass} ${this.scrollableTaskList ? 'horizontalContainerScrollable' : ''}`, style: this.ganttHeight
|
|
179
523
|
? { height: this.ganttHeight + 'px' }
|
|
180
524
|
: {}, ref: (el) => (this.horizontalContainerRef = el) }, TaskListTable && TaskListTable['$attrs$'] ? (TaskListTable) : (h("kup-custom-task-list-table", Object.assign({}, tableProps, { onclickTaskList: (id) => {
|
|
181
525
|
let row = getProjectById(id, this.currentTasks);
|
|
@@ -201,7 +545,9 @@ const TaskList = /*@__PURE__*/ proxyCustomElement(class TaskList extends HTMLEle
|
|
|
201
545
|
if (row) {
|
|
202
546
|
this.handleContextMenu(event, row, this.ganttonOnContextMenu);
|
|
203
547
|
}
|
|
204
|
-
},
|
|
548
|
+
}, ontaskListScrollWidth: (width) => {
|
|
549
|
+
this.ontaskListScrollWidth(width);
|
|
550
|
+
}, taskListScrollX: this.taskListScrollX, ganttId: KUP_PLANNER_MAIN_GANTT_ID }))))));
|
|
205
551
|
}
|
|
206
552
|
get element() { return this; }
|
|
207
553
|
static get watchers() { return {
|
|
@@ -226,6 +572,9 @@ const TaskList = /*@__PURE__*/ proxyCustomElement(class TaskList extends HTMLEle
|
|
|
226
572
|
"currentTasks": [16],
|
|
227
573
|
"label": [1],
|
|
228
574
|
"doubleView": [4, "double-view"],
|
|
575
|
+
"scrollableTaskList": [4, "scrollable-task-list"],
|
|
576
|
+
"updateTaskListScrollX": [4, "update-task-list-scroll-x"],
|
|
577
|
+
"taskListScrollX": [2, "task-list-scroll-x"],
|
|
229
578
|
"setDoubleView": [16],
|
|
230
579
|
"handleClick": [16],
|
|
231
580
|
"handleDblClick": [16],
|
|
@@ -235,6 +584,7 @@ const TaskList = /*@__PURE__*/ proxyCustomElement(class TaskList extends HTMLEle
|
|
|
235
584
|
"ganttonOnContextMenu": [16],
|
|
236
585
|
"setSelectedTask": [16],
|
|
237
586
|
"expanderClick": [16],
|
|
587
|
+
"ontaskListScrollWidth": [16],
|
|
238
588
|
"selectedTaskId": [32]
|
|
239
589
|
}, undefined, {
|
|
240
590
|
"scrollY": ["updateScrollY"]
|
|
@@ -263,4 +613,4 @@ function defineCustomElement() {
|
|
|
263
613
|
} });
|
|
264
614
|
}
|
|
265
615
|
|
|
266
|
-
export {
|
|
616
|
+
export { TaskList as T, convertProjectToTasks as a, getPhaseById as b, calculateDisplayedDateRange as c, defineCustomElement as d, getProjectById as e, mergeTaskIntoPhases as f, ganttDateRangeFromTask as g, columnWidthForTimeUnit as h, mergeTaskIntoProjects as m, seedDates as s };
|
|
@@ -66,7 +66,7 @@ const Tooltip = /*@__PURE__*/ proxyCustomElement(class Tooltip extends HTMLEleme
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
render() {
|
|
69
|
-
return (h("div", { key: '
|
|
69
|
+
return (h("div", { key: '285d804e882396024becfcfb1bbe83f7b92ef1ba', class: this.relatedX ? 'tooltipDetailsContainer' : 'tooltipDetailsContainerHidden', style: { left: `${this.relatedX}px`, top: `${this.relatedY}px` } }, h(this.TooltipContent, { key: '64a79a8e5c79ef4985e289e2e86c9d4c8ef75175', task: this.task, fontSize: this.fontSize, fontFamily: this.fontFamily })));
|
|
70
70
|
}
|
|
71
71
|
get rootElement() { return this; }
|
|
72
72
|
static get watchers() { return {
|
|
@@ -37,11 +37,11 @@ const KupVerticalScroll = /*@__PURE__*/ proxyCustomElement(class KupVerticalScro
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
render() {
|
|
40
|
-
return (h("div", { key: '
|
|
40
|
+
return (h("div", { key: 'fd24a7eab2da0ee2317a1fde6aa2f052394a0d5b', style: {
|
|
41
41
|
height: `${this.ganttHeight}px`,
|
|
42
42
|
marginTop: `${this.headerHeight}px`,
|
|
43
43
|
marginLeft: this.rtl ? '' : '-1rem',
|
|
44
|
-
}, class: "scroll", onScroll: this.verticalScroll, ref: (el) => (this.scrollRef = el) }, h("div", { key: '
|
|
44
|
+
}, class: "scroll", onScroll: this.verticalScroll, ref: (el) => (this.scrollRef = el) }, h("div", { key: 'f6d2bacc2f3c5532d33cb148e46394bc9697ece9', style: {
|
|
45
45
|
height: `${this.ganttFullHeight}px`,
|
|
46
46
|
width: '1px',
|
|
47
47
|
} })));
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
export { createArrayFromNum as c, isKeyboardEvent as i, removeHiddenTasks as r, sortTasks as s };
|