@progress/kendo-react-gantt 6.1.1 → 7.0.0-develop.1
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/npm/Gantt.d.ts → Gantt.d.ts} +4 -0
- package/LICENSE.md +1 -1
- package/{dist/es/cells → cells}/FilterCells/GanttBooleanFilter.d.ts +4 -0
- package/{dist/npm/cells → cells}/FilterCells/GanttDateFilter.d.ts +4 -0
- package/{dist/es/cells → cells}/FilterCells/GanttNumericFilter.d.ts +4 -0
- package/{dist/npm/cells → cells}/FilterCells/GanttTextFilter.d.ts +4 -0
- package/{dist/npm/cells → cells}/FilterCells/utils.d.ts +4 -0
- package/{dist/npm/components → components}/BaseView.d.ts +4 -0
- package/components/GanttDependency.d.ts +13 -0
- package/{dist/npm/components → components}/GanttTask.d.ts +4 -0
- package/{dist/npm/components → components}/GanttTreelist.d.ts +6 -2
- package/{dist/npm/components → components}/toolbar/AddButton.d.ts +4 -0
- package/{dist/npm/components → components}/toolbar/Toolbar.d.ts +4 -0
- package/{dist/es/components → components}/toolbar/view-selector/ViewSelector.d.ts +4 -0
- package/components/toolbar/view-selector/ViewSelectorItem.d.ts +15 -0
- package/components/toolbar/view-selector/ViewSelectorList.d.ts +7 -0
- package/{dist/npm/constants → constants}/index.d.ts +4 -0
- package/{dist/es/context → context}/GanttContext.d.ts +17 -13
- package/{dist/npm/context → context}/GanttViewContext.d.ts +8 -4
- package/dist/cdn/js/kendo-react-gantt.js +5 -1
- package/editors/FormDateTimePicker.d.ts +8 -0
- package/editors/FormInput.d.ts +8 -0
- package/editors/FormNumericTextBox.d.ts +8 -0
- package/editors/GanttEditor.d.ts +8 -0
- package/{dist/npm/editors → editors}/GanttForm.d.ts +4 -0
- package/{dist/es/editors → editors}/GanttRemoveDialog.d.ts +4 -0
- package/hooks/useControlledState.d.ts +8 -0
- package/{dist/es/hooks → hooks}/useDictionaryStore.d.ts +5 -1
- package/hooks/useGanttTask.d.ts +8 -0
- package/index.d.ts +30 -0
- package/index.js +5 -0
- package/index.mjs +2582 -0
- package/interfaces/AddDirection.d.ts +10 -0
- package/interfaces/DataItem.d.ts +10 -0
- package/interfaces/DateRange.d.ts +12 -0
- package/{dist/es/interfaces → interfaces}/DependencyModelFields.d.ts +4 -0
- package/{dist/npm/interfaces → interfaces}/GanttBaseProps.d.ts +4 -1
- package/{dist/es/interfaces → interfaces}/GanttCellProps.d.ts +4 -1
- package/{dist/npm/interfaces → interfaces}/GanttColumnProps.d.ts +4 -0
- package/{dist/npm/interfaces → interfaces}/GanttDependencyModelFields.d.ts +4 -0
- package/interfaces/GanttFilterCellProps.d.ts +10 -0
- package/interfaces/GanttFilterOperator.d.ts +10 -0
- package/interfaces/GanttHeaderCellProps.d.ts +10 -0
- package/interfaces/GanttNoRecordsProps.d.ts +13 -0
- package/{dist/npm/interfaces → interfaces}/GanttProps.d.ts +4 -1
- package/{dist/es/interfaces → interfaces}/GanttRowProps.d.ts +4 -1
- package/{dist/es/interfaces → interfaces}/GanttSelectableSettings.d.ts +5 -1
- package/interfaces/GanttSlotType.d.ts +8 -0
- package/interfaces/GanttSortSettings.d.ts +17 -0
- package/{dist/es/interfaces → interfaces}/GanttTaskModelFields.d.ts +4 -0
- package/{dist/npm/interfaces → interfaces}/GanttView.d.ts +6 -3
- package/{dist/es/interfaces → interfaces}/GanttViewTimelineHeaderCellProps.d.ts +4 -0
- package/interfaces/Rectangle.d.ts +10 -0
- package/interfaces/Slot.d.ts +16 -0
- package/interfaces/TaskModelFields.d.ts +19 -0
- package/{dist/npm/interfaces → interfaces}/events.d.ts +4 -0
- package/{dist/es/messages → messages}/index.d.ts +4 -0
- package/package-metadata.d.ts +9 -0
- package/package.json +40 -57
- package/rows/GanttRow.d.ts +8 -0
- package/{dist/es/utils → utils}/data-operations.d.ts +4 -0
- package/{dist/es/utils → utils}/index.d.ts +11 -7
- package/{dist/npm/views → views}/GanttDayView.d.ts +4 -0
- package/{dist/npm/views → views}/GanttMonthView.d.ts +4 -0
- package/{dist/es/views → views}/GanttWeekView.d.ts +4 -0
- package/{dist/npm/views → views}/GanttYearView.d.ts +4 -0
- package/about.md +0 -3
- package/dist/es/Gantt.d.ts +0 -25
- package/dist/es/Gantt.js +0 -332
- package/dist/es/GanttNoRecords.d.ts +0 -12
- package/dist/es/GanttNoRecords.js +0 -37
- package/dist/es/cells/FilterCells/GanttBooleanFilter.js +0 -31
- package/dist/es/cells/FilterCells/GanttDateFilter.d.ts +0 -10
- package/dist/es/cells/FilterCells/GanttDateFilter.js +0 -31
- package/dist/es/cells/FilterCells/GanttNumericFilter.js +0 -31
- package/dist/es/cells/FilterCells/GanttTextFilter.d.ts +0 -10
- package/dist/es/cells/FilterCells/GanttTextFilter.js +0 -31
- package/dist/es/cells/FilterCells/utils.d.ts +0 -38
- package/dist/es/cells/FilterCells/utils.js +0 -66
- package/dist/es/components/BaseView.d.ts +0 -20
- package/dist/es/components/BaseView.js +0 -253
- package/dist/es/components/GanttDependency.d.ts +0 -10
- package/dist/es/components/GanttDependency.js +0 -56
- package/dist/es/components/GanttTask.d.ts +0 -12
- package/dist/es/components/GanttTask.js +0 -164
- package/dist/es/components/GanttTreelist.d.ts +0 -138
- package/dist/es/components/GanttTreelist.js +0 -607
- package/dist/es/components/toolbar/AddButton.d.ts +0 -12
- package/dist/es/components/toolbar/AddButton.js +0 -47
- package/dist/es/components/toolbar/Toolbar.d.ts +0 -21
- package/dist/es/components/toolbar/Toolbar.js +0 -41
- package/dist/es/components/toolbar/view-selector/ViewSelector.js +0 -38
- package/dist/es/components/toolbar/view-selector/ViewSelectorItem.d.ts +0 -12
- package/dist/es/components/toolbar/view-selector/ViewSelectorItem.js +0 -17
- package/dist/es/components/toolbar/view-selector/ViewSelectorList.d.ts +0 -3
- package/dist/es/components/toolbar/view-selector/ViewSelectorList.js +0 -42
- package/dist/es/constants/index.d.ts +0 -53
- package/dist/es/constants/index.js +0 -63
- package/dist/es/context/GanttContext.js +0 -105
- package/dist/es/context/GanttViewContext.d.ts +0 -40
- package/dist/es/context/GanttViewContext.js +0 -31
- package/dist/es/editors/FormAssingmentsEditor.d.ts +0 -5
- package/dist/es/editors/FormAssingmentsEditor.js +0 -20
- package/dist/es/editors/FormDateTimePicker.d.ts +0 -5
- package/dist/es/editors/FormDateTimePicker.js +0 -45
- package/dist/es/editors/FormInput.d.ts +0 -5
- package/dist/es/editors/FormInput.js +0 -44
- package/dist/es/editors/FormNumericTextBox.d.ts +0 -5
- package/dist/es/editors/FormNumericTextBox.js +0 -44
- package/dist/es/editors/GanttEditor.d.ts +0 -5
- package/dist/es/editors/GanttEditor.js +0 -39
- package/dist/es/editors/GanttForm.d.ts +0 -44
- package/dist/es/editors/GanttForm.js +0 -72
- package/dist/es/editors/GanttRemoveDialog.js +0 -61
- package/dist/es/hooks/useControlledState.d.ts +0 -4
- package/dist/es/hooks/useControlledState.js +0 -23
- package/dist/es/hooks/useDictionaryStore.js +0 -24
- package/dist/es/hooks/useGanttTask.d.ts +0 -4
- package/dist/es/hooks/useGanttTask.js +0 -27
- package/dist/es/interfaces/AddDirection.d.ts +0 -6
- package/dist/es/interfaces/AddDirection.js +0 -1
- package/dist/es/interfaces/DataAction.d.ts +0 -25
- package/dist/es/interfaces/DataAction.js +0 -9
- package/dist/es/interfaces/DataItem.d.ts +0 -6
- package/dist/es/interfaces/DataItem.js +0 -1
- package/dist/es/interfaces/DateRange.d.ts +0 -8
- package/dist/es/interfaces/DateRange.js +0 -1
- package/dist/es/interfaces/DependencyModelFields.js +0 -1
- package/dist/es/interfaces/DragEvent.d.ts +0 -14
- package/dist/es/interfaces/DragEvent.js +0 -1
- package/dist/es/interfaces/GanttBaseProps.d.ts +0 -63
- package/dist/es/interfaces/GanttBaseProps.js +0 -1
- package/dist/es/interfaces/GanttCellProps.js +0 -1
- package/dist/es/interfaces/GanttColumnProps.d.ts +0 -36
- package/dist/es/interfaces/GanttColumnProps.js +0 -1
- package/dist/es/interfaces/GanttDependencyModelFields.d.ts +0 -25
- package/dist/es/interfaces/GanttDependencyModelFields.js +0 -1
- package/dist/es/interfaces/GanttFilterCellProps.d.ts +0 -6
- package/dist/es/interfaces/GanttFilterCellProps.js +0 -1
- package/dist/es/interfaces/GanttFilterOperator.d.ts +0 -6
- package/dist/es/interfaces/GanttFilterOperator.js +0 -1
- package/dist/es/interfaces/GanttHeaderCellProps.d.ts +0 -6
- package/dist/es/interfaces/GanttHeaderCellProps.js +0 -1
- package/dist/es/interfaces/GanttNoRecordsProps.d.ts +0 -10
- package/dist/es/interfaces/GanttNoRecordsProps.js +0 -1
- package/dist/es/interfaces/GanttProps.d.ts +0 -147
- package/dist/es/interfaces/GanttProps.js +0 -1
- package/dist/es/interfaces/GanttRowProps.js +0 -1
- package/dist/es/interfaces/GanttSelectableSettings.js +0 -2
- package/dist/es/interfaces/GanttSlotType.d.ts +0 -4
- package/dist/es/interfaces/GanttSlotType.js +0 -1
- package/dist/es/interfaces/GanttSortSettings.d.ts +0 -13
- package/dist/es/interfaces/GanttSortSettings.js +0 -19
- package/dist/es/interfaces/GanttTaskModelFields.js +0 -1
- package/dist/es/interfaces/GanttView.d.ts +0 -77
- package/dist/es/interfaces/GanttView.js +0 -1
- package/dist/es/interfaces/GanttViewTimelineHeaderCellProps.js +0 -1
- package/dist/es/interfaces/Rectangle.d.ts +0 -6
- package/dist/es/interfaces/Rectangle.js +0 -1
- package/dist/es/interfaces/Slot.d.ts +0 -12
- package/dist/es/interfaces/Slot.js +0 -1
- package/dist/es/interfaces/TaskModelFields.d.ts +0 -15
- package/dist/es/interfaces/TaskModelFields.js +0 -1
- package/dist/es/interfaces/events.d.ts +0 -294
- package/dist/es/interfaces/events.js +0 -84
- package/dist/es/main.d.ts +0 -26
- package/dist/es/main.js +0 -17
- package/dist/es/messages/index.js +0 -138
- package/dist/es/package-metadata.d.ts +0 -5
- package/dist/es/package-metadata.js +0 -11
- package/dist/es/rows/GanttRow.d.ts +0 -5
- package/dist/es/rows/GanttRow.js +0 -5
- package/dist/es/utils/data-operations.js +0 -319
- package/dist/es/utils/index.js +0 -455
- package/dist/es/views/GanttDayView.d.ts +0 -17
- package/dist/es/views/GanttDayView.js +0 -102
- package/dist/es/views/GanttMonthView.d.ts +0 -13
- package/dist/es/views/GanttMonthView.js +0 -78
- package/dist/es/views/GanttWeekView.js +0 -84
- package/dist/es/views/GanttYearView.d.ts +0 -13
- package/dist/es/views/GanttYearView.js +0 -70
- package/dist/npm/Gantt.js +0 -335
- package/dist/npm/GanttNoRecords.d.ts +0 -12
- package/dist/npm/GanttNoRecords.js +0 -40
- package/dist/npm/cells/FilterCells/GanttBooleanFilter.d.ts +0 -10
- package/dist/npm/cells/FilterCells/GanttBooleanFilter.js +0 -35
- package/dist/npm/cells/FilterCells/GanttDateFilter.js +0 -35
- package/dist/npm/cells/FilterCells/GanttNumericFilter.d.ts +0 -10
- package/dist/npm/cells/FilterCells/GanttNumericFilter.js +0 -35
- package/dist/npm/cells/FilterCells/GanttTextFilter.js +0 -35
- package/dist/npm/cells/FilterCells/utils.js +0 -70
- package/dist/npm/components/BaseView.js +0 -256
- package/dist/npm/components/GanttDependency.d.ts +0 -10
- package/dist/npm/components/GanttDependency.js +0 -60
- package/dist/npm/components/GanttTask.js +0 -167
- package/dist/npm/components/GanttTreelist.js +0 -610
- package/dist/npm/components/toolbar/AddButton.js +0 -50
- package/dist/npm/components/toolbar/Toolbar.js +0 -44
- package/dist/npm/components/toolbar/view-selector/ViewSelector.d.ts +0 -24
- package/dist/npm/components/toolbar/view-selector/ViewSelector.js +0 -41
- package/dist/npm/components/toolbar/view-selector/ViewSelectorItem.d.ts +0 -12
- package/dist/npm/components/toolbar/view-selector/ViewSelectorItem.js +0 -21
- package/dist/npm/components/toolbar/view-selector/ViewSelectorList.d.ts +0 -3
- package/dist/npm/components/toolbar/view-selector/ViewSelectorList.js +0 -45
- package/dist/npm/constants/index.js +0 -67
- package/dist/npm/context/GanttContext.d.ts +0 -121
- package/dist/npm/context/GanttContext.js +0 -121
- package/dist/npm/context/GanttViewContext.js +0 -38
- package/dist/npm/editors/FormAssingmentsEditor.d.ts +0 -5
- package/dist/npm/editors/FormAssingmentsEditor.js +0 -24
- package/dist/npm/editors/FormDateTimePicker.d.ts +0 -5
- package/dist/npm/editors/FormDateTimePicker.js +0 -49
- package/dist/npm/editors/FormInput.d.ts +0 -5
- package/dist/npm/editors/FormInput.js +0 -48
- package/dist/npm/editors/FormNumericTextBox.d.ts +0 -5
- package/dist/npm/editors/FormNumericTextBox.js +0 -48
- package/dist/npm/editors/GanttEditor.d.ts +0 -5
- package/dist/npm/editors/GanttEditor.js +0 -43
- package/dist/npm/editors/GanttForm.js +0 -76
- package/dist/npm/editors/GanttRemoveDialog.d.ts +0 -44
- package/dist/npm/editors/GanttRemoveDialog.js +0 -65
- package/dist/npm/hooks/useControlledState.d.ts +0 -4
- package/dist/npm/hooks/useControlledState.js +0 -27
- package/dist/npm/hooks/useDictionaryStore.d.ts +0 -18
- package/dist/npm/hooks/useDictionaryStore.js +0 -28
- package/dist/npm/hooks/useGanttTask.d.ts +0 -4
- package/dist/npm/hooks/useGanttTask.js +0 -31
- package/dist/npm/interfaces/AddDirection.d.ts +0 -6
- package/dist/npm/interfaces/AddDirection.js +0 -2
- package/dist/npm/interfaces/DataAction.d.ts +0 -25
- package/dist/npm/interfaces/DataAction.js +0 -12
- package/dist/npm/interfaces/DataItem.d.ts +0 -6
- package/dist/npm/interfaces/DataItem.js +0 -2
- package/dist/npm/interfaces/DateRange.d.ts +0 -8
- package/dist/npm/interfaces/DateRange.js +0 -2
- package/dist/npm/interfaces/DependencyModelFields.d.ts +0 -25
- package/dist/npm/interfaces/DependencyModelFields.js +0 -2
- package/dist/npm/interfaces/DragEvent.d.ts +0 -14
- package/dist/npm/interfaces/DragEvent.js +0 -2
- package/dist/npm/interfaces/GanttBaseProps.js +0 -2
- package/dist/npm/interfaces/GanttCellProps.d.ts +0 -42
- package/dist/npm/interfaces/GanttCellProps.js +0 -2
- package/dist/npm/interfaces/GanttColumnProps.js +0 -2
- package/dist/npm/interfaces/GanttDependencyModelFields.js +0 -2
- package/dist/npm/interfaces/GanttFilterCellProps.d.ts +0 -6
- package/dist/npm/interfaces/GanttFilterCellProps.js +0 -2
- package/dist/npm/interfaces/GanttFilterOperator.d.ts +0 -6
- package/dist/npm/interfaces/GanttFilterOperator.js +0 -2
- package/dist/npm/interfaces/GanttHeaderCellProps.d.ts +0 -6
- package/dist/npm/interfaces/GanttHeaderCellProps.js +0 -2
- package/dist/npm/interfaces/GanttNoRecordsProps.d.ts +0 -10
- package/dist/npm/interfaces/GanttNoRecordsProps.js +0 -2
- package/dist/npm/interfaces/GanttProps.js +0 -2
- package/dist/npm/interfaces/GanttRowProps.d.ts +0 -92
- package/dist/npm/interfaces/GanttRowProps.js +0 -2
- package/dist/npm/interfaces/GanttSelectableSettings.d.ts +0 -18
- package/dist/npm/interfaces/GanttSelectableSettings.js +0 -3
- package/dist/npm/interfaces/GanttSlotType.d.ts +0 -4
- package/dist/npm/interfaces/GanttSlotType.js +0 -2
- package/dist/npm/interfaces/GanttSortSettings.d.ts +0 -13
- package/dist/npm/interfaces/GanttSortSettings.js +0 -23
- package/dist/npm/interfaces/GanttTaskModelFields.d.ts +0 -55
- package/dist/npm/interfaces/GanttTaskModelFields.js +0 -2
- package/dist/npm/interfaces/GanttView.js +0 -2
- package/dist/npm/interfaces/GanttViewTimelineHeaderCellProps.d.ts +0 -19
- package/dist/npm/interfaces/GanttViewTimelineHeaderCellProps.js +0 -2
- package/dist/npm/interfaces/Rectangle.d.ts +0 -6
- package/dist/npm/interfaces/Rectangle.js +0 -2
- package/dist/npm/interfaces/Slot.d.ts +0 -12
- package/dist/npm/interfaces/Slot.js +0 -2
- package/dist/npm/interfaces/TaskModelFields.d.ts +0 -15
- package/dist/npm/interfaces/TaskModelFields.js +0 -2
- package/dist/npm/interfaces/events.js +0 -85
- package/dist/npm/main.d.ts +0 -26
- package/dist/npm/main.js +0 -46
- package/dist/npm/messages/index.d.ts +0 -137
- package/dist/npm/messages/index.js +0 -141
- package/dist/npm/package-metadata.d.ts +0 -5
- package/dist/npm/package-metadata.js +0 -14
- package/dist/npm/rows/GanttRow.d.ts +0 -5
- package/dist/npm/rows/GanttRow.js +0 -8
- package/dist/npm/utils/data-operations.d.ts +0 -43
- package/dist/npm/utils/data-operations.js +0 -326
- package/dist/npm/utils/index.d.ts +0 -178
- package/dist/npm/utils/index.js +0 -485
- package/dist/npm/views/GanttDayView.js +0 -105
- package/dist/npm/views/GanttMonthView.js +0 -81
- package/dist/npm/views/GanttWeekView.d.ts +0 -13
- package/dist/npm/views/GanttWeekView.js +0 -87
- package/dist/npm/views/GanttYearView.js +0 -73
- package/dist/systemjs/kendo-react-gantt.js +0 -1
- package/e2e-next/gantt.basic.tests.ts +0 -24
package/index.mjs
ADDED
|
@@ -0,0 +1,2582 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as t from "react";
|
|
6
|
+
import * as i from "prop-types";
|
|
7
|
+
import { mapTree as ya, extendDataItem as va, getter as D, classNames as ce, noop as F, useDraggable as Kt, IconWrap as mt, guid as Jt, canUseDOM as gt, validatePackage as Ta, shouldShowValidationUI as ba, WatermarkOverlay as Ra, setter as ee } from "@progress/kendo-react-common";
|
|
8
|
+
import { MS_PER_MINUTE as Sa, MS_PER_DAY as Oe, getDate as oe, addDays as ht, ZonedDate as S, firstDayInWeek as at, addMonths as Qt, firstDayOfMonth as en, lastDayOfMonth as tn, firstMonthOfYear as xa, lastMonthOfYear as Ia } from "@progress/kendo-date-math";
|
|
9
|
+
import { TABLE_ROW_INDEX_ATTRIBUTE as Na, TABLE_COL_INDEX_ATTRIBUTE as Ma, TABLE_PREVENT_SELECTION_ELEMENT as Fa, orderBy as La, filterBy as Ha, tableKeyboardNavigation as De, getSelectionOptions as Bt, CommonDragLogic as Aa, ColumnResize as Va, tableKeyboardNavigationTools as $t, Header as za, HeaderRow as Ga, tableColumnsVirtualization as Wa, TableKeyboardNavigationContext as nn, tableKeyboardNavigationScopeAttributes as Oa, TableSelection as Pa, tableKeyboardNavigationBodyAttributes as _a, DropClue as Ka, DragClue as Ba, FilterRow as $a, readColumns as Ua, mapColumns as Ya, TextFilterCell as qa, NumericFilterCell as Xa, BooleanFilterCell as ja, DateFilterCell as Za } from "@progress/kendo-react-data-tools";
|
|
10
|
+
import { getSelectedState as Ps, getSelectedStateFromKeyDown as _s, setSelectedState as Ks } from "@progress/kendo-react-data-tools";
|
|
11
|
+
import { createDataTree as Ja, setHeaderRowsTop as Qa, tableRowsVirtualization as eo, TreeListRow as an, TreeListNoRecords as to, TreeListCell as no, flatData as ao } from "@progress/kendo-react-treelist";
|
|
12
|
+
import { useInternationalization as xe, useLocalization as ae } from "@progress/kendo-react-intl";
|
|
13
|
+
import { xIcon as oo, caretAltDownIcon as so, plusIcon as ro } from "@progress/kendo-svg-icons";
|
|
14
|
+
import { Button as ze, ButtonGroup as lo, DropDownButton as on, ToolbarItem as io, Toolbar as co, ToolbarSpacer as uo } from "@progress/kendo-react-buttons";
|
|
15
|
+
import * as sn from "react-dom";
|
|
16
|
+
import { FieldWrapper as ft, FormElement as mo, Field as He, Form as go } from "@progress/kendo-react-form";
|
|
17
|
+
import { Dialog as rn, DialogActionsBar as ln } from "@progress/kendo-react-dialogs";
|
|
18
|
+
import { Label as pt, Hint as Ct, Error as kt } from "@progress/kendo-react-labels";
|
|
19
|
+
import { Input as ho, NumericTextBox as fo } from "@progress/kendo-react-inputs";
|
|
20
|
+
import { DateTimePicker as po } from "@progress/kendo-react-dateinputs";
|
|
21
|
+
const bs = Na, Rs = Ma, Ss = Fa, Ut = (/* @__PURE__ */ new Date()).getTime(), cn = 7, Co = "hh:mm a", ot = { skeleton: "MEd" }, ko = "MMM", Eo = "yyyy", Ie = 100, Do = 6, Ge = "data-dependency-drag-handle", wo = "start", yo = "finish", Yt = { [Ge]: wo }, qt = { [Ge]: yo }, We = "data-task-id", dn = {
|
|
22
|
+
id: "id",
|
|
23
|
+
start: "start",
|
|
24
|
+
end: "end",
|
|
25
|
+
title: "title",
|
|
26
|
+
percentComplete: "percentComplete",
|
|
27
|
+
isRollup: "isRollup",
|
|
28
|
+
isExpanded: "isExpanded",
|
|
29
|
+
isInEdit: "isInEdit",
|
|
30
|
+
children: "children",
|
|
31
|
+
isSelected: "isSelected"
|
|
32
|
+
}, un = {
|
|
33
|
+
id: "id",
|
|
34
|
+
fromId: "fromId",
|
|
35
|
+
toId: "toId",
|
|
36
|
+
type: "type"
|
|
37
|
+
}, xs = La, Is = Ha, Et = ya, Ns = va, Ms = Ja, vo = (e) => ({ fields: { ...dn, ...e } }), To = (e) => ({ fields: { ...un, ...e } }), mn = (e) => oe(e), Dt = (e, a) => oe(ht(e, a || 1)), bo = (e, a, n, o) => n < a && e <= o;
|
|
38
|
+
function se(e) {
|
|
39
|
+
return new Date(Date.UTC(
|
|
40
|
+
e.getFullYear(),
|
|
41
|
+
e.getMonth(),
|
|
42
|
+
e.getDate(),
|
|
43
|
+
e.getHours(),
|
|
44
|
+
e.getMinutes(),
|
|
45
|
+
e.getSeconds(),
|
|
46
|
+
e.getMilliseconds()
|
|
47
|
+
));
|
|
48
|
+
}
|
|
49
|
+
const te = 4, nt = 10, Ro = (e, a, n, o) => {
|
|
50
|
+
const r = [];
|
|
51
|
+
let l = 0, s = 0;
|
|
52
|
+
const c = nt, m = Math.floor(n / 2), g = e.top < a.top, d = () => r.push({ left: s, top: l });
|
|
53
|
+
if (o === 0 || o === 3) {
|
|
54
|
+
const u = o === 3 ? "start" : "end";
|
|
55
|
+
l = e.top, s = e[u], d(), s = Math[u === "start" ? "min" : "max"](e[u], a[u]), s = u === "start" ? s - c : s + c, d(), l = a.top, d(), s = u === "start" ? a[u] - te : a[u] + te, d(), Xt(l, s, r, u !== "start");
|
|
56
|
+
} else {
|
|
57
|
+
const u = o === 2 ? "start" : "end", h = o === 2 ? "end" : "start", p = o === 2 ? e[u] - nt * 2 >= a[h] : e[u] + nt * 2 <= a[h];
|
|
58
|
+
l = e.top, s = e[u], d(), s = u === "start" ? s - c : s + c, d(), p || (l = g ? l + m : l - m, d(), s = u === "start" ? a[h] + c : a[h] - c, d()), l = a.top, d(), s = h === "start" ? a[h] - te : a[h] + te, d(), Xt(l, s, r, h !== "start");
|
|
59
|
+
}
|
|
60
|
+
return r;
|
|
61
|
+
}, Xt = (e, a, n, o) => o ? So(e, a, n) : xo(e, a, n), So = (e, a, n) => {
|
|
62
|
+
n.push({
|
|
63
|
+
top: e - te / 2,
|
|
64
|
+
left: a
|
|
65
|
+
}), n.push({
|
|
66
|
+
top: e,
|
|
67
|
+
left: a - te + 1
|
|
68
|
+
}), n.push({
|
|
69
|
+
top: e + te / 2,
|
|
70
|
+
left: a
|
|
71
|
+
}), n.push({
|
|
72
|
+
top: e,
|
|
73
|
+
left: a
|
|
74
|
+
});
|
|
75
|
+
}, xo = (e, a, n) => {
|
|
76
|
+
n.push({
|
|
77
|
+
top: e + te / 2,
|
|
78
|
+
left: a
|
|
79
|
+
}), n.push({
|
|
80
|
+
top: e,
|
|
81
|
+
left: a + te - 1
|
|
82
|
+
}), n.push({
|
|
83
|
+
top: e - te / 2,
|
|
84
|
+
left: a
|
|
85
|
+
}), n.push({
|
|
86
|
+
top: e,
|
|
87
|
+
left: a
|
|
88
|
+
});
|
|
89
|
+
}, gn = (e) => {
|
|
90
|
+
if (e.workWeekStart === void 0 || e.workWeekEnd === void 0)
|
|
91
|
+
return [];
|
|
92
|
+
const a = [];
|
|
93
|
+
let n = e.workWeekStart;
|
|
94
|
+
for (a.push(n); e.workWeekEnd !== n; )
|
|
95
|
+
n > 6 ? n -= 7 : n++, a.push(n);
|
|
96
|
+
return a;
|
|
97
|
+
}, Io = (e, a) => {
|
|
98
|
+
const n = e.getDay();
|
|
99
|
+
return a.indexOf(n) > -1;
|
|
100
|
+
}, hn = (e, { step: a, timezone: n }) => {
|
|
101
|
+
const o = [], r = S.fromLocalDate(e.start, n), l = S.fromLocalDate(e.end, n);
|
|
102
|
+
let s = r.clone();
|
|
103
|
+
for (; s.getTime() < l.getTime(); ) {
|
|
104
|
+
const c = s.clone(), m = c.clone().addTime(a), g = new Date(c.getTime()), u = {
|
|
105
|
+
end: new Date(m.getTime()),
|
|
106
|
+
start: g,
|
|
107
|
+
zonedStart: c,
|
|
108
|
+
zonedEnd: m
|
|
109
|
+
};
|
|
110
|
+
o.push(u), s = s.addTime(a);
|
|
111
|
+
}
|
|
112
|
+
return o;
|
|
113
|
+
}, No = (e, { timezone: a }, n) => {
|
|
114
|
+
const o = [], r = S.fromLocalDate(e.start, a), l = S.fromLocalDate(e.end, a);
|
|
115
|
+
for (let s = r.clone(), c = 0; s.getTime() < l.getTime(); c++) {
|
|
116
|
+
const m = s.clone(), g = Dt(at(oe(m), n.firstDay()), cn), d = S.fromUTCDate(se(g), a), u = d.getTime() > l.getTime() ? l.clone() : d;
|
|
117
|
+
s = u.clone();
|
|
118
|
+
const h = new Date(m.getTime()), C = {
|
|
119
|
+
end: new Date(u.getTime()),
|
|
120
|
+
start: h,
|
|
121
|
+
zonedStart: m,
|
|
122
|
+
zonedEnd: u
|
|
123
|
+
};
|
|
124
|
+
o.push(C);
|
|
125
|
+
}
|
|
126
|
+
return o;
|
|
127
|
+
}, Mo = (e, { timezone: a }) => {
|
|
128
|
+
const n = [], o = S.fromLocalDate(e.start, a), r = S.fromLocalDate(e.end, a);
|
|
129
|
+
for (let l = o.clone(), s = 0; l.getTime() < r.getTime(); s++) {
|
|
130
|
+
const c = l.clone(), m = S.fromLocalDate(Qt(new Date(c.getTime()), 1), a);
|
|
131
|
+
l = m.clone();
|
|
132
|
+
const g = new Date(c.getTime()), u = {
|
|
133
|
+
end: new Date(m.getTime()),
|
|
134
|
+
start: g,
|
|
135
|
+
zonedStart: c,
|
|
136
|
+
zonedEnd: m
|
|
137
|
+
};
|
|
138
|
+
n.push(u);
|
|
139
|
+
}
|
|
140
|
+
return n;
|
|
141
|
+
}, Fo = (e, { timezone: a }) => {
|
|
142
|
+
const n = [], o = S.fromLocalDate(e.start, a), r = S.fromLocalDate(e.end, a);
|
|
143
|
+
for (let l = o.clone(), s = 0; l.getTime() < r.getTime(); s++) {
|
|
144
|
+
const c = l.clone(), m = S.fromLocalDate(Qt(new Date(c.getTime()), 12), a);
|
|
145
|
+
l = m.clone();
|
|
146
|
+
const g = new Date(c.getTime()), u = {
|
|
147
|
+
end: new Date(m.getTime()),
|
|
148
|
+
start: g,
|
|
149
|
+
zonedStart: c,
|
|
150
|
+
zonedEnd: m
|
|
151
|
+
};
|
|
152
|
+
n.push(u);
|
|
153
|
+
}
|
|
154
|
+
return n;
|
|
155
|
+
}, Lo = (e, a, n) => {
|
|
156
|
+
const o = n.parseDate(a.workDayStart).getHours(), r = n.parseDate(a.workDayEnd).getHours();
|
|
157
|
+
return hn(e, { step: Sa * a.slotDuration, timezone: a.timezone }).map((s) => {
|
|
158
|
+
const c = s.zonedStart.getHours();
|
|
159
|
+
return {
|
|
160
|
+
range: s,
|
|
161
|
+
isWork: c >= o && c < r,
|
|
162
|
+
span: 1,
|
|
163
|
+
text: n.formatDate(s.zonedStart, Co),
|
|
164
|
+
type: "time"
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
}, fn = (e, a, n) => hn(e, { step: Oe, timezone: a.timezone }).map((r) => ({
|
|
168
|
+
range: r,
|
|
169
|
+
isWork: Io(r.start, a.workDays),
|
|
170
|
+
span: 1,
|
|
171
|
+
text: n.formatDate(r.zonedStart, ot),
|
|
172
|
+
type: "day"
|
|
173
|
+
})), pn = (e, a, n) => No(e, { timezone: a.timezone }, n).map((r) => {
|
|
174
|
+
const l = Math.round((r.zonedEnd.getTime() - r.zonedStart.getTime()) / Oe);
|
|
175
|
+
return {
|
|
176
|
+
range: r,
|
|
177
|
+
isWork: !1,
|
|
178
|
+
span: l,
|
|
179
|
+
text: `${n.formatDate(r.zonedStart, ot)} - ${n.formatDate(r.zonedEnd, ot)}`,
|
|
180
|
+
type: "week"
|
|
181
|
+
};
|
|
182
|
+
}), Cn = (e, a, n) => Mo(e, { timezone: a.timezone }).map((r) => {
|
|
183
|
+
const l = Math.round((r.zonedEnd.getTime() - r.zonedStart.getTime()) / Oe);
|
|
184
|
+
return {
|
|
185
|
+
range: r,
|
|
186
|
+
isWork: !1,
|
|
187
|
+
span: l,
|
|
188
|
+
text: n.formatDate(r.zonedStart, ko),
|
|
189
|
+
type: "month"
|
|
190
|
+
};
|
|
191
|
+
}), Ho = (e, a, n) => Fo(e, { timezone: a.timezone }).map((r) => {
|
|
192
|
+
const l = Math.round((r.zonedEnd.getTime() - r.zonedStart.getTime()) / Oe);
|
|
193
|
+
return {
|
|
194
|
+
range: r,
|
|
195
|
+
isWork: !1,
|
|
196
|
+
span: l,
|
|
197
|
+
text: n.formatDate(r.zonedStart, Eo),
|
|
198
|
+
type: "year"
|
|
199
|
+
};
|
|
200
|
+
}), Ao = (e, a, n) => {
|
|
201
|
+
const o = n;
|
|
202
|
+
return /* @__PURE__ */ t.createElement("table", { className: "k-table k-table-md", ref: a, "aria-hidden": !0 }, /* @__PURE__ */ t.createElement("tbody", { className: "k-table-tbody" }, e.map((r, l) => /* @__PURE__ */ t.createElement("tr", { className: "k-table-row", key: l }, r.map((s, c) => /* @__PURE__ */ t.createElement(
|
|
203
|
+
"td",
|
|
204
|
+
{
|
|
205
|
+
key: s.range.start.getTime(),
|
|
206
|
+
colSpan: s.span,
|
|
207
|
+
className: ce(
|
|
208
|
+
"k-table-th",
|
|
209
|
+
{
|
|
210
|
+
"k-header": !0,
|
|
211
|
+
"k-nonwork-hour": !s.isWork
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
},
|
|
215
|
+
o ? /* @__PURE__ */ t.createElement(
|
|
216
|
+
o,
|
|
217
|
+
{
|
|
218
|
+
rowIndex: l,
|
|
219
|
+
index: c,
|
|
220
|
+
range: s.range,
|
|
221
|
+
text: s.text,
|
|
222
|
+
isWork: s.isWork,
|
|
223
|
+
type: s.type
|
|
224
|
+
}
|
|
225
|
+
) : s.text
|
|
226
|
+
))))));
|
|
227
|
+
}, Vo = (e, a) => {
|
|
228
|
+
const n = e[e.length - 1];
|
|
229
|
+
return /* @__PURE__ */ t.createElement("table", { className: "k-table k-table-md k-gantt-columns", ref: a, "aria-hidden": !0 }, /* @__PURE__ */ t.createElement("tbody", { className: "k-table-tbody" }, /* @__PURE__ */ t.createElement("tr", { className: "k-table-row" }, n.map((o) => /* @__PURE__ */ t.createElement(
|
|
230
|
+
"td",
|
|
231
|
+
{
|
|
232
|
+
key: o.range.start.getTime(),
|
|
233
|
+
colSpan: o.span,
|
|
234
|
+
className: ce(
|
|
235
|
+
"k-table-td",
|
|
236
|
+
{
|
|
237
|
+
"k-nonwork-hour": !o.isWork
|
|
238
|
+
}
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
)))));
|
|
242
|
+
}, zo = (e, a) => {
|
|
243
|
+
const n = e[e.length - 1];
|
|
244
|
+
let o = 0, r = 0;
|
|
245
|
+
return n.forEach((l) => {
|
|
246
|
+
const s = l.span;
|
|
247
|
+
r += s, s > o && (o = s);
|
|
248
|
+
}), Math.round(r * a / o);
|
|
249
|
+
}, st = (e, a) => !!D(a)(e), kn = (e, a) => !!D(a)(e), Go = (e, a) => (n) => st(n, e) && kn(n, a) ? [...D(a)(n)] : [], wt = t.createContext([]), Wo = () => t.useContext(wt);
|
|
250
|
+
wt.displayName = "KendoReactGanttTaskDataContext";
|
|
251
|
+
const yt = t.createContext([]), Oo = () => t.useContext(yt);
|
|
252
|
+
yt.displayName = "KendoReactGanttDependencyDataContext";
|
|
253
|
+
const vt = t.createContext(dn), Tt = () => t.useContext(vt);
|
|
254
|
+
vt.displayName = "KendoReactGanttTaskModelFieldsContext";
|
|
255
|
+
const bt = t.createContext(un), En = () => t.useContext(bt);
|
|
256
|
+
bt.displayName = "KendoReactGanttDependencyModelFieldsContext";
|
|
257
|
+
const Rt = t.createContext({}), Ne = () => t.useContext(Rt);
|
|
258
|
+
Rt.displayName = "KendoReactGanttPropsContext";
|
|
259
|
+
const St = t.createContext({
|
|
260
|
+
start: /* @__PURE__ */ new Date(),
|
|
261
|
+
end: /* @__PURE__ */ new Date(),
|
|
262
|
+
zonedStart: S.fromLocalDate(/* @__PURE__ */ new Date()),
|
|
263
|
+
zonedEnd: S.fromLocalDate(/* @__PURE__ */ new Date())
|
|
264
|
+
}), Me = () => t.useContext(St);
|
|
265
|
+
St.displayName = "KendoReactGanttDateRangeContext";
|
|
266
|
+
const xt = t.createContext([]), Po = () => t.useContext(xt);
|
|
267
|
+
xt.displayName = "KendoReactGanttViewsContext";
|
|
268
|
+
const It = t.createContext(["week", F]), Dn = () => t.useContext(It);
|
|
269
|
+
It.displayName = "KendoReactGanttActiveViewContext";
|
|
270
|
+
const Nt = t.createContext(0), wn = () => t.useContext(Nt);
|
|
271
|
+
Nt.displayName = "KendoReactGanttRowHeightContext";
|
|
272
|
+
const Mt = t.createContext(0), _o = () => t.useContext(Mt);
|
|
273
|
+
Mt.displayName = "KendoReactGanttToolbarHeightContext";
|
|
274
|
+
const Ft = t.createContext({
|
|
275
|
+
onDataStateChange: F,
|
|
276
|
+
onSortChange: F,
|
|
277
|
+
onFilterChange: F,
|
|
278
|
+
onColumnMenuFilterChange: F,
|
|
279
|
+
onExpandChange: F,
|
|
280
|
+
onRowClick: F,
|
|
281
|
+
onRowDoubleClick: F,
|
|
282
|
+
onRowContextMenu: F,
|
|
283
|
+
onColumnResize: F,
|
|
284
|
+
onColumnReorder: F,
|
|
285
|
+
onDependencyCreate: F,
|
|
286
|
+
onKeyDown: F,
|
|
287
|
+
onSelectionChange: F,
|
|
288
|
+
onHeaderSelectionChange: F
|
|
289
|
+
}), Ko = () => t.useContext(Ft);
|
|
290
|
+
Ft.displayName = "KendoReactGanttEventsContext";
|
|
291
|
+
const Lt = t.createContext({
|
|
292
|
+
onTaskClick: F,
|
|
293
|
+
onTaskDoubleClick: F,
|
|
294
|
+
onTaskContextMenu: F
|
|
295
|
+
}), Bo = () => t.useContext(Lt);
|
|
296
|
+
Lt.displayName = "KendoReactGanttTaskEventsContext";
|
|
297
|
+
const yn = ({
|
|
298
|
+
children: e,
|
|
299
|
+
taskData: a,
|
|
300
|
+
dependencyData: n,
|
|
301
|
+
taskModelFields: o,
|
|
302
|
+
dependencyModelFields: r,
|
|
303
|
+
props: l,
|
|
304
|
+
dateRange: s,
|
|
305
|
+
views: c,
|
|
306
|
+
activeView: m,
|
|
307
|
+
rowHeight: g,
|
|
308
|
+
toolbarHeight: d,
|
|
309
|
+
events: u,
|
|
310
|
+
taskEvents: h
|
|
311
|
+
}) => /* @__PURE__ */ t.createElement(Rt.Provider, { value: l }, /* @__PURE__ */ t.createElement(wt.Provider, { value: a }, /* @__PURE__ */ t.createElement(yt.Provider, { value: n }, /* @__PURE__ */ t.createElement(vt.Provider, { value: o }, /* @__PURE__ */ t.createElement(bt.Provider, { value: r }, /* @__PURE__ */ t.createElement(St.Provider, { value: s }, /* @__PURE__ */ t.createElement(xt.Provider, { value: c }, /* @__PURE__ */ t.createElement(It.Provider, { value: m }, /* @__PURE__ */ t.createElement(Nt.Provider, { value: g }, /* @__PURE__ */ t.createElement(Mt.Provider, { value: d }, /* @__PURE__ */ t.createElement(Ft.Provider, { value: u }, /* @__PURE__ */ t.createElement(Lt.Provider, { value: h }, e))))))))))));
|
|
312
|
+
yn.displayName = "KendoReactGanttContext";
|
|
313
|
+
const Ht = t.createContext([{ current: {} }, F]), vn = () => t.useContext(Ht);
|
|
314
|
+
Ht.displayName = "KendoReactGanttViewContext";
|
|
315
|
+
const At = t.createContext(0), $o = () => t.useContext(At);
|
|
316
|
+
At.displayName = "KendoReactGanttViewTimelineWidthContext";
|
|
317
|
+
const Vt = t.createContext({
|
|
318
|
+
onDependencyHandlePress: F,
|
|
319
|
+
onDependencyHandleDrag: F,
|
|
320
|
+
onDependencyHandleRelease: F,
|
|
321
|
+
isEnabled: !1,
|
|
322
|
+
draggedId: null
|
|
323
|
+
}), Uo = () => t.useContext(Vt);
|
|
324
|
+
Vt.displayName = "KendoReactGanttViewDependencyDragContext";
|
|
325
|
+
const Tn = ({
|
|
326
|
+
children: e,
|
|
327
|
+
tasksStore: a,
|
|
328
|
+
timelineWidth: n,
|
|
329
|
+
dependencyDrag: o
|
|
330
|
+
}) => /* @__PURE__ */ t.createElement(Ht.Provider, { value: a }, /* @__PURE__ */ t.createElement(At.Provider, { value: n }, /* @__PURE__ */ t.createElement(Vt.Provider, { value: o }, e)));
|
|
331
|
+
Tn.displayName = "KendoReactGanttViewContext";
|
|
332
|
+
var rt = /* @__PURE__ */ ((e) => (e[e.add = 0] = "add", e[e.remove = 1] = "remove", e))(rt || {});
|
|
333
|
+
const Yo = () => {
|
|
334
|
+
const e = t.useRef({}), a = t.useCallback(
|
|
335
|
+
(n) => {
|
|
336
|
+
switch (n.type) {
|
|
337
|
+
case 0:
|
|
338
|
+
e.current[n.id] = n.itemRef;
|
|
339
|
+
break;
|
|
340
|
+
case 1:
|
|
341
|
+
delete e.current[n.id];
|
|
342
|
+
break;
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
[]
|
|
346
|
+
);
|
|
347
|
+
return [e, a];
|
|
348
|
+
}, qo = (e, a, n, o) => {
|
|
349
|
+
const r = t.useRef(null), [, l] = vn();
|
|
350
|
+
t.useImperativeHandle(r, () => ({ element: o.current, dataItem: e })), t.useImperativeHandle(n, () => r.current), t.useLayoutEffect(
|
|
351
|
+
() => {
|
|
352
|
+
const s = r.current;
|
|
353
|
+
if (s)
|
|
354
|
+
return l({
|
|
355
|
+
type: rt.add,
|
|
356
|
+
itemRef: s,
|
|
357
|
+
id: a
|
|
358
|
+
}), () => {
|
|
359
|
+
l({
|
|
360
|
+
type: rt.remove,
|
|
361
|
+
itemRef: s,
|
|
362
|
+
id: a
|
|
363
|
+
});
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
);
|
|
367
|
+
}, bn = t.forwardRef((e, a) => {
|
|
368
|
+
const n = Me(), o = Tt(), r = $o(), l = Uo(), s = Bo(), c = t.useRef(null), m = t.useRef(null);
|
|
369
|
+
qo(e.dataItem, D(o.id)(e.dataItem), a, c);
|
|
370
|
+
const g = t.useRef(null), d = D(o.id)(e.dataItem), u = D(o.start)(e.dataItem), h = D(o.end)(e.dataItem), p = D(o.title)(e.dataItem), C = D(o.percentComplete)(e.dataItem), f = D(o.children)(e.dataItem), v = D(o.isSelected)(e.dataItem), L = u && u.getTime(), V = h && h.getTime(), M = f && f.length, x = !M && L === V, z = L && V && bo(n.start, n.end, u, h), [J, R] = t.useState(!1), X = t.useRef(null), A = t.useRef(null);
|
|
371
|
+
Kt(X, {
|
|
372
|
+
onPress: l.onDependencyHandlePress,
|
|
373
|
+
onDrag: l.onDependencyHandleDrag,
|
|
374
|
+
onRelease: l.onDependencyHandleRelease
|
|
375
|
+
}), Kt(A, {
|
|
376
|
+
onPress: l.onDependencyHandlePress,
|
|
377
|
+
onDrag: l.onDependencyHandleDrag,
|
|
378
|
+
onRelease: l.onDependencyHandleRelease
|
|
379
|
+
});
|
|
380
|
+
const j = t.useCallback(
|
|
381
|
+
(w) => {
|
|
382
|
+
s.onTaskClick && s.onTaskClick({
|
|
383
|
+
dataItem: e.dataItem,
|
|
384
|
+
level: e.level,
|
|
385
|
+
nativeEvent: w && w.nativeEvent,
|
|
386
|
+
syntheticEvent: w,
|
|
387
|
+
target: null
|
|
388
|
+
});
|
|
389
|
+
},
|
|
390
|
+
[e.dataItem, e.level]
|
|
391
|
+
), G = t.useCallback(
|
|
392
|
+
(w) => {
|
|
393
|
+
s.onTaskDoubleClick && s.onTaskDoubleClick({
|
|
394
|
+
dataItem: e.dataItem,
|
|
395
|
+
level: e.level,
|
|
396
|
+
nativeEvent: w && w.nativeEvent,
|
|
397
|
+
syntheticEvent: w,
|
|
398
|
+
target: null
|
|
399
|
+
});
|
|
400
|
+
},
|
|
401
|
+
[e.dataItem, e.level]
|
|
402
|
+
), B = t.useCallback(
|
|
403
|
+
(w) => {
|
|
404
|
+
s.onTaskContextMenu && s.onTaskContextMenu({
|
|
405
|
+
dataItem: e.dataItem,
|
|
406
|
+
level: e.level,
|
|
407
|
+
nativeEvent: w && w.nativeEvent,
|
|
408
|
+
syntheticEvent: w,
|
|
409
|
+
target: null
|
|
410
|
+
});
|
|
411
|
+
},
|
|
412
|
+
[e.dataItem, e.level]
|
|
413
|
+
), E = t.useCallback(
|
|
414
|
+
(w) => {
|
|
415
|
+
s.onTaskRemoveClick && s.onTaskRemoveClick({
|
|
416
|
+
dataItem: e.dataItem,
|
|
417
|
+
level: e.level,
|
|
418
|
+
nativeEvent: w && w.nativeEvent,
|
|
419
|
+
syntheticEvent: w,
|
|
420
|
+
target: null
|
|
421
|
+
});
|
|
422
|
+
},
|
|
423
|
+
[e.dataItem, e.level]
|
|
424
|
+
), H = t.useCallback(
|
|
425
|
+
() => {
|
|
426
|
+
const w = n.start, Z = n.end, T = g.current, N = c.current, K = m.current;
|
|
427
|
+
if (!z || T === null || N === null)
|
|
428
|
+
return;
|
|
429
|
+
const Y = T.clientWidth / (Z.getTime() - w.getTime()), W = (u.getTime() - w.getTime()) * Y, O = (h.getTime() - u.getTime()) * Y, ge = (T.offsetHeight - N.offsetHeight) / 2;
|
|
430
|
+
N.style.left = `${Math.round(x ? W - Do : W)}px`, N.style.top = `${Math.round(ge)}px`, x || (N.style.width = `${Math.round(O)}px`, K !== null && (K.style.width = `${Math.round(O * (C || 0))}px`)), R(!0);
|
|
431
|
+
},
|
|
432
|
+
[n.start.getTime(), n.end.getTime(), L, V, z, C, r]
|
|
433
|
+
);
|
|
434
|
+
t.useEffect(H, [H]);
|
|
435
|
+
const Q = {
|
|
436
|
+
visibility: J ? void 0 : "hidden",
|
|
437
|
+
display: z ? void 0 : "none"
|
|
438
|
+
}, _ = {
|
|
439
|
+
userSelect: "none",
|
|
440
|
+
display: l.draggedId === String(d) ? "block" : void 0
|
|
441
|
+
};
|
|
442
|
+
return /* @__PURE__ */ t.createElement("td", { ref: g, key: d, role: "presentation" }, x ? /* @__PURE__ */ t.createElement(
|
|
443
|
+
"div",
|
|
444
|
+
{
|
|
445
|
+
"aria-hidden": !0,
|
|
446
|
+
className: ce({
|
|
447
|
+
"k-task": !0,
|
|
448
|
+
"k-task-milestone": !0,
|
|
449
|
+
"k-selected": v && !Array.isArray(v)
|
|
450
|
+
}),
|
|
451
|
+
style: Q,
|
|
452
|
+
ref: c,
|
|
453
|
+
[We]: d,
|
|
454
|
+
onClick: j,
|
|
455
|
+
onDoubleClick: G,
|
|
456
|
+
onContextMenu: B
|
|
457
|
+
},
|
|
458
|
+
/* @__PURE__ */ t.createElement("div", { className: "k-task-milestone-content" }),
|
|
459
|
+
l.isEnabled && /* @__PURE__ */ t.createElement(
|
|
460
|
+
"div",
|
|
461
|
+
{
|
|
462
|
+
className: "k-task-dot k-task-start",
|
|
463
|
+
ref: X,
|
|
464
|
+
style: _,
|
|
465
|
+
...Yt
|
|
466
|
+
}
|
|
467
|
+
),
|
|
468
|
+
l.isEnabled && /* @__PURE__ */ t.createElement(
|
|
469
|
+
"div",
|
|
470
|
+
{
|
|
471
|
+
className: "k-task-dot k-task-end",
|
|
472
|
+
ref: A,
|
|
473
|
+
style: _,
|
|
474
|
+
...qt
|
|
475
|
+
}
|
|
476
|
+
)
|
|
477
|
+
) : /* @__PURE__ */ t.createElement(
|
|
478
|
+
"div",
|
|
479
|
+
{
|
|
480
|
+
"aria-hidden": !0,
|
|
481
|
+
className: ce({
|
|
482
|
+
"k-task": !0,
|
|
483
|
+
"k-task-summary": M,
|
|
484
|
+
"k-task-single": !M,
|
|
485
|
+
"k-selected": v && !Array.isArray(v)
|
|
486
|
+
}),
|
|
487
|
+
ref: c,
|
|
488
|
+
style: Q,
|
|
489
|
+
[We]: d,
|
|
490
|
+
onClick: j,
|
|
491
|
+
onDoubleClick: G,
|
|
492
|
+
onContextMenu: B
|
|
493
|
+
},
|
|
494
|
+
M ? /* @__PURE__ */ t.createElement("div", { className: "k-task-summary-progress", ref: m }, /* @__PURE__ */ t.createElement("div", { className: "k-task-summary-complete" })) : /* @__PURE__ */ t.createElement("div", { className: "k-task-complete", ref: m }),
|
|
495
|
+
!M && /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", { className: "k-task-content" }, p), s.onTaskRemoveClick ? /* @__PURE__ */ t.createElement("span", { className: "k-task-actions" }, /* @__PURE__ */ t.createElement("span", { onClick: E, className: "k-link k-task-delete", "aria-label": "Delete" }, /* @__PURE__ */ t.createElement(mt, { name: "x", icon: oo }))) : null),
|
|
496
|
+
l.isEnabled && /* @__PURE__ */ t.createElement(
|
|
497
|
+
"div",
|
|
498
|
+
{
|
|
499
|
+
className: "k-task-dot k-task-start",
|
|
500
|
+
ref: X,
|
|
501
|
+
style: _,
|
|
502
|
+
...Yt
|
|
503
|
+
}
|
|
504
|
+
),
|
|
505
|
+
l.isEnabled && /* @__PURE__ */ t.createElement(
|
|
506
|
+
"div",
|
|
507
|
+
{
|
|
508
|
+
className: "k-task-dot k-task-end",
|
|
509
|
+
ref: A,
|
|
510
|
+
style: _,
|
|
511
|
+
...qt
|
|
512
|
+
}
|
|
513
|
+
)
|
|
514
|
+
));
|
|
515
|
+
});
|
|
516
|
+
bn.displayName = "KendoReactGanttTask";
|
|
517
|
+
const Rn = (e) => {
|
|
518
|
+
const { dependency: a } = e, [n] = vn(), o = t.useRef(null), r = En(), l = wn(), [s, c] = t.useState(!1), m = () => {
|
|
519
|
+
if (o.current === null || n.current === null) {
|
|
520
|
+
c(!1);
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
const g = n.current[D(r.fromId)(a)], d = n.current[D(r.toId)(a)];
|
|
524
|
+
if (!g || !d) {
|
|
525
|
+
c(!1);
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
const u = g.element, h = d.element;
|
|
529
|
+
if (!u || !h) {
|
|
530
|
+
c(!1);
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
if (s === !1) {
|
|
534
|
+
c(!0);
|
|
535
|
+
return;
|
|
536
|
+
}
|
|
537
|
+
const p = {
|
|
538
|
+
top: u.offsetTop + u.offsetHeight / 2,
|
|
539
|
+
start: u.offsetLeft,
|
|
540
|
+
end: u.offsetLeft + u.offsetWidth
|
|
541
|
+
}, C = {
|
|
542
|
+
top: h.offsetTop + h.offsetHeight / 2,
|
|
543
|
+
start: h.offsetLeft,
|
|
544
|
+
end: h.offsetLeft + h.offsetWidth
|
|
545
|
+
}, f = D(r.type)(a), v = Ro(p, C, l, f);
|
|
546
|
+
v && v.length && o.current.setAttribute("points", v.map((L) => `${L.left},${L.top}`).join(" "));
|
|
547
|
+
};
|
|
548
|
+
return t.useEffect(m), /* @__PURE__ */ t.createElement(
|
|
549
|
+
"polyline",
|
|
550
|
+
{
|
|
551
|
+
ref: o,
|
|
552
|
+
style: {
|
|
553
|
+
display: s ? void 0 : "none"
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
);
|
|
557
|
+
};
|
|
558
|
+
Rn.displayName = "KendoReactGanttDependency";
|
|
559
|
+
class zt extends t.Component {
|
|
560
|
+
constructor(a) {
|
|
561
|
+
super(a), this.state = {
|
|
562
|
+
activeId: void 0,
|
|
563
|
+
level: 0
|
|
564
|
+
}, this.tableElement = null, this.tbodyElement = null, this.wrapperScrollLeft = 0, this.wrapperScrollTop = 0, this.updateOnScroll = !1, this.tbodyOffsetTop = 0, this.prevData = [], this.flattedData = [], this.element = null, this._treeListId = Jt(), this.contextStateRef = { current: void 0 }, this.navigationStateRef = { current: void 0 }, this.scrollIntoView = (n) => {
|
|
565
|
+
if (!this.element)
|
|
566
|
+
return;
|
|
567
|
+
const { rowIndex: o = 0 } = n, { rowHeight: r = 0 } = this.props;
|
|
568
|
+
this.element.scroll(0, (o - 1) * r);
|
|
569
|
+
}, this.getColumns = (n) => {
|
|
570
|
+
const o = n.filter((l) => l.declarationIndex >= 0 && l.parentIndex === -1), r = (l) => (l.sort((s, c) => s.declarationIndex - c.declarationIndex), l.map((s) => {
|
|
571
|
+
const {
|
|
572
|
+
declarationIndex: c,
|
|
573
|
+
parentIndex: m,
|
|
574
|
+
depth: g,
|
|
575
|
+
colSpan: d,
|
|
576
|
+
rowSpan: u,
|
|
577
|
+
index: h,
|
|
578
|
+
kFirst: p,
|
|
579
|
+
groupable: C,
|
|
580
|
+
children: f,
|
|
581
|
+
...v
|
|
582
|
+
} = s;
|
|
583
|
+
return f.length ? {
|
|
584
|
+
children: r(f),
|
|
585
|
+
...v
|
|
586
|
+
} : v;
|
|
587
|
+
}));
|
|
588
|
+
return r(o);
|
|
589
|
+
}, this.onKeyDown = (n) => {
|
|
590
|
+
if (De.onKeyDown(n, {
|
|
591
|
+
contextStateRef: this.contextStateRef,
|
|
592
|
+
navigationStateRef: this.navigationStateRef
|
|
593
|
+
}), this.props.onKeyDown) {
|
|
594
|
+
const { mode: o, cell: r } = Bt(this.props.selectable), l = {
|
|
595
|
+
dataItems: this.getLeafDataItems(),
|
|
596
|
+
mode: o,
|
|
597
|
+
cell: r,
|
|
598
|
+
componentId: this._treeListId,
|
|
599
|
+
selectedField: this.props.selectedField,
|
|
600
|
+
...this.getEventArguments(n)
|
|
601
|
+
};
|
|
602
|
+
this.props.onKeyDown.call(void 0, l);
|
|
603
|
+
}
|
|
604
|
+
}, this.onFocus = (n) => {
|
|
605
|
+
De.onFocus(n, {
|
|
606
|
+
contextStateRef: this.contextStateRef
|
|
607
|
+
});
|
|
608
|
+
}, this.onRowDrag = (n) => {
|
|
609
|
+
if (this.props.onRowDrag) {
|
|
610
|
+
const o = {
|
|
611
|
+
...n,
|
|
612
|
+
target: this
|
|
613
|
+
};
|
|
614
|
+
this.props.onRowDrag.call(void 0, o);
|
|
615
|
+
}
|
|
616
|
+
}, this.onRowDrop = (n) => {
|
|
617
|
+
if (this.props.onRowDrop) {
|
|
618
|
+
const o = {
|
|
619
|
+
...n,
|
|
620
|
+
target: this
|
|
621
|
+
};
|
|
622
|
+
this.props.onRowDrop.call(void 0, o);
|
|
623
|
+
}
|
|
624
|
+
}, this.onColumnReorder = (n, o, r) => {
|
|
625
|
+
const { extendedColumns: l } = this.props, s = l[n].depth, c = (d) => {
|
|
626
|
+
do
|
|
627
|
+
d++;
|
|
628
|
+
while (d < l.length && l[d].depth > s);
|
|
629
|
+
return d;
|
|
630
|
+
}, m = [...l], g = m.splice(n, c(n) - n);
|
|
631
|
+
if (m.splice(n < o ? c(o - g.length) : o, 0, ...g), m.filter((d) => d.declarationIndex >= 0).forEach((d, u) => d.orderIndex = u), this.props.onColumnReorder) {
|
|
632
|
+
const d = {
|
|
633
|
+
target: this,
|
|
634
|
+
columns: this.getColumns(m),
|
|
635
|
+
nativeEvent: r
|
|
636
|
+
};
|
|
637
|
+
this.props.onColumnReorder.call(void 0, d);
|
|
638
|
+
}
|
|
639
|
+
}, this.onColumnResize = (n, o, r, l, s) => {
|
|
640
|
+
if (this.props.onColumnResize) {
|
|
641
|
+
const c = this.props.extendedColumns.filter((g) => g.children.length === 0).reduce((g, d) => g += parseFloat(String(d.width)), 0);
|
|
642
|
+
this.tableElement && (this.tableElement.style.width = c + "px");
|
|
643
|
+
const m = {
|
|
644
|
+
columns: this.getColumns(this.props.extendedColumns),
|
|
645
|
+
totalWidth: c,
|
|
646
|
+
index: n,
|
|
647
|
+
nativeEvent: l,
|
|
648
|
+
newWidth: o,
|
|
649
|
+
oldWidth: r,
|
|
650
|
+
end: s,
|
|
651
|
+
target: this
|
|
652
|
+
};
|
|
653
|
+
this.props.onColumnResize.call(void 0, m);
|
|
654
|
+
}
|
|
655
|
+
}, this.onScroll = (n) => {
|
|
656
|
+
const o = n.currentTarget.scrollLeft, r = n.currentTarget.scrollTop, { columnVirtualization: l, scrollable: s, rowHeight: c = 0 } = this.props, m = c, g = 0;
|
|
657
|
+
let d = !1;
|
|
658
|
+
l && Math.abs(this.wrapperScrollLeft - o) > g && (this.wrapperScrollLeft = o, d = !0), s === "virtual" && Math.abs(this.wrapperScrollTop - r) > m && (this.wrapperScrollTop = r, d = !0), d && (this.updateOnScroll = !0, this.forceUpdate());
|
|
659
|
+
}, this.calculateSizes = (n) => {
|
|
660
|
+
if (!n || this.props.scrollable === "none")
|
|
661
|
+
return;
|
|
662
|
+
const o = Array.from(n.childNodes), r = o.find((c) => c.nodeName === "TABLE"), l = this.props.toolbar && o.find((c) => c.nodeType === 1 && c.classList.contains("k-grid-toolbar"));
|
|
663
|
+
let s = 0;
|
|
664
|
+
if (l) {
|
|
665
|
+
const c = l.style.boxSizing;
|
|
666
|
+
l.style.boxSizing = "border-box", s = parseFloat(String(window.getComputedStyle(l).height)) || l.offsetHeight, l.style.boxSizing = c, l.getAttribute("style") || l.removeAttribute("style");
|
|
667
|
+
}
|
|
668
|
+
this.tbodyOffsetTop = r.tBodies[0].offsetTop, Qa(r, s);
|
|
669
|
+
}, this.onItemChange = (n) => {
|
|
670
|
+
if (n.field === this.props.expandField) {
|
|
671
|
+
const o = this.props.onExpandChange;
|
|
672
|
+
if (o) {
|
|
673
|
+
const r = {
|
|
674
|
+
...this.getEventArguments(n.syntheticEvent),
|
|
675
|
+
dataItem: n.dataItem,
|
|
676
|
+
level: n.level,
|
|
677
|
+
value: n.value
|
|
678
|
+
};
|
|
679
|
+
o.call(void 0, r);
|
|
680
|
+
}
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
if (this.props.onItemChange) {
|
|
684
|
+
const o = {
|
|
685
|
+
...this.getEventArguments(n.syntheticEvent),
|
|
686
|
+
dataItem: n.dataItem,
|
|
687
|
+
level: n.level,
|
|
688
|
+
field: n.field,
|
|
689
|
+
value: n.value
|
|
690
|
+
};
|
|
691
|
+
this.props.onItemChange.call(void 0, o);
|
|
692
|
+
}
|
|
693
|
+
}, this.onHeaderSelectionChange = (n) => {
|
|
694
|
+
if (this.props.onHeaderSelectionChange) {
|
|
695
|
+
const o = {
|
|
696
|
+
field: n.field,
|
|
697
|
+
nativeEvent: n.syntheticEvent && n.syntheticEvent.nativeEvent,
|
|
698
|
+
syntheticEvent: n.syntheticEvent,
|
|
699
|
+
target: this,
|
|
700
|
+
dataItems: this.getLeafDataItems()
|
|
701
|
+
};
|
|
702
|
+
this.props.onHeaderSelectionChange.call(void 0, o);
|
|
703
|
+
}
|
|
704
|
+
}, this.selectionRelease = (n) => {
|
|
705
|
+
if (this.props.onSelectionChange) {
|
|
706
|
+
const o = {
|
|
707
|
+
syntheticEvent: void 0,
|
|
708
|
+
target: this,
|
|
709
|
+
selectedField: this.props.selectedField || "",
|
|
710
|
+
componentId: this._treeListId,
|
|
711
|
+
dataItems: this.getLeafDataItems(),
|
|
712
|
+
dataItem: null,
|
|
713
|
+
level: [],
|
|
714
|
+
...n
|
|
715
|
+
};
|
|
716
|
+
this.props.onSelectionChange.call(void 0, o);
|
|
717
|
+
}
|
|
718
|
+
}, this.onSortChange = (n, o, r) => {
|
|
719
|
+
this.onDataStateChange(this.props.onSortChange, { sort: o, field: r }, n);
|
|
720
|
+
}, this.onFilterChange = (n) => {
|
|
721
|
+
const { filter: o, field: r } = n;
|
|
722
|
+
this.onDataStateChange(this.props.onFilterChange, { filter: o, field: r }, n.syntheticEvent);
|
|
723
|
+
}, this.onColumnMenuFilterChange = (n, o, r) => {
|
|
724
|
+
if (!r)
|
|
725
|
+
return;
|
|
726
|
+
const { onColumnMenuFilterChange: l } = this.props;
|
|
727
|
+
if (!l)
|
|
728
|
+
return;
|
|
729
|
+
const s = {
|
|
730
|
+
syntheticEvent: n,
|
|
731
|
+
filter: o,
|
|
732
|
+
field: r,
|
|
733
|
+
target: this,
|
|
734
|
+
nativeEvent: n.nativeEvent
|
|
735
|
+
};
|
|
736
|
+
l.call(void 0, s);
|
|
737
|
+
}, this.onExpandChange = (n, o, r) => {
|
|
738
|
+
const { expandField: l, onExpandChange: s } = this.props;
|
|
739
|
+
if (l && s) {
|
|
740
|
+
const c = {
|
|
741
|
+
...this.getEventArguments(n),
|
|
742
|
+
dataItem: o,
|
|
743
|
+
level: r,
|
|
744
|
+
value: st(o, this.props.expandField)
|
|
745
|
+
};
|
|
746
|
+
s.call(void 0, c);
|
|
747
|
+
}
|
|
748
|
+
}, this.onRowClick = (n, o) => {
|
|
749
|
+
if (this.props.onRowClick && n.target.nodeName === "TD") {
|
|
750
|
+
const r = {
|
|
751
|
+
dataItem: o.dataItem,
|
|
752
|
+
level: o.level,
|
|
753
|
+
...this.getEventArguments(n)
|
|
754
|
+
};
|
|
755
|
+
this.props.onRowClick.call(void 0, r);
|
|
756
|
+
}
|
|
757
|
+
}, this.rowDoubleClick = (n, o) => {
|
|
758
|
+
if (this.props.onRowDoubleClick && n.target.nodeName === "TD") {
|
|
759
|
+
const r = {
|
|
760
|
+
dataItem: o.dataItem,
|
|
761
|
+
level: o.level,
|
|
762
|
+
...this.getEventArguments(n)
|
|
763
|
+
};
|
|
764
|
+
this.props.onRowDoubleClick.call(void 0, r);
|
|
765
|
+
}
|
|
766
|
+
}, this.rowContextMenu = (n, o) => {
|
|
767
|
+
if (this.props.onRowContextMenu && n.target.nodeName === "TD") {
|
|
768
|
+
const r = {
|
|
769
|
+
dataItem: o.dataItem,
|
|
770
|
+
level: o.level,
|
|
771
|
+
...this.getEventArguments(n)
|
|
772
|
+
};
|
|
773
|
+
this.props.onRowContextMenu.call(void 0, r);
|
|
774
|
+
}
|
|
775
|
+
}, this.onPageChange = (n) => {
|
|
776
|
+
if (this.props.onPageChange) {
|
|
777
|
+
const o = {
|
|
778
|
+
...this.getEventArguments(n.syntheticEvent),
|
|
779
|
+
skip: n.skip,
|
|
780
|
+
take: n.take
|
|
781
|
+
};
|
|
782
|
+
this.props.onPageChange.call(void 0, o);
|
|
783
|
+
}
|
|
784
|
+
}, this.onDataStateChange = (n, o, r) => {
|
|
785
|
+
if (n && n.call(void 0, { ...this.getEventArguments(r), ...o }), this.props.onDataStateChange) {
|
|
786
|
+
const l = {
|
|
787
|
+
...this.getEventArguments(r),
|
|
788
|
+
dataState: { ...this.getDataState(), ...o }
|
|
789
|
+
};
|
|
790
|
+
this.props.onDataStateChange.call(void 0, l);
|
|
791
|
+
}
|
|
792
|
+
}, this.getDataState = () => ({
|
|
793
|
+
filter: this.props.filter,
|
|
794
|
+
sort: this.props.sort
|
|
795
|
+
}), this.getEventArguments = (n) => ({
|
|
796
|
+
nativeEvent: n && n.nativeEvent,
|
|
797
|
+
syntheticEvent: n,
|
|
798
|
+
target: this
|
|
799
|
+
}), this.getLeafDataItems = () => this.flatData.map((n) => n.dataItem), this.dragLogic = new Aa(this.onColumnReorder, F, F), this.columnResize = new Va(this.onColumnResize), De.onConstructor({
|
|
800
|
+
navigatable: !!a.navigatable,
|
|
801
|
+
contextStateRef: this.contextStateRef,
|
|
802
|
+
navigationStateRef: this.navigationStateRef,
|
|
803
|
+
idPrefix: a.idPrefix
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
get document() {
|
|
807
|
+
if (gt)
|
|
808
|
+
return this.element && this.element.ownerDocument || document;
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* @hidden
|
|
812
|
+
*/
|
|
813
|
+
componentDidMount() {
|
|
814
|
+
this.calculateSizes(this.element), De.onComponentDidMount({
|
|
815
|
+
scope: this.element || void 0,
|
|
816
|
+
contextStateRef: this.contextStateRef,
|
|
817
|
+
navigationStateRef: this.navigationStateRef
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
/**
|
|
821
|
+
* @hidden
|
|
822
|
+
*/
|
|
823
|
+
getSnapshotBeforeUpdate() {
|
|
824
|
+
return De.onGetSnapshotBeforeUpdate({
|
|
825
|
+
document: this.document,
|
|
826
|
+
contextStateRef: this.contextStateRef,
|
|
827
|
+
navigationStateRef: this.navigationStateRef
|
|
828
|
+
}), null;
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* @hidden
|
|
832
|
+
*/
|
|
833
|
+
componentDidUpdate(a) {
|
|
834
|
+
a.columns !== this.props.columns && this.calculateSizes(this.element), De.onComponentDidUpdate({
|
|
835
|
+
scope: this.element || void 0,
|
|
836
|
+
contextStateRef: this.contextStateRef,
|
|
837
|
+
navigationStateRef: this.navigationStateRef
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* @hidden
|
|
842
|
+
*/
|
|
843
|
+
componentWillUnmount() {
|
|
844
|
+
this.columnResize.columns = [], this.dragLogic.columns = [], this.prevData = [], this.flattedData = [], this.updateOnScroll = !1;
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* @hidden
|
|
848
|
+
*/
|
|
849
|
+
render() {
|
|
850
|
+
const {
|
|
851
|
+
filterRow: a,
|
|
852
|
+
scrollable: n = "scrollable",
|
|
853
|
+
resizable: o = !1,
|
|
854
|
+
reorderable: r = !1,
|
|
855
|
+
skip: l,
|
|
856
|
+
take: s,
|
|
857
|
+
afterContent: c,
|
|
858
|
+
extendedColumns: m = [],
|
|
859
|
+
columnsMap: g
|
|
860
|
+
} = this.props, d = m.some((E) => !!E.filter) || a !== void 0, u = a || $a, h = $t.getIdPrefix(this.navigationStateRef);
|
|
861
|
+
this.columnResize.columns = m, this.columnResize.resizable = o, this.dragLogic.columns = m, this.dragLogic.reorderable = r, this.dragLogic.groupable = !1;
|
|
862
|
+
const p = m.filter((E) => E.children.length === 0), C = /* @__PURE__ */ t.createElement(
|
|
863
|
+
za,
|
|
864
|
+
{
|
|
865
|
+
headerRow: /* @__PURE__ */ t.createElement(
|
|
866
|
+
Ga,
|
|
867
|
+
{
|
|
868
|
+
sort: this.props.sort,
|
|
869
|
+
sortable: this.props.sortable,
|
|
870
|
+
sortChange: this.onSortChange,
|
|
871
|
+
selectionChange: this.onHeaderSelectionChange,
|
|
872
|
+
columns: m,
|
|
873
|
+
columnsMap: g,
|
|
874
|
+
cellRender: this.props.headerCellRender,
|
|
875
|
+
columnResize: this.columnResize,
|
|
876
|
+
columnMenu: this.props.columnMenu,
|
|
877
|
+
columnMenuFilter: this.props.columnMenuFilter,
|
|
878
|
+
columnMenuFilterChange: this.onColumnMenuFilterChange,
|
|
879
|
+
pressHandler: this.dragLogic.pressHandler,
|
|
880
|
+
dragHandler: this.dragLogic.dragHandler,
|
|
881
|
+
releaseHandler: this.dragLogic.releaseHandler
|
|
882
|
+
}
|
|
883
|
+
),
|
|
884
|
+
filterRow: d && /* @__PURE__ */ t.createElement(
|
|
885
|
+
u,
|
|
886
|
+
{
|
|
887
|
+
columns: p,
|
|
888
|
+
filter: this.props.filter,
|
|
889
|
+
filterChange: this.onFilterChange,
|
|
890
|
+
sort: this.props.sort,
|
|
891
|
+
ariaRowIndex: g.length + 1
|
|
892
|
+
}
|
|
893
|
+
) || void 0,
|
|
894
|
+
columnResize: this.columnResize
|
|
895
|
+
}
|
|
896
|
+
), f = this.props.style || {}, { colSpans: v, hiddenColumns: L } = Wa({
|
|
897
|
+
enabled: this.props.columnVirtualization,
|
|
898
|
+
columns: p,
|
|
899
|
+
scrollLeft: this.wrapperScrollLeft,
|
|
900
|
+
tableViewPortWidth: parseFloat((f.width || "").toString())
|
|
901
|
+
}), V = (E, H, Q, _, w, Z) => p.map((T, N) => {
|
|
902
|
+
if (L[N])
|
|
903
|
+
return null;
|
|
904
|
+
const K = T.id ? T.id : N, Y = `k-table-td ${T.className ? T.className + " " : ""}${T.locked ? "k-grid-content-sticky" : ""}`, W = {
|
|
905
|
+
id: $t.generateNavigatableId(`${Q}-${String(N)}`, h),
|
|
906
|
+
colSpan: v[N],
|
|
907
|
+
dataItem: E.dataItem,
|
|
908
|
+
field: T.field,
|
|
909
|
+
format: T.format,
|
|
910
|
+
className: Y || void 0,
|
|
911
|
+
render: this.props.cellRender,
|
|
912
|
+
onChange: this.onItemChange,
|
|
913
|
+
selectionChange: this.props.onSelectionChange ? (O) => {
|
|
914
|
+
this.onSelectionChange({ event: O, item: E, columnIndex: N, dataIndex: w });
|
|
915
|
+
} : void 0,
|
|
916
|
+
level: E.level,
|
|
917
|
+
expandable: T.expandable,
|
|
918
|
+
expanded: _,
|
|
919
|
+
hasChildren: kn(E.dataItem, this.props.subItemsField),
|
|
920
|
+
colIndex: N,
|
|
921
|
+
ariaColumnIndex: T.ariaColumnIndex,
|
|
922
|
+
onExpandChange: this.onExpandChange,
|
|
923
|
+
style: T.left !== void 0 && {
|
|
924
|
+
left: T.left,
|
|
925
|
+
right: T.right,
|
|
926
|
+
borderRightWidth: T.rightBorder ? "1px" : ""
|
|
927
|
+
} || {},
|
|
928
|
+
isSelected: Array.isArray(Z) && Z.indexOf(N) > -1
|
|
929
|
+
};
|
|
930
|
+
return H && T.editCell ? /* @__PURE__ */ t.createElement(T.editCell, { ...W, onChange: this.onItemChange, key: K }) : T.cell ? /* @__PURE__ */ t.createElement(T.cell, { key: K, ...W }) : /* @__PURE__ */ t.createElement(no, { key: K, ...W });
|
|
931
|
+
});
|
|
932
|
+
let M = this.flatData;
|
|
933
|
+
const x = M.length;
|
|
934
|
+
l !== void 0 && s !== void 0 && (M = M.slice(l, l + s)), n === "virtual" && (M = eo({
|
|
935
|
+
rows: M,
|
|
936
|
+
tableViewPortHeight: parseFloat((f.height || f.maxHeight || "").toString()),
|
|
937
|
+
scrollTop: this.wrapperScrollTop
|
|
938
|
+
}), this.updateOnScroll = !1);
|
|
939
|
+
const z = M.map((E) => E.level), J = g.length + (d ? 1 : 0) + 1, R = M.length > 0 && M.map((E, H) => {
|
|
940
|
+
const Q = D(this.props.editField || "")(E.dataItem), _ = D(this.props.dataItemKey)(E.dataItem), w = String(_ || E.level.join(".")), Z = st(E.dataItem, this.props.expandField), T = this.props.selectedField ? D(this.props.selectedField)(E.dataItem) : void 0, N = {
|
|
941
|
+
key: w,
|
|
942
|
+
level: E.level,
|
|
943
|
+
levels: z,
|
|
944
|
+
dataItem: E.dataItem,
|
|
945
|
+
selectedField: this.props.selectedField,
|
|
946
|
+
rowHeight: E.height,
|
|
947
|
+
render: this.props.rowRender,
|
|
948
|
+
onDrop: this.onRowDrop,
|
|
949
|
+
onDrag: this.onRowDrag,
|
|
950
|
+
onClick: (O) => this.onRowClick(O, E),
|
|
951
|
+
onDoubleClick: (O) => this.rowDoubleClick(O, E),
|
|
952
|
+
onContextMenu: (O) => this.rowContextMenu(O, E),
|
|
953
|
+
isAltRow: H % 2 !== 0,
|
|
954
|
+
expanded: Z,
|
|
955
|
+
rowIndex: H,
|
|
956
|
+
ariaRowIndex: J + H,
|
|
957
|
+
ariaSetSize: E.levelCount,
|
|
958
|
+
ariaPosInSet: E.level[E.level.length - 1] + 1,
|
|
959
|
+
isSelected: typeof T == "boolean" && T
|
|
960
|
+
}, K = this.props.editRow, Y = this.props.row || an, W = V(E, Q, w, Z, H, T);
|
|
961
|
+
return Q && K ? /* @__PURE__ */ t.createElement(K, { ...N }, W) : /* @__PURE__ */ t.createElement(Y, { ...N }, W);
|
|
962
|
+
}) || /* @__PURE__ */ t.createElement("tr", { className: "k-table-row k-grid-norecords" }, /* @__PURE__ */ t.createElement("td", { className: "k-table-td", colSpan: p.length }, this.props.noRecords || /* @__PURE__ */ t.createElement(to, null))), X = (E) => this.props.sort && this.props.sort.some((H) => H.field === E), A = /* @__PURE__ */ t.createElement("colgroup", { ref: (E) => {
|
|
963
|
+
this.columnResize.colGroupMain = E;
|
|
964
|
+
} }, p.map(
|
|
965
|
+
(E, H) => /* @__PURE__ */ t.createElement(
|
|
966
|
+
"col",
|
|
967
|
+
{
|
|
968
|
+
key: H.toString(),
|
|
969
|
+
className: X(E.field) ? "k-sorted" : void 0,
|
|
970
|
+
style: E.width !== void 0 ? { width: E.width } : void 0
|
|
971
|
+
}
|
|
972
|
+
)
|
|
973
|
+
)), j = this.props.columnVirtualization || this.props.scrollable === "virtual", G = this.props.selectable && this.props.selectable.drag ? "none" : void 0, B = this.props.tableProps || {};
|
|
974
|
+
return /* @__PURE__ */ t.createElement(nn.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ t.createElement(
|
|
975
|
+
"div",
|
|
976
|
+
{
|
|
977
|
+
style: this.props.style,
|
|
978
|
+
className: ce(
|
|
979
|
+
"k-grid k-grid-md",
|
|
980
|
+
this.props.className,
|
|
981
|
+
{ "k-treelist-scrollable": n !== "none" }
|
|
982
|
+
),
|
|
983
|
+
ref: (E) => this.element = E,
|
|
984
|
+
onScroll: j ? this.onScroll : void 0,
|
|
985
|
+
onKeyDown: this.onKeyDown,
|
|
986
|
+
onFocus: this.onFocus,
|
|
987
|
+
"aria-rowcount": x,
|
|
988
|
+
"aria-colcount": p.length,
|
|
989
|
+
role: "treegrid",
|
|
990
|
+
...Oa
|
|
991
|
+
},
|
|
992
|
+
this.props.toolbar,
|
|
993
|
+
/* @__PURE__ */ t.createElement(
|
|
994
|
+
Pa,
|
|
995
|
+
{
|
|
996
|
+
selectable: this.props.selectable,
|
|
997
|
+
onRelease: this.selectionRelease,
|
|
998
|
+
childRef: (E) => {
|
|
999
|
+
this.tableElement = E;
|
|
1000
|
+
}
|
|
1001
|
+
},
|
|
1002
|
+
/* @__PURE__ */ t.createElement(
|
|
1003
|
+
"table",
|
|
1004
|
+
{
|
|
1005
|
+
className: "k-table k-table-md",
|
|
1006
|
+
...this.props.tableProps || {},
|
|
1007
|
+
style: { ...B.style || {}, userSelect: G },
|
|
1008
|
+
role: "presentation"
|
|
1009
|
+
},
|
|
1010
|
+
A,
|
|
1011
|
+
C,
|
|
1012
|
+
/* @__PURE__ */ t.createElement("tbody", { className: "k-table-tbody", ..._a, ref: (E) => this.tbodyElement = E, role: "presentation" }, R)
|
|
1013
|
+
)
|
|
1014
|
+
),
|
|
1015
|
+
this.props.pager && /* @__PURE__ */ t.createElement(
|
|
1016
|
+
this.props.pager,
|
|
1017
|
+
{
|
|
1018
|
+
className: "k-grid-pager",
|
|
1019
|
+
total: x,
|
|
1020
|
+
skip: l,
|
|
1021
|
+
take: s,
|
|
1022
|
+
onPageChange: this.onPageChange
|
|
1023
|
+
}
|
|
1024
|
+
),
|
|
1025
|
+
r && /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(Ka, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ t.createElement(Ba, { ref: this.dragLogic.refDragElementClue })),
|
|
1026
|
+
c
|
|
1027
|
+
));
|
|
1028
|
+
}
|
|
1029
|
+
get flatData() {
|
|
1030
|
+
const { data: a = [], rowHeight: n = 0 } = this.props;
|
|
1031
|
+
let o = 0;
|
|
1032
|
+
const r = () => {
|
|
1033
|
+
const s = { height: n, offsetTop: o };
|
|
1034
|
+
return o += s.height, s;
|
|
1035
|
+
}, l = this.updateOnScroll && this.prevData === a && this.tbodyOffsetTop > 0 && this.flattedData.length ? this.flattedData : a.map((s) => ({ ...s, ...r() }));
|
|
1036
|
+
return this.prevData = a, this.flattedData = l, l;
|
|
1037
|
+
}
|
|
1038
|
+
onSelectionChange(a) {
|
|
1039
|
+
if (this.props.onSelectionChange) {
|
|
1040
|
+
const { event: n, item: o, dataIndex: r, columnIndex: l } = a, { mode: s, cell: c } = Bt(this.props.selectable), m = {
|
|
1041
|
+
...this.getEventArguments(n.syntheticEvent),
|
|
1042
|
+
dataItem: o.dataItem,
|
|
1043
|
+
level: o.level,
|
|
1044
|
+
startColIndex: l,
|
|
1045
|
+
endColIndex: l,
|
|
1046
|
+
startRowIndex: r,
|
|
1047
|
+
endRowIndex: r,
|
|
1048
|
+
dataItems: this.getLeafDataItems(),
|
|
1049
|
+
altKey: !1,
|
|
1050
|
+
ctrlKey: !1,
|
|
1051
|
+
shiftKey: !1,
|
|
1052
|
+
metaKey: !1,
|
|
1053
|
+
mode: s,
|
|
1054
|
+
cell: c,
|
|
1055
|
+
isDrag: !1,
|
|
1056
|
+
componentId: this._treeListId,
|
|
1057
|
+
selectedField: this.props.selectedField || ""
|
|
1058
|
+
};
|
|
1059
|
+
this.props.onSelectionChange.call(void 0, m);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
zt.propTypes = {
|
|
1064
|
+
data: i.array,
|
|
1065
|
+
resizable: i.bool,
|
|
1066
|
+
reorderable: i.bool,
|
|
1067
|
+
sortable: i.oneOfType([
|
|
1068
|
+
i.bool,
|
|
1069
|
+
i.shape({
|
|
1070
|
+
mode: i.oneOf(["single", "multiple"]),
|
|
1071
|
+
allowUnsort: i.bool
|
|
1072
|
+
})
|
|
1073
|
+
]),
|
|
1074
|
+
onSortChange: i.func,
|
|
1075
|
+
sort: i.array,
|
|
1076
|
+
columns: i.arrayOf(i.object),
|
|
1077
|
+
columnVirtualization: i.bool,
|
|
1078
|
+
filter: i.array,
|
|
1079
|
+
onFilterChange: i.func,
|
|
1080
|
+
filterRow: i.any,
|
|
1081
|
+
toolbar: i.any,
|
|
1082
|
+
noRecords: i.any,
|
|
1083
|
+
onExpandChange: i.func,
|
|
1084
|
+
expandField: i.string,
|
|
1085
|
+
subItemsField: i.string,
|
|
1086
|
+
selectedField: i.string,
|
|
1087
|
+
onSelectionChange: i.func,
|
|
1088
|
+
onHeaderSelectionChange: i.func,
|
|
1089
|
+
onRowClick: i.func,
|
|
1090
|
+
onItemChange: i.func,
|
|
1091
|
+
editField: i.string,
|
|
1092
|
+
scrollable: i.oneOf(["none", "scrollable", "virtual"]),
|
|
1093
|
+
rowHeight: i.number,
|
|
1094
|
+
style: i.object,
|
|
1095
|
+
tableProps: i.object,
|
|
1096
|
+
pager: i.any,
|
|
1097
|
+
skip: i.number,
|
|
1098
|
+
take: i.number,
|
|
1099
|
+
onPageChange: i.func,
|
|
1100
|
+
onDataStateChange: i.func,
|
|
1101
|
+
onColumnResize: i.func,
|
|
1102
|
+
onColumnReorder: i.func,
|
|
1103
|
+
extendedColumns: i.arrayOf(i.object),
|
|
1104
|
+
columnsMap: i.arrayOf(i.array),
|
|
1105
|
+
dataItemKey: i.string.isRequired,
|
|
1106
|
+
afterContent: i.any,
|
|
1107
|
+
navigatable: i.bool,
|
|
1108
|
+
idPrefix: i.string
|
|
1109
|
+
};
|
|
1110
|
+
zt.contextType = nn;
|
|
1111
|
+
const Fe = t.forwardRef((e, a) => {
|
|
1112
|
+
const { slotLevels: n, slotWidth: o, timelineHeaderCell: r } = e, {
|
|
1113
|
+
columns: l,
|
|
1114
|
+
noRecords: s,
|
|
1115
|
+
resizable: c,
|
|
1116
|
+
reorderable: m,
|
|
1117
|
+
sortable: g,
|
|
1118
|
+
sort: d,
|
|
1119
|
+
filter: u,
|
|
1120
|
+
columnMenuFilter: h,
|
|
1121
|
+
columnMenu: p,
|
|
1122
|
+
navigatable: C,
|
|
1123
|
+
row: f,
|
|
1124
|
+
selectable: v
|
|
1125
|
+
} = Ne(), {
|
|
1126
|
+
onDataStateChange: L,
|
|
1127
|
+
onSortChange: V,
|
|
1128
|
+
onFilterChange: M,
|
|
1129
|
+
onColumnMenuFilterChange: x,
|
|
1130
|
+
onExpandChange: z,
|
|
1131
|
+
onRowClick: J,
|
|
1132
|
+
onRowDoubleClick: R,
|
|
1133
|
+
onRowContextMenu: X,
|
|
1134
|
+
onColumnResize: A,
|
|
1135
|
+
onColumnReorder: j,
|
|
1136
|
+
onDependencyCreate: G,
|
|
1137
|
+
onKeyDown: B,
|
|
1138
|
+
onSelectionChange: E,
|
|
1139
|
+
onHeaderSelectionChange: H
|
|
1140
|
+
} = Ko(), Q = wn(), _ = _o(), w = Tt(), Z = En(), T = Wo(), N = Oo(), K = t.useRef(null), Y = t.useRef(null), W = t.useRef(null), O = t.useRef(null), ge = t.useRef(0), we = t.useRef(Jt()), b = t.useRef(null), Le = t.useRef(null), Ye = t.useCallback(
|
|
1141
|
+
(y) => {
|
|
1142
|
+
W.current && W.current.scrollIntoView(y);
|
|
1143
|
+
},
|
|
1144
|
+
[]
|
|
1145
|
+
);
|
|
1146
|
+
t.useImperativeHandle(Le, () => ({ scrollIntoView: Ye })), t.useImperativeHandle(a, () => Le.current);
|
|
1147
|
+
const he = t.useRef(0), fe = t.useRef(0), pe = t.useRef(0), Ce = t.useRef(0), de = t.useRef(null), ye = t.useRef(null), [ue, ve] = t.useState(null), qe = Ao(n, K, r), Xe = Vo(n, Y), ke = zo(n, o), { extendedColumns: je, columnsWidth: Ze, columnsMap: Je } = t.useMemo(
|
|
1148
|
+
() => {
|
|
1149
|
+
const y = Ua(
|
|
1150
|
+
[
|
|
1151
|
+
...l,
|
|
1152
|
+
{
|
|
1153
|
+
title: "",
|
|
1154
|
+
sortable: !1,
|
|
1155
|
+
resizable: !1,
|
|
1156
|
+
reorderable: !1,
|
|
1157
|
+
width: ke,
|
|
1158
|
+
headerCell: () => qe,
|
|
1159
|
+
cell: bn,
|
|
1160
|
+
orderIndex: Number.MAX_SAFE_INTEGER,
|
|
1161
|
+
navigatable: !1
|
|
1162
|
+
}
|
|
1163
|
+
],
|
|
1164
|
+
{ prevId: 0, idPrefix: we.current }
|
|
1165
|
+
);
|
|
1166
|
+
let P = 0;
|
|
1167
|
+
return y.forEach((I, $, q) => {
|
|
1168
|
+
const U = $ + 1 === q.length, ie = I.children.length === 0;
|
|
1169
|
+
U ? I.isAccessible = !1 : (I.locked = !0, ie && (I.width = I.width || Ie)), ie && (P += parseFloat(String(I.width)));
|
|
1170
|
+
}), {
|
|
1171
|
+
extendedColumns: y,
|
|
1172
|
+
columnsWidth: P,
|
|
1173
|
+
columnsMap: Ya(y)
|
|
1174
|
+
};
|
|
1175
|
+
},
|
|
1176
|
+
[l, ke]
|
|
1177
|
+
), [Qe, et] = Yo(), Te = t.useCallback(
|
|
1178
|
+
() => K.current && K.current.parentElement,
|
|
1179
|
+
[]
|
|
1180
|
+
), k = () => {
|
|
1181
|
+
const y = Te(), P = Y.current, I = W.current && W.current.tbodyElement;
|
|
1182
|
+
if (!y || !P || !I)
|
|
1183
|
+
return;
|
|
1184
|
+
const $ = I.offsetTop, q = y.offsetLeft, U = ke;
|
|
1185
|
+
P.style.top = $ + "px", P.style.left = q + "px", P.style.width = U + "px", P.style.height = I.offsetHeight + "px";
|
|
1186
|
+
}, re = () => {
|
|
1187
|
+
const y = Te();
|
|
1188
|
+
y && (ge.current = y.offsetLeft);
|
|
1189
|
+
};
|
|
1190
|
+
t.useEffect(k), t.useEffect(re);
|
|
1191
|
+
const le = t.useCallback(
|
|
1192
|
+
(y) => {
|
|
1193
|
+
if (!O.current)
|
|
1194
|
+
return;
|
|
1195
|
+
const P = y.columns.slice(0, y.columns.length - 1);
|
|
1196
|
+
if (y.end)
|
|
1197
|
+
O.current.style.left = "0px";
|
|
1198
|
+
else {
|
|
1199
|
+
const I = Te();
|
|
1200
|
+
if (!I)
|
|
1201
|
+
return;
|
|
1202
|
+
O.current.style.left = I.offsetLeft - ge.current + "px", k();
|
|
1203
|
+
}
|
|
1204
|
+
A({
|
|
1205
|
+
...y,
|
|
1206
|
+
columns: P
|
|
1207
|
+
});
|
|
1208
|
+
},
|
|
1209
|
+
[A]
|
|
1210
|
+
), be = t.useCallback(
|
|
1211
|
+
(y) => {
|
|
1212
|
+
const P = y.columns.slice(0, y.columns.length - 1);
|
|
1213
|
+
j({
|
|
1214
|
+
...y,
|
|
1215
|
+
columns: P
|
|
1216
|
+
});
|
|
1217
|
+
},
|
|
1218
|
+
[A]
|
|
1219
|
+
), Re = t.useCallback(
|
|
1220
|
+
(y) => {
|
|
1221
|
+
const I = (b.current && b.current.ownerDocument ? b.current.ownerDocument : document).elementFromPoint(y.clientX, y.clientY), $ = b.current;
|
|
1222
|
+
if (!I || !I.parentElement || !$)
|
|
1223
|
+
return;
|
|
1224
|
+
const q = $.parentElement, U = $.firstElementChild;
|
|
1225
|
+
if (!q || !U)
|
|
1226
|
+
return;
|
|
1227
|
+
const ie = I.getAttribute(Ge);
|
|
1228
|
+
if (ie) {
|
|
1229
|
+
const pa = $.offsetTop, Ca = $.offsetLeft, ka = q.offsetTop, Ea = q.offsetLeft, Da = U.scrollTop, wa = U.scrollLeft;
|
|
1230
|
+
pe.current = Ca + Ea, Ce.current = pa + ka, he.current = y.clientX - pe.current + wa, fe.current = y.clientY - Ce.current + Da, de.current = I.parentElement.getAttribute(We), ye.current = ie;
|
|
1231
|
+
}
|
|
1232
|
+
},
|
|
1233
|
+
[]
|
|
1234
|
+
), tt = t.useCallback(
|
|
1235
|
+
(y) => {
|
|
1236
|
+
const P = b.current;
|
|
1237
|
+
if (!P)
|
|
1238
|
+
return;
|
|
1239
|
+
const I = P.firstElementChild;
|
|
1240
|
+
if (!I)
|
|
1241
|
+
return;
|
|
1242
|
+
const $ = I.scrollTop, q = I.scrollLeft, U = y.clientX - pe.current + q, ie = y.clientY - Ce.current + $;
|
|
1243
|
+
Math.abs(he.current - U) < 10 && Math.abs(fe.current - ie) < 10 || ve({
|
|
1244
|
+
startX: he.current,
|
|
1245
|
+
startY: fe.current,
|
|
1246
|
+
endX: U,
|
|
1247
|
+
endY: ie
|
|
1248
|
+
});
|
|
1249
|
+
},
|
|
1250
|
+
[]
|
|
1251
|
+
), Ee = t.useCallback(
|
|
1252
|
+
(y) => {
|
|
1253
|
+
const I = (b.current && b.current.ownerDocument ? b.current.ownerDocument : document).elementFromPoint(y.clientX, y.clientY);
|
|
1254
|
+
if (!I || !I.parentElement)
|
|
1255
|
+
return;
|
|
1256
|
+
const $ = I.parentElement.getAttribute(We), q = I.getAttribute(Ge);
|
|
1257
|
+
if (q && $ !== de.current && G) {
|
|
1258
|
+
let U;
|
|
1259
|
+
ye.current === "start" ? U = q === "start" ? 3 : 2 : U = q === "start" ? 1 : 0, G({
|
|
1260
|
+
fromId: de.current,
|
|
1261
|
+
toId: $,
|
|
1262
|
+
type: U
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
he.current = 0, fe.current = 0, pe.current = 0, Ce.current = 0, de.current = null, ye.current = null, ve(null);
|
|
1266
|
+
},
|
|
1267
|
+
[G, ve]
|
|
1268
|
+
);
|
|
1269
|
+
return /* @__PURE__ */ t.createElement(
|
|
1270
|
+
Tn,
|
|
1271
|
+
{
|
|
1272
|
+
tasksStore: [Qe, et],
|
|
1273
|
+
timelineWidth: ke,
|
|
1274
|
+
dependencyDrag: {
|
|
1275
|
+
isEnabled: !!G,
|
|
1276
|
+
draggedId: de.current,
|
|
1277
|
+
onDependencyHandlePress: Re,
|
|
1278
|
+
onDependencyHandleDrag: tt,
|
|
1279
|
+
onDependencyHandleRelease: Ee
|
|
1280
|
+
}
|
|
1281
|
+
},
|
|
1282
|
+
/* @__PURE__ */ t.createElement("div", { className: "k-gantt-content", ref: b, style: { height: `calc(100% - ${_}px)` } }, /* @__PURE__ */ t.createElement(
|
|
1283
|
+
zt,
|
|
1284
|
+
{
|
|
1285
|
+
ref: W,
|
|
1286
|
+
extendedColumns: je,
|
|
1287
|
+
columnsMap: Je,
|
|
1288
|
+
dataItemKey: w.id,
|
|
1289
|
+
data: T,
|
|
1290
|
+
idPrefix: we.current,
|
|
1291
|
+
navigatable: C,
|
|
1292
|
+
expandField: w.isExpanded,
|
|
1293
|
+
subItemsField: w.children,
|
|
1294
|
+
editField: w.isInEdit,
|
|
1295
|
+
selectedField: w.isSelected,
|
|
1296
|
+
onDataStateChange: L,
|
|
1297
|
+
onSortChange: V,
|
|
1298
|
+
onFilterChange: M,
|
|
1299
|
+
onExpandChange: z,
|
|
1300
|
+
onRowClick: J,
|
|
1301
|
+
onRowDoubleClick: R,
|
|
1302
|
+
onRowContextMenu: X,
|
|
1303
|
+
onColumnResize: le,
|
|
1304
|
+
onColumnReorder: be,
|
|
1305
|
+
onColumnMenuFilterChange: x,
|
|
1306
|
+
onKeyDown: B,
|
|
1307
|
+
onSelectionChange: E,
|
|
1308
|
+
onHeaderSelectionChange: H,
|
|
1309
|
+
tableProps: { style: { width: Ze }, className: "k-table k-table-md k-table-layout-fixed" },
|
|
1310
|
+
noRecords: s,
|
|
1311
|
+
rowHeight: Q,
|
|
1312
|
+
resizable: c,
|
|
1313
|
+
reorderable: m,
|
|
1314
|
+
sortable: g,
|
|
1315
|
+
sort: d,
|
|
1316
|
+
filter: u,
|
|
1317
|
+
columnMenuFilter: h,
|
|
1318
|
+
columnMenu: p,
|
|
1319
|
+
row: f,
|
|
1320
|
+
selectable: v,
|
|
1321
|
+
afterContent: /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("svg", { className: "k-gantt-dependencies-svg", ref: O, style: { left: 0, top: 0 } }, N.map((y) => /* @__PURE__ */ t.createElement(Rn, { key: D(Z.id)(y), dependency: y }))), /* @__PURE__ */ t.createElement("svg", { className: "k-gantt-dependencies-svg", style: { left: 0, top: 0, zIndex: 3 } }, ue && /* @__PURE__ */ t.createElement("polyline", { points: `${ue.startX},${ue.startY} ${ue.endX},${ue.endY}` })), T && T.length ? Xe : null)
|
|
1322
|
+
}
|
|
1323
|
+
))
|
|
1324
|
+
);
|
|
1325
|
+
});
|
|
1326
|
+
Fe.displayName = "KendoReactGanttBaseView";
|
|
1327
|
+
const lt = "gantt.weekViewTitle", it = "gantt.dayViewTitle", ct = "gantt.monthViewTitle", dt = "gantt.yearViewTitle", ut = "gantt.filterClearButton", Pe = "gantt.filterEqOperator", _e = "gantt.filterNotEqOperator", Ke = "gantt.filterIsNullOperator", Be = "gantt.filterIsNotNullOperator", Sn = "gantt.filterIsEmptyOperator", xn = "gantt.filterIsNotEmptyOperator", In = "gantt.filterStartsWithOperator", Nn = "gantt.filterContainsOperator", Mn = "gantt.filterNotContainsOperator", Fn = "gantt.filterEndsWithOperator", Ln = "gantt.filterGteOperator", Hn = "gantt.filterGtOperator", An = "gantt.filterLteOperator", Vn = "gantt.filterLtOperator", zn = "gantt.filterIsTrue", Gn = "gantt.filterIsFalse", Wn = "gantt.filterBooleanAll", On = "gantt.filterAfterOrEqualOperator", Pn = "gantt.filterAfterOperator", _n = "gantt.filterBeforeOperator", Kn = "gantt.filterBeforeOrEqualOperator", Xo = "gantt.noRecords", Bn = "gantt.editSave", Gt = "gantt.editCancel", $n = "gantt.editorTitle", Un = "gantt.editorTaskTitle", Yn = "gantt.editorTaskStart", qn = "gantt.editorTaskEnd", Xn = "gantt.editorTaskComplete", jn = "gantt.editorValidationRequired", Zn = "gantt.editorValidationStart", Jn = "gantt.editorValidationEnd", Qn = "gantt.addTask", ea = "gantt.addChild", ta = "gantt.addAbove", na = "gantt.addBelow", aa = "gantt.editorDelete", oa = "gantt.deleteConfirmation", sa = "gantt.deleteDialogTitle", ne = {
|
|
1328
|
+
[lt]: "Week",
|
|
1329
|
+
[it]: "Day",
|
|
1330
|
+
[ct]: "Month",
|
|
1331
|
+
[dt]: "Year",
|
|
1332
|
+
[ut]: "Clear",
|
|
1333
|
+
[Pe]: "Is equal to",
|
|
1334
|
+
[_e]: "Is not equal to",
|
|
1335
|
+
[Ke]: "Is null",
|
|
1336
|
+
[Be]: "Is not null",
|
|
1337
|
+
[Sn]: "Is empty",
|
|
1338
|
+
[xn]: "Is not empty",
|
|
1339
|
+
[In]: "Starts with",
|
|
1340
|
+
[Nn]: "Contains",
|
|
1341
|
+
[Mn]: "Does not contain",
|
|
1342
|
+
[Fn]: "Ends with",
|
|
1343
|
+
[Ln]: "Is greater than or equal to",
|
|
1344
|
+
[Hn]: "Is greater than",
|
|
1345
|
+
[An]: "Is less than or equal to",
|
|
1346
|
+
[Vn]: "Is less than",
|
|
1347
|
+
[zn]: "Is true",
|
|
1348
|
+
[Gn]: "Is false",
|
|
1349
|
+
[Wn]: "(All)",
|
|
1350
|
+
[On]: "Is after or equal to",
|
|
1351
|
+
[Pn]: "Is after",
|
|
1352
|
+
[_n]: "Is before",
|
|
1353
|
+
[Kn]: "Is before or equal to",
|
|
1354
|
+
[Xo]: "No records available",
|
|
1355
|
+
[Bn]: "Save",
|
|
1356
|
+
[Gt]: "Cancel",
|
|
1357
|
+
[$n]: "Task",
|
|
1358
|
+
[Un]: "Title",
|
|
1359
|
+
[Yn]: "Start",
|
|
1360
|
+
[qn]: "End",
|
|
1361
|
+
[Xn]: "Complete",
|
|
1362
|
+
[jn]: "Field is required.",
|
|
1363
|
+
[Zn]: "Start time must be be before End time.",
|
|
1364
|
+
[Jn]: "End time must be after Start time.",
|
|
1365
|
+
[Qn]: "Add Task",
|
|
1366
|
+
[ea]: "Add Child",
|
|
1367
|
+
[ta]: "Add Above",
|
|
1368
|
+
[na]: "Add Below",
|
|
1369
|
+
[aa]: "Delete",
|
|
1370
|
+
[oa]: "Are you sure you want to delete this event?",
|
|
1371
|
+
[sa]: "Delete Event"
|
|
1372
|
+
}, $e = t.forwardRef((e, a) => {
|
|
1373
|
+
const { slotWidth: n = Ae.slotWidth, firstSlotRangeRef: o, timelineHeaderCell: r } = e, { timezone: l } = Ne(), s = xe(), c = t.useRef(null), m = t.useRef(null), g = t.useCallback(
|
|
1374
|
+
(C) => {
|
|
1375
|
+
m.current && m.current.scrollIntoView(C);
|
|
1376
|
+
},
|
|
1377
|
+
[]
|
|
1378
|
+
);
|
|
1379
|
+
t.useImperativeHandle(c, () => ({ scrollIntoView: g })), t.useImperativeHandle(a, () => c.current);
|
|
1380
|
+
const d = Me(), u = e.workWeekStart || Ae.workWeekStart, h = e.workWeekEnd || Ae.workWeekEnd, p = t.useMemo(
|
|
1381
|
+
() => {
|
|
1382
|
+
const C = gn({
|
|
1383
|
+
workWeekStart: u,
|
|
1384
|
+
workWeekEnd: h
|
|
1385
|
+
}), f = [], v = pn(d, { timezone: l }, s);
|
|
1386
|
+
return v.forEach((L) => {
|
|
1387
|
+
const V = fn(L.range, { workDays: C, timezone: l }, s);
|
|
1388
|
+
f.push.apply(f, V);
|
|
1389
|
+
}), o && f[0] && (o.current = f[0].range), [v, f];
|
|
1390
|
+
},
|
|
1391
|
+
[l, d.start.getTime(), d.end.getTime(), s, u, h]
|
|
1392
|
+
);
|
|
1393
|
+
return /* @__PURE__ */ t.createElement(
|
|
1394
|
+
Fe,
|
|
1395
|
+
{
|
|
1396
|
+
ref: m,
|
|
1397
|
+
slotWidth: n,
|
|
1398
|
+
slotLevels: p,
|
|
1399
|
+
timelineHeaderCell: r
|
|
1400
|
+
}
|
|
1401
|
+
);
|
|
1402
|
+
}), jo = ({ intl: e, tasksStart: a, tasksEnd: n, timezone: o }) => {
|
|
1403
|
+
const r = S.fromLocalDate(a, o), l = S.fromLocalDate(n, o), s = mn(at(oe(r), e.firstDay())), c = Dt(at(oe(l), e.firstDay()), cn), m = S.fromUTCDate(se(s), o), g = S.fromUTCDate(se(c), o);
|
|
1404
|
+
return {
|
|
1405
|
+
start: new Date(m.getTime()),
|
|
1406
|
+
end: new Date(g.getTime()),
|
|
1407
|
+
zonedStart: m,
|
|
1408
|
+
zonedEnd: g
|
|
1409
|
+
};
|
|
1410
|
+
}, Ae = {
|
|
1411
|
+
name: "week",
|
|
1412
|
+
dateRange: jo,
|
|
1413
|
+
title: (e) => e.toLanguageString(lt, ne[lt]),
|
|
1414
|
+
slotWidth: Ie,
|
|
1415
|
+
workWeekStart: 1,
|
|
1416
|
+
workWeekEnd: 5,
|
|
1417
|
+
workDayStart: "08:00",
|
|
1418
|
+
workDayEnd: "17:00"
|
|
1419
|
+
};
|
|
1420
|
+
$e.defaultProps = Ae;
|
|
1421
|
+
$e.propTypes = {
|
|
1422
|
+
name: i.string,
|
|
1423
|
+
dateRange: i.oneOfType([i.func, i.object]),
|
|
1424
|
+
title: i.oneOfType([i.string, i.func]),
|
|
1425
|
+
slotWidth: i.number,
|
|
1426
|
+
workWeekStart: i.number,
|
|
1427
|
+
workWeekEnd: i.number,
|
|
1428
|
+
workDayStart: i.string,
|
|
1429
|
+
workDayEnd: i.string
|
|
1430
|
+
};
|
|
1431
|
+
$e.displayName = "KendoReactGanttWeekView";
|
|
1432
|
+
const Zo = (e, a, n) => {
|
|
1433
|
+
const [o, r] = t.useState(a || e), l = t.useCallback(
|
|
1434
|
+
(s, c) => {
|
|
1435
|
+
r(s), n && n.call(void 0, { ...c, value: s });
|
|
1436
|
+
},
|
|
1437
|
+
[n, r]
|
|
1438
|
+
);
|
|
1439
|
+
return [a !== void 0 ? a : o, l];
|
|
1440
|
+
}, ra = (e) => {
|
|
1441
|
+
const [a, n] = Dn(), o = ae(), r = t.useMemo(
|
|
1442
|
+
() => typeof e.view.title == "function" ? e.view.title.call(void 0, o) : e.view.title,
|
|
1443
|
+
[e.view.title, o]
|
|
1444
|
+
), l = t.useCallback(
|
|
1445
|
+
() => {
|
|
1446
|
+
e.view.name && n(e.view.name);
|
|
1447
|
+
},
|
|
1448
|
+
[n, e.view.name]
|
|
1449
|
+
);
|
|
1450
|
+
return /* @__PURE__ */ t.createElement(
|
|
1451
|
+
ze,
|
|
1452
|
+
{
|
|
1453
|
+
role: "button",
|
|
1454
|
+
type: "button",
|
|
1455
|
+
tabIndex: -1,
|
|
1456
|
+
togglable: !0,
|
|
1457
|
+
selected: e.view.name === a,
|
|
1458
|
+
onClick: l
|
|
1459
|
+
},
|
|
1460
|
+
r
|
|
1461
|
+
);
|
|
1462
|
+
};
|
|
1463
|
+
ra.displayName = "KendoReactGanttViewSelectorItem";
|
|
1464
|
+
const la = t.forwardRef(() => {
|
|
1465
|
+
const e = Po(), [a, n] = Dn(), o = e.find((s) => s.props.name === a), r = ae(), l = t.useCallback(
|
|
1466
|
+
(s) => {
|
|
1467
|
+
n && (s.syntheticEvent.preventDefault(), n(s.item.name));
|
|
1468
|
+
},
|
|
1469
|
+
[n]
|
|
1470
|
+
);
|
|
1471
|
+
return /* @__PURE__ */ t.createElement("div", { className: "k-gantt-views-wrapper" }, /* @__PURE__ */ t.createElement(lo, { className: "k-gantt-views" }, e.map((s) => /* @__PURE__ */ t.createElement(ra, { key: s.props.name, view: s.props }))), o && /* @__PURE__ */ t.createElement(
|
|
1472
|
+
on,
|
|
1473
|
+
{
|
|
1474
|
+
className: "k-views-dropdown",
|
|
1475
|
+
onItemClick: l,
|
|
1476
|
+
popupSettings: { popupClass: "k-gantt-toolbar" },
|
|
1477
|
+
textField: "title",
|
|
1478
|
+
items: e.map((s) => ({
|
|
1479
|
+
...s.props,
|
|
1480
|
+
selected: s.props.name === a,
|
|
1481
|
+
title: typeof s.props.title == "function" ? s.props.title.call(void 0, r) : s.props.title
|
|
1482
|
+
})),
|
|
1483
|
+
text: /* @__PURE__ */ t.createElement(t.Fragment, null, typeof o.props.title == "function" ? o.props.title.call(void 0, r) : o.props.title, /* @__PURE__ */ t.createElement(mt, { name: "caret-alt-down", icon: so }))
|
|
1484
|
+
}
|
|
1485
|
+
));
|
|
1486
|
+
});
|
|
1487
|
+
la.displayName = "KendoReactGanttViewSelectorList";
|
|
1488
|
+
const ia = t.forwardRef((e, a) => {
|
|
1489
|
+
const {
|
|
1490
|
+
className: n,
|
|
1491
|
+
...o
|
|
1492
|
+
} = e, r = t.useRef(null);
|
|
1493
|
+
return t.useImperativeHandle(a, () => ({ element: r.current, props: e })), /* @__PURE__ */ t.createElement(
|
|
1494
|
+
io,
|
|
1495
|
+
{
|
|
1496
|
+
ref: (l) => {
|
|
1497
|
+
l && (r.current = l.element);
|
|
1498
|
+
},
|
|
1499
|
+
className: ce("k-gantt-views", n),
|
|
1500
|
+
...o
|
|
1501
|
+
},
|
|
1502
|
+
e.children
|
|
1503
|
+
);
|
|
1504
|
+
});
|
|
1505
|
+
ia.displayName = "KendoReactGanttViewSelector";
|
|
1506
|
+
const ca = t.forwardRef((e, a) => {
|
|
1507
|
+
const {
|
|
1508
|
+
className: n,
|
|
1509
|
+
...o
|
|
1510
|
+
} = e, r = t.useRef(null), l = t.useRef(null);
|
|
1511
|
+
t.useImperativeHandle(l, () => ({ element: r.current, props: e })), t.useImperativeHandle(a, () => l.current);
|
|
1512
|
+
const s = t.useMemo(() => ce("k-gantt-toolbar k-gantt-header", n), [n]);
|
|
1513
|
+
return /* @__PURE__ */ t.createElement(
|
|
1514
|
+
co,
|
|
1515
|
+
{
|
|
1516
|
+
ref: (c) => {
|
|
1517
|
+
c && (r.current = c.element);
|
|
1518
|
+
},
|
|
1519
|
+
className: s,
|
|
1520
|
+
...o
|
|
1521
|
+
},
|
|
1522
|
+
e.children
|
|
1523
|
+
);
|
|
1524
|
+
});
|
|
1525
|
+
ca.displayName = "KendoReactGanttToolbar";
|
|
1526
|
+
const jt = {
|
|
1527
|
+
name: "@progress/kendo-react-gantt",
|
|
1528
|
+
productName: "KendoReact",
|
|
1529
|
+
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
1530
|
+
publishDate: 1700494246,
|
|
1531
|
+
version: "",
|
|
1532
|
+
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
1533
|
+
}, da = t.forwardRef((e, a) => {
|
|
1534
|
+
const n = ae(), o = (u) => n.toLanguageString(u, ne[u]), r = o(Qn), l = o(ea), s = o(ta), c = o(na), m = t.useCallback(
|
|
1535
|
+
(u) => {
|
|
1536
|
+
u.syntheticEvent.preventDefault();
|
|
1537
|
+
const h = u.item && u.item.direction ? u.item.direction : "none";
|
|
1538
|
+
e.onClick && e.onClick({
|
|
1539
|
+
nativeEvent: u.nativeEvent,
|
|
1540
|
+
syntheticEvent: u.syntheticEvent,
|
|
1541
|
+
direction: h
|
|
1542
|
+
});
|
|
1543
|
+
},
|
|
1544
|
+
[e.onClick]
|
|
1545
|
+
), g = t.useCallback(
|
|
1546
|
+
(u) => {
|
|
1547
|
+
u.preventDefault(), e.onClick && e.onClick({
|
|
1548
|
+
nativeEvent: u && u.nativeEvent,
|
|
1549
|
+
syntheticEvent: u,
|
|
1550
|
+
direction: "none"
|
|
1551
|
+
});
|
|
1552
|
+
},
|
|
1553
|
+
[e.onClick]
|
|
1554
|
+
), d = /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(mt, { name: "plus", icon: ro }), r);
|
|
1555
|
+
return e.selectedTask ? /* @__PURE__ */ t.createElement(
|
|
1556
|
+
on,
|
|
1557
|
+
{
|
|
1558
|
+
className: "k-views-dropdown",
|
|
1559
|
+
onItemClick: m,
|
|
1560
|
+
popupSettings: { popupClass: "k-gantt-toolbar" },
|
|
1561
|
+
textField: "title",
|
|
1562
|
+
items: [
|
|
1563
|
+
{ title: l, direction: "child" },
|
|
1564
|
+
{ title: s, direction: "above" },
|
|
1565
|
+
{ title: c, direction: "below" }
|
|
1566
|
+
],
|
|
1567
|
+
text: d
|
|
1568
|
+
}
|
|
1569
|
+
) : /* @__PURE__ */ t.createElement(ze, { onClick: g }, d);
|
|
1570
|
+
});
|
|
1571
|
+
da.displayName = "KendoReactGanttAddButton";
|
|
1572
|
+
const Wt = t.forwardRef((e, a) => {
|
|
1573
|
+
Ta(jt);
|
|
1574
|
+
const n = ba(jt), {
|
|
1575
|
+
columns: o = Se.columns,
|
|
1576
|
+
taskData: r = Se.taskData,
|
|
1577
|
+
dependencyData: l = Se.dependencyData,
|
|
1578
|
+
style: s,
|
|
1579
|
+
className: c,
|
|
1580
|
+
noRecords: m,
|
|
1581
|
+
timezone: g,
|
|
1582
|
+
rowHeight: d = Se.rowHeight,
|
|
1583
|
+
resizable: u,
|
|
1584
|
+
reorderable: h,
|
|
1585
|
+
sortable: p,
|
|
1586
|
+
sort: C,
|
|
1587
|
+
filter: f,
|
|
1588
|
+
columnMenuFilter: v,
|
|
1589
|
+
columnMenu: L,
|
|
1590
|
+
navigatable: V,
|
|
1591
|
+
toolbar: M,
|
|
1592
|
+
row: x,
|
|
1593
|
+
selectable: z
|
|
1594
|
+
} = e, J = xe(), { fields: R } = t.useMemo(() => vo(e.taskModelFields), [e.taskModelFields]), { fields: X } = t.useMemo(() => To(e.dependencyModelFields), [e.dependencyModelFields]), A = t.useCallback(
|
|
1595
|
+
Go(R.isExpanded, R.children),
|
|
1596
|
+
[R.isExpanded, R.children]
|
|
1597
|
+
), j = t.useRef(null), G = t.useRef(null), B = t.useRef(null), E = t.useRef(null), H = t.useRef(null), Q = t.useCallback(
|
|
1598
|
+
(k) => {
|
|
1599
|
+
const re = D(R.start)(k), le = D(R.end)(k), be = D(R.isSelected)(k);
|
|
1600
|
+
(!G.current || re < G.current) && (G.current = re), (!B.current || le > B.current) && (B.current = le), be && (E.current = k);
|
|
1601
|
+
},
|
|
1602
|
+
[R.start, R.end]
|
|
1603
|
+
), _ = t.useMemo(
|
|
1604
|
+
() => (G.current = null, B.current = null, E.current = null, ao(r, A, Q)),
|
|
1605
|
+
[r, A]
|
|
1606
|
+
);
|
|
1607
|
+
(!G.current || !B.current) && (G.current = new Date(Ut), B.current = new Date(Ut));
|
|
1608
|
+
const w = t.Children.toArray(
|
|
1609
|
+
e.children || [/* @__PURE__ */ t.createElement($e, { key: "week", firstSlotRangeRef: H })]
|
|
1610
|
+
), [
|
|
1611
|
+
Z,
|
|
1612
|
+
T
|
|
1613
|
+
] = Zo(
|
|
1614
|
+
e.defaultView || w[0].props.name,
|
|
1615
|
+
e.view,
|
|
1616
|
+
e.onViewChange
|
|
1617
|
+
), N = w.find((k) => k.props.name === Z) || w[0], K = typeof N.props.dateRange == "function" ? N.props.dateRange.call(void 0, {
|
|
1618
|
+
intl: J,
|
|
1619
|
+
tasksStart: G.current,
|
|
1620
|
+
tasksEnd: B.current,
|
|
1621
|
+
timezone: g
|
|
1622
|
+
}) : N.props.dateRange, Y = t.useRef(null), [W, O] = t.useState(0);
|
|
1623
|
+
t.useLayoutEffect(
|
|
1624
|
+
() => {
|
|
1625
|
+
Y.current && O(Y.current.element.offsetHeight);
|
|
1626
|
+
},
|
|
1627
|
+
[]
|
|
1628
|
+
);
|
|
1629
|
+
const ge = t.useCallback(
|
|
1630
|
+
(k) => {
|
|
1631
|
+
j.current && j.current.scrollIntoView(k);
|
|
1632
|
+
},
|
|
1633
|
+
[]
|
|
1634
|
+
), we = t.useRef(null), b = t.useRef(null);
|
|
1635
|
+
t.useImperativeHandle(b, () => ({ props: e, element: we.current, scrollIntoView: ge })), t.useImperativeHandle(a, () => b.current);
|
|
1636
|
+
const Le = t.useCallback(
|
|
1637
|
+
(k) => {
|
|
1638
|
+
e.onDataStateChange && e.onDataStateChange.call(
|
|
1639
|
+
void 0,
|
|
1640
|
+
{ ...k, target: b.current }
|
|
1641
|
+
);
|
|
1642
|
+
},
|
|
1643
|
+
[e.onDataStateChange]
|
|
1644
|
+
), Ye = t.useCallback(
|
|
1645
|
+
(k) => {
|
|
1646
|
+
e.onSortChange && e.onSortChange.call(
|
|
1647
|
+
void 0,
|
|
1648
|
+
{ ...k, target: b.current }
|
|
1649
|
+
);
|
|
1650
|
+
},
|
|
1651
|
+
[e.onSortChange]
|
|
1652
|
+
), he = t.useCallback(
|
|
1653
|
+
(k) => {
|
|
1654
|
+
e.onKeyDown && e.onKeyDown.call(
|
|
1655
|
+
void 0,
|
|
1656
|
+
{ ...k, target: b.current }
|
|
1657
|
+
);
|
|
1658
|
+
},
|
|
1659
|
+
[e.onKeyDown]
|
|
1660
|
+
), fe = t.useCallback(
|
|
1661
|
+
(k) => {
|
|
1662
|
+
e.onSelectionChange && e.onSelectionChange.call(
|
|
1663
|
+
void 0,
|
|
1664
|
+
{ ...k, target: b.current }
|
|
1665
|
+
);
|
|
1666
|
+
},
|
|
1667
|
+
[e.onSelectionChange]
|
|
1668
|
+
), pe = t.useCallback(
|
|
1669
|
+
(k) => {
|
|
1670
|
+
e.onHeaderSelectionChange && e.onHeaderSelectionChange.call(
|
|
1671
|
+
void 0,
|
|
1672
|
+
{ ...k, target: b.current }
|
|
1673
|
+
);
|
|
1674
|
+
},
|
|
1675
|
+
[e.onHeaderSelectionChange]
|
|
1676
|
+
), Ce = t.useCallback(
|
|
1677
|
+
(k) => {
|
|
1678
|
+
e.onFilterChange && e.onFilterChange.call(
|
|
1679
|
+
void 0,
|
|
1680
|
+
{ ...k, target: b.current }
|
|
1681
|
+
);
|
|
1682
|
+
},
|
|
1683
|
+
[e.onFilterChange]
|
|
1684
|
+
), de = t.useCallback(
|
|
1685
|
+
(k) => {
|
|
1686
|
+
e.onColumnMenuFilterChange && e.onColumnMenuFilterChange.call(
|
|
1687
|
+
void 0,
|
|
1688
|
+
{ ...k, target: b.current }
|
|
1689
|
+
);
|
|
1690
|
+
},
|
|
1691
|
+
[e.onColumnMenuFilterChange]
|
|
1692
|
+
), ye = t.useCallback(
|
|
1693
|
+
(k) => {
|
|
1694
|
+
e.onExpandChange && e.onExpandChange.call(
|
|
1695
|
+
void 0,
|
|
1696
|
+
{ ...k, target: b.current }
|
|
1697
|
+
);
|
|
1698
|
+
},
|
|
1699
|
+
[e.onExpandChange]
|
|
1700
|
+
), ue = t.useCallback(
|
|
1701
|
+
(k) => {
|
|
1702
|
+
e.onAddClick && e.onAddClick.call(
|
|
1703
|
+
void 0,
|
|
1704
|
+
{
|
|
1705
|
+
...k,
|
|
1706
|
+
target: b.current,
|
|
1707
|
+
selectedDataItem: E.current,
|
|
1708
|
+
slotStart: H.current && new Date(H.current.start.getTime()),
|
|
1709
|
+
slotEnd: H.current && new Date(H.current.end.getTime())
|
|
1710
|
+
}
|
|
1711
|
+
);
|
|
1712
|
+
},
|
|
1713
|
+
[e.onAddClick]
|
|
1714
|
+
), ve = t.useCallback(
|
|
1715
|
+
(k) => {
|
|
1716
|
+
e.onColumnResize && e.onColumnResize.call(
|
|
1717
|
+
void 0,
|
|
1718
|
+
{
|
|
1719
|
+
...k,
|
|
1720
|
+
target: b.current
|
|
1721
|
+
}
|
|
1722
|
+
);
|
|
1723
|
+
},
|
|
1724
|
+
[e.onColumnResize]
|
|
1725
|
+
), qe = t.useCallback(
|
|
1726
|
+
(k) => {
|
|
1727
|
+
e.onColumnReorder && e.onColumnReorder.call(
|
|
1728
|
+
void 0,
|
|
1729
|
+
{ ...k, target: b.current }
|
|
1730
|
+
);
|
|
1731
|
+
},
|
|
1732
|
+
[e.onColumnReorder]
|
|
1733
|
+
), Xe = t.useCallback(
|
|
1734
|
+
(k) => {
|
|
1735
|
+
e.onRowClick && e.onRowClick.call(
|
|
1736
|
+
void 0,
|
|
1737
|
+
{ ...k, target: b.current }
|
|
1738
|
+
);
|
|
1739
|
+
},
|
|
1740
|
+
[e.onRowClick]
|
|
1741
|
+
), ke = t.useCallback(
|
|
1742
|
+
(k) => {
|
|
1743
|
+
e.onRowDoubleClick && e.onRowDoubleClick.call(
|
|
1744
|
+
void 0,
|
|
1745
|
+
{ ...k, target: b.current }
|
|
1746
|
+
);
|
|
1747
|
+
},
|
|
1748
|
+
[e.onRowClick]
|
|
1749
|
+
), je = t.useCallback(
|
|
1750
|
+
(k) => {
|
|
1751
|
+
e.onRowContextMenu && e.onRowContextMenu.call(
|
|
1752
|
+
void 0,
|
|
1753
|
+
{ ...k, target: b.current }
|
|
1754
|
+
);
|
|
1755
|
+
},
|
|
1756
|
+
[e.onRowClick]
|
|
1757
|
+
), Ze = t.useCallback(
|
|
1758
|
+
(k) => {
|
|
1759
|
+
e.onTaskClick && e.onTaskClick.call(
|
|
1760
|
+
void 0,
|
|
1761
|
+
{ ...k, target: b.current }
|
|
1762
|
+
);
|
|
1763
|
+
},
|
|
1764
|
+
[e.onTaskClick]
|
|
1765
|
+
), Je = t.useCallback(
|
|
1766
|
+
(k) => {
|
|
1767
|
+
e.onTaskDoubleClick && e.onTaskDoubleClick.call(
|
|
1768
|
+
void 0,
|
|
1769
|
+
{ ...k, target: b.current }
|
|
1770
|
+
);
|
|
1771
|
+
},
|
|
1772
|
+
[e.onTaskDoubleClick]
|
|
1773
|
+
), Qe = t.useCallback(
|
|
1774
|
+
(k) => {
|
|
1775
|
+
e.onTaskContextMenu && e.onTaskContextMenu.call(
|
|
1776
|
+
void 0,
|
|
1777
|
+
{ ...k, target: b.current }
|
|
1778
|
+
);
|
|
1779
|
+
},
|
|
1780
|
+
[e.onTaskContextMenu]
|
|
1781
|
+
), et = t.useCallback(
|
|
1782
|
+
(k) => {
|
|
1783
|
+
e.onTaskRemoveClick && e.onTaskRemoveClick.call(
|
|
1784
|
+
void 0,
|
|
1785
|
+
{ ...k, target: b.current }
|
|
1786
|
+
);
|
|
1787
|
+
},
|
|
1788
|
+
[e.onTaskRemoveClick]
|
|
1789
|
+
), Te = t.useCallback(
|
|
1790
|
+
(k) => {
|
|
1791
|
+
if (e.onDependencyCreate) {
|
|
1792
|
+
let re, le;
|
|
1793
|
+
const be = D(R.id);
|
|
1794
|
+
for (let Re = 0; Re < _.length; Re++) {
|
|
1795
|
+
const tt = _[Re], Ee = be(tt.dataItem);
|
|
1796
|
+
if (String(Ee) === k.fromId && (re = Ee), String(Ee) === k.toId && (le = Ee), re && le)
|
|
1797
|
+
break;
|
|
1798
|
+
}
|
|
1799
|
+
e.onDependencyCreate.call(
|
|
1800
|
+
void 0,
|
|
1801
|
+
{
|
|
1802
|
+
fromId: re,
|
|
1803
|
+
toId: le,
|
|
1804
|
+
target: b.current,
|
|
1805
|
+
type: k.type
|
|
1806
|
+
}
|
|
1807
|
+
);
|
|
1808
|
+
}
|
|
1809
|
+
},
|
|
1810
|
+
[e.onDependencyCreate, R, _]
|
|
1811
|
+
);
|
|
1812
|
+
return /* @__PURE__ */ t.createElement(
|
|
1813
|
+
yn,
|
|
1814
|
+
{
|
|
1815
|
+
dateRange: K,
|
|
1816
|
+
taskData: _,
|
|
1817
|
+
dependencyData: l,
|
|
1818
|
+
taskModelFields: R,
|
|
1819
|
+
dependencyModelFields: X,
|
|
1820
|
+
views: w,
|
|
1821
|
+
activeView: [Z, T],
|
|
1822
|
+
rowHeight: d,
|
|
1823
|
+
toolbarHeight: W,
|
|
1824
|
+
props: {
|
|
1825
|
+
columns: o,
|
|
1826
|
+
noRecords: m,
|
|
1827
|
+
timezone: g,
|
|
1828
|
+
resizable: u,
|
|
1829
|
+
reorderable: h,
|
|
1830
|
+
sortable: p,
|
|
1831
|
+
sort: C,
|
|
1832
|
+
filter: f,
|
|
1833
|
+
columnMenuFilter: v,
|
|
1834
|
+
columnMenu: L,
|
|
1835
|
+
navigatable: V,
|
|
1836
|
+
row: x,
|
|
1837
|
+
selectable: z
|
|
1838
|
+
},
|
|
1839
|
+
events: {
|
|
1840
|
+
onDataStateChange: Le,
|
|
1841
|
+
onSortChange: Ye,
|
|
1842
|
+
onFilterChange: Ce,
|
|
1843
|
+
onColumnMenuFilterChange: de,
|
|
1844
|
+
onExpandChange: ye,
|
|
1845
|
+
onRowClick: Xe,
|
|
1846
|
+
onRowDoubleClick: ke,
|
|
1847
|
+
onRowContextMenu: je,
|
|
1848
|
+
onColumnResize: ve,
|
|
1849
|
+
onColumnReorder: qe,
|
|
1850
|
+
onDependencyCreate: e.onDependencyCreate && Te,
|
|
1851
|
+
onKeyDown: he,
|
|
1852
|
+
onSelectionChange: fe,
|
|
1853
|
+
onHeaderSelectionChange: pe
|
|
1854
|
+
},
|
|
1855
|
+
taskEvents: {
|
|
1856
|
+
onTaskClick: Ze,
|
|
1857
|
+
onTaskDoubleClick: Je,
|
|
1858
|
+
onTaskContextMenu: Qe,
|
|
1859
|
+
onTaskRemoveClick: e.onTaskRemoveClick && et
|
|
1860
|
+
}
|
|
1861
|
+
},
|
|
1862
|
+
/* @__PURE__ */ t.createElement(
|
|
1863
|
+
"div",
|
|
1864
|
+
{
|
|
1865
|
+
ref: we,
|
|
1866
|
+
role: "application",
|
|
1867
|
+
style: s,
|
|
1868
|
+
className: ce("k-gantt", c)
|
|
1869
|
+
},
|
|
1870
|
+
/* @__PURE__ */ t.createElement(ca, { ref: Y }, M && M.addTaskButton ? /* @__PURE__ */ t.createElement(da, { selectedTask: E.current, onClick: ue }) : null, /* @__PURE__ */ t.createElement(uo, null), /* @__PURE__ */ t.createElement(ia, null, /* @__PURE__ */ t.createElement(la, null))),
|
|
1871
|
+
N && /* @__PURE__ */ t.createElement(
|
|
1872
|
+
N.type,
|
|
1873
|
+
{
|
|
1874
|
+
key: N.props.name,
|
|
1875
|
+
ref: j,
|
|
1876
|
+
...N.props,
|
|
1877
|
+
firstSlotRangeRef: H
|
|
1878
|
+
}
|
|
1879
|
+
),
|
|
1880
|
+
n && /* @__PURE__ */ t.createElement(Ra, null)
|
|
1881
|
+
)
|
|
1882
|
+
);
|
|
1883
|
+
}), Se = {
|
|
1884
|
+
taskData: [],
|
|
1885
|
+
dependencyData: [],
|
|
1886
|
+
columns: [],
|
|
1887
|
+
rowHeight: 40
|
|
1888
|
+
};
|
|
1889
|
+
Wt.propTypes = {
|
|
1890
|
+
taskData: i.array,
|
|
1891
|
+
taskModelFields: i.shape({
|
|
1892
|
+
id: i.string,
|
|
1893
|
+
start: i.string,
|
|
1894
|
+
end: i.string,
|
|
1895
|
+
title: i.string,
|
|
1896
|
+
percentComplete: i.string,
|
|
1897
|
+
isRollup: i.string,
|
|
1898
|
+
isExpanded: i.string,
|
|
1899
|
+
children: i.string,
|
|
1900
|
+
isInEdit: i.string
|
|
1901
|
+
}),
|
|
1902
|
+
dependencyData: i.array,
|
|
1903
|
+
dependencyModelFields: i.shape({
|
|
1904
|
+
id: i.string,
|
|
1905
|
+
fromId: i.string,
|
|
1906
|
+
toId: i.string,
|
|
1907
|
+
type: i.string
|
|
1908
|
+
}),
|
|
1909
|
+
columns: i.arrayOf(
|
|
1910
|
+
i.shape({
|
|
1911
|
+
width: i.number,
|
|
1912
|
+
cell: i.any,
|
|
1913
|
+
editCell: i.any,
|
|
1914
|
+
headerCell: i.any,
|
|
1915
|
+
filter: i.any,
|
|
1916
|
+
children: i.any,
|
|
1917
|
+
field: i.string,
|
|
1918
|
+
title: i.string,
|
|
1919
|
+
sortable: i.any,
|
|
1920
|
+
expandable: i.bool,
|
|
1921
|
+
headerSelectionValue: i.bool,
|
|
1922
|
+
format: i.string,
|
|
1923
|
+
headerClassName: i.string,
|
|
1924
|
+
className: i.string,
|
|
1925
|
+
resizable: i.bool,
|
|
1926
|
+
reorderable: i.bool,
|
|
1927
|
+
minResizableWidth: i.number,
|
|
1928
|
+
orderIndex: i.number,
|
|
1929
|
+
columnMenu: i.any
|
|
1930
|
+
})
|
|
1931
|
+
),
|
|
1932
|
+
sort: i.array,
|
|
1933
|
+
filter: i.array,
|
|
1934
|
+
columnMenuFilter: i.array,
|
|
1935
|
+
columnMenu: i.any,
|
|
1936
|
+
style: i.object,
|
|
1937
|
+
className: i.string,
|
|
1938
|
+
children: i.any,
|
|
1939
|
+
timezone: i.string,
|
|
1940
|
+
defaultView: i.string,
|
|
1941
|
+
view: i.string,
|
|
1942
|
+
rowHeight: i.number,
|
|
1943
|
+
navigatable: i.bool,
|
|
1944
|
+
onViewChange: i.func,
|
|
1945
|
+
onDataStateChange: i.func,
|
|
1946
|
+
onSortChange: i.func,
|
|
1947
|
+
onFilterChange: i.func,
|
|
1948
|
+
onExpandChange: i.func,
|
|
1949
|
+
onRowClick: i.func,
|
|
1950
|
+
onColumnResize: i.func,
|
|
1951
|
+
onColumnReorder: i.func
|
|
1952
|
+
};
|
|
1953
|
+
Wt.defaultProps = Se;
|
|
1954
|
+
Wt.displayName = "KendoReactGantt";
|
|
1955
|
+
const Ot = t.forwardRef((e, a) => {
|
|
1956
|
+
const { slotWidth: n = me.slotWidth, slotDuration: o = me.slotDuration, firstSlotRangeRef: r, timelineHeaderCell: l } = e, { timezone: s } = Ne(), c = xe(), m = t.useRef(null), g = t.useRef(null), d = t.useCallback(
|
|
1957
|
+
(L) => {
|
|
1958
|
+
g.current && g.current.scrollIntoView(L);
|
|
1959
|
+
},
|
|
1960
|
+
[]
|
|
1961
|
+
);
|
|
1962
|
+
t.useImperativeHandle(m, () => ({ scrollIntoView: d })), t.useImperativeHandle(a, () => m.current);
|
|
1963
|
+
const u = Me(), h = e.workWeekStart || me.workWeekStart, p = e.workWeekEnd || me.workWeekEnd, C = e.workDayStart || me.workDayStart, f = e.workDayEnd || me.workDayEnd, v = t.useMemo(
|
|
1964
|
+
() => {
|
|
1965
|
+
const L = gn({
|
|
1966
|
+
workWeekStart: h,
|
|
1967
|
+
workWeekEnd: p
|
|
1968
|
+
}), V = [], M = fn(u, { workDays: L, timezone: s }, c);
|
|
1969
|
+
return M.forEach((x) => {
|
|
1970
|
+
const z = Lo(
|
|
1971
|
+
x.range,
|
|
1972
|
+
{
|
|
1973
|
+
workDayStart: C,
|
|
1974
|
+
workDayEnd: f,
|
|
1975
|
+
timezone: s,
|
|
1976
|
+
slotDuration: o
|
|
1977
|
+
},
|
|
1978
|
+
c
|
|
1979
|
+
);
|
|
1980
|
+
x.span = z.length, V.push.apply(V, z);
|
|
1981
|
+
}), r && V[0] && (r.current = V[0].range), [M, V];
|
|
1982
|
+
},
|
|
1983
|
+
[s, u.start.getTime(), u.end.getTime(), c, h, p, C, f]
|
|
1984
|
+
);
|
|
1985
|
+
return /* @__PURE__ */ t.createElement(
|
|
1986
|
+
Fe,
|
|
1987
|
+
{
|
|
1988
|
+
ref: g,
|
|
1989
|
+
slotWidth: n,
|
|
1990
|
+
slotLevels: v,
|
|
1991
|
+
timelineHeaderCell: l
|
|
1992
|
+
}
|
|
1993
|
+
);
|
|
1994
|
+
}), Jo = ({ tasksStart: e, tasksEnd: a, timezone: n }) => {
|
|
1995
|
+
const o = S.fromLocalDate(e, n), r = S.fromLocalDate(a, n), l = mn(o), s = Dt(r), c = S.fromUTCDate(se(l), n), m = S.fromUTCDate(se(s), n);
|
|
1996
|
+
return {
|
|
1997
|
+
// Sat May 31 2014 07:00:00 GMT+0300 (Eastern European Summer Time)
|
|
1998
|
+
start: new Date(c.getTime()),
|
|
1999
|
+
end: new Date(m.getTime()),
|
|
2000
|
+
// Sat May 31 2014 00:00:00 GMT-0400 (EDT)
|
|
2001
|
+
zonedStart: c,
|
|
2002
|
+
zonedEnd: m
|
|
2003
|
+
};
|
|
2004
|
+
}, me = {
|
|
2005
|
+
name: "day",
|
|
2006
|
+
dateRange: Jo,
|
|
2007
|
+
title: (e) => e.toLanguageString(it, ne[it]),
|
|
2008
|
+
slotWidth: Ie,
|
|
2009
|
+
slotDuration: 60,
|
|
2010
|
+
workWeekStart: 1,
|
|
2011
|
+
workWeekEnd: 5,
|
|
2012
|
+
workDayStart: "08:00",
|
|
2013
|
+
workDayEnd: "17:00"
|
|
2014
|
+
};
|
|
2015
|
+
Ot.defaultProps = me;
|
|
2016
|
+
Ot.propTypes = {
|
|
2017
|
+
name: i.string,
|
|
2018
|
+
dateRange: i.oneOfType([i.func, i.object]),
|
|
2019
|
+
title: i.oneOfType([i.string, i.func]),
|
|
2020
|
+
slotWidth: i.number,
|
|
2021
|
+
slotDuration: i.number,
|
|
2022
|
+
workWeekStart: i.number,
|
|
2023
|
+
workWeekEnd: i.number,
|
|
2024
|
+
workDayStart: i.string,
|
|
2025
|
+
workDayEnd: i.string
|
|
2026
|
+
};
|
|
2027
|
+
Ot.displayName = "KendoReactGanttDayView";
|
|
2028
|
+
const Pt = t.forwardRef((e, a) => {
|
|
2029
|
+
const { slotWidth: n = ua.slotWidth, firstSlotRangeRef: o, timelineHeaderCell: r } = e, { timezone: l } = Ne(), s = xe(), c = t.useRef(null), m = t.useRef(null), g = t.useCallback(
|
|
2030
|
+
(h) => {
|
|
2031
|
+
m.current && m.current.scrollIntoView(h);
|
|
2032
|
+
},
|
|
2033
|
+
[]
|
|
2034
|
+
);
|
|
2035
|
+
t.useImperativeHandle(c, () => ({ scrollIntoView: g })), t.useImperativeHandle(a, () => c.current);
|
|
2036
|
+
const d = Me(), u = t.useMemo(
|
|
2037
|
+
() => {
|
|
2038
|
+
const h = [], p = Cn(d, { timezone: l }, s);
|
|
2039
|
+
return p.forEach((C) => {
|
|
2040
|
+
const f = pn(
|
|
2041
|
+
C.range,
|
|
2042
|
+
{ timezone: l },
|
|
2043
|
+
s
|
|
2044
|
+
);
|
|
2045
|
+
h.push.apply(h, f);
|
|
2046
|
+
}), o && h[0] && (o.current = h[0].range), [p, h];
|
|
2047
|
+
},
|
|
2048
|
+
[l, d.start.getTime(), d.end.getTime(), s]
|
|
2049
|
+
);
|
|
2050
|
+
return /* @__PURE__ */ t.createElement(
|
|
2051
|
+
Fe,
|
|
2052
|
+
{
|
|
2053
|
+
ref: m,
|
|
2054
|
+
slotWidth: n,
|
|
2055
|
+
slotLevels: u,
|
|
2056
|
+
timelineHeaderCell: r
|
|
2057
|
+
}
|
|
2058
|
+
);
|
|
2059
|
+
}), Qo = ({ tasksStart: e, tasksEnd: a, timezone: n }) => {
|
|
2060
|
+
const o = S.fromLocalDate(e, n), r = S.fromLocalDate(a, n), l = en(oe(o)), s = ht(tn(oe(r)), 1), c = S.fromUTCDate(se(l), n), m = S.fromUTCDate(se(s), n);
|
|
2061
|
+
return {
|
|
2062
|
+
start: new Date(c.getTime()),
|
|
2063
|
+
end: new Date(m.getTime()),
|
|
2064
|
+
zonedStart: c,
|
|
2065
|
+
zonedEnd: m
|
|
2066
|
+
};
|
|
2067
|
+
}, ua = {
|
|
2068
|
+
name: "month",
|
|
2069
|
+
dateRange: Qo,
|
|
2070
|
+
title: (e) => e.toLanguageString(ct, ne[ct]),
|
|
2071
|
+
slotWidth: Ie,
|
|
2072
|
+
workWeekStart: 1,
|
|
2073
|
+
workWeekEnd: 5,
|
|
2074
|
+
workDayStart: "08:00",
|
|
2075
|
+
workDayEnd: "17:00"
|
|
2076
|
+
};
|
|
2077
|
+
Pt.defaultProps = ua;
|
|
2078
|
+
Pt.propTypes = {
|
|
2079
|
+
name: i.string,
|
|
2080
|
+
dateRange: i.oneOfType([i.func, i.object]),
|
|
2081
|
+
title: i.oneOfType([i.string, i.func]),
|
|
2082
|
+
slotWidth: i.number,
|
|
2083
|
+
workWeekStart: i.number,
|
|
2084
|
+
workWeekEnd: i.number,
|
|
2085
|
+
workDayStart: i.string,
|
|
2086
|
+
workDayEnd: i.string
|
|
2087
|
+
};
|
|
2088
|
+
Pt.displayName = "GanttMonthView";
|
|
2089
|
+
const _t = t.forwardRef((e, a) => {
|
|
2090
|
+
const { slotWidth: n = ma.slotWidth, firstSlotRangeRef: o, timelineHeaderCell: r } = e, { timezone: l } = Ne(), s = xe(), c = t.useRef(null), m = t.useRef(null), g = t.useCallback(
|
|
2091
|
+
(h) => {
|
|
2092
|
+
m.current && m.current.scrollIntoView(h);
|
|
2093
|
+
},
|
|
2094
|
+
[]
|
|
2095
|
+
);
|
|
2096
|
+
t.useImperativeHandle(c, () => ({ scrollIntoView: g })), t.useImperativeHandle(a, () => c.current);
|
|
2097
|
+
const d = Me(), u = t.useMemo(
|
|
2098
|
+
() => {
|
|
2099
|
+
const h = Ho(d, { timezone: l }, s), p = [];
|
|
2100
|
+
return h.forEach((C) => {
|
|
2101
|
+
const f = Cn(
|
|
2102
|
+
C.range,
|
|
2103
|
+
{ timezone: l },
|
|
2104
|
+
s
|
|
2105
|
+
);
|
|
2106
|
+
p.push.apply(p, f);
|
|
2107
|
+
}), o && p[0] && (o.current = p[0].range), [h, p];
|
|
2108
|
+
},
|
|
2109
|
+
[l, d.start.getTime(), d.end.getTime(), s]
|
|
2110
|
+
);
|
|
2111
|
+
return /* @__PURE__ */ t.createElement(
|
|
2112
|
+
Fe,
|
|
2113
|
+
{
|
|
2114
|
+
slotWidth: n,
|
|
2115
|
+
slotLevels: u,
|
|
2116
|
+
timelineHeaderCell: r
|
|
2117
|
+
}
|
|
2118
|
+
);
|
|
2119
|
+
}), es = ({ tasksStart: e, tasksEnd: a, timezone: n }) => {
|
|
2120
|
+
const o = S.fromLocalDate(e, n), r = S.fromLocalDate(a, n), l = en(xa(oe(o))), s = ht(tn(Ia(oe(r))), 1), c = S.fromUTCDate(se(l), n), m = S.fromUTCDate(se(s), n);
|
|
2121
|
+
return {
|
|
2122
|
+
start: new Date(c.getTime()),
|
|
2123
|
+
end: new Date(m.getTime()),
|
|
2124
|
+
zonedStart: c,
|
|
2125
|
+
zonedEnd: m
|
|
2126
|
+
};
|
|
2127
|
+
}, ma = {
|
|
2128
|
+
name: "year",
|
|
2129
|
+
dateRange: es,
|
|
2130
|
+
title: (e) => e.toLanguageString(dt, ne[dt]),
|
|
2131
|
+
slotWidth: Ie
|
|
2132
|
+
};
|
|
2133
|
+
_t.defaultProps = ma;
|
|
2134
|
+
_t.propTypes = {
|
|
2135
|
+
name: i.string,
|
|
2136
|
+
dateRange: i.oneOfType([i.func, i.object]),
|
|
2137
|
+
title: i.oneOfType([i.string, i.func]),
|
|
2138
|
+
slotWidth: i.number
|
|
2139
|
+
};
|
|
2140
|
+
_t.displayName = "GanttYearView";
|
|
2141
|
+
const ts = [
|
|
2142
|
+
{ text: Nn, operator: "contains" },
|
|
2143
|
+
{ text: Mn, operator: "doesnotcontain" },
|
|
2144
|
+
{ text: Pe, operator: "eq" },
|
|
2145
|
+
{ text: _e, operator: "neq" },
|
|
2146
|
+
{ text: In, operator: "startswith" },
|
|
2147
|
+
{ text: Fn, operator: "endswith" },
|
|
2148
|
+
{ text: Ke, operator: "isnull" },
|
|
2149
|
+
{ text: Be, operator: "isnotnull" },
|
|
2150
|
+
{ text: Sn, operator: "isempty" },
|
|
2151
|
+
{ text: xn, operator: "isnotempty" }
|
|
2152
|
+
], ns = [
|
|
2153
|
+
{ text: Pe, operator: "eq" },
|
|
2154
|
+
{ text: _e, operator: "neq" },
|
|
2155
|
+
{ text: Ln, operator: "gte" },
|
|
2156
|
+
{ text: Hn, operator: "gt" },
|
|
2157
|
+
{ text: An, operator: "lte" },
|
|
2158
|
+
{ text: Vn, operator: "lt" },
|
|
2159
|
+
{ text: Ke, operator: "isnull" },
|
|
2160
|
+
{ text: Be, operator: "isnotnull" }
|
|
2161
|
+
], as = [
|
|
2162
|
+
{ text: Pe, operator: "eq" },
|
|
2163
|
+
{ text: _e, operator: "neq" },
|
|
2164
|
+
{ text: On, operator: "gte" },
|
|
2165
|
+
{ text: Pn, operator: "gt" },
|
|
2166
|
+
{ text: _n, operator: "lt" },
|
|
2167
|
+
{ text: Kn, operator: "lte" },
|
|
2168
|
+
{ text: Ke, operator: "isnull" },
|
|
2169
|
+
{ text: Be, operator: "isnotnull" }
|
|
2170
|
+
], os = [
|
|
2171
|
+
{ text: Wn, operator: "" },
|
|
2172
|
+
{ text: zn, operator: !0 },
|
|
2173
|
+
{ text: Gn, operator: !1 }
|
|
2174
|
+
];
|
|
2175
|
+
function Ue(e, a) {
|
|
2176
|
+
return {
|
|
2177
|
+
clearButtonTitle: e.toLanguageString(ut, ne[ut]),
|
|
2178
|
+
operators: a.map((n) => ({
|
|
2179
|
+
text: e.toLanguageString(n.text, ne[n.text]),
|
|
2180
|
+
operator: n.operator
|
|
2181
|
+
}))
|
|
2182
|
+
};
|
|
2183
|
+
}
|
|
2184
|
+
const ss = (e) => {
|
|
2185
|
+
const { operators: a, ...n } = e;
|
|
2186
|
+
return /* @__PURE__ */ t.createElement(
|
|
2187
|
+
qa,
|
|
2188
|
+
{
|
|
2189
|
+
ariaLabel: "text filter",
|
|
2190
|
+
...Ue(ae(), a || ts),
|
|
2191
|
+
...n
|
|
2192
|
+
}
|
|
2193
|
+
);
|
|
2194
|
+
};
|
|
2195
|
+
ss.displayName = "KendoReactGanttTextFilter";
|
|
2196
|
+
const rs = (e) => {
|
|
2197
|
+
const { operators: a, ...n } = e;
|
|
2198
|
+
return /* @__PURE__ */ t.createElement(
|
|
2199
|
+
Xa,
|
|
2200
|
+
{
|
|
2201
|
+
ariaLabel: "numeric filter",
|
|
2202
|
+
...Ue(ae(), a || ns),
|
|
2203
|
+
...n
|
|
2204
|
+
}
|
|
2205
|
+
);
|
|
2206
|
+
};
|
|
2207
|
+
rs.displayName = "KendoReactGanttNumericFilter";
|
|
2208
|
+
const ls = (e) => {
|
|
2209
|
+
const { operators: a, ...n } = e;
|
|
2210
|
+
return /* @__PURE__ */ t.createElement(
|
|
2211
|
+
ja,
|
|
2212
|
+
{
|
|
2213
|
+
ariaLabel: "boolean filter",
|
|
2214
|
+
...Ue(ae(), a || os),
|
|
2215
|
+
...n
|
|
2216
|
+
}
|
|
2217
|
+
);
|
|
2218
|
+
};
|
|
2219
|
+
ls.displayName = "KendoReactGanttBooleanFilter";
|
|
2220
|
+
const is = (e) => {
|
|
2221
|
+
const { operators: a, ...n } = e;
|
|
2222
|
+
return /* @__PURE__ */ t.createElement(
|
|
2223
|
+
Za,
|
|
2224
|
+
{
|
|
2225
|
+
ariaLabel: "date filter",
|
|
2226
|
+
...Ue(ae(), a || as),
|
|
2227
|
+
...n
|
|
2228
|
+
}
|
|
2229
|
+
);
|
|
2230
|
+
};
|
|
2231
|
+
is.displayName = "KendoReactGanttDateFilter";
|
|
2232
|
+
const Fs = (e) => {
|
|
2233
|
+
const { dependencyData: a, dependencyModelFields: n, defaultDataItem: o, fromId: r, toId: l, type: s } = e, c = a.map((h) => ({ ...h })), m = ee(n.fromId), g = ee(n.toId), d = ee(n.type), u = o ? { ...o } : {};
|
|
2234
|
+
return m(u, r), g(u, l), d(u, s), c.push(u), c;
|
|
2235
|
+
}, Ls = (e) => {
|
|
2236
|
+
const { defaultDataItem: a, selectedDataItem: n, direction: o, taskModelFields: r, dataTree: l, slotStart: s, slotEnd: c } = e, m = Et(l, r.children, (f) => ({ ...f })), g = ee(r.start), d = ee(r.end), u = D(r.start), h = D(r.end), p = a ? { ...a } : {}, C = u(p) && h(p);
|
|
2237
|
+
if (!n || o === "none")
|
|
2238
|
+
C || (g(p, s), d(p, c)), m.unshift(p);
|
|
2239
|
+
else {
|
|
2240
|
+
const f = [{
|
|
2241
|
+
task: { [r.children]: m },
|
|
2242
|
+
childrenIndex: 0
|
|
2243
|
+
}], v = D(r.id), L = D(r.children), V = ee(r.children), M = v(n);
|
|
2244
|
+
for (; f.length > 0; ) {
|
|
2245
|
+
const x = f[f.length - 1], z = x.task, J = v(z), R = L(z);
|
|
2246
|
+
if (J && J === M)
|
|
2247
|
+
break;
|
|
2248
|
+
R && R.length && R.length > x.childrenIndex ? (f.push({
|
|
2249
|
+
task: R[x.childrenIndex],
|
|
2250
|
+
childrenIndex: 0
|
|
2251
|
+
}), x.childrenIndex++) : f.pop();
|
|
2252
|
+
}
|
|
2253
|
+
if (f.length > 1) {
|
|
2254
|
+
const x = f[f.length - 1].task, z = f[f.length - 2].childrenIndex, R = f[f.length - 2].task, X = L(R);
|
|
2255
|
+
switch (o) {
|
|
2256
|
+
case "child": {
|
|
2257
|
+
let A = L(x);
|
|
2258
|
+
A || (A = [], V(x, A)), C || (g(p, new Date(u(x).getTime())), d(p, new Date(h(x).getTime()))), A.push(p), Ve(f.splice(1, f.length - 1).map((j) => j.task), r);
|
|
2259
|
+
break;
|
|
2260
|
+
}
|
|
2261
|
+
case "above": {
|
|
2262
|
+
u(R) && h(R) && !C ? (g(p, new Date(u(x).getTime())), d(p, new Date(h(x).getTime()))) : (g(p, s), d(p, c)), X.splice(z - 1, 0, p), Ve(f.splice(1, f.length - 2).map((A) => A.task), r);
|
|
2263
|
+
break;
|
|
2264
|
+
}
|
|
2265
|
+
case "below": {
|
|
2266
|
+
u(R) && h(R) && !C ? (g(p, new Date(u(x).getTime())), d(p, new Date(h(x).getTime()))) : (g(p, s), d(p, c)), X.splice(z, 0, p), Ve(f.splice(1, f.length - 2).map((A) => A.task), r);
|
|
2267
|
+
break;
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
return m;
|
|
2273
|
+
}, Hs = (e) => {
|
|
2274
|
+
const { updatedDataItem: a, taskModelFields: n, dataTree: o } = e, r = D(n.id), l = D(n.children), s = r(a);
|
|
2275
|
+
let c;
|
|
2276
|
+
const m = Et(o, n.children, (d) => r(d) === s ? (c = d, { ...a }) : { ...d });
|
|
2277
|
+
let g = [{
|
|
2278
|
+
task: { [n.children]: m },
|
|
2279
|
+
childrenIndex: 0
|
|
2280
|
+
}];
|
|
2281
|
+
for (; g.length > 0; ) {
|
|
2282
|
+
const d = g[g.length - 1], u = d.task, h = r(u), p = l(u);
|
|
2283
|
+
if (h && h === s)
|
|
2284
|
+
break;
|
|
2285
|
+
p && p.length && p.length > d.childrenIndex ? (g.push({
|
|
2286
|
+
task: p[d.childrenIndex],
|
|
2287
|
+
childrenIndex: 0
|
|
2288
|
+
}), d.childrenIndex++) : g.pop();
|
|
2289
|
+
}
|
|
2290
|
+
if (g.length > 1) {
|
|
2291
|
+
g = g.splice(1, g.length - 2);
|
|
2292
|
+
const d = D(n.start), u = D(n.end), h = D(n.percentComplete);
|
|
2293
|
+
if (d(c).getTime() !== d(a).getTime()) {
|
|
2294
|
+
ga(g.map((C) => C.task), n);
|
|
2295
|
+
const p = d(a).getTime() - d(c).getTime();
|
|
2296
|
+
cs(l(a), n, p);
|
|
2297
|
+
}
|
|
2298
|
+
u(c).getTime() !== u(a).getTime() && ha(g.map((p) => p.task), n), h(c) !== h(a) && fa(g.map((p) => p.task), n);
|
|
2299
|
+
}
|
|
2300
|
+
return m;
|
|
2301
|
+
}, As = (e) => {
|
|
2302
|
+
const { removedDataItem: a, taskModelFields: n, dataTree: o } = e, r = Et(o, n.children, (g) => ({ ...g }));
|
|
2303
|
+
let l = [{
|
|
2304
|
+
task: { [n.children]: r },
|
|
2305
|
+
childrenIndex: 0
|
|
2306
|
+
}];
|
|
2307
|
+
const s = D(n.id), c = D(n.children), m = s(a);
|
|
2308
|
+
for (; l.length > 0; ) {
|
|
2309
|
+
const g = l[l.length - 1], d = g.task, u = s(d), h = c(d);
|
|
2310
|
+
if (u && u === m)
|
|
2311
|
+
break;
|
|
2312
|
+
h && h.length && h.length > g.childrenIndex ? (l.push({
|
|
2313
|
+
task: h[g.childrenIndex],
|
|
2314
|
+
childrenIndex: 0
|
|
2315
|
+
}), g.childrenIndex++) : l.pop();
|
|
2316
|
+
}
|
|
2317
|
+
if (l.length > 1) {
|
|
2318
|
+
const g = l[l.length - 2], d = g.task;
|
|
2319
|
+
c(d).splice(g.childrenIndex - 1, 1), l = l.splice(1, l.length - 2), Ve(l.map((h) => h.task), n);
|
|
2320
|
+
}
|
|
2321
|
+
return r;
|
|
2322
|
+
}, Ve = (e, a) => {
|
|
2323
|
+
ga(e, a), ha(e, a), fa(e, a);
|
|
2324
|
+
}, ga = (e, a) => {
|
|
2325
|
+
if (!e.length)
|
|
2326
|
+
return;
|
|
2327
|
+
const n = D(a.children), o = D(a.start), r = ee(a.start);
|
|
2328
|
+
for (let l = e.length - 1; l >= 0; l--) {
|
|
2329
|
+
const s = e[l], c = n(s);
|
|
2330
|
+
if (c && c.length) {
|
|
2331
|
+
const m = c.reduce(
|
|
2332
|
+
(g, d) => Math.min(g, o(d).getTime()),
|
|
2333
|
+
o(c[0]).getTime()
|
|
2334
|
+
);
|
|
2335
|
+
r(s, new Date(m));
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
}, ha = (e, a) => {
|
|
2339
|
+
if (!e.length)
|
|
2340
|
+
return;
|
|
2341
|
+
const n = D(a.children), o = D(a.end), r = ee(a.end);
|
|
2342
|
+
for (let l = e.length - 1; l >= 0; l--) {
|
|
2343
|
+
const s = e[l], c = n(s);
|
|
2344
|
+
if (c && c.length) {
|
|
2345
|
+
const m = c.reduce(
|
|
2346
|
+
(g, d) => Math.max(g, o(d).getTime()),
|
|
2347
|
+
o(c[0]).getTime()
|
|
2348
|
+
);
|
|
2349
|
+
r(s, new Date(m));
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
}, fa = (e, a) => {
|
|
2353
|
+
if (!e.length)
|
|
2354
|
+
return;
|
|
2355
|
+
const n = D(a.children), o = D(a.percentComplete), r = ee(a.percentComplete), l = ({ avg: s, n: c }, m) => ({
|
|
2356
|
+
avg: ((o(m) || 0) + c * s) / (c + 1),
|
|
2357
|
+
n: c + 1
|
|
2358
|
+
});
|
|
2359
|
+
for (let s = e.length - 1; s >= 0; s--) {
|
|
2360
|
+
const c = e[s], m = n(c);
|
|
2361
|
+
if (m && m.length) {
|
|
2362
|
+
const g = m.reduce(l, { avg: 0, n: 0 }).avg;
|
|
2363
|
+
r(c, g);
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
}, cs = (e, a, n) => {
|
|
2367
|
+
if (!e)
|
|
2368
|
+
return;
|
|
2369
|
+
const o = D(a.children), r = D(a.start), l = ee(a.start), s = D(a.end), c = ee(a.end), m = e.map((g) => ({ task: g, childrenIndex: 0 }));
|
|
2370
|
+
for (; m.length > 0; ) {
|
|
2371
|
+
const g = m[m.length - 1], d = g.task, u = o(d);
|
|
2372
|
+
u && u.length && u.length > g.childrenIndex ? (m.push({
|
|
2373
|
+
task: u[g.childrenIndex],
|
|
2374
|
+
childrenIndex: 0
|
|
2375
|
+
}), g.childrenIndex++) : (m.pop(), l(d, new Date(r(d).getTime() + n)), c(d, new Date(s(d).getTime() + n)));
|
|
2376
|
+
}
|
|
2377
|
+
}, ds = (e) => {
|
|
2378
|
+
const { validationMessage: a, touched: n, label: o, id: r, valid: l, disabled: s, hint: c, type: m, optional: g, ...d } = e, u = n && a, h = !u && c, p = h ? `${r}_hint` : "", C = u ? `${r}_error` : "";
|
|
2379
|
+
return /* @__PURE__ */ t.createElement(ft, null, /* @__PURE__ */ t.createElement(pt, { editorId: r, editorValid: l, editorDisabled: s, optional: g }, o), /* @__PURE__ */ t.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ t.createElement(
|
|
2380
|
+
ho,
|
|
2381
|
+
{
|
|
2382
|
+
valid: l,
|
|
2383
|
+
type: m,
|
|
2384
|
+
id: r,
|
|
2385
|
+
disabled: s,
|
|
2386
|
+
ariaDescribedBy: `${p} ${C}`,
|
|
2387
|
+
...d
|
|
2388
|
+
}
|
|
2389
|
+
), h && /* @__PURE__ */ t.createElement(Ct, { id: p }, c), u && /* @__PURE__ */ t.createElement(kt, { id: C }, a)));
|
|
2390
|
+
}, Zt = (e) => {
|
|
2391
|
+
const { validationMessage: a, touched: n, label: o, id: r, valid: l, disabled: s, hint: c, wrapperStyle: m, ...g } = e, d = n && a, u = !d && c, h = u ? `${r}_hint` : "", p = d ? `${r}_error` : "", C = o ? `${r}_label` : "";
|
|
2392
|
+
return /* @__PURE__ */ t.createElement(ft, { style: m }, /* @__PURE__ */ t.createElement(pt, { id: C, editorId: r, editorValid: l, editorDisabled: s }, o), /* @__PURE__ */ t.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ t.createElement(
|
|
2393
|
+
po,
|
|
2394
|
+
{
|
|
2395
|
+
ariaLabelledBy: C,
|
|
2396
|
+
ariaDescribedBy: `${h} ${p}`,
|
|
2397
|
+
valid: l,
|
|
2398
|
+
id: r,
|
|
2399
|
+
disabled: s,
|
|
2400
|
+
...g
|
|
2401
|
+
}
|
|
2402
|
+
), u && /* @__PURE__ */ t.createElement(Ct, { id: h }, c), d && /* @__PURE__ */ t.createElement(kt, { id: p }, a)));
|
|
2403
|
+
}, us = (e) => {
|
|
2404
|
+
const { validationMessage: a, touched: n, label: o, id: r, valid: l, disabled: s, hint: c, ...m } = e, g = n && a, d = !g && c, u = d ? `${r}_hint` : "", h = g ? `${r}_error` : "";
|
|
2405
|
+
return /* @__PURE__ */ t.createElement(ft, null, /* @__PURE__ */ t.createElement(pt, { editorId: r, editorValid: l, editorDisabled: s }, o), /* @__PURE__ */ t.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ t.createElement(
|
|
2406
|
+
fo,
|
|
2407
|
+
{
|
|
2408
|
+
ariaDescribedBy: `${u} ${h}`,
|
|
2409
|
+
valid: l,
|
|
2410
|
+
id: r,
|
|
2411
|
+
disabled: s,
|
|
2412
|
+
...m
|
|
2413
|
+
}
|
|
2414
|
+
), d && /* @__PURE__ */ t.createElement(Ct, { id: u }, c), g && /* @__PURE__ */ t.createElement(kt, { id: h }, a)));
|
|
2415
|
+
}, ms = () => {
|
|
2416
|
+
const e = Tt(), a = ae(), n = (f) => a.toLanguageString(f, ne[f]), o = n(Un), r = n(Yn), l = n(qn), s = n(Xn), c = n(jn), m = n(Zn), g = n(Jn), d = t.useCallback(
|
|
2417
|
+
(f) => f || f === 0 ? void 0 : c,
|
|
2418
|
+
[c]
|
|
2419
|
+
), u = t.useCallback(
|
|
2420
|
+
(f, v) => f && v(e.end) && f.getTime() > v(e.end).getTime() ? m : void 0,
|
|
2421
|
+
[e, m]
|
|
2422
|
+
), h = t.useCallback(
|
|
2423
|
+
(f, v) => f && v(e.start) && f.getTime() < v(e.start).getTime() ? g : void 0,
|
|
2424
|
+
[e, g]
|
|
2425
|
+
), p = t.useMemo(
|
|
2426
|
+
() => [d, u],
|
|
2427
|
+
[d, u]
|
|
2428
|
+
), C = t.useMemo(
|
|
2429
|
+
() => [d, h],
|
|
2430
|
+
[d, h]
|
|
2431
|
+
);
|
|
2432
|
+
return /* @__PURE__ */ t.createElement(mo, { style: { width: 400 }, horizontal: !0 }, /* @__PURE__ */ t.createElement(
|
|
2433
|
+
He,
|
|
2434
|
+
{
|
|
2435
|
+
id: `${e.title}_gantteditor`,
|
|
2436
|
+
name: e.title,
|
|
2437
|
+
label: o,
|
|
2438
|
+
component: ds,
|
|
2439
|
+
validator: d
|
|
2440
|
+
}
|
|
2441
|
+
), /* @__PURE__ */ t.createElement(
|
|
2442
|
+
He,
|
|
2443
|
+
{
|
|
2444
|
+
id: `${e.start}_gantteditor`,
|
|
2445
|
+
name: e.start,
|
|
2446
|
+
label: r,
|
|
2447
|
+
component: Zt,
|
|
2448
|
+
validator: p
|
|
2449
|
+
}
|
|
2450
|
+
), /* @__PURE__ */ t.createElement(
|
|
2451
|
+
He,
|
|
2452
|
+
{
|
|
2453
|
+
id: `${e.end}_gantteditor`,
|
|
2454
|
+
name: e.end,
|
|
2455
|
+
label: l,
|
|
2456
|
+
component: Zt,
|
|
2457
|
+
validator: C
|
|
2458
|
+
}
|
|
2459
|
+
), /* @__PURE__ */ t.createElement(
|
|
2460
|
+
He,
|
|
2461
|
+
{
|
|
2462
|
+
id: `${e.percentComplete}_gantteditor`,
|
|
2463
|
+
name: e.percentComplete,
|
|
2464
|
+
format: "p",
|
|
2465
|
+
label: s,
|
|
2466
|
+
component: us,
|
|
2467
|
+
step: 0.01,
|
|
2468
|
+
validator: d
|
|
2469
|
+
}
|
|
2470
|
+
));
|
|
2471
|
+
}, Vs = (e) => {
|
|
2472
|
+
const { onCancel: a, onClose: n, onSubmit: o, ...r } = e, l = ae(), s = (C) => l.toLanguageString(C, ne[C]), c = s(Bn), m = s(Gt), g = s($n), d = t.useCallback(
|
|
2473
|
+
(C) => {
|
|
2474
|
+
if (a) {
|
|
2475
|
+
const f = { syntheticEvent: C, nativeEvent: C.nativeEvent, dataItem: e.dataItem };
|
|
2476
|
+
a.call(void 0, f);
|
|
2477
|
+
}
|
|
2478
|
+
},
|
|
2479
|
+
[a, e.dataItem]
|
|
2480
|
+
), u = t.useCallback(
|
|
2481
|
+
({ syntheticEvent: C }) => {
|
|
2482
|
+
if (n) {
|
|
2483
|
+
const f = { syntheticEvent: C, nativeEvent: C.nativeEvent, dataItem: e.dataItem };
|
|
2484
|
+
n.call(void 0, f);
|
|
2485
|
+
}
|
|
2486
|
+
},
|
|
2487
|
+
[n, e.dataItem]
|
|
2488
|
+
), h = t.useCallback(
|
|
2489
|
+
(C, f) => {
|
|
2490
|
+
if (o) {
|
|
2491
|
+
const v = { dataItem: C, syntheticEvent: f, nativeEvent: f && f.nativeEvent };
|
|
2492
|
+
o.call(void 0, v);
|
|
2493
|
+
}
|
|
2494
|
+
},
|
|
2495
|
+
[o]
|
|
2496
|
+
), p = /* @__PURE__ */ t.createElement(
|
|
2497
|
+
go,
|
|
2498
|
+
{
|
|
2499
|
+
initialValues: e.dataItem,
|
|
2500
|
+
onSubmit: h,
|
|
2501
|
+
render: (C) => /* @__PURE__ */ t.createElement(
|
|
2502
|
+
rn,
|
|
2503
|
+
{
|
|
2504
|
+
title: g,
|
|
2505
|
+
minWidth: 600,
|
|
2506
|
+
onClose: u,
|
|
2507
|
+
style: { zIndex: 90 }
|
|
2508
|
+
},
|
|
2509
|
+
/* @__PURE__ */ t.createElement(ms, null),
|
|
2510
|
+
/* @__PURE__ */ t.createElement(ln, null, /* @__PURE__ */ t.createElement(
|
|
2511
|
+
ze,
|
|
2512
|
+
{
|
|
2513
|
+
disabled: !C.allowSubmit,
|
|
2514
|
+
onClick: C.onSubmit
|
|
2515
|
+
},
|
|
2516
|
+
c
|
|
2517
|
+
), /* @__PURE__ */ t.createElement(ze, { onClick: d }, m))
|
|
2518
|
+
),
|
|
2519
|
+
...r
|
|
2520
|
+
}
|
|
2521
|
+
);
|
|
2522
|
+
return gt ? sn.createPortal(p, document && document.body) : null;
|
|
2523
|
+
}, zs = (e) => {
|
|
2524
|
+
const { onClose: a, onCancel: n, onConfirm: o, dataItem: r } = e, l = ae(), s = (f) => l.toLanguageString(f, ne[f]), c = s(aa), m = s(Gt), g = s(oa), d = s(sa), u = t.useCallback(
|
|
2525
|
+
({ syntheticEvent: f }) => {
|
|
2526
|
+
a && a.call(void 0, {
|
|
2527
|
+
syntheticEvent: f,
|
|
2528
|
+
nativeEvent: f && f.nativeEvent,
|
|
2529
|
+
dataItem: null
|
|
2530
|
+
});
|
|
2531
|
+
},
|
|
2532
|
+
[a]
|
|
2533
|
+
), h = t.useCallback(
|
|
2534
|
+
(f) => {
|
|
2535
|
+
n && n.call(void 0, {
|
|
2536
|
+
syntheticEvent: f,
|
|
2537
|
+
nativeEvent: f && f.nativeEvent,
|
|
2538
|
+
dataItem: null
|
|
2539
|
+
});
|
|
2540
|
+
},
|
|
2541
|
+
[n]
|
|
2542
|
+
), p = t.useCallback(
|
|
2543
|
+
(f) => {
|
|
2544
|
+
o && o.call(void 0, {
|
|
2545
|
+
syntheticEvent: f,
|
|
2546
|
+
nativeEvent: f && f.nativeEvent,
|
|
2547
|
+
dataItem: r
|
|
2548
|
+
});
|
|
2549
|
+
},
|
|
2550
|
+
[o, r]
|
|
2551
|
+
), C = /* @__PURE__ */ t.createElement(rn, { title: d, onClose: u }, g, /* @__PURE__ */ t.createElement(ln, null, /* @__PURE__ */ t.createElement("button", { className: "k-button", onClick: h }, m), /* @__PURE__ */ t.createElement("button", { className: "k-button", onClick: p }, c)));
|
|
2552
|
+
return gt ? sn.createPortal(C, document && document.body) : null;
|
|
2553
|
+
}, Gs = an;
|
|
2554
|
+
export {
|
|
2555
|
+
Rs as GANTT_COL_INDEX_ATTRIBUTE,
|
|
2556
|
+
Ss as GANTT_PREVENT_SELECTION_ELEMENT,
|
|
2557
|
+
bs as GANTT_ROW_INDEX_ATTRIBUTE,
|
|
2558
|
+
Wt as Gantt,
|
|
2559
|
+
ls as GanttBooleanFilter,
|
|
2560
|
+
is as GanttDateFilter,
|
|
2561
|
+
Ot as GanttDayView,
|
|
2562
|
+
Vs as GanttForm,
|
|
2563
|
+
Pt as GanttMonthView,
|
|
2564
|
+
rs as GanttNumericFilter,
|
|
2565
|
+
zs as GanttRemoveDialog,
|
|
2566
|
+
Gs as GanttRow,
|
|
2567
|
+
ss as GanttTextFilter,
|
|
2568
|
+
$e as GanttWeekView,
|
|
2569
|
+
_t as GanttYearView,
|
|
2570
|
+
Fs as addDependency,
|
|
2571
|
+
Ls as addTask,
|
|
2572
|
+
Ms as createDataTree,
|
|
2573
|
+
Ns as extendDataItem,
|
|
2574
|
+
Is as filterBy,
|
|
2575
|
+
Ps as getSelectedState,
|
|
2576
|
+
_s as getSelectedStateFromKeyDown,
|
|
2577
|
+
Et as mapTree,
|
|
2578
|
+
xs as orderBy,
|
|
2579
|
+
As as removeTask,
|
|
2580
|
+
Ks as setSelectedState,
|
|
2581
|
+
Hs as updateTask
|
|
2582
|
+
};
|