@m3ui-vue/m3ui-vue 1.10.2 → 1.11.0
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/README.md +19 -4
- package/dist/API.md +195 -56
- package/dist/MButton-gWoOzFWf.js +284 -0
- package/dist/MButton-gWoOzFWf.js.map +1 -0
- package/dist/MColorPickerModal-CJYMvlgK.js +466 -0
- package/dist/MColorPickerModal-CJYMvlgK.js.map +1 -0
- package/dist/MDialog-CU8EYgCC.js +226 -0
- package/dist/MDialog-CU8EYgCC.js.map +1 -0
- package/dist/{MIcon-BSsJZhK7.js → MIcon-CkUc9kuQ.js} +10 -4
- package/dist/MIcon-CkUc9kuQ.js.map +1 -0
- package/dist/MIconButton-DTFOfsTy.js +317 -0
- package/dist/MIconButton-DTFOfsTy.js.map +1 -0
- package/dist/MListItem-Cdw2FqCT.js +1306 -0
- package/dist/MListItem-Cdw2FqCT.js.map +1 -0
- package/dist/MLoadingIndicator-BxAy2x7P.js +115 -0
- package/dist/MLoadingIndicator-BxAy2x7P.js.map +1 -0
- package/dist/{MMenuItem-US0Zbglq.js → MMenuItem-CEIKYvaX.js} +216 -214
- package/dist/MMenuItem-CEIKYvaX.js.map +1 -0
- package/dist/{MPdfViewer-DL9mRsd2.js → MPdfViewer-CEfyXGq2.js} +674 -671
- package/dist/MPdfViewer-CEfyXGq2.js.map +1 -0
- package/dist/MProgressBar-BzZMxq7M.js.map +1 -1
- package/dist/MSeekBar-B3_D-PwH.js +435 -0
- package/dist/MSeekBar-B3_D-PwH.js.map +1 -0
- package/dist/{MSegmentedButton-DMou-8sG.js → MSegmentedButton-Dg07j-4r.js} +4 -4
- package/dist/{MSegmentedButton-DMou-8sG.js.map → MSegmentedButton-Dg07j-4r.js.map} +1 -1
- package/dist/{MSignaturePad-WuvE_Cyl.js → MSignaturePad-3nddtLKI.js} +2 -2
- package/dist/{MSignaturePad-WuvE_Cyl.js.map → MSignaturePad-3nddtLKI.js.map} +1 -1
- package/dist/{MSlider-7TzhFHKS.js → MSlider-BrpLbqwt.js} +4 -4
- package/dist/{MSlider-7TzhFHKS.js.map → MSlider-BrpLbqwt.js.map} +1 -1
- package/dist/{MSpinner-CkIVBuGE.js → MSpinner-CLwzDH33.js} +2 -2
- package/dist/{MSpinner-CkIVBuGE.js.map → MSpinner-CLwzDH33.js.map} +1 -1
- package/dist/{MTextField-B6_iOczK.js → MTextField-CZRizAwA.js} +136 -134
- package/dist/MTextField-CZRizAwA.js.map +1 -0
- package/dist/{_useFieldValidation-COBJ1tWr.js → _useFieldValidation-DVcqyy9g.js} +2 -2
- package/dist/{_useFieldValidation-COBJ1tWr.js.map → _useFieldValidation-DVcqyy9g.js.map} +1 -1
- package/dist/api.json +1 -1
- package/dist/chart.js +1 -1
- package/dist/code-editor.js +3 -3
- package/dist/code-editor.js.map +1 -1
- package/dist/components/MAlert.vue.d.ts +1 -1
- package/dist/components/MAudioPlayer.vue.d.ts +3 -3
- package/dist/components/MAvatar.vue.d.ts +19 -1
- package/dist/components/MButton.vue.d.ts +2 -1
- package/dist/components/MChatBubble.vue.d.ts +2 -0
- package/dist/components/MCheckbox.vue.d.ts +2 -0
- package/dist/components/MDataTable.vue.d.ts +31 -3
- package/dist/components/MFlow.vue.d.ts +1 -1
- package/dist/components/MHotkeys.vue.d.ts +1 -0
- package/dist/components/MIcon.vue.d.ts +6 -0
- package/dist/components/MIconButton.vue.d.ts +5 -0
- package/dist/components/MKanban.vue.d.ts +1 -1
- package/dist/components/MLink.vue.d.ts +59 -0
- package/dist/components/MListItem.vue.d.ts +3 -1
- package/dist/components/MMapControl.vue.d.ts +1 -1
- package/dist/components/MNotificationCenter.vue.d.ts +1 -1
- package/dist/components/MNumberField.vue.d.ts +1 -1
- package/dist/components/MPagination.vue.d.ts +14 -1
- package/dist/components/MPdfSigner.vue.d.ts +2 -2
- package/dist/components/MRadio.vue.d.ts +2 -0
- package/dist/components/MRadioGroup.vue.d.ts +2 -0
- package/dist/components/MStatCard.vue.d.ts +2 -2
- package/dist/components/MSwitch.vue.d.ts +2 -0
- package/dist/components/MText.vue.d.ts +4 -2
- package/dist/components/MTextField.vue.d.ts +2 -0
- package/dist/components/_MDrawerItemList.vue.d.ts +6 -0
- package/dist/composables/_menuGroups.d.ts +10 -1
- package/dist/composables/_splitAttrs.d.ts +6 -0
- package/dist/composables/_springAnimation.d.ts +2 -2
- package/dist/composables/_useFocusTrap.d.ts +15 -0
- package/dist/composables/_usePaneResize.d.ts +1 -1
- package/dist/composables/_useSpring.d.ts +4 -4
- package/dist/composables/dynamicColor.d.ts +9 -1
- package/dist/composables/motion.d.ts +63 -0
- package/dist/composables/useConfirm.d.ts +28 -0
- package/dist/composables/useDevice.d.ts +8 -1
- package/dist/composables/useLocale.d.ts +14 -0
- package/dist/composables/useScrollReveal.d.ts +1 -1
- package/dist/composables/useTheme.d.ts +1 -0
- package/dist/composables/useToast.d.ts +7 -0
- package/dist/draw.js +556 -556
- package/dist/draw.js.map +1 -1
- package/dist/flow.js +854 -851
- package/dist/flow.js.map +1 -1
- package/dist/gantt.js +1118 -1096
- package/dist/gantt.js.map +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/locales/index.d.ts +1 -0
- package/dist/locales/index.js +833 -1
- package/dist/locales/index.js.map +1 -1
- package/dist/locales/pl.d.ts +2 -0
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +10327 -9796
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +860 -860
- package/dist/map.js.map +1 -1
- package/dist/{material-color-utilities-CEFytLsr.js → material-color-utilities-BZsBNIhi.js} +276 -217
- package/dist/material-color-utilities-BZsBNIhi.js.map +1 -0
- package/dist/media.js +7 -7
- package/dist/{motion-BcejVTeX.js → motion-BqYcqcim.js} +15 -5
- package/dist/motion-BqYcqcim.js.map +1 -0
- package/dist/pdf-sign.js +140 -137
- package/dist/pdf-sign.js.map +1 -1
- package/dist/pdf.js +1 -1
- package/dist/plugin.d.ts +11 -0
- package/dist/rich-text-editor.js +7 -7
- package/dist/styles/theme.css +40 -0
- package/dist/styles.css +1 -1
- package/dist/terminal.js +1 -1
- package/dist/{useLocale-YRaOT12S.js → useLocale-BjcYauXr.js} +60 -4
- package/dist/useLocale-BjcYauXr.js.map +1 -0
- package/dist/{useThemeTokens-DyAdPQB0.js → useThemeTokens-D5nr5KHf.js} +28 -27
- package/dist/useThemeTokens-D5nr5KHf.js.map +1 -0
- package/package.json +17 -2
- package/src/__tests__/MAvatarImage.test.ts +37 -0
- package/src/__tests__/MDataTableControlled.test.ts +68 -0
- package/src/__tests__/MHotkeysSequence.test.ts +53 -0
- package/src/__tests__/MIconAxes.test.ts +16 -0
- package/src/__tests__/MIconButtonWidth.test.ts +22 -0
- package/src/__tests__/MLink.test.ts +46 -0
- package/src/__tests__/MPaginationPages.test.ts +43 -0
- package/src/__tests__/MTextEmphasized.test.ts +14 -0
- package/src/__tests__/controlDescription.test.ts +34 -0
- package/src/__tests__/customColor.test.ts +27 -0
- package/src/__tests__/dynamicColor.test.ts +3 -2
- package/src/__tests__/focusTrap.test.ts +124 -0
- package/src/__tests__/formatMessage.test.ts +20 -0
- package/src/__tests__/inputAttrs.test.ts +103 -0
- package/src/__tests__/localePresets.test.ts +2 -0
- package/src/__tests__/menuGroupsRemount.test.ts +40 -0
- package/src/__tests__/menuHydration.test.ts +41 -0
- package/src/__tests__/motionPrefs.test.ts +28 -0
- package/src/__tests__/ssr.test.ts +11 -0
- package/src/__tests__/ssrToast.test.ts +20 -0
- package/src/__tests__/toastDetails.test.ts +39 -0
- package/src/__tests__/useConfirm.test.ts +47 -0
- package/src/__tests__/useTheme.test.ts +14 -0
- package/src/__tests__/warningRole.test.ts +22 -0
- package/src/components/MAlert.vue +2 -2
- package/src/components/MAnimatedNumber.vue +9 -3
- package/src/components/MAutocomplete.vue +16 -4
- package/src/components/MAvailabilityCalendar.vue +3 -3
- package/src/components/MAvatar.vue +32 -5
- package/src/components/MAvatarGroup.vue +7 -2
- package/src/components/MBottomSheet.vue +18 -2
- package/src/components/MButton.vue +18 -5
- package/src/components/MCarousel.vue +3 -3
- package/src/components/MChatBubble.vue +14 -1
- package/src/components/MCheckbox.vue +21 -4
- package/src/components/MChip.vue +4 -2
- package/src/components/MCollapse.vue +7 -1
- package/src/components/MCommandPalette.vue +6 -2
- package/src/components/MContextMenu.vue +4 -4
- package/src/components/MCreditCardInput.vue +5 -0
- package/src/components/MDashboardGrid.vue +2 -1
- package/src/components/MDataTable.vue +63 -16
- package/src/components/MDialog.vue +21 -3
- package/src/components/MDiffViewer.vue +3 -3
- package/src/components/MDrawLayers.vue +3 -3
- package/src/components/MFabMenu.vue +7 -0
- package/src/components/MFloorPlan.vue +3 -3
- package/src/components/MFloorPlanInspector.vue +3 -3
- package/src/components/MFlow.vue +9 -5
- package/src/components/MFlowControls.vue +6 -0
- package/src/components/MFormBuilder.vue +1 -1
- package/src/components/MGantt.vue +10 -10
- package/src/components/MHotkeys.vue +61 -16
- package/src/components/MIcon.vue +17 -1
- package/src/components/MIconButton.vue +29 -6
- package/src/components/MImageCropper.vue +1 -1
- package/src/components/MKanban.vue +2 -1
- package/src/components/MLightbox.vue +5 -4
- package/src/components/MLink.vue +136 -0
- package/src/components/MListDetail.vue +7 -0
- package/src/components/MListItem.vue +7 -4
- package/src/components/MLoadingIndicator.vue +2 -1
- package/src/components/MMap.vue +3 -0
- package/src/components/MMapCluster.vue +2 -2
- package/src/components/MMapControl.vue +2 -2
- package/src/components/MMapMeasure.vue +1 -1
- package/src/components/MMaskField.vue +16 -3
- package/src/components/MMenu.vue +4 -4
- package/src/components/MMenuItem.vue +2 -2
- package/src/components/MMeterGroup.vue +3 -2
- package/src/components/MMortgageCalculator.vue +3 -3
- package/src/components/MMultiAutocomplete.vue +19 -7
- package/src/components/MMultiSelect.vue +19 -7
- package/src/components/MNavigationDrawer.vue +10 -3
- package/src/components/MNavigationRail.vue +5 -1
- package/src/components/MNotificationCenter.vue +2 -1
- package/src/components/MNotificationHost.vue +3 -3
- package/src/components/MNumberField.vue +23 -6
- package/src/components/MOdontogram.vue +4 -4
- package/src/components/MOrderBook.vue +4 -0
- package/src/components/MPagination.vue +91 -12
- package/src/components/MPdfSigner.vue +3 -3
- package/src/components/MPdfViewer.vue +7 -7
- package/src/components/MPhoneInput.vue +17 -4
- package/src/components/MProductConfigurator.vue +4 -4
- package/src/components/MProgressBar.vue +5 -0
- package/src/components/MQuiz.vue +8 -5
- package/src/components/MRadio.vue +24 -5
- package/src/components/MRadioGroup.vue +3 -0
- package/src/components/MReactions.vue +2 -2
- package/src/components/MResourceTimeline.vue +3 -3
- package/src/components/MResult.vue +1 -1
- package/src/components/MScrollField.vue +1 -1
- package/src/components/MSearchField.vue +6 -5
- package/src/components/MSeatMap.vue +5 -0
- package/src/components/MSeekBar.vue +3 -2
- package/src/components/MSelect.vue +16 -4
- package/src/components/MSideSheet.vue +25 -3
- package/src/components/MSimpleCarousel.vue +2 -2
- package/src/components/MSnackbar.vue +16 -13
- package/src/components/MSparkline.vue +2 -1
- package/src/components/MSpinner.vue +8 -0
- package/src/components/MSplitter.vue +1 -1
- package/src/components/MSpotlightSearch.vue +6 -2
- package/src/components/MSpreadsheet.vue +1 -1
- package/src/components/MStatCard.vue +2 -1
- package/src/components/MSwitch.vue +21 -4
- package/src/components/MTabs.vue +2 -1
- package/src/components/MTagInput.vue +19 -6
- package/src/components/MText.vue +23 -4
- package/src/components/MTextField.vue +25 -6
- package/src/components/MTimeline.vue +5 -5
- package/src/components/MToolbar.vue +2 -2
- package/src/components/MTour.vue +3 -0
- package/src/components/MTrackingTimeline.vue +6 -0
- package/src/components/MTypewriter.vue +7 -1
- package/src/components/MWindow.vue +10 -1
- package/src/components/_MColorPanel.vue +4 -4
- package/src/components/_MComment.vue +3 -2
- package/src/components/_MFlowNodeShell.vue +1 -1
- package/src/components/_MPdfPage.vue +1 -1
- package/src/components/_MTransferPane.vue +10 -0
- package/src/composables/_effectCanvas.ts +2 -1
- package/src/composables/_menuGroups.ts +10 -1
- package/src/composables/_splitAttrs.ts +29 -0
- package/src/composables/_springAnimation.ts +3 -3
- package/src/composables/_themeTransition.ts +3 -2
- package/src/composables/_useFocusTrap.ts +142 -0
- package/src/composables/_useMenuNav.ts +3 -3
- package/src/composables/_usePaneResize.ts +2 -1
- package/src/composables/_useSheetMotion.ts +3 -4
- package/src/composables/_useSpring.ts +16 -10
- package/src/composables/cron.ts +7 -6
- package/src/composables/dynamicColor.ts +21 -2
- package/src/composables/motion.ts +27 -0
- package/src/composables/useConfirm.ts +116 -0
- package/src/composables/useDevice.ts +23 -3
- package/src/composables/useFieldBg.ts +4 -0
- package/src/composables/useLocale.ts +74 -0
- package/src/composables/useNotification.ts +3 -0
- package/src/composables/useScrollReveal.ts +3 -3
- package/src/composables/useTheme.ts +8 -2
- package/src/composables/useToast.ts +27 -4
- package/src/directives/vSparkle.ts +2 -1
- package/src/index.ts +8 -5
- package/src/locales/ar.ts +7 -0
- package/src/locales/de.ts +7 -0
- package/src/locales/es.ts +7 -0
- package/src/locales/fr.ts +7 -0
- package/src/locales/index.ts +1 -0
- package/src/locales/ja.ts +7 -0
- package/src/locales/ko.ts +7 -0
- package/src/locales/pl.ts +807 -0
- package/src/locales/pt.ts +7 -0
- package/src/locales/zh.ts +7 -0
- package/src/plugin.ts +16 -0
- package/src/styles/theme.css +40 -0
- package/dist/MButton-B9RCM06i.js +0 -171
- package/dist/MButton-B9RCM06i.js.map +0 -1
- package/dist/MColorPickerModal-ChRtcZOo.js +0 -577
- package/dist/MColorPickerModal-ChRtcZOo.js.map +0 -1
- package/dist/MDialog-dk07tify.js +0 -167
- package/dist/MDialog-dk07tify.js.map +0 -1
- package/dist/MIcon-BSsJZhK7.js.map +0 -1
- package/dist/MIconButton-CrBPZidd.js +0 -288
- package/dist/MIconButton-CrBPZidd.js.map +0 -1
- package/dist/MListItem-h9H223vx.js +0 -1239
- package/dist/MListItem-h9H223vx.js.map +0 -1
- package/dist/MLoadingIndicator-YTV1Ov5w.js +0 -114
- package/dist/MLoadingIndicator-YTV1Ov5w.js.map +0 -1
- package/dist/MMenuItem-US0Zbglq.js.map +0 -1
- package/dist/MPdfViewer-DL9mRsd2.js.map +0 -1
- package/dist/MSeekBar-JFZcoJ8y.js +0 -434
- package/dist/MSeekBar-JFZcoJ8y.js.map +0 -1
- package/dist/MTextField-B6_iOczK.js.map +0 -1
- package/dist/material-color-utilities-CEFytLsr.js.map +0 -1
- package/dist/motion-BcejVTeX.js.map +0 -1
- package/dist/useLocale-YRaOT12S.js.map +0 -1
- package/dist/useThemeTokens-DyAdPQB0.js.map +0 -1
package/dist/gantt.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { t as e } from "./flowPaths-BaH7yaUM.js";
|
|
2
|
-
import { f as t, l as n, t as r, u as i } from "./MIconButton-
|
|
3
|
-
import { i as
|
|
4
|
-
import { t as
|
|
5
|
-
import { Fragment as
|
|
2
|
+
import { f as t, l as n, t as r, u as i } from "./MIconButton-DTFOfsTy.js";
|
|
3
|
+
import { a, i as o } from "./useLocale-BjcYauXr.js";
|
|
4
|
+
import { t as s } from "./MSegmentedButton-Dg07j-4r.js";
|
|
5
|
+
import { Fragment as c, Teleport as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createTextVNode as ee, createVNode as te, defineComponent as h, inject as g, nextTick as _, normalizeClass as v, normalizeStyle as y, onBeforeUnmount as ne, onBeforeUpdate as re, onMounted as ie, onUpdated as ae, openBlock as b, provide as oe, ref as x, renderList as S, renderSlot as se, shallowRef as ce, toDisplayString as C, toRaw as le, unref as w, useSlots as ue, vModelText as de, watch as T, withDirectives as fe, withKeys as pe, withModifiers as E } from "vue";
|
|
6
6
|
// src/composables/useGantt.ts
|
|
7
|
-
var
|
|
7
|
+
var me = Symbol("m3-gantt"), he = Symbol("m3-timeline-controls");
|
|
8
8
|
function D() {
|
|
9
|
-
let e =
|
|
9
|
+
let e = g(me, null);
|
|
10
10
|
if (!e) throw Error("useGantt() must be called inside <MGantt>");
|
|
11
11
|
return e;
|
|
12
12
|
}
|
|
13
13
|
// src/composables/_ganttTime.ts
|
|
14
|
-
var
|
|
14
|
+
var ge = 36e5, O = 864e5, k = [
|
|
15
15
|
"hour",
|
|
16
16
|
"day",
|
|
17
17
|
"week",
|
|
18
18
|
"month",
|
|
19
19
|
"quarter",
|
|
20
20
|
"year"
|
|
21
|
-
],
|
|
21
|
+
], _e = /^\d{4}-\d{2}-\d{2}$/;
|
|
22
22
|
function A(e) {
|
|
23
|
-
return !!e &&
|
|
23
|
+
return !!e && _e.test(e);
|
|
24
24
|
}
|
|
25
25
|
function j(e) {
|
|
26
26
|
if (!e) return NaN;
|
|
27
|
-
if (
|
|
27
|
+
if (_e.test(e)) {
|
|
28
28
|
let [t, n, r] = e.split("-").map(Number);
|
|
29
29
|
return new Date(t, n - 1, r).getTime();
|
|
30
30
|
}
|
|
@@ -35,29 +35,29 @@ function j(e) {
|
|
|
35
35
|
}
|
|
36
36
|
return Date.parse(e);
|
|
37
37
|
}
|
|
38
|
-
var
|
|
39
|
-
function
|
|
40
|
-
let n = new Date(e), r = `${n.getFullYear()}-${
|
|
38
|
+
var M = (e) => String(e).padStart(2, "0");
|
|
39
|
+
function N(e, t) {
|
|
40
|
+
let n = new Date(e), r = `${n.getFullYear()}-${M(n.getMonth() + 1)}-${M(n.getDate())}`;
|
|
41
41
|
if (t) return r;
|
|
42
42
|
let i = n.getSeconds();
|
|
43
|
-
return `${r}T${
|
|
43
|
+
return `${r}T${M(n.getHours())}:${M(n.getMinutes())}${i ? `:${M(i)}` : ""}`;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function P(e) {
|
|
46
46
|
let t = new Date(e);
|
|
47
47
|
return new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime();
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function F(e, t) {
|
|
50
50
|
let n = new Date(e);
|
|
51
51
|
return n.setDate(n.getDate() + t), n.getTime();
|
|
52
52
|
}
|
|
53
53
|
function ve(e, t) {
|
|
54
|
-
return Math.round((
|
|
54
|
+
return Math.round((P(t) - P(e)) / O);
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function I(e, t, n = 1) {
|
|
57
57
|
let r = new Date(e);
|
|
58
58
|
switch (t) {
|
|
59
59
|
case "hour": return new Date(r.getFullYear(), r.getMonth(), r.getDate(), r.getHours()).getTime();
|
|
60
|
-
case "day": return
|
|
60
|
+
case "day": return P(e);
|
|
61
61
|
case "week": {
|
|
62
62
|
let e = (r.getDay() - n + 7) % 7;
|
|
63
63
|
return new Date(r.getFullYear(), r.getMonth(), r.getDate() - e).getTime();
|
|
@@ -71,8 +71,8 @@ function ye(e, t, n = 1) {
|
|
|
71
71
|
let r = new Date(e);
|
|
72
72
|
switch (t) {
|
|
73
73
|
case "hour": return new Date(r.getFullYear(), r.getMonth(), r.getDate(), r.getHours() + n).getTime();
|
|
74
|
-
case "day": return
|
|
75
|
-
case "week": return
|
|
74
|
+
case "day": return F(e, 1);
|
|
75
|
+
case "week": return F(e, 7);
|
|
76
76
|
case "month": return new Date(r.getFullYear(), r.getMonth() + 1, 1).getTime();
|
|
77
77
|
case "quarter": return new Date(r.getFullYear(), r.getMonth() + 3, 1).getTime();
|
|
78
78
|
case "year": return new Date(r.getFullYear() + 1, 0, 1).getTime();
|
|
@@ -80,10 +80,10 @@ function ye(e, t, n = 1) {
|
|
|
80
80
|
}
|
|
81
81
|
function be(e, t) {
|
|
82
82
|
if (t >= 1440) {
|
|
83
|
-
let n = Math.round(t / 1440), r =
|
|
84
|
-
return n <= 1 ? r :
|
|
83
|
+
let n = Math.round(t / 1440), r = P(e + 12 * ge);
|
|
84
|
+
return n <= 1 ? r : F(r, -((ve(0, r) % n + n) % n));
|
|
85
85
|
}
|
|
86
|
-
let n = t * 6e4, r =
|
|
86
|
+
let n = t * 6e4, r = P(e);
|
|
87
87
|
return r + Math.round((e - r) / n) * n;
|
|
88
88
|
}
|
|
89
89
|
var xe = {
|
|
@@ -107,7 +107,7 @@ var xe = {
|
|
|
107
107
|
month: 44,
|
|
108
108
|
quarter: 36,
|
|
109
109
|
year: 44
|
|
110
|
-
},
|
|
110
|
+
}, L = {
|
|
111
111
|
hour: "day",
|
|
112
112
|
day: "month",
|
|
113
113
|
week: "month",
|
|
@@ -131,7 +131,7 @@ function Te(e) {
|
|
|
131
131
|
let n = k.find((t) => t !== "hour" && Se[t] * e >= Ce[t]) ?? "year";
|
|
132
132
|
return {
|
|
133
133
|
bottom: n,
|
|
134
|
-
top:
|
|
134
|
+
top: L[n],
|
|
135
135
|
step: 1
|
|
136
136
|
};
|
|
137
137
|
}
|
|
@@ -144,11 +144,11 @@ function Ee(e) {
|
|
|
144
144
|
return t;
|
|
145
145
|
}
|
|
146
146
|
function De(e, t, n, r = 1, i = 1, a = 2e3) {
|
|
147
|
-
let o = [], s =
|
|
148
|
-
for (n === "hour" && i > 1 && (s -= new Date(s).getHours() % i *
|
|
147
|
+
let o = [], s = I(e, n, r);
|
|
148
|
+
for (n === "hour" && i > 1 && (s -= new Date(s).getHours() % i * ge); s < t && o.length < a; s = ye(s, n, i)) o.push(s);
|
|
149
149
|
return o;
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function R(e, t, n, r, i, a = !1) {
|
|
152
152
|
let o = new Date(e), s = (e) => new Intl.DateTimeFormat(r, e).format(o);
|
|
153
153
|
switch (t) {
|
|
154
154
|
case "hour": return s({ hour: "numeric" });
|
|
@@ -176,8 +176,8 @@ function Oe(e) {
|
|
|
176
176
|
let t = e / 24;
|
|
177
177
|
return t >= 120 ? 5 : t >= 40 ? 15 : t >= 16 ? 30 : t >= 4 ? 60 : 1440;
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
return t.includes(new Date(e).getDay()) && !n.has(
|
|
179
|
+
function z(e, t, n) {
|
|
180
|
+
return t.includes(new Date(e).getDay()) && !n.has(N(e, !0));
|
|
181
181
|
}
|
|
182
182
|
// src/composables/ganttSchedule.ts
|
|
183
183
|
function ke(e) {
|
|
@@ -197,17 +197,17 @@ function Ae(e) {
|
|
|
197
197
|
for (let t of e) t.type === "summary" && n.add(t.id);
|
|
198
198
|
return n;
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function B(e) {
|
|
201
201
|
return e.type === "milestone" || !e.end && e.type !== "summary";
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function V(e) {
|
|
204
204
|
let t = j(e.start), n = A(e.start);
|
|
205
205
|
if (e.type === "milestone" || !e.end) return {
|
|
206
206
|
start: t,
|
|
207
207
|
end: t,
|
|
208
208
|
dateOnly: n
|
|
209
209
|
};
|
|
210
|
-
let r = j(e.end), i = A(e.end) ? P(
|
|
210
|
+
let r = j(e.end), i = A(e.end) ? F(P(r), 1) : r;
|
|
211
211
|
return {
|
|
212
212
|
start: t,
|
|
213
213
|
end: Math.max(t, i),
|
|
@@ -216,21 +216,21 @@ function B(e) {
|
|
|
216
216
|
}
|
|
217
217
|
function je(e, t, n) {
|
|
218
218
|
let r = A(e.start);
|
|
219
|
-
if (e.type === "milestone" || !e.end) return { start:
|
|
219
|
+
if (e.type === "milestone" || !e.end) return { start: N(r ? P(t) : t, r) };
|
|
220
220
|
if (r) {
|
|
221
|
-
let e =
|
|
221
|
+
let e = P(t), r = Math.max(e, P(n - 1));
|
|
222
222
|
return {
|
|
223
|
-
start:
|
|
224
|
-
end:
|
|
223
|
+
start: N(e, !0),
|
|
224
|
+
end: N(r, !0)
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
227
|
return {
|
|
228
|
-
start:
|
|
229
|
-
end:
|
|
228
|
+
start: N(t, !1),
|
|
229
|
+
end: N(Math.max(t, n), !1)
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
|
-
function
|
|
233
|
-
let t =
|
|
232
|
+
function H(e) {
|
|
233
|
+
let t = V(e);
|
|
234
234
|
return t.dateOnly ? ve(t.start, t.end) : (t.end - t.start) / O;
|
|
235
235
|
}
|
|
236
236
|
function Me(e) {
|
|
@@ -245,19 +245,19 @@ function Me(e) {
|
|
|
245
245
|
i.add(e.id);
|
|
246
246
|
let o = Infinity, s = -Infinity, c = !0, l = 0, u = 0;
|
|
247
247
|
for (let t of n.get(e.id)) {
|
|
248
|
-
let e = a(t), n =
|
|
248
|
+
let e = a(t), n = V(e);
|
|
249
249
|
if (!Number.isFinite(n.start)) continue;
|
|
250
250
|
o = Math.min(o, n.start), s = Math.max(s, n.end), n.dateOnly || (c = !1);
|
|
251
|
-
let r = Math.max(n.end - n.start, +!
|
|
251
|
+
let r = Math.max(n.end - n.start, +!B(e));
|
|
252
252
|
l += r, u += r * (e.progress ?? 0);
|
|
253
253
|
}
|
|
254
254
|
if (i.delete(e.id), !Number.isFinite(o)) return e;
|
|
255
255
|
let d = c ? {
|
|
256
|
-
start:
|
|
257
|
-
end:
|
|
256
|
+
start: N(o, !0),
|
|
257
|
+
end: N(Math.max(o, P(s - 1)), !0)
|
|
258
258
|
} : {
|
|
259
|
-
start:
|
|
260
|
-
end:
|
|
259
|
+
start: N(o, !1),
|
|
260
|
+
end: N(s, !1)
|
|
261
261
|
}, f = l ? Math.round(u / l) : e.progress ?? 0, p = d.start === e.start && d.end === e.end && f === (e.progress ?? 0) ? e : {
|
|
262
262
|
...e,
|
|
263
263
|
start: d.start,
|
|
@@ -271,7 +271,7 @@ function Me(e) {
|
|
|
271
271
|
});
|
|
272
272
|
return o ? s : e;
|
|
273
273
|
}
|
|
274
|
-
function
|
|
274
|
+
function U(e) {
|
|
275
275
|
return {
|
|
276
276
|
days: e?.workingDays ?? [
|
|
277
277
|
1,
|
|
@@ -284,20 +284,20 @@ function H(e) {
|
|
|
284
284
|
};
|
|
285
285
|
}
|
|
286
286
|
function Ne(e, t, n) {
|
|
287
|
-
let r =
|
|
288
|
-
for (let t =
|
|
287
|
+
let r = U(n), i = 0, a = P(j(t));
|
|
288
|
+
for (let t = P(j(e)); t <= a; t = F(t, 1)) z(t, r.days, r.holidays) && i++;
|
|
289
289
|
return i;
|
|
290
290
|
}
|
|
291
|
-
function
|
|
292
|
-
let r =
|
|
291
|
+
function W(e, t, n) {
|
|
292
|
+
let r = U(n);
|
|
293
293
|
if (!r.days.length) return e;
|
|
294
|
-
let i =
|
|
295
|
-
for (; !
|
|
294
|
+
let i = P(j(e));
|
|
295
|
+
for (; !z(i, r.days, r.holidays);) i = F(i, 1);
|
|
296
296
|
let a = t < 0 ? -1 : 1;
|
|
297
|
-
for (let e = Math.abs(t); e > 0;) i =
|
|
298
|
-
return
|
|
297
|
+
for (let e = Math.abs(t); e > 0;) i = F(i, a), z(i, r.days, r.holidays) && e--;
|
|
298
|
+
return N(i, !0);
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function G(e) {
|
|
301
301
|
let t = new Map(e.map((e) => [e.id, e])), n = Ae(e), r = /* @__PURE__ */ new Map();
|
|
302
302
|
for (let n of e) n.parentId && t.has(n.parentId) && (r.get(n.parentId) ?? r.set(n.parentId, []).get(n.parentId)).push(n.id);
|
|
303
303
|
let i = (e, t = 0) => n.has(e) && r.has(e) && t < 100 ? r.get(e).flatMap((e) => i(e, t + 1)) : [e], a = [];
|
|
@@ -319,7 +319,7 @@ function W(e) {
|
|
|
319
319
|
links: a
|
|
320
320
|
};
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function K(e, t) {
|
|
323
323
|
let n = [], r = /* @__PURE__ */ new Map(), i = (e) => {
|
|
324
324
|
if (!r.get(e)) {
|
|
325
325
|
r.set(e, 1);
|
|
@@ -331,8 +331,8 @@ function G(e, t) {
|
|
|
331
331
|
return n;
|
|
332
332
|
}
|
|
333
333
|
function Pe(e, t = {}) {
|
|
334
|
-
let { sums: n, kids: r, leaves: i, links: a } =
|
|
335
|
-
for (let t of e) n.has(t.id) || s.set(t.id,
|
|
334
|
+
let { sums: n, kids: r, leaves: i, links: a } = G(e), o = t.calendar ? U(t.calendar) : null, s = /* @__PURE__ */ new Map();
|
|
335
|
+
for (let t of e) n.has(t.id) || s.set(t.id, V(t));
|
|
336
336
|
let c = /* @__PURE__ */ new Map();
|
|
337
337
|
for (let e of a) (c.get(e.succ) ?? c.set(e.succ, []).get(e.succ)).push(e.pred);
|
|
338
338
|
for (let e of n) c.set(e, [...c.get(e) ?? [], ...i(e)]);
|
|
@@ -350,12 +350,12 @@ function Pe(e, t = {}) {
|
|
|
350
350
|
end: r,
|
|
351
351
|
dateOnly: !0
|
|
352
352
|
} : void 0;
|
|
353
|
-
}, d = (e, n, r) => !o || !r ? e + n * O : j(
|
|
353
|
+
}, d = (e, n, r) => !o || !r ? e + n * O : j(W(N(e, !0), n, t.calendar)), f = (e) => {
|
|
354
354
|
let t = 0;
|
|
355
|
-
for (let n = e.start; n < e.end; n =
|
|
355
|
+
for (let n = e.start; n < e.end; n = F(n, 1)) z(n, o.days, o.holidays) && t++;
|
|
356
356
|
return t;
|
|
357
357
|
}, p = !1;
|
|
358
|
-
for (let e of
|
|
358
|
+
for (let e of K([...s.keys(), ...n], c)) {
|
|
359
359
|
if (n.has(e)) continue;
|
|
360
360
|
let r = s.get(e), i = l.get(e);
|
|
361
361
|
if (!i?.length || !Number.isFinite(r.start)) continue;
|
|
@@ -368,21 +368,21 @@ function Pe(e, t = {}) {
|
|
|
368
368
|
}
|
|
369
369
|
if (!Number.isFinite(c)) continue;
|
|
370
370
|
let m = t.mode === "asap" ? c : Math.max(r.start, c);
|
|
371
|
-
r.dateOnly && (m =
|
|
372
|
-
let
|
|
371
|
+
r.dateOnly && (m = P(m + 432e5));
|
|
372
|
+
let ee = m + a;
|
|
373
373
|
if (o && r.dateOnly) {
|
|
374
374
|
let e = f(r);
|
|
375
|
-
m = j(
|
|
376
|
-
} else r.dateOnly && (
|
|
377
|
-
(m !== r.start ||
|
|
375
|
+
m = j(W(N(m, !0), 0, t.calendar)), ee = e ? F(j(W(N(m, !0), Math.max(0, e - 1), t.calendar)), 1) : m;
|
|
376
|
+
} else r.dateOnly && (ee = F(m, ve(r.start, r.end)));
|
|
377
|
+
(m !== r.start || ee !== r.end) && (s.set(e, {
|
|
378
378
|
start: m,
|
|
379
|
-
end:
|
|
379
|
+
end: ee,
|
|
380
380
|
dateOnly: r.dateOnly
|
|
381
381
|
}), p = !0);
|
|
382
382
|
}
|
|
383
383
|
return Me(p ? e.map((e) => {
|
|
384
384
|
if (n.has(e.id) && r.has(e.id)) return e;
|
|
385
|
-
let t = s.get(e.id), i =
|
|
385
|
+
let t = s.get(e.id), i = V(e);
|
|
386
386
|
return !t || t.start === i.start && t.end === i.end ? e : {
|
|
387
387
|
...e,
|
|
388
388
|
...je(e, t.start, t.end)
|
|
@@ -390,8 +390,8 @@ function Pe(e, t = {}) {
|
|
|
390
390
|
}) : e);
|
|
391
391
|
}
|
|
392
392
|
function Fe(e, t = {}) {
|
|
393
|
-
let { sums: n, kids: r, leaves: i, links: a } =
|
|
394
|
-
for (let t of e) n.has(t.id) && r.has(t.id) || o.set(t.id,
|
|
393
|
+
let { sums: n, kids: r, leaves: i, links: a } = G(e), o = /* @__PURE__ */ new Map();
|
|
394
|
+
for (let t of e) n.has(t.id) && r.has(t.id) || o.set(t.id, V(t));
|
|
395
395
|
let s = [...o.keys()].filter((e) => Number.isFinite(o.get(e).start));
|
|
396
396
|
if (!s.length) return {
|
|
397
397
|
tasks: [],
|
|
@@ -399,18 +399,18 @@ function Fe(e, t = {}) {
|
|
|
399
399
|
slack: {},
|
|
400
400
|
finish: ""
|
|
401
401
|
};
|
|
402
|
-
let c = t.calendar ?
|
|
402
|
+
let c = t.calendar ? U(t.calendar) : null, l = (e) => e / O;
|
|
403
403
|
if (c) {
|
|
404
|
-
let e =
|
|
404
|
+
let e = P(Math.min(...s.map((e) => o.get(e).start))), t = /* @__PURE__ */ new Map();
|
|
405
405
|
l = (n) => {
|
|
406
|
-
let r =
|
|
406
|
+
let r = P(n), i = t.get(r);
|
|
407
407
|
if (i === void 0) {
|
|
408
408
|
i = 0;
|
|
409
409
|
let n = r >= e ? 1 : -1;
|
|
410
|
-
for (let t = e; t !== r; t =
|
|
410
|
+
for (let t = e; t !== r; t = F(t, n)) z(n > 0 ? t : F(t, -1), c.days, c.holidays) && (i += n);
|
|
411
411
|
t.set(r, i);
|
|
412
412
|
}
|
|
413
|
-
return i + (
|
|
413
|
+
return i + (z(r, c.days, c.holidays) ? (n - r) / O : 0);
|
|
414
414
|
};
|
|
415
415
|
}
|
|
416
416
|
let u = new Map(s.map((e) => [e, {
|
|
@@ -421,56 +421,56 @@ function Fe(e, t = {}) {
|
|
|
421
421
|
pred: t
|
|
422
422
|
})) : [e]).filter((e) => u.has(e.pred) && u.has(e.succ)), f = Math.max(...s.map((e) => u.get(e).end)), p = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
|
|
423
423
|
for (let e of d) (p.get(e.pred) ?? p.set(e.pred, []).get(e.pred)).push(e), (m.get(e.succ) ?? m.set(e.succ, []).get(e.succ)).push(e.pred);
|
|
424
|
-
let
|
|
425
|
-
for (let e of
|
|
424
|
+
let ee = /* @__PURE__ */ new Map();
|
|
425
|
+
for (let e of K(s, m).reverse()) {
|
|
426
426
|
let t = u.get(e), n = t.end - t.start, r = f;
|
|
427
427
|
for (let t of p.get(e) ?? []) {
|
|
428
|
-
let e =
|
|
428
|
+
let e = ee.get(t.succ);
|
|
429
429
|
if (e === void 0) continue;
|
|
430
430
|
let i = u.get(t.succ), a = e + (i.end - i.start);
|
|
431
431
|
r = t.type === "FS" ? Math.min(r, e - t.lag) : t.type === "SS" ? Math.min(r, e - t.lag + n) : t.type === "FF" ? Math.min(r, a - t.lag) : Math.min(r, a - t.lag + n);
|
|
432
432
|
}
|
|
433
|
-
|
|
433
|
+
ee.set(e, r - n);
|
|
434
434
|
}
|
|
435
|
-
let
|
|
435
|
+
let te = {}, h = /* @__PURE__ */ new Set();
|
|
436
436
|
for (let e of s) {
|
|
437
|
-
let t =
|
|
438
|
-
|
|
437
|
+
let t = ee.get(e) - u.get(e).start;
|
|
438
|
+
te[e] = Math.round(t * 1e3) / 1e3, t < 1e-6 && h.add(e);
|
|
439
439
|
}
|
|
440
|
-
let
|
|
440
|
+
let g = /* @__PURE__ */ new Set();
|
|
441
441
|
for (let e of d) {
|
|
442
|
-
if (!
|
|
442
|
+
if (!h.has(e.pred) || !h.has(e.succ)) continue;
|
|
443
443
|
let t = u.get(e.pred), n = u.get(e.succ), r = (e.type === "FS" || e.type === "FF" ? t.end : t.start) + e.lag, i = e.type === "FS" || e.type === "SS" ? n.start : n.end;
|
|
444
|
-
Math.abs(i - r) < 1e-6 &&
|
|
444
|
+
Math.abs(i - r) < 1e-6 && g.add(e.key);
|
|
445
445
|
}
|
|
446
|
-
for (let e of n) r.has(e) && i(e).some((e) =>
|
|
447
|
-
let
|
|
446
|
+
for (let e of n) r.has(e) && i(e).some((e) => h.has(e)) && h.add(e);
|
|
447
|
+
let _ = Math.max(...s.map((e) => o.get(e).end)), v = e.find((e) => o.get(e.id)?.end === _);
|
|
448
448
|
return {
|
|
449
|
-
tasks: e.filter((e) =>
|
|
450
|
-
dependencies: [...
|
|
451
|
-
slack:
|
|
452
|
-
finish:
|
|
449
|
+
tasks: e.filter((e) => h.has(e.id)).map((e) => e.id),
|
|
450
|
+
dependencies: [...g],
|
|
451
|
+
slack: te,
|
|
452
|
+
finish: N(A(v?.start) ? F(_, -1) : _, A(v?.start))
|
|
453
453
|
};
|
|
454
454
|
}
|
|
455
455
|
// src/composables/_useTimeAxis.ts
|
|
456
456
|
function Ie(e) {
|
|
457
|
-
let t = (t) => Math.min(e.maxPxPerDay(), Math.max(e.minPxPerDay(), t)), n =
|
|
458
|
-
|
|
457
|
+
let t = (t) => Math.min(e.maxPxPerDay(), Math.max(e.minPxPerDay(), t)), n = x(t(e.pxPerDay() ?? xe[e.scale()])), r = u(() => Ee(n.value)), a = r.value;
|
|
458
|
+
T(r, (t) => {
|
|
459
459
|
t !== a && (a = t, e.onScale(t));
|
|
460
|
-
}),
|
|
460
|
+
}), T(e.scale, (e) => {
|
|
461
461
|
e !== a && (a = e, re(xe[e]));
|
|
462
462
|
});
|
|
463
|
-
let o =
|
|
463
|
+
let o = x({
|
|
464
464
|
left: 0,
|
|
465
465
|
top: 0,
|
|
466
466
|
width: 0,
|
|
467
467
|
height: 0
|
|
468
|
-
}), s =
|
|
468
|
+
}), s = u(() => Math.max(0, o.value.width - e.listWidth.value)), c = x(Date.now()), l, d = u(() => {
|
|
469
469
|
let t = e.today();
|
|
470
470
|
return t === null ? null : t ? j(t) : c.value;
|
|
471
|
-
}), f =
|
|
472
|
-
function
|
|
473
|
-
let t =
|
|
471
|
+
}), f = u(() => Math.max(14, (s.value || 800) / n.value)), p = x(0), m = u(() => Math.max((e.extent.value.max - p.value) / O + f.value, s.value / n.value)), ee = u(() => m.value * n.value);
|
|
472
|
+
function te() {
|
|
473
|
+
let t = P(F(e.extent.value.min, -Math.ceil(f.value)));
|
|
474
474
|
if (!p.value) {
|
|
475
475
|
p.value = t;
|
|
476
476
|
return;
|
|
@@ -483,69 +483,69 @@ function Ie(e) {
|
|
|
483
483
|
i && (i.scrollLeft += r, o.value.left = i.scrollLeft);
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
|
-
|
|
487
|
-
let
|
|
486
|
+
T([e.extent, f], te, { immediate: !0 });
|
|
487
|
+
let h = (e) => (e - p.value) / O * n.value, g = (e) => p.value + e / n.value * O, v = 0, y = null;
|
|
488
488
|
function re(r, a, c = !0, l) {
|
|
489
489
|
r = t(r);
|
|
490
|
-
let u = a ?? s.value / 2, d = l ??
|
|
490
|
+
let u = a ?? s.value / 2, d = l ?? g(o.value.left + u);
|
|
491
491
|
if (!c || i() || !e.scroller.value) {
|
|
492
|
-
cancelAnimationFrame(
|
|
492
|
+
cancelAnimationFrame(v), v = 0, y = null, ae(r, u, d);
|
|
493
493
|
return;
|
|
494
494
|
}
|
|
495
|
-
if (
|
|
495
|
+
if (y = {
|
|
496
496
|
z: Math.log(n.value),
|
|
497
|
-
v:
|
|
497
|
+
v: y?.v ?? 0,
|
|
498
498
|
target: Math.log(r),
|
|
499
499
|
anchor: u,
|
|
500
500
|
at: d
|
|
501
|
-
},
|
|
501
|
+
}, v) return;
|
|
502
502
|
let f = performance.now(), p = (e) => {
|
|
503
|
-
let t =
|
|
503
|
+
let t = y, n = Math.min((e - f) / 1e3, 1 / 30);
|
|
504
504
|
for (f = e; n > 0;) {
|
|
505
505
|
let e = Math.min(n, .004);
|
|
506
506
|
t.v += (-700 * (t.z - t.target) - 1.8 * Math.sqrt(700) * t.v) * e, t.z += t.v * e, n -= e;
|
|
507
507
|
}
|
|
508
508
|
let r = Math.abs(t.z - t.target) < .001 && Math.abs(t.v) < .01;
|
|
509
|
-
|
|
509
|
+
ae(Math.exp(r ? t.target : t.z), t.anchor, t.at), r ? (v = 0, y = null) : v = requestAnimationFrame(p);
|
|
510
510
|
};
|
|
511
|
-
|
|
511
|
+
v = requestAnimationFrame(p);
|
|
512
512
|
}
|
|
513
|
-
function
|
|
514
|
-
n.value = t,
|
|
515
|
-
let a = Math.max(0,
|
|
516
|
-
o.value.left = a,
|
|
513
|
+
function ae(t, r, i) {
|
|
514
|
+
n.value = t, te();
|
|
515
|
+
let a = Math.max(0, h(i) - r);
|
|
516
|
+
o.value.left = a, _(() => {
|
|
517
517
|
e.scroller.value && (e.scroller.value.scrollLeft = a);
|
|
518
518
|
});
|
|
519
519
|
}
|
|
520
|
-
let
|
|
521
|
-
function
|
|
520
|
+
let b = () => y ? Math.exp(y.target) : n.value, oe = () => re(b() * 1.6), S = () => re(b() / 1.6), se = (e) => re(xe[e]);
|
|
521
|
+
function ce(e, t = 24) {
|
|
522
522
|
let n = Math.max((e.max - e.min) / O, 1 / 24);
|
|
523
523
|
re(Math.max(40, s.value - 2 * t) / n, s.value / 2, !1, (e.min + e.max) / 2);
|
|
524
524
|
}
|
|
525
|
-
function
|
|
526
|
-
let r = t ? j(t) : Date.now(), a =
|
|
525
|
+
function C(t, n = {}) {
|
|
526
|
+
let r = t ? j(t) : Date.now(), a = h(r) - (n.align === "start" ? 24 : s.value / 2);
|
|
527
527
|
e.scroller.value?.scrollTo({
|
|
528
528
|
left: Math.max(0, a),
|
|
529
529
|
behavior: n.animate === !1 || i() ? "auto" : "smooth"
|
|
530
530
|
});
|
|
531
531
|
}
|
|
532
|
-
let
|
|
533
|
-
function
|
|
534
|
-
let r = n ? 1 :
|
|
535
|
-
return De(
|
|
536
|
-
let a =
|
|
532
|
+
let le = u(() => Te(n.value)), w = u(() => g(o.value.left - 200)), ue = u(() => g(o.value.left + s.value + 200));
|
|
533
|
+
function de(t, n) {
|
|
534
|
+
let r = n ? 1 : le.value.step;
|
|
535
|
+
return De(w.value, ue.value, t, e.weekStartsOn(), r).map((i) => {
|
|
536
|
+
let a = h(i), o = h(ye(i, t, r)) - a;
|
|
537
537
|
return {
|
|
538
538
|
key: i,
|
|
539
539
|
x: a,
|
|
540
540
|
w: o,
|
|
541
|
-
label:
|
|
541
|
+
label: R(i, t, o, e.lang.value, e.quarterLabel(), n)
|
|
542
542
|
};
|
|
543
543
|
});
|
|
544
544
|
}
|
|
545
|
-
let
|
|
545
|
+
let fe = u(() => de(le.value.bottom, !1)), pe = u(() => le.value.top ? de(le.value.top, !0).map((e) => ({
|
|
546
546
|
...e,
|
|
547
547
|
labelX: Math.max(0, Math.min(o.value.left - e.x, e.w - 80))
|
|
548
|
-
})) : []),
|
|
548
|
+
})) : []), E = u(() => ({
|
|
549
549
|
days: e.calendar()?.workingDays ?? [
|
|
550
550
|
1,
|
|
551
551
|
2,
|
|
@@ -554,54 +554,54 @@ function Ie(e) {
|
|
|
554
554
|
5
|
|
555
555
|
],
|
|
556
556
|
holidays: new Set(e.calendar()?.holidays ?? [])
|
|
557
|
-
})), me =
|
|
557
|
+
})), me = u(() => {
|
|
558
558
|
let t = [];
|
|
559
559
|
if (n.value < 6) return t;
|
|
560
560
|
let r = e.workHours?.();
|
|
561
|
-
for (let e =
|
|
562
|
-
let i =
|
|
563
|
-
if (!
|
|
564
|
-
x:
|
|
565
|
-
w:
|
|
561
|
+
for (let e = P(w.value); e < ue.value; e = F(e, 1)) {
|
|
562
|
+
let i = F(e, 1);
|
|
563
|
+
if (!z(e, E.value.days, E.value.holidays)) t.push({
|
|
564
|
+
x: h(e),
|
|
565
|
+
w: h(i) - h(e)
|
|
566
566
|
});
|
|
567
567
|
else if (r && n.value >= 120) {
|
|
568
568
|
let n = e + r[0] * 36e5, a = e + r[1] * 36e5;
|
|
569
569
|
r[0] > 0 && t.push({
|
|
570
|
-
x:
|
|
571
|
-
w:
|
|
570
|
+
x: h(e),
|
|
571
|
+
w: h(n) - h(e)
|
|
572
572
|
}), r[1] < 24 && t.push({
|
|
573
|
-
x:
|
|
574
|
-
w:
|
|
573
|
+
x: h(a),
|
|
574
|
+
w: h(i) - h(a)
|
|
575
575
|
});
|
|
576
576
|
}
|
|
577
577
|
}
|
|
578
578
|
return t;
|
|
579
579
|
});
|
|
580
|
-
function
|
|
580
|
+
function he(t) {
|
|
581
581
|
if (!t.ctrlKey && !t.metaKey) return;
|
|
582
582
|
t.preventDefault();
|
|
583
583
|
let r = e.scroller.value.getBoundingClientRect(), i = t.clientX - r.left - e.listWidth.value;
|
|
584
584
|
i < 0 || re(n.value * Math.exp(-t.deltaY * .002 * (t.deltaMode === 1 ? 16 : 1)), i, !1);
|
|
585
585
|
}
|
|
586
|
-
let
|
|
587
|
-
function
|
|
586
|
+
let D = null, ge = () => !!D;
|
|
587
|
+
function k(t) {
|
|
588
588
|
if (t.touches.length !== 2) return;
|
|
589
589
|
e.onPinch?.();
|
|
590
590
|
let [r, i] = [t.touches[0], t.touches[1]], a = e.scroller.value.getBoundingClientRect();
|
|
591
|
-
|
|
591
|
+
D = {
|
|
592
592
|
dist: Math.hypot(r.clientX - i.clientX, r.clientY - i.clientY) || 1,
|
|
593
593
|
z: n.value,
|
|
594
594
|
anchor: (r.clientX + i.clientX) / 2 - a.left - e.listWidth.value
|
|
595
595
|
};
|
|
596
596
|
}
|
|
597
|
-
function
|
|
598
|
-
if (!
|
|
597
|
+
function _e(e) {
|
|
598
|
+
if (!D || e.touches.length !== 2) return !1;
|
|
599
599
|
e.cancelable && e.preventDefault();
|
|
600
600
|
let [t, n] = [e.touches[0], e.touches[1]];
|
|
601
|
-
return re(
|
|
601
|
+
return re(D.z * (Math.hypot(t.clientX - n.clientX, t.clientY - n.clientY) / D.dist), D.anchor, !1), !0;
|
|
602
602
|
}
|
|
603
|
-
function
|
|
604
|
-
e.touches.length < 2 && (
|
|
603
|
+
function A(e) {
|
|
604
|
+
e.touches.length < 2 && (D = null);
|
|
605
605
|
}
|
|
606
606
|
function M() {
|
|
607
607
|
let t = e.scroller.value;
|
|
@@ -612,38 +612,38 @@ function Ie(e) {
|
|
|
612
612
|
height: t.clientHeight
|
|
613
613
|
});
|
|
614
614
|
}
|
|
615
|
-
let
|
|
616
|
-
return
|
|
615
|
+
let N;
|
|
616
|
+
return ie(() => {
|
|
617
617
|
let t = e.scroller.value;
|
|
618
|
-
t.addEventListener("wheel",
|
|
618
|
+
t.addEventListener("wheel", he, { passive: !1 }), M(), N = new ResizeObserver(M), N.observe(t), e.today() !== null && (l = setInterval(() => {
|
|
619
619
|
c.value = Date.now();
|
|
620
620
|
}, 6e4));
|
|
621
|
-
}),
|
|
622
|
-
e.scroller.value?.removeEventListener("wheel",
|
|
621
|
+
}), ne(() => {
|
|
622
|
+
e.scroller.value?.removeEventListener("wheel", he), N?.disconnect(), cancelAnimationFrame(v), clearInterval(l);
|
|
623
623
|
}), {
|
|
624
624
|
ppd: n,
|
|
625
625
|
scaleNow: r,
|
|
626
626
|
view: o,
|
|
627
627
|
timelineView: s,
|
|
628
628
|
origin: p,
|
|
629
|
-
timelineWidth:
|
|
629
|
+
timelineWidth: ee,
|
|
630
630
|
todayMs: d,
|
|
631
|
-
xOf:
|
|
632
|
-
timeAt:
|
|
631
|
+
xOf: h,
|
|
632
|
+
timeAt: g,
|
|
633
633
|
zoomTo: re,
|
|
634
|
-
zoomIn:
|
|
635
|
-
zoomOut:
|
|
636
|
-
setScale:
|
|
637
|
-
fit:
|
|
638
|
-
scrollToDate:
|
|
639
|
-
units:
|
|
640
|
-
topCells:
|
|
641
|
-
bottomCells:
|
|
634
|
+
zoomIn: oe,
|
|
635
|
+
zoomOut: S,
|
|
636
|
+
setScale: se,
|
|
637
|
+
fit: ce,
|
|
638
|
+
scrollToDate: C,
|
|
639
|
+
units: le,
|
|
640
|
+
topCells: pe,
|
|
641
|
+
bottomCells: fe,
|
|
642
642
|
offTimes: me,
|
|
643
|
-
onTouchStart:
|
|
644
|
-
pinchMove:
|
|
645
|
-
onTouchEnd:
|
|
646
|
-
pinching:
|
|
643
|
+
onTouchStart: k,
|
|
644
|
+
pinchMove: _e,
|
|
645
|
+
onTouchEnd: A,
|
|
646
|
+
pinching: ge,
|
|
647
647
|
readView: M
|
|
648
648
|
};
|
|
649
649
|
}
|
|
@@ -657,7 +657,7 @@ function Re() {
|
|
|
657
657
|
e.style.cursor = "", e.style.userSelect = "", e.classList.remove("m3-drag-cursor");
|
|
658
658
|
}
|
|
659
659
|
// src/components/_MTimeHeader.vue?vue&type=script&setup=true&lang.ts
|
|
660
|
-
var ze = { class: "absolute inset-x-0 top-0 h-7" },
|
|
660
|
+
var ze = { class: "absolute inset-x-0 top-0 h-7" }, q = { class: "absolute inset-x-0 bottom-0 h-7" }, Be = /* @__PURE__ */ h({
|
|
661
661
|
__name: "_MTimeHeader",
|
|
662
662
|
props: {
|
|
663
663
|
width: {},
|
|
@@ -666,41 +666,41 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
666
666
|
todayX: {}
|
|
667
667
|
},
|
|
668
668
|
setup(e) {
|
|
669
|
-
return (t, n) => (
|
|
669
|
+
return (t, n) => (b(), p("div", {
|
|
670
670
|
class: "relative shrink-0 border-b border-outline-variant bg-surface-container-low",
|
|
671
|
-
style:
|
|
671
|
+
style: y({ width: `${e.width}px` }),
|
|
672
672
|
"aria-hidden": "true"
|
|
673
673
|
}, [
|
|
674
|
-
|
|
674
|
+
m("div", ze, [(b(!0), p(c, null, S(e.topCells, (e) => (b(), p("div", {
|
|
675
675
|
key: e.key,
|
|
676
676
|
class: "absolute inset-y-0 overflow-hidden border-l border-outline-variant/60",
|
|
677
|
-
style:
|
|
677
|
+
style: y({
|
|
678
678
|
left: `${e.x}px`,
|
|
679
679
|
width: `${e.w}px`
|
|
680
680
|
})
|
|
681
|
-
}, [
|
|
681
|
+
}, [m("span", {
|
|
682
682
|
class: "absolute top-1.5 truncate pl-2 text-label-medium whitespace-nowrap text-on-surface",
|
|
683
|
-
style:
|
|
683
|
+
style: y({
|
|
684
684
|
left: `${e.labelX}px`,
|
|
685
685
|
maxWidth: `${Math.max(0, e.w - e.labelX)}px`
|
|
686
686
|
})
|
|
687
|
-
},
|
|
688
|
-
|
|
687
|
+
}, C(e.label), 5)], 4))), 128))]),
|
|
688
|
+
m("div", q, [(b(!0), p(c, null, S(e.bottomCells, (e) => (b(), p("div", {
|
|
689
689
|
key: e.key,
|
|
690
690
|
class: "absolute inset-y-0 flex items-center justify-center overflow-hidden border-l border-outline-variant/60 text-label-small whitespace-nowrap text-on-surface-variant",
|
|
691
|
-
style:
|
|
691
|
+
style: y({
|
|
692
692
|
left: `${e.x}px`,
|
|
693
693
|
width: `${e.w}px`
|
|
694
694
|
})
|
|
695
|
-
},
|
|
696
|
-
e.todayX === null ?
|
|
695
|
+
}, C(e.label), 5))), 128))]),
|
|
696
|
+
e.todayX === null ? f("", !0) : (b(), p("div", {
|
|
697
697
|
key: 0,
|
|
698
698
|
class: "absolute bottom-0 size-2 -translate-x-1/2 translate-y-1/2 rounded-full bg-primary",
|
|
699
|
-
style:
|
|
699
|
+
style: y({ left: `${e.todayX}px` })
|
|
700
700
|
}, null, 4))
|
|
701
701
|
], 4));
|
|
702
702
|
}
|
|
703
|
-
}), Ve = { class: "pointer-events-none absolute inset-0" }, He = /* @__PURE__ */
|
|
703
|
+
}), Ve = { class: "pointer-events-none absolute inset-0" }, He = /* @__PURE__ */ h({
|
|
704
704
|
__name: "_MTimeBackground",
|
|
705
705
|
props: {
|
|
706
706
|
offTimes: {},
|
|
@@ -708,28 +708,28 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
708
708
|
todayX: {}
|
|
709
709
|
},
|
|
710
710
|
setup(e) {
|
|
711
|
-
return (t, n) => (
|
|
712
|
-
(
|
|
711
|
+
return (t, n) => (b(), p("div", Ve, [
|
|
712
|
+
(b(!0), p(c, null, S(e.offTimes, (e) => (b(), p("div", {
|
|
713
713
|
key: `o${e.x}`,
|
|
714
714
|
class: "absolute inset-y-0 bg-on-surface/4",
|
|
715
|
-
style:
|
|
715
|
+
style: y({
|
|
716
716
|
left: `${e.x}px`,
|
|
717
717
|
width: `${e.w}px`
|
|
718
718
|
})
|
|
719
719
|
}, null, 4))), 128)),
|
|
720
|
-
(
|
|
720
|
+
(b(!0), p(c, null, S(e.cells, (e) => (b(), p("div", {
|
|
721
721
|
key: e.key,
|
|
722
722
|
class: "absolute inset-y-0 border-l border-outline-variant/40",
|
|
723
|
-
style:
|
|
723
|
+
style: y({ left: `${e.x}px` })
|
|
724
724
|
}, null, 4))), 128)),
|
|
725
|
-
e.todayX === null ?
|
|
725
|
+
e.todayX === null ? f("", !0) : (b(), p("div", {
|
|
726
726
|
key: 0,
|
|
727
727
|
class: "absolute inset-y-0 z-[1] w-0.5 -translate-x-1/2 bg-primary",
|
|
728
|
-
style:
|
|
728
|
+
style: y({ left: `${e.todayX}px` })
|
|
729
729
|
}, null, 4))
|
|
730
730
|
]));
|
|
731
731
|
}
|
|
732
|
-
}), Ue = ["aria-label", "aria-valuenow"], We = /* @__PURE__ */
|
|
732
|
+
}), Ue = ["aria-label", "aria-valuenow"], We = /* @__PURE__ */ h({
|
|
733
733
|
__name: "_MTimeSplitter",
|
|
734
734
|
props: {
|
|
735
735
|
label: {},
|
|
@@ -738,17 +738,17 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
738
738
|
gripTop: {}
|
|
739
739
|
},
|
|
740
740
|
setup(e) {
|
|
741
|
-
return (t, n) => (
|
|
741
|
+
return (t, n) => (b(), p("div", {
|
|
742
742
|
role: "separator",
|
|
743
743
|
"aria-orientation": "vertical",
|
|
744
744
|
"aria-label": e.label,
|
|
745
745
|
"aria-valuenow": e.value,
|
|
746
746
|
tabindex: "0",
|
|
747
747
|
class: "group/split absolute inset-y-0 -right-1 z-30 w-2 cursor-col-resize touch-none outline-none pointer-coarse:-right-3 pointer-coarse:w-6"
|
|
748
|
-
}, [
|
|
749
|
-
class:
|
|
750
|
-
style:
|
|
751
|
-
}, [(
|
|
748
|
+
}, [m("span", { class: v(["pointer-events-none absolute inset-y-0 left-1/2 w-0.5 -translate-x-1/2 transition-colors duration-150 group-hover/split:bg-primary group-focus-visible/split:bg-primary", e.active ? "bg-primary" : "bg-transparent"]) }, null, 2), m("span", {
|
|
749
|
+
class: v(["pointer-events-none absolute left-1/2 flex h-8 w-3 -translate-1/2 flex-col items-center justify-center gap-[3px] rounded-full border transition-colors duration-150 pointer-coarse:h-10 pointer-coarse:w-4", e.active ? "border-primary bg-primary text-on-primary" : "border-outline-variant bg-surface-container-high text-on-surface-variant group-hover/split:border-primary group-hover/split:bg-primary group-hover/split:text-on-primary group-focus-visible/split:border-primary group-focus-visible/split:bg-primary group-focus-visible/split:text-on-primary"]),
|
|
750
|
+
style: y({ top: `${e.gripTop}px` })
|
|
751
|
+
}, [(b(), p(c, null, S(3, (e) => m("span", {
|
|
752
752
|
key: e,
|
|
753
753
|
class: "size-[3px] rounded-full bg-current"
|
|
754
754
|
})), 64))], 6)], 8, Ue));
|
|
@@ -795,13 +795,13 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
795
795
|
key: 0,
|
|
796
796
|
class: "truncate",
|
|
797
797
|
style: { transform: "translateX(var(--m3-gantt-label-x, 0px))" }
|
|
798
|
-
}, ut = ["data-gantt-resize", "onPointerdown"],
|
|
798
|
+
}, ut = ["data-gantt-resize", "onPointerdown"], J = {
|
|
799
799
|
key: 5,
|
|
800
800
|
class: "pointer-events-none absolute top-1/2 left-full ml-2 -translate-y-1/2 text-label-medium whitespace-nowrap text-on-surface-variant"
|
|
801
801
|
}, dt = ["onPointerdown"], ft = ["onPointerdown"], pt = { class: "text-body-medium text-on-surface-variant" }, mt = { class: "text-title-small" }, ht = { class: "text-body-small text-on-surface-variant" }, gt = {
|
|
802
802
|
class: "sr-only",
|
|
803
803
|
"aria-live": "polite"
|
|
804
|
-
}, _t = 56, vt = 6, yt = 10,
|
|
804
|
+
}, _t = 56, vt = 6, yt = 10, Y = /* @__PURE__ */ h({
|
|
805
805
|
__name: "MGantt",
|
|
806
806
|
props: {
|
|
807
807
|
tasks: { default: () => [] },
|
|
@@ -851,72 +851,72 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
851
851
|
"change",
|
|
852
852
|
"delete"
|
|
853
853
|
],
|
|
854
|
-
setup(r, { expose:
|
|
855
|
-
let
|
|
856
|
-
|
|
854
|
+
setup(r, { expose: s, emit: h }) {
|
|
855
|
+
let g = r, D = h, ge = ue(), k = a(), _e = u(() => g.locale ?? (k.lang === "en" ? void 0 : k.lang)), A = ce(g.tasks);
|
|
856
|
+
T(() => g.tasks, (e) => {
|
|
857
857
|
A.value = e;
|
|
858
858
|
});
|
|
859
|
-
let
|
|
859
|
+
let M = ce(null), P = u(() => Me(le(A.value))), I = u(() => M.value ?? P.value), ye = [], xe = [], Se = x(0);
|
|
860
860
|
function Ce(e) {
|
|
861
861
|
A.value = e, D("update:tasks", e);
|
|
862
862
|
}
|
|
863
|
-
function
|
|
864
|
-
e = Me(e), e !==
|
|
863
|
+
function L(e) {
|
|
864
|
+
e = Me(e), e !== P.value && (ye.push(le(A.value)), ye.length > 100 && ye.shift(), xe.length = 0, Se.value++, Ce(e));
|
|
865
865
|
}
|
|
866
866
|
function we() {
|
|
867
867
|
let e = ye.pop();
|
|
868
|
-
e && (xe.push(
|
|
868
|
+
e && (xe.push(le(A.value)), Se.value++, Ce(e));
|
|
869
869
|
}
|
|
870
870
|
function Te() {
|
|
871
871
|
let e = xe.pop();
|
|
872
|
-
e && (ye.push(
|
|
872
|
+
e && (ye.push(le(A.value)), Se.value++, Ce(e));
|
|
873
873
|
}
|
|
874
|
-
let Ee =
|
|
874
|
+
let Ee = u(() => (Se.value, ye.length > 0)), De = u(() => (Se.value, xe.length > 0)), R = u(() => new Map(I.value.map((e) => [e.id, e]))), z = u(() => Ae(I.value)), U = u(() => {
|
|
875
875
|
let e = /* @__PURE__ */ new Map();
|
|
876
|
-
for (let t of
|
|
877
|
-
let n = t.parentId &&
|
|
876
|
+
for (let t of I.value) {
|
|
877
|
+
let n = t.parentId && R.value.has(t.parentId) ? t.parentId : void 0;
|
|
878
878
|
(e.get(n) ?? e.set(n, []).get(n)).push(t);
|
|
879
879
|
}
|
|
880
880
|
return e;
|
|
881
881
|
});
|
|
882
882
|
function Ne(e, t = [], n = 0) {
|
|
883
883
|
if (n > 100) return t;
|
|
884
|
-
for (let r of
|
|
884
|
+
for (let r of U.value.get(e) ?? []) t.push(r.id), Ne(r.id, t, n + 1);
|
|
885
885
|
return t;
|
|
886
886
|
}
|
|
887
|
-
let
|
|
888
|
-
|
|
889
|
-
e && (
|
|
887
|
+
let W = x(g.selection ?? []);
|
|
888
|
+
T(() => g.selection, (e) => {
|
|
889
|
+
e && (W.value = e);
|
|
890
890
|
});
|
|
891
|
-
let
|
|
892
|
-
function
|
|
893
|
-
let t = e.filter((e) =>
|
|
894
|
-
|
|
891
|
+
let G = u(() => new Set(W.value));
|
|
892
|
+
function K(e) {
|
|
893
|
+
let t = e.filter((e) => R.value.get(e)?.selectable !== !1);
|
|
894
|
+
W.value = t, D("update:selection", t);
|
|
895
895
|
}
|
|
896
|
-
let ze =
|
|
897
|
-
|
|
896
|
+
let ze = x(g.collapsed ?? []);
|
|
897
|
+
T(() => g.collapsed, (e) => {
|
|
898
898
|
e && (ze.value = e);
|
|
899
899
|
});
|
|
900
|
-
let
|
|
900
|
+
let q = u(() => new Set(ze.value));
|
|
901
901
|
function Ve(e) {
|
|
902
902
|
ze.value = e, D("update:collapsed", e);
|
|
903
903
|
}
|
|
904
904
|
function Ue(e, t) {
|
|
905
|
-
Ve(t ??
|
|
905
|
+
Ve(t ?? q.value.has(e) ? ze.value.filter((t) => t !== e) : [...ze.value, e]);
|
|
906
906
|
}
|
|
907
|
-
let
|
|
907
|
+
let Y = u(() => {
|
|
908
908
|
let e = [], t = (n, r) => {
|
|
909
|
-
for (let i of
|
|
910
|
-
let n =
|
|
909
|
+
for (let i of U.value.get(n) ?? []) {
|
|
910
|
+
let n = U.value.has(i.id);
|
|
911
911
|
e.push({
|
|
912
912
|
task: i,
|
|
913
913
|
depth: r,
|
|
914
914
|
parent: n
|
|
915
|
-
}), n && !
|
|
915
|
+
}), n && !q.value.has(i.id) && r < 100 && t(i.id, r + 1);
|
|
916
916
|
}
|
|
917
917
|
};
|
|
918
918
|
return t(void 0, 0), e;
|
|
919
|
-
}), bt =
|
|
919
|
+
}), bt = u(() => new Map(Y.value.map((e, t) => [e.task.id, t]))), X = x(), xt = u(() => [
|
|
920
920
|
{
|
|
921
921
|
key: "name",
|
|
922
922
|
label: k.ganttTask
|
|
@@ -934,26 +934,26 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
934
934
|
align: "end",
|
|
935
935
|
hideBelow: 600
|
|
936
936
|
}
|
|
937
|
-
]), St =
|
|
938
|
-
|
|
937
|
+
]), St = u(() => g.columns ?? xt.value), Ct = x(g.gridCollapsed ?? !1);
|
|
938
|
+
T(() => g.gridCollapsed, (e) => {
|
|
939
939
|
e !== void 0 && (Ct.value = e);
|
|
940
940
|
});
|
|
941
941
|
function wt(e) {
|
|
942
942
|
e !== Ct.value && (Ct.value = e, D("update:gridCollapsed", e));
|
|
943
943
|
}
|
|
944
|
-
let Tt =
|
|
945
|
-
|
|
944
|
+
let Tt = u(() => St.value.length > 0 && !Ct.value), Et = g.gridWidth ?? 320, Dt = x(Et);
|
|
945
|
+
T(() => g.gridWidth, (e) => {
|
|
946
946
|
e !== void 0 && (Dt.value = e, Et = e);
|
|
947
947
|
});
|
|
948
948
|
function Ot(e) {
|
|
949
949
|
Dt.value = e, D("update:gridWidth", e);
|
|
950
950
|
}
|
|
951
|
-
let kt =
|
|
951
|
+
let kt = u(() => Tt.value ? Dt.value : 0), At = u(() => {
|
|
952
952
|
let e = Infinity, t = -Infinity;
|
|
953
|
-
for (let n of
|
|
954
|
-
let r =
|
|
955
|
-
if (Number.isFinite(r.start) && (e = Math.min(e, r.start), t = Math.max(t, r.end),
|
|
956
|
-
let r =
|
|
953
|
+
for (let n of I.value) {
|
|
954
|
+
let r = V(n);
|
|
955
|
+
if (Number.isFinite(r.start) && (e = Math.min(e, r.start), t = Math.max(t, r.end), g.baselines && n.baselineStart)) {
|
|
956
|
+
let r = V({
|
|
957
957
|
start: n.baselineStart,
|
|
958
958
|
end: n.baselineEnd,
|
|
959
959
|
type: n.type
|
|
@@ -961,42 +961,42 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
961
961
|
Number.isFinite(r.start) && (e = Math.min(e, r.start), t = Math.max(t, r.end));
|
|
962
962
|
}
|
|
963
963
|
}
|
|
964
|
-
return Number.isFinite(e) || (e = t =
|
|
964
|
+
return Number.isFinite(e) || (e = t = g.today ? j(g.today) : Date.now()), {
|
|
965
965
|
min: e,
|
|
966
966
|
max: t
|
|
967
967
|
};
|
|
968
968
|
}), jt = Ie({
|
|
969
|
-
scroller:
|
|
969
|
+
scroller: X,
|
|
970
970
|
listWidth: kt,
|
|
971
971
|
headerHeight: _t,
|
|
972
972
|
extent: At,
|
|
973
|
-
scale: () =>
|
|
974
|
-
pxPerDay: () =>
|
|
975
|
-
minPxPerDay: () =>
|
|
976
|
-
maxPxPerDay: () =>
|
|
977
|
-
weekStartsOn: () =>
|
|
978
|
-
lang:
|
|
973
|
+
scale: () => g.scale,
|
|
974
|
+
pxPerDay: () => g.pxPerDay,
|
|
975
|
+
minPxPerDay: () => g.minPxPerDay,
|
|
976
|
+
maxPxPerDay: () => g.maxPxPerDay,
|
|
977
|
+
weekStartsOn: () => g.weekStartsOn,
|
|
978
|
+
lang: _e,
|
|
979
979
|
quarterLabel: () => k.ganttQuarter,
|
|
980
|
-
today: () =>
|
|
981
|
-
calendar: () =>
|
|
980
|
+
today: () => g.today,
|
|
981
|
+
calendar: () => g.calendar,
|
|
982
982
|
onScale: (e) => D("update:scale", e),
|
|
983
983
|
onPinch: () => {
|
|
984
|
-
|
|
984
|
+
$ && sr({ pointerId: $.id });
|
|
985
985
|
}
|
|
986
|
-
}), { ppd: Mt, view:
|
|
986
|
+
}), { ppd: Mt, view: Z, timelineView: Nt, origin: Pt, timelineWidth: Q, todayMs: Ft, xOf: It, timeAt: Lt, zoomIn: Rt, zoomOut: zt, setScale: Bt, scrollToDate: Vt, topCells: Ht, bottomCells: Ut, offTimes: Wt } = jt, Gt = jt.scaleNow;
|
|
987
987
|
function Kt() {
|
|
988
|
-
|
|
988
|
+
I.value.length && jt.fit(At.value);
|
|
989
989
|
}
|
|
990
|
-
let qt =
|
|
990
|
+
let qt = u(() => Z.value.width > 0 && Z.value.width < 600), Jt = u(() => qt.value ? 12 : 20), Yt = u(() => St.value.filter((e) => !e.hideBelow || !Z.value.width || Z.value.width >= e.hideBelow));
|
|
991
991
|
function Xt(e) {
|
|
992
|
-
let t =
|
|
993
|
-
for (let e = t?.parentId; e &&
|
|
994
|
-
n.length && Ve(ze.value.filter((e) => !n.includes(e))),
|
|
995
|
-
t =
|
|
992
|
+
let t = R.value.get(e), n = [];
|
|
993
|
+
for (let e = t?.parentId; e && R.value.has(e); e = R.value.get(e).parentId) q.value.has(e) && n.push(e);
|
|
994
|
+
n.length && Ve(ze.value.filter((e) => !n.includes(e))), _(() => {
|
|
995
|
+
t = R.value.get(e);
|
|
996
996
|
let n = bt.value.get(e);
|
|
997
|
-
if (!t || n === void 0 || !
|
|
998
|
-
let r =
|
|
999
|
-
a < s ? s = a : a +
|
|
997
|
+
if (!t || n === void 0 || !X.value) return;
|
|
998
|
+
let r = V(t), a = n * g.rowHeight, o = X.value, s = o.scrollTop, c = o.clientHeight - _t;
|
|
999
|
+
a < s ? s = a : a + g.rowHeight > s + c && (s = a + g.rowHeight - c);
|
|
1000
1000
|
let l = o.scrollLeft, u = It(r.start);
|
|
1001
1001
|
(u < l || u > l + Nt.value - 40) && (l = Math.max(0, u - 48)), o.scrollTo({
|
|
1002
1002
|
left: l,
|
|
@@ -1005,16 +1005,16 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1005
1005
|
});
|
|
1006
1006
|
});
|
|
1007
1007
|
}
|
|
1008
|
-
let Zt =
|
|
1008
|
+
let Zt = u(() => Math.max(0, Math.floor(Z.value.top / g.rowHeight) - vt)), Qt = u(() => Math.min(Y.value.length, Math.ceil((Z.value.top + Z.value.height) / g.rowHeight) + vt)), $t = u(() => Y.value.slice(Zt.value, Qt.value).map((e, t) => ({
|
|
1009
1009
|
...e,
|
|
1010
1010
|
index: Zt.value + t
|
|
1011
|
-
}))), en =
|
|
1011
|
+
}))), en = u(() => Math.max(Y.value.length * g.rowHeight, Z.value.height - _t)), tn = u(() => Math.round(g.rowHeight * .6)), nn = u(() => g.criticalPath ? Fe(I.value, { calendar: g.calendar }) : null), rn = u(() => nn.value ?? Fe(I.value, { calendar: g.calendar })), an = u(() => new Set(nn.value?.tasks ?? [])), on = u(() => new Set(nn.value?.dependencies ?? [])), sn = u(() => {
|
|
1012
1012
|
let e = /* @__PURE__ */ new Map();
|
|
1013
|
-
for (let t of
|
|
1014
|
-
let n =
|
|
1013
|
+
for (let t of I.value) {
|
|
1014
|
+
let n = V(t);
|
|
1015
1015
|
Number.isFinite(n.start) && e.set(t.id, {
|
|
1016
1016
|
x: It(n.start),
|
|
1017
|
-
w:
|
|
1017
|
+
w: B(t) ? 0 : Math.max(2, It(n.end) - It(n.start))
|
|
1018
1018
|
});
|
|
1019
1019
|
}
|
|
1020
1020
|
return e;
|
|
@@ -1022,7 +1022,7 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1022
1022
|
ppd: Mt.value,
|
|
1023
1023
|
origin: Pt.value
|
|
1024
1024
|
};
|
|
1025
|
-
|
|
1025
|
+
T(sn, (e) => {
|
|
1026
1026
|
let t = fn.ppd !== Mt.value || fn.origin !== Pt.value || i();
|
|
1027
1027
|
fn = {
|
|
1028
1028
|
ppd: Mt.value,
|
|
@@ -1066,24 +1066,24 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1066
1066
|
let n = cn.get(e);
|
|
1067
1067
|
if (!n) return;
|
|
1068
1068
|
t.style.transform = `translateX(${n.x}px)`, t.style.width = `${n.w}px`;
|
|
1069
|
-
let r =
|
|
1069
|
+
let r = R.value.get(e)?.name ?? "", i = Math.max(0, Math.min(Z.value.left - n.x, n.w - (r.length * 7 + 24)));
|
|
1070
1070
|
t.style.setProperty("--m3-gantt-label-x", `${i}px`);
|
|
1071
1071
|
}
|
|
1072
1072
|
function hn() {
|
|
1073
1073
|
for (let [e, t] of ln) mn(e, t);
|
|
1074
1074
|
for (let [e, t] of un) Cn(e, t);
|
|
1075
1075
|
}
|
|
1076
|
-
|
|
1076
|
+
T(() => Z.value.left, () => {
|
|
1077
1077
|
for (let [e, t] of ln) mn(e, t);
|
|
1078
1078
|
});
|
|
1079
1079
|
function gn(e, t) {
|
|
1080
1080
|
t instanceof HTMLElement ? (ln.set(e, t), mn(e, t)) : ln.delete(e);
|
|
1081
1081
|
}
|
|
1082
|
-
let _n = (e) => cn.get(e) ?? sn.value.get(e), vn =
|
|
1082
|
+
let _n = (e) => cn.get(e) ?? sn.value.get(e), vn = u(() => {
|
|
1083
1083
|
let e = [];
|
|
1084
|
-
for (let t of
|
|
1084
|
+
for (let t of I.value) for (let n of t.dependencies ?? []) {
|
|
1085
1085
|
let r = ke(n);
|
|
1086
|
-
|
|
1086
|
+
R.value.has(r.id) && e.push({
|
|
1087
1087
|
key: `${r.id}>${t.id}`,
|
|
1088
1088
|
from: r.id,
|
|
1089
1089
|
to: t.id,
|
|
@@ -1094,14 +1094,14 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1094
1094
|
return e;
|
|
1095
1095
|
});
|
|
1096
1096
|
function yn(e) {
|
|
1097
|
-
let t =
|
|
1097
|
+
let t = R.value.get(e);
|
|
1098
1098
|
for (let e = 0; t && e < 100; e++) {
|
|
1099
1099
|
let e = bt.value.get(t.id);
|
|
1100
1100
|
if (e !== void 0) return e;
|
|
1101
|
-
t = t.parentId ?
|
|
1101
|
+
t = t.parentId ? R.value.get(t.parentId) : void 0;
|
|
1102
1102
|
}
|
|
1103
1103
|
}
|
|
1104
|
-
let bn =
|
|
1104
|
+
let bn = u(() => {
|
|
1105
1105
|
let e = Zt.value, t = Qt.value;
|
|
1106
1106
|
return vn.value.filter((n) => {
|
|
1107
1107
|
let r = yn(n.from), i = yn(n.to);
|
|
@@ -1111,21 +1111,21 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1111
1111
|
function xn(e) {
|
|
1112
1112
|
let t = yn(e.from), n = yn(e.to);
|
|
1113
1113
|
if (t === void 0 || n === void 0) return null;
|
|
1114
|
-
let r = _n(
|
|
1114
|
+
let r = _n(Y.value[t].task.id), i = _n(Y.value[n].task.id);
|
|
1115
1115
|
if (!r || !i) return null;
|
|
1116
|
-
let a =
|
|
1116
|
+
let a = g.rowHeight, o = t * a + a / 2, s = n * a + a / 2, c = e.type === "FS" || e.type === "FF", l = e.type === "FS" || e.type === "SS", u = (e) => e.w ? 0 : tn.value * .4, d = c ? r.x + r.w + u(r) : r.x - u(r), f = l ? i.x - u(i) : i.x + i.w + u(i), p = d + (c ? yt : -10), m = f + (l ? -10 : yt);
|
|
1117
1117
|
if (l ? p <= m : p >= m) return [
|
|
1118
1118
|
[d, o],
|
|
1119
1119
|
[p, o],
|
|
1120
1120
|
[p, s],
|
|
1121
1121
|
[f, s]
|
|
1122
1122
|
];
|
|
1123
|
-
let
|
|
1123
|
+
let ee = s > o ? n * a : (n + 1) * a;
|
|
1124
1124
|
return [
|
|
1125
1125
|
[d, o],
|
|
1126
1126
|
[p, o],
|
|
1127
|
-
[p,
|
|
1128
|
-
[m,
|
|
1127
|
+
[p, ee],
|
|
1128
|
+
[m, ee],
|
|
1129
1129
|
[m, s],
|
|
1130
1130
|
[f, s]
|
|
1131
1131
|
];
|
|
@@ -1138,8 +1138,8 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1138
1138
|
n += ` L${o},${s}`;
|
|
1139
1139
|
continue;
|
|
1140
1140
|
}
|
|
1141
|
-
let p = o - (o - i) / u * f, m = s - (s - a) / u * f,
|
|
1142
|
-
n += ` L${p},${m} Q${o},${s} ${
|
|
1141
|
+
let p = o - (o - i) / u * f, m = s - (s - a) / u * f, ee = o + (c - o) / d * f, te = s + (l - s) / d * f;
|
|
1142
|
+
n += ` L${p},${m} Q${o},${s} ${ee},${te}`;
|
|
1143
1143
|
}
|
|
1144
1144
|
let [r, i] = e.at(-1);
|
|
1145
1145
|
return `${n} L${r},${i}`;
|
|
@@ -1153,7 +1153,7 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1153
1153
|
function wn(e, t) {
|
|
1154
1154
|
t instanceof SVGGElement ? (un.set(e, t), Cn(e, t)) : un.delete(e);
|
|
1155
1155
|
}
|
|
1156
|
-
let Tn =
|
|
1156
|
+
let Tn = x(null), En = u(() => {
|
|
1157
1157
|
let e = vn.value.find((e) => e.key === Tn.value), t = e && xn(e);
|
|
1158
1158
|
if (!t) return null;
|
|
1159
1159
|
let n = Math.floor((t.length - 1) / 2);
|
|
@@ -1163,13 +1163,13 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1163
1163
|
};
|
|
1164
1164
|
});
|
|
1165
1165
|
function Dn(e, t) {
|
|
1166
|
-
A.value.find((e) => e.id === t)?.dependencies?.some((t) => ke(t).id === e) && (
|
|
1166
|
+
A.value.find((e) => e.id === t)?.dependencies?.some((t) => ke(t).id === e) && (L(A.value.map((n) => n.id === t ? {
|
|
1167
1167
|
...n,
|
|
1168
1168
|
dependencies: n.dependencies.filter((t) => ke(t).id !== e)
|
|
1169
1169
|
} : n)), Tn.value === `${e}>${t}` && (Tn.value = null), D("unlink", {
|
|
1170
1170
|
from: e,
|
|
1171
1171
|
to: t
|
|
1172
|
-
}),
|
|
1172
|
+
}), Fr(k.ganttUnlink));
|
|
1173
1173
|
}
|
|
1174
1174
|
function On(e, t) {
|
|
1175
1175
|
let n = /* @__PURE__ */ new Set(), r = [e];
|
|
@@ -1178,14 +1178,14 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1178
1178
|
if (e === t) return !0;
|
|
1179
1179
|
if (!n.has(e)) {
|
|
1180
1180
|
n.add(e);
|
|
1181
|
-
for (let t of
|
|
1181
|
+
for (let t of R.value.get(e)?.dependencies ?? []) r.push(ke(t).id);
|
|
1182
1182
|
}
|
|
1183
1183
|
}
|
|
1184
1184
|
return !1;
|
|
1185
1185
|
}
|
|
1186
1186
|
function kn(e, t) {
|
|
1187
|
-
if (e === t ||
|
|
1188
|
-
let n =
|
|
1187
|
+
if (e === t || g.readonly) return !1;
|
|
1188
|
+
let n = R.value.get(e), r = R.value.get(t);
|
|
1189
1189
|
return !n || !r || n.linkable === !1 || r.linkable === !1 || Ne(e).includes(t) || Ne(t).includes(e) || r.dependencies?.some((t) => ke(t).id === e) ? !1 : !On(e, t);
|
|
1190
1190
|
}
|
|
1191
1191
|
function An(e, t, n = "FS", r = 0) {
|
|
@@ -1198,13 +1198,16 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1198
1198
|
...e,
|
|
1199
1199
|
dependencies: [...e.dependencies ?? [], i]
|
|
1200
1200
|
} : e);
|
|
1201
|
-
|
|
1201
|
+
g.schedule === "auto" && (a = Pe(a, jn())), L(a), D("link", {
|
|
1202
1202
|
from: e,
|
|
1203
1203
|
to: t,
|
|
1204
1204
|
type: n
|
|
1205
|
-
}),
|
|
1205
|
+
}), Fr(o(k.ganttLinked, {
|
|
1206
|
+
from: R.value.get(e)?.name ?? e,
|
|
1207
|
+
to: R.value.get(t)?.name ?? t
|
|
1208
|
+
}, k.lang));
|
|
1206
1209
|
}
|
|
1207
|
-
let jn = () => ({ calendar:
|
|
1210
|
+
let jn = () => ({ calendar: g.calendar ? g.calendar : void 0 });
|
|
1208
1211
|
function Mn(e, t = {}) {
|
|
1209
1212
|
let n = Array.isArray(e) ? e : [e], r = [...A.value], i = t.after ? r.findIndex((e) => e.id === t.after) : -1;
|
|
1210
1213
|
if (i >= 0) {
|
|
@@ -1212,19 +1215,19 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1212
1215
|
for (; i + 1 < r.length && e.has(r[i + 1].id);) i++;
|
|
1213
1216
|
r.splice(i + 1, 0, ...n);
|
|
1214
1217
|
} else r.push(...n);
|
|
1215
|
-
|
|
1218
|
+
L(r);
|
|
1216
1219
|
}
|
|
1217
1220
|
function Nn(e, t) {
|
|
1218
1221
|
let n = A.value.map((n) => n.id === e ? typeof t == "function" ? t(n) : {
|
|
1219
1222
|
...n,
|
|
1220
1223
|
...t
|
|
1221
1224
|
} : n);
|
|
1222
|
-
|
|
1225
|
+
g.schedule === "auto" && (n = Pe(n, jn())), L(n);
|
|
1223
1226
|
}
|
|
1224
1227
|
async function Pn(e) {
|
|
1225
1228
|
let t = /* @__PURE__ */ new Set();
|
|
1226
1229
|
for (let n of e) {
|
|
1227
|
-
let e =
|
|
1230
|
+
let e = R.value.get(n);
|
|
1228
1231
|
if (e && e.deletable !== !1) {
|
|
1229
1232
|
t.add(n);
|
|
1230
1233
|
for (let e of Ne(n)) t.add(e);
|
|
@@ -1232,108 +1235,108 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1232
1235
|
}
|
|
1233
1236
|
if (!t.size) return;
|
|
1234
1237
|
let n = A.value.filter((e) => t.has(e.id));
|
|
1235
|
-
(!
|
|
1238
|
+
(!g.beforeDelete || await g.beforeDelete(n)) && (L(A.value.filter((e) => !t.has(e.id)).map((e) => e.dependencies?.some((e) => t.has(ke(e).id)) ? {
|
|
1236
1239
|
...e,
|
|
1237
1240
|
dependencies: e.dependencies.filter((e) => !t.has(ke(e).id))
|
|
1238
|
-
} : e)),
|
|
1241
|
+
} : e)), K(W.value.filter((e) => !t.has(e))), D("delete", { tasks: n }), Fr(o(k.ganttDeleted, { count: String(n.length) }, k.lang)));
|
|
1239
1242
|
}
|
|
1240
1243
|
function Fn(e) {
|
|
1241
|
-
|
|
1244
|
+
L(Pe(A.value, {
|
|
1242
1245
|
...jn(),
|
|
1243
1246
|
...e
|
|
1244
1247
|
}));
|
|
1245
1248
|
}
|
|
1246
1249
|
function In(e) {
|
|
1247
|
-
let t = e - (
|
|
1248
|
-
return
|
|
1250
|
+
let t = e - (X.value?.getBoundingClientRect()?.left ?? 0) - kt.value + Z.value.left;
|
|
1251
|
+
return N(be(Lt(t), 1440), !0);
|
|
1249
1252
|
}
|
|
1250
|
-
let
|
|
1253
|
+
let $ = null, Ln, Rn = x(null), zn = x(!1), Bn = x(null), Vn = x(null), Hn = {
|
|
1251
1254
|
x: 0,
|
|
1252
1255
|
y: 0
|
|
1253
1256
|
};
|
|
1254
|
-
function
|
|
1255
|
-
let n =
|
|
1257
|
+
function Un(e, t) {
|
|
1258
|
+
let n = X.value.getBoundingClientRect();
|
|
1256
1259
|
return {
|
|
1257
|
-
x: e - n.left - kt.value +
|
|
1258
|
-
y: t - n.top - _t +
|
|
1260
|
+
x: e - n.left - kt.value + X.value.scrollLeft,
|
|
1261
|
+
y: t - n.top - _t + X.value.scrollTop
|
|
1259
1262
|
};
|
|
1260
1263
|
}
|
|
1261
|
-
let
|
|
1262
|
-
function
|
|
1264
|
+
let Wn = (e) => e instanceof Element && !!e.closest("input, textarea, select, button, a, [contenteditable], [data-gantt-action]");
|
|
1265
|
+
function Gn(e) {
|
|
1263
1266
|
if (e.pointerType === "touch") return;
|
|
1264
1267
|
e.preventDefault();
|
|
1265
1268
|
let t = document.activeElement;
|
|
1266
1269
|
t instanceof HTMLElement && t.matches("[data-gantt-rename]") && t.blur();
|
|
1267
1270
|
}
|
|
1268
|
-
function
|
|
1269
|
-
if (e.button !== 0 ||
|
|
1270
|
-
e.stopPropagation(),
|
|
1271
|
+
function Kn(e, t, n) {
|
|
1272
|
+
if (e.button !== 0 || Wn(e.target) || g.readonly && n !== "body") return;
|
|
1273
|
+
e.stopPropagation(), Gn(e), hr.value?.id !== t.id && (hr.value = null);
|
|
1271
1274
|
let r = e.pointerType === "touch";
|
|
1272
|
-
|
|
1275
|
+
$ = {
|
|
1273
1276
|
kind: "bar",
|
|
1274
1277
|
part: n,
|
|
1275
1278
|
id: e.pointerId,
|
|
1276
1279
|
taskId: t.id,
|
|
1277
1280
|
sx: e.clientX,
|
|
1278
1281
|
sy: e.clientY,
|
|
1279
|
-
sl:
|
|
1280
|
-
st:
|
|
1282
|
+
sl: X.value.scrollLeft,
|
|
1283
|
+
st: X.value.scrollTop,
|
|
1281
1284
|
touch: r,
|
|
1282
1285
|
active: !1,
|
|
1283
1286
|
spans: /* @__PURE__ */ new Map(),
|
|
1284
1287
|
moving: []
|
|
1285
|
-
},
|
|
1288
|
+
}, Xn(), r && n === "body" ? Ln = setTimeout(() => Qn(e), 250) : r && Qn(e);
|
|
1286
1289
|
}
|
|
1287
|
-
function
|
|
1288
|
-
|
|
1290
|
+
function qn(e) {
|
|
1291
|
+
hr.value = null, e.button !== 0 || e.pointerType === "touch" || Wn(e.target) || (Gn(e), $ = {
|
|
1289
1292
|
kind: "pan",
|
|
1290
1293
|
id: e.pointerId,
|
|
1291
1294
|
sx: e.clientX,
|
|
1292
1295
|
sy: e.clientY,
|
|
1293
|
-
sl:
|
|
1294
|
-
st:
|
|
1296
|
+
sl: X.value.scrollLeft,
|
|
1297
|
+
st: X.value.scrollTop,
|
|
1295
1298
|
moved: !1
|
|
1296
|
-
},
|
|
1299
|
+
}, Xn());
|
|
1297
1300
|
}
|
|
1298
|
-
function
|
|
1299
|
-
if (e.button !== 0 ||
|
|
1301
|
+
function Jn(e, t) {
|
|
1302
|
+
if (e.button !== 0 || Wn(e.target) || g.readonly || Ir.value) return;
|
|
1300
1303
|
let n = e.pointerType === "touch";
|
|
1301
|
-
|
|
1304
|
+
$ = {
|
|
1302
1305
|
kind: "row",
|
|
1303
1306
|
id: e.pointerId,
|
|
1304
1307
|
taskId: t.id,
|
|
1305
1308
|
sx: e.clientX,
|
|
1306
1309
|
sy: e.clientY,
|
|
1307
|
-
st:
|
|
1310
|
+
st: X.value.scrollTop,
|
|
1308
1311
|
touch: n,
|
|
1309
1312
|
active: !1
|
|
1310
|
-
},
|
|
1313
|
+
}, Xn(), n && (Ln = setTimeout(() => Qn(e), 350));
|
|
1311
1314
|
}
|
|
1312
|
-
function
|
|
1313
|
-
e.button === 0 && (e.preventDefault(),
|
|
1315
|
+
function Yn(e) {
|
|
1316
|
+
e.button === 0 && (e.preventDefault(), $ = {
|
|
1314
1317
|
kind: "split",
|
|
1315
1318
|
id: e.pointerId,
|
|
1316
1319
|
sx: e.clientX,
|
|
1317
1320
|
w: Dt.value
|
|
1318
|
-
}, zn.value = !0, Le("col-resize"),
|
|
1319
|
-
}
|
|
1320
|
-
function Yn() {
|
|
1321
|
-
window.addEventListener("pointermove", Qn), window.addEventListener("pointerup", ar), window.addEventListener("pointercancel", or);
|
|
1321
|
+
}, zn.value = !0, Le("col-resize"), Xn());
|
|
1322
1322
|
}
|
|
1323
1323
|
function Xn() {
|
|
1324
|
-
window.
|
|
1324
|
+
window.addEventListener("pointermove", $n), window.addEventListener("pointerup", or), window.addEventListener("pointercancel", sr);
|
|
1325
|
+
}
|
|
1326
|
+
function Zn() {
|
|
1327
|
+
window.removeEventListener("pointermove", $n), window.removeEventListener("pointerup", or), window.removeEventListener("pointercancel", sr), clearTimeout(Ln), Re(), zn.value = !1;
|
|
1325
1328
|
}
|
|
1326
|
-
function
|
|
1327
|
-
let t =
|
|
1329
|
+
function Qn(e) {
|
|
1330
|
+
let t = $;
|
|
1328
1331
|
if (!t || t.kind !== "bar" && t.kind !== "row" || t.active) return;
|
|
1329
|
-
let n =
|
|
1332
|
+
let n = R.value.get(t.taskId);
|
|
1330
1333
|
if (!n) return;
|
|
1331
1334
|
if (t.kind === "bar") {
|
|
1332
|
-
if (t.part === "body" && (
|
|
1335
|
+
if (t.part === "body" && (g.readonly || n.draggable === !1) || (t.part === "start" || t.part === "end") && n.resizable === !1 || (t.part === "link-start" || t.part === "link-end") && n.linkable === !1) return;
|
|
1333
1336
|
t.active = !0;
|
|
1334
|
-
let r = t.part === "body" &&
|
|
1337
|
+
let r = t.part === "body" && G.value.has(n.id) ? W.value : [n.id], i = /* @__PURE__ */ new Set();
|
|
1335
1338
|
for (let e of r) {
|
|
1336
|
-
let t =
|
|
1339
|
+
let t = R.value.get(e);
|
|
1337
1340
|
if (t && t.draggable !== !1) {
|
|
1338
1341
|
i.add(e);
|
|
1339
1342
|
for (let t of Ne(e)) i.add(t);
|
|
@@ -1341,18 +1344,18 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1341
1344
|
}
|
|
1342
1345
|
t.moving = t.part === "body" ? [...i] : [n.id];
|
|
1343
1346
|
for (let e of t.moving) {
|
|
1344
|
-
let n =
|
|
1347
|
+
let n = V(R.value.get(e));
|
|
1345
1348
|
t.spans.set(e, {
|
|
1346
1349
|
start: n.start,
|
|
1347
1350
|
end: n.end
|
|
1348
1351
|
});
|
|
1349
1352
|
}
|
|
1350
|
-
if (
|
|
1353
|
+
if (G.value.has(n.id) || K([n.id]), Rn.value = {
|
|
1351
1354
|
taskId: n.id,
|
|
1352
1355
|
part: t.part
|
|
1353
1356
|
}, t.part === "link-start" || t.part === "link-end") {
|
|
1354
|
-
let r =
|
|
1355
|
-
|
|
1357
|
+
let r = Un(e.clientX, e.clientY);
|
|
1358
|
+
Bn.value = {
|
|
1356
1359
|
from: n.id,
|
|
1357
1360
|
fromEnd: t.part === "link-end",
|
|
1358
1361
|
x: r.x,
|
|
@@ -1368,22 +1371,22 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1368
1371
|
};
|
|
1369
1372
|
t.touch && navigator.vibrate?.(10);
|
|
1370
1373
|
let r = Rn.value.part;
|
|
1371
|
-
Le(r === "body" ? "grabbing" : r.startsWith("link") ? "crosshair" : "ew-resize"),
|
|
1374
|
+
Le(r === "body" ? "grabbing" : r.startsWith("link") ? "crosshair" : "ew-resize"), ur();
|
|
1372
1375
|
}
|
|
1373
|
-
function
|
|
1374
|
-
let t =
|
|
1376
|
+
function $n(e) {
|
|
1377
|
+
let t = $;
|
|
1375
1378
|
if (t && t.id === e.pointerId) {
|
|
1376
|
-
if (
|
|
1379
|
+
if (Hn.x = e.clientX, Hn.y = e.clientY, t.kind === "split") Ot(Math.round(Math.min(Math.max(120, t.w + e.clientX - t.sx), Math.max(160, Z.value.width - 80))));
|
|
1377
1380
|
else {
|
|
1378
|
-
if (t.kind === "pan") return
|
|
1381
|
+
if (t.kind === "pan") return er(t, e);
|
|
1379
1382
|
if (!t.active) {
|
|
1380
1383
|
let n = Math.hypot(e.clientX - t.sx, e.clientY - t.sy);
|
|
1381
1384
|
if (t.touch) {
|
|
1382
|
-
n > 8 && (
|
|
1385
|
+
n > 8 && ($ = null, Zn());
|
|
1383
1386
|
return;
|
|
1384
1387
|
}
|
|
1385
1388
|
if (n < 4) return;
|
|
1386
|
-
if (
|
|
1389
|
+
if (Qn(e), !t.active) {
|
|
1387
1390
|
if (t.kind === "bar" && t.part === "body") {
|
|
1388
1391
|
let n = {
|
|
1389
1392
|
kind: "pan",
|
|
@@ -1394,30 +1397,30 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1394
1397
|
st: t.st,
|
|
1395
1398
|
moved: !1
|
|
1396
1399
|
};
|
|
1397
|
-
|
|
1400
|
+
$ = n, er(n, e);
|
|
1398
1401
|
}
|
|
1399
1402
|
return;
|
|
1400
1403
|
}
|
|
1401
1404
|
}
|
|
1402
|
-
|
|
1405
|
+
nr(e.clientX, e.clientY);
|
|
1403
1406
|
}
|
|
1404
1407
|
}
|
|
1405
1408
|
}
|
|
1406
|
-
function
|
|
1409
|
+
function er(e, t) {
|
|
1407
1410
|
let n = t.clientX - e.sx, r = t.clientY - e.sy;
|
|
1408
|
-
!e.moved && Math.hypot(n, r) < 4 || (e.moved || (e.moved = !0,
|
|
1411
|
+
!e.moved && Math.hypot(n, r) < 4 || (e.moved || (e.moved = !0, mr.value = null, Le("grabbing")), X.value.scrollLeft = e.sl - n, X.value.scrollTop = e.st - r);
|
|
1409
1412
|
}
|
|
1410
|
-
function
|
|
1411
|
-
return
|
|
1413
|
+
function tr(e) {
|
|
1414
|
+
return V(e).dateOnly ? 1440 : g.snap ?? Oe(Mt.value);
|
|
1412
1415
|
}
|
|
1413
|
-
function
|
|
1414
|
-
let n =
|
|
1416
|
+
function nr(e, t) {
|
|
1417
|
+
let n = $;
|
|
1415
1418
|
if (!n || n.kind !== "bar" && n.kind !== "row" || !n.active) return;
|
|
1416
|
-
if (n.kind === "row") return
|
|
1417
|
-
let r =
|
|
1419
|
+
if (n.kind === "row") return ir(t);
|
|
1420
|
+
let r = Un(e, t), i = (e - n.sx + (X.value.scrollLeft - n.sl)) / Mt.value * O, a = R.value.get(n.taskId), o = P.value;
|
|
1418
1421
|
if (n.part === "link-start" || n.part === "link-end") {
|
|
1419
|
-
let i =
|
|
1420
|
-
|
|
1422
|
+
let i = rr(e, t), a = i && i !== n.taskId ? i : null, o = a ? _n(a) : void 0, s = !!o && r.x > o.x + o.w / 2;
|
|
1423
|
+
Bn.value = {
|
|
1421
1424
|
from: n.taskId,
|
|
1422
1425
|
fromEnd: n.part === "link-end",
|
|
1423
1426
|
x: r.x,
|
|
@@ -1436,18 +1439,18 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1436
1439
|
progress: o
|
|
1437
1440
|
});
|
|
1438
1441
|
} else if (n.part === "body") {
|
|
1439
|
-
let e = n.spans.get(n.taskId), t =
|
|
1442
|
+
let e = n.spans.get(n.taskId), t = tr(a), r = be(e.start + i, t), c = V(a).dateOnly ? ve(e.start, r) : 0, l = r - e.start;
|
|
1440
1443
|
for (let e of n.moving) {
|
|
1441
1444
|
let t = o.find((t) => t.id === e), r = n.spans.get(e);
|
|
1442
|
-
if (!t || !r ||
|
|
1443
|
-
let i =
|
|
1445
|
+
if (!t || !r || z.value.has(e) && U.value.has(e)) continue;
|
|
1446
|
+
let i = V(t).dateOnly, a = i ? F(r.start, c || Math.round(l / 864e5)) : r.start + l, u = i ? F(r.end, c || Math.round(l / 864e5)) : r.end + l;
|
|
1444
1447
|
s.set(e, {
|
|
1445
1448
|
...t,
|
|
1446
1449
|
...je(t, a, u)
|
|
1447
1450
|
});
|
|
1448
1451
|
}
|
|
1449
1452
|
} else {
|
|
1450
|
-
let e = n.spans.get(n.taskId), t =
|
|
1453
|
+
let e = n.spans.get(n.taskId), t = tr(a), r = V(a).dateOnly ? O : t * 6e4;
|
|
1451
1454
|
if (n.part === "start") {
|
|
1452
1455
|
let o = Math.min(be(e.start + i, t), e.end - r);
|
|
1453
1456
|
s.set(n.taskId, {
|
|
@@ -1463,199 +1466,209 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1463
1466
|
}
|
|
1464
1467
|
}
|
|
1465
1468
|
let c = o.map((e) => s.get(e.id) ?? e);
|
|
1466
|
-
|
|
1469
|
+
g.schedule === "auto" && n.part !== "progress" && (c = Pe(c, jn())), M.value = Me(c);
|
|
1467
1470
|
}
|
|
1468
|
-
function
|
|
1471
|
+
function rr(e, t) {
|
|
1469
1472
|
let n = (document.elementFromPoint?.(e, t))?.closest("[data-gantt-task]");
|
|
1470
1473
|
if (n) return n.getAttribute("data-gantt-task");
|
|
1471
|
-
let r =
|
|
1472
|
-
return
|
|
1474
|
+
let r = Un(e, t);
|
|
1475
|
+
return Y.value[Math.floor(r.y / g.rowHeight)]?.task.id ?? null;
|
|
1473
1476
|
}
|
|
1474
|
-
function
|
|
1475
|
-
let t =
|
|
1476
|
-
|
|
1477
|
+
function ir(e) {
|
|
1478
|
+
let t = $, n = e - X.value.getBoundingClientRect().top - _t + X.value.scrollTop, r = Math.max(0, Math.min(Y.value.length - 1, Math.floor(n / g.rowHeight))), i = Y.value[r].task, a = n / g.rowHeight - r, o = i.id === t.taskId || Ne(t.taskId).includes(i.id), s = a < .3 ? "before" : a > .7 ? "after" : "inside";
|
|
1479
|
+
Vn.value = o ? null : {
|
|
1477
1480
|
taskId: t.taskId,
|
|
1478
1481
|
target: i.id,
|
|
1479
1482
|
where: s
|
|
1480
1483
|
};
|
|
1481
1484
|
}
|
|
1482
|
-
function
|
|
1483
|
-
let r = A.value, i = /* @__PURE__ */ new Set([e, ...Ne(e)]), a = r.filter((e) => i.has(e.id)),
|
|
1484
|
-
if (
|
|
1485
|
-
let
|
|
1485
|
+
function ar(e, t, n) {
|
|
1486
|
+
let r = A.value, i = /* @__PURE__ */ new Set([e, ...Ne(e)]), a = r.filter((e) => i.has(e.id)), s = r.filter((e) => !i.has(e.id)), c = s.findIndex((e) => e.id === t);
|
|
1487
|
+
if (c < 0) return;
|
|
1488
|
+
let l = s[c], u = c;
|
|
1486
1489
|
if (n !== "before") {
|
|
1487
1490
|
let e = new Set(Ne(t));
|
|
1488
|
-
for (
|
|
1491
|
+
for (u = c + 1; u < s.length && e.has(s[u].id);) u++;
|
|
1489
1492
|
}
|
|
1490
|
-
let
|
|
1493
|
+
let d = n === "inside" ? t : l.parentId, f = {
|
|
1491
1494
|
...a[0],
|
|
1492
|
-
parentId:
|
|
1495
|
+
parentId: d
|
|
1493
1496
|
};
|
|
1494
|
-
|
|
1495
|
-
let
|
|
1496
|
-
...
|
|
1497
|
+
d || delete f.parentId, a[0] = f;
|
|
1498
|
+
let p = [
|
|
1499
|
+
...s.slice(0, u),
|
|
1497
1500
|
...a,
|
|
1498
|
-
...
|
|
1501
|
+
...s.slice(u)
|
|
1499
1502
|
];
|
|
1500
|
-
n === "inside" &&
|
|
1501
|
-
let
|
|
1503
|
+
n === "inside" && q.value.has(t) && Ue(t, !0), L(p);
|
|
1504
|
+
let m = Y.value.findIndex((t) => t.task.id === e) + 1;
|
|
1502
1505
|
D("change", {
|
|
1503
|
-
tasks: [
|
|
1506
|
+
tasks: [f],
|
|
1504
1507
|
kind: "reorder"
|
|
1505
|
-
}),
|
|
1508
|
+
}), _(() => Fr(o(k.ganttReordered, {
|
|
1509
|
+
name: f.name,
|
|
1510
|
+
pos: String(Y.value.findIndex((t) => t.task.id === e) + 1 || m)
|
|
1511
|
+
}, k.lang)));
|
|
1506
1512
|
}
|
|
1507
|
-
function
|
|
1508
|
-
let t =
|
|
1509
|
-
if (!t || t.id !== e.pointerId || (
|
|
1513
|
+
function or(e) {
|
|
1514
|
+
let t = $;
|
|
1515
|
+
if (!t || t.id !== e.pointerId || ($ = null, Zn(), dr(), t.kind === "pan" || t.kind === "split")) return;
|
|
1510
1516
|
if (t.kind === "row") {
|
|
1511
1517
|
Rn.value = null;
|
|
1512
|
-
let e =
|
|
1513
|
-
|
|
1518
|
+
let e = Vn.value;
|
|
1519
|
+
Vn.value = null, t.active && e && ar(e.taskId, e.target, e.where);
|
|
1514
1520
|
return;
|
|
1515
1521
|
}
|
|
1516
1522
|
if (Rn.value = null, !t.active) {
|
|
1517
|
-
let n =
|
|
1523
|
+
let n = R.value.get(t.taskId);
|
|
1518
1524
|
if (!n) return;
|
|
1519
|
-
|
|
1525
|
+
cr(n, e), e.pointerType === "touch" && yr(n.id), D("task-click", n, e);
|
|
1520
1526
|
return;
|
|
1521
1527
|
}
|
|
1522
1528
|
if (t.part === "link-start" || t.part === "link-end") {
|
|
1523
|
-
let e =
|
|
1524
|
-
|
|
1529
|
+
let e = Bn.value;
|
|
1530
|
+
Bn.value = null, e?.target && e.valid && An(e.from, e.target, e.fromEnd ? e.targetEnd ? "FF" : "FS" : e.targetEnd ? "SF" : "SS");
|
|
1525
1531
|
return;
|
|
1526
1532
|
}
|
|
1527
|
-
let n =
|
|
1528
|
-
if (
|
|
1529
|
-
let r = new Map(
|
|
1533
|
+
let n = M.value;
|
|
1534
|
+
if (M.value = null, !n) return;
|
|
1535
|
+
let r = new Map(P.value.map((e) => [e.id, e])), i = n.filter((e) => r.get(e.id) && r.get(e.id) !== e && !(z.value.has(e.id) && U.value.has(e.id)));
|
|
1530
1536
|
if (!i.length) return;
|
|
1531
1537
|
let a = new Map(n.map((e) => [e.id, e]));
|
|
1532
|
-
|
|
1533
|
-
let
|
|
1538
|
+
L(A.value.map((e) => i.some((t) => t.id === e.id) ? a.get(e.id) : e));
|
|
1539
|
+
let s = t.part === "progress" ? "progress" : t.part === "body" ? "move" : "resize";
|
|
1534
1540
|
D("change", {
|
|
1535
1541
|
tasks: i,
|
|
1536
|
-
kind:
|
|
1542
|
+
kind: s
|
|
1537
1543
|
});
|
|
1538
|
-
let
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
function
|
|
1549
|
-
|
|
1544
|
+
let c = a.get(t.taskId);
|
|
1545
|
+
Fr(s === "progress" ? o(k.ganttProgressSet, {
|
|
1546
|
+
name: c.name,
|
|
1547
|
+
progress: String(c.progress ?? 0)
|
|
1548
|
+
}, k.lang) : o(k.ganttMoved, {
|
|
1549
|
+
name: c.name,
|
|
1550
|
+
start: wr(c.start),
|
|
1551
|
+
end: wr(c.end ?? c.start)
|
|
1552
|
+
}, k.lang));
|
|
1553
|
+
}
|
|
1554
|
+
function sr(e) {
|
|
1555
|
+
$ && $.id === e.pointerId && ($ = null, Zn(), dr(), M.value = null, Rn.value = null, Bn.value = null, Vn.value = null);
|
|
1556
|
+
}
|
|
1557
|
+
function cr(e, t) {
|
|
1558
|
+
Tn.value = null, e.selectable !== !1 && (t.shiftKey || t.metaKey || t.ctrlKey ? K(G.value.has(e.id) ? W.value.filter((t) => t !== e.id) : [...W.value, e.id]) : K([e.id]), Mr.value = e.id);
|
|
1559
|
+
}
|
|
1560
|
+
let lr = 0;
|
|
1561
|
+
function ur() {
|
|
1562
|
+
if (lr) return;
|
|
1550
1563
|
let e = () => {
|
|
1551
|
-
|
|
1552
|
-
let t =
|
|
1553
|
-
if (!t ||
|
|
1564
|
+
lr = requestAnimationFrame(e);
|
|
1565
|
+
let t = X.value;
|
|
1566
|
+
if (!t || !$ || !("active" in $) || !$.active) return;
|
|
1554
1567
|
let n = t.getBoundingClientRect(), r = n.left + kt.value, i = 0, a = 0;
|
|
1555
|
-
|
|
1568
|
+
$.kind === "bar" && (Hn.x < r + 40 ? i = -Math.ceil((r + 40 - Hn.x) / 4) : Hn.x > n.right - 40 && (i = Math.ceil((Hn.x - n.right + 40) / 4))), Hn.y < n.top + _t + 40 ? a = -Math.ceil((n.top + _t + 40 - Hn.y) / 4) : Hn.y > n.bottom - 40 && (a = Math.ceil((Hn.y - n.bottom + 40) / 4)), (i || a) && (t.scrollLeft += i, t.scrollTop += a, nr(Hn.x, Hn.y));
|
|
1556
1569
|
};
|
|
1557
|
-
|
|
1570
|
+
lr = requestAnimationFrame(e);
|
|
1558
1571
|
}
|
|
1559
|
-
function
|
|
1560
|
-
cancelAnimationFrame(
|
|
1572
|
+
function dr() {
|
|
1573
|
+
cancelAnimationFrame(lr), lr = 0;
|
|
1561
1574
|
}
|
|
1562
|
-
function
|
|
1563
|
-
jt.pinchMove(e) ||
|
|
1575
|
+
function fr(e) {
|
|
1576
|
+
jt.pinchMove(e) || $ && "active" in $ && $.active && e.cancelable && e.preventDefault();
|
|
1564
1577
|
}
|
|
1565
|
-
function
|
|
1566
|
-
jt.readView(),
|
|
1578
|
+
function pr() {
|
|
1579
|
+
jt.readView(), mr.value = null, $ || (hr.value = null);
|
|
1567
1580
|
}
|
|
1568
|
-
let
|
|
1569
|
-
function
|
|
1570
|
-
if (e.pointerType === "touch" ||
|
|
1571
|
-
clearTimeout(
|
|
1581
|
+
let mr = x(null), hr = x(null), gr;
|
|
1582
|
+
function _r(e, t) {
|
|
1583
|
+
if (e.pointerType === "touch" || $) return;
|
|
1584
|
+
clearTimeout(gr);
|
|
1572
1585
|
let n = e.currentTarget;
|
|
1573
|
-
|
|
1586
|
+
gr = setTimeout(() => {
|
|
1574
1587
|
let e = n.getBoundingClientRect();
|
|
1575
|
-
|
|
1588
|
+
mr.value = {
|
|
1576
1589
|
id: t.id,
|
|
1577
1590
|
x: e.left + e.width / 2,
|
|
1578
1591
|
y: e.top
|
|
1579
1592
|
};
|
|
1580
1593
|
}, 450);
|
|
1581
1594
|
}
|
|
1582
|
-
function
|
|
1583
|
-
clearTimeout(
|
|
1595
|
+
function vr() {
|
|
1596
|
+
clearTimeout(gr), mr.value = null;
|
|
1584
1597
|
}
|
|
1585
|
-
function
|
|
1586
|
-
if (
|
|
1587
|
-
|
|
1598
|
+
function yr(e) {
|
|
1599
|
+
if (hr.value?.id === e) {
|
|
1600
|
+
hr.value = null;
|
|
1588
1601
|
return;
|
|
1589
1602
|
}
|
|
1590
|
-
let t = (ln.get(e)?.querySelector("[data-gantt-task]") ?? ln.get(e))?.getBoundingClientRect(), n =
|
|
1603
|
+
let t = (ln.get(e)?.querySelector("[data-gantt-task]") ?? ln.get(e))?.getBoundingClientRect(), n = X.value?.getBoundingClientRect();
|
|
1591
1604
|
if (!t) return;
|
|
1592
1605
|
let r = Math.max(t.left, (n?.left ?? 0) + kt.value), i = Math.min(t.right, n?.right ?? window.innerWidth);
|
|
1593
|
-
|
|
1606
|
+
hr.value = {
|
|
1594
1607
|
id: e,
|
|
1595
1608
|
x: i > r ? (r + i) / 2 : t.left + t.width / 2,
|
|
1596
1609
|
y: t.top
|
|
1597
1610
|
};
|
|
1598
1611
|
}
|
|
1599
|
-
let
|
|
1600
|
-
let e = Rn.value?.taskId ??
|
|
1601
|
-
return e ?
|
|
1602
|
-
}),
|
|
1612
|
+
let br = u(() => mr.value ?? hr.value), xr = u(() => {
|
|
1613
|
+
let e = Rn.value?.taskId ?? br.value?.id;
|
|
1614
|
+
return e ? R.value.get(e) : void 0;
|
|
1615
|
+
}), Sr = x({
|
|
1603
1616
|
x: 0,
|
|
1604
1617
|
y: 0
|
|
1605
|
-
}),
|
|
1606
|
-
|
|
1618
|
+
}), Cr = (e) => Math.min(Math.max(e, 120), window.innerWidth - 120);
|
|
1619
|
+
T([xr, br], () => {
|
|
1607
1620
|
if (Rn.value) {
|
|
1608
1621
|
let e = ln.get(Rn.value.taskId)?.getBoundingClientRect();
|
|
1609
|
-
e && (
|
|
1622
|
+
e && (Sr.value = {
|
|
1610
1623
|
x: e.left + e.width / 2,
|
|
1611
1624
|
y: e.top
|
|
1612
1625
|
});
|
|
1613
|
-
} else
|
|
1614
|
-
x:
|
|
1615
|
-
y:
|
|
1626
|
+
} else br.value && (Sr.value = {
|
|
1627
|
+
x: Cr(br.value.x),
|
|
1628
|
+
y: br.value.y
|
|
1616
1629
|
});
|
|
1617
|
-
}, { flush: "post" }),
|
|
1618
|
-
Rn.value &&
|
|
1630
|
+
}, { flush: "post" }), T(M, () => {
|
|
1631
|
+
Rn.value && _(() => {
|
|
1619
1632
|
let e = ln.get(Rn.value?.taskId ?? "")?.getBoundingClientRect();
|
|
1620
|
-
e && (
|
|
1621
|
-
x:
|
|
1633
|
+
e && (Sr.value = {
|
|
1634
|
+
x: Cr(e.left + e.width / 2),
|
|
1622
1635
|
y: e.top
|
|
1623
1636
|
});
|
|
1624
1637
|
});
|
|
1625
1638
|
});
|
|
1626
|
-
function
|
|
1639
|
+
function wr(e) {
|
|
1627
1640
|
let t = j(e);
|
|
1628
1641
|
if (Number.isNaN(t)) return "";
|
|
1629
1642
|
let n = {
|
|
1630
1643
|
day: "numeric",
|
|
1631
1644
|
month: "short"
|
|
1632
1645
|
};
|
|
1633
|
-
return new Date(t).getFullYear() !== (/* @__PURE__ */ new Date()).getFullYear() && (n.year = "2-digit"), /^\d{4}-\d{2}-\d{2}$/.test(e) || (n.hour = "numeric", n.minute = "2-digit"), new Intl.DateTimeFormat(
|
|
1646
|
+
return new Date(t).getFullYear() !== (/* @__PURE__ */ new Date()).getFullYear() && (n.year = "2-digit"), /^\d{4}-\d{2}-\d{2}$/.test(e) || (n.hour = "numeric", n.minute = "2-digit"), new Intl.DateTimeFormat(_e.value, n).format(t);
|
|
1634
1647
|
}
|
|
1635
|
-
function
|
|
1636
|
-
if (
|
|
1637
|
-
let t =
|
|
1638
|
-
return
|
|
1648
|
+
function Tr(e) {
|
|
1649
|
+
if (B(e)) return k.ganttMilestone;
|
|
1650
|
+
let t = H(e);
|
|
1651
|
+
return V(e).dateOnly || t >= 1 ? o(k.ganttDays, { n: String(Math.round(t * 10) / 10) }, k.lang) : o(k.ganttHours, { n: String(Math.round(t * 24 * 10) / 10) }, k.lang);
|
|
1639
1652
|
}
|
|
1640
|
-
let
|
|
1653
|
+
let Er = u(() => {
|
|
1641
1654
|
let e = Yt.value.reduce((e, t) => e + (t.key === "name" && !t.width ? 0 : t.width ?? 100), 0);
|
|
1642
1655
|
return Yt.value.map((t) => t.key === "name" && !t.width ? Math.max(120, Dt.value - e) : t.width ?? 100);
|
|
1643
1656
|
});
|
|
1644
|
-
function
|
|
1657
|
+
function Dr(e, t) {
|
|
1645
1658
|
if (t.format) return t.format(e);
|
|
1646
1659
|
switch (t.key) {
|
|
1647
1660
|
case "name": return e.name;
|
|
1648
|
-
case "start": return
|
|
1649
|
-
case "end": return
|
|
1650
|
-
case "duration": return
|
|
1651
|
-
case "progress": return
|
|
1661
|
+
case "start": return wr(e.start);
|
|
1662
|
+
case "end": return B(e) ? "" : wr(e.end ?? e.start);
|
|
1663
|
+
case "duration": return Tr(e);
|
|
1664
|
+
case "progress": return B(e) ? "" : `${Math.round(e.progress ?? 0)}%`;
|
|
1652
1665
|
}
|
|
1653
1666
|
let n = e.data?.[t.key] ?? e[t.key];
|
|
1654
1667
|
return n == null ? "" : String(n);
|
|
1655
1668
|
}
|
|
1656
|
-
function
|
|
1657
|
-
if (!
|
|
1658
|
-
let t =
|
|
1669
|
+
function Or(e) {
|
|
1670
|
+
if (!g.baselines || !e.baselineStart) return null;
|
|
1671
|
+
let t = V({
|
|
1659
1672
|
start: e.baselineStart,
|
|
1660
1673
|
end: e.baselineEnd ?? (e.end ? e.baselineStart : void 0),
|
|
1661
1674
|
type: e.type
|
|
@@ -1665,10 +1678,10 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1665
1678
|
w: Math.max(4, It(t.end) - It(t.start))
|
|
1666
1679
|
} : null;
|
|
1667
1680
|
}
|
|
1668
|
-
let
|
|
1681
|
+
let kr = (e) => {
|
|
1669
1682
|
let t = sn.value.get(e.id);
|
|
1670
1683
|
return !!t && t.w > e.name.length * 7 + 24;
|
|
1671
|
-
},
|
|
1684
|
+
}, Ar = {
|
|
1672
1685
|
primary: {
|
|
1673
1686
|
bar: "bg-primary-container text-on-primary-container",
|
|
1674
1687
|
fill: "bg-primary/30",
|
|
@@ -1700,88 +1713,92 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1700
1713
|
solid: "bg-on-surface-variant text-on-surface-variant"
|
|
1701
1714
|
}
|
|
1702
1715
|
};
|
|
1703
|
-
function
|
|
1704
|
-
return an.value.has(e.id) && !(
|
|
1716
|
+
function jr(e) {
|
|
1717
|
+
return an.value.has(e.id) && !(z.value.has(e.id) && U.value.has(e.id)) ? Ar.error : Ar[e.color ?? (z.value.has(e.id) ? "neutral" : "primary")] ?? Ar.primary;
|
|
1705
1718
|
}
|
|
1706
|
-
let
|
|
1707
|
-
function
|
|
1708
|
-
|
|
1709
|
-
|
|
1719
|
+
let Mr = x(null), Nr = u(() => Mr.value && bt.value.has(Mr.value) ? Mr.value : Y.value[0]?.task.id), Pr = x("");
|
|
1720
|
+
function Fr(e) {
|
|
1721
|
+
Pr.value = "", _(() => {
|
|
1722
|
+
Pr.value = e;
|
|
1710
1723
|
});
|
|
1711
1724
|
}
|
|
1712
|
-
let
|
|
1713
|
-
function
|
|
1714
|
-
let t =
|
|
1715
|
-
t && !
|
|
1716
|
-
let e =
|
|
1725
|
+
let Ir = x(null), Lr = x("");
|
|
1726
|
+
function Rr(e) {
|
|
1727
|
+
let t = R.value.get(e);
|
|
1728
|
+
t && !g.readonly && (Ir.value = e, Lr.value = t.name, _(() => {
|
|
1729
|
+
let e = X.value?.querySelector("[data-gantt-rename]");
|
|
1717
1730
|
e?.focus(), e?.select();
|
|
1718
1731
|
}));
|
|
1719
1732
|
}
|
|
1720
|
-
function
|
|
1721
|
-
let t =
|
|
1733
|
+
function zr(e) {
|
|
1734
|
+
let t = Ir.value;
|
|
1722
1735
|
if (!t) return;
|
|
1723
|
-
|
|
1736
|
+
Ir.value = null;
|
|
1724
1737
|
let n = A.value.find((e) => e.id === t);
|
|
1725
|
-
if (e && n &&
|
|
1738
|
+
if (e && n && Lr.value.trim() && Lr.value !== n.name) {
|
|
1726
1739
|
let e = {
|
|
1727
1740
|
...n,
|
|
1728
|
-
name:
|
|
1741
|
+
name: Lr.value.trim()
|
|
1729
1742
|
};
|
|
1730
|
-
|
|
1743
|
+
L(A.value.map((n) => n.id === t ? e : n)), D("change", {
|
|
1731
1744
|
tasks: [e],
|
|
1732
1745
|
kind: "rename"
|
|
1733
1746
|
});
|
|
1734
1747
|
}
|
|
1735
|
-
|
|
1748
|
+
Br(t);
|
|
1736
1749
|
}
|
|
1737
|
-
function
|
|
1738
|
-
|
|
1750
|
+
function Br(e) {
|
|
1751
|
+
Mr.value = e, _(() => X.value?.querySelector(`[data-gantt-row="${CSS.escape(e)}"]`)?.focus({ preventScroll: !0 }));
|
|
1739
1752
|
}
|
|
1740
|
-
function
|
|
1741
|
-
let r =
|
|
1742
|
-
n &&
|
|
1743
|
-
let
|
|
1744
|
-
if (!
|
|
1753
|
+
function Vr(e, t, n) {
|
|
1754
|
+
let r = V(e), i = tr(e), a = (e) => r.dateOnly ? F(e, t) : e + t * i * 6e4, s = n ? r.start : a(r.start), c = a(r.end);
|
|
1755
|
+
n && c <= r.start && (c = r.dateOnly ? F(r.start, 1) : r.start + i * 6e4);
|
|
1756
|
+
let l = n ? [e.id] : [e.id, ...Ne(e.id)], u = A.value.map((n) => {
|
|
1757
|
+
if (!l.includes(n.id) || z.value.has(n.id) && U.value.has(n.id)) return n;
|
|
1745
1758
|
if (n.id === e.id) return {
|
|
1746
1759
|
...n,
|
|
1747
|
-
...je(n,
|
|
1760
|
+
...je(n, s, c)
|
|
1748
1761
|
};
|
|
1749
|
-
let r =
|
|
1762
|
+
let r = V(n);
|
|
1750
1763
|
return {
|
|
1751
1764
|
...n,
|
|
1752
|
-
...je(n, r.dateOnly ?
|
|
1765
|
+
...je(n, r.dateOnly ? F(r.start, t) : r.start + t * i * 6e4, r.dateOnly ? F(r.end, t) : r.end + t * i * 6e4)
|
|
1753
1766
|
};
|
|
1754
|
-
}),
|
|
1755
|
-
|
|
1756
|
-
let
|
|
1767
|
+
}), d = g.schedule === "auto" ? Pe(u, jn()) : u;
|
|
1768
|
+
L(d);
|
|
1769
|
+
let f = Me(d).find((t) => t.id === e.id);
|
|
1757
1770
|
D("change", {
|
|
1758
|
-
tasks: [
|
|
1771
|
+
tasks: [f],
|
|
1759
1772
|
kind: n ? "resize" : "move"
|
|
1760
|
-
}),
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1773
|
+
}), Fr(o(k.ganttMoved, {
|
|
1774
|
+
name: f.name,
|
|
1775
|
+
start: wr(f.start),
|
|
1776
|
+
end: wr(f.end ?? f.start)
|
|
1777
|
+
}, k.lang));
|
|
1778
|
+
}
|
|
1779
|
+
function Hr(e, t) {
|
|
1780
|
+
if (Ir.value) return;
|
|
1764
1781
|
let n = bt.value.get(t.id) ?? 0, r = e.ctrlKey || e.metaKey, i = (t) => {
|
|
1765
|
-
let n =
|
|
1766
|
-
n && (
|
|
1767
|
-
}, a = !
|
|
1768
|
-
if (e.altKey && a && (e.key === "ArrowLeft" || e.key === "ArrowRight")) e.preventDefault(), t.draggable !== !1 &&
|
|
1782
|
+
let n = Y.value[Math.max(0, Math.min(Y.value.length - 1, t))];
|
|
1783
|
+
n && (Br(n.task.id), e.shiftKey ? K([.../* @__PURE__ */ new Set([...W.value, n.task.id])]) : K([n.task.id]), Xt(n.task.id));
|
|
1784
|
+
}, a = !g.readonly;
|
|
1785
|
+
if (e.altKey && a && (e.key === "ArrowLeft" || e.key === "ArrowRight")) e.preventDefault(), t.draggable !== !1 && Vr(t, e.key === "ArrowLeft" ? -1 : 1, e.shiftKey);
|
|
1769
1786
|
else if (e.altKey && a && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
|
|
1770
1787
|
e.preventDefault();
|
|
1771
|
-
let n =
|
|
1772
|
-
r &&
|
|
1788
|
+
let n = U.value.get(t.parentId && R.value.has(t.parentId) ? t.parentId : void 0) ?? [], r = n[n.findIndex((e) => e.id === t.id) + (e.key === "ArrowUp" ? -1 : 1)];
|
|
1789
|
+
r && ar(t.id, r.id, e.key === "ArrowUp" ? "before" : "after"), Br(t.id);
|
|
1773
1790
|
} else if (r && a && (e.key === "]" || e.key === "[")) {
|
|
1774
1791
|
if (e.preventDefault(), e.key === "]") {
|
|
1775
|
-
let e =
|
|
1792
|
+
let e = U.value.get(t.parentId && R.value.has(t.parentId) ? t.parentId : void 0) ?? [], n = e[e.findIndex((e) => e.id === t.id) - 1];
|
|
1776
1793
|
if (n) {
|
|
1777
|
-
let e = (
|
|
1778
|
-
e ?
|
|
1794
|
+
let e = (U.value.get(n.id) ?? []).at(-1);
|
|
1795
|
+
e ? ar(t.id, e.id, "after") : ar(t.id, n.id, "inside");
|
|
1779
1796
|
}
|
|
1780
|
-
} else t.parentId &&
|
|
1781
|
-
|
|
1797
|
+
} else t.parentId && R.value.has(t.parentId) && ar(t.id, t.parentId, "after");
|
|
1798
|
+
Br(t.id);
|
|
1782
1799
|
} else if (r && e.key.toLowerCase() === "z") e.preventDefault(), e.shiftKey ? Te() : we();
|
|
1783
1800
|
else if (r && e.key.toLowerCase() === "y") e.preventDefault(), Te();
|
|
1784
|
-
else if (r && e.key.toLowerCase() === "a") e.preventDefault(),
|
|
1801
|
+
else if (r && e.key.toLowerCase() === "a") e.preventDefault(), K(Y.value.map((e) => e.task.id));
|
|
1785
1802
|
else switch (e.key) {
|
|
1786
1803
|
case "ArrowDown":
|
|
1787
1804
|
e.preventDefault(), i(n + 1);
|
|
@@ -1793,64 +1810,64 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1793
1810
|
e.preventDefault(), i(0);
|
|
1794
1811
|
break;
|
|
1795
1812
|
case "End":
|
|
1796
|
-
e.preventDefault(), i(
|
|
1813
|
+
e.preventDefault(), i(Y.value.length - 1);
|
|
1797
1814
|
break;
|
|
1798
1815
|
case "ArrowRight":
|
|
1799
|
-
e.preventDefault(),
|
|
1816
|
+
e.preventDefault(), U.value.has(t.id) && q.value.has(t.id) ? Ue(t.id, !0) : U.value.has(t.id) && i(n + 1);
|
|
1800
1817
|
break;
|
|
1801
1818
|
case "ArrowLeft":
|
|
1802
|
-
e.preventDefault(),
|
|
1819
|
+
e.preventDefault(), U.value.has(t.id) && !q.value.has(t.id) ? Ue(t.id, !1) : t.parentId && bt.value.has(t.parentId) && i(bt.value.get(t.parentId));
|
|
1803
1820
|
break;
|
|
1804
1821
|
case " ":
|
|
1805
|
-
e.preventDefault(), G
|
|
1822
|
+
e.preventDefault(), K(G.value.has(t.id) ? W.value.filter((e) => e !== t.id) : [...W.value, t.id]);
|
|
1806
1823
|
break;
|
|
1807
1824
|
case "Enter":
|
|
1808
1825
|
e.preventDefault(), D("task-dblclick", t, e);
|
|
1809
1826
|
break;
|
|
1810
1827
|
case "F2":
|
|
1811
|
-
e.preventDefault(),
|
|
1828
|
+
e.preventDefault(), Rr(t.id);
|
|
1812
1829
|
break;
|
|
1813
1830
|
case "Delete":
|
|
1814
1831
|
case "Backspace":
|
|
1815
1832
|
if (!a) break;
|
|
1816
|
-
e.preventDefault(), Pn(
|
|
1833
|
+
e.preventDefault(), Pn(G.value.has(t.id) ? W.value : [t.id]);
|
|
1817
1834
|
}
|
|
1818
1835
|
}
|
|
1819
|
-
function
|
|
1820
|
-
if ((e.key === "Delete" || e.key === "Backspace") && Tn.value && !
|
|
1836
|
+
function Ur(e) {
|
|
1837
|
+
if ((e.key === "Delete" || e.key === "Backspace") && Tn.value && !g.readonly) {
|
|
1821
1838
|
e.preventDefault();
|
|
1822
1839
|
let [t, n] = Tn.value.split(">");
|
|
1823
1840
|
Dn(t, n);
|
|
1824
1841
|
}
|
|
1825
1842
|
}
|
|
1826
|
-
let
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
}),
|
|
1830
|
-
if (!
|
|
1843
|
+
let Wr = /* @__PURE__ */ new Map();
|
|
1844
|
+
re(() => {
|
|
1845
|
+
$ && "active" in $ && $.active || (Wr = new Map(Y.value.map((e, t) => [e.task.id, t * g.rowHeight])));
|
|
1846
|
+
}), ae(() => {
|
|
1847
|
+
if (!Wr.size || i()) return;
|
|
1831
1848
|
let e = bt.value;
|
|
1832
|
-
for (let r of
|
|
1833
|
-
let i = r.dataset.ganttFlip, a =
|
|
1849
|
+
for (let r of X.value?.querySelectorAll("[data-gantt-flip]") ?? []) {
|
|
1850
|
+
let i = r.dataset.ganttFlip, a = Wr.get(i), o = e.get(i);
|
|
1834
1851
|
if (a === void 0 || o === void 0) continue;
|
|
1835
|
-
let s = a - o *
|
|
1836
|
-
if (Math.abs(s) < 1 || Math.abs(s) >
|
|
1852
|
+
let s = a - o * g.rowHeight;
|
|
1853
|
+
if (Math.abs(s) < 1 || Math.abs(s) > g.rowHeight * 40) continue;
|
|
1837
1854
|
let c = t(s, 0, 0, {
|
|
1838
1855
|
dampingRatio: .9,
|
|
1839
1856
|
stiffness: 700
|
|
1840
1857
|
}, .5);
|
|
1841
1858
|
n(r, c, (e) => ({ translate: `0 ${e}px` }));
|
|
1842
1859
|
}
|
|
1843
|
-
|
|
1860
|
+
Wr.clear();
|
|
1844
1861
|
});
|
|
1845
|
-
let
|
|
1846
|
-
tasks:
|
|
1847
|
-
selection:
|
|
1862
|
+
let Gr = {
|
|
1863
|
+
tasks: u(() => I.value),
|
|
1864
|
+
selection: u(() => W.value),
|
|
1848
1865
|
scale: Gt,
|
|
1849
1866
|
pxPerDay: Mt,
|
|
1850
|
-
readonly:
|
|
1867
|
+
readonly: u(() => g.readonly),
|
|
1851
1868
|
canUndo: Ee,
|
|
1852
1869
|
canRedo: De,
|
|
1853
|
-
collapsed:
|
|
1870
|
+
collapsed: u(() => ze.value),
|
|
1854
1871
|
undo: we,
|
|
1855
1872
|
redo: Te,
|
|
1856
1873
|
zoomIn: Rt,
|
|
@@ -1860,8 +1877,8 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1860
1877
|
scrollToTask: Xt,
|
|
1861
1878
|
toggle: Ue,
|
|
1862
1879
|
expandAll: () => Ve([]),
|
|
1863
|
-
collapseAll: () => Ve([...
|
|
1864
|
-
setSelection:
|
|
1880
|
+
collapseAll: () => Ve([...U.value.keys()].filter((e) => !!e)),
|
|
1881
|
+
setSelection: K,
|
|
1865
1882
|
addTasks: Mn,
|
|
1866
1883
|
updateTask: Nn,
|
|
1867
1884
|
removeTasks: Pn,
|
|
@@ -1870,383 +1887,383 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
1870
1887
|
schedule: Fn,
|
|
1871
1888
|
criticalPath: rn,
|
|
1872
1889
|
dateAt: In,
|
|
1873
|
-
gridCollapsed:
|
|
1890
|
+
gridCollapsed: u(() => Ct.value),
|
|
1874
1891
|
setGridCollapsed: wt,
|
|
1875
1892
|
fit: Kt
|
|
1876
1893
|
};
|
|
1877
|
-
return
|
|
1878
|
-
...
|
|
1879
|
-
foldable:
|
|
1880
|
-
folded:
|
|
1881
|
-
hasList:
|
|
1882
|
-
}),
|
|
1883
|
-
let e =
|
|
1884
|
-
e.addEventListener("touchmove",
|
|
1894
|
+
return oe(me, Gr), oe(he, {
|
|
1895
|
+
...Gr,
|
|
1896
|
+
foldable: u(() => U.value.size > 1),
|
|
1897
|
+
folded: u(() => ze.value.length > 0),
|
|
1898
|
+
hasList: u(() => St.value.length > 0)
|
|
1899
|
+
}), ie(() => {
|
|
1900
|
+
let e = X.value;
|
|
1901
|
+
e.addEventListener("touchmove", fr, { passive: !1 }), _(() => {
|
|
1885
1902
|
let t = Ft.value, n = t !== null && t >= At.value.min && t <= At.value.max ? t : At.value.min;
|
|
1886
|
-
e.scrollLeft = Math.max(0, It(n) - Math.min(80, Nt.value / 4)),
|
|
1903
|
+
e.scrollLeft = Math.max(0, It(n) - Math.min(80, Nt.value / 4)), Z.value.left = e.scrollLeft;
|
|
1887
1904
|
});
|
|
1888
|
-
}),
|
|
1889
|
-
|
|
1890
|
-
}),
|
|
1905
|
+
}), ne(() => {
|
|
1906
|
+
X.value?.removeEventListener("touchmove", fr), Zn(), dr(), cancelAnimationFrame(dn), clearTimeout(gr);
|
|
1907
|
+
}), s(Gr), (e, t) => (b(), p("div", {
|
|
1891
1908
|
class: "m3-gantt flex flex-col overflow-hidden rounded-md bg-surface text-on-surface",
|
|
1892
|
-
onKeydown:
|
|
1909
|
+
onKeydown: Ur
|
|
1893
1910
|
}, [
|
|
1894
|
-
|
|
1895
|
-
|
|
1911
|
+
se(e.$slots, "default", { gantt: Gr }),
|
|
1912
|
+
m("div", {
|
|
1896
1913
|
ref_key: "scroller",
|
|
1897
|
-
ref:
|
|
1914
|
+
ref: X,
|
|
1898
1915
|
class: "relative min-h-0 flex-1 touch-pan-x touch-pan-y overflow-auto overscroll-contain",
|
|
1899
|
-
onScrollPassive:
|
|
1900
|
-
onTouchstartPassive: t[13] ||= (...e) =>
|
|
1901
|
-
onTouchendPassive: t[14] ||= (...e) =>
|
|
1902
|
-
onContextmenu: t[15] ||= (e) =>
|
|
1903
|
-
}, [
|
|
1916
|
+
onScrollPassive: pr,
|
|
1917
|
+
onTouchstartPassive: t[13] ||= (...e) => w(jt).onTouchStart && w(jt).onTouchStart(...e),
|
|
1918
|
+
onTouchendPassive: t[14] ||= (...e) => w(jt).onTouchEnd && w(jt).onTouchEnd(...e),
|
|
1919
|
+
onContextmenu: t[15] ||= (e) => w($) && e.preventDefault()
|
|
1920
|
+
}, [m("div", {
|
|
1904
1921
|
class: "relative",
|
|
1905
|
-
style:
|
|
1906
|
-
width: `${kt.value +
|
|
1922
|
+
style: y({
|
|
1923
|
+
width: `${kt.value + w(Q)}px`,
|
|
1907
1924
|
height: `${_t + en.value}px`
|
|
1908
1925
|
})
|
|
1909
|
-
}, [
|
|
1926
|
+
}, [m("div", {
|
|
1910
1927
|
class: "sticky top-0 z-20 flex",
|
|
1911
|
-
style:
|
|
1928
|
+
style: y({
|
|
1912
1929
|
height: `${_t}px`,
|
|
1913
|
-
width: `${kt.value +
|
|
1930
|
+
width: `${kt.value + w(Q)}px`
|
|
1914
1931
|
})
|
|
1915
|
-
}, [Tt.value ? (
|
|
1932
|
+
}, [Tt.value ? (b(), p("div", {
|
|
1916
1933
|
key: 0,
|
|
1917
1934
|
class: "sticky left-0 z-10 flex shrink-0 items-end border-r border-b border-outline-variant bg-surface-container-low text-label-medium text-on-surface-variant",
|
|
1918
|
-
style:
|
|
1935
|
+
style: y({ width: `${kt.value}px` }),
|
|
1919
1936
|
role: "row"
|
|
1920
|
-
}, [(
|
|
1937
|
+
}, [(b(!0), p(c, null, S(Yt.value, (e, t) => (b(), p("div", {
|
|
1921
1938
|
key: e.key,
|
|
1922
1939
|
role: "columnheader",
|
|
1923
|
-
class:
|
|
1924
|
-
style:
|
|
1925
|
-
},
|
|
1926
|
-
width:
|
|
1927
|
-
"top-cells":
|
|
1928
|
-
"bottom-cells":
|
|
1929
|
-
"today-x":
|
|
1940
|
+
class: v(["truncate px-3 pb-2", e.align === "end" ? "text-right" : e.align === "center" ? "text-center" : ""]),
|
|
1941
|
+
style: y({ width: `${Er.value[t]}px` })
|
|
1942
|
+
}, C(e.label ?? e.key), 7))), 128))], 4)) : f("", !0), te(Be, {
|
|
1943
|
+
width: w(Q),
|
|
1944
|
+
"top-cells": w(Ht),
|
|
1945
|
+
"bottom-cells": w(Ut),
|
|
1946
|
+
"today-x": w(Ft) === null ? null : w(It)(w(Ft))
|
|
1930
1947
|
}, null, 8, [
|
|
1931
1948
|
"width",
|
|
1932
1949
|
"top-cells",
|
|
1933
1950
|
"bottom-cells",
|
|
1934
1951
|
"today-x"
|
|
1935
|
-
])], 4),
|
|
1952
|
+
])], 4), m("div", {
|
|
1936
1953
|
class: "flex",
|
|
1937
|
-
style:
|
|
1938
|
-
}, [Tt.value ? (
|
|
1954
|
+
style: y({ height: `${en.value}px` })
|
|
1955
|
+
}, [Tt.value ? (b(), p("div", {
|
|
1939
1956
|
key: 0,
|
|
1940
1957
|
class: "sticky left-0 z-10 shrink-0 border-r border-outline-variant bg-surface",
|
|
1941
|
-
style:
|
|
1958
|
+
style: y({ width: `${kt.value}px` }),
|
|
1942
1959
|
role: "treegrid",
|
|
1943
|
-
"aria-label": r.label ??
|
|
1944
|
-
"aria-rowcount":
|
|
1960
|
+
"aria-label": r.label ?? w(k).ganttChart,
|
|
1961
|
+
"aria-rowcount": Y.value.length,
|
|
1945
1962
|
"aria-multiselectable": "true"
|
|
1946
1963
|
}, [
|
|
1947
|
-
(
|
|
1964
|
+
(b(!0), p(c, null, S($t.value, (n) => (b(), p("div", {
|
|
1948
1965
|
key: n.task.id,
|
|
1949
1966
|
"data-gantt-row": n.task.id,
|
|
1950
1967
|
"data-gantt-flip": n.task.id,
|
|
1951
1968
|
role: "row",
|
|
1952
1969
|
"aria-level": n.depth + 1,
|
|
1953
1970
|
"aria-rowindex": n.index + 1,
|
|
1954
|
-
"aria-expanded": n.parent ? !
|
|
1955
|
-
"aria-selected":
|
|
1956
|
-
tabindex:
|
|
1957
|
-
class:
|
|
1958
|
-
style:
|
|
1971
|
+
"aria-expanded": n.parent ? !q.value.has(n.task.id) : void 0,
|
|
1972
|
+
"aria-selected": G.value.has(n.task.id),
|
|
1973
|
+
tabindex: Nr.value === n.task.id ? 0 : -1,
|
|
1974
|
+
class: v(["m3-gantt-row absolute inset-x-0 flex items-center text-body-medium outline-none select-none focus-visible:z-10 focus-visible:ring-2 focus-visible:ring-secondary focus-visible:ring-inset", [G.value.has(n.task.id) ? "bg-secondary-container text-on-secondary-container" : "hover:bg-on-surface/8", Rn.value?.taskId === n.task.id && !Rn.value?.part.startsWith("link") && Vn.value ? "opacity-50" : ""]]),
|
|
1975
|
+
style: y({
|
|
1959
1976
|
top: `${n.index * r.rowHeight}px`,
|
|
1960
1977
|
height: `${r.rowHeight}px`
|
|
1961
1978
|
}),
|
|
1962
|
-
onPointerdown: (e) =>
|
|
1963
|
-
onClick: (e) =>
|
|
1979
|
+
onPointerdown: (e) => Jn(e, n.task),
|
|
1980
|
+
onClick: (e) => cr(n.task, e),
|
|
1964
1981
|
onDblclick: (e) => D("task-dblclick", n.task, e),
|
|
1965
1982
|
onContextmenu: (e) => D("task-contextmenu", n.task, e),
|
|
1966
|
-
onKeydown: (e) =>
|
|
1967
|
-
onFocus: (e) =>
|
|
1968
|
-
}, [(
|
|
1983
|
+
onKeydown: (e) => Hr(e, n.task),
|
|
1984
|
+
onFocus: (e) => Mr.value = n.task.id
|
|
1985
|
+
}, [(b(!0), p(c, null, S(Yt.value, (i, a) => (b(), p("div", {
|
|
1969
1986
|
key: i.key,
|
|
1970
1987
|
role: "gridcell",
|
|
1971
|
-
class:
|
|
1972
|
-
style:
|
|
1973
|
-
width: `${
|
|
1988
|
+
class: v(["flex h-full min-w-0 items-center px-3", [i.align === "end" ? "justify-end" : i.align === "center" ? "justify-center" : "", i.key === "name" ? "gap-1" : "text-on-surface-variant"]]),
|
|
1989
|
+
style: y({
|
|
1990
|
+
width: `${Er.value[a]}px`,
|
|
1974
1991
|
paddingLeft: i.key === "name" ? `${8 + n.depth * Jt.value}px` : void 0
|
|
1975
1992
|
})
|
|
1976
|
-
}, [i.key === "name" ? (
|
|
1977
|
-
n.parent ? (
|
|
1993
|
+
}, [i.key === "name" ? (b(), p(c, { key: 0 }, [
|
|
1994
|
+
n.parent ? (b(), p("button", {
|
|
1978
1995
|
key: 0,
|
|
1979
1996
|
type: "button",
|
|
1980
1997
|
tabindex: "-1",
|
|
1981
1998
|
"data-gantt-action": "",
|
|
1982
1999
|
class: "flex size-6 shrink-0 items-center justify-center rounded-full text-on-surface-variant hover:bg-on-surface/8",
|
|
1983
|
-
"aria-label":
|
|
1984
|
-
onClick:
|
|
1985
|
-
}, [
|
|
1986
|
-
|
|
1987
|
-
|
|
2000
|
+
"aria-label": q.value.has(n.task.id) ? w(k).ganttExpand : w(k).ganttCollapse,
|
|
2001
|
+
onClick: E((e) => Ue(n.task.id), ["stop"])
|
|
2002
|
+
}, [m("span", { class: v(["material-symbols-outlined text-[20px] transition-transform duration-200", q.value.has(n.task.id) ? "-rotate-90" : ""]) }, "expand_more", 2)], 8, qe)) : (b(), p("span", Je)),
|
|
2003
|
+
w(B)(n.task) ? (b(), p("span", Ye)) : f("", !0),
|
|
2004
|
+
Ir.value === n.task.id ? fe((b(), p("input", {
|
|
1988
2005
|
key: 3,
|
|
1989
|
-
"onUpdate:modelValue": t[0] ||= (e) =>
|
|
2006
|
+
"onUpdate:modelValue": t[0] ||= (e) => Lr.value = e,
|
|
1990
2007
|
"data-gantt-rename": "",
|
|
1991
2008
|
class: "h-8 min-w-0 flex-1 rounded-xs border border-primary bg-surface px-2 text-body-medium text-on-surface outline-none",
|
|
1992
|
-
onKeydown: [t[1] ||=
|
|
1993
|
-
onBlur: t[3] ||= (e) =>
|
|
1994
|
-
onClick: t[4] ||=
|
|
1995
|
-
onDblclick: t[5] ||=
|
|
1996
|
-
}, null, 544)), [[
|
|
2009
|
+
onKeydown: [t[1] ||= pe(E((e) => zr(!0), ["stop", "prevent"]), ["enter"]), t[2] ||= pe(E((e) => zr(!1), ["stop", "prevent"]), ["esc"])],
|
|
2010
|
+
onBlur: t[3] ||= (e) => zr(!0),
|
|
2011
|
+
onClick: t[4] ||= E(() => {}, ["stop"]),
|
|
2012
|
+
onDblclick: t[5] ||= E(() => {}, ["stop"])
|
|
2013
|
+
}, null, 544)), [[de, Lr.value]]) : se(e.$slots, `cell-${i.key}`, {
|
|
1997
2014
|
task: n.task,
|
|
1998
|
-
value:
|
|
1999
|
-
}, () => [
|
|
2000
|
-
class:
|
|
2001
|
-
onDblclick:
|
|
2002
|
-
},
|
|
2003
|
-
], 64)) :
|
|
2015
|
+
value: Dr(n.task, i)
|
|
2016
|
+
}, () => [m("span", {
|
|
2017
|
+
class: v(["truncate", n.parent ? "font-medium" : ""]),
|
|
2018
|
+
onDblclick: E((e) => r.readonly ? D("task-dblclick", n.task, e) : Rr(n.task.id), ["stop"])
|
|
2019
|
+
}, C(Dr(n.task, i)), 43, Xe)], void 0, 4)
|
|
2020
|
+
], 64)) : se(e.$slots, `cell-${i.key}`, {
|
|
2004
2021
|
task: n.task,
|
|
2005
|
-
value:
|
|
2006
|
-
}, () => [
|
|
2007
|
-
|
|
2022
|
+
value: Dr(n.task, i)
|
|
2023
|
+
}, () => [m("span", Ze, C(Dr(n.task, i)), 1)], void 0, 1)], 6))), 128))], 46, Ke))), 128)),
|
|
2024
|
+
Vn.value ? (b(), p("div", {
|
|
2008
2025
|
key: 0,
|
|
2009
|
-
class:
|
|
2010
|
-
style:
|
|
2011
|
-
top: `${(bt.value.get(
|
|
2026
|
+
class: v(["pointer-events-none absolute right-2 z-20", Vn.value.where === "inside" ? "rounded-sm border-2 border-primary" : "h-0.5 rounded-full bg-primary"]),
|
|
2027
|
+
style: y(Vn.value.where === "inside" ? {
|
|
2028
|
+
top: `${(bt.value.get(Vn.value.target) ?? 0) * r.rowHeight + 2}px`,
|
|
2012
2029
|
height: `${r.rowHeight - 4}px`,
|
|
2013
2030
|
left: "8px"
|
|
2014
2031
|
} : {
|
|
2015
|
-
top: `${((bt.value.get(
|
|
2016
|
-
left: `${8 + (
|
|
2032
|
+
top: `${((bt.value.get(Vn.value.target) ?? 0) + +(Vn.value.where === "after")) * r.rowHeight - 1}px`,
|
|
2033
|
+
left: `${8 + (Y.value[bt.value.get(Vn.value.target) ?? 0]?.depth ?? 0) * Jt.value}px`
|
|
2017
2034
|
})
|
|
2018
|
-
}, null, 6)) :
|
|
2019
|
-
|
|
2020
|
-
label:
|
|
2035
|
+
}, null, 6)) : f("", !0),
|
|
2036
|
+
te(We, {
|
|
2037
|
+
label: w(k).ganttResize,
|
|
2021
2038
|
value: kt.value,
|
|
2022
2039
|
active: zn.value,
|
|
2023
|
-
"grip-top":
|
|
2024
|
-
onPointerdown:
|
|
2025
|
-
onDblclick: t[6] ||= (e) => Ot(
|
|
2026
|
-
onKeydown: [t[7] ||=
|
|
2040
|
+
"grip-top": w(Z).top + Math.max(0, w(Z).height - _t) / 2,
|
|
2041
|
+
onPointerdown: Yn,
|
|
2042
|
+
onDblclick: t[6] ||= (e) => Ot(w(Et)),
|
|
2043
|
+
onKeydown: [t[7] ||= pe(E((e) => Ot(Math.max(120, Dt.value - 16)), ["prevent"]), ["left"]), t[8] ||= pe(E((e) => Ot(Dt.value + 16), ["prevent"]), ["right"])]
|
|
2027
2044
|
}, null, 8, [
|
|
2028
2045
|
"label",
|
|
2029
2046
|
"value",
|
|
2030
2047
|
"active",
|
|
2031
2048
|
"grip-top"
|
|
2032
2049
|
])
|
|
2033
|
-
], 12, Ge)) :
|
|
2050
|
+
], 12, Ge)) : f("", !0), m("div", {
|
|
2034
2051
|
class: "relative shrink-0 cursor-grab select-none [-webkit-user-drag:none] active:cursor-grabbing",
|
|
2035
|
-
style:
|
|
2052
|
+
style: y({ width: `${w(Q)}px` }),
|
|
2036
2053
|
"aria-hidden": "true",
|
|
2037
|
-
onPointerdown:
|
|
2038
|
-
onDragstart: t[12] ||=
|
|
2054
|
+
onPointerdown: qn,
|
|
2055
|
+
onDragstart: t[12] ||= E(() => {}, ["prevent"])
|
|
2039
2056
|
}, [
|
|
2040
|
-
|
|
2041
|
-
"off-times":
|
|
2042
|
-
cells:
|
|
2043
|
-
"today-x":
|
|
2057
|
+
te(He, {
|
|
2058
|
+
"off-times": w(Wt),
|
|
2059
|
+
cells: w(Ut),
|
|
2060
|
+
"today-x": w(Ft) === null ? null : w(It)(w(Ft))
|
|
2044
2061
|
}, null, 8, [
|
|
2045
2062
|
"off-times",
|
|
2046
2063
|
"cells",
|
|
2047
2064
|
"today-x"
|
|
2048
2065
|
]),
|
|
2049
|
-
(
|
|
2066
|
+
(b(!0), p(c, null, S($t.value, (e) => (b(), p("div", {
|
|
2050
2067
|
key: `r${e.task.id}`,
|
|
2051
|
-
class:
|
|
2052
|
-
style:
|
|
2068
|
+
class: v(["absolute inset-x-0", G.value.has(e.task.id) ? "bg-secondary-container/40" : ""]),
|
|
2069
|
+
style: y({
|
|
2053
2070
|
top: `${e.index * r.rowHeight}px`,
|
|
2054
2071
|
height: `${r.rowHeight}px`
|
|
2055
2072
|
})
|
|
2056
2073
|
}, null, 6))), 128)),
|
|
2057
|
-
(
|
|
2074
|
+
(b(), p("svg", {
|
|
2058
2075
|
class: "pointer-events-none absolute inset-0 overflow-visible",
|
|
2059
|
-
width:
|
|
2076
|
+
width: w(Q),
|
|
2060
2077
|
height: en.value
|
|
2061
|
-
}, [(
|
|
2078
|
+
}, [(b(!0), p(c, null, S(bn.value, (e) => (b(), p("g", {
|
|
2062
2079
|
key: e.key,
|
|
2063
2080
|
ref_for: !0,
|
|
2064
2081
|
ref: (t) => wn(e.key, t),
|
|
2065
|
-
class:
|
|
2082
|
+
class: v(["m3-gantt-link", on.value.has(e.key) ? "text-error" : Tn.value === e.key ? "text-primary" : "text-outline"])
|
|
2066
2083
|
}, [
|
|
2067
|
-
|
|
2084
|
+
m("path", {
|
|
2068
2085
|
fill: "none",
|
|
2069
2086
|
stroke: "transparent",
|
|
2070
2087
|
class: "pointer-events-auto cursor-pointer [stroke-width:12px] pointer-coarse:[stroke-width:28px]",
|
|
2071
|
-
onPointerdown: t[9] ||=
|
|
2072
|
-
onClick:
|
|
2073
|
-
Tn.value = e.key,
|
|
2088
|
+
onPointerdown: t[9] ||= E(() => {}, ["stop"]),
|
|
2089
|
+
onClick: E((t) => {
|
|
2090
|
+
Tn.value = e.key, K([]);
|
|
2074
2091
|
}, ["stop"])
|
|
2075
2092
|
}, null, 40, $e),
|
|
2076
|
-
|
|
2093
|
+
m("path", {
|
|
2077
2094
|
fill: "none",
|
|
2078
2095
|
stroke: "currentColor",
|
|
2079
2096
|
"stroke-width": Tn.value === e.key || on.value.has(e.key) ? 2.5 : 1.5,
|
|
2080
2097
|
"stroke-linejoin": "round"
|
|
2081
2098
|
}, null, 8, et),
|
|
2082
|
-
t[16] ||=
|
|
2099
|
+
t[16] ||= m("path", {
|
|
2083
2100
|
fill: "currentColor",
|
|
2084
2101
|
stroke: "currentColor",
|
|
2085
2102
|
"stroke-width": "1",
|
|
2086
2103
|
"stroke-linejoin": "round"
|
|
2087
2104
|
}, null, -1)
|
|
2088
|
-
], 2))), 128)),
|
|
2105
|
+
], 2))), 128)), Bn.value ? (b(), p("path", {
|
|
2089
2106
|
key: 0,
|
|
2090
2107
|
fill: "none",
|
|
2091
2108
|
"stroke-width": "2",
|
|
2092
2109
|
"stroke-dasharray": "6 4",
|
|
2093
|
-
class:
|
|
2094
|
-
d: `M${
|
|
2095
|
-
}, null, 10, tt)) :
|
|
2096
|
-
Tn.value && En.value && !r.readonly ? (
|
|
2110
|
+
class: v(Bn.value.valid ? "stroke-primary" : "stroke-outline"),
|
|
2111
|
+
d: `M${Bn.value.fromEnd ? _n(Bn.value.from).x + _n(Bn.value.from).w : _n(Bn.value.from).x},${(bt.value.get(Bn.value.from) ?? 0) * r.rowHeight + r.rowHeight / 2} L${Bn.value.x},${Bn.value.y}`
|
|
2112
|
+
}, null, 10, tt)) : f("", !0)], 8, Qe)),
|
|
2113
|
+
Tn.value && En.value && !r.readonly ? (b(), p("button", {
|
|
2097
2114
|
key: 0,
|
|
2098
2115
|
type: "button",
|
|
2099
2116
|
"data-gantt-action": "",
|
|
2100
2117
|
class: "absolute z-10 flex size-6 -translate-1/2 items-center justify-center rounded-full bg-error text-on-error shadow-elevation-2 pointer-coarse:size-10",
|
|
2101
|
-
style:
|
|
2118
|
+
style: y({
|
|
2102
2119
|
left: `${En.value.x}px`,
|
|
2103
2120
|
top: `${En.value.y}px`
|
|
2104
2121
|
}),
|
|
2105
|
-
"aria-label":
|
|
2106
|
-
onPointerdown: t[10] ||=
|
|
2107
|
-
onClick: t[11] ||=
|
|
2108
|
-
}, [...t[17] ||= [
|
|
2109
|
-
(
|
|
2122
|
+
"aria-label": w(k).ganttUnlink,
|
|
2123
|
+
onPointerdown: t[10] ||= E(() => {}, ["stop"]),
|
|
2124
|
+
onClick: t[11] ||= E((e) => Dn(Tn.value.split(">")[0], Tn.value.split(">")[1]), ["stop"])
|
|
2125
|
+
}, [...t[17] ||= [m("span", { class: "material-symbols-outlined text-[16px]" }, "close", -1)]], 44, nt)) : f("", !0),
|
|
2126
|
+
(b(!0), p(c, null, S($t.value, (e) => (b(), p(c, { key: `g${e.task.id}` }, [Or(e.task) ? (b(), p("div", {
|
|
2110
2127
|
key: 0,
|
|
2111
2128
|
class: "pointer-events-none absolute h-1 rounded-full bg-outline",
|
|
2112
|
-
style:
|
|
2129
|
+
style: y({
|
|
2113
2130
|
top: `${e.index * r.rowHeight + r.rowHeight / 2 + tn.value / 2 + 2}px`,
|
|
2114
|
-
left: `${
|
|
2115
|
-
width: `${
|
|
2131
|
+
left: `${Or(e.task).x}px`,
|
|
2132
|
+
width: `${Or(e.task).w}px`
|
|
2116
2133
|
})
|
|
2117
|
-
}, null, 4)) :
|
|
2118
|
-
(
|
|
2134
|
+
}, null, 4)) : f("", !0)], 64))), 128)),
|
|
2135
|
+
(b(!0), p(c, null, S($t.value, (n) => (b(), p("div", {
|
|
2119
2136
|
key: `b${n.task.id}`,
|
|
2120
2137
|
ref_for: !0,
|
|
2121
2138
|
ref: (e) => gn(n.task.id, e),
|
|
2122
2139
|
"data-gantt-flip": n.task.id,
|
|
2123
|
-
class:
|
|
2124
|
-
style:
|
|
2140
|
+
class: v(["m3-gantt-bar group absolute left-0", [n.task.class, Rn.value?.taskId === n.task.id ? "z-10" : ""]]),
|
|
2141
|
+
style: y({
|
|
2125
2142
|
top: `${n.index * r.rowHeight + (r.rowHeight - tn.value) / 2}px`,
|
|
2126
2143
|
height: `${tn.value}px`
|
|
2127
2144
|
})
|
|
2128
2145
|
}, [
|
|
2129
|
-
|
|
2146
|
+
w(B)(n.task) ? (b(), p("div", {
|
|
2130
2147
|
key: 0,
|
|
2131
2148
|
class: "absolute top-1/2 left-0 hidden size-11 -translate-1/2 pointer-coarse:block",
|
|
2132
|
-
onPointerdown: (e) =>
|
|
2133
|
-
}, null, 40, it)) :
|
|
2134
|
-
|
|
2149
|
+
onPointerdown: (e) => Kn(e, n.task, "body")
|
|
2150
|
+
}, null, 40, it)) : f("", !0),
|
|
2151
|
+
w(B)(n.task) ? (b(), p("div", {
|
|
2135
2152
|
key: 1,
|
|
2136
2153
|
"data-gantt-task": n.task.id,
|
|
2137
|
-
class:
|
|
2138
|
-
an.value.has(n.task.id) ? "bg-error" :
|
|
2139
|
-
|
|
2154
|
+
class: v(["absolute top-1/2 left-0 -translate-1/2 rotate-45 rounded-[3px] shadow-elevation-1", [
|
|
2155
|
+
an.value.has(n.task.id) ? "bg-error" : Ar[n.task.color ?? "tertiary"].solid,
|
|
2156
|
+
G.value.has(n.task.id) ? "ring-2 ring-on-surface ring-offset-2 ring-offset-surface" : "",
|
|
2140
2157
|
r.readonly ? "" : "cursor-grab"
|
|
2141
2158
|
]]),
|
|
2142
|
-
style:
|
|
2159
|
+
style: y({
|
|
2143
2160
|
width: `${tn.value * .8}px`,
|
|
2144
2161
|
height: `${tn.value * .8}px`
|
|
2145
2162
|
}),
|
|
2146
|
-
onPointerdown: (e) =>
|
|
2147
|
-
onPointerenter: (e) =>
|
|
2148
|
-
onPointerleave:
|
|
2163
|
+
onPointerdown: (e) => Kn(e, n.task, "body"),
|
|
2164
|
+
onPointerenter: (e) => _r(e, n.task),
|
|
2165
|
+
onPointerleave: vr,
|
|
2149
2166
|
onDblclick: (e) => D("task-dblclick", n.task, e),
|
|
2150
2167
|
onContextmenu: (e) => D("task-contextmenu", n.task, e)
|
|
2151
|
-
}, null, 46, at)) :
|
|
2168
|
+
}, null, 46, at)) : z.value.has(n.task.id) && U.value.has(n.task.id) ? (b(), p("div", {
|
|
2152
2169
|
key: 2,
|
|
2153
2170
|
"data-gantt-task": n.task.id,
|
|
2154
|
-
class:
|
|
2155
|
-
|
|
2156
|
-
|
|
2171
|
+
class: v(["m3-gantt-summary absolute inset-x-0 top-1/2 h-2.5 -translate-y-1/2 rounded-t-xs", [
|
|
2172
|
+
jr(n.task).solid,
|
|
2173
|
+
G.value.has(n.task.id) ? "ring-2 ring-on-surface ring-offset-1 ring-offset-surface" : "",
|
|
2157
2174
|
r.readonly ? "" : "cursor-grab"
|
|
2158
2175
|
]]),
|
|
2159
|
-
onPointerdown: (e) =>
|
|
2160
|
-
onPointerenter: (e) =>
|
|
2161
|
-
onPointerleave:
|
|
2176
|
+
onPointerdown: (e) => Kn(e, n.task, "body"),
|
|
2177
|
+
onPointerenter: (e) => _r(e, n.task),
|
|
2178
|
+
onPointerleave: vr,
|
|
2162
2179
|
onDblclick: (e) => D("task-dblclick", n.task, e),
|
|
2163
2180
|
onContextmenu: (e) => D("task-contextmenu", n.task, e)
|
|
2164
|
-
}, null, 42, ot)) : (
|
|
2181
|
+
}, null, 42, ot)) : (b(), p("div", {
|
|
2165
2182
|
key: 3,
|
|
2166
2183
|
"data-gantt-task": n.task.id,
|
|
2167
|
-
class:
|
|
2168
|
-
|
|
2169
|
-
|
|
2184
|
+
class: v(["absolute inset-0 overflow-hidden rounded-sm transition-shadow duration-200", [
|
|
2185
|
+
jr(n.task).bar,
|
|
2186
|
+
G.value.has(n.task.id) ? "ring-2 ring-on-surface ring-offset-1 ring-offset-surface" : "",
|
|
2170
2187
|
Rn.value?.taskId === n.task.id ? "shadow-elevation-3" : "hover:shadow-elevation-1",
|
|
2171
2188
|
r.readonly || n.task.draggable === !1 ? "" : "cursor-grab active:cursor-grabbing"
|
|
2172
2189
|
]]),
|
|
2173
|
-
onPointerdown: (e) =>
|
|
2174
|
-
onPointerenter: (e) =>
|
|
2175
|
-
onPointerleave:
|
|
2190
|
+
onPointerdown: (e) => Kn(e, n.task, "body"),
|
|
2191
|
+
onPointerenter: (e) => _r(e, n.task),
|
|
2192
|
+
onPointerleave: vr,
|
|
2176
2193
|
onDblclick: (e) => D("task-dblclick", n.task, e),
|
|
2177
2194
|
onContextmenu: (e) => D("task-contextmenu", n.task, e)
|
|
2178
|
-
}, [
|
|
2179
|
-
class:
|
|
2180
|
-
style:
|
|
2181
|
-
}, null, 6),
|
|
2195
|
+
}, [m("div", {
|
|
2196
|
+
class: v(["pointer-events-none absolute inset-y-0 left-0", jr(n.task).fill]),
|
|
2197
|
+
style: y({ width: `${n.task.progress ?? 0}%` })
|
|
2198
|
+
}, null, 6), m("div", ct, [se(e.$slots, "bar", {
|
|
2182
2199
|
task: n.task,
|
|
2183
|
-
selected:
|
|
2200
|
+
selected: G.value.has(n.task.id),
|
|
2184
2201
|
critical: an.value.has(n.task.id)
|
|
2185
|
-
}, () => [
|
|
2186
|
-
!r.readonly && n.task.resizable !== !1 && !
|
|
2202
|
+
}, () => [kr(n.task) ? (b(), p("span", lt, C(n.task.name), 1)) : f("", !0)])])], 42, st)),
|
|
2203
|
+
!r.readonly && n.task.resizable !== !1 && !w(B)(n.task) && !(z.value.has(n.task.id) && U.value.has(n.task.id)) ? (b(), p(c, { key: 4 }, S(["start", "end"], (e) => m("div", {
|
|
2187
2204
|
key: `rs${e}`,
|
|
2188
2205
|
"data-gantt-resize": e,
|
|
2189
|
-
class:
|
|
2190
|
-
onPointerdown: (t) =>
|
|
2191
|
-
}, [
|
|
2192
|
-
!
|
|
2206
|
+
class: v(["absolute inset-y-0 z-[1] flex w-3 cursor-ew-resize items-center justify-center pointer-coarse:w-7", e === "start" ? "-left-1 pointer-coarse:-left-3.5" : "-right-1 pointer-coarse:-right-3.5"]),
|
|
2207
|
+
onPointerdown: (t) => Kn(t, n.task, e)
|
|
2208
|
+
}, [m("span", { class: v(["hidden h-3/5 w-1 rounded-full bg-on-surface pointer-coarse:block", G.value.has(n.task.id) ? "opacity-100" : "opacity-0"]) }, null, 2)], 42, ut)), 64)) : f("", !0),
|
|
2209
|
+
!w(B)(n.task) && !w(ge).bar && !(z.value.has(n.task.id) && U.value.has(n.task.id)) && !kr(n.task) ? (b(), p("span", J, C(n.task.name), 1)) : w(B)(n.task) || z.value.has(n.task.id) && U.value.has(n.task.id) ? (b(), p("span", {
|
|
2193
2210
|
key: 6,
|
|
2194
|
-
class:
|
|
2195
|
-
},
|
|
2196
|
-
!r.readonly && !(
|
|
2211
|
+
class: v(["pointer-events-none absolute top-1/2 left-full -translate-y-1/2 text-label-medium whitespace-nowrap", [w(B)(n.task) ? "ml-4" : "ml-2", z.value.has(n.task.id) ? "font-medium text-on-surface" : "text-on-surface-variant"]])
|
|
2212
|
+
}, C(n.task.name), 3)) : f("", !0),
|
|
2213
|
+
!r.readonly && !(z.value.has(n.task.id) && U.value.has(n.task.id)) ? (b(), p(c, { key: 7 }, [w(B)(n.task) ? f("", !0) : (b(), p("div", {
|
|
2197
2214
|
key: 0,
|
|
2198
|
-
class:
|
|
2199
|
-
style:
|
|
2200
|
-
onPointerdown: (e) =>
|
|
2201
|
-
}, null, 46, dt)), n.task.linkable === !1 ?
|
|
2215
|
+
class: v(["absolute -bottom-2 size-0 -translate-x-1/2 cursor-ew-resize border-x-[6px] border-b-[7px] border-x-transparent border-b-on-surface-variant opacity-0 transition-opacity group-hover:opacity-100", G.value.has(n.task.id) || Rn.value?.taskId === n.task.id ? "opacity-100" : ""]),
|
|
2216
|
+
style: y({ left: `${n.task.progress ?? 0}%` }),
|
|
2217
|
+
onPointerdown: (e) => Kn(e, n.task, "progress")
|
|
2218
|
+
}, null, 46, dt)), n.task.linkable === !1 ? f("", !0) : (b(), p(c, { key: 1 }, S(["start", "end"], (e) => m("div", {
|
|
2202
2219
|
key: e,
|
|
2203
|
-
class:
|
|
2204
|
-
onPointerdown: (t) =>
|
|
2205
|
-
}, [...t[18] ||= [
|
|
2206
|
-
|
|
2220
|
+
class: v(["absolute top-1/2 flex size-5 -translate-y-1/2 cursor-crosshair items-center justify-center transition-opacity pointer-coarse:size-8", [e === "start" ? w(B)(n.task) ? "-left-9 pointer-coarse:-left-14" : "-left-5 pointer-coarse:-left-9" : w(B)(n.task) ? "left-4 pointer-coarse:left-6" : "-right-5 pointer-coarse:-right-9", G.value.has(n.task.id) || Bn.value ? "opacity-100" : "pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100"]]),
|
|
2221
|
+
onPointerdown: (t) => Kn(t, n.task, e === "start" ? "link-start" : "link-end")
|
|
2222
|
+
}, [...t[18] ||= [m("span", { class: "size-2.5 rounded-full border-2 border-primary bg-surface" }, null, -1)]], 42, ft)), 64))], 64)) : f("", !0),
|
|
2223
|
+
Bn.value?.target === n.task.id ? (b(), p("div", {
|
|
2207
2224
|
key: 8,
|
|
2208
|
-
class:
|
|
2209
|
-
}, null, 2)) :
|
|
2225
|
+
class: v(["pointer-events-none absolute -inset-1 rounded-md border-2", Bn.value.valid ? "border-primary" : "border-error"])
|
|
2226
|
+
}, null, 2)) : f("", !0)
|
|
2210
2227
|
], 14, rt))), 128)),
|
|
2211
|
-
|
|
2228
|
+
Y.value.length ? f("", !0) : (b(), p("div", {
|
|
2212
2229
|
key: 1,
|
|
2213
2230
|
class: "absolute inset-0 flex items-center justify-center p-6",
|
|
2214
|
-
style:
|
|
2215
|
-
left: `${
|
|
2216
|
-
width: `${
|
|
2231
|
+
style: y({
|
|
2232
|
+
left: `${w(Z).left}px`,
|
|
2233
|
+
width: `${w(Nt)}px`
|
|
2217
2234
|
})
|
|
2218
|
-
}, [
|
|
2235
|
+
}, [se(e.$slots, "empty", {}, () => [m("span", pt, C(w(k).ganttEmpty), 1)])], 4))
|
|
2219
2236
|
], 36)], 4)], 4)], 544),
|
|
2220
|
-
(
|
|
2237
|
+
(b(), d(l, { to: "body" }, [xr.value && !Bn.value && !Vn.value ? (b(), p("div", {
|
|
2221
2238
|
key: 0,
|
|
2222
2239
|
class: "pointer-events-none fixed z-[300] -translate-x-1/2 -translate-y-full rounded-md bg-surface-container px-3 py-2 text-on-surface shadow-elevation-2",
|
|
2223
|
-
style:
|
|
2224
|
-
left: `${
|
|
2225
|
-
top: `${
|
|
2240
|
+
style: y({
|
|
2241
|
+
left: `${Sr.value.x}px`,
|
|
2242
|
+
top: `${Sr.value.y - 8}px`
|
|
2226
2243
|
}),
|
|
2227
2244
|
role: "tooltip"
|
|
2228
|
-
}, [
|
|
2229
|
-
task:
|
|
2230
|
-
slack: rn.value.slack[
|
|
2245
|
+
}, [se(e.$slots, "tooltip", {
|
|
2246
|
+
task: xr.value,
|
|
2247
|
+
slack: rn.value.slack[xr.value.id]
|
|
2231
2248
|
}, () => [
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
!
|
|
2249
|
+
m("div", mt, C(xr.value.name), 1),
|
|
2250
|
+
m("div", ht, [
|
|
2251
|
+
ee(C(wr(xr.value.start)), 1),
|
|
2252
|
+
w(B)(xr.value) ? f("", !0) : (b(), p(c, { key: 0 }, [ee(" – " + C(wr(xr.value.end ?? xr.value.start)) + " · " + C(Tr(xr.value)), 1)], 64)),
|
|
2253
|
+
!w(B)(xr.value) && xr.value.progress !== void 0 ? (b(), p(c, { key: 1 }, [ee(" · " + C(Math.round(xr.value.progress)) + "%", 1)], 64)) : f("", !0)
|
|
2237
2254
|
]),
|
|
2238
|
-
r.criticalPath && rn.value.slack[
|
|
2255
|
+
r.criticalPath && rn.value.slack[xr.value.id] !== void 0 ? (b(), p("div", {
|
|
2239
2256
|
key: 0,
|
|
2240
|
-
class:
|
|
2241
|
-
},
|
|
2242
|
-
])], 4)) :
|
|
2243
|
-
|
|
2257
|
+
class: v(["text-body-small", an.value.has(xr.value.id) ? "text-error" : "text-on-surface-variant"])
|
|
2258
|
+
}, C(an.value.has(xr.value.id) ? w(k).ganttCritical : w(o)(w(k).ganttSlack, { n: String(Math.round(rn.value.slack[xr.value.id] * 10) / 10) }, w(k).lang)), 3)) : f("", !0)
|
|
2259
|
+
])], 4)) : f("", !0)])),
|
|
2260
|
+
m("div", gt, C(Pr.value), 1)
|
|
2244
2261
|
], 32));
|
|
2245
2262
|
}
|
|
2246
2263
|
}), bt = {
|
|
2247
2264
|
class: "m3-gantt-controls flex flex-wrap items-center gap-2 border-b border-outline-variant px-3 py-2",
|
|
2248
2265
|
role: "toolbar"
|
|
2249
|
-
},
|
|
2266
|
+
}, X = { class: "flex items-center" }, xt = /* @__PURE__ */ h({
|
|
2250
2267
|
__name: "MGanttControls",
|
|
2251
2268
|
props: {
|
|
2252
2269
|
scales: { default: () => [
|
|
@@ -2281,106 +2298,106 @@ var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset
|
|
|
2281
2298
|
}
|
|
2282
2299
|
},
|
|
2283
2300
|
setup(e) {
|
|
2284
|
-
let t = e, n =
|
|
2301
|
+
let t = e, n = g(he, null);
|
|
2285
2302
|
if (!n) throw Error("MGanttControls must be inside <MGantt> or <MResourceTimeline>");
|
|
2286
|
-
let i = n,
|
|
2303
|
+
let i = n, o = a(), l = {
|
|
2287
2304
|
hour: "ganttScaleHour",
|
|
2288
2305
|
day: "ganttScaleDay",
|
|
2289
2306
|
week: "ganttScaleWeek",
|
|
2290
2307
|
month: "ganttScaleMonth",
|
|
2291
2308
|
quarter: "ganttScaleQuarter",
|
|
2292
2309
|
year: "ganttScaleYear"
|
|
2293
|
-
},
|
|
2294
|
-
|
|
2310
|
+
}, ee = x(!1), h, _ = () => {
|
|
2311
|
+
ee.value = !!h?.matches;
|
|
2295
2312
|
};
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
}),
|
|
2299
|
-
let
|
|
2313
|
+
ie(() => {
|
|
2314
|
+
h = window.matchMedia?.("(pointer: coarse)"), _(), h?.addEventListener?.("change", _);
|
|
2315
|
+
}), ne(() => h?.removeEventListener?.("change", _));
|
|
2316
|
+
let v = u(() => ee.value ? 48 : "sm"), y = u(() => t.list && !!i.hasList?.value && !!i.setGridCollapsed), re = u(() => t.scales.map((e) => ({
|
|
2300
2317
|
value: e,
|
|
2301
|
-
label:
|
|
2318
|
+
label: o[l[e]]
|
|
2302
2319
|
})));
|
|
2303
|
-
return (t, n) => (
|
|
2304
|
-
|
|
2320
|
+
return (t, n) => (b(), p("div", bt, [
|
|
2321
|
+
y.value ? (b(), d(r, {
|
|
2305
2322
|
key: 0,
|
|
2306
|
-
size:
|
|
2307
|
-
icon:
|
|
2308
|
-
label:
|
|
2309
|
-
onClick: n[0] ||= (e) =>
|
|
2323
|
+
size: v.value,
|
|
2324
|
+
icon: w(i).gridCollapsed.value ? "left_panel_open" : "left_panel_close",
|
|
2325
|
+
label: w(i).gridCollapsed.value ? w(o).ganttShowList : w(o).ganttHideList,
|
|
2326
|
+
onClick: n[0] ||= (e) => w(i).setGridCollapsed(!w(i).gridCollapsed.value)
|
|
2310
2327
|
}, null, 8, [
|
|
2311
2328
|
"size",
|
|
2312
2329
|
"icon",
|
|
2313
2330
|
"label"
|
|
2314
|
-
])) :
|
|
2315
|
-
|
|
2316
|
-
re.value.length ? (
|
|
2331
|
+
])) : f("", !0),
|
|
2332
|
+
se(t.$slots, "default"),
|
|
2333
|
+
re.value.length ? (b(), d(s, {
|
|
2317
2334
|
key: 1,
|
|
2318
|
-
"model-value":
|
|
2335
|
+
"model-value": w(i).scale.value,
|
|
2319
2336
|
options: re.value,
|
|
2320
2337
|
density: "compact",
|
|
2321
|
-
"onUpdate:modelValue": n[1] ||= (e) =>
|
|
2322
|
-
}, null, 8, ["model-value", "options"])) :
|
|
2323
|
-
|
|
2324
|
-
e.zoom ? (
|
|
2325
|
-
size:
|
|
2338
|
+
"onUpdate:modelValue": n[1] ||= (e) => w(i).setScale(e)
|
|
2339
|
+
}, null, 8, ["model-value", "options"])) : f("", !0),
|
|
2340
|
+
m("div", X, [
|
|
2341
|
+
e.zoom ? (b(), p(c, { key: 0 }, [te(r, {
|
|
2342
|
+
size: v.value,
|
|
2326
2343
|
icon: "zoom_out",
|
|
2327
|
-
label:
|
|
2328
|
-
onClick: n[2] ||= (e) =>
|
|
2329
|
-
}, null, 8, ["size", "label"]),
|
|
2330
|
-
size:
|
|
2344
|
+
label: w(o).ganttZoomOut,
|
|
2345
|
+
onClick: n[2] ||= (e) => w(i).zoomOut()
|
|
2346
|
+
}, null, 8, ["size", "label"]), te(r, {
|
|
2347
|
+
size: v.value,
|
|
2331
2348
|
icon: "zoom_in",
|
|
2332
|
-
label:
|
|
2333
|
-
onClick: n[3] ||= (e) =>
|
|
2334
|
-
}, null, 8, ["size", "label"])], 64)) :
|
|
2335
|
-
e.fit ? (
|
|
2349
|
+
label: w(o).ganttZoomIn,
|
|
2350
|
+
onClick: n[3] ||= (e) => w(i).zoomIn()
|
|
2351
|
+
}, null, 8, ["size", "label"])], 64)) : f("", !0),
|
|
2352
|
+
e.fit ? (b(), d(r, {
|
|
2336
2353
|
key: 1,
|
|
2337
|
-
size:
|
|
2354
|
+
size: v.value,
|
|
2338
2355
|
icon: "fit_width",
|
|
2339
|
-
label:
|
|
2340
|
-
onClick: n[4] ||= (e) =>
|
|
2341
|
-
}, null, 8, ["size", "label"])) :
|
|
2342
|
-
e.today ? (
|
|
2356
|
+
label: w(o).ganttFit,
|
|
2357
|
+
onClick: n[4] ||= (e) => w(i).fit()
|
|
2358
|
+
}, null, 8, ["size", "label"])) : f("", !0),
|
|
2359
|
+
e.today ? (b(), d(r, {
|
|
2343
2360
|
key: 2,
|
|
2344
|
-
size:
|
|
2361
|
+
size: v.value,
|
|
2345
2362
|
icon: "today",
|
|
2346
|
-
label:
|
|
2347
|
-
onClick: n[5] ||= (e) =>
|
|
2348
|
-
}, null, 8, ["size", "label"])) :
|
|
2349
|
-
e.fold &&
|
|
2363
|
+
label: w(o).ganttToday,
|
|
2364
|
+
onClick: n[5] ||= (e) => w(i).scrollToDate()
|
|
2365
|
+
}, null, 8, ["size", "label"])) : f("", !0),
|
|
2366
|
+
e.fold && w(i).foldable.value ? (b(), d(r, {
|
|
2350
2367
|
key: 3,
|
|
2351
|
-
size:
|
|
2352
|
-
icon:
|
|
2353
|
-
label:
|
|
2354
|
-
onClick: n[6] ||= (e) =>
|
|
2368
|
+
size: v.value,
|
|
2369
|
+
icon: w(i).folded.value ? "unfold_more" : "unfold_less",
|
|
2370
|
+
label: w(i).folded.value ? w(o).ganttExpandAll : w(o).ganttCollapseAll,
|
|
2371
|
+
onClick: n[6] ||= (e) => w(i).folded.value ? w(i).expandAll() : w(i).collapseAll()
|
|
2355
2372
|
}, null, 8, [
|
|
2356
2373
|
"size",
|
|
2357
2374
|
"icon",
|
|
2358
2375
|
"label"
|
|
2359
|
-
])) :
|
|
2360
|
-
e.history && !
|
|
2361
|
-
size:
|
|
2376
|
+
])) : f("", !0),
|
|
2377
|
+
e.history && !w(i).readonly.value ? (b(), p(c, { key: 4 }, [te(r, {
|
|
2378
|
+
size: v.value,
|
|
2362
2379
|
icon: "undo",
|
|
2363
|
-
label:
|
|
2364
|
-
disabled: !
|
|
2365
|
-
onClick: n[7] ||= (e) =>
|
|
2380
|
+
label: w(o).ganttUndo,
|
|
2381
|
+
disabled: !w(i).canUndo.value,
|
|
2382
|
+
onClick: n[7] ||= (e) => w(i).undo()
|
|
2366
2383
|
}, null, 8, [
|
|
2367
2384
|
"size",
|
|
2368
2385
|
"label",
|
|
2369
2386
|
"disabled"
|
|
2370
|
-
]),
|
|
2371
|
-
size:
|
|
2387
|
+
]), te(r, {
|
|
2388
|
+
size: v.value,
|
|
2372
2389
|
icon: "redo",
|
|
2373
|
-
label:
|
|
2374
|
-
disabled: !
|
|
2375
|
-
onClick: n[8] ||= (e) =>
|
|
2390
|
+
label: w(o).ganttRedo,
|
|
2391
|
+
disabled: !w(i).canRedo.value,
|
|
2392
|
+
onClick: n[8] ||= (e) => w(i).redo()
|
|
2376
2393
|
}, null, 8, [
|
|
2377
2394
|
"size",
|
|
2378
2395
|
"label",
|
|
2379
2396
|
"disabled"
|
|
2380
|
-
])], 64)) :
|
|
2397
|
+
])], 64)) : f("", !0)
|
|
2381
2398
|
]),
|
|
2382
|
-
n[9] ||=
|
|
2383
|
-
|
|
2399
|
+
n[9] ||= m("div", { class: "flex-1" }, null, -1),
|
|
2400
|
+
se(t.$slots, "end")
|
|
2384
2401
|
]));
|
|
2385
2402
|
}
|
|
2386
2403
|
});
|
|
@@ -2497,7 +2514,7 @@ function kt(e, t) {
|
|
|
2497
2514
|
return i[4] ? `${r}T${i[4].padStart(2, "0")}:${i[5]}` : r;
|
|
2498
2515
|
}
|
|
2499
2516
|
let a = Date.parse(n);
|
|
2500
|
-
return Number.isNaN(a) ? void 0 :
|
|
2517
|
+
return Number.isNaN(a) ? void 0 : N(a, !/\d:\d/.test(n));
|
|
2501
2518
|
}
|
|
2502
2519
|
function At(e, t = {}) {
|
|
2503
2520
|
let n = e.split(/\r?\n/, 1)[0] ?? "", r = t.separator ?? [
|
|
@@ -2560,7 +2577,7 @@ function Mt(e) {
|
|
|
2560
2577
|
};
|
|
2561
2578
|
});
|
|
2562
2579
|
}
|
|
2563
|
-
function
|
|
2580
|
+
function Z(e) {
|
|
2564
2581
|
return e.replace(/<!\[CDATA\[([\s\S]*?)\]\]>/g, "$1").replace(/&#x([0-9a-f]+);/gi, (e, t) => String.fromCodePoint(parseInt(t, 16))).replace(/&#(\d+);/g, (e, t) => String.fromCodePoint(Number(t))).replace(/</g, "<").replace(/>/g, ">").replace(/"/g, "\"").replace(/'/g, "'").replace(/&/g, "&");
|
|
2565
2582
|
}
|
|
2566
2583
|
function Nt(e) {
|
|
@@ -2571,7 +2588,7 @@ function Nt(e) {
|
|
|
2571
2588
|
}, n = [t], r = /<!--[\s\S]*?-->|<\?[\s\S]*?\?>|<!\[CDATA\[[\s\S]*?\]\]>|<![^>]*>|<\/?([\w:.-]+)[^>]*?(\/?)>|[^<]+/g;
|
|
2572
2589
|
for (let t; t = r.exec(e);) {
|
|
2573
2590
|
let e = t[0], r = n.at(-1);
|
|
2574
|
-
if (e.startsWith("<![CDATA[")) r.text +=
|
|
2591
|
+
if (e.startsWith("<![CDATA[")) r.text += Z(e);
|
|
2575
2592
|
else if (e.startsWith("<!") || e.startsWith("<?")) continue;
|
|
2576
2593
|
else if (e.startsWith("</")) {
|
|
2577
2594
|
let e = t[1].replace(/^.*:/, "");
|
|
@@ -2583,18 +2600,18 @@ function Nt(e) {
|
|
|
2583
2600
|
text: ""
|
|
2584
2601
|
};
|
|
2585
2602
|
r.children.push(e), t[2] || n.push(e);
|
|
2586
|
-
} else r.text +=
|
|
2603
|
+
} else r.text += Z(e);
|
|
2587
2604
|
}
|
|
2588
2605
|
return t;
|
|
2589
2606
|
}
|
|
2590
|
-
var Pt = (e, t) => e?.children.find((e) => e.name === t),
|
|
2607
|
+
var Pt = (e, t) => e?.children.find((e) => e.name === t), Q = (e, t) => Pt(e, t)?.text.trim() ?? "", Ft = [
|
|
2591
2608
|
"FF",
|
|
2592
2609
|
"FS",
|
|
2593
2610
|
"SF",
|
|
2594
2611
|
"SS"
|
|
2595
2612
|
], It = 4800, Lt = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
2596
2613
|
function Rt(e) {
|
|
2597
|
-
return `${
|
|
2614
|
+
return `${N(e, !1).slice(0, 16)}:00`;
|
|
2598
2615
|
}
|
|
2599
2616
|
function zt(e) {
|
|
2600
2617
|
let t = Math.round(e / 6e4);
|
|
@@ -2614,7 +2631,7 @@ function Bt(e, t = {}) {
|
|
|
2614
2631
|
};
|
|
2615
2632
|
c(void 0, 1);
|
|
2616
2633
|
let l = new Map(s.map((e, t) => [e.t.id, t + 1])), u = (e, t, i) => {
|
|
2617
|
-
let a =
|
|
2634
|
+
let a = V({
|
|
2618
2635
|
start: t ?? e.start,
|
|
2619
2636
|
end: i ?? e.end,
|
|
2620
2637
|
type: e.type
|
|
@@ -2624,7 +2641,7 @@ function Bt(e, t = {}) {
|
|
|
2624
2641
|
finish: a.end,
|
|
2625
2642
|
work: a.end - a.start
|
|
2626
2643
|
};
|
|
2627
|
-
let o = a.end > a.start ?
|
|
2644
|
+
let o = a.end > a.start ? F(a.end, -1) : a.start, s = Math.max(0, Math.round((P(a.end) - P(a.start)) / O));
|
|
2628
2645
|
return {
|
|
2629
2646
|
start: a.start + n * 36e5,
|
|
2630
2647
|
finish: a.end > a.start ? o + r * 36e5 : a.start + n * 36e5,
|
|
@@ -2660,21 +2677,21 @@ function Vt(e, t = {}) {
|
|
|
2660
2677
|
let n = Pt(Nt(e), "Project");
|
|
2661
2678
|
if (!n) throw SyntaxError("Not a Microsoft Project XML file (no <Project>)");
|
|
2662
2679
|
let r = (Pt(n, "Tasks")?.children.filter((e) => e.name === "Task") ?? []).map((e) => ({
|
|
2663
|
-
uid:
|
|
2664
|
-
name:
|
|
2665
|
-
level: Number(
|
|
2666
|
-
start:
|
|
2667
|
-
finish:
|
|
2668
|
-
progress: Number(
|
|
2669
|
-
milestone:
|
|
2670
|
-
summary:
|
|
2671
|
-
nullTask:
|
|
2672
|
-
baseline: e.children.find((e) => e.name === "Baseline" && (
|
|
2680
|
+
uid: Q(e, "UID"),
|
|
2681
|
+
name: Q(e, "Name"),
|
|
2682
|
+
level: Number(Q(e, "OutlineLevel") || 1),
|
|
2683
|
+
start: Q(e, "Start"),
|
|
2684
|
+
finish: Q(e, "Finish"),
|
|
2685
|
+
progress: Number(Q(e, "PercentComplete") || 0),
|
|
2686
|
+
milestone: Q(e, "Milestone") === "1",
|
|
2687
|
+
summary: Q(e, "Summary") === "1",
|
|
2688
|
+
nullTask: Q(e, "IsNull") === "1",
|
|
2689
|
+
baseline: e.children.find((e) => e.name === "Baseline" && (Q(e, "Number") || "0") === "0"),
|
|
2673
2690
|
links: e.children.filter((e) => e.name === "PredecessorLink")
|
|
2674
|
-
})).filter((e) => e.uid && e.start && !e.nullTask && !(e.uid === "0" && e.level <= 0)), i = r.every((e) => /T(0?0:00|0?8:00|0?9:00)/.test(e.start) && (e.milestone || /T(0?0:00|1[6-8]:00|23:59)/.test(e.finish))), a = t.dates === "date" || t.dates !== "datetime" && i, o = (e) =>
|
|
2691
|
+
})).filter((e) => e.uid && e.start && !e.nullTask && !(e.uid === "0" && e.level <= 0)), i = r.every((e) => /T(0?0:00|0?8:00|0?9:00)/.test(e.start) && (e.milestone || /T(0?0:00|1[6-8]:00|23:59)/.test(e.finish))), a = t.dates === "date" || t.dates !== "datetime" && i, o = (e) => N(j(e.slice(0, 19)), a), s = (e) => {
|
|
2675
2692
|
if (!a) return o(e);
|
|
2676
2693
|
let t = j(e.slice(0, 19));
|
|
2677
|
-
return
|
|
2694
|
+
return N(P(t) === t ? F(t, -1) : t, !0);
|
|
2678
2695
|
}, c = [], l = r.map((e) => {
|
|
2679
2696
|
c.length = Math.max(0, e.level - 1);
|
|
2680
2697
|
let t = {
|
|
@@ -2684,12 +2701,12 @@ function Vt(e, t = {}) {
|
|
|
2684
2701
|
};
|
|
2685
2702
|
e.milestone ? t.type = "milestone" : t.end = A(t.start) ? s(e.finish) : o(e.finish), t.end && j(t.end) < j(t.start) && (t.end = t.start), e.progress && (t.progress = e.progress);
|
|
2686
2703
|
let n = c[e.level - 2];
|
|
2687
|
-
n && (t.parentId = n), c[e.level - 1] = e.uid, e.summary && (t.type = "summary"), e.baseline &&
|
|
2704
|
+
n && (t.parentId = n), c[e.level - 1] = e.uid, e.summary && (t.type = "summary"), e.baseline && Q(e.baseline, "Start") && (t.baselineStart = o(Q(e.baseline, "Start")), !e.milestone && Q(e.baseline, "Finish") && (t.baselineEnd = A(t.baselineStart) ? s(Q(e.baseline, "Finish")) : o(Q(e.baseline, "Finish"))));
|
|
2688
2705
|
let r = [];
|
|
2689
2706
|
for (let t of e.links) {
|
|
2690
|
-
let e =
|
|
2707
|
+
let e = Q(t, "PredecessorUID");
|
|
2691
2708
|
if (!e) continue;
|
|
2692
|
-
let n = Ft[Number(
|
|
2709
|
+
let n = Ft[Number(Q(t, "Type") || 1)] ?? "FS", i = Math.round(Number(Q(t, "LinkLag") || 0) / It * 100) / 100;
|
|
2693
2710
|
r.push(n === "FS" && !i ? e : {
|
|
2694
2711
|
id: e,
|
|
2695
2712
|
type: n,
|
|
@@ -2697,7 +2714,7 @@ function Vt(e, t = {}) {
|
|
|
2697
2714
|
});
|
|
2698
2715
|
}
|
|
2699
2716
|
return r.length && (t.dependencies = r), t;
|
|
2700
|
-
}), u =
|
|
2717
|
+
}), u = Q(n, "Title") || Q(n, "Name") || void 0;
|
|
2701
2718
|
return {
|
|
2702
2719
|
...u ? { name: u } : {},
|
|
2703
2720
|
tasks: l
|
|
@@ -2706,7 +2723,7 @@ function Vt(e, t = {}) {
|
|
|
2706
2723
|
// src/composables/useResourceTimeline.ts
|
|
2707
2724
|
var Ht = Symbol("m3-resource-timeline");
|
|
2708
2725
|
function Ut() {
|
|
2709
|
-
let e =
|
|
2726
|
+
let e = g(Ht, null);
|
|
2710
2727
|
if (!e) throw Error("useResourceTimeline() must be called inside <MResourceTimeline>");
|
|
2711
2728
|
return e;
|
|
2712
2729
|
}
|
|
@@ -2730,7 +2747,7 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
2730
2747
|
}, an = ["title"], on = ["data-timeline-resize", "onPointerdown"], sn = { class: "text-body-medium text-on-surface-variant" }, cn = {
|
|
2731
2748
|
class: "sr-only",
|
|
2732
2749
|
"aria-live": "polite"
|
|
2733
|
-
}, ln = 40, un = 56, dn = 400, fn = /* @__PURE__ */
|
|
2750
|
+
}, ln = 40, un = 56, dn = 400, fn = /* @__PURE__ */ h({
|
|
2734
2751
|
__name: "MResourceTimeline",
|
|
2735
2752
|
props: {
|
|
2736
2753
|
events: { default: () => [] },
|
|
@@ -2779,63 +2796,63 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
2779
2796
|
"delete"
|
|
2780
2797
|
],
|
|
2781
2798
|
setup(e, { expose: t, emit: n }) {
|
|
2782
|
-
let r = e,
|
|
2783
|
-
|
|
2784
|
-
|
|
2799
|
+
let r = e, s = n, l = a(), d = u(() => r.locale ?? (l.lang === "en" ? void 0 : l.lang)), h = ce(r.events);
|
|
2800
|
+
T(() => r.events, (e) => {
|
|
2801
|
+
h.value = e;
|
|
2785
2802
|
});
|
|
2786
|
-
let
|
|
2787
|
-
function
|
|
2788
|
-
|
|
2803
|
+
let g = ce(null), re = u(() => g.value ?? h.value), ae = [], ue = [], de = x(0);
|
|
2804
|
+
function fe(e) {
|
|
2805
|
+
h.value = e, s("update:events", e);
|
|
2789
2806
|
}
|
|
2790
|
-
function
|
|
2791
|
-
|
|
2807
|
+
function me(e) {
|
|
2808
|
+
ae.push(le(h.value)), ae.length > 100 && ae.shift(), ue.length = 0, de.value++, fe(e);
|
|
2792
2809
|
}
|
|
2793
2810
|
function D() {
|
|
2794
|
-
let e =
|
|
2795
|
-
e && (
|
|
2811
|
+
let e = ae.pop();
|
|
2812
|
+
e && (ue.push(le(h.value)), de.value++, fe(e));
|
|
2796
2813
|
}
|
|
2797
2814
|
function k() {
|
|
2798
|
-
let e =
|
|
2799
|
-
e && (
|
|
2815
|
+
let e = ue.pop();
|
|
2816
|
+
e && (ae.push(le(h.value)), de.value++, fe(e));
|
|
2800
2817
|
}
|
|
2801
|
-
let
|
|
2802
|
-
|
|
2803
|
-
e && (
|
|
2818
|
+
let _e = u(() => (de.value, ae.length > 0)), A = u(() => (de.value, ue.length > 0)), M = u(() => new Map(re.value.map((e) => [e.id, e]))), P = u(() => new Map(r.resources.map((e) => [e.id, e]))), F = x(r.selection ?? []);
|
|
2819
|
+
T(() => r.selection, (e) => {
|
|
2820
|
+
e && (F.value = e);
|
|
2804
2821
|
});
|
|
2805
|
-
let ve =
|
|
2806
|
-
function
|
|
2807
|
-
let t = e.filter((e) =>
|
|
2808
|
-
|
|
2822
|
+
let ve = u(() => new Set(F.value));
|
|
2823
|
+
function I(e) {
|
|
2824
|
+
let t = e.filter((e) => M.value.get(e)?.selectable !== !1);
|
|
2825
|
+
F.value = t, s("update:selection", t);
|
|
2809
2826
|
}
|
|
2810
|
-
let ye =
|
|
2811
|
-
|
|
2827
|
+
let ye = x(r.collapsed ?? []);
|
|
2828
|
+
T(() => r.collapsed, (e) => {
|
|
2812
2829
|
e && (ye.value = e);
|
|
2813
2830
|
});
|
|
2814
|
-
let xe =
|
|
2831
|
+
let xe = u(() => new Set(ye.value));
|
|
2815
2832
|
function Se(e) {
|
|
2816
|
-
ye.value = e,
|
|
2833
|
+
ye.value = e, s("update:collapsed", e);
|
|
2817
2834
|
}
|
|
2818
|
-
let Ce = (e) => Se(xe.value.has(e) ? ye.value.filter((t) => t !== e) : [...ye.value, e]),
|
|
2835
|
+
let Ce = (e) => Se(xe.value.has(e) ? ye.value.filter((t) => t !== e) : [...ye.value, e]), L = u(() => {
|
|
2819
2836
|
let e = /* @__PURE__ */ new Map();
|
|
2820
|
-
for (let t of
|
|
2821
|
-
let n =
|
|
2837
|
+
for (let t of re.value) {
|
|
2838
|
+
let n = V({
|
|
2822
2839
|
start: t.start,
|
|
2823
2840
|
end: t.end
|
|
2824
2841
|
});
|
|
2825
2842
|
Number.isFinite(n.start) && e.set(t.id, n);
|
|
2826
2843
|
}
|
|
2827
2844
|
return e;
|
|
2828
|
-
}), we =
|
|
2845
|
+
}), we = u(() => {
|
|
2829
2846
|
let e = /* @__PURE__ */ new Map();
|
|
2830
|
-
for (let t of
|
|
2831
|
-
for (let t of e.values()) t.sort((e, t) =>
|
|
2847
|
+
for (let t of re.value) L.value.has(t.id) && (e.get(t.resourceId) ?? e.set(t.resourceId, []).get(t.resourceId)).push(t);
|
|
2848
|
+
for (let t of e.values()) t.sort((e, t) => L.value.get(e.id).start - L.value.get(t.id).start);
|
|
2832
2849
|
return e;
|
|
2833
|
-
}), Te =
|
|
2850
|
+
}), Te = u(() => {
|
|
2834
2851
|
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
|
|
2835
2852
|
for (let [n, r] of we.value) {
|
|
2836
2853
|
let i = [];
|
|
2837
2854
|
for (let t of r) {
|
|
2838
|
-
let n =
|
|
2855
|
+
let n = L.value.get(t.id), r = i.findIndex((e) => e <= n.start);
|
|
2839
2856
|
r < 0 && (r = i.length, i.push(0)), i[r] = n.end, e.set(t.id, r);
|
|
2840
2857
|
}
|
|
2841
2858
|
t.set(n, Math.max(1, i.length));
|
|
@@ -2854,11 +2871,11 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
2854
2871
|
}
|
|
2855
2872
|
return r;
|
|
2856
2873
|
}
|
|
2857
|
-
let De =
|
|
2874
|
+
let De = u(() => {
|
|
2858
2875
|
let e = /* @__PURE__ */ new Map();
|
|
2859
|
-
for (let [t, n] of we.value) for (let [r, i] of Ee(n,
|
|
2876
|
+
for (let [t, n] of we.value) for (let [r, i] of Ee(n, P.value.get(t)?.capacity ?? 1, L.value)) e.set(r, i);
|
|
2860
2877
|
return e;
|
|
2861
|
-
}),
|
|
2878
|
+
}), R = u(() => new Set(De.value.keys())), z = u(() => {
|
|
2862
2879
|
let e = [], t = /* @__PURE__ */ new Map(), n = [];
|
|
2863
2880
|
for (let e of r.resources) e.group ? (t.has(e.group) || (t.set(e.group, []), n.push(e.group)), t.get(e.group).push(e)) : n.push(e);
|
|
2864
2881
|
let i = 0, a = (t) => {
|
|
@@ -2887,28 +2904,28 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
2887
2904
|
}), i += ln, xe.value.has(r) || n.forEach(a);
|
|
2888
2905
|
}
|
|
2889
2906
|
return e;
|
|
2890
|
-
}), ke =
|
|
2907
|
+
}), ke = u(() => {
|
|
2891
2908
|
let e = /* @__PURE__ */ new Map();
|
|
2892
|
-
for (let t of
|
|
2909
|
+
for (let t of z.value) t.kind === "resource" && e.set(t.resource.id, t);
|
|
2893
2910
|
return e;
|
|
2894
|
-
}), Ae =
|
|
2895
|
-
let e =
|
|
2911
|
+
}), Ae = u(() => {
|
|
2912
|
+
let e = z.value.at(-1);
|
|
2896
2913
|
return e ? e.top + e.height : 0;
|
|
2897
|
-
}),
|
|
2898
|
-
|
|
2914
|
+
}), B = (e) => P.value.get(e)?.group, H = x(), Me = x(r.listWidth ?? 220);
|
|
2915
|
+
T(() => r.listWidth, (e) => {
|
|
2899
2916
|
e !== void 0 && (Me.value = e);
|
|
2900
2917
|
});
|
|
2901
|
-
let
|
|
2918
|
+
let U = u(() => Me.value), Ne = u(() => {
|
|
2902
2919
|
let e = Infinity, t = -Infinity;
|
|
2903
|
-
for (let n of
|
|
2920
|
+
for (let n of L.value.values()) e = Math.min(e, n.start), t = Math.max(t, n.end);
|
|
2904
2921
|
let n = r.start ? j(r.start) : r.now ? j(r.now) : Date.now();
|
|
2905
2922
|
return Number.isFinite(e) || (e = n, t = n + O), {
|
|
2906
2923
|
min: Math.min(e, n),
|
|
2907
2924
|
max: Math.max(t, n + O)
|
|
2908
2925
|
};
|
|
2909
|
-
}),
|
|
2910
|
-
scroller:
|
|
2911
|
-
listWidth:
|
|
2926
|
+
}), W = Ie({
|
|
2927
|
+
scroller: H,
|
|
2928
|
+
listWidth: U,
|
|
2912
2929
|
headerHeight: un,
|
|
2913
2930
|
extent: Ne,
|
|
2914
2931
|
scale: () => r.scale,
|
|
@@ -2916,8 +2933,8 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
2916
2933
|
minPxPerDay: () => r.minPxPerDay,
|
|
2917
2934
|
maxPxPerDay: () => r.maxPxPerDay,
|
|
2918
2935
|
weekStartsOn: () => r.weekStartsOn,
|
|
2919
|
-
lang:
|
|
2920
|
-
quarterLabel: () =>
|
|
2936
|
+
lang: d,
|
|
2937
|
+
quarterLabel: () => l.ganttQuarter,
|
|
2921
2938
|
today: () => r.now,
|
|
2922
2939
|
calendar: () => r.calendar ?? { workingDays: [
|
|
2923
2940
|
0,
|
|
@@ -2929,45 +2946,45 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
2929
2946
|
6
|
|
2930
2947
|
] },
|
|
2931
2948
|
workHours: () => r.workHours,
|
|
2932
|
-
onScale: (e) =>
|
|
2949
|
+
onScale: (e) => s("update:scale", e),
|
|
2933
2950
|
onPinch: () => {
|
|
2934
|
-
|
|
2951
|
+
J && Z({ pointerId: J.id });
|
|
2935
2952
|
}
|
|
2936
|
-
}), { ppd:
|
|
2937
|
-
let e =
|
|
2938
|
-
return
|
|
2939
|
-
}), Qe =
|
|
2953
|
+
}), { ppd: G, view: K, timelineView: Pe, timelineWidth: Fe, todayMs: ze, xOf: q, timeAt: Ve, zoomIn: Ue, zoomOut: Ge, setScale: Ke, scrollToDate: qe, topCells: Je, bottomCells: Ye, offTimes: Xe } = W, Ze = u(() => {
|
|
2954
|
+
let e = K.value.top - dn, t = K.value.top + K.value.height + dn;
|
|
2955
|
+
return z.value.filter((n) => n.top + n.height >= e && n.top <= t);
|
|
2956
|
+
}), Qe = u(() => Ve(K.value.left - 400)), $e = u(() => Ve(K.value.left + Pe.value + 400)), et = u(() => {
|
|
2940
2957
|
let e = [];
|
|
2941
2958
|
for (let t of Ze.value) if (t.kind === "resource") for (let n of we.value.get(t.resource.id) ?? []) {
|
|
2942
|
-
let r =
|
|
2959
|
+
let r = L.value.get(n.id);
|
|
2943
2960
|
r.end >= Qe.value && r.start <= $e.value && e.push({
|
|
2944
2961
|
event: n,
|
|
2945
2962
|
row: t
|
|
2946
2963
|
});
|
|
2947
2964
|
}
|
|
2948
2965
|
return e;
|
|
2949
|
-
}), tt =
|
|
2966
|
+
}), tt = u(() => r.laneHeight - 8), nt = u(() => {
|
|
2950
2967
|
let e = /* @__PURE__ */ new Map();
|
|
2951
|
-
for (let t of
|
|
2952
|
-
let n =
|
|
2968
|
+
for (let t of re.value) {
|
|
2969
|
+
let n = L.value.get(t.id), i = ke.value.get(t.resourceId);
|
|
2953
2970
|
if (!n || !i) continue;
|
|
2954
2971
|
let a = (Te.value.count.get(t.resourceId) ?? 1) * r.laneHeight, o = i.top + (i.height - a) / 2 + (Te.value.lane.get(t.id) ?? 0) * r.laneHeight + 4;
|
|
2955
2972
|
e.set(t.id, {
|
|
2956
|
-
x:
|
|
2973
|
+
x: q(n.start),
|
|
2957
2974
|
y: o,
|
|
2958
|
-
w: Math.max(4,
|
|
2975
|
+
w: Math.max(4, q(n.end) - q(n.start))
|
|
2959
2976
|
});
|
|
2960
2977
|
}
|
|
2961
2978
|
return e;
|
|
2962
2979
|
}), rt = /* @__PURE__ */ new Map(), it = /* @__PURE__ */ new Map(), at = 0, ot = {
|
|
2963
|
-
ppd:
|
|
2964
|
-
origin:
|
|
2980
|
+
ppd: G.value,
|
|
2981
|
+
origin: W.origin.value
|
|
2965
2982
|
};
|
|
2966
|
-
|
|
2967
|
-
let t = ot.ppd !==
|
|
2983
|
+
T(nt, (e) => {
|
|
2984
|
+
let t = ot.ppd !== G.value || ot.origin !== W.origin.value || i();
|
|
2968
2985
|
ot = {
|
|
2969
|
-
ppd:
|
|
2970
|
-
origin:
|
|
2986
|
+
ppd: G.value,
|
|
2987
|
+
origin: W.origin.value
|
|
2971
2988
|
};
|
|
2972
2989
|
let n = !1;
|
|
2973
2990
|
for (let [r, i] of e) {
|
|
@@ -3030,49 +3047,49 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
3030
3047
|
function ut(e, t) {
|
|
3031
3048
|
t instanceof HTMLElement ? (it.set(e, t), ct(e, t)) : it.delete(e);
|
|
3032
3049
|
}
|
|
3033
|
-
let
|
|
3034
|
-
|
|
3050
|
+
let J = null, dt, ft = x(null), pt = x(!1), mt = x(r.listWidth ?? 220);
|
|
3051
|
+
T(() => r.listWidth, (e) => {
|
|
3035
3052
|
e !== void 0 && (mt.value = e);
|
|
3036
3053
|
});
|
|
3037
3054
|
function ht(e) {
|
|
3038
|
-
Me.value = e,
|
|
3055
|
+
Me.value = e, s("update:listWidth", e);
|
|
3039
3056
|
}
|
|
3040
|
-
let gt =
|
|
3057
|
+
let gt = x(null), _t = x(!1), vt = {
|
|
3041
3058
|
x: 0,
|
|
3042
3059
|
y: 0
|
|
3043
3060
|
}, yt = (e) => e instanceof Element && !!e.closest("input, textarea, select, button, a, [contenteditable], [data-timeline-action]");
|
|
3044
|
-
function
|
|
3061
|
+
function Y(e) {
|
|
3045
3062
|
e.pointerType !== "touch" && e.preventDefault();
|
|
3046
3063
|
}
|
|
3047
3064
|
function bt(e, t) {
|
|
3048
|
-
let n =
|
|
3065
|
+
let n = H.value.getBoundingClientRect();
|
|
3049
3066
|
return {
|
|
3050
|
-
x: e - n.left -
|
|
3051
|
-
y: t - n.top - un +
|
|
3067
|
+
x: e - n.left - U.value + H.value.scrollLeft,
|
|
3068
|
+
y: t - n.top - un + H.value.scrollTop
|
|
3052
3069
|
};
|
|
3053
3070
|
}
|
|
3054
|
-
function
|
|
3055
|
-
let t =
|
|
3071
|
+
function X(e) {
|
|
3072
|
+
let t = z.value.find((t) => e >= t.top && e < t.top + t.height);
|
|
3056
3073
|
return t?.kind === "resource" ? t.resource : void 0;
|
|
3057
3074
|
}
|
|
3058
3075
|
function xt(e) {
|
|
3059
|
-
return e ? 1440 : r.snap ?? (
|
|
3076
|
+
return e ? 1440 : r.snap ?? (G.value >= 192 ? 15 : Oe(G.value));
|
|
3060
3077
|
}
|
|
3061
3078
|
function St(e, t, n) {
|
|
3062
3079
|
if (e.button !== 0 || yt(e.target)) return;
|
|
3063
|
-
e.stopPropagation(),
|
|
3064
|
-
let r =
|
|
3080
|
+
e.stopPropagation(), Y(e);
|
|
3081
|
+
let r = L.value.get(t.id);
|
|
3065
3082
|
if (!r) return;
|
|
3066
3083
|
let i = e.pointerType === "touch";
|
|
3067
|
-
|
|
3084
|
+
J = {
|
|
3068
3085
|
kind: "event",
|
|
3069
3086
|
part: n,
|
|
3070
3087
|
id: e.pointerId,
|
|
3071
3088
|
eventId: t.id,
|
|
3072
3089
|
sx: e.clientX,
|
|
3073
3090
|
sy: e.clientY,
|
|
3074
|
-
sl:
|
|
3075
|
-
st:
|
|
3091
|
+
sl: H.value.scrollLeft,
|
|
3092
|
+
st: H.value.scrollTop,
|
|
3076
3093
|
touch: i,
|
|
3077
3094
|
active: !1,
|
|
3078
3095
|
span: r,
|
|
@@ -3081,9 +3098,9 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
3081
3098
|
}
|
|
3082
3099
|
function Ct(e) {
|
|
3083
3100
|
if (e.button !== 0 || yt(e.target)) return;
|
|
3084
|
-
|
|
3085
|
-
let t = bt(e.clientX, e.clientY), n =
|
|
3086
|
-
n && r.creatable && !r.readonly ? (
|
|
3101
|
+
Y(e);
|
|
3102
|
+
let t = bt(e.clientX, e.clientY), n = X(t.y), i = e.pointerType === "touch";
|
|
3103
|
+
n && r.creatable && !r.readonly ? (J = {
|
|
3087
3104
|
kind: "empty",
|
|
3088
3105
|
id: e.pointerId,
|
|
3089
3106
|
resourceId: n.id,
|
|
@@ -3092,7 +3109,7 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
3092
3109
|
t0: Ve(t.x),
|
|
3093
3110
|
touch: i,
|
|
3094
3111
|
active: !1
|
|
3095
|
-
}, Tt(), i && (dt = setTimeout(() => Dt(), 350))) : i ? n && (
|
|
3112
|
+
}, Tt(), i && (dt = setTimeout(() => Dt(), 350))) : i ? n && (J = {
|
|
3096
3113
|
kind: "empty",
|
|
3097
3114
|
id: e.pointerId,
|
|
3098
3115
|
resourceId: n.id,
|
|
@@ -3101,19 +3118,19 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
3101
3118
|
t0: Ve(t.x),
|
|
3102
3119
|
touch: i,
|
|
3103
3120
|
active: !1
|
|
3104
|
-
}, Tt()) : (
|
|
3121
|
+
}, Tt()) : (J = {
|
|
3105
3122
|
kind: "pan",
|
|
3106
3123
|
id: e.pointerId,
|
|
3107
3124
|
sx: e.clientX,
|
|
3108
3125
|
sy: e.clientY,
|
|
3109
|
-
sl:
|
|
3110
|
-
st:
|
|
3126
|
+
sl: H.value.scrollLeft,
|
|
3127
|
+
st: H.value.scrollTop,
|
|
3111
3128
|
moved: !1,
|
|
3112
3129
|
resourceId: n?.id
|
|
3113
3130
|
}, Tt());
|
|
3114
3131
|
}
|
|
3115
3132
|
function wt(e) {
|
|
3116
|
-
e.button === 0 && (e.preventDefault(),
|
|
3133
|
+
e.button === 0 && (e.preventDefault(), J = {
|
|
3117
3134
|
kind: "split",
|
|
3118
3135
|
id: e.pointerId,
|
|
3119
3136
|
sx: e.clientX,
|
|
@@ -3121,18 +3138,18 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
3121
3138
|
}, pt.value = !0, Le("col-resize"), Tt());
|
|
3122
3139
|
}
|
|
3123
3140
|
function Tt() {
|
|
3124
|
-
window.addEventListener("pointermove", Ot), window.addEventListener("pointerup", Mt), window.addEventListener("pointercancel",
|
|
3141
|
+
window.addEventListener("pointermove", Ot), window.addEventListener("pointerup", Mt), window.addEventListener("pointercancel", Z);
|
|
3125
3142
|
}
|
|
3126
3143
|
function Et() {
|
|
3127
|
-
window.removeEventListener("pointermove", Ot), window.removeEventListener("pointerup", Mt), window.removeEventListener("pointercancel",
|
|
3144
|
+
window.removeEventListener("pointermove", Ot), window.removeEventListener("pointerup", Mt), window.removeEventListener("pointercancel", Z), clearTimeout(dt), Re(), pt.value = !1;
|
|
3128
3145
|
}
|
|
3129
3146
|
function Dt() {
|
|
3130
|
-
let e =
|
|
3147
|
+
let e = J;
|
|
3131
3148
|
if (!(!e || e.kind !== "event" && e.kind !== "empty" || e.active)) {
|
|
3132
3149
|
if (e.kind === "event") {
|
|
3133
|
-
let t =
|
|
3150
|
+
let t = M.value.get(e.eventId);
|
|
3134
3151
|
if (!t || r.readonly || e.part === "body" && t.draggable === !1 || e.part !== "body" && t.resizable === !1) return;
|
|
3135
|
-
e.active = !0, ve.value.has(t.id) ||
|
|
3152
|
+
e.active = !0, ve.value.has(t.id) || I([t.id]), ft.value = {
|
|
3136
3153
|
id: t.id,
|
|
3137
3154
|
part: e.part
|
|
3138
3155
|
};
|
|
@@ -3143,22 +3160,22 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
3143
3160
|
gt.value = {
|
|
3144
3161
|
resourceId: e.resourceId,
|
|
3145
3162
|
start: n,
|
|
3146
|
-
end: n + Math.max(t,
|
|
3163
|
+
end: n + Math.max(t, ge)
|
|
3147
3164
|
};
|
|
3148
3165
|
}
|
|
3149
3166
|
e.touch && navigator.vibrate?.(10), Le(e.kind === "event" && e.part !== "body" ? "ew-resize" : e.kind === "event" ? "grabbing" : "crosshair"), Pt();
|
|
3150
3167
|
}
|
|
3151
3168
|
}
|
|
3152
3169
|
function Ot(e) {
|
|
3153
|
-
let t =
|
|
3170
|
+
let t = J;
|
|
3154
3171
|
if (t && t.id === e.pointerId) {
|
|
3155
|
-
if (vt.x = e.clientX, vt.y = e.clientY, t.kind === "split") ht(Math.round(Math.min(Math.max(0, t.w + e.clientX - t.sx), Math.max(160,
|
|
3172
|
+
if (vt.x = e.clientX, vt.y = e.clientY, t.kind === "split") ht(Math.round(Math.min(Math.max(0, t.w + e.clientX - t.sx), Math.max(160, K.value.width - 80))));
|
|
3156
3173
|
else {
|
|
3157
3174
|
if (t.kind === "pan") return kt(t, e);
|
|
3158
3175
|
if (!t.active) {
|
|
3159
3176
|
let n = Math.hypot(e.clientX - t.sx, e.clientY - t.sy);
|
|
3160
3177
|
if (t.touch) {
|
|
3161
|
-
n > 8 && (
|
|
3178
|
+
n > 8 && (J = null, Et());
|
|
3162
3179
|
return;
|
|
3163
3180
|
}
|
|
3164
3181
|
if (n < 4) return;
|
|
@@ -3173,7 +3190,7 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
3173
3190
|
st: t.st,
|
|
3174
3191
|
moved: !0
|
|
3175
3192
|
};
|
|
3176
|
-
|
|
3193
|
+
J = n, Le("grabbing"), kt(n, e);
|
|
3177
3194
|
}
|
|
3178
3195
|
return;
|
|
3179
3196
|
}
|
|
@@ -3184,10 +3201,10 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
3184
3201
|
}
|
|
3185
3202
|
function kt(e, t) {
|
|
3186
3203
|
let n = t.clientX - e.sx, r = t.clientY - e.sy;
|
|
3187
|
-
!e.moved && Math.hypot(n, r) < 4 || (e.moved || (e.moved = !0, Le("grabbing")),
|
|
3204
|
+
!e.moved && Math.hypot(n, r) < 4 || (e.moved || (e.moved = !0, Le("grabbing")), H.value.scrollLeft = e.sl - n, H.value.scrollTop = e.st - r);
|
|
3188
3205
|
}
|
|
3189
3206
|
function At(e, t) {
|
|
3190
|
-
let n =
|
|
3207
|
+
let n = J;
|
|
3191
3208
|
if (!n || n.kind !== "event" && n.kind !== "empty" || !n.active) return;
|
|
3192
3209
|
let i = bt(e, t);
|
|
3193
3210
|
if (n.kind === "empty") {
|
|
@@ -3199,11 +3216,11 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
3199
3216
|
};
|
|
3200
3217
|
return;
|
|
3201
3218
|
}
|
|
3202
|
-
let a =
|
|
3219
|
+
let a = h.value.find((e) => e.id === n.eventId);
|
|
3203
3220
|
if (!a) return;
|
|
3204
|
-
let o = n.span, s = (e - n.sx + (
|
|
3221
|
+
let o = n.span, s = (e - n.sx + (H.value.scrollLeft - n.sl)) / G.value * O, c = xt(o.dateOnly), l = o.dateOnly ? O : c * 6e4, u;
|
|
3205
3222
|
if (n.part === "body") {
|
|
3206
|
-
let e = be(o.start + s, c), t =
|
|
3223
|
+
let e = be(o.start + s, c), t = X(i.y), n = t && !r.readonly ? t.id : a.resourceId;
|
|
3207
3224
|
u = {
|
|
3208
3225
|
...a,
|
|
3209
3226
|
...je({
|
|
@@ -3231,98 +3248,98 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
3231
3248
|
}, o.start, e)
|
|
3232
3249
|
};
|
|
3233
3250
|
}
|
|
3234
|
-
let d =
|
|
3235
|
-
|
|
3251
|
+
let d = h.value.map((e) => e.id === a.id ? u : e);
|
|
3252
|
+
g.value = d, _t.value = r.overlap === "prevent" && jt(u, d).length > 0;
|
|
3236
3253
|
}
|
|
3237
3254
|
function jt(e, t) {
|
|
3238
3255
|
let n = /* @__PURE__ */ new Map(), r = t.filter((t) => t.resourceId === e.resourceId);
|
|
3239
|
-
for (let e of r) n.set(e.id,
|
|
3256
|
+
for (let e of r) n.set(e.id, V({
|
|
3240
3257
|
start: e.start,
|
|
3241
3258
|
end: e.end
|
|
3242
3259
|
}));
|
|
3243
3260
|
r.sort((e, t) => n.get(e.id).start - n.get(t.id).start);
|
|
3244
|
-
let i = Ee(r,
|
|
3261
|
+
let i = Ee(r, P.value.get(e.resourceId)?.capacity ?? 1, n).get(e.id);
|
|
3245
3262
|
return i ? r.filter((e) => i.includes(e.id)) : [];
|
|
3246
3263
|
}
|
|
3247
3264
|
function Mt(e) {
|
|
3248
|
-
let t =
|
|
3249
|
-
if (!t || t.id !== e.pointerId || (
|
|
3265
|
+
let t = J;
|
|
3266
|
+
if (!t || t.id !== e.pointerId || (J = null, Et(), Q(), t.kind === "split")) return;
|
|
3250
3267
|
if (t.kind === "pan") {
|
|
3251
|
-
!t.moved && t.resourceId &&
|
|
3268
|
+
!t.moved && t.resourceId && s("slot-click", {
|
|
3252
3269
|
resourceId: t.resourceId,
|
|
3253
|
-
start:
|
|
3254
|
-
}), t.moved ||
|
|
3270
|
+
start: N(be(Ve(bt(e.clientX, e.clientY).x), xt(!1)), !1)
|
|
3271
|
+
}), t.moved || I([]);
|
|
3255
3272
|
return;
|
|
3256
3273
|
}
|
|
3257
3274
|
if (t.kind === "empty") {
|
|
3258
3275
|
let e = gt.value;
|
|
3259
|
-
gt.value = null, t.active && e ?
|
|
3276
|
+
gt.value = null, t.active && e ? s("create", {
|
|
3260
3277
|
resourceId: e.resourceId,
|
|
3261
|
-
start:
|
|
3262
|
-
end:
|
|
3263
|
-
}) : t.active || (
|
|
3278
|
+
start: N(e.start, !1),
|
|
3279
|
+
end: N(e.end, !1)
|
|
3280
|
+
}) : t.active || (s("slot-click", {
|
|
3264
3281
|
resourceId: t.resourceId,
|
|
3265
|
-
start:
|
|
3266
|
-
}),
|
|
3282
|
+
start: N(be(t.t0, xt(!1)), !1)
|
|
3283
|
+
}), I([]));
|
|
3267
3284
|
return;
|
|
3268
3285
|
}
|
|
3269
3286
|
ft.value = null;
|
|
3270
|
-
let n =
|
|
3287
|
+
let n = M.value.get(t.eventId);
|
|
3271
3288
|
if (!t.active) {
|
|
3272
|
-
if (
|
|
3273
|
-
n.selectable !== !1 && (e.shiftKey || e.ctrlKey || e.metaKey ?
|
|
3289
|
+
if (g.value = null, !n) return;
|
|
3290
|
+
n.selectable !== !1 && (e.shiftKey || e.ctrlKey || e.metaKey ? I(ve.value.has(n.id) ? F.value.filter((e) => e !== n.id) : [...F.value, n.id]) : I([n.id])), s("event-click", n, e);
|
|
3274
3291
|
return;
|
|
3275
3292
|
}
|
|
3276
|
-
let i =
|
|
3277
|
-
|
|
3278
|
-
let a = i?.find((e) => e.id === t.eventId),
|
|
3279
|
-
if (_t.value = !1, i && a &&
|
|
3293
|
+
let i = g.value;
|
|
3294
|
+
g.value = null;
|
|
3295
|
+
let a = i?.find((e) => e.id === t.eventId), o = h.value.find((e) => e.id === t.eventId);
|
|
3296
|
+
if (_t.value = !1, i && a && o && (a.start !== o.start || a.end !== o.end || a.resourceId !== o.resourceId)) {
|
|
3280
3297
|
if (r.overlap === "prevent") {
|
|
3281
3298
|
let e = jt(a, i);
|
|
3282
3299
|
if (e.length) {
|
|
3283
|
-
|
|
3300
|
+
s("conflict", {
|
|
3284
3301
|
event: a,
|
|
3285
3302
|
with: e
|
|
3286
|
-
}), Lt(
|
|
3303
|
+
}), Lt(l.timelineConflict);
|
|
3287
3304
|
return;
|
|
3288
3305
|
}
|
|
3289
3306
|
}
|
|
3290
|
-
|
|
3307
|
+
me(i), s("change", {
|
|
3291
3308
|
events: [a],
|
|
3292
3309
|
kind: t.part === "body" ? "move" : "resize"
|
|
3293
3310
|
}), Bt(a);
|
|
3294
3311
|
}
|
|
3295
3312
|
}
|
|
3296
|
-
function
|
|
3297
|
-
|
|
3313
|
+
function Z(e) {
|
|
3314
|
+
J && J.id === e.pointerId && (J = null, Et(), Q(), g.value = null, ft.value = null, gt.value = null, _t.value = !1);
|
|
3298
3315
|
}
|
|
3299
3316
|
let Nt = 0;
|
|
3300
3317
|
function Pt() {
|
|
3301
3318
|
if (Nt) return;
|
|
3302
3319
|
let e = () => {
|
|
3303
3320
|
Nt = requestAnimationFrame(e);
|
|
3304
|
-
let t =
|
|
3305
|
-
if (!t || !
|
|
3306
|
-
let n = t.getBoundingClientRect(), r = n.left +
|
|
3321
|
+
let t = H.value;
|
|
3322
|
+
if (!t || !J || !("active" in J) || !J.active) return;
|
|
3323
|
+
let n = t.getBoundingClientRect(), r = n.left + U.value, i = 0, a = 0;
|
|
3307
3324
|
vt.x < r + 40 ? i = -Math.ceil((r + 40 - vt.x) / 4) : vt.x > n.right - 40 && (i = Math.ceil((vt.x - n.right + 40) / 4)), vt.y < n.top + un + 40 ? a = -Math.ceil((n.top + un + 40 - vt.y) / 4) : vt.y > n.bottom - 40 && (a = Math.ceil((vt.y - n.bottom + 40) / 4)), (i || a) && (t.scrollLeft += i, t.scrollTop += a, At(vt.x, vt.y));
|
|
3308
3325
|
};
|
|
3309
3326
|
Nt = requestAnimationFrame(e);
|
|
3310
3327
|
}
|
|
3311
|
-
function
|
|
3328
|
+
function Q() {
|
|
3312
3329
|
cancelAnimationFrame(Nt), Nt = 0;
|
|
3313
3330
|
}
|
|
3314
3331
|
function Ft(e) {
|
|
3315
|
-
|
|
3332
|
+
W.pinchMove(e) || J && "active" in J && J.active && e.cancelable && e.preventDefault();
|
|
3316
3333
|
}
|
|
3317
|
-
let It =
|
|
3334
|
+
let It = x("");
|
|
3318
3335
|
function Lt(e) {
|
|
3319
|
-
It.value = "",
|
|
3336
|
+
It.value = "", _(() => {
|
|
3320
3337
|
It.value = e;
|
|
3321
3338
|
});
|
|
3322
3339
|
}
|
|
3323
3340
|
function Rt(e) {
|
|
3324
3341
|
let t = j(e), n = /^\d{4}-\d{2}-\d{2}$/.test(e);
|
|
3325
|
-
return new Intl.DateTimeFormat(
|
|
3342
|
+
return new Intl.DateTimeFormat(d.value, n ? {
|
|
3326
3343
|
day: "numeric",
|
|
3327
3344
|
month: "short"
|
|
3328
3345
|
} : {
|
|
@@ -3334,32 +3351,37 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
3334
3351
|
function zt(e) {
|
|
3335
3352
|
let t = j(e.start), n = j(e.end);
|
|
3336
3353
|
if (/^\d{4}-\d{2}-\d{2}$/.test(e.start)) return `${Rt(e.start)} – ${Rt(e.end)}`;
|
|
3337
|
-
let r = (e) => new Intl.DateTimeFormat(
|
|
3354
|
+
let r = (e) => new Intl.DateTimeFormat(d.value, new Date(e).getMinutes() ? {
|
|
3338
3355
|
hour: "numeric",
|
|
3339
3356
|
minute: "2-digit"
|
|
3340
3357
|
} : { hour: "numeric" }).format(e);
|
|
3341
3358
|
return `${r(t)}–${r(n)}`;
|
|
3342
3359
|
}
|
|
3343
3360
|
function Bt(e) {
|
|
3344
|
-
Lt(
|
|
3361
|
+
Lt(o(l.timelineMoved, {
|
|
3362
|
+
title: e.title,
|
|
3363
|
+
resource: P.value.get(e.resourceId)?.name ?? "",
|
|
3364
|
+
start: Rt(e.start),
|
|
3365
|
+
end: Rt(e.end)
|
|
3366
|
+
}, l.lang));
|
|
3345
3367
|
}
|
|
3346
3368
|
function Vt(e) {
|
|
3347
|
-
|
|
3369
|
+
me([...h.value, ...Array.isArray(e) ? e : [e]]);
|
|
3348
3370
|
}
|
|
3349
3371
|
function Ut(e, t) {
|
|
3350
|
-
|
|
3372
|
+
me(h.value.map((n) => n.id === e ? typeof t == "function" ? t(n) : {
|
|
3351
3373
|
...n,
|
|
3352
3374
|
...t
|
|
3353
3375
|
} : n));
|
|
3354
3376
|
}
|
|
3355
3377
|
async function fn(e) {
|
|
3356
|
-
let t =
|
|
3378
|
+
let t = h.value.filter((t) => e.includes(t.id) && t.deletable !== !1);
|
|
3357
3379
|
if (!t.length || r.beforeDelete && !await r.beforeDelete(t)) return;
|
|
3358
3380
|
let n = new Set(t.map((e) => e.id));
|
|
3359
|
-
|
|
3381
|
+
me(h.value.filter((e) => !n.has(e.id))), I(F.value.filter((e) => !n.has(e))), s("delete", { events: t }), Lt(o(l.ganttDeleted, { count: String(t.length) }, l.lang));
|
|
3360
3382
|
}
|
|
3361
3383
|
function pn() {
|
|
3362
|
-
return
|
|
3384
|
+
return z.value.filter((e) => e.kind === "resource");
|
|
3363
3385
|
}
|
|
3364
3386
|
function mn(e, t) {
|
|
3365
3387
|
let n = e.ctrlKey || e.metaKey;
|
|
@@ -3372,29 +3394,29 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
3372
3394
|
return;
|
|
3373
3395
|
}
|
|
3374
3396
|
if (e.key === "Enter") {
|
|
3375
|
-
e.preventDefault(),
|
|
3397
|
+
e.preventDefault(), s("event-dblclick", t, e);
|
|
3376
3398
|
return;
|
|
3377
3399
|
}
|
|
3378
3400
|
if (r.readonly) return;
|
|
3379
3401
|
if (e.key === "Delete" || e.key === "Backspace") {
|
|
3380
|
-
e.preventDefault(), fn(ve.value.has(t.id) ?
|
|
3402
|
+
e.preventDefault(), fn(ve.value.has(t.id) ? F.value : [t.id]);
|
|
3381
3403
|
return;
|
|
3382
3404
|
}
|
|
3383
|
-
let i =
|
|
3405
|
+
let i = L.value.get(t.id);
|
|
3384
3406
|
if (!i) return;
|
|
3385
|
-
let a = i.dateOnly ? O : xt(!1) * 6e4,
|
|
3407
|
+
let a = i.dateOnly ? O : xt(!1) * 6e4, o = null;
|
|
3386
3408
|
if ((e.key === "ArrowLeft" || e.key === "ArrowRight") && t.draggable !== !1) {
|
|
3387
3409
|
let n = e.key === "ArrowLeft" ? -a : a;
|
|
3388
3410
|
if (e.shiftKey) {
|
|
3389
3411
|
if (t.resizable === !1) return;
|
|
3390
|
-
|
|
3412
|
+
o = {
|
|
3391
3413
|
...t,
|
|
3392
3414
|
...je({
|
|
3393
3415
|
start: t.start,
|
|
3394
3416
|
end: t.end
|
|
3395
3417
|
}, i.start, Math.max(i.start + a, i.end + n))
|
|
3396
3418
|
};
|
|
3397
|
-
} else
|
|
3419
|
+
} else o = {
|
|
3398
3420
|
...t,
|
|
3399
3421
|
...je({
|
|
3400
3422
|
start: t.start,
|
|
@@ -3403,28 +3425,28 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
3403
3425
|
};
|
|
3404
3426
|
} else if ((e.key === "ArrowUp" || e.key === "ArrowDown") && t.draggable !== !1) {
|
|
3405
3427
|
let n = pn(), r = n[n.findIndex((e) => e.resource.id === t.resourceId) + (e.key === "ArrowUp" ? -1 : 1)];
|
|
3406
|
-
r && (
|
|
3428
|
+
r && (o = {
|
|
3407
3429
|
...t,
|
|
3408
3430
|
resourceId: r.resource.id
|
|
3409
3431
|
});
|
|
3410
3432
|
}
|
|
3411
|
-
if (!
|
|
3433
|
+
if (!o) return;
|
|
3412
3434
|
e.preventDefault();
|
|
3413
|
-
let
|
|
3414
|
-
r.overlap === "prevent" && jt(
|
|
3415
|
-
event:
|
|
3416
|
-
with: jt(
|
|
3417
|
-
}), Lt(
|
|
3418
|
-
events: [
|
|
3435
|
+
let c = h.value.map((e) => e.id === t.id ? o : e);
|
|
3436
|
+
r.overlap === "prevent" && jt(o, c).length ? (s("conflict", {
|
|
3437
|
+
event: o,
|
|
3438
|
+
with: jt(o, c)
|
|
3439
|
+
}), Lt(l.timelineConflict)) : (me(c), s("change", {
|
|
3440
|
+
events: [o],
|
|
3419
3441
|
kind: e.shiftKey ? "resize" : "move"
|
|
3420
|
-
}), Bt(
|
|
3442
|
+
}), Bt(o), _(() => it.get(t.id)?.querySelector("[data-timeline-event]")?.focus({ preventScroll: !0 })));
|
|
3421
3443
|
}
|
|
3422
3444
|
function hn(e) {
|
|
3423
|
-
let t =
|
|
3445
|
+
let t = M.value.get(e);
|
|
3424
3446
|
if (!t) return;
|
|
3425
|
-
let n =
|
|
3426
|
-
n && xe.value.has(n) && Ce(n),
|
|
3427
|
-
let t = nt.value.get(e), n =
|
|
3447
|
+
let n = B(t.resourceId);
|
|
3448
|
+
n && xe.value.has(n) && Ce(n), _(() => {
|
|
3449
|
+
let t = nt.value.get(e), n = H.value;
|
|
3428
3450
|
t && n && n.scrollTo({
|
|
3429
3451
|
left: Math.max(0, t.x - 48),
|
|
3430
3452
|
top: Math.max(0, t.y - 48),
|
|
@@ -3449,24 +3471,24 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
3449
3471
|
error: "bg-error",
|
|
3450
3472
|
success: "bg-success",
|
|
3451
3473
|
neutral: "bg-outline"
|
|
3452
|
-
}, yn = (e) => e.color ??
|
|
3474
|
+
}, yn = (e) => e.color ?? P.value.get(e.resourceId)?.color ?? "primary";
|
|
3453
3475
|
function bn(e) {
|
|
3454
3476
|
return e.split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0].toUpperCase()).join("");
|
|
3455
3477
|
}
|
|
3456
|
-
let xn =
|
|
3478
|
+
let xn = u(() => {
|
|
3457
3479
|
let e = /* @__PURE__ */ new Map();
|
|
3458
|
-
for (let t of
|
|
3459
|
-
let n =
|
|
3460
|
-
n && e.set(t.resourceId, (e.get(t.resourceId) ?? 0) + (n.end - n.start) /
|
|
3480
|
+
for (let t of re.value) {
|
|
3481
|
+
let n = L.value.get(t.id);
|
|
3482
|
+
n && e.set(t.resourceId, (e.get(t.resourceId) ?? 0) + (n.end - n.start) / ge);
|
|
3461
3483
|
}
|
|
3462
3484
|
return e;
|
|
3463
3485
|
}), Sn = {
|
|
3464
|
-
events:
|
|
3465
|
-
selection:
|
|
3466
|
-
conflicts:
|
|
3467
|
-
scale:
|
|
3468
|
-
pxPerDay:
|
|
3469
|
-
canUndo:
|
|
3486
|
+
events: u(() => re.value),
|
|
3487
|
+
selection: u(() => F.value),
|
|
3488
|
+
conflicts: R,
|
|
3489
|
+
scale: W.scaleNow,
|
|
3490
|
+
pxPerDay: G,
|
|
3491
|
+
canUndo: _e,
|
|
3470
3492
|
canRedo: A,
|
|
3471
3493
|
undo: D,
|
|
3472
3494
|
redo: k,
|
|
@@ -3475,26 +3497,26 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
3475
3497
|
setScale: Ke,
|
|
3476
3498
|
scrollToDate: qe,
|
|
3477
3499
|
scrollToEvent: hn,
|
|
3478
|
-
setSelection:
|
|
3500
|
+
setSelection: I,
|
|
3479
3501
|
addEvents: Vt,
|
|
3480
3502
|
updateEvent: Ut,
|
|
3481
3503
|
removeEvents: fn,
|
|
3482
3504
|
dateAt: (e) => {
|
|
3483
|
-
let t =
|
|
3484
|
-
return
|
|
3505
|
+
let t = H.value?.getBoundingClientRect();
|
|
3506
|
+
return N(be(Ve(e - (t?.left ?? 0) - U.value + K.value.left), xt(!1)), !1);
|
|
3485
3507
|
},
|
|
3486
3508
|
resourceAt: (e) => {
|
|
3487
|
-
let t =
|
|
3488
|
-
return
|
|
3509
|
+
let t = H.value?.getBoundingClientRect();
|
|
3510
|
+
return X(e - (t?.top ?? 0) - un + K.value.top);
|
|
3489
3511
|
}
|
|
3490
3512
|
};
|
|
3491
|
-
return
|
|
3492
|
-
scale:
|
|
3493
|
-
readonly:
|
|
3494
|
-
canUndo:
|
|
3513
|
+
return oe(Ht, Sn), oe(he, {
|
|
3514
|
+
scale: W.scaleNow,
|
|
3515
|
+
readonly: u(() => r.readonly),
|
|
3516
|
+
canUndo: _e,
|
|
3495
3517
|
canRedo: A,
|
|
3496
|
-
foldable:
|
|
3497
|
-
folded:
|
|
3518
|
+
foldable: u(() => r.resources.some((e) => e.group)),
|
|
3519
|
+
folded: u(() => ye.value.length > 0),
|
|
3498
3520
|
undo: D,
|
|
3499
3521
|
redo: k,
|
|
3500
3522
|
zoomIn: Ue,
|
|
@@ -3502,199 +3524,199 @@ var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "trunc
|
|
|
3502
3524
|
setScale: Ke,
|
|
3503
3525
|
scrollToDate: qe,
|
|
3504
3526
|
fit: () => {
|
|
3505
|
-
|
|
3527
|
+
L.value.size && W.fit(Ne.value);
|
|
3506
3528
|
},
|
|
3507
3529
|
expandAll: () => Se([]),
|
|
3508
3530
|
collapseAll: () => Se([...new Set(r.resources.map((e) => e.group).filter((e) => !!e))])
|
|
3509
|
-
}),
|
|
3510
|
-
let e =
|
|
3511
|
-
e.addEventListener("touchmove", Ft, { passive: !1 }),
|
|
3531
|
+
}), ie(() => {
|
|
3532
|
+
let e = H.value;
|
|
3533
|
+
e.addEventListener("touchmove", Ft, { passive: !1 }), _(() => {
|
|
3512
3534
|
let t = r.start ? j(r.start) : ze.value ?? Ne.value.min;
|
|
3513
|
-
e.scrollLeft = Math.max(0,
|
|
3535
|
+
e.scrollLeft = Math.max(0, q(t) - Math.min(48, Pe.value / 4)), K.value.left = e.scrollLeft;
|
|
3514
3536
|
});
|
|
3515
|
-
}),
|
|
3516
|
-
|
|
3517
|
-
}), t(Sn), (t, n) => (
|
|
3537
|
+
}), ne(() => {
|
|
3538
|
+
H.value?.removeEventListener("touchmove", Ft), Et(), Q(), cancelAnimationFrame(at);
|
|
3539
|
+
}), t(Sn), (t, n) => (b(), p("div", {
|
|
3518
3540
|
class: "m3-resource-timeline flex flex-col overflow-hidden rounded-md bg-surface text-on-surface",
|
|
3519
3541
|
onKeydown: gn
|
|
3520
3542
|
}, [
|
|
3521
|
-
|
|
3522
|
-
|
|
3543
|
+
se(t.$slots, "default", { timeline: Sn }),
|
|
3544
|
+
m("div", {
|
|
3523
3545
|
ref_key: "scroller",
|
|
3524
|
-
ref:
|
|
3546
|
+
ref: H,
|
|
3525
3547
|
class: "relative min-h-0 flex-1 touch-pan-x touch-pan-y overflow-auto overscroll-contain",
|
|
3526
|
-
onScrollPassive: n[4] ||= (...e) =>
|
|
3527
|
-
onTouchstartPassive: n[5] ||= (...e) =>
|
|
3528
|
-
onTouchendPassive: n[6] ||= (...e) =>
|
|
3529
|
-
onContextmenu: n[7] ||= (e) =>
|
|
3530
|
-
}, [
|
|
3548
|
+
onScrollPassive: n[4] ||= (...e) => w(W).readView && w(W).readView(...e),
|
|
3549
|
+
onTouchstartPassive: n[5] ||= (...e) => w(W).onTouchStart && w(W).onTouchStart(...e),
|
|
3550
|
+
onTouchendPassive: n[6] ||= (...e) => w(W).onTouchEnd && w(W).onTouchEnd(...e),
|
|
3551
|
+
onContextmenu: n[7] ||= (e) => w(J) && e.preventDefault()
|
|
3552
|
+
}, [m("div", {
|
|
3531
3553
|
class: "relative",
|
|
3532
|
-
style:
|
|
3533
|
-
width: `${
|
|
3534
|
-
height: `${un + Math.max(Ae.value,
|
|
3554
|
+
style: y({
|
|
3555
|
+
width: `${U.value + w(Fe)}px`,
|
|
3556
|
+
height: `${un + Math.max(Ae.value, w(K).height - un)}px`
|
|
3535
3557
|
})
|
|
3536
|
-
}, [
|
|
3558
|
+
}, [m("div", {
|
|
3537
3559
|
class: "sticky top-0 z-20 flex",
|
|
3538
|
-
style:
|
|
3560
|
+
style: y({
|
|
3539
3561
|
height: `${un}px`,
|
|
3540
|
-
width: `${
|
|
3562
|
+
width: `${U.value + w(Fe)}px`
|
|
3541
3563
|
})
|
|
3542
|
-
}, [
|
|
3564
|
+
}, [U.value ? (b(), p("div", {
|
|
3543
3565
|
key: 0,
|
|
3544
3566
|
class: "sticky left-0 z-10 flex shrink-0 items-end border-r border-b border-outline-variant bg-surface-container-low px-4 pb-2 text-label-medium text-on-surface-variant",
|
|
3545
|
-
style:
|
|
3546
|
-
}, w(
|
|
3547
|
-
width:
|
|
3548
|
-
"top-cells":
|
|
3549
|
-
"bottom-cells":
|
|
3550
|
-
"today-x":
|
|
3567
|
+
style: y({ width: `${U.value}px` })
|
|
3568
|
+
}, C(w(l).timelineResource), 5)) : f("", !0), te(Be, {
|
|
3569
|
+
width: w(Fe),
|
|
3570
|
+
"top-cells": w(Je),
|
|
3571
|
+
"bottom-cells": w(Ye),
|
|
3572
|
+
"today-x": w(ze) === null ? null : w(q)(w(ze))
|
|
3551
3573
|
}, null, 8, [
|
|
3552
3574
|
"width",
|
|
3553
3575
|
"top-cells",
|
|
3554
3576
|
"bottom-cells",
|
|
3555
3577
|
"today-x"
|
|
3556
|
-
])], 4),
|
|
3578
|
+
])], 4), m("div", {
|
|
3557
3579
|
class: "flex",
|
|
3558
|
-
style:
|
|
3559
|
-
}, [
|
|
3580
|
+
style: y({ height: `${Math.max(Ae.value, w(K).height - un)}px` })
|
|
3581
|
+
}, [U.value ? (b(), p("div", {
|
|
3560
3582
|
key: 0,
|
|
3561
3583
|
class: "sticky left-0 z-10 shrink-0 border-r border-outline-variant bg-surface",
|
|
3562
|
-
style:
|
|
3584
|
+
style: y({ width: `${U.value}px` }),
|
|
3563
3585
|
role: "list",
|
|
3564
3586
|
"aria-label": e.label
|
|
3565
|
-
}, [(
|
|
3587
|
+
}, [(b(!0), p(c, null, S(Ze.value, (e) => (b(), p(c, { key: e.key }, [e.kind === "group" ? (b(), p("button", {
|
|
3566
3588
|
key: 0,
|
|
3567
3589
|
type: "button",
|
|
3568
3590
|
class: "absolute inset-x-0 flex items-center gap-1 border-b border-outline-variant/60 bg-surface-container-low px-2 text-left text-title-small text-on-surface outline-none hover:bg-on-surface/8 focus-visible:ring-2 focus-visible:ring-secondary focus-visible:ring-inset",
|
|
3569
|
-
style:
|
|
3591
|
+
style: y({
|
|
3570
3592
|
top: `${e.top}px`,
|
|
3571
3593
|
height: `${e.height}px`
|
|
3572
3594
|
}),
|
|
3573
3595
|
"aria-expanded": !xe.value.has(e.group),
|
|
3574
3596
|
onClick: (t) => Ce(e.group)
|
|
3575
|
-
}, [
|
|
3597
|
+
}, [m("span", { class: v(["material-symbols-outlined text-[20px] text-on-surface-variant transition-transform duration-200", xe.value.has(e.group) ? "-rotate-90" : ""]) }, "expand_more", 2), se(t.$slots, "group", {
|
|
3576
3598
|
group: e.group,
|
|
3577
3599
|
resources: e.resources,
|
|
3578
3600
|
collapsed: xe.value.has(e.group)
|
|
3579
|
-
}, () => [
|
|
3601
|
+
}, () => [m("span", Kt, C(e.group), 1), m("span", qt, C(e.resources.length), 1)])], 12, Gt)) : (b(), p("div", {
|
|
3580
3602
|
key: 1,
|
|
3581
3603
|
role: "listitem",
|
|
3582
3604
|
class: "absolute inset-x-0 flex items-center gap-3 border-b border-outline-variant/60 px-4",
|
|
3583
|
-
style:
|
|
3605
|
+
style: y({
|
|
3584
3606
|
top: `${e.top}px`,
|
|
3585
3607
|
height: `${e.height}px`
|
|
3586
3608
|
})
|
|
3587
|
-
}, [
|
|
3609
|
+
}, [se(t.$slots, "resource", {
|
|
3588
3610
|
resource: e.resource,
|
|
3589
3611
|
events: we.value.get(e.resource.id) ?? [],
|
|
3590
3612
|
hours: Math.round((xn.value.get(e.resource.id) ?? 0) * 10) / 10
|
|
3591
|
-
}, () => [e.resource.avatar ? (
|
|
3613
|
+
}, () => [e.resource.avatar ? (b(), p("img", {
|
|
3592
3614
|
key: 0,
|
|
3593
3615
|
src: e.resource.avatar,
|
|
3594
3616
|
alt: "",
|
|
3595
3617
|
class: "size-9 shrink-0 rounded-full object-cover"
|
|
3596
|
-
}, null, 8, Jt)) : (
|
|
3618
|
+
}, null, 8, Jt)) : (b(), p("span", {
|
|
3597
3619
|
key: 1,
|
|
3598
|
-
class:
|
|
3599
|
-
}, [e.resource.icon ? (
|
|
3600
|
-
label:
|
|
3601
|
-
value:
|
|
3620
|
+
class: v(["flex size-9 shrink-0 items-center justify-center rounded-full text-label-large", _n[e.resource.color ?? "neutral"]])
|
|
3621
|
+
}, [e.resource.icon ? (b(), p("span", Yt, C(e.resource.icon), 1)) : (b(), p(c, { key: 1 }, [ee(C(bn(e.resource.name)), 1)], 64))], 2)), m("span", Xt, [m("span", Zt, C(e.resource.name), 1), e.resource.subtitle ? (b(), p("span", Qt, C(e.resource.subtitle), 1)) : f("", !0)])])], 4))], 64))), 128)), te(We, {
|
|
3622
|
+
label: w(l).ganttResize,
|
|
3623
|
+
value: U.value,
|
|
3602
3624
|
active: pt.value,
|
|
3603
|
-
"grip-top":
|
|
3625
|
+
"grip-top": w(K).top + Math.max(0, w(K).height - un) / 2,
|
|
3604
3626
|
onPointerdown: wt,
|
|
3605
3627
|
onDblclick: n[0] ||= (e) => ht(mt.value),
|
|
3606
|
-
onKeydown: [n[1] ||=
|
|
3628
|
+
onKeydown: [n[1] ||= pe(E((e) => ht(Math.max(120, Me.value - 16)), ["prevent"]), ["left"]), n[2] ||= pe(E((e) => ht(Me.value + 16), ["prevent"]), ["right"])]
|
|
3607
3629
|
}, null, 8, [
|
|
3608
3630
|
"label",
|
|
3609
3631
|
"value",
|
|
3610
3632
|
"active",
|
|
3611
3633
|
"grip-top"
|
|
3612
|
-
])], 12, Wt)) :
|
|
3613
|
-
class:
|
|
3614
|
-
style:
|
|
3634
|
+
])], 12, Wt)) : f("", !0), m("div", {
|
|
3635
|
+
class: v(["relative shrink-0 select-none [-webkit-user-drag:none]", e.creatable && !e.readonly ? "" : "cursor-grab active:cursor-grabbing"]),
|
|
3636
|
+
style: y({ width: `${w(Fe)}px` }),
|
|
3615
3637
|
onPointerdown: Ct,
|
|
3616
|
-
onDragstart: n[3] ||=
|
|
3638
|
+
onDragstart: n[3] ||= E(() => {}, ["prevent"])
|
|
3617
3639
|
}, [
|
|
3618
|
-
|
|
3619
|
-
"off-times":
|
|
3620
|
-
cells:
|
|
3621
|
-
"today-x":
|
|
3640
|
+
te(He, {
|
|
3641
|
+
"off-times": w(Xe),
|
|
3642
|
+
cells: w(Ye),
|
|
3643
|
+
"today-x": w(ze) === null ? null : w(q)(w(ze))
|
|
3622
3644
|
}, null, 8, [
|
|
3623
3645
|
"off-times",
|
|
3624
3646
|
"cells",
|
|
3625
3647
|
"today-x"
|
|
3626
3648
|
]),
|
|
3627
|
-
(
|
|
3649
|
+
(b(!0), p(c, null, S(Ze.value, (e) => (b(), p("div", {
|
|
3628
3650
|
key: `r${e.key}`,
|
|
3629
|
-
class:
|
|
3630
|
-
style:
|
|
3651
|
+
class: v(["pointer-events-none absolute inset-x-0 border-b border-outline-variant/60", e.kind === "group" ? "bg-surface-container-low/60" : ""]),
|
|
3652
|
+
style: y({
|
|
3631
3653
|
top: `${e.top}px`,
|
|
3632
3654
|
height: `${e.height}px`
|
|
3633
3655
|
})
|
|
3634
3656
|
}, null, 6))), 128)),
|
|
3635
|
-
gt.value && ke.value.get(gt.value.resourceId) ? (
|
|
3657
|
+
gt.value && ke.value.get(gt.value.resourceId) ? (b(), p("div", {
|
|
3636
3658
|
key: 0,
|
|
3637
3659
|
class: "pointer-events-none absolute rounded-sm border-2 border-dashed border-primary bg-primary/12",
|
|
3638
|
-
style:
|
|
3639
|
-
left: `${
|
|
3640
|
-
width: `${
|
|
3660
|
+
style: y({
|
|
3661
|
+
left: `${w(q)(gt.value.start)}px`,
|
|
3662
|
+
width: `${w(q)(gt.value.end) - w(q)(gt.value.start)}px`,
|
|
3641
3663
|
top: `${ke.value.get(gt.value.resourceId).top + 4}px`,
|
|
3642
3664
|
height: `${ke.value.get(gt.value.resourceId).height - 8}px`
|
|
3643
3665
|
})
|
|
3644
|
-
}, null, 4)) :
|
|
3645
|
-
(
|
|
3666
|
+
}, null, 4)) : f("", !0),
|
|
3667
|
+
(b(!0), p(c, null, S(et.value, ({ event: n }) => (b(), p("div", {
|
|
3646
3668
|
key: n.id,
|
|
3647
3669
|
ref_for: !0,
|
|
3648
3670
|
ref: (e) => ut(n.id, e),
|
|
3649
|
-
class:
|
|
3650
|
-
style:
|
|
3651
|
-
}, [
|
|
3671
|
+
class: v(["absolute top-0 left-0", [n.class, ft.value?.id === n.id ? "z-10" : ""]]),
|
|
3672
|
+
style: y({ height: `${tt.value}px` })
|
|
3673
|
+
}, [m("div", {
|
|
3652
3674
|
"data-timeline-event": "",
|
|
3653
3675
|
role: "button",
|
|
3654
3676
|
tabindex: "0",
|
|
3655
|
-
"aria-label": `${n.title}, ${
|
|
3677
|
+
"aria-label": `${n.title}, ${P.value.get(n.resourceId)?.name ?? ""}, ${zt(n)}`,
|
|
3656
3678
|
"aria-pressed": ve.value.has(n.id),
|
|
3657
|
-
class:
|
|
3679
|
+
class: v(["group absolute inset-0 flex items-stretch overflow-hidden rounded-sm text-left outline-none select-none focus-visible:ring-2 focus-visible:ring-secondary focus-visible:ring-offset-1", [
|
|
3658
3680
|
_n[yn(n)],
|
|
3659
3681
|
ve.value.has(n.id) ? "ring-2 ring-on-surface ring-offset-1 ring-offset-surface" : "",
|
|
3660
|
-
|
|
3682
|
+
R.value.has(n.id) || ft.value?.id === n.id && _t.value ? "outline-2 outline-offset-1 outline-error" : "",
|
|
3661
3683
|
ft.value?.id === n.id ? "shadow-elevation-3" : "hover:shadow-elevation-1",
|
|
3662
3684
|
e.readonly || n.draggable === !1 ? "" : "cursor-grab active:cursor-grabbing"
|
|
3663
3685
|
]]),
|
|
3664
3686
|
onPointerdown: (e) => St(e, n, "body"),
|
|
3665
|
-
onDblclick: (e) =>
|
|
3666
|
-
onContextmenu: (e) =>
|
|
3687
|
+
onDblclick: (e) => s("event-dblclick", n, e),
|
|
3688
|
+
onContextmenu: (e) => s("event-contextmenu", n, e),
|
|
3667
3689
|
onKeydown: (e) => mn(e, n)
|
|
3668
|
-
}, [
|
|
3690
|
+
}, [m("span", { class: v(["w-1 shrink-0", vn[yn(n)]]) }, null, 2), m("span", en, [se(t.$slots, "event", {
|
|
3669
3691
|
event: n,
|
|
3670
|
-
resource:
|
|
3692
|
+
resource: P.value.get(n.resourceId),
|
|
3671
3693
|
selected: ve.value.has(n.id),
|
|
3672
|
-
conflict:
|
|
3673
|
-
}, () => [
|
|
3694
|
+
conflict: R.value.has(n.id)
|
|
3695
|
+
}, () => [m("span", tn, [m("span", nn, C(n.title), 1), tt.value >= 30 ? (b(), p("span", rn, C(n.subtitle ?? zt(n)), 1)) : f("", !0)]), R.value.has(n.id) && (nt.value.get(n.id)?.w ?? 0) > 72 ? (b(), p("span", {
|
|
3674
3696
|
key: 0,
|
|
3675
3697
|
class: "material-symbols-outlined shrink-0 text-[18px] text-error",
|
|
3676
|
-
title:
|
|
3677
|
-
}, "warning", 8, an)) :
|
|
3698
|
+
title: w(l).timelineConflict
|
|
3699
|
+
}, "warning", 8, an)) : f("", !0)])])], 42, $t), !e.readonly && n.resizable !== !1 ? (b(), p(c, { key: 0 }, S(["start", "end"], (e) => m("span", {
|
|
3678
3700
|
key: e,
|
|
3679
3701
|
"data-timeline-resize": e,
|
|
3680
|
-
class:
|
|
3702
|
+
class: v(["absolute inset-y-0 z-[1] flex w-3 cursor-ew-resize items-center justify-center pointer-coarse:w-7", e === "start" ? "-left-1 pointer-coarse:-left-3.5" : "-right-1 pointer-coarse:-right-3.5"]),
|
|
3681
3703
|
onPointerdown: (t) => St(t, n, e)
|
|
3682
|
-
}, [
|
|
3683
|
-
e.resources.length ?
|
|
3704
|
+
}, [m("span", { class: v(["hidden h-3/5 w-1 rounded-full bg-on-surface pointer-coarse:block", ve.value.has(n.id) ? "opacity-100" : "opacity-0"]) }, null, 2)], 42, on)), 64)) : f("", !0)], 6))), 128)),
|
|
3705
|
+
e.resources.length ? f("", !0) : (b(), p("div", {
|
|
3684
3706
|
key: 1,
|
|
3685
3707
|
class: "absolute flex items-center justify-center p-6",
|
|
3686
|
-
style:
|
|
3687
|
-
left: `${
|
|
3688
|
-
width: `${
|
|
3708
|
+
style: y({
|
|
3709
|
+
left: `${w(K).left}px`,
|
|
3710
|
+
width: `${w(Pe)}px`,
|
|
3689
3711
|
top: 0,
|
|
3690
|
-
height: `${Math.max(120,
|
|
3712
|
+
height: `${Math.max(120, w(K).height - un)}px`
|
|
3691
3713
|
})
|
|
3692
|
-
}, [
|
|
3714
|
+
}, [se(t.$slots, "empty", {}, () => [m("span", sn, C(w(l).timelineEmpty), 1)])], 4))
|
|
3693
3715
|
], 38)], 4)], 4)], 544),
|
|
3694
|
-
|
|
3716
|
+
m("div", cn, C(It.value), 1)
|
|
3695
3717
|
], 32));
|
|
3696
3718
|
}
|
|
3697
3719
|
});
|
|
3698
|
-
export {
|
|
3720
|
+
export { Y as MGantt, xt as MGanttControls, fn as MResourceTimeline, W as addWorkingDays, Fe as criticalPath, At as parseGanttCsv, Mt as parseGanttJson, Vt as parseMsProjectXml, Me as rollupSummaries, Pe as scheduleTasks, V as taskSpan, Et as toGanttCsv, jt as toGanttJson, Bt as toMsProjectXml, D as useGantt, Ut as useResourceTimeline, Ne as workingDays };
|
|
3699
3721
|
|
|
3700
3722
|
//# sourceMappingURL=gantt.js.map
|