@sme.up/ketchup 9.6.3 → 9.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{bar.helpers-f46a5a83.js → bar.helpers-c481a535.js} +45 -13
- package/dist/cjs/{f-button-9a0eba42.js → f-button-23ec3db5.js} +1 -1
- package/dist/cjs/{f-cell-1ad41071.js → f-cell-bcc51c0f.js} +9 -29
- package/dist/cjs/{f-chip-48851b4f.js → f-chip-63363ecf.js} +2 -2
- package/dist/cjs/{f-image-541e5f4d.js → f-image-f3944c01.js} +2 -5
- package/dist/cjs/{f-paginator-utils-8ff2a9b4.js → f-paginator-utils-60e05759.js} +3 -3
- package/dist/cjs/{f-text-field-ac5d6497.js → f-text-field-354b6c78.js} +1 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/ketchup.cjs.js +1 -1
- package/dist/cjs/kup-accordion.cjs.entry.js +3 -3
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +48 -48
- package/dist/cjs/kup-box.cjs.entry.js +8 -8
- package/dist/cjs/kup-calendar.cjs.entry.js +5 -5
- package/dist/cjs/kup-card-list.cjs.entry.js +2 -2
- package/dist/cjs/kup-cell.cjs.entry.js +7 -7
- package/dist/cjs/kup-custom-task-list-header_4.cjs.entry.js +256 -40
- package/dist/cjs/kup-dashboard.cjs.entry.js +5 -5
- package/dist/cjs/{kup-dates-b7d53b4d.js → kup-dates-e22ee32c.js} +21 -0
- package/dist/cjs/kup-drawer.cjs.entry.js +2 -2
- package/dist/cjs/kup-echart.cjs.entry.js +2 -2
- package/dist/cjs/kup-editor.cjs.entry.js +2 -2
- package/dist/cjs/kup-family-tree.cjs.entry.js +4 -4
- package/dist/cjs/kup-gantt_10.cjs.entry.js +105 -39
- package/dist/cjs/kup-grid.cjs.entry.js +2 -2
- package/dist/cjs/kup-iframe.cjs.entry.js +2 -2
- package/dist/cjs/kup-image-list.cjs.entry.js +21 -14
- package/dist/cjs/kup-input-panel.cjs.entry.js +444 -0
- package/dist/cjs/kup-lazy.cjs.entry.js +13 -13
- package/dist/cjs/kup-magic-box.cjs.entry.js +6 -6
- package/dist/cjs/{kup-manager-26a9154b.js → kup-manager-e1bfd4f8.js} +656 -121
- package/dist/cjs/kup-nav-bar.cjs.entry.js +3 -3
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +4 -4
- package/dist/cjs/kup-pdf.cjs.entry.js +76600 -0
- package/dist/cjs/kup-photo-frame.cjs.entry.js +4 -4
- package/dist/cjs/{kup-planner-declarations-d3dec885.js → kup-planner-declarations-cb33663d.js} +3 -0
- package/dist/cjs/{kup-planner-renderer-helper-680bbd5a.js → kup-planner-renderer-helper-f001fad7.js} +56 -8
- package/dist/cjs/kup-planner-renderer.cjs.entry.js +44 -11
- package/dist/cjs/{kup-planner-time-formatter-a74e70f0.js → kup-planner-time-formatter-b7dca3ea.js} +3 -0
- package/dist/cjs/kup-planner.cjs.entry.js +81 -9
- package/dist/cjs/kup-probe.cjs.entry.js +3 -3
- package/dist/cjs/kup-qlik.cjs.entry.js +3 -3
- package/dist/cjs/kup-snackbar.cjs.entry.js +5 -5
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/image-list.js +332 -2
- package/dist/collection/assets/index.js +8 -0
- package/dist/collection/assets/input-panel.js +480 -0
- package/dist/collection/assets/pdf.js +15 -0
- package/dist/collection/assets/planner-example-5.js +19 -7
- package/dist/collection/assets/planner-example-6.js +3 -0
- package/dist/collection/assets/planner.js +4 -3
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/kup-badge/kup-badge.css +4 -4
- package/dist/collection/components/kup-image-list/kup-image-list.css +37 -4
- package/dist/collection/components/kup-image-list/kup-image-list.js +15 -8
- package/dist/collection/components/kup-input-panel/kup-input-panel-declarations.js +8 -0
- package/dist/collection/components/kup-input-panel/kup-input-panel.css +169 -0
- package/dist/collection/components/kup-input-panel/kup-input-panel.e2e.js +346 -0
- package/dist/collection/components/kup-input-panel/kup-input-panel.js +669 -0
- package/dist/collection/components/kup-lazy/kup-lazy.js +11 -11
- package/dist/collection/components/kup-list/kup-list.js +1 -1
- package/dist/collection/components/kup-magic-box/kup-magic-box.js +3 -3
- package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +1 -1
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.js +1 -1
- package/dist/collection/components/kup-pdf/kup-pdf-declarations.js +8 -0
- package/dist/collection/components/kup-pdf/kup-pdf.css +169 -0
- package/dist/collection/components/kup-pdf/kup-pdf.js +262 -0
- package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +2 -2
- package/dist/collection/components/kup-planner/kup-planner-declarations.js +3 -0
- package/dist/collection/components/kup-planner/kup-planner-helper.js +42 -1
- package/dist/collection/components/kup-planner/kup-planner.js +191 -5
- package/dist/collection/components/kup-planner/utils/custom-task-list-header.js +2 -2
- package/dist/collection/components/kup-planner/utils/custom-task-list-table.js +103 -11
- package/dist/collection/components/kup-planner/utils/gantt-table.module.css +80 -2
- package/dist/collection/components/kup-planner/utils/helpers/bar.helpers.js +41 -13
- package/dist/collection/components/kup-planner/utils/helpers/other.helpers.js +3 -0
- package/dist/collection/components/kup-planner/utils/kup-gantt/kup-gantt.css +10 -0
- package/dist/collection/components/kup-planner/utils/kup-gantt/kup-gantt.js +61 -6
- package/dist/collection/components/kup-planner/utils/kup-gantt-calendar/kup-gantt-calendar.js +32 -2
- package/dist/collection/components/kup-planner/utils/kup-grid-renderer/kup-grid-renderer.css +4 -0
- package/dist/collection/components/kup-planner/utils/kup-grid-renderer/kup-grid-renderer.js +208 -24
- package/dist/collection/components/kup-planner/utils/kup-horizontal-scroll/kup-horizontal-scroll.css +4 -0
- package/dist/collection/components/kup-planner/utils/kup-horizontal-scroll/kup-horizontal-scroll.js +131 -7
- package/dist/collection/components/kup-planner/utils/kup-planner-renderer-helper.js +55 -6
- package/dist/collection/components/kup-planner/utils/kup-planner-renderer.js +40 -7
- package/dist/collection/components/kup-planner/utils/kup-switcher/kup-switcher.css +22 -15
- package/dist/collection/components/kup-planner/utils/kup-switcher/kup-switcher.js +21 -5
- package/dist/collection/components/kup-planner/utils/kup-task-gantt/kup-task-gantt.js +19 -3
- package/dist/collection/components/kup-planner/utils/kup-task-list/kup-task-list-header.js +7 -7
- package/dist/collection/components/kup-planner/utils/kup-task-list/kup-task-list-table.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-task-list/kup-task-list.js +76 -2
- package/dist/collection/components/kup-planner/utils/kup-tooltip/kup-standard-tooltip.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-tooltip/kup-tooltip.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-vertical-scroll/kup-vertical-scroll.js +2 -2
- package/dist/collection/components/kup-probe/kup-probe.js +1 -1
- package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +1 -1
- package/dist/collection/components/kup-qlik/kup-qlik.js +1 -1
- package/dist/collection/components/kup-rating/kup-rating.js +1 -1
- package/dist/collection/components/kup-snackbar/kup-snackbar.js +1 -1
- package/dist/collection/components/kup-spinner/kup-spinner.js +34 -34
- package/dist/collection/components/kup-switch/kup-switch.js +1 -1
- package/dist/collection/components/kup-time-picker/kup-time-picker.js +1 -1
- package/dist/collection/f-components/f-cell/f-cell.js +5 -24
- package/dist/collection/f-components/f-image/f-image.js +2 -5
- package/dist/collection/managers/kup-theme/kup-theme-declarations.js +7 -0
- package/dist/collection/types/GenericTypes.js +1 -0
- package/dist/components/_commonjsHelpers.js +26 -0
- package/dist/components/custom-task-list-header.js +2 -2
- package/dist/components/custom-task-list-table.js +58 -13
- package/dist/components/kup-autocomplete2.js +48 -70
- package/dist/components/kup-box2.js +1 -1
- package/dist/components/kup-calendar.js +2 -2
- package/dist/components/kup-cell.js +1 -1
- package/dist/components/kup-dashboard.js +1 -1
- package/dist/components/kup-dates.js +2 -6
- package/dist/components/kup-echart2.js +1 -1
- package/dist/components/kup-editor.js +1 -1
- package/dist/components/kup-gantt-calendar2.js +31 -1
- package/dist/components/kup-gantt2.js +26 -7
- package/dist/components/kup-grid-renderer2.js +219 -81
- package/dist/components/kup-grid2.js +1 -1
- package/dist/components/kup-horizontal-scroll2.js +48 -10
- package/dist/components/kup-iframe.js +1 -1
- package/dist/components/kup-image-list.js +15 -8
- package/dist/components/kup-input-panel.d.ts +11 -0
- package/dist/components/kup-input-panel.js +595 -0
- package/dist/components/kup-lazy.js +11 -11
- package/dist/components/kup-magic-box.js +4 -4
- package/dist/components/kup-manager.js +658 -122
- package/dist/components/kup-nav-bar.js +1 -1
- package/dist/components/kup-numeric-picker.js +2 -2
- package/dist/components/kup-pdf.d.ts +11 -0
- package/dist/components/kup-pdf.js +76756 -0
- package/dist/components/kup-photo-frame.js +2 -2
- package/dist/components/kup-planner-declarations.js +91 -0
- package/dist/components/kup-planner-renderer2.js +42 -9
- package/dist/components/kup-planner.js +86 -6
- package/dist/components/kup-probe.js +1 -1
- package/dist/components/kup-qlik.js +1 -1
- package/dist/components/kup-snackbar.js +1 -1
- package/dist/components/kup-standard-tooltip2.js +1 -1
- package/dist/components/kup-switcher2.js +19 -7
- package/dist/components/kup-task-gantt2.js +6 -4
- package/dist/components/kup-task-list-header2.js +7 -7
- package/dist/components/kup-task-list-table2.js +1 -1
- package/dist/components/kup-task-list2.js +434 -84
- package/dist/components/kup-tooltip2.js +1 -1
- package/dist/components/kup-vertical-scroll2.js +2 -2
- package/dist/components/other.helpers.js +47 -0
- package/dist/esm/{bar.helpers-0898efb9.js → bar.helpers-23a51579.js} +45 -14
- package/dist/esm/{f-button-45d690a5.js → f-button-d6dbcfd6.js} +1 -1
- package/dist/esm/{f-cell-63db06db.js → f-cell-7b41415c.js} +9 -29
- package/dist/esm/{f-chip-f1ab6c5e.js → f-chip-68d27d7a.js} +2 -2
- package/dist/esm/{f-image-8b382cc5.js → f-image-a67229e5.js} +2 -5
- package/dist/esm/{f-paginator-utils-ae563cd5.js → f-paginator-utils-8773e358.js} +3 -3
- package/dist/esm/{f-text-field-b5fcb598.js → f-text-field-d364ffd2.js} +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/ketchup.js +1 -1
- package/dist/esm/kup-accordion.entry.js +3 -3
- package/dist/esm/kup-autocomplete_27.entry.js +48 -48
- package/dist/esm/kup-box.entry.js +8 -8
- package/dist/esm/kup-calendar.entry.js +5 -5
- package/dist/esm/kup-card-list.entry.js +2 -2
- package/dist/esm/kup-cell.entry.js +7 -7
- package/dist/esm/kup-custom-task-list-header_4.entry.js +256 -40
- package/dist/esm/kup-dashboard.entry.js +5 -5
- package/dist/esm/{kup-dates-4ad48be7.js → kup-dates-26a56bf7.js} +20 -1
- package/dist/esm/kup-drawer.entry.js +2 -2
- package/dist/esm/kup-echart.entry.js +2 -2
- package/dist/esm/kup-editor.entry.js +2 -2
- package/dist/esm/kup-family-tree.entry.js +4 -4
- package/dist/esm/kup-gantt_10.entry.js +106 -40
- package/dist/esm/kup-grid.entry.js +2 -2
- package/dist/esm/kup-iframe.entry.js +2 -2
- package/dist/esm/kup-image-list.entry.js +21 -14
- package/dist/esm/kup-input-panel.entry.js +440 -0
- package/dist/esm/kup-lazy.entry.js +13 -13
- package/dist/esm/kup-magic-box.entry.js +6 -6
- package/dist/esm/{kup-manager-cdb4f21a.js → kup-manager-a316a70e.js} +656 -121
- package/dist/esm/kup-nav-bar.entry.js +3 -3
- package/dist/esm/kup-numeric-picker.entry.js +4 -4
- package/dist/esm/kup-pdf.entry.js +76596 -0
- package/dist/esm/kup-photo-frame.entry.js +4 -4
- package/dist/esm/{kup-planner-declarations-b9345758.js → kup-planner-declarations-398babf9.js} +3 -0
- package/dist/esm/{kup-planner-renderer-helper-da0518be.js → kup-planner-renderer-helper-a2ec9a1c.js} +57 -8
- package/dist/esm/kup-planner-renderer.entry.js +44 -11
- package/dist/esm/{kup-planner-time-formatter-a68e05ba.js → kup-planner-time-formatter-ddf84f9b.js} +1 -1
- package/dist/esm/kup-planner.entry.js +81 -9
- package/dist/esm/kup-probe.entry.js +3 -3
- package/dist/esm/kup-qlik.entry.js +3 -3
- package/dist/esm/kup-snackbar.entry.js +5 -5
- package/dist/esm/loader.js +1 -1
- package/dist/ketchup/index.esm.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-008bdcdc.js +1 -0
- package/dist/ketchup/p-042e874a.entry.js +1 -0
- package/dist/ketchup/{p-837bd0a6.entry.js → p-074ccd53.entry.js} +1 -1
- package/dist/ketchup/{p-41e8402e.entry.js → p-1088ab22.entry.js} +1 -1
- package/dist/ketchup/{p-d9284d98.entry.js → p-1bcac01f.entry.js} +1 -1
- package/dist/ketchup/{p-e0a1fbe7.entry.js → p-1e028d95.entry.js} +1 -1
- package/dist/ketchup/p-25058baa.js +1 -0
- package/dist/ketchup/{p-cbe42afd.entry.js → p-2932e7e8.entry.js} +1 -1
- package/dist/ketchup/{p-1cd48eea.entry.js → p-2b84db7b.entry.js} +1 -1
- package/dist/ketchup/{p-d608f866.entry.js → p-2ef90f60.entry.js} +1 -1
- package/dist/ketchup/{p-bedabdb5.js → p-339bbeae.js} +1 -1
- package/dist/ketchup/{p-157f0e89.entry.js → p-48e45ac0.entry.js} +1 -1
- package/dist/ketchup/p-53af4c87.js +1 -0
- package/dist/ketchup/{p-4dfc5927.entry.js → p-556f7ddc.entry.js} +1 -1
- package/dist/ketchup/{p-cc7352a8.entry.js → p-5f7d8c21.entry.js} +1 -1
- package/dist/ketchup/{p-e0c10de2.entry.js → p-6362738c.entry.js} +1 -1
- package/dist/ketchup/{p-ad6a3c2a.entry.js → p-65e363c6.entry.js} +1 -1
- package/dist/ketchup/p-6921bc81.entry.js +16 -0
- package/dist/ketchup/p-6961e0ce.entry.js +1 -0
- package/dist/ketchup/p-7123d2a4.entry.js +1 -0
- package/dist/ketchup/{p-a5074ce4.js → p-801776bc.js} +1 -1
- package/dist/ketchup/{p-ca8a1f53.entry.js → p-81645576.entry.js} +1 -1
- package/dist/ketchup/p-838dea62.js +1 -0
- package/dist/ketchup/{p-924b841b.js → p-84b511e1.js} +1 -1
- package/dist/ketchup/{p-9a856951.js → p-8d4050ec.js} +4 -4
- package/dist/ketchup/{p-1474852d.entry.js → p-9e2533e1.entry.js} +1 -1
- package/dist/ketchup/{p-c6b34763.entry.js → p-a06974a3.entry.js} +1 -1
- package/dist/ketchup/p-a6beb822.js +1 -0
- package/dist/ketchup/p-abe181d0.entry.js +1 -0
- package/dist/ketchup/{p-ba0f28b7.js → p-b3540f83.js} +1 -1
- package/dist/ketchup/{p-b6a21b6a.entry.js → p-c702eb45.entry.js} +1 -1
- package/dist/ketchup/{p-090e5097.entry.js → p-ccb6dbb0.entry.js} +1 -1
- package/dist/ketchup/{p-d839ce21.entry.js → p-cf44485a.entry.js} +2 -2
- package/dist/ketchup/p-d2001dec.entry.js +44 -0
- package/dist/ketchup/{p-e508b2fd.entry.js → p-dbb6cd8d.entry.js} +1 -1
- package/dist/ketchup/p-eb8ea3a6.js +1 -0
- package/dist/ketchup/{p-590c34bc.js → p-f6c8f006.js} +1 -1
- package/dist/ketchup/{p-4c100286.entry.js → p-f79ffe77.entry.js} +1 -1
- package/dist/ketchup/{p-31c0cfc0.entry.js → p-fdcfaedd.entry.js} +1 -1
- package/dist/ketchup/p-fe75ede2.entry.js +1 -0
- package/dist/types/components/kup-image-list/kup-image-list.d.ts +1 -1
- package/dist/types/components/kup-input-panel/kup-input-panel-declarations.d.ts +81 -0
- package/dist/types/components/kup-input-panel/kup-input-panel.d.ts +67 -0
- package/dist/types/components/kup-pdf/kup-pdf-declarations.d.ts +7 -0
- package/dist/types/components/kup-pdf/kup-pdf.d.ts +42 -0
- package/dist/types/components/kup-planner/kup-planner-declarations.d.ts +29 -2
- package/dist/types/components/kup-planner/kup-planner-helper.d.ts +2 -1
- package/dist/types/components/kup-planner/kup-planner.d.ts +38 -0
- package/dist/types/components/kup-planner/utils/custom-task-list-table.d.ts +7 -0
- package/dist/types/components/kup-planner/utils/helpers/bar.helpers.d.ts +1 -1
- package/dist/types/components/kup-planner/utils/helpers/other.helpers.d.ts +1 -0
- package/dist/types/components/kup-planner/utils/kup-gantt/kup-gantt.d.ts +6 -0
- package/dist/types/components/kup-planner/utils/kup-gantt-calendar/kup-gantt-calendar.d.ts +1 -0
- package/dist/types/components/kup-planner/utils/kup-grid-renderer/kup-grid-renderer.d.ts +13 -1
- package/dist/types/components/kup-planner/utils/kup-horizontal-scroll/kup-horizontal-scroll.d.ts +7 -0
- package/dist/types/components/kup-planner/utils/kup-planner-renderer-helper.d.ts +6 -2
- package/dist/types/components/kup-planner/utils/kup-planner-renderer.d.ts +1 -0
- package/dist/types/components/kup-planner/utils/kup-switcher/kup-switcher.d.ts +3 -1
- package/dist/types/components/kup-planner/utils/kup-task-gantt/kup-task-gantt.d.ts +1 -0
- package/dist/types/components/kup-planner/utils/kup-task-list/kup-task-list.d.ts +4 -0
- package/dist/types/components.d.ts +266 -2
- package/dist/types/types/GenericTypes.d.ts +1 -0
- package/package.json +2 -1
- package/dist/components/kup-planner-renderer-helper.js +0 -379
- package/dist/ketchup/p-21351b19.entry.js +0 -1
- package/dist/ketchup/p-2b40d9b9.entry.js +0 -1
- package/dist/ketchup/p-5c79cb74.js +0 -1
- package/dist/ketchup/p-670354ef.entry.js +0 -1
- package/dist/ketchup/p-8e3b6de8.js +0 -1
- package/dist/ketchup/p-935f58fc.js +0 -1
- package/dist/ketchup/p-9852b1e9.js +0 -1
- package/dist/ketchup/p-ca42a421.entry.js +0 -16
- package/dist/ketchup/p-d50515f7.js +0 -1
- package/dist/ketchup/p-e841c2ae.js +0 -1
- package/dist/ketchup/p-ec4050e1.entry.js +0 -1
|
@@ -1,49 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Fragment } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
function isKeyboardEvent(event) {
|
|
6
|
-
return event.key !== undefined;
|
|
7
|
-
}
|
|
8
|
-
function removeHiddenTasks(tasks) {
|
|
9
|
-
const groupedTasks = tasks.filter((t) => t.hideChildren && t.type === 'project');
|
|
10
|
-
if (groupedTasks.length > 0) {
|
|
11
|
-
for (let i = 0; groupedTasks.length > i; i++) {
|
|
12
|
-
const groupedTask = groupedTasks[i];
|
|
13
|
-
const children = getChildren(tasks, groupedTask);
|
|
14
|
-
tasks = tasks.filter((t) => children.indexOf(t) === -1);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return tasks;
|
|
18
|
-
}
|
|
19
|
-
function getChildren(taskList, task) {
|
|
20
|
-
let tasks = [];
|
|
21
|
-
if (task.type !== 'project') {
|
|
22
|
-
tasks = taskList.filter((t) => t.dependencies && t.dependencies.indexOf(task.id) !== -1);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
tasks = taskList.filter((t) => t.project && t.project === task.id);
|
|
26
|
-
}
|
|
27
|
-
var taskChildren = [];
|
|
28
|
-
tasks.forEach((t) => {
|
|
29
|
-
taskChildren.push(...getChildren(taskList, t));
|
|
30
|
-
});
|
|
31
|
-
tasks = tasks.concat(tasks, taskChildren);
|
|
32
|
-
return tasks;
|
|
33
|
-
}
|
|
34
|
-
const sortTasks = (taskA, taskB) => {
|
|
35
|
-
const orderA = taskA.displayOrder || Number.MAX_VALUE;
|
|
36
|
-
const orderB = taskB.displayOrder || Number.MAX_VALUE;
|
|
37
|
-
if (orderA > orderB) {
|
|
38
|
-
return 1;
|
|
39
|
-
}
|
|
40
|
-
else if (orderA < orderB) {
|
|
41
|
-
return -1;
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
return 0;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
2
|
+
import { d as defaultStylingOptions } from './kup-planner-declarations.js';
|
|
3
|
+
import { i as isKeyboardEvent } from './other.helpers.js';
|
|
4
|
+
import { c as commonjsGlobal } from './_commonjsHelpers.js';
|
|
47
5
|
|
|
48
6
|
const convertToBarTasks = (tasks, dates, columnWidth, rowHeight, taskHeight, projectHeight, timelineHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, showSecondaryDates) => {
|
|
49
7
|
let barTasks = tasks.map((t, i) => {
|
|
@@ -76,16 +34,16 @@ const convertToBarTask = (task, index, dates, columnWidth, rowHeight, taskHeight
|
|
|
76
34
|
}
|
|
77
35
|
return barTask;
|
|
78
36
|
};
|
|
79
|
-
function computeTypeAndXs(start, end, type, dates, columnWidth, handleWidth, rtl) {
|
|
37
|
+
function computeTypeAndXs(start, end, type, dates, columnWidth, handleWidth, rtl, startHour, endHour) {
|
|
80
38
|
let x1;
|
|
81
39
|
let x2;
|
|
82
40
|
if (rtl) {
|
|
83
|
-
x2 = taskXCoordinateRTL(start, dates, columnWidth);
|
|
84
|
-
x1 = taskXCoordinateRTL(end, dates, columnWidth);
|
|
41
|
+
x2 = taskXCoordinateRTL(start, dates, columnWidth, startHour);
|
|
42
|
+
x1 = taskXCoordinateRTL(end, dates, columnWidth, endHour);
|
|
85
43
|
}
|
|
86
44
|
else {
|
|
87
|
-
x1 = taskXCoordinate(start, dates, columnWidth);
|
|
88
|
-
x2 = taskXCoordinate(end, dates, columnWidth);
|
|
45
|
+
x1 = taskXCoordinate(start, dates, columnWidth, startHour);
|
|
46
|
+
x2 = taskXCoordinate(end, dates, columnWidth, endHour);
|
|
89
47
|
}
|
|
90
48
|
let typeInternal = type;
|
|
91
49
|
if (typeInternal === 'task' && x2 - x1 < handleWidth * 2) {
|
|
@@ -95,9 +53,9 @@ function computeTypeAndXs(start, end, type, dates, columnWidth, handleWidth, rtl
|
|
|
95
53
|
return { x1, x2, typeInternal };
|
|
96
54
|
}
|
|
97
55
|
const convertToBar = (task, index, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, showSecondaryDates) => {
|
|
98
|
-
const { x1, x2, typeInternal } = computeTypeAndXs(task.start, task.end, task.type, dates, columnWidth, handleWidth, rtl);
|
|
56
|
+
const { x1, x2, typeInternal } = computeTypeAndXs(task.start, task.end, task.type, dates, columnWidth, handleWidth, rtl, task.startHour, task.endHour);
|
|
99
57
|
const { x1: x1secondary, x2: x2secondary } = showSecondaryDates && task.secondaryStart && task.secondaryEnd
|
|
100
|
-
? computeTypeAndXs(task.secondaryStart, task.secondaryEnd, task.type, dates, columnWidth, handleWidth, rtl)
|
|
58
|
+
? computeTypeAndXs(task.secondaryStart, task.secondaryEnd, task.type, dates, columnWidth, handleWidth, rtl, task.secondaryStartHour, task.secondaryEndHour)
|
|
101
59
|
: { x1: undefined, x2: undefined };
|
|
102
60
|
const [progressWidth, progressX] = progressWithByParams(x1, x2, task.progress, rtl);
|
|
103
61
|
const y = taskYCoordinate(index, rowHeight, taskHeight);
|
|
@@ -114,7 +72,7 @@ const convertToBar = (task, index, dates, columnWidth, rowHeight, taskHeight, ba
|
|
|
114
72
|
progressWidth,
|
|
115
73
|
barCornerRadius,
|
|
116
74
|
handleWidth,
|
|
117
|
-
hideChildren, height: taskHeight, barChildren: [], styles });
|
|
75
|
+
hideChildren, height: taskHeight, barChildren: [], styles, ySecondary: y });
|
|
118
76
|
};
|
|
119
77
|
const defaultStyles = (styles) => {
|
|
120
78
|
var _a, _b, _c, _d;
|
|
@@ -171,7 +129,13 @@ const convertToTimeline = (task, index, dates, columnWidth, rowHeight, taskHeigh
|
|
|
171
129
|
index, progressX: 0, progressWidth: 0, barCornerRadius,
|
|
172
130
|
handleWidth, typeInternal: task.type, progress: 0, height: taskHeight, hideChildren: undefined, barChildren: children !== null && children !== void 0 ? children : [], styles: defaultStyles(task.styles) });
|
|
173
131
|
};
|
|
174
|
-
const taskXCoordinate = (xDate, dates, columnWidth) => {
|
|
132
|
+
const taskXCoordinate = (xDate, dates, columnWidth, hourString) => {
|
|
133
|
+
if (hourString) {
|
|
134
|
+
const [hours, minutes, seconds] = hourString.split(':').map(Number);
|
|
135
|
+
xDate.setHours(hours !== null && hours !== void 0 ? hours : 0);
|
|
136
|
+
xDate.setMinutes(minutes !== null && minutes !== void 0 ? minutes : 0);
|
|
137
|
+
xDate.setSeconds(seconds !== null && seconds !== void 0 ? seconds : 0);
|
|
138
|
+
}
|
|
175
139
|
const index = dates.findIndex((d) => d.getTime() >= xDate.getTime()) - 1;
|
|
176
140
|
if (index < 0) {
|
|
177
141
|
return 0;
|
|
@@ -181,8 +145,8 @@ const taskXCoordinate = (xDate, dates, columnWidth) => {
|
|
|
181
145
|
const x = index * columnWidth + percentOfInterval * columnWidth;
|
|
182
146
|
return x;
|
|
183
147
|
};
|
|
184
|
-
const taskXCoordinateRTL = (xDate, dates, columnWidth) => {
|
|
185
|
-
let x = taskXCoordinate(xDate, dates, columnWidth);
|
|
148
|
+
const taskXCoordinateRTL = (xDate, dates, columnWidth, hourString) => {
|
|
149
|
+
let x = taskXCoordinate(xDate, dates, columnWidth, hourString);
|
|
186
150
|
x += columnWidth;
|
|
187
151
|
return x;
|
|
188
152
|
};
|
|
@@ -265,11 +229,24 @@ const dateByX = (x, taskX, taskDate, xStep, timeStep) => {
|
|
|
265
229
|
(newDate.getTimezoneOffset() - taskDate.getTimezoneOffset()) * 60000);
|
|
266
230
|
return newDate;
|
|
267
231
|
};
|
|
232
|
+
const hourStringFromDate = (date, withSeconds) => {
|
|
233
|
+
const hours = date.getHours();
|
|
234
|
+
const minutes = date.getMinutes();
|
|
235
|
+
const seconds = date.getSeconds();
|
|
236
|
+
const formattedHours = hours < 10 ? '0' + hours : hours;
|
|
237
|
+
const formattedMinutes = minutes < 10 ? '0' + minutes : minutes;
|
|
238
|
+
const formattedSeconds = seconds < 10 ? '0' + seconds : seconds;
|
|
239
|
+
const hourString = withSeconds ? `${formattedHours}:${formattedMinutes}:${formattedSeconds}` : `${formattedHours}:${formattedMinutes}`;
|
|
240
|
+
return hourString;
|
|
241
|
+
};
|
|
242
|
+
const hasSeconds = (hourString) => {
|
|
243
|
+
return hourString.split(":").length === 3;
|
|
244
|
+
};
|
|
268
245
|
/**
|
|
269
246
|
* Method handles event in real time(mousemove) and on finish(mouseup)
|
|
270
247
|
*/
|
|
271
|
-
const handleTaskBySVGMouseEvent = (svgX, action, selectedTask, xStep, timeStep, initEventX1Delta, rtl) => handleTaskBySVGMouseEventForBar(svgX, action, selectedTask, xStep, timeStep, initEventX1Delta, rtl);
|
|
272
|
-
const handleTaskBySVGMouseEventForBar = (svgX, action, selectedTask, xStep, timeStep, initEventX1Delta, rtl) => {
|
|
248
|
+
const handleTaskBySVGMouseEvent = (svgX, action, selectedTask, xStep, timeStep, initEventX1Delta, rtl, svgY) => handleTaskBySVGMouseEventForBar(svgX, action, selectedTask, xStep, timeStep, initEventX1Delta, rtl, svgY);
|
|
249
|
+
const handleTaskBySVGMouseEventForBar = (svgX, action, selectedTask, xStep, timeStep, initEventX1Delta, rtl, svgY) => {
|
|
273
250
|
const changedTask = Object.assign({}, selectedTask);
|
|
274
251
|
let isChanged = false;
|
|
275
252
|
switch (action) {
|
|
@@ -294,9 +271,11 @@ const handleTaskBySVGMouseEventForBar = (svgX, action, selectedTask, xStep, time
|
|
|
294
271
|
if (isChanged) {
|
|
295
272
|
if (rtl) {
|
|
296
273
|
changedTask.end = dateByX(newX1, selectedTask.x1, selectedTask.end, xStep, timeStep);
|
|
274
|
+
changedTask.endHour && (changedTask.endHour = hourStringFromDate(changedTask.end, hasSeconds(changedTask.endHour)));
|
|
297
275
|
}
|
|
298
276
|
else {
|
|
299
277
|
changedTask.start = dateByX(newX1, selectedTask.x1, selectedTask.start, xStep, timeStep);
|
|
278
|
+
changedTask.startHour && (changedTask.startHour = hourStringFromDate(changedTask.start, hasSeconds(changedTask.startHour)));
|
|
300
279
|
}
|
|
301
280
|
const [progressWidth, progressX] = progressWithByParams(changedTask.x1, changedTask.x2, changedTask.progress, rtl);
|
|
302
281
|
changedTask.progressWidth = progressWidth;
|
|
@@ -311,9 +290,11 @@ const handleTaskBySVGMouseEventForBar = (svgX, action, selectedTask, xStep, time
|
|
|
311
290
|
if (isChanged) {
|
|
312
291
|
if (rtl) {
|
|
313
292
|
changedTask.start = dateByX(newX2, selectedTask.x2, selectedTask.start, xStep, timeStep);
|
|
293
|
+
changedTask.startHour && (changedTask.startHour = hourStringFromDate(changedTask.start, hasSeconds(changedTask.startHour)));
|
|
314
294
|
}
|
|
315
295
|
else {
|
|
316
296
|
changedTask.end = dateByX(newX2, selectedTask.x2, selectedTask.end, xStep, timeStep);
|
|
297
|
+
changedTask.endHour && (changedTask.endHour = hourStringFromDate(changedTask.end, hasSeconds(changedTask.endHour)));
|
|
317
298
|
}
|
|
318
299
|
const [progressWidth, progressX] = progressWithByParams(changedTask.x1, changedTask.x2, changedTask.progress, rtl);
|
|
319
300
|
changedTask.progressWidth = progressWidth;
|
|
@@ -327,11 +308,16 @@ const handleTaskBySVGMouseEventForBar = (svgX, action, selectedTask, xStep, time
|
|
|
327
308
|
if (isChanged) {
|
|
328
309
|
changedTask.start = dateByX(newMoveX1, selectedTask.x1, selectedTask.start, xStep, timeStep);
|
|
329
310
|
changedTask.end = dateByX(newMoveX2, selectedTask.x2, selectedTask.end, xStep, timeStep);
|
|
311
|
+
changedTask.startHour && (changedTask.startHour = hourStringFromDate(changedTask.start, hasSeconds(changedTask.startHour)));
|
|
312
|
+
changedTask.endHour && (changedTask.endHour = hourStringFromDate(changedTask.end, hasSeconds(changedTask.endHour)));
|
|
330
313
|
changedTask.x1 = newMoveX1;
|
|
331
314
|
changedTask.x2 = newMoveX2;
|
|
332
315
|
const [progressWidth, progressX] = progressWithByParams(changedTask.x1, changedTask.x2, changedTask.progress, rtl);
|
|
333
316
|
changedTask.progressWidth = progressWidth;
|
|
334
317
|
changedTask.progressX = progressX;
|
|
318
|
+
if (changedTask.type === 'task') {
|
|
319
|
+
changedTask.y = svgY;
|
|
320
|
+
}
|
|
335
321
|
}
|
|
336
322
|
break;
|
|
337
323
|
}
|
|
@@ -905,7 +891,7 @@ var hexToCssFilter = {exports: {}};
|
|
|
905
891
|
})));
|
|
906
892
|
}(hexToCssFilter, hexToCssFilter.exports));
|
|
907
893
|
|
|
908
|
-
const kupGridRendererCss = ".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}";
|
|
894
|
+
const kupGridRendererCss = ".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}.ghost-preview{opacity:0.5}";
|
|
909
895
|
const KupGridRendererStyle0 = kupGridRendererCss;
|
|
910
896
|
|
|
911
897
|
const KupGridRenderer = /*@__PURE__*/ proxyCustomElement(class KupGridRenderer extends HTMLElement {
|
|
@@ -942,13 +928,18 @@ const KupGridRenderer = /*@__PURE__*/ proxyCustomElement(class KupGridRenderer e
|
|
|
942
928
|
this.setSelectedTask = undefined;
|
|
943
929
|
this.eventStart = undefined;
|
|
944
930
|
this.eMouseDown = undefined;
|
|
931
|
+
this.phaseDrop = undefined;
|
|
945
932
|
this.setGanttEvent = undefined;
|
|
933
|
+
this.phaseDragScroll = undefined;
|
|
946
934
|
this.xStep = 0;
|
|
947
935
|
this.initEventX1Delta = 0;
|
|
948
936
|
this.initEventXClick = 0;
|
|
949
937
|
this.isMoving = false;
|
|
950
938
|
this.point = undefined;
|
|
951
939
|
this.svg = undefined;
|
|
940
|
+
this.currentTarget = undefined;
|
|
941
|
+
this.dragScrollInterval = undefined;
|
|
942
|
+
this.dropZoneTask = undefined;
|
|
952
943
|
}
|
|
953
944
|
//---- Lifecycle hooks ----
|
|
954
945
|
componentDidLoad() {
|
|
@@ -980,14 +971,22 @@ const KupGridRenderer = /*@__PURE__*/ proxyCustomElement(class KupGridRenderer e
|
|
|
980
971
|
return;
|
|
981
972
|
event.preventDefault();
|
|
982
973
|
this.point.x = event.clientX;
|
|
974
|
+
this.point.y = event.clientY;
|
|
983
975
|
const cursor = this.point.matrixTransform((_b = (_a = this.svg) === null || _a === void 0 ? void 0 : _a.getScreenCTM()) === null || _b === void 0 ? void 0 : _b.inverse());
|
|
984
|
-
const { isChanged, changedTask } = handleTaskBySVGMouseEvent(cursor.x, this.ganttEvent.action, this.ganttEvent.changedTask, this.xStep, this.timeStep, this.initEventX1Delta, this.rtl);
|
|
976
|
+
const { isChanged, changedTask } = handleTaskBySVGMouseEvent(cursor.x, this.ganttEvent.action, this.ganttEvent.changedTask, this.xStep, this.timeStep, this.initEventX1Delta, this.rtl, cursor.y);
|
|
977
|
+
if (this.currentTarget) {
|
|
978
|
+
this.addGhostPreview(event);
|
|
979
|
+
this.handleAutoScrollForPhaseDrag(event);
|
|
980
|
+
this.addDropzoneVisualization();
|
|
981
|
+
}
|
|
985
982
|
if (isChanged) {
|
|
986
983
|
this.setGanttEvent(Object.assign(Object.assign({}, this.ganttEvent), { action: this.ganttEvent.action, changedTask }));
|
|
987
984
|
}
|
|
988
985
|
};
|
|
989
986
|
const handleMouseUp = async (event) => {
|
|
990
|
-
var _a, _b;
|
|
987
|
+
var _a, _b, _c;
|
|
988
|
+
clearInterval(this.dragScrollInterval);
|
|
989
|
+
this.resetDropzoneVisualization();
|
|
991
990
|
const { action, originalSelectedTask, changedTask } = this.ganttEvent;
|
|
992
991
|
if (!changedTask ||
|
|
993
992
|
!this.point ||
|
|
@@ -997,18 +996,33 @@ const KupGridRenderer = /*@__PURE__*/ proxyCustomElement(class KupGridRenderer e
|
|
|
997
996
|
event.preventDefault();
|
|
998
997
|
this.point.x = event.clientX;
|
|
999
998
|
const cursor = this.point.matrixTransform((_b = (_a = this.svg) === null || _a === void 0 ? void 0 : _a.getScreenCTM()) === null || _b === void 0 ? void 0 : _b.inverse());
|
|
1000
|
-
|
|
999
|
+
this.currentTarget = null;
|
|
1000
|
+
const { changedTask: newChangedTask } = handleTaskBySVGMouseEvent(cursor.x, action, changedTask, this.xStep, this.timeStep, this.initEventX1Delta, this.rtl, cursor.y);
|
|
1001
1001
|
const isNotLikeOriginal = originalSelectedTask.start !== newChangedTask.start ||
|
|
1002
1002
|
originalSelectedTask.end !== newChangedTask.end ||
|
|
1003
|
-
originalSelectedTask.progress !== newChangedTask.progress
|
|
1003
|
+
originalSelectedTask.progress !== newChangedTask.progress ||
|
|
1004
|
+
originalSelectedTask.y !== newChangedTask.y;
|
|
1004
1005
|
// remove listeners
|
|
1005
1006
|
this.svg.removeEventListener('mousemove', handleMouseMove);
|
|
1006
1007
|
this.svg.removeEventListener('mouseup', handleMouseUp);
|
|
1008
|
+
(_c = this.svg.querySelector('.ghost-preview')) === null || _c === void 0 ? void 0 : _c.remove();
|
|
1007
1009
|
this.setGanttEvent({ action: '' });
|
|
1008
1010
|
this.isMoving = false;
|
|
1009
1011
|
// custom operation start
|
|
1010
1012
|
let operationSuccess = true;
|
|
1011
|
-
|
|
1013
|
+
let droppedOn = undefined;
|
|
1014
|
+
let originalTaskData = undefined;
|
|
1015
|
+
if (action === 'move' &&
|
|
1016
|
+
isNotLikeOriginal &&
|
|
1017
|
+
newChangedTask.type === 'task') {
|
|
1018
|
+
droppedOn = this.tasks.find((task) => this.isPhaseWithinTaskArea(changedTask, task) &&
|
|
1019
|
+
task.type === 'project');
|
|
1020
|
+
originalTaskData = this.tasks.find((task) => task.id == originalSelectedTask.id.split('_').shift());
|
|
1021
|
+
}
|
|
1022
|
+
if ((droppedOn === null || droppedOn === void 0 ? void 0 : droppedOn.id) && (originalTaskData === null || originalTaskData === void 0 ? void 0 : originalTaskData.id) !== (droppedOn === null || droppedOn === void 0 ? void 0 : droppedOn.id)) {
|
|
1023
|
+
this.phaseDrop(originalSelectedTask, originalTaskData, newChangedTask, droppedOn);
|
|
1024
|
+
}
|
|
1025
|
+
else if ((action === 'move' || action === 'end' || action === 'start') &&
|
|
1012
1026
|
this.dateChange &&
|
|
1013
1027
|
isNotLikeOriginal) {
|
|
1014
1028
|
try {
|
|
@@ -1054,6 +1068,110 @@ const KupGridRenderer = /*@__PURE__*/ proxyCustomElement(class KupGridRenderer e
|
|
|
1054
1068
|
}
|
|
1055
1069
|
return this.initEventXClick !== event.clientX;
|
|
1056
1070
|
}
|
|
1071
|
+
addGhostPreview(event) {
|
|
1072
|
+
var _a;
|
|
1073
|
+
(_a = this.svg.querySelector('.ghost-preview')) === null || _a === void 0 ? void 0 : _a.remove();
|
|
1074
|
+
const mockEvent = Object.assign(Object.assign({}, event), { dataTransfer: new DataTransfer() });
|
|
1075
|
+
const dragEle = this.currentTarget;
|
|
1076
|
+
dragEle.classList.add('ghost-preview');
|
|
1077
|
+
this.svg.appendChild(dragEle.cloneNode(true));
|
|
1078
|
+
const nodeRect = dragEle.getBoundingClientRect();
|
|
1079
|
+
mockEvent.dataTransfer.setDragImage(dragEle, mockEvent.clientX - nodeRect.left, mockEvent.clientY - nodeRect.top);
|
|
1080
|
+
}
|
|
1081
|
+
handleAutoScrollForPhaseDrag(event) {
|
|
1082
|
+
var _a, _b;
|
|
1083
|
+
const list = (_b = (_a = this.svg) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement;
|
|
1084
|
+
if (!list)
|
|
1085
|
+
return;
|
|
1086
|
+
clearInterval(this.dragScrollInterval);
|
|
1087
|
+
const isOverFlowing = list.clientHeight < list.scrollHeight;
|
|
1088
|
+
if (isOverFlowing) {
|
|
1089
|
+
// if container is overflowing we need to scroll within the container
|
|
1090
|
+
const containerRect = list.getBoundingClientRect();
|
|
1091
|
+
const offsetY = event.clientY - containerRect.top;
|
|
1092
|
+
const diff = 5;
|
|
1093
|
+
if (offsetY - 20 < diff) {
|
|
1094
|
+
this.dragScrollInterval = setInterval(() => {
|
|
1095
|
+
this.phaseDragScroll((list.scrollTop -= diff));
|
|
1096
|
+
}, 1);
|
|
1097
|
+
}
|
|
1098
|
+
else if (offsetY + 20 > containerRect.height - diff) {
|
|
1099
|
+
this.dragScrollInterval = setInterval(() => {
|
|
1100
|
+
this.phaseDragScroll((list.scrollTop += diff));
|
|
1101
|
+
}, 1);
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
else {
|
|
1105
|
+
// else we need to scroll the window when viewport exceeds
|
|
1106
|
+
const scrollOffset = 20;
|
|
1107
|
+
const windowHeight = window.innerHeight;
|
|
1108
|
+
const y = event.clientY;
|
|
1109
|
+
if (y < scrollOffset) {
|
|
1110
|
+
window.scrollBy(0, -scrollOffset);
|
|
1111
|
+
}
|
|
1112
|
+
else if (y > windowHeight - scrollOffset) {
|
|
1113
|
+
window.scrollBy(0, scrollOffset);
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
isPhaseWithinTaskArea(phase, task) {
|
|
1118
|
+
return (phase.y + phase.height >= task.ySecondary &&
|
|
1119
|
+
phase.y <= task.ySecondary + task.height &&
|
|
1120
|
+
phase.x2 >= task.x1 &&
|
|
1121
|
+
phase.x1 <= task.x2);
|
|
1122
|
+
}
|
|
1123
|
+
addDropzoneVisualization() {
|
|
1124
|
+
var _a;
|
|
1125
|
+
this.resetDropzoneVisualization();
|
|
1126
|
+
// find the tasks where drop is allowed, includes all projects except parent project also includes current phase
|
|
1127
|
+
const dropAllowedOn = this.tasks.filter((task) => {
|
|
1128
|
+
var _a, _b, _c;
|
|
1129
|
+
return task.type == 'project' &&
|
|
1130
|
+
((_c = (_b = (_a = this.ganttEvent.originalSelectedTask) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.split('_')) === null || _c === void 0 ? void 0 : _c.shift()) !=
|
|
1131
|
+
task.id;
|
|
1132
|
+
});
|
|
1133
|
+
const changedTask = this.ganttEvent.changedTask;
|
|
1134
|
+
// to determine whether the phase is in some another project y and x area
|
|
1135
|
+
this.dropZoneTask = dropAllowedOn.find((task) => this.isPhaseWithinTaskArea(changedTask, task));
|
|
1136
|
+
if ((_a = this.dropZoneTask) === null || _a === void 0 ? void 0 : _a.ySecondary) {
|
|
1137
|
+
const rects = this.getBarRectsForDropzoneVisualization();
|
|
1138
|
+
rects.forEach((rect) => {
|
|
1139
|
+
rect.setAttribute('fill', defaultStylingOptions.barDropZoneColor);
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
resetDropzoneVisualization() {
|
|
1144
|
+
if (!this.dropZoneTask)
|
|
1145
|
+
return;
|
|
1146
|
+
const rects = this.getBarRectsForDropzoneVisualization();
|
|
1147
|
+
const isSelected = !!this.selectedTask &&
|
|
1148
|
+
this.dropZoneTask.id === this.selectedTask.id;
|
|
1149
|
+
rects.forEach((rect) => {
|
|
1150
|
+
rect.setAttribute('fill', this.getBarColor(isSelected, this.dropZoneTask.styles));
|
|
1151
|
+
});
|
|
1152
|
+
}
|
|
1153
|
+
getBarRectsForDropzoneVisualization() {
|
|
1154
|
+
let rects;
|
|
1155
|
+
if (!this.showSecondaryDates) {
|
|
1156
|
+
rects = this.svg.querySelectorAll(`.barWrapper[data-type="${this.dropZoneTask.type}"] rect[y='${this.dropZoneTask.ySecondary}']`);
|
|
1157
|
+
}
|
|
1158
|
+
else {
|
|
1159
|
+
const rect = this.svg.querySelector(`.barWrapper[data-type="${this.dropZoneTask.type}"] rect[y='${this.dropZoneTask.ySecondary}']`);
|
|
1160
|
+
const siblings = [rect];
|
|
1161
|
+
let nextSibling = rect.nextElementSibling;
|
|
1162
|
+
while (nextSibling !== null) {
|
|
1163
|
+
siblings.push(nextSibling);
|
|
1164
|
+
nextSibling = nextSibling.nextElementSibling;
|
|
1165
|
+
}
|
|
1166
|
+
let prevSibling = rect.previousElementSibling;
|
|
1167
|
+
while (prevSibling !== null) {
|
|
1168
|
+
siblings.unshift(prevSibling);
|
|
1169
|
+
prevSibling = prevSibling.previousElementSibling;
|
|
1170
|
+
}
|
|
1171
|
+
rects = siblings;
|
|
1172
|
+
}
|
|
1173
|
+
return rects;
|
|
1174
|
+
}
|
|
1057
1175
|
handleBarEventStart(action, task, event) {
|
|
1058
1176
|
var _a;
|
|
1059
1177
|
if (!event) {
|
|
@@ -1109,7 +1227,14 @@ const KupGridRenderer = /*@__PURE__*/ proxyCustomElement(class KupGridRenderer e
|
|
|
1109
1227
|
return;
|
|
1110
1228
|
this.point.x = event.clientX;
|
|
1111
1229
|
const cursor = this.point.matrixTransform((_a = this.svg.getScreenCTM()) === null || _a === void 0 ? void 0 : _a.inverse());
|
|
1230
|
+
if (task.type === 'task') {
|
|
1231
|
+
this.currentTarget = event.currentTarget.cloneNode(true);
|
|
1232
|
+
}
|
|
1233
|
+
else {
|
|
1234
|
+
this.currentTarget = null;
|
|
1235
|
+
}
|
|
1112
1236
|
this.initEventX1Delta = cursor.x - task.x1;
|
|
1237
|
+
this.point.y = event.clientY;
|
|
1113
1238
|
this.initEventXClick = event.clientX;
|
|
1114
1239
|
this.setGanttEvent({
|
|
1115
1240
|
action,
|
|
@@ -1131,7 +1256,7 @@ const KupGridRenderer = /*@__PURE__*/ proxyCustomElement(class KupGridRenderer e
|
|
|
1131
1256
|
}
|
|
1132
1257
|
renderKupBar(task, isSelected, isDateResizable, isProgressChangeable) {
|
|
1133
1258
|
var _a, _b, _c;
|
|
1134
|
-
return (h("g", { class: "barWrapper", "tab-index": 0 }, this.renderKupBarDisplay(task.x1, task.y, task.x2 - task.x1, task.height, task.progressX, task.progressWidth, task.barCornerRadius, task.styles, isSelected, !this.readOnly && !!this.dateChange && !task.isDisabled, task, task.x1secondary, ((_a = task.x2secondary) !== null && _a !== void 0 ? _a : 0) - ((_b = task.x1secondary) !== null && _b !== void 0 ? _b : 0)), h("g", { class: "handleGroup" }, isDateResizable && (h("g", null, this.renderKupBarDateHandle(task.x1 + 1, task.y + 1, task.handleWidth, task.height - 2, task.barCornerRadius, task, 'start'), this.renderKupBarDateHandle(task.x2 - task.handleWidth - 1, task.y + 1, task.handleWidth, task.height - 2, task.barCornerRadius, task, 'end'))), isProgressChangeable && (h("polygon", { class: "barHandle", points: this.calculateProgressPoint(task), onMouseDown: (e) => {
|
|
1259
|
+
return (h("g", { class: "barWrapper", "tab-index": 0, "data-type": task.type }, this.renderKupBarDisplay(task.x1, task.y, task.x2 - task.x1, task.height, task.progressX, task.progressWidth, task.barCornerRadius, task.styles, isSelected, !this.readOnly && !!this.dateChange && !task.isDisabled, task, task.x1secondary, ((_a = task.x2secondary) !== null && _a !== void 0 ? _a : 0) - ((_b = task.x1secondary) !== null && _b !== void 0 ? _b : 0), task.ySecondary), h("g", { class: "handleGroup" }, isDateResizable && (h("g", null, this.renderKupBarDateHandle(task.x1 + 1, task.y + 1, task.handleWidth, task.height - 2, task.barCornerRadius, task, 'start'), this.renderKupBarDateHandle(task.x2 - task.handleWidth - 1, task.y + 1, task.handleWidth, task.height - 2, task.barCornerRadius, task, 'end'))), isProgressChangeable && (h("polygon", { class: "barHandle", points: this.calculateProgressPoint(task), onMouseDown: (e) => {
|
|
1135
1260
|
this.handleBarEventStart('progress', task, e);
|
|
1136
1261
|
} }))), task.icon &&
|
|
1137
1262
|
task.icon.url &&
|
|
@@ -1146,11 +1271,11 @@ const KupGridRenderer = /*@__PURE__*/ proxyCustomElement(class KupGridRenderer e
|
|
|
1146
1271
|
(this.showSecondaryDates ? task.height / 2 : 0),
|
|
1147
1272
|
})));
|
|
1148
1273
|
}
|
|
1149
|
-
renderKupBarDisplay(x, y, width, height, progressX, progressWidth, barCornerRadius, styles, isSelected, isDateMovable, task, xSecondary, widthSecondary) {
|
|
1274
|
+
renderKupBarDisplay(x, y, width, height, progressX, progressWidth, barCornerRadius, styles, isSelected, isDateMovable, task, xSecondary, widthSecondary, ySecondary) {
|
|
1150
1275
|
if (this.showSecondaryDates && typeof xSecondary !== 'undefined') {
|
|
1151
1276
|
const halfHeight = height / 2;
|
|
1152
1277
|
return (h("g", { onMouseDown: (e) => isDateMovable &&
|
|
1153
|
-
this.handleBarEventStart('move', task, e) }, h("rect", { key: "top semi-transparent bar", x: xSecondary, width: widthSecondary, y: y, height: halfHeight, ry: barCornerRadius, rx: barCornerRadius, fill: this.getBarColor(isSelected, styles), opacity: 0.5, class: 'barBackground' }), h("rect", { key: "main bar", x: x, width: width, y: y + halfHeight, height: halfHeight, ry: barCornerRadius, rx: barCornerRadius, fill: this.getBarColor(isSelected, styles), class: 'barBackground' }), h("rect", { key: "progress bar", x: progressX, width: progressWidth, y: y + halfHeight, height: halfHeight, ry: barCornerRadius, rx: barCornerRadius, fill: this.getProcessColor(isSelected, styles) })));
|
|
1278
|
+
this.handleBarEventStart('move', task, e) }, h("rect", { key: "top semi-transparent bar", x: xSecondary, width: widthSecondary, y: ySecondary !== null && ySecondary !== void 0 ? ySecondary : y, height: halfHeight, ry: barCornerRadius, rx: barCornerRadius, fill: this.getBarColor(isSelected, styles), opacity: 0.5, class: 'barBackground' }), h("rect", { key: "main bar", x: x, width: width, y: y + halfHeight, height: halfHeight, ry: barCornerRadius, rx: barCornerRadius, fill: this.getBarColor(isSelected, styles), class: 'barBackground' }), h("rect", { key: "progress bar", x: progressX, width: progressWidth, y: y + halfHeight, height: halfHeight, ry: barCornerRadius, rx: barCornerRadius, fill: this.getProcessColor(isSelected, styles) })));
|
|
1154
1279
|
}
|
|
1155
1280
|
return (h("g", { onMouseDown: (e) => {
|
|
1156
1281
|
isDateMovable && this.handleBarEventStart('move', task, e);
|
|
@@ -1253,29 +1378,37 @@ const KupGridRenderer = /*@__PURE__*/ proxyCustomElement(class KupGridRenderer e
|
|
|
1253
1378
|
rowLines.push(h("line", { key: 'RowLine' + task.id, x1: 0, y1: y + this.rowHeight, x2: this.gridProps.svgWidth, y2: y + this.rowHeight, class: "gridRowLine" }));
|
|
1254
1379
|
y += this.rowHeight;
|
|
1255
1380
|
}
|
|
1256
|
-
const now = new Date();
|
|
1381
|
+
// const now = new Date();
|
|
1257
1382
|
let tickX = 0;
|
|
1258
1383
|
const ticks = [];
|
|
1259
1384
|
for (let i = 0; i < this.dates.length; i++) {
|
|
1260
1385
|
const date = this.dates[i];
|
|
1261
1386
|
ticks.push(h("line", { key: date.getTime(), x1: tickX, y1: 0, x2: tickX, y2: y, class: "gridTick" }));
|
|
1262
|
-
if (
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1387
|
+
// if (
|
|
1388
|
+
// (i + 1 !== this.dates.length &&
|
|
1389
|
+
// date.getTime() < now.getTime() &&
|
|
1390
|
+
// this.dates[i + 1].getTime() >= now.getTime()) ||
|
|
1391
|
+
// // if current date is last
|
|
1392
|
+
// (i !== 0 &&
|
|
1393
|
+
// i + 1 === this.dates.length &&
|
|
1394
|
+
// date.getTime() < now.getTime() &&
|
|
1395
|
+
// addToDate(
|
|
1396
|
+
// date,
|
|
1397
|
+
// date.getTime() - this.dates[i - 1].getTime(),
|
|
1398
|
+
// 'millisecond'
|
|
1399
|
+
// ).getTime() >= now.getTime())
|
|
1400
|
+
// ) {
|
|
1401
|
+
// // Add custom logic here if needed
|
|
1402
|
+
// }
|
|
1270
1403
|
tickX += this.columnWidth;
|
|
1271
1404
|
}
|
|
1272
|
-
return (h("svg", { key: '
|
|
1405
|
+
return (h("svg", { key: '95b5c0ebccd9d472507328baa068f9d75daa4a6e', xmlns: "http://www.w3.org/2000/svg", width: this.gridProps.svgWidth, height: `${this.rowHeight * this.tasks.length}px`, "font-family": this.fontFamily, ref: (el) => (this.svg = el) }, h("g", { key: 'bd6598993c35c69c6aadca0d41c50b028a283b70', class: "grid" }, h("g", { key: 'c52a1de5fa57cc5fdd4b80ff84b3a09b13e3b199', class: "rows" }, gridRows), h("g", { key: 'd8747275b307b05c7a5c4ab1ab3efa5956c95f25', class: "rowLines" }, rowLines), h("g", { key: '000d0b2ec6253da9d23096a7cfa3564a2a3a173d', class: "ticks" }, ticks)), h("g", { key: 'fc0d6cc1b4f60e84b77082b7c47d68eb364fbb7b', class: "content" }, this.currentDateIndicator && (h("rect", { fill: this.currentDateIndicator.color, x: this.currentDateIndicator.x + 1.5, y: "0", width: "2", height: "100%" })), this.projection && (h("rect", { fill: this.projection.color, x: this.projection.x0, y: "0", width: this.projection.xf - this.projection.x0, height: "100%", "fill-opacity": "0.35" })), h("g", { key: '04162e3432a56f08c1ea29e69503fe97e1fb84d2', class: "arrows", fill: this.arrowColor, stroke: this.arrowColor }, this.tasks.map((task) => {
|
|
1273
1406
|
return task.barChildren.map((child) => {
|
|
1274
1407
|
if (task.type !== 'timeline') {
|
|
1275
1408
|
this.renderKupArrow(task, child);
|
|
1276
1409
|
}
|
|
1277
1410
|
});
|
|
1278
|
-
})), h("g", { key: '
|
|
1411
|
+
})), h("g", { key: '4e5888f0a6335480ee0f32df3844982e355f4e39', class: "bar", "font-family": this.fontFamily, "font-size": this.fontSize }, this.tasks.map((task) => {
|
|
1279
1412
|
const forbidResize = task.type === 'project';
|
|
1280
1413
|
return (h("g", { onKeyDown: (e) => {
|
|
1281
1414
|
switch (e.key) {
|
|
@@ -1335,7 +1468,7 @@ const KupGridRenderer = /*@__PURE__*/ proxyCustomElement(class KupGridRenderer e
|
|
|
1335
1468
|
return this.renderKupBar(task, props.isSelected, isDateResizable, isProgressChangeable);
|
|
1336
1469
|
}
|
|
1337
1470
|
})()));
|
|
1338
|
-
})))));
|
|
1471
|
+
}), this.currentTarget && this.ganttEvent.changedTask && (h("g", { class: "task-wrapper" }, this.renderKupBar(this.ganttEvent.changedTask, false, false, false)))))));
|
|
1339
1472
|
}
|
|
1340
1473
|
static get watchers() { return {
|
|
1341
1474
|
"columnWidth": ["updateXStep"],
|
|
@@ -1382,13 +1515,18 @@ const KupGridRenderer = /*@__PURE__*/ proxyCustomElement(class KupGridRenderer e
|
|
|
1382
1515
|
"setSelectedTask": [16],
|
|
1383
1516
|
"eventStart": [16],
|
|
1384
1517
|
"eMouseDown": [16],
|
|
1518
|
+
"phaseDrop": [16],
|
|
1385
1519
|
"setGanttEvent": [1040],
|
|
1520
|
+
"phaseDragScroll": [16],
|
|
1386
1521
|
"xStep": [32],
|
|
1387
1522
|
"initEventX1Delta": [32],
|
|
1388
1523
|
"initEventXClick": [32],
|
|
1389
1524
|
"isMoving": [32],
|
|
1390
1525
|
"point": [32],
|
|
1391
|
-
"svg": [32]
|
|
1526
|
+
"svg": [32],
|
|
1527
|
+
"currentTarget": [32],
|
|
1528
|
+
"dragScrollInterval": [32],
|
|
1529
|
+
"dropZoneTask": [32]
|
|
1392
1530
|
}, undefined, {
|
|
1393
1531
|
"columnWidth": ["updateXStep"],
|
|
1394
1532
|
"dates": ["updateXStep"],
|
|
@@ -1416,4 +1554,4 @@ function defineCustomElement() {
|
|
|
1416
1554
|
} });
|
|
1417
1555
|
}
|
|
1418
1556
|
|
|
1419
|
-
export { KupGridRenderer as K, calculateCurrentDateCalculator as a, calculateProjection as b, convertToBarTasks as c, defineCustomElement as d
|
|
1557
|
+
export { KupGridRenderer as K, calculateCurrentDateCalculator as a, calculateProjection as b, convertToBarTasks as c, defineCustomElement as d };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, forceUpdate, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { k as kupManagerInstance, g as getProps, s as setProps,
|
|
2
|
+
import { k as kupManagerInstance, g as getProps, s as setProps, o as KupDebugCategory } from './kup-manager.js';
|
|
3
3
|
import { c as componentWrapperId, d as defineCustomElement$1, a as defineCustomElement$2, b as defineCustomElement$3, e as defineCustomElement$4, f as defineCustomElement$5, g as defineCustomElement$6, h as defineCustomElement$7, i as defineCustomElement$8, j as defineCustomElement$9, k as defineCustomElement$a, l as defineCustomElement$b, m as defineCustomElement$c, n as defineCustomElement$d, o as defineCustomElement$e, p as defineCustomElement$f, q as defineCustomElement$g, r as defineCustomElement$h, s as defineCustomElement$i, t as defineCustomElement$j, u as defineCustomElement$k, v as defineCustomElement$l, w as defineCustomElement$m, x as defineCustomElement$n, y as defineCustomElement$o, z as defineCustomElement$p, A as defineCustomElement$q, B as defineCustomElement$r } from './kup-autocomplete2.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Fragment } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
|
-
const kupHorizontalScrollCss = ".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}.scrollWrapper{overflow:auto;max-width:100%;height:1.2rem}.scrollWrapper::-webkit-scrollbar{width:1.1rem;height:1.1rem}.scrollWrapper::-webkit-scrollbar-corner{background:transparent}.scrollWrapper::-webkit-scrollbar-thumb{border:6px solid transparent;background:rgba(0, 0, 0, 0.2);background:var(--palette-black-alpha-20, rgba(0, 0, 0, 0.2));border-radius:10px;background-clip:padding-box}.scrollWrapper::-webkit-scrollbar-thumb:hover{border:4px solid transparent;background:rgba(0, 0, 0, 0.3);background:var(--palette-black-alpha-30, rgba(0, 0, 0, 0.3));background-clip:padding-box}.scroll{height:1px}";
|
|
3
|
+
const kupHorizontalScrollCss = ".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}.scrollWrapper{overflow:auto;max-width:100%;height:1.2rem}.scrollWrapper::-webkit-scrollbar{width:1.1rem;height:1.1rem}.scrollWrapper::-webkit-scrollbar-corner{background:transparent}.scrollWrapper::-webkit-scrollbar-thumb{border:6px solid transparent;background:rgba(0, 0, 0, 0.2);background:var(--palette-black-alpha-20, rgba(0, 0, 0, 0.2));border-radius:10px;background-clip:padding-box}.scrollWrapper::-webkit-scrollbar-thumb:hover{border:4px solid transparent;background:rgba(0, 0, 0, 0.3);background:var(--palette-black-alpha-30, rgba(0, 0, 0, 0.3));background-clip:padding-box}.scroll{height:1px}.scroll-container{display:flex}";
|
|
4
4
|
const KupHorizontalScrollStyle0 = kupHorizontalScrollCss;
|
|
5
5
|
|
|
6
6
|
const HorizontalScroll = /*@__PURE__*/ proxyCustomElement(class HorizontalScroll extends HTMLElement {
|
|
@@ -13,7 +13,12 @@ const HorizontalScroll = /*@__PURE__*/ proxyCustomElement(class HorizontalScroll
|
|
|
13
13
|
this.taskListTrueRef = undefined;
|
|
14
14
|
this.rtl = undefined;
|
|
15
15
|
this.taskListWidth = undefined;
|
|
16
|
+
this.scrollableTaskList = false;
|
|
17
|
+
this.listCellWidth = '300px';
|
|
18
|
+
this.taskListScrollWidth = undefined;
|
|
19
|
+
this.taskListScrollNumber = undefined;
|
|
16
20
|
this.horizontalScroll = undefined;
|
|
21
|
+
this.horizontalTaskListScroll = undefined;
|
|
17
22
|
this.timeoutId = undefined;
|
|
18
23
|
}
|
|
19
24
|
//---- Lifecycle hooks ----
|
|
@@ -29,24 +34,51 @@ const HorizontalScroll = /*@__PURE__*/ proxyCustomElement(class HorizontalScroll
|
|
|
29
34
|
this.setScrollLeft();
|
|
30
35
|
}, 50);
|
|
31
36
|
}
|
|
37
|
+
listScrollLeft() {
|
|
38
|
+
clearTimeout(this.timeoutId);
|
|
39
|
+
this.timeoutId = setTimeout(() => {
|
|
40
|
+
this.setTaskListScrollLeft();
|
|
41
|
+
}, 50);
|
|
42
|
+
}
|
|
32
43
|
setScrollLeft() {
|
|
33
44
|
if (this.rootElement) {
|
|
34
|
-
this.rootElement.shadowRoot.querySelector('div')
|
|
35
|
-
|
|
45
|
+
const shadowElement = this.rootElement.shadowRoot.querySelector('div');
|
|
46
|
+
const element = shadowElement.children.length == 2
|
|
47
|
+
? shadowElement.children[1]
|
|
48
|
+
: shadowElement.children[0];
|
|
49
|
+
element && (element.scrollLeft = this.scrollNumber);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
setTaskListScrollLeft() {
|
|
53
|
+
if (this.rootElement) {
|
|
54
|
+
const shadowElement = this.rootElement.shadowRoot.querySelector('div');
|
|
55
|
+
const taskListScrollBar = shadowElement.children.length == 2 ? shadowElement.children[0] : null;
|
|
56
|
+
taskListScrollBar && (taskListScrollBar.scrollLeft = this.taskListScrollNumber);
|
|
36
57
|
}
|
|
37
58
|
}
|
|
38
59
|
render() {
|
|
39
60
|
var _a, _b;
|
|
40
61
|
const w = (_b = ((_a = this.taskListTrueRef) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().width) + 24 * 1.5) !== null && _b !== void 0 ? _b : 0; // 24 * 2 is the sum of padding and margin for both list and gantt, multiplied by 1.5 cause we need to add the other half to the right
|
|
41
|
-
|
|
62
|
+
const width = +this.listCellWidth.replace('px', '');
|
|
63
|
+
return (h(Fragment, { key: '84cd5ee2a862b2e0afaba38f81ad299466c6c90a' }, h("div", { key: '8be4374ca4ae407dd6c538994a4236d24196111b', class: "scroll-container" }, this.scrollableTaskList &&
|
|
64
|
+
this.taskListScrollWidth > width && (h("div", { dir: "ltr", style: {
|
|
65
|
+
margin: this.rtl
|
|
66
|
+
? `0px 20px 0px 20px`
|
|
67
|
+
: `0px 20px 0px 20px`,
|
|
68
|
+
maxWidth: `${width + 20}px`,
|
|
69
|
+
minWidth: `${width + 20}px`,
|
|
70
|
+
}, class: "scrollWrapper", "data-scrollx": "true", onScroll: this.horizontalTaskListScroll }, h("div", { style: {
|
|
71
|
+
width: `${this.taskListScrollWidth}px`,
|
|
72
|
+
}, class: "scroll" }))), h("div", { key: '703cb38b994d2012c5c8718e144b360d6351eafd', dir: "ltr", style: {
|
|
42
73
|
margin: this.rtl
|
|
43
|
-
? `0px ${w}px 0px 12px`
|
|
44
|
-
: `0px 12px 0px ${w}px`,
|
|
45
|
-
}, class: "scrollWrapper", "data-scrollx": "true", onScroll: this.horizontalScroll }, h("div", { key: '
|
|
74
|
+
? `0px ${this.scrollableTaskList && this.taskListScrollWidth > width ? 40 : w}px 0px 12px`
|
|
75
|
+
: `0px 12px 0px ${this.scrollableTaskList && this.taskListScrollWidth > width ? 40 : w}px`,
|
|
76
|
+
}, class: "scrollWrapper", "data-scrollx": "true", onScroll: this.horizontalScroll }, h("div", { key: '347758c21c87bd6069526f5079acac13e50220f8', style: { width: `${this.svgWidth}px` }, class: "scroll" })))));
|
|
46
77
|
}
|
|
47
78
|
get rootElement() { return this; }
|
|
48
79
|
static get watchers() { return {
|
|
49
|
-
"scrollNumber": ["scrollLeft"]
|
|
80
|
+
"scrollNumber": ["scrollLeft"],
|
|
81
|
+
"taskListScrollNumber": ["listScrollLeft"]
|
|
50
82
|
}; }
|
|
51
83
|
static get style() { return KupHorizontalScrollStyle0; }
|
|
52
84
|
}, [1, "kup-horizontal-scroll", {
|
|
@@ -55,10 +87,16 @@ const HorizontalScroll = /*@__PURE__*/ proxyCustomElement(class HorizontalScroll
|
|
|
55
87
|
"taskListTrueRef": [16],
|
|
56
88
|
"rtl": [4],
|
|
57
89
|
"taskListWidth": [2, "task-list-width"],
|
|
90
|
+
"scrollableTaskList": [4, "scrollable-task-list"],
|
|
91
|
+
"listCellWidth": [1, "list-cell-width"],
|
|
92
|
+
"taskListScrollWidth": [2, "task-list-scroll-width"],
|
|
93
|
+
"taskListScrollNumber": [2, "task-list-scroll-number"],
|
|
58
94
|
"horizontalScroll": [16],
|
|
95
|
+
"horizontalTaskListScroll": [16],
|
|
59
96
|
"timeoutId": [32]
|
|
60
97
|
}, undefined, {
|
|
61
|
-
"scrollNumber": ["scrollLeft"]
|
|
98
|
+
"scrollNumber": ["scrollLeft"],
|
|
99
|
+
"taskListScrollNumber": ["listScrollLeft"]
|
|
62
100
|
}]);
|
|
63
101
|
function defineCustomElement() {
|
|
64
102
|
if (typeof customElements === "undefined") {
|