@sme.up/ketchup 9.6.4 → 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-89de2403.js → f-button-23ec3db5.js} +1 -1
- package/dist/cjs/{f-cell-75dbd6eb.js → f-cell-bcc51c0f.js} +5 -5
- package/dist/cjs/{f-chip-08857345.js → f-chip-63363ecf.js} +2 -2
- package/dist/cjs/{f-image-a41d7f1e.js → f-image-f3944c01.js} +2 -5
- package/dist/cjs/{f-paginator-utils-ff07301e.js → f-paginator-utils-60e05759.js} +2 -2
- package/dist/cjs/{f-text-field-eb207a83.js → f-text-field-354b6c78.js} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/ketchup.cjs.js +1 -1
- package/dist/cjs/kup-accordion.cjs.entry.js +2 -2
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +46 -46
- package/dist/cjs/kup-box.cjs.entry.js +7 -7
- package/dist/cjs/kup-calendar.cjs.entry.js +4 -4
- package/dist/cjs/kup-card-list.cjs.entry.js +1 -1
- package/dist/cjs/kup-cell.cjs.entry.js +6 -6
- package/dist/cjs/kup-custom-task-list-header_4.cjs.entry.js +253 -37
- package/dist/cjs/kup-dashboard.cjs.entry.js +4 -4
- package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
- package/dist/cjs/kup-echart.cjs.entry.js +1 -1
- package/dist/cjs/kup-editor.cjs.entry.js +1 -1
- package/dist/cjs/kup-family-tree.cjs.entry.js +3 -3
- package/dist/cjs/kup-gantt_10.cjs.entry.js +104 -38
- package/dist/cjs/kup-grid.cjs.entry.js +1 -1
- package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
- package/dist/cjs/kup-image-list.cjs.entry.js +20 -13
- package/dist/cjs/kup-input-panel.cjs.entry.js +199 -53
- package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
- package/dist/cjs/kup-magic-box.cjs.entry.js +2 -2
- package/dist/cjs/{kup-manager-abfe4ddd.js → kup-manager-e1bfd4f8.js} +647 -120
- package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
- package/dist/cjs/kup-pdf.cjs.entry.js +1 -1
- package/dist/cjs/kup-photo-frame.cjs.entry.js +1 -1
- package/dist/cjs/{kup-planner-declarations-d3dec885.js → kup-planner-declarations-cb33663d.js} +3 -0
- package/dist/cjs/{kup-planner-renderer-helper-9f776d6e.js → kup-planner-renderer-helper-f001fad7.js} +55 -7
- package/dist/cjs/kup-planner-renderer.cjs.entry.js +43 -10
- 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 +80 -8
- package/dist/cjs/kup-probe.cjs.entry.js +2 -2
- package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
- package/dist/cjs/kup-snackbar.cjs.entry.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/image-list.js +332 -2
- package/dist/collection/assets/input-panel.js +307 -76
- 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/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 +1 -1
- package/dist/collection/components/kup-input-panel/kup-input-panel.css +38 -1
- package/dist/collection/components/kup-input-panel/kup-input-panel.e2e.js +69 -28
- package/dist/collection/components/kup-input-panel/kup-input-panel.js +206 -59
- 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-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-image/f-image.js +2 -5
- package/dist/components/_commonjsHelpers.js +26 -0
- package/dist/components/custom-task-list-table.js +58 -13
- package/dist/components/kup-autocomplete2.js +43 -45
- package/dist/components/kup-calendar.js +1 -1
- package/dist/components/kup-dates.js +2 -25
- 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-horizontal-scroll2.js +48 -10
- package/dist/components/kup-image-list.js +14 -7
- package/dist/components/kup-input-panel.js +192 -46
- package/dist/components/kup-manager.js +649 -121
- package/dist/components/kup-pdf.js +1 -1
- 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-1eebd42e.js → f-button-d6dbcfd6.js} +1 -1
- package/dist/esm/{f-cell-af19d5c7.js → f-cell-7b41415c.js} +5 -5
- package/dist/esm/{f-chip-9e5fdb25.js → f-chip-68d27d7a.js} +2 -2
- package/dist/esm/{f-image-1e1ed567.js → f-image-a67229e5.js} +2 -5
- package/dist/esm/{f-paginator-utils-dede029b.js → f-paginator-utils-8773e358.js} +2 -2
- package/dist/esm/{f-text-field-802b45fb.js → f-text-field-d364ffd2.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/ketchup.js +1 -1
- package/dist/esm/kup-accordion.entry.js +2 -2
- package/dist/esm/kup-autocomplete_27.entry.js +46 -46
- package/dist/esm/kup-box.entry.js +7 -7
- package/dist/esm/kup-calendar.entry.js +4 -4
- package/dist/esm/kup-card-list.entry.js +1 -1
- package/dist/esm/kup-cell.entry.js +6 -6
- package/dist/esm/kup-custom-task-list-header_4.entry.js +253 -37
- package/dist/esm/kup-dashboard.entry.js +4 -4
- package/dist/esm/kup-drawer.entry.js +1 -1
- package/dist/esm/kup-echart.entry.js +1 -1
- package/dist/esm/kup-editor.entry.js +1 -1
- package/dist/esm/kup-family-tree.entry.js +3 -3
- package/dist/esm/kup-gantt_10.entry.js +105 -39
- package/dist/esm/kup-grid.entry.js +1 -1
- package/dist/esm/kup-iframe.entry.js +1 -1
- package/dist/esm/kup-image-list.entry.js +20 -13
- package/dist/esm/kup-input-panel.entry.js +199 -53
- package/dist/esm/kup-lazy.entry.js +1 -1
- package/dist/esm/kup-magic-box.entry.js +2 -2
- package/dist/esm/{kup-manager-dd24fb5a.js → kup-manager-a316a70e.js} +647 -120
- package/dist/esm/kup-nav-bar.entry.js +1 -1
- package/dist/esm/kup-numeric-picker.entry.js +2 -2
- package/dist/esm/kup-pdf.entry.js +1 -1
- package/dist/esm/kup-photo-frame.entry.js +1 -1
- package/dist/esm/{kup-planner-declarations-b9345758.js → kup-planner-declarations-398babf9.js} +3 -0
- package/dist/esm/{kup-planner-renderer-helper-b4727e44.js → kup-planner-renderer-helper-a2ec9a1c.js} +56 -7
- package/dist/esm/kup-planner-renderer.entry.js +43 -10
- package/dist/esm/{kup-planner-time-formatter-a68e05ba.js → kup-planner-time-formatter-ddf84f9b.js} +1 -1
- package/dist/esm/kup-planner.entry.js +80 -8
- package/dist/esm/kup-probe.entry.js +2 -2
- package/dist/esm/kup-qlik.entry.js +2 -2
- package/dist/esm/kup-snackbar.entry.js +4 -4
- 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-b3b50bb5.entry.js → p-074ccd53.entry.js} +1 -1
- package/dist/ketchup/{p-26d42b88.entry.js → p-1088ab22.entry.js} +1 -1
- package/dist/ketchup/{p-201f8d7b.entry.js → p-1bcac01f.entry.js} +1 -1
- package/dist/ketchup/{p-3b544027.entry.js → p-1e028d95.entry.js} +1 -1
- package/dist/ketchup/p-25058baa.js +1 -0
- package/dist/ketchup/{p-dcf7e9b6.entry.js → p-2932e7e8.entry.js} +1 -1
- package/dist/ketchup/{p-b238cde7.entry.js → p-2b84db7b.entry.js} +1 -1
- package/dist/ketchup/{p-f998ff28.entry.js → p-2ef90f60.entry.js} +1 -1
- package/dist/ketchup/{p-8fcdf454.js → p-339bbeae.js} +1 -1
- package/dist/ketchup/{p-cd7fec02.entry.js → p-48e45ac0.entry.js} +1 -1
- package/dist/ketchup/p-53af4c87.js +1 -0
- package/dist/ketchup/{p-6972fa0c.entry.js → p-556f7ddc.entry.js} +1 -1
- package/dist/ketchup/{p-e7507dd6.entry.js → p-5f7d8c21.entry.js} +1 -1
- package/dist/ketchup/{p-e0e47ca9.entry.js → p-6362738c.entry.js} +1 -1
- package/dist/ketchup/{p-a2e14d8b.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-6c888179.js → p-801776bc.js} +1 -1
- package/dist/ketchup/{p-4f69f6f9.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-8229b97a.js → p-8d4050ec.js} +4 -4
- package/dist/ketchup/{p-79f4dc5b.entry.js → p-9e2533e1.entry.js} +1 -1
- package/dist/ketchup/{p-158076de.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-61e8d573.js → p-b3540f83.js} +1 -1
- package/dist/ketchup/{p-19a13672.entry.js → p-c702eb45.entry.js} +1 -1
- package/dist/ketchup/{p-2e04042b.entry.js → p-ccb6dbb0.entry.js} +1 -1
- package/dist/ketchup/{p-a2e691b8.entry.js → p-cf44485a.entry.js} +2 -2
- package/dist/ketchup/{p-8f3d400a.entry.js → p-d2001dec.entry.js} +1 -1
- package/dist/ketchup/{p-34d70475.entry.js → p-dbb6cd8d.entry.js} +1 -1
- package/dist/ketchup/{p-2d4a9235.js → p-f6c8f006.js} +1 -1
- package/dist/ketchup/{p-43ce397b.entry.js → p-f79ffe77.entry.js} +1 -1
- package/dist/ketchup/{p-489af77f.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 +9 -7
- package/dist/types/components/kup-input-panel/kup-input-panel.d.ts +4 -4
- 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 +122 -16
- package/package.json +1 -1
- package/dist/components/kup-planner-renderer-helper.js +0 -379
- package/dist/ketchup/p-14943de9.entry.js +0 -1
- package/dist/ketchup/p-180cd7ab.entry.js +0 -1
- package/dist/ketchup/p-636be6f1.entry.js +0 -16
- package/dist/ketchup/p-63c141d9.entry.js +0 -1
- package/dist/ketchup/p-818e61d5.entry.js +0 -1
- package/dist/ketchup/p-8e3b6de8.js +0 -1
- package/dist/ketchup/p-a46f99d4.js +0 -1
- package/dist/ketchup/p-c0f660d6.js +0 -1
- package/dist/ketchup/p-e4c63684.js +0 -1
- package/dist/ketchup/p-e841c2ae.js +0 -1
- package/dist/ketchup/p-f9a7c21c.entry.js +0 -1
|
@@ -1,379 +0,0 @@
|
|
|
1
|
-
import { b as KupDates } from './kup-dates.js';
|
|
2
|
-
|
|
3
|
-
const columnWidthForTimeUnit = (timeUnit) => {
|
|
4
|
-
switch (timeUnit) {
|
|
5
|
-
case 'year':
|
|
6
|
-
return 60 * 2;
|
|
7
|
-
default:
|
|
8
|
-
return 60;
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
const getProjectById = (id, items) => {
|
|
12
|
-
for (let i = 0; i < items.length; i++) {
|
|
13
|
-
if (items[i].id === id) {
|
|
14
|
-
return items[i];
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return undefined;
|
|
18
|
-
};
|
|
19
|
-
const getPhaseById = (id, items) => {
|
|
20
|
-
for (let i = 0; i < items.length; i++) {
|
|
21
|
-
if (isDetail(items[i])) {
|
|
22
|
-
continue;
|
|
23
|
-
}
|
|
24
|
-
const item = items[i];
|
|
25
|
-
if (!item.phases) {
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
for (let j = 0; j < item.phases.length; j++)
|
|
29
|
-
if (item.phases[j].id === id) {
|
|
30
|
-
return item.phases[j];
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return undefined;
|
|
34
|
-
};
|
|
35
|
-
const isDetail = (row) => {
|
|
36
|
-
return (row &&
|
|
37
|
-
row.schedule &&
|
|
38
|
-
row.schedule.length !== 0);
|
|
39
|
-
};
|
|
40
|
-
const mergeTaskIntoProjects = (projects, { id, start, end }) => projects.map((project) => project.id === id ? withNewDates(project, start, end) : project);
|
|
41
|
-
const mergeTaskIntoPhases = (phases, { id, start, end }) => {
|
|
42
|
-
if (phases) {
|
|
43
|
-
return phases.map((phase) => phase.id === id ? withNewDates(phase, start, end) : phase);
|
|
44
|
-
}
|
|
45
|
-
return undefined;
|
|
46
|
-
};
|
|
47
|
-
const convertProjectToTasks = (item, mainGanttStartDate, mainGanttEndDate) => {
|
|
48
|
-
var _a;
|
|
49
|
-
if (!isDetail(item)) {
|
|
50
|
-
const kupDates = new KupDates();
|
|
51
|
-
const row = item;
|
|
52
|
-
const { start, end } = kupDates.validDates(row.startDate, row.endDate, row.name);
|
|
53
|
-
const { start: start2, end: end2 } = kupDates.validDates(row.secondaryStartDate, row.secondaryEndDate, row.name);
|
|
54
|
-
const mainTask = {
|
|
55
|
-
/**
|
|
56
|
-
* La libreria lo intende come le ore 00:00, che non è coerente
|
|
57
|
-
* con come vorremmo ragionare noi. Es.: se un task finisce il 9 luglio,
|
|
58
|
-
* la libreria colora le celle fino all'8 luglio compreso, ma non il 9;
|
|
59
|
-
* noi invece vorremmo colorare anche il 9.
|
|
60
|
-
* Possibili workaround: gestirsi ovunque il giorno di differenza (😱);
|
|
61
|
-
* impostare le conversioni dell'intervallo di fine come orario 23:59.
|
|
62
|
-
* In ogni caso va a cozzare con il calcolo delle durate
|
|
63
|
-
* (es.: dall'1 al 5 luglio => risulta 4 giorni ma dovrebbe
|
|
64
|
-
* essere 5 perché includiamo gli estremi; se sommiamo 23:59 ore
|
|
65
|
-
* risulta ancora 4 per la libreria, e 4.99.. se calcolato a mano, e
|
|
66
|
-
* ci vuole un Math.round come minimo)
|
|
67
|
-
*/
|
|
68
|
-
start: start,
|
|
69
|
-
end: end,
|
|
70
|
-
id: row.id,
|
|
71
|
-
name: row.name,
|
|
72
|
-
type: row.type,
|
|
73
|
-
valuesToShow: row.valuesToShow,
|
|
74
|
-
secondaryStart: start2,
|
|
75
|
-
secondaryEnd: end2,
|
|
76
|
-
progress: 100,
|
|
77
|
-
/** Non disabilita clic nè select, ma solo il resize/move */
|
|
78
|
-
isDisabled: false,
|
|
79
|
-
hideChildren: false,
|
|
80
|
-
icon: row.icon,
|
|
81
|
-
};
|
|
82
|
-
const children1 = ((_a = row.phases) !== null && _a !== void 0 ? _a : []).map(convertPhaseToTask);
|
|
83
|
-
return [mainTask, ...children1];
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
const row = item;
|
|
87
|
-
return [
|
|
88
|
-
Object.assign({}, convertDetailToTimeline(row, mainGanttStartDate, mainGanttEndDate)),
|
|
89
|
-
];
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
const convertPhaseToTask = (item) => {
|
|
93
|
-
const mapPhase = ({ startDate: phaseStart, endDate: phaseEnd, secondaryStartDate, secondaryEndDate, name: phaseName, id: phaseId, color, selectedColor, dependencies, icon, }) => {
|
|
94
|
-
const kupDates = new KupDates();
|
|
95
|
-
const { start, end } = kupDates.validDates(phaseStart, phaseEnd, phaseName);
|
|
96
|
-
const { start: phaseStart2, end: phaseEnd2 } = kupDates.validDates(secondaryStartDate, secondaryEndDate, phaseName);
|
|
97
|
-
return {
|
|
98
|
-
start,
|
|
99
|
-
end,
|
|
100
|
-
secondaryStart: phaseStart2,
|
|
101
|
-
secondaryEnd: phaseEnd2,
|
|
102
|
-
name: phaseName,
|
|
103
|
-
valuesToShow: item.valuesToShow,
|
|
104
|
-
id: phaseId,
|
|
105
|
-
type: 'task',
|
|
106
|
-
progress: 100,
|
|
107
|
-
dependencies,
|
|
108
|
-
/**
|
|
109
|
-
* Colori custom per specifico task - ci serve per distinguere le fasi
|
|
110
|
-
*/
|
|
111
|
-
styles: color
|
|
112
|
-
? {
|
|
113
|
-
backgroundColor: color,
|
|
114
|
-
progressColor: color,
|
|
115
|
-
backgroundSelectedColor: selectedColor,
|
|
116
|
-
progressSelectedColor: selectedColor,
|
|
117
|
-
}
|
|
118
|
-
: {},
|
|
119
|
-
icon,
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
return mapPhase(item);
|
|
123
|
-
};
|
|
124
|
-
const convertDetailToTimeline = (item, mainGanttStartDate, mainGanttEndDate) => {
|
|
125
|
-
const kupDates = new KupDates();
|
|
126
|
-
const { id, name, schedule } = item;
|
|
127
|
-
const getDatesForTask = (item) => {
|
|
128
|
-
let start = mainGanttStartDate !== null && mainGanttStartDate !== void 0 ? mainGanttStartDate : '';
|
|
129
|
-
let end = mainGanttEndDate !== null && mainGanttEndDate !== void 0 ? mainGanttEndDate : '';
|
|
130
|
-
for (let i = 0; i < item.schedule.length; i++) {
|
|
131
|
-
const lstart = item.schedule[i].startDate;
|
|
132
|
-
const lend = item.schedule[i].endDate;
|
|
133
|
-
if (!start || lstart.localeCompare(start) < 0) {
|
|
134
|
-
start = lstart;
|
|
135
|
-
}
|
|
136
|
-
if (!end || lend.localeCompare(end) > 0) {
|
|
137
|
-
end = lend;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return kupDates.validDates(start, end, 'detail item');
|
|
141
|
-
};
|
|
142
|
-
const { start, end } = getDatesForTask(item);
|
|
143
|
-
const convertToFrame = (x) => {
|
|
144
|
-
const { startDate, endDate, color, selectedColor, icon } = x;
|
|
145
|
-
const { start, end } = kupDates.validDates(startDate, endDate, 'time frame');
|
|
146
|
-
return {
|
|
147
|
-
start,
|
|
148
|
-
end,
|
|
149
|
-
backgroundColor: color !== null && color !== void 0 ? color : '0xffffff',
|
|
150
|
-
backgroundSelectedColor: selectedColor !== null && selectedColor !== void 0 ? selectedColor : color,
|
|
151
|
-
icon,
|
|
152
|
-
};
|
|
153
|
-
};
|
|
154
|
-
const defaultColor = '#595959';
|
|
155
|
-
return {
|
|
156
|
-
id,
|
|
157
|
-
type: 'timeline',
|
|
158
|
-
timeline: schedule.map(convertToFrame),
|
|
159
|
-
name,
|
|
160
|
-
valuesToShow: item.valuesToShow,
|
|
161
|
-
start: start,
|
|
162
|
-
end: end,
|
|
163
|
-
progress: 100,
|
|
164
|
-
styles: {
|
|
165
|
-
backgroundColor: defaultColor,
|
|
166
|
-
progressColor: defaultColor,
|
|
167
|
-
backgroundSelectedColor: defaultColor,
|
|
168
|
-
progressSelectedColor: defaultColor,
|
|
169
|
-
},
|
|
170
|
-
};
|
|
171
|
-
};
|
|
172
|
-
/** Return a shallow copy, with the dates updated */
|
|
173
|
-
const withNewDates = (p, start, end) => {
|
|
174
|
-
const kupDates = new KupDates();
|
|
175
|
-
const startDate = kupDates.formatToIsoDate(start);
|
|
176
|
-
const endDate = kupDates.formatToIsoDate(end);
|
|
177
|
-
const extra = { startDate, endDate };
|
|
178
|
-
return Object.assign(Object.assign({}, p), extra);
|
|
179
|
-
};
|
|
180
|
-
/**
|
|
181
|
-
* Calculate date range valid for each Gantt
|
|
182
|
-
* @param mainGanttItems
|
|
183
|
-
* @param timeUnit
|
|
184
|
-
* @param mainGanttDoubleView
|
|
185
|
-
* @param secondaryGanttItems
|
|
186
|
-
* @param preStepsCount
|
|
187
|
-
* @returns
|
|
188
|
-
*/
|
|
189
|
-
const calculateDisplayedDateRange = (mainGanttItems, timeUnit, mainGanttDoubleView, secondaryGanttItems, preStepsCount) => {
|
|
190
|
-
const dates = ganttDateRangeFromGanttTask(mainGanttItems, timeUnit, preStepsCount !== null && preStepsCount !== void 0 ? preStepsCount : 1, mainGanttDoubleView);
|
|
191
|
-
if (secondaryGanttItems) {
|
|
192
|
-
const dates2 = ganttDateRangeFromDetail(secondaryGanttItems, timeUnit, preStepsCount !== null && preStepsCount !== void 0 ? preStepsCount : 1, mainGanttDoubleView);
|
|
193
|
-
if (dates2[0] < dates[0]) {
|
|
194
|
-
dates[0] = dates2[0];
|
|
195
|
-
}
|
|
196
|
-
if (dates2[1] > dates[1]) {
|
|
197
|
-
dates[1] = dates2[1];
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
return {
|
|
201
|
-
displayedStartDate: dates[0],
|
|
202
|
-
displayedEndDate: dates[1],
|
|
203
|
-
};
|
|
204
|
-
};
|
|
205
|
-
const ganttDateRangeFromGanttTask = (tasks, viewMode, preStepsCount, showSecondaryDates) => {
|
|
206
|
-
const dates = [];
|
|
207
|
-
const kupDates = new KupDates();
|
|
208
|
-
tasks.forEach((item) => {
|
|
209
|
-
var _a;
|
|
210
|
-
dates.push({
|
|
211
|
-
start: kupDates.parseToDayStart(item.startDate),
|
|
212
|
-
end: kupDates.parseToDayEnd(item.endDate),
|
|
213
|
-
secondaryStart: kupDates.parseToDayStart(item.secondaryStartDate),
|
|
214
|
-
secondaryEnd: kupDates.parseToDayEnd(item.secondaryEndDate),
|
|
215
|
-
});
|
|
216
|
-
(_a = item.phases) === null || _a === void 0 ? void 0 : _a.forEach((phase) => {
|
|
217
|
-
dates.push({
|
|
218
|
-
start: kupDates.parseToDayStart(phase.startDate),
|
|
219
|
-
end: kupDates.parseToDayEnd(phase.endDate),
|
|
220
|
-
secondaryStart: kupDates.parseToDayStart(phase.secondaryStartDate),
|
|
221
|
-
secondaryEnd: kupDates.parseToDayEnd(phase.secondaryEndDate),
|
|
222
|
-
});
|
|
223
|
-
});
|
|
224
|
-
});
|
|
225
|
-
return ganttDateRangeGeneric(dates, viewMode, preStepsCount, showSecondaryDates, true);
|
|
226
|
-
};
|
|
227
|
-
const ganttDateRangeGeneric = (dates, viewMode, preStepsCount, showSecondaryDates, realDates) => {
|
|
228
|
-
let newStartDate = dates.length > 0 ? dates[0].start : new Date();
|
|
229
|
-
let newEndDate = dates.length > 0 ? dates[0].end : new Date();
|
|
230
|
-
for (const d of dates) {
|
|
231
|
-
if (d.start < newStartDate) {
|
|
232
|
-
newStartDate = d.start;
|
|
233
|
-
}
|
|
234
|
-
if (d.end > newEndDate) {
|
|
235
|
-
newEndDate = d.end;
|
|
236
|
-
}
|
|
237
|
-
if (showSecondaryDates) {
|
|
238
|
-
if (d.secondaryStart && d.secondaryStart < newStartDate) {
|
|
239
|
-
newStartDate = d.secondaryStart;
|
|
240
|
-
}
|
|
241
|
-
if (d.secondaryEnd && d.secondaryEnd > newEndDate) {
|
|
242
|
-
newEndDate = d.secondaryEnd;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
if (realDates) {
|
|
247
|
-
return [newStartDate, newEndDate];
|
|
248
|
-
}
|
|
249
|
-
switch (viewMode) {
|
|
250
|
-
case 'year':
|
|
251
|
-
newStartDate = addToDate(newStartDate, -1, 'year');
|
|
252
|
-
newStartDate = startOfDate(newStartDate, 'year');
|
|
253
|
-
newEndDate = addToDate(newEndDate, 1, 'year');
|
|
254
|
-
newEndDate = startOfDate(newEndDate, 'year');
|
|
255
|
-
break;
|
|
256
|
-
case 'month':
|
|
257
|
-
newStartDate = addToDate(newStartDate, -1 * preStepsCount, 'month');
|
|
258
|
-
newStartDate = startOfDate(newStartDate, 'month');
|
|
259
|
-
newEndDate = addToDate(newEndDate, 1, 'month');
|
|
260
|
-
newEndDate = startOfDate(newEndDate, 'month');
|
|
261
|
-
break;
|
|
262
|
-
case 'week':
|
|
263
|
-
newStartDate = startOfDate(newStartDate, 'day');
|
|
264
|
-
newStartDate = addToDate(getMonday(newStartDate), -7 * preStepsCount, 'day');
|
|
265
|
-
newEndDate = startOfDate(newEndDate, 'day');
|
|
266
|
-
newEndDate = addToDate(newEndDate, 1.5, 'month');
|
|
267
|
-
break;
|
|
268
|
-
case 'day':
|
|
269
|
-
newStartDate = startOfDate(newStartDate, 'day');
|
|
270
|
-
newStartDate = addToDate(newStartDate, -1 * preStepsCount, 'day');
|
|
271
|
-
newEndDate = startOfDate(newEndDate, 'day');
|
|
272
|
-
newEndDate = addToDate(newEndDate, 19, 'day');
|
|
273
|
-
break;
|
|
274
|
-
}
|
|
275
|
-
return [newStartDate, newEndDate];
|
|
276
|
-
};
|
|
277
|
-
const ganttDateRangeFromDetail = (details, viewMode, preStepsCount, showSecondaryDates) => {
|
|
278
|
-
const dates = [];
|
|
279
|
-
const kupDates = new KupDates();
|
|
280
|
-
details.forEach((item) => {
|
|
281
|
-
const scheduleItems = item.schedule;
|
|
282
|
-
if (scheduleItems) {
|
|
283
|
-
scheduleItems.forEach((item) => {
|
|
284
|
-
dates.push({
|
|
285
|
-
start: kupDates.parseToDayStart(item.startDate),
|
|
286
|
-
end: kupDates.parseToDayEnd(item.endDate),
|
|
287
|
-
secondaryStart: undefined,
|
|
288
|
-
secondaryEnd: undefined,
|
|
289
|
-
});
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
return ganttDateRangeGeneric(dates, viewMode, preStepsCount, showSecondaryDates, true);
|
|
294
|
-
};
|
|
295
|
-
const addToDate = (date, quantity, scale) => {
|
|
296
|
-
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));
|
|
297
|
-
return newDate;
|
|
298
|
-
};
|
|
299
|
-
const startOfDate = (date, scale) => {
|
|
300
|
-
const scores = [
|
|
301
|
-
'millisecond',
|
|
302
|
-
'second',
|
|
303
|
-
'minute',
|
|
304
|
-
'hour',
|
|
305
|
-
'day',
|
|
306
|
-
'month',
|
|
307
|
-
'year',
|
|
308
|
-
];
|
|
309
|
-
const shouldReset = (_scale) => {
|
|
310
|
-
const maxScore = scores.indexOf(scale);
|
|
311
|
-
return scores.indexOf(_scale) <= maxScore;
|
|
312
|
-
};
|
|
313
|
-
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());
|
|
314
|
-
return newDate;
|
|
315
|
-
};
|
|
316
|
-
/**
|
|
317
|
-
* Returns monday of current week
|
|
318
|
-
* @param date date for modify
|
|
319
|
-
*/
|
|
320
|
-
const getMonday = (date) => {
|
|
321
|
-
const day = date.getDay();
|
|
322
|
-
const diff = date.getDate() - day + (day === 0 ? -6 : 1); // adjust when day is sunday
|
|
323
|
-
return new Date(date.setDate(diff));
|
|
324
|
-
};
|
|
325
|
-
const ganttDateRangeFromTask = (tasks, viewMode, preStepsCount, showSecondaryDates, mainGanttStartDate, mainGanttEndDate) => {
|
|
326
|
-
const dates = [];
|
|
327
|
-
tasks.forEach((item) => {
|
|
328
|
-
dates.push({
|
|
329
|
-
start: item.start,
|
|
330
|
-
end: item.end,
|
|
331
|
-
secondaryStart: item.secondaryStart,
|
|
332
|
-
secondaryEnd: item.secondaryEnd,
|
|
333
|
-
});
|
|
334
|
-
});
|
|
335
|
-
if (mainGanttStartDate && mainGanttEndDate) {
|
|
336
|
-
dates.push({
|
|
337
|
-
start: mainGanttStartDate,
|
|
338
|
-
end: mainGanttEndDate,
|
|
339
|
-
secondaryStart: undefined,
|
|
340
|
-
secondaryEnd: undefined,
|
|
341
|
-
});
|
|
342
|
-
}
|
|
343
|
-
return ganttDateRangeGeneric(dates, viewMode, preStepsCount, showSecondaryDates);
|
|
344
|
-
};
|
|
345
|
-
const seedDates = (startDate, endDate, viewMode) => {
|
|
346
|
-
let currentDate = new Date(startDate);
|
|
347
|
-
const dates = [currentDate];
|
|
348
|
-
while (currentDate < endDate) {
|
|
349
|
-
switch (viewMode) {
|
|
350
|
-
case 'year':
|
|
351
|
-
currentDate = addToDate(currentDate, 1, 'year');
|
|
352
|
-
break;
|
|
353
|
-
case 'month':
|
|
354
|
-
currentDate = addToDate(currentDate, 1, 'month');
|
|
355
|
-
break;
|
|
356
|
-
case 'week':
|
|
357
|
-
currentDate = addToDate(currentDate, 7, 'day');
|
|
358
|
-
break;
|
|
359
|
-
case 'day':
|
|
360
|
-
currentDate = addToDate(currentDate, 1, 'day');
|
|
361
|
-
break;
|
|
362
|
-
/*
|
|
363
|
-
case ViewMode.HalfDay:
|
|
364
|
-
currentDate = addToDate(currentDate, 12, "hour");
|
|
365
|
-
break;
|
|
366
|
-
case ViewMode.QuarterDay:
|
|
367
|
-
currentDate = addToDate(currentDate, 6, "hour");
|
|
368
|
-
break;
|
|
369
|
-
case ViewMode.Hour:
|
|
370
|
-
currentDate = addToDate(currentDate, 1, "hour");
|
|
371
|
-
break;
|
|
372
|
-
*/
|
|
373
|
-
}
|
|
374
|
-
dates.push(currentDate);
|
|
375
|
-
}
|
|
376
|
-
return dates;
|
|
377
|
-
};
|
|
378
|
-
|
|
379
|
-
export { addToDate as a, getPhaseById as b, getProjectById as c, calculateDisplayedDateRange as d, convertProjectToTasks as e, mergeTaskIntoPhases as f, ganttDateRangeFromTask as g, columnWidthForTimeUnit as h, mergeTaskIntoProjects as m, seedDates as s };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,f as e,h as n,H as a,d as o}from"./p-47040db6.js";import{k as s,g as l,s as f,l as p,a3 as h}from"./p-8229b97a.js";import{c as r}from"./p-635bb4b3.js";import{F as c}from"./p-2d4a9235.js";import{F as u}from"./p-b3577066.js";import{F as m}from"./p-a46f99d4.js";import"./p-eb8ea3a6.js";import"./p-c634eb82.js";import"./p-c0f660d6.js";import"./p-d4a879fc.js";import"./p-e2bf2bb6.js";import"./p-6c888179.js";import"./p-61e8d573.js";var d;!function(t){t.customStyle="Custom style of the component.",t.data="Actual data of the input panel.",t.hiddenSubmitButton="Creates a hidden submit button in order to submit the form with enter.",t.submitCb="Sets the callback function on submit form",t.valueChangeCb="Sets the callback function on value change event"}(d||(d={}));var g,b,x,k,y,v,w,j,z,_,C,O,E,D,F,S=function(t,i,e,n){if("a"===e&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!n:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?n:"a"===e?n.call(t):n?n.value:i.get(t)};const I=document.documentElement,P=class{constructor(e){t(this,e),this.kupReady=i(this,"kup-input-panel-ready",6),g.add(this),b.set(this,s()),this.customStyle="",this.data=null,this.hiddenSubmitButton=!1,this.submitCb=null,this.handleEventsCallbacks=[],this.inputPanelCells=[]}onDataChanged(){S(this,g,"m",y).call(this,this.data)}async getProps(t){return l(this,d,t)}async refresh(){e(this)}async setProps(t){f(this,d,t)}componentWillLoad(){S(this,b,"f").debug.logLoad(this,!1),S(this,b,"f").language.register(this),S(this,b,"f").theme.register(this),this.onDataChanged()}componentDidLoad(){this.kupReady.emit({comp:this,id:this.rootElement.id}),S(this,b,"f").debug.logLoad(this,!0),this.handleEventsCallbacks.map((t=>{this.rootElement.addEventListener(t.eventName,(i=>{const e={state:this.inputPanelCells.find((t=>t.cells.find((t=>t.column.name===i.detail.id)))).cells,data:{field:i.detail.id,value:i.detail.inputValue||i.detail.value}};t.eventCallback(e)}))}))}componentWillRender(){S(this,b,"f").debug.logRender(this,!1)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const i=t.querySelectorAll(".f-text-field");for(let t=0;t<i.length;t++)u(i[t])}S(this,b,"f").debug.logRender(this,!0)}render(){const t=Boolean(!this.inputPanelCells.length)?[n("p",null,S(this,b,"f").language.translate(p.EMPTY_DATA))]:this.inputPanelCells.map((t=>S(this,g,"m",x).call(this,t)));return n(a,{key:"47b1cbfae920b48873c3c5c5629ed1d9f4ac7290"},n("style",{key:"d48cfa1e1f470e9b991745ef30ebc236c6399b98"},S(this,b,"f").theme.setKupStyle(this.rootElement)),n("div",{key:"257d3d98795b32e59abee2c5aa8be341880f37be",id:r},t))}disconnectedCallback(){S(this,b,"f").language.unregister(this),S(this,b,"f").theme.unregister(this)}get rootElement(){return o(this)}static get watchers(){return{data:["onDataChanged"]}}};b=new WeakMap,g=new WeakSet,x=function(t){var i;const e=(null===(i=t.row.layout)||void 0===i?void 0:i.horizontal)||!1,a=t.cells.map((i=>S(this,g,"m",k).call(this,i.cell,t.row,i.column)));return n("form",{class:{form:!0,"input-panel":!0,"form--column":!e},name:this.rootElement.id,onSubmit:this.submitCb},a,this.hiddenSubmitButton?n(c,{buttonType:"submit",label:S(this,b,"f").language.translate(p.CONFIRM),wrapperClass:"form__submit"}):null)},k=function(t,i,e){return n(m,Object.assign({},{cell:t,column:e,row:i,component:this,editable:t.isEditable,renderKup:!0,setSizes:!0}))},y=function(t){var i;const e=(null===(i=null==t?void 0:t.rows)||void 0===i?void 0:i.length)?t.rows.reduce(((i,e)=>[...i,{cells:t.columns.filter((t=>t.visible)).map((t=>{const i=e.cells[t.name];return{column:t,cell:Object.assign(Object.assign({},i),{data:Object.assign(Object.assign({},S(this,g,"m",v).call(this,i,t)),{id:t.name}),slotData:S(this,g,"m",w).call(this,i,t),isEditable:i.editable})}})),row:e}]),[]):[];this.inputPanelCells=e},v=function(t,i){const e=t.options,n=i.title,a=t.value,o=I.ketchup.data.cell.getType(t,t.shape),s=new Map([[h.AUTOCOMPLETE,S(this,g,"m",C)],[h.BUTTON_LIST,S(this,g,"m",_)],[h.CHART,S(this,g,"m",z)],[h.CHIP,S(this,g,"m",j)],[h.CHECKBOX,S(this,g,"m",O)],[h.COLOR_PICKER,S(this,g,"m",E)],[h.COMBOBOX,S(this,g,"m",C)],[h.RADIO,S(this,g,"m",F)],[h.STRING,S(this,g,"m",D)]]).get(o);return s?s(e,n,a):null},w=function(t,i){const e=I.ketchup.data.cell.getType(t,t.shape);return e===h.CHIP||e===h.MULTI_AUTOCOMPLETE||e===h.MULTI_COMBOBOX||t.editable?{trailingIcon:!0,label:i.title}:null},j=function(t,i,e){return{data:(null==t?void 0:t.length)?t.map((t=>({value:t.label,id:t.id,selected:e===t.id}))):[{id:e,value:e}]}},z=function(){return{data:{sizeX:"50px",offlineMode:{value:"8;4;5"},id:"i1012_GREF_0",cellId:"i1012_GREF_0",sizeY:"50px"}}},_=function(){return{data:[{data:{dropdownOnly:!1,label:"Pier"}},{data:{dropdownOnly:!1,label:"Valerio"}}]}},C=function(t,i,e){return{data:{"kup-text-field":{trailingIcon:!0,label:i,icon:"arrow_drop_down"},"kup-list":{showIcons:!0,data:(null==t?void 0:t.length)?t.map((t=>({value:t.label,id:t.id,selected:e===t.id}))):[]}},label:i}},O=function(t,i,e){return{checked:"on"===e||"1"===e,label:i}},E=function(t,i){return{data:{"kup-text-field":{label:i}}}},D=function(t,i){return{label:i}},F=function(t,i,e){return{data:t.map((t=>({value:t.id,label:t.label,checked:t.id===e})))}},P.style=".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}.input-panel .f-cell .f-checkbox .checkbox .checkbox__native-control{height:40px;width:40px}";export{P as kup_input_panel}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,f as s,h,H as e,d as n,g as o}from"./p-47040db6.js";import{k as a,ac as l,g as r,s as f,a as c,D as d}from"./p-8229b97a.js";import{K as p,d as u,a as m,b as v,c as w}from"./p-924b841b.js";import{c as g}from"./p-635bb4b3.js";import{K as k}from"./p-eb8ea3a6.js";import{F as y}from"./p-6c888179.js";import{F as b}from"./p-b3577066.js";import"./p-d4a879fc.js";const x=a();function D(t,i,s,h){const e=S(t,i);let n=[];return s&&h&&(n=O(s,h)?S(s,h):[...e]),{dateValues:e,secDateValues:n}}function S(t,i){let s=[t.value,i.value];return j(t)&&j(i)?s:j(t)?[t.value,t.value]:j(i)?[i.value,i.value]:s}function j(t){return x.objects.isDate(t.obj)&&x.dates.isValid(t.value,k.ISO_DATE)}function O(t,i){return j(t)||j(i)}function C(t,i,s,h,e,n){let o=()=>e.map((i=>l(h.find((t=>t.name==i)),t.cells[i])));return n&&(o=n),(null==e?void 0:e.length)>=2?o():[t.cells[i].value,t.cells[s].value]}class T{constructor(){this.showSecondaryDates=!1,this.detailFilter="",this.detailInitialScrollX=0,this.detailInitialScrollY=0,this.taskFilter="",this.taskInitialScrollX=0,this.taskInitialScrollY=0,this.viewMode="day"}toDebugString(){return"dt state"}}var z,M,E,W,I,R,Y,K,P,V,G,X,A,F,L,H,N,_,q,B,J,Q,U,Z,$=function(t,i,s,h){if("a"===s&&!h)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!h:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?h:"a"===s?h.call(t):h?h.value:i.get(t)},tt=function(t,i,s,h,e){if("m"===h)throw new TypeError("Private method is not writable");if("a"===h&&!e)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?t!==i||!e:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===h?e.call(t,s):e?e.value=s:i.set(t,s),s};const it=class{constructor(s){t(this,s),this.kupClick=i(this,"kup-planner-click",6),this.kupDblClick=i(this,"kup-planner-dblclick",6),this.kupDateChange=i(this,"kup-planner-datechange",6),this.kupReady=i(this,"kup-planner-ready",6),this.kupContextMenu=i(this,"kup-planner-contextmenu",6),this.kupDidUnload=i(this,"kup-planner-didunload",6),z.add(this),this.state=new T,this.plannerRenderer=void 0,M.set(this,a()),E.set(this,void 0),W.set(this,[]),I.set(this,{}),R.set(this,void 0),this.stateId="",this.store=void 0,this.customStyle="",this.data=void 0,this.detailData=void 0,this.detailColorCol=void 0,this.detailColumns=void 0,this.detailDates=void 0,this.detailFilter=void 0,this.detailHeight=void 0,this.detailIconCol=void 0,this.detailIdCol=void 0,this.detailNameCol=void 0,this.detailPrevDates=void 0,this.detailInitialScrollX=void 0,this.detailInitialScrollY=void 0,this.listCellWidth="300px",this.maxWidth="90vw",this.phaseColorCol=void 0,this.phaseColumns=void 0,this.phaseColParDep=void 0,this.phaseDates=void 0,this.phaseIconCol=void 0,this.phaseIdCol=void 0,this.phaseNameCol=void 0,this.phasePrevDates=void 0,this.readOnly=!1,this.showSecondaryDates=!1,this.taskColumns=void 0,this.taskDates=void 0,this.taskFilter=void 0,this.taskHeight=void 0,this.taskIconCol=void 0,this.taskIdCol=void 0,this.taskInitialScrollX=void 0,this.taskInitialScrollY=void 0,this.taskNameCol=void 0,this.taskPrevDates=void 0,this.titleMess=void 0,this.viewMode="month",this.mainFilter=void 0,this.secondaryFilter=void 0,this.plannerProps=void 0}initWithPersistedState(){if(this.store&&this.stateId){const t=this.store.getState(this.stateId);null!=t&&($(this,M,"f").debug.logMessage(this,"Initializing stateId "+this.stateId),this.detailFilter=t.detailFilter,this.showSecondaryDates=t.showSecondaryDates,this.detailInitialScrollX=t.detailInitialScrollX,this.detailInitialScrollY=t.detailInitialScrollY,this.taskFilter=t.taskFilter,this.taskInitialScrollX=t.taskInitialScrollX,this.taskInitialScrollY=t.taskInitialScrollY,this.viewMode=t.viewMode)}}persistState(){if(this.store&&this.stateId){let t=!1;$(this,M,"f").objects.deepEqual(this.state.detailFilter,$(this,R,"f").detailFilter)||(this.state.detailFilter=$(this,R,"f").detailFilter,t=!0),$(this,M,"f").objects.deepEqual(this.state.showSecondaryDates,$(this,R,"f").showSecondaryDates)||(this.state.showSecondaryDates=$(this,R,"f").showSecondaryDates,t=!0),$(this,M,"f").objects.deepEqual(this.state.detailInitialScrollX,$(this,R,"f").detailInitialScrollX)||(this.state.detailInitialScrollX=$(this,R,"f").detailInitialScrollX,t=!0),$(this,M,"f").objects.deepEqual(this.state.detailInitialScrollY,$(this,R,"f").detailInitialScrollY)||(this.state.detailInitialScrollY=$(this,R,"f").detailInitialScrollY,t=!0),$(this,M,"f").objects.deepEqual(this.state.taskFilter,$(this,R,"f").taskFilter)||(this.state.taskFilter=$(this,R,"f").taskFilter,t=!0),$(this,M,"f").objects.deepEqual(this.state.taskInitialScrollX,$(this,R,"f").taskInitialScrollX)||(this.state.taskInitialScrollX=$(this,R,"f").taskInitialScrollX,t=!0),$(this,M,"f").objects.deepEqual(this.state.taskInitialScrollY,$(this,R,"f").taskInitialScrollY)||(this.state.taskInitialScrollY=$(this,R,"f").taskInitialScrollY,t=!0),$(this,M,"f").objects.deepEqual(this.state.viewMode,$(this,R,"f").viewMode)||(this.state.viewMode=$(this,R,"f").viewMode,t=!0),t&&($(this,M,"f").debug.logMessage(this,"Persisting stateId "+this.stateId),this.store.persistState(this.stateId,this.state))}}dataChanged(){tt(this,I,{},"f")}async getProps(t){return r(this,w,t)}async refresh(){s(this),this.plannerRenderer.refresh()}async setProps(t){f(this,w,t)}async addPhases(t,i){var s;const h=$(this,z,"m",P).call(this,t);h&&($(this,I,"f")[t]=i,h.phases=null===(s=i.rows)||void 0===s?void 0:s.filter((t=>O(t.cells[this.phaseDates[0]],t.cells[this.phaseDates[1]]))).map((t=>{const s=D(t.cells[this.phaseDates[0]],t.cells[this.phaseDates[1]],t.cells[this.phasePrevDates[0]],t.cells[this.phasePrevDates[1]]),e=C(t,this.phaseIdCol,this.phaseNameCol,i.columns,this.phaseColumns,(()=>this.phaseColumns.map((s=>s==this.phaseDates[0]?"#START#":s==this.phaseDates[1]?"#END#":l(i.columns.find((t=>t.name==s)),t.cells[s])))));let n=$(this,z,"m",U).call(this,t,this.phaseIconCol),o=$(this,z,"m",Z).call(this,t,this.phaseIconCol);return{taskRow:h.taskRow,phaseRow:t,id:h.id+"_"+t.cells[this.phaseIdCol].value,phaseRowId:t.id,taskRowId:h.taskRowId,name:t.cells[this.phaseNameCol].value,startDate:s.dateValues[0],endDate:s.dateValues[1],secondaryStartDate:s.secDateValues[0],secondaryEndDate:s.secDateValues[1],type:"task",color:t.cells[this.phaseColorCol].value,selectedColor:t.cells[this.phaseColorCol].value,valuesToShow:e,rowType:p.PHASE,icon:n?{url:n,color:null!=o?o:"#595959"}:void 0}}))),this.plannerProps.mainGantt.initialScrollX=$(this,R,"f").taskInitialScrollX,this.plannerProps.mainGantt.initialScrollY=$(this,R,"f").taskInitialScrollY,this.plannerProps.secondaryGantt&&(this.plannerProps.secondaryGantt.initialScrollX=$(this,R,"f").detailInitialScrollX,this.plannerProps.secondaryGantt.initialScrollX=$(this,R,"f").detailInitialScrollY),this.plannerProps=Object.assign({},this.plannerProps),this.refresh()}componentWillLoad(){$(this,M,"f").debug.logLoad(this,!1),$(this,M,"f").theme.register(this),this.initWithPersistedState(),tt(this,R,{detailFilter:this.detailFilter,detailInitialScrollX:this.detailInitialScrollX,detailInitialScrollY:this.detailInitialScrollY,showSecondaryDates:this.showSecondaryDates,taskFilter:this.taskFilter,taskInitialScrollX:this.taskInitialScrollX,taskInitialScrollY:this.taskInitialScrollY,viewMode:this.viewMode},"f")}componentDidLoad(){let t=$(this,z,"m",K).call(this,$(this,z,"m",Q).call(this,$(this,R,"f").detailFilter,!0));const i=this.rootElement.shadowRoot.querySelector("#main-filter");b(i);const s=this.rootElement.shadowRoot.querySelector("#secondary-filter");let h,e,n;t&&b(s),this.plannerProps={mainGantt:{title:this.titleMess,items:$(this,z,"m",Y).call(this,$(this,z,"m",Q).call(this,$(this,R,"f").taskFilter,!1)),stylingOptions:Object.assign(Object.assign({},u),{listCellWidth:this.listCellWidth}),filter:i,hideLabel:!0,ganttHeight:this.taskHeight,showSecondaryDates:$(this,R,"f").showSecondaryDates,onClick:t=>this.handleOnClick(t),onDblClick:t=>this.handleOnDblClick(t),onContextMenu:(t,i)=>this.handleOnContextMenu(t,i),onDateChange:t=>this.handleOnDateChange(t),initialScrollX:this.taskInitialScrollX,initialScrollY:this.taskInitialScrollY,readOnly:this.readOnly,onScrollY:t=>{window.clearTimeout(e),e=window.setTimeout((()=>this.handleTaskGanttScrollY(t)),500)}},secondaryGantt:t?{title:"",items:t,stylingOptions:Object.assign(Object.assign({},u),{listCellWidth:this.listCellWidth}),filter:s,hideLabel:!0,ganttHeight:this.detailHeight,onClick:t=>this.handleOnClick(t),onContextMenu:(t,i)=>this.handleOnContextMenu(t,i),onDateChange:t=>this.handleOnDateChange(t),initialScrollX:this.detailInitialScrollX,initialScrollY:this.detailInitialScrollY,readOnly:this.readOnly,onScrollY:t=>{window.clearTimeout(n),n=window.setTimeout((()=>this.handleDetailGanttScrollY(t)),500)}}:void 0,onSetDoubleView:t=>this.handleOnSetDoubleView(t),onSetViewMode:t=>this.handleOnSetViewMode(t),viewMode:this.viewMode,onScrollX:t=>{window.clearTimeout(h),h=window.setTimeout((()=>this.handleOnScrollX(t)),500)}},this.kupReady.emit({comp:this,id:this.rootElement.id,value:void 0}),this.taskFilter&&$(this,z,"m",J).call(this,this.taskFilter),this.detailFilter&&$(this,z,"m",J).call(this,this.detailFilter,!0),$(this,M,"f").debug.logLoad(this,!0)}componentDidRender(){this.persistState(),$(this,M,"f").debug.logRender(this,!0)}onKupDblClick(t,i){this.kupDblClick.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}onKupClick(t,i){this.kupClick.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}onKupContextMenu(t,i,s){let h,e,n;switch(i.type){case"project":h=i.taskRow,e=h.cells[this.taskIdCol],n=this.data.columns[this.taskIdCol];break;case"task":h=i.phaseRow,e=h.cells[this.phaseIdCol];break;case"timeline":h=i.detailRow,e=h.cells[this.detailIdCol],n=this.data.columns[this.detailIdCol]}this.kupContextMenu.emit({comp:this,id:this.rootElement.id,value:i,taskAction:s,details:{cell:e,column:n,originalEvent:t,row:h}})}onKupDateChange(t,i){this.kupDateChange.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}handleOnDblClick(t){switch(t.rowType){case p.TASK:$(this,z,"m",G).call(this)&&this.onKupDblClick(t,m.onDblClick);break;case p.PHASE:$(this,z,"m",X).call(this)&&this.onKupDblClick(t,m.onDblClick);break;case p.DETAIL:$(this,z,"m",A).call(this)&&this.onKupDblClick(t,m.onDblClick)}for(let t=0;t<$(this,W,"f").length;t++)clearTimeout($(this,W,"f")[t]),$(this,M,"f").debug.logMessage(this,"Cleared click timeout("+$(this,W,"f")[t]+").");tt(this,W,[],"f")}handleOnClick(t){$(this,W,"f").push(setTimeout((()=>{switch(t.rowType){case p.TASK:const i=t.phases?m.onTaskClosing:m.onTaskOpening;$(this,z,"m",F).call(this,t)&&this.onKupClick(t,i);break;case p.PHASE:$(this,z,"m",L).call(this)&&this.onKupClick(t,m.onClick);break;case p.DETAIL:$(this,z,"m",H).call(this)&&this.onKupClick(t,m.onClick)}}),300))}handleOnContextMenu(t,i){switch(i.rowType){case p.TASK:$(this,z,"m",N).call(this)&&this.onKupContextMenu(t,i,m.onRightClick);break;case p.PHASE:$(this,z,"m",_).call(this)&&this.onKupContextMenu(t,i,m.onRightClick);break;case p.DETAIL:$(this,z,"m",q).call(this)&&this.onKupContextMenu(t,i,m.onRightClick)}}handleOnSetDoubleView(t){var i;$(this,R,"f").showSecondaryDates=t,(null===(i=this.plannerProps)||void 0===i?void 0:i.mainGantt)&&(this.plannerProps.mainGantt.showSecondaryDates=t),this.persistState()}handleOnSetViewMode(t){$(this,R,"f").viewMode=t,this.plannerProps.viewMode=t,this.persistState()}handleOnScrollX(t){$(this,R,"f").taskInitialScrollX=t,$(this,R,"f").detailInitialScrollX=t,this.persistState()}handleTaskGanttScrollY(t){$(this,R,"f").taskInitialScrollY=t,this.persistState()}handleDetailGanttScrollY(t){$(this,R,"f").detailInitialScrollY=t,this.persistState()}handleOnDateChange(t){$(this,z,"m",B).call(this,t)&&t.rowType!=p.DETAIL&&this.onKupDateChange(t,m.onResize)}render(){var t,i,s;const n=this.plannerProps?Object.assign(Object.assign({},this.plannerProps),{onSetDoubleView:this.handleOnSetDoubleView.bind(this),onSetViewMode:this.handleOnSetViewMode.bind(this),onScrollX:this.handleOnScrollX.bind(this),mainGantt:Object.assign(Object.assign({},null===(t=this.plannerProps)||void 0===t?void 0:t.mainGantt),{onScrollY:this.handleTaskGanttScrollY.bind(this)})}):null;return(null===(i=this.plannerProps)||void 0===i?void 0:i.secondaryGantt)&&(n.secondaryGantt=Object.assign(Object.assign({},this.plannerProps.secondaryGantt),{onScrollY:this.handleDetailGanttScrollY.bind(this)})),h(e,{key:"48097981722a6754c764f640323df8db967a8965"},h("style",{key:"4e707ee5c473822a3d8f57c54d49e79df72094ba"},$(this,M,"f").theme.setKupStyle(this.rootElement)),h("div",{key:"ed811811c76bd8e36487018607af8d72125bce3a",id:g,style:{maxWidth:this.maxWidth}},this.plannerProps&&h("kup-planner-renderer",{props:n,ref:t=>this.plannerRenderer=t})),h("div",{key:"d337aadbee5d6e101c2ed0084b85fddb51602c93",style:{display:this.plannerProps?"none":""}},h(y,{key:"c1ae374b1041d4e273a5e6eac20b72d2a4011374",icon:c.SEARCH,id:"main-filter",label:$(this,M,"f").language.translate(d.SEARCH),onKeyDown:t=>{"Enter"===t.key&&$(this,z,"m",J).call(this,t.target.value)},value:this.taskFilter,wrapperClass:"filter"}),(null===(s=this.detailData)||void 0===s?void 0:s.rows)&&this.detailData.rows.length>0?h(y,{icon:c.SEARCH,id:"secondary-filter",label:$(this,M,"f").language.translate(d.SEARCH),onKeyDown:t=>{"Enter"===t.key&&$(this,z,"m",J).call(this,t.target.value,!0)},value:this.detailFilter,wrapperClass:"filter"}):null))}disconnectedCallback(){$(this,M,"f").theme.unregister(this),this.kupDidUnload.emit({comp:this,id:this.rootElement.id,storedSettings:$(this,R,"f")})}get rootElement(){return n(this)}static get watchers(){return{data:["dataChanged"]}}};M=new WeakMap,E=new WeakMap,W=new WeakMap,I=new WeakMap,R=new WeakMap,z=new WeakSet,Y=function(t){var i;return t&&t.rows?null===(i=t.rows)||void 0===i?void 0:i.filter((t=>O(t.cells[this.taskDates[0]],t.cells[this.taskDates[1]]))).map((i=>{const s=D(i.cells[this.taskDates[0]],i.cells[this.taskDates[1]],i.cells[this.taskPrevDates[0]],i.cells[this.taskPrevDates[1]]),h=C(i,this.taskIdCol,this.taskNameCol,t.columns,this.taskColumns,(()=>this.taskColumns.map((s=>s==this.taskDates[0]?"#START#":s==this.taskDates[1]?"#END#":l(t.columns.find((t=>t.name==s)),i.cells[s])))));let e=$(this,z,"m",U).call(this,i,this.taskIconCol),n=$(this,z,"m",Z).call(this,i,this.taskIconCol);return{taskRow:i,taskRowId:i.id,id:i.cells[this.taskIdCol].value,name:i.cells[this.taskNameCol].value,startDate:s.dateValues[0],endDate:s.dateValues[1],secondaryStartDate:s.secDateValues[0],secondaryEndDate:s.secDateValues[1],type:"project",valuesToShow:h,rowType:p.TASK,icon:e?{url:e,color:null!=n?n:"#595959"}:void 0}})):[]},K=function(t){if(!t||!t.rows)return;let i=[];return t.rows.filter((t=>O(t.cells[this.detailDates[0]],t.cells[this.detailDates[1]]))).forEach((s=>{var h,e;const n=s.cells[this.detailIdCol].value,o=s.cells[this.detailNameCol].value,a=D(s.cells[this.detailDates[0]],s.cells[this.detailDates[1]]),l=C(s,this.detailIdCol,this.detailNameCol,t.columns,this.detailColumns);let r=i.find((t=>t.id==n));r||(r={id:n,name:o,detailRow:s,type:"timeline",valuesToShow:l,rowType:p.DETAIL,schedule:[]},i.push(r));let f=$(this,z,"m",U).call(this,s,this.detailIconCol),c=$(this,z,"m",Z).call(this,s,this.detailIconCol);r.schedule.push({startDate:a.dateValues[0],endDate:a.dateValues[1],color:this.detailColorCol&&null!==(h=s.cells[this.detailColorCol].value)&&void 0!==h?h:"#D9D9D8",selectedColor:this.detailColorCol&&null!==(e=s.cells[this.detailColorCol].value)&&void 0!==e?e:"#D9D9D8",icon:f?{url:f,color:null!=c?c:"#595959"}:void 0})})),i},P=function(t){return this.plannerProps.mainGantt.items.find((i=>i.id==t))},V=function(t){const i=$(this,z,"m",P).call(this,t);i&&(i.phases=void 0),this.plannerProps=Object.assign({},this.plannerProps)},G=function(){return!0},X=function(){return!0},A=function(){return!0},F=function(t){const i=$(this,z,"m",P).call(this,t.id);return(null==i?void 0:i.phases)&&$(this,z,"m",V).call(this,i.id),!0},L=function(){return!0},H=function(){return!0},N=function(){return!0},_=function(){return!0},q=function(){return!0},B=function(t){let i=!1;return $(this,E,"f")?$(this,E,"f").isEquivalent(t)||(tt(this,E,new v(t),"f"),i=!0):(i=!0,tt(this,E,new v(t),"f")),i},J=function(t,i){i?$(this,R,"f").detailFilter=t:$(this,R,"f").taskFilter=t;const s=i?{secondaryGantt:Object.assign(Object.assign({},this.plannerProps.secondaryGantt),{items:$(this,z,"m",K).call(this,$(this,z,"m",Q).call(this,t,i))})}:{mainGantt:Object.assign(Object.assign({},this.plannerProps.mainGantt),{items:$(this,z,"m",Y).call(this,$(this,z,"m",Q).call(this,t,i))})};this.plannerProps=Object.assign(Object.assign({},this.plannerProps),s),this.persistState()},Q=function(t,i){const s=i?this.detailData:this.data;if(!s||!s.rows||0==s.rows.length)return;if(!t)return s;const h={columns:this.data.columns,rows:[]},e=[];for(let i=0;i<s.rows.length;i++){const h=s.rows[i],n=h.cells;for(let i=0;i<s.columns.length;i++){const o=n[s.columns[i].name];if(o&&l(s.columns[i],o).toLowerCase().indexOf(t.toLowerCase())>-1){e.push({row:h,weight:i});break}}}return e.sort(((t,i)=>t.weight-i.weight)).forEach((t=>{h.rows.push(t.row)})),h},U=function(t,i){var s;let h;if(i){const e=t.cells[i];let n=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.resource;n||(n=e.value),n&&(h=o("./assets/svg/"+n+".svg"))}return h},Z=function(t,i){var s;let h;if(i){const e=t.cells[i];h=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.color,h&&(h=$(this,M,"f").theme.colorCheck(h).hexColor)}return h},it.style=".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}:host{display:block}.filter{margin:12px 10px 12px 0;padding:0 10px}.planner-render{padding-top:40px}";export{it as kup_planner}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{r as t,h as i,F as e}from"./p-47040db6.js";import{b as s,c as n}from"./p-eb8ea3a6.js";import{d as o,a}from"./p-e841c2ae.js";import{h}from"./p-e4c63684.js";import{i as r,g as l,h as f}from"./p-8e3b6de8.js";const p=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:"777c24c612e5d8c93b74a4a8466248cd9a84cd31",class:"custom-task-list-wrapper",style:{height:"50px",fontFamily:this.fontFamily,fontSize:this.fontSize}},i("div",{key:"8a00184f85811656ea2f4c6e69fee0db3ef85f48",class:"title"},i("span",{key:"170a1bef8a7663064ebaaa600a3aaa40beb84243"},this.label)),void 0!==this.setDoubleView&&i("div",{class:"toggler"},i("label",{htmlFor:"ch2",class:"switch"},i("input",{class:"input",id:"ch2",type:"checkbox",checked:this.doubleView,onClick:()=>this.setDoubleView(!this.doubleView)}),i("span",{class:"slider"})),i("span",{class:"label"},"Previsioni")))}};p.style='.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}.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 c=class{constructor(i){t(this,i),this.ganttId=void 0,this.tasks=[],this.rowHeight=0,this.rowWidth="",this.fontFamily="",this.fontSize="",this.setSelectedTask=void 0,this.onclickTaskList=void 0,this.ondblclickTaskList=void 0,this.oncontextmenuTaskList=void 0}render(){const t=new s;return i("div",{key:"6f208e493d948891975d12cfa398634ead8f7631",class:"container"},this.tasks.map((s=>{var n,o,a;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===(n=s.valuesToShow)||void 0===n?void 0:n.map(((e,n)=>i("span",{class:0===n?"main":void 0,title:e.length>10?e:void 0,key:`task_${s.id}_valuesToShow_${n}`},"#START#"===e?t.formatToLocaleSimple(s.start):"#END#"===e?t.formatToLocaleSimple(s.end):e)))):"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)}},i("span",{key:`phase_${s.id}_valuesToShow_color`,style:{height:"16px",width:"16px",backgroundColor:null===(o=s.styles)||void 0===o?void 0:o.backgroundColor}}),null===(a=s.valuesToShow)||void 0===a?void 0:a.map(((e,n)=>i("span",{class:0===n?"main":void 0,title:e.length>10?e:void 0,key:`phase_${s.id}_valuesToShow_${n}`},"#START#"===e?t.formatToLocaleSimple(s.start):"#END#"===e?t.formatToLocaleSimple(s.end):e)))):(()=>{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))))})())})))}};c.style=".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}.container{padding:0 10px;margin-right:10px}.project{background:var(--kup-background-color, #ffffff);border:1px solid var(--kup-border-color, #acacac);border-radius:4px;box-sizing:border-box;color:var(--kup-text-color, #595959);cursor:pointer;display:grid;font-weight:400;grid-template-columns:var(--grid-project-columns, 1fr 1fr 1fr);place-items:center}.project>*{font-size:14px;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.project .main{font-weight:700;width:100%;padding-left:4px}.subrow{cursor:pointer;display:grid;border-width:1px;border-style:solid;border-color:#acacac;border-bottom-left-radius:4px;border-bottom-right-radius:4px;box-sizing:border-box;grid-template-columns:var(--grid-fasi-columns, 1fr 1fr 1fr);place-items:center;background:#ffffff;color:#595959;font-weight:400}.subrow>*{font-size:12px;line-height:14px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%}.subrow:has(+.subrow),.project:has(+.subrow){border-bottom-left-radius:0;border-bottom-right-radius:0}.timeline{cursor:pointer;display:grid;border-width:1px;border-style:solid;border-color:#cbcbcb;border-radius:4px;grid-template-columns:var(--grid-fasi-columns, 1fr 1fr 1fr);place-items:center;background:#fff;color:#595959;font-weight:400;box-sizing:border-box}.timeline>*{font-size:14px;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.timeline .main{font-weight:700;width:100%;padding-left:4px}";const d=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):o.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):o.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):o.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):o.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):o.day(t,this.locale)}getCalendarValuesForYear(){const t=[],e=[],s=.5*this.headerHeight,n=this.dateSetup.dates;for(let o=0;o<n.length;o++){const a=n[o],h=this.formatYear(a);if(e.push(i("text",{key:h,y:.8*this.headerHeight,x:this.columnWidth*o+.5*this.columnWidth,class:"calendarBottomText"},h)),0===o||a.getFullYear()!==n[o-1].getFullYear()){const i=a.getFullYear().toString();let e;e=this.rtl?(6+o+a.getFullYear()+1)*this.columnWidth:(6+o-a.getFullYear())*this.columnWidth,t.push({key:i,value:i,x1Line:this.columnWidth*o,y1Line:0,y2Line:this.headerHeight,xText:e,yText:.9*s})}}return[t,e]}getCalendarValuesForMonth(){const t=[],e=[],s=.5*this.headerHeight,n=this.dateSetup.dates;for(let o=0;o<n.length;o++){const a=n[o],h=this.formatMonth(a);if(e.push(i("text",{key:h+a.getFullYear(),y:.8*this.headerHeight,x:this.columnWidth*o+.5*this.columnWidth,class:"calendarBottomText"},h)),0===o||a.getFullYear()!==n[o-1].getFullYear()){const i=this.formatYear(a);let e;e=this.rtl?(6+o+a.getMonth()+1)*this.columnWidth:(6+o-a.getMonth())*this.columnWidth,t.push({key:i,value:i,x1Line:this.columnWidth*o,y1Line:0,y2Line:s,xText:e,yText:.9*s})}}return[t,e]}getCalendarValuesForWeek(){const t=[],e=[];let s=1;const n=.5*this.headerHeight,o=this.dateSetup.dates;for(let a=o.length-1;a>=0;a--){const h=o[a];let r="";0!==a&&h.getMonth()===o[a-1].getMonth()||(r=this.formatMonthAndYear(h));const l=this.formatWeek(h);e.push(i("text",{key:h.getTime(),y:.8*this.headerHeight,x:this.columnWidth*(a+ +this.rtl),class:"calendarBottomText"},l)),r&&(a!==o.length-1&&t.push({key:r,value:r,x1Line:this.columnWidth*a+s*this.columnWidth,y1Line:0,y2Line:n,xText:this.columnWidth*a+this.columnWidth*s*.5,yText:.9*n}),s=0),s++}return[t,e]}getCalendarValuesForDay(){const t=[],e=[],s=.5*this.headerHeight,n=this.dateSetup.dates;for(let o=0;o<n.length;o++){const h=n[o],r=this.formatDay(h);if(e.push(i("text",{key:h.getTime(),y:.8*this.headerHeight,x:this.columnWidth*o+.5*this.columnWidth,class:"calendarBottomText"},r)),o+1!==n.length&&h.getMonth()!==n[o+1].getMonth()){const i=this.formatMonth(h);t.push({key:i+h.getFullYear(),value:i,x1Line:this.columnWidth*(o+1),y1Line:0,y2Line:s,xText:this.columnWidth*(o+1)-a(h.getMonth(),h.getFullYear())*this.columnWidth*.5,yText:.9*s})}}return[t,e]}getTopAndBottomValues(){switch(this.dateSetup.viewMode){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:"afbc0f59b413dd491ba4eec43ae3ad275b083617",xmlns:"http://www.w3.org/2000/svg",width:this.svgWidth,height:this.headerHeight},i("g",{key:"52d441353903b6f5b5310c0e1b8b494c6294084a",class:"calendar","font-size":this.fontSize,"font-family":this.fontFamily},i("rect",{key:"4f5880bcc29c37d1e5f71b65cc752d510a690917",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",{fill:this.currentDateIndicator.color,cx:this.currentDateIndicator.x+2.5,cy:this.headerHeight-8,r:"8"})))}};d.style=".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}.calendarBottomText{text-anchor:middle;fill:#333;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}.calendarTopTick{stroke:#e6e4e4}.calendarTopText{text-anchor:middle;fill:#555;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}.calendarHeader{fill:#ffffff;stroke:#e0e0e0;stroke-width:1.4}";var u,g,x,v,y,m={exports:{}};u=m.exports,g=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),n=Math.min(t,i,e),o=0,a=(s+n)/2;if(s===n)return{h:0,s:0,l:100*a};var h=s-n;return s===t?o=(i-e)/h+(i<e?6:0):s===i?o=(e-t)/h+2:s===e&&(o=(t-i)/h+4),{h:100*(o/=6),s:100*(a>.5?h/(2-s-n):h/(s+n)),l:100*a}},t.prototype.clamp=function(t){return Math.min(Math.max(t,0),255)},t}(),x=function(){function t(t,i){this.target=t,this.targetHSL=t.hsl(),this.options=Object.assign({},{acceptanceLossPercentage:5,maxChecks:15},i),this.reusedColor=new g(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,n=t.values,o=t.maxTriesInLoop,a=void 0===o?500:o,h=t.called,r=void 0===h?0:h,l=null,f=1/0,p=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),x=0;x<6;x++)p[x]=Math.random()>.5?1:-1,c[x]=n[x]+g*p[x],d[x]=n[x]-g*p[x];var v=this.loss(c)-this.loss(d);for(x=0;x<6;x++){var y=v/(2*g)*p[x],m=e[x]/Math.pow(i+u+1,1);n[x]=this.fixValueByFilterIDX(n[x]-m*y,x)}var k=this.loss(n);k<f&&(l=n.slice(0),f=k)}return{values:l,loss:f,called:r}},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}(),v=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},y={},u.clearCache=function(t){t?y[t]&&delete y[t]:y={}},u.hexToCSSFilter=function(t,i){var e,s,n,o,a,h;if(void 0===i&&(i={}),y[t]&&!i.forceFilterRecalculation)return Object.assign({},y[t],{cache:!0});try{if(n=(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,n,o=e.call(t),a=[];try{for(;(void 0===i||i-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(t){n={error:t}}finally{try{s&&!s.done&&(e=o.return)&&e.call(o)}finally{if(n)throw n.error}}return a}((h=t,4===h.length?[parseInt("0x"+h[1]+h[1]),parseInt("0x"+h[2]+h[2]),parseInt("0x"+h[3]+h[3])]:7===h.length?[parseInt("0x"+h[1]+h[2]),parseInt("0x"+h[3]+h[4]),parseInt("0x"+h[5]+h[6])]:[]),3))[1],o=e[2],!v(s=e[0])||!v(n)||!v(o))throw new Error("hextToRgb returned an invalid value for '"+t+"'");a=new g(Number(s),Number(n),Number(o))}catch(t){throw new Error("Color value should be in HEX format. "+t)}var r=new x(a,Object.assign({},{acceptanceLossPercentage:5,maxChecks:30,forceFilterRecalculation:!1},i));return y[t]=Object.assign({},r.solve(),{hex:t,rgb:[s,n,o],cache:!1})},Object.defineProperty(u,"__esModule",{value:!0});const k=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.setGanttEvent=void 0,this.xStep=0,this.initEventX1Delta=0,this.initEventXClick=0,this.isMoving=!1,this.point=void 0,this.svg=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;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:n,changedTask:o}=f(s.x,this.ganttEvent.action,this.ganttEvent.changedTask,this.xStep,this.timeStep,this.initEventX1Delta,this.rtl);n&&this.setGanttEvent(Object.assign(Object.assign({},this.ganttEvent),{action:this.ganttEvent.action,changedTask:o}))},i=async e=>{var s,n;const{action:o,originalSelectedTask:a,changedTask:h}=this.ganttEvent;if(!(h&&this.point&&this.svg&&a))return;e.preventDefault(),this.point.x=e.clientX;const r=this.point.matrixTransform(null===(n=null===(s=this.svg)||void 0===s?void 0:s.getScreenCTM())||void 0===n?void 0:n.inverse()),{changedTask:l}=f(r.x,o,h,this.xStep,this.timeStep,this.initEventX1Delta,this.rtl),p=a.start!==l.start||a.end!==l.end||a.progress!==l.progress;this.svg.removeEventListener("mousemove",t),this.svg.removeEventListener("mouseup",i),this.setGanttEvent({action:""}),this.isMoving=!1;let c=!0;if(("move"===o||"end"===o||"start"===o)&&this.dateChange&&p)try{const t=await this.dateChange(l,l.barChildren);void 0!==t&&(c=t)}catch(t){c=!1}else if(this.progressChange&&p)try{const t=this.progressChange(l,l.barChildren);void 0!==t&&(c=t)}catch(t){c=!1}c||this.setFailedTask(a)};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}handleBarEventStart(t,i,e){var s;if(e)if(r(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 n=this.point.matrixTransform(null===(s=this.svg.getScreenCTM())||void 0===s?void 0:s.inverse());this.initEventX1Delta=n.x-i.x1,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=m.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,n){var o,a,h;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,!this.readOnly&&!!this.dateChange&&!t.isDisabled,t,t.x1secondary,(null!==(o=t.x2secondary)&&void 0!==o?o:0)-(null!==(a=t.x1secondary)&&void 0!==a?a:0)),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")),n&&i("polygon",{class:"barHandle",points:this.calculateProgressPoint(t),onMouseDown:i=>{this.handleBarEventStart("progress",t,i)}})),t.icon&&t.icon.url&&this.getTaskIcon({color:null!==(h=t.icon.color)&&void 0!==h?h:"#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,n,o,a,h,r,l,f,p,c,d){if(this.showSecondaryDates&&void 0!==c){const u=n/2;return i("g",{onMouseDown:t=>f&&this.handleBarEventStart("move",p,t)},i("rect",{key:"top semi-transparent bar",x:c,width:d,y:e,height:u,ry:h,rx:h,fill:this.getBarColor(l,r),opacity:.5,class:"barBackground"}),i("rect",{key:"main bar",x:t,width:s,y:e+u,height:u,ry:h,rx:h,fill:this.getBarColor(l,r),class:"barBackground"}),i("rect",{key:"progress bar",x:o,width:a,y:e+u,height:u,ry:h,rx:h,fill:this.getProcessColor(l,r)}))}return i("g",{onMouseDown:t=>{f&&this.handleBarEventStart("move",p,t)}},i("rect",{x:t,width:s,y:e,height:n,ry:h,rx:h,fill:this.getBarColor(l,r),class:"barBackground"}),i("rect",{x:o,width:a,y:e,height:n,ry:h,rx:h,fill:this.getProcessColor(l,r)}))}renderKupBarDateHandle(t,e,s,n,o,a,h){return i("rect",{x:t,y:e,width:s,height:n,class:"barHandle",ry:o,rx:o,onMouseDown:t=>this.handleBarEventStart(h,a,t)})}renderKupBarSmall(t,e,s,n){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"},n&&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,n]=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:n}))}drownPathAndTriangle(t,i,e,s,n){const o=i.y+s/2,a=t.x2+2*n;return[`M ${t.x2} ${t.y+s/2}\n h ${n}\n v ${(t.index>i.index?-1:1)*e/2}\n ${a<i.x1?"":"H "+(i.x1-n)}\n V ${o}\n h ${a>i.x1?n:i.x1-t.x2-n}`,`${i.x1},${o}\n ${i.x1-5},${o-5}\n ${i.x1-5},${o+5}`]}drownPathAndTriangleRTL(t,i,e,s,n){const o=i.y+s/2,a=t.x1-2*n;return[`M ${t.x1} ${t.y+s/2}\n h ${-n}\n v ${(t.index>i.index?-1:1)*e/2}\n ${a>i.x2?"":`H ${i.x2+n}`}\n V ${o}\n h ${a<i.x2?-n:i.x2-t.x1+n}`,`${i.x2},${o}\n ${i.x2+5},${o+5}\n ${i.x2+5},${o-5}`]}getBarColor(t,i){return t?i.backgroundSelectedColor:i.backgroundColor}getProcessColor(t,i){return t?i.progressSelectedColor:i.progressColor}calculateProgressPoint(t,i="bar"){return l("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 n of this.tasks)e.push(i("rect",{key:"Row"+n.id,x:0,y:t,width:this.gridProps.svgWidth,height:this.rowHeight,class:"gridRow"})),s.push(i("line",{key:"RowLine"+n.id,x1:0,y1:t+this.rowHeight,x2:this.gridProps.svgWidth,y2:t+this.rowHeight,class:"gridRowLine"})),t+=this.rowHeight;const n=new Date;let o=0;const a=[];for(let e=0;e<this.dates.length;e++){const s=this.dates[e];a.push(i("line",{key:s.getTime(),x1:o,y1:0,x2:o,y2:t,class:"gridTick"})),e+1!==this.dates.length&&s.getTime()<n.getTime()&&this.dates[e+1].getTime()>=n.getTime()||0!==e&&e+1===this.dates.length&&s.getTime()<n.getTime()&&(h(s,s.getTime()-this.dates[e-1].getTime(),"millisecond").getTime(),n.getTime()),o+=this.columnWidth}return i("svg",{key:"520a50739aa00f72aeb4e43ba03a3b5f126e289a",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:"2681f573ab6f0c7ae9c9f316b77a05c9a634e100",class:"grid"},i("g",{key:"085ea28cdbb6ee28354cd255c0f1b00a56c5588f",class:"rows"},e),i("g",{key:"cb02f6b77af725f514f4eaf63624ff4ace5cf9e2",class:"rowLines"},s),i("g",{key:"bed7254aeb03e0fbd1ab3e9d40c14f84b346bffc",class:"ticks"},a)),i("g",{key:"b22b4e0c75d7cef3336a8e069b243d6296200272",class:"content"},this.currentDateIndicator&&i("rect",{fill:this.currentDateIndicator.color,x:this.currentDateIndicator.x+1.5,y:"0",width:"2",height:"100%"}),this.projection&&i("rect",{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:"594dd1e9af2f037f0599019a3082a58115907d3b",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:"9d41cb46ff1373cf3a34fcebf7f9bc02ab961a8b",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,n=i.isSelected?s.backgroundSelectedColor:s.backgroundColor,o=!(this.readOnly||!this.dateChange||t.isDisabled||e),a=!this.readOnly&&!!this.progressChange&&!t.isDisabled,h=!this.readOnly&&!!this.dateChange&&!t.isDisabled;switch(t.typeInternal){case"project":default:return this.renderKupBar(t,i.isSelected,o,a);case"smalltask":return this.renderKupBarSmall(t,i.isSelected,h,a);case"timeline":return this.renderKupBarTimeLine(t,n)}})())})))))}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"]}}};k.style=".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}.gridRow{fill:#fff}.gridRowLine{stroke:transparent}.gridTick{stroke:#e6e4e4}.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:#fff;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:#555;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}";export{p as kup_custom_task_list_header,c as kup_custom_task_list_table,d as kup_gantt_calendar,k as kup_grid_renderer}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,c as t,f as e,h as a,H as s,d as n}from"./p-47040db6.js";import{k as r,g as o,s as l,l as p,M as h,e as f}from"./p-8229b97a.js";import{c}from"./p-635bb4b3.js";import{F as m}from"./p-c0f660d6.js";import{F as g}from"./p-2d4a9235.js";import{F as u}from"./p-c634eb82.js";import{F as d}from"./p-a46f99d4.js";import{M as _}from"./p-d4a879fc.js";import"./p-eb8ea3a6.js";import"./p-e2bf2bb6.js";import"./p-6c888179.js";import"./p-61e8d573.js";var k;!function(i){i.columns="Can set a specific number of columns",i.customStyle="Custom style of the component.",i.data="Actual data of the component",i.ripple="When enabled displays Material's ripple effect on clicked items.",i.rows="Cam set a specific number of rows. It overwrite the columns flow into rows flow"}(k||(k={}));class b{constructor(){this.load=!1}toDebugString(){return"image-list state"}}var v,w,y,x,j,z,C,M,W,E,O,T,P,D,F,S=function(i,t,e,a){if("a"===e&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?i!==t||!a:!t.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?a:"a"===e?a.call(i):a?a.value:t.get(i)},I=function(i,t,e,a,s){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?i!==t||!s:!t.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?s.call(i,e):s?s.value=e:t.set(i,e),e};const N=class{constructor(e){i(this,e),this.kupClick=t(this,"kup-imagelist-click",6),this.kupContextMenu=t(this,"kup-imagelist-contextmenu",6),this.kupDblClick=t(this,"kup-imagelist-dblclick",6),v.add(this),this.state=new b,w.set(this,[]),y.set(this,r()),x.set(this,{icon:"arrow_back",onClick:()=>{this.currentNode=S(this,y,"f").data.node.getParent(this.data,this.currentNode),this.currentNode||(this.navigationBarToggled=!1)},styling:u.FLAT,wrapperClass:"navigation-bar__back"}),j.set(this,{icon:"arrow_upward",onClick:()=>{this.currentNode=null,this.navigationBarToggled=!1},styling:u.FLAT,wrapperClass:"navigation-bar__top"}),z.set(this,void 0),C.set(this,!1),M.set(this,[]),this.currentNode=null,this.navigationBarToggled=!1,this.columns=4,this.customStyle="",this.data=[],this.ripple=!0,this.rows=null,this.selectedNode=[],this.stateId="",this.store=void 0}initWithPersistedState(){if(this.store&&this.stateId){const i=this.store.getState(this.stateId);null!=i&&(this.currentNode=S(this,y,"f").data.node.findByStrTreeNodePath(this.data,i.selectedTreeNodePath))}}persistState(){if(this.store&&this.stateId){let i=!1,t=this.currentNode?this.currentNode.id:"";if(S(this,y,"f").objects.deepEqual(this.state.selectedTreeNodePath,t)||(this.state.selectedTreeNodePath=t,i=!0),!this.state.load)return void(this.state.load=!0);i&&this.store.persistState(this.stateId,this.state)}}selectNode(i){i&&0!=i.length&&(this.currentNode=S(this,y,"f").data.node.find(this.data,i))}async getProps(i){return o(this,k,i)}async refresh(){e(this)}async setProps(i){l(this,k,i)}componentWillLoad(){S(this,y,"f").debug.logLoad(this,!1),S(this,y,"f").language.register(this),S(this,y,"f").theme.register(this)}componentDidLoad(){S(this,v,"m",F).call(this),S(this,y,"f").debug.logLoad(this,!0)}componentWillRender(){S(this,y,"f").debug.logRender(this,!1)}componentDidRender(){const i=this.rootElement.shadowRoot;if(i&&this.ripple){const t=i.querySelectorAll(".mdc-ripple-surface:not(.mdc-ripple-upgraded)");if(t)for(let i=0;i<t.length;i++)_.attachTo(t[i])}this.persistState(),S(this,y,"f").debug.logRender(this,!0)}render(){const i=!!this.currentNode;let t=Object.assign({},{"grid-template-columns":`repeat(${this.columns}, minmax(0px, 1fr))`});if(null!=this.rows&&this.rows>0){const i={"grid-template-rows":`repeat(${this.rows}, minmax(0px, 1fr))`,"grid-auto-flow":"column"};t=Object.assign(Object.assign({},t),i)}return a(s,{key:"86c391c4a1e0c507dc0c07971aa90e6f7091bc95"},a("style",{key:"99f966c6cd10aac991c99b4badca0a6cff1dbf5b"},S(this,y,"f").theme.setKupStyle(this.rootElement)),a("div",{key:"e4eaa257a47cabcb34a412f56d736cd77fbc97af",id:c,ref:i=>{I(this,z,i,"f")}},a("div",{key:"48ff34cbb307b0ab49ca3b8ed240f0510e674e93",class:"navigation-bar"},i?a("div",{class:"navigation-bar__wrapper "+(this.navigationBarToggled?"navigation-bar__wrapper--active":"")},a("div",{class:"navigation-bar__title",onClick:()=>{this.navigationBarToggled=!this.navigationBarToggled}},a(m,{fit:!0,resource:this.currentNode.icon,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"navigation-bar__title__image"}),a("div",{class:"navigation-bar__title__label"},this.currentNode.value)),a(g,Object.assign({},S(this,x,"f"),{label:S(this,y,"f").language.translate(p.BACK)})),a(g,Object.assign({},S(this,j,"f"),{label:S(this,y,"f").language.translate(p.TOP)}))):null),a("div",{key:"97ac20f9d893c131c03adc953e78435bb062f137",class:"image-list",style:t},...S(this,v,"m",E).call(this))))}disconnectedCallback(){S(this,y,"f").interact.unregister(S(this,M,"f")),S(this,y,"f").language.unregister(this),S(this,y,"f").theme.unregister(this)}get rootElement(){return n(this)}static get watchers(){return{selectedNode:["selectNode"]}}};w=new WeakMap,y=new WeakMap,x=new WeakMap,j=new WeakMap,z=new WeakMap,C=new WeakMap,M=new WeakMap,v=new WeakSet,W=function(i){const t=a(m,Object.assign({},{fit:!0,resource:i.icon,title:i.title,wrapperClass:"image-list__image",badgeData:i.badgeData})),e=a("div",{class:"image-list__label"},i.value);return a(d,{cell:{value:i.value,icon:i.icon,obj:i.obj},column:{name:"IMAGE",title:"Image"},component:this,density:f.NONE,row:Object.assign({},i)},a("div",{class:"image-list__wrapper"},t,e))},E=function(){const i=[],t=this.currentNode?this.currentNode.children:this.data;for(let e=0;t&&e<t.length;e++){const s=t[e],n=a("div",{onContextMenu:i=>{i.preventDefault()},class:{"image-list__item":!0,"mdc-ripple-surface":!!this.ripple}},S(this,v,"m",W).call(this,s));i.push(n)}return i},O=function(i,t){let e;if(i)for(let t=i.length-1;t>=0;t--){let a=i[t];a.tagName&&a.classList.contains("f-cell")&&(e=a["kup-get-cell-props"]())}return{cell:null==e?void 0:e.cell,column:null==e?void 0:e.column,originalEvent:t,row:null==e?void 0:e.row}},T=function(i){return S(this,v,"m",O).call(this,S(this,y,"f").getEventPath(i.target,this.rootElement),i)},P=function(i){return S(this,v,"m",O).call(this,S(this,y,"f").getEventPath(i.target,this.rootElement),i)},D=function(i){return S(this,v,"m",O).call(this,S(this,y,"f").getEventPath(i.target,this.rootElement),i)},F=function(){S(this,M,"f").push(S(this,z,"f"));const i=i=>{"pen"!==i.pointerType&&"touch"!==i.pointerType||I(this,C,!0,"f")};S(this,y,"f").interact.on(S(this,z,"f"),h.HOLD,i),S(this,y,"f").interact.on(S(this,z,"f"),h.TAP,(i=>{if(S(this,C,"f"))I(this,C,!1,"f");else switch(i.button){case 0:const t={};for(const e in i)t[e]=i[e];S(this,w,"f").push(setTimeout((()=>{const i=S(this,v,"m",T).call(this,t),e=i.row;e.children&&e.children.length>0&&(this.currentNode=e),this.kupClick.emit({comp:this,id:this.rootElement.id,details:i})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:S(this,v,"m",P).call(this,i)})}})),S(this,y,"f").interact.on(S(this,z,"f"),h.DOUBLETAP,(i=>{if(0===i.button){for(let i=0;i<S(this,w,"f").length;i++)clearTimeout(S(this,w,"f")[i]),S(this,y,"f").debug.logMessage(this,"Cleared clickHandler timeout("+S(this,w,"f")[i]+").");I(this,w,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:S(this,v,"m",D).call(this,i)})}})),S(this,y,"f").interact.on(S(this,z,"f"),h.HOLD,i)},N.style=".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}:host{--kup_imagelist_background_color:var(\n --kup-imagelist-background-color,\n transparent\n );--kup_imagelist_columns:var(--kup-imagelist-columns, 4);--kup_imagelist_grid_gap:var(--kup-imagelist-grid-gap, 0.5em);--kup_imagelist_image_min_height:var(\n --kup-imagelist-image-min-height,\n var(--kup-space-09)\n );--kup_imagelist_item_border_radius:var(\n --kup-imagelist-item-border-radius,\n var(--kup-radius-00)\n );--kup_imagelist_item_height:var(--kup-imagelist-item-height, auto);--kup_imagelist_item_padding:var(--kup-imagelist-item-padding, 0);--kup_imagelist_item_width:var(--kup-imagelist-item-width, auto);--kup_imagelist_label_margin:var(\n --kup-imagelist-label-margin,\n 0 auto 1em auto\n );--kup_imagelist_navbar_background_color:var(\n --kup-imagelist-navbar-background-color,\n transparent\n );--kup_imagelist_primary_color:var(\n --kup-imagelist-primary-color,\n var(--kup-primary-color)\n );--kup_imagelist_primary_color_rgb:var(\n --kup-imagelist-primary-color-rgb,\n var(--kup-primary-color-rgb)\n );--kup_imagelist_text_color:var(\n --kup-imagelist-text-color,\n var(--kup-gray-color-70)\n );--kup_imagelist_item_background_color:var(\n --kup-imagelist-item-background-color,\n var(--kup-gray-color-10)\n );display:block}.navigation-bar{align-items:center;background-color:var(--kup_imagelist_navbar_background_color);display:flex;justify-content:center}.navigation-bar__wrapper{align-items:center;display:flex;flex-wrap:wrap;justify-content:center;max-width:100%;position:relative}.navigation-bar__wrapper--active .navigation-bar__title{background-color:rgba(var(--kup_imagelist_primary_color_rgb), 0.15);color:var(--kup_imagelist_primary_color)}.navigation-bar__back,.navigation-bar__top{--kup-button-primary-color-rgb:0}.navigation-bar__title{border-radius:16px;box-sizing:border-box;cursor:pointer;display:flex;justify-content:center;padding:0.75em 1em;user-select:none;transition:background-color 125ms, color 125ms;width:100%}.navigation-bar__title__image.f-image{margin:0}.navigation-bar__title__label{overflow:hidden;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap;font-family:var(--kup-font-family);font-size:14px;line-height:18px;font-weight:400;letter-spacing:0.16px}.image-list{background-color:var(--kup_imagelist_background_color);display:grid;grid-gap:var(--kup_imagelist_grid_gap);grid-template-columns:repeat(var(--kup_imagelist_columns, 4), minmax(0px, 1fr));margin-top:1em;width:100%;grid-auto-flow:row}.image-list .f-cell{height:100%;width:100%}.image-list .f-cell .f-cell__content .image-list__wrapper{padding:var(--kup-space-03) var(--kup-space-02)}.image-list__item{background-color:var(--kup_imagelist_item_background_color);border-radius:var(--kup_imagelist_item_border_radius);cursor:pointer;height:var(--kup_imagelist_item_height);padding:var(--kup_imagelist_item_padding);width:var(--kup_imagelist_item_width)}.image-list__item:hover{background-color:var(--kup-gray-color-20)}.image-list__image.f-image{margin-bottom:var(--kup-space-03)}.image-list__image.f-image .f-image__icon{min-height:var(--kup_imagelist_image_min_height)}.image-list__label{overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap;font-family:var(--kup-font-family);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}:host(.kup-full-height){height:100%}:host(.kup-full-width){width:100%}:host(.kup-horizontal) .image-list{display:flex}:host(.kup-auto-grid) .image-list{display:flex;flex-wrap:wrap;justify-content:center}";export{N as kup_image_list}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as t,r as i,d as s}from"./p-47040db6.js";import{c as e,a as h,g as l,m as a,b as n,d as o,e as d}from"./p-e4c63684.js";import{e as r,f as c}from"./p-924b841b.js";import{b as v}from"./p-eb8ea3a6.js";import{g as u}from"./p-e841c2ae.js";const D=()=>()=>t("div",null),p=class{constructor(t){i(this,t),this.locale="it-IT",this.props=void 0,this.timeUnit=void 0,this.currentTasks=[],this.currentDetails=[],this.scrollX=-1,this.mainGanttDoubleView=!1,this.displayedDates={displayedStartDate:new Date,displayedEndDate:new Date},this.viewDate=void 0,this.projection=void 0,this.tasks=[],this.details=[]}mainGanttChangeHandler(){var t;this.currentTasks=this.props.mainGantt.items,this.currentDetails=null===(t=this.props.secondaryGantt)||void 0===t?void 0:t.items,this.projection=void 0,this.updateTasks()}updateDisplayedDates(){const t=e(this.currentTasks,this.timeUnit,this.mainGanttDoubleView,this.currentDetails,this.props.preStepsCount);if(!this.viewDate){const i=new Date;this.viewDate=t.displayedStartDate<=i&&t.displayedEndDate>=i?i:t.displayedStartDate}}updateTasks(){var t,i;const s=new v;this.tasks=[];for(let i=0;i<(null===(t=this.currentTasks)||void 0===t?void 0:t.length);i++)this.tasks.push(...h(this.currentTasks[i],s.formatToIsoDate(this.displayedDates.displayedStartDate),s.formatToIsoDate(this.displayedDates.displayedEndDate)));this.details=[];for(let t=0;t<(null===(i=this.currentDetails)||void 0===i?void 0:i.length);t++)this.details.push(...h(this.currentDetails[t],s.formatToIsoDate(this.displayedDates.displayedStartDate),s.formatToIsoDate(this.displayedDates.displayedEndDate)))}componentWillLoad(){var t,i,s,h,l,a,n,o,d,r;this.timeUnit=null===(t=this.props)||void 0===t?void 0:t.viewMode,this.currentTasks=(null===(i=this.props)||void 0===i?void 0:i.mainGantt.items)||[],this.currentDetails=null===(h=null===(s=this.props)||void 0===s?void 0:s.secondaryGantt)||void 0===h?void 0:h.items,this.scrollX=(null===(a=null===(l=this.props)||void 0===l?void 0:l.mainGantt)||void 0===a?void 0:a.initialScrollX)||-1,this.mainGanttDoubleView=null!==(d=null===(o=null===(n=this.props)||void 0===n?void 0:n.mainGantt)||void 0===o?void 0:o.showSecondaryDates)&&void 0!==d&&d,this.displayedDates=e(this.currentTasks,this.timeUnit,this.mainGanttDoubleView,this.currentDetails,null===(r=this.props)||void 0===r?void 0:r.preStepsCount),this.viewDate=void 0,this.projection=void 0,this.updateTasks()}async refresh(){var t;this.displayedDates=e(this.currentTasks,this.timeUnit,this.mainGanttDoubleView,this.currentDetails,null===(t=this.props)||void 0===t?void 0:t.preStepsCount)}handleClick(t,i){if(t){if("task"===t.type&&this.props.secondaryGantt){const i=t;this.projection={start:new Date(i.startDate),end:new Date(i.endDate),color:i.color||"#ED7D31"}}else this.projection=void 0;null==i||i(t)}}handleDblClick(t,i){t&&(null==i||i(t))}handleContextMenu(t,i,s){if(i){if("task"===i.type&&this.props.secondaryGantt){const t=i;this.projection={start:new Date(t.startDate),end:new Date(t.endDate),color:t.color||"#ED7D31"}}else this.projection=void 0;null==s||s(t,i)}}handleSetDoubleView(t){var i,s;this.mainGanttDoubleView=t,null===(s=null===(i=this.props)||void 0===i?void 0:i.onSetDoubleView)||void 0===s||s.call(i,t)}handleDateChange(t,i,s){var e;const h=null==t?void 0:t.id;if(!h)return;let d=n(h,i);if(d||(d=l(h,i)),d)if("timeline"!==d.type){if("project"===d.type){const s=a(i,t);d=n(d.id,s),this.viewDate=t.start,this.currentTasks=s}else if("task"===d.type){const s=i.find((t=>{var i;return null===(i=t.phases)||void 0===i?void 0:i.some((t=>(null==t?void 0:t.id)===h))}));if(s){const h=o(s.phases,t),a=i.map((t=>t.id===s.id?Object.assign(Object.assign({},t),{phases:h}):t));d=l(d.id,a),this.props.secondaryGantt&&d&&(this.projection={start:new Date(d.startDate),end:new Date(d.endDate),color:null!==(e=d.color)&&void 0!==e?e:"#ED7D31"}),this.viewDate=t.start,this.currentTasks=a}}null==s||s(d),setTimeout(this.getScrollX,500)}else console.log("onDateChange for timeline not managed yet",h,d.type)}getScrollX(){var t,i,s;if(this.rootElement){const e=null===(t=this.rootElement.querySelector('[data-scrollx="true"]'))||void 0===t?void 0:t.scrollLeft;void 0!==e&&(null===(s=(i=this.props).onScrollX)||void 0===s||s.call(i,e))}}render(){var i,s,e;return t("div",{key:"e633ff68b8b848cd29b1fb4a44f4561ef9dfc65f",class:"planner-render"},t("kup-switcher",{key:"e8982db1704160c67839e156521f8cadbd9d182a",timeUnitChange:t=>{var i,s;null===(s=(i=this.props).onSetViewMode)||void 0===s||s.call(i,t),this.timeUnit=t,this.viewDate=void 0,this.scrollX=-1}}),this.props&&t("div",{style:{display:"flex",flexDirection:"column"}},t("kup-gantt",Object.assign({ref:t=>this.mainGantt=t,ganttId:r,key:r,filter:this.props.mainGantt.filter,hideLabel:this.props.mainGantt.hideLabel,showSecondaryDates:this.mainGanttDoubleView,hideDependencies:this.props.mainGantt.hideDependencies,ganttHeight:this.props.mainGantt.ganttHeight,displayedStartDate:this.displayedDates.displayedStartDate,displayedEndDate:this.displayedDates.displayedEndDate,viewDate:this.viewDate,tasks:this.tasks,columnWidth:d(this.timeUnit),viewMode:this.timeUnit},this.props.mainGantt.stylingOptions,{TaskListHeader:this.props.mainGantt.taskListHeaderProject,TaskListTable:this.props.mainGantt.taskListTableProject,TooltipContent:null!==(i=this.props.mainGantt.tooltipContent)&&void 0!==i?i:D(),barClick:t=>{let i=n(t.id,this.currentTasks);i||(i=l(t.id,this.currentTasks)),i&&this.handleClick(i,this.props.mainGantt.onClick)},barDblClick:t=>{let i=n(t.id,this.currentTasks);i||(i=l(t.id,this.currentTasks)),i&&this.handleDblClick(i,this.props.mainGantt.onDblClick)},barContextMenu:(t,i)=>{let s=n(i.id,this.currentTasks);s||(s=l(i.id,this.currentTasks)),s&&this.handleContextMenu(t,s,this.props.mainGantt.onContextMenu)},dateChange:t=>this.handleDateChange(t,this.currentTasks,this.props.mainGantt.onDateChange),locale:this.locale,dateTimeFormatters:u,initialScrollX:this.scrollX,initialScrollY:this.props.mainGantt.initialScrollY,readOnly:this.props.mainGantt.readOnly,scrollXChange:this.props.onScrollX,scrollYChange:this.props.mainGantt.onScrollY,currentTasks:this.currentTasks,handleClick:this.handleClick.bind(this),handleDblClick:this.handleDblClick.bind(this),handleContextMenu:this.handleContextMenu.bind(this),ganttOnClick:this.props.mainGantt.onClick,ganttOnDblClick:this.props.mainGantt.onDblClick,ganttonOnContextMenu:this.props.mainGantt.onContextMenu,label:this.props.mainGantt.title,doubleView:null!==(s=this.mainGanttDoubleView)&&void 0!==s&&s,setDoubleView:this.handleSetDoubleView.bind(this)})),this.props.secondaryGantt&&t("kup-gantt",Object.assign({ref:t=>this.secondaryGantt=t,ganttId:c,key:c,filter:this.props.secondaryGantt.filter,hideLabel:this.props.secondaryGantt.hideLabel,showSecondaryDates:this.mainGanttDoubleView,hideDependencies:this.props.secondaryGantt.hideDependencies,ganttHeight:this.props.secondaryGantt.ganttHeight,displayedStartDate:this.displayedDates.displayedStartDate,displayedEndDate:this.displayedDates.displayedEndDate,viewDate:this.viewDate,tasks:this.details,columnWidth:d(this.timeUnit),viewMode:this.timeUnit},this.props.secondaryGantt.stylingOptions,{TaskListHeader:this.props.secondaryGantt.taskListHeaderProject,TaskListTable:this.props.secondaryGantt.taskListTableProject,TooltipContent:null!==(e=this.props.secondaryGantt.tooltipContent)&&void 0!==e?e:D(),projection:this.projection,barClick:t=>{if(this.props.secondaryGantt){let i=n(t.id,this.currentDetails);i&&this.handleClick(i,this.props.secondaryGantt.onClick)}},barDblClick:t=>{if(this.props.secondaryGantt){let i=n(t.id,this.currentDetails);i&&this.handleDblClick(i,this.props.secondaryGantt.onDblClick)}},barContextMenu:(t,i)=>{if(this.props.secondaryGantt){let s=n(i.id,this.currentDetails);s&&this.handleContextMenu(t,s,this.props.secondaryGantt.onContextMenu)}},dateChange:t=>this.handleDateChange(t,this.currentTasks,this.props.secondaryGantt.onDateChange),locale:this.locale,dateTimeFormatters:u,initialScrollX:this.scrollX,initialScrollY:this.props.secondaryGantt.initialScrollY,readOnly:this.props.secondaryGantt.readOnly,scrollXChange:this.props.onScrollX,scrollYChange:this.props.secondaryGantt.onScrollY,currentTasks:this.currentTasks,handleClick:this.handleClick.bind(this),handleDblClick:this.handleDblClick.bind(this),handleContextMenu:this.handleContextMenu.bind(this),ganttOnClick:this.props.secondaryGantt.onClick,ganttOnDblClick:this.props.secondaryGantt.onDblClick,ganttonOnContextMenu:this.props.secondaryGantt.onContextMenu,label:this.props.secondaryGantt.title}))))}get rootElement(){return s(this)}static get watchers(){return{props:["mainGanttChangeHandler"],timeUnit:["updateDisplayedDates"],mainGanttDoubleView:["updateDisplayedDates"],"props.preStepsCount":["updateDisplayedDates"],viewDate:["updateDisplayedDates"],currentTasks:["updateTasks"],currentDetails:["updateTasks"]}}};export{p as kup_planner_renderer}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){return void 0!==e.key}function r(e){const r=e.filter((e=>e.hideChildren&&"project"===e.type));if(r.length>0)for(let n=0;r.length>n;n++){const o=t(e,r[n]);e=e.filter((e=>-1===o.indexOf(e)))}return e}function t(e,r){let n=[];n=e.filter("project"!==r.type?e=>e.dependencies&&-1!==e.dependencies.indexOf(r.id):e=>e.project&&e.project===r.id);var o=[];return n.forEach((r=>{o.push(...t(e,r))})),n=n.concat(n,o),n}const n=(e,r)=>{const t=e.displayOrder||Number.MAX_VALUE,n=r.displayOrder||Number.MAX_VALUE;return t>n?1:t<n?-1:0},o=(e,r,t,n,o,a,l,c,d,i,u,b,h,g,p,x,v,C,f)=>{let k=e.map(((e,k)=>s(e,k,r,t,n,o,a,l,c,d,i,u,b,h,g,p,x,v,C,f)));return k=k.map((e=>{const r=e.dependencies||[];for(let t=0;t<r.length;t++){const n=k.findIndex((e=>e.id===r[t]));-1!==n&&k[n].barChildren.push(e)}return e})),k},s=(e,r,t,n,o,s,a,c,i,u,b,h,g,p,x,v,C,f,k,y)=>{let j;switch(e.type){case"timeline":j=d(e,r,t,n,o,c,i,u);break;case"project":j=l(e,r,t,n,o,a,i,u,b,v,C,f,k,y);break;default:j=l(e,r,t,n,o,s,i,u,b,h,g,p,x,y)}return j};function a(e,r,t,n,o,s,a){let l,c;a?(c=u(e,n,o),l=u(r,n,o)):(l=i(e,n,o),c=i(r,n,o));let d=t;return"task"===d&&c-l<2*s&&(d="smalltask",c=l+2*s),{x1:l,x2:c,typeInternal:d}}const l=(e,r,t,n,o,s,l,c,d,i,u,g,p,x)=>{const{x1:v,x2:C,typeInternal:f}=a(e.start,e.end,e.type,t,n,c,d),{x1:k,x2:y}=x&&e.secondaryStart&&e.secondaryEnd?a(e.secondaryStart,e.secondaryEnd,e.type,t,n,c,d):{x1:void 0,x2:void 0},[j,m]=h(v,C,e.progress,d),S=b(r,o,s),w="project"===e.type?e.hideChildren:void 0,O=Object.assign({backgroundColor:g,backgroundSelectedColor:p,progressColor:i,progressSelectedColor:u},e.styles);return Object.assign(Object.assign({},e),{typeInternal:f,x1:v,x2:C,x1secondary:k,x2secondary:y,y:S,index:r,progressX:m,progressWidth:j,barCornerRadius:l,handleWidth:c,hideChildren:w,height:s,barChildren:[],styles:O})},c=e=>{var r,t,n,o;return{backgroundColor:null!==(r=null==e?void 0:e.backgroundColor)&&void 0!==r?r:"#deadbeef",backgroundSelectedColor:null!==(t=null==e?void 0:e.backgroundSelectedColor)&&void 0!==t?t:"#cafebabe",progressColor:null!==(n=null==e?void 0:e.progressColor)&&void 0!==n?n:"#deadbeef",progressSelectedColor:null!==(o=null==e?void 0:e.progressSelectedColor)&&void 0!==o?o:"#cafebabe"}},d=(e,r,t,n,o,s,l,d)=>{var i;const u=b(r,o,s),{x1:h,x2:g}=a(e.start,e.end,e.type,t,n,d,!1),p=null===(i=e.timeline)||void 0===i?void 0:i.map((function(r,o){var l,c;const{x1:i,x2:b}=a(r.start,r.end,"task",t,n,d,!1),h=r.backgroundColor,g=null!==(l=r.backgroundSelectedColor)&&void 0!==l?l:h;return{barChildren:[],barCornerRadius:0,start:r.start,end:r.end,handleWidth:0,height:s,id:`Frame-${e.id}-${o}`,index:+r.start,name:"",valuesToShow:e.valuesToShow,progress:0,progressWidth:0,progressX:0,styles:{backgroundColor:h,backgroundSelectedColor:g,progressColor:h,progressSelectedColor:g},timeline:[],type:"task",typeInternal:"timeline",x1:i,x2:b,y:u,icon:null!==(c=r.icon)&&void 0!==c?c:void 0}}));return Object.assign(Object.assign({},e),{x1:h,x2:g,y:u,index:r,progressX:0,progressWidth:0,barCornerRadius:l,handleWidth:d,typeInternal:e.type,progress:0,height:s,hideChildren:void 0,barChildren:null!=p?p:[],styles:c(e.styles)})},i=(e,r,t)=>{const n=r.findIndex((r=>r.getTime()>=e.getTime()))-1;return n<0?0:n*t+(e.getTime()-r[n].getTime())/(r[n+1].getTime()-r[n].getTime())*t},u=(e,r,t)=>{let n=i(e,r,t);return n+=t,n},b=(e,r,t)=>e*r+(r-t)/2,h=(e,r,t,n)=>{const o=(r-e)*t*.01;let s;return s=n?r-o:e,[o,s]},g=(e,r,t)=>[e-5,r+t,e+5,r+t,e,r+t-8.66].join(","),p=(e,r,t,n,o)=>{let s=new Date((e-r)/n*o+t.getTime());return s=new Date(s.getTime()+6e4*(s.getTimezoneOffset()-t.getTimezoneOffset())),s},x=(e,r,t,n,o,s,a)=>v(e,r,t,n,o,s,a),v=(e,r,t,n,o,s,a)=>{const l=Object.assign({},t);let c=!1;switch(r){case"progress":if(l.progress=a?(d=e)>=(i=t).x2?0:d<=i.x1?100:Math.round(100*(i.x2-d)/(i.x2-i.x1)):((e,r)=>e>=r.x2?100:e<=r.x1?0:Math.round(100*(e-r.x1)/(r.x2-r.x1)))(e,t),c=l.progress!==t.progress,c){const[e,r]=h(l.x1,l.x2,l.progress,a);l.progressWidth=e,l.progressX=r}break;case"start":{const r=((e,r,t)=>{e>=t.x2-2*t.handleWidth&&(e=t.x2-2*t.handleWidth);const n=Math.round((e-t.x1)/r);return t.x1+n*r})(e,n,t);if(l.x1=r,c=l.x1!==t.x1,c){a?l.end=p(r,t.x1,t.end,n,o):l.start=p(r,t.x1,t.start,n,o);const[e,s]=h(l.x1,l.x2,l.progress,a);l.progressWidth=e,l.progressX=s}break}case"end":{const r=((e,r,t)=>{e<=t.x1+2*t.handleWidth&&(e=t.x1+2*t.handleWidth);const n=Math.round((e-t.x2)/r);return t.x2+n*r})(e,n,t);if(l.x2=r,c=l.x2!==t.x2,c){a?l.start=p(r,t.x2,t.start,n,o):l.end=p(r,t.x2,t.end,n,o);const[e,s]=h(l.x1,l.x2,l.progress,a);l.progressWidth=e,l.progressX=s}break}case"move":{const[r,d]=((e,r,t)=>{const n=Math.round((e-t.x1)/r),o=t.x1+n*r;return[o,o+t.x2-t.x1]})(e-s,n,t);if(c=r!==t.x1,c){l.start=p(r,t.x1,t.start,n,o),l.end=p(d,t.x2,t.end,n,o),l.x1=r,l.x2=d;const[e,s]=h(l.x1,l.x2,l.progress,a);l.progressWidth=e,l.progressX=s}break}}var d,i;return{isChanged:c,changedTask:l}};function C(e,r){return i(new Date,e,r)}function f(e,r,t,n){return{x0:i(e,t,n),xf:i(r,t,n)}}export{C as a,f as b,o as c,g,x as h,e as i,r,n as s}
|