gantt-task-react-v 1.2.2 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/gantt/task-gantt.d.ts +0 -1
- package/dist/components/gantt-today/index.d.ts +2 -1
- package/dist/components/task-list/index.d.ts +0 -1
- package/dist/gantt-task-react.es.js +403 -353
- package/dist/gantt-task-react.umd.js +403 -353
- package/dist/helpers/data-date-helper.d.ts +14 -0
- package/dist/style.css +23 -53
- package/dist/types/public-types.d.ts +0 -5
- package/package.json +1 -1
|
@@ -7456,11 +7456,11 @@ const defaultScrollIntent = {
|
|
|
7456
7456
|
function useScrollIntent(_ref2) {
|
|
7457
7457
|
let {
|
|
7458
7458
|
delta,
|
|
7459
|
-
disabled
|
|
7459
|
+
disabled
|
|
7460
7460
|
} = _ref2;
|
|
7461
7461
|
const previousDelta = usePrevious(delta);
|
|
7462
7462
|
return useLazyMemo((previousIntent) => {
|
|
7463
|
-
if (
|
|
7463
|
+
if (disabled || !previousDelta || !previousIntent) {
|
|
7464
7464
|
return defaultScrollIntent;
|
|
7465
7465
|
}
|
|
7466
7466
|
const direction = {
|
|
@@ -7477,7 +7477,7 @@ function useScrollIntent(_ref2) {
|
|
|
7477
7477
|
[Direction.Forward]: previousIntent.y[Direction.Forward] || direction.y === 1
|
|
7478
7478
|
}
|
|
7479
7479
|
};
|
|
7480
|
-
}, [
|
|
7480
|
+
}, [disabled, delta, previousDelta]);
|
|
7481
7481
|
}
|
|
7482
7482
|
function useCachedNode(draggableNodes, id) {
|
|
7483
7483
|
const draggableNode = id !== null ? draggableNodes.get(id) : void 0;
|
|
@@ -7526,8 +7526,8 @@ function useDroppableMeasuring(containers, _ref) {
|
|
|
7526
7526
|
strategy
|
|
7527
7527
|
} = config;
|
|
7528
7528
|
const containersRef = useRef(containers);
|
|
7529
|
-
const
|
|
7530
|
-
const disabledRef = useLatestValue(
|
|
7529
|
+
const disabled = isDisabled();
|
|
7530
|
+
const disabledRef = useLatestValue(disabled);
|
|
7531
7531
|
const measureDroppableContainers = useCallback(function(ids2) {
|
|
7532
7532
|
if (ids2 === void 0) {
|
|
7533
7533
|
ids2 = [];
|
|
@@ -7544,7 +7544,7 @@ function useDroppableMeasuring(containers, _ref) {
|
|
|
7544
7544
|
}, [disabledRef]);
|
|
7545
7545
|
const timeoutId = useRef(null);
|
|
7546
7546
|
const droppableRects = useLazyMemo((previousValue) => {
|
|
7547
|
-
if (
|
|
7547
|
+
if (disabled && !dragging2) {
|
|
7548
7548
|
return defaultValue;
|
|
7549
7549
|
}
|
|
7550
7550
|
if (!previousValue || previousValue === defaultValue || containersRef.current !== containers || queue != null) {
|
|
@@ -7567,19 +7567,19 @@ function useDroppableMeasuring(containers, _ref) {
|
|
|
7567
7567
|
return map;
|
|
7568
7568
|
}
|
|
7569
7569
|
return previousValue;
|
|
7570
|
-
}, [containers, queue, dragging2,
|
|
7570
|
+
}, [containers, queue, dragging2, disabled, measure]);
|
|
7571
7571
|
useEffect(() => {
|
|
7572
7572
|
containersRef.current = containers;
|
|
7573
7573
|
}, [containers]);
|
|
7574
7574
|
useEffect(
|
|
7575
7575
|
() => {
|
|
7576
|
-
if (
|
|
7576
|
+
if (disabled) {
|
|
7577
7577
|
return;
|
|
7578
7578
|
}
|
|
7579
7579
|
measureDroppableContainers();
|
|
7580
7580
|
},
|
|
7581
7581
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7582
|
-
[dragging2,
|
|
7582
|
+
[dragging2, disabled]
|
|
7583
7583
|
);
|
|
7584
7584
|
useEffect(
|
|
7585
7585
|
() => {
|
|
@@ -7592,7 +7592,7 @@ function useDroppableMeasuring(containers, _ref) {
|
|
|
7592
7592
|
);
|
|
7593
7593
|
useEffect(
|
|
7594
7594
|
() => {
|
|
7595
|
-
if (
|
|
7595
|
+
if (disabled || typeof frequency !== "number" || timeoutId.current !== null) {
|
|
7596
7596
|
return;
|
|
7597
7597
|
}
|
|
7598
7598
|
timeoutId.current = setTimeout(() => {
|
|
@@ -7601,7 +7601,7 @@ function useDroppableMeasuring(containers, _ref) {
|
|
|
7601
7601
|
}, frequency);
|
|
7602
7602
|
},
|
|
7603
7603
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7604
|
-
[frequency,
|
|
7604
|
+
[frequency, disabled, measureDroppableContainers, ...dependencies]
|
|
7605
7605
|
);
|
|
7606
7606
|
return {
|
|
7607
7607
|
droppableRects,
|
|
@@ -7636,18 +7636,18 @@ function useInitialRect(node, measure) {
|
|
|
7636
7636
|
function useMutationObserver(_ref) {
|
|
7637
7637
|
let {
|
|
7638
7638
|
callback,
|
|
7639
|
-
disabled
|
|
7639
|
+
disabled
|
|
7640
7640
|
} = _ref;
|
|
7641
7641
|
const handleMutations = useEvent(callback);
|
|
7642
7642
|
const mutationObserver = useMemo(() => {
|
|
7643
|
-
if (
|
|
7643
|
+
if (disabled || typeof window === "undefined" || typeof window.MutationObserver === "undefined") {
|
|
7644
7644
|
return void 0;
|
|
7645
7645
|
}
|
|
7646
7646
|
const {
|
|
7647
7647
|
MutationObserver
|
|
7648
7648
|
} = window;
|
|
7649
7649
|
return new MutationObserver(handleMutations);
|
|
7650
|
-
}, [handleMutations,
|
|
7650
|
+
}, [handleMutations, disabled]);
|
|
7651
7651
|
useEffect(() => {
|
|
7652
7652
|
return () => mutationObserver == null ? void 0 : mutationObserver.disconnect();
|
|
7653
7653
|
}, [mutationObserver]);
|
|
@@ -7656,12 +7656,12 @@ function useMutationObserver(_ref) {
|
|
|
7656
7656
|
function useResizeObserver(_ref) {
|
|
7657
7657
|
let {
|
|
7658
7658
|
callback,
|
|
7659
|
-
disabled
|
|
7659
|
+
disabled
|
|
7660
7660
|
} = _ref;
|
|
7661
7661
|
const handleResize = useEvent(callback);
|
|
7662
7662
|
const resizeObserver = useMemo(
|
|
7663
7663
|
() => {
|
|
7664
|
-
if (
|
|
7664
|
+
if (disabled || typeof window === "undefined" || typeof window.ResizeObserver === "undefined") {
|
|
7665
7665
|
return void 0;
|
|
7666
7666
|
}
|
|
7667
7667
|
const {
|
|
@@ -7670,7 +7670,7 @@ function useResizeObserver(_ref) {
|
|
|
7670
7670
|
return new ResizeObserver2(handleResize);
|
|
7671
7671
|
},
|
|
7672
7672
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7673
|
-
[
|
|
7673
|
+
[disabled]
|
|
7674
7674
|
);
|
|
7675
7675
|
useEffect(() => {
|
|
7676
7676
|
return () => resizeObserver == null ? void 0 : resizeObserver.disconnect();
|
|
@@ -7988,9 +7988,9 @@ class DroppableContainersMap extends Map {
|
|
|
7988
7988
|
getEnabled() {
|
|
7989
7989
|
return this.toArray().filter((_ref) => {
|
|
7990
7990
|
let {
|
|
7991
|
-
disabled
|
|
7991
|
+
disabled
|
|
7992
7992
|
} = _ref;
|
|
7993
|
-
return !
|
|
7993
|
+
return !disabled;
|
|
7994
7994
|
});
|
|
7995
7995
|
}
|
|
7996
7996
|
getNodeFor(id) {
|
|
@@ -8120,7 +8120,7 @@ function reducer(state, action) {
|
|
|
8120
8120
|
const {
|
|
8121
8121
|
id,
|
|
8122
8122
|
key: key2,
|
|
8123
|
-
disabled
|
|
8123
|
+
disabled
|
|
8124
8124
|
} = action;
|
|
8125
8125
|
const element = state.droppable.containers.get(id);
|
|
8126
8126
|
if (!element || key2 !== element.key) {
|
|
@@ -8129,7 +8129,7 @@ function reducer(state, action) {
|
|
|
8129
8129
|
const containers = new DroppableContainersMap(state.droppable.containers);
|
|
8130
8130
|
containers.set(id, {
|
|
8131
8131
|
...element,
|
|
8132
|
-
disabled
|
|
8132
|
+
disabled
|
|
8133
8133
|
});
|
|
8134
8134
|
return {
|
|
8135
8135
|
...state,
|
|
@@ -8165,7 +8165,7 @@ function reducer(state, action) {
|
|
|
8165
8165
|
}
|
|
8166
8166
|
function RestoreFocus(_ref) {
|
|
8167
8167
|
let {
|
|
8168
|
-
disabled
|
|
8168
|
+
disabled
|
|
8169
8169
|
} = _ref;
|
|
8170
8170
|
const {
|
|
8171
8171
|
active,
|
|
@@ -8175,7 +8175,7 @@ function RestoreFocus(_ref) {
|
|
|
8175
8175
|
const previousActivatorEvent = usePrevious(activatorEvent);
|
|
8176
8176
|
const previousActiveId = usePrevious(active == null ? void 0 : active.id);
|
|
8177
8177
|
useEffect(() => {
|
|
8178
|
-
if (
|
|
8178
|
+
if (disabled) {
|
|
8179
8179
|
return;
|
|
8180
8180
|
}
|
|
8181
8181
|
if (!activatorEvent && previousActivatorEvent && previousActiveId != null) {
|
|
@@ -8209,7 +8209,7 @@ function RestoreFocus(_ref) {
|
|
|
8209
8209
|
}
|
|
8210
8210
|
});
|
|
8211
8211
|
}
|
|
8212
|
-
}, [activatorEvent,
|
|
8212
|
+
}, [activatorEvent, disabled, draggableNodes, previousActiveId, previousActivatorEvent]);
|
|
8213
8213
|
return null;
|
|
8214
8214
|
}
|
|
8215
8215
|
function applyModifiers(modifiers, _ref) {
|
|
@@ -8260,8 +8260,8 @@ function useLayoutShiftScrollCompensation(_ref) {
|
|
|
8260
8260
|
y: config
|
|
8261
8261
|
} : config;
|
|
8262
8262
|
useIsomorphicLayoutEffect(() => {
|
|
8263
|
-
const
|
|
8264
|
-
if (
|
|
8263
|
+
const disabled = !x && !y;
|
|
8264
|
+
if (disabled || !activeNode) {
|
|
8265
8265
|
initialized.current = false;
|
|
8266
8266
|
return;
|
|
8267
8267
|
}
|
|
@@ -8768,7 +8768,7 @@ function useDraggable(_ref) {
|
|
|
8768
8768
|
let {
|
|
8769
8769
|
id,
|
|
8770
8770
|
data,
|
|
8771
|
-
disabled
|
|
8771
|
+
disabled = false,
|
|
8772
8772
|
attributes
|
|
8773
8773
|
} = _ref;
|
|
8774
8774
|
const key2 = useUniqueId(ID_PREFIX$1);
|
|
@@ -8814,18 +8814,18 @@ function useDraggable(_ref) {
|
|
|
8814
8814
|
const memoizedAttributes = useMemo(() => ({
|
|
8815
8815
|
role,
|
|
8816
8816
|
tabIndex,
|
|
8817
|
-
"aria-disabled":
|
|
8817
|
+
"aria-disabled": disabled,
|
|
8818
8818
|
"aria-pressed": isDragging && role === defaultRole ? true : void 0,
|
|
8819
8819
|
"aria-roledescription": roleDescription,
|
|
8820
8820
|
"aria-describedby": ariaDescribedById.draggable
|
|
8821
|
-
}), [
|
|
8821
|
+
}), [disabled, role, tabIndex, isDragging, roleDescription, ariaDescribedById.draggable]);
|
|
8822
8822
|
return {
|
|
8823
8823
|
active,
|
|
8824
8824
|
activatorEvent,
|
|
8825
8825
|
activeNodeRect,
|
|
8826
8826
|
attributes: memoizedAttributes,
|
|
8827
8827
|
isDragging,
|
|
8828
|
-
listeners:
|
|
8828
|
+
listeners: disabled ? void 0 : listeners,
|
|
8829
8829
|
node,
|
|
8830
8830
|
over,
|
|
8831
8831
|
setNodeRef,
|
|
@@ -8843,7 +8843,7 @@ const defaultResizeObserverConfig = {
|
|
|
8843
8843
|
function useDroppable(_ref) {
|
|
8844
8844
|
let {
|
|
8845
8845
|
data,
|
|
8846
|
-
disabled
|
|
8846
|
+
disabled = false,
|
|
8847
8847
|
id,
|
|
8848
8848
|
resizeObserverConfig
|
|
8849
8849
|
} = _ref;
|
|
@@ -8855,7 +8855,7 @@ function useDroppable(_ref) {
|
|
|
8855
8855
|
measureDroppableContainers
|
|
8856
8856
|
} = useContext(InternalContext);
|
|
8857
8857
|
const previous = useRef({
|
|
8858
|
-
disabled
|
|
8858
|
+
disabled
|
|
8859
8859
|
});
|
|
8860
8860
|
const resizeObserverConnected = useRef(false);
|
|
8861
8861
|
const rect = useRef(null);
|
|
@@ -8919,7 +8919,7 @@ function useDroppable(_ref) {
|
|
|
8919
8919
|
element: {
|
|
8920
8920
|
id,
|
|
8921
8921
|
key: key2,
|
|
8922
|
-
disabled
|
|
8922
|
+
disabled,
|
|
8923
8923
|
node: nodeRef,
|
|
8924
8924
|
rect,
|
|
8925
8925
|
data: dataRef
|
|
@@ -8935,16 +8935,16 @@ function useDroppable(_ref) {
|
|
|
8935
8935
|
[id]
|
|
8936
8936
|
);
|
|
8937
8937
|
useEffect(() => {
|
|
8938
|
-
if (
|
|
8938
|
+
if (disabled !== previous.current.disabled) {
|
|
8939
8939
|
dispatch({
|
|
8940
8940
|
type: Action.SetDroppableDisabled,
|
|
8941
8941
|
id,
|
|
8942
8942
|
key: key2,
|
|
8943
|
-
disabled
|
|
8943
|
+
disabled
|
|
8944
8944
|
});
|
|
8945
|
-
previous.current.disabled =
|
|
8945
|
+
previous.current.disabled = disabled;
|
|
8946
8946
|
}
|
|
8947
|
-
}, [id, key2,
|
|
8947
|
+
}, [id, key2, disabled, dispatch]);
|
|
8948
8948
|
return {
|
|
8949
8949
|
active,
|
|
8950
8950
|
rect,
|
|
@@ -9335,14 +9335,14 @@ function itemsEqual(a, b) {
|
|
|
9335
9335
|
}
|
|
9336
9336
|
return true;
|
|
9337
9337
|
}
|
|
9338
|
-
function normalizeDisabled(
|
|
9339
|
-
if (typeof
|
|
9338
|
+
function normalizeDisabled(disabled) {
|
|
9339
|
+
if (typeof disabled === "boolean") {
|
|
9340
9340
|
return {
|
|
9341
|
-
draggable:
|
|
9342
|
-
droppable:
|
|
9341
|
+
draggable: disabled,
|
|
9342
|
+
droppable: disabled
|
|
9343
9343
|
};
|
|
9344
9344
|
}
|
|
9345
|
-
return
|
|
9345
|
+
return disabled;
|
|
9346
9346
|
}
|
|
9347
9347
|
const rectSortingStrategy = (_ref) => {
|
|
9348
9348
|
let {
|
|
@@ -9464,7 +9464,7 @@ function SortableContext(_ref) {
|
|
|
9464
9464
|
const previousItemsRef = useRef(items);
|
|
9465
9465
|
const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current);
|
|
9466
9466
|
const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged;
|
|
9467
|
-
const
|
|
9467
|
+
const disabled = normalizeDisabled(disabledProp);
|
|
9468
9468
|
useIsomorphicLayoutEffect(() => {
|
|
9469
9469
|
if (itemsHaveChanged && isDragging) {
|
|
9470
9470
|
measureDroppableContainers(items);
|
|
@@ -9477,7 +9477,7 @@ function SortableContext(_ref) {
|
|
|
9477
9477
|
() => ({
|
|
9478
9478
|
activeIndex,
|
|
9479
9479
|
containerId,
|
|
9480
|
-
disabled
|
|
9480
|
+
disabled,
|
|
9481
9481
|
disableTransforms,
|
|
9482
9482
|
items,
|
|
9483
9483
|
overIndex,
|
|
@@ -9486,7 +9486,7 @@ function SortableContext(_ref) {
|
|
|
9486
9486
|
strategy
|
|
9487
9487
|
}),
|
|
9488
9488
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
9489
|
-
[activeIndex, containerId,
|
|
9489
|
+
[activeIndex, containerId, disabled.draggable, disabled.droppable, disableTransforms, items, overIndex, droppableRects, useDragOverlay, strategy]
|
|
9490
9490
|
);
|
|
9491
9491
|
return React__default.createElement(Context.Provider, {
|
|
9492
9492
|
value: contextValue
|
|
@@ -9539,7 +9539,7 @@ const defaultAttributes = {
|
|
|
9539
9539
|
};
|
|
9540
9540
|
function useDerivedTransform(_ref) {
|
|
9541
9541
|
let {
|
|
9542
|
-
disabled
|
|
9542
|
+
disabled,
|
|
9543
9543
|
index: index2,
|
|
9544
9544
|
node,
|
|
9545
9545
|
rect
|
|
@@ -9547,7 +9547,7 @@ function useDerivedTransform(_ref) {
|
|
|
9547
9547
|
const [derivedTransform, setDerivedtransform] = useState(null);
|
|
9548
9548
|
const previousIndex = useRef(index2);
|
|
9549
9549
|
useIsomorphicLayoutEffect(() => {
|
|
9550
|
-
if (!
|
|
9550
|
+
if (!disabled && index2 !== previousIndex.current && node.current) {
|
|
9551
9551
|
const initial = rect.current;
|
|
9552
9552
|
if (initial) {
|
|
9553
9553
|
const current = getClientRect(node.current, {
|
|
@@ -9567,7 +9567,7 @@ function useDerivedTransform(_ref) {
|
|
|
9567
9567
|
if (index2 !== previousIndex.current) {
|
|
9568
9568
|
previousIndex.current = index2;
|
|
9569
9569
|
}
|
|
9570
|
-
}, [
|
|
9570
|
+
}, [disabled, index2, node, rect]);
|
|
9571
9571
|
useEffect(() => {
|
|
9572
9572
|
if (derivedTransform) {
|
|
9573
9573
|
setDerivedtransform(null);
|
|
@@ -9598,7 +9598,7 @@ function useSortable(_ref) {
|
|
|
9598
9598
|
useDragOverlay,
|
|
9599
9599
|
strategy: globalStrategy
|
|
9600
9600
|
} = useContext(Context);
|
|
9601
|
-
const
|
|
9601
|
+
const disabled = normalizeLocalDisabled(localDisabled, globalDisabled);
|
|
9602
9602
|
const index2 = items.indexOf(id);
|
|
9603
9603
|
const data = useMemo(() => ({
|
|
9604
9604
|
sortable: {
|
|
@@ -9617,7 +9617,7 @@ function useSortable(_ref) {
|
|
|
9617
9617
|
} = useDroppable({
|
|
9618
9618
|
id,
|
|
9619
9619
|
data,
|
|
9620
|
-
disabled:
|
|
9620
|
+
disabled: disabled.droppable,
|
|
9621
9621
|
resizeObserverConfig: {
|
|
9622
9622
|
updateMeasurementsFor: itemsAfterCurrentSortable,
|
|
9623
9623
|
...resizeObserverConfig
|
|
@@ -9641,7 +9641,7 @@ function useSortable(_ref) {
|
|
|
9641
9641
|
...defaultAttributes,
|
|
9642
9642
|
...userDefinedAttributes
|
|
9643
9643
|
},
|
|
9644
|
-
disabled:
|
|
9644
|
+
disabled: disabled.draggable
|
|
9645
9645
|
});
|
|
9646
9646
|
const setNodeRef = useCombinedRefs(setDroppableNodeRef, setDraggableNodeRef);
|
|
9647
9647
|
const isSorting = Boolean(active);
|
|
@@ -10637,16 +10637,14 @@ const TaskListTableDefaultInner = ({
|
|
|
10637
10637
|
);
|
|
10638
10638
|
};
|
|
10639
10639
|
const TaskListTable = memo(TaskListTableDefaultInner);
|
|
10640
|
-
const taskListRoot = "
|
|
10641
|
-
const taskListHorizontalScroll = "
|
|
10642
|
-
const taskListResizer = "
|
|
10643
|
-
const horizontalContainer$1 = "
|
|
10644
|
-
const tableWrapper = "
|
|
10645
|
-
const scrollToTop = "
|
|
10646
|
-
const scrollToBottom = "
|
|
10647
|
-
const hidden = "
|
|
10648
|
-
const disabled$1 = "_disabled_cyzwo_213";
|
|
10649
|
-
const disabledOverlay$1 = "_disabledOverlay_cyzwo_221";
|
|
10640
|
+
const taskListRoot = "_taskListRoot_yoz76_1";
|
|
10641
|
+
const taskListHorizontalScroll = "_taskListHorizontalScroll_yoz76_19";
|
|
10642
|
+
const taskListResizer = "_taskListResizer_yoz76_81";
|
|
10643
|
+
const horizontalContainer$1 = "_horizontalContainer_yoz76_145";
|
|
10644
|
+
const tableWrapper = "_tableWrapper_yoz76_159";
|
|
10645
|
+
const scrollToTop = "_scrollToTop_yoz76_173";
|
|
10646
|
+
const scrollToBottom = "_scrollToBottom_yoz76_189";
|
|
10647
|
+
const hidden = "_hidden_yoz76_205";
|
|
10650
10648
|
const styles$d = {
|
|
10651
10649
|
taskListRoot,
|
|
10652
10650
|
taskListHorizontalScroll,
|
|
@@ -10655,9 +10653,7 @@ const styles$d = {
|
|
|
10655
10653
|
tableWrapper,
|
|
10656
10654
|
scrollToTop,
|
|
10657
10655
|
scrollToBottom,
|
|
10658
|
-
hidden
|
|
10659
|
-
disabled: disabled$1,
|
|
10660
|
-
disabledOverlay: disabledOverlay$1
|
|
10656
|
+
hidden
|
|
10661
10657
|
};
|
|
10662
10658
|
const checkHasChildren = (task, childTasksMap) => {
|
|
10663
10659
|
const { id, comparisonLevel = 1 } = task;
|
|
@@ -10706,8 +10702,7 @@ const TaskListInner = ({
|
|
|
10706
10702
|
tasks,
|
|
10707
10703
|
onResizeColumn,
|
|
10708
10704
|
canReorderTasks,
|
|
10709
|
-
tableBottom
|
|
10710
|
-
isLoading = false
|
|
10705
|
+
tableBottom
|
|
10711
10706
|
}) => {
|
|
10712
10707
|
const [
|
|
10713
10708
|
columns,
|
|
@@ -10884,8 +10879,7 @@ const TaskListInner = ({
|
|
|
10884
10879
|
{
|
|
10885
10880
|
className: `${styles$d.scrollToBottom} ${!renderedIndexes || renderedIndexes[3] ? styles$d.hidden : ""}`
|
|
10886
10881
|
}
|
|
10887
|
-
)
|
|
10888
|
-
isLoading && /* @__PURE__ */ jsx("div", { className: styles$d.disabledOverlay })
|
|
10882
|
+
)
|
|
10889
10883
|
] }),
|
|
10890
10884
|
(tableBottom == null ? void 0 : tableBottom.renderContent) && (tableBottom == null ? void 0 : tableBottom.height) && /* @__PURE__ */ jsx("div", { style: { height: tableBottom.height, width: "100%" }, children: tableBottom.renderContent() })
|
|
10891
10885
|
]
|
|
@@ -10915,6 +10909,285 @@ const styles$c = {
|
|
|
10915
10909
|
ganttToday,
|
|
10916
10910
|
ganttTodayCircle
|
|
10917
10911
|
};
|
|
10912
|
+
const getDateByOffset = (startDate, offset2, viewMode) => {
|
|
10913
|
+
switch (viewMode) {
|
|
10914
|
+
case ViewMode.Day:
|
|
10915
|
+
return addDays(startDate, offset2);
|
|
10916
|
+
case ViewMode.HalfDay:
|
|
10917
|
+
return addHours(startDate, offset2 * 12);
|
|
10918
|
+
case ViewMode.QuarterDay:
|
|
10919
|
+
return addHours(startDate, offset2 * 6);
|
|
10920
|
+
case ViewMode.Hour:
|
|
10921
|
+
return addHours(startDate, offset2);
|
|
10922
|
+
case ViewMode.Month:
|
|
10923
|
+
return addMonths(startDate, offset2);
|
|
10924
|
+
case ViewMode.Week:
|
|
10925
|
+
return addWeeks(startDate, offset2);
|
|
10926
|
+
case ViewMode.Year:
|
|
10927
|
+
return addYears(startDate, offset2);
|
|
10928
|
+
default:
|
|
10929
|
+
throw new Error("Unknown view mode");
|
|
10930
|
+
}
|
|
10931
|
+
};
|
|
10932
|
+
const taskXCoordinate = (xDate, startDate, viewMode, columnWidth) => {
|
|
10933
|
+
const index2 = getDatesDiff(xDate, startDate, viewMode);
|
|
10934
|
+
const currentDate = getDateByOffset(startDate, index2, viewMode);
|
|
10935
|
+
const nextDate = getDateByOffset(startDate, index2 + 1, viewMode);
|
|
10936
|
+
const remainderMillis = xDate.getTime() - currentDate.getTime();
|
|
10937
|
+
const percentOfInterval = remainderMillis / (nextDate.getTime() - currentDate.getTime());
|
|
10938
|
+
return index2 * columnWidth + percentOfInterval * columnWidth;
|
|
10939
|
+
};
|
|
10940
|
+
const taskComparisonXCoordinate = (xDate, startDate, viewMode, columnWidth) => {
|
|
10941
|
+
const index2 = getDatesDiff(xDate, startDate, viewMode);
|
|
10942
|
+
const currentDate = getDateByOffset(startDate, index2, viewMode);
|
|
10943
|
+
const nextDate = getDateByOffset(startDate, index2 + 1, viewMode);
|
|
10944
|
+
const remainderMillis = xDate.getTime() - currentDate.getTime();
|
|
10945
|
+
const percentOfInterval = remainderMillis / (nextDate.getTime() - currentDate.getTime());
|
|
10946
|
+
return index2 * columnWidth + percentOfInterval * columnWidth;
|
|
10947
|
+
};
|
|
10948
|
+
const progressWithByParams = (taskX1, taskX2, progress, rtl) => {
|
|
10949
|
+
const progressWidth = Math.max((taskX2 - taskX1) * progress * 0.01, 0);
|
|
10950
|
+
let progressX;
|
|
10951
|
+
if (rtl) {
|
|
10952
|
+
progressX = taskX2 - progressWidth;
|
|
10953
|
+
} else {
|
|
10954
|
+
progressX = taskX1;
|
|
10955
|
+
}
|
|
10956
|
+
return [progressWidth, progressX];
|
|
10957
|
+
};
|
|
10958
|
+
const dateByX = (x, taskX, taskDate, xStep, timeStep) => {
|
|
10959
|
+
let newDate = new Date((x - taskX) / xStep * timeStep + taskDate.getTime());
|
|
10960
|
+
newDate = new Date(
|
|
10961
|
+
newDate.getTime() + (newDate.getTimezoneOffset() - taskDate.getTimezoneOffset()) * 6e4
|
|
10962
|
+
);
|
|
10963
|
+
return newDate;
|
|
10964
|
+
};
|
|
10965
|
+
const handleTaskBySVGMouseEvent = (action, selectedTask, initialCoordinates, coordinates, xStep, timeStep, rtl) => {
|
|
10966
|
+
let result;
|
|
10967
|
+
switch (selectedTask.type) {
|
|
10968
|
+
case "milestone":
|
|
10969
|
+
result = handleTaskBySVGMouseEventForMilestone(
|
|
10970
|
+
action,
|
|
10971
|
+
selectedTask,
|
|
10972
|
+
initialCoordinates,
|
|
10973
|
+
coordinates,
|
|
10974
|
+
xStep,
|
|
10975
|
+
timeStep
|
|
10976
|
+
);
|
|
10977
|
+
break;
|
|
10978
|
+
default:
|
|
10979
|
+
result = handleTaskBySVGMouseEventForBar(
|
|
10980
|
+
action,
|
|
10981
|
+
selectedTask,
|
|
10982
|
+
initialCoordinates,
|
|
10983
|
+
coordinates,
|
|
10984
|
+
xStep,
|
|
10985
|
+
timeStep,
|
|
10986
|
+
rtl
|
|
10987
|
+
);
|
|
10988
|
+
break;
|
|
10989
|
+
}
|
|
10990
|
+
return result;
|
|
10991
|
+
};
|
|
10992
|
+
const handleTaskBySVGMouseEventForBar = (action, selectedTask, initialCoordinates, coordinates, xStep, timeStep, rtl) => {
|
|
10993
|
+
const changedTask = { ...selectedTask };
|
|
10994
|
+
let isChanged = false;
|
|
10995
|
+
switch (action) {
|
|
10996
|
+
case "progress":
|
|
10997
|
+
isChanged = initialCoordinates.progressWidth !== coordinates.progressWidth;
|
|
10998
|
+
if (isChanged) {
|
|
10999
|
+
changedTask.progress = Math.round(
|
|
11000
|
+
coordinates.progressWidth * 100 / (coordinates.x2 - coordinates.x1)
|
|
11001
|
+
);
|
|
11002
|
+
}
|
|
11003
|
+
break;
|
|
11004
|
+
case "start": {
|
|
11005
|
+
isChanged = initialCoordinates.x1 !== coordinates.x1;
|
|
11006
|
+
if (isChanged) {
|
|
11007
|
+
if (rtl) {
|
|
11008
|
+
changedTask.end = dateByX(
|
|
11009
|
+
coordinates.x1,
|
|
11010
|
+
initialCoordinates.x1,
|
|
11011
|
+
selectedTask.end,
|
|
11012
|
+
xStep,
|
|
11013
|
+
timeStep
|
|
11014
|
+
);
|
|
11015
|
+
} else {
|
|
11016
|
+
changedTask.start = dateByX(
|
|
11017
|
+
coordinates.x1,
|
|
11018
|
+
initialCoordinates.x1,
|
|
11019
|
+
selectedTask.start,
|
|
11020
|
+
xStep,
|
|
11021
|
+
timeStep
|
|
11022
|
+
);
|
|
11023
|
+
}
|
|
11024
|
+
}
|
|
11025
|
+
break;
|
|
11026
|
+
}
|
|
11027
|
+
case "end": {
|
|
11028
|
+
isChanged = initialCoordinates.x2 !== coordinates.x2;
|
|
11029
|
+
if (isChanged) {
|
|
11030
|
+
if (rtl) {
|
|
11031
|
+
changedTask.start = dateByX(
|
|
11032
|
+
coordinates.x2,
|
|
11033
|
+
initialCoordinates.x2,
|
|
11034
|
+
selectedTask.start,
|
|
11035
|
+
xStep,
|
|
11036
|
+
timeStep
|
|
11037
|
+
);
|
|
11038
|
+
} else {
|
|
11039
|
+
changedTask.end = dateByX(
|
|
11040
|
+
coordinates.x2,
|
|
11041
|
+
initialCoordinates.x2,
|
|
11042
|
+
selectedTask.end,
|
|
11043
|
+
xStep,
|
|
11044
|
+
timeStep
|
|
11045
|
+
);
|
|
11046
|
+
}
|
|
11047
|
+
}
|
|
11048
|
+
break;
|
|
11049
|
+
}
|
|
11050
|
+
case "move": {
|
|
11051
|
+
isChanged = initialCoordinates.x1 !== coordinates.x1;
|
|
11052
|
+
if (isChanged) {
|
|
11053
|
+
if (rtl) {
|
|
11054
|
+
changedTask.end = dateByX(
|
|
11055
|
+
coordinates.x1,
|
|
11056
|
+
initialCoordinates.x1,
|
|
11057
|
+
selectedTask.end,
|
|
11058
|
+
xStep,
|
|
11059
|
+
timeStep
|
|
11060
|
+
);
|
|
11061
|
+
changedTask.start = dateByX(
|
|
11062
|
+
coordinates.x2,
|
|
11063
|
+
initialCoordinates.x2,
|
|
11064
|
+
selectedTask.start,
|
|
11065
|
+
xStep,
|
|
11066
|
+
timeStep
|
|
11067
|
+
);
|
|
11068
|
+
} else {
|
|
11069
|
+
changedTask.start = dateByX(
|
|
11070
|
+
coordinates.x1,
|
|
11071
|
+
initialCoordinates.x1,
|
|
11072
|
+
selectedTask.start,
|
|
11073
|
+
xStep,
|
|
11074
|
+
timeStep
|
|
11075
|
+
);
|
|
11076
|
+
changedTask.end = dateByX(
|
|
11077
|
+
coordinates.x2,
|
|
11078
|
+
initialCoordinates.x2,
|
|
11079
|
+
selectedTask.end,
|
|
11080
|
+
xStep,
|
|
11081
|
+
timeStep
|
|
11082
|
+
);
|
|
11083
|
+
}
|
|
11084
|
+
}
|
|
11085
|
+
break;
|
|
11086
|
+
}
|
|
11087
|
+
}
|
|
11088
|
+
return { isChanged, changedTask };
|
|
11089
|
+
};
|
|
11090
|
+
const handleTaskBySVGMouseEventForMilestone = (action, selectedTask, initialCoordinates, coordinates, xStep, timeStep) => {
|
|
11091
|
+
const changedTask = { ...selectedTask };
|
|
11092
|
+
const isChanged = coordinates.x1 !== initialCoordinates.x1;
|
|
11093
|
+
if (isChanged) {
|
|
11094
|
+
switch (action) {
|
|
11095
|
+
case "move": {
|
|
11096
|
+
changedTask.start = dateByX(
|
|
11097
|
+
coordinates.x1,
|
|
11098
|
+
initialCoordinates.x1,
|
|
11099
|
+
selectedTask.start,
|
|
11100
|
+
xStep,
|
|
11101
|
+
timeStep
|
|
11102
|
+
);
|
|
11103
|
+
changedTask.end = changedTask.start;
|
|
11104
|
+
break;
|
|
11105
|
+
}
|
|
11106
|
+
}
|
|
11107
|
+
}
|
|
11108
|
+
return { isChanged, changedTask };
|
|
11109
|
+
};
|
|
11110
|
+
const calculateDataDatePosition = ({
|
|
11111
|
+
dataDate,
|
|
11112
|
+
startDate,
|
|
11113
|
+
viewMode,
|
|
11114
|
+
columnWidth,
|
|
11115
|
+
tasks = [],
|
|
11116
|
+
rtl = false
|
|
11117
|
+
}) => {
|
|
11118
|
+
const tasksStartingOnDataDate = tasks.filter((task) => {
|
|
11119
|
+
if (!task || !task.start)
|
|
11120
|
+
return false;
|
|
11121
|
+
const taskStartDate = new Date(task.start);
|
|
11122
|
+
const dataDateNormalized = new Date(dataDate);
|
|
11123
|
+
switch (viewMode) {
|
|
11124
|
+
case ViewMode.Hour:
|
|
11125
|
+
return taskStartDate.getFullYear() === dataDateNormalized.getFullYear() && taskStartDate.getMonth() === dataDateNormalized.getMonth() && taskStartDate.getDate() === dataDateNormalized.getDate() && taskStartDate.getHours() === dataDateNormalized.getHours();
|
|
11126
|
+
case ViewMode.QuarterDay:
|
|
11127
|
+
return taskStartDate.getFullYear() === dataDateNormalized.getFullYear() && taskStartDate.getMonth() === dataDateNormalized.getMonth() && taskStartDate.getDate() === dataDateNormalized.getDate() && Math.floor(taskStartDate.getHours() / 6) === Math.floor(dataDateNormalized.getHours() / 6);
|
|
11128
|
+
case ViewMode.HalfDay:
|
|
11129
|
+
return taskStartDate.getFullYear() === dataDateNormalized.getFullYear() && taskStartDate.getMonth() === dataDateNormalized.getMonth() && taskStartDate.getDate() === dataDateNormalized.getDate() && Math.floor(taskStartDate.getHours() / 12) === Math.floor(dataDateNormalized.getHours() / 12);
|
|
11130
|
+
case ViewMode.Day:
|
|
11131
|
+
return taskStartDate.getFullYear() === dataDateNormalized.getFullYear() && taskStartDate.getMonth() === dataDateNormalized.getMonth() && taskStartDate.getDate() === dataDateNormalized.getDate();
|
|
11132
|
+
case ViewMode.Week: {
|
|
11133
|
+
const taskWeekStart = new Date(taskStartDate);
|
|
11134
|
+
taskWeekStart.setDate(taskStartDate.getDate() - taskStartDate.getDay());
|
|
11135
|
+
const dataWeekStart = new Date(dataDateNormalized);
|
|
11136
|
+
dataWeekStart.setDate(
|
|
11137
|
+
dataDateNormalized.getDate() - dataDateNormalized.getDay()
|
|
11138
|
+
);
|
|
11139
|
+
return taskWeekStart.getTime() === dataWeekStart.getTime();
|
|
11140
|
+
}
|
|
11141
|
+
case ViewMode.Month:
|
|
11142
|
+
return taskStartDate.getFullYear() === dataDateNormalized.getFullYear() && taskStartDate.getMonth() === dataDateNormalized.getMonth();
|
|
11143
|
+
case ViewMode.Year:
|
|
11144
|
+
return taskStartDate.getFullYear() === dataDateNormalized.getFullYear();
|
|
11145
|
+
default:
|
|
11146
|
+
return false;
|
|
11147
|
+
}
|
|
11148
|
+
});
|
|
11149
|
+
if (tasksStartingOnDataDate.length > 0) {
|
|
11150
|
+
let maxEndPosition = -Infinity;
|
|
11151
|
+
for (const task of tasksStartingOnDataDate) {
|
|
11152
|
+
const taskEndX = taskXCoordinate(
|
|
11153
|
+
task.end,
|
|
11154
|
+
startDate,
|
|
11155
|
+
viewMode,
|
|
11156
|
+
columnWidth
|
|
11157
|
+
);
|
|
11158
|
+
maxEndPosition = Math.max(maxEndPosition, taskEndX);
|
|
11159
|
+
}
|
|
11160
|
+
if (maxEndPosition > -Infinity) {
|
|
11161
|
+
return maxEndPosition;
|
|
11162
|
+
}
|
|
11163
|
+
}
|
|
11164
|
+
const dataIndex = getDatesDiff(dataDate, startDate, viewMode);
|
|
11165
|
+
const extraMultiplier = () => {
|
|
11166
|
+
switch (viewMode) {
|
|
11167
|
+
case ViewMode.Week: {
|
|
11168
|
+
const percent = dataDate.getDay() / 7;
|
|
11169
|
+
return 1 + percent * 0.2;
|
|
11170
|
+
}
|
|
11171
|
+
case ViewMode.Month: {
|
|
11172
|
+
const dayInMonth = dataDate.getDate();
|
|
11173
|
+
const maxDaysInMonth = getDaysInMonth(
|
|
11174
|
+
dataDate.getMonth(),
|
|
11175
|
+
dataDate.getFullYear()
|
|
11176
|
+
);
|
|
11177
|
+
const percent = dayInMonth / maxDaysInMonth;
|
|
11178
|
+
return 1 + percent * 0.5;
|
|
11179
|
+
}
|
|
11180
|
+
case ViewMode.Year: {
|
|
11181
|
+
const percent = dataDate.getMonth() / 12;
|
|
11182
|
+
return 1 + percent * 0.5;
|
|
11183
|
+
}
|
|
11184
|
+
default:
|
|
11185
|
+
return 1;
|
|
11186
|
+
}
|
|
11187
|
+
};
|
|
11188
|
+
const tickX = dataIndex * columnWidth * extraMultiplier();
|
|
11189
|
+
return rtl ? tickX + columnWidth : tickX;
|
|
11190
|
+
};
|
|
10918
11191
|
const GanttTodayInner = ({
|
|
10919
11192
|
additionalLeftSpace,
|
|
10920
11193
|
distances: { columnWidth },
|
|
@@ -10929,7 +11202,8 @@ const GanttTodayInner = ({
|
|
|
10929
11202
|
todayColor = null,
|
|
10930
11203
|
dataDateColor = null,
|
|
10931
11204
|
todayLabel = "Today",
|
|
10932
|
-
dataDateLabel = "Data Date"
|
|
11205
|
+
dataDateLabel = "Data Date",
|
|
11206
|
+
tasks = []
|
|
10933
11207
|
}) => {
|
|
10934
11208
|
const todayElement = useMemo(() => {
|
|
10935
11209
|
if (isUnknownDates || !showTodayLine) {
|
|
@@ -11012,32 +11286,15 @@ const GanttTodayInner = ({
|
|
|
11012
11286
|
if (!showDataDateLine || !dataDate) {
|
|
11013
11287
|
return null;
|
|
11014
11288
|
}
|
|
11015
|
-
const
|
|
11016
|
-
|
|
11017
|
-
|
|
11018
|
-
|
|
11019
|
-
|
|
11020
|
-
|
|
11021
|
-
|
|
11022
|
-
|
|
11023
|
-
|
|
11024
|
-
const maxDaysInMonth = getDaysInMonth(
|
|
11025
|
-
dataDate.getMonth(),
|
|
11026
|
-
dataDate.getFullYear()
|
|
11027
|
-
);
|
|
11028
|
-
const percent = dayInMonth / maxDaysInMonth;
|
|
11029
|
-
return 1 + percent * 0.5;
|
|
11030
|
-
}
|
|
11031
|
-
case ViewMode.Year: {
|
|
11032
|
-
const percent = dataDate.getMonth() / 12;
|
|
11033
|
-
return 1 + percent * 0.5;
|
|
11034
|
-
}
|
|
11035
|
-
default:
|
|
11036
|
-
return 1;
|
|
11037
|
-
}
|
|
11038
|
-
};
|
|
11039
|
-
const tickX = dataIndex * columnWidth * extraMultiplier();
|
|
11040
|
-
const x = rtl ? tickX + columnWidth : tickX;
|
|
11289
|
+
const tickX = calculateDataDatePosition({
|
|
11290
|
+
dataDate,
|
|
11291
|
+
startDate,
|
|
11292
|
+
viewMode,
|
|
11293
|
+
columnWidth,
|
|
11294
|
+
tasks,
|
|
11295
|
+
rtl
|
|
11296
|
+
});
|
|
11297
|
+
const x = rtl ? tickX : tickX;
|
|
11041
11298
|
const color = dataDateColor || "var(--gantt-calendar-today-color)";
|
|
11042
11299
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11043
11300
|
/* @__PURE__ */ jsx(
|
|
@@ -11083,7 +11340,8 @@ const GanttTodayInner = ({
|
|
|
11083
11340
|
showDataDateLine,
|
|
11084
11341
|
dataDate,
|
|
11085
11342
|
dataDateColor,
|
|
11086
|
-
dataDateLabel
|
|
11343
|
+
dataDateLabel,
|
|
11344
|
+
tasks
|
|
11087
11345
|
]);
|
|
11088
11346
|
return /* @__PURE__ */ jsxs("g", { className: "today", children: [
|
|
11089
11347
|
dataDateElement,
|
|
@@ -11778,204 +12036,6 @@ const RelationLine = ({
|
|
|
11778
12036
|
}
|
|
11779
12037
|
);
|
|
11780
12038
|
};
|
|
11781
|
-
const getDateByOffset = (startDate, offset2, viewMode) => {
|
|
11782
|
-
switch (viewMode) {
|
|
11783
|
-
case ViewMode.Day:
|
|
11784
|
-
return addDays(startDate, offset2);
|
|
11785
|
-
case ViewMode.HalfDay:
|
|
11786
|
-
return addHours(startDate, offset2 * 12);
|
|
11787
|
-
case ViewMode.QuarterDay:
|
|
11788
|
-
return addHours(startDate, offset2 * 6);
|
|
11789
|
-
case ViewMode.Hour:
|
|
11790
|
-
return addHours(startDate, offset2);
|
|
11791
|
-
case ViewMode.Month:
|
|
11792
|
-
return addMonths(startDate, offset2);
|
|
11793
|
-
case ViewMode.Week:
|
|
11794
|
-
return addWeeks(startDate, offset2);
|
|
11795
|
-
case ViewMode.Year:
|
|
11796
|
-
return addYears(startDate, offset2);
|
|
11797
|
-
default:
|
|
11798
|
-
throw new Error("Unknown view mode");
|
|
11799
|
-
}
|
|
11800
|
-
};
|
|
11801
|
-
const taskXCoordinate = (xDate, startDate, viewMode, columnWidth) => {
|
|
11802
|
-
const index2 = getDatesDiff(xDate, startDate, viewMode);
|
|
11803
|
-
const currentDate = getDateByOffset(startDate, index2, viewMode);
|
|
11804
|
-
const nextDate = getDateByOffset(startDate, index2 + 1, viewMode);
|
|
11805
|
-
const remainderMillis = xDate.getTime() - currentDate.getTime();
|
|
11806
|
-
const percentOfInterval = remainderMillis / (nextDate.getTime() - currentDate.getTime());
|
|
11807
|
-
return index2 * columnWidth + percentOfInterval * columnWidth;
|
|
11808
|
-
};
|
|
11809
|
-
const taskComparisonXCoordinate = (xDate, startDate, viewMode, columnWidth) => {
|
|
11810
|
-
const index2 = getDatesDiff(xDate, startDate, viewMode);
|
|
11811
|
-
const currentDate = getDateByOffset(startDate, index2, viewMode);
|
|
11812
|
-
const nextDate = getDateByOffset(startDate, index2 + 1, viewMode);
|
|
11813
|
-
const remainderMillis = xDate.getTime() - currentDate.getTime();
|
|
11814
|
-
const percentOfInterval = remainderMillis / (nextDate.getTime() - currentDate.getTime());
|
|
11815
|
-
return index2 * columnWidth + percentOfInterval * columnWidth;
|
|
11816
|
-
};
|
|
11817
|
-
const progressWithByParams = (taskX1, taskX2, progress, rtl) => {
|
|
11818
|
-
const progressWidth = Math.max((taskX2 - taskX1) * progress * 0.01, 0);
|
|
11819
|
-
let progressX;
|
|
11820
|
-
if (rtl) {
|
|
11821
|
-
progressX = taskX2 - progressWidth;
|
|
11822
|
-
} else {
|
|
11823
|
-
progressX = taskX1;
|
|
11824
|
-
}
|
|
11825
|
-
return [progressWidth, progressX];
|
|
11826
|
-
};
|
|
11827
|
-
const dateByX = (x, taskX, taskDate, xStep, timeStep) => {
|
|
11828
|
-
let newDate = new Date((x - taskX) / xStep * timeStep + taskDate.getTime());
|
|
11829
|
-
newDate = new Date(
|
|
11830
|
-
newDate.getTime() + (newDate.getTimezoneOffset() - taskDate.getTimezoneOffset()) * 6e4
|
|
11831
|
-
);
|
|
11832
|
-
return newDate;
|
|
11833
|
-
};
|
|
11834
|
-
const handleTaskBySVGMouseEvent = (action, selectedTask, initialCoordinates, coordinates, xStep, timeStep, rtl) => {
|
|
11835
|
-
let result;
|
|
11836
|
-
switch (selectedTask.type) {
|
|
11837
|
-
case "milestone":
|
|
11838
|
-
result = handleTaskBySVGMouseEventForMilestone(
|
|
11839
|
-
action,
|
|
11840
|
-
selectedTask,
|
|
11841
|
-
initialCoordinates,
|
|
11842
|
-
coordinates,
|
|
11843
|
-
xStep,
|
|
11844
|
-
timeStep
|
|
11845
|
-
);
|
|
11846
|
-
break;
|
|
11847
|
-
default:
|
|
11848
|
-
result = handleTaskBySVGMouseEventForBar(
|
|
11849
|
-
action,
|
|
11850
|
-
selectedTask,
|
|
11851
|
-
initialCoordinates,
|
|
11852
|
-
coordinates,
|
|
11853
|
-
xStep,
|
|
11854
|
-
timeStep,
|
|
11855
|
-
rtl
|
|
11856
|
-
);
|
|
11857
|
-
break;
|
|
11858
|
-
}
|
|
11859
|
-
return result;
|
|
11860
|
-
};
|
|
11861
|
-
const handleTaskBySVGMouseEventForBar = (action, selectedTask, initialCoordinates, coordinates, xStep, timeStep, rtl) => {
|
|
11862
|
-
const changedTask = { ...selectedTask };
|
|
11863
|
-
let isChanged = false;
|
|
11864
|
-
switch (action) {
|
|
11865
|
-
case "progress":
|
|
11866
|
-
isChanged = initialCoordinates.progressWidth !== coordinates.progressWidth;
|
|
11867
|
-
if (isChanged) {
|
|
11868
|
-
changedTask.progress = Math.round(
|
|
11869
|
-
coordinates.progressWidth * 100 / (coordinates.x2 - coordinates.x1)
|
|
11870
|
-
);
|
|
11871
|
-
}
|
|
11872
|
-
break;
|
|
11873
|
-
case "start": {
|
|
11874
|
-
isChanged = initialCoordinates.x1 !== coordinates.x1;
|
|
11875
|
-
if (isChanged) {
|
|
11876
|
-
if (rtl) {
|
|
11877
|
-
changedTask.end = dateByX(
|
|
11878
|
-
coordinates.x1,
|
|
11879
|
-
initialCoordinates.x1,
|
|
11880
|
-
selectedTask.end,
|
|
11881
|
-
xStep,
|
|
11882
|
-
timeStep
|
|
11883
|
-
);
|
|
11884
|
-
} else {
|
|
11885
|
-
changedTask.start = dateByX(
|
|
11886
|
-
coordinates.x1,
|
|
11887
|
-
initialCoordinates.x1,
|
|
11888
|
-
selectedTask.start,
|
|
11889
|
-
xStep,
|
|
11890
|
-
timeStep
|
|
11891
|
-
);
|
|
11892
|
-
}
|
|
11893
|
-
}
|
|
11894
|
-
break;
|
|
11895
|
-
}
|
|
11896
|
-
case "end": {
|
|
11897
|
-
isChanged = initialCoordinates.x2 !== coordinates.x2;
|
|
11898
|
-
if (isChanged) {
|
|
11899
|
-
if (rtl) {
|
|
11900
|
-
changedTask.start = dateByX(
|
|
11901
|
-
coordinates.x2,
|
|
11902
|
-
initialCoordinates.x2,
|
|
11903
|
-
selectedTask.start,
|
|
11904
|
-
xStep,
|
|
11905
|
-
timeStep
|
|
11906
|
-
);
|
|
11907
|
-
} else {
|
|
11908
|
-
changedTask.end = dateByX(
|
|
11909
|
-
coordinates.x2,
|
|
11910
|
-
initialCoordinates.x2,
|
|
11911
|
-
selectedTask.end,
|
|
11912
|
-
xStep,
|
|
11913
|
-
timeStep
|
|
11914
|
-
);
|
|
11915
|
-
}
|
|
11916
|
-
}
|
|
11917
|
-
break;
|
|
11918
|
-
}
|
|
11919
|
-
case "move": {
|
|
11920
|
-
isChanged = initialCoordinates.x1 !== coordinates.x1;
|
|
11921
|
-
if (isChanged) {
|
|
11922
|
-
if (rtl) {
|
|
11923
|
-
changedTask.end = dateByX(
|
|
11924
|
-
coordinates.x1,
|
|
11925
|
-
initialCoordinates.x1,
|
|
11926
|
-
selectedTask.end,
|
|
11927
|
-
xStep,
|
|
11928
|
-
timeStep
|
|
11929
|
-
);
|
|
11930
|
-
changedTask.start = dateByX(
|
|
11931
|
-
coordinates.x2,
|
|
11932
|
-
initialCoordinates.x2,
|
|
11933
|
-
selectedTask.start,
|
|
11934
|
-
xStep,
|
|
11935
|
-
timeStep
|
|
11936
|
-
);
|
|
11937
|
-
} else {
|
|
11938
|
-
changedTask.start = dateByX(
|
|
11939
|
-
coordinates.x1,
|
|
11940
|
-
initialCoordinates.x1,
|
|
11941
|
-
selectedTask.start,
|
|
11942
|
-
xStep,
|
|
11943
|
-
timeStep
|
|
11944
|
-
);
|
|
11945
|
-
changedTask.end = dateByX(
|
|
11946
|
-
coordinates.x2,
|
|
11947
|
-
initialCoordinates.x2,
|
|
11948
|
-
selectedTask.end,
|
|
11949
|
-
xStep,
|
|
11950
|
-
timeStep
|
|
11951
|
-
);
|
|
11952
|
-
}
|
|
11953
|
-
}
|
|
11954
|
-
break;
|
|
11955
|
-
}
|
|
11956
|
-
}
|
|
11957
|
-
return { isChanged, changedTask };
|
|
11958
|
-
};
|
|
11959
|
-
const handleTaskBySVGMouseEventForMilestone = (action, selectedTask, initialCoordinates, coordinates, xStep, timeStep) => {
|
|
11960
|
-
const changedTask = { ...selectedTask };
|
|
11961
|
-
const isChanged = coordinates.x1 !== initialCoordinates.x1;
|
|
11962
|
-
if (isChanged) {
|
|
11963
|
-
switch (action) {
|
|
11964
|
-
case "move": {
|
|
11965
|
-
changedTask.start = dateByX(
|
|
11966
|
-
coordinates.x1,
|
|
11967
|
-
initialCoordinates.x1,
|
|
11968
|
-
selectedTask.start,
|
|
11969
|
-
xStep,
|
|
11970
|
-
timeStep
|
|
11971
|
-
);
|
|
11972
|
-
changedTask.end = changedTask.start;
|
|
11973
|
-
break;
|
|
11974
|
-
}
|
|
11975
|
-
}
|
|
11976
|
-
}
|
|
11977
|
-
return { isChanged, changedTask };
|
|
11978
|
-
};
|
|
11979
12039
|
const barWrapper = "_barWrapper_5jhkr_1";
|
|
11980
12040
|
const barHandle = "_barHandle_5jhkr_11";
|
|
11981
12041
|
const barHandleImportantVisible = "_barHandleImportantVisible_5jhkr_37";
|
|
@@ -13369,19 +13429,15 @@ const TaskGanttContentInner = (props) => {
|
|
|
13369
13429
|
] });
|
|
13370
13430
|
};
|
|
13371
13431
|
const TaskGanttContent = memo(TaskGanttContentInner);
|
|
13372
|
-
const ganttVerticalContainer = "
|
|
13373
|
-
const horizontalContainer = "
|
|
13374
|
-
const wrapper = "
|
|
13375
|
-
const calendarDragging = "
|
|
13376
|
-
const disabled = "_disabled_15ld3_117";
|
|
13377
|
-
const disabledOverlay = "_disabledOverlay_15ld3_125";
|
|
13432
|
+
const ganttVerticalContainer = "_ganttVerticalContainer_1wr55_1";
|
|
13433
|
+
const horizontalContainer = "_horizontalContainer_1wr55_73";
|
|
13434
|
+
const wrapper = "_wrapper_1wr55_85";
|
|
13435
|
+
const calendarDragging = "_calendarDragging_1wr55_109";
|
|
13378
13436
|
const styles$2 = {
|
|
13379
13437
|
ganttVerticalContainer,
|
|
13380
13438
|
horizontalContainer,
|
|
13381
13439
|
wrapper,
|
|
13382
|
-
calendarDragging
|
|
13383
|
-
disabled,
|
|
13384
|
-
disabledOverlay
|
|
13440
|
+
calendarDragging
|
|
13385
13441
|
};
|
|
13386
13442
|
const TaskGanttInner = (props) => {
|
|
13387
13443
|
const {
|
|
@@ -13401,8 +13457,7 @@ const TaskGanttInner = (props) => {
|
|
|
13401
13457
|
onVerticalScrollbarScrollX,
|
|
13402
13458
|
verticalGanttContainerRef,
|
|
13403
13459
|
verticalScrollbarRef,
|
|
13404
|
-
onOpenGanttContextMenu
|
|
13405
|
-
isLoading = false
|
|
13460
|
+
onOpenGanttContextMenu
|
|
13406
13461
|
} = props;
|
|
13407
13462
|
const contentRef = React__default.useRef(null);
|
|
13408
13463
|
const moveStateVertRef = useRef(null);
|
|
@@ -13526,44 +13581,41 @@ const TaskGanttInner = (props) => {
|
|
|
13526
13581
|
children: /* @__PURE__ */ jsx(Calendar, { scrollRef: verticalGanttContainerRef, ...calendarProps })
|
|
13527
13582
|
}
|
|
13528
13583
|
),
|
|
13529
|
-
/* @__PURE__ */
|
|
13584
|
+
/* @__PURE__ */ jsx(
|
|
13530
13585
|
"div",
|
|
13531
13586
|
{
|
|
13532
13587
|
ref: horizontalContainerRef,
|
|
13533
13588
|
className: styles$2.horizontalContainer,
|
|
13534
13589
|
style: containerStyle,
|
|
13535
|
-
children:
|
|
13536
|
-
|
|
13537
|
-
|
|
13538
|
-
|
|
13539
|
-
|
|
13540
|
-
|
|
13541
|
-
|
|
13542
|
-
|
|
13543
|
-
|
|
13544
|
-
|
|
13545
|
-
|
|
13546
|
-
|
|
13547
|
-
|
|
13590
|
+
children: /* @__PURE__ */ jsx("div", { style: gridStyle, children: /* @__PURE__ */ jsxs(
|
|
13591
|
+
"svg",
|
|
13592
|
+
{
|
|
13593
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13594
|
+
width: fullSvgWidth,
|
|
13595
|
+
height: ganttFullHeight,
|
|
13596
|
+
fontFamily: "var(--gantt-font-family)",
|
|
13597
|
+
ref: ganttSVGRef,
|
|
13598
|
+
onContextMenu: (event) => {
|
|
13599
|
+
event.preventDefault();
|
|
13600
|
+
if (onOpenGanttContextMenu) {
|
|
13601
|
+
onOpenGanttContextMenu(event.clientX, event.clientY);
|
|
13602
|
+
}
|
|
13603
|
+
},
|
|
13604
|
+
children: [
|
|
13605
|
+
/* @__PURE__ */ jsx(GanttToday, { ...ganttTodayProps }),
|
|
13606
|
+
/* @__PURE__ */ jsx(
|
|
13607
|
+
"rect",
|
|
13608
|
+
{
|
|
13609
|
+
ref: contentRef,
|
|
13610
|
+
width: "100%",
|
|
13611
|
+
height: "100%",
|
|
13612
|
+
fill: "transparent"
|
|
13548
13613
|
}
|
|
13549
|
-
|
|
13550
|
-
|
|
13551
|
-
|
|
13552
|
-
|
|
13553
|
-
|
|
13554
|
-
{
|
|
13555
|
-
ref: contentRef,
|
|
13556
|
-
width: "100%",
|
|
13557
|
-
height: "100%",
|
|
13558
|
-
fill: "transparent"
|
|
13559
|
-
}
|
|
13560
|
-
),
|
|
13561
|
-
/* @__PURE__ */ jsx(TaskGanttContent, { ...barProps })
|
|
13562
|
-
]
|
|
13563
|
-
}
|
|
13564
|
-
) }),
|
|
13565
|
-
isLoading && /* @__PURE__ */ jsx("div", { className: styles$2.disabledOverlay })
|
|
13566
|
-
]
|
|
13614
|
+
),
|
|
13615
|
+
/* @__PURE__ */ jsx(TaskGanttContent, { ...barProps })
|
|
13616
|
+
]
|
|
13617
|
+
}
|
|
13618
|
+
) })
|
|
13567
13619
|
}
|
|
13568
13620
|
)
|
|
13569
13621
|
]
|
|
@@ -18033,7 +18085,7 @@ function MenuOption(props) {
|
|
|
18033
18085
|
},
|
|
18034
18086
|
handleAction,
|
|
18035
18087
|
option,
|
|
18036
|
-
option: { icon: icon2, label: label2, disabled
|
|
18088
|
+
option: { icon: icon2, label: label2, disabled, children }
|
|
18037
18089
|
} = props;
|
|
18038
18090
|
const [hovered, setHovered] = useState(false);
|
|
18039
18091
|
const [coords, setCoords] = useState(null);
|
|
@@ -18043,7 +18095,7 @@ function MenuOption(props) {
|
|
|
18043
18095
|
const onClick = useCallback(
|
|
18044
18096
|
(e) => {
|
|
18045
18097
|
e.preventDefault();
|
|
18046
|
-
if (
|
|
18098
|
+
if (disabled) {
|
|
18047
18099
|
return;
|
|
18048
18100
|
}
|
|
18049
18101
|
if (children && children.length > 0) {
|
|
@@ -18053,7 +18105,7 @@ function MenuOption(props) {
|
|
|
18053
18105
|
handleAction(option);
|
|
18054
18106
|
onClose == null ? void 0 : onClose();
|
|
18055
18107
|
},
|
|
18056
|
-
[onClose, handleAction, option,
|
|
18108
|
+
[onClose, handleAction, option, disabled, children]
|
|
18057
18109
|
);
|
|
18058
18110
|
useEffect(() => {
|
|
18059
18111
|
if (!hovered || !nestedRef.current)
|
|
@@ -18113,8 +18165,8 @@ function MenuOption(props) {
|
|
|
18113
18165
|
"button",
|
|
18114
18166
|
{
|
|
18115
18167
|
className: styles$1.menuOption,
|
|
18116
|
-
"aria-disabled":
|
|
18117
|
-
disabled
|
|
18168
|
+
"aria-disabled": disabled,
|
|
18169
|
+
disabled,
|
|
18118
18170
|
style: {
|
|
18119
18171
|
height: contextMenuOptionHeight,
|
|
18120
18172
|
paddingLeft: contextMenuSidePadding,
|
|
@@ -18131,7 +18183,7 @@ function MenuOption(props) {
|
|
|
18131
18183
|
style: {
|
|
18132
18184
|
width: contextMenuIconWidth,
|
|
18133
18185
|
color: "var(--gantt-context-menu-text-color)",
|
|
18134
|
-
opacity:
|
|
18186
|
+
opacity: disabled ? 0.3 : 0.5
|
|
18135
18187
|
},
|
|
18136
18188
|
children: icon2
|
|
18137
18189
|
}
|
|
@@ -18998,8 +19050,7 @@ const Gantt = (props) => {
|
|
|
18998
19050
|
todayLabel = "Today",
|
|
18999
19051
|
dataDateLabel = "Data Date",
|
|
19000
19052
|
showProgress = true,
|
|
19001
|
-
progressColor
|
|
19002
|
-
isLoading = false
|
|
19053
|
+
progressColor
|
|
19003
19054
|
} = props;
|
|
19004
19055
|
const ganttSVGRef = useRef(null);
|
|
19005
19056
|
const wrapperRef = useRef(null);
|
|
@@ -20201,7 +20252,8 @@ const Gantt = (props) => {
|
|
|
20201
20252
|
todayColor,
|
|
20202
20253
|
dataDateColor,
|
|
20203
20254
|
todayLabel,
|
|
20204
|
-
dataDateLabel
|
|
20255
|
+
dataDateLabel,
|
|
20256
|
+
tasks: sortedTasks.filter((task) => task.type !== "empty")
|
|
20205
20257
|
}),
|
|
20206
20258
|
[
|
|
20207
20259
|
additionalLeftSpace,
|
|
@@ -20217,7 +20269,8 @@ const Gantt = (props) => {
|
|
|
20217
20269
|
todayColor,
|
|
20218
20270
|
dataDateColor,
|
|
20219
20271
|
todayLabel,
|
|
20220
|
-
dataDateLabel
|
|
20272
|
+
dataDateLabel,
|
|
20273
|
+
sortedTasks
|
|
20221
20274
|
]
|
|
20222
20275
|
);
|
|
20223
20276
|
const calendarProps = useMemo(
|
|
@@ -20362,8 +20415,7 @@ const Gantt = (props) => {
|
|
|
20362
20415
|
taskListContainerRef,
|
|
20363
20416
|
taskListRef,
|
|
20364
20417
|
tasks: visibleTasks,
|
|
20365
|
-
ganttRef: wrapperRef
|
|
20366
|
-
isLoading
|
|
20418
|
+
ganttRef: wrapperRef
|
|
20367
20419
|
}),
|
|
20368
20420
|
[
|
|
20369
20421
|
childTasksMap,
|
|
@@ -20392,8 +20444,7 @@ const Gantt = (props) => {
|
|
|
20392
20444
|
selectedIdsMirror,
|
|
20393
20445
|
taskList,
|
|
20394
20446
|
taskListContainerRef,
|
|
20395
|
-
visibleTasks
|
|
20396
|
-
isLoading
|
|
20447
|
+
visibleTasks
|
|
20397
20448
|
]
|
|
20398
20449
|
);
|
|
20399
20450
|
return /* @__PURE__ */ jsx(GanttThemeProvider, { theme, children: (cssVars) => /* @__PURE__ */ jsx(GanttLocaleProvider, { locale, children: /* @__PURE__ */ jsxs(
|
|
@@ -20431,8 +20482,7 @@ const Gantt = (props) => {
|
|
|
20431
20482
|
verticalGanttContainerRef,
|
|
20432
20483
|
onOpenGanttContextMenu: (clientX, clientY) => {
|
|
20433
20484
|
handleOpenGanttContextMenu(null, clientX, clientY);
|
|
20434
|
-
}
|
|
20435
|
-
isLoading
|
|
20485
|
+
}
|
|
20436
20486
|
}
|
|
20437
20487
|
),
|
|
20438
20488
|
tooltipTaskFromMap && /* @__PURE__ */ jsx(
|